summaryrefslogtreecommitdiffstats
path: root/contrib/libs/grpc/src
diff options
context:
space:
mode:
authorheretic <[email protected]>2022-02-10 16:45:46 +0300
committerDaniil Cherednik <[email protected]>2022-02-10 16:45:46 +0300
commit81eddc8c0b55990194e112b02d127b87d54164a9 (patch)
tree9142afc54d335ea52910662635b898e79e192e49 /contrib/libs/grpc/src
parent397cbe258b9e064f49c4ca575279f02f39fef76e (diff)
Restoring authorship annotation for <[email protected]>. Commit 2 of 2.
Diffstat (limited to 'contrib/libs/grpc/src')
-rw-r--r--contrib/libs/grpc/src/compiler/config.h16
-rw-r--r--contrib/libs/grpc/src/compiler/cpp_generator.cc950
-rw-r--r--contrib/libs/grpc/src/compiler/cpp_generator.h88
-rw-r--r--contrib/libs/grpc/src/compiler/cpp_generator_helpers.h14
-rw-r--r--contrib/libs/grpc/src/compiler/cpp_plugin.h36
-rw-r--r--contrib/libs/grpc/src/compiler/csharp_generator.cc188
-rw-r--r--contrib/libs/grpc/src/compiler/csharp_generator.h6
-rw-r--r--contrib/libs/grpc/src/compiler/csharp_generator_helpers.h4
-rw-r--r--contrib/libs/grpc/src/compiler/generator_helpers.h80
-rw-r--r--contrib/libs/grpc/src/compiler/grpc_cpp_plugin/ya.make12
-rw-r--r--contrib/libs/grpc/src/compiler/grpc_plugin_support/ya.make12
-rw-r--r--contrib/libs/grpc/src/compiler/grpc_python_plugin/ya.make12
-rw-r--r--contrib/libs/grpc/src/compiler/node_generator.cc54
-rw-r--r--contrib/libs/grpc/src/compiler/node_generator.h4
-rw-r--r--contrib/libs/grpc/src/compiler/node_generator_helpers.h4
-rw-r--r--contrib/libs/grpc/src/compiler/objective_c_generator.cc70
-rw-r--r--contrib/libs/grpc/src/compiler/objective_c_generator.h2
-rw-r--r--contrib/libs/grpc/src/compiler/objective_c_generator_helpers.h56
-rw-r--r--contrib/libs/grpc/src/compiler/php_generator.cc62
-rw-r--r--contrib/libs/grpc/src/compiler/php_generator_helpers.h20
-rw-r--r--contrib/libs/grpc/src/compiler/protobuf_plugin.h66
-rw-r--r--contrib/libs/grpc/src/compiler/python_generator.cc336
-rw-r--r--contrib/libs/grpc/src/compiler/python_generator.h16
-rw-r--r--contrib/libs/grpc/src/compiler/python_generator_helpers.h40
-rw-r--r--contrib/libs/grpc/src/compiler/python_private_generator.h22
-rw-r--r--contrib/libs/grpc/src/compiler/ruby_generator.cc40
-rw-r--r--contrib/libs/grpc/src/compiler/ruby_generator.h2
-rw-r--r--contrib/libs/grpc/src/compiler/ruby_generator_helpers-inl.h6
-rw-r--r--contrib/libs/grpc/src/compiler/ruby_generator_map-inl.h10
-rw-r--r--contrib/libs/grpc/src/compiler/ruby_generator_string-inl.h56
-rw-r--r--contrib/libs/grpc/src/compiler/schema_interface.h60
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/backend_metric.cc36
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/backup_poller.cc6
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/client_channel.cc1476
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/client_channel.h2
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/client_channel_channelz.cc68
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/client_channel_channelz.h8
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/client_channel_plugin.cc6
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/config_selector.cc116
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/config_selector.h244
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/global_subchannel_pool.cc48
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/health/health_check_client.cc30
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/health/health_check_client.h6
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/http_connect_handshaker.cc18
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/http_proxy.cc62
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy.cc40
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy.h94
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/address_filtering.cc192
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/address_filtering.h202
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/child_policy_handler.cc600
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/child_policy_handler.h166
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc1138
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.cc152
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.h74
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc10
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h6
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc178
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h48
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc58
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/priority/priority.cc1780
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc34
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h26
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/weighted_target/weighted_target.cc1488
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/xds/cds.cc558
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/xds/eds.cc2304
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/xds/eds_drop.cc1142
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/xds/xds.h2
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_manager.cc1454
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy_factory.h6
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy_registry.cc110
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy_registry.h2
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/local_subchannel_pool.h4
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/resolver.cc10
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/resolver.h24
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc270
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.cc82
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h16
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_libuv.cc46
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc26
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc158
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc404
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h10
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_fallback.cc14
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_libuv.cc2
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc2
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc100
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc190
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc12
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc1262
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.h56
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/resolver_factory.h4
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/resolver_registry.cc38
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/resolver_registry.h16
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/resolver_result_parsing.cc490
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/resolver_result_parsing.h46
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/resolving_lb_policy.cc196
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/resolving_lb_policy.h84
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/server_address.cc250
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/server_address.h108
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/service_config.cc304
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/service_config.h72
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/service_config_call_data.h136
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/service_config_channel_arg_filter.cc284
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/service_config_parser.cc178
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/service_config_parser.h184
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/subchannel.cc228
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/subchannel.h104
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/subchannel_interface.h88
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/http/client/http_client_filter.cc50
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/http/client_authority_filter.cc8
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/http/http_filters_plugin.cc52
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/http/message_compress/message_compress_filter.cc516
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/http/message_compress/message_decompress_filter.cc798
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/http/message_compress/message_decompress_filter.h62
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/max_age/max_age_filter.cc4
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/message_size/message_size_filter.cc186
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/message_size/message_size_filter.h24
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/chttp2/client/chttp2_connector.cc174
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/chttp2/client/chttp2_connector.h36
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc20
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/chttp2/server/chttp2_server.cc758
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/chttp2/server/chttp2_server.h14
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/chttp2/server/insecure/server_chttp2.cc6
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc20
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.cc18
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/chttp2/transport/chttp2_transport.cc592
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/chttp2/transport/chttp2_transport.h2
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/chttp2/transport/flow_control.cc62
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/chttp2/transport/flow_control.h48
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_data.cc18
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_goaway.cc8
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_ping.cc10
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_rst_stream.cc24
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_settings.cc16
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_window_update.cc18
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/chttp2/transport/hpack_encoder.cc54
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/chttp2/transport/hpack_parser.cc50
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/chttp2/transport/hpack_table.cc26
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/chttp2/transport/internal.h46
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/chttp2/transport/parsing.cc100
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/chttp2/transport/writing.cc62
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/inproc/inproc_transport.cc176
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.c34
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.h58
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/annotations/resource.upb.c54
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/annotations/resource.upb.h106
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.c488
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.h1532
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.c148
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.h452
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.c916
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.h3270
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.c70
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.h138
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.c110
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.h646
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.c248
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.h758
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.c70
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.h158
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.c620
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.h1738
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.c206
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.h702
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.c68
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.h142
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.c106
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.h266
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.c482
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.h1504
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.c340
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.h1368
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.c72
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.h160
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.c352
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.h1290
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.c56
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.h116
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.c68
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.h176
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.c72
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.h170
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.c182
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.h440
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.c182
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.h546
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.c224
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.h664
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.c66
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.h130
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.c256
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.h934
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.c310
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.h1078
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.c82
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.h188
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.c356
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.h1232
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.c126
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.h408
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.c1800
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.h6580
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.c120
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.h278
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.c100
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.h216
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c728
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h2672
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.c40
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.h68
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.c220
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.h774
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.c152
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.h428
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.c294
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.h1140
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/cluster/v3/cds.upb.c54
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/cluster/v3/cds.upb.h98
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.c50
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.h98
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.c278
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.h898
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/endpoint/v3/eds.upb.c60
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/endpoint/v3/eds.upb.h98
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/listener/v3/lds.upb.c60
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/listener/v3/lds.upb.h98
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.c110
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.h272
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/route/v3/rds.upb.c58
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/route/v3/rds.upb.h98
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/route/v3/srds.upb.c54
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/route/v3/srds.upb.h98
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.c94
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.h228
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.c70
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.h154
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.c68
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.h142
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.c128
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.h290
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.c108
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.h266
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.c126
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.h376
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.c176
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.h516
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.c180
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.h500
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/v3/http.upb.c34
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/v3/http.upb.h70
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/v3/percent.upb.c80
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/v3/percent.upb.h172
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/v3/range.upb.c102
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/v3/range.upb.h222
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.c60
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.h122
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.c484
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.h1506
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.c468
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.h1518
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/google/api/http.upb.h58
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/any.upb.h10
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/descriptor.upb.c86
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/descriptor.upb.h842
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/duration.upb.h10
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/empty.upb.h2
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/struct.upb.c2
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/struct.upb.h68
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/timestamp.upb.h10
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/wrappers.upb.h54
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/google/rpc/status.upb.h16
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c2
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.h64
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c66
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h344
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.h28
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h12
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c26
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h184
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/migrate.upb.c96
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/migrate.upb.h206
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/security.upb.c62
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/security.upb.h114
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.c34
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.h58
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/status.upb.c56
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/status.upb.h128
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/versioning.upb.c54
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/versioning.upb.h106
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/udpa/core/v1/authority.upb.c56
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/udpa/core/v1/authority.upb.h106
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/udpa/core/v1/collection_entry.upb.c104
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/udpa/core/v1/collection_entry.upb.h258
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/udpa/core/v1/context_params.upb.c84
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/udpa/core/v1/context_params.upb.h154
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/udpa/core/v1/resource.upb.c72
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/udpa/core/v1/resource.upb.h170
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/udpa/core/v1/resource_locator.upb.c108
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/udpa/core/v1/resource_locator.upb.h320
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/udpa/core/v1/resource_name.upb.c72
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/udpa/core/v1/resource_name.upb.h168
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c12
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.h82
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/validate/validate.upb.c94
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/validate/validate.upb.h1262
-rw-r--r--contrib/libs/grpc/src/core/ext/xds/certificate_provider_factory.h118
-rw-r--r--contrib/libs/grpc/src/core/ext/xds/certificate_provider_registry.cc206
-rw-r--r--contrib/libs/grpc/src/core/ext/xds/certificate_provider_registry.h114
-rw-r--r--contrib/libs/grpc/src/core/ext/xds/google_mesh_ca_certificate_provider_factory.cc754
-rw-r--r--contrib/libs/grpc/src/core/ext/xds/google_mesh_ca_certificate_provider_factory.h204
-rw-r--r--contrib/libs/grpc/src/core/ext/xds/xds_api.cc5192
-rw-r--r--contrib/libs/grpc/src/core/ext/xds/xds_api.h794
-rw-r--r--contrib/libs/grpc/src/core/ext/xds/xds_bootstrap.cc746
-rw-r--r--contrib/libs/grpc/src/core/ext/xds/xds_bootstrap.h186
-rw-r--r--contrib/libs/grpc/src/core/ext/xds/xds_channel_args.h58
-rw-r--r--contrib/libs/grpc/src/core/ext/xds/xds_client.cc4404
-rw-r--r--contrib/libs/grpc/src/core/ext/xds/xds_client.h660
-rw-r--r--contrib/libs/grpc/src/core/ext/xds/xds_client_stats.cc242
-rw-r--r--contrib/libs/grpc/src/core/ext/xds/xds_client_stats.h478
-rw-r--r--contrib/libs/grpc/src/core/lib/.yandex_meta/licenses.list.txt108
-rw-r--r--contrib/libs/grpc/src/core/lib/channel/channel_args.cc30
-rw-r--r--contrib/libs/grpc/src/core/lib/channel/channel_args.h6
-rw-r--r--contrib/libs/grpc/src/core/lib/channel/channel_stack.h24
-rw-r--r--contrib/libs/grpc/src/core/lib/channel/channel_trace.cc56
-rw-r--r--contrib/libs/grpc/src/core/lib/channel/channel_trace.h6
-rw-r--r--contrib/libs/grpc/src/core/lib/channel/channelz.cc334
-rw-r--r--contrib/libs/grpc/src/core/lib/channel/channelz.h88
-rw-r--r--contrib/libs/grpc/src/core/lib/channel/channelz_registry.cc134
-rw-r--r--contrib/libs/grpc/src/core/lib/channel/channelz_registry.h14
-rw-r--r--contrib/libs/grpc/src/core/lib/channel/connected_channel.cc10
-rw-r--r--contrib/libs/grpc/src/core/lib/channel/context.h2
-rw-r--r--contrib/libs/grpc/src/core/lib/channel/handshaker.cc22
-rw-r--r--contrib/libs/grpc/src/core/lib/channel/handshaker.h8
-rw-r--r--contrib/libs/grpc/src/core/lib/channel/handshaker_registry.cc10
-rw-r--r--contrib/libs/grpc/src/core/lib/compression/message_compress.cc10
-rw-r--r--contrib/libs/grpc/src/core/lib/debug/stats.cc42
-rw-r--r--contrib/libs/grpc/src/core/lib/debug/stats.h6
-rw-r--r--contrib/libs/grpc/src/core/lib/gpr/log_linux.cc12
-rw-r--r--contrib/libs/grpc/src/core/lib/gpr/log_posix.cc12
-rw-r--r--contrib/libs/grpc/src/core/lib/gpr/string.cc20
-rw-r--r--contrib/libs/grpc/src/core/lib/gpr/string.h8
-rw-r--r--contrib/libs/grpc/src/core/lib/gpr/sync_abseil.cc232
-rw-r--r--contrib/libs/grpc/src/core/lib/gpr/sync_posix.cc20
-rw-r--r--contrib/libs/grpc/src/core/lib/gpr/sync_windows.cc8
-rw-r--r--contrib/libs/grpc/src/core/lib/gpr/time.cc8
-rw-r--r--contrib/libs/grpc/src/core/lib/gpr/time_posix.cc2
-rw-r--r--contrib/libs/grpc/src/core/lib/gpr/time_precise.cc6
-rw-r--r--contrib/libs/grpc/src/core/lib/gpr/time_precise.h12
-rw-r--r--contrib/libs/grpc/src/core/lib/gprpp/debug_location.h2
-rw-r--r--contrib/libs/grpc/src/core/lib/gprpp/dual_ref_counted.h672
-rw-r--r--contrib/libs/grpc/src/core/lib/gprpp/fork.cc2
-rw-r--r--contrib/libs/grpc/src/core/lib/gprpp/global_config_env.cc16
-rw-r--r--contrib/libs/grpc/src/core/lib/gprpp/host_port.cc60
-rw-r--r--contrib/libs/grpc/src/core/lib/gprpp/host_port.h28
-rw-r--r--contrib/libs/grpc/src/core/lib/gprpp/map.h10
-rw-r--r--contrib/libs/grpc/src/core/lib/gprpp/memory.h6
-rw-r--r--contrib/libs/grpc/src/core/lib/gprpp/ref_counted.h102
-rw-r--r--contrib/libs/grpc/src/core/lib/gprpp/ref_counted_ptr.h316
-rw-r--r--contrib/libs/grpc/src/core/lib/gprpp/sync.h18
-rw-r--r--contrib/libs/grpc/src/core/lib/http/format_request.cc92
-rw-r--r--contrib/libs/grpc/src/core/lib/http/httpcli.cc26
-rw-r--r--contrib/libs/grpc/src/core/lib/http/httpcli_security_connector.cc16
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/buffer_list.cc72
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/buffer_list.h44
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/call_combiner.h6
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/cfstream_handle.cc8
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/dualstack_socket_posix.cc94
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/endpoint.cc10
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/endpoint.h14
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/endpoint_cfstream.cc72
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/endpoint_pair_posix.cc20
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/error.h8
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/error_cfstream.cc18
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/ev_apple.cc712
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/ev_apple.h86
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/ev_epoll1_linux.cc50
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/ev_epollex_linux.cc52
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/ev_poll_posix.cc18
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/exec_ctx.h40
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/executor.cc2
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/fork_posix.cc8
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/iomgr_posix_cfstream.cc168
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/is_epollexclusive_available.cc28
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/load_file.cc2
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/parse_address.cc476
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/parse_address.h106
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/poller/eventmanager_libuv.cc174
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/poller/eventmanager_libuv.h176
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/pollset_set_custom.cc20
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/port.h4
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/resolve_address_custom.cc86
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/resolve_address_custom.h8
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/resolve_address_posix.cc16
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/resolve_address_windows.cc28
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/resource_quota.cc68
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/sockaddr_utils.cc62
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/sockaddr_utils.h24
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/socket_utils_common_posix.cc230
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/socket_utils_posix.h30
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/socket_windows.cc8
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/tcp_client_cfstream.cc28
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/tcp_client_custom.cc12
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/tcp_client_posix.cc78
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/tcp_client_posix.h12
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/tcp_client_windows.cc18
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/tcp_custom.cc66
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/tcp_custom.h8
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/tcp_posix.cc1274
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/tcp_server.cc6
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/tcp_server.h14
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/tcp_server_custom.cc52
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/tcp_server_posix.cc76
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/tcp_server_utils_posix.h6
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/tcp_server_utils_posix_common.cc30
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.cc20
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/tcp_server_windows.cc32
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/tcp_uv.cc6
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/tcp_windows.cc52
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/timer_generic.cc26
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/udp_server.cc64
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/udp_server.h10
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/unix_sockets_posix.cc18
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/unix_sockets_posix.h6
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/unix_sockets_posix_noop.cc10
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/work_serializer.cc310
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/work_serializer.h130
-rw-r--r--contrib/libs/grpc/src/core/lib/json/json.h430
-rw-r--r--contrib/libs/grpc/src/core/lib/json/json_reader.cc1024
-rw-r--r--contrib/libs/grpc/src/core/lib/json/json_util.cc116
-rw-r--r--contrib/libs/grpc/src/core/lib/json/json_util.h74
-rw-r--r--contrib/libs/grpc/src/core/lib/json/json_writer.cc406
-rw-r--r--contrib/libs/grpc/src/core/lib/security/authorization/authorization_engine.cc354
-rw-r--r--contrib/libs/grpc/src/core/lib/security/authorization/authorization_engine.h168
-rw-r--r--contrib/libs/grpc/src/core/lib/security/authorization/evaluate_args.cc306
-rw-r--r--contrib/libs/grpc/src/core/lib/security/authorization/evaluate_args.h118
-rw-r--r--contrib/libs/grpc/src/core/lib/security/authorization/mock_cel/activation.h114
-rw-r--r--contrib/libs/grpc/src/core/lib/security/authorization/mock_cel/cel_expr_builder_factory.h84
-rw-r--r--contrib/libs/grpc/src/core/lib/security/authorization/mock_cel/cel_expression.h136
-rw-r--r--contrib/libs/grpc/src/core/lib/security/authorization/mock_cel/cel_value.h186
-rw-r--r--contrib/libs/grpc/src/core/lib/security/authorization/mock_cel/evaluator_core.h134
-rw-r--r--contrib/libs/grpc/src/core/lib/security/authorization/mock_cel/flat_expr_builder.h112
-rw-r--r--contrib/libs/grpc/src/core/lib/security/authorization/mock_cel/statusor.h100
-rw-r--r--contrib/libs/grpc/src/core/lib/security/certificate_provider.h120
-rw-r--r--contrib/libs/grpc/src/core/lib/security/credentials/alts/check_gcp_environment.cc2
-rw-r--r--contrib/libs/grpc/src/core/lib/security/credentials/composite/composite_credentials.cc38
-rw-r--r--contrib/libs/grpc/src/core/lib/security/credentials/composite/composite_credentials.h22
-rw-r--r--contrib/libs/grpc/src/core/lib/security/credentials/credentials.h42
-rw-r--r--contrib/libs/grpc/src/core/lib/security/credentials/fake/fake_credentials.h12
-rw-r--r--contrib/libs/grpc/src/core/lib/security/credentials/google_default/credentials_generic.cc16
-rw-r--r--contrib/libs/grpc/src/core/lib/security/credentials/google_default/google_default_credentials.cc144
-rw-r--r--contrib/libs/grpc/src/core/lib/security/credentials/iam/iam_credentials.cc16
-rw-r--r--contrib/libs/grpc/src/core/lib/security/credentials/iam/iam_credentials.h8
-rw-r--r--contrib/libs/grpc/src/core/lib/security/credentials/jwt/json_token.cc52
-rw-r--r--contrib/libs/grpc/src/core/lib/security/credentials/jwt/json_token.h4
-rw-r--r--contrib/libs/grpc/src/core/lib/security/credentials/jwt/jwt_credentials.cc30
-rw-r--r--contrib/libs/grpc/src/core/lib/security/credentials/jwt/jwt_credentials.h24
-rw-r--r--contrib/libs/grpc/src/core/lib/security/credentials/jwt/jwt_verifier.cc298
-rw-r--r--contrib/libs/grpc/src/core/lib/security/credentials/jwt/jwt_verifier.h4
-rw-r--r--contrib/libs/grpc/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc218
-rw-r--r--contrib/libs/grpc/src/core/lib/security/credentials/oauth2/oauth2_credentials.h16
-rw-r--r--contrib/libs/grpc/src/core/lib/security/credentials/plugin/plugin_credentials.cc50
-rw-r--r--contrib/libs/grpc/src/core/lib/security/credentials/plugin/plugin_credentials.h8
-rw-r--r--contrib/libs/grpc/src/core/lib/security/credentials/ssl/ssl_credentials.cc40
-rw-r--r--contrib/libs/grpc/src/core/lib/security/credentials/ssl/ssl_credentials.h20
-rw-r--r--contrib/libs/grpc/src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.cc642
-rw-r--r--contrib/libs/grpc/src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.h428
-rw-r--r--contrib/libs/grpc/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.cc90
-rw-r--r--contrib/libs/grpc/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h114
-rw-r--r--contrib/libs/grpc/src/core/lib/security/credentials/tls/tls_credentials.cc256
-rw-r--r--contrib/libs/grpc/src/core/lib/security/credentials/tls/tls_credentials.h124
-rw-r--r--contrib/libs/grpc/src/core/lib/security/credentials/xds/xds_credentials.cc90
-rw-r--r--contrib/libs/grpc/src/core/lib/security/credentials/xds/xds_credentials.h102
-rw-r--r--contrib/libs/grpc/src/core/lib/security/security_connector/alts/alts_security_connector.cc68
-rw-r--r--contrib/libs/grpc/src/core/lib/security/security_connector/fake/fake_security_connector.cc82
-rw-r--r--contrib/libs/grpc/src/core/lib/security/security_connector/load_system_roots_fallback.cc4
-rw-r--r--contrib/libs/grpc/src/core/lib/security/security_connector/load_system_roots_linux.cc10
-rw-r--r--contrib/libs/grpc/src/core/lib/security/security_connector/local/local_security_connector.cc64
-rw-r--r--contrib/libs/grpc/src/core/lib/security/security_connector/security_connector.cc4
-rw-r--r--contrib/libs/grpc/src/core/lib/security/security_connector/security_connector.h4
-rw-r--r--contrib/libs/grpc/src/core/lib/security/security_connector/ssl/ssl_security_connector.cc76
-rw-r--r--contrib/libs/grpc/src/core/lib/security/security_connector/ssl/ssl_security_connector.h10
-rw-r--r--contrib/libs/grpc/src/core/lib/security/security_connector/ssl_utils.cc276
-rw-r--r--contrib/libs/grpc/src/core/lib/security/security_connector/ssl_utils.h68
-rw-r--r--contrib/libs/grpc/src/core/lib/security/security_connector/tls/tls_security_connector.cc1212
-rw-r--r--contrib/libs/grpc/src/core/lib/security/security_connector/tls/tls_security_connector.h366
-rw-r--r--contrib/libs/grpc/src/core/lib/security/transport/client_auth_filter.cc88
-rw-r--r--contrib/libs/grpc/src/core/lib/security/transport/secure_endpoint.cc14
-rw-r--r--contrib/libs/grpc/src/core/lib/security/transport/security_handshaker.cc4
-rw-r--r--contrib/libs/grpc/src/core/lib/security/util/json_util.cc54
-rw-r--r--contrib/libs/grpc/src/core/lib/security/util/json_util.h4
-rw-r--r--contrib/libs/grpc/src/core/lib/slice/slice.cc76
-rw-r--r--contrib/libs/grpc/src/core/lib/slice/slice_internal.h30
-rw-r--r--contrib/libs/grpc/src/core/lib/slice/slice_utils.h18
-rw-r--r--contrib/libs/grpc/src/core/lib/surface/byte_buffer_reader.cc4
-rw-r--r--contrib/libs/grpc/src/core/lib/surface/call.cc104
-rw-r--r--contrib/libs/grpc/src/core/lib/surface/call.h4
-rw-r--r--contrib/libs/grpc/src/core/lib/surface/call_log_batch.cc100
-rw-r--r--contrib/libs/grpc/src/core/lib/surface/channel.cc140
-rw-r--r--contrib/libs/grpc/src/core/lib/surface/channel.h102
-rw-r--r--contrib/libs/grpc/src/core/lib/surface/completion_queue.cc94
-rw-r--r--contrib/libs/grpc/src/core/lib/surface/event_string.cc36
-rw-r--r--contrib/libs/grpc/src/core/lib/surface/event_string.h6
-rw-r--r--contrib/libs/grpc/src/core/lib/surface/init.cc54
-rw-r--r--contrib/libs/grpc/src/core/lib/surface/init_secure.cc2
-rw-r--r--contrib/libs/grpc/src/core/lib/surface/server.cc2700
-rw-r--r--contrib/libs/grpc/src/core/lib/surface/server.h768
-rw-r--r--contrib/libs/grpc/src/core/lib/surface/version.cc4
-rw-r--r--contrib/libs/grpc/src/core/lib/transport/authority_override.cc76
-rw-r--r--contrib/libs/grpc/src/core/lib/transport/authority_override.h64
-rw-r--r--contrib/libs/grpc/src/core/lib/transport/bdp_estimator.h4
-rw-r--r--contrib/libs/grpc/src/core/lib/transport/byte_stream.h14
-rw-r--r--contrib/libs/grpc/src/core/lib/transport/connectivity_state.cc46
-rw-r--r--contrib/libs/grpc/src/core/lib/transport/connectivity_state.h50
-rw-r--r--contrib/libs/grpc/src/core/lib/transport/error_utils.cc26
-rw-r--r--contrib/libs/grpc/src/core/lib/transport/error_utils.h12
-rw-r--r--contrib/libs/grpc/src/core/lib/transport/metadata.cc28
-rw-r--r--contrib/libs/grpc/src/core/lib/transport/static_metadata.cc590
-rw-r--r--contrib/libs/grpc/src/core/lib/transport/static_metadata.h162
-rw-r--r--contrib/libs/grpc/src/core/lib/transport/transport.h32
-rw-r--r--contrib/libs/grpc/src/core/lib/transport/transport_op_string.cc122
-rw-r--r--contrib/libs/grpc/src/core/lib/uri/uri_parser.cc60
-rw-r--r--contrib/libs/grpc/src/core/lib/uri/uri_parser.h6
-rw-r--r--contrib/libs/grpc/src/core/lib/ya.make28
-rw-r--r--contrib/libs/grpc/src/core/plugin_registry/grpc_plugin_registry.cc94
-rw-r--r--contrib/libs/grpc/src/core/plugin_registry/grpc_unsecure_plugin_registry.cc24
-rw-r--r--contrib/libs/grpc/src/core/tsi/alts/handshaker/alts_handshaker_client.cc64
-rw-r--r--contrib/libs/grpc/src/core/tsi/alts/handshaker/alts_handshaker_client.h16
-rw-r--r--contrib/libs/grpc/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc136
-rw-r--r--contrib/libs/grpc/src/core/tsi/alts/handshaker/alts_tsi_handshaker.h20
-rw-r--r--contrib/libs/grpc/src/core/tsi/alts/handshaker/transport_security_common_api.cc4
-rw-r--r--contrib/libs/grpc/src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.cc6
-rw-r--r--contrib/libs/grpc/src/core/tsi/fake_transport_security.cc14
-rw-r--r--contrib/libs/grpc/src/core/tsi/fake_transport_security.h4
-rw-r--r--contrib/libs/grpc/src/core/tsi/ssl/session_cache/ssl_session_boringssl.cc2
-rw-r--r--contrib/libs/grpc/src/core/tsi/ssl/session_cache/ssl_session_openssl.cc2
-rw-r--r--contrib/libs/grpc/src/core/tsi/ssl_transport_security.cc590
-rw-r--r--contrib/libs/grpc/src/core/tsi/ssl_transport_security.h64
-rw-r--r--contrib/libs/grpc/src/core/tsi/test_creds/README96
-rw-r--r--contrib/libs/grpc/src/core/tsi/test_creds/badclient.key52
-rw-r--r--contrib/libs/grpc/src/core/tsi/test_creds/badclient.pem40
-rw-r--r--contrib/libs/grpc/src/core/tsi/test_creds/badserver.key52
-rw-r--r--contrib/libs/grpc/src/core/tsi/test_creds/badserver.pem40
-rw-r--r--contrib/libs/grpc/src/core/tsi/test_creds/ca.key52
-rw-r--r--contrib/libs/grpc/src/core/tsi/test_creds/ca.pem36
-rw-r--r--contrib/libs/grpc/src/core/tsi/test_creds/client.key52
-rw-r--r--contrib/libs/grpc/src/core/tsi/test_creds/client.pem36
-rw-r--r--contrib/libs/grpc/src/core/tsi/test_creds/multi-domain-openssl.cnf60
-rw-r--r--contrib/libs/grpc/src/core/tsi/test_creds/multi-domain.key56
-rw-r--r--contrib/libs/grpc/src/core/tsi/test_creds/multi-domain.pem40
-rw-r--r--contrib/libs/grpc/src/core/tsi/test_creds/server0.key52
-rw-r--r--contrib/libs/grpc/src/core/tsi/test_creds/server0.pem36
-rw-r--r--contrib/libs/grpc/src/core/tsi/test_creds/server1.key52
-rw-r--r--contrib/libs/grpc/src/core/tsi/test_creds/server1.pem40
-rw-r--r--contrib/libs/grpc/src/core/tsi/transport_security.cc26
-rw-r--r--contrib/libs/grpc/src/core/tsi/transport_security_grpc.cc4
-rw-r--r--contrib/libs/grpc/src/core/tsi/transport_security_grpc.h4
-rw-r--r--contrib/libs/grpc/src/core/tsi/transport_security_interface.h36
-rwxr-xr-xcontrib/libs/grpc/src/cpp/README.md214
-rw-r--r--contrib/libs/grpc/src/cpp/client/channel_cc.cc22
-rw-r--r--contrib/libs/grpc/src/cpp/client/client_callback.cc104
-rw-r--r--contrib/libs/grpc/src/cpp/client/client_context.cc34
-rw-r--r--contrib/libs/grpc/src/cpp/client/create_channel.cc12
-rw-r--r--contrib/libs/grpc/src/cpp/client/create_channel_internal.cc2
-rw-r--r--contrib/libs/grpc/src/cpp/client/create_channel_internal.h2
-rw-r--r--contrib/libs/grpc/src/cpp/client/create_channel_posix.cc32
-rw-r--r--contrib/libs/grpc/src/cpp/client/credentials_cc.cc4
-rw-r--r--contrib/libs/grpc/src/cpp/client/insecure_credentials.cc8
-rw-r--r--contrib/libs/grpc/src/cpp/client/secure_credentials.cc106
-rw-r--r--contrib/libs/grpc/src/cpp/client/secure_credentials.h18
-rw-r--r--contrib/libs/grpc/src/cpp/common/.yandex_meta/licenses.list.txt56
-rw-r--r--contrib/libs/grpc/src/cpp/common/alarm.cc26
-rw-r--r--contrib/libs/grpc/src/cpp/common/alts_context.cc254
-rw-r--r--contrib/libs/grpc/src/cpp/common/alts_util.cc164
-rw-r--r--contrib/libs/grpc/src/cpp/common/channel_arguments.cc28
-rw-r--r--contrib/libs/grpc/src/cpp/common/completion_queue_cc.cc18
-rw-r--r--contrib/libs/grpc/src/cpp/common/resource_quota_cc.cc6
-rw-r--r--contrib/libs/grpc/src/cpp/common/secure_auth_context.cc8
-rw-r--r--contrib/libs/grpc/src/cpp/common/secure_auth_context.h8
-rw-r--r--contrib/libs/grpc/src/cpp/common/secure_channel_arguments.cc10
-rw-r--r--contrib/libs/grpc/src/cpp/common/tls_credentials_options.cc202
-rw-r--r--contrib/libs/grpc/src/cpp/common/tls_credentials_options_util.cc16
-rw-r--r--contrib/libs/grpc/src/cpp/common/tls_credentials_options_util.h4
-rw-r--r--contrib/libs/grpc/src/cpp/common/validate_service_config.cc8
-rw-r--r--contrib/libs/grpc/src/cpp/common/version_cc.cc2
-rw-r--r--contrib/libs/grpc/src/cpp/common/ya.make82
-rw-r--r--contrib/libs/grpc/src/cpp/ext/proto_server_reflection.cc16
-rw-r--r--contrib/libs/grpc/src/cpp/ext/proto_server_reflection.h10
-rw-r--r--contrib/libs/grpc/src/cpp/ext/proto_server_reflection_plugin.cc18
-rw-r--r--contrib/libs/grpc/src/cpp/server/async_generic_service.cc4
-rw-r--r--contrib/libs/grpc/src/cpp/server/channel_argument_option.cc14
-rw-r--r--contrib/libs/grpc/src/cpp/server/channelz/channelz_service.cc10
-rw-r--r--contrib/libs/grpc/src/cpp/server/channelz/channelz_service_plugin.cc16
-rw-r--r--contrib/libs/grpc/src/cpp/server/external_connection_acceptor_impl.cc4
-rw-r--r--contrib/libs/grpc/src/cpp/server/external_connection_acceptor_impl.h4
-rw-r--r--contrib/libs/grpc/src/cpp/server/health/default_health_check_service.cc22
-rw-r--r--contrib/libs/grpc/src/cpp/server/health/default_health_check_service.h16
-rw-r--r--contrib/libs/grpc/src/cpp/server/health/health_check_service.cc6
-rw-r--r--contrib/libs/grpc/src/cpp/server/insecure_server_credentials.cc6
-rw-r--r--contrib/libs/grpc/src/cpp/server/load_reporter/load_data_store.cc50
-rw-r--r--contrib/libs/grpc/src/cpp/server/load_reporter/load_data_store.h114
-rw-r--r--contrib/libs/grpc/src/cpp/server/load_reporter/util.cc8
-rw-r--r--contrib/libs/grpc/src/cpp/server/secure_server_credentials.cc14
-rw-r--r--contrib/libs/grpc/src/cpp/server/secure_server_credentials.h6
-rw-r--r--contrib/libs/grpc/src/cpp/server/server_builder.cc128
-rw-r--r--contrib/libs/grpc/src/cpp/server/server_callback.cc94
-rw-r--r--contrib/libs/grpc/src/cpp/server/server_cc.cc336
-rw-r--r--contrib/libs/grpc/src/cpp/server/server_context.cc152
-rw-r--r--contrib/libs/grpc/src/cpp/server/server_credentials.cc6
-rw-r--r--contrib/libs/grpc/src/cpp/server/server_posix.cc4
-rw-r--r--contrib/libs/grpc/src/cpp/thread_manager/thread_manager.cc4
-rw-r--r--contrib/libs/grpc/src/cpp/util/error_details.cc4
-rw-r--r--contrib/libs/grpc/src/proto/grpc/channelz/.yandex_meta/licenses.list.txt32
-rw-r--r--contrib/libs/grpc/src/proto/grpc/channelz/ya.make12
-rw-r--r--contrib/libs/grpc/src/proto/grpc/core/.yandex_meta/licenses.list.txt32
-rw-r--r--contrib/libs/grpc/src/proto/grpc/core/ya.make12
-rw-r--r--contrib/libs/grpc/src/proto/grpc/gcp/handshaker.proto18
-rw-r--r--contrib/libs/grpc/src/proto/grpc/health/v1/.yandex_meta/licenses.list.txt32
-rw-r--r--contrib/libs/grpc/src/proto/grpc/health/v1/ya.make12
-rw-r--r--contrib/libs/grpc/src/proto/grpc/lb/v1/load_balancer.proto14
-rw-r--r--contrib/libs/grpc/src/proto/grpc/reflection/v1alpha/.yandex_meta/licenses.list.txt32
-rw-r--r--contrib/libs/grpc/src/proto/grpc/reflection/v1alpha/ya.make12
-rw-r--r--contrib/libs/grpc/src/proto/grpc/status/.yandex_meta/licenses.list.txt32
-rw-r--r--contrib/libs/grpc/src/proto/grpc/status/ya.make12
-rw-r--r--contrib/libs/grpc/src/proto/grpc/testing/.yandex_meta/licenses.list.txt64
-rw-r--r--contrib/libs/grpc/src/proto/grpc/testing/control.proto12
-rw-r--r--contrib/libs/grpc/src/proto/grpc/testing/duplicate/.yandex_meta/licenses.list.txt32
-rw-r--r--contrib/libs/grpc/src/proto/grpc/testing/duplicate/ya.make12
-rw-r--r--contrib/libs/grpc/src/proto/grpc/testing/echo.proto68
-rw-r--r--contrib/libs/grpc/src/proto/grpc/testing/echo_messages.proto4
-rw-r--r--contrib/libs/grpc/src/proto/grpc/testing/messages.proto44
-rw-r--r--contrib/libs/grpc/src/proto/grpc/testing/simple_messages.proto10
-rw-r--r--contrib/libs/grpc/src/proto/grpc/testing/test.proto26
-rw-r--r--contrib/libs/grpc/src/proto/grpc/testing/xds/.yandex_meta/licenses.list.txt40
-rw-r--r--contrib/libs/grpc/src/proto/grpc/testing/xds/cds_for_test.proto348
-rw-r--r--contrib/libs/grpc/src/proto/grpc/testing/xds/eds_for_test.proto50
-rw-r--r--contrib/libs/grpc/src/proto/grpc/testing/xds/lds_rds_for_test.proto430
-rw-r--r--contrib/libs/grpc/src/proto/grpc/testing/xds/lrs_for_test.proto12
-rw-r--r--contrib/libs/grpc/src/proto/grpc/testing/xds/v3/address.proto100
-rw-r--r--contrib/libs/grpc/src/proto/grpc/testing/xds/v3/ads.proto90
-rw-r--r--contrib/libs/grpc/src/proto/grpc/testing/xds/v3/base.proto222
-rw-r--r--contrib/libs/grpc/src/proto/grpc/testing/xds/v3/cluster.proto324
-rw-r--r--contrib/libs/grpc/src/proto/grpc/testing/xds/v3/config_source.proto154
-rw-r--r--contrib/libs/grpc/src/proto/grpc/testing/xds/v3/discovery.proto244
-rw-r--r--contrib/libs/grpc/src/proto/grpc/testing/xds/v3/endpoint.proto352
-rw-r--r--contrib/libs/grpc/src/proto/grpc/testing/xds/v3/http_connection_manager.proto112
-rw-r--r--contrib/libs/grpc/src/proto/grpc/testing/xds/v3/listener.proto128
-rw-r--r--contrib/libs/grpc/src/proto/grpc/testing/xds/v3/load_report.proto324
-rw-r--r--contrib/libs/grpc/src/proto/grpc/testing/xds/v3/lrs.proto192
-rw-r--r--contrib/libs/grpc/src/proto/grpc/testing/xds/v3/orca_load_report.proto88
-rw-r--r--contrib/libs/grpc/src/proto/grpc/testing/xds/v3/percent.proto104
-rw-r--r--contrib/libs/grpc/src/proto/grpc/testing/xds/v3/range.proto62
-rw-r--r--contrib/libs/grpc/src/proto/grpc/testing/xds/v3/regex.proto76
-rw-r--r--contrib/libs/grpc/src/proto/grpc/testing/xds/v3/route.proto630
-rw-r--r--contrib/libs/grpc/src/proto/grpc/testing/xds/ya.make16
-rw-r--r--contrib/libs/grpc/src/proto/grpc/testing/ya.make12
-rw-r--r--contrib/libs/grpc/src/python/grpcio/.yandex_meta/licenses.list.txt120
-rw-r--r--contrib/libs/grpc/src/python/grpcio/README.rst2
-rw-r--r--contrib/libs/grpc/src/python/grpcio/_parallel_compile_patch.py8
-rw-r--r--contrib/libs/grpc/src/python/grpcio/commands.py116
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/__init__.py250
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/_auth.py22
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/_channel.py326
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/_common.py56
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/call.pxd.pxi58
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/call.pyx.pxi930
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/callback_common.pxd.pxi14
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/callback_common.pyx.pxi206
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/channel.pxd.pxi18
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/channel.pyx.pxi224
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/common.pyx.pxi372
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/completion_queue.pxd.pxi152
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/completion_queue.pyx.pxi388
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/grpc_aio.pxd.pxi42
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/grpc_aio.pyx.pxi240
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/iomgr/iomgr.pyx.pxi66
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/iomgr/resolver.pxd.pxi4
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/iomgr/resolver.pyx.pxi24
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/iomgr/socket.pxd.pxi18
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/iomgr/socket.pyx.pxi200
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/iomgr/timer.pxd.pxi8
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/iomgr/timer.pyx.pxi28
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/rpc_status.pxd.pxi58
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/rpc_status.pyx.pxi88
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/server.pxd.pxi78
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/server.pyx.pxi1594
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/channel.pyx.pxi4
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/credentials.pxd.pxi12
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/credentials.pyx.pxi122
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/fork_posix.pyx.pxi10
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/fork_windows.pyx.pxi2
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/grpc.pxi48
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/grpc_gevent.pxd.pxi4
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/grpc_gevent.pyx.pxi4
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/grpc_string.pyx.pxi2
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/iomgr.pxd.pxi18
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/iomgr.pyx.pxi8
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/metadata.pyx.pxi10
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/operation.pyx.pxi8
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/server.pyx.pxi10
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/thread.pyx.pxi118
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/_cython/cygrpc.pxd8
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/_cython/cygrpc.pyx32
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/_grpcio_metadata.py2
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/_interceptor.py100
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/_plugin_wrapping.py12
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/_runtime_protos.py342
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/_server.py94
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/_simple_stubs.py986
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/aio/__init__.py162
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/aio/_base_call.py488
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/aio/_base_channel.py694
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/aio/_base_server.py588
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/aio/_call.py1258
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/aio/_channel.py938
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/aio/_interceptor.py1974
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/aio/_metadata.py238
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/aio/_server.py418
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/aio/_typing.py64
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/aio/_utils.py44
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/beta/_client_adaptations.py150
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/beta/_server_adaptations.py82
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/beta/implementations.py8
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/experimental/__init__.py192
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/experimental/aio/__init__.py6
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/framework/foundation/logging_pool.py6
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc_core_dependencies.py1268
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc_version.py2
-rw-r--r--contrib/libs/grpc/src/python/grpcio/support.py26
-rw-r--r--contrib/libs/grpc/src/python/grpcio/ya.make32
-rw-r--r--contrib/libs/grpc/src/python/grpcio_channelz/.yandex_meta/licenses.list.txt48
-rw-r--r--contrib/libs/grpc/src/python/grpcio_channelz/channelz_commands.py6
-rw-r--r--contrib/libs/grpc/src/python/grpcio_channelz/grpc_channelz/v1/_async.py132
-rw-r--r--contrib/libs/grpc/src/python/grpcio_channelz/grpc_channelz/v1/_servicer.py240
-rw-r--r--contrib/libs/grpc/src/python/grpcio_channelz/grpc_channelz/v1/channelz.py80
-rw-r--r--contrib/libs/grpc/src/python/grpcio_channelz/grpc_version.py2
-rw-r--r--contrib/libs/grpc/src/python/grpcio_channelz/setup.py6
-rw-r--r--contrib/libs/grpc/src/python/grpcio_channelz/ya.make22
-rw-r--r--contrib/libs/grpc/src/python/grpcio_health_checking/.yandex_meta/licenses.list.txt64
-rw-r--r--contrib/libs/grpc/src/python/grpcio_health_checking/grpc_health/v1/_async.py226
-rw-r--r--contrib/libs/grpc/src/python/grpcio_health_checking/grpc_health/v1/health.py20
-rw-r--r--contrib/libs/grpc/src/python/grpcio_health_checking/grpc_version.py2
-rw-r--r--contrib/libs/grpc/src/python/grpcio_health_checking/health_commands.py6
-rw-r--r--contrib/libs/grpc/src/python/grpcio_health_checking/setup.py34
-rw-r--r--contrib/libs/grpc/src/python/grpcio_health_checking/ya.make6
-rw-r--r--contrib/libs/grpc/src/python/grpcio_reflection/.yandex_meta/licenses.list.txt56
-rw-r--r--contrib/libs/grpc/src/python/grpcio_reflection/grpc_reflection/v1alpha/_async.py114
-rw-r--r--contrib/libs/grpc/src/python/grpcio_reflection/grpc_reflection/v1alpha/_base.py220
-rw-r--r--contrib/libs/grpc/src/python/grpcio_reflection/grpc_reflection/v1alpha/reflection.py96
-rw-r--r--contrib/libs/grpc/src/python/grpcio_reflection/grpc_version.py2
-rw-r--r--contrib/libs/grpc/src/python/grpcio_reflection/setup.py34
-rw-r--r--contrib/libs/grpc/src/python/grpcio_reflection/ya.make22
-rw-r--r--contrib/libs/grpc/src/python/grpcio_status/.yandex_meta/licenses.list.txt56
-rw-r--r--contrib/libs/grpc/src/python/grpcio_status/grpc_status/_async.py112
-rw-r--r--contrib/libs/grpc/src/python/grpcio_status/grpc_status/_common.py54
-rw-r--r--contrib/libs/grpc/src/python/grpcio_status/grpc_status/rpc_status.py42
-rw-r--r--contrib/libs/grpc/src/python/grpcio_status/grpc_version.py2
-rw-r--r--contrib/libs/grpc/src/python/grpcio_status/setup.py28
-rw-r--r--contrib/libs/grpc/src/python/grpcio_status/status_commands.py20
-rw-r--r--contrib/libs/grpc/src/python/grpcio_status/ya.make22
-rw-r--r--contrib/libs/grpc/src/python/grpcio_testing/grpc_testing/_channel/_rpc_state.py8
-rw-r--r--contrib/libs/grpc/src/python/grpcio_testing/grpc_testing/_server/_server.py40
-rw-r--r--contrib/libs/grpc/src/python/grpcio_testing/grpc_testing/_server/_service.py8
-rw-r--r--contrib/libs/grpc/src/python/grpcio_testing/grpc_version.py2
-rw-r--r--contrib/libs/grpc/src/python/grpcio_testing/setup.py24
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/.yandex_meta/licenses.list.txt144
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/commands.py110
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/grpc_version.py2
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/setup.py46
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/_result.py78
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/_runner.py4
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/_sanity/_sanity_test.py8
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/channelz/_channelz_servicer_test.py20
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/fork/_fork_interop_test.py6
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/fork/client.py32
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/fork/methods.py20
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/health_check/_health_servicer_test.py42
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/http2/negative_http2_client.py38
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/interop/_secure_intraop_test.py14
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/interop/client.py224
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/interop/methods.py58
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/interop/server.py58
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/interop/service.py20
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/qps/benchmark_client.py8
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/qps/benchmark_server.py10
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/qps/client_runner.py4
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/qps/histogram.py20
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/qps/qps_worker.py8
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/qps/worker_server.py20
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/status/_grpc_status_test.py12
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/stress/client.py52
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/stress/test_runner.py6
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/stress/unary_stream_benchmark.py10
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/testing/_client_application.py4
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/testing/_time_test.py4
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_abort_test.py6
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_api_test.py10
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_auth_context_test.py54
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_channel_args_test.py14
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_channel_connectivity_test.py8
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_channel_ready_future_test.py4
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_compression_test.py22
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_contextvars_propagation_test.py236
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_cython/_cancel_many_calls_test.py4
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_cython/_no_messages_server_completion_queue_per_call_test.py12
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_cython/_no_messages_single_server_completion_queue_test.py12
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_cython/cygrpc_test.py40
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_dns_resolver_test.py4
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_dynamic_stubs_test.py238
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_error_message_encoding_test.py4
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_exit_scenarios.py6
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_exit_test.py112
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_interceptor_test.py126
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_invalid_metadata_test.py12
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_invocation_defects_test.py62
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_local_credentials_test.py16
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_logging_test.py8
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_metadata_code_details_test.py98
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_metadata_flags_test.py116
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_metadata_test.py12
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_reconnect_test.py2
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_rpc_part_1_test.py464
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_rpc_part_2_test.py852
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_rpc_test_helpers.py834
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_server_ssl_cert_config_test.py136
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_server_test.py42
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_server_wait_for_termination_test.py32
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_session_cache_test.py68
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_signal_client.py14
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/beta/_beta_features_test.py70
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/beta/_implementations_test.py4
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/beta/_not_found_test.py10
-rwxr-xr-xcontrib/libs/grpc/src/python/grpcio_tests/tests/unit/credentials/ca.pem36
-rwxr-xr-xcontrib/libs/grpc/src/python/grpcio_tests/tests/unit/credentials/server1.key52
-rwxr-xr-xcontrib/libs/grpc/src/python/grpcio_tests/tests/unit/credentials/server1.pem40
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/framework/common/__init__.py52
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/test_common.py4
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/benchmark/benchmark_client.py310
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/benchmark/benchmark_servicer.py110
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/benchmark/server.py12
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/benchmark/worker.py118
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/benchmark/worker_servicer.py734
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/channelz/__init__.py26
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/channelz/channelz_servicer_test.py948
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/health_check/__init__.py26
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/health_check/health_servicer_test.py564
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/interop/__init__.py26
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/interop/client.py122
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/interop/local_interop_test.py268
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/interop/methods.py912
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/interop/server.py98
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/reflection/__init__.py26
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/reflection/reflection_servicer_test.py386
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/status/__init__.py26
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/status/grpc_status_test.py350
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/_common.py198
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/_constants.py32
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/_metadata_test.py274
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/_test_base.py86
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/_test_server.py248
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/abort_test.py302
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/aio_rpc_error_test.py104
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/auth_context_test.py388
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/call_test.py1584
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/channel_argument_test.py352
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/channel_ready_test.py138
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/channel_test.py384
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/client_stream_stream_interceptor_test.py404
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/client_stream_unary_interceptor_test.py1034
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/client_unary_stream_interceptor_test.py790
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/client_unary_unary_interceptor_test.py1398
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/close_channel_test.py276
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/compatibility_test.py760
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/compression_test.py392
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/connectivity_test.py224
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/context_peer_test.py130
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/done_callback_test.py248
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/init_test.py24
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/metadata_test.py594
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/outside_init_test.py148
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/secure_call_test.py260
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/server_interceptor_test.py660
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/server_test.py820
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/timeout_test.py356
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/wait_for_connection_test.py318
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/wait_for_ready_test.py292
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_py3_only/__init__.py42
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_py3_only/interop/xds_interop_client.py696
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_py3_only/unit/__init__.py26
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_py3_only/unit/_leak_test.py196
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_py3_only/unit/_simple_stubs_test.py830
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/ya.make24
891 files changed, 87139 insertions, 87139 deletions
diff --git a/contrib/libs/grpc/src/compiler/config.h b/contrib/libs/grpc/src/compiler/config.h
index bee4077bcd0..95213b0f045 100644
--- a/contrib/libs/grpc/src/compiler/config.h
+++ b/contrib/libs/grpc/src/compiler/config.h
@@ -21,18 +21,18 @@
#include "src/compiler/config_protobuf.h"
-#include <util/generic/string.h>
-
-#ifdef GRPC_CUSTOM_STRING
-#warning GRPC_CUSTOM_STRING is no longer supported. Please use TString.
+#include <util/generic/string.h>
+
+#ifdef GRPC_CUSTOM_STRING
+#warning GRPC_CUSTOM_STRING is no longer supported. Please use TString.
#endif
namespace grpc {
-// Using grpc::string and grpc::to_string is discouraged in favor of
-// TString and ToString. This is only for legacy code using
-// them explictly.
-typedef TString string; // deprecated
+// Using grpc::string and grpc::to_string is discouraged in favor of
+// TString and ToString. This is only for legacy code using
+// them explictly.
+typedef TString string; // deprecated
namespace protobuf {
diff --git a/contrib/libs/grpc/src/compiler/cpp_generator.cc b/contrib/libs/grpc/src/compiler/cpp_generator.cc
index dad9c485892..57591774745 100644
--- a/contrib/libs/grpc/src/compiler/cpp_generator.cc
+++ b/contrib/libs/grpc/src/compiler/cpp_generator.cc
@@ -22,16 +22,16 @@
#include <sstream>
-#include <util/string/cast.h>
-
+#include <util/string/cast.h>
+
namespace grpc_cpp_generator {
namespace {
template <class T>
-TString as_string(T x) {
+TString as_string(T x) {
std::ostringstream out;
out << x;
- return out.str();
+ return out.str();
}
inline bool ClientOnlyStreaming(const grpc_generator::Method* method) {
@@ -42,8 +42,8 @@ inline bool ServerOnlyStreaming(const grpc_generator::Method* method) {
return !method->ClientStreaming() && method->ServerStreaming();
}
-TString FilenameIdentifier(const TString& filename) {
- TString result;
+TString FilenameIdentifier(const TString& filename) {
+ TString result;
for (unsigned i = 0; i < filename.size(); i++) {
char c = filename[i];
if (isalnum(c)) {
@@ -65,9 +65,9 @@ T* array_end(T (&array)[N]) {
}
void PrintIncludes(grpc_generator::Printer* printer,
- const std::vector<TString>& headers,
- bool use_system_headers, const TString& search_path) {
- std::map<TString, TString> vars;
+ const std::vector<TString>& headers,
+ bool use_system_headers, const TString& search_path) {
+ std::map<TString, TString> vars;
vars["l"] = use_system_headers ? '<' : '"';
vars["r"] = use_system_headers ? '>' : '"';
@@ -85,13 +85,13 @@ void PrintIncludes(grpc_generator::Printer* printer,
}
}
-TString GetHeaderPrologue(grpc_generator::File* file,
- const Parameters& params) {
- TString output;
+TString GetHeaderPrologue(grpc_generator::File* file,
+ const Parameters& params) {
+ TString output;
{
// Scope the output stream so it closes and finalizes output to the string.
auto printer = file->CreatePrinter(&output);
- std::map<TString, TString> vars;
+ std::map<TString, TString> vars;
vars["filename"] = file->filename();
vars["filename_identifier"] = FilenameIdentifier(file->filename());
@@ -104,7 +104,7 @@ TString GetHeaderPrologue(grpc_generator::File* file,
printer->Print(vars,
"// If you make any local change, they will be lost.\n");
printer->Print(vars, "// source: $filename$\n");
- TString leading_comments = file->GetLeadingComments("//");
+ TString leading_comments = file->GetLeadingComments("//");
if (!leading_comments.empty()) {
printer->Print(vars, "// Original file comments:\n");
printer->PrintRaw(leading_comments.c_str());
@@ -124,37 +124,37 @@ TString GetHeaderPrologue(grpc_generator::File* file,
}
// Convert from "a/b/c.proto" to "#include \"a/b/c$message_header_ext$\"\n"
-TString ImportInludeFromProtoName(const TString& proto_name) {
- return TString("#include \"") +
+TString ImportInludeFromProtoName(const TString& proto_name) {
+ return TString("#include \"") +
proto_name.substr(0, proto_name.size() - 6) +
- TString("$message_header_ext$\"\n");
+ TString("$message_header_ext$\"\n");
}
-TString GetHeaderIncludes(grpc_generator::File* file,
- const Parameters& params) {
- TString output;
+TString GetHeaderIncludes(grpc_generator::File* file,
+ const Parameters& params) {
+ TString output;
{
// Scope the output stream so it closes and finalizes output to the string.
auto printer = file->CreatePrinter(&output);
- std::map<TString, TString> vars;
+ std::map<TString, TString> vars;
if (!params.additional_header_includes.empty()) {
PrintIncludes(printer.get(), params.additional_header_includes, false,
"");
}
- // TODO(vjpai): Remove port_platform.h from header list when callback API is
- // fully de-experimentalized since we will no longer be using
- // macros from it.
+ // TODO(vjpai): Remove port_platform.h from header list when callback API is
+ // fully de-experimentalized since we will no longer be using
+ // macros from it.
static const char* headers_strs[] = {
"functional",
- "grpc/impl/codegen/port_platform.h",
+ "grpc/impl/codegen/port_platform.h",
"grpcpp/impl/codegen/async_generic_service.h",
"grpcpp/impl/codegen/async_stream.h",
"grpcpp/impl/codegen/async_unary_call.h",
"grpcpp/impl/codegen/client_callback.h",
"grpcpp/impl/codegen/client_context.h",
"grpcpp/impl/codegen/completion_queue.h",
- "grpcpp/impl/codegen/message_allocator.h",
+ "grpcpp/impl/codegen/message_allocator.h",
"grpcpp/impl/codegen/method_handler.h",
"grpcpp/impl/codegen/proto_utils.h",
"grpcpp/impl/codegen/rpc_method.h",
@@ -166,7 +166,7 @@ TString GetHeaderIncludes(grpc_generator::File* file,
"grpcpp/impl/codegen/stub_options.h",
"grpcpp/impl/codegen/sync_stream.h",
};
- std::vector<TString> headers(headers_strs, array_end(headers_strs));
+ std::vector<TString> headers(headers_strs, array_end(headers_strs));
PrintIncludes(printer.get(), headers, params.use_system_headers,
params.grpc_search_path);
printer->Print(vars, "\n");
@@ -176,16 +176,16 @@ TString GetHeaderIncludes(grpc_generator::File* file,
: params.message_header_extension;
if (params.include_import_headers) {
- const std::vector<TString> import_names = file->GetImportNames();
+ const std::vector<TString> import_names = file->GetImportNames();
for (const auto& import_name : import_names) {
- const TString include_name = ImportInludeFromProtoName(import_name);
+ const TString include_name = ImportInludeFromProtoName(import_name);
printer->Print(vars, include_name.c_str());
}
printer->PrintRaw("\n");
}
if (!file->package().empty()) {
- std::vector<TString> parts = file->package_parts();
+ std::vector<TString> parts = file->package_parts();
for (auto part = parts.begin(); part != parts.end(); part++) {
vars["part"] = *part;
@@ -197,18 +197,18 @@ TString GetHeaderIncludes(grpc_generator::File* file,
return output;
}
-void PrintHeaderClientMethodInterfaces(grpc_generator::Printer* printer,
- const grpc_generator::Method* method,
- std::map<TString, TString>* vars,
- bool is_public) {
+void PrintHeaderClientMethodInterfaces(grpc_generator::Printer* printer,
+ const grpc_generator::Method* method,
+ std::map<TString, TString>* vars,
+ bool is_public) {
(*vars)["Method"] = method->name();
(*vars)["Request"] = method->input_type_name();
(*vars)["Response"] = method->output_type_name();
struct {
- TString prefix;
- TString method_params; // extra arguments to method
- TString raw_args; // extra arguments to raw version of method
+ TString prefix;
+ TString method_params; // extra arguments to method
+ TString raw_args; // extra arguments to raw version of method
} async_prefixes[] = {{"Async", ", void* tag", ", tag"},
{"PrepareAsync", "", ""}};
@@ -282,7 +282,7 @@ void PrintHeaderClientMethodInterfaces(grpc_generator::Printer* printer,
"($Method$Raw(context, request));\n");
printer->Outdent();
printer->Print("}\n");
- for (auto& async_prefix : async_prefixes) {
+ for (auto& async_prefix : async_prefixes) {
(*vars)["AsyncPrefix"] = async_prefix.prefix;
(*vars)["AsyncMethodParams"] = async_prefix.method_params;
(*vars)["AsyncRawArgs"] = async_prefix.raw_args;
@@ -398,15 +398,15 @@ void PrintHeaderClientMethodInterfaces(grpc_generator::Printer* printer,
void PrintHeaderClientMethod(grpc_generator::Printer* printer,
const grpc_generator::Method* method,
- std::map<TString, TString>* vars,
+ std::map<TString, TString>* vars,
bool is_public) {
(*vars)["Method"] = method->name();
(*vars)["Request"] = method->input_type_name();
(*vars)["Response"] = method->output_type_name();
struct {
- TString prefix;
- TString method_params; // extra arguments to method
- TString raw_args; // extra arguments to raw version of method
+ TString prefix;
+ TString method_params; // extra arguments to method
+ TString raw_args; // extra arguments to raw version of method
} async_prefixes[] = {{"Async", ", void* tag", ", tag"},
{"PrepareAsync", "", ""}};
@@ -585,7 +585,7 @@ void PrintHeaderClientMethod(grpc_generator::Printer* printer,
void PrintHeaderClientMethodCallbackInterfacesStart(
grpc_generator::Printer* printer,
- std::map<TString, TString>* /*vars*/) {
+ std::map<TString, TString>* /*vars*/) {
// This declares the interface for the callback-based API. The components
// are pure; even though this is new (post-1.0) API, it can be pure because
// it is an entirely new interface that happens to be scoped within
@@ -600,7 +600,7 @@ void PrintHeaderClientMethodCallbackInterfacesStart(
void PrintHeaderClientMethodCallbackInterfaces(
grpc_generator::Printer* printer, const grpc_generator::Method* method,
- std::map<TString, TString>* vars) {
+ std::map<TString, TString>* vars) {
(*vars)["Method"] = method->name();
(*vars)["Request"] = method->input_type_name();
(*vars)["Response"] = method->output_type_name();
@@ -610,67 +610,67 @@ void PrintHeaderClientMethodCallbackInterfaces(
"virtual void $Method$(::grpc::ClientContext* context, "
"const $Request$* request, $Response$* response, "
"std::function<void(::grpc::Status)>) = 0;\n");
- // TODO(vjpai): Remove experimental versions and macros when callback API is
- // fully de-experimentalized.
+ // TODO(vjpai): Remove experimental versions and macros when callback API is
+ // fully de-experimentalized.
printer->Print(*vars,
- "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
+ "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
+ "virtual void $Method$(::grpc::ClientContext* context, "
+ "const $Request$* request, $Response$* response, "
+ "::grpc::ClientUnaryReactor* reactor) = 0;\n"
+ "#else\n"
"virtual void $Method$(::grpc::ClientContext* context, "
"const $Request$* request, $Response$* response, "
- "::grpc::ClientUnaryReactor* reactor) = 0;\n"
- "#else\n"
- "virtual void $Method$(::grpc::ClientContext* context, "
- "const $Request$* request, $Response$* response, "
- "::grpc::experimental::ClientUnaryReactor* reactor) = 0;\n"
- "#endif\n");
+ "::grpc::experimental::ClientUnaryReactor* reactor) = 0;\n"
+ "#endif\n");
} else if (ClientOnlyStreaming(method)) {
printer->Print(*vars,
- "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
+ "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
+ "virtual void $Method$(::grpc::ClientContext* context, "
+ "$Response$* response, "
+ "::grpc::ClientWriteReactor< $Request$>* "
+ "reactor) = 0;\n"
+ "#else\n"
"virtual void $Method$(::grpc::ClientContext* context, "
"$Response$* response, "
- "::grpc::ClientWriteReactor< $Request$>* "
- "reactor) = 0;\n"
- "#else\n"
- "virtual void $Method$(::grpc::ClientContext* context, "
- "$Response$* response, "
"::grpc::experimental::ClientWriteReactor< $Request$>* "
- "reactor) = 0;\n"
- "#endif\n");
+ "reactor) = 0;\n"
+ "#endif\n");
} else if (ServerOnlyStreaming(method)) {
printer->Print(*vars,
- "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
+ "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
+ "virtual void $Method$(::grpc::ClientContext* context, "
+ "$Request$* request, "
+ "::grpc::ClientReadReactor< $Response$>* "
+ "reactor) = 0;\n"
+ "#else\n"
"virtual void $Method$(::grpc::ClientContext* context, "
"$Request$* request, "
- "::grpc::ClientReadReactor< $Response$>* "
- "reactor) = 0;\n"
- "#else\n"
- "virtual void $Method$(::grpc::ClientContext* context, "
- "$Request$* request, "
"::grpc::experimental::ClientReadReactor< $Response$>* "
- "reactor) = 0;\n"
- "#endif\n");
+ "reactor) = 0;\n"
+ "#endif\n");
} else if (method->BidiStreaming()) {
printer->Print(*vars,
- "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
+ "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
+ "virtual void $Method$(::grpc::ClientContext* context, "
+ "::grpc::ClientBidiReactor< "
+ "$Request$,$Response$>* reactor) = 0;\n"
+ "#else\n"
"virtual void $Method$(::grpc::ClientContext* context, "
- "::grpc::ClientBidiReactor< "
- "$Request$,$Response$>* reactor) = 0;\n"
- "#else\n"
- "virtual void $Method$(::grpc::ClientContext* context, "
"::grpc::experimental::ClientBidiReactor< "
- "$Request$,$Response$>* reactor) = 0;\n"
- "#endif\n");
+ "$Request$,$Response$>* reactor) = 0;\n"
+ "#endif\n");
}
}
void PrintHeaderClientMethodCallbackInterfacesEnd(
grpc_generator::Printer* printer,
- std::map<TString, TString>* /*vars*/) {
+ std::map<TString, TString>* /*vars*/) {
printer->Outdent();
printer->Print("};\n");
- printer->Print(
- "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
- "typedef class experimental_async_interface async_interface;\n"
- "#endif\n");
+ printer->Print(
+ "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
+ "typedef class experimental_async_interface async_interface;\n"
+ "#endif\n");
// Declare a function to give the async stub contents. It can't be pure
// since this is a new API in StubInterface, but it is meaningless by default
@@ -678,17 +678,17 @@ void PrintHeaderClientMethodCallbackInterfacesEnd(
// the callback functions therein), so make the default return value nullptr.
// Intentionally include the word "class" to avoid possible shadowing.
printer->Print(
- "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
- "async_interface* async() { return experimental_async(); }\n"
- "#endif\n");
- printer->Print(
+ "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
+ "async_interface* async() { return experimental_async(); }\n"
+ "#endif\n");
+ printer->Print(
"virtual class experimental_async_interface* experimental_async() { "
"return nullptr; }\n");
}
void PrintHeaderClientMethodCallbackStart(
grpc_generator::Printer* printer,
- std::map<TString, TString>* /*vars*/) {
+ std::map<TString, TString>* /*vars*/) {
// This declares the stub entry for the callback-based API.
printer->Print("class experimental_async final :\n");
printer->Print(" public StubInterface::experimental_async_interface {\n");
@@ -696,9 +696,9 @@ void PrintHeaderClientMethodCallbackStart(
printer->Indent();
}
-void PrintHeaderClientMethodCallback(grpc_generator::Printer* printer,
- const grpc_generator::Method* method,
- std::map<TString, TString>* vars) {
+void PrintHeaderClientMethodCallback(grpc_generator::Printer* printer,
+ const grpc_generator::Method* method,
+ std::map<TString, TString>* vars) {
(*vars)["Method"] = method->name();
(*vars)["Request"] = method->input_type_name();
(*vars)["Response"] = method->output_type_name();
@@ -710,59 +710,59 @@ void PrintHeaderClientMethodCallback(grpc_generator::Printer* printer,
"std::function<void(::grpc::Status)>) override;\n");
printer->Print(
*vars,
- "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
+ "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
+ "void $Method$(::grpc::ClientContext* context, "
+ "const $Request$* request, $Response$* response, "
+ "::grpc::ClientUnaryReactor* reactor) override;\n"
+ "#else\n"
"void $Method$(::grpc::ClientContext* context, "
"const $Request$* request, $Response$* response, "
- "::grpc::ClientUnaryReactor* reactor) override;\n"
- "#else\n"
- "void $Method$(::grpc::ClientContext* context, "
- "const $Request$* request, $Response$* response, "
- "::grpc::experimental::ClientUnaryReactor* reactor) override;\n"
- "#endif\n");
+ "::grpc::experimental::ClientUnaryReactor* reactor) override;\n"
+ "#endif\n");
} else if (ClientOnlyStreaming(method)) {
printer->Print(*vars,
- "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
+ "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
+ "void $Method$(::grpc::ClientContext* context, "
+ "$Response$* response, "
+ "::grpc::ClientWriteReactor< $Request$>* "
+ "reactor) override;\n"
+ "#else\n"
"void $Method$(::grpc::ClientContext* context, "
"$Response$* response, "
- "::grpc::ClientWriteReactor< $Request$>* "
- "reactor) override;\n"
- "#else\n"
- "void $Method$(::grpc::ClientContext* context, "
- "$Response$* response, "
"::grpc::experimental::ClientWriteReactor< $Request$>* "
- "reactor) override;\n"
- "#endif\n");
+ "reactor) override;\n"
+ "#endif\n");
} else if (ServerOnlyStreaming(method)) {
printer->Print(*vars,
- "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
+ "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
+ "void $Method$(::grpc::ClientContext* context, "
+ "$Request$* request, "
+ "::grpc::ClientReadReactor< $Response$>* "
+ "reactor) override;\n"
+ "#else\n"
"void $Method$(::grpc::ClientContext* context, "
"$Request$* request, "
- "::grpc::ClientReadReactor< $Response$>* "
- "reactor) override;\n"
- "#else\n"
- "void $Method$(::grpc::ClientContext* context, "
- "$Request$* request, "
"::grpc::experimental::ClientReadReactor< $Response$>* "
- "reactor) override;\n"
- "#endif\n");
+ "reactor) override;\n"
+ "#endif\n");
} else if (method->BidiStreaming()) {
printer->Print(*vars,
- "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
+ "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
+ "void $Method$(::grpc::ClientContext* context, "
+ "::grpc::ClientBidiReactor< "
+ "$Request$,$Response$>* reactor) override;\n"
+ "#else\n"
"void $Method$(::grpc::ClientContext* context, "
- "::grpc::ClientBidiReactor< "
- "$Request$,$Response$>* reactor) override;\n"
- "#else\n"
- "void $Method$(::grpc::ClientContext* context, "
"::grpc::experimental::ClientBidiReactor< "
- "$Request$,$Response$>* reactor) override;\n"
- "#endif\n");
+ "$Request$,$Response$>* reactor) override;\n"
+ "#endif\n");
}
}
void PrintHeaderClientMethodCallbackEnd(
grpc_generator::Printer* printer,
- std::map<TString, TString>* /*vars*/) {
+ std::map<TString, TString>* /*vars*/) {
printer->Outdent();
printer->Print(" private:\n");
printer->Indent();
@@ -782,7 +782,7 @@ void PrintHeaderClientMethodCallbackEnd(
void PrintHeaderClientMethodData(grpc_generator::Printer* printer,
const grpc_generator::Method* method,
- std::map<TString, TString>* vars) {
+ std::map<TString, TString>* vars) {
(*vars)["Method"] = method->name();
printer->Print(*vars,
"const ::grpc::internal::RpcMethod rpcmethod_$Method$_;\n");
@@ -790,7 +790,7 @@ void PrintHeaderClientMethodData(grpc_generator::Printer* printer,
void PrintHeaderServerMethodSync(grpc_generator::Printer* printer,
const grpc_generator::Method* method,
- std::map<TString, TString>* vars) {
+ std::map<TString, TString>* vars) {
(*vars)["Method"] = method->name();
(*vars)["Request"] = method->input_type_name();
(*vars)["Response"] = method->output_type_name();
@@ -827,7 +827,7 @@ void PrintHeaderServerMethodSync(grpc_generator::Printer* printer,
// to generate async and raw async APIs.
void PrintHeaderServerAsyncMethodsHelper(
grpc_generator::Printer* printer, const grpc_generator::Method* method,
- std::map<TString, TString>* vars) {
+ std::map<TString, TString>* vars) {
if (method->NoStreaming()) {
printer->Print(
*vars,
@@ -922,7 +922,7 @@ void PrintHeaderServerAsyncMethodsHelper(
void PrintHeaderServerMethodAsync(grpc_generator::Printer* printer,
const grpc_generator::Method* method,
- std::map<TString, TString>* vars) {
+ std::map<TString, TString>* vars) {
(*vars)["Method"] = method->name();
// These will be disabled
(*vars)["Request"] = method->input_type_name();
@@ -957,7 +957,7 @@ void PrintHeaderServerMethodAsync(grpc_generator::Printer* printer,
// to generate callback and raw callback APIs.
void PrintHeaderServerCallbackMethodsHelper(
grpc_generator::Printer* printer, const grpc_generator::Method* method,
- std::map<TString, TString>* vars) {
+ std::map<TString, TString>* vars) {
if (method->NoStreaming()) {
printer->Print(
*vars,
@@ -969,19 +969,19 @@ void PrintHeaderServerCallbackMethodsHelper(
" return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, \"\");\n"
"}\n");
printer->Print(*vars,
- "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
- "virtual ::grpc::ServerUnaryReactor* $Method$(\n"
- " ::grpc::CallbackServerContext* /*context*/, "
- "const $RealRequest$* /*request*/, "
- "$RealResponse$* /*response*/)\n"
- "#else\n"
+ "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
+ "virtual ::grpc::ServerUnaryReactor* $Method$(\n"
+ " ::grpc::CallbackServerContext* /*context*/, "
+ "const $RealRequest$* /*request*/, "
+ "$RealResponse$* /*response*/)\n"
+ "#else\n"
"virtual ::grpc::experimental::ServerUnaryReactor* "
- "$Method$(\n"
- " ::grpc::experimental::CallbackServerContext* "
- "/*context*/, const $RealRequest$* /*request*/, "
- "$RealResponse$* /*response*/)\n"
- "#endif\n"
- " { return nullptr; }\n");
+ "$Method$(\n"
+ " ::grpc::experimental::CallbackServerContext* "
+ "/*context*/, const $RealRequest$* /*request*/, "
+ "$RealResponse$* /*response*/)\n"
+ "#endif\n"
+ " { return nullptr; }\n");
} else if (ClientOnlyStreaming(method)) {
printer->Print(
*vars,
@@ -994,18 +994,18 @@ void PrintHeaderServerCallbackMethodsHelper(
" return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, \"\");\n"
"}\n");
printer->Print(*vars,
- "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
- "virtual ::grpc::ServerReadReactor< "
- "$RealRequest$>* $Method$(\n"
- " ::grpc::CallbackServerContext* "
- "/*context*/, $RealResponse$* /*response*/)\n"
- "#else\n"
+ "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
+ "virtual ::grpc::ServerReadReactor< "
+ "$RealRequest$>* $Method$(\n"
+ " ::grpc::CallbackServerContext* "
+ "/*context*/, $RealResponse$* /*response*/)\n"
+ "#else\n"
"virtual ::grpc::experimental::ServerReadReactor< "
- "$RealRequest$>* $Method$(\n"
- " ::grpc::experimental::CallbackServerContext* "
- "/*context*/, $RealResponse$* /*response*/)\n"
- "#endif\n"
- " { return nullptr; }\n");
+ "$RealRequest$>* $Method$(\n"
+ " ::grpc::experimental::CallbackServerContext* "
+ "/*context*/, $RealResponse$* /*response*/)\n"
+ "#endif\n"
+ " { return nullptr; }\n");
} else if (ServerOnlyStreaming(method)) {
printer->Print(
*vars,
@@ -1019,17 +1019,17 @@ void PrintHeaderServerCallbackMethodsHelper(
"}\n");
printer->Print(
*vars,
- "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
- "virtual ::grpc::ServerWriteReactor< $RealResponse$>* $Method$(\n"
- " ::grpc::CallbackServerContext* "
- "/*context*/, const $RealRequest$* /*request*/)\n"
- "#else\n"
- "virtual ::grpc::experimental::ServerWriteReactor< $RealResponse$>* "
- "$Method$(\n"
- " ::grpc::experimental::CallbackServerContext* "
- "/*context*/, const $RealRequest$* /*request*/)\n"
- "#endif\n"
- " { return nullptr; }\n");
+ "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
+ "virtual ::grpc::ServerWriteReactor< $RealResponse$>* $Method$(\n"
+ " ::grpc::CallbackServerContext* "
+ "/*context*/, const $RealRequest$* /*request*/)\n"
+ "#else\n"
+ "virtual ::grpc::experimental::ServerWriteReactor< $RealResponse$>* "
+ "$Method$(\n"
+ " ::grpc::experimental::CallbackServerContext* "
+ "/*context*/, const $RealRequest$* /*request*/)\n"
+ "#endif\n"
+ " { return nullptr; }\n");
} else if (method->BidiStreaming()) {
printer->Print(
*vars,
@@ -1043,23 +1043,23 @@ void PrintHeaderServerCallbackMethodsHelper(
"}\n");
printer->Print(
*vars,
- "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
- "virtual ::grpc::ServerBidiReactor< $RealRequest$, $RealResponse$>* "
- "$Method$(\n"
- " ::grpc::CallbackServerContext* /*context*/)\n"
- "#else\n"
+ "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
+ "virtual ::grpc::ServerBidiReactor< $RealRequest$, $RealResponse$>* "
+ "$Method$(\n"
+ " ::grpc::CallbackServerContext* /*context*/)\n"
+ "#else\n"
"virtual ::grpc::experimental::ServerBidiReactor< "
"$RealRequest$, $RealResponse$>* "
- "$Method$(\n"
- " ::grpc::experimental::CallbackServerContext* /*context*/)\n"
- "#endif\n"
- " { return nullptr; }\n");
+ "$Method$(\n"
+ " ::grpc::experimental::CallbackServerContext* /*context*/)\n"
+ "#endif\n"
+ " { return nullptr; }\n");
}
}
-void PrintHeaderServerMethodCallback(grpc_generator::Printer* printer,
- const grpc_generator::Method* method,
- std::map<TString, TString>* vars) {
+void PrintHeaderServerMethodCallback(grpc_generator::Printer* printer,
+ const grpc_generator::Method* method,
+ std::map<TString, TString>* vars) {
(*vars)["Method"] = method->name();
// These will be disabled
(*vars)["Request"] = method->input_type_name();
@@ -1081,21 +1081,21 @@ void PrintHeaderServerMethodCallback(grpc_generator::Printer* printer,
if (method->NoStreaming()) {
printer->Print(
*vars,
- "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
- " ::grpc::Service::\n"
- "#else\n"
- " ::grpc::Service::experimental().\n"
- "#endif\n"
- " MarkMethodCallback($Idx$,\n"
- " new ::grpc::internal::CallbackUnaryHandler< "
+ "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
+ " ::grpc::Service::\n"
+ "#else\n"
+ " ::grpc::Service::experimental().\n"
+ "#endif\n"
+ " MarkMethodCallback($Idx$,\n"
+ " new ::grpc::internal::CallbackUnaryHandler< "
"$RealRequest$, $RealResponse$>(\n"
- " [this](\n"
- "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
- " ::grpc::CallbackServerContext*\n"
- "#else\n"
- " ::grpc::experimental::CallbackServerContext*\n"
- "#endif\n"
- " context, "
+ " [this](\n"
+ "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
+ " ::grpc::CallbackServerContext*\n"
+ "#else\n"
+ " ::grpc::experimental::CallbackServerContext*\n"
+ "#endif\n"
+ " context, "
"const $RealRequest$* "
"request, "
"$RealResponse$* response) { "
@@ -1104,77 +1104,77 @@ void PrintHeaderServerMethodCallback(grpc_generator::Printer* printer,
"void SetMessageAllocatorFor_$Method$(\n"
" ::grpc::experimental::MessageAllocator< "
"$RealRequest$, $RealResponse$>* allocator) {\n"
- "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
- " ::grpc::internal::MethodHandler* const handler = "
- "::grpc::Service::GetHandler($Idx$);\n"
- "#else\n"
- " ::grpc::internal::MethodHandler* const handler = "
- "::grpc::Service::experimental().GetHandler($Idx$);\n"
- "#endif\n"
- " static_cast<::grpc::internal::CallbackUnaryHandler< "
- "$RealRequest$, $RealResponse$>*>(handler)\n"
+ "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
+ " ::grpc::internal::MethodHandler* const handler = "
+ "::grpc::Service::GetHandler($Idx$);\n"
+ "#else\n"
+ " ::grpc::internal::MethodHandler* const handler = "
+ "::grpc::Service::experimental().GetHandler($Idx$);\n"
+ "#endif\n"
+ " static_cast<::grpc::internal::CallbackUnaryHandler< "
+ "$RealRequest$, $RealResponse$>*>(handler)\n"
" ->SetMessageAllocator(allocator);\n");
} else if (ClientOnlyStreaming(method)) {
printer->Print(
*vars,
- "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
- " ::grpc::Service::\n"
- "#else\n"
- " ::grpc::Service::experimental().\n"
- "#endif\n"
- " MarkMethodCallback($Idx$,\n"
- " new ::grpc::internal::CallbackClientStreamingHandler< "
+ "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
+ " ::grpc::Service::\n"
+ "#else\n"
+ " ::grpc::Service::experimental().\n"
+ "#endif\n"
+ " MarkMethodCallback($Idx$,\n"
+ " new ::grpc::internal::CallbackClientStreamingHandler< "
"$RealRequest$, $RealResponse$>(\n"
- " [this](\n"
- "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
- " ::grpc::CallbackServerContext*\n"
- "#else\n"
- " ::grpc::experimental::CallbackServerContext*\n"
- "#endif\n"
- " context, "
+ " [this](\n"
+ "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
+ " ::grpc::CallbackServerContext*\n"
+ "#else\n"
+ " ::grpc::experimental::CallbackServerContext*\n"
+ "#endif\n"
+ " context, "
"$RealResponse$* "
"response) { "
"return this->$Method$(context, response); }));\n");
} else if (ServerOnlyStreaming(method)) {
printer->Print(
*vars,
- "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
- " ::grpc::Service::\n"
- "#else\n"
- " ::grpc::Service::experimental().\n"
- "#endif\n"
- " MarkMethodCallback($Idx$,\n"
- " new ::grpc::internal::CallbackServerStreamingHandler< "
+ "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
+ " ::grpc::Service::\n"
+ "#else\n"
+ " ::grpc::Service::experimental().\n"
+ "#endif\n"
+ " MarkMethodCallback($Idx$,\n"
+ " new ::grpc::internal::CallbackServerStreamingHandler< "
"$RealRequest$, $RealResponse$>(\n"
- " [this](\n"
- "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
- " ::grpc::CallbackServerContext*\n"
- "#else\n"
- " ::grpc::experimental::CallbackServerContext*\n"
- "#endif\n"
- " context, "
+ " [this](\n"
+ "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
+ " ::grpc::CallbackServerContext*\n"
+ "#else\n"
+ " ::grpc::experimental::CallbackServerContext*\n"
+ "#endif\n"
+ " context, "
"const $RealRequest$* "
"request) { "
"return this->$Method$(context, request); }));\n");
} else if (method->BidiStreaming()) {
printer->Print(
*vars,
- "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
- " ::grpc::Service::\n"
- "#else\n"
- " ::grpc::Service::experimental().\n"
- "#endif\n"
- " MarkMethodCallback($Idx$,\n"
- " new ::grpc::internal::CallbackBidiHandler< "
+ "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
+ " ::grpc::Service::\n"
+ "#else\n"
+ " ::grpc::Service::experimental().\n"
+ "#endif\n"
+ " MarkMethodCallback($Idx$,\n"
+ " new ::grpc::internal::CallbackBidiHandler< "
"$RealRequest$, $RealResponse$>(\n"
- " [this](\n"
- "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
- " ::grpc::CallbackServerContext*\n"
- "#else\n"
- " ::grpc::experimental::CallbackServerContext*\n"
- "#endif\n"
- " context) "
- "{ return this->$Method$(context); }));\n");
+ " [this](\n"
+ "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
+ " ::grpc::CallbackServerContext*\n"
+ "#else\n"
+ " ::grpc::experimental::CallbackServerContext*\n"
+ "#endif\n"
+ " context) "
+ "{ return this->$Method$(context); }));\n");
}
printer->Print(*vars, "}\n");
printer->Print(*vars,
@@ -1188,7 +1188,7 @@ void PrintHeaderServerMethodCallback(grpc_generator::Printer* printer,
void PrintHeaderServerMethodRawCallback(
grpc_generator::Printer* printer, const grpc_generator::Method* method,
- std::map<TString, TString>* vars) {
+ std::map<TString, TString>* vars) {
(*vars)["Method"] = method->name();
// These will be disabled
(*vars)["Request"] = method->input_type_name();
@@ -1210,21 +1210,21 @@ void PrintHeaderServerMethodRawCallback(
if (method->NoStreaming()) {
printer->Print(
*vars,
- "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
- " ::grpc::Service::\n"
- "#else\n"
- " ::grpc::Service::experimental().\n"
- "#endif\n"
- " MarkMethodRawCallback($Idx$,\n"
- " new ::grpc::internal::CallbackUnaryHandler< "
+ "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
+ " ::grpc::Service::\n"
+ "#else\n"
+ " ::grpc::Service::experimental().\n"
+ "#endif\n"
+ " MarkMethodRawCallback($Idx$,\n"
+ " new ::grpc::internal::CallbackUnaryHandler< "
"$RealRequest$, $RealResponse$>(\n"
- " [this](\n"
- "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
- " ::grpc::CallbackServerContext*\n"
- "#else\n"
- " ::grpc::experimental::CallbackServerContext*\n"
- "#endif\n"
- " context, "
+ " [this](\n"
+ "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
+ " ::grpc::CallbackServerContext*\n"
+ "#else\n"
+ " ::grpc::experimental::CallbackServerContext*\n"
+ "#endif\n"
+ " context, "
"const $RealRequest$* "
"request, "
"$RealResponse$* response) { return "
@@ -1232,63 +1232,63 @@ void PrintHeaderServerMethodRawCallback(
} else if (ClientOnlyStreaming(method)) {
printer->Print(
*vars,
- "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
- " ::grpc::Service::\n"
- "#else\n"
- " ::grpc::Service::experimental().\n"
- "#endif\n"
- " MarkMethodRawCallback($Idx$,\n"
- " new ::grpc::internal::CallbackClientStreamingHandler< "
+ "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
+ " ::grpc::Service::\n"
+ "#else\n"
+ " ::grpc::Service::experimental().\n"
+ "#endif\n"
+ " MarkMethodRawCallback($Idx$,\n"
+ " new ::grpc::internal::CallbackClientStreamingHandler< "
"$RealRequest$, $RealResponse$>(\n"
- " [this](\n"
- "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
- " ::grpc::CallbackServerContext*\n"
- "#else\n"
- " ::grpc::experimental::CallbackServerContext*\n"
- "#endif\n"
- " context, "
+ " [this](\n"
+ "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
+ " ::grpc::CallbackServerContext*\n"
+ "#else\n"
+ " ::grpc::experimental::CallbackServerContext*\n"
+ "#endif\n"
+ " context, "
"$RealResponse$* response) "
"{ return this->$Method$(context, response); }));\n");
} else if (ServerOnlyStreaming(method)) {
printer->Print(
*vars,
- "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
- " ::grpc::Service::\n"
- "#else\n"
- " ::grpc::Service::experimental().\n"
- "#endif\n"
- " MarkMethodRawCallback($Idx$,\n"
- " new ::grpc::internal::CallbackServerStreamingHandler< "
+ "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
+ " ::grpc::Service::\n"
+ "#else\n"
+ " ::grpc::Service::experimental().\n"
+ "#endif\n"
+ " MarkMethodRawCallback($Idx$,\n"
+ " new ::grpc::internal::CallbackServerStreamingHandler< "
"$RealRequest$, $RealResponse$>(\n"
- " [this](\n"
- "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
- " ::grpc::CallbackServerContext*\n"
- "#else\n"
- " ::grpc::experimental::CallbackServerContext*\n"
- "#endif\n"
- " context, "
+ " [this](\n"
+ "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
+ " ::grpc::CallbackServerContext*\n"
+ "#else\n"
+ " ::grpc::experimental::CallbackServerContext*\n"
+ "#endif\n"
+ " context, "
"const"
"$RealRequest$* request) { return "
"this->$Method$(context, request); }));\n");
} else if (method->BidiStreaming()) {
printer->Print(
*vars,
- "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
- " ::grpc::Service::\n"
- "#else\n"
- " ::grpc::Service::experimental().\n"
- "#endif\n"
- " MarkMethodRawCallback($Idx$,\n"
- " new ::grpc::internal::CallbackBidiHandler< "
+ "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
+ " ::grpc::Service::\n"
+ "#else\n"
+ " ::grpc::Service::experimental().\n"
+ "#endif\n"
+ " MarkMethodRawCallback($Idx$,\n"
+ " new ::grpc::internal::CallbackBidiHandler< "
"$RealRequest$, $RealResponse$>(\n"
- " [this](\n"
- "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
- " ::grpc::CallbackServerContext*\n"
- "#else\n"
- " ::grpc::experimental::CallbackServerContext*\n"
- "#endif\n"
- " context) "
- "{ return this->$Method$(context); }));\n");
+ " [this](\n"
+ "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
+ " ::grpc::CallbackServerContext*\n"
+ "#else\n"
+ " ::grpc::experimental::CallbackServerContext*\n"
+ "#endif\n"
+ " context) "
+ "{ return this->$Method$(context); }));\n");
}
printer->Print(*vars, "}\n");
printer->Print(*vars,
@@ -1302,7 +1302,7 @@ void PrintHeaderServerMethodRawCallback(
void PrintHeaderServerMethodStreamedUnary(
grpc_generator::Printer* printer, const grpc_generator::Method* method,
- std::map<TString, TString>* vars) {
+ std::map<TString, TString>* vars) {
(*vars)["Method"] = method->name();
(*vars)["Request"] = method->input_type_name();
(*vars)["Response"] = method->output_type_name();
@@ -1320,14 +1320,14 @@ void PrintHeaderServerMethodStreamedUnary(
printer->Print(*vars,
"WithStreamedUnaryMethod_$Method$() {\n"
" ::grpc::Service::MarkMethodStreamed($Idx$,\n"
- " new ::grpc::internal::StreamedUnaryHandler<\n"
- " $Request$, $Response$>(\n"
- " [this](::grpc::ServerContext* context,\n"
- " ::grpc::ServerUnaryStreamer<\n"
- " $Request$, $Response$>* streamer) {\n"
- " return this->Streamed$Method$(context,\n"
- " streamer);\n"
- " }));\n"
+ " new ::grpc::internal::StreamedUnaryHandler<\n"
+ " $Request$, $Response$>(\n"
+ " [this](::grpc::ServerContext* context,\n"
+ " ::grpc::ServerUnaryStreamer<\n"
+ " $Request$, $Response$>* streamer) {\n"
+ " return this->Streamed$Method$(context,\n"
+ " streamer);\n"
+ " }));\n"
"}\n");
printer->Print(*vars,
"~WithStreamedUnaryMethod_$Method$() override {\n"
@@ -1356,7 +1356,7 @@ void PrintHeaderServerMethodStreamedUnary(
void PrintHeaderServerMethodSplitStreaming(
grpc_generator::Printer* printer, const grpc_generator::Method* method,
- std::map<TString, TString>* vars) {
+ std::map<TString, TString>* vars) {
(*vars)["Method"] = method->name();
(*vars)["Request"] = method->input_type_name();
(*vars)["Response"] = method->output_type_name();
@@ -1372,18 +1372,18 @@ void PrintHeaderServerMethodSplitStreaming(
printer->Print(" public:\n");
printer->Indent();
printer->Print(*vars,
- "WithSplitStreamingMethod_$Method$() {\n"
- " ::grpc::Service::MarkMethodStreamed($Idx$,\n"
- " new ::grpc::internal::SplitServerStreamingHandler<\n"
- " $Request$, $Response$>(\n"
- " [this](::grpc::ServerContext* context,\n"
- " ::grpc::ServerSplitStreamer<\n"
- " $Request$, $Response$>* streamer) {\n"
- " return this->Streamed$Method$(context,\n"
- " streamer);\n"
- " }));\n"
- "}\n");
- printer->Print(*vars,
+ "WithSplitStreamingMethod_$Method$() {\n"
+ " ::grpc::Service::MarkMethodStreamed($Idx$,\n"
+ " new ::grpc::internal::SplitServerStreamingHandler<\n"
+ " $Request$, $Response$>(\n"
+ " [this](::grpc::ServerContext* context,\n"
+ " ::grpc::ServerSplitStreamer<\n"
+ " $Request$, $Response$>* streamer) {\n"
+ " return this->Streamed$Method$(context,\n"
+ " streamer);\n"
+ " }));\n"
+ "}\n");
+ printer->Print(*vars,
"~WithSplitStreamingMethod_$Method$() override {\n"
" BaseClassMustBeDerivedFromService(this);\n"
"}\n");
@@ -1409,9 +1409,9 @@ void PrintHeaderServerMethodSplitStreaming(
}
}
-void PrintHeaderServerMethodGeneric(grpc_generator::Printer* printer,
- const grpc_generator::Method* method,
- std::map<TString, TString>* vars) {
+void PrintHeaderServerMethodGeneric(grpc_generator::Printer* printer,
+ const grpc_generator::Method* method,
+ std::map<TString, TString>* vars) {
(*vars)["Method"] = method->name();
(*vars)["Request"] = method->input_type_name();
(*vars)["Response"] = method->output_type_name();
@@ -1482,7 +1482,7 @@ void PrintHeaderServerMethodGeneric(grpc_generator::Printer* printer,
void PrintHeaderServerMethodRaw(grpc_generator::Printer* printer,
const grpc_generator::Method* method,
- std::map<TString, TString>* vars) {
+ std::map<TString, TString>* vars) {
(*vars)["Method"] = method->name();
// These will be disabled
(*vars)["Request"] = method->input_type_name();
@@ -1513,7 +1513,7 @@ void PrintHeaderServerMethodRaw(grpc_generator::Printer* printer,
void PrintHeaderService(grpc_generator::Printer* printer,
const grpc_generator::Service* service,
- std::map<TString, TString>* vars) {
+ std::map<TString, TString>* vars) {
(*vars)["Service"] = service->name();
printer->Print(service->GetLeadingComments("//").c_str());
@@ -1629,7 +1629,20 @@ void PrintHeaderService(grpc_generator::Printer* printer,
PrintHeaderServerMethodCallback(printer, service->method(i).get(), vars);
}
- printer->Print("#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n");
+ printer->Print("#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n");
+ printer->Print("typedef ");
+
+ for (int i = 0; i < service->method_count(); ++i) {
+ (*vars)["method_name"] = service->method(i)->name();
+ printer->Print(*vars, "ExperimentalWithCallbackMethod_$method_name$<");
+ }
+ printer->Print("Service");
+ for (int i = 0; i < service->method_count(); ++i) {
+ printer->Print(" >");
+ }
+ printer->Print(" CallbackService;\n");
+ printer->Print("#endif\n\n");
+
printer->Print("typedef ");
for (int i = 0; i < service->method_count(); ++i) {
@@ -1640,19 +1653,6 @@ void PrintHeaderService(grpc_generator::Printer* printer,
for (int i = 0; i < service->method_count(); ++i) {
printer->Print(" >");
}
- printer->Print(" CallbackService;\n");
- printer->Print("#endif\n\n");
-
- printer->Print("typedef ");
-
- for (int i = 0; i < service->method_count(); ++i) {
- (*vars)["method_name"] = service->method(i)->name();
- printer->Print(*vars, "ExperimentalWithCallbackMethod_$method_name$<");
- }
- printer->Print("Service");
- for (int i = 0; i < service->method_count(); ++i) {
- printer->Print(" >");
- }
printer->Print(" ExperimentalCallbackService;\n");
// Server side - Generic
@@ -1746,13 +1746,13 @@ void PrintHeaderService(grpc_generator::Printer* printer,
printer->Print(service->GetTrailingComments("//").c_str());
}
-TString GetHeaderServices(grpc_generator::File* file,
- const Parameters& params) {
- TString output;
+TString GetHeaderServices(grpc_generator::File* file,
+ const Parameters& params) {
+ TString output;
{
// Scope the output stream so it closes and finalizes output to the string.
auto printer = file->CreatePrinter(&output);
- std::map<TString, TString> vars;
+ std::map<TString, TString> vars;
// Package string is empty or ends with a dot. It is used to fully qualify
// method names.
vars["Package"] = file->package();
@@ -1777,19 +1777,19 @@ TString GetHeaderServices(grpc_generator::File* file,
return output;
}
-TString GetHeaderEpilogue(grpc_generator::File* file,
- const Parameters& /*params*/) {
- TString output;
+TString GetHeaderEpilogue(grpc_generator::File* file,
+ const Parameters& /*params*/) {
+ TString output;
{
// Scope the output stream so it closes and finalizes output to the string.
auto printer = file->CreatePrinter(&output);
- std::map<TString, TString> vars;
+ std::map<TString, TString> vars;
vars["filename"] = file->filename();
vars["filename_identifier"] = FilenameIdentifier(file->filename());
if (!file->package().empty()) {
- std::vector<TString> parts = file->package_parts();
+ std::vector<TString> parts = file->package_parts();
for (auto part = parts.rbegin(); part != parts.rend(); part++) {
vars["part"] = *part;
@@ -1806,13 +1806,13 @@ TString GetHeaderEpilogue(grpc_generator::File* file,
return output;
}
-TString GetSourcePrologue(grpc_generator::File* file,
- const Parameters& params) {
- TString output;
+TString GetSourcePrologue(grpc_generator::File* file,
+ const Parameters& params) {
+ TString output;
{
// Scope the output stream so it closes and finalizes output to the string.
auto printer = file->CreatePrinter(&output);
- std::map<TString, TString> vars;
+ std::map<TString, TString> vars;
vars["filename"] = file->filename();
vars["filename_base"] = file->filename_without_ext();
@@ -1833,13 +1833,13 @@ TString GetSourcePrologue(grpc_generator::File* file,
return output;
}
-TString GetSourceIncludes(grpc_generator::File* file,
- const Parameters& params) {
- TString output;
+TString GetSourceIncludes(grpc_generator::File* file,
+ const Parameters& params) {
+ TString output;
{
// Scope the output stream so it closes and finalizes output to the string.
auto printer = file->CreatePrinter(&output);
- std::map<TString, TString> vars;
+ std::map<TString, TString> vars;
static const char* headers_strs[] = {
"functional",
"grpcpp/impl/codegen/async_stream.h",
@@ -1847,7 +1847,7 @@ TString GetSourceIncludes(grpc_generator::File* file,
"grpcpp/impl/codegen/channel_interface.h",
"grpcpp/impl/codegen/client_unary_call.h",
"grpcpp/impl/codegen/client_callback.h",
- "grpcpp/impl/codegen/message_allocator.h",
+ "grpcpp/impl/codegen/message_allocator.h",
"grpcpp/impl/codegen/method_handler.h",
"grpcpp/impl/codegen/rpc_service_method.h",
"grpcpp/impl/codegen/server_callback.h",
@@ -1855,12 +1855,12 @@ TString GetSourceIncludes(grpc_generator::File* file,
"grpcpp/impl/codegen/server_context.h",
"grpcpp/impl/codegen/service_type.h",
"grpcpp/impl/codegen/sync_stream.h"};
- std::vector<TString> headers(headers_strs, array_end(headers_strs));
+ std::vector<TString> headers(headers_strs, array_end(headers_strs));
PrintIncludes(printer.get(), headers, params.use_system_headers,
params.grpc_search_path);
if (!file->package().empty()) {
- std::vector<TString> parts = file->package_parts();
+ std::vector<TString> parts = file->package_parts();
for (auto part = parts.begin(); part != parts.end(); part++) {
vars["part"] = *part;
@@ -1875,15 +1875,15 @@ TString GetSourceIncludes(grpc_generator::File* file,
void PrintSourceClientMethod(grpc_generator::Printer* printer,
const grpc_generator::Method* method,
- std::map<TString, TString>* vars) {
+ std::map<TString, TString>* vars) {
(*vars)["Method"] = method->name();
(*vars)["Request"] = method->input_type_name();
(*vars)["Response"] = method->output_type_name();
struct {
- TString prefix;
- TString start; // bool literal expressed as string
- TString method_params; // extra arguments to method
- TString create_args; // extra arguments to creator
+ TString prefix;
+ TString start; // bool literal expressed as string
+ TString method_params; // extra arguments to method
+ TString create_args; // extra arguments to creator
} async_prefixes[] = {{"Async", "true", ", void* tag", ", tag"},
{"PrepareAsync", "false", "", ", nullptr"}};
if (method->NoStreaming()) {
@@ -1902,7 +1902,7 @@ void PrintSourceClientMethod(grpc_generator::Printer* printer,
"const $Request$* request, $Response$* response, "
"std::function<void(::grpc::Status)> f) {\n");
printer->Print(*vars,
- " ::grpc::internal::CallbackUnaryCall"
+ " ::grpc::internal::CallbackUnaryCall"
"(stub_->channel_.get(), stub_->rpcmethod_$Method$_, "
"context, request, response, std::move(f));\n}\n\n");
@@ -1912,42 +1912,42 @@ void PrintSourceClientMethod(grpc_generator::Printer* printer,
"const $Request$* request, $Response$* response, "
"::grpc::experimental::ClientUnaryReactor* reactor) {\n");
printer->Print(*vars,
- " ::grpc::internal::ClientCallbackUnaryFactory::Create"
+ " ::grpc::internal::ClientCallbackUnaryFactory::Create"
"(stub_->channel_.get(), stub_->rpcmethod_$Method$_, "
"context, request, response, reactor);\n}\n\n");
printer->Print(*vars,
- "::grpc::ClientAsyncResponseReader< $Response$>* "
- "$ns$$Service$::Stub::PrepareAsync$Method$Raw(::grpc::"
- "ClientContext* context, "
- "const $Request$& request, "
- "::grpc::CompletionQueue* cq) {\n");
+ "::grpc::ClientAsyncResponseReader< $Response$>* "
+ "$ns$$Service$::Stub::PrepareAsync$Method$Raw(::grpc::"
+ "ClientContext* context, "
+ "const $Request$& request, "
+ "::grpc::CompletionQueue* cq) {\n");
+ printer->Print(*vars,
+ " return "
+ "::grpc::internal::ClientAsyncResponseReaderFactory"
+ "< $Response$>::Create(channel_.get(), cq, "
+ "rpcmethod_$Method$_, "
+ "context, request, false);\n"
+ "}\n\n");
+ printer->Print(*vars,
+ "::grpc::ClientAsyncResponseReader< $Response$>* "
+ "$ns$$Service$::Stub::Async$Method$Raw(::grpc::"
+ "ClientContext* context, "
+ "const $Request$& request, "
+ "::grpc::CompletionQueue* cq) {\n");
printer->Print(*vars,
- " return "
- "::grpc::internal::ClientAsyncResponseReaderFactory"
- "< $Response$>::Create(channel_.get(), cq, "
- "rpcmethod_$Method$_, "
- "context, request, false);\n"
- "}\n\n");
- printer->Print(*vars,
- "::grpc::ClientAsyncResponseReader< $Response$>* "
- "$ns$$Service$::Stub::Async$Method$Raw(::grpc::"
- "ClientContext* context, "
- "const $Request$& request, "
- "::grpc::CompletionQueue* cq) {\n");
- printer->Print(*vars,
- " auto* result =\n"
- " this->PrepareAsync$Method$Raw(context, request, cq);\n"
- " result->StartCall();\n"
- " return result;\n"
- "}\n\n");
+ " auto* result =\n"
+ " this->PrepareAsync$Method$Raw(context, request, cq);\n"
+ " result->StartCall();\n"
+ " return result;\n"
+ "}\n\n");
} else if (ClientOnlyStreaming(method)) {
printer->Print(*vars,
"::grpc::ClientWriter< $Request$>* "
"$ns$$Service$::Stub::$Method$Raw("
"::grpc::ClientContext* context, $Response$* response) {\n");
printer->Print(*vars,
- " return ::grpc::internal::ClientWriterFactory< "
+ " return ::grpc::internal::ClientWriterFactory< "
"$Request$>::Create("
"channel_.get(), "
"rpcmethod_$Method$_, "
@@ -1961,7 +1961,7 @@ void PrintSourceClientMethod(grpc_generator::Printer* printer,
"$Response$* response, "
"::grpc::experimental::ClientWriteReactor< $Request$>* reactor) {\n");
printer->Print(*vars,
- " ::grpc::internal::ClientCallbackWriterFactory< "
+ " ::grpc::internal::ClientCallbackWriterFactory< "
"$Request$>::Create("
"stub_->channel_.get(), "
"stub_->rpcmethod_$Method$_, "
@@ -1980,7 +1980,7 @@ void PrintSourceClientMethod(grpc_generator::Printer* printer,
"::grpc::CompletionQueue* cq$AsyncMethodParams$) {\n");
printer->Print(
*vars,
- " return ::grpc::internal::ClientAsyncWriterFactory< $Request$>"
+ " return ::grpc::internal::ClientAsyncWriterFactory< $Request$>"
"::Create(channel_.get(), cq, "
"rpcmethod_$Method$_, "
"context, response, $AsyncStart$$AsyncCreateArgs$);\n"
@@ -1993,7 +1993,7 @@ void PrintSourceClientMethod(grpc_generator::Printer* printer,
"$ns$$Service$::Stub::$Method$Raw("
"::grpc::ClientContext* context, const $Request$& request) {\n");
printer->Print(*vars,
- " return ::grpc::internal::ClientReaderFactory< "
+ " return ::grpc::internal::ClientReaderFactory< "
"$Response$>::Create("
"channel_.get(), "
"rpcmethod_$Method$_, "
@@ -2007,7 +2007,7 @@ void PrintSourceClientMethod(grpc_generator::Printer* printer,
"$Request$* request, "
"::grpc::experimental::ClientReadReactor< $Response$>* reactor) {\n");
printer->Print(*vars,
- " ::grpc::internal::ClientCallbackReaderFactory< "
+ " ::grpc::internal::ClientCallbackReaderFactory< "
"$Response$>::Create("
"stub_->channel_.get(), "
"stub_->rpcmethod_$Method$_, "
@@ -2025,13 +2025,13 @@ void PrintSourceClientMethod(grpc_generator::Printer* printer,
"$ns$$Service$::Stub::$AsyncPrefix$$Method$Raw("
"::grpc::ClientContext* context, const $Request$& request, "
"::grpc::CompletionQueue* cq$AsyncMethodParams$) {\n");
- printer->Print(*vars,
- " return ::grpc::internal::ClientAsyncReaderFactory< "
- "$Response$>"
- "::Create(channel_.get(), cq, "
- "rpcmethod_$Method$_, "
- "context, request, $AsyncStart$$AsyncCreateArgs$);\n"
- "}\n\n");
+ printer->Print(*vars,
+ " return ::grpc::internal::ClientAsyncReaderFactory< "
+ "$Response$>"
+ "::Create(channel_.get(), cq, "
+ "rpcmethod_$Method$_, "
+ "context, request, $AsyncStart$$AsyncCreateArgs$);\n"
+ "}\n\n");
}
} else if (method->BidiStreaming()) {
printer->Print(
@@ -2039,7 +2039,7 @@ void PrintSourceClientMethod(grpc_generator::Printer* printer,
"::grpc::ClientReaderWriter< $Request$, $Response$>* "
"$ns$$Service$::Stub::$Method$Raw(::grpc::ClientContext* context) {\n");
printer->Print(*vars,
- " return ::grpc::internal::ClientReaderWriterFactory< "
+ " return ::grpc::internal::ClientReaderWriterFactory< "
"$Request$, $Response$>::Create("
"channel_.get(), "
"rpcmethod_$Method$_, "
@@ -2052,13 +2052,13 @@ void PrintSourceClientMethod(grpc_generator::Printer* printer,
"ClientContext* context, "
"::grpc::experimental::ClientBidiReactor< $Request$,$Response$>* "
"reactor) {\n");
- printer->Print(*vars,
- " ::grpc::internal::ClientCallbackReaderWriterFactory< "
- "$Request$,$Response$>::Create("
- "stub_->channel_.get(), "
- "stub_->rpcmethod_$Method$_, "
- "context, reactor);\n"
- "}\n\n");
+ printer->Print(*vars,
+ " ::grpc::internal::ClientCallbackReaderWriterFactory< "
+ "$Request$,$Response$>::Create("
+ "stub_->channel_.get(), "
+ "stub_->rpcmethod_$Method$_, "
+ "context, reactor);\n"
+ "}\n\n");
for (auto async_prefix : async_prefixes) {
(*vars)["AsyncPrefix"] = async_prefix.prefix;
@@ -2072,7 +2072,7 @@ void PrintSourceClientMethod(grpc_generator::Printer* printer,
"::grpc::CompletionQueue* cq$AsyncMethodParams$) {\n");
printer->Print(*vars,
" return "
- "::grpc::internal::ClientAsyncReaderWriterFactory< "
+ "::grpc::internal::ClientAsyncReaderWriterFactory< "
"$Request$, $Response$>::Create("
"channel_.get(), cq, "
"rpcmethod_$Method$_, "
@@ -2084,7 +2084,7 @@ void PrintSourceClientMethod(grpc_generator::Printer* printer,
void PrintSourceServerMethod(grpc_generator::Printer* printer,
const grpc_generator::Method* method,
- std::map<TString, TString>* vars) {
+ std::map<TString, TString>* vars) {
(*vars)["Method"] = method->name();
(*vars)["Request"] = method->input_type_name();
(*vars)["Response"] = method->output_type_name();
@@ -2143,7 +2143,7 @@ void PrintSourceServerMethod(grpc_generator::Printer* printer,
void PrintSourceService(grpc_generator::Printer* printer,
const grpc_generator::Service* service,
- std::map<TString, TString>* vars) {
+ std::map<TString, TString>* vars) {
(*vars)["Service"] = service->name();
if (service->method_count() > 0) {
@@ -2218,12 +2218,12 @@ void PrintSourceService(grpc_generator::Printer* printer,
" new ::grpc::internal::RpcMethodHandler< $ns$$Service$::Service, "
"$Request$, "
"$Response$>(\n"
- " []($ns$$Service$::Service* service,\n"
- " ::grpc::ServerContext* ctx,\n"
- " const $Request$* req,\n"
- " $Response$* resp) {\n"
- " return service->$Method$(ctx, req, resp);\n"
- " }, this)));\n");
+ " []($ns$$Service$::Service* service,\n"
+ " ::grpc::ServerContext* ctx,\n"
+ " const $Request$* req,\n"
+ " $Response$* resp) {\n"
+ " return service->$Method$(ctx, req, resp);\n"
+ " }, this)));\n");
} else if (ClientOnlyStreaming(method.get())) {
printer->Print(
*vars,
@@ -2232,12 +2232,12 @@ void PrintSourceService(grpc_generator::Printer* printer,
" ::grpc::internal::RpcMethod::CLIENT_STREAMING,\n"
" new ::grpc::internal::ClientStreamingHandler< "
"$ns$$Service$::Service, $Request$, $Response$>(\n"
- " []($ns$$Service$::Service* service,\n"
- " ::grpc::ServerContext* ctx,\n"
- " ::grpc::ServerReader<$Request$>* reader,\n"
- " $Response$* resp) {\n"
- " return service->$Method$(ctx, reader, resp);\n"
- " }, this)));\n");
+ " []($ns$$Service$::Service* service,\n"
+ " ::grpc::ServerContext* ctx,\n"
+ " ::grpc::ServerReader<$Request$>* reader,\n"
+ " $Response$* resp) {\n"
+ " return service->$Method$(ctx, reader, resp);\n"
+ " }, this)));\n");
} else if (ServerOnlyStreaming(method.get())) {
printer->Print(
*vars,
@@ -2246,25 +2246,25 @@ void PrintSourceService(grpc_generator::Printer* printer,
" ::grpc::internal::RpcMethod::SERVER_STREAMING,\n"
" new ::grpc::internal::ServerStreamingHandler< "
"$ns$$Service$::Service, $Request$, $Response$>(\n"
- " []($ns$$Service$::Service* service,\n"
- " ::grpc::ServerContext* ctx,\n"
- " const $Request$* req,\n"
- " ::grpc::ServerWriter<$Response$>* writer) {\n"
- " return service->$Method$(ctx, req, writer);\n"
- " }, this)));\n");
+ " []($ns$$Service$::Service* service,\n"
+ " ::grpc::ServerContext* ctx,\n"
+ " const $Request$* req,\n"
+ " ::grpc::ServerWriter<$Response$>* writer) {\n"
+ " return service->$Method$(ctx, req, writer);\n"
+ " }, this)));\n");
} else if (method->BidiStreaming()) {
- printer->Print(*vars,
- "AddMethod(new ::grpc::internal::RpcServiceMethod(\n"
- " $prefix$$Service$_method_names[$Idx$],\n"
- " ::grpc::internal::RpcMethod::BIDI_STREAMING,\n"
- " new ::grpc::internal::BidiStreamingHandler< "
- "$ns$$Service$::Service, $Request$, $Response$>(\n"
- " []($ns$$Service$::Service* service,\n"
- " ::grpc::ServerContext* ctx,\n"
- " ::grpc::ServerReaderWriter<$Response$,\n"
- " $Request$>* stream) {\n"
- " return service->$Method$(ctx, stream);\n"
- " }, this)));\n");
+ printer->Print(*vars,
+ "AddMethod(new ::grpc::internal::RpcServiceMethod(\n"
+ " $prefix$$Service$_method_names[$Idx$],\n"
+ " ::grpc::internal::RpcMethod::BIDI_STREAMING,\n"
+ " new ::grpc::internal::BidiStreamingHandler< "
+ "$ns$$Service$::Service, $Request$, $Response$>(\n"
+ " []($ns$$Service$::Service* service,\n"
+ " ::grpc::ServerContext* ctx,\n"
+ " ::grpc::ServerReaderWriter<$Response$,\n"
+ " $Request$>* stream) {\n"
+ " return service->$Method$(ctx, stream);\n"
+ " }, this)));\n");
}
}
printer->Outdent();
@@ -2278,13 +2278,13 @@ void PrintSourceService(grpc_generator::Printer* printer,
}
}
-TString GetSourceServices(grpc_generator::File* file,
- const Parameters& params) {
- TString output;
+TString GetSourceServices(grpc_generator::File* file,
+ const Parameters& params) {
+ TString output;
{
// Scope the output stream so it closes and finalizes output to the string.
auto printer = file->CreatePrinter(&output);
- std::map<TString, TString> vars;
+ std::map<TString, TString> vars;
// Package string is empty or ends with a dot. It is used to fully qualify
// method names.
vars["Package"] = file->package();
@@ -2307,12 +2307,12 @@ TString GetSourceServices(grpc_generator::File* file,
return output;
}
-TString GetSourceEpilogue(grpc_generator::File* file,
- const Parameters& /*params*/) {
- TString temp;
+TString GetSourceEpilogue(grpc_generator::File* file,
+ const Parameters& /*params*/) {
+ TString temp;
if (!file->package().empty()) {
- std::vector<TString> parts = file->package_parts();
+ std::vector<TString> parts = file->package_parts();
for (auto part = parts.begin(); part != parts.end(); part++) {
temp.append("} // namespace ");
@@ -2326,13 +2326,13 @@ TString GetSourceEpilogue(grpc_generator::File* file,
}
// TODO(mmukhi): Make sure we need parameters or not.
-TString GetMockPrologue(grpc_generator::File* file,
- const Parameters& params) {
- TString output;
+TString GetMockPrologue(grpc_generator::File* file,
+ const Parameters& params) {
+ TString output;
{
// Scope the output stream so it closes and finalizes output to the string.
auto printer = file->CreatePrinter(&output);
- std::map<TString, TString> vars;
+ std::map<TString, TString> vars;
vars["filename"] = file->filename();
vars["filename_base"] = file->filename_without_ext();
@@ -2349,9 +2349,9 @@ TString GetMockPrologue(grpc_generator::File* file,
printer->Print(vars, "#include \"$filename_base$$message_header_ext$\"\n");
printer->Print(vars, "#include \"$filename_base$$service_header_ext$\"\n");
if (params.include_import_headers) {
- const std::vector<TString> import_names = file->GetImportNames();
+ const std::vector<TString> import_names = file->GetImportNames();
for (const auto& import_name : import_names) {
- const TString include_name = ImportInludeFromProtoName(import_name);
+ const TString include_name = ImportInludeFromProtoName(import_name);
printer->Print(vars, include_name.c_str());
}
printer->PrintRaw("\n");
@@ -2363,23 +2363,23 @@ TString GetMockPrologue(grpc_generator::File* file,
}
// TODO(mmukhi): Add client-stream and completion-queue headers.
-TString GetMockIncludes(grpc_generator::File* file,
- const Parameters& params) {
- TString output;
+TString GetMockIncludes(grpc_generator::File* file,
+ const Parameters& params) {
+ TString output;
{
// Scope the output stream so it closes and finalizes output to the string.
auto printer = file->CreatePrinter(&output);
- std::map<TString, TString> vars;
+ std::map<TString, TString> vars;
static const char* headers_strs[] = {
"grpcpp/impl/codegen/async_stream.h",
"grpcpp/impl/codegen/sync_stream.h",
};
- std::vector<TString> headers(headers_strs, array_end(headers_strs));
+ std::vector<TString> headers(headers_strs, array_end(headers_strs));
PrintIncludes(printer.get(), headers, params.use_system_headers,
params.grpc_search_path);
- std::vector<TString> gmock_header;
+ std::vector<TString> gmock_header;
if (params.gmock_search_path.empty()) {
gmock_header.push_back("gmock/gmock.h");
PrintIncludes(printer.get(), gmock_header, params.use_system_headers,
@@ -2392,7 +2392,7 @@ TString GetMockIncludes(grpc_generator::File* file,
}
if (!file->package().empty()) {
- std::vector<TString> parts = file->package_parts();
+ std::vector<TString> parts = file->package_parts();
for (auto part = parts.begin(); part != parts.end(); part++) {
vars["part"] = *part;
@@ -2407,14 +2407,14 @@ TString GetMockIncludes(grpc_generator::File* file,
void PrintMockClientMethods(grpc_generator::Printer* printer,
const grpc_generator::Method* method,
- std::map<TString, TString>* vars) {
+ std::map<TString, TString>* vars) {
(*vars)["Method"] = method->name();
(*vars)["Request"] = method->input_type_name();
(*vars)["Response"] = method->output_type_name();
struct {
- TString prefix;
- TString method_params; // extra arguments to method
+ TString prefix;
+ TString method_params; // extra arguments to method
int extra_method_param_count;
} async_prefixes[] = {{"Async", ", void* tag", 1}, {"PrepareAsync", "", 0}};
@@ -2442,7 +2442,7 @@ void PrintMockClientMethods(grpc_generator::Printer* printer,
(*vars)["AsyncPrefix"] = async_prefix.prefix;
(*vars)["AsyncMethodParams"] = async_prefix.method_params;
(*vars)["MockArgs"] =
- ToString(3 + async_prefix.extra_method_param_count);
+ ToString(3 + async_prefix.extra_method_param_count);
printer->Print(*vars,
"MOCK_METHOD$MockArgs$($AsyncPrefix$$Method$Raw, "
"::grpc::ClientAsyncWriterInterface< $Request$>*"
@@ -2459,7 +2459,7 @@ void PrintMockClientMethods(grpc_generator::Printer* printer,
(*vars)["AsyncPrefix"] = async_prefix.prefix;
(*vars)["AsyncMethodParams"] = async_prefix.method_params;
(*vars)["MockArgs"] =
- ToString(3 + async_prefix.extra_method_param_count);
+ ToString(3 + async_prefix.extra_method_param_count);
printer->Print(
*vars,
"MOCK_METHOD$MockArgs$($AsyncPrefix$$Method$Raw, "
@@ -2477,7 +2477,7 @@ void PrintMockClientMethods(grpc_generator::Printer* printer,
(*vars)["AsyncPrefix"] = async_prefix.prefix;
(*vars)["AsyncMethodParams"] = async_prefix.method_params;
(*vars)["MockArgs"] =
- ToString(2 + async_prefix.extra_method_param_count);
+ ToString(2 + async_prefix.extra_method_param_count);
printer->Print(
*vars,
"MOCK_METHOD$MockArgs$($AsyncPrefix$$Method$Raw, "
@@ -2491,7 +2491,7 @@ void PrintMockClientMethods(grpc_generator::Printer* printer,
void PrintMockService(grpc_generator::Printer* printer,
const grpc_generator::Service* service,
- std::map<TString, TString>* vars) {
+ std::map<TString, TString>* vars) {
(*vars)["Service"] = service->name();
printer->Print(*vars,
@@ -2505,13 +2505,13 @@ void PrintMockService(grpc_generator::Printer* printer,
printer->Print("};\n");
}
-TString GetMockServices(grpc_generator::File* file,
- const Parameters& params) {
- TString output;
+TString GetMockServices(grpc_generator::File* file,
+ const Parameters& params) {
+ TString output;
{
// Scope the output stream so it closes and finalizes output to the string.
auto printer = file->CreatePrinter(&output);
- std::map<TString, TString> vars;
+ std::map<TString, TString> vars;
// Package string is empty or ends with a dot. It is used to fully qualify
// method names.
vars["Package"] = file->package();
@@ -2536,12 +2536,12 @@ TString GetMockServices(grpc_generator::File* file,
return output;
}
-TString GetMockEpilogue(grpc_generator::File* file,
- const Parameters& /*params*/) {
- TString temp;
+TString GetMockEpilogue(grpc_generator::File* file,
+ const Parameters& /*params*/) {
+ TString temp;
if (!file->package().empty()) {
- std::vector<TString> parts = file->package_parts();
+ std::vector<TString> parts = file->package_parts();
for (auto part = parts.begin(); part != parts.end(); part++) {
temp.append("} // namespace ");
diff --git a/contrib/libs/grpc/src/compiler/cpp_generator.h b/contrib/libs/grpc/src/compiler/cpp_generator.h
index 7ace6f270f1..606b850a874 100644
--- a/contrib/libs/grpc/src/compiler/cpp_generator.h
+++ b/contrib/libs/grpc/src/compiler/cpp_generator.h
@@ -24,22 +24,22 @@
// FlatBuffers.
#include <memory>
-#include <util/generic/string.h>
+#include <util/generic/string.h>
#include <vector>
#include "src/compiler/config.h"
#include "src/compiler/schema_interface.h"
-#ifdef GRPC_CUSTOM_STRING
-#warning GRPC_CUSTOM_STRING is no longer supported. Please use TString.
+#ifdef GRPC_CUSTOM_STRING
+#warning GRPC_CUSTOM_STRING is no longer supported. Please use TString.
#endif
namespace grpc {
-// Using grpc::string and grpc::to_string is discouraged in favor of
-// TString and ToString. This is only for legacy code using
-// them explictly.
-typedef TString string; // deprecated
+// Using grpc::string and grpc::to_string is discouraged in favor of
+// TString and ToString. This is only for legacy code using
+// them explictly.
+typedef TString string; // deprecated
} // namespace grpc
@@ -48,86 +48,86 @@ namespace grpc_cpp_generator {
// Contains all the parameters that are parsed from the command line.
struct Parameters {
// Puts the service into a namespace
- TString services_namespace;
+ TString services_namespace;
// Use system includes (<>) or local includes ("")
bool use_system_headers;
// Prefix to any grpc include
- TString grpc_search_path;
+ TString grpc_search_path;
// Generate Google Mock code to facilitate unit testing.
bool generate_mock_code;
// Google Mock search path, when non-empty, local includes will be used.
- TString gmock_search_path;
+ TString gmock_search_path;
// *EXPERIMENTAL* Additional include files in grpc.pb.h
- std::vector<TString> additional_header_includes;
+ std::vector<TString> additional_header_includes;
// By default, use "pb.h"
- TString message_header_extension;
+ TString message_header_extension;
// Whether to include headers corresponding to imports in source file.
bool include_import_headers;
};
// Return the prologue of the generated header file.
-TString GetHeaderPrologue(grpc_generator::File* file,
- const Parameters& params);
+TString GetHeaderPrologue(grpc_generator::File* file,
+ const Parameters& params);
// Return the includes needed for generated header file.
-TString GetHeaderIncludes(grpc_generator::File* file,
- const Parameters& params);
+TString GetHeaderIncludes(grpc_generator::File* file,
+ const Parameters& params);
// Return the includes needed for generated source file.
-TString GetSourceIncludes(grpc_generator::File* file,
- const Parameters& params);
+TString GetSourceIncludes(grpc_generator::File* file,
+ const Parameters& params);
// Return the epilogue of the generated header file.
-TString GetHeaderEpilogue(grpc_generator::File* file,
- const Parameters& params);
+TString GetHeaderEpilogue(grpc_generator::File* file,
+ const Parameters& params);
// Return the prologue of the generated source file.
-TString GetSourcePrologue(grpc_generator::File* file,
- const Parameters& params);
+TString GetSourcePrologue(grpc_generator::File* file,
+ const Parameters& params);
// Return the services for generated header file.
-TString GetHeaderServices(grpc_generator::File* file,
- const Parameters& params);
+TString GetHeaderServices(grpc_generator::File* file,
+ const Parameters& params);
// Return the services for generated source file.
-TString GetSourceServices(grpc_generator::File* file,
- const Parameters& params);
+TString GetSourceServices(grpc_generator::File* file,
+ const Parameters& params);
// Return the epilogue of the generated source file.
-TString GetSourceEpilogue(grpc_generator::File* file,
- const Parameters& params);
+TString GetSourceEpilogue(grpc_generator::File* file,
+ const Parameters& params);
// Return the prologue of the generated mock file.
-TString GetMockPrologue(grpc_generator::File* file,
- const Parameters& params);
+TString GetMockPrologue(grpc_generator::File* file,
+ const Parameters& params);
// Return the includes needed for generated mock file.
-TString GetMockIncludes(grpc_generator::File* file,
- const Parameters& params);
+TString GetMockIncludes(grpc_generator::File* file,
+ const Parameters& params);
// Return the services for generated mock file.
-TString GetMockServices(grpc_generator::File* file,
- const Parameters& params);
+TString GetMockServices(grpc_generator::File* file,
+ const Parameters& params);
// Return the epilogue of generated mock file.
-TString GetMockEpilogue(grpc_generator::File* file,
- const Parameters& params);
+TString GetMockEpilogue(grpc_generator::File* file,
+ const Parameters& params);
// Return the prologue of the generated mock file.
-TString GetMockPrologue(grpc_generator::File* file,
- const Parameters& params);
+TString GetMockPrologue(grpc_generator::File* file,
+ const Parameters& params);
// Return the includes needed for generated mock file.
-TString GetMockIncludes(grpc_generator::File* file,
- const Parameters& params);
+TString GetMockIncludes(grpc_generator::File* file,
+ const Parameters& params);
// Return the services for generated mock file.
-TString GetMockServices(grpc_generator::File* file,
- const Parameters& params);
+TString GetMockServices(grpc_generator::File* file,
+ const Parameters& params);
// Return the epilogue of generated mock file.
-TString GetMockEpilogue(grpc_generator::File* file,
- const Parameters& params);
+TString GetMockEpilogue(grpc_generator::File* file,
+ const Parameters& params);
} // namespace grpc_cpp_generator
diff --git a/contrib/libs/grpc/src/compiler/cpp_generator_helpers.h b/contrib/libs/grpc/src/compiler/cpp_generator_helpers.h
index b50c75ef1bb..2e34d53a65d 100644
--- a/contrib/libs/grpc/src/compiler/cpp_generator_helpers.h
+++ b/contrib/libs/grpc/src/compiler/cpp_generator_helpers.h
@@ -26,23 +26,23 @@
namespace grpc_cpp_generator {
-inline TString DotsToColons(const TString& name) {
+inline TString DotsToColons(const TString& name) {
return grpc_generator::StringReplace(name, ".", "::");
}
-inline TString DotsToUnderscores(const TString& name) {
+inline TString DotsToUnderscores(const TString& name) {
return grpc_generator::StringReplace(name, ".", "_");
}
-inline TString ClassName(const grpc::protobuf::Descriptor* descriptor,
- bool qualified) {
+inline TString ClassName(const grpc::protobuf::Descriptor* descriptor,
+ bool qualified) {
// Find "outer", the descriptor of the top-level message in which
// "descriptor" is embedded.
const grpc::protobuf::Descriptor* outer = descriptor;
while (outer->containing_type() != NULL) outer = outer->containing_type();
- const TString& outer_name = outer->full_name();
- TString inner_name = descriptor->full_name().substr(outer_name.size());
+ const TString& outer_name = outer->full_name();
+ TString inner_name = descriptor->full_name().substr(outer_name.size());
if (qualified) {
return "::" + DotsToColons(outer_name) + DotsToUnderscores(inner_name);
@@ -54,7 +54,7 @@ inline TString ClassName(const grpc::protobuf::Descriptor* descriptor,
// Get leading or trailing comments in a string. Comment lines start with "// ".
// Leading detached comments are put in front of leading comments.
template <typename DescriptorType>
-inline TString GetCppComments(const DescriptorType* desc, bool leading) {
+inline TString GetCppComments(const DescriptorType* desc, bool leading) {
return grpc_generator::GetPrefixedComments(desc, leading, "//");
}
diff --git a/contrib/libs/grpc/src/compiler/cpp_plugin.h b/contrib/libs/grpc/src/compiler/cpp_plugin.h
index bb48ed0388e..0c289a7395b 100644
--- a/contrib/libs/grpc/src/compiler/cpp_plugin.h
+++ b/contrib/libs/grpc/src/compiler/cpp_plugin.h
@@ -34,14 +34,14 @@ class CppGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator {
CppGrpcGenerator() {}
virtual ~CppGrpcGenerator() {}
- uint64_t GetSupportedFeatures() const override {
- return FEATURE_PROTO3_OPTIONAL;
- }
-
+ uint64_t GetSupportedFeatures() const override {
+ return FEATURE_PROTO3_OPTIONAL;
+ }
+
virtual bool Generate(const grpc::protobuf::FileDescriptor* file,
- const TString& parameter,
+ const TString& parameter,
grpc::protobuf::compiler::GeneratorContext* context,
- TString* error) const override {
+ TString* error) const override {
if (file->options().cc_generic_services()) {
*error =
"cpp grpc proto compiler plugin does not work with generic "
@@ -58,11 +58,11 @@ class CppGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator {
ProtoBufFile pbfile(file);
if (!parameter.empty()) {
- std::vector<TString> parameters_list =
+ std::vector<TString> parameters_list =
grpc_generator::tokenize(parameter, ",");
for (auto parameter_string = parameters_list.begin();
parameter_string != parameters_list.end(); parameter_string++) {
- std::vector<TString> param =
+ std::vector<TString> param =
grpc_generator::tokenize(*parameter_string, "=");
if (param[0] == "services_namespace") {
generator_parameters.services_namespace = param[1];
@@ -72,7 +72,7 @@ class CppGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator {
} else if (param[1] == "false") {
generator_parameters.use_system_headers = false;
} else {
- *error = TString("Invalid parameter: ") + *parameter_string;
+ *error = TString("Invalid parameter: ") + *parameter_string;
return false;
}
} else if (param[0] == "grpc_search_path") {
@@ -81,7 +81,7 @@ class CppGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator {
if (param[1] == "true") {
generator_parameters.generate_mock_code = true;
} else if (param[1] != "false") {
- *error = TString("Invalid parameter: ") + *parameter_string;
+ *error = TString("Invalid parameter: ") + *parameter_string;
return false;
}
} else if (param[0] == "gmock_search_path") {
@@ -95,19 +95,19 @@ class CppGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator {
if (param[1] == "true") {
generator_parameters.include_import_headers = true;
} else if (param[1] != "false") {
- *error = TString("Invalid parameter: ") + *parameter_string;
+ *error = TString("Invalid parameter: ") + *parameter_string;
return false;
}
} else {
- *error = TString("Unknown parameter: ") + *parameter_string;
+ *error = TString("Unknown parameter: ") + *parameter_string;
return false;
}
}
}
- TString file_name = grpc_generator::StripProto(file->name());
+ TString file_name = grpc_generator::StripProto(file->name());
- TString header_code =
+ TString header_code =
grpc_cpp_generator::GetHeaderPrologue(&pbfile, generator_parameters) +
grpc_cpp_generator::GetHeaderIncludes(&pbfile, generator_parameters) +
grpc_cpp_generator::GetHeaderServices(&pbfile, generator_parameters) +
@@ -117,7 +117,7 @@ class CppGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator {
grpc::protobuf::io::CodedOutputStream header_coded_out(header_output.get());
header_coded_out.WriteRaw(header_code.data(), header_code.size());
- TString source_code =
+ TString source_code =
grpc_cpp_generator::GetSourcePrologue(&pbfile, generator_parameters) +
grpc_cpp_generator::GetSourceIncludes(&pbfile, generator_parameters) +
grpc_cpp_generator::GetSourceServices(&pbfile, generator_parameters) +
@@ -130,7 +130,7 @@ class CppGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator {
if (!generator_parameters.generate_mock_code) {
return true;
}
- TString mock_code =
+ TString mock_code =
grpc_cpp_generator::GetMockPrologue(&pbfile, generator_parameters) +
grpc_cpp_generator::GetMockIncludes(&pbfile, generator_parameters) +
grpc_cpp_generator::GetMockServices(&pbfile, generator_parameters) +
@@ -146,8 +146,8 @@ class CppGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator {
private:
// Insert the given code into the given file at the given insertion point.
void Insert(grpc::protobuf::compiler::GeneratorContext* context,
- const TString& filename, const TString& insertion_point,
- const TString& code) const {
+ const TString& filename, const TString& insertion_point,
+ const TString& code) const {
std::unique_ptr<grpc::protobuf::io::ZeroCopyOutputStream> output(
context->OpenForInsert(filename, insertion_point));
grpc::protobuf::io::CodedOutputStream coded_out(output.get());
diff --git a/contrib/libs/grpc/src/compiler/csharp_generator.cc b/contrib/libs/grpc/src/compiler/csharp_generator.cc
index 430be335ca2..3b7107c4c48 100644
--- a/contrib/libs/grpc/src/compiler/csharp_generator.cc
+++ b/contrib/libs/grpc/src/compiler/csharp_generator.cc
@@ -35,7 +35,7 @@ using grpc::protobuf::ServiceDescriptor;
using grpc::protobuf::io::Printer;
using grpc::protobuf::io::StringOutputStream;
using grpc_generator::GetMethodType;
-using grpc_generator::MethodType;
+using grpc_generator::MethodType;
using grpc_generator::METHODTYPE_BIDI_STREAMING;
using grpc_generator::METHODTYPE_CLIENT_STREAMING;
using grpc_generator::METHODTYPE_NO_STREAMING;
@@ -54,9 +54,9 @@ namespace {
// TODO(jtattermusch): reuse the functionality from google/protobuf.
bool GenerateDocCommentBodyImpl(grpc::protobuf::io::Printer* printer,
grpc::protobuf::SourceLocation location) {
- TString comments = location.leading_comments.empty()
- ? location.trailing_comments
- : location.leading_comments;
+ TString comments = location.leading_comments.empty()
+ ? location.trailing_comments
+ : location.leading_comments;
if (comments.empty()) {
return false;
}
@@ -66,7 +66,7 @@ bool GenerateDocCommentBodyImpl(grpc::protobuf::io::Printer* printer,
comments = grpc_generator::StringReplace(comments, "&", "&amp;", true);
comments = grpc_generator::StringReplace(comments, "<", "&lt;", true);
- std::vector<TString> lines;
+ std::vector<TString> lines;
grpc_generator::Split(comments, '\n', &lines);
// TODO: We really should work out which part to put in the summary and which
// to put in the remarks...
@@ -81,9 +81,9 @@ bool GenerateDocCommentBodyImpl(grpc::protobuf::io::Printer* printer,
// Note that we can't remove leading or trailing whitespace as *that's*
// relevant in markdown too.
// (We don't skip "just whitespace" lines, either.)
- for (std::vector<TString>::iterator it = lines.begin(); it != lines.end();
- ++it) {
- TString line = *it;
+ for (std::vector<TString>::iterator it = lines.begin(); it != lines.end();
+ ++it) {
+ TString line = *it;
if (line.empty()) {
last_was_empty = true;
} else {
@@ -172,19 +172,19 @@ void GenerateDocCommentClientMethod(grpc::protobuf::io::Printer* printer,
}
}
-TString GetServiceClassName(const ServiceDescriptor* service) {
+TString GetServiceClassName(const ServiceDescriptor* service) {
return service->name();
}
-TString GetClientClassName(const ServiceDescriptor* service) {
+TString GetClientClassName(const ServiceDescriptor* service) {
return service->name() + "Client";
}
-TString GetServerClassName(const ServiceDescriptor* service) {
+TString GetServerClassName(const ServiceDescriptor* service) {
return service->name() + "Base";
}
-TString GetCSharpMethodType(MethodType method_type) {
+TString GetCSharpMethodType(MethodType method_type) {
switch (method_type) {
case METHODTYPE_NO_STREAMING:
return "grpc::MethodType.Unary";
@@ -199,7 +199,7 @@ TString GetCSharpMethodType(MethodType method_type) {
return "";
}
-TString GetCSharpServerMethodType(MethodType method_type) {
+TString GetCSharpServerMethodType(MethodType method_type) {
switch (method_type) {
case METHODTYPE_NO_STREAMING:
return "grpc::UnaryServerMethod";
@@ -214,18 +214,18 @@ TString GetCSharpServerMethodType(MethodType method_type) {
return "";
}
-TString GetServiceNameFieldName() { return "__ServiceName"; }
+TString GetServiceNameFieldName() { return "__ServiceName"; }
-TString GetMarshallerFieldName(const Descriptor* message) {
+TString GetMarshallerFieldName(const Descriptor* message) {
return "__Marshaller_" +
grpc_generator::StringReplace(message->full_name(), ".", "_", true);
}
-TString GetMethodFieldName(const MethodDescriptor* method) {
+TString GetMethodFieldName(const MethodDescriptor* method) {
return "__Method_" + method->name();
}
-TString GetMethodRequestParamMaybe(const MethodDescriptor* method,
+TString GetMethodRequestParamMaybe(const MethodDescriptor* method,
bool invocation_param = false) {
if (method->client_streaming()) {
return "";
@@ -236,11 +236,11 @@ TString GetMethodRequestParamMaybe(const MethodDescriptor* method,
return GetClassName(method->input_type()) + " request, ";
}
-TString GetAccessLevel(bool internal_access) {
+TString GetAccessLevel(bool internal_access) {
return internal_access ? "internal" : "public";
}
-TString GetMethodReturnTypeClient(const MethodDescriptor* method) {
+TString GetMethodReturnTypeClient(const MethodDescriptor* method) {
switch (GetMethodType(method)) {
case METHODTYPE_NO_STREAMING:
return "grpc::AsyncUnaryCall<" + GetClassName(method->output_type()) +
@@ -261,7 +261,7 @@ TString GetMethodReturnTypeClient(const MethodDescriptor* method) {
return "";
}
-TString GetMethodRequestParamServer(const MethodDescriptor* method) {
+TString GetMethodRequestParamServer(const MethodDescriptor* method) {
switch (GetMethodType(method)) {
case METHODTYPE_NO_STREAMING:
case METHODTYPE_SERVER_STREAMING:
@@ -275,7 +275,7 @@ TString GetMethodRequestParamServer(const MethodDescriptor* method) {
return "";
}
-TString GetMethodReturnTypeServer(const MethodDescriptor* method) {
+TString GetMethodReturnTypeServer(const MethodDescriptor* method) {
switch (GetMethodType(method)) {
case METHODTYPE_NO_STREAMING:
case METHODTYPE_CLIENT_STREAMING:
@@ -289,7 +289,7 @@ TString GetMethodReturnTypeServer(const MethodDescriptor* method) {
return "";
}
-TString GetMethodResponseStreamMaybe(const MethodDescriptor* method) {
+TString GetMethodResponseStreamMaybe(const MethodDescriptor* method) {
switch (GetMethodType(method)) {
case METHODTYPE_NO_STREAMING:
case METHODTYPE_CLIENT_STREAMING:
@@ -325,76 +325,76 @@ std::vector<const Descriptor*> GetUsedMessages(
void GenerateMarshallerFields(Printer* out, const ServiceDescriptor* service) {
std::vector<const Descriptor*> used_messages = GetUsedMessages(service);
- if (used_messages.size() != 0) {
- // Generate static helper methods for serialization/deserialization
- out->Print(
- "static void __Helper_SerializeMessage("
- "global::Google.Protobuf.IMessage message, "
- "grpc::SerializationContext context)\n"
- "{\n");
- out->Indent();
- out->Print(
- "#if !GRPC_DISABLE_PROTOBUF_BUFFER_SERIALIZATION\n"
- "if (message is global::Google.Protobuf.IBufferMessage)\n"
- "{\n");
- out->Indent();
- out->Print(
- "context.SetPayloadLength(message.CalculateSize());\n"
- "global::Google.Protobuf.MessageExtensions.WriteTo(message, "
- "context.GetBufferWriter());\n"
- "context.Complete();\n"
- "return;\n");
- out->Outdent();
- out->Print(
- "}\n"
- "#endif\n");
- out->Print(
- "context.Complete("
- "global::Google.Protobuf.MessageExtensions.ToByteArray(message));\n");
- out->Outdent();
- out->Print("}\n\n");
-
- out->Print(
- "static class __Helper_MessageCache<T>\n"
- "{\n");
- out->Indent();
- out->Print(
- "public static readonly bool IsBufferMessage = "
- "global::System.Reflection.IntrospectionExtensions.GetTypeInfo(typeof("
- "global::Google.Protobuf.IBufferMessage)).IsAssignableFrom(typeof(T));"
- "\n");
- out->Outdent();
- out->Print("}\n\n");
-
- out->Print(
- "static T __Helper_DeserializeMessage<T>("
- "grpc::DeserializationContext context, "
- "global::Google.Protobuf.MessageParser<T> parser) "
- "where T : global::Google.Protobuf.IMessage<T>\n"
- "{\n");
- out->Indent();
- out->Print(
- "#if !GRPC_DISABLE_PROTOBUF_BUFFER_SERIALIZATION\n"
- "if (__Helper_MessageCache<T>.IsBufferMessage)\n"
- "{\n");
- out->Indent();
- out->Print(
- "return parser.ParseFrom(context.PayloadAsReadOnlySequence());\n");
- out->Outdent();
- out->Print(
- "}\n"
- "#endif\n");
- out->Print("return parser.ParseFrom(context.PayloadAsNewBuffer());\n");
- out->Outdent();
- out->Print("}\n\n");
- }
-
+ if (used_messages.size() != 0) {
+ // Generate static helper methods for serialization/deserialization
+ out->Print(
+ "static void __Helper_SerializeMessage("
+ "global::Google.Protobuf.IMessage message, "
+ "grpc::SerializationContext context)\n"
+ "{\n");
+ out->Indent();
+ out->Print(
+ "#if !GRPC_DISABLE_PROTOBUF_BUFFER_SERIALIZATION\n"
+ "if (message is global::Google.Protobuf.IBufferMessage)\n"
+ "{\n");
+ out->Indent();
+ out->Print(
+ "context.SetPayloadLength(message.CalculateSize());\n"
+ "global::Google.Protobuf.MessageExtensions.WriteTo(message, "
+ "context.GetBufferWriter());\n"
+ "context.Complete();\n"
+ "return;\n");
+ out->Outdent();
+ out->Print(
+ "}\n"
+ "#endif\n");
+ out->Print(
+ "context.Complete("
+ "global::Google.Protobuf.MessageExtensions.ToByteArray(message));\n");
+ out->Outdent();
+ out->Print("}\n\n");
+
+ out->Print(
+ "static class __Helper_MessageCache<T>\n"
+ "{\n");
+ out->Indent();
+ out->Print(
+ "public static readonly bool IsBufferMessage = "
+ "global::System.Reflection.IntrospectionExtensions.GetTypeInfo(typeof("
+ "global::Google.Protobuf.IBufferMessage)).IsAssignableFrom(typeof(T));"
+ "\n");
+ out->Outdent();
+ out->Print("}\n\n");
+
+ out->Print(
+ "static T __Helper_DeserializeMessage<T>("
+ "grpc::DeserializationContext context, "
+ "global::Google.Protobuf.MessageParser<T> parser) "
+ "where T : global::Google.Protobuf.IMessage<T>\n"
+ "{\n");
+ out->Indent();
+ out->Print(
+ "#if !GRPC_DISABLE_PROTOBUF_BUFFER_SERIALIZATION\n"
+ "if (__Helper_MessageCache<T>.IsBufferMessage)\n"
+ "{\n");
+ out->Indent();
+ out->Print(
+ "return parser.ParseFrom(context.PayloadAsReadOnlySequence());\n");
+ out->Outdent();
+ out->Print(
+ "}\n"
+ "#endif\n");
+ out->Print("return parser.ParseFrom(context.PayloadAsNewBuffer());\n");
+ out->Outdent();
+ out->Print("}\n\n");
+ }
+
for (size_t i = 0; i < used_messages.size(); i++) {
const Descriptor* message = used_messages[i];
out->Print(
"static readonly grpc::Marshaller<$type$> $fieldname$ = "
- "grpc::Marshallers.Create(__Helper_SerializeMessage, "
- "context => __Helper_DeserializeMessage(context, $type$.Parser));\n",
+ "grpc::Marshallers.Create(__Helper_SerializeMessage, "
+ "context => __Helper_DeserializeMessage(context, $type$.Parser));\n",
"fieldname", GetMarshallerFieldName(message), "type",
GetClassName(message));
}
@@ -569,7 +569,7 @@ void GenerateClientStub(Printer* out, const ServiceDescriptor* service) {
out->Print("}\n");
}
- TString method_name = method->name();
+ TString method_name = method->name();
if (method_type == METHODTYPE_NO_STREAMING) {
method_name += "Async"; // prevent name clash with synchronous method.
}
@@ -769,9 +769,9 @@ void GenerateService(Printer* out, const ServiceDescriptor* service,
} // anonymous namespace
-TString GetServices(const FileDescriptor* file, bool generate_client,
- bool generate_server, bool internal_access) {
- TString output;
+TString GetServices(const FileDescriptor* file, bool generate_client,
+ bool generate_server, bool internal_access) {
+ TString output;
{
// Scope the output stream so it closes and finalizes output to the string.
@@ -792,7 +792,7 @@ TString GetServices(const FileDescriptor* file, bool generate_client,
out.Print("// </auto-generated>\n");
// use C++ style as there are no file-level XML comments in .NET
- TString leading_comments = GetCsharpComments(file, true);
+ TString leading_comments = GetCsharpComments(file, true);
if (!leading_comments.empty()) {
out.Print("// Original file comments:\n");
out.PrintRaw(leading_comments.c_str());
@@ -805,7 +805,7 @@ TString GetServices(const FileDescriptor* file, bool generate_client,
out.Print("using grpc = global::Grpc.Core;\n");
out.Print("\n");
- TString file_namespace = GetFileNamespace(file);
+ TString file_namespace = GetFileNamespace(file);
if (file_namespace != "") {
out.Print("namespace $namespace$ {\n", "namespace", file_namespace);
out.Indent();
diff --git a/contrib/libs/grpc/src/compiler/csharp_generator.h b/contrib/libs/grpc/src/compiler/csharp_generator.h
index 53ba561f24b..c13da4657f3 100644
--- a/contrib/libs/grpc/src/compiler/csharp_generator.h
+++ b/contrib/libs/grpc/src/compiler/csharp_generator.h
@@ -25,9 +25,9 @@
namespace grpc_csharp_generator {
-TString GetServices(const grpc::protobuf::FileDescriptor* file,
- bool generate_client, bool generate_server,
- bool internal_access);
+TString GetServices(const grpc::protobuf::FileDescriptor* file,
+ bool generate_client, bool generate_server,
+ bool internal_access);
} // namespace grpc_csharp_generator
diff --git a/contrib/libs/grpc/src/compiler/csharp_generator_helpers.h b/contrib/libs/grpc/src/compiler/csharp_generator_helpers.h
index 8b65536251c..a8af7f3ccd1 100644
--- a/contrib/libs/grpc/src/compiler/csharp_generator_helpers.h
+++ b/contrib/libs/grpc/src/compiler/csharp_generator_helpers.h
@@ -25,7 +25,7 @@
namespace grpc_csharp_generator {
inline bool ServicesFilename(const grpc::protobuf::FileDescriptor* file,
- TString* file_name_or_error) {
+ TString* file_name_or_error) {
*file_name_or_error =
grpc_generator::FileNameInUpperCamel(file, false) + "Grpc.cs";
return true;
@@ -34,7 +34,7 @@ inline bool ServicesFilename(const grpc::protobuf::FileDescriptor* file,
// Get leading or trailing comments in a string. Comment lines start with "// ".
// Leading detached comments are put in front of leading comments.
template <typename DescriptorType>
-inline TString GetCsharpComments(const DescriptorType* desc, bool leading) {
+inline TString GetCsharpComments(const DescriptorType* desc, bool leading) {
return grpc_generator::GetPrefixedComments(desc, leading, "//");
}
diff --git a/contrib/libs/grpc/src/compiler/generator_helpers.h b/contrib/libs/grpc/src/compiler/generator_helpers.h
index 149529a7728..265713a16b3 100644
--- a/contrib/libs/grpc/src/compiler/generator_helpers.h
+++ b/contrib/libs/grpc/src/compiler/generator_helpers.h
@@ -22,21 +22,21 @@
#include <iostream>
#include <map>
#include <sstream>
-#include <util/generic/string.h>
+#include <util/generic/string.h>
#include <vector>
#include <util/generic/string.h>
#include <util/string/split.h>
#include <util/stream/str.h>
-#include "src/compiler/config.h"
-
+#include "src/compiler/config.h"
+
namespace grpc_generator {
-inline bool StripSuffix(TString* filename, const TString& suffix) {
+inline bool StripSuffix(TString* filename, const TString& suffix) {
if (filename->length() >= suffix.length()) {
size_t suffix_pos = filename->length() - suffix.length();
- if (filename->compare(suffix_pos, TString::npos, suffix) == 0) {
+ if (filename->compare(suffix_pos, TString::npos, suffix) == 0) {
filename->resize(filename->size() - suffix.size());
return true;
}
@@ -45,7 +45,7 @@ inline bool StripSuffix(TString* filename, const TString& suffix) {
return false;
}
-inline bool StripPrefix(TString* name, const TString& prefix) {
+inline bool StripPrefix(TString* name, const TString& prefix) {
if (name->length() >= prefix.length()) {
if (name->substr(0, prefix.size()) == prefix) {
*name = name->substr(prefix.size());
@@ -55,20 +55,20 @@ inline bool StripPrefix(TString* name, const TString& prefix) {
return false;
}
-inline TString StripProto(TString filename) {
+inline TString StripProto(TString filename) {
if (!StripSuffix(&filename, ".protodevel")) {
StripSuffix(&filename, ".proto");
}
return filename;
}
-inline TString StringReplace(TString str, const TString& from,
- const TString& to, bool replace_all) {
+inline TString StringReplace(TString str, const TString& from,
+ const TString& to, bool replace_all) {
size_t pos = 0;
do {
pos = str.find(from, pos);
- if (pos == TString::npos) {
+ if (pos == TString::npos) {
break;
}
str.replace(pos, from.length(), to);
@@ -78,20 +78,20 @@ inline TString StringReplace(TString str, const TString& from,
return str;
}
-inline TString StringReplace(TString str, const TString& from,
- const TString& to) {
+inline TString StringReplace(TString str, const TString& from,
+ const TString& to) {
return StringReplace(str, from, to, true);
}
-inline std::vector<TString> tokenize(const TString& input,
- const TString& delimiters) {
- std::vector<TString> tokens;
+inline std::vector<TString> tokenize(const TString& input,
+ const TString& delimiters) {
+ std::vector<TString> tokens;
size_t pos, last_pos = 0;
for (;;) {
bool done = false;
pos = input.find_first_of(delimiters, last_pos);
- if (pos == TString::npos) {
+ if (pos == TString::npos) {
done = true;
pos = input.length();
}
@@ -103,7 +103,7 @@ inline std::vector<TString> tokenize(const TString& input,
}
}
-inline TString CapitalizeFirstLetter(TString s) {
+inline TString CapitalizeFirstLetter(TString s) {
if (s.empty()) {
return s;
}
@@ -111,7 +111,7 @@ inline TString CapitalizeFirstLetter(TString s) {
return s;
}
-inline TString LowercaseFirstLetter(TString s) {
+inline TString LowercaseFirstLetter(TString s) {
if (s.empty()) {
return s;
}
@@ -119,19 +119,19 @@ inline TString LowercaseFirstLetter(TString s) {
return s;
}
-inline TString LowerUnderscoreToUpperCamel(TString str) {
- std::vector<TString> tokens = tokenize(str, "_");
- TString result = "";
+inline TString LowerUnderscoreToUpperCamel(TString str) {
+ std::vector<TString> tokens = tokenize(str, "_");
+ TString result = "";
for (unsigned int i = 0; i < tokens.size(); i++) {
result += CapitalizeFirstLetter(tokens[i]);
}
return result;
}
-inline TString FileNameInUpperCamel(
+inline TString FileNameInUpperCamel(
const grpc::protobuf::FileDescriptor* file, bool include_package_path) {
- std::vector<TString> tokens = tokenize(StripProto(file->name()), "/");
- TString result = "";
+ std::vector<TString> tokens = tokenize(StripProto(file->name()), "/");
+ TString result = "";
if (include_package_path) {
for (unsigned int i = 0; i < tokens.size() - 1; i++) {
result += tokens[i] + "/";
@@ -141,7 +141,7 @@ inline TString FileNameInUpperCamel(
return result;
}
-inline TString FileNameInUpperCamel(
+inline TString FileNameInUpperCamel(
const grpc::protobuf::FileDescriptor* file) {
return FileNameInUpperCamel(file, true);
}
@@ -171,11 +171,11 @@ inline MethodType GetMethodType(
}
template <typename TStringType>
-inline void Split(const TStringType& s, char /*delim*/,
+inline void Split(const TStringType& s, char /*delim*/,
std::vector<TStringType>* append_to) {
std::istringstream iss(s);
TStringType piece;
- while (std::getline(iss, piece)) {
+ while (std::getline(iss, piece)) {
append_to->push_back(piece);
}
}
@@ -199,15 +199,15 @@ enum CommentType {
// Get all the raw comments and append each line without newline to out.
template <typename DescriptorType>
inline void GetComment(const DescriptorType* desc, CommentType type,
- std::vector<TString>* out) {
+ std::vector<TString>* out) {
grpc::protobuf::SourceLocation location;
if (!desc->GetSourceLocation(&location)) {
return;
}
if (type == COMMENTTYPE_LEADING || type == COMMENTTYPE_TRAILING) {
- const TString& comments = type == COMMENTTYPE_LEADING
- ? location.leading_comments
- : location.trailing_comments;
+ const TString& comments = type == COMMENTTYPE_LEADING
+ ? location.leading_comments
+ : location.trailing_comments;
Split(comments, '\n', out);
} else if (type == COMMENTTYPE_LEADING_DETACHED) {
for (unsigned int i = 0; i < location.leading_detached_comments.size();
@@ -226,7 +226,7 @@ inline void GetComment(const DescriptorType* desc, CommentType type,
// above syntax line. Return nothing for trailing comments.
template <>
inline void GetComment(const grpc::protobuf::FileDescriptor* desc,
- CommentType type, std::vector<TString>* out) {
+ CommentType type, std::vector<TString>* out) {
if (type == COMMENTTYPE_TRAILING) {
return;
}
@@ -252,11 +252,11 @@ inline void GetComment(const grpc::protobuf::FileDescriptor* desc,
// Add prefix and newline to each comment line and concatenate them together.
// Make sure there is a space after the prefix unless the line is empty.
-inline TString GenerateCommentsWithPrefix(
- const std::vector<TString>& in, const TString& prefix) {
+inline TString GenerateCommentsWithPrefix(
+ const std::vector<TString>& in, const TString& prefix) {
std::ostringstream oss;
for (auto it = in.begin(); it != in.end(); it++) {
- const TString& elem = *it;
+ const TString& elem = *it;
if (elem.empty()) {
oss << prefix << "\n";
} else if (elem[0] == ' ') {
@@ -265,17 +265,17 @@ inline TString GenerateCommentsWithPrefix(
oss << prefix << " " << elem << "\n";
}
}
- return oss.str();
+ return oss.str();
}
template <typename DescriptorType>
-inline TString GetPrefixedComments(const DescriptorType* desc, bool leading,
- const TString& prefix) {
- std::vector<TString> out;
+inline TString GetPrefixedComments(const DescriptorType* desc, bool leading,
+ const TString& prefix) {
+ std::vector<TString> out;
if (leading) {
grpc_generator::GetComment(
desc, grpc_generator::COMMENTTYPE_LEADING_DETACHED, &out);
- std::vector<TString> leading;
+ std::vector<TString> leading;
grpc_generator::GetComment(desc, grpc_generator::COMMENTTYPE_LEADING,
&leading);
out.insert(out.end(), leading.begin(), leading.end());
diff --git a/contrib/libs/grpc/src/compiler/grpc_cpp_plugin/ya.make b/contrib/libs/grpc/src/compiler/grpc_cpp_plugin/ya.make
index a5a970dad5e..a4b7e363a3b 100644
--- a/contrib/libs/grpc/src/compiler/grpc_cpp_plugin/ya.make
+++ b/contrib/libs/grpc/src/compiler/grpc_cpp_plugin/ya.make
@@ -2,8 +2,8 @@
PROGRAM()
-WITHOUT_LICENSE_TEXTS()
-
+WITHOUT_LICENSE_TEXTS()
+
OWNER(g:cpp-contrib)
LICENSE(Apache-2.0)
@@ -15,7 +15,7 @@ PEERDIR(
)
ADDINCL(
- ${ARCADIA_BUILD_ROOT}/contrib/libs/grpc
+ ${ARCADIA_BUILD_ROOT}/contrib/libs/grpc
contrib/libs/grpc
contrib/libs/grpc/include
)
@@ -25,9 +25,9 @@ NO_COMPILER_WARNINGS()
SRCDIR(contrib/libs/grpc/src/compiler)
IF (OS_LINUX OR OS_DARWIN)
- CFLAGS(
- -DGRPC_POSIX_FORK_ALLOW_PTHREAD_ATFORK=1
- )
+ CFLAGS(
+ -DGRPC_POSIX_FORK_ALLOW_PTHREAD_ATFORK=1
+ )
ENDIF()
SRCS(
diff --git a/contrib/libs/grpc/src/compiler/grpc_plugin_support/ya.make b/contrib/libs/grpc/src/compiler/grpc_plugin_support/ya.make
index f5001abae28..068ae1ead6d 100644
--- a/contrib/libs/grpc/src/compiler/grpc_plugin_support/ya.make
+++ b/contrib/libs/grpc/src/compiler/grpc_plugin_support/ya.make
@@ -2,8 +2,8 @@
LIBRARY()
-WITHOUT_LICENSE_TEXTS()
-
+WITHOUT_LICENSE_TEXTS()
+
OWNER(g:cpp-contrib)
LICENSE(Apache-2.0)
@@ -15,7 +15,7 @@ PEERDIR(
ADDINCL(
GLOBAL contrib/libs/grpc/include
- ${ARCADIA_BUILD_ROOT}/contrib/libs/grpc
+ ${ARCADIA_BUILD_ROOT}/contrib/libs/grpc
contrib/libs/grpc
)
@@ -24,9 +24,9 @@ NO_COMPILER_WARNINGS()
SRCDIR(contrib/libs/grpc/src/compiler)
IF (OS_LINUX OR OS_DARWIN)
- CFLAGS(
- -DGRPC_POSIX_FORK_ALLOW_PTHREAD_ATFORK=1
- )
+ CFLAGS(
+ -DGRPC_POSIX_FORK_ALLOW_PTHREAD_ATFORK=1
+ )
ENDIF()
SRCS(
diff --git a/contrib/libs/grpc/src/compiler/grpc_python_plugin/ya.make b/contrib/libs/grpc/src/compiler/grpc_python_plugin/ya.make
index 351fab1a2f3..cf2a106c915 100644
--- a/contrib/libs/grpc/src/compiler/grpc_python_plugin/ya.make
+++ b/contrib/libs/grpc/src/compiler/grpc_python_plugin/ya.make
@@ -2,8 +2,8 @@
PROGRAM()
-WITHOUT_LICENSE_TEXTS()
-
+WITHOUT_LICENSE_TEXTS()
+
OWNER(g:cpp-contrib)
LICENSE(Apache-2.0)
@@ -14,7 +14,7 @@ PEERDIR(
)
ADDINCL(
- ${ARCADIA_BUILD_ROOT}/contrib/libs/grpc
+ ${ARCADIA_BUILD_ROOT}/contrib/libs/grpc
contrib/libs/grpc
contrib/libs/grpc/include
)
@@ -24,9 +24,9 @@ NO_COMPILER_WARNINGS()
SRCDIR(contrib/libs/grpc/src/compiler)
IF (OS_LINUX OR OS_DARWIN)
- CFLAGS(
- -DGRPC_POSIX_FORK_ALLOW_PTHREAD_ATFORK=1
- )
+ CFLAGS(
+ -DGRPC_POSIX_FORK_ALLOW_PTHREAD_ATFORK=1
+ )
ENDIF()
SRCS(
diff --git a/contrib/libs/grpc/src/compiler/node_generator.cc b/contrib/libs/grpc/src/compiler/node_generator.cc
index 12ac3a9727c..89e4871a660 100644
--- a/contrib/libs/grpc/src/compiler/node_generator.cc
+++ b/contrib/libs/grpc/src/compiler/node_generator.cc
@@ -37,7 +37,7 @@ namespace {
// Returns the alias we assign to the module of the given .proto filename
// when importing. Copied entirely from
// github:google/protobuf/src/google/protobuf/compiler/js/js_generator.cc#L154
-TString ModuleAlias(const TString filename) {
+TString ModuleAlias(const TString filename) {
// This scheme could technically cause problems if a file includes any 2 of:
// foo/bar_baz.proto
// foo_bar_baz.proto
@@ -45,7 +45,7 @@ TString ModuleAlias(const TString filename) {
//
// We'll worry about this problem if/when we actually see it. This name isn't
// exposed to users so we can change it later if we need to.
- TString basename = grpc_generator::StripProto(filename);
+ TString basename = grpc_generator::StripProto(filename);
basename = grpc_generator::StringReplace(basename, "-", "$");
basename = grpc_generator::StringReplace(basename, "/", "_");
basename = grpc_generator::StringReplace(basename, ".", "_");
@@ -54,15 +54,15 @@ TString ModuleAlias(const TString filename) {
// Given a filename like foo/bar/baz.proto, returns the corresponding JavaScript
// message file foo/bar/baz.js
-TString GetJSMessageFilename(const TString& filename) {
- TString name = filename;
+TString GetJSMessageFilename(const TString& filename) {
+ TString name = filename;
return grpc_generator::StripProto(name) + "_pb.js";
}
// Given a filename like foo/bar/baz.proto, returns the root directory
// path ../../
-TString GetRootPath(const TString& from_filename,
- const TString& to_filename) {
+TString GetRootPath(const TString& from_filename,
+ const TString& to_filename) {
if (to_filename.find("google/protobuf") == 0) {
// Well-known types (.proto files in the google/protobuf directory) are
// assumed to come from the 'google-protobuf' npm package. We may want to
@@ -74,7 +74,7 @@ TString GetRootPath(const TString& from_filename,
if (slashes == 0) {
return "./";
}
- TString result = "";
+ TString result = "";
for (size_t i = 0; i < slashes; i++) {
result += "../";
}
@@ -83,15 +83,15 @@ TString GetRootPath(const TString& from_filename,
// Return the relative path to load to_file from the directory containing
// from_file, assuming that both paths are relative to the same directory
-TString GetRelativePath(const TString& from_file,
- const TString& to_file) {
+TString GetRelativePath(const TString& from_file,
+ const TString& to_file) {
return GetRootPath(from_file, to_file) + to_file;
}
/* Finds all message types used in all services in the file, and returns them
* as a map of fully qualified message type name to message descriptor */
-map<TString, const Descriptor*> GetAllMessages(const FileDescriptor* file) {
- map<TString, const Descriptor*> message_types;
+map<TString, const Descriptor*> GetAllMessages(const FileDescriptor* file) {
+ map<TString, const Descriptor*> message_types;
for (int service_num = 0; service_num < file->service_count();
service_num++) {
const ServiceDescriptor* service = file->service(service_num);
@@ -107,13 +107,13 @@ map<TString, const Descriptor*> GetAllMessages(const FileDescriptor* file) {
return message_types;
}
-TString MessageIdentifierName(const TString& name) {
+TString MessageIdentifierName(const TString& name) {
return grpc_generator::StringReplace(name, ".", "_");
}
-TString NodeObjectPath(const Descriptor* descriptor) {
- TString module_alias = ModuleAlias(descriptor->file()->name());
- TString name = descriptor->full_name();
+TString NodeObjectPath(const Descriptor* descriptor) {
+ TString module_alias = ModuleAlias(descriptor->file()->name());
+ TString name = descriptor->full_name();
grpc_generator::StripPrefix(&name, descriptor->file()->package() + ".");
return module_alias + "." + name;
}
@@ -121,8 +121,8 @@ TString NodeObjectPath(const Descriptor* descriptor) {
// Prints out the message serializer and deserializer functions
void PrintMessageTransformer(const Descriptor* descriptor, Printer* out,
const Parameters& params) {
- map<TString, TString> template_vars;
- TString full_name = descriptor->full_name();
+ map<TString, TString> template_vars;
+ TString full_name = descriptor->full_name();
template_vars["identifier_name"] = MessageIdentifierName(full_name);
template_vars["name"] = full_name;
template_vars["node_name"] = NodeObjectPath(descriptor);
@@ -158,7 +158,7 @@ void PrintMessageTransformer(const Descriptor* descriptor, Printer* out,
void PrintMethod(const MethodDescriptor* method, Printer* out) {
const Descriptor* input_type = method->input_type();
const Descriptor* output_type = method->output_type();
- map<TString, TString> vars;
+ map<TString, TString> vars;
vars["service_name"] = method->service()->full_name();
vars["name"] = method->name();
vars["input_type"] = NodeObjectPath(input_type);
@@ -184,13 +184,13 @@ void PrintMethod(const MethodDescriptor* method, Printer* out) {
// Prints out the service descriptor object
void PrintService(const ServiceDescriptor* service, Printer* out) {
- map<TString, TString> template_vars;
+ map<TString, TString> template_vars;
out->Print(GetNodeComments(service, true).c_str());
template_vars["name"] = service->name();
out->Print(template_vars, "var $name$Service = exports.$name$Service = {\n");
out->Indent();
for (int i = 0; i < service->method_count(); i++) {
- TString method_name =
+ TString method_name =
grpc_generator::LowercaseFirstLetter(service->method(i)->name());
out->Print(GetNodeComments(service->method(i), true).c_str());
out->Print("$method_name$: ", "method_name", method_name);
@@ -209,14 +209,14 @@ void PrintService(const ServiceDescriptor* service, Printer* out) {
void PrintImports(const FileDescriptor* file, Printer* out) {
out->Print("var grpc = require('grpc');\n");
if (file->message_type_count() > 0) {
- TString file_path =
+ TString file_path =
GetRelativePath(file->name(), GetJSMessageFilename(file->name()));
out->Print("var $module_alias$ = require('$file_path$');\n", "module_alias",
ModuleAlias(file->name()), "file_path", file_path);
}
for (int i = 0; i < file->dependency_count(); i++) {
- TString file_path = GetRelativePath(
+ TString file_path = GetRelativePath(
file->name(), GetJSMessageFilename(file->dependency(i)->name()));
out->Print("var $module_alias$ = require('$file_path$');\n", "module_alias",
ModuleAlias(file->dependency(i)->name()), "file_path",
@@ -227,8 +227,8 @@ void PrintImports(const FileDescriptor* file, Printer* out) {
void PrintTransformers(const FileDescriptor* file, Printer* out,
const Parameters& params) {
- map<TString, const Descriptor*> messages = GetAllMessages(file);
- for (std::map<TString, const Descriptor*>::iterator it = messages.begin();
+ map<TString, const Descriptor*> messages = GetAllMessages(file);
+ for (std::map<TString, const Descriptor*>::iterator it = messages.begin();
it != messages.end(); it++) {
PrintMessageTransformer(it->second, out, params);
}
@@ -242,8 +242,8 @@ void PrintServices(const FileDescriptor* file, Printer* out) {
}
} // namespace
-TString GenerateFile(const FileDescriptor* file, const Parameters& params) {
- TString output;
+TString GenerateFile(const FileDescriptor* file, const Parameters& params) {
+ TString output;
{
StringOutputStream output_stream(&output);
Printer out(&output_stream, '$');
@@ -253,7 +253,7 @@ TString GenerateFile(const FileDescriptor* file, const Parameters& params) {
}
out.Print("// GENERATED CODE -- DO NOT EDIT!\n\n");
- TString leading_comments = GetNodeComments(file, true);
+ TString leading_comments = GetNodeComments(file, true);
if (!leading_comments.empty()) {
out.Print("// Original file comments:\n");
out.PrintRaw(leading_comments.c_str());
diff --git a/contrib/libs/grpc/src/compiler/node_generator.h b/contrib/libs/grpc/src/compiler/node_generator.h
index 5361552d5d5..959df436ea5 100644
--- a/contrib/libs/grpc/src/compiler/node_generator.h
+++ b/contrib/libs/grpc/src/compiler/node_generator.h
@@ -29,8 +29,8 @@ struct Parameters {
int minimum_node_version;
};
-TString GenerateFile(const grpc::protobuf::FileDescriptor* file,
- const Parameters& params);
+TString GenerateFile(const grpc::protobuf::FileDescriptor* file,
+ const Parameters& params);
} // namespace grpc_node_generator
diff --git a/contrib/libs/grpc/src/compiler/node_generator_helpers.h b/contrib/libs/grpc/src/compiler/node_generator_helpers.h
index ce380cecc2e..ccf57ec8a62 100644
--- a/contrib/libs/grpc/src/compiler/node_generator_helpers.h
+++ b/contrib/libs/grpc/src/compiler/node_generator_helpers.h
@@ -26,14 +26,14 @@
namespace grpc_node_generator {
-inline TString GetJSServiceFilename(const TString& filename) {
+inline TString GetJSServiceFilename(const TString& filename) {
return grpc_generator::StripProto(filename) + "_grpc_pb.js";
}
// Get leading or trailing comments in a string. Comment lines start with "// ".
// Leading detached comments are put in front of leading comments.
template <typename DescriptorType>
-inline TString GetNodeComments(const DescriptorType* desc, bool leading) {
+inline TString GetNodeComments(const DescriptorType* desc, bool leading) {
return grpc_generator::GetPrefixedComments(desc, leading, "//");
}
diff --git a/contrib/libs/grpc/src/compiler/objective_c_generator.cc b/contrib/libs/grpc/src/compiler/objective_c_generator.cc
index 66a473705ae..07826b6a8d8 100644
--- a/contrib/libs/grpc/src/compiler/objective_c_generator.cc
+++ b/contrib/libs/grpc/src/compiler/objective_c_generator.cc
@@ -37,9 +37,9 @@ using ::std::set;
namespace grpc_objective_c_generator {
namespace {
-void PrintProtoRpcDeclarationAsPragma(Printer* printer,
- const MethodDescriptor* method,
- map< ::TString, ::TString> vars) {
+void PrintProtoRpcDeclarationAsPragma(Printer* printer,
+ const MethodDescriptor* method,
+ map< ::TString, ::TString> vars) {
vars["client_stream"] = method->client_streaming() ? "stream " : "";
vars["server_stream"] = method->server_streaming() ? "stream " : "";
@@ -51,7 +51,7 @@ void PrintProtoRpcDeclarationAsPragma(Printer* printer,
template <typename DescriptorType>
static void PrintAllComments(const DescriptorType* desc, Printer* printer,
bool deprecated = false) {
- std::vector<TString> comments;
+ std::vector<TString> comments;
grpc_generator::GetComment(desc, grpc_generator::COMMENTTYPE_LEADING_DETACHED,
&comments);
grpc_generator::GetComment(desc, grpc_generator::COMMENTTYPE_LEADING,
@@ -65,7 +65,7 @@ static void PrintAllComments(const DescriptorType* desc, Printer* printer,
for (auto it = comments.begin(); it != comments.end(); ++it) {
printer->Print(" * ");
size_t start_pos = it->find_first_not_of(' ');
- if (start_pos != TString::npos) {
+ if (start_pos != TString::npos) {
printer->PrintRaw(it->c_str() + start_pos);
}
printer->Print("\n");
@@ -81,7 +81,7 @@ static void PrintAllComments(const DescriptorType* desc, Printer* printer,
}
void PrintMethodSignature(Printer* printer, const MethodDescriptor* method,
- const map< ::TString, ::TString>& vars) {
+ const map< ::TString, ::TString>& vars) {
// Print comment
PrintAllComments(method, printer, true);
@@ -106,7 +106,7 @@ void PrintMethodSignature(Printer* printer, const MethodDescriptor* method,
}
void PrintSimpleSignature(Printer* printer, const MethodDescriptor* method,
- map< ::TString, ::TString> vars) {
+ map< ::TString, ::TString> vars) {
vars["method_name"] =
grpc_generator::LowercaseFirstLetter(vars["method_name"]);
vars["return_type"] = "void";
@@ -114,14 +114,14 @@ void PrintSimpleSignature(Printer* printer, const MethodDescriptor* method,
}
void PrintAdvancedSignature(Printer* printer, const MethodDescriptor* method,
- map< ::TString, ::TString> vars) {
+ map< ::TString, ::TString> vars) {
vars["method_name"] = "RPCTo" + vars["method_name"];
vars["return_type"] = "GRPCProtoCall *";
PrintMethodSignature(printer, method, vars);
}
void PrintV2Signature(Printer* printer, const MethodDescriptor* method,
- map< ::TString, ::TString> vars) {
+ map< ::TString, ::TString> vars) {
if (method->client_streaming()) {
vars["return_type"] = "GRPCStreamingProtoCall *";
} else {
@@ -143,9 +143,9 @@ void PrintV2Signature(Printer* printer, const MethodDescriptor* method,
printer->Print(" callOptions:(GRPCCallOptions *_Nullable)callOptions");
}
-inline map< ::TString, ::TString> GetMethodVars(
+inline map< ::TString, ::TString> GetMethodVars(
const MethodDescriptor* method) {
- map< ::TString, ::TString> res;
+ map< ::TString, ::TString> res;
res["method_name"] = method->name();
res["request_type"] = method->input_type()->name();
res["response_type"] = method->output_type()->name();
@@ -155,7 +155,7 @@ inline map< ::TString, ::TString> GetMethodVars(
}
void PrintMethodDeclarations(Printer* printer, const MethodDescriptor* method) {
- map< ::TString, ::TString> vars = GetMethodVars(method);
+ map< ::TString, ::TString> vars = GetMethodVars(method);
PrintProtoRpcDeclarationAsPragma(printer, method, vars);
@@ -167,7 +167,7 @@ void PrintMethodDeclarations(Printer* printer, const MethodDescriptor* method) {
void PrintV2MethodDeclarations(Printer* printer,
const MethodDescriptor* method) {
- map< ::TString, ::TString> vars = GetMethodVars(method);
+ map< ::TString, ::TString> vars = GetMethodVars(method);
PrintProtoRpcDeclarationAsPragma(printer, method, vars);
@@ -176,7 +176,7 @@ void PrintV2MethodDeclarations(Printer* printer,
}
void PrintSimpleImplementation(Printer* printer, const MethodDescriptor* method,
- map< ::TString, ::TString> vars) {
+ map< ::TString, ::TString> vars) {
printer->Print("{\n");
printer->Print(vars, " [[self RPCTo$method_name$With");
if (method->client_streaming()) {
@@ -194,7 +194,7 @@ void PrintSimpleImplementation(Printer* printer, const MethodDescriptor* method,
void PrintAdvancedImplementation(Printer* printer,
const MethodDescriptor* method,
- map< ::TString, ::TString> vars) {
+ map< ::TString, ::TString> vars) {
printer->Print("{\n");
printer->Print(vars, " return [self RPCToMethod:@\"$method_name$\"\n");
@@ -218,7 +218,7 @@ void PrintAdvancedImplementation(Printer* printer,
}
void PrintV2Implementation(Printer* printer, const MethodDescriptor* method,
- map< ::TString, ::TString> vars) {
+ map< ::TString, ::TString> vars) {
printer->Print(" {\n");
if (method->client_streaming()) {
printer->Print(vars, " return [self RPCToMethod:@\"$method_name$\"\n");
@@ -239,7 +239,7 @@ void PrintV2Implementation(Printer* printer, const MethodDescriptor* method,
void PrintMethodImplementations(Printer* printer,
const MethodDescriptor* method,
const Parameters& generator_params) {
- map< ::TString, ::TString> vars = GetMethodVars(method);
+ map< ::TString, ::TString> vars = GetMethodVars(method);
PrintProtoRpcDeclarationAsPragma(printer, method, vars);
@@ -259,9 +259,9 @@ void PrintMethodImplementations(Printer* printer,
} // namespace
-::TString GetAllMessageClasses(const FileDescriptor* file) {
- ::TString output;
- set< ::TString> classes;
+::TString GetAllMessageClasses(const FileDescriptor* file) {
+ ::TString output;
+ set< ::TString> classes;
for (int i = 0; i < file->service_count(); i++) {
const auto service = file->service(i);
for (int i = 0; i < service->method_count(); i++) {
@@ -277,9 +277,9 @@ void PrintMethodImplementations(Printer* printer,
return output;
}
-::TString GetProtocol(const ServiceDescriptor* service,
- const Parameters& generator_params) {
- ::TString output;
+::TString GetProtocol(const ServiceDescriptor* service,
+ const Parameters& generator_params) {
+ ::TString output;
if (generator_params.no_v1_compatibility) return output;
@@ -287,7 +287,7 @@ void PrintMethodImplementations(Printer* printer,
grpc::protobuf::io::StringOutputStream output_stream(&output);
Printer printer(&output_stream, '$');
- map< ::TString, ::TString> vars = {
+ map< ::TString, ::TString> vars = {
{"service_class", ServiceClassName(service)}};
printer.Print(vars,
@@ -306,14 +306,14 @@ void PrintMethodImplementations(Printer* printer,
return output;
}
-::TString GetV2Protocol(const ServiceDescriptor* service) {
- ::TString output;
+::TString GetV2Protocol(const ServiceDescriptor* service) {
+ ::TString output;
// Scope the output stream so it closes and finalizes output to the string.
grpc::protobuf::io::StringOutputStream output_stream(&output);
Printer printer(&output_stream, '$');
- map< ::TString, ::TString> vars = {
+ map< ::TString, ::TString> vars = {
{"service_class", ServiceClassName(service) + "2"}};
printer.Print(vars, "@protocol $service_class$ <NSObject>\n\n");
@@ -325,15 +325,15 @@ void PrintMethodImplementations(Printer* printer,
return output;
}
-::TString GetInterface(const ServiceDescriptor* service,
- const Parameters& generator_params) {
- ::TString output;
+::TString GetInterface(const ServiceDescriptor* service,
+ const Parameters& generator_params) {
+ ::TString output;
// Scope the output stream so it closes and finalizes output to the string.
grpc::protobuf::io::StringOutputStream output_stream(&output);
Printer printer(&output_stream, '$');
- map< ::TString, ::TString> vars = {
+ map< ::TString, ::TString> vars = {
{"service_class", ServiceClassName(service)}};
printer.Print(vars,
@@ -368,15 +368,15 @@ void PrintMethodImplementations(Printer* printer,
return output;
}
-::TString GetSource(const ServiceDescriptor* service,
- const Parameters& generator_params) {
- ::TString output;
+::TString GetSource(const ServiceDescriptor* service,
+ const Parameters& generator_params) {
+ ::TString output;
{
// Scope the output stream so it closes and finalizes output to the string.
grpc::protobuf::io::StringOutputStream output_stream(&output);
Printer printer(&output_stream, '$');
- map< ::TString, ::TString> vars = {
+ map< ::TString, ::TString> vars = {
{"service_name", service->name()},
{"service_class", ServiceClassName(service)},
{"package", service->file()->package()}};
diff --git a/contrib/libs/grpc/src/compiler/objective_c_generator.h b/contrib/libs/grpc/src/compiler/objective_c_generator.h
index e1d5bdc1604..9770f65436d 100644
--- a/contrib/libs/grpc/src/compiler/objective_c_generator.h
+++ b/contrib/libs/grpc/src/compiler/objective_c_generator.h
@@ -30,7 +30,7 @@ struct Parameters {
using ::grpc::protobuf::FileDescriptor;
using ::grpc::protobuf::ServiceDescriptor;
-using ::TString;
+using ::TString;
// Returns forward declaration of classes in the generated header file.
string GetAllMessageClasses(const FileDescriptor* file);
diff --git a/contrib/libs/grpc/src/compiler/objective_c_generator_helpers.h b/contrib/libs/grpc/src/compiler/objective_c_generator_helpers.h
index 9ad3773ac23..ae296741cec 100644
--- a/contrib/libs/grpc/src/compiler/objective_c_generator_helpers.h
+++ b/contrib/libs/grpc/src/compiler/objective_c_generator_helpers.h
@@ -29,7 +29,7 @@ namespace grpc_objective_c_generator {
using ::grpc::protobuf::FileDescriptor;
using ::grpc::protobuf::ServiceDescriptor;
-using ::TString;
+using ::TString;
inline string MessageHeaderName(const FileDescriptor* file) {
return google::protobuf::compiler::objectivec::FilePath(file) + ".pbobjc.h";
@@ -41,53 +41,53 @@ inline string ServiceClassName(const ServiceDescriptor* service) {
return prefix + service->name();
}
-inline ::TString LocalImport(const ::TString& import) {
- return ::TString("#import \"" + import + "\"\n");
+inline ::TString LocalImport(const ::TString& import) {
+ return ::TString("#import \"" + import + "\"\n");
}
-inline ::TString FrameworkImport(const ::TString& import,
- const ::TString& framework) {
+inline ::TString FrameworkImport(const ::TString& import,
+ const ::TString& framework) {
// Flattens the directory structure: grab the file name only
std::size_t pos = import.rfind("/");
// If pos is npos, pos + 1 is 0, which gives us the entire string,
// so there's no need to check that
- ::TString filename = import.substr(pos + 1, import.size() - (pos + 1));
- return ::TString("#import <" + framework + "/" + filename + ">\n");
+ ::TString filename = import.substr(pos + 1, import.size() - (pos + 1));
+ return ::TString("#import <" + framework + "/" + filename + ">\n");
}
-inline ::TString SystemImport(const ::TString& import) {
- return ::TString("#import <" + import + ">\n");
+inline ::TString SystemImport(const ::TString& import) {
+ return ::TString("#import <" + import + ">\n");
}
-inline ::TString PreprocConditional(::TString symbol, bool invert) {
+inline ::TString PreprocConditional(::TString symbol, bool invert) {
return invert ? "!defined(" + symbol + ") || !" + symbol
: "defined(" + symbol + ") && " + symbol;
}
-inline ::TString PreprocIf(const ::TString& symbol,
- const ::TString& if_true) {
- return ::TString("#if " + PreprocConditional(symbol, false) + "\n" +
- if_true + "#endif\n");
+inline ::TString PreprocIf(const ::TString& symbol,
+ const ::TString& if_true) {
+ return ::TString("#if " + PreprocConditional(symbol, false) + "\n" +
+ if_true + "#endif\n");
}
-inline ::TString PreprocIfNot(const ::TString& symbol,
- const ::TString& if_true) {
- return ::TString("#if " + PreprocConditional(symbol, true) + "\n" +
- if_true + "#endif\n");
+inline ::TString PreprocIfNot(const ::TString& symbol,
+ const ::TString& if_true) {
+ return ::TString("#if " + PreprocConditional(symbol, true) + "\n" +
+ if_true + "#endif\n");
}
-inline ::TString PreprocIfElse(const ::TString& symbol,
- const ::TString& if_true,
- const ::TString& if_false) {
- return ::TString("#if " + PreprocConditional(symbol, false) + "\n" +
- if_true + "#else\n" + if_false + "#endif\n");
+inline ::TString PreprocIfElse(const ::TString& symbol,
+ const ::TString& if_true,
+ const ::TString& if_false) {
+ return ::TString("#if " + PreprocConditional(symbol, false) + "\n" +
+ if_true + "#else\n" + if_false + "#endif\n");
}
-inline ::TString PreprocIfNotElse(const ::TString& symbol,
- const ::TString& if_true,
- const ::TString& if_false) {
- return ::TString("#if " + PreprocConditional(symbol, true) + "\n" +
- if_true + "#else\n" + if_false + "#endif\n");
+inline ::TString PreprocIfNotElse(const ::TString& symbol,
+ const ::TString& if_true,
+ const ::TString& if_false) {
+ return ::TString("#if " + PreprocConditional(symbol, true) + "\n" +
+ if_true + "#else\n" + if_false + "#endif\n");
}
} // namespace grpc_objective_c_generator
diff --git a/contrib/libs/grpc/src/compiler/php_generator.cc b/contrib/libs/grpc/src/compiler/php_generator.cc
index fccd99aefb5..b35d3f2a02e 100644
--- a/contrib/libs/grpc/src/compiler/php_generator.cc
+++ b/contrib/libs/grpc/src/compiler/php_generator.cc
@@ -35,8 +35,8 @@ using std::map;
namespace grpc_php_generator {
namespace {
-TString ConvertToPhpNamespace(const TString& name) {
- std::vector<TString> tokens = grpc_generator::tokenize(name, ".");
+TString ConvertToPhpNamespace(const TString& name) {
+ std::vector<TString> tokens = grpc_generator::tokenize(name, ".");
std::ostringstream oss;
for (unsigned int i = 0; i < tokens.size(); i++) {
oss << (i == 0 ? "" : "\\")
@@ -45,7 +45,7 @@ TString ConvertToPhpNamespace(const TString& name) {
return oss.str();
}
-TString PackageName(const FileDescriptor* file) {
+TString PackageName(const FileDescriptor* file) {
if (file->options().has_php_namespace()) {
return file->options().php_namespace();
} else {
@@ -53,9 +53,9 @@ TString PackageName(const FileDescriptor* file) {
}
}
-TString MessageIdentifierName(const TString& name,
- const FileDescriptor* file) {
- std::vector<TString> tokens = grpc_generator::tokenize(name, ".");
+TString MessageIdentifierName(const TString& name,
+ const FileDescriptor* file) {
+ std::vector<TString> tokens = grpc_generator::tokenize(name, ".");
std::ostringstream oss;
if (PackageName(file) != "") {
oss << PackageName(file) << "\\";
@@ -67,7 +67,7 @@ TString MessageIdentifierName(const TString& name,
void PrintMethod(const MethodDescriptor* method, Printer* out) {
const Descriptor* input_type = method->input_type();
const Descriptor* output_type = method->output_type();
- map<TString, TString> vars;
+ map<TString, TString> vars;
vars["service_name"] = method->service()->full_name();
vars["name"] = method->name();
vars["input_type_id"] =
@@ -78,15 +78,15 @@ void PrintMethod(const MethodDescriptor* method, Printer* out) {
out->Print("/**\n");
out->Print(GetPHPComments(method, " *").c_str());
if (method->client_streaming()) {
- if (method->server_streaming()) {
- vars["return_type_id"] = "\\Grpc\\BidiStreamingCall";
- } else {
- vars["return_type_id"] = "\\Grpc\\ClientStreamingCall";
- }
+ if (method->server_streaming()) {
+ vars["return_type_id"] = "\\Grpc\\BidiStreamingCall";
+ } else {
+ vars["return_type_id"] = "\\Grpc\\ClientStreamingCall";
+ }
out->Print(vars,
" * @param array $$metadata metadata\n"
- " * @param array $$options call options\n"
- " * @return $return_type_id$\n */\n"
+ " * @param array $$options call options\n"
+ " * @return $return_type_id$\n */\n"
"public function $name$($$metadata = [], "
"$$options = []) {\n");
out->Indent();
@@ -101,16 +101,16 @@ void PrintMethod(const MethodDescriptor* method, Printer* out) {
"['\\$output_type_id$','decode'],\n"
"$$metadata, $$options);\n");
} else {
- if (method->server_streaming()) {
- vars["return_type_id"] = "\\Grpc\\ServerStreamingCall";
- } else {
- vars["return_type_id"] = "\\Grpc\\UnaryCall";
- }
+ if (method->server_streaming()) {
+ vars["return_type_id"] = "\\Grpc\\ServerStreamingCall";
+ } else {
+ vars["return_type_id"] = "\\Grpc\\UnaryCall";
+ }
out->Print(vars,
" * @param \\$input_type_id$ $$argument input argument\n"
" * @param array $$metadata metadata\n"
- " * @param array $$options call options\n"
- " * @return $return_type_id$\n */\n"
+ " * @param array $$options call options\n"
+ " * @return $return_type_id$\n */\n"
"public function $name$(\\$input_type_id$ $$argument,\n"
" $$metadata = [], $$options = []) {\n");
out->Indent();
@@ -133,8 +133,8 @@ void PrintMethod(const MethodDescriptor* method, Printer* out) {
// Prints out the service descriptor object
void PrintService(const ServiceDescriptor* service,
- const TString& class_suffix, Printer* out) {
- map<TString, TString> vars;
+ const TString& class_suffix, Printer* out) {
+ map<TString, TString> vars;
out->Print("/**\n");
out->Print(GetPHPComments(service, " *").c_str());
out->Print(" */\n");
@@ -156,7 +156,7 @@ void PrintService(const ServiceDescriptor* service,
out->Outdent();
out->Print("}\n\n");
for (int i = 0; i < service->method_count(); i++) {
- TString method_name =
+ TString method_name =
grpc_generator::LowercaseFirstLetter(service->method(i)->name());
PrintMethod(service->method(i), out);
}
@@ -166,10 +166,10 @@ void PrintService(const ServiceDescriptor* service,
}
} // namespace
-TString GenerateFile(const FileDescriptor* file,
- const ServiceDescriptor* service,
- const TString& class_suffix) {
- TString output;
+TString GenerateFile(const FileDescriptor* file,
+ const ServiceDescriptor* service,
+ const TString& class_suffix) {
+ TString output;
{
StringOutputStream output_stream(&output);
Printer out(&output_stream, '$');
@@ -177,14 +177,14 @@ TString GenerateFile(const FileDescriptor* file,
out.Print("<?php\n");
out.Print("// GENERATED CODE -- DO NOT EDIT!\n\n");
- TString leading_comments = GetPHPComments(file, "//");
+ TString leading_comments = GetPHPComments(file, "//");
if (!leading_comments.empty()) {
out.Print("// Original file comments:\n");
out.PrintRaw(leading_comments.c_str());
}
- map<TString, TString> vars;
- TString php_namespace = PackageName(file);
+ map<TString, TString> vars;
+ TString php_namespace = PackageName(file);
vars["package"] = php_namespace;
out.Print(vars, "namespace $package$;\n\n");
diff --git a/contrib/libs/grpc/src/compiler/php_generator_helpers.h b/contrib/libs/grpc/src/compiler/php_generator_helpers.h
index 985326fdb2e..70a31eaf75e 100644
--- a/contrib/libs/grpc/src/compiler/php_generator_helpers.h
+++ b/contrib/libs/grpc/src/compiler/php_generator_helpers.h
@@ -26,32 +26,32 @@
namespace grpc_php_generator {
-inline TString GetPHPServiceClassname(
+inline TString GetPHPServiceClassname(
const grpc::protobuf::ServiceDescriptor* service,
- const TString& class_suffix) {
+ const TString& class_suffix) {
return service->name() + (class_suffix == "" ? "Client" : class_suffix);
}
// ReplaceAll replaces all instances of search with replace in s.
-inline TString ReplaceAll(TString s, const TString& search,
- const TString& replace) {
+inline TString ReplaceAll(TString s, const TString& search,
+ const TString& replace) {
size_t pos = 0;
- while ((pos = s.find(search, pos)) != TString::npos) {
+ while ((pos = s.find(search, pos)) != TString::npos) {
s.replace(pos, search.length(), replace);
pos += replace.length();
}
return s;
}
-inline TString GetPHPServiceFilename(
+inline TString GetPHPServiceFilename(
const grpc::protobuf::FileDescriptor* file,
const grpc::protobuf::ServiceDescriptor* service,
- const TString& class_suffix) {
+ const TString& class_suffix) {
std::ostringstream oss;
if (file->options().has_php_namespace()) {
oss << ReplaceAll(file->options().php_namespace(), "\\", "/");
} else {
- std::vector<TString> tokens =
+ std::vector<TString> tokens =
grpc_generator::tokenize(file->package(), ".");
for (unsigned int i = 0; i < tokens.size(); i++) {
oss << (i == 0 ? "" : "/")
@@ -65,8 +65,8 @@ inline TString GetPHPServiceFilename(
// Get leading or trailing comments in a string. Comment lines start with "// ".
// Leading detached comments are put in front of leading comments.
template <typename DescriptorType>
-inline TString GetPHPComments(const DescriptorType* desc,
- TString prefix) {
+inline TString GetPHPComments(const DescriptorType* desc,
+ TString prefix) {
return ReplaceAll(grpc_generator::GetPrefixedComments(desc, true, prefix),
"*/", "&#42;/");
}
diff --git a/contrib/libs/grpc/src/compiler/protobuf_plugin.h b/contrib/libs/grpc/src/compiler/protobuf_plugin.h
index f7df4d7b7e1..ef844ea0551 100644
--- a/contrib/libs/grpc/src/compiler/protobuf_plugin.h
+++ b/contrib/libs/grpc/src/compiler/protobuf_plugin.h
@@ -29,8 +29,8 @@
// Get leading or trailing comments in a string.
template <typename DescriptorType>
-inline TString GetCommentsHelper(const DescriptorType* desc, bool leading,
- const TString& prefix) {
+inline TString GetCommentsHelper(const DescriptorType* desc, bool leading,
+ const TString& prefix) {
return grpc_generator::GetPrefixedComments(desc, leading, prefix);
}
@@ -39,36 +39,36 @@ class ProtoBufMethod : public grpc_generator::Method {
ProtoBufMethod(const grpc::protobuf::MethodDescriptor* method)
: method_(method) {}
- TString name() const { return method_->name(); }
+ TString name() const { return method_->name(); }
- TString input_type_name() const {
+ TString input_type_name() const {
return grpc_cpp_generator::ClassName(method_->input_type(), true);
}
- TString output_type_name() const {
+ TString output_type_name() const {
return grpc_cpp_generator::ClassName(method_->output_type(), true);
}
- TString get_input_type_name() const {
+ TString get_input_type_name() const {
return method_->input_type()->file()->name();
}
- TString get_output_type_name() const {
+ TString get_output_type_name() const {
return method_->output_type()->file()->name();
}
// TODO(https://github.com/grpc/grpc/issues/18800): Clean this up.
bool get_module_and_message_path_input(
- TString* str, TString generator_file_name,
- bool generate_in_pb2_grpc, TString import_prefix,
- const std::vector<TString>& prefixes_to_filter) const final {
+ TString* str, TString generator_file_name,
+ bool generate_in_pb2_grpc, TString import_prefix,
+ const std::vector<TString>& prefixes_to_filter) const final {
return grpc_python_generator::GetModuleAndMessagePath(
method_->input_type(), str, generator_file_name, generate_in_pb2_grpc,
import_prefix, prefixes_to_filter);
}
bool get_module_and_message_path_output(
- TString* str, TString generator_file_name,
- bool generate_in_pb2_grpc, TString import_prefix,
- const std::vector<TString>& prefixes_to_filter) const final {
+ TString* str, TString generator_file_name,
+ bool generate_in_pb2_grpc, TString import_prefix,
+ const std::vector<TString>& prefixes_to_filter) const final {
return grpc_python_generator::GetModuleAndMessagePath(
method_->output_type(), str, generator_file_name, generate_in_pb2_grpc,
import_prefix, prefixes_to_filter);
@@ -86,15 +86,15 @@ class ProtoBufMethod : public grpc_generator::Method {
return method_->client_streaming() && method_->server_streaming();
}
- TString GetLeadingComments(const TString prefix) const {
+ TString GetLeadingComments(const TString prefix) const {
return GetCommentsHelper(method_, true, prefix);
}
- TString GetTrailingComments(const TString prefix) const {
+ TString GetTrailingComments(const TString prefix) const {
return GetCommentsHelper(method_, false, prefix);
}
- vector<TString> GetAllComments() const {
+ vector<TString> GetAllComments() const {
return grpc_python_generator::get_all_comments(method_);
}
@@ -107,7 +107,7 @@ class ProtoBufService : public grpc_generator::Service {
ProtoBufService(const grpc::protobuf::ServiceDescriptor* service)
: service_(service) {}
- TString name() const { return service_->name(); }
+ TString name() const { return service_->name(); }
int method_count() const { return service_->method_count(); }
std::unique_ptr<const grpc_generator::Method> method(int i) const {
@@ -115,15 +115,15 @@ class ProtoBufService : public grpc_generator::Service {
new ProtoBufMethod(service_->method(i)));
}
- TString GetLeadingComments(const TString prefix) const {
+ TString GetLeadingComments(const TString prefix) const {
return GetCommentsHelper(service_, true, prefix);
}
- TString GetTrailingComments(const TString prefix) const {
+ TString GetTrailingComments(const TString prefix) const {
return GetCommentsHelper(service_, false, prefix);
}
- vector<TString> GetAllComments() const {
+ vector<TString> GetAllComments() const {
return grpc_python_generator::get_all_comments(service_);
}
@@ -133,10 +133,10 @@ class ProtoBufService : public grpc_generator::Service {
class ProtoBufPrinter : public grpc_generator::Printer {
public:
- ProtoBufPrinter(TString* str)
+ ProtoBufPrinter(TString* str)
: output_stream_(str), printer_(&output_stream_, '$') {}
- void Print(const std::map<TString, TString>& vars,
+ void Print(const std::map<TString, TString>& vars,
const char* string_template) {
printer_.Print(vars, string_template);
}
@@ -155,17 +155,17 @@ class ProtoBufFile : public grpc_generator::File {
public:
ProtoBufFile(const grpc::protobuf::FileDescriptor* file) : file_(file) {}
- TString filename() const { return file_->name(); }
- TString filename_without_ext() const {
+ TString filename() const { return file_->name(); }
+ TString filename_without_ext() const {
return grpc_generator::StripProto(filename());
}
- TString package() const { return file_->package(); }
- std::vector<TString> package_parts() const {
+ TString package() const { return file_->package(); }
+ std::vector<TString> package_parts() const {
return grpc_generator::tokenize(package(), ".");
}
- TString additional_headers() const { return ""; }
+ TString additional_headers() const { return ""; }
int service_count() const { return file_->service_count(); }
std::unique_ptr<const grpc_generator::Service> service(int i) const {
@@ -174,24 +174,24 @@ class ProtoBufFile : public grpc_generator::File {
}
std::unique_ptr<grpc_generator::Printer> CreatePrinter(
- TString* str) const {
+ TString* str) const {
return std::unique_ptr<grpc_generator::Printer>(new ProtoBufPrinter(str));
}
- TString GetLeadingComments(const TString prefix) const {
+ TString GetLeadingComments(const TString prefix) const {
return GetCommentsHelper(file_, true, prefix);
}
- TString GetTrailingComments(const TString prefix) const {
+ TString GetTrailingComments(const TString prefix) const {
return GetCommentsHelper(file_, false, prefix);
}
- vector<TString> GetAllComments() const {
+ vector<TString> GetAllComments() const {
return grpc_python_generator::get_all_comments(file_);
}
- vector<TString> GetImportNames() const {
- vector<TString> proto_names;
+ vector<TString> GetImportNames() const {
+ vector<TString> proto_names;
for (int i = 0; i < file_->dependency_count(); ++i) {
const auto& dep = *file_->dependency(i);
proto_names.push_back(dep.name());
diff --git a/contrib/libs/grpc/src/compiler/python_generator.cc b/contrib/libs/grpc/src/compiler/python_generator.cc
index 57d7b6152e9..d083d19f0b3 100644
--- a/contrib/libs/grpc/src/compiler/python_generator.cc
+++ b/contrib/libs/grpc/src/compiler/python_generator.cc
@@ -51,13 +51,13 @@ using std::vector;
namespace grpc_python_generator {
-TString generator_file_name;
+TString generator_file_name;
namespace {
-typedef map<TString, TString> StringMap;
-typedef vector<TString> StringVector;
-typedef tuple<TString, TString> StringPair;
+typedef map<TString, TString> StringMap;
+typedef vector<TString> StringVector;
+typedef tuple<TString, TString> StringPair;
typedef set<StringPair> StringPairSet;
// Provides RAII indentation handling. Use as:
@@ -70,16 +70,16 @@ typedef set<StringPair> StringPairSet;
class IndentScope {
public:
explicit IndentScope(grpc_generator::Printer* printer) : printer_(printer) {
- // NOTE(rbellevi): Two-space tabs are hard-coded in the protocol compiler.
- // Doubling our indents and outdents guarantees compliance with PEP8.
+ // NOTE(rbellevi): Two-space tabs are hard-coded in the protocol compiler.
+ // Doubling our indents and outdents guarantees compliance with PEP8.
+ printer_->Indent();
printer_->Indent();
- printer_->Indent();
}
- ~IndentScope() {
- printer_->Outdent();
- printer_->Outdent();
- }
+ ~IndentScope() {
+ printer_->Outdent();
+ printer_->Outdent();
+ }
private:
grpc_generator::Printer* printer_;
@@ -98,16 +98,16 @@ void PrivateGenerator::PrintAllComments(StringVector comments,
// smarter and more sophisticated, but at the moment, if there is
// no docstring to print, we simply emit "pass" to ensure validity
// of the generated code.
- out->Print(
- "\"\"\"Missing associated documentation comment in .proto "
- "file.\"\"\"\n");
+ out->Print(
+ "\"\"\"Missing associated documentation comment in .proto "
+ "file.\"\"\"\n");
return;
}
out->Print("\"\"\"");
for (StringVector::iterator it = comments.begin(); it != comments.end();
++it) {
size_t start_pos = it->find_first_not_of(' ');
- if (start_pos != TString::npos) {
+ if (start_pos != TString::npos) {
out->PrintRaw(it->c_str() + start_pos);
}
out->Print("\n");
@@ -134,7 +134,7 @@ bool PrivateGenerator::PrintBetaServicer(const grpc_generator::Service* service,
PrintAllComments(service_comments, out);
for (int i = 0; i < service->method_count(); ++i) {
auto method = service->method(i);
- TString arg_name =
+ TString arg_name =
method->ClientStreaming() ? "request_iterator" : "request";
StringMap method_dict;
method_dict["Method"] = method->name();
@@ -170,7 +170,7 @@ bool PrivateGenerator::PrintBetaStub(const grpc_generator::Service* service,
PrintAllComments(service_comments, out);
for (int i = 0; i < service->method_count(); ++i) {
auto method = service->method(i);
- TString arg_name =
+ TString arg_name =
method->ClientStreaming() ? "request_iterator" : "request";
StringMap method_dict;
method_dict["Method"] = method->name();
@@ -193,7 +193,7 @@ bool PrivateGenerator::PrintBetaStub(const grpc_generator::Service* service,
}
bool PrivateGenerator::PrintBetaServerFactory(
- const TString& package_qualified_service_name,
+ const TString& package_qualified_service_name,
const grpc_generator::Service* service, grpc_generator::Printer* out) {
StringMap service_dict;
service_dict["Service"] = service->name();
@@ -214,18 +214,18 @@ bool PrivateGenerator::PrintBetaServerFactory(
StringMap output_message_modules_and_classes;
for (int i = 0; i < service->method_count(); ++i) {
auto method = service->method(i);
- const TString method_implementation_constructor =
- TString(method->ClientStreaming() ? "stream_" : "unary_") +
- TString(method->ServerStreaming() ? "stream_" : "unary_") +
+ const TString method_implementation_constructor =
+ TString(method->ClientStreaming() ? "stream_" : "unary_") +
+ TString(method->ServerStreaming() ? "stream_" : "unary_") +
"inline";
- TString input_message_module_and_class;
+ TString input_message_module_and_class;
if (!method->get_module_and_message_path_input(
&input_message_module_and_class, generator_file_name,
generate_in_pb2_grpc, config.import_prefix,
config.prefixes_to_filter)) {
return false;
}
- TString output_message_module_and_class;
+ TString output_message_module_and_class;
if (!method->get_module_and_message_path_output(
&output_message_module_and_class, generator_file_name,
generate_in_pb2_grpc, config.import_prefix,
@@ -280,7 +280,7 @@ bool PrivateGenerator::PrintBetaServerFactory(
method_dict["Method"] = name_and_implementation_constructor->first;
method_dict["Constructor"] = name_and_implementation_constructor->second;
IndentScope raii_descriptions_indent(out);
- const TString method_name =
+ const TString method_name =
name_and_implementation_constructor->first;
out->Print(method_dict,
"(\'$PackageQualifiedServiceName$\', \'$Method$\'): "
@@ -302,7 +302,7 @@ bool PrivateGenerator::PrintBetaServerFactory(
}
bool PrivateGenerator::PrintBetaStubFactory(
- const TString& package_qualified_service_name,
+ const TString& package_qualified_service_name,
const grpc_generator::Service* service, grpc_generator::Printer* out) {
StringMap dict;
dict["Service"] = service->name();
@@ -323,17 +323,17 @@ bool PrivateGenerator::PrintBetaStubFactory(
StringMap output_message_modules_and_classes;
for (int i = 0; i < service->method_count(); ++i) {
auto method = service->method(i);
- const TString method_cardinality =
- TString(method->ClientStreaming() ? "STREAM" : "UNARY") + "_" +
- TString(method->ServerStreaming() ? "STREAM" : "UNARY");
- TString input_message_module_and_class;
+ const TString method_cardinality =
+ TString(method->ClientStreaming() ? "STREAM" : "UNARY") + "_" +
+ TString(method->ServerStreaming() ? "STREAM" : "UNARY");
+ TString input_message_module_and_class;
if (!method->get_module_and_message_path_input(
&input_message_module_and_class, generator_file_name,
generate_in_pb2_grpc, config.import_prefix,
config.prefixes_to_filter)) {
return false;
}
- TString output_message_module_and_class;
+ TString output_message_module_and_class;
if (!method->get_module_and_message_path_output(
&output_message_module_and_class, generator_file_name,
generate_in_pb2_grpc, config.import_prefix,
@@ -406,7 +406,7 @@ bool PrivateGenerator::PrintBetaStubFactory(
}
bool PrivateGenerator::PrintStub(
- const TString& package_qualified_service_name,
+ const TString& package_qualified_service_name,
const grpc_generator::Service* service, grpc_generator::Printer* out) {
StringMap dict;
dict["Service"] = service->name();
@@ -430,17 +430,17 @@ bool PrivateGenerator::PrintStub(
out->Print("\"\"\"\n");
for (int i = 0; i < service->method_count(); ++i) {
auto method = service->method(i);
- TString multi_callable_constructor =
- TString(method->ClientStreaming() ? "stream" : "unary") + "_" +
- TString(method->ServerStreaming() ? "stream" : "unary");
- TString request_module_and_class;
+ TString multi_callable_constructor =
+ TString(method->ClientStreaming() ? "stream" : "unary") + "_" +
+ TString(method->ServerStreaming() ? "stream" : "unary");
+ TString request_module_and_class;
if (!method->get_module_and_message_path_input(
&request_module_and_class, generator_file_name,
generate_in_pb2_grpc, config.import_prefix,
config.prefixes_to_filter)) {
return false;
}
- TString response_module_and_class;
+ TString response_module_and_class;
if (!method->get_module_and_message_path_output(
&response_module_and_class, generator_file_name,
generate_in_pb2_grpc, config.import_prefix,
@@ -486,7 +486,7 @@ bool PrivateGenerator::PrintServicer(const grpc_generator::Service* service,
PrintAllComments(service_comments, out);
for (int i = 0; i < service->method_count(); ++i) {
auto method = service->method(i);
- TString arg_name =
+ TString arg_name =
method->ClientStreaming() ? "request_iterator" : "request";
StringMap method_dict;
method_dict["Method"] = method->name();
@@ -507,7 +507,7 @@ bool PrivateGenerator::PrintServicer(const grpc_generator::Service* service,
}
bool PrivateGenerator::PrintAddServicerToServer(
- const TString& package_qualified_service_name,
+ const TString& package_qualified_service_name,
const grpc_generator::Service* service, grpc_generator::Printer* out) {
StringMap service_dict;
service_dict["Service"] = service->name();
@@ -522,18 +522,18 @@ bool PrivateGenerator::PrintAddServicerToServer(
IndentScope raii_dict_second_indent(out);
for (int i = 0; i < service->method_count(); ++i) {
auto method = service->method(i);
- TString method_handler_constructor =
- TString(method->ClientStreaming() ? "stream" : "unary") + "_" +
- TString(method->ServerStreaming() ? "stream" : "unary") +
+ TString method_handler_constructor =
+ TString(method->ClientStreaming() ? "stream" : "unary") + "_" +
+ TString(method->ServerStreaming() ? "stream" : "unary") +
"_rpc_method_handler";
- TString request_module_and_class;
+ TString request_module_and_class;
if (!method->get_module_and_message_path_input(
&request_module_and_class, generator_file_name,
generate_in_pb2_grpc, config.import_prefix,
config.prefixes_to_filter)) {
return false;
}
- TString response_module_and_class;
+ TString response_module_and_class;
if (!method->get_module_and_message_path_output(
&response_module_and_class, generator_file_name,
generate_in_pb2_grpc, config.import_prefix,
@@ -577,94 +577,94 @@ bool PrivateGenerator::PrintAddServicerToServer(
return true;
}
-/* Prints out a service class used as a container for static methods pertaining
- * to a class. This class has the exact name of service written in the ".proto"
- * file, with no suffixes. Since this class merely acts as a namespace, it
- * should never be instantiated.
- */
-bool PrivateGenerator::PrintServiceClass(
- const TString& package_qualified_service_name,
- const grpc_generator::Service* service, grpc_generator::Printer* out) {
- StringMap dict;
- dict["Service"] = service->name();
- out->Print("\n\n");
- out->Print(" # This class is part of an EXPERIMENTAL API.\n");
- out->Print(dict, "class $Service$(object):\n");
- {
- IndentScope class_indent(out);
- StringVector service_comments = service->GetAllComments();
- PrintAllComments(service_comments, out);
- for (int i = 0; i < service->method_count(); ++i) {
- const auto& method = service->method(i);
- TString request_module_and_class;
- if (!method->get_module_and_message_path_input(
- &request_module_and_class, generator_file_name,
- generate_in_pb2_grpc, config.import_prefix,
- config.prefixes_to_filter)) {
- return false;
- }
- TString response_module_and_class;
- if (!method->get_module_and_message_path_output(
- &response_module_and_class, generator_file_name,
- generate_in_pb2_grpc, config.import_prefix,
- config.prefixes_to_filter)) {
- return false;
- }
- out->Print("\n");
- StringMap method_dict;
- method_dict["Method"] = method->name();
- out->Print("@staticmethod\n");
- out->Print(method_dict, "def $Method$(");
- TString request_parameter(
- method->ClientStreaming() ? "request_iterator" : "request");
- StringMap args_dict;
- args_dict["RequestParameter"] = request_parameter;
- {
- IndentScope args_indent(out);
- IndentScope args_double_indent(out);
- out->Print(args_dict, "$RequestParameter$,\n");
- out->Print("target,\n");
- out->Print("options=(),\n");
- out->Print("channel_credentials=None,\n");
- out->Print("call_credentials=None,\n");
- out->Print("insecure=False,\n");
- out->Print("compression=None,\n");
- out->Print("wait_for_ready=None,\n");
- out->Print("timeout=None,\n");
- out->Print("metadata=None):\n");
- }
- {
- IndentScope method_indent(out);
- TString arity_method_name =
- TString(method->ClientStreaming() ? "stream" : "unary") + "_" +
- TString(method->ServerStreaming() ? "stream" : "unary");
- args_dict["ArityMethodName"] = arity_method_name;
- args_dict["PackageQualifiedService"] = package_qualified_service_name;
- args_dict["Method"] = method->name();
- out->Print(args_dict,
- "return "
- "grpc.experimental.$ArityMethodName$($RequestParameter$, "
- "target, '/$PackageQualifiedService$/$Method$',\n");
- {
- IndentScope continuation_indent(out);
- StringMap serializer_dict;
- serializer_dict["RequestModuleAndClass"] = request_module_and_class;
- serializer_dict["ResponseModuleAndClass"] = response_module_and_class;
- out->Print(serializer_dict,
- "$RequestModuleAndClass$.SerializeToString,\n");
- out->Print(serializer_dict, "$ResponseModuleAndClass$.FromString,\n");
- out->Print("options, channel_credentials,\n");
- out->Print(
- "insecure, call_credentials, compression, wait_for_ready, "
- "timeout, metadata)\n");
- }
- }
- }
- }
- // TODO(rbellevi): Add methods pertinent to the server side as well.
- return true;
-}
-
+/* Prints out a service class used as a container for static methods pertaining
+ * to a class. This class has the exact name of service written in the ".proto"
+ * file, with no suffixes. Since this class merely acts as a namespace, it
+ * should never be instantiated.
+ */
+bool PrivateGenerator::PrintServiceClass(
+ const TString& package_qualified_service_name,
+ const grpc_generator::Service* service, grpc_generator::Printer* out) {
+ StringMap dict;
+ dict["Service"] = service->name();
+ out->Print("\n\n");
+ out->Print(" # This class is part of an EXPERIMENTAL API.\n");
+ out->Print(dict, "class $Service$(object):\n");
+ {
+ IndentScope class_indent(out);
+ StringVector service_comments = service->GetAllComments();
+ PrintAllComments(service_comments, out);
+ for (int i = 0; i < service->method_count(); ++i) {
+ const auto& method = service->method(i);
+ TString request_module_and_class;
+ if (!method->get_module_and_message_path_input(
+ &request_module_and_class, generator_file_name,
+ generate_in_pb2_grpc, config.import_prefix,
+ config.prefixes_to_filter)) {
+ return false;
+ }
+ TString response_module_and_class;
+ if (!method->get_module_and_message_path_output(
+ &response_module_and_class, generator_file_name,
+ generate_in_pb2_grpc, config.import_prefix,
+ config.prefixes_to_filter)) {
+ return false;
+ }
+ out->Print("\n");
+ StringMap method_dict;
+ method_dict["Method"] = method->name();
+ out->Print("@staticmethod\n");
+ out->Print(method_dict, "def $Method$(");
+ TString request_parameter(
+ method->ClientStreaming() ? "request_iterator" : "request");
+ StringMap args_dict;
+ args_dict["RequestParameter"] = request_parameter;
+ {
+ IndentScope args_indent(out);
+ IndentScope args_double_indent(out);
+ out->Print(args_dict, "$RequestParameter$,\n");
+ out->Print("target,\n");
+ out->Print("options=(),\n");
+ out->Print("channel_credentials=None,\n");
+ out->Print("call_credentials=None,\n");
+ out->Print("insecure=False,\n");
+ out->Print("compression=None,\n");
+ out->Print("wait_for_ready=None,\n");
+ out->Print("timeout=None,\n");
+ out->Print("metadata=None):\n");
+ }
+ {
+ IndentScope method_indent(out);
+ TString arity_method_name =
+ TString(method->ClientStreaming() ? "stream" : "unary") + "_" +
+ TString(method->ServerStreaming() ? "stream" : "unary");
+ args_dict["ArityMethodName"] = arity_method_name;
+ args_dict["PackageQualifiedService"] = package_qualified_service_name;
+ args_dict["Method"] = method->name();
+ out->Print(args_dict,
+ "return "
+ "grpc.experimental.$ArityMethodName$($RequestParameter$, "
+ "target, '/$PackageQualifiedService$/$Method$',\n");
+ {
+ IndentScope continuation_indent(out);
+ StringMap serializer_dict;
+ serializer_dict["RequestModuleAndClass"] = request_module_and_class;
+ serializer_dict["ResponseModuleAndClass"] = response_module_and_class;
+ out->Print(serializer_dict,
+ "$RequestModuleAndClass$.SerializeToString,\n");
+ out->Print(serializer_dict, "$ResponseModuleAndClass$.FromString,\n");
+ out->Print("options, channel_credentials,\n");
+ out->Print(
+ "insecure, call_credentials, compression, wait_for_ready, "
+ "timeout, metadata)\n");
+ }
+ }
+ }
+ }
+ // TODO(rbellevi): Add methods pertinent to the server side as well.
+ return true;
+}
+
bool PrivateGenerator::PrintBetaPreamble(grpc_generator::Printer* out) {
StringMap var;
var["Package"] = config.beta_package_root;
@@ -690,21 +690,21 @@ bool PrivateGenerator::PrintPreamble(grpc_generator::Printer* out) {
for (int j = 0; j < service->method_count(); ++j) {
auto method = service.get()->method(j);
- TString input_type_file_name = method->get_input_type_name();
- TString input_module_name =
+ TString input_type_file_name = method->get_input_type_name();
+ TString input_module_name =
ModuleName(input_type_file_name, config.import_prefix,
config.prefixes_to_filter);
- TString input_module_alias =
+ TString input_module_alias =
ModuleAlias(input_type_file_name, config.import_prefix,
config.prefixes_to_filter);
imports_set.insert(
std::make_tuple(input_module_name, input_module_alias));
- TString output_type_file_name = method->get_output_type_name();
- TString output_module_name =
+ TString output_type_file_name = method->get_output_type_name();
+ TString output_module_name =
ModuleName(output_type_file_name, config.import_prefix,
config.prefixes_to_filter);
- TString output_module_alias =
+ TString output_module_alias =
ModuleAlias(output_type_file_name, config.import_prefix,
config.prefixes_to_filter);
imports_set.insert(
@@ -717,7 +717,7 @@ bool PrivateGenerator::PrintPreamble(grpc_generator::Printer* out) {
auto module_name = std::get<0>(*it);
var["ModuleAlias"] = std::get<1>(*it);
const size_t last_dot_pos = module_name.rfind('.');
- if (last_dot_pos == TString::npos) {
+ if (last_dot_pos == TString::npos) {
var["ImportStatement"] = "import " + module_name;
} else {
var["ImportStatement"] = "from " + module_name.substr(0, last_dot_pos) +
@@ -731,19 +731,19 @@ bool PrivateGenerator::PrintPreamble(grpc_generator::Printer* out) {
}
bool PrivateGenerator::PrintGAServices(grpc_generator::Printer* out) {
- TString package = file->package();
+ TString package = file->package();
if (!package.empty()) {
package = package.append(".");
}
for (int i = 0; i < file->service_count(); ++i) {
auto service = file->service(i);
- TString package_qualified_service_name = package + service->name();
+ TString package_qualified_service_name = package + service->name();
if (!(PrintStub(package_qualified_service_name, service.get(), out) &&
PrintServicer(service.get(), out) &&
PrintAddServicerToServer(package_qualified_service_name,
- service.get(), out) &&
- PrintServiceClass(package_qualified_service_name, service.get(),
- out))) {
+ service.get(), out) &&
+ PrintServiceClass(package_qualified_service_name, service.get(),
+ out))) {
return false;
}
}
@@ -751,13 +751,13 @@ bool PrivateGenerator::PrintGAServices(grpc_generator::Printer* out) {
}
bool PrivateGenerator::PrintBetaServices(grpc_generator::Printer* out) {
- TString package = file->package();
+ TString package = file->package();
if (!package.empty()) {
package = package.append(".");
}
for (int i = 0; i < file->service_count(); ++i) {
auto service = file->service(i);
- TString package_qualified_service_name = package + service->name();
+ TString package_qualified_service_name = package + service->name();
if (!(PrintBetaServicer(service.get(), out) &&
PrintBetaStub(service.get(), out) &&
PrintBetaServerFactory(package_qualified_service_name, service.get(),
@@ -770,17 +770,17 @@ bool PrivateGenerator::PrintBetaServices(grpc_generator::Printer* out) {
return true;
}
-pair<bool, TString> PrivateGenerator::GetGrpcServices() {
- TString output;
+pair<bool, TString> PrivateGenerator::GetGrpcServices() {
+ TString output;
{
// Scope the output stream so it closes and finalizes output to the string.
auto out = file->CreatePrinter(&output);
if (generate_in_pb2_grpc) {
out->Print(
"# Generated by the gRPC Python protocol compiler plugin. "
- "DO NOT EDIT!\n\"\"\""
- "Client and server classes corresponding to protobuf-defined "
- "services.\"\"\"\n");
+ "DO NOT EDIT!\n\"\"\""
+ "Client and server classes corresponding to protobuf-defined "
+ "services.\"\"\"\n");
if (!PrintPreamble(out.get())) {
return make_pair(false, "");
}
@@ -830,11 +830,11 @@ PythonGrpcGenerator::PythonGrpcGenerator(const GeneratorConfiguration& config)
PythonGrpcGenerator::~PythonGrpcGenerator() {}
static bool GenerateGrpc(GeneratorContext* context, PrivateGenerator& generator,
- TString file_name, bool generate_in_pb2_grpc) {
+ TString file_name, bool generate_in_pb2_grpc) {
bool success;
std::unique_ptr<ZeroCopyOutputStream> output;
std::unique_ptr<CodedOutputStream> coded_output;
- TString grpc_code;
+ TString grpc_code;
if (generate_in_pb2_grpc) {
output.reset(context->Open(file_name));
@@ -845,7 +845,7 @@ static bool GenerateGrpc(GeneratorContext* context, PrivateGenerator& generator,
}
coded_output.reset(new CodedOutputStream(output.get()));
- tie(success, grpc_code) = generator.GetGrpcServices();
+ tie(success, grpc_code) = generator.GetGrpcServices();
if (success) {
coded_output->WriteRaw(grpc_code.data(), grpc_code.size());
@@ -855,11 +855,11 @@ static bool GenerateGrpc(GeneratorContext* context, PrivateGenerator& generator,
}
}
-static bool ParseParameters(const TString& parameter,
- TString* grpc_version,
- std::vector<TString>* strip_prefixes,
- TString* error) {
- std::vector<TString> comma_delimited_parameters;
+static bool ParseParameters(const TString& parameter,
+ TString* grpc_version,
+ std::vector<TString>* strip_prefixes,
+ TString* error) {
+ std::vector<TString> comma_delimited_parameters;
grpc_python_generator::Split(parameter, ',', &comma_delimited_parameters);
if (comma_delimited_parameters.size() == 1 &&
comma_delimited_parameters[0].empty()) {
@@ -878,21 +878,21 @@ static bool ParseParameters(const TString& parameter,
return true;
}
-uint64_t PythonGrpcGenerator::GetSupportedFeatures() const {
- return FEATURE_PROTO3_OPTIONAL;
-}
-
+uint64_t PythonGrpcGenerator::GetSupportedFeatures() const {
+ return FEATURE_PROTO3_OPTIONAL;
+}
+
bool PythonGrpcGenerator::Generate(const FileDescriptor* file,
- const TString& parameter,
+ const TString& parameter,
GeneratorContext* context,
- TString* error) const {
+ TString* error) const {
// Get output file name.
- TString pb2_file_name;
- TString pb2_grpc_file_name;
+ TString pb2_file_name;
+ TString pb2_grpc_file_name;
static const int proto_suffix_length = strlen(".proto");
if (file->name().size() > static_cast<size_t>(proto_suffix_length) &&
file->name().find_last_of(".proto") == file->name().size() - 1) {
- TString base =
+ TString base =
file->name().substr(0, file->name().size() - proto_suffix_length);
pb2_file_name = base + "_pb2.py";
pb2_grpc_file_name = base + "_pb2_grpc.py";
@@ -903,7 +903,7 @@ bool PythonGrpcGenerator::Generate(const FileDescriptor* file,
generator_file_name = file->name();
ProtoBufFile pbfile(file);
- TString grpc_version;
+ TString grpc_version;
GeneratorConfiguration extended_config(config_);
bool success = ParseParameters(parameter, &grpc_version,
&(extended_config.prefixes_to_filter), error);
diff --git a/contrib/libs/grpc/src/compiler/python_generator.h b/contrib/libs/grpc/src/compiler/python_generator.h
index 962e23cac05..bcde0a5e358 100644
--- a/contrib/libs/grpc/src/compiler/python_generator.h
+++ b/contrib/libs/grpc/src/compiler/python_generator.h
@@ -31,12 +31,12 @@ namespace grpc_python_generator {
// that may be used internally at Google.
struct GeneratorConfiguration {
GeneratorConfiguration();
- TString grpc_package_root;
+ TString grpc_package_root;
// TODO(https://github.com/grpc/grpc/issues/8622): Drop this.
- TString beta_package_root;
+ TString beta_package_root;
// TODO(https://github.com/google/protobuf/issues/888): Drop this.
- TString import_prefix;
- std::vector<TString> prefixes_to_filter;
+ TString import_prefix;
+ std::vector<TString> prefixes_to_filter;
};
class PythonGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator {
@@ -44,12 +44,12 @@ class PythonGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator {
PythonGrpcGenerator(const GeneratorConfiguration& config);
~PythonGrpcGenerator();
- uint64_t GetSupportedFeatures() const override;
-
+ uint64_t GetSupportedFeatures() const override;
+
bool Generate(const grpc::protobuf::FileDescriptor* file,
- const TString& parameter,
+ const TString& parameter,
grpc::protobuf::compiler::GeneratorContext* context,
- TString* error) const override;
+ TString* error) const override;
private:
GeneratorConfiguration config_;
diff --git a/contrib/libs/grpc/src/compiler/python_generator_helpers.h b/contrib/libs/grpc/src/compiler/python_generator_helpers.h
index 441b7dc4c06..78e7efd7e0d 100644
--- a/contrib/libs/grpc/src/compiler/python_generator_helpers.h
+++ b/contrib/libs/grpc/src/compiler/python_generator_helpers.h
@@ -47,11 +47,11 @@ namespace grpc_python_generator {
namespace {
typedef vector<const Descriptor*> DescriptorVector;
-typedef vector<TString> StringVector;
+typedef vector<TString> StringVector;
-static TString StripModulePrefixes(
- const TString& raw_module_name,
- const std::vector<TString>& prefixes_to_filter) {
+static TString StripModulePrefixes(
+ const TString& raw_module_name,
+ const std::vector<TString>& prefixes_to_filter) {
for (const auto& prefix : prefixes_to_filter) {
if (raw_module_name.rfind(prefix, 0) == 0) {
return raw_module_name.substr(prefix.size(),
@@ -64,10 +64,10 @@ static TString StripModulePrefixes(
// TODO(https://github.com/google/protobuf/issues/888):
// Export `ModuleName` from protobuf's
// `src/google/protobuf/compiler/python/python_generator.cc` file.
-TString ModuleName(const TString& filename,
- const TString& import_prefix,
- const std::vector<TString>& prefixes_to_filter) {
- TString basename = StripProto(filename);
+TString ModuleName(const TString& filename,
+ const TString& import_prefix,
+ const std::vector<TString>& prefixes_to_filter) {
+ TString basename = StripProto(filename);
basename = StringReplace(basename, "-", "_");
basename = StringReplace(basename, "/", ".");
return StripModulePrefixes(import_prefix + basename + "_pb2",
@@ -77,10 +77,10 @@ TString ModuleName(const TString& filename,
// TODO(https://github.com/google/protobuf/issues/888):
// Export `ModuleAlias` from protobuf's
// `src/google/protobuf/compiler/python/python_generator.cc` file.
-TString ModuleAlias(const TString& filename,
- const TString& import_prefix,
- const std::vector<TString>& prefixes_to_filter) {
- TString module_name =
+TString ModuleAlias(const TString& filename,
+ const TString& import_prefix,
+ const std::vector<TString>& prefixes_to_filter) {
+ TString module_name =
ModuleName(filename, import_prefix, prefixes_to_filter);
// We can't have dots in the module name, so we replace each with _dot_.
// But that could lead to a collision between a.b and a_dot_b, so we also
@@ -91,29 +91,29 @@ TString ModuleAlias(const TString& filename,
}
bool GetModuleAndMessagePath(
- const Descriptor* type, TString* out, TString generator_file_name,
- bool generate_in_pb2_grpc, TString& import_prefix,
- const std::vector<TString>& prefixes_to_filter) {
+ const Descriptor* type, TString* out, TString generator_file_name,
+ bool generate_in_pb2_grpc, TString& import_prefix,
+ const std::vector<TString>& prefixes_to_filter) {
const Descriptor* path_elem_type = type;
DescriptorVector message_path;
do {
message_path.push_back(path_elem_type);
path_elem_type = path_elem_type->containing_type();
} while (path_elem_type); // implicit nullptr comparison; don't be explicit
- TString file_name = type->file()->name();
+ TString file_name = type->file()->name();
static const int proto_suffix_length = strlen(".proto");
if (!(file_name.size() > static_cast<size_t>(proto_suffix_length) &&
file_name.find_last_of(".proto") == file_name.size() - 1)) {
return false;
}
- TString module;
+ TString module;
if (generator_file_name != file_name || generate_in_pb2_grpc) {
module = ModuleAlias(file_name, import_prefix, prefixes_to_filter) + ".";
} else {
module = "";
}
- TString message_type;
+ TString message_type;
for (DescriptorVector::reverse_iterator path_iter = message_path.rbegin();
path_iter != message_path.rend(); ++path_iter) {
message_type += (*path_iter)->name() + ".";
@@ -136,8 +136,8 @@ StringVector get_all_comments(const DescriptorType* descriptor) {
return comments;
}
-inline void Split(const TString& s, char delim,
- std::vector<TString>* append_to) {
+inline void Split(const TString& s, char delim,
+ std::vector<TString>* append_to) {
auto current = s.begin();
while (current <= s.end()) {
auto next = std::find(current, s.end(), delim);
diff --git a/contrib/libs/grpc/src/compiler/python_private_generator.h b/contrib/libs/grpc/src/compiler/python_private_generator.h
index 48bce873f20..3039a38e122 100644
--- a/contrib/libs/grpc/src/compiler/python_private_generator.h
+++ b/contrib/libs/grpc/src/compiler/python_private_generator.h
@@ -42,7 +42,7 @@ struct PrivateGenerator {
PrivateGenerator(const GeneratorConfiguration& config,
const grpc_generator::File* file);
- std::pair<bool, TString> GetGrpcServices();
+ std::pair<bool, TString> GetGrpcServices();
private:
bool PrintPreamble(grpc_generator::Printer* out);
@@ -51,32 +51,32 @@ struct PrivateGenerator {
bool PrintBetaServices(grpc_generator::Printer* out);
bool PrintAddServicerToServer(
- const TString& package_qualified_service_name,
+ const TString& package_qualified_service_name,
const grpc_generator::Service* service, grpc_generator::Printer* out);
bool PrintServicer(const grpc_generator::Service* service,
grpc_generator::Printer* out);
- bool PrintStub(const TString& package_qualified_service_name,
+ bool PrintStub(const TString& package_qualified_service_name,
const grpc_generator::Service* service,
grpc_generator::Printer* out);
- bool PrintServiceClass(const TString& package_qualified_service_name,
- const grpc_generator::Service* service,
- grpc_generator::Printer* out);
+ bool PrintServiceClass(const TString& package_qualified_service_name,
+ const grpc_generator::Service* service,
+ grpc_generator::Printer* out);
bool PrintBetaServicer(const grpc_generator::Service* service,
grpc_generator::Printer* out);
- bool PrintBetaServerFactory(const TString& package_qualified_service_name,
- const grpc_generator::Service* service,
- grpc_generator::Printer* out);
+ bool PrintBetaServerFactory(const TString& package_qualified_service_name,
+ const grpc_generator::Service* service,
+ grpc_generator::Printer* out);
bool PrintBetaStub(const grpc_generator::Service* service,
grpc_generator::Printer* out);
- bool PrintBetaStubFactory(const TString& package_qualified_service_name,
+ bool PrintBetaStubFactory(const TString& package_qualified_service_name,
const grpc_generator::Service* service,
grpc_generator::Printer* out);
// Get all comments (leading, leading_detached, trailing) and print them as a
// docstring. Any leading space of a line will be removed, but the line
// wrapping will not be changed.
- void PrintAllComments(std::vector<TString> comments,
+ void PrintAllComments(std::vector<TString> comments,
grpc_generator::Printer* out);
};
diff --git a/contrib/libs/grpc/src/compiler/ruby_generator.cc b/contrib/libs/grpc/src/compiler/ruby_generator.cc
index eeb82612a4e..c82e78fd640 100644
--- a/contrib/libs/grpc/src/compiler/ruby_generator.cc
+++ b/contrib/libs/grpc/src/compiler/ruby_generator.cc
@@ -38,16 +38,16 @@ namespace grpc_ruby_generator {
namespace {
// Prints out the method using the ruby gRPC DSL.
-void PrintMethod(const MethodDescriptor* method, Printer* out) {
- TString input_type = RubyTypeOf(method->input_type());
+void PrintMethod(const MethodDescriptor* method, Printer* out) {
+ TString input_type = RubyTypeOf(method->input_type());
if (method->client_streaming()) {
input_type = "stream(" + input_type + ")";
}
- TString output_type = RubyTypeOf(method->output_type());
+ TString output_type = RubyTypeOf(method->output_type());
if (method->server_streaming()) {
output_type = "stream(" + output_type + ")";
}
- std::map<TString, TString> method_vars = ListToDict({
+ std::map<TString, TString> method_vars = ListToDict({
"mth.name",
method->name(),
"input.type",
@@ -61,13 +61,13 @@ void PrintMethod(const MethodDescriptor* method, Printer* out) {
}
// Prints out the service using the ruby gRPC DSL.
-void PrintService(const ServiceDescriptor* service, Printer* out) {
+void PrintService(const ServiceDescriptor* service, Printer* out) {
if (service->method_count() == 0) {
return;
}
// Begin the service module
- std::map<TString, TString> module_vars = ListToDict({
+ std::map<TString, TString> module_vars = ListToDict({
"module.name",
Modularize(service->name()),
});
@@ -84,12 +84,12 @@ void PrintService(const ServiceDescriptor* service, Printer* out) {
out->Print("\n");
out->Print("self.marshal_class_method = :encode\n");
out->Print("self.unmarshal_class_method = :decode\n");
- std::map<TString, TString> pkg_vars =
+ std::map<TString, TString> pkg_vars =
ListToDict({"service_full_name", service->full_name()});
out->Print(pkg_vars, "self.service_name = '$service_full_name$'\n");
out->Print("\n");
for (int i = 0; i < service->method_count(); ++i) {
- PrintMethod(service->method(i), out);
+ PrintMethod(service->method(i), out);
}
out->Outdent();
@@ -120,12 +120,12 @@ char ToUpper(char ch) { return IsLower(ch) ? (ch - 'a' + 'A') : ch; }
// names must be PascalCased.
//
// foo_bar_baz -> FooBarBaz
-TString PackageToModule(const TString& name) {
+TString PackageToModule(const TString& name) {
bool next_upper = true;
- TString result;
+ TString result;
result.reserve(name.size());
- for (TString::size_type i = 0; i < name.size(); i++) {
+ for (TString::size_type i = 0; i < name.size(); i++) {
if (name[i] == '_') {
next_upper = true;
} else {
@@ -142,8 +142,8 @@ TString PackageToModule(const TString& name) {
}
// end copying of protoc generator for ruby code
-TString GetServices(const FileDescriptor* file) {
- TString output;
+TString GetServices(const FileDescriptor* file) {
+ TString output;
{
// Scope the output stream so it closes and finalizes output to the string.
@@ -156,10 +156,10 @@ TString GetServices(const FileDescriptor* file) {
return output;
}
- TString package_name = RubyPackage(file);
+ TString package_name = RubyPackage(file);
// Write out a file header.
- std::map<TString, TString> header_comment_vars = ListToDict({
+ std::map<TString, TString> header_comment_vars = ListToDict({
"file.name",
file->name(),
"file.package",
@@ -169,7 +169,7 @@ TString GetServices(const FileDescriptor* file) {
out.Print(header_comment_vars,
"# Source: $file.name$ for package '$file.package$'\n");
- TString leading_comments = GetRubyComments(file, true);
+ TString leading_comments = GetRubyComments(file, true);
if (!leading_comments.empty()) {
out.Print("# Original file comments:\n");
out.PrintRaw(leading_comments.c_str());
@@ -180,7 +180,7 @@ TString GetServices(const FileDescriptor* file) {
// Write out require statemment to import the separately generated file
// that defines the messages used by the service. This is generated by the
// main ruby plugin.
- std::map<TString, TString> dep_vars = ListToDict({
+ std::map<TString, TString> dep_vars = ListToDict({
"dep.name",
MessagesRequireName(file),
});
@@ -188,9 +188,9 @@ TString GetServices(const FileDescriptor* file) {
// Write out services within the modules
out.Print("\n");
- std::vector<TString> modules = Split(package_name, '.');
+ std::vector<TString> modules = Split(package_name, '.');
for (size_t i = 0; i < modules.size(); ++i) {
- std::map<TString, TString> module_vars = ListToDict({
+ std::map<TString, TString> module_vars = ListToDict({
"module.name",
PackageToModule(modules[i]),
});
@@ -199,7 +199,7 @@ TString GetServices(const FileDescriptor* file) {
}
for (int i = 0; i < file->service_count(); ++i) {
auto service = file->service(i);
- PrintService(service, &out);
+ PrintService(service, &out);
}
for (size_t i = 0; i < modules.size(); ++i) {
out.Outdent();
diff --git a/contrib/libs/grpc/src/compiler/ruby_generator.h b/contrib/libs/grpc/src/compiler/ruby_generator.h
index d4f23eca5f9..325dc02294a 100644
--- a/contrib/libs/grpc/src/compiler/ruby_generator.h
+++ b/contrib/libs/grpc/src/compiler/ruby_generator.h
@@ -23,7 +23,7 @@
namespace grpc_ruby_generator {
-TString GetServices(const grpc::protobuf::FileDescriptor* file);
+TString GetServices(const grpc::protobuf::FileDescriptor* file);
} // namespace grpc_ruby_generator
diff --git a/contrib/libs/grpc/src/compiler/ruby_generator_helpers-inl.h b/contrib/libs/grpc/src/compiler/ruby_generator_helpers-inl.h
index 504d0e1db15..9a109766194 100644
--- a/contrib/libs/grpc/src/compiler/ruby_generator_helpers-inl.h
+++ b/contrib/libs/grpc/src/compiler/ruby_generator_helpers-inl.h
@@ -26,7 +26,7 @@
namespace grpc_ruby_generator {
inline bool ServicesFilename(const grpc::protobuf::FileDescriptor* file,
- TString* file_name_or_error) {
+ TString* file_name_or_error) {
// Get output file name.
static const unsigned proto_suffix_length = 6; // length of ".proto"
if (file->name().size() > proto_suffix_length &&
@@ -41,7 +41,7 @@ inline bool ServicesFilename(const grpc::protobuf::FileDescriptor* file,
}
}
-inline TString MessagesRequireName(
+inline TString MessagesRequireName(
const grpc::protobuf::FileDescriptor* file) {
return Replace(file->name(), ".proto", "_pb");
}
@@ -49,7 +49,7 @@ inline TString MessagesRequireName(
// Get leading or trailing comments in a string. Comment lines start with "# ".
// Leading detached comments are put in front of leading comments.
template <typename DescriptorType>
-inline TString GetRubyComments(const DescriptorType* desc, bool leading) {
+inline TString GetRubyComments(const DescriptorType* desc, bool leading) {
return grpc_generator::GetPrefixedComments(desc, leading, "#");
}
diff --git a/contrib/libs/grpc/src/compiler/ruby_generator_map-inl.h b/contrib/libs/grpc/src/compiler/ruby_generator_map-inl.h
index 87ee01ceb36..4c75780b1a3 100644
--- a/contrib/libs/grpc/src/compiler/ruby_generator_map-inl.h
+++ b/contrib/libs/grpc/src/compiler/ruby_generator_map-inl.h
@@ -35,17 +35,17 @@ namespace grpc_ruby_generator {
// Converts an initializer list of the form { key0, value0, key1, value1, ... }
// into a map of key* to value*. Is merely a readability helper for later code.
-inline std::map<TString, TString> ListToDict(
- const initializer_list<TString>& values) {
+inline std::map<TString, TString> ListToDict(
+ const initializer_list<TString>& values) {
if (values.size() % 2 != 0) {
std::cerr << "Not every 'key' has a value in `values`." << std::endl;
}
- std::map<TString, TString> value_map;
+ std::map<TString, TString> value_map;
auto value_iter = values.begin();
for (unsigned i = 0; i < values.size() / 2; ++i) {
- TString key = *value_iter;
+ TString key = *value_iter;
++value_iter;
- TString value = *value_iter;
+ TString value = *value_iter;
value_map[key] = value;
++value_iter;
}
diff --git a/contrib/libs/grpc/src/compiler/ruby_generator_string-inl.h b/contrib/libs/grpc/src/compiler/ruby_generator_string-inl.h
index 04f9924268b..956539f392a 100644
--- a/contrib/libs/grpc/src/compiler/ruby_generator_string-inl.h
+++ b/contrib/libs/grpc/src/compiler/ruby_generator_string-inl.h
@@ -31,10 +31,10 @@ using std::transform;
namespace grpc_ruby_generator {
// Split splits a string using char into elems.
-inline std::vector<TString>& Split(const TString& s, char delim,
- std::vector<TString>* elems) {
+inline std::vector<TString>& Split(const TString& s, char delim,
+ std::vector<TString>* elems) {
std::stringstream ss(s);
- TString item;
+ TString item;
while (getline(ss, item, delim)) {
elems->push_back(item);
}
@@ -42,17 +42,17 @@ inline std::vector<TString>& Split(const TString& s, char delim,
}
// Split splits a string using char, returning the result in a vector.
-inline std::vector<TString> Split(const TString& s, char delim) {
- std::vector<TString> elems;
+inline std::vector<TString> Split(const TString& s, char delim) {
+ std::vector<TString> elems;
Split(s, delim, &elems);
return elems;
}
// Replace replaces from with to in s.
-inline TString Replace(TString s, const TString& from,
- const TString& to) {
+inline TString Replace(TString s, const TString& from,
+ const TString& to) {
size_t start_pos = s.find(from);
- if (start_pos == TString::npos) {
+ if (start_pos == TString::npos) {
return s;
}
s.replace(start_pos, from.length(), to);
@@ -60,10 +60,10 @@ inline TString Replace(TString s, const TString& from,
}
// ReplaceAll replaces all instances of search with replace in s.
-inline TString ReplaceAll(TString s, const TString& search,
- const TString& replace) {
+inline TString ReplaceAll(TString s, const TString& search,
+ const TString& replace) {
size_t pos = 0;
- while ((pos = s.find(search, pos)) != TString::npos) {
+ while ((pos = s.find(search, pos)) != TString::npos) {
s.replace(pos, search.length(), replace);
pos += replace.length();
}
@@ -71,10 +71,10 @@ inline TString ReplaceAll(TString s, const TString& search,
}
// ReplacePrefix replaces from with to in s if search is a prefix of s.
-inline bool ReplacePrefix(TString* s, const TString& from,
- const TString& to) {
+inline bool ReplacePrefix(TString* s, const TString& from,
+ const TString& to) {
size_t start_pos = s->find(from);
- if (start_pos == TString::npos || start_pos != 0) {
+ if (start_pos == TString::npos || start_pos != 0) {
return false;
}
s->replace(start_pos, from.length(), to);
@@ -82,14 +82,14 @@ inline bool ReplacePrefix(TString* s, const TString& from,
}
// Modularize converts a string into a ruby module compatible name
-inline TString Modularize(TString s) {
+inline TString Modularize(TString s) {
if (s.empty()) {
return s;
}
- TString new_string = "";
+ TString new_string = "";
bool was_last_underscore = false;
new_string.append(1, ::toupper(s[0]));
- for (TString::size_type i = 1; i < s.size(); ++i) {
+ for (TString::size_type i = 1; i < s.size(); ++i) {
if (was_last_underscore && s[i] != '_') {
new_string.append(1, ::toupper(s[i]));
} else if (s[i] != '_') {
@@ -101,8 +101,8 @@ inline TString Modularize(TString s) {
}
// RubyPackage gets the ruby package in either proto or ruby_package format
-inline TString RubyPackage(const grpc::protobuf::FileDescriptor* file) {
- TString package_name = file->package();
+inline TString RubyPackage(const grpc::protobuf::FileDescriptor* file) {
+ TString package_name = file->package();
if (file->options().has_ruby_package()) {
package_name = file->options().ruby_package();
@@ -116,19 +116,19 @@ inline TString RubyPackage(const grpc::protobuf::FileDescriptor* file) {
}
// RubyTypeOf updates a proto type to the required ruby equivalent.
-inline TString RubyTypeOf(const grpc::protobuf::Descriptor* descriptor) {
- TString proto_type = descriptor->full_name();
+inline TString RubyTypeOf(const grpc::protobuf::Descriptor* descriptor) {
+ TString proto_type = descriptor->full_name();
if (descriptor->file()->options().has_ruby_package()) {
- // remove the leading package if present
- ReplacePrefix(&proto_type, descriptor->file()->package(), "");
- ReplacePrefix(&proto_type, ".", ""); // remove the leading . (no package)
- proto_type = RubyPackage(descriptor->file()) + "." + proto_type;
+ // remove the leading package if present
+ ReplacePrefix(&proto_type, descriptor->file()->package(), "");
+ ReplacePrefix(&proto_type, ".", ""); // remove the leading . (no package)
+ proto_type = RubyPackage(descriptor->file()) + "." + proto_type;
}
- TString res("." + proto_type);
- if (res.find('.') == TString::npos) {
+ TString res("." + proto_type);
+ if (res.find('.') == TString::npos) {
return res;
} else {
- std::vector<TString> prefixes_and_type = Split(res, '.');
+ std::vector<TString> prefixes_and_type = Split(res, '.');
res.clear();
for (unsigned int i = 0; i < prefixes_and_type.size(); ++i) {
if (i != 0) {
diff --git a/contrib/libs/grpc/src/compiler/schema_interface.h b/contrib/libs/grpc/src/compiler/schema_interface.h
index abf6f55ae7f..60b9d337e8d 100644
--- a/contrib/libs/grpc/src/compiler/schema_interface.h
+++ b/contrib/libs/grpc/src/compiler/schema_interface.h
@@ -22,19 +22,19 @@
#include "src/compiler/config.h"
#include <memory>
-#include <util/generic/string.h>
+#include <util/generic/string.h>
#include <vector>
-#ifdef GRPC_CUSTOM_STRING
-#warning GRPC_CUSTOM_STRING is no longer supported. Please use TString.
+#ifdef GRPC_CUSTOM_STRING
+#warning GRPC_CUSTOM_STRING is no longer supported. Please use TString.
#endif
namespace grpc {
-// Using grpc::string and grpc::to_string is discouraged in favor of
-// TString and ToString. This is only for legacy code using
-// them explictly.
-typedef TString string; // deprecated
+// Using grpc::string and grpc::to_string is discouraged in favor of
+// TString and ToString. This is only for legacy code using
+// them explictly.
+typedef TString string; // deprecated
} // namespace grpc
@@ -44,31 +44,31 @@ namespace grpc_generator {
// Return formatted comments to be inserted in generated code.
struct CommentHolder {
virtual ~CommentHolder() {}
- virtual TString GetLeadingComments(const TString prefix) const = 0;
- virtual TString GetTrailingComments(const TString prefix) const = 0;
- virtual std::vector<TString> GetAllComments() const = 0;
+ virtual TString GetLeadingComments(const TString prefix) const = 0;
+ virtual TString GetTrailingComments(const TString prefix) const = 0;
+ virtual std::vector<TString> GetAllComments() const = 0;
};
// An abstract interface representing a method.
struct Method : public CommentHolder {
virtual ~Method() {}
- virtual TString name() const = 0;
+ virtual TString name() const = 0;
- virtual TString input_type_name() const = 0;
- virtual TString output_type_name() const = 0;
+ virtual TString input_type_name() const = 0;
+ virtual TString output_type_name() const = 0;
virtual bool get_module_and_message_path_input(
- TString* str, TString generator_file_name,
- bool generate_in_pb2_grpc, TString import_prefix,
- const std::vector<TString>& prefixes_to_filter) const = 0;
+ TString* str, TString generator_file_name,
+ bool generate_in_pb2_grpc, TString import_prefix,
+ const std::vector<TString>& prefixes_to_filter) const = 0;
virtual bool get_module_and_message_path_output(
- TString* str, TString generator_file_name,
- bool generate_in_pb2_grpc, TString import_prefix,
- const std::vector<TString>& prefixes_to_filter) const = 0;
+ TString* str, TString generator_file_name,
+ bool generate_in_pb2_grpc, TString import_prefix,
+ const std::vector<TString>& prefixes_to_filter) const = 0;
- virtual TString get_input_type_name() const = 0;
- virtual TString get_output_type_name() const = 0;
+ virtual TString get_input_type_name() const = 0;
+ virtual TString get_output_type_name() const = 0;
virtual bool NoStreaming() const = 0;
virtual bool ClientStreaming() const = 0;
virtual bool ServerStreaming() const = 0;
@@ -79,7 +79,7 @@ struct Method : public CommentHolder {
struct Service : public CommentHolder {
virtual ~Service() {}
- virtual TString name() const = 0;
+ virtual TString name() const = 0;
virtual int method_count() const = 0;
virtual std::unique_ptr<const Method> method(int i) const = 0;
@@ -88,7 +88,7 @@ struct Service : public CommentHolder {
struct Printer {
virtual ~Printer() {}
- virtual void Print(const std::map<TString, TString>& vars,
+ virtual void Print(const std::map<TString, TString>& vars,
const char* template_string) = 0;
virtual void Print(const char* string) = 0;
virtual void PrintRaw(const char* string) = 0;
@@ -101,17 +101,17 @@ struct Printer {
struct File : public CommentHolder {
virtual ~File() {}
- virtual TString filename() const = 0;
- virtual TString filename_without_ext() const = 0;
- virtual TString package() const = 0;
- virtual std::vector<TString> package_parts() const = 0;
- virtual TString additional_headers() const = 0;
- virtual std::vector<TString> GetImportNames() const { return {}; }
+ virtual TString filename() const = 0;
+ virtual TString filename_without_ext() const = 0;
+ virtual TString package() const = 0;
+ virtual std::vector<TString> package_parts() const = 0;
+ virtual TString additional_headers() const = 0;
+ virtual std::vector<TString> GetImportNames() const { return {}; }
virtual int service_count() const = 0;
virtual std::unique_ptr<const Service> service(int i) const = 0;
- virtual std::unique_ptr<Printer> CreatePrinter(TString* str) const = 0;
+ virtual std::unique_ptr<Printer> CreatePrinter(TString* str) const = 0;
};
} // namespace grpc_generator
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/backend_metric.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/backend_metric.cc
index 66c140555cf..257663cf201 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/backend_metric.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/backend_metric.cc
@@ -18,33 +18,33 @@
#include "src/core/ext/filters/client_channel/backend_metric.h"
-#include "y_absl/strings/string_view.h"
-
+#include "y_absl/strings/string_view.h"
+
#include "udpa/data/orca/v1/orca_load_report.upb.h"
-#include "upb/upb.hpp"
+#include "upb/upb.hpp"
+
+#include "src/core/lib/gprpp/map.h"
-#include "src/core/lib/gprpp/map.h"
-
namespace grpc_core {
namespace {
template <typename EntryType>
-std::map<y_absl::string_view, double, StringLess> ParseMap(
+std::map<y_absl::string_view, double, StringLess> ParseMap(
udpa_data_orca_v1_OrcaLoadReport* msg,
- const EntryType* (*entry_func)(const udpa_data_orca_v1_OrcaLoadReport*,
- size_t*),
+ const EntryType* (*entry_func)(const udpa_data_orca_v1_OrcaLoadReport*,
+ size_t*),
upb_strview (*key_func)(const EntryType*),
double (*value_func)(const EntryType*), Arena* arena) {
- std::map<y_absl::string_view, double, StringLess> result;
- size_t i = UPB_MAP_BEGIN;
- while (true) {
- const auto* entry = entry_func(msg, &i);
- if (entry == nullptr) break;
- upb_strview key_view = key_func(entry);
- char* key = static_cast<char*>(arena->Alloc(key_view.size));
+ std::map<y_absl::string_view, double, StringLess> result;
+ size_t i = UPB_MAP_BEGIN;
+ while (true) {
+ const auto* entry = entry_func(msg, &i);
+ if (entry == nullptr) break;
+ upb_strview key_view = key_func(entry);
+ char* key = static_cast<char*>(arena->Alloc(key_view.size));
memcpy(key, key_view.data, key_view.size);
- result[y_absl::string_view(key, key_view.size)] = value_func(entry);
+ result[y_absl::string_view(key, key_view.size)] = value_func(entry);
}
return result;
}
@@ -70,12 +70,12 @@ const LoadBalancingPolicy::BackendMetricData* ParseBackendMetricData(
udpa_data_orca_v1_OrcaLoadReport_rps(msg);
backend_metric_data->request_cost =
ParseMap<udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry>(
- msg, udpa_data_orca_v1_OrcaLoadReport_request_cost_next,
+ msg, udpa_data_orca_v1_OrcaLoadReport_request_cost_next,
udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry_key,
udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry_value, arena);
backend_metric_data->utilization =
ParseMap<udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry>(
- msg, udpa_data_orca_v1_OrcaLoadReport_utilization_next,
+ msg, udpa_data_orca_v1_OrcaLoadReport_utilization_next,
udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry_key,
udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry_value, arena);
return backend_metric_data;
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/backup_poller.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/backup_poller.cc
index 16a466d1406..1b7708953ab 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/backup_poller.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/backup_poller.cc
@@ -106,7 +106,7 @@ static void g_poller_unref() {
grpc_schedule_on_exec_ctx));
gpr_mu_unlock(p->pollset_mu);
grpc_timer_cancel(&p->polling_timer);
- backup_poller_shutdown_unref(p);
+ backup_poller_shutdown_unref(p);
} else {
gpr_mu_unlock(&g_poller_mu);
}
@@ -144,8 +144,8 @@ static void g_poller_init_locked() {
g_poller->shutting_down = false;
grpc_pollset_init(g_poller->pollset, &g_poller->pollset_mu);
gpr_ref_init(&g_poller->refs, 0);
- // one for timer cancellation, one for pollset shutdown, one for g_poller
- gpr_ref_init(&g_poller->shutdown_refs, 3);
+ // one for timer cancellation, one for pollset shutdown, one for g_poller
+ gpr_ref_init(&g_poller->shutdown_refs, 3);
GRPC_CLOSURE_INIT(&g_poller->run_poller_closure, run_poller, g_poller,
grpc_schedule_on_exec_ctx);
grpc_timer_init(&g_poller->polling_timer,
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/client_channel.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/client_channel.cc
index 0bf2996c359..908a05248cb 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/client_channel.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/client_channel.cc
@@ -28,21 +28,21 @@
#include <set>
-#include "y_absl/strings/numbers.h"
-#include "y_absl/strings/str_cat.h"
-#include "y_absl/strings/string_view.h"
-
+#include "y_absl/strings/numbers.h"
+#include "y_absl/strings/str_cat.h"
+#include "y_absl/strings/string_view.h"
+
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
#include <grpc/support/sync.h>
-#include "y_absl/container/inlined_vector.h"
-#include "y_absl/types/optional.h"
-
+#include "y_absl/container/inlined_vector.h"
+#include "y_absl/types/optional.h"
+
#include "src/core/ext/filters/client_channel/backend_metric.h"
#include "src/core/ext/filters/client_channel/backup_poller.h"
-#include "src/core/ext/filters/client_channel/config_selector.h"
+#include "src/core/ext/filters/client_channel/config_selector.h"
#include "src/core/ext/filters/client_channel/global_subchannel_pool.h"
#include "src/core/ext/filters/client_channel/http_connect_handshaker.h"
#include "src/core/ext/filters/client_channel/lb_policy_registry.h"
@@ -53,7 +53,7 @@
#include "src/core/ext/filters/client_channel/resolving_lb_policy.h"
#include "src/core/ext/filters/client_channel/retry_throttle.h"
#include "src/core/ext/filters/client_channel/service_config.h"
-#include "src/core/ext/filters/client_channel/service_config_call_data.h"
+#include "src/core/ext/filters/client_channel/service_config_call_data.h"
#include "src/core/ext/filters/client_channel/subchannel.h"
#include "src/core/ext/filters/deadline/deadline_filter.h"
#include "src/core/lib/backoff/backoff.h"
@@ -66,7 +66,7 @@
#include "src/core/lib/gprpp/sync.h"
#include "src/core/lib/iomgr/iomgr.h"
#include "src/core/lib/iomgr/polling_entity.h"
-#include "src/core/lib/iomgr/work_serializer.h"
+#include "src/core/lib/iomgr/work_serializer.h"
#include "src/core/lib/profiling/timers.h"
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/slice/slice_string_helpers.h"
@@ -134,7 +134,7 @@ class ChannelData {
size_t per_rpc_retry_buffer_size() const {
return per_rpc_retry_buffer_size_;
}
- grpc_channel_stack* owning_stack() const { return owning_stack_; }
+ grpc_channel_stack* owning_stack() const { return owning_stack_; }
// Note: Does NOT return a new ref.
grpc_error* disconnect_error() const {
@@ -152,17 +152,17 @@ class ChannelData {
bool received_service_config_data() const {
return received_service_config_data_;
}
- grpc_error* resolver_transient_failure_error() const {
- return resolver_transient_failure_error_;
- }
+ grpc_error* resolver_transient_failure_error() const {
+ return resolver_transient_failure_error_;
+ }
RefCountedPtr<ServerRetryThrottleData> retry_throttle_data() const {
return retry_throttle_data_;
}
RefCountedPtr<ServiceConfig> service_config() const {
return service_config_;
}
- ConfigSelector* config_selector() const { return config_selector_.get(); }
- WorkSerializer* work_serializer() const { return work_serializer_.get(); }
+ ConfigSelector* config_selector() const { return config_selector_.get(); }
+ WorkSerializer* work_serializer() const { return work_serializer_.get(); }
RefCountedPtr<ConnectedSubchannel> GetConnectedSubchannelInDataPlane(
SubchannelInterface* subchannel) const;
@@ -173,14 +173,14 @@ class ChannelData {
grpc_connectivity_state* state,
grpc_closure* on_complete,
grpc_closure* watcher_timer_init) {
- new ExternalConnectivityWatcher(this, pollent, state, on_complete,
- watcher_timer_init);
+ new ExternalConnectivityWatcher(this, pollent, state, on_complete,
+ watcher_timer_init);
}
void RemoveExternalConnectivityWatcher(grpc_closure* on_complete,
bool cancel) {
- ExternalConnectivityWatcher::RemoveWatcherFromExternalWatchersMap(
- this, on_complete, cancel);
+ ExternalConnectivityWatcher::RemoveWatcherFromExternalWatchersMap(
+ this, on_complete, cancel);
}
int NumExternalConnectivityWatchers() const {
@@ -211,21 +211,21 @@ class ChannelData {
~ExternalConnectivityWatcher();
- // Removes the watcher from the external_watchers_ map.
- static void RemoveWatcherFromExternalWatchersMap(ChannelData* chand,
- grpc_closure* on_complete,
- bool cancel);
-
- void Notify(grpc_connectivity_state state,
- const y_absl::Status& /* status */) override;
+ // Removes the watcher from the external_watchers_ map.
+ static void RemoveWatcherFromExternalWatchersMap(ChannelData* chand,
+ grpc_closure* on_complete,
+ bool cancel);
+
+ void Notify(grpc_connectivity_state state,
+ const y_absl::Status& /* status */) override;
void Cancel();
private:
- // Adds the watcher to state_tracker_. Consumes the ref that is passed to it
- // from Start().
- void AddWatcherLocked();
- void RemoveWatcherLocked();
+ // Adds the watcher to state_tracker_. Consumes the ref that is passed to it
+ // from Start().
+ void AddWatcherLocked();
+ void RemoveWatcherLocked();
ChannelData* chand_;
grpc_polling_entity pollent_;
@@ -236,52 +236,52 @@ class ChannelData {
Atomic<bool> done_{false};
};
- class ChannelConfigHelper
- : public ResolvingLoadBalancingPolicy::ChannelConfigHelper {
- public:
- explicit ChannelConfigHelper(ChannelData* chand) : chand_(chand) {}
-
- ChooseServiceConfigResult ChooseServiceConfig(
- const Resolver::Result& result) override;
-
- void StartUsingServiceConfigForCalls() override;
-
- void ResolverTransientFailure(grpc_error* error) override;
-
- private:
- static void ChooseLbPolicy(
- const Resolver::Result& resolver_result,
- const internal::ClientChannelGlobalParsedConfig* parsed_service_config,
- RefCountedPtr<LoadBalancingPolicy::Config>* lb_policy_config);
-
- ChannelData* chand_;
- };
-
+ class ChannelConfigHelper
+ : public ResolvingLoadBalancingPolicy::ChannelConfigHelper {
+ public:
+ explicit ChannelConfigHelper(ChannelData* chand) : chand_(chand) {}
+
+ ChooseServiceConfigResult ChooseServiceConfig(
+ const Resolver::Result& result) override;
+
+ void StartUsingServiceConfigForCalls() override;
+
+ void ResolverTransientFailure(grpc_error* error) override;
+
+ private:
+ static void ChooseLbPolicy(
+ const Resolver::Result& resolver_result,
+ const internal::ClientChannelGlobalParsedConfig* parsed_service_config,
+ RefCountedPtr<LoadBalancingPolicy::Config>* lb_policy_config);
+
+ ChannelData* chand_;
+ };
+
ChannelData(grpc_channel_element_args* args, grpc_error** error);
~ChannelData();
void UpdateStateAndPickerLocked(
- grpc_connectivity_state state, const y_absl::Status& status,
- const char* reason,
+ grpc_connectivity_state state, const y_absl::Status& status,
+ const char* reason,
std::unique_ptr<LoadBalancingPolicy::SubchannelPicker> picker);
- void UpdateServiceConfigInControlPlaneLocked(
- RefCountedPtr<ServiceConfig> service_config,
- RefCountedPtr<ConfigSelector> config_selector,
- const internal::ClientChannelGlobalParsedConfig* parsed_service_config,
- const char* lb_policy_name);
+ void UpdateServiceConfigInControlPlaneLocked(
+ RefCountedPtr<ServiceConfig> service_config,
+ RefCountedPtr<ConfigSelector> config_selector,
+ const internal::ClientChannelGlobalParsedConfig* parsed_service_config,
+ const char* lb_policy_name);
+
+ void UpdateServiceConfigInDataPlaneLocked();
- void UpdateServiceConfigInDataPlaneLocked();
-
void CreateResolvingLoadBalancingPolicyLocked();
void DestroyResolvingLoadBalancingPolicyLocked();
grpc_error* DoPingLocked(grpc_transport_op* op);
- void StartTransportOpLocked(grpc_transport_op* op);
+ void StartTransportOpLocked(grpc_transport_op* op);
- void TryToConnectLocked();
+ void TryToConnectLocked();
//
// Fields set at construction and never modified.
@@ -296,7 +296,7 @@ class ChannelData {
grpc_core::UniquePtr<char> server_name_;
grpc_core::UniquePtr<char> target_uri_;
channelz::ChannelNode* channelz_node_;
- ChannelConfigHelper channel_config_helper_;
+ ChannelConfigHelper channel_config_helper_;
//
// Fields used in the data plane. Guarded by data_plane_mu.
@@ -305,39 +305,39 @@ class ChannelData {
std::unique_ptr<LoadBalancingPolicy::SubchannelPicker> picker_;
QueuedPick* queued_picks_ = nullptr; // Linked list of queued picks.
// Data from service config.
- grpc_error* resolver_transient_failure_error_ = GRPC_ERROR_NONE;
+ grpc_error* resolver_transient_failure_error_ = GRPC_ERROR_NONE;
bool received_service_config_data_ = false;
RefCountedPtr<ServerRetryThrottleData> retry_throttle_data_;
RefCountedPtr<ServiceConfig> service_config_;
- RefCountedPtr<ConfigSelector> config_selector_;
+ RefCountedPtr<ConfigSelector> config_selector_;
//
- // Fields used in the control plane. Guarded by work_serializer.
+ // Fields used in the control plane. Guarded by work_serializer.
//
- std::shared_ptr<WorkSerializer> work_serializer_;
+ std::shared_ptr<WorkSerializer> work_serializer_;
grpc_pollset_set* interested_parties_;
RefCountedPtr<SubchannelPoolInterface> subchannel_pool_;
OrphanablePtr<ResolvingLoadBalancingPolicy> resolving_lb_policy_;
ConnectivityStateTracker state_tracker_;
grpc_core::UniquePtr<char> health_check_service_name_;
RefCountedPtr<ServiceConfig> saved_service_config_;
- RefCountedPtr<ConfigSelector> saved_config_selector_;
+ RefCountedPtr<ConfigSelector> saved_config_selector_;
// The number of SubchannelWrapper instances referencing a given Subchannel.
std::map<Subchannel*, int> subchannel_refcount_map_;
// The set of SubchannelWrappers that currently exist.
// No need to hold a ref, since the map is updated in the control-plane
- // work_serializer when the SubchannelWrappers are created and destroyed.
+ // work_serializer when the SubchannelWrappers are created and destroyed.
std::set<SubchannelWrapper*> subchannel_wrappers_;
// Pending ConnectedSubchannel updates for each SubchannelWrapper.
- // Updates are queued here in the control plane work_serializer and then
- // applied in the data plane mutex when the picker is updated.
- std::map<RefCountedPtr<SubchannelWrapper>, RefCountedPtr<ConnectedSubchannel>>
+ // Updates are queued here in the control plane work_serializer and then
+ // applied in the data plane mutex when the picker is updated.
+ std::map<RefCountedPtr<SubchannelWrapper>, RefCountedPtr<ConnectedSubchannel>>
pending_subchannel_updates_;
- int keepalive_time_ = -1;
+ int keepalive_time_ = -1;
//
- // Fields accessed from both data plane mutex and control plane
- // work_serializer.
+ // Fields accessed from both data plane mutex and control plane
+ // work_serializer.
//
Atomic<grpc_error*> disconnect_error_;
@@ -354,8 +354,8 @@ class ChannelData {
// synchronously via grpc_channel_num_external_connectivity_watchers().
//
mutable Mutex external_watchers_mu_;
- std::map<grpc_closure*, RefCountedPtr<ExternalConnectivityWatcher>>
- external_watchers_;
+ std::map<grpc_closure*, RefCountedPtr<ExternalConnectivityWatcher>>
+ external_watchers_;
};
//
@@ -395,7 +395,7 @@ class CallData {
Metadata(CallData* calld, grpc_metadata_batch* batch)
: calld_(calld), batch_(batch) {}
- void Add(y_absl::string_view key, y_absl::string_view value) override {
+ void Add(y_absl::string_view key, y_absl::string_view value) override {
grpc_linked_mdelem* linked_mdelem = static_cast<grpc_linked_mdelem*>(
calld_->arena_->Alloc(sizeof(grpc_linked_mdelem)));
linked_mdelem->md = grpc_mdelem_from_slices(
@@ -408,8 +408,8 @@ class CallData {
iterator begin() const override {
static_assert(sizeof(grpc_linked_mdelem*) <= sizeof(intptr_t),
"iterator size too large");
- return iterator(
- this, reinterpret_cast<intptr_t>(MaybeSkipEntry(batch_->list.head)));
+ return iterator(
+ this, reinterpret_cast<intptr_t>(MaybeSkipEntry(batch_->list.head)));
}
iterator end() const override {
static_assert(sizeof(grpc_linked_mdelem*) <= sizeof(intptr_t),
@@ -426,20 +426,20 @@ class CallData {
}
private:
- grpc_linked_mdelem* MaybeSkipEntry(grpc_linked_mdelem* entry) const {
- if (entry != nullptr && batch_->idx.named.path == entry) {
- return entry->next;
- }
- return entry;
- }
-
+ grpc_linked_mdelem* MaybeSkipEntry(grpc_linked_mdelem* entry) const {
+ if (entry != nullptr && batch_->idx.named.path == entry) {
+ return entry->next;
+ }
+ return entry;
+ }
+
intptr_t IteratorHandleNext(intptr_t handle) const override {
grpc_linked_mdelem* linked_mdelem =
reinterpret_cast<grpc_linked_mdelem*>(handle);
- return reinterpret_cast<intptr_t>(MaybeSkipEntry(linked_mdelem->next));
+ return reinterpret_cast<intptr_t>(MaybeSkipEntry(linked_mdelem->next));
}
-
- std::pair<y_absl::string_view, y_absl::string_view> IteratorHandleGet(
+
+ std::pair<y_absl::string_view, y_absl::string_view> IteratorHandleGet(
intptr_t handle) const override {
grpc_linked_mdelem* linked_mdelem =
reinterpret_cast<grpc_linked_mdelem*>(handle);
@@ -471,12 +471,12 @@ class CallData {
return calld_->backend_metric_data_;
}
- y_absl::string_view ExperimentalGetCallAttribute(const char* key) override {
- auto it = calld_->call_attributes_.find(key);
- if (it == calld_->call_attributes_.end()) return y_absl::string_view();
- return it->second;
- }
-
+ y_absl::string_view ExperimentalGetCallAttribute(const char* key) override {
+ auto it = calld_->call_attributes_.find(key);
+ if (it == calld_->call_attributes_.end()) return y_absl::string_view();
+ return it->second;
+ }
+
private:
CallData* calld_;
};
@@ -771,17 +771,17 @@ class CallData {
void CreateSubchannelCall(grpc_call_element* elem);
// Invoked when a pick is completed, on both success or failure.
static void PickDone(void* arg, grpc_error* error);
- // Removes the call from the channel's list of queued picks if present.
- void MaybeRemoveCallFromQueuedPicksLocked(grpc_call_element* elem);
- // Adds the call to the channel's list of queued picks if not already present.
- void MaybeAddCallToQueuedPicksLocked(grpc_call_element* elem);
+ // Removes the call from the channel's list of queued picks if present.
+ void MaybeRemoveCallFromQueuedPicksLocked(grpc_call_element* elem);
+ // Adds the call to the channel's list of queued picks if not already present.
+ void MaybeAddCallToQueuedPicksLocked(grpc_call_element* elem);
// Applies service config to the call. Must be invoked once we know
// that the resolver has returned results to the channel.
- // If an error is returned, the error indicates the status with which
- // the call should be failed.
- grpc_error* ApplyServiceConfigToCallLocked(
- grpc_call_element* elem, grpc_metadata_batch* initial_metadata);
- void MaybeInvokeConfigSelectorCommitCallback();
+ // If an error is returned, the error indicates the status with which
+ // the call should be failed.
+ grpc_error* ApplyServiceConfigToCallLocked(
+ grpc_call_element* elem, grpc_metadata_batch* initial_metadata);
+ void MaybeInvokeConfigSelectorCommitCallback();
// State for handling deadlines.
// The code in deadline_filter.c requires this to be the first field.
@@ -801,8 +801,8 @@ class CallData {
RefCountedPtr<ServerRetryThrottleData> retry_throttle_data_;
const ClientChannelMethodParsedConfig* method_params_ = nullptr;
- std::map<const char*, y_absl::string_view> call_attributes_;
- std::function<void()> on_call_committed_;
+ std::map<const char*, y_absl::string_view> call_attributes_;
+ std::function<void()> on_call_committed_;
RefCountedPtr<SubchannelCall> subchannel_call_;
@@ -871,7 +871,7 @@ class CallData {
// Note: We inline the cache for the first 3 send_message ops and use
// dynamic allocation after that. This number was essentially picked
// at random; it could be changed in the future to tune performance.
- y_absl::InlinedVector<ByteStreamCache*, 3> send_messages_;
+ y_absl::InlinedVector<ByteStreamCache*, 3> send_messages_;
// send_trailing_metadata
bool seen_send_trailing_metadata_ = false;
grpc_linked_mdelem* send_trailing_metadata_storage_ = nullptr;
@@ -882,9 +882,9 @@ class CallData {
// ChannelData::SubchannelWrapper
//
-using ServerAddressAttributeMap =
- std::map<const char*, std::unique_ptr<ServerAddress::AttributeInterface>>;
-
+using ServerAddressAttributeMap =
+ std::map<const char*, std::unique_ptr<ServerAddress::AttributeInterface>>;
+
// This class is a wrapper for Subchannel that hides details of the
// channel's implementation (such as the health check service name and
// connected subchannel) from the LB policy API.
@@ -892,17 +892,17 @@ using ServerAddressAttributeMap =
// Note that no synchronization is needed here, because even if the
// underlying subchannel is shared between channels, this wrapper will only
// be used within one channel, so it will always be synchronized by the
-// control plane work_serializer.
+// control plane work_serializer.
class ChannelData::SubchannelWrapper : public SubchannelInterface {
public:
SubchannelWrapper(ChannelData* chand, Subchannel* subchannel,
- grpc_core::UniquePtr<char> health_check_service_name,
- ServerAddressAttributeMap attributes)
+ grpc_core::UniquePtr<char> health_check_service_name,
+ ServerAddressAttributeMap attributes)
: SubchannelInterface(&grpc_client_channel_routing_trace),
chand_(chand),
subchannel_(subchannel),
- health_check_service_name_(std::move(health_check_service_name)),
- attributes_(std::move(attributes)) {
+ health_check_service_name_(std::move(health_check_service_name)),
+ attributes_(std::move(attributes)) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
gpr_log(GPR_INFO,
"chand=%p: creating subchannel wrapper %p for subchannel %p",
@@ -963,7 +963,7 @@ class ChannelData::SubchannelWrapper : public SubchannelInterface {
initial_state,
grpc_core::UniquePtr<char>(
gpr_strdup(health_check_service_name_.get())),
- RefCountedPtr<Subchannel::ConnectivityStateWatcherInterface>(
+ RefCountedPtr<Subchannel::ConnectivityStateWatcherInterface>(
watcher_wrapper));
}
@@ -984,17 +984,17 @@ class ChannelData::SubchannelWrapper : public SubchannelInterface {
return subchannel_->channel_args();
}
- const ServerAddress::AttributeInterface* GetAttribute(
- const char* key) const override {
- auto it = attributes_.find(key);
- if (it == attributes_.end()) return nullptr;
- return it->second.get();
- }
-
- void ThrottleKeepaliveTime(int new_keepalive_time) {
- subchannel_->ThrottleKeepaliveTime(new_keepalive_time);
- }
-
+ const ServerAddress::AttributeInterface* GetAttribute(
+ const char* key) const override {
+ auto it = attributes_.find(key);
+ if (it == attributes_.end()) return nullptr;
+ return it->second.get();
+ }
+
+ void ThrottleKeepaliveTime(int new_keepalive_time) {
+ subchannel_->ThrottleKeepaliveTime(new_keepalive_time);
+ }
+
void UpdateHealthCheckServiceName(
grpc_core::UniquePtr<char> health_check_service_name) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
@@ -1024,14 +1024,14 @@ class ChannelData::SubchannelWrapper : public SubchannelInterface {
replacement->last_seen_state(),
grpc_core::UniquePtr<char>(
gpr_strdup(health_check_service_name.get())),
- RefCountedPtr<Subchannel::ConnectivityStateWatcherInterface>(
+ RefCountedPtr<Subchannel::ConnectivityStateWatcherInterface>(
replacement));
}
// Save the new health check service name.
health_check_service_name_ = std::move(health_check_service_name);
}
- // Caller must be holding the control-plane work_serializer.
+ // Caller must be holding the control-plane work_serializer.
ConnectedSubchannel* connected_subchannel() const {
return connected_subchannel_.get();
}
@@ -1071,27 +1071,27 @@ class ChannelData::SubchannelWrapper : public SubchannelInterface {
parent_(std::move(parent)),
last_seen_state_(initial_state) {}
- ~WatcherWrapper() {
- auto* parent = parent_.release(); // ref owned by lambda
- parent->chand_->work_serializer_->Run(
- [parent]() { parent->Unref(DEBUG_LOCATION, "WatcherWrapper"); },
- DEBUG_LOCATION);
- }
+ ~WatcherWrapper() {
+ auto* parent = parent_.release(); // ref owned by lambda
+ parent->chand_->work_serializer_->Run(
+ [parent]() { parent->Unref(DEBUG_LOCATION, "WatcherWrapper"); },
+ DEBUG_LOCATION);
+ }
- void OnConnectivityStateChange() override {
+ void OnConnectivityStateChange() override {
if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
gpr_log(GPR_INFO,
"chand=%p: connectivity change for subchannel wrapper %p "
- "subchannel %p; hopping into work_serializer",
- parent_->chand_, parent_.get(), parent_->subchannel_);
+ "subchannel %p; hopping into work_serializer",
+ parent_->chand_, parent_.get(), parent_->subchannel_);
}
- Ref().release(); // ref owned by lambda
- parent_->chand_->work_serializer_->Run(
- [this]() {
- ApplyUpdateInControlPlaneWorkSerializer();
- Unref();
- },
- DEBUG_LOCATION);
+ Ref().release(); // ref owned by lambda
+ parent_->chand_->work_serializer_->Run(
+ [this]() {
+ ApplyUpdateInControlPlaneWorkSerializer();
+ Unref();
+ },
+ DEBUG_LOCATION);
}
grpc_pollset_set* interested_parties() override {
@@ -1111,51 +1111,51 @@ class ChannelData::SubchannelWrapper : public SubchannelInterface {
grpc_connectivity_state last_seen_state() const { return last_seen_state_; }
private:
- void ApplyUpdateInControlPlaneWorkSerializer() {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
- gpr_log(GPR_INFO,
- "chand=%p: processing connectivity change in work serializer "
- "for subchannel wrapper %p subchannel %p "
- "watcher=%p",
- parent_->chand_, parent_.get(), parent_->subchannel_,
- watcher_.get());
+ void ApplyUpdateInControlPlaneWorkSerializer() {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
+ gpr_log(GPR_INFO,
+ "chand=%p: processing connectivity change in work serializer "
+ "for subchannel wrapper %p subchannel %p "
+ "watcher=%p",
+ parent_->chand_, parent_.get(), parent_->subchannel_,
+ watcher_.get());
}
- ConnectivityStateChange state_change = PopConnectivityStateChange();
- y_absl::optional<y_absl::Cord> keepalive_throttling =
- state_change.status.GetPayload(grpc_core::kKeepaliveThrottlingKey);
- if (keepalive_throttling.has_value()) {
- int new_keepalive_time = -1;
- if (y_absl::SimpleAtoi(TString(keepalive_throttling.value()),
- &new_keepalive_time)) {
- if (new_keepalive_time > parent_->chand_->keepalive_time_) {
- parent_->chand_->keepalive_time_ = new_keepalive_time;
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
- gpr_log(GPR_INFO, "chand=%p: throttling keepalive time to %d",
- parent_->chand_, parent_->chand_->keepalive_time_);
- }
- // Propagate the new keepalive time to all subchannels. This is so
- // that new transports created by any subchannel (and not just the
- // subchannel that received the GOAWAY), use the new keepalive time.
- for (auto* subchannel_wrapper :
- parent_->chand_->subchannel_wrappers_) {
- subchannel_wrapper->ThrottleKeepaliveTime(new_keepalive_time);
- }
- }
- } else {
- gpr_log(GPR_ERROR, "chand=%p: Illegal keepalive throttling value %s",
- parent_->chand_,
- TString(keepalive_throttling.value()).c_str());
- }
- }
- // Ignore update if the parent WatcherWrapper has been replaced
- // since this callback was scheduled.
- if (watcher_ != nullptr) {
- last_seen_state_ = state_change.state;
- parent_->MaybeUpdateConnectedSubchannel(
- std::move(state_change.connected_subchannel));
- watcher_->OnConnectivityStateChange(state_change.state);
+ ConnectivityStateChange state_change = PopConnectivityStateChange();
+ y_absl::optional<y_absl::Cord> keepalive_throttling =
+ state_change.status.GetPayload(grpc_core::kKeepaliveThrottlingKey);
+ if (keepalive_throttling.has_value()) {
+ int new_keepalive_time = -1;
+ if (y_absl::SimpleAtoi(TString(keepalive_throttling.value()),
+ &new_keepalive_time)) {
+ if (new_keepalive_time > parent_->chand_->keepalive_time_) {
+ parent_->chand_->keepalive_time_ = new_keepalive_time;
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
+ gpr_log(GPR_INFO, "chand=%p: throttling keepalive time to %d",
+ parent_->chand_, parent_->chand_->keepalive_time_);
+ }
+ // Propagate the new keepalive time to all subchannels. This is so
+ // that new transports created by any subchannel (and not just the
+ // subchannel that received the GOAWAY), use the new keepalive time.
+ for (auto* subchannel_wrapper :
+ parent_->chand_->subchannel_wrappers_) {
+ subchannel_wrapper->ThrottleKeepaliveTime(new_keepalive_time);
+ }
+ }
+ } else {
+ gpr_log(GPR_ERROR, "chand=%p: Illegal keepalive throttling value %s",
+ parent_->chand_,
+ TString(keepalive_throttling.value()).c_str());
+ }
+ }
+ // Ignore update if the parent WatcherWrapper has been replaced
+ // since this callback was scheduled.
+ if (watcher_ != nullptr) {
+ last_seen_state_ = state_change.state;
+ parent_->MaybeUpdateConnectedSubchannel(
+ std::move(state_change.connected_subchannel));
+ watcher_->OnConnectivityStateChange(state_change.state);
}
- }
+ }
std::unique_ptr<SubchannelInterface::ConnectivityStateWatcherInterface>
watcher_;
@@ -1188,14 +1188,14 @@ class ChannelData::SubchannelWrapper : public SubchannelInterface {
ChannelData* chand_;
Subchannel* subchannel_;
grpc_core::UniquePtr<char> health_check_service_name_;
- ServerAddressAttributeMap attributes_;
+ ServerAddressAttributeMap attributes_;
// Maps from the address of the watcher passed to us by the LB policy
// to the address of the WrapperWatcher that we passed to the underlying
// subchannel. This is needed so that when the LB policy calls
// CancelConnectivityStateWatch() with its watcher, we know the
// corresponding WrapperWatcher to cancel on the underlying subchannel.
std::map<ConnectivityStateWatcherInterface*, WatcherWrapper*> watcher_map_;
- // To be accessed only in the control plane work_serializer.
+ // To be accessed only in the control plane work_serializer.
RefCountedPtr<ConnectedSubchannel> connected_subchannel_;
// To be accessed only in the data plane mutex.
RefCountedPtr<ConnectedSubchannel> connected_subchannel_in_data_plane_;
@@ -1218,21 +1218,21 @@ ChannelData::ExternalConnectivityWatcher::ExternalConnectivityWatcher(
grpc_polling_entity_add_to_pollset_set(&pollent_,
chand_->interested_parties_);
GRPC_CHANNEL_STACK_REF(chand_->owning_stack_, "ExternalConnectivityWatcher");
- {
- MutexLock lock(&chand_->external_watchers_mu_);
- // Will be deleted when the watch is complete.
- GPR_ASSERT(chand->external_watchers_[on_complete] == nullptr);
- // Store a ref to the watcher in the external_watchers_ map.
- chand->external_watchers_[on_complete] =
- Ref(DEBUG_LOCATION, "AddWatcherToExternalWatchersMapLocked");
- }
- // Pass the ref from creating the object to Start().
- chand_->work_serializer_->Run(
- [this]() {
- // The ref is passed to AddWatcherLocked().
- AddWatcherLocked();
- },
- DEBUG_LOCATION);
+ {
+ MutexLock lock(&chand_->external_watchers_mu_);
+ // Will be deleted when the watch is complete.
+ GPR_ASSERT(chand->external_watchers_[on_complete] == nullptr);
+ // Store a ref to the watcher in the external_watchers_ map.
+ chand->external_watchers_[on_complete] =
+ Ref(DEBUG_LOCATION, "AddWatcherToExternalWatchersMapLocked");
+ }
+ // Pass the ref from creating the object to Start().
+ chand_->work_serializer_->Run(
+ [this]() {
+ // The ref is passed to AddWatcherLocked().
+ AddWatcherLocked();
+ },
+ DEBUG_LOCATION);
}
ChannelData::ExternalConnectivityWatcher::~ExternalConnectivityWatcher() {
@@ -1242,26 +1242,26 @@ ChannelData::ExternalConnectivityWatcher::~ExternalConnectivityWatcher() {
"ExternalConnectivityWatcher");
}
-void ChannelData::ExternalConnectivityWatcher::
- RemoveWatcherFromExternalWatchersMap(ChannelData* chand,
- grpc_closure* on_complete,
- bool cancel) {
- RefCountedPtr<ExternalConnectivityWatcher> watcher;
- {
- MutexLock lock(&chand->external_watchers_mu_);
- auto it = chand->external_watchers_.find(on_complete);
- if (it != chand->external_watchers_.end()) {
- watcher = std::move(it->second);
- chand->external_watchers_.erase(it);
- }
- }
- // watcher->Cancel() will hop into the WorkSerializer, so we have to unlock
- // the mutex before calling it.
- if (watcher != nullptr && cancel) watcher->Cancel();
-}
-
+void ChannelData::ExternalConnectivityWatcher::
+ RemoveWatcherFromExternalWatchersMap(ChannelData* chand,
+ grpc_closure* on_complete,
+ bool cancel) {
+ RefCountedPtr<ExternalConnectivityWatcher> watcher;
+ {
+ MutexLock lock(&chand->external_watchers_mu_);
+ auto it = chand->external_watchers_.find(on_complete);
+ if (it != chand->external_watchers_.end()) {
+ watcher = std::move(it->second);
+ chand->external_watchers_.erase(it);
+ }
+ }
+ // watcher->Cancel() will hop into the WorkSerializer, so we have to unlock
+ // the mutex before calling it.
+ if (watcher != nullptr && cancel) watcher->Cancel();
+}
+
void ChannelData::ExternalConnectivityWatcher::Notify(
- grpc_connectivity_state state, const y_absl::Status& /* status */) {
+ grpc_connectivity_state state, const y_absl::Status& /* status */) {
bool done = false;
if (!done_.CompareExchangeStrong(&done, true, MemoryOrder::RELAXED,
MemoryOrder::RELAXED)) {
@@ -1272,12 +1272,12 @@ void ChannelData::ExternalConnectivityWatcher::Notify(
// Report new state to the user.
*state_ = state;
ExecCtx::Run(DEBUG_LOCATION, on_complete_, GRPC_ERROR_NONE);
- // Hop back into the work_serializer to clean up.
+ // Hop back into the work_serializer to clean up.
// Not needed in state SHUTDOWN, because the tracker will
// automatically remove all watchers in that case.
if (state != GRPC_CHANNEL_SHUTDOWN) {
- chand_->work_serializer_->Run([this]() { RemoveWatcherLocked(); },
- DEBUG_LOCATION);
+ chand_->work_serializer_->Run([this]() { RemoveWatcherLocked(); },
+ DEBUG_LOCATION);
}
}
@@ -1288,20 +1288,20 @@ void ChannelData::ExternalConnectivityWatcher::Cancel() {
return; // Already done.
}
ExecCtx::Run(DEBUG_LOCATION, on_complete_, GRPC_ERROR_CANCELLED);
- // Hop back into the work_serializer to clean up.
- chand_->work_serializer_->Run([this]() { RemoveWatcherLocked(); },
- DEBUG_LOCATION);
+ // Hop back into the work_serializer to clean up.
+ chand_->work_serializer_->Run([this]() { RemoveWatcherLocked(); },
+ DEBUG_LOCATION);
}
-void ChannelData::ExternalConnectivityWatcher::AddWatcherLocked() {
- Closure::Run(DEBUG_LOCATION, watcher_timer_init_, GRPC_ERROR_NONE);
- // Add new watcher. Pass the ref of the object from creation to OrphanablePtr.
- chand_->state_tracker_.AddWatcher(
- initial_state_, OrphanablePtr<ConnectivityStateWatcherInterface>(this));
+void ChannelData::ExternalConnectivityWatcher::AddWatcherLocked() {
+ Closure::Run(DEBUG_LOCATION, watcher_timer_init_, GRPC_ERROR_NONE);
+ // Add new watcher. Pass the ref of the object from creation to OrphanablePtr.
+ chand_->state_tracker_.AddWatcher(
+ initial_state_, OrphanablePtr<ConnectivityStateWatcherInterface>(this));
}
-void ChannelData::ExternalConnectivityWatcher::RemoveWatcherLocked() {
- chand_->state_tracker_.RemoveWatcher(this);
+void ChannelData::ExternalConnectivityWatcher::RemoveWatcherLocked() {
+ chand_->state_tracker_.RemoveWatcher(this);
}
//
@@ -1317,15 +1317,15 @@ class ChannelData::ConnectivityWatcherAdder {
initial_state_(initial_state),
watcher_(std::move(watcher)) {
GRPC_CHANNEL_STACK_REF(chand_->owning_stack_, "ConnectivityWatcherAdder");
- chand_->work_serializer_->Run([this]() { AddWatcherLocked(); },
- DEBUG_LOCATION);
+ chand_->work_serializer_->Run([this]() { AddWatcherLocked(); },
+ DEBUG_LOCATION);
}
private:
- void AddWatcherLocked() {
- chand_->state_tracker_.AddWatcher(initial_state_, std::move(watcher_));
- GRPC_CHANNEL_STACK_UNREF(chand_->owning_stack_, "ConnectivityWatcherAdder");
- delete this;
+ void AddWatcherLocked() {
+ chand_->state_tracker_.AddWatcher(initial_state_, std::move(watcher_));
+ GRPC_CHANNEL_STACK_UNREF(chand_->owning_stack_, "ConnectivityWatcherAdder");
+ delete this;
}
ChannelData* chand_;
@@ -1343,16 +1343,16 @@ class ChannelData::ConnectivityWatcherRemover {
AsyncConnectivityStateWatcherInterface* watcher)
: chand_(chand), watcher_(watcher) {
GRPC_CHANNEL_STACK_REF(chand_->owning_stack_, "ConnectivityWatcherRemover");
- chand_->work_serializer_->Run([this]() { RemoveWatcherLocked(); },
- DEBUG_LOCATION);
+ chand_->work_serializer_->Run([this]() { RemoveWatcherLocked(); },
+ DEBUG_LOCATION);
}
private:
- void RemoveWatcherLocked() {
- chand_->state_tracker_.RemoveWatcher(watcher_);
- GRPC_CHANNEL_STACK_UNREF(chand_->owning_stack_,
+ void RemoveWatcherLocked() {
+ chand_->state_tracker_.RemoveWatcher(watcher_);
+ GRPC_CHANNEL_STACK_UNREF(chand_->owning_stack_,
"ConnectivityWatcherRemover");
- delete this;
+ delete this;
}
ChannelData* chand_;
@@ -1363,18 +1363,18 @@ class ChannelData::ConnectivityWatcherRemover {
// ChannelData::ClientChannelControlHelper
//
-} // namespace
-
-// Allows accessing the attributes from a ServerAddress.
-class ChannelServerAddressPeer {
- public:
- static ServerAddressAttributeMap GetAttributes(ServerAddress* address) {
- return std::move(address->attributes_);
- }
-};
-
-namespace {
-
+} // namespace
+
+// Allows accessing the attributes from a ServerAddress.
+class ChannelServerAddressPeer {
+ public:
+ static ServerAddressAttributeMap GetAttributes(ServerAddress* address) {
+ return std::move(address->attributes_);
+ }
+};
+
+namespace {
+
class ChannelData::ClientChannelControlHelper
: public LoadBalancingPolicy::ChannelControlHelper {
public:
@@ -1388,8 +1388,8 @@ class ChannelData::ClientChannelControlHelper
}
RefCountedPtr<SubchannelInterface> CreateSubchannel(
- ServerAddress address, const grpc_channel_args& args) override {
- // Determine health check service name.
+ ServerAddress address, const grpc_channel_args& args) override {
+ // Determine health check service name.
bool inhibit_health_checking = grpc_channel_arg_get_bool(
grpc_channel_args_find(&args, GRPC_ARG_INHIBIT_HEALTH_CHECKING), false);
grpc_core::UniquePtr<char> health_check_service_name;
@@ -1397,63 +1397,63 @@ class ChannelData::ClientChannelControlHelper
health_check_service_name.reset(
gpr_strdup(chand_->health_check_service_name_.get()));
}
- // Remove channel args that should not affect subchannel uniqueness.
+ // Remove channel args that should not affect subchannel uniqueness.
static const char* args_to_remove[] = {
GRPC_ARG_INHIBIT_HEALTH_CHECKING,
GRPC_ARG_CHANNELZ_CHANNEL_NODE,
};
- // Add channel args needed for the subchannel.
- y_absl::InlinedVector<grpc_arg, 3> args_to_add = {
- Subchannel::CreateSubchannelAddressArg(&address.address()),
- SubchannelPoolInterface::CreateChannelArg(
- chand_->subchannel_pool_.get()),
- };
- if (address.args() != nullptr) {
- for (size_t j = 0; j < address.args()->num_args; ++j) {
- args_to_add.emplace_back(address.args()->args[j]);
- }
- }
+ // Add channel args needed for the subchannel.
+ y_absl::InlinedVector<grpc_arg, 3> args_to_add = {
+ Subchannel::CreateSubchannelAddressArg(&address.address()),
+ SubchannelPoolInterface::CreateChannelArg(
+ chand_->subchannel_pool_.get()),
+ };
+ if (address.args() != nullptr) {
+ for (size_t j = 0; j < address.args()->num_args; ++j) {
+ args_to_add.emplace_back(address.args()->args[j]);
+ }
+ }
grpc_channel_args* new_args = grpc_channel_args_copy_and_add_and_remove(
- &args, args_to_remove, GPR_ARRAY_SIZE(args_to_remove),
- args_to_add.data(), args_to_add.size());
- gpr_free(args_to_add[0].value.string);
- // Create subchannel.
+ &args, args_to_remove, GPR_ARRAY_SIZE(args_to_remove),
+ args_to_add.data(), args_to_add.size());
+ gpr_free(args_to_add[0].value.string);
+ // Create subchannel.
Subchannel* subchannel =
chand_->client_channel_factory_->CreateSubchannel(new_args);
grpc_channel_args_destroy(new_args);
if (subchannel == nullptr) return nullptr;
- // Make sure the subchannel has updated keepalive time.
- subchannel->ThrottleKeepaliveTime(chand_->keepalive_time_);
- // Create and return wrapper for the subchannel.
+ // Make sure the subchannel has updated keepalive time.
+ subchannel->ThrottleKeepaliveTime(chand_->keepalive_time_);
+ // Create and return wrapper for the subchannel.
return MakeRefCounted<SubchannelWrapper>(
- chand_, subchannel, std::move(health_check_service_name),
- ChannelServerAddressPeer::GetAttributes(&address));
+ chand_, subchannel, std::move(health_check_service_name),
+ ChannelServerAddressPeer::GetAttributes(&address));
}
void UpdateState(
- grpc_connectivity_state state, const y_absl::Status& status,
+ grpc_connectivity_state state, const y_absl::Status& status,
std::unique_ptr<LoadBalancingPolicy::SubchannelPicker> picker) override {
grpc_error* disconnect_error = chand_->disconnect_error();
if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
const char* extra = disconnect_error == GRPC_ERROR_NONE
? ""
: " (ignoring -- channel shutting down)";
- gpr_log(GPR_INFO, "chand=%p: update: state=%s status=(%s) picker=%p%s",
- chand_, ConnectivityStateName(state), status.ToString().c_str(),
- picker.get(), extra);
+ gpr_log(GPR_INFO, "chand=%p: update: state=%s status=(%s) picker=%p%s",
+ chand_, ConnectivityStateName(state), status.ToString().c_str(),
+ picker.get(), extra);
}
// Do update only if not shutting down.
if (disconnect_error == GRPC_ERROR_NONE) {
- chand_->UpdateStateAndPickerLocked(state, status, "helper",
- std::move(picker));
+ chand_->UpdateStateAndPickerLocked(state, status, "helper",
+ std::move(picker));
}
}
// No-op -- we should never get this from ResolvingLoadBalancingPolicy.
void RequestReresolution() override {}
- void AddTraceEvent(TraceSeverity severity,
- y_absl::string_view message) override {
+ void AddTraceEvent(TraceSeverity severity,
+ y_absl::string_view message) override {
if (chand_->channelz_node_ != nullptr) {
chand_->channelz_node_->AddTraceEvent(
ConvertSeverityEnum(severity),
@@ -1473,139 +1473,139 @@ class ChannelData::ClientChannelControlHelper
};
//
-// ChannelData::ChannelConfigHelper
-//
-
-ChannelData::ChannelConfigHelper::ChooseServiceConfigResult
-ChannelData::ChannelConfigHelper::ChooseServiceConfig(
- const Resolver::Result& result) {
- ChooseServiceConfigResult service_config_result;
- RefCountedPtr<ServiceConfig> service_config;
- RefCountedPtr<ConfigSelector> config_selector;
- if (result.service_config_error != GRPC_ERROR_NONE) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
- gpr_log(GPR_INFO, "chand=%p: resolver returned service config error: %s",
- chand_, grpc_error_string(result.service_config_error));
- }
- // If the service config was invalid, then fallback to the
- // previously returned service config.
- if (chand_->saved_service_config_ != nullptr) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
- gpr_log(GPR_INFO,
- "chand=%p: resolver returned invalid service config. "
- "Continuing to use previous service config.",
- chand_);
- }
- service_config = chand_->saved_service_config_;
- config_selector = chand_->saved_config_selector_;
- } else {
- // No previously returned config, so put the channel into
- // TRANSIENT_FAILURE.
- service_config_result.no_valid_service_config = true;
- return service_config_result;
- }
- } else if (result.service_config == nullptr) {
- // Resolver did not return any service config.
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
- gpr_log(GPR_INFO,
- "chand=%p: resolver returned no service config. Using default "
- "service config for channel.",
- chand_);
- }
- service_config = chand_->default_service_config_;
- } else {
- // Use ServiceConfig and ConfigSelector returned by resolver.
- service_config = result.service_config;
- config_selector = ConfigSelector::GetFromChannelArgs(*result.args);
- }
- GPR_ASSERT(service_config != nullptr);
- // Extract global config for client channel.
- const internal::ClientChannelGlobalParsedConfig* parsed_service_config =
- static_cast<const internal::ClientChannelGlobalParsedConfig*>(
- service_config->GetGlobalParsedConfig(
- internal::ClientChannelServiceConfigParser::ParserIndex()));
- // Find LB policy config.
- ChooseLbPolicy(result, parsed_service_config,
- &service_config_result.lb_policy_config);
- // Check if the ServiceConfig has changed.
- const bool service_config_changed =
- chand_->saved_service_config_ == nullptr ||
- service_config->json_string() !=
- chand_->saved_service_config_->json_string();
- // Check if the ConfigSelector has changed.
- const bool config_selector_changed = !ConfigSelector::Equals(
- chand_->saved_config_selector_.get(), config_selector.get());
- // Indicate a change if either the ServiceConfig or ConfigSelector have
- // changed.
- service_config_result.service_config_changed =
- service_config_changed || config_selector_changed;
- // If it has, apply the global parameters now.
- if (service_config_result.service_config_changed) {
- chand_->UpdateServiceConfigInControlPlaneLocked(
- std::move(service_config), std::move(config_selector),
- parsed_service_config, service_config_result.lb_policy_config->name());
- }
- // Return results.
- return service_config_result;
-}
-
-void ChannelData::ChannelConfigHelper::StartUsingServiceConfigForCalls() {
- chand_->UpdateServiceConfigInDataPlaneLocked();
-}
-
-void ChannelData::ChannelConfigHelper::ResolverTransientFailure(
- grpc_error* error) {
- MutexLock lock(&chand_->data_plane_mu_);
- GRPC_ERROR_UNREF(chand_->resolver_transient_failure_error_);
- chand_->resolver_transient_failure_error_ = error;
-}
-
-void ChannelData::ChannelConfigHelper::ChooseLbPolicy(
- const Resolver::Result& resolver_result,
- const internal::ClientChannelGlobalParsedConfig* parsed_service_config,
- RefCountedPtr<LoadBalancingPolicy::Config>* lb_policy_config) {
- // Prefer the LB policy config found in the service config.
- if (parsed_service_config->parsed_lb_config() != nullptr) {
- *lb_policy_config = parsed_service_config->parsed_lb_config();
- return;
- }
- // Try the deprecated LB policy name from the service config.
- // If not, try the setting from channel args.
- const char* policy_name = nullptr;
- if (!parsed_service_config->parsed_deprecated_lb_policy().empty()) {
- policy_name = parsed_service_config->parsed_deprecated_lb_policy().c_str();
- } else {
- const grpc_arg* channel_arg =
- grpc_channel_args_find(resolver_result.args, GRPC_ARG_LB_POLICY_NAME);
- policy_name = grpc_channel_arg_get_string(channel_arg);
- }
- // Use pick_first if nothing was specified and we didn't select grpclb
- // above.
- if (policy_name == nullptr) policy_name = "pick_first";
- // Now that we have the policy name, construct an empty config for it.
- Json config_json = Json::Array{Json::Object{
- {policy_name, Json::Object{}},
- }};
- grpc_error* parse_error = GRPC_ERROR_NONE;
- *lb_policy_config = LoadBalancingPolicyRegistry::ParseLoadBalancingConfig(
- config_json, &parse_error);
- // The policy name came from one of three places:
- // - The deprecated loadBalancingPolicy field in the service config,
- // in which case the code in ClientChannelServiceConfigParser
- // already verified that the policy does not require a config.
- // - One of the hard-coded values here, all of which are known to not
- // require a config.
- // - A channel arg, in which case the application did something that
- // is a misuse of our API.
- // In the first two cases, these assertions will always be true. In
- // the last case, this is probably fine for now.
- // TODO(roth): If the last case becomes a problem, add better error
- // handling here.
- GPR_ASSERT(*lb_policy_config != nullptr);
- GPR_ASSERT(parse_error == GRPC_ERROR_NONE);
-}
-
-//
+// ChannelData::ChannelConfigHelper
+//
+
+ChannelData::ChannelConfigHelper::ChooseServiceConfigResult
+ChannelData::ChannelConfigHelper::ChooseServiceConfig(
+ const Resolver::Result& result) {
+ ChooseServiceConfigResult service_config_result;
+ RefCountedPtr<ServiceConfig> service_config;
+ RefCountedPtr<ConfigSelector> config_selector;
+ if (result.service_config_error != GRPC_ERROR_NONE) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
+ gpr_log(GPR_INFO, "chand=%p: resolver returned service config error: %s",
+ chand_, grpc_error_string(result.service_config_error));
+ }
+ // If the service config was invalid, then fallback to the
+ // previously returned service config.
+ if (chand_->saved_service_config_ != nullptr) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
+ gpr_log(GPR_INFO,
+ "chand=%p: resolver returned invalid service config. "
+ "Continuing to use previous service config.",
+ chand_);
+ }
+ service_config = chand_->saved_service_config_;
+ config_selector = chand_->saved_config_selector_;
+ } else {
+ // No previously returned config, so put the channel into
+ // TRANSIENT_FAILURE.
+ service_config_result.no_valid_service_config = true;
+ return service_config_result;
+ }
+ } else if (result.service_config == nullptr) {
+ // Resolver did not return any service config.
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
+ gpr_log(GPR_INFO,
+ "chand=%p: resolver returned no service config. Using default "
+ "service config for channel.",
+ chand_);
+ }
+ service_config = chand_->default_service_config_;
+ } else {
+ // Use ServiceConfig and ConfigSelector returned by resolver.
+ service_config = result.service_config;
+ config_selector = ConfigSelector::GetFromChannelArgs(*result.args);
+ }
+ GPR_ASSERT(service_config != nullptr);
+ // Extract global config for client channel.
+ const internal::ClientChannelGlobalParsedConfig* parsed_service_config =
+ static_cast<const internal::ClientChannelGlobalParsedConfig*>(
+ service_config->GetGlobalParsedConfig(
+ internal::ClientChannelServiceConfigParser::ParserIndex()));
+ // Find LB policy config.
+ ChooseLbPolicy(result, parsed_service_config,
+ &service_config_result.lb_policy_config);
+ // Check if the ServiceConfig has changed.
+ const bool service_config_changed =
+ chand_->saved_service_config_ == nullptr ||
+ service_config->json_string() !=
+ chand_->saved_service_config_->json_string();
+ // Check if the ConfigSelector has changed.
+ const bool config_selector_changed = !ConfigSelector::Equals(
+ chand_->saved_config_selector_.get(), config_selector.get());
+ // Indicate a change if either the ServiceConfig or ConfigSelector have
+ // changed.
+ service_config_result.service_config_changed =
+ service_config_changed || config_selector_changed;
+ // If it has, apply the global parameters now.
+ if (service_config_result.service_config_changed) {
+ chand_->UpdateServiceConfigInControlPlaneLocked(
+ std::move(service_config), std::move(config_selector),
+ parsed_service_config, service_config_result.lb_policy_config->name());
+ }
+ // Return results.
+ return service_config_result;
+}
+
+void ChannelData::ChannelConfigHelper::StartUsingServiceConfigForCalls() {
+ chand_->UpdateServiceConfigInDataPlaneLocked();
+}
+
+void ChannelData::ChannelConfigHelper::ResolverTransientFailure(
+ grpc_error* error) {
+ MutexLock lock(&chand_->data_plane_mu_);
+ GRPC_ERROR_UNREF(chand_->resolver_transient_failure_error_);
+ chand_->resolver_transient_failure_error_ = error;
+}
+
+void ChannelData::ChannelConfigHelper::ChooseLbPolicy(
+ const Resolver::Result& resolver_result,
+ const internal::ClientChannelGlobalParsedConfig* parsed_service_config,
+ RefCountedPtr<LoadBalancingPolicy::Config>* lb_policy_config) {
+ // Prefer the LB policy config found in the service config.
+ if (parsed_service_config->parsed_lb_config() != nullptr) {
+ *lb_policy_config = parsed_service_config->parsed_lb_config();
+ return;
+ }
+ // Try the deprecated LB policy name from the service config.
+ // If not, try the setting from channel args.
+ const char* policy_name = nullptr;
+ if (!parsed_service_config->parsed_deprecated_lb_policy().empty()) {
+ policy_name = parsed_service_config->parsed_deprecated_lb_policy().c_str();
+ } else {
+ const grpc_arg* channel_arg =
+ grpc_channel_args_find(resolver_result.args, GRPC_ARG_LB_POLICY_NAME);
+ policy_name = grpc_channel_arg_get_string(channel_arg);
+ }
+ // Use pick_first if nothing was specified and we didn't select grpclb
+ // above.
+ if (policy_name == nullptr) policy_name = "pick_first";
+ // Now that we have the policy name, construct an empty config for it.
+ Json config_json = Json::Array{Json::Object{
+ {policy_name, Json::Object{}},
+ }};
+ grpc_error* parse_error = GRPC_ERROR_NONE;
+ *lb_policy_config = LoadBalancingPolicyRegistry::ParseLoadBalancingConfig(
+ config_json, &parse_error);
+ // The policy name came from one of three places:
+ // - The deprecated loadBalancingPolicy field in the service config,
+ // in which case the code in ClientChannelServiceConfigParser
+ // already verified that the policy does not require a config.
+ // - One of the hard-coded values here, all of which are known to not
+ // require a config.
+ // - A channel arg, in which case the application did something that
+ // is a misuse of our API.
+ // In the first two cases, these assertions will always be true. In
+ // the last case, this is probably fine for now.
+ // TODO(roth): If the last case becomes a problem, add better error
+ // handling here.
+ GPR_ASSERT(*lb_policy_config != nullptr);
+ GPR_ASSERT(parse_error == GRPC_ERROR_NONE);
+}
+
+//
// ChannelData implementation
//
@@ -1663,8 +1663,8 @@ ChannelData::ChannelData(grpc_channel_element_args* args, grpc_error** error)
client_channel_factory_(
ClientChannelFactory::GetFromChannelArgs(args->channel_args)),
channelz_node_(GetChannelzNode(args->channel_args)),
- channel_config_helper_(this),
- work_serializer_(std::make_shared<WorkSerializer>()),
+ channel_config_helper_(this),
+ work_serializer_(std::make_shared<WorkSerializer>()),
interested_parties_(grpc_pollset_set_create()),
subchannel_pool_(GetSubchannelPool(args->channel_args)),
state_tracker_("client_channel", GRPC_CHANNEL_IDLE),
@@ -1692,17 +1692,17 @@ ChannelData::ChannelData(grpc_channel_element_args* args, grpc_error** error)
"filter");
return;
}
- // Get default service config. If none is specified via the client API,
- // we use an empty config.
+ // Get default service config. If none is specified via the client API,
+ // we use an empty config.
const char* service_config_json = grpc_channel_arg_get_string(
grpc_channel_args_find(args->channel_args, GRPC_ARG_SERVICE_CONFIG));
- if (service_config_json == nullptr) service_config_json = "{}";
- *error = GRPC_ERROR_NONE;
- default_service_config_ =
- ServiceConfig::Create(args->channel_args, service_config_json, error);
- if (*error != GRPC_ERROR_NONE) {
- default_service_config_.reset();
- return;
+ if (service_config_json == nullptr) service_config_json = "{}";
+ *error = GRPC_ERROR_NONE;
+ default_service_config_ =
+ ServiceConfig::Create(args->channel_args, service_config_json, error);
+ if (*error != GRPC_ERROR_NONE) {
+ default_service_config_.reset();
+ return;
}
grpc_uri* uri = grpc_uri_parse(server_uri, true);
if (uri != nullptr && uri->path[0] != '\0') {
@@ -1716,19 +1716,19 @@ ChannelData::ChannelData(grpc_channel_element_args* args, grpc_error** error)
&new_args);
target_uri_.reset(proxy_name != nullptr ? proxy_name
: gpr_strdup(server_uri));
- // Strip out service config channel arg, so that it doesn't affect
- // subchannel uniqueness when the args flow down to that layer.
- const char* arg_to_remove = GRPC_ARG_SERVICE_CONFIG;
- channel_args_ = grpc_channel_args_copy_and_remove(
- new_args != nullptr ? new_args : args->channel_args, &arg_to_remove, 1);
- grpc_channel_args_destroy(new_args);
- keepalive_time_ = grpc_channel_args_find_integer(
- channel_args_, GRPC_ARG_KEEPALIVE_TIME_MS,
- {-1 /* default value, unset */, 1, INT_MAX});
+ // Strip out service config channel arg, so that it doesn't affect
+ // subchannel uniqueness when the args flow down to that layer.
+ const char* arg_to_remove = GRPC_ARG_SERVICE_CONFIG;
+ channel_args_ = grpc_channel_args_copy_and_remove(
+ new_args != nullptr ? new_args : args->channel_args, &arg_to_remove, 1);
+ grpc_channel_args_destroy(new_args);
+ keepalive_time_ = grpc_channel_args_find_integer(
+ channel_args_, GRPC_ARG_KEEPALIVE_TIME_MS,
+ {-1 /* default value, unset */, 1, INT_MAX});
if (!ResolverRegistry::IsValidTarget(target_uri_.get())) {
- TString error_message =
- y_absl::StrCat("the target uri is not valid: ", target_uri_.get());
- *error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(error_message.c_str());
+ TString error_message =
+ y_absl::StrCat("the target uri is not valid: ", target_uri_.get());
+ *error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(error_message.c_str());
return;
}
*error = GRPC_ERROR_NONE;
@@ -1740,7 +1740,7 @@ ChannelData::~ChannelData() {
}
DestroyResolvingLoadBalancingPolicyLocked();
grpc_channel_args_destroy(channel_args_);
- GRPC_ERROR_UNREF(resolver_transient_failure_error_);
+ GRPC_ERROR_UNREF(resolver_transient_failure_error_);
// Stop backup polling.
grpc_client_channel_stop_backup_polling(interested_parties_);
grpc_pollset_set_destroy(interested_parties_);
@@ -1749,17 +1749,17 @@ ChannelData::~ChannelData() {
}
void ChannelData::UpdateStateAndPickerLocked(
- grpc_connectivity_state state, const y_absl::Status& status,
- const char* reason,
+ grpc_connectivity_state state, const y_absl::Status& status,
+ const char* reason,
std::unique_ptr<LoadBalancingPolicy::SubchannelPicker> picker) {
// Clean the control plane when entering IDLE.
- if (picker == nullptr || state == GRPC_CHANNEL_SHUTDOWN) {
+ if (picker == nullptr || state == GRPC_CHANNEL_SHUTDOWN) {
health_check_service_name_.reset();
saved_service_config_.reset();
- saved_config_selector_.reset();
+ saved_config_selector_.reset();
}
// Update connectivity state.
- state_tracker_.SetState(state, status, reason);
+ state_tracker_.SetState(state, status, reason);
if (channelz_node_ != nullptr) {
channelz_node_->SetConnectivityState(state);
channelz_node_->AddTraceEvent(
@@ -1778,11 +1778,11 @@ void ChannelData::UpdateStateAndPickerLocked(
// - refs to subchannel wrappers in the keys of pending_subchannel_updates_
// - ref stored in retry_throttle_data_
// - ref stored in service_config_
- // - ref stored in config_selector_
+ // - ref stored in config_selector_
// - ownership of the existing picker in picker_
RefCountedPtr<ServerRetryThrottleData> retry_throttle_data_to_unref;
RefCountedPtr<ServiceConfig> service_config_to_unref;
- RefCountedPtr<ConfigSelector> config_selector_to_unref;
+ RefCountedPtr<ConfigSelector> config_selector_to_unref;
{
MutexLock lock(&data_plane_mu_);
// Handle subchannel updates.
@@ -1802,12 +1802,12 @@ void ChannelData::UpdateStateAndPickerLocked(
// Note: Original value will be destroyed after the lock is released.
picker_.swap(picker);
// Clean the data plane if the updated picker is nullptr.
- if (picker_ == nullptr || state == GRPC_CHANNEL_SHUTDOWN) {
+ if (picker_ == nullptr || state == GRPC_CHANNEL_SHUTDOWN) {
received_service_config_data_ = false;
// Note: We save the objects to unref until after the lock is released.
retry_throttle_data_to_unref = std::move(retry_throttle_data_);
service_config_to_unref = std::move(service_config_);
- config_selector_to_unref = std::move(config_selector_);
+ config_selector_to_unref = std::move(config_selector_);
}
// Re-process queued picks.
for (QueuedPick* pick = queued_picks_; pick != nullptr; pick = pick->next) {
@@ -1824,98 +1824,98 @@ void ChannelData::UpdateStateAndPickerLocked(
pending_subchannel_updates_.clear();
}
-void ChannelData::UpdateServiceConfigInControlPlaneLocked(
- RefCountedPtr<ServiceConfig> service_config,
- RefCountedPtr<ConfigSelector> config_selector,
- const internal::ClientChannelGlobalParsedConfig* parsed_service_config,
- const char* lb_policy_name) {
- grpc_core::UniquePtr<char> service_config_json(
- gpr_strdup(service_config->json_string().c_str()));
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
- gpr_log(GPR_INFO,
- "chand=%p: resolver returned updated service config: \"%s\"", this,
- service_config_json.get());
- }
- // Save service config.
- saved_service_config_ = std::move(service_config);
- // Update health check service name if needed.
- if (((health_check_service_name_ == nullptr) !=
- (parsed_service_config->health_check_service_name() == nullptr)) ||
- (health_check_service_name_ != nullptr &&
- strcmp(health_check_service_name_.get(),
- parsed_service_config->health_check_service_name()) != 0)) {
- health_check_service_name_.reset(
- gpr_strdup(parsed_service_config->health_check_service_name()));
- // Update health check service name used by existing subchannel wrappers.
- for (auto* subchannel_wrapper : subchannel_wrappers_) {
- subchannel_wrapper->UpdateHealthCheckServiceName(
- grpc_core::UniquePtr<char>(
- gpr_strdup(health_check_service_name_.get())));
- }
- }
- // Swap out the data used by GetChannelInfo().
- grpc_core::UniquePtr<char> lb_policy_name_owned(gpr_strdup(lb_policy_name));
- {
- MutexLock lock(&info_mu_);
- info_lb_policy_name_ = std::move(lb_policy_name_owned);
- info_service_config_json_ = std::move(service_config_json);
- }
- // Save config selector.
- saved_config_selector_ = std::move(config_selector);
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
- gpr_log(GPR_INFO, "chand=%p: using ConfigSelector %p", this,
- saved_config_selector_.get());
- }
-}
-
-void ChannelData::UpdateServiceConfigInDataPlaneLocked() {
- // Get retry throttle data from service config.
- const internal::ClientChannelGlobalParsedConfig* parsed_service_config =
- static_cast<const internal::ClientChannelGlobalParsedConfig*>(
- saved_service_config_->GetGlobalParsedConfig(
- internal::ClientChannelServiceConfigParser::ParserIndex()));
- y_absl::optional<internal::ClientChannelGlobalParsedConfig::RetryThrottling>
- retry_throttle_config = parsed_service_config->retry_throttling();
- RefCountedPtr<ServerRetryThrottleData> retry_throttle_data;
- if (retry_throttle_config.has_value()) {
- retry_throttle_data = internal::ServerRetryThrottleMap::GetDataForServer(
- server_name_.get(), retry_throttle_config.value().max_milli_tokens,
- retry_throttle_config.value().milli_token_ratio);
- }
- // Grab ref to service config.
- RefCountedPtr<ServiceConfig> service_config = saved_service_config_;
- // Grab ref to config selector. Use default if resolver didn't supply one.
- RefCountedPtr<ConfigSelector> config_selector = saved_config_selector_;
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
- gpr_log(GPR_INFO, "chand=%p: switching to ConfigSelector %p", this,
- saved_config_selector_.get());
- }
- if (config_selector == nullptr) {
- config_selector =
- MakeRefCounted<DefaultConfigSelector>(saved_service_config_);
- }
+void ChannelData::UpdateServiceConfigInControlPlaneLocked(
+ RefCountedPtr<ServiceConfig> service_config,
+ RefCountedPtr<ConfigSelector> config_selector,
+ const internal::ClientChannelGlobalParsedConfig* parsed_service_config,
+ const char* lb_policy_name) {
+ grpc_core::UniquePtr<char> service_config_json(
+ gpr_strdup(service_config->json_string().c_str()));
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
+ gpr_log(GPR_INFO,
+ "chand=%p: resolver returned updated service config: \"%s\"", this,
+ service_config_json.get());
+ }
+ // Save service config.
+ saved_service_config_ = std::move(service_config);
+ // Update health check service name if needed.
+ if (((health_check_service_name_ == nullptr) !=
+ (parsed_service_config->health_check_service_name() == nullptr)) ||
+ (health_check_service_name_ != nullptr &&
+ strcmp(health_check_service_name_.get(),
+ parsed_service_config->health_check_service_name()) != 0)) {
+ health_check_service_name_.reset(
+ gpr_strdup(parsed_service_config->health_check_service_name()));
+ // Update health check service name used by existing subchannel wrappers.
+ for (auto* subchannel_wrapper : subchannel_wrappers_) {
+ subchannel_wrapper->UpdateHealthCheckServiceName(
+ grpc_core::UniquePtr<char>(
+ gpr_strdup(health_check_service_name_.get())));
+ }
+ }
+ // Swap out the data used by GetChannelInfo().
+ grpc_core::UniquePtr<char> lb_policy_name_owned(gpr_strdup(lb_policy_name));
+ {
+ MutexLock lock(&info_mu_);
+ info_lb_policy_name_ = std::move(lb_policy_name_owned);
+ info_service_config_json_ = std::move(service_config_json);
+ }
+ // Save config selector.
+ saved_config_selector_ = std::move(config_selector);
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
+ gpr_log(GPR_INFO, "chand=%p: using ConfigSelector %p", this,
+ saved_config_selector_.get());
+ }
+}
+
+void ChannelData::UpdateServiceConfigInDataPlaneLocked() {
+ // Get retry throttle data from service config.
+ const internal::ClientChannelGlobalParsedConfig* parsed_service_config =
+ static_cast<const internal::ClientChannelGlobalParsedConfig*>(
+ saved_service_config_->GetGlobalParsedConfig(
+ internal::ClientChannelServiceConfigParser::ParserIndex()));
+ y_absl::optional<internal::ClientChannelGlobalParsedConfig::RetryThrottling>
+ retry_throttle_config = parsed_service_config->retry_throttling();
+ RefCountedPtr<ServerRetryThrottleData> retry_throttle_data;
+ if (retry_throttle_config.has_value()) {
+ retry_throttle_data = internal::ServerRetryThrottleMap::GetDataForServer(
+ server_name_.get(), retry_throttle_config.value().max_milli_tokens,
+ retry_throttle_config.value().milli_token_ratio);
+ }
+ // Grab ref to service config.
+ RefCountedPtr<ServiceConfig> service_config = saved_service_config_;
+ // Grab ref to config selector. Use default if resolver didn't supply one.
+ RefCountedPtr<ConfigSelector> config_selector = saved_config_selector_;
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
+ gpr_log(GPR_INFO, "chand=%p: switching to ConfigSelector %p", this,
+ saved_config_selector_.get());
+ }
+ if (config_selector == nullptr) {
+ config_selector =
+ MakeRefCounted<DefaultConfigSelector>(saved_service_config_);
+ }
// Grab data plane lock to update service config.
//
// We defer unreffing the old values (and deallocating memory) until
// after releasing the lock to keep the critical section small.
{
MutexLock lock(&data_plane_mu_);
- GRPC_ERROR_UNREF(resolver_transient_failure_error_);
- resolver_transient_failure_error_ = GRPC_ERROR_NONE;
+ GRPC_ERROR_UNREF(resolver_transient_failure_error_);
+ resolver_transient_failure_error_ = GRPC_ERROR_NONE;
// Update service config.
received_service_config_data_ = true;
// Old values will be unreffed after lock is released.
retry_throttle_data_.swap(retry_throttle_data);
service_config_.swap(service_config);
- config_selector_.swap(config_selector);
- // Re-process queued picks.
+ config_selector_.swap(config_selector);
+ // Re-process queued picks.
for (QueuedPick* pick = queued_picks_; pick != nullptr; pick = pick->next) {
- grpc_call_element* elem = pick->elem;
- CallData* calld = static_cast<CallData*>(elem->call_data);
- grpc_error* error = GRPC_ERROR_NONE;
- if (calld->PickSubchannelLocked(elem, &error)) {
- calld->AsyncPickDone(elem, error);
- }
+ grpc_call_element* elem = pick->elem;
+ CallData* calld = static_cast<CallData*>(elem->call_data);
+ grpc_error* error = GRPC_ERROR_NONE;
+ if (calld->PickSubchannelLocked(elem, &error)) {
+ calld->AsyncPickDone(elem, error);
+ }
}
}
// Old values will be unreffed after lock is released when they go out
@@ -1925,14 +1925,14 @@ void ChannelData::UpdateServiceConfigInDataPlaneLocked() {
void ChannelData::CreateResolvingLoadBalancingPolicyLocked() {
// Instantiate resolving LB policy.
LoadBalancingPolicy::Args lb_args;
- lb_args.work_serializer = work_serializer_;
- lb_args.channel_control_helper =
- y_absl::make_unique<ClientChannelControlHelper>(this);
+ lb_args.work_serializer = work_serializer_;
+ lb_args.channel_control_helper =
+ y_absl::make_unique<ClientChannelControlHelper>(this);
lb_args.args = channel_args_;
grpc_core::UniquePtr<char> target_uri(gpr_strdup(target_uri_.get()));
resolving_lb_policy_.reset(new ResolvingLoadBalancingPolicy(
std::move(lb_args), &grpc_client_channel_routing_trace,
- std::move(target_uri), &channel_config_helper_));
+ std::move(target_uri), &channel_config_helper_));
grpc_pollset_set_add_pollset_set(resolving_lb_policy_->interested_parties(),
interested_parties_);
if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
@@ -1972,18 +1972,18 @@ grpc_error* ChannelData::DoPingLocked(grpc_transport_op* op) {
return result.error;
}
-void ChannelData::StartTransportOpLocked(grpc_transport_op* op) {
+void ChannelData::StartTransportOpLocked(grpc_transport_op* op) {
// Connectivity watch.
if (op->start_connectivity_watch != nullptr) {
- state_tracker_.AddWatcher(op->start_connectivity_watch_state,
- std::move(op->start_connectivity_watch));
+ state_tracker_.AddWatcher(op->start_connectivity_watch_state,
+ std::move(op->start_connectivity_watch));
}
if (op->stop_connectivity_watch != nullptr) {
- state_tracker_.RemoveWatcher(op->stop_connectivity_watch);
+ state_tracker_.RemoveWatcher(op->stop_connectivity_watch);
}
// Ping.
if (op->send_ping.on_initiate != nullptr || op->send_ping.on_ack != nullptr) {
- grpc_error* error = DoPingLocked(op);
+ grpc_error* error = DoPingLocked(op);
if (error != GRPC_ERROR_NONE) {
ExecCtx::Run(DEBUG_LOCATION, op->send_ping.on_initiate,
GRPC_ERROR_REF(error));
@@ -1995,39 +1995,39 @@ void ChannelData::StartTransportOpLocked(grpc_transport_op* op) {
}
// Reset backoff.
if (op->reset_connect_backoff) {
- if (resolving_lb_policy_ != nullptr) {
- resolving_lb_policy_->ResetBackoffLocked();
+ if (resolving_lb_policy_ != nullptr) {
+ resolving_lb_policy_->ResetBackoffLocked();
}
}
// Disconnect or enter IDLE.
if (op->disconnect_with_error != GRPC_ERROR_NONE) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
- gpr_log(GPR_INFO, "chand=%p: disconnect_with_error: %s", this,
+ gpr_log(GPR_INFO, "chand=%p: disconnect_with_error: %s", this,
grpc_error_string(op->disconnect_with_error));
}
- DestroyResolvingLoadBalancingPolicyLocked();
+ DestroyResolvingLoadBalancingPolicyLocked();
intptr_t value;
if (grpc_error_get_int(op->disconnect_with_error,
GRPC_ERROR_INT_CHANNEL_CONNECTIVITY_STATE, &value) &&
static_cast<grpc_connectivity_state>(value) == GRPC_CHANNEL_IDLE) {
- if (disconnect_error() == GRPC_ERROR_NONE) {
+ if (disconnect_error() == GRPC_ERROR_NONE) {
// Enter IDLE state.
- UpdateStateAndPickerLocked(GRPC_CHANNEL_IDLE, y_absl::Status(),
- "channel entering IDLE", nullptr);
+ UpdateStateAndPickerLocked(GRPC_CHANNEL_IDLE, y_absl::Status(),
+ "channel entering IDLE", nullptr);
}
GRPC_ERROR_UNREF(op->disconnect_with_error);
} else {
// Disconnect.
- GPR_ASSERT(disconnect_error_.Load(MemoryOrder::RELAXED) ==
+ GPR_ASSERT(disconnect_error_.Load(MemoryOrder::RELAXED) ==
GRPC_ERROR_NONE);
- disconnect_error_.Store(op->disconnect_with_error, MemoryOrder::RELEASE);
- UpdateStateAndPickerLocked(
- GRPC_CHANNEL_SHUTDOWN, y_absl::Status(), "shutdown from API",
- y_absl::make_unique<LoadBalancingPolicy::TransientFailurePicker>(
+ disconnect_error_.Store(op->disconnect_with_error, MemoryOrder::RELEASE);
+ UpdateStateAndPickerLocked(
+ GRPC_CHANNEL_SHUTDOWN, y_absl::Status(), "shutdown from API",
+ y_absl::make_unique<LoadBalancingPolicy::TransientFailurePicker>(
GRPC_ERROR_REF(op->disconnect_with_error)));
}
}
- GRPC_CHANNEL_STACK_UNREF(owning_stack_, "start_transport_op");
+ GRPC_CHANNEL_STACK_UNREF(owning_stack_, "start_transport_op");
ExecCtx::Run(DEBUG_LOCATION, op->on_consumed, GRPC_ERROR_NONE);
}
@@ -2039,10 +2039,10 @@ void ChannelData::StartTransportOp(grpc_channel_element* elem,
if (op->bind_pollset != nullptr) {
grpc_pollset_set_add_pollset(chand->interested_parties_, op->bind_pollset);
}
- // Pop into control plane work_serializer for remaining ops.
+ // Pop into control plane work_serializer for remaining ops.
GRPC_CHANNEL_STACK_REF(chand->owning_stack_, "start_transport_op");
- chand->work_serializer_->Run(
- [chand, op]() { chand->StartTransportOpLocked(op); }, DEBUG_LOCATION);
+ chand->work_serializer_->Run(
+ [chand, op]() { chand->StartTransportOpLocked(op); }, DEBUG_LOCATION);
}
void ChannelData::GetChannelInfo(grpc_channel_element* elem,
@@ -2093,13 +2093,13 @@ ChannelData::GetConnectedSubchannelInDataPlane(
return connected_subchannel->Ref();
}
-void ChannelData::TryToConnectLocked() {
- if (resolving_lb_policy_ != nullptr) {
- resolving_lb_policy_->ExitIdleLocked();
+void ChannelData::TryToConnectLocked() {
+ if (resolving_lb_policy_ != nullptr) {
+ resolving_lb_policy_->ExitIdleLocked();
} else {
- CreateResolvingLoadBalancingPolicyLocked();
+ CreateResolvingLoadBalancingPolicyLocked();
}
- GRPC_CHANNEL_STACK_UNREF(owning_stack_, "TryToConnect");
+ GRPC_CHANNEL_STACK_UNREF(owning_stack_, "TryToConnect");
}
grpc_connectivity_state ChannelData::CheckConnectivityState(
@@ -2107,7 +2107,7 @@ grpc_connectivity_state ChannelData::CheckConnectivityState(
grpc_connectivity_state out = state_tracker_.state();
if (out == GRPC_CHANNEL_IDLE && try_to_connect) {
GRPC_CHANNEL_STACK_REF(owning_stack_, "TryToConnect");
- work_serializer_->Run([this]() { TryToConnectLocked(); }, DEBUG_LOCATION);
+ work_serializer_->Run([this]() { TryToConnectLocked(); }, DEBUG_LOCATION);
}
return out;
}
@@ -2207,13 +2207,13 @@ void CallData::Destroy(grpc_call_element* elem,
const grpc_call_final_info* /*final_info*/,
grpc_closure* then_schedule_closure) {
CallData* calld = static_cast<CallData*>(elem->call_data);
- RefCountedPtr<SubchannelCall> subchannel_call = calld->subchannel_call_;
- calld->~CallData();
- if (GPR_LIKELY(subchannel_call != nullptr)) {
- subchannel_call->SetAfterCallStackDestroy(then_schedule_closure);
- } else {
- // TODO(yashkt) : This can potentially be a Closure::Run
- ExecCtx::Run(DEBUG_LOCATION, then_schedule_closure, GRPC_ERROR_NONE);
+ RefCountedPtr<SubchannelCall> subchannel_call = calld->subchannel_call_;
+ calld->~CallData();
+ if (GPR_LIKELY(subchannel_call != nullptr)) {
+ subchannel_call->SetAfterCallStackDestroy(then_schedule_closure);
+ } else {
+ // TODO(yashkt) : This can potentially be a Closure::Run
+ ExecCtx::Run(DEBUG_LOCATION, then_schedule_closure, GRPC_ERROR_NONE);
}
}
@@ -2414,32 +2414,32 @@ void CallData::FreeCachedSendOpDataForCompletedBatch(
void CallData::RecvTrailingMetadataReadyForLoadBalancingPolicy(
void* arg, grpc_error* error) {
CallData* calld = static_cast<CallData*>(arg);
- // Set error if call did not succeed.
- grpc_error* error_for_lb = GRPC_ERROR_NONE;
- if (error != GRPC_ERROR_NONE) {
- error_for_lb = error;
- } else {
- const auto& fields = calld->recv_trailing_metadata_->idx.named;
- GPR_ASSERT(fields.grpc_status != nullptr);
- grpc_status_code status =
- grpc_get_status_code_from_metadata(fields.grpc_status->md);
- TString msg;
- if (status != GRPC_STATUS_OK) {
- error_for_lb = grpc_error_set_int(
- GRPC_ERROR_CREATE_FROM_STATIC_STRING("call failed"),
- GRPC_ERROR_INT_GRPC_STATUS, status);
- if (fields.grpc_message != nullptr) {
- error_for_lb = grpc_error_set_str(
- error_for_lb, GRPC_ERROR_STR_GRPC_MESSAGE,
- grpc_slice_ref_internal(GRPC_MDVALUE(fields.grpc_message->md)));
- }
- }
- }
+ // Set error if call did not succeed.
+ grpc_error* error_for_lb = GRPC_ERROR_NONE;
+ if (error != GRPC_ERROR_NONE) {
+ error_for_lb = error;
+ } else {
+ const auto& fields = calld->recv_trailing_metadata_->idx.named;
+ GPR_ASSERT(fields.grpc_status != nullptr);
+ grpc_status_code status =
+ grpc_get_status_code_from_metadata(fields.grpc_status->md);
+ TString msg;
+ if (status != GRPC_STATUS_OK) {
+ error_for_lb = grpc_error_set_int(
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("call failed"),
+ GRPC_ERROR_INT_GRPC_STATUS, status);
+ if (fields.grpc_message != nullptr) {
+ error_for_lb = grpc_error_set_str(
+ error_for_lb, GRPC_ERROR_STR_GRPC_MESSAGE,
+ grpc_slice_ref_internal(GRPC_MDVALUE(fields.grpc_message->md)));
+ }
+ }
+ }
// Invoke callback to LB policy.
Metadata trailing_metadata(calld, calld->recv_trailing_metadata_);
- calld->lb_recv_trailing_metadata_ready_(error_for_lb, &trailing_metadata,
+ calld->lb_recv_trailing_metadata_ready_(error_for_lb, &trailing_metadata,
&calld->lb_call_state_);
- if (error == GRPC_ERROR_NONE) GRPC_ERROR_UNREF(error_for_lb);
+ if (error == GRPC_ERROR_NONE) GRPC_ERROR_UNREF(error_for_lb);
// Chain to original callback.
Closure::Run(DEBUG_LOCATION, calld->original_recv_trailing_metadata_ready_,
GRPC_ERROR_REF(error));
@@ -2992,7 +2992,7 @@ void CallData::RecvInitialMetadataReady(void* arg, grpc_error* error) {
}
// Received valid initial metadata, so commit the call.
calld->RetryCommit(elem, retry_state);
- calld->MaybeInvokeConfigSelectorCommitCallback();
+ calld->MaybeInvokeConfigSelectorCommitCallback();
// Invoke the callback to return the result to the surface.
// Manually invoking a callback function; it does not take ownership of error.
calld->InvokeRecvInitialMetadataCallback(batch_data, error);
@@ -3079,7 +3079,7 @@ void CallData::RecvMessageReady(void* arg, grpc_error* error) {
}
// Received a valid message, so commit the call.
calld->RetryCommit(elem, retry_state);
- calld->MaybeInvokeConfigSelectorCommitCallback();
+ calld->MaybeInvokeConfigSelectorCommitCallback();
// Invoke the callback to return the result to the surface.
// Manually invoking a callback function; it does not take ownership of error.
calld->InvokeRecvMessageCallback(batch_data, error);
@@ -3281,7 +3281,7 @@ void CallData::RecvTrailingMetadataReady(void* arg, grpc_error* error) {
}
// Not retrying, so commit the call.
calld->RetryCommit(elem, retry_state);
- calld->MaybeInvokeConfigSelectorCommitCallback();
+ calld->MaybeInvokeConfigSelectorCommitCallback();
// Run any necessary closures.
calld->RunClosuresForCompletedCall(batch_data, GRPC_ERROR_REF(error));
}
@@ -3360,8 +3360,8 @@ void CallData::OnComplete(void* arg, grpc_error* error) {
CallData* calld = static_cast<CallData*>(elem->call_data);
if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
gpr_log(GPR_INFO, "chand=%p calld=%p: got on_complete, error=%s, batch=%s",
- chand, calld, grpc_error_string(error),
- grpc_transport_stream_op_batch_string(&batch_data->batch).c_str());
+ chand, calld, grpc_error_string(error),
+ grpc_transport_stream_op_batch_string(&batch_data->batch).c_str());
}
SubchannelCallRetryState* retry_state =
static_cast<SubchannelCallRetryState*>(
@@ -3435,7 +3435,7 @@ void CallData::AddClosureForSubchannelBatch(
batch, grpc_schedule_on_exec_ctx);
if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
gpr_log(GPR_INFO, "chand=%p calld=%p: starting subchannel batch: %s", chand,
- this, grpc_transport_stream_op_batch_string(batch).c_str());
+ this, grpc_transport_stream_op_batch_string(batch).c_str());
}
closures->Add(&batch->handler_private.closure, GRPC_ERROR_NONE,
"start_subchannel_batch");
@@ -3904,8 +3904,8 @@ class CallData::QueuedPickCanceller {
}
if (calld->pick_canceller_ == self && error != GRPC_ERROR_NONE) {
// Remove pick from list of queued picks.
- calld->MaybeInvokeConfigSelectorCommitCallback();
- calld->MaybeRemoveCallFromQueuedPicksLocked(self->elem_);
+ calld->MaybeInvokeConfigSelectorCommitCallback();
+ calld->MaybeRemoveCallFromQueuedPicksLocked(self->elem_);
// Fail pending batches on the call.
calld->PendingBatchesFail(self->elem_, GRPC_ERROR_REF(error),
YieldCallCombinerIfPendingBatchesFound);
@@ -3918,8 +3918,8 @@ class CallData::QueuedPickCanceller {
grpc_closure closure_;
};
-void CallData::MaybeRemoveCallFromQueuedPicksLocked(grpc_call_element* elem) {
- if (!pick_queued_) return;
+void CallData::MaybeRemoveCallFromQueuedPicksLocked(grpc_call_element* elem) {
+ if (!pick_queued_) return;
auto* chand = static_cast<ChannelData*>(elem->channel_data);
if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
gpr_log(GPR_INFO, "chand=%p calld=%p: removing from queued picks list",
@@ -3931,8 +3931,8 @@ void CallData::MaybeRemoveCallFromQueuedPicksLocked(grpc_call_element* elem) {
pick_canceller_ = nullptr;
}
-void CallData::MaybeAddCallToQueuedPicksLocked(grpc_call_element* elem) {
- if (pick_queued_) return;
+void CallData::MaybeAddCallToQueuedPicksLocked(grpc_call_element* elem) {
+ if (pick_queued_) return;
auto* chand = static_cast<ChannelData*>(elem->channel_data);
if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
gpr_log(GPR_INFO, "chand=%p calld=%p: adding to queued picks list", chand,
@@ -3945,77 +3945,77 @@ void CallData::MaybeAddCallToQueuedPicksLocked(grpc_call_element* elem) {
pick_canceller_ = new QueuedPickCanceller(elem);
}
-grpc_error* CallData::ApplyServiceConfigToCallLocked(
- grpc_call_element* elem, grpc_metadata_batch* initial_metadata) {
+grpc_error* CallData::ApplyServiceConfigToCallLocked(
+ grpc_call_element* elem, grpc_metadata_batch* initial_metadata) {
ChannelData* chand = static_cast<ChannelData*>(elem->channel_data);
if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
gpr_log(GPR_INFO, "chand=%p calld=%p: applying service config to call",
chand, this);
}
- ConfigSelector* config_selector = chand->config_selector();
- if (config_selector != nullptr) {
- // Use the ConfigSelector to determine the config for the call.
- ConfigSelector::CallConfig call_config =
- config_selector->GetCallConfig({&path_, initial_metadata, arena_});
- if (call_config.error != GRPC_ERROR_NONE) return call_config.error;
- call_attributes_ = std::move(call_config.call_attributes);
- on_call_committed_ = std::move(call_config.on_call_committed);
- // Create a ServiceConfigCallData for the call. This stores a ref to the
- // ServiceConfig and caches the right set of parsed configs to use for
- // the call. The MethodConfig will store itself in the call context,
- // so that it can be accessed by filters in the subchannel, and it
- // will be cleaned up when the call ends.
- auto* service_config_call_data = arena_->New<ServiceConfigCallData>(
- std::move(call_config.service_config), call_config.method_configs,
- call_context_);
- // Apply our own method params to the call.
+ ConfigSelector* config_selector = chand->config_selector();
+ if (config_selector != nullptr) {
+ // Use the ConfigSelector to determine the config for the call.
+ ConfigSelector::CallConfig call_config =
+ config_selector->GetCallConfig({&path_, initial_metadata, arena_});
+ if (call_config.error != GRPC_ERROR_NONE) return call_config.error;
+ call_attributes_ = std::move(call_config.call_attributes);
+ on_call_committed_ = std::move(call_config.on_call_committed);
+ // Create a ServiceConfigCallData for the call. This stores a ref to the
+ // ServiceConfig and caches the right set of parsed configs to use for
+ // the call. The MethodConfig will store itself in the call context,
+ // so that it can be accessed by filters in the subchannel, and it
+ // will be cleaned up when the call ends.
+ auto* service_config_call_data = arena_->New<ServiceConfigCallData>(
+ std::move(call_config.service_config), call_config.method_configs,
+ call_context_);
+ // Apply our own method params to the call.
method_params_ = static_cast<ClientChannelMethodParsedConfig*>(
- service_config_call_data->GetMethodParsedConfig(
+ service_config_call_data->GetMethodParsedConfig(
internal::ClientChannelServiceConfigParser::ParserIndex()));
- if (method_params_ != nullptr) {
- // If the deadline from the service config is shorter than the one
- // from the client API, reset the deadline timer.
- if (chand->deadline_checking_enabled() &&
- method_params_->timeout() != 0) {
- const grpc_millis per_method_deadline =
- grpc_cycle_counter_to_millis_round_up(call_start_time_) +
- method_params_->timeout();
- if (per_method_deadline < deadline_) {
- deadline_ = per_method_deadline;
- grpc_deadline_state_reset(elem, deadline_);
- }
+ if (method_params_ != nullptr) {
+ // If the deadline from the service config is shorter than the one
+ // from the client API, reset the deadline timer.
+ if (chand->deadline_checking_enabled() &&
+ method_params_->timeout() != 0) {
+ const grpc_millis per_method_deadline =
+ grpc_cycle_counter_to_millis_round_up(call_start_time_) +
+ method_params_->timeout();
+ if (per_method_deadline < deadline_) {
+ deadline_ = per_method_deadline;
+ grpc_deadline_state_reset(elem, deadline_);
+ }
}
- // If the service config set wait_for_ready and the application
- // did not explicitly set it, use the value from the service config.
- uint32_t* send_initial_metadata_flags =
- &pending_batches_[0]
- .batch->payload->send_initial_metadata
- .send_initial_metadata_flags;
- if (method_params_->wait_for_ready().has_value() &&
- !(*send_initial_metadata_flags &
- GRPC_INITIAL_METADATA_WAIT_FOR_READY_EXPLICITLY_SET)) {
- if (method_params_->wait_for_ready().value()) {
- *send_initial_metadata_flags |= GRPC_INITIAL_METADATA_WAIT_FOR_READY;
- } else {
- *send_initial_metadata_flags &= ~GRPC_INITIAL_METADATA_WAIT_FOR_READY;
- }
+ // If the service config set wait_for_ready and the application
+ // did not explicitly set it, use the value from the service config.
+ uint32_t* send_initial_metadata_flags =
+ &pending_batches_[0]
+ .batch->payload->send_initial_metadata
+ .send_initial_metadata_flags;
+ if (method_params_->wait_for_ready().has_value() &&
+ !(*send_initial_metadata_flags &
+ GRPC_INITIAL_METADATA_WAIT_FOR_READY_EXPLICITLY_SET)) {
+ if (method_params_->wait_for_ready().value()) {
+ *send_initial_metadata_flags |= GRPC_INITIAL_METADATA_WAIT_FOR_READY;
+ } else {
+ *send_initial_metadata_flags &= ~GRPC_INITIAL_METADATA_WAIT_FOR_READY;
+ }
}
}
- // Set retry throttle data for call.
- retry_throttle_data_ = chand->retry_throttle_data();
+ // Set retry throttle data for call.
+ retry_throttle_data_ = chand->retry_throttle_data();
}
// If no retry policy, disable retries.
// TODO(roth): Remove this when adding support for transparent retries.
if (method_params_ == nullptr || method_params_->retry_policy() == nullptr) {
enable_retries_ = false;
}
- return GRPC_ERROR_NONE;
+ return GRPC_ERROR_NONE;
}
-void CallData::MaybeInvokeConfigSelectorCommitCallback() {
- if (on_call_committed_ != nullptr) {
- on_call_committed_();
- on_call_committed_ = nullptr;
+void CallData::MaybeInvokeConfigSelectorCommitCallback() {
+ if (on_call_committed_ != nullptr) {
+ on_call_committed_();
+ on_call_committed_ = nullptr;
}
}
@@ -4055,66 +4055,66 @@ bool CallData::PickSubchannelLocked(grpc_call_element* elem,
// The picker being null means that the channel is currently in IDLE state.
// The incoming call will make the channel exit IDLE.
if (chand->picker() == nullptr) {
- GRPC_CHANNEL_STACK_REF(chand->owning_stack(), "PickSubchannelLocked");
- // Bounce into the control plane work serializer to exit IDLE. Since we are
- // holding on to the data plane mutex here, we offload it on the ExecCtx so
- // that we don't deadlock with ourselves.
- ExecCtx::Run(
- DEBUG_LOCATION,
- GRPC_CLOSURE_CREATE(
- [](void* arg, grpc_error* /*error*/) {
- auto* chand = static_cast<ChannelData*>(arg);
- chand->work_serializer()->Run(
- [chand]() {
- chand->CheckConnectivityState(/*try_to_connect=*/true);
- GRPC_CHANNEL_STACK_UNREF(chand->owning_stack(),
- "PickSubchannelLocked");
- },
- DEBUG_LOCATION);
- },
- chand, nullptr),
- GRPC_ERROR_NONE);
+ GRPC_CHANNEL_STACK_REF(chand->owning_stack(), "PickSubchannelLocked");
+ // Bounce into the control plane work serializer to exit IDLE. Since we are
+ // holding on to the data plane mutex here, we offload it on the ExecCtx so
+ // that we don't deadlock with ourselves.
+ ExecCtx::Run(
+ DEBUG_LOCATION,
+ GRPC_CLOSURE_CREATE(
+ [](void* arg, grpc_error* /*error*/) {
+ auto* chand = static_cast<ChannelData*>(arg);
+ chand->work_serializer()->Run(
+ [chand]() {
+ chand->CheckConnectivityState(/*try_to_connect=*/true);
+ GRPC_CHANNEL_STACK_UNREF(chand->owning_stack(),
+ "PickSubchannelLocked");
+ },
+ DEBUG_LOCATION);
+ },
+ chand, nullptr),
+ GRPC_ERROR_NONE);
// Queue the pick, so that it will be attempted once the channel
// becomes connected.
- MaybeAddCallToQueuedPicksLocked(elem);
+ MaybeAddCallToQueuedPicksLocked(elem);
return false;
}
- grpc_metadata_batch* initial_metadata_batch =
- seen_send_initial_metadata_
- ? &send_initial_metadata_
- : pending_batches_[0]
- .batch->payload->send_initial_metadata.send_initial_metadata;
- // Grab initial metadata flags so that we can check later if the call has
- // wait_for_ready enabled.
- const uint32_t send_initial_metadata_flags =
- seen_send_initial_metadata_ ? send_initial_metadata_flags_
- : pending_batches_[0]
- .batch->payload->send_initial_metadata
- .send_initial_metadata_flags;
- // Avoid picking if we haven't yet received service config data.
- if (GPR_UNLIKELY(!chand->received_service_config_data())) {
- // If the resolver returned transient failure before returning the
- // first service config, fail any non-wait_for_ready calls.
- grpc_error* resolver_error = chand->resolver_transient_failure_error();
- if (resolver_error != GRPC_ERROR_NONE &&
- (send_initial_metadata_flags & GRPC_INITIAL_METADATA_WAIT_FOR_READY) ==
- 0) {
- MaybeRemoveCallFromQueuedPicksLocked(elem);
- *error = GRPC_ERROR_REF(resolver_error);
- return true;
- }
- // Either the resolver has not yet returned a result, or it has
- // returned transient failure but the call is wait_for_ready. In
- // either case, queue the call.
- MaybeAddCallToQueuedPicksLocked(elem);
- return false;
- }
- // Apply service config to call if not yet applied.
- if (GPR_LIKELY(!service_config_applied_)) {
- service_config_applied_ = true;
- *error = ApplyServiceConfigToCallLocked(elem, initial_metadata_batch);
- if (*error != GRPC_ERROR_NONE) return true;
- }
+ grpc_metadata_batch* initial_metadata_batch =
+ seen_send_initial_metadata_
+ ? &send_initial_metadata_
+ : pending_batches_[0]
+ .batch->payload->send_initial_metadata.send_initial_metadata;
+ // Grab initial metadata flags so that we can check later if the call has
+ // wait_for_ready enabled.
+ const uint32_t send_initial_metadata_flags =
+ seen_send_initial_metadata_ ? send_initial_metadata_flags_
+ : pending_batches_[0]
+ .batch->payload->send_initial_metadata
+ .send_initial_metadata_flags;
+ // Avoid picking if we haven't yet received service config data.
+ if (GPR_UNLIKELY(!chand->received_service_config_data())) {
+ // If the resolver returned transient failure before returning the
+ // first service config, fail any non-wait_for_ready calls.
+ grpc_error* resolver_error = chand->resolver_transient_failure_error();
+ if (resolver_error != GRPC_ERROR_NONE &&
+ (send_initial_metadata_flags & GRPC_INITIAL_METADATA_WAIT_FOR_READY) ==
+ 0) {
+ MaybeRemoveCallFromQueuedPicksLocked(elem);
+ *error = GRPC_ERROR_REF(resolver_error);
+ return true;
+ }
+ // Either the resolver has not yet returned a result, or it has
+ // returned transient failure but the call is wait_for_ready. In
+ // either case, queue the call.
+ MaybeAddCallToQueuedPicksLocked(elem);
+ return false;
+ }
+ // Apply service config to call if not yet applied.
+ if (GPR_LIKELY(!service_config_applied_)) {
+ service_config_applied_ = true;
+ *error = ApplyServiceConfigToCallLocked(elem, initial_metadata_batch);
+ if (*error != GRPC_ERROR_NONE) return true;
+ }
// If this is a retry, use the send_initial_metadata payload that
// we've cached; otherwise, use the pending batch. The
// send_initial_metadata batch will be the first pending batch in the
@@ -4126,9 +4126,9 @@ bool CallData::PickSubchannelLocked(grpc_call_element* elem,
// subchannel's copy of the metadata batch (which is copied for each
// attempt) to the LB policy instead the one from the parent channel.
LoadBalancingPolicy::PickArgs pick_args;
- pick_args.path = StringViewFromSlice(path_);
+ pick_args.path = StringViewFromSlice(path_);
pick_args.call_state = &lb_call_state_;
- Metadata initial_metadata(this, initial_metadata_batch);
+ Metadata initial_metadata(this, initial_metadata_batch);
pick_args.initial_metadata = &initial_metadata;
// Attempt pick.
auto result = chand->picker()->Pick(pick_args);
@@ -4144,8 +4144,8 @@ bool CallData::PickSubchannelLocked(grpc_call_element* elem,
grpc_error* disconnect_error = chand->disconnect_error();
if (disconnect_error != GRPC_ERROR_NONE) {
GRPC_ERROR_UNREF(result.error);
- MaybeRemoveCallFromQueuedPicksLocked(elem);
- MaybeInvokeConfigSelectorCommitCallback();
+ MaybeRemoveCallFromQueuedPicksLocked(elem);
+ MaybeInvokeConfigSelectorCommitCallback();
*error = GRPC_ERROR_REF(disconnect_error);
return true;
}
@@ -4166,9 +4166,9 @@ bool CallData::PickSubchannelLocked(grpc_call_element* elem,
"Failed to pick subchannel", &result.error, 1);
GRPC_ERROR_UNREF(result.error);
*error = new_error;
- MaybeInvokeConfigSelectorCommitCallback();
+ MaybeInvokeConfigSelectorCommitCallback();
}
- MaybeRemoveCallFromQueuedPicksLocked(elem);
+ MaybeRemoveCallFromQueuedPicksLocked(elem);
return !retried;
}
// If wait_for_ready is true, then queue to retry when we get a new
@@ -4177,26 +4177,26 @@ bool CallData::PickSubchannelLocked(grpc_call_element* elem,
}
// Fallthrough
case LoadBalancingPolicy::PickResult::PICK_QUEUE:
- MaybeAddCallToQueuedPicksLocked(elem);
+ MaybeAddCallToQueuedPicksLocked(elem);
return false;
default: // PICK_COMPLETE
- MaybeRemoveCallFromQueuedPicksLocked(elem);
+ MaybeRemoveCallFromQueuedPicksLocked(elem);
// Handle drops.
if (GPR_UNLIKELY(result.subchannel == nullptr)) {
- result.error = grpc_error_set_int(
- GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "Call dropped by load balancing policy"),
- GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE);
- MaybeInvokeConfigSelectorCommitCallback();
+ result.error = grpc_error_set_int(
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Call dropped by load balancing policy"),
+ GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE);
+ MaybeInvokeConfigSelectorCommitCallback();
} else {
// Grab a ref to the connected subchannel while we're still
// holding the data plane mutex.
connected_subchannel_ =
chand->GetConnectedSubchannelInDataPlane(result.subchannel.get());
GPR_ASSERT(connected_subchannel_ != nullptr);
- if (!enable_retries_ || retry_committed_) {
- MaybeInvokeConfigSelectorCommitCallback();
- }
+ if (!enable_retries_ || retry_committed_) {
+ MaybeInvokeConfigSelectorCommitCallback();
+ }
}
lb_recv_trailing_metadata_ready_ = result.recv_trailing_metadata_ready;
*error = result.error;
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/client_channel.h b/contrib/libs/grpc/src/core/ext/filters/client_channel/client_channel.h
index 376cec24757..35c2a2af6b2 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/client_channel.h
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/client_channel.h
@@ -79,4 +79,4 @@ void grpc_client_channel_stop_connectivity_watch(
grpc_core::RefCountedPtr<grpc_core::SubchannelCall>
grpc_client_channel_get_subchannel_call(grpc_call_element* elem);
-#endif // GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_CLIENT_CHANNEL_H
+#endif // GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_CLIENT_CHANNEL_H
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/client_channel_channelz.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/client_channel_channelz.cc
index 0d07add46ab..a7799e449aa 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/client_channel_channelz.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/client_channel_channelz.cc
@@ -27,12 +27,12 @@
#include <grpc/support/string_util.h>
-#include <util/string/cast.h>
-
+#include <util/string/cast.h>
+
namespace grpc_core {
namespace channelz {
-SubchannelNode::SubchannelNode(TString target_address,
+SubchannelNode::SubchannelNode(TString target_address,
size_t channel_tracer_max_nodes)
: BaseNode(EntityType::kSubchannel, target_address),
target_(std::move(target_address)),
@@ -49,48 +49,48 @@ void SubchannelNode::SetChildSocket(RefCountedPtr<SocketNode> socket) {
child_socket_ = std::move(socket);
}
-Json SubchannelNode::RenderJson() {
- // Create and fill the data child.
+Json SubchannelNode::RenderJson() {
+ // Create and fill the data child.
grpc_connectivity_state state =
connectivity_state_.Load(MemoryOrder::RELAXED);
- Json::Object data = {
- {"state",
- Json::Object{
- {"state", ConnectivityStateName(state)},
- }},
- {"target", target_},
- };
+ Json::Object data = {
+ {"state",
+ Json::Object{
+ {"state", ConnectivityStateName(state)},
+ }},
+ {"target", target_},
+ };
- // Fill in the channel trace if applicable
- Json trace_json = trace_.RenderJson();
- if (trace_json.type() != Json::Type::JSON_NULL) {
- data["trace"] = std::move(trace_json);
+ // Fill in the channel trace if applicable
+ Json trace_json = trace_.RenderJson();
+ if (trace_json.type() != Json::Type::JSON_NULL) {
+ data["trace"] = std::move(trace_json);
}
- // Ask CallCountingHelper to populate call count data.
- call_counter_.PopulateCallCounts(&data);
- // Construct top-level object.
- Json::Object object{
- {"ref",
- Json::Object{
- {"subchannelId", ToString(uuid())},
- }},
- {"data", std::move(data)},
- };
- // Populate the child socket.
+ // Ask CallCountingHelper to populate call count data.
+ call_counter_.PopulateCallCounts(&data);
+ // Construct top-level object.
+ Json::Object object{
+ {"ref",
+ Json::Object{
+ {"subchannelId", ToString(uuid())},
+ }},
+ {"data", std::move(data)},
+ };
+ // Populate the child socket.
RefCountedPtr<SocketNode> child_socket;
{
MutexLock lock(&socket_mu_);
child_socket = child_socket_;
}
if (child_socket != nullptr && child_socket->uuid() != 0) {
- object["socketRef"] = Json::Array{
- Json::Object{
- {"socketId", ToString(child_socket->uuid())},
- {"name", child_socket->name()},
- },
- };
+ object["socketRef"] = Json::Array{
+ Json::Object{
+ {"socketId", ToString(child_socket->uuid())},
+ {"name", child_socket->name()},
+ },
+ };
}
- return object;
+ return object;
}
} // namespace channelz
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/client_channel_channelz.h b/contrib/libs/grpc/src/core/ext/filters/client_channel/client_channel_channelz.h
index 5cd9981a931..cc463e26b94 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/client_channel_channelz.h
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/client_channel_channelz.h
@@ -21,7 +21,7 @@
#include <grpc/support/port_platform.h>
-#include <util/generic/string.h>
+#include <util/generic/string.h>
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/channel/channel_stack.h"
@@ -33,7 +33,7 @@ namespace channelz {
class SubchannelNode : public BaseNode {
public:
- SubchannelNode(TString target_address, size_t channel_tracer_max_nodes);
+ SubchannelNode(TString target_address, size_t channel_tracer_max_nodes);
~SubchannelNode() override;
// Sets the subchannel's connectivity state without health checking.
@@ -44,7 +44,7 @@ class SubchannelNode : public BaseNode {
// subchannel unrefs the transport.
void SetChildSocket(RefCountedPtr<SocketNode> socket);
- Json RenderJson() override;
+ Json RenderJson() override;
// proxy methods to composed classes.
void AddTraceEvent(ChannelTrace::Severity severity, const grpc_slice& data) {
@@ -64,7 +64,7 @@ class SubchannelNode : public BaseNode {
Atomic<grpc_connectivity_state> connectivity_state_{GRPC_CHANNEL_IDLE};
Mutex socket_mu_;
RefCountedPtr<SocketNode> child_socket_;
- TString target_;
+ TString target_;
CallCountingHelper call_counter_;
ChannelTrace trace_;
};
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/client_channel_plugin.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/client_channel_plugin.cc
index 666291d9e4a..2358415fc2e 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/client_channel_plugin.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/client_channel_plugin.cc
@@ -35,7 +35,7 @@
#include "src/core/ext/filters/client_channel/resolver_registry.h"
#include "src/core/ext/filters/client_channel/resolver_result_parsing.h"
#include "src/core/ext/filters/client_channel/retry_throttle.h"
-#include "src/core/ext/filters/client_channel/service_config_parser.h"
+#include "src/core/ext/filters/client_channel/service_config_parser.h"
#include "src/core/lib/surface/channel_init.h"
static bool append_filter(grpc_channel_stack_builder* builder, void* arg) {
@@ -44,7 +44,7 @@ static bool append_filter(grpc_channel_stack_builder* builder, void* arg) {
}
void grpc_client_channel_init(void) {
- grpc_core::ServiceConfigParser::Init();
+ grpc_core::ServiceConfigParser::Init();
grpc_core::internal::ClientChannelServiceConfigParser::Register();
grpc_core::LoadBalancingPolicyRegistry::Builder::InitRegistry();
grpc_core::ResolverRegistry::Builder::InitRegistry();
@@ -66,5 +66,5 @@ void grpc_client_channel_shutdown(void) {
grpc_core::internal::ServerRetryThrottleMap::Shutdown();
grpc_core::ResolverRegistry::Builder::ShutdownRegistry();
grpc_core::LoadBalancingPolicyRegistry::Builder::ShutdownRegistry();
- grpc_core::ServiceConfigParser::Shutdown();
+ grpc_core::ServiceConfigParser::Shutdown();
}
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/config_selector.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/config_selector.cc
index f58f283f350..0c2a08e5eb1 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/config_selector.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/config_selector.cc
@@ -1,58 +1,58 @@
-//
-// Copyright 2020 gRPC authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-#include <grpc/support/port_platform.h>
-
-#include "src/core/ext/filters/client_channel/config_selector.h"
-#include "src/core/lib/channel/channel_args.h"
-
-namespace grpc_core {
-
-namespace {
-
-void* ConfigSelectorArgCopy(void* p) {
- ConfigSelector* config_selector = static_cast<ConfigSelector*>(p);
- config_selector->Ref().release();
- return p;
-}
-
-void ConfigSelectorArgDestroy(void* p) {
- ConfigSelector* config_selector = static_cast<ConfigSelector*>(p);
- config_selector->Unref();
-}
-
-int ConfigSelectorArgCmp(void* p, void* q) { return GPR_ICMP(p, q); }
-
-const grpc_arg_pointer_vtable kChannelArgVtable = {
- ConfigSelectorArgCopy, ConfigSelectorArgDestroy, ConfigSelectorArgCmp};
-
-} // namespace
-
-grpc_arg ConfigSelector::MakeChannelArg() const {
- return grpc_channel_arg_pointer_create(
- const_cast<char*>(GRPC_ARG_CONFIG_SELECTOR),
- const_cast<ConfigSelector*>(this), &kChannelArgVtable);
-}
-
-RefCountedPtr<ConfigSelector> ConfigSelector::GetFromChannelArgs(
- const grpc_channel_args& args) {
- ConfigSelector* config_selector =
- grpc_channel_args_find_pointer<ConfigSelector>(&args,
- GRPC_ARG_CONFIG_SELECTOR);
- return config_selector != nullptr ? config_selector->Ref() : nullptr;
-}
-
-} // namespace grpc_core
+//
+// Copyright 2020 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/ext/filters/client_channel/config_selector.h"
+#include "src/core/lib/channel/channel_args.h"
+
+namespace grpc_core {
+
+namespace {
+
+void* ConfigSelectorArgCopy(void* p) {
+ ConfigSelector* config_selector = static_cast<ConfigSelector*>(p);
+ config_selector->Ref().release();
+ return p;
+}
+
+void ConfigSelectorArgDestroy(void* p) {
+ ConfigSelector* config_selector = static_cast<ConfigSelector*>(p);
+ config_selector->Unref();
+}
+
+int ConfigSelectorArgCmp(void* p, void* q) { return GPR_ICMP(p, q); }
+
+const grpc_arg_pointer_vtable kChannelArgVtable = {
+ ConfigSelectorArgCopy, ConfigSelectorArgDestroy, ConfigSelectorArgCmp};
+
+} // namespace
+
+grpc_arg ConfigSelector::MakeChannelArg() const {
+ return grpc_channel_arg_pointer_create(
+ const_cast<char*>(GRPC_ARG_CONFIG_SELECTOR),
+ const_cast<ConfigSelector*>(this), &kChannelArgVtable);
+}
+
+RefCountedPtr<ConfigSelector> ConfigSelector::GetFromChannelArgs(
+ const grpc_channel_args& args) {
+ ConfigSelector* config_selector =
+ grpc_channel_args_find_pointer<ConfigSelector>(&args,
+ GRPC_ARG_CONFIG_SELECTOR);
+ return config_selector != nullptr ? config_selector->Ref() : nullptr;
+}
+
+} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/config_selector.h b/contrib/libs/grpc/src/core/ext/filters/client_channel/config_selector.h
index 55c8e00d6aa..2022b175146 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/config_selector.h
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/config_selector.h
@@ -1,122 +1,122 @@
-//
-// Copyright 2020 gRPC authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-#ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_CONFIG_SELECTOR_H
-#define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_CONFIG_SELECTOR_H
-
-#include <grpc/support/port_platform.h>
-
-#include <functional>
-#include <map>
-
-#include "y_absl/strings/string_view.h"
-
-#include <grpc/impl/codegen/grpc_types.h>
-#include <grpc/impl/codegen/slice.h>
-
-#include "src/core/ext/filters/client_channel/service_config.h"
-#include "src/core/ext/filters/client_channel/service_config_parser.h"
-#include "src/core/lib/gprpp/arena.h"
-#include "src/core/lib/gprpp/ref_counted.h"
-#include "src/core/lib/gprpp/ref_counted_ptr.h"
-#include "src/core/lib/transport/metadata_batch.h"
-
-// Channel arg key for ConfigSelector.
-#define GRPC_ARG_CONFIG_SELECTOR "grpc.internal.config_selector"
-
-namespace grpc_core {
-
-// Internal API used to allow resolver implementations to override
-// MethodConfig and provide input to LB policies on a per-call basis.
-class ConfigSelector : public RefCounted<ConfigSelector> {
- public:
- struct GetCallConfigArgs {
- grpc_slice* path;
- grpc_metadata_batch* initial_metadata;
- Arena* arena;
- };
-
- struct CallConfig {
- // Can be set to indicate the call should be failed.
- grpc_error* error = GRPC_ERROR_NONE;
- // The per-method parsed configs that will be passed to
- // ServiceConfigCallData.
- const ServiceConfigParser::ParsedConfigVector* method_configs = nullptr;
- // A ref to the service config that contains method_configs, held by
- // the call to ensure that method_configs lives long enough.
- RefCountedPtr<ServiceConfig> service_config;
- // Call attributes that will be accessible to LB policy implementations.
- std::map<const char*, y_absl::string_view> call_attributes;
- // A callback that, if set, will be invoked when the call is
- // committed (i.e., when we know that we will never again need to
- // ask the picker for a subchannel for this call).
- std::function<void()> on_call_committed;
- };
-
- virtual ~ConfigSelector() = default;
-
- virtual const char* name() const = 0;
-
- // Will be called only if the two objects have the same name, so
- // subclasses can be free to safely down-cast the argument.
- virtual bool Equals(const ConfigSelector* other) const = 0;
-
- static bool Equals(const ConfigSelector* cs1, const ConfigSelector* cs2) {
- if (cs1 == nullptr) return cs2 == nullptr;
- if (cs2 == nullptr) return false;
- if (strcmp(cs1->name(), cs2->name()) != 0) return false;
- return cs1->Equals(cs2);
- }
-
- virtual CallConfig GetCallConfig(GetCallConfigArgs args) = 0;
-
- grpc_arg MakeChannelArg() const;
- static RefCountedPtr<ConfigSelector> GetFromChannelArgs(
- const grpc_channel_args& args);
-};
-
-// Default ConfigSelector that gets the MethodConfig from the service config.
-class DefaultConfigSelector : public ConfigSelector {
- public:
- explicit DefaultConfigSelector(RefCountedPtr<ServiceConfig> service_config)
- : service_config_(std::move(service_config)) {
- // The client channel code ensures that this will never be null.
- // If neither the resolver nor the client application provide a
- // config, a default empty config will be used.
- GPR_DEBUG_ASSERT(service_config_ != nullptr);
- }
-
- const char* name() const override { return "default"; }
-
- // Only comparing the ConfigSelector itself, not the underlying
- // service config, so we always return true.
- bool Equals(const ConfigSelector* other) const override { return true; }
-
- CallConfig GetCallConfig(GetCallConfigArgs args) override {
- CallConfig call_config;
- call_config.method_configs =
- service_config_->GetMethodParsedConfigVector(*args.path);
- call_config.service_config = service_config_;
- return call_config;
- }
-
- private:
- RefCountedPtr<ServiceConfig> service_config_;
-};
-
-} // namespace grpc_core
-
-#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_CONFIG_SELECTOR_H */
+//
+// Copyright 2020 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+#ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_CONFIG_SELECTOR_H
+#define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_CONFIG_SELECTOR_H
+
+#include <grpc/support/port_platform.h>
+
+#include <functional>
+#include <map>
+
+#include "y_absl/strings/string_view.h"
+
+#include <grpc/impl/codegen/grpc_types.h>
+#include <grpc/impl/codegen/slice.h>
+
+#include "src/core/ext/filters/client_channel/service_config.h"
+#include "src/core/ext/filters/client_channel/service_config_parser.h"
+#include "src/core/lib/gprpp/arena.h"
+#include "src/core/lib/gprpp/ref_counted.h"
+#include "src/core/lib/gprpp/ref_counted_ptr.h"
+#include "src/core/lib/transport/metadata_batch.h"
+
+// Channel arg key for ConfigSelector.
+#define GRPC_ARG_CONFIG_SELECTOR "grpc.internal.config_selector"
+
+namespace grpc_core {
+
+// Internal API used to allow resolver implementations to override
+// MethodConfig and provide input to LB policies on a per-call basis.
+class ConfigSelector : public RefCounted<ConfigSelector> {
+ public:
+ struct GetCallConfigArgs {
+ grpc_slice* path;
+ grpc_metadata_batch* initial_metadata;
+ Arena* arena;
+ };
+
+ struct CallConfig {
+ // Can be set to indicate the call should be failed.
+ grpc_error* error = GRPC_ERROR_NONE;
+ // The per-method parsed configs that will be passed to
+ // ServiceConfigCallData.
+ const ServiceConfigParser::ParsedConfigVector* method_configs = nullptr;
+ // A ref to the service config that contains method_configs, held by
+ // the call to ensure that method_configs lives long enough.
+ RefCountedPtr<ServiceConfig> service_config;
+ // Call attributes that will be accessible to LB policy implementations.
+ std::map<const char*, y_absl::string_view> call_attributes;
+ // A callback that, if set, will be invoked when the call is
+ // committed (i.e., when we know that we will never again need to
+ // ask the picker for a subchannel for this call).
+ std::function<void()> on_call_committed;
+ };
+
+ virtual ~ConfigSelector() = default;
+
+ virtual const char* name() const = 0;
+
+ // Will be called only if the two objects have the same name, so
+ // subclasses can be free to safely down-cast the argument.
+ virtual bool Equals(const ConfigSelector* other) const = 0;
+
+ static bool Equals(const ConfigSelector* cs1, const ConfigSelector* cs2) {
+ if (cs1 == nullptr) return cs2 == nullptr;
+ if (cs2 == nullptr) return false;
+ if (strcmp(cs1->name(), cs2->name()) != 0) return false;
+ return cs1->Equals(cs2);
+ }
+
+ virtual CallConfig GetCallConfig(GetCallConfigArgs args) = 0;
+
+ grpc_arg MakeChannelArg() const;
+ static RefCountedPtr<ConfigSelector> GetFromChannelArgs(
+ const grpc_channel_args& args);
+};
+
+// Default ConfigSelector that gets the MethodConfig from the service config.
+class DefaultConfigSelector : public ConfigSelector {
+ public:
+ explicit DefaultConfigSelector(RefCountedPtr<ServiceConfig> service_config)
+ : service_config_(std::move(service_config)) {
+ // The client channel code ensures that this will never be null.
+ // If neither the resolver nor the client application provide a
+ // config, a default empty config will be used.
+ GPR_DEBUG_ASSERT(service_config_ != nullptr);
+ }
+
+ const char* name() const override { return "default"; }
+
+ // Only comparing the ConfigSelector itself, not the underlying
+ // service config, so we always return true.
+ bool Equals(const ConfigSelector* other) const override { return true; }
+
+ CallConfig GetCallConfig(GetCallConfigArgs args) override {
+ CallConfig call_config;
+ call_config.method_configs =
+ service_config_->GetMethodParsedConfigVector(*args.path);
+ call_config.service_config = service_config_;
+ return call_config;
+ }
+
+ private:
+ RefCountedPtr<ServiceConfig> service_config_;
+};
+
+} // namespace grpc_core
+
+#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_CONFIG_SELECTOR_H */
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/global_subchannel_pool.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/global_subchannel_pool.cc
index 052c59b98d6..546d1c44160 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/global_subchannel_pool.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/global_subchannel_pool.cc
@@ -24,9 +24,9 @@
namespace grpc_core {
-#define GRPC_REGISTER_SUBCHANNEL_CALM_DOWN_AFTER_ATTEMPTS 100
-#define GRPC_REGISTER_SUBCHANNEL_CALM_DOWN_MICROS 10
-
+#define GRPC_REGISTER_SUBCHANNEL_CALM_DOWN_AFTER_ATTEMPTS 100
+#define GRPC_REGISTER_SUBCHANNEL_CALM_DOWN_MICROS 10
+
GlobalSubchannelPool::GlobalSubchannelPool() {
subchannel_map_ = grpc_avl_create(&subchannel_avl_vtable_);
gpr_mu_init(&mu_);
@@ -61,7 +61,7 @@ Subchannel* GlobalSubchannelPool::RegisterSubchannel(SubchannelKey* key,
Subchannel* constructed) {
Subchannel* c = nullptr;
// Compare and swap (CAS) loop:
- for (int attempt_count = 0; c == nullptr; attempt_count++) {
+ for (int attempt_count = 0; c == nullptr; attempt_count++) {
// Ref the shared map to have a local copy.
gpr_mu_lock(&mu_);
grpc_avl old_map = grpc_avl_ref(subchannel_map_, nullptr);
@@ -75,26 +75,26 @@ Subchannel* GlobalSubchannelPool::RegisterSubchannel(SubchannelKey* key,
GRPC_SUBCHANNEL_UNREF(constructed,
"subchannel_register+found_existing");
// Exit the CAS loop without modifying the shared map.
- } else {
- // Reuse of the subchannel failed, so retry CAS loop
- if (attempt_count >=
- GRPC_REGISTER_SUBCHANNEL_CALM_DOWN_AFTER_ATTEMPTS) {
- // GRPC_SUBCHANNEL_REF_FROM_WEAK_REF returning nullptr means that the
- // subchannel we got is no longer valid and it's going to be removed
- // from the AVL tree soon. Spinning here excesively here can actually
- // prevent another thread from removing the subchannel, basically
- // resulting in a live lock. See b/157516542 for more details.
- // TODO(jtattermusch): the entire ref-counting mechanism for
- // subchannels should be overhaulded, but the current workaround
- // is fine for short-term.
- // TODO(jtattermusch): gpr does not support thread yield operation,
- // so a very short wait is the best we can do.
- gpr_sleep_until(gpr_time_add(
- gpr_now(GPR_CLOCK_REALTIME),
- gpr_time_from_micros(GRPC_REGISTER_SUBCHANNEL_CALM_DOWN_MICROS,
- GPR_TIMESPAN)));
- }
- }
+ } else {
+ // Reuse of the subchannel failed, so retry CAS loop
+ if (attempt_count >=
+ GRPC_REGISTER_SUBCHANNEL_CALM_DOWN_AFTER_ATTEMPTS) {
+ // GRPC_SUBCHANNEL_REF_FROM_WEAK_REF returning nullptr means that the
+ // subchannel we got is no longer valid and it's going to be removed
+ // from the AVL tree soon. Spinning here excesively here can actually
+ // prevent another thread from removing the subchannel, basically
+ // resulting in a live lock. See b/157516542 for more details.
+ // TODO(jtattermusch): the entire ref-counting mechanism for
+ // subchannels should be overhaulded, but the current workaround
+ // is fine for short-term.
+ // TODO(jtattermusch): gpr does not support thread yield operation,
+ // so a very short wait is the best we can do.
+ gpr_sleep_until(gpr_time_add(
+ gpr_now(GPR_CLOCK_REALTIME),
+ gpr_time_from_micros(GRPC_REGISTER_SUBCHANNEL_CALM_DOWN_MICROS,
+ GPR_TIMESPAN)));
+ }
+ }
} else {
// There hasn't been such subchannel. Add one.
// Note that we should ref the old map first because grpc_avl_add() will
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/health/health_check_client.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/health/health_check_client.cc
index 2489c07a6ea..7995185c131 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/health/health_check_client.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/health/health_check_client.cc
@@ -23,8 +23,8 @@
#include "src/core/ext/filters/client_channel/health/health_check_client.h"
-#include "upb/upb.hpp"
-
+#include "upb/upb.hpp"
+
#include "src/core/lib/debug/trace.h"
#include "src/core/lib/gprpp/sync.h"
#include "src/core/lib/slice/slice_internal.h"
@@ -91,12 +91,12 @@ void HealthCheckClient::SetHealthStatusLocked(grpc_connectivity_state state,
gpr_log(GPR_INFO, "HealthCheckClient %p: setting state=%s reason=%s", this,
ConnectivityStateName(state), reason);
}
- if (watcher_ != nullptr) {
- watcher_->Notify(state,
- state == GRPC_CHANNEL_TRANSIENT_FAILURE
- ? y_absl::Status(y_absl::StatusCode::kUnavailable, reason)
- : y_absl::Status());
- }
+ if (watcher_ != nullptr) {
+ watcher_->Notify(state,
+ state == GRPC_CHANNEL_TRANSIENT_FAILURE
+ ? y_absl::Status(y_absl::StatusCode::kUnavailable, reason)
+ : y_absl::Status());
+ }
}
void HealthCheckClient::Orphan() {
@@ -132,7 +132,7 @@ void HealthCheckClient::StartCallLocked() {
call_state_->StartCall();
}
-void HealthCheckClient::StartRetryTimerLocked() {
+void HealthCheckClient::StartRetryTimerLocked() {
SetHealthStatusLocked(GRPC_CHANNEL_TRANSIENT_FAILURE,
"health check call failed; will retry after backoff");
grpc_millis next_try = retry_backoff_.NextAttemptTime();
@@ -303,7 +303,7 @@ void HealthCheckClient::CallState::StartCall() {
"checking call on subchannel (%s); will retry",
health_check_client_.get(), this, grpc_error_string(error));
GRPC_ERROR_UNREF(error);
- CallEndedLocked(/*retry=*/true);
+ CallEndedLocked(/*retry=*/true);
return;
}
// Initialize payload and batch.
@@ -581,11 +581,11 @@ void HealthCheckClient::CallState::RecvTrailingMetadataReady(
kErrorMessage);
retry = false;
}
- MutexLock lock(&self->health_check_client_->mu_);
- self->CallEndedLocked(retry);
+ MutexLock lock(&self->health_check_client_->mu_);
+ self->CallEndedLocked(retry);
}
-void HealthCheckClient::CallState::CallEndedLocked(bool retry) {
+void HealthCheckClient::CallState::CallEndedLocked(bool retry) {
// If this CallState is still in use, this call ended because of a failure,
// so we need to stop using it and optionally create a new one.
// Otherwise, we have deliberately ended this call, and no further action
@@ -598,10 +598,10 @@ void HealthCheckClient::CallState::CallEndedLocked(bool retry) {
// If the call fails after we've gotten a successful response, reset
// the backoff and restart the call immediately.
health_check_client_->retry_backoff_.Reset();
- health_check_client_->StartCallLocked();
+ health_check_client_->StartCallLocked();
} else {
// If the call failed without receiving any messages, retry later.
- health_check_client_->StartRetryTimerLocked();
+ health_check_client_->StartRetryTimerLocked();
}
}
}
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/health/health_check_client.h b/contrib/libs/grpc/src/core/ext/filters/client_channel/health/health_check_client.h
index 0ad291387a2..e9555b5f955 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/health/health_check_client.h
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/health/health_check_client.h
@@ -72,8 +72,8 @@ class HealthCheckClient : public InternallyRefCounted<HealthCheckClient> {
void StartBatch(grpc_transport_stream_op_batch* batch);
static void StartBatchInCallCombiner(void* arg, grpc_error* error);
- // Requires holding health_check_client_->mu_.
- void CallEndedLocked(bool retry);
+ // Requires holding health_check_client_->mu_.
+ void CallEndedLocked(bool retry);
static void OnComplete(void* arg, grpc_error* error);
static void RecvInitialMetadataReady(void* arg, grpc_error* error);
@@ -143,7 +143,7 @@ class HealthCheckClient : public InternallyRefCounted<HealthCheckClient> {
void StartCall();
void StartCallLocked(); // Requires holding mu_.
- void StartRetryTimerLocked(); // Requires holding mu_.
+ void StartRetryTimerLocked(); // Requires holding mu_.
static void OnRetryTimer(void* arg, grpc_error* error);
void SetHealthStatus(grpc_connectivity_state state, const char* reason);
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/http_connect_handshaker.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/http_connect_handshaker.cc
index 80e98f90cb7..190baabd0a3 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/http_connect_handshaker.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/http_connect_handshaker.cc
@@ -22,8 +22,8 @@
#include <string.h>
-#include "y_absl/strings/str_cat.h"
-
+#include "y_absl/strings/str_cat.h"
+
#include <grpc/slice_buffer.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
@@ -243,10 +243,10 @@ void HttpConnectHandshaker::OnReadDone(void* arg, grpc_error* error) {
// Make sure we got a 2xx response.
if (handshaker->http_response_.status < 200 ||
handshaker->http_response_.status >= 300) {
- error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("HTTP proxy returned response code ",
- handshaker->http_response_.status)
- .c_str());
+ error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrCat("HTTP proxy returned response code ",
+ handshaker->http_response_.status)
+ .c_str());
handshaker->HandshakeFailedLocked(error);
goto done;
}
@@ -325,9 +325,9 @@ void HttpConnectHandshaker::DoHandshake(grpc_tcp_server_acceptor* /*acceptor*/,
args_ = args;
on_handshake_done_ = on_handshake_done;
// Log connection via proxy.
- TString proxy_name(grpc_endpoint_get_peer(args->endpoint));
+ TString proxy_name(grpc_endpoint_get_peer(args->endpoint));
gpr_log(GPR_INFO, "Connecting to server %s via HTTP proxy %s", server_name,
- proxy_name.c_str());
+ proxy_name.c_str());
// Construct HTTP CONNECT request.
grpc_httpcli_request request;
request.host = server_name;
@@ -385,5 +385,5 @@ void grpc_http_connect_register_handshaker_factory() {
using namespace grpc_core;
HandshakerRegistry::RegisterHandshakerFactory(
true /* at_start */, HANDSHAKER_CLIENT,
- y_absl::make_unique<HttpConnectHandshakerFactory>());
+ y_absl::make_unique<HttpConnectHandshakerFactory>());
}
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/http_proxy.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/http_proxy.cc
index 22002d73f84..2187682526c 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/http_proxy.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/http_proxy.cc
@@ -23,8 +23,8 @@
#include <stdbool.h>
#include <string.h>
-#include "y_absl/strings/str_cat.h"
-
+#include "y_absl/strings/str_cat.h"
+
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
@@ -47,29 +47,29 @@ namespace {
* credentials if present in the 'http_proxy' env var, otherwise leaves it
* unchanged. It is caller's responsibility to gpr_free user_cred.
*/
-char* GetHttpProxyServer(const grpc_channel_args* args, char** user_cred) {
+char* GetHttpProxyServer(const grpc_channel_args* args, char** user_cred) {
GPR_ASSERT(user_cred != nullptr);
- grpc_uri* uri = nullptr;
+ grpc_uri* uri = nullptr;
char* proxy_name = nullptr;
char** authority_strs = nullptr;
size_t authority_nstrs;
- /* We check the following places to determine the HTTP proxy to use, stopping
- * at the first one that is set:
- * 1. GRPC_ARG_HTTP_PROXY channel arg
- * 2. grpc_proxy environment variable
- * 3. https_proxy environment variable
- * 4. http_proxy environment variable
- * If none of the above are set, then no HTTP proxy will be used.
+ /* We check the following places to determine the HTTP proxy to use, stopping
+ * at the first one that is set:
+ * 1. GRPC_ARG_HTTP_PROXY channel arg
+ * 2. grpc_proxy environment variable
+ * 3. https_proxy environment variable
+ * 4. http_proxy environment variable
+ * If none of the above are set, then no HTTP proxy will be used.
*/
- char* uri_str =
- gpr_strdup(grpc_channel_args_find_string(args, GRPC_ARG_HTTP_PROXY));
- if (uri_str == nullptr) uri_str = gpr_getenv("grpc_proxy");
+ char* uri_str =
+ gpr_strdup(grpc_channel_args_find_string(args, GRPC_ARG_HTTP_PROXY));
+ if (uri_str == nullptr) uri_str = gpr_getenv("grpc_proxy");
if (uri_str == nullptr) uri_str = gpr_getenv("https_proxy");
if (uri_str == nullptr) uri_str = gpr_getenv("http_proxy");
if (uri_str == nullptr) return nullptr;
- // an emtpy value means "don't use proxy"
- if (uri_str[0] == '\0') goto done;
- uri = grpc_uri_parse(uri_str, false /* suppress_errors */);
+ // an emtpy value means "don't use proxy"
+ if (uri_str[0] == '\0') goto done;
+ uri = grpc_uri_parse(uri_str, false /* suppress_errors */);
if (uri == nullptr || uri->authority == nullptr) {
gpr_log(GPR_ERROR, "cannot parse value of 'http_proxy' env var");
goto done;
@@ -111,7 +111,7 @@ class HttpProxyMapper : public ProxyMapperInterface {
return false;
}
char* user_cred = nullptr;
- *name_to_resolve = GetHttpProxyServer(args, &user_cred);
+ *name_to_resolve = GetHttpProxyServer(args, &user_cred);
if (*name_to_resolve == nullptr) return false;
char* no_proxy_str = nullptr;
grpc_uri* uri = grpc_uri_parse(server_uri, false /* suppress_errors */);
@@ -133,8 +133,8 @@ class HttpProxyMapper : public ProxyMapperInterface {
if (no_proxy_str != nullptr) {
static const char* NO_PROXY_SEPARATOR = ",";
bool use_proxy = true;
- TString server_host;
- TString server_port;
+ TString server_host;
+ TString server_port;
if (!grpc_core::SplitHostPort(
uri->path[0] == '/' ? uri->path + 1 : uri->path, &server_host,
&server_port)) {
@@ -144,7 +144,7 @@ class HttpProxyMapper : public ProxyMapperInterface {
server_uri);
gpr_free(no_proxy_str);
} else {
- size_t uri_len = server_host.size();
+ size_t uri_len = server_host.size();
char** no_proxy_hosts;
size_t num_no_proxy_hosts;
gpr_string_split(no_proxy_str, NO_PROXY_SEPARATOR, &no_proxy_hosts,
@@ -154,8 +154,8 @@ class HttpProxyMapper : public ProxyMapperInterface {
size_t no_proxy_len = strlen(no_proxy_entry);
if (no_proxy_len <= uri_len &&
gpr_stricmp(no_proxy_entry,
- &(server_host.c_str()[uri_len - no_proxy_len])) ==
- 0) {
+ &(server_host.c_str()[uri_len - no_proxy_len])) ==
+ 0) {
gpr_log(GPR_INFO, "not using proxy for host in no_proxy list '%s'",
server_uri);
use_proxy = false;
@@ -178,12 +178,12 @@ class HttpProxyMapper : public ProxyMapperInterface {
/* Use base64 encoding for user credentials as stated in RFC 7617 */
char* encoded_user_cred =
grpc_base64_encode(user_cred, strlen(user_cred), 0, 0);
- TString header =
- y_absl::StrCat("Proxy-Authorization:Basic ", encoded_user_cred);
+ TString header =
+ y_absl::StrCat("Proxy-Authorization:Basic ", encoded_user_cred);
gpr_free(encoded_user_cred);
args_to_add[1] = grpc_channel_arg_string_create(
- const_cast<char*>(GRPC_ARG_HTTP_CONNECT_HEADERS),
- const_cast<char*>(header.c_str()));
+ const_cast<char*>(GRPC_ARG_HTTP_CONNECT_HEADERS),
+ const_cast<char*>(header.c_str()));
*new_args = grpc_channel_args_copy_and_add(args, args_to_add, 2);
} else {
*new_args = grpc_channel_args_copy_and_add(args, args_to_add, 1);
@@ -199,10 +199,10 @@ class HttpProxyMapper : public ProxyMapperInterface {
return false;
}
- bool MapAddress(const grpc_resolved_address& /*address*/,
- const grpc_channel_args* /*args*/,
- grpc_resolved_address** /*new_address*/,
- grpc_channel_args** /*new_args*/) override {
+ bool MapAddress(const grpc_resolved_address& /*address*/,
+ const grpc_channel_args* /*args*/,
+ grpc_resolved_address** /*new_address*/,
+ grpc_channel_args** /*new_args*/) override {
return false;
}
};
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy.cc
index 5f3f0c92441..6c639ef86ce 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy.cc
@@ -33,7 +33,7 @@ DebugOnlyTraceFlag grpc_trace_lb_policy_refcount(false, "lb_policy_refcount");
LoadBalancingPolicy::LoadBalancingPolicy(Args args, intptr_t initial_refcount)
: InternallyRefCounted(&grpc_trace_lb_policy_refcount, initial_refcount),
- work_serializer_(std::move(args.work_serializer)),
+ work_serializer_(std::move(args.work_serializer)),
interested_parties_(grpc_pollset_set_create()),
channel_control_helper_(std::move(args.channel_control_helper)) {}
@@ -43,7 +43,7 @@ LoadBalancingPolicy::~LoadBalancingPolicy() {
void LoadBalancingPolicy::Orphan() {
ShutdownLocked();
- Unref(DEBUG_LOCATION, "Orphan");
+ Unref(DEBUG_LOCATION, "Orphan");
}
//
@@ -56,7 +56,7 @@ LoadBalancingPolicy::UpdateArgs::UpdateArgs(const UpdateArgs& other) {
args = grpc_channel_args_copy(other.args);
}
-LoadBalancingPolicy::UpdateArgs::UpdateArgs(UpdateArgs&& other) noexcept {
+LoadBalancingPolicy::UpdateArgs::UpdateArgs(UpdateArgs&& other) noexcept {
addresses = std::move(other.addresses);
config = std::move(other.config);
// TODO(roth): Use std::move() once channel args is converted to C++.
@@ -74,7 +74,7 @@ LoadBalancingPolicy::UpdateArgs& LoadBalancingPolicy::UpdateArgs::operator=(
}
LoadBalancingPolicy::UpdateArgs& LoadBalancingPolicy::UpdateArgs::operator=(
- UpdateArgs&& other) noexcept {
+ UpdateArgs&& other) noexcept {
addresses = std::move(other.addresses);
config = std::move(other.config);
// TODO(roth): Use std::move() once channel args is converted to C++.
@@ -98,25 +98,25 @@ LoadBalancingPolicy::PickResult LoadBalancingPolicy::QueuePicker::Pick(
// the time this function returns, the pick will already have
// been processed, and we'll be trying to re-process the same
// pick again, leading to a crash.
- // 2. We are currently running in the data plane mutex, but we
- // need to bounce into the control plane work_serializer to call
+ // 2. We are currently running in the data plane mutex, but we
+ // need to bounce into the control plane work_serializer to call
// ExitIdleLocked().
if (!exit_idle_called_) {
exit_idle_called_ = true;
- auto* parent = parent_->Ref().release(); // ref held by lambda.
- ExecCtx::Run(DEBUG_LOCATION,
- GRPC_CLOSURE_CREATE(
- [](void* arg, grpc_error* /*error*/) {
- auto* parent = static_cast<LoadBalancingPolicy*>(arg);
- parent->work_serializer()->Run(
- [parent]() {
- parent->ExitIdleLocked();
- parent->Unref();
- },
- DEBUG_LOCATION);
- },
- parent, nullptr),
- GRPC_ERROR_NONE);
+ auto* parent = parent_->Ref().release(); // ref held by lambda.
+ ExecCtx::Run(DEBUG_LOCATION,
+ GRPC_CLOSURE_CREATE(
+ [](void* arg, grpc_error* /*error*/) {
+ auto* parent = static_cast<LoadBalancingPolicy*>(arg);
+ parent->work_serializer()->Run(
+ [parent]() {
+ parent->ExitIdleLocked();
+ parent->Unref();
+ },
+ DEBUG_LOCATION);
+ },
+ parent, nullptr),
+ GRPC_ERROR_NONE);
}
PickResult result;
result.type = PickResult::PICK_QUEUE;
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy.h b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy.h
index c70b869ca3d..1cbc074484b 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy.h
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy.h
@@ -24,9 +24,9 @@
#include <functional>
#include <iterator>
-#include "y_absl/status/status.h"
-#include "y_absl/strings/string_view.h"
-
+#include "y_absl/status/status.h"
+#include "y_absl/strings/string_view.h"
+
#include "src/core/ext/filters/client_channel/server_address.h"
#include "src/core/ext/filters/client_channel/service_config.h"
#include "src/core/ext/filters/client_channel/subchannel_interface.h"
@@ -34,7 +34,7 @@
#include "src/core/lib/gprpp/orphanable.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/iomgr/polling_entity.h"
-#include "src/core/lib/iomgr/work_serializer.h"
+#include "src/core/lib/iomgr/work_serializer.h"
#include "src/core/lib/transport/connectivity_state.h"
namespace grpc_core {
@@ -74,7 +74,7 @@ extern DebugOnlyTraceFlag grpc_trace_lb_policy_refcount;
/// LoadBalacingPolicy API.
///
/// Note: All methods with a "Locked" suffix must be called from the
-/// work_serializer passed to the constructor.
+/// work_serializer passed to the constructor.
///
/// Any I/O done by the LB policy should be done under the pollset_set
/// returned by \a interested_parties().
@@ -95,11 +95,11 @@ class LoadBalancingPolicy : public InternallyRefCounted<LoadBalancingPolicy> {
/// Application-specific requests cost metrics. Metric names are
/// determined by the application. Each value is an absolute cost
/// (e.g. 3487 bytes of storage) associated with the request.
- std::map<y_absl::string_view, double, StringLess> request_cost;
+ std::map<y_absl::string_view, double, StringLess> request_cost;
/// Application-specific resource utilization metrics. Metric names
/// are determined by the application. Each value is expressed as a
/// fraction of total resources available.
- std::map<y_absl::string_view, double, StringLess> utilization;
+ std::map<y_absl::string_view, double, StringLess> utilization;
};
/// Interface for accessing per-call state.
@@ -117,17 +117,17 @@ class LoadBalancingPolicy : public InternallyRefCounted<LoadBalancingPolicy> {
/// Returns the backend metric data returned by the server for the call,
/// or null if no backend metric data was returned.
- // TODO(roth): Move this out of CallState, since it should not be
- // accessible to the picker, only to the recv_trailing_metadata_ready
- // callback. It should instead be in its own interface.
+ // TODO(roth): Move this out of CallState, since it should not be
+ // accessible to the picker, only to the recv_trailing_metadata_ready
+ // callback. It should instead be in its own interface.
virtual const BackendMetricData* GetBackendMetricData() = 0;
-
- /// EXPERIMENTAL API.
- /// Returns the value of the call attribute \a key.
- /// Keys are static strings, so an attribute can be accessed by an LB
- /// policy implementation only if it knows about the internal key.
- /// Returns a null string_view if key not found.
- virtual y_absl::string_view ExperimentalGetCallAttribute(const char* key) = 0;
+
+ /// EXPERIMENTAL API.
+ /// Returns the value of the call attribute \a key.
+ /// Keys are static strings, so an attribute can be accessed by an LB
+ /// policy implementation only if it knows about the internal key.
+ /// Returns a null string_view if key not found.
+ virtual y_absl::string_view ExperimentalGetCallAttribute(const char* key) = 0;
};
/// Interface for accessing metadata.
@@ -135,13 +135,13 @@ class LoadBalancingPolicy : public InternallyRefCounted<LoadBalancingPolicy> {
class MetadataInterface {
public:
class iterator
- : public std::iterator<
- std::input_iterator_tag,
- std::pair<y_absl::string_view, y_absl::string_view>, // value_type
- std::ptrdiff_t, // difference_type
- std::pair<y_absl::string_view, y_absl::string_view>*, // pointer
- std::pair<y_absl::string_view, y_absl::string_view>& // reference
- > {
+ : public std::iterator<
+ std::input_iterator_tag,
+ std::pair<y_absl::string_view, y_absl::string_view>, // value_type
+ std::ptrdiff_t, // difference_type
+ std::pair<y_absl::string_view, y_absl::string_view>*, // pointer
+ std::pair<y_absl::string_view, y_absl::string_view>& // reference
+ > {
public:
iterator(const MetadataInterface* md, intptr_t handle)
: md_(md), handle_(handle) {}
@@ -168,7 +168,7 @@ class LoadBalancingPolicy : public InternallyRefCounted<LoadBalancingPolicy> {
/// Implementations must ensure that the key and value remain alive
/// until the call ends. If desired, they may be allocated via
/// CallState::Alloc().
- virtual void Add(y_absl::string_view key, y_absl::string_view value) = 0;
+ virtual void Add(y_absl::string_view key, y_absl::string_view value) = 0;
/// Iteration interface.
virtual iterator begin() const = 0;
@@ -185,21 +185,21 @@ class LoadBalancingPolicy : public InternallyRefCounted<LoadBalancingPolicy> {
friend class iterator;
virtual intptr_t IteratorHandleNext(intptr_t handle) const = 0;
- virtual std::pair<y_absl::string_view /*key*/, y_absl::string_view /*value */>
+ virtual std::pair<y_absl::string_view /*key*/, y_absl::string_view /*value */>
IteratorHandleGet(intptr_t handle) const = 0;
};
/// Arguments used when picking a subchannel for a call.
struct PickArgs {
- /// The path of the call. Indicates the RPC service and method name.
- y_absl::string_view path;
+ /// The path of the call. Indicates the RPC service and method name.
+ y_absl::string_view path;
/// Initial metadata associated with the picking call.
/// The LB policy may use the existing metadata to influence its routing
/// decision, and it may add new metadata elements to be sent with the
/// call to the chosen backend.
MetadataInterface* initial_metadata;
/// An interface for accessing call state. Can be used to allocate
- /// memory associated with the call in an efficient way.
+ /// memory associated with the call in an efficient way.
CallState* call_state;
};
@@ -241,9 +241,9 @@ class LoadBalancingPolicy : public InternallyRefCounted<LoadBalancingPolicy> {
/// does not take ownership, so any data that needs to be used after
/// returning must be copied.
/// The call state can be used to obtain backend metric data.
- // TODO(roth): The arguments to this callback should be moved into a
- // struct, so that we can later add new fields without breaking
- // existing implementations.
+ // TODO(roth): The arguments to this callback should be moved into a
+ // struct, so that we can later add new fields without breaking
+ // existing implementations.
std::function<void(grpc_error*, MetadataInterface*, CallState*)>
recv_trailing_metadata_ready;
};
@@ -260,7 +260,7 @@ class LoadBalancingPolicy : public InternallyRefCounted<LoadBalancingPolicy> {
/// live in the LB policy object itself.
///
/// Currently, pickers are always accessed from within the
- /// client_channel data plane mutex, so they do not have to be
+ /// client_channel data plane mutex, so they do not have to be
/// thread-safe.
class SubchannelPicker {
public:
@@ -279,12 +279,12 @@ class LoadBalancingPolicy : public InternallyRefCounted<LoadBalancingPolicy> {
/// Creates a new subchannel with the specified channel args.
virtual RefCountedPtr<SubchannelInterface> CreateSubchannel(
- ServerAddress address, const grpc_channel_args& args) = 0;
+ ServerAddress address, const grpc_channel_args& args) = 0;
/// Sets the connectivity state and returns a new picker to be used
/// by the client channel.
virtual void UpdateState(grpc_connectivity_state state,
- const y_absl::Status& status,
+ const y_absl::Status& status,
std::unique_ptr<SubchannelPicker>) = 0;
/// Requests that the resolver re-resolve.
@@ -292,8 +292,8 @@ class LoadBalancingPolicy : public InternallyRefCounted<LoadBalancingPolicy> {
/// Adds a trace message associated with the channel.
enum TraceSeverity { TRACE_INFO, TRACE_WARNING, TRACE_ERROR };
- virtual void AddTraceEvent(TraceSeverity severity,
- y_absl::string_view message) = 0;
+ virtual void AddTraceEvent(TraceSeverity severity,
+ y_absl::string_view message) = 0;
};
/// Interface for configuration data used by an LB policy implementation.
@@ -319,15 +319,15 @@ class LoadBalancingPolicy : public InternallyRefCounted<LoadBalancingPolicy> {
UpdateArgs() = default;
~UpdateArgs() { grpc_channel_args_destroy(args); }
UpdateArgs(const UpdateArgs& other);
- UpdateArgs(UpdateArgs&& other) noexcept;
+ UpdateArgs(UpdateArgs&& other) noexcept;
UpdateArgs& operator=(const UpdateArgs& other);
- UpdateArgs& operator=(UpdateArgs&& other) noexcept;
+ UpdateArgs& operator=(UpdateArgs&& other) noexcept;
};
/// Args used to instantiate an LB policy.
struct Args {
- /// The work_serializer under which all LB policy calls will be run.
- std::shared_ptr<WorkSerializer> work_serializer;
+ /// The work_serializer under which all LB policy calls will be run.
+ std::shared_ptr<WorkSerializer> work_serializer;
/// Channel control helper.
/// Note: LB policies MUST NOT call any method on the helper from
/// their constructor.
@@ -365,7 +365,7 @@ class LoadBalancingPolicy : public InternallyRefCounted<LoadBalancingPolicy> {
grpc_pollset_set* interested_parties() const { return interested_parties_; }
- // Note: This must be invoked while holding the work_serializer.
+ // Note: This must be invoked while holding the work_serializer.
void Orphan() override;
// A picker that returns PICK_QUEUE for all picks.
@@ -398,9 +398,9 @@ class LoadBalancingPolicy : public InternallyRefCounted<LoadBalancingPolicy> {
};
protected:
- std::shared_ptr<WorkSerializer> work_serializer() const {
- return work_serializer_;
- }
+ std::shared_ptr<WorkSerializer> work_serializer() const {
+ return work_serializer_;
+ }
// Note: LB policies MUST NOT call any method on the helper from their
// constructor.
@@ -412,8 +412,8 @@ class LoadBalancingPolicy : public InternallyRefCounted<LoadBalancingPolicy> {
virtual void ShutdownLocked() = 0;
private:
- /// Work Serializer under which LB policy actions take place.
- std::shared_ptr<WorkSerializer> work_serializer_;
+ /// Work Serializer under which LB policy actions take place.
+ std::shared_ptr<WorkSerializer> work_serializer_;
/// Owned pointer to interested parties in load balancing decisions.
grpc_pollset_set* interested_parties_;
/// Channel control helper.
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/address_filtering.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/address_filtering.cc
index fbc6714f115..7f2ca801482 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/address_filtering.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/address_filtering.cc
@@ -1,96 +1,96 @@
-//
-// Copyright 2020 gRPC authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-#include <grpc/support/port_platform.h>
-
-#include "src/core/ext/filters/client_channel/lb_policy/address_filtering.h"
-
-#include "y_absl/strings/str_cat.h"
-#include "y_absl/strings/str_join.h"
-
-#include "src/core/lib/channel/channel_args.h"
-
-#define GRPC_ARG_HIERARCHICAL_PATH "grpc.internal.address.hierarchical_path"
-
-namespace grpc_core {
-
-const char* kHierarchicalPathAttributeKey = "hierarchical_path";
-
-namespace {
-
-class HierarchicalPathAttribute : public ServerAddress::AttributeInterface {
- public:
- explicit HierarchicalPathAttribute(std::vector<TString> path)
- : path_(std::move(path)) {}
-
- std::unique_ptr<AttributeInterface> Copy() const override {
- return y_absl::make_unique<HierarchicalPathAttribute>(path_);
- }
-
- int Cmp(const AttributeInterface* other) const override {
- const std::vector<TString>& other_path =
- static_cast<const HierarchicalPathAttribute*>(other)->path_;
- for (size_t i = 0; i < path_.size(); ++i) {
- if (other_path.size() == i) return 1;
- int r = path_[i].compare(other_path[i]);
- if (r != 0) return r;
- }
- if (other_path.size() > path_.size()) return -1;
- return 0;
- }
-
- TString ToString() const override {
- return y_absl::StrCat("[", y_absl::StrJoin(path_, ", "), "]");
- }
-
- const std::vector<TString>& path() const { return path_; }
-
- private:
- std::vector<TString> path_;
-};
-
-} // namespace
-
-std::unique_ptr<ServerAddress::AttributeInterface>
-MakeHierarchicalPathAttribute(std::vector<TString> path) {
- return y_absl::make_unique<HierarchicalPathAttribute>(std::move(path));
-}
-
-HierarchicalAddressMap MakeHierarchicalAddressMap(
- const ServerAddressList& addresses) {
- HierarchicalAddressMap result;
- for (const ServerAddress& address : addresses) {
- const HierarchicalPathAttribute* path_attribute =
- static_cast<const HierarchicalPathAttribute*>(
- address.GetAttribute(kHierarchicalPathAttributeKey));
- if (path_attribute == nullptr) continue;
- const std::vector<TString>& path = path_attribute->path();
- auto it = path.begin();
- ServerAddressList& target_list = result[*it];
- std::unique_ptr<HierarchicalPathAttribute> new_attribute;
- ++it;
- if (it != path.end()) {
- std::vector<TString> remaining_path(it, path.end());
- new_attribute = y_absl::make_unique<HierarchicalPathAttribute>(
- std::move(remaining_path));
- }
- target_list.emplace_back(address.WithAttribute(
- kHierarchicalPathAttributeKey, std::move(new_attribute)));
- }
- return result;
-}
-
-} // namespace grpc_core
+//
+// Copyright 2020 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/ext/filters/client_channel/lb_policy/address_filtering.h"
+
+#include "y_absl/strings/str_cat.h"
+#include "y_absl/strings/str_join.h"
+
+#include "src/core/lib/channel/channel_args.h"
+
+#define GRPC_ARG_HIERARCHICAL_PATH "grpc.internal.address.hierarchical_path"
+
+namespace grpc_core {
+
+const char* kHierarchicalPathAttributeKey = "hierarchical_path";
+
+namespace {
+
+class HierarchicalPathAttribute : public ServerAddress::AttributeInterface {
+ public:
+ explicit HierarchicalPathAttribute(std::vector<TString> path)
+ : path_(std::move(path)) {}
+
+ std::unique_ptr<AttributeInterface> Copy() const override {
+ return y_absl::make_unique<HierarchicalPathAttribute>(path_);
+ }
+
+ int Cmp(const AttributeInterface* other) const override {
+ const std::vector<TString>& other_path =
+ static_cast<const HierarchicalPathAttribute*>(other)->path_;
+ for (size_t i = 0; i < path_.size(); ++i) {
+ if (other_path.size() == i) return 1;
+ int r = path_[i].compare(other_path[i]);
+ if (r != 0) return r;
+ }
+ if (other_path.size() > path_.size()) return -1;
+ return 0;
+ }
+
+ TString ToString() const override {
+ return y_absl::StrCat("[", y_absl::StrJoin(path_, ", "), "]");
+ }
+
+ const std::vector<TString>& path() const { return path_; }
+
+ private:
+ std::vector<TString> path_;
+};
+
+} // namespace
+
+std::unique_ptr<ServerAddress::AttributeInterface>
+MakeHierarchicalPathAttribute(std::vector<TString> path) {
+ return y_absl::make_unique<HierarchicalPathAttribute>(std::move(path));
+}
+
+HierarchicalAddressMap MakeHierarchicalAddressMap(
+ const ServerAddressList& addresses) {
+ HierarchicalAddressMap result;
+ for (const ServerAddress& address : addresses) {
+ const HierarchicalPathAttribute* path_attribute =
+ static_cast<const HierarchicalPathAttribute*>(
+ address.GetAttribute(kHierarchicalPathAttributeKey));
+ if (path_attribute == nullptr) continue;
+ const std::vector<TString>& path = path_attribute->path();
+ auto it = path.begin();
+ ServerAddressList& target_list = result[*it];
+ std::unique_ptr<HierarchicalPathAttribute> new_attribute;
+ ++it;
+ if (it != path.end()) {
+ std::vector<TString> remaining_path(it, path.end());
+ new_attribute = y_absl::make_unique<HierarchicalPathAttribute>(
+ std::move(remaining_path));
+ }
+ target_list.emplace_back(address.WithAttribute(
+ kHierarchicalPathAttributeKey, std::move(new_attribute)));
+ }
+ return result;
+}
+
+} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/address_filtering.h b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/address_filtering.h
index 9ad2bee066a..79c970ce55a 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/address_filtering.h
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/address_filtering.h
@@ -1,101 +1,101 @@
-//
-// Copyright 2020 gRPC authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-#ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_ADDRESS_FILTERING_H
-#define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_ADDRESS_FILTERING_H
-
-#include <grpc/support/port_platform.h>
-
-#include <map>
-#include <util/generic/string.h>
-#include <vector>
-
-#include "src/core/ext/filters/client_channel/server_address.h"
-
-// The resolver returns a flat list of addresses. When a hierarchy of
-// LB policies is in use, each leaf of the hierarchy will need a
-// different subset of those addresses. This library provides a
-// mechanism for determining which address is passed to which leaf
-// policy.
-//
-// Each address will have an associated path that indicates which child
-// it should be sent to at each level of the hierarchy to wind up at the
-// right leaf policy. Each LB policy will look at the first element of
-// the path of each address to determine which child to send the address
-// to. It will then remove that first element when passing the address
-// down to its child.
-//
-// For example, consider the following LB policy hierarchy:
-//
-// - priority
-// - child0 (weighted_target)
-// - localityA (round_robin)
-// - localityB (round_robin)
-// - child1 (weighted_target)
-// - localityC (round_robin)
-// - localityD (round_robin)
-//
-// Now consider the following addresses:
-// - 10.0.0.1:80 path=["child0", "localityA"]
-// - 10.0.0.2:80 path=["child0", "localityB"]
-// - 10.0.0.3:80 path=["child1", "localityC"]
-// - 10.0.0.4:80 path=["child1", "localityD"]
-//
-// The priority policy will split this up into two lists, one for each
-// of its children:
-// - child0:
-// - 10.0.0.1:80 path=["localityA"]
-// - 10.0.0.2:80 path=["localityB"]
-// - child1:
-// - 10.0.0.3:80 path=["localityC"]
-// - 10.0.0.4:80 path=["localityD"]
-//
-// The weighted_target policy for child0 will split its list up into two
-// lists, one for each of its children:
-// - localityA:
-// - 10.0.0.1:80 path=[]
-// - localityB:
-// - 10.0.0.2:80 path=[]
-//
-// Similarly, the weighted_target policy for child1 will split its list
-// up into two lists, one for each of its children:
-// - localityC:
-// - 10.0.0.3:80 path=[]
-// - localityD:
-// - 10.0.0.4:80 path=[]
-
-namespace grpc_core {
-
-// The attribute key to be used for hierarchical paths in ServerAddress.
-extern const char* kHierarchicalPathAttributeKey;
-
-// Constructs an address attribute containing the hierarchical path
-// to be associated with the address.
-std::unique_ptr<ServerAddress::AttributeInterface>
-MakeHierarchicalPathAttribute(std::vector<TString> path);
-
-// A map from the next path element to the addresses that fall under
-// that path element.
-using HierarchicalAddressMap = std::map<TString, ServerAddressList>;
-
-// Splits up the addresses into a separate list for each child.
-HierarchicalAddressMap MakeHierarchicalAddressMap(
- const ServerAddressList& addresses);
-
-} // namespace grpc_core
-
-#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_ADDRESS_FILTERING_H \
- */
+//
+// Copyright 2020 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+#ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_ADDRESS_FILTERING_H
+#define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_ADDRESS_FILTERING_H
+
+#include <grpc/support/port_platform.h>
+
+#include <map>
+#include <util/generic/string.h>
+#include <vector>
+
+#include "src/core/ext/filters/client_channel/server_address.h"
+
+// The resolver returns a flat list of addresses. When a hierarchy of
+// LB policies is in use, each leaf of the hierarchy will need a
+// different subset of those addresses. This library provides a
+// mechanism for determining which address is passed to which leaf
+// policy.
+//
+// Each address will have an associated path that indicates which child
+// it should be sent to at each level of the hierarchy to wind up at the
+// right leaf policy. Each LB policy will look at the first element of
+// the path of each address to determine which child to send the address
+// to. It will then remove that first element when passing the address
+// down to its child.
+//
+// For example, consider the following LB policy hierarchy:
+//
+// - priority
+// - child0 (weighted_target)
+// - localityA (round_robin)
+// - localityB (round_robin)
+// - child1 (weighted_target)
+// - localityC (round_robin)
+// - localityD (round_robin)
+//
+// Now consider the following addresses:
+// - 10.0.0.1:80 path=["child0", "localityA"]
+// - 10.0.0.2:80 path=["child0", "localityB"]
+// - 10.0.0.3:80 path=["child1", "localityC"]
+// - 10.0.0.4:80 path=["child1", "localityD"]
+//
+// The priority policy will split this up into two lists, one for each
+// of its children:
+// - child0:
+// - 10.0.0.1:80 path=["localityA"]
+// - 10.0.0.2:80 path=["localityB"]
+// - child1:
+// - 10.0.0.3:80 path=["localityC"]
+// - 10.0.0.4:80 path=["localityD"]
+//
+// The weighted_target policy for child0 will split its list up into two
+// lists, one for each of its children:
+// - localityA:
+// - 10.0.0.1:80 path=[]
+// - localityB:
+// - 10.0.0.2:80 path=[]
+//
+// Similarly, the weighted_target policy for child1 will split its list
+// up into two lists, one for each of its children:
+// - localityC:
+// - 10.0.0.3:80 path=[]
+// - localityD:
+// - 10.0.0.4:80 path=[]
+
+namespace grpc_core {
+
+// The attribute key to be used for hierarchical paths in ServerAddress.
+extern const char* kHierarchicalPathAttributeKey;
+
+// Constructs an address attribute containing the hierarchical path
+// to be associated with the address.
+std::unique_ptr<ServerAddress::AttributeInterface>
+MakeHierarchicalPathAttribute(std::vector<TString> path);
+
+// A map from the next path element to the addresses that fall under
+// that path element.
+using HierarchicalAddressMap = std::map<TString, ServerAddressList>;
+
+// Splits up the addresses into a separate list for each child.
+HierarchicalAddressMap MakeHierarchicalAddressMap(
+ const ServerAddressList& addresses);
+
+} // namespace grpc_core
+
+#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_ADDRESS_FILTERING_H \
+ */
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/child_policy_handler.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/child_policy_handler.cc
index aa06d017c3f..b364ecf528a 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/child_policy_handler.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/child_policy_handler.cc
@@ -1,300 +1,300 @@
-//
-// Copyright 2018 gRPC authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-#include <grpc/support/port_platform.h>
-
-#include <cstring>
-
-#include "src/core/ext/filters/client_channel/lb_policy/child_policy_handler.h"
-
-#include "y_absl/strings/str_cat.h"
-
-#include "src/core/ext/filters/client_channel/lb_policy_registry.h"
-
-namespace grpc_core {
-
-//
-// ChildPolicyHandler::Helper
-//
-
-class ChildPolicyHandler::Helper
- : public LoadBalancingPolicy::ChannelControlHelper {
- public:
- explicit Helper(RefCountedPtr<ChildPolicyHandler> parent)
- : parent_(std::move(parent)) {}
-
- ~Helper() { parent_.reset(DEBUG_LOCATION, "Helper"); }
-
- RefCountedPtr<SubchannelInterface> CreateSubchannel(
- ServerAddress address, const grpc_channel_args& args) override {
- if (parent_->shutting_down_) return nullptr;
- if (!CalledByCurrentChild() && !CalledByPendingChild()) return nullptr;
- return parent_->channel_control_helper()->CreateSubchannel(
- std::move(address), args);
- }
-
- void UpdateState(grpc_connectivity_state state, const y_absl::Status& status,
- std::unique_ptr<SubchannelPicker> picker) override {
- if (parent_->shutting_down_) return;
- // If this request is from the pending child policy, ignore it until
- // it reports something other than CONNECTING, at which point we swap it
- // into place.
- if (CalledByPendingChild()) {
- if (GRPC_TRACE_FLAG_ENABLED(*(parent_->tracer_))) {
- gpr_log(GPR_INFO,
- "[child_policy_handler %p] helper %p: pending child policy %p "
- "reports state=%s (%s)",
- parent_.get(), this, child_, ConnectivityStateName(state),
- status.ToString().c_str());
- }
- if (state == GRPC_CHANNEL_CONNECTING) return;
- grpc_pollset_set_del_pollset_set(
- parent_->child_policy_->interested_parties(),
- parent_->interested_parties());
- parent_->child_policy_ = std::move(parent_->pending_child_policy_);
- } else if (!CalledByCurrentChild()) {
- // This request is from an outdated child, so ignore it.
- return;
- }
- parent_->channel_control_helper()->UpdateState(state, status,
- std::move(picker));
- }
-
- void RequestReresolution() override {
- if (parent_->shutting_down_) return;
- // Only forward re-resolution requests from the most recent child,
- // since that's the one that will be receiving any update we receive
- // from the resolver.
- const LoadBalancingPolicy* latest_child_policy =
- parent_->pending_child_policy_ != nullptr
- ? parent_->pending_child_policy_.get()
- : parent_->child_policy_.get();
- if (child_ != latest_child_policy) return;
- if (GRPC_TRACE_FLAG_ENABLED(*(parent_->tracer_))) {
- gpr_log(GPR_INFO, "[child_policy_handler %p] started name re-resolving",
- parent_.get());
- }
- parent_->channel_control_helper()->RequestReresolution();
- }
-
- void AddTraceEvent(TraceSeverity severity,
- y_absl::string_view message) override {
- if (parent_->shutting_down_) return;
- if (!CalledByPendingChild() && !CalledByCurrentChild()) return;
- parent_->channel_control_helper()->AddTraceEvent(severity, message);
- }
-
- void set_child(LoadBalancingPolicy* child) { child_ = child; }
-
- private:
- bool CalledByPendingChild() const {
- GPR_ASSERT(child_ != nullptr);
- return child_ == parent_->pending_child_policy_.get();
- }
-
- bool CalledByCurrentChild() const {
- GPR_ASSERT(child_ != nullptr);
- return child_ == parent_->child_policy_.get();
- };
-
- RefCountedPtr<ChildPolicyHandler> parent_;
- LoadBalancingPolicy* child_ = nullptr;
-};
-
-//
-// ChildPolicyHandler
-//
-
-void ChildPolicyHandler::ShutdownLocked() {
- if (GRPC_TRACE_FLAG_ENABLED(*tracer_)) {
- gpr_log(GPR_INFO, "[child_policy_handler %p] shutting down", this);
- }
- shutting_down_ = true;
- if (child_policy_ != nullptr) {
- if (GRPC_TRACE_FLAG_ENABLED(*tracer_)) {
- gpr_log(GPR_INFO, "[child_policy_handler %p] shutting down lb_policy %p",
- this, child_policy_.get());
- }
- grpc_pollset_set_del_pollset_set(child_policy_->interested_parties(),
- interested_parties());
- child_policy_.reset();
- }
- if (pending_child_policy_ != nullptr) {
- if (GRPC_TRACE_FLAG_ENABLED(*tracer_)) {
- gpr_log(GPR_INFO,
- "[child_policy_handler %p] shutting down pending lb_policy %p",
- this, pending_child_policy_.get());
- }
- grpc_pollset_set_del_pollset_set(
- pending_child_policy_->interested_parties(), interested_parties());
- pending_child_policy_.reset();
- }
-}
-
-void ChildPolicyHandler::UpdateLocked(UpdateArgs args) {
- // If the child policy name changes, we need to create a new child
- // policy. When this happens, we leave child_policy_ as-is and store
- // the new child policy in pending_child_policy_. Once the new child
- // policy transitions into state READY, we swap it into child_policy_,
- // replacing the original child policy. So pending_child_policy_ is
- // non-null only between when we apply an update that changes the child
- // policy name and when the new child reports state READY.
- //
- // Updates can arrive at any point during this transition. We always
- // apply updates relative to the most recently created child policy,
- // even if the most recent one is still in pending_child_policy_. This
- // is true both when applying the updates to an existing child policy
- // and when determining whether we need to create a new policy.
- //
- // As a result of this, there are several cases to consider here:
- //
- // 1. We have no existing child policy (i.e., this is the first update
- // we receive after being created; in this case, both child_policy_
- // and pending_child_policy_ are null). In this case, we create a
- // new child policy and store it in child_policy_.
- //
- // 2. We have an existing child policy and have no pending child policy
- // from a previous update (i.e., either there has not been a
- // previous update that changed the policy name, or we have already
- // finished swapping in the new policy; in this case, child_policy_
- // is non-null but pending_child_policy_ is null). In this case:
- // a. If going from the current config to the new config does not
- // require a new policy, then we update the existing child policy.
- // b. If going from the current config to the new config does require a
- // new policy, we create a new policy. The policy will be stored in
- // pending_child_policy_ and will later be swapped into
- // child_policy_ by the helper when the new child transitions
- // into state READY.
- //
- // 3. We have an existing child policy and have a pending child policy
- // from a previous update (i.e., a previous update set
- // pending_child_policy_ as per case 2b above and that policy has
- // not yet transitioned into state READY and been swapped into
- // child_policy_; in this case, both child_policy_ and
- // pending_child_policy_ are non-null). In this case:
- // a. If going from the current config to the new config does not
- // require a new policy, then we update the existing pending
- // child policy.
- // b. If going from the current config to the new config does require a
- // new child policy, then we create a new policy. The new
- // policy is stored in pending_child_policy_ (replacing the one
- // that was there before, which will be immediately shut down)
- // and will later be swapped into child_policy_ by the helper
- // when the new child transitions into state READY.
- const bool create_policy =
- // case 1
- child_policy_ == nullptr ||
- // cases 2b and 3b
- ConfigChangeRequiresNewPolicyInstance(current_config_.get(),
- args.config.get());
- current_config_ = args.config;
- LoadBalancingPolicy* policy_to_update = nullptr;
- if (create_policy) {
- // Cases 1, 2b, and 3b: create a new child policy.
- // If child_policy_ is null, we set it (case 1), else we set
- // pending_child_policy_ (cases 2b and 3b).
- // TODO(roth): In cases 2b and 3b, we should start a timer here, so
- // that there's an upper bound on the amount of time it takes us to
- // switch to the new policy, even if the new policy stays in
- // CONNECTING for a very long period of time.
- if (GRPC_TRACE_FLAG_ENABLED(*tracer_)) {
- gpr_log(GPR_INFO,
- "[child_policy_handler %p] creating new %schild policy %s", this,
- child_policy_ == nullptr ? "" : "pending ", args.config->name());
- }
- auto& lb_policy =
- child_policy_ == nullptr ? child_policy_ : pending_child_policy_;
- lb_policy = CreateChildPolicy(args.config->name(), *args.args);
- policy_to_update = lb_policy.get();
- } else {
- // Cases 2a and 3a: update an existing policy.
- // If we have a pending child policy, send the update to the pending
- // policy (case 3a), else send it to the current policy (case 2a).
- policy_to_update = pending_child_policy_ != nullptr
- ? pending_child_policy_.get()
- : child_policy_.get();
- }
- GPR_ASSERT(policy_to_update != nullptr);
- // Update the policy.
- if (GRPC_TRACE_FLAG_ENABLED(*tracer_)) {
- gpr_log(GPR_INFO, "[child_policy_handler %p] updating %schild policy %p",
- this,
- policy_to_update == pending_child_policy_.get() ? "pending " : "",
- policy_to_update);
- }
- policy_to_update->UpdateLocked(std::move(args));
-}
-
-void ChildPolicyHandler::ExitIdleLocked() {
- if (child_policy_ != nullptr) {
- child_policy_->ExitIdleLocked();
- if (pending_child_policy_ != nullptr) {
- pending_child_policy_->ExitIdleLocked();
- }
- }
-}
-
-void ChildPolicyHandler::ResetBackoffLocked() {
- if (child_policy_ != nullptr) {
- child_policy_->ResetBackoffLocked();
- if (pending_child_policy_ != nullptr) {
- pending_child_policy_->ResetBackoffLocked();
- }
- }
-}
-
-OrphanablePtr<LoadBalancingPolicy> ChildPolicyHandler::CreateChildPolicy(
- const char* child_policy_name, const grpc_channel_args& args) {
- Helper* helper = new Helper(Ref(DEBUG_LOCATION, "Helper"));
- LoadBalancingPolicy::Args lb_policy_args;
- lb_policy_args.work_serializer = work_serializer();
- lb_policy_args.channel_control_helper =
- std::unique_ptr<ChannelControlHelper>(helper);
- lb_policy_args.args = &args;
- OrphanablePtr<LoadBalancingPolicy> lb_policy =
- CreateLoadBalancingPolicy(child_policy_name, std::move(lb_policy_args));
- if (GPR_UNLIKELY(lb_policy == nullptr)) {
- gpr_log(GPR_ERROR, "could not create LB policy \"%s\"", child_policy_name);
- return nullptr;
- }
- helper->set_child(lb_policy.get());
- if (GRPC_TRACE_FLAG_ENABLED(*tracer_)) {
- gpr_log(GPR_INFO,
- "[child_policy_handler %p] created new LB policy \"%s\" (%p)", this,
- child_policy_name, lb_policy.get());
- }
- channel_control_helper()->AddTraceEvent(
- ChannelControlHelper::TRACE_INFO,
- y_absl::StrCat("Created new LB policy \"", child_policy_name, "\""));
- grpc_pollset_set_add_pollset_set(lb_policy->interested_parties(),
- interested_parties());
- return lb_policy;
-}
-
-bool ChildPolicyHandler::ConfigChangeRequiresNewPolicyInstance(
- LoadBalancingPolicy::Config* old_config,
- LoadBalancingPolicy::Config* new_config) const {
- return strcmp(old_config->name(), new_config->name()) != 0;
-}
-
-OrphanablePtr<LoadBalancingPolicy>
-ChildPolicyHandler::CreateLoadBalancingPolicy(
- const char* name, LoadBalancingPolicy::Args args) const {
- return LoadBalancingPolicyRegistry::CreateLoadBalancingPolicy(
- name, std::move(args));
-}
-
-} // namespace grpc_core
+//
+// Copyright 2018 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+#include <grpc/support/port_platform.h>
+
+#include <cstring>
+
+#include "src/core/ext/filters/client_channel/lb_policy/child_policy_handler.h"
+
+#include "y_absl/strings/str_cat.h"
+
+#include "src/core/ext/filters/client_channel/lb_policy_registry.h"
+
+namespace grpc_core {
+
+//
+// ChildPolicyHandler::Helper
+//
+
+class ChildPolicyHandler::Helper
+ : public LoadBalancingPolicy::ChannelControlHelper {
+ public:
+ explicit Helper(RefCountedPtr<ChildPolicyHandler> parent)
+ : parent_(std::move(parent)) {}
+
+ ~Helper() { parent_.reset(DEBUG_LOCATION, "Helper"); }
+
+ RefCountedPtr<SubchannelInterface> CreateSubchannel(
+ ServerAddress address, const grpc_channel_args& args) override {
+ if (parent_->shutting_down_) return nullptr;
+ if (!CalledByCurrentChild() && !CalledByPendingChild()) return nullptr;
+ return parent_->channel_control_helper()->CreateSubchannel(
+ std::move(address), args);
+ }
+
+ void UpdateState(grpc_connectivity_state state, const y_absl::Status& status,
+ std::unique_ptr<SubchannelPicker> picker) override {
+ if (parent_->shutting_down_) return;
+ // If this request is from the pending child policy, ignore it until
+ // it reports something other than CONNECTING, at which point we swap it
+ // into place.
+ if (CalledByPendingChild()) {
+ if (GRPC_TRACE_FLAG_ENABLED(*(parent_->tracer_))) {
+ gpr_log(GPR_INFO,
+ "[child_policy_handler %p] helper %p: pending child policy %p "
+ "reports state=%s (%s)",
+ parent_.get(), this, child_, ConnectivityStateName(state),
+ status.ToString().c_str());
+ }
+ if (state == GRPC_CHANNEL_CONNECTING) return;
+ grpc_pollset_set_del_pollset_set(
+ parent_->child_policy_->interested_parties(),
+ parent_->interested_parties());
+ parent_->child_policy_ = std::move(parent_->pending_child_policy_);
+ } else if (!CalledByCurrentChild()) {
+ // This request is from an outdated child, so ignore it.
+ return;
+ }
+ parent_->channel_control_helper()->UpdateState(state, status,
+ std::move(picker));
+ }
+
+ void RequestReresolution() override {
+ if (parent_->shutting_down_) return;
+ // Only forward re-resolution requests from the most recent child,
+ // since that's the one that will be receiving any update we receive
+ // from the resolver.
+ const LoadBalancingPolicy* latest_child_policy =
+ parent_->pending_child_policy_ != nullptr
+ ? parent_->pending_child_policy_.get()
+ : parent_->child_policy_.get();
+ if (child_ != latest_child_policy) return;
+ if (GRPC_TRACE_FLAG_ENABLED(*(parent_->tracer_))) {
+ gpr_log(GPR_INFO, "[child_policy_handler %p] started name re-resolving",
+ parent_.get());
+ }
+ parent_->channel_control_helper()->RequestReresolution();
+ }
+
+ void AddTraceEvent(TraceSeverity severity,
+ y_absl::string_view message) override {
+ if (parent_->shutting_down_) return;
+ if (!CalledByPendingChild() && !CalledByCurrentChild()) return;
+ parent_->channel_control_helper()->AddTraceEvent(severity, message);
+ }
+
+ void set_child(LoadBalancingPolicy* child) { child_ = child; }
+
+ private:
+ bool CalledByPendingChild() const {
+ GPR_ASSERT(child_ != nullptr);
+ return child_ == parent_->pending_child_policy_.get();
+ }
+
+ bool CalledByCurrentChild() const {
+ GPR_ASSERT(child_ != nullptr);
+ return child_ == parent_->child_policy_.get();
+ };
+
+ RefCountedPtr<ChildPolicyHandler> parent_;
+ LoadBalancingPolicy* child_ = nullptr;
+};
+
+//
+// ChildPolicyHandler
+//
+
+void ChildPolicyHandler::ShutdownLocked() {
+ if (GRPC_TRACE_FLAG_ENABLED(*tracer_)) {
+ gpr_log(GPR_INFO, "[child_policy_handler %p] shutting down", this);
+ }
+ shutting_down_ = true;
+ if (child_policy_ != nullptr) {
+ if (GRPC_TRACE_FLAG_ENABLED(*tracer_)) {
+ gpr_log(GPR_INFO, "[child_policy_handler %p] shutting down lb_policy %p",
+ this, child_policy_.get());
+ }
+ grpc_pollset_set_del_pollset_set(child_policy_->interested_parties(),
+ interested_parties());
+ child_policy_.reset();
+ }
+ if (pending_child_policy_ != nullptr) {
+ if (GRPC_TRACE_FLAG_ENABLED(*tracer_)) {
+ gpr_log(GPR_INFO,
+ "[child_policy_handler %p] shutting down pending lb_policy %p",
+ this, pending_child_policy_.get());
+ }
+ grpc_pollset_set_del_pollset_set(
+ pending_child_policy_->interested_parties(), interested_parties());
+ pending_child_policy_.reset();
+ }
+}
+
+void ChildPolicyHandler::UpdateLocked(UpdateArgs args) {
+ // If the child policy name changes, we need to create a new child
+ // policy. When this happens, we leave child_policy_ as-is and store
+ // the new child policy in pending_child_policy_. Once the new child
+ // policy transitions into state READY, we swap it into child_policy_,
+ // replacing the original child policy. So pending_child_policy_ is
+ // non-null only between when we apply an update that changes the child
+ // policy name and when the new child reports state READY.
+ //
+ // Updates can arrive at any point during this transition. We always
+ // apply updates relative to the most recently created child policy,
+ // even if the most recent one is still in pending_child_policy_. This
+ // is true both when applying the updates to an existing child policy
+ // and when determining whether we need to create a new policy.
+ //
+ // As a result of this, there are several cases to consider here:
+ //
+ // 1. We have no existing child policy (i.e., this is the first update
+ // we receive after being created; in this case, both child_policy_
+ // and pending_child_policy_ are null). In this case, we create a
+ // new child policy and store it in child_policy_.
+ //
+ // 2. We have an existing child policy and have no pending child policy
+ // from a previous update (i.e., either there has not been a
+ // previous update that changed the policy name, or we have already
+ // finished swapping in the new policy; in this case, child_policy_
+ // is non-null but pending_child_policy_ is null). In this case:
+ // a. If going from the current config to the new config does not
+ // require a new policy, then we update the existing child policy.
+ // b. If going from the current config to the new config does require a
+ // new policy, we create a new policy. The policy will be stored in
+ // pending_child_policy_ and will later be swapped into
+ // child_policy_ by the helper when the new child transitions
+ // into state READY.
+ //
+ // 3. We have an existing child policy and have a pending child policy
+ // from a previous update (i.e., a previous update set
+ // pending_child_policy_ as per case 2b above and that policy has
+ // not yet transitioned into state READY and been swapped into
+ // child_policy_; in this case, both child_policy_ and
+ // pending_child_policy_ are non-null). In this case:
+ // a. If going from the current config to the new config does not
+ // require a new policy, then we update the existing pending
+ // child policy.
+ // b. If going from the current config to the new config does require a
+ // new child policy, then we create a new policy. The new
+ // policy is stored in pending_child_policy_ (replacing the one
+ // that was there before, which will be immediately shut down)
+ // and will later be swapped into child_policy_ by the helper
+ // when the new child transitions into state READY.
+ const bool create_policy =
+ // case 1
+ child_policy_ == nullptr ||
+ // cases 2b and 3b
+ ConfigChangeRequiresNewPolicyInstance(current_config_.get(),
+ args.config.get());
+ current_config_ = args.config;
+ LoadBalancingPolicy* policy_to_update = nullptr;
+ if (create_policy) {
+ // Cases 1, 2b, and 3b: create a new child policy.
+ // If child_policy_ is null, we set it (case 1), else we set
+ // pending_child_policy_ (cases 2b and 3b).
+ // TODO(roth): In cases 2b and 3b, we should start a timer here, so
+ // that there's an upper bound on the amount of time it takes us to
+ // switch to the new policy, even if the new policy stays in
+ // CONNECTING for a very long period of time.
+ if (GRPC_TRACE_FLAG_ENABLED(*tracer_)) {
+ gpr_log(GPR_INFO,
+ "[child_policy_handler %p] creating new %schild policy %s", this,
+ child_policy_ == nullptr ? "" : "pending ", args.config->name());
+ }
+ auto& lb_policy =
+ child_policy_ == nullptr ? child_policy_ : pending_child_policy_;
+ lb_policy = CreateChildPolicy(args.config->name(), *args.args);
+ policy_to_update = lb_policy.get();
+ } else {
+ // Cases 2a and 3a: update an existing policy.
+ // If we have a pending child policy, send the update to the pending
+ // policy (case 3a), else send it to the current policy (case 2a).
+ policy_to_update = pending_child_policy_ != nullptr
+ ? pending_child_policy_.get()
+ : child_policy_.get();
+ }
+ GPR_ASSERT(policy_to_update != nullptr);
+ // Update the policy.
+ if (GRPC_TRACE_FLAG_ENABLED(*tracer_)) {
+ gpr_log(GPR_INFO, "[child_policy_handler %p] updating %schild policy %p",
+ this,
+ policy_to_update == pending_child_policy_.get() ? "pending " : "",
+ policy_to_update);
+ }
+ policy_to_update->UpdateLocked(std::move(args));
+}
+
+void ChildPolicyHandler::ExitIdleLocked() {
+ if (child_policy_ != nullptr) {
+ child_policy_->ExitIdleLocked();
+ if (pending_child_policy_ != nullptr) {
+ pending_child_policy_->ExitIdleLocked();
+ }
+ }
+}
+
+void ChildPolicyHandler::ResetBackoffLocked() {
+ if (child_policy_ != nullptr) {
+ child_policy_->ResetBackoffLocked();
+ if (pending_child_policy_ != nullptr) {
+ pending_child_policy_->ResetBackoffLocked();
+ }
+ }
+}
+
+OrphanablePtr<LoadBalancingPolicy> ChildPolicyHandler::CreateChildPolicy(
+ const char* child_policy_name, const grpc_channel_args& args) {
+ Helper* helper = new Helper(Ref(DEBUG_LOCATION, "Helper"));
+ LoadBalancingPolicy::Args lb_policy_args;
+ lb_policy_args.work_serializer = work_serializer();
+ lb_policy_args.channel_control_helper =
+ std::unique_ptr<ChannelControlHelper>(helper);
+ lb_policy_args.args = &args;
+ OrphanablePtr<LoadBalancingPolicy> lb_policy =
+ CreateLoadBalancingPolicy(child_policy_name, std::move(lb_policy_args));
+ if (GPR_UNLIKELY(lb_policy == nullptr)) {
+ gpr_log(GPR_ERROR, "could not create LB policy \"%s\"", child_policy_name);
+ return nullptr;
+ }
+ helper->set_child(lb_policy.get());
+ if (GRPC_TRACE_FLAG_ENABLED(*tracer_)) {
+ gpr_log(GPR_INFO,
+ "[child_policy_handler %p] created new LB policy \"%s\" (%p)", this,
+ child_policy_name, lb_policy.get());
+ }
+ channel_control_helper()->AddTraceEvent(
+ ChannelControlHelper::TRACE_INFO,
+ y_absl::StrCat("Created new LB policy \"", child_policy_name, "\""));
+ grpc_pollset_set_add_pollset_set(lb_policy->interested_parties(),
+ interested_parties());
+ return lb_policy;
+}
+
+bool ChildPolicyHandler::ConfigChangeRequiresNewPolicyInstance(
+ LoadBalancingPolicy::Config* old_config,
+ LoadBalancingPolicy::Config* new_config) const {
+ return strcmp(old_config->name(), new_config->name()) != 0;
+}
+
+OrphanablePtr<LoadBalancingPolicy>
+ChildPolicyHandler::CreateLoadBalancingPolicy(
+ const char* name, LoadBalancingPolicy::Args args) const {
+ return LoadBalancingPolicyRegistry::CreateLoadBalancingPolicy(
+ name, std::move(args));
+}
+
+} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/child_policy_handler.h b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/child_policy_handler.h
index 2583f8d5b6b..d67f3264a87 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/child_policy_handler.h
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/child_policy_handler.h
@@ -1,83 +1,83 @@
-//
-// Copyright 2018 gRPC authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-#ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_CHILD_POLICY_HANDLER_H
-#define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_CHILD_POLICY_HANDLER_H
-
-#include <grpc/support/port_platform.h>
-
-#include "src/core/ext/filters/client_channel/lb_policy.h"
-#include "src/core/lib/debug/trace.h"
-#include "src/core/lib/gprpp/orphanable.h"
-
-namespace grpc_core {
-
-// A class that makes it easy to gracefully switch child policies.
-//
-// Callers should instantiate this instead of using
-// LoadBalancingPolicyRegistry::CreateLoadBalancingPolicy(). Once
-// instantiated, this object will automatically take care of
-// constructing the child policy as needed upon receiving an update.
-class ChildPolicyHandler : public LoadBalancingPolicy {
- public:
- ChildPolicyHandler(Args args, TraceFlag* tracer)
- : LoadBalancingPolicy(std::move(args)), tracer_(tracer) {}
-
- virtual const char* name() const override { return "child_policy_handler"; }
-
- void UpdateLocked(UpdateArgs args) override;
- void ExitIdleLocked() override;
- void ResetBackoffLocked() override;
-
- // Returns true if transitioning from the old config to the new config
- // requires instantiating a new policy object.
- virtual bool ConfigChangeRequiresNewPolicyInstance(
- LoadBalancingPolicy::Config* old_config,
- LoadBalancingPolicy::Config* new_config) const;
-
- // Instantiates a new policy of the specified name.
- // May be overridden by subclasses to avoid recursion when an LB
- // policy factory returns a ChildPolicyHandler.
- virtual OrphanablePtr<LoadBalancingPolicy> CreateLoadBalancingPolicy(
- const char* name, LoadBalancingPolicy::Args args) const;
-
- private:
- class Helper;
-
- void ShutdownLocked() override;
-
- OrphanablePtr<LoadBalancingPolicy> CreateChildPolicy(
- const char* child_policy_name, const grpc_channel_args& args);
-
- // Passed in from caller at construction time.
- TraceFlag* tracer_;
-
- bool shutting_down_ = false;
-
- // The most recent config passed to UpdateLocked().
- // If pending_child_policy_ is non-null, this is the config passed to
- // pending_child_policy_; otherwise, it's the config passed to child_policy_.
- RefCountedPtr<LoadBalancingPolicy::Config> current_config_;
-
- // Child LB policy.
- OrphanablePtr<LoadBalancingPolicy> child_policy_;
- OrphanablePtr<LoadBalancingPolicy> pending_child_policy_;
-};
-
-} // namespace grpc_core
-
-#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_CHILD_POLICY_HANDLER_H \
- */
+//
+// Copyright 2018 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+#ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_CHILD_POLICY_HANDLER_H
+#define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_CHILD_POLICY_HANDLER_H
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/ext/filters/client_channel/lb_policy.h"
+#include "src/core/lib/debug/trace.h"
+#include "src/core/lib/gprpp/orphanable.h"
+
+namespace grpc_core {
+
+// A class that makes it easy to gracefully switch child policies.
+//
+// Callers should instantiate this instead of using
+// LoadBalancingPolicyRegistry::CreateLoadBalancingPolicy(). Once
+// instantiated, this object will automatically take care of
+// constructing the child policy as needed upon receiving an update.
+class ChildPolicyHandler : public LoadBalancingPolicy {
+ public:
+ ChildPolicyHandler(Args args, TraceFlag* tracer)
+ : LoadBalancingPolicy(std::move(args)), tracer_(tracer) {}
+
+ virtual const char* name() const override { return "child_policy_handler"; }
+
+ void UpdateLocked(UpdateArgs args) override;
+ void ExitIdleLocked() override;
+ void ResetBackoffLocked() override;
+
+ // Returns true if transitioning from the old config to the new config
+ // requires instantiating a new policy object.
+ virtual bool ConfigChangeRequiresNewPolicyInstance(
+ LoadBalancingPolicy::Config* old_config,
+ LoadBalancingPolicy::Config* new_config) const;
+
+ // Instantiates a new policy of the specified name.
+ // May be overridden by subclasses to avoid recursion when an LB
+ // policy factory returns a ChildPolicyHandler.
+ virtual OrphanablePtr<LoadBalancingPolicy> CreateLoadBalancingPolicy(
+ const char* name, LoadBalancingPolicy::Args args) const;
+
+ private:
+ class Helper;
+
+ void ShutdownLocked() override;
+
+ OrphanablePtr<LoadBalancingPolicy> CreateChildPolicy(
+ const char* child_policy_name, const grpc_channel_args& args);
+
+ // Passed in from caller at construction time.
+ TraceFlag* tracer_;
+
+ bool shutting_down_ = false;
+
+ // The most recent config passed to UpdateLocked().
+ // If pending_child_policy_ is non-null, this is the config passed to
+ // pending_child_policy_; otherwise, it's the config passed to child_policy_.
+ RefCountedPtr<LoadBalancingPolicy::Config> current_config_;
+
+ // Child LB policy.
+ OrphanablePtr<LoadBalancingPolicy> child_policy_;
+ OrphanablePtr<LoadBalancingPolicy> pending_child_policy_;
+};
+
+} // namespace grpc_core
+
+#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_CHILD_POLICY_HANDLER_H \
+ */
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc
index 10f3cfd7efd..ccfdb5f215a 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc
@@ -64,13 +64,13 @@
#include <limits.h>
#include <string.h>
-#include "y_absl/container/inlined_vector.h"
-#include "y_absl/strings/str_cat.h"
-#include "y_absl/strings/str_format.h"
-#include "y_absl/strings/str_join.h"
-
-#include "upb/upb.hpp"
-
+#include "y_absl/container/inlined_vector.h"
+#include "y_absl/strings/str_cat.h"
+#include "y_absl/strings/str_format.h"
+#include "y_absl/strings/str_join.h"
+
+#include "upb/upb.hpp"
+
#include <grpc/byte_buffer_reader.h>
#include <grpc/grpc.h>
#include <grpc/support/alloc.h>
@@ -78,10 +78,10 @@
#include <grpc/support/time.h>
#include "src/core/ext/filters/client_channel/client_channel.h"
-#include "src/core/ext/filters/client_channel/lb_policy/child_policy_handler.h"
+#include "src/core/ext/filters/client_channel/lb_policy/child_policy_handler.h"
#include "src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.h"
#include "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h"
-#include "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.h"
+#include "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.h"
#include "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h"
#include "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h"
#include "src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h"
@@ -97,7 +97,7 @@
#include "src/core/lib/gprpp/memory.h"
#include "src/core/lib/gprpp/orphanable.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
-#include "src/core/lib/iomgr/parse_address.h"
+#include "src/core/lib/iomgr/parse_address.h"
#include "src/core/lib/iomgr/sockaddr.h"
#include "src/core/lib/iomgr/sockaddr_utils.h"
#include "src/core/lib/iomgr/timer.h"
@@ -124,29 +124,29 @@ TraceFlag grpc_lb_glb_trace(false, "glb");
const char kGrpcLbClientStatsMetadataKey[] = "grpclb_client_stats";
const char kGrpcLbLbTokenMetadataKey[] = "lb-token";
-const char kGrpcLbAddressAttributeKey[] = "grpclb";
-
+const char kGrpcLbAddressAttributeKey[] = "grpclb";
+
namespace {
constexpr char kGrpclb[] = "grpclb";
-class GrpcLbConfig : public LoadBalancingPolicy::Config {
+class GrpcLbConfig : public LoadBalancingPolicy::Config {
public:
- GrpcLbConfig(RefCountedPtr<LoadBalancingPolicy::Config> child_policy,
- TString service_name)
- : child_policy_(std::move(child_policy)),
- service_name_(std::move(service_name)) {}
+ GrpcLbConfig(RefCountedPtr<LoadBalancingPolicy::Config> child_policy,
+ TString service_name)
+ : child_policy_(std::move(child_policy)),
+ service_name_(std::move(service_name)) {}
const char* name() const override { return kGrpclb; }
RefCountedPtr<LoadBalancingPolicy::Config> child_policy() const {
return child_policy_;
}
- const TString& service_name() const { return service_name_; }
-
+ const TString& service_name() const { return service_name_; }
+
private:
RefCountedPtr<LoadBalancingPolicy::Config> child_policy_;
- TString service_name_;
+ TString service_name_;
};
class GrpcLb : public LoadBalancingPolicy {
@@ -191,11 +191,11 @@ class GrpcLb : public LoadBalancingPolicy {
static void OnBalancerMessageReceived(void* arg, grpc_error* error);
static void OnBalancerStatusReceived(void* arg, grpc_error* error);
- void MaybeSendClientLoadReportLocked(grpc_error* error);
- void ClientLoadReportDoneLocked(grpc_error* error);
- void OnInitialRequestSentLocked();
- void OnBalancerMessageReceivedLocked();
- void OnBalancerStatusReceivedLocked(grpc_error* error);
+ void MaybeSendClientLoadReportLocked(grpc_error* error);
+ void ClientLoadReportDoneLocked(grpc_error* error);
+ void OnInitialRequestSentLocked();
+ void OnBalancerMessageReceivedLocked();
+ void OnBalancerStatusReceivedLocked(grpc_error* error);
// The owning LB policy.
RefCountedPtr<LoadBalancingPolicy> grpclb_policy_;
@@ -235,52 +235,52 @@ class GrpcLb : public LoadBalancingPolicy {
grpc_closure client_load_report_closure_;
};
- class TokenAndClientStatsAttribute
- : public ServerAddress::AttributeInterface {
- public:
- TokenAndClientStatsAttribute(TString lb_token,
- RefCountedPtr<GrpcLbClientStats> client_stats)
- : lb_token_(std::move(lb_token)),
- client_stats_(std::move(client_stats)) {}
-
- std::unique_ptr<AttributeInterface> Copy() const override {
- return y_absl::make_unique<TokenAndClientStatsAttribute>(lb_token_,
- client_stats_);
- }
-
- int Cmp(const AttributeInterface* other_base) const override {
- const TokenAndClientStatsAttribute* other =
- static_cast<const TokenAndClientStatsAttribute*>(other_base);
- int r = lb_token_.compare(other->lb_token_);
- if (r != 0) return r;
- return GPR_ICMP(client_stats_.get(), other->client_stats_.get());
- }
-
- TString ToString() const override {
- return y_absl::StrFormat("lb_token=\"%s\" client_stats=%p", lb_token_,
- client_stats_.get());
- }
-
- const TString& lb_token() const { return lb_token_; }
- GrpcLbClientStats* client_stats() const { return client_stats_.get(); }
-
- private:
- TString lb_token_;
- RefCountedPtr<GrpcLbClientStats> client_stats_;
- };
-
+ class TokenAndClientStatsAttribute
+ : public ServerAddress::AttributeInterface {
+ public:
+ TokenAndClientStatsAttribute(TString lb_token,
+ RefCountedPtr<GrpcLbClientStats> client_stats)
+ : lb_token_(std::move(lb_token)),
+ client_stats_(std::move(client_stats)) {}
+
+ std::unique_ptr<AttributeInterface> Copy() const override {
+ return y_absl::make_unique<TokenAndClientStatsAttribute>(lb_token_,
+ client_stats_);
+ }
+
+ int Cmp(const AttributeInterface* other_base) const override {
+ const TokenAndClientStatsAttribute* other =
+ static_cast<const TokenAndClientStatsAttribute*>(other_base);
+ int r = lb_token_.compare(other->lb_token_);
+ if (r != 0) return r;
+ return GPR_ICMP(client_stats_.get(), other->client_stats_.get());
+ }
+
+ TString ToString() const override {
+ return y_absl::StrFormat("lb_token=\"%s\" client_stats=%p", lb_token_,
+ client_stats_.get());
+ }
+
+ const TString& lb_token() const { return lb_token_; }
+ GrpcLbClientStats* client_stats() const { return client_stats_.get(); }
+
+ private:
+ TString lb_token_;
+ RefCountedPtr<GrpcLbClientStats> client_stats_;
+ };
+
class Serverlist : public RefCounted<Serverlist> {
public:
// Takes ownership of serverlist.
- explicit Serverlist(std::vector<GrpcLbServer> serverlist)
- : serverlist_(std::move(serverlist)) {}
+ explicit Serverlist(std::vector<GrpcLbServer> serverlist)
+ : serverlist_(std::move(serverlist)) {}
bool operator==(const Serverlist& other) const;
- const std::vector<GrpcLbServer>& serverlist() const { return serverlist_; }
+ const std::vector<GrpcLbServer>& serverlist() const { return serverlist_; }
// Returns a text representation suitable for logging.
- TString AsText() const;
+ TString AsText() const;
// Extracts all non-drop entries into a ServerAddressList.
ServerAddressList GetServerAddressList(
@@ -294,16 +294,16 @@ class GrpcLb : public LoadBalancingPolicy {
// should not be dropped.
//
// Note: This is called from the picker, so it will be invoked in
- // the channel's data plane mutex, NOT the control plane
- // work_serializer. It should not be accessed by any other part of the LB
+ // the channel's data plane mutex, NOT the control plane
+ // work_serializer. It should not be accessed by any other part of the LB
// policy.
const char* ShouldDrop();
private:
- std::vector<GrpcLbServer> serverlist_;
+ std::vector<GrpcLbServer> serverlist_;
- // Guarded by the channel's data plane mutex, NOT the control
- // plane work_serializer. It should not be accessed by anything but the
+ // Guarded by the channel's data plane mutex, NOT the control
+ // plane work_serializer. It should not be accessed by anything but the
// picker via the ShouldDrop() method.
size_t drop_index_ = 0;
};
@@ -338,49 +338,49 @@ class GrpcLb : public LoadBalancingPolicy {
: parent_(std::move(parent)) {}
RefCountedPtr<SubchannelInterface> CreateSubchannel(
- ServerAddress address, const grpc_channel_args& args) override;
- void UpdateState(grpc_connectivity_state state, const y_absl::Status& status,
+ ServerAddress address, const grpc_channel_args& args) override;
+ void UpdateState(grpc_connectivity_state state, const y_absl::Status& status,
std::unique_ptr<SubchannelPicker> picker) override;
void RequestReresolution() override;
- void AddTraceEvent(TraceSeverity severity,
- y_absl::string_view message) override;
+ void AddTraceEvent(TraceSeverity severity,
+ y_absl::string_view message) override;
+
+ private:
+ RefCountedPtr<GrpcLb> parent_;
+ };
+
+ class StateWatcher : public AsyncConnectivityStateWatcherInterface {
+ public:
+ explicit StateWatcher(RefCountedPtr<GrpcLb> parent)
+ : AsyncConnectivityStateWatcherInterface(parent->work_serializer()),
+ parent_(std::move(parent)) {}
+
+ ~StateWatcher() { parent_.reset(DEBUG_LOCATION, "StateWatcher"); }
private:
+ void OnConnectivityStateChange(grpc_connectivity_state new_state,
+ const y_absl::Status& status) override {
+ if (parent_->fallback_at_startup_checks_pending_ &&
+ new_state == GRPC_CHANNEL_TRANSIENT_FAILURE) {
+ // In TRANSIENT_FAILURE. Cancel the fallback timer and go into
+ // fallback mode immediately.
+ gpr_log(GPR_INFO,
+ "[grpclb %p] balancer channel in state:TRANSIENT_FAILURE (%s); "
+ "entering fallback mode",
+ parent_.get(), status.ToString().c_str());
+ parent_->fallback_at_startup_checks_pending_ = false;
+ grpc_timer_cancel(&parent_->lb_fallback_timer_);
+ parent_->fallback_mode_ = true;
+ parent_->CreateOrUpdateChildPolicyLocked();
+ // Cancel the watch, since we don't care about the channel state once we
+ // go into fallback mode.
+ parent_->CancelBalancerChannelConnectivityWatchLocked();
+ }
+ }
+
RefCountedPtr<GrpcLb> parent_;
};
- class StateWatcher : public AsyncConnectivityStateWatcherInterface {
- public:
- explicit StateWatcher(RefCountedPtr<GrpcLb> parent)
- : AsyncConnectivityStateWatcherInterface(parent->work_serializer()),
- parent_(std::move(parent)) {}
-
- ~StateWatcher() { parent_.reset(DEBUG_LOCATION, "StateWatcher"); }
-
- private:
- void OnConnectivityStateChange(grpc_connectivity_state new_state,
- const y_absl::Status& status) override {
- if (parent_->fallback_at_startup_checks_pending_ &&
- new_state == GRPC_CHANNEL_TRANSIENT_FAILURE) {
- // In TRANSIENT_FAILURE. Cancel the fallback timer and go into
- // fallback mode immediately.
- gpr_log(GPR_INFO,
- "[grpclb %p] balancer channel in state:TRANSIENT_FAILURE (%s); "
- "entering fallback mode",
- parent_.get(), status.ToString().c_str());
- parent_->fallback_at_startup_checks_pending_ = false;
- grpc_timer_cancel(&parent_->lb_fallback_timer_);
- parent_->fallback_mode_ = true;
- parent_->CreateOrUpdateChildPolicyLocked();
- // Cancel the watch, since we don't care about the channel state once we
- // go into fallback mode.
- parent_->CancelBalancerChannelConnectivityWatchLocked();
- }
- }
-
- RefCountedPtr<GrpcLb> parent_;
- };
-
~GrpcLb();
void ShutdownLocked() override;
@@ -388,33 +388,33 @@ class GrpcLb : public LoadBalancingPolicy {
// Helper functions used in UpdateLocked().
void ProcessAddressesAndChannelArgsLocked(const ServerAddressList& addresses,
const grpc_channel_args& args);
- static ServerAddressList AddNullLbTokenToAddresses(
- const ServerAddressList& addresses);
-
+ static ServerAddressList AddNullLbTokenToAddresses(
+ const ServerAddressList& addresses);
+
void CancelBalancerChannelConnectivityWatchLocked();
// Methods for dealing with fallback state.
void MaybeEnterFallbackModeAfterStartup();
static void OnFallbackTimer(void* arg, grpc_error* error);
- void OnFallbackTimerLocked(grpc_error* error);
+ void OnFallbackTimerLocked(grpc_error* error);
// Methods for dealing with the balancer call.
void StartBalancerCallLocked();
void StartBalancerCallRetryTimerLocked();
static void OnBalancerCallRetryTimer(void* arg, grpc_error* error);
- void OnBalancerCallRetryTimerLocked(grpc_error* error);
+ void OnBalancerCallRetryTimerLocked(grpc_error* error);
// Methods for dealing with the child policy.
grpc_channel_args* CreateChildPolicyArgsLocked(
bool is_backend_from_grpclb_load_balancer);
OrphanablePtr<LoadBalancingPolicy> CreateChildPolicyLocked(
- const grpc_channel_args* args);
+ const grpc_channel_args* args);
void CreateOrUpdateChildPolicyLocked();
// Who the client is trying to communicate with.
const char* server_name_ = nullptr;
- // Configurations for the policy.
- RefCountedPtr<GrpcLbConfig> config_;
+ // Configurations for the policy.
+ RefCountedPtr<GrpcLbConfig> config_;
// Current channel args from the resolver.
grpc_channel_args* args_ = nullptr;
@@ -424,11 +424,11 @@ class GrpcLb : public LoadBalancingPolicy {
// The channel for communicating with the LB server.
grpc_channel* lb_channel_ = nullptr;
- StateWatcher* watcher_ = nullptr;
+ StateWatcher* watcher_ = nullptr;
// Response generator to inject address updates into lb_channel_.
RefCountedPtr<FakeResolverResponseGenerator> response_generator_;
- // Parent channelz node.
- RefCountedPtr<channelz::ChannelNode> parent_channelz_node_;
+ // Parent channelz node.
+ RefCountedPtr<channelz::ChannelNode> parent_channelz_node_;
// The data associated with the current LB call. It holds a ref to this LB
// policy. It's initialized every time we query for backends. It's reset to
@@ -471,64 +471,64 @@ class GrpcLb : public LoadBalancingPolicy {
//
bool GrpcLb::Serverlist::operator==(const Serverlist& other) const {
- return serverlist_ == other.serverlist_;
+ return serverlist_ == other.serverlist_;
}
-void ParseServer(const GrpcLbServer& server, grpc_resolved_address* addr) {
+void ParseServer(const GrpcLbServer& server, grpc_resolved_address* addr) {
memset(addr, 0, sizeof(*addr));
- if (server.drop) return;
- const uint16_t netorder_port = grpc_htons((uint16_t)server.port);
+ if (server.drop) return;
+ const uint16_t netorder_port = grpc_htons((uint16_t)server.port);
/* the addresses are given in binary format (a in(6)_addr struct) in
* server->ip_address.bytes. */
- if (server.ip_size == 4) {
+ if (server.ip_size == 4) {
addr->len = static_cast<socklen_t>(sizeof(grpc_sockaddr_in));
grpc_sockaddr_in* addr4 = reinterpret_cast<grpc_sockaddr_in*>(&addr->addr);
addr4->sin_family = GRPC_AF_INET;
- memcpy(&addr4->sin_addr, server.ip_addr, server.ip_size);
+ memcpy(&addr4->sin_addr, server.ip_addr, server.ip_size);
addr4->sin_port = netorder_port;
- } else if (server.ip_size == 16) {
+ } else if (server.ip_size == 16) {
addr->len = static_cast<socklen_t>(sizeof(grpc_sockaddr_in6));
grpc_sockaddr_in6* addr6 = (grpc_sockaddr_in6*)&addr->addr;
addr6->sin6_family = GRPC_AF_INET6;
- memcpy(&addr6->sin6_addr, server.ip_addr, server.ip_size);
+ memcpy(&addr6->sin6_addr, server.ip_addr, server.ip_size);
addr6->sin6_port = netorder_port;
}
}
-TString GrpcLb::Serverlist::AsText() const {
- std::vector<TString> entries;
- for (size_t i = 0; i < serverlist_.size(); ++i) {
- const GrpcLbServer& server = serverlist_[i];
- TString ipport;
- if (server.drop) {
- ipport = "(drop)";
+TString GrpcLb::Serverlist::AsText() const {
+ std::vector<TString> entries;
+ for (size_t i = 0; i < serverlist_.size(); ++i) {
+ const GrpcLbServer& server = serverlist_[i];
+ TString ipport;
+ if (server.drop) {
+ ipport = "(drop)";
} else {
grpc_resolved_address addr;
ParseServer(server, &addr);
- ipport = grpc_sockaddr_to_string(&addr, false);
+ ipport = grpc_sockaddr_to_string(&addr, false);
}
- entries.push_back(y_absl::StrFormat(" %" PRIuPTR ": %s token=%s\n", i,
- ipport, server.load_balance_token));
+ entries.push_back(y_absl::StrFormat(" %" PRIuPTR ": %s token=%s\n", i,
+ ipport, server.load_balance_token));
}
- return y_absl::StrJoin(entries, "");
+ return y_absl::StrJoin(entries, "");
}
-bool IsServerValid(const GrpcLbServer& server, size_t idx, bool log) {
- if (server.drop) return false;
- if (GPR_UNLIKELY(server.port >> 16 != 0)) {
+bool IsServerValid(const GrpcLbServer& server, size_t idx, bool log) {
+ if (server.drop) return false;
+ if (GPR_UNLIKELY(server.port >> 16 != 0)) {
if (log) {
gpr_log(GPR_ERROR,
"Invalid port '%d' at index %lu of serverlist. Ignoring.",
- server.port, (unsigned long)idx);
+ server.port, (unsigned long)idx);
}
return false;
}
- if (GPR_UNLIKELY(server.ip_size != 4 && server.ip_size != 16)) {
+ if (GPR_UNLIKELY(server.ip_size != 4 && server.ip_size != 16)) {
if (log) {
gpr_log(GPR_ERROR,
"Expected IP to be 4 or 16 bytes, got %d at index %lu of "
"serverlist. Ignoring",
- server.ip_size, (unsigned long)idx);
+ server.ip_size, (unsigned long)idx);
}
return false;
}
@@ -538,50 +538,50 @@ bool IsServerValid(const GrpcLbServer& server, size_t idx, bool log) {
// Returns addresses extracted from the serverlist.
ServerAddressList GrpcLb::Serverlist::GetServerAddressList(
GrpcLbClientStats* client_stats) const {
- RefCountedPtr<GrpcLbClientStats> stats;
- if (client_stats != nullptr) stats = client_stats->Ref();
+ RefCountedPtr<GrpcLbClientStats> stats;
+ if (client_stats != nullptr) stats = client_stats->Ref();
ServerAddressList addresses;
- for (size_t i = 0; i < serverlist_.size(); ++i) {
- const GrpcLbServer& server = serverlist_[i];
- if (!IsServerValid(server, i, false)) continue;
+ for (size_t i = 0; i < serverlist_.size(); ++i) {
+ const GrpcLbServer& server = serverlist_[i];
+ if (!IsServerValid(server, i, false)) continue;
// Address processing.
grpc_resolved_address addr;
ParseServer(server, &addr);
// LB token processing.
- const size_t lb_token_length = strnlen(
- server.load_balance_token, GPR_ARRAY_SIZE(server.load_balance_token));
- TString lb_token(server.load_balance_token, lb_token_length);
- if (lb_token.empty()) {
+ const size_t lb_token_length = strnlen(
+ server.load_balance_token, GPR_ARRAY_SIZE(server.load_balance_token));
+ TString lb_token(server.load_balance_token, lb_token_length);
+ if (lb_token.empty()) {
gpr_log(GPR_INFO,
"Missing LB token for backend address '%s'. The empty token will "
"be used instead",
- grpc_sockaddr_to_uri(&addr).c_str());
+ grpc_sockaddr_to_uri(&addr).c_str());
}
- // Attach attribute to address containing LB token and stats object.
- std::map<const char*, std::unique_ptr<ServerAddress::AttributeInterface>>
- attributes;
- attributes[kGrpcLbAddressAttributeKey] =
- y_absl::make_unique<TokenAndClientStatsAttribute>(std::move(lb_token),
- stats);
+ // Attach attribute to address containing LB token and stats object.
+ std::map<const char*, std::unique_ptr<ServerAddress::AttributeInterface>>
+ attributes;
+ attributes[kGrpcLbAddressAttributeKey] =
+ y_absl::make_unique<TokenAndClientStatsAttribute>(std::move(lb_token),
+ stats);
// Add address.
- addresses.emplace_back(addr, /*args=*/nullptr, std::move(attributes));
+ addresses.emplace_back(addr, /*args=*/nullptr, std::move(attributes));
}
return addresses;
}
bool GrpcLb::Serverlist::ContainsAllDropEntries() const {
- if (serverlist_.empty()) return false;
- for (const GrpcLbServer& server : serverlist_) {
- if (!server.drop) return false;
+ if (serverlist_.empty()) return false;
+ for (const GrpcLbServer& server : serverlist_) {
+ if (!server.drop) return false;
}
return true;
}
const char* GrpcLb::Serverlist::ShouldDrop() {
- if (serverlist_.empty()) return nullptr;
- GrpcLbServer& server = serverlist_[drop_index_];
- drop_index_ = (drop_index_ + 1) % serverlist_.size();
- return server.drop ? server.load_balance_token : nullptr;
+ if (serverlist_.empty()) return nullptr;
+ GrpcLbServer& server = serverlist_[drop_index_];
+ drop_index_ = (drop_index_ + 1) % serverlist_.size();
+ return server.drop ? server.load_balance_token : nullptr;
}
//
@@ -609,36 +609,36 @@ GrpcLb::PickResult GrpcLb::Picker::Pick(PickArgs args) {
// If pick succeeded, add LB token to initial metadata.
if (result.type == PickResult::PICK_COMPLETE &&
result.subchannel != nullptr) {
- const TokenAndClientStatsAttribute* attribute =
- static_cast<const TokenAndClientStatsAttribute*>(
- result.subchannel->GetAttribute(kGrpcLbAddressAttributeKey));
- if (attribute == nullptr) {
- gpr_log(GPR_ERROR, "[grpclb %p picker %p] No LB token for subchannel %p",
- parent_, this, result.subchannel.get());
- abort();
- }
+ const TokenAndClientStatsAttribute* attribute =
+ static_cast<const TokenAndClientStatsAttribute*>(
+ result.subchannel->GetAttribute(kGrpcLbAddressAttributeKey));
+ if (attribute == nullptr) {
+ gpr_log(GPR_ERROR, "[grpclb %p picker %p] No LB token for subchannel %p",
+ parent_, this, result.subchannel.get());
+ abort();
+ }
// Encode client stats object into metadata for use by
// client_load_reporting filter.
- GrpcLbClientStats* client_stats = attribute->client_stats();
- if (client_stats != nullptr) {
+ GrpcLbClientStats* client_stats = attribute->client_stats();
+ if (client_stats != nullptr) {
client_stats->Ref().release(); // Ref passed via metadata.
// The metadata value is a hack: we pretend the pointer points to
// a string and rely on the client_load_reporting filter to know
// how to interpret it.
args.initial_metadata->Add(
kGrpcLbClientStatsMetadataKey,
- y_absl::string_view(reinterpret_cast<const char*>(client_stats), 0));
+ y_absl::string_view(reinterpret_cast<const char*>(client_stats), 0));
// Update calls-started.
client_stats->AddCallStarted();
}
// Encode the LB token in metadata.
- // Create a new copy on the call arena, since the subchannel list
- // may get refreshed between when we return this pick and when the
- // initial metadata goes out on the wire.
- char* lb_token = static_cast<char*>(
- args.call_state->Alloc(attribute->lb_token().size() + 1));
- strcpy(lb_token, attribute->lb_token().c_str());
- args.initial_metadata->Add(kGrpcLbLbTokenMetadataKey, lb_token);
+ // Create a new copy on the call arena, since the subchannel list
+ // may get refreshed between when we return this pick and when the
+ // initial metadata goes out on the wire.
+ char* lb_token = static_cast<char*>(
+ args.call_state->Alloc(attribute->lb_token().size() + 1));
+ strcpy(lb_token, attribute->lb_token().c_str());
+ args.initial_metadata->Add(kGrpcLbLbTokenMetadataKey, lb_token);
}
return result;
}
@@ -648,14 +648,14 @@ GrpcLb::PickResult GrpcLb::Picker::Pick(PickArgs args) {
//
RefCountedPtr<SubchannelInterface> GrpcLb::Helper::CreateSubchannel(
- ServerAddress address, const grpc_channel_args& args) {
- if (parent_->shutting_down_) return nullptr;
- return parent_->channel_control_helper()->CreateSubchannel(std::move(address),
- args);
+ ServerAddress address, const grpc_channel_args& args) {
+ if (parent_->shutting_down_) return nullptr;
+ return parent_->channel_control_helper()->CreateSubchannel(std::move(address),
+ args);
}
void GrpcLb::Helper::UpdateState(grpc_connectivity_state state,
- const y_absl::Status& status,
+ const y_absl::Status& status,
std::unique_ptr<SubchannelPicker> picker) {
if (parent_->shutting_down_) return;
// Record whether child policy reports READY.
@@ -686,22 +686,22 @@ void GrpcLb::Helper::UpdateState(grpc_connectivity_state state,
state != GRPC_CHANNEL_READY)) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_glb_trace)) {
gpr_log(GPR_INFO,
- "[grpclb %p helper %p] state=%s (%s) passing "
- "child picker %p as-is",
- parent_.get(), this, ConnectivityStateName(state),
- status.ToString().c_str(), picker.get());
+ "[grpclb %p helper %p] state=%s (%s) passing "
+ "child picker %p as-is",
+ parent_.get(), this, ConnectivityStateName(state),
+ status.ToString().c_str(), picker.get());
}
- parent_->channel_control_helper()->UpdateState(state, status,
- std::move(picker));
+ parent_->channel_control_helper()->UpdateState(state, status,
+ std::move(picker));
return;
}
// Cases 2 and 3a: wrap picker from the child in our own picker.
if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_glb_trace)) {
- gpr_log(GPR_INFO,
- "[grpclb %p helper %p] state=%s (%s) wrapping child "
- "picker %p",
- parent_.get(), this, ConnectivityStateName(state),
- status.ToString().c_str(), picker.get());
+ gpr_log(GPR_INFO,
+ "[grpclb %p helper %p] state=%s (%s) wrapping child "
+ "picker %p",
+ parent_.get(), this, ConnectivityStateName(state),
+ status.ToString().c_str(), picker.get());
}
RefCountedPtr<GrpcLbClientStats> client_stats;
if (parent_->lb_calld_ != nullptr &&
@@ -709,8 +709,8 @@ void GrpcLb::Helper::UpdateState(grpc_connectivity_state state,
client_stats = parent_->lb_calld_->client_stats()->Ref();
}
parent_->channel_control_helper()->UpdateState(
- state, status,
- y_absl::make_unique<Picker>(parent_.get(), parent_->serverlist_,
+ state, status,
+ y_absl::make_unique<Picker>(parent_.get(), parent_->serverlist_,
std::move(picker), std::move(client_stats)));
}
@@ -726,9 +726,9 @@ void GrpcLb::Helper::RequestReresolution() {
}
}
-void GrpcLb::Helper::AddTraceEvent(TraceSeverity severity,
- y_absl::string_view message) {
- if (parent_->shutting_down_) return;
+void GrpcLb::Helper::AddTraceEvent(TraceSeverity severity,
+ y_absl::string_view message) {
+ if (parent_->shutting_down_) return;
parent_->channel_control_helper()->AddTraceEvent(severity, message);
}
@@ -747,15 +747,15 @@ GrpcLb::BalancerCallState::BalancerCallState(
// the polling entities from client_channel.
GPR_ASSERT(grpclb_policy()->server_name_ != nullptr);
GPR_ASSERT(grpclb_policy()->server_name_[0] != '\0');
- // Closure Initialization
- GRPC_CLOSURE_INIT(&lb_on_initial_request_sent_, OnInitialRequestSent, this,
- grpc_schedule_on_exec_ctx);
- GRPC_CLOSURE_INIT(&lb_on_balancer_message_received_,
- OnBalancerMessageReceived, this, grpc_schedule_on_exec_ctx);
- GRPC_CLOSURE_INIT(&lb_on_balancer_status_received_, OnBalancerStatusReceived,
- this, grpc_schedule_on_exec_ctx);
- GRPC_CLOSURE_INIT(&client_load_report_closure_, MaybeSendClientLoadReport,
- this, grpc_schedule_on_exec_ctx);
+ // Closure Initialization
+ GRPC_CLOSURE_INIT(&lb_on_initial_request_sent_, OnInitialRequestSent, this,
+ grpc_schedule_on_exec_ctx);
+ GRPC_CLOSURE_INIT(&lb_on_balancer_message_received_,
+ OnBalancerMessageReceived, this, grpc_schedule_on_exec_ctx);
+ GRPC_CLOSURE_INIT(&lb_on_balancer_status_received_, OnBalancerStatusReceived,
+ this, grpc_schedule_on_exec_ctx);
+ GRPC_CLOSURE_INIT(&client_load_report_closure_, MaybeSendClientLoadReport,
+ this, grpc_schedule_on_exec_ctx);
const grpc_millis deadline =
grpclb_policy()->lb_call_timeout_ms_ == 0
? GRPC_MILLIS_INF_FUTURE
@@ -767,11 +767,11 @@ GrpcLb::BalancerCallState::BalancerCallState(
nullptr, deadline, nullptr);
// Init the LB call request payload.
upb::Arena arena;
- grpc_slice request_payload_slice = GrpcLbRequestCreate(
- grpclb_policy()->config_->service_name().empty()
- ? grpclb_policy()->server_name_
- : grpclb_policy()->config_->service_name().c_str(),
- arena.ptr());
+ grpc_slice request_payload_slice = GrpcLbRequestCreate(
+ grpclb_policy()->config_->service_name().empty()
+ ? grpclb_policy()->server_name_
+ : grpclb_policy()->config_->service_name().c_str(),
+ arena.ptr());
send_message_payload_ =
grpc_raw_byte_buffer_create(&request_payload_slice, 1);
grpc_slice_unref_internal(request_payload_slice);
@@ -796,7 +796,7 @@ void GrpcLb::BalancerCallState::Orphan() {
// lb_on_balancer_status_received_ will complete the cancellation and clean
// up. Otherwise, we are here because grpclb_policy has to orphan a failed
// call, then the following cancellation will be a no-op.
- grpc_call_cancel_internal(lb_call_);
+ grpc_call_cancel_internal(lb_call_);
if (client_load_report_timer_callback_pending_) {
grpc_timer_cancel(&client_load_report_timer_);
}
@@ -891,48 +891,48 @@ void GrpcLb::BalancerCallState::ScheduleNextClientLoadReportLocked() {
void GrpcLb::BalancerCallState::MaybeSendClientLoadReport(void* arg,
grpc_error* error) {
BalancerCallState* lb_calld = static_cast<BalancerCallState*>(arg);
- GRPC_ERROR_REF(error); // ref owned by lambda
- lb_calld->grpclb_policy()->work_serializer()->Run(
- [lb_calld, error]() { lb_calld->MaybeSendClientLoadReportLocked(error); },
- DEBUG_LOCATION);
+ GRPC_ERROR_REF(error); // ref owned by lambda
+ lb_calld->grpclb_policy()->work_serializer()->Run(
+ [lb_calld, error]() { lb_calld->MaybeSendClientLoadReportLocked(error); },
+ DEBUG_LOCATION);
}
void GrpcLb::BalancerCallState::MaybeSendClientLoadReportLocked(
- grpc_error* error) {
- client_load_report_timer_callback_pending_ = false;
- if (error != GRPC_ERROR_NONE || this != grpclb_policy()->lb_calld_.get()) {
- Unref(DEBUG_LOCATION, "client_load_report");
- GRPC_ERROR_UNREF(error);
+ grpc_error* error) {
+ client_load_report_timer_callback_pending_ = false;
+ if (error != GRPC_ERROR_NONE || this != grpclb_policy()->lb_calld_.get()) {
+ Unref(DEBUG_LOCATION, "client_load_report");
+ GRPC_ERROR_UNREF(error);
return;
}
// If we've already sent the initial request, then we can go ahead and send
// the load report. Otherwise, we need to wait until the initial request has
// been sent to send this (see OnInitialRequestSentLocked()).
- if (send_message_payload_ == nullptr) {
- SendClientLoadReportLocked();
+ if (send_message_payload_ == nullptr) {
+ SendClientLoadReportLocked();
} else {
- client_load_report_is_due_ = true;
+ client_load_report_is_due_ = true;
}
}
void GrpcLb::BalancerCallState::SendClientLoadReportLocked() {
// Construct message payload.
GPR_ASSERT(send_message_payload_ == nullptr);
- // Get snapshot of stats.
- int64_t num_calls_started;
- int64_t num_calls_finished;
- int64_t num_calls_finished_with_client_failed_to_send;
- int64_t num_calls_finished_known_received;
- std::unique_ptr<GrpcLbClientStats::DroppedCallCounts> drop_token_counts;
- client_stats_->Get(&num_calls_started, &num_calls_finished,
- &num_calls_finished_with_client_failed_to_send,
- &num_calls_finished_known_received, &drop_token_counts);
+ // Get snapshot of stats.
+ int64_t num_calls_started;
+ int64_t num_calls_finished;
+ int64_t num_calls_finished_with_client_failed_to_send;
+ int64_t num_calls_finished_known_received;
+ std::unique_ptr<GrpcLbClientStats::DroppedCallCounts> drop_token_counts;
+ client_stats_->Get(&num_calls_started, &num_calls_finished,
+ &num_calls_finished_with_client_failed_to_send,
+ &num_calls_finished_known_received, &drop_token_counts);
// Skip client load report if the counters were all zero in the last
// report and they are still zero in this one.
- if (num_calls_started == 0 && num_calls_finished == 0 &&
- num_calls_finished_with_client_failed_to_send == 0 &&
- num_calls_finished_known_received == 0 &&
- (drop_token_counts == nullptr || drop_token_counts->size() == 0)) {
+ if (num_calls_started == 0 && num_calls_finished == 0 &&
+ num_calls_finished_with_client_failed_to_send == 0 &&
+ num_calls_finished_known_received == 0 &&
+ (drop_token_counts == nullptr || drop_token_counts->size() == 0)) {
if (last_client_load_report_counters_were_zero_) {
ScheduleNextClientLoadReportLocked();
return;
@@ -941,12 +941,12 @@ void GrpcLb::BalancerCallState::SendClientLoadReportLocked() {
} else {
last_client_load_report_counters_were_zero_ = false;
}
- // Populate load report.
- upb::Arena arena;
- grpc_slice request_payload_slice = GrpcLbLoadReportRequestCreate(
- num_calls_started, num_calls_finished,
- num_calls_finished_with_client_failed_to_send,
- num_calls_finished_known_received, drop_token_counts.get(), arena.ptr());
+ // Populate load report.
+ upb::Arena arena;
+ grpc_slice request_payload_slice = GrpcLbLoadReportRequestCreate(
+ num_calls_started, num_calls_finished,
+ num_calls_finished_with_client_failed_to_send,
+ num_calls_finished_known_received, drop_token_counts.get(), arena.ptr());
send_message_payload_ =
grpc_raw_byte_buffer_create(&request_payload_slice, 1);
grpc_slice_unref_internal(request_payload_slice);
@@ -970,275 +970,275 @@ void GrpcLb::BalancerCallState::SendClientLoadReportLocked() {
void GrpcLb::BalancerCallState::ClientLoadReportDone(void* arg,
grpc_error* error) {
BalancerCallState* lb_calld = static_cast<BalancerCallState*>(arg);
- GRPC_ERROR_REF(error); // ref owned by lambda
- lb_calld->grpclb_policy()->work_serializer()->Run(
- [lb_calld, error]() { lb_calld->ClientLoadReportDoneLocked(error); },
- DEBUG_LOCATION);
+ GRPC_ERROR_REF(error); // ref owned by lambda
+ lb_calld->grpclb_policy()->work_serializer()->Run(
+ [lb_calld, error]() { lb_calld->ClientLoadReportDoneLocked(error); },
+ DEBUG_LOCATION);
}
-void GrpcLb::BalancerCallState::ClientLoadReportDoneLocked(grpc_error* error) {
- grpc_byte_buffer_destroy(send_message_payload_);
- send_message_payload_ = nullptr;
- if (error != GRPC_ERROR_NONE || this != grpclb_policy()->lb_calld_.get()) {
- Unref(DEBUG_LOCATION, "client_load_report");
- GRPC_ERROR_UNREF(error);
+void GrpcLb::BalancerCallState::ClientLoadReportDoneLocked(grpc_error* error) {
+ grpc_byte_buffer_destroy(send_message_payload_);
+ send_message_payload_ = nullptr;
+ if (error != GRPC_ERROR_NONE || this != grpclb_policy()->lb_calld_.get()) {
+ Unref(DEBUG_LOCATION, "client_load_report");
+ GRPC_ERROR_UNREF(error);
return;
}
- ScheduleNextClientLoadReportLocked();
+ ScheduleNextClientLoadReportLocked();
}
void GrpcLb::BalancerCallState::OnInitialRequestSent(void* arg,
- grpc_error* /*error*/) {
+ grpc_error* /*error*/) {
BalancerCallState* lb_calld = static_cast<BalancerCallState*>(arg);
- lb_calld->grpclb_policy()->work_serializer()->Run(
- [lb_calld]() { lb_calld->OnInitialRequestSentLocked(); }, DEBUG_LOCATION);
+ lb_calld->grpclb_policy()->work_serializer()->Run(
+ [lb_calld]() { lb_calld->OnInitialRequestSentLocked(); }, DEBUG_LOCATION);
}
-void GrpcLb::BalancerCallState::OnInitialRequestSentLocked() {
- grpc_byte_buffer_destroy(send_message_payload_);
- send_message_payload_ = nullptr;
+void GrpcLb::BalancerCallState::OnInitialRequestSentLocked() {
+ grpc_byte_buffer_destroy(send_message_payload_);
+ send_message_payload_ = nullptr;
// If we attempted to send a client load report before the initial request was
// sent (and this lb_calld is still in use), send the load report now.
- if (client_load_report_is_due_ && this == grpclb_policy()->lb_calld_.get()) {
- SendClientLoadReportLocked();
- client_load_report_is_due_ = false;
+ if (client_load_report_is_due_ && this == grpclb_policy()->lb_calld_.get()) {
+ SendClientLoadReportLocked();
+ client_load_report_is_due_ = false;
}
- Unref(DEBUG_LOCATION, "on_initial_request_sent");
+ Unref(DEBUG_LOCATION, "on_initial_request_sent");
}
-void GrpcLb::BalancerCallState::OnBalancerMessageReceived(
- void* arg, grpc_error* /*error*/) {
+void GrpcLb::BalancerCallState::OnBalancerMessageReceived(
+ void* arg, grpc_error* /*error*/) {
BalancerCallState* lb_calld = static_cast<BalancerCallState*>(arg);
- lb_calld->grpclb_policy()->work_serializer()->Run(
- [lb_calld]() { lb_calld->OnBalancerMessageReceivedLocked(); },
- DEBUG_LOCATION);
+ lb_calld->grpclb_policy()->work_serializer()->Run(
+ [lb_calld]() { lb_calld->OnBalancerMessageReceivedLocked(); },
+ DEBUG_LOCATION);
}
-void GrpcLb::BalancerCallState::OnBalancerMessageReceivedLocked() {
+void GrpcLb::BalancerCallState::OnBalancerMessageReceivedLocked() {
// Null payload means the LB call was cancelled.
- if (this != grpclb_policy()->lb_calld_.get() ||
- recv_message_payload_ == nullptr) {
- Unref(DEBUG_LOCATION, "on_message_received");
+ if (this != grpclb_policy()->lb_calld_.get() ||
+ recv_message_payload_ == nullptr) {
+ Unref(DEBUG_LOCATION, "on_message_received");
return;
}
grpc_byte_buffer_reader bbr;
- grpc_byte_buffer_reader_init(&bbr, recv_message_payload_);
+ grpc_byte_buffer_reader_init(&bbr, recv_message_payload_);
grpc_slice response_slice = grpc_byte_buffer_reader_readall(&bbr);
grpc_byte_buffer_reader_destroy(&bbr);
- grpc_byte_buffer_destroy(recv_message_payload_);
- recv_message_payload_ = nullptr;
- GrpcLbResponse response;
+ grpc_byte_buffer_destroy(recv_message_payload_);
+ recv_message_payload_ = nullptr;
+ GrpcLbResponse response;
upb::Arena arena;
- if (!GrpcLbResponseParse(response_slice, arena.ptr(), &response) ||
- (response.type == response.INITIAL && seen_initial_response_)) {
+ if (!GrpcLbResponseParse(response_slice, arena.ptr(), &response) ||
+ (response.type == response.INITIAL && seen_initial_response_)) {
char* response_slice_str =
grpc_dump_slice(response_slice, GPR_DUMP_ASCII | GPR_DUMP_HEX);
gpr_log(GPR_ERROR,
"[grpclb %p] lb_calld=%p: Invalid LB response received: '%s'. "
"Ignoring.",
- grpclb_policy(), this, response_slice_str);
+ grpclb_policy(), this, response_slice_str);
gpr_free(response_slice_str);
- } else {
- switch (response.type) {
- case response.INITIAL: {
- if (response.client_stats_report_interval != 0) {
- client_stats_report_interval_ =
- GPR_MAX(GPR_MS_PER_SEC, response.client_stats_report_interval);
- if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_glb_trace)) {
- gpr_log(GPR_INFO,
- "[grpclb %p] lb_calld=%p: Received initial LB response "
- "message; client load reporting interval = %" PRId64
- " milliseconds",
- grpclb_policy(), this, client_stats_report_interval_);
- }
- } else if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_glb_trace)) {
- gpr_log(GPR_INFO,
- "[grpclb %p] lb_calld=%p: Received initial LB response "
- "message; client load reporting NOT enabled",
- grpclb_policy(), this);
- }
- seen_initial_response_ = true;
- break;
- }
- case response.SERVERLIST: {
- GPR_ASSERT(lb_call_ != nullptr);
- auto serverlist_wrapper =
- MakeRefCounted<Serverlist>(std::move(response.serverlist));
- if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_glb_trace)) {
- gpr_log(GPR_INFO,
- "[grpclb %p] lb_calld=%p: Serverlist with %" PRIuPTR
- " servers received:\n%s",
- grpclb_policy(), this,
- serverlist_wrapper->serverlist().size(),
- serverlist_wrapper->AsText().c_str());
- }
- seen_serverlist_ = true;
- // Start sending client load report only after we start using the
- // serverlist returned from the current LB call.
- if (client_stats_report_interval_ > 0 && client_stats_ == nullptr) {
- client_stats_ = MakeRefCounted<GrpcLbClientStats>();
- // Ref held by callback.
- Ref(DEBUG_LOCATION, "client_load_report").release();
- ScheduleNextClientLoadReportLocked();
- }
- // Check if the serverlist differs from the previous one.
- if (grpclb_policy()->serverlist_ != nullptr &&
- *grpclb_policy()->serverlist_ == *serverlist_wrapper) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_glb_trace)) {
- gpr_log(GPR_INFO,
- "[grpclb %p] lb_calld=%p: Incoming server list identical "
- "to current, ignoring.",
- grpclb_policy(), this);
- }
- } else { // New serverlist.
- // Dispose of the fallback.
- // TODO(roth): Ideally, we should stay in fallback mode until we
- // know that we can reach at least one of the backends in the new
- // serverlist. Unfortunately, we can't do that, since we need to
- // send the new addresses to the child policy in order to determine
- // if they are reachable, and if we don't exit fallback mode now,
- // CreateOrUpdateChildPolicyLocked() will use the fallback
- // addresses instead of the addresses from the new serverlist.
- // However, if we can't reach any of the servers in the new
- // serverlist, then the child policy will never switch away from
- // the fallback addresses, but the grpclb policy will still think
- // that we're not in fallback mode, which means that we won't send
- // updates to the child policy when the fallback addresses are
- // updated by the resolver. This is sub-optimal, but the only way
- // to fix it is to maintain a completely separate child policy for
- // fallback mode, and that's more work than we want to put into
- // the grpclb implementation at this point, since we're deprecating
- // it in favor of the xds policy. We will implement this the
- // right way in the xds policy instead.
- if (grpclb_policy()->fallback_mode_) {
- gpr_log(GPR_INFO,
- "[grpclb %p] Received response from balancer; exiting "
- "fallback mode",
- grpclb_policy());
- grpclb_policy()->fallback_mode_ = false;
- }
- if (grpclb_policy()->fallback_at_startup_checks_pending_) {
- grpclb_policy()->fallback_at_startup_checks_pending_ = false;
- grpc_timer_cancel(&grpclb_policy()->lb_fallback_timer_);
- grpclb_policy()->CancelBalancerChannelConnectivityWatchLocked();
- }
- // Update the serverlist in the GrpcLb instance. This serverlist
- // instance will be destroyed either upon the next update or when the
- // GrpcLb instance is destroyed.
- grpclb_policy()->serverlist_ = std::move(serverlist_wrapper);
- grpclb_policy()->CreateOrUpdateChildPolicyLocked();
- }
- break;
- }
- case response.FALLBACK: {
- if (!grpclb_policy()->fallback_mode_) {
- gpr_log(GPR_INFO,
- "[grpclb %p] Entering fallback mode as requested by balancer",
- grpclb_policy());
- if (grpclb_policy()->fallback_at_startup_checks_pending_) {
- grpclb_policy()->fallback_at_startup_checks_pending_ = false;
- grpc_timer_cancel(&grpclb_policy()->lb_fallback_timer_);
- grpclb_policy()->CancelBalancerChannelConnectivityWatchLocked();
- }
- grpclb_policy()->fallback_mode_ = true;
- grpclb_policy()->CreateOrUpdateChildPolicyLocked();
- // Reset serverlist, so that if the balancer exits fallback
- // mode by sending the same serverlist we were previously
- // using, we don't incorrectly ignore it as a duplicate.
- grpclb_policy()->serverlist_.reset();
- }
- break;
- }
- }
+ } else {
+ switch (response.type) {
+ case response.INITIAL: {
+ if (response.client_stats_report_interval != 0) {
+ client_stats_report_interval_ =
+ GPR_MAX(GPR_MS_PER_SEC, response.client_stats_report_interval);
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_glb_trace)) {
+ gpr_log(GPR_INFO,
+ "[grpclb %p] lb_calld=%p: Received initial LB response "
+ "message; client load reporting interval = %" PRId64
+ " milliseconds",
+ grpclb_policy(), this, client_stats_report_interval_);
+ }
+ } else if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_glb_trace)) {
+ gpr_log(GPR_INFO,
+ "[grpclb %p] lb_calld=%p: Received initial LB response "
+ "message; client load reporting NOT enabled",
+ grpclb_policy(), this);
+ }
+ seen_initial_response_ = true;
+ break;
+ }
+ case response.SERVERLIST: {
+ GPR_ASSERT(lb_call_ != nullptr);
+ auto serverlist_wrapper =
+ MakeRefCounted<Serverlist>(std::move(response.serverlist));
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_glb_trace)) {
+ gpr_log(GPR_INFO,
+ "[grpclb %p] lb_calld=%p: Serverlist with %" PRIuPTR
+ " servers received:\n%s",
+ grpclb_policy(), this,
+ serverlist_wrapper->serverlist().size(),
+ serverlist_wrapper->AsText().c_str());
+ }
+ seen_serverlist_ = true;
+ // Start sending client load report only after we start using the
+ // serverlist returned from the current LB call.
+ if (client_stats_report_interval_ > 0 && client_stats_ == nullptr) {
+ client_stats_ = MakeRefCounted<GrpcLbClientStats>();
+ // Ref held by callback.
+ Ref(DEBUG_LOCATION, "client_load_report").release();
+ ScheduleNextClientLoadReportLocked();
+ }
+ // Check if the serverlist differs from the previous one.
+ if (grpclb_policy()->serverlist_ != nullptr &&
+ *grpclb_policy()->serverlist_ == *serverlist_wrapper) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_glb_trace)) {
+ gpr_log(GPR_INFO,
+ "[grpclb %p] lb_calld=%p: Incoming server list identical "
+ "to current, ignoring.",
+ grpclb_policy(), this);
+ }
+ } else { // New serverlist.
+ // Dispose of the fallback.
+ // TODO(roth): Ideally, we should stay in fallback mode until we
+ // know that we can reach at least one of the backends in the new
+ // serverlist. Unfortunately, we can't do that, since we need to
+ // send the new addresses to the child policy in order to determine
+ // if they are reachable, and if we don't exit fallback mode now,
+ // CreateOrUpdateChildPolicyLocked() will use the fallback
+ // addresses instead of the addresses from the new serverlist.
+ // However, if we can't reach any of the servers in the new
+ // serverlist, then the child policy will never switch away from
+ // the fallback addresses, but the grpclb policy will still think
+ // that we're not in fallback mode, which means that we won't send
+ // updates to the child policy when the fallback addresses are
+ // updated by the resolver. This is sub-optimal, but the only way
+ // to fix it is to maintain a completely separate child policy for
+ // fallback mode, and that's more work than we want to put into
+ // the grpclb implementation at this point, since we're deprecating
+ // it in favor of the xds policy. We will implement this the
+ // right way in the xds policy instead.
+ if (grpclb_policy()->fallback_mode_) {
+ gpr_log(GPR_INFO,
+ "[grpclb %p] Received response from balancer; exiting "
+ "fallback mode",
+ grpclb_policy());
+ grpclb_policy()->fallback_mode_ = false;
+ }
+ if (grpclb_policy()->fallback_at_startup_checks_pending_) {
+ grpclb_policy()->fallback_at_startup_checks_pending_ = false;
+ grpc_timer_cancel(&grpclb_policy()->lb_fallback_timer_);
+ grpclb_policy()->CancelBalancerChannelConnectivityWatchLocked();
+ }
+ // Update the serverlist in the GrpcLb instance. This serverlist
+ // instance will be destroyed either upon the next update or when the
+ // GrpcLb instance is destroyed.
+ grpclb_policy()->serverlist_ = std::move(serverlist_wrapper);
+ grpclb_policy()->CreateOrUpdateChildPolicyLocked();
+ }
+ break;
+ }
+ case response.FALLBACK: {
+ if (!grpclb_policy()->fallback_mode_) {
+ gpr_log(GPR_INFO,
+ "[grpclb %p] Entering fallback mode as requested by balancer",
+ grpclb_policy());
+ if (grpclb_policy()->fallback_at_startup_checks_pending_) {
+ grpclb_policy()->fallback_at_startup_checks_pending_ = false;
+ grpc_timer_cancel(&grpclb_policy()->lb_fallback_timer_);
+ grpclb_policy()->CancelBalancerChannelConnectivityWatchLocked();
+ }
+ grpclb_policy()->fallback_mode_ = true;
+ grpclb_policy()->CreateOrUpdateChildPolicyLocked();
+ // Reset serverlist, so that if the balancer exits fallback
+ // mode by sending the same serverlist we were previously
+ // using, we don't incorrectly ignore it as a duplicate.
+ grpclb_policy()->serverlist_.reset();
+ }
+ break;
+ }
+ }
}
grpc_slice_unref_internal(response_slice);
- if (!grpclb_policy()->shutting_down_) {
+ if (!grpclb_policy()->shutting_down_) {
// Keep listening for serverlist updates.
grpc_op op;
memset(&op, 0, sizeof(op));
op.op = GRPC_OP_RECV_MESSAGE;
- op.data.recv_message.recv_message = &recv_message_payload_;
+ op.data.recv_message.recv_message = &recv_message_payload_;
op.flags = 0;
op.reserved = nullptr;
// Reuse the "OnBalancerMessageReceivedLocked" ref taken in StartQuery().
const grpc_call_error call_error = grpc_call_start_batch_and_execute(
- lb_call_, &op, 1, &lb_on_balancer_message_received_);
+ lb_call_, &op, 1, &lb_on_balancer_message_received_);
GPR_ASSERT(GRPC_CALL_OK == call_error);
} else {
- Unref(DEBUG_LOCATION, "on_message_received+grpclb_shutdown");
+ Unref(DEBUG_LOCATION, "on_message_received+grpclb_shutdown");
}
}
void GrpcLb::BalancerCallState::OnBalancerStatusReceived(void* arg,
grpc_error* error) {
BalancerCallState* lb_calld = static_cast<BalancerCallState*>(arg);
- GRPC_ERROR_REF(error); // owned by lambda
- lb_calld->grpclb_policy()->work_serializer()->Run(
- [lb_calld, error]() { lb_calld->OnBalancerStatusReceivedLocked(error); },
- DEBUG_LOCATION);
+ GRPC_ERROR_REF(error); // owned by lambda
+ lb_calld->grpclb_policy()->work_serializer()->Run(
+ [lb_calld, error]() { lb_calld->OnBalancerStatusReceivedLocked(error); },
+ DEBUG_LOCATION);
}
void GrpcLb::BalancerCallState::OnBalancerStatusReceivedLocked(
- grpc_error* error) {
- GPR_ASSERT(lb_call_ != nullptr);
+ grpc_error* error) {
+ GPR_ASSERT(lb_call_ != nullptr);
if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_glb_trace)) {
- char* status_details = grpc_slice_to_c_string(lb_call_status_details_);
+ char* status_details = grpc_slice_to_c_string(lb_call_status_details_);
gpr_log(GPR_INFO,
"[grpclb %p] lb_calld=%p: Status from LB server received. "
"Status = %d, details = '%s', (lb_call: %p), error '%s'",
- grpclb_policy(), this, lb_call_status_, status_details, lb_call_,
- grpc_error_string(error));
+ grpclb_policy(), this, lb_call_status_, status_details, lb_call_,
+ grpc_error_string(error));
gpr_free(status_details);
}
- GRPC_ERROR_UNREF(error);
+ GRPC_ERROR_UNREF(error);
// If this lb_calld is still in use, this call ended because of a failure so
// we want to retry connecting. Otherwise, we have deliberately ended this
// call and no further action is required.
- if (this == grpclb_policy()->lb_calld_.get()) {
+ if (this == grpclb_policy()->lb_calld_.get()) {
// If the fallback-at-startup checks are pending, go into fallback mode
// immediately. This short-circuits the timeout for the fallback-at-startup
// case.
- if (grpclb_policy()->fallback_at_startup_checks_pending_) {
- GPR_ASSERT(!seen_serverlist_);
+ if (grpclb_policy()->fallback_at_startup_checks_pending_) {
+ GPR_ASSERT(!seen_serverlist_);
gpr_log(GPR_INFO,
"[grpclb %p] Balancer call finished without receiving "
"serverlist; entering fallback mode",
- grpclb_policy());
- grpclb_policy()->fallback_at_startup_checks_pending_ = false;
- grpc_timer_cancel(&grpclb_policy()->lb_fallback_timer_);
- grpclb_policy()->CancelBalancerChannelConnectivityWatchLocked();
- grpclb_policy()->fallback_mode_ = true;
- grpclb_policy()->CreateOrUpdateChildPolicyLocked();
+ grpclb_policy());
+ grpclb_policy()->fallback_at_startup_checks_pending_ = false;
+ grpc_timer_cancel(&grpclb_policy()->lb_fallback_timer_);
+ grpclb_policy()->CancelBalancerChannelConnectivityWatchLocked();
+ grpclb_policy()->fallback_mode_ = true;
+ grpclb_policy()->CreateOrUpdateChildPolicyLocked();
} else {
// This handles the fallback-after-startup case.
- grpclb_policy()->MaybeEnterFallbackModeAfterStartup();
+ grpclb_policy()->MaybeEnterFallbackModeAfterStartup();
}
- grpclb_policy()->lb_calld_.reset();
- GPR_ASSERT(!grpclb_policy()->shutting_down_);
- grpclb_policy()->channel_control_helper()->RequestReresolution();
- if (seen_initial_response_) {
+ grpclb_policy()->lb_calld_.reset();
+ GPR_ASSERT(!grpclb_policy()->shutting_down_);
+ grpclb_policy()->channel_control_helper()->RequestReresolution();
+ if (seen_initial_response_) {
// If we lose connection to the LB server, reset the backoff and restart
// the LB call immediately.
- grpclb_policy()->lb_call_backoff_.Reset();
- grpclb_policy()->StartBalancerCallLocked();
+ grpclb_policy()->lb_call_backoff_.Reset();
+ grpclb_policy()->StartBalancerCallLocked();
} else {
// If this LB call fails establishing any connection to the LB server,
// retry later.
- grpclb_policy()->StartBalancerCallRetryTimerLocked();
+ grpclb_policy()->StartBalancerCallRetryTimerLocked();
}
}
- Unref(DEBUG_LOCATION, "lb_call_ended");
+ Unref(DEBUG_LOCATION, "lb_call_ended");
}
//
// helper code for creating balancer channel
//
-ServerAddressList ExtractBalancerAddresses(const grpc_channel_args& args) {
- const ServerAddressList* addresses =
- FindGrpclbBalancerAddressesInChannelArgs(args);
- if (addresses != nullptr) return *addresses;
- return ServerAddressList();
+ServerAddressList ExtractBalancerAddresses(const grpc_channel_args& args) {
+ const ServerAddressList* addresses =
+ FindGrpclbBalancerAddressesInChannelArgs(args);
+ if (addresses != nullptr) return *addresses;
+ return ServerAddressList();
}
/* Returns the channel args for the LB channel, used to create a bidirectional
@@ -1282,18 +1282,18 @@ grpc_channel_args* BuildBalancerChannelArgs(
GRPC_ARG_CHANNELZ_CHANNEL_NODE,
};
// Channel args to add.
- y_absl::InlinedVector<grpc_arg, 3> args_to_add = {
- // The fake resolver response generator, which we use to inject
- // address updates into the LB channel.
+ y_absl::InlinedVector<grpc_arg, 3> args_to_add = {
+ // The fake resolver response generator, which we use to inject
+ // address updates into the LB channel.
grpc_core::FakeResolverResponseGenerator::MakeChannelArg(
- response_generator),
- // A channel arg indicating the target is a grpclb load balancer.
- grpc_channel_arg_integer_create(
- const_cast<char*>(GRPC_ARG_ADDRESS_IS_GRPCLB_LOAD_BALANCER), 1),
- // Tells channelz that this is an internal channel.
- grpc_channel_arg_integer_create(
- const_cast<char*>(GRPC_ARG_CHANNELZ_IS_INTERNAL_CHANNEL), 1),
- };
+ response_generator),
+ // A channel arg indicating the target is a grpclb load balancer.
+ grpc_channel_arg_integer_create(
+ const_cast<char*>(GRPC_ARG_ADDRESS_IS_GRPCLB_LOAD_BALANCER), 1),
+ // Tells channelz that this is an internal channel.
+ grpc_channel_arg_integer_create(
+ const_cast<char*>(GRPC_ARG_CHANNELZ_IS_INTERNAL_CHANNEL), 1),
+ };
// Construct channel args.
grpc_channel_args* new_args = grpc_channel_args_copy_and_add_and_remove(
args, args_to_remove, GPR_ARRAY_SIZE(args_to_remove), args_to_add.data(),
@@ -1317,11 +1317,11 @@ GrpcLb::GrpcLb(Args args)
.set_jitter(GRPC_GRPCLB_RECONNECT_JITTER)
.set_max_backoff(GRPC_GRPCLB_RECONNECT_MAX_BACKOFF_SECONDS *
1000)) {
- // Closure Initialization
- GRPC_CLOSURE_INIT(&lb_on_fallback_, &GrpcLb::OnFallbackTimer, this,
- grpc_schedule_on_exec_ctx);
- GRPC_CLOSURE_INIT(&lb_on_call_retry_, &GrpcLb::OnBalancerCallRetryTimer, this,
- grpc_schedule_on_exec_ctx);
+ // Closure Initialization
+ GRPC_CLOSURE_INIT(&lb_on_fallback_, &GrpcLb::OnFallbackTimer, this,
+ grpc_schedule_on_exec_ctx);
+ GRPC_CLOSURE_INIT(&lb_on_call_retry_, &GrpcLb::OnBalancerCallRetryTimer, this,
+ grpc_schedule_on_exec_ctx);
// Record server name.
const grpc_arg* arg = grpc_channel_args_find(args.args, GRPC_ARG_SERVER_URI);
const char* server_uri = grpc_channel_arg_get_string(arg);
@@ -1356,26 +1356,26 @@ void GrpcLb::ShutdownLocked() {
grpc_timer_cancel(&lb_call_retry_timer_);
}
if (fallback_at_startup_checks_pending_) {
- fallback_at_startup_checks_pending_ = false;
+ fallback_at_startup_checks_pending_ = false;
grpc_timer_cancel(&lb_fallback_timer_);
CancelBalancerChannelConnectivityWatchLocked();
}
if (child_policy_ != nullptr) {
grpc_pollset_set_del_pollset_set(child_policy_->interested_parties(),
interested_parties());
- child_policy_.reset();
+ child_policy_.reset();
}
// We destroy the LB channel here instead of in our destructor because
// destroying the channel triggers a last callback to
// OnBalancerChannelConnectivityChangedLocked(), and we need to be
// alive when that callback is invoked.
if (lb_channel_ != nullptr) {
- if (parent_channelz_node_ != nullptr) {
- channelz::ChannelNode* child_channelz_node =
- grpc_channel_get_channelz_node(lb_channel_);
- GPR_ASSERT(child_channelz_node != nullptr);
- parent_channelz_node_->RemoveChildChannel(child_channelz_node->uuid());
- }
+ if (parent_channelz_node_ != nullptr) {
+ channelz::ChannelNode* child_channelz_node =
+ grpc_channel_get_channelz_node(lb_channel_);
+ GPR_ASSERT(child_channelz_node != nullptr);
+ parent_channelz_node_->RemoveChildChannel(child_channelz_node->uuid());
+ }
grpc_channel_destroy(lb_channel_);
lb_channel_ = nullptr;
}
@@ -1396,8 +1396,8 @@ void GrpcLb::ResetBackoffLocked() {
void GrpcLb::UpdateLocked(UpdateArgs args) {
const bool is_initial_update = lb_channel_ == nullptr;
- config_ = args.config;
- GPR_ASSERT(config_ != nullptr);
+ config_ = args.config;
+ GPR_ASSERT(config_ != nullptr);
ProcessAddressesAndChannelArgsLocked(args.addresses, *args.args);
// Update the existing child policy.
if (child_policy_ != nullptr) CreateOrUpdateChildPolicyLocked();
@@ -1416,10 +1416,10 @@ void GrpcLb::UpdateLocked(UpdateArgs args) {
grpc_channel_get_channel_stack(lb_channel_));
GPR_ASSERT(client_channel_elem->filter == &grpc_client_channel_filter);
// Ref held by callback.
- watcher_ = new StateWatcher(Ref(DEBUG_LOCATION, "StateWatcher"));
- grpc_client_channel_start_connectivity_watch(
- client_channel_elem, GRPC_CHANNEL_IDLE,
- OrphanablePtr<AsyncConnectivityStateWatcherInterface>(watcher_));
+ watcher_ = new StateWatcher(Ref(DEBUG_LOCATION, "StateWatcher"));
+ grpc_client_channel_start_connectivity_watch(
+ client_channel_elem, GRPC_CHANNEL_IDLE,
+ OrphanablePtr<AsyncConnectivityStateWatcherInterface>(watcher_));
// Start balancer call.
StartBalancerCallLocked();
}
@@ -1429,21 +1429,21 @@ void GrpcLb::UpdateLocked(UpdateArgs args) {
// helpers for UpdateLocked()
//
-ServerAddressList GrpcLb::AddNullLbTokenToAddresses(
- const ServerAddressList& addresses) {
- ServerAddressList addresses_out;
- for (const ServerAddress& address : addresses) {
- addresses_out.emplace_back(address.WithAttribute(
- kGrpcLbAddressAttributeKey,
- y_absl::make_unique<TokenAndClientStatsAttribute>("", nullptr)));
+ServerAddressList GrpcLb::AddNullLbTokenToAddresses(
+ const ServerAddressList& addresses) {
+ ServerAddressList addresses_out;
+ for (const ServerAddress& address : addresses) {
+ addresses_out.emplace_back(address.WithAttribute(
+ kGrpcLbAddressAttributeKey,
+ y_absl::make_unique<TokenAndClientStatsAttribute>("", nullptr)));
}
- return addresses_out;
+ return addresses_out;
}
void GrpcLb::ProcessAddressesAndChannelArgsLocked(
const ServerAddressList& addresses, const grpc_channel_args& args) {
// Update fallback address list.
- fallback_backend_addresses_ = AddNullLbTokenToAddresses(addresses);
+ fallback_backend_addresses_ = AddNullLbTokenToAddresses(addresses);
// Make sure that GRPC_ARG_LB_POLICY_NAME is set in channel args,
// since we use this to trigger the client_load_reporting filter.
static const char* args_to_remove[] = {GRPC_ARG_LB_POLICY_NAME};
@@ -1453,25 +1453,25 @@ void GrpcLb::ProcessAddressesAndChannelArgsLocked(
args_ = grpc_channel_args_copy_and_add_and_remove(
&args, args_to_remove, GPR_ARRAY_SIZE(args_to_remove), &new_arg, 1);
// Construct args for balancer channel.
- ServerAddressList balancer_addresses = ExtractBalancerAddresses(args);
+ ServerAddressList balancer_addresses = ExtractBalancerAddresses(args);
grpc_channel_args* lb_channel_args = BuildBalancerChannelArgs(
balancer_addresses, response_generator_.get(), &args);
// Create balancer channel if needed.
if (lb_channel_ == nullptr) {
- TString uri_str = y_absl::StrCat("fake:///", server_name_);
- lb_channel_ =
- CreateGrpclbBalancerChannel(uri_str.c_str(), *lb_channel_args);
+ TString uri_str = y_absl::StrCat("fake:///", server_name_);
+ lb_channel_ =
+ CreateGrpclbBalancerChannel(uri_str.c_str(), *lb_channel_args);
GPR_ASSERT(lb_channel_ != nullptr);
- // Set up channelz linkage.
- channelz::ChannelNode* child_channelz_node =
- grpc_channel_get_channelz_node(lb_channel_);
- channelz::ChannelNode* parent_channelz_node =
- grpc_channel_args_find_pointer<channelz::ChannelNode>(
- &args, GRPC_ARG_CHANNELZ_CHANNEL_NODE);
- if (child_channelz_node != nullptr && parent_channelz_node != nullptr) {
- parent_channelz_node->AddChildChannel(child_channelz_node->uuid());
- parent_channelz_node_ = parent_channelz_node->Ref();
- }
+ // Set up channelz linkage.
+ channelz::ChannelNode* child_channelz_node =
+ grpc_channel_get_channelz_node(lb_channel_);
+ channelz::ChannelNode* parent_channelz_node =
+ grpc_channel_args_find_pointer<channelz::ChannelNode>(
+ &args, GRPC_ARG_CHANNELZ_CHANNEL_NODE);
+ if (child_channelz_node != nullptr && parent_channelz_node != nullptr) {
+ parent_channelz_node->AddChildChannel(child_channelz_node->uuid());
+ parent_channelz_node_ = parent_channelz_node->Ref();
+ }
}
// Propagate updates to the LB channel (pick_first) through the fake
// resolver.
@@ -1485,7 +1485,7 @@ void GrpcLb::CancelBalancerChannelConnectivityWatchLocked() {
grpc_channel_element* client_channel_elem = grpc_channel_stack_last_element(
grpc_channel_get_channel_stack(lb_channel_));
GPR_ASSERT(client_channel_elem->filter == &grpc_client_channel_filter);
- grpc_client_channel_stop_connectivity_watch(client_channel_elem, watcher_);
+ grpc_client_channel_stop_connectivity_watch(client_channel_elem, watcher_);
}
//
@@ -1530,24 +1530,24 @@ void GrpcLb::StartBalancerCallRetryTimerLocked() {
void GrpcLb::OnBalancerCallRetryTimer(void* arg, grpc_error* error) {
GrpcLb* grpclb_policy = static_cast<GrpcLb*>(arg);
- GRPC_ERROR_REF(error); // ref owned by lambda
- grpclb_policy->work_serializer()->Run(
- [grpclb_policy, error]() {
- grpclb_policy->OnBalancerCallRetryTimerLocked(error);
- },
- DEBUG_LOCATION);
+ GRPC_ERROR_REF(error); // ref owned by lambda
+ grpclb_policy->work_serializer()->Run(
+ [grpclb_policy, error]() {
+ grpclb_policy->OnBalancerCallRetryTimerLocked(error);
+ },
+ DEBUG_LOCATION);
}
-void GrpcLb::OnBalancerCallRetryTimerLocked(grpc_error* error) {
- retry_timer_callback_pending_ = false;
- if (!shutting_down_ && error == GRPC_ERROR_NONE && lb_calld_ == nullptr) {
+void GrpcLb::OnBalancerCallRetryTimerLocked(grpc_error* error) {
+ retry_timer_callback_pending_ = false;
+ if (!shutting_down_ && error == GRPC_ERROR_NONE && lb_calld_ == nullptr) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_glb_trace)) {
- gpr_log(GPR_INFO, "[grpclb %p] Restarting call to LB server", this);
+ gpr_log(GPR_INFO, "[grpclb %p] Restarting call to LB server", this);
}
- StartBalancerCallLocked();
+ StartBalancerCallLocked();
}
- Unref(DEBUG_LOCATION, "on_balancer_call_retry_timer");
- GRPC_ERROR_UNREF(error);
+ Unref(DEBUG_LOCATION, "on_balancer_call_retry_timer");
+ GRPC_ERROR_UNREF(error);
}
//
@@ -1574,28 +1574,28 @@ void GrpcLb::MaybeEnterFallbackModeAfterStartup() {
void GrpcLb::OnFallbackTimer(void* arg, grpc_error* error) {
GrpcLb* grpclb_policy = static_cast<GrpcLb*>(arg);
- GRPC_ERROR_REF(error); // ref owned by lambda
- grpclb_policy->work_serializer()->Run(
- [grpclb_policy, error]() { grpclb_policy->OnFallbackTimerLocked(error); },
- DEBUG_LOCATION);
+ GRPC_ERROR_REF(error); // ref owned by lambda
+ grpclb_policy->work_serializer()->Run(
+ [grpclb_policy, error]() { grpclb_policy->OnFallbackTimerLocked(error); },
+ DEBUG_LOCATION);
}
-void GrpcLb::OnFallbackTimerLocked(grpc_error* error) {
+void GrpcLb::OnFallbackTimerLocked(grpc_error* error) {
// If we receive a serverlist after the timer fires but before this callback
// actually runs, don't fall back.
- if (fallback_at_startup_checks_pending_ && !shutting_down_ &&
- error == GRPC_ERROR_NONE) {
+ if (fallback_at_startup_checks_pending_ && !shutting_down_ &&
+ error == GRPC_ERROR_NONE) {
gpr_log(GPR_INFO,
"[grpclb %p] No response from balancer after fallback timeout; "
"entering fallback mode",
- this);
- fallback_at_startup_checks_pending_ = false;
- CancelBalancerChannelConnectivityWatchLocked();
- fallback_mode_ = true;
- CreateOrUpdateChildPolicyLocked();
+ this);
+ fallback_at_startup_checks_pending_ = false;
+ CancelBalancerChannelConnectivityWatchLocked();
+ fallback_mode_ = true;
+ CreateOrUpdateChildPolicyLocked();
}
- Unref(DEBUG_LOCATION, "on_fallback_timer");
- GRPC_ERROR_UNREF(error);
+ Unref(DEBUG_LOCATION, "on_fallback_timer");
+ GRPC_ERROR_UNREF(error);
}
//
@@ -1604,7 +1604,7 @@ void GrpcLb::OnFallbackTimerLocked(grpc_error* error) {
grpc_channel_args* GrpcLb::CreateChildPolicyArgsLocked(
bool is_backend_from_grpclb_load_balancer) {
- y_absl::InlinedVector<grpc_arg, 2> args_to_add;
+ y_absl::InlinedVector<grpc_arg, 2> args_to_add;
args_to_add.emplace_back(grpc_channel_arg_integer_create(
const_cast<char*>(GRPC_ARG_ADDRESS_IS_BACKEND_FROM_GRPCLB_LOAD_BALANCER),
is_backend_from_grpclb_load_balancer));
@@ -1617,17 +1617,17 @@ grpc_channel_args* GrpcLb::CreateChildPolicyArgsLocked(
}
OrphanablePtr<LoadBalancingPolicy> GrpcLb::CreateChildPolicyLocked(
- const grpc_channel_args* args) {
+ const grpc_channel_args* args) {
LoadBalancingPolicy::Args lb_policy_args;
- lb_policy_args.work_serializer = work_serializer();
+ lb_policy_args.work_serializer = work_serializer();
lb_policy_args.args = args;
- lb_policy_args.channel_control_helper = y_absl::make_unique<Helper>(Ref());
+ lb_policy_args.channel_control_helper = y_absl::make_unique<Helper>(Ref());
OrphanablePtr<LoadBalancingPolicy> lb_policy =
- MakeOrphanable<ChildPolicyHandler>(std::move(lb_policy_args),
- &grpc_lb_glb_trace);
+ MakeOrphanable<ChildPolicyHandler>(std::move(lb_policy_args),
+ &grpc_lb_glb_trace);
if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_glb_trace)) {
- gpr_log(GPR_INFO, "[grpclb %p] Created new child policy handler (%p)", this,
- lb_policy.get());
+ gpr_log(GPR_INFO, "[grpclb %p] Created new child policy handler (%p)", this,
+ lb_policy.get());
}
// Add the gRPC LB's interested_parties pollset_set to that of the newly
// created child policy. This will make the child policy progress upon
@@ -1657,17 +1657,17 @@ void GrpcLb::CreateOrUpdateChildPolicyLocked() {
update_args.args =
CreateChildPolicyArgsLocked(is_backend_from_grpclb_load_balancer);
GPR_ASSERT(update_args.args != nullptr);
- update_args.config = config_->child_policy();
- // Create child policy if needed.
- if (child_policy_ == nullptr) {
- child_policy_ = CreateChildPolicyLocked(update_args.args);
+ update_args.config = config_->child_policy();
+ // Create child policy if needed.
+ if (child_policy_ == nullptr) {
+ child_policy_ = CreateChildPolicyLocked(update_args.args);
}
// Update the policy.
if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_glb_trace)) {
- gpr_log(GPR_INFO, "[grpclb %p] Updating child policy handler %p", this,
- child_policy_.get());
+ gpr_log(GPR_INFO, "[grpclb %p] Updating child policy handler %p", this,
+ child_policy_.get());
}
- child_policy_->UpdateLocked(std::move(update_args));
+ child_policy_->UpdateLocked(std::move(update_args));
}
//
@@ -1684,47 +1684,47 @@ class GrpcLbFactory : public LoadBalancingPolicyFactory {
const char* name() const override { return kGrpclb; }
RefCountedPtr<LoadBalancingPolicy::Config> ParseLoadBalancingConfig(
- const Json& json, grpc_error** error) const override {
+ const Json& json, grpc_error** error) const override {
GPR_DEBUG_ASSERT(error != nullptr && *error == GRPC_ERROR_NONE);
- if (json.type() == Json::Type::JSON_NULL) {
- return MakeRefCounted<GrpcLbConfig>(nullptr, "");
+ if (json.type() == Json::Type::JSON_NULL) {
+ return MakeRefCounted<GrpcLbConfig>(nullptr, "");
+ }
+ std::vector<grpc_error*> error_list;
+ Json child_policy_config_json_tmp;
+ const Json* child_policy_config_json;
+ TString service_name;
+ auto it = json.object_value().find("serviceName");
+ if (it != json.object_value().end()) {
+ const Json& service_name_json = it->second;
+ if (service_name_json.type() != Json::Type::STRING) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:serviceName error:type should be string"));
+ } else {
+ service_name = service_name_json.string_value();
+ }
+ }
+ it = json.object_value().find("childPolicy");
+ if (it == json.object_value().end()) {
+ child_policy_config_json_tmp = Json::Array{Json::Object{
+ {"round_robin", Json::Object()},
+ }};
+ child_policy_config_json = &child_policy_config_json_tmp;
+ } else {
+ child_policy_config_json = &it->second;
}
- std::vector<grpc_error*> error_list;
- Json child_policy_config_json_tmp;
- const Json* child_policy_config_json;
- TString service_name;
- auto it = json.object_value().find("serviceName");
- if (it != json.object_value().end()) {
- const Json& service_name_json = it->second;
- if (service_name_json.type() != Json::Type::STRING) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:serviceName error:type should be string"));
- } else {
- service_name = service_name_json.string_value();
- }
- }
- it = json.object_value().find("childPolicy");
- if (it == json.object_value().end()) {
- child_policy_config_json_tmp = Json::Array{Json::Object{
- {"round_robin", Json::Object()},
- }};
- child_policy_config_json = &child_policy_config_json_tmp;
- } else {
- child_policy_config_json = &it->second;
+ grpc_error* parse_error = GRPC_ERROR_NONE;
+ RefCountedPtr<LoadBalancingPolicy::Config> child_policy_config =
+ LoadBalancingPolicyRegistry::ParseLoadBalancingConfig(
+ *child_policy_config_json, &parse_error);
+ if (parse_error != GRPC_ERROR_NONE) {
+ std::vector<grpc_error*> child_errors;
+ child_errors.push_back(parse_error);
+ error_list.push_back(
+ GRPC_ERROR_CREATE_FROM_VECTOR("field:childPolicy", &child_errors));
}
- grpc_error* parse_error = GRPC_ERROR_NONE;
- RefCountedPtr<LoadBalancingPolicy::Config> child_policy_config =
- LoadBalancingPolicyRegistry::ParseLoadBalancingConfig(
- *child_policy_config_json, &parse_error);
- if (parse_error != GRPC_ERROR_NONE) {
- std::vector<grpc_error*> child_errors;
- child_errors.push_back(parse_error);
- error_list.push_back(
- GRPC_ERROR_CREATE_FROM_VECTOR("field:childPolicy", &child_errors));
- }
if (error_list.empty()) {
- return MakeRefCounted<GrpcLbConfig>(std::move(child_policy_config),
- std::move(service_name));
+ return MakeRefCounted<GrpcLbConfig>(std::move(child_policy_config),
+ std::move(service_name));
} else {
*error = GRPC_ERROR_CREATE_FROM_VECTOR("GrpcLb Parser", &error_list);
return nullptr;
@@ -1767,7 +1767,7 @@ bool maybe_add_client_load_reporting_filter(grpc_channel_stack_builder* builder,
void grpc_lb_policy_grpclb_init() {
grpc_core::LoadBalancingPolicyRegistry::Builder::
RegisterLoadBalancingPolicyFactory(
- y_absl::make_unique<grpc_core::GrpcLbFactory>());
+ y_absl::make_unique<grpc_core::GrpcLbFactory>());
grpc_channel_init_register_stage(GRPC_CLIENT_SUBCHANNEL,
GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
maybe_add_client_load_reporting_filter,
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.cc
index d312a75b10e..0bd587a9323 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.cc
@@ -1,76 +1,76 @@
-//
-// Copyright 2019 gRPC authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-#include <grpc/support/port_platform.h>
-
-#include "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.h"
-
-#include "src/core/lib/channel/channel_args.h"
-#include "src/core/lib/gpr/useful.h"
-
-// Channel arg key for the list of balancer addresses.
-#define GRPC_ARG_GRPCLB_BALANCER_ADDRESSES "grpc.grpclb_balancer_addresses"
-
-namespace grpc_core {
-
-namespace {
-
-void* BalancerAddressesArgCopy(void* p) {
- ServerAddressList* address_list = static_cast<ServerAddressList*>(p);
- return new ServerAddressList(*address_list);
-}
-
-void BalancerAddressesArgDestroy(void* p) {
- ServerAddressList* address_list = static_cast<ServerAddressList*>(p);
- delete address_list;
-}
-
-int BalancerAddressesArgCmp(void* p, void* q) {
- ServerAddressList* address_list1 = static_cast<ServerAddressList*>(p);
- ServerAddressList* address_list2 = static_cast<ServerAddressList*>(q);
- if (address_list1 == nullptr || address_list2 == nullptr) {
- return GPR_ICMP(address_list1, address_list2);
- }
- if (address_list1->size() > address_list2->size()) return 1;
- if (address_list1->size() < address_list2->size()) return -1;
- for (size_t i = 0; i < address_list1->size(); ++i) {
- int retval = (*address_list1)[i].Cmp((*address_list2)[i]);
- if (retval != 0) return retval;
- }
- return 0;
-}
-
-const grpc_arg_pointer_vtable kBalancerAddressesArgVtable = {
- BalancerAddressesArgCopy, BalancerAddressesArgDestroy,
- BalancerAddressesArgCmp};
-
-} // namespace
-
-grpc_arg CreateGrpclbBalancerAddressesArg(
- const ServerAddressList* address_list) {
- return grpc_channel_arg_pointer_create(
- const_cast<char*>(GRPC_ARG_GRPCLB_BALANCER_ADDRESSES),
- const_cast<ServerAddressList*>(address_list),
- &kBalancerAddressesArgVtable);
-}
-
-const ServerAddressList* FindGrpclbBalancerAddressesInChannelArgs(
- const grpc_channel_args& args) {
- return grpc_channel_args_find_pointer<const ServerAddressList>(
- &args, const_cast<char*>(GRPC_ARG_GRPCLB_BALANCER_ADDRESSES));
-}
-
-} // namespace grpc_core
+//
+// Copyright 2019 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.h"
+
+#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/gpr/useful.h"
+
+// Channel arg key for the list of balancer addresses.
+#define GRPC_ARG_GRPCLB_BALANCER_ADDRESSES "grpc.grpclb_balancer_addresses"
+
+namespace grpc_core {
+
+namespace {
+
+void* BalancerAddressesArgCopy(void* p) {
+ ServerAddressList* address_list = static_cast<ServerAddressList*>(p);
+ return new ServerAddressList(*address_list);
+}
+
+void BalancerAddressesArgDestroy(void* p) {
+ ServerAddressList* address_list = static_cast<ServerAddressList*>(p);
+ delete address_list;
+}
+
+int BalancerAddressesArgCmp(void* p, void* q) {
+ ServerAddressList* address_list1 = static_cast<ServerAddressList*>(p);
+ ServerAddressList* address_list2 = static_cast<ServerAddressList*>(q);
+ if (address_list1 == nullptr || address_list2 == nullptr) {
+ return GPR_ICMP(address_list1, address_list2);
+ }
+ if (address_list1->size() > address_list2->size()) return 1;
+ if (address_list1->size() < address_list2->size()) return -1;
+ for (size_t i = 0; i < address_list1->size(); ++i) {
+ int retval = (*address_list1)[i].Cmp((*address_list2)[i]);
+ if (retval != 0) return retval;
+ }
+ return 0;
+}
+
+const grpc_arg_pointer_vtable kBalancerAddressesArgVtable = {
+ BalancerAddressesArgCopy, BalancerAddressesArgDestroy,
+ BalancerAddressesArgCmp};
+
+} // namespace
+
+grpc_arg CreateGrpclbBalancerAddressesArg(
+ const ServerAddressList* address_list) {
+ return grpc_channel_arg_pointer_create(
+ const_cast<char*>(GRPC_ARG_GRPCLB_BALANCER_ADDRESSES),
+ const_cast<ServerAddressList*>(address_list),
+ &kBalancerAddressesArgVtable);
+}
+
+const ServerAddressList* FindGrpclbBalancerAddressesInChannelArgs(
+ const grpc_channel_args& args) {
+ return grpc_channel_args_find_pointer<const ServerAddressList>(
+ &args, const_cast<char*>(GRPC_ARG_GRPCLB_BALANCER_ADDRESSES));
+}
+
+} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.h b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.h
index cbc54a4da79..f95341e3f40 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.h
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.h
@@ -1,37 +1,37 @@
-//
-// Copyright 2019 gRPC authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-#ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_GRPCLB_GRPCLB_BALANCER_ADDRESSES_H
-#define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_GRPCLB_GRPCLB_BALANCER_ADDRESSES_H
-
-#include <grpc/support/port_platform.h>
-
-#include <grpc/impl/codegen/grpc_types.h>
-
-#include "src/core/ext/filters/client_channel/server_address.h"
-
-namespace grpc_core {
-
-grpc_arg CreateGrpclbBalancerAddressesArg(
- const ServerAddressList* address_list);
-const ServerAddressList* FindGrpclbBalancerAddressesInChannelArgs(
- const grpc_channel_args& args);
-
-} // namespace grpc_core
-
-#endif /* \
-GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_GRPCLB_GRPCLB_BALANCER_ADDRESSES_H \
- */
+//
+// Copyright 2019 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+#ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_GRPCLB_GRPCLB_BALANCER_ADDRESSES_H
+#define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_GRPCLB_GRPCLB_BALANCER_ADDRESSES_H
+
+#include <grpc/support/port_platform.h>
+
+#include <grpc/impl/codegen/grpc_types.h>
+
+#include "src/core/ext/filters/client_channel/server_address.h"
+
+namespace grpc_core {
+
+grpc_arg CreateGrpclbBalancerAddressesArg(
+ const ServerAddressList* address_list);
+const ServerAddressList* FindGrpclbBalancerAddressesInChannelArgs(
+ const grpc_channel_args& args);
+
+} // namespace grpc_core
+
+#endif /* \
+GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_GRPCLB_GRPCLB_BALANCER_ADDRESSES_H \
+ */
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc
index b801eb0290e..e918ee08360 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc
@@ -22,14 +22,14 @@
#include <string.h>
-#include "y_absl/container/inlined_vector.h"
-
+#include "y_absl/container/inlined_vector.h"
+
#include <grpc/grpc_security.h>
#include <grpc/support/alloc.h>
#include <grpc/support/string_util.h>
#include "src/core/ext/filters/client_channel/client_channel.h"
-#include "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.h"
+#include "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.h"
#include "src/core/ext/filters/client_channel/server_address.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/gpr/string.h"
@@ -41,8 +41,8 @@ namespace grpc_core {
grpc_channel_args* ModifyGrpclbBalancerChannelArgs(
const ServerAddressList& addresses, grpc_channel_args* args) {
- y_absl::InlinedVector<const char*, 1> args_to_remove;
- y_absl::InlinedVector<grpc_arg, 1> args_to_add;
+ y_absl::InlinedVector<const char*, 1> args_to_remove;
+ y_absl::InlinedVector<grpc_arg, 1> args_to_add;
// Substitute the channel credentials with a version without call
// credentials: the load balancer is not necessarily trusted to handle
// bearer token credentials.
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h
index 0d3e872603c..e5304fda6be 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h
@@ -23,8 +23,8 @@
#include <grpc/support/atm.h>
-#include "y_absl/container/inlined_vector.h"
-
+#include "y_absl/container/inlined_vector.h"
+
#include "src/core/lib/gprpp/memory.h"
#include "src/core/lib/gprpp/ref_counted.h"
#include "src/core/lib/gprpp/sync.h"
@@ -41,7 +41,7 @@ class GrpcLbClientStats : public RefCounted<GrpcLbClientStats> {
: token(std::move(token)), count(count) {}
};
- typedef y_absl::InlinedVector<DropTokenCount, 10> DroppedCallCounts;
+ typedef y_absl::InlinedVector<DropTokenCount, 10> DroppedCallCounts;
void AddCallStarted();
void AddCallFinished(bool finished_with_client_failed_to_send,
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc
index 73a168d9c16..3185b993c41 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc
@@ -28,38 +28,38 @@
namespace grpc_core {
-bool GrpcLbServer::operator==(const GrpcLbServer& other) const {
- if (ip_size != other.ip_size) return false;
- int r = memcmp(ip_addr, other.ip_addr, ip_size);
- if (r != 0) return false;
- if (port != other.port) return false;
- r = strncmp(load_balance_token, other.load_balance_token,
- sizeof(load_balance_token));
- if (r != 0) return false;
- return drop == other.drop;
-}
-
-namespace {
-
-grpc_slice grpc_grpclb_request_encode(
- const grpc_lb_v1_LoadBalanceRequest* request, upb_arena* arena) {
- size_t buf_length;
- char* buf =
- grpc_lb_v1_LoadBalanceRequest_serialize(request, arena, &buf_length);
- return grpc_slice_from_copied_buffer(buf, buf_length);
-}
-
-} // namespace
-
-grpc_slice GrpcLbRequestCreate(const char* lb_service_name, upb_arena* arena) {
- grpc_lb_v1_LoadBalanceRequest* req = grpc_lb_v1_LoadBalanceRequest_new(arena);
+bool GrpcLbServer::operator==(const GrpcLbServer& other) const {
+ if (ip_size != other.ip_size) return false;
+ int r = memcmp(ip_addr, other.ip_addr, ip_size);
+ if (r != 0) return false;
+ if (port != other.port) return false;
+ r = strncmp(load_balance_token, other.load_balance_token,
+ sizeof(load_balance_token));
+ if (r != 0) return false;
+ return drop == other.drop;
+}
+
+namespace {
+
+grpc_slice grpc_grpclb_request_encode(
+ const grpc_lb_v1_LoadBalanceRequest* request, upb_arena* arena) {
+ size_t buf_length;
+ char* buf =
+ grpc_lb_v1_LoadBalanceRequest_serialize(request, arena, &buf_length);
+ return grpc_slice_from_copied_buffer(buf, buf_length);
+}
+
+} // namespace
+
+grpc_slice GrpcLbRequestCreate(const char* lb_service_name, upb_arena* arena) {
+ grpc_lb_v1_LoadBalanceRequest* req = grpc_lb_v1_LoadBalanceRequest_new(arena);
grpc_lb_v1_InitialLoadBalanceRequest* initial_request =
grpc_lb_v1_LoadBalanceRequest_mutable_initial_request(req, arena);
size_t name_len =
GPR_MIN(strlen(lb_service_name), GRPC_GRPCLB_SERVICE_NAME_MAX_LENGTH);
grpc_lb_v1_InitialLoadBalanceRequest_set_name(
initial_request, upb_strview_make(lb_service_name, name_len));
- return grpc_grpclb_request_encode(req, arena);
+ return grpc_grpclb_request_encode(req, arena);
}
namespace {
@@ -72,13 +72,13 @@ void google_protobuf_Timestamp_assign(google_protobuf_Timestamp* timestamp,
} // namespace
-grpc_slice GrpcLbLoadReportRequestCreate(
- int64_t num_calls_started, int64_t num_calls_finished,
- int64_t num_calls_finished_with_client_failed_to_send,
- int64_t num_calls_finished_known_received,
- const GrpcLbClientStats::DroppedCallCounts* drop_token_counts,
- upb_arena* arena) {
- grpc_lb_v1_LoadBalanceRequest* req = grpc_lb_v1_LoadBalanceRequest_new(arena);
+grpc_slice GrpcLbLoadReportRequestCreate(
+ int64_t num_calls_started, int64_t num_calls_finished,
+ int64_t num_calls_finished_with_client_failed_to_send,
+ int64_t num_calls_finished_known_received,
+ const GrpcLbClientStats::DroppedCallCounts* drop_token_counts,
+ upb_arena* arena) {
+ grpc_lb_v1_LoadBalanceRequest* req = grpc_lb_v1_LoadBalanceRequest_new(arena);
grpc_lb_v1_ClientStats* req_stats =
grpc_lb_v1_LoadBalanceRequest_mutable_client_stats(req, arena);
google_protobuf_Timestamp_assign(
@@ -92,7 +92,7 @@ grpc_slice GrpcLbLoadReportRequestCreate(
req_stats, num_calls_finished_known_received);
if (drop_token_counts != nullptr) {
for (size_t i = 0; i < drop_token_counts->size(); ++i) {
- const GrpcLbClientStats::DropTokenCount& cur = (*drop_token_counts)[i];
+ const GrpcLbClientStats::DropTokenCount& cur = (*drop_token_counts)[i];
grpc_lb_v1_ClientStatsPerToken* cur_msg =
grpc_lb_v1_ClientStats_add_calls_finished_with_drop(req_stats, arena);
const size_t token_len = strlen(cur.token.get());
@@ -103,91 +103,91 @@ grpc_slice GrpcLbLoadReportRequestCreate(
grpc_lb_v1_ClientStatsPerToken_set_num_calls(cur_msg, cur.count);
}
}
- return grpc_grpclb_request_encode(req, arena);
+ return grpc_grpclb_request_encode(req, arena);
}
-namespace {
+namespace {
-bool ParseServerList(const grpc_lb_v1_LoadBalanceResponse& response,
- std::vector<GrpcLbServer>* server_list) {
- // Determine the number of servers.
+bool ParseServerList(const grpc_lb_v1_LoadBalanceResponse& response,
+ std::vector<GrpcLbServer>* server_list) {
+ // Determine the number of servers.
const grpc_lb_v1_ServerList* server_list_msg =
- grpc_lb_v1_LoadBalanceResponse_server_list(&response);
- if (server_list_msg == nullptr) return false;
+ grpc_lb_v1_LoadBalanceResponse_server_list(&response);
+ if (server_list_msg == nullptr) return false;
size_t server_count = 0;
- const grpc_lb_v1_Server* const* servers =
- grpc_lb_v1_ServerList_servers(server_list_msg, &server_count);
- // Populate servers.
+ const grpc_lb_v1_Server* const* servers =
+ grpc_lb_v1_ServerList_servers(server_list_msg, &server_count);
+ // Populate servers.
if (server_count > 0) {
- server_list->reserve(server_count);
+ server_list->reserve(server_count);
for (size_t i = 0; i < server_count; ++i) {
- GrpcLbServer& cur = *server_list->emplace(server_list->end());
+ GrpcLbServer& cur = *server_list->emplace(server_list->end());
upb_strview address = grpc_lb_v1_Server_ip_address(servers[i]);
if (address.size == 0) {
; // Nothing to do because cur->ip_address is an empty string.
} else if (address.size <= GRPC_GRPCLB_SERVER_IP_ADDRESS_MAX_SIZE) {
- cur.ip_size = static_cast<int32_t>(address.size);
- memcpy(cur.ip_addr, address.data, address.size);
+ cur.ip_size = static_cast<int32_t>(address.size);
+ memcpy(cur.ip_addr, address.data, address.size);
}
- cur.port = grpc_lb_v1_Server_port(servers[i]);
+ cur.port = grpc_lb_v1_Server_port(servers[i]);
upb_strview token = grpc_lb_v1_Server_load_balance_token(servers[i]);
if (token.size == 0) {
; // Nothing to do because cur->load_balance_token is an empty string.
} else if (token.size <= GRPC_GRPCLB_SERVER_LOAD_BALANCE_TOKEN_MAX_SIZE) {
- memcpy(cur.load_balance_token, token.data, token.size);
+ memcpy(cur.load_balance_token, token.data, token.size);
} else {
gpr_log(GPR_ERROR,
"grpc_lb_v1_LoadBalanceResponse has too long token. len=%zu",
token.size);
}
- cur.drop = grpc_lb_v1_Server_drop(servers[i]);
+ cur.drop = grpc_lb_v1_Server_drop(servers[i]);
}
}
- return true;
+ return true;
}
-grpc_millis grpc_grpclb_duration_to_millis(
- const google_protobuf_Duration* duration_pb) {
- return static_cast<grpc_millis>(
- (google_protobuf_Duration_seconds(duration_pb) * GPR_MS_PER_SEC) +
- (google_protobuf_Duration_nanos(duration_pb) / GPR_NS_PER_MS));
+grpc_millis grpc_grpclb_duration_to_millis(
+ const google_protobuf_Duration* duration_pb) {
+ return static_cast<grpc_millis>(
+ (google_protobuf_Duration_seconds(duration_pb) * GPR_MS_PER_SEC) +
+ (google_protobuf_Duration_nanos(duration_pb) / GPR_NS_PER_MS));
}
-} // namespace
-
-bool GrpcLbResponseParse(const grpc_slice& encoded_grpc_grpclb_response,
- upb_arena* arena, GrpcLbResponse* result) {
- grpc_lb_v1_LoadBalanceResponse* response =
- grpc_lb_v1_LoadBalanceResponse_parse(
- reinterpret_cast<const char*>(
- GRPC_SLICE_START_PTR(encoded_grpc_grpclb_response)),
- GRPC_SLICE_LENGTH(encoded_grpc_grpclb_response), arena);
- // Handle serverlist responses.
- if (ParseServerList(*response, &result->serverlist)) {
- result->type = result->SERVERLIST;
- return true;
+} // namespace
+
+bool GrpcLbResponseParse(const grpc_slice& encoded_grpc_grpclb_response,
+ upb_arena* arena, GrpcLbResponse* result) {
+ grpc_lb_v1_LoadBalanceResponse* response =
+ grpc_lb_v1_LoadBalanceResponse_parse(
+ reinterpret_cast<const char*>(
+ GRPC_SLICE_START_PTR(encoded_grpc_grpclb_response)),
+ GRPC_SLICE_LENGTH(encoded_grpc_grpclb_response), arena);
+ // Handle serverlist responses.
+ if (ParseServerList(*response, &result->serverlist)) {
+ result->type = result->SERVERLIST;
+ return true;
}
- // Handle initial responses.
- auto* initial_response =
- grpc_lb_v1_LoadBalanceResponse_initial_response(response);
- if (initial_response != nullptr) {
- result->type = result->INITIAL;
- const google_protobuf_Duration* client_stats_report_interval =
- grpc_lb_v1_InitialLoadBalanceResponse_client_stats_report_interval(
- initial_response);
- if (client_stats_report_interval != nullptr) {
- result->client_stats_report_interval =
- grpc_grpclb_duration_to_millis(client_stats_report_interval);
+ // Handle initial responses.
+ auto* initial_response =
+ grpc_lb_v1_LoadBalanceResponse_initial_response(response);
+ if (initial_response != nullptr) {
+ result->type = result->INITIAL;
+ const google_protobuf_Duration* client_stats_report_interval =
+ grpc_lb_v1_InitialLoadBalanceResponse_client_stats_report_interval(
+ initial_response);
+ if (client_stats_report_interval != nullptr) {
+ result->client_stats_report_interval =
+ grpc_grpclb_duration_to_millis(client_stats_report_interval);
}
- return true;
+ return true;
+ }
+ // Handle fallback.
+ if (grpc_lb_v1_LoadBalanceResponse_has_fallback_response(response)) {
+ result->type = result->FALLBACK;
+ return true;
}
- // Handle fallback.
- if (grpc_lb_v1_LoadBalanceResponse_has_fallback_response(response)) {
- result->type = result->FALLBACK;
- return true;
- }
- // Unknown response type.
- return false;
+ // Unknown response type.
+ return false;
}
} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h
index 33bf6495490..6caa120f587 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h
@@ -21,8 +21,8 @@
#include <grpc/support/port_platform.h>
-#include <vector>
-
+#include <vector>
+
#include <grpc/slice_buffer.h>
#include "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h"
@@ -37,36 +37,36 @@ namespace grpc_core {
// Contains server information. When the drop field is not true, use the other
// fields.
-struct GrpcLbServer {
- int32_t ip_size;
- char ip_addr[GRPC_GRPCLB_SERVER_IP_ADDRESS_MAX_SIZE];
+struct GrpcLbServer {
+ int32_t ip_size;
+ char ip_addr[GRPC_GRPCLB_SERVER_IP_ADDRESS_MAX_SIZE];
int32_t port;
char load_balance_token[GRPC_GRPCLB_SERVER_LOAD_BALANCE_TOKEN_MAX_SIZE];
bool drop;
- bool operator==(const GrpcLbServer& other) const;
-};
+ bool operator==(const GrpcLbServer& other) const;
+};
-struct GrpcLbResponse {
- enum { INITIAL, SERVERLIST, FALLBACK } type;
- grpc_millis client_stats_report_interval = 0;
- std::vector<GrpcLbServer> serverlist;
-};
+struct GrpcLbResponse {
+ enum { INITIAL, SERVERLIST, FALLBACK } type;
+ grpc_millis client_stats_report_interval = 0;
+ std::vector<GrpcLbServer> serverlist;
+};
-// Creates a serialized grpclb request.
-grpc_slice GrpcLbRequestCreate(const char* lb_service_name, upb_arena* arena);
+// Creates a serialized grpclb request.
+grpc_slice GrpcLbRequestCreate(const char* lb_service_name, upb_arena* arena);
-// Creates a serialized grpclb load report request.
-grpc_slice GrpcLbLoadReportRequestCreate(
- int64_t num_calls_started, int64_t num_calls_finished,
- int64_t num_calls_finished_with_client_failed_to_send,
- int64_t num_calls_finished_known_received,
- const GrpcLbClientStats::DroppedCallCounts* drop_token_counts,
- upb_arena* arena);
+// Creates a serialized grpclb load report request.
+grpc_slice GrpcLbLoadReportRequestCreate(
+ int64_t num_calls_started, int64_t num_calls_finished,
+ int64_t num_calls_finished_with_client_failed_to_send,
+ int64_t num_calls_finished_known_received,
+ const GrpcLbClientStats::DroppedCallCounts* drop_token_counts,
+ upb_arena* arena);
-// Deserialize a grpclb response.
-bool GrpcLbResponseParse(const grpc_slice& serialized_response,
- upb_arena* arena, GrpcLbResponse* response);
+// Deserialize a grpclb response.
+bool GrpcLbResponseParse(const grpc_slice& serialized_response,
+ upb_arena* arena, GrpcLbResponse* response);
} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc
index 0cdbdef29dc..ab780530085 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc
@@ -30,7 +30,7 @@
#include "src/core/lib/gprpp/sync.h"
#include "src/core/lib/iomgr/sockaddr_utils.h"
#include "src/core/lib/transport/connectivity_state.h"
-#include "src/core/lib/transport/error_utils.h"
+#include "src/core/lib/transport/error_utils.h"
namespace grpc_core {
@@ -84,9 +84,9 @@ class PickFirst : public LoadBalancingPolicy {
PickFirstSubchannelData> {
public:
PickFirstSubchannelList(PickFirst* policy, TraceFlag* tracer,
- ServerAddressList addresses,
+ ServerAddressList addresses,
const grpc_channel_args& args)
- : SubchannelList(policy, tracer, std::move(addresses),
+ : SubchannelList(policy, tracer, std::move(addresses),
policy->channel_control_helper(), args) {
// Need to maintain a ref to the LB policy as long as we maintain
// any references to subchannels, since the subchannels'
@@ -201,8 +201,8 @@ void PickFirst::AttemptToConnectUsingLatestUpdateArgsLocked() {
grpc_error_set_int(GRPC_ERROR_CREATE_FROM_STATIC_STRING("Empty update"),
GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE);
channel_control_helper()->UpdateState(
- GRPC_CHANNEL_TRANSIENT_FAILURE, grpc_error_to_absl_status(error),
- y_absl::make_unique<TransientFailurePicker>(error));
+ GRPC_CHANNEL_TRANSIENT_FAILURE, grpc_error_to_absl_status(error),
+ y_absl::make_unique<TransientFailurePicker>(error));
return;
}
// If one of the subchannels in the new list is already in state
@@ -319,13 +319,13 @@ void PickFirst::PickFirstSubchannelData::ProcessConnectivityChangeLocked(
"selected subchannel failed; switching to pending update"),
GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE);
p->channel_control_helper()->UpdateState(
- GRPC_CHANNEL_TRANSIENT_FAILURE, grpc_error_to_absl_status(error),
- y_absl::make_unique<TransientFailurePicker>(error));
+ GRPC_CHANNEL_TRANSIENT_FAILURE, grpc_error_to_absl_status(error),
+ y_absl::make_unique<TransientFailurePicker>(error));
} else {
p->channel_control_helper()->UpdateState(
- GRPC_CHANNEL_CONNECTING, y_absl::Status(),
- y_absl::make_unique<QueuePicker>(
- p->Ref(DEBUG_LOCATION, "QueuePicker")));
+ GRPC_CHANNEL_CONNECTING, y_absl::Status(),
+ y_absl::make_unique<QueuePicker>(
+ p->Ref(DEBUG_LOCATION, "QueuePicker")));
}
} else {
if (connectivity_state == GRPC_CHANNEL_TRANSIENT_FAILURE) {
@@ -340,22 +340,22 @@ void PickFirst::PickFirstSubchannelData::ProcessConnectivityChangeLocked(
p->selected_ = nullptr;
p->subchannel_list_.reset();
p->channel_control_helper()->UpdateState(
- GRPC_CHANNEL_IDLE, y_absl::Status(),
- y_absl::make_unique<QueuePicker>(
- p->Ref(DEBUG_LOCATION, "QueuePicker")));
+ GRPC_CHANNEL_IDLE, y_absl::Status(),
+ y_absl::make_unique<QueuePicker>(
+ p->Ref(DEBUG_LOCATION, "QueuePicker")));
} else {
// This is unlikely but can happen when a subchannel has been asked
// to reconnect by a different channel and this channel has dropped
// some connectivity state notifications.
if (connectivity_state == GRPC_CHANNEL_READY) {
p->channel_control_helper()->UpdateState(
- GRPC_CHANNEL_READY, y_absl::Status(),
- y_absl::make_unique<Picker>(subchannel()->Ref()));
+ GRPC_CHANNEL_READY, y_absl::Status(),
+ y_absl::make_unique<Picker>(subchannel()->Ref()));
} else { // CONNECTING
p->channel_control_helper()->UpdateState(
- connectivity_state, y_absl::Status(),
- y_absl::make_unique<QueuePicker>(
- p->Ref(DEBUG_LOCATION, "QueuePicker")));
+ connectivity_state, y_absl::Status(),
+ y_absl::make_unique<QueuePicker>(
+ p->Ref(DEBUG_LOCATION, "QueuePicker")));
}
}
}
@@ -398,8 +398,8 @@ void PickFirst::PickFirstSubchannelData::ProcessConnectivityChangeLocked(
"failed to connect to all addresses"),
GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE);
p->channel_control_helper()->UpdateState(
- GRPC_CHANNEL_TRANSIENT_FAILURE, grpc_error_to_absl_status(error),
- y_absl::make_unique<TransientFailurePicker>(error));
+ GRPC_CHANNEL_TRANSIENT_FAILURE, grpc_error_to_absl_status(error),
+ y_absl::make_unique<TransientFailurePicker>(error));
}
}
sd->CheckConnectivityStateAndStartWatchingLocked();
@@ -410,9 +410,9 @@ void PickFirst::PickFirstSubchannelData::ProcessConnectivityChangeLocked(
// Only update connectivity state in case 1.
if (subchannel_list() == p->subchannel_list_.get()) {
p->channel_control_helper()->UpdateState(
- GRPC_CHANNEL_CONNECTING, y_absl::Status(),
- y_absl::make_unique<QueuePicker>(
- p->Ref(DEBUG_LOCATION, "QueuePicker")));
+ GRPC_CHANNEL_CONNECTING, y_absl::Status(),
+ y_absl::make_unique<QueuePicker>(
+ p->Ref(DEBUG_LOCATION, "QueuePicker")));
}
break;
}
@@ -451,8 +451,8 @@ void PickFirst::PickFirstSubchannelData::ProcessUnselectedReadyLocked() {
}
p->selected_ = this;
p->channel_control_helper()->UpdateState(
- GRPC_CHANNEL_READY, y_absl::Status(),
- y_absl::make_unique<Picker>(subchannel()->Ref()));
+ GRPC_CHANNEL_READY, y_absl::Status(),
+ y_absl::make_unique<Picker>(subchannel()->Ref()));
for (size_t i = 0; i < subchannel_list()->num_subchannels(); ++i) {
if (i != Index()) {
subchannel_list()->subchannel(i)->ShutdownLocked();
@@ -478,7 +478,7 @@ void PickFirst::PickFirstSubchannelData::
}
}
-class PickFirstConfig : public LoadBalancingPolicy::Config {
+class PickFirstConfig : public LoadBalancingPolicy::Config {
public:
const char* name() const override { return kPickFirst; }
};
@@ -497,8 +497,8 @@ class PickFirstFactory : public LoadBalancingPolicyFactory {
const char* name() const override { return kPickFirst; }
RefCountedPtr<LoadBalancingPolicy::Config> ParseLoadBalancingConfig(
- const Json& json, grpc_error** /*error*/) const override {
- return MakeRefCounted<PickFirstConfig>();
+ const Json& json, grpc_error** /*error*/) const override {
+ return MakeRefCounted<PickFirstConfig>();
}
};
@@ -509,7 +509,7 @@ class PickFirstFactory : public LoadBalancingPolicyFactory {
void grpc_lb_policy_pick_first_init() {
grpc_core::LoadBalancingPolicyRegistry::Builder::
RegisterLoadBalancingPolicyFactory(
- y_absl::make_unique<grpc_core::PickFirstFactory>());
+ y_absl::make_unique<grpc_core::PickFirstFactory>());
}
void grpc_lb_policy_pick_first_shutdown() {}
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/priority/priority.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/priority/priority.cc
index b501036ff53..38114b1a007 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/priority/priority.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/priority/priority.cc
@@ -1,890 +1,890 @@
-//
-// Copyright 2018 gRPC authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-#include <grpc/support/port_platform.h>
-
-#include <inttypes.h>
-#include <limits.h>
-
-#include "y_absl/strings/str_cat.h"
-#include "y_absl/strings/str_format.h"
-
-#include <grpc/grpc.h>
-
-#include "src/core/ext/filters/client_channel/lb_policy.h"
-#include "src/core/ext/filters/client_channel/lb_policy/address_filtering.h"
-#include "src/core/ext/filters/client_channel/lb_policy/child_policy_handler.h"
-#include "src/core/ext/filters/client_channel/lb_policy_factory.h"
-#include "src/core/ext/filters/client_channel/lb_policy_registry.h"
-#include "src/core/lib/channel/channel_args.h"
-#include "src/core/lib/gprpp/orphanable.h"
-#include "src/core/lib/gprpp/ref_counted_ptr.h"
-#include "src/core/lib/iomgr/timer.h"
-#include "src/core/lib/iomgr/work_serializer.h"
-#include "src/core/lib/transport/error_utils.h"
-
-namespace grpc_core {
-
-TraceFlag grpc_lb_priority_trace(false, "priority_lb");
-
-namespace {
-
-constexpr char kPriority[] = "priority_experimental";
-
-// How long we keep a child around for after it is no longer being used
-// (either because it has been removed from the config or because we
-// have switched to a higher-priority child).
-constexpr int kChildRetentionIntervalMs = 15 * 60 * 1000;
-
-// Default for how long we wait for a newly created child to get connected
-// before starting to attempt the next priority. Overridable via channel arg.
-constexpr int kDefaultChildFailoverTimeoutMs = 10000;
-
-// Config for priority LB policy.
-class PriorityLbConfig : public LoadBalancingPolicy::Config {
- public:
- PriorityLbConfig(
- std::map<TString, RefCountedPtr<LoadBalancingPolicy::Config>>
- children,
- std::vector<TString> priorities)
- : children_(std::move(children)), priorities_(std::move(priorities)) {}
-
- const char* name() const override { return kPriority; }
-
- const std::map<TString, RefCountedPtr<LoadBalancingPolicy::Config>>&
- children() const {
- return children_;
- }
- const std::vector<TString>& priorities() const { return priorities_; }
-
- private:
- const std::map<TString, RefCountedPtr<LoadBalancingPolicy::Config>>
- children_;
- const std::vector<TString> priorities_;
-};
-
-// priority LB policy.
-class PriorityLb : public LoadBalancingPolicy {
- public:
- explicit PriorityLb(Args args);
-
- const char* name() const override { return kPriority; }
-
- void UpdateLocked(UpdateArgs args) override;
- void ExitIdleLocked() override;
- void ResetBackoffLocked() override;
-
- private:
- // Each ChildPriority holds a ref to the PriorityLb.
- class ChildPriority : public InternallyRefCounted<ChildPriority> {
- public:
- ChildPriority(RefCountedPtr<PriorityLb> priority_policy, TString name);
-
- ~ChildPriority() {
- priority_policy_.reset(DEBUG_LOCATION, "ChildPriority");
- }
-
- const TString& name() const { return name_; }
-
- void UpdateLocked(RefCountedPtr<LoadBalancingPolicy::Config> config);
- void ExitIdleLocked();
- void ResetBackoffLocked();
- void DeactivateLocked();
- void MaybeReactivateLocked();
- void MaybeCancelFailoverTimerLocked();
-
- void Orphan() override;
-
- std::unique_ptr<SubchannelPicker> GetPicker() {
- return y_absl::make_unique<RefCountedPickerWrapper>(picker_wrapper_);
- }
-
- grpc_connectivity_state connectivity_state() const {
- return connectivity_state_;
- }
-
- const y_absl::Status& connectivity_status() const {
- return connectivity_status_;
- }
-
- bool failover_timer_callback_pending() const {
- return failover_timer_callback_pending_;
- }
-
- private:
- // A simple wrapper for ref-counting a picker from the child policy.
- class RefCountedPicker : public RefCounted<RefCountedPicker> {
- public:
- explicit RefCountedPicker(std::unique_ptr<SubchannelPicker> picker)
- : picker_(std::move(picker)) {}
- PickResult Pick(PickArgs args) { return picker_->Pick(args); }
-
- private:
- std::unique_ptr<SubchannelPicker> picker_;
- };
-
- // A non-ref-counted wrapper for RefCountedPicker.
- class RefCountedPickerWrapper : public SubchannelPicker {
- public:
- explicit RefCountedPickerWrapper(RefCountedPtr<RefCountedPicker> picker)
- : picker_(std::move(picker)) {}
- PickResult Pick(PickArgs args) override { return picker_->Pick(args); }
-
- private:
- RefCountedPtr<RefCountedPicker> picker_;
- };
-
- class Helper : public ChannelControlHelper {
- public:
- explicit Helper(RefCountedPtr<ChildPriority> priority)
- : priority_(std::move(priority)) {}
-
- ~Helper() { priority_.reset(DEBUG_LOCATION, "Helper"); }
-
- RefCountedPtr<SubchannelInterface> CreateSubchannel(
- ServerAddress address, const grpc_channel_args& args) override;
- void UpdateState(grpc_connectivity_state state,
- const y_absl::Status& status,
- std::unique_ptr<SubchannelPicker> picker) override;
- void RequestReresolution() override;
- void AddTraceEvent(TraceSeverity severity,
- y_absl::string_view message) override;
-
- private:
- RefCountedPtr<ChildPriority> priority_;
- };
-
- // Methods for dealing with the child policy.
- OrphanablePtr<LoadBalancingPolicy> CreateChildPolicyLocked(
- const grpc_channel_args* args);
-
- void OnConnectivityStateUpdateLocked(
- grpc_connectivity_state state, const y_absl::Status& status,
- std::unique_ptr<SubchannelPicker> picker);
-
- void StartFailoverTimerLocked();
-
- static void OnFailoverTimer(void* arg, grpc_error* error);
- void OnFailoverTimerLocked(grpc_error* error);
- static void OnDeactivationTimer(void* arg, grpc_error* error);
- void OnDeactivationTimerLocked(grpc_error* error);
-
- RefCountedPtr<PriorityLb> priority_policy_;
- const TString name_;
-
- OrphanablePtr<LoadBalancingPolicy> child_policy_;
-
- grpc_connectivity_state connectivity_state_ = GRPC_CHANNEL_CONNECTING;
- y_absl::Status connectivity_status_;
- RefCountedPtr<RefCountedPicker> picker_wrapper_;
-
- // States for delayed removal.
- grpc_timer deactivation_timer_;
- grpc_closure on_deactivation_timer_;
- bool deactivation_timer_callback_pending_ = false;
-
- // States of failover.
- grpc_timer failover_timer_;
- grpc_closure on_failover_timer_;
- bool failover_timer_callback_pending_ = false;
- };
-
- ~PriorityLb();
-
- void ShutdownLocked() override;
-
- // Returns UINT32_MAX if child is not in current priority list.
- uint32_t GetChildPriorityLocked(const TString& child_name) const;
-
- void HandleChildConnectivityStateChangeLocked(ChildPriority* child);
- void DeleteChild(ChildPriority* child);
-
- void TryNextPriorityLocked(bool report_connecting);
- void SelectPriorityLocked(uint32_t priority);
-
- const int child_failover_timeout_ms_;
-
- // Current channel args and config from the resolver.
- const grpc_channel_args* args_ = nullptr;
- RefCountedPtr<PriorityLbConfig> config_;
- HierarchicalAddressMap addresses_;
-
- // Internal state.
- bool shutting_down_ = false;
-
- std::map<TString, OrphanablePtr<ChildPriority>> children_;
- // The priority that is being used.
- uint32_t current_priority_ = UINT32_MAX;
- // Points to the current child from before the most recent update.
- // We will continue to use this child until we decide which of the new
- // children to use.
- ChildPriority* current_child_from_before_update_ = nullptr;
-};
-
-//
-// PriorityLb
-//
-
-PriorityLb::PriorityLb(Args args)
- : LoadBalancingPolicy(std::move(args)),
- child_failover_timeout_ms_(grpc_channel_args_find_integer(
- args.args, GRPC_ARG_PRIORITY_FAILOVER_TIMEOUT_MS,
- {kDefaultChildFailoverTimeoutMs, 0, INT_MAX})) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) {
- gpr_log(GPR_INFO, "[priority_lb %p] created", this);
- }
-}
-
-PriorityLb::~PriorityLb() {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) {
- gpr_log(GPR_INFO, "[priority_lb %p] destroying priority LB policy", this);
- }
- grpc_channel_args_destroy(args_);
-}
-
-void PriorityLb::ShutdownLocked() {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) {
- gpr_log(GPR_INFO, "[priority_lb %p] shutting down", this);
- }
- shutting_down_ = true;
- children_.clear();
-}
-
-void PriorityLb::ExitIdleLocked() {
- if (current_priority_ != UINT32_MAX) {
- const TString& child_name = config_->priorities()[current_priority_];
- if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) {
- gpr_log(GPR_INFO,
- "[priority_lb %p] exiting IDLE for current priority %d child %s",
- this, current_priority_, child_name.c_str());
- }
- children_[child_name]->ExitIdleLocked();
- }
-}
-
-void PriorityLb::ResetBackoffLocked() {
- for (const auto& p : children_) p.second->ResetBackoffLocked();
-}
-
-void PriorityLb::UpdateLocked(UpdateArgs args) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) {
- gpr_log(GPR_INFO, "[priority_lb %p] received update", this);
- }
- // Save current child.
- if (current_priority_ != UINT32_MAX) {
- const TString& child_name = config_->priorities()[current_priority_];
- current_child_from_before_update_ = children_[child_name].get();
- // Unset current_priority_, since it was an index into the old
- // config's priority list and may no longer be valid. It will be
- // reset later by TryNextPriorityLocked(), but we unset it here in
- // case updating any of our children triggers a state update.
- current_priority_ = UINT32_MAX;
- }
- // Update config.
- config_ = std::move(args.config);
- // Update args.
- grpc_channel_args_destroy(args_);
- args_ = args.args;
- args.args = nullptr;
- // Update addresses.
- addresses_ = MakeHierarchicalAddressMap(args.addresses);
- // Check all existing children against the new config.
- for (const auto& p : children_) {
- const TString& child_name = p.first;
- auto& child = p.second;
- auto config_it = config_->children().find(child_name);
- if (config_it == config_->children().end()) {
- // Existing child not found in new config. Deactivate it.
- child->DeactivateLocked();
- } else {
- // Existing child found in new config. Update it.
- child->UpdateLocked(config_it->second);
- }
- }
- // Try to get connected.
- TryNextPriorityLocked(/*report_connecting=*/children_.empty());
-}
-
-uint32_t PriorityLb::GetChildPriorityLocked(
- const TString& child_name) const {
- for (uint32_t priority = 0; priority < config_->priorities().size();
- ++priority) {
- if (config_->priorities()[priority] == child_name) return priority;
- }
- return UINT32_MAX;
-}
-
-void PriorityLb::HandleChildConnectivityStateChangeLocked(
- ChildPriority* child) {
- // Special case for the child that was the current child before the
- // most recent update.
- if (child == current_child_from_before_update_) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) {
- gpr_log(GPR_INFO,
- "[priority_lb %p] state update for current child from before "
- "config update",
- this);
- }
- if (child->connectivity_state() == GRPC_CHANNEL_READY ||
- child->connectivity_state() == GRPC_CHANNEL_IDLE) {
- // If it's still READY or IDLE, we stick with this child, so pass
- // the new picker up to our parent.
- channel_control_helper()->UpdateState(child->connectivity_state(),
- child->connectivity_status(),
- child->GetPicker());
- } else {
- // If it's no longer READY or IDLE, we should stop using it.
- // We already started trying other priorities as a result of the
- // update, but calling TryNextPriorityLocked() ensures that we will
- // properly select between CONNECTING and TRANSIENT_FAILURE as the
- // new state to report to our parent.
- current_child_from_before_update_ = nullptr;
- TryNextPriorityLocked(/*report_connecting=*/true);
- }
- return;
- }
- // Otherwise, find the child's priority.
- uint32_t child_priority = GetChildPriorityLocked(child->name());
- if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) {
- gpr_log(GPR_INFO, "[priority_lb %p] state update for priority %d, child %s",
- this, child_priority, child->name().c_str());
- }
- // Ignore priorities not in the current config.
- if (child_priority == UINT32_MAX) return;
- // Ignore lower-than-current priorities.
- if (child_priority > current_priority_) return;
- // If a child reports TRANSIENT_FAILURE, start trying the next priority.
- // Note that even if this is for a higher-than-current priority, we
- // may still need to create some children between this priority and
- // the current one (e.g., if we got an update that inserted new
- // priorities ahead of the current one).
- if (child->connectivity_state() == GRPC_CHANNEL_TRANSIENT_FAILURE) {
- TryNextPriorityLocked(
- /*report_connecting=*/child_priority == current_priority_);
- return;
- }
- // The update is for a higher-than-current priority (or for any
- // priority if we don't have any current priority).
- if (child_priority < current_priority_) {
- // If the child reports READY or IDLE, switch to that priority.
- // Otherwise, ignore the update.
- if (child->connectivity_state() == GRPC_CHANNEL_READY ||
- child->connectivity_state() == GRPC_CHANNEL_IDLE) {
- SelectPriorityLocked(child_priority);
- }
- return;
- }
- // The current priority has returned a new picker, so pass it up to
- // our parent.
- channel_control_helper()->UpdateState(child->connectivity_state(),
- child->connectivity_status(),
- child->GetPicker());
-}
-
-void PriorityLb::DeleteChild(ChildPriority* child) {
- // If this was the current child from before the most recent update,
- // stop using it. We already started trying other priorities as a
- // result of the update, but calling TryNextPriorityLocked() ensures that
- // we will properly select between CONNECTING and TRANSIENT_FAILURE as the
- // new state to report to our parent.
- if (current_child_from_before_update_ == child) {
- current_child_from_before_update_ = nullptr;
- TryNextPriorityLocked(/*report_connecting=*/true);
- }
- children_.erase(child->name());
-}
-
-void PriorityLb::TryNextPriorityLocked(bool report_connecting) {
- for (uint32_t priority = 0; priority < config_->priorities().size();
- ++priority) {
- // If the child for the priority does not exist yet, create it.
- const TString& child_name = config_->priorities()[priority];
- if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) {
- gpr_log(GPR_INFO, "[priority_lb %p] trying priority %d, child %s", this,
- priority, child_name.c_str());
- }
- auto& child = children_[child_name];
- if (child == nullptr) {
- if (report_connecting) {
- channel_control_helper()->UpdateState(
- GRPC_CHANNEL_CONNECTING, y_absl::Status(),
- y_absl::make_unique<QueuePicker>(Ref(DEBUG_LOCATION, "QueuePicker")));
- }
- child = MakeOrphanable<ChildPriority>(
- Ref(DEBUG_LOCATION, "ChildPriority"), child_name);
- child->UpdateLocked(config_->children().find(child_name)->second);
- return;
- }
- // The child already exists.
- child->MaybeReactivateLocked();
- // If the child is in state READY or IDLE, switch to it.
- if (child->connectivity_state() == GRPC_CHANNEL_READY ||
- child->connectivity_state() == GRPC_CHANNEL_IDLE) {
- SelectPriorityLocked(priority);
- return;
- }
- // Child is not READY or IDLE.
- // If its failover timer is still pending, give it time to fire.
- if (child->failover_timer_callback_pending()) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) {
- gpr_log(GPR_INFO,
- "[priority_lb %p] priority %d, child %s: child still "
- "attempting to connect, will wait",
- this, priority, child_name.c_str());
- }
- if (report_connecting) {
- channel_control_helper()->UpdateState(
- GRPC_CHANNEL_CONNECTING, y_absl::Status(),
- y_absl::make_unique<QueuePicker>(Ref(DEBUG_LOCATION, "QueuePicker")));
- }
- return;
- }
- // Child has been failing for a while. Move on to the next priority.
- }
- // If there are no more priorities to try, report TRANSIENT_FAILURE.
- if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) {
- gpr_log(GPR_INFO,
- "[priority_lb %p] no priority reachable, putting channel in "
- "TRANSIENT_FAILURE",
- this);
- }
- current_priority_ = UINT32_MAX;
- current_child_from_before_update_ = nullptr;
- grpc_error* error = grpc_error_set_int(
- GRPC_ERROR_CREATE_FROM_STATIC_STRING("no ready priority"),
- GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE);
- channel_control_helper()->UpdateState(
- GRPC_CHANNEL_TRANSIENT_FAILURE, grpc_error_to_absl_status(error),
- y_absl::make_unique<TransientFailurePicker>(error));
-}
-
-void PriorityLb::SelectPriorityLocked(uint32_t priority) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) {
- gpr_log(GPR_INFO, "[priority_lb %p] selected priority %d, child %s", this,
- priority, config_->priorities()[priority].c_str());
- }
- current_priority_ = priority;
- current_child_from_before_update_ = nullptr;
- // Deactivate lower priorities.
- for (uint32_t p = priority + 1; p < config_->priorities().size(); ++p) {
- const TString& child_name = config_->priorities()[p];
- auto it = children_.find(child_name);
- if (it != children_.end()) it->second->DeactivateLocked();
- }
- // Update picker.
- auto& child = children_[config_->priorities()[priority]];
- channel_control_helper()->UpdateState(child->connectivity_state(),
- child->connectivity_status(),
- child->GetPicker());
-}
-
-//
-// PriorityLb::ChildPriority
-//
-
-PriorityLb::ChildPriority::ChildPriority(
- RefCountedPtr<PriorityLb> priority_policy, TString name)
- : priority_policy_(std::move(priority_policy)), name_(std::move(name)) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) {
- gpr_log(GPR_INFO, "[priority_lb %p] creating child %s (%p)",
- priority_policy_.get(), name_.c_str(), this);
- }
- GRPC_CLOSURE_INIT(&on_failover_timer_, OnFailoverTimer, this,
- grpc_schedule_on_exec_ctx);
- GRPC_CLOSURE_INIT(&on_deactivation_timer_, OnDeactivationTimer, this,
- grpc_schedule_on_exec_ctx);
- // Start the failover timer.
- StartFailoverTimerLocked();
-}
-
-void PriorityLb::ChildPriority::Orphan() {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) {
- gpr_log(GPR_INFO, "[priority_lb %p] child %s (%p): orphaned",
- priority_policy_.get(), name_.c_str(), this);
- }
- MaybeCancelFailoverTimerLocked();
- if (deactivation_timer_callback_pending_) {
- grpc_timer_cancel(&deactivation_timer_);
- }
- // Remove the child policy's interested_parties pollset_set from the
- // xDS policy.
- grpc_pollset_set_del_pollset_set(child_policy_->interested_parties(),
- priority_policy_->interested_parties());
- child_policy_.reset();
- // Drop our ref to the child's picker, in case it's holding a ref to
- // the child.
- picker_wrapper_.reset();
- if (deactivation_timer_callback_pending_) {
- grpc_timer_cancel(&deactivation_timer_);
- }
- Unref(DEBUG_LOCATION, "ChildPriority+Orphan");
-}
-
-void PriorityLb::ChildPriority::UpdateLocked(
- RefCountedPtr<LoadBalancingPolicy::Config> config) {
- if (priority_policy_->shutting_down_) return;
- if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) {
- gpr_log(GPR_INFO, "[priority_lb %p] child %s (%p): start update",
- priority_policy_.get(), name_.c_str(), this);
- }
- // Create policy if needed.
- if (child_policy_ == nullptr) {
- child_policy_ = CreateChildPolicyLocked(priority_policy_->args_);
- }
- // Construct update args.
- UpdateArgs update_args;
- update_args.config = std::move(config);
- update_args.addresses = priority_policy_->addresses_[name_];
- update_args.args = grpc_channel_args_copy(priority_policy_->args_);
- // Update the policy.
- if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) {
- gpr_log(GPR_INFO,
- "[priority_lb %p] child %s (%p): updating child policy handler %p",
- priority_policy_.get(), name_.c_str(), this, child_policy_.get());
- }
- child_policy_->UpdateLocked(std::move(update_args));
-}
-
-OrphanablePtr<LoadBalancingPolicy>
-PriorityLb::ChildPriority::CreateChildPolicyLocked(
- const grpc_channel_args* args) {
- LoadBalancingPolicy::Args lb_policy_args;
- lb_policy_args.work_serializer = priority_policy_->work_serializer();
- lb_policy_args.args = args;
- lb_policy_args.channel_control_helper =
- y_absl::make_unique<Helper>(this->Ref(DEBUG_LOCATION, "Helper"));
- OrphanablePtr<LoadBalancingPolicy> lb_policy =
- MakeOrphanable<ChildPolicyHandler>(std::move(lb_policy_args),
- &grpc_lb_priority_trace);
- if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) {
- gpr_log(GPR_INFO,
- "[priority_lb %p] child %s (%p): created new child policy "
- "handler %p",
- priority_policy_.get(), name_.c_str(), this, lb_policy.get());
- }
- // Add the parent's interested_parties pollset_set to that of the newly
- // created child policy. This will make the child policy progress upon
- // activity on the parent LB, which in turn is tied to the application's call.
- grpc_pollset_set_add_pollset_set(lb_policy->interested_parties(),
- priority_policy_->interested_parties());
- return lb_policy;
-}
-
-void PriorityLb::ChildPriority::ExitIdleLocked() {
- if (connectivity_state_ == GRPC_CHANNEL_IDLE &&
- !failover_timer_callback_pending_) {
- StartFailoverTimerLocked();
- }
- child_policy_->ExitIdleLocked();
-}
-
-void PriorityLb::ChildPriority::ResetBackoffLocked() {
- child_policy_->ResetBackoffLocked();
-}
-
-void PriorityLb::ChildPriority::OnConnectivityStateUpdateLocked(
- grpc_connectivity_state state, const y_absl::Status& status,
- std::unique_ptr<SubchannelPicker> picker) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) {
- gpr_log(GPR_INFO,
- "[priority_lb %p] child %s (%p): state update: %s (%s) picker %p",
- priority_policy_.get(), name_.c_str(), this,
- ConnectivityStateName(state), status.ToString().c_str(),
- picker.get());
- }
- // Store the state and picker.
- connectivity_state_ = state;
- connectivity_status_ = status;
- picker_wrapper_ = MakeRefCounted<RefCountedPicker>(std::move(picker));
- // If READY or TRANSIENT_FAILURE, cancel failover timer.
- if (state == GRPC_CHANNEL_READY || state == GRPC_CHANNEL_TRANSIENT_FAILURE) {
- MaybeCancelFailoverTimerLocked();
- }
- // Notify the parent policy.
- priority_policy_->HandleChildConnectivityStateChangeLocked(this);
-}
-
-void PriorityLb::ChildPriority::StartFailoverTimerLocked() {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) {
- gpr_log(GPR_INFO,
- "[priority_lb %p] child %s (%p): starting failover timer for %d ms",
- priority_policy_.get(), name_.c_str(), this,
- priority_policy_->child_failover_timeout_ms_);
- }
- Ref(DEBUG_LOCATION, "ChildPriority+OnFailoverTimerLocked").release();
- grpc_timer_init(
- &failover_timer_,
- ExecCtx::Get()->Now() + priority_policy_->child_failover_timeout_ms_,
- &on_failover_timer_);
- failover_timer_callback_pending_ = true;
-}
-
-void PriorityLb::ChildPriority::MaybeCancelFailoverTimerLocked() {
- if (failover_timer_callback_pending_) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) {
- gpr_log(GPR_INFO,
- "[priority_lb %p] child %s (%p): cancelling failover timer",
- priority_policy_.get(), name_.c_str(), this);
- }
- grpc_timer_cancel(&failover_timer_);
- failover_timer_callback_pending_ = false;
- }
-}
-
-void PriorityLb::ChildPriority::OnFailoverTimer(void* arg, grpc_error* error) {
- ChildPriority* self = static_cast<ChildPriority*>(arg);
- GRPC_ERROR_REF(error); // ref owned by lambda
- self->priority_policy_->work_serializer()->Run(
- [self, error]() { self->OnFailoverTimerLocked(error); }, DEBUG_LOCATION);
-}
-
-void PriorityLb::ChildPriority::OnFailoverTimerLocked(grpc_error* error) {
- if (error == GRPC_ERROR_NONE && failover_timer_callback_pending_ &&
- !priority_policy_->shutting_down_) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) {
- gpr_log(GPR_INFO,
- "[priority_lb %p] child %s (%p): failover timer fired, "
- "reporting TRANSIENT_FAILURE",
- priority_policy_.get(), name_.c_str(), this);
- }
- failover_timer_callback_pending_ = false;
- OnConnectivityStateUpdateLocked(
- GRPC_CHANNEL_TRANSIENT_FAILURE,
- y_absl::Status(y_absl::StatusCode::kUnavailable, "failover timer fired"),
- nullptr);
- }
- Unref(DEBUG_LOCATION, "ChildPriority+OnFailoverTimerLocked");
- GRPC_ERROR_UNREF(error);
-}
-
-void PriorityLb::ChildPriority::DeactivateLocked() {
- // If already deactivated, don't do it again.
- if (deactivation_timer_callback_pending_) return;
- if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) {
- gpr_log(GPR_INFO,
- "[priority_lb %p] child %s (%p): deactivating -- will remove in %d "
- "ms.",
- priority_policy_.get(), name_.c_str(), this,
- kChildRetentionIntervalMs);
- }
- MaybeCancelFailoverTimerLocked();
- // Start a timer to delete the child.
- Ref(DEBUG_LOCATION, "ChildPriority+timer").release();
- grpc_timer_init(&deactivation_timer_,
- ExecCtx::Get()->Now() + kChildRetentionIntervalMs,
- &on_deactivation_timer_);
- deactivation_timer_callback_pending_ = true;
-}
-
-void PriorityLb::ChildPriority::MaybeReactivateLocked() {
- if (deactivation_timer_callback_pending_) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) {
- gpr_log(GPR_INFO, "[priority_lb %p] child %s (%p): reactivating",
- priority_policy_.get(), name_.c_str(), this);
- }
- deactivation_timer_callback_pending_ = false;
- grpc_timer_cancel(&deactivation_timer_);
- }
-}
-
-void PriorityLb::ChildPriority::OnDeactivationTimer(void* arg,
- grpc_error* error) {
- ChildPriority* self = static_cast<ChildPriority*>(arg);
- GRPC_ERROR_REF(error); // ref owned by lambda
- self->priority_policy_->work_serializer()->Run(
- [self, error]() { self->OnDeactivationTimerLocked(error); },
- DEBUG_LOCATION);
-}
-
-void PriorityLb::ChildPriority::OnDeactivationTimerLocked(grpc_error* error) {
- if (error == GRPC_ERROR_NONE && deactivation_timer_callback_pending_ &&
- !priority_policy_->shutting_down_) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) {
- gpr_log(GPR_INFO,
- "[priority_lb %p] child %s (%p): deactivation timer fired, "
- "deleting child",
- priority_policy_.get(), name_.c_str(), this);
- }
- deactivation_timer_callback_pending_ = false;
- priority_policy_->DeleteChild(this);
- }
- Unref(DEBUG_LOCATION, "ChildPriority+timer");
- GRPC_ERROR_UNREF(error);
-}
-
-//
-// PriorityLb::ChildPriority::Helper
-//
-
-void PriorityLb::ChildPriority::Helper::RequestReresolution() {
- if (priority_->priority_policy_->shutting_down_) return;
- priority_->priority_policy_->channel_control_helper()->RequestReresolution();
-}
-
-RefCountedPtr<SubchannelInterface>
-PriorityLb::ChildPriority::Helper::CreateSubchannel(
- ServerAddress address, const grpc_channel_args& args) {
- if (priority_->priority_policy_->shutting_down_) return nullptr;
- return priority_->priority_policy_->channel_control_helper()
- ->CreateSubchannel(std::move(address), args);
-}
-
-void PriorityLb::ChildPriority::Helper::UpdateState(
- grpc_connectivity_state state, const y_absl::Status& status,
- std::unique_ptr<SubchannelPicker> picker) {
- if (priority_->priority_policy_->shutting_down_) return;
- // Notify the priority.
- priority_->OnConnectivityStateUpdateLocked(state, status, std::move(picker));
-}
-
-void PriorityLb::ChildPriority::Helper::AddTraceEvent(
- TraceSeverity severity, y_absl::string_view message) {
- if (priority_->priority_policy_->shutting_down_) return;
- priority_->priority_policy_->channel_control_helper()->AddTraceEvent(severity,
- message);
-}
-
-//
-// factory
-//
-
-class PriorityLbFactory : public LoadBalancingPolicyFactory {
- public:
- OrphanablePtr<LoadBalancingPolicy> CreateLoadBalancingPolicy(
- LoadBalancingPolicy::Args args) const override {
- return MakeOrphanable<PriorityLb>(std::move(args));
- }
-
- const char* name() const override { return kPriority; }
-
- RefCountedPtr<LoadBalancingPolicy::Config> ParseLoadBalancingConfig(
- const Json& json, grpc_error** error) const override {
- GPR_DEBUG_ASSERT(error != nullptr && *error == GRPC_ERROR_NONE);
- if (json.type() == Json::Type::JSON_NULL) {
- // priority was mentioned as a policy in the deprecated
- // loadBalancingPolicy field or in the client API.
- *error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:loadBalancingPolicy error:priority policy requires "
- "configuration. Please use loadBalancingConfig field of service "
- "config instead.");
- return nullptr;
- }
- std::vector<grpc_error*> error_list;
- // Children.
- std::map<TString, RefCountedPtr<LoadBalancingPolicy::Config>> children;
- auto it = json.object_value().find("children");
- if (it == json.object_value().end()) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:children error:required field missing"));
- } else if (it->second.type() != Json::Type::OBJECT) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:children error:type should be object"));
- } else {
- const Json::Object& object = it->second.object_value();
- for (const auto& p : object) {
- const TString& child_name = p.first;
- const Json& element = p.second;
- if (element.type() != Json::Type::OBJECT) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("field:children key:", child_name,
- " error:should be type object")
- .c_str()));
- } else {
- auto it2 = element.object_value().find("config");
- if (it2 == element.object_value().end()) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("field:children key:", child_name,
- " error:missing 'config' field")
- .c_str()));
- } else {
- grpc_error* parse_error = GRPC_ERROR_NONE;
- auto config = LoadBalancingPolicyRegistry::ParseLoadBalancingConfig(
- it2->second, &parse_error);
- if (config == nullptr) {
- GPR_DEBUG_ASSERT(parse_error != GRPC_ERROR_NONE);
- error_list.push_back(
- GRPC_ERROR_CREATE_REFERENCING_FROM_COPIED_STRING(
- y_absl::StrCat("field:children key:", child_name).c_str(),
- &parse_error, 1));
- GRPC_ERROR_UNREF(parse_error);
- }
- children[child_name] = std::move(config);
- }
- }
- }
- }
- // Priorities.
- std::vector<TString> priorities;
- it = json.object_value().find("priorities");
- if (it == json.object_value().end()) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:priorities error:required field missing"));
- } else if (it->second.type() != Json::Type::ARRAY) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:priorities error:type should be array"));
- } else {
- const Json::Array& array = it->second.array_value();
- for (size_t i = 0; i < array.size(); ++i) {
- const Json& element = array[i];
- if (element.type() != Json::Type::STRING) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("field:priorities element:", i,
- " error:should be type string")
- .c_str()));
- } else if (children.find(element.string_value()) == children.end()) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("field:priorities element:", i,
- " error:unknown child '", element.string_value(),
- "'")
- .c_str()));
- } else {
- priorities.emplace_back(element.string_value());
- }
- }
- if (priorities.size() != children.size()) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("field:priorities error:priorities size (",
- priorities.size(), ") != children size (",
- children.size(), ")")
- .c_str()));
- }
- }
- if (error_list.empty()) {
- return MakeRefCounted<PriorityLbConfig>(std::move(children),
- std::move(priorities));
- } else {
- *error = GRPC_ERROR_CREATE_FROM_VECTOR(
- "priority_experimental LB policy config", &error_list);
- return nullptr;
- }
- }
-};
-
-} // namespace
-
-} // namespace grpc_core
-
-//
-// Plugin registration
-//
-
-void grpc_lb_policy_priority_init() {
- grpc_core::LoadBalancingPolicyRegistry::Builder::
- RegisterLoadBalancingPolicyFactory(
- y_absl::make_unique<grpc_core::PriorityLbFactory>());
-}
-
-void grpc_lb_policy_priority_shutdown() {}
+//
+// Copyright 2018 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+#include <grpc/support/port_platform.h>
+
+#include <inttypes.h>
+#include <limits.h>
+
+#include "y_absl/strings/str_cat.h"
+#include "y_absl/strings/str_format.h"
+
+#include <grpc/grpc.h>
+
+#include "src/core/ext/filters/client_channel/lb_policy.h"
+#include "src/core/ext/filters/client_channel/lb_policy/address_filtering.h"
+#include "src/core/ext/filters/client_channel/lb_policy/child_policy_handler.h"
+#include "src/core/ext/filters/client_channel/lb_policy_factory.h"
+#include "src/core/ext/filters/client_channel/lb_policy_registry.h"
+#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/gprpp/orphanable.h"
+#include "src/core/lib/gprpp/ref_counted_ptr.h"
+#include "src/core/lib/iomgr/timer.h"
+#include "src/core/lib/iomgr/work_serializer.h"
+#include "src/core/lib/transport/error_utils.h"
+
+namespace grpc_core {
+
+TraceFlag grpc_lb_priority_trace(false, "priority_lb");
+
+namespace {
+
+constexpr char kPriority[] = "priority_experimental";
+
+// How long we keep a child around for after it is no longer being used
+// (either because it has been removed from the config or because we
+// have switched to a higher-priority child).
+constexpr int kChildRetentionIntervalMs = 15 * 60 * 1000;
+
+// Default for how long we wait for a newly created child to get connected
+// before starting to attempt the next priority. Overridable via channel arg.
+constexpr int kDefaultChildFailoverTimeoutMs = 10000;
+
+// Config for priority LB policy.
+class PriorityLbConfig : public LoadBalancingPolicy::Config {
+ public:
+ PriorityLbConfig(
+ std::map<TString, RefCountedPtr<LoadBalancingPolicy::Config>>
+ children,
+ std::vector<TString> priorities)
+ : children_(std::move(children)), priorities_(std::move(priorities)) {}
+
+ const char* name() const override { return kPriority; }
+
+ const std::map<TString, RefCountedPtr<LoadBalancingPolicy::Config>>&
+ children() const {
+ return children_;
+ }
+ const std::vector<TString>& priorities() const { return priorities_; }
+
+ private:
+ const std::map<TString, RefCountedPtr<LoadBalancingPolicy::Config>>
+ children_;
+ const std::vector<TString> priorities_;
+};
+
+// priority LB policy.
+class PriorityLb : public LoadBalancingPolicy {
+ public:
+ explicit PriorityLb(Args args);
+
+ const char* name() const override { return kPriority; }
+
+ void UpdateLocked(UpdateArgs args) override;
+ void ExitIdleLocked() override;
+ void ResetBackoffLocked() override;
+
+ private:
+ // Each ChildPriority holds a ref to the PriorityLb.
+ class ChildPriority : public InternallyRefCounted<ChildPriority> {
+ public:
+ ChildPriority(RefCountedPtr<PriorityLb> priority_policy, TString name);
+
+ ~ChildPriority() {
+ priority_policy_.reset(DEBUG_LOCATION, "ChildPriority");
+ }
+
+ const TString& name() const { return name_; }
+
+ void UpdateLocked(RefCountedPtr<LoadBalancingPolicy::Config> config);
+ void ExitIdleLocked();
+ void ResetBackoffLocked();
+ void DeactivateLocked();
+ void MaybeReactivateLocked();
+ void MaybeCancelFailoverTimerLocked();
+
+ void Orphan() override;
+
+ std::unique_ptr<SubchannelPicker> GetPicker() {
+ return y_absl::make_unique<RefCountedPickerWrapper>(picker_wrapper_);
+ }
+
+ grpc_connectivity_state connectivity_state() const {
+ return connectivity_state_;
+ }
+
+ const y_absl::Status& connectivity_status() const {
+ return connectivity_status_;
+ }
+
+ bool failover_timer_callback_pending() const {
+ return failover_timer_callback_pending_;
+ }
+
+ private:
+ // A simple wrapper for ref-counting a picker from the child policy.
+ class RefCountedPicker : public RefCounted<RefCountedPicker> {
+ public:
+ explicit RefCountedPicker(std::unique_ptr<SubchannelPicker> picker)
+ : picker_(std::move(picker)) {}
+ PickResult Pick(PickArgs args) { return picker_->Pick(args); }
+
+ private:
+ std::unique_ptr<SubchannelPicker> picker_;
+ };
+
+ // A non-ref-counted wrapper for RefCountedPicker.
+ class RefCountedPickerWrapper : public SubchannelPicker {
+ public:
+ explicit RefCountedPickerWrapper(RefCountedPtr<RefCountedPicker> picker)
+ : picker_(std::move(picker)) {}
+ PickResult Pick(PickArgs args) override { return picker_->Pick(args); }
+
+ private:
+ RefCountedPtr<RefCountedPicker> picker_;
+ };
+
+ class Helper : public ChannelControlHelper {
+ public:
+ explicit Helper(RefCountedPtr<ChildPriority> priority)
+ : priority_(std::move(priority)) {}
+
+ ~Helper() { priority_.reset(DEBUG_LOCATION, "Helper"); }
+
+ RefCountedPtr<SubchannelInterface> CreateSubchannel(
+ ServerAddress address, const grpc_channel_args& args) override;
+ void UpdateState(grpc_connectivity_state state,
+ const y_absl::Status& status,
+ std::unique_ptr<SubchannelPicker> picker) override;
+ void RequestReresolution() override;
+ void AddTraceEvent(TraceSeverity severity,
+ y_absl::string_view message) override;
+
+ private:
+ RefCountedPtr<ChildPriority> priority_;
+ };
+
+ // Methods for dealing with the child policy.
+ OrphanablePtr<LoadBalancingPolicy> CreateChildPolicyLocked(
+ const grpc_channel_args* args);
+
+ void OnConnectivityStateUpdateLocked(
+ grpc_connectivity_state state, const y_absl::Status& status,
+ std::unique_ptr<SubchannelPicker> picker);
+
+ void StartFailoverTimerLocked();
+
+ static void OnFailoverTimer(void* arg, grpc_error* error);
+ void OnFailoverTimerLocked(grpc_error* error);
+ static void OnDeactivationTimer(void* arg, grpc_error* error);
+ void OnDeactivationTimerLocked(grpc_error* error);
+
+ RefCountedPtr<PriorityLb> priority_policy_;
+ const TString name_;
+
+ OrphanablePtr<LoadBalancingPolicy> child_policy_;
+
+ grpc_connectivity_state connectivity_state_ = GRPC_CHANNEL_CONNECTING;
+ y_absl::Status connectivity_status_;
+ RefCountedPtr<RefCountedPicker> picker_wrapper_;
+
+ // States for delayed removal.
+ grpc_timer deactivation_timer_;
+ grpc_closure on_deactivation_timer_;
+ bool deactivation_timer_callback_pending_ = false;
+
+ // States of failover.
+ grpc_timer failover_timer_;
+ grpc_closure on_failover_timer_;
+ bool failover_timer_callback_pending_ = false;
+ };
+
+ ~PriorityLb();
+
+ void ShutdownLocked() override;
+
+ // Returns UINT32_MAX if child is not in current priority list.
+ uint32_t GetChildPriorityLocked(const TString& child_name) const;
+
+ void HandleChildConnectivityStateChangeLocked(ChildPriority* child);
+ void DeleteChild(ChildPriority* child);
+
+ void TryNextPriorityLocked(bool report_connecting);
+ void SelectPriorityLocked(uint32_t priority);
+
+ const int child_failover_timeout_ms_;
+
+ // Current channel args and config from the resolver.
+ const grpc_channel_args* args_ = nullptr;
+ RefCountedPtr<PriorityLbConfig> config_;
+ HierarchicalAddressMap addresses_;
+
+ // Internal state.
+ bool shutting_down_ = false;
+
+ std::map<TString, OrphanablePtr<ChildPriority>> children_;
+ // The priority that is being used.
+ uint32_t current_priority_ = UINT32_MAX;
+ // Points to the current child from before the most recent update.
+ // We will continue to use this child until we decide which of the new
+ // children to use.
+ ChildPriority* current_child_from_before_update_ = nullptr;
+};
+
+//
+// PriorityLb
+//
+
+PriorityLb::PriorityLb(Args args)
+ : LoadBalancingPolicy(std::move(args)),
+ child_failover_timeout_ms_(grpc_channel_args_find_integer(
+ args.args, GRPC_ARG_PRIORITY_FAILOVER_TIMEOUT_MS,
+ {kDefaultChildFailoverTimeoutMs, 0, INT_MAX})) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) {
+ gpr_log(GPR_INFO, "[priority_lb %p] created", this);
+ }
+}
+
+PriorityLb::~PriorityLb() {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) {
+ gpr_log(GPR_INFO, "[priority_lb %p] destroying priority LB policy", this);
+ }
+ grpc_channel_args_destroy(args_);
+}
+
+void PriorityLb::ShutdownLocked() {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) {
+ gpr_log(GPR_INFO, "[priority_lb %p] shutting down", this);
+ }
+ shutting_down_ = true;
+ children_.clear();
+}
+
+void PriorityLb::ExitIdleLocked() {
+ if (current_priority_ != UINT32_MAX) {
+ const TString& child_name = config_->priorities()[current_priority_];
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) {
+ gpr_log(GPR_INFO,
+ "[priority_lb %p] exiting IDLE for current priority %d child %s",
+ this, current_priority_, child_name.c_str());
+ }
+ children_[child_name]->ExitIdleLocked();
+ }
+}
+
+void PriorityLb::ResetBackoffLocked() {
+ for (const auto& p : children_) p.second->ResetBackoffLocked();
+}
+
+void PriorityLb::UpdateLocked(UpdateArgs args) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) {
+ gpr_log(GPR_INFO, "[priority_lb %p] received update", this);
+ }
+ // Save current child.
+ if (current_priority_ != UINT32_MAX) {
+ const TString& child_name = config_->priorities()[current_priority_];
+ current_child_from_before_update_ = children_[child_name].get();
+ // Unset current_priority_, since it was an index into the old
+ // config's priority list and may no longer be valid. It will be
+ // reset later by TryNextPriorityLocked(), but we unset it here in
+ // case updating any of our children triggers a state update.
+ current_priority_ = UINT32_MAX;
+ }
+ // Update config.
+ config_ = std::move(args.config);
+ // Update args.
+ grpc_channel_args_destroy(args_);
+ args_ = args.args;
+ args.args = nullptr;
+ // Update addresses.
+ addresses_ = MakeHierarchicalAddressMap(args.addresses);
+ // Check all existing children against the new config.
+ for (const auto& p : children_) {
+ const TString& child_name = p.first;
+ auto& child = p.second;
+ auto config_it = config_->children().find(child_name);
+ if (config_it == config_->children().end()) {
+ // Existing child not found in new config. Deactivate it.
+ child->DeactivateLocked();
+ } else {
+ // Existing child found in new config. Update it.
+ child->UpdateLocked(config_it->second);
+ }
+ }
+ // Try to get connected.
+ TryNextPriorityLocked(/*report_connecting=*/children_.empty());
+}
+
+uint32_t PriorityLb::GetChildPriorityLocked(
+ const TString& child_name) const {
+ for (uint32_t priority = 0; priority < config_->priorities().size();
+ ++priority) {
+ if (config_->priorities()[priority] == child_name) return priority;
+ }
+ return UINT32_MAX;
+}
+
+void PriorityLb::HandleChildConnectivityStateChangeLocked(
+ ChildPriority* child) {
+ // Special case for the child that was the current child before the
+ // most recent update.
+ if (child == current_child_from_before_update_) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) {
+ gpr_log(GPR_INFO,
+ "[priority_lb %p] state update for current child from before "
+ "config update",
+ this);
+ }
+ if (child->connectivity_state() == GRPC_CHANNEL_READY ||
+ child->connectivity_state() == GRPC_CHANNEL_IDLE) {
+ // If it's still READY or IDLE, we stick with this child, so pass
+ // the new picker up to our parent.
+ channel_control_helper()->UpdateState(child->connectivity_state(),
+ child->connectivity_status(),
+ child->GetPicker());
+ } else {
+ // If it's no longer READY or IDLE, we should stop using it.
+ // We already started trying other priorities as a result of the
+ // update, but calling TryNextPriorityLocked() ensures that we will
+ // properly select between CONNECTING and TRANSIENT_FAILURE as the
+ // new state to report to our parent.
+ current_child_from_before_update_ = nullptr;
+ TryNextPriorityLocked(/*report_connecting=*/true);
+ }
+ return;
+ }
+ // Otherwise, find the child's priority.
+ uint32_t child_priority = GetChildPriorityLocked(child->name());
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) {
+ gpr_log(GPR_INFO, "[priority_lb %p] state update for priority %d, child %s",
+ this, child_priority, child->name().c_str());
+ }
+ // Ignore priorities not in the current config.
+ if (child_priority == UINT32_MAX) return;
+ // Ignore lower-than-current priorities.
+ if (child_priority > current_priority_) return;
+ // If a child reports TRANSIENT_FAILURE, start trying the next priority.
+ // Note that even if this is for a higher-than-current priority, we
+ // may still need to create some children between this priority and
+ // the current one (e.g., if we got an update that inserted new
+ // priorities ahead of the current one).
+ if (child->connectivity_state() == GRPC_CHANNEL_TRANSIENT_FAILURE) {
+ TryNextPriorityLocked(
+ /*report_connecting=*/child_priority == current_priority_);
+ return;
+ }
+ // The update is for a higher-than-current priority (or for any
+ // priority if we don't have any current priority).
+ if (child_priority < current_priority_) {
+ // If the child reports READY or IDLE, switch to that priority.
+ // Otherwise, ignore the update.
+ if (child->connectivity_state() == GRPC_CHANNEL_READY ||
+ child->connectivity_state() == GRPC_CHANNEL_IDLE) {
+ SelectPriorityLocked(child_priority);
+ }
+ return;
+ }
+ // The current priority has returned a new picker, so pass it up to
+ // our parent.
+ channel_control_helper()->UpdateState(child->connectivity_state(),
+ child->connectivity_status(),
+ child->GetPicker());
+}
+
+void PriorityLb::DeleteChild(ChildPriority* child) {
+ // If this was the current child from before the most recent update,
+ // stop using it. We already started trying other priorities as a
+ // result of the update, but calling TryNextPriorityLocked() ensures that
+ // we will properly select between CONNECTING and TRANSIENT_FAILURE as the
+ // new state to report to our parent.
+ if (current_child_from_before_update_ == child) {
+ current_child_from_before_update_ = nullptr;
+ TryNextPriorityLocked(/*report_connecting=*/true);
+ }
+ children_.erase(child->name());
+}
+
+void PriorityLb::TryNextPriorityLocked(bool report_connecting) {
+ for (uint32_t priority = 0; priority < config_->priorities().size();
+ ++priority) {
+ // If the child for the priority does not exist yet, create it.
+ const TString& child_name = config_->priorities()[priority];
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) {
+ gpr_log(GPR_INFO, "[priority_lb %p] trying priority %d, child %s", this,
+ priority, child_name.c_str());
+ }
+ auto& child = children_[child_name];
+ if (child == nullptr) {
+ if (report_connecting) {
+ channel_control_helper()->UpdateState(
+ GRPC_CHANNEL_CONNECTING, y_absl::Status(),
+ y_absl::make_unique<QueuePicker>(Ref(DEBUG_LOCATION, "QueuePicker")));
+ }
+ child = MakeOrphanable<ChildPriority>(
+ Ref(DEBUG_LOCATION, "ChildPriority"), child_name);
+ child->UpdateLocked(config_->children().find(child_name)->second);
+ return;
+ }
+ // The child already exists.
+ child->MaybeReactivateLocked();
+ // If the child is in state READY or IDLE, switch to it.
+ if (child->connectivity_state() == GRPC_CHANNEL_READY ||
+ child->connectivity_state() == GRPC_CHANNEL_IDLE) {
+ SelectPriorityLocked(priority);
+ return;
+ }
+ // Child is not READY or IDLE.
+ // If its failover timer is still pending, give it time to fire.
+ if (child->failover_timer_callback_pending()) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) {
+ gpr_log(GPR_INFO,
+ "[priority_lb %p] priority %d, child %s: child still "
+ "attempting to connect, will wait",
+ this, priority, child_name.c_str());
+ }
+ if (report_connecting) {
+ channel_control_helper()->UpdateState(
+ GRPC_CHANNEL_CONNECTING, y_absl::Status(),
+ y_absl::make_unique<QueuePicker>(Ref(DEBUG_LOCATION, "QueuePicker")));
+ }
+ return;
+ }
+ // Child has been failing for a while. Move on to the next priority.
+ }
+ // If there are no more priorities to try, report TRANSIENT_FAILURE.
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) {
+ gpr_log(GPR_INFO,
+ "[priority_lb %p] no priority reachable, putting channel in "
+ "TRANSIENT_FAILURE",
+ this);
+ }
+ current_priority_ = UINT32_MAX;
+ current_child_from_before_update_ = nullptr;
+ grpc_error* error = grpc_error_set_int(
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("no ready priority"),
+ GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE);
+ channel_control_helper()->UpdateState(
+ GRPC_CHANNEL_TRANSIENT_FAILURE, grpc_error_to_absl_status(error),
+ y_absl::make_unique<TransientFailurePicker>(error));
+}
+
+void PriorityLb::SelectPriorityLocked(uint32_t priority) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) {
+ gpr_log(GPR_INFO, "[priority_lb %p] selected priority %d, child %s", this,
+ priority, config_->priorities()[priority].c_str());
+ }
+ current_priority_ = priority;
+ current_child_from_before_update_ = nullptr;
+ // Deactivate lower priorities.
+ for (uint32_t p = priority + 1; p < config_->priorities().size(); ++p) {
+ const TString& child_name = config_->priorities()[p];
+ auto it = children_.find(child_name);
+ if (it != children_.end()) it->second->DeactivateLocked();
+ }
+ // Update picker.
+ auto& child = children_[config_->priorities()[priority]];
+ channel_control_helper()->UpdateState(child->connectivity_state(),
+ child->connectivity_status(),
+ child->GetPicker());
+}
+
+//
+// PriorityLb::ChildPriority
+//
+
+PriorityLb::ChildPriority::ChildPriority(
+ RefCountedPtr<PriorityLb> priority_policy, TString name)
+ : priority_policy_(std::move(priority_policy)), name_(std::move(name)) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) {
+ gpr_log(GPR_INFO, "[priority_lb %p] creating child %s (%p)",
+ priority_policy_.get(), name_.c_str(), this);
+ }
+ GRPC_CLOSURE_INIT(&on_failover_timer_, OnFailoverTimer, this,
+ grpc_schedule_on_exec_ctx);
+ GRPC_CLOSURE_INIT(&on_deactivation_timer_, OnDeactivationTimer, this,
+ grpc_schedule_on_exec_ctx);
+ // Start the failover timer.
+ StartFailoverTimerLocked();
+}
+
+void PriorityLb::ChildPriority::Orphan() {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) {
+ gpr_log(GPR_INFO, "[priority_lb %p] child %s (%p): orphaned",
+ priority_policy_.get(), name_.c_str(), this);
+ }
+ MaybeCancelFailoverTimerLocked();
+ if (deactivation_timer_callback_pending_) {
+ grpc_timer_cancel(&deactivation_timer_);
+ }
+ // Remove the child policy's interested_parties pollset_set from the
+ // xDS policy.
+ grpc_pollset_set_del_pollset_set(child_policy_->interested_parties(),
+ priority_policy_->interested_parties());
+ child_policy_.reset();
+ // Drop our ref to the child's picker, in case it's holding a ref to
+ // the child.
+ picker_wrapper_.reset();
+ if (deactivation_timer_callback_pending_) {
+ grpc_timer_cancel(&deactivation_timer_);
+ }
+ Unref(DEBUG_LOCATION, "ChildPriority+Orphan");
+}
+
+void PriorityLb::ChildPriority::UpdateLocked(
+ RefCountedPtr<LoadBalancingPolicy::Config> config) {
+ if (priority_policy_->shutting_down_) return;
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) {
+ gpr_log(GPR_INFO, "[priority_lb %p] child %s (%p): start update",
+ priority_policy_.get(), name_.c_str(), this);
+ }
+ // Create policy if needed.
+ if (child_policy_ == nullptr) {
+ child_policy_ = CreateChildPolicyLocked(priority_policy_->args_);
+ }
+ // Construct update args.
+ UpdateArgs update_args;
+ update_args.config = std::move(config);
+ update_args.addresses = priority_policy_->addresses_[name_];
+ update_args.args = grpc_channel_args_copy(priority_policy_->args_);
+ // Update the policy.
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) {
+ gpr_log(GPR_INFO,
+ "[priority_lb %p] child %s (%p): updating child policy handler %p",
+ priority_policy_.get(), name_.c_str(), this, child_policy_.get());
+ }
+ child_policy_->UpdateLocked(std::move(update_args));
+}
+
+OrphanablePtr<LoadBalancingPolicy>
+PriorityLb::ChildPriority::CreateChildPolicyLocked(
+ const grpc_channel_args* args) {
+ LoadBalancingPolicy::Args lb_policy_args;
+ lb_policy_args.work_serializer = priority_policy_->work_serializer();
+ lb_policy_args.args = args;
+ lb_policy_args.channel_control_helper =
+ y_absl::make_unique<Helper>(this->Ref(DEBUG_LOCATION, "Helper"));
+ OrphanablePtr<LoadBalancingPolicy> lb_policy =
+ MakeOrphanable<ChildPolicyHandler>(std::move(lb_policy_args),
+ &grpc_lb_priority_trace);
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) {
+ gpr_log(GPR_INFO,
+ "[priority_lb %p] child %s (%p): created new child policy "
+ "handler %p",
+ priority_policy_.get(), name_.c_str(), this, lb_policy.get());
+ }
+ // Add the parent's interested_parties pollset_set to that of the newly
+ // created child policy. This will make the child policy progress upon
+ // activity on the parent LB, which in turn is tied to the application's call.
+ grpc_pollset_set_add_pollset_set(lb_policy->interested_parties(),
+ priority_policy_->interested_parties());
+ return lb_policy;
+}
+
+void PriorityLb::ChildPriority::ExitIdleLocked() {
+ if (connectivity_state_ == GRPC_CHANNEL_IDLE &&
+ !failover_timer_callback_pending_) {
+ StartFailoverTimerLocked();
+ }
+ child_policy_->ExitIdleLocked();
+}
+
+void PriorityLb::ChildPriority::ResetBackoffLocked() {
+ child_policy_->ResetBackoffLocked();
+}
+
+void PriorityLb::ChildPriority::OnConnectivityStateUpdateLocked(
+ grpc_connectivity_state state, const y_absl::Status& status,
+ std::unique_ptr<SubchannelPicker> picker) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) {
+ gpr_log(GPR_INFO,
+ "[priority_lb %p] child %s (%p): state update: %s (%s) picker %p",
+ priority_policy_.get(), name_.c_str(), this,
+ ConnectivityStateName(state), status.ToString().c_str(),
+ picker.get());
+ }
+ // Store the state and picker.
+ connectivity_state_ = state;
+ connectivity_status_ = status;
+ picker_wrapper_ = MakeRefCounted<RefCountedPicker>(std::move(picker));
+ // If READY or TRANSIENT_FAILURE, cancel failover timer.
+ if (state == GRPC_CHANNEL_READY || state == GRPC_CHANNEL_TRANSIENT_FAILURE) {
+ MaybeCancelFailoverTimerLocked();
+ }
+ // Notify the parent policy.
+ priority_policy_->HandleChildConnectivityStateChangeLocked(this);
+}
+
+void PriorityLb::ChildPriority::StartFailoverTimerLocked() {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) {
+ gpr_log(GPR_INFO,
+ "[priority_lb %p] child %s (%p): starting failover timer for %d ms",
+ priority_policy_.get(), name_.c_str(), this,
+ priority_policy_->child_failover_timeout_ms_);
+ }
+ Ref(DEBUG_LOCATION, "ChildPriority+OnFailoverTimerLocked").release();
+ grpc_timer_init(
+ &failover_timer_,
+ ExecCtx::Get()->Now() + priority_policy_->child_failover_timeout_ms_,
+ &on_failover_timer_);
+ failover_timer_callback_pending_ = true;
+}
+
+void PriorityLb::ChildPriority::MaybeCancelFailoverTimerLocked() {
+ if (failover_timer_callback_pending_) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) {
+ gpr_log(GPR_INFO,
+ "[priority_lb %p] child %s (%p): cancelling failover timer",
+ priority_policy_.get(), name_.c_str(), this);
+ }
+ grpc_timer_cancel(&failover_timer_);
+ failover_timer_callback_pending_ = false;
+ }
+}
+
+void PriorityLb::ChildPriority::OnFailoverTimer(void* arg, grpc_error* error) {
+ ChildPriority* self = static_cast<ChildPriority*>(arg);
+ GRPC_ERROR_REF(error); // ref owned by lambda
+ self->priority_policy_->work_serializer()->Run(
+ [self, error]() { self->OnFailoverTimerLocked(error); }, DEBUG_LOCATION);
+}
+
+void PriorityLb::ChildPriority::OnFailoverTimerLocked(grpc_error* error) {
+ if (error == GRPC_ERROR_NONE && failover_timer_callback_pending_ &&
+ !priority_policy_->shutting_down_) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) {
+ gpr_log(GPR_INFO,
+ "[priority_lb %p] child %s (%p): failover timer fired, "
+ "reporting TRANSIENT_FAILURE",
+ priority_policy_.get(), name_.c_str(), this);
+ }
+ failover_timer_callback_pending_ = false;
+ OnConnectivityStateUpdateLocked(
+ GRPC_CHANNEL_TRANSIENT_FAILURE,
+ y_absl::Status(y_absl::StatusCode::kUnavailable, "failover timer fired"),
+ nullptr);
+ }
+ Unref(DEBUG_LOCATION, "ChildPriority+OnFailoverTimerLocked");
+ GRPC_ERROR_UNREF(error);
+}
+
+void PriorityLb::ChildPriority::DeactivateLocked() {
+ // If already deactivated, don't do it again.
+ if (deactivation_timer_callback_pending_) return;
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) {
+ gpr_log(GPR_INFO,
+ "[priority_lb %p] child %s (%p): deactivating -- will remove in %d "
+ "ms.",
+ priority_policy_.get(), name_.c_str(), this,
+ kChildRetentionIntervalMs);
+ }
+ MaybeCancelFailoverTimerLocked();
+ // Start a timer to delete the child.
+ Ref(DEBUG_LOCATION, "ChildPriority+timer").release();
+ grpc_timer_init(&deactivation_timer_,
+ ExecCtx::Get()->Now() + kChildRetentionIntervalMs,
+ &on_deactivation_timer_);
+ deactivation_timer_callback_pending_ = true;
+}
+
+void PriorityLb::ChildPriority::MaybeReactivateLocked() {
+ if (deactivation_timer_callback_pending_) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) {
+ gpr_log(GPR_INFO, "[priority_lb %p] child %s (%p): reactivating",
+ priority_policy_.get(), name_.c_str(), this);
+ }
+ deactivation_timer_callback_pending_ = false;
+ grpc_timer_cancel(&deactivation_timer_);
+ }
+}
+
+void PriorityLb::ChildPriority::OnDeactivationTimer(void* arg,
+ grpc_error* error) {
+ ChildPriority* self = static_cast<ChildPriority*>(arg);
+ GRPC_ERROR_REF(error); // ref owned by lambda
+ self->priority_policy_->work_serializer()->Run(
+ [self, error]() { self->OnDeactivationTimerLocked(error); },
+ DEBUG_LOCATION);
+}
+
+void PriorityLb::ChildPriority::OnDeactivationTimerLocked(grpc_error* error) {
+ if (error == GRPC_ERROR_NONE && deactivation_timer_callback_pending_ &&
+ !priority_policy_->shutting_down_) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) {
+ gpr_log(GPR_INFO,
+ "[priority_lb %p] child %s (%p): deactivation timer fired, "
+ "deleting child",
+ priority_policy_.get(), name_.c_str(), this);
+ }
+ deactivation_timer_callback_pending_ = false;
+ priority_policy_->DeleteChild(this);
+ }
+ Unref(DEBUG_LOCATION, "ChildPriority+timer");
+ GRPC_ERROR_UNREF(error);
+}
+
+//
+// PriorityLb::ChildPriority::Helper
+//
+
+void PriorityLb::ChildPriority::Helper::RequestReresolution() {
+ if (priority_->priority_policy_->shutting_down_) return;
+ priority_->priority_policy_->channel_control_helper()->RequestReresolution();
+}
+
+RefCountedPtr<SubchannelInterface>
+PriorityLb::ChildPriority::Helper::CreateSubchannel(
+ ServerAddress address, const grpc_channel_args& args) {
+ if (priority_->priority_policy_->shutting_down_) return nullptr;
+ return priority_->priority_policy_->channel_control_helper()
+ ->CreateSubchannel(std::move(address), args);
+}
+
+void PriorityLb::ChildPriority::Helper::UpdateState(
+ grpc_connectivity_state state, const y_absl::Status& status,
+ std::unique_ptr<SubchannelPicker> picker) {
+ if (priority_->priority_policy_->shutting_down_) return;
+ // Notify the priority.
+ priority_->OnConnectivityStateUpdateLocked(state, status, std::move(picker));
+}
+
+void PriorityLb::ChildPriority::Helper::AddTraceEvent(
+ TraceSeverity severity, y_absl::string_view message) {
+ if (priority_->priority_policy_->shutting_down_) return;
+ priority_->priority_policy_->channel_control_helper()->AddTraceEvent(severity,
+ message);
+}
+
+//
+// factory
+//
+
+class PriorityLbFactory : public LoadBalancingPolicyFactory {
+ public:
+ OrphanablePtr<LoadBalancingPolicy> CreateLoadBalancingPolicy(
+ LoadBalancingPolicy::Args args) const override {
+ return MakeOrphanable<PriorityLb>(std::move(args));
+ }
+
+ const char* name() const override { return kPriority; }
+
+ RefCountedPtr<LoadBalancingPolicy::Config> ParseLoadBalancingConfig(
+ const Json& json, grpc_error** error) const override {
+ GPR_DEBUG_ASSERT(error != nullptr && *error == GRPC_ERROR_NONE);
+ if (json.type() == Json::Type::JSON_NULL) {
+ // priority was mentioned as a policy in the deprecated
+ // loadBalancingPolicy field or in the client API.
+ *error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:loadBalancingPolicy error:priority policy requires "
+ "configuration. Please use loadBalancingConfig field of service "
+ "config instead.");
+ return nullptr;
+ }
+ std::vector<grpc_error*> error_list;
+ // Children.
+ std::map<TString, RefCountedPtr<LoadBalancingPolicy::Config>> children;
+ auto it = json.object_value().find("children");
+ if (it == json.object_value().end()) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:children error:required field missing"));
+ } else if (it->second.type() != Json::Type::OBJECT) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:children error:type should be object"));
+ } else {
+ const Json::Object& object = it->second.object_value();
+ for (const auto& p : object) {
+ const TString& child_name = p.first;
+ const Json& element = p.second;
+ if (element.type() != Json::Type::OBJECT) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrCat("field:children key:", child_name,
+ " error:should be type object")
+ .c_str()));
+ } else {
+ auto it2 = element.object_value().find("config");
+ if (it2 == element.object_value().end()) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrCat("field:children key:", child_name,
+ " error:missing 'config' field")
+ .c_str()));
+ } else {
+ grpc_error* parse_error = GRPC_ERROR_NONE;
+ auto config = LoadBalancingPolicyRegistry::ParseLoadBalancingConfig(
+ it2->second, &parse_error);
+ if (config == nullptr) {
+ GPR_DEBUG_ASSERT(parse_error != GRPC_ERROR_NONE);
+ error_list.push_back(
+ GRPC_ERROR_CREATE_REFERENCING_FROM_COPIED_STRING(
+ y_absl::StrCat("field:children key:", child_name).c_str(),
+ &parse_error, 1));
+ GRPC_ERROR_UNREF(parse_error);
+ }
+ children[child_name] = std::move(config);
+ }
+ }
+ }
+ }
+ // Priorities.
+ std::vector<TString> priorities;
+ it = json.object_value().find("priorities");
+ if (it == json.object_value().end()) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:priorities error:required field missing"));
+ } else if (it->second.type() != Json::Type::ARRAY) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:priorities error:type should be array"));
+ } else {
+ const Json::Array& array = it->second.array_value();
+ for (size_t i = 0; i < array.size(); ++i) {
+ const Json& element = array[i];
+ if (element.type() != Json::Type::STRING) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrCat("field:priorities element:", i,
+ " error:should be type string")
+ .c_str()));
+ } else if (children.find(element.string_value()) == children.end()) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrCat("field:priorities element:", i,
+ " error:unknown child '", element.string_value(),
+ "'")
+ .c_str()));
+ } else {
+ priorities.emplace_back(element.string_value());
+ }
+ }
+ if (priorities.size() != children.size()) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrCat("field:priorities error:priorities size (",
+ priorities.size(), ") != children size (",
+ children.size(), ")")
+ .c_str()));
+ }
+ }
+ if (error_list.empty()) {
+ return MakeRefCounted<PriorityLbConfig>(std::move(children),
+ std::move(priorities));
+ } else {
+ *error = GRPC_ERROR_CREATE_FROM_VECTOR(
+ "priority_experimental LB policy config", &error_list);
+ return nullptr;
+ }
+ }
+};
+
+} // namespace
+
+} // namespace grpc_core
+
+//
+// Plugin registration
+//
+
+void grpc_lb_policy_priority_init() {
+ grpc_core::LoadBalancingPolicyRegistry::Builder::
+ RegisterLoadBalancingPolicyFactory(
+ y_absl::make_unique<grpc_core::PriorityLbFactory>());
+}
+
+void grpc_lb_policy_priority_shutdown() {}
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc
index 6cf31f5b164..b277add32a1 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc
@@ -40,7 +40,7 @@
#include "src/core/lib/gprpp/sync.h"
#include "src/core/lib/iomgr/sockaddr_utils.h"
#include "src/core/lib/transport/connectivity_state.h"
-#include "src/core/lib/transport/error_utils.h"
+#include "src/core/lib/transport/error_utils.h"
#include "src/core/lib/transport/static_metadata.h"
namespace grpc_core {
@@ -112,9 +112,9 @@ class RoundRobin : public LoadBalancingPolicy {
RoundRobinSubchannelData> {
public:
RoundRobinSubchannelList(RoundRobin* policy, TraceFlag* tracer,
- ServerAddressList addresses,
+ ServerAddressList addresses,
const grpc_channel_args& args)
- : SubchannelList(policy, tracer, std::move(addresses),
+ : SubchannelList(policy, tracer, std::move(addresses),
policy->channel_control_helper(), args) {
// Need to maintain a ref to the LB policy as long as we maintain
// any references to subchannels, since the subchannels'
@@ -161,7 +161,7 @@ class RoundRobin : public LoadBalancingPolicy {
RoundRobin* parent_;
size_t last_picked_index_;
- y_absl::InlinedVector<RefCountedPtr<SubchannelInterface>, 10> subchannels_;
+ y_absl::InlinedVector<RefCountedPtr<SubchannelInterface>, 10> subchannels_;
};
void ShutdownLocked() override;
@@ -322,13 +322,13 @@ void RoundRobin::RoundRobinSubchannelList::
*/
if (num_ready_ > 0) {
/* 1) READY */
- p->channel_control_helper()->UpdateState(
- GRPC_CHANNEL_READY, y_absl::Status(), y_absl::make_unique<Picker>(p, this));
+ p->channel_control_helper()->UpdateState(
+ GRPC_CHANNEL_READY, y_absl::Status(), y_absl::make_unique<Picker>(p, this));
} else if (num_connecting_ > 0) {
/* 2) CONNECTING */
p->channel_control_helper()->UpdateState(
- GRPC_CHANNEL_CONNECTING, y_absl::Status(),
- y_absl::make_unique<QueuePicker>(p->Ref(DEBUG_LOCATION, "QueuePicker")));
+ GRPC_CHANNEL_CONNECTING, y_absl::Status(),
+ y_absl::make_unique<QueuePicker>(p->Ref(DEBUG_LOCATION, "QueuePicker")));
} else if (num_transient_failure_ == num_subchannels()) {
/* 3) TRANSIENT_FAILURE */
grpc_error* error =
@@ -336,8 +336,8 @@ void RoundRobin::RoundRobinSubchannelList::
"connections to all backends failing"),
GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE);
p->channel_control_helper()->UpdateState(
- GRPC_CHANNEL_TRANSIENT_FAILURE, grpc_error_to_absl_status(error),
- y_absl::make_unique<TransientFailurePicker>(error));
+ GRPC_CHANNEL_TRANSIENT_FAILURE, grpc_error_to_absl_status(error),
+ y_absl::make_unique<TransientFailurePicker>(error));
}
}
@@ -445,7 +445,7 @@ void RoundRobin::UpdateLocked(UpdateArgs args) {
}
}
latest_pending_subchannel_list_ = MakeOrphanable<RoundRobinSubchannelList>(
- this, &grpc_lb_round_robin_trace, std::move(args.addresses), *args.args);
+ this, &grpc_lb_round_robin_trace, std::move(args.addresses), *args.args);
if (latest_pending_subchannel_list_->num_subchannels() == 0) {
// If the new list is empty, immediately promote the new list to the
// current list and transition to TRANSIENT_FAILURE.
@@ -453,8 +453,8 @@ void RoundRobin::UpdateLocked(UpdateArgs args) {
grpc_error_set_int(GRPC_ERROR_CREATE_FROM_STATIC_STRING("Empty update"),
GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE);
channel_control_helper()->UpdateState(
- GRPC_CHANNEL_TRANSIENT_FAILURE, grpc_error_to_absl_status(error),
- y_absl::make_unique<TransientFailurePicker>(error));
+ GRPC_CHANNEL_TRANSIENT_FAILURE, grpc_error_to_absl_status(error),
+ y_absl::make_unique<TransientFailurePicker>(error));
subchannel_list_ = std::move(latest_pending_subchannel_list_);
} else if (subchannel_list_ == nullptr) {
// If there is no current list, immediately promote the new list to
@@ -468,7 +468,7 @@ void RoundRobin::UpdateLocked(UpdateArgs args) {
}
}
-class RoundRobinConfig : public LoadBalancingPolicy::Config {
+class RoundRobinConfig : public LoadBalancingPolicy::Config {
public:
const char* name() const override { return kRoundRobin; }
};
@@ -487,8 +487,8 @@ class RoundRobinFactory : public LoadBalancingPolicyFactory {
const char* name() const override { return kRoundRobin; }
RefCountedPtr<LoadBalancingPolicy::Config> ParseLoadBalancingConfig(
- const Json& /*json*/, grpc_error** /*error*/) const override {
- return MakeRefCounted<RoundRobinConfig>();
+ const Json& /*json*/, grpc_error** /*error*/) const override {
+ return MakeRefCounted<RoundRobinConfig>();
}
};
@@ -499,7 +499,7 @@ class RoundRobinFactory : public LoadBalancingPolicyFactory {
void grpc_lb_policy_round_robin_init() {
grpc_core::LoadBalancingPolicyRegistry::Builder::
RegisterLoadBalancingPolicyFactory(
- y_absl::make_unique<grpc_core::RoundRobinFactory>());
+ y_absl::make_unique<grpc_core::RoundRobinFactory>());
}
void grpc_lb_policy_round_robin_shutdown() {}
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h
index 96b70a8881f..db46cd1104e 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h
@@ -26,8 +26,8 @@
#include <grpc/support/alloc.h>
-#include "y_absl/container/inlined_vector.h"
-
+#include "y_absl/container/inlined_vector.h"
+
#include "src/core/ext/filters/client_channel/lb_policy_registry.h"
#include "src/core/ext/filters/client_channel/server_address.h"
// TODO(roth): Should not need the include of subchannel.h here, since
@@ -64,7 +64,7 @@ class MySubchannelList
};
*/
-// All methods will be called from within the client_channel work serializer.
+// All methods will be called from within the client_channel work serializer.
namespace grpc_core {
@@ -174,7 +174,7 @@ class SubchannelData {
template <typename SubchannelListType, typename SubchannelDataType>
class SubchannelList : public InternallyRefCounted<SubchannelListType> {
public:
- typedef y_absl::InlinedVector<SubchannelDataType, 10> SubchannelVector;
+ typedef y_absl::InlinedVector<SubchannelDataType, 10> SubchannelVector;
// The number of subchannels in the list.
size_t num_subchannels() const { return subchannels_.size(); }
@@ -201,7 +201,7 @@ class SubchannelList : public InternallyRefCounted<SubchannelListType> {
protected:
SubchannelList(LoadBalancingPolicy* policy, TraceFlag* tracer,
- ServerAddressList addresses,
+ ServerAddressList addresses,
LoadBalancingPolicy::ChannelControlHelper* helper,
const grpc_channel_args& args);
@@ -351,7 +351,7 @@ void SubchannelData<SubchannelListType, SubchannelDataType>::ShutdownLocked() {
template <typename SubchannelListType, typename SubchannelDataType>
SubchannelList<SubchannelListType, SubchannelDataType>::SubchannelList(
- LoadBalancingPolicy* policy, TraceFlag* tracer, ServerAddressList addresses,
+ LoadBalancingPolicy* policy, TraceFlag* tracer, ServerAddressList addresses,
LoadBalancingPolicy::ChannelControlHelper* helper,
const grpc_channel_args& args) Y_NO_SANITIZE("undefined")
: InternallyRefCounted<SubchannelListType>(tracer),
@@ -364,27 +364,27 @@ SubchannelList<SubchannelListType, SubchannelDataType>::SubchannelList(
}
subchannels_.reserve(addresses.size());
// Create a subchannel for each address.
- for (const ServerAddress& address : addresses) {
+ for (const ServerAddress& address : addresses) {
RefCountedPtr<SubchannelInterface> subchannel =
- helper->CreateSubchannel(std::move(address), args);
+ helper->CreateSubchannel(std::move(address), args);
if (subchannel == nullptr) {
// Subchannel could not be created.
if (GRPC_TRACE_FLAG_ENABLED(*tracer_)) {
gpr_log(GPR_INFO,
- "[%s %p] could not create subchannel for address %s, "
+ "[%s %p] could not create subchannel for address %s, "
"ignoring",
- tracer_->name(), policy_, address.ToString().c_str());
+ tracer_->name(), policy_, address.ToString().c_str());
}
continue;
}
if (GRPC_TRACE_FLAG_ENABLED(*tracer_)) {
gpr_log(GPR_INFO,
"[%s %p] subchannel list %p index %" PRIuPTR
- ": Created subchannel %p for address %s",
+ ": Created subchannel %p for address %s",
tracer_->name(), policy_, this, subchannels_.size(),
- subchannel.get(), address.ToString().c_str());
+ subchannel.get(), address.ToString().c_str());
}
- subchannels_.emplace_back(this, address, std::move(subchannel));
+ subchannels_.emplace_back(this, address, std::move(subchannel));
}
}
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/weighted_target/weighted_target.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/weighted_target/weighted_target.cc
index a3d1c878acd..d1d225930a5 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/weighted_target/weighted_target.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/weighted_target/weighted_target.cc
@@ -1,744 +1,744 @@
-//
-// Copyright 2018 gRPC authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-#include <grpc/support/port_platform.h>
-
-#include <inttypes.h>
-#include <limits.h>
-#include <string.h>
-
-#include "y_absl/container/inlined_vector.h"
-#include "y_absl/strings/str_cat.h"
-
-#include <grpc/grpc.h>
-
-#include "src/core/ext/filters/client_channel/lb_policy.h"
-#include "src/core/ext/filters/client_channel/lb_policy/address_filtering.h"
-#include "src/core/ext/filters/client_channel/lb_policy/child_policy_handler.h"
-#include "src/core/ext/filters/client_channel/lb_policy_factory.h"
-#include "src/core/ext/filters/client_channel/lb_policy_registry.h"
-#include "src/core/lib/channel/channel_args.h"
-#include "src/core/lib/gpr/string.h"
-#include "src/core/lib/gprpp/orphanable.h"
-#include "src/core/lib/gprpp/ref_counted_ptr.h"
-#include "src/core/lib/iomgr/timer.h"
-#include "src/core/lib/iomgr/work_serializer.h"
-#include "src/core/lib/transport/error_utils.h"
-
-namespace grpc_core {
-
-TraceFlag grpc_lb_weighted_target_trace(false, "weighted_target_lb");
-
-namespace {
-
-constexpr char kWeightedTarget[] = "weighted_target_experimental";
-
-// How long we keep a child around for after it has been removed from
-// the config.
-constexpr int kChildRetentionIntervalMs = 15 * 60 * 1000;
-
-// Config for weighted_target LB policy.
-class WeightedTargetLbConfig : public LoadBalancingPolicy::Config {
- public:
- struct ChildConfig {
- uint32_t weight;
- RefCountedPtr<LoadBalancingPolicy::Config> config;
- };
-
- using TargetMap = std::map<TString, ChildConfig>;
-
- explicit WeightedTargetLbConfig(TargetMap target_map)
- : target_map_(std::move(target_map)) {}
-
- const char* name() const override { return kWeightedTarget; }
-
- const TargetMap& target_map() const { return target_map_; }
-
- private:
- TargetMap target_map_;
-};
-
-// weighted_target LB policy.
-class WeightedTargetLb : public LoadBalancingPolicy {
- public:
- explicit WeightedTargetLb(Args args);
-
- const char* name() const override { return kWeightedTarget; }
-
- void UpdateLocked(UpdateArgs args) override;
- void ResetBackoffLocked() override;
-
- private:
- // A simple wrapper for ref-counting a picker from the child policy.
- class ChildPickerWrapper : public RefCounted<ChildPickerWrapper> {
- public:
- explicit ChildPickerWrapper(std::unique_ptr<SubchannelPicker> picker)
- : picker_(std::move(picker)) {}
- PickResult Pick(PickArgs args) { return picker_->Pick(args); }
-
- private:
- std::unique_ptr<SubchannelPicker> picker_;
- };
-
- // Picks a child using stateless WRR and then delegates to that
- // child's picker.
- class WeightedPicker : public SubchannelPicker {
- public:
- // Maintains a weighted list of pickers from each child that is in
- // ready state. The first element in the pair represents the end of a
- // range proportional to the child's weight. The start of the range
- // is the previous value in the vector and is 0 for the first element.
- using PickerList = y_absl::InlinedVector<
- std::pair<uint32_t, RefCountedPtr<ChildPickerWrapper>>, 1>;
-
- explicit WeightedPicker(PickerList pickers)
- : pickers_(std::move(pickers)) {}
-
- PickResult Pick(PickArgs args) override;
-
- private:
- PickerList pickers_;
- };
-
- // Each WeightedChild holds a ref to its parent WeightedTargetLb.
- class WeightedChild : public InternallyRefCounted<WeightedChild> {
- public:
- WeightedChild(RefCountedPtr<WeightedTargetLb> weighted_target_policy,
- const TString& name);
- ~WeightedChild();
-
- void Orphan() override;
-
- void UpdateLocked(const WeightedTargetLbConfig::ChildConfig& config,
- ServerAddressList addresses,
- const grpc_channel_args* args);
- void ResetBackoffLocked();
- void DeactivateLocked();
-
- uint32_t weight() const { return weight_; }
- grpc_connectivity_state connectivity_state() const {
- return connectivity_state_;
- }
- RefCountedPtr<ChildPickerWrapper> picker_wrapper() const {
- return picker_wrapper_;
- }
-
- private:
- class Helper : public ChannelControlHelper {
- public:
- explicit Helper(RefCountedPtr<WeightedChild> weighted_child)
- : weighted_child_(std::move(weighted_child)) {}
-
- ~Helper() { weighted_child_.reset(DEBUG_LOCATION, "Helper"); }
-
- RefCountedPtr<SubchannelInterface> CreateSubchannel(
- ServerAddress address, const grpc_channel_args& args) override;
- void UpdateState(grpc_connectivity_state state,
- const y_absl::Status& status,
- std::unique_ptr<SubchannelPicker> picker) override;
- void RequestReresolution() override;
- void AddTraceEvent(TraceSeverity severity,
- y_absl::string_view message) override;
-
- private:
- RefCountedPtr<WeightedChild> weighted_child_;
- };
-
- // Methods for dealing with the child policy.
- OrphanablePtr<LoadBalancingPolicy> CreateChildPolicyLocked(
- const grpc_channel_args* args);
-
- void OnConnectivityStateUpdateLocked(
- grpc_connectivity_state state, const y_absl::Status& status,
- std::unique_ptr<SubchannelPicker> picker);
-
- static void OnDelayedRemovalTimer(void* arg, grpc_error* error);
- void OnDelayedRemovalTimerLocked(grpc_error* error);
-
- // The owning LB policy.
- RefCountedPtr<WeightedTargetLb> weighted_target_policy_;
-
- const TString name_;
-
- uint32_t weight_;
-
- OrphanablePtr<LoadBalancingPolicy> child_policy_;
-
- RefCountedPtr<ChildPickerWrapper> picker_wrapper_;
- grpc_connectivity_state connectivity_state_ = GRPC_CHANNEL_CONNECTING;
- bool seen_failure_since_ready_ = false;
-
- // States for delayed removal.
- grpc_timer delayed_removal_timer_;
- grpc_closure on_delayed_removal_timer_;
- bool delayed_removal_timer_callback_pending_ = false;
- bool shutdown_ = false;
- };
-
- ~WeightedTargetLb();
-
- void ShutdownLocked() override;
-
- void UpdateStateLocked();
-
- // Current config from the resolver.
- RefCountedPtr<WeightedTargetLbConfig> config_;
-
- // Internal state.
- bool shutting_down_ = false;
-
- // Children.
- std::map<TString, OrphanablePtr<WeightedChild>> targets_;
-};
-
-//
-// WeightedTargetLb::WeightedPicker
-//
-
-WeightedTargetLb::PickResult WeightedTargetLb::WeightedPicker::Pick(
- PickArgs args) {
- // Generate a random number in [0, total weight).
- const uint32_t key = rand() % pickers_[pickers_.size() - 1].first;
- // Find the index in pickers_ corresponding to key.
- size_t mid = 0;
- size_t start_index = 0;
- size_t end_index = pickers_.size() - 1;
- size_t index = 0;
- while (end_index > start_index) {
- mid = (start_index + end_index) / 2;
- if (pickers_[mid].first > key) {
- end_index = mid;
- } else if (pickers_[mid].first < key) {
- start_index = mid + 1;
- } else {
- index = mid + 1;
- break;
- }
- }
- if (index == 0) index = start_index;
- GPR_ASSERT(pickers_[index].first > key);
- // Delegate to the child picker.
- return pickers_[index].second->Pick(args);
-}
-
-//
-// WeightedTargetLb
-//
-
-WeightedTargetLb::WeightedTargetLb(Args args)
- : LoadBalancingPolicy(std::move(args)) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_weighted_target_trace)) {
- gpr_log(GPR_INFO, "[weighted_target_lb %p] created", this);
- }
-}
-
-WeightedTargetLb::~WeightedTargetLb() {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_weighted_target_trace)) {
- gpr_log(GPR_INFO,
- "[weighted_target_lb %p] destroying weighted_target LB policy",
- this);
- }
-}
-
-void WeightedTargetLb::ShutdownLocked() {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_weighted_target_trace)) {
- gpr_log(GPR_INFO, "[weighted_target_lb %p] shutting down", this);
- }
- shutting_down_ = true;
- targets_.clear();
-}
-
-void WeightedTargetLb::ResetBackoffLocked() {
- for (auto& p : targets_) p.second->ResetBackoffLocked();
-}
-
-void WeightedTargetLb::UpdateLocked(UpdateArgs args) {
- if (shutting_down_) return;
- if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_weighted_target_trace)) {
- gpr_log(GPR_INFO, "[weighted_target_lb %p] Received update", this);
- }
- // Update config.
- config_ = std::move(args.config);
- // Deactivate the targets not in the new config.
- for (const auto& p : targets_) {
- const TString& name = p.first;
- WeightedChild* child = p.second.get();
- if (config_->target_map().find(name) == config_->target_map().end()) {
- child->DeactivateLocked();
- }
- }
- // Create any children that don't already exist.
- // Note that we add all children before updating any of them, because
- // an update may trigger a child to immediately update its
- // connectivity state (e.g., reporting TRANSIENT_FAILURE immediately when
- // receiving an empty address list), and we don't want to return an
- // overall state with incomplete data.
- for (const auto& p : config_->target_map()) {
- const TString& name = p.first;
- auto it = targets_.find(name);
- if (it == targets_.end()) {
- targets_.emplace(name, MakeOrphanable<WeightedChild>(
- Ref(DEBUG_LOCATION, "WeightedChild"), name));
- }
- }
- // Update all children.
- HierarchicalAddressMap address_map =
- MakeHierarchicalAddressMap(args.addresses);
- for (const auto& p : config_->target_map()) {
- const TString& name = p.first;
- const WeightedTargetLbConfig::ChildConfig& config = p.second;
- targets_[name]->UpdateLocked(config, std::move(address_map[name]),
- args.args);
- }
- UpdateStateLocked();
-}
-
-void WeightedTargetLb::UpdateStateLocked() {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_weighted_target_trace)) {
- gpr_log(GPR_INFO,
- "[weighted_target_lb %p] scanning children to determine "
- "connectivity state",
- this);
- }
- // Construct a new picker which maintains a map of all child pickers
- // that are ready. Each child is represented by a portion of the range
- // proportional to its weight, such that the total range is the sum of the
- // weights of all children.
- WeightedPicker::PickerList picker_list;
- uint32_t end = 0;
- // Also count the number of children in each state, to determine the
- // overall state.
- size_t num_connecting = 0;
- size_t num_idle = 0;
- size_t num_transient_failures = 0;
- for (const auto& p : targets_) {
- const TString& child_name = p.first;
- const WeightedChild* child = p.second.get();
- // Skip the targets that are not in the latest update.
- if (config_->target_map().find(child_name) == config_->target_map().end()) {
- continue;
- }
- if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_weighted_target_trace)) {
- gpr_log(GPR_INFO,
- "[weighted_target_lb %p] child=%s state=%s weight=%d picker=%p",
- this, child_name.c_str(),
- ConnectivityStateName(child->connectivity_state()),
- child->weight(), child->picker_wrapper().get());
- }
- switch (child->connectivity_state()) {
- case GRPC_CHANNEL_READY: {
- end += child->weight();
- picker_list.push_back(std::make_pair(end, child->picker_wrapper()));
- break;
- }
- case GRPC_CHANNEL_CONNECTING: {
- ++num_connecting;
- break;
- }
- case GRPC_CHANNEL_IDLE: {
- ++num_idle;
- break;
- }
- case GRPC_CHANNEL_TRANSIENT_FAILURE: {
- ++num_transient_failures;
- break;
- }
- default:
- GPR_UNREACHABLE_CODE(return );
- }
- }
- // Determine aggregated connectivity state.
- grpc_connectivity_state connectivity_state;
- if (!picker_list.empty()) {
- connectivity_state = GRPC_CHANNEL_READY;
- } else if (num_connecting > 0) {
- connectivity_state = GRPC_CHANNEL_CONNECTING;
- } else if (num_idle > 0) {
- connectivity_state = GRPC_CHANNEL_IDLE;
- } else {
- connectivity_state = GRPC_CHANNEL_TRANSIENT_FAILURE;
- }
- if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_weighted_target_trace)) {
- gpr_log(GPR_INFO, "[weighted_target_lb %p] connectivity changed to %s",
- this, ConnectivityStateName(connectivity_state));
- }
- std::unique_ptr<SubchannelPicker> picker;
- y_absl::Status status;
- switch (connectivity_state) {
- case GRPC_CHANNEL_READY:
- picker = y_absl::make_unique<WeightedPicker>(std::move(picker_list));
- break;
- case GRPC_CHANNEL_CONNECTING:
- case GRPC_CHANNEL_IDLE:
- picker =
- y_absl::make_unique<QueuePicker>(Ref(DEBUG_LOCATION, "QueuePicker"));
- break;
- default:
- grpc_error* error = grpc_error_set_int(
- GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "weighted_target: all children report state TRANSIENT_FAILURE"),
- GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE);
- status = grpc_error_to_absl_status(error);
- picker = y_absl::make_unique<TransientFailurePicker>(error);
- }
- channel_control_helper()->UpdateState(connectivity_state, status,
- std::move(picker));
-}
-
-//
-// WeightedTargetLb::WeightedChild
-//
-
-WeightedTargetLb::WeightedChild::WeightedChild(
- RefCountedPtr<WeightedTargetLb> weighted_target_policy,
- const TString& name)
- : weighted_target_policy_(std::move(weighted_target_policy)), name_(name) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_weighted_target_trace)) {
- gpr_log(GPR_INFO, "[weighted_target_lb %p] created WeightedChild %p for %s",
- weighted_target_policy_.get(), this, name_.c_str());
- }
- GRPC_CLOSURE_INIT(&on_delayed_removal_timer_, OnDelayedRemovalTimer, this,
- grpc_schedule_on_exec_ctx);
-}
-
-WeightedTargetLb::WeightedChild::~WeightedChild() {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_weighted_target_trace)) {
- gpr_log(GPR_INFO,
- "[weighted_target_lb %p] WeightedChild %p %s: destroying child",
- weighted_target_policy_.get(), this, name_.c_str());
- }
- weighted_target_policy_.reset(DEBUG_LOCATION, "WeightedChild");
-}
-
-void WeightedTargetLb::WeightedChild::Orphan() {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_weighted_target_trace)) {
- gpr_log(GPR_INFO,
- "[weighted_target_lb %p] WeightedChild %p %s: shutting down child",
- weighted_target_policy_.get(), this, name_.c_str());
- }
- // Remove the child policy's interested_parties pollset_set from the
- // xDS policy.
- grpc_pollset_set_del_pollset_set(
- child_policy_->interested_parties(),
- weighted_target_policy_->interested_parties());
- child_policy_.reset();
- // Drop our ref to the child's picker, in case it's holding a ref to
- // the child.
- picker_wrapper_.reset();
- if (delayed_removal_timer_callback_pending_) {
- delayed_removal_timer_callback_pending_ = false;
- grpc_timer_cancel(&delayed_removal_timer_);
- }
- shutdown_ = true;
- Unref();
-}
-
-OrphanablePtr<LoadBalancingPolicy>
-WeightedTargetLb::WeightedChild::CreateChildPolicyLocked(
- const grpc_channel_args* args) {
- LoadBalancingPolicy::Args lb_policy_args;
- lb_policy_args.work_serializer = weighted_target_policy_->work_serializer();
- lb_policy_args.args = args;
- lb_policy_args.channel_control_helper =
- y_absl::make_unique<Helper>(this->Ref(DEBUG_LOCATION, "Helper"));
- OrphanablePtr<LoadBalancingPolicy> lb_policy =
- MakeOrphanable<ChildPolicyHandler>(std::move(lb_policy_args),
- &grpc_lb_weighted_target_trace);
- if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_weighted_target_trace)) {
- gpr_log(GPR_INFO,
- "[weighted_target_lb %p] WeightedChild %p %s: Created new child "
- "policy handler %p",
- weighted_target_policy_.get(), this, name_.c_str(),
- lb_policy.get());
- }
- // Add the xDS's interested_parties pollset_set to that of the newly created
- // child policy. This will make the child policy progress upon activity on
- // xDS LB, which in turn is tied to the application's call.
- grpc_pollset_set_add_pollset_set(
- lb_policy->interested_parties(),
- weighted_target_policy_->interested_parties());
- return lb_policy;
-}
-
-void WeightedTargetLb::WeightedChild::UpdateLocked(
- const WeightedTargetLbConfig::ChildConfig& config,
- ServerAddressList addresses, const grpc_channel_args* args) {
- if (weighted_target_policy_->shutting_down_) return;
- // Update child weight.
- weight_ = config.weight;
- // Reactivate if needed.
- if (delayed_removal_timer_callback_pending_) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_weighted_target_trace)) {
- gpr_log(GPR_INFO,
- "[weighted_target_lb %p] WeightedChild %p %s: reactivating",
- weighted_target_policy_.get(), this, name_.c_str());
- }
- delayed_removal_timer_callback_pending_ = false;
- grpc_timer_cancel(&delayed_removal_timer_);
- }
- // Create child policy if needed.
- if (child_policy_ == nullptr) {
- child_policy_ = CreateChildPolicyLocked(args);
- }
- // Construct update args.
- UpdateArgs update_args;
- update_args.config = config.config;
- update_args.addresses = std::move(addresses);
- update_args.args = grpc_channel_args_copy(args);
- // Update the policy.
- if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_weighted_target_trace)) {
- gpr_log(GPR_INFO,
- "[weighted_target_lb %p] WeightedChild %p %s: Updating child "
- "policy handler %p",
- weighted_target_policy_.get(), this, name_.c_str(),
- child_policy_.get());
- }
- child_policy_->UpdateLocked(std::move(update_args));
-}
-
-void WeightedTargetLb::WeightedChild::ResetBackoffLocked() {
- child_policy_->ResetBackoffLocked();
-}
-
-void WeightedTargetLb::WeightedChild::OnConnectivityStateUpdateLocked(
- grpc_connectivity_state state, const y_absl::Status& status,
- std::unique_ptr<SubchannelPicker> picker) {
- // Cache the picker in the WeightedChild.
- picker_wrapper_ = MakeRefCounted<ChildPickerWrapper>(std::move(picker));
- if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_weighted_target_trace)) {
- gpr_log(GPR_INFO,
- "[weighted_target_lb %p] WeightedChild %p %s: connectivity "
- "state update: state=%s (%s) picker_wrapper=%p",
- weighted_target_policy_.get(), this, name_.c_str(),
- ConnectivityStateName(state), status.ToString().c_str(),
- picker_wrapper_.get());
- }
- // If the child reports IDLE, immediately tell it to exit idle.
- if (state == GRPC_CHANNEL_IDLE) child_policy_->ExitIdleLocked();
- // Decide what state to report for aggregation purposes.
- // If we haven't seen a failure since the last time we were in state
- // READY, then we report the state change as-is. However, once we do see
- // a failure, we report TRANSIENT_FAILURE and ignore any subsequent state
- // changes until we go back into state READY.
- if (!seen_failure_since_ready_) {
- if (state == GRPC_CHANNEL_TRANSIENT_FAILURE) {
- seen_failure_since_ready_ = true;
- }
- } else {
- if (state != GRPC_CHANNEL_READY) return;
- seen_failure_since_ready_ = false;
- }
- connectivity_state_ = state;
- // Notify the LB policy.
- weighted_target_policy_->UpdateStateLocked();
-}
-
-void WeightedTargetLb::WeightedChild::DeactivateLocked() {
- // If already deactivated, don't do that again.
- if (weight_ == 0) return;
- if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_weighted_target_trace)) {
- gpr_log(GPR_INFO,
- "[weighted_target_lb %p] WeightedChild %p %s: deactivating",
- weighted_target_policy_.get(), this, name_.c_str());
- }
- // Set the child weight to 0 so that future picker won't contain this child.
- weight_ = 0;
- // Start a timer to delete the child.
- Ref(DEBUG_LOCATION, "WeightedChild+timer").release();
- delayed_removal_timer_callback_pending_ = true;
- grpc_timer_init(&delayed_removal_timer_,
- ExecCtx::Get()->Now() + kChildRetentionIntervalMs,
- &on_delayed_removal_timer_);
-}
-
-void WeightedTargetLb::WeightedChild::OnDelayedRemovalTimer(void* arg,
- grpc_error* error) {
- WeightedChild* self = static_cast<WeightedChild*>(arg);
- GRPC_ERROR_REF(error); // ref owned by lambda
- self->weighted_target_policy_->work_serializer()->Run(
- [self, error]() { self->OnDelayedRemovalTimerLocked(error); },
- DEBUG_LOCATION);
-}
-
-void WeightedTargetLb::WeightedChild::OnDelayedRemovalTimerLocked(
- grpc_error* error) {
- if (error == GRPC_ERROR_NONE && delayed_removal_timer_callback_pending_ &&
- !shutdown_ && weight_ == 0) {
- delayed_removal_timer_callback_pending_ = false;
- weighted_target_policy_->targets_.erase(name_);
- }
- Unref(DEBUG_LOCATION, "WeightedChild+timer");
- GRPC_ERROR_UNREF(error);
-}
-
-//
-// WeightedTargetLb::WeightedChild::Helper
-//
-
-RefCountedPtr<SubchannelInterface>
-WeightedTargetLb::WeightedChild::Helper::CreateSubchannel(
- ServerAddress address, const grpc_channel_args& args) {
- if (weighted_child_->weighted_target_policy_->shutting_down_) return nullptr;
- return weighted_child_->weighted_target_policy_->channel_control_helper()
- ->CreateSubchannel(std::move(address), args);
-}
-
-void WeightedTargetLb::WeightedChild::Helper::UpdateState(
- grpc_connectivity_state state, const y_absl::Status& status,
- std::unique_ptr<SubchannelPicker> picker) {
- if (weighted_child_->weighted_target_policy_->shutting_down_) return;
- weighted_child_->OnConnectivityStateUpdateLocked(state, status,
- std::move(picker));
-}
-
-void WeightedTargetLb::WeightedChild::Helper::RequestReresolution() {
- if (weighted_child_->weighted_target_policy_->shutting_down_) return;
- weighted_child_->weighted_target_policy_->channel_control_helper()
- ->RequestReresolution();
-}
-
-void WeightedTargetLb::WeightedChild::Helper::AddTraceEvent(
- TraceSeverity severity, y_absl::string_view message) {
- if (weighted_child_->weighted_target_policy_->shutting_down_) return;
- weighted_child_->weighted_target_policy_->channel_control_helper()
- ->AddTraceEvent(severity, message);
-}
-
-//
-// factory
-//
-
-class WeightedTargetLbFactory : public LoadBalancingPolicyFactory {
- public:
- OrphanablePtr<LoadBalancingPolicy> CreateLoadBalancingPolicy(
- LoadBalancingPolicy::Args args) const override {
- return MakeOrphanable<WeightedTargetLb>(std::move(args));
- }
-
- const char* name() const override { return kWeightedTarget; }
-
- RefCountedPtr<LoadBalancingPolicy::Config> ParseLoadBalancingConfig(
- const Json& json, grpc_error** error) const override {
- GPR_DEBUG_ASSERT(error != nullptr && *error == GRPC_ERROR_NONE);
- if (json.type() == Json::Type::JSON_NULL) {
- // weighted_target was mentioned as a policy in the deprecated
- // loadBalancingPolicy field or in the client API.
- *error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:loadBalancingPolicy error:weighted_target policy requires "
- "configuration. Please use loadBalancingConfig field of service "
- "config instead.");
- return nullptr;
- }
- std::vector<grpc_error*> error_list;
- // Weight map.
- WeightedTargetLbConfig::TargetMap target_map;
- auto it = json.object_value().find("targets");
- if (it == json.object_value().end()) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:targets error:required field not present"));
- } else if (it->second.type() != Json::Type::OBJECT) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:targets error:type should be object"));
- } else {
- for (const auto& p : it->second.object_value()) {
- WeightedTargetLbConfig::ChildConfig child_config;
- std::vector<grpc_error*> child_errors =
- ParseChildConfig(p.second, &child_config);
- if (!child_errors.empty()) {
- // Can't use GRPC_ERROR_CREATE_FROM_VECTOR() here, because the error
- // string is not static in this case.
- grpc_error* error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("field:targets key:", p.first).c_str());
- for (grpc_error* child_error : child_errors) {
- error = grpc_error_add_child(error, child_error);
- }
- error_list.push_back(error);
- } else {
- target_map[p.first] = std::move(child_config);
- }
- }
- }
- if (!error_list.empty()) {
- *error = GRPC_ERROR_CREATE_FROM_VECTOR(
- "weighted_target_experimental LB policy config", &error_list);
- return nullptr;
- }
- return MakeRefCounted<WeightedTargetLbConfig>(std::move(target_map));
- }
-
- private:
- static std::vector<grpc_error*> ParseChildConfig(
- const Json& json, WeightedTargetLbConfig::ChildConfig* child_config) {
- std::vector<grpc_error*> error_list;
- if (json.type() != Json::Type::OBJECT) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "value should be of type object"));
- return error_list;
- }
- // Weight.
- auto it = json.object_value().find("weight");
- if (it == json.object_value().end()) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "required field \"weight\" not specified"));
- } else if (it->second.type() != Json::Type::NUMBER) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:weight error:must be of type number"));
- } else {
- int weight = gpr_parse_nonnegative_int(it->second.string_value().c_str());
- if (weight == -1) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:weight error:unparseable value"));
- } else if (weight == 0) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:weight error:value must be greater than zero"));
- } else {
- child_config->weight = weight;
- }
- }
- // Child policy.
- it = json.object_value().find("childPolicy");
- if (it != json.object_value().end()) {
- grpc_error* parse_error = GRPC_ERROR_NONE;
- child_config->config =
- LoadBalancingPolicyRegistry::ParseLoadBalancingConfig(it->second,
- &parse_error);
- if (child_config->config == nullptr) {
- GPR_DEBUG_ASSERT(parse_error != GRPC_ERROR_NONE);
- std::vector<grpc_error*> child_errors;
- child_errors.push_back(parse_error);
- error_list.push_back(
- GRPC_ERROR_CREATE_FROM_VECTOR("field:childPolicy", &child_errors));
- }
- }
- return error_list;
- }
-};
-
-} // namespace
-
-} // namespace grpc_core
-
-//
-// Plugin registration
-//
-
-void grpc_lb_policy_weighted_target_init() {
- grpc_core::LoadBalancingPolicyRegistry::Builder::
- RegisterLoadBalancingPolicyFactory(
- y_absl::make_unique<grpc_core::WeightedTargetLbFactory>());
-}
-
-void grpc_lb_policy_weighted_target_shutdown() {}
+//
+// Copyright 2018 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+#include <grpc/support/port_platform.h>
+
+#include <inttypes.h>
+#include <limits.h>
+#include <string.h>
+
+#include "y_absl/container/inlined_vector.h"
+#include "y_absl/strings/str_cat.h"
+
+#include <grpc/grpc.h>
+
+#include "src/core/ext/filters/client_channel/lb_policy.h"
+#include "src/core/ext/filters/client_channel/lb_policy/address_filtering.h"
+#include "src/core/ext/filters/client_channel/lb_policy/child_policy_handler.h"
+#include "src/core/ext/filters/client_channel/lb_policy_factory.h"
+#include "src/core/ext/filters/client_channel/lb_policy_registry.h"
+#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/gpr/string.h"
+#include "src/core/lib/gprpp/orphanable.h"
+#include "src/core/lib/gprpp/ref_counted_ptr.h"
+#include "src/core/lib/iomgr/timer.h"
+#include "src/core/lib/iomgr/work_serializer.h"
+#include "src/core/lib/transport/error_utils.h"
+
+namespace grpc_core {
+
+TraceFlag grpc_lb_weighted_target_trace(false, "weighted_target_lb");
+
+namespace {
+
+constexpr char kWeightedTarget[] = "weighted_target_experimental";
+
+// How long we keep a child around for after it has been removed from
+// the config.
+constexpr int kChildRetentionIntervalMs = 15 * 60 * 1000;
+
+// Config for weighted_target LB policy.
+class WeightedTargetLbConfig : public LoadBalancingPolicy::Config {
+ public:
+ struct ChildConfig {
+ uint32_t weight;
+ RefCountedPtr<LoadBalancingPolicy::Config> config;
+ };
+
+ using TargetMap = std::map<TString, ChildConfig>;
+
+ explicit WeightedTargetLbConfig(TargetMap target_map)
+ : target_map_(std::move(target_map)) {}
+
+ const char* name() const override { return kWeightedTarget; }
+
+ const TargetMap& target_map() const { return target_map_; }
+
+ private:
+ TargetMap target_map_;
+};
+
+// weighted_target LB policy.
+class WeightedTargetLb : public LoadBalancingPolicy {
+ public:
+ explicit WeightedTargetLb(Args args);
+
+ const char* name() const override { return kWeightedTarget; }
+
+ void UpdateLocked(UpdateArgs args) override;
+ void ResetBackoffLocked() override;
+
+ private:
+ // A simple wrapper for ref-counting a picker from the child policy.
+ class ChildPickerWrapper : public RefCounted<ChildPickerWrapper> {
+ public:
+ explicit ChildPickerWrapper(std::unique_ptr<SubchannelPicker> picker)
+ : picker_(std::move(picker)) {}
+ PickResult Pick(PickArgs args) { return picker_->Pick(args); }
+
+ private:
+ std::unique_ptr<SubchannelPicker> picker_;
+ };
+
+ // Picks a child using stateless WRR and then delegates to that
+ // child's picker.
+ class WeightedPicker : public SubchannelPicker {
+ public:
+ // Maintains a weighted list of pickers from each child that is in
+ // ready state. The first element in the pair represents the end of a
+ // range proportional to the child's weight. The start of the range
+ // is the previous value in the vector and is 0 for the first element.
+ using PickerList = y_absl::InlinedVector<
+ std::pair<uint32_t, RefCountedPtr<ChildPickerWrapper>>, 1>;
+
+ explicit WeightedPicker(PickerList pickers)
+ : pickers_(std::move(pickers)) {}
+
+ PickResult Pick(PickArgs args) override;
+
+ private:
+ PickerList pickers_;
+ };
+
+ // Each WeightedChild holds a ref to its parent WeightedTargetLb.
+ class WeightedChild : public InternallyRefCounted<WeightedChild> {
+ public:
+ WeightedChild(RefCountedPtr<WeightedTargetLb> weighted_target_policy,
+ const TString& name);
+ ~WeightedChild();
+
+ void Orphan() override;
+
+ void UpdateLocked(const WeightedTargetLbConfig::ChildConfig& config,
+ ServerAddressList addresses,
+ const grpc_channel_args* args);
+ void ResetBackoffLocked();
+ void DeactivateLocked();
+
+ uint32_t weight() const { return weight_; }
+ grpc_connectivity_state connectivity_state() const {
+ return connectivity_state_;
+ }
+ RefCountedPtr<ChildPickerWrapper> picker_wrapper() const {
+ return picker_wrapper_;
+ }
+
+ private:
+ class Helper : public ChannelControlHelper {
+ public:
+ explicit Helper(RefCountedPtr<WeightedChild> weighted_child)
+ : weighted_child_(std::move(weighted_child)) {}
+
+ ~Helper() { weighted_child_.reset(DEBUG_LOCATION, "Helper"); }
+
+ RefCountedPtr<SubchannelInterface> CreateSubchannel(
+ ServerAddress address, const grpc_channel_args& args) override;
+ void UpdateState(grpc_connectivity_state state,
+ const y_absl::Status& status,
+ std::unique_ptr<SubchannelPicker> picker) override;
+ void RequestReresolution() override;
+ void AddTraceEvent(TraceSeverity severity,
+ y_absl::string_view message) override;
+
+ private:
+ RefCountedPtr<WeightedChild> weighted_child_;
+ };
+
+ // Methods for dealing with the child policy.
+ OrphanablePtr<LoadBalancingPolicy> CreateChildPolicyLocked(
+ const grpc_channel_args* args);
+
+ void OnConnectivityStateUpdateLocked(
+ grpc_connectivity_state state, const y_absl::Status& status,
+ std::unique_ptr<SubchannelPicker> picker);
+
+ static void OnDelayedRemovalTimer(void* arg, grpc_error* error);
+ void OnDelayedRemovalTimerLocked(grpc_error* error);
+
+ // The owning LB policy.
+ RefCountedPtr<WeightedTargetLb> weighted_target_policy_;
+
+ const TString name_;
+
+ uint32_t weight_;
+
+ OrphanablePtr<LoadBalancingPolicy> child_policy_;
+
+ RefCountedPtr<ChildPickerWrapper> picker_wrapper_;
+ grpc_connectivity_state connectivity_state_ = GRPC_CHANNEL_CONNECTING;
+ bool seen_failure_since_ready_ = false;
+
+ // States for delayed removal.
+ grpc_timer delayed_removal_timer_;
+ grpc_closure on_delayed_removal_timer_;
+ bool delayed_removal_timer_callback_pending_ = false;
+ bool shutdown_ = false;
+ };
+
+ ~WeightedTargetLb();
+
+ void ShutdownLocked() override;
+
+ void UpdateStateLocked();
+
+ // Current config from the resolver.
+ RefCountedPtr<WeightedTargetLbConfig> config_;
+
+ // Internal state.
+ bool shutting_down_ = false;
+
+ // Children.
+ std::map<TString, OrphanablePtr<WeightedChild>> targets_;
+};
+
+//
+// WeightedTargetLb::WeightedPicker
+//
+
+WeightedTargetLb::PickResult WeightedTargetLb::WeightedPicker::Pick(
+ PickArgs args) {
+ // Generate a random number in [0, total weight).
+ const uint32_t key = rand() % pickers_[pickers_.size() - 1].first;
+ // Find the index in pickers_ corresponding to key.
+ size_t mid = 0;
+ size_t start_index = 0;
+ size_t end_index = pickers_.size() - 1;
+ size_t index = 0;
+ while (end_index > start_index) {
+ mid = (start_index + end_index) / 2;
+ if (pickers_[mid].first > key) {
+ end_index = mid;
+ } else if (pickers_[mid].first < key) {
+ start_index = mid + 1;
+ } else {
+ index = mid + 1;
+ break;
+ }
+ }
+ if (index == 0) index = start_index;
+ GPR_ASSERT(pickers_[index].first > key);
+ // Delegate to the child picker.
+ return pickers_[index].second->Pick(args);
+}
+
+//
+// WeightedTargetLb
+//
+
+WeightedTargetLb::WeightedTargetLb(Args args)
+ : LoadBalancingPolicy(std::move(args)) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_weighted_target_trace)) {
+ gpr_log(GPR_INFO, "[weighted_target_lb %p] created", this);
+ }
+}
+
+WeightedTargetLb::~WeightedTargetLb() {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_weighted_target_trace)) {
+ gpr_log(GPR_INFO,
+ "[weighted_target_lb %p] destroying weighted_target LB policy",
+ this);
+ }
+}
+
+void WeightedTargetLb::ShutdownLocked() {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_weighted_target_trace)) {
+ gpr_log(GPR_INFO, "[weighted_target_lb %p] shutting down", this);
+ }
+ shutting_down_ = true;
+ targets_.clear();
+}
+
+void WeightedTargetLb::ResetBackoffLocked() {
+ for (auto& p : targets_) p.second->ResetBackoffLocked();
+}
+
+void WeightedTargetLb::UpdateLocked(UpdateArgs args) {
+ if (shutting_down_) return;
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_weighted_target_trace)) {
+ gpr_log(GPR_INFO, "[weighted_target_lb %p] Received update", this);
+ }
+ // Update config.
+ config_ = std::move(args.config);
+ // Deactivate the targets not in the new config.
+ for (const auto& p : targets_) {
+ const TString& name = p.first;
+ WeightedChild* child = p.second.get();
+ if (config_->target_map().find(name) == config_->target_map().end()) {
+ child->DeactivateLocked();
+ }
+ }
+ // Create any children that don't already exist.
+ // Note that we add all children before updating any of them, because
+ // an update may trigger a child to immediately update its
+ // connectivity state (e.g., reporting TRANSIENT_FAILURE immediately when
+ // receiving an empty address list), and we don't want to return an
+ // overall state with incomplete data.
+ for (const auto& p : config_->target_map()) {
+ const TString& name = p.first;
+ auto it = targets_.find(name);
+ if (it == targets_.end()) {
+ targets_.emplace(name, MakeOrphanable<WeightedChild>(
+ Ref(DEBUG_LOCATION, "WeightedChild"), name));
+ }
+ }
+ // Update all children.
+ HierarchicalAddressMap address_map =
+ MakeHierarchicalAddressMap(args.addresses);
+ for (const auto& p : config_->target_map()) {
+ const TString& name = p.first;
+ const WeightedTargetLbConfig::ChildConfig& config = p.second;
+ targets_[name]->UpdateLocked(config, std::move(address_map[name]),
+ args.args);
+ }
+ UpdateStateLocked();
+}
+
+void WeightedTargetLb::UpdateStateLocked() {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_weighted_target_trace)) {
+ gpr_log(GPR_INFO,
+ "[weighted_target_lb %p] scanning children to determine "
+ "connectivity state",
+ this);
+ }
+ // Construct a new picker which maintains a map of all child pickers
+ // that are ready. Each child is represented by a portion of the range
+ // proportional to its weight, such that the total range is the sum of the
+ // weights of all children.
+ WeightedPicker::PickerList picker_list;
+ uint32_t end = 0;
+ // Also count the number of children in each state, to determine the
+ // overall state.
+ size_t num_connecting = 0;
+ size_t num_idle = 0;
+ size_t num_transient_failures = 0;
+ for (const auto& p : targets_) {
+ const TString& child_name = p.first;
+ const WeightedChild* child = p.second.get();
+ // Skip the targets that are not in the latest update.
+ if (config_->target_map().find(child_name) == config_->target_map().end()) {
+ continue;
+ }
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_weighted_target_trace)) {
+ gpr_log(GPR_INFO,
+ "[weighted_target_lb %p] child=%s state=%s weight=%d picker=%p",
+ this, child_name.c_str(),
+ ConnectivityStateName(child->connectivity_state()),
+ child->weight(), child->picker_wrapper().get());
+ }
+ switch (child->connectivity_state()) {
+ case GRPC_CHANNEL_READY: {
+ end += child->weight();
+ picker_list.push_back(std::make_pair(end, child->picker_wrapper()));
+ break;
+ }
+ case GRPC_CHANNEL_CONNECTING: {
+ ++num_connecting;
+ break;
+ }
+ case GRPC_CHANNEL_IDLE: {
+ ++num_idle;
+ break;
+ }
+ case GRPC_CHANNEL_TRANSIENT_FAILURE: {
+ ++num_transient_failures;
+ break;
+ }
+ default:
+ GPR_UNREACHABLE_CODE(return );
+ }
+ }
+ // Determine aggregated connectivity state.
+ grpc_connectivity_state connectivity_state;
+ if (!picker_list.empty()) {
+ connectivity_state = GRPC_CHANNEL_READY;
+ } else if (num_connecting > 0) {
+ connectivity_state = GRPC_CHANNEL_CONNECTING;
+ } else if (num_idle > 0) {
+ connectivity_state = GRPC_CHANNEL_IDLE;
+ } else {
+ connectivity_state = GRPC_CHANNEL_TRANSIENT_FAILURE;
+ }
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_weighted_target_trace)) {
+ gpr_log(GPR_INFO, "[weighted_target_lb %p] connectivity changed to %s",
+ this, ConnectivityStateName(connectivity_state));
+ }
+ std::unique_ptr<SubchannelPicker> picker;
+ y_absl::Status status;
+ switch (connectivity_state) {
+ case GRPC_CHANNEL_READY:
+ picker = y_absl::make_unique<WeightedPicker>(std::move(picker_list));
+ break;
+ case GRPC_CHANNEL_CONNECTING:
+ case GRPC_CHANNEL_IDLE:
+ picker =
+ y_absl::make_unique<QueuePicker>(Ref(DEBUG_LOCATION, "QueuePicker"));
+ break;
+ default:
+ grpc_error* error = grpc_error_set_int(
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "weighted_target: all children report state TRANSIENT_FAILURE"),
+ GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE);
+ status = grpc_error_to_absl_status(error);
+ picker = y_absl::make_unique<TransientFailurePicker>(error);
+ }
+ channel_control_helper()->UpdateState(connectivity_state, status,
+ std::move(picker));
+}
+
+//
+// WeightedTargetLb::WeightedChild
+//
+
+WeightedTargetLb::WeightedChild::WeightedChild(
+ RefCountedPtr<WeightedTargetLb> weighted_target_policy,
+ const TString& name)
+ : weighted_target_policy_(std::move(weighted_target_policy)), name_(name) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_weighted_target_trace)) {
+ gpr_log(GPR_INFO, "[weighted_target_lb %p] created WeightedChild %p for %s",
+ weighted_target_policy_.get(), this, name_.c_str());
+ }
+ GRPC_CLOSURE_INIT(&on_delayed_removal_timer_, OnDelayedRemovalTimer, this,
+ grpc_schedule_on_exec_ctx);
+}
+
+WeightedTargetLb::WeightedChild::~WeightedChild() {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_weighted_target_trace)) {
+ gpr_log(GPR_INFO,
+ "[weighted_target_lb %p] WeightedChild %p %s: destroying child",
+ weighted_target_policy_.get(), this, name_.c_str());
+ }
+ weighted_target_policy_.reset(DEBUG_LOCATION, "WeightedChild");
+}
+
+void WeightedTargetLb::WeightedChild::Orphan() {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_weighted_target_trace)) {
+ gpr_log(GPR_INFO,
+ "[weighted_target_lb %p] WeightedChild %p %s: shutting down child",
+ weighted_target_policy_.get(), this, name_.c_str());
+ }
+ // Remove the child policy's interested_parties pollset_set from the
+ // xDS policy.
+ grpc_pollset_set_del_pollset_set(
+ child_policy_->interested_parties(),
+ weighted_target_policy_->interested_parties());
+ child_policy_.reset();
+ // Drop our ref to the child's picker, in case it's holding a ref to
+ // the child.
+ picker_wrapper_.reset();
+ if (delayed_removal_timer_callback_pending_) {
+ delayed_removal_timer_callback_pending_ = false;
+ grpc_timer_cancel(&delayed_removal_timer_);
+ }
+ shutdown_ = true;
+ Unref();
+}
+
+OrphanablePtr<LoadBalancingPolicy>
+WeightedTargetLb::WeightedChild::CreateChildPolicyLocked(
+ const grpc_channel_args* args) {
+ LoadBalancingPolicy::Args lb_policy_args;
+ lb_policy_args.work_serializer = weighted_target_policy_->work_serializer();
+ lb_policy_args.args = args;
+ lb_policy_args.channel_control_helper =
+ y_absl::make_unique<Helper>(this->Ref(DEBUG_LOCATION, "Helper"));
+ OrphanablePtr<LoadBalancingPolicy> lb_policy =
+ MakeOrphanable<ChildPolicyHandler>(std::move(lb_policy_args),
+ &grpc_lb_weighted_target_trace);
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_weighted_target_trace)) {
+ gpr_log(GPR_INFO,
+ "[weighted_target_lb %p] WeightedChild %p %s: Created new child "
+ "policy handler %p",
+ weighted_target_policy_.get(), this, name_.c_str(),
+ lb_policy.get());
+ }
+ // Add the xDS's interested_parties pollset_set to that of the newly created
+ // child policy. This will make the child policy progress upon activity on
+ // xDS LB, which in turn is tied to the application's call.
+ grpc_pollset_set_add_pollset_set(
+ lb_policy->interested_parties(),
+ weighted_target_policy_->interested_parties());
+ return lb_policy;
+}
+
+void WeightedTargetLb::WeightedChild::UpdateLocked(
+ const WeightedTargetLbConfig::ChildConfig& config,
+ ServerAddressList addresses, const grpc_channel_args* args) {
+ if (weighted_target_policy_->shutting_down_) return;
+ // Update child weight.
+ weight_ = config.weight;
+ // Reactivate if needed.
+ if (delayed_removal_timer_callback_pending_) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_weighted_target_trace)) {
+ gpr_log(GPR_INFO,
+ "[weighted_target_lb %p] WeightedChild %p %s: reactivating",
+ weighted_target_policy_.get(), this, name_.c_str());
+ }
+ delayed_removal_timer_callback_pending_ = false;
+ grpc_timer_cancel(&delayed_removal_timer_);
+ }
+ // Create child policy if needed.
+ if (child_policy_ == nullptr) {
+ child_policy_ = CreateChildPolicyLocked(args);
+ }
+ // Construct update args.
+ UpdateArgs update_args;
+ update_args.config = config.config;
+ update_args.addresses = std::move(addresses);
+ update_args.args = grpc_channel_args_copy(args);
+ // Update the policy.
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_weighted_target_trace)) {
+ gpr_log(GPR_INFO,
+ "[weighted_target_lb %p] WeightedChild %p %s: Updating child "
+ "policy handler %p",
+ weighted_target_policy_.get(), this, name_.c_str(),
+ child_policy_.get());
+ }
+ child_policy_->UpdateLocked(std::move(update_args));
+}
+
+void WeightedTargetLb::WeightedChild::ResetBackoffLocked() {
+ child_policy_->ResetBackoffLocked();
+}
+
+void WeightedTargetLb::WeightedChild::OnConnectivityStateUpdateLocked(
+ grpc_connectivity_state state, const y_absl::Status& status,
+ std::unique_ptr<SubchannelPicker> picker) {
+ // Cache the picker in the WeightedChild.
+ picker_wrapper_ = MakeRefCounted<ChildPickerWrapper>(std::move(picker));
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_weighted_target_trace)) {
+ gpr_log(GPR_INFO,
+ "[weighted_target_lb %p] WeightedChild %p %s: connectivity "
+ "state update: state=%s (%s) picker_wrapper=%p",
+ weighted_target_policy_.get(), this, name_.c_str(),
+ ConnectivityStateName(state), status.ToString().c_str(),
+ picker_wrapper_.get());
+ }
+ // If the child reports IDLE, immediately tell it to exit idle.
+ if (state == GRPC_CHANNEL_IDLE) child_policy_->ExitIdleLocked();
+ // Decide what state to report for aggregation purposes.
+ // If we haven't seen a failure since the last time we were in state
+ // READY, then we report the state change as-is. However, once we do see
+ // a failure, we report TRANSIENT_FAILURE and ignore any subsequent state
+ // changes until we go back into state READY.
+ if (!seen_failure_since_ready_) {
+ if (state == GRPC_CHANNEL_TRANSIENT_FAILURE) {
+ seen_failure_since_ready_ = true;
+ }
+ } else {
+ if (state != GRPC_CHANNEL_READY) return;
+ seen_failure_since_ready_ = false;
+ }
+ connectivity_state_ = state;
+ // Notify the LB policy.
+ weighted_target_policy_->UpdateStateLocked();
+}
+
+void WeightedTargetLb::WeightedChild::DeactivateLocked() {
+ // If already deactivated, don't do that again.
+ if (weight_ == 0) return;
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_weighted_target_trace)) {
+ gpr_log(GPR_INFO,
+ "[weighted_target_lb %p] WeightedChild %p %s: deactivating",
+ weighted_target_policy_.get(), this, name_.c_str());
+ }
+ // Set the child weight to 0 so that future picker won't contain this child.
+ weight_ = 0;
+ // Start a timer to delete the child.
+ Ref(DEBUG_LOCATION, "WeightedChild+timer").release();
+ delayed_removal_timer_callback_pending_ = true;
+ grpc_timer_init(&delayed_removal_timer_,
+ ExecCtx::Get()->Now() + kChildRetentionIntervalMs,
+ &on_delayed_removal_timer_);
+}
+
+void WeightedTargetLb::WeightedChild::OnDelayedRemovalTimer(void* arg,
+ grpc_error* error) {
+ WeightedChild* self = static_cast<WeightedChild*>(arg);
+ GRPC_ERROR_REF(error); // ref owned by lambda
+ self->weighted_target_policy_->work_serializer()->Run(
+ [self, error]() { self->OnDelayedRemovalTimerLocked(error); },
+ DEBUG_LOCATION);
+}
+
+void WeightedTargetLb::WeightedChild::OnDelayedRemovalTimerLocked(
+ grpc_error* error) {
+ if (error == GRPC_ERROR_NONE && delayed_removal_timer_callback_pending_ &&
+ !shutdown_ && weight_ == 0) {
+ delayed_removal_timer_callback_pending_ = false;
+ weighted_target_policy_->targets_.erase(name_);
+ }
+ Unref(DEBUG_LOCATION, "WeightedChild+timer");
+ GRPC_ERROR_UNREF(error);
+}
+
+//
+// WeightedTargetLb::WeightedChild::Helper
+//
+
+RefCountedPtr<SubchannelInterface>
+WeightedTargetLb::WeightedChild::Helper::CreateSubchannel(
+ ServerAddress address, const grpc_channel_args& args) {
+ if (weighted_child_->weighted_target_policy_->shutting_down_) return nullptr;
+ return weighted_child_->weighted_target_policy_->channel_control_helper()
+ ->CreateSubchannel(std::move(address), args);
+}
+
+void WeightedTargetLb::WeightedChild::Helper::UpdateState(
+ grpc_connectivity_state state, const y_absl::Status& status,
+ std::unique_ptr<SubchannelPicker> picker) {
+ if (weighted_child_->weighted_target_policy_->shutting_down_) return;
+ weighted_child_->OnConnectivityStateUpdateLocked(state, status,
+ std::move(picker));
+}
+
+void WeightedTargetLb::WeightedChild::Helper::RequestReresolution() {
+ if (weighted_child_->weighted_target_policy_->shutting_down_) return;
+ weighted_child_->weighted_target_policy_->channel_control_helper()
+ ->RequestReresolution();
+}
+
+void WeightedTargetLb::WeightedChild::Helper::AddTraceEvent(
+ TraceSeverity severity, y_absl::string_view message) {
+ if (weighted_child_->weighted_target_policy_->shutting_down_) return;
+ weighted_child_->weighted_target_policy_->channel_control_helper()
+ ->AddTraceEvent(severity, message);
+}
+
+//
+// factory
+//
+
+class WeightedTargetLbFactory : public LoadBalancingPolicyFactory {
+ public:
+ OrphanablePtr<LoadBalancingPolicy> CreateLoadBalancingPolicy(
+ LoadBalancingPolicy::Args args) const override {
+ return MakeOrphanable<WeightedTargetLb>(std::move(args));
+ }
+
+ const char* name() const override { return kWeightedTarget; }
+
+ RefCountedPtr<LoadBalancingPolicy::Config> ParseLoadBalancingConfig(
+ const Json& json, grpc_error** error) const override {
+ GPR_DEBUG_ASSERT(error != nullptr && *error == GRPC_ERROR_NONE);
+ if (json.type() == Json::Type::JSON_NULL) {
+ // weighted_target was mentioned as a policy in the deprecated
+ // loadBalancingPolicy field or in the client API.
+ *error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:loadBalancingPolicy error:weighted_target policy requires "
+ "configuration. Please use loadBalancingConfig field of service "
+ "config instead.");
+ return nullptr;
+ }
+ std::vector<grpc_error*> error_list;
+ // Weight map.
+ WeightedTargetLbConfig::TargetMap target_map;
+ auto it = json.object_value().find("targets");
+ if (it == json.object_value().end()) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:targets error:required field not present"));
+ } else if (it->second.type() != Json::Type::OBJECT) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:targets error:type should be object"));
+ } else {
+ for (const auto& p : it->second.object_value()) {
+ WeightedTargetLbConfig::ChildConfig child_config;
+ std::vector<grpc_error*> child_errors =
+ ParseChildConfig(p.second, &child_config);
+ if (!child_errors.empty()) {
+ // Can't use GRPC_ERROR_CREATE_FROM_VECTOR() here, because the error
+ // string is not static in this case.
+ grpc_error* error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrCat("field:targets key:", p.first).c_str());
+ for (grpc_error* child_error : child_errors) {
+ error = grpc_error_add_child(error, child_error);
+ }
+ error_list.push_back(error);
+ } else {
+ target_map[p.first] = std::move(child_config);
+ }
+ }
+ }
+ if (!error_list.empty()) {
+ *error = GRPC_ERROR_CREATE_FROM_VECTOR(
+ "weighted_target_experimental LB policy config", &error_list);
+ return nullptr;
+ }
+ return MakeRefCounted<WeightedTargetLbConfig>(std::move(target_map));
+ }
+
+ private:
+ static std::vector<grpc_error*> ParseChildConfig(
+ const Json& json, WeightedTargetLbConfig::ChildConfig* child_config) {
+ std::vector<grpc_error*> error_list;
+ if (json.type() != Json::Type::OBJECT) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "value should be of type object"));
+ return error_list;
+ }
+ // Weight.
+ auto it = json.object_value().find("weight");
+ if (it == json.object_value().end()) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "required field \"weight\" not specified"));
+ } else if (it->second.type() != Json::Type::NUMBER) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:weight error:must be of type number"));
+ } else {
+ int weight = gpr_parse_nonnegative_int(it->second.string_value().c_str());
+ if (weight == -1) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:weight error:unparseable value"));
+ } else if (weight == 0) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:weight error:value must be greater than zero"));
+ } else {
+ child_config->weight = weight;
+ }
+ }
+ // Child policy.
+ it = json.object_value().find("childPolicy");
+ if (it != json.object_value().end()) {
+ grpc_error* parse_error = GRPC_ERROR_NONE;
+ child_config->config =
+ LoadBalancingPolicyRegistry::ParseLoadBalancingConfig(it->second,
+ &parse_error);
+ if (child_config->config == nullptr) {
+ GPR_DEBUG_ASSERT(parse_error != GRPC_ERROR_NONE);
+ std::vector<grpc_error*> child_errors;
+ child_errors.push_back(parse_error);
+ error_list.push_back(
+ GRPC_ERROR_CREATE_FROM_VECTOR("field:childPolicy", &child_errors));
+ }
+ }
+ return error_list;
+ }
+};
+
+} // namespace
+
+} // namespace grpc_core
+
+//
+// Plugin registration
+//
+
+void grpc_lb_policy_weighted_target_init() {
+ grpc_core::LoadBalancingPolicyRegistry::Builder::
+ RegisterLoadBalancingPolicyFactory(
+ y_absl::make_unique<grpc_core::WeightedTargetLbFactory>());
+}
+
+void grpc_lb_policy_weighted_target_shutdown() {}
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/xds/cds.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/xds/cds.cc
index dad8d41fe37..b81106cc31b 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/xds/cds.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/xds/cds.cc
@@ -18,20 +18,20 @@
#include <string.h>
-#include "y_absl/strings/str_cat.h"
-
+#include "y_absl/strings/str_cat.h"
+
#include "src/core/ext/filters/client_channel/lb_policy.h"
#include "src/core/ext/filters/client_channel/lb_policy_factory.h"
#include "src/core/ext/filters/client_channel/lb_policy_registry.h"
#include "src/core/ext/filters/client_channel/service_config.h"
-#include "src/core/ext/xds/xds_client.h"
+#include "src/core/ext/xds/xds_client.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/gprpp/memory.h"
#include "src/core/lib/gprpp/orphanable.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
-#include "src/core/lib/iomgr/closure.h"
-#include "src/core/lib/iomgr/exec_ctx.h"
-#include "src/core/lib/transport/error_utils.h"
+#include "src/core/lib/iomgr/closure.h"
+#include "src/core/lib/iomgr/exec_ctx.h"
+#include "src/core/lib/transport/error_utils.h"
namespace grpc_core {
@@ -41,21 +41,21 @@ namespace {
constexpr char kCds[] = "cds_experimental";
-// Config for this LB policy.
-class CdsLbConfig : public LoadBalancingPolicy::Config {
+// Config for this LB policy.
+class CdsLbConfig : public LoadBalancingPolicy::Config {
public:
- explicit CdsLbConfig(TString cluster) : cluster_(std::move(cluster)) {}
- const TString& cluster() const { return cluster_; }
+ explicit CdsLbConfig(TString cluster) : cluster_(std::move(cluster)) {}
+ const TString& cluster() const { return cluster_; }
const char* name() const override { return kCds; }
private:
- TString cluster_;
+ TString cluster_;
};
// CDS LB policy.
class CdsLb : public LoadBalancingPolicy {
public:
- CdsLb(RefCountedPtr<XdsClient> xds_client, Args args);
+ CdsLb(RefCountedPtr<XdsClient> xds_client, Args args);
const char* name() const override { return kCds; }
@@ -69,31 +69,31 @@ class CdsLb : public LoadBalancingPolicy {
explicit ClusterWatcher(RefCountedPtr<CdsLb> parent)
: parent_(std::move(parent)) {}
- void OnClusterChanged(XdsApi::CdsUpdate cluster_data) override {
- new Notifier(parent_, std::move(cluster_data));
- }
- void OnError(grpc_error* error) override { new Notifier(parent_, error); }
- void OnResourceDoesNotExist() override { new Notifier(parent_); }
-
+ void OnClusterChanged(XdsApi::CdsUpdate cluster_data) override {
+ new Notifier(parent_, std::move(cluster_data));
+ }
+ void OnError(grpc_error* error) override { new Notifier(parent_, error); }
+ void OnResourceDoesNotExist() override { new Notifier(parent_); }
+
private:
- class Notifier {
- public:
- Notifier(RefCountedPtr<CdsLb> parent, XdsApi::CdsUpdate update);
- Notifier(RefCountedPtr<CdsLb> parent, grpc_error* error);
- explicit Notifier(RefCountedPtr<CdsLb> parent);
-
- private:
- enum Type { kUpdate, kError, kDoesNotExist };
-
- static void RunInExecCtx(void* arg, grpc_error* error);
- void RunInWorkSerializer(grpc_error* error);
-
- RefCountedPtr<CdsLb> parent_;
- grpc_closure closure_;
- XdsApi::CdsUpdate update_;
- Type type_;
- };
-
+ class Notifier {
+ public:
+ Notifier(RefCountedPtr<CdsLb> parent, XdsApi::CdsUpdate update);
+ Notifier(RefCountedPtr<CdsLb> parent, grpc_error* error);
+ explicit Notifier(RefCountedPtr<CdsLb> parent);
+
+ private:
+ enum Type { kUpdate, kError, kDoesNotExist };
+
+ static void RunInExecCtx(void* arg, grpc_error* error);
+ void RunInWorkSerializer(grpc_error* error);
+
+ RefCountedPtr<CdsLb> parent_;
+ grpc_closure closure_;
+ XdsApi::CdsUpdate update_;
+ Type type_;
+ };
+
RefCountedPtr<CdsLb> parent_;
};
@@ -102,12 +102,12 @@ class CdsLb : public LoadBalancingPolicy {
public:
explicit Helper(RefCountedPtr<CdsLb> parent) : parent_(std::move(parent)) {}
RefCountedPtr<SubchannelInterface> CreateSubchannel(
- ServerAddress address, const grpc_channel_args& args) override;
- void UpdateState(grpc_connectivity_state state, const y_absl::Status& status,
+ ServerAddress address, const grpc_channel_args& args) override;
+ void UpdateState(grpc_connectivity_state state, const y_absl::Status& status,
std::unique_ptr<SubchannelPicker> picker) override;
void RequestReresolution() override;
- void AddTraceEvent(TraceSeverity severity,
- y_absl::string_view message) override;
+ void AddTraceEvent(TraceSeverity severity,
+ y_absl::string_view message) override;
private:
RefCountedPtr<CdsLb> parent_;
@@ -117,14 +117,14 @@ class CdsLb : public LoadBalancingPolicy {
void ShutdownLocked() override;
- void OnClusterChanged(XdsApi::CdsUpdate cluster_data);
- void OnError(grpc_error* error);
- void OnResourceDoesNotExist();
-
- void MaybeDestroyChildPolicyLocked();
+ void OnClusterChanged(XdsApi::CdsUpdate cluster_data);
+ void OnError(grpc_error* error);
+ void OnResourceDoesNotExist();
+
+ void MaybeDestroyChildPolicyLocked();
+
+ RefCountedPtr<CdsLbConfig> config_;
- RefCountedPtr<CdsLbConfig> config_;
-
// Current channel args from the resolver.
const grpc_channel_args* args_ = nullptr;
@@ -142,74 +142,74 @@ class CdsLb : public LoadBalancingPolicy {
};
//
-// CdsLb::ClusterWatcher::Notifier
+// CdsLb::ClusterWatcher::Notifier
//
-CdsLb::ClusterWatcher::Notifier::Notifier(RefCountedPtr<CdsLb> parent,
- XdsApi::CdsUpdate update)
- : parent_(std::move(parent)), update_(std::move(update)), type_(kUpdate) {
- GRPC_CLOSURE_INIT(&closure_, &RunInExecCtx, this, nullptr);
- ExecCtx::Run(DEBUG_LOCATION, &closure_, GRPC_ERROR_NONE);
+CdsLb::ClusterWatcher::Notifier::Notifier(RefCountedPtr<CdsLb> parent,
+ XdsApi::CdsUpdate update)
+ : parent_(std::move(parent)), update_(std::move(update)), type_(kUpdate) {
+ GRPC_CLOSURE_INIT(&closure_, &RunInExecCtx, this, nullptr);
+ ExecCtx::Run(DEBUG_LOCATION, &closure_, GRPC_ERROR_NONE);
}
-CdsLb::ClusterWatcher::Notifier::Notifier(RefCountedPtr<CdsLb> parent,
- grpc_error* error)
- : parent_(std::move(parent)), type_(kError) {
- GRPC_CLOSURE_INIT(&closure_, &RunInExecCtx, this, nullptr);
- ExecCtx::Run(DEBUG_LOCATION, &closure_, error);
+CdsLb::ClusterWatcher::Notifier::Notifier(RefCountedPtr<CdsLb> parent,
+ grpc_error* error)
+ : parent_(std::move(parent)), type_(kError) {
+ GRPC_CLOSURE_INIT(&closure_, &RunInExecCtx, this, nullptr);
+ ExecCtx::Run(DEBUG_LOCATION, &closure_, error);
+}
+
+CdsLb::ClusterWatcher::Notifier::Notifier(RefCountedPtr<CdsLb> parent)
+ : parent_(std::move(parent)), type_(kDoesNotExist) {
+ GRPC_CLOSURE_INIT(&closure_, &RunInExecCtx, this, nullptr);
+ ExecCtx::Run(DEBUG_LOCATION, &closure_, GRPC_ERROR_NONE);
+}
+
+void CdsLb::ClusterWatcher::Notifier::RunInExecCtx(void* arg,
+ grpc_error* error) {
+ Notifier* self = static_cast<Notifier*>(arg);
+ GRPC_ERROR_REF(error);
+ self->parent_->work_serializer()->Run(
+ [self, error]() { self->RunInWorkSerializer(error); }, DEBUG_LOCATION);
+}
+
+void CdsLb::ClusterWatcher::Notifier::RunInWorkSerializer(grpc_error* error) {
+ switch (type_) {
+ case kUpdate:
+ parent_->OnClusterChanged(std::move(update_));
+ break;
+ case kError:
+ parent_->OnError(error);
+ break;
+ case kDoesNotExist:
+ parent_->OnResourceDoesNotExist();
+ break;
+ };
+ delete this;
}
-CdsLb::ClusterWatcher::Notifier::Notifier(RefCountedPtr<CdsLb> parent)
- : parent_(std::move(parent)), type_(kDoesNotExist) {
- GRPC_CLOSURE_INIT(&closure_, &RunInExecCtx, this, nullptr);
- ExecCtx::Run(DEBUG_LOCATION, &closure_, GRPC_ERROR_NONE);
-}
-
-void CdsLb::ClusterWatcher::Notifier::RunInExecCtx(void* arg,
- grpc_error* error) {
- Notifier* self = static_cast<Notifier*>(arg);
- GRPC_ERROR_REF(error);
- self->parent_->work_serializer()->Run(
- [self, error]() { self->RunInWorkSerializer(error); }, DEBUG_LOCATION);
-}
-
-void CdsLb::ClusterWatcher::Notifier::RunInWorkSerializer(grpc_error* error) {
- switch (type_) {
- case kUpdate:
- parent_->OnClusterChanged(std::move(update_));
- break;
- case kError:
- parent_->OnError(error);
- break;
- case kDoesNotExist:
- parent_->OnResourceDoesNotExist();
- break;
- };
- delete this;
-}
-
//
// CdsLb::Helper
//
RefCountedPtr<SubchannelInterface> CdsLb::Helper::CreateSubchannel(
- ServerAddress address, const grpc_channel_args& args) {
+ ServerAddress address, const grpc_channel_args& args) {
if (parent_->shutting_down_) return nullptr;
- return parent_->channel_control_helper()->CreateSubchannel(std::move(address),
- args);
+ return parent_->channel_control_helper()->CreateSubchannel(std::move(address),
+ args);
}
void CdsLb::Helper::UpdateState(grpc_connectivity_state state,
- const y_absl::Status& status,
+ const y_absl::Status& status,
std::unique_ptr<SubchannelPicker> picker) {
- if (parent_->shutting_down_ || parent_->child_policy_ == nullptr) return;
+ if (parent_->shutting_down_ || parent_->child_policy_ == nullptr) return;
if (GRPC_TRACE_FLAG_ENABLED(grpc_cds_lb_trace)) {
- gpr_log(GPR_INFO,
- "[cdslb %p] state updated by child: %s message_state: (%s)", this,
- ConnectivityStateName(state), status.ToString().c_str());
+ gpr_log(GPR_INFO,
+ "[cdslb %p] state updated by child: %s message_state: (%s)", this,
+ ConnectivityStateName(state), status.ToString().c_str());
}
- parent_->channel_control_helper()->UpdateState(state, status,
- std::move(picker));
+ parent_->channel_control_helper()->UpdateState(state, status,
+ std::move(picker));
}
void CdsLb::Helper::RequestReresolution() {
@@ -221,8 +221,8 @@ void CdsLb::Helper::RequestReresolution() {
parent_->channel_control_helper()->RequestReresolution();
}
-void CdsLb::Helper::AddTraceEvent(TraceSeverity severity,
- y_absl::string_view message) {
+void CdsLb::Helper::AddTraceEvent(TraceSeverity severity,
+ y_absl::string_view message) {
if (parent_->shutting_down_) return;
parent_->channel_control_helper()->AddTraceEvent(severity, message);
}
@@ -231,11 +231,11 @@ void CdsLb::Helper::AddTraceEvent(TraceSeverity severity,
// CdsLb
//
-CdsLb::CdsLb(RefCountedPtr<XdsClient> xds_client, Args args)
- : LoadBalancingPolicy(std::move(args)), xds_client_(std::move(xds_client)) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_cds_lb_trace)) {
- gpr_log(GPR_INFO, "[cdslb %p] created -- using xds client %p", this,
- xds_client_.get());
+CdsLb::CdsLb(RefCountedPtr<XdsClient> xds_client, Args args)
+ : LoadBalancingPolicy(std::move(args)), xds_client_(std::move(xds_client)) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_cds_lb_trace)) {
+ gpr_log(GPR_INFO, "[cdslb %p] created -- using xds client %p", this,
+ xds_client_.get());
}
}
@@ -250,29 +250,29 @@ void CdsLb::ShutdownLocked() {
gpr_log(GPR_INFO, "[cdslb %p] shutting down", this);
}
shutting_down_ = true;
- MaybeDestroyChildPolicyLocked();
+ MaybeDestroyChildPolicyLocked();
if (xds_client_ != nullptr) {
if (cluster_watcher_ != nullptr) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_cds_lb_trace)) {
- gpr_log(GPR_INFO, "[cdslb %p] cancelling watch for cluster %s", this,
- config_->cluster().c_str());
- }
- xds_client_->CancelClusterDataWatch(config_->cluster(), cluster_watcher_);
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_cds_lb_trace)) {
+ gpr_log(GPR_INFO, "[cdslb %p] cancelling watch for cluster %s", this,
+ config_->cluster().c_str());
+ }
+ xds_client_->CancelClusterDataWatch(config_->cluster(), cluster_watcher_);
}
- xds_client_.reset(DEBUG_LOCATION, "CdsLb");
+ xds_client_.reset(DEBUG_LOCATION, "CdsLb");
+ }
+ grpc_channel_args_destroy(args_);
+ args_ = nullptr;
+}
+
+void CdsLb::MaybeDestroyChildPolicyLocked() {
+ if (child_policy_ != nullptr) {
+ grpc_pollset_set_del_pollset_set(child_policy_->interested_parties(),
+ interested_parties());
+ child_policy_.reset();
}
- grpc_channel_args_destroy(args_);
- args_ = nullptr;
}
-void CdsLb::MaybeDestroyChildPolicyLocked() {
- if (child_policy_ != nullptr) {
- grpc_pollset_set_del_pollset_set(child_policy_->interested_parties(),
- interested_parties());
- child_policy_.reset();
- }
-}
-
void CdsLb::ResetBackoffLocked() {
if (child_policy_ != nullptr) child_policy_->ResetBackoffLocked();
}
@@ -281,176 +281,176 @@ void CdsLb::UpdateLocked(UpdateArgs args) {
// Update config.
auto old_config = std::move(config_);
config_ = std::move(args.config);
- if (GRPC_TRACE_FLAG_ENABLED(grpc_cds_lb_trace)) {
- gpr_log(GPR_INFO, "[cdslb %p] received update: cluster=%s", this,
- config_->cluster().c_str());
- }
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_cds_lb_trace)) {
+ gpr_log(GPR_INFO, "[cdslb %p] received update: cluster=%s", this,
+ config_->cluster().c_str());
+ }
// Update args.
grpc_channel_args_destroy(args_);
args_ = args.args;
args.args = nullptr;
// If cluster name changed, cancel watcher and restart.
- if (old_config == nullptr || old_config->cluster() != config_->cluster()) {
+ if (old_config == nullptr || old_config->cluster() != config_->cluster()) {
if (old_config != nullptr) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_cds_lb_trace)) {
- gpr_log(GPR_INFO, "[cdslb %p] cancelling watch for cluster %s", this,
- old_config->cluster().c_str());
- }
- xds_client_->CancelClusterDataWatch(old_config->cluster(),
- cluster_watcher_,
- /*delay_unsubscription=*/true);
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_cds_lb_trace)) {
+ gpr_log(GPR_INFO, "[cdslb %p] cancelling watch for cluster %s", this,
+ old_config->cluster().c_str());
+ }
+ xds_client_->CancelClusterDataWatch(old_config->cluster(),
+ cluster_watcher_,
+ /*delay_unsubscription=*/true);
}
- if (GRPC_TRACE_FLAG_ENABLED(grpc_cds_lb_trace)) {
- gpr_log(GPR_INFO, "[cdslb %p] starting watch for cluster %s", this,
- config_->cluster().c_str());
- }
- auto watcher = y_absl::make_unique<ClusterWatcher>(Ref());
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_cds_lb_trace)) {
+ gpr_log(GPR_INFO, "[cdslb %p] starting watch for cluster %s", this,
+ config_->cluster().c_str());
+ }
+ auto watcher = y_absl::make_unique<ClusterWatcher>(Ref());
cluster_watcher_ = watcher.get();
- xds_client_->WatchClusterData(config_->cluster(), std::move(watcher));
+ xds_client_->WatchClusterData(config_->cluster(), std::move(watcher));
}
}
-void CdsLb::OnClusterChanged(XdsApi::CdsUpdate cluster_data) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_cds_lb_trace)) {
- gpr_log(GPR_INFO,
- "[cdslb %p] received CDS update from xds client %p: "
- "eds_service_name=%s lrs_load_reporting_server_name=%s "
- "max_concurrent_requests=%d",
- this, xds_client_.get(), cluster_data.eds_service_name.c_str(),
- cluster_data.lrs_load_reporting_server_name.has_value()
- ? cluster_data.lrs_load_reporting_server_name.value().c_str()
- : "(unset)",
- cluster_data.max_concurrent_requests);
- }
- // Construct config for child policy.
- Json::Object child_config = {
- {"clusterName", config_->cluster()},
- {"max_concurrent_requests", cluster_data.max_concurrent_requests},
- {"localityPickingPolicy",
- Json::Array{
- Json::Object{
- {"weighted_target_experimental",
- Json::Object{
- {"targets", Json::Object()},
- }},
- },
- }},
- {"endpointPickingPolicy",
- Json::Array{
- Json::Object{
- {"round_robin", Json::Object()},
- },
- }},
- };
- if (!cluster_data.eds_service_name.empty()) {
- child_config["edsServiceName"] = cluster_data.eds_service_name;
- }
- if (cluster_data.lrs_load_reporting_server_name.has_value()) {
- child_config["lrsLoadReportingServerName"] =
- cluster_data.lrs_load_reporting_server_name.value();
- }
- Json json = Json::Array{
- Json::Object{
- {"eds_experimental", std::move(child_config)},
- },
- };
- if (GRPC_TRACE_FLAG_ENABLED(grpc_cds_lb_trace)) {
- TString json_str = json.Dump(/*indent=*/1);
- gpr_log(GPR_INFO, "[cdslb %p] generated config for child policy: %s", this,
- json_str.c_str());
- }
- grpc_error* error = GRPC_ERROR_NONE;
- RefCountedPtr<LoadBalancingPolicy::Config> config =
- LoadBalancingPolicyRegistry::ParseLoadBalancingConfig(json, &error);
- if (error != GRPC_ERROR_NONE) {
- OnError(error);
- return;
- }
- // Create child policy if not already present.
- if (child_policy_ == nullptr) {
- LoadBalancingPolicy::Args args;
- args.work_serializer = work_serializer();
- args.args = args_;
- args.channel_control_helper = y_absl::make_unique<Helper>(Ref());
- child_policy_ = LoadBalancingPolicyRegistry::CreateLoadBalancingPolicy(
- config->name(), std::move(args));
- if (child_policy_ == nullptr) {
- OnError(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "failed to create child policy"));
- return;
- }
- grpc_pollset_set_add_pollset_set(child_policy_->interested_parties(),
- interested_parties());
- if (GRPC_TRACE_FLAG_ENABLED(grpc_cds_lb_trace)) {
- gpr_log(GPR_INFO, "[cdslb %p] created child policy %s (%p)", this,
- config->name(), child_policy_.get());
- }
- }
- // Update child policy.
- UpdateArgs args;
- args.config = std::move(config);
- args.args = grpc_channel_args_copy(args_);
- child_policy_->UpdateLocked(std::move(args));
-}
-
-void CdsLb::OnError(grpc_error* error) {
- gpr_log(GPR_ERROR, "[cdslb %p] xds error obtaining data for cluster %s: %s",
- this, config_->cluster().c_str(), grpc_error_string(error));
- // Go into TRANSIENT_FAILURE if we have not yet created the child
- // policy (i.e., we have not yet received data from xds). Otherwise,
- // we keep running with the data we had previously.
- if (child_policy_ == nullptr) {
- channel_control_helper()->UpdateState(
- GRPC_CHANNEL_TRANSIENT_FAILURE, grpc_error_to_absl_status(error),
- y_absl::make_unique<TransientFailurePicker>(error));
- } else {
- GRPC_ERROR_UNREF(error);
- }
-}
-
-void CdsLb::OnResourceDoesNotExist() {
- gpr_log(GPR_ERROR,
- "[cdslb %p] CDS resource for %s does not exist -- reporting "
- "TRANSIENT_FAILURE",
- this, config_->cluster().c_str());
- grpc_error* error =
- grpc_error_set_int(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("CDS resource \"", config_->cluster(),
- "\" does not exist")
- .c_str()),
- GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE);
- channel_control_helper()->UpdateState(
- GRPC_CHANNEL_TRANSIENT_FAILURE, grpc_error_to_absl_status(error),
- y_absl::make_unique<TransientFailurePicker>(error));
- MaybeDestroyChildPolicyLocked();
-}
-
+void CdsLb::OnClusterChanged(XdsApi::CdsUpdate cluster_data) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_cds_lb_trace)) {
+ gpr_log(GPR_INFO,
+ "[cdslb %p] received CDS update from xds client %p: "
+ "eds_service_name=%s lrs_load_reporting_server_name=%s "
+ "max_concurrent_requests=%d",
+ this, xds_client_.get(), cluster_data.eds_service_name.c_str(),
+ cluster_data.lrs_load_reporting_server_name.has_value()
+ ? cluster_data.lrs_load_reporting_server_name.value().c_str()
+ : "(unset)",
+ cluster_data.max_concurrent_requests);
+ }
+ // Construct config for child policy.
+ Json::Object child_config = {
+ {"clusterName", config_->cluster()},
+ {"max_concurrent_requests", cluster_data.max_concurrent_requests},
+ {"localityPickingPolicy",
+ Json::Array{
+ Json::Object{
+ {"weighted_target_experimental",
+ Json::Object{
+ {"targets", Json::Object()},
+ }},
+ },
+ }},
+ {"endpointPickingPolicy",
+ Json::Array{
+ Json::Object{
+ {"round_robin", Json::Object()},
+ },
+ }},
+ };
+ if (!cluster_data.eds_service_name.empty()) {
+ child_config["edsServiceName"] = cluster_data.eds_service_name;
+ }
+ if (cluster_data.lrs_load_reporting_server_name.has_value()) {
+ child_config["lrsLoadReportingServerName"] =
+ cluster_data.lrs_load_reporting_server_name.value();
+ }
+ Json json = Json::Array{
+ Json::Object{
+ {"eds_experimental", std::move(child_config)},
+ },
+ };
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_cds_lb_trace)) {
+ TString json_str = json.Dump(/*indent=*/1);
+ gpr_log(GPR_INFO, "[cdslb %p] generated config for child policy: %s", this,
+ json_str.c_str());
+ }
+ grpc_error* error = GRPC_ERROR_NONE;
+ RefCountedPtr<LoadBalancingPolicy::Config> config =
+ LoadBalancingPolicyRegistry::ParseLoadBalancingConfig(json, &error);
+ if (error != GRPC_ERROR_NONE) {
+ OnError(error);
+ return;
+ }
+ // Create child policy if not already present.
+ if (child_policy_ == nullptr) {
+ LoadBalancingPolicy::Args args;
+ args.work_serializer = work_serializer();
+ args.args = args_;
+ args.channel_control_helper = y_absl::make_unique<Helper>(Ref());
+ child_policy_ = LoadBalancingPolicyRegistry::CreateLoadBalancingPolicy(
+ config->name(), std::move(args));
+ if (child_policy_ == nullptr) {
+ OnError(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "failed to create child policy"));
+ return;
+ }
+ grpc_pollset_set_add_pollset_set(child_policy_->interested_parties(),
+ interested_parties());
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_cds_lb_trace)) {
+ gpr_log(GPR_INFO, "[cdslb %p] created child policy %s (%p)", this,
+ config->name(), child_policy_.get());
+ }
+ }
+ // Update child policy.
+ UpdateArgs args;
+ args.config = std::move(config);
+ args.args = grpc_channel_args_copy(args_);
+ child_policy_->UpdateLocked(std::move(args));
+}
+
+void CdsLb::OnError(grpc_error* error) {
+ gpr_log(GPR_ERROR, "[cdslb %p] xds error obtaining data for cluster %s: %s",
+ this, config_->cluster().c_str(), grpc_error_string(error));
+ // Go into TRANSIENT_FAILURE if we have not yet created the child
+ // policy (i.e., we have not yet received data from xds). Otherwise,
+ // we keep running with the data we had previously.
+ if (child_policy_ == nullptr) {
+ channel_control_helper()->UpdateState(
+ GRPC_CHANNEL_TRANSIENT_FAILURE, grpc_error_to_absl_status(error),
+ y_absl::make_unique<TransientFailurePicker>(error));
+ } else {
+ GRPC_ERROR_UNREF(error);
+ }
+}
+
+void CdsLb::OnResourceDoesNotExist() {
+ gpr_log(GPR_ERROR,
+ "[cdslb %p] CDS resource for %s does not exist -- reporting "
+ "TRANSIENT_FAILURE",
+ this, config_->cluster().c_str());
+ grpc_error* error =
+ grpc_error_set_int(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrCat("CDS resource \"", config_->cluster(),
+ "\" does not exist")
+ .c_str()),
+ GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE);
+ channel_control_helper()->UpdateState(
+ GRPC_CHANNEL_TRANSIENT_FAILURE, grpc_error_to_absl_status(error),
+ y_absl::make_unique<TransientFailurePicker>(error));
+ MaybeDestroyChildPolicyLocked();
+}
+
//
// factory
//
-class CdsLbFactory : public LoadBalancingPolicyFactory {
+class CdsLbFactory : public LoadBalancingPolicyFactory {
public:
OrphanablePtr<LoadBalancingPolicy> CreateLoadBalancingPolicy(
LoadBalancingPolicy::Args args) const override {
- grpc_error* error = GRPC_ERROR_NONE;
- RefCountedPtr<XdsClient> xds_client = XdsClient::GetOrCreate(&error);
- if (error != GRPC_ERROR_NONE) {
- gpr_log(GPR_ERROR,
- "cannot get XdsClient to instantiate cds LB policy: %s",
- grpc_error_string(error));
- GRPC_ERROR_UNREF(error);
- return nullptr;
- }
- return MakeOrphanable<CdsLb>(std::move(xds_client), std::move(args));
+ grpc_error* error = GRPC_ERROR_NONE;
+ RefCountedPtr<XdsClient> xds_client = XdsClient::GetOrCreate(&error);
+ if (error != GRPC_ERROR_NONE) {
+ gpr_log(GPR_ERROR,
+ "cannot get XdsClient to instantiate cds LB policy: %s",
+ grpc_error_string(error));
+ GRPC_ERROR_UNREF(error);
+ return nullptr;
+ }
+ return MakeOrphanable<CdsLb>(std::move(xds_client), std::move(args));
}
const char* name() const override { return kCds; }
RefCountedPtr<LoadBalancingPolicy::Config> ParseLoadBalancingConfig(
- const Json& json, grpc_error** error) const override {
+ const Json& json, grpc_error** error) const override {
GPR_DEBUG_ASSERT(error != nullptr && *error == GRPC_ERROR_NONE);
- if (json.type() == Json::Type::JSON_NULL) {
+ if (json.type() == Json::Type::JSON_NULL) {
// xds was mentioned as a policy in the deprecated loadBalancingPolicy
// field or in the client API.
*error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
@@ -458,23 +458,23 @@ class CdsLbFactory : public LoadBalancingPolicyFactory {
"Please use loadBalancingConfig field of service config instead.");
return nullptr;
}
- std::vector<grpc_error*> error_list;
- TString cluster;
- auto it = json.object_value().find("cluster");
- if (it == json.object_value().end()) {
+ std::vector<grpc_error*> error_list;
+ TString cluster;
+ auto it = json.object_value().find("cluster");
+ if (it == json.object_value().end()) {
error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"required field 'cluster' not present"));
- } else if (it->second.type() != Json::Type::STRING) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:cluster error:type should be string"));
- } else {
- cluster = it->second.string_value();
+ } else if (it->second.type() != Json::Type::STRING) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:cluster error:type should be string"));
+ } else {
+ cluster = it->second.string_value();
}
- if (!error_list.empty()) {
+ if (!error_list.empty()) {
*error = GRPC_ERROR_CREATE_FROM_VECTOR("Cds Parser", &error_list);
return nullptr;
}
- return MakeRefCounted<CdsLbConfig>(std::move(cluster));
+ return MakeRefCounted<CdsLbConfig>(std::move(cluster));
}
};
@@ -489,7 +489,7 @@ class CdsLbFactory : public LoadBalancingPolicyFactory {
void grpc_lb_policy_cds_init() {
grpc_core::LoadBalancingPolicyRegistry::Builder::
RegisterLoadBalancingPolicyFactory(
- y_absl::make_unique<grpc_core::CdsLbFactory>());
+ y_absl::make_unique<grpc_core::CdsLbFactory>());
}
void grpc_lb_policy_cds_shutdown() {}
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/xds/eds.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/xds/eds.cc
index f61ee1c1445..93fff4d3e39 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/xds/eds.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/xds/eds.cc
@@ -1,1152 +1,1152 @@
-//
-// Copyright 2018 gRPC authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-#include <grpc/support/port_platform.h>
-
-#include <inttypes.h>
-#include <limits.h>
-
-#include "y_absl/strings/str_cat.h"
-#include "y_absl/types/optional.h"
-
-#include <grpc/grpc.h>
-
-#include "src/core/ext/filters/client_channel/client_channel.h"
-#include "src/core/ext/filters/client_channel/lb_policy.h"
-#include "src/core/ext/filters/client_channel/lb_policy/address_filtering.h"
-#include "src/core/ext/filters/client_channel/lb_policy/child_policy_handler.h"
-#include "src/core/ext/filters/client_channel/lb_policy/xds/xds.h"
-#include "src/core/ext/filters/client_channel/lb_policy_factory.h"
-#include "src/core/ext/filters/client_channel/lb_policy_registry.h"
-#include "src/core/ext/filters/client_channel/server_address.h"
-#include "src/core/ext/xds/xds_channel_args.h"
-#include "src/core/ext/xds/xds_client.h"
-#include "src/core/ext/xds/xds_client_stats.h"
-#include "src/core/lib/channel/channel_args.h"
-#include "src/core/lib/gpr/env.h"
-#include "src/core/lib/gpr/string.h"
-#include "src/core/lib/gprpp/orphanable.h"
-#include "src/core/lib/gprpp/ref_counted_ptr.h"
-#include "src/core/lib/iomgr/timer.h"
-#include "src/core/lib/iomgr/work_serializer.h"
-#include "src/core/lib/transport/error_utils.h"
-#include "src/core/lib/uri/uri_parser.h"
-
-#define GRPC_EDS_DEFAULT_FALLBACK_TIMEOUT 10000
-
-namespace grpc_core {
-
-TraceFlag grpc_lb_eds_trace(false, "eds_lb");
-
-namespace {
-
-constexpr char kEds[] = "eds_experimental";
-
-const char* kXdsLocalityNameAttributeKey = "xds_locality_name";
-
-// TODO (donnadionne): Check to see if circuit breaking is enabled, this will be
-// removed once circuit breaking feature is fully integrated and enabled by
-// default.
-bool XdsCircuitBreakingEnabled() {
- char* value = gpr_getenv("GRPC_XDS_EXPERIMENTAL_CIRCUIT_BREAKING");
- bool parsed_value;
- bool parse_succeeded = gpr_parse_bool_value(value, &parsed_value);
- gpr_free(value);
- return parse_succeeded && parsed_value;
-}
-
-// Config for EDS LB policy.
-class EdsLbConfig : public LoadBalancingPolicy::Config {
- public:
- EdsLbConfig(TString cluster_name, TString eds_service_name,
- y_absl::optional<TString> lrs_load_reporting_server_name,
- Json locality_picking_policy, Json endpoint_picking_policy,
- uint32_t max_concurrent_requests)
- : cluster_name_(std::move(cluster_name)),
- eds_service_name_(std::move(eds_service_name)),
- lrs_load_reporting_server_name_(
- std::move(lrs_load_reporting_server_name)),
- locality_picking_policy_(std::move(locality_picking_policy)),
- endpoint_picking_policy_(std::move(endpoint_picking_policy)),
- max_concurrent_requests_(max_concurrent_requests) {}
-
- const char* name() const override { return kEds; }
-
- const TString& cluster_name() const { return cluster_name_; }
- const TString& eds_service_name() const { return eds_service_name_; }
- const y_absl::optional<TString>& lrs_load_reporting_server_name() const {
- return lrs_load_reporting_server_name_;
- };
- const Json& locality_picking_policy() const {
- return locality_picking_policy_;
- }
- const Json& endpoint_picking_policy() const {
- return endpoint_picking_policy_;
- }
- const uint32_t max_concurrent_requests() const {
- return max_concurrent_requests_;
- }
-
- private:
- TString cluster_name_;
- TString eds_service_name_;
- y_absl::optional<TString> lrs_load_reporting_server_name_;
- Json locality_picking_policy_;
- Json endpoint_picking_policy_;
- uint32_t max_concurrent_requests_;
-};
-
-// EDS LB policy.
-class EdsLb : public LoadBalancingPolicy {
- public:
- EdsLb(RefCountedPtr<XdsClient> xds_client, Args args);
-
- const char* name() const override { return kEds; }
-
- void UpdateLocked(UpdateArgs args) override;
- void ResetBackoffLocked() override;
-
- private:
- class XdsLocalityAttribute : public ServerAddress::AttributeInterface {
- public:
- explicit XdsLocalityAttribute(RefCountedPtr<XdsLocalityName> locality_name)
- : locality_name_(std::move(locality_name)) {}
-
- RefCountedPtr<XdsLocalityName> locality_name() const {
- return locality_name_;
- }
-
- std::unique_ptr<AttributeInterface> Copy() const override {
- return y_absl::make_unique<XdsLocalityAttribute>(locality_name_->Ref());
- }
-
- int Cmp(const AttributeInterface* other) const override {
- const auto* other_locality_attr =
- static_cast<const XdsLocalityAttribute*>(other);
- return locality_name_->Compare(*other_locality_attr->locality_name_);
- }
-
- TString ToString() const override {
- return locality_name_->AsHumanReadableString();
- }
-
- private:
- RefCountedPtr<XdsLocalityName> locality_name_;
- };
-
- class StatsSubchannelWrapper : public DelegatingSubchannel {
- public:
- StatsSubchannelWrapper(
- RefCountedPtr<SubchannelInterface> wrapped_subchannel,
- RefCountedPtr<XdsClusterLocalityStats> locality_stats)
- : DelegatingSubchannel(std::move(wrapped_subchannel)),
- locality_stats_(std::move(locality_stats)) {}
-
- XdsClusterLocalityStats* locality_stats() const {
- return locality_stats_.get();
- }
-
- private:
- RefCountedPtr<XdsClusterLocalityStats> locality_stats_;
- };
-
- class EndpointWatcher : public XdsClient::EndpointWatcherInterface {
- public:
- explicit EndpointWatcher(RefCountedPtr<EdsLb> parent)
- : parent_(std::move(parent)) {}
- void OnEndpointChanged(XdsApi::EdsUpdate update) override {
- new Notifier(parent_, std::move(update));
- }
- void OnError(grpc_error* error) override { new Notifier(parent_, error); }
- void OnResourceDoesNotExist() override { new Notifier(parent_); }
-
- private:
- class Notifier {
- public:
- Notifier(RefCountedPtr<EdsLb> parent, XdsApi::EdsUpdate update);
- Notifier(RefCountedPtr<EdsLb> parent, grpc_error* error);
- explicit Notifier(RefCountedPtr<EdsLb> parent);
-
- private:
- enum Type { kUpdate, kError, kDoesNotExist };
-
- static void RunInExecCtx(void* arg, grpc_error* error);
- void RunInWorkSerializer(grpc_error* error);
-
- RefCountedPtr<EdsLb> parent_;
- grpc_closure closure_;
- XdsApi::EdsUpdate update_;
- Type type_;
- };
-
- RefCountedPtr<EdsLb> parent_;
- };
-
- // A simple wrapper for ref-counting a picker from the child policy.
- class ChildPickerWrapper : public RefCounted<ChildPickerWrapper> {
- public:
- explicit ChildPickerWrapper(std::unique_ptr<SubchannelPicker> picker)
- : picker_(std::move(picker)) {}
- PickResult Pick(PickArgs args) { return picker_->Pick(args); }
-
- private:
- std::unique_ptr<SubchannelPicker> picker_;
- };
-
- // A picker that handles drops.
- class EdsPicker : public SubchannelPicker {
- public:
- explicit EdsPicker(RefCountedPtr<EdsLb> eds_policy);
-
- PickResult Pick(PickArgs args) override;
-
- private:
- RefCountedPtr<EdsLb> eds_policy_;
- RefCountedPtr<XdsApi::EdsUpdate::DropConfig> drop_config_;
- RefCountedPtr<XdsClusterDropStats> drop_stats_;
- RefCountedPtr<ChildPickerWrapper> child_picker_;
- bool xds_circuit_breaking_enabled_;
- uint32_t max_concurrent_requests_;
- };
-
- class Helper : public ChannelControlHelper {
- public:
- explicit Helper(RefCountedPtr<EdsLb> eds_policy)
- : eds_policy_(std::move(eds_policy)) {}
-
- ~Helper() { eds_policy_.reset(DEBUG_LOCATION, "Helper"); }
-
- RefCountedPtr<SubchannelInterface> CreateSubchannel(
- ServerAddress address, const grpc_channel_args& args) override;
- void UpdateState(grpc_connectivity_state state, const y_absl::Status& status,
- std::unique_ptr<SubchannelPicker> picker) override;
- // This is a no-op, because we get the addresses from the xds
- // client, which is a watch-based API.
- void RequestReresolution() override {}
- void AddTraceEvent(TraceSeverity severity,
- y_absl::string_view message) override;
-
- private:
- RefCountedPtr<EdsLb> eds_policy_;
- };
-
- ~EdsLb();
-
- void ShutdownLocked() override;
-
- void OnEndpointChanged(XdsApi::EdsUpdate update);
- void OnError(grpc_error* error);
- void OnResourceDoesNotExist();
-
- void MaybeDestroyChildPolicyLocked();
-
- void UpdatePriorityList(XdsApi::EdsUpdate::PriorityList priority_list);
- void UpdateChildPolicyLocked();
- OrphanablePtr<LoadBalancingPolicy> CreateChildPolicyLocked(
- const grpc_channel_args* args);
- ServerAddressList CreateChildPolicyAddressesLocked();
- RefCountedPtr<Config> CreateChildPolicyConfigLocked();
- grpc_channel_args* CreateChildPolicyArgsLocked(
- const grpc_channel_args* args_in);
- void MaybeUpdateEdsPickerLocked();
-
- // Caller must ensure that config_ is set before calling.
- const y_absl::string_view GetEdsResourceName() const {
- if (!is_xds_uri_) return server_name_;
- if (!config_->eds_service_name().empty()) {
- return config_->eds_service_name();
- }
- return config_->cluster_name();
- }
-
- // Returns a pair containing the cluster and eds_service_name to use
- // for LRS load reporting.
- // Caller must ensure that config_ is set before calling.
- std::pair<y_absl::string_view, y_absl::string_view> GetLrsClusterKey() const {
- if (!is_xds_uri_) return {server_name_, y_absl::string_view{}};
- return {config_->cluster_name(), config_->eds_service_name()};
- }
-
- // Server name from target URI.
- TString server_name_;
- bool is_xds_uri_;
-
- // Current channel args and config from the resolver.
- const grpc_channel_args* args_ = nullptr;
- RefCountedPtr<EdsLbConfig> config_;
-
- // Internal state.
- bool shutting_down_ = false;
-
- // The xds client and endpoint watcher.
- RefCountedPtr<XdsClient> xds_client_;
- // A pointer to the endpoint watcher, to be used when cancelling the watch.
- // Note that this is not owned, so this pointer must never be derefernced.
- EndpointWatcher* endpoint_watcher_ = nullptr;
- // The latest data from the endpoint watcher.
- XdsApi::EdsUpdate::PriorityList priority_list_;
- // State used to retain child policy names for priority policy.
- std::vector<size_t /*child_number*/> priority_child_numbers_;
-
- RefCountedPtr<XdsApi::EdsUpdate::DropConfig> drop_config_;
- RefCountedPtr<XdsClusterDropStats> drop_stats_;
- // Current concurrent number of requests;
- Atomic<uint32_t> concurrent_requests_{0};
-
- OrphanablePtr<LoadBalancingPolicy> child_policy_;
-
- // The latest state and picker returned from the child policy.
- grpc_connectivity_state child_state_;
- y_absl::Status child_status_;
- RefCountedPtr<ChildPickerWrapper> child_picker_;
-};
-
-//
-// EdsLb::EdsPicker
-//
-
-EdsLb::EdsPicker::EdsPicker(RefCountedPtr<EdsLb> eds_policy)
- : eds_policy_(std::move(eds_policy)),
- drop_stats_(eds_policy_->drop_stats_),
- child_picker_(eds_policy_->child_picker_),
- xds_circuit_breaking_enabled_(XdsCircuitBreakingEnabled()),
- max_concurrent_requests_(
- eds_policy_->config_->max_concurrent_requests()) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_eds_trace)) {
- gpr_log(GPR_INFO, "[edslb %p] constructed new drop picker %p",
- eds_policy_.get(), this);
- }
-}
-
-EdsLb::PickResult EdsLb::EdsPicker::Pick(PickArgs args) {
- uint32_t current = eds_policy_->concurrent_requests_.FetchAdd(1);
- if (xds_circuit_breaking_enabled_) {
- // Check and see if we exceeded the max concurrent requests count.
- if (current >= max_concurrent_requests_) {
- eds_policy_->concurrent_requests_.FetchSub(1);
- if (drop_stats_ != nullptr) {
- drop_stats_->AddUncategorizedDrops();
- }
- PickResult result;
- result.type = PickResult::PICK_COMPLETE;
- return result;
- }
- }
- // If we're not dropping the call, we should always have a child picker.
- if (child_picker_ == nullptr) { // Should never happen.
- PickResult result;
- result.type = PickResult::PICK_FAILED;
- result.error =
- grpc_error_set_int(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "eds drop picker not given any child picker"),
- GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_INTERNAL);
- eds_policy_->concurrent_requests_.FetchSub(1);
- return result;
- }
- // Not dropping, so delegate to child's picker.
- PickResult result = child_picker_->Pick(args);
- if (result.type == result.PICK_COMPLETE && result.subchannel != nullptr) {
- XdsClusterLocalityStats* locality_stats = nullptr;
- if (drop_stats_ != nullptr) { // If load reporting is enabled.
- auto* subchannel_wrapper =
- static_cast<StatsSubchannelWrapper*>(result.subchannel.get());
- // Handle load reporting.
- locality_stats = subchannel_wrapper->locality_stats()->Ref().release();
- // Record a call started.
- locality_stats->AddCallStarted();
- // Unwrap subchannel to pass back up the stack.
- result.subchannel = subchannel_wrapper->wrapped_subchannel();
- }
- // Intercept the recv_trailing_metadata op to record call completion.
- EdsLb* eds_policy = static_cast<EdsLb*>(
- eds_policy_->Ref(DEBUG_LOCATION, "DropPickPicker+call").release());
- auto original_recv_trailing_metadata_ready =
- result.recv_trailing_metadata_ready;
- result.recv_trailing_metadata_ready =
- // Note: This callback does not run in either the control plane
- // work serializer or in the data plane mutex.
- [locality_stats, original_recv_trailing_metadata_ready, eds_policy](
- grpc_error* error, MetadataInterface* metadata,
- CallState* call_state) {
- // Record call completion for load reporting.
- if (locality_stats != nullptr) {
- const bool call_failed = error != GRPC_ERROR_NONE;
- locality_stats->AddCallFinished(call_failed);
- locality_stats->Unref(DEBUG_LOCATION, "LocalityStats+call");
- }
- // Decrement number of calls in flight.
- eds_policy->concurrent_requests_.FetchSub(1);
- eds_policy->Unref(DEBUG_LOCATION, "DropPickPicker+call");
- // Invoke the original recv_trailing_metadata_ready callback, if any.
- if (original_recv_trailing_metadata_ready != nullptr) {
- original_recv_trailing_metadata_ready(error, metadata, call_state);
- }
- };
- } else {
- // TODO(roth): We should ideally also record call failures here in the case
- // where a pick fails. This is challenging, because we don't know which
- // picks are for wait_for_ready RPCs or how many times we'll return a
- // failure for the same wait_for_ready RPC.
- eds_policy_->concurrent_requests_.FetchSub(1);
- }
- return result;
-}
-
-//
-// EdsLb::Helper
-//
-
-RefCountedPtr<SubchannelInterface> EdsLb::Helper::CreateSubchannel(
- ServerAddress address, const grpc_channel_args& args) {
- if (eds_policy_->shutting_down_) return nullptr;
- // If load reporting is enabled, wrap the subchannel such that it
- // includes the locality stats object, which will be used by the EdsPicker.
- if (eds_policy_->config_->lrs_load_reporting_server_name().has_value()) {
- RefCountedPtr<XdsLocalityName> locality_name;
- auto* attribute = address.GetAttribute(kXdsLocalityNameAttributeKey);
- if (attribute != nullptr) {
- const auto* locality_attr =
- static_cast<const XdsLocalityAttribute*>(attribute);
- locality_name = locality_attr->locality_name();
- }
- RefCountedPtr<XdsClusterLocalityStats> locality_stats =
- eds_policy_->xds_client_->AddClusterLocalityStats(
- *eds_policy_->config_->lrs_load_reporting_server_name(),
- eds_policy_->config_->cluster_name(),
- eds_policy_->config_->eds_service_name(), std::move(locality_name));
- return MakeRefCounted<StatsSubchannelWrapper>(
- eds_policy_->channel_control_helper()->CreateSubchannel(
- std::move(address), args),
- std::move(locality_stats));
- }
- // Load reporting not enabled, so don't wrap the subchannel.
- return eds_policy_->channel_control_helper()->CreateSubchannel(
- std::move(address), args);
-}
-
-void EdsLb::Helper::UpdateState(grpc_connectivity_state state,
- const y_absl::Status& status,
- std::unique_ptr<SubchannelPicker> picker) {
- if (eds_policy_->shutting_down_ || eds_policy_->child_policy_ == nullptr) {
- return;
- }
- if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_eds_trace)) {
- gpr_log(GPR_INFO,
- "[edslb %p] child policy updated state=%s (%s) "
- "picker=%p",
- eds_policy_.get(), ConnectivityStateName(state),
- status.ToString().c_str(), picker.get());
- }
- // Save the state and picker.
- eds_policy_->child_state_ = state;
- eds_policy_->child_status_ = status;
- eds_policy_->child_picker_ =
- MakeRefCounted<ChildPickerWrapper>(std::move(picker));
- // Wrap the picker in a EdsPicker and pass it up.
- eds_policy_->MaybeUpdateEdsPickerLocked();
-}
-
-void EdsLb::Helper::AddTraceEvent(TraceSeverity severity,
- y_absl::string_view message) {
- if (eds_policy_->shutting_down_) return;
- eds_policy_->channel_control_helper()->AddTraceEvent(severity, message);
-}
-
-//
-// EdsLb::EndpointWatcher::Notifier
-//
-
-EdsLb::EndpointWatcher::Notifier::Notifier(RefCountedPtr<EdsLb> parent,
- XdsApi::EdsUpdate update)
- : parent_(std::move(parent)), update_(std::move(update)), type_(kUpdate) {
- GRPC_CLOSURE_INIT(&closure_, &RunInExecCtx, this, nullptr);
- ExecCtx::Run(DEBUG_LOCATION, &closure_, GRPC_ERROR_NONE);
-}
-
-EdsLb::EndpointWatcher::Notifier::Notifier(RefCountedPtr<EdsLb> parent,
- grpc_error* error)
- : parent_(std::move(parent)), type_(kError) {
- GRPC_CLOSURE_INIT(&closure_, &RunInExecCtx, this, nullptr);
- ExecCtx::Run(DEBUG_LOCATION, &closure_, error);
-}
-
-EdsLb::EndpointWatcher::Notifier::Notifier(RefCountedPtr<EdsLb> parent)
- : parent_(std::move(parent)), type_(kDoesNotExist) {
- GRPC_CLOSURE_INIT(&closure_, &RunInExecCtx, this, nullptr);
- ExecCtx::Run(DEBUG_LOCATION, &closure_, GRPC_ERROR_NONE);
-}
-
-void EdsLb::EndpointWatcher::Notifier::RunInExecCtx(void* arg,
- grpc_error* error) {
- Notifier* self = static_cast<Notifier*>(arg);
- GRPC_ERROR_REF(error);
- self->parent_->work_serializer()->Run(
- [self, error]() { self->RunInWorkSerializer(error); }, DEBUG_LOCATION);
-}
-
-void EdsLb::EndpointWatcher::Notifier::RunInWorkSerializer(grpc_error* error) {
- switch (type_) {
- case kUpdate:
- parent_->OnEndpointChanged(std::move(update_));
- break;
- case kError:
- parent_->OnError(error);
- break;
- case kDoesNotExist:
- parent_->OnResourceDoesNotExist();
- break;
- };
- delete this;
-}
-
-//
-// EdsLb public methods
-//
-
-EdsLb::EdsLb(RefCountedPtr<XdsClient> xds_client, Args args)
- : LoadBalancingPolicy(std::move(args)), xds_client_(std::move(xds_client)) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_eds_trace)) {
- gpr_log(GPR_INFO, "[edslb %p] created -- using xds client %p", this,
- xds_client_.get());
- }
- // Record server name.
- const char* server_uri =
- grpc_channel_args_find_string(args.args, GRPC_ARG_SERVER_URI);
- GPR_ASSERT(server_uri != nullptr);
- grpc_uri* uri = grpc_uri_parse(server_uri, true);
- GPR_ASSERT(uri->path[0] != '\0');
- server_name_ = uri->path[0] == '/' ? uri->path + 1 : uri->path;
- is_xds_uri_ = strcmp(uri->scheme, "xds") == 0;
- if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_eds_trace)) {
- gpr_log(GPR_INFO, "[edslb %p] server name from channel (is_xds_uri=%d): %s",
- this, is_xds_uri_, server_name_.c_str());
- }
- grpc_uri_destroy(uri);
- // EDS-only flow.
- if (!is_xds_uri_) {
- // Setup channelz linkage.
- channelz::ChannelNode* parent_channelz_node =
- grpc_channel_args_find_pointer<channelz::ChannelNode>(
- args.args, GRPC_ARG_CHANNELZ_CHANNEL_NODE);
- if (parent_channelz_node != nullptr) {
- xds_client_->AddChannelzLinkage(parent_channelz_node);
- }
- // Couple polling.
- grpc_pollset_set_add_pollset_set(xds_client_->interested_parties(),
- interested_parties());
- }
-}
-
-EdsLb::~EdsLb() {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_eds_trace)) {
- gpr_log(GPR_INFO, "[edslb %p] destroying eds LB policy", this);
- }
-}
-
-void EdsLb::ShutdownLocked() {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_eds_trace)) {
- gpr_log(GPR_INFO, "[edslb %p] shutting down", this);
- }
- shutting_down_ = true;
- // Drop our ref to the child's picker, in case it's holding a ref to
- // the child.
- child_picker_.reset();
- MaybeDestroyChildPolicyLocked();
- drop_stats_.reset();
- // Cancel watcher.
- if (endpoint_watcher_ != nullptr) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_eds_trace)) {
- gpr_log(GPR_INFO, "[edslb %p] cancelling xds watch for %s", this,
- TString(GetEdsResourceName()).c_str());
- }
- xds_client_->CancelEndpointDataWatch(GetEdsResourceName(),
- endpoint_watcher_);
- }
- if (!is_xds_uri_) {
- // Remove channelz linkage.
- channelz::ChannelNode* parent_channelz_node =
- grpc_channel_args_find_pointer<channelz::ChannelNode>(
- args_, GRPC_ARG_CHANNELZ_CHANNEL_NODE);
- if (parent_channelz_node != nullptr) {
- xds_client_->RemoveChannelzLinkage(parent_channelz_node);
- }
- // Decouple polling.
- grpc_pollset_set_del_pollset_set(xds_client_->interested_parties(),
- interested_parties());
- }
- xds_client_.reset(DEBUG_LOCATION, "EdsLb");
- // Destroy channel args.
- grpc_channel_args_destroy(args_);
- args_ = nullptr;
-}
-
-void EdsLb::MaybeDestroyChildPolicyLocked() {
- if (child_policy_ != nullptr) {
- grpc_pollset_set_del_pollset_set(child_policy_->interested_parties(),
- interested_parties());
- child_policy_.reset();
- }
-}
-
-void EdsLb::UpdateLocked(UpdateArgs args) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_eds_trace)) {
- gpr_log(GPR_INFO, "[edslb %p] Received update", this);
- }
- const bool is_initial_update = args_ == nullptr;
- // Update config.
- auto old_config = std::move(config_);
- config_ = std::move(args.config);
- // Update args.
- grpc_channel_args_destroy(args_);
- args_ = args.args;
- args.args = nullptr;
- const bool lrs_server_changed =
- is_initial_update || config_->lrs_load_reporting_server_name() !=
- old_config->lrs_load_reporting_server_name();
- const bool max_concurrent_requests_changed =
- is_initial_update || config_->max_concurrent_requests() !=
- old_config->max_concurrent_requests();
- // Update drop stats for load reporting if needed.
- if (lrs_server_changed) {
- drop_stats_.reset();
- if (config_->lrs_load_reporting_server_name().has_value()) {
- const auto key = GetLrsClusterKey();
- drop_stats_ = xds_client_->AddClusterDropStats(
- config_->lrs_load_reporting_server_name().value(),
- key.first /*cluster_name*/, key.second /*eds_service_name*/);
- }
- }
- if (lrs_server_changed || max_concurrent_requests_changed) {
- MaybeUpdateEdsPickerLocked();
- }
- // Update child policy if needed.
- // Note that this comes after updating drop_stats_, since we want that
- // to be used by any new picker we create here.
- if (child_policy_ != nullptr) UpdateChildPolicyLocked();
- // Create endpoint watcher if needed.
- if (is_initial_update) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_eds_trace)) {
- gpr_log(GPR_INFO, "[edslb %p] starting xds watch for %s", this,
- TString(GetEdsResourceName()).c_str());
- }
- auto watcher = y_absl::make_unique<EndpointWatcher>(
- Ref(DEBUG_LOCATION, "EndpointWatcher"));
- endpoint_watcher_ = watcher.get();
- xds_client_->WatchEndpointData(GetEdsResourceName(), std::move(watcher));
- }
-}
-
-void EdsLb::ResetBackoffLocked() {
- // When the XdsClient is instantiated in the resolver instead of in this
- // LB policy, this is done via the resolver, so we don't need to do it here.
- if (!is_xds_uri_ && xds_client_ != nullptr) xds_client_->ResetBackoff();
- if (child_policy_ != nullptr) {
- child_policy_->ResetBackoffLocked();
- }
-}
-
-void EdsLb::OnEndpointChanged(XdsApi::EdsUpdate update) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_eds_trace)) {
- gpr_log(GPR_INFO, "[edslb %p] Received EDS update from xds client", this);
- }
- // Update the drop config.
- drop_config_ = std::move(update.drop_config);
- // If priority list is empty, add a single priority, just so that we
- // have a child in which to create the eds_drop policy.
- if (update.priorities.empty()) update.priorities.emplace_back();
- // Update child policy.
- UpdatePriorityList(std::move(update.priorities));
-}
-
-void EdsLb::OnError(grpc_error* error) {
- gpr_log(GPR_ERROR, "[edslb %p] xds watcher reported error: %s", this,
- grpc_error_string(error));
- // Go into TRANSIENT_FAILURE if we have not yet created the child
- // policy (i.e., we have not yet received data from xds). Otherwise,
- // we keep running with the data we had previously.
- if (child_policy_ == nullptr) {
- channel_control_helper()->UpdateState(
- GRPC_CHANNEL_TRANSIENT_FAILURE, grpc_error_to_absl_status(error),
- y_absl::make_unique<TransientFailurePicker>(error));
- } else {
- GRPC_ERROR_UNREF(error);
- }
-}
-
-void EdsLb::OnResourceDoesNotExist() {
- gpr_log(
- GPR_ERROR,
- "[edslb %p] EDS resource does not exist -- reporting TRANSIENT_FAILURE",
- this);
- grpc_error* error = grpc_error_set_int(
- GRPC_ERROR_CREATE_FROM_STATIC_STRING("EDS resource does not exist"),
- GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE);
- channel_control_helper()->UpdateState(
- GRPC_CHANNEL_TRANSIENT_FAILURE, grpc_error_to_absl_status(error),
- y_absl::make_unique<TransientFailurePicker>(error));
- MaybeDestroyChildPolicyLocked();
-}
-
-//
-// child policy-related methods
-//
-
-void EdsLb::UpdatePriorityList(XdsApi::EdsUpdate::PriorityList priority_list) {
- // Build some maps from locality to child number and the reverse from
- // the old data in priority_list_ and priority_child_numbers_.
- std::map<XdsLocalityName*, size_t /*child_number*/, XdsLocalityName::Less>
- locality_child_map;
- std::map<size_t, std::set<XdsLocalityName*>> child_locality_map;
- for (size_t priority = 0; priority < priority_list_.size(); ++priority) {
- size_t child_number = priority_child_numbers_[priority];
- const auto& localities = priority_list_[priority].localities;
- for (const auto& p : localities) {
- XdsLocalityName* locality_name = p.first;
- locality_child_map[locality_name] = child_number;
- child_locality_map[child_number].insert(locality_name);
- }
- }
- // Construct new list of children.
- std::vector<size_t> priority_child_numbers;
- for (size_t priority = 0; priority < priority_list.size(); ++priority) {
- const auto& localities = priority_list[priority].localities;
- y_absl::optional<size_t> child_number;
- // If one of the localities in this priority already existed, reuse its
- // child number.
- for (const auto& p : localities) {
- XdsLocalityName* locality_name = p.first;
- if (!child_number.has_value()) {
- auto it = locality_child_map.find(locality_name);
- if (it != locality_child_map.end()) {
- child_number = it->second;
- locality_child_map.erase(it);
- // Remove localities that *used* to be in this child number, so
- // that we don't incorrectly reuse this child number for a
- // subsequent priority.
- for (XdsLocalityName* old_locality :
- child_locality_map[*child_number]) {
- locality_child_map.erase(old_locality);
- }
- }
- } else {
- // Remove all localities that are now in this child number, so
- // that we don't accidentally reuse this child number for a
- // subsequent priority.
- locality_child_map.erase(locality_name);
- }
- }
- // If we didn't find an existing child number, assign a new one.
- if (!child_number.has_value()) {
- for (child_number = 0;
- child_locality_map.find(*child_number) != child_locality_map.end();
- ++(*child_number))
- ;
- // Add entry so we know that the child number is in use.
- // (Don't need to add the list of localities, since we won't use them.)
- child_locality_map[*child_number];
- }
- priority_child_numbers.push_back(*child_number);
- }
- // Save update.
- priority_list_ = std::move(priority_list);
- priority_child_numbers_ = std::move(priority_child_numbers);
- // Update child policy.
- UpdateChildPolicyLocked();
-}
-
-ServerAddressList EdsLb::CreateChildPolicyAddressesLocked() {
- ServerAddressList addresses;
- for (size_t priority = 0; priority < priority_list_.size(); ++priority) {
- const auto& localities = priority_list_[priority].localities;
- TString priority_child_name =
- y_absl::StrCat("child", priority_child_numbers_[priority]);
- for (const auto& p : localities) {
- const auto& locality_name = p.first;
- const auto& locality = p.second;
- std::vector<TString> hierarchical_path = {
- priority_child_name, locality_name->AsHumanReadableString()};
- for (const auto& endpoint : locality.endpoints) {
- addresses.emplace_back(
- endpoint
- .WithAttribute(kHierarchicalPathAttributeKey,
- MakeHierarchicalPathAttribute(hierarchical_path))
- .WithAttribute(kXdsLocalityNameAttributeKey,
- y_absl::make_unique<XdsLocalityAttribute>(
- locality_name->Ref())));
- }
- }
- }
- return addresses;
-}
-
-RefCountedPtr<LoadBalancingPolicy::Config>
-EdsLb::CreateChildPolicyConfigLocked() {
- const auto lrs_key = GetLrsClusterKey();
- Json::Object priority_children;
- Json::Array priority_priorities;
- for (size_t priority = 0; priority < priority_list_.size(); ++priority) {
- const auto& localities = priority_list_[priority].localities;
- Json::Object weighted_targets;
- for (const auto& p : localities) {
- XdsLocalityName* locality_name = p.first;
- const auto& locality = p.second;
- // Construct JSON object containing locality name.
- Json::Object locality_name_json;
- if (!locality_name->region().empty()) {
- locality_name_json["region"] = locality_name->region();
- }
- if (!locality_name->zone().empty()) {
- locality_name_json["zone"] = locality_name->zone();
- }
- if (!locality_name->sub_zone().empty()) {
- locality_name_json["subzone"] = locality_name->sub_zone();
- }
- // Add weighted target entry.
- weighted_targets[locality_name->AsHumanReadableString()] = Json::Object{
- {"weight", locality.lb_weight},
- {"childPolicy", config_->endpoint_picking_policy()},
- };
- }
- // Construct locality-picking policy.
- // Start with field from our config and add the "targets" field.
- Json locality_picking_config = config_->locality_picking_policy();
- Json::Object& config =
- *(*locality_picking_config.mutable_array())[0].mutable_object();
- auto it = config.begin();
- GPR_ASSERT(it != config.end());
- (*it->second.mutable_object())["targets"] = std::move(weighted_targets);
- // Wrap it in the drop policy.
- Json::Array drop_categories;
- for (const auto& category : drop_config_->drop_category_list()) {
- drop_categories.push_back(Json::Object{
- {"category", category.name},
- {"requests_per_million", category.parts_per_million},
- });
- }
- Json::Object eds_drop_config = {
- {"clusterName", TString(lrs_key.first)},
- {"childPolicy", std::move(locality_picking_config)},
- {"dropCategories", std::move(drop_categories)},
- };
- if (!lrs_key.second.empty()) {
- eds_drop_config["edsServiceName"] = TString(lrs_key.second);
- }
- if (config_->lrs_load_reporting_server_name().has_value()) {
- eds_drop_config["lrsLoadReportingServerName"] =
- config_->lrs_load_reporting_server_name().value();
- }
- Json locality_picking_policy = Json::Array{Json::Object{
- {"eds_drop_experimental", std::move(eds_drop_config)},
- }};
- // Add priority entry.
- const size_t child_number = priority_child_numbers_[priority];
- TString child_name = y_absl::StrCat("child", child_number);
- priority_priorities.emplace_back(child_name);
- priority_children[child_name] = Json::Object{
- {"config", std::move(locality_picking_policy)},
- };
- }
- Json json = Json::Array{Json::Object{
- {"priority_experimental",
- Json::Object{
- {"children", std::move(priority_children)},
- {"priorities", std::move(priority_priorities)},
- }},
- }};
- if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_eds_trace)) {
- TString json_str = json.Dump(/*indent=*/1);
- gpr_log(GPR_INFO, "[edslb %p] generated config for child policy: %s", this,
- json_str.c_str());
- }
- grpc_error* error = GRPC_ERROR_NONE;
- RefCountedPtr<LoadBalancingPolicy::Config> config =
- LoadBalancingPolicyRegistry::ParseLoadBalancingConfig(json, &error);
- if (error != GRPC_ERROR_NONE) {
- // This should never happen, but if it does, we basically have no
- // way to fix it, so we put the channel in TRANSIENT_FAILURE.
- gpr_log(GPR_ERROR,
- "[edslb %p] error parsing generated child policy config -- "
- "will put channel in TRANSIENT_FAILURE: %s",
- this, grpc_error_string(error));
- error = grpc_error_set_int(
- grpc_error_add_child(
- GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "eds LB policy: error parsing generated child policy config"),
- error),
- GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_INTERNAL);
- channel_control_helper()->UpdateState(
- GRPC_CHANNEL_TRANSIENT_FAILURE, grpc_error_to_absl_status(error),
- y_absl::make_unique<TransientFailurePicker>(error));
- return nullptr;
- }
- return config;
-}
-
-void EdsLb::UpdateChildPolicyLocked() {
- if (shutting_down_) return;
- UpdateArgs update_args;
- update_args.config = CreateChildPolicyConfigLocked();
- if (update_args.config == nullptr) return;
- update_args.addresses = CreateChildPolicyAddressesLocked();
- update_args.args = CreateChildPolicyArgsLocked(args_);
- if (child_policy_ == nullptr) {
- child_policy_ = CreateChildPolicyLocked(update_args.args);
- }
- if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_eds_trace)) {
- gpr_log(GPR_INFO, "[edslb %p] Updating child policy %p", this,
- child_policy_.get());
- }
- child_policy_->UpdateLocked(std::move(update_args));
-}
-
-grpc_channel_args* EdsLb::CreateChildPolicyArgsLocked(
- const grpc_channel_args* args) {
- grpc_arg args_to_add[] = {
- // A channel arg indicating if the target is a backend inferred from an
- // xds load balancer.
- // TODO(roth): This isn't needed with the new fallback design.
- // Remove as part of implementing the new fallback functionality.
- grpc_channel_arg_integer_create(
- const_cast<char*>(GRPC_ARG_ADDRESS_IS_BACKEND_FROM_XDS_LOAD_BALANCER),
- 1),
- // Inhibit client-side health checking, since the balancer does
- // this for us.
- grpc_channel_arg_integer_create(
- const_cast<char*>(GRPC_ARG_INHIBIT_HEALTH_CHECKING), 1),
- };
- return grpc_channel_args_copy_and_add(args, args_to_add,
- GPR_ARRAY_SIZE(args_to_add));
-}
-
-OrphanablePtr<LoadBalancingPolicy> EdsLb::CreateChildPolicyLocked(
- const grpc_channel_args* args) {
- LoadBalancingPolicy::Args lb_policy_args;
- lb_policy_args.work_serializer = work_serializer();
- lb_policy_args.args = args;
- lb_policy_args.channel_control_helper =
- y_absl::make_unique<Helper>(Ref(DEBUG_LOCATION, "Helper"));
- OrphanablePtr<LoadBalancingPolicy> lb_policy =
- LoadBalancingPolicyRegistry::CreateLoadBalancingPolicy(
- "priority_experimental", std::move(lb_policy_args));
- if (GPR_UNLIKELY(lb_policy == nullptr)) {
- gpr_log(GPR_ERROR, "[edslb %p] failure creating child policy", this);
- return nullptr;
- }
- if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_eds_trace)) {
- gpr_log(GPR_INFO, "[edslb %p]: Created new child policy %p", this,
- lb_policy.get());
- }
- // Add our interested_parties pollset_set to that of the newly created
- // child policy. This will make the child policy progress upon activity on
- // this policy, which in turn is tied to the application's call.
- grpc_pollset_set_add_pollset_set(lb_policy->interested_parties(),
- interested_parties());
- return lb_policy;
-}
-
-void EdsLb::MaybeUpdateEdsPickerLocked() {
- // Update only if we have a child picker.
- if (child_picker_ != nullptr) {
- channel_control_helper()->UpdateState(
- child_state_, child_status_,
- y_absl::make_unique<EdsPicker>(Ref(DEBUG_LOCATION, "EdsPicker")));
- }
-}
-
-//
-// factory
-//
-
-class EdsLbFactory : public LoadBalancingPolicyFactory {
- public:
- OrphanablePtr<LoadBalancingPolicy> CreateLoadBalancingPolicy(
- LoadBalancingPolicy::Args args) const override {
- grpc_error* error = GRPC_ERROR_NONE;
- RefCountedPtr<XdsClient> xds_client = XdsClient::GetOrCreate(&error);
- if (error != GRPC_ERROR_NONE) {
- gpr_log(GPR_ERROR,
- "cannot get XdsClient to instantiate eds LB policy: %s",
- grpc_error_string(error));
- GRPC_ERROR_UNREF(error);
- return nullptr;
- }
- return MakeOrphanable<EdsChildHandler>(std::move(xds_client),
- std::move(args));
- }
-
- const char* name() const override { return kEds; }
-
- RefCountedPtr<LoadBalancingPolicy::Config> ParseLoadBalancingConfig(
- const Json& json, grpc_error** error) const override {
- GPR_DEBUG_ASSERT(error != nullptr && *error == GRPC_ERROR_NONE);
- if (json.type() == Json::Type::JSON_NULL) {
- // eds was mentioned as a policy in the deprecated loadBalancingPolicy
- // field or in the client API.
- *error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:loadBalancingPolicy error:eds policy requires configuration. "
- "Please use loadBalancingConfig field of service config instead.");
- return nullptr;
- }
- std::vector<grpc_error*> error_list;
- // EDS service name.
- TString eds_service_name;
- auto it = json.object_value().find("edsServiceName");
- if (it != json.object_value().end()) {
- if (it->second.type() != Json::Type::STRING) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:edsServiceName error:type should be string"));
- } else {
- eds_service_name = it->second.string_value();
- }
- }
- // Cluster name.
- TString cluster_name;
- it = json.object_value().find("clusterName");
- if (it == json.object_value().end()) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:clusterName error:required field missing"));
- } else if (it->second.type() != Json::Type::STRING) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:clusterName error:type should be string"));
- } else {
- cluster_name = it->second.string_value();
- }
- // LRS load reporting server name.
- y_absl::optional<TString> lrs_load_reporting_server_name;
- it = json.object_value().find("lrsLoadReportingServerName");
- if (it != json.object_value().end()) {
- if (it->second.type() != Json::Type::STRING) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:lrsLoadReportingServerName error:type should be string"));
- } else {
- lrs_load_reporting_server_name.emplace(it->second.string_value());
- }
- }
- // Locality-picking policy.
- Json locality_picking_policy;
- it = json.object_value().find("localityPickingPolicy");
- if (it == json.object_value().end()) {
- locality_picking_policy = Json::Array{
- Json::Object{
- {"weighted_target_experimental",
- Json::Object{
- {"targets", Json::Object()},
- }},
- },
- };
- } else {
- locality_picking_policy = it->second;
- }
- grpc_error* parse_error = GRPC_ERROR_NONE;
- if (LoadBalancingPolicyRegistry::ParseLoadBalancingConfig(
- locality_picking_policy, &parse_error) == nullptr) {
- GPR_DEBUG_ASSERT(parse_error != GRPC_ERROR_NONE);
- error_list.push_back(GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
- "localityPickingPolicy", &parse_error, 1));
- GRPC_ERROR_UNREF(parse_error);
- }
- // Endpoint-picking policy. Called "childPolicy" for xds policy.
- Json endpoint_picking_policy;
- it = json.object_value().find("endpointPickingPolicy");
- if (it == json.object_value().end()) {
- endpoint_picking_policy = Json::Array{
- Json::Object{
- {"round_robin", Json::Object()},
- },
- };
- } else {
- endpoint_picking_policy = it->second;
- }
- parse_error = GRPC_ERROR_NONE;
- if (LoadBalancingPolicyRegistry::ParseLoadBalancingConfig(
- endpoint_picking_policy, &parse_error) == nullptr) {
- GPR_DEBUG_ASSERT(parse_error != GRPC_ERROR_NONE);
- error_list.push_back(GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
- "endpointPickingPolicy", &parse_error, 1));
- GRPC_ERROR_UNREF(parse_error);
- }
- // Max concurrent requests.
- uint32_t max_concurrent_requests = 1024;
- it = json.object_value().find("max_concurrent_requests");
- if (it != json.object_value().end()) {
- if (it->second.type() != Json::Type::NUMBER) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:max_concurrent_requests error:must be of type number"));
- } else {
- max_concurrent_requests =
- gpr_parse_nonnegative_int(it->second.string_value().c_str());
- }
- }
- // Construct config.
- if (error_list.empty()) {
- return MakeRefCounted<EdsLbConfig>(
- std::move(cluster_name), std::move(eds_service_name),
- std::move(lrs_load_reporting_server_name),
- std::move(locality_picking_policy),
- std::move(endpoint_picking_policy), max_concurrent_requests);
- } else {
- *error = GRPC_ERROR_CREATE_FROM_VECTOR(
- "eds_experimental LB policy config", &error_list);
- return nullptr;
- }
- }
-
- private:
- class EdsChildHandler : public ChildPolicyHandler {
- public:
- EdsChildHandler(RefCountedPtr<XdsClient> xds_client, Args args)
- : ChildPolicyHandler(std::move(args), &grpc_lb_eds_trace),
- xds_client_(std::move(xds_client)) {}
-
- bool ConfigChangeRequiresNewPolicyInstance(
- LoadBalancingPolicy::Config* old_config,
- LoadBalancingPolicy::Config* new_config) const override {
- GPR_ASSERT(old_config->name() == kEds);
- GPR_ASSERT(new_config->name() == kEds);
- EdsLbConfig* old_eds_config = static_cast<EdsLbConfig*>(old_config);
- EdsLbConfig* new_eds_config = static_cast<EdsLbConfig*>(new_config);
- return old_eds_config->cluster_name() != new_eds_config->cluster_name() ||
- old_eds_config->eds_service_name() !=
- new_eds_config->eds_service_name() ||
- old_eds_config->lrs_load_reporting_server_name() !=
- new_eds_config->lrs_load_reporting_server_name();
- }
-
- OrphanablePtr<LoadBalancingPolicy> CreateLoadBalancingPolicy(
- const char* name, LoadBalancingPolicy::Args args) const override {
- return MakeOrphanable<EdsLb>(xds_client_, std::move(args));
- }
-
- private:
- RefCountedPtr<XdsClient> xds_client_;
- };
-};
-
-} // namespace
-
-} // namespace grpc_core
-
-//
-// Plugin registration
-//
-
-void grpc_lb_policy_eds_init() {
- grpc_core::LoadBalancingPolicyRegistry::Builder::
- RegisterLoadBalancingPolicyFactory(
- y_absl::make_unique<grpc_core::EdsLbFactory>());
-}
-
-void grpc_lb_policy_eds_shutdown() {}
+//
+// Copyright 2018 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+#include <grpc/support/port_platform.h>
+
+#include <inttypes.h>
+#include <limits.h>
+
+#include "y_absl/strings/str_cat.h"
+#include "y_absl/types/optional.h"
+
+#include <grpc/grpc.h>
+
+#include "src/core/ext/filters/client_channel/client_channel.h"
+#include "src/core/ext/filters/client_channel/lb_policy.h"
+#include "src/core/ext/filters/client_channel/lb_policy/address_filtering.h"
+#include "src/core/ext/filters/client_channel/lb_policy/child_policy_handler.h"
+#include "src/core/ext/filters/client_channel/lb_policy/xds/xds.h"
+#include "src/core/ext/filters/client_channel/lb_policy_factory.h"
+#include "src/core/ext/filters/client_channel/lb_policy_registry.h"
+#include "src/core/ext/filters/client_channel/server_address.h"
+#include "src/core/ext/xds/xds_channel_args.h"
+#include "src/core/ext/xds/xds_client.h"
+#include "src/core/ext/xds/xds_client_stats.h"
+#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/gpr/env.h"
+#include "src/core/lib/gpr/string.h"
+#include "src/core/lib/gprpp/orphanable.h"
+#include "src/core/lib/gprpp/ref_counted_ptr.h"
+#include "src/core/lib/iomgr/timer.h"
+#include "src/core/lib/iomgr/work_serializer.h"
+#include "src/core/lib/transport/error_utils.h"
+#include "src/core/lib/uri/uri_parser.h"
+
+#define GRPC_EDS_DEFAULT_FALLBACK_TIMEOUT 10000
+
+namespace grpc_core {
+
+TraceFlag grpc_lb_eds_trace(false, "eds_lb");
+
+namespace {
+
+constexpr char kEds[] = "eds_experimental";
+
+const char* kXdsLocalityNameAttributeKey = "xds_locality_name";
+
+// TODO (donnadionne): Check to see if circuit breaking is enabled, this will be
+// removed once circuit breaking feature is fully integrated and enabled by
+// default.
+bool XdsCircuitBreakingEnabled() {
+ char* value = gpr_getenv("GRPC_XDS_EXPERIMENTAL_CIRCUIT_BREAKING");
+ bool parsed_value;
+ bool parse_succeeded = gpr_parse_bool_value(value, &parsed_value);
+ gpr_free(value);
+ return parse_succeeded && parsed_value;
+}
+
+// Config for EDS LB policy.
+class EdsLbConfig : public LoadBalancingPolicy::Config {
+ public:
+ EdsLbConfig(TString cluster_name, TString eds_service_name,
+ y_absl::optional<TString> lrs_load_reporting_server_name,
+ Json locality_picking_policy, Json endpoint_picking_policy,
+ uint32_t max_concurrent_requests)
+ : cluster_name_(std::move(cluster_name)),
+ eds_service_name_(std::move(eds_service_name)),
+ lrs_load_reporting_server_name_(
+ std::move(lrs_load_reporting_server_name)),
+ locality_picking_policy_(std::move(locality_picking_policy)),
+ endpoint_picking_policy_(std::move(endpoint_picking_policy)),
+ max_concurrent_requests_(max_concurrent_requests) {}
+
+ const char* name() const override { return kEds; }
+
+ const TString& cluster_name() const { return cluster_name_; }
+ const TString& eds_service_name() const { return eds_service_name_; }
+ const y_absl::optional<TString>& lrs_load_reporting_server_name() const {
+ return lrs_load_reporting_server_name_;
+ };
+ const Json& locality_picking_policy() const {
+ return locality_picking_policy_;
+ }
+ const Json& endpoint_picking_policy() const {
+ return endpoint_picking_policy_;
+ }
+ const uint32_t max_concurrent_requests() const {
+ return max_concurrent_requests_;
+ }
+
+ private:
+ TString cluster_name_;
+ TString eds_service_name_;
+ y_absl::optional<TString> lrs_load_reporting_server_name_;
+ Json locality_picking_policy_;
+ Json endpoint_picking_policy_;
+ uint32_t max_concurrent_requests_;
+};
+
+// EDS LB policy.
+class EdsLb : public LoadBalancingPolicy {
+ public:
+ EdsLb(RefCountedPtr<XdsClient> xds_client, Args args);
+
+ const char* name() const override { return kEds; }
+
+ void UpdateLocked(UpdateArgs args) override;
+ void ResetBackoffLocked() override;
+
+ private:
+ class XdsLocalityAttribute : public ServerAddress::AttributeInterface {
+ public:
+ explicit XdsLocalityAttribute(RefCountedPtr<XdsLocalityName> locality_name)
+ : locality_name_(std::move(locality_name)) {}
+
+ RefCountedPtr<XdsLocalityName> locality_name() const {
+ return locality_name_;
+ }
+
+ std::unique_ptr<AttributeInterface> Copy() const override {
+ return y_absl::make_unique<XdsLocalityAttribute>(locality_name_->Ref());
+ }
+
+ int Cmp(const AttributeInterface* other) const override {
+ const auto* other_locality_attr =
+ static_cast<const XdsLocalityAttribute*>(other);
+ return locality_name_->Compare(*other_locality_attr->locality_name_);
+ }
+
+ TString ToString() const override {
+ return locality_name_->AsHumanReadableString();
+ }
+
+ private:
+ RefCountedPtr<XdsLocalityName> locality_name_;
+ };
+
+ class StatsSubchannelWrapper : public DelegatingSubchannel {
+ public:
+ StatsSubchannelWrapper(
+ RefCountedPtr<SubchannelInterface> wrapped_subchannel,
+ RefCountedPtr<XdsClusterLocalityStats> locality_stats)
+ : DelegatingSubchannel(std::move(wrapped_subchannel)),
+ locality_stats_(std::move(locality_stats)) {}
+
+ XdsClusterLocalityStats* locality_stats() const {
+ return locality_stats_.get();
+ }
+
+ private:
+ RefCountedPtr<XdsClusterLocalityStats> locality_stats_;
+ };
+
+ class EndpointWatcher : public XdsClient::EndpointWatcherInterface {
+ public:
+ explicit EndpointWatcher(RefCountedPtr<EdsLb> parent)
+ : parent_(std::move(parent)) {}
+ void OnEndpointChanged(XdsApi::EdsUpdate update) override {
+ new Notifier(parent_, std::move(update));
+ }
+ void OnError(grpc_error* error) override { new Notifier(parent_, error); }
+ void OnResourceDoesNotExist() override { new Notifier(parent_); }
+
+ private:
+ class Notifier {
+ public:
+ Notifier(RefCountedPtr<EdsLb> parent, XdsApi::EdsUpdate update);
+ Notifier(RefCountedPtr<EdsLb> parent, grpc_error* error);
+ explicit Notifier(RefCountedPtr<EdsLb> parent);
+
+ private:
+ enum Type { kUpdate, kError, kDoesNotExist };
+
+ static void RunInExecCtx(void* arg, grpc_error* error);
+ void RunInWorkSerializer(grpc_error* error);
+
+ RefCountedPtr<EdsLb> parent_;
+ grpc_closure closure_;
+ XdsApi::EdsUpdate update_;
+ Type type_;
+ };
+
+ RefCountedPtr<EdsLb> parent_;
+ };
+
+ // A simple wrapper for ref-counting a picker from the child policy.
+ class ChildPickerWrapper : public RefCounted<ChildPickerWrapper> {
+ public:
+ explicit ChildPickerWrapper(std::unique_ptr<SubchannelPicker> picker)
+ : picker_(std::move(picker)) {}
+ PickResult Pick(PickArgs args) { return picker_->Pick(args); }
+
+ private:
+ std::unique_ptr<SubchannelPicker> picker_;
+ };
+
+ // A picker that handles drops.
+ class EdsPicker : public SubchannelPicker {
+ public:
+ explicit EdsPicker(RefCountedPtr<EdsLb> eds_policy);
+
+ PickResult Pick(PickArgs args) override;
+
+ private:
+ RefCountedPtr<EdsLb> eds_policy_;
+ RefCountedPtr<XdsApi::EdsUpdate::DropConfig> drop_config_;
+ RefCountedPtr<XdsClusterDropStats> drop_stats_;
+ RefCountedPtr<ChildPickerWrapper> child_picker_;
+ bool xds_circuit_breaking_enabled_;
+ uint32_t max_concurrent_requests_;
+ };
+
+ class Helper : public ChannelControlHelper {
+ public:
+ explicit Helper(RefCountedPtr<EdsLb> eds_policy)
+ : eds_policy_(std::move(eds_policy)) {}
+
+ ~Helper() { eds_policy_.reset(DEBUG_LOCATION, "Helper"); }
+
+ RefCountedPtr<SubchannelInterface> CreateSubchannel(
+ ServerAddress address, const grpc_channel_args& args) override;
+ void UpdateState(grpc_connectivity_state state, const y_absl::Status& status,
+ std::unique_ptr<SubchannelPicker> picker) override;
+ // This is a no-op, because we get the addresses from the xds
+ // client, which is a watch-based API.
+ void RequestReresolution() override {}
+ void AddTraceEvent(TraceSeverity severity,
+ y_absl::string_view message) override;
+
+ private:
+ RefCountedPtr<EdsLb> eds_policy_;
+ };
+
+ ~EdsLb();
+
+ void ShutdownLocked() override;
+
+ void OnEndpointChanged(XdsApi::EdsUpdate update);
+ void OnError(grpc_error* error);
+ void OnResourceDoesNotExist();
+
+ void MaybeDestroyChildPolicyLocked();
+
+ void UpdatePriorityList(XdsApi::EdsUpdate::PriorityList priority_list);
+ void UpdateChildPolicyLocked();
+ OrphanablePtr<LoadBalancingPolicy> CreateChildPolicyLocked(
+ const grpc_channel_args* args);
+ ServerAddressList CreateChildPolicyAddressesLocked();
+ RefCountedPtr<Config> CreateChildPolicyConfigLocked();
+ grpc_channel_args* CreateChildPolicyArgsLocked(
+ const grpc_channel_args* args_in);
+ void MaybeUpdateEdsPickerLocked();
+
+ // Caller must ensure that config_ is set before calling.
+ const y_absl::string_view GetEdsResourceName() const {
+ if (!is_xds_uri_) return server_name_;
+ if (!config_->eds_service_name().empty()) {
+ return config_->eds_service_name();
+ }
+ return config_->cluster_name();
+ }
+
+ // Returns a pair containing the cluster and eds_service_name to use
+ // for LRS load reporting.
+ // Caller must ensure that config_ is set before calling.
+ std::pair<y_absl::string_view, y_absl::string_view> GetLrsClusterKey() const {
+ if (!is_xds_uri_) return {server_name_, y_absl::string_view{}};
+ return {config_->cluster_name(), config_->eds_service_name()};
+ }
+
+ // Server name from target URI.
+ TString server_name_;
+ bool is_xds_uri_;
+
+ // Current channel args and config from the resolver.
+ const grpc_channel_args* args_ = nullptr;
+ RefCountedPtr<EdsLbConfig> config_;
+
+ // Internal state.
+ bool shutting_down_ = false;
+
+ // The xds client and endpoint watcher.
+ RefCountedPtr<XdsClient> xds_client_;
+ // A pointer to the endpoint watcher, to be used when cancelling the watch.
+ // Note that this is not owned, so this pointer must never be derefernced.
+ EndpointWatcher* endpoint_watcher_ = nullptr;
+ // The latest data from the endpoint watcher.
+ XdsApi::EdsUpdate::PriorityList priority_list_;
+ // State used to retain child policy names for priority policy.
+ std::vector<size_t /*child_number*/> priority_child_numbers_;
+
+ RefCountedPtr<XdsApi::EdsUpdate::DropConfig> drop_config_;
+ RefCountedPtr<XdsClusterDropStats> drop_stats_;
+ // Current concurrent number of requests;
+ Atomic<uint32_t> concurrent_requests_{0};
+
+ OrphanablePtr<LoadBalancingPolicy> child_policy_;
+
+ // The latest state and picker returned from the child policy.
+ grpc_connectivity_state child_state_;
+ y_absl::Status child_status_;
+ RefCountedPtr<ChildPickerWrapper> child_picker_;
+};
+
+//
+// EdsLb::EdsPicker
+//
+
+EdsLb::EdsPicker::EdsPicker(RefCountedPtr<EdsLb> eds_policy)
+ : eds_policy_(std::move(eds_policy)),
+ drop_stats_(eds_policy_->drop_stats_),
+ child_picker_(eds_policy_->child_picker_),
+ xds_circuit_breaking_enabled_(XdsCircuitBreakingEnabled()),
+ max_concurrent_requests_(
+ eds_policy_->config_->max_concurrent_requests()) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_eds_trace)) {
+ gpr_log(GPR_INFO, "[edslb %p] constructed new drop picker %p",
+ eds_policy_.get(), this);
+ }
+}
+
+EdsLb::PickResult EdsLb::EdsPicker::Pick(PickArgs args) {
+ uint32_t current = eds_policy_->concurrent_requests_.FetchAdd(1);
+ if (xds_circuit_breaking_enabled_) {
+ // Check and see if we exceeded the max concurrent requests count.
+ if (current >= max_concurrent_requests_) {
+ eds_policy_->concurrent_requests_.FetchSub(1);
+ if (drop_stats_ != nullptr) {
+ drop_stats_->AddUncategorizedDrops();
+ }
+ PickResult result;
+ result.type = PickResult::PICK_COMPLETE;
+ return result;
+ }
+ }
+ // If we're not dropping the call, we should always have a child picker.
+ if (child_picker_ == nullptr) { // Should never happen.
+ PickResult result;
+ result.type = PickResult::PICK_FAILED;
+ result.error =
+ grpc_error_set_int(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "eds drop picker not given any child picker"),
+ GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_INTERNAL);
+ eds_policy_->concurrent_requests_.FetchSub(1);
+ return result;
+ }
+ // Not dropping, so delegate to child's picker.
+ PickResult result = child_picker_->Pick(args);
+ if (result.type == result.PICK_COMPLETE && result.subchannel != nullptr) {
+ XdsClusterLocalityStats* locality_stats = nullptr;
+ if (drop_stats_ != nullptr) { // If load reporting is enabled.
+ auto* subchannel_wrapper =
+ static_cast<StatsSubchannelWrapper*>(result.subchannel.get());
+ // Handle load reporting.
+ locality_stats = subchannel_wrapper->locality_stats()->Ref().release();
+ // Record a call started.
+ locality_stats->AddCallStarted();
+ // Unwrap subchannel to pass back up the stack.
+ result.subchannel = subchannel_wrapper->wrapped_subchannel();
+ }
+ // Intercept the recv_trailing_metadata op to record call completion.
+ EdsLb* eds_policy = static_cast<EdsLb*>(
+ eds_policy_->Ref(DEBUG_LOCATION, "DropPickPicker+call").release());
+ auto original_recv_trailing_metadata_ready =
+ result.recv_trailing_metadata_ready;
+ result.recv_trailing_metadata_ready =
+ // Note: This callback does not run in either the control plane
+ // work serializer or in the data plane mutex.
+ [locality_stats, original_recv_trailing_metadata_ready, eds_policy](
+ grpc_error* error, MetadataInterface* metadata,
+ CallState* call_state) {
+ // Record call completion for load reporting.
+ if (locality_stats != nullptr) {
+ const bool call_failed = error != GRPC_ERROR_NONE;
+ locality_stats->AddCallFinished(call_failed);
+ locality_stats->Unref(DEBUG_LOCATION, "LocalityStats+call");
+ }
+ // Decrement number of calls in flight.
+ eds_policy->concurrent_requests_.FetchSub(1);
+ eds_policy->Unref(DEBUG_LOCATION, "DropPickPicker+call");
+ // Invoke the original recv_trailing_metadata_ready callback, if any.
+ if (original_recv_trailing_metadata_ready != nullptr) {
+ original_recv_trailing_metadata_ready(error, metadata, call_state);
+ }
+ };
+ } else {
+ // TODO(roth): We should ideally also record call failures here in the case
+ // where a pick fails. This is challenging, because we don't know which
+ // picks are for wait_for_ready RPCs or how many times we'll return a
+ // failure for the same wait_for_ready RPC.
+ eds_policy_->concurrent_requests_.FetchSub(1);
+ }
+ return result;
+}
+
+//
+// EdsLb::Helper
+//
+
+RefCountedPtr<SubchannelInterface> EdsLb::Helper::CreateSubchannel(
+ ServerAddress address, const grpc_channel_args& args) {
+ if (eds_policy_->shutting_down_) return nullptr;
+ // If load reporting is enabled, wrap the subchannel such that it
+ // includes the locality stats object, which will be used by the EdsPicker.
+ if (eds_policy_->config_->lrs_load_reporting_server_name().has_value()) {
+ RefCountedPtr<XdsLocalityName> locality_name;
+ auto* attribute = address.GetAttribute(kXdsLocalityNameAttributeKey);
+ if (attribute != nullptr) {
+ const auto* locality_attr =
+ static_cast<const XdsLocalityAttribute*>(attribute);
+ locality_name = locality_attr->locality_name();
+ }
+ RefCountedPtr<XdsClusterLocalityStats> locality_stats =
+ eds_policy_->xds_client_->AddClusterLocalityStats(
+ *eds_policy_->config_->lrs_load_reporting_server_name(),
+ eds_policy_->config_->cluster_name(),
+ eds_policy_->config_->eds_service_name(), std::move(locality_name));
+ return MakeRefCounted<StatsSubchannelWrapper>(
+ eds_policy_->channel_control_helper()->CreateSubchannel(
+ std::move(address), args),
+ std::move(locality_stats));
+ }
+ // Load reporting not enabled, so don't wrap the subchannel.
+ return eds_policy_->channel_control_helper()->CreateSubchannel(
+ std::move(address), args);
+}
+
+void EdsLb::Helper::UpdateState(grpc_connectivity_state state,
+ const y_absl::Status& status,
+ std::unique_ptr<SubchannelPicker> picker) {
+ if (eds_policy_->shutting_down_ || eds_policy_->child_policy_ == nullptr) {
+ return;
+ }
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_eds_trace)) {
+ gpr_log(GPR_INFO,
+ "[edslb %p] child policy updated state=%s (%s) "
+ "picker=%p",
+ eds_policy_.get(), ConnectivityStateName(state),
+ status.ToString().c_str(), picker.get());
+ }
+ // Save the state and picker.
+ eds_policy_->child_state_ = state;
+ eds_policy_->child_status_ = status;
+ eds_policy_->child_picker_ =
+ MakeRefCounted<ChildPickerWrapper>(std::move(picker));
+ // Wrap the picker in a EdsPicker and pass it up.
+ eds_policy_->MaybeUpdateEdsPickerLocked();
+}
+
+void EdsLb::Helper::AddTraceEvent(TraceSeverity severity,
+ y_absl::string_view message) {
+ if (eds_policy_->shutting_down_) return;
+ eds_policy_->channel_control_helper()->AddTraceEvent(severity, message);
+}
+
+//
+// EdsLb::EndpointWatcher::Notifier
+//
+
+EdsLb::EndpointWatcher::Notifier::Notifier(RefCountedPtr<EdsLb> parent,
+ XdsApi::EdsUpdate update)
+ : parent_(std::move(parent)), update_(std::move(update)), type_(kUpdate) {
+ GRPC_CLOSURE_INIT(&closure_, &RunInExecCtx, this, nullptr);
+ ExecCtx::Run(DEBUG_LOCATION, &closure_, GRPC_ERROR_NONE);
+}
+
+EdsLb::EndpointWatcher::Notifier::Notifier(RefCountedPtr<EdsLb> parent,
+ grpc_error* error)
+ : parent_(std::move(parent)), type_(kError) {
+ GRPC_CLOSURE_INIT(&closure_, &RunInExecCtx, this, nullptr);
+ ExecCtx::Run(DEBUG_LOCATION, &closure_, error);
+}
+
+EdsLb::EndpointWatcher::Notifier::Notifier(RefCountedPtr<EdsLb> parent)
+ : parent_(std::move(parent)), type_(kDoesNotExist) {
+ GRPC_CLOSURE_INIT(&closure_, &RunInExecCtx, this, nullptr);
+ ExecCtx::Run(DEBUG_LOCATION, &closure_, GRPC_ERROR_NONE);
+}
+
+void EdsLb::EndpointWatcher::Notifier::RunInExecCtx(void* arg,
+ grpc_error* error) {
+ Notifier* self = static_cast<Notifier*>(arg);
+ GRPC_ERROR_REF(error);
+ self->parent_->work_serializer()->Run(
+ [self, error]() { self->RunInWorkSerializer(error); }, DEBUG_LOCATION);
+}
+
+void EdsLb::EndpointWatcher::Notifier::RunInWorkSerializer(grpc_error* error) {
+ switch (type_) {
+ case kUpdate:
+ parent_->OnEndpointChanged(std::move(update_));
+ break;
+ case kError:
+ parent_->OnError(error);
+ break;
+ case kDoesNotExist:
+ parent_->OnResourceDoesNotExist();
+ break;
+ };
+ delete this;
+}
+
+//
+// EdsLb public methods
+//
+
+EdsLb::EdsLb(RefCountedPtr<XdsClient> xds_client, Args args)
+ : LoadBalancingPolicy(std::move(args)), xds_client_(std::move(xds_client)) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_eds_trace)) {
+ gpr_log(GPR_INFO, "[edslb %p] created -- using xds client %p", this,
+ xds_client_.get());
+ }
+ // Record server name.
+ const char* server_uri =
+ grpc_channel_args_find_string(args.args, GRPC_ARG_SERVER_URI);
+ GPR_ASSERT(server_uri != nullptr);
+ grpc_uri* uri = grpc_uri_parse(server_uri, true);
+ GPR_ASSERT(uri->path[0] != '\0');
+ server_name_ = uri->path[0] == '/' ? uri->path + 1 : uri->path;
+ is_xds_uri_ = strcmp(uri->scheme, "xds") == 0;
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_eds_trace)) {
+ gpr_log(GPR_INFO, "[edslb %p] server name from channel (is_xds_uri=%d): %s",
+ this, is_xds_uri_, server_name_.c_str());
+ }
+ grpc_uri_destroy(uri);
+ // EDS-only flow.
+ if (!is_xds_uri_) {
+ // Setup channelz linkage.
+ channelz::ChannelNode* parent_channelz_node =
+ grpc_channel_args_find_pointer<channelz::ChannelNode>(
+ args.args, GRPC_ARG_CHANNELZ_CHANNEL_NODE);
+ if (parent_channelz_node != nullptr) {
+ xds_client_->AddChannelzLinkage(parent_channelz_node);
+ }
+ // Couple polling.
+ grpc_pollset_set_add_pollset_set(xds_client_->interested_parties(),
+ interested_parties());
+ }
+}
+
+EdsLb::~EdsLb() {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_eds_trace)) {
+ gpr_log(GPR_INFO, "[edslb %p] destroying eds LB policy", this);
+ }
+}
+
+void EdsLb::ShutdownLocked() {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_eds_trace)) {
+ gpr_log(GPR_INFO, "[edslb %p] shutting down", this);
+ }
+ shutting_down_ = true;
+ // Drop our ref to the child's picker, in case it's holding a ref to
+ // the child.
+ child_picker_.reset();
+ MaybeDestroyChildPolicyLocked();
+ drop_stats_.reset();
+ // Cancel watcher.
+ if (endpoint_watcher_ != nullptr) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_eds_trace)) {
+ gpr_log(GPR_INFO, "[edslb %p] cancelling xds watch for %s", this,
+ TString(GetEdsResourceName()).c_str());
+ }
+ xds_client_->CancelEndpointDataWatch(GetEdsResourceName(),
+ endpoint_watcher_);
+ }
+ if (!is_xds_uri_) {
+ // Remove channelz linkage.
+ channelz::ChannelNode* parent_channelz_node =
+ grpc_channel_args_find_pointer<channelz::ChannelNode>(
+ args_, GRPC_ARG_CHANNELZ_CHANNEL_NODE);
+ if (parent_channelz_node != nullptr) {
+ xds_client_->RemoveChannelzLinkage(parent_channelz_node);
+ }
+ // Decouple polling.
+ grpc_pollset_set_del_pollset_set(xds_client_->interested_parties(),
+ interested_parties());
+ }
+ xds_client_.reset(DEBUG_LOCATION, "EdsLb");
+ // Destroy channel args.
+ grpc_channel_args_destroy(args_);
+ args_ = nullptr;
+}
+
+void EdsLb::MaybeDestroyChildPolicyLocked() {
+ if (child_policy_ != nullptr) {
+ grpc_pollset_set_del_pollset_set(child_policy_->interested_parties(),
+ interested_parties());
+ child_policy_.reset();
+ }
+}
+
+void EdsLb::UpdateLocked(UpdateArgs args) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_eds_trace)) {
+ gpr_log(GPR_INFO, "[edslb %p] Received update", this);
+ }
+ const bool is_initial_update = args_ == nullptr;
+ // Update config.
+ auto old_config = std::move(config_);
+ config_ = std::move(args.config);
+ // Update args.
+ grpc_channel_args_destroy(args_);
+ args_ = args.args;
+ args.args = nullptr;
+ const bool lrs_server_changed =
+ is_initial_update || config_->lrs_load_reporting_server_name() !=
+ old_config->lrs_load_reporting_server_name();
+ const bool max_concurrent_requests_changed =
+ is_initial_update || config_->max_concurrent_requests() !=
+ old_config->max_concurrent_requests();
+ // Update drop stats for load reporting if needed.
+ if (lrs_server_changed) {
+ drop_stats_.reset();
+ if (config_->lrs_load_reporting_server_name().has_value()) {
+ const auto key = GetLrsClusterKey();
+ drop_stats_ = xds_client_->AddClusterDropStats(
+ config_->lrs_load_reporting_server_name().value(),
+ key.first /*cluster_name*/, key.second /*eds_service_name*/);
+ }
+ }
+ if (lrs_server_changed || max_concurrent_requests_changed) {
+ MaybeUpdateEdsPickerLocked();
+ }
+ // Update child policy if needed.
+ // Note that this comes after updating drop_stats_, since we want that
+ // to be used by any new picker we create here.
+ if (child_policy_ != nullptr) UpdateChildPolicyLocked();
+ // Create endpoint watcher if needed.
+ if (is_initial_update) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_eds_trace)) {
+ gpr_log(GPR_INFO, "[edslb %p] starting xds watch for %s", this,
+ TString(GetEdsResourceName()).c_str());
+ }
+ auto watcher = y_absl::make_unique<EndpointWatcher>(
+ Ref(DEBUG_LOCATION, "EndpointWatcher"));
+ endpoint_watcher_ = watcher.get();
+ xds_client_->WatchEndpointData(GetEdsResourceName(), std::move(watcher));
+ }
+}
+
+void EdsLb::ResetBackoffLocked() {
+ // When the XdsClient is instantiated in the resolver instead of in this
+ // LB policy, this is done via the resolver, so we don't need to do it here.
+ if (!is_xds_uri_ && xds_client_ != nullptr) xds_client_->ResetBackoff();
+ if (child_policy_ != nullptr) {
+ child_policy_->ResetBackoffLocked();
+ }
+}
+
+void EdsLb::OnEndpointChanged(XdsApi::EdsUpdate update) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_eds_trace)) {
+ gpr_log(GPR_INFO, "[edslb %p] Received EDS update from xds client", this);
+ }
+ // Update the drop config.
+ drop_config_ = std::move(update.drop_config);
+ // If priority list is empty, add a single priority, just so that we
+ // have a child in which to create the eds_drop policy.
+ if (update.priorities.empty()) update.priorities.emplace_back();
+ // Update child policy.
+ UpdatePriorityList(std::move(update.priorities));
+}
+
+void EdsLb::OnError(grpc_error* error) {
+ gpr_log(GPR_ERROR, "[edslb %p] xds watcher reported error: %s", this,
+ grpc_error_string(error));
+ // Go into TRANSIENT_FAILURE if we have not yet created the child
+ // policy (i.e., we have not yet received data from xds). Otherwise,
+ // we keep running with the data we had previously.
+ if (child_policy_ == nullptr) {
+ channel_control_helper()->UpdateState(
+ GRPC_CHANNEL_TRANSIENT_FAILURE, grpc_error_to_absl_status(error),
+ y_absl::make_unique<TransientFailurePicker>(error));
+ } else {
+ GRPC_ERROR_UNREF(error);
+ }
+}
+
+void EdsLb::OnResourceDoesNotExist() {
+ gpr_log(
+ GPR_ERROR,
+ "[edslb %p] EDS resource does not exist -- reporting TRANSIENT_FAILURE",
+ this);
+ grpc_error* error = grpc_error_set_int(
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("EDS resource does not exist"),
+ GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE);
+ channel_control_helper()->UpdateState(
+ GRPC_CHANNEL_TRANSIENT_FAILURE, grpc_error_to_absl_status(error),
+ y_absl::make_unique<TransientFailurePicker>(error));
+ MaybeDestroyChildPolicyLocked();
+}
+
+//
+// child policy-related methods
+//
+
+void EdsLb::UpdatePriorityList(XdsApi::EdsUpdate::PriorityList priority_list) {
+ // Build some maps from locality to child number and the reverse from
+ // the old data in priority_list_ and priority_child_numbers_.
+ std::map<XdsLocalityName*, size_t /*child_number*/, XdsLocalityName::Less>
+ locality_child_map;
+ std::map<size_t, std::set<XdsLocalityName*>> child_locality_map;
+ for (size_t priority = 0; priority < priority_list_.size(); ++priority) {
+ size_t child_number = priority_child_numbers_[priority];
+ const auto& localities = priority_list_[priority].localities;
+ for (const auto& p : localities) {
+ XdsLocalityName* locality_name = p.first;
+ locality_child_map[locality_name] = child_number;
+ child_locality_map[child_number].insert(locality_name);
+ }
+ }
+ // Construct new list of children.
+ std::vector<size_t> priority_child_numbers;
+ for (size_t priority = 0; priority < priority_list.size(); ++priority) {
+ const auto& localities = priority_list[priority].localities;
+ y_absl::optional<size_t> child_number;
+ // If one of the localities in this priority already existed, reuse its
+ // child number.
+ for (const auto& p : localities) {
+ XdsLocalityName* locality_name = p.first;
+ if (!child_number.has_value()) {
+ auto it = locality_child_map.find(locality_name);
+ if (it != locality_child_map.end()) {
+ child_number = it->second;
+ locality_child_map.erase(it);
+ // Remove localities that *used* to be in this child number, so
+ // that we don't incorrectly reuse this child number for a
+ // subsequent priority.
+ for (XdsLocalityName* old_locality :
+ child_locality_map[*child_number]) {
+ locality_child_map.erase(old_locality);
+ }
+ }
+ } else {
+ // Remove all localities that are now in this child number, so
+ // that we don't accidentally reuse this child number for a
+ // subsequent priority.
+ locality_child_map.erase(locality_name);
+ }
+ }
+ // If we didn't find an existing child number, assign a new one.
+ if (!child_number.has_value()) {
+ for (child_number = 0;
+ child_locality_map.find(*child_number) != child_locality_map.end();
+ ++(*child_number))
+ ;
+ // Add entry so we know that the child number is in use.
+ // (Don't need to add the list of localities, since we won't use them.)
+ child_locality_map[*child_number];
+ }
+ priority_child_numbers.push_back(*child_number);
+ }
+ // Save update.
+ priority_list_ = std::move(priority_list);
+ priority_child_numbers_ = std::move(priority_child_numbers);
+ // Update child policy.
+ UpdateChildPolicyLocked();
+}
+
+ServerAddressList EdsLb::CreateChildPolicyAddressesLocked() {
+ ServerAddressList addresses;
+ for (size_t priority = 0; priority < priority_list_.size(); ++priority) {
+ const auto& localities = priority_list_[priority].localities;
+ TString priority_child_name =
+ y_absl::StrCat("child", priority_child_numbers_[priority]);
+ for (const auto& p : localities) {
+ const auto& locality_name = p.first;
+ const auto& locality = p.second;
+ std::vector<TString> hierarchical_path = {
+ priority_child_name, locality_name->AsHumanReadableString()};
+ for (const auto& endpoint : locality.endpoints) {
+ addresses.emplace_back(
+ endpoint
+ .WithAttribute(kHierarchicalPathAttributeKey,
+ MakeHierarchicalPathAttribute(hierarchical_path))
+ .WithAttribute(kXdsLocalityNameAttributeKey,
+ y_absl::make_unique<XdsLocalityAttribute>(
+ locality_name->Ref())));
+ }
+ }
+ }
+ return addresses;
+}
+
+RefCountedPtr<LoadBalancingPolicy::Config>
+EdsLb::CreateChildPolicyConfigLocked() {
+ const auto lrs_key = GetLrsClusterKey();
+ Json::Object priority_children;
+ Json::Array priority_priorities;
+ for (size_t priority = 0; priority < priority_list_.size(); ++priority) {
+ const auto& localities = priority_list_[priority].localities;
+ Json::Object weighted_targets;
+ for (const auto& p : localities) {
+ XdsLocalityName* locality_name = p.first;
+ const auto& locality = p.second;
+ // Construct JSON object containing locality name.
+ Json::Object locality_name_json;
+ if (!locality_name->region().empty()) {
+ locality_name_json["region"] = locality_name->region();
+ }
+ if (!locality_name->zone().empty()) {
+ locality_name_json["zone"] = locality_name->zone();
+ }
+ if (!locality_name->sub_zone().empty()) {
+ locality_name_json["subzone"] = locality_name->sub_zone();
+ }
+ // Add weighted target entry.
+ weighted_targets[locality_name->AsHumanReadableString()] = Json::Object{
+ {"weight", locality.lb_weight},
+ {"childPolicy", config_->endpoint_picking_policy()},
+ };
+ }
+ // Construct locality-picking policy.
+ // Start with field from our config and add the "targets" field.
+ Json locality_picking_config = config_->locality_picking_policy();
+ Json::Object& config =
+ *(*locality_picking_config.mutable_array())[0].mutable_object();
+ auto it = config.begin();
+ GPR_ASSERT(it != config.end());
+ (*it->second.mutable_object())["targets"] = std::move(weighted_targets);
+ // Wrap it in the drop policy.
+ Json::Array drop_categories;
+ for (const auto& category : drop_config_->drop_category_list()) {
+ drop_categories.push_back(Json::Object{
+ {"category", category.name},
+ {"requests_per_million", category.parts_per_million},
+ });
+ }
+ Json::Object eds_drop_config = {
+ {"clusterName", TString(lrs_key.first)},
+ {"childPolicy", std::move(locality_picking_config)},
+ {"dropCategories", std::move(drop_categories)},
+ };
+ if (!lrs_key.second.empty()) {
+ eds_drop_config["edsServiceName"] = TString(lrs_key.second);
+ }
+ if (config_->lrs_load_reporting_server_name().has_value()) {
+ eds_drop_config["lrsLoadReportingServerName"] =
+ config_->lrs_load_reporting_server_name().value();
+ }
+ Json locality_picking_policy = Json::Array{Json::Object{
+ {"eds_drop_experimental", std::move(eds_drop_config)},
+ }};
+ // Add priority entry.
+ const size_t child_number = priority_child_numbers_[priority];
+ TString child_name = y_absl::StrCat("child", child_number);
+ priority_priorities.emplace_back(child_name);
+ priority_children[child_name] = Json::Object{
+ {"config", std::move(locality_picking_policy)},
+ };
+ }
+ Json json = Json::Array{Json::Object{
+ {"priority_experimental",
+ Json::Object{
+ {"children", std::move(priority_children)},
+ {"priorities", std::move(priority_priorities)},
+ }},
+ }};
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_eds_trace)) {
+ TString json_str = json.Dump(/*indent=*/1);
+ gpr_log(GPR_INFO, "[edslb %p] generated config for child policy: %s", this,
+ json_str.c_str());
+ }
+ grpc_error* error = GRPC_ERROR_NONE;
+ RefCountedPtr<LoadBalancingPolicy::Config> config =
+ LoadBalancingPolicyRegistry::ParseLoadBalancingConfig(json, &error);
+ if (error != GRPC_ERROR_NONE) {
+ // This should never happen, but if it does, we basically have no
+ // way to fix it, so we put the channel in TRANSIENT_FAILURE.
+ gpr_log(GPR_ERROR,
+ "[edslb %p] error parsing generated child policy config -- "
+ "will put channel in TRANSIENT_FAILURE: %s",
+ this, grpc_error_string(error));
+ error = grpc_error_set_int(
+ grpc_error_add_child(
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "eds LB policy: error parsing generated child policy config"),
+ error),
+ GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_INTERNAL);
+ channel_control_helper()->UpdateState(
+ GRPC_CHANNEL_TRANSIENT_FAILURE, grpc_error_to_absl_status(error),
+ y_absl::make_unique<TransientFailurePicker>(error));
+ return nullptr;
+ }
+ return config;
+}
+
+void EdsLb::UpdateChildPolicyLocked() {
+ if (shutting_down_) return;
+ UpdateArgs update_args;
+ update_args.config = CreateChildPolicyConfigLocked();
+ if (update_args.config == nullptr) return;
+ update_args.addresses = CreateChildPolicyAddressesLocked();
+ update_args.args = CreateChildPolicyArgsLocked(args_);
+ if (child_policy_ == nullptr) {
+ child_policy_ = CreateChildPolicyLocked(update_args.args);
+ }
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_eds_trace)) {
+ gpr_log(GPR_INFO, "[edslb %p] Updating child policy %p", this,
+ child_policy_.get());
+ }
+ child_policy_->UpdateLocked(std::move(update_args));
+}
+
+grpc_channel_args* EdsLb::CreateChildPolicyArgsLocked(
+ const grpc_channel_args* args) {
+ grpc_arg args_to_add[] = {
+ // A channel arg indicating if the target is a backend inferred from an
+ // xds load balancer.
+ // TODO(roth): This isn't needed with the new fallback design.
+ // Remove as part of implementing the new fallback functionality.
+ grpc_channel_arg_integer_create(
+ const_cast<char*>(GRPC_ARG_ADDRESS_IS_BACKEND_FROM_XDS_LOAD_BALANCER),
+ 1),
+ // Inhibit client-side health checking, since the balancer does
+ // this for us.
+ grpc_channel_arg_integer_create(
+ const_cast<char*>(GRPC_ARG_INHIBIT_HEALTH_CHECKING), 1),
+ };
+ return grpc_channel_args_copy_and_add(args, args_to_add,
+ GPR_ARRAY_SIZE(args_to_add));
+}
+
+OrphanablePtr<LoadBalancingPolicy> EdsLb::CreateChildPolicyLocked(
+ const grpc_channel_args* args) {
+ LoadBalancingPolicy::Args lb_policy_args;
+ lb_policy_args.work_serializer = work_serializer();
+ lb_policy_args.args = args;
+ lb_policy_args.channel_control_helper =
+ y_absl::make_unique<Helper>(Ref(DEBUG_LOCATION, "Helper"));
+ OrphanablePtr<LoadBalancingPolicy> lb_policy =
+ LoadBalancingPolicyRegistry::CreateLoadBalancingPolicy(
+ "priority_experimental", std::move(lb_policy_args));
+ if (GPR_UNLIKELY(lb_policy == nullptr)) {
+ gpr_log(GPR_ERROR, "[edslb %p] failure creating child policy", this);
+ return nullptr;
+ }
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_eds_trace)) {
+ gpr_log(GPR_INFO, "[edslb %p]: Created new child policy %p", this,
+ lb_policy.get());
+ }
+ // Add our interested_parties pollset_set to that of the newly created
+ // child policy. This will make the child policy progress upon activity on
+ // this policy, which in turn is tied to the application's call.
+ grpc_pollset_set_add_pollset_set(lb_policy->interested_parties(),
+ interested_parties());
+ return lb_policy;
+}
+
+void EdsLb::MaybeUpdateEdsPickerLocked() {
+ // Update only if we have a child picker.
+ if (child_picker_ != nullptr) {
+ channel_control_helper()->UpdateState(
+ child_state_, child_status_,
+ y_absl::make_unique<EdsPicker>(Ref(DEBUG_LOCATION, "EdsPicker")));
+ }
+}
+
+//
+// factory
+//
+
+class EdsLbFactory : public LoadBalancingPolicyFactory {
+ public:
+ OrphanablePtr<LoadBalancingPolicy> CreateLoadBalancingPolicy(
+ LoadBalancingPolicy::Args args) const override {
+ grpc_error* error = GRPC_ERROR_NONE;
+ RefCountedPtr<XdsClient> xds_client = XdsClient::GetOrCreate(&error);
+ if (error != GRPC_ERROR_NONE) {
+ gpr_log(GPR_ERROR,
+ "cannot get XdsClient to instantiate eds LB policy: %s",
+ grpc_error_string(error));
+ GRPC_ERROR_UNREF(error);
+ return nullptr;
+ }
+ return MakeOrphanable<EdsChildHandler>(std::move(xds_client),
+ std::move(args));
+ }
+
+ const char* name() const override { return kEds; }
+
+ RefCountedPtr<LoadBalancingPolicy::Config> ParseLoadBalancingConfig(
+ const Json& json, grpc_error** error) const override {
+ GPR_DEBUG_ASSERT(error != nullptr && *error == GRPC_ERROR_NONE);
+ if (json.type() == Json::Type::JSON_NULL) {
+ // eds was mentioned as a policy in the deprecated loadBalancingPolicy
+ // field or in the client API.
+ *error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:loadBalancingPolicy error:eds policy requires configuration. "
+ "Please use loadBalancingConfig field of service config instead.");
+ return nullptr;
+ }
+ std::vector<grpc_error*> error_list;
+ // EDS service name.
+ TString eds_service_name;
+ auto it = json.object_value().find("edsServiceName");
+ if (it != json.object_value().end()) {
+ if (it->second.type() != Json::Type::STRING) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:edsServiceName error:type should be string"));
+ } else {
+ eds_service_name = it->second.string_value();
+ }
+ }
+ // Cluster name.
+ TString cluster_name;
+ it = json.object_value().find("clusterName");
+ if (it == json.object_value().end()) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:clusterName error:required field missing"));
+ } else if (it->second.type() != Json::Type::STRING) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:clusterName error:type should be string"));
+ } else {
+ cluster_name = it->second.string_value();
+ }
+ // LRS load reporting server name.
+ y_absl::optional<TString> lrs_load_reporting_server_name;
+ it = json.object_value().find("lrsLoadReportingServerName");
+ if (it != json.object_value().end()) {
+ if (it->second.type() != Json::Type::STRING) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:lrsLoadReportingServerName error:type should be string"));
+ } else {
+ lrs_load_reporting_server_name.emplace(it->second.string_value());
+ }
+ }
+ // Locality-picking policy.
+ Json locality_picking_policy;
+ it = json.object_value().find("localityPickingPolicy");
+ if (it == json.object_value().end()) {
+ locality_picking_policy = Json::Array{
+ Json::Object{
+ {"weighted_target_experimental",
+ Json::Object{
+ {"targets", Json::Object()},
+ }},
+ },
+ };
+ } else {
+ locality_picking_policy = it->second;
+ }
+ grpc_error* parse_error = GRPC_ERROR_NONE;
+ if (LoadBalancingPolicyRegistry::ParseLoadBalancingConfig(
+ locality_picking_policy, &parse_error) == nullptr) {
+ GPR_DEBUG_ASSERT(parse_error != GRPC_ERROR_NONE);
+ error_list.push_back(GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
+ "localityPickingPolicy", &parse_error, 1));
+ GRPC_ERROR_UNREF(parse_error);
+ }
+ // Endpoint-picking policy. Called "childPolicy" for xds policy.
+ Json endpoint_picking_policy;
+ it = json.object_value().find("endpointPickingPolicy");
+ if (it == json.object_value().end()) {
+ endpoint_picking_policy = Json::Array{
+ Json::Object{
+ {"round_robin", Json::Object()},
+ },
+ };
+ } else {
+ endpoint_picking_policy = it->second;
+ }
+ parse_error = GRPC_ERROR_NONE;
+ if (LoadBalancingPolicyRegistry::ParseLoadBalancingConfig(
+ endpoint_picking_policy, &parse_error) == nullptr) {
+ GPR_DEBUG_ASSERT(parse_error != GRPC_ERROR_NONE);
+ error_list.push_back(GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
+ "endpointPickingPolicy", &parse_error, 1));
+ GRPC_ERROR_UNREF(parse_error);
+ }
+ // Max concurrent requests.
+ uint32_t max_concurrent_requests = 1024;
+ it = json.object_value().find("max_concurrent_requests");
+ if (it != json.object_value().end()) {
+ if (it->second.type() != Json::Type::NUMBER) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:max_concurrent_requests error:must be of type number"));
+ } else {
+ max_concurrent_requests =
+ gpr_parse_nonnegative_int(it->second.string_value().c_str());
+ }
+ }
+ // Construct config.
+ if (error_list.empty()) {
+ return MakeRefCounted<EdsLbConfig>(
+ std::move(cluster_name), std::move(eds_service_name),
+ std::move(lrs_load_reporting_server_name),
+ std::move(locality_picking_policy),
+ std::move(endpoint_picking_policy), max_concurrent_requests);
+ } else {
+ *error = GRPC_ERROR_CREATE_FROM_VECTOR(
+ "eds_experimental LB policy config", &error_list);
+ return nullptr;
+ }
+ }
+
+ private:
+ class EdsChildHandler : public ChildPolicyHandler {
+ public:
+ EdsChildHandler(RefCountedPtr<XdsClient> xds_client, Args args)
+ : ChildPolicyHandler(std::move(args), &grpc_lb_eds_trace),
+ xds_client_(std::move(xds_client)) {}
+
+ bool ConfigChangeRequiresNewPolicyInstance(
+ LoadBalancingPolicy::Config* old_config,
+ LoadBalancingPolicy::Config* new_config) const override {
+ GPR_ASSERT(old_config->name() == kEds);
+ GPR_ASSERT(new_config->name() == kEds);
+ EdsLbConfig* old_eds_config = static_cast<EdsLbConfig*>(old_config);
+ EdsLbConfig* new_eds_config = static_cast<EdsLbConfig*>(new_config);
+ return old_eds_config->cluster_name() != new_eds_config->cluster_name() ||
+ old_eds_config->eds_service_name() !=
+ new_eds_config->eds_service_name() ||
+ old_eds_config->lrs_load_reporting_server_name() !=
+ new_eds_config->lrs_load_reporting_server_name();
+ }
+
+ OrphanablePtr<LoadBalancingPolicy> CreateLoadBalancingPolicy(
+ const char* name, LoadBalancingPolicy::Args args) const override {
+ return MakeOrphanable<EdsLb>(xds_client_, std::move(args));
+ }
+
+ private:
+ RefCountedPtr<XdsClient> xds_client_;
+ };
+};
+
+} // namespace
+
+} // namespace grpc_core
+
+//
+// Plugin registration
+//
+
+void grpc_lb_policy_eds_init() {
+ grpc_core::LoadBalancingPolicyRegistry::Builder::
+ RegisterLoadBalancingPolicyFactory(
+ y_absl::make_unique<grpc_core::EdsLbFactory>());
+}
+
+void grpc_lb_policy_eds_shutdown() {}
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/xds/eds_drop.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/xds/eds_drop.cc
index 86d21cf6d47..0b17015dd82 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/xds/eds_drop.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/xds/eds_drop.cc
@@ -1,571 +1,571 @@
-//
-// Copyright 2018 gRPC authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-#include <grpc/support/port_platform.h>
-
-#include "y_absl/strings/string_view.h"
-
-#include <grpc/grpc.h>
-
-#include "src/core/ext/filters/client_channel/lb_policy.h"
-#include "src/core/ext/filters/client_channel/lb_policy/child_policy_handler.h"
-#include "src/core/ext/filters/client_channel/lb_policy_factory.h"
-#include "src/core/ext/filters/client_channel/lb_policy_registry.h"
-#include "src/core/ext/xds/xds_client.h"
-#include "src/core/ext/xds/xds_client_stats.h"
-#include "src/core/lib/channel/channel_args.h"
-#include "src/core/lib/gpr/string.h"
-#include "src/core/lib/gprpp/orphanable.h"
-#include "src/core/lib/gprpp/ref_counted_ptr.h"
-#include "src/core/lib/iomgr/work_serializer.h"
-
-namespace grpc_core {
-
-TraceFlag grpc_eds_drop_lb_trace(false, "eds_drop_lb");
-
-namespace {
-
-constexpr char kEdsDrop[] = "eds_drop_experimental";
-
-// Config for EDS drop LB policy.
-class EdsDropLbConfig : public LoadBalancingPolicy::Config {
- public:
- EdsDropLbConfig(RefCountedPtr<LoadBalancingPolicy::Config> child_policy,
- TString cluster_name, TString eds_service_name,
- y_absl::optional<TString> lrs_load_reporting_server_name,
- RefCountedPtr<XdsApi::EdsUpdate::DropConfig> drop_config)
- : child_policy_(std::move(child_policy)),
- cluster_name_(std::move(cluster_name)),
- eds_service_name_(std::move(eds_service_name)),
- lrs_load_reporting_server_name_(
- std::move(lrs_load_reporting_server_name)),
- drop_config_(std::move(drop_config)) {}
-
- const char* name() const override { return kEdsDrop; }
-
- RefCountedPtr<LoadBalancingPolicy::Config> child_policy() const {
- return child_policy_;
- }
- const TString& cluster_name() const { return cluster_name_; }
- const TString& eds_service_name() const { return eds_service_name_; }
- const y_absl::optional<TString>& lrs_load_reporting_server_name() const {
- return lrs_load_reporting_server_name_;
- };
- RefCountedPtr<XdsApi::EdsUpdate::DropConfig> drop_config() const {
- return drop_config_;
- }
-
- private:
- RefCountedPtr<LoadBalancingPolicy::Config> child_policy_;
- TString cluster_name_;
- TString eds_service_name_;
- y_absl::optional<TString> lrs_load_reporting_server_name_;
- RefCountedPtr<XdsApi::EdsUpdate::DropConfig> drop_config_;
-};
-
-// EDS Drop LB policy.
-class EdsDropLb : public LoadBalancingPolicy {
- public:
- EdsDropLb(RefCountedPtr<XdsClient> xds_client, Args args);
-
- const char* name() const override { return kEdsDrop; }
-
- void UpdateLocked(UpdateArgs args) override;
- void ExitIdleLocked() override;
- void ResetBackoffLocked() override;
-
- private:
- // A simple wrapper for ref-counting a picker from the child policy.
- class RefCountedPicker : public RefCounted<RefCountedPicker> {
- public:
- explicit RefCountedPicker(std::unique_ptr<SubchannelPicker> picker)
- : picker_(std::move(picker)) {}
- PickResult Pick(PickArgs args) { return picker_->Pick(args); }
-
- private:
- std::unique_ptr<SubchannelPicker> picker_;
- };
-
- // A picker that wraps the picker from the child to perform drops.
- class DropPicker : public SubchannelPicker {
- public:
- DropPicker(EdsDropLb* eds_drop_lb, RefCountedPtr<RefCountedPicker> picker)
- : drop_config_(eds_drop_lb->config_->drop_config()),
- drop_stats_(eds_drop_lb->drop_stats_),
- picker_(std::move(picker)) {}
-
- PickResult Pick(PickArgs args);
-
- private:
- RefCountedPtr<XdsApi::EdsUpdate::DropConfig> drop_config_;
- RefCountedPtr<XdsClusterDropStats> drop_stats_;
- RefCountedPtr<RefCountedPicker> picker_;
- };
-
- class Helper : public ChannelControlHelper {
- public:
- explicit Helper(RefCountedPtr<EdsDropLb> eds_drop_policy)
- : eds_drop_policy_(std::move(eds_drop_policy)) {}
-
- ~Helper() { eds_drop_policy_.reset(DEBUG_LOCATION, "Helper"); }
-
- RefCountedPtr<SubchannelInterface> CreateSubchannel(
- ServerAddress address, const grpc_channel_args& args) override;
- void UpdateState(grpc_connectivity_state state, const y_absl::Status& status,
- std::unique_ptr<SubchannelPicker> picker) override;
- void RequestReresolution() override;
- void AddTraceEvent(TraceSeverity severity,
- y_absl::string_view message) override;
-
- private:
- RefCountedPtr<EdsDropLb> eds_drop_policy_;
- };
-
- ~EdsDropLb();
-
- void ShutdownLocked() override;
-
- OrphanablePtr<LoadBalancingPolicy> CreateChildPolicyLocked(
- const grpc_channel_args* args);
- void UpdateChildPolicyLocked(ServerAddressList addresses,
- const grpc_channel_args* args);
-
- void MaybeUpdatePickerLocked();
-
- // Current config from the resolver.
- RefCountedPtr<EdsDropLbConfig> config_;
-
- // Internal state.
- bool shutting_down_ = false;
-
- // The xds client.
- RefCountedPtr<XdsClient> xds_client_;
-
- // The stats for client-side load reporting.
- RefCountedPtr<XdsClusterDropStats> drop_stats_;
-
- OrphanablePtr<LoadBalancingPolicy> child_policy_;
-
- // Latest state and picker reported by the child policy.
- grpc_connectivity_state state_ = GRPC_CHANNEL_IDLE;
- y_absl::Status status_;
- RefCountedPtr<RefCountedPicker> picker_;
-};
-
-//
-// EdsDropLb::DropPicker
-//
-
-LoadBalancingPolicy::PickResult EdsDropLb::DropPicker::Pick(
- LoadBalancingPolicy::PickArgs args) {
- // Handle drop.
- const TString* drop_category;
- if (drop_config_->ShouldDrop(&drop_category)) {
- if (drop_stats_ != nullptr) drop_stats_->AddCallDropped(*drop_category);
- PickResult result;
- result.type = PickResult::PICK_COMPLETE;
- return result;
- }
- // If we're not dropping the call, we should always have a child picker.
- if (picker_ == nullptr) { // Should never happen.
- PickResult result;
- result.type = PickResult::PICK_FAILED;
- result.error =
- grpc_error_set_int(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "eds_drop picker not given any child picker"),
- GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_INTERNAL);
- return result;
- }
- // Not dropping, so delegate to child picker.
- return picker_->Pick(args);
-}
-
-//
-// EdsDropLb
-//
-
-EdsDropLb::EdsDropLb(RefCountedPtr<XdsClient> xds_client, Args args)
- : LoadBalancingPolicy(std::move(args)), xds_client_(std::move(xds_client)) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_eds_drop_lb_trace)) {
- gpr_log(GPR_INFO, "[eds_drop_lb %p] created -- using xds client %p", this,
- xds_client_.get());
- }
-}
-
-EdsDropLb::~EdsDropLb() {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_eds_drop_lb_trace)) {
- gpr_log(GPR_INFO, "[eds_drop_lb %p] destroying xds LB policy", this);
- }
-}
-
-void EdsDropLb::ShutdownLocked() {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_eds_drop_lb_trace)) {
- gpr_log(GPR_INFO, "[eds_drop_lb %p] shutting down", this);
- }
- shutting_down_ = true;
- // Remove the child policy's interested_parties pollset_set from the
- // xDS policy.
- if (child_policy_ != nullptr) {
- grpc_pollset_set_del_pollset_set(child_policy_->interested_parties(),
- interested_parties());
- child_policy_.reset();
- }
- // Drop our ref to the child's picker, in case it's holding a ref to
- // the child.
- picker_.reset();
- drop_stats_.reset();
- xds_client_.reset();
-}
-
-void EdsDropLb::ExitIdleLocked() {
- if (child_policy_ != nullptr) child_policy_->ExitIdleLocked();
-}
-
-void EdsDropLb::ResetBackoffLocked() {
- // The XdsClient will have its backoff reset by the xds resolver, so we
- // don't need to do it here.
- if (child_policy_ != nullptr) child_policy_->ResetBackoffLocked();
-}
-
-void EdsDropLb::UpdateLocked(UpdateArgs args) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_eds_drop_lb_trace)) {
- gpr_log(GPR_INFO, "[eds_drop_lb %p] Received update", this);
- }
- // Update config.
- auto old_config = std::move(config_);
- config_ = std::move(args.config);
- // Update load reporting if needed.
- if (old_config == nullptr ||
- config_->lrs_load_reporting_server_name() !=
- old_config->lrs_load_reporting_server_name() ||
- config_->cluster_name() != old_config->cluster_name() ||
- config_->eds_service_name() != old_config->eds_service_name()) {
- drop_stats_.reset();
- if (config_->lrs_load_reporting_server_name().has_value()) {
- drop_stats_ = xds_client_->AddClusterDropStats(
- config_->lrs_load_reporting_server_name().value(),
- config_->cluster_name(), config_->eds_service_name());
- }
- MaybeUpdatePickerLocked();
- }
- // Update child policy.
- UpdateChildPolicyLocked(std::move(args.addresses), args.args);
- args.args = nullptr;
-}
-
-void EdsDropLb::MaybeUpdatePickerLocked() {
- // If we're dropping all calls, report READY, regardless of what (or
- // whether) the child has reported.
- if (config_->drop_config() != nullptr && config_->drop_config()->drop_all()) {
- auto drop_picker = y_absl::make_unique<DropPicker>(this, picker_);
- if (GRPC_TRACE_FLAG_ENABLED(grpc_eds_drop_lb_trace)) {
- gpr_log(GPR_INFO,
- "[eds_drop_lb %p] updating connectivity (drop all): state=READY "
- "picker=%p",
- this, drop_picker.get());
- }
- channel_control_helper()->UpdateState(GRPC_CHANNEL_READY, y_absl::Status(),
- std::move(drop_picker));
- return;
- }
- // Otherwise, update only if we have a child picker.
- if (picker_ != nullptr) {
- auto drop_picker = y_absl::make_unique<DropPicker>(this, picker_);
- if (GRPC_TRACE_FLAG_ENABLED(grpc_eds_drop_lb_trace)) {
- gpr_log(GPR_INFO,
- "[eds_drop_lb %p] updating connectivity: state=%s status=(%s) "
- "picker=%p",
- this, ConnectivityStateName(state_), status_.ToString().c_str(),
- drop_picker.get());
- }
- channel_control_helper()->UpdateState(state_, status_,
- std::move(drop_picker));
- }
-}
-
-OrphanablePtr<LoadBalancingPolicy> EdsDropLb::CreateChildPolicyLocked(
- const grpc_channel_args* args) {
- LoadBalancingPolicy::Args lb_policy_args;
- lb_policy_args.work_serializer = work_serializer();
- lb_policy_args.args = args;
- lb_policy_args.channel_control_helper =
- y_absl::make_unique<Helper>(Ref(DEBUG_LOCATION, "Helper"));
- OrphanablePtr<LoadBalancingPolicy> lb_policy =
- MakeOrphanable<ChildPolicyHandler>(std::move(lb_policy_args),
- &grpc_eds_drop_lb_trace);
- if (GRPC_TRACE_FLAG_ENABLED(grpc_eds_drop_lb_trace)) {
- gpr_log(GPR_INFO, "[eds_drop_lb %p] Created new child policy handler %p",
- this, lb_policy.get());
- }
- // Add our interested_parties pollset_set to that of the newly created
- // child policy. This will make the child policy progress upon activity on
- // this policy, which in turn is tied to the application's call.
- grpc_pollset_set_add_pollset_set(lb_policy->interested_parties(),
- interested_parties());
- return lb_policy;
-}
-
-void EdsDropLb::UpdateChildPolicyLocked(ServerAddressList addresses,
- const grpc_channel_args* args) {
- // Create policy if needed.
- if (child_policy_ == nullptr) {
- child_policy_ = CreateChildPolicyLocked(args);
- }
- // Construct update args.
- UpdateArgs update_args;
- update_args.addresses = std::move(addresses);
- update_args.config = config_->child_policy();
- update_args.args = args;
- // Update the policy.
- if (GRPC_TRACE_FLAG_ENABLED(grpc_eds_drop_lb_trace)) {
- gpr_log(GPR_INFO, "[eds_drop_lb %p] Updating child policy handler %p", this,
- child_policy_.get());
- }
- child_policy_->UpdateLocked(std::move(update_args));
-}
-
-//
-// EdsDropLb::Helper
-//
-
-RefCountedPtr<SubchannelInterface> EdsDropLb::Helper::CreateSubchannel(
- ServerAddress address, const grpc_channel_args& args) {
- if (eds_drop_policy_->shutting_down_) return nullptr;
- return eds_drop_policy_->channel_control_helper()->CreateSubchannel(
- std::move(address), args);
-}
-
-void EdsDropLb::Helper::UpdateState(grpc_connectivity_state state,
- const y_absl::Status& status,
- std::unique_ptr<SubchannelPicker> picker) {
- if (eds_drop_policy_->shutting_down_) return;
- if (GRPC_TRACE_FLAG_ENABLED(grpc_eds_drop_lb_trace)) {
- gpr_log(GPR_INFO,
- "[eds_drop_lb %p] child connectivity state update: state=%s (%s) "
- "picker=%p",
- eds_drop_policy_.get(), ConnectivityStateName(state),
- status.ToString().c_str(), picker.get());
- }
- // Save the state and picker.
- eds_drop_policy_->state_ = state;
- eds_drop_policy_->status_ = status;
- eds_drop_policy_->picker_ =
- MakeRefCounted<RefCountedPicker>(std::move(picker));
- // Wrap the picker and return it to the channel.
- eds_drop_policy_->MaybeUpdatePickerLocked();
-}
-
-void EdsDropLb::Helper::RequestReresolution() {
- if (eds_drop_policy_->shutting_down_) return;
- eds_drop_policy_->channel_control_helper()->RequestReresolution();
-}
-
-void EdsDropLb::Helper::AddTraceEvent(TraceSeverity severity,
- y_absl::string_view message) {
- if (eds_drop_policy_->shutting_down_) return;
- eds_drop_policy_->channel_control_helper()->AddTraceEvent(severity, message);
-}
-
-//
-// factory
-//
-
-class EdsDropLbFactory : public LoadBalancingPolicyFactory {
- public:
- OrphanablePtr<LoadBalancingPolicy> CreateLoadBalancingPolicy(
- LoadBalancingPolicy::Args args) const override {
- grpc_error* error = GRPC_ERROR_NONE;
- RefCountedPtr<XdsClient> xds_client = XdsClient::GetOrCreate(&error);
- if (error != GRPC_ERROR_NONE) {
- gpr_log(GPR_ERROR,
- "cannot get XdsClient to instantiate eds_drop LB policy: %s",
- grpc_error_string(error));
- GRPC_ERROR_UNREF(error);
- return nullptr;
- }
- return MakeOrphanable<EdsDropLb>(std::move(xds_client), std::move(args));
- }
-
- const char* name() const override { return kEdsDrop; }
-
- RefCountedPtr<LoadBalancingPolicy::Config> ParseLoadBalancingConfig(
- const Json& json, grpc_error** error) const override {
- GPR_DEBUG_ASSERT(error != nullptr && *error == GRPC_ERROR_NONE);
- if (json.type() == Json::Type::JSON_NULL) {
- // This policy was configured in the deprecated loadBalancingPolicy
- // field or in the client API.
- *error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:loadBalancingPolicy error:eds_drop policy requires "
- "configuration. Please use loadBalancingConfig field of service "
- "config instead.");
- return nullptr;
- }
- std::vector<grpc_error*> error_list;
- // Child policy.
- RefCountedPtr<LoadBalancingPolicy::Config> child_policy;
- auto it = json.object_value().find("childPolicy");
- if (it == json.object_value().end()) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:childPolicy error:required field missing"));
- } else {
- grpc_error* parse_error = GRPC_ERROR_NONE;
- child_policy = LoadBalancingPolicyRegistry::ParseLoadBalancingConfig(
- it->second, &parse_error);
- if (child_policy == nullptr) {
- GPR_DEBUG_ASSERT(parse_error != GRPC_ERROR_NONE);
- std::vector<grpc_error*> child_errors;
- child_errors.push_back(parse_error);
- error_list.push_back(
- GRPC_ERROR_CREATE_FROM_VECTOR("field:childPolicy", &child_errors));
- }
- }
- // Cluster name.
- TString cluster_name;
- it = json.object_value().find("clusterName");
- if (it == json.object_value().end()) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:clusterName error:required field missing"));
- } else if (it->second.type() != Json::Type::STRING) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:clusterName error:type should be string"));
- } else {
- cluster_name = it->second.string_value();
- }
- // EDS service name.
- TString eds_service_name;
- it = json.object_value().find("edsServiceName");
- if (it != json.object_value().end()) {
- if (it->second.type() != Json::Type::STRING) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:edsServiceName error:type should be string"));
- } else {
- eds_service_name = it->second.string_value();
- }
- }
- // LRS load reporting server name.
- y_absl::optional<TString> lrs_load_reporting_server_name;
- it = json.object_value().find("lrsLoadReportingServerName");
- if (it != json.object_value().end()) {
- if (it->second.type() != Json::Type::STRING) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:lrsLoadReportingServerName error:type should be string"));
- } else {
- lrs_load_reporting_server_name = it->second.string_value();
- }
- }
- // Drop config.
- auto drop_config = MakeRefCounted<XdsApi::EdsUpdate::DropConfig>();
- it = json.object_value().find("dropCategories");
- if (it == json.object_value().end()) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:dropCategories error:required field missing"));
- } else {
- std::vector<grpc_error*> child_errors =
- ParseDropCategories(it->second, drop_config.get());
- if (!child_errors.empty()) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_VECTOR(
- "field:dropCategories", &child_errors));
- }
- }
- if (!error_list.empty()) {
- *error = GRPC_ERROR_CREATE_FROM_VECTOR(
- "eds_drop_experimental LB policy config", &error_list);
- return nullptr;
- }
- return MakeRefCounted<EdsDropLbConfig>(
- std::move(child_policy), std::move(cluster_name),
- std::move(eds_service_name), std::move(lrs_load_reporting_server_name),
- std::move(drop_config));
- }
-
- private:
- static std::vector<grpc_error*> ParseDropCategories(
- const Json& json, XdsApi::EdsUpdate::DropConfig* drop_config) {
- std::vector<grpc_error*> error_list;
- if (json.type() != Json::Type::ARRAY) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "dropCategories field is not an array"));
- return error_list;
- }
- for (size_t i = 0; i < json.array_value().size(); ++i) {
- const Json& entry = json.array_value()[i];
- std::vector<grpc_error*> child_errors =
- ParseDropCategory(entry, drop_config);
- if (!child_errors.empty()) {
- grpc_error* error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("errors parsing index ", i).c_str());
- for (size_t i = 0; i < child_errors.size(); ++i) {
- error = grpc_error_add_child(error, child_errors[i]);
- }
- error_list.push_back(error);
- }
- }
- return error_list;
- }
-
- static std::vector<grpc_error*> ParseDropCategory(
- const Json& json, XdsApi::EdsUpdate::DropConfig* drop_config) {
- std::vector<grpc_error*> error_list;
- if (json.type() != Json::Type::OBJECT) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "dropCategories entry is not an object"));
- return error_list;
- }
- TString category;
- auto it = json.object_value().find("category");
- if (it == json.object_value().end()) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "\"category\" field not present"));
- } else if (it->second.type() != Json::Type::STRING) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "\"category\" field is not a string"));
- } else {
- category = it->second.string_value();
- }
- uint32_t requests_per_million = 0;
- it = json.object_value().find("requests_per_million");
- if (it == json.object_value().end()) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "\"requests_per_million\" field is not present"));
- } else if (it->second.type() != Json::Type::NUMBER) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "\"requests_per_million\" field is not a number"));
- } else {
- requests_per_million =
- gpr_parse_nonnegative_int(it->second.string_value().c_str());
- }
- if (error_list.empty()) {
- drop_config->AddCategory(std::move(category), requests_per_million);
- }
- return error_list;
- }
-};
-
-} // namespace
-
-} // namespace grpc_core
-
-//
-// Plugin registration
-//
-
-void grpc_lb_policy_eds_drop_init() {
- grpc_core::LoadBalancingPolicyRegistry::Builder::
- RegisterLoadBalancingPolicyFactory(
- y_absl::make_unique<grpc_core::EdsDropLbFactory>());
-}
-
-void grpc_lb_policy_eds_drop_shutdown() {}
+//
+// Copyright 2018 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+#include <grpc/support/port_platform.h>
+
+#include "y_absl/strings/string_view.h"
+
+#include <grpc/grpc.h>
+
+#include "src/core/ext/filters/client_channel/lb_policy.h"
+#include "src/core/ext/filters/client_channel/lb_policy/child_policy_handler.h"
+#include "src/core/ext/filters/client_channel/lb_policy_factory.h"
+#include "src/core/ext/filters/client_channel/lb_policy_registry.h"
+#include "src/core/ext/xds/xds_client.h"
+#include "src/core/ext/xds/xds_client_stats.h"
+#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/gpr/string.h"
+#include "src/core/lib/gprpp/orphanable.h"
+#include "src/core/lib/gprpp/ref_counted_ptr.h"
+#include "src/core/lib/iomgr/work_serializer.h"
+
+namespace grpc_core {
+
+TraceFlag grpc_eds_drop_lb_trace(false, "eds_drop_lb");
+
+namespace {
+
+constexpr char kEdsDrop[] = "eds_drop_experimental";
+
+// Config for EDS drop LB policy.
+class EdsDropLbConfig : public LoadBalancingPolicy::Config {
+ public:
+ EdsDropLbConfig(RefCountedPtr<LoadBalancingPolicy::Config> child_policy,
+ TString cluster_name, TString eds_service_name,
+ y_absl::optional<TString> lrs_load_reporting_server_name,
+ RefCountedPtr<XdsApi::EdsUpdate::DropConfig> drop_config)
+ : child_policy_(std::move(child_policy)),
+ cluster_name_(std::move(cluster_name)),
+ eds_service_name_(std::move(eds_service_name)),
+ lrs_load_reporting_server_name_(
+ std::move(lrs_load_reporting_server_name)),
+ drop_config_(std::move(drop_config)) {}
+
+ const char* name() const override { return kEdsDrop; }
+
+ RefCountedPtr<LoadBalancingPolicy::Config> child_policy() const {
+ return child_policy_;
+ }
+ const TString& cluster_name() const { return cluster_name_; }
+ const TString& eds_service_name() const { return eds_service_name_; }
+ const y_absl::optional<TString>& lrs_load_reporting_server_name() const {
+ return lrs_load_reporting_server_name_;
+ };
+ RefCountedPtr<XdsApi::EdsUpdate::DropConfig> drop_config() const {
+ return drop_config_;
+ }
+
+ private:
+ RefCountedPtr<LoadBalancingPolicy::Config> child_policy_;
+ TString cluster_name_;
+ TString eds_service_name_;
+ y_absl::optional<TString> lrs_load_reporting_server_name_;
+ RefCountedPtr<XdsApi::EdsUpdate::DropConfig> drop_config_;
+};
+
+// EDS Drop LB policy.
+class EdsDropLb : public LoadBalancingPolicy {
+ public:
+ EdsDropLb(RefCountedPtr<XdsClient> xds_client, Args args);
+
+ const char* name() const override { return kEdsDrop; }
+
+ void UpdateLocked(UpdateArgs args) override;
+ void ExitIdleLocked() override;
+ void ResetBackoffLocked() override;
+
+ private:
+ // A simple wrapper for ref-counting a picker from the child policy.
+ class RefCountedPicker : public RefCounted<RefCountedPicker> {
+ public:
+ explicit RefCountedPicker(std::unique_ptr<SubchannelPicker> picker)
+ : picker_(std::move(picker)) {}
+ PickResult Pick(PickArgs args) { return picker_->Pick(args); }
+
+ private:
+ std::unique_ptr<SubchannelPicker> picker_;
+ };
+
+ // A picker that wraps the picker from the child to perform drops.
+ class DropPicker : public SubchannelPicker {
+ public:
+ DropPicker(EdsDropLb* eds_drop_lb, RefCountedPtr<RefCountedPicker> picker)
+ : drop_config_(eds_drop_lb->config_->drop_config()),
+ drop_stats_(eds_drop_lb->drop_stats_),
+ picker_(std::move(picker)) {}
+
+ PickResult Pick(PickArgs args);
+
+ private:
+ RefCountedPtr<XdsApi::EdsUpdate::DropConfig> drop_config_;
+ RefCountedPtr<XdsClusterDropStats> drop_stats_;
+ RefCountedPtr<RefCountedPicker> picker_;
+ };
+
+ class Helper : public ChannelControlHelper {
+ public:
+ explicit Helper(RefCountedPtr<EdsDropLb> eds_drop_policy)
+ : eds_drop_policy_(std::move(eds_drop_policy)) {}
+
+ ~Helper() { eds_drop_policy_.reset(DEBUG_LOCATION, "Helper"); }
+
+ RefCountedPtr<SubchannelInterface> CreateSubchannel(
+ ServerAddress address, const grpc_channel_args& args) override;
+ void UpdateState(grpc_connectivity_state state, const y_absl::Status& status,
+ std::unique_ptr<SubchannelPicker> picker) override;
+ void RequestReresolution() override;
+ void AddTraceEvent(TraceSeverity severity,
+ y_absl::string_view message) override;
+
+ private:
+ RefCountedPtr<EdsDropLb> eds_drop_policy_;
+ };
+
+ ~EdsDropLb();
+
+ void ShutdownLocked() override;
+
+ OrphanablePtr<LoadBalancingPolicy> CreateChildPolicyLocked(
+ const grpc_channel_args* args);
+ void UpdateChildPolicyLocked(ServerAddressList addresses,
+ const grpc_channel_args* args);
+
+ void MaybeUpdatePickerLocked();
+
+ // Current config from the resolver.
+ RefCountedPtr<EdsDropLbConfig> config_;
+
+ // Internal state.
+ bool shutting_down_ = false;
+
+ // The xds client.
+ RefCountedPtr<XdsClient> xds_client_;
+
+ // The stats for client-side load reporting.
+ RefCountedPtr<XdsClusterDropStats> drop_stats_;
+
+ OrphanablePtr<LoadBalancingPolicy> child_policy_;
+
+ // Latest state and picker reported by the child policy.
+ grpc_connectivity_state state_ = GRPC_CHANNEL_IDLE;
+ y_absl::Status status_;
+ RefCountedPtr<RefCountedPicker> picker_;
+};
+
+//
+// EdsDropLb::DropPicker
+//
+
+LoadBalancingPolicy::PickResult EdsDropLb::DropPicker::Pick(
+ LoadBalancingPolicy::PickArgs args) {
+ // Handle drop.
+ const TString* drop_category;
+ if (drop_config_->ShouldDrop(&drop_category)) {
+ if (drop_stats_ != nullptr) drop_stats_->AddCallDropped(*drop_category);
+ PickResult result;
+ result.type = PickResult::PICK_COMPLETE;
+ return result;
+ }
+ // If we're not dropping the call, we should always have a child picker.
+ if (picker_ == nullptr) { // Should never happen.
+ PickResult result;
+ result.type = PickResult::PICK_FAILED;
+ result.error =
+ grpc_error_set_int(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "eds_drop picker not given any child picker"),
+ GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_INTERNAL);
+ return result;
+ }
+ // Not dropping, so delegate to child picker.
+ return picker_->Pick(args);
+}
+
+//
+// EdsDropLb
+//
+
+EdsDropLb::EdsDropLb(RefCountedPtr<XdsClient> xds_client, Args args)
+ : LoadBalancingPolicy(std::move(args)), xds_client_(std::move(xds_client)) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_eds_drop_lb_trace)) {
+ gpr_log(GPR_INFO, "[eds_drop_lb %p] created -- using xds client %p", this,
+ xds_client_.get());
+ }
+}
+
+EdsDropLb::~EdsDropLb() {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_eds_drop_lb_trace)) {
+ gpr_log(GPR_INFO, "[eds_drop_lb %p] destroying xds LB policy", this);
+ }
+}
+
+void EdsDropLb::ShutdownLocked() {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_eds_drop_lb_trace)) {
+ gpr_log(GPR_INFO, "[eds_drop_lb %p] shutting down", this);
+ }
+ shutting_down_ = true;
+ // Remove the child policy's interested_parties pollset_set from the
+ // xDS policy.
+ if (child_policy_ != nullptr) {
+ grpc_pollset_set_del_pollset_set(child_policy_->interested_parties(),
+ interested_parties());
+ child_policy_.reset();
+ }
+ // Drop our ref to the child's picker, in case it's holding a ref to
+ // the child.
+ picker_.reset();
+ drop_stats_.reset();
+ xds_client_.reset();
+}
+
+void EdsDropLb::ExitIdleLocked() {
+ if (child_policy_ != nullptr) child_policy_->ExitIdleLocked();
+}
+
+void EdsDropLb::ResetBackoffLocked() {
+ // The XdsClient will have its backoff reset by the xds resolver, so we
+ // don't need to do it here.
+ if (child_policy_ != nullptr) child_policy_->ResetBackoffLocked();
+}
+
+void EdsDropLb::UpdateLocked(UpdateArgs args) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_eds_drop_lb_trace)) {
+ gpr_log(GPR_INFO, "[eds_drop_lb %p] Received update", this);
+ }
+ // Update config.
+ auto old_config = std::move(config_);
+ config_ = std::move(args.config);
+ // Update load reporting if needed.
+ if (old_config == nullptr ||
+ config_->lrs_load_reporting_server_name() !=
+ old_config->lrs_load_reporting_server_name() ||
+ config_->cluster_name() != old_config->cluster_name() ||
+ config_->eds_service_name() != old_config->eds_service_name()) {
+ drop_stats_.reset();
+ if (config_->lrs_load_reporting_server_name().has_value()) {
+ drop_stats_ = xds_client_->AddClusterDropStats(
+ config_->lrs_load_reporting_server_name().value(),
+ config_->cluster_name(), config_->eds_service_name());
+ }
+ MaybeUpdatePickerLocked();
+ }
+ // Update child policy.
+ UpdateChildPolicyLocked(std::move(args.addresses), args.args);
+ args.args = nullptr;
+}
+
+void EdsDropLb::MaybeUpdatePickerLocked() {
+ // If we're dropping all calls, report READY, regardless of what (or
+ // whether) the child has reported.
+ if (config_->drop_config() != nullptr && config_->drop_config()->drop_all()) {
+ auto drop_picker = y_absl::make_unique<DropPicker>(this, picker_);
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_eds_drop_lb_trace)) {
+ gpr_log(GPR_INFO,
+ "[eds_drop_lb %p] updating connectivity (drop all): state=READY "
+ "picker=%p",
+ this, drop_picker.get());
+ }
+ channel_control_helper()->UpdateState(GRPC_CHANNEL_READY, y_absl::Status(),
+ std::move(drop_picker));
+ return;
+ }
+ // Otherwise, update only if we have a child picker.
+ if (picker_ != nullptr) {
+ auto drop_picker = y_absl::make_unique<DropPicker>(this, picker_);
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_eds_drop_lb_trace)) {
+ gpr_log(GPR_INFO,
+ "[eds_drop_lb %p] updating connectivity: state=%s status=(%s) "
+ "picker=%p",
+ this, ConnectivityStateName(state_), status_.ToString().c_str(),
+ drop_picker.get());
+ }
+ channel_control_helper()->UpdateState(state_, status_,
+ std::move(drop_picker));
+ }
+}
+
+OrphanablePtr<LoadBalancingPolicy> EdsDropLb::CreateChildPolicyLocked(
+ const grpc_channel_args* args) {
+ LoadBalancingPolicy::Args lb_policy_args;
+ lb_policy_args.work_serializer = work_serializer();
+ lb_policy_args.args = args;
+ lb_policy_args.channel_control_helper =
+ y_absl::make_unique<Helper>(Ref(DEBUG_LOCATION, "Helper"));
+ OrphanablePtr<LoadBalancingPolicy> lb_policy =
+ MakeOrphanable<ChildPolicyHandler>(std::move(lb_policy_args),
+ &grpc_eds_drop_lb_trace);
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_eds_drop_lb_trace)) {
+ gpr_log(GPR_INFO, "[eds_drop_lb %p] Created new child policy handler %p",
+ this, lb_policy.get());
+ }
+ // Add our interested_parties pollset_set to that of the newly created
+ // child policy. This will make the child policy progress upon activity on
+ // this policy, which in turn is tied to the application's call.
+ grpc_pollset_set_add_pollset_set(lb_policy->interested_parties(),
+ interested_parties());
+ return lb_policy;
+}
+
+void EdsDropLb::UpdateChildPolicyLocked(ServerAddressList addresses,
+ const grpc_channel_args* args) {
+ // Create policy if needed.
+ if (child_policy_ == nullptr) {
+ child_policy_ = CreateChildPolicyLocked(args);
+ }
+ // Construct update args.
+ UpdateArgs update_args;
+ update_args.addresses = std::move(addresses);
+ update_args.config = config_->child_policy();
+ update_args.args = args;
+ // Update the policy.
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_eds_drop_lb_trace)) {
+ gpr_log(GPR_INFO, "[eds_drop_lb %p] Updating child policy handler %p", this,
+ child_policy_.get());
+ }
+ child_policy_->UpdateLocked(std::move(update_args));
+}
+
+//
+// EdsDropLb::Helper
+//
+
+RefCountedPtr<SubchannelInterface> EdsDropLb::Helper::CreateSubchannel(
+ ServerAddress address, const grpc_channel_args& args) {
+ if (eds_drop_policy_->shutting_down_) return nullptr;
+ return eds_drop_policy_->channel_control_helper()->CreateSubchannel(
+ std::move(address), args);
+}
+
+void EdsDropLb::Helper::UpdateState(grpc_connectivity_state state,
+ const y_absl::Status& status,
+ std::unique_ptr<SubchannelPicker> picker) {
+ if (eds_drop_policy_->shutting_down_) return;
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_eds_drop_lb_trace)) {
+ gpr_log(GPR_INFO,
+ "[eds_drop_lb %p] child connectivity state update: state=%s (%s) "
+ "picker=%p",
+ eds_drop_policy_.get(), ConnectivityStateName(state),
+ status.ToString().c_str(), picker.get());
+ }
+ // Save the state and picker.
+ eds_drop_policy_->state_ = state;
+ eds_drop_policy_->status_ = status;
+ eds_drop_policy_->picker_ =
+ MakeRefCounted<RefCountedPicker>(std::move(picker));
+ // Wrap the picker and return it to the channel.
+ eds_drop_policy_->MaybeUpdatePickerLocked();
+}
+
+void EdsDropLb::Helper::RequestReresolution() {
+ if (eds_drop_policy_->shutting_down_) return;
+ eds_drop_policy_->channel_control_helper()->RequestReresolution();
+}
+
+void EdsDropLb::Helper::AddTraceEvent(TraceSeverity severity,
+ y_absl::string_view message) {
+ if (eds_drop_policy_->shutting_down_) return;
+ eds_drop_policy_->channel_control_helper()->AddTraceEvent(severity, message);
+}
+
+//
+// factory
+//
+
+class EdsDropLbFactory : public LoadBalancingPolicyFactory {
+ public:
+ OrphanablePtr<LoadBalancingPolicy> CreateLoadBalancingPolicy(
+ LoadBalancingPolicy::Args args) const override {
+ grpc_error* error = GRPC_ERROR_NONE;
+ RefCountedPtr<XdsClient> xds_client = XdsClient::GetOrCreate(&error);
+ if (error != GRPC_ERROR_NONE) {
+ gpr_log(GPR_ERROR,
+ "cannot get XdsClient to instantiate eds_drop LB policy: %s",
+ grpc_error_string(error));
+ GRPC_ERROR_UNREF(error);
+ return nullptr;
+ }
+ return MakeOrphanable<EdsDropLb>(std::move(xds_client), std::move(args));
+ }
+
+ const char* name() const override { return kEdsDrop; }
+
+ RefCountedPtr<LoadBalancingPolicy::Config> ParseLoadBalancingConfig(
+ const Json& json, grpc_error** error) const override {
+ GPR_DEBUG_ASSERT(error != nullptr && *error == GRPC_ERROR_NONE);
+ if (json.type() == Json::Type::JSON_NULL) {
+ // This policy was configured in the deprecated loadBalancingPolicy
+ // field or in the client API.
+ *error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:loadBalancingPolicy error:eds_drop policy requires "
+ "configuration. Please use loadBalancingConfig field of service "
+ "config instead.");
+ return nullptr;
+ }
+ std::vector<grpc_error*> error_list;
+ // Child policy.
+ RefCountedPtr<LoadBalancingPolicy::Config> child_policy;
+ auto it = json.object_value().find("childPolicy");
+ if (it == json.object_value().end()) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:childPolicy error:required field missing"));
+ } else {
+ grpc_error* parse_error = GRPC_ERROR_NONE;
+ child_policy = LoadBalancingPolicyRegistry::ParseLoadBalancingConfig(
+ it->second, &parse_error);
+ if (child_policy == nullptr) {
+ GPR_DEBUG_ASSERT(parse_error != GRPC_ERROR_NONE);
+ std::vector<grpc_error*> child_errors;
+ child_errors.push_back(parse_error);
+ error_list.push_back(
+ GRPC_ERROR_CREATE_FROM_VECTOR("field:childPolicy", &child_errors));
+ }
+ }
+ // Cluster name.
+ TString cluster_name;
+ it = json.object_value().find("clusterName");
+ if (it == json.object_value().end()) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:clusterName error:required field missing"));
+ } else if (it->second.type() != Json::Type::STRING) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:clusterName error:type should be string"));
+ } else {
+ cluster_name = it->second.string_value();
+ }
+ // EDS service name.
+ TString eds_service_name;
+ it = json.object_value().find("edsServiceName");
+ if (it != json.object_value().end()) {
+ if (it->second.type() != Json::Type::STRING) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:edsServiceName error:type should be string"));
+ } else {
+ eds_service_name = it->second.string_value();
+ }
+ }
+ // LRS load reporting server name.
+ y_absl::optional<TString> lrs_load_reporting_server_name;
+ it = json.object_value().find("lrsLoadReportingServerName");
+ if (it != json.object_value().end()) {
+ if (it->second.type() != Json::Type::STRING) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:lrsLoadReportingServerName error:type should be string"));
+ } else {
+ lrs_load_reporting_server_name = it->second.string_value();
+ }
+ }
+ // Drop config.
+ auto drop_config = MakeRefCounted<XdsApi::EdsUpdate::DropConfig>();
+ it = json.object_value().find("dropCategories");
+ if (it == json.object_value().end()) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:dropCategories error:required field missing"));
+ } else {
+ std::vector<grpc_error*> child_errors =
+ ParseDropCategories(it->second, drop_config.get());
+ if (!child_errors.empty()) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_VECTOR(
+ "field:dropCategories", &child_errors));
+ }
+ }
+ if (!error_list.empty()) {
+ *error = GRPC_ERROR_CREATE_FROM_VECTOR(
+ "eds_drop_experimental LB policy config", &error_list);
+ return nullptr;
+ }
+ return MakeRefCounted<EdsDropLbConfig>(
+ std::move(child_policy), std::move(cluster_name),
+ std::move(eds_service_name), std::move(lrs_load_reporting_server_name),
+ std::move(drop_config));
+ }
+
+ private:
+ static std::vector<grpc_error*> ParseDropCategories(
+ const Json& json, XdsApi::EdsUpdate::DropConfig* drop_config) {
+ std::vector<grpc_error*> error_list;
+ if (json.type() != Json::Type::ARRAY) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "dropCategories field is not an array"));
+ return error_list;
+ }
+ for (size_t i = 0; i < json.array_value().size(); ++i) {
+ const Json& entry = json.array_value()[i];
+ std::vector<grpc_error*> child_errors =
+ ParseDropCategory(entry, drop_config);
+ if (!child_errors.empty()) {
+ grpc_error* error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrCat("errors parsing index ", i).c_str());
+ for (size_t i = 0; i < child_errors.size(); ++i) {
+ error = grpc_error_add_child(error, child_errors[i]);
+ }
+ error_list.push_back(error);
+ }
+ }
+ return error_list;
+ }
+
+ static std::vector<grpc_error*> ParseDropCategory(
+ const Json& json, XdsApi::EdsUpdate::DropConfig* drop_config) {
+ std::vector<grpc_error*> error_list;
+ if (json.type() != Json::Type::OBJECT) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "dropCategories entry is not an object"));
+ return error_list;
+ }
+ TString category;
+ auto it = json.object_value().find("category");
+ if (it == json.object_value().end()) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "\"category\" field not present"));
+ } else if (it->second.type() != Json::Type::STRING) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "\"category\" field is not a string"));
+ } else {
+ category = it->second.string_value();
+ }
+ uint32_t requests_per_million = 0;
+ it = json.object_value().find("requests_per_million");
+ if (it == json.object_value().end()) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "\"requests_per_million\" field is not present"));
+ } else if (it->second.type() != Json::Type::NUMBER) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "\"requests_per_million\" field is not a number"));
+ } else {
+ requests_per_million =
+ gpr_parse_nonnegative_int(it->second.string_value().c_str());
+ }
+ if (error_list.empty()) {
+ drop_config->AddCategory(std::move(category), requests_per_million);
+ }
+ return error_list;
+ }
+};
+
+} // namespace
+
+} // namespace grpc_core
+
+//
+// Plugin registration
+//
+
+void grpc_lb_policy_eds_drop_init() {
+ grpc_core::LoadBalancingPolicyRegistry::Builder::
+ RegisterLoadBalancingPolicyFactory(
+ y_absl::make_unique<grpc_core::EdsDropLbFactory>());
+}
+
+void grpc_lb_policy_eds_drop_shutdown() {}
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/xds/xds.h b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/xds/xds.h
index 8c74eead48b..1de3472a3a0 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/xds/xds.h
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/xds/xds.h
@@ -29,4 +29,4 @@
#define GRPC_ARG_ADDRESS_IS_BACKEND_FROM_XDS_LOAD_BALANCER \
"grpc.address_is_backend_from_xds_load_balancer"
-#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_XDS_XDS_H */
+#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_XDS_XDS_H */
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_manager.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_manager.cc
index 15cfba6b03f..f113887a88e 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_manager.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_manager.cc
@@ -1,727 +1,727 @@
-//
-// Copyright 2018 gRPC authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-#include <grpc/support/port_platform.h>
-
-#include <inttypes.h>
-#include <limits.h>
-#include <string.h>
-
-#include "y_absl/container/inlined_vector.h"
-#include "y_absl/strings/match.h"
-#include "y_absl/strings/numbers.h"
-#include "y_absl/strings/str_cat.h"
-#include "y_absl/strings/str_join.h"
-#include "y_absl/strings/str_split.h"
-#include "y_absl/strings/string_view.h"
-#include "re2/re2.h"
-
-#include <grpc/grpc.h>
-
-#include "src/core/ext/filters/client_channel/lb_policy.h"
-#include "src/core/ext/filters/client_channel/lb_policy/child_policy_handler.h"
-#include "src/core/ext/filters/client_channel/lb_policy_factory.h"
-#include "src/core/ext/filters/client_channel/lb_policy_registry.h"
-#include "src/core/ext/filters/client_channel/resolver/xds/xds_resolver.h"
-#include "src/core/ext/xds/xds_api.h"
-#include "src/core/lib/channel/channel_args.h"
-#include "src/core/lib/gpr/string.h"
-#include "src/core/lib/gprpp/orphanable.h"
-#include "src/core/lib/gprpp/ref_counted_ptr.h"
-#include "src/core/lib/iomgr/timer.h"
-#include "src/core/lib/iomgr/work_serializer.h"
-#include "src/core/lib/transport/error_utils.h"
-
-#define GRPC_XDS_CLUSTER_MANAGER_CHILD_RETENTION_INTERVAL_MS (15 * 60 * 1000)
-
-namespace grpc_core {
-
-TraceFlag grpc_xds_cluster_manager_lb_trace(false, "xds_cluster_manager_lb");
-
-namespace {
-
-constexpr char kXdsClusterManager[] = "xds_cluster_manager_experimental";
-
-// Config for xds_cluster_manager LB policy.
-class XdsClusterManagerLbConfig : public LoadBalancingPolicy::Config {
- public:
- using ClusterMap =
- std::map<TString, RefCountedPtr<LoadBalancingPolicy::Config>>;
-
- XdsClusterManagerLbConfig(ClusterMap cluster_map)
- : cluster_map_(std::move(cluster_map)) {}
-
- const char* name() const override { return kXdsClusterManager; }
-
- const ClusterMap& cluster_map() const { return cluster_map_; }
-
- private:
- ClusterMap cluster_map_;
-};
-
-// xds_cluster_manager LB policy.
-class XdsClusterManagerLb : public LoadBalancingPolicy {
- public:
- explicit XdsClusterManagerLb(Args args);
-
- const char* name() const override { return kXdsClusterManager; }
-
- void UpdateLocked(UpdateArgs args) override;
- void ExitIdleLocked() override;
- void ResetBackoffLocked() override;
-
- private:
- // A simple wrapper for ref-counting a picker from the child policy.
- class ChildPickerWrapper : public RefCounted<ChildPickerWrapper> {
- public:
- ChildPickerWrapper(TString name,
- std::unique_ptr<SubchannelPicker> picker)
- : name_(std::move(name)), picker_(std::move(picker)) {}
- PickResult Pick(PickArgs args) { return picker_->Pick(args); }
-
- const TString& name() const { return name_; }
-
- private:
- TString name_;
- std::unique_ptr<SubchannelPicker> picker_;
- };
-
- // Picks a child using prefix or path matching and then delegates to that
- // child's picker.
- class ClusterPicker : public SubchannelPicker {
- public:
- // Maintains a map of cluster names to pickers.
- using ClusterMap = std::map<y_absl::string_view /*cluster_name*/,
- RefCountedPtr<ChildPickerWrapper>>;
-
- // It is required that the keys of cluster_map have to live at least as long
- // as the ClusterPicker instance.
- ClusterPicker(ClusterMap cluster_map,
- RefCountedPtr<XdsClusterManagerLbConfig> config)
- : cluster_map_(std::move(cluster_map)), config_(std::move(config)) {}
-
- PickResult Pick(PickArgs args) override;
-
- private:
- ClusterMap cluster_map_;
- // Take a reference to config so that we can use
- // XdsApi::RdsUpdate::RdsRoute::Matchers from it.
- RefCountedPtr<XdsClusterManagerLbConfig> config_;
- };
-
- // Each ClusterChild holds a ref to its parent XdsClusterManagerLb.
- class ClusterChild : public InternallyRefCounted<ClusterChild> {
- public:
- ClusterChild(RefCountedPtr<XdsClusterManagerLb> xds_cluster_manager_policy,
- const TString& name);
- ~ClusterChild();
-
- void Orphan() override;
-
- void UpdateLocked(RefCountedPtr<LoadBalancingPolicy::Config> config,
- const ServerAddressList& addresses,
- const grpc_channel_args* args);
- void ExitIdleLocked();
- void ResetBackoffLocked();
- void DeactivateLocked();
-
- grpc_connectivity_state connectivity_state() const {
- return connectivity_state_;
- }
- RefCountedPtr<ChildPickerWrapper> picker_wrapper() const {
- return picker_wrapper_;
- }
-
- private:
- class Helper : public ChannelControlHelper {
- public:
- explicit Helper(RefCountedPtr<ClusterChild> xds_cluster_manager_child)
- : xds_cluster_manager_child_(std::move(xds_cluster_manager_child)) {}
-
- ~Helper() { xds_cluster_manager_child_.reset(DEBUG_LOCATION, "Helper"); }
-
- RefCountedPtr<SubchannelInterface> CreateSubchannel(
- ServerAddress address, const grpc_channel_args& args) override;
- void UpdateState(grpc_connectivity_state state,
- const y_absl::Status& status,
- std::unique_ptr<SubchannelPicker> picker) override;
- void RequestReresolution() override;
- void AddTraceEvent(TraceSeverity severity,
- y_absl::string_view message) override;
-
- private:
- RefCountedPtr<ClusterChild> xds_cluster_manager_child_;
- };
-
- // Methods for dealing with the child policy.
- OrphanablePtr<LoadBalancingPolicy> CreateChildPolicyLocked(
- const grpc_channel_args* args);
-
- static void OnDelayedRemovalTimer(void* arg, grpc_error* error);
- void OnDelayedRemovalTimerLocked(grpc_error* error);
-
- // The owning LB policy.
- RefCountedPtr<XdsClusterManagerLb> xds_cluster_manager_policy_;
-
- // Points to the corresponding key in children map.
- const TString name_;
-
- OrphanablePtr<LoadBalancingPolicy> child_policy_;
-
- RefCountedPtr<ChildPickerWrapper> picker_wrapper_;
- grpc_connectivity_state connectivity_state_ = GRPC_CHANNEL_IDLE;
- bool seen_failure_since_ready_ = false;
-
- // States for delayed removal.
- grpc_timer delayed_removal_timer_;
- grpc_closure on_delayed_removal_timer_;
- bool delayed_removal_timer_callback_pending_ = false;
- bool shutdown_ = false;
- };
-
- ~XdsClusterManagerLb();
-
- void ShutdownLocked() override;
-
- void UpdateStateLocked();
-
- // Current config from the resolver.
- RefCountedPtr<XdsClusterManagerLbConfig> config_;
-
- // Internal state.
- bool shutting_down_ = false;
-
- // Children.
- std::map<TString, OrphanablePtr<ClusterChild>> children_;
-};
-
-//
-// XdsClusterManagerLb::ClusterPicker
-//
-
-XdsClusterManagerLb::PickResult XdsClusterManagerLb::ClusterPicker::Pick(
- PickArgs args) {
- auto cluster_name =
- args.call_state->ExperimentalGetCallAttribute(kXdsClusterAttribute);
- auto it = cluster_map_.find(cluster_name);
- if (it != cluster_map_.end()) {
- return it->second->Pick(args);
- }
- PickResult result;
- result.type = PickResult::PICK_FAILED;
- result.error = grpc_error_set_int(
- GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("xds cluster manager picker: unknown cluster \"",
- cluster_name, "\"")
- .c_str()),
- GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_INTERNAL);
- return result;
-}
-
-//
-// XdsClusterManagerLb
-//
-
-XdsClusterManagerLb::XdsClusterManagerLb(Args args)
- : LoadBalancingPolicy(std::move(args)) {}
-
-XdsClusterManagerLb::~XdsClusterManagerLb() {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_cluster_manager_lb_trace)) {
- gpr_log(
- GPR_INFO,
- "[xds_cluster_manager_lb %p] destroying xds_cluster_manager LB policy",
- this);
- }
-}
-
-void XdsClusterManagerLb::ShutdownLocked() {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_cluster_manager_lb_trace)) {
- gpr_log(GPR_INFO, "[xds_cluster_manager_lb %p] shutting down", this);
- }
- shutting_down_ = true;
- children_.clear();
-}
-
-void XdsClusterManagerLb::ExitIdleLocked() {
- for (auto& p : children_) p.second->ExitIdleLocked();
-}
-
-void XdsClusterManagerLb::ResetBackoffLocked() {
- for (auto& p : children_) p.second->ResetBackoffLocked();
-}
-
-void XdsClusterManagerLb::UpdateLocked(UpdateArgs args) {
- if (shutting_down_) return;
- if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_cluster_manager_lb_trace)) {
- gpr_log(GPR_INFO, "[xds_cluster_manager_lb %p] Received update", this);
- }
- // Update config.
- config_ = std::move(args.config);
- // Deactivate the children not in the new config.
- for (const auto& p : children_) {
- const TString& name = p.first;
- ClusterChild* child = p.second.get();
- if (config_->cluster_map().find(name) == config_->cluster_map().end()) {
- child->DeactivateLocked();
- }
- }
- // Add or update the children in the new config.
- for (const auto& p : config_->cluster_map()) {
- const TString& name = p.first;
- const RefCountedPtr<LoadBalancingPolicy::Config>& config = p.second;
- auto it = children_.find(name);
- if (it == children_.end()) {
- it = children_
- .emplace(name, MakeOrphanable<ClusterChild>(
- Ref(DEBUG_LOCATION, "ClusterChild"), name))
- .first;
- }
- it->second->UpdateLocked(config, args.addresses, args.args);
- }
- UpdateStateLocked();
-}
-
-void XdsClusterManagerLb::UpdateStateLocked() {
- // Also count the number of children in each state, to determine the
- // overall state.
- size_t num_ready = 0;
- size_t num_connecting = 0;
- size_t num_idle = 0;
- size_t num_transient_failures = 0;
- for (const auto& p : children_) {
- const auto& child_name = p.first;
- const ClusterChild* child = p.second.get();
- // Skip the children that are not in the latest update.
- if (config_->cluster_map().find(child_name) ==
- config_->cluster_map().end()) {
- continue;
- }
- switch (child->connectivity_state()) {
- case GRPC_CHANNEL_READY: {
- ++num_ready;
- break;
- }
- case GRPC_CHANNEL_CONNECTING: {
- ++num_connecting;
- break;
- }
- case GRPC_CHANNEL_IDLE: {
- ++num_idle;
- break;
- }
- case GRPC_CHANNEL_TRANSIENT_FAILURE: {
- ++num_transient_failures;
- break;
- }
- default:
- GPR_UNREACHABLE_CODE(return );
- }
- }
- // Determine aggregated connectivity state.
- grpc_connectivity_state connectivity_state;
- if (num_ready > 0) {
- connectivity_state = GRPC_CHANNEL_READY;
- } else if (num_connecting > 0) {
- connectivity_state = GRPC_CHANNEL_CONNECTING;
- } else if (num_idle > 0) {
- connectivity_state = GRPC_CHANNEL_IDLE;
- } else {
- connectivity_state = GRPC_CHANNEL_TRANSIENT_FAILURE;
- }
- if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_cluster_manager_lb_trace)) {
- gpr_log(GPR_INFO, "[xds_cluster_manager_lb %p] connectivity changed to %s",
- this, ConnectivityStateName(connectivity_state));
- }
- std::unique_ptr<SubchannelPicker> picker;
- y_absl::Status status;
- switch (connectivity_state) {
- case GRPC_CHANNEL_READY: {
- ClusterPicker::ClusterMap cluster_map;
- for (const auto& p : config_->cluster_map()) {
- const TString& cluster_name = p.first;
- RefCountedPtr<ChildPickerWrapper>& child_picker =
- cluster_map[cluster_name];
- child_picker = children_[cluster_name]->picker_wrapper();
- if (child_picker == nullptr) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_cluster_manager_lb_trace)) {
- gpr_log(
- GPR_INFO,
- "[xds_cluster_manager_lb %p] child %s has not yet returned a "
- "picker; creating a QueuePicker.",
- this, cluster_name.c_str());
- }
- child_picker = MakeRefCounted<ChildPickerWrapper>(
- cluster_name, y_absl::make_unique<QueuePicker>(
- Ref(DEBUG_LOCATION, "QueuePicker")));
- }
- }
- picker =
- y_absl::make_unique<ClusterPicker>(std::move(cluster_map), config_);
- break;
- }
- case GRPC_CHANNEL_CONNECTING:
- case GRPC_CHANNEL_IDLE:
- picker =
- y_absl::make_unique<QueuePicker>(Ref(DEBUG_LOCATION, "QueuePicker"));
- break;
- default:
- grpc_error* error = grpc_error_set_int(
- GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "TRANSIENT_FAILURE from XdsClusterManagerLb"),
- GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE);
- status = grpc_error_to_absl_status(error);
- picker = y_absl::make_unique<TransientFailurePicker>(error);
- }
- channel_control_helper()->UpdateState(connectivity_state, status,
- std::move(picker));
-}
-
-//
-// XdsClusterManagerLb::ClusterChild
-//
-
-XdsClusterManagerLb::ClusterChild::ClusterChild(
- RefCountedPtr<XdsClusterManagerLb> xds_cluster_manager_policy,
- const TString& name)
- : xds_cluster_manager_policy_(std::move(xds_cluster_manager_policy)),
- name_(name) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_cluster_manager_lb_trace)) {
- gpr_log(GPR_INFO,
- "[xds_cluster_manager_lb %p] created ClusterChild %p for %s",
- xds_cluster_manager_policy_.get(), this, name_.c_str());
- }
- GRPC_CLOSURE_INIT(&on_delayed_removal_timer_, OnDelayedRemovalTimer, this,
- grpc_schedule_on_exec_ctx);
-}
-
-XdsClusterManagerLb::ClusterChild::~ClusterChild() {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_cluster_manager_lb_trace)) {
- gpr_log(GPR_INFO,
- "[xds_cluster_manager_lb %p] ClusterChild %p: destroying "
- "child",
- xds_cluster_manager_policy_.get(), this);
- }
- xds_cluster_manager_policy_.reset(DEBUG_LOCATION, "ClusterChild");
-}
-
-void XdsClusterManagerLb::ClusterChild::Orphan() {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_cluster_manager_lb_trace)) {
- gpr_log(GPR_INFO,
- "[xds_cluster_manager_lb %p] ClusterChild %p %s: "
- "shutting down child",
- xds_cluster_manager_policy_.get(), this, name_.c_str());
- }
- // Remove the child policy's interested_parties pollset_set from the
- // xDS policy.
- grpc_pollset_set_del_pollset_set(
- child_policy_->interested_parties(),
- xds_cluster_manager_policy_->interested_parties());
- child_policy_.reset();
- // Drop our ref to the child's picker, in case it's holding a ref to
- // the child.
- picker_wrapper_.reset();
- if (delayed_removal_timer_callback_pending_) {
- grpc_timer_cancel(&delayed_removal_timer_);
- }
- shutdown_ = true;
- Unref();
-}
-
-OrphanablePtr<LoadBalancingPolicy>
-XdsClusterManagerLb::ClusterChild::CreateChildPolicyLocked(
- const grpc_channel_args* args) {
- LoadBalancingPolicy::Args lb_policy_args;
- lb_policy_args.work_serializer =
- xds_cluster_manager_policy_->work_serializer();
- lb_policy_args.args = args;
- lb_policy_args.channel_control_helper =
- y_absl::make_unique<Helper>(this->Ref(DEBUG_LOCATION, "Helper"));
- OrphanablePtr<LoadBalancingPolicy> lb_policy =
- MakeOrphanable<ChildPolicyHandler>(std::move(lb_policy_args),
- &grpc_xds_cluster_manager_lb_trace);
- if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_cluster_manager_lb_trace)) {
- gpr_log(GPR_INFO,
- "[xds_cluster_manager_lb %p] ClusterChild %p %s: Created "
- "new child "
- "policy handler %p",
- xds_cluster_manager_policy_.get(), this, name_.c_str(),
- lb_policy.get());
- }
- // Add the xDS's interested_parties pollset_set to that of the newly created
- // child policy. This will make the child policy progress upon activity on
- // xDS LB, which in turn is tied to the application's call.
- grpc_pollset_set_add_pollset_set(
- lb_policy->interested_parties(),
- xds_cluster_manager_policy_->interested_parties());
- return lb_policy;
-}
-
-void XdsClusterManagerLb::ClusterChild::UpdateLocked(
- RefCountedPtr<LoadBalancingPolicy::Config> config,
- const ServerAddressList& addresses, const grpc_channel_args* args) {
- if (xds_cluster_manager_policy_->shutting_down_) return;
- // Update child weight.
- // Reactivate if needed.
- if (delayed_removal_timer_callback_pending_) {
- delayed_removal_timer_callback_pending_ = false;
- grpc_timer_cancel(&delayed_removal_timer_);
- }
- // Create child policy if needed.
- if (child_policy_ == nullptr) {
- child_policy_ = CreateChildPolicyLocked(args);
- }
- // Construct update args.
- UpdateArgs update_args;
- update_args.config = std::move(config);
- update_args.addresses = addresses;
- update_args.args = grpc_channel_args_copy(args);
- // Update the policy.
- if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_cluster_manager_lb_trace)) {
- gpr_log(GPR_INFO,
- "[xds_cluster_manager_lb %p] ClusterChild %p %s: "
- "Updating child "
- "policy handler %p",
- xds_cluster_manager_policy_.get(), this, name_.c_str(),
- child_policy_.get());
- }
- child_policy_->UpdateLocked(std::move(update_args));
-}
-
-void XdsClusterManagerLb::ClusterChild::ExitIdleLocked() {
- child_policy_->ExitIdleLocked();
-}
-
-void XdsClusterManagerLb::ClusterChild::ResetBackoffLocked() {
- child_policy_->ResetBackoffLocked();
-}
-
-void XdsClusterManagerLb::ClusterChild::DeactivateLocked() {
- // If already deactivated, don't do that again.
- if (delayed_removal_timer_callback_pending_ == true) return;
- // Set the child weight to 0 so that future picker won't contain this child.
- // Start a timer to delete the child.
- Ref(DEBUG_LOCATION, "ClusterChild+timer").release();
- grpc_timer_init(&delayed_removal_timer_,
- ExecCtx::Get()->Now() +
- GRPC_XDS_CLUSTER_MANAGER_CHILD_RETENTION_INTERVAL_MS,
- &on_delayed_removal_timer_);
- delayed_removal_timer_callback_pending_ = true;
-}
-
-void XdsClusterManagerLb::ClusterChild::OnDelayedRemovalTimer(
- void* arg, grpc_error* error) {
- ClusterChild* self = static_cast<ClusterChild*>(arg);
- GRPC_ERROR_REF(error); // Ref owned by the lambda
- self->xds_cluster_manager_policy_->work_serializer()->Run(
- [self, error]() { self->OnDelayedRemovalTimerLocked(error); },
- DEBUG_LOCATION);
-}
-
-void XdsClusterManagerLb::ClusterChild::OnDelayedRemovalTimerLocked(
- grpc_error* error) {
- delayed_removal_timer_callback_pending_ = false;
- if (error == GRPC_ERROR_NONE && !shutdown_) {
- xds_cluster_manager_policy_->children_.erase(name_);
- }
- Unref(DEBUG_LOCATION, "ClusterChild+timer");
- GRPC_ERROR_UNREF(error);
-}
-
-//
-// XdsClusterManagerLb::ClusterChild::Helper
-//
-
-RefCountedPtr<SubchannelInterface>
-XdsClusterManagerLb::ClusterChild::Helper::CreateSubchannel(
- ServerAddress address, const grpc_channel_args& args) {
- if (xds_cluster_manager_child_->xds_cluster_manager_policy_->shutting_down_)
- return nullptr;
- return xds_cluster_manager_child_->xds_cluster_manager_policy_
- ->channel_control_helper()
- ->CreateSubchannel(std::move(address), args);
-}
-
-void XdsClusterManagerLb::ClusterChild::Helper::UpdateState(
- grpc_connectivity_state state, const y_absl::Status& status,
- std::unique_ptr<SubchannelPicker> picker) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_cluster_manager_lb_trace)) {
- gpr_log(
- GPR_INFO,
- "[xds_cluster_manager_lb %p] child %s: received update: state=%s (%s) "
- "picker=%p",
- xds_cluster_manager_child_->xds_cluster_manager_policy_.get(),
- xds_cluster_manager_child_->name_.c_str(), ConnectivityStateName(state),
- status.ToString().c_str(), picker.get());
- }
- if (xds_cluster_manager_child_->xds_cluster_manager_policy_->shutting_down_)
- return;
- // Cache the picker in the ClusterChild.
- xds_cluster_manager_child_->picker_wrapper_ =
- MakeRefCounted<ChildPickerWrapper>(xds_cluster_manager_child_->name_,
- std::move(picker));
- // Decide what state to report for aggregation purposes.
- // If we haven't seen a failure since the last time we were in state
- // READY, then we report the state change as-is. However, once we do see
- // a failure, we report TRANSIENT_FAILURE and ignore any subsequent state
- // changes until we go back into state READY.
- if (!xds_cluster_manager_child_->seen_failure_since_ready_) {
- if (state == GRPC_CHANNEL_TRANSIENT_FAILURE) {
- xds_cluster_manager_child_->seen_failure_since_ready_ = true;
- }
- } else {
- if (state != GRPC_CHANNEL_READY) return;
- xds_cluster_manager_child_->seen_failure_since_ready_ = false;
- }
- xds_cluster_manager_child_->connectivity_state_ = state;
- // Notify the LB policy.
- xds_cluster_manager_child_->xds_cluster_manager_policy_->UpdateStateLocked();
-}
-
-void XdsClusterManagerLb::ClusterChild::Helper::RequestReresolution() {
- if (xds_cluster_manager_child_->xds_cluster_manager_policy_->shutting_down_)
- return;
- xds_cluster_manager_child_->xds_cluster_manager_policy_
- ->channel_control_helper()
- ->RequestReresolution();
-}
-
-void XdsClusterManagerLb::ClusterChild::Helper::AddTraceEvent(
- TraceSeverity severity, y_absl::string_view message) {
- if (xds_cluster_manager_child_->xds_cluster_manager_policy_->shutting_down_)
- return;
- xds_cluster_manager_child_->xds_cluster_manager_policy_
- ->channel_control_helper()
- ->AddTraceEvent(severity, message);
-}
-
-//
-// factory
-//
-
-class XdsClusterManagerLbFactory : public LoadBalancingPolicyFactory {
- public:
- OrphanablePtr<LoadBalancingPolicy> CreateLoadBalancingPolicy(
- LoadBalancingPolicy::Args args) const override {
- return MakeOrphanable<XdsClusterManagerLb>(std::move(args));
- }
-
- const char* name() const override { return kXdsClusterManager; }
-
- RefCountedPtr<LoadBalancingPolicy::Config> ParseLoadBalancingConfig(
- const Json& json, grpc_error** error) const override {
- GPR_DEBUG_ASSERT(error != nullptr && *error == GRPC_ERROR_NONE);
- if (json.type() == Json::Type::JSON_NULL) {
- // xds_cluster_manager was mentioned as a policy in the deprecated
- // loadBalancingPolicy field or in the client API.
- *error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:loadBalancingPolicy error:xds_cluster_manager policy requires "
- "configuration. Please use loadBalancingConfig field of service "
- "config instead.");
- return nullptr;
- }
- std::vector<grpc_error*> error_list;
- XdsClusterManagerLbConfig::ClusterMap cluster_map;
- std::set<TString /*cluster_name*/> clusters_to_be_used;
- auto it = json.object_value().find("children");
- if (it == json.object_value().end()) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:children error:required field not present"));
- } else if (it->second.type() != Json::Type::OBJECT) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:children error:type should be object"));
- } else {
- for (const auto& p : it->second.object_value()) {
- const TString& child_name = p.first;
- if (child_name.empty()) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:children element error: name cannot be empty"));
- continue;
- }
- RefCountedPtr<LoadBalancingPolicy::Config> child_config;
- std::vector<grpc_error*> child_errors =
- ParseChildConfig(p.second, &child_config);
- if (!child_errors.empty()) {
- // Can't use GRPC_ERROR_CREATE_FROM_VECTOR() here, because the error
- // string is not static in this case.
- grpc_error* error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("field:children name:", child_name).c_str());
- for (grpc_error* child_error : child_errors) {
- error = grpc_error_add_child(error, child_error);
- }
- error_list.push_back(error);
- } else {
- cluster_map[child_name] = std::move(child_config);
- clusters_to_be_used.insert(child_name);
- }
- }
- }
- if (cluster_map.empty()) {
- error_list.push_back(
- GRPC_ERROR_CREATE_FROM_STATIC_STRING("no valid children configured"));
- }
- if (!error_list.empty()) {
- *error = GRPC_ERROR_CREATE_FROM_VECTOR(
- "xds_cluster_manager_experimental LB policy config", &error_list);
- return nullptr;
- }
- return MakeRefCounted<XdsClusterManagerLbConfig>(std::move(cluster_map));
- }
-
- private:
- static std::vector<grpc_error*> ParseChildConfig(
- const Json& json,
- RefCountedPtr<LoadBalancingPolicy::Config>* child_config) {
- std::vector<grpc_error*> error_list;
- if (json.type() != Json::Type::OBJECT) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "value should be of type object"));
- return error_list;
- }
- auto it = json.object_value().find("childPolicy");
- if (it == json.object_value().end()) {
- error_list.push_back(
- GRPC_ERROR_CREATE_FROM_STATIC_STRING("did not find childPolicy"));
- } else {
- grpc_error* parse_error = GRPC_ERROR_NONE;
- *child_config = LoadBalancingPolicyRegistry::ParseLoadBalancingConfig(
- it->second, &parse_error);
- if (*child_config == nullptr) {
- GPR_DEBUG_ASSERT(parse_error != GRPC_ERROR_NONE);
- std::vector<grpc_error*> child_errors;
- child_errors.push_back(parse_error);
- error_list.push_back(
- GRPC_ERROR_CREATE_FROM_VECTOR("field:childPolicy", &child_errors));
- }
- }
- return error_list;
- }
-};
-
-} // namespace
-
-} // namespace grpc_core
-
-//
-// Plugin registration
-//
-
-void grpc_lb_policy_xds_cluster_manager_init() {
- grpc_core::LoadBalancingPolicyRegistry::Builder::
- RegisterLoadBalancingPolicyFactory(
- y_absl::make_unique<grpc_core::XdsClusterManagerLbFactory>());
-}
-
-void grpc_lb_policy_xds_cluster_manager_shutdown() {}
+//
+// Copyright 2018 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+#include <grpc/support/port_platform.h>
+
+#include <inttypes.h>
+#include <limits.h>
+#include <string.h>
+
+#include "y_absl/container/inlined_vector.h"
+#include "y_absl/strings/match.h"
+#include "y_absl/strings/numbers.h"
+#include "y_absl/strings/str_cat.h"
+#include "y_absl/strings/str_join.h"
+#include "y_absl/strings/str_split.h"
+#include "y_absl/strings/string_view.h"
+#include "re2/re2.h"
+
+#include <grpc/grpc.h>
+
+#include "src/core/ext/filters/client_channel/lb_policy.h"
+#include "src/core/ext/filters/client_channel/lb_policy/child_policy_handler.h"
+#include "src/core/ext/filters/client_channel/lb_policy_factory.h"
+#include "src/core/ext/filters/client_channel/lb_policy_registry.h"
+#include "src/core/ext/filters/client_channel/resolver/xds/xds_resolver.h"
+#include "src/core/ext/xds/xds_api.h"
+#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/gpr/string.h"
+#include "src/core/lib/gprpp/orphanable.h"
+#include "src/core/lib/gprpp/ref_counted_ptr.h"
+#include "src/core/lib/iomgr/timer.h"
+#include "src/core/lib/iomgr/work_serializer.h"
+#include "src/core/lib/transport/error_utils.h"
+
+#define GRPC_XDS_CLUSTER_MANAGER_CHILD_RETENTION_INTERVAL_MS (15 * 60 * 1000)
+
+namespace grpc_core {
+
+TraceFlag grpc_xds_cluster_manager_lb_trace(false, "xds_cluster_manager_lb");
+
+namespace {
+
+constexpr char kXdsClusterManager[] = "xds_cluster_manager_experimental";
+
+// Config for xds_cluster_manager LB policy.
+class XdsClusterManagerLbConfig : public LoadBalancingPolicy::Config {
+ public:
+ using ClusterMap =
+ std::map<TString, RefCountedPtr<LoadBalancingPolicy::Config>>;
+
+ XdsClusterManagerLbConfig(ClusterMap cluster_map)
+ : cluster_map_(std::move(cluster_map)) {}
+
+ const char* name() const override { return kXdsClusterManager; }
+
+ const ClusterMap& cluster_map() const { return cluster_map_; }
+
+ private:
+ ClusterMap cluster_map_;
+};
+
+// xds_cluster_manager LB policy.
+class XdsClusterManagerLb : public LoadBalancingPolicy {
+ public:
+ explicit XdsClusterManagerLb(Args args);
+
+ const char* name() const override { return kXdsClusterManager; }
+
+ void UpdateLocked(UpdateArgs args) override;
+ void ExitIdleLocked() override;
+ void ResetBackoffLocked() override;
+
+ private:
+ // A simple wrapper for ref-counting a picker from the child policy.
+ class ChildPickerWrapper : public RefCounted<ChildPickerWrapper> {
+ public:
+ ChildPickerWrapper(TString name,
+ std::unique_ptr<SubchannelPicker> picker)
+ : name_(std::move(name)), picker_(std::move(picker)) {}
+ PickResult Pick(PickArgs args) { return picker_->Pick(args); }
+
+ const TString& name() const { return name_; }
+
+ private:
+ TString name_;
+ std::unique_ptr<SubchannelPicker> picker_;
+ };
+
+ // Picks a child using prefix or path matching and then delegates to that
+ // child's picker.
+ class ClusterPicker : public SubchannelPicker {
+ public:
+ // Maintains a map of cluster names to pickers.
+ using ClusterMap = std::map<y_absl::string_view /*cluster_name*/,
+ RefCountedPtr<ChildPickerWrapper>>;
+
+ // It is required that the keys of cluster_map have to live at least as long
+ // as the ClusterPicker instance.
+ ClusterPicker(ClusterMap cluster_map,
+ RefCountedPtr<XdsClusterManagerLbConfig> config)
+ : cluster_map_(std::move(cluster_map)), config_(std::move(config)) {}
+
+ PickResult Pick(PickArgs args) override;
+
+ private:
+ ClusterMap cluster_map_;
+ // Take a reference to config so that we can use
+ // XdsApi::RdsUpdate::RdsRoute::Matchers from it.
+ RefCountedPtr<XdsClusterManagerLbConfig> config_;
+ };
+
+ // Each ClusterChild holds a ref to its parent XdsClusterManagerLb.
+ class ClusterChild : public InternallyRefCounted<ClusterChild> {
+ public:
+ ClusterChild(RefCountedPtr<XdsClusterManagerLb> xds_cluster_manager_policy,
+ const TString& name);
+ ~ClusterChild();
+
+ void Orphan() override;
+
+ void UpdateLocked(RefCountedPtr<LoadBalancingPolicy::Config> config,
+ const ServerAddressList& addresses,
+ const grpc_channel_args* args);
+ void ExitIdleLocked();
+ void ResetBackoffLocked();
+ void DeactivateLocked();
+
+ grpc_connectivity_state connectivity_state() const {
+ return connectivity_state_;
+ }
+ RefCountedPtr<ChildPickerWrapper> picker_wrapper() const {
+ return picker_wrapper_;
+ }
+
+ private:
+ class Helper : public ChannelControlHelper {
+ public:
+ explicit Helper(RefCountedPtr<ClusterChild> xds_cluster_manager_child)
+ : xds_cluster_manager_child_(std::move(xds_cluster_manager_child)) {}
+
+ ~Helper() { xds_cluster_manager_child_.reset(DEBUG_LOCATION, "Helper"); }
+
+ RefCountedPtr<SubchannelInterface> CreateSubchannel(
+ ServerAddress address, const grpc_channel_args& args) override;
+ void UpdateState(grpc_connectivity_state state,
+ const y_absl::Status& status,
+ std::unique_ptr<SubchannelPicker> picker) override;
+ void RequestReresolution() override;
+ void AddTraceEvent(TraceSeverity severity,
+ y_absl::string_view message) override;
+
+ private:
+ RefCountedPtr<ClusterChild> xds_cluster_manager_child_;
+ };
+
+ // Methods for dealing with the child policy.
+ OrphanablePtr<LoadBalancingPolicy> CreateChildPolicyLocked(
+ const grpc_channel_args* args);
+
+ static void OnDelayedRemovalTimer(void* arg, grpc_error* error);
+ void OnDelayedRemovalTimerLocked(grpc_error* error);
+
+ // The owning LB policy.
+ RefCountedPtr<XdsClusterManagerLb> xds_cluster_manager_policy_;
+
+ // Points to the corresponding key in children map.
+ const TString name_;
+
+ OrphanablePtr<LoadBalancingPolicy> child_policy_;
+
+ RefCountedPtr<ChildPickerWrapper> picker_wrapper_;
+ grpc_connectivity_state connectivity_state_ = GRPC_CHANNEL_IDLE;
+ bool seen_failure_since_ready_ = false;
+
+ // States for delayed removal.
+ grpc_timer delayed_removal_timer_;
+ grpc_closure on_delayed_removal_timer_;
+ bool delayed_removal_timer_callback_pending_ = false;
+ bool shutdown_ = false;
+ };
+
+ ~XdsClusterManagerLb();
+
+ void ShutdownLocked() override;
+
+ void UpdateStateLocked();
+
+ // Current config from the resolver.
+ RefCountedPtr<XdsClusterManagerLbConfig> config_;
+
+ // Internal state.
+ bool shutting_down_ = false;
+
+ // Children.
+ std::map<TString, OrphanablePtr<ClusterChild>> children_;
+};
+
+//
+// XdsClusterManagerLb::ClusterPicker
+//
+
+XdsClusterManagerLb::PickResult XdsClusterManagerLb::ClusterPicker::Pick(
+ PickArgs args) {
+ auto cluster_name =
+ args.call_state->ExperimentalGetCallAttribute(kXdsClusterAttribute);
+ auto it = cluster_map_.find(cluster_name);
+ if (it != cluster_map_.end()) {
+ return it->second->Pick(args);
+ }
+ PickResult result;
+ result.type = PickResult::PICK_FAILED;
+ result.error = grpc_error_set_int(
+ GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrCat("xds cluster manager picker: unknown cluster \"",
+ cluster_name, "\"")
+ .c_str()),
+ GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_INTERNAL);
+ return result;
+}
+
+//
+// XdsClusterManagerLb
+//
+
+XdsClusterManagerLb::XdsClusterManagerLb(Args args)
+ : LoadBalancingPolicy(std::move(args)) {}
+
+XdsClusterManagerLb::~XdsClusterManagerLb() {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_cluster_manager_lb_trace)) {
+ gpr_log(
+ GPR_INFO,
+ "[xds_cluster_manager_lb %p] destroying xds_cluster_manager LB policy",
+ this);
+ }
+}
+
+void XdsClusterManagerLb::ShutdownLocked() {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_cluster_manager_lb_trace)) {
+ gpr_log(GPR_INFO, "[xds_cluster_manager_lb %p] shutting down", this);
+ }
+ shutting_down_ = true;
+ children_.clear();
+}
+
+void XdsClusterManagerLb::ExitIdleLocked() {
+ for (auto& p : children_) p.second->ExitIdleLocked();
+}
+
+void XdsClusterManagerLb::ResetBackoffLocked() {
+ for (auto& p : children_) p.second->ResetBackoffLocked();
+}
+
+void XdsClusterManagerLb::UpdateLocked(UpdateArgs args) {
+ if (shutting_down_) return;
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_cluster_manager_lb_trace)) {
+ gpr_log(GPR_INFO, "[xds_cluster_manager_lb %p] Received update", this);
+ }
+ // Update config.
+ config_ = std::move(args.config);
+ // Deactivate the children not in the new config.
+ for (const auto& p : children_) {
+ const TString& name = p.first;
+ ClusterChild* child = p.second.get();
+ if (config_->cluster_map().find(name) == config_->cluster_map().end()) {
+ child->DeactivateLocked();
+ }
+ }
+ // Add or update the children in the new config.
+ for (const auto& p : config_->cluster_map()) {
+ const TString& name = p.first;
+ const RefCountedPtr<LoadBalancingPolicy::Config>& config = p.second;
+ auto it = children_.find(name);
+ if (it == children_.end()) {
+ it = children_
+ .emplace(name, MakeOrphanable<ClusterChild>(
+ Ref(DEBUG_LOCATION, "ClusterChild"), name))
+ .first;
+ }
+ it->second->UpdateLocked(config, args.addresses, args.args);
+ }
+ UpdateStateLocked();
+}
+
+void XdsClusterManagerLb::UpdateStateLocked() {
+ // Also count the number of children in each state, to determine the
+ // overall state.
+ size_t num_ready = 0;
+ size_t num_connecting = 0;
+ size_t num_idle = 0;
+ size_t num_transient_failures = 0;
+ for (const auto& p : children_) {
+ const auto& child_name = p.first;
+ const ClusterChild* child = p.second.get();
+ // Skip the children that are not in the latest update.
+ if (config_->cluster_map().find(child_name) ==
+ config_->cluster_map().end()) {
+ continue;
+ }
+ switch (child->connectivity_state()) {
+ case GRPC_CHANNEL_READY: {
+ ++num_ready;
+ break;
+ }
+ case GRPC_CHANNEL_CONNECTING: {
+ ++num_connecting;
+ break;
+ }
+ case GRPC_CHANNEL_IDLE: {
+ ++num_idle;
+ break;
+ }
+ case GRPC_CHANNEL_TRANSIENT_FAILURE: {
+ ++num_transient_failures;
+ break;
+ }
+ default:
+ GPR_UNREACHABLE_CODE(return );
+ }
+ }
+ // Determine aggregated connectivity state.
+ grpc_connectivity_state connectivity_state;
+ if (num_ready > 0) {
+ connectivity_state = GRPC_CHANNEL_READY;
+ } else if (num_connecting > 0) {
+ connectivity_state = GRPC_CHANNEL_CONNECTING;
+ } else if (num_idle > 0) {
+ connectivity_state = GRPC_CHANNEL_IDLE;
+ } else {
+ connectivity_state = GRPC_CHANNEL_TRANSIENT_FAILURE;
+ }
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_cluster_manager_lb_trace)) {
+ gpr_log(GPR_INFO, "[xds_cluster_manager_lb %p] connectivity changed to %s",
+ this, ConnectivityStateName(connectivity_state));
+ }
+ std::unique_ptr<SubchannelPicker> picker;
+ y_absl::Status status;
+ switch (connectivity_state) {
+ case GRPC_CHANNEL_READY: {
+ ClusterPicker::ClusterMap cluster_map;
+ for (const auto& p : config_->cluster_map()) {
+ const TString& cluster_name = p.first;
+ RefCountedPtr<ChildPickerWrapper>& child_picker =
+ cluster_map[cluster_name];
+ child_picker = children_[cluster_name]->picker_wrapper();
+ if (child_picker == nullptr) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_cluster_manager_lb_trace)) {
+ gpr_log(
+ GPR_INFO,
+ "[xds_cluster_manager_lb %p] child %s has not yet returned a "
+ "picker; creating a QueuePicker.",
+ this, cluster_name.c_str());
+ }
+ child_picker = MakeRefCounted<ChildPickerWrapper>(
+ cluster_name, y_absl::make_unique<QueuePicker>(
+ Ref(DEBUG_LOCATION, "QueuePicker")));
+ }
+ }
+ picker =
+ y_absl::make_unique<ClusterPicker>(std::move(cluster_map), config_);
+ break;
+ }
+ case GRPC_CHANNEL_CONNECTING:
+ case GRPC_CHANNEL_IDLE:
+ picker =
+ y_absl::make_unique<QueuePicker>(Ref(DEBUG_LOCATION, "QueuePicker"));
+ break;
+ default:
+ grpc_error* error = grpc_error_set_int(
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "TRANSIENT_FAILURE from XdsClusterManagerLb"),
+ GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE);
+ status = grpc_error_to_absl_status(error);
+ picker = y_absl::make_unique<TransientFailurePicker>(error);
+ }
+ channel_control_helper()->UpdateState(connectivity_state, status,
+ std::move(picker));
+}
+
+//
+// XdsClusterManagerLb::ClusterChild
+//
+
+XdsClusterManagerLb::ClusterChild::ClusterChild(
+ RefCountedPtr<XdsClusterManagerLb> xds_cluster_manager_policy,
+ const TString& name)
+ : xds_cluster_manager_policy_(std::move(xds_cluster_manager_policy)),
+ name_(name) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_cluster_manager_lb_trace)) {
+ gpr_log(GPR_INFO,
+ "[xds_cluster_manager_lb %p] created ClusterChild %p for %s",
+ xds_cluster_manager_policy_.get(), this, name_.c_str());
+ }
+ GRPC_CLOSURE_INIT(&on_delayed_removal_timer_, OnDelayedRemovalTimer, this,
+ grpc_schedule_on_exec_ctx);
+}
+
+XdsClusterManagerLb::ClusterChild::~ClusterChild() {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_cluster_manager_lb_trace)) {
+ gpr_log(GPR_INFO,
+ "[xds_cluster_manager_lb %p] ClusterChild %p: destroying "
+ "child",
+ xds_cluster_manager_policy_.get(), this);
+ }
+ xds_cluster_manager_policy_.reset(DEBUG_LOCATION, "ClusterChild");
+}
+
+void XdsClusterManagerLb::ClusterChild::Orphan() {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_cluster_manager_lb_trace)) {
+ gpr_log(GPR_INFO,
+ "[xds_cluster_manager_lb %p] ClusterChild %p %s: "
+ "shutting down child",
+ xds_cluster_manager_policy_.get(), this, name_.c_str());
+ }
+ // Remove the child policy's interested_parties pollset_set from the
+ // xDS policy.
+ grpc_pollset_set_del_pollset_set(
+ child_policy_->interested_parties(),
+ xds_cluster_manager_policy_->interested_parties());
+ child_policy_.reset();
+ // Drop our ref to the child's picker, in case it's holding a ref to
+ // the child.
+ picker_wrapper_.reset();
+ if (delayed_removal_timer_callback_pending_) {
+ grpc_timer_cancel(&delayed_removal_timer_);
+ }
+ shutdown_ = true;
+ Unref();
+}
+
+OrphanablePtr<LoadBalancingPolicy>
+XdsClusterManagerLb::ClusterChild::CreateChildPolicyLocked(
+ const grpc_channel_args* args) {
+ LoadBalancingPolicy::Args lb_policy_args;
+ lb_policy_args.work_serializer =
+ xds_cluster_manager_policy_->work_serializer();
+ lb_policy_args.args = args;
+ lb_policy_args.channel_control_helper =
+ y_absl::make_unique<Helper>(this->Ref(DEBUG_LOCATION, "Helper"));
+ OrphanablePtr<LoadBalancingPolicy> lb_policy =
+ MakeOrphanable<ChildPolicyHandler>(std::move(lb_policy_args),
+ &grpc_xds_cluster_manager_lb_trace);
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_cluster_manager_lb_trace)) {
+ gpr_log(GPR_INFO,
+ "[xds_cluster_manager_lb %p] ClusterChild %p %s: Created "
+ "new child "
+ "policy handler %p",
+ xds_cluster_manager_policy_.get(), this, name_.c_str(),
+ lb_policy.get());
+ }
+ // Add the xDS's interested_parties pollset_set to that of the newly created
+ // child policy. This will make the child policy progress upon activity on
+ // xDS LB, which in turn is tied to the application's call.
+ grpc_pollset_set_add_pollset_set(
+ lb_policy->interested_parties(),
+ xds_cluster_manager_policy_->interested_parties());
+ return lb_policy;
+}
+
+void XdsClusterManagerLb::ClusterChild::UpdateLocked(
+ RefCountedPtr<LoadBalancingPolicy::Config> config,
+ const ServerAddressList& addresses, const grpc_channel_args* args) {
+ if (xds_cluster_manager_policy_->shutting_down_) return;
+ // Update child weight.
+ // Reactivate if needed.
+ if (delayed_removal_timer_callback_pending_) {
+ delayed_removal_timer_callback_pending_ = false;
+ grpc_timer_cancel(&delayed_removal_timer_);
+ }
+ // Create child policy if needed.
+ if (child_policy_ == nullptr) {
+ child_policy_ = CreateChildPolicyLocked(args);
+ }
+ // Construct update args.
+ UpdateArgs update_args;
+ update_args.config = std::move(config);
+ update_args.addresses = addresses;
+ update_args.args = grpc_channel_args_copy(args);
+ // Update the policy.
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_cluster_manager_lb_trace)) {
+ gpr_log(GPR_INFO,
+ "[xds_cluster_manager_lb %p] ClusterChild %p %s: "
+ "Updating child "
+ "policy handler %p",
+ xds_cluster_manager_policy_.get(), this, name_.c_str(),
+ child_policy_.get());
+ }
+ child_policy_->UpdateLocked(std::move(update_args));
+}
+
+void XdsClusterManagerLb::ClusterChild::ExitIdleLocked() {
+ child_policy_->ExitIdleLocked();
+}
+
+void XdsClusterManagerLb::ClusterChild::ResetBackoffLocked() {
+ child_policy_->ResetBackoffLocked();
+}
+
+void XdsClusterManagerLb::ClusterChild::DeactivateLocked() {
+ // If already deactivated, don't do that again.
+ if (delayed_removal_timer_callback_pending_ == true) return;
+ // Set the child weight to 0 so that future picker won't contain this child.
+ // Start a timer to delete the child.
+ Ref(DEBUG_LOCATION, "ClusterChild+timer").release();
+ grpc_timer_init(&delayed_removal_timer_,
+ ExecCtx::Get()->Now() +
+ GRPC_XDS_CLUSTER_MANAGER_CHILD_RETENTION_INTERVAL_MS,
+ &on_delayed_removal_timer_);
+ delayed_removal_timer_callback_pending_ = true;
+}
+
+void XdsClusterManagerLb::ClusterChild::OnDelayedRemovalTimer(
+ void* arg, grpc_error* error) {
+ ClusterChild* self = static_cast<ClusterChild*>(arg);
+ GRPC_ERROR_REF(error); // Ref owned by the lambda
+ self->xds_cluster_manager_policy_->work_serializer()->Run(
+ [self, error]() { self->OnDelayedRemovalTimerLocked(error); },
+ DEBUG_LOCATION);
+}
+
+void XdsClusterManagerLb::ClusterChild::OnDelayedRemovalTimerLocked(
+ grpc_error* error) {
+ delayed_removal_timer_callback_pending_ = false;
+ if (error == GRPC_ERROR_NONE && !shutdown_) {
+ xds_cluster_manager_policy_->children_.erase(name_);
+ }
+ Unref(DEBUG_LOCATION, "ClusterChild+timer");
+ GRPC_ERROR_UNREF(error);
+}
+
+//
+// XdsClusterManagerLb::ClusterChild::Helper
+//
+
+RefCountedPtr<SubchannelInterface>
+XdsClusterManagerLb::ClusterChild::Helper::CreateSubchannel(
+ ServerAddress address, const grpc_channel_args& args) {
+ if (xds_cluster_manager_child_->xds_cluster_manager_policy_->shutting_down_)
+ return nullptr;
+ return xds_cluster_manager_child_->xds_cluster_manager_policy_
+ ->channel_control_helper()
+ ->CreateSubchannel(std::move(address), args);
+}
+
+void XdsClusterManagerLb::ClusterChild::Helper::UpdateState(
+ grpc_connectivity_state state, const y_absl::Status& status,
+ std::unique_ptr<SubchannelPicker> picker) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_cluster_manager_lb_trace)) {
+ gpr_log(
+ GPR_INFO,
+ "[xds_cluster_manager_lb %p] child %s: received update: state=%s (%s) "
+ "picker=%p",
+ xds_cluster_manager_child_->xds_cluster_manager_policy_.get(),
+ xds_cluster_manager_child_->name_.c_str(), ConnectivityStateName(state),
+ status.ToString().c_str(), picker.get());
+ }
+ if (xds_cluster_manager_child_->xds_cluster_manager_policy_->shutting_down_)
+ return;
+ // Cache the picker in the ClusterChild.
+ xds_cluster_manager_child_->picker_wrapper_ =
+ MakeRefCounted<ChildPickerWrapper>(xds_cluster_manager_child_->name_,
+ std::move(picker));
+ // Decide what state to report for aggregation purposes.
+ // If we haven't seen a failure since the last time we were in state
+ // READY, then we report the state change as-is. However, once we do see
+ // a failure, we report TRANSIENT_FAILURE and ignore any subsequent state
+ // changes until we go back into state READY.
+ if (!xds_cluster_manager_child_->seen_failure_since_ready_) {
+ if (state == GRPC_CHANNEL_TRANSIENT_FAILURE) {
+ xds_cluster_manager_child_->seen_failure_since_ready_ = true;
+ }
+ } else {
+ if (state != GRPC_CHANNEL_READY) return;
+ xds_cluster_manager_child_->seen_failure_since_ready_ = false;
+ }
+ xds_cluster_manager_child_->connectivity_state_ = state;
+ // Notify the LB policy.
+ xds_cluster_manager_child_->xds_cluster_manager_policy_->UpdateStateLocked();
+}
+
+void XdsClusterManagerLb::ClusterChild::Helper::RequestReresolution() {
+ if (xds_cluster_manager_child_->xds_cluster_manager_policy_->shutting_down_)
+ return;
+ xds_cluster_manager_child_->xds_cluster_manager_policy_
+ ->channel_control_helper()
+ ->RequestReresolution();
+}
+
+void XdsClusterManagerLb::ClusterChild::Helper::AddTraceEvent(
+ TraceSeverity severity, y_absl::string_view message) {
+ if (xds_cluster_manager_child_->xds_cluster_manager_policy_->shutting_down_)
+ return;
+ xds_cluster_manager_child_->xds_cluster_manager_policy_
+ ->channel_control_helper()
+ ->AddTraceEvent(severity, message);
+}
+
+//
+// factory
+//
+
+class XdsClusterManagerLbFactory : public LoadBalancingPolicyFactory {
+ public:
+ OrphanablePtr<LoadBalancingPolicy> CreateLoadBalancingPolicy(
+ LoadBalancingPolicy::Args args) const override {
+ return MakeOrphanable<XdsClusterManagerLb>(std::move(args));
+ }
+
+ const char* name() const override { return kXdsClusterManager; }
+
+ RefCountedPtr<LoadBalancingPolicy::Config> ParseLoadBalancingConfig(
+ const Json& json, grpc_error** error) const override {
+ GPR_DEBUG_ASSERT(error != nullptr && *error == GRPC_ERROR_NONE);
+ if (json.type() == Json::Type::JSON_NULL) {
+ // xds_cluster_manager was mentioned as a policy in the deprecated
+ // loadBalancingPolicy field or in the client API.
+ *error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:loadBalancingPolicy error:xds_cluster_manager policy requires "
+ "configuration. Please use loadBalancingConfig field of service "
+ "config instead.");
+ return nullptr;
+ }
+ std::vector<grpc_error*> error_list;
+ XdsClusterManagerLbConfig::ClusterMap cluster_map;
+ std::set<TString /*cluster_name*/> clusters_to_be_used;
+ auto it = json.object_value().find("children");
+ if (it == json.object_value().end()) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:children error:required field not present"));
+ } else if (it->second.type() != Json::Type::OBJECT) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:children error:type should be object"));
+ } else {
+ for (const auto& p : it->second.object_value()) {
+ const TString& child_name = p.first;
+ if (child_name.empty()) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:children element error: name cannot be empty"));
+ continue;
+ }
+ RefCountedPtr<LoadBalancingPolicy::Config> child_config;
+ std::vector<grpc_error*> child_errors =
+ ParseChildConfig(p.second, &child_config);
+ if (!child_errors.empty()) {
+ // Can't use GRPC_ERROR_CREATE_FROM_VECTOR() here, because the error
+ // string is not static in this case.
+ grpc_error* error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrCat("field:children name:", child_name).c_str());
+ for (grpc_error* child_error : child_errors) {
+ error = grpc_error_add_child(error, child_error);
+ }
+ error_list.push_back(error);
+ } else {
+ cluster_map[child_name] = std::move(child_config);
+ clusters_to_be_used.insert(child_name);
+ }
+ }
+ }
+ if (cluster_map.empty()) {
+ error_list.push_back(
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("no valid children configured"));
+ }
+ if (!error_list.empty()) {
+ *error = GRPC_ERROR_CREATE_FROM_VECTOR(
+ "xds_cluster_manager_experimental LB policy config", &error_list);
+ return nullptr;
+ }
+ return MakeRefCounted<XdsClusterManagerLbConfig>(std::move(cluster_map));
+ }
+
+ private:
+ static std::vector<grpc_error*> ParseChildConfig(
+ const Json& json,
+ RefCountedPtr<LoadBalancingPolicy::Config>* child_config) {
+ std::vector<grpc_error*> error_list;
+ if (json.type() != Json::Type::OBJECT) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "value should be of type object"));
+ return error_list;
+ }
+ auto it = json.object_value().find("childPolicy");
+ if (it == json.object_value().end()) {
+ error_list.push_back(
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("did not find childPolicy"));
+ } else {
+ grpc_error* parse_error = GRPC_ERROR_NONE;
+ *child_config = LoadBalancingPolicyRegistry::ParseLoadBalancingConfig(
+ it->second, &parse_error);
+ if (*child_config == nullptr) {
+ GPR_DEBUG_ASSERT(parse_error != GRPC_ERROR_NONE);
+ std::vector<grpc_error*> child_errors;
+ child_errors.push_back(parse_error);
+ error_list.push_back(
+ GRPC_ERROR_CREATE_FROM_VECTOR("field:childPolicy", &child_errors));
+ }
+ }
+ return error_list;
+ }
+};
+
+} // namespace
+
+} // namespace grpc_core
+
+//
+// Plugin registration
+//
+
+void grpc_lb_policy_xds_cluster_manager_init() {
+ grpc_core::LoadBalancingPolicyRegistry::Builder::
+ RegisterLoadBalancingPolicyFactory(
+ y_absl::make_unique<grpc_core::XdsClusterManagerLbFactory>());
+}
+
+void grpc_lb_policy_xds_cluster_manager_shutdown() {}
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy_factory.h b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy_factory.h
index 3dc8f40f1ef..9e4425fa447 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy_factory.h
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy_factory.h
@@ -28,8 +28,8 @@ namespace grpc_core {
class LoadBalancingPolicyFactory {
public:
- virtual ~LoadBalancingPolicyFactory() {}
-
+ virtual ~LoadBalancingPolicyFactory() {}
+
/// Returns a new LB policy instance.
virtual OrphanablePtr<LoadBalancingPolicy> CreateLoadBalancingPolicy(
LoadBalancingPolicy::Args) const = 0;
@@ -39,7 +39,7 @@ class LoadBalancingPolicyFactory {
virtual const char* name() const = 0;
virtual RefCountedPtr<LoadBalancingPolicy::Config> ParseLoadBalancingConfig(
- const Json& json, grpc_error** error) const = 0;
+ const Json& json, grpc_error** error) const = 0;
};
} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy_registry.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy_registry.cc
index 67cb97344dd..463e54a2e6c 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy_registry.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy_registry.cc
@@ -22,11 +22,11 @@
#include <string.h>
-#include "y_absl/container/inlined_vector.h"
-#include "y_absl/strings/str_cat.h"
-#include "y_absl/strings/str_format.h"
-#include "y_absl/strings/str_join.h"
-
+#include "y_absl/container/inlined_vector.h"
+#include "y_absl/strings/str_cat.h"
+#include "y_absl/strings/str_format.h"
+#include "y_absl/strings/str_join.h"
+
#include "src/core/lib/gpr/string.h"
namespace grpc_core {
@@ -39,8 +39,8 @@ class RegistryState {
void RegisterLoadBalancingPolicyFactory(
std::unique_ptr<LoadBalancingPolicyFactory> factory) {
- gpr_log(GPR_DEBUG, "registering LB policy factory for \"%s\"",
- factory->name());
+ gpr_log(GPR_DEBUG, "registering LB policy factory for \"%s\"",
+ factory->name());
for (size_t i = 0; i < factories_.size(); ++i) {
GPR_ASSERT(strcmp(factories_[i]->name(), factory->name()) != 0);
}
@@ -58,8 +58,8 @@ class RegistryState {
}
private:
- y_absl::InlinedVector<std::unique_ptr<LoadBalancingPolicyFactory>, 10>
- factories_;
+ y_absl::InlinedVector<std::unique_ptr<LoadBalancingPolicyFactory>, 10>
+ factories_;
};
RegistryState* g_state = nullptr;
@@ -112,77 +112,77 @@ bool LoadBalancingPolicyRegistry::LoadBalancingPolicyExists(
grpc_error* error = GRPC_ERROR_NONE;
// Check if the load balancing policy allows an empty config
*requires_config =
- factory->ParseLoadBalancingConfig(Json(), &error) == nullptr;
+ factory->ParseLoadBalancingConfig(Json(), &error) == nullptr;
GRPC_ERROR_UNREF(error);
}
return true;
}
namespace {
-
+
// Returns the JSON node of policy (with both policy name and config content)
// given the JSON node of a LoadBalancingConfig array.
-grpc_error* ParseLoadBalancingConfigHelper(
- const Json& lb_config_array, Json::Object::const_iterator* result) {
- if (lb_config_array.type() != Json::Type::ARRAY) {
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING("type should be array");
+grpc_error* ParseLoadBalancingConfigHelper(
+ const Json& lb_config_array, Json::Object::const_iterator* result) {
+ if (lb_config_array.type() != Json::Type::ARRAY) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING("type should be array");
}
// Find the first LB policy that this client supports.
- std::vector<y_absl::string_view> policies_tried;
- for (const Json& lb_config : lb_config_array.array_value()) {
- if (lb_config.type() != Json::Type::OBJECT) {
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "child entry should be of type object");
+ std::vector<y_absl::string_view> policies_tried;
+ for (const Json& lb_config : lb_config_array.array_value()) {
+ if (lb_config.type() != Json::Type::OBJECT) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "child entry should be of type object");
+ }
+ if (lb_config.object_value().empty()) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "no policy found in child entry");
}
- if (lb_config.object_value().empty()) {
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "no policy found in child entry");
+ if (lb_config.object_value().size() > 1) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING("oneOf violation");
}
- if (lb_config.object_value().size() > 1) {
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING("oneOf violation");
+ auto it = lb_config.object_value().begin();
+ if (it->second.type() != Json::Type::OBJECT) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "child entry should be of type object");
}
- auto it = lb_config.object_value().begin();
- if (it->second.type() != Json::Type::OBJECT) {
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "child entry should be of type object");
- }
// If we support this policy, then select it.
- if (LoadBalancingPolicyRegistry::LoadBalancingPolicyExists(
- it->first.c_str(), nullptr)) {
- *result = it;
- return GRPC_ERROR_NONE;
+ if (LoadBalancingPolicyRegistry::LoadBalancingPolicyExists(
+ it->first.c_str(), nullptr)) {
+ *result = it;
+ return GRPC_ERROR_NONE;
}
- policies_tried.push_back(it->first);
+ policies_tried.push_back(it->first);
}
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("No known policies in list: ",
- y_absl::StrJoin(policies_tried, " "))
- .c_str());
+ return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrCat("No known policies in list: ",
+ y_absl::StrJoin(policies_tried, " "))
+ .c_str());
}
-
+
} // namespace
RefCountedPtr<LoadBalancingPolicy::Config>
-LoadBalancingPolicyRegistry::ParseLoadBalancingConfig(const Json& json,
+LoadBalancingPolicyRegistry::ParseLoadBalancingConfig(const Json& json,
grpc_error** error) {
GPR_DEBUG_ASSERT(error != nullptr && *error == GRPC_ERROR_NONE);
GPR_ASSERT(g_state != nullptr);
- Json::Object::const_iterator policy;
- *error = ParseLoadBalancingConfigHelper(json, &policy);
- if (*error != GRPC_ERROR_NONE) {
+ Json::Object::const_iterator policy;
+ *error = ParseLoadBalancingConfigHelper(json, &policy);
+ if (*error != GRPC_ERROR_NONE) {
+ return nullptr;
+ }
+ // Find factory.
+ LoadBalancingPolicyFactory* factory =
+ g_state->GetLoadBalancingPolicyFactory(policy->first.c_str());
+ if (factory == nullptr) {
+ *error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrFormat("Factory not found for policy \"%s\"", policy->first)
+ .c_str());
return nullptr;
}
- // Find factory.
- LoadBalancingPolicyFactory* factory =
- g_state->GetLoadBalancingPolicyFactory(policy->first.c_str());
- if (factory == nullptr) {
- *error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrFormat("Factory not found for policy \"%s\"", policy->first)
- .c_str());
- return nullptr;
- }
- // Parse load balancing config via factory.
- return factory->ParseLoadBalancingConfig(policy->second, error);
+ // Parse load balancing config via factory.
+ return factory->ParseLoadBalancingConfig(policy->second, error);
}
} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy_registry.h b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy_registry.h
index a9f29aa3a4b..8d2e3e395d5 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy_registry.h
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy_registry.h
@@ -57,7 +57,7 @@ class LoadBalancingPolicyRegistry {
/// Returns a parsed object of the load balancing policy to be used from a
/// LoadBalancingConfig array \a json.
static RefCountedPtr<LoadBalancingPolicy::Config> ParseLoadBalancingConfig(
- const Json& json, grpc_error** error);
+ const Json& json, grpc_error** error);
};
} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/local_subchannel_pool.h b/contrib/libs/grpc/src/core/ext/filters/client_channel/local_subchannel_pool.h
index bdf791024a1..7d18d9b53f5 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/local_subchannel_pool.h
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/local_subchannel_pool.h
@@ -38,8 +38,8 @@ class LocalSubchannelPool final : public SubchannelPoolInterface {
~LocalSubchannelPool() override;
// Implements interface methods.
- // Thread-unsafe. Intended to be invoked within the client_channel work
- // serializer.
+ // Thread-unsafe. Intended to be invoked within the client_channel work
+ // serializer.
Subchannel* RegisterSubchannel(SubchannelKey* key,
Subchannel* constructed) override;
void UnregisterSubchannel(SubchannelKey* key) override;
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver.cc
index 38b1bafc8ad..4a76a7d7bdc 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver.cc
@@ -29,11 +29,11 @@ namespace grpc_core {
// Resolver
//
-Resolver::Resolver(std::shared_ptr<WorkSerializer> work_serializer,
+Resolver::Resolver(std::shared_ptr<WorkSerializer> work_serializer,
std::unique_ptr<ResultHandler> result_handler)
: InternallyRefCounted(&grpc_trace_resolver_refcount),
- work_serializer_(std::move(work_serializer)),
- result_handler_(std::move(result_handler)) {}
+ work_serializer_(std::move(work_serializer)),
+ result_handler_(std::move(result_handler)) {}
//
// Resolver::Result
@@ -51,7 +51,7 @@ Resolver::Result::Result(const Result& other) {
args = grpc_channel_args_copy(other.args);
}
-Resolver::Result::Result(Result&& other) noexcept {
+Resolver::Result::Result(Result&& other) noexcept {
addresses = std::move(other.addresses);
service_config = std::move(other.service_config);
service_config_error = other.service_config_error;
@@ -70,7 +70,7 @@ Resolver::Result& Resolver::Result::operator=(const Result& other) {
return *this;
}
-Resolver::Result& Resolver::Result::operator=(Result&& other) noexcept {
+Resolver::Result& Resolver::Result::operator=(Result&& other) noexcept {
addresses = std::move(other.addresses);
service_config = std::move(other.service_config);
GRPC_ERROR_UNREF(service_config_error);
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver.h b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver.h
index 4f46fad99f1..de941a063b4 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver.h
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver.h
@@ -28,7 +28,7 @@
#include "src/core/lib/gprpp/orphanable.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/iomgr/iomgr.h"
-#include "src/core/lib/iomgr/work_serializer.h"
+#include "src/core/lib/iomgr/work_serializer.h"
extern grpc_core::DebugOnlyTraceFlag grpc_trace_resolver_refcount;
@@ -45,7 +45,7 @@ namespace grpc_core {
/// DNS).
///
/// Note: All methods with a "Locked" suffix must be called from the
-/// work_serializer passed to the constructor.
+/// work_serializer passed to the constructor.
class Resolver : public InternallyRefCounted<Resolver> {
public:
/// Results returned by the resolver.
@@ -60,9 +60,9 @@ class Resolver : public InternallyRefCounted<Resolver> {
Result() = default;
~Result();
Result(const Result& other);
- Result(Result&& other) noexcept;
+ Result(Result&& other) noexcept;
Result& operator=(const Result& other);
- Result& operator=(Result&& other) noexcept;
+ Result& operator=(Result&& other) noexcept;
};
/// A proxy object used by the resolver to return results to the
@@ -87,7 +87,7 @@ class Resolver : public InternallyRefCounted<Resolver> {
// Not copyable nor movable.
Resolver(const Resolver&) = delete;
Resolver& operator=(const Resolver&) = delete;
- virtual ~Resolver() = default;
+ virtual ~Resolver() = default;
/// Starts resolving.
virtual void StartLocked() = 0;
@@ -115,27 +115,27 @@ class Resolver : public InternallyRefCounted<Resolver> {
/// implementations. At that point, this method can go away.
virtual void ResetBackoffLocked() {}
- // Note: This must be invoked while holding the work_serializer.
+ // Note: This must be invoked while holding the work_serializer.
void Orphan() override {
ShutdownLocked();
Unref();
}
protected:
- Resolver(std::shared_ptr<WorkSerializer> work_serializer,
- std::unique_ptr<ResultHandler> result_handler);
+ Resolver(std::shared_ptr<WorkSerializer> work_serializer,
+ std::unique_ptr<ResultHandler> result_handler);
/// Shuts down the resolver.
virtual void ShutdownLocked() = 0;
- std::shared_ptr<WorkSerializer> work_serializer() const {
- return work_serializer_;
- }
+ std::shared_ptr<WorkSerializer> work_serializer() const {
+ return work_serializer_;
+ }
ResultHandler* result_handler() const { return result_handler_.get(); }
private:
- std::shared_ptr<WorkSerializer> work_serializer_;
+ std::shared_ptr<WorkSerializer> work_serializer_;
std::unique_ptr<ResultHandler> result_handler_;
};
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc
index 12f9c2ec826..43d638ab3f1 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc
@@ -24,16 +24,16 @@
#include <stdio.h>
#include <string.h>
-#include "y_absl/container/inlined_vector.h"
-#include "y_absl/strings/str_cat.h"
-
+#include "y_absl/container/inlined_vector.h"
+#include "y_absl/strings/str_cat.h"
+
#include <grpc/support/alloc.h>
#include <grpc/support/string_util.h>
#include <address_sorting/address_sorting.h>
#include "src/core/ext/filters/client_channel/http_connect_handshaker.h"
-#include "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.h"
+#include "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.h"
#include "src/core/ext/filters/client_channel/lb_policy_registry.h"
#include "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h"
#include "src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.h"
@@ -48,7 +48,7 @@
#include "src/core/lib/iomgr/iomgr_custom.h"
#include "src/core/lib/iomgr/resolve_address.h"
#include "src/core/lib/iomgr/timer.h"
-#include "src/core/lib/iomgr/work_serializer.h"
+#include "src/core/lib/iomgr/work_serializer.h"
#include "src/core/lib/json/json.h"
#define GRPC_DNS_INITIAL_CONNECT_BACKOFF_SECONDS 1
@@ -82,8 +82,8 @@ class AresDnsResolver : public Resolver {
static void OnNextResolution(void* arg, grpc_error* error);
static void OnResolved(void* arg, grpc_error* error);
- void OnNextResolutionLocked(grpc_error* error);
- void OnResolvedLocked(grpc_error* error);
+ void OnNextResolutionLocked(grpc_error* error);
+ void OnResolvedLocked(grpc_error* error);
/// DNS server to use (if not system default)
char* dns_server_;
@@ -95,7 +95,7 @@ class AresDnsResolver : public Resolver {
bool request_service_config_;
/// pollset_set to drive the name resolution process
grpc_pollset_set* interested_parties_;
- /// closures used by the work_serializer
+ /// closures used by the work_serializer
grpc_closure on_next_resolution_;
grpc_closure on_resolved_;
/// are we currently resolving?
@@ -111,10 +111,10 @@ class AresDnsResolver : public Resolver {
grpc_millis last_resolution_timestamp_ = -1;
/// retry backoff state
BackOff backoff_;
- /// currently resolving backend addresses
+ /// currently resolving backend addresses
std::unique_ptr<ServerAddressList> addresses_;
- /// currently resolving balancer addresses
- std::unique_ptr<ServerAddressList> balancer_addresses_;
+ /// currently resolving balancer addresses
+ std::unique_ptr<ServerAddressList> balancer_addresses_;
/// currently resolving service config
char* service_config_json_ = nullptr;
// has shutdown been initiated
@@ -126,7 +126,7 @@ class AresDnsResolver : public Resolver {
};
AresDnsResolver::AresDnsResolver(ResolverArgs args)
- : Resolver(std::move(args.work_serializer), std::move(args.result_handler)),
+ : Resolver(std::move(args.work_serializer), std::move(args.result_handler)),
backoff_(
BackOff::Options()
.set_initial_backoff(GRPC_DNS_INITIAL_CONNECT_BACKOFF_SECONDS *
@@ -134,10 +134,10 @@ AresDnsResolver::AresDnsResolver(ResolverArgs args)
.set_multiplier(GRPC_DNS_RECONNECT_BACKOFF_MULTIPLIER)
.set_jitter(GRPC_DNS_RECONNECT_JITTER)
.set_max_backoff(GRPC_DNS_RECONNECT_MAX_BACKOFF_SECONDS * 1000)) {
- // Closure Initialization
- GRPC_CLOSURE_INIT(&on_next_resolution_, OnNextResolution, this,
- grpc_schedule_on_exec_ctx);
- GRPC_CLOSURE_INIT(&on_resolved_, OnResolved, this, grpc_schedule_on_exec_ctx);
+ // Closure Initialization
+ GRPC_CLOSURE_INIT(&on_next_resolution_, OnNextResolution, this,
+ grpc_schedule_on_exec_ctx);
+ GRPC_CLOSURE_INIT(&on_resolved_, OnResolved, this, grpc_schedule_on_exec_ctx);
// Get name to resolve from URI path.
const char* path = args.uri->path;
if (path[0] == '/') ++path;
@@ -211,105 +211,105 @@ void AresDnsResolver::ShutdownLocked() {
void AresDnsResolver::OnNextResolution(void* arg, grpc_error* error) {
AresDnsResolver* r = static_cast<AresDnsResolver*>(arg);
- GRPC_ERROR_REF(error); // ref owned by lambda
- r->work_serializer()->Run([r, error]() { r->OnNextResolutionLocked(error); },
- DEBUG_LOCATION);
+ GRPC_ERROR_REF(error); // ref owned by lambda
+ r->work_serializer()->Run([r, error]() { r->OnNextResolutionLocked(error); },
+ DEBUG_LOCATION);
}
-void AresDnsResolver::OnNextResolutionLocked(grpc_error* error) {
+void AresDnsResolver::OnNextResolutionLocked(grpc_error* error) {
GRPC_CARES_TRACE_LOG(
"resolver:%p re-resolution timer fired. error: %s. shutdown_initiated_: "
"%d",
- this, grpc_error_string(error), shutdown_initiated_);
- have_next_resolution_timer_ = false;
- if (error == GRPC_ERROR_NONE && !shutdown_initiated_) {
- if (!resolving_) {
+ this, grpc_error_string(error), shutdown_initiated_);
+ have_next_resolution_timer_ = false;
+ if (error == GRPC_ERROR_NONE && !shutdown_initiated_) {
+ if (!resolving_) {
GRPC_CARES_TRACE_LOG(
- "resolver:%p start resolving due to re-resolution timer", this);
- StartResolvingLocked();
+ "resolver:%p start resolving due to re-resolution timer", this);
+ StartResolvingLocked();
}
}
- Unref(DEBUG_LOCATION, "next_resolution_timer");
- GRPC_ERROR_UNREF(error);
+ Unref(DEBUG_LOCATION, "next_resolution_timer");
+ GRPC_ERROR_UNREF(error);
}
-bool ValueInJsonArray(const Json::Array& array, const char* value) {
- for (const Json& entry : array) {
- if (entry.type() == Json::Type::STRING && entry.string_value() == value) {
+bool ValueInJsonArray(const Json::Array& array, const char* value) {
+ for (const Json& entry : array) {
+ if (entry.type() == Json::Type::STRING && entry.string_value() == value) {
return true;
}
}
return false;
}
-TString ChooseServiceConfig(char* service_config_choice_json,
- grpc_error** error) {
- Json json = Json::Parse(service_config_choice_json, error);
- if (*error != GRPC_ERROR_NONE) return "";
- if (json.type() != Json::Type::ARRAY) {
+TString ChooseServiceConfig(char* service_config_choice_json,
+ grpc_error** error) {
+ Json json = Json::Parse(service_config_choice_json, error);
+ if (*error != GRPC_ERROR_NONE) return "";
+ if (json.type() != Json::Type::ARRAY) {
*error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"Service Config Choices, error: should be of type array");
- return "";
+ return "";
}
- const Json* service_config = nullptr;
- y_absl::InlinedVector<grpc_error*, 4> error_list;
- for (const Json& choice : json.array_value()) {
- if (choice.type() != Json::Type::OBJECT) {
+ const Json* service_config = nullptr;
+ y_absl::InlinedVector<grpc_error*, 4> error_list;
+ for (const Json& choice : json.array_value()) {
+ if (choice.type() != Json::Type::OBJECT) {
error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"Service Config Choice, error: should be of type object"));
continue;
}
- // Check client language, if specified.
- auto it = choice.object_value().find("clientLanguage");
- if (it != choice.object_value().end()) {
- if (it->second.type() != Json::Type::ARRAY) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:clientLanguage error:should be of type array"));
- } else if (!ValueInJsonArray(it->second.array_value(), "c++")) {
- continue;
+ // Check client language, if specified.
+ auto it = choice.object_value().find("clientLanguage");
+ if (it != choice.object_value().end()) {
+ if (it->second.type() != Json::Type::ARRAY) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:clientLanguage error:should be of type array"));
+ } else if (!ValueInJsonArray(it->second.array_value(), "c++")) {
+ continue;
}
- }
- // Check client hostname, if specified.
- it = choice.object_value().find("clientHostname");
- if (it != choice.object_value().end()) {
- if (it->second.type() != Json::Type::ARRAY) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:clientHostname error:should be of type array"));
- } else {
- char* hostname = grpc_gethostname();
- if (hostname == nullptr ||
- !ValueInJsonArray(it->second.array_value(), hostname)) {
+ }
+ // Check client hostname, if specified.
+ it = choice.object_value().find("clientHostname");
+ if (it != choice.object_value().end()) {
+ if (it->second.type() != Json::Type::ARRAY) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:clientHostname error:should be of type array"));
+ } else {
+ char* hostname = grpc_gethostname();
+ if (hostname == nullptr ||
+ !ValueInJsonArray(it->second.array_value(), hostname)) {
continue;
}
}
- }
- // Check percentage, if specified.
- it = choice.object_value().find("percentage");
- if (it != choice.object_value().end()) {
- if (it->second.type() != Json::Type::NUMBER) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:percentage error:should be of type number"));
- } else {
+ }
+ // Check percentage, if specified.
+ it = choice.object_value().find("percentage");
+ if (it != choice.object_value().end()) {
+ if (it->second.type() != Json::Type::NUMBER) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:percentage error:should be of type number"));
+ } else {
int random_pct = rand() % 100;
int percentage;
- if (sscanf(it->second.string_value().c_str(), "%d", &percentage) != 1) {
+ if (sscanf(it->second.string_value().c_str(), "%d", &percentage) != 1) {
error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"field:percentage error:should be of type integer"));
- } else if (random_pct > percentage || percentage == 0) {
+ } else if (random_pct > percentage || percentage == 0) {
continue;
}
}
}
- // Found service config.
- it = choice.object_value().find("serviceConfig");
- if (it == choice.object_value().end()) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:serviceConfig error:required field missing"));
- } else if (it->second.type() != Json::Type::OBJECT) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:serviceConfig error:should be of type object"));
- } else if (service_config == nullptr) {
- service_config = &it->second;
+ // Found service config.
+ it = choice.object_value().find("serviceConfig");
+ if (it == choice.object_value().end()) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:serviceConfig error:required field missing"));
+ } else if (it->second.type() != Json::Type::OBJECT) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:serviceConfig error:should be of type object"));
+ } else if (service_config == nullptr) {
+ service_config = &it->second;
}
}
if (!error_list.empty()) {
@@ -317,87 +317,87 @@ TString ChooseServiceConfig(char* service_config_choice_json,
*error = GRPC_ERROR_CREATE_FROM_VECTOR("Service Config Choices Parser",
&error_list);
}
- if (service_config == nullptr) return "";
- return service_config->Dump();
+ if (service_config == nullptr) return "";
+ return service_config->Dump();
}
void AresDnsResolver::OnResolved(void* arg, grpc_error* error) {
AresDnsResolver* r = static_cast<AresDnsResolver*>(arg);
- GRPC_ERROR_REF(error); // ref owned by lambda
- r->work_serializer()->Run([r, error]() { r->OnResolvedLocked(error); },
- DEBUG_LOCATION);
+ GRPC_ERROR_REF(error); // ref owned by lambda
+ r->work_serializer()->Run([r, error]() { r->OnResolvedLocked(error); },
+ DEBUG_LOCATION);
}
-void AresDnsResolver::OnResolvedLocked(grpc_error* error) {
- GPR_ASSERT(resolving_);
- resolving_ = false;
- gpr_free(pending_request_);
- pending_request_ = nullptr;
- if (shutdown_initiated_) {
- Unref(DEBUG_LOCATION, "OnResolvedLocked() shutdown");
- GRPC_ERROR_UNREF(error);
+void AresDnsResolver::OnResolvedLocked(grpc_error* error) {
+ GPR_ASSERT(resolving_);
+ resolving_ = false;
+ gpr_free(pending_request_);
+ pending_request_ = nullptr;
+ if (shutdown_initiated_) {
+ Unref(DEBUG_LOCATION, "OnResolvedLocked() shutdown");
+ GRPC_ERROR_UNREF(error);
return;
}
- if (addresses_ != nullptr || balancer_addresses_ != nullptr) {
+ if (addresses_ != nullptr || balancer_addresses_ != nullptr) {
Result result;
- if (addresses_ != nullptr) {
- result.addresses = std::move(*addresses_);
- }
- if (service_config_json_ != nullptr) {
- TString service_config_string = ChooseServiceConfig(
- service_config_json_, &result.service_config_error);
- gpr_free(service_config_json_);
+ if (addresses_ != nullptr) {
+ result.addresses = std::move(*addresses_);
+ }
+ if (service_config_json_ != nullptr) {
+ TString service_config_string = ChooseServiceConfig(
+ service_config_json_, &result.service_config_error);
+ gpr_free(service_config_json_);
if (result.service_config_error == GRPC_ERROR_NONE &&
- !service_config_string.empty()) {
+ !service_config_string.empty()) {
GRPC_CARES_TRACE_LOG("resolver:%p selected service config choice: %s",
- this, service_config_string.c_str());
+ this, service_config_string.c_str());
result.service_config = ServiceConfig::Create(
- channel_args_, service_config_string, &result.service_config_error);
+ channel_args_, service_config_string, &result.service_config_error);
}
}
- y_absl::InlinedVector<grpc_arg, 1> new_args;
- if (balancer_addresses_ != nullptr) {
- new_args.push_back(
- CreateGrpclbBalancerAddressesArg(balancer_addresses_.get()));
- }
- result.args = grpc_channel_args_copy_and_add(channel_args_, new_args.data(),
- new_args.size());
- result_handler()->ReturnResult(std::move(result));
- addresses_.reset();
- balancer_addresses_.reset();
+ y_absl::InlinedVector<grpc_arg, 1> new_args;
+ if (balancer_addresses_ != nullptr) {
+ new_args.push_back(
+ CreateGrpclbBalancerAddressesArg(balancer_addresses_.get()));
+ }
+ result.args = grpc_channel_args_copy_and_add(channel_args_, new_args.data(),
+ new_args.size());
+ result_handler()->ReturnResult(std::move(result));
+ addresses_.reset();
+ balancer_addresses_.reset();
// Reset backoff state so that we start from the beginning when the
// next request gets triggered.
- backoff_.Reset();
+ backoff_.Reset();
} else {
- GRPC_CARES_TRACE_LOG("resolver:%p dns resolution failed: %s", this,
+ GRPC_CARES_TRACE_LOG("resolver:%p dns resolution failed: %s", this,
grpc_error_string(error));
- TString error_message =
- y_absl::StrCat("DNS resolution failed for service: ", name_to_resolve_);
- result_handler()->ReturnError(grpc_error_set_int(
- GRPC_ERROR_CREATE_REFERENCING_FROM_COPIED_STRING(error_message.c_str(),
- &error, 1),
+ TString error_message =
+ y_absl::StrCat("DNS resolution failed for service: ", name_to_resolve_);
+ result_handler()->ReturnError(grpc_error_set_int(
+ GRPC_ERROR_CREATE_REFERENCING_FROM_COPIED_STRING(error_message.c_str(),
+ &error, 1),
GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE));
// Set retry timer.
- grpc_millis next_try = backoff_.NextAttemptTime();
+ grpc_millis next_try = backoff_.NextAttemptTime();
grpc_millis timeout = next_try - ExecCtx::Get()->Now();
GRPC_CARES_TRACE_LOG("resolver:%p dns resolution failed (will retry): %s",
- this, grpc_error_string(error));
- GPR_ASSERT(!have_next_resolution_timer_);
- have_next_resolution_timer_ = true;
+ this, grpc_error_string(error));
+ GPR_ASSERT(!have_next_resolution_timer_);
+ have_next_resolution_timer_ = true;
// TODO(roth): We currently deal with this ref manually. Once the
// new closure API is done, find a way to track this ref with the timer
// callback as part of the type system.
- Ref(DEBUG_LOCATION, "retry-timer").release();
+ Ref(DEBUG_LOCATION, "retry-timer").release();
if (timeout > 0) {
GRPC_CARES_TRACE_LOG("resolver:%p retrying in %" PRId64 " milliseconds",
- this, timeout);
+ this, timeout);
} else {
- GRPC_CARES_TRACE_LOG("resolver:%p retrying immediately", this);
+ GRPC_CARES_TRACE_LOG("resolver:%p retrying immediately", this);
}
- grpc_timer_init(&next_resolution_timer_, next_try, &on_next_resolution_);
+ grpc_timer_init(&next_resolution_timer_, next_try, &on_next_resolution_);
}
- Unref(DEBUG_LOCATION, "dns-resolving");
- GRPC_ERROR_UNREF(error);
+ Unref(DEBUG_LOCATION, "dns-resolving");
+ GRPC_ERROR_UNREF(error);
}
void AresDnsResolver::MaybeStartResolvingLocked() {
@@ -440,10 +440,10 @@ void AresDnsResolver::StartResolvingLocked() {
service_config_json_ = nullptr;
pending_request_ = grpc_dns_lookup_ares_locked(
dns_server_, name_to_resolve_, kDefaultPort, interested_parties_,
- &on_resolved_, &addresses_,
- enable_srv_queries_ ? &balancer_addresses_ : nullptr,
+ &on_resolved_, &addresses_,
+ enable_srv_queries_ ? &balancer_addresses_ : nullptr,
request_service_config_ ? &service_config_json_ : nullptr,
- query_timeout_ms_, work_serializer());
+ query_timeout_ms_, work_serializer());
last_resolution_timestamp_ = grpc_core::ExecCtx::Get()->Now();
GRPC_CARES_TRACE_LOG("resolver:%p Started resolving. pending_request_:%p",
this, pending_request_);
@@ -514,7 +514,7 @@ void grpc_resolver_dns_ares_init() {
}
grpc_set_resolver_impl(&ares_resolver);
grpc_core::ResolverRegistry::Builder::RegisterResolverFactory(
- y_absl::make_unique<grpc_core::AresDnsResolverFactory>());
+ y_absl::make_unique<grpc_core::AresDnsResolverFactory>());
} else {
g_use_ares_dns_resolver = false;
}
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.cc
index 0c4b743672a..9e6bd876228 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.cc
@@ -23,8 +23,8 @@
#include <ares.h>
#include <string.h>
-#include "y_absl/strings/str_cat.h"
-
+#include "y_absl/strings/str_cat.h"
+
#include "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h"
#include <grpc/support/alloc.h>
@@ -67,8 +67,8 @@ struct grpc_ares_ev_driver {
/** refcount of the event driver */
gpr_refcount refs;
- /** work_serializer to synchronize c-ares and I/O callbacks on */
- std::shared_ptr<grpc_core::WorkSerializer> work_serializer;
+ /** work_serializer to synchronize c-ares and I/O callbacks on */
+ std::shared_ptr<grpc_core::WorkSerializer> work_serializer;
/** a list of grpc_fd that this event driver is currently using. */
fd_node* fds;
/** is this event driver currently working? */
@@ -133,22 +133,22 @@ static void fd_node_shutdown_locked(fd_node* fdn, const char* reason) {
}
static void on_timeout(void* arg, grpc_error* error);
-static void on_timeout_locked(grpc_ares_ev_driver* arg, grpc_error* error);
+static void on_timeout_locked(grpc_ares_ev_driver* arg, grpc_error* error);
static void on_ares_backup_poll_alarm(void* arg, grpc_error* error);
-static void on_ares_backup_poll_alarm_locked(grpc_ares_ev_driver* arg,
- grpc_error* error);
+static void on_ares_backup_poll_alarm_locked(grpc_ares_ev_driver* arg,
+ grpc_error* error);
static void noop_inject_channel_config(ares_channel /*channel*/) {}
void (*grpc_ares_test_only_inject_config)(ares_channel channel) =
noop_inject_channel_config;
-grpc_error* grpc_ares_ev_driver_create_locked(
- grpc_ares_ev_driver** ev_driver, grpc_pollset_set* pollset_set,
- int query_timeout_ms,
- std::shared_ptr<grpc_core::WorkSerializer> work_serializer,
- grpc_ares_request* request) {
+grpc_error* grpc_ares_ev_driver_create_locked(
+ grpc_ares_ev_driver** ev_driver, grpc_pollset_set* pollset_set,
+ int query_timeout_ms,
+ std::shared_ptr<grpc_core::WorkSerializer> work_serializer,
+ grpc_ares_request* request) {
*ev_driver = new grpc_ares_ev_driver();
ares_options opts;
memset(&opts, 0, sizeof(opts));
@@ -157,14 +157,14 @@ grpc_error* grpc_ares_ev_driver_create_locked(
grpc_ares_test_only_inject_config((*ev_driver)->channel);
GRPC_CARES_TRACE_LOG("request:%p grpc_ares_ev_driver_create_locked", request);
if (status != ARES_SUCCESS) {
- grpc_error* err = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("Failed to init ares channel. C-ares error: ",
- ares_strerror(status))
- .c_str());
+ grpc_error* err = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrCat("Failed to init ares channel. C-ares error: ",
+ ares_strerror(status))
+ .c_str());
gpr_free(*ev_driver);
return err;
}
- (*ev_driver)->work_serializer = std::move(work_serializer);
+ (*ev_driver)->work_serializer = std::move(work_serializer);
gpr_ref_init(&(*ev_driver)->refs, 1);
(*ev_driver)->pollset_set = pollset_set;
(*ev_driver)->fds = nullptr;
@@ -172,7 +172,7 @@ grpc_error* grpc_ares_ev_driver_create_locked(
(*ev_driver)->shutting_down = false;
(*ev_driver)->request = request;
(*ev_driver)->polled_fd_factory =
- grpc_core::NewGrpcPolledFdFactory((*ev_driver)->work_serializer);
+ grpc_core::NewGrpcPolledFdFactory((*ev_driver)->work_serializer);
(*ev_driver)
->polled_fd_factory->ConfigureAresChannelLocked((*ev_driver)->channel);
(*ev_driver)->query_timeout_ms = query_timeout_ms;
@@ -234,12 +234,12 @@ static grpc_millis calculate_next_ares_backup_poll_alarm_ms(
static void on_timeout(void* arg, grpc_error* error) {
grpc_ares_ev_driver* driver = static_cast<grpc_ares_ev_driver*>(arg);
- GRPC_ERROR_REF(error); // ref owned by lambda
- driver->work_serializer->Run(
- [driver, error]() { on_timeout_locked(driver, error); }, DEBUG_LOCATION);
+ GRPC_ERROR_REF(error); // ref owned by lambda
+ driver->work_serializer->Run(
+ [driver, error]() { on_timeout_locked(driver, error); }, DEBUG_LOCATION);
}
-static void on_timeout_locked(grpc_ares_ev_driver* driver, grpc_error* error) {
+static void on_timeout_locked(grpc_ares_ev_driver* driver, grpc_error* error) {
GRPC_CARES_TRACE_LOG(
"request:%p ev_driver=%p on_timeout_locked. driver->shutting_down=%d. "
"err=%s",
@@ -248,15 +248,15 @@ static void on_timeout_locked(grpc_ares_ev_driver* driver, grpc_error* error) {
grpc_ares_ev_driver_shutdown_locked(driver);
}
grpc_ares_ev_driver_unref(driver);
- GRPC_ERROR_UNREF(error);
+ GRPC_ERROR_UNREF(error);
}
static void on_ares_backup_poll_alarm(void* arg, grpc_error* error) {
grpc_ares_ev_driver* driver = static_cast<grpc_ares_ev_driver*>(arg);
- GRPC_ERROR_REF(error);
- driver->work_serializer->Run(
- [driver, error]() { on_ares_backup_poll_alarm_locked(driver, error); },
- DEBUG_LOCATION);
+ GRPC_ERROR_REF(error);
+ driver->work_serializer->Run(
+ [driver, error]() { on_ares_backup_poll_alarm_locked(driver, error); },
+ DEBUG_LOCATION);
}
/* In case of non-responsive DNS servers, dropped packets, etc., c-ares has
@@ -267,8 +267,8 @@ static void on_ares_backup_poll_alarm(void* arg, grpc_error* error) {
* b) when some time has passed without fd events having happened
* For the latter, we use this backup poller. Also see
* https://github.com/grpc/grpc/pull/17688 description for more details. */
-static void on_ares_backup_poll_alarm_locked(grpc_ares_ev_driver* driver,
- grpc_error* error) {
+static void on_ares_backup_poll_alarm_locked(grpc_ares_ev_driver* driver,
+ grpc_error* error) {
GRPC_CARES_TRACE_LOG(
"request:%p ev_driver=%p on_ares_backup_poll_alarm_locked. "
"driver->shutting_down=%d. "
@@ -301,10 +301,10 @@ static void on_ares_backup_poll_alarm_locked(grpc_ares_ev_driver* driver,
grpc_ares_notify_on_event_locked(driver);
}
grpc_ares_ev_driver_unref(driver);
- GRPC_ERROR_UNREF(error);
+ GRPC_ERROR_UNREF(error);
}
-static void on_readable_locked(fd_node* fdn, grpc_error* error) {
+static void on_readable_locked(fd_node* fdn, grpc_error* error) {
GPR_ASSERT(fdn->readable_registered);
grpc_ares_ev_driver* ev_driver = fdn->ev_driver;
const ares_socket_t as = fdn->grpc_polled_fd->GetWrappedAresSocketLocked();
@@ -326,17 +326,17 @@ static void on_readable_locked(fd_node* fdn, grpc_error* error) {
}
grpc_ares_notify_on_event_locked(ev_driver);
grpc_ares_ev_driver_unref(ev_driver);
- GRPC_ERROR_UNREF(error);
+ GRPC_ERROR_UNREF(error);
}
static void on_readable(void* arg, grpc_error* error) {
fd_node* fdn = static_cast<fd_node*>(arg);
- GRPC_ERROR_REF(error); /* ref owned by lambda */
- fdn->ev_driver->work_serializer->Run(
- [fdn, error]() { on_readable_locked(fdn, error); }, DEBUG_LOCATION);
+ GRPC_ERROR_REF(error); /* ref owned by lambda */
+ fdn->ev_driver->work_serializer->Run(
+ [fdn, error]() { on_readable_locked(fdn, error); }, DEBUG_LOCATION);
}
-static void on_writable_locked(fd_node* fdn, grpc_error* error) {
+static void on_writable_locked(fd_node* fdn, grpc_error* error) {
GPR_ASSERT(fdn->writable_registered);
grpc_ares_ev_driver* ev_driver = fdn->ev_driver;
const ares_socket_t as = fdn->grpc_polled_fd->GetWrappedAresSocketLocked();
@@ -356,14 +356,14 @@ static void on_writable_locked(fd_node* fdn, grpc_error* error) {
}
grpc_ares_notify_on_event_locked(ev_driver);
grpc_ares_ev_driver_unref(ev_driver);
- GRPC_ERROR_UNREF(error);
+ GRPC_ERROR_UNREF(error);
}
static void on_writable(void* arg, grpc_error* error) {
fd_node* fdn = static_cast<fd_node*>(arg);
- GRPC_ERROR_REF(error); /* ref owned by lambda */
- fdn->ev_driver->work_serializer->Run(
- [fdn, error]() { on_writable_locked(fdn, error); }, DEBUG_LOCATION);
+ GRPC_ERROR_REF(error); /* ref owned by lambda */
+ fdn->ev_driver->work_serializer->Run(
+ [fdn, error]() { on_writable_locked(fdn, error); }, DEBUG_LOCATION);
}
ares_channel* grpc_ares_ev_driver_get_channel_locked(
@@ -388,7 +388,7 @@ static void grpc_ares_notify_on_event_locked(grpc_ares_ev_driver* ev_driver) {
fdn = static_cast<fd_node*>(gpr_malloc(sizeof(fd_node)));
fdn->grpc_polled_fd =
ev_driver->polled_fd_factory->NewGrpcPolledFdLocked(
- socks[i], ev_driver->pollset_set, ev_driver->work_serializer);
+ socks[i], ev_driver->pollset_set, ev_driver->work_serializer);
GRPC_CARES_TRACE_LOG("request:%p new fd: %s", ev_driver->request,
fdn->grpc_polled_fd->GetName());
fdn->ev_driver = ev_driver;
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h
index 1569a6dbf5a..cedf0c39709 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h
@@ -40,11 +40,11 @@ ares_channel* grpc_ares_ev_driver_get_channel_locked(
/* Creates a new grpc_ares_ev_driver. Returns GRPC_ERROR_NONE if \a ev_driver is
created successfully. */
-grpc_error* grpc_ares_ev_driver_create_locked(
- grpc_ares_ev_driver** ev_driver, grpc_pollset_set* pollset_set,
- int query_timeout_ms,
- std::shared_ptr<grpc_core::WorkSerializer> work_serializer,
- grpc_ares_request* request);
+grpc_error* grpc_ares_ev_driver_create_locked(
+ grpc_ares_ev_driver** ev_driver, grpc_pollset_set* pollset_set,
+ int query_timeout_ms,
+ std::shared_ptr<grpc_core::WorkSerializer> work_serializer,
+ grpc_ares_request* request);
/* Called back when all DNS lookups have completed. */
void grpc_ares_ev_driver_on_queries_complete_locked(
@@ -90,13 +90,13 @@ class GrpcPolledFdFactory {
/* Creates a new wrapped fd for the current platform */
virtual GrpcPolledFd* NewGrpcPolledFdLocked(
ares_socket_t as, grpc_pollset_set* driver_pollset_set,
- std::shared_ptr<grpc_core::WorkSerializer> work_serializer) = 0;
+ std::shared_ptr<grpc_core::WorkSerializer> work_serializer) = 0;
/* Optionally configures the ares channel after creation */
virtual void ConfigureAresChannelLocked(ares_channel channel) = 0;
};
-std::unique_ptr<GrpcPolledFdFactory> NewGrpcPolledFdFactory(
- std::shared_ptr<grpc_core::WorkSerializer> work_serializer);
+std::unique_ptr<GrpcPolledFdFactory> NewGrpcPolledFdFactory(
+ std::shared_ptr<grpc_core::WorkSerializer> work_serializer);
} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_libuv.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_libuv.cc
index f9a2cbf8cbc..36d4b24c65c 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_libuv.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_libuv.cc
@@ -20,8 +20,8 @@
#include "src/core/lib/iomgr/port.h"
#if GRPC_ARES == 1 && defined(GRPC_UV)
-#include "y_absl/strings/str_format.h"
-
+#include "y_absl/strings/str_format.h"
+
#include <ares.h>
#error #include <uv.h>
@@ -33,7 +33,7 @@
#include <grpc/support/time.h>
#include "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h"
#include "src/core/lib/gpr/string.h"
-#include "src/core/lib/iomgr/work_serializer.h"
+#include "src/core/lib/iomgr/work_serializer.h"
namespace grpc_core {
@@ -43,11 +43,11 @@ void ares_uv_poll_close_cb(uv_handle_t* handle) { delete handle; }
class GrpcPolledFdLibuv : public GrpcPolledFd {
public:
- GrpcPolledFdLibuv(ares_socket_t as,
- std::shared_ptr<WorkSerializer> work_serializer)
- : name_(y_absl::StrFormat("c-ares socket: %" PRIdPTR, (intptr_t)as)),
- as_(as),
- work_serializer_(std::move(work_serializer)) {
+ GrpcPolledFdLibuv(ares_socket_t as,
+ std::shared_ptr<WorkSerializer> work_serializer)
+ : name_(y_absl::StrFormat("c-ares socket: %" PRIdPTR, (intptr_t)as)),
+ as_(as),
+ work_serializer_(std::move(work_serializer)) {
handle_ = new uv_poll_t();
uv_poll_init_socket(uv_default_loop(), handle_, as);
handle_->data = this;
@@ -99,16 +99,16 @@ class GrpcPolledFdLibuv : public GrpcPolledFd {
ares_socket_t GetWrappedAresSocketLocked() override { return as_; }
- const char* GetName() override { return name_.c_str(); }
+ const char* GetName() override { return name_.c_str(); }
- // TODO(apolcyn): Data members should be private.
- TString name_;
+ // TODO(apolcyn): Data members should be private.
+ TString name_;
ares_socket_t as_;
uv_poll_t* handle_;
grpc_closure* read_closure_ = nullptr;
grpc_closure* write_closure_ = nullptr;
int poll_events_ = 0;
- std::shared_ptr<WorkSerializer> work_serializer_;
+ std::shared_ptr<WorkSerializer> work_serializer_;
};
struct AresUvPollCbArg {
@@ -120,14 +120,14 @@ struct AresUvPollCbArg {
int events;
};
-static void ares_uv_poll_cb_locked(AresUvPollCbArg* arg) {
- std::unique_ptr<AresUvPollCbArg> arg_struct(arg);
+static void ares_uv_poll_cb_locked(AresUvPollCbArg* arg) {
+ std::unique_ptr<AresUvPollCbArg> arg_struct(arg);
uv_poll_t* handle = arg_struct->handle;
int status = arg_struct->status;
int events = arg_struct->events;
GrpcPolledFdLibuv* polled_fd =
reinterpret_cast<GrpcPolledFdLibuv*>(handle->data);
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error* error = GRPC_ERROR_NONE;
if (status < 0) {
error = GRPC_ERROR_CREATE_FROM_STATIC_STRING("cares polling error");
error =
@@ -154,24 +154,24 @@ void ares_uv_poll_cb(uv_poll_t* handle, int status, int events) {
GrpcPolledFdLibuv* polled_fd =
reinterpret_cast<GrpcPolledFdLibuv*>(handle->data);
AresUvPollCbArg* arg = new AresUvPollCbArg(handle, status, events);
- polled_fd->work_serializer_->Run([arg]() { ares_uv_poll_cb_locked(arg); },
- DEBUG_LOCATION);
+ polled_fd->work_serializer_->Run([arg]() { ares_uv_poll_cb_locked(arg); },
+ DEBUG_LOCATION);
}
class GrpcPolledFdFactoryLibuv : public GrpcPolledFdFactory {
public:
- GrpcPolledFd* NewGrpcPolledFdLocked(
- ares_socket_t as, grpc_pollset_set* driver_pollset_set,
- std::shared_ptr<WorkSerializer> work_serializer) override {
- return new GrpcPolledFdLibuv(as, std::move(work_serializer));
+ GrpcPolledFd* NewGrpcPolledFdLocked(
+ ares_socket_t as, grpc_pollset_set* driver_pollset_set,
+ std::shared_ptr<WorkSerializer> work_serializer) override {
+ return new GrpcPolledFdLibuv(as, std::move(work_serializer));
}
void ConfigureAresChannelLocked(ares_channel channel) override {}
};
std::unique_ptr<GrpcPolledFdFactory> NewGrpcPolledFdFactory(
- std::shared_ptr<WorkSerializer> work_serializer) {
- return y_absl::make_unique<GrpcPolledFdFactoryLibuv>();
+ std::shared_ptr<WorkSerializer> work_serializer) {
+ return y_absl::make_unique<GrpcPolledFdFactoryLibuv>();
}
} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc
index a582c362c77..e1fcaa5090c 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc
@@ -24,8 +24,8 @@
#include <string.h>
#include <sys/ioctl.h>
-#include "y_absl/strings/str_cat.h"
-
+#include "y_absl/strings/str_cat.h"
+
#include "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h"
#include <grpc/support/alloc.h>
@@ -43,8 +43,8 @@ namespace grpc_core {
class GrpcPolledFdPosix : public GrpcPolledFd {
public:
GrpcPolledFdPosix(ares_socket_t as, grpc_pollset_set* driver_pollset_set)
- : name_(y_absl::StrCat("c-ares fd: ", (int)as)), as_(as) {
- fd_ = grpc_fd_create((int)as, name_.c_str(), false);
+ : name_(y_absl::StrCat("c-ares fd: ", (int)as)), as_(as) {
+ fd_ = grpc_fd_create((int)as, name_.c_str(), false);
driver_pollset_set_ = driver_pollset_set;
grpc_pollset_set_add_fd(driver_pollset_set_, fd_);
}
@@ -78,10 +78,10 @@ class GrpcPolledFdPosix : public GrpcPolledFd {
ares_socket_t GetWrappedAresSocketLocked() override { return as_; }
- const char* GetName() override { return name_.c_str(); }
+ const char* GetName() override { return name_.c_str(); }
- private:
- TString name_;
+ private:
+ TString name_;
ares_socket_t as_;
grpc_fd* fd_;
grpc_pollset_set* driver_pollset_set_;
@@ -89,9 +89,9 @@ class GrpcPolledFdPosix : public GrpcPolledFd {
class GrpcPolledFdFactoryPosix : public GrpcPolledFdFactory {
public:
- GrpcPolledFd* NewGrpcPolledFdLocked(
- ares_socket_t as, grpc_pollset_set* driver_pollset_set,
- std::shared_ptr<WorkSerializer> /*work_serializer*/) override {
+ GrpcPolledFd* NewGrpcPolledFdLocked(
+ ares_socket_t as, grpc_pollset_set* driver_pollset_set,
+ std::shared_ptr<WorkSerializer> /*work_serializer*/) override {
return new GrpcPolledFdPosix(as, driver_pollset_set);
}
@@ -99,9 +99,9 @@ class GrpcPolledFdFactoryPosix : public GrpcPolledFdFactory {
};
std::unique_ptr<GrpcPolledFdFactory> NewGrpcPolledFdFactory(
- std::shared_ptr<WorkSerializer> work_serializer) {
- (void)work_serializer;
- return y_absl::make_unique<GrpcPolledFdFactoryPosix>();
+ std::shared_ptr<WorkSerializer> work_serializer) {
+ (void)work_serializer;
+ return y_absl::make_unique<GrpcPolledFdFactoryPosix>();
}
} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc
index 659b78f1776..e228469517b 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc
@@ -20,8 +20,8 @@
#include "src/core/lib/iomgr/port.h"
#if GRPC_ARES == 1 && defined(GRPC_WINDOWS_SOCKET_ARES_EV_DRIVER)
-#include "y_absl/strings/str_format.h"
-
+#include "y_absl/strings/str_format.h"
+
#include <ares.h>
#include <grpc/support/alloc.h>
@@ -37,7 +37,7 @@
#include "src/core/lib/iomgr/sockaddr_windows.h"
#include "src/core/lib/iomgr/socket_windows.h"
#include "src/core/lib/iomgr/tcp_windows.h"
-#include "src/core/lib/iomgr/work_serializer.h"
+#include "src/core/lib/iomgr/work_serializer.h"
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h"
@@ -99,28 +99,28 @@ class GrpcPolledFdWindows {
WRITE_WAITING_FOR_VERIFICATION_UPON_RETRY,
};
- GrpcPolledFdWindows(ares_socket_t as,
- std::shared_ptr<WorkSerializer> work_serializer,
- int address_family, int socket_type)
- : work_serializer_(std::move(work_serializer)),
- read_buf_(grpc_empty_slice()),
+ GrpcPolledFdWindows(ares_socket_t as,
+ std::shared_ptr<WorkSerializer> work_serializer,
+ int address_family, int socket_type)
+ : work_serializer_(std::move(work_serializer)),
+ read_buf_(grpc_empty_slice()),
write_buf_(grpc_empty_slice()),
tcp_write_state_(WRITE_IDLE),
- name_(y_absl::StrFormat("c-ares socket: %" PRIdPTR, as)),
+ name_(y_absl::StrFormat("c-ares socket: %" PRIdPTR, as)),
gotten_into_driver_list_(false),
address_family_(address_family),
socket_type_(socket_type) {
- // Closure Initialization
- GRPC_CLOSURE_INIT(&outer_read_closure_,
- &GrpcPolledFdWindows::OnIocpReadable, this,
- grpc_schedule_on_exec_ctx);
- GRPC_CLOSURE_INIT(&outer_write_closure_,
- &GrpcPolledFdWindows::OnIocpWriteable, this,
- grpc_schedule_on_exec_ctx);
- GRPC_CLOSURE_INIT(&on_tcp_connect_locked_,
- &GrpcPolledFdWindows::OnTcpConnect, this,
- grpc_schedule_on_exec_ctx);
- winsocket_ = grpc_winsocket_create(as, name_.c_str());
+ // Closure Initialization
+ GRPC_CLOSURE_INIT(&outer_read_closure_,
+ &GrpcPolledFdWindows::OnIocpReadable, this,
+ grpc_schedule_on_exec_ctx);
+ GRPC_CLOSURE_INIT(&outer_write_closure_,
+ &GrpcPolledFdWindows::OnIocpWriteable, this,
+ grpc_schedule_on_exec_ctx);
+ GRPC_CLOSURE_INIT(&on_tcp_connect_locked_,
+ &GrpcPolledFdWindows::OnTcpConnect, this,
+ grpc_schedule_on_exec_ctx);
+ winsocket_ = grpc_winsocket_create(as, name_.c_str());
}
~GrpcPolledFdWindows() {
@@ -149,15 +149,15 @@ class GrpcPolledFdWindows {
GPR_ASSERT(!read_buf_has_data_);
read_buf_ = GRPC_SLICE_MALLOC(4192);
if (connect_done_) {
- work_serializer_->Run([this]() { ContinueRegisterForOnReadableLocked(); },
- DEBUG_LOCATION);
+ work_serializer_->Run([this]() { ContinueRegisterForOnReadableLocked(); },
+ DEBUG_LOCATION);
} else {
- GPR_ASSERT(pending_continue_register_for_on_readable_locked_ == false);
- pending_continue_register_for_on_readable_locked_ = true;
+ GPR_ASSERT(pending_continue_register_for_on_readable_locked_ == false);
+ pending_continue_register_for_on_readable_locked_ = true;
}
}
- void ContinueRegisterForOnReadableLocked() {
+ void ContinueRegisterForOnReadableLocked() {
GRPC_CARES_TRACE_LOG(
"fd:|%s| InnerContinueRegisterForOnReadableLocked "
"wsa_connect_error_:%d",
@@ -190,7 +190,7 @@ class GrpcPolledFdWindows {
return;
}
}
- grpc_socket_notify_on_read(winsocket_, &outer_read_closure_);
+ grpc_socket_notify_on_read(winsocket_, &outer_read_closure_);
}
void RegisterForOnWriteableLocked(grpc_closure* write_closure) {
@@ -206,15 +206,15 @@ class GrpcPolledFdWindows {
GPR_ASSERT(write_closure_ == nullptr);
write_closure_ = write_closure;
if (connect_done_) {
- work_serializer_->Run(
- [this]() { ContinueRegisterForOnWriteableLocked(); }, DEBUG_LOCATION);
+ work_serializer_->Run(
+ [this]() { ContinueRegisterForOnWriteableLocked(); }, DEBUG_LOCATION);
} else {
- GPR_ASSERT(pending_continue_register_for_on_writeable_locked_ == false);
- pending_continue_register_for_on_writeable_locked_ = true;
+ GPR_ASSERT(pending_continue_register_for_on_writeable_locked_ == false);
+ pending_continue_register_for_on_writeable_locked_ = true;
}
}
- void ContinueRegisterForOnWriteableLocked() {
+ void ContinueRegisterForOnWriteableLocked() {
GRPC_CARES_TRACE_LOG(
"fd:|%s| InnerContinueRegisterForOnWriteableLocked "
"wsa_connect_error_:%d",
@@ -241,7 +241,7 @@ class GrpcPolledFdWindows {
ScheduleAndNullWriteClosure(
GRPC_WSA_ERROR(wsa_error_code, "WSASend (overlapped)"));
} else {
- grpc_socket_notify_on_write(winsocket_, &outer_write_closure_);
+ grpc_socket_notify_on_write(winsocket_, &outer_write_closure_);
}
break;
case WRITE_PENDING:
@@ -261,7 +261,7 @@ class GrpcPolledFdWindows {
return grpc_winsocket_wrapped_socket(winsocket_);
}
- const char* GetName() { return name_.c_str(); }
+ const char* GetName() { return name_.c_str(); }
ares_ssize_t RecvFrom(WSAErrorContext* wsa_error_ctx, void* data,
ares_socket_t data_len, int flags,
@@ -421,19 +421,19 @@ class GrpcPolledFdWindows {
static void OnTcpConnect(void* arg, grpc_error* error) {
GrpcPolledFdWindows* grpc_polled_fd =
static_cast<GrpcPolledFdWindows*>(arg);
- GRPC_ERROR_REF(error); // ref owned by lambda
- grpc_polled_fd->work_serializer_->Run(
- [grpc_polled_fd, error]() {
- grpc_polled_fd->OnTcpConnectLocked(error);
- },
- DEBUG_LOCATION);
+ GRPC_ERROR_REF(error); // ref owned by lambda
+ grpc_polled_fd->work_serializer_->Run(
+ [grpc_polled_fd, error]() {
+ grpc_polled_fd->OnTcpConnectLocked(error);
+ },
+ DEBUG_LOCATION);
}
- void OnTcpConnectLocked(grpc_error* error) {
+ void OnTcpConnectLocked(grpc_error* error) {
GRPC_CARES_TRACE_LOG(
"fd:%s InnerOnTcpConnectLocked error:|%s| "
- "pending_register_for_readable:%d"
- " pending_register_for_writeable:%d",
+ "pending_register_for_readable:%d"
+ " pending_register_for_writeable:%d",
GetName(), grpc_error_string(error),
pending_continue_register_for_on_readable_locked_,
pending_continue_register_for_on_writeable_locked_);
@@ -462,15 +462,15 @@ class GrpcPolledFdWindows {
// this fd to abort.
wsa_connect_error_ = WSA_OPERATION_ABORTED;
}
- if (pending_continue_register_for_on_readable_locked_) {
- work_serializer_->Run([this]() { ContinueRegisterForOnReadableLocked(); },
- DEBUG_LOCATION);
+ if (pending_continue_register_for_on_readable_locked_) {
+ work_serializer_->Run([this]() { ContinueRegisterForOnReadableLocked(); },
+ DEBUG_LOCATION);
}
- if (pending_continue_register_for_on_writeable_locked_) {
- work_serializer_->Run(
- [this]() { ContinueRegisterForOnWriteableLocked(); }, DEBUG_LOCATION);
+ if (pending_continue_register_for_on_writeable_locked_) {
+ work_serializer_->Run(
+ [this]() { ContinueRegisterForOnWriteableLocked(); }, DEBUG_LOCATION);
}
- GRPC_ERROR_UNREF(error);
+ GRPC_ERROR_UNREF(error);
}
int Connect(WSAErrorContext* wsa_error_ctx, const struct sockaddr* target,
@@ -576,10 +576,10 @@ class GrpcPolledFdWindows {
static void OnIocpReadable(void* arg, grpc_error* error) {
GrpcPolledFdWindows* polled_fd = static_cast<GrpcPolledFdWindows*>(arg);
- GRPC_ERROR_REF(error); // ref owned by lambda
- polled_fd->work_serializer_->Run(
- [polled_fd, error]() { polled_fd->OnIocpReadableLocked(error); },
- DEBUG_LOCATION);
+ GRPC_ERROR_REF(error); // ref owned by lambda
+ polled_fd->work_serializer_->Run(
+ [polled_fd, error]() { polled_fd->OnIocpReadableLocked(error); },
+ DEBUG_LOCATION);
}
// TODO(apolcyn): improve this error handling to be less conversative.
@@ -587,7 +587,7 @@ class GrpcPolledFdWindows {
// c-ares reads from this socket later, but it shouldn't necessarily cancel
// the entire resolution attempt. Doing so will allow the "inject broken
// nameserver list" test to pass on Windows.
- void OnIocpReadableLocked(grpc_error* error) {
+ void OnIocpReadableLocked(grpc_error* error) {
if (error == GRPC_ERROR_NONE) {
if (winsocket_->read_info.wsa_error != 0) {
/* WSAEMSGSIZE would be due to receiving more data
@@ -621,13 +621,13 @@ class GrpcPolledFdWindows {
static void OnIocpWriteable(void* arg, grpc_error* error) {
GrpcPolledFdWindows* polled_fd = static_cast<GrpcPolledFdWindows*>(arg);
- GRPC_ERROR_REF(error); // error owned by lambda
- polled_fd->work_serializer_->Run(
- [polled_fd, error]() { polled_fd->OnIocpWriteableLocked(error); },
- DEBUG_LOCATION);
+ GRPC_ERROR_REF(error); // error owned by lambda
+ polled_fd->work_serializer_->Run(
+ [polled_fd, error]() { polled_fd->OnIocpWriteableLocked(error); },
+ DEBUG_LOCATION);
}
- void OnIocpWriteableLocked(grpc_error* error) {
+ void OnIocpWriteableLocked(grpc_error* error) {
GRPC_CARES_TRACE_LOG("OnIocpWriteableInner. fd:|%s|", GetName());
GPR_ASSERT(socket_type_ == SOCK_STREAM);
if (error == GRPC_ERROR_NONE) {
@@ -658,8 +658,8 @@ class GrpcPolledFdWindows {
bool gotten_into_driver_list() const { return gotten_into_driver_list_; }
void set_gotten_into_driver_list() { gotten_into_driver_list_ = true; }
- private:
- std::shared_ptr<WorkSerializer> work_serializer_;
+ private:
+ std::shared_ptr<WorkSerializer> work_serializer_;
char recv_from_source_addr_[200];
ares_socklen_t recv_from_source_addr_len_;
grpc_slice read_buf_;
@@ -672,7 +672,7 @@ class GrpcPolledFdWindows {
grpc_winsocket* winsocket_;
// tcp_write_state_ is only used on TCP GrpcPolledFds
WriteState tcp_write_state_;
- TString name_;
+ TString name_;
bool gotten_into_driver_list_;
int address_family_;
int socket_type_;
@@ -682,8 +682,8 @@ class GrpcPolledFdWindows {
// We don't run register_for_{readable,writeable} logic until
// a socket is connected. In the interim, we queue readable/writeable
// registrations with the following state.
- bool pending_continue_register_for_on_readable_locked_ = false;
- bool pending_continue_register_for_on_writeable_locked_ = false;
+ bool pending_continue_register_for_on_readable_locked_ = false;
+ bool pending_continue_register_for_on_writeable_locked_ = false;
};
struct SockToPolledFdEntry {
@@ -701,10 +701,10 @@ struct SockToPolledFdEntry {
* with a GrpcPolledFdWindows factory and event driver */
class SockToPolledFdMap {
public:
- explicit SockToPolledFdMap(std::shared_ptr<WorkSerializer> work_serializer)
- : work_serializer_(std::move(work_serializer)) {}
+ explicit SockToPolledFdMap(std::shared_ptr<WorkSerializer> work_serializer)
+ : work_serializer_(std::move(work_serializer)) {}
- ~SockToPolledFdMap() { GPR_ASSERT(head_ == nullptr); }
+ ~SockToPolledFdMap() { GPR_ASSERT(head_ == nullptr); }
void AddNewSocket(SOCKET s, GrpcPolledFdWindows* polled_fd) {
SockToPolledFdEntry* new_node = new SockToPolledFdEntry(s, polled_fd);
@@ -760,7 +760,7 @@ class SockToPolledFdMap {
}
grpc_tcp_set_non_block(s);
GrpcPolledFdWindows* polled_fd =
- new GrpcPolledFdWindows(s, map->work_serializer_, af, type);
+ new GrpcPolledFdWindows(s, map->work_serializer_, af, type);
GRPC_CARES_TRACE_LOG(
"fd:|%s| created with params af:%d type:%d protocol:%d",
polled_fd->GetName(), af, type, protocol);
@@ -816,7 +816,7 @@ class SockToPolledFdMap {
private:
SockToPolledFdEntry* head_ = nullptr;
- std::shared_ptr<WorkSerializer> work_serializer_;
+ std::shared_ptr<WorkSerializer> work_serializer_;
};
const struct ares_socket_functions custom_ares_sock_funcs = {
@@ -832,7 +832,7 @@ const struct ares_socket_functions custom_ares_sock_funcs = {
so that c-ares can close it via usual socket teardown. */
class GrpcPolledFdWindowsWrapper : public GrpcPolledFd {
public:
- explicit GrpcPolledFdWindowsWrapper(GrpcPolledFdWindows* wrapped)
+ explicit GrpcPolledFdWindowsWrapper(GrpcPolledFdWindows* wrapped)
: wrapped_(wrapped) {}
~GrpcPolledFdWindowsWrapper() {}
@@ -865,13 +865,13 @@ class GrpcPolledFdWindowsWrapper : public GrpcPolledFd {
class GrpcPolledFdFactoryWindows : public GrpcPolledFdFactory {
public:
- explicit GrpcPolledFdFactoryWindows(
- std::shared_ptr<WorkSerializer> work_serializer)
- : sock_to_polled_fd_map_(std::move(work_serializer)) {}
+ explicit GrpcPolledFdFactoryWindows(
+ std::shared_ptr<WorkSerializer> work_serializer)
+ : sock_to_polled_fd_map_(std::move(work_serializer)) {}
- GrpcPolledFd* NewGrpcPolledFdLocked(
- ares_socket_t as, grpc_pollset_set* driver_pollset_set,
- std::shared_ptr<WorkSerializer> work_serializer) override {
+ GrpcPolledFd* NewGrpcPolledFdLocked(
+ ares_socket_t as, grpc_pollset_set* driver_pollset_set,
+ std::shared_ptr<WorkSerializer> work_serializer) override {
GrpcPolledFdWindows* polled_fd = sock_to_polled_fd_map_.LookupPolledFd(as);
// Set a flag so that the virtual socket "close" method knows it
// doesn't need to call ShutdownLocked, since now the driver will.
@@ -889,9 +889,9 @@ class GrpcPolledFdFactoryWindows : public GrpcPolledFdFactory {
};
std::unique_ptr<GrpcPolledFdFactory> NewGrpcPolledFdFactory(
- std::shared_ptr<WorkSerializer> work_serializer) {
- return y_absl::make_unique<GrpcPolledFdFactoryWindows>(
- std::move(work_serializer));
+ std::shared_ptr<WorkSerializer> work_serializer) {
+ return y_absl::make_unique<GrpcPolledFdFactoryWindows>(
+ std::move(work_serializer));
}
} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc
index 5c651681ed7..c3b236af689 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc
@@ -26,10 +26,10 @@
#include <string.h>
#include <sys/types.h>
-#include "y_absl/container/inlined_vector.h"
-#include "y_absl/strings/str_cat.h"
-#include "y_absl/strings/str_format.h"
-
+#include "y_absl/container/inlined_vector.h"
+#include "y_absl/strings/str_cat.h"
+#include "y_absl/strings/str_format.h"
+
#include <ares.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
@@ -44,9 +44,9 @@
#include "src/core/lib/iomgr/executor.h"
#include "src/core/lib/iomgr/iomgr_internal.h"
#include "src/core/lib/iomgr/nameser.h"
-#include "src/core/lib/iomgr/parse_address.h"
+#include "src/core/lib/iomgr/parse_address.h"
#include "src/core/lib/iomgr/sockaddr_utils.h"
-#include "src/core/lib/transport/authority_override.h"
+#include "src/core/lib/transport/authority_override.h"
using grpc_core::ServerAddress;
using grpc_core::ServerAddressList;
@@ -64,8 +64,8 @@ struct grpc_ares_request {
grpc_closure* on_done;
/** the pointer to receive the resolved addresses */
std::unique_ptr<grpc_core::ServerAddressList>* addresses_out;
- /** the pointer to receive the resolved balancer addresses */
- std::unique_ptr<grpc_core::ServerAddressList>* balancer_addresses_out;
+ /** the pointer to receive the resolved balancer addresses */
+ std::unique_ptr<grpc_core::ServerAddressList>* balancer_addresses_out;
/** the pointer to receive the service config in JSON */
char** service_config_json_out;
/** the evernt driver used by this request */
@@ -77,8 +77,8 @@ struct grpc_ares_request {
grpc_error* error;
};
-// TODO(apolcyn): make grpc_ares_hostbyname_request a sub-class
-// of GrpcAresQuery.
+// TODO(apolcyn): make grpc_ares_hostbyname_request a sub-class
+// of GrpcAresQuery.
typedef struct grpc_ares_hostbyname_request {
/** following members are set in create_hostbyname_request_locked
*/
@@ -90,54 +90,54 @@ typedef struct grpc_ares_hostbyname_request {
uint16_t port;
/** is it a grpclb address */
bool is_balancer;
- /** for logging and errors: the query type ("A" or "AAAA") */
- const char* qtype;
+ /** for logging and errors: the query type ("A" or "AAAA") */
+ const char* qtype;
} grpc_ares_hostbyname_request;
-static void grpc_ares_request_ref_locked(grpc_ares_request* r);
-static void grpc_ares_request_unref_locked(grpc_ares_request* r);
-
-// TODO(apolcyn): as a part of C++-ification, find a way to
-// organize per-query and per-resolution information in such a way
-// that doesn't involve allocating a number of different data
-// structures.
-class GrpcAresQuery {
- public:
- explicit GrpcAresQuery(grpc_ares_request* r, const TString& name)
- : r_(r), name_(name) {
- grpc_ares_request_ref_locked(r_);
- }
-
- ~GrpcAresQuery() { grpc_ares_request_unref_locked(r_); }
-
- grpc_ares_request* parent_request() { return r_; }
-
- const TString& name() { return name_; }
-
- private:
- /* the top level request instance */
- grpc_ares_request* r_;
- /** for logging and errors */
- const TString name_;
-};
-
-static void log_address_sorting_list(const grpc_ares_request* r,
- const ServerAddressList& addresses,
+static void grpc_ares_request_ref_locked(grpc_ares_request* r);
+static void grpc_ares_request_unref_locked(grpc_ares_request* r);
+
+// TODO(apolcyn): as a part of C++-ification, find a way to
+// organize per-query and per-resolution information in such a way
+// that doesn't involve allocating a number of different data
+// structures.
+class GrpcAresQuery {
+ public:
+ explicit GrpcAresQuery(grpc_ares_request* r, const TString& name)
+ : r_(r), name_(name) {
+ grpc_ares_request_ref_locked(r_);
+ }
+
+ ~GrpcAresQuery() { grpc_ares_request_unref_locked(r_); }
+
+ grpc_ares_request* parent_request() { return r_; }
+
+ const TString& name() { return name_; }
+
+ private:
+ /* the top level request instance */
+ grpc_ares_request* r_;
+ /** for logging and errors */
+ const TString name_;
+};
+
+static void log_address_sorting_list(const grpc_ares_request* r,
+ const ServerAddressList& addresses,
const char* input_output_str) {
for (size_t i = 0; i < addresses.size(); i++) {
- TString addr_str =
- grpc_sockaddr_to_string(&addresses[i].address(), true);
- gpr_log(GPR_INFO,
- "(c-ares resolver) request:%p c-ares address sorting: %s[%" PRIuPTR
- "]=%s",
- r, input_output_str, i, addr_str.c_str());
+ TString addr_str =
+ grpc_sockaddr_to_string(&addresses[i].address(), true);
+ gpr_log(GPR_INFO,
+ "(c-ares resolver) request:%p c-ares address sorting: %s[%" PRIuPTR
+ "]=%s",
+ r, input_output_str, i, addr_str.c_str());
}
}
-void grpc_cares_wrapper_address_sorting_sort(const grpc_ares_request* r,
- ServerAddressList* addresses) {
+void grpc_cares_wrapper_address_sorting_sort(const grpc_ares_request* r,
+ ServerAddressList* addresses) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_cares_address_sorting)) {
- log_address_sorting_list(r, *addresses, "input");
+ log_address_sorting_list(r, *addresses, "input");
}
address_sorting_sortable* sortables = (address_sorting_sortable*)gpr_zalloc(
sizeof(address_sorting_sortable) * addresses->size());
@@ -156,7 +156,7 @@ void grpc_cares_wrapper_address_sorting_sort(const grpc_ares_request* r,
gpr_free(sortables);
*addresses = std::move(sorted);
if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_cares_address_sorting)) {
- log_address_sorting_list(r, *addresses, "output");
+ log_address_sorting_list(r, *addresses, "output");
}
}
@@ -177,36 +177,36 @@ void grpc_ares_complete_request_locked(grpc_ares_request* r) {
r->ev_driver = nullptr;
ServerAddressList* addresses = r->addresses_out->get();
if (addresses != nullptr) {
- grpc_cares_wrapper_address_sorting_sort(r, addresses);
+ grpc_cares_wrapper_address_sorting_sort(r, addresses);
GRPC_ERROR_UNREF(r->error);
r->error = GRPC_ERROR_NONE;
// TODO(apolcyn): allow c-ares to return a service config
// with no addresses along side it
}
- if (r->balancer_addresses_out != nullptr) {
- ServerAddressList* balancer_addresses = r->balancer_addresses_out->get();
- if (balancer_addresses != nullptr) {
- grpc_cares_wrapper_address_sorting_sort(r, balancer_addresses);
- }
- }
+ if (r->balancer_addresses_out != nullptr) {
+ ServerAddressList* balancer_addresses = r->balancer_addresses_out->get();
+ if (balancer_addresses != nullptr) {
+ grpc_cares_wrapper_address_sorting_sort(r, balancer_addresses);
+ }
+ }
grpc_core::ExecCtx::Run(DEBUG_LOCATION, r->on_done, r->error);
}
-/* Note that the returned object takes a reference to qtype, so
- * qtype must outlive it. */
+/* Note that the returned object takes a reference to qtype, so
+ * qtype must outlive it. */
static grpc_ares_hostbyname_request* create_hostbyname_request_locked(
- grpc_ares_request* parent_request, const char* host, uint16_t port,
- bool is_balancer, const char* qtype) {
+ grpc_ares_request* parent_request, const char* host, uint16_t port,
+ bool is_balancer, const char* qtype) {
GRPC_CARES_TRACE_LOG(
"request:%p create_hostbyname_request_locked host:%s port:%d "
- "is_balancer:%d qtype:%s",
- parent_request, host, port, is_balancer, qtype);
- grpc_ares_hostbyname_request* hr = new grpc_ares_hostbyname_request();
+ "is_balancer:%d qtype:%s",
+ parent_request, host, port, is_balancer, qtype);
+ grpc_ares_hostbyname_request* hr = new grpc_ares_hostbyname_request();
hr->parent_request = parent_request;
hr->host = gpr_strdup(host);
hr->port = port;
hr->is_balancer = is_balancer;
- hr->qtype = qtype;
+ hr->qtype = qtype;
grpc_ares_request_ref_locked(parent_request);
return hr;
}
@@ -215,7 +215,7 @@ static void destroy_hostbyname_request_locked(
grpc_ares_hostbyname_request* hr) {
grpc_ares_request_unref_locked(hr->parent_request);
gpr_free(hr->host);
- delete hr;
+ delete hr;
}
static void on_hostbyname_done_locked(void* arg, int status, int /*timeouts*/,
@@ -225,19 +225,19 @@ static void on_hostbyname_done_locked(void* arg, int status, int /*timeouts*/,
grpc_ares_request* r = hr->parent_request;
if (status == ARES_SUCCESS) {
GRPC_CARES_TRACE_LOG(
- "request:%p on_hostbyname_done_locked qtype=%s host=%s ARES_SUCCESS", r,
- hr->qtype, hr->host);
- std::unique_ptr<ServerAddressList>* address_list_ptr =
- hr->is_balancer ? r->balancer_addresses_out : r->addresses_out;
- if (*address_list_ptr == nullptr) {
- *address_list_ptr = y_absl::make_unique<ServerAddressList>();
+ "request:%p on_hostbyname_done_locked qtype=%s host=%s ARES_SUCCESS", r,
+ hr->qtype, hr->host);
+ std::unique_ptr<ServerAddressList>* address_list_ptr =
+ hr->is_balancer ? r->balancer_addresses_out : r->addresses_out;
+ if (*address_list_ptr == nullptr) {
+ *address_list_ptr = y_absl::make_unique<ServerAddressList>();
}
- ServerAddressList& addresses = **address_list_ptr;
+ ServerAddressList& addresses = **address_list_ptr;
for (size_t i = 0; hostent->h_addr_list[i] != nullptr; ++i) {
- y_absl::InlinedVector<grpc_arg, 1> args_to_add;
+ y_absl::InlinedVector<grpc_arg, 1> args_to_add;
if (hr->is_balancer) {
- args_to_add.emplace_back(
- grpc_core::CreateAuthorityOverrideChannelArg(hr->host));
+ args_to_add.emplace_back(
+ grpc_core::CreateAuthorityOverrideChannelArg(hr->host));
}
grpc_channel_args* args = grpc_channel_args_copy_and_add(
nullptr, args_to_add.data(), args_to_add.size());
@@ -279,12 +279,12 @@ static void on_hostbyname_done_locked(void* arg, int status, int /*timeouts*/,
}
}
} else {
- TString error_msg = y_absl::StrFormat(
- "C-ares status is not ARES_SUCCESS qtype=%s name=%s is_balancer=%d: %s",
- hr->qtype, hr->host, hr->is_balancer, ares_strerror(status));
- GRPC_CARES_TRACE_LOG("request:%p on_hostbyname_done_locked: %s", r,
- error_msg.c_str());
- grpc_error* error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(error_msg.c_str());
+ TString error_msg = y_absl::StrFormat(
+ "C-ares status is not ARES_SUCCESS qtype=%s name=%s is_balancer=%d: %s",
+ hr->qtype, hr->host, hr->is_balancer, ares_strerror(status));
+ GRPC_CARES_TRACE_LOG("request:%p on_hostbyname_done_locked: %s", r,
+ error_msg.c_str());
+ grpc_error* error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(error_msg.c_str());
r->error = grpc_error_add_child(error, r->error);
}
destroy_hostbyname_request_locked(hr);
@@ -292,12 +292,12 @@ static void on_hostbyname_done_locked(void* arg, int status, int /*timeouts*/,
static void on_srv_query_done_locked(void* arg, int status, int /*timeouts*/,
unsigned char* abuf, int alen) {
- GrpcAresQuery* q = static_cast<GrpcAresQuery*>(arg);
- grpc_ares_request* r = q->parent_request();
+ GrpcAresQuery* q = static_cast<GrpcAresQuery*>(arg);
+ grpc_ares_request* r = q->parent_request();
if (status == ARES_SUCCESS) {
- GRPC_CARES_TRACE_LOG(
- "request:%p on_srv_query_done_locked name=%s ARES_SUCCESS", r,
- q->name().c_str());
+ GRPC_CARES_TRACE_LOG(
+ "request:%p on_srv_query_done_locked name=%s ARES_SUCCESS", r,
+ q->name().c_str());
struct ares_srv_reply* reply;
const int parse_status = ares_parse_srv_reply(abuf, alen, &reply);
GRPC_CARES_TRACE_LOG("request:%p ares_parse_srv_reply: %d", r,
@@ -309,13 +309,13 @@ static void on_srv_query_done_locked(void* arg, int status, int /*timeouts*/,
srv_it = srv_it->next) {
if (grpc_ares_query_ipv6()) {
grpc_ares_hostbyname_request* hr = create_hostbyname_request_locked(
- r, srv_it->host, htons(srv_it->port), true /* is_balancer */,
- "AAAA");
+ r, srv_it->host, htons(srv_it->port), true /* is_balancer */,
+ "AAAA");
ares_gethostbyname(*channel, hr->host, AF_INET6,
on_hostbyname_done_locked, hr);
}
grpc_ares_hostbyname_request* hr = create_hostbyname_request_locked(
- r, srv_it->host, htons(srv_it->port), true /* is_balancer */, "A");
+ r, srv_it->host, htons(srv_it->port), true /* is_balancer */, "A");
ares_gethostbyname(*channel, hr->host, AF_INET,
on_hostbyname_done_locked, hr);
grpc_ares_ev_driver_start_locked(r->ev_driver);
@@ -325,31 +325,31 @@ static void on_srv_query_done_locked(void* arg, int status, int /*timeouts*/,
ares_free_data(reply);
}
} else {
- TString error_msg = y_absl::StrFormat(
- "C-ares status is not ARES_SUCCESS qtype=SRV name=%s: %s", q->name(),
- ares_strerror(status));
- GRPC_CARES_TRACE_LOG("request:%p on_srv_query_done_locked: %s", r,
- error_msg.c_str());
- grpc_error* error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(error_msg.c_str());
+ TString error_msg = y_absl::StrFormat(
+ "C-ares status is not ARES_SUCCESS qtype=SRV name=%s: %s", q->name(),
+ ares_strerror(status));
+ GRPC_CARES_TRACE_LOG("request:%p on_srv_query_done_locked: %s", r,
+ error_msg.c_str());
+ grpc_error* error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(error_msg.c_str());
r->error = grpc_error_add_child(error, r->error);
}
- delete q;
+ delete q;
}
static const char g_service_config_attribute_prefix[] = "grpc_config=";
static void on_txt_done_locked(void* arg, int status, int /*timeouts*/,
unsigned char* buf, int len) {
- GrpcAresQuery* q = static_cast<GrpcAresQuery*>(arg);
- std::unique_ptr<GrpcAresQuery> query_deleter(q);
- grpc_ares_request* r = q->parent_request();
+ GrpcAresQuery* q = static_cast<GrpcAresQuery*>(arg);
+ std::unique_ptr<GrpcAresQuery> query_deleter(q);
+ grpc_ares_request* r = q->parent_request();
const size_t prefix_len = sizeof(g_service_config_attribute_prefix) - 1;
struct ares_txt_ext* result = nullptr;
struct ares_txt_ext* reply = nullptr;
grpc_error* error = GRPC_ERROR_NONE;
if (status != ARES_SUCCESS) goto fail;
- GRPC_CARES_TRACE_LOG("request:%p on_txt_done_locked name=%s ARES_SUCCESS", r,
- q->name().c_str());
+ GRPC_CARES_TRACE_LOG("request:%p on_txt_done_locked name=%s ARES_SUCCESS", r,
+ q->name().c_str());
status = ares_parse_txt_reply_ext(buf, len, &reply);
if (status != ARES_SUCCESS) goto fail;
// Find service config in TXT record.
@@ -382,46 +382,46 @@ static void on_txt_done_locked(void* arg, int status, int /*timeouts*/,
}
// Clean up.
ares_free_data(reply);
- return;
+ return;
fail:
- TString error_msg =
- y_absl::StrFormat("C-ares status is not ARES_SUCCESS qtype=TXT name=%s: %s",
- q->name(), ares_strerror(status));
- error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(error_msg.c_str());
- GRPC_CARES_TRACE_LOG("request:%p on_txt_done_locked %s", r,
- error_msg.c_str());
+ TString error_msg =
+ y_absl::StrFormat("C-ares status is not ARES_SUCCESS qtype=TXT name=%s: %s",
+ q->name(), ares_strerror(status));
+ error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(error_msg.c_str());
+ GRPC_CARES_TRACE_LOG("request:%p on_txt_done_locked %s", r,
+ error_msg.c_str());
r->error = grpc_error_add_child(error, r->error);
}
void grpc_dns_lookup_ares_continue_after_check_localhost_and_ip_literals_locked(
grpc_ares_request* r, const char* dns_server, const char* name,
const char* default_port, grpc_pollset_set* interested_parties,
- int query_timeout_ms,
- std::shared_ptr<grpc_core::WorkSerializer> work_serializer) {
+ int query_timeout_ms,
+ std::shared_ptr<grpc_core::WorkSerializer> work_serializer) {
grpc_error* error = GRPC_ERROR_NONE;
grpc_ares_hostbyname_request* hr = nullptr;
ares_channel* channel = nullptr;
/* parse name, splitting it into host and port parts */
- TString host;
- TString port;
+ TString host;
+ TString port;
grpc_core::SplitHostPort(name, &host, &port);
- if (host.empty()) {
+ if (host.empty()) {
error = grpc_error_set_str(
GRPC_ERROR_CREATE_FROM_STATIC_STRING("unparseable host:port"),
GRPC_ERROR_STR_TARGET_ADDRESS, grpc_slice_from_copied_string(name));
goto error_cleanup;
- } else if (port.empty()) {
+ } else if (port.empty()) {
if (default_port == nullptr) {
error = grpc_error_set_str(
GRPC_ERROR_CREATE_FROM_STATIC_STRING("no port in name"),
GRPC_ERROR_STR_TARGET_ADDRESS, grpc_slice_from_copied_string(name));
goto error_cleanup;
}
- port = default_port;
+ port = default_port;
}
error = grpc_ares_ev_driver_create_locked(&r->ev_driver, interested_parties,
- query_timeout_ms,
- std::move(work_serializer), r);
+ query_timeout_ms,
+ std::move(work_serializer), r);
if (error != GRPC_ERROR_NONE) goto error_cleanup;
channel = grpc_ares_ev_driver_get_channel_locked(r->ev_driver);
// If dns_server is specified, use it.
@@ -452,38 +452,38 @@ void grpc_dns_lookup_ares_continue_after_check_localhost_and_ip_literals_locked(
}
int status = ares_set_servers_ports(*channel, &r->dns_server_addr);
if (status != ARES_SUCCESS) {
- error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("C-ares status is not ARES_SUCCESS: ",
- ares_strerror(status))
- .c_str());
+ error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrCat("C-ares status is not ARES_SUCCESS: ",
+ ares_strerror(status))
+ .c_str());
goto error_cleanup;
}
}
r->pending_queries = 1;
if (grpc_ares_query_ipv6()) {
- hr = create_hostbyname_request_locked(r, host.c_str(),
- grpc_strhtons(port.c_str()),
- /*is_balancer=*/false, "AAAA");
+ hr = create_hostbyname_request_locked(r, host.c_str(),
+ grpc_strhtons(port.c_str()),
+ /*is_balancer=*/false, "AAAA");
ares_gethostbyname(*channel, hr->host, AF_INET6, on_hostbyname_done_locked,
hr);
}
- hr = create_hostbyname_request_locked(r, host.c_str(),
- grpc_strhtons(port.c_str()),
- /*is_balancer=*/false, "A");
+ hr = create_hostbyname_request_locked(r, host.c_str(),
+ grpc_strhtons(port.c_str()),
+ /*is_balancer=*/false, "A");
ares_gethostbyname(*channel, hr->host, AF_INET, on_hostbyname_done_locked,
hr);
- if (r->balancer_addresses_out != nullptr) {
+ if (r->balancer_addresses_out != nullptr) {
/* Query the SRV record */
- TString service_name = y_absl::StrCat("_grpclb._tcp.", host);
- GrpcAresQuery* srv_query = new GrpcAresQuery(r, service_name);
- ares_query(*channel, service_name.c_str(), ns_c_in, ns_t_srv,
- on_srv_query_done_locked, srv_query);
+ TString service_name = y_absl::StrCat("_grpclb._tcp.", host);
+ GrpcAresQuery* srv_query = new GrpcAresQuery(r, service_name);
+ ares_query(*channel, service_name.c_str(), ns_c_in, ns_t_srv,
+ on_srv_query_done_locked, srv_query);
}
if (r->service_config_json_out != nullptr) {
- TString config_name = y_absl::StrCat("_grpc_config.", host);
- GrpcAresQuery* txt_query = new GrpcAresQuery(r, config_name);
- ares_search(*channel, config_name.c_str(), ns_c_in, ns_t_txt,
- on_txt_done_locked, txt_query);
+ TString config_name = y_absl::StrCat("_grpc_config.", host);
+ GrpcAresQuery* txt_query = new GrpcAresQuery(r, config_name);
+ ares_search(*channel, config_name.c_str(), ns_c_in, ns_t_txt,
+ on_txt_done_locked, txt_query);
}
grpc_ares_ev_driver_start_locked(r->ev_driver);
grpc_ares_request_unref_locked(r);
@@ -495,16 +495,16 @@ error_cleanup:
static bool inner_resolve_as_ip_literal_locked(
const char* name, const char* default_port,
- std::unique_ptr<grpc_core::ServerAddressList>* addrs, TString* host,
- TString* port, TString* hostport) {
- if (!grpc_core::SplitHostPort(name, host, port)) {
+ std::unique_ptr<grpc_core::ServerAddressList>* addrs, TString* host,
+ TString* port, TString* hostport) {
+ if (!grpc_core::SplitHostPort(name, host, port)) {
gpr_log(GPR_ERROR,
"Failed to parse %s to host:port while attempting to resolve as ip "
"literal.",
name);
return false;
}
- if (port->empty()) {
+ if (port->empty()) {
if (default_port == nullptr) {
gpr_log(GPR_ERROR,
"No port or default port for %s while attempting to resolve as "
@@ -512,16 +512,16 @@ static bool inner_resolve_as_ip_literal_locked(
name);
return false;
}
- *port = default_port;
+ *port = default_port;
}
grpc_resolved_address addr;
- *hostport = grpc_core::JoinHostPort(*host, atoi(port->c_str()));
- if (grpc_parse_ipv4_hostport(hostport->c_str(), &addr,
+ *hostport = grpc_core::JoinHostPort(*host, atoi(port->c_str()));
+ if (grpc_parse_ipv4_hostport(hostport->c_str(), &addr,
false /* log errors */) ||
- grpc_parse_ipv6_hostport(hostport->c_str(), &addr,
+ grpc_parse_ipv6_hostport(hostport->c_str(), &addr,
false /* log errors */)) {
GPR_ASSERT(*addrs == nullptr);
- *addrs = y_absl::make_unique<ServerAddressList>();
+ *addrs = y_absl::make_unique<ServerAddressList>();
(*addrs)->emplace_back(addr.addr, addr.len, nullptr /* args */);
return true;
}
@@ -531,21 +531,21 @@ static bool inner_resolve_as_ip_literal_locked(
static bool resolve_as_ip_literal_locked(
const char* name, const char* default_port,
std::unique_ptr<grpc_core::ServerAddressList>* addrs) {
- TString host;
- TString port;
- TString hostport;
+ TString host;
+ TString port;
+ TString hostport;
bool out = inner_resolve_as_ip_literal_locked(name, default_port, addrs,
&host, &port, &hostport);
return out;
}
-static bool target_matches_localhost_inner(const char* name, TString* host,
- TString* port) {
+static bool target_matches_localhost_inner(const char* name, TString* host,
+ TString* port) {
if (!grpc_core::SplitHostPort(name, host, port)) {
gpr_log(GPR_ERROR, "Unable to split host and port for name: %s", name);
return false;
}
- if (gpr_stricmp(host->c_str(), "localhost") == 0) {
+ if (gpr_stricmp(host->c_str(), "localhost") == 0) {
return true;
} else {
return false;
@@ -553,25 +553,25 @@ static bool target_matches_localhost_inner(const char* name, TString* host,
}
static bool target_matches_localhost(const char* name) {
- TString host;
- TString port;
+ TString host;
+ TString port;
return target_matches_localhost_inner(name, &host, &port);
}
#ifdef GRPC_ARES_RESOLVE_LOCALHOST_MANUALLY
static bool inner_maybe_resolve_localhost_manually_locked(
- const grpc_ares_request* r, const char* name, const char* default_port,
- std::unique_ptr<grpc_core::ServerAddressList>* addrs, TString* host,
- TString* port) {
+ const grpc_ares_request* r, const char* name, const char* default_port,
+ std::unique_ptr<grpc_core::ServerAddressList>* addrs, TString* host,
+ TString* port) {
grpc_core::SplitHostPort(name, host, port);
- if (host->empty()) {
+ if (host->empty()) {
gpr_log(GPR_ERROR,
"Failed to parse %s into host:port during manual localhost "
"resolution check.",
name);
return false;
}
- if (port->empty()) {
+ if (port->empty()) {
if (default_port == nullptr) {
gpr_log(GPR_ERROR,
"No port or default port for %s during manual localhost "
@@ -579,12 +579,12 @@ static bool inner_maybe_resolve_localhost_manually_locked(
name);
return false;
}
- *port = default_port;
+ *port = default_port;
}
- if (gpr_stricmp(host->c_str(), "localhost") == 0) {
+ if (gpr_stricmp(host->c_str(), "localhost") == 0) {
GPR_ASSERT(*addrs == nullptr);
- *addrs = y_absl::make_unique<grpc_core::ServerAddressList>();
- uint16_t numeric_port = grpc_strhtons(port->c_str());
+ *addrs = y_absl::make_unique<grpc_core::ServerAddressList>();
+ uint16_t numeric_port = grpc_strhtons(port->c_str());
// Append the ipv6 loopback address.
struct sockaddr_in6 ipv6_loopback_addr;
memset(&ipv6_loopback_addr, 0, sizeof(ipv6_loopback_addr));
@@ -603,24 +603,24 @@ static bool inner_maybe_resolve_localhost_manually_locked(
(*addrs)->emplace_back(&ipv4_loopback_addr, sizeof(ipv4_loopback_addr),
nullptr /* args */);
// Let the address sorter figure out which one should be tried first.
- grpc_cares_wrapper_address_sorting_sort(r, addrs->get());
+ grpc_cares_wrapper_address_sorting_sort(r, addrs->get());
return true;
}
return false;
}
static bool grpc_ares_maybe_resolve_localhost_manually_locked(
- const grpc_ares_request* r, const char* name, const char* default_port,
+ const grpc_ares_request* r, const char* name, const char* default_port,
std::unique_ptr<grpc_core::ServerAddressList>* addrs) {
- TString host;
- TString port;
- return inner_maybe_resolve_localhost_manually_locked(r, name, default_port,
+ TString host;
+ TString port;
+ return inner_maybe_resolve_localhost_manually_locked(r, name, default_port,
addrs, &host, &port);
}
#else /* GRPC_ARES_RESOLVE_LOCALHOST_MANUALLY */
static bool grpc_ares_maybe_resolve_localhost_manually_locked(
- const grpc_ares_request* /*r*/, const char* /*name*/,
- const char* /*default_port*/,
+ const grpc_ares_request* /*r*/, const char* /*name*/,
+ const char* /*default_port*/,
std::unique_ptr<grpc_core::ServerAddressList>* /*addrs*/) {
return false;
}
@@ -629,16 +629,16 @@ static bool grpc_ares_maybe_resolve_localhost_manually_locked(
static grpc_ares_request* grpc_dns_lookup_ares_locked_impl(
const char* dns_server, const char* name, const char* default_port,
grpc_pollset_set* interested_parties, grpc_closure* on_done,
- std::unique_ptr<grpc_core::ServerAddressList>* addrs,
- std::unique_ptr<grpc_core::ServerAddressList>* balancer_addrs,
+ std::unique_ptr<grpc_core::ServerAddressList>* addrs,
+ std::unique_ptr<grpc_core::ServerAddressList>* balancer_addrs,
char** service_config_json, int query_timeout_ms,
- std::shared_ptr<grpc_core::WorkSerializer> work_serializer) {
+ std::shared_ptr<grpc_core::WorkSerializer> work_serializer) {
grpc_ares_request* r =
static_cast<grpc_ares_request*>(gpr_zalloc(sizeof(grpc_ares_request)));
r->ev_driver = nullptr;
r->on_done = on_done;
r->addresses_out = addrs;
- r->balancer_addresses_out = balancer_addrs;
+ r->balancer_addresses_out = balancer_addrs;
r->service_config_json_out = service_config_json;
r->error = GRPC_ERROR_NONE;
r->pending_queries = 0;
@@ -652,7 +652,7 @@ static grpc_ares_request* grpc_dns_lookup_ares_locked_impl(
return r;
}
// Early out if the target is localhost and we're on Windows.
- if (grpc_ares_maybe_resolve_localhost_manually_locked(r, name, default_port,
+ if (grpc_ares_maybe_resolve_localhost_manually_locked(r, name, default_port,
addrs)) {
grpc_ares_complete_request_locked(r);
return r;
@@ -661,24 +661,24 @@ static grpc_ares_request* grpc_dns_lookup_ares_locked_impl(
// as to cut down on lookups over the network, especially in tests:
// https://github.com/grpc/proposal/pull/79
if (target_matches_localhost(name)) {
- r->balancer_addresses_out = nullptr;
+ r->balancer_addresses_out = nullptr;
r->service_config_json_out = nullptr;
}
// Look up name using c-ares lib.
grpc_dns_lookup_ares_continue_after_check_localhost_and_ip_literals_locked(
- r, dns_server, name, default_port, interested_parties, query_timeout_ms,
- std::move(work_serializer));
+ r, dns_server, name, default_port, interested_parties, query_timeout_ms,
+ std::move(work_serializer));
return r;
}
grpc_ares_request* (*grpc_dns_lookup_ares_locked)(
const char* dns_server, const char* name, const char* default_port,
grpc_pollset_set* interested_parties, grpc_closure* on_done,
- std::unique_ptr<grpc_core::ServerAddressList>* addrs,
- std::unique_ptr<grpc_core::ServerAddressList>* balancer_addrs,
+ std::unique_ptr<grpc_core::ServerAddressList>* addrs,
+ std::unique_ptr<grpc_core::ServerAddressList>* balancer_addrs,
char** service_config_json, int query_timeout_ms,
- std::shared_ptr<grpc_core::WorkSerializer> work_serializer) =
- grpc_dns_lookup_ares_locked_impl;
+ std::shared_ptr<grpc_core::WorkSerializer> work_serializer) =
+ grpc_dns_lookup_ares_locked_impl;
static void grpc_cancel_ares_request_locked_impl(grpc_ares_request* r) {
GPR_ASSERT(r != nullptr);
@@ -697,9 +697,9 @@ void (*grpc_cancel_ares_request_locked)(grpc_ares_request* r) =
grpc_error* grpc_ares_init(void) {
int status = ares_library_init(ARES_LIB_INIT_ALL);
if (status != ARES_SUCCESS) {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("ares_library_init failed: ", ares_strerror(status))
- .c_str());
+ return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrCat("ares_library_init failed: ", ares_strerror(status))
+ .c_str());
}
return GRPC_ERROR_NONE;
}
@@ -715,8 +715,8 @@ void grpc_ares_cleanup(void) {}
*/
typedef struct grpc_resolve_address_ares_request {
- /* work_serializer that queries and related callbacks run under */
- std::shared_ptr<grpc_core::WorkSerializer> work_serializer;
+ /* work_serializer that queries and related callbacks run under */
+ std::shared_ptr<grpc_core::WorkSerializer> work_serializer;
/** the pointer to receive the resolved addresses */
grpc_resolved_addresses** addrs_out;
/** currently resolving addresses */
@@ -736,8 +736,8 @@ typedef struct grpc_resolve_address_ares_request {
grpc_ares_request* ares_request = nullptr;
} grpc_resolve_address_ares_request;
-static void on_dns_lookup_done_locked(grpc_resolve_address_ares_request* r,
- grpc_error* error) {
+static void on_dns_lookup_done_locked(grpc_resolve_address_ares_request* r,
+ grpc_error* error) {
gpr_free(r->ares_request);
grpc_resolved_addresses** resolved_addresses = r->addrs_out;
if (r->addresses == nullptr || r->addresses->empty()) {
@@ -754,28 +754,28 @@ static void on_dns_lookup_done_locked(grpc_resolve_address_ares_request* r,
sizeof(grpc_resolved_address));
}
}
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, r->on_resolve_address_done, error);
+ grpc_core::ExecCtx::Run(DEBUG_LOCATION, r->on_resolve_address_done, error);
delete r;
}
static void on_dns_lookup_done(void* arg, grpc_error* error) {
grpc_resolve_address_ares_request* r =
static_cast<grpc_resolve_address_ares_request*>(arg);
- GRPC_ERROR_REF(error); // ref owned by lambda
- r->work_serializer->Run([r, error]() { on_dns_lookup_done_locked(r, error); },
- DEBUG_LOCATION);
+ GRPC_ERROR_REF(error); // ref owned by lambda
+ r->work_serializer->Run([r, error]() { on_dns_lookup_done_locked(r, error); },
+ DEBUG_LOCATION);
}
-static void grpc_resolve_address_invoke_dns_lookup_ares_locked(void* arg) {
+static void grpc_resolve_address_invoke_dns_lookup_ares_locked(void* arg) {
grpc_resolve_address_ares_request* r =
static_cast<grpc_resolve_address_ares_request*>(arg);
GRPC_CLOSURE_INIT(&r->on_dns_lookup_done_locked, on_dns_lookup_done, r,
grpc_schedule_on_exec_ctx);
r->ares_request = grpc_dns_lookup_ares_locked(
nullptr /* dns_server */, r->name, r->default_port, r->interested_parties,
- &r->on_dns_lookup_done_locked, &r->addresses,
- nullptr /* balancer_addresses */, nullptr /* service_config_json */,
- GRPC_DNS_ARES_DEFAULT_QUERY_TIMEOUT_MS, r->work_serializer);
+ &r->on_dns_lookup_done_locked, &r->addresses,
+ nullptr /* balancer_addresses */, nullptr /* service_config_json */,
+ GRPC_DNS_ARES_DEFAULT_QUERY_TIMEOUT_MS, r->work_serializer);
}
static void grpc_resolve_address_ares_impl(const char* name,
@@ -785,15 +785,15 @@ static void grpc_resolve_address_ares_impl(const char* name,
grpc_resolved_addresses** addrs) {
grpc_resolve_address_ares_request* r =
new grpc_resolve_address_ares_request();
- r->work_serializer = std::make_shared<grpc_core::WorkSerializer>();
+ r->work_serializer = std::make_shared<grpc_core::WorkSerializer>();
r->addrs_out = addrs;
r->on_resolve_address_done = on_done;
r->name = name;
r->default_port = default_port;
r->interested_parties = interested_parties;
- r->work_serializer->Run(
- [r]() { grpc_resolve_address_invoke_dns_lookup_ares_locked(r); },
- DEBUG_LOCATION);
+ r->work_serializer->Run(
+ [r]() { grpc_resolve_address_invoke_dns_lookup_ares_locked(r); },
+ DEBUG_LOCATION);
}
void (*grpc_resolve_address_ares)(
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h
index 5e8706b2475..ddce754934f 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h
@@ -25,7 +25,7 @@
#include "src/core/lib/iomgr/iomgr.h"
#include "src/core/lib/iomgr/polling_entity.h"
#include "src/core/lib/iomgr/resolve_address.h"
-#include "src/core/lib/iomgr/work_serializer.h"
+#include "src/core/lib/iomgr/work_serializer.h"
#define GRPC_DNS_ARES_DEFAULT_QUERY_TIMEOUT_MS 120000
@@ -64,10 +64,10 @@ extern void (*grpc_resolve_address_ares)(const char* name,
extern grpc_ares_request* (*grpc_dns_lookup_ares_locked)(
const char* dns_server, const char* name, const char* default_port,
grpc_pollset_set* interested_parties, grpc_closure* on_done,
- std::unique_ptr<grpc_core::ServerAddressList>* addresses,
- std::unique_ptr<grpc_core::ServerAddressList>* balancer_addresses,
+ std::unique_ptr<grpc_core::ServerAddressList>* addresses,
+ std::unique_ptr<grpc_core::ServerAddressList>* balancer_addresses,
char** service_config_json, int query_timeout_ms,
- std::shared_ptr<grpc_core::WorkSerializer> work_serializer);
+ std::shared_ptr<grpc_core::WorkSerializer> work_serializer);
/* Cancel the pending grpc_ares_request \a request */
extern void (*grpc_cancel_ares_request_locked)(grpc_ares_request* request);
@@ -91,7 +91,7 @@ bool grpc_ares_query_ipv6();
/* Sorts destinations in lb_addrs according to RFC 6724. */
void grpc_cares_wrapper_address_sorting_sort(
- const grpc_ares_request* request, grpc_core::ServerAddressList* addresses);
+ const grpc_ares_request* request, grpc_core::ServerAddressList* addresses);
#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_DNS_C_ARES_GRPC_ARES_WRAPPER_H \
*/
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_fallback.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_fallback.cc
index 5258a27eafc..2049f371184 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_fallback.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_fallback.cc
@@ -29,21 +29,21 @@ struct grpc_ares_request {
static grpc_ares_request* grpc_dns_lookup_ares_locked_impl(
const char* dns_server, const char* name, const char* default_port,
grpc_pollset_set* interested_parties, grpc_closure* on_done,
- std::unique_ptr<grpc_core::ServerAddressList>* addrs,
- std::unique_ptr<grpc_core::ServerAddressList>* balancer_addrs,
+ std::unique_ptr<grpc_core::ServerAddressList>* addrs,
+ std::unique_ptr<grpc_core::ServerAddressList>* balancer_addrs,
char** service_config_json, int query_timeout_ms,
- std::shared_ptr<grpc_core::WorkSerializer> work_serializer) {
+ std::shared_ptr<grpc_core::WorkSerializer> work_serializer) {
return NULL;
}
grpc_ares_request* (*grpc_dns_lookup_ares_locked)(
const char* dns_server, const char* name, const char* default_port,
grpc_pollset_set* interested_parties, grpc_closure* on_done,
- std::unique_ptr<grpc_core::ServerAddressList>* addrs,
- std::unique_ptr<grpc_core::ServerAddressList>* balancer_addrs,
+ std::unique_ptr<grpc_core::ServerAddressList>* addrs,
+ std::unique_ptr<grpc_core::ServerAddressList>* balancer_addrs,
char** service_config_json, int query_timeout_ms,
- std::shared_ptr<grpc_core::WorkSerializer> work_serializer) =
- grpc_dns_lookup_ares_locked_impl;
+ std::shared_ptr<grpc_core::WorkSerializer> work_serializer) =
+ grpc_dns_lookup_ares_locked_impl;
static void grpc_cancel_ares_request_locked_impl(grpc_ares_request* r) {}
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_libuv.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_libuv.cc
index 449bcf71cd1..1d4a90fbd90 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_libuv.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_libuv.cc
@@ -26,7 +26,7 @@
#include "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h"
#include "src/core/ext/filters/client_channel/server_address.h"
#include "src/core/lib/gpr/string.h"
-#include "src/core/lib/iomgr/parse_address.h"
+#include "src/core/lib/iomgr/parse_address.h"
bool grpc_ares_query_ipv6() {
/* The libuv grpc code currently does not have the code to probe for this,
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc
index 80e5743f539..df11db3624d 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc
@@ -26,7 +26,7 @@
#include "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h"
#include "src/core/ext/filters/client_channel/server_address.h"
#include "src/core/lib/gpr/string.h"
-#include "src/core/lib/iomgr/parse_address.h"
+#include "src/core/lib/iomgr/parse_address.h"
#include "src/core/lib/iomgr/socket_windows.h"
bool grpc_ares_query_ipv6() { return grpc_ipv6_loopback_available(); }
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc
index 182f93a99da..a0e35661908 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc
@@ -22,8 +22,8 @@
#include <climits>
#include <cstring>
-#include "y_absl/strings/str_cat.h"
-
+#include "y_absl/strings/str_cat.h"
+
#include <grpc/support/alloc.h>
#include <grpc/support/string_util.h>
#include <grpc/support/time.h>
@@ -37,7 +37,7 @@
#include "src/core/lib/gprpp/manual_constructor.h"
#include "src/core/lib/iomgr/resolve_address.h"
#include "src/core/lib/iomgr/timer.h"
-#include "src/core/lib/iomgr/work_serializer.h"
+#include "src/core/lib/iomgr/work_serializer.h"
#define GRPC_DNS_INITIAL_CONNECT_BACKOFF_SECONDS 1
#define GRPC_DNS_RECONNECT_BACKOFF_MULTIPLIER 1.6
@@ -69,9 +69,9 @@ class NativeDnsResolver : public Resolver {
void StartResolvingLocked();
static void OnNextResolution(void* arg, grpc_error* error);
- void OnNextResolutionLocked(grpc_error* error);
+ void OnNextResolutionLocked(grpc_error* error);
static void OnResolved(void* arg, grpc_error* error);
- void OnResolvedLocked(grpc_error* error);
+ void OnResolvedLocked(grpc_error* error);
/// name to resolve
char* name_to_resolve_ = nullptr;
@@ -99,7 +99,7 @@ class NativeDnsResolver : public Resolver {
};
NativeDnsResolver::NativeDnsResolver(ResolverArgs args)
- : Resolver(std::move(args.work_serializer), std::move(args.result_handler)),
+ : Resolver(std::move(args.work_serializer), std::move(args.result_handler)),
backoff_(
BackOff::Options()
.set_initial_backoff(GRPC_DNS_INITIAL_CONNECT_BACKOFF_SECONDS *
@@ -151,81 +151,81 @@ void NativeDnsResolver::ShutdownLocked() {
void NativeDnsResolver::OnNextResolution(void* arg, grpc_error* error) {
NativeDnsResolver* r = static_cast<NativeDnsResolver*>(arg);
- GRPC_ERROR_REF(error); // ref owned by lambda
- r->work_serializer()->Run([r, error]() { r->OnNextResolutionLocked(error); },
- DEBUG_LOCATION);
+ GRPC_ERROR_REF(error); // ref owned by lambda
+ r->work_serializer()->Run([r, error]() { r->OnNextResolutionLocked(error); },
+ DEBUG_LOCATION);
}
-void NativeDnsResolver::OnNextResolutionLocked(grpc_error* error) {
- have_next_resolution_timer_ = false;
- if (error == GRPC_ERROR_NONE && !resolving_) {
- StartResolvingLocked();
+void NativeDnsResolver::OnNextResolutionLocked(grpc_error* error) {
+ have_next_resolution_timer_ = false;
+ if (error == GRPC_ERROR_NONE && !resolving_) {
+ StartResolvingLocked();
}
- Unref(DEBUG_LOCATION, "retry-timer");
- GRPC_ERROR_UNREF(error);
+ Unref(DEBUG_LOCATION, "retry-timer");
+ GRPC_ERROR_UNREF(error);
}
void NativeDnsResolver::OnResolved(void* arg, grpc_error* error) {
NativeDnsResolver* r = static_cast<NativeDnsResolver*>(arg);
- GRPC_ERROR_REF(error); // owned by lambda
- r->work_serializer()->Run([r, error]() { r->OnResolvedLocked(error); },
- DEBUG_LOCATION);
+ GRPC_ERROR_REF(error); // owned by lambda
+ r->work_serializer()->Run([r, error]() { r->OnResolvedLocked(error); },
+ DEBUG_LOCATION);
}
-void NativeDnsResolver::OnResolvedLocked(grpc_error* error) {
- GPR_ASSERT(resolving_);
- resolving_ = false;
- if (shutdown_) {
- if (addresses_ != nullptr) {
- grpc_resolved_addresses_destroy(addresses_);
+void NativeDnsResolver::OnResolvedLocked(grpc_error* error) {
+ GPR_ASSERT(resolving_);
+ resolving_ = false;
+ if (shutdown_) {
+ if (addresses_ != nullptr) {
+ grpc_resolved_addresses_destroy(addresses_);
}
- Unref(DEBUG_LOCATION, "dns-resolving");
- GRPC_ERROR_UNREF(error);
+ Unref(DEBUG_LOCATION, "dns-resolving");
+ GRPC_ERROR_UNREF(error);
return;
}
- if (addresses_ != nullptr) {
+ if (addresses_ != nullptr) {
Result result;
- for (size_t i = 0; i < addresses_->naddrs; ++i) {
- result.addresses.emplace_back(&addresses_->addrs[i].addr,
- addresses_->addrs[i].len,
+ for (size_t i = 0; i < addresses_->naddrs; ++i) {
+ result.addresses.emplace_back(&addresses_->addrs[i].addr,
+ addresses_->addrs[i].len,
nullptr /* args */);
}
- grpc_resolved_addresses_destroy(addresses_);
- result.args = grpc_channel_args_copy(channel_args_);
- result_handler()->ReturnResult(std::move(result));
+ grpc_resolved_addresses_destroy(addresses_);
+ result.args = grpc_channel_args_copy(channel_args_);
+ result_handler()->ReturnResult(std::move(result));
// Reset backoff state so that we start from the beginning when the
// next request gets triggered.
- backoff_.Reset();
+ backoff_.Reset();
} else {
gpr_log(GPR_INFO, "dns resolution failed (will retry): %s",
grpc_error_string(error));
// Return transient error.
- TString error_message =
- y_absl::StrCat("DNS resolution failed for service: ", name_to_resolve_);
- result_handler()->ReturnError(grpc_error_set_int(
- GRPC_ERROR_CREATE_REFERENCING_FROM_COPIED_STRING(error_message.c_str(),
- &error, 1),
+ TString error_message =
+ y_absl::StrCat("DNS resolution failed for service: ", name_to_resolve_);
+ result_handler()->ReturnError(grpc_error_set_int(
+ GRPC_ERROR_CREATE_REFERENCING_FROM_COPIED_STRING(error_message.c_str(),
+ &error, 1),
GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE));
// Set up for retry.
- grpc_millis next_try = backoff_.NextAttemptTime();
+ grpc_millis next_try = backoff_.NextAttemptTime();
grpc_millis timeout = next_try - ExecCtx::Get()->Now();
- GPR_ASSERT(!have_next_resolution_timer_);
- have_next_resolution_timer_ = true;
+ GPR_ASSERT(!have_next_resolution_timer_);
+ have_next_resolution_timer_ = true;
// TODO(roth): We currently deal with this ref manually. Once the
// new closure API is done, find a way to track this ref with the timer
// callback as part of the type system.
- Ref(DEBUG_LOCATION, "next_resolution_timer").release();
+ Ref(DEBUG_LOCATION, "next_resolution_timer").release();
if (timeout > 0) {
gpr_log(GPR_DEBUG, "retrying in %" PRId64 " milliseconds", timeout);
} else {
gpr_log(GPR_DEBUG, "retrying immediately");
}
- GRPC_CLOSURE_INIT(&on_next_resolution_, NativeDnsResolver::OnNextResolution,
- this, grpc_schedule_on_exec_ctx);
- grpc_timer_init(&next_resolution_timer_, next_try, &on_next_resolution_);
+ GRPC_CLOSURE_INIT(&on_next_resolution_, NativeDnsResolver::OnNextResolution,
+ this, grpc_schedule_on_exec_ctx);
+ grpc_timer_init(&next_resolution_timer_, next_try, &on_next_resolution_);
}
- Unref(DEBUG_LOCATION, "dns-resolving");
- GRPC_ERROR_UNREF(error);
+ Unref(DEBUG_LOCATION, "dns-resolving");
+ GRPC_ERROR_UNREF(error);
}
void NativeDnsResolver::MaybeStartResolvingLocked() {
@@ -309,7 +309,7 @@ void grpc_resolver_dns_native_init() {
if (gpr_stricmp(resolver.get(), "native") == 0) {
gpr_log(GPR_DEBUG, "Using native dns resolver");
grpc_core::ResolverRegistry::Builder::RegisterResolverFactory(
- y_absl::make_unique<grpc_core::NativeDnsResolverFactory>());
+ y_absl::make_unique<grpc_core::NativeDnsResolverFactory>());
} else {
grpc_core::ResolverRegistry::Builder::InitRegistry();
grpc_core::ResolverFactory* existing_factory =
@@ -317,7 +317,7 @@ void grpc_resolver_dns_native_init() {
if (existing_factory == nullptr) {
gpr_log(GPR_DEBUG, "Using native dns resolver");
grpc_core::ResolverRegistry::Builder::RegisterResolverFactory(
- y_absl::make_unique<grpc_core::NativeDnsResolverFactory>());
+ y_absl::make_unique<grpc_core::NativeDnsResolverFactory>());
}
}
}
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc
index 0606946c1c1..792146ed049 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc
@@ -34,10 +34,10 @@
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/iomgr/closure.h"
-#include "src/core/lib/iomgr/parse_address.h"
+#include "src/core/lib/iomgr/parse_address.h"
#include "src/core/lib/iomgr/resolve_address.h"
#include "src/core/lib/iomgr/unix_sockets_posix.h"
-#include "src/core/lib/iomgr/work_serializer.h"
+#include "src/core/lib/iomgr/work_serializer.h"
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/slice/slice_string_helpers.h"
@@ -57,15 +57,15 @@ class FakeResolver : public Resolver {
private:
friend class FakeResolverResponseGenerator;
- friend class FakeResolverResponseSetter;
+ friend class FakeResolverResponseSetter;
virtual ~FakeResolver();
- void ShutdownLocked() override;
+ void ShutdownLocked() override;
void MaybeSendResultLocked();
- void ReturnReresolutionResult();
+ void ReturnReresolutionResult();
// passed-in parameters
grpc_channel_args* channel_args_ = nullptr;
@@ -89,7 +89,7 @@ class FakeResolver : public Resolver {
};
FakeResolver::FakeResolver(ResolverArgs args)
- : Resolver(std::move(args.work_serializer), std::move(args.result_handler)),
+ : Resolver(std::move(args.work_serializer), std::move(args.result_handler)),
response_generator_(
FakeResolverResponseGenerator::GetFromArgs(args.args)) {
// Channels sharing the same subchannels may have different resolver response
@@ -121,20 +121,20 @@ void FakeResolver::RequestReresolutionLocked() {
if (!reresolution_closure_pending_) {
reresolution_closure_pending_ = true;
Ref().release(); // ref held by closure
- work_serializer()->Run([this]() { ReturnReresolutionResult(); },
- DEBUG_LOCATION);
+ work_serializer()->Run([this]() { ReturnReresolutionResult(); },
+ DEBUG_LOCATION);
}
}
}
-void FakeResolver::ShutdownLocked() {
- shutdown_ = true;
- if (response_generator_ != nullptr) {
- response_generator_->SetFakeResolver(nullptr);
- response_generator_.reset();
- }
-}
-
+void FakeResolver::ShutdownLocked() {
+ shutdown_ = true;
+ if (response_generator_ != nullptr) {
+ response_generator_->SetFakeResolver(nullptr);
+ response_generator_.reset();
+ }
+}
+
void FakeResolver::MaybeSendResultLocked() {
if (!started_ || shutdown_) return;
if (return_failure_) {
@@ -160,61 +160,61 @@ void FakeResolver::MaybeSendResultLocked() {
}
}
-void FakeResolver::ReturnReresolutionResult() {
- reresolution_closure_pending_ = false;
- MaybeSendResultLocked();
- Unref();
+void FakeResolver::ReturnReresolutionResult() {
+ reresolution_closure_pending_ = false;
+ MaybeSendResultLocked();
+ Unref();
+}
+
+class FakeResolverResponseSetter {
+ public:
+ explicit FakeResolverResponseSetter(RefCountedPtr<FakeResolver> resolver,
+ Resolver::Result result,
+ bool has_result = false,
+ bool immediate = true)
+ : resolver_(std::move(resolver)),
+ result_(std::move(result)),
+ has_result_(has_result),
+ immediate_(immediate) {}
+ void SetResponseLocked();
+ void SetReresolutionResponseLocked();
+ void SetFailureLocked();
+
+ private:
+ RefCountedPtr<FakeResolver> resolver_;
+ Resolver::Result result_;
+ bool has_result_;
+ bool immediate_;
+};
+
+// Deletes object when done
+void FakeResolverResponseSetter::SetReresolutionResponseLocked() {
+ if (!resolver_->shutdown_) {
+ resolver_->reresolution_result_ = std::move(result_);
+ resolver_->has_reresolution_result_ = has_result_;
+ }
+ delete this;
+}
+
+// Deletes object when done
+void FakeResolverResponseSetter::SetResponseLocked() {
+ if (!resolver_->shutdown_) {
+ resolver_->next_result_ = std::move(result_);
+ resolver_->has_next_result_ = true;
+ resolver_->MaybeSendResultLocked();
+ }
+ delete this;
+}
+
+// Deletes object when done
+void FakeResolverResponseSetter::SetFailureLocked() {
+ if (!resolver_->shutdown_) {
+ resolver_->return_failure_ = true;
+ if (immediate_) resolver_->MaybeSendResultLocked();
+ }
+ delete this;
}
-class FakeResolverResponseSetter {
- public:
- explicit FakeResolverResponseSetter(RefCountedPtr<FakeResolver> resolver,
- Resolver::Result result,
- bool has_result = false,
- bool immediate = true)
- : resolver_(std::move(resolver)),
- result_(std::move(result)),
- has_result_(has_result),
- immediate_(immediate) {}
- void SetResponseLocked();
- void SetReresolutionResponseLocked();
- void SetFailureLocked();
-
- private:
- RefCountedPtr<FakeResolver> resolver_;
- Resolver::Result result_;
- bool has_result_;
- bool immediate_;
-};
-
-// Deletes object when done
-void FakeResolverResponseSetter::SetReresolutionResponseLocked() {
- if (!resolver_->shutdown_) {
- resolver_->reresolution_result_ = std::move(result_);
- resolver_->has_reresolution_result_ = has_result_;
- }
- delete this;
-}
-
-// Deletes object when done
-void FakeResolverResponseSetter::SetResponseLocked() {
- if (!resolver_->shutdown_) {
- resolver_->next_result_ = std::move(result_);
- resolver_->has_next_result_ = true;
- resolver_->MaybeSendResultLocked();
- }
- delete this;
-}
-
-// Deletes object when done
-void FakeResolverResponseSetter::SetFailureLocked() {
- if (!resolver_->shutdown_) {
- resolver_->return_failure_ = true;
- if (immediate_) resolver_->MaybeSendResultLocked();
- }
- delete this;
-}
-
//
// FakeResolverResponseGenerator
//
@@ -234,10 +234,10 @@ void FakeResolverResponseGenerator::SetResponse(Resolver::Result result) {
}
resolver = resolver_->Ref();
}
- FakeResolverResponseSetter* arg =
- new FakeResolverResponseSetter(resolver, std::move(result));
- resolver->work_serializer()->Run([arg]() { arg->SetResponseLocked(); },
- DEBUG_LOCATION);
+ FakeResolverResponseSetter* arg =
+ new FakeResolverResponseSetter(resolver, std::move(result));
+ resolver->work_serializer()->Run([arg]() { arg->SetResponseLocked(); },
+ DEBUG_LOCATION);
}
void FakeResolverResponseGenerator::SetReresolutionResponse(
@@ -248,10 +248,10 @@ void FakeResolverResponseGenerator::SetReresolutionResponse(
GPR_ASSERT(resolver_ != nullptr);
resolver = resolver_->Ref();
}
- FakeResolverResponseSetter* arg = new FakeResolverResponseSetter(
- resolver, std::move(result), true /* has_result */);
- resolver->work_serializer()->Run(
- [arg]() { arg->SetReresolutionResponseLocked(); }, DEBUG_LOCATION);
+ FakeResolverResponseSetter* arg = new FakeResolverResponseSetter(
+ resolver, std::move(result), true /* has_result */);
+ resolver->work_serializer()->Run(
+ [arg]() { arg->SetReresolutionResponseLocked(); }, DEBUG_LOCATION);
}
void FakeResolverResponseGenerator::UnsetReresolutionResponse() {
@@ -261,10 +261,10 @@ void FakeResolverResponseGenerator::UnsetReresolutionResponse() {
GPR_ASSERT(resolver_ != nullptr);
resolver = resolver_->Ref();
}
- FakeResolverResponseSetter* arg =
- new FakeResolverResponseSetter(resolver, Resolver::Result());
- resolver->work_serializer()->Run(
- [arg]() { arg->SetReresolutionResponseLocked(); }, DEBUG_LOCATION);
+ FakeResolverResponseSetter* arg =
+ new FakeResolverResponseSetter(resolver, Resolver::Result());
+ resolver->work_serializer()->Run(
+ [arg]() { arg->SetReresolutionResponseLocked(); }, DEBUG_LOCATION);
}
void FakeResolverResponseGenerator::SetFailure() {
@@ -274,10 +274,10 @@ void FakeResolverResponseGenerator::SetFailure() {
GPR_ASSERT(resolver_ != nullptr);
resolver = resolver_->Ref();
}
- FakeResolverResponseSetter* arg =
- new FakeResolverResponseSetter(resolver, Resolver::Result());
- resolver->work_serializer()->Run([arg]() { arg->SetFailureLocked(); },
- DEBUG_LOCATION);
+ FakeResolverResponseSetter* arg =
+ new FakeResolverResponseSetter(resolver, Resolver::Result());
+ resolver->work_serializer()->Run([arg]() { arg->SetFailureLocked(); },
+ DEBUG_LOCATION);
}
void FakeResolverResponseGenerator::SetFailureOnReresolution() {
@@ -287,11 +287,11 @@ void FakeResolverResponseGenerator::SetFailureOnReresolution() {
GPR_ASSERT(resolver_ != nullptr);
resolver = resolver_->Ref();
}
- FakeResolverResponseSetter* arg = new FakeResolverResponseSetter(
- resolver, Resolver::Result(), false /* has_result */,
- false /* immediate */);
- resolver->work_serializer()->Run([arg]() { arg->SetFailureLocked(); },
- DEBUG_LOCATION);
+ FakeResolverResponseSetter* arg = new FakeResolverResponseSetter(
+ resolver, Resolver::Result(), false /* has_result */,
+ false /* immediate */);
+ resolver->work_serializer()->Run([arg]() { arg->SetFailureLocked(); },
+ DEBUG_LOCATION);
}
void FakeResolverResponseGenerator::SetFakeResolver(
@@ -300,10 +300,10 @@ void FakeResolverResponseGenerator::SetFakeResolver(
resolver_ = std::move(resolver);
if (resolver_ == nullptr) return;
if (has_result_) {
- FakeResolverResponseSetter* arg =
- new FakeResolverResponseSetter(resolver_, std::move(result_));
- resolver_->work_serializer()->Run([arg]() { arg->SetResponseLocked(); },
- DEBUG_LOCATION);
+ FakeResolverResponseSetter* arg =
+ new FakeResolverResponseSetter(resolver_, std::move(result_));
+ resolver_->work_serializer()->Run([arg]() { arg->SetResponseLocked(); },
+ DEBUG_LOCATION);
has_result_ = false;
}
}
@@ -377,7 +377,7 @@ class FakeResolverFactory : public ResolverFactory {
void grpc_resolver_fake_init() {
grpc_core::ResolverRegistry::Builder::RegisterResolverFactory(
- y_absl::make_unique<grpc_core::FakeResolverFactory>());
+ y_absl::make_unique<grpc_core::FakeResolverFactory>());
}
void grpc_resolver_fake_shutdown() {}
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc
index 8bc3907d5a6..b52bd8afba5 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc
@@ -30,10 +30,10 @@
#include "src/core/ext/filters/client_channel/server_address.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/gpr/string.h"
-#include "src/core/lib/iomgr/parse_address.h"
+#include "src/core/lib/iomgr/parse_address.h"
#include "src/core/lib/iomgr/resolve_address.h"
#include "src/core/lib/iomgr/unix_sockets_posix.h"
-#include "src/core/lib/iomgr/work_serializer.h"
+#include "src/core/lib/iomgr/work_serializer.h"
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/slice/slice_string_helpers.h"
@@ -57,7 +57,7 @@ class SockaddrResolver : public Resolver {
SockaddrResolver::SockaddrResolver(ServerAddressList addresses,
ResolverArgs args)
- : Resolver(std::move(args.work_serializer), std::move(args.result_handler)),
+ : Resolver(std::move(args.work_serializer), std::move(args.result_handler)),
addresses_(std::move(addresses)),
channel_args_(grpc_channel_args_copy(args.args)) {}
@@ -176,12 +176,12 @@ class UnixResolverFactory : public ResolverFactory {
void grpc_resolver_sockaddr_init() {
grpc_core::ResolverRegistry::Builder::RegisterResolverFactory(
- y_absl::make_unique<grpc_core::IPv4ResolverFactory>());
+ y_absl::make_unique<grpc_core::IPv4ResolverFactory>());
grpc_core::ResolverRegistry::Builder::RegisterResolverFactory(
- y_absl::make_unique<grpc_core::IPv6ResolverFactory>());
+ y_absl::make_unique<grpc_core::IPv6ResolverFactory>());
#ifdef GRPC_HAVE_UNIX_SOCKET
grpc_core::ResolverRegistry::Builder::RegisterResolverFactory(
- y_absl::make_unique<grpc_core::UnixResolverFactory>());
+ y_absl::make_unique<grpc_core::UnixResolverFactory>());
#endif
}
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc
index 1b19ff674b3..03f98d0fa3e 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc
@@ -18,25 +18,25 @@
#include <grpc/support/port_platform.h>
-#include "y_absl/strings/match.h"
-#include "y_absl/strings/str_join.h"
-#include "y_absl/strings/str_split.h"
-#include "re2/re2.h"
-
-#include "src/core/ext/filters/client_channel/config_selector.h"
+#include "y_absl/strings/match.h"
+#include "y_absl/strings/str_join.h"
+#include "y_absl/strings/str_split.h"
+#include "re2/re2.h"
+
+#include "src/core/ext/filters/client_channel/config_selector.h"
#include "src/core/ext/filters/client_channel/resolver_registry.h"
-#include "src/core/ext/xds/xds_client.h"
-#include "src/core/lib/channel/channel_args.h"
-#include "src/core/lib/iomgr/closure.h"
-#include "src/core/lib/iomgr/exec_ctx.h"
-#include "src/core/lib/transport/timeout_encoding.h"
+#include "src/core/ext/xds/xds_client.h"
+#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/iomgr/closure.h"
+#include "src/core/lib/iomgr/exec_ctx.h"
+#include "src/core/lib/transport/timeout_encoding.h"
namespace grpc_core {
-TraceFlag grpc_xds_resolver_trace(false, "xds_resolver");
-
-const char* kXdsClusterAttribute = "xds_cluster_name";
-
+TraceFlag grpc_xds_resolver_trace(false, "xds_resolver");
+
+const char* kXdsClusterAttribute = "xds_cluster_name";
+
namespace {
//
@@ -46,657 +46,657 @@ namespace {
class XdsResolver : public Resolver {
public:
explicit XdsResolver(ResolverArgs args)
- : Resolver(std::move(args.work_serializer),
- std::move(args.result_handler)),
+ : Resolver(std::move(args.work_serializer),
+ std::move(args.result_handler)),
args_(grpc_channel_args_copy(args.args)),
interested_parties_(args.pollset_set) {
char* path = args.uri->path;
if (path[0] == '/') ++path;
- server_name_ = path;
- if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_resolver_trace)) {
- gpr_log(GPR_INFO, "[xds_resolver %p] created for server name %s", this,
- server_name_.c_str());
- }
+ server_name_ = path;
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_resolver_trace)) {
+ gpr_log(GPR_INFO, "[xds_resolver %p] created for server name %s", this,
+ server_name_.c_str());
+ }
}
- ~XdsResolver() override {
- grpc_channel_args_destroy(args_);
- if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_resolver_trace)) {
- gpr_log(GPR_INFO, "[xds_resolver %p] destroyed", this);
- }
- }
+ ~XdsResolver() override {
+ grpc_channel_args_destroy(args_);
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_resolver_trace)) {
+ gpr_log(GPR_INFO, "[xds_resolver %p] destroyed", this);
+ }
+ }
void StartLocked() override;
- void ShutdownLocked() override;
+ void ShutdownLocked() override;
private:
- class Notifier {
+ class Notifier {
+ public:
+ Notifier(RefCountedPtr<XdsResolver> resolver, XdsApi::LdsUpdate update);
+ Notifier(RefCountedPtr<XdsResolver> resolver, XdsApi::RdsUpdate update);
+ Notifier(RefCountedPtr<XdsResolver> resolver, grpc_error* error);
+ explicit Notifier(RefCountedPtr<XdsResolver> resolver);
+
+ private:
+ enum Type { kLdsUpdate, kRdsUpdate, kError, kDoesNotExist };
+
+ static void RunInExecCtx(void* arg, grpc_error* error);
+ void RunInWorkSerializer(grpc_error* error);
+
+ RefCountedPtr<XdsResolver> resolver_;
+ grpc_closure closure_;
+ XdsApi::LdsUpdate update_;
+ Type type_;
+ };
+
+ class ListenerWatcher : public XdsClient::ListenerWatcherInterface {
public:
- Notifier(RefCountedPtr<XdsResolver> resolver, XdsApi::LdsUpdate update);
- Notifier(RefCountedPtr<XdsResolver> resolver, XdsApi::RdsUpdate update);
- Notifier(RefCountedPtr<XdsResolver> resolver, grpc_error* error);
- explicit Notifier(RefCountedPtr<XdsResolver> resolver);
-
- private:
- enum Type { kLdsUpdate, kRdsUpdate, kError, kDoesNotExist };
-
- static void RunInExecCtx(void* arg, grpc_error* error);
- void RunInWorkSerializer(grpc_error* error);
-
- RefCountedPtr<XdsResolver> resolver_;
- grpc_closure closure_;
- XdsApi::LdsUpdate update_;
- Type type_;
- };
-
- class ListenerWatcher : public XdsClient::ListenerWatcherInterface {
- public:
- explicit ListenerWatcher(RefCountedPtr<XdsResolver> resolver)
+ explicit ListenerWatcher(RefCountedPtr<XdsResolver> resolver)
: resolver_(std::move(resolver)) {}
- void OnListenerChanged(XdsApi::LdsUpdate listener) override {
- new Notifier(resolver_, std::move(listener));
- }
- void OnError(grpc_error* error) override { new Notifier(resolver_, error); }
- void OnResourceDoesNotExist() override { new Notifier(resolver_); }
+ void OnListenerChanged(XdsApi::LdsUpdate listener) override {
+ new Notifier(resolver_, std::move(listener));
+ }
+ void OnError(grpc_error* error) override { new Notifier(resolver_, error); }
+ void OnResourceDoesNotExist() override { new Notifier(resolver_); }
+
+ private:
+ RefCountedPtr<XdsResolver> resolver_;
+ };
+
+ class RouteConfigWatcher : public XdsClient::RouteConfigWatcherInterface {
+ public:
+ explicit RouteConfigWatcher(RefCountedPtr<XdsResolver> resolver)
+ : resolver_(std::move(resolver)) {}
+ void OnRouteConfigChanged(XdsApi::RdsUpdate route_config) override {
+ new Notifier(resolver_, std::move(route_config));
+ }
+ void OnError(grpc_error* error) override { new Notifier(resolver_, error); }
+ void OnResourceDoesNotExist() override { new Notifier(resolver_); }
+
+ private:
+ RefCountedPtr<XdsResolver> resolver_;
+ };
+
+ class ClusterState
+ : public RefCounted<ClusterState, PolymorphicRefCount, false> {
+ public:
+ using ClusterStateMap =
+ std::map<TString, std::unique_ptr<ClusterState>>;
+
+ ClusterState(const TString& cluster_name,
+ ClusterStateMap* cluster_state_map)
+ : it_(cluster_state_map
+ ->emplace(cluster_name, std::unique_ptr<ClusterState>(this))
+ .first) {}
+ const TString& cluster() const { return it_->first; }
+
+ private:
+ ClusterStateMap::iterator it_;
+ };
+
+ class XdsConfigSelector : public ConfigSelector {
+ public:
+ XdsConfigSelector(RefCountedPtr<XdsResolver> resolver,
+ const std::vector<XdsApi::Route>& routes);
+ ~XdsConfigSelector();
+
+ const char* name() const override { return "XdsConfigSelector"; }
+
+ bool Equals(const ConfigSelector* other) const override {
+ const auto* other_xds = static_cast<const XdsConfigSelector*>(other);
+ // Don't need to compare resolver_, since that will always be the same.
+ return route_table_ == other_xds->route_table_ &&
+ clusters_ == other_xds->clusters_;
+ }
+
+ CallConfig GetCallConfig(GetCallConfigArgs args) override;
private:
+ struct Route {
+ XdsApi::Route route;
+ y_absl::InlinedVector<std::pair<uint32_t, y_absl::string_view>, 2>
+ weighted_cluster_state;
+ bool operator==(const Route& other) const {
+ return route == other.route &&
+ weighted_cluster_state == other.weighted_cluster_state;
+ }
+ };
+ using RouteTable = std::vector<Route>;
+
+ void MaybeAddCluster(const TString& name);
+
RefCountedPtr<XdsResolver> resolver_;
+ RouteTable route_table_;
+ std::map<y_absl::string_view, RefCountedPtr<ClusterState>> clusters_;
};
- class RouteConfigWatcher : public XdsClient::RouteConfigWatcherInterface {
- public:
- explicit RouteConfigWatcher(RefCountedPtr<XdsResolver> resolver)
- : resolver_(std::move(resolver)) {}
- void OnRouteConfigChanged(XdsApi::RdsUpdate route_config) override {
- new Notifier(resolver_, std::move(route_config));
- }
- void OnError(grpc_error* error) override { new Notifier(resolver_, error); }
- void OnResourceDoesNotExist() override { new Notifier(resolver_); }
-
- private:
- RefCountedPtr<XdsResolver> resolver_;
- };
-
- class ClusterState
- : public RefCounted<ClusterState, PolymorphicRefCount, false> {
- public:
- using ClusterStateMap =
- std::map<TString, std::unique_ptr<ClusterState>>;
-
- ClusterState(const TString& cluster_name,
- ClusterStateMap* cluster_state_map)
- : it_(cluster_state_map
- ->emplace(cluster_name, std::unique_ptr<ClusterState>(this))
- .first) {}
- const TString& cluster() const { return it_->first; }
-
- private:
- ClusterStateMap::iterator it_;
- };
-
- class XdsConfigSelector : public ConfigSelector {
- public:
- XdsConfigSelector(RefCountedPtr<XdsResolver> resolver,
- const std::vector<XdsApi::Route>& routes);
- ~XdsConfigSelector();
-
- const char* name() const override { return "XdsConfigSelector"; }
-
- bool Equals(const ConfigSelector* other) const override {
- const auto* other_xds = static_cast<const XdsConfigSelector*>(other);
- // Don't need to compare resolver_, since that will always be the same.
- return route_table_ == other_xds->route_table_ &&
- clusters_ == other_xds->clusters_;
- }
-
- CallConfig GetCallConfig(GetCallConfigArgs args) override;
-
- private:
- struct Route {
- XdsApi::Route route;
- y_absl::InlinedVector<std::pair<uint32_t, y_absl::string_view>, 2>
- weighted_cluster_state;
- bool operator==(const Route& other) const {
- return route == other.route &&
- weighted_cluster_state == other.weighted_cluster_state;
- }
- };
- using RouteTable = std::vector<Route>;
-
- void MaybeAddCluster(const TString& name);
-
- RefCountedPtr<XdsResolver> resolver_;
- RouteTable route_table_;
- std::map<y_absl::string_view, RefCountedPtr<ClusterState>> clusters_;
- };
-
- void OnListenerUpdate(XdsApi::LdsUpdate listener);
- void OnRouteConfigUpdate(XdsApi::RdsUpdate rds_update);
- void OnError(grpc_error* error);
- void OnResourceDoesNotExist();
-
- grpc_error* CreateServiceConfig(RefCountedPtr<ServiceConfig>* service_config);
- void GenerateResult();
- void MaybeRemoveUnusedClusters();
-
- TString server_name_;
+ void OnListenerUpdate(XdsApi::LdsUpdate listener);
+ void OnRouteConfigUpdate(XdsApi::RdsUpdate rds_update);
+ void OnError(grpc_error* error);
+ void OnResourceDoesNotExist();
+
+ grpc_error* CreateServiceConfig(RefCountedPtr<ServiceConfig>* service_config);
+ void GenerateResult();
+ void MaybeRemoveUnusedClusters();
+
+ TString server_name_;
const grpc_channel_args* args_;
grpc_pollset_set* interested_parties_;
- RefCountedPtr<XdsClient> xds_client_;
- XdsClient::ListenerWatcherInterface* listener_watcher_ = nullptr;
- TString route_config_name_;
- XdsClient::RouteConfigWatcherInterface* route_config_watcher_ = nullptr;
- ClusterState::ClusterStateMap cluster_state_map_;
- std::vector<XdsApi::Route> current_update_;
+ RefCountedPtr<XdsClient> xds_client_;
+ XdsClient::ListenerWatcherInterface* listener_watcher_ = nullptr;
+ TString route_config_name_;
+ XdsClient::RouteConfigWatcherInterface* route_config_watcher_ = nullptr;
+ ClusterState::ClusterStateMap cluster_state_map_;
+ std::vector<XdsApi::Route> current_update_;
};
-//
-// XdsResolver::Notifier
-//
-
-XdsResolver::Notifier::Notifier(RefCountedPtr<XdsResolver> resolver,
- XdsApi::LdsUpdate update)
- : resolver_(std::move(resolver)),
- update_(std::move(update)),
- type_(kLdsUpdate) {
- GRPC_CLOSURE_INIT(&closure_, &RunInExecCtx, this, nullptr);
- ExecCtx::Run(DEBUG_LOCATION, &closure_, GRPC_ERROR_NONE);
-}
-
-XdsResolver::Notifier::Notifier(RefCountedPtr<XdsResolver> resolver,
- XdsApi::RdsUpdate update)
- : resolver_(std::move(resolver)), type_(kRdsUpdate) {
- update_.rds_update = std::move(update);
- GRPC_CLOSURE_INIT(&closure_, &RunInExecCtx, this, nullptr);
- ExecCtx::Run(DEBUG_LOCATION, &closure_, GRPC_ERROR_NONE);
-}
-
-XdsResolver::Notifier::Notifier(RefCountedPtr<XdsResolver> resolver,
- grpc_error* error)
- : resolver_(std::move(resolver)), type_(kError) {
- GRPC_CLOSURE_INIT(&closure_, &RunInExecCtx, this, nullptr);
- ExecCtx::Run(DEBUG_LOCATION, &closure_, error);
-}
-
-XdsResolver::Notifier::Notifier(RefCountedPtr<XdsResolver> resolver)
- : resolver_(std::move(resolver)), type_(kDoesNotExist) {
- GRPC_CLOSURE_INIT(&closure_, &RunInExecCtx, this, nullptr);
- ExecCtx::Run(DEBUG_LOCATION, &closure_, GRPC_ERROR_NONE);
-}
-
-void XdsResolver::Notifier::RunInExecCtx(void* arg, grpc_error* error) {
- Notifier* self = static_cast<Notifier*>(arg);
- GRPC_ERROR_REF(error);
- self->resolver_->work_serializer()->Run(
- [self, error]() { self->RunInWorkSerializer(error); }, DEBUG_LOCATION);
-}
-
-void XdsResolver::Notifier::RunInWorkSerializer(grpc_error* error) {
- if (resolver_->xds_client_ == nullptr) {
- GRPC_ERROR_UNREF(error);
- delete this;
- return;
- }
- switch (type_) {
- case kLdsUpdate:
- resolver_->OnListenerUpdate(std::move(update_));
- break;
- case kRdsUpdate:
- resolver_->OnRouteConfigUpdate(std::move(*update_.rds_update));
- break;
- case kError:
- resolver_->OnError(error);
- break;
- case kDoesNotExist:
- resolver_->OnResourceDoesNotExist();
- break;
- };
- delete this;
-}
-
-//
-// XdsResolver::XdsConfigSelector
-//
-
-XdsResolver::XdsConfigSelector::XdsConfigSelector(
- RefCountedPtr<XdsResolver> resolver,
- const std::vector<XdsApi::Route>& routes)
- : resolver_(std::move(resolver)) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_resolver_trace)) {
- gpr_log(GPR_INFO, "[xds_resolver %p] creating XdsConfigSelector %p",
- resolver_.get(), this);
- }
- // 1. Construct the route table
- // 2 Update resolver's cluster state map
- // 3. Construct cluster list to hold on to entries in the cluster state
- // map.
- // Reserve the necessary entries up-front to avoid reallocation as we add
- // elements. This is necessary because the string_view in the entry's
- // weighted_cluster_state field points to the memory in the route field, so
- // moving the entry in a reallocation will cause the string_view to point to
- // invalid data.
- route_table_.reserve(routes.size());
- for (auto& route : routes) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_resolver_trace)) {
- gpr_log(GPR_INFO, "[xds_resolver %p] XdsConfigSelector %p: route: %s",
- resolver_.get(), this, route.ToString().c_str());
- }
- route_table_.emplace_back();
- auto& route_entry = route_table_.back();
- route_entry.route = route;
- if (route.weighted_clusters.empty()) {
- MaybeAddCluster(route.cluster_name);
- } else {
- uint32_t end = 0;
- for (const auto& weighted_cluster : route_entry.route.weighted_clusters) {
- MaybeAddCluster(weighted_cluster.name);
- end += weighted_cluster.weight;
- route_entry.weighted_cluster_state.emplace_back(end,
- weighted_cluster.name);
- }
- }
- }
+//
+// XdsResolver::Notifier
+//
+
+XdsResolver::Notifier::Notifier(RefCountedPtr<XdsResolver> resolver,
+ XdsApi::LdsUpdate update)
+ : resolver_(std::move(resolver)),
+ update_(std::move(update)),
+ type_(kLdsUpdate) {
+ GRPC_CLOSURE_INIT(&closure_, &RunInExecCtx, this, nullptr);
+ ExecCtx::Run(DEBUG_LOCATION, &closure_, GRPC_ERROR_NONE);
+}
+
+XdsResolver::Notifier::Notifier(RefCountedPtr<XdsResolver> resolver,
+ XdsApi::RdsUpdate update)
+ : resolver_(std::move(resolver)), type_(kRdsUpdate) {
+ update_.rds_update = std::move(update);
+ GRPC_CLOSURE_INIT(&closure_, &RunInExecCtx, this, nullptr);
+ ExecCtx::Run(DEBUG_LOCATION, &closure_, GRPC_ERROR_NONE);
+}
+
+XdsResolver::Notifier::Notifier(RefCountedPtr<XdsResolver> resolver,
+ grpc_error* error)
+ : resolver_(std::move(resolver)), type_(kError) {
+ GRPC_CLOSURE_INIT(&closure_, &RunInExecCtx, this, nullptr);
+ ExecCtx::Run(DEBUG_LOCATION, &closure_, error);
+}
+
+XdsResolver::Notifier::Notifier(RefCountedPtr<XdsResolver> resolver)
+ : resolver_(std::move(resolver)), type_(kDoesNotExist) {
+ GRPC_CLOSURE_INIT(&closure_, &RunInExecCtx, this, nullptr);
+ ExecCtx::Run(DEBUG_LOCATION, &closure_, GRPC_ERROR_NONE);
+}
+
+void XdsResolver::Notifier::RunInExecCtx(void* arg, grpc_error* error) {
+ Notifier* self = static_cast<Notifier*>(arg);
+ GRPC_ERROR_REF(error);
+ self->resolver_->work_serializer()->Run(
+ [self, error]() { self->RunInWorkSerializer(error); }, DEBUG_LOCATION);
+}
+
+void XdsResolver::Notifier::RunInWorkSerializer(grpc_error* error) {
+ if (resolver_->xds_client_ == nullptr) {
+ GRPC_ERROR_UNREF(error);
+ delete this;
+ return;
+ }
+ switch (type_) {
+ case kLdsUpdate:
+ resolver_->OnListenerUpdate(std::move(update_));
+ break;
+ case kRdsUpdate:
+ resolver_->OnRouteConfigUpdate(std::move(*update_.rds_update));
+ break;
+ case kError:
+ resolver_->OnError(error);
+ break;
+ case kDoesNotExist:
+ resolver_->OnResourceDoesNotExist();
+ break;
+ };
+ delete this;
+}
+
+//
+// XdsResolver::XdsConfigSelector
+//
+
+XdsResolver::XdsConfigSelector::XdsConfigSelector(
+ RefCountedPtr<XdsResolver> resolver,
+ const std::vector<XdsApi::Route>& routes)
+ : resolver_(std::move(resolver)) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_resolver_trace)) {
+ gpr_log(GPR_INFO, "[xds_resolver %p] creating XdsConfigSelector %p",
+ resolver_.get(), this);
+ }
+ // 1. Construct the route table
+ // 2 Update resolver's cluster state map
+ // 3. Construct cluster list to hold on to entries in the cluster state
+ // map.
+ // Reserve the necessary entries up-front to avoid reallocation as we add
+ // elements. This is necessary because the string_view in the entry's
+ // weighted_cluster_state field points to the memory in the route field, so
+ // moving the entry in a reallocation will cause the string_view to point to
+ // invalid data.
+ route_table_.reserve(routes.size());
+ for (auto& route : routes) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_resolver_trace)) {
+ gpr_log(GPR_INFO, "[xds_resolver %p] XdsConfigSelector %p: route: %s",
+ resolver_.get(), this, route.ToString().c_str());
+ }
+ route_table_.emplace_back();
+ auto& route_entry = route_table_.back();
+ route_entry.route = route;
+ if (route.weighted_clusters.empty()) {
+ MaybeAddCluster(route.cluster_name);
+ } else {
+ uint32_t end = 0;
+ for (const auto& weighted_cluster : route_entry.route.weighted_clusters) {
+ MaybeAddCluster(weighted_cluster.name);
+ end += weighted_cluster.weight;
+ route_entry.weighted_cluster_state.emplace_back(end,
+ weighted_cluster.name);
+ }
+ }
+ }
+}
+
+XdsResolver::XdsConfigSelector::~XdsConfigSelector() {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_resolver_trace)) {
+ gpr_log(GPR_INFO, "[xds_resolver %p] destroying XdsConfigSelector %p",
+ resolver_.get(), this);
+ }
+ clusters_.clear();
+ resolver_->MaybeRemoveUnusedClusters();
+}
+
+void XdsResolver::XdsConfigSelector::MaybeAddCluster(const TString& name) {
+ if (clusters_.find(name) == clusters_.end()) {
+ auto it = resolver_->cluster_state_map_.find(name);
+ if (it == resolver_->cluster_state_map_.end()) {
+ auto new_cluster_state =
+ MakeRefCounted<ClusterState>(name, &resolver_->cluster_state_map_);
+ clusters_[new_cluster_state->cluster()] = std::move(new_cluster_state);
+ } else {
+ clusters_[it->second->cluster()] = it->second->Ref();
+ }
+ }
+}
+
+bool PathMatch(const y_absl::string_view& path,
+ const XdsApi::Route::Matchers::PathMatcher& path_matcher) {
+ switch (path_matcher.type) {
+ case XdsApi::Route::Matchers::PathMatcher::PathMatcherType::PREFIX:
+ return y_absl::StartsWith(path, path_matcher.string_matcher);
+ case XdsApi::Route::Matchers::PathMatcher::PathMatcherType::PATH:
+ return path == path_matcher.string_matcher;
+ case XdsApi::Route::Matchers::PathMatcher::PathMatcherType::REGEX:
+ return RE2::FullMatch(path.data(), *path_matcher.regex_matcher);
+ default:
+ return false;
+ }
+}
+
+y_absl::optional<y_absl::string_view> GetMetadataValue(
+ const TString& target_key, grpc_metadata_batch* initial_metadata,
+ TString* concatenated_value) {
+ // Find all values for the specified key.
+ GPR_DEBUG_ASSERT(initial_metadata != nullptr);
+ y_absl::InlinedVector<y_absl::string_view, 1> values;
+ for (grpc_linked_mdelem* md = initial_metadata->list.head; md != nullptr;
+ md = md->next) {
+ y_absl::string_view key = StringViewFromSlice(GRPC_MDKEY(md->md));
+ y_absl::string_view value = StringViewFromSlice(GRPC_MDVALUE(md->md));
+ if (target_key == key) values.push_back(value);
+ }
+ // If none found, no match.
+ if (values.empty()) return y_absl::nullopt;
+ // If exactly one found, return it as-is.
+ if (values.size() == 1) return values.front();
+ // If more than one found, concatenate the values, using
+ // *concatenated_values as a temporary holding place for the
+ // concatenated string.
+ *concatenated_value = y_absl::StrJoin(values, ",");
+ return *concatenated_value;
}
-XdsResolver::XdsConfigSelector::~XdsConfigSelector() {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_resolver_trace)) {
- gpr_log(GPR_INFO, "[xds_resolver %p] destroying XdsConfigSelector %p",
- resolver_.get(), this);
- }
- clusters_.clear();
- resolver_->MaybeRemoveUnusedClusters();
+bool HeaderMatchHelper(
+ const XdsApi::Route::Matchers::HeaderMatcher& header_matcher,
+ grpc_metadata_batch* initial_metadata) {
+ TString concatenated_value;
+ y_absl::optional<y_absl::string_view> value;
+ // Note: If we ever allow binary headers here, we still need to
+ // special-case ignore "grpc-tags-bin" and "grpc-trace-bin", since
+ // they are not visible to the LB policy in grpc-go.
+ if (y_absl::EndsWith(header_matcher.name, "-bin") ||
+ header_matcher.name == "grpc-previous-rpc-attempts") {
+ value = y_absl::nullopt;
+ } else if (header_matcher.name == "content-type") {
+ value = "application/grpc";
+ } else {
+ value = GetMetadataValue(header_matcher.name, initial_metadata,
+ &concatenated_value);
+ }
+ if (!value.has_value()) {
+ if (header_matcher.type ==
+ XdsApi::Route::Matchers::HeaderMatcher::HeaderMatcherType::PRESENT) {
+ return !header_matcher.present_match;
+ } else {
+ // For all other header matcher types, we need the header value to
+ // exist to consider matches.
+ return false;
+ }
+ }
+ switch (header_matcher.type) {
+ case XdsApi::Route::Matchers::HeaderMatcher::HeaderMatcherType::EXACT:
+ return value.value() == header_matcher.string_matcher;
+ case XdsApi::Route::Matchers::HeaderMatcher::HeaderMatcherType::REGEX:
+ return RE2::FullMatch(value.value().data(), *header_matcher.regex_match);
+ case XdsApi::Route::Matchers::HeaderMatcher::HeaderMatcherType::RANGE:
+ int64_t int_value;
+ if (!y_absl::SimpleAtoi(value.value(), &int_value)) {
+ return false;
+ }
+ return int_value >= header_matcher.range_start &&
+ int_value < header_matcher.range_end;
+ case XdsApi::Route::Matchers::HeaderMatcher::HeaderMatcherType::PREFIX:
+ return y_absl::StartsWith(value.value(), header_matcher.string_matcher);
+ case XdsApi::Route::Matchers::HeaderMatcher::HeaderMatcherType::SUFFIX:
+ return y_absl::EndsWith(value.value(), header_matcher.string_matcher);
+ default:
+ return false;
+ }
}
-void XdsResolver::XdsConfigSelector::MaybeAddCluster(const TString& name) {
- if (clusters_.find(name) == clusters_.end()) {
- auto it = resolver_->cluster_state_map_.find(name);
- if (it == resolver_->cluster_state_map_.end()) {
- auto new_cluster_state =
- MakeRefCounted<ClusterState>(name, &resolver_->cluster_state_map_);
- clusters_[new_cluster_state->cluster()] = std::move(new_cluster_state);
- } else {
- clusters_[it->second->cluster()] = it->second->Ref();
- }
- }
-}
-
-bool PathMatch(const y_absl::string_view& path,
- const XdsApi::Route::Matchers::PathMatcher& path_matcher) {
- switch (path_matcher.type) {
- case XdsApi::Route::Matchers::PathMatcher::PathMatcherType::PREFIX:
- return y_absl::StartsWith(path, path_matcher.string_matcher);
- case XdsApi::Route::Matchers::PathMatcher::PathMatcherType::PATH:
- return path == path_matcher.string_matcher;
- case XdsApi::Route::Matchers::PathMatcher::PathMatcherType::REGEX:
- return RE2::FullMatch(path.data(), *path_matcher.regex_matcher);
- default:
- return false;
- }
-}
-
-y_absl::optional<y_absl::string_view> GetMetadataValue(
- const TString& target_key, grpc_metadata_batch* initial_metadata,
- TString* concatenated_value) {
- // Find all values for the specified key.
- GPR_DEBUG_ASSERT(initial_metadata != nullptr);
- y_absl::InlinedVector<y_absl::string_view, 1> values;
- for (grpc_linked_mdelem* md = initial_metadata->list.head; md != nullptr;
- md = md->next) {
- y_absl::string_view key = StringViewFromSlice(GRPC_MDKEY(md->md));
- y_absl::string_view value = StringViewFromSlice(GRPC_MDVALUE(md->md));
- if (target_key == key) values.push_back(value);
- }
- // If none found, no match.
- if (values.empty()) return y_absl::nullopt;
- // If exactly one found, return it as-is.
- if (values.size() == 1) return values.front();
- // If more than one found, concatenate the values, using
- // *concatenated_values as a temporary holding place for the
- // concatenated string.
- *concatenated_value = y_absl::StrJoin(values, ",");
- return *concatenated_value;
-}
-
-bool HeaderMatchHelper(
- const XdsApi::Route::Matchers::HeaderMatcher& header_matcher,
- grpc_metadata_batch* initial_metadata) {
- TString concatenated_value;
- y_absl::optional<y_absl::string_view> value;
- // Note: If we ever allow binary headers here, we still need to
- // special-case ignore "grpc-tags-bin" and "grpc-trace-bin", since
- // they are not visible to the LB policy in grpc-go.
- if (y_absl::EndsWith(header_matcher.name, "-bin") ||
- header_matcher.name == "grpc-previous-rpc-attempts") {
- value = y_absl::nullopt;
- } else if (header_matcher.name == "content-type") {
- value = "application/grpc";
- } else {
- value = GetMetadataValue(header_matcher.name, initial_metadata,
- &concatenated_value);
- }
- if (!value.has_value()) {
- if (header_matcher.type ==
- XdsApi::Route::Matchers::HeaderMatcher::HeaderMatcherType::PRESENT) {
- return !header_matcher.present_match;
- } else {
- // For all other header matcher types, we need the header value to
- // exist to consider matches.
- return false;
- }
- }
- switch (header_matcher.type) {
- case XdsApi::Route::Matchers::HeaderMatcher::HeaderMatcherType::EXACT:
- return value.value() == header_matcher.string_matcher;
- case XdsApi::Route::Matchers::HeaderMatcher::HeaderMatcherType::REGEX:
- return RE2::FullMatch(value.value().data(), *header_matcher.regex_match);
- case XdsApi::Route::Matchers::HeaderMatcher::HeaderMatcherType::RANGE:
- int64_t int_value;
- if (!y_absl::SimpleAtoi(value.value(), &int_value)) {
- return false;
- }
- return int_value >= header_matcher.range_start &&
- int_value < header_matcher.range_end;
- case XdsApi::Route::Matchers::HeaderMatcher::HeaderMatcherType::PREFIX:
- return y_absl::StartsWith(value.value(), header_matcher.string_matcher);
- case XdsApi::Route::Matchers::HeaderMatcher::HeaderMatcherType::SUFFIX:
- return y_absl::EndsWith(value.value(), header_matcher.string_matcher);
- default:
- return false;
- }
-}
-
-bool HeadersMatch(
- const std::vector<XdsApi::Route::Matchers::HeaderMatcher>& header_matchers,
- grpc_metadata_batch* initial_metadata) {
- for (const auto& header_matcher : header_matchers) {
- bool match = HeaderMatchHelper(header_matcher, initial_metadata);
- if (header_matcher.invert_match) match = !match;
- if (!match) return false;
- }
- return true;
-}
-
-bool UnderFraction(const uint32_t fraction_per_million) {
- // Generate a random number in [0, 1000000).
- const uint32_t random_number = rand() % 1000000;
- return random_number < fraction_per_million;
-}
-
-ConfigSelector::CallConfig XdsResolver::XdsConfigSelector::GetCallConfig(
- GetCallConfigArgs args) {
- for (const auto& entry : route_table_) {
- // Path matching.
- if (!PathMatch(StringViewFromSlice(*args.path),
- entry.route.matchers.path_matcher)) {
- continue;
- }
- // Header Matching.
- if (!HeadersMatch(entry.route.matchers.header_matchers,
- args.initial_metadata)) {
- continue;
- }
- // Match fraction check
- if (entry.route.matchers.fraction_per_million.has_value() &&
- !UnderFraction(entry.route.matchers.fraction_per_million.value())) {
- continue;
- }
- // Found a route match
- y_absl::string_view cluster_name;
- if (entry.route.weighted_clusters.empty()) {
- cluster_name = entry.route.cluster_name;
- } else {
- const uint32_t key =
- rand() %
- entry.weighted_cluster_state[entry.weighted_cluster_state.size() - 1]
- .first;
- // Find the index in weighted clusters corresponding to key.
- size_t mid = 0;
- size_t start_index = 0;
- size_t end_index = entry.weighted_cluster_state.size() - 1;
- size_t index = 0;
- while (end_index > start_index) {
- mid = (start_index + end_index) / 2;
- if (entry.weighted_cluster_state[mid].first > key) {
- end_index = mid;
- } else if (entry.weighted_cluster_state[mid].first < key) {
- start_index = mid + 1;
- } else {
- index = mid + 1;
- break;
- }
- }
- if (index == 0) index = start_index;
- GPR_ASSERT(entry.weighted_cluster_state[index].first > key);
- cluster_name = entry.weighted_cluster_state[index].second;
- }
- auto it = clusters_.find(cluster_name);
- GPR_ASSERT(it != clusters_.end());
- XdsResolver* resolver =
- static_cast<XdsResolver*>(resolver_->Ref().release());
- ClusterState* cluster_state = it->second->Ref().release();
- CallConfig call_config;
- call_config.call_attributes[kXdsClusterAttribute] = it->first;
- call_config.on_call_committed = [resolver, cluster_state]() {
- cluster_state->Unref();
- ExecCtx::Run(
- // TODO(roth): This hop into the ExecCtx is being done to avoid
- // entering the WorkSerializer while holding the client channel data
- // plane mutex, since that can lead to deadlocks. However, we should
- // not have to solve this problem in each individual ConfigSelector
- // implementation. When we have time, we should fix the client channel
- // code to avoid this by not invoking the
- // CallConfig::on_call_committed callback until after it has released
- // the data plane mutex.
- DEBUG_LOCATION,
- GRPC_CLOSURE_CREATE(
- [](void* arg, grpc_error* /*error*/) {
- auto* resolver = static_cast<XdsResolver*>(arg);
- resolver->work_serializer()->Run(
- [resolver]() {
- resolver->MaybeRemoveUnusedClusters();
- resolver->Unref();
- },
- DEBUG_LOCATION);
- },
- resolver, nullptr),
- GRPC_ERROR_NONE);
- };
- return call_config;
- }
- return CallConfig();
-}
-
-//
-// XdsResolver
-//
-
+bool HeadersMatch(
+ const std::vector<XdsApi::Route::Matchers::HeaderMatcher>& header_matchers,
+ grpc_metadata_batch* initial_metadata) {
+ for (const auto& header_matcher : header_matchers) {
+ bool match = HeaderMatchHelper(header_matcher, initial_metadata);
+ if (header_matcher.invert_match) match = !match;
+ if (!match) return false;
+ }
+ return true;
+}
+
+bool UnderFraction(const uint32_t fraction_per_million) {
+ // Generate a random number in [0, 1000000).
+ const uint32_t random_number = rand() % 1000000;
+ return random_number < fraction_per_million;
+}
+
+ConfigSelector::CallConfig XdsResolver::XdsConfigSelector::GetCallConfig(
+ GetCallConfigArgs args) {
+ for (const auto& entry : route_table_) {
+ // Path matching.
+ if (!PathMatch(StringViewFromSlice(*args.path),
+ entry.route.matchers.path_matcher)) {
+ continue;
+ }
+ // Header Matching.
+ if (!HeadersMatch(entry.route.matchers.header_matchers,
+ args.initial_metadata)) {
+ continue;
+ }
+ // Match fraction check
+ if (entry.route.matchers.fraction_per_million.has_value() &&
+ !UnderFraction(entry.route.matchers.fraction_per_million.value())) {
+ continue;
+ }
+ // Found a route match
+ y_absl::string_view cluster_name;
+ if (entry.route.weighted_clusters.empty()) {
+ cluster_name = entry.route.cluster_name;
+ } else {
+ const uint32_t key =
+ rand() %
+ entry.weighted_cluster_state[entry.weighted_cluster_state.size() - 1]
+ .first;
+ // Find the index in weighted clusters corresponding to key.
+ size_t mid = 0;
+ size_t start_index = 0;
+ size_t end_index = entry.weighted_cluster_state.size() - 1;
+ size_t index = 0;
+ while (end_index > start_index) {
+ mid = (start_index + end_index) / 2;
+ if (entry.weighted_cluster_state[mid].first > key) {
+ end_index = mid;
+ } else if (entry.weighted_cluster_state[mid].first < key) {
+ start_index = mid + 1;
+ } else {
+ index = mid + 1;
+ break;
+ }
+ }
+ if (index == 0) index = start_index;
+ GPR_ASSERT(entry.weighted_cluster_state[index].first > key);
+ cluster_name = entry.weighted_cluster_state[index].second;
+ }
+ auto it = clusters_.find(cluster_name);
+ GPR_ASSERT(it != clusters_.end());
+ XdsResolver* resolver =
+ static_cast<XdsResolver*>(resolver_->Ref().release());
+ ClusterState* cluster_state = it->second->Ref().release();
+ CallConfig call_config;
+ call_config.call_attributes[kXdsClusterAttribute] = it->first;
+ call_config.on_call_committed = [resolver, cluster_state]() {
+ cluster_state->Unref();
+ ExecCtx::Run(
+ // TODO(roth): This hop into the ExecCtx is being done to avoid
+ // entering the WorkSerializer while holding the client channel data
+ // plane mutex, since that can lead to deadlocks. However, we should
+ // not have to solve this problem in each individual ConfigSelector
+ // implementation. When we have time, we should fix the client channel
+ // code to avoid this by not invoking the
+ // CallConfig::on_call_committed callback until after it has released
+ // the data plane mutex.
+ DEBUG_LOCATION,
+ GRPC_CLOSURE_CREATE(
+ [](void* arg, grpc_error* /*error*/) {
+ auto* resolver = static_cast<XdsResolver*>(arg);
+ resolver->work_serializer()->Run(
+ [resolver]() {
+ resolver->MaybeRemoveUnusedClusters();
+ resolver->Unref();
+ },
+ DEBUG_LOCATION);
+ },
+ resolver, nullptr),
+ GRPC_ERROR_NONE);
+ };
+ return call_config;
+ }
+ return CallConfig();
+}
+
+//
+// XdsResolver
+//
+
void XdsResolver::StartLocked() {
grpc_error* error = GRPC_ERROR_NONE;
- xds_client_ = XdsClient::GetOrCreate(&error);
+ xds_client_ = XdsClient::GetOrCreate(&error);
if (error != GRPC_ERROR_NONE) {
gpr_log(GPR_ERROR,
"Failed to create xds client -- channel will remain in "
"TRANSIENT_FAILURE: %s",
grpc_error_string(error));
result_handler()->ReturnError(error);
- return;
+ return;
+ }
+ grpc_pollset_set_add_pollset_set(xds_client_->interested_parties(),
+ interested_parties_);
+ channelz::ChannelNode* parent_channelz_node =
+ grpc_channel_args_find_pointer<channelz::ChannelNode>(
+ args_, GRPC_ARG_CHANNELZ_CHANNEL_NODE);
+ if (parent_channelz_node != nullptr) {
+ xds_client_->AddChannelzLinkage(parent_channelz_node);
+ }
+ auto watcher = y_absl::make_unique<ListenerWatcher>(Ref());
+ listener_watcher_ = watcher.get();
+ xds_client_->WatchListenerData(server_name_, std::move(watcher));
+}
+
+void XdsResolver::ShutdownLocked() {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_resolver_trace)) {
+ gpr_log(GPR_INFO, "[xds_resolver %p] shutting down", this);
+ }
+ if (xds_client_ != nullptr) {
+ if (listener_watcher_ != nullptr) {
+ xds_client_->CancelListenerDataWatch(server_name_, listener_watcher_,
+ /*delay_unsubscription=*/false);
+ }
+ if (route_config_watcher_ != nullptr) {
+ xds_client_->CancelRouteConfigDataWatch(
+ server_name_, route_config_watcher_, /*delay_unsubscription=*/false);
+ }
+ channelz::ChannelNode* parent_channelz_node =
+ grpc_channel_args_find_pointer<channelz::ChannelNode>(
+ args_, GRPC_ARG_CHANNELZ_CHANNEL_NODE);
+ if (parent_channelz_node != nullptr) {
+ xds_client_->RemoveChannelzLinkage(parent_channelz_node);
+ }
+ grpc_pollset_set_del_pollset_set(xds_client_->interested_parties(),
+ interested_parties_);
+ xds_client_.reset();
+ }
+}
+
+void XdsResolver::OnListenerUpdate(XdsApi::LdsUpdate listener) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_resolver_trace)) {
+ gpr_log(GPR_INFO, "[xds_resolver %p] received updated listener data", this);
+ }
+ if (listener.route_config_name != route_config_name_) {
+ if (route_config_watcher_ != nullptr) {
+ xds_client_->CancelRouteConfigDataWatch(
+ route_config_name_, route_config_watcher_,
+ /*delay_unsubscription=*/!listener.route_config_name.empty());
+ route_config_watcher_ = nullptr;
+ }
+ route_config_name_ = std::move(listener.route_config_name);
+ if (!route_config_name_.empty()) {
+ auto watcher = y_absl::make_unique<RouteConfigWatcher>(Ref());
+ route_config_watcher_ = watcher.get();
+ xds_client_->WatchRouteConfigData(route_config_name_, std::move(watcher));
+ }
+ }
+ if (route_config_name_.empty()) {
+ GPR_ASSERT(listener.rds_update.has_value());
+ OnRouteConfigUpdate(std::move(*listener.rds_update));
+ }
+}
+
+void XdsResolver::OnRouteConfigUpdate(XdsApi::RdsUpdate rds_update) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_resolver_trace)) {
+ gpr_log(GPR_INFO, "[xds_resolver %p] received updated route config", this);
+ }
+ // Find the relevant VirtualHost from the RouteConfiguration.
+ XdsApi::RdsUpdate::VirtualHost* vhost =
+ rds_update.FindVirtualHostForDomain(server_name_);
+ if (vhost == nullptr) {
+ OnError(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrCat("could not find VirtualHost for ", server_name_,
+ " in RouteConfiguration")
+ .c_str()));
+ return;
+ }
+ // Save the list of routes in the resolver.
+ current_update_ = std::move(vhost->routes);
+ // Send a new result to the channel.
+ GenerateResult();
+}
+
+void XdsResolver::OnError(grpc_error* error) {
+ gpr_log(GPR_ERROR, "[xds_resolver %p] received error from XdsClient: %s",
+ this, grpc_error_string(error));
+ Result result;
+ result.args = grpc_channel_args_copy(args_);
+ result.service_config_error = error;
+ result_handler()->ReturnResult(std::move(result));
+}
+
+void XdsResolver::OnResourceDoesNotExist() {
+ gpr_log(GPR_ERROR,
+ "[xds_resolver %p] LDS/RDS resource does not exist -- clearing "
+ "update and returning empty service config",
+ this);
+ current_update_.clear();
+ Result result;
+ result.service_config =
+ ServiceConfig::Create(args_, "{}", &result.service_config_error);
+ GPR_ASSERT(result.service_config != nullptr);
+ result.args = grpc_channel_args_copy(args_);
+ result_handler()->ReturnResult(std::move(result));
+}
+
+grpc_error* XdsResolver::CreateServiceConfig(
+ RefCountedPtr<ServiceConfig>* service_config) {
+ std::vector<TString> clusters;
+ for (const auto& cluster : cluster_state_map_) {
+ clusters.push_back(
+ y_absl::StrFormat(" \"%s\":{\n"
+ " \"childPolicy\":[ {\n"
+ " \"cds_experimental\":{\n"
+ " \"cluster\": \"%s\"\n"
+ " }\n"
+ " } ]\n"
+ " }",
+ cluster.first, cluster.first));
+ }
+ std::vector<TString> config_parts;
+ config_parts.push_back(
+ "{\n"
+ " \"loadBalancingConfig\":[\n"
+ " { \"xds_cluster_manager_experimental\":{\n"
+ " \"children\":{\n");
+ config_parts.push_back(y_absl::StrJoin(clusters, ",\n"));
+ config_parts.push_back(
+ " }\n"
+ " } }\n"
+ " ]\n"
+ "}");
+ TString json = y_absl::StrJoin(config_parts, "");
+ grpc_error* error = GRPC_ERROR_NONE;
+ *service_config = ServiceConfig::Create(args_, json.c_str(), &error);
+ return error;
+}
+
+void XdsResolver::GenerateResult() {
+ if (current_update_.empty()) return;
+ // First create XdsConfigSelector, which may add new entries to the cluster
+ // state map, and then CreateServiceConfig for LB policies.
+ auto config_selector =
+ MakeRefCounted<XdsConfigSelector>(Ref(), current_update_);
+ Result result;
+ grpc_error* error = CreateServiceConfig(&result.service_config);
+ if (error != GRPC_ERROR_NONE) {
+ OnError(error);
+ return;
+ }
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_resolver_trace)) {
+ gpr_log(GPR_INFO, "[xds_resolver %p] generated service config: %s", this,
+ result.service_config->json_string().c_str());
+ }
+ grpc_arg new_arg = config_selector->MakeChannelArg();
+ result.args = grpc_channel_args_copy_and_add(args_, &new_arg, 1);
+ result_handler()->ReturnResult(std::move(result));
+}
+
+void XdsResolver::MaybeRemoveUnusedClusters() {
+ bool update_needed = false;
+ for (auto it = cluster_state_map_.begin(); it != cluster_state_map_.end();) {
+ RefCountedPtr<ClusterState> cluster_state = it->second->RefIfNonZero();
+ if (cluster_state != nullptr) {
+ ++it;
+ } else {
+ update_needed = true;
+ it = cluster_state_map_.erase(it);
+ }
+ }
+ if (update_needed && xds_client_ != nullptr) {
+ // Send a new result to the channel.
+ GenerateResult();
}
- grpc_pollset_set_add_pollset_set(xds_client_->interested_parties(),
- interested_parties_);
- channelz::ChannelNode* parent_channelz_node =
- grpc_channel_args_find_pointer<channelz::ChannelNode>(
- args_, GRPC_ARG_CHANNELZ_CHANNEL_NODE);
- if (parent_channelz_node != nullptr) {
- xds_client_->AddChannelzLinkage(parent_channelz_node);
- }
- auto watcher = y_absl::make_unique<ListenerWatcher>(Ref());
- listener_watcher_ = watcher.get();
- xds_client_->WatchListenerData(server_name_, std::move(watcher));
}
-void XdsResolver::ShutdownLocked() {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_resolver_trace)) {
- gpr_log(GPR_INFO, "[xds_resolver %p] shutting down", this);
- }
- if (xds_client_ != nullptr) {
- if (listener_watcher_ != nullptr) {
- xds_client_->CancelListenerDataWatch(server_name_, listener_watcher_,
- /*delay_unsubscription=*/false);
- }
- if (route_config_watcher_ != nullptr) {
- xds_client_->CancelRouteConfigDataWatch(
- server_name_, route_config_watcher_, /*delay_unsubscription=*/false);
- }
- channelz::ChannelNode* parent_channelz_node =
- grpc_channel_args_find_pointer<channelz::ChannelNode>(
- args_, GRPC_ARG_CHANNELZ_CHANNEL_NODE);
- if (parent_channelz_node != nullptr) {
- xds_client_->RemoveChannelzLinkage(parent_channelz_node);
- }
- grpc_pollset_set_del_pollset_set(xds_client_->interested_parties(),
- interested_parties_);
- xds_client_.reset();
- }
-}
-
-void XdsResolver::OnListenerUpdate(XdsApi::LdsUpdate listener) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_resolver_trace)) {
- gpr_log(GPR_INFO, "[xds_resolver %p] received updated listener data", this);
- }
- if (listener.route_config_name != route_config_name_) {
- if (route_config_watcher_ != nullptr) {
- xds_client_->CancelRouteConfigDataWatch(
- route_config_name_, route_config_watcher_,
- /*delay_unsubscription=*/!listener.route_config_name.empty());
- route_config_watcher_ = nullptr;
- }
- route_config_name_ = std::move(listener.route_config_name);
- if (!route_config_name_.empty()) {
- auto watcher = y_absl::make_unique<RouteConfigWatcher>(Ref());
- route_config_watcher_ = watcher.get();
- xds_client_->WatchRouteConfigData(route_config_name_, std::move(watcher));
- }
- }
- if (route_config_name_.empty()) {
- GPR_ASSERT(listener.rds_update.has_value());
- OnRouteConfigUpdate(std::move(*listener.rds_update));
- }
-}
-
-void XdsResolver::OnRouteConfigUpdate(XdsApi::RdsUpdate rds_update) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_resolver_trace)) {
- gpr_log(GPR_INFO, "[xds_resolver %p] received updated route config", this);
- }
- // Find the relevant VirtualHost from the RouteConfiguration.
- XdsApi::RdsUpdate::VirtualHost* vhost =
- rds_update.FindVirtualHostForDomain(server_name_);
- if (vhost == nullptr) {
- OnError(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("could not find VirtualHost for ", server_name_,
- " in RouteConfiguration")
- .c_str()));
- return;
- }
- // Save the list of routes in the resolver.
- current_update_ = std::move(vhost->routes);
- // Send a new result to the channel.
- GenerateResult();
-}
-
-void XdsResolver::OnError(grpc_error* error) {
- gpr_log(GPR_ERROR, "[xds_resolver %p] received error from XdsClient: %s",
- this, grpc_error_string(error));
- Result result;
- result.args = grpc_channel_args_copy(args_);
- result.service_config_error = error;
- result_handler()->ReturnResult(std::move(result));
-}
-
-void XdsResolver::OnResourceDoesNotExist() {
- gpr_log(GPR_ERROR,
- "[xds_resolver %p] LDS/RDS resource does not exist -- clearing "
- "update and returning empty service config",
- this);
- current_update_.clear();
- Result result;
- result.service_config =
- ServiceConfig::Create(args_, "{}", &result.service_config_error);
- GPR_ASSERT(result.service_config != nullptr);
- result.args = grpc_channel_args_copy(args_);
- result_handler()->ReturnResult(std::move(result));
-}
-
-grpc_error* XdsResolver::CreateServiceConfig(
- RefCountedPtr<ServiceConfig>* service_config) {
- std::vector<TString> clusters;
- for (const auto& cluster : cluster_state_map_) {
- clusters.push_back(
- y_absl::StrFormat(" \"%s\":{\n"
- " \"childPolicy\":[ {\n"
- " \"cds_experimental\":{\n"
- " \"cluster\": \"%s\"\n"
- " }\n"
- " } ]\n"
- " }",
- cluster.first, cluster.first));
- }
- std::vector<TString> config_parts;
- config_parts.push_back(
- "{\n"
- " \"loadBalancingConfig\":[\n"
- " { \"xds_cluster_manager_experimental\":{\n"
- " \"children\":{\n");
- config_parts.push_back(y_absl::StrJoin(clusters, ",\n"));
- config_parts.push_back(
- " }\n"
- " } }\n"
- " ]\n"
- "}");
- TString json = y_absl::StrJoin(config_parts, "");
- grpc_error* error = GRPC_ERROR_NONE;
- *service_config = ServiceConfig::Create(args_, json.c_str(), &error);
- return error;
-}
-
-void XdsResolver::GenerateResult() {
- if (current_update_.empty()) return;
- // First create XdsConfigSelector, which may add new entries to the cluster
- // state map, and then CreateServiceConfig for LB policies.
- auto config_selector =
- MakeRefCounted<XdsConfigSelector>(Ref(), current_update_);
- Result result;
- grpc_error* error = CreateServiceConfig(&result.service_config);
- if (error != GRPC_ERROR_NONE) {
- OnError(error);
- return;
- }
- if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_resolver_trace)) {
- gpr_log(GPR_INFO, "[xds_resolver %p] generated service config: %s", this,
- result.service_config->json_string().c_str());
- }
- grpc_arg new_arg = config_selector->MakeChannelArg();
- result.args = grpc_channel_args_copy_and_add(args_, &new_arg, 1);
- result_handler()->ReturnResult(std::move(result));
-}
-
-void XdsResolver::MaybeRemoveUnusedClusters() {
- bool update_needed = false;
- for (auto it = cluster_state_map_.begin(); it != cluster_state_map_.end();) {
- RefCountedPtr<ClusterState> cluster_state = it->second->RefIfNonZero();
- if (cluster_state != nullptr) {
- ++it;
- } else {
- update_needed = true;
- it = cluster_state_map_.erase(it);
- }
- }
- if (update_needed && xds_client_ != nullptr) {
- // Send a new result to the channel.
- GenerateResult();
- }
-}
-
//
// Factory
//
@@ -716,7 +716,7 @@ class XdsResolverFactory : public ResolverFactory {
return MakeOrphanable<XdsResolver>(std::move(args));
}
- const char* scheme() const override { return "xds"; }
+ const char* scheme() const override { return "xds"; }
};
} // namespace
@@ -725,7 +725,7 @@ class XdsResolverFactory : public ResolverFactory {
void grpc_resolver_xds_init() {
grpc_core::ResolverRegistry::Builder::RegisterResolverFactory(
- y_absl::make_unique<grpc_core::XdsResolverFactory>());
+ y_absl::make_unique<grpc_core::XdsResolverFactory>());
}
void grpc_resolver_xds_shutdown() {}
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.h b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.h
index 6d50877cfb0..72a80a97e1f 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.h
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.h
@@ -1,28 +1,28 @@
-//
-// Copyright 2019 gRPC authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-#ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_XDS_XDS_RESOLVER_H
-#define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_XDS_XDS_RESOLVER_H
-
-#include <grpc/support/port_platform.h>
-
-namespace grpc_core {
-
-extern const char* kXdsClusterAttribute;
-
-} // namespace grpc_core
-
-#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_XDS_XDS_RESOLVER_H */
+//
+// Copyright 2019 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+#ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_XDS_XDS_RESOLVER_H
+#define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_XDS_XDS_RESOLVER_H
+
+#include <grpc/support/port_platform.h>
+
+namespace grpc_core {
+
+extern const char* kXdsClusterAttribute;
+
+} // namespace grpc_core
+
+#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_XDS_XDS_RESOLVER_H */
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver_factory.h b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver_factory.h
index 76e388c6a22..d8dd801ae09 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver_factory.h
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver_factory.h
@@ -38,8 +38,8 @@ struct ResolverArgs {
const grpc_channel_args* args = nullptr;
/// Used to drive I/O in the name resolution process.
grpc_pollset_set* pollset_set = nullptr;
- /// The work_serializer under which all resolver calls will be run.
- std::shared_ptr<WorkSerializer> work_serializer;
+ /// The work_serializer under which all resolver calls will be run.
+ std::shared_ptr<WorkSerializer> work_serializer;
/// The result handler to be used by the resolver.
std::unique_ptr<Resolver::ResultHandler> result_handler;
};
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver_registry.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver_registry.cc
index e77ce51d468..4cea1ec382c 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver_registry.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver_registry.cc
@@ -22,9 +22,9 @@
#include <string.h>
-#include "y_absl/container/inlined_vector.h"
-#include "y_absl/strings/str_cat.h"
-
+#include "y_absl/container/inlined_vector.h"
+#include "y_absl/strings/str_cat.h"
+
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
@@ -66,22 +66,22 @@ class RegistryState {
// If \a default_prefix_ needs to be prepended, sets \a canonical_target
// to the canonical target string.
ResolverFactory* FindResolverFactory(const char* target, grpc_uri** uri,
- TString* canonical_target) const {
+ TString* canonical_target) const {
GPR_ASSERT(uri != nullptr);
*uri = grpc_uri_parse(target, 1);
ResolverFactory* factory =
*uri == nullptr ? nullptr : LookupResolverFactory((*uri)->scheme);
if (factory == nullptr) {
grpc_uri_destroy(*uri);
- *canonical_target = y_absl::StrCat(default_prefix_.get(), target);
- *uri = grpc_uri_parse(canonical_target->c_str(), 1);
+ *canonical_target = y_absl::StrCat(default_prefix_.get(), target);
+ *uri = grpc_uri_parse(canonical_target->c_str(), 1);
factory =
*uri == nullptr ? nullptr : LookupResolverFactory((*uri)->scheme);
if (factory == nullptr) {
grpc_uri_destroy(grpc_uri_parse(target, 0));
- grpc_uri_destroy(grpc_uri_parse(canonical_target->c_str(), 0));
+ grpc_uri_destroy(grpc_uri_parse(canonical_target->c_str(), 0));
gpr_log(GPR_ERROR, "don't know how to resolve '%s' or '%s'", target,
- canonical_target->c_str());
+ canonical_target->c_str());
}
}
return factory;
@@ -93,7 +93,7 @@ class RegistryState {
// more factories are needed and the additional allocations are
// hurting performance (which is unlikely, since these allocations
// only occur at gRPC initialization time).
- y_absl::InlinedVector<std::unique_ptr<ResolverFactory>, 10> factories_;
+ y_absl::InlinedVector<std::unique_ptr<ResolverFactory>, 10> factories_;
grpc_core::UniquePtr<char> default_prefix_;
};
@@ -137,7 +137,7 @@ ResolverFactory* ResolverRegistry::LookupResolverFactory(const char* scheme) {
bool ResolverRegistry::IsValidTarget(const char* target) {
grpc_uri* uri = nullptr;
- TString canonical_target;
+ TString canonical_target;
ResolverFactory* factory =
g_state->FindResolverFactory(target, &uri, &canonical_target);
bool result = factory == nullptr ? false : factory->IsValidUri(uri);
@@ -147,19 +147,19 @@ bool ResolverRegistry::IsValidTarget(const char* target) {
OrphanablePtr<Resolver> ResolverRegistry::CreateResolver(
const char* target, const grpc_channel_args* args,
- grpc_pollset_set* pollset_set,
- std::shared_ptr<WorkSerializer> work_serializer,
+ grpc_pollset_set* pollset_set,
+ std::shared_ptr<WorkSerializer> work_serializer,
std::unique_ptr<Resolver::ResultHandler> result_handler) {
GPR_ASSERT(g_state != nullptr);
grpc_uri* uri = nullptr;
- TString canonical_target;
+ TString canonical_target;
ResolverFactory* factory =
g_state->FindResolverFactory(target, &uri, &canonical_target);
ResolverArgs resolver_args;
resolver_args.uri = uri;
resolver_args.args = args;
resolver_args.pollset_set = pollset_set;
- resolver_args.work_serializer = std::move(work_serializer);
+ resolver_args.work_serializer = std::move(work_serializer);
resolver_args.result_handler = std::move(result_handler);
OrphanablePtr<Resolver> resolver =
factory == nullptr ? nullptr
@@ -172,7 +172,7 @@ grpc_core::UniquePtr<char> ResolverRegistry::GetDefaultAuthority(
const char* target) {
GPR_ASSERT(g_state != nullptr);
grpc_uri* uri = nullptr;
- TString canonical_target;
+ TString canonical_target;
ResolverFactory* factory =
g_state->FindResolverFactory(target, &uri, &canonical_target);
grpc_core::UniquePtr<char> authority =
@@ -185,12 +185,12 @@ grpc_core::UniquePtr<char> ResolverRegistry::AddDefaultPrefixIfNeeded(
const char* target) {
GPR_ASSERT(g_state != nullptr);
grpc_uri* uri = nullptr;
- TString canonical_target;
+ TString canonical_target;
g_state->FindResolverFactory(target, &uri, &canonical_target);
grpc_uri_destroy(uri);
- return grpc_core::UniquePtr<char>(canonical_target.empty()
- ? gpr_strdup(target)
- : gpr_strdup(canonical_target.c_str()));
+ return grpc_core::UniquePtr<char>(canonical_target.empty()
+ ? gpr_strdup(target)
+ : gpr_strdup(canonical_target.c_str()));
}
} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver_registry.h b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver_registry.h
index 255aae07e2c..bf34216b2cf 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver_registry.h
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver_registry.h
@@ -60,16 +60,16 @@ class ResolverRegistry {
/// prepends default_prefix to target and tries again.
/// If a resolver factory is found, uses it to instantiate a resolver and
/// returns it; otherwise, returns nullptr.
- /// \a args, \a pollset_set, and \a work_serializer are passed to the
- /// factory's \a CreateResolver() method. \a args are the channel args to be
- /// included in resolver results. \a pollset_set is used to drive I/O in the
- /// name resolution process. \a work_serializer is the work_serializer under
- /// which all resolver calls will be run. \a result_handler is used to return
- /// results from the resolver.
+ /// \a args, \a pollset_set, and \a work_serializer are passed to the
+ /// factory's \a CreateResolver() method. \a args are the channel args to be
+ /// included in resolver results. \a pollset_set is used to drive I/O in the
+ /// name resolution process. \a work_serializer is the work_serializer under
+ /// which all resolver calls will be run. \a result_handler is used to return
+ /// results from the resolver.
static OrphanablePtr<Resolver> CreateResolver(
const char* target, const grpc_channel_args* args,
- grpc_pollset_set* pollset_set,
- std::shared_ptr<WorkSerializer> work_serializer,
+ grpc_pollset_set* pollset_set,
+ std::shared_ptr<WorkSerializer> work_serializer,
std::unique_ptr<Resolver::ResultHandler> result_handler);
/// Returns the default authority to pass from a client for \a target.
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver_result_parsing.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver_result_parsing.cc
index 8df384a7e01..e800b1e8f3b 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver_result_parsing.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver_result_parsing.cc
@@ -24,9 +24,9 @@
#include <stdio.h>
#include <string.h>
-#include "y_absl/strings/str_cat.h"
-#include "y_absl/types/optional.h"
-
+#include "y_absl/strings/str_cat.h"
+#include "y_absl/types/optional.h"
+
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
@@ -38,7 +38,7 @@
#include "src/core/lib/channel/status_util.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gprpp/memory.h"
-#include "src/core/lib/json/json_util.h"
+#include "src/core/lib/json/json_util.h"
#include "src/core/lib/uri/uri_parser.h"
// As per the retry design, we do not allow more than 5 retry attempts.
@@ -56,100 +56,100 @@ size_t ClientChannelServiceConfigParser::ParserIndex() {
}
void ClientChannelServiceConfigParser::Register() {
- g_client_channel_service_config_parser_index =
- ServiceConfigParser::RegisterParser(
- y_absl::make_unique<ClientChannelServiceConfigParser>());
+ g_client_channel_service_config_parser_index =
+ ServiceConfigParser::RegisterParser(
+ y_absl::make_unique<ClientChannelServiceConfigParser>());
}
namespace {
std::unique_ptr<ClientChannelMethodParsedConfig::RetryPolicy> ParseRetryPolicy(
- const Json& json, grpc_error** error) {
+ const Json& json, grpc_error** error) {
GPR_DEBUG_ASSERT(error != nullptr && *error == GRPC_ERROR_NONE);
auto retry_policy =
- y_absl::make_unique<ClientChannelMethodParsedConfig::RetryPolicy>();
- if (json.type() != Json::Type::OBJECT) {
+ y_absl::make_unique<ClientChannelMethodParsedConfig::RetryPolicy>();
+ if (json.type() != Json::Type::OBJECT) {
*error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"field:retryPolicy error:should be of type object");
return nullptr;
}
- std::vector<grpc_error*> error_list;
- // Parse maxAttempts.
- auto it = json.object_value().find("maxAttempts");
- if (it != json.object_value().end()) {
- if (it->second.type() != Json::Type::NUMBER) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:maxAttempts error:should be of type number"));
- } else {
- retry_policy->max_attempts =
- gpr_parse_nonnegative_int(it->second.string_value().c_str());
+ std::vector<grpc_error*> error_list;
+ // Parse maxAttempts.
+ auto it = json.object_value().find("maxAttempts");
+ if (it != json.object_value().end()) {
+ if (it->second.type() != Json::Type::NUMBER) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:maxAttempts error:should be of type number"));
+ } else {
+ retry_policy->max_attempts =
+ gpr_parse_nonnegative_int(it->second.string_value().c_str());
if (retry_policy->max_attempts <= 1) {
error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"field:maxAttempts error:should be at least 2"));
- } else if (retry_policy->max_attempts > MAX_MAX_RETRY_ATTEMPTS) {
+ } else if (retry_policy->max_attempts > MAX_MAX_RETRY_ATTEMPTS) {
gpr_log(GPR_ERROR,
"service config: clamped retryPolicy.maxAttempts at %d",
MAX_MAX_RETRY_ATTEMPTS);
retry_policy->max_attempts = MAX_MAX_RETRY_ATTEMPTS;
}
- }
- }
- // Parse initialBackoff.
- it = json.object_value().find("initialBackoff");
- if (it != json.object_value().end()) {
- if (!ParseDurationFromJson(it->second, &retry_policy->initial_backoff)) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:initialBackoff error:Failed to parse"));
- } else if (retry_policy->initial_backoff == 0) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:initialBackoff error:must be greater than 0"));
- }
- }
- // Parse maxBackoff.
- it = json.object_value().find("maxBackoff");
- if (it != json.object_value().end()) {
- if (!ParseDurationFromJson(it->second, &retry_policy->max_backoff)) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:maxBackoff error:failed to parse"));
- } else if (retry_policy->max_backoff == 0) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:maxBackoff error:should be greater than 0"));
- }
- }
- // Parse backoffMultiplier.
- it = json.object_value().find("backoffMultiplier");
- if (it != json.object_value().end()) {
- if (it->second.type() != Json::Type::NUMBER) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:backoffMultiplier error:should be of type number"));
- } else {
- if (sscanf(it->second.string_value().c_str(), "%f",
- &retry_policy->backoff_multiplier) != 1) {
+ }
+ }
+ // Parse initialBackoff.
+ it = json.object_value().find("initialBackoff");
+ if (it != json.object_value().end()) {
+ if (!ParseDurationFromJson(it->second, &retry_policy->initial_backoff)) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:initialBackoff error:Failed to parse"));
+ } else if (retry_policy->initial_backoff == 0) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:initialBackoff error:must be greater than 0"));
+ }
+ }
+ // Parse maxBackoff.
+ it = json.object_value().find("maxBackoff");
+ if (it != json.object_value().end()) {
+ if (!ParseDurationFromJson(it->second, &retry_policy->max_backoff)) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:maxBackoff error:failed to parse"));
+ } else if (retry_policy->max_backoff == 0) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:maxBackoff error:should be greater than 0"));
+ }
+ }
+ // Parse backoffMultiplier.
+ it = json.object_value().find("backoffMultiplier");
+ if (it != json.object_value().end()) {
+ if (it->second.type() != Json::Type::NUMBER) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:backoffMultiplier error:should be of type number"));
+ } else {
+ if (sscanf(it->second.string_value().c_str(), "%f",
+ &retry_policy->backoff_multiplier) != 1) {
error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"field:backoffMultiplier error:failed to parse"));
- } else if (retry_policy->backoff_multiplier <= 0) {
+ } else if (retry_policy->backoff_multiplier <= 0) {
error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"field:backoffMultiplier error:should be greater than 0"));
}
- }
- }
- // Parse retryableStatusCodes.
- it = json.object_value().find("retryableStatusCodes");
- if (it != json.object_value().end()) {
- if (it->second.type() != Json::Type::ARRAY) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:retryableStatusCodes error:should be of type array"));
- } else {
- for (const Json& element : it->second.array_value()) {
- if (element.type() != Json::Type::STRING) {
+ }
+ }
+ // Parse retryableStatusCodes.
+ it = json.object_value().find("retryableStatusCodes");
+ if (it != json.object_value().end()) {
+ if (it->second.type() != Json::Type::ARRAY) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:retryableStatusCodes error:should be of type array"));
+ } else {
+ for (const Json& element : it->second.array_value()) {
+ if (element.type() != Json::Type::STRING) {
error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"field:retryableStatusCodes error:status codes should be of type "
"string"));
continue;
}
grpc_status_code status;
- if (!grpc_status_code_from_string(element.string_value().c_str(),
- &status)) {
+ if (!grpc_status_code_from_string(element.string_value().c_str(),
+ &status)) {
error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"field:retryableStatusCodes error:failed to parse status code"));
continue;
@@ -177,100 +177,100 @@ std::unique_ptr<ClientChannelMethodParsedConfig::RetryPolicy> ParseRetryPolicy(
return *error == GRPC_ERROR_NONE ? std::move(retry_policy) : nullptr;
}
-grpc_error* ParseRetryThrottling(
- const Json& json,
- ClientChannelGlobalParsedConfig::RetryThrottling* retry_throttling) {
- if (json.type() != Json::Type::OBJECT) {
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:retryThrottling error:Type should be object");
- }
- std::vector<grpc_error*> error_list;
- // Parse maxTokens.
- auto it = json.object_value().find("maxTokens");
- if (it == json.object_value().end()) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:retryThrottling field:maxTokens error:Not found"));
- } else if (it->second.type() != Json::Type::NUMBER) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:retryThrottling field:maxTokens error:Type should be "
- "number"));
- } else {
- retry_throttling->max_milli_tokens =
- gpr_parse_nonnegative_int(it->second.string_value().c_str()) * 1000;
- if (retry_throttling->max_milli_tokens <= 0) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:retryThrottling field:maxTokens error:should be "
- "greater than zero"));
- }
- }
- // Parse tokenRatio.
- it = json.object_value().find("tokenRatio");
- if (it == json.object_value().end()) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:retryThrottling field:tokenRatio error:Not found"));
- } else if (it->second.type() != Json::Type::NUMBER) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:retryThrottling field:tokenRatio error:type should be "
- "number"));
- } else {
- // We support up to 3 decimal digits.
- size_t whole_len = it->second.string_value().size();
- const char* value = it->second.string_value().c_str();
- uint32_t multiplier = 1;
- uint32_t decimal_value = 0;
- const char* decimal_point = strchr(value, '.');
- if (decimal_point != nullptr) {
- whole_len = static_cast<size_t>(decimal_point - value);
- multiplier = 1000;
- size_t decimal_len = strlen(decimal_point + 1);
- if (decimal_len > 3) decimal_len = 3;
- if (!gpr_parse_bytes_to_uint32(decimal_point + 1, decimal_len,
- &decimal_value)) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:retryThrottling field:tokenRatio error:Failed "
- "parsing"));
- return GRPC_ERROR_CREATE_FROM_VECTOR("retryPolicy", &error_list);
- }
- uint32_t decimal_multiplier = 1;
- for (size_t i = 0; i < (3 - decimal_len); ++i) {
- decimal_multiplier *= 10;
- }
- decimal_value *= decimal_multiplier;
- }
- uint32_t whole_value;
- if (!gpr_parse_bytes_to_uint32(value, whole_len, &whole_value)) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:retryThrottling field:tokenRatio error:Failed "
- "parsing"));
- return GRPC_ERROR_CREATE_FROM_VECTOR("retryPolicy", &error_list);
- }
- retry_throttling->milli_token_ratio =
- static_cast<int>((whole_value * multiplier) + decimal_value);
- if (retry_throttling->milli_token_ratio <= 0) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:retryThrottling field:tokenRatio error:value should "
- "be greater than 0"));
- }
- }
- return GRPC_ERROR_CREATE_FROM_VECTOR("retryPolicy", &error_list);
-}
-
-const char* ParseHealthCheckConfig(const Json& field, grpc_error** error) {
+grpc_error* ParseRetryThrottling(
+ const Json& json,
+ ClientChannelGlobalParsedConfig::RetryThrottling* retry_throttling) {
+ if (json.type() != Json::Type::OBJECT) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:retryThrottling error:Type should be object");
+ }
+ std::vector<grpc_error*> error_list;
+ // Parse maxTokens.
+ auto it = json.object_value().find("maxTokens");
+ if (it == json.object_value().end()) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:retryThrottling field:maxTokens error:Not found"));
+ } else if (it->second.type() != Json::Type::NUMBER) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:retryThrottling field:maxTokens error:Type should be "
+ "number"));
+ } else {
+ retry_throttling->max_milli_tokens =
+ gpr_parse_nonnegative_int(it->second.string_value().c_str()) * 1000;
+ if (retry_throttling->max_milli_tokens <= 0) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:retryThrottling field:maxTokens error:should be "
+ "greater than zero"));
+ }
+ }
+ // Parse tokenRatio.
+ it = json.object_value().find("tokenRatio");
+ if (it == json.object_value().end()) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:retryThrottling field:tokenRatio error:Not found"));
+ } else if (it->second.type() != Json::Type::NUMBER) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:retryThrottling field:tokenRatio error:type should be "
+ "number"));
+ } else {
+ // We support up to 3 decimal digits.
+ size_t whole_len = it->second.string_value().size();
+ const char* value = it->second.string_value().c_str();
+ uint32_t multiplier = 1;
+ uint32_t decimal_value = 0;
+ const char* decimal_point = strchr(value, '.');
+ if (decimal_point != nullptr) {
+ whole_len = static_cast<size_t>(decimal_point - value);
+ multiplier = 1000;
+ size_t decimal_len = strlen(decimal_point + 1);
+ if (decimal_len > 3) decimal_len = 3;
+ if (!gpr_parse_bytes_to_uint32(decimal_point + 1, decimal_len,
+ &decimal_value)) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:retryThrottling field:tokenRatio error:Failed "
+ "parsing"));
+ return GRPC_ERROR_CREATE_FROM_VECTOR("retryPolicy", &error_list);
+ }
+ uint32_t decimal_multiplier = 1;
+ for (size_t i = 0; i < (3 - decimal_len); ++i) {
+ decimal_multiplier *= 10;
+ }
+ decimal_value *= decimal_multiplier;
+ }
+ uint32_t whole_value;
+ if (!gpr_parse_bytes_to_uint32(value, whole_len, &whole_value)) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:retryThrottling field:tokenRatio error:Failed "
+ "parsing"));
+ return GRPC_ERROR_CREATE_FROM_VECTOR("retryPolicy", &error_list);
+ }
+ retry_throttling->milli_token_ratio =
+ static_cast<int>((whole_value * multiplier) + decimal_value);
+ if (retry_throttling->milli_token_ratio <= 0) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:retryThrottling field:tokenRatio error:value should "
+ "be greater than 0"));
+ }
+ }
+ return GRPC_ERROR_CREATE_FROM_VECTOR("retryPolicy", &error_list);
+}
+
+const char* ParseHealthCheckConfig(const Json& field, grpc_error** error) {
GPR_DEBUG_ASSERT(error != nullptr && *error == GRPC_ERROR_NONE);
const char* service_name = nullptr;
- if (field.type() != Json::Type::OBJECT) {
+ if (field.type() != Json::Type::OBJECT) {
*error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"field:healthCheckConfig error:should be of type object");
return nullptr;
}
- std::vector<grpc_error*> error_list;
- auto it = field.object_value().find("serviceName");
- if (it != field.object_value().end()) {
- if (it->second.type() != Json::Type::STRING) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:serviceName error:should be of type string"));
- } else {
- service_name = it->second.string_value().c_str();
+ std::vector<grpc_error*> error_list;
+ auto it = field.object_value().find("serviceName");
+ if (it != field.object_value().end()) {
+ if (it->second.type() != Json::Type::STRING) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:serviceName error:should be of type string"));
+ } else {
+ service_name = it->second.string_value().c_str();
}
}
if (!error_list.empty()) {
@@ -283,126 +283,126 @@ const char* ParseHealthCheckConfig(const Json& field, grpc_error** error) {
} // namespace
-std::unique_ptr<ServiceConfigParser::ParsedConfig>
-ClientChannelServiceConfigParser::ParseGlobalParams(
- const grpc_channel_args* /*args*/, const Json& json, grpc_error** error) {
+std::unique_ptr<ServiceConfigParser::ParsedConfig>
+ClientChannelServiceConfigParser::ParseGlobalParams(
+ const grpc_channel_args* /*args*/, const Json& json, grpc_error** error) {
GPR_DEBUG_ASSERT(error != nullptr && *error == GRPC_ERROR_NONE);
- std::vector<grpc_error*> error_list;
+ std::vector<grpc_error*> error_list;
RefCountedPtr<LoadBalancingPolicy::Config> parsed_lb_config;
- TString lb_policy_name;
- y_absl::optional<ClientChannelGlobalParsedConfig::RetryThrottling>
- retry_throttling;
+ TString lb_policy_name;
+ y_absl::optional<ClientChannelGlobalParsedConfig::RetryThrottling>
+ retry_throttling;
const char* health_check_service_name = nullptr;
- // Parse LB config.
- auto it = json.object_value().find("loadBalancingConfig");
- if (it != json.object_value().end()) {
- grpc_error* parse_error = GRPC_ERROR_NONE;
- parsed_lb_config = LoadBalancingPolicyRegistry::ParseLoadBalancingConfig(
- it->second, &parse_error);
- if (parsed_lb_config == nullptr) {
- std::vector<grpc_error*> lb_errors;
- lb_errors.push_back(parse_error);
- error_list.push_back(GRPC_ERROR_CREATE_FROM_VECTOR(
- "field:loadBalancingConfig", &lb_errors));
+ // Parse LB config.
+ auto it = json.object_value().find("loadBalancingConfig");
+ if (it != json.object_value().end()) {
+ grpc_error* parse_error = GRPC_ERROR_NONE;
+ parsed_lb_config = LoadBalancingPolicyRegistry::ParseLoadBalancingConfig(
+ it->second, &parse_error);
+ if (parsed_lb_config == nullptr) {
+ std::vector<grpc_error*> lb_errors;
+ lb_errors.push_back(parse_error);
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_VECTOR(
+ "field:loadBalancingConfig", &lb_errors));
}
- }
- // Parse deprecated LB policy.
- it = json.object_value().find("loadBalancingPolicy");
- if (it != json.object_value().end()) {
- if (it->second.type() != Json::Type::STRING) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:loadBalancingPolicy error:type should be string"));
- } else {
- lb_policy_name = it->second.string_value();
- for (size_t i = 0; i < lb_policy_name.size(); ++i) {
- lb_policy_name[i] = tolower(lb_policy_name[i]);
+ }
+ // Parse deprecated LB policy.
+ it = json.object_value().find("loadBalancingPolicy");
+ if (it != json.object_value().end()) {
+ if (it->second.type() != Json::Type::STRING) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:loadBalancingPolicy error:type should be string"));
+ } else {
+ lb_policy_name = it->second.string_value();
+ for (size_t i = 0; i < lb_policy_name.size(); ++i) {
+ lb_policy_name[i] = tolower(lb_policy_name[i]);
}
bool requires_config = false;
if (!LoadBalancingPolicyRegistry::LoadBalancingPolicyExists(
- lb_policy_name.c_str(), &requires_config)) {
+ lb_policy_name.c_str(), &requires_config)) {
error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"field:loadBalancingPolicy error:Unknown lb policy"));
} else if (requires_config) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("field:loadBalancingPolicy error:", lb_policy_name,
- " requires a config. Please use loadBalancingConfig "
- "instead.")
- .c_str()));
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrCat("field:loadBalancingPolicy error:", lb_policy_name,
+ " requires a config. Please use loadBalancingConfig "
+ "instead.")
+ .c_str()));
}
}
- }
- // Parse retry throttling.
- it = json.object_value().find("retryThrottling");
- if (it != json.object_value().end()) {
- ClientChannelGlobalParsedConfig::RetryThrottling data;
- grpc_error* parsing_error = ParseRetryThrottling(it->second, &data);
- if (parsing_error != GRPC_ERROR_NONE) {
- error_list.push_back(parsing_error);
- } else {
- retry_throttling.emplace(data);
+ }
+ // Parse retry throttling.
+ it = json.object_value().find("retryThrottling");
+ if (it != json.object_value().end()) {
+ ClientChannelGlobalParsedConfig::RetryThrottling data;
+ grpc_error* parsing_error = ParseRetryThrottling(it->second, &data);
+ if (parsing_error != GRPC_ERROR_NONE) {
+ error_list.push_back(parsing_error);
+ } else {
+ retry_throttling.emplace(data);
}
- }
- // Parse health check config.
- it = json.object_value().find("healthCheckConfig");
- if (it != json.object_value().end()) {
- grpc_error* parsing_error = GRPC_ERROR_NONE;
- health_check_service_name =
- ParseHealthCheckConfig(it->second, &parsing_error);
- if (parsing_error != GRPC_ERROR_NONE) {
- error_list.push_back(parsing_error);
+ }
+ // Parse health check config.
+ it = json.object_value().find("healthCheckConfig");
+ if (it != json.object_value().end()) {
+ grpc_error* parsing_error = GRPC_ERROR_NONE;
+ health_check_service_name =
+ ParseHealthCheckConfig(it->second, &parsing_error);
+ if (parsing_error != GRPC_ERROR_NONE) {
+ error_list.push_back(parsing_error);
}
}
*error = GRPC_ERROR_CREATE_FROM_VECTOR("Client channel global parser",
&error_list);
if (*error == GRPC_ERROR_NONE) {
- return y_absl::make_unique<ClientChannelGlobalParsedConfig>(
+ return y_absl::make_unique<ClientChannelGlobalParsedConfig>(
std::move(parsed_lb_config), std::move(lb_policy_name),
retry_throttling, health_check_service_name);
}
return nullptr;
}
-std::unique_ptr<ServiceConfigParser::ParsedConfig>
-ClientChannelServiceConfigParser::ParsePerMethodParams(
- const grpc_channel_args* /*args*/, const Json& json, grpc_error** error) {
+std::unique_ptr<ServiceConfigParser::ParsedConfig>
+ClientChannelServiceConfigParser::ParsePerMethodParams(
+ const grpc_channel_args* /*args*/, const Json& json, grpc_error** error) {
GPR_DEBUG_ASSERT(error != nullptr && *error == GRPC_ERROR_NONE);
- std::vector<grpc_error*> error_list;
- y_absl::optional<bool> wait_for_ready;
+ std::vector<grpc_error*> error_list;
+ y_absl::optional<bool> wait_for_ready;
grpc_millis timeout = 0;
std::unique_ptr<ClientChannelMethodParsedConfig::RetryPolicy> retry_policy;
- // Parse waitForReady.
- auto it = json.object_value().find("waitForReady");
- if (it != json.object_value().end()) {
- if (it->second.type() == Json::Type::JSON_TRUE) {
- wait_for_ready.emplace(true);
- } else if (it->second.type() == Json::Type::JSON_FALSE) {
- wait_for_ready.emplace(false);
- } else {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:waitForReady error:Type should be true/false"));
+ // Parse waitForReady.
+ auto it = json.object_value().find("waitForReady");
+ if (it != json.object_value().end()) {
+ if (it->second.type() == Json::Type::JSON_TRUE) {
+ wait_for_ready.emplace(true);
+ } else if (it->second.type() == Json::Type::JSON_FALSE) {
+ wait_for_ready.emplace(false);
+ } else {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:waitForReady error:Type should be true/false"));
+ }
+ }
+ // Parse timeout.
+ it = json.object_value().find("timeout");
+ if (it != json.object_value().end()) {
+ if (!ParseDurationFromJson(it->second, &timeout)) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:timeout error:Failed parsing"));
+ };
+ }
+ // Parse retry policy.
+ it = json.object_value().find("retryPolicy");
+ if (it != json.object_value().end()) {
+ grpc_error* error = GRPC_ERROR_NONE;
+ retry_policy = ParseRetryPolicy(it->second, &error);
+ if (retry_policy == nullptr) {
+ error_list.push_back(error);
}
}
- // Parse timeout.
- it = json.object_value().find("timeout");
- if (it != json.object_value().end()) {
- if (!ParseDurationFromJson(it->second, &timeout)) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:timeout error:Failed parsing"));
- };
- }
- // Parse retry policy.
- it = json.object_value().find("retryPolicy");
- if (it != json.object_value().end()) {
- grpc_error* error = GRPC_ERROR_NONE;
- retry_policy = ParseRetryPolicy(it->second, &error);
- if (retry_policy == nullptr) {
- error_list.push_back(error);
- }
- }
*error = GRPC_ERROR_CREATE_FROM_VECTOR("Client channel parser", &error_list);
if (*error == GRPC_ERROR_NONE) {
- return y_absl::make_unique<ClientChannelMethodParsedConfig>(
- timeout, wait_for_ready, std::move(retry_policy));
+ return y_absl::make_unique<ClientChannelMethodParsedConfig>(
+ timeout, wait_for_ready, std::move(retry_policy));
}
return nullptr;
}
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver_result_parsing.h b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver_result_parsing.h
index c7ab19ed81e..6149ebe32bc 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver_result_parsing.h
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver_result_parsing.h
@@ -21,8 +21,8 @@
#include <grpc/support/port_platform.h>
-#include "y_absl/types/optional.h"
-
+#include "y_absl/types/optional.h"
+
#include "src/core/ext/filters/client_channel/lb_policy.h"
#include "src/core/ext/filters/client_channel/lb_policy_factory.h"
#include "src/core/ext/filters/client_channel/resolver.h"
@@ -37,8 +37,8 @@
namespace grpc_core {
namespace internal {
-class ClientChannelGlobalParsedConfig
- : public ServiceConfigParser::ParsedConfig {
+class ClientChannelGlobalParsedConfig
+ : public ServiceConfigParser::ParsedConfig {
public:
struct RetryThrottling {
intptr_t max_milli_tokens = 0;
@@ -47,15 +47,15 @@ class ClientChannelGlobalParsedConfig
ClientChannelGlobalParsedConfig(
RefCountedPtr<LoadBalancingPolicy::Config> parsed_lb_config,
- TString parsed_deprecated_lb_policy,
- const y_absl::optional<RetryThrottling>& retry_throttling,
+ TString parsed_deprecated_lb_policy,
+ const y_absl::optional<RetryThrottling>& retry_throttling,
const char* health_check_service_name)
: parsed_lb_config_(std::move(parsed_lb_config)),
parsed_deprecated_lb_policy_(std::move(parsed_deprecated_lb_policy)),
retry_throttling_(retry_throttling),
health_check_service_name_(health_check_service_name) {}
- y_absl::optional<RetryThrottling> retry_throttling() const {
+ y_absl::optional<RetryThrottling> retry_throttling() const {
return retry_throttling_;
}
@@ -63,8 +63,8 @@ class ClientChannelGlobalParsedConfig
return parsed_lb_config_;
}
- const TString& parsed_deprecated_lb_policy() const {
- return parsed_deprecated_lb_policy_;
+ const TString& parsed_deprecated_lb_policy() const {
+ return parsed_deprecated_lb_policy_;
}
const char* health_check_service_name() const {
@@ -73,13 +73,13 @@ class ClientChannelGlobalParsedConfig
private:
RefCountedPtr<LoadBalancingPolicy::Config> parsed_lb_config_;
- TString parsed_deprecated_lb_policy_;
- y_absl::optional<RetryThrottling> retry_throttling_;
+ TString parsed_deprecated_lb_policy_;
+ y_absl::optional<RetryThrottling> retry_throttling_;
const char* health_check_service_name_;
};
-class ClientChannelMethodParsedConfig
- : public ServiceConfigParser::ParsedConfig {
+class ClientChannelMethodParsedConfig
+ : public ServiceConfigParser::ParsedConfig {
public:
struct RetryPolicy {
int max_attempts = 0;
@@ -90,7 +90,7 @@ class ClientChannelMethodParsedConfig
};
ClientChannelMethodParsedConfig(grpc_millis timeout,
- const y_absl::optional<bool>& wait_for_ready,
+ const y_absl::optional<bool>& wait_for_ready,
std::unique_ptr<RetryPolicy> retry_policy)
: timeout_(timeout),
wait_for_ready_(wait_for_ready),
@@ -98,25 +98,25 @@ class ClientChannelMethodParsedConfig
grpc_millis timeout() const { return timeout_; }
- y_absl::optional<bool> wait_for_ready() const { return wait_for_ready_; }
+ y_absl::optional<bool> wait_for_ready() const { return wait_for_ready_; }
const RetryPolicy* retry_policy() const { return retry_policy_.get(); }
private:
grpc_millis timeout_ = 0;
- y_absl::optional<bool> wait_for_ready_;
+ y_absl::optional<bool> wait_for_ready_;
std::unique_ptr<RetryPolicy> retry_policy_;
};
-class ClientChannelServiceConfigParser : public ServiceConfigParser::Parser {
+class ClientChannelServiceConfigParser : public ServiceConfigParser::Parser {
public:
- std::unique_ptr<ServiceConfigParser::ParsedConfig> ParseGlobalParams(
- const grpc_channel_args* /*args*/, const Json& json,
- grpc_error** error) override;
+ std::unique_ptr<ServiceConfigParser::ParsedConfig> ParseGlobalParams(
+ const grpc_channel_args* /*args*/, const Json& json,
+ grpc_error** error) override;
- std::unique_ptr<ServiceConfigParser::ParsedConfig> ParsePerMethodParams(
- const grpc_channel_args* /*args*/, const Json& json,
- grpc_error** error) override;
+ std::unique_ptr<ServiceConfigParser::ParsedConfig> ParsePerMethodParams(
+ const grpc_channel_args* /*args*/, const Json& json,
+ grpc_error** error) override;
static size_t ParserIndex();
static void Register();
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolving_lb_policy.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolving_lb_policy.cc
index b04b6fab3e3..af27e2eeae0 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolving_lb_policy.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolving_lb_policy.cc
@@ -26,9 +26,9 @@
#include <stdio.h>
#include <string.h>
-#include "y_absl/strings/str_cat.h"
-#include "y_absl/strings/str_join.h"
-
+#include "y_absl/strings/str_cat.h"
+#include "y_absl/strings/str_join.h"
+
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
@@ -36,7 +36,7 @@
#include "src/core/ext/filters/client_channel/backup_poller.h"
#include "src/core/ext/filters/client_channel/http_connect_handshaker.h"
-#include "src/core/ext/filters/client_channel/lb_policy/child_policy_handler.h"
+#include "src/core/ext/filters/client_channel/lb_policy/child_policy_handler.h"
#include "src/core/ext/filters/client_channel/lb_policy_registry.h"
#include "src/core/ext/filters/client_channel/proxy_mapper_registry.h"
#include "src/core/ext/filters/client_channel/resolver_registry.h"
@@ -109,33 +109,33 @@ class ResolvingLoadBalancingPolicy::ResolvingControlHelper
: parent_(std::move(parent)) {}
RefCountedPtr<SubchannelInterface> CreateSubchannel(
- ServerAddress address, const grpc_channel_args& args) override {
+ ServerAddress address, const grpc_channel_args& args) override {
if (parent_->resolver_ == nullptr) return nullptr; // Shutting down.
- return parent_->channel_control_helper()->CreateSubchannel(
- std::move(address), args);
+ return parent_->channel_control_helper()->CreateSubchannel(
+ std::move(address), args);
}
- void UpdateState(grpc_connectivity_state state, const y_absl::Status& status,
+ void UpdateState(grpc_connectivity_state state, const y_absl::Status& status,
std::unique_ptr<SubchannelPicker> picker) override {
if (parent_->resolver_ == nullptr) return; // Shutting down.
- parent_->channel_control_helper()->UpdateState(state, status,
- std::move(picker));
+ parent_->channel_control_helper()->UpdateState(state, status,
+ std::move(picker));
}
void RequestReresolution() override {
- if (parent_->resolver_ == nullptr) return; // Shutting down.
+ if (parent_->resolver_ == nullptr) return; // Shutting down.
if (GRPC_TRACE_FLAG_ENABLED(*(parent_->tracer_))) {
gpr_log(GPR_INFO, "resolving_lb=%p: started name re-resolving",
parent_.get());
}
- parent_->resolver_->RequestReresolutionLocked();
+ parent_->resolver_->RequestReresolutionLocked();
}
- void AddTraceEvent(TraceSeverity severity,
- y_absl::string_view message) override {
- if (parent_->resolver_ == nullptr) return; // Shutting down.
- parent_->channel_control_helper()->AddTraceEvent(severity, message);
- }
+ void AddTraceEvent(TraceSeverity severity,
+ y_absl::string_view message) override {
+ if (parent_->resolver_ == nullptr) return; // Shutting down.
+ parent_->channel_control_helper()->AddTraceEvent(severity, message);
+ }
private:
RefCountedPtr<ResolvingLoadBalancingPolicy> parent_;
@@ -147,23 +147,23 @@ class ResolvingLoadBalancingPolicy::ResolvingControlHelper
ResolvingLoadBalancingPolicy::ResolvingLoadBalancingPolicy(
Args args, TraceFlag* tracer, grpc_core::UniquePtr<char> target_uri,
- ChannelConfigHelper* helper)
+ ChannelConfigHelper* helper)
: LoadBalancingPolicy(std::move(args)),
tracer_(tracer),
target_uri_(std::move(target_uri)),
- helper_(helper) {
- GPR_ASSERT(helper_ != nullptr);
+ helper_(helper) {
+ GPR_ASSERT(helper_ != nullptr);
resolver_ = ResolverRegistry::CreateResolver(
- target_uri_.get(), args.args, interested_parties(), work_serializer(),
- y_absl::make_unique<ResolverResultHandler>(Ref()));
+ target_uri_.get(), args.args, interested_parties(), work_serializer(),
+ y_absl::make_unique<ResolverResultHandler>(Ref()));
// Since the validity of args has been checked when create the channel,
// CreateResolver() must return a non-null result.
GPR_ASSERT(resolver_ != nullptr);
if (GRPC_TRACE_FLAG_ENABLED(*tracer_)) {
gpr_log(GPR_INFO, "resolving_lb=%p: starting name resolution", this);
}
- channel_control_helper()->UpdateState(GRPC_CHANNEL_CONNECTING, y_absl::Status(),
- y_absl::make_unique<QueuePicker>(Ref()));
+ channel_control_helper()->UpdateState(GRPC_CHANNEL_CONNECTING, y_absl::Status(),
+ y_absl::make_unique<QueuePicker>(Ref()));
resolver_->StartLocked();
}
@@ -174,10 +174,10 @@ ResolvingLoadBalancingPolicy::~ResolvingLoadBalancingPolicy() {
void ResolvingLoadBalancingPolicy::ShutdownLocked() {
if (resolver_ != nullptr) {
- if (GRPC_TRACE_FLAG_ENABLED(*tracer_)) {
- gpr_log(GPR_INFO, "resolving_lb=%p: shutting down resolver=%p", this,
- resolver_.get());
- }
+ if (GRPC_TRACE_FLAG_ENABLED(*tracer_)) {
+ gpr_log(GPR_INFO, "resolving_lb=%p: shutting down resolver=%p", this,
+ resolver_.get());
+ }
resolver_.reset();
if (lb_policy_ != nullptr) {
if (GRPC_TRACE_FLAG_ENABLED(*tracer_)) {
@@ -192,7 +192,7 @@ void ResolvingLoadBalancingPolicy::ShutdownLocked() {
}
void ResolvingLoadBalancingPolicy::ExitIdleLocked() {
- if (lb_policy_ != nullptr) lb_policy_->ExitIdleLocked();
+ if (lb_policy_ != nullptr) lb_policy_->ExitIdleLocked();
}
void ResolvingLoadBalancingPolicy::ResetBackoffLocked() {
@@ -218,53 +218,53 @@ void ResolvingLoadBalancingPolicy::OnResolverError(grpc_error* error) {
if (lb_policy_ == nullptr) {
grpc_error* state_error = GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
"Resolver transient failure", &error, 1);
- helper_->ResolverTransientFailure(GRPC_ERROR_REF(state_error));
+ helper_->ResolverTransientFailure(GRPC_ERROR_REF(state_error));
channel_control_helper()->UpdateState(
- GRPC_CHANNEL_TRANSIENT_FAILURE, grpc_error_to_absl_status(state_error),
- y_absl::make_unique<TransientFailurePicker>(state_error));
+ GRPC_CHANNEL_TRANSIENT_FAILURE, grpc_error_to_absl_status(state_error),
+ y_absl::make_unique<TransientFailurePicker>(state_error));
}
GRPC_ERROR_UNREF(error);
}
void ResolvingLoadBalancingPolicy::CreateOrUpdateLbPolicyLocked(
RefCountedPtr<LoadBalancingPolicy::Config> lb_policy_config,
- Resolver::Result result) {
- // Construct update.
+ Resolver::Result result) {
+ // Construct update.
UpdateArgs update_args;
update_args.addresses = std::move(result.addresses);
update_args.config = std::move(lb_policy_config);
- // Remove the config selector from channel args so that we're not holding
- // unnecessary refs that cause it to be destroyed somewhere other than in the
- // WorkSerializer.
- const char* arg_name = GRPC_ARG_CONFIG_SELECTOR;
- update_args.args =
- grpc_channel_args_copy_and_remove(result.args, &arg_name, 1);
- // Create policy if needed.
- if (lb_policy_ == nullptr) {
- lb_policy_ = CreateLbPolicyLocked(*update_args.args);
- }
- // Update the policy.
- if (GRPC_TRACE_FLAG_ENABLED(*tracer_)) {
- gpr_log(GPR_INFO, "resolving_lb=%p: Updating child policy %p", this,
- lb_policy_.get());
- }
- lb_policy_->UpdateLocked(std::move(update_args));
+ // Remove the config selector from channel args so that we're not holding
+ // unnecessary refs that cause it to be destroyed somewhere other than in the
+ // WorkSerializer.
+ const char* arg_name = GRPC_ARG_CONFIG_SELECTOR;
+ update_args.args =
+ grpc_channel_args_copy_and_remove(result.args, &arg_name, 1);
+ // Create policy if needed.
+ if (lb_policy_ == nullptr) {
+ lb_policy_ = CreateLbPolicyLocked(*update_args.args);
+ }
+ // Update the policy.
+ if (GRPC_TRACE_FLAG_ENABLED(*tracer_)) {
+ gpr_log(GPR_INFO, "resolving_lb=%p: Updating child policy %p", this,
+ lb_policy_.get());
+ }
+ lb_policy_->UpdateLocked(std::move(update_args));
}
// Creates a new LB policy.
OrphanablePtr<LoadBalancingPolicy>
ResolvingLoadBalancingPolicy::CreateLbPolicyLocked(
- const grpc_channel_args& args) {
+ const grpc_channel_args& args) {
LoadBalancingPolicy::Args lb_policy_args;
- lb_policy_args.work_serializer = work_serializer();
+ lb_policy_args.work_serializer = work_serializer();
lb_policy_args.channel_control_helper =
- y_absl::make_unique<ResolvingControlHelper>(Ref());
+ y_absl::make_unique<ResolvingControlHelper>(Ref());
lb_policy_args.args = &args;
OrphanablePtr<LoadBalancingPolicy> lb_policy =
- MakeOrphanable<ChildPolicyHandler>(std::move(lb_policy_args), tracer_);
+ MakeOrphanable<ChildPolicyHandler>(std::move(lb_policy_args), tracer_);
if (GRPC_TRACE_FLAG_ENABLED(*tracer_)) {
- gpr_log(GPR_INFO, "resolving_lb=%p: created new LB policy %p", this,
- lb_policy.get());
+ gpr_log(GPR_INFO, "resolving_lb=%p: created new LB policy %p", this,
+ lb_policy.get());
}
grpc_pollset_set_add_pollset_set(lb_policy->interested_parties(),
interested_parties());
@@ -275,21 +275,21 @@ void ResolvingLoadBalancingPolicy::MaybeAddTraceMessagesForAddressChangesLocked(
bool resolution_contains_addresses, TraceStringVector* trace_strings) {
if (!resolution_contains_addresses &&
previous_resolution_contained_addresses_) {
- trace_strings->push_back("Address list became empty");
+ trace_strings->push_back("Address list became empty");
} else if (resolution_contains_addresses &&
!previous_resolution_contained_addresses_) {
- trace_strings->push_back("Address list became non-empty");
+ trace_strings->push_back("Address list became non-empty");
}
previous_resolution_contained_addresses_ = resolution_contains_addresses;
}
void ResolvingLoadBalancingPolicy::ConcatenateAndAddChannelTraceLocked(
- const TraceStringVector& trace_strings) const {
- if (!trace_strings.empty()) {
- TString message =
- y_absl::StrCat("Resolution event: ", y_absl::StrJoin(trace_strings, ", "));
+ const TraceStringVector& trace_strings) const {
+ if (!trace_strings.empty()) {
+ TString message =
+ y_absl::StrCat("Resolution event: ", y_absl::StrJoin(trace_strings, ", "));
channel_control_helper()->AddTraceEvent(ChannelControlHelper::TRACE_INFO,
- message);
+ message);
}
}
@@ -310,46 +310,46 @@ void ResolvingLoadBalancingPolicy::OnResolverResultChangedLocked(
//
// We track a list of strings to eventually be concatenated and traced.
TraceStringVector trace_strings;
- MaybeAddTraceMessagesForAddressChangesLocked(!result.addresses.empty(),
- &trace_strings);
- // The result of grpc_error_string() is owned by the error itself.
- // We're storing that string in trace_strings, so we need to make sure
- // that the error lives until we're done with the string.
- grpc_error* service_config_error =
- GRPC_ERROR_REF(result.service_config_error);
- if (service_config_error != GRPC_ERROR_NONE) {
- trace_strings.push_back(grpc_error_string(service_config_error));
- }
- // Choose the service config.
- ChannelConfigHelper::ChooseServiceConfigResult service_config_result;
- if (helper_ != nullptr) {
- service_config_result = helper_->ChooseServiceConfig(result);
+ MaybeAddTraceMessagesForAddressChangesLocked(!result.addresses.empty(),
+ &trace_strings);
+ // The result of grpc_error_string() is owned by the error itself.
+ // We're storing that string in trace_strings, so we need to make sure
+ // that the error lives until we're done with the string.
+ grpc_error* service_config_error =
+ GRPC_ERROR_REF(result.service_config_error);
+ if (service_config_error != GRPC_ERROR_NONE) {
+ trace_strings.push_back(grpc_error_string(service_config_error));
+ }
+ // Choose the service config.
+ ChannelConfigHelper::ChooseServiceConfigResult service_config_result;
+ if (helper_ != nullptr) {
+ service_config_result = helper_->ChooseServiceConfig(result);
} else {
- service_config_result.lb_policy_config = child_lb_config_;
+ service_config_result.lb_policy_config = child_lb_config_;
}
- if (service_config_result.no_valid_service_config) {
- // We received an invalid service config and we don't have a
- // previous service config to fall back to.
- OnResolverError(GRPC_ERROR_REF(service_config_error));
- trace_strings.push_back("no valid service config");
- } else {
+ if (service_config_result.no_valid_service_config) {
+ // We received an invalid service config and we don't have a
+ // previous service config to fall back to.
+ OnResolverError(GRPC_ERROR_REF(service_config_error));
+ trace_strings.push_back("no valid service config");
+ } else {
// Create or update LB policy, as needed.
- CreateOrUpdateLbPolicyLocked(
- std::move(service_config_result.lb_policy_config), std::move(result));
- if (service_config_result.service_config_changed) {
- // Tell channel to start using new service config for calls.
- // This needs to happen after the LB policy has been updated, since
- // the ConfigSelector may need the LB policy to know about new
- // destinations before it can send RPCs to those destinations.
- if (helper_ != nullptr) helper_->StartUsingServiceConfigForCalls();
- // TODO(ncteisen): might be worth somehow including a snippet of the
- // config in the trace, at the risk of bloating the trace logs.
- trace_strings.push_back("Service config changed");
- }
+ CreateOrUpdateLbPolicyLocked(
+ std::move(service_config_result.lb_policy_config), std::move(result));
+ if (service_config_result.service_config_changed) {
+ // Tell channel to start using new service config for calls.
+ // This needs to happen after the LB policy has been updated, since
+ // the ConfigSelector may need the LB policy to know about new
+ // destinations before it can send RPCs to those destinations.
+ if (helper_ != nullptr) helper_->StartUsingServiceConfigForCalls();
+ // TODO(ncteisen): might be worth somehow including a snippet of the
+ // config in the trace, at the risk of bloating the trace logs.
+ trace_strings.push_back("Service config changed");
+ }
}
// Add channel trace event.
- ConcatenateAndAddChannelTraceLocked(trace_strings);
- GRPC_ERROR_UNREF(service_config_error);
+ ConcatenateAndAddChannelTraceLocked(trace_strings);
+ GRPC_ERROR_UNREF(service_config_error);
}
} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolving_lb_policy.h b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolving_lb_policy.h
index 53471ef23f6..1bd1db8b789 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolving_lb_policy.h
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolving_lb_policy.h
@@ -21,9 +21,9 @@
#include <grpc/support/port_platform.h>
-#include "y_absl/container/inlined_vector.h"
-
-#include "src/core/ext/filters/client_channel/config_selector.h"
+#include "y_absl/container/inlined_vector.h"
+
+#include "src/core/ext/filters/client_channel/config_selector.h"
#include "src/core/ext/filters/client_channel/lb_policy.h"
#include "src/core/ext/filters/client_channel/lb_policy_factory.h"
#include "src/core/ext/filters/client_channel/resolver.h"
@@ -53,36 +53,36 @@ namespace grpc_core {
// child LB policy and config to use.
class ResolvingLoadBalancingPolicy : public LoadBalancingPolicy {
public:
- class ChannelConfigHelper {
- public:
- struct ChooseServiceConfigResult {
- // Set to true if the service config has changed since the last result.
- bool service_config_changed = false;
- // Set to true if we don't have a valid service config to use.
- // This tells the ResolvingLoadBalancingPolicy to put the channel
- // into TRANSIENT_FAILURE.
- bool no_valid_service_config = false;
- // The LB policy config to use.
- RefCountedPtr<LoadBalancingPolicy::Config> lb_policy_config;
- };
-
- virtual ~ChannelConfigHelper() = default;
-
- // Chooses the service config for the channel.
- virtual ChooseServiceConfigResult ChooseServiceConfig(
- const Resolver::Result& result) = 0;
-
- // Starts using the service config for calls.
- virtual void StartUsingServiceConfigForCalls() = 0;
-
- // Indicates a resolver transient failure.
- virtual void ResolverTransientFailure(grpc_error* error) = 0;
- };
-
- ResolvingLoadBalancingPolicy(Args args, TraceFlag* tracer,
- grpc_core::UniquePtr<char> target_uri,
- ChannelConfigHelper* helper);
-
+ class ChannelConfigHelper {
+ public:
+ struct ChooseServiceConfigResult {
+ // Set to true if the service config has changed since the last result.
+ bool service_config_changed = false;
+ // Set to true if we don't have a valid service config to use.
+ // This tells the ResolvingLoadBalancingPolicy to put the channel
+ // into TRANSIENT_FAILURE.
+ bool no_valid_service_config = false;
+ // The LB policy config to use.
+ RefCountedPtr<LoadBalancingPolicy::Config> lb_policy_config;
+ };
+
+ virtual ~ChannelConfigHelper() = default;
+
+ // Chooses the service config for the channel.
+ virtual ChooseServiceConfigResult ChooseServiceConfig(
+ const Resolver::Result& result) = 0;
+
+ // Starts using the service config for calls.
+ virtual void StartUsingServiceConfigForCalls() = 0;
+
+ // Indicates a resolver transient failure.
+ virtual void ResolverTransientFailure(grpc_error* error) = 0;
+ };
+
+ ResolvingLoadBalancingPolicy(Args args, TraceFlag* tracer,
+ grpc_core::UniquePtr<char> target_uri,
+ ChannelConfigHelper* helper);
+
virtual const char* name() const override { return "resolving_lb"; }
// No-op -- should never get updates from the channel.
@@ -95,7 +95,7 @@ class ResolvingLoadBalancingPolicy : public LoadBalancingPolicy {
void ResetBackoffLocked() override;
private:
- using TraceStringVector = y_absl::InlinedVector<const char*, 3>;
+ using TraceStringVector = y_absl::InlinedVector<const char*, 3>;
class ResolverResultHandler;
class ResolvingControlHelper;
@@ -107,28 +107,28 @@ class ResolvingLoadBalancingPolicy : public LoadBalancingPolicy {
void OnResolverError(grpc_error* error);
void CreateOrUpdateLbPolicyLocked(
RefCountedPtr<LoadBalancingPolicy::Config> lb_policy_config,
- Resolver::Result result);
+ Resolver::Result result);
OrphanablePtr<LoadBalancingPolicy> CreateLbPolicyLocked(
- const grpc_channel_args& args);
+ const grpc_channel_args& args);
void MaybeAddTraceMessagesForAddressChangesLocked(
bool resolution_contains_addresses, TraceStringVector* trace_strings);
void ConcatenateAndAddChannelTraceLocked(
- const TraceStringVector& trace_strings) const;
+ const TraceStringVector& trace_strings) const;
void OnResolverResultChangedLocked(Resolver::Result result);
// Passed in from caller at construction time.
TraceFlag* tracer_;
grpc_core::UniquePtr<char> target_uri_;
- ChannelConfigHelper* helper_;
+ ChannelConfigHelper* helper_;
// Resolver and associated state.
OrphanablePtr<Resolver> resolver_;
bool previous_resolution_contained_addresses_ = false;
- // Determined by resolver results.
- grpc_core::UniquePtr<char> child_policy_name_;
- RefCountedPtr<LoadBalancingPolicy::Config> child_lb_config_;
-
+ // Determined by resolver results.
+ grpc_core::UniquePtr<char> child_policy_name_;
+ RefCountedPtr<LoadBalancingPolicy::Config> child_lb_config_;
+
// Child LB policy.
OrphanablePtr<LoadBalancingPolicy> lb_policy_;
};
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/server_address.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/server_address.cc
index 348826c3cdc..89ea1d9055a 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/server_address.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/server_address.cc
@@ -20,142 +20,142 @@
#include "src/core/ext/filters/client_channel/server_address.h"
-#include <memory>
-#include <util/generic/string.h>
-#include <vector>
-
-#include "y_absl/strings/str_cat.h"
-#include "y_absl/strings/str_join.h"
-
-#include "src/core/lib/iomgr/sockaddr_utils.h"
-
+#include <memory>
+#include <util/generic/string.h>
+#include <vector>
+
+#include "y_absl/strings/str_cat.h"
+#include "y_absl/strings/str_join.h"
+
+#include "src/core/lib/iomgr/sockaddr_utils.h"
+
namespace grpc_core {
//
// ServerAddress
//
-ServerAddress::ServerAddress(
- const grpc_resolved_address& address, grpc_channel_args* args,
- std::map<const char*, std::unique_ptr<AttributeInterface>> attributes)
- : address_(address), args_(args), attributes_(std::move(attributes)) {}
+ServerAddress::ServerAddress(
+ const grpc_resolved_address& address, grpc_channel_args* args,
+ std::map<const char*, std::unique_ptr<AttributeInterface>> attributes)
+ : address_(address), args_(args), attributes_(std::move(attributes)) {}
-ServerAddress::ServerAddress(
- const void* address, size_t address_len, grpc_channel_args* args,
- std::map<const char*, std::unique_ptr<AttributeInterface>> attributes)
- : args_(args), attributes_(std::move(attributes)) {
+ServerAddress::ServerAddress(
+ const void* address, size_t address_len, grpc_channel_args* args,
+ std::map<const char*, std::unique_ptr<AttributeInterface>> attributes)
+ : args_(args), attributes_(std::move(attributes)) {
memcpy(address_.addr, address, address_len);
address_.len = static_cast<socklen_t>(address_len);
}
-ServerAddress::ServerAddress(const ServerAddress& other)
- : address_(other.address_), args_(grpc_channel_args_copy(other.args_)) {
- for (const auto& p : other.attributes_) {
- attributes_[p.first] = p.second->Copy();
- }
-}
-ServerAddress& ServerAddress::operator=(const ServerAddress& other) {
- address_ = other.address_;
- grpc_channel_args_destroy(args_);
- args_ = grpc_channel_args_copy(other.args_);
- attributes_.clear();
- for (const auto& p : other.attributes_) {
- attributes_[p.first] = p.second->Copy();
- }
- return *this;
-}
-
-ServerAddress::ServerAddress(ServerAddress&& other) noexcept
- : address_(other.address_),
- args_(other.args_),
- attributes_(std::move(other.attributes_)) {
- other.args_ = nullptr;
-}
-ServerAddress& ServerAddress::operator=(ServerAddress&& other) noexcept {
- address_ = other.address_;
- grpc_channel_args_destroy(args_);
- args_ = other.args_;
- other.args_ = nullptr;
- attributes_ = std::move(other.attributes_);
- return *this;
-}
-
-namespace {
-
-int CompareAttributes(
- const std::map<const char*,
- std::unique_ptr<ServerAddress::AttributeInterface>>&
- attributes1,
- const std::map<const char*,
- std::unique_ptr<ServerAddress::AttributeInterface>>&
- attributes2) {
- auto it2 = attributes2.begin();
- for (auto it1 = attributes1.begin(); it1 != attributes1.end(); ++it1) {
- // attributes2 has fewer elements than attributes1
- if (it2 == attributes2.end()) return -1;
- // compare keys
- int retval = strcmp(it1->first, it2->first);
- if (retval != 0) return retval;
- // compare values
- retval = it1->second->Cmp(it2->second.get());
- if (retval != 0) return retval;
- ++it2;
- }
- // attributes1 has fewer elements than attributes2
- if (it2 != attributes2.end()) return 1;
- // equal
- return 0;
-}
-
-} // namespace
-
-int ServerAddress::Cmp(const ServerAddress& other) const {
- if (address_.len > other.address_.len) return 1;
- if (address_.len < other.address_.len) return -1;
- int retval = memcmp(address_.addr, other.address_.addr, address_.len);
- if (retval != 0) return retval;
- retval = grpc_channel_args_compare(args_, other.args_);
- if (retval != 0) return retval;
- return CompareAttributes(attributes_, other.attributes_);
+ServerAddress::ServerAddress(const ServerAddress& other)
+ : address_(other.address_), args_(grpc_channel_args_copy(other.args_)) {
+ for (const auto& p : other.attributes_) {
+ attributes_[p.first] = p.second->Copy();
+ }
+}
+ServerAddress& ServerAddress::operator=(const ServerAddress& other) {
+ address_ = other.address_;
+ grpc_channel_args_destroy(args_);
+ args_ = grpc_channel_args_copy(other.args_);
+ attributes_.clear();
+ for (const auto& p : other.attributes_) {
+ attributes_[p.first] = p.second->Copy();
+ }
+ return *this;
+}
+
+ServerAddress::ServerAddress(ServerAddress&& other) noexcept
+ : address_(other.address_),
+ args_(other.args_),
+ attributes_(std::move(other.attributes_)) {
+ other.args_ = nullptr;
+}
+ServerAddress& ServerAddress::operator=(ServerAddress&& other) noexcept {
+ address_ = other.address_;
+ grpc_channel_args_destroy(args_);
+ args_ = other.args_;
+ other.args_ = nullptr;
+ attributes_ = std::move(other.attributes_);
+ return *this;
+}
+
+namespace {
+
+int CompareAttributes(
+ const std::map<const char*,
+ std::unique_ptr<ServerAddress::AttributeInterface>>&
+ attributes1,
+ const std::map<const char*,
+ std::unique_ptr<ServerAddress::AttributeInterface>>&
+ attributes2) {
+ auto it2 = attributes2.begin();
+ for (auto it1 = attributes1.begin(); it1 != attributes1.end(); ++it1) {
+ // attributes2 has fewer elements than attributes1
+ if (it2 == attributes2.end()) return -1;
+ // compare keys
+ int retval = strcmp(it1->first, it2->first);
+ if (retval != 0) return retval;
+ // compare values
+ retval = it1->second->Cmp(it2->second.get());
+ if (retval != 0) return retval;
+ ++it2;
+ }
+ // attributes1 has fewer elements than attributes2
+ if (it2 != attributes2.end()) return 1;
+ // equal
+ return 0;
+}
+
+} // namespace
+
+int ServerAddress::Cmp(const ServerAddress& other) const {
+ if (address_.len > other.address_.len) return 1;
+ if (address_.len < other.address_.len) return -1;
+ int retval = memcmp(address_.addr, other.address_.addr, address_.len);
+ if (retval != 0) return retval;
+ retval = grpc_channel_args_compare(args_, other.args_);
+ if (retval != 0) return retval;
+ return CompareAttributes(attributes_, other.attributes_);
+}
+
+const ServerAddress::AttributeInterface* ServerAddress::GetAttribute(
+ const char* key) const {
+ auto it = attributes_.find(key);
+ if (it == attributes_.end()) return nullptr;
+ return it->second.get();
+}
+
+// Returns a copy of the address with a modified attribute.
+// If the new value is null, the attribute is removed.
+ServerAddress ServerAddress::WithAttribute(
+ const char* key, std::unique_ptr<AttributeInterface> value) const {
+ ServerAddress address = *this;
+ if (value == nullptr) {
+ address.attributes_.erase(key);
+ } else {
+ address.attributes_[key] = std::move(value);
+ }
+ return address;
+}
+
+TString ServerAddress::ToString() const {
+ std::vector<TString> parts = {
+ grpc_sockaddr_to_string(&address_, false),
+ };
+ if (args_ != nullptr) {
+ parts.emplace_back(
+ y_absl::StrCat("args={", grpc_channel_args_string(args_), "}"));
+ }
+ if (!attributes_.empty()) {
+ std::vector<TString> attrs;
+ for (const auto& p : attributes_) {
+ attrs.emplace_back(y_absl::StrCat(p.first, "=", p.second->ToString()));
+ }
+ parts.emplace_back(
+ y_absl::StrCat("attributes={", y_absl::StrJoin(attrs, ", "), "}"));
+ }
+ return y_absl::StrJoin(parts, " ");
}
-const ServerAddress::AttributeInterface* ServerAddress::GetAttribute(
- const char* key) const {
- auto it = attributes_.find(key);
- if (it == attributes_.end()) return nullptr;
- return it->second.get();
-}
-
-// Returns a copy of the address with a modified attribute.
-// If the new value is null, the attribute is removed.
-ServerAddress ServerAddress::WithAttribute(
- const char* key, std::unique_ptr<AttributeInterface> value) const {
- ServerAddress address = *this;
- if (value == nullptr) {
- address.attributes_.erase(key);
- } else {
- address.attributes_[key] = std::move(value);
- }
- return address;
-}
-
-TString ServerAddress::ToString() const {
- std::vector<TString> parts = {
- grpc_sockaddr_to_string(&address_, false),
- };
- if (args_ != nullptr) {
- parts.emplace_back(
- y_absl::StrCat("args={", grpc_channel_args_string(args_), "}"));
- }
- if (!attributes_.empty()) {
- std::vector<TString> attrs;
- for (const auto& p : attributes_) {
- attrs.emplace_back(y_absl::StrCat(p.first, "=", p.second->ToString()));
- }
- parts.emplace_back(
- y_absl::StrCat("attributes={", y_absl::StrJoin(attrs, ", "), "}"));
- }
- return y_absl::StrJoin(parts, " ");
-}
-
} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/server_address.h b/contrib/libs/grpc/src/core/ext/filters/client_channel/server_address.h
index 82e8413ee4c..f9359730fae 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/server_address.h
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/server_address.h
@@ -21,11 +21,11 @@
#include <grpc/support/port_platform.h>
-#include <map>
-#include <memory>
-
-#include "y_absl/container/inlined_vector.h"
-
+#include <map>
+#include <memory>
+
+#include "y_absl/container/inlined_vector.h"
+
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/iomgr/resolve_address.h"
@@ -40,77 +40,77 @@ namespace grpc_core {
// args when a subchannel is created for this address.
class ServerAddress {
public:
- // Base class for resolver-supplied attributes.
- // Unlike channel args, these attributes don't affect subchannel
- // uniqueness or behavior. They are for use by LB policies only.
- //
- // Attributes are keyed by a C string that is unique by address, not
- // by value. All attributes added with the same key must be of the
- // same type.
- class AttributeInterface {
- public:
- virtual ~AttributeInterface() = default;
-
- // Creates a copy of the attribute.
- virtual std::unique_ptr<AttributeInterface> Copy() const = 0;
-
- // Compares this attribute with another.
- virtual int Cmp(const AttributeInterface* other) const = 0;
-
- // Returns a human-readable representation of the attribute.
- virtual TString ToString() const = 0;
- };
-
+ // Base class for resolver-supplied attributes.
+ // Unlike channel args, these attributes don't affect subchannel
+ // uniqueness or behavior. They are for use by LB policies only.
+ //
+ // Attributes are keyed by a C string that is unique by address, not
+ // by value. All attributes added with the same key must be of the
+ // same type.
+ class AttributeInterface {
+ public:
+ virtual ~AttributeInterface() = default;
+
+ // Creates a copy of the attribute.
+ virtual std::unique_ptr<AttributeInterface> Copy() const = 0;
+
+ // Compares this attribute with another.
+ virtual int Cmp(const AttributeInterface* other) const = 0;
+
+ // Returns a human-readable representation of the attribute.
+ virtual TString ToString() const = 0;
+ };
+
// Takes ownership of args.
- ServerAddress(const grpc_resolved_address& address, grpc_channel_args* args,
- std::map<const char*, std::unique_ptr<AttributeInterface>>
- attributes = {});
+ ServerAddress(const grpc_resolved_address& address, grpc_channel_args* args,
+ std::map<const char*, std::unique_ptr<AttributeInterface>>
+ attributes = {});
ServerAddress(const void* address, size_t address_len,
- grpc_channel_args* args,
- std::map<const char*, std::unique_ptr<AttributeInterface>>
- attributes = {});
+ grpc_channel_args* args,
+ std::map<const char*, std::unique_ptr<AttributeInterface>>
+ attributes = {});
~ServerAddress() { grpc_channel_args_destroy(args_); }
// Copyable.
- ServerAddress(const ServerAddress& other);
- ServerAddress& operator=(const ServerAddress& other);
+ ServerAddress(const ServerAddress& other);
+ ServerAddress& operator=(const ServerAddress& other);
// Movable.
- ServerAddress(ServerAddress&& other) noexcept;
- ServerAddress& operator=(ServerAddress&& other) noexcept;
+ ServerAddress(ServerAddress&& other) noexcept;
+ ServerAddress& operator=(ServerAddress&& other) noexcept;
+
+ bool operator==(const ServerAddress& other) const { return Cmp(other) == 0; }
- bool operator==(const ServerAddress& other) const { return Cmp(other) == 0; }
+ int Cmp(const ServerAddress& other) const;
- int Cmp(const ServerAddress& other) const;
-
const grpc_resolved_address& address() const { return address_; }
const grpc_channel_args* args() const { return args_; }
- const AttributeInterface* GetAttribute(const char* key) const;
-
- // Returns a copy of the address with a modified attribute.
- // If the new value is null, the attribute is removed.
- ServerAddress WithAttribute(const char* key,
- std::unique_ptr<AttributeInterface> value) const;
-
- TString ToString() const;
-
+ const AttributeInterface* GetAttribute(const char* key) const;
+
+ // Returns a copy of the address with a modified attribute.
+ // If the new value is null, the attribute is removed.
+ ServerAddress WithAttribute(const char* key,
+ std::unique_ptr<AttributeInterface> value) const;
+
+ TString ToString() const;
+
private:
- // Allows the channel to access the attributes without knowing the keys.
- // (We intentionally do not allow LB policies to do this.)
- friend class ChannelServerAddressPeer;
-
+ // Allows the channel to access the attributes without knowing the keys.
+ // (We intentionally do not allow LB policies to do this.)
+ friend class ChannelServerAddressPeer;
+
grpc_resolved_address address_;
grpc_channel_args* args_;
- std::map<const char*, std::unique_ptr<AttributeInterface>> attributes_;
+ std::map<const char*, std::unique_ptr<AttributeInterface>> attributes_;
};
//
// ServerAddressList
//
-typedef y_absl::InlinedVector<ServerAddress, 1> ServerAddressList;
+typedef y_absl::InlinedVector<ServerAddress, 1> ServerAddressList;
} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/service_config.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/service_config.cc
index 4258cab455c..9ff2ad942b9 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/service_config.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/service_config.cc
@@ -18,207 +18,207 @@
#include "src/core/ext/filters/client_channel/service_config.h"
-#include <util/generic/string.h>
+#include <util/generic/string.h>
+
+#include "y_absl/strings/str_cat.h"
-#include "y_absl/strings/str_cat.h"
-
#include <grpc/support/log.h>
-#include "src/core/ext/filters/client_channel/service_config_parser.h"
+#include "src/core/ext/filters/client_channel/service_config_parser.h"
#include "src/core/lib/json/json.h"
#include "src/core/lib/slice/slice_internal.h"
namespace grpc_core {
-RefCountedPtr<ServiceConfig> ServiceConfig::Create(
- const grpc_channel_args* args, y_absl::string_view json_string,
- grpc_error** error) {
+RefCountedPtr<ServiceConfig> ServiceConfig::Create(
+ const grpc_channel_args* args, y_absl::string_view json_string,
+ grpc_error** error) {
GPR_DEBUG_ASSERT(error != nullptr);
- Json json = Json::Parse(json_string, error);
- if (*error != GRPC_ERROR_NONE) return nullptr;
- return MakeRefCounted<ServiceConfig>(args, TString(json_string),
- std::move(json), error);
+ Json json = Json::Parse(json_string, error);
+ if (*error != GRPC_ERROR_NONE) return nullptr;
+ return MakeRefCounted<ServiceConfig>(args, TString(json_string),
+ std::move(json), error);
}
-ServiceConfig::ServiceConfig(const grpc_channel_args* args,
- TString json_string, Json json,
- grpc_error** error)
- : json_string_(std::move(json_string)), json_(std::move(json)) {
+ServiceConfig::ServiceConfig(const grpc_channel_args* args,
+ TString json_string, Json json,
+ grpc_error** error)
+ : json_string_(std::move(json_string)), json_(std::move(json)) {
GPR_DEBUG_ASSERT(error != nullptr);
- if (json_.type() != Json::Type::OBJECT) {
- *error =
- GRPC_ERROR_CREATE_FROM_STATIC_STRING("JSON value is not an object");
+ if (json_.type() != Json::Type::OBJECT) {
+ *error =
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("JSON value is not an object");
return;
}
- std::vector<grpc_error*> error_list;
- grpc_error* global_error = GRPC_ERROR_NONE;
- parsed_global_configs_ =
- ServiceConfigParser::ParseGlobalParameters(args, json_, &global_error);
- if (global_error != GRPC_ERROR_NONE) error_list.push_back(global_error);
- grpc_error* local_error = ParsePerMethodParams(args);
- if (local_error != GRPC_ERROR_NONE) error_list.push_back(local_error);
- if (!error_list.empty()) {
- *error = GRPC_ERROR_CREATE_FROM_VECTOR("Service config parsing error",
- &error_list);
+ std::vector<grpc_error*> error_list;
+ grpc_error* global_error = GRPC_ERROR_NONE;
+ parsed_global_configs_ =
+ ServiceConfigParser::ParseGlobalParameters(args, json_, &global_error);
+ if (global_error != GRPC_ERROR_NONE) error_list.push_back(global_error);
+ grpc_error* local_error = ParsePerMethodParams(args);
+ if (local_error != GRPC_ERROR_NONE) error_list.push_back(local_error);
+ if (!error_list.empty()) {
+ *error = GRPC_ERROR_CREATE_FROM_VECTOR("Service config parsing error",
+ &error_list);
}
}
-ServiceConfig::~ServiceConfig() {
- for (auto& p : parsed_method_configs_map_) {
- grpc_slice_unref_internal(p.first);
+ServiceConfig::~ServiceConfig() {
+ for (auto& p : parsed_method_configs_map_) {
+ grpc_slice_unref_internal(p.first);
}
}
-grpc_error* ServiceConfig::ParseJsonMethodConfig(const grpc_channel_args* args,
- const Json& json) {
- std::vector<grpc_error*> error_list;
- // Parse method config with each registered parser.
- auto parsed_configs =
- y_absl::make_unique<ServiceConfigParser::ParsedConfigVector>();
- grpc_error* parser_error = GRPC_ERROR_NONE;
- *parsed_configs =
- ServiceConfigParser::ParsePerMethodParameters(args, json, &parser_error);
- if (parser_error != GRPC_ERROR_NONE) {
- error_list.push_back(parser_error);
+grpc_error* ServiceConfig::ParseJsonMethodConfig(const grpc_channel_args* args,
+ const Json& json) {
+ std::vector<grpc_error*> error_list;
+ // Parse method config with each registered parser.
+ auto parsed_configs =
+ y_absl::make_unique<ServiceConfigParser::ParsedConfigVector>();
+ grpc_error* parser_error = GRPC_ERROR_NONE;
+ *parsed_configs =
+ ServiceConfigParser::ParsePerMethodParameters(args, json, &parser_error);
+ if (parser_error != GRPC_ERROR_NONE) {
+ error_list.push_back(parser_error);
}
- parsed_method_config_vectors_storage_.push_back(std::move(parsed_configs));
- const auto* vector_ptr = parsed_method_config_vectors_storage_.back().get();
- // Add an entry for each path.
- bool found_name = false;
- auto it = json.object_value().find("name");
- if (it != json.object_value().end()) {
- if (it->second.type() != Json::Type::ARRAY) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:name error:not of type Array"));
- return GRPC_ERROR_CREATE_FROM_VECTOR("methodConfig", &error_list);
- }
- const Json::Array& name_array = it->second.array_value();
- for (const Json& name : name_array) {
- grpc_error* parse_error = GRPC_ERROR_NONE;
- TString path = ParseJsonMethodName(name, &parse_error);
- if (parse_error != GRPC_ERROR_NONE) {
- error_list.push_back(parse_error);
- } else {
- found_name = true;
- if (path.empty()) {
- if (default_method_config_vector_ != nullptr) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:name error:multiple default method configs"));
- }
- default_method_config_vector_ = vector_ptr;
- } else {
- grpc_slice key = grpc_slice_from_copied_string(path.c_str());
- // If the key is not already present in the map, this will
- // store a ref to the key in the map.
- auto& value = parsed_method_configs_map_[key];
- if (value != nullptr) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:name error:multiple method configs with same name"));
- // The map entry already existed, so we need to unref the
- // key we just created.
- grpc_slice_unref_internal(key);
- } else {
- value = vector_ptr;
- }
- }
+ parsed_method_config_vectors_storage_.push_back(std::move(parsed_configs));
+ const auto* vector_ptr = parsed_method_config_vectors_storage_.back().get();
+ // Add an entry for each path.
+ bool found_name = false;
+ auto it = json.object_value().find("name");
+ if (it != json.object_value().end()) {
+ if (it->second.type() != Json::Type::ARRAY) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:name error:not of type Array"));
+ return GRPC_ERROR_CREATE_FROM_VECTOR("methodConfig", &error_list);
+ }
+ const Json::Array& name_array = it->second.array_value();
+ for (const Json& name : name_array) {
+ grpc_error* parse_error = GRPC_ERROR_NONE;
+ TString path = ParseJsonMethodName(name, &parse_error);
+ if (parse_error != GRPC_ERROR_NONE) {
+ error_list.push_back(parse_error);
+ } else {
+ found_name = true;
+ if (path.empty()) {
+ if (default_method_config_vector_ != nullptr) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:name error:multiple default method configs"));
+ }
+ default_method_config_vector_ = vector_ptr;
+ } else {
+ grpc_slice key = grpc_slice_from_copied_string(path.c_str());
+ // If the key is not already present in the map, this will
+ // store a ref to the key in the map.
+ auto& value = parsed_method_configs_map_[key];
+ if (value != nullptr) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:name error:multiple method configs with same name"));
+ // The map entry already existed, so we need to unref the
+ // key we just created.
+ grpc_slice_unref_internal(key);
+ } else {
+ value = vector_ptr;
+ }
+ }
}
}
}
- if (!found_name) {
- parsed_method_config_vectors_storage_.pop_back();
+ if (!found_name) {
+ parsed_method_config_vectors_storage_.pop_back();
}
return GRPC_ERROR_CREATE_FROM_VECTOR("methodConfig", &error_list);
}
-grpc_error* ServiceConfig::ParsePerMethodParams(const grpc_channel_args* args) {
- std::vector<grpc_error*> error_list;
- auto it = json_.object_value().find("methodConfig");
- if (it != json_.object_value().end()) {
- if (it->second.type() != Json::Type::ARRAY) {
+grpc_error* ServiceConfig::ParsePerMethodParams(const grpc_channel_args* args) {
+ std::vector<grpc_error*> error_list;
+ auto it = json_.object_value().find("methodConfig");
+ if (it != json_.object_value().end()) {
+ if (it->second.type() != Json::Type::ARRAY) {
error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:methodConfig error:not of type Array"));
+ "field:methodConfig error:not of type Array"));
}
- for (const Json& method_config : it->second.array_value()) {
- if (method_config.type() != Json::Type::OBJECT) {
+ for (const Json& method_config : it->second.array_value()) {
+ if (method_config.type() != Json::Type::OBJECT) {
error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:methodConfig error:not of type Object"));
- continue;
+ "field:methodConfig error:not of type Object"));
+ continue;
}
- grpc_error* error = ParseJsonMethodConfig(args, method_config);
- if (error != GRPC_ERROR_NONE) {
- error_list.push_back(error);
+ grpc_error* error = ParseJsonMethodConfig(args, method_config);
+ if (error != GRPC_ERROR_NONE) {
+ error_list.push_back(error);
}
}
}
return GRPC_ERROR_CREATE_FROM_VECTOR("Method Params", &error_list);
}
-TString ServiceConfig::ParseJsonMethodName(const Json& json,
- grpc_error** error) {
- if (json.type() != Json::Type::OBJECT) {
+TString ServiceConfig::ParseJsonMethodName(const Json& json,
+ grpc_error** error) {
+ if (json.type() != Json::Type::OBJECT) {
*error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"field:name error:type is not object");
- return "";
+ return "";
}
- // Find service name.
- const TString* service_name = nullptr;
- auto it = json.object_value().find("service");
- if (it != json.object_value().end() &&
- it->second.type() != Json::Type::JSON_NULL) {
- if (it->second.type() != Json::Type::STRING) {
- *error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:name error: field:service error:not of type string");
- return "";
- }
- if (!it->second.string_value().empty()) {
- service_name = &it->second.string_value();
- }
- }
- const TString* method_name = nullptr;
- // Find method name.
- it = json.object_value().find("method");
- if (it != json.object_value().end() &&
- it->second.type() != Json::Type::JSON_NULL) {
- if (it->second.type() != Json::Type::STRING) {
+ // Find service name.
+ const TString* service_name = nullptr;
+ auto it = json.object_value().find("service");
+ if (it != json.object_value().end() &&
+ it->second.type() != Json::Type::JSON_NULL) {
+ if (it->second.type() != Json::Type::STRING) {
*error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:name error: field:method error:not of type string");
- return "";
+ "field:name error: field:service error:not of type string");
+ return "";
}
- if (!it->second.string_value().empty()) {
- method_name = &it->second.string_value();
- }
- }
- // If neither service nor method are specified, it's the default.
- // Method name may not be specified without service name.
- if (service_name == nullptr) {
- if (method_name != nullptr) {
+ if (!it->second.string_value().empty()) {
+ service_name = &it->second.string_value();
+ }
+ }
+ const TString* method_name = nullptr;
+ // Find method name.
+ it = json.object_value().find("method");
+ if (it != json.object_value().end() &&
+ it->second.type() != Json::Type::JSON_NULL) {
+ if (it->second.type() != Json::Type::STRING) {
+ *error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:name error: field:method error:not of type string");
+ return "";
+ }
+ if (!it->second.string_value().empty()) {
+ method_name = &it->second.string_value();
+ }
+ }
+ // If neither service nor method are specified, it's the default.
+ // Method name may not be specified without service name.
+ if (service_name == nullptr) {
+ if (method_name != nullptr) {
*error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:name error:method name populated without service name");
+ "field:name error:method name populated without service name");
}
- return "";
+ return "";
}
- // Construct path.
- return y_absl::StrCat("/", *service_name, "/",
- method_name == nullptr ? "" : *method_name);
+ // Construct path.
+ return y_absl::StrCat("/", *service_name, "/",
+ method_name == nullptr ? "" : *method_name);
}
-const ServiceConfigParser::ParsedConfigVector*
-ServiceConfig::GetMethodParsedConfigVector(const grpc_slice& path) const {
- if (parsed_method_configs_map_.empty()) return nullptr;
- // Try looking up the full path in the map.
- auto it = parsed_method_configs_map_.find(path);
- if (it != parsed_method_configs_map_.end()) return it->second;
+const ServiceConfigParser::ParsedConfigVector*
+ServiceConfig::GetMethodParsedConfigVector(const grpc_slice& path) const {
+ if (parsed_method_configs_map_.empty()) return nullptr;
+ // Try looking up the full path in the map.
+ auto it = parsed_method_configs_map_.find(path);
+ if (it != parsed_method_configs_map_.end()) return it->second;
// If we didn't find a match for the path, try looking for a wildcard
- // entry (i.e., change "/service/method" to "/service/").
- UniquePtr<char> path_str(grpc_slice_to_c_string(path));
- char* sep = strrchr(path_str.get(), '/');
- if (sep == nullptr) return nullptr; // Shouldn't ever happen.
- sep[1] = '\0';
- grpc_slice wildcard_path = grpc_slice_from_static_string(path_str.get());
- it = parsed_method_configs_map_.find(wildcard_path);
- if (it != parsed_method_configs_map_.end()) return it->second;
- // Try default method config, if set.
- return default_method_config_vector_;
+ // entry (i.e., change "/service/method" to "/service/").
+ UniquePtr<char> path_str(grpc_slice_to_c_string(path));
+ char* sep = strrchr(path_str.get(), '/');
+ if (sep == nullptr) return nullptr; // Shouldn't ever happen.
+ sep[1] = '\0';
+ grpc_slice wildcard_path = grpc_slice_from_static_string(path_str.get());
+ it = parsed_method_configs_map_.find(wildcard_path);
+ if (it != parsed_method_configs_map_.end()) return it->second;
+ // Try default method config, if set.
+ return default_method_config_vector_;
}
} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/service_config.h b/contrib/libs/grpc/src/core/ext/filters/client_channel/service_config.h
index 7eda351ac45..718f6026c2d 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/service_config.h
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/service_config.h
@@ -19,19 +19,19 @@
#include <grpc/support/port_platform.h>
-#include <unordered_map>
-
-#include "y_absl/container/inlined_vector.h"
-
+#include <unordered_map>
+
+#include "y_absl/container/inlined_vector.h"
+
#include <grpc/impl/codegen/grpc_types.h>
#include <grpc/support/string_util.h>
-#include "src/core/ext/filters/client_channel/service_config_parser.h"
+#include "src/core/ext/filters/client_channel/service_config_parser.h"
#include "src/core/lib/gprpp/ref_counted.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/iomgr/error.h"
#include "src/core/lib/json/json.h"
-#include "src/core/lib/slice/slice_internal.h"
+#include "src/core/lib/slice/slice_internal.h"
// The main purpose of the code here is to parse the service config in
// JSON form, which will look like this:
@@ -59,26 +59,26 @@
namespace grpc_core {
-// TODO(roth): Consider stripping this down further to the completely minimal
-// interface requied to be exposed as part of the resolver API.
+// TODO(roth): Consider stripping this down further to the completely minimal
+// interface requied to be exposed as part of the resolver API.
class ServiceConfig : public RefCounted<ServiceConfig> {
public:
/// Creates a new service config from parsing \a json_string.
/// Returns null on parse error.
- static RefCountedPtr<ServiceConfig> Create(const grpc_channel_args* args,
- y_absl::string_view json_string,
+ static RefCountedPtr<ServiceConfig> Create(const grpc_channel_args* args,
+ y_absl::string_view json_string,
grpc_error** error);
- ServiceConfig(const grpc_channel_args* args, TString json_string,
- Json json, grpc_error** error);
- ~ServiceConfig();
+ ServiceConfig(const grpc_channel_args* args, TString json_string,
+ Json json, grpc_error** error);
+ ~ServiceConfig();
- const TString& json_string() const { return json_string_; }
+ const TString& json_string() const { return json_string_; }
/// Retrieves the global parsed config at index \a index. The
/// lifetime of the returned object is tied to the lifetime of the
/// ServiceConfig object.
- ServiceConfigParser::ParsedConfig* GetGlobalParsedConfig(size_t index) {
+ ServiceConfigParser::ParsedConfig* GetGlobalParsedConfig(size_t index) {
GPR_DEBUG_ASSERT(index < parsed_global_configs_.size());
return parsed_global_configs_[index].get();
}
@@ -86,38 +86,38 @@ class ServiceConfig : public RefCounted<ServiceConfig> {
/// Retrieves the vector of parsed configs for the method identified
/// by \a path. The lifetime of the returned vector and contained objects
/// is tied to the lifetime of the ServiceConfig object.
- const ServiceConfigParser::ParsedConfigVector* GetMethodParsedConfigVector(
- const grpc_slice& path) const;
+ const ServiceConfigParser::ParsedConfigVector* GetMethodParsedConfigVector(
+ const grpc_slice& path) const;
private:
- // Helper functions for parsing the method configs.
- grpc_error* ParsePerMethodParams(const grpc_channel_args* args);
- grpc_error* ParseJsonMethodConfig(const grpc_channel_args* args,
- const Json& json);
+ // Helper functions for parsing the method configs.
+ grpc_error* ParsePerMethodParams(const grpc_channel_args* args);
+ grpc_error* ParseJsonMethodConfig(const grpc_channel_args* args,
+ const Json& json);
- // Returns a path string for the JSON name object specified by json.
- // Sets *error on error.
- static TString ParseJsonMethodName(const Json& json, grpc_error** error);
+ // Returns a path string for the JSON name object specified by json.
+ // Sets *error on error.
+ static TString ParseJsonMethodName(const Json& json, grpc_error** error);
- TString json_string_;
- Json json_;
+ TString json_string_;
+ Json json_;
- y_absl::InlinedVector<std::unique_ptr<ServiceConfigParser::ParsedConfig>,
- ServiceConfigParser::kNumPreallocatedParsers>
+ y_absl::InlinedVector<std::unique_ptr<ServiceConfigParser::ParsedConfig>,
+ ServiceConfigParser::kNumPreallocatedParsers>
parsed_global_configs_;
// A map from the method name to the parsed config vector. Note that we are
// using a raw pointer and not a unique pointer so that we can use the same
// vector for multiple names.
- std::unordered_map<grpc_slice, const ServiceConfigParser::ParsedConfigVector*,
- SliceHash>
- parsed_method_configs_map_;
- // Default method config.
- const ServiceConfigParser::ParsedConfigVector* default_method_config_vector_ =
- nullptr;
+ std::unordered_map<grpc_slice, const ServiceConfigParser::ParsedConfigVector*,
+ SliceHash>
+ parsed_method_configs_map_;
+ // Default method config.
+ const ServiceConfigParser::ParsedConfigVector* default_method_config_vector_ =
+ nullptr;
// Storage for all the vectors that are being used in
// parsed_method_configs_table_.
- y_absl::InlinedVector<std::unique_ptr<ServiceConfigParser::ParsedConfigVector>,
- 32>
+ y_absl::InlinedVector<std::unique_ptr<ServiceConfigParser::ParsedConfigVector>,
+ 32>
parsed_method_config_vectors_storage_;
};
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/service_config_call_data.h b/contrib/libs/grpc/src/core/ext/filters/client_channel/service_config_call_data.h
index b5dd3d01e94..b6b5b73ce08 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/service_config_call_data.h
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/service_config_call_data.h
@@ -1,68 +1,68 @@
-//
-// Copyright 2016 gRPC authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-#ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_SERVICE_CONFIG_CALL_DATA_H
-#define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_SERVICE_CONFIG_CALL_DATA_H
-
-#include <grpc/support/port_platform.h>
-
-#include "src/core/ext/filters/client_channel/service_config.h"
-#include "src/core/ext/filters/client_channel/service_config_parser.h"
-#include "src/core/lib/channel/context.h"
-#include "src/core/lib/gprpp/ref_counted_ptr.h"
-
-namespace grpc_core {
-
-/// When a service config is applied to a call in the client_channel_filter,
-/// we create an instance of this object on the arena. A pointer to this
-/// object is also stored in the call_context, so that future filters can
-/// easily access method and global parameters for the call.
-class ServiceConfigCallData {
- public:
- ServiceConfigCallData(
- RefCountedPtr<ServiceConfig> service_config,
- const ServiceConfigParser::ParsedConfigVector* method_configs,
- grpc_call_context_element* call_context)
- : service_config_(std::move(service_config)),
- method_configs_(method_configs) {
- call_context[GRPC_CONTEXT_SERVICE_CONFIG_CALL_DATA].value = this;
- call_context[GRPC_CONTEXT_SERVICE_CONFIG_CALL_DATA].destroy = Destroy;
- }
-
- ServiceConfig* service_config() { return service_config_.get(); }
-
- ServiceConfigParser::ParsedConfig* GetMethodParsedConfig(size_t index) const {
- return method_configs_ != nullptr ? (*method_configs_)[index].get()
- : nullptr;
- }
-
- ServiceConfigParser::ParsedConfig* GetGlobalParsedConfig(size_t index) const {
- return service_config_->GetGlobalParsedConfig(index);
- }
-
- private:
- static void Destroy(void* ptr) {
- ServiceConfigCallData* self = static_cast<ServiceConfigCallData*>(ptr);
- self->~ServiceConfigCallData();
- }
-
- RefCountedPtr<ServiceConfig> service_config_;
- const ServiceConfigParser::ParsedConfigVector* method_configs_ = nullptr;
-};
-
-} // namespace grpc_core
-
-#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_SERVICE_CONFIG_CALL_DATA_H */
+//
+// Copyright 2016 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+#ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_SERVICE_CONFIG_CALL_DATA_H
+#define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_SERVICE_CONFIG_CALL_DATA_H
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/ext/filters/client_channel/service_config.h"
+#include "src/core/ext/filters/client_channel/service_config_parser.h"
+#include "src/core/lib/channel/context.h"
+#include "src/core/lib/gprpp/ref_counted_ptr.h"
+
+namespace grpc_core {
+
+/// When a service config is applied to a call in the client_channel_filter,
+/// we create an instance of this object on the arena. A pointer to this
+/// object is also stored in the call_context, so that future filters can
+/// easily access method and global parameters for the call.
+class ServiceConfigCallData {
+ public:
+ ServiceConfigCallData(
+ RefCountedPtr<ServiceConfig> service_config,
+ const ServiceConfigParser::ParsedConfigVector* method_configs,
+ grpc_call_context_element* call_context)
+ : service_config_(std::move(service_config)),
+ method_configs_(method_configs) {
+ call_context[GRPC_CONTEXT_SERVICE_CONFIG_CALL_DATA].value = this;
+ call_context[GRPC_CONTEXT_SERVICE_CONFIG_CALL_DATA].destroy = Destroy;
+ }
+
+ ServiceConfig* service_config() { return service_config_.get(); }
+
+ ServiceConfigParser::ParsedConfig* GetMethodParsedConfig(size_t index) const {
+ return method_configs_ != nullptr ? (*method_configs_)[index].get()
+ : nullptr;
+ }
+
+ ServiceConfigParser::ParsedConfig* GetGlobalParsedConfig(size_t index) const {
+ return service_config_->GetGlobalParsedConfig(index);
+ }
+
+ private:
+ static void Destroy(void* ptr) {
+ ServiceConfigCallData* self = static_cast<ServiceConfigCallData*>(ptr);
+ self->~ServiceConfigCallData();
+ }
+
+ RefCountedPtr<ServiceConfig> service_config_;
+ const ServiceConfigParser::ParsedConfigVector* method_configs_ = nullptr;
+};
+
+} // namespace grpc_core
+
+#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_SERVICE_CONFIG_CALL_DATA_H */
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/service_config_channel_arg_filter.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/service_config_channel_arg_filter.cc
index c7e00b13896..679c0f572c2 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/service_config_channel_arg_filter.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/service_config_channel_arg_filter.cc
@@ -1,142 +1,142 @@
-//
-// Copyright 2020 gRPC authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-// This filter reads GRPC_ARG_SERVICE_CONFIG and populates ServiceConfigCallData
-// in the call context per call for direct channels.
-
-#include <grpc/support/port_platform.h>
-
-#include "src/core/ext/filters/client_channel/service_config_call_data.h"
-#include "src/core/lib/channel/channel_args.h"
-#include "src/core/lib/channel/channel_stack.h"
-#include "src/core/lib/channel/channel_stack_builder.h"
-#include "src/core/lib/surface/channel_init.h"
-
-namespace grpc_core {
-
-namespace {
-
-class ServiceConfigChannelArgChannelData {
- public:
- explicit ServiceConfigChannelArgChannelData(
- const grpc_channel_element_args* args) {
- const char* service_config_str = grpc_channel_args_find_string(
- args->channel_args, GRPC_ARG_SERVICE_CONFIG);
- if (service_config_str != nullptr) {
- grpc_error* service_config_error = GRPC_ERROR_NONE;
- auto service_config = ServiceConfig::Create(
- args->channel_args, service_config_str, &service_config_error);
- if (service_config_error == GRPC_ERROR_NONE) {
- service_config_ = std::move(service_config);
- } else {
- gpr_log(GPR_ERROR, "%s", grpc_error_string(service_config_error));
- }
- GRPC_ERROR_UNREF(service_config_error);
- }
- }
-
- RefCountedPtr<ServiceConfig> service_config() const {
- return service_config_;
- }
-
- private:
- RefCountedPtr<ServiceConfig> service_config_;
-};
-
-class ServiceConfigChannelArgCallData {
- public:
- ServiceConfigChannelArgCallData(grpc_call_element* elem,
- const grpc_call_element_args* args) {
- ServiceConfigChannelArgChannelData* chand =
- static_cast<ServiceConfigChannelArgChannelData*>(elem->channel_data);
- RefCountedPtr<ServiceConfig> service_config = chand->service_config();
- if (service_config != nullptr) {
- GPR_DEBUG_ASSERT(args->context != nullptr);
- const auto* method_params_vector =
- service_config->GetMethodParsedConfigVector(args->path);
- args->arena->New<ServiceConfigCallData>(
- std::move(service_config), method_params_vector, args->context);
- }
- }
-};
-
-grpc_error* ServiceConfigChannelArgInitCallElem(
- grpc_call_element* elem, const grpc_call_element_args* args) {
- ServiceConfigChannelArgCallData* calld =
- static_cast<ServiceConfigChannelArgCallData*>(elem->call_data);
- new (calld) ServiceConfigChannelArgCallData(elem, args);
- return GRPC_ERROR_NONE;
-}
-
-void ServiceConfigChannelArgDestroyCallElem(
- grpc_call_element* elem, const grpc_call_final_info* /* final_info */,
- grpc_closure* /* then_schedule_closure */) {
- ServiceConfigChannelArgCallData* calld =
- static_cast<ServiceConfigChannelArgCallData*>(elem->call_data);
- calld->~ServiceConfigChannelArgCallData();
-}
-
-grpc_error* ServiceConfigChannelArgInitChannelElem(
- grpc_channel_element* elem, grpc_channel_element_args* args) {
- ServiceConfigChannelArgChannelData* chand =
- static_cast<ServiceConfigChannelArgChannelData*>(elem->channel_data);
- new (chand) ServiceConfigChannelArgChannelData(args);
- return GRPC_ERROR_NONE;
-}
-
-void ServiceConfigChannelArgDestroyChannelElem(grpc_channel_element* elem) {
- ServiceConfigChannelArgChannelData* chand =
- static_cast<ServiceConfigChannelArgChannelData*>(elem->channel_data);
- chand->~ServiceConfigChannelArgChannelData();
-}
-
-const grpc_channel_filter ServiceConfigChannelArgFilter = {
- grpc_call_next_op,
- grpc_channel_next_op,
- sizeof(ServiceConfigChannelArgCallData),
- ServiceConfigChannelArgInitCallElem,
- grpc_call_stack_ignore_set_pollset_or_pollset_set,
- ServiceConfigChannelArgDestroyCallElem,
- sizeof(ServiceConfigChannelArgChannelData),
- ServiceConfigChannelArgInitChannelElem,
- ServiceConfigChannelArgDestroyChannelElem,
- grpc_channel_next_get_info,
- "service_config_channel_arg"};
-
-bool maybe_add_service_config_channel_arg_filter(
- grpc_channel_stack_builder* builder, void* /* arg */) {
- const grpc_channel_args* channel_args =
- grpc_channel_stack_builder_get_channel_arguments(builder);
- if (grpc_channel_args_want_minimal_stack(channel_args) ||
- grpc_channel_args_find_string(channel_args, GRPC_ARG_SERVICE_CONFIG) ==
- nullptr) {
- return true;
- }
- return grpc_channel_stack_builder_prepend_filter(
- builder, &ServiceConfigChannelArgFilter, nullptr, nullptr);
-}
-
-} // namespace
-
-} // namespace grpc_core
-
-void grpc_service_config_channel_arg_filter_init(void) {
- grpc_channel_init_register_stage(
- GRPC_CLIENT_DIRECT_CHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
- grpc_core::maybe_add_service_config_channel_arg_filter, nullptr);
-}
-
-void grpc_service_config_channel_arg_filter_shutdown(void) {}
+//
+// Copyright 2020 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+// This filter reads GRPC_ARG_SERVICE_CONFIG and populates ServiceConfigCallData
+// in the call context per call for direct channels.
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/ext/filters/client_channel/service_config_call_data.h"
+#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/channel/channel_stack.h"
+#include "src/core/lib/channel/channel_stack_builder.h"
+#include "src/core/lib/surface/channel_init.h"
+
+namespace grpc_core {
+
+namespace {
+
+class ServiceConfigChannelArgChannelData {
+ public:
+ explicit ServiceConfigChannelArgChannelData(
+ const grpc_channel_element_args* args) {
+ const char* service_config_str = grpc_channel_args_find_string(
+ args->channel_args, GRPC_ARG_SERVICE_CONFIG);
+ if (service_config_str != nullptr) {
+ grpc_error* service_config_error = GRPC_ERROR_NONE;
+ auto service_config = ServiceConfig::Create(
+ args->channel_args, service_config_str, &service_config_error);
+ if (service_config_error == GRPC_ERROR_NONE) {
+ service_config_ = std::move(service_config);
+ } else {
+ gpr_log(GPR_ERROR, "%s", grpc_error_string(service_config_error));
+ }
+ GRPC_ERROR_UNREF(service_config_error);
+ }
+ }
+
+ RefCountedPtr<ServiceConfig> service_config() const {
+ return service_config_;
+ }
+
+ private:
+ RefCountedPtr<ServiceConfig> service_config_;
+};
+
+class ServiceConfigChannelArgCallData {
+ public:
+ ServiceConfigChannelArgCallData(grpc_call_element* elem,
+ const grpc_call_element_args* args) {
+ ServiceConfigChannelArgChannelData* chand =
+ static_cast<ServiceConfigChannelArgChannelData*>(elem->channel_data);
+ RefCountedPtr<ServiceConfig> service_config = chand->service_config();
+ if (service_config != nullptr) {
+ GPR_DEBUG_ASSERT(args->context != nullptr);
+ const auto* method_params_vector =
+ service_config->GetMethodParsedConfigVector(args->path);
+ args->arena->New<ServiceConfigCallData>(
+ std::move(service_config), method_params_vector, args->context);
+ }
+ }
+};
+
+grpc_error* ServiceConfigChannelArgInitCallElem(
+ grpc_call_element* elem, const grpc_call_element_args* args) {
+ ServiceConfigChannelArgCallData* calld =
+ static_cast<ServiceConfigChannelArgCallData*>(elem->call_data);
+ new (calld) ServiceConfigChannelArgCallData(elem, args);
+ return GRPC_ERROR_NONE;
+}
+
+void ServiceConfigChannelArgDestroyCallElem(
+ grpc_call_element* elem, const grpc_call_final_info* /* final_info */,
+ grpc_closure* /* then_schedule_closure */) {
+ ServiceConfigChannelArgCallData* calld =
+ static_cast<ServiceConfigChannelArgCallData*>(elem->call_data);
+ calld->~ServiceConfigChannelArgCallData();
+}
+
+grpc_error* ServiceConfigChannelArgInitChannelElem(
+ grpc_channel_element* elem, grpc_channel_element_args* args) {
+ ServiceConfigChannelArgChannelData* chand =
+ static_cast<ServiceConfigChannelArgChannelData*>(elem->channel_data);
+ new (chand) ServiceConfigChannelArgChannelData(args);
+ return GRPC_ERROR_NONE;
+}
+
+void ServiceConfigChannelArgDestroyChannelElem(grpc_channel_element* elem) {
+ ServiceConfigChannelArgChannelData* chand =
+ static_cast<ServiceConfigChannelArgChannelData*>(elem->channel_data);
+ chand->~ServiceConfigChannelArgChannelData();
+}
+
+const grpc_channel_filter ServiceConfigChannelArgFilter = {
+ grpc_call_next_op,
+ grpc_channel_next_op,
+ sizeof(ServiceConfigChannelArgCallData),
+ ServiceConfigChannelArgInitCallElem,
+ grpc_call_stack_ignore_set_pollset_or_pollset_set,
+ ServiceConfigChannelArgDestroyCallElem,
+ sizeof(ServiceConfigChannelArgChannelData),
+ ServiceConfigChannelArgInitChannelElem,
+ ServiceConfigChannelArgDestroyChannelElem,
+ grpc_channel_next_get_info,
+ "service_config_channel_arg"};
+
+bool maybe_add_service_config_channel_arg_filter(
+ grpc_channel_stack_builder* builder, void* /* arg */) {
+ const grpc_channel_args* channel_args =
+ grpc_channel_stack_builder_get_channel_arguments(builder);
+ if (grpc_channel_args_want_minimal_stack(channel_args) ||
+ grpc_channel_args_find_string(channel_args, GRPC_ARG_SERVICE_CONFIG) ==
+ nullptr) {
+ return true;
+ }
+ return grpc_channel_stack_builder_prepend_filter(
+ builder, &ServiceConfigChannelArgFilter, nullptr, nullptr);
+}
+
+} // namespace
+
+} // namespace grpc_core
+
+void grpc_service_config_channel_arg_filter_init(void) {
+ grpc_channel_init_register_stage(
+ GRPC_CLIENT_DIRECT_CHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
+ grpc_core::maybe_add_service_config_channel_arg_filter, nullptr);
+}
+
+void grpc_service_config_channel_arg_filter_shutdown(void) {}
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/service_config_parser.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/service_config_parser.cc
index e425635b235..9575a1f85ab 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/service_config_parser.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/service_config_parser.cc
@@ -1,89 +1,89 @@
-//
-// Copyright 2015 gRPC authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-#include <grpc/support/port_platform.h>
-
-#include "src/core/ext/filters/client_channel/service_config_parser.h"
-
-#include <grpc/support/log.h>
-
-namespace grpc_core {
-
-namespace {
-typedef y_absl::InlinedVector<std::unique_ptr<ServiceConfigParser::Parser>,
- ServiceConfigParser::kNumPreallocatedParsers>
- ServiceConfigParserList;
-ServiceConfigParserList* g_registered_parsers;
-} // namespace
-
-void ServiceConfigParser::Init() {
- GPR_ASSERT(g_registered_parsers == nullptr);
- g_registered_parsers = new ServiceConfigParserList();
-}
-
-void ServiceConfigParser::Shutdown() {
- delete g_registered_parsers;
- g_registered_parsers = nullptr;
-}
-
-size_t ServiceConfigParser::RegisterParser(std::unique_ptr<Parser> parser) {
- g_registered_parsers->push_back(std::move(parser));
- return g_registered_parsers->size() - 1;
-}
-
-ServiceConfigParser::ParsedConfigVector
-ServiceConfigParser::ParseGlobalParameters(const grpc_channel_args* args,
- const Json& json,
- grpc_error** error) {
- ParsedConfigVector parsed_global_configs;
- std::vector<grpc_error*> error_list;
- for (size_t i = 0; i < g_registered_parsers->size(); i++) {
- grpc_error* parser_error = GRPC_ERROR_NONE;
- auto parsed_config = (*g_registered_parsers)[i]->ParseGlobalParams(
- args, json, &parser_error);
- if (parser_error != GRPC_ERROR_NONE) {
- error_list.push_back(parser_error);
- }
- parsed_global_configs.push_back(std::move(parsed_config));
- }
- if (!error_list.empty()) {
- *error = GRPC_ERROR_CREATE_FROM_VECTOR("Global Params", &error_list);
- }
- return parsed_global_configs;
-}
-
-ServiceConfigParser::ParsedConfigVector
-ServiceConfigParser::ParsePerMethodParameters(const grpc_channel_args* args,
- const Json& json,
- grpc_error** error) {
- ParsedConfigVector parsed_method_configs;
- std::vector<grpc_error*> error_list;
- for (size_t i = 0; i < g_registered_parsers->size(); i++) {
- grpc_error* parser_error = GRPC_ERROR_NONE;
- auto parsed_config = (*g_registered_parsers)[i]->ParsePerMethodParams(
- args, json, &parser_error);
- if (parser_error != GRPC_ERROR_NONE) {
- error_list.push_back(parser_error);
- }
- parsed_method_configs.push_back(std::move(parsed_config));
- }
- if (!error_list.empty()) {
- *error = GRPC_ERROR_CREATE_FROM_VECTOR("methodConfig", &error_list);
- }
- return parsed_method_configs;
-}
-
-} // namespace grpc_core
+//
+// Copyright 2015 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/ext/filters/client_channel/service_config_parser.h"
+
+#include <grpc/support/log.h>
+
+namespace grpc_core {
+
+namespace {
+typedef y_absl::InlinedVector<std::unique_ptr<ServiceConfigParser::Parser>,
+ ServiceConfigParser::kNumPreallocatedParsers>
+ ServiceConfigParserList;
+ServiceConfigParserList* g_registered_parsers;
+} // namespace
+
+void ServiceConfigParser::Init() {
+ GPR_ASSERT(g_registered_parsers == nullptr);
+ g_registered_parsers = new ServiceConfigParserList();
+}
+
+void ServiceConfigParser::Shutdown() {
+ delete g_registered_parsers;
+ g_registered_parsers = nullptr;
+}
+
+size_t ServiceConfigParser::RegisterParser(std::unique_ptr<Parser> parser) {
+ g_registered_parsers->push_back(std::move(parser));
+ return g_registered_parsers->size() - 1;
+}
+
+ServiceConfigParser::ParsedConfigVector
+ServiceConfigParser::ParseGlobalParameters(const grpc_channel_args* args,
+ const Json& json,
+ grpc_error** error) {
+ ParsedConfigVector parsed_global_configs;
+ std::vector<grpc_error*> error_list;
+ for (size_t i = 0; i < g_registered_parsers->size(); i++) {
+ grpc_error* parser_error = GRPC_ERROR_NONE;
+ auto parsed_config = (*g_registered_parsers)[i]->ParseGlobalParams(
+ args, json, &parser_error);
+ if (parser_error != GRPC_ERROR_NONE) {
+ error_list.push_back(parser_error);
+ }
+ parsed_global_configs.push_back(std::move(parsed_config));
+ }
+ if (!error_list.empty()) {
+ *error = GRPC_ERROR_CREATE_FROM_VECTOR("Global Params", &error_list);
+ }
+ return parsed_global_configs;
+}
+
+ServiceConfigParser::ParsedConfigVector
+ServiceConfigParser::ParsePerMethodParameters(const grpc_channel_args* args,
+ const Json& json,
+ grpc_error** error) {
+ ParsedConfigVector parsed_method_configs;
+ std::vector<grpc_error*> error_list;
+ for (size_t i = 0; i < g_registered_parsers->size(); i++) {
+ grpc_error* parser_error = GRPC_ERROR_NONE;
+ auto parsed_config = (*g_registered_parsers)[i]->ParsePerMethodParams(
+ args, json, &parser_error);
+ if (parser_error != GRPC_ERROR_NONE) {
+ error_list.push_back(parser_error);
+ }
+ parsed_method_configs.push_back(std::move(parsed_config));
+ }
+ if (!error_list.empty()) {
+ *error = GRPC_ERROR_CREATE_FROM_VECTOR("methodConfig", &error_list);
+ }
+ return parsed_method_configs;
+}
+
+} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/service_config_parser.h b/contrib/libs/grpc/src/core/ext/filters/client_channel/service_config_parser.h
index 1fe99054493..6fcb768377f 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/service_config_parser.h
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/service_config_parser.h
@@ -1,92 +1,92 @@
-//
-// Copyright 2016 gRPC authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-#ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_SERVICE_CONFIG_PARSER_H
-#define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_SERVICE_CONFIG_PARSER_H
-
-#include <grpc/support/port_platform.h>
-
-#include <memory>
-
-#include "y_absl/container/inlined_vector.h"
-
-#include <grpc/impl/codegen/grpc_types.h>
-
-#include "src/core/lib/iomgr/error.h"
-#include "src/core/lib/json/json.h"
-
-namespace grpc_core {
-
-// Service config parser registry.
-// See service_config.h for more information.
-class ServiceConfigParser {
- public:
- /// This is the base class that all service config parsers MUST use to store
- /// parsed service config data.
- class ParsedConfig {
- public:
- virtual ~ParsedConfig() = default;
- };
-
- /// This is the base class that all service config parsers should derive from.
- class Parser {
- public:
- virtual ~Parser() = default;
-
- virtual std::unique_ptr<ParsedConfig> ParseGlobalParams(
- const grpc_channel_args*, const Json& /* json */, grpc_error** error) {
- // Avoid unused parameter warning on debug-only parameter
- (void)error;
- GPR_DEBUG_ASSERT(error != nullptr);
- return nullptr;
- }
-
- virtual std::unique_ptr<ParsedConfig> ParsePerMethodParams(
- const grpc_channel_args*, const Json& /* json */, grpc_error** error) {
- // Avoid unused parameter warning on debug-only parameter
- (void)error;
- GPR_DEBUG_ASSERT(error != nullptr);
- return nullptr;
- }
- };
-
- static constexpr int kNumPreallocatedParsers = 4;
- typedef y_absl::InlinedVector<std::unique_ptr<ParsedConfig>,
- kNumPreallocatedParsers>
- ParsedConfigVector;
-
- static void Init();
- static void Shutdown();
-
- /// Globally register a service config parser. On successful registration, it
- /// returns the index at which the parser was registered. On failure, -1 is
- /// returned. Each new service config update will go through all the
- /// registered parser. Each parser is responsible for reading the service
- /// config json and returning a parsed config. This parsed config can later be
- /// retrieved using the same index that was returned at registration time.
- static size_t RegisterParser(std::unique_ptr<Parser> parser);
-
- static ParsedConfigVector ParseGlobalParameters(const grpc_channel_args* args,
- const Json& json,
- grpc_error** error);
-
- static ParsedConfigVector ParsePerMethodParameters(
- const grpc_channel_args* args, const Json& json, grpc_error** error);
-};
-
-} // namespace grpc_core
-
-#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_SERVICE_CONFIG_PARSER_H */
+//
+// Copyright 2016 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+#ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_SERVICE_CONFIG_PARSER_H
+#define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_SERVICE_CONFIG_PARSER_H
+
+#include <grpc/support/port_platform.h>
+
+#include <memory>
+
+#include "y_absl/container/inlined_vector.h"
+
+#include <grpc/impl/codegen/grpc_types.h>
+
+#include "src/core/lib/iomgr/error.h"
+#include "src/core/lib/json/json.h"
+
+namespace grpc_core {
+
+// Service config parser registry.
+// See service_config.h for more information.
+class ServiceConfigParser {
+ public:
+ /// This is the base class that all service config parsers MUST use to store
+ /// parsed service config data.
+ class ParsedConfig {
+ public:
+ virtual ~ParsedConfig() = default;
+ };
+
+ /// This is the base class that all service config parsers should derive from.
+ class Parser {
+ public:
+ virtual ~Parser() = default;
+
+ virtual std::unique_ptr<ParsedConfig> ParseGlobalParams(
+ const grpc_channel_args*, const Json& /* json */, grpc_error** error) {
+ // Avoid unused parameter warning on debug-only parameter
+ (void)error;
+ GPR_DEBUG_ASSERT(error != nullptr);
+ return nullptr;
+ }
+
+ virtual std::unique_ptr<ParsedConfig> ParsePerMethodParams(
+ const grpc_channel_args*, const Json& /* json */, grpc_error** error) {
+ // Avoid unused parameter warning on debug-only parameter
+ (void)error;
+ GPR_DEBUG_ASSERT(error != nullptr);
+ return nullptr;
+ }
+ };
+
+ static constexpr int kNumPreallocatedParsers = 4;
+ typedef y_absl::InlinedVector<std::unique_ptr<ParsedConfig>,
+ kNumPreallocatedParsers>
+ ParsedConfigVector;
+
+ static void Init();
+ static void Shutdown();
+
+ /// Globally register a service config parser. On successful registration, it
+ /// returns the index at which the parser was registered. On failure, -1 is
+ /// returned. Each new service config update will go through all the
+ /// registered parser. Each parser is responsible for reading the service
+ /// config json and returning a parsed config. This parsed config can later be
+ /// retrieved using the same index that was returned at registration time.
+ static size_t RegisterParser(std::unique_ptr<Parser> parser);
+
+ static ParsedConfigVector ParseGlobalParameters(const grpc_channel_args* args,
+ const Json& json,
+ grpc_error** error);
+
+ static ParsedConfigVector ParsePerMethodParameters(
+ const grpc_channel_args* args, const Json& json, grpc_error** error);
+};
+
+} // namespace grpc_core
+
+#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_SERVICE_CONFIG_PARSER_H */
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/subchannel.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/subchannel.cc
index 70ba16b1cb5..39800681e0f 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/subchannel.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/subchannel.cc
@@ -26,8 +26,8 @@
#include <algorithm>
#include <cstring>
-#include "y_absl/strings/str_format.h"
-
+#include "y_absl/strings/str_format.h"
+
#include <grpc/support/alloc.h>
#include <grpc/support/string_util.h>
@@ -45,7 +45,7 @@
#include "src/core/lib/gprpp/manual_constructor.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/gprpp/sync.h"
-#include "src/core/lib/iomgr/parse_address.h"
+#include "src/core/lib/iomgr/parse_address.h"
#include "src/core/lib/iomgr/sockaddr_utils.h"
#include "src/core/lib/profiling/timers.h"
#include "src/core/lib/slice/slice_internal.h"
@@ -327,8 +327,8 @@ class Subchannel::ConnectedSubchannelStateWatcher
}
private:
- void OnConnectivityStateChange(grpc_connectivity_state new_state,
- const y_absl::Status& status) override {
+ void OnConnectivityStateChange(grpc_connectivity_state new_state,
+ const y_absl::Status& status) override {
Subchannel* c = subchannel_;
MutexLock lock(&c->mu_);
switch (new_state) {
@@ -346,15 +346,15 @@ class Subchannel::ConnectedSubchannelStateWatcher
if (c->channelz_node() != nullptr) {
c->channelz_node()->SetChildSocket(nullptr);
}
- // We need to construct our own status if the underlying state was
- // shutdown since the accompanying status will be StatusCode::OK
- // otherwise.
- c->SetConnectivityStateLocked(
- GRPC_CHANNEL_TRANSIENT_FAILURE,
- new_state == GRPC_CHANNEL_SHUTDOWN
- ? y_absl::Status(y_absl::StatusCode::kUnavailable,
- "Subchannel has disconnected.")
- : status);
+ // We need to construct our own status if the underlying state was
+ // shutdown since the accompanying status will be StatusCode::OK
+ // otherwise.
+ c->SetConnectivityStateLocked(
+ GRPC_CHANNEL_TRANSIENT_FAILURE,
+ new_state == GRPC_CHANNEL_SHUTDOWN
+ ? y_absl::Status(y_absl::StatusCode::kUnavailable,
+ "Subchannel has disconnected.")
+ : status);
c->backoff_begun_ = false;
c->backoff_.Reset();
}
@@ -365,7 +365,7 @@ class Subchannel::ConnectedSubchannelStateWatcher
// a callback for READY, because that was the state we started
// this watch from. And a connected subchannel should never go
// from READY to CONNECTING or IDLE.
- c->SetConnectivityStateLocked(new_state, status);
+ c->SetConnectivityStateLocked(new_state, status);
}
}
}
@@ -373,45 +373,45 @@ class Subchannel::ConnectedSubchannelStateWatcher
Subchannel* subchannel_;
};
-// Asynchronously notifies the \a watcher of a change in the connectvity state
-// of \a subchannel to the current \a state. Deletes itself when done.
-class Subchannel::AsyncWatcherNotifierLocked {
- public:
- AsyncWatcherNotifierLocked(
- RefCountedPtr<Subchannel::ConnectivityStateWatcherInterface> watcher,
- Subchannel* subchannel, grpc_connectivity_state state,
- const y_absl::Status& status)
- : watcher_(std::move(watcher)) {
- RefCountedPtr<ConnectedSubchannel> connected_subchannel;
- if (state == GRPC_CHANNEL_READY) {
- connected_subchannel = subchannel->connected_subchannel_;
- }
- watcher_->PushConnectivityStateChange(
- {state, status, std::move(connected_subchannel)});
- ExecCtx::Run(
- DEBUG_LOCATION,
- GRPC_CLOSURE_INIT(&closure_,
- [](void* arg, grpc_error* /*error*/) {
- auto* self =
- static_cast<AsyncWatcherNotifierLocked*>(arg);
- self->watcher_->OnConnectivityStateChange();
- delete self;
- },
- this, nullptr),
- GRPC_ERROR_NONE);
- }
-
- private:
- RefCountedPtr<Subchannel::ConnectivityStateWatcherInterface> watcher_;
- grpc_closure closure_;
-};
-
+// Asynchronously notifies the \a watcher of a change in the connectvity state
+// of \a subchannel to the current \a state. Deletes itself when done.
+class Subchannel::AsyncWatcherNotifierLocked {
+ public:
+ AsyncWatcherNotifierLocked(
+ RefCountedPtr<Subchannel::ConnectivityStateWatcherInterface> watcher,
+ Subchannel* subchannel, grpc_connectivity_state state,
+ const y_absl::Status& status)
+ : watcher_(std::move(watcher)) {
+ RefCountedPtr<ConnectedSubchannel> connected_subchannel;
+ if (state == GRPC_CHANNEL_READY) {
+ connected_subchannel = subchannel->connected_subchannel_;
+ }
+ watcher_->PushConnectivityStateChange(
+ {state, status, std::move(connected_subchannel)});
+ ExecCtx::Run(
+ DEBUG_LOCATION,
+ GRPC_CLOSURE_INIT(&closure_,
+ [](void* arg, grpc_error* /*error*/) {
+ auto* self =
+ static_cast<AsyncWatcherNotifierLocked*>(arg);
+ self->watcher_->OnConnectivityStateChange();
+ delete self;
+ },
+ this, nullptr),
+ GRPC_ERROR_NONE);
+ }
+
+ private:
+ RefCountedPtr<Subchannel::ConnectivityStateWatcherInterface> watcher_;
+ grpc_closure closure_;
+};
+
//
// Subchannel::ConnectivityStateWatcherList
//
void Subchannel::ConnectivityStateWatcherList::AddWatcherLocked(
- RefCountedPtr<ConnectivityStateWatcherInterface> watcher) {
+ RefCountedPtr<ConnectivityStateWatcherInterface> watcher) {
watchers_.insert(std::make_pair(watcher.get(), std::move(watcher)));
}
@@ -421,10 +421,10 @@ void Subchannel::ConnectivityStateWatcherList::RemoveWatcherLocked(
}
void Subchannel::ConnectivityStateWatcherList::NotifyLocked(
- Subchannel* subchannel, grpc_connectivity_state state,
- const y_absl::Status& status) {
+ Subchannel* subchannel, grpc_connectivity_state state,
+ const y_absl::Status& status) {
for (const auto& p : watchers_) {
- new AsyncWatcherNotifierLocked(p.second, subchannel, state, status);
+ new AsyncWatcherNotifierLocked(p.second, subchannel, state, status);
}
}
@@ -461,9 +461,9 @@ class Subchannel::HealthWatcherMap::HealthWatcher
void AddWatcherLocked(
grpc_connectivity_state initial_state,
- RefCountedPtr<Subchannel::ConnectivityStateWatcherInterface> watcher) {
+ RefCountedPtr<Subchannel::ConnectivityStateWatcherInterface> watcher) {
if (state_ != initial_state) {
- new AsyncWatcherNotifierLocked(watcher, subchannel_, state_, status_);
+ new AsyncWatcherNotifierLocked(watcher, subchannel_, state_, status_);
}
watcher_list_.AddWatcherLocked(std::move(watcher));
}
@@ -475,7 +475,7 @@ class Subchannel::HealthWatcherMap::HealthWatcher
bool HasWatchers() const { return !watcher_list_.empty(); }
- void NotifyLocked(grpc_connectivity_state state, const y_absl::Status& status) {
+ void NotifyLocked(grpc_connectivity_state state, const y_absl::Status& status) {
if (state == GRPC_CHANNEL_READY) {
// If we had not already notified for CONNECTING state, do so now.
// (We may have missed this earlier, because if the transition
@@ -483,15 +483,15 @@ class Subchannel::HealthWatcherMap::HealthWatcher
// subchannel may not have sent us a notification for CONNECTING.)
if (state_ != GRPC_CHANNEL_CONNECTING) {
state_ = GRPC_CHANNEL_CONNECTING;
- status_ = status;
- watcher_list_.NotifyLocked(subchannel_, state_, status);
+ status_ = status;
+ watcher_list_.NotifyLocked(subchannel_, state_, status);
}
// If we've become connected, start health checking.
StartHealthCheckingLocked();
} else {
state_ = state;
- status_ = status;
- watcher_list_.NotifyLocked(subchannel_, state_, status);
+ status_ = status;
+ watcher_list_.NotifyLocked(subchannel_, state_, status);
// We're not connected, so stop health checking.
health_check_client_.reset();
}
@@ -504,13 +504,13 @@ class Subchannel::HealthWatcherMap::HealthWatcher
}
private:
- void OnConnectivityStateChange(grpc_connectivity_state new_state,
- const y_absl::Status& status) override {
+ void OnConnectivityStateChange(grpc_connectivity_state new_state,
+ const y_absl::Status& status) override {
MutexLock lock(&subchannel_->mu_);
if (new_state != GRPC_CHANNEL_SHUTDOWN && health_check_client_ != nullptr) {
state_ = new_state;
- status_ = status;
- watcher_list_.NotifyLocked(subchannel_, new_state, status);
+ status_ = status;
+ watcher_list_.NotifyLocked(subchannel_, new_state, status);
}
}
@@ -525,7 +525,7 @@ class Subchannel::HealthWatcherMap::HealthWatcher
grpc_core::UniquePtr<char> health_check_service_name_;
OrphanablePtr<HealthCheckClient> health_check_client_;
grpc_connectivity_state state_;
- y_absl::Status status_;
+ y_absl::Status status_;
ConnectivityStateWatcherList watcher_list_;
};
@@ -536,7 +536,7 @@ class Subchannel::HealthWatcherMap::HealthWatcher
void Subchannel::HealthWatcherMap::AddWatcherLocked(
Subchannel* subchannel, grpc_connectivity_state initial_state,
grpc_core::UniquePtr<char> health_check_service_name,
- RefCountedPtr<ConnectivityStateWatcherInterface> watcher) {
+ RefCountedPtr<ConnectivityStateWatcherInterface> watcher) {
// If the health check service name is not already present in the map,
// add it.
auto it = map_.find(health_check_service_name.get());
@@ -565,10 +565,10 @@ void Subchannel::HealthWatcherMap::RemoveWatcherLocked(
if (!it->second->HasWatchers()) map_.erase(it);
}
-void Subchannel::HealthWatcherMap::NotifyLocked(grpc_connectivity_state state,
- const y_absl::Status& status) {
+void Subchannel::HealthWatcherMap::NotifyLocked(grpc_connectivity_state state,
+ const y_absl::Status& status) {
for (const auto& p : map_) {
- p.second->NotifyLocked(state, status);
+ p.second->NotifyLocked(state, status);
}
}
@@ -647,21 +647,21 @@ BackOff::Options ParseArgsForBackoffValues(
} // namespace
-void Subchannel::ConnectivityStateWatcherInterface::PushConnectivityStateChange(
- ConnectivityStateChange state_change) {
- MutexLock lock(&mu_);
- connectivity_state_queue_.push_back(std::move(state_change));
-}
-
-Subchannel::ConnectivityStateWatcherInterface::ConnectivityStateChange
-Subchannel::ConnectivityStateWatcherInterface::PopConnectivityStateChange() {
- MutexLock lock(&mu_);
- GPR_ASSERT(!connectivity_state_queue_.empty());
- ConnectivityStateChange state_change = connectivity_state_queue_.front();
- connectivity_state_queue_.pop_front();
- return state_change;
-}
-
+void Subchannel::ConnectivityStateWatcherInterface::PushConnectivityStateChange(
+ ConnectivityStateChange state_change) {
+ MutexLock lock(&mu_);
+ connectivity_state_queue_.push_back(std::move(state_change));
+}
+
+Subchannel::ConnectivityStateWatcherInterface::ConnectivityStateChange
+Subchannel::ConnectivityStateWatcherInterface::PopConnectivityStateChange() {
+ MutexLock lock(&mu_);
+ GPR_ASSERT(!connectivity_state_queue_.empty());
+ ConnectivityStateChange state_change = connectivity_state_queue_.front();
+ connectivity_state_queue_.pop_front();
+ return state_change;
+}
+
Subchannel::Subchannel(SubchannelKey* key,
OrphanablePtr<SubchannelConnector> connector,
const grpc_channel_args* args)
@@ -743,25 +743,25 @@ Subchannel* Subchannel::Create(OrphanablePtr<SubchannelConnector> connector,
return registered;
}
-void Subchannel::ThrottleKeepaliveTime(int new_keepalive_time) {
- MutexLock lock(&mu_);
- // Only update the value if the new keepalive time is larger.
- if (new_keepalive_time > keepalive_time_) {
- keepalive_time_ = new_keepalive_time;
- if (grpc_trace_subchannel.enabled()) {
- gpr_log(GPR_INFO, "Subchannel=%p: Throttling keepalive time to %d", this,
- new_keepalive_time);
- }
- const grpc_arg arg_to_add = grpc_channel_arg_integer_create(
- const_cast<char*>(GRPC_ARG_KEEPALIVE_TIME_MS), new_keepalive_time);
- const char* arg_to_remove = GRPC_ARG_KEEPALIVE_TIME_MS;
- grpc_channel_args* new_args = grpc_channel_args_copy_and_add_and_remove(
- args_, &arg_to_remove, 1, &arg_to_add, 1);
- grpc_channel_args_destroy(args_);
- args_ = new_args;
- }
-}
-
+void Subchannel::ThrottleKeepaliveTime(int new_keepalive_time) {
+ MutexLock lock(&mu_);
+ // Only update the value if the new keepalive time is larger.
+ if (new_keepalive_time > keepalive_time_) {
+ keepalive_time_ = new_keepalive_time;
+ if (grpc_trace_subchannel.enabled()) {
+ gpr_log(GPR_INFO, "Subchannel=%p: Throttling keepalive time to %d", this,
+ new_keepalive_time);
+ }
+ const grpc_arg arg_to_add = grpc_channel_arg_integer_create(
+ const_cast<char*>(GRPC_ARG_KEEPALIVE_TIME_MS), new_keepalive_time);
+ const char* arg_to_remove = GRPC_ARG_KEEPALIVE_TIME_MS;
+ grpc_channel_args* new_args = grpc_channel_args_copy_and_add_and_remove(
+ args_, &arg_to_remove, 1, &arg_to_add, 1);
+ grpc_channel_args_destroy(args_);
+ args_ = new_args;
+ }
+}
+
Subchannel* Subchannel::Ref(GRPC_SUBCHANNEL_REF_EXTRA_ARGS) {
gpr_atm old_refs;
old_refs = RefMutate((1 << INTERNAL_REF_BITS),
@@ -856,7 +856,7 @@ grpc_connectivity_state Subchannel::CheckConnectivityState(
void Subchannel::WatchConnectivityState(
grpc_connectivity_state initial_state,
grpc_core::UniquePtr<char> health_check_service_name,
- RefCountedPtr<ConnectivityStateWatcherInterface> watcher) {
+ RefCountedPtr<ConnectivityStateWatcherInterface> watcher) {
MutexLock lock(&mu_);
grpc_pollset_set* interested_parties = watcher->interested_parties();
if (interested_parties != nullptr) {
@@ -864,7 +864,7 @@ void Subchannel::WatchConnectivityState(
}
if (health_check_service_name == nullptr) {
if (state_ != initial_state) {
- new AsyncWatcherNotifierLocked(watcher, this, state_, status_);
+ new AsyncWatcherNotifierLocked(watcher, this, state_, status_);
}
watcher_list_.AddWatcherLocked(std::move(watcher));
} else {
@@ -910,7 +910,7 @@ grpc_arg Subchannel::CreateSubchannelAddressArg(
const grpc_resolved_address* addr) {
return grpc_channel_arg_string_create(
(char*)GRPC_ARG_SUBCHANNEL_ADDRESS,
- gpr_strdup(addr->len > 0 ? grpc_sockaddr_to_uri(addr).c_str() : ""));
+ gpr_strdup(addr->len > 0 ? grpc_sockaddr_to_uri(addr).c_str() : ""));
}
const char* Subchannel::GetUriFromSubchannelAddressArg(
@@ -966,10 +966,10 @@ const char* SubchannelConnectivityStateChangeString(
} // namespace
// Note: Must be called with a state that is different from the current state.
-void Subchannel::SetConnectivityStateLocked(grpc_connectivity_state state,
- const y_absl::Status& status) {
+void Subchannel::SetConnectivityStateLocked(grpc_connectivity_state state,
+ const y_absl::Status& status) {
state_ = state;
- status_ = status;
+ status_ = status;
if (channelz_node_ != nullptr) {
channelz_node_->UpdateConnectivityState(state);
channelz_node_->AddTraceEvent(
@@ -978,9 +978,9 @@ void Subchannel::SetConnectivityStateLocked(grpc_connectivity_state state,
SubchannelConnectivityStateChangeString(state)));
}
// Notify non-health watchers.
- watcher_list_.NotifyLocked(this, state, status);
+ watcher_list_.NotifyLocked(this, state, status);
// Notify health watchers.
- health_watcher_map_.NotifyLocked(state, status);
+ health_watcher_map_.NotifyLocked(state, status);
}
void Subchannel::MaybeStartConnectingLocked() {
@@ -1052,7 +1052,7 @@ void Subchannel::ContinueConnectingLocked() {
next_attempt_deadline_ = backoff_.NextAttemptTime();
args.deadline = std::max(next_attempt_deadline_, min_deadline);
args.channel_args = args_;
- SetConnectivityStateLocked(GRPC_CHANNEL_CONNECTING, y_absl::Status());
+ SetConnectivityStateLocked(GRPC_CHANNEL_CONNECTING, y_absl::Status());
connector_->Connect(args, &connecting_result_, &on_connecting_finished_);
}
@@ -1071,8 +1071,8 @@ void Subchannel::OnConnectingFinished(void* arg, grpc_error* error) {
GRPC_SUBCHANNEL_WEAK_UNREF(c, "connecting");
} else {
gpr_log(GPR_INFO, "Connect failed: %s", grpc_error_string(error));
- c->SetConnectivityStateLocked(GRPC_CHANNEL_TRANSIENT_FAILURE,
- grpc_error_to_absl_status(error));
+ c->SetConnectivityStateLocked(GRPC_CHANNEL_TRANSIENT_FAILURE,
+ grpc_error_to_absl_status(error));
GRPC_SUBCHANNEL_WEAK_UNREF(c, "connecting");
}
}
@@ -1132,7 +1132,7 @@ bool Subchannel::PublishTransportLocked() {
connected_subchannel_->StartWatch(
pollset_set_, MakeOrphanable<ConnectedSubchannelStateWatcher>(this));
// Report initial state.
- SetConnectivityStateLocked(GRPC_CHANNEL_READY, y_absl::Status());
+ SetConnectivityStateLocked(GRPC_CHANNEL_READY, y_absl::Status());
return true;
}
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/subchannel.h b/contrib/libs/grpc/src/core/ext/filters/client_channel/subchannel.h
index feb2ab8822c..0ced846c385 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/subchannel.h
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/subchannel.h
@@ -21,8 +21,8 @@
#include <grpc/support/port_platform.h>
-#include <deque>
-
+#include <deque>
+
#include "src/core/ext/filters/client_channel/client_channel_channelz.h"
#include "src/core/ext/filters/client_channel/connector.h"
#include "src/core/ext/filters/client_channel/subchannel_pool_interface.h"
@@ -39,7 +39,7 @@
#include "src/core/lib/transport/connectivity_state.h"
#include "src/core/lib/transport/metadata.h"
-// Channel arg containing a URI indicating the address to connect to.
+// Channel arg containing a URI indicating the address to connect to.
#define GRPC_ARG_SUBCHANNEL_ADDRESS "grpc.subchannel_address"
// For debugging refcounting.
@@ -178,45 +178,45 @@ class SubchannelCall {
class Subchannel {
public:
class ConnectivityStateWatcherInterface
- : public RefCounted<ConnectivityStateWatcherInterface> {
+ : public RefCounted<ConnectivityStateWatcherInterface> {
public:
- struct ConnectivityStateChange {
- grpc_connectivity_state state;
- y_absl::Status status;
- RefCountedPtr<ConnectedSubchannel> connected_subchannel;
- };
-
+ struct ConnectivityStateChange {
+ grpc_connectivity_state state;
+ y_absl::Status status;
+ RefCountedPtr<ConnectedSubchannel> connected_subchannel;
+ };
+
virtual ~ConnectivityStateWatcherInterface() = default;
// Will be invoked whenever the subchannel's connectivity state
// changes. There will be only one invocation of this method on a
// given watcher instance at any given time.
- // Implementations should call PopConnectivityStateChange to get the next
- // connectivity state change.
- virtual void OnConnectivityStateChange() = 0;
-
- virtual grpc_pollset_set* interested_parties() = 0;
-
- // Enqueues connectivity state change notifications.
+ // Implementations should call PopConnectivityStateChange to get the next
+ // connectivity state change.
+ virtual void OnConnectivityStateChange() = 0;
+
+ virtual grpc_pollset_set* interested_parties() = 0;
+
+ // Enqueues connectivity state change notifications.
// When the state changes to READY, connected_subchannel will
// contain a ref to the connected subchannel. When it changes from
// READY to some other state, the implementation must release its
// ref to the connected subchannel.
- // TODO(yashkt): This is currently needed to send the state updates in the
- // right order when asynchronously notifying. This will no longer be
- // necessary when we have access to EventManager.
- void PushConnectivityStateChange(ConnectivityStateChange state_change);
-
- // Dequeues connectivity state change notifications.
- ConnectivityStateChange PopConnectivityStateChange();
-
- private:
- // Keeps track of the updates that the watcher instance must be notified of.
- // TODO(yashkt): This is currently needed to send the state updates in the
- // right order when asynchronously notifying. This will no longer be
- // necessary when we have access to EventManager.
- std::deque<ConnectivityStateChange> connectivity_state_queue_;
- Mutex mu_; // protects the queue
+ // TODO(yashkt): This is currently needed to send the state updates in the
+ // right order when asynchronously notifying. This will no longer be
+ // necessary when we have access to EventManager.
+ void PushConnectivityStateChange(ConnectivityStateChange state_change);
+
+ // Dequeues connectivity state change notifications.
+ ConnectivityStateChange PopConnectivityStateChange();
+
+ private:
+ // Keeps track of the updates that the watcher instance must be notified of.
+ // TODO(yashkt): This is currently needed to send the state updates in the
+ // right order when asynchronously notifying. This will no longer be
+ // necessary when we have access to EventManager.
+ std::deque<ConnectivityStateChange> connectivity_state_queue_;
+ Mutex mu_; // protects the queue
};
// The ctor and dtor are not intended to use directly.
@@ -228,11 +228,11 @@ class Subchannel {
static Subchannel* Create(OrphanablePtr<SubchannelConnector> connector,
const grpc_channel_args* args);
- // Throttles keepalive time to \a new_keepalive_time iff \a new_keepalive_time
- // is larger than the subchannel's current keepalive time. The updated value
- // will have an affect when the subchannel creates a new ConnectedSubchannel.
- void ThrottleKeepaliveTime(int new_keepalive_time);
-
+ // Throttles keepalive time to \a new_keepalive_time iff \a new_keepalive_time
+ // is larger than the subchannel's current keepalive time. The updated value
+ // will have an affect when the subchannel creates a new ConnectedSubchannel.
+ void ThrottleKeepaliveTime(int new_keepalive_time);
+
// Strong and weak refcounting.
Subchannel* Ref(GRPC_SUBCHANNEL_REF_EXTRA_ARGS);
void Unref(GRPC_SUBCHANNEL_REF_EXTRA_ARGS);
@@ -271,7 +271,7 @@ class Subchannel {
void WatchConnectivityState(
grpc_connectivity_state initial_state,
grpc_core::UniquePtr<char> health_check_service_name,
- RefCountedPtr<ConnectivityStateWatcherInterface> watcher);
+ RefCountedPtr<ConnectivityStateWatcherInterface> watcher);
// Cancels a connectivity state watch.
// If the watcher has already been destroyed, this is a no-op.
@@ -308,12 +308,12 @@ class Subchannel {
~ConnectivityStateWatcherList() { Clear(); }
void AddWatcherLocked(
- RefCountedPtr<ConnectivityStateWatcherInterface> watcher);
+ RefCountedPtr<ConnectivityStateWatcherInterface> watcher);
void RemoveWatcherLocked(ConnectivityStateWatcherInterface* watcher);
// Notifies all watchers in the list about a change to state.
- void NotifyLocked(Subchannel* subchannel, grpc_connectivity_state state,
- const y_absl::Status& status);
+ void NotifyLocked(Subchannel* subchannel, grpc_connectivity_state state,
+ const y_absl::Status& status);
void Clear() { watchers_.clear(); }
@@ -323,7 +323,7 @@ class Subchannel {
// TODO(roth): Once we can use C++-14 heterogeneous lookups, this can
// be a set instead of a map.
std::map<ConnectivityStateWatcherInterface*,
- RefCountedPtr<ConnectivityStateWatcherInterface>>
+ RefCountedPtr<ConnectivityStateWatcherInterface>>
watchers_;
};
@@ -341,13 +341,13 @@ class Subchannel {
void AddWatcherLocked(
Subchannel* subchannel, grpc_connectivity_state initial_state,
grpc_core::UniquePtr<char> health_check_service_name,
- RefCountedPtr<ConnectivityStateWatcherInterface> watcher);
+ RefCountedPtr<ConnectivityStateWatcherInterface> watcher);
void RemoveWatcherLocked(const char* health_check_service_name,
ConnectivityStateWatcherInterface* watcher);
// Notifies the watcher when the subchannel's state changes.
- void NotifyLocked(grpc_connectivity_state state,
- const y_absl::Status& status);
+ void NotifyLocked(grpc_connectivity_state state,
+ const y_absl::Status& status);
grpc_connectivity_state CheckConnectivityStateLocked(
Subchannel* subchannel, const char* health_check_service_name);
@@ -362,11 +362,11 @@ class Subchannel {
class ConnectedSubchannelStateWatcher;
- class AsyncWatcherNotifierLocked;
-
+ class AsyncWatcherNotifierLocked;
+
// Sets the subchannel's connectivity state to \a state.
- void SetConnectivityStateLocked(grpc_connectivity_state state,
- const y_absl::Status& status);
+ void SetConnectivityStateLocked(grpc_connectivity_state state,
+ const y_absl::Status& status);
// Methods for connection.
void MaybeStartConnectingLocked();
@@ -409,7 +409,7 @@ class Subchannel {
// Connectivity state tracking.
grpc_connectivity_state state_ = GRPC_CHANNEL_IDLE;
- y_absl::Status status_;
+ y_absl::Status status_;
// The list of watchers without a health check service name.
ConnectivityStateWatcherList watcher_list_;
// The map of watchers with health check service names.
@@ -427,8 +427,8 @@ class Subchannel {
bool have_retry_alarm_ = false;
// reset_backoff() was called while alarm was pending.
bool retry_immediately_ = false;
- // Keepalive time period (-1 for unset)
- int keepalive_time_ = -1;
+ // Keepalive time period (-1 for unset)
+ int keepalive_time_ = -1;
// Channelz tracking.
RefCountedPtr<channelz::SubchannelNode> channelz_node_;
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/subchannel_interface.h b/contrib/libs/grpc/src/core/ext/filters/client_channel/subchannel_interface.h
index 8c5fcb3af74..ccaca4ef08f 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/subchannel_interface.h
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/subchannel_interface.h
@@ -21,7 +21,7 @@
#include <grpc/support/port_platform.h>
-#include "src/core/ext/filters/client_channel/server_address.h"
+#include "src/core/ext/filters/client_channel/server_address.h"
#include "src/core/lib/gprpp/ref_counted.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
@@ -88,51 +88,51 @@ class SubchannelInterface : public RefCounted<SubchannelInterface> {
// TODO(roth): Need a better non-grpc-specific abstraction here.
virtual const grpc_channel_args* channel_args() = 0;
-
- // Allows accessing the attributes associated with the address for
- // this subchannel.
- virtual const ServerAddress::AttributeInterface* GetAttribute(
- const char* key) const = 0;
+
+ // Allows accessing the attributes associated with the address for
+ // this subchannel.
+ virtual const ServerAddress::AttributeInterface* GetAttribute(
+ const char* key) const = 0;
+};
+
+// A class that delegates to another subchannel, to be used in cases
+// where an LB policy needs to wrap a subchannel.
+class DelegatingSubchannel : public SubchannelInterface {
+ public:
+ explicit DelegatingSubchannel(RefCountedPtr<SubchannelInterface> subchannel)
+ : wrapped_subchannel_(std::move(subchannel)) {}
+
+ RefCountedPtr<SubchannelInterface> wrapped_subchannel() const {
+ return wrapped_subchannel_;
+ }
+
+ grpc_connectivity_state CheckConnectivityState() override {
+ return wrapped_subchannel_->CheckConnectivityState();
+ }
+ void WatchConnectivityState(
+ grpc_connectivity_state initial_state,
+ std::unique_ptr<ConnectivityStateWatcherInterface> watcher) override {
+ return wrapped_subchannel_->WatchConnectivityState(initial_state,
+ std::move(watcher));
+ }
+ void CancelConnectivityStateWatch(
+ ConnectivityStateWatcherInterface* watcher) override {
+ return wrapped_subchannel_->CancelConnectivityStateWatch(watcher);
+ }
+ void AttemptToConnect() override { wrapped_subchannel_->AttemptToConnect(); }
+ void ResetBackoff() override { wrapped_subchannel_->ResetBackoff(); }
+ const grpc_channel_args* channel_args() override {
+ return wrapped_subchannel_->channel_args();
+ }
+ const ServerAddress::AttributeInterface* GetAttribute(
+ const char* key) const override {
+ return wrapped_subchannel_->GetAttribute(key);
+ }
+
+ private:
+ RefCountedPtr<SubchannelInterface> wrapped_subchannel_;
};
-// A class that delegates to another subchannel, to be used in cases
-// where an LB policy needs to wrap a subchannel.
-class DelegatingSubchannel : public SubchannelInterface {
- public:
- explicit DelegatingSubchannel(RefCountedPtr<SubchannelInterface> subchannel)
- : wrapped_subchannel_(std::move(subchannel)) {}
-
- RefCountedPtr<SubchannelInterface> wrapped_subchannel() const {
- return wrapped_subchannel_;
- }
-
- grpc_connectivity_state CheckConnectivityState() override {
- return wrapped_subchannel_->CheckConnectivityState();
- }
- void WatchConnectivityState(
- grpc_connectivity_state initial_state,
- std::unique_ptr<ConnectivityStateWatcherInterface> watcher) override {
- return wrapped_subchannel_->WatchConnectivityState(initial_state,
- std::move(watcher));
- }
- void CancelConnectivityStateWatch(
- ConnectivityStateWatcherInterface* watcher) override {
- return wrapped_subchannel_->CancelConnectivityStateWatch(watcher);
- }
- void AttemptToConnect() override { wrapped_subchannel_->AttemptToConnect(); }
- void ResetBackoff() override { wrapped_subchannel_->ResetBackoff(); }
- const grpc_channel_args* channel_args() override {
- return wrapped_subchannel_->channel_args();
- }
- const ServerAddress::AttributeInterface* GetAttribute(
- const char* key) const override {
- return wrapped_subchannel_->GetAttribute(key);
- }
-
- private:
- RefCountedPtr<SubchannelInterface> wrapped_subchannel_;
-};
-
} // namespace grpc_core
#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_SUBCHANNEL_INTERFACE_H */
diff --git a/contrib/libs/grpc/src/core/ext/filters/http/client/http_client_filter.cc b/contrib/libs/grpc/src/core/ext/filters/http/client/http_client_filter.cc
index f679693f867..f5f18474da8 100644
--- a/contrib/libs/grpc/src/core/ext/filters/http/client/http_client_filter.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/http/client/http_client_filter.cc
@@ -17,19 +17,19 @@
#include <grpc/support/port_platform.h>
-#include <stdint.h>
-#include <string.h>
-
-#include <util/generic/string.h>
-#include <vector>
-
-#include "y_absl/strings/str_cat.h"
-#include "y_absl/strings/str_format.h"
-#include "y_absl/strings/str_join.h"
-
+#include <stdint.h>
+#include <string.h>
+
+#include <util/generic/string.h>
+#include <vector>
+
+#include "y_absl/strings/str_cat.h"
+#include "y_absl/strings/str_format.h"
+#include "y_absl/strings/str_join.h"
+
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
-
+
#include "src/core/ext/filters/http/client/http_client_filter.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gprpp/manual_constructor.h"
@@ -121,8 +121,8 @@ static grpc_error* client_filter_incoming_metadata(grpc_metadata_batch* b) {
} else {
char* val = grpc_dump_slice(GRPC_MDVALUE(b->idx.named.status->md),
GPR_DUMP_ASCII);
- TString msg =
- y_absl::StrCat("Received http2 header with status: ", val);
+ TString msg =
+ y_absl::StrCat("Received http2 header with status: ", val);
grpc_error* e = grpc_error_set_str(
grpc_error_set_int(
grpc_error_set_str(
@@ -131,8 +131,8 @@ static grpc_error* client_filter_incoming_metadata(grpc_metadata_batch* b) {
GRPC_ERROR_STR_VALUE, grpc_slice_from_copied_string(val)),
GRPC_ERROR_INT_GRPC_STATUS,
grpc_http2_status_to_grpc_status(atoi(val))),
- GRPC_ERROR_STR_GRPC_MESSAGE,
- grpc_slice_from_cpp_string(std::move(msg)));
+ GRPC_ERROR_STR_GRPC_MESSAGE,
+ grpc_slice_from_cpp_string(std::move(msg)));
gpr_free(val);
return e;
}
@@ -528,36 +528,36 @@ static size_t max_payload_size_from_args(const grpc_channel_args* args) {
static grpc_core::ManagedMemorySlice user_agent_from_args(
const grpc_channel_args* args, const char* transport_name) {
- std::vector<TString> user_agent_fields;
+ std::vector<TString> user_agent_fields;
- for (size_t i = 0; args && i < args->num_args; i++) {
+ for (size_t i = 0; args && i < args->num_args; i++) {
if (0 == strcmp(args->args[i].key, GRPC_ARG_PRIMARY_USER_AGENT_STRING)) {
if (args->args[i].type != GRPC_ARG_STRING) {
gpr_log(GPR_ERROR, "Channel argument '%s' should be a string",
GRPC_ARG_PRIMARY_USER_AGENT_STRING);
} else {
- user_agent_fields.push_back(args->args[i].value.string);
+ user_agent_fields.push_back(args->args[i].value.string);
}
}
}
- user_agent_fields.push_back(
- y_absl::StrFormat("grpc-c/%s (%s; %s)", grpc_version_string(),
- GPR_PLATFORM_STRING, transport_name));
+ user_agent_fields.push_back(
+ y_absl::StrFormat("grpc-c/%s (%s; %s)", grpc_version_string(),
+ GPR_PLATFORM_STRING, transport_name));
- for (size_t i = 0; args && i < args->num_args; i++) {
+ for (size_t i = 0; args && i < args->num_args; i++) {
if (0 == strcmp(args->args[i].key, GRPC_ARG_SECONDARY_USER_AGENT_STRING)) {
if (args->args[i].type != GRPC_ARG_STRING) {
gpr_log(GPR_ERROR, "Channel argument '%s' should be a string",
GRPC_ARG_SECONDARY_USER_AGENT_STRING);
} else {
- user_agent_fields.push_back(args->args[i].value.string);
+ user_agent_fields.push_back(args->args[i].value.string);
}
}
}
- TString user_agent_string = y_absl::StrJoin(user_agent_fields, " ");
- return grpc_core::ManagedMemorySlice(user_agent_string.c_str());
+ TString user_agent_string = y_absl::StrJoin(user_agent_fields, " ");
+ return grpc_core::ManagedMemorySlice(user_agent_string.c_str());
}
/* Constructor for channel_data */
diff --git a/contrib/libs/grpc/src/core/ext/filters/http/client_authority_filter.cc b/contrib/libs/grpc/src/core/ext/filters/http/client_authority_filter.cc
index 97eb4bd65c3..2c3cae6adbc 100644
--- a/contrib/libs/grpc/src/core/ext/filters/http/client_authority_filter.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/http/client_authority_filter.cc
@@ -55,11 +55,11 @@ void client_authority_start_transport_stream_op_batch(
// Handle send_initial_metadata.
// If the initial metadata doesn't already contain :authority, add it.
if (batch->send_initial_metadata &&
- batch->payload->send_initial_metadata.send_initial_metadata->idx.named
- .authority == nullptr) {
+ batch->payload->send_initial_metadata.send_initial_metadata->idx.named
+ .authority == nullptr) {
grpc_error* error = grpc_metadata_batch_add_head(
- batch->payload->send_initial_metadata.send_initial_metadata,
- &calld->authority_storage,
+ batch->payload->send_initial_metadata.send_initial_metadata,
+ &calld->authority_storage,
GRPC_MDELEM_REF(chand->default_authority_mdelem), GRPC_BATCH_AUTHORITY);
if (error != GRPC_ERROR_NONE) {
grpc_transport_stream_op_batch_finish_with_failure(batch, error,
diff --git a/contrib/libs/grpc/src/core/ext/filters/http/http_filters_plugin.cc b/contrib/libs/grpc/src/core/ext/filters/http/http_filters_plugin.cc
index a30fce50ad2..637dc3030f2 100644
--- a/contrib/libs/grpc/src/core/ext/filters/http/http_filters_plugin.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/http/http_filters_plugin.cc
@@ -22,7 +22,7 @@
#include "src/core/ext/filters/http/client/http_client_filter.h"
#include "src/core/ext/filters/http/message_compress/message_compress_filter.h"
-#include "src/core/ext/filters/http/message_compress/message_decompress_filter.h"
+#include "src/core/ext/filters/http/message_compress/message_decompress_filter.h"
#include "src/core/ext/filters/http/server/http_server_filter.h"
#include "src/core/lib/channel/channel_stack_builder.h"
#include "src/core/lib/surface/call.h"
@@ -37,17 +37,17 @@ struct optional_filter {
static optional_filter compress_filter = {
&grpc_message_compress_filter, GRPC_ARG_ENABLE_PER_MESSAGE_COMPRESSION};
-static optional_filter decompress_filter = {
- &grpc_core::MessageDecompressFilter,
- GRPC_ARG_ENABLE_PER_MESSAGE_DECOMPRESSION};
-
+static optional_filter decompress_filter = {
+ &grpc_core::MessageDecompressFilter,
+ GRPC_ARG_ENABLE_PER_MESSAGE_DECOMPRESSION};
+
static bool is_building_http_like_transport(
grpc_channel_stack_builder* builder) {
grpc_transport* t = grpc_channel_stack_builder_get_transport(builder);
return t != nullptr && strstr(t->vtable->name, "http");
}
-template <bool enable_in_minimal_stack>
+template <bool enable_in_minimal_stack>
static bool maybe_add_optional_filter(grpc_channel_stack_builder* builder,
void* arg) {
if (!is_building_http_like_transport(builder)) return true;
@@ -56,8 +56,8 @@ static bool maybe_add_optional_filter(grpc_channel_stack_builder* builder,
grpc_channel_stack_builder_get_channel_arguments(builder);
bool enable = grpc_channel_arg_get_bool(
grpc_channel_args_find(channel_args, filtarg->control_channel_arg),
- enable_in_minimal_stack ||
- !grpc_channel_args_want_minimal_stack(channel_args));
+ enable_in_minimal_stack ||
+ !grpc_channel_args_want_minimal_stack(channel_args));
return enable ? grpc_channel_stack_builder_prepend_filter(
builder, filtarg->filter, nullptr, nullptr)
: true;
@@ -75,24 +75,24 @@ static bool maybe_add_required_filter(grpc_channel_stack_builder* builder,
void grpc_http_filters_init(void) {
grpc_channel_init_register_stage(
GRPC_CLIENT_SUBCHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
- maybe_add_optional_filter<false>, &compress_filter);
- grpc_channel_init_register_stage(
- GRPC_CLIENT_DIRECT_CHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
- maybe_add_optional_filter<false>, &compress_filter);
- grpc_channel_init_register_stage(
- GRPC_SERVER_CHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
- maybe_add_optional_filter<false>, &compress_filter);
- grpc_channel_init_register_stage(
- GRPC_CLIENT_SUBCHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
- maybe_add_optional_filter<true>, &decompress_filter);
- grpc_channel_init_register_stage(
- GRPC_CLIENT_DIRECT_CHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
- maybe_add_optional_filter<true>, &decompress_filter);
- grpc_channel_init_register_stage(
- GRPC_SERVER_CHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
- maybe_add_optional_filter<true>, &decompress_filter);
- grpc_channel_init_register_stage(
- GRPC_CLIENT_SUBCHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
+ maybe_add_optional_filter<false>, &compress_filter);
+ grpc_channel_init_register_stage(
+ GRPC_CLIENT_DIRECT_CHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
+ maybe_add_optional_filter<false>, &compress_filter);
+ grpc_channel_init_register_stage(
+ GRPC_SERVER_CHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
+ maybe_add_optional_filter<false>, &compress_filter);
+ grpc_channel_init_register_stage(
+ GRPC_CLIENT_SUBCHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
+ maybe_add_optional_filter<true>, &decompress_filter);
+ grpc_channel_init_register_stage(
+ GRPC_CLIENT_DIRECT_CHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
+ maybe_add_optional_filter<true>, &decompress_filter);
+ grpc_channel_init_register_stage(
+ GRPC_SERVER_CHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
+ maybe_add_optional_filter<true>, &decompress_filter);
+ grpc_channel_init_register_stage(
+ GRPC_CLIENT_SUBCHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
maybe_add_required_filter, (void*)&grpc_http_client_filter);
grpc_channel_init_register_stage(
GRPC_CLIENT_DIRECT_CHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
diff --git a/contrib/libs/grpc/src/core/ext/filters/http/message_compress/message_compress_filter.cc b/contrib/libs/grpc/src/core/ext/filters/http/message_compress/message_compress_filter.cc
index e36cc0fb660..53f6e2b80de 100644
--- a/contrib/libs/grpc/src/core/ext/filters/http/message_compress/message_compress_filter.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/http/message_compress/message_compress_filter.cc
@@ -21,8 +21,8 @@
#include <assert.h>
#include <string.h>
-#include "y_absl/types/optional.h"
-
+#include "y_absl/types/optional.h"
+
#include <grpc/compression.h>
#include <grpc/slice_buffer.h>
#include <grpc/support/alloc.h>
@@ -44,154 +44,154 @@
namespace {
-class ChannelData {
- public:
- explicit ChannelData(grpc_channel_element_args* args) {
- // Get the enabled and the default algorithms from channel args.
- enabled_compression_algorithms_bitset_ =
- grpc_channel_args_compression_algorithm_get_states(args->channel_args);
- default_compression_algorithm_ =
- grpc_channel_args_get_channel_default_compression_algorithm(
- args->channel_args);
- // Make sure the default is enabled.
- if (!GPR_BITGET(enabled_compression_algorithms_bitset_,
- default_compression_algorithm_)) {
- const char* name;
- GPR_ASSERT(grpc_compression_algorithm_name(default_compression_algorithm_,
- &name) == 1);
- gpr_log(GPR_ERROR,
- "default compression algorithm %s not enabled: switching to none",
- name);
- default_compression_algorithm_ = GRPC_COMPRESS_NONE;
- }
- enabled_message_compression_algorithms_bitset_ =
- grpc_compression_bitset_to_message_bitset(
- enabled_compression_algorithms_bitset_);
- enabled_stream_compression_algorithms_bitset_ =
- grpc_compression_bitset_to_stream_bitset(
- enabled_compression_algorithms_bitset_);
- GPR_ASSERT(!args->is_last);
- }
-
- grpc_compression_algorithm default_compression_algorithm() const {
- return default_compression_algorithm_;
- }
-
- uint32_t enabled_compression_algorithms_bitset() const {
- return enabled_compression_algorithms_bitset_;
- }
-
- uint32_t enabled_message_compression_algorithms_bitset() const {
- return enabled_message_compression_algorithms_bitset_;
- }
-
- uint32_t enabled_stream_compression_algorithms_bitset() const {
- return enabled_stream_compression_algorithms_bitset_;
- }
-
- private:
+class ChannelData {
+ public:
+ explicit ChannelData(grpc_channel_element_args* args) {
+ // Get the enabled and the default algorithms from channel args.
+ enabled_compression_algorithms_bitset_ =
+ grpc_channel_args_compression_algorithm_get_states(args->channel_args);
+ default_compression_algorithm_ =
+ grpc_channel_args_get_channel_default_compression_algorithm(
+ args->channel_args);
+ // Make sure the default is enabled.
+ if (!GPR_BITGET(enabled_compression_algorithms_bitset_,
+ default_compression_algorithm_)) {
+ const char* name;
+ GPR_ASSERT(grpc_compression_algorithm_name(default_compression_algorithm_,
+ &name) == 1);
+ gpr_log(GPR_ERROR,
+ "default compression algorithm %s not enabled: switching to none",
+ name);
+ default_compression_algorithm_ = GRPC_COMPRESS_NONE;
+ }
+ enabled_message_compression_algorithms_bitset_ =
+ grpc_compression_bitset_to_message_bitset(
+ enabled_compression_algorithms_bitset_);
+ enabled_stream_compression_algorithms_bitset_ =
+ grpc_compression_bitset_to_stream_bitset(
+ enabled_compression_algorithms_bitset_);
+ GPR_ASSERT(!args->is_last);
+ }
+
+ grpc_compression_algorithm default_compression_algorithm() const {
+ return default_compression_algorithm_;
+ }
+
+ uint32_t enabled_compression_algorithms_bitset() const {
+ return enabled_compression_algorithms_bitset_;
+ }
+
+ uint32_t enabled_message_compression_algorithms_bitset() const {
+ return enabled_message_compression_algorithms_bitset_;
+ }
+
+ uint32_t enabled_stream_compression_algorithms_bitset() const {
+ return enabled_stream_compression_algorithms_bitset_;
+ }
+
+ private:
/** The default, channel-level, compression algorithm */
- grpc_compression_algorithm default_compression_algorithm_;
+ grpc_compression_algorithm default_compression_algorithm_;
/** Bitset of enabled compression algorithms */
- uint32_t enabled_compression_algorithms_bitset_;
+ uint32_t enabled_compression_algorithms_bitset_;
/** Bitset of enabled message compression algorithms */
- uint32_t enabled_message_compression_algorithms_bitset_;
+ uint32_t enabled_message_compression_algorithms_bitset_;
/** Bitset of enabled stream compression algorithms */
- uint32_t enabled_stream_compression_algorithms_bitset_;
+ uint32_t enabled_stream_compression_algorithms_bitset_;
};
-class CallData {
- public:
- CallData(grpc_call_element* elem, const grpc_call_element_args& args)
- : call_combiner_(args.call_combiner) {
- ChannelData* channeld = static_cast<ChannelData*>(elem->channel_data);
+class CallData {
+ public:
+ CallData(grpc_call_element* elem, const grpc_call_element_args& args)
+ : call_combiner_(args.call_combiner) {
+ ChannelData* channeld = static_cast<ChannelData*>(elem->channel_data);
// The call's message compression algorithm is set to channel's default
// setting. It can be overridden later by initial metadata.
- if (GPR_LIKELY(GPR_BITGET(channeld->enabled_compression_algorithms_bitset(),
- channeld->default_compression_algorithm()))) {
- message_compression_algorithm_ =
+ if (GPR_LIKELY(GPR_BITGET(channeld->enabled_compression_algorithms_bitset(),
+ channeld->default_compression_algorithm()))) {
+ message_compression_algorithm_ =
grpc_compression_algorithm_to_message_compression_algorithm(
- channeld->default_compression_algorithm());
+ channeld->default_compression_algorithm());
}
- GRPC_CLOSURE_INIT(&start_send_message_batch_in_call_combiner_,
- StartSendMessageBatch, elem, grpc_schedule_on_exec_ctx);
+ GRPC_CLOSURE_INIT(&start_send_message_batch_in_call_combiner_,
+ StartSendMessageBatch, elem, grpc_schedule_on_exec_ctx);
}
- ~CallData() {
- if (state_initialized_) {
- grpc_slice_buffer_destroy_internal(&slices_);
+ ~CallData() {
+ if (state_initialized_) {
+ grpc_slice_buffer_destroy_internal(&slices_);
}
- GRPC_ERROR_UNREF(cancel_error_);
+ GRPC_ERROR_UNREF(cancel_error_);
}
- void CompressStartTransportStreamOpBatch(
- grpc_call_element* elem, grpc_transport_stream_op_batch* batch);
-
- private:
- bool SkipMessageCompression();
- void InitializeState(grpc_call_element* elem);
-
- grpc_error* ProcessSendInitialMetadata(grpc_call_element* elem,
- grpc_metadata_batch* initial_metadata);
-
- // Methods for processing a send_message batch
- static void StartSendMessageBatch(void* elem_arg, grpc_error* unused);
- static void OnSendMessageNextDone(void* elem_arg, grpc_error* error);
- grpc_error* PullSliceFromSendMessage();
- void ContinueReadingSendMessage(grpc_call_element* elem);
- void FinishSendMessage(grpc_call_element* elem);
- void SendMessageBatchContinue(grpc_call_element* elem);
- static void FailSendMessageBatchInCallCombiner(void* calld_arg,
- grpc_error* error);
-
- static void SendMessageOnComplete(void* calld_arg, grpc_error* error);
-
- grpc_core::CallCombiner* call_combiner_;
- grpc_message_compression_algorithm message_compression_algorithm_ =
+ void CompressStartTransportStreamOpBatch(
+ grpc_call_element* elem, grpc_transport_stream_op_batch* batch);
+
+ private:
+ bool SkipMessageCompression();
+ void InitializeState(grpc_call_element* elem);
+
+ grpc_error* ProcessSendInitialMetadata(grpc_call_element* elem,
+ grpc_metadata_batch* initial_metadata);
+
+ // Methods for processing a send_message batch
+ static void StartSendMessageBatch(void* elem_arg, grpc_error* unused);
+ static void OnSendMessageNextDone(void* elem_arg, grpc_error* error);
+ grpc_error* PullSliceFromSendMessage();
+ void ContinueReadingSendMessage(grpc_call_element* elem);
+ void FinishSendMessage(grpc_call_element* elem);
+ void SendMessageBatchContinue(grpc_call_element* elem);
+ static void FailSendMessageBatchInCallCombiner(void* calld_arg,
+ grpc_error* error);
+
+ static void SendMessageOnComplete(void* calld_arg, grpc_error* error);
+
+ grpc_core::CallCombiner* call_combiner_;
+ grpc_message_compression_algorithm message_compression_algorithm_ =
GRPC_MESSAGE_COMPRESS_NONE;
- grpc_error* cancel_error_ = GRPC_ERROR_NONE;
- grpc_transport_stream_op_batch* send_message_batch_ = nullptr;
- bool seen_initial_metadata_ = false;
+ grpc_error* cancel_error_ = GRPC_ERROR_NONE;
+ grpc_transport_stream_op_batch* send_message_batch_ = nullptr;
+ bool seen_initial_metadata_ = false;
/* Set to true, if the fields below are initialized. */
- bool state_initialized_ = false;
- grpc_closure start_send_message_batch_in_call_combiner_;
+ bool state_initialized_ = false;
+ grpc_closure start_send_message_batch_in_call_combiner_;
/* The fields below are only initialized when we compress the payload.
* Keep them at the bottom of the struct, so they don't pollute the
* cache-lines. */
- grpc_linked_mdelem message_compression_algorithm_storage_;
- grpc_linked_mdelem stream_compression_algorithm_storage_;
- grpc_linked_mdelem accept_encoding_storage_;
- grpc_linked_mdelem accept_stream_encoding_storage_;
- grpc_slice_buffer slices_; /**< Buffers up input slices to be compressed */
- // Allocate space for the replacement stream
- std::aligned_storage<sizeof(grpc_core::SliceBufferByteStream),
- alignof(grpc_core::SliceBufferByteStream)>::type
- replacement_stream_;
- grpc_closure* original_send_message_on_complete_ = nullptr;
- grpc_closure send_message_on_complete_;
- grpc_closure on_send_message_next_done_;
+ grpc_linked_mdelem message_compression_algorithm_storage_;
+ grpc_linked_mdelem stream_compression_algorithm_storage_;
+ grpc_linked_mdelem accept_encoding_storage_;
+ grpc_linked_mdelem accept_stream_encoding_storage_;
+ grpc_slice_buffer slices_; /**< Buffers up input slices to be compressed */
+ // Allocate space for the replacement stream
+ std::aligned_storage<sizeof(grpc_core::SliceBufferByteStream),
+ alignof(grpc_core::SliceBufferByteStream)>::type
+ replacement_stream_;
+ grpc_closure* original_send_message_on_complete_ = nullptr;
+ grpc_closure send_message_on_complete_;
+ grpc_closure on_send_message_next_done_;
};
// Returns true if we should skip message compression for the current message.
-bool CallData::SkipMessageCompression() {
+bool CallData::SkipMessageCompression() {
// If the flags of this message indicate that it shouldn't be compressed, we
// skip message compression.
uint32_t flags =
- send_message_batch_->payload->send_message.send_message->flags();
+ send_message_batch_->payload->send_message.send_message->flags();
if (flags & (GRPC_WRITE_NO_COMPRESS | GRPC_WRITE_INTERNAL_COMPRESS)) {
return true;
}
// If this call doesn't have any message compression algorithm set, skip
// message compression.
- return message_compression_algorithm_ == GRPC_MESSAGE_COMPRESS_NONE;
+ return message_compression_algorithm_ == GRPC_MESSAGE_COMPRESS_NONE;
}
// Determines the compression algorithm from the initial metadata and the
// channel's default setting.
-grpc_compression_algorithm FindCompressionAlgorithm(
- grpc_metadata_batch* initial_metadata, ChannelData* channeld) {
+grpc_compression_algorithm FindCompressionAlgorithm(
+ grpc_metadata_batch* initial_metadata, ChannelData* channeld) {
if (initial_metadata->idx.named.grpc_internal_encoding_request == nullptr) {
- return channeld->default_compression_algorithm();
+ return channeld->default_compression_algorithm();
}
grpc_compression_algorithm compression_algorithm;
// Parse the compression algorithm from the initial metadata.
@@ -207,7 +207,7 @@ grpc_compression_algorithm FindCompressionAlgorithm(
// enabled.
// TODO(juanlishen): Maybe use channel default or abort() if the algorithm
// from the initial metadata is disabled.
- if (GPR_LIKELY(GPR_BITGET(channeld->enabled_compression_algorithms_bitset(),
+ if (GPR_LIKELY(GPR_BITGET(channeld->enabled_compression_algorithms_bitset(),
compression_algorithm))) {
return compression_algorithm;
}
@@ -222,24 +222,24 @@ grpc_compression_algorithm FindCompressionAlgorithm(
return GRPC_COMPRESS_NONE;
}
-void CallData::InitializeState(grpc_call_element* elem) {
- GPR_DEBUG_ASSERT(!state_initialized_);
- state_initialized_ = true;
- grpc_slice_buffer_init(&slices_);
- GRPC_CLOSURE_INIT(&send_message_on_complete_, SendMessageOnComplete, this,
+void CallData::InitializeState(grpc_call_element* elem) {
+ GPR_DEBUG_ASSERT(!state_initialized_);
+ state_initialized_ = true;
+ grpc_slice_buffer_init(&slices_);
+ GRPC_CLOSURE_INIT(&send_message_on_complete_, SendMessageOnComplete, this,
grpc_schedule_on_exec_ctx);
- GRPC_CLOSURE_INIT(&on_send_message_next_done_, OnSendMessageNextDone, elem,
+ GRPC_CLOSURE_INIT(&on_send_message_next_done_, OnSendMessageNextDone, elem,
grpc_schedule_on_exec_ctx);
}
-grpc_error* CallData::ProcessSendInitialMetadata(
+grpc_error* CallData::ProcessSendInitialMetadata(
grpc_call_element* elem, grpc_metadata_batch* initial_metadata) {
- ChannelData* channeld = static_cast<ChannelData*>(elem->channel_data);
+ ChannelData* channeld = static_cast<ChannelData*>(elem->channel_data);
// Find the compression algorithm.
grpc_compression_algorithm compression_algorithm =
- FindCompressionAlgorithm(initial_metadata, channeld);
+ FindCompressionAlgorithm(initial_metadata, channeld);
// Note that at most one of the following algorithms can be set.
- message_compression_algorithm_ =
+ message_compression_algorithm_ =
grpc_compression_algorithm_to_message_compression_algorithm(
compression_algorithm);
grpc_stream_compression_algorithm stream_compression_algorithm =
@@ -247,300 +247,300 @@ grpc_error* CallData::ProcessSendInitialMetadata(
compression_algorithm);
// Hint compression algorithm.
grpc_error* error = GRPC_ERROR_NONE;
- if (message_compression_algorithm_ != GRPC_MESSAGE_COMPRESS_NONE) {
- InitializeState(elem);
+ if (message_compression_algorithm_ != GRPC_MESSAGE_COMPRESS_NONE) {
+ InitializeState(elem);
error = grpc_metadata_batch_add_tail(
- initial_metadata, &message_compression_algorithm_storage_,
+ initial_metadata, &message_compression_algorithm_storage_,
grpc_message_compression_encoding_mdelem(
- message_compression_algorithm_),
+ message_compression_algorithm_),
GRPC_BATCH_GRPC_ENCODING);
} else if (stream_compression_algorithm != GRPC_STREAM_COMPRESS_NONE) {
- InitializeState(elem);
+ InitializeState(elem);
error = grpc_metadata_batch_add_tail(
- initial_metadata, &stream_compression_algorithm_storage_,
+ initial_metadata, &stream_compression_algorithm_storage_,
grpc_stream_compression_encoding_mdelem(stream_compression_algorithm),
GRPC_BATCH_CONTENT_ENCODING);
}
if (error != GRPC_ERROR_NONE) return error;
// Convey supported compression algorithms.
error = grpc_metadata_batch_add_tail(
- initial_metadata, &accept_encoding_storage_,
+ initial_metadata, &accept_encoding_storage_,
GRPC_MDELEM_ACCEPT_ENCODING_FOR_ALGORITHMS(
- channeld->enabled_message_compression_algorithms_bitset()),
+ channeld->enabled_message_compression_algorithms_bitset()),
GRPC_BATCH_GRPC_ACCEPT_ENCODING);
if (error != GRPC_ERROR_NONE) return error;
// Do not overwrite accept-encoding header if it already presents (e.g., added
// by some proxy).
if (!initial_metadata->idx.named.accept_encoding) {
error = grpc_metadata_batch_add_tail(
- initial_metadata, &accept_stream_encoding_storage_,
+ initial_metadata, &accept_stream_encoding_storage_,
GRPC_MDELEM_ACCEPT_STREAM_ENCODING_FOR_ALGORITHMS(
- channeld->enabled_stream_compression_algorithms_bitset()),
+ channeld->enabled_stream_compression_algorithms_bitset()),
GRPC_BATCH_ACCEPT_ENCODING);
}
return error;
}
-void CallData::SendMessageOnComplete(void* calld_arg, grpc_error* error) {
- CallData* calld = static_cast<CallData*>(calld_arg);
- grpc_slice_buffer_reset_and_unref_internal(&calld->slices_);
+void CallData::SendMessageOnComplete(void* calld_arg, grpc_error* error) {
+ CallData* calld = static_cast<CallData*>(calld_arg);
+ grpc_slice_buffer_reset_and_unref_internal(&calld->slices_);
grpc_core::Closure::Run(DEBUG_LOCATION,
- calld->original_send_message_on_complete_,
+ calld->original_send_message_on_complete_,
GRPC_ERROR_REF(error));
}
-void CallData::SendMessageBatchContinue(grpc_call_element* elem) {
+void CallData::SendMessageBatchContinue(grpc_call_element* elem) {
// Note: The call to grpc_call_next_op() results in yielding the
- // call combiner, so we need to clear send_message_batch_ before we do that.
- grpc_transport_stream_op_batch* send_message_batch = send_message_batch_;
- send_message_batch_ = nullptr;
+ // call combiner, so we need to clear send_message_batch_ before we do that.
+ grpc_transport_stream_op_batch* send_message_batch = send_message_batch_;
+ send_message_batch_ = nullptr;
grpc_call_next_op(elem, send_message_batch);
}
-void CallData::FinishSendMessage(grpc_call_element* elem) {
- GPR_DEBUG_ASSERT(message_compression_algorithm_ !=
+void CallData::FinishSendMessage(grpc_call_element* elem) {
+ GPR_DEBUG_ASSERT(message_compression_algorithm_ !=
GRPC_MESSAGE_COMPRESS_NONE);
// Compress the data if appropriate.
grpc_slice_buffer tmp;
grpc_slice_buffer_init(&tmp);
uint32_t send_flags =
- send_message_batch_->payload->send_message.send_message->flags();
- bool did_compress =
- grpc_msg_compress(message_compression_algorithm_, &slices_, &tmp);
+ send_message_batch_->payload->send_message.send_message->flags();
+ bool did_compress =
+ grpc_msg_compress(message_compression_algorithm_, &slices_, &tmp);
if (did_compress) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_compression_trace)) {
const char* algo_name;
- const size_t before_size = slices_.length;
+ const size_t before_size = slices_.length;
const size_t after_size = tmp.length;
const float savings_ratio = 1.0f - static_cast<float>(after_size) /
static_cast<float>(before_size);
GPR_ASSERT(grpc_message_compression_algorithm_name(
- message_compression_algorithm_, &algo_name));
+ message_compression_algorithm_, &algo_name));
gpr_log(GPR_INFO,
"Compressed[%s] %" PRIuPTR " bytes vs. %" PRIuPTR
" bytes (%.2f%% savings)",
algo_name, before_size, after_size, 100 * savings_ratio);
}
- grpc_slice_buffer_swap(&slices_, &tmp);
+ grpc_slice_buffer_swap(&slices_, &tmp);
send_flags |= GRPC_WRITE_INTERNAL_COMPRESS;
} else {
if (GRPC_TRACE_FLAG_ENABLED(grpc_compression_trace)) {
const char* algo_name;
GPR_ASSERT(grpc_message_compression_algorithm_name(
- message_compression_algorithm_, &algo_name));
+ message_compression_algorithm_, &algo_name));
gpr_log(GPR_INFO,
"Algorithm '%s' enabled but decided not to compress. Input size: "
"%" PRIuPTR,
- algo_name, slices_.length);
+ algo_name, slices_.length);
}
}
grpc_slice_buffer_destroy_internal(&tmp);
// Swap out the original byte stream with our new one and send the
// batch down.
- new (&replacement_stream_)
- grpc_core::SliceBufferByteStream(&slices_, send_flags);
- send_message_batch_->payload->send_message.send_message.reset(
- reinterpret_cast<grpc_core::SliceBufferByteStream*>(
- &replacement_stream_));
- original_send_message_on_complete_ = send_message_batch_->on_complete;
- send_message_batch_->on_complete = &send_message_on_complete_;
- SendMessageBatchContinue(elem);
+ new (&replacement_stream_)
+ grpc_core::SliceBufferByteStream(&slices_, send_flags);
+ send_message_batch_->payload->send_message.send_message.reset(
+ reinterpret_cast<grpc_core::SliceBufferByteStream*>(
+ &replacement_stream_));
+ original_send_message_on_complete_ = send_message_batch_->on_complete;
+ send_message_batch_->on_complete = &send_message_on_complete_;
+ SendMessageBatchContinue(elem);
}
-void CallData::FailSendMessageBatchInCallCombiner(void* calld_arg,
- grpc_error* error) {
- CallData* calld = static_cast<CallData*>(calld_arg);
- if (calld->send_message_batch_ != nullptr) {
+void CallData::FailSendMessageBatchInCallCombiner(void* calld_arg,
+ grpc_error* error) {
+ CallData* calld = static_cast<CallData*>(calld_arg);
+ if (calld->send_message_batch_ != nullptr) {
grpc_transport_stream_op_batch_finish_with_failure(
- calld->send_message_batch_, GRPC_ERROR_REF(error),
- calld->call_combiner_);
- calld->send_message_batch_ = nullptr;
+ calld->send_message_batch_, GRPC_ERROR_REF(error),
+ calld->call_combiner_);
+ calld->send_message_batch_ = nullptr;
}
}
-// Pulls a slice from the send_message byte stream and adds it to slices_.
-grpc_error* CallData::PullSliceFromSendMessage() {
+// Pulls a slice from the send_message byte stream and adds it to slices_.
+grpc_error* CallData::PullSliceFromSendMessage() {
grpc_slice incoming_slice;
grpc_error* error =
- send_message_batch_->payload->send_message.send_message->Pull(
+ send_message_batch_->payload->send_message.send_message->Pull(
&incoming_slice);
if (error == GRPC_ERROR_NONE) {
- grpc_slice_buffer_add(&slices_, incoming_slice);
+ grpc_slice_buffer_add(&slices_, incoming_slice);
}
return error;
}
// Reads as many slices as possible from the send_message byte stream.
-// If all data has been read, invokes FinishSendMessage(). Otherwise,
+// If all data has been read, invokes FinishSendMessage(). Otherwise,
// an async call to ByteStream::Next() has been started, which will
-// eventually result in calling OnSendMessageNextDone().
-void CallData::ContinueReadingSendMessage(grpc_call_element* elem) {
- if (slices_.length ==
- send_message_batch_->payload->send_message.send_message->length()) {
- FinishSendMessage(elem);
+// eventually result in calling OnSendMessageNextDone().
+void CallData::ContinueReadingSendMessage(grpc_call_element* elem) {
+ if (slices_.length ==
+ send_message_batch_->payload->send_message.send_message->length()) {
+ FinishSendMessage(elem);
return;
}
- while (send_message_batch_->payload->send_message.send_message->Next(
- ~static_cast<size_t>(0), &on_send_message_next_done_)) {
- grpc_error* error = PullSliceFromSendMessage();
+ while (send_message_batch_->payload->send_message.send_message->Next(
+ ~static_cast<size_t>(0), &on_send_message_next_done_)) {
+ grpc_error* error = PullSliceFromSendMessage();
if (error != GRPC_ERROR_NONE) {
// Closure callback; does not take ownership of error.
- FailSendMessageBatchInCallCombiner(this, error);
+ FailSendMessageBatchInCallCombiner(this, error);
GRPC_ERROR_UNREF(error);
return;
}
- if (slices_.length ==
- send_message_batch_->payload->send_message.send_message->length()) {
- FinishSendMessage(elem);
+ if (slices_.length ==
+ send_message_batch_->payload->send_message.send_message->length()) {
+ FinishSendMessage(elem);
break;
}
}
}
// Async callback for ByteStream::Next().
-void CallData::OnSendMessageNextDone(void* elem_arg, grpc_error* error) {
- grpc_call_element* elem = static_cast<grpc_call_element*>(elem_arg);
- CallData* calld = static_cast<CallData*>(elem->call_data);
+void CallData::OnSendMessageNextDone(void* elem_arg, grpc_error* error) {
+ grpc_call_element* elem = static_cast<grpc_call_element*>(elem_arg);
+ CallData* calld = static_cast<CallData*>(elem->call_data);
if (error != GRPC_ERROR_NONE) {
// Closure callback; does not take ownership of error.
- FailSendMessageBatchInCallCombiner(calld, error);
+ FailSendMessageBatchInCallCombiner(calld, error);
return;
}
- error = calld->PullSliceFromSendMessage();
+ error = calld->PullSliceFromSendMessage();
if (error != GRPC_ERROR_NONE) {
// Closure callback; does not take ownership of error.
- FailSendMessageBatchInCallCombiner(calld, error);
+ FailSendMessageBatchInCallCombiner(calld, error);
GRPC_ERROR_UNREF(error);
return;
}
- if (calld->slices_.length == calld->send_message_batch_->payload->send_message
- .send_message->length()) {
- calld->FinishSendMessage(elem);
+ if (calld->slices_.length == calld->send_message_batch_->payload->send_message
+ .send_message->length()) {
+ calld->FinishSendMessage(elem);
} else {
- calld->ContinueReadingSendMessage(elem);
+ calld->ContinueReadingSendMessage(elem);
}
}
-void CallData::StartSendMessageBatch(void* elem_arg, grpc_error* /*unused*/) {
- grpc_call_element* elem = static_cast<grpc_call_element*>(elem_arg);
- CallData* calld = static_cast<CallData*>(elem->call_data);
- if (calld->SkipMessageCompression()) {
- calld->SendMessageBatchContinue(elem);
+void CallData::StartSendMessageBatch(void* elem_arg, grpc_error* /*unused*/) {
+ grpc_call_element* elem = static_cast<grpc_call_element*>(elem_arg);
+ CallData* calld = static_cast<CallData*>(elem->call_data);
+ if (calld->SkipMessageCompression()) {
+ calld->SendMessageBatchContinue(elem);
} else {
- calld->ContinueReadingSendMessage(elem);
+ calld->ContinueReadingSendMessage(elem);
}
}
-void CallData::CompressStartTransportStreamOpBatch(
+void CallData::CompressStartTransportStreamOpBatch(
grpc_call_element* elem, grpc_transport_stream_op_batch* batch) {
GPR_TIMER_SCOPE("compress_start_transport_stream_op_batch", 0);
// Handle cancel_stream.
if (batch->cancel_stream) {
- GRPC_ERROR_UNREF(cancel_error_);
- cancel_error_ = GRPC_ERROR_REF(batch->payload->cancel_stream.cancel_error);
- if (send_message_batch_ != nullptr) {
- if (!seen_initial_metadata_) {
+ GRPC_ERROR_UNREF(cancel_error_);
+ cancel_error_ = GRPC_ERROR_REF(batch->payload->cancel_stream.cancel_error);
+ if (send_message_batch_ != nullptr) {
+ if (!seen_initial_metadata_) {
GRPC_CALL_COMBINER_START(
- call_combiner_,
- GRPC_CLOSURE_CREATE(FailSendMessageBatchInCallCombiner, this,
+ call_combiner_,
+ GRPC_CLOSURE_CREATE(FailSendMessageBatchInCallCombiner, this,
grpc_schedule_on_exec_ctx),
- GRPC_ERROR_REF(cancel_error_), "failing send_message op");
+ GRPC_ERROR_REF(cancel_error_), "failing send_message op");
} else {
- send_message_batch_->payload->send_message.send_message->Shutdown(
- GRPC_ERROR_REF(cancel_error_));
+ send_message_batch_->payload->send_message.send_message->Shutdown(
+ GRPC_ERROR_REF(cancel_error_));
}
}
- } else if (cancel_error_ != GRPC_ERROR_NONE) {
+ } else if (cancel_error_ != GRPC_ERROR_NONE) {
grpc_transport_stream_op_batch_finish_with_failure(
- batch, GRPC_ERROR_REF(cancel_error_), call_combiner_);
+ batch, GRPC_ERROR_REF(cancel_error_), call_combiner_);
return;
}
// Handle send_initial_metadata.
if (batch->send_initial_metadata) {
- GPR_ASSERT(!seen_initial_metadata_);
- grpc_error* error = ProcessSendInitialMetadata(
+ GPR_ASSERT(!seen_initial_metadata_);
+ grpc_error* error = ProcessSendInitialMetadata(
elem, batch->payload->send_initial_metadata.send_initial_metadata);
if (error != GRPC_ERROR_NONE) {
grpc_transport_stream_op_batch_finish_with_failure(batch, error,
- call_combiner_);
+ call_combiner_);
return;
}
- seen_initial_metadata_ = true;
+ seen_initial_metadata_ = true;
// If we had previously received a batch containing a send_message op,
// handle it now. Note that we need to re-enter the call combiner
// for this, since we can't send two batches down while holding the
// call combiner, since the connected_channel filter (at the bottom of
// the call stack) will release the call combiner for each batch it sees.
- if (send_message_batch_ != nullptr) {
+ if (send_message_batch_ != nullptr) {
GRPC_CALL_COMBINER_START(
- call_combiner_, &start_send_message_batch_in_call_combiner_,
- GRPC_ERROR_NONE, "starting send_message after send_initial_metadata");
+ call_combiner_, &start_send_message_batch_in_call_combiner_,
+ GRPC_ERROR_NONE, "starting send_message after send_initial_metadata");
}
}
// Handle send_message.
if (batch->send_message) {
- GPR_ASSERT(send_message_batch_ == nullptr);
- send_message_batch_ = batch;
+ GPR_ASSERT(send_message_batch_ == nullptr);
+ send_message_batch_ = batch;
// If we have not yet seen send_initial_metadata, then we have to
- // wait. We save the batch and then drop the call combiner, which we'll
- // have to pick up again later when we get send_initial_metadata.
- if (!seen_initial_metadata_) {
+ // wait. We save the batch and then drop the call combiner, which we'll
+ // have to pick up again later when we get send_initial_metadata.
+ if (!seen_initial_metadata_) {
GRPC_CALL_COMBINER_STOP(
- call_combiner_, "send_message batch pending send_initial_metadata");
+ call_combiner_, "send_message batch pending send_initial_metadata");
return;
}
- StartSendMessageBatch(elem, GRPC_ERROR_NONE);
+ StartSendMessageBatch(elem, GRPC_ERROR_NONE);
} else {
// Pass control down the stack.
grpc_call_next_op(elem, batch);
}
}
-void CompressStartTransportStreamOpBatch(
- grpc_call_element* elem, grpc_transport_stream_op_batch* batch) {
- CallData* calld = static_cast<CallData*>(elem->call_data);
- calld->CompressStartTransportStreamOpBatch(elem, batch);
-}
-
+void CompressStartTransportStreamOpBatch(
+ grpc_call_element* elem, grpc_transport_stream_op_batch* batch) {
+ CallData* calld = static_cast<CallData*>(elem->call_data);
+ calld->CompressStartTransportStreamOpBatch(elem, batch);
+}
+
/* Constructor for call_data */
-grpc_error* CompressInitCallElem(grpc_call_element* elem,
- const grpc_call_element_args* args) {
- new (elem->call_data) CallData(elem, *args);
+grpc_error* CompressInitCallElem(grpc_call_element* elem,
+ const grpc_call_element_args* args) {
+ new (elem->call_data) CallData(elem, *args);
return GRPC_ERROR_NONE;
}
/* Destructor for call_data */
-void CompressDestroyCallElem(grpc_call_element* elem,
- const grpc_call_final_info* /*final_info*/,
- grpc_closure* /*ignored*/) {
- CallData* calld = static_cast<CallData*>(elem->call_data);
- calld->~CallData();
+void CompressDestroyCallElem(grpc_call_element* elem,
+ const grpc_call_final_info* /*final_info*/,
+ grpc_closure* /*ignored*/) {
+ CallData* calld = static_cast<CallData*>(elem->call_data);
+ calld->~CallData();
}
-/* Constructor for ChannelData */
-grpc_error* CompressInitChannelElem(grpc_channel_element* elem,
- grpc_channel_element_args* args) {
- new (elem->channel_data) ChannelData(args);
+/* Constructor for ChannelData */
+grpc_error* CompressInitChannelElem(grpc_channel_element* elem,
+ grpc_channel_element_args* args) {
+ new (elem->channel_data) ChannelData(args);
return GRPC_ERROR_NONE;
}
/* Destructor for channel data */
-void CompressDestroyChannelElem(grpc_channel_element* elem) {
- ChannelData* channeld = static_cast<ChannelData*>(elem->channel_data);
- channeld->~ChannelData();
-}
+void CompressDestroyChannelElem(grpc_channel_element* elem) {
+ ChannelData* channeld = static_cast<ChannelData*>(elem->channel_data);
+ channeld->~ChannelData();
+}
+
+} // namespace
-} // namespace
-
const grpc_channel_filter grpc_message_compress_filter = {
- CompressStartTransportStreamOpBatch,
+ CompressStartTransportStreamOpBatch,
grpc_channel_next_op,
- sizeof(CallData),
- CompressInitCallElem,
+ sizeof(CallData),
+ CompressInitCallElem,
grpc_call_stack_ignore_set_pollset_or_pollset_set,
- CompressDestroyCallElem,
- sizeof(ChannelData),
- CompressInitChannelElem,
- CompressDestroyChannelElem,
+ CompressDestroyCallElem,
+ sizeof(ChannelData),
+ CompressInitChannelElem,
+ CompressDestroyChannelElem,
grpc_channel_next_get_info,
"message_compress"};
diff --git a/contrib/libs/grpc/src/core/ext/filters/http/message_compress/message_decompress_filter.cc b/contrib/libs/grpc/src/core/ext/filters/http/message_compress/message_decompress_filter.cc
index 8ba458762fe..93fbe5db8e8 100644
--- a/contrib/libs/grpc/src/core/ext/filters/http/message_compress/message_decompress_filter.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/http/message_compress/message_decompress_filter.cc
@@ -1,399 +1,399 @@
-//
-//
-// Copyright 2020 gRPC authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//
-
-#include <grpc/support/port_platform.h>
-
-#include "src/core/ext/filters/http/message_compress/message_decompress_filter.h"
-
-#include <assert.h>
-#include <string.h>
-
-#include "y_absl/strings/str_cat.h"
-
-#include <grpc/compression.h>
-#include <grpc/slice_buffer.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-
-#include "y_absl/strings/str_format.h"
-#include "src/core/ext/filters/message_size/message_size_filter.h"
-#include "src/core/lib/channel/channel_args.h"
-#include "src/core/lib/compression/algorithm_metadata.h"
-#include "src/core/lib/compression/compression_args.h"
-#include "src/core/lib/compression/compression_internal.h"
-#include "src/core/lib/compression/message_compress.h"
-#include "src/core/lib/gpr/string.h"
-#include "src/core/lib/slice/slice_internal.h"
-#include "src/core/lib/slice/slice_string_helpers.h"
-
-namespace grpc_core {
-namespace {
-
-class ChannelData {
- public:
- explicit ChannelData(const grpc_channel_element_args* args)
- : max_recv_size_(GetMaxRecvSizeFromChannelArgs(args->channel_args)) {}
-
- int max_recv_size() const { return max_recv_size_; }
-
- private:
- int max_recv_size_;
-};
-
-class CallData {
- public:
- CallData(const grpc_call_element_args& args, const ChannelData* chand)
- : call_combiner_(args.call_combiner),
- max_recv_message_length_(chand->max_recv_size()) {
- // Initialize state for recv_initial_metadata_ready callback
- GRPC_CLOSURE_INIT(&on_recv_initial_metadata_ready_,
- OnRecvInitialMetadataReady, this,
- grpc_schedule_on_exec_ctx);
- // Initialize state for recv_message_ready callback
- grpc_slice_buffer_init(&recv_slices_);
- GRPC_CLOSURE_INIT(&on_recv_message_next_done_, OnRecvMessageNextDone, this,
- grpc_schedule_on_exec_ctx);
- GRPC_CLOSURE_INIT(&on_recv_message_ready_, OnRecvMessageReady, this,
- grpc_schedule_on_exec_ctx);
- // Initialize state for recv_trailing_metadata_ready callback
- GRPC_CLOSURE_INIT(&on_recv_trailing_metadata_ready_,
- OnRecvTrailingMetadataReady, this,
- grpc_schedule_on_exec_ctx);
- const MessageSizeParsedConfig* limits =
- MessageSizeParsedConfig::GetFromCallContext(args.context);
- if (limits != nullptr && limits->limits().max_recv_size >= 0 &&
- (limits->limits().max_recv_size < max_recv_message_length_ ||
- max_recv_message_length_ < 0)) {
- max_recv_message_length_ = limits->limits().max_recv_size;
- }
- }
-
- ~CallData() { grpc_slice_buffer_destroy_internal(&recv_slices_); }
-
- void DecompressStartTransportStreamOpBatch(
- grpc_call_element* elem, grpc_transport_stream_op_batch* batch);
-
- private:
- static void OnRecvInitialMetadataReady(void* arg, grpc_error* error);
-
- // Methods for processing a receive message event
- void MaybeResumeOnRecvMessageReady();
- static void OnRecvMessageReady(void* arg, grpc_error* error);
- static void OnRecvMessageNextDone(void* arg, grpc_error* error);
- grpc_error* PullSliceFromRecvMessage();
- void ContinueReadingRecvMessage();
- void FinishRecvMessage();
- void ContinueRecvMessageReadyCallback(grpc_error* error);
-
- // Methods for processing a recv_trailing_metadata event
- void MaybeResumeOnRecvTrailingMetadataReady();
- static void OnRecvTrailingMetadataReady(void* arg, grpc_error* error);
-
- CallCombiner* call_combiner_;
- // Overall error for the call
- grpc_error* error_ = GRPC_ERROR_NONE;
- // Fields for handling recv_initial_metadata_ready callback
- grpc_closure on_recv_initial_metadata_ready_;
- grpc_closure* original_recv_initial_metadata_ready_ = nullptr;
- grpc_metadata_batch* recv_initial_metadata_ = nullptr;
- // Fields for handling recv_message_ready callback
- bool seen_recv_message_ready_ = false;
- int max_recv_message_length_;
- grpc_message_compression_algorithm algorithm_ = GRPC_MESSAGE_COMPRESS_NONE;
- grpc_closure on_recv_message_ready_;
- grpc_closure* original_recv_message_ready_ = nullptr;
- grpc_closure on_recv_message_next_done_;
- OrphanablePtr<ByteStream>* recv_message_ = nullptr;
- // recv_slices_ holds the slices read from the original recv_message stream.
- // It is initialized during construction and reset when a new stream is
- // created using it.
- grpc_slice_buffer recv_slices_;
- std::aligned_storage<sizeof(SliceBufferByteStream),
- alignof(SliceBufferByteStream)>::type
- recv_replacement_stream_;
- // Fields for handling recv_trailing_metadata_ready callback
- bool seen_recv_trailing_metadata_ready_ = false;
- grpc_closure on_recv_trailing_metadata_ready_;
- grpc_closure* original_recv_trailing_metadata_ready_ = nullptr;
- grpc_error* on_recv_trailing_metadata_ready_error_ = GRPC_ERROR_NONE;
-};
-
-grpc_message_compression_algorithm DecodeMessageCompressionAlgorithm(
- grpc_mdelem md) {
- grpc_message_compression_algorithm algorithm =
- grpc_message_compression_algorithm_from_slice(GRPC_MDVALUE(md));
- if (algorithm == GRPC_MESSAGE_COMPRESS_ALGORITHMS_COUNT) {
- char* md_c_str = grpc_slice_to_c_string(GRPC_MDVALUE(md));
- gpr_log(GPR_ERROR,
- "Invalid incoming message compression algorithm: '%s'. "
- "Interpreting incoming data as uncompressed.",
- md_c_str);
- gpr_free(md_c_str);
- return GRPC_MESSAGE_COMPRESS_NONE;
- }
- return algorithm;
-}
-
-void CallData::OnRecvInitialMetadataReady(void* arg, grpc_error* error) {
- CallData* calld = static_cast<CallData*>(arg);
- if (error == GRPC_ERROR_NONE) {
- grpc_linked_mdelem* grpc_encoding =
- calld->recv_initial_metadata_->idx.named.grpc_encoding;
- if (grpc_encoding != nullptr) {
- calld->algorithm_ = DecodeMessageCompressionAlgorithm(grpc_encoding->md);
- }
- }
- calld->MaybeResumeOnRecvMessageReady();
- calld->MaybeResumeOnRecvTrailingMetadataReady();
- grpc_closure* closure = calld->original_recv_initial_metadata_ready_;
- calld->original_recv_initial_metadata_ready_ = nullptr;
- Closure::Run(DEBUG_LOCATION, closure, GRPC_ERROR_REF(error));
-}
-
-void CallData::MaybeResumeOnRecvMessageReady() {
- if (seen_recv_message_ready_) {
- seen_recv_message_ready_ = false;
- GRPC_CALL_COMBINER_START(call_combiner_, &on_recv_message_ready_,
- GRPC_ERROR_NONE,
- "continue recv_message_ready callback");
- }
-}
-
-void CallData::OnRecvMessageReady(void* arg, grpc_error* error) {
- CallData* calld = static_cast<CallData*>(arg);
- if (error == GRPC_ERROR_NONE) {
- if (calld->original_recv_initial_metadata_ready_ != nullptr) {
- calld->seen_recv_message_ready_ = true;
- GRPC_CALL_COMBINER_STOP(calld->call_combiner_,
- "Deferring OnRecvMessageReady until after "
- "OnRecvInitialMetadataReady");
- return;
- }
- if (calld->algorithm_ != GRPC_MESSAGE_COMPRESS_NONE) {
- // recv_message can be NULL if trailing metadata is received instead of
- // message, or it's possible that the message was not compressed.
- if (*calld->recv_message_ == nullptr ||
- (*calld->recv_message_)->length() == 0 ||
- ((*calld->recv_message_)->flags() & GRPC_WRITE_INTERNAL_COMPRESS) ==
- 0) {
- return calld->ContinueRecvMessageReadyCallback(GRPC_ERROR_NONE);
- }
- if (calld->max_recv_message_length_ >= 0 &&
- (*calld->recv_message_)->length() >
- static_cast<uint32_t>(calld->max_recv_message_length_)) {
- TString message_string = y_absl::StrFormat(
- "Received message larger than max (%u vs. %d)",
- (*calld->recv_message_)->length(), calld->max_recv_message_length_);
- GPR_DEBUG_ASSERT(calld->error_ == GRPC_ERROR_NONE);
- calld->error_ = grpc_error_set_int(
- GRPC_ERROR_CREATE_FROM_COPIED_STRING(message_string.c_str()),
- GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_RESOURCE_EXHAUSTED);
- return calld->ContinueRecvMessageReadyCallback(
- GRPC_ERROR_REF(calld->error_));
- }
- grpc_slice_buffer_destroy_internal(&calld->recv_slices_);
- grpc_slice_buffer_init(&calld->recv_slices_);
- return calld->ContinueReadingRecvMessage();
- }
- }
- calld->ContinueRecvMessageReadyCallback(GRPC_ERROR_REF(error));
-}
-
-void CallData::ContinueReadingRecvMessage() {
- while ((*recv_message_)
- ->Next((*recv_message_)->length() - recv_slices_.length,
- &on_recv_message_next_done_)) {
- grpc_error* error = PullSliceFromRecvMessage();
- if (error != GRPC_ERROR_NONE) {
- return ContinueRecvMessageReadyCallback(error);
- }
- // We have read the entire message.
- if (recv_slices_.length == (*recv_message_)->length()) {
- return FinishRecvMessage();
- }
- }
-}
-
-grpc_error* CallData::PullSliceFromRecvMessage() {
- grpc_slice incoming_slice;
- grpc_error* error = (*recv_message_)->Pull(&incoming_slice);
- if (error == GRPC_ERROR_NONE) {
- grpc_slice_buffer_add(&recv_slices_, incoming_slice);
- }
- return error;
-}
-
-void CallData::OnRecvMessageNextDone(void* arg, grpc_error* error) {
- CallData* calld = static_cast<CallData*>(arg);
- if (error != GRPC_ERROR_NONE) {
- return calld->ContinueRecvMessageReadyCallback(GRPC_ERROR_REF(error));
- }
- error = calld->PullSliceFromRecvMessage();
- if (error != GRPC_ERROR_NONE) {
- return calld->ContinueRecvMessageReadyCallback(error);
- }
- if (calld->recv_slices_.length == (*calld->recv_message_)->length()) {
- calld->FinishRecvMessage();
- } else {
- calld->ContinueReadingRecvMessage();
- }
-}
-
-void CallData::FinishRecvMessage() {
- grpc_slice_buffer decompressed_slices;
- grpc_slice_buffer_init(&decompressed_slices);
- if (grpc_msg_decompress(algorithm_, &recv_slices_, &decompressed_slices) ==
- 0) {
- GPR_DEBUG_ASSERT(error_ == GRPC_ERROR_NONE);
- error_ = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("Unexpected error decompressing data for algorithm with "
- "enum value ",
- algorithm_)
- .c_str());
- grpc_slice_buffer_destroy_internal(&decompressed_slices);
- } else {
- uint32_t recv_flags =
- ((*recv_message_)->flags() & (~GRPC_WRITE_INTERNAL_COMPRESS)) |
- GRPC_WRITE_INTERNAL_TEST_ONLY_WAS_COMPRESSED;
- // Swap out the original receive byte stream with our new one and send the
- // batch down.
- // Initializing recv_replacement_stream_ with decompressed_slices removes
- // all the slices from decompressed_slices leaving it empty.
- new (&recv_replacement_stream_)
- SliceBufferByteStream(&decompressed_slices, recv_flags);
- recv_message_->reset(
- reinterpret_cast<SliceBufferByteStream*>(&recv_replacement_stream_));
- recv_message_ = nullptr;
- }
- ContinueRecvMessageReadyCallback(GRPC_ERROR_REF(error_));
-}
-
-void CallData::ContinueRecvMessageReadyCallback(grpc_error* error) {
- MaybeResumeOnRecvTrailingMetadataReady();
- // The surface will clean up the receiving stream if there is an error.
- grpc_closure* closure = original_recv_message_ready_;
- original_recv_message_ready_ = nullptr;
- Closure::Run(DEBUG_LOCATION, closure, error);
-}
-
-void CallData::MaybeResumeOnRecvTrailingMetadataReady() {
- if (seen_recv_trailing_metadata_ready_) {
- seen_recv_trailing_metadata_ready_ = false;
- grpc_error* error = on_recv_trailing_metadata_ready_error_;
- on_recv_trailing_metadata_ready_error_ = GRPC_ERROR_NONE;
- GRPC_CALL_COMBINER_START(call_combiner_, &on_recv_trailing_metadata_ready_,
- error, "Continuing OnRecvTrailingMetadataReady");
- }
-}
-
-void CallData::OnRecvTrailingMetadataReady(void* arg, grpc_error* error) {
- CallData* calld = static_cast<CallData*>(arg);
- if (calld->original_recv_initial_metadata_ready_ != nullptr ||
- calld->original_recv_message_ready_ != nullptr) {
- calld->seen_recv_trailing_metadata_ready_ = true;
- calld->on_recv_trailing_metadata_ready_error_ = GRPC_ERROR_REF(error);
- GRPC_CALL_COMBINER_STOP(
- calld->call_combiner_,
- "Deferring OnRecvTrailingMetadataReady until after "
- "OnRecvInitialMetadataReady and OnRecvMessageReady");
- return;
- }
- error = grpc_error_add_child(GRPC_ERROR_REF(error), calld->error_);
- calld->error_ = GRPC_ERROR_NONE;
- grpc_closure* closure = calld->original_recv_trailing_metadata_ready_;
- calld->original_recv_trailing_metadata_ready_ = nullptr;
- Closure::Run(DEBUG_LOCATION, closure, error);
-}
-
-void CallData::DecompressStartTransportStreamOpBatch(
- grpc_call_element* elem, grpc_transport_stream_op_batch* batch) {
- // Handle recv_initial_metadata.
- if (batch->recv_initial_metadata) {
- recv_initial_metadata_ =
- batch->payload->recv_initial_metadata.recv_initial_metadata;
- original_recv_initial_metadata_ready_ =
- batch->payload->recv_initial_metadata.recv_initial_metadata_ready;
- batch->payload->recv_initial_metadata.recv_initial_metadata_ready =
- &on_recv_initial_metadata_ready_;
- }
- // Handle recv_message
- if (batch->recv_message) {
- recv_message_ = batch->payload->recv_message.recv_message;
- original_recv_message_ready_ =
- batch->payload->recv_message.recv_message_ready;
- batch->payload->recv_message.recv_message_ready = &on_recv_message_ready_;
- }
- // Handle recv_trailing_metadata
- if (batch->recv_trailing_metadata) {
- original_recv_trailing_metadata_ready_ =
- batch->payload->recv_trailing_metadata.recv_trailing_metadata_ready;
- batch->payload->recv_trailing_metadata.recv_trailing_metadata_ready =
- &on_recv_trailing_metadata_ready_;
- }
- // Pass control down the stack.
- grpc_call_next_op(elem, batch);
-}
-
-void DecompressStartTransportStreamOpBatch(
- grpc_call_element* elem, grpc_transport_stream_op_batch* batch) {
- GPR_TIMER_SCOPE("decompress_start_transport_stream_op_batch", 0);
- CallData* calld = static_cast<CallData*>(elem->call_data);
- calld->DecompressStartTransportStreamOpBatch(elem, batch);
-}
-
-grpc_error* DecompressInitCallElem(grpc_call_element* elem,
- const grpc_call_element_args* args) {
- ChannelData* chand = static_cast<ChannelData*>(elem->channel_data);
- new (elem->call_data) CallData(*args, chand);
- return GRPC_ERROR_NONE;
-}
-
-void DecompressDestroyCallElem(grpc_call_element* elem,
- const grpc_call_final_info* /*final_info*/,
- grpc_closure* /*ignored*/) {
- CallData* calld = static_cast<CallData*>(elem->call_data);
- calld->~CallData();
-}
-
-grpc_error* DecompressInitChannelElem(grpc_channel_element* elem,
- grpc_channel_element_args* args) {
- ChannelData* chand = static_cast<ChannelData*>(elem->channel_data);
- new (chand) ChannelData(args);
- return GRPC_ERROR_NONE;
-}
-
-void DecompressDestroyChannelElem(grpc_channel_element* elem) {
- ChannelData* chand = static_cast<ChannelData*>(elem->channel_data);
- chand->~ChannelData();
-}
-
-} // namespace
-
-const grpc_channel_filter MessageDecompressFilter = {
- DecompressStartTransportStreamOpBatch,
- grpc_channel_next_op,
- sizeof(CallData),
- DecompressInitCallElem,
- grpc_call_stack_ignore_set_pollset_or_pollset_set,
- DecompressDestroyCallElem,
- sizeof(ChannelData),
- DecompressInitChannelElem,
- DecompressDestroyChannelElem,
- grpc_channel_next_get_info,
- "message_decompress"};
-} // namespace grpc_core
+//
+//
+// Copyright 2020 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+//
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/ext/filters/http/message_compress/message_decompress_filter.h"
+
+#include <assert.h>
+#include <string.h>
+
+#include "y_absl/strings/str_cat.h"
+
+#include <grpc/compression.h>
+#include <grpc/slice_buffer.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+
+#include "y_absl/strings/str_format.h"
+#include "src/core/ext/filters/message_size/message_size_filter.h"
+#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/compression/algorithm_metadata.h"
+#include "src/core/lib/compression/compression_args.h"
+#include "src/core/lib/compression/compression_internal.h"
+#include "src/core/lib/compression/message_compress.h"
+#include "src/core/lib/gpr/string.h"
+#include "src/core/lib/slice/slice_internal.h"
+#include "src/core/lib/slice/slice_string_helpers.h"
+
+namespace grpc_core {
+namespace {
+
+class ChannelData {
+ public:
+ explicit ChannelData(const grpc_channel_element_args* args)
+ : max_recv_size_(GetMaxRecvSizeFromChannelArgs(args->channel_args)) {}
+
+ int max_recv_size() const { return max_recv_size_; }
+
+ private:
+ int max_recv_size_;
+};
+
+class CallData {
+ public:
+ CallData(const grpc_call_element_args& args, const ChannelData* chand)
+ : call_combiner_(args.call_combiner),
+ max_recv_message_length_(chand->max_recv_size()) {
+ // Initialize state for recv_initial_metadata_ready callback
+ GRPC_CLOSURE_INIT(&on_recv_initial_metadata_ready_,
+ OnRecvInitialMetadataReady, this,
+ grpc_schedule_on_exec_ctx);
+ // Initialize state for recv_message_ready callback
+ grpc_slice_buffer_init(&recv_slices_);
+ GRPC_CLOSURE_INIT(&on_recv_message_next_done_, OnRecvMessageNextDone, this,
+ grpc_schedule_on_exec_ctx);
+ GRPC_CLOSURE_INIT(&on_recv_message_ready_, OnRecvMessageReady, this,
+ grpc_schedule_on_exec_ctx);
+ // Initialize state for recv_trailing_metadata_ready callback
+ GRPC_CLOSURE_INIT(&on_recv_trailing_metadata_ready_,
+ OnRecvTrailingMetadataReady, this,
+ grpc_schedule_on_exec_ctx);
+ const MessageSizeParsedConfig* limits =
+ MessageSizeParsedConfig::GetFromCallContext(args.context);
+ if (limits != nullptr && limits->limits().max_recv_size >= 0 &&
+ (limits->limits().max_recv_size < max_recv_message_length_ ||
+ max_recv_message_length_ < 0)) {
+ max_recv_message_length_ = limits->limits().max_recv_size;
+ }
+ }
+
+ ~CallData() { grpc_slice_buffer_destroy_internal(&recv_slices_); }
+
+ void DecompressStartTransportStreamOpBatch(
+ grpc_call_element* elem, grpc_transport_stream_op_batch* batch);
+
+ private:
+ static void OnRecvInitialMetadataReady(void* arg, grpc_error* error);
+
+ // Methods for processing a receive message event
+ void MaybeResumeOnRecvMessageReady();
+ static void OnRecvMessageReady(void* arg, grpc_error* error);
+ static void OnRecvMessageNextDone(void* arg, grpc_error* error);
+ grpc_error* PullSliceFromRecvMessage();
+ void ContinueReadingRecvMessage();
+ void FinishRecvMessage();
+ void ContinueRecvMessageReadyCallback(grpc_error* error);
+
+ // Methods for processing a recv_trailing_metadata event
+ void MaybeResumeOnRecvTrailingMetadataReady();
+ static void OnRecvTrailingMetadataReady(void* arg, grpc_error* error);
+
+ CallCombiner* call_combiner_;
+ // Overall error for the call
+ grpc_error* error_ = GRPC_ERROR_NONE;
+ // Fields for handling recv_initial_metadata_ready callback
+ grpc_closure on_recv_initial_metadata_ready_;
+ grpc_closure* original_recv_initial_metadata_ready_ = nullptr;
+ grpc_metadata_batch* recv_initial_metadata_ = nullptr;
+ // Fields for handling recv_message_ready callback
+ bool seen_recv_message_ready_ = false;
+ int max_recv_message_length_;
+ grpc_message_compression_algorithm algorithm_ = GRPC_MESSAGE_COMPRESS_NONE;
+ grpc_closure on_recv_message_ready_;
+ grpc_closure* original_recv_message_ready_ = nullptr;
+ grpc_closure on_recv_message_next_done_;
+ OrphanablePtr<ByteStream>* recv_message_ = nullptr;
+ // recv_slices_ holds the slices read from the original recv_message stream.
+ // It is initialized during construction and reset when a new stream is
+ // created using it.
+ grpc_slice_buffer recv_slices_;
+ std::aligned_storage<sizeof(SliceBufferByteStream),
+ alignof(SliceBufferByteStream)>::type
+ recv_replacement_stream_;
+ // Fields for handling recv_trailing_metadata_ready callback
+ bool seen_recv_trailing_metadata_ready_ = false;
+ grpc_closure on_recv_trailing_metadata_ready_;
+ grpc_closure* original_recv_trailing_metadata_ready_ = nullptr;
+ grpc_error* on_recv_trailing_metadata_ready_error_ = GRPC_ERROR_NONE;
+};
+
+grpc_message_compression_algorithm DecodeMessageCompressionAlgorithm(
+ grpc_mdelem md) {
+ grpc_message_compression_algorithm algorithm =
+ grpc_message_compression_algorithm_from_slice(GRPC_MDVALUE(md));
+ if (algorithm == GRPC_MESSAGE_COMPRESS_ALGORITHMS_COUNT) {
+ char* md_c_str = grpc_slice_to_c_string(GRPC_MDVALUE(md));
+ gpr_log(GPR_ERROR,
+ "Invalid incoming message compression algorithm: '%s'. "
+ "Interpreting incoming data as uncompressed.",
+ md_c_str);
+ gpr_free(md_c_str);
+ return GRPC_MESSAGE_COMPRESS_NONE;
+ }
+ return algorithm;
+}
+
+void CallData::OnRecvInitialMetadataReady(void* arg, grpc_error* error) {
+ CallData* calld = static_cast<CallData*>(arg);
+ if (error == GRPC_ERROR_NONE) {
+ grpc_linked_mdelem* grpc_encoding =
+ calld->recv_initial_metadata_->idx.named.grpc_encoding;
+ if (grpc_encoding != nullptr) {
+ calld->algorithm_ = DecodeMessageCompressionAlgorithm(grpc_encoding->md);
+ }
+ }
+ calld->MaybeResumeOnRecvMessageReady();
+ calld->MaybeResumeOnRecvTrailingMetadataReady();
+ grpc_closure* closure = calld->original_recv_initial_metadata_ready_;
+ calld->original_recv_initial_metadata_ready_ = nullptr;
+ Closure::Run(DEBUG_LOCATION, closure, GRPC_ERROR_REF(error));
+}
+
+void CallData::MaybeResumeOnRecvMessageReady() {
+ if (seen_recv_message_ready_) {
+ seen_recv_message_ready_ = false;
+ GRPC_CALL_COMBINER_START(call_combiner_, &on_recv_message_ready_,
+ GRPC_ERROR_NONE,
+ "continue recv_message_ready callback");
+ }
+}
+
+void CallData::OnRecvMessageReady(void* arg, grpc_error* error) {
+ CallData* calld = static_cast<CallData*>(arg);
+ if (error == GRPC_ERROR_NONE) {
+ if (calld->original_recv_initial_metadata_ready_ != nullptr) {
+ calld->seen_recv_message_ready_ = true;
+ GRPC_CALL_COMBINER_STOP(calld->call_combiner_,
+ "Deferring OnRecvMessageReady until after "
+ "OnRecvInitialMetadataReady");
+ return;
+ }
+ if (calld->algorithm_ != GRPC_MESSAGE_COMPRESS_NONE) {
+ // recv_message can be NULL if trailing metadata is received instead of
+ // message, or it's possible that the message was not compressed.
+ if (*calld->recv_message_ == nullptr ||
+ (*calld->recv_message_)->length() == 0 ||
+ ((*calld->recv_message_)->flags() & GRPC_WRITE_INTERNAL_COMPRESS) ==
+ 0) {
+ return calld->ContinueRecvMessageReadyCallback(GRPC_ERROR_NONE);
+ }
+ if (calld->max_recv_message_length_ >= 0 &&
+ (*calld->recv_message_)->length() >
+ static_cast<uint32_t>(calld->max_recv_message_length_)) {
+ TString message_string = y_absl::StrFormat(
+ "Received message larger than max (%u vs. %d)",
+ (*calld->recv_message_)->length(), calld->max_recv_message_length_);
+ GPR_DEBUG_ASSERT(calld->error_ == GRPC_ERROR_NONE);
+ calld->error_ = grpc_error_set_int(
+ GRPC_ERROR_CREATE_FROM_COPIED_STRING(message_string.c_str()),
+ GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_RESOURCE_EXHAUSTED);
+ return calld->ContinueRecvMessageReadyCallback(
+ GRPC_ERROR_REF(calld->error_));
+ }
+ grpc_slice_buffer_destroy_internal(&calld->recv_slices_);
+ grpc_slice_buffer_init(&calld->recv_slices_);
+ return calld->ContinueReadingRecvMessage();
+ }
+ }
+ calld->ContinueRecvMessageReadyCallback(GRPC_ERROR_REF(error));
+}
+
+void CallData::ContinueReadingRecvMessage() {
+ while ((*recv_message_)
+ ->Next((*recv_message_)->length() - recv_slices_.length,
+ &on_recv_message_next_done_)) {
+ grpc_error* error = PullSliceFromRecvMessage();
+ if (error != GRPC_ERROR_NONE) {
+ return ContinueRecvMessageReadyCallback(error);
+ }
+ // We have read the entire message.
+ if (recv_slices_.length == (*recv_message_)->length()) {
+ return FinishRecvMessage();
+ }
+ }
+}
+
+grpc_error* CallData::PullSliceFromRecvMessage() {
+ grpc_slice incoming_slice;
+ grpc_error* error = (*recv_message_)->Pull(&incoming_slice);
+ if (error == GRPC_ERROR_NONE) {
+ grpc_slice_buffer_add(&recv_slices_, incoming_slice);
+ }
+ return error;
+}
+
+void CallData::OnRecvMessageNextDone(void* arg, grpc_error* error) {
+ CallData* calld = static_cast<CallData*>(arg);
+ if (error != GRPC_ERROR_NONE) {
+ return calld->ContinueRecvMessageReadyCallback(GRPC_ERROR_REF(error));
+ }
+ error = calld->PullSliceFromRecvMessage();
+ if (error != GRPC_ERROR_NONE) {
+ return calld->ContinueRecvMessageReadyCallback(error);
+ }
+ if (calld->recv_slices_.length == (*calld->recv_message_)->length()) {
+ calld->FinishRecvMessage();
+ } else {
+ calld->ContinueReadingRecvMessage();
+ }
+}
+
+void CallData::FinishRecvMessage() {
+ grpc_slice_buffer decompressed_slices;
+ grpc_slice_buffer_init(&decompressed_slices);
+ if (grpc_msg_decompress(algorithm_, &recv_slices_, &decompressed_slices) ==
+ 0) {
+ GPR_DEBUG_ASSERT(error_ == GRPC_ERROR_NONE);
+ error_ = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrCat("Unexpected error decompressing data for algorithm with "
+ "enum value ",
+ algorithm_)
+ .c_str());
+ grpc_slice_buffer_destroy_internal(&decompressed_slices);
+ } else {
+ uint32_t recv_flags =
+ ((*recv_message_)->flags() & (~GRPC_WRITE_INTERNAL_COMPRESS)) |
+ GRPC_WRITE_INTERNAL_TEST_ONLY_WAS_COMPRESSED;
+ // Swap out the original receive byte stream with our new one and send the
+ // batch down.
+ // Initializing recv_replacement_stream_ with decompressed_slices removes
+ // all the slices from decompressed_slices leaving it empty.
+ new (&recv_replacement_stream_)
+ SliceBufferByteStream(&decompressed_slices, recv_flags);
+ recv_message_->reset(
+ reinterpret_cast<SliceBufferByteStream*>(&recv_replacement_stream_));
+ recv_message_ = nullptr;
+ }
+ ContinueRecvMessageReadyCallback(GRPC_ERROR_REF(error_));
+}
+
+void CallData::ContinueRecvMessageReadyCallback(grpc_error* error) {
+ MaybeResumeOnRecvTrailingMetadataReady();
+ // The surface will clean up the receiving stream if there is an error.
+ grpc_closure* closure = original_recv_message_ready_;
+ original_recv_message_ready_ = nullptr;
+ Closure::Run(DEBUG_LOCATION, closure, error);
+}
+
+void CallData::MaybeResumeOnRecvTrailingMetadataReady() {
+ if (seen_recv_trailing_metadata_ready_) {
+ seen_recv_trailing_metadata_ready_ = false;
+ grpc_error* error = on_recv_trailing_metadata_ready_error_;
+ on_recv_trailing_metadata_ready_error_ = GRPC_ERROR_NONE;
+ GRPC_CALL_COMBINER_START(call_combiner_, &on_recv_trailing_metadata_ready_,
+ error, "Continuing OnRecvTrailingMetadataReady");
+ }
+}
+
+void CallData::OnRecvTrailingMetadataReady(void* arg, grpc_error* error) {
+ CallData* calld = static_cast<CallData*>(arg);
+ if (calld->original_recv_initial_metadata_ready_ != nullptr ||
+ calld->original_recv_message_ready_ != nullptr) {
+ calld->seen_recv_trailing_metadata_ready_ = true;
+ calld->on_recv_trailing_metadata_ready_error_ = GRPC_ERROR_REF(error);
+ GRPC_CALL_COMBINER_STOP(
+ calld->call_combiner_,
+ "Deferring OnRecvTrailingMetadataReady until after "
+ "OnRecvInitialMetadataReady and OnRecvMessageReady");
+ return;
+ }
+ error = grpc_error_add_child(GRPC_ERROR_REF(error), calld->error_);
+ calld->error_ = GRPC_ERROR_NONE;
+ grpc_closure* closure = calld->original_recv_trailing_metadata_ready_;
+ calld->original_recv_trailing_metadata_ready_ = nullptr;
+ Closure::Run(DEBUG_LOCATION, closure, error);
+}
+
+void CallData::DecompressStartTransportStreamOpBatch(
+ grpc_call_element* elem, grpc_transport_stream_op_batch* batch) {
+ // Handle recv_initial_metadata.
+ if (batch->recv_initial_metadata) {
+ recv_initial_metadata_ =
+ batch->payload->recv_initial_metadata.recv_initial_metadata;
+ original_recv_initial_metadata_ready_ =
+ batch->payload->recv_initial_metadata.recv_initial_metadata_ready;
+ batch->payload->recv_initial_metadata.recv_initial_metadata_ready =
+ &on_recv_initial_metadata_ready_;
+ }
+ // Handle recv_message
+ if (batch->recv_message) {
+ recv_message_ = batch->payload->recv_message.recv_message;
+ original_recv_message_ready_ =
+ batch->payload->recv_message.recv_message_ready;
+ batch->payload->recv_message.recv_message_ready = &on_recv_message_ready_;
+ }
+ // Handle recv_trailing_metadata
+ if (batch->recv_trailing_metadata) {
+ original_recv_trailing_metadata_ready_ =
+ batch->payload->recv_trailing_metadata.recv_trailing_metadata_ready;
+ batch->payload->recv_trailing_metadata.recv_trailing_metadata_ready =
+ &on_recv_trailing_metadata_ready_;
+ }
+ // Pass control down the stack.
+ grpc_call_next_op(elem, batch);
+}
+
+void DecompressStartTransportStreamOpBatch(
+ grpc_call_element* elem, grpc_transport_stream_op_batch* batch) {
+ GPR_TIMER_SCOPE("decompress_start_transport_stream_op_batch", 0);
+ CallData* calld = static_cast<CallData*>(elem->call_data);
+ calld->DecompressStartTransportStreamOpBatch(elem, batch);
+}
+
+grpc_error* DecompressInitCallElem(grpc_call_element* elem,
+ const grpc_call_element_args* args) {
+ ChannelData* chand = static_cast<ChannelData*>(elem->channel_data);
+ new (elem->call_data) CallData(*args, chand);
+ return GRPC_ERROR_NONE;
+}
+
+void DecompressDestroyCallElem(grpc_call_element* elem,
+ const grpc_call_final_info* /*final_info*/,
+ grpc_closure* /*ignored*/) {
+ CallData* calld = static_cast<CallData*>(elem->call_data);
+ calld->~CallData();
+}
+
+grpc_error* DecompressInitChannelElem(grpc_channel_element* elem,
+ grpc_channel_element_args* args) {
+ ChannelData* chand = static_cast<ChannelData*>(elem->channel_data);
+ new (chand) ChannelData(args);
+ return GRPC_ERROR_NONE;
+}
+
+void DecompressDestroyChannelElem(grpc_channel_element* elem) {
+ ChannelData* chand = static_cast<ChannelData*>(elem->channel_data);
+ chand->~ChannelData();
+}
+
+} // namespace
+
+const grpc_channel_filter MessageDecompressFilter = {
+ DecompressStartTransportStreamOpBatch,
+ grpc_channel_next_op,
+ sizeof(CallData),
+ DecompressInitCallElem,
+ grpc_call_stack_ignore_set_pollset_or_pollset_set,
+ DecompressDestroyCallElem,
+ sizeof(ChannelData),
+ DecompressInitChannelElem,
+ DecompressDestroyChannelElem,
+ grpc_channel_next_get_info,
+ "message_decompress"};
+} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/ext/filters/http/message_compress/message_decompress_filter.h b/contrib/libs/grpc/src/core/ext/filters/http/message_compress/message_decompress_filter.h
index 14445c642b5..f19a4ca0cbd 100644
--- a/contrib/libs/grpc/src/core/ext/filters/http/message_compress/message_decompress_filter.h
+++ b/contrib/libs/grpc/src/core/ext/filters/http/message_compress/message_decompress_filter.h
@@ -1,31 +1,31 @@
-//
-//
-// Copyright 2020 gRPC authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//
-
-#ifndef GRPC_CORE_EXT_FILTERS_HTTP_MESSAGE_COMPRESS_MESSAGE_DECOMPRESS_FILTER_H
-#define GRPC_CORE_EXT_FILTERS_HTTP_MESSAGE_COMPRESS_MESSAGE_DECOMPRESS_FILTER_H
-
-#include <grpc/support/port_platform.h>
-
-#include "src/core/lib/channel/channel_stack.h"
-
-namespace grpc_core {
-extern const grpc_channel_filter MessageDecompressFilter;
-} // namespace grpc_core
-
-#endif /* GRPC_CORE_EXT_FILTERS_HTTP_MESSAGE_COMPRESS_MESSAGE_DECOMPRESS_FILTER_H \
- */
+//
+//
+// Copyright 2020 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+//
+
+#ifndef GRPC_CORE_EXT_FILTERS_HTTP_MESSAGE_COMPRESS_MESSAGE_DECOMPRESS_FILTER_H
+#define GRPC_CORE_EXT_FILTERS_HTTP_MESSAGE_COMPRESS_MESSAGE_DECOMPRESS_FILTER_H
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/lib/channel/channel_stack.h"
+
+namespace grpc_core {
+extern const grpc_channel_filter MessageDecompressFilter;
+} // namespace grpc_core
+
+#endif /* GRPC_CORE_EXT_FILTERS_HTTP_MESSAGE_COMPRESS_MESSAGE_DECOMPRESS_FILTER_H \
+ */
diff --git a/contrib/libs/grpc/src/core/ext/filters/max_age/max_age_filter.cc b/contrib/libs/grpc/src/core/ext/filters/max_age/max_age_filter.cc
index f998d4f8347..c57efd6d1ca 100644
--- a/contrib/libs/grpc/src/core/ext/filters/max_age/max_age_filter.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/max_age/max_age_filter.cc
@@ -229,8 +229,8 @@ class ConnectivityWatcher : public AsyncConnectivityStateWatcherInterface {
}
private:
- void OnConnectivityStateChange(grpc_connectivity_state new_state,
- const y_absl::Status& /* status */) override {
+ void OnConnectivityStateChange(grpc_connectivity_state new_state,
+ const y_absl::Status& /* status */) override {
if (new_state != GRPC_CHANNEL_SHUTDOWN) return;
{
MutexLock lock(&chand_->max_age_timer_mu);
diff --git a/contrib/libs/grpc/src/core/ext/filters/message_size/message_size_filter.cc b/contrib/libs/grpc/src/core/ext/filters/message_size/message_size_filter.cc
index 9467e3ca96b..944479ac3b2 100644
--- a/contrib/libs/grpc/src/core/ext/filters/message_size/message_size_filter.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/message_size/message_size_filter.cc
@@ -21,14 +21,14 @@
#include <limits.h>
#include <string.h>
-#include "y_absl/strings/str_format.h"
-
+#include "y_absl/strings/str_format.h"
+
#include <grpc/impl/codegen/grpc_types.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include "src/core/ext/filters/client_channel/service_config.h"
-#include "src/core/ext/filters/client_channel/service_config_call_data.h"
+#include "src/core/ext/filters/client_channel/service_config_call_data.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/channel/channel_stack_builder.h"
#include "src/core/lib/gpr/string.h"
@@ -46,61 +46,61 @@ namespace {
size_t g_message_size_parser_index;
} // namespace
-//
-// MessageSizeParsedConfig
-//
-
-const MessageSizeParsedConfig* MessageSizeParsedConfig::GetFromCallContext(
- const grpc_call_context_element* context) {
- if (context == nullptr) return nullptr;
- auto* svc_cfg_call_data = static_cast<ServiceConfigCallData*>(
- context[GRPC_CONTEXT_SERVICE_CONFIG_CALL_DATA].value);
- if (svc_cfg_call_data == nullptr) return nullptr;
- return static_cast<const MessageSizeParsedConfig*>(
- svc_cfg_call_data->GetMethodParsedConfig(
- MessageSizeParser::ParserIndex()));
-}
-
-//
-// MessageSizeParser
-//
-
-std::unique_ptr<ServiceConfigParser::ParsedConfig>
-MessageSizeParser::ParsePerMethodParams(const grpc_channel_args* /*args*/,
- const Json& json, grpc_error** error) {
+//
+// MessageSizeParsedConfig
+//
+
+const MessageSizeParsedConfig* MessageSizeParsedConfig::GetFromCallContext(
+ const grpc_call_context_element* context) {
+ if (context == nullptr) return nullptr;
+ auto* svc_cfg_call_data = static_cast<ServiceConfigCallData*>(
+ context[GRPC_CONTEXT_SERVICE_CONFIG_CALL_DATA].value);
+ if (svc_cfg_call_data == nullptr) return nullptr;
+ return static_cast<const MessageSizeParsedConfig*>(
+ svc_cfg_call_data->GetMethodParsedConfig(
+ MessageSizeParser::ParserIndex()));
+}
+
+//
+// MessageSizeParser
+//
+
+std::unique_ptr<ServiceConfigParser::ParsedConfig>
+MessageSizeParser::ParsePerMethodParams(const grpc_channel_args* /*args*/,
+ const Json& json, grpc_error** error) {
GPR_DEBUG_ASSERT(error != nullptr && *error == GRPC_ERROR_NONE);
- std::vector<grpc_error*> error_list;
- // Max request size.
+ std::vector<grpc_error*> error_list;
+ // Max request size.
int max_request_message_bytes = -1;
- auto it = json.object_value().find("maxRequestMessageBytes");
- if (it != json.object_value().end()) {
- if (it->second.type() != Json::Type::STRING &&
- it->second.type() != Json::Type::NUMBER) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:maxRequestMessageBytes error:should be of type number"));
- } else {
- max_request_message_bytes =
- gpr_parse_nonnegative_int(it->second.string_value().c_str());
- if (max_request_message_bytes == -1) {
+ auto it = json.object_value().find("maxRequestMessageBytes");
+ if (it != json.object_value().end()) {
+ if (it->second.type() != Json::Type::STRING &&
+ it->second.type() != Json::Type::NUMBER) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:maxRequestMessageBytes error:should be of type number"));
+ } else {
+ max_request_message_bytes =
+ gpr_parse_nonnegative_int(it->second.string_value().c_str());
+ if (max_request_message_bytes == -1) {
error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:maxRequestMessageBytes error:should be non-negative"));
+ "field:maxRequestMessageBytes error:should be non-negative"));
}
- }
- }
- // Max response size.
- int max_response_message_bytes = -1;
- it = json.object_value().find("maxResponseMessageBytes");
- if (it != json.object_value().end()) {
- if (it->second.type() != Json::Type::STRING &&
- it->second.type() != Json::Type::NUMBER) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:maxResponseMessageBytes error:should be of type number"));
- } else {
- max_response_message_bytes =
- gpr_parse_nonnegative_int(it->second.string_value().c_str());
- if (max_response_message_bytes == -1) {
+ }
+ }
+ // Max response size.
+ int max_response_message_bytes = -1;
+ it = json.object_value().find("maxResponseMessageBytes");
+ if (it != json.object_value().end()) {
+ if (it->second.type() != Json::Type::STRING &&
+ it->second.type() != Json::Type::NUMBER) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:maxResponseMessageBytes error:should be of type number"));
+ } else {
+ max_response_message_bytes =
+ gpr_parse_nonnegative_int(it->second.string_value().c_str());
+ if (max_response_message_bytes == -1) {
error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:maxResponseMessageBytes error:should be non-negative"));
+ "field:maxResponseMessageBytes error:should be non-negative"));
}
}
}
@@ -108,31 +108,31 @@ MessageSizeParser::ParsePerMethodParams(const grpc_channel_args* /*args*/,
*error = GRPC_ERROR_CREATE_FROM_VECTOR("Message size parser", &error_list);
return nullptr;
}
- return y_absl::make_unique<MessageSizeParsedConfig>(max_request_message_bytes,
- max_response_message_bytes);
+ return y_absl::make_unique<MessageSizeParsedConfig>(max_request_message_bytes,
+ max_response_message_bytes);
}
void MessageSizeParser::Register() {
- g_message_size_parser_index = ServiceConfigParser::RegisterParser(
- y_absl::make_unique<MessageSizeParser>());
+ g_message_size_parser_index = ServiceConfigParser::RegisterParser(
+ y_absl::make_unique<MessageSizeParser>());
}
size_t MessageSizeParser::ParserIndex() { return g_message_size_parser_index; }
-
-int GetMaxRecvSizeFromChannelArgs(const grpc_channel_args* args) {
- if (grpc_channel_args_want_minimal_stack(args)) return -1;
- return grpc_channel_args_find_integer(
- args, GRPC_ARG_MAX_RECEIVE_MESSAGE_LENGTH,
- {GRPC_DEFAULT_MAX_RECV_MESSAGE_LENGTH, -1, INT_MAX});
-}
-
-int GetMaxSendSizeFromChannelArgs(const grpc_channel_args* args) {
- if (grpc_channel_args_want_minimal_stack(args)) return -1;
- return grpc_channel_args_find_integer(
- args, GRPC_ARG_MAX_SEND_MESSAGE_LENGTH,
- {GRPC_DEFAULT_MAX_SEND_MESSAGE_LENGTH, -1, INT_MAX});
-}
-
+
+int GetMaxRecvSizeFromChannelArgs(const grpc_channel_args* args) {
+ if (grpc_channel_args_want_minimal_stack(args)) return -1;
+ return grpc_channel_args_find_integer(
+ args, GRPC_ARG_MAX_RECEIVE_MESSAGE_LENGTH,
+ {GRPC_DEFAULT_MAX_RECV_MESSAGE_LENGTH, -1, INT_MAX});
+}
+
+int GetMaxSendSizeFromChannelArgs(const grpc_channel_args* args) {
+ if (grpc_channel_args_want_minimal_stack(args)) return -1;
+ return grpc_channel_args_find_integer(
+ args, GRPC_ARG_MAX_SEND_MESSAGE_LENGTH,
+ {GRPC_DEFAULT_MAX_SEND_MESSAGE_LENGTH, -1, INT_MAX});
+}
+
} // namespace grpc_core
namespace {
@@ -153,8 +153,8 @@ struct call_data {
// Note: Per-method config is only available on the client, so we
// apply the max request size to the send limit and the max response
// size to the receive limit.
- const grpc_core::MessageSizeParsedConfig* limits =
- grpc_core::MessageSizeParsedConfig::GetFromCallContext(args.context);
+ const grpc_core::MessageSizeParsedConfig* limits =
+ grpc_core::MessageSizeParsedConfig::GetFromCallContext(args.context);
if (limits != nullptr) {
if (limits->limits().max_send_size >= 0 &&
(limits->limits().max_send_size < this->limits.max_send_size ||
@@ -201,13 +201,13 @@ static void recv_message_ready(void* user_data, grpc_error* error) {
(*calld->recv_message)->length() >
static_cast<size_t>(calld->limits.max_recv_size)) {
grpc_error* new_error = grpc_error_set_int(
- GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrFormat("Received message larger than max (%u vs. %d)",
- (*calld->recv_message)->length(),
- calld->limits.max_recv_size)
- .c_str()),
+ GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrFormat("Received message larger than max (%u vs. %d)",
+ (*calld->recv_message)->length(),
+ calld->limits.max_recv_size)
+ .c_str()),
GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_RESOURCE_EXHAUSTED);
- error = grpc_error_add_child(GRPC_ERROR_REF(error), new_error);
+ error = grpc_error_add_child(GRPC_ERROR_REF(error), new_error);
GRPC_ERROR_UNREF(calld->error);
calld->error = GRPC_ERROR_REF(error);
} else {
@@ -261,14 +261,14 @@ static void message_size_start_transport_stream_op_batch(
static_cast<size_t>(calld->limits.max_send_size)) {
grpc_transport_stream_op_batch_finish_with_failure(
op,
- grpc_error_set_int(
- GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrFormat(
- "Sent message larger than max (%u vs. %d)",
- op->payload->send_message.send_message->length(),
- calld->limits.max_send_size)
- .c_str()),
- GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_RESOURCE_EXHAUSTED),
+ grpc_error_set_int(
+ GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrFormat(
+ "Sent message larger than max (%u vs. %d)",
+ op->payload->send_message.send_message->length(),
+ calld->limits.max_send_size)
+ .c_str()),
+ GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_RESOURCE_EXHAUSTED),
calld->call_combiner);
return;
}
@@ -309,8 +309,8 @@ static void message_size_destroy_call_elem(
grpc_core::MessageSizeParsedConfig::message_size_limits get_message_size_limits(
const grpc_channel_args* channel_args) {
grpc_core::MessageSizeParsedConfig::message_size_limits lim;
- lim.max_send_size = grpc_core::GetMaxSendSizeFromChannelArgs(channel_args);
- lim.max_recv_size = grpc_core::GetMaxRecvSizeFromChannelArgs(channel_args);
+ lim.max_send_size = grpc_core::GetMaxSendSizeFromChannelArgs(channel_args);
+ lim.max_recv_size = grpc_core::GetMaxRecvSizeFromChannelArgs(channel_args);
return lim;
}
@@ -361,9 +361,9 @@ static bool maybe_add_message_size_filter(grpc_channel_stack_builder* builder,
void* /*arg*/) {
const grpc_channel_args* channel_args =
grpc_channel_stack_builder_get_channel_arguments(builder);
- if (grpc_channel_args_want_minimal_stack(channel_args)) {
- return true;
- }
+ if (grpc_channel_args_want_minimal_stack(channel_args)) {
+ return true;
+ }
bool enable = false;
grpc_core::MessageSizeParsedConfig::message_size_limits lim =
get_message_size_limits(channel_args);
diff --git a/contrib/libs/grpc/src/core/ext/filters/message_size/message_size_filter.h b/contrib/libs/grpc/src/core/ext/filters/message_size/message_size_filter.h
index fd9bcd91dd5..0583a789267 100644
--- a/contrib/libs/grpc/src/core/ext/filters/message_size/message_size_filter.h
+++ b/contrib/libs/grpc/src/core/ext/filters/message_size/message_size_filter.h
@@ -19,14 +19,14 @@
#include <grpc/support/port_platform.h>
-#include "src/core/ext/filters/client_channel/service_config_parser.h"
+#include "src/core/ext/filters/client_channel/service_config_parser.h"
#include "src/core/lib/channel/channel_stack.h"
extern const grpc_channel_filter grpc_message_size_filter;
namespace grpc_core {
-class MessageSizeParsedConfig : public ServiceConfigParser::ParsedConfig {
+class MessageSizeParsedConfig : public ServiceConfigParser::ParsedConfig {
public:
struct message_size_limits {
int max_send_size;
@@ -40,27 +40,27 @@ class MessageSizeParsedConfig : public ServiceConfigParser::ParsedConfig {
const message_size_limits& limits() const { return limits_; }
- static const MessageSizeParsedConfig* GetFromCallContext(
- const grpc_call_context_element* context);
-
+ static const MessageSizeParsedConfig* GetFromCallContext(
+ const grpc_call_context_element* context);
+
private:
message_size_limits limits_;
};
-class MessageSizeParser : public ServiceConfigParser::Parser {
+class MessageSizeParser : public ServiceConfigParser::Parser {
public:
- std::unique_ptr<ServiceConfigParser::ParsedConfig> ParsePerMethodParams(
- const grpc_channel_args* /*args*/, const Json& json,
- grpc_error** error) override;
+ std::unique_ptr<ServiceConfigParser::ParsedConfig> ParsePerMethodParams(
+ const grpc_channel_args* /*args*/, const Json& json,
+ grpc_error** error) override;
static void Register();
static size_t ParserIndex();
};
-int GetMaxRecvSizeFromChannelArgs(const grpc_channel_args* args);
-int GetMaxSendSizeFromChannelArgs(const grpc_channel_args* args);
-
+int GetMaxRecvSizeFromChannelArgs(const grpc_channel_args* args);
+int GetMaxSendSizeFromChannelArgs(const grpc_channel_args* args);
+
} // namespace grpc_core
#endif /* GRPC_CORE_EXT_FILTERS_MESSAGE_SIZE_MESSAGE_SIZE_FILTER_H */
diff --git a/contrib/libs/grpc/src/core/ext/transport/chttp2/client/chttp2_connector.cc b/contrib/libs/grpc/src/core/ext/transport/chttp2/client/chttp2_connector.cc
index c1c0ec6fe14..3408ed92675 100644
--- a/contrib/libs/grpc/src/core/ext/transport/chttp2/client/chttp2_connector.cc
+++ b/contrib/libs/grpc/src/core/ext/transport/chttp2/client/chttp2_connector.cc
@@ -129,15 +129,15 @@ void Chttp2Connector::StartHandshakeLocked() {
endpoint_ = nullptr; // Endpoint handed off to handshake manager.
}
-namespace {
-void NullThenSchedClosure(const DebugLocation& location, grpc_closure** closure,
- grpc_error* error) {
- grpc_closure* c = *closure;
- *closure = nullptr;
- ExecCtx::Run(location, c, error);
-}
-} // namespace
-
+namespace {
+void NullThenSchedClosure(const DebugLocation& location, grpc_closure** closure,
+ grpc_error* error) {
+ grpc_closure* c = *closure;
+ *closure = nullptr;
+ ExecCtx::Run(location, c, error);
+}
+} // namespace
+
void Chttp2Connector::OnHandshakeDone(void* arg, grpc_error* error) {
auto* args = static_cast<HandshakerArgs*>(arg);
Chttp2Connector* self = static_cast<Chttp2Connector*>(args->user_data);
@@ -163,100 +163,100 @@ void Chttp2Connector::OnHandshakeDone(void* arg, grpc_error* error) {
error = GRPC_ERROR_REF(error);
}
self->result_->Reset();
- NullThenSchedClosure(DEBUG_LOCATION, &self->notify_, error);
+ NullThenSchedClosure(DEBUG_LOCATION, &self->notify_, error);
} else if (args->endpoint != nullptr) {
self->result_->transport =
grpc_create_chttp2_transport(args->args, args->endpoint, true);
self->result_->socket_node =
grpc_chttp2_transport_get_socket_node(self->result_->transport);
- self->result_->channel_args = args->args;
+ self->result_->channel_args = args->args;
GPR_ASSERT(self->result_->transport != nullptr);
- self->endpoint_ = args->endpoint;
- self->Ref().release(); // Ref held by OnReceiveSettings()
- GRPC_CLOSURE_INIT(&self->on_receive_settings_, OnReceiveSettings, self,
- grpc_schedule_on_exec_ctx);
- self->Ref().release(); // Ref held by OnTimeout()
+ self->endpoint_ = args->endpoint;
+ self->Ref().release(); // Ref held by OnReceiveSettings()
+ GRPC_CLOSURE_INIT(&self->on_receive_settings_, OnReceiveSettings, self,
+ grpc_schedule_on_exec_ctx);
+ self->Ref().release(); // Ref held by OnTimeout()
grpc_chttp2_transport_start_reading(self->result_->transport,
- args->read_buffer,
- &self->on_receive_settings_);
- GRPC_CLOSURE_INIT(&self->on_timeout_, OnTimeout, self,
- grpc_schedule_on_exec_ctx);
- grpc_timer_init(&self->timer_, self->args_.deadline, &self->on_timeout_);
+ args->read_buffer,
+ &self->on_receive_settings_);
+ GRPC_CLOSURE_INIT(&self->on_timeout_, OnTimeout, self,
+ grpc_schedule_on_exec_ctx);
+ grpc_timer_init(&self->timer_, self->args_.deadline, &self->on_timeout_);
} else {
// If the handshaking succeeded but there is no endpoint, then the
// handshaker may have handed off the connection to some external
// code. Just verify that exit_early flag is set.
GPR_DEBUG_ASSERT(args->exit_early);
- NullThenSchedClosure(DEBUG_LOCATION, &self->notify_, error);
+ NullThenSchedClosure(DEBUG_LOCATION, &self->notify_, error);
}
self->handshake_mgr_.reset();
}
self->Unref();
}
-void Chttp2Connector::OnReceiveSettings(void* arg, grpc_error* error) {
- Chttp2Connector* self = static_cast<Chttp2Connector*>(arg);
- {
- MutexLock lock(&self->mu_);
- if (!self->notify_error_.has_value()) {
- grpc_endpoint_delete_from_pollset_set(self->endpoint_,
- self->args_.interested_parties);
- if (error != GRPC_ERROR_NONE) {
- // Transport got an error while waiting on SETTINGS frame.
- // TODO(yashykt): The following two lines should be moved to
- // SubchannelConnector::Result::Reset()
- grpc_transport_destroy(self->result_->transport);
- grpc_channel_args_destroy(self->result_->channel_args);
- self->result_->Reset();
- }
- self->MaybeNotify(GRPC_ERROR_REF(error));
- grpc_timer_cancel(&self->timer_);
- } else {
- // OnTimeout() was already invoked. Call Notify() again so that notify_
- // can be invoked.
- self->MaybeNotify(GRPC_ERROR_NONE);
- }
- }
- self->Unref();
-}
-
-void Chttp2Connector::OnTimeout(void* arg, grpc_error* error) {
- Chttp2Connector* self = static_cast<Chttp2Connector*>(arg);
- {
- MutexLock lock(&self->mu_);
- if (!self->notify_error_.has_value()) {
- // The transport did not receive the settings frame in time. Destroy the
- // transport.
- grpc_endpoint_delete_from_pollset_set(self->endpoint_,
- self->args_.interested_parties);
- // TODO(yashykt): The following two lines should be moved to
- // SubchannelConnector::Result::Reset()
- grpc_transport_destroy(self->result_->transport);
- grpc_channel_args_destroy(self->result_->channel_args);
- self->result_->Reset();
- self->MaybeNotify(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "connection attempt timed out before receiving SETTINGS frame"));
- } else {
- // OnReceiveSettings() was already invoked. Call Notify() again so that
- // notify_ can be invoked.
- self->MaybeNotify(GRPC_ERROR_NONE);
- }
- }
- self->Unref();
-}
-
-void Chttp2Connector::MaybeNotify(grpc_error* error) {
- if (notify_error_.has_value()) {
- GRPC_ERROR_UNREF(error);
- NullThenSchedClosure(DEBUG_LOCATION, &notify_, notify_error_.value());
- // Clear state for a new Connect().
- // Clear out the endpoint_, since it is the responsibility of
- // the transport to shut it down.
- endpoint_ = nullptr;
- notify_error_.reset();
- } else {
- notify_error_ = error;
- }
-}
-
+void Chttp2Connector::OnReceiveSettings(void* arg, grpc_error* error) {
+ Chttp2Connector* self = static_cast<Chttp2Connector*>(arg);
+ {
+ MutexLock lock(&self->mu_);
+ if (!self->notify_error_.has_value()) {
+ grpc_endpoint_delete_from_pollset_set(self->endpoint_,
+ self->args_.interested_parties);
+ if (error != GRPC_ERROR_NONE) {
+ // Transport got an error while waiting on SETTINGS frame.
+ // TODO(yashykt): The following two lines should be moved to
+ // SubchannelConnector::Result::Reset()
+ grpc_transport_destroy(self->result_->transport);
+ grpc_channel_args_destroy(self->result_->channel_args);
+ self->result_->Reset();
+ }
+ self->MaybeNotify(GRPC_ERROR_REF(error));
+ grpc_timer_cancel(&self->timer_);
+ } else {
+ // OnTimeout() was already invoked. Call Notify() again so that notify_
+ // can be invoked.
+ self->MaybeNotify(GRPC_ERROR_NONE);
+ }
+ }
+ self->Unref();
+}
+
+void Chttp2Connector::OnTimeout(void* arg, grpc_error* error) {
+ Chttp2Connector* self = static_cast<Chttp2Connector*>(arg);
+ {
+ MutexLock lock(&self->mu_);
+ if (!self->notify_error_.has_value()) {
+ // The transport did not receive the settings frame in time. Destroy the
+ // transport.
+ grpc_endpoint_delete_from_pollset_set(self->endpoint_,
+ self->args_.interested_parties);
+ // TODO(yashykt): The following two lines should be moved to
+ // SubchannelConnector::Result::Reset()
+ grpc_transport_destroy(self->result_->transport);
+ grpc_channel_args_destroy(self->result_->channel_args);
+ self->result_->Reset();
+ self->MaybeNotify(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "connection attempt timed out before receiving SETTINGS frame"));
+ } else {
+ // OnReceiveSettings() was already invoked. Call Notify() again so that
+ // notify_ can be invoked.
+ self->MaybeNotify(GRPC_ERROR_NONE);
+ }
+ }
+ self->Unref();
+}
+
+void Chttp2Connector::MaybeNotify(grpc_error* error) {
+ if (notify_error_.has_value()) {
+ GRPC_ERROR_UNREF(error);
+ NullThenSchedClosure(DEBUG_LOCATION, &notify_, notify_error_.value());
+ // Clear state for a new Connect().
+ // Clear out the endpoint_, since it is the responsibility of
+ // the transport to shut it down.
+ endpoint_ = nullptr;
+ notify_error_.reset();
+ } else {
+ notify_error_ = error;
+ }
+}
+
} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/ext/transport/chttp2/client/chttp2_connector.h b/contrib/libs/grpc/src/core/ext/transport/chttp2/client/chttp2_connector.h
index 3d69495e541..322cbc2eba4 100644
--- a/contrib/libs/grpc/src/core/ext/transport/chttp2/client/chttp2_connector.h
+++ b/contrib/libs/grpc/src/core/ext/transport/chttp2/client/chttp2_connector.h
@@ -39,20 +39,20 @@ class Chttp2Connector : public SubchannelConnector {
static void Connected(void* arg, grpc_error* error);
void StartHandshakeLocked();
static void OnHandshakeDone(void* arg, grpc_error* error);
- static void OnReceiveSettings(void* arg, grpc_error* error);
- static void OnTimeout(void* arg, grpc_error* error);
+ static void OnReceiveSettings(void* arg, grpc_error* error);
+ static void OnTimeout(void* arg, grpc_error* error);
+
+ // We cannot invoke notify_ until both OnTimeout() and OnReceiveSettings()
+ // have been called since that is an indicator to the upper layer that we are
+ // done with the connection attempt. So, the notification process is broken
+ // into two steps. 1) Either OnTimeout() or OnReceiveSettings() gets invoked
+ // first. Whichever gets invoked, calls MaybeNotify() to set the result and
+ // triggers the other callback to be invoked. 2) When the other callback is
+ // invoked, we call MaybeNotify() again to actually invoke the notify_
+ // callback. Note that this only happens if the handshake is done and the
+ // connector is waiting on the SETTINGS frame.
+ void MaybeNotify(grpc_error* error);
- // We cannot invoke notify_ until both OnTimeout() and OnReceiveSettings()
- // have been called since that is an indicator to the upper layer that we are
- // done with the connection attempt. So, the notification process is broken
- // into two steps. 1) Either OnTimeout() or OnReceiveSettings() gets invoked
- // first. Whichever gets invoked, calls MaybeNotify() to set the result and
- // triggers the other callback to be invoked. 2) When the other callback is
- // invoked, we call MaybeNotify() again to actually invoke the notify_
- // callback. Note that this only happens if the handshake is done and the
- // connector is waiting on the SETTINGS frame.
- void MaybeNotify(grpc_error* error);
-
Mutex mu_;
Args args_;
Result* result_ = nullptr;
@@ -60,13 +60,13 @@ class Chttp2Connector : public SubchannelConnector {
bool shutdown_ = false;
bool connecting_ = false;
// Holds the endpoint when first created before being handed off to
- // the handshake manager, and then again after handshake is done.
+ // the handshake manager, and then again after handshake is done.
grpc_endpoint* endpoint_ = nullptr;
grpc_closure connected_;
- grpc_closure on_receive_settings_;
- grpc_timer timer_;
- grpc_closure on_timeout_;
- y_absl::optional<grpc_error*> notify_error_;
+ grpc_closure on_receive_settings_;
+ grpc_timer timer_;
+ grpc_closure on_timeout_;
+ y_absl::optional<grpc_error*> notify_error_;
RefCountedPtr<HandshakeManager> handshake_mgr_;
};
diff --git a/contrib/libs/grpc/src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc b/contrib/libs/grpc/src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc
index 2e14ea543b9..93dadf36456 100644
--- a/contrib/libs/grpc/src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc
+++ b/contrib/libs/grpc/src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc
@@ -36,7 +36,7 @@
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/surface/api_trace.h"
#include "src/core/lib/surface/channel.h"
-#include "src/core/lib/transport/authority_override.h"
+#include "src/core/lib/transport/authority_override.h"
#include "src/core/lib/uri/uri_parser.h"
namespace grpc_core {
@@ -74,16 +74,16 @@ class Chttp2SecureClientChannelFactory : public ClientChannelFactory {
"channel args.");
return nullptr;
}
- // Find the authority to use in the security connector.
- // First, check the authority override channel arg.
- // Otherwise, get it from the server name used to construct the
- // channel.
- grpc_core::UniquePtr<char> authority(
- gpr_strdup(FindAuthorityOverrideInArgs(args)));
+ // Find the authority to use in the security connector.
+ // First, check the authority override channel arg.
+ // Otherwise, get it from the server name used to construct the
+ // channel.
+ grpc_core::UniquePtr<char> authority(
+ gpr_strdup(FindAuthorityOverrideInArgs(args)));
if (authority == nullptr) {
- const char* server_uri_str =
- grpc_channel_args_find_string(args, GRPC_ARG_SERVER_URI);
- GPR_ASSERT(server_uri_str != nullptr);
+ const char* server_uri_str =
+ grpc_channel_args_find_string(args, GRPC_ARG_SERVER_URI);
+ GPR_ASSERT(server_uri_str != nullptr);
authority = ResolverRegistry::GetDefaultAuthority(server_uri_str);
}
grpc_arg args_to_add[2];
diff --git a/contrib/libs/grpc/src/core/ext/transport/chttp2/server/chttp2_server.cc b/contrib/libs/grpc/src/core/ext/transport/chttp2/server/chttp2_server.cc
index 8d5f1afa20a..94cf61310bc 100644
--- a/contrib/libs/grpc/src/core/ext/transport/chttp2/server/chttp2_server.cc
+++ b/contrib/libs/grpc/src/core/ext/transport/chttp2/server/chttp2_server.cc
@@ -23,11 +23,11 @@
#include <inttypes.h>
#include <limits.h>
#include <string.h>
-#include <vector>
+#include <vector>
+
+#include "y_absl/strings/str_cat.h"
+#include "y_absl/strings/str_format.h"
-#include "y_absl/strings/str_cat.h"
-#include "y_absl/strings/str_format.h"
-
#include <grpc/grpc.h>
#include <grpc/impl/codegen/grpc_types.h>
#include <grpc/support/alloc.h>
@@ -40,8 +40,8 @@
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/channel/handshaker.h"
#include "src/core/lib/channel/handshaker_registry.h"
-#include "src/core/lib/gprpp/ref_counted.h"
-#include "src/core/lib/gprpp/ref_counted_ptr.h"
+#include "src/core/lib/gprpp/ref_counted.h"
+#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/iomgr/endpoint.h"
#include "src/core/lib/iomgr/resolve_address.h"
#include "src/core/lib/iomgr/resource_quota.h"
@@ -50,432 +50,432 @@
#include "src/core/lib/surface/api_trace.h"
#include "src/core/lib/surface/server.h"
-namespace grpc_core {
-namespace {
-
-class Chttp2ServerListener : public Server::ListenerInterface {
- public:
- static grpc_error* Create(Server* server, const char* addr,
- grpc_channel_args* args, int* port_num);
-
- static grpc_error* CreateWithAcceptor(Server* server, const char* name,
- grpc_channel_args* args);
-
- // Do not instantiate directly. Use one of the factory methods above.
- Chttp2ServerListener(Server* server, grpc_channel_args* args);
- ~Chttp2ServerListener();
-
- void Start(Server* server,
- const std::vector<grpc_pollset*>* pollsets) override;
-
- channelz::ListenSocketNode* channelz_listen_socket_node() const override {
- return channelz_listen_socket_.get();
- }
-
- void SetOnDestroyDone(grpc_closure* on_destroy_done) override;
-
- void Orphan() override;
-
- private:
- class ConnectionState : public RefCounted<ConnectionState> {
- public:
- ConnectionState(Chttp2ServerListener* listener,
- grpc_pollset* accepting_pollset,
- grpc_tcp_server_acceptor* acceptor,
- RefCountedPtr<HandshakeManager> handshake_mgr,
- grpc_channel_args* args, grpc_endpoint* endpoint);
-
- ~ConnectionState();
-
- private:
- static void OnTimeout(void* arg, grpc_error* error);
- static void OnReceiveSettings(void* arg, grpc_error* error);
- static void OnHandshakeDone(void* arg, grpc_error* error);
-
- Chttp2ServerListener* const listener_;
- grpc_pollset* const accepting_pollset_;
- grpc_tcp_server_acceptor* const acceptor_;
- RefCountedPtr<HandshakeManager> handshake_mgr_;
- // State for enforcing handshake timeout on receiving HTTP/2 settings.
- grpc_chttp2_transport* transport_ = nullptr;
- grpc_millis deadline_;
- grpc_timer timer_;
- grpc_closure on_timeout_;
- grpc_closure on_receive_settings_;
- grpc_pollset_set* const interested_parties_;
- };
-
- static void OnAccept(void* arg, grpc_endpoint* tcp,
- grpc_pollset* accepting_pollset,
- grpc_tcp_server_acceptor* acceptor);
-
- RefCountedPtr<HandshakeManager> CreateHandshakeManager();
-
- static void TcpServerShutdownComplete(void* arg, grpc_error* error);
-
- static void DestroyListener(Server* /*server*/, void* arg,
- grpc_closure* destroy_done);
-
- Server* const server_;
- grpc_channel_args* const args_;
- grpc_tcp_server* tcp_server_;
- Mutex mu_;
- bool shutdown_ = true;
- grpc_closure tcp_server_shutdown_complete_;
- grpc_closure* on_destroy_done_ = nullptr;
- HandshakeManager* pending_handshake_mgrs_ = nullptr;
- RefCountedPtr<channelz::ListenSocketNode> channelz_listen_socket_;
+namespace grpc_core {
+namespace {
+
+class Chttp2ServerListener : public Server::ListenerInterface {
+ public:
+ static grpc_error* Create(Server* server, const char* addr,
+ grpc_channel_args* args, int* port_num);
+
+ static grpc_error* CreateWithAcceptor(Server* server, const char* name,
+ grpc_channel_args* args);
+
+ // Do not instantiate directly. Use one of the factory methods above.
+ Chttp2ServerListener(Server* server, grpc_channel_args* args);
+ ~Chttp2ServerListener();
+
+ void Start(Server* server,
+ const std::vector<grpc_pollset*>* pollsets) override;
+
+ channelz::ListenSocketNode* channelz_listen_socket_node() const override {
+ return channelz_listen_socket_.get();
+ }
+
+ void SetOnDestroyDone(grpc_closure* on_destroy_done) override;
+
+ void Orphan() override;
+
+ private:
+ class ConnectionState : public RefCounted<ConnectionState> {
+ public:
+ ConnectionState(Chttp2ServerListener* listener,
+ grpc_pollset* accepting_pollset,
+ grpc_tcp_server_acceptor* acceptor,
+ RefCountedPtr<HandshakeManager> handshake_mgr,
+ grpc_channel_args* args, grpc_endpoint* endpoint);
+
+ ~ConnectionState();
+
+ private:
+ static void OnTimeout(void* arg, grpc_error* error);
+ static void OnReceiveSettings(void* arg, grpc_error* error);
+ static void OnHandshakeDone(void* arg, grpc_error* error);
+
+ Chttp2ServerListener* const listener_;
+ grpc_pollset* const accepting_pollset_;
+ grpc_tcp_server_acceptor* const acceptor_;
+ RefCountedPtr<HandshakeManager> handshake_mgr_;
+ // State for enforcing handshake timeout on receiving HTTP/2 settings.
+ grpc_chttp2_transport* transport_ = nullptr;
+ grpc_millis deadline_;
+ grpc_timer timer_;
+ grpc_closure on_timeout_;
+ grpc_closure on_receive_settings_;
+ grpc_pollset_set* const interested_parties_;
+ };
+
+ static void OnAccept(void* arg, grpc_endpoint* tcp,
+ grpc_pollset* accepting_pollset,
+ grpc_tcp_server_acceptor* acceptor);
+
+ RefCountedPtr<HandshakeManager> CreateHandshakeManager();
+
+ static void TcpServerShutdownComplete(void* arg, grpc_error* error);
+
+ static void DestroyListener(Server* /*server*/, void* arg,
+ grpc_closure* destroy_done);
+
+ Server* const server_;
+ grpc_channel_args* const args_;
+ grpc_tcp_server* tcp_server_;
+ Mutex mu_;
+ bool shutdown_ = true;
+ grpc_closure tcp_server_shutdown_complete_;
+ grpc_closure* on_destroy_done_ = nullptr;
+ HandshakeManager* pending_handshake_mgrs_ = nullptr;
+ RefCountedPtr<channelz::ListenSocketNode> channelz_listen_socket_;
};
-//
-// Chttp2ServerListener::ConnectionState
-//
-
-grpc_millis GetConnectionDeadline(const grpc_channel_args* args) {
- int timeout_ms =
- grpc_channel_args_find_integer(args, GRPC_ARG_SERVER_HANDSHAKE_TIMEOUT_MS,
- {120 * GPR_MS_PER_SEC, 1, INT_MAX});
- return ExecCtx::Get()->Now() + timeout_ms;
-}
-
-Chttp2ServerListener::ConnectionState::ConnectionState(
- Chttp2ServerListener* listener, grpc_pollset* accepting_pollset,
- grpc_tcp_server_acceptor* acceptor,
- RefCountedPtr<HandshakeManager> handshake_mgr, grpc_channel_args* args,
- grpc_endpoint* endpoint)
- : listener_(listener),
- accepting_pollset_(accepting_pollset),
- acceptor_(acceptor),
- handshake_mgr_(std::move(handshake_mgr)),
- deadline_(GetConnectionDeadline(args)),
- interested_parties_(grpc_pollset_set_create()) {
- grpc_pollset_set_add_pollset(interested_parties_, accepting_pollset_);
- HandshakerRegistry::AddHandshakers(HANDSHAKER_SERVER, args,
- interested_parties_, handshake_mgr_.get());
- handshake_mgr_->DoHandshake(endpoint, args, deadline_, acceptor_,
- OnHandshakeDone, this);
-}
-
-Chttp2ServerListener::ConnectionState::~ConnectionState() {
- if (transport_ != nullptr) {
- GRPC_CHTTP2_UNREF_TRANSPORT(transport_, "receive settings timeout");
+//
+// Chttp2ServerListener::ConnectionState
+//
+
+grpc_millis GetConnectionDeadline(const grpc_channel_args* args) {
+ int timeout_ms =
+ grpc_channel_args_find_integer(args, GRPC_ARG_SERVER_HANDSHAKE_TIMEOUT_MS,
+ {120 * GPR_MS_PER_SEC, 1, INT_MAX});
+ return ExecCtx::Get()->Now() + timeout_ms;
+}
+
+Chttp2ServerListener::ConnectionState::ConnectionState(
+ Chttp2ServerListener* listener, grpc_pollset* accepting_pollset,
+ grpc_tcp_server_acceptor* acceptor,
+ RefCountedPtr<HandshakeManager> handshake_mgr, grpc_channel_args* args,
+ grpc_endpoint* endpoint)
+ : listener_(listener),
+ accepting_pollset_(accepting_pollset),
+ acceptor_(acceptor),
+ handshake_mgr_(std::move(handshake_mgr)),
+ deadline_(GetConnectionDeadline(args)),
+ interested_parties_(grpc_pollset_set_create()) {
+ grpc_pollset_set_add_pollset(interested_parties_, accepting_pollset_);
+ HandshakerRegistry::AddHandshakers(HANDSHAKER_SERVER, args,
+ interested_parties_, handshake_mgr_.get());
+ handshake_mgr_->DoHandshake(endpoint, args, deadline_, acceptor_,
+ OnHandshakeDone, this);
+}
+
+Chttp2ServerListener::ConnectionState::~ConnectionState() {
+ if (transport_ != nullptr) {
+ GRPC_CHTTP2_UNREF_TRANSPORT(transport_, "receive settings timeout");
}
- grpc_pollset_set_del_pollset(interested_parties_, accepting_pollset_);
- grpc_pollset_set_destroy(interested_parties_);
+ grpc_pollset_set_del_pollset(interested_parties_, accepting_pollset_);
+ grpc_pollset_set_destroy(interested_parties_);
}
-void Chttp2ServerListener::ConnectionState::OnTimeout(void* arg,
- grpc_error* error) {
- ConnectionState* self = static_cast<ConnectionState*>(arg);
+void Chttp2ServerListener::ConnectionState::OnTimeout(void* arg,
+ grpc_error* error) {
+ ConnectionState* self = static_cast<ConnectionState*>(arg);
// Note that we may be called with GRPC_ERROR_NONE when the timer fires
// or with an error indicating that the timer system is being shut down.
if (error != GRPC_ERROR_CANCELLED) {
grpc_transport_op* op = grpc_make_transport_op(nullptr);
op->disconnect_with_error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"Did not receive HTTP/2 settings before handshake timeout");
- grpc_transport_perform_op(&self->transport_->base, op);
+ grpc_transport_perform_op(&self->transport_->base, op);
}
- self->Unref();
+ self->Unref();
}
-void Chttp2ServerListener::ConnectionState::OnReceiveSettings(
- void* arg, grpc_error* error) {
- ConnectionState* self = static_cast<ConnectionState*>(arg);
+void Chttp2ServerListener::ConnectionState::OnReceiveSettings(
+ void* arg, grpc_error* error) {
+ ConnectionState* self = static_cast<ConnectionState*>(arg);
if (error == GRPC_ERROR_NONE) {
- grpc_timer_cancel(&self->timer_);
+ grpc_timer_cancel(&self->timer_);
}
- self->Unref();
+ self->Unref();
}
-void Chttp2ServerListener::ConnectionState::OnHandshakeDone(void* arg,
- grpc_error* error) {
- auto* args = static_cast<HandshakerArgs*>(arg);
- ConnectionState* self = static_cast<ConnectionState*>(args->user_data);
- {
- MutexLock lock(&self->listener_->mu_);
- grpc_resource_user* resource_user =
- self->listener_->server_->default_resource_user();
- if (error != GRPC_ERROR_NONE || self->listener_->shutdown_) {
- const char* error_str = grpc_error_string(error);
- gpr_log(GPR_DEBUG, "Handshaking failed: %s", error_str);
+void Chttp2ServerListener::ConnectionState::OnHandshakeDone(void* arg,
+ grpc_error* error) {
+ auto* args = static_cast<HandshakerArgs*>(arg);
+ ConnectionState* self = static_cast<ConnectionState*>(args->user_data);
+ {
+ MutexLock lock(&self->listener_->mu_);
+ grpc_resource_user* resource_user =
+ self->listener_->server_->default_resource_user();
+ if (error != GRPC_ERROR_NONE || self->listener_->shutdown_) {
+ const char* error_str = grpc_error_string(error);
+ gpr_log(GPR_DEBUG, "Handshaking failed: %s", error_str);
if (resource_user != nullptr) {
grpc_resource_user_free(resource_user,
GRPC_RESOURCE_QUOTA_CHANNEL_SIZE);
}
- if (error == GRPC_ERROR_NONE && args->endpoint != nullptr) {
- // We were shut down after handshaking completed successfully, so
- // destroy the endpoint here.
- // TODO(ctiller): It is currently necessary to shutdown endpoints
- // before destroying them, even if we know that there are no
- // pending read/write callbacks. This should be fixed, at which
- // point this can be removed.
- grpc_endpoint_shutdown(args->endpoint, GRPC_ERROR_NONE);
- grpc_endpoint_destroy(args->endpoint);
- grpc_channel_args_destroy(args->args);
- grpc_slice_buffer_destroy_internal(args->read_buffer);
- gpr_free(args->read_buffer);
- }
- } else {
- // If the handshaking succeeded but there is no endpoint, then the
- // handshaker may have handed off the connection to some external
- // code, so we can just clean up here without creating a transport.
- if (args->endpoint != nullptr) {
- grpc_transport* transport = grpc_create_chttp2_transport(
- args->args, args->endpoint, false, resource_user);
- self->listener_->server_->SetupTransport(
- transport, self->accepting_pollset_, args->args,
- grpc_chttp2_transport_get_socket_node(transport), resource_user);
- // Use notify_on_receive_settings callback to enforce the
- // handshake deadline.
- // Note: The reinterpret_cast<>s here are safe, because
- // grpc_chttp2_transport is a C-style extension of
- // grpc_transport, so this is morally equivalent of a
- // static_cast<> to a derived class.
- // TODO(roth): Change to static_cast<> when we C++-ify the
- // transport API.
- self->transport_ = reinterpret_cast<grpc_chttp2_transport*>(transport);
- self->Ref().release(); // Held by OnReceiveSettings().
- GRPC_CLOSURE_INIT(&self->on_receive_settings_, OnReceiveSettings, self,
- grpc_schedule_on_exec_ctx);
- grpc_chttp2_transport_start_reading(transport, args->read_buffer,
- &self->on_receive_settings_);
- grpc_channel_args_destroy(args->args);
- self->Ref().release(); // Held by OnTimeout().
- GRPC_CHTTP2_REF_TRANSPORT(
- reinterpret_cast<grpc_chttp2_transport*>(transport),
- "receive settings timeout");
- GRPC_CLOSURE_INIT(&self->on_timeout_, OnTimeout, self,
- grpc_schedule_on_exec_ctx);
- grpc_timer_init(&self->timer_, self->deadline_, &self->on_timeout_);
- } else {
- if (resource_user != nullptr) {
- grpc_resource_user_free(resource_user,
- GRPC_RESOURCE_QUOTA_CHANNEL_SIZE);
- }
- }
+ if (error == GRPC_ERROR_NONE && args->endpoint != nullptr) {
+ // We were shut down after handshaking completed successfully, so
+ // destroy the endpoint here.
+ // TODO(ctiller): It is currently necessary to shutdown endpoints
+ // before destroying them, even if we know that there are no
+ // pending read/write callbacks. This should be fixed, at which
+ // point this can be removed.
+ grpc_endpoint_shutdown(args->endpoint, GRPC_ERROR_NONE);
+ grpc_endpoint_destroy(args->endpoint);
+ grpc_channel_args_destroy(args->args);
+ grpc_slice_buffer_destroy_internal(args->read_buffer);
+ gpr_free(args->read_buffer);
+ }
+ } else {
+ // If the handshaking succeeded but there is no endpoint, then the
+ // handshaker may have handed off the connection to some external
+ // code, so we can just clean up here without creating a transport.
+ if (args->endpoint != nullptr) {
+ grpc_transport* transport = grpc_create_chttp2_transport(
+ args->args, args->endpoint, false, resource_user);
+ self->listener_->server_->SetupTransport(
+ transport, self->accepting_pollset_, args->args,
+ grpc_chttp2_transport_get_socket_node(transport), resource_user);
+ // Use notify_on_receive_settings callback to enforce the
+ // handshake deadline.
+ // Note: The reinterpret_cast<>s here are safe, because
+ // grpc_chttp2_transport is a C-style extension of
+ // grpc_transport, so this is morally equivalent of a
+ // static_cast<> to a derived class.
+ // TODO(roth): Change to static_cast<> when we C++-ify the
+ // transport API.
+ self->transport_ = reinterpret_cast<grpc_chttp2_transport*>(transport);
+ self->Ref().release(); // Held by OnReceiveSettings().
+ GRPC_CLOSURE_INIT(&self->on_receive_settings_, OnReceiveSettings, self,
+ grpc_schedule_on_exec_ctx);
+ grpc_chttp2_transport_start_reading(transport, args->read_buffer,
+ &self->on_receive_settings_);
+ grpc_channel_args_destroy(args->args);
+ self->Ref().release(); // Held by OnTimeout().
+ GRPC_CHTTP2_REF_TRANSPORT(
+ reinterpret_cast<grpc_chttp2_transport*>(transport),
+ "receive settings timeout");
+ GRPC_CLOSURE_INIT(&self->on_timeout_, OnTimeout, self,
+ grpc_schedule_on_exec_ctx);
+ grpc_timer_init(&self->timer_, self->deadline_, &self->on_timeout_);
+ } else {
+ if (resource_user != nullptr) {
+ grpc_resource_user_free(resource_user,
+ GRPC_RESOURCE_QUOTA_CHANNEL_SIZE);
+ }
+ }
}
- self->handshake_mgr_->RemoveFromPendingMgrList(
- &self->listener_->pending_handshake_mgrs_);
+ self->handshake_mgr_->RemoveFromPendingMgrList(
+ &self->listener_->pending_handshake_mgrs_);
}
- self->handshake_mgr_.reset();
- gpr_free(self->acceptor_);
- grpc_tcp_server_unref(self->listener_->tcp_server_);
- self->Unref();
+ self->handshake_mgr_.reset();
+ gpr_free(self->acceptor_);
+ grpc_tcp_server_unref(self->listener_->tcp_server_);
+ self->Unref();
}
-//
-// Chttp2ServerListener
-//
-
-grpc_error* Chttp2ServerListener::Create(Server* server, const char* addr,
- grpc_channel_args* args,
- int* port_num) {
- std::vector<grpc_error*> error_list;
- grpc_resolved_addresses* resolved = nullptr;
- Chttp2ServerListener* listener = nullptr;
- // The bulk of this method is inside of a lambda to make cleanup
- // easier without using goto.
- grpc_error* error = [&]() {
- *port_num = -1;
- /* resolve address */
- grpc_error* error = grpc_blocking_resolve_address(addr, "https", &resolved);
- if (error != GRPC_ERROR_NONE) return error;
- // Create Chttp2ServerListener.
- listener = new Chttp2ServerListener(server, args);
- error = grpc_tcp_server_create(&listener->tcp_server_shutdown_complete_,
- args, &listener->tcp_server_);
- if (error != GRPC_ERROR_NONE) return error;
- for (size_t i = 0; i < resolved->naddrs; i++) {
- int port_temp;
- error = grpc_tcp_server_add_port(listener->tcp_server_,
- &resolved->addrs[i], &port_temp);
- if (error != GRPC_ERROR_NONE) {
- error_list.push_back(error);
- } else {
- if (*port_num == -1) {
- *port_num = port_temp;
- } else {
- GPR_ASSERT(*port_num == port_temp);
- }
- }
- }
- if (error_list.size() == resolved->naddrs) {
- TString msg =
- y_absl::StrFormat("No address added out of total %" PRIuPTR " resolved",
- resolved->naddrs);
- return GRPC_ERROR_CREATE_REFERENCING_FROM_COPIED_STRING(
- msg.c_str(), error_list.data(), error_list.size());
- } else if (!error_list.empty()) {
- TString msg = y_absl::StrFormat(
- "Only %" PRIuPTR " addresses added out of total %" PRIuPTR
- " resolved",
- resolved->naddrs - error_list.size(), resolved->naddrs);
- error = GRPC_ERROR_CREATE_REFERENCING_FROM_COPIED_STRING(
- msg.c_str(), error_list.data(), error_list.size());
- gpr_log(GPR_INFO, "WARNING: %s", grpc_error_string(error));
- GRPC_ERROR_UNREF(error);
- /* we managed to bind some addresses: continue */
- }
- // Create channelz node.
- if (grpc_channel_args_find_bool(args, GRPC_ARG_ENABLE_CHANNELZ,
- GRPC_ENABLE_CHANNELZ_DEFAULT)) {
- listener->channelz_listen_socket_ =
- MakeRefCounted<channelz::ListenSocketNode>(
- addr, y_absl::StrFormat("chttp2 listener %s", addr));
- }
- /* Register with the server only upon success */
- server->AddListener(OrphanablePtr<Server::ListenerInterface>(listener));
- return GRPC_ERROR_NONE;
- }();
- if (resolved != nullptr) {
- grpc_resolved_addresses_destroy(resolved);
+//
+// Chttp2ServerListener
+//
+
+grpc_error* Chttp2ServerListener::Create(Server* server, const char* addr,
+ grpc_channel_args* args,
+ int* port_num) {
+ std::vector<grpc_error*> error_list;
+ grpc_resolved_addresses* resolved = nullptr;
+ Chttp2ServerListener* listener = nullptr;
+ // The bulk of this method is inside of a lambda to make cleanup
+ // easier without using goto.
+ grpc_error* error = [&]() {
+ *port_num = -1;
+ /* resolve address */
+ grpc_error* error = grpc_blocking_resolve_address(addr, "https", &resolved);
+ if (error != GRPC_ERROR_NONE) return error;
+ // Create Chttp2ServerListener.
+ listener = new Chttp2ServerListener(server, args);
+ error = grpc_tcp_server_create(&listener->tcp_server_shutdown_complete_,
+ args, &listener->tcp_server_);
+ if (error != GRPC_ERROR_NONE) return error;
+ for (size_t i = 0; i < resolved->naddrs; i++) {
+ int port_temp;
+ error = grpc_tcp_server_add_port(listener->tcp_server_,
+ &resolved->addrs[i], &port_temp);
+ if (error != GRPC_ERROR_NONE) {
+ error_list.push_back(error);
+ } else {
+ if (*port_num == -1) {
+ *port_num = port_temp;
+ } else {
+ GPR_ASSERT(*port_num == port_temp);
+ }
+ }
+ }
+ if (error_list.size() == resolved->naddrs) {
+ TString msg =
+ y_absl::StrFormat("No address added out of total %" PRIuPTR " resolved",
+ resolved->naddrs);
+ return GRPC_ERROR_CREATE_REFERENCING_FROM_COPIED_STRING(
+ msg.c_str(), error_list.data(), error_list.size());
+ } else if (!error_list.empty()) {
+ TString msg = y_absl::StrFormat(
+ "Only %" PRIuPTR " addresses added out of total %" PRIuPTR
+ " resolved",
+ resolved->naddrs - error_list.size(), resolved->naddrs);
+ error = GRPC_ERROR_CREATE_REFERENCING_FROM_COPIED_STRING(
+ msg.c_str(), error_list.data(), error_list.size());
+ gpr_log(GPR_INFO, "WARNING: %s", grpc_error_string(error));
+ GRPC_ERROR_UNREF(error);
+ /* we managed to bind some addresses: continue */
+ }
+ // Create channelz node.
+ if (grpc_channel_args_find_bool(args, GRPC_ARG_ENABLE_CHANNELZ,
+ GRPC_ENABLE_CHANNELZ_DEFAULT)) {
+ listener->channelz_listen_socket_ =
+ MakeRefCounted<channelz::ListenSocketNode>(
+ addr, y_absl::StrFormat("chttp2 listener %s", addr));
+ }
+ /* Register with the server only upon success */
+ server->AddListener(OrphanablePtr<Server::ListenerInterface>(listener));
+ return GRPC_ERROR_NONE;
+ }();
+ if (resolved != nullptr) {
+ grpc_resolved_addresses_destroy(resolved);
+ }
+ if (error != GRPC_ERROR_NONE) {
+ if (listener != nullptr) {
+ if (listener->tcp_server_ != nullptr) {
+ grpc_tcp_server_unref(listener->tcp_server_);
+ } else {
+ delete listener;
+ }
+ } else {
+ grpc_channel_args_destroy(args);
+ }
+ *port_num = 0;
+ }
+ for (grpc_error* error : error_list) {
+ GRPC_ERROR_UNREF(error);
+ }
+ return error;
+}
+
+grpc_error* Chttp2ServerListener::CreateWithAcceptor(Server* server,
+ const char* name,
+ grpc_channel_args* args) {
+ Chttp2ServerListener* listener = new Chttp2ServerListener(server, args);
+ grpc_error* error = grpc_tcp_server_create(
+ &listener->tcp_server_shutdown_complete_, args, &listener->tcp_server_);
+ if (error != GRPC_ERROR_NONE) {
+ delete listener;
+ return error;
+ }
+ // TODO(yangg) channelz
+ TcpServerFdHandler** arg_val =
+ grpc_channel_args_find_pointer<TcpServerFdHandler*>(args, name);
+ *arg_val = grpc_tcp_server_create_fd_handler(listener->tcp_server_);
+ server->AddListener(OrphanablePtr<Server::ListenerInterface>(listener));
+ return GRPC_ERROR_NONE;
+}
+
+Chttp2ServerListener::Chttp2ServerListener(Server* server,
+ grpc_channel_args* args)
+ : server_(server), args_(args) {
+ GRPC_CLOSURE_INIT(&tcp_server_shutdown_complete_, TcpServerShutdownComplete,
+ this, grpc_schedule_on_exec_ctx);
+}
+
+Chttp2ServerListener::~Chttp2ServerListener() {
+ grpc_channel_args_destroy(args_);
+}
+
+/* Server callback: start listening on our ports */
+void Chttp2ServerListener::Start(Server* /*server*/,
+ const std::vector<grpc_pollset*>* pollsets) {
+ {
+ MutexLock lock(&mu_);
+ shutdown_ = false;
}
- if (error != GRPC_ERROR_NONE) {
- if (listener != nullptr) {
- if (listener->tcp_server_ != nullptr) {
- grpc_tcp_server_unref(listener->tcp_server_);
- } else {
- delete listener;
- }
- } else {
- grpc_channel_args_destroy(args);
- }
- *port_num = 0;
- }
- for (grpc_error* error : error_list) {
- GRPC_ERROR_UNREF(error);
- }
- return error;
-}
-
-grpc_error* Chttp2ServerListener::CreateWithAcceptor(Server* server,
- const char* name,
- grpc_channel_args* args) {
- Chttp2ServerListener* listener = new Chttp2ServerListener(server, args);
- grpc_error* error = grpc_tcp_server_create(
- &listener->tcp_server_shutdown_complete_, args, &listener->tcp_server_);
- if (error != GRPC_ERROR_NONE) {
- delete listener;
- return error;
- }
- // TODO(yangg) channelz
- TcpServerFdHandler** arg_val =
- grpc_channel_args_find_pointer<TcpServerFdHandler*>(args, name);
- *arg_val = grpc_tcp_server_create_fd_handler(listener->tcp_server_);
- server->AddListener(OrphanablePtr<Server::ListenerInterface>(listener));
- return GRPC_ERROR_NONE;
-}
-
-Chttp2ServerListener::Chttp2ServerListener(Server* server,
- grpc_channel_args* args)
- : server_(server), args_(args) {
- GRPC_CLOSURE_INIT(&tcp_server_shutdown_complete_, TcpServerShutdownComplete,
- this, grpc_schedule_on_exec_ctx);
-}
-
-Chttp2ServerListener::~Chttp2ServerListener() {
- grpc_channel_args_destroy(args_);
-}
-
-/* Server callback: start listening on our ports */
-void Chttp2ServerListener::Start(Server* /*server*/,
- const std::vector<grpc_pollset*>* pollsets) {
- {
- MutexLock lock(&mu_);
- shutdown_ = false;
- }
- grpc_tcp_server_start(tcp_server_, pollsets, OnAccept, this);
-}
-
-void Chttp2ServerListener::SetOnDestroyDone(grpc_closure* on_destroy_done) {
- MutexLock lock(&mu_);
- on_destroy_done_ = on_destroy_done;
-}
-
-RefCountedPtr<HandshakeManager> Chttp2ServerListener::CreateHandshakeManager() {
- MutexLock lock(&mu_);
- if (shutdown_) return nullptr;
- grpc_resource_user* resource_user = server_->default_resource_user();
+ grpc_tcp_server_start(tcp_server_, pollsets, OnAccept, this);
+}
+
+void Chttp2ServerListener::SetOnDestroyDone(grpc_closure* on_destroy_done) {
+ MutexLock lock(&mu_);
+ on_destroy_done_ = on_destroy_done;
+}
+
+RefCountedPtr<HandshakeManager> Chttp2ServerListener::CreateHandshakeManager() {
+ MutexLock lock(&mu_);
+ if (shutdown_) return nullptr;
+ grpc_resource_user* resource_user = server_->default_resource_user();
if (resource_user != nullptr &&
!grpc_resource_user_safe_alloc(resource_user,
GRPC_RESOURCE_QUOTA_CHANNEL_SIZE)) {
- gpr_log(GPR_ERROR,
- "Memory quota exhausted, rejecting connection, no handshaking.");
- return nullptr;
- }
- auto handshake_mgr = MakeRefCounted<HandshakeManager>();
- handshake_mgr->AddToPendingMgrList(&pending_handshake_mgrs_);
- grpc_tcp_server_ref(tcp_server_); // Ref held by ConnectionState.
- return handshake_mgr;
-}
-
-void Chttp2ServerListener::OnAccept(void* arg, grpc_endpoint* tcp,
- grpc_pollset* accepting_pollset,
- grpc_tcp_server_acceptor* acceptor) {
- Chttp2ServerListener* self = static_cast<Chttp2ServerListener*>(arg);
- RefCountedPtr<HandshakeManager> handshake_mgr =
- self->CreateHandshakeManager();
- if (handshake_mgr == nullptr) {
+ gpr_log(GPR_ERROR,
+ "Memory quota exhausted, rejecting connection, no handshaking.");
+ return nullptr;
+ }
+ auto handshake_mgr = MakeRefCounted<HandshakeManager>();
+ handshake_mgr->AddToPendingMgrList(&pending_handshake_mgrs_);
+ grpc_tcp_server_ref(tcp_server_); // Ref held by ConnectionState.
+ return handshake_mgr;
+}
+
+void Chttp2ServerListener::OnAccept(void* arg, grpc_endpoint* tcp,
+ grpc_pollset* accepting_pollset,
+ grpc_tcp_server_acceptor* acceptor) {
+ Chttp2ServerListener* self = static_cast<Chttp2ServerListener*>(arg);
+ RefCountedPtr<HandshakeManager> handshake_mgr =
+ self->CreateHandshakeManager();
+ if (handshake_mgr == nullptr) {
grpc_endpoint_shutdown(tcp, GRPC_ERROR_NONE);
grpc_endpoint_destroy(tcp);
gpr_free(acceptor);
return;
}
- // Deletes itself when done.
- new ConnectionState(self, accepting_pollset, acceptor,
- std::move(handshake_mgr), self->args_, tcp);
+ // Deletes itself when done.
+ new ConnectionState(self, accepting_pollset, acceptor,
+ std::move(handshake_mgr), self->args_, tcp);
}
-void Chttp2ServerListener::TcpServerShutdownComplete(void* arg,
- grpc_error* error) {
- Chttp2ServerListener* self = static_cast<Chttp2ServerListener*>(arg);
+void Chttp2ServerListener::TcpServerShutdownComplete(void* arg,
+ grpc_error* error) {
+ Chttp2ServerListener* self = static_cast<Chttp2ServerListener*>(arg);
/* ensure all threads have unlocked */
- grpc_closure* destroy_done = nullptr;
- {
- MutexLock lock(&self->mu_);
- destroy_done = self->on_destroy_done_;
- GPR_ASSERT(self->shutdown_);
- if (self->pending_handshake_mgrs_ != nullptr) {
- self->pending_handshake_mgrs_->ShutdownAllPending(GRPC_ERROR_REF(error));
- }
- self->channelz_listen_socket_.reset();
+ grpc_closure* destroy_done = nullptr;
+ {
+ MutexLock lock(&self->mu_);
+ destroy_done = self->on_destroy_done_;
+ GPR_ASSERT(self->shutdown_);
+ if (self->pending_handshake_mgrs_ != nullptr) {
+ self->pending_handshake_mgrs_->ShutdownAllPending(GRPC_ERROR_REF(error));
+ }
+ self->channelz_listen_socket_.reset();
}
// Flush queued work before destroying handshaker factory, since that
// may do a synchronous unref.
- ExecCtx::Get()->Flush();
+ ExecCtx::Get()->Flush();
if (destroy_done != nullptr) {
- ExecCtx::Run(DEBUG_LOCATION, destroy_done, GRPC_ERROR_REF(error));
- ExecCtx::Get()->Flush();
+ ExecCtx::Run(DEBUG_LOCATION, destroy_done, GRPC_ERROR_REF(error));
+ ExecCtx::Get()->Flush();
}
- delete self;
+ delete self;
}
/* Server callback: destroy the tcp listener (so we don't generate further
callbacks) */
-void Chttp2ServerListener::Orphan() {
- grpc_tcp_server* tcp_server;
- {
- MutexLock lock(&mu_);
- shutdown_ = true;
- tcp_server = tcp_server_;
- }
+void Chttp2ServerListener::Orphan() {
+ grpc_tcp_server* tcp_server;
+ {
+ MutexLock lock(&mu_);
+ shutdown_ = true;
+ tcp_server = tcp_server_;
+ }
grpc_tcp_server_shutdown_listeners(tcp_server);
grpc_tcp_server_unref(tcp_server);
}
-} // namespace
+} // namespace
-//
-// Chttp2ServerAddPort()
-//
+//
+// Chttp2ServerAddPort()
+//
-grpc_error* Chttp2ServerAddPort(Server* server, const char* addr,
- grpc_channel_args* args, int* port_num) {
- if (strncmp(addr, "external:", 9) == 0) {
- return grpc_core::Chttp2ServerListener::CreateWithAcceptor(server, addr,
- args);
+grpc_error* Chttp2ServerAddPort(Server* server, const char* addr,
+ grpc_channel_args* args, int* port_num) {
+ if (strncmp(addr, "external:", 9) == 0) {
+ return grpc_core::Chttp2ServerListener::CreateWithAcceptor(server, addr,
+ args);
}
- return grpc_core::Chttp2ServerListener::Create(server, addr, args, port_num);
+ return grpc_core::Chttp2ServerListener::Create(server, addr, args, port_num);
}
-} // namespace grpc_core
+} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/ext/transport/chttp2/server/chttp2_server.h b/contrib/libs/grpc/src/core/ext/transport/chttp2/server/chttp2_server.h
index 92451a82129..095cc5e4c04 100644
--- a/contrib/libs/grpc/src/core/ext/transport/chttp2/server/chttp2_server.h
+++ b/contrib/libs/grpc/src/core/ext/transport/chttp2/server/chttp2_server.h
@@ -24,15 +24,15 @@
#include <grpc/impl/codegen/grpc_types.h>
#include "src/core/lib/iomgr/error.h"
-#include "src/core/lib/surface/server.h"
+#include "src/core/lib/surface/server.h"
+
+namespace grpc_core {
-namespace grpc_core {
-
/// Adds a port to \a server. Sets \a port_num to the port number.
/// Takes ownership of \a args.
-grpc_error* Chttp2ServerAddPort(Server* server, const char* addr,
- grpc_channel_args* args, int* port_num);
+grpc_error* Chttp2ServerAddPort(Server* server, const char* addr,
+ grpc_channel_args* args, int* port_num);
+
+} // namespace grpc_core
-} // namespace grpc_core
-
#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_SERVER_CHTTP2_SERVER_H */
diff --git a/contrib/libs/grpc/src/core/ext/transport/chttp2/server/insecure/server_chttp2.cc b/contrib/libs/grpc/src/core/ext/transport/chttp2/server/insecure/server_chttp2.cc
index 020ca7f5d69..eebae9efaa9 100644
--- a/contrib/libs/grpc/src/core/ext/transport/chttp2/server/insecure/server_chttp2.cc
+++ b/contrib/libs/grpc/src/core/ext/transport/chttp2/server/insecure/server_chttp2.cc
@@ -32,9 +32,9 @@ int grpc_server_add_insecure_http2_port(grpc_server* server, const char* addr) {
int port_num = 0;
GRPC_API_TRACE("grpc_server_add_insecure_http2_port(server=%p, addr=%s)", 2,
(server, addr));
- grpc_error* err = grpc_core::Chttp2ServerAddPort(
- server->core_server.get(), addr,
- grpc_channel_args_copy(server->core_server->channel_args()), &port_num);
+ grpc_error* err = grpc_core::Chttp2ServerAddPort(
+ server->core_server.get(), addr,
+ grpc_channel_args_copy(server->core_server->channel_args()), &port_num);
if (err != GRPC_ERROR_NONE) {
const char* msg = grpc_error_string(err);
gpr_log(GPR_ERROR, "%s", msg);
diff --git a/contrib/libs/grpc/src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc b/contrib/libs/grpc/src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc
index 395b35f62ac..33086bd6020 100644
--- a/contrib/libs/grpc/src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc
+++ b/contrib/libs/grpc/src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc
@@ -24,8 +24,8 @@
#ifdef GPR_SUPPORT_CHANNELS_FROM_FD
-#include "y_absl/strings/str_cat.h"
-
+#include "y_absl/strings/str_cat.h"
+
#include <grpc/support/alloc.h>
#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
@@ -41,21 +41,21 @@ void grpc_server_add_insecure_channel_from_fd(grpc_server* server,
GPR_ASSERT(reserved == nullptr);
grpc_core::ExecCtx exec_ctx;
- grpc_core::Server* core_server = server->core_server.get();
+ grpc_core::Server* core_server = server->core_server.get();
- const grpc_channel_args* server_args = core_server->channel_args();
- TString name = y_absl::StrCat("fd:", fd);
- grpc_endpoint* server_endpoint = grpc_tcp_create(
- grpc_fd_create(fd, name.c_str(), true), server_args, name.c_str());
+ const grpc_channel_args* server_args = core_server->channel_args();
+ TString name = y_absl::StrCat("fd:", fd);
+ grpc_endpoint* server_endpoint = grpc_tcp_create(
+ grpc_fd_create(fd, name.c_str(), true), server_args, name.c_str());
grpc_transport* transport = grpc_create_chttp2_transport(
server_args, server_endpoint, false /* is_client */);
- for (grpc_pollset* pollset : core_server->pollsets()) {
- grpc_endpoint_add_to_pollset(server_endpoint, pollset);
+ for (grpc_pollset* pollset : core_server->pollsets()) {
+ grpc_endpoint_add_to_pollset(server_endpoint, pollset);
}
- core_server->SetupTransport(transport, nullptr, server_args, nullptr);
+ core_server->SetupTransport(transport, nullptr, server_args, nullptr);
grpc_chttp2_transport_start_reading(transport, nullptr, nullptr);
}
diff --git a/contrib/libs/grpc/src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.cc b/contrib/libs/grpc/src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.cc
index 6034b713a9e..c49e1511a57 100644
--- a/contrib/libs/grpc/src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.cc
+++ b/contrib/libs/grpc/src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.cc
@@ -22,8 +22,8 @@
#include <string.h>
-#include "y_absl/strings/str_cat.h"
-
+#include "y_absl/strings/str_cat.h"
+
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
@@ -57,10 +57,10 @@ int grpc_server_add_secure_http2_port(grpc_server* server, const char* addr,
}
sc = creds->create_security_connector();
if (sc == nullptr) {
- err = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("Unable to create secure server with credentials of type ",
- creds->type())
- .c_str());
+ err = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrCat("Unable to create secure server with credentials of type ",
+ creds->type())
+ .c_str());
goto done;
}
// Create channel args.
@@ -68,11 +68,11 @@ int grpc_server_add_secure_http2_port(grpc_server* server, const char* addr,
args_to_add[0] = grpc_server_credentials_to_arg(creds);
args_to_add[1] = grpc_security_connector_to_arg(sc.get());
args =
- grpc_channel_args_copy_and_add(server->core_server->channel_args(),
+ grpc_channel_args_copy_and_add(server->core_server->channel_args(),
args_to_add, GPR_ARRAY_SIZE(args_to_add));
// Add server port.
- err = grpc_core::Chttp2ServerAddPort(server->core_server.get(), addr, args,
- &port_num);
+ err = grpc_core::Chttp2ServerAddPort(server->core_server.get(), addr, args,
+ &port_num);
done:
sc.reset(DEBUG_LOCATION, "server");
diff --git a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/chttp2_transport.cc b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/chttp2_transport.cc
index d04ad3c5111..180ca625435 100644
--- a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/chttp2_transport.cc
+++ b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/chttp2_transport.cc
@@ -1,30 +1,30 @@
-//
-// Copyright 2018 gRPC authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
+//
+// Copyright 2018 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
#include <grpc/support/port_platform.h>
#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
-#include "y_absl/strings/str_format.h"
-
-#include <grpc/slice_buffer.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/port_platform.h>
-#include <grpc/support/string_util.h>
+#include "y_absl/strings/str_format.h"
+
+#include <grpc/slice_buffer.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/port_platform.h>
+#include <grpc/support/string_util.h>
#include <inttypes.h>
#include <limits.h>
#include <math.h>
@@ -98,11 +98,11 @@ static int g_default_max_ping_strikes = DEFAULT_MAX_PING_STRIKES;
#define MAX_CLIENT_STREAM_ID 0x7fffffffu
grpc_core::TraceFlag grpc_http_trace(false, "http");
-grpc_core::TraceFlag grpc_keepalive_trace(false, "http_keepalive");
+grpc_core::TraceFlag grpc_keepalive_trace(false, "http_keepalive");
grpc_core::DebugOnlyTraceFlag grpc_trace_chttp2_refcount(false,
"chttp2_refcount");
-// forward declarations of various callbacks that we'll build closures around
+// forward declarations of various callbacks that we'll build closures around
static void write_action_begin_locked(void* t, grpc_error* error);
static void write_action(void* t, grpc_error* error);
static void write_action_end(void* t, grpc_error* error);
@@ -114,19 +114,19 @@ static void continue_read_action_locked(grpc_chttp2_transport* t);
static void complete_fetch(void* gs, grpc_error* error);
static void complete_fetch_locked(void* gs, grpc_error* error);
-// Set a transport level setting, and push it to our peer
+// Set a transport level setting, and push it to our peer
static void queue_setting_update(grpc_chttp2_transport* t,
grpc_chttp2_setting_id id, uint32_t value);
static void close_from_api(grpc_chttp2_transport* t, grpc_chttp2_stream* s,
grpc_error* error);
-// Start new streams that have been created if we can
+// Start new streams that have been created if we can
static void maybe_start_some_streams(grpc_chttp2_transport* t);
static void connectivity_state_set(grpc_chttp2_transport* t,
grpc_connectivity_state state,
- const y_absl::Status& status,
+ const y_absl::Status& status,
const char* reason);
static void benign_reclaimer(void* t, grpc_error* error);
@@ -153,7 +153,7 @@ static void send_ping_locked(grpc_chttp2_transport* t,
grpc_closure* on_complete);
static void retry_initiate_ping_locked(void* tp, grpc_error* error);
-// keepalive-relevant functions
+// keepalive-relevant functions
static void init_keepalive_ping(void* arg, grpc_error* error);
static void init_keepalive_ping_locked(void* arg, grpc_error* error);
static void start_keepalive_ping(void* arg, grpc_error* error);
@@ -169,9 +169,9 @@ static void reset_byte_stream(void* arg, grpc_error* error);
// GRPC_EXPERIMENTAL_DISABLE_FLOW_CONTROL
bool g_flow_control_enabled = true;
-//
-// CONSTRUCTION/DESTRUCTION/REFCOUNTING
-//
+//
+// CONSTRUCTION/DESTRUCTION/REFCOUNTING
+//
grpc_chttp2_transport::~grpc_chttp2_transport() {
size_t i;
@@ -229,7 +229,7 @@ grpc_chttp2_transport::~grpc_chttp2_transport() {
static const grpc_transport_vtable* get_vtable(void);
-// Returns whether bdp is enabled
+// Returns whether bdp is enabled
static bool read_channel_args(grpc_chttp2_transport* t,
const grpc_channel_args* channel_args,
bool is_client) {
@@ -378,8 +378,8 @@ static bool read_channel_args(grpc_chttp2_transport* t,
if (channelz_enabled) {
t->channelz_socket =
grpc_core::MakeRefCounted<grpc_core::channelz::SocketNode>(
- TString(grpc_endpoint_get_local_address(t->ep)), t->peer_string,
- y_absl::StrFormat("%s %s", get_vtable()->name, t->peer_string));
+ TString(grpc_endpoint_get_local_address(t->ep)), t->peer_string,
+ y_absl::StrFormat("%s %s", get_vtable()->name, t->peer_string));
}
return enable_bdp;
}
@@ -425,8 +425,8 @@ static void init_keepalive_pings_if_enabled(grpc_chttp2_transport* t) {
grpc_core::ExecCtx::Get()->Now() + t->keepalive_time,
&t->init_keepalive_ping_locked);
} else {
- // Use GRPC_CHTTP2_KEEPALIVE_STATE_DISABLED to indicate there are no
- // inflight keeaplive timers
+ // Use GRPC_CHTTP2_KEEPALIVE_STATE_DISABLED to indicate there are no
+ // inflight keeaplive timers
t->keepalive_state = GRPC_CHTTP2_KEEPALIVE_STATE_DISABLED;
}
}
@@ -447,11 +447,11 @@ grpc_chttp2_transport::grpc_chttp2_transport(
GPR_ASSERT(strlen(GRPC_CHTTP2_CLIENT_CONNECT_STRING) ==
GRPC_CHTTP2_CLIENT_CONNECT_STRLEN);
base.vtable = get_vtable();
- // 8 is a random stab in the dark as to a good initial size: it's small enough
- // that it shouldn't waste memory for infrequently used connections, yet
- // large enough that the exponential growth should happen nicely when it's
- // needed.
- // TODO(ctiller): tune this
+ // 8 is a random stab in the dark as to a good initial size: it's small enough
+ // that it shouldn't waste memory for infrequently used connections, yet
+ // large enough that the exponential growth should happen nicely when it's
+ // needed.
+ // TODO(ctiller): tune this
grpc_chttp2_stream_map_init(&stream_map, 8);
grpc_slice_buffer_init(&read_buffer);
@@ -462,7 +462,7 @@ grpc_chttp2_transport::grpc_chttp2_transport(
}
grpc_chttp2_hpack_compressor_init(&hpack_compressor);
grpc_slice_buffer_init(&qbuf);
- // copy in initial settings to all setting sets
+ // copy in initial settings to all setting sets
size_t i;
int j;
for (i = 0; i < GRPC_CHTTP2_NUM_SETTINGS; i++) {
@@ -473,7 +473,7 @@ grpc_chttp2_transport::grpc_chttp2_transport(
grpc_chttp2_hpack_parser_init(&hpack_parser);
grpc_chttp2_goaway_parser_init(&goaway_parser);
- // configure http2 the way we like it
+ // configure http2 the way we like it
if (is_client) {
queue_setting_update(this, GRPC_CHTTP2_SETTINGS_ENABLE_PUSH, 0);
queue_setting_update(this, GRPC_CHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS, 0);
@@ -499,7 +499,7 @@ grpc_chttp2_transport::grpc_chttp2_transport(
enable_bdp = false;
}
- // No pings allowed before receiving a header or data frame.
+ // No pings allowed before receiving a header or data frame.
ping_state.pings_before_data_required = 0;
ping_state.is_delayed_ping_timer_set = false;
ping_state.last_ping_sent_time = GRPC_MILLIS_INF_PAST;
@@ -510,7 +510,7 @@ grpc_chttp2_transport::grpc_chttp2_transport(
init_keepalive_pings_if_enabled(this);
if (enable_bdp) {
- bdp_ping_blocked = true;
+ bdp_ping_blocked = true;
grpc_chttp2_act_on_flowctl_action(flow_control->PeriodicUpdate(), this,
nullptr);
}
@@ -557,8 +557,8 @@ static void close_transport_locked(grpc_chttp2_transport* t,
}
GPR_ASSERT(error != GRPC_ERROR_NONE);
t->closed_with_error = GRPC_ERROR_REF(error);
- connectivity_state_set(t, GRPC_CHANNEL_SHUTDOWN, y_absl::Status(),
- "close_transport");
+ connectivity_state_set(t, GRPC_CHANNEL_SHUTDOWN, y_absl::Status(),
+ "close_transport");
if (t->ping_state.is_delayed_ping_timer_set) {
grpc_timer_cancel(&t->ping_state.delayed_ping_timer);
}
@@ -575,11 +575,11 @@ static void close_transport_locked(grpc_chttp2_transport* t,
break;
case GRPC_CHTTP2_KEEPALIVE_STATE_DYING:
case GRPC_CHTTP2_KEEPALIVE_STATE_DISABLED:
- // keepalive timers are not set in these two states
+ // keepalive timers are not set in these two states
break;
}
- // flush writable stream list to avoid dangling references
+ // flush writable stream list to avoid dangling references
grpc_chttp2_stream* s;
while (grpc_chttp2_list_pop_writable_stream(t, &s)) {
GRPC_CHTTP2_STREAM_UNREF(s, "chttp2_writing:close");
@@ -589,7 +589,7 @@ static void close_transport_locked(grpc_chttp2_transport* t,
}
if (t->notify_on_receive_settings != nullptr) {
grpc_core::ExecCtx::Run(DEBUG_LOCATION, t->notify_on_receive_settings,
- GRPC_ERROR_REF(error));
+ GRPC_ERROR_REF(error));
t->notify_on_receive_settings = nullptr;
}
GRPC_ERROR_UNREF(error);
@@ -612,9 +612,9 @@ void grpc_chttp2_stream_unref(grpc_chttp2_stream* s) {
#endif
grpc_chttp2_stream::Reffer::Reffer(grpc_chttp2_stream* s) {
- // We reserve one 'active stream' that's dropped when the stream is
- // read-closed. The others are for Chttp2IncomingByteStreams that are
- // actively reading
+ // We reserve one 'active stream' that's dropped when the stream is
+ // read-closed. The others are for Chttp2IncomingByteStreams that are
+ // actively reading
GRPC_CHTTP2_STREAM_REF(s, "chttp2");
GRPC_CHTTP2_REF_TRANSPORT(s->t, "stream");
}
@@ -767,9 +767,9 @@ grpc_chttp2_stream* grpc_chttp2_parsing_accept_stream(grpc_chttp2_transport* t,
return accepting;
}
-//
-// OUTPUT PROCESSING
-//
+//
+// OUTPUT PROCESSING
+//
static const char* write_state_name(grpc_chttp2_write_state st) {
switch (st) {
@@ -787,15 +787,15 @@ static void set_write_state(grpc_chttp2_transport* t,
grpc_chttp2_write_state st, const char* reason) {
GRPC_CHTTP2_IF_TRACING(
gpr_log(GPR_INFO, "W:%p %s [%s] state %s -> %s [%s]", t,
- t->is_client ? "CLIENT" : "SERVER", t->peer_string.c_str(),
+ t->is_client ? "CLIENT" : "SERVER", t->peer_string.c_str(),
write_state_name(t->write_state), write_state_name(st), reason));
t->write_state = st;
- // If the state is being reset back to idle, it means a write was just
- // finished. Make sure all the run_after_write closures are scheduled.
- //
- // This is also our chance to close the transport if the transport was marked
- // to be closed after all writes finish (for example, if we received a go-away
- // from peer while we had some pending writes)
+ // If the state is being reset back to idle, it means a write was just
+ // finished. Make sure all the run_after_write closures are scheduled.
+ //
+ // This is also our chance to close the transport if the transport was marked
+ // to be closed after all writes finish (for example, if we received a go-away
+ // from peer while we had some pending writes)
if (st == GRPC_CHTTP2_WRITE_STATE_IDLE) {
grpc_core::ExecCtx::RunList(DEBUG_LOCATION, &t->run_after_write);
if (t->close_transport_on_writes_finished != nullptr) {
@@ -857,9 +857,9 @@ static void inc_initiate_write_reason(
case GRPC_CHTTP2_INITIATE_WRITE_APPLICATION_PING:
GRPC_STATS_INC_HTTP2_INITIATE_WRITE_DUE_TO_APPLICATION_PING();
break;
- case GRPC_CHTTP2_INITIATE_WRITE_BDP_PING:
- GRPC_STATS_INC_HTTP2_INITIATE_WRITE_DUE_TO_BDP_ESTIMATOR_PING();
- break;
+ case GRPC_CHTTP2_INITIATE_WRITE_BDP_PING:
+ GRPC_STATS_INC_HTTP2_INITIATE_WRITE_DUE_TO_BDP_ESTIMATOR_PING();
+ break;
case GRPC_CHTTP2_INITIATE_WRITE_KEEPALIVE_PING:
GRPC_STATS_INC_HTTP2_INITIATE_WRITE_DUE_TO_KEEPALIVE_PING();
break;
@@ -885,22 +885,22 @@ void grpc_chttp2_initiate_write(grpc_chttp2_transport* t,
set_write_state(t, GRPC_CHTTP2_WRITE_STATE_WRITING,
grpc_chttp2_initiate_write_reason_string(reason));
GRPC_CHTTP2_REF_TRANSPORT(t, "writing");
- // Note that the 'write_action_begin_locked' closure is being scheduled
- // on the 'finally_scheduler' of t->combiner. This means that
- // 'write_action_begin_locked' is called only *after* all the other
- // closures (some of which are potentially initiating more writes on the
- // transport) are executed on the t->combiner.
- //
- // The reason for scheduling on finally_scheduler is to make sure we batch
- // as many writes as possible. 'write_action_begin_locked' is the function
- // that gathers all the relevant bytes (which are at various places in the
- // grpc_chttp2_transport structure) and append them to 'outbuf' field in
- // grpc_chttp2_transport thereby batching what would have been potentially
- // multiple write operations.
- //
- // Also, 'write_action_begin_locked' only gathers the bytes into outbuf.
- // It does not call the endpoint to write the bytes. That is done by the
- // 'write_action' (which is scheduled by 'write_action_begin_locked')
+ // Note that the 'write_action_begin_locked' closure is being scheduled
+ // on the 'finally_scheduler' of t->combiner. This means that
+ // 'write_action_begin_locked' is called only *after* all the other
+ // closures (some of which are potentially initiating more writes on the
+ // transport) are executed on the t->combiner.
+ //
+ // The reason for scheduling on finally_scheduler is to make sure we batch
+ // as many writes as possible. 'write_action_begin_locked' is the function
+ // that gathers all the relevant bytes (which are at various places in the
+ // grpc_chttp2_transport structure) and append them to 'outbuf' field in
+ // grpc_chttp2_transport thereby batching what would have been potentially
+ // multiple write operations.
+ //
+ // Also, 'write_action_begin_locked' only gathers the bytes into outbuf.
+ // It does not call the endpoint to write the bytes. That is done by the
+ // 'write_action' (which is scheduled by 'write_action_begin_locked')
t->combiner->FinallyRun(
GRPC_CLOSURE_INIT(&t->write_action_begin_locked,
write_action_begin_locked, t, nullptr),
@@ -952,9 +952,9 @@ static void write_action_begin_locked(void* gt, grpc_error* /*error_ignored*/) {
write_action(t, GRPC_ERROR_NONE);
if (t->reading_paused_on_pending_induced_frames) {
GPR_ASSERT(t->num_pending_induced_frames == 0);
- // We had paused reading, because we had many induced frames (SETTINGS
- // ACK, PINGS ACK and RST_STREAMS) pending in t->qbuf. Now that we have
- // been able to flush qbuf, we can resume reading.
+ // We had paused reading, because we had many induced frames (SETTINGS
+ // ACK, PINGS ACK and RST_STREAMS) pending in t->qbuf. Now that we have
+ // been able to flush qbuf, we can resume reading.
GRPC_CHTTP2_IF_TRACING(gpr_log(
GPR_INFO,
"transport %p : Resuming reading after being paused due to too "
@@ -989,8 +989,8 @@ static void write_action_end(void* tp, grpc_error* error) {
GRPC_ERROR_REF(error));
}
-// Callback from the grpc_endpoint after bytes have been written by calling
-// sendmsg
+// Callback from the grpc_endpoint after bytes have been written by calling
+// sendmsg
static void write_action_end_locked(void* tp, grpc_error* error) {
GPR_TIMER_SCOPE("terminate_writing_with_lock", 0);
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(tp);
@@ -1076,17 +1076,17 @@ void grpc_chttp2_add_incoming_goaway(grpc_chttp2_transport* t,
GRPC_CHTTP2_IF_TRACING(
gpr_log(GPR_INFO, "transport %p got goaway with last stream id %d", t,
last_stream_id));
- // We want to log this irrespective of whether http tracing is enabled if we
- // received a GOAWAY with a non NO_ERROR code.
+ // We want to log this irrespective of whether http tracing is enabled if we
+ // received a GOAWAY with a non NO_ERROR code.
if (goaway_error != GRPC_HTTP2_NO_ERROR) {
- gpr_log(GPR_INFO, "%s: Got goaway [%d] err=%s", t->peer_string.c_str(),
+ gpr_log(GPR_INFO, "%s: Got goaway [%d] err=%s", t->peer_string.c_str(),
goaway_error, grpc_error_string(t->goaway_error));
}
- y_absl::Status status = grpc_error_to_absl_status(t->goaway_error);
- // When a client receives a GOAWAY with error code ENHANCE_YOUR_CALM and debug
- // data equal to "too_many_pings", it should log the occurrence at a log level
- // that is enabled by default and double the configured KEEPALIVE_TIME used
- // for new connections on that channel.
+ y_absl::Status status = grpc_error_to_absl_status(t->goaway_error);
+ // When a client receives a GOAWAY with error code ENHANCE_YOUR_CALM and debug
+ // data equal to "too_many_pings", it should log the occurrence at a log level
+ // that is enabled by default and double the configured KEEPALIVE_TIME used
+ // for new connections on that channel.
if (GPR_UNLIKELY(t->is_client &&
goaway_error == GRPC_HTTP2_ENHANCE_YOUR_CALM &&
grpc_slice_str_cmp(goaway_text, "too_many_pings") == 0)) {
@@ -1094,25 +1094,25 @@ void grpc_chttp2_add_incoming_goaway(grpc_chttp2_transport* t,
"Received a GOAWAY with error code ENHANCE_YOUR_CALM and debug "
"data equal to \"too_many_pings\"");
double current_keepalive_time_ms = static_cast<double>(t->keepalive_time);
- constexpr int max_keepalive_time_ms =
- INT_MAX / KEEPALIVE_TIME_BACKOFF_MULTIPLIER;
+ constexpr int max_keepalive_time_ms =
+ INT_MAX / KEEPALIVE_TIME_BACKOFF_MULTIPLIER;
t->keepalive_time =
- current_keepalive_time_ms > static_cast<double>(max_keepalive_time_ms)
+ current_keepalive_time_ms > static_cast<double>(max_keepalive_time_ms)
? GRPC_MILLIS_INF_FUTURE
: static_cast<grpc_millis>(current_keepalive_time_ms *
KEEPALIVE_TIME_BACKOFF_MULTIPLIER);
- status.SetPayload(grpc_core::kKeepaliveThrottlingKey,
- y_absl::Cord(ToString(t->keepalive_time)));
+ status.SetPayload(grpc_core::kKeepaliveThrottlingKey,
+ y_absl::Cord(ToString(t->keepalive_time)));
}
- // lie: use transient failure from the transport to indicate goaway has been
- // received.
- connectivity_state_set(t, GRPC_CHANNEL_TRANSIENT_FAILURE, status,
- "got_goaway");
+ // lie: use transient failure from the transport to indicate goaway has been
+ // received.
+ connectivity_state_set(t, GRPC_CHANNEL_TRANSIENT_FAILURE, status,
+ "got_goaway");
}
static void maybe_start_some_streams(grpc_chttp2_transport* t) {
grpc_chttp2_stream* s;
- // cancel out streams that haven't yet started if we have received a GOAWAY
+ // cancel out streams that haven't yet started if we have received a GOAWAY
if (t->goaway_error != GRPC_ERROR_NONE) {
while (grpc_chttp2_list_pop_waiting_for_concurrency(t, &s)) {
grpc_chttp2_cancel_stream(
@@ -1123,14 +1123,14 @@ static void maybe_start_some_streams(grpc_chttp2_transport* t) {
}
return;
}
- // start streams where we have free grpc_chttp2_stream ids and free
- // * concurrency
+ // start streams where we have free grpc_chttp2_stream ids and free
+ // * concurrency
while (t->next_stream_id <= MAX_CLIENT_STREAM_ID &&
grpc_chttp2_stream_map_size(&t->stream_map) <
t->settings[GRPC_PEER_SETTINGS]
[GRPC_CHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS] &&
grpc_chttp2_list_pop_waiting_for_concurrency(t, &s)) {
- // safe since we can't (legally) be parsing this stream yet
+ // safe since we can't (legally) be parsing this stream yet
GRPC_CHTTP2_IF_TRACING(gpr_log(
GPR_INFO,
"HTTP:%s: Transport %p allocating new grpc_chttp2_stream %p to id %d",
@@ -1142,8 +1142,8 @@ static void maybe_start_some_streams(grpc_chttp2_transport* t) {
if (t->next_stream_id >= MAX_CLIENT_STREAM_ID) {
connectivity_state_set(t, GRPC_CHANNEL_TRANSIENT_FAILURE,
- y_absl::Status(y_absl::StatusCode::kUnavailable,
- "Transport Stream IDs exhausted"),
+ y_absl::Status(y_absl::StatusCode::kUnavailable,
+ "Transport Stream IDs exhausted"),
"no_more_stream_ids");
}
@@ -1152,7 +1152,7 @@ static void maybe_start_some_streams(grpc_chttp2_transport* t) {
grpc_chttp2_mark_stream_writable(t, s);
grpc_chttp2_initiate_write(t, GRPC_CHTTP2_INITIATE_WRITE_START_NEW_STREAM);
}
- // cancel out streams that will never be started
+ // cancel out streams that will never be started
if (t->next_stream_id >= MAX_CLIENT_STREAM_ID) {
while (grpc_chttp2_list_pop_waiting_for_concurrency(t, &s)) {
grpc_chttp2_cancel_stream(
@@ -1164,12 +1164,12 @@ static void maybe_start_some_streams(grpc_chttp2_transport* t) {
}
}
-// Flag that this closure barrier may be covering a write in a pollset, and so
-// we should not complete this closure until we can prove that the write got
-// scheduled
+// Flag that this closure barrier may be covering a write in a pollset, and so
+// we should not complete this closure until we can prove that the write got
+// scheduled
#define CLOSURE_BARRIER_MAY_COVER_WRITE (1 << 0)
-// First bit of the reference count, stored in the high order bits (with the low
-// bits being used for flags defined above)
+// First bit of the reference count, stored in the high order bits (with the low
+// bits being used for flags defined above)
#define CLOSURE_BARRIER_FIRST_REF_BIT (1 << 16)
static grpc_closure* add_closure_barrier(grpc_closure* closure) {
@@ -1213,7 +1213,7 @@ void grpc_chttp2_complete_closure_step(grpc_chttp2_transport* t,
"Error in HTTP transport completing operation");
closure->error_data.error = grpc_error_set_str(
closure->error_data.error, GRPC_ERROR_STR_TARGET_ADDRESS,
- grpc_slice_from_copied_string(t->peer_string.c_str()));
+ grpc_slice_from_copied_string(t->peer_string.c_str()));
}
closure->error_data.error =
grpc_error_add_child(closure->error_data.error, error);
@@ -1261,7 +1261,7 @@ static void continue_fetching_send_locked(grpc_chttp2_transport* t,
grpc_chttp2_stream* s) {
for (;;) {
if (s->fetching_send_message == nullptr) {
- // Stream was cancelled before message fetch completed
+ // Stream was cancelled before message fetch completed
abort(); /* TODO(ctiller): what cleanup here? */
return; /* early out */
}
@@ -1357,8 +1357,8 @@ static void perform_stream_op_locked(void* stream_op,
s->context = op->payload->context;
s->traced = op->is_traced;
if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace)) {
- gpr_log(GPR_INFO, "perform_stream_op_locked: %s; on_complete = %p",
- grpc_transport_stream_op_batch_string(op).c_str(), op->on_complete);
+ gpr_log(GPR_INFO, "perform_stream_op_locked: %s; on_complete = %p",
+ grpc_transport_stream_op_batch_string(op).c_str(), op->on_complete);
if (op->send_initial_metadata) {
log_metadata(op_payload->send_initial_metadata.send_initial_metadata,
s->id, t->is_client, true);
@@ -1391,7 +1391,7 @@ static void perform_stream_op_locked(void* stream_op,
GPR_ASSERT(s->send_initial_metadata_finished == nullptr);
on_complete->next_data.scratch |= CLOSURE_BARRIER_MAY_COVER_WRITE;
- // Identify stream compression
+ // Identify stream compression
if (op_payload->send_initial_metadata.send_initial_metadata->idx.named
.content_encoding == nullptr ||
grpc_stream_compression_method_parse(
@@ -1413,45 +1413,45 @@ static void perform_stream_op_locked(void* stream_op,
if (t->is_client) {
s->deadline = GPR_MIN(s->deadline, s->send_initial_metadata->deadline);
}
- if (contains_non_ok_status(s->send_initial_metadata)) {
- s->seen_error = true;
- }
- if (!s->write_closed) {
- if (t->is_client) {
- if (t->closed_with_error == GRPC_ERROR_NONE) {
- GPR_ASSERT(s->id == 0);
- grpc_chttp2_list_add_waiting_for_concurrency(t, s);
- maybe_start_some_streams(t);
- } else {
- grpc_chttp2_cancel_stream(
- t, s,
+ if (contains_non_ok_status(s->send_initial_metadata)) {
+ s->seen_error = true;
+ }
+ if (!s->write_closed) {
+ if (t->is_client) {
+ if (t->closed_with_error == GRPC_ERROR_NONE) {
+ GPR_ASSERT(s->id == 0);
+ grpc_chttp2_list_add_waiting_for_concurrency(t, s);
+ maybe_start_some_streams(t);
+ } else {
+ grpc_chttp2_cancel_stream(
+ t, s,
grpc_error_set_int(
- GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
- "Transport closed", &t->closed_with_error, 1),
- GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE));
+ GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
+ "Transport closed", &t->closed_with_error, 1),
+ GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE));
}
} else {
- GPR_ASSERT(s->id != 0);
- grpc_chttp2_mark_stream_writable(t, s);
- if (!(op->send_message &&
- (op->payload->send_message.send_message->flags() &
- GRPC_WRITE_BUFFER_HINT))) {
- grpc_chttp2_initiate_write(
- t, GRPC_CHTTP2_INITIATE_WRITE_SEND_INITIAL_METADATA);
- }
+ GPR_ASSERT(s->id != 0);
+ grpc_chttp2_mark_stream_writable(t, s);
+ if (!(op->send_message &&
+ (op->payload->send_message.send_message->flags() &
+ GRPC_WRITE_BUFFER_HINT))) {
+ grpc_chttp2_initiate_write(
+ t, GRPC_CHTTP2_INITIATE_WRITE_SEND_INITIAL_METADATA);
+ }
}
- } else {
- s->send_initial_metadata = nullptr;
- grpc_chttp2_complete_closure_step(
- t, s, &s->send_initial_metadata_finished,
- GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
- "Attempt to send initial metadata after stream was closed",
- &s->write_closed_error, 1),
- "send_initial_metadata_finished");
+ } else {
+ s->send_initial_metadata = nullptr;
+ grpc_chttp2_complete_closure_step(
+ t, s, &s->send_initial_metadata_finished,
+ GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
+ "Attempt to send initial metadata after stream was closed",
+ &s->write_closed_error, 1),
+ "send_initial_metadata_finished");
}
if (op_payload->send_initial_metadata.peer_string != nullptr) {
gpr_atm_rel_store(op_payload->send_initial_metadata.peer_string,
- (gpr_atm)t->peer_string.c_str());
+ (gpr_atm)t->peer_string.c_str());
}
}
@@ -1507,30 +1507,30 @@ static void perform_stream_op_locked(void* stream_op,
s->send_trailing_metadata_finished = add_closure_barrier(on_complete);
s->send_trailing_metadata =
op_payload->send_trailing_metadata.send_trailing_metadata;
- s->sent_trailing_metadata_op = op_payload->send_trailing_metadata.sent;
+ s->sent_trailing_metadata_op = op_payload->send_trailing_metadata.sent;
s->write_buffering = false;
- if (contains_non_ok_status(s->send_trailing_metadata)) {
- s->seen_error = true;
- }
- if (s->write_closed) {
- s->send_trailing_metadata = nullptr;
- s->sent_trailing_metadata_op = nullptr;
- grpc_chttp2_complete_closure_step(
- t, s, &s->send_trailing_metadata_finished,
- grpc_metadata_batch_is_empty(
- op->payload->send_trailing_metadata.send_trailing_metadata)
- ? GRPC_ERROR_NONE
- : GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "Attempt to send trailing metadata after "
- "stream was closed"),
- "send_trailing_metadata_finished");
- } else if (s->id != 0) {
- // TODO(ctiller): check if there's flow control for any outstanding
- // bytes before going writable
- grpc_chttp2_mark_stream_writable(t, s);
- grpc_chttp2_initiate_write(
- t, GRPC_CHTTP2_INITIATE_WRITE_SEND_TRAILING_METADATA);
- }
+ if (contains_non_ok_status(s->send_trailing_metadata)) {
+ s->seen_error = true;
+ }
+ if (s->write_closed) {
+ s->send_trailing_metadata = nullptr;
+ s->sent_trailing_metadata_op = nullptr;
+ grpc_chttp2_complete_closure_step(
+ t, s, &s->send_trailing_metadata_finished,
+ grpc_metadata_batch_is_empty(
+ op->payload->send_trailing_metadata.send_trailing_metadata)
+ ? GRPC_ERROR_NONE
+ : GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Attempt to send trailing metadata after "
+ "stream was closed"),
+ "send_trailing_metadata_finished");
+ } else if (s->id != 0) {
+ // TODO(ctiller): check if there's flow control for any outstanding
+ // bytes before going writable
+ grpc_chttp2_mark_stream_writable(t, s);
+ grpc_chttp2_initiate_write(
+ t, GRPC_CHTTP2_INITIATE_WRITE_SEND_TRAILING_METADATA);
+ }
}
if (op->recv_initial_metadata) {
@@ -1544,7 +1544,7 @@ static void perform_stream_op_locked(void* stream_op,
op_payload->recv_initial_metadata.trailing_metadata_available;
if (op_payload->recv_initial_metadata.peer_string != nullptr) {
gpr_atm_rel_store(op_payload->recv_initial_metadata.peer_string,
- (gpr_atm)t->peer_string.c_str());
+ (gpr_atm)t->peer_string.c_str());
}
grpc_chttp2_maybe_complete_recv_initial_metadata(t, s);
}
@@ -1615,8 +1615,8 @@ static void perform_stream_op(grpc_transport* gt, grpc_stream* gs,
}
if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace)) {
- gpr_log(GPR_INFO, "perform_stream_op[s=%p]: %s", s,
- grpc_transport_stream_op_batch_string(op).c_str());
+ gpr_log(GPR_INFO, "perform_stream_op[s=%p]: %s", s,
+ grpc_transport_stream_op_batch_string(op).c_str());
}
GRPC_CHTTP2_STREAM_REF(s, "perform_stream_op");
@@ -1627,8 +1627,8 @@ static void perform_stream_op(grpc_transport* gt, grpc_stream* gs,
}
static void cancel_pings(grpc_chttp2_transport* t, grpc_error* error) {
- // callback remaining pings: they're not allowed to call into the transport,
- // and maybe they hold resources that need to be freed
+ // callback remaining pings: they're not allowed to call into the transport,
+ // and maybe they hold resources that need to be freed
grpc_chttp2_ping_queue* pq = &t->ping_queue;
GPR_ASSERT(error != GRPC_ERROR_NONE);
for (size_t j = 0; j < GRPC_CHTTP2_PCL_COUNT; j++) {
@@ -1654,9 +1654,9 @@ static void send_ping_locked(grpc_chttp2_transport* t,
GRPC_ERROR_NONE);
}
-// Specialized form of send_ping_locked for keepalive ping. If there is already
-// a ping in progress, the keepalive ping would piggyback onto that ping,
-// instead of waiting for that ping to complete and then starting a new ping.
+// Specialized form of send_ping_locked for keepalive ping. If there is already
+// a ping in progress, the keepalive ping would piggyback onto that ping,
+// instead of waiting for that ping to complete and then starting a new ping.
static void send_keepalive_ping_locked(grpc_chttp2_transport* t) {
if (t->closed_with_error != GRPC_ERROR_NONE) {
t->combiner->Run(GRPC_CLOSURE_INIT(&t->start_keepalive_ping_locked,
@@ -1670,7 +1670,7 @@ static void send_keepalive_ping_locked(grpc_chttp2_transport* t) {
}
grpc_chttp2_ping_queue* pq = &t->ping_queue;
if (!grpc_closure_list_empty(pq->lists[GRPC_CHTTP2_PCL_INFLIGHT])) {
- // There is a ping in flight. Add yourself to the inflight closure list.
+ // There is a ping in flight. Add yourself to the inflight closure list.
t->combiner->Run(GRPC_CLOSURE_INIT(&t->start_keepalive_ping_locked,
start_keepalive_ping_locked, t, nullptr),
GRPC_ERROR_REF(t->closed_with_error));
@@ -1712,8 +1712,8 @@ static void retry_initiate_ping_locked(void* tp, grpc_error* error) {
void grpc_chttp2_ack_ping(grpc_chttp2_transport* t, uint64_t id) {
grpc_chttp2_ping_queue* pq = &t->ping_queue;
if (pq->inflight_id != id) {
- gpr_log(GPR_DEBUG, "Unknown ping response from %s: %" PRIx64,
- t->peer_string.c_str(), id);
+ gpr_log(GPR_DEBUG, "Unknown ping response from %s: %" PRIx64,
+ t->peer_string.c_str(), id);
return;
}
grpc_core::ExecCtx::RunList(DEBUG_LOCATION,
@@ -1724,8 +1724,8 @@ void grpc_chttp2_ack_ping(grpc_chttp2_transport* t, uint64_t id) {
}
static void send_goaway(grpc_chttp2_transport* t, grpc_error* error) {
- // We want to log this irrespective of whether http tracing is enabled
- gpr_log(GPR_INFO, "%s: Sending goaway err=%s", t->peer_string.c_str(),
+ // We want to log this irrespective of whether http tracing is enabled
+ gpr_log(GPR_INFO, "%s: Sending goaway err=%s", t->peer_string.c_str(),
grpc_error_string(error));
t->sent_goaway_state = GRPC_CHTTP2_GOAWAY_SEND_SCHEDULED;
grpc_http2_error_code http_error;
@@ -1746,7 +1746,7 @@ void grpc_chttp2_add_ping_strike(grpc_chttp2_transport* t) {
grpc_error_set_int(
GRPC_ERROR_CREATE_FROM_STATIC_STRING("too_many_pings"),
GRPC_ERROR_INT_HTTP2_ERROR, GRPC_HTTP2_ENHANCE_YOUR_CALM));
- // The transport will be closed after the write is done
+ // The transport will be closed after the write is done
close_transport_locked(
t, grpc_error_set_int(
GRPC_ERROR_CREATE_FROM_STATIC_STRING("Too many pings"),
@@ -1754,15 +1754,15 @@ void grpc_chttp2_add_ping_strike(grpc_chttp2_transport* t) {
}
}
-void grpc_chttp2_reset_ping_clock(grpc_chttp2_transport* t) {
- if (!t->is_client) {
- t->ping_recv_state.last_ping_recv_time = GRPC_MILLIS_INF_PAST;
- t->ping_recv_state.ping_strikes = 0;
- }
- t->ping_state.pings_before_data_required =
- t->ping_policy.max_pings_without_data;
-}
-
+void grpc_chttp2_reset_ping_clock(grpc_chttp2_transport* t) {
+ if (!t->is_client) {
+ t->ping_recv_state.last_ping_recv_time = GRPC_MILLIS_INF_PAST;
+ t->ping_recv_state.ping_strikes = 0;
+ }
+ t->ping_state.pings_before_data_required =
+ t->ping_policy.max_pings_without_data;
+}
+
static void perform_transport_op_locked(void* stream_op,
grpc_error* /*error_ignored*/) {
grpc_transport_op* op = static_cast<grpc_transport_op*>(stream_op);
@@ -1811,8 +1811,8 @@ static void perform_transport_op_locked(void* stream_op,
static void perform_transport_op(grpc_transport* gt, grpc_transport_op* op) {
grpc_chttp2_transport* t = reinterpret_cast<grpc_chttp2_transport*>(gt);
if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace)) {
- gpr_log(GPR_INFO, "perform_transport_op[t=%p]: %s", t,
- grpc_transport_op_string(op).c_str());
+ gpr_log(GPR_INFO, "perform_transport_op[t=%p]: %s", t,
+ grpc_transport_op_string(op).c_str());
}
op->handler_private.extra_arg = gt;
GRPC_CHTTP2_REF_TRANSPORT(t, "transport_op");
@@ -1821,9 +1821,9 @@ static void perform_transport_op(grpc_transport* gt, grpc_transport_op* op) {
GRPC_ERROR_NONE);
}
-//
-// INPUT PROCESSING - GENERAL
-//
+//
+// INPUT PROCESSING - GENERAL
+//
void grpc_chttp2_maybe_complete_recv_initial_metadata(
grpc_chttp2_transport* /*t*/, grpc_chttp2_stream* s) {
@@ -1943,8 +1943,8 @@ void grpc_chttp2_maybe_complete_recv_trailing_metadata(grpc_chttp2_transport* t,
s->unprocessed_incoming_frames_buffer.length > 0;
if (s->read_closed && s->frame_storage.length > 0 && !pending_data &&
!s->seen_error && s->recv_trailing_metadata_finished != nullptr) {
- // Maybe some SYNC_FLUSH data is left in frame_storage. Consume them and
- // maybe decompress the next 5 bytes in the stream.
+ // Maybe some SYNC_FLUSH data is left in frame_storage. Consume them and
+ // maybe decompress the next 5 bytes in the stream.
if (s->stream_decompression_method ==
GRPC_STREAM_COMPRESSION_IDENTITY_DECOMPRESS) {
grpc_slice_buffer_move_first(
@@ -2028,8 +2028,8 @@ static void remove_stream(grpc_chttp2_transport* t, uint32_t id,
if (grpc_chttp2_list_remove_writable_stream(t, s)) {
GRPC_CHTTP2_STREAM_UNREF(s, "chttp2_writing:remove_stream");
}
- grpc_chttp2_list_remove_stalled_by_stream(t, s);
- grpc_chttp2_list_remove_stalled_by_transport(t, s);
+ grpc_chttp2_list_remove_stalled_by_stream(t, s);
+ grpc_chttp2_list_remove_stalled_by_transport(t, s);
GRPC_ERROR_UNREF(error);
@@ -2068,12 +2068,12 @@ void grpc_chttp2_fake_status(grpc_chttp2_transport* t, grpc_chttp2_stream* s,
if (status != GRPC_STATUS_OK) {
s->seen_error = true;
}
- // stream_global->recv_trailing_metadata_finished gives us a
- // last chance replacement: we've received trailing metadata,
- // but something more important has become available to signal
- // to the upper layers - drop what we've got, and then publish
- // what we want - which is safe because we haven't told anyone
- // about the metadata yet
+ // stream_global->recv_trailing_metadata_finished gives us a
+ // last chance replacement: we've received trailing metadata,
+ // but something more important has become available to signal
+ // to the upper layers - drop what we've got, and then publish
+ // what we want - which is safe because we haven't told anyone
+ // about the metadata yet
if (s->published_metadata[1] == GRPC_METADATA_NOT_PUBLISHED ||
s->recv_trailing_metadata_finished != nullptr) {
char status_string[GPR_LTOA_MIN_BUFSIZE];
@@ -2148,7 +2148,7 @@ void grpc_chttp2_fail_pending_writes(grpc_chttp2_transport* t,
"send_initial_metadata_finished");
s->send_trailing_metadata = nullptr;
- s->sent_trailing_metadata_op = nullptr;
+ s->sent_trailing_metadata_op = nullptr;
grpc_chttp2_complete_closure_step(t, s, &s->send_trailing_metadata_finished,
GRPC_ERROR_REF(error),
"send_trailing_metadata_finished");
@@ -2165,11 +2165,11 @@ void grpc_chttp2_mark_stream_closed(grpc_chttp2_transport* t,
grpc_chttp2_stream* s, int close_reads,
int close_writes, grpc_error* error) {
if (s->read_closed && s->write_closed) {
- // already closed, but we should still fake the status if needed.
- grpc_error* overall_error = removal_error(error, s, "Stream removed");
- if (overall_error != GRPC_ERROR_NONE) {
- grpc_chttp2_fake_status(t, s, overall_error);
- }
+ // already closed, but we should still fake the status if needed.
+ grpc_error* overall_error = removal_error(error, s, "Stream removed");
+ if (overall_error != GRPC_ERROR_NONE) {
+ grpc_chttp2_fake_status(t, s, overall_error);
+ }
grpc_chttp2_maybe_complete_recv_trailing_metadata(t, s);
return;
}
@@ -2192,7 +2192,7 @@ void grpc_chttp2_mark_stream_closed(grpc_chttp2_transport* t,
if (s->id != 0) {
remove_stream(t, s->id, GRPC_ERROR_REF(overall_error));
} else {
- // Purge streams waiting on concurrency still waiting for id assignment
+ // Purge streams waiting on concurrency still waiting for id assignment
grpc_chttp2_list_remove_waiting_for_concurrency(t, s);
}
if (overall_error != GRPC_ERROR_NONE) {
@@ -2231,12 +2231,12 @@ static void close_from_api(grpc_chttp2_transport* t, grpc_chttp2_stream* s,
GPR_ASSERT(grpc_status >= 0 && (int)grpc_status < 100);
- // Hand roll a header block.
- // This is unnecessarily ugly - at some point we should find a more
- // elegant solution.
- // It's complicated by the fact that our send machinery would be dead by
- // the time we got around to sending this, so instead we ignore HPACK
- // compression and just write the uncompressed bytes onto the wire.
+ // Hand roll a header block.
+ // This is unnecessarily ugly - at some point we should find a more
+ // elegant solution.
+ // It's complicated by the fact that our send machinery would be dead by
+ // the time we got around to sending this, so instead we ignore HPACK
+ // compression and just write the uncompressed bytes onto the wire.
if (!s->sent_initial_metadata) {
http_status_hdr = GRPC_SLICE_MALLOC(13);
p = GRPC_SLICE_START_PTR(http_status_hdr);
@@ -2365,7 +2365,7 @@ static void close_from_api(grpc_chttp2_transport* t, grpc_chttp2_stream* s,
grpc_slice_buffer_add(&t->qbuf, status_hdr);
grpc_slice_buffer_add(&t->qbuf, message_pfx);
grpc_slice_buffer_add(&t->qbuf, grpc_slice_ref_internal(slice));
- grpc_chttp2_reset_ping_clock(t);
+ grpc_chttp2_reset_ping_clock(t);
grpc_chttp2_add_rst_stream_to_next_write(t, s->id, GRPC_HTTP2_NO_ERROR,
&s->stats.outgoing);
@@ -2397,9 +2397,9 @@ static void end_all_the_calls(grpc_chttp2_transport* t, grpc_error* error) {
GRPC_ERROR_UNREF(error);
}
-//
-// INPUT PROCESSING - PARSING
-//
+//
+// INPUT PROCESSING - PARSING
+//
template <class F>
static void WithUrgency(grpc_chttp2_transport* t,
@@ -2529,8 +2529,8 @@ static void read_action_locked(void* tp, grpc_error* error) {
"Transport closed", &t->closed_with_error, 1);
}
if (error != GRPC_ERROR_NONE) {
- // If a goaway frame was received, this might be the reason why the read
- // failed. Add this info to the error
+ // If a goaway frame was received, this might be the reason why the read
+ // failed. Add this info to the error
if (t->goaway_error != GRPC_ERROR_NONE) {
error = grpc_error_add_child(error, GRPC_ERROR_REF(t->goaway_error));
}
@@ -2539,7 +2539,7 @@ static void read_action_locked(void* tp, grpc_error* error) {
t->endpoint_reading = 0;
} else if (t->closed_with_error == GRPC_ERROR_NONE) {
keep_reading = true;
- // Since we have read a byte, reset the keepalive timer
+ // Since we have read a byte, reset the keepalive timer
if (t->keepalive_state == GRPC_CHTTP2_KEEPALIVE_STATE_WAITING) {
grpc_timer_cancel(&t->keepalive_ping_timer);
}
@@ -2574,7 +2574,7 @@ static void continue_read_action_locked(grpc_chttp2_transport* t) {
// t is reffed prior to calling the first time, and once the callback chain
// that kicks off finishes, it's unreffed
-void schedule_bdp_ping_locked(grpc_chttp2_transport* t) {
+void schedule_bdp_ping_locked(grpc_chttp2_transport* t) {
t->flow_control->bdp_estimator()->SchedulePing();
send_ping_locked(
t,
@@ -2582,9 +2582,9 @@ void schedule_bdp_ping_locked(grpc_chttp2_transport* t) {
grpc_schedule_on_exec_ctx),
GRPC_CLOSURE_INIT(&t->finish_bdp_ping_locked, finish_bdp_ping, t,
grpc_schedule_on_exec_ctx));
- // TODO(yashykt): Enabling this causes internal b/168345569. Re-enable once
- // fixed.
- // grpc_chttp2_initiate_write(t, GRPC_CHTTP2_INITIATE_WRITE_BDP_PING);
+ // TODO(yashykt): Enabling this causes internal b/168345569. Re-enable once
+ // fixed.
+ // grpc_chttp2_initiate_write(t, GRPC_CHTTP2_INITIATE_WRITE_BDP_PING);
}
static void start_bdp_ping(void* tp, grpc_error* error) {
@@ -2597,13 +2597,13 @@ static void start_bdp_ping(void* tp, grpc_error* error) {
static void start_bdp_ping_locked(void* tp, grpc_error* error) {
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(tp);
if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace)) {
- gpr_log(GPR_INFO, "%s: Start BDP ping err=%s", t->peer_string.c_str(),
+ gpr_log(GPR_INFO, "%s: Start BDP ping err=%s", t->peer_string.c_str(),
grpc_error_string(error));
}
if (error != GRPC_ERROR_NONE || t->closed_with_error != GRPC_ERROR_NONE) {
return;
}
- // Reset the keepalive ping timer
+ // Reset the keepalive ping timer
if (t->keepalive_state == GRPC_CHTTP2_KEEPALIVE_STATE_WAITING) {
grpc_timer_cancel(&t->keepalive_ping_timer);
}
@@ -2621,7 +2621,7 @@ static void finish_bdp_ping(void* tp, grpc_error* error) {
static void finish_bdp_ping_locked(void* tp, grpc_error* error) {
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(tp);
if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace)) {
- gpr_log(GPR_INFO, "%s: Complete BDP ping err=%s", t->peer_string.c_str(),
+ gpr_log(GPR_INFO, "%s: Complete BDP ping err=%s", t->peer_string.c_str(),
grpc_error_string(error));
}
if (error != GRPC_ERROR_NONE || t->closed_with_error != GRPC_ERROR_NONE) {
@@ -2629,8 +2629,8 @@ static void finish_bdp_ping_locked(void* tp, grpc_error* error) {
return;
}
if (!t->bdp_ping_started) {
- // start_bdp_ping_locked has not been run yet. Schedule
- // finish_bdp_ping_locked to be run later.
+ // start_bdp_ping_locked has not been run yet. Schedule
+ // finish_bdp_ping_locked to be run later.
t->combiner->Run(GRPC_CLOSURE_INIT(&t->finish_bdp_ping_locked,
finish_bdp_ping_locked, t, nullptr),
GRPC_ERROR_REF(error));
@@ -2664,13 +2664,13 @@ static void next_bdp_ping_timer_expired_locked(void* tp, grpc_error* error) {
GRPC_CHTTP2_UNREF_TRANSPORT(t, "bdp_ping");
return;
}
- if (t->flow_control->bdp_estimator()->accumulator() == 0) {
- // Block the bdp ping till we receive more data.
- t->bdp_ping_blocked = true;
- GRPC_CHTTP2_UNREF_TRANSPORT(t, "bdp_ping");
- } else {
- schedule_bdp_ping_locked(t);
- }
+ if (t->flow_control->bdp_estimator()->accumulator() == 0) {
+ // Block the bdp ping till we receive more data.
+ t->bdp_ping_blocked = true;
+ GRPC_CHTTP2_UNREF_TRANSPORT(t, "bdp_ping");
+ } else {
+ schedule_bdp_ping_locked(t);
+ }
}
void grpc_chttp2_config_default_keepalive_args(grpc_channel_args* args,
@@ -2769,7 +2769,7 @@ static void init_keepalive_ping_locked(void* arg, grpc_error* error) {
&t->init_keepalive_ping_locked);
}
} else if (error == GRPC_ERROR_CANCELLED) {
- // The keepalive ping timer may be cancelled by bdp
+ // The keepalive ping timer may be cancelled by bdp
GRPC_CHTTP2_REF_TRANSPORT(t, "init keepalive ping");
GRPC_CLOSURE_INIT(&t->init_keepalive_ping_locked, init_keepalive_ping, t,
grpc_schedule_on_exec_ctx);
@@ -2795,9 +2795,9 @@ static void start_keepalive_ping_locked(void* arg, grpc_error* error) {
if (t->channelz_socket != nullptr) {
t->channelz_socket->RecordKeepaliveSent();
}
- if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace) ||
- GRPC_TRACE_FLAG_ENABLED(grpc_keepalive_trace)) {
- gpr_log(GPR_INFO, "%s: Start keepalive ping", t->peer_string.c_str());
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace) ||
+ GRPC_TRACE_FLAG_ENABLED(grpc_keepalive_trace)) {
+ gpr_log(GPR_INFO, "%s: Start keepalive ping", t->peer_string.c_str());
}
GRPC_CHTTP2_REF_TRANSPORT(t, "keepalive watchdog");
GRPC_CLOSURE_INIT(&t->keepalive_watchdog_fired_locked,
@@ -2819,13 +2819,13 @@ static void finish_keepalive_ping_locked(void* arg, grpc_error* error) {
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(arg);
if (t->keepalive_state == GRPC_CHTTP2_KEEPALIVE_STATE_PINGING) {
if (error == GRPC_ERROR_NONE) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace) ||
- GRPC_TRACE_FLAG_ENABLED(grpc_keepalive_trace)) {
- gpr_log(GPR_INFO, "%s: Finish keepalive ping", t->peer_string.c_str());
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace) ||
+ GRPC_TRACE_FLAG_ENABLED(grpc_keepalive_trace)) {
+ gpr_log(GPR_INFO, "%s: Finish keepalive ping", t->peer_string.c_str());
}
if (!t->keepalive_ping_started) {
- // start_keepalive_ping_locked has not run yet. Reschedule
- // finish_keepalive_ping_locked for it to be run later.
+ // start_keepalive_ping_locked has not run yet. Reschedule
+ // finish_keepalive_ping_locked for it to be run later.
t->combiner->Run(
GRPC_CLOSURE_INIT(&t->finish_keepalive_ping_locked,
finish_keepalive_ping_locked, t, nullptr),
@@ -2858,8 +2858,8 @@ static void keepalive_watchdog_fired_locked(void* arg, grpc_error* error) {
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(arg);
if (t->keepalive_state == GRPC_CHTTP2_KEEPALIVE_STATE_PINGING) {
if (error == GRPC_ERROR_NONE) {
- gpr_log(GPR_INFO, "%s: Keepalive watchdog fired. Closing transport.",
- t->peer_string.c_str());
+ gpr_log(GPR_INFO, "%s: Keepalive watchdog fired. Closing transport.",
+ t->peer_string.c_str());
t->keepalive_state = GRPC_CHTTP2_KEEPALIVE_STATE_DYING;
close_transport_locked(
t, grpc_error_set_int(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
@@ -2868,8 +2868,8 @@ static void keepalive_watchdog_fired_locked(void* arg, grpc_error* error) {
GRPC_STATUS_UNAVAILABLE));
}
} else {
- // The watchdog timer should have been cancelled by
- // finish_keepalive_ping_locked.
+ // The watchdog timer should have been cancelled by
+ // finish_keepalive_ping_locked.
if (GPR_UNLIKELY(error != GRPC_ERROR_CANCELLED)) {
gpr_log(GPR_ERROR, "keepalive_ping_end state error: %d (expect: %d)",
t->keepalive_state, GRPC_CHTTP2_KEEPALIVE_STATE_PINGING);
@@ -2878,22 +2878,22 @@ static void keepalive_watchdog_fired_locked(void* arg, grpc_error* error) {
GRPC_CHTTP2_UNREF_TRANSPORT(t, "keepalive watchdog");
}
-//
-// CALLBACK LOOP
-//
+//
+// CALLBACK LOOP
+//
static void connectivity_state_set(grpc_chttp2_transport* t,
grpc_connectivity_state state,
- const y_absl::Status& status,
+ const y_absl::Status& status,
const char* reason) {
GRPC_CHTTP2_IF_TRACING(
gpr_log(GPR_INFO, "transport %p set connectivity_state=%d", t, state));
- t->state_tracker.SetState(state, status, reason);
+ t->state_tracker.SetState(state, status, reason);
}
-//
-// POLLSET STUFF
-//
+//
+// POLLSET STUFF
+//
static void set_pollset(grpc_transport* gt, grpc_stream* /*gs*/,
grpc_pollset* pollset) {
@@ -2907,9 +2907,9 @@ static void set_pollset_set(grpc_transport* gt, grpc_stream* /*gs*/,
grpc_endpoint_add_to_pollset_set(t->ep, pollset_set);
}
-//
-// BYTE STREAM
-//
+//
+// BYTE STREAM
+//
static void reset_byte_stream(void* arg, grpc_error* error) {
grpc_chttp2_stream* s = static_cast<grpc_chttp2_stream*>(arg);
@@ -2988,8 +2988,8 @@ void Chttp2IncomingByteStream::NextLocked(void* arg,
}
} else if (s->read_closed) {
if (bs->remaining_bytes_ != 0) {
- s->byte_stream_error = GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
- "Truncated message", &s->read_closed_error, 1);
+ s->byte_stream_error = GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
+ "Truncated message", &s->read_closed_error, 1);
grpc_core::ExecCtx::Run(DEBUG_LOCATION, bs->next_action_.on_complete,
GRPC_ERROR_REF(s->byte_stream_error));
if (s->data_parser.parsing_frame != nullptr) {
@@ -2997,7 +2997,7 @@ void Chttp2IncomingByteStream::NextLocked(void* arg,
s->data_parser.parsing_frame = nullptr;
}
} else {
- // Should never reach here.
+ // Should never reach here.
GPR_ASSERT(false);
}
} else {
@@ -3126,9 +3126,9 @@ void Chttp2IncomingByteStream::Shutdown(grpc_error* error) {
} // namespace grpc_core
-//
-// RESOURCE QUOTAS
-//
+//
+// RESOURCE QUOTAS
+//
static void post_benign_reclaimer(grpc_chttp2_transport* t) {
if (!t->benign_reclaimer_registered) {
@@ -3163,11 +3163,11 @@ static void benign_reclaimer_locked(void* arg, grpc_error* error) {
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(arg);
if (error == GRPC_ERROR_NONE &&
grpc_chttp2_stream_map_size(&t->stream_map) == 0) {
- // Channel with no active streams: send a goaway to try and make it
- // disconnect cleanly
+ // Channel with no active streams: send a goaway to try and make it
+ // disconnect cleanly
if (GRPC_TRACE_FLAG_ENABLED(grpc_resource_quota_trace)) {
gpr_log(GPR_INFO, "HTTP2: %s - send goaway to free memory",
- t->peer_string.c_str());
+ t->peer_string.c_str());
}
send_goaway(t,
grpc_error_set_int(
@@ -3178,8 +3178,8 @@ static void benign_reclaimer_locked(void* arg, grpc_error* error) {
gpr_log(GPR_INFO,
"HTTP2: %s - skip benign reclamation, there are still %" PRIdPTR
" streams",
- t->peer_string.c_str(),
- grpc_chttp2_stream_map_size(&t->stream_map));
+ t->peer_string.c_str(),
+ grpc_chttp2_stream_map_size(&t->stream_map));
}
t->benign_reclaimer_registered = false;
if (error != GRPC_ERROR_CANCELLED) {
@@ -3204,8 +3204,8 @@ static void destructive_reclaimer_locked(void* arg, grpc_error* error) {
grpc_chttp2_stream* s = static_cast<grpc_chttp2_stream*>(
grpc_chttp2_stream_map_rand(&t->stream_map));
if (GRPC_TRACE_FLAG_ENABLED(grpc_resource_quota_trace)) {
- gpr_log(GPR_INFO, "HTTP2: %s - abandon stream id %d",
- t->peer_string.c_str(), s->id);
+ gpr_log(GPR_INFO, "HTTP2: %s - abandon stream id %d",
+ t->peer_string.c_str(), s->id);
}
grpc_chttp2_cancel_stream(
t, s,
@@ -3213,10 +3213,10 @@ static void destructive_reclaimer_locked(void* arg, grpc_error* error) {
GRPC_ERROR_INT_HTTP2_ERROR,
GRPC_HTTP2_ENHANCE_YOUR_CALM));
if (n > 1) {
- // Since we cancel one stream per destructive reclamation, if
- // there are more streams left, we can immediately post a new
- // reclaimer in case the resource quota needs to free more
- // memory
+ // Since we cancel one stream per destructive reclamation, if
+ // there are more streams left, we can immediately post a new
+ // reclaimer in case the resource quota needs to free more
+ // memory
post_destructive_reclaimer(t);
}
}
@@ -3227,9 +3227,9 @@ static void destructive_reclaimer_locked(void* arg, grpc_error* error) {
GRPC_CHTTP2_UNREF_TRANSPORT(t, "destructive_reclaimer");
}
-//
-// MONITORING
-//
+//
+// MONITORING
+//
const char* grpc_chttp2_initiate_write_reason_string(
grpc_chttp2_initiate_write_reason reason) {
@@ -3266,8 +3266,8 @@ const char* grpc_chttp2_initiate_write_reason_string(
return "FLOW_CONTROL_UNSTALLED_BY_UPDATE";
case GRPC_CHTTP2_INITIATE_WRITE_APPLICATION_PING:
return "APPLICATION_PING";
- case GRPC_CHTTP2_INITIATE_WRITE_BDP_PING:
- return "BDP_PING";
+ case GRPC_CHTTP2_INITIATE_WRITE_BDP_PING:
+ return "BDP_PING";
case GRPC_CHTTP2_INITIATE_WRITE_KEEPALIVE_PING:
return "KEEPALIVE_PING";
case GRPC_CHTTP2_INITIATE_WRITE_TRANSPORT_FLOW_CONTROL_UNSTALLED:
diff --git a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/chttp2_transport.h b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/chttp2_transport.h
index 3d245ad0fbe..b04630bbe2b 100644
--- a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/chttp2_transport.h
+++ b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/chttp2_transport.h
@@ -27,7 +27,7 @@
#include "src/core/lib/transport/transport.h"
extern grpc_core::TraceFlag grpc_http_trace;
-extern grpc_core::TraceFlag grpc_keepalive_trace;
+extern grpc_core::TraceFlag grpc_keepalive_trace;
extern grpc_core::TraceFlag grpc_trace_http2_stream_state;
extern grpc_core::DebugOnlyTraceFlag grpc_trace_chttp2_refcount;
extern grpc_core::DebugOnlyTraceFlag grpc_trace_chttp2_hpack_parser;
diff --git a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/flow_control.cc b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/flow_control.cc
index bbc9df80ff0..fd76c4b3d9a 100644
--- a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/flow_control.cc
+++ b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/flow_control.cc
@@ -25,10 +25,10 @@
#include <math.h>
#include <string.h>
-#include <util/generic/string.h>
-
-#include "y_absl/strings/str_format.h"
-
+#include <util/generic/string.h>
+
+#include "y_absl/strings/str_format.h"
+
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
@@ -40,32 +40,32 @@ grpc_core::TraceFlag grpc_flowctl_trace(false, "flowctl");
namespace grpc_core {
namespace chttp2 {
-TestOnlyTransportTargetWindowEstimatesMocker*
- g_test_only_transport_target_window_estimates_mocker;
-
+TestOnlyTransportTargetWindowEstimatesMocker*
+ g_test_only_transport_target_window_estimates_mocker;
+
namespace {
static constexpr const int kTracePadding = 30;
static constexpr const uint32_t kMaxWindowUpdateSize = (1u << 31) - 1;
static char* fmt_int64_diff_str(int64_t old_val, int64_t new_val) {
- TString str;
+ TString str;
if (old_val != new_val) {
- str = y_absl::StrFormat("%" PRId64 " -> %" PRId64 "", old_val, new_val);
+ str = y_absl::StrFormat("%" PRId64 " -> %" PRId64 "", old_val, new_val);
} else {
- str = y_absl::StrFormat("%" PRId64 "", old_val);
+ str = y_absl::StrFormat("%" PRId64 "", old_val);
}
- return gpr_leftpad(str.c_str(), ' ', kTracePadding);
+ return gpr_leftpad(str.c_str(), ' ', kTracePadding);
}
static char* fmt_uint32_diff_str(uint32_t old_val, uint32_t new_val) {
- TString str;
+ TString str;
if (old_val != new_val) {
- str = y_absl::StrFormat("%" PRIu32 " -> %" PRIu32 "", old_val, new_val);
+ str = y_absl::StrFormat("%" PRIu32 " -> %" PRIu32 "", old_val, new_val);
} else {
- str = y_absl::StrFormat("%" PRIu32 "", old_val);
+ str = y_absl::StrFormat("%" PRIu32 "", old_val);
}
- return gpr_leftpad(str.c_str(), ' ', kTracePadding);
+ return gpr_leftpad(str.c_str(), ' ', kTracePadding);
}
} // namespace
@@ -178,7 +178,7 @@ TransportFlowControl::TransportFlowControl(const grpc_chttp2_transport* t,
bool enable_bdp_probe)
: t_(t),
enable_bdp_probe_(enable_bdp_probe),
- bdp_estimator_(t->peer_string.c_str()),
+ bdp_estimator_(t->peer_string.c_str()),
pid_controller_(grpc_core::PidController::Args()
.set_gain_p(4)
.set_gain_i(8)
@@ -206,11 +206,11 @@ uint32_t TransportFlowControl::MaybeSendUpdate(bool writing_anyway) {
grpc_error* TransportFlowControl::ValidateRecvData(
int64_t incoming_frame_size) {
if (incoming_frame_size > announced_window_) {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrFormat("frame of size %" PRId64
- " overflows local window of %" PRId64,
- incoming_frame_size, announced_window_)
- .c_str());
+ return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrFormat("frame of size %" PRId64
+ " overflows local window of %" PRId64,
+ incoming_frame_size, announced_window_)
+ .c_str());
}
return GRPC_ERROR_NONE;
}
@@ -275,8 +275,8 @@ void StreamFlowControl::IncomingByteStreamUpdate(size_t max_size_hint,
[GRPC_CHTTP2_SETTINGS_INITIAL_WINDOW_SIZE];
/* clamp max recv hint to an allowable size */
- if (max_size_hint >= kMaxWindowUpdateSize - sent_init_window) {
- max_recv_bytes = kMaxWindowUpdateSize - sent_init_window;
+ if (max_size_hint >= kMaxWindowUpdateSize - sent_init_window) {
+ max_recv_bytes = kMaxWindowUpdateSize - sent_init_window;
} else {
max_recv_bytes = static_cast<uint32_t>(max_size_hint);
}
@@ -289,7 +289,7 @@ void StreamFlowControl::IncomingByteStreamUpdate(size_t max_size_hint,
}
/* add some small lookahead to keep pipelines flowing */
- GPR_DEBUG_ASSERT(max_recv_bytes <= kMaxWindowUpdateSize - sent_init_window);
+ GPR_DEBUG_ASSERT(max_recv_bytes <= kMaxWindowUpdateSize - sent_init_window);
if (local_window_delta_ < max_recv_bytes) {
uint32_t add_max_recv_bytes =
static_cast<uint32_t>(max_recv_bytes - local_window_delta_);
@@ -351,13 +351,13 @@ FlowControlAction TransportFlowControl::PeriodicUpdate() {
// target might change based on how much memory pressure we are under
// TODO(ncteisen): experiment with setting target to be huge under low
// memory pressure.
- double target = pow(2, SmoothLogBdp(TargetLogBdp()));
- if (g_test_only_transport_target_window_estimates_mocker != nullptr) {
- // Hook for simulating unusual flow control situations in tests.
- target = g_test_only_transport_target_window_estimates_mocker
- ->ComputeNextTargetInitialWindowSizeFromPeriodicUpdate(
- target_initial_window_size_ /* current target */);
- }
+ double target = pow(2, SmoothLogBdp(TargetLogBdp()));
+ if (g_test_only_transport_target_window_estimates_mocker != nullptr) {
+ // Hook for simulating unusual flow control situations in tests.
+ target = g_test_only_transport_target_window_estimates_mocker
+ ->ComputeNextTargetInitialWindowSizeFromPeriodicUpdate(
+ target_initial_window_size_ /* current target */);
+ }
// Though initial window 'could' drop to 0, we keep the floor at 128
target_initial_window_size_ =
static_cast<int32_t> GPR_CLAMP(target, 128, INT32_MAX);
diff --git a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/flow_control.h b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/flow_control.h
index 60537377cd8..a55ab82efb4 100644
--- a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/flow_control.h
+++ b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/flow_control.h
@@ -140,7 +140,7 @@ class FlowControlTrace {
};
// Fat interface with all methods a flow control implementation needs to
-// support.
+// support.
class TransportFlowControlBase {
public:
TransportFlowControlBase() {}
@@ -148,30 +148,30 @@ class TransportFlowControlBase {
// Is flow control enabled? This is needed in other codepaths like the checks
// in parsing and in writing.
- virtual bool flow_control_enabled() const = 0;
+ virtual bool flow_control_enabled() const = 0;
// Called to check if the transport needs to send a WINDOW_UPDATE frame
- virtual uint32_t MaybeSendUpdate(bool /* writing_anyway */) = 0;
+ virtual uint32_t MaybeSendUpdate(bool /* writing_anyway */) = 0;
// Using the protected members, returns and Action to be taken by the
// tranport.
- virtual FlowControlAction MakeAction() = 0;
+ virtual FlowControlAction MakeAction() = 0;
// Using the protected members, returns and Action to be taken by the
// tranport. Also checks for updates to our BDP estimate and acts
// accordingly.
- virtual FlowControlAction PeriodicUpdate() = 0;
+ virtual FlowControlAction PeriodicUpdate() = 0;
// Called to do bookkeeping when a stream owned by this transport sends
// data on the wire
- virtual void StreamSentData(int64_t /* size */) = 0;
+ virtual void StreamSentData(int64_t /* size */) = 0;
// Called to do bookkeeping when a stream owned by this transport receives
// data from the wire. Also does error checking for frame size.
- virtual grpc_error* RecvData(int64_t /* incoming_frame_size */) = 0;
+ virtual grpc_error* RecvData(int64_t /* incoming_frame_size */) = 0;
// Called to do bookkeeping when we receive a WINDOW_UPDATE frame.
- virtual void RecvUpdate(uint32_t /* size */) = 0;
+ virtual void RecvUpdate(uint32_t /* size */) = 0;
// Returns the BdpEstimator held by this object. Caller is responsible for
// checking for nullptr. TODO(ncteisen): consider fully encapsulating all
@@ -333,7 +333,7 @@ class TransportFlowControl final : public TransportFlowControlBase {
};
// Fat interface with all methods a stream flow control implementation needs
-// to support.
+// to support.
class StreamFlowControlBase {
public:
StreamFlowControlBase() {}
@@ -346,19 +346,19 @@ class StreamFlowControlBase {
// Using the protected members, returns an Action for this stream to be
// taken by the tranport.
- virtual FlowControlAction MakeAction() = 0;
+ virtual FlowControlAction MakeAction() = 0;
// Bookkeeping for when data is sent on this stream.
- virtual void SentData(int64_t /* outgoing_frame_size */) = 0;
+ virtual void SentData(int64_t /* outgoing_frame_size */) = 0;
// Bookkeeping and error checking for when data is received by this stream.
- virtual grpc_error* RecvData(int64_t /* incoming_frame_size */) = 0;
+ virtual grpc_error* RecvData(int64_t /* incoming_frame_size */) = 0;
// Called to check if this stream needs to send a WINDOW_UPDATE frame.
- virtual uint32_t MaybeSendUpdate() = 0;
+ virtual uint32_t MaybeSendUpdate() = 0;
// Bookkeeping for receiving a WINDOW_UPDATE from for this stream.
- virtual void RecvUpdate(uint32_t /* size */) = 0;
+ virtual void RecvUpdate(uint32_t /* size */) = 0;
// Bookkeeping for when a call pulls bytes out of the transport. At this
// point we consider the data 'used' and can thus let out peer know we are
@@ -466,16 +466,16 @@ class StreamFlowControl final : public StreamFlowControlBase {
}
};
-class TestOnlyTransportTargetWindowEstimatesMocker {
- public:
- virtual ~TestOnlyTransportTargetWindowEstimatesMocker() {}
- virtual double ComputeNextTargetInitialWindowSizeFromPeriodicUpdate(
- double current_target) = 0;
-};
-
-extern TestOnlyTransportTargetWindowEstimatesMocker*
- g_test_only_transport_target_window_estimates_mocker;
-
+class TestOnlyTransportTargetWindowEstimatesMocker {
+ public:
+ virtual ~TestOnlyTransportTargetWindowEstimatesMocker() {}
+ virtual double ComputeNextTargetInitialWindowSizeFromPeriodicUpdate(
+ double current_target) = 0;
+};
+
+extern TestOnlyTransportTargetWindowEstimatesMocker*
+ g_test_only_transport_target_window_estimates_mocker;
+
} // namespace chttp2
} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_data.cc b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_data.cc
index a79e37ab05f..6869bdb006d 100644
--- a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_data.cc
+++ b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_data.cc
@@ -22,8 +22,8 @@
#include <string.h>
-#include "y_absl/strings/str_format.h"
-
+#include "y_absl/strings/str_format.h"
+
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include "src/core/ext/transport/chttp2/transport/internal.h"
@@ -45,10 +45,10 @@ grpc_error* grpc_chttp2_data_parser_begin_frame(
grpc_chttp2_data_parser* /*parser*/, uint8_t flags, uint32_t stream_id,
grpc_chttp2_stream* s) {
if (flags & ~GRPC_CHTTP2_DATA_FLAG_END_STREAM) {
- return grpc_error_set_int(
- GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrFormat("unsupported data flags: 0x%02x", flags).c_str()),
- GRPC_ERROR_INT_STREAM_ID, static_cast<intptr_t>(stream_id));
+ return grpc_error_set_int(
+ GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrFormat("unsupported data flags: 0x%02x", flags).c_str()),
+ GRPC_ERROR_INT_STREAM_ID, static_cast<intptr_t>(stream_id));
}
if (flags & GRPC_CHTTP2_DATA_FLAG_END_STREAM) {
@@ -128,9 +128,9 @@ grpc_error* grpc_deframe_unprocessed_incoming_frames(
p->is_frame_compressed = true; /* GPR_TRUE */
break;
default:
- p->error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrFormat("Bad GRPC frame type 0x%02x", p->frame_type)
- .c_str());
+ p->error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrFormat("Bad GRPC frame type 0x%02x", p->frame_type)
+ .c_str());
p->error = grpc_error_set_int(p->error, GRPC_ERROR_INT_STREAM_ID,
static_cast<intptr_t>(s->id));
p->error = grpc_error_set_str(
diff --git a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_goaway.cc b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_goaway.cc
index fbfc6f89db9..79a8a03dc7e 100644
--- a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_goaway.cc
+++ b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_goaway.cc
@@ -23,8 +23,8 @@
#include <string.h>
-#include "y_absl/strings/str_format.h"
-
+#include "y_absl/strings/str_format.h"
+
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
@@ -40,8 +40,8 @@ grpc_error* grpc_chttp2_goaway_parser_begin_frame(grpc_chttp2_goaway_parser* p,
uint32_t length,
uint8_t /*flags*/) {
if (length < 8) {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrFormat("goaway frame too short (%d bytes)", length).c_str());
+ return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrFormat("goaway frame too short (%d bytes)", length).c_str());
}
gpr_free(p->debug_data);
diff --git a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_ping.cc b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_ping.cc
index 8bc8ac9384b..ae152099ba5 100644
--- a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_ping.cc
+++ b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_ping.cc
@@ -23,8 +23,8 @@
#include <string.h>
-#include "y_absl/strings/str_format.h"
-
+#include "y_absl/strings/str_format.h"
+
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
@@ -59,9 +59,9 @@ grpc_error* grpc_chttp2_ping_parser_begin_frame(grpc_chttp2_ping_parser* parser,
uint32_t length,
uint8_t flags) {
if (flags & 0xfe || length != 8) {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrFormat("invalid ping: length=%d, flags=%02x", length, flags)
- .c_str());
+ return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrFormat("invalid ping: length=%d, flags=%02x", length, flags)
+ .c_str());
}
parser->byte = 0;
parser->is_ack = flags;
diff --git a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_rst_stream.cc b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_rst_stream.cc
index ad86ababd2f..5113329991b 100644
--- a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_rst_stream.cc
+++ b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_rst_stream.cc
@@ -21,9 +21,9 @@
#include "src/core/ext/transport/chttp2/transport/frame_rst_stream.h"
#include "src/core/ext/transport/chttp2/transport/internal.h"
-#include "y_absl/strings/str_cat.h"
-#include "y_absl/strings/str_format.h"
-
+#include "y_absl/strings/str_cat.h"
+#include "y_absl/strings/str_format.h"
+
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
@@ -71,10 +71,10 @@ void grpc_chttp2_add_rst_stream_to_next_write(
grpc_error* grpc_chttp2_rst_stream_parser_begin_frame(
grpc_chttp2_rst_stream_parser* parser, uint32_t length, uint8_t flags) {
if (length != 4) {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrFormat("invalid rst_stream: length=%d, flags=%02x", length,
- flags)
- .c_str());
+ return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrFormat("invalid rst_stream: length=%d, flags=%02x", length,
+ flags)
+ .c_str());
}
parser->byte = 0;
return GRPC_ERROR_NONE;
@@ -107,11 +107,11 @@ grpc_error* grpc_chttp2_rst_stream_parser_parse(void* parser,
grpc_error* error = GRPC_ERROR_NONE;
if (reason != GRPC_HTTP2_NO_ERROR || s->metadata_buffer[1].size == 0) {
error = grpc_error_set_int(
- grpc_error_set_str(
- GRPC_ERROR_CREATE_FROM_STATIC_STRING("RST_STREAM"),
- GRPC_ERROR_STR_GRPC_MESSAGE,
- grpc_slice_from_cpp_string(y_absl::StrCat(
- "Received RST_STREAM with error code ", reason))),
+ grpc_error_set_str(
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("RST_STREAM"),
+ GRPC_ERROR_STR_GRPC_MESSAGE,
+ grpc_slice_from_cpp_string(y_absl::StrCat(
+ "Received RST_STREAM with error code ", reason))),
GRPC_ERROR_INT_HTTP2_ERROR, static_cast<intptr_t>(reason));
}
grpc_chttp2_mark_stream_closed(t, s, true, true, error);
diff --git a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_settings.cc b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_settings.cc
index 9ee588ac4e3..9e9a838cc3b 100644
--- a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_settings.cc
+++ b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_settings.cc
@@ -23,8 +23,8 @@
#include <string.h>
-#include "y_absl/strings/str_format.h"
-
+#include "y_absl/strings/str_format.h"
+
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
@@ -208,10 +208,10 @@ grpc_error* grpc_chttp2_settings_parser_parse(void* p, grpc_chttp2_transport* t,
t->last_new_stream_id, sp->error_value,
grpc_slice_from_static_string("HTTP2 settings error"),
&t->qbuf);
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrFormat("invalid value %u passed for %s",
- parser->value, sp->name)
- .c_str());
+ return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrFormat("invalid value %u passed for %s",
+ parser->value, sp->name)
+ .c_str());
}
}
if (id == GRPC_CHTTP2_SETTINGS_INITIAL_WINDOW_SIZE &&
@@ -228,8 +228,8 @@ grpc_error* grpc_chttp2_settings_parser_parse(void* p, grpc_chttp2_transport* t,
parser->incoming_settings[id] = parser->value;
if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace)) {
gpr_log(GPR_INFO, "CHTTP2:%s:%s: got setting %s = %d",
- t->is_client ? "CLI" : "SVR", t->peer_string.c_str(),
- sp->name, parser->value);
+ t->is_client ? "CLI" : "SVR", t->peer_string.c_str(),
+ sp->name, parser->value);
}
} else if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace)) {
gpr_log(GPR_ERROR, "CHTTP2: Ignoring unknown setting %d (value %d)",
diff --git a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_window_update.cc b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_window_update.cc
index f83a4effc6e..20efb09b0d3 100644
--- a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_window_update.cc
+++ b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_window_update.cc
@@ -21,9 +21,9 @@
#include "src/core/ext/transport/chttp2/transport/frame_window_update.h"
#include "src/core/ext/transport/chttp2/transport/internal.h"
-#include "y_absl/strings/str_cat.h"
-#include "y_absl/strings/str_format.h"
-
+#include "y_absl/strings/str_cat.h"
+#include "y_absl/strings/str_format.h"
+
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
@@ -56,10 +56,10 @@ grpc_slice grpc_chttp2_window_update_create(
grpc_error* grpc_chttp2_window_update_parser_begin_frame(
grpc_chttp2_window_update_parser* parser, uint32_t length, uint8_t flags) {
if (flags || length != 4) {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrFormat("invalid window update: length=%d, flags=%02x", length,
- flags)
- .c_str());
+ return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrFormat("invalid window update: length=%d, flags=%02x", length,
+ flags)
+ .c_str());
}
parser->byte = 0;
parser->amount = 0;
@@ -91,8 +91,8 @@ grpc_error* grpc_chttp2_window_update_parser_parse(void* parser,
// top bit is reserved and must be ignored.
uint32_t received_update = p->amount & 0x7fffffffu;
if (received_update == 0) {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("invalid window update bytes: ", p->amount).c_str());
+ return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrCat("invalid window update bytes: ", p->amount).c_str());
}
GPR_ASSERT(is_last);
diff --git a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/hpack_encoder.cc b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/hpack_encoder.cc
index 5f09adc3a9a..4ceaec24b3d 100644
--- a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/hpack_encoder.cc
+++ b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/hpack_encoder.cc
@@ -277,7 +277,7 @@ struct framer_state {
/* maximum size of a frame */
size_t max_frame_size;
bool use_true_binary_metadata;
- bool is_end_of_stream;
+ bool is_end_of_stream;
};
/* fills p (which is expected to be kDataFrameHeaderSize bytes long)
* with a data frame header */
@@ -315,29 +315,29 @@ static size_t current_frame_size(framer_state* st) {
}
/* finish a frame - fill in the previously reserved header */
-static void finish_frame(framer_state* st, int is_header_boundary) {
+static void finish_frame(framer_state* st, int is_header_boundary) {
uint8_t type = 0xff;
- type =
- static_cast<uint8_t>(st->is_first_frame ? GRPC_CHTTP2_FRAME_HEADER
- : GRPC_CHTTP2_FRAME_CONTINUATION);
- uint8_t flags = 0xff;
- /* per the HTTP/2 spec:
- A HEADERS frame carries the END_STREAM flag that signals the end of a
- stream. However, a HEADERS frame with the END_STREAM flag set can be
- followed by CONTINUATION frames on the same stream. Logically, the
- CONTINUATION frames are part of the HEADERS frame.
- Thus, we add the END_STREAM flag to the HEADER frame (the first frame). */
- flags = static_cast<uint8_t>(st->is_first_frame && st->is_end_of_stream
- ? GRPC_CHTTP2_DATA_FLAG_END_STREAM
- : 0);
- /* per the HTTP/2 spec:
- A HEADERS frame without the END_HEADERS flag set MUST be followed by
- a CONTINUATION frame for the same stream.
- Thus, we add the END_HEADER flag to the last frame. */
- flags |= static_cast<uint8_t>(
- is_header_boundary ? GRPC_CHTTP2_DATA_FLAG_END_HEADERS : 0);
- fill_header(GRPC_SLICE_START_PTR(st->output->slices[st->header_idx]), type,
- st->stream_id, current_frame_size(st), flags);
+ type =
+ static_cast<uint8_t>(st->is_first_frame ? GRPC_CHTTP2_FRAME_HEADER
+ : GRPC_CHTTP2_FRAME_CONTINUATION);
+ uint8_t flags = 0xff;
+ /* per the HTTP/2 spec:
+ A HEADERS frame carries the END_STREAM flag that signals the end of a
+ stream. However, a HEADERS frame with the END_STREAM flag set can be
+ followed by CONTINUATION frames on the same stream. Logically, the
+ CONTINUATION frames are part of the HEADERS frame.
+ Thus, we add the END_STREAM flag to the HEADER frame (the first frame). */
+ flags = static_cast<uint8_t>(st->is_first_frame && st->is_end_of_stream
+ ? GRPC_CHTTP2_DATA_FLAG_END_STREAM
+ : 0);
+ /* per the HTTP/2 spec:
+ A HEADERS frame without the END_HEADERS flag set MUST be followed by
+ a CONTINUATION frame for the same stream.
+ Thus, we add the END_HEADER flag to the last frame. */
+ flags |= static_cast<uint8_t>(
+ is_header_boundary ? GRPC_CHTTP2_DATA_FLAG_END_HEADERS : 0);
+ fill_header(GRPC_SLICE_START_PTR(st->output->slices[st->header_idx]), type,
+ st->stream_id, current_frame_size(st), flags);
st->stats->framing_bytes += kDataFrameHeaderSize;
st->is_first_frame = 0;
}
@@ -359,7 +359,7 @@ static void ensure_space(framer_state* st, size_t need_bytes) {
if (GPR_LIKELY(current_frame_size(st) + need_bytes <= st->max_frame_size)) {
return;
}
- finish_frame(st, 0);
+ finish_frame(st, 0);
begin_frame(st);
}
@@ -374,7 +374,7 @@ static void add_header_data(framer_state* st, grpc_slice slice) {
} else {
st->stats->header_bytes += remaining;
grpc_slice_buffer_add(st->output, grpc_slice_split_head(&slice, remaining));
- finish_frame(st, 0);
+ finish_frame(st, 0);
begin_frame(st);
add_header_data(st, slice);
}
@@ -853,7 +853,7 @@ void grpc_chttp2_encode_header(grpc_chttp2_hpack_compressor* c,
st.stats = options->stats;
st.max_frame_size = options->max_frame_size;
st.use_true_binary_metadata = options->use_true_binary_metadata;
- st.is_end_of_stream = options->is_eof;
+ st.is_end_of_stream = options->is_eof;
/* Encode a metadata batch; store the returned values, representing
a metadata element that needs to be unreffed back into the metadata
@@ -896,5 +896,5 @@ void grpc_chttp2_encode_header(grpc_chttp2_hpack_compressor* c,
deadline_enc(c, deadline, &st);
}
- finish_frame(&st, 1);
+ finish_frame(&st, 1);
}
diff --git a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/hpack_parser.cc b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/hpack_parser.cc
index ae5b336b4d1..a325439ad59 100644
--- a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/hpack_parser.cc
+++ b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/hpack_parser.cc
@@ -25,9 +25,9 @@
#include <stddef.h>
#include <string.h>
-#include "y_absl/strings/str_cat.h"
-#include "y_absl/strings/str_format.h"
-
+#include "y_absl/strings/str_cat.h"
+#include "y_absl/strings/str_format.h"
+
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
@@ -1089,8 +1089,8 @@ static grpc_error* still_parse_error(grpc_chttp2_hpack_parser* p,
static grpc_error* parse_illegal_op(grpc_chttp2_hpack_parser* p,
const uint8_t* cur, const uint8_t* end) {
GPR_ASSERT(cur != end);
- grpc_error* err = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("Illegal hpack op code ", *cur).c_str());
+ grpc_error* err = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrCat("Illegal hpack op code ", *cur).c_str());
return parse_error(p, cur, end, err);
}
@@ -1199,12 +1199,12 @@ static grpc_error* parse_value4(grpc_chttp2_hpack_parser* p, const uint8_t* cur,
}
error:
- grpc_error* err = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrFormat(
- "integer overflow in hpack integer decoding: have 0x%08x, "
- "got byte 0x%02x on byte 5",
- *p->parsing.value, *cur)
- .c_str());
+ grpc_error* err = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrFormat(
+ "integer overflow in hpack integer decoding: have 0x%08x, "
+ "got byte 0x%02x on byte 5",
+ *p->parsing.value, *cur)
+ .c_str());
return parse_error(p, cur, end, err);
}
@@ -1226,12 +1226,12 @@ static grpc_error* parse_value5up(grpc_chttp2_hpack_parser* p,
return parse_next(p, cur + 1, end);
}
- grpc_error* err = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrFormat(
- "integer overflow in hpack integer decoding: have 0x%08x, "
- "got byte 0x%02x sometime after byte 5",
- *p->parsing.value, *cur)
- .c_str());
+ grpc_error* err = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrFormat(
+ "integer overflow in hpack integer decoding: have 0x%08x, "
+ "got byte 0x%02x sometime after byte 5",
+ *p->parsing.value, *cur)
+ .c_str());
return parse_error(p, cur, end, err);
}
@@ -1387,10 +1387,10 @@ static grpc_error* finish_str(grpc_chttp2_hpack_parser* p, const uint8_t* cur,
case B64_BYTE2:
bits = p->base64_buffer;
if (bits & 0xffff) {
- grpc_error* err = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrFormat("trailing bits in base64 encoding: 0x%04x",
- bits & 0xffff)
- .c_str());
+ grpc_error* err = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrFormat("trailing bits in base64 encoding: 0x%04x",
+ bits & 0xffff)
+ .c_str());
return parse_error(p, cur, end, err);
}
decoded[0] = static_cast<uint8_t>(bits >> 16);
@@ -1399,10 +1399,10 @@ static grpc_error* finish_str(grpc_chttp2_hpack_parser* p, const uint8_t* cur,
case B64_BYTE3:
bits = p->base64_buffer;
if (bits & 0xff) {
- grpc_error* err = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrFormat("trailing bits in base64 encoding: 0x%02x",
- bits & 0xff)
- .c_str());
+ grpc_error* err = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrFormat("trailing bits in base64 encoding: 0x%02x",
+ bits & 0xff)
+ .c_str());
return parse_error(p, cur, end, err);
}
decoded[0] = static_cast<uint8_t>(bits >> 16);
diff --git a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/hpack_table.cc b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/hpack_table.cc
index 862b1af8761..812d17cb457 100644
--- a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/hpack_table.cc
+++ b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/hpack_table.cc
@@ -23,8 +23,8 @@
#include <assert.h>
#include <string.h>
-#include "y_absl/strings/str_format.h"
-
+#include "y_absl/strings/str_format.h"
+
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
@@ -120,11 +120,11 @@ grpc_error* grpc_chttp2_hptbl_set_current_table_size(grpc_chttp2_hptbl* tbl,
return GRPC_ERROR_NONE;
}
if (bytes > tbl->max_bytes) {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrFormat(
- "Attempt to make hpack table %d bytes when max is %d bytes", bytes,
- tbl->max_bytes)
- .c_str());
+ return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrFormat(
+ "Attempt to make hpack table %d bytes when max is %d bytes", bytes,
+ tbl->max_bytes)
+ .c_str());
}
if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace)) {
gpr_log(GPR_INFO, "Update hpack parser table size to %d", bytes);
@@ -152,12 +152,12 @@ grpc_error* grpc_chttp2_hptbl_add(grpc_chttp2_hptbl* tbl, grpc_mdelem md) {
GRPC_CHTTP2_HPACK_ENTRY_OVERHEAD;
if (tbl->current_table_bytes > tbl->max_bytes) {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrFormat(
- "HPACK max table size reduced to %d but not reflected by hpack "
- "stream (still at %d)",
- tbl->max_bytes, tbl->current_table_bytes)
- .c_str());
+ return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrFormat(
+ "HPACK max table size reduced to %d but not reflected by hpack "
+ "stream (still at %d)",
+ tbl->max_bytes, tbl->current_table_bytes)
+ .c_str());
}
/* we can't add elements bigger than the max table size */
diff --git a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/internal.h b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/internal.h
index 349e5f4ff0c..2f028c08f38 100644
--- a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/internal.h
+++ b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/internal.h
@@ -52,12 +52,12 @@ class ContextList;
/* streams are kept in various linked lists depending on what things need to
happen to them... this enum labels each list */
typedef enum {
- /* If a stream is in the following two lists, an explicit ref is associated
- with the stream */
+ /* If a stream is in the following two lists, an explicit ref is associated
+ with the stream */
GRPC_CHTTP2_LIST_WRITABLE,
GRPC_CHTTP2_LIST_WRITING,
- /* No additional ref is taken for the following refs. Make sure to remove the
- stream from these lists when the stream is removed. */
+ /* No additional ref is taken for the following refs. Make sure to remove the
+ stream from these lists when the stream is removed. */
GRPC_CHTTP2_LIST_STALLED_BY_TRANSPORT,
GRPC_CHTTP2_LIST_STALLED_BY_STREAM,
/** streams that are waiting to start because there are too many concurrent
@@ -101,7 +101,7 @@ typedef enum {
GRPC_CHTTP2_INITIATE_WRITE_FLOW_CONTROL_UNSTALLED_BY_SETTING,
GRPC_CHTTP2_INITIATE_WRITE_FLOW_CONTROL_UNSTALLED_BY_UPDATE,
GRPC_CHTTP2_INITIATE_WRITE_APPLICATION_PING,
- GRPC_CHTTP2_INITIATE_WRITE_BDP_PING,
+ GRPC_CHTTP2_INITIATE_WRITE_BDP_PING,
GRPC_CHTTP2_INITIATE_WRITE_KEEPALIVE_PING,
GRPC_CHTTP2_INITIATE_WRITE_TRANSPORT_FLOW_CONTROL_UNSTALLED,
GRPC_CHTTP2_INITIATE_WRITE_PING_RESPONSE,
@@ -295,7 +295,7 @@ struct grpc_chttp2_transport {
grpc_transport base; /* must be first */
grpc_core::RefCount refs;
grpc_endpoint* ep;
- TString peer_string;
+ TString peer_string;
grpc_resource_user* resource_user;
@@ -435,8 +435,8 @@ struct grpc_chttp2_transport {
grpc_chttp2_write_cb* write_cb_pool = nullptr;
/* bdp estimator */
- bool bdp_ping_blocked =
- false; /* Is the BDP blocked due to not receiving any data? */
+ bool bdp_ping_blocked =
+ false; /* Is the BDP blocked due to not receiving any data? */
grpc_closure next_bdp_ping_timer_expired_locked;
grpc_closure start_bdp_ping_locked;
grpc_closure finish_bdp_ping_locked;
@@ -534,13 +534,13 @@ struct grpc_chttp2_stream {
grpc_metadata_batch* send_initial_metadata = nullptr;
grpc_closure* send_initial_metadata_finished = nullptr;
grpc_metadata_batch* send_trailing_metadata = nullptr;
- // TODO(yashykt): Find a better name for the below field and others in this
- // struct to betteer distinguish inputs, return values, and
- // internal state.
- // sent_trailing_metadata_op allows the transport to fill in to the upper
- // layer whether this stream was able to send its trailing metadata (used for
- // detecting cancellation on the server-side)..
- bool* sent_trailing_metadata_op = nullptr;
+ // TODO(yashykt): Find a better name for the below field and others in this
+ // struct to betteer distinguish inputs, return values, and
+ // internal state.
+ // sent_trailing_metadata_op allows the transport to fill in to the upper
+ // layer whether this stream was able to send its trailing metadata (used for
+ // detecting cancellation on the server-side)..
+ bool* sent_trailing_metadata_op = nullptr;
grpc_closure* send_trailing_metadata_finished = nullptr;
grpc_core::OrphanablePtr<grpc_core::ByteStream> fetching_send_message;
@@ -850,12 +850,12 @@ void grpc_chttp2_ack_ping(grpc_chttp2_transport* t, uint64_t id);
"too_many_pings" followed by immediately closing the connection. */
void grpc_chttp2_add_ping_strike(grpc_chttp2_transport* t);
-/** Resets ping clock. Should be called when flushing window updates,
- * initial/trailing metadata or data frames. For a server, it resets the number
- * of ping strikes and the last_ping_recv_time. For a ping sender, it resets
- * pings_before_data_required. */
-void grpc_chttp2_reset_ping_clock(grpc_chttp2_transport* t);
-
+/** Resets ping clock. Should be called when flushing window updates,
+ * initial/trailing metadata or data frames. For a server, it resets the number
+ * of ping strikes and the last_ping_recv_time. For a ping sender, it resets
+ * pings_before_data_required. */
+void grpc_chttp2_reset_ping_clock(grpc_chttp2_transport* t);
+
/** add a ref to the stream and add it to the writable list;
ref will be dropped in writing.c */
void grpc_chttp2_mark_stream_writable(grpc_chttp2_transport* t,
@@ -881,6 +881,6 @@ void grpc_chttp2_config_default_keepalive_args(grpc_channel_args* args,
void grpc_chttp2_retry_initiate_ping(void* tp, grpc_error* error);
-void schedule_bdp_ping_locked(grpc_chttp2_transport* t);
-
+void schedule_bdp_ping_locked(grpc_chttp2_transport* t);
+
#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_INTERNAL_H */
diff --git a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/parsing.cc b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/parsing.cc
index 68a3e5d64f6..741d72041b2 100644
--- a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/parsing.cc
+++ b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/parsing.cc
@@ -22,9 +22,9 @@
#include <string.h>
-#include "y_absl/strings/str_cat.h"
-#include "y_absl/strings/str_format.h"
-
+#include "y_absl/strings/str_cat.h"
+#include "y_absl/strings/str_format.h"
+
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
@@ -87,15 +87,15 @@ grpc_error* grpc_chttp2_perform_read(grpc_chttp2_transport* t,
case GRPC_DTS_CLIENT_PREFIX_23:
while (cur != end && t->deframe_state != GRPC_DTS_FH_0) {
if (*cur != GRPC_CHTTP2_CLIENT_CONNECT_STRING[t->deframe_state]) {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrFormat(
- "Connect string mismatch: expected '%c' (%d) got '%c' (%d) "
- "at byte %d",
- GRPC_CHTTP2_CLIENT_CONNECT_STRING[t->deframe_state],
- static_cast<int>(static_cast<uint8_t>(
- GRPC_CHTTP2_CLIENT_CONNECT_STRING[t->deframe_state])),
- *cur, static_cast<int>(*cur), t->deframe_state)
- .c_str());
+ return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrFormat(
+ "Connect string mismatch: expected '%c' (%d) got '%c' (%d) "
+ "at byte %d",
+ GRPC_CHTTP2_CLIENT_CONNECT_STRING[t->deframe_state],
+ static_cast<int>(static_cast<uint8_t>(
+ GRPC_CHTTP2_CLIENT_CONNECT_STRING[t->deframe_state])),
+ *cur, static_cast<int>(*cur), t->deframe_state)
+ .c_str());
}
++cur;
t->deframe_state = static_cast<grpc_chttp2_deframe_transport_state>(
@@ -193,12 +193,12 @@ grpc_error* grpc_chttp2_perform_read(grpc_chttp2_transport* t,
t->incoming_frame_size >
t->settings[GRPC_ACKED_SETTINGS]
[GRPC_CHTTP2_SETTINGS_MAX_FRAME_SIZE]) {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrFormat("Frame size %d is larger than max frame size %d",
- t->incoming_frame_size,
- t->settings[GRPC_ACKED_SETTINGS]
- [GRPC_CHTTP2_SETTINGS_MAX_FRAME_SIZE])
- .c_str());
+ return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrFormat("Frame size %d is larger than max frame size %d",
+ t->incoming_frame_size,
+ t->settings[GRPC_ACKED_SETTINGS]
+ [GRPC_CHTTP2_SETTINGS_MAX_FRAME_SIZE])
+ .c_str());
}
if (++cur == end) {
return GRPC_ERROR_NONE;
@@ -252,27 +252,27 @@ grpc_error* grpc_chttp2_perform_read(grpc_chttp2_transport* t,
static grpc_error* init_frame_parser(grpc_chttp2_transport* t) {
if (t->is_first_frame &&
t->incoming_frame_type != GRPC_CHTTP2_FRAME_SETTINGS) {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat(
- "Expected SETTINGS frame as the first frame, got frame type ",
- t->incoming_frame_type)
- .c_str());
+ return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrCat(
+ "Expected SETTINGS frame as the first frame, got frame type ",
+ t->incoming_frame_type)
+ .c_str());
}
t->is_first_frame = false;
if (t->expect_continuation_stream_id != 0) {
if (t->incoming_frame_type != GRPC_CHTTP2_FRAME_CONTINUATION) {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrFormat("Expected CONTINUATION frame, got frame type %02x",
- t->incoming_frame_type)
- .c_str());
+ return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrFormat("Expected CONTINUATION frame, got frame type %02x",
+ t->incoming_frame_type)
+ .c_str());
}
if (t->expect_continuation_stream_id != t->incoming_stream_id) {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrFormat(
- "Expected CONTINUATION frame for grpc_chttp2_stream %08x, got "
- "grpc_chttp2_stream %08x",
- t->expect_continuation_stream_id, t->incoming_stream_id)
- .c_str());
+ return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrFormat(
+ "Expected CONTINUATION frame for grpc_chttp2_stream %08x, got "
+ "grpc_chttp2_stream %08x",
+ t->expect_continuation_stream_id, t->incoming_stream_id)
+ .c_str());
}
return init_header_frame_parser(t, 1);
}
@@ -334,16 +334,16 @@ void grpc_chttp2_parsing_become_skip_parser(grpc_chttp2_transport* t) {
}
static grpc_error* init_data_frame_parser(grpc_chttp2_transport* t) {
- // Update BDP accounting since we have received a data frame.
- grpc_core::BdpEstimator* bdp_est = t->flow_control->bdp_estimator();
- if (bdp_est) {
- if (t->bdp_ping_blocked) {
- t->bdp_ping_blocked = false;
- GRPC_CHTTP2_REF_TRANSPORT(t, "bdp_ping");
- schedule_bdp_ping_locked(t);
- }
- bdp_est->AddIncomingBytes(t->incoming_frame_size);
- }
+ // Update BDP accounting since we have received a data frame.
+ grpc_core::BdpEstimator* bdp_est = t->flow_control->bdp_estimator();
+ if (bdp_est) {
+ if (t->bdp_ping_blocked) {
+ t->bdp_ping_blocked = false;
+ GRPC_CHTTP2_REF_TRANSPORT(t, "bdp_ping");
+ schedule_bdp_ping_locked(t);
+ }
+ bdp_est->AddIncomingBytes(t->incoming_frame_size);
+ }
grpc_chttp2_stream* s =
grpc_chttp2_parsing_lookup_stream(t, t->incoming_stream_id);
grpc_error* err = GRPC_ERROR_NONE;
@@ -447,8 +447,8 @@ static grpc_error* GPR_ATTRIBUTE_NOINLINE handle_metadata_size_limit_exceeded(
size_t new_size, size_t metadata_size_limit) {
gpr_log(GPR_DEBUG,
"received initial metadata size exceeds limit (%" PRIuPTR
- " vs. %" PRIuPTR
- "). GRPC_ARG_MAX_METADATA_SIZE can be set to increase this limit.",
+ " vs. %" PRIuPTR
+ "). GRPC_ARG_MAX_METADATA_SIZE can be set to increase this limit.",
new_size, metadata_size_limit);
grpc_chttp2_cancel_stream(
t, s,
@@ -483,7 +483,7 @@ static grpc_error* on_initial_header(void* tp, grpc_mdelem md) {
on_initial_header_log(t, s, md);
}
- if (md_key_cmp(md, GRPC_MDSTR_GRPC_TIMEOUT)) {
+ if (md_key_cmp(md, GRPC_MDSTR_GRPC_TIMEOUT)) {
return handle_timeout(s, md);
}
@@ -529,10 +529,10 @@ static grpc_error* on_trailing_header(void* tp, grpc_mdelem md) {
if (new_size > metadata_size_limit) {
gpr_log(GPR_DEBUG,
"received trailing metadata size exceeds limit (%" PRIuPTR
- " vs. %" PRIuPTR
- "). Please note that the status is also included in the trailing "
- "metadata and a large status message can also trigger this. "
- "GRPC_ARG_MAX_METADATA_SIZE can be set to increase this limit.",
+ " vs. %" PRIuPTR
+ "). Please note that the status is also included in the trailing "
+ "metadata and a large status message can also trigger this. "
+ "GRPC_ARG_MAX_METADATA_SIZE can be set to increase this limit.",
new_size, metadata_size_limit);
grpc_chttp2_cancel_stream(
t, s,
diff --git a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/writing.cc b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/writing.cc
index f0c5c4d0ee2..f8e21e8e159 100644
--- a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/writing.cc
+++ b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/writing.cc
@@ -18,7 +18,7 @@
#include <grpc/support/port_platform.h>
-#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
+#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
#include "src/core/ext/transport/chttp2/transport/context_list.h"
#include "src/core/ext/transport/chttp2/transport/internal.h"
@@ -55,10 +55,10 @@ static void maybe_initiate_ping(grpc_chttp2_transport* t) {
if (!grpc_closure_list_empty(pq->lists[GRPC_CHTTP2_PCL_INFLIGHT])) {
/* ping already in-flight: wait */
if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace) ||
- GRPC_TRACE_FLAG_ENABLED(grpc_bdp_estimator_trace) ||
- GRPC_TRACE_FLAG_ENABLED(grpc_keepalive_trace)) {
- gpr_log(GPR_INFO, "%s: Ping delayed [%s]: already pinging",
- t->is_client ? "CLIENT" : "SERVER", t->peer_string.c_str());
+ GRPC_TRACE_FLAG_ENABLED(grpc_bdp_estimator_trace) ||
+ GRPC_TRACE_FLAG_ENABLED(grpc_keepalive_trace)) {
+ gpr_log(GPR_INFO, "%s: Ping delayed [%s]: already pinging",
+ t->is_client ? "CLIENT" : "SERVER", t->peer_string.c_str());
}
return;
}
@@ -66,10 +66,10 @@ static void maybe_initiate_ping(grpc_chttp2_transport* t) {
t->ping_policy.max_pings_without_data != 0) {
/* need to receive something of substance before sending a ping again */
if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace) ||
- GRPC_TRACE_FLAG_ENABLED(grpc_bdp_estimator_trace) ||
- GRPC_TRACE_FLAG_ENABLED(grpc_keepalive_trace)) {
- gpr_log(GPR_INFO, "%s: Ping delayed [%s]: too many recent pings: %d/%d",
- t->is_client ? "CLIENT" : "SERVER", t->peer_string.c_str(),
+ GRPC_TRACE_FLAG_ENABLED(grpc_bdp_estimator_trace) ||
+ GRPC_TRACE_FLAG_ENABLED(grpc_keepalive_trace)) {
+ gpr_log(GPR_INFO, "%s: Ping delayed [%s]: too many recent pings: %d/%d",
+ t->is_client ? "CLIENT" : "SERVER", t->peer_string.c_str(),
t->ping_state.pings_before_data_required,
t->ping_policy.max_pings_without_data);
}
@@ -81,21 +81,21 @@ static void maybe_initiate_ping(grpc_chttp2_transport* t) {
(t->keepalive_permit_without_calls == 0 &&
grpc_chttp2_stream_map_size(&t->stream_map) == 0)
? 7200 * GPR_MS_PER_SEC
- : (t->ping_policy.min_sent_ping_interval_without_data +
- GPR_MS_PER_SEC); /* A second is added to deal with network delays
- and timing imprecision */
+ : (t->ping_policy.min_sent_ping_interval_without_data +
+ GPR_MS_PER_SEC); /* A second is added to deal with network delays
+ and timing imprecision */
grpc_millis next_allowed_ping =
t->ping_state.last_ping_sent_time + next_allowed_ping_interval;
if (next_allowed_ping > now) {
/* not enough elapsed time between successive pings */
if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace) ||
- GRPC_TRACE_FLAG_ENABLED(grpc_bdp_estimator_trace) ||
- GRPC_TRACE_FLAG_ENABLED(grpc_keepalive_trace)) {
+ GRPC_TRACE_FLAG_ENABLED(grpc_bdp_estimator_trace) ||
+ GRPC_TRACE_FLAG_ENABLED(grpc_keepalive_trace)) {
gpr_log(GPR_INFO,
- "%s: Ping delayed [%s]: not enough time elapsed since last ping. "
+ "%s: Ping delayed [%s]: not enough time elapsed since last ping. "
" Last ping %f: Next ping %f: Now %f",
- t->is_client ? "CLIENT" : "SERVER", t->peer_string.c_str(),
+ t->is_client ? "CLIENT" : "SERVER", t->peer_string.c_str(),
static_cast<double>(t->ping_state.last_ping_sent_time),
static_cast<double>(next_allowed_ping), static_cast<double>(now));
}
@@ -122,10 +122,10 @@ static void maybe_initiate_ping(grpc_chttp2_transport* t) {
GRPC_STATS_INC_HTTP2_PINGS_SENT();
t->ping_state.last_ping_sent_time = now;
if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace) ||
- GRPC_TRACE_FLAG_ENABLED(grpc_bdp_estimator_trace) ||
- GRPC_TRACE_FLAG_ENABLED(grpc_keepalive_trace)) {
+ GRPC_TRACE_FLAG_ENABLED(grpc_bdp_estimator_trace) ||
+ GRPC_TRACE_FLAG_ENABLED(grpc_keepalive_trace)) {
gpr_log(GPR_INFO, "%s: Ping sent [%s]: %d/%d",
- t->is_client ? "CLIENT" : "SERVER", t->peer_string.c_str(),
+ t->is_client ? "CLIENT" : "SERVER", t->peer_string.c_str(),
t->ping_state.pings_before_data_required,
t->ping_policy.max_pings_without_data);
}
@@ -165,8 +165,8 @@ static void report_stall(grpc_chttp2_transport* t, grpc_chttp2_stream* s,
"helpful data: [fc:pending=%" PRIdPTR ":pending-compressed=%" PRIdPTR
":flowed=%" PRId64 ":peer_initwin=%d:t_win=%" PRId64
":s_win=%d:s_delta=%" PRId64 "]",
- t->peer_string.c_str(), t, s->id, staller,
- s->flow_controlled_buffer.length,
+ t->peer_string.c_str(), t, s->id, staller,
+ s->flow_controlled_buffer.length,
s->stream_compression_method ==
GRPC_STREAM_COMPRESSION_IDENTITY_COMPRESS
? 0
@@ -243,7 +243,7 @@ class WriteContext {
grpc_slice_buffer_add(
&t_->outbuf, grpc_chttp2_window_update_create(0, transport_announce,
&throwaway_stats));
- grpc_chttp2_reset_ping_clock(t_);
+ grpc_chttp2_reset_ping_clock(t_);
}
}
@@ -466,7 +466,7 @@ class StreamWriteContext {
};
grpc_chttp2_encode_header(&t_->hpack_compressor, nullptr, 0,
s_->send_initial_metadata, &hopt, &t_->outbuf);
- grpc_chttp2_reset_ping_clock(t_);
+ grpc_chttp2_reset_ping_clock(t_);
write_context_->IncInitialMetadataWrites();
}
@@ -478,7 +478,7 @@ class StreamWriteContext {
"send_initial_metadata_finished");
}
- size_t compressed_data_buffer_len() {
+ size_t compressed_data_buffer_len() {
return s_->stream_compression_method ==
GRPC_STREAM_COMPRESSION_IDENTITY_COMPRESS
? 0
@@ -493,7 +493,7 @@ class StreamWriteContext {
grpc_slice_buffer_add(
&t_->outbuf, grpc_chttp2_window_update_create(s_->id, stream_announce,
&s_->stats.outgoing));
- grpc_chttp2_reset_ping_clock(t_);
+ grpc_chttp2_reset_ping_clock(t_);
write_context_->IncWindowUpdateWrites();
}
@@ -535,7 +535,7 @@ class StreamWriteContext {
}
}
}
- grpc_chttp2_reset_ping_clock(t_);
+ grpc_chttp2_reset_ping_clock(t_);
if (data_send_context.is_last_frame()) {
SentLastFrame();
}
@@ -576,7 +576,7 @@ class StreamWriteContext {
s_->send_trailing_metadata, &hopt, &t_->outbuf);
}
write_context_->IncTrailingMetadataWrites();
- grpc_chttp2_reset_ping_clock(t_);
+ grpc_chttp2_reset_ping_clock(t_);
SentLastFrame();
write_context_->NoteScheduledResults();
@@ -607,10 +607,10 @@ class StreamWriteContext {
void SentLastFrame() {
s_->send_trailing_metadata = nullptr;
- if (s_->sent_trailing_metadata_op) {
- *s_->sent_trailing_metadata_op = true;
- s_->sent_trailing_metadata_op = nullptr;
- }
+ if (s_->sent_trailing_metadata_op) {
+ *s_->sent_trailing_metadata_op = true;
+ s_->sent_trailing_metadata_op = nullptr;
+ }
s_->sent_trailing_metadata = true;
s_->eos_sent = true;
diff --git a/contrib/libs/grpc/src/core/ext/transport/inproc/inproc_transport.cc b/contrib/libs/grpc/src/core/ext/transport/inproc/inproc_transport.cc
index c3ad5eabbd9..728831f3648 100644
--- a/contrib/libs/grpc/src/core/ext/transport/inproc/inproc_transport.cc
+++ b/contrib/libs/grpc/src/core/ext/transport/inproc/inproc_transport.cc
@@ -51,8 +51,8 @@ grpc_slice g_fake_auth_value;
struct inproc_stream;
bool cancel_stream_locked(inproc_stream* s, grpc_error* error);
-void maybe_process_ops_locked(inproc_stream* s, grpc_error* error);
-void op_state_machine_locked(inproc_stream* s, grpc_error* error);
+void maybe_process_ops_locked(inproc_stream* s, grpc_error* error);
+void op_state_machine_locked(inproc_stream* s, grpc_error* error);
void log_metadata(const grpc_metadata_batch* md_batch, bool is_client,
bool is_initial);
grpc_error* fill_in_metadata(inproc_stream* s,
@@ -185,7 +185,7 @@ struct inproc_stream {
if (cs->write_buffer_cancel_error != GRPC_ERROR_NONE) {
cancel_other_error = cs->write_buffer_cancel_error;
cs->write_buffer_cancel_error = GRPC_ERROR_NONE;
- maybe_process_ops_locked(this, cancel_other_error);
+ maybe_process_ops_locked(this, cancel_other_error);
}
gpr_mu_unlock(&t->mu->mu);
@@ -261,11 +261,11 @@ struct inproc_stream {
bool trailing_md_sent = false;
bool initial_md_recvd = false;
bool trailing_md_recvd = false;
- // The following tracks if the server-side only pretends to have received
- // trailing metadata since it no longer cares about the RPC. If that is the
- // case, it is still ok for the client to send trailing metadata (in which
- // case it will be ignored).
- bool trailing_md_recvd_implicit_only = false;
+ // The following tracks if the server-side only pretends to have received
+ // trailing metadata since it no longer cares about the RPC. If that is the
+ // case, it is still ok for the client to send trailing metadata (in which
+ // case it will be ignored).
+ bool trailing_md_recvd_implicit_only = false;
bool closed = false;
@@ -393,10 +393,10 @@ void complete_if_batch_end_locked(inproc_stream* s, grpc_error* error,
}
}
-void maybe_process_ops_locked(inproc_stream* s, grpc_error* error) {
- if (s && (error != GRPC_ERROR_NONE || s->ops_needed)) {
+void maybe_process_ops_locked(inproc_stream* s, grpc_error* error) {
+ if (s && (error != GRPC_ERROR_NONE || s->ops_needed)) {
s->ops_needed = false;
- op_state_machine_locked(s, error);
+ op_state_machine_locked(s, error);
}
}
@@ -424,7 +424,7 @@ void fail_helper_locked(inproc_stream* s, grpc_error* error) {
if (other->cancel_other_error == GRPC_ERROR_NONE) {
other->cancel_other_error = GRPC_ERROR_REF(error);
}
- maybe_process_ops_locked(other, error);
+ maybe_process_ops_locked(other, error);
} else if (s->write_buffer_cancel_error == GRPC_ERROR_NONE) {
s->write_buffer_cancel_error = GRPC_ERROR_REF(error);
}
@@ -582,7 +582,7 @@ void message_transfer_locked(inproc_stream* sender, inproc_stream* receiver) {
sender->send_message_op = nullptr;
}
-void op_state_machine_locked(inproc_stream* s, grpc_error* error) {
+void op_state_machine_locked(inproc_stream* s, grpc_error* error) {
// This function gets called when we have contents in the unprocessed reads
// Get what we want based on our ops wanted
// Schedule our appropriate closures
@@ -592,7 +592,7 @@ void op_state_machine_locked(inproc_stream* s, grpc_error* error) {
bool needs_close = false;
- INPROC_LOG(GPR_INFO, "op_state_machine %p", s);
+ INPROC_LOG(GPR_INFO, "op_state_machine %p", s);
// cancellation takes precedence
inproc_stream* other = s->other_side;
@@ -610,13 +610,13 @@ void op_state_machine_locked(inproc_stream* s, grpc_error* error) {
if (s->send_message_op && other) {
if (other->recv_message_op) {
message_transfer_locked(s, other);
- maybe_process_ops_locked(other, GRPC_ERROR_NONE);
+ maybe_process_ops_locked(other, GRPC_ERROR_NONE);
} else if (!s->t->is_client && s->trailing_md_sent) {
// A server send will never be matched if the server already sent status
s->send_message_op->payload->send_message.send_message.reset();
complete_if_batch_end_locked(
s, GRPC_ERROR_NONE, s->send_message_op,
- "op_state_machine scheduling send-message-on-complete case 1");
+ "op_state_machine scheduling send-message-on-complete case 1");
s->send_message_op = nullptr;
}
}
@@ -651,9 +651,9 @@ void op_state_machine_locked(inproc_stream* s, grpc_error* error) {
0, dest, nullptr, destfilled);
}
s->trailing_md_sent = true;
- if (s->send_trailing_md_op->payload->send_trailing_metadata.sent) {
- *s->send_trailing_md_op->payload->send_trailing_metadata.sent = true;
- }
+ if (s->send_trailing_md_op->payload->send_trailing_metadata.sent) {
+ *s->send_trailing_md_op->payload->send_trailing_metadata.sent = true;
+ }
if (!s->t->is_client && s->trailing_md_recvd && s->recv_trailing_md_op) {
INPROC_LOG(GPR_INFO,
"op_state_machine %p scheduling trailing-metadata-ready", s);
@@ -671,7 +671,7 @@ void op_state_machine_locked(inproc_stream* s, grpc_error* error) {
needs_close = true;
}
}
- maybe_process_ops_locked(other, GRPC_ERROR_NONE);
+ maybe_process_ops_locked(other, GRPC_ERROR_NONE);
complete_if_batch_end_locked(
s, GRPC_ERROR_NONE, s->send_trailing_md_op,
"op_state_machine scheduling send-trailing-metadata-on-complete");
@@ -733,30 +733,30 @@ void op_state_machine_locked(inproc_stream* s, grpc_error* error) {
if (s->recv_message_op) {
if (other && other->send_message_op) {
message_transfer_locked(other, s);
- maybe_process_ops_locked(other, GRPC_ERROR_NONE);
+ maybe_process_ops_locked(other, GRPC_ERROR_NONE);
}
}
if (s->to_read_trailing_md_filled) {
if (s->trailing_md_recvd) {
- if (s->trailing_md_recvd_implicit_only) {
- INPROC_LOG(GPR_INFO,
- "op_state_machine %p already implicitly received trailing "
- "metadata, so ignoring new trailing metadata from client",
- s);
- grpc_metadata_batch_clear(&s->to_read_trailing_md);
- s->to_read_trailing_md_filled = false;
- s->trailing_md_recvd_implicit_only = false;
- } else {
- new_err =
- GRPC_ERROR_CREATE_FROM_STATIC_STRING("Already recvd trailing md");
- INPROC_LOG(
- GPR_INFO,
- "op_state_machine %p scheduling on_complete errors for already "
- "recvd trailing md %p",
- s, new_err);
- fail_helper_locked(s, GRPC_ERROR_REF(new_err));
- goto done;
- }
+ if (s->trailing_md_recvd_implicit_only) {
+ INPROC_LOG(GPR_INFO,
+ "op_state_machine %p already implicitly received trailing "
+ "metadata, so ignoring new trailing metadata from client",
+ s);
+ grpc_metadata_batch_clear(&s->to_read_trailing_md);
+ s->to_read_trailing_md_filled = false;
+ s->trailing_md_recvd_implicit_only = false;
+ } else {
+ new_err =
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("Already recvd trailing md");
+ INPROC_LOG(
+ GPR_INFO,
+ "op_state_machine %p scheduling on_complete errors for already "
+ "recvd trailing md %p",
+ s, new_err);
+ fail_helper_locked(s, GRPC_ERROR_REF(new_err));
+ goto done;
+ }
}
if (s->recv_message_op != nullptr) {
// This message needs to be wrapped up because it will never be
@@ -776,10 +776,10 @@ void op_state_machine_locked(inproc_stream* s, grpc_error* error) {
// Nothing further will try to receive from this stream, so finish off
// any outstanding send_message op
s->send_message_op->payload->send_message.send_message.reset();
- s->send_message_op->payload->send_message.stream_write_closed = true;
+ s->send_message_op->payload->send_message.stream_write_closed = true;
complete_if_batch_end_locked(
s, new_err, s->send_message_op,
- "op_state_machine scheduling send-message-on-complete case 2");
+ "op_state_machine scheduling send-message-on-complete case 2");
s->send_message_op = nullptr;
}
if (s->recv_trailing_md_op != nullptr) {
@@ -811,40 +811,40 @@ void op_state_machine_locked(inproc_stream* s, grpc_error* error) {
s->recv_trailing_md_op->on_complete,
GRPC_ERROR_REF(new_err));
s->recv_trailing_md_op = nullptr;
- needs_close = s->trailing_md_sent;
+ needs_close = s->trailing_md_sent;
} else {
INPROC_LOG(GPR_INFO,
"op_state_machine %p server needs to delay handling "
"trailing-md-on-complete %p",
s, new_err);
}
- } else if (!s->trailing_md_recvd) {
+ } else if (!s->trailing_md_recvd) {
INPROC_LOG(
GPR_INFO,
"op_state_machine %p has trailing md but not yet waiting for it", s);
}
}
- if (!s->t->is_client && s->trailing_md_sent &&
- (s->recv_trailing_md_op != nullptr)) {
- // In this case, we don't care to receive the write-close from the client
- // because we have already sent status and the RPC is over as far as we
- // are concerned.
- INPROC_LOG(GPR_INFO, "op_state_machine %p scheduling trailing-md-ready %p",
- s, new_err);
- grpc_core::ExecCtx::Run(
- DEBUG_LOCATION,
- s->recv_trailing_md_op->payload->recv_trailing_metadata
- .recv_trailing_metadata_ready,
- GRPC_ERROR_REF(new_err));
- complete_if_batch_end_locked(
- s, new_err, s->recv_trailing_md_op,
- "op_state_machine scheduling recv-trailing-md-on-complete");
- s->trailing_md_recvd = true;
- s->recv_trailing_md_op = nullptr;
- // Since we are only pretending to have received the trailing MD, it would
- // be ok (not an error) if the client actually sends it later.
- s->trailing_md_recvd_implicit_only = true;
- }
+ if (!s->t->is_client && s->trailing_md_sent &&
+ (s->recv_trailing_md_op != nullptr)) {
+ // In this case, we don't care to receive the write-close from the client
+ // because we have already sent status and the RPC is over as far as we
+ // are concerned.
+ INPROC_LOG(GPR_INFO, "op_state_machine %p scheduling trailing-md-ready %p",
+ s, new_err);
+ grpc_core::ExecCtx::Run(
+ DEBUG_LOCATION,
+ s->recv_trailing_md_op->payload->recv_trailing_metadata
+ .recv_trailing_metadata_ready,
+ GRPC_ERROR_REF(new_err));
+ complete_if_batch_end_locked(
+ s, new_err, s->recv_trailing_md_op,
+ "op_state_machine scheduling recv-trailing-md-on-complete");
+ s->trailing_md_recvd = true;
+ s->recv_trailing_md_op = nullptr;
+ // Since we are only pretending to have received the trailing MD, it would
+ // be ok (not an error) if the client actually sends it later.
+ s->trailing_md_recvd_implicit_only = true;
+ }
if (s->trailing_md_recvd && s->recv_message_op) {
// No further message will come on this stream, so finish off the
// recv_message_op
@@ -859,13 +859,13 @@ void op_state_machine_locked(inproc_stream* s, grpc_error* error) {
"op_state_machine scheduling recv-message-on-complete");
s->recv_message_op = nullptr;
}
- if (s->trailing_md_recvd && s->send_message_op && s->t->is_client) {
+ if (s->trailing_md_recvd && s->send_message_op && s->t->is_client) {
// Nothing further will try to receive from this stream, so finish off
// any outstanding send_message op
s->send_message_op->payload->send_message.send_message.reset();
complete_if_batch_end_locked(
s, new_err, s->send_message_op,
- "op_state_machine scheduling send-message-on-complete case 3");
+ "op_state_machine scheduling send-message-on-complete case 3");
s->send_message_op = nullptr;
}
if (s->send_message_op || s->send_trailing_md_op || s->recv_initial_md_op ||
@@ -892,9 +892,9 @@ bool cancel_stream_locked(inproc_stream* s, grpc_error* error) {
if (s->cancel_self_error == GRPC_ERROR_NONE) {
ret = true;
s->cancel_self_error = GRPC_ERROR_REF(error);
- // Catch current value of other before it gets closed off
- inproc_stream* other = s->other_side;
- maybe_process_ops_locked(s, s->cancel_self_error);
+ // Catch current value of other before it gets closed off
+ inproc_stream* other = s->other_side;
+ maybe_process_ops_locked(s, s->cancel_self_error);
// Send trailing md to the other side indicating cancellation, even if we
// already have
s->trailing_md_sent = true;
@@ -914,7 +914,7 @@ bool cancel_stream_locked(inproc_stream* s, grpc_error* error) {
if (other->cancel_other_error == GRPC_ERROR_NONE) {
other->cancel_other_error = GRPC_ERROR_REF(s->cancel_self_error);
}
- maybe_process_ops_locked(other, other->cancel_other_error);
+ maybe_process_ops_locked(other, other->cancel_other_error);
} else if (s->write_buffer_cancel_error == GRPC_ERROR_NONE) {
s->write_buffer_cancel_error = GRPC_ERROR_REF(s->cancel_self_error);
}
@@ -1012,7 +1012,7 @@ void perform_stream_op(grpc_transport* gt, grpc_stream* gs,
INPROC_LOG(GPR_INFO, "Extra initial metadata %p", s);
error = GRPC_ERROR_CREATE_FROM_STATIC_STRING("Extra initial metadata");
} else {
- if (!s->other_side_closed) {
+ if (!s->other_side_closed) {
fill_in_metadata(
s, op->payload->send_initial_metadata.send_initial_metadata,
op->payload->send_initial_metadata.send_initial_metadata_flags,
@@ -1026,7 +1026,7 @@ void perform_stream_op(grpc_transport* gt, grpc_stream* gs,
s->initial_md_sent = true;
}
}
- maybe_process_ops_locked(other, error);
+ maybe_process_ops_locked(other, error);
}
}
@@ -1034,7 +1034,7 @@ void perform_stream_op(grpc_transport* gt, grpc_stream* gs,
(op->send_message || op->send_trailing_metadata ||
op->recv_initial_metadata || op->recv_message ||
op->recv_trailing_metadata)) {
- // Mark ops that need to be processed by the state machine
+ // Mark ops that need to be processed by the state machine
if (op->send_message) {
s->send_message_op = op;
}
@@ -1051,7 +1051,7 @@ void perform_stream_op(grpc_transport* gt, grpc_stream* gs,
s->recv_trailing_md_op = op;
}
- // We want to initiate the state machine if:
+ // We want to initiate the state machine if:
// 1. We want to send a message and the other side wants to receive
// 2. We want to send trailing metadata and there isn't an unmatched send
// or the other side wants trailing metadata
@@ -1065,7 +1065,7 @@ void perform_stream_op(grpc_transport* gt, grpc_stream* gs,
(op->recv_initial_metadata && s->to_read_initial_md_filled) ||
(op->recv_message && other && other->send_message_op != nullptr) ||
(s->to_read_trailing_md_filled || s->trailing_md_recvd)) {
- op_state_machine_locked(s, error);
+ op_state_machine_locked(s, error);
} else {
s->ops_needed = true;
}
@@ -1126,8 +1126,8 @@ void perform_stream_op(grpc_transport* gt, grpc_stream* gs,
void close_transport_locked(inproc_transport* t) {
INPROC_LOG(GPR_INFO, "close_transport %p %d", t, t->is_closed);
- t->state_tracker.SetState(GRPC_CHANNEL_SHUTDOWN, y_absl::Status(),
- "close transport");
+ t->state_tracker.SetState(GRPC_CHANNEL_SHUTDOWN, y_absl::Status(),
+ "close transport");
if (!t->is_closed) {
t->is_closed = true;
/* Also end all streams on this transport */
@@ -1177,17 +1177,17 @@ void perform_transport_op(grpc_transport* gt, grpc_transport_op* op) {
gpr_mu_unlock(&t->mu->mu);
}
-void destroy_stream(grpc_transport* gt, grpc_stream* gs,
+void destroy_stream(grpc_transport* gt, grpc_stream* gs,
grpc_closure* then_schedule_closure) {
INPROC_LOG(GPR_INFO, "destroy_stream %p %p", gs, then_schedule_closure);
- inproc_transport* t = reinterpret_cast<inproc_transport*>(gt);
+ inproc_transport* t = reinterpret_cast<inproc_transport*>(gt);
inproc_stream* s = reinterpret_cast<inproc_stream*>(gs);
- gpr_mu_lock(&t->mu->mu);
- close_stream_locked(s);
- gpr_mu_unlock(&t->mu->mu);
+ gpr_mu_lock(&t->mu->mu);
+ close_stream_locked(s);
+ gpr_mu_unlock(&t->mu->mu);
s->~inproc_stream();
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, then_schedule_closure,
- GRPC_ERROR_NONE);
+ grpc_core::ExecCtx::Run(DEBUG_LOCATION, then_schedule_closure,
+ GRPC_ERROR_NONE);
}
void destroy_transport(grpc_transport* gt) {
@@ -1275,7 +1275,7 @@ grpc_channel* grpc_inproc_channel_create(grpc_server* server,
const char* args_to_remove[] = {GRPC_ARG_MAX_CONNECTION_IDLE_MS,
GRPC_ARG_MAX_CONNECTION_AGE_MS};
const grpc_channel_args* server_args = grpc_channel_args_copy_and_remove(
- server->core_server->channel_args(), args_to_remove,
+ server->core_server->channel_args(), args_to_remove,
GPR_ARRAY_SIZE(args_to_remove));
// Add a default authority channel argument for the client
@@ -1292,8 +1292,8 @@ grpc_channel* grpc_inproc_channel_create(grpc_server* server,
client_args);
// TODO(ncteisen): design and support channelz GetSocket for inproc.
- server->core_server->SetupTransport(server_transport, nullptr, server_args,
- nullptr);
+ server->core_server->SetupTransport(server_transport, nullptr, server_args,
+ nullptr);
grpc_channel* channel = grpc_channel_create(
"inproc", client_args, GRPC_CLIENT_DIRECT_CHANNEL, client_transport);
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.c
index 5d80759e0c9..007de310153 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.c
@@ -1,17 +1,17 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/annotations/deprecation.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include <stddef.h>
-#include "upb/msg.h"
-#include "envoy/annotations/deprecation.upb.h"
-#include "google/protobuf/descriptor.upb.h"
-
-#include "upb/port_def.inc"
-
-#include "upb/port_undef.inc"
-
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/annotations/deprecation.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg.h"
+#include "envoy/annotations/deprecation.upb.h"
+#include "google/protobuf/descriptor.upb.h"
+
+#include "upb/port_def.inc"
+
+#include "upb/port_undef.inc"
+
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.h
index ee97e3e7bdb..cdb472fc2f2 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.h
@@ -1,29 +1,29 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/annotations/deprecation.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef ENVOY_ANNOTATIONS_DEPRECATION_PROTO_UPB_H_
-#define ENVOY_ANNOTATIONS_DEPRECATION_PROTO_UPB_H_
-
-#include "upb/msg.h"
-#include "upb/decode.h"
-#include "upb/encode.h"
-
-#include "upb/port_def.inc"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* ENVOY_ANNOTATIONS_DEPRECATION_PROTO_UPB_H_ */
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/annotations/deprecation.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_ANNOTATIONS_DEPRECATION_PROTO_UPB_H_
+#define ENVOY_ANNOTATIONS_DEPRECATION_PROTO_UPB_H_
+
+#include "upb/msg.h"
+#include "upb/decode.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_ANNOTATIONS_DEPRECATION_PROTO_UPB_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/annotations/resource.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/annotations/resource.upb.c
index 7bdcd880287..3e5712a4792 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/annotations/resource.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/annotations/resource.upb.c
@@ -1,27 +1,27 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/annotations/resource.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include <stddef.h>
-#include "upb/msg.h"
-#include "envoy/annotations/resource.upb.h"
-#include "google/protobuf/descriptor.upb.h"
-
-#include "upb/port_def.inc"
-
-static const upb_msglayout_field envoy_annotations_ResourceAnnotation__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
-};
-
-const upb_msglayout envoy_annotations_ResourceAnnotation_msginit = {
- NULL,
- &envoy_annotations_ResourceAnnotation__fields[0],
- UPB_SIZE(8, 16), 1, false,
-};
-
-#include "upb/port_undef.inc"
-
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/annotations/resource.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg.h"
+#include "envoy/annotations/resource.upb.h"
+#include "google/protobuf/descriptor.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_msglayout_field envoy_annotations_ResourceAnnotation__fields[1] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+};
+
+const upb_msglayout envoy_annotations_ResourceAnnotation_msginit = {
+ NULL,
+ &envoy_annotations_ResourceAnnotation__fields[0],
+ UPB_SIZE(8, 16), 1, false,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/annotations/resource.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/annotations/resource.upb.h
index 4ff0ff3c907..ed6660a2d8a 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/annotations/resource.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/annotations/resource.upb.h
@@ -1,53 +1,53 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/annotations/resource.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef ENVOY_ANNOTATIONS_RESOURCE_PROTO_UPB_H_
-#define ENVOY_ANNOTATIONS_RESOURCE_PROTO_UPB_H_
-
-#include "upb/msg.h"
-#include "upb/decode.h"
-#include "upb/encode.h"
-
-#include "upb/port_def.inc"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct envoy_annotations_ResourceAnnotation;
-typedef struct envoy_annotations_ResourceAnnotation envoy_annotations_ResourceAnnotation;
-extern const upb_msglayout envoy_annotations_ResourceAnnotation_msginit;
-
-
-/* envoy.annotations.ResourceAnnotation */
-
-UPB_INLINE envoy_annotations_ResourceAnnotation *envoy_annotations_ResourceAnnotation_new(upb_arena *arena) {
- return (envoy_annotations_ResourceAnnotation *)_upb_msg_new(&envoy_annotations_ResourceAnnotation_msginit, arena);
-}
-UPB_INLINE envoy_annotations_ResourceAnnotation *envoy_annotations_ResourceAnnotation_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_annotations_ResourceAnnotation *ret = envoy_annotations_ResourceAnnotation_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_annotations_ResourceAnnotation_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_annotations_ResourceAnnotation_serialize(const envoy_annotations_ResourceAnnotation *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_annotations_ResourceAnnotation_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview envoy_annotations_ResourceAnnotation_type(const envoy_annotations_ResourceAnnotation *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-
-UPB_INLINE void envoy_annotations_ResourceAnnotation_set_type(envoy_annotations_ResourceAnnotation *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* ENVOY_ANNOTATIONS_RESOURCE_PROTO_UPB_H_ */
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/annotations/resource.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_ANNOTATIONS_RESOURCE_PROTO_UPB_H_
+#define ENVOY_ANNOTATIONS_RESOURCE_PROTO_UPB_H_
+
+#include "upb/msg.h"
+#include "upb/decode.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_annotations_ResourceAnnotation;
+typedef struct envoy_annotations_ResourceAnnotation envoy_annotations_ResourceAnnotation;
+extern const upb_msglayout envoy_annotations_ResourceAnnotation_msginit;
+
+
+/* envoy.annotations.ResourceAnnotation */
+
+UPB_INLINE envoy_annotations_ResourceAnnotation *envoy_annotations_ResourceAnnotation_new(upb_arena *arena) {
+ return (envoy_annotations_ResourceAnnotation *)_upb_msg_new(&envoy_annotations_ResourceAnnotation_msginit, arena);
+}
+UPB_INLINE envoy_annotations_ResourceAnnotation *envoy_annotations_ResourceAnnotation_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_annotations_ResourceAnnotation *ret = envoy_annotations_ResourceAnnotation_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_annotations_ResourceAnnotation_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_annotations_ResourceAnnotation_serialize(const envoy_annotations_ResourceAnnotation *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_annotations_ResourceAnnotation_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview envoy_annotations_ResourceAnnotation_type(const envoy_annotations_ResourceAnnotation *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+
+UPB_INLINE void envoy_annotations_ResourceAnnotation_set_type(envoy_annotations_ResourceAnnotation *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_ANNOTATIONS_RESOURCE_PROTO_UPB_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.c
index 4f6f96ef812..8968072a56f 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.c
@@ -1,244 +1,244 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/config/accesslog/v3/accesslog.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include <stddef.h>
-#include "upb/msg.h"
-#include "envoy/config/accesslog/v3/accesslog.upb.h"
-#include "envoy/config/core/v3/base.upb.h"
-#include "envoy/config/route/v3/route_components.upb.h"
-#include "envoy/type/matcher/v3/metadata.upb.h"
-#include "envoy/type/v3/percent.upb.h"
-#include "google/protobuf/any.upb.h"
-#include "google/protobuf/struct.upb.h"
-#include "google/protobuf/wrappers.upb.h"
-#include "udpa/annotations/status.upb.h"
-#include "udpa/annotations/versioning.upb.h"
-#include "validate/validate.upb.h"
-
-#include "upb/port_def.inc"
-
-static const upb_msglayout *const envoy_config_accesslog_v3_AccessLog_submsgs[2] = {
- &envoy_config_accesslog_v3_AccessLogFilter_msginit,
- &google_protobuf_Any_msginit,
-};
-
-static const upb_msglayout_field envoy_config_accesslog_v3_AccessLog__fields[3] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 11, 1},
- {4, UPB_SIZE(12, 24), UPB_SIZE(-17, -33), 1, 11, 1},
-};
-
-const upb_msglayout envoy_config_accesslog_v3_AccessLog_msginit = {
- &envoy_config_accesslog_v3_AccessLog_submsgs[0],
- &envoy_config_accesslog_v3_AccessLog__fields[0],
- UPB_SIZE(24, 48), 3, false,
-};
-
-static const upb_msglayout *const envoy_config_accesslog_v3_AccessLogFilter_submsgs[12] = {
- &envoy_config_accesslog_v3_AndFilter_msginit,
- &envoy_config_accesslog_v3_DurationFilter_msginit,
- &envoy_config_accesslog_v3_ExtensionFilter_msginit,
- &envoy_config_accesslog_v3_GrpcStatusFilter_msginit,
- &envoy_config_accesslog_v3_HeaderFilter_msginit,
- &envoy_config_accesslog_v3_MetadataFilter_msginit,
- &envoy_config_accesslog_v3_NotHealthCheckFilter_msginit,
- &envoy_config_accesslog_v3_OrFilter_msginit,
- &envoy_config_accesslog_v3_ResponseFlagFilter_msginit,
- &envoy_config_accesslog_v3_RuntimeFilter_msginit,
- &envoy_config_accesslog_v3_StatusCodeFilter_msginit,
- &envoy_config_accesslog_v3_TraceableFilter_msginit,
-};
-
-static const upb_msglayout_field envoy_config_accesslog_v3_AccessLogFilter__fields[12] = {
- {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 10, 11, 1},
- {2, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 1, 11, 1},
- {3, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 6, 11, 1},
- {4, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 11, 11, 1},
- {5, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 9, 11, 1},
- {6, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, 1},
- {7, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 7, 11, 1},
- {8, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 4, 11, 1},
- {9, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 8, 11, 1},
- {10, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 3, 11, 1},
- {11, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 2, 11, 1},
- {12, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 5, 11, 1},
-};
-
-const upb_msglayout envoy_config_accesslog_v3_AccessLogFilter_msginit = {
- &envoy_config_accesslog_v3_AccessLogFilter_submsgs[0],
- &envoy_config_accesslog_v3_AccessLogFilter__fields[0],
- UPB_SIZE(8, 16), 12, false,
-};
-
-static const upb_msglayout *const envoy_config_accesslog_v3_ComparisonFilter_submsgs[1] = {
- &envoy_config_core_v3_RuntimeUInt32_msginit,
-};
-
-static const upb_msglayout_field envoy_config_accesslog_v3_ComparisonFilter__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 14, 1},
- {2, UPB_SIZE(8, 8), 0, 0, 11, 1},
-};
-
-const upb_msglayout envoy_config_accesslog_v3_ComparisonFilter_msginit = {
- &envoy_config_accesslog_v3_ComparisonFilter_submsgs[0],
- &envoy_config_accesslog_v3_ComparisonFilter__fields[0],
- UPB_SIZE(16, 16), 2, false,
-};
-
-static const upb_msglayout *const envoy_config_accesslog_v3_StatusCodeFilter_submsgs[1] = {
- &envoy_config_accesslog_v3_ComparisonFilter_msginit,
-};
-
-static const upb_msglayout_field envoy_config_accesslog_v3_StatusCodeFilter__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
-};
-
-const upb_msglayout envoy_config_accesslog_v3_StatusCodeFilter_msginit = {
- &envoy_config_accesslog_v3_StatusCodeFilter_submsgs[0],
- &envoy_config_accesslog_v3_StatusCodeFilter__fields[0],
- UPB_SIZE(4, 8), 1, false,
-};
-
-static const upb_msglayout *const envoy_config_accesslog_v3_DurationFilter_submsgs[1] = {
- &envoy_config_accesslog_v3_ComparisonFilter_msginit,
-};
-
-static const upb_msglayout_field envoy_config_accesslog_v3_DurationFilter__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
-};
-
-const upb_msglayout envoy_config_accesslog_v3_DurationFilter_msginit = {
- &envoy_config_accesslog_v3_DurationFilter_submsgs[0],
- &envoy_config_accesslog_v3_DurationFilter__fields[0],
- UPB_SIZE(4, 8), 1, false,
-};
-
-const upb_msglayout envoy_config_accesslog_v3_NotHealthCheckFilter_msginit = {
- NULL,
- NULL,
- UPB_SIZE(0, 0), 0, false,
-};
-
-const upb_msglayout envoy_config_accesslog_v3_TraceableFilter_msginit = {
- NULL,
- NULL,
- UPB_SIZE(0, 0), 0, false,
-};
-
-static const upb_msglayout *const envoy_config_accesslog_v3_RuntimeFilter_submsgs[1] = {
- &envoy_type_v3_FractionalPercent_msginit,
-};
-
-static const upb_msglayout_field envoy_config_accesslog_v3_RuntimeFilter__fields[3] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(12, 24), 0, 0, 11, 1},
- {3, UPB_SIZE(0, 0), 0, 0, 8, 1},
-};
-
-const upb_msglayout envoy_config_accesslog_v3_RuntimeFilter_msginit = {
- &envoy_config_accesslog_v3_RuntimeFilter_submsgs[0],
- &envoy_config_accesslog_v3_RuntimeFilter__fields[0],
- UPB_SIZE(16, 32), 3, false,
-};
-
-static const upb_msglayout *const envoy_config_accesslog_v3_AndFilter_submsgs[1] = {
- &envoy_config_accesslog_v3_AccessLogFilter_msginit,
-};
-
-static const upb_msglayout_field envoy_config_accesslog_v3_AndFilter__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 3},
-};
-
-const upb_msglayout envoy_config_accesslog_v3_AndFilter_msginit = {
- &envoy_config_accesslog_v3_AndFilter_submsgs[0],
- &envoy_config_accesslog_v3_AndFilter__fields[0],
- UPB_SIZE(4, 8), 1, false,
-};
-
-static const upb_msglayout *const envoy_config_accesslog_v3_OrFilter_submsgs[1] = {
- &envoy_config_accesslog_v3_AccessLogFilter_msginit,
-};
-
-static const upb_msglayout_field envoy_config_accesslog_v3_OrFilter__fields[1] = {
- {2, UPB_SIZE(0, 0), 0, 0, 11, 3},
-};
-
-const upb_msglayout envoy_config_accesslog_v3_OrFilter_msginit = {
- &envoy_config_accesslog_v3_OrFilter_submsgs[0],
- &envoy_config_accesslog_v3_OrFilter__fields[0],
- UPB_SIZE(4, 8), 1, false,
-};
-
-static const upb_msglayout *const envoy_config_accesslog_v3_HeaderFilter_submsgs[1] = {
- &envoy_config_route_v3_HeaderMatcher_msginit,
-};
-
-static const upb_msglayout_field envoy_config_accesslog_v3_HeaderFilter__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
-};
-
-const upb_msglayout envoy_config_accesslog_v3_HeaderFilter_msginit = {
- &envoy_config_accesslog_v3_HeaderFilter_submsgs[0],
- &envoy_config_accesslog_v3_HeaderFilter__fields[0],
- UPB_SIZE(4, 8), 1, false,
-};
-
-static const upb_msglayout_field envoy_config_accesslog_v3_ResponseFlagFilter__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 3},
-};
-
-const upb_msglayout envoy_config_accesslog_v3_ResponseFlagFilter_msginit = {
- NULL,
- &envoy_config_accesslog_v3_ResponseFlagFilter__fields[0],
- UPB_SIZE(4, 8), 1, false,
-};
-
-static const upb_msglayout_field envoy_config_accesslog_v3_GrpcStatusFilter__fields[2] = {
- {1, UPB_SIZE(4, 8), 0, 0, 14, _UPB_LABEL_PACKED},
- {2, UPB_SIZE(0, 0), 0, 0, 8, 1},
-};
-
-const upb_msglayout envoy_config_accesslog_v3_GrpcStatusFilter_msginit = {
- NULL,
- &envoy_config_accesslog_v3_GrpcStatusFilter__fields[0],
- UPB_SIZE(8, 16), 2, false,
-};
-
-static const upb_msglayout *const envoy_config_accesslog_v3_MetadataFilter_submsgs[2] = {
- &envoy_type_matcher_v3_MetadataMatcher_msginit,
- &google_protobuf_BoolValue_msginit,
-};
-
-static const upb_msglayout_field envoy_config_accesslog_v3_MetadataFilter__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
- {2, UPB_SIZE(4, 8), 0, 1, 11, 1},
-};
-
-const upb_msglayout envoy_config_accesslog_v3_MetadataFilter_msginit = {
- &envoy_config_accesslog_v3_MetadataFilter_submsgs[0],
- &envoy_config_accesslog_v3_MetadataFilter__fields[0],
- UPB_SIZE(8, 16), 2, false,
-};
-
-static const upb_msglayout *const envoy_config_accesslog_v3_ExtensionFilter_submsgs[1] = {
- &google_protobuf_Any_msginit,
-};
-
-static const upb_msglayout_field envoy_config_accesslog_v3_ExtensionFilter__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {3, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, 1},
-};
-
-const upb_msglayout envoy_config_accesslog_v3_ExtensionFilter_msginit = {
- &envoy_config_accesslog_v3_ExtensionFilter_submsgs[0],
- &envoy_config_accesslog_v3_ExtensionFilter__fields[0],
- UPB_SIZE(16, 32), 2, false,
-};
-
-#include "upb/port_undef.inc"
-
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/accesslog/v3/accesslog.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg.h"
+#include "envoy/config/accesslog/v3/accesslog.upb.h"
+#include "envoy/config/core/v3/base.upb.h"
+#include "envoy/config/route/v3/route_components.upb.h"
+#include "envoy/type/matcher/v3/metadata.upb.h"
+#include "envoy/type/v3/percent.upb.h"
+#include "google/protobuf/any.upb.h"
+#include "google/protobuf/struct.upb.h"
+#include "google/protobuf/wrappers.upb.h"
+#include "udpa/annotations/status.upb.h"
+#include "udpa/annotations/versioning.upb.h"
+#include "validate/validate.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_msglayout *const envoy_config_accesslog_v3_AccessLog_submsgs[2] = {
+ &envoy_config_accesslog_v3_AccessLogFilter_msginit,
+ &google_protobuf_Any_msginit,
+};
+
+static const upb_msglayout_field envoy_config_accesslog_v3_AccessLog__fields[3] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {2, UPB_SIZE(8, 16), 0, 0, 11, 1},
+ {4, UPB_SIZE(12, 24), UPB_SIZE(-17, -33), 1, 11, 1},
+};
+
+const upb_msglayout envoy_config_accesslog_v3_AccessLog_msginit = {
+ &envoy_config_accesslog_v3_AccessLog_submsgs[0],
+ &envoy_config_accesslog_v3_AccessLog__fields[0],
+ UPB_SIZE(24, 48), 3, false,
+};
+
+static const upb_msglayout *const envoy_config_accesslog_v3_AccessLogFilter_submsgs[12] = {
+ &envoy_config_accesslog_v3_AndFilter_msginit,
+ &envoy_config_accesslog_v3_DurationFilter_msginit,
+ &envoy_config_accesslog_v3_ExtensionFilter_msginit,
+ &envoy_config_accesslog_v3_GrpcStatusFilter_msginit,
+ &envoy_config_accesslog_v3_HeaderFilter_msginit,
+ &envoy_config_accesslog_v3_MetadataFilter_msginit,
+ &envoy_config_accesslog_v3_NotHealthCheckFilter_msginit,
+ &envoy_config_accesslog_v3_OrFilter_msginit,
+ &envoy_config_accesslog_v3_ResponseFlagFilter_msginit,
+ &envoy_config_accesslog_v3_RuntimeFilter_msginit,
+ &envoy_config_accesslog_v3_StatusCodeFilter_msginit,
+ &envoy_config_accesslog_v3_TraceableFilter_msginit,
+};
+
+static const upb_msglayout_field envoy_config_accesslog_v3_AccessLogFilter__fields[12] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 10, 11, 1},
+ {2, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 1, 11, 1},
+ {3, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 6, 11, 1},
+ {4, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 11, 11, 1},
+ {5, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 9, 11, 1},
+ {6, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, 1},
+ {7, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 7, 11, 1},
+ {8, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 4, 11, 1},
+ {9, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 8, 11, 1},
+ {10, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 3, 11, 1},
+ {11, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 2, 11, 1},
+ {12, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 5, 11, 1},
+};
+
+const upb_msglayout envoy_config_accesslog_v3_AccessLogFilter_msginit = {
+ &envoy_config_accesslog_v3_AccessLogFilter_submsgs[0],
+ &envoy_config_accesslog_v3_AccessLogFilter__fields[0],
+ UPB_SIZE(8, 16), 12, false,
+};
+
+static const upb_msglayout *const envoy_config_accesslog_v3_ComparisonFilter_submsgs[1] = {
+ &envoy_config_core_v3_RuntimeUInt32_msginit,
+};
+
+static const upb_msglayout_field envoy_config_accesslog_v3_ComparisonFilter__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 14, 1},
+ {2, UPB_SIZE(8, 8), 0, 0, 11, 1},
+};
+
+const upb_msglayout envoy_config_accesslog_v3_ComparisonFilter_msginit = {
+ &envoy_config_accesslog_v3_ComparisonFilter_submsgs[0],
+ &envoy_config_accesslog_v3_ComparisonFilter__fields[0],
+ UPB_SIZE(16, 16), 2, false,
+};
+
+static const upb_msglayout *const envoy_config_accesslog_v3_StatusCodeFilter_submsgs[1] = {
+ &envoy_config_accesslog_v3_ComparisonFilter_msginit,
+};
+
+static const upb_msglayout_field envoy_config_accesslog_v3_StatusCodeFilter__fields[1] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
+};
+
+const upb_msglayout envoy_config_accesslog_v3_StatusCodeFilter_msginit = {
+ &envoy_config_accesslog_v3_StatusCodeFilter_submsgs[0],
+ &envoy_config_accesslog_v3_StatusCodeFilter__fields[0],
+ UPB_SIZE(4, 8), 1, false,
+};
+
+static const upb_msglayout *const envoy_config_accesslog_v3_DurationFilter_submsgs[1] = {
+ &envoy_config_accesslog_v3_ComparisonFilter_msginit,
+};
+
+static const upb_msglayout_field envoy_config_accesslog_v3_DurationFilter__fields[1] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
+};
+
+const upb_msglayout envoy_config_accesslog_v3_DurationFilter_msginit = {
+ &envoy_config_accesslog_v3_DurationFilter_submsgs[0],
+ &envoy_config_accesslog_v3_DurationFilter__fields[0],
+ UPB_SIZE(4, 8), 1, false,
+};
+
+const upb_msglayout envoy_config_accesslog_v3_NotHealthCheckFilter_msginit = {
+ NULL,
+ NULL,
+ UPB_SIZE(0, 0), 0, false,
+};
+
+const upb_msglayout envoy_config_accesslog_v3_TraceableFilter_msginit = {
+ NULL,
+ NULL,
+ UPB_SIZE(0, 0), 0, false,
+};
+
+static const upb_msglayout *const envoy_config_accesslog_v3_RuntimeFilter_submsgs[1] = {
+ &envoy_type_v3_FractionalPercent_msginit,
+};
+
+static const upb_msglayout_field envoy_config_accesslog_v3_RuntimeFilter__fields[3] = {
+ {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
+ {2, UPB_SIZE(12, 24), 0, 0, 11, 1},
+ {3, UPB_SIZE(0, 0), 0, 0, 8, 1},
+};
+
+const upb_msglayout envoy_config_accesslog_v3_RuntimeFilter_msginit = {
+ &envoy_config_accesslog_v3_RuntimeFilter_submsgs[0],
+ &envoy_config_accesslog_v3_RuntimeFilter__fields[0],
+ UPB_SIZE(16, 32), 3, false,
+};
+
+static const upb_msglayout *const envoy_config_accesslog_v3_AndFilter_submsgs[1] = {
+ &envoy_config_accesslog_v3_AccessLogFilter_msginit,
+};
+
+static const upb_msglayout_field envoy_config_accesslog_v3_AndFilter__fields[1] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 11, 3},
+};
+
+const upb_msglayout envoy_config_accesslog_v3_AndFilter_msginit = {
+ &envoy_config_accesslog_v3_AndFilter_submsgs[0],
+ &envoy_config_accesslog_v3_AndFilter__fields[0],
+ UPB_SIZE(4, 8), 1, false,
+};
+
+static const upb_msglayout *const envoy_config_accesslog_v3_OrFilter_submsgs[1] = {
+ &envoy_config_accesslog_v3_AccessLogFilter_msginit,
+};
+
+static const upb_msglayout_field envoy_config_accesslog_v3_OrFilter__fields[1] = {
+ {2, UPB_SIZE(0, 0), 0, 0, 11, 3},
+};
+
+const upb_msglayout envoy_config_accesslog_v3_OrFilter_msginit = {
+ &envoy_config_accesslog_v3_OrFilter_submsgs[0],
+ &envoy_config_accesslog_v3_OrFilter__fields[0],
+ UPB_SIZE(4, 8), 1, false,
+};
+
+static const upb_msglayout *const envoy_config_accesslog_v3_HeaderFilter_submsgs[1] = {
+ &envoy_config_route_v3_HeaderMatcher_msginit,
+};
+
+static const upb_msglayout_field envoy_config_accesslog_v3_HeaderFilter__fields[1] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
+};
+
+const upb_msglayout envoy_config_accesslog_v3_HeaderFilter_msginit = {
+ &envoy_config_accesslog_v3_HeaderFilter_submsgs[0],
+ &envoy_config_accesslog_v3_HeaderFilter__fields[0],
+ UPB_SIZE(4, 8), 1, false,
+};
+
+static const upb_msglayout_field envoy_config_accesslog_v3_ResponseFlagFilter__fields[1] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 3},
+};
+
+const upb_msglayout envoy_config_accesslog_v3_ResponseFlagFilter_msginit = {
+ NULL,
+ &envoy_config_accesslog_v3_ResponseFlagFilter__fields[0],
+ UPB_SIZE(4, 8), 1, false,
+};
+
+static const upb_msglayout_field envoy_config_accesslog_v3_GrpcStatusFilter__fields[2] = {
+ {1, UPB_SIZE(4, 8), 0, 0, 14, _UPB_LABEL_PACKED},
+ {2, UPB_SIZE(0, 0), 0, 0, 8, 1},
+};
+
+const upb_msglayout envoy_config_accesslog_v3_GrpcStatusFilter_msginit = {
+ NULL,
+ &envoy_config_accesslog_v3_GrpcStatusFilter__fields[0],
+ UPB_SIZE(8, 16), 2, false,
+};
+
+static const upb_msglayout *const envoy_config_accesslog_v3_MetadataFilter_submsgs[2] = {
+ &envoy_type_matcher_v3_MetadataMatcher_msginit,
+ &google_protobuf_BoolValue_msginit,
+};
+
+static const upb_msglayout_field envoy_config_accesslog_v3_MetadataFilter__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
+ {2, UPB_SIZE(4, 8), 0, 1, 11, 1},
+};
+
+const upb_msglayout envoy_config_accesslog_v3_MetadataFilter_msginit = {
+ &envoy_config_accesslog_v3_MetadataFilter_submsgs[0],
+ &envoy_config_accesslog_v3_MetadataFilter__fields[0],
+ UPB_SIZE(8, 16), 2, false,
+};
+
+static const upb_msglayout *const envoy_config_accesslog_v3_ExtensionFilter_submsgs[1] = {
+ &google_protobuf_Any_msginit,
+};
+
+static const upb_msglayout_field envoy_config_accesslog_v3_ExtensionFilter__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {3, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, 1},
+};
+
+const upb_msglayout envoy_config_accesslog_v3_ExtensionFilter_msginit = {
+ &envoy_config_accesslog_v3_ExtensionFilter_submsgs[0],
+ &envoy_config_accesslog_v3_ExtensionFilter__fields[0],
+ UPB_SIZE(16, 32), 2, false,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.h
index d4bc3cae28a..2e9cb7a741d 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.h
@@ -1,766 +1,766 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/config/accesslog/v3/accesslog.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef ENVOY_CONFIG_ACCESSLOG_V3_ACCESSLOG_PROTO_UPB_H_
-#define ENVOY_CONFIG_ACCESSLOG_V3_ACCESSLOG_PROTO_UPB_H_
-
-#include "upb/msg.h"
-#include "upb/decode.h"
-#include "upb/encode.h"
-
-#include "upb/port_def.inc"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct envoy_config_accesslog_v3_AccessLog;
-struct envoy_config_accesslog_v3_AccessLogFilter;
-struct envoy_config_accesslog_v3_ComparisonFilter;
-struct envoy_config_accesslog_v3_StatusCodeFilter;
-struct envoy_config_accesslog_v3_DurationFilter;
-struct envoy_config_accesslog_v3_NotHealthCheckFilter;
-struct envoy_config_accesslog_v3_TraceableFilter;
-struct envoy_config_accesslog_v3_RuntimeFilter;
-struct envoy_config_accesslog_v3_AndFilter;
-struct envoy_config_accesslog_v3_OrFilter;
-struct envoy_config_accesslog_v3_HeaderFilter;
-struct envoy_config_accesslog_v3_ResponseFlagFilter;
-struct envoy_config_accesslog_v3_GrpcStatusFilter;
-struct envoy_config_accesslog_v3_MetadataFilter;
-struct envoy_config_accesslog_v3_ExtensionFilter;
-typedef struct envoy_config_accesslog_v3_AccessLog envoy_config_accesslog_v3_AccessLog;
-typedef struct envoy_config_accesslog_v3_AccessLogFilter envoy_config_accesslog_v3_AccessLogFilter;
-typedef struct envoy_config_accesslog_v3_ComparisonFilter envoy_config_accesslog_v3_ComparisonFilter;
-typedef struct envoy_config_accesslog_v3_StatusCodeFilter envoy_config_accesslog_v3_StatusCodeFilter;
-typedef struct envoy_config_accesslog_v3_DurationFilter envoy_config_accesslog_v3_DurationFilter;
-typedef struct envoy_config_accesslog_v3_NotHealthCheckFilter envoy_config_accesslog_v3_NotHealthCheckFilter;
-typedef struct envoy_config_accesslog_v3_TraceableFilter envoy_config_accesslog_v3_TraceableFilter;
-typedef struct envoy_config_accesslog_v3_RuntimeFilter envoy_config_accesslog_v3_RuntimeFilter;
-typedef struct envoy_config_accesslog_v3_AndFilter envoy_config_accesslog_v3_AndFilter;
-typedef struct envoy_config_accesslog_v3_OrFilter envoy_config_accesslog_v3_OrFilter;
-typedef struct envoy_config_accesslog_v3_HeaderFilter envoy_config_accesslog_v3_HeaderFilter;
-typedef struct envoy_config_accesslog_v3_ResponseFlagFilter envoy_config_accesslog_v3_ResponseFlagFilter;
-typedef struct envoy_config_accesslog_v3_GrpcStatusFilter envoy_config_accesslog_v3_GrpcStatusFilter;
-typedef struct envoy_config_accesslog_v3_MetadataFilter envoy_config_accesslog_v3_MetadataFilter;
-typedef struct envoy_config_accesslog_v3_ExtensionFilter envoy_config_accesslog_v3_ExtensionFilter;
-extern const upb_msglayout envoy_config_accesslog_v3_AccessLog_msginit;
-extern const upb_msglayout envoy_config_accesslog_v3_AccessLogFilter_msginit;
-extern const upb_msglayout envoy_config_accesslog_v3_ComparisonFilter_msginit;
-extern const upb_msglayout envoy_config_accesslog_v3_StatusCodeFilter_msginit;
-extern const upb_msglayout envoy_config_accesslog_v3_DurationFilter_msginit;
-extern const upb_msglayout envoy_config_accesslog_v3_NotHealthCheckFilter_msginit;
-extern const upb_msglayout envoy_config_accesslog_v3_TraceableFilter_msginit;
-extern const upb_msglayout envoy_config_accesslog_v3_RuntimeFilter_msginit;
-extern const upb_msglayout envoy_config_accesslog_v3_AndFilter_msginit;
-extern const upb_msglayout envoy_config_accesslog_v3_OrFilter_msginit;
-extern const upb_msglayout envoy_config_accesslog_v3_HeaderFilter_msginit;
-extern const upb_msglayout envoy_config_accesslog_v3_ResponseFlagFilter_msginit;
-extern const upb_msglayout envoy_config_accesslog_v3_GrpcStatusFilter_msginit;
-extern const upb_msglayout envoy_config_accesslog_v3_MetadataFilter_msginit;
-extern const upb_msglayout envoy_config_accesslog_v3_ExtensionFilter_msginit;
-struct envoy_config_core_v3_RuntimeUInt32;
-struct envoy_config_route_v3_HeaderMatcher;
-struct envoy_type_matcher_v3_MetadataMatcher;
-struct envoy_type_v3_FractionalPercent;
-struct google_protobuf_Any;
-struct google_protobuf_BoolValue;
-extern const upb_msglayout envoy_config_core_v3_RuntimeUInt32_msginit;
-extern const upb_msglayout envoy_config_route_v3_HeaderMatcher_msginit;
-extern const upb_msglayout envoy_type_matcher_v3_MetadataMatcher_msginit;
-extern const upb_msglayout envoy_type_v3_FractionalPercent_msginit;
-extern const upb_msglayout google_protobuf_Any_msginit;
-extern const upb_msglayout google_protobuf_BoolValue_msginit;
-
-typedef enum {
- envoy_config_accesslog_v3_ComparisonFilter_EQ = 0,
- envoy_config_accesslog_v3_ComparisonFilter_GE = 1,
- envoy_config_accesslog_v3_ComparisonFilter_LE = 2
-} envoy_config_accesslog_v3_ComparisonFilter_Op;
-
-typedef enum {
- envoy_config_accesslog_v3_GrpcStatusFilter_OK = 0,
- envoy_config_accesslog_v3_GrpcStatusFilter_CANCELED = 1,
- envoy_config_accesslog_v3_GrpcStatusFilter_UNKNOWN = 2,
- envoy_config_accesslog_v3_GrpcStatusFilter_INVALID_ARGUMENT = 3,
- envoy_config_accesslog_v3_GrpcStatusFilter_DEADLINE_EXCEEDED = 4,
- envoy_config_accesslog_v3_GrpcStatusFilter_NOT_FOUND = 5,
- envoy_config_accesslog_v3_GrpcStatusFilter_ALREADY_EXISTS = 6,
- envoy_config_accesslog_v3_GrpcStatusFilter_PERMISSION_DENIED = 7,
- envoy_config_accesslog_v3_GrpcStatusFilter_RESOURCE_EXHAUSTED = 8,
- envoy_config_accesslog_v3_GrpcStatusFilter_FAILED_PRECONDITION = 9,
- envoy_config_accesslog_v3_GrpcStatusFilter_ABORTED = 10,
- envoy_config_accesslog_v3_GrpcStatusFilter_OUT_OF_RANGE = 11,
- envoy_config_accesslog_v3_GrpcStatusFilter_UNIMPLEMENTED = 12,
- envoy_config_accesslog_v3_GrpcStatusFilter_INTERNAL = 13,
- envoy_config_accesslog_v3_GrpcStatusFilter_UNAVAILABLE = 14,
- envoy_config_accesslog_v3_GrpcStatusFilter_DATA_LOSS = 15,
- envoy_config_accesslog_v3_GrpcStatusFilter_UNAUTHENTICATED = 16
-} envoy_config_accesslog_v3_GrpcStatusFilter_Status;
-
-
-/* envoy.config.accesslog.v3.AccessLog */
-
-UPB_INLINE envoy_config_accesslog_v3_AccessLog *envoy_config_accesslog_v3_AccessLog_new(upb_arena *arena) {
- return (envoy_config_accesslog_v3_AccessLog *)_upb_msg_new(&envoy_config_accesslog_v3_AccessLog_msginit, arena);
-}
-UPB_INLINE envoy_config_accesslog_v3_AccessLog *envoy_config_accesslog_v3_AccessLog_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_accesslog_v3_AccessLog *ret = envoy_config_accesslog_v3_AccessLog_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_accesslog_v3_AccessLog_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_accesslog_v3_AccessLog_serialize(const envoy_config_accesslog_v3_AccessLog *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_accesslog_v3_AccessLog_msginit, arena, len);
-}
-
-typedef enum {
- envoy_config_accesslog_v3_AccessLog_config_type_typed_config = 4,
- envoy_config_accesslog_v3_AccessLog_config_type_NOT_SET = 0
-} envoy_config_accesslog_v3_AccessLog_config_type_oneofcases;
-UPB_INLINE envoy_config_accesslog_v3_AccessLog_config_type_oneofcases envoy_config_accesslog_v3_AccessLog_config_type_case(const envoy_config_accesslog_v3_AccessLog* msg) { return (envoy_config_accesslog_v3_AccessLog_config_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(16, 32), int32_t); }
-
-UPB_INLINE upb_strview envoy_config_accesslog_v3_AccessLog_name(const envoy_config_accesslog_v3_AccessLog *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE bool envoy_config_accesslog_v3_AccessLog_has_filter(const envoy_config_accesslog_v3_AccessLog *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const envoy_config_accesslog_v3_AccessLogFilter* envoy_config_accesslog_v3_AccessLog_filter(const envoy_config_accesslog_v3_AccessLog *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const envoy_config_accesslog_v3_AccessLogFilter*); }
-UPB_INLINE bool envoy_config_accesslog_v3_AccessLog_has_typed_config(const envoy_config_accesslog_v3_AccessLog *msg) { return _upb_getoneofcase(msg, UPB_SIZE(16, 32)) == 4; }
-UPB_INLINE const struct google_protobuf_Any* envoy_config_accesslog_v3_AccessLog_typed_config(const envoy_config_accesslog_v3_AccessLog *msg) { return UPB_READ_ONEOF(msg, const struct google_protobuf_Any*, UPB_SIZE(12, 24), UPB_SIZE(16, 32), 4, NULL); }
-
-UPB_INLINE void envoy_config_accesslog_v3_AccessLog_set_name(envoy_config_accesslog_v3_AccessLog *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_accesslog_v3_AccessLog_set_filter(envoy_config_accesslog_v3_AccessLog *msg, envoy_config_accesslog_v3_AccessLogFilter* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), envoy_config_accesslog_v3_AccessLogFilter*) = value;
-}
-UPB_INLINE struct envoy_config_accesslog_v3_AccessLogFilter* envoy_config_accesslog_v3_AccessLog_mutable_filter(envoy_config_accesslog_v3_AccessLog *msg, upb_arena *arena) {
- struct envoy_config_accesslog_v3_AccessLogFilter* sub = (struct envoy_config_accesslog_v3_AccessLogFilter*)envoy_config_accesslog_v3_AccessLog_filter(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_accesslog_v3_AccessLogFilter*)_upb_msg_new(&envoy_config_accesslog_v3_AccessLogFilter_msginit, arena);
- if (!sub) return NULL;
- envoy_config_accesslog_v3_AccessLog_set_filter(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_accesslog_v3_AccessLog_set_typed_config(envoy_config_accesslog_v3_AccessLog *msg, struct google_protobuf_Any* value) {
- UPB_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(12, 24), value, UPB_SIZE(16, 32), 4);
-}
-UPB_INLINE struct google_protobuf_Any* envoy_config_accesslog_v3_AccessLog_mutable_typed_config(envoy_config_accesslog_v3_AccessLog *msg, upb_arena *arena) {
- struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_config_accesslog_v3_AccessLog_typed_config(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena);
- if (!sub) return NULL;
- envoy_config_accesslog_v3_AccessLog_set_typed_config(msg, sub);
- }
- return sub;
-}
-
-/* envoy.config.accesslog.v3.AccessLogFilter */
-
-UPB_INLINE envoy_config_accesslog_v3_AccessLogFilter *envoy_config_accesslog_v3_AccessLogFilter_new(upb_arena *arena) {
- return (envoy_config_accesslog_v3_AccessLogFilter *)_upb_msg_new(&envoy_config_accesslog_v3_AccessLogFilter_msginit, arena);
-}
-UPB_INLINE envoy_config_accesslog_v3_AccessLogFilter *envoy_config_accesslog_v3_AccessLogFilter_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_accesslog_v3_AccessLogFilter *ret = envoy_config_accesslog_v3_AccessLogFilter_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_accesslog_v3_AccessLogFilter_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_accesslog_v3_AccessLogFilter_serialize(const envoy_config_accesslog_v3_AccessLogFilter *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_accesslog_v3_AccessLogFilter_msginit, arena, len);
-}
-
-typedef enum {
- envoy_config_accesslog_v3_AccessLogFilter_filter_specifier_status_code_filter = 1,
- envoy_config_accesslog_v3_AccessLogFilter_filter_specifier_duration_filter = 2,
- envoy_config_accesslog_v3_AccessLogFilter_filter_specifier_not_health_check_filter = 3,
- envoy_config_accesslog_v3_AccessLogFilter_filter_specifier_traceable_filter = 4,
- envoy_config_accesslog_v3_AccessLogFilter_filter_specifier_runtime_filter = 5,
- envoy_config_accesslog_v3_AccessLogFilter_filter_specifier_and_filter = 6,
- envoy_config_accesslog_v3_AccessLogFilter_filter_specifier_or_filter = 7,
- envoy_config_accesslog_v3_AccessLogFilter_filter_specifier_header_filter = 8,
- envoy_config_accesslog_v3_AccessLogFilter_filter_specifier_response_flag_filter = 9,
- envoy_config_accesslog_v3_AccessLogFilter_filter_specifier_grpc_status_filter = 10,
- envoy_config_accesslog_v3_AccessLogFilter_filter_specifier_extension_filter = 11,
- envoy_config_accesslog_v3_AccessLogFilter_filter_specifier_metadata_filter = 12,
- envoy_config_accesslog_v3_AccessLogFilter_filter_specifier_NOT_SET = 0
-} envoy_config_accesslog_v3_AccessLogFilter_filter_specifier_oneofcases;
-UPB_INLINE envoy_config_accesslog_v3_AccessLogFilter_filter_specifier_oneofcases envoy_config_accesslog_v3_AccessLogFilter_filter_specifier_case(const envoy_config_accesslog_v3_AccessLogFilter* msg) { return (envoy_config_accesslog_v3_AccessLogFilter_filter_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 8), int32_t); }
-
-UPB_INLINE bool envoy_config_accesslog_v3_AccessLogFilter_has_status_code_filter(const envoy_config_accesslog_v3_AccessLogFilter *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 1; }
-UPB_INLINE const envoy_config_accesslog_v3_StatusCodeFilter* envoy_config_accesslog_v3_AccessLogFilter_status_code_filter(const envoy_config_accesslog_v3_AccessLogFilter *msg) { return UPB_READ_ONEOF(msg, const envoy_config_accesslog_v3_StatusCodeFilter*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 1, NULL); }
-UPB_INLINE bool envoy_config_accesslog_v3_AccessLogFilter_has_duration_filter(const envoy_config_accesslog_v3_AccessLogFilter *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 2; }
-UPB_INLINE const envoy_config_accesslog_v3_DurationFilter* envoy_config_accesslog_v3_AccessLogFilter_duration_filter(const envoy_config_accesslog_v3_AccessLogFilter *msg) { return UPB_READ_ONEOF(msg, const envoy_config_accesslog_v3_DurationFilter*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 2, NULL); }
-UPB_INLINE bool envoy_config_accesslog_v3_AccessLogFilter_has_not_health_check_filter(const envoy_config_accesslog_v3_AccessLogFilter *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 3; }
-UPB_INLINE const envoy_config_accesslog_v3_NotHealthCheckFilter* envoy_config_accesslog_v3_AccessLogFilter_not_health_check_filter(const envoy_config_accesslog_v3_AccessLogFilter *msg) { return UPB_READ_ONEOF(msg, const envoy_config_accesslog_v3_NotHealthCheckFilter*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 3, NULL); }
-UPB_INLINE bool envoy_config_accesslog_v3_AccessLogFilter_has_traceable_filter(const envoy_config_accesslog_v3_AccessLogFilter *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 4; }
-UPB_INLINE const envoy_config_accesslog_v3_TraceableFilter* envoy_config_accesslog_v3_AccessLogFilter_traceable_filter(const envoy_config_accesslog_v3_AccessLogFilter *msg) { return UPB_READ_ONEOF(msg, const envoy_config_accesslog_v3_TraceableFilter*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 4, NULL); }
-UPB_INLINE bool envoy_config_accesslog_v3_AccessLogFilter_has_runtime_filter(const envoy_config_accesslog_v3_AccessLogFilter *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 5; }
-UPB_INLINE const envoy_config_accesslog_v3_RuntimeFilter* envoy_config_accesslog_v3_AccessLogFilter_runtime_filter(const envoy_config_accesslog_v3_AccessLogFilter *msg) { return UPB_READ_ONEOF(msg, const envoy_config_accesslog_v3_RuntimeFilter*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 5, NULL); }
-UPB_INLINE bool envoy_config_accesslog_v3_AccessLogFilter_has_and_filter(const envoy_config_accesslog_v3_AccessLogFilter *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 6; }
-UPB_INLINE const envoy_config_accesslog_v3_AndFilter* envoy_config_accesslog_v3_AccessLogFilter_and_filter(const envoy_config_accesslog_v3_AccessLogFilter *msg) { return UPB_READ_ONEOF(msg, const envoy_config_accesslog_v3_AndFilter*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 6, NULL); }
-UPB_INLINE bool envoy_config_accesslog_v3_AccessLogFilter_has_or_filter(const envoy_config_accesslog_v3_AccessLogFilter *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 7; }
-UPB_INLINE const envoy_config_accesslog_v3_OrFilter* envoy_config_accesslog_v3_AccessLogFilter_or_filter(const envoy_config_accesslog_v3_AccessLogFilter *msg) { return UPB_READ_ONEOF(msg, const envoy_config_accesslog_v3_OrFilter*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 7, NULL); }
-UPB_INLINE bool envoy_config_accesslog_v3_AccessLogFilter_has_header_filter(const envoy_config_accesslog_v3_AccessLogFilter *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 8; }
-UPB_INLINE const envoy_config_accesslog_v3_HeaderFilter* envoy_config_accesslog_v3_AccessLogFilter_header_filter(const envoy_config_accesslog_v3_AccessLogFilter *msg) { return UPB_READ_ONEOF(msg, const envoy_config_accesslog_v3_HeaderFilter*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 8, NULL); }
-UPB_INLINE bool envoy_config_accesslog_v3_AccessLogFilter_has_response_flag_filter(const envoy_config_accesslog_v3_AccessLogFilter *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 9; }
-UPB_INLINE const envoy_config_accesslog_v3_ResponseFlagFilter* envoy_config_accesslog_v3_AccessLogFilter_response_flag_filter(const envoy_config_accesslog_v3_AccessLogFilter *msg) { return UPB_READ_ONEOF(msg, const envoy_config_accesslog_v3_ResponseFlagFilter*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 9, NULL); }
-UPB_INLINE bool envoy_config_accesslog_v3_AccessLogFilter_has_grpc_status_filter(const envoy_config_accesslog_v3_AccessLogFilter *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 10; }
-UPB_INLINE const envoy_config_accesslog_v3_GrpcStatusFilter* envoy_config_accesslog_v3_AccessLogFilter_grpc_status_filter(const envoy_config_accesslog_v3_AccessLogFilter *msg) { return UPB_READ_ONEOF(msg, const envoy_config_accesslog_v3_GrpcStatusFilter*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 10, NULL); }
-UPB_INLINE bool envoy_config_accesslog_v3_AccessLogFilter_has_extension_filter(const envoy_config_accesslog_v3_AccessLogFilter *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 11; }
-UPB_INLINE const envoy_config_accesslog_v3_ExtensionFilter* envoy_config_accesslog_v3_AccessLogFilter_extension_filter(const envoy_config_accesslog_v3_AccessLogFilter *msg) { return UPB_READ_ONEOF(msg, const envoy_config_accesslog_v3_ExtensionFilter*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 11, NULL); }
-UPB_INLINE bool envoy_config_accesslog_v3_AccessLogFilter_has_metadata_filter(const envoy_config_accesslog_v3_AccessLogFilter *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 12; }
-UPB_INLINE const envoy_config_accesslog_v3_MetadataFilter* envoy_config_accesslog_v3_AccessLogFilter_metadata_filter(const envoy_config_accesslog_v3_AccessLogFilter *msg) { return UPB_READ_ONEOF(msg, const envoy_config_accesslog_v3_MetadataFilter*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 12, NULL); }
-
-UPB_INLINE void envoy_config_accesslog_v3_AccessLogFilter_set_status_code_filter(envoy_config_accesslog_v3_AccessLogFilter *msg, envoy_config_accesslog_v3_StatusCodeFilter* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_accesslog_v3_StatusCodeFilter*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 1);
-}
-UPB_INLINE struct envoy_config_accesslog_v3_StatusCodeFilter* envoy_config_accesslog_v3_AccessLogFilter_mutable_status_code_filter(envoy_config_accesslog_v3_AccessLogFilter *msg, upb_arena *arena) {
- struct envoy_config_accesslog_v3_StatusCodeFilter* sub = (struct envoy_config_accesslog_v3_StatusCodeFilter*)envoy_config_accesslog_v3_AccessLogFilter_status_code_filter(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_accesslog_v3_StatusCodeFilter*)_upb_msg_new(&envoy_config_accesslog_v3_StatusCodeFilter_msginit, arena);
- if (!sub) return NULL;
- envoy_config_accesslog_v3_AccessLogFilter_set_status_code_filter(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_accesslog_v3_AccessLogFilter_set_duration_filter(envoy_config_accesslog_v3_AccessLogFilter *msg, envoy_config_accesslog_v3_DurationFilter* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_accesslog_v3_DurationFilter*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 2);
-}
-UPB_INLINE struct envoy_config_accesslog_v3_DurationFilter* envoy_config_accesslog_v3_AccessLogFilter_mutable_duration_filter(envoy_config_accesslog_v3_AccessLogFilter *msg, upb_arena *arena) {
- struct envoy_config_accesslog_v3_DurationFilter* sub = (struct envoy_config_accesslog_v3_DurationFilter*)envoy_config_accesslog_v3_AccessLogFilter_duration_filter(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_accesslog_v3_DurationFilter*)_upb_msg_new(&envoy_config_accesslog_v3_DurationFilter_msginit, arena);
- if (!sub) return NULL;
- envoy_config_accesslog_v3_AccessLogFilter_set_duration_filter(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_accesslog_v3_AccessLogFilter_set_not_health_check_filter(envoy_config_accesslog_v3_AccessLogFilter *msg, envoy_config_accesslog_v3_NotHealthCheckFilter* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_accesslog_v3_NotHealthCheckFilter*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 3);
-}
-UPB_INLINE struct envoy_config_accesslog_v3_NotHealthCheckFilter* envoy_config_accesslog_v3_AccessLogFilter_mutable_not_health_check_filter(envoy_config_accesslog_v3_AccessLogFilter *msg, upb_arena *arena) {
- struct envoy_config_accesslog_v3_NotHealthCheckFilter* sub = (struct envoy_config_accesslog_v3_NotHealthCheckFilter*)envoy_config_accesslog_v3_AccessLogFilter_not_health_check_filter(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_accesslog_v3_NotHealthCheckFilter*)_upb_msg_new(&envoy_config_accesslog_v3_NotHealthCheckFilter_msginit, arena);
- if (!sub) return NULL;
- envoy_config_accesslog_v3_AccessLogFilter_set_not_health_check_filter(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_accesslog_v3_AccessLogFilter_set_traceable_filter(envoy_config_accesslog_v3_AccessLogFilter *msg, envoy_config_accesslog_v3_TraceableFilter* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_accesslog_v3_TraceableFilter*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 4);
-}
-UPB_INLINE struct envoy_config_accesslog_v3_TraceableFilter* envoy_config_accesslog_v3_AccessLogFilter_mutable_traceable_filter(envoy_config_accesslog_v3_AccessLogFilter *msg, upb_arena *arena) {
- struct envoy_config_accesslog_v3_TraceableFilter* sub = (struct envoy_config_accesslog_v3_TraceableFilter*)envoy_config_accesslog_v3_AccessLogFilter_traceable_filter(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_accesslog_v3_TraceableFilter*)_upb_msg_new(&envoy_config_accesslog_v3_TraceableFilter_msginit, arena);
- if (!sub) return NULL;
- envoy_config_accesslog_v3_AccessLogFilter_set_traceable_filter(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_accesslog_v3_AccessLogFilter_set_runtime_filter(envoy_config_accesslog_v3_AccessLogFilter *msg, envoy_config_accesslog_v3_RuntimeFilter* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_accesslog_v3_RuntimeFilter*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 5);
-}
-UPB_INLINE struct envoy_config_accesslog_v3_RuntimeFilter* envoy_config_accesslog_v3_AccessLogFilter_mutable_runtime_filter(envoy_config_accesslog_v3_AccessLogFilter *msg, upb_arena *arena) {
- struct envoy_config_accesslog_v3_RuntimeFilter* sub = (struct envoy_config_accesslog_v3_RuntimeFilter*)envoy_config_accesslog_v3_AccessLogFilter_runtime_filter(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_accesslog_v3_RuntimeFilter*)_upb_msg_new(&envoy_config_accesslog_v3_RuntimeFilter_msginit, arena);
- if (!sub) return NULL;
- envoy_config_accesslog_v3_AccessLogFilter_set_runtime_filter(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_accesslog_v3_AccessLogFilter_set_and_filter(envoy_config_accesslog_v3_AccessLogFilter *msg, envoy_config_accesslog_v3_AndFilter* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_accesslog_v3_AndFilter*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 6);
-}
-UPB_INLINE struct envoy_config_accesslog_v3_AndFilter* envoy_config_accesslog_v3_AccessLogFilter_mutable_and_filter(envoy_config_accesslog_v3_AccessLogFilter *msg, upb_arena *arena) {
- struct envoy_config_accesslog_v3_AndFilter* sub = (struct envoy_config_accesslog_v3_AndFilter*)envoy_config_accesslog_v3_AccessLogFilter_and_filter(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_accesslog_v3_AndFilter*)_upb_msg_new(&envoy_config_accesslog_v3_AndFilter_msginit, arena);
- if (!sub) return NULL;
- envoy_config_accesslog_v3_AccessLogFilter_set_and_filter(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_accesslog_v3_AccessLogFilter_set_or_filter(envoy_config_accesslog_v3_AccessLogFilter *msg, envoy_config_accesslog_v3_OrFilter* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_accesslog_v3_OrFilter*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 7);
-}
-UPB_INLINE struct envoy_config_accesslog_v3_OrFilter* envoy_config_accesslog_v3_AccessLogFilter_mutable_or_filter(envoy_config_accesslog_v3_AccessLogFilter *msg, upb_arena *arena) {
- struct envoy_config_accesslog_v3_OrFilter* sub = (struct envoy_config_accesslog_v3_OrFilter*)envoy_config_accesslog_v3_AccessLogFilter_or_filter(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_accesslog_v3_OrFilter*)_upb_msg_new(&envoy_config_accesslog_v3_OrFilter_msginit, arena);
- if (!sub) return NULL;
- envoy_config_accesslog_v3_AccessLogFilter_set_or_filter(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_accesslog_v3_AccessLogFilter_set_header_filter(envoy_config_accesslog_v3_AccessLogFilter *msg, envoy_config_accesslog_v3_HeaderFilter* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_accesslog_v3_HeaderFilter*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 8);
-}
-UPB_INLINE struct envoy_config_accesslog_v3_HeaderFilter* envoy_config_accesslog_v3_AccessLogFilter_mutable_header_filter(envoy_config_accesslog_v3_AccessLogFilter *msg, upb_arena *arena) {
- struct envoy_config_accesslog_v3_HeaderFilter* sub = (struct envoy_config_accesslog_v3_HeaderFilter*)envoy_config_accesslog_v3_AccessLogFilter_header_filter(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_accesslog_v3_HeaderFilter*)_upb_msg_new(&envoy_config_accesslog_v3_HeaderFilter_msginit, arena);
- if (!sub) return NULL;
- envoy_config_accesslog_v3_AccessLogFilter_set_header_filter(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_accesslog_v3_AccessLogFilter_set_response_flag_filter(envoy_config_accesslog_v3_AccessLogFilter *msg, envoy_config_accesslog_v3_ResponseFlagFilter* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_accesslog_v3_ResponseFlagFilter*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 9);
-}
-UPB_INLINE struct envoy_config_accesslog_v3_ResponseFlagFilter* envoy_config_accesslog_v3_AccessLogFilter_mutable_response_flag_filter(envoy_config_accesslog_v3_AccessLogFilter *msg, upb_arena *arena) {
- struct envoy_config_accesslog_v3_ResponseFlagFilter* sub = (struct envoy_config_accesslog_v3_ResponseFlagFilter*)envoy_config_accesslog_v3_AccessLogFilter_response_flag_filter(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_accesslog_v3_ResponseFlagFilter*)_upb_msg_new(&envoy_config_accesslog_v3_ResponseFlagFilter_msginit, arena);
- if (!sub) return NULL;
- envoy_config_accesslog_v3_AccessLogFilter_set_response_flag_filter(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_accesslog_v3_AccessLogFilter_set_grpc_status_filter(envoy_config_accesslog_v3_AccessLogFilter *msg, envoy_config_accesslog_v3_GrpcStatusFilter* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_accesslog_v3_GrpcStatusFilter*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 10);
-}
-UPB_INLINE struct envoy_config_accesslog_v3_GrpcStatusFilter* envoy_config_accesslog_v3_AccessLogFilter_mutable_grpc_status_filter(envoy_config_accesslog_v3_AccessLogFilter *msg, upb_arena *arena) {
- struct envoy_config_accesslog_v3_GrpcStatusFilter* sub = (struct envoy_config_accesslog_v3_GrpcStatusFilter*)envoy_config_accesslog_v3_AccessLogFilter_grpc_status_filter(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_accesslog_v3_GrpcStatusFilter*)_upb_msg_new(&envoy_config_accesslog_v3_GrpcStatusFilter_msginit, arena);
- if (!sub) return NULL;
- envoy_config_accesslog_v3_AccessLogFilter_set_grpc_status_filter(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_accesslog_v3_AccessLogFilter_set_extension_filter(envoy_config_accesslog_v3_AccessLogFilter *msg, envoy_config_accesslog_v3_ExtensionFilter* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_accesslog_v3_ExtensionFilter*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 11);
-}
-UPB_INLINE struct envoy_config_accesslog_v3_ExtensionFilter* envoy_config_accesslog_v3_AccessLogFilter_mutable_extension_filter(envoy_config_accesslog_v3_AccessLogFilter *msg, upb_arena *arena) {
- struct envoy_config_accesslog_v3_ExtensionFilter* sub = (struct envoy_config_accesslog_v3_ExtensionFilter*)envoy_config_accesslog_v3_AccessLogFilter_extension_filter(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_accesslog_v3_ExtensionFilter*)_upb_msg_new(&envoy_config_accesslog_v3_ExtensionFilter_msginit, arena);
- if (!sub) return NULL;
- envoy_config_accesslog_v3_AccessLogFilter_set_extension_filter(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_accesslog_v3_AccessLogFilter_set_metadata_filter(envoy_config_accesslog_v3_AccessLogFilter *msg, envoy_config_accesslog_v3_MetadataFilter* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_accesslog_v3_MetadataFilter*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 12);
-}
-UPB_INLINE struct envoy_config_accesslog_v3_MetadataFilter* envoy_config_accesslog_v3_AccessLogFilter_mutable_metadata_filter(envoy_config_accesslog_v3_AccessLogFilter *msg, upb_arena *arena) {
- struct envoy_config_accesslog_v3_MetadataFilter* sub = (struct envoy_config_accesslog_v3_MetadataFilter*)envoy_config_accesslog_v3_AccessLogFilter_metadata_filter(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_accesslog_v3_MetadataFilter*)_upb_msg_new(&envoy_config_accesslog_v3_MetadataFilter_msginit, arena);
- if (!sub) return NULL;
- envoy_config_accesslog_v3_AccessLogFilter_set_metadata_filter(msg, sub);
- }
- return sub;
-}
-
-/* envoy.config.accesslog.v3.ComparisonFilter */
-
-UPB_INLINE envoy_config_accesslog_v3_ComparisonFilter *envoy_config_accesslog_v3_ComparisonFilter_new(upb_arena *arena) {
- return (envoy_config_accesslog_v3_ComparisonFilter *)_upb_msg_new(&envoy_config_accesslog_v3_ComparisonFilter_msginit, arena);
-}
-UPB_INLINE envoy_config_accesslog_v3_ComparisonFilter *envoy_config_accesslog_v3_ComparisonFilter_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_accesslog_v3_ComparisonFilter *ret = envoy_config_accesslog_v3_ComparisonFilter_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_accesslog_v3_ComparisonFilter_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_accesslog_v3_ComparisonFilter_serialize(const envoy_config_accesslog_v3_ComparisonFilter *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_accesslog_v3_ComparisonFilter_msginit, arena, len);
-}
-
-UPB_INLINE int32_t envoy_config_accesslog_v3_ComparisonFilter_op(const envoy_config_accesslog_v3_ComparisonFilter *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
-UPB_INLINE bool envoy_config_accesslog_v3_ComparisonFilter_has_value(const envoy_config_accesslog_v3_ComparisonFilter *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 8)); }
-UPB_INLINE const struct envoy_config_core_v3_RuntimeUInt32* envoy_config_accesslog_v3_ComparisonFilter_value(const envoy_config_accesslog_v3_ComparisonFilter *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const struct envoy_config_core_v3_RuntimeUInt32*); }
-
-UPB_INLINE void envoy_config_accesslog_v3_ComparisonFilter_set_op(envoy_config_accesslog_v3_ComparisonFilter *msg, int32_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
-}
-UPB_INLINE void envoy_config_accesslog_v3_ComparisonFilter_set_value(envoy_config_accesslog_v3_ComparisonFilter *msg, struct envoy_config_core_v3_RuntimeUInt32* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), struct envoy_config_core_v3_RuntimeUInt32*) = value;
-}
-UPB_INLINE struct envoy_config_core_v3_RuntimeUInt32* envoy_config_accesslog_v3_ComparisonFilter_mutable_value(envoy_config_accesslog_v3_ComparisonFilter *msg, upb_arena *arena) {
- struct envoy_config_core_v3_RuntimeUInt32* sub = (struct envoy_config_core_v3_RuntimeUInt32*)envoy_config_accesslog_v3_ComparisonFilter_value(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_RuntimeUInt32*)_upb_msg_new(&envoy_config_core_v3_RuntimeUInt32_msginit, arena);
- if (!sub) return NULL;
- envoy_config_accesslog_v3_ComparisonFilter_set_value(msg, sub);
- }
- return sub;
-}
-
-/* envoy.config.accesslog.v3.StatusCodeFilter */
-
-UPB_INLINE envoy_config_accesslog_v3_StatusCodeFilter *envoy_config_accesslog_v3_StatusCodeFilter_new(upb_arena *arena) {
- return (envoy_config_accesslog_v3_StatusCodeFilter *)_upb_msg_new(&envoy_config_accesslog_v3_StatusCodeFilter_msginit, arena);
-}
-UPB_INLINE envoy_config_accesslog_v3_StatusCodeFilter *envoy_config_accesslog_v3_StatusCodeFilter_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_accesslog_v3_StatusCodeFilter *ret = envoy_config_accesslog_v3_StatusCodeFilter_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_accesslog_v3_StatusCodeFilter_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_accesslog_v3_StatusCodeFilter_serialize(const envoy_config_accesslog_v3_StatusCodeFilter *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_accesslog_v3_StatusCodeFilter_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_config_accesslog_v3_StatusCodeFilter_has_comparison(const envoy_config_accesslog_v3_StatusCodeFilter *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE const envoy_config_accesslog_v3_ComparisonFilter* envoy_config_accesslog_v3_StatusCodeFilter_comparison(const envoy_config_accesslog_v3_StatusCodeFilter *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const envoy_config_accesslog_v3_ComparisonFilter*); }
-
-UPB_INLINE void envoy_config_accesslog_v3_StatusCodeFilter_set_comparison(envoy_config_accesslog_v3_StatusCodeFilter *msg, envoy_config_accesslog_v3_ComparisonFilter* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), envoy_config_accesslog_v3_ComparisonFilter*) = value;
-}
-UPB_INLINE struct envoy_config_accesslog_v3_ComparisonFilter* envoy_config_accesslog_v3_StatusCodeFilter_mutable_comparison(envoy_config_accesslog_v3_StatusCodeFilter *msg, upb_arena *arena) {
- struct envoy_config_accesslog_v3_ComparisonFilter* sub = (struct envoy_config_accesslog_v3_ComparisonFilter*)envoy_config_accesslog_v3_StatusCodeFilter_comparison(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_accesslog_v3_ComparisonFilter*)_upb_msg_new(&envoy_config_accesslog_v3_ComparisonFilter_msginit, arena);
- if (!sub) return NULL;
- envoy_config_accesslog_v3_StatusCodeFilter_set_comparison(msg, sub);
- }
- return sub;
-}
-
-/* envoy.config.accesslog.v3.DurationFilter */
-
-UPB_INLINE envoy_config_accesslog_v3_DurationFilter *envoy_config_accesslog_v3_DurationFilter_new(upb_arena *arena) {
- return (envoy_config_accesslog_v3_DurationFilter *)_upb_msg_new(&envoy_config_accesslog_v3_DurationFilter_msginit, arena);
-}
-UPB_INLINE envoy_config_accesslog_v3_DurationFilter *envoy_config_accesslog_v3_DurationFilter_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_accesslog_v3_DurationFilter *ret = envoy_config_accesslog_v3_DurationFilter_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_accesslog_v3_DurationFilter_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_accesslog_v3_DurationFilter_serialize(const envoy_config_accesslog_v3_DurationFilter *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_accesslog_v3_DurationFilter_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_config_accesslog_v3_DurationFilter_has_comparison(const envoy_config_accesslog_v3_DurationFilter *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE const envoy_config_accesslog_v3_ComparisonFilter* envoy_config_accesslog_v3_DurationFilter_comparison(const envoy_config_accesslog_v3_DurationFilter *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const envoy_config_accesslog_v3_ComparisonFilter*); }
-
-UPB_INLINE void envoy_config_accesslog_v3_DurationFilter_set_comparison(envoy_config_accesslog_v3_DurationFilter *msg, envoy_config_accesslog_v3_ComparisonFilter* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), envoy_config_accesslog_v3_ComparisonFilter*) = value;
-}
-UPB_INLINE struct envoy_config_accesslog_v3_ComparisonFilter* envoy_config_accesslog_v3_DurationFilter_mutable_comparison(envoy_config_accesslog_v3_DurationFilter *msg, upb_arena *arena) {
- struct envoy_config_accesslog_v3_ComparisonFilter* sub = (struct envoy_config_accesslog_v3_ComparisonFilter*)envoy_config_accesslog_v3_DurationFilter_comparison(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_accesslog_v3_ComparisonFilter*)_upb_msg_new(&envoy_config_accesslog_v3_ComparisonFilter_msginit, arena);
- if (!sub) return NULL;
- envoy_config_accesslog_v3_DurationFilter_set_comparison(msg, sub);
- }
- return sub;
-}
-
-/* envoy.config.accesslog.v3.NotHealthCheckFilter */
-
-UPB_INLINE envoy_config_accesslog_v3_NotHealthCheckFilter *envoy_config_accesslog_v3_NotHealthCheckFilter_new(upb_arena *arena) {
- return (envoy_config_accesslog_v3_NotHealthCheckFilter *)_upb_msg_new(&envoy_config_accesslog_v3_NotHealthCheckFilter_msginit, arena);
-}
-UPB_INLINE envoy_config_accesslog_v3_NotHealthCheckFilter *envoy_config_accesslog_v3_NotHealthCheckFilter_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_accesslog_v3_NotHealthCheckFilter *ret = envoy_config_accesslog_v3_NotHealthCheckFilter_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_accesslog_v3_NotHealthCheckFilter_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_accesslog_v3_NotHealthCheckFilter_serialize(const envoy_config_accesslog_v3_NotHealthCheckFilter *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_accesslog_v3_NotHealthCheckFilter_msginit, arena, len);
-}
-
-
-
-/* envoy.config.accesslog.v3.TraceableFilter */
-
-UPB_INLINE envoy_config_accesslog_v3_TraceableFilter *envoy_config_accesslog_v3_TraceableFilter_new(upb_arena *arena) {
- return (envoy_config_accesslog_v3_TraceableFilter *)_upb_msg_new(&envoy_config_accesslog_v3_TraceableFilter_msginit, arena);
-}
-UPB_INLINE envoy_config_accesslog_v3_TraceableFilter *envoy_config_accesslog_v3_TraceableFilter_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_accesslog_v3_TraceableFilter *ret = envoy_config_accesslog_v3_TraceableFilter_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_accesslog_v3_TraceableFilter_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_accesslog_v3_TraceableFilter_serialize(const envoy_config_accesslog_v3_TraceableFilter *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_accesslog_v3_TraceableFilter_msginit, arena, len);
-}
-
-
-
-/* envoy.config.accesslog.v3.RuntimeFilter */
-
-UPB_INLINE envoy_config_accesslog_v3_RuntimeFilter *envoy_config_accesslog_v3_RuntimeFilter_new(upb_arena *arena) {
- return (envoy_config_accesslog_v3_RuntimeFilter *)_upb_msg_new(&envoy_config_accesslog_v3_RuntimeFilter_msginit, arena);
-}
-UPB_INLINE envoy_config_accesslog_v3_RuntimeFilter *envoy_config_accesslog_v3_RuntimeFilter_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_accesslog_v3_RuntimeFilter *ret = envoy_config_accesslog_v3_RuntimeFilter_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_accesslog_v3_RuntimeFilter_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_accesslog_v3_RuntimeFilter_serialize(const envoy_config_accesslog_v3_RuntimeFilter *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_accesslog_v3_RuntimeFilter_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview envoy_config_accesslog_v3_RuntimeFilter_runtime_key(const envoy_config_accesslog_v3_RuntimeFilter *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
-UPB_INLINE bool envoy_config_accesslog_v3_RuntimeFilter_has_percent_sampled(const envoy_config_accesslog_v3_RuntimeFilter *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
-UPB_INLINE const struct envoy_type_v3_FractionalPercent* envoy_config_accesslog_v3_RuntimeFilter_percent_sampled(const envoy_config_accesslog_v3_RuntimeFilter *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct envoy_type_v3_FractionalPercent*); }
-UPB_INLINE bool envoy_config_accesslog_v3_RuntimeFilter_use_independent_randomness(const envoy_config_accesslog_v3_RuntimeFilter *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); }
-
-UPB_INLINE void envoy_config_accesslog_v3_RuntimeFilter_set_runtime_key(envoy_config_accesslog_v3_RuntimeFilter *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_accesslog_v3_RuntimeFilter_set_percent_sampled(envoy_config_accesslog_v3_RuntimeFilter *msg, struct envoy_type_v3_FractionalPercent* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct envoy_type_v3_FractionalPercent*) = value;
-}
-UPB_INLINE struct envoy_type_v3_FractionalPercent* envoy_config_accesslog_v3_RuntimeFilter_mutable_percent_sampled(envoy_config_accesslog_v3_RuntimeFilter *msg, upb_arena *arena) {
- struct envoy_type_v3_FractionalPercent* sub = (struct envoy_type_v3_FractionalPercent*)envoy_config_accesslog_v3_RuntimeFilter_percent_sampled(msg);
- if (sub == NULL) {
- sub = (struct envoy_type_v3_FractionalPercent*)_upb_msg_new(&envoy_type_v3_FractionalPercent_msginit, arena);
- if (!sub) return NULL;
- envoy_config_accesslog_v3_RuntimeFilter_set_percent_sampled(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_accesslog_v3_RuntimeFilter_set_use_independent_randomness(envoy_config_accesslog_v3_RuntimeFilter *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
-}
-
-/* envoy.config.accesslog.v3.AndFilter */
-
-UPB_INLINE envoy_config_accesslog_v3_AndFilter *envoy_config_accesslog_v3_AndFilter_new(upb_arena *arena) {
- return (envoy_config_accesslog_v3_AndFilter *)_upb_msg_new(&envoy_config_accesslog_v3_AndFilter_msginit, arena);
-}
-UPB_INLINE envoy_config_accesslog_v3_AndFilter *envoy_config_accesslog_v3_AndFilter_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_accesslog_v3_AndFilter *ret = envoy_config_accesslog_v3_AndFilter_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_accesslog_v3_AndFilter_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_accesslog_v3_AndFilter_serialize(const envoy_config_accesslog_v3_AndFilter *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_accesslog_v3_AndFilter_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_config_accesslog_v3_AndFilter_has_filters(const envoy_config_accesslog_v3_AndFilter *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE const envoy_config_accesslog_v3_AccessLogFilter* const* envoy_config_accesslog_v3_AndFilter_filters(const envoy_config_accesslog_v3_AndFilter *msg, size_t *len) { return (const envoy_config_accesslog_v3_AccessLogFilter* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
-
-UPB_INLINE envoy_config_accesslog_v3_AccessLogFilter** envoy_config_accesslog_v3_AndFilter_mutable_filters(envoy_config_accesslog_v3_AndFilter *msg, size_t *len) {
- return (envoy_config_accesslog_v3_AccessLogFilter**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
-}
-UPB_INLINE envoy_config_accesslog_v3_AccessLogFilter** envoy_config_accesslog_v3_AndFilter_resize_filters(envoy_config_accesslog_v3_AndFilter *msg, size_t len, upb_arena *arena) {
- return (envoy_config_accesslog_v3_AccessLogFilter**)_upb_array_resize_accessor(msg, UPB_SIZE(0, 0), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_config_accesslog_v3_AccessLogFilter* envoy_config_accesslog_v3_AndFilter_add_filters(envoy_config_accesslog_v3_AndFilter *msg, upb_arena *arena) {
- struct envoy_config_accesslog_v3_AccessLogFilter* sub = (struct envoy_config_accesslog_v3_AccessLogFilter*)_upb_msg_new(&envoy_config_accesslog_v3_AccessLogFilter_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(0, 0), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-
-/* envoy.config.accesslog.v3.OrFilter */
-
-UPB_INLINE envoy_config_accesslog_v3_OrFilter *envoy_config_accesslog_v3_OrFilter_new(upb_arena *arena) {
- return (envoy_config_accesslog_v3_OrFilter *)_upb_msg_new(&envoy_config_accesslog_v3_OrFilter_msginit, arena);
-}
-UPB_INLINE envoy_config_accesslog_v3_OrFilter *envoy_config_accesslog_v3_OrFilter_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_accesslog_v3_OrFilter *ret = envoy_config_accesslog_v3_OrFilter_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_accesslog_v3_OrFilter_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_accesslog_v3_OrFilter_serialize(const envoy_config_accesslog_v3_OrFilter *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_accesslog_v3_OrFilter_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_config_accesslog_v3_OrFilter_has_filters(const envoy_config_accesslog_v3_OrFilter *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE const envoy_config_accesslog_v3_AccessLogFilter* const* envoy_config_accesslog_v3_OrFilter_filters(const envoy_config_accesslog_v3_OrFilter *msg, size_t *len) { return (const envoy_config_accesslog_v3_AccessLogFilter* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
-
-UPB_INLINE envoy_config_accesslog_v3_AccessLogFilter** envoy_config_accesslog_v3_OrFilter_mutable_filters(envoy_config_accesslog_v3_OrFilter *msg, size_t *len) {
- return (envoy_config_accesslog_v3_AccessLogFilter**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
-}
-UPB_INLINE envoy_config_accesslog_v3_AccessLogFilter** envoy_config_accesslog_v3_OrFilter_resize_filters(envoy_config_accesslog_v3_OrFilter *msg, size_t len, upb_arena *arena) {
- return (envoy_config_accesslog_v3_AccessLogFilter**)_upb_array_resize_accessor(msg, UPB_SIZE(0, 0), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_config_accesslog_v3_AccessLogFilter* envoy_config_accesslog_v3_OrFilter_add_filters(envoy_config_accesslog_v3_OrFilter *msg, upb_arena *arena) {
- struct envoy_config_accesslog_v3_AccessLogFilter* sub = (struct envoy_config_accesslog_v3_AccessLogFilter*)_upb_msg_new(&envoy_config_accesslog_v3_AccessLogFilter_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(0, 0), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-
-/* envoy.config.accesslog.v3.HeaderFilter */
-
-UPB_INLINE envoy_config_accesslog_v3_HeaderFilter *envoy_config_accesslog_v3_HeaderFilter_new(upb_arena *arena) {
- return (envoy_config_accesslog_v3_HeaderFilter *)_upb_msg_new(&envoy_config_accesslog_v3_HeaderFilter_msginit, arena);
-}
-UPB_INLINE envoy_config_accesslog_v3_HeaderFilter *envoy_config_accesslog_v3_HeaderFilter_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_accesslog_v3_HeaderFilter *ret = envoy_config_accesslog_v3_HeaderFilter_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_accesslog_v3_HeaderFilter_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_accesslog_v3_HeaderFilter_serialize(const envoy_config_accesslog_v3_HeaderFilter *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_accesslog_v3_HeaderFilter_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_config_accesslog_v3_HeaderFilter_has_header(const envoy_config_accesslog_v3_HeaderFilter *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE const struct envoy_config_route_v3_HeaderMatcher* envoy_config_accesslog_v3_HeaderFilter_header(const envoy_config_accesslog_v3_HeaderFilter *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct envoy_config_route_v3_HeaderMatcher*); }
-
-UPB_INLINE void envoy_config_accesslog_v3_HeaderFilter_set_header(envoy_config_accesslog_v3_HeaderFilter *msg, struct envoy_config_route_v3_HeaderMatcher* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct envoy_config_route_v3_HeaderMatcher*) = value;
-}
-UPB_INLINE struct envoy_config_route_v3_HeaderMatcher* envoy_config_accesslog_v3_HeaderFilter_mutable_header(envoy_config_accesslog_v3_HeaderFilter *msg, upb_arena *arena) {
- struct envoy_config_route_v3_HeaderMatcher* sub = (struct envoy_config_route_v3_HeaderMatcher*)envoy_config_accesslog_v3_HeaderFilter_header(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_route_v3_HeaderMatcher*)_upb_msg_new(&envoy_config_route_v3_HeaderMatcher_msginit, arena);
- if (!sub) return NULL;
- envoy_config_accesslog_v3_HeaderFilter_set_header(msg, sub);
- }
- return sub;
-}
-
-/* envoy.config.accesslog.v3.ResponseFlagFilter */
-
-UPB_INLINE envoy_config_accesslog_v3_ResponseFlagFilter *envoy_config_accesslog_v3_ResponseFlagFilter_new(upb_arena *arena) {
- return (envoy_config_accesslog_v3_ResponseFlagFilter *)_upb_msg_new(&envoy_config_accesslog_v3_ResponseFlagFilter_msginit, arena);
-}
-UPB_INLINE envoy_config_accesslog_v3_ResponseFlagFilter *envoy_config_accesslog_v3_ResponseFlagFilter_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_accesslog_v3_ResponseFlagFilter *ret = envoy_config_accesslog_v3_ResponseFlagFilter_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_accesslog_v3_ResponseFlagFilter_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_accesslog_v3_ResponseFlagFilter_serialize(const envoy_config_accesslog_v3_ResponseFlagFilter *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_accesslog_v3_ResponseFlagFilter_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview const* envoy_config_accesslog_v3_ResponseFlagFilter_flags(const envoy_config_accesslog_v3_ResponseFlagFilter *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
-
-UPB_INLINE upb_strview* envoy_config_accesslog_v3_ResponseFlagFilter_mutable_flags(envoy_config_accesslog_v3_ResponseFlagFilter *msg, size_t *len) {
- return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
-}
-UPB_INLINE upb_strview* envoy_config_accesslog_v3_ResponseFlagFilter_resize_flags(envoy_config_accesslog_v3_ResponseFlagFilter *msg, size_t len, upb_arena *arena) {
- return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(0, 0), len, UPB_TYPE_STRING, arena);
-}
-UPB_INLINE bool envoy_config_accesslog_v3_ResponseFlagFilter_add_flags(envoy_config_accesslog_v3_ResponseFlagFilter *msg, upb_strview val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(0, 0), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
- arena);
-}
-
-/* envoy.config.accesslog.v3.GrpcStatusFilter */
-
-UPB_INLINE envoy_config_accesslog_v3_GrpcStatusFilter *envoy_config_accesslog_v3_GrpcStatusFilter_new(upb_arena *arena) {
- return (envoy_config_accesslog_v3_GrpcStatusFilter *)_upb_msg_new(&envoy_config_accesslog_v3_GrpcStatusFilter_msginit, arena);
-}
-UPB_INLINE envoy_config_accesslog_v3_GrpcStatusFilter *envoy_config_accesslog_v3_GrpcStatusFilter_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_accesslog_v3_GrpcStatusFilter *ret = envoy_config_accesslog_v3_GrpcStatusFilter_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_accesslog_v3_GrpcStatusFilter_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_accesslog_v3_GrpcStatusFilter_serialize(const envoy_config_accesslog_v3_GrpcStatusFilter *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_accesslog_v3_GrpcStatusFilter_msginit, arena, len);
-}
-
-UPB_INLINE int32_t const* envoy_config_accesslog_v3_GrpcStatusFilter_statuses(const envoy_config_accesslog_v3_GrpcStatusFilter *msg, size_t *len) { return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len); }
-UPB_INLINE bool envoy_config_accesslog_v3_GrpcStatusFilter_exclude(const envoy_config_accesslog_v3_GrpcStatusFilter *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); }
-
-UPB_INLINE int32_t* envoy_config_accesslog_v3_GrpcStatusFilter_mutable_statuses(envoy_config_accesslog_v3_GrpcStatusFilter *msg, size_t *len) {
- return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len);
-}
-UPB_INLINE int32_t* envoy_config_accesslog_v3_GrpcStatusFilter_resize_statuses(envoy_config_accesslog_v3_GrpcStatusFilter *msg, size_t len, upb_arena *arena) {
- return (int32_t*)_upb_array_resize_accessor(msg, UPB_SIZE(4, 8), len, UPB_TYPE_ENUM, arena);
-}
-UPB_INLINE bool envoy_config_accesslog_v3_GrpcStatusFilter_add_statuses(envoy_config_accesslog_v3_GrpcStatusFilter *msg, int32_t val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(4, 8), UPB_SIZE(8, 8), UPB_TYPE_ENUM, &val,
- arena);
-}
-UPB_INLINE void envoy_config_accesslog_v3_GrpcStatusFilter_set_exclude(envoy_config_accesslog_v3_GrpcStatusFilter *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
-}
-
-/* envoy.config.accesslog.v3.MetadataFilter */
-
-UPB_INLINE envoy_config_accesslog_v3_MetadataFilter *envoy_config_accesslog_v3_MetadataFilter_new(upb_arena *arena) {
- return (envoy_config_accesslog_v3_MetadataFilter *)_upb_msg_new(&envoy_config_accesslog_v3_MetadataFilter_msginit, arena);
-}
-UPB_INLINE envoy_config_accesslog_v3_MetadataFilter *envoy_config_accesslog_v3_MetadataFilter_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_accesslog_v3_MetadataFilter *ret = envoy_config_accesslog_v3_MetadataFilter_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_accesslog_v3_MetadataFilter_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_accesslog_v3_MetadataFilter_serialize(const envoy_config_accesslog_v3_MetadataFilter *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_accesslog_v3_MetadataFilter_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_config_accesslog_v3_MetadataFilter_has_matcher(const envoy_config_accesslog_v3_MetadataFilter *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE const struct envoy_type_matcher_v3_MetadataMatcher* envoy_config_accesslog_v3_MetadataFilter_matcher(const envoy_config_accesslog_v3_MetadataFilter *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct envoy_type_matcher_v3_MetadataMatcher*); }
-UPB_INLINE bool envoy_config_accesslog_v3_MetadataFilter_has_match_if_key_not_found(const envoy_config_accesslog_v3_MetadataFilter *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
-UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_accesslog_v3_MetadataFilter_match_if_key_not_found(const envoy_config_accesslog_v3_MetadataFilter *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_BoolValue*); }
-
-UPB_INLINE void envoy_config_accesslog_v3_MetadataFilter_set_matcher(envoy_config_accesslog_v3_MetadataFilter *msg, struct envoy_type_matcher_v3_MetadataMatcher* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct envoy_type_matcher_v3_MetadataMatcher*) = value;
-}
-UPB_INLINE struct envoy_type_matcher_v3_MetadataMatcher* envoy_config_accesslog_v3_MetadataFilter_mutable_matcher(envoy_config_accesslog_v3_MetadataFilter *msg, upb_arena *arena) {
- struct envoy_type_matcher_v3_MetadataMatcher* sub = (struct envoy_type_matcher_v3_MetadataMatcher*)envoy_config_accesslog_v3_MetadataFilter_matcher(msg);
- if (sub == NULL) {
- sub = (struct envoy_type_matcher_v3_MetadataMatcher*)_upb_msg_new(&envoy_type_matcher_v3_MetadataMatcher_msginit, arena);
- if (!sub) return NULL;
- envoy_config_accesslog_v3_MetadataFilter_set_matcher(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_accesslog_v3_MetadataFilter_set_match_if_key_not_found(envoy_config_accesslog_v3_MetadataFilter *msg, struct google_protobuf_BoolValue* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_BoolValue*) = value;
-}
-UPB_INLINE struct google_protobuf_BoolValue* envoy_config_accesslog_v3_MetadataFilter_mutable_match_if_key_not_found(envoy_config_accesslog_v3_MetadataFilter *msg, upb_arena *arena) {
- struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_accesslog_v3_MetadataFilter_match_if_key_not_found(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_BoolValue*)_upb_msg_new(&google_protobuf_BoolValue_msginit, arena);
- if (!sub) return NULL;
- envoy_config_accesslog_v3_MetadataFilter_set_match_if_key_not_found(msg, sub);
- }
- return sub;
-}
-
-/* envoy.config.accesslog.v3.ExtensionFilter */
-
-UPB_INLINE envoy_config_accesslog_v3_ExtensionFilter *envoy_config_accesslog_v3_ExtensionFilter_new(upb_arena *arena) {
- return (envoy_config_accesslog_v3_ExtensionFilter *)_upb_msg_new(&envoy_config_accesslog_v3_ExtensionFilter_msginit, arena);
-}
-UPB_INLINE envoy_config_accesslog_v3_ExtensionFilter *envoy_config_accesslog_v3_ExtensionFilter_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_accesslog_v3_ExtensionFilter *ret = envoy_config_accesslog_v3_ExtensionFilter_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_accesslog_v3_ExtensionFilter_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_accesslog_v3_ExtensionFilter_serialize(const envoy_config_accesslog_v3_ExtensionFilter *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_accesslog_v3_ExtensionFilter_msginit, arena, len);
-}
-
-typedef enum {
- envoy_config_accesslog_v3_ExtensionFilter_config_type_typed_config = 3,
- envoy_config_accesslog_v3_ExtensionFilter_config_type_NOT_SET = 0
-} envoy_config_accesslog_v3_ExtensionFilter_config_type_oneofcases;
-UPB_INLINE envoy_config_accesslog_v3_ExtensionFilter_config_type_oneofcases envoy_config_accesslog_v3_ExtensionFilter_config_type_case(const envoy_config_accesslog_v3_ExtensionFilter* msg) { return (envoy_config_accesslog_v3_ExtensionFilter_config_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(12, 24), int32_t); }
-
-UPB_INLINE upb_strview envoy_config_accesslog_v3_ExtensionFilter_name(const envoy_config_accesslog_v3_ExtensionFilter *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE bool envoy_config_accesslog_v3_ExtensionFilter_has_typed_config(const envoy_config_accesslog_v3_ExtensionFilter *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 3; }
-UPB_INLINE const struct google_protobuf_Any* envoy_config_accesslog_v3_ExtensionFilter_typed_config(const envoy_config_accesslog_v3_ExtensionFilter *msg) { return UPB_READ_ONEOF(msg, const struct google_protobuf_Any*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 3, NULL); }
-
-UPB_INLINE void envoy_config_accesslog_v3_ExtensionFilter_set_name(envoy_config_accesslog_v3_ExtensionFilter *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_accesslog_v3_ExtensionFilter_set_typed_config(envoy_config_accesslog_v3_ExtensionFilter *msg, struct google_protobuf_Any* value) {
- UPB_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 3);
-}
-UPB_INLINE struct google_protobuf_Any* envoy_config_accesslog_v3_ExtensionFilter_mutable_typed_config(envoy_config_accesslog_v3_ExtensionFilter *msg, upb_arena *arena) {
- struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_config_accesslog_v3_ExtensionFilter_typed_config(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena);
- if (!sub) return NULL;
- envoy_config_accesslog_v3_ExtensionFilter_set_typed_config(msg, sub);
- }
- return sub;
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* ENVOY_CONFIG_ACCESSLOG_V3_ACCESSLOG_PROTO_UPB_H_ */
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/accesslog/v3/accesslog.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_CONFIG_ACCESSLOG_V3_ACCESSLOG_PROTO_UPB_H_
+#define ENVOY_CONFIG_ACCESSLOG_V3_ACCESSLOG_PROTO_UPB_H_
+
+#include "upb/msg.h"
+#include "upb/decode.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_config_accesslog_v3_AccessLog;
+struct envoy_config_accesslog_v3_AccessLogFilter;
+struct envoy_config_accesslog_v3_ComparisonFilter;
+struct envoy_config_accesslog_v3_StatusCodeFilter;
+struct envoy_config_accesslog_v3_DurationFilter;
+struct envoy_config_accesslog_v3_NotHealthCheckFilter;
+struct envoy_config_accesslog_v3_TraceableFilter;
+struct envoy_config_accesslog_v3_RuntimeFilter;
+struct envoy_config_accesslog_v3_AndFilter;
+struct envoy_config_accesslog_v3_OrFilter;
+struct envoy_config_accesslog_v3_HeaderFilter;
+struct envoy_config_accesslog_v3_ResponseFlagFilter;
+struct envoy_config_accesslog_v3_GrpcStatusFilter;
+struct envoy_config_accesslog_v3_MetadataFilter;
+struct envoy_config_accesslog_v3_ExtensionFilter;
+typedef struct envoy_config_accesslog_v3_AccessLog envoy_config_accesslog_v3_AccessLog;
+typedef struct envoy_config_accesslog_v3_AccessLogFilter envoy_config_accesslog_v3_AccessLogFilter;
+typedef struct envoy_config_accesslog_v3_ComparisonFilter envoy_config_accesslog_v3_ComparisonFilter;
+typedef struct envoy_config_accesslog_v3_StatusCodeFilter envoy_config_accesslog_v3_StatusCodeFilter;
+typedef struct envoy_config_accesslog_v3_DurationFilter envoy_config_accesslog_v3_DurationFilter;
+typedef struct envoy_config_accesslog_v3_NotHealthCheckFilter envoy_config_accesslog_v3_NotHealthCheckFilter;
+typedef struct envoy_config_accesslog_v3_TraceableFilter envoy_config_accesslog_v3_TraceableFilter;
+typedef struct envoy_config_accesslog_v3_RuntimeFilter envoy_config_accesslog_v3_RuntimeFilter;
+typedef struct envoy_config_accesslog_v3_AndFilter envoy_config_accesslog_v3_AndFilter;
+typedef struct envoy_config_accesslog_v3_OrFilter envoy_config_accesslog_v3_OrFilter;
+typedef struct envoy_config_accesslog_v3_HeaderFilter envoy_config_accesslog_v3_HeaderFilter;
+typedef struct envoy_config_accesslog_v3_ResponseFlagFilter envoy_config_accesslog_v3_ResponseFlagFilter;
+typedef struct envoy_config_accesslog_v3_GrpcStatusFilter envoy_config_accesslog_v3_GrpcStatusFilter;
+typedef struct envoy_config_accesslog_v3_MetadataFilter envoy_config_accesslog_v3_MetadataFilter;
+typedef struct envoy_config_accesslog_v3_ExtensionFilter envoy_config_accesslog_v3_ExtensionFilter;
+extern const upb_msglayout envoy_config_accesslog_v3_AccessLog_msginit;
+extern const upb_msglayout envoy_config_accesslog_v3_AccessLogFilter_msginit;
+extern const upb_msglayout envoy_config_accesslog_v3_ComparisonFilter_msginit;
+extern const upb_msglayout envoy_config_accesslog_v3_StatusCodeFilter_msginit;
+extern const upb_msglayout envoy_config_accesslog_v3_DurationFilter_msginit;
+extern const upb_msglayout envoy_config_accesslog_v3_NotHealthCheckFilter_msginit;
+extern const upb_msglayout envoy_config_accesslog_v3_TraceableFilter_msginit;
+extern const upb_msglayout envoy_config_accesslog_v3_RuntimeFilter_msginit;
+extern const upb_msglayout envoy_config_accesslog_v3_AndFilter_msginit;
+extern const upb_msglayout envoy_config_accesslog_v3_OrFilter_msginit;
+extern const upb_msglayout envoy_config_accesslog_v3_HeaderFilter_msginit;
+extern const upb_msglayout envoy_config_accesslog_v3_ResponseFlagFilter_msginit;
+extern const upb_msglayout envoy_config_accesslog_v3_GrpcStatusFilter_msginit;
+extern const upb_msglayout envoy_config_accesslog_v3_MetadataFilter_msginit;
+extern const upb_msglayout envoy_config_accesslog_v3_ExtensionFilter_msginit;
+struct envoy_config_core_v3_RuntimeUInt32;
+struct envoy_config_route_v3_HeaderMatcher;
+struct envoy_type_matcher_v3_MetadataMatcher;
+struct envoy_type_v3_FractionalPercent;
+struct google_protobuf_Any;
+struct google_protobuf_BoolValue;
+extern const upb_msglayout envoy_config_core_v3_RuntimeUInt32_msginit;
+extern const upb_msglayout envoy_config_route_v3_HeaderMatcher_msginit;
+extern const upb_msglayout envoy_type_matcher_v3_MetadataMatcher_msginit;
+extern const upb_msglayout envoy_type_v3_FractionalPercent_msginit;
+extern const upb_msglayout google_protobuf_Any_msginit;
+extern const upb_msglayout google_protobuf_BoolValue_msginit;
+
+typedef enum {
+ envoy_config_accesslog_v3_ComparisonFilter_EQ = 0,
+ envoy_config_accesslog_v3_ComparisonFilter_GE = 1,
+ envoy_config_accesslog_v3_ComparisonFilter_LE = 2
+} envoy_config_accesslog_v3_ComparisonFilter_Op;
+
+typedef enum {
+ envoy_config_accesslog_v3_GrpcStatusFilter_OK = 0,
+ envoy_config_accesslog_v3_GrpcStatusFilter_CANCELED = 1,
+ envoy_config_accesslog_v3_GrpcStatusFilter_UNKNOWN = 2,
+ envoy_config_accesslog_v3_GrpcStatusFilter_INVALID_ARGUMENT = 3,
+ envoy_config_accesslog_v3_GrpcStatusFilter_DEADLINE_EXCEEDED = 4,
+ envoy_config_accesslog_v3_GrpcStatusFilter_NOT_FOUND = 5,
+ envoy_config_accesslog_v3_GrpcStatusFilter_ALREADY_EXISTS = 6,
+ envoy_config_accesslog_v3_GrpcStatusFilter_PERMISSION_DENIED = 7,
+ envoy_config_accesslog_v3_GrpcStatusFilter_RESOURCE_EXHAUSTED = 8,
+ envoy_config_accesslog_v3_GrpcStatusFilter_FAILED_PRECONDITION = 9,
+ envoy_config_accesslog_v3_GrpcStatusFilter_ABORTED = 10,
+ envoy_config_accesslog_v3_GrpcStatusFilter_OUT_OF_RANGE = 11,
+ envoy_config_accesslog_v3_GrpcStatusFilter_UNIMPLEMENTED = 12,
+ envoy_config_accesslog_v3_GrpcStatusFilter_INTERNAL = 13,
+ envoy_config_accesslog_v3_GrpcStatusFilter_UNAVAILABLE = 14,
+ envoy_config_accesslog_v3_GrpcStatusFilter_DATA_LOSS = 15,
+ envoy_config_accesslog_v3_GrpcStatusFilter_UNAUTHENTICATED = 16
+} envoy_config_accesslog_v3_GrpcStatusFilter_Status;
+
+
+/* envoy.config.accesslog.v3.AccessLog */
+
+UPB_INLINE envoy_config_accesslog_v3_AccessLog *envoy_config_accesslog_v3_AccessLog_new(upb_arena *arena) {
+ return (envoy_config_accesslog_v3_AccessLog *)_upb_msg_new(&envoy_config_accesslog_v3_AccessLog_msginit, arena);
+}
+UPB_INLINE envoy_config_accesslog_v3_AccessLog *envoy_config_accesslog_v3_AccessLog_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_accesslog_v3_AccessLog *ret = envoy_config_accesslog_v3_AccessLog_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_accesslog_v3_AccessLog_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_accesslog_v3_AccessLog_serialize(const envoy_config_accesslog_v3_AccessLog *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_accesslog_v3_AccessLog_msginit, arena, len);
+}
+
+typedef enum {
+ envoy_config_accesslog_v3_AccessLog_config_type_typed_config = 4,
+ envoy_config_accesslog_v3_AccessLog_config_type_NOT_SET = 0
+} envoy_config_accesslog_v3_AccessLog_config_type_oneofcases;
+UPB_INLINE envoy_config_accesslog_v3_AccessLog_config_type_oneofcases envoy_config_accesslog_v3_AccessLog_config_type_case(const envoy_config_accesslog_v3_AccessLog* msg) { return (envoy_config_accesslog_v3_AccessLog_config_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(16, 32), int32_t); }
+
+UPB_INLINE upb_strview envoy_config_accesslog_v3_AccessLog_name(const envoy_config_accesslog_v3_AccessLog *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE bool envoy_config_accesslog_v3_AccessLog_has_filter(const envoy_config_accesslog_v3_AccessLog *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
+UPB_INLINE const envoy_config_accesslog_v3_AccessLogFilter* envoy_config_accesslog_v3_AccessLog_filter(const envoy_config_accesslog_v3_AccessLog *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const envoy_config_accesslog_v3_AccessLogFilter*); }
+UPB_INLINE bool envoy_config_accesslog_v3_AccessLog_has_typed_config(const envoy_config_accesslog_v3_AccessLog *msg) { return _upb_getoneofcase(msg, UPB_SIZE(16, 32)) == 4; }
+UPB_INLINE const struct google_protobuf_Any* envoy_config_accesslog_v3_AccessLog_typed_config(const envoy_config_accesslog_v3_AccessLog *msg) { return UPB_READ_ONEOF(msg, const struct google_protobuf_Any*, UPB_SIZE(12, 24), UPB_SIZE(16, 32), 4, NULL); }
+
+UPB_INLINE void envoy_config_accesslog_v3_AccessLog_set_name(envoy_config_accesslog_v3_AccessLog *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_accesslog_v3_AccessLog_set_filter(envoy_config_accesslog_v3_AccessLog *msg, envoy_config_accesslog_v3_AccessLogFilter* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), envoy_config_accesslog_v3_AccessLogFilter*) = value;
+}
+UPB_INLINE struct envoy_config_accesslog_v3_AccessLogFilter* envoy_config_accesslog_v3_AccessLog_mutable_filter(envoy_config_accesslog_v3_AccessLog *msg, upb_arena *arena) {
+ struct envoy_config_accesslog_v3_AccessLogFilter* sub = (struct envoy_config_accesslog_v3_AccessLogFilter*)envoy_config_accesslog_v3_AccessLog_filter(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_accesslog_v3_AccessLogFilter*)_upb_msg_new(&envoy_config_accesslog_v3_AccessLogFilter_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_accesslog_v3_AccessLog_set_filter(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_accesslog_v3_AccessLog_set_typed_config(envoy_config_accesslog_v3_AccessLog *msg, struct google_protobuf_Any* value) {
+ UPB_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(12, 24), value, UPB_SIZE(16, 32), 4);
+}
+UPB_INLINE struct google_protobuf_Any* envoy_config_accesslog_v3_AccessLog_mutable_typed_config(envoy_config_accesslog_v3_AccessLog *msg, upb_arena *arena) {
+ struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_config_accesslog_v3_AccessLog_typed_config(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_accesslog_v3_AccessLog_set_typed_config(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.accesslog.v3.AccessLogFilter */
+
+UPB_INLINE envoy_config_accesslog_v3_AccessLogFilter *envoy_config_accesslog_v3_AccessLogFilter_new(upb_arena *arena) {
+ return (envoy_config_accesslog_v3_AccessLogFilter *)_upb_msg_new(&envoy_config_accesslog_v3_AccessLogFilter_msginit, arena);
+}
+UPB_INLINE envoy_config_accesslog_v3_AccessLogFilter *envoy_config_accesslog_v3_AccessLogFilter_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_accesslog_v3_AccessLogFilter *ret = envoy_config_accesslog_v3_AccessLogFilter_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_accesslog_v3_AccessLogFilter_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_accesslog_v3_AccessLogFilter_serialize(const envoy_config_accesslog_v3_AccessLogFilter *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_accesslog_v3_AccessLogFilter_msginit, arena, len);
+}
+
+typedef enum {
+ envoy_config_accesslog_v3_AccessLogFilter_filter_specifier_status_code_filter = 1,
+ envoy_config_accesslog_v3_AccessLogFilter_filter_specifier_duration_filter = 2,
+ envoy_config_accesslog_v3_AccessLogFilter_filter_specifier_not_health_check_filter = 3,
+ envoy_config_accesslog_v3_AccessLogFilter_filter_specifier_traceable_filter = 4,
+ envoy_config_accesslog_v3_AccessLogFilter_filter_specifier_runtime_filter = 5,
+ envoy_config_accesslog_v3_AccessLogFilter_filter_specifier_and_filter = 6,
+ envoy_config_accesslog_v3_AccessLogFilter_filter_specifier_or_filter = 7,
+ envoy_config_accesslog_v3_AccessLogFilter_filter_specifier_header_filter = 8,
+ envoy_config_accesslog_v3_AccessLogFilter_filter_specifier_response_flag_filter = 9,
+ envoy_config_accesslog_v3_AccessLogFilter_filter_specifier_grpc_status_filter = 10,
+ envoy_config_accesslog_v3_AccessLogFilter_filter_specifier_extension_filter = 11,
+ envoy_config_accesslog_v3_AccessLogFilter_filter_specifier_metadata_filter = 12,
+ envoy_config_accesslog_v3_AccessLogFilter_filter_specifier_NOT_SET = 0
+} envoy_config_accesslog_v3_AccessLogFilter_filter_specifier_oneofcases;
+UPB_INLINE envoy_config_accesslog_v3_AccessLogFilter_filter_specifier_oneofcases envoy_config_accesslog_v3_AccessLogFilter_filter_specifier_case(const envoy_config_accesslog_v3_AccessLogFilter* msg) { return (envoy_config_accesslog_v3_AccessLogFilter_filter_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 8), int32_t); }
+
+UPB_INLINE bool envoy_config_accesslog_v3_AccessLogFilter_has_status_code_filter(const envoy_config_accesslog_v3_AccessLogFilter *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 1; }
+UPB_INLINE const envoy_config_accesslog_v3_StatusCodeFilter* envoy_config_accesslog_v3_AccessLogFilter_status_code_filter(const envoy_config_accesslog_v3_AccessLogFilter *msg) { return UPB_READ_ONEOF(msg, const envoy_config_accesslog_v3_StatusCodeFilter*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 1, NULL); }
+UPB_INLINE bool envoy_config_accesslog_v3_AccessLogFilter_has_duration_filter(const envoy_config_accesslog_v3_AccessLogFilter *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 2; }
+UPB_INLINE const envoy_config_accesslog_v3_DurationFilter* envoy_config_accesslog_v3_AccessLogFilter_duration_filter(const envoy_config_accesslog_v3_AccessLogFilter *msg) { return UPB_READ_ONEOF(msg, const envoy_config_accesslog_v3_DurationFilter*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 2, NULL); }
+UPB_INLINE bool envoy_config_accesslog_v3_AccessLogFilter_has_not_health_check_filter(const envoy_config_accesslog_v3_AccessLogFilter *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 3; }
+UPB_INLINE const envoy_config_accesslog_v3_NotHealthCheckFilter* envoy_config_accesslog_v3_AccessLogFilter_not_health_check_filter(const envoy_config_accesslog_v3_AccessLogFilter *msg) { return UPB_READ_ONEOF(msg, const envoy_config_accesslog_v3_NotHealthCheckFilter*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 3, NULL); }
+UPB_INLINE bool envoy_config_accesslog_v3_AccessLogFilter_has_traceable_filter(const envoy_config_accesslog_v3_AccessLogFilter *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 4; }
+UPB_INLINE const envoy_config_accesslog_v3_TraceableFilter* envoy_config_accesslog_v3_AccessLogFilter_traceable_filter(const envoy_config_accesslog_v3_AccessLogFilter *msg) { return UPB_READ_ONEOF(msg, const envoy_config_accesslog_v3_TraceableFilter*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 4, NULL); }
+UPB_INLINE bool envoy_config_accesslog_v3_AccessLogFilter_has_runtime_filter(const envoy_config_accesslog_v3_AccessLogFilter *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 5; }
+UPB_INLINE const envoy_config_accesslog_v3_RuntimeFilter* envoy_config_accesslog_v3_AccessLogFilter_runtime_filter(const envoy_config_accesslog_v3_AccessLogFilter *msg) { return UPB_READ_ONEOF(msg, const envoy_config_accesslog_v3_RuntimeFilter*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 5, NULL); }
+UPB_INLINE bool envoy_config_accesslog_v3_AccessLogFilter_has_and_filter(const envoy_config_accesslog_v3_AccessLogFilter *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 6; }
+UPB_INLINE const envoy_config_accesslog_v3_AndFilter* envoy_config_accesslog_v3_AccessLogFilter_and_filter(const envoy_config_accesslog_v3_AccessLogFilter *msg) { return UPB_READ_ONEOF(msg, const envoy_config_accesslog_v3_AndFilter*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 6, NULL); }
+UPB_INLINE bool envoy_config_accesslog_v3_AccessLogFilter_has_or_filter(const envoy_config_accesslog_v3_AccessLogFilter *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 7; }
+UPB_INLINE const envoy_config_accesslog_v3_OrFilter* envoy_config_accesslog_v3_AccessLogFilter_or_filter(const envoy_config_accesslog_v3_AccessLogFilter *msg) { return UPB_READ_ONEOF(msg, const envoy_config_accesslog_v3_OrFilter*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 7, NULL); }
+UPB_INLINE bool envoy_config_accesslog_v3_AccessLogFilter_has_header_filter(const envoy_config_accesslog_v3_AccessLogFilter *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 8; }
+UPB_INLINE const envoy_config_accesslog_v3_HeaderFilter* envoy_config_accesslog_v3_AccessLogFilter_header_filter(const envoy_config_accesslog_v3_AccessLogFilter *msg) { return UPB_READ_ONEOF(msg, const envoy_config_accesslog_v3_HeaderFilter*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 8, NULL); }
+UPB_INLINE bool envoy_config_accesslog_v3_AccessLogFilter_has_response_flag_filter(const envoy_config_accesslog_v3_AccessLogFilter *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 9; }
+UPB_INLINE const envoy_config_accesslog_v3_ResponseFlagFilter* envoy_config_accesslog_v3_AccessLogFilter_response_flag_filter(const envoy_config_accesslog_v3_AccessLogFilter *msg) { return UPB_READ_ONEOF(msg, const envoy_config_accesslog_v3_ResponseFlagFilter*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 9, NULL); }
+UPB_INLINE bool envoy_config_accesslog_v3_AccessLogFilter_has_grpc_status_filter(const envoy_config_accesslog_v3_AccessLogFilter *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 10; }
+UPB_INLINE const envoy_config_accesslog_v3_GrpcStatusFilter* envoy_config_accesslog_v3_AccessLogFilter_grpc_status_filter(const envoy_config_accesslog_v3_AccessLogFilter *msg) { return UPB_READ_ONEOF(msg, const envoy_config_accesslog_v3_GrpcStatusFilter*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 10, NULL); }
+UPB_INLINE bool envoy_config_accesslog_v3_AccessLogFilter_has_extension_filter(const envoy_config_accesslog_v3_AccessLogFilter *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 11; }
+UPB_INLINE const envoy_config_accesslog_v3_ExtensionFilter* envoy_config_accesslog_v3_AccessLogFilter_extension_filter(const envoy_config_accesslog_v3_AccessLogFilter *msg) { return UPB_READ_ONEOF(msg, const envoy_config_accesslog_v3_ExtensionFilter*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 11, NULL); }
+UPB_INLINE bool envoy_config_accesslog_v3_AccessLogFilter_has_metadata_filter(const envoy_config_accesslog_v3_AccessLogFilter *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 12; }
+UPB_INLINE const envoy_config_accesslog_v3_MetadataFilter* envoy_config_accesslog_v3_AccessLogFilter_metadata_filter(const envoy_config_accesslog_v3_AccessLogFilter *msg) { return UPB_READ_ONEOF(msg, const envoy_config_accesslog_v3_MetadataFilter*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 12, NULL); }
+
+UPB_INLINE void envoy_config_accesslog_v3_AccessLogFilter_set_status_code_filter(envoy_config_accesslog_v3_AccessLogFilter *msg, envoy_config_accesslog_v3_StatusCodeFilter* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_accesslog_v3_StatusCodeFilter*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 1);
+}
+UPB_INLINE struct envoy_config_accesslog_v3_StatusCodeFilter* envoy_config_accesslog_v3_AccessLogFilter_mutable_status_code_filter(envoy_config_accesslog_v3_AccessLogFilter *msg, upb_arena *arena) {
+ struct envoy_config_accesslog_v3_StatusCodeFilter* sub = (struct envoy_config_accesslog_v3_StatusCodeFilter*)envoy_config_accesslog_v3_AccessLogFilter_status_code_filter(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_accesslog_v3_StatusCodeFilter*)_upb_msg_new(&envoy_config_accesslog_v3_StatusCodeFilter_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_accesslog_v3_AccessLogFilter_set_status_code_filter(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_accesslog_v3_AccessLogFilter_set_duration_filter(envoy_config_accesslog_v3_AccessLogFilter *msg, envoy_config_accesslog_v3_DurationFilter* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_accesslog_v3_DurationFilter*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 2);
+}
+UPB_INLINE struct envoy_config_accesslog_v3_DurationFilter* envoy_config_accesslog_v3_AccessLogFilter_mutable_duration_filter(envoy_config_accesslog_v3_AccessLogFilter *msg, upb_arena *arena) {
+ struct envoy_config_accesslog_v3_DurationFilter* sub = (struct envoy_config_accesslog_v3_DurationFilter*)envoy_config_accesslog_v3_AccessLogFilter_duration_filter(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_accesslog_v3_DurationFilter*)_upb_msg_new(&envoy_config_accesslog_v3_DurationFilter_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_accesslog_v3_AccessLogFilter_set_duration_filter(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_accesslog_v3_AccessLogFilter_set_not_health_check_filter(envoy_config_accesslog_v3_AccessLogFilter *msg, envoy_config_accesslog_v3_NotHealthCheckFilter* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_accesslog_v3_NotHealthCheckFilter*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 3);
+}
+UPB_INLINE struct envoy_config_accesslog_v3_NotHealthCheckFilter* envoy_config_accesslog_v3_AccessLogFilter_mutable_not_health_check_filter(envoy_config_accesslog_v3_AccessLogFilter *msg, upb_arena *arena) {
+ struct envoy_config_accesslog_v3_NotHealthCheckFilter* sub = (struct envoy_config_accesslog_v3_NotHealthCheckFilter*)envoy_config_accesslog_v3_AccessLogFilter_not_health_check_filter(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_accesslog_v3_NotHealthCheckFilter*)_upb_msg_new(&envoy_config_accesslog_v3_NotHealthCheckFilter_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_accesslog_v3_AccessLogFilter_set_not_health_check_filter(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_accesslog_v3_AccessLogFilter_set_traceable_filter(envoy_config_accesslog_v3_AccessLogFilter *msg, envoy_config_accesslog_v3_TraceableFilter* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_accesslog_v3_TraceableFilter*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 4);
+}
+UPB_INLINE struct envoy_config_accesslog_v3_TraceableFilter* envoy_config_accesslog_v3_AccessLogFilter_mutable_traceable_filter(envoy_config_accesslog_v3_AccessLogFilter *msg, upb_arena *arena) {
+ struct envoy_config_accesslog_v3_TraceableFilter* sub = (struct envoy_config_accesslog_v3_TraceableFilter*)envoy_config_accesslog_v3_AccessLogFilter_traceable_filter(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_accesslog_v3_TraceableFilter*)_upb_msg_new(&envoy_config_accesslog_v3_TraceableFilter_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_accesslog_v3_AccessLogFilter_set_traceable_filter(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_accesslog_v3_AccessLogFilter_set_runtime_filter(envoy_config_accesslog_v3_AccessLogFilter *msg, envoy_config_accesslog_v3_RuntimeFilter* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_accesslog_v3_RuntimeFilter*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 5);
+}
+UPB_INLINE struct envoy_config_accesslog_v3_RuntimeFilter* envoy_config_accesslog_v3_AccessLogFilter_mutable_runtime_filter(envoy_config_accesslog_v3_AccessLogFilter *msg, upb_arena *arena) {
+ struct envoy_config_accesslog_v3_RuntimeFilter* sub = (struct envoy_config_accesslog_v3_RuntimeFilter*)envoy_config_accesslog_v3_AccessLogFilter_runtime_filter(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_accesslog_v3_RuntimeFilter*)_upb_msg_new(&envoy_config_accesslog_v3_RuntimeFilter_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_accesslog_v3_AccessLogFilter_set_runtime_filter(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_accesslog_v3_AccessLogFilter_set_and_filter(envoy_config_accesslog_v3_AccessLogFilter *msg, envoy_config_accesslog_v3_AndFilter* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_accesslog_v3_AndFilter*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 6);
+}
+UPB_INLINE struct envoy_config_accesslog_v3_AndFilter* envoy_config_accesslog_v3_AccessLogFilter_mutable_and_filter(envoy_config_accesslog_v3_AccessLogFilter *msg, upb_arena *arena) {
+ struct envoy_config_accesslog_v3_AndFilter* sub = (struct envoy_config_accesslog_v3_AndFilter*)envoy_config_accesslog_v3_AccessLogFilter_and_filter(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_accesslog_v3_AndFilter*)_upb_msg_new(&envoy_config_accesslog_v3_AndFilter_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_accesslog_v3_AccessLogFilter_set_and_filter(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_accesslog_v3_AccessLogFilter_set_or_filter(envoy_config_accesslog_v3_AccessLogFilter *msg, envoy_config_accesslog_v3_OrFilter* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_accesslog_v3_OrFilter*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 7);
+}
+UPB_INLINE struct envoy_config_accesslog_v3_OrFilter* envoy_config_accesslog_v3_AccessLogFilter_mutable_or_filter(envoy_config_accesslog_v3_AccessLogFilter *msg, upb_arena *arena) {
+ struct envoy_config_accesslog_v3_OrFilter* sub = (struct envoy_config_accesslog_v3_OrFilter*)envoy_config_accesslog_v3_AccessLogFilter_or_filter(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_accesslog_v3_OrFilter*)_upb_msg_new(&envoy_config_accesslog_v3_OrFilter_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_accesslog_v3_AccessLogFilter_set_or_filter(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_accesslog_v3_AccessLogFilter_set_header_filter(envoy_config_accesslog_v3_AccessLogFilter *msg, envoy_config_accesslog_v3_HeaderFilter* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_accesslog_v3_HeaderFilter*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 8);
+}
+UPB_INLINE struct envoy_config_accesslog_v3_HeaderFilter* envoy_config_accesslog_v3_AccessLogFilter_mutable_header_filter(envoy_config_accesslog_v3_AccessLogFilter *msg, upb_arena *arena) {
+ struct envoy_config_accesslog_v3_HeaderFilter* sub = (struct envoy_config_accesslog_v3_HeaderFilter*)envoy_config_accesslog_v3_AccessLogFilter_header_filter(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_accesslog_v3_HeaderFilter*)_upb_msg_new(&envoy_config_accesslog_v3_HeaderFilter_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_accesslog_v3_AccessLogFilter_set_header_filter(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_accesslog_v3_AccessLogFilter_set_response_flag_filter(envoy_config_accesslog_v3_AccessLogFilter *msg, envoy_config_accesslog_v3_ResponseFlagFilter* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_accesslog_v3_ResponseFlagFilter*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 9);
+}
+UPB_INLINE struct envoy_config_accesslog_v3_ResponseFlagFilter* envoy_config_accesslog_v3_AccessLogFilter_mutable_response_flag_filter(envoy_config_accesslog_v3_AccessLogFilter *msg, upb_arena *arena) {
+ struct envoy_config_accesslog_v3_ResponseFlagFilter* sub = (struct envoy_config_accesslog_v3_ResponseFlagFilter*)envoy_config_accesslog_v3_AccessLogFilter_response_flag_filter(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_accesslog_v3_ResponseFlagFilter*)_upb_msg_new(&envoy_config_accesslog_v3_ResponseFlagFilter_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_accesslog_v3_AccessLogFilter_set_response_flag_filter(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_accesslog_v3_AccessLogFilter_set_grpc_status_filter(envoy_config_accesslog_v3_AccessLogFilter *msg, envoy_config_accesslog_v3_GrpcStatusFilter* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_accesslog_v3_GrpcStatusFilter*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 10);
+}
+UPB_INLINE struct envoy_config_accesslog_v3_GrpcStatusFilter* envoy_config_accesslog_v3_AccessLogFilter_mutable_grpc_status_filter(envoy_config_accesslog_v3_AccessLogFilter *msg, upb_arena *arena) {
+ struct envoy_config_accesslog_v3_GrpcStatusFilter* sub = (struct envoy_config_accesslog_v3_GrpcStatusFilter*)envoy_config_accesslog_v3_AccessLogFilter_grpc_status_filter(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_accesslog_v3_GrpcStatusFilter*)_upb_msg_new(&envoy_config_accesslog_v3_GrpcStatusFilter_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_accesslog_v3_AccessLogFilter_set_grpc_status_filter(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_accesslog_v3_AccessLogFilter_set_extension_filter(envoy_config_accesslog_v3_AccessLogFilter *msg, envoy_config_accesslog_v3_ExtensionFilter* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_accesslog_v3_ExtensionFilter*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 11);
+}
+UPB_INLINE struct envoy_config_accesslog_v3_ExtensionFilter* envoy_config_accesslog_v3_AccessLogFilter_mutable_extension_filter(envoy_config_accesslog_v3_AccessLogFilter *msg, upb_arena *arena) {
+ struct envoy_config_accesslog_v3_ExtensionFilter* sub = (struct envoy_config_accesslog_v3_ExtensionFilter*)envoy_config_accesslog_v3_AccessLogFilter_extension_filter(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_accesslog_v3_ExtensionFilter*)_upb_msg_new(&envoy_config_accesslog_v3_ExtensionFilter_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_accesslog_v3_AccessLogFilter_set_extension_filter(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_accesslog_v3_AccessLogFilter_set_metadata_filter(envoy_config_accesslog_v3_AccessLogFilter *msg, envoy_config_accesslog_v3_MetadataFilter* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_accesslog_v3_MetadataFilter*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 12);
+}
+UPB_INLINE struct envoy_config_accesslog_v3_MetadataFilter* envoy_config_accesslog_v3_AccessLogFilter_mutable_metadata_filter(envoy_config_accesslog_v3_AccessLogFilter *msg, upb_arena *arena) {
+ struct envoy_config_accesslog_v3_MetadataFilter* sub = (struct envoy_config_accesslog_v3_MetadataFilter*)envoy_config_accesslog_v3_AccessLogFilter_metadata_filter(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_accesslog_v3_MetadataFilter*)_upb_msg_new(&envoy_config_accesslog_v3_MetadataFilter_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_accesslog_v3_AccessLogFilter_set_metadata_filter(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.accesslog.v3.ComparisonFilter */
+
+UPB_INLINE envoy_config_accesslog_v3_ComparisonFilter *envoy_config_accesslog_v3_ComparisonFilter_new(upb_arena *arena) {
+ return (envoy_config_accesslog_v3_ComparisonFilter *)_upb_msg_new(&envoy_config_accesslog_v3_ComparisonFilter_msginit, arena);
+}
+UPB_INLINE envoy_config_accesslog_v3_ComparisonFilter *envoy_config_accesslog_v3_ComparisonFilter_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_accesslog_v3_ComparisonFilter *ret = envoy_config_accesslog_v3_ComparisonFilter_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_accesslog_v3_ComparisonFilter_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_accesslog_v3_ComparisonFilter_serialize(const envoy_config_accesslog_v3_ComparisonFilter *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_accesslog_v3_ComparisonFilter_msginit, arena, len);
+}
+
+UPB_INLINE int32_t envoy_config_accesslog_v3_ComparisonFilter_op(const envoy_config_accesslog_v3_ComparisonFilter *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
+UPB_INLINE bool envoy_config_accesslog_v3_ComparisonFilter_has_value(const envoy_config_accesslog_v3_ComparisonFilter *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 8)); }
+UPB_INLINE const struct envoy_config_core_v3_RuntimeUInt32* envoy_config_accesslog_v3_ComparisonFilter_value(const envoy_config_accesslog_v3_ComparisonFilter *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const struct envoy_config_core_v3_RuntimeUInt32*); }
+
+UPB_INLINE void envoy_config_accesslog_v3_ComparisonFilter_set_op(envoy_config_accesslog_v3_ComparisonFilter *msg, int32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
+}
+UPB_INLINE void envoy_config_accesslog_v3_ComparisonFilter_set_value(envoy_config_accesslog_v3_ComparisonFilter *msg, struct envoy_config_core_v3_RuntimeUInt32* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), struct envoy_config_core_v3_RuntimeUInt32*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_RuntimeUInt32* envoy_config_accesslog_v3_ComparisonFilter_mutable_value(envoy_config_accesslog_v3_ComparisonFilter *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_RuntimeUInt32* sub = (struct envoy_config_core_v3_RuntimeUInt32*)envoy_config_accesslog_v3_ComparisonFilter_value(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_RuntimeUInt32*)_upb_msg_new(&envoy_config_core_v3_RuntimeUInt32_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_accesslog_v3_ComparisonFilter_set_value(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.accesslog.v3.StatusCodeFilter */
+
+UPB_INLINE envoy_config_accesslog_v3_StatusCodeFilter *envoy_config_accesslog_v3_StatusCodeFilter_new(upb_arena *arena) {
+ return (envoy_config_accesslog_v3_StatusCodeFilter *)_upb_msg_new(&envoy_config_accesslog_v3_StatusCodeFilter_msginit, arena);
+}
+UPB_INLINE envoy_config_accesslog_v3_StatusCodeFilter *envoy_config_accesslog_v3_StatusCodeFilter_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_accesslog_v3_StatusCodeFilter *ret = envoy_config_accesslog_v3_StatusCodeFilter_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_accesslog_v3_StatusCodeFilter_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_accesslog_v3_StatusCodeFilter_serialize(const envoy_config_accesslog_v3_StatusCodeFilter *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_accesslog_v3_StatusCodeFilter_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_accesslog_v3_StatusCodeFilter_has_comparison(const envoy_config_accesslog_v3_StatusCodeFilter *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE const envoy_config_accesslog_v3_ComparisonFilter* envoy_config_accesslog_v3_StatusCodeFilter_comparison(const envoy_config_accesslog_v3_StatusCodeFilter *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const envoy_config_accesslog_v3_ComparisonFilter*); }
+
+UPB_INLINE void envoy_config_accesslog_v3_StatusCodeFilter_set_comparison(envoy_config_accesslog_v3_StatusCodeFilter *msg, envoy_config_accesslog_v3_ComparisonFilter* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), envoy_config_accesslog_v3_ComparisonFilter*) = value;
+}
+UPB_INLINE struct envoy_config_accesslog_v3_ComparisonFilter* envoy_config_accesslog_v3_StatusCodeFilter_mutable_comparison(envoy_config_accesslog_v3_StatusCodeFilter *msg, upb_arena *arena) {
+ struct envoy_config_accesslog_v3_ComparisonFilter* sub = (struct envoy_config_accesslog_v3_ComparisonFilter*)envoy_config_accesslog_v3_StatusCodeFilter_comparison(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_accesslog_v3_ComparisonFilter*)_upb_msg_new(&envoy_config_accesslog_v3_ComparisonFilter_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_accesslog_v3_StatusCodeFilter_set_comparison(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.accesslog.v3.DurationFilter */
+
+UPB_INLINE envoy_config_accesslog_v3_DurationFilter *envoy_config_accesslog_v3_DurationFilter_new(upb_arena *arena) {
+ return (envoy_config_accesslog_v3_DurationFilter *)_upb_msg_new(&envoy_config_accesslog_v3_DurationFilter_msginit, arena);
+}
+UPB_INLINE envoy_config_accesslog_v3_DurationFilter *envoy_config_accesslog_v3_DurationFilter_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_accesslog_v3_DurationFilter *ret = envoy_config_accesslog_v3_DurationFilter_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_accesslog_v3_DurationFilter_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_accesslog_v3_DurationFilter_serialize(const envoy_config_accesslog_v3_DurationFilter *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_accesslog_v3_DurationFilter_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_accesslog_v3_DurationFilter_has_comparison(const envoy_config_accesslog_v3_DurationFilter *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE const envoy_config_accesslog_v3_ComparisonFilter* envoy_config_accesslog_v3_DurationFilter_comparison(const envoy_config_accesslog_v3_DurationFilter *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const envoy_config_accesslog_v3_ComparisonFilter*); }
+
+UPB_INLINE void envoy_config_accesslog_v3_DurationFilter_set_comparison(envoy_config_accesslog_v3_DurationFilter *msg, envoy_config_accesslog_v3_ComparisonFilter* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), envoy_config_accesslog_v3_ComparisonFilter*) = value;
+}
+UPB_INLINE struct envoy_config_accesslog_v3_ComparisonFilter* envoy_config_accesslog_v3_DurationFilter_mutable_comparison(envoy_config_accesslog_v3_DurationFilter *msg, upb_arena *arena) {
+ struct envoy_config_accesslog_v3_ComparisonFilter* sub = (struct envoy_config_accesslog_v3_ComparisonFilter*)envoy_config_accesslog_v3_DurationFilter_comparison(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_accesslog_v3_ComparisonFilter*)_upb_msg_new(&envoy_config_accesslog_v3_ComparisonFilter_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_accesslog_v3_DurationFilter_set_comparison(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.accesslog.v3.NotHealthCheckFilter */
+
+UPB_INLINE envoy_config_accesslog_v3_NotHealthCheckFilter *envoy_config_accesslog_v3_NotHealthCheckFilter_new(upb_arena *arena) {
+ return (envoy_config_accesslog_v3_NotHealthCheckFilter *)_upb_msg_new(&envoy_config_accesslog_v3_NotHealthCheckFilter_msginit, arena);
+}
+UPB_INLINE envoy_config_accesslog_v3_NotHealthCheckFilter *envoy_config_accesslog_v3_NotHealthCheckFilter_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_accesslog_v3_NotHealthCheckFilter *ret = envoy_config_accesslog_v3_NotHealthCheckFilter_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_accesslog_v3_NotHealthCheckFilter_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_accesslog_v3_NotHealthCheckFilter_serialize(const envoy_config_accesslog_v3_NotHealthCheckFilter *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_accesslog_v3_NotHealthCheckFilter_msginit, arena, len);
+}
+
+
+
+/* envoy.config.accesslog.v3.TraceableFilter */
+
+UPB_INLINE envoy_config_accesslog_v3_TraceableFilter *envoy_config_accesslog_v3_TraceableFilter_new(upb_arena *arena) {
+ return (envoy_config_accesslog_v3_TraceableFilter *)_upb_msg_new(&envoy_config_accesslog_v3_TraceableFilter_msginit, arena);
+}
+UPB_INLINE envoy_config_accesslog_v3_TraceableFilter *envoy_config_accesslog_v3_TraceableFilter_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_accesslog_v3_TraceableFilter *ret = envoy_config_accesslog_v3_TraceableFilter_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_accesslog_v3_TraceableFilter_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_accesslog_v3_TraceableFilter_serialize(const envoy_config_accesslog_v3_TraceableFilter *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_accesslog_v3_TraceableFilter_msginit, arena, len);
+}
+
+
+
+/* envoy.config.accesslog.v3.RuntimeFilter */
+
+UPB_INLINE envoy_config_accesslog_v3_RuntimeFilter *envoy_config_accesslog_v3_RuntimeFilter_new(upb_arena *arena) {
+ return (envoy_config_accesslog_v3_RuntimeFilter *)_upb_msg_new(&envoy_config_accesslog_v3_RuntimeFilter_msginit, arena);
+}
+UPB_INLINE envoy_config_accesslog_v3_RuntimeFilter *envoy_config_accesslog_v3_RuntimeFilter_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_accesslog_v3_RuntimeFilter *ret = envoy_config_accesslog_v3_RuntimeFilter_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_accesslog_v3_RuntimeFilter_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_accesslog_v3_RuntimeFilter_serialize(const envoy_config_accesslog_v3_RuntimeFilter *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_accesslog_v3_RuntimeFilter_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview envoy_config_accesslog_v3_RuntimeFilter_runtime_key(const envoy_config_accesslog_v3_RuntimeFilter *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
+UPB_INLINE bool envoy_config_accesslog_v3_RuntimeFilter_has_percent_sampled(const envoy_config_accesslog_v3_RuntimeFilter *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
+UPB_INLINE const struct envoy_type_v3_FractionalPercent* envoy_config_accesslog_v3_RuntimeFilter_percent_sampled(const envoy_config_accesslog_v3_RuntimeFilter *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct envoy_type_v3_FractionalPercent*); }
+UPB_INLINE bool envoy_config_accesslog_v3_RuntimeFilter_use_independent_randomness(const envoy_config_accesslog_v3_RuntimeFilter *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); }
+
+UPB_INLINE void envoy_config_accesslog_v3_RuntimeFilter_set_runtime_key(envoy_config_accesslog_v3_RuntimeFilter *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_accesslog_v3_RuntimeFilter_set_percent_sampled(envoy_config_accesslog_v3_RuntimeFilter *msg, struct envoy_type_v3_FractionalPercent* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct envoy_type_v3_FractionalPercent*) = value;
+}
+UPB_INLINE struct envoy_type_v3_FractionalPercent* envoy_config_accesslog_v3_RuntimeFilter_mutable_percent_sampled(envoy_config_accesslog_v3_RuntimeFilter *msg, upb_arena *arena) {
+ struct envoy_type_v3_FractionalPercent* sub = (struct envoy_type_v3_FractionalPercent*)envoy_config_accesslog_v3_RuntimeFilter_percent_sampled(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_type_v3_FractionalPercent*)_upb_msg_new(&envoy_type_v3_FractionalPercent_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_accesslog_v3_RuntimeFilter_set_percent_sampled(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_accesslog_v3_RuntimeFilter_set_use_independent_randomness(envoy_config_accesslog_v3_RuntimeFilter *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
+}
+
+/* envoy.config.accesslog.v3.AndFilter */
+
+UPB_INLINE envoy_config_accesslog_v3_AndFilter *envoy_config_accesslog_v3_AndFilter_new(upb_arena *arena) {
+ return (envoy_config_accesslog_v3_AndFilter *)_upb_msg_new(&envoy_config_accesslog_v3_AndFilter_msginit, arena);
+}
+UPB_INLINE envoy_config_accesslog_v3_AndFilter *envoy_config_accesslog_v3_AndFilter_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_accesslog_v3_AndFilter *ret = envoy_config_accesslog_v3_AndFilter_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_accesslog_v3_AndFilter_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_accesslog_v3_AndFilter_serialize(const envoy_config_accesslog_v3_AndFilter *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_accesslog_v3_AndFilter_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_accesslog_v3_AndFilter_has_filters(const envoy_config_accesslog_v3_AndFilter *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE const envoy_config_accesslog_v3_AccessLogFilter* const* envoy_config_accesslog_v3_AndFilter_filters(const envoy_config_accesslog_v3_AndFilter *msg, size_t *len) { return (const envoy_config_accesslog_v3_AccessLogFilter* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
+
+UPB_INLINE envoy_config_accesslog_v3_AccessLogFilter** envoy_config_accesslog_v3_AndFilter_mutable_filters(envoy_config_accesslog_v3_AndFilter *msg, size_t *len) {
+ return (envoy_config_accesslog_v3_AccessLogFilter**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
+}
+UPB_INLINE envoy_config_accesslog_v3_AccessLogFilter** envoy_config_accesslog_v3_AndFilter_resize_filters(envoy_config_accesslog_v3_AndFilter *msg, size_t len, upb_arena *arena) {
+ return (envoy_config_accesslog_v3_AccessLogFilter**)_upb_array_resize_accessor(msg, UPB_SIZE(0, 0), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_config_accesslog_v3_AccessLogFilter* envoy_config_accesslog_v3_AndFilter_add_filters(envoy_config_accesslog_v3_AndFilter *msg, upb_arena *arena) {
+ struct envoy_config_accesslog_v3_AccessLogFilter* sub = (struct envoy_config_accesslog_v3_AccessLogFilter*)_upb_msg_new(&envoy_config_accesslog_v3_AccessLogFilter_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(0, 0), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+
+/* envoy.config.accesslog.v3.OrFilter */
+
+UPB_INLINE envoy_config_accesslog_v3_OrFilter *envoy_config_accesslog_v3_OrFilter_new(upb_arena *arena) {
+ return (envoy_config_accesslog_v3_OrFilter *)_upb_msg_new(&envoy_config_accesslog_v3_OrFilter_msginit, arena);
+}
+UPB_INLINE envoy_config_accesslog_v3_OrFilter *envoy_config_accesslog_v3_OrFilter_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_accesslog_v3_OrFilter *ret = envoy_config_accesslog_v3_OrFilter_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_accesslog_v3_OrFilter_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_accesslog_v3_OrFilter_serialize(const envoy_config_accesslog_v3_OrFilter *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_accesslog_v3_OrFilter_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_accesslog_v3_OrFilter_has_filters(const envoy_config_accesslog_v3_OrFilter *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE const envoy_config_accesslog_v3_AccessLogFilter* const* envoy_config_accesslog_v3_OrFilter_filters(const envoy_config_accesslog_v3_OrFilter *msg, size_t *len) { return (const envoy_config_accesslog_v3_AccessLogFilter* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
+
+UPB_INLINE envoy_config_accesslog_v3_AccessLogFilter** envoy_config_accesslog_v3_OrFilter_mutable_filters(envoy_config_accesslog_v3_OrFilter *msg, size_t *len) {
+ return (envoy_config_accesslog_v3_AccessLogFilter**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
+}
+UPB_INLINE envoy_config_accesslog_v3_AccessLogFilter** envoy_config_accesslog_v3_OrFilter_resize_filters(envoy_config_accesslog_v3_OrFilter *msg, size_t len, upb_arena *arena) {
+ return (envoy_config_accesslog_v3_AccessLogFilter**)_upb_array_resize_accessor(msg, UPB_SIZE(0, 0), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_config_accesslog_v3_AccessLogFilter* envoy_config_accesslog_v3_OrFilter_add_filters(envoy_config_accesslog_v3_OrFilter *msg, upb_arena *arena) {
+ struct envoy_config_accesslog_v3_AccessLogFilter* sub = (struct envoy_config_accesslog_v3_AccessLogFilter*)_upb_msg_new(&envoy_config_accesslog_v3_AccessLogFilter_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(0, 0), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+
+/* envoy.config.accesslog.v3.HeaderFilter */
+
+UPB_INLINE envoy_config_accesslog_v3_HeaderFilter *envoy_config_accesslog_v3_HeaderFilter_new(upb_arena *arena) {
+ return (envoy_config_accesslog_v3_HeaderFilter *)_upb_msg_new(&envoy_config_accesslog_v3_HeaderFilter_msginit, arena);
+}
+UPB_INLINE envoy_config_accesslog_v3_HeaderFilter *envoy_config_accesslog_v3_HeaderFilter_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_accesslog_v3_HeaderFilter *ret = envoy_config_accesslog_v3_HeaderFilter_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_accesslog_v3_HeaderFilter_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_accesslog_v3_HeaderFilter_serialize(const envoy_config_accesslog_v3_HeaderFilter *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_accesslog_v3_HeaderFilter_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_accesslog_v3_HeaderFilter_has_header(const envoy_config_accesslog_v3_HeaderFilter *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE const struct envoy_config_route_v3_HeaderMatcher* envoy_config_accesslog_v3_HeaderFilter_header(const envoy_config_accesslog_v3_HeaderFilter *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct envoy_config_route_v3_HeaderMatcher*); }
+
+UPB_INLINE void envoy_config_accesslog_v3_HeaderFilter_set_header(envoy_config_accesslog_v3_HeaderFilter *msg, struct envoy_config_route_v3_HeaderMatcher* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct envoy_config_route_v3_HeaderMatcher*) = value;
+}
+UPB_INLINE struct envoy_config_route_v3_HeaderMatcher* envoy_config_accesslog_v3_HeaderFilter_mutable_header(envoy_config_accesslog_v3_HeaderFilter *msg, upb_arena *arena) {
+ struct envoy_config_route_v3_HeaderMatcher* sub = (struct envoy_config_route_v3_HeaderMatcher*)envoy_config_accesslog_v3_HeaderFilter_header(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_route_v3_HeaderMatcher*)_upb_msg_new(&envoy_config_route_v3_HeaderMatcher_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_accesslog_v3_HeaderFilter_set_header(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.accesslog.v3.ResponseFlagFilter */
+
+UPB_INLINE envoy_config_accesslog_v3_ResponseFlagFilter *envoy_config_accesslog_v3_ResponseFlagFilter_new(upb_arena *arena) {
+ return (envoy_config_accesslog_v3_ResponseFlagFilter *)_upb_msg_new(&envoy_config_accesslog_v3_ResponseFlagFilter_msginit, arena);
+}
+UPB_INLINE envoy_config_accesslog_v3_ResponseFlagFilter *envoy_config_accesslog_v3_ResponseFlagFilter_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_accesslog_v3_ResponseFlagFilter *ret = envoy_config_accesslog_v3_ResponseFlagFilter_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_accesslog_v3_ResponseFlagFilter_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_accesslog_v3_ResponseFlagFilter_serialize(const envoy_config_accesslog_v3_ResponseFlagFilter *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_accesslog_v3_ResponseFlagFilter_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview const* envoy_config_accesslog_v3_ResponseFlagFilter_flags(const envoy_config_accesslog_v3_ResponseFlagFilter *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
+
+UPB_INLINE upb_strview* envoy_config_accesslog_v3_ResponseFlagFilter_mutable_flags(envoy_config_accesslog_v3_ResponseFlagFilter *msg, size_t *len) {
+ return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
+}
+UPB_INLINE upb_strview* envoy_config_accesslog_v3_ResponseFlagFilter_resize_flags(envoy_config_accesslog_v3_ResponseFlagFilter *msg, size_t len, upb_arena *arena) {
+ return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(0, 0), len, UPB_TYPE_STRING, arena);
+}
+UPB_INLINE bool envoy_config_accesslog_v3_ResponseFlagFilter_add_flags(envoy_config_accesslog_v3_ResponseFlagFilter *msg, upb_strview val, upb_arena *arena) {
+ return _upb_array_append_accessor(msg, UPB_SIZE(0, 0), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
+ arena);
+}
+
+/* envoy.config.accesslog.v3.GrpcStatusFilter */
+
+UPB_INLINE envoy_config_accesslog_v3_GrpcStatusFilter *envoy_config_accesslog_v3_GrpcStatusFilter_new(upb_arena *arena) {
+ return (envoy_config_accesslog_v3_GrpcStatusFilter *)_upb_msg_new(&envoy_config_accesslog_v3_GrpcStatusFilter_msginit, arena);
+}
+UPB_INLINE envoy_config_accesslog_v3_GrpcStatusFilter *envoy_config_accesslog_v3_GrpcStatusFilter_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_accesslog_v3_GrpcStatusFilter *ret = envoy_config_accesslog_v3_GrpcStatusFilter_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_accesslog_v3_GrpcStatusFilter_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_accesslog_v3_GrpcStatusFilter_serialize(const envoy_config_accesslog_v3_GrpcStatusFilter *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_accesslog_v3_GrpcStatusFilter_msginit, arena, len);
+}
+
+UPB_INLINE int32_t const* envoy_config_accesslog_v3_GrpcStatusFilter_statuses(const envoy_config_accesslog_v3_GrpcStatusFilter *msg, size_t *len) { return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len); }
+UPB_INLINE bool envoy_config_accesslog_v3_GrpcStatusFilter_exclude(const envoy_config_accesslog_v3_GrpcStatusFilter *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); }
+
+UPB_INLINE int32_t* envoy_config_accesslog_v3_GrpcStatusFilter_mutable_statuses(envoy_config_accesslog_v3_GrpcStatusFilter *msg, size_t *len) {
+ return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len);
+}
+UPB_INLINE int32_t* envoy_config_accesslog_v3_GrpcStatusFilter_resize_statuses(envoy_config_accesslog_v3_GrpcStatusFilter *msg, size_t len, upb_arena *arena) {
+ return (int32_t*)_upb_array_resize_accessor(msg, UPB_SIZE(4, 8), len, UPB_TYPE_ENUM, arena);
+}
+UPB_INLINE bool envoy_config_accesslog_v3_GrpcStatusFilter_add_statuses(envoy_config_accesslog_v3_GrpcStatusFilter *msg, int32_t val, upb_arena *arena) {
+ return _upb_array_append_accessor(msg, UPB_SIZE(4, 8), UPB_SIZE(8, 8), UPB_TYPE_ENUM, &val,
+ arena);
+}
+UPB_INLINE void envoy_config_accesslog_v3_GrpcStatusFilter_set_exclude(envoy_config_accesslog_v3_GrpcStatusFilter *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
+}
+
+/* envoy.config.accesslog.v3.MetadataFilter */
+
+UPB_INLINE envoy_config_accesslog_v3_MetadataFilter *envoy_config_accesslog_v3_MetadataFilter_new(upb_arena *arena) {
+ return (envoy_config_accesslog_v3_MetadataFilter *)_upb_msg_new(&envoy_config_accesslog_v3_MetadataFilter_msginit, arena);
+}
+UPB_INLINE envoy_config_accesslog_v3_MetadataFilter *envoy_config_accesslog_v3_MetadataFilter_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_accesslog_v3_MetadataFilter *ret = envoy_config_accesslog_v3_MetadataFilter_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_accesslog_v3_MetadataFilter_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_accesslog_v3_MetadataFilter_serialize(const envoy_config_accesslog_v3_MetadataFilter *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_accesslog_v3_MetadataFilter_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_accesslog_v3_MetadataFilter_has_matcher(const envoy_config_accesslog_v3_MetadataFilter *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE const struct envoy_type_matcher_v3_MetadataMatcher* envoy_config_accesslog_v3_MetadataFilter_matcher(const envoy_config_accesslog_v3_MetadataFilter *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct envoy_type_matcher_v3_MetadataMatcher*); }
+UPB_INLINE bool envoy_config_accesslog_v3_MetadataFilter_has_match_if_key_not_found(const envoy_config_accesslog_v3_MetadataFilter *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
+UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_accesslog_v3_MetadataFilter_match_if_key_not_found(const envoy_config_accesslog_v3_MetadataFilter *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_BoolValue*); }
+
+UPB_INLINE void envoy_config_accesslog_v3_MetadataFilter_set_matcher(envoy_config_accesslog_v3_MetadataFilter *msg, struct envoy_type_matcher_v3_MetadataMatcher* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct envoy_type_matcher_v3_MetadataMatcher*) = value;
+}
+UPB_INLINE struct envoy_type_matcher_v3_MetadataMatcher* envoy_config_accesslog_v3_MetadataFilter_mutable_matcher(envoy_config_accesslog_v3_MetadataFilter *msg, upb_arena *arena) {
+ struct envoy_type_matcher_v3_MetadataMatcher* sub = (struct envoy_type_matcher_v3_MetadataMatcher*)envoy_config_accesslog_v3_MetadataFilter_matcher(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_type_matcher_v3_MetadataMatcher*)_upb_msg_new(&envoy_type_matcher_v3_MetadataMatcher_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_accesslog_v3_MetadataFilter_set_matcher(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_accesslog_v3_MetadataFilter_set_match_if_key_not_found(envoy_config_accesslog_v3_MetadataFilter *msg, struct google_protobuf_BoolValue* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_BoolValue*) = value;
+}
+UPB_INLINE struct google_protobuf_BoolValue* envoy_config_accesslog_v3_MetadataFilter_mutable_match_if_key_not_found(envoy_config_accesslog_v3_MetadataFilter *msg, upb_arena *arena) {
+ struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_accesslog_v3_MetadataFilter_match_if_key_not_found(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_BoolValue*)_upb_msg_new(&google_protobuf_BoolValue_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_accesslog_v3_MetadataFilter_set_match_if_key_not_found(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.accesslog.v3.ExtensionFilter */
+
+UPB_INLINE envoy_config_accesslog_v3_ExtensionFilter *envoy_config_accesslog_v3_ExtensionFilter_new(upb_arena *arena) {
+ return (envoy_config_accesslog_v3_ExtensionFilter *)_upb_msg_new(&envoy_config_accesslog_v3_ExtensionFilter_msginit, arena);
+}
+UPB_INLINE envoy_config_accesslog_v3_ExtensionFilter *envoy_config_accesslog_v3_ExtensionFilter_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_accesslog_v3_ExtensionFilter *ret = envoy_config_accesslog_v3_ExtensionFilter_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_accesslog_v3_ExtensionFilter_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_accesslog_v3_ExtensionFilter_serialize(const envoy_config_accesslog_v3_ExtensionFilter *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_accesslog_v3_ExtensionFilter_msginit, arena, len);
+}
+
+typedef enum {
+ envoy_config_accesslog_v3_ExtensionFilter_config_type_typed_config = 3,
+ envoy_config_accesslog_v3_ExtensionFilter_config_type_NOT_SET = 0
+} envoy_config_accesslog_v3_ExtensionFilter_config_type_oneofcases;
+UPB_INLINE envoy_config_accesslog_v3_ExtensionFilter_config_type_oneofcases envoy_config_accesslog_v3_ExtensionFilter_config_type_case(const envoy_config_accesslog_v3_ExtensionFilter* msg) { return (envoy_config_accesslog_v3_ExtensionFilter_config_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(12, 24), int32_t); }
+
+UPB_INLINE upb_strview envoy_config_accesslog_v3_ExtensionFilter_name(const envoy_config_accesslog_v3_ExtensionFilter *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE bool envoy_config_accesslog_v3_ExtensionFilter_has_typed_config(const envoy_config_accesslog_v3_ExtensionFilter *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 3; }
+UPB_INLINE const struct google_protobuf_Any* envoy_config_accesslog_v3_ExtensionFilter_typed_config(const envoy_config_accesslog_v3_ExtensionFilter *msg) { return UPB_READ_ONEOF(msg, const struct google_protobuf_Any*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 3, NULL); }
+
+UPB_INLINE void envoy_config_accesslog_v3_ExtensionFilter_set_name(envoy_config_accesslog_v3_ExtensionFilter *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_accesslog_v3_ExtensionFilter_set_typed_config(envoy_config_accesslog_v3_ExtensionFilter *msg, struct google_protobuf_Any* value) {
+ UPB_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 3);
+}
+UPB_INLINE struct google_protobuf_Any* envoy_config_accesslog_v3_ExtensionFilter_mutable_typed_config(envoy_config_accesslog_v3_ExtensionFilter *msg, upb_arena *arena) {
+ struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_config_accesslog_v3_ExtensionFilter_typed_config(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_accesslog_v3_ExtensionFilter_set_typed_config(msg, sub);
+ }
+ return sub;
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_CONFIG_ACCESSLOG_V3_ACCESSLOG_PROTO_UPB_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.c
index bf92a546f19..26304e42b9d 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.c
@@ -1,74 +1,74 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/config/cluster/v3/circuit_breaker.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include <stddef.h>
-#include "upb/msg.h"
-#include "envoy/config/cluster/v3/circuit_breaker.upb.h"
-#include "envoy/config/core/v3/base.upb.h"
-#include "envoy/type/v3/percent.upb.h"
-#include "google/protobuf/wrappers.upb.h"
-#include "udpa/annotations/status.upb.h"
-#include "udpa/annotations/versioning.upb.h"
-#include "validate/validate.upb.h"
-
-#include "upb/port_def.inc"
-
-static const upb_msglayout *const envoy_config_cluster_v3_CircuitBreakers_submsgs[1] = {
- &envoy_config_cluster_v3_CircuitBreakers_Thresholds_msginit,
-};
-
-static const upb_msglayout_field envoy_config_cluster_v3_CircuitBreakers__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 3},
-};
-
-const upb_msglayout envoy_config_cluster_v3_CircuitBreakers_msginit = {
- &envoy_config_cluster_v3_CircuitBreakers_submsgs[0],
- &envoy_config_cluster_v3_CircuitBreakers__fields[0],
- UPB_SIZE(4, 8), 1, false,
-};
-
-static const upb_msglayout *const envoy_config_cluster_v3_CircuitBreakers_Thresholds_submsgs[6] = {
- &envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_msginit,
- &google_protobuf_UInt32Value_msginit,
-};
-
-static const upb_msglayout_field envoy_config_cluster_v3_CircuitBreakers_Thresholds__fields[8] = {
- {1, UPB_SIZE(0, 0), 0, 0, 14, 1},
- {2, UPB_SIZE(12, 16), 0, 1, 11, 1},
- {3, UPB_SIZE(16, 24), 0, 1, 11, 1},
- {4, UPB_SIZE(20, 32), 0, 1, 11, 1},
- {5, UPB_SIZE(24, 40), 0, 1, 11, 1},
- {6, UPB_SIZE(8, 8), 0, 0, 8, 1},
- {7, UPB_SIZE(28, 48), 0, 1, 11, 1},
- {8, UPB_SIZE(32, 56), 0, 0, 11, 1},
-};
-
-const upb_msglayout envoy_config_cluster_v3_CircuitBreakers_Thresholds_msginit = {
- &envoy_config_cluster_v3_CircuitBreakers_Thresholds_submsgs[0],
- &envoy_config_cluster_v3_CircuitBreakers_Thresholds__fields[0],
- UPB_SIZE(40, 64), 8, false,
-};
-
-static const upb_msglayout *const envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_submsgs[2] = {
- &envoy_type_v3_Percent_msginit,
- &google_protobuf_UInt32Value_msginit,
-};
-
-static const upb_msglayout_field envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
- {2, UPB_SIZE(4, 8), 0, 1, 11, 1},
-};
-
-const upb_msglayout envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_msginit = {
- &envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_submsgs[0],
- &envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget__fields[0],
- UPB_SIZE(8, 16), 2, false,
-};
-
-#include "upb/port_undef.inc"
-
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/cluster/v3/circuit_breaker.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg.h"
+#include "envoy/config/cluster/v3/circuit_breaker.upb.h"
+#include "envoy/config/core/v3/base.upb.h"
+#include "envoy/type/v3/percent.upb.h"
+#include "google/protobuf/wrappers.upb.h"
+#include "udpa/annotations/status.upb.h"
+#include "udpa/annotations/versioning.upb.h"
+#include "validate/validate.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_msglayout *const envoy_config_cluster_v3_CircuitBreakers_submsgs[1] = {
+ &envoy_config_cluster_v3_CircuitBreakers_Thresholds_msginit,
+};
+
+static const upb_msglayout_field envoy_config_cluster_v3_CircuitBreakers__fields[1] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 11, 3},
+};
+
+const upb_msglayout envoy_config_cluster_v3_CircuitBreakers_msginit = {
+ &envoy_config_cluster_v3_CircuitBreakers_submsgs[0],
+ &envoy_config_cluster_v3_CircuitBreakers__fields[0],
+ UPB_SIZE(4, 8), 1, false,
+};
+
+static const upb_msglayout *const envoy_config_cluster_v3_CircuitBreakers_Thresholds_submsgs[6] = {
+ &envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_msginit,
+ &google_protobuf_UInt32Value_msginit,
+};
+
+static const upb_msglayout_field envoy_config_cluster_v3_CircuitBreakers_Thresholds__fields[8] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 14, 1},
+ {2, UPB_SIZE(12, 16), 0, 1, 11, 1},
+ {3, UPB_SIZE(16, 24), 0, 1, 11, 1},
+ {4, UPB_SIZE(20, 32), 0, 1, 11, 1},
+ {5, UPB_SIZE(24, 40), 0, 1, 11, 1},
+ {6, UPB_SIZE(8, 8), 0, 0, 8, 1},
+ {7, UPB_SIZE(28, 48), 0, 1, 11, 1},
+ {8, UPB_SIZE(32, 56), 0, 0, 11, 1},
+};
+
+const upb_msglayout envoy_config_cluster_v3_CircuitBreakers_Thresholds_msginit = {
+ &envoy_config_cluster_v3_CircuitBreakers_Thresholds_submsgs[0],
+ &envoy_config_cluster_v3_CircuitBreakers_Thresholds__fields[0],
+ UPB_SIZE(40, 64), 8, false,
+};
+
+static const upb_msglayout *const envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_submsgs[2] = {
+ &envoy_type_v3_Percent_msginit,
+ &google_protobuf_UInt32Value_msginit,
+};
+
+static const upb_msglayout_field envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
+ {2, UPB_SIZE(4, 8), 0, 1, 11, 1},
+};
+
+const upb_msglayout envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_msginit = {
+ &envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_submsgs[0],
+ &envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget__fields[0],
+ UPB_SIZE(8, 16), 2, false,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.h
index 2a86458f07b..c2da177f210 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.h
@@ -1,226 +1,226 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/config/cluster/v3/circuit_breaker.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef ENVOY_CONFIG_CLUSTER_V3_CIRCUIT_BREAKER_PROTO_UPB_H_
-#define ENVOY_CONFIG_CLUSTER_V3_CIRCUIT_BREAKER_PROTO_UPB_H_
-
-#include "upb/msg.h"
-#include "upb/decode.h"
-#include "upb/encode.h"
-
-#include "upb/port_def.inc"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct envoy_config_cluster_v3_CircuitBreakers;
-struct envoy_config_cluster_v3_CircuitBreakers_Thresholds;
-struct envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget;
-typedef struct envoy_config_cluster_v3_CircuitBreakers envoy_config_cluster_v3_CircuitBreakers;
-typedef struct envoy_config_cluster_v3_CircuitBreakers_Thresholds envoy_config_cluster_v3_CircuitBreakers_Thresholds;
-typedef struct envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget;
-extern const upb_msglayout envoy_config_cluster_v3_CircuitBreakers_msginit;
-extern const upb_msglayout envoy_config_cluster_v3_CircuitBreakers_Thresholds_msginit;
-extern const upb_msglayout envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_msginit;
-struct envoy_type_v3_Percent;
-struct google_protobuf_UInt32Value;
-extern const upb_msglayout envoy_type_v3_Percent_msginit;
-extern const upb_msglayout google_protobuf_UInt32Value_msginit;
-
-
-/* envoy.config.cluster.v3.CircuitBreakers */
-
-UPB_INLINE envoy_config_cluster_v3_CircuitBreakers *envoy_config_cluster_v3_CircuitBreakers_new(upb_arena *arena) {
- return (envoy_config_cluster_v3_CircuitBreakers *)_upb_msg_new(&envoy_config_cluster_v3_CircuitBreakers_msginit, arena);
-}
-UPB_INLINE envoy_config_cluster_v3_CircuitBreakers *envoy_config_cluster_v3_CircuitBreakers_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_cluster_v3_CircuitBreakers *ret = envoy_config_cluster_v3_CircuitBreakers_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_cluster_v3_CircuitBreakers_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_cluster_v3_CircuitBreakers_serialize(const envoy_config_cluster_v3_CircuitBreakers *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_cluster_v3_CircuitBreakers_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_config_cluster_v3_CircuitBreakers_has_thresholds(const envoy_config_cluster_v3_CircuitBreakers *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE const envoy_config_cluster_v3_CircuitBreakers_Thresholds* const* envoy_config_cluster_v3_CircuitBreakers_thresholds(const envoy_config_cluster_v3_CircuitBreakers *msg, size_t *len) { return (const envoy_config_cluster_v3_CircuitBreakers_Thresholds* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
-
-UPB_INLINE envoy_config_cluster_v3_CircuitBreakers_Thresholds** envoy_config_cluster_v3_CircuitBreakers_mutable_thresholds(envoy_config_cluster_v3_CircuitBreakers *msg, size_t *len) {
- return (envoy_config_cluster_v3_CircuitBreakers_Thresholds**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
-}
-UPB_INLINE envoy_config_cluster_v3_CircuitBreakers_Thresholds** envoy_config_cluster_v3_CircuitBreakers_resize_thresholds(envoy_config_cluster_v3_CircuitBreakers *msg, size_t len, upb_arena *arena) {
- return (envoy_config_cluster_v3_CircuitBreakers_Thresholds**)_upb_array_resize_accessor(msg, UPB_SIZE(0, 0), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_config_cluster_v3_CircuitBreakers_Thresholds* envoy_config_cluster_v3_CircuitBreakers_add_thresholds(envoy_config_cluster_v3_CircuitBreakers *msg, upb_arena *arena) {
- struct envoy_config_cluster_v3_CircuitBreakers_Thresholds* sub = (struct envoy_config_cluster_v3_CircuitBreakers_Thresholds*)_upb_msg_new(&envoy_config_cluster_v3_CircuitBreakers_Thresholds_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(0, 0), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-
-/* envoy.config.cluster.v3.CircuitBreakers.Thresholds */
-
-UPB_INLINE envoy_config_cluster_v3_CircuitBreakers_Thresholds *envoy_config_cluster_v3_CircuitBreakers_Thresholds_new(upb_arena *arena) {
- return (envoy_config_cluster_v3_CircuitBreakers_Thresholds *)_upb_msg_new(&envoy_config_cluster_v3_CircuitBreakers_Thresholds_msginit, arena);
-}
-UPB_INLINE envoy_config_cluster_v3_CircuitBreakers_Thresholds *envoy_config_cluster_v3_CircuitBreakers_Thresholds_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_cluster_v3_CircuitBreakers_Thresholds *ret = envoy_config_cluster_v3_CircuitBreakers_Thresholds_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_cluster_v3_CircuitBreakers_Thresholds_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_cluster_v3_CircuitBreakers_Thresholds_serialize(const envoy_config_cluster_v3_CircuitBreakers_Thresholds *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_cluster_v3_CircuitBreakers_Thresholds_msginit, arena, len);
-}
-
-UPB_INLINE int32_t envoy_config_cluster_v3_CircuitBreakers_Thresholds_priority(const envoy_config_cluster_v3_CircuitBreakers_Thresholds *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
-UPB_INLINE bool envoy_config_cluster_v3_CircuitBreakers_Thresholds_has_max_connections(const envoy_config_cluster_v3_CircuitBreakers_Thresholds *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 16)); }
-UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_CircuitBreakers_Thresholds_max_connections(const envoy_config_cluster_v3_CircuitBreakers_Thresholds *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const struct google_protobuf_UInt32Value*); }
-UPB_INLINE bool envoy_config_cluster_v3_CircuitBreakers_Thresholds_has_max_pending_requests(const envoy_config_cluster_v3_CircuitBreakers_Thresholds *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 24)); }
-UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_CircuitBreakers_Thresholds_max_pending_requests(const envoy_config_cluster_v3_CircuitBreakers_Thresholds *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const struct google_protobuf_UInt32Value*); }
-UPB_INLINE bool envoy_config_cluster_v3_CircuitBreakers_Thresholds_has_max_requests(const envoy_config_cluster_v3_CircuitBreakers_Thresholds *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 32)); }
-UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_CircuitBreakers_Thresholds_max_requests(const envoy_config_cluster_v3_CircuitBreakers_Thresholds *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const struct google_protobuf_UInt32Value*); }
-UPB_INLINE bool envoy_config_cluster_v3_CircuitBreakers_Thresholds_has_max_retries(const envoy_config_cluster_v3_CircuitBreakers_Thresholds *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 40)); }
-UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_CircuitBreakers_Thresholds_max_retries(const envoy_config_cluster_v3_CircuitBreakers_Thresholds *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const struct google_protobuf_UInt32Value*); }
-UPB_INLINE bool envoy_config_cluster_v3_CircuitBreakers_Thresholds_track_remaining(const envoy_config_cluster_v3_CircuitBreakers_Thresholds *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool); }
-UPB_INLINE bool envoy_config_cluster_v3_CircuitBreakers_Thresholds_has_max_connection_pools(const envoy_config_cluster_v3_CircuitBreakers_Thresholds *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 48)); }
-UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_CircuitBreakers_Thresholds_max_connection_pools(const envoy_config_cluster_v3_CircuitBreakers_Thresholds *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 48), const struct google_protobuf_UInt32Value*); }
-UPB_INLINE bool envoy_config_cluster_v3_CircuitBreakers_Thresholds_has_retry_budget(const envoy_config_cluster_v3_CircuitBreakers_Thresholds *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(32, 56)); }
-UPB_INLINE const envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget* envoy_config_cluster_v3_CircuitBreakers_Thresholds_retry_budget(const envoy_config_cluster_v3_CircuitBreakers_Thresholds *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 56), const envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget*); }
-
-UPB_INLINE void envoy_config_cluster_v3_CircuitBreakers_Thresholds_set_priority(envoy_config_cluster_v3_CircuitBreakers_Thresholds *msg, int32_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
-}
-UPB_INLINE void envoy_config_cluster_v3_CircuitBreakers_Thresholds_set_max_connections(envoy_config_cluster_v3_CircuitBreakers_Thresholds *msg, struct google_protobuf_UInt32Value* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(12, 16), struct google_protobuf_UInt32Value*) = value;
-}
-UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_CircuitBreakers_Thresholds_mutable_max_connections(envoy_config_cluster_v3_CircuitBreakers_Thresholds *msg, upb_arena *arena) {
- struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_cluster_v3_CircuitBreakers_Thresholds_max_connections(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_CircuitBreakers_Thresholds_set_max_connections(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_cluster_v3_CircuitBreakers_Thresholds_set_max_pending_requests(envoy_config_cluster_v3_CircuitBreakers_Thresholds *msg, struct google_protobuf_UInt32Value* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(16, 24), struct google_protobuf_UInt32Value*) = value;
-}
-UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_CircuitBreakers_Thresholds_mutable_max_pending_requests(envoy_config_cluster_v3_CircuitBreakers_Thresholds *msg, upb_arena *arena) {
- struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_cluster_v3_CircuitBreakers_Thresholds_max_pending_requests(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_CircuitBreakers_Thresholds_set_max_pending_requests(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_cluster_v3_CircuitBreakers_Thresholds_set_max_requests(envoy_config_cluster_v3_CircuitBreakers_Thresholds *msg, struct google_protobuf_UInt32Value* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(20, 32), struct google_protobuf_UInt32Value*) = value;
-}
-UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_CircuitBreakers_Thresholds_mutable_max_requests(envoy_config_cluster_v3_CircuitBreakers_Thresholds *msg, upb_arena *arena) {
- struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_cluster_v3_CircuitBreakers_Thresholds_max_requests(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_CircuitBreakers_Thresholds_set_max_requests(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_cluster_v3_CircuitBreakers_Thresholds_set_max_retries(envoy_config_cluster_v3_CircuitBreakers_Thresholds *msg, struct google_protobuf_UInt32Value* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(24, 40), struct google_protobuf_UInt32Value*) = value;
-}
-UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_CircuitBreakers_Thresholds_mutable_max_retries(envoy_config_cluster_v3_CircuitBreakers_Thresholds *msg, upb_arena *arena) {
- struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_cluster_v3_CircuitBreakers_Thresholds_max_retries(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_CircuitBreakers_Thresholds_set_max_retries(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_cluster_v3_CircuitBreakers_Thresholds_set_track_remaining(envoy_config_cluster_v3_CircuitBreakers_Thresholds *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = value;
-}
-UPB_INLINE void envoy_config_cluster_v3_CircuitBreakers_Thresholds_set_max_connection_pools(envoy_config_cluster_v3_CircuitBreakers_Thresholds *msg, struct google_protobuf_UInt32Value* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(28, 48), struct google_protobuf_UInt32Value*) = value;
-}
-UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_CircuitBreakers_Thresholds_mutable_max_connection_pools(envoy_config_cluster_v3_CircuitBreakers_Thresholds *msg, upb_arena *arena) {
- struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_cluster_v3_CircuitBreakers_Thresholds_max_connection_pools(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_CircuitBreakers_Thresholds_set_max_connection_pools(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_cluster_v3_CircuitBreakers_Thresholds_set_retry_budget(envoy_config_cluster_v3_CircuitBreakers_Thresholds *msg, envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(32, 56), envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget*) = value;
-}
-UPB_INLINE struct envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget* envoy_config_cluster_v3_CircuitBreakers_Thresholds_mutable_retry_budget(envoy_config_cluster_v3_CircuitBreakers_Thresholds *msg, upb_arena *arena) {
- struct envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget* sub = (struct envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget*)envoy_config_cluster_v3_CircuitBreakers_Thresholds_retry_budget(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget*)_upb_msg_new(&envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_CircuitBreakers_Thresholds_set_retry_budget(msg, sub);
- }
- return sub;
-}
-
-/* envoy.config.cluster.v3.CircuitBreakers.Thresholds.RetryBudget */
-
-UPB_INLINE envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget *envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_new(upb_arena *arena) {
- return (envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget *)_upb_msg_new(&envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_msginit, arena);
-}
-UPB_INLINE envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget *envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget *ret = envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_serialize(const envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_has_budget_percent(const envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE const struct envoy_type_v3_Percent* envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_budget_percent(const envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct envoy_type_v3_Percent*); }
-UPB_INLINE bool envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_has_min_retry_concurrency(const envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
-UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_min_retry_concurrency(const envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_UInt32Value*); }
-
-UPB_INLINE void envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_set_budget_percent(envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget *msg, struct envoy_type_v3_Percent* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct envoy_type_v3_Percent*) = value;
-}
-UPB_INLINE struct envoy_type_v3_Percent* envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_mutable_budget_percent(envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget *msg, upb_arena *arena) {
- struct envoy_type_v3_Percent* sub = (struct envoy_type_v3_Percent*)envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_budget_percent(msg);
- if (sub == NULL) {
- sub = (struct envoy_type_v3_Percent*)_upb_msg_new(&envoy_type_v3_Percent_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_set_budget_percent(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_set_min_retry_concurrency(envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget *msg, struct google_protobuf_UInt32Value* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_UInt32Value*) = value;
-}
-UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_mutable_min_retry_concurrency(envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget *msg, upb_arena *arena) {
- struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_min_retry_concurrency(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_set_min_retry_concurrency(msg, sub);
- }
- return sub;
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* ENVOY_CONFIG_CLUSTER_V3_CIRCUIT_BREAKER_PROTO_UPB_H_ */
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/cluster/v3/circuit_breaker.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_CONFIG_CLUSTER_V3_CIRCUIT_BREAKER_PROTO_UPB_H_
+#define ENVOY_CONFIG_CLUSTER_V3_CIRCUIT_BREAKER_PROTO_UPB_H_
+
+#include "upb/msg.h"
+#include "upb/decode.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_config_cluster_v3_CircuitBreakers;
+struct envoy_config_cluster_v3_CircuitBreakers_Thresholds;
+struct envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget;
+typedef struct envoy_config_cluster_v3_CircuitBreakers envoy_config_cluster_v3_CircuitBreakers;
+typedef struct envoy_config_cluster_v3_CircuitBreakers_Thresholds envoy_config_cluster_v3_CircuitBreakers_Thresholds;
+typedef struct envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget;
+extern const upb_msglayout envoy_config_cluster_v3_CircuitBreakers_msginit;
+extern const upb_msglayout envoy_config_cluster_v3_CircuitBreakers_Thresholds_msginit;
+extern const upb_msglayout envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_msginit;
+struct envoy_type_v3_Percent;
+struct google_protobuf_UInt32Value;
+extern const upb_msglayout envoy_type_v3_Percent_msginit;
+extern const upb_msglayout google_protobuf_UInt32Value_msginit;
+
+
+/* envoy.config.cluster.v3.CircuitBreakers */
+
+UPB_INLINE envoy_config_cluster_v3_CircuitBreakers *envoy_config_cluster_v3_CircuitBreakers_new(upb_arena *arena) {
+ return (envoy_config_cluster_v3_CircuitBreakers *)_upb_msg_new(&envoy_config_cluster_v3_CircuitBreakers_msginit, arena);
+}
+UPB_INLINE envoy_config_cluster_v3_CircuitBreakers *envoy_config_cluster_v3_CircuitBreakers_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_cluster_v3_CircuitBreakers *ret = envoy_config_cluster_v3_CircuitBreakers_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_cluster_v3_CircuitBreakers_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_cluster_v3_CircuitBreakers_serialize(const envoy_config_cluster_v3_CircuitBreakers *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_cluster_v3_CircuitBreakers_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_cluster_v3_CircuitBreakers_has_thresholds(const envoy_config_cluster_v3_CircuitBreakers *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE const envoy_config_cluster_v3_CircuitBreakers_Thresholds* const* envoy_config_cluster_v3_CircuitBreakers_thresholds(const envoy_config_cluster_v3_CircuitBreakers *msg, size_t *len) { return (const envoy_config_cluster_v3_CircuitBreakers_Thresholds* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
+
+UPB_INLINE envoy_config_cluster_v3_CircuitBreakers_Thresholds** envoy_config_cluster_v3_CircuitBreakers_mutable_thresholds(envoy_config_cluster_v3_CircuitBreakers *msg, size_t *len) {
+ return (envoy_config_cluster_v3_CircuitBreakers_Thresholds**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
+}
+UPB_INLINE envoy_config_cluster_v3_CircuitBreakers_Thresholds** envoy_config_cluster_v3_CircuitBreakers_resize_thresholds(envoy_config_cluster_v3_CircuitBreakers *msg, size_t len, upb_arena *arena) {
+ return (envoy_config_cluster_v3_CircuitBreakers_Thresholds**)_upb_array_resize_accessor(msg, UPB_SIZE(0, 0), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_config_cluster_v3_CircuitBreakers_Thresholds* envoy_config_cluster_v3_CircuitBreakers_add_thresholds(envoy_config_cluster_v3_CircuitBreakers *msg, upb_arena *arena) {
+ struct envoy_config_cluster_v3_CircuitBreakers_Thresholds* sub = (struct envoy_config_cluster_v3_CircuitBreakers_Thresholds*)_upb_msg_new(&envoy_config_cluster_v3_CircuitBreakers_Thresholds_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(0, 0), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+
+/* envoy.config.cluster.v3.CircuitBreakers.Thresholds */
+
+UPB_INLINE envoy_config_cluster_v3_CircuitBreakers_Thresholds *envoy_config_cluster_v3_CircuitBreakers_Thresholds_new(upb_arena *arena) {
+ return (envoy_config_cluster_v3_CircuitBreakers_Thresholds *)_upb_msg_new(&envoy_config_cluster_v3_CircuitBreakers_Thresholds_msginit, arena);
+}
+UPB_INLINE envoy_config_cluster_v3_CircuitBreakers_Thresholds *envoy_config_cluster_v3_CircuitBreakers_Thresholds_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_cluster_v3_CircuitBreakers_Thresholds *ret = envoy_config_cluster_v3_CircuitBreakers_Thresholds_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_cluster_v3_CircuitBreakers_Thresholds_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_cluster_v3_CircuitBreakers_Thresholds_serialize(const envoy_config_cluster_v3_CircuitBreakers_Thresholds *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_cluster_v3_CircuitBreakers_Thresholds_msginit, arena, len);
+}
+
+UPB_INLINE int32_t envoy_config_cluster_v3_CircuitBreakers_Thresholds_priority(const envoy_config_cluster_v3_CircuitBreakers_Thresholds *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
+UPB_INLINE bool envoy_config_cluster_v3_CircuitBreakers_Thresholds_has_max_connections(const envoy_config_cluster_v3_CircuitBreakers_Thresholds *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 16)); }
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_CircuitBreakers_Thresholds_max_connections(const envoy_config_cluster_v3_CircuitBreakers_Thresholds *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const struct google_protobuf_UInt32Value*); }
+UPB_INLINE bool envoy_config_cluster_v3_CircuitBreakers_Thresholds_has_max_pending_requests(const envoy_config_cluster_v3_CircuitBreakers_Thresholds *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 24)); }
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_CircuitBreakers_Thresholds_max_pending_requests(const envoy_config_cluster_v3_CircuitBreakers_Thresholds *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const struct google_protobuf_UInt32Value*); }
+UPB_INLINE bool envoy_config_cluster_v3_CircuitBreakers_Thresholds_has_max_requests(const envoy_config_cluster_v3_CircuitBreakers_Thresholds *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 32)); }
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_CircuitBreakers_Thresholds_max_requests(const envoy_config_cluster_v3_CircuitBreakers_Thresholds *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const struct google_protobuf_UInt32Value*); }
+UPB_INLINE bool envoy_config_cluster_v3_CircuitBreakers_Thresholds_has_max_retries(const envoy_config_cluster_v3_CircuitBreakers_Thresholds *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 40)); }
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_CircuitBreakers_Thresholds_max_retries(const envoy_config_cluster_v3_CircuitBreakers_Thresholds *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const struct google_protobuf_UInt32Value*); }
+UPB_INLINE bool envoy_config_cluster_v3_CircuitBreakers_Thresholds_track_remaining(const envoy_config_cluster_v3_CircuitBreakers_Thresholds *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool); }
+UPB_INLINE bool envoy_config_cluster_v3_CircuitBreakers_Thresholds_has_max_connection_pools(const envoy_config_cluster_v3_CircuitBreakers_Thresholds *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 48)); }
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_CircuitBreakers_Thresholds_max_connection_pools(const envoy_config_cluster_v3_CircuitBreakers_Thresholds *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 48), const struct google_protobuf_UInt32Value*); }
+UPB_INLINE bool envoy_config_cluster_v3_CircuitBreakers_Thresholds_has_retry_budget(const envoy_config_cluster_v3_CircuitBreakers_Thresholds *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(32, 56)); }
+UPB_INLINE const envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget* envoy_config_cluster_v3_CircuitBreakers_Thresholds_retry_budget(const envoy_config_cluster_v3_CircuitBreakers_Thresholds *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 56), const envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget*); }
+
+UPB_INLINE void envoy_config_cluster_v3_CircuitBreakers_Thresholds_set_priority(envoy_config_cluster_v3_CircuitBreakers_Thresholds *msg, int32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
+}
+UPB_INLINE void envoy_config_cluster_v3_CircuitBreakers_Thresholds_set_max_connections(envoy_config_cluster_v3_CircuitBreakers_Thresholds *msg, struct google_protobuf_UInt32Value* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 16), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_CircuitBreakers_Thresholds_mutable_max_connections(envoy_config_cluster_v3_CircuitBreakers_Thresholds *msg, upb_arena *arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_cluster_v3_CircuitBreakers_Thresholds_max_connections(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_CircuitBreakers_Thresholds_set_max_connections(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_cluster_v3_CircuitBreakers_Thresholds_set_max_pending_requests(envoy_config_cluster_v3_CircuitBreakers_Thresholds *msg, struct google_protobuf_UInt32Value* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_CircuitBreakers_Thresholds_mutable_max_pending_requests(envoy_config_cluster_v3_CircuitBreakers_Thresholds *msg, upb_arena *arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_cluster_v3_CircuitBreakers_Thresholds_max_pending_requests(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_CircuitBreakers_Thresholds_set_max_pending_requests(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_cluster_v3_CircuitBreakers_Thresholds_set_max_requests(envoy_config_cluster_v3_CircuitBreakers_Thresholds *msg, struct google_protobuf_UInt32Value* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 32), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_CircuitBreakers_Thresholds_mutable_max_requests(envoy_config_cluster_v3_CircuitBreakers_Thresholds *msg, upb_arena *arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_cluster_v3_CircuitBreakers_Thresholds_max_requests(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_CircuitBreakers_Thresholds_set_max_requests(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_cluster_v3_CircuitBreakers_Thresholds_set_max_retries(envoy_config_cluster_v3_CircuitBreakers_Thresholds *msg, struct google_protobuf_UInt32Value* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 40), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_CircuitBreakers_Thresholds_mutable_max_retries(envoy_config_cluster_v3_CircuitBreakers_Thresholds *msg, upb_arena *arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_cluster_v3_CircuitBreakers_Thresholds_max_retries(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_CircuitBreakers_Thresholds_set_max_retries(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_cluster_v3_CircuitBreakers_Thresholds_set_track_remaining(envoy_config_cluster_v3_CircuitBreakers_Thresholds *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = value;
+}
+UPB_INLINE void envoy_config_cluster_v3_CircuitBreakers_Thresholds_set_max_connection_pools(envoy_config_cluster_v3_CircuitBreakers_Thresholds *msg, struct google_protobuf_UInt32Value* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 48), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_CircuitBreakers_Thresholds_mutable_max_connection_pools(envoy_config_cluster_v3_CircuitBreakers_Thresholds *msg, upb_arena *arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_cluster_v3_CircuitBreakers_Thresholds_max_connection_pools(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_CircuitBreakers_Thresholds_set_max_connection_pools(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_cluster_v3_CircuitBreakers_Thresholds_set_retry_budget(envoy_config_cluster_v3_CircuitBreakers_Thresholds *msg, envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 56), envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget*) = value;
+}
+UPB_INLINE struct envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget* envoy_config_cluster_v3_CircuitBreakers_Thresholds_mutable_retry_budget(envoy_config_cluster_v3_CircuitBreakers_Thresholds *msg, upb_arena *arena) {
+ struct envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget* sub = (struct envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget*)envoy_config_cluster_v3_CircuitBreakers_Thresholds_retry_budget(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget*)_upb_msg_new(&envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_CircuitBreakers_Thresholds_set_retry_budget(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.cluster.v3.CircuitBreakers.Thresholds.RetryBudget */
+
+UPB_INLINE envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget *envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_new(upb_arena *arena) {
+ return (envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget *)_upb_msg_new(&envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_msginit, arena);
+}
+UPB_INLINE envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget *envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget *ret = envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_serialize(const envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_has_budget_percent(const envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE const struct envoy_type_v3_Percent* envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_budget_percent(const envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct envoy_type_v3_Percent*); }
+UPB_INLINE bool envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_has_min_retry_concurrency(const envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_min_retry_concurrency(const envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_UInt32Value*); }
+
+UPB_INLINE void envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_set_budget_percent(envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget *msg, struct envoy_type_v3_Percent* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct envoy_type_v3_Percent*) = value;
+}
+UPB_INLINE struct envoy_type_v3_Percent* envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_mutable_budget_percent(envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget *msg, upb_arena *arena) {
+ struct envoy_type_v3_Percent* sub = (struct envoy_type_v3_Percent*)envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_budget_percent(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_type_v3_Percent*)_upb_msg_new(&envoy_type_v3_Percent_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_set_budget_percent(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_set_min_retry_concurrency(envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget *msg, struct google_protobuf_UInt32Value* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_mutable_min_retry_concurrency(envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget *msg, upb_arena *arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_min_retry_concurrency(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_set_min_retry_concurrency(msg, sub);
+ }
+ return sub;
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_CONFIG_CLUSTER_V3_CIRCUIT_BREAKER_PROTO_UPB_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.c
index 64736740c99..3add43b0159 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.c
@@ -1,458 +1,458 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/config/cluster/v3/cluster.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include <stddef.h>
-#include "upb/msg.h"
-#include "envoy/config/cluster/v3/cluster.upb.h"
-#include "envoy/config/cluster/v3/circuit_breaker.upb.h"
-#include "envoy/config/cluster/v3/filter.upb.h"
-#include "envoy/config/cluster/v3/outlier_detection.upb.h"
-#include "envoy/config/core/v3/address.upb.h"
-#include "envoy/config/core/v3/base.upb.h"
-#include "envoy/config/core/v3/config_source.upb.h"
-#include "envoy/config/core/v3/extension.upb.h"
-#include "envoy/config/core/v3/health_check.upb.h"
-#include "envoy/config/core/v3/protocol.upb.h"
-#include "envoy/config/endpoint/v3/endpoint.upb.h"
-#include "envoy/type/v3/percent.upb.h"
-#include "google/protobuf/any.upb.h"
-#include "google/protobuf/duration.upb.h"
-#include "google/protobuf/struct.upb.h"
-#include "google/protobuf/wrappers.upb.h"
-#include "udpa/core/v1/collection_entry.upb.h"
-#include "udpa/core/v1/resource_locator.upb.h"
-#include "envoy/annotations/deprecation.upb.h"
-#include "udpa/annotations/migrate.upb.h"
-#include "udpa/annotations/security.upb.h"
-#include "udpa/annotations/status.upb.h"
-#include "udpa/annotations/versioning.upb.h"
-#include "validate/validate.upb.h"
-
-#include "upb/port_def.inc"
-
-static const upb_msglayout *const envoy_config_cluster_v3_ClusterCollection_submsgs[1] = {
- &udpa_core_v1_CollectionEntry_msginit,
-};
-
-static const upb_msglayout_field envoy_config_cluster_v3_ClusterCollection__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
-};
-
-const upb_msglayout envoy_config_cluster_v3_ClusterCollection_msginit = {
- &envoy_config_cluster_v3_ClusterCollection_submsgs[0],
- &envoy_config_cluster_v3_ClusterCollection__fields[0],
- UPB_SIZE(4, 8), 1, false,
-};
-
-static const upb_msglayout *const envoy_config_cluster_v3_Cluster_submsgs[35] = {
- &envoy_config_cluster_v3_CircuitBreakers_msginit,
- &envoy_config_cluster_v3_Cluster_CommonLbConfig_msginit,
- &envoy_config_cluster_v3_Cluster_CustomClusterType_msginit,
- &envoy_config_cluster_v3_Cluster_EdsClusterConfig_msginit,
- &envoy_config_cluster_v3_Cluster_LbSubsetConfig_msginit,
- &envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_msginit,
- &envoy_config_cluster_v3_Cluster_MaglevLbConfig_msginit,
- &envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_msginit,
- &envoy_config_cluster_v3_Cluster_PrefetchPolicy_msginit,
- &envoy_config_cluster_v3_Cluster_RefreshRate_msginit,
- &envoy_config_cluster_v3_Cluster_RingHashLbConfig_msginit,
- &envoy_config_cluster_v3_Cluster_TransportSocketMatch_msginit,
- &envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry_msginit,
- &envoy_config_cluster_v3_Filter_msginit,
- &envoy_config_cluster_v3_LoadBalancingPolicy_msginit,
- &envoy_config_cluster_v3_OutlierDetection_msginit,
- &envoy_config_cluster_v3_TrackClusterStats_msginit,
- &envoy_config_cluster_v3_UpstreamConnectionOptions_msginit,
- &envoy_config_core_v3_Address_msginit,
- &envoy_config_core_v3_BindConfig_msginit,
- &envoy_config_core_v3_ConfigSource_msginit,
- &envoy_config_core_v3_HealthCheck_msginit,
- &envoy_config_core_v3_Http1ProtocolOptions_msginit,
- &envoy_config_core_v3_Http2ProtocolOptions_msginit,
- &envoy_config_core_v3_HttpProtocolOptions_msginit,
- &envoy_config_core_v3_Metadata_msginit,
- &envoy_config_core_v3_TransportSocket_msginit,
- &envoy_config_core_v3_TypedExtensionConfig_msginit,
- &envoy_config_core_v3_UpstreamHttpProtocolOptions_msginit,
- &envoy_config_endpoint_v3_ClusterLoadAssignment_msginit,
- &google_protobuf_Duration_msginit,
- &google_protobuf_UInt32Value_msginit,
-};
-
-static const upb_msglayout_field envoy_config_cluster_v3_Cluster__fields[47] = {
- {1, UPB_SIZE(32, 32), 0, 0, 9, 1},
- {2, UPB_SIZE(168, 304), UPB_SIZE(-177, -313), 0, 14, 1},
- {3, UPB_SIZE(48, 64), 0, 3, 11, 1},
- {4, UPB_SIZE(52, 72), 0, 30, 11, 1},
- {5, UPB_SIZE(56, 80), 0, 31, 11, 1},
- {6, UPB_SIZE(0, 0), 0, 0, 14, 1},
- {8, UPB_SIZE(148, 264), 0, 21, 11, 3},
- {9, UPB_SIZE(60, 88), 0, 31, 11, 1},
- {10, UPB_SIZE(64, 96), 0, 0, 11, 1},
- {13, UPB_SIZE(68, 104), 0, 22, 11, 1},
- {14, UPB_SIZE(72, 112), 0, 23, 11, 1},
- {16, UPB_SIZE(76, 120), 0, 30, 11, 1},
- {17, UPB_SIZE(8, 8), 0, 0, 14, 1},
- {18, UPB_SIZE(152, 272), 0, 18, 11, 3},
- {19, UPB_SIZE(80, 128), 0, 15, 11, 1},
- {20, UPB_SIZE(84, 136), 0, 30, 11, 1},
- {21, UPB_SIZE(88, 144), 0, 19, 11, 1},
- {22, UPB_SIZE(92, 152), 0, 4, 11, 1},
- {23, UPB_SIZE(180, 320), UPB_SIZE(-185, -329), 10, 11, 1},
- {24, UPB_SIZE(96, 160), 0, 26, 11, 1},
- {25, UPB_SIZE(100, 168), 0, 25, 11, 1},
- {26, UPB_SIZE(16, 16), 0, 0, 14, 1},
- {27, UPB_SIZE(104, 176), 0, 1, 11, 1},
- {28, UPB_SIZE(40, 48), 0, 0, 9, 1},
- {29, UPB_SIZE(108, 184), 0, 24, 11, 1},
- {30, UPB_SIZE(112, 192), 0, 17, 11, 1},
- {31, UPB_SIZE(24, 24), 0, 0, 8, 1},
- {32, UPB_SIZE(25, 25), 0, 0, 8, 1},
- {33, UPB_SIZE(116, 200), 0, 29, 11, 1},
- {34, UPB_SIZE(180, 320), UPB_SIZE(-185, -329), 7, 11, 1},
- {36, UPB_SIZE(156, 280), 0, 12, 11, _UPB_LABEL_MAP},
- {37, UPB_SIZE(180, 320), UPB_SIZE(-185, -329), 5, 11, 1},
- {38, UPB_SIZE(168, 304), UPB_SIZE(-177, -313), 2, 11, 1},
- {39, UPB_SIZE(26, 26), 0, 0, 8, 1},
- {40, UPB_SIZE(160, 288), 0, 13, 11, 3},
- {41, UPB_SIZE(120, 208), 0, 14, 11, 1},
- {42, UPB_SIZE(124, 216), 0, 20, 11, 1},
- {43, UPB_SIZE(164, 296), 0, 11, 11, 3},
- {44, UPB_SIZE(128, 224), 0, 9, 11, 1},
- {45, UPB_SIZE(27, 27), 0, 0, 8, 1},
- {46, UPB_SIZE(132, 232), 0, 28, 11, 1},
- {47, UPB_SIZE(28, 28), 0, 0, 8, 1},
- {48, UPB_SIZE(136, 240), 0, 27, 11, 1},
- {49, UPB_SIZE(140, 248), 0, 16, 11, 1},
- {50, UPB_SIZE(144, 256), 0, 8, 11, 1},
- {51, UPB_SIZE(29, 29), 0, 0, 8, 1},
- {52, UPB_SIZE(180, 320), UPB_SIZE(-185, -329), 6, 11, 1},
-};
-
-const upb_msglayout envoy_config_cluster_v3_Cluster_msginit = {
- &envoy_config_cluster_v3_Cluster_submsgs[0],
- &envoy_config_cluster_v3_Cluster__fields[0],
- UPB_SIZE(192, 336), 47, false,
-};
-
-static const upb_msglayout *const envoy_config_cluster_v3_Cluster_TransportSocketMatch_submsgs[2] = {
- &envoy_config_core_v3_TransportSocket_msginit,
- &google_protobuf_Struct_msginit,
-};
-
-static const upb_msglayout_field envoy_config_cluster_v3_Cluster_TransportSocketMatch__fields[3] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 1, 11, 1},
- {3, UPB_SIZE(12, 24), 0, 0, 11, 1},
-};
-
-const upb_msglayout envoy_config_cluster_v3_Cluster_TransportSocketMatch_msginit = {
- &envoy_config_cluster_v3_Cluster_TransportSocketMatch_submsgs[0],
- &envoy_config_cluster_v3_Cluster_TransportSocketMatch__fields[0],
- UPB_SIZE(16, 32), 3, false,
-};
-
-static const upb_msglayout *const envoy_config_cluster_v3_Cluster_CustomClusterType_submsgs[1] = {
- &google_protobuf_Any_msginit,
-};
-
-static const upb_msglayout_field envoy_config_cluster_v3_Cluster_CustomClusterType__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 11, 1},
-};
-
-const upb_msglayout envoy_config_cluster_v3_Cluster_CustomClusterType_msginit = {
- &envoy_config_cluster_v3_Cluster_CustomClusterType_submsgs[0],
- &envoy_config_cluster_v3_Cluster_CustomClusterType__fields[0],
- UPB_SIZE(16, 32), 2, false,
-};
-
-static const upb_msglayout *const envoy_config_cluster_v3_Cluster_EdsClusterConfig_submsgs[2] = {
- &envoy_config_core_v3_ConfigSource_msginit,
- &udpa_core_v1_ResourceLocator_msginit,
-};
-
-static const upb_msglayout_field envoy_config_cluster_v3_Cluster_EdsClusterConfig__fields[3] = {
- {1, UPB_SIZE(8, 16), 0, 0, 11, 1},
- {2, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {3, UPB_SIZE(12, 24), 0, 1, 11, 1},
-};
-
-const upb_msglayout envoy_config_cluster_v3_Cluster_EdsClusterConfig_msginit = {
- &envoy_config_cluster_v3_Cluster_EdsClusterConfig_submsgs[0],
- &envoy_config_cluster_v3_Cluster_EdsClusterConfig__fields[0],
- UPB_SIZE(16, 32), 3, false,
-};
-
-static const upb_msglayout *const envoy_config_cluster_v3_Cluster_LbSubsetConfig_submsgs[2] = {
- &envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_msginit,
- &google_protobuf_Struct_msginit,
-};
-
-static const upb_msglayout_field envoy_config_cluster_v3_Cluster_LbSubsetConfig__fields[7] = {
- {1, UPB_SIZE(0, 0), 0, 0, 14, 1},
- {2, UPB_SIZE(12, 16), 0, 1, 11, 1},
- {3, UPB_SIZE(16, 24), 0, 0, 11, 3},
- {4, UPB_SIZE(8, 8), 0, 0, 8, 1},
- {5, UPB_SIZE(9, 9), 0, 0, 8, 1},
- {6, UPB_SIZE(10, 10), 0, 0, 8, 1},
- {7, UPB_SIZE(11, 11), 0, 0, 8, 1},
-};
-
-const upb_msglayout envoy_config_cluster_v3_Cluster_LbSubsetConfig_msginit = {
- &envoy_config_cluster_v3_Cluster_LbSubsetConfig_submsgs[0],
- &envoy_config_cluster_v3_Cluster_LbSubsetConfig__fields[0],
- UPB_SIZE(24, 32), 7, false,
-};
-
-static const upb_msglayout_field envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector__fields[4] = {
- {1, UPB_SIZE(12, 16), 0, 0, 9, 3},
- {2, UPB_SIZE(0, 0), 0, 0, 14, 1},
- {3, UPB_SIZE(16, 24), 0, 0, 9, 3},
- {4, UPB_SIZE(8, 8), 0, 0, 8, 1},
-};
-
-const upb_msglayout envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_msginit = {
- NULL,
- &envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector__fields[0],
- UPB_SIZE(24, 32), 4, false,
-};
-
-static const upb_msglayout *const envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_submsgs[2] = {
- &envoy_config_core_v3_RuntimeDouble_msginit,
- &google_protobuf_UInt32Value_msginit,
-};
-
-static const upb_msglayout_field envoy_config_cluster_v3_Cluster_LeastRequestLbConfig__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 1, 11, 1},
- {2, UPB_SIZE(4, 8), 0, 0, 11, 1},
-};
-
-const upb_msglayout envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_msginit = {
- &envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_submsgs[0],
- &envoy_config_cluster_v3_Cluster_LeastRequestLbConfig__fields[0],
- UPB_SIZE(8, 16), 2, false,
-};
-
-static const upb_msglayout *const envoy_config_cluster_v3_Cluster_RingHashLbConfig_submsgs[2] = {
- &google_protobuf_UInt64Value_msginit,
-};
-
-static const upb_msglayout_field envoy_config_cluster_v3_Cluster_RingHashLbConfig__fields[3] = {
- {1, UPB_SIZE(8, 8), 0, 0, 11, 1},
- {3, UPB_SIZE(0, 0), 0, 0, 14, 1},
- {4, UPB_SIZE(12, 16), 0, 0, 11, 1},
-};
-
-const upb_msglayout envoy_config_cluster_v3_Cluster_RingHashLbConfig_msginit = {
- &envoy_config_cluster_v3_Cluster_RingHashLbConfig_submsgs[0],
- &envoy_config_cluster_v3_Cluster_RingHashLbConfig__fields[0],
- UPB_SIZE(16, 24), 3, false,
-};
-
-static const upb_msglayout *const envoy_config_cluster_v3_Cluster_MaglevLbConfig_submsgs[1] = {
- &google_protobuf_UInt64Value_msginit,
-};
-
-static const upb_msglayout_field envoy_config_cluster_v3_Cluster_MaglevLbConfig__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
-};
-
-const upb_msglayout envoy_config_cluster_v3_Cluster_MaglevLbConfig_msginit = {
- &envoy_config_cluster_v3_Cluster_MaglevLbConfig_submsgs[0],
- &envoy_config_cluster_v3_Cluster_MaglevLbConfig__fields[0],
- UPB_SIZE(4, 8), 1, false,
-};
-
-static const upb_msglayout_field envoy_config_cluster_v3_Cluster_OriginalDstLbConfig__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 8, 1},
-};
-
-const upb_msglayout envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_msginit = {
- NULL,
- &envoy_config_cluster_v3_Cluster_OriginalDstLbConfig__fields[0],
- UPB_SIZE(1, 1), 1, false,
-};
-
-static const upb_msglayout *const envoy_config_cluster_v3_Cluster_CommonLbConfig_submsgs[5] = {
- &envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_msginit,
- &envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig_msginit,
- &envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_msginit,
- &envoy_type_v3_Percent_msginit,
- &google_protobuf_Duration_msginit,
-};
-
-static const upb_msglayout_field envoy_config_cluster_v3_Cluster_CommonLbConfig__fields[7] = {
- {1, UPB_SIZE(4, 8), 0, 3, 11, 1},
- {2, UPB_SIZE(16, 32), UPB_SIZE(-21, -41), 2, 11, 1},
- {3, UPB_SIZE(16, 32), UPB_SIZE(-21, -41), 1, 11, 1},
- {4, UPB_SIZE(8, 16), 0, 4, 11, 1},
- {5, UPB_SIZE(0, 0), 0, 0, 8, 1},
- {6, UPB_SIZE(1, 1), 0, 0, 8, 1},
- {7, UPB_SIZE(12, 24), 0, 0, 11, 1},
-};
-
-const upb_msglayout envoy_config_cluster_v3_Cluster_CommonLbConfig_msginit = {
- &envoy_config_cluster_v3_Cluster_CommonLbConfig_submsgs[0],
- &envoy_config_cluster_v3_Cluster_CommonLbConfig__fields[0],
- UPB_SIZE(24, 48), 7, false,
-};
-
-static const upb_msglayout *const envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_submsgs[2] = {
- &envoy_type_v3_Percent_msginit,
- &google_protobuf_UInt64Value_msginit,
-};
-
-static const upb_msglayout_field envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig__fields[3] = {
- {1, UPB_SIZE(4, 8), 0, 0, 11, 1},
- {2, UPB_SIZE(8, 16), 0, 1, 11, 1},
- {3, UPB_SIZE(0, 0), 0, 0, 8, 1},
-};
-
-const upb_msglayout envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_msginit = {
- &envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_submsgs[0],
- &envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig__fields[0],
- UPB_SIZE(12, 24), 3, false,
-};
-
-const upb_msglayout envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig_msginit = {
- NULL,
- NULL,
- UPB_SIZE(0, 0), 0, false,
-};
-
-static const upb_msglayout *const envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_submsgs[1] = {
- &google_protobuf_UInt32Value_msginit,
-};
-
-static const upb_msglayout_field envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 8, 1},
- {2, UPB_SIZE(4, 8), 0, 0, 11, 1},
-};
-
-const upb_msglayout envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_msginit = {
- &envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_submsgs[0],
- &envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig__fields[0],
- UPB_SIZE(8, 16), 2, false,
-};
-
-static const upb_msglayout *const envoy_config_cluster_v3_Cluster_RefreshRate_submsgs[2] = {
- &google_protobuf_Duration_msginit,
-};
-
-static const upb_msglayout_field envoy_config_cluster_v3_Cluster_RefreshRate__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
- {2, UPB_SIZE(4, 8), 0, 0, 11, 1},
-};
-
-const upb_msglayout envoy_config_cluster_v3_Cluster_RefreshRate_msginit = {
- &envoy_config_cluster_v3_Cluster_RefreshRate_submsgs[0],
- &envoy_config_cluster_v3_Cluster_RefreshRate__fields[0],
- UPB_SIZE(8, 16), 2, false,
-};
-
-static const upb_msglayout *const envoy_config_cluster_v3_Cluster_PrefetchPolicy_submsgs[2] = {
- &google_protobuf_DoubleValue_msginit,
-};
-
-static const upb_msglayout_field envoy_config_cluster_v3_Cluster_PrefetchPolicy__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
- {2, UPB_SIZE(4, 8), 0, 0, 11, 1},
-};
-
-const upb_msglayout envoy_config_cluster_v3_Cluster_PrefetchPolicy_msginit = {
- &envoy_config_cluster_v3_Cluster_PrefetchPolicy_submsgs[0],
- &envoy_config_cluster_v3_Cluster_PrefetchPolicy__fields[0],
- UPB_SIZE(8, 16), 2, false,
-};
-
-static const upb_msglayout *const envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry_submsgs[1] = {
- &google_protobuf_Any_msginit,
-};
-
-static const upb_msglayout_field envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 11, 1},
-};
-
-const upb_msglayout envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry_msginit = {
- &envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry_submsgs[0],
- &envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry__fields[0],
- UPB_SIZE(16, 32), 2, false,
-};
-
-static const upb_msglayout *const envoy_config_cluster_v3_LoadBalancingPolicy_submsgs[1] = {
- &envoy_config_cluster_v3_LoadBalancingPolicy_Policy_msginit,
-};
-
-static const upb_msglayout_field envoy_config_cluster_v3_LoadBalancingPolicy__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 3},
-};
-
-const upb_msglayout envoy_config_cluster_v3_LoadBalancingPolicy_msginit = {
- &envoy_config_cluster_v3_LoadBalancingPolicy_submsgs[0],
- &envoy_config_cluster_v3_LoadBalancingPolicy__fields[0],
- UPB_SIZE(4, 8), 1, false,
-};
-
-static const upb_msglayout *const envoy_config_cluster_v3_LoadBalancingPolicy_Policy_submsgs[1] = {
- &google_protobuf_Any_msginit,
-};
-
-static const upb_msglayout_field envoy_config_cluster_v3_LoadBalancingPolicy_Policy__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {3, UPB_SIZE(8, 16), 0, 0, 11, 1},
-};
-
-const upb_msglayout envoy_config_cluster_v3_LoadBalancingPolicy_Policy_msginit = {
- &envoy_config_cluster_v3_LoadBalancingPolicy_Policy_submsgs[0],
- &envoy_config_cluster_v3_LoadBalancingPolicy_Policy__fields[0],
- UPB_SIZE(16, 32), 2, false,
-};
-
-static const upb_msglayout *const envoy_config_cluster_v3_UpstreamBindConfig_submsgs[1] = {
- &envoy_config_core_v3_Address_msginit,
-};
-
-static const upb_msglayout_field envoy_config_cluster_v3_UpstreamBindConfig__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
-};
-
-const upb_msglayout envoy_config_cluster_v3_UpstreamBindConfig_msginit = {
- &envoy_config_cluster_v3_UpstreamBindConfig_submsgs[0],
- &envoy_config_cluster_v3_UpstreamBindConfig__fields[0],
- UPB_SIZE(4, 8), 1, false,
-};
-
-static const upb_msglayout *const envoy_config_cluster_v3_UpstreamConnectionOptions_submsgs[1] = {
- &envoy_config_core_v3_TcpKeepalive_msginit,
-};
-
-static const upb_msglayout_field envoy_config_cluster_v3_UpstreamConnectionOptions__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
-};
-
-const upb_msglayout envoy_config_cluster_v3_UpstreamConnectionOptions_msginit = {
- &envoy_config_cluster_v3_UpstreamConnectionOptions_submsgs[0],
- &envoy_config_cluster_v3_UpstreamConnectionOptions__fields[0],
- UPB_SIZE(4, 8), 1, false,
-};
-
-static const upb_msglayout_field envoy_config_cluster_v3_TrackClusterStats__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 8, 1},
- {2, UPB_SIZE(1, 1), 0, 0, 8, 1},
-};
-
-const upb_msglayout envoy_config_cluster_v3_TrackClusterStats_msginit = {
- NULL,
- &envoy_config_cluster_v3_TrackClusterStats__fields[0],
- UPB_SIZE(2, 2), 2, false,
-};
-
-#include "upb/port_undef.inc"
-
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/cluster/v3/cluster.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg.h"
+#include "envoy/config/cluster/v3/cluster.upb.h"
+#include "envoy/config/cluster/v3/circuit_breaker.upb.h"
+#include "envoy/config/cluster/v3/filter.upb.h"
+#include "envoy/config/cluster/v3/outlier_detection.upb.h"
+#include "envoy/config/core/v3/address.upb.h"
+#include "envoy/config/core/v3/base.upb.h"
+#include "envoy/config/core/v3/config_source.upb.h"
+#include "envoy/config/core/v3/extension.upb.h"
+#include "envoy/config/core/v3/health_check.upb.h"
+#include "envoy/config/core/v3/protocol.upb.h"
+#include "envoy/config/endpoint/v3/endpoint.upb.h"
+#include "envoy/type/v3/percent.upb.h"
+#include "google/protobuf/any.upb.h"
+#include "google/protobuf/duration.upb.h"
+#include "google/protobuf/struct.upb.h"
+#include "google/protobuf/wrappers.upb.h"
+#include "udpa/core/v1/collection_entry.upb.h"
+#include "udpa/core/v1/resource_locator.upb.h"
+#include "envoy/annotations/deprecation.upb.h"
+#include "udpa/annotations/migrate.upb.h"
+#include "udpa/annotations/security.upb.h"
+#include "udpa/annotations/status.upb.h"
+#include "udpa/annotations/versioning.upb.h"
+#include "validate/validate.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_msglayout *const envoy_config_cluster_v3_ClusterCollection_submsgs[1] = {
+ &udpa_core_v1_CollectionEntry_msginit,
+};
+
+static const upb_msglayout_field envoy_config_cluster_v3_ClusterCollection__fields[1] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
+};
+
+const upb_msglayout envoy_config_cluster_v3_ClusterCollection_msginit = {
+ &envoy_config_cluster_v3_ClusterCollection_submsgs[0],
+ &envoy_config_cluster_v3_ClusterCollection__fields[0],
+ UPB_SIZE(4, 8), 1, false,
+};
+
+static const upb_msglayout *const envoy_config_cluster_v3_Cluster_submsgs[35] = {
+ &envoy_config_cluster_v3_CircuitBreakers_msginit,
+ &envoy_config_cluster_v3_Cluster_CommonLbConfig_msginit,
+ &envoy_config_cluster_v3_Cluster_CustomClusterType_msginit,
+ &envoy_config_cluster_v3_Cluster_EdsClusterConfig_msginit,
+ &envoy_config_cluster_v3_Cluster_LbSubsetConfig_msginit,
+ &envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_msginit,
+ &envoy_config_cluster_v3_Cluster_MaglevLbConfig_msginit,
+ &envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_msginit,
+ &envoy_config_cluster_v3_Cluster_PrefetchPolicy_msginit,
+ &envoy_config_cluster_v3_Cluster_RefreshRate_msginit,
+ &envoy_config_cluster_v3_Cluster_RingHashLbConfig_msginit,
+ &envoy_config_cluster_v3_Cluster_TransportSocketMatch_msginit,
+ &envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry_msginit,
+ &envoy_config_cluster_v3_Filter_msginit,
+ &envoy_config_cluster_v3_LoadBalancingPolicy_msginit,
+ &envoy_config_cluster_v3_OutlierDetection_msginit,
+ &envoy_config_cluster_v3_TrackClusterStats_msginit,
+ &envoy_config_cluster_v3_UpstreamConnectionOptions_msginit,
+ &envoy_config_core_v3_Address_msginit,
+ &envoy_config_core_v3_BindConfig_msginit,
+ &envoy_config_core_v3_ConfigSource_msginit,
+ &envoy_config_core_v3_HealthCheck_msginit,
+ &envoy_config_core_v3_Http1ProtocolOptions_msginit,
+ &envoy_config_core_v3_Http2ProtocolOptions_msginit,
+ &envoy_config_core_v3_HttpProtocolOptions_msginit,
+ &envoy_config_core_v3_Metadata_msginit,
+ &envoy_config_core_v3_TransportSocket_msginit,
+ &envoy_config_core_v3_TypedExtensionConfig_msginit,
+ &envoy_config_core_v3_UpstreamHttpProtocolOptions_msginit,
+ &envoy_config_endpoint_v3_ClusterLoadAssignment_msginit,
+ &google_protobuf_Duration_msginit,
+ &google_protobuf_UInt32Value_msginit,
+};
+
+static const upb_msglayout_field envoy_config_cluster_v3_Cluster__fields[47] = {
+ {1, UPB_SIZE(32, 32), 0, 0, 9, 1},
+ {2, UPB_SIZE(168, 304), UPB_SIZE(-177, -313), 0, 14, 1},
+ {3, UPB_SIZE(48, 64), 0, 3, 11, 1},
+ {4, UPB_SIZE(52, 72), 0, 30, 11, 1},
+ {5, UPB_SIZE(56, 80), 0, 31, 11, 1},
+ {6, UPB_SIZE(0, 0), 0, 0, 14, 1},
+ {8, UPB_SIZE(148, 264), 0, 21, 11, 3},
+ {9, UPB_SIZE(60, 88), 0, 31, 11, 1},
+ {10, UPB_SIZE(64, 96), 0, 0, 11, 1},
+ {13, UPB_SIZE(68, 104), 0, 22, 11, 1},
+ {14, UPB_SIZE(72, 112), 0, 23, 11, 1},
+ {16, UPB_SIZE(76, 120), 0, 30, 11, 1},
+ {17, UPB_SIZE(8, 8), 0, 0, 14, 1},
+ {18, UPB_SIZE(152, 272), 0, 18, 11, 3},
+ {19, UPB_SIZE(80, 128), 0, 15, 11, 1},
+ {20, UPB_SIZE(84, 136), 0, 30, 11, 1},
+ {21, UPB_SIZE(88, 144), 0, 19, 11, 1},
+ {22, UPB_SIZE(92, 152), 0, 4, 11, 1},
+ {23, UPB_SIZE(180, 320), UPB_SIZE(-185, -329), 10, 11, 1},
+ {24, UPB_SIZE(96, 160), 0, 26, 11, 1},
+ {25, UPB_SIZE(100, 168), 0, 25, 11, 1},
+ {26, UPB_SIZE(16, 16), 0, 0, 14, 1},
+ {27, UPB_SIZE(104, 176), 0, 1, 11, 1},
+ {28, UPB_SIZE(40, 48), 0, 0, 9, 1},
+ {29, UPB_SIZE(108, 184), 0, 24, 11, 1},
+ {30, UPB_SIZE(112, 192), 0, 17, 11, 1},
+ {31, UPB_SIZE(24, 24), 0, 0, 8, 1},
+ {32, UPB_SIZE(25, 25), 0, 0, 8, 1},
+ {33, UPB_SIZE(116, 200), 0, 29, 11, 1},
+ {34, UPB_SIZE(180, 320), UPB_SIZE(-185, -329), 7, 11, 1},
+ {36, UPB_SIZE(156, 280), 0, 12, 11, _UPB_LABEL_MAP},
+ {37, UPB_SIZE(180, 320), UPB_SIZE(-185, -329), 5, 11, 1},
+ {38, UPB_SIZE(168, 304), UPB_SIZE(-177, -313), 2, 11, 1},
+ {39, UPB_SIZE(26, 26), 0, 0, 8, 1},
+ {40, UPB_SIZE(160, 288), 0, 13, 11, 3},
+ {41, UPB_SIZE(120, 208), 0, 14, 11, 1},
+ {42, UPB_SIZE(124, 216), 0, 20, 11, 1},
+ {43, UPB_SIZE(164, 296), 0, 11, 11, 3},
+ {44, UPB_SIZE(128, 224), 0, 9, 11, 1},
+ {45, UPB_SIZE(27, 27), 0, 0, 8, 1},
+ {46, UPB_SIZE(132, 232), 0, 28, 11, 1},
+ {47, UPB_SIZE(28, 28), 0, 0, 8, 1},
+ {48, UPB_SIZE(136, 240), 0, 27, 11, 1},
+ {49, UPB_SIZE(140, 248), 0, 16, 11, 1},
+ {50, UPB_SIZE(144, 256), 0, 8, 11, 1},
+ {51, UPB_SIZE(29, 29), 0, 0, 8, 1},
+ {52, UPB_SIZE(180, 320), UPB_SIZE(-185, -329), 6, 11, 1},
+};
+
+const upb_msglayout envoy_config_cluster_v3_Cluster_msginit = {
+ &envoy_config_cluster_v3_Cluster_submsgs[0],
+ &envoy_config_cluster_v3_Cluster__fields[0],
+ UPB_SIZE(192, 336), 47, false,
+};
+
+static const upb_msglayout *const envoy_config_cluster_v3_Cluster_TransportSocketMatch_submsgs[2] = {
+ &envoy_config_core_v3_TransportSocket_msginit,
+ &google_protobuf_Struct_msginit,
+};
+
+static const upb_msglayout_field envoy_config_cluster_v3_Cluster_TransportSocketMatch__fields[3] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {2, UPB_SIZE(8, 16), 0, 1, 11, 1},
+ {3, UPB_SIZE(12, 24), 0, 0, 11, 1},
+};
+
+const upb_msglayout envoy_config_cluster_v3_Cluster_TransportSocketMatch_msginit = {
+ &envoy_config_cluster_v3_Cluster_TransportSocketMatch_submsgs[0],
+ &envoy_config_cluster_v3_Cluster_TransportSocketMatch__fields[0],
+ UPB_SIZE(16, 32), 3, false,
+};
+
+static const upb_msglayout *const envoy_config_cluster_v3_Cluster_CustomClusterType_submsgs[1] = {
+ &google_protobuf_Any_msginit,
+};
+
+static const upb_msglayout_field envoy_config_cluster_v3_Cluster_CustomClusterType__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {2, UPB_SIZE(8, 16), 0, 0, 11, 1},
+};
+
+const upb_msglayout envoy_config_cluster_v3_Cluster_CustomClusterType_msginit = {
+ &envoy_config_cluster_v3_Cluster_CustomClusterType_submsgs[0],
+ &envoy_config_cluster_v3_Cluster_CustomClusterType__fields[0],
+ UPB_SIZE(16, 32), 2, false,
+};
+
+static const upb_msglayout *const envoy_config_cluster_v3_Cluster_EdsClusterConfig_submsgs[2] = {
+ &envoy_config_core_v3_ConfigSource_msginit,
+ &udpa_core_v1_ResourceLocator_msginit,
+};
+
+static const upb_msglayout_field envoy_config_cluster_v3_Cluster_EdsClusterConfig__fields[3] = {
+ {1, UPB_SIZE(8, 16), 0, 0, 11, 1},
+ {2, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {3, UPB_SIZE(12, 24), 0, 1, 11, 1},
+};
+
+const upb_msglayout envoy_config_cluster_v3_Cluster_EdsClusterConfig_msginit = {
+ &envoy_config_cluster_v3_Cluster_EdsClusterConfig_submsgs[0],
+ &envoy_config_cluster_v3_Cluster_EdsClusterConfig__fields[0],
+ UPB_SIZE(16, 32), 3, false,
+};
+
+static const upb_msglayout *const envoy_config_cluster_v3_Cluster_LbSubsetConfig_submsgs[2] = {
+ &envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_msginit,
+ &google_protobuf_Struct_msginit,
+};
+
+static const upb_msglayout_field envoy_config_cluster_v3_Cluster_LbSubsetConfig__fields[7] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 14, 1},
+ {2, UPB_SIZE(12, 16), 0, 1, 11, 1},
+ {3, UPB_SIZE(16, 24), 0, 0, 11, 3},
+ {4, UPB_SIZE(8, 8), 0, 0, 8, 1},
+ {5, UPB_SIZE(9, 9), 0, 0, 8, 1},
+ {6, UPB_SIZE(10, 10), 0, 0, 8, 1},
+ {7, UPB_SIZE(11, 11), 0, 0, 8, 1},
+};
+
+const upb_msglayout envoy_config_cluster_v3_Cluster_LbSubsetConfig_msginit = {
+ &envoy_config_cluster_v3_Cluster_LbSubsetConfig_submsgs[0],
+ &envoy_config_cluster_v3_Cluster_LbSubsetConfig__fields[0],
+ UPB_SIZE(24, 32), 7, false,
+};
+
+static const upb_msglayout_field envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector__fields[4] = {
+ {1, UPB_SIZE(12, 16), 0, 0, 9, 3},
+ {2, UPB_SIZE(0, 0), 0, 0, 14, 1},
+ {3, UPB_SIZE(16, 24), 0, 0, 9, 3},
+ {4, UPB_SIZE(8, 8), 0, 0, 8, 1},
+};
+
+const upb_msglayout envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_msginit = {
+ NULL,
+ &envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector__fields[0],
+ UPB_SIZE(24, 32), 4, false,
+};
+
+static const upb_msglayout *const envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_submsgs[2] = {
+ &envoy_config_core_v3_RuntimeDouble_msginit,
+ &google_protobuf_UInt32Value_msginit,
+};
+
+static const upb_msglayout_field envoy_config_cluster_v3_Cluster_LeastRequestLbConfig__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 1, 11, 1},
+ {2, UPB_SIZE(4, 8), 0, 0, 11, 1},
+};
+
+const upb_msglayout envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_msginit = {
+ &envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_submsgs[0],
+ &envoy_config_cluster_v3_Cluster_LeastRequestLbConfig__fields[0],
+ UPB_SIZE(8, 16), 2, false,
+};
+
+static const upb_msglayout *const envoy_config_cluster_v3_Cluster_RingHashLbConfig_submsgs[2] = {
+ &google_protobuf_UInt64Value_msginit,
+};
+
+static const upb_msglayout_field envoy_config_cluster_v3_Cluster_RingHashLbConfig__fields[3] = {
+ {1, UPB_SIZE(8, 8), 0, 0, 11, 1},
+ {3, UPB_SIZE(0, 0), 0, 0, 14, 1},
+ {4, UPB_SIZE(12, 16), 0, 0, 11, 1},
+};
+
+const upb_msglayout envoy_config_cluster_v3_Cluster_RingHashLbConfig_msginit = {
+ &envoy_config_cluster_v3_Cluster_RingHashLbConfig_submsgs[0],
+ &envoy_config_cluster_v3_Cluster_RingHashLbConfig__fields[0],
+ UPB_SIZE(16, 24), 3, false,
+};
+
+static const upb_msglayout *const envoy_config_cluster_v3_Cluster_MaglevLbConfig_submsgs[1] = {
+ &google_protobuf_UInt64Value_msginit,
+};
+
+static const upb_msglayout_field envoy_config_cluster_v3_Cluster_MaglevLbConfig__fields[1] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
+};
+
+const upb_msglayout envoy_config_cluster_v3_Cluster_MaglevLbConfig_msginit = {
+ &envoy_config_cluster_v3_Cluster_MaglevLbConfig_submsgs[0],
+ &envoy_config_cluster_v3_Cluster_MaglevLbConfig__fields[0],
+ UPB_SIZE(4, 8), 1, false,
+};
+
+static const upb_msglayout_field envoy_config_cluster_v3_Cluster_OriginalDstLbConfig__fields[1] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 8, 1},
+};
+
+const upb_msglayout envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_msginit = {
+ NULL,
+ &envoy_config_cluster_v3_Cluster_OriginalDstLbConfig__fields[0],
+ UPB_SIZE(1, 1), 1, false,
+};
+
+static const upb_msglayout *const envoy_config_cluster_v3_Cluster_CommonLbConfig_submsgs[5] = {
+ &envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_msginit,
+ &envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig_msginit,
+ &envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_msginit,
+ &envoy_type_v3_Percent_msginit,
+ &google_protobuf_Duration_msginit,
+};
+
+static const upb_msglayout_field envoy_config_cluster_v3_Cluster_CommonLbConfig__fields[7] = {
+ {1, UPB_SIZE(4, 8), 0, 3, 11, 1},
+ {2, UPB_SIZE(16, 32), UPB_SIZE(-21, -41), 2, 11, 1},
+ {3, UPB_SIZE(16, 32), UPB_SIZE(-21, -41), 1, 11, 1},
+ {4, UPB_SIZE(8, 16), 0, 4, 11, 1},
+ {5, UPB_SIZE(0, 0), 0, 0, 8, 1},
+ {6, UPB_SIZE(1, 1), 0, 0, 8, 1},
+ {7, UPB_SIZE(12, 24), 0, 0, 11, 1},
+};
+
+const upb_msglayout envoy_config_cluster_v3_Cluster_CommonLbConfig_msginit = {
+ &envoy_config_cluster_v3_Cluster_CommonLbConfig_submsgs[0],
+ &envoy_config_cluster_v3_Cluster_CommonLbConfig__fields[0],
+ UPB_SIZE(24, 48), 7, false,
+};
+
+static const upb_msglayout *const envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_submsgs[2] = {
+ &envoy_type_v3_Percent_msginit,
+ &google_protobuf_UInt64Value_msginit,
+};
+
+static const upb_msglayout_field envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig__fields[3] = {
+ {1, UPB_SIZE(4, 8), 0, 0, 11, 1},
+ {2, UPB_SIZE(8, 16), 0, 1, 11, 1},
+ {3, UPB_SIZE(0, 0), 0, 0, 8, 1},
+};
+
+const upb_msglayout envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_msginit = {
+ &envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_submsgs[0],
+ &envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig__fields[0],
+ UPB_SIZE(12, 24), 3, false,
+};
+
+const upb_msglayout envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig_msginit = {
+ NULL,
+ NULL,
+ UPB_SIZE(0, 0), 0, false,
+};
+
+static const upb_msglayout *const envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_submsgs[1] = {
+ &google_protobuf_UInt32Value_msginit,
+};
+
+static const upb_msglayout_field envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 8, 1},
+ {2, UPB_SIZE(4, 8), 0, 0, 11, 1},
+};
+
+const upb_msglayout envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_msginit = {
+ &envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_submsgs[0],
+ &envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig__fields[0],
+ UPB_SIZE(8, 16), 2, false,
+};
+
+static const upb_msglayout *const envoy_config_cluster_v3_Cluster_RefreshRate_submsgs[2] = {
+ &google_protobuf_Duration_msginit,
+};
+
+static const upb_msglayout_field envoy_config_cluster_v3_Cluster_RefreshRate__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
+ {2, UPB_SIZE(4, 8), 0, 0, 11, 1},
+};
+
+const upb_msglayout envoy_config_cluster_v3_Cluster_RefreshRate_msginit = {
+ &envoy_config_cluster_v3_Cluster_RefreshRate_submsgs[0],
+ &envoy_config_cluster_v3_Cluster_RefreshRate__fields[0],
+ UPB_SIZE(8, 16), 2, false,
+};
+
+static const upb_msglayout *const envoy_config_cluster_v3_Cluster_PrefetchPolicy_submsgs[2] = {
+ &google_protobuf_DoubleValue_msginit,
+};
+
+static const upb_msglayout_field envoy_config_cluster_v3_Cluster_PrefetchPolicy__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
+ {2, UPB_SIZE(4, 8), 0, 0, 11, 1},
+};
+
+const upb_msglayout envoy_config_cluster_v3_Cluster_PrefetchPolicy_msginit = {
+ &envoy_config_cluster_v3_Cluster_PrefetchPolicy_submsgs[0],
+ &envoy_config_cluster_v3_Cluster_PrefetchPolicy__fields[0],
+ UPB_SIZE(8, 16), 2, false,
+};
+
+static const upb_msglayout *const envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry_submsgs[1] = {
+ &google_protobuf_Any_msginit,
+};
+
+static const upb_msglayout_field envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {2, UPB_SIZE(8, 16), 0, 0, 11, 1},
+};
+
+const upb_msglayout envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry_msginit = {
+ &envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry_submsgs[0],
+ &envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry__fields[0],
+ UPB_SIZE(16, 32), 2, false,
+};
+
+static const upb_msglayout *const envoy_config_cluster_v3_LoadBalancingPolicy_submsgs[1] = {
+ &envoy_config_cluster_v3_LoadBalancingPolicy_Policy_msginit,
+};
+
+static const upb_msglayout_field envoy_config_cluster_v3_LoadBalancingPolicy__fields[1] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 11, 3},
+};
+
+const upb_msglayout envoy_config_cluster_v3_LoadBalancingPolicy_msginit = {
+ &envoy_config_cluster_v3_LoadBalancingPolicy_submsgs[0],
+ &envoy_config_cluster_v3_LoadBalancingPolicy__fields[0],
+ UPB_SIZE(4, 8), 1, false,
+};
+
+static const upb_msglayout *const envoy_config_cluster_v3_LoadBalancingPolicy_Policy_submsgs[1] = {
+ &google_protobuf_Any_msginit,
+};
+
+static const upb_msglayout_field envoy_config_cluster_v3_LoadBalancingPolicy_Policy__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {3, UPB_SIZE(8, 16), 0, 0, 11, 1},
+};
+
+const upb_msglayout envoy_config_cluster_v3_LoadBalancingPolicy_Policy_msginit = {
+ &envoy_config_cluster_v3_LoadBalancingPolicy_Policy_submsgs[0],
+ &envoy_config_cluster_v3_LoadBalancingPolicy_Policy__fields[0],
+ UPB_SIZE(16, 32), 2, false,
+};
+
+static const upb_msglayout *const envoy_config_cluster_v3_UpstreamBindConfig_submsgs[1] = {
+ &envoy_config_core_v3_Address_msginit,
+};
+
+static const upb_msglayout_field envoy_config_cluster_v3_UpstreamBindConfig__fields[1] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
+};
+
+const upb_msglayout envoy_config_cluster_v3_UpstreamBindConfig_msginit = {
+ &envoy_config_cluster_v3_UpstreamBindConfig_submsgs[0],
+ &envoy_config_cluster_v3_UpstreamBindConfig__fields[0],
+ UPB_SIZE(4, 8), 1, false,
+};
+
+static const upb_msglayout *const envoy_config_cluster_v3_UpstreamConnectionOptions_submsgs[1] = {
+ &envoy_config_core_v3_TcpKeepalive_msginit,
+};
+
+static const upb_msglayout_field envoy_config_cluster_v3_UpstreamConnectionOptions__fields[1] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
+};
+
+const upb_msglayout envoy_config_cluster_v3_UpstreamConnectionOptions_msginit = {
+ &envoy_config_cluster_v3_UpstreamConnectionOptions_submsgs[0],
+ &envoy_config_cluster_v3_UpstreamConnectionOptions__fields[0],
+ UPB_SIZE(4, 8), 1, false,
+};
+
+static const upb_msglayout_field envoy_config_cluster_v3_TrackClusterStats__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 8, 1},
+ {2, UPB_SIZE(1, 1), 0, 0, 8, 1},
+};
+
+const upb_msglayout envoy_config_cluster_v3_TrackClusterStats_msginit = {
+ NULL,
+ &envoy_config_cluster_v3_TrackClusterStats__fields[0],
+ UPB_SIZE(2, 2), 2, false,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.h
index 33bf7a46f03..2108fd61ae1 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.h
@@ -1,1635 +1,1635 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/config/cluster/v3/cluster.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef ENVOY_CONFIG_CLUSTER_V3_CLUSTER_PROTO_UPB_H_
-#define ENVOY_CONFIG_CLUSTER_V3_CLUSTER_PROTO_UPB_H_
-
-#include "upb/msg.h"
-#include "upb/decode.h"
-#include "upb/encode.h"
-
-#include "upb/port_def.inc"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct envoy_config_cluster_v3_ClusterCollection;
-struct envoy_config_cluster_v3_Cluster;
-struct envoy_config_cluster_v3_Cluster_TransportSocketMatch;
-struct envoy_config_cluster_v3_Cluster_CustomClusterType;
-struct envoy_config_cluster_v3_Cluster_EdsClusterConfig;
-struct envoy_config_cluster_v3_Cluster_LbSubsetConfig;
-struct envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector;
-struct envoy_config_cluster_v3_Cluster_LeastRequestLbConfig;
-struct envoy_config_cluster_v3_Cluster_RingHashLbConfig;
-struct envoy_config_cluster_v3_Cluster_MaglevLbConfig;
-struct envoy_config_cluster_v3_Cluster_OriginalDstLbConfig;
-struct envoy_config_cluster_v3_Cluster_CommonLbConfig;
-struct envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig;
-struct envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig;
-struct envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig;
-struct envoy_config_cluster_v3_Cluster_RefreshRate;
-struct envoy_config_cluster_v3_Cluster_PrefetchPolicy;
-struct envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry;
-struct envoy_config_cluster_v3_LoadBalancingPolicy;
-struct envoy_config_cluster_v3_LoadBalancingPolicy_Policy;
-struct envoy_config_cluster_v3_UpstreamBindConfig;
-struct envoy_config_cluster_v3_UpstreamConnectionOptions;
-struct envoy_config_cluster_v3_TrackClusterStats;
-typedef struct envoy_config_cluster_v3_ClusterCollection envoy_config_cluster_v3_ClusterCollection;
-typedef struct envoy_config_cluster_v3_Cluster envoy_config_cluster_v3_Cluster;
-typedef struct envoy_config_cluster_v3_Cluster_TransportSocketMatch envoy_config_cluster_v3_Cluster_TransportSocketMatch;
-typedef struct envoy_config_cluster_v3_Cluster_CustomClusterType envoy_config_cluster_v3_Cluster_CustomClusterType;
-typedef struct envoy_config_cluster_v3_Cluster_EdsClusterConfig envoy_config_cluster_v3_Cluster_EdsClusterConfig;
-typedef struct envoy_config_cluster_v3_Cluster_LbSubsetConfig envoy_config_cluster_v3_Cluster_LbSubsetConfig;
-typedef struct envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector;
-typedef struct envoy_config_cluster_v3_Cluster_LeastRequestLbConfig envoy_config_cluster_v3_Cluster_LeastRequestLbConfig;
-typedef struct envoy_config_cluster_v3_Cluster_RingHashLbConfig envoy_config_cluster_v3_Cluster_RingHashLbConfig;
-typedef struct envoy_config_cluster_v3_Cluster_MaglevLbConfig envoy_config_cluster_v3_Cluster_MaglevLbConfig;
-typedef struct envoy_config_cluster_v3_Cluster_OriginalDstLbConfig envoy_config_cluster_v3_Cluster_OriginalDstLbConfig;
-typedef struct envoy_config_cluster_v3_Cluster_CommonLbConfig envoy_config_cluster_v3_Cluster_CommonLbConfig;
-typedef struct envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig;
-typedef struct envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig;
-typedef struct envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig;
-typedef struct envoy_config_cluster_v3_Cluster_RefreshRate envoy_config_cluster_v3_Cluster_RefreshRate;
-typedef struct envoy_config_cluster_v3_Cluster_PrefetchPolicy envoy_config_cluster_v3_Cluster_PrefetchPolicy;
-typedef struct envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry;
-typedef struct envoy_config_cluster_v3_LoadBalancingPolicy envoy_config_cluster_v3_LoadBalancingPolicy;
-typedef struct envoy_config_cluster_v3_LoadBalancingPolicy_Policy envoy_config_cluster_v3_LoadBalancingPolicy_Policy;
-typedef struct envoy_config_cluster_v3_UpstreamBindConfig envoy_config_cluster_v3_UpstreamBindConfig;
-typedef struct envoy_config_cluster_v3_UpstreamConnectionOptions envoy_config_cluster_v3_UpstreamConnectionOptions;
-typedef struct envoy_config_cluster_v3_TrackClusterStats envoy_config_cluster_v3_TrackClusterStats;
-extern const upb_msglayout envoy_config_cluster_v3_ClusterCollection_msginit;
-extern const upb_msglayout envoy_config_cluster_v3_Cluster_msginit;
-extern const upb_msglayout envoy_config_cluster_v3_Cluster_TransportSocketMatch_msginit;
-extern const upb_msglayout envoy_config_cluster_v3_Cluster_CustomClusterType_msginit;
-extern const upb_msglayout envoy_config_cluster_v3_Cluster_EdsClusterConfig_msginit;
-extern const upb_msglayout envoy_config_cluster_v3_Cluster_LbSubsetConfig_msginit;
-extern const upb_msglayout envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_msginit;
-extern const upb_msglayout envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_msginit;
-extern const upb_msglayout envoy_config_cluster_v3_Cluster_RingHashLbConfig_msginit;
-extern const upb_msglayout envoy_config_cluster_v3_Cluster_MaglevLbConfig_msginit;
-extern const upb_msglayout envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_msginit;
-extern const upb_msglayout envoy_config_cluster_v3_Cluster_CommonLbConfig_msginit;
-extern const upb_msglayout envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_msginit;
-extern const upb_msglayout envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig_msginit;
-extern const upb_msglayout envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_msginit;
-extern const upb_msglayout envoy_config_cluster_v3_Cluster_RefreshRate_msginit;
-extern const upb_msglayout envoy_config_cluster_v3_Cluster_PrefetchPolicy_msginit;
-extern const upb_msglayout envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry_msginit;
-extern const upb_msglayout envoy_config_cluster_v3_LoadBalancingPolicy_msginit;
-extern const upb_msglayout envoy_config_cluster_v3_LoadBalancingPolicy_Policy_msginit;
-extern const upb_msglayout envoy_config_cluster_v3_UpstreamBindConfig_msginit;
-extern const upb_msglayout envoy_config_cluster_v3_UpstreamConnectionOptions_msginit;
-extern const upb_msglayout envoy_config_cluster_v3_TrackClusterStats_msginit;
-struct envoy_config_cluster_v3_CircuitBreakers;
-struct envoy_config_cluster_v3_Filter;
-struct envoy_config_cluster_v3_OutlierDetection;
-struct envoy_config_core_v3_Address;
-struct envoy_config_core_v3_BindConfig;
-struct envoy_config_core_v3_ConfigSource;
-struct envoy_config_core_v3_HealthCheck;
-struct envoy_config_core_v3_Http1ProtocolOptions;
-struct envoy_config_core_v3_Http2ProtocolOptions;
-struct envoy_config_core_v3_HttpProtocolOptions;
-struct envoy_config_core_v3_Metadata;
-struct envoy_config_core_v3_RuntimeDouble;
-struct envoy_config_core_v3_TcpKeepalive;
-struct envoy_config_core_v3_TransportSocket;
-struct envoy_config_core_v3_TypedExtensionConfig;
-struct envoy_config_core_v3_UpstreamHttpProtocolOptions;
-struct envoy_config_endpoint_v3_ClusterLoadAssignment;
-struct envoy_type_v3_Percent;
-struct google_protobuf_Any;
-struct google_protobuf_DoubleValue;
-struct google_protobuf_Duration;
-struct google_protobuf_Struct;
-struct google_protobuf_UInt32Value;
-struct google_protobuf_UInt64Value;
-struct udpa_core_v1_CollectionEntry;
-struct udpa_core_v1_ResourceLocator;
-extern const upb_msglayout envoy_config_cluster_v3_CircuitBreakers_msginit;
-extern const upb_msglayout envoy_config_cluster_v3_Filter_msginit;
-extern const upb_msglayout envoy_config_cluster_v3_OutlierDetection_msginit;
-extern const upb_msglayout envoy_config_core_v3_Address_msginit;
-extern const upb_msglayout envoy_config_core_v3_BindConfig_msginit;
-extern const upb_msglayout envoy_config_core_v3_ConfigSource_msginit;
-extern const upb_msglayout envoy_config_core_v3_HealthCheck_msginit;
-extern const upb_msglayout envoy_config_core_v3_Http1ProtocolOptions_msginit;
-extern const upb_msglayout envoy_config_core_v3_Http2ProtocolOptions_msginit;
-extern const upb_msglayout envoy_config_core_v3_HttpProtocolOptions_msginit;
-extern const upb_msglayout envoy_config_core_v3_Metadata_msginit;
-extern const upb_msglayout envoy_config_core_v3_RuntimeDouble_msginit;
-extern const upb_msglayout envoy_config_core_v3_TcpKeepalive_msginit;
-extern const upb_msglayout envoy_config_core_v3_TransportSocket_msginit;
-extern const upb_msglayout envoy_config_core_v3_TypedExtensionConfig_msginit;
-extern const upb_msglayout envoy_config_core_v3_UpstreamHttpProtocolOptions_msginit;
-extern const upb_msglayout envoy_config_endpoint_v3_ClusterLoadAssignment_msginit;
-extern const upb_msglayout envoy_type_v3_Percent_msginit;
-extern const upb_msglayout google_protobuf_Any_msginit;
-extern const upb_msglayout google_protobuf_DoubleValue_msginit;
-extern const upb_msglayout google_protobuf_Duration_msginit;
-extern const upb_msglayout google_protobuf_Struct_msginit;
-extern const upb_msglayout google_protobuf_UInt32Value_msginit;
-extern const upb_msglayout google_protobuf_UInt64Value_msginit;
-extern const upb_msglayout udpa_core_v1_CollectionEntry_msginit;
-extern const upb_msglayout udpa_core_v1_ResourceLocator_msginit;
-
-typedef enum {
- envoy_config_cluster_v3_Cluster_USE_CONFIGURED_PROTOCOL = 0,
- envoy_config_cluster_v3_Cluster_USE_DOWNSTREAM_PROTOCOL = 1
-} envoy_config_cluster_v3_Cluster_ClusterProtocolSelection;
-
-typedef enum {
- envoy_config_cluster_v3_Cluster_STATIC = 0,
- envoy_config_cluster_v3_Cluster_STRICT_DNS = 1,
- envoy_config_cluster_v3_Cluster_LOGICAL_DNS = 2,
- envoy_config_cluster_v3_Cluster_EDS = 3,
- envoy_config_cluster_v3_Cluster_ORIGINAL_DST = 4
-} envoy_config_cluster_v3_Cluster_DiscoveryType;
-
-typedef enum {
- envoy_config_cluster_v3_Cluster_AUTO = 0,
- envoy_config_cluster_v3_Cluster_V4_ONLY = 1,
- envoy_config_cluster_v3_Cluster_V6_ONLY = 2
-} envoy_config_cluster_v3_Cluster_DnsLookupFamily;
-
-typedef enum {
- envoy_config_cluster_v3_Cluster_ROUND_ROBIN = 0,
- envoy_config_cluster_v3_Cluster_LEAST_REQUEST = 1,
- envoy_config_cluster_v3_Cluster_RING_HASH = 2,
- envoy_config_cluster_v3_Cluster_RANDOM = 3,
- envoy_config_cluster_v3_Cluster_MAGLEV = 5,
- envoy_config_cluster_v3_Cluster_CLUSTER_PROVIDED = 6,
- envoy_config_cluster_v3_Cluster_LOAD_BALANCING_POLICY_CONFIG = 7
-} envoy_config_cluster_v3_Cluster_LbPolicy;
-
-typedef enum {
- envoy_config_cluster_v3_Cluster_LbSubsetConfig_NO_FALLBACK = 0,
- envoy_config_cluster_v3_Cluster_LbSubsetConfig_ANY_ENDPOINT = 1,
- envoy_config_cluster_v3_Cluster_LbSubsetConfig_DEFAULT_SUBSET = 2
-} envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetFallbackPolicy;
-
-typedef enum {
- envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_NOT_DEFINED = 0,
- envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_NO_FALLBACK = 1,
- envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_ANY_ENDPOINT = 2,
- envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_DEFAULT_SUBSET = 3,
- envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_KEYS_SUBSET = 4
-} envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_LbSubsetSelectorFallbackPolicy;
-
-typedef enum {
- envoy_config_cluster_v3_Cluster_RingHashLbConfig_XX_HASH = 0,
- envoy_config_cluster_v3_Cluster_RingHashLbConfig_MURMUR_HASH_2 = 1
-} envoy_config_cluster_v3_Cluster_RingHashLbConfig_HashFunction;
-
-
-/* envoy.config.cluster.v3.ClusterCollection */
-
-UPB_INLINE envoy_config_cluster_v3_ClusterCollection *envoy_config_cluster_v3_ClusterCollection_new(upb_arena *arena) {
- return (envoy_config_cluster_v3_ClusterCollection *)_upb_msg_new(&envoy_config_cluster_v3_ClusterCollection_msginit, arena);
-}
-UPB_INLINE envoy_config_cluster_v3_ClusterCollection *envoy_config_cluster_v3_ClusterCollection_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_cluster_v3_ClusterCollection *ret = envoy_config_cluster_v3_ClusterCollection_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_cluster_v3_ClusterCollection_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_cluster_v3_ClusterCollection_serialize(const envoy_config_cluster_v3_ClusterCollection *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_cluster_v3_ClusterCollection_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_config_cluster_v3_ClusterCollection_has_entries(const envoy_config_cluster_v3_ClusterCollection *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE const struct udpa_core_v1_CollectionEntry* envoy_config_cluster_v3_ClusterCollection_entries(const envoy_config_cluster_v3_ClusterCollection *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct udpa_core_v1_CollectionEntry*); }
-
-UPB_INLINE void envoy_config_cluster_v3_ClusterCollection_set_entries(envoy_config_cluster_v3_ClusterCollection *msg, struct udpa_core_v1_CollectionEntry* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct udpa_core_v1_CollectionEntry*) = value;
-}
-UPB_INLINE struct udpa_core_v1_CollectionEntry* envoy_config_cluster_v3_ClusterCollection_mutable_entries(envoy_config_cluster_v3_ClusterCollection *msg, upb_arena *arena) {
- struct udpa_core_v1_CollectionEntry* sub = (struct udpa_core_v1_CollectionEntry*)envoy_config_cluster_v3_ClusterCollection_entries(msg);
- if (sub == NULL) {
- sub = (struct udpa_core_v1_CollectionEntry*)_upb_msg_new(&udpa_core_v1_CollectionEntry_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_ClusterCollection_set_entries(msg, sub);
- }
- return sub;
-}
-
-/* envoy.config.cluster.v3.Cluster */
-
-UPB_INLINE envoy_config_cluster_v3_Cluster *envoy_config_cluster_v3_Cluster_new(upb_arena *arena) {
- return (envoy_config_cluster_v3_Cluster *)_upb_msg_new(&envoy_config_cluster_v3_Cluster_msginit, arena);
-}
-UPB_INLINE envoy_config_cluster_v3_Cluster *envoy_config_cluster_v3_Cluster_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_cluster_v3_Cluster *ret = envoy_config_cluster_v3_Cluster_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_cluster_v3_Cluster_serialize(const envoy_config_cluster_v3_Cluster *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_cluster_v3_Cluster_msginit, arena, len);
-}
-
-typedef enum {
- envoy_config_cluster_v3_Cluster_cluster_discovery_type_type = 2,
- envoy_config_cluster_v3_Cluster_cluster_discovery_type_cluster_type = 38,
- envoy_config_cluster_v3_Cluster_cluster_discovery_type_NOT_SET = 0
-} envoy_config_cluster_v3_Cluster_cluster_discovery_type_oneofcases;
-UPB_INLINE envoy_config_cluster_v3_Cluster_cluster_discovery_type_oneofcases envoy_config_cluster_v3_Cluster_cluster_discovery_type_case(const envoy_config_cluster_v3_Cluster* msg) { return (envoy_config_cluster_v3_Cluster_cluster_discovery_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(176, 312), int32_t); }
-
-typedef enum {
- envoy_config_cluster_v3_Cluster_lb_config_ring_hash_lb_config = 23,
- envoy_config_cluster_v3_Cluster_lb_config_maglev_lb_config = 52,
- envoy_config_cluster_v3_Cluster_lb_config_original_dst_lb_config = 34,
- envoy_config_cluster_v3_Cluster_lb_config_least_request_lb_config = 37,
- envoy_config_cluster_v3_Cluster_lb_config_NOT_SET = 0
-} envoy_config_cluster_v3_Cluster_lb_config_oneofcases;
-UPB_INLINE envoy_config_cluster_v3_Cluster_lb_config_oneofcases envoy_config_cluster_v3_Cluster_lb_config_case(const envoy_config_cluster_v3_Cluster* msg) { return (envoy_config_cluster_v3_Cluster_lb_config_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(184, 328), int32_t); }
-
-UPB_INLINE upb_strview envoy_config_cluster_v3_Cluster_name(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 32), upb_strview); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_type(const envoy_config_cluster_v3_Cluster *msg) { return _upb_getoneofcase(msg, UPB_SIZE(176, 312)) == 2; }
-UPB_INLINE int32_t envoy_config_cluster_v3_Cluster_type(const envoy_config_cluster_v3_Cluster *msg) { return UPB_READ_ONEOF(msg, int32_t, UPB_SIZE(168, 304), UPB_SIZE(176, 312), 2, 0); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_eds_cluster_config(const envoy_config_cluster_v3_Cluster *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(48, 64)); }
-UPB_INLINE const envoy_config_cluster_v3_Cluster_EdsClusterConfig* envoy_config_cluster_v3_Cluster_eds_cluster_config(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(48, 64), const envoy_config_cluster_v3_Cluster_EdsClusterConfig*); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_connect_timeout(const envoy_config_cluster_v3_Cluster *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(52, 72)); }
-UPB_INLINE const struct google_protobuf_Duration* envoy_config_cluster_v3_Cluster_connect_timeout(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(52, 72), const struct google_protobuf_Duration*); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_per_connection_buffer_limit_bytes(const envoy_config_cluster_v3_Cluster *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(56, 80)); }
-UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_Cluster_per_connection_buffer_limit_bytes(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(56, 80), const struct google_protobuf_UInt32Value*); }
-UPB_INLINE int32_t envoy_config_cluster_v3_Cluster_lb_policy(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_health_checks(const envoy_config_cluster_v3_Cluster *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(148, 264)); }
-UPB_INLINE const struct envoy_config_core_v3_HealthCheck* const* envoy_config_cluster_v3_Cluster_health_checks(const envoy_config_cluster_v3_Cluster *msg, size_t *len) { return (const struct envoy_config_core_v3_HealthCheck* const*)_upb_array_accessor(msg, UPB_SIZE(148, 264), len); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_max_requests_per_connection(const envoy_config_cluster_v3_Cluster *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(60, 88)); }
-UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_Cluster_max_requests_per_connection(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(60, 88), const struct google_protobuf_UInt32Value*); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_circuit_breakers(const envoy_config_cluster_v3_Cluster *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(64, 96)); }
-UPB_INLINE const struct envoy_config_cluster_v3_CircuitBreakers* envoy_config_cluster_v3_Cluster_circuit_breakers(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(64, 96), const struct envoy_config_cluster_v3_CircuitBreakers*); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_http_protocol_options(const envoy_config_cluster_v3_Cluster *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(68, 104)); }
-UPB_INLINE const struct envoy_config_core_v3_Http1ProtocolOptions* envoy_config_cluster_v3_Cluster_http_protocol_options(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(68, 104), const struct envoy_config_core_v3_Http1ProtocolOptions*); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_http2_protocol_options(const envoy_config_cluster_v3_Cluster *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(72, 112)); }
-UPB_INLINE const struct envoy_config_core_v3_Http2ProtocolOptions* envoy_config_cluster_v3_Cluster_http2_protocol_options(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(72, 112), const struct envoy_config_core_v3_Http2ProtocolOptions*); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_dns_refresh_rate(const envoy_config_cluster_v3_Cluster *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(76, 120)); }
-UPB_INLINE const struct google_protobuf_Duration* envoy_config_cluster_v3_Cluster_dns_refresh_rate(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(76, 120), const struct google_protobuf_Duration*); }
-UPB_INLINE int32_t envoy_config_cluster_v3_Cluster_dns_lookup_family(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_dns_resolvers(const envoy_config_cluster_v3_Cluster *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(152, 272)); }
-UPB_INLINE const struct envoy_config_core_v3_Address* const* envoy_config_cluster_v3_Cluster_dns_resolvers(const envoy_config_cluster_v3_Cluster *msg, size_t *len) { return (const struct envoy_config_core_v3_Address* const*)_upb_array_accessor(msg, UPB_SIZE(152, 272), len); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_outlier_detection(const envoy_config_cluster_v3_Cluster *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(80, 128)); }
-UPB_INLINE const struct envoy_config_cluster_v3_OutlierDetection* envoy_config_cluster_v3_Cluster_outlier_detection(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(80, 128), const struct envoy_config_cluster_v3_OutlierDetection*); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_cleanup_interval(const envoy_config_cluster_v3_Cluster *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(84, 136)); }
-UPB_INLINE const struct google_protobuf_Duration* envoy_config_cluster_v3_Cluster_cleanup_interval(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(84, 136), const struct google_protobuf_Duration*); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_upstream_bind_config(const envoy_config_cluster_v3_Cluster *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(88, 144)); }
-UPB_INLINE const struct envoy_config_core_v3_BindConfig* envoy_config_cluster_v3_Cluster_upstream_bind_config(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(88, 144), const struct envoy_config_core_v3_BindConfig*); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_lb_subset_config(const envoy_config_cluster_v3_Cluster *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(92, 152)); }
-UPB_INLINE const envoy_config_cluster_v3_Cluster_LbSubsetConfig* envoy_config_cluster_v3_Cluster_lb_subset_config(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(92, 152), const envoy_config_cluster_v3_Cluster_LbSubsetConfig*); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_ring_hash_lb_config(const envoy_config_cluster_v3_Cluster *msg) { return _upb_getoneofcase(msg, UPB_SIZE(184, 328)) == 23; }
-UPB_INLINE const envoy_config_cluster_v3_Cluster_RingHashLbConfig* envoy_config_cluster_v3_Cluster_ring_hash_lb_config(const envoy_config_cluster_v3_Cluster *msg) { return UPB_READ_ONEOF(msg, const envoy_config_cluster_v3_Cluster_RingHashLbConfig*, UPB_SIZE(180, 320), UPB_SIZE(184, 328), 23, NULL); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_transport_socket(const envoy_config_cluster_v3_Cluster *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(96, 160)); }
-UPB_INLINE const struct envoy_config_core_v3_TransportSocket* envoy_config_cluster_v3_Cluster_transport_socket(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(96, 160), const struct envoy_config_core_v3_TransportSocket*); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_metadata(const envoy_config_cluster_v3_Cluster *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(100, 168)); }
-UPB_INLINE const struct envoy_config_core_v3_Metadata* envoy_config_cluster_v3_Cluster_metadata(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(100, 168), const struct envoy_config_core_v3_Metadata*); }
-UPB_INLINE int32_t envoy_config_cluster_v3_Cluster_protocol_selection(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_common_lb_config(const envoy_config_cluster_v3_Cluster *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(104, 176)); }
-UPB_INLINE const envoy_config_cluster_v3_Cluster_CommonLbConfig* envoy_config_cluster_v3_Cluster_common_lb_config(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(104, 176), const envoy_config_cluster_v3_Cluster_CommonLbConfig*); }
-UPB_INLINE upb_strview envoy_config_cluster_v3_Cluster_alt_stat_name(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(40, 48), upb_strview); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_common_http_protocol_options(const envoy_config_cluster_v3_Cluster *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(108, 184)); }
-UPB_INLINE const struct envoy_config_core_v3_HttpProtocolOptions* envoy_config_cluster_v3_Cluster_common_http_protocol_options(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(108, 184), const struct envoy_config_core_v3_HttpProtocolOptions*); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_upstream_connection_options(const envoy_config_cluster_v3_Cluster *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(112, 192)); }
-UPB_INLINE const envoy_config_cluster_v3_UpstreamConnectionOptions* envoy_config_cluster_v3_Cluster_upstream_connection_options(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(112, 192), const envoy_config_cluster_v3_UpstreamConnectionOptions*); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_close_connections_on_host_health_failure(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_ignore_health_on_host_removal(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(25, 25), bool); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_load_assignment(const envoy_config_cluster_v3_Cluster *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(116, 200)); }
-UPB_INLINE const struct envoy_config_endpoint_v3_ClusterLoadAssignment* envoy_config_cluster_v3_Cluster_load_assignment(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(116, 200), const struct envoy_config_endpoint_v3_ClusterLoadAssignment*); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_original_dst_lb_config(const envoy_config_cluster_v3_Cluster *msg) { return _upb_getoneofcase(msg, UPB_SIZE(184, 328)) == 34; }
-UPB_INLINE const envoy_config_cluster_v3_Cluster_OriginalDstLbConfig* envoy_config_cluster_v3_Cluster_original_dst_lb_config(const envoy_config_cluster_v3_Cluster *msg) { return UPB_READ_ONEOF(msg, const envoy_config_cluster_v3_Cluster_OriginalDstLbConfig*, UPB_SIZE(180, 320), UPB_SIZE(184, 328), 34, NULL); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_typed_extension_protocol_options(const envoy_config_cluster_v3_Cluster *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(156, 280)); }
-UPB_INLINE size_t envoy_config_cluster_v3_Cluster_typed_extension_protocol_options_size(const envoy_config_cluster_v3_Cluster *msg) {return _upb_msg_map_size(msg, UPB_SIZE(156, 280)); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_typed_extension_protocol_options_get(const envoy_config_cluster_v3_Cluster *msg, upb_strview key, struct google_protobuf_Any* *val) { return _upb_msg_map_get(msg, UPB_SIZE(156, 280), &key, 0, val, sizeof(*val)); }
-UPB_INLINE const envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry* envoy_config_cluster_v3_Cluster_typed_extension_protocol_options_next(const envoy_config_cluster_v3_Cluster *msg, size_t* iter) { return (const envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry*)_upb_msg_map_next(msg, UPB_SIZE(156, 280), iter); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_least_request_lb_config(const envoy_config_cluster_v3_Cluster *msg) { return _upb_getoneofcase(msg, UPB_SIZE(184, 328)) == 37; }
-UPB_INLINE const envoy_config_cluster_v3_Cluster_LeastRequestLbConfig* envoy_config_cluster_v3_Cluster_least_request_lb_config(const envoy_config_cluster_v3_Cluster *msg) { return UPB_READ_ONEOF(msg, const envoy_config_cluster_v3_Cluster_LeastRequestLbConfig*, UPB_SIZE(180, 320), UPB_SIZE(184, 328), 37, NULL); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_cluster_type(const envoy_config_cluster_v3_Cluster *msg) { return _upb_getoneofcase(msg, UPB_SIZE(176, 312)) == 38; }
-UPB_INLINE const envoy_config_cluster_v3_Cluster_CustomClusterType* envoy_config_cluster_v3_Cluster_cluster_type(const envoy_config_cluster_v3_Cluster *msg) { return UPB_READ_ONEOF(msg, const envoy_config_cluster_v3_Cluster_CustomClusterType*, UPB_SIZE(168, 304), UPB_SIZE(176, 312), 38, NULL); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_respect_dns_ttl(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(26, 26), bool); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_filters(const envoy_config_cluster_v3_Cluster *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(160, 288)); }
-UPB_INLINE const struct envoy_config_cluster_v3_Filter* const* envoy_config_cluster_v3_Cluster_filters(const envoy_config_cluster_v3_Cluster *msg, size_t *len) { return (const struct envoy_config_cluster_v3_Filter* const*)_upb_array_accessor(msg, UPB_SIZE(160, 288), len); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_load_balancing_policy(const envoy_config_cluster_v3_Cluster *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(120, 208)); }
-UPB_INLINE const envoy_config_cluster_v3_LoadBalancingPolicy* envoy_config_cluster_v3_Cluster_load_balancing_policy(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(120, 208), const envoy_config_cluster_v3_LoadBalancingPolicy*); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_lrs_server(const envoy_config_cluster_v3_Cluster *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(124, 216)); }
-UPB_INLINE const struct envoy_config_core_v3_ConfigSource* envoy_config_cluster_v3_Cluster_lrs_server(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(124, 216), const struct envoy_config_core_v3_ConfigSource*); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_transport_socket_matches(const envoy_config_cluster_v3_Cluster *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(164, 296)); }
-UPB_INLINE const envoy_config_cluster_v3_Cluster_TransportSocketMatch* const* envoy_config_cluster_v3_Cluster_transport_socket_matches(const envoy_config_cluster_v3_Cluster *msg, size_t *len) { return (const envoy_config_cluster_v3_Cluster_TransportSocketMatch* const*)_upb_array_accessor(msg, UPB_SIZE(164, 296), len); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_dns_failure_refresh_rate(const envoy_config_cluster_v3_Cluster *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(128, 224)); }
-UPB_INLINE const envoy_config_cluster_v3_Cluster_RefreshRate* envoy_config_cluster_v3_Cluster_dns_failure_refresh_rate(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(128, 224), const envoy_config_cluster_v3_Cluster_RefreshRate*); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_use_tcp_for_dns_lookups(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(27, 27), bool); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_upstream_http_protocol_options(const envoy_config_cluster_v3_Cluster *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(132, 232)); }
-UPB_INLINE const struct envoy_config_core_v3_UpstreamHttpProtocolOptions* envoy_config_cluster_v3_Cluster_upstream_http_protocol_options(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(132, 232), const struct envoy_config_core_v3_UpstreamHttpProtocolOptions*); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_track_timeout_budgets(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 28), bool); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_upstream_config(const envoy_config_cluster_v3_Cluster *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(136, 240)); }
-UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_cluster_v3_Cluster_upstream_config(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(136, 240), const struct envoy_config_core_v3_TypedExtensionConfig*); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_track_cluster_stats(const envoy_config_cluster_v3_Cluster *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(140, 248)); }
-UPB_INLINE const envoy_config_cluster_v3_TrackClusterStats* envoy_config_cluster_v3_Cluster_track_cluster_stats(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(140, 248), const envoy_config_cluster_v3_TrackClusterStats*); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_prefetch_policy(const envoy_config_cluster_v3_Cluster *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(144, 256)); }
-UPB_INLINE const envoy_config_cluster_v3_Cluster_PrefetchPolicy* envoy_config_cluster_v3_Cluster_prefetch_policy(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(144, 256), const envoy_config_cluster_v3_Cluster_PrefetchPolicy*); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_connection_pool_per_downstream_connection(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(29, 29), bool); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_maglev_lb_config(const envoy_config_cluster_v3_Cluster *msg) { return _upb_getoneofcase(msg, UPB_SIZE(184, 328)) == 52; }
-UPB_INLINE const envoy_config_cluster_v3_Cluster_MaglevLbConfig* envoy_config_cluster_v3_Cluster_maglev_lb_config(const envoy_config_cluster_v3_Cluster *msg) { return UPB_READ_ONEOF(msg, const envoy_config_cluster_v3_Cluster_MaglevLbConfig*, UPB_SIZE(180, 320), UPB_SIZE(184, 328), 52, NULL); }
-
-UPB_INLINE void envoy_config_cluster_v3_Cluster_set_name(envoy_config_cluster_v3_Cluster *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(32, 32), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_cluster_v3_Cluster_set_type(envoy_config_cluster_v3_Cluster *msg, int32_t value) {
- UPB_WRITE_ONEOF(msg, int32_t, UPB_SIZE(168, 304), value, UPB_SIZE(176, 312), 2);
-}
-UPB_INLINE void envoy_config_cluster_v3_Cluster_set_eds_cluster_config(envoy_config_cluster_v3_Cluster *msg, envoy_config_cluster_v3_Cluster_EdsClusterConfig* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(48, 64), envoy_config_cluster_v3_Cluster_EdsClusterConfig*) = value;
-}
-UPB_INLINE struct envoy_config_cluster_v3_Cluster_EdsClusterConfig* envoy_config_cluster_v3_Cluster_mutable_eds_cluster_config(envoy_config_cluster_v3_Cluster *msg, upb_arena *arena) {
- struct envoy_config_cluster_v3_Cluster_EdsClusterConfig* sub = (struct envoy_config_cluster_v3_Cluster_EdsClusterConfig*)envoy_config_cluster_v3_Cluster_eds_cluster_config(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_cluster_v3_Cluster_EdsClusterConfig*)_upb_msg_new(&envoy_config_cluster_v3_Cluster_EdsClusterConfig_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_Cluster_set_eds_cluster_config(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_cluster_v3_Cluster_set_connect_timeout(envoy_config_cluster_v3_Cluster *msg, struct google_protobuf_Duration* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(52, 72), struct google_protobuf_Duration*) = value;
-}
-UPB_INLINE struct google_protobuf_Duration* envoy_config_cluster_v3_Cluster_mutable_connect_timeout(envoy_config_cluster_v3_Cluster *msg, upb_arena *arena) {
- struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_cluster_v3_Cluster_connect_timeout(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_Cluster_set_connect_timeout(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_cluster_v3_Cluster_set_per_connection_buffer_limit_bytes(envoy_config_cluster_v3_Cluster *msg, struct google_protobuf_UInt32Value* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(56, 80), struct google_protobuf_UInt32Value*) = value;
-}
-UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_Cluster_mutable_per_connection_buffer_limit_bytes(envoy_config_cluster_v3_Cluster *msg, upb_arena *arena) {
- struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_cluster_v3_Cluster_per_connection_buffer_limit_bytes(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_Cluster_set_per_connection_buffer_limit_bytes(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_cluster_v3_Cluster_set_lb_policy(envoy_config_cluster_v3_Cluster *msg, int32_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
-}
-UPB_INLINE struct envoy_config_core_v3_HealthCheck** envoy_config_cluster_v3_Cluster_mutable_health_checks(envoy_config_cluster_v3_Cluster *msg, size_t *len) {
- return (struct envoy_config_core_v3_HealthCheck**)_upb_array_mutable_accessor(msg, UPB_SIZE(148, 264), len);
-}
-UPB_INLINE struct envoy_config_core_v3_HealthCheck** envoy_config_cluster_v3_Cluster_resize_health_checks(envoy_config_cluster_v3_Cluster *msg, size_t len, upb_arena *arena) {
- return (struct envoy_config_core_v3_HealthCheck**)_upb_array_resize_accessor(msg, UPB_SIZE(148, 264), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_config_core_v3_HealthCheck* envoy_config_cluster_v3_Cluster_add_health_checks(envoy_config_cluster_v3_Cluster *msg, upb_arena *arena) {
- struct envoy_config_core_v3_HealthCheck* sub = (struct envoy_config_core_v3_HealthCheck*)_upb_msg_new(&envoy_config_core_v3_HealthCheck_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(148, 264), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-UPB_INLINE void envoy_config_cluster_v3_Cluster_set_max_requests_per_connection(envoy_config_cluster_v3_Cluster *msg, struct google_protobuf_UInt32Value* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(60, 88), struct google_protobuf_UInt32Value*) = value;
-}
-UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_Cluster_mutable_max_requests_per_connection(envoy_config_cluster_v3_Cluster *msg, upb_arena *arena) {
- struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_cluster_v3_Cluster_max_requests_per_connection(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_Cluster_set_max_requests_per_connection(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_cluster_v3_Cluster_set_circuit_breakers(envoy_config_cluster_v3_Cluster *msg, struct envoy_config_cluster_v3_CircuitBreakers* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(64, 96), struct envoy_config_cluster_v3_CircuitBreakers*) = value;
-}
-UPB_INLINE struct envoy_config_cluster_v3_CircuitBreakers* envoy_config_cluster_v3_Cluster_mutable_circuit_breakers(envoy_config_cluster_v3_Cluster *msg, upb_arena *arena) {
- struct envoy_config_cluster_v3_CircuitBreakers* sub = (struct envoy_config_cluster_v3_CircuitBreakers*)envoy_config_cluster_v3_Cluster_circuit_breakers(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_cluster_v3_CircuitBreakers*)_upb_msg_new(&envoy_config_cluster_v3_CircuitBreakers_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_Cluster_set_circuit_breakers(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_cluster_v3_Cluster_set_http_protocol_options(envoy_config_cluster_v3_Cluster *msg, struct envoy_config_core_v3_Http1ProtocolOptions* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(68, 104), struct envoy_config_core_v3_Http1ProtocolOptions*) = value;
-}
-UPB_INLINE struct envoy_config_core_v3_Http1ProtocolOptions* envoy_config_cluster_v3_Cluster_mutable_http_protocol_options(envoy_config_cluster_v3_Cluster *msg, upb_arena *arena) {
- struct envoy_config_core_v3_Http1ProtocolOptions* sub = (struct envoy_config_core_v3_Http1ProtocolOptions*)envoy_config_cluster_v3_Cluster_http_protocol_options(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_Http1ProtocolOptions*)_upb_msg_new(&envoy_config_core_v3_Http1ProtocolOptions_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_Cluster_set_http_protocol_options(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_cluster_v3_Cluster_set_http2_protocol_options(envoy_config_cluster_v3_Cluster *msg, struct envoy_config_core_v3_Http2ProtocolOptions* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(72, 112), struct envoy_config_core_v3_Http2ProtocolOptions*) = value;
-}
-UPB_INLINE struct envoy_config_core_v3_Http2ProtocolOptions* envoy_config_cluster_v3_Cluster_mutable_http2_protocol_options(envoy_config_cluster_v3_Cluster *msg, upb_arena *arena) {
- struct envoy_config_core_v3_Http2ProtocolOptions* sub = (struct envoy_config_core_v3_Http2ProtocolOptions*)envoy_config_cluster_v3_Cluster_http2_protocol_options(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_Http2ProtocolOptions*)_upb_msg_new(&envoy_config_core_v3_Http2ProtocolOptions_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_Cluster_set_http2_protocol_options(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_cluster_v3_Cluster_set_dns_refresh_rate(envoy_config_cluster_v3_Cluster *msg, struct google_protobuf_Duration* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(76, 120), struct google_protobuf_Duration*) = value;
-}
-UPB_INLINE struct google_protobuf_Duration* envoy_config_cluster_v3_Cluster_mutable_dns_refresh_rate(envoy_config_cluster_v3_Cluster *msg, upb_arena *arena) {
- struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_cluster_v3_Cluster_dns_refresh_rate(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_Cluster_set_dns_refresh_rate(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_cluster_v3_Cluster_set_dns_lookup_family(envoy_config_cluster_v3_Cluster *msg, int32_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
-}
-UPB_INLINE struct envoy_config_core_v3_Address** envoy_config_cluster_v3_Cluster_mutable_dns_resolvers(envoy_config_cluster_v3_Cluster *msg, size_t *len) {
- return (struct envoy_config_core_v3_Address**)_upb_array_mutable_accessor(msg, UPB_SIZE(152, 272), len);
-}
-UPB_INLINE struct envoy_config_core_v3_Address** envoy_config_cluster_v3_Cluster_resize_dns_resolvers(envoy_config_cluster_v3_Cluster *msg, size_t len, upb_arena *arena) {
- return (struct envoy_config_core_v3_Address**)_upb_array_resize_accessor(msg, UPB_SIZE(152, 272), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_config_core_v3_Address* envoy_config_cluster_v3_Cluster_add_dns_resolvers(envoy_config_cluster_v3_Cluster *msg, upb_arena *arena) {
- struct envoy_config_core_v3_Address* sub = (struct envoy_config_core_v3_Address*)_upb_msg_new(&envoy_config_core_v3_Address_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(152, 272), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-UPB_INLINE void envoy_config_cluster_v3_Cluster_set_outlier_detection(envoy_config_cluster_v3_Cluster *msg, struct envoy_config_cluster_v3_OutlierDetection* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(80, 128), struct envoy_config_cluster_v3_OutlierDetection*) = value;
-}
-UPB_INLINE struct envoy_config_cluster_v3_OutlierDetection* envoy_config_cluster_v3_Cluster_mutable_outlier_detection(envoy_config_cluster_v3_Cluster *msg, upb_arena *arena) {
- struct envoy_config_cluster_v3_OutlierDetection* sub = (struct envoy_config_cluster_v3_OutlierDetection*)envoy_config_cluster_v3_Cluster_outlier_detection(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_cluster_v3_OutlierDetection*)_upb_msg_new(&envoy_config_cluster_v3_OutlierDetection_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_Cluster_set_outlier_detection(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_cluster_v3_Cluster_set_cleanup_interval(envoy_config_cluster_v3_Cluster *msg, struct google_protobuf_Duration* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(84, 136), struct google_protobuf_Duration*) = value;
-}
-UPB_INLINE struct google_protobuf_Duration* envoy_config_cluster_v3_Cluster_mutable_cleanup_interval(envoy_config_cluster_v3_Cluster *msg, upb_arena *arena) {
- struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_cluster_v3_Cluster_cleanup_interval(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_Cluster_set_cleanup_interval(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_cluster_v3_Cluster_set_upstream_bind_config(envoy_config_cluster_v3_Cluster *msg, struct envoy_config_core_v3_BindConfig* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(88, 144), struct envoy_config_core_v3_BindConfig*) = value;
-}
-UPB_INLINE struct envoy_config_core_v3_BindConfig* envoy_config_cluster_v3_Cluster_mutable_upstream_bind_config(envoy_config_cluster_v3_Cluster *msg, upb_arena *arena) {
- struct envoy_config_core_v3_BindConfig* sub = (struct envoy_config_core_v3_BindConfig*)envoy_config_cluster_v3_Cluster_upstream_bind_config(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_BindConfig*)_upb_msg_new(&envoy_config_core_v3_BindConfig_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_Cluster_set_upstream_bind_config(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_cluster_v3_Cluster_set_lb_subset_config(envoy_config_cluster_v3_Cluster *msg, envoy_config_cluster_v3_Cluster_LbSubsetConfig* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(92, 152), envoy_config_cluster_v3_Cluster_LbSubsetConfig*) = value;
-}
-UPB_INLINE struct envoy_config_cluster_v3_Cluster_LbSubsetConfig* envoy_config_cluster_v3_Cluster_mutable_lb_subset_config(envoy_config_cluster_v3_Cluster *msg, upb_arena *arena) {
- struct envoy_config_cluster_v3_Cluster_LbSubsetConfig* sub = (struct envoy_config_cluster_v3_Cluster_LbSubsetConfig*)envoy_config_cluster_v3_Cluster_lb_subset_config(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_cluster_v3_Cluster_LbSubsetConfig*)_upb_msg_new(&envoy_config_cluster_v3_Cluster_LbSubsetConfig_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_Cluster_set_lb_subset_config(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_cluster_v3_Cluster_set_ring_hash_lb_config(envoy_config_cluster_v3_Cluster *msg, envoy_config_cluster_v3_Cluster_RingHashLbConfig* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_cluster_v3_Cluster_RingHashLbConfig*, UPB_SIZE(180, 320), value, UPB_SIZE(184, 328), 23);
-}
-UPB_INLINE struct envoy_config_cluster_v3_Cluster_RingHashLbConfig* envoy_config_cluster_v3_Cluster_mutable_ring_hash_lb_config(envoy_config_cluster_v3_Cluster *msg, upb_arena *arena) {
- struct envoy_config_cluster_v3_Cluster_RingHashLbConfig* sub = (struct envoy_config_cluster_v3_Cluster_RingHashLbConfig*)envoy_config_cluster_v3_Cluster_ring_hash_lb_config(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_cluster_v3_Cluster_RingHashLbConfig*)_upb_msg_new(&envoy_config_cluster_v3_Cluster_RingHashLbConfig_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_Cluster_set_ring_hash_lb_config(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_cluster_v3_Cluster_set_transport_socket(envoy_config_cluster_v3_Cluster *msg, struct envoy_config_core_v3_TransportSocket* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(96, 160), struct envoy_config_core_v3_TransportSocket*) = value;
-}
-UPB_INLINE struct envoy_config_core_v3_TransportSocket* envoy_config_cluster_v3_Cluster_mutable_transport_socket(envoy_config_cluster_v3_Cluster *msg, upb_arena *arena) {
- struct envoy_config_core_v3_TransportSocket* sub = (struct envoy_config_core_v3_TransportSocket*)envoy_config_cluster_v3_Cluster_transport_socket(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_TransportSocket*)_upb_msg_new(&envoy_config_core_v3_TransportSocket_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_Cluster_set_transport_socket(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_cluster_v3_Cluster_set_metadata(envoy_config_cluster_v3_Cluster *msg, struct envoy_config_core_v3_Metadata* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(100, 168), struct envoy_config_core_v3_Metadata*) = value;
-}
-UPB_INLINE struct envoy_config_core_v3_Metadata* envoy_config_cluster_v3_Cluster_mutable_metadata(envoy_config_cluster_v3_Cluster *msg, upb_arena *arena) {
- struct envoy_config_core_v3_Metadata* sub = (struct envoy_config_core_v3_Metadata*)envoy_config_cluster_v3_Cluster_metadata(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_Metadata*)_upb_msg_new(&envoy_config_core_v3_Metadata_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_Cluster_set_metadata(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_cluster_v3_Cluster_set_protocol_selection(envoy_config_cluster_v3_Cluster *msg, int32_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t) = value;
-}
-UPB_INLINE void envoy_config_cluster_v3_Cluster_set_common_lb_config(envoy_config_cluster_v3_Cluster *msg, envoy_config_cluster_v3_Cluster_CommonLbConfig* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(104, 176), envoy_config_cluster_v3_Cluster_CommonLbConfig*) = value;
-}
-UPB_INLINE struct envoy_config_cluster_v3_Cluster_CommonLbConfig* envoy_config_cluster_v3_Cluster_mutable_common_lb_config(envoy_config_cluster_v3_Cluster *msg, upb_arena *arena) {
- struct envoy_config_cluster_v3_Cluster_CommonLbConfig* sub = (struct envoy_config_cluster_v3_Cluster_CommonLbConfig*)envoy_config_cluster_v3_Cluster_common_lb_config(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_cluster_v3_Cluster_CommonLbConfig*)_upb_msg_new(&envoy_config_cluster_v3_Cluster_CommonLbConfig_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_Cluster_set_common_lb_config(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_cluster_v3_Cluster_set_alt_stat_name(envoy_config_cluster_v3_Cluster *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(40, 48), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_cluster_v3_Cluster_set_common_http_protocol_options(envoy_config_cluster_v3_Cluster *msg, struct envoy_config_core_v3_HttpProtocolOptions* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(108, 184), struct envoy_config_core_v3_HttpProtocolOptions*) = value;
-}
-UPB_INLINE struct envoy_config_core_v3_HttpProtocolOptions* envoy_config_cluster_v3_Cluster_mutable_common_http_protocol_options(envoy_config_cluster_v3_Cluster *msg, upb_arena *arena) {
- struct envoy_config_core_v3_HttpProtocolOptions* sub = (struct envoy_config_core_v3_HttpProtocolOptions*)envoy_config_cluster_v3_Cluster_common_http_protocol_options(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_HttpProtocolOptions*)_upb_msg_new(&envoy_config_core_v3_HttpProtocolOptions_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_Cluster_set_common_http_protocol_options(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_cluster_v3_Cluster_set_upstream_connection_options(envoy_config_cluster_v3_Cluster *msg, envoy_config_cluster_v3_UpstreamConnectionOptions* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(112, 192), envoy_config_cluster_v3_UpstreamConnectionOptions*) = value;
-}
-UPB_INLINE struct envoy_config_cluster_v3_UpstreamConnectionOptions* envoy_config_cluster_v3_Cluster_mutable_upstream_connection_options(envoy_config_cluster_v3_Cluster *msg, upb_arena *arena) {
- struct envoy_config_cluster_v3_UpstreamConnectionOptions* sub = (struct envoy_config_cluster_v3_UpstreamConnectionOptions*)envoy_config_cluster_v3_Cluster_upstream_connection_options(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_cluster_v3_UpstreamConnectionOptions*)_upb_msg_new(&envoy_config_cluster_v3_UpstreamConnectionOptions_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_Cluster_set_upstream_connection_options(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_cluster_v3_Cluster_set_close_connections_on_host_health_failure(envoy_config_cluster_v3_Cluster *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool) = value;
-}
-UPB_INLINE void envoy_config_cluster_v3_Cluster_set_ignore_health_on_host_removal(envoy_config_cluster_v3_Cluster *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(25, 25), bool) = value;
-}
-UPB_INLINE void envoy_config_cluster_v3_Cluster_set_load_assignment(envoy_config_cluster_v3_Cluster *msg, struct envoy_config_endpoint_v3_ClusterLoadAssignment* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(116, 200), struct envoy_config_endpoint_v3_ClusterLoadAssignment*) = value;
-}
-UPB_INLINE struct envoy_config_endpoint_v3_ClusterLoadAssignment* envoy_config_cluster_v3_Cluster_mutable_load_assignment(envoy_config_cluster_v3_Cluster *msg, upb_arena *arena) {
- struct envoy_config_endpoint_v3_ClusterLoadAssignment* sub = (struct envoy_config_endpoint_v3_ClusterLoadAssignment*)envoy_config_cluster_v3_Cluster_load_assignment(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_endpoint_v3_ClusterLoadAssignment*)_upb_msg_new(&envoy_config_endpoint_v3_ClusterLoadAssignment_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_Cluster_set_load_assignment(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_cluster_v3_Cluster_set_original_dst_lb_config(envoy_config_cluster_v3_Cluster *msg, envoy_config_cluster_v3_Cluster_OriginalDstLbConfig* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_cluster_v3_Cluster_OriginalDstLbConfig*, UPB_SIZE(180, 320), value, UPB_SIZE(184, 328), 34);
-}
-UPB_INLINE struct envoy_config_cluster_v3_Cluster_OriginalDstLbConfig* envoy_config_cluster_v3_Cluster_mutable_original_dst_lb_config(envoy_config_cluster_v3_Cluster *msg, upb_arena *arena) {
- struct envoy_config_cluster_v3_Cluster_OriginalDstLbConfig* sub = (struct envoy_config_cluster_v3_Cluster_OriginalDstLbConfig*)envoy_config_cluster_v3_Cluster_original_dst_lb_config(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_cluster_v3_Cluster_OriginalDstLbConfig*)_upb_msg_new(&envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_Cluster_set_original_dst_lb_config(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_cluster_v3_Cluster_typed_extension_protocol_options_clear(envoy_config_cluster_v3_Cluster *msg) { _upb_msg_map_clear(msg, UPB_SIZE(156, 280)); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_typed_extension_protocol_options_set(envoy_config_cluster_v3_Cluster *msg, upb_strview key, struct google_protobuf_Any* val, upb_arena *a) { return _upb_msg_map_set(msg, UPB_SIZE(156, 280), &key, 0, &val, sizeof(val), a); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_typed_extension_protocol_options_delete(envoy_config_cluster_v3_Cluster *msg, upb_strview key) { return _upb_msg_map_delete(msg, UPB_SIZE(156, 280), &key, 0); }
-UPB_INLINE envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry* envoy_config_cluster_v3_Cluster_typed_extension_protocol_options_nextmutable(envoy_config_cluster_v3_Cluster *msg, size_t* iter) { return (envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry*)_upb_msg_map_next(msg, UPB_SIZE(156, 280), iter); }
-UPB_INLINE void envoy_config_cluster_v3_Cluster_set_least_request_lb_config(envoy_config_cluster_v3_Cluster *msg, envoy_config_cluster_v3_Cluster_LeastRequestLbConfig* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_cluster_v3_Cluster_LeastRequestLbConfig*, UPB_SIZE(180, 320), value, UPB_SIZE(184, 328), 37);
-}
-UPB_INLINE struct envoy_config_cluster_v3_Cluster_LeastRequestLbConfig* envoy_config_cluster_v3_Cluster_mutable_least_request_lb_config(envoy_config_cluster_v3_Cluster *msg, upb_arena *arena) {
- struct envoy_config_cluster_v3_Cluster_LeastRequestLbConfig* sub = (struct envoy_config_cluster_v3_Cluster_LeastRequestLbConfig*)envoy_config_cluster_v3_Cluster_least_request_lb_config(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_cluster_v3_Cluster_LeastRequestLbConfig*)_upb_msg_new(&envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_Cluster_set_least_request_lb_config(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_cluster_v3_Cluster_set_cluster_type(envoy_config_cluster_v3_Cluster *msg, envoy_config_cluster_v3_Cluster_CustomClusterType* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_cluster_v3_Cluster_CustomClusterType*, UPB_SIZE(168, 304), value, UPB_SIZE(176, 312), 38);
-}
-UPB_INLINE struct envoy_config_cluster_v3_Cluster_CustomClusterType* envoy_config_cluster_v3_Cluster_mutable_cluster_type(envoy_config_cluster_v3_Cluster *msg, upb_arena *arena) {
- struct envoy_config_cluster_v3_Cluster_CustomClusterType* sub = (struct envoy_config_cluster_v3_Cluster_CustomClusterType*)envoy_config_cluster_v3_Cluster_cluster_type(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_cluster_v3_Cluster_CustomClusterType*)_upb_msg_new(&envoy_config_cluster_v3_Cluster_CustomClusterType_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_Cluster_set_cluster_type(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_cluster_v3_Cluster_set_respect_dns_ttl(envoy_config_cluster_v3_Cluster *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(26, 26), bool) = value;
-}
-UPB_INLINE struct envoy_config_cluster_v3_Filter** envoy_config_cluster_v3_Cluster_mutable_filters(envoy_config_cluster_v3_Cluster *msg, size_t *len) {
- return (struct envoy_config_cluster_v3_Filter**)_upb_array_mutable_accessor(msg, UPB_SIZE(160, 288), len);
-}
-UPB_INLINE struct envoy_config_cluster_v3_Filter** envoy_config_cluster_v3_Cluster_resize_filters(envoy_config_cluster_v3_Cluster *msg, size_t len, upb_arena *arena) {
- return (struct envoy_config_cluster_v3_Filter**)_upb_array_resize_accessor(msg, UPB_SIZE(160, 288), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_config_cluster_v3_Filter* envoy_config_cluster_v3_Cluster_add_filters(envoy_config_cluster_v3_Cluster *msg, upb_arena *arena) {
- struct envoy_config_cluster_v3_Filter* sub = (struct envoy_config_cluster_v3_Filter*)_upb_msg_new(&envoy_config_cluster_v3_Filter_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(160, 288), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-UPB_INLINE void envoy_config_cluster_v3_Cluster_set_load_balancing_policy(envoy_config_cluster_v3_Cluster *msg, envoy_config_cluster_v3_LoadBalancingPolicy* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(120, 208), envoy_config_cluster_v3_LoadBalancingPolicy*) = value;
-}
-UPB_INLINE struct envoy_config_cluster_v3_LoadBalancingPolicy* envoy_config_cluster_v3_Cluster_mutable_load_balancing_policy(envoy_config_cluster_v3_Cluster *msg, upb_arena *arena) {
- struct envoy_config_cluster_v3_LoadBalancingPolicy* sub = (struct envoy_config_cluster_v3_LoadBalancingPolicy*)envoy_config_cluster_v3_Cluster_load_balancing_policy(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_cluster_v3_LoadBalancingPolicy*)_upb_msg_new(&envoy_config_cluster_v3_LoadBalancingPolicy_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_Cluster_set_load_balancing_policy(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_cluster_v3_Cluster_set_lrs_server(envoy_config_cluster_v3_Cluster *msg, struct envoy_config_core_v3_ConfigSource* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(124, 216), struct envoy_config_core_v3_ConfigSource*) = value;
-}
-UPB_INLINE struct envoy_config_core_v3_ConfigSource* envoy_config_cluster_v3_Cluster_mutable_lrs_server(envoy_config_cluster_v3_Cluster *msg, upb_arena *arena) {
- struct envoy_config_core_v3_ConfigSource* sub = (struct envoy_config_core_v3_ConfigSource*)envoy_config_cluster_v3_Cluster_lrs_server(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_ConfigSource*)_upb_msg_new(&envoy_config_core_v3_ConfigSource_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_Cluster_set_lrs_server(msg, sub);
- }
- return sub;
-}
-UPB_INLINE envoy_config_cluster_v3_Cluster_TransportSocketMatch** envoy_config_cluster_v3_Cluster_mutable_transport_socket_matches(envoy_config_cluster_v3_Cluster *msg, size_t *len) {
- return (envoy_config_cluster_v3_Cluster_TransportSocketMatch**)_upb_array_mutable_accessor(msg, UPB_SIZE(164, 296), len);
-}
-UPB_INLINE envoy_config_cluster_v3_Cluster_TransportSocketMatch** envoy_config_cluster_v3_Cluster_resize_transport_socket_matches(envoy_config_cluster_v3_Cluster *msg, size_t len, upb_arena *arena) {
- return (envoy_config_cluster_v3_Cluster_TransportSocketMatch**)_upb_array_resize_accessor(msg, UPB_SIZE(164, 296), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_config_cluster_v3_Cluster_TransportSocketMatch* envoy_config_cluster_v3_Cluster_add_transport_socket_matches(envoy_config_cluster_v3_Cluster *msg, upb_arena *arena) {
- struct envoy_config_cluster_v3_Cluster_TransportSocketMatch* sub = (struct envoy_config_cluster_v3_Cluster_TransportSocketMatch*)_upb_msg_new(&envoy_config_cluster_v3_Cluster_TransportSocketMatch_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(164, 296), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-UPB_INLINE void envoy_config_cluster_v3_Cluster_set_dns_failure_refresh_rate(envoy_config_cluster_v3_Cluster *msg, envoy_config_cluster_v3_Cluster_RefreshRate* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(128, 224), envoy_config_cluster_v3_Cluster_RefreshRate*) = value;
-}
-UPB_INLINE struct envoy_config_cluster_v3_Cluster_RefreshRate* envoy_config_cluster_v3_Cluster_mutable_dns_failure_refresh_rate(envoy_config_cluster_v3_Cluster *msg, upb_arena *arena) {
- struct envoy_config_cluster_v3_Cluster_RefreshRate* sub = (struct envoy_config_cluster_v3_Cluster_RefreshRate*)envoy_config_cluster_v3_Cluster_dns_failure_refresh_rate(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_cluster_v3_Cluster_RefreshRate*)_upb_msg_new(&envoy_config_cluster_v3_Cluster_RefreshRate_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_Cluster_set_dns_failure_refresh_rate(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_cluster_v3_Cluster_set_use_tcp_for_dns_lookups(envoy_config_cluster_v3_Cluster *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(27, 27), bool) = value;
-}
-UPB_INLINE void envoy_config_cluster_v3_Cluster_set_upstream_http_protocol_options(envoy_config_cluster_v3_Cluster *msg, struct envoy_config_core_v3_UpstreamHttpProtocolOptions* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(132, 232), struct envoy_config_core_v3_UpstreamHttpProtocolOptions*) = value;
-}
-UPB_INLINE struct envoy_config_core_v3_UpstreamHttpProtocolOptions* envoy_config_cluster_v3_Cluster_mutable_upstream_http_protocol_options(envoy_config_cluster_v3_Cluster *msg, upb_arena *arena) {
- struct envoy_config_core_v3_UpstreamHttpProtocolOptions* sub = (struct envoy_config_core_v3_UpstreamHttpProtocolOptions*)envoy_config_cluster_v3_Cluster_upstream_http_protocol_options(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_UpstreamHttpProtocolOptions*)_upb_msg_new(&envoy_config_core_v3_UpstreamHttpProtocolOptions_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_Cluster_set_upstream_http_protocol_options(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_cluster_v3_Cluster_set_track_timeout_budgets(envoy_config_cluster_v3_Cluster *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(28, 28), bool) = value;
-}
-UPB_INLINE void envoy_config_cluster_v3_Cluster_set_upstream_config(envoy_config_cluster_v3_Cluster *msg, struct envoy_config_core_v3_TypedExtensionConfig* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(136, 240), struct envoy_config_core_v3_TypedExtensionConfig*) = value;
-}
-UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_cluster_v3_Cluster_mutable_upstream_config(envoy_config_cluster_v3_Cluster *msg, upb_arena *arena) {
- struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)envoy_config_cluster_v3_Cluster_upstream_config(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_msg_new(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_Cluster_set_upstream_config(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_cluster_v3_Cluster_set_track_cluster_stats(envoy_config_cluster_v3_Cluster *msg, envoy_config_cluster_v3_TrackClusterStats* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(140, 248), envoy_config_cluster_v3_TrackClusterStats*) = value;
-}
-UPB_INLINE struct envoy_config_cluster_v3_TrackClusterStats* envoy_config_cluster_v3_Cluster_mutable_track_cluster_stats(envoy_config_cluster_v3_Cluster *msg, upb_arena *arena) {
- struct envoy_config_cluster_v3_TrackClusterStats* sub = (struct envoy_config_cluster_v3_TrackClusterStats*)envoy_config_cluster_v3_Cluster_track_cluster_stats(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_cluster_v3_TrackClusterStats*)_upb_msg_new(&envoy_config_cluster_v3_TrackClusterStats_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_Cluster_set_track_cluster_stats(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_cluster_v3_Cluster_set_prefetch_policy(envoy_config_cluster_v3_Cluster *msg, envoy_config_cluster_v3_Cluster_PrefetchPolicy* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(144, 256), envoy_config_cluster_v3_Cluster_PrefetchPolicy*) = value;
-}
-UPB_INLINE struct envoy_config_cluster_v3_Cluster_PrefetchPolicy* envoy_config_cluster_v3_Cluster_mutable_prefetch_policy(envoy_config_cluster_v3_Cluster *msg, upb_arena *arena) {
- struct envoy_config_cluster_v3_Cluster_PrefetchPolicy* sub = (struct envoy_config_cluster_v3_Cluster_PrefetchPolicy*)envoy_config_cluster_v3_Cluster_prefetch_policy(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_cluster_v3_Cluster_PrefetchPolicy*)_upb_msg_new(&envoy_config_cluster_v3_Cluster_PrefetchPolicy_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_Cluster_set_prefetch_policy(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_cluster_v3_Cluster_set_connection_pool_per_downstream_connection(envoy_config_cluster_v3_Cluster *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(29, 29), bool) = value;
-}
-UPB_INLINE void envoy_config_cluster_v3_Cluster_set_maglev_lb_config(envoy_config_cluster_v3_Cluster *msg, envoy_config_cluster_v3_Cluster_MaglevLbConfig* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_cluster_v3_Cluster_MaglevLbConfig*, UPB_SIZE(180, 320), value, UPB_SIZE(184, 328), 52);
-}
-UPB_INLINE struct envoy_config_cluster_v3_Cluster_MaglevLbConfig* envoy_config_cluster_v3_Cluster_mutable_maglev_lb_config(envoy_config_cluster_v3_Cluster *msg, upb_arena *arena) {
- struct envoy_config_cluster_v3_Cluster_MaglevLbConfig* sub = (struct envoy_config_cluster_v3_Cluster_MaglevLbConfig*)envoy_config_cluster_v3_Cluster_maglev_lb_config(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_cluster_v3_Cluster_MaglevLbConfig*)_upb_msg_new(&envoy_config_cluster_v3_Cluster_MaglevLbConfig_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_Cluster_set_maglev_lb_config(msg, sub);
- }
- return sub;
-}
-
-/* envoy.config.cluster.v3.Cluster.TransportSocketMatch */
-
-UPB_INLINE envoy_config_cluster_v3_Cluster_TransportSocketMatch *envoy_config_cluster_v3_Cluster_TransportSocketMatch_new(upb_arena *arena) {
- return (envoy_config_cluster_v3_Cluster_TransportSocketMatch *)_upb_msg_new(&envoy_config_cluster_v3_Cluster_TransportSocketMatch_msginit, arena);
-}
-UPB_INLINE envoy_config_cluster_v3_Cluster_TransportSocketMatch *envoy_config_cluster_v3_Cluster_TransportSocketMatch_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_cluster_v3_Cluster_TransportSocketMatch *ret = envoy_config_cluster_v3_Cluster_TransportSocketMatch_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_TransportSocketMatch_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_cluster_v3_Cluster_TransportSocketMatch_serialize(const envoy_config_cluster_v3_Cluster_TransportSocketMatch *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_cluster_v3_Cluster_TransportSocketMatch_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview envoy_config_cluster_v3_Cluster_TransportSocketMatch_name(const envoy_config_cluster_v3_Cluster_TransportSocketMatch *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_TransportSocketMatch_has_match(const envoy_config_cluster_v3_Cluster_TransportSocketMatch *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const struct google_protobuf_Struct* envoy_config_cluster_v3_Cluster_TransportSocketMatch_match(const envoy_config_cluster_v3_Cluster_TransportSocketMatch *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_Struct*); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_TransportSocketMatch_has_transport_socket(const envoy_config_cluster_v3_Cluster_TransportSocketMatch *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
-UPB_INLINE const struct envoy_config_core_v3_TransportSocket* envoy_config_cluster_v3_Cluster_TransportSocketMatch_transport_socket(const envoy_config_cluster_v3_Cluster_TransportSocketMatch *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct envoy_config_core_v3_TransportSocket*); }
-
-UPB_INLINE void envoy_config_cluster_v3_Cluster_TransportSocketMatch_set_name(envoy_config_cluster_v3_Cluster_TransportSocketMatch *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_cluster_v3_Cluster_TransportSocketMatch_set_match(envoy_config_cluster_v3_Cluster_TransportSocketMatch *msg, struct google_protobuf_Struct* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_Struct*) = value;
-}
-UPB_INLINE struct google_protobuf_Struct* envoy_config_cluster_v3_Cluster_TransportSocketMatch_mutable_match(envoy_config_cluster_v3_Cluster_TransportSocketMatch *msg, upb_arena *arena) {
- struct google_protobuf_Struct* sub = (struct google_protobuf_Struct*)envoy_config_cluster_v3_Cluster_TransportSocketMatch_match(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Struct*)_upb_msg_new(&google_protobuf_Struct_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_Cluster_TransportSocketMatch_set_match(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_cluster_v3_Cluster_TransportSocketMatch_set_transport_socket(envoy_config_cluster_v3_Cluster_TransportSocketMatch *msg, struct envoy_config_core_v3_TransportSocket* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct envoy_config_core_v3_TransportSocket*) = value;
-}
-UPB_INLINE struct envoy_config_core_v3_TransportSocket* envoy_config_cluster_v3_Cluster_TransportSocketMatch_mutable_transport_socket(envoy_config_cluster_v3_Cluster_TransportSocketMatch *msg, upb_arena *arena) {
- struct envoy_config_core_v3_TransportSocket* sub = (struct envoy_config_core_v3_TransportSocket*)envoy_config_cluster_v3_Cluster_TransportSocketMatch_transport_socket(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_TransportSocket*)_upb_msg_new(&envoy_config_core_v3_TransportSocket_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_Cluster_TransportSocketMatch_set_transport_socket(msg, sub);
- }
- return sub;
-}
-
-/* envoy.config.cluster.v3.Cluster.CustomClusterType */
-
-UPB_INLINE envoy_config_cluster_v3_Cluster_CustomClusterType *envoy_config_cluster_v3_Cluster_CustomClusterType_new(upb_arena *arena) {
- return (envoy_config_cluster_v3_Cluster_CustomClusterType *)_upb_msg_new(&envoy_config_cluster_v3_Cluster_CustomClusterType_msginit, arena);
-}
-UPB_INLINE envoy_config_cluster_v3_Cluster_CustomClusterType *envoy_config_cluster_v3_Cluster_CustomClusterType_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_cluster_v3_Cluster_CustomClusterType *ret = envoy_config_cluster_v3_Cluster_CustomClusterType_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_CustomClusterType_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_cluster_v3_Cluster_CustomClusterType_serialize(const envoy_config_cluster_v3_Cluster_CustomClusterType *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_cluster_v3_Cluster_CustomClusterType_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview envoy_config_cluster_v3_Cluster_CustomClusterType_name(const envoy_config_cluster_v3_Cluster_CustomClusterType *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_CustomClusterType_has_typed_config(const envoy_config_cluster_v3_Cluster_CustomClusterType *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const struct google_protobuf_Any* envoy_config_cluster_v3_Cluster_CustomClusterType_typed_config(const envoy_config_cluster_v3_Cluster_CustomClusterType *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_Any*); }
-
-UPB_INLINE void envoy_config_cluster_v3_Cluster_CustomClusterType_set_name(envoy_config_cluster_v3_Cluster_CustomClusterType *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_cluster_v3_Cluster_CustomClusterType_set_typed_config(envoy_config_cluster_v3_Cluster_CustomClusterType *msg, struct google_protobuf_Any* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_Any*) = value;
-}
-UPB_INLINE struct google_protobuf_Any* envoy_config_cluster_v3_Cluster_CustomClusterType_mutable_typed_config(envoy_config_cluster_v3_Cluster_CustomClusterType *msg, upb_arena *arena) {
- struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_config_cluster_v3_Cluster_CustomClusterType_typed_config(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_Cluster_CustomClusterType_set_typed_config(msg, sub);
- }
- return sub;
-}
-
-/* envoy.config.cluster.v3.Cluster.EdsClusterConfig */
-
-UPB_INLINE envoy_config_cluster_v3_Cluster_EdsClusterConfig *envoy_config_cluster_v3_Cluster_EdsClusterConfig_new(upb_arena *arena) {
- return (envoy_config_cluster_v3_Cluster_EdsClusterConfig *)_upb_msg_new(&envoy_config_cluster_v3_Cluster_EdsClusterConfig_msginit, arena);
-}
-UPB_INLINE envoy_config_cluster_v3_Cluster_EdsClusterConfig *envoy_config_cluster_v3_Cluster_EdsClusterConfig_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_cluster_v3_Cluster_EdsClusterConfig *ret = envoy_config_cluster_v3_Cluster_EdsClusterConfig_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_EdsClusterConfig_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_cluster_v3_Cluster_EdsClusterConfig_serialize(const envoy_config_cluster_v3_Cluster_EdsClusterConfig *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_cluster_v3_Cluster_EdsClusterConfig_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_EdsClusterConfig_has_eds_config(const envoy_config_cluster_v3_Cluster_EdsClusterConfig *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const struct envoy_config_core_v3_ConfigSource* envoy_config_cluster_v3_Cluster_EdsClusterConfig_eds_config(const envoy_config_cluster_v3_Cluster_EdsClusterConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct envoy_config_core_v3_ConfigSource*); }
-UPB_INLINE upb_strview envoy_config_cluster_v3_Cluster_EdsClusterConfig_service_name(const envoy_config_cluster_v3_Cluster_EdsClusterConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_EdsClusterConfig_has_eds_resource_locator(const envoy_config_cluster_v3_Cluster_EdsClusterConfig *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
-UPB_INLINE const struct udpa_core_v1_ResourceLocator* envoy_config_cluster_v3_Cluster_EdsClusterConfig_eds_resource_locator(const envoy_config_cluster_v3_Cluster_EdsClusterConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct udpa_core_v1_ResourceLocator*); }
-
-UPB_INLINE void envoy_config_cluster_v3_Cluster_EdsClusterConfig_set_eds_config(envoy_config_cluster_v3_Cluster_EdsClusterConfig *msg, struct envoy_config_core_v3_ConfigSource* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct envoy_config_core_v3_ConfigSource*) = value;
-}
-UPB_INLINE struct envoy_config_core_v3_ConfigSource* envoy_config_cluster_v3_Cluster_EdsClusterConfig_mutable_eds_config(envoy_config_cluster_v3_Cluster_EdsClusterConfig *msg, upb_arena *arena) {
- struct envoy_config_core_v3_ConfigSource* sub = (struct envoy_config_core_v3_ConfigSource*)envoy_config_cluster_v3_Cluster_EdsClusterConfig_eds_config(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_ConfigSource*)_upb_msg_new(&envoy_config_core_v3_ConfigSource_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_Cluster_EdsClusterConfig_set_eds_config(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_cluster_v3_Cluster_EdsClusterConfig_set_service_name(envoy_config_cluster_v3_Cluster_EdsClusterConfig *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_cluster_v3_Cluster_EdsClusterConfig_set_eds_resource_locator(envoy_config_cluster_v3_Cluster_EdsClusterConfig *msg, struct udpa_core_v1_ResourceLocator* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct udpa_core_v1_ResourceLocator*) = value;
-}
-UPB_INLINE struct udpa_core_v1_ResourceLocator* envoy_config_cluster_v3_Cluster_EdsClusterConfig_mutable_eds_resource_locator(envoy_config_cluster_v3_Cluster_EdsClusterConfig *msg, upb_arena *arena) {
- struct udpa_core_v1_ResourceLocator* sub = (struct udpa_core_v1_ResourceLocator*)envoy_config_cluster_v3_Cluster_EdsClusterConfig_eds_resource_locator(msg);
- if (sub == NULL) {
- sub = (struct udpa_core_v1_ResourceLocator*)_upb_msg_new(&udpa_core_v1_ResourceLocator_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_Cluster_EdsClusterConfig_set_eds_resource_locator(msg, sub);
- }
- return sub;
-}
-
-/* envoy.config.cluster.v3.Cluster.LbSubsetConfig */
-
-UPB_INLINE envoy_config_cluster_v3_Cluster_LbSubsetConfig *envoy_config_cluster_v3_Cluster_LbSubsetConfig_new(upb_arena *arena) {
- return (envoy_config_cluster_v3_Cluster_LbSubsetConfig *)_upb_msg_new(&envoy_config_cluster_v3_Cluster_LbSubsetConfig_msginit, arena);
-}
-UPB_INLINE envoy_config_cluster_v3_Cluster_LbSubsetConfig *envoy_config_cluster_v3_Cluster_LbSubsetConfig_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_cluster_v3_Cluster_LbSubsetConfig *ret = envoy_config_cluster_v3_Cluster_LbSubsetConfig_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_LbSubsetConfig_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_cluster_v3_Cluster_LbSubsetConfig_serialize(const envoy_config_cluster_v3_Cluster_LbSubsetConfig *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_cluster_v3_Cluster_LbSubsetConfig_msginit, arena, len);
-}
-
-UPB_INLINE int32_t envoy_config_cluster_v3_Cluster_LbSubsetConfig_fallback_policy(const envoy_config_cluster_v3_Cluster_LbSubsetConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_LbSubsetConfig_has_default_subset(const envoy_config_cluster_v3_Cluster_LbSubsetConfig *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 16)); }
-UPB_INLINE const struct google_protobuf_Struct* envoy_config_cluster_v3_Cluster_LbSubsetConfig_default_subset(const envoy_config_cluster_v3_Cluster_LbSubsetConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const struct google_protobuf_Struct*); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_LbSubsetConfig_has_subset_selectors(const envoy_config_cluster_v3_Cluster_LbSubsetConfig *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 24)); }
-UPB_INLINE const envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector* const* envoy_config_cluster_v3_Cluster_LbSubsetConfig_subset_selectors(const envoy_config_cluster_v3_Cluster_LbSubsetConfig *msg, size_t *len) { return (const envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector* const*)_upb_array_accessor(msg, UPB_SIZE(16, 24), len); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_LbSubsetConfig_locality_weight_aware(const envoy_config_cluster_v3_Cluster_LbSubsetConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_LbSubsetConfig_scale_locality_weight(const envoy_config_cluster_v3_Cluster_LbSubsetConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(9, 9), bool); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_LbSubsetConfig_panic_mode_any(const envoy_config_cluster_v3_Cluster_LbSubsetConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(10, 10), bool); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_LbSubsetConfig_list_as_any(const envoy_config_cluster_v3_Cluster_LbSubsetConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(11, 11), bool); }
-
-UPB_INLINE void envoy_config_cluster_v3_Cluster_LbSubsetConfig_set_fallback_policy(envoy_config_cluster_v3_Cluster_LbSubsetConfig *msg, int32_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
-}
-UPB_INLINE void envoy_config_cluster_v3_Cluster_LbSubsetConfig_set_default_subset(envoy_config_cluster_v3_Cluster_LbSubsetConfig *msg, struct google_protobuf_Struct* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(12, 16), struct google_protobuf_Struct*) = value;
-}
-UPB_INLINE struct google_protobuf_Struct* envoy_config_cluster_v3_Cluster_LbSubsetConfig_mutable_default_subset(envoy_config_cluster_v3_Cluster_LbSubsetConfig *msg, upb_arena *arena) {
- struct google_protobuf_Struct* sub = (struct google_protobuf_Struct*)envoy_config_cluster_v3_Cluster_LbSubsetConfig_default_subset(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Struct*)_upb_msg_new(&google_protobuf_Struct_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_Cluster_LbSubsetConfig_set_default_subset(msg, sub);
- }
- return sub;
-}
-UPB_INLINE envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector** envoy_config_cluster_v3_Cluster_LbSubsetConfig_mutable_subset_selectors(envoy_config_cluster_v3_Cluster_LbSubsetConfig *msg, size_t *len) {
- return (envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector**)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 24), len);
-}
-UPB_INLINE envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector** envoy_config_cluster_v3_Cluster_LbSubsetConfig_resize_subset_selectors(envoy_config_cluster_v3_Cluster_LbSubsetConfig *msg, size_t len, upb_arena *arena) {
- return (envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector**)_upb_array_resize_accessor(msg, UPB_SIZE(16, 24), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector* envoy_config_cluster_v3_Cluster_LbSubsetConfig_add_subset_selectors(envoy_config_cluster_v3_Cluster_LbSubsetConfig *msg, upb_arena *arena) {
- struct envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector* sub = (struct envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector*)_upb_msg_new(&envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(16, 24), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-UPB_INLINE void envoy_config_cluster_v3_Cluster_LbSubsetConfig_set_locality_weight_aware(envoy_config_cluster_v3_Cluster_LbSubsetConfig *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = value;
-}
-UPB_INLINE void envoy_config_cluster_v3_Cluster_LbSubsetConfig_set_scale_locality_weight(envoy_config_cluster_v3_Cluster_LbSubsetConfig *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(9, 9), bool) = value;
-}
-UPB_INLINE void envoy_config_cluster_v3_Cluster_LbSubsetConfig_set_panic_mode_any(envoy_config_cluster_v3_Cluster_LbSubsetConfig *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(10, 10), bool) = value;
-}
-UPB_INLINE void envoy_config_cluster_v3_Cluster_LbSubsetConfig_set_list_as_any(envoy_config_cluster_v3_Cluster_LbSubsetConfig *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(11, 11), bool) = value;
-}
-
-/* envoy.config.cluster.v3.Cluster.LbSubsetConfig.LbSubsetSelector */
-
-UPB_INLINE envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector *envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_new(upb_arena *arena) {
- return (envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector *)_upb_msg_new(&envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_msginit, arena);
-}
-UPB_INLINE envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector *envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector *ret = envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_serialize(const envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview const* envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_keys(const envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(12, 16), len); }
-UPB_INLINE int32_t envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_fallback_policy(const envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
-UPB_INLINE upb_strview const* envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_fallback_keys_subset(const envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(16, 24), len); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_single_host_per_subset(const envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool); }
-
-UPB_INLINE upb_strview* envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_mutable_keys(envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector *msg, size_t *len) {
- return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 16), len);
-}
-UPB_INLINE upb_strview* envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_resize_keys(envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector *msg, size_t len, upb_arena *arena) {
- return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(12, 16), len, UPB_TYPE_STRING, arena);
-}
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_add_keys(envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector *msg, upb_strview val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(12, 16), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
- arena);
-}
-UPB_INLINE void envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_set_fallback_policy(envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector *msg, int32_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
-}
-UPB_INLINE upb_strview* envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_mutable_fallback_keys_subset(envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector *msg, size_t *len) {
- return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 24), len);
-}
-UPB_INLINE upb_strview* envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_resize_fallback_keys_subset(envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector *msg, size_t len, upb_arena *arena) {
- return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(16, 24), len, UPB_TYPE_STRING, arena);
-}
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_add_fallback_keys_subset(envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector *msg, upb_strview val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(16, 24), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
- arena);
-}
-UPB_INLINE void envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_set_single_host_per_subset(envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = value;
-}
-
-/* envoy.config.cluster.v3.Cluster.LeastRequestLbConfig */
-
-UPB_INLINE envoy_config_cluster_v3_Cluster_LeastRequestLbConfig *envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_new(upb_arena *arena) {
- return (envoy_config_cluster_v3_Cluster_LeastRequestLbConfig *)_upb_msg_new(&envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_msginit, arena);
-}
-UPB_INLINE envoy_config_cluster_v3_Cluster_LeastRequestLbConfig *envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_cluster_v3_Cluster_LeastRequestLbConfig *ret = envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_serialize(const envoy_config_cluster_v3_Cluster_LeastRequestLbConfig *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_has_choice_count(const envoy_config_cluster_v3_Cluster_LeastRequestLbConfig *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_choice_count(const envoy_config_cluster_v3_Cluster_LeastRequestLbConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct google_protobuf_UInt32Value*); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_has_active_request_bias(const envoy_config_cluster_v3_Cluster_LeastRequestLbConfig *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
-UPB_INLINE const struct envoy_config_core_v3_RuntimeDouble* envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_active_request_bias(const envoy_config_cluster_v3_Cluster_LeastRequestLbConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_config_core_v3_RuntimeDouble*); }
-
-UPB_INLINE void envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_set_choice_count(envoy_config_cluster_v3_Cluster_LeastRequestLbConfig *msg, struct google_protobuf_UInt32Value* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct google_protobuf_UInt32Value*) = value;
-}
-UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_mutable_choice_count(envoy_config_cluster_v3_Cluster_LeastRequestLbConfig *msg, upb_arena *arena) {
- struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_choice_count(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_set_choice_count(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_set_active_request_bias(envoy_config_cluster_v3_Cluster_LeastRequestLbConfig *msg, struct envoy_config_core_v3_RuntimeDouble* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_config_core_v3_RuntimeDouble*) = value;
-}
-UPB_INLINE struct envoy_config_core_v3_RuntimeDouble* envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_mutable_active_request_bias(envoy_config_cluster_v3_Cluster_LeastRequestLbConfig *msg, upb_arena *arena) {
- struct envoy_config_core_v3_RuntimeDouble* sub = (struct envoy_config_core_v3_RuntimeDouble*)envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_active_request_bias(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_RuntimeDouble*)_upb_msg_new(&envoy_config_core_v3_RuntimeDouble_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_set_active_request_bias(msg, sub);
- }
- return sub;
-}
-
-/* envoy.config.cluster.v3.Cluster.RingHashLbConfig */
-
-UPB_INLINE envoy_config_cluster_v3_Cluster_RingHashLbConfig *envoy_config_cluster_v3_Cluster_RingHashLbConfig_new(upb_arena *arena) {
- return (envoy_config_cluster_v3_Cluster_RingHashLbConfig *)_upb_msg_new(&envoy_config_cluster_v3_Cluster_RingHashLbConfig_msginit, arena);
-}
-UPB_INLINE envoy_config_cluster_v3_Cluster_RingHashLbConfig *envoy_config_cluster_v3_Cluster_RingHashLbConfig_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_cluster_v3_Cluster_RingHashLbConfig *ret = envoy_config_cluster_v3_Cluster_RingHashLbConfig_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_RingHashLbConfig_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_cluster_v3_Cluster_RingHashLbConfig_serialize(const envoy_config_cluster_v3_Cluster_RingHashLbConfig *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_cluster_v3_Cluster_RingHashLbConfig_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_RingHashLbConfig_has_minimum_ring_size(const envoy_config_cluster_v3_Cluster_RingHashLbConfig *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 8)); }
-UPB_INLINE const struct google_protobuf_UInt64Value* envoy_config_cluster_v3_Cluster_RingHashLbConfig_minimum_ring_size(const envoy_config_cluster_v3_Cluster_RingHashLbConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const struct google_protobuf_UInt64Value*); }
-UPB_INLINE int32_t envoy_config_cluster_v3_Cluster_RingHashLbConfig_hash_function(const envoy_config_cluster_v3_Cluster_RingHashLbConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_RingHashLbConfig_has_maximum_ring_size(const envoy_config_cluster_v3_Cluster_RingHashLbConfig *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 16)); }
-UPB_INLINE const struct google_protobuf_UInt64Value* envoy_config_cluster_v3_Cluster_RingHashLbConfig_maximum_ring_size(const envoy_config_cluster_v3_Cluster_RingHashLbConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const struct google_protobuf_UInt64Value*); }
-
-UPB_INLINE void envoy_config_cluster_v3_Cluster_RingHashLbConfig_set_minimum_ring_size(envoy_config_cluster_v3_Cluster_RingHashLbConfig *msg, struct google_protobuf_UInt64Value* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), struct google_protobuf_UInt64Value*) = value;
-}
-UPB_INLINE struct google_protobuf_UInt64Value* envoy_config_cluster_v3_Cluster_RingHashLbConfig_mutable_minimum_ring_size(envoy_config_cluster_v3_Cluster_RingHashLbConfig *msg, upb_arena *arena) {
- struct google_protobuf_UInt64Value* sub = (struct google_protobuf_UInt64Value*)envoy_config_cluster_v3_Cluster_RingHashLbConfig_minimum_ring_size(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_UInt64Value*)_upb_msg_new(&google_protobuf_UInt64Value_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_Cluster_RingHashLbConfig_set_minimum_ring_size(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_cluster_v3_Cluster_RingHashLbConfig_set_hash_function(envoy_config_cluster_v3_Cluster_RingHashLbConfig *msg, int32_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
-}
-UPB_INLINE void envoy_config_cluster_v3_Cluster_RingHashLbConfig_set_maximum_ring_size(envoy_config_cluster_v3_Cluster_RingHashLbConfig *msg, struct google_protobuf_UInt64Value* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(12, 16), struct google_protobuf_UInt64Value*) = value;
-}
-UPB_INLINE struct google_protobuf_UInt64Value* envoy_config_cluster_v3_Cluster_RingHashLbConfig_mutable_maximum_ring_size(envoy_config_cluster_v3_Cluster_RingHashLbConfig *msg, upb_arena *arena) {
- struct google_protobuf_UInt64Value* sub = (struct google_protobuf_UInt64Value*)envoy_config_cluster_v3_Cluster_RingHashLbConfig_maximum_ring_size(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_UInt64Value*)_upb_msg_new(&google_protobuf_UInt64Value_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_Cluster_RingHashLbConfig_set_maximum_ring_size(msg, sub);
- }
- return sub;
-}
-
-/* envoy.config.cluster.v3.Cluster.MaglevLbConfig */
-
-UPB_INLINE envoy_config_cluster_v3_Cluster_MaglevLbConfig *envoy_config_cluster_v3_Cluster_MaglevLbConfig_new(upb_arena *arena) {
- return (envoy_config_cluster_v3_Cluster_MaglevLbConfig *)_upb_msg_new(&envoy_config_cluster_v3_Cluster_MaglevLbConfig_msginit, arena);
-}
-UPB_INLINE envoy_config_cluster_v3_Cluster_MaglevLbConfig *envoy_config_cluster_v3_Cluster_MaglevLbConfig_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_cluster_v3_Cluster_MaglevLbConfig *ret = envoy_config_cluster_v3_Cluster_MaglevLbConfig_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_MaglevLbConfig_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_cluster_v3_Cluster_MaglevLbConfig_serialize(const envoy_config_cluster_v3_Cluster_MaglevLbConfig *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_cluster_v3_Cluster_MaglevLbConfig_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_MaglevLbConfig_has_table_size(const envoy_config_cluster_v3_Cluster_MaglevLbConfig *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE const struct google_protobuf_UInt64Value* envoy_config_cluster_v3_Cluster_MaglevLbConfig_table_size(const envoy_config_cluster_v3_Cluster_MaglevLbConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct google_protobuf_UInt64Value*); }
-
-UPB_INLINE void envoy_config_cluster_v3_Cluster_MaglevLbConfig_set_table_size(envoy_config_cluster_v3_Cluster_MaglevLbConfig *msg, struct google_protobuf_UInt64Value* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct google_protobuf_UInt64Value*) = value;
-}
-UPB_INLINE struct google_protobuf_UInt64Value* envoy_config_cluster_v3_Cluster_MaglevLbConfig_mutable_table_size(envoy_config_cluster_v3_Cluster_MaglevLbConfig *msg, upb_arena *arena) {
- struct google_protobuf_UInt64Value* sub = (struct google_protobuf_UInt64Value*)envoy_config_cluster_v3_Cluster_MaglevLbConfig_table_size(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_UInt64Value*)_upb_msg_new(&google_protobuf_UInt64Value_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_Cluster_MaglevLbConfig_set_table_size(msg, sub);
- }
- return sub;
-}
-
-/* envoy.config.cluster.v3.Cluster.OriginalDstLbConfig */
-
-UPB_INLINE envoy_config_cluster_v3_Cluster_OriginalDstLbConfig *envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_new(upb_arena *arena) {
- return (envoy_config_cluster_v3_Cluster_OriginalDstLbConfig *)_upb_msg_new(&envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_msginit, arena);
-}
-UPB_INLINE envoy_config_cluster_v3_Cluster_OriginalDstLbConfig *envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_cluster_v3_Cluster_OriginalDstLbConfig *ret = envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_serialize(const envoy_config_cluster_v3_Cluster_OriginalDstLbConfig *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_use_http_header(const envoy_config_cluster_v3_Cluster_OriginalDstLbConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); }
-
-UPB_INLINE void envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_set_use_http_header(envoy_config_cluster_v3_Cluster_OriginalDstLbConfig *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
-}
-
-/* envoy.config.cluster.v3.Cluster.CommonLbConfig */
-
-UPB_INLINE envoy_config_cluster_v3_Cluster_CommonLbConfig *envoy_config_cluster_v3_Cluster_CommonLbConfig_new(upb_arena *arena) {
- return (envoy_config_cluster_v3_Cluster_CommonLbConfig *)_upb_msg_new(&envoy_config_cluster_v3_Cluster_CommonLbConfig_msginit, arena);
-}
-UPB_INLINE envoy_config_cluster_v3_Cluster_CommonLbConfig *envoy_config_cluster_v3_Cluster_CommonLbConfig_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_cluster_v3_Cluster_CommonLbConfig *ret = envoy_config_cluster_v3_Cluster_CommonLbConfig_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_CommonLbConfig_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_cluster_v3_Cluster_CommonLbConfig_serialize(const envoy_config_cluster_v3_Cluster_CommonLbConfig *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_cluster_v3_Cluster_CommonLbConfig_msginit, arena, len);
-}
-
-typedef enum {
- envoy_config_cluster_v3_Cluster_CommonLbConfig_locality_config_specifier_zone_aware_lb_config = 2,
- envoy_config_cluster_v3_Cluster_CommonLbConfig_locality_config_specifier_locality_weighted_lb_config = 3,
- envoy_config_cluster_v3_Cluster_CommonLbConfig_locality_config_specifier_NOT_SET = 0
-} envoy_config_cluster_v3_Cluster_CommonLbConfig_locality_config_specifier_oneofcases;
-UPB_INLINE envoy_config_cluster_v3_Cluster_CommonLbConfig_locality_config_specifier_oneofcases envoy_config_cluster_v3_Cluster_CommonLbConfig_locality_config_specifier_case(const envoy_config_cluster_v3_Cluster_CommonLbConfig* msg) { return (envoy_config_cluster_v3_Cluster_CommonLbConfig_locality_config_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(20, 40), int32_t); }
-
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_CommonLbConfig_has_healthy_panic_threshold(const envoy_config_cluster_v3_Cluster_CommonLbConfig *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
-UPB_INLINE const struct envoy_type_v3_Percent* envoy_config_cluster_v3_Cluster_CommonLbConfig_healthy_panic_threshold(const envoy_config_cluster_v3_Cluster_CommonLbConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_type_v3_Percent*); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_CommonLbConfig_has_zone_aware_lb_config(const envoy_config_cluster_v3_Cluster_CommonLbConfig *msg) { return _upb_getoneofcase(msg, UPB_SIZE(20, 40)) == 2; }
-UPB_INLINE const envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig* envoy_config_cluster_v3_Cluster_CommonLbConfig_zone_aware_lb_config(const envoy_config_cluster_v3_Cluster_CommonLbConfig *msg) { return UPB_READ_ONEOF(msg, const envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig*, UPB_SIZE(16, 32), UPB_SIZE(20, 40), 2, NULL); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_CommonLbConfig_has_locality_weighted_lb_config(const envoy_config_cluster_v3_Cluster_CommonLbConfig *msg) { return _upb_getoneofcase(msg, UPB_SIZE(20, 40)) == 3; }
-UPB_INLINE const envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig* envoy_config_cluster_v3_Cluster_CommonLbConfig_locality_weighted_lb_config(const envoy_config_cluster_v3_Cluster_CommonLbConfig *msg) { return UPB_READ_ONEOF(msg, const envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig*, UPB_SIZE(16, 32), UPB_SIZE(20, 40), 3, NULL); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_CommonLbConfig_has_update_merge_window(const envoy_config_cluster_v3_Cluster_CommonLbConfig *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const struct google_protobuf_Duration* envoy_config_cluster_v3_Cluster_CommonLbConfig_update_merge_window(const envoy_config_cluster_v3_Cluster_CommonLbConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_Duration*); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_CommonLbConfig_ignore_new_hosts_until_first_hc(const envoy_config_cluster_v3_Cluster_CommonLbConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_CommonLbConfig_close_connections_on_host_set_change(const envoy_config_cluster_v3_Cluster_CommonLbConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_CommonLbConfig_has_consistent_hashing_lb_config(const envoy_config_cluster_v3_Cluster_CommonLbConfig *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
-UPB_INLINE const envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig* envoy_config_cluster_v3_Cluster_CommonLbConfig_consistent_hashing_lb_config(const envoy_config_cluster_v3_Cluster_CommonLbConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig*); }
-
-UPB_INLINE void envoy_config_cluster_v3_Cluster_CommonLbConfig_set_healthy_panic_threshold(envoy_config_cluster_v3_Cluster_CommonLbConfig *msg, struct envoy_type_v3_Percent* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_type_v3_Percent*) = value;
-}
-UPB_INLINE struct envoy_type_v3_Percent* envoy_config_cluster_v3_Cluster_CommonLbConfig_mutable_healthy_panic_threshold(envoy_config_cluster_v3_Cluster_CommonLbConfig *msg, upb_arena *arena) {
- struct envoy_type_v3_Percent* sub = (struct envoy_type_v3_Percent*)envoy_config_cluster_v3_Cluster_CommonLbConfig_healthy_panic_threshold(msg);
- if (sub == NULL) {
- sub = (struct envoy_type_v3_Percent*)_upb_msg_new(&envoy_type_v3_Percent_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_Cluster_CommonLbConfig_set_healthy_panic_threshold(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_cluster_v3_Cluster_CommonLbConfig_set_zone_aware_lb_config(envoy_config_cluster_v3_Cluster_CommonLbConfig *msg, envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig*, UPB_SIZE(16, 32), value, UPB_SIZE(20, 40), 2);
-}
-UPB_INLINE struct envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig* envoy_config_cluster_v3_Cluster_CommonLbConfig_mutable_zone_aware_lb_config(envoy_config_cluster_v3_Cluster_CommonLbConfig *msg, upb_arena *arena) {
- struct envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig* sub = (struct envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig*)envoy_config_cluster_v3_Cluster_CommonLbConfig_zone_aware_lb_config(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig*)_upb_msg_new(&envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_Cluster_CommonLbConfig_set_zone_aware_lb_config(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_cluster_v3_Cluster_CommonLbConfig_set_locality_weighted_lb_config(envoy_config_cluster_v3_Cluster_CommonLbConfig *msg, envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig*, UPB_SIZE(16, 32), value, UPB_SIZE(20, 40), 3);
-}
-UPB_INLINE struct envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig* envoy_config_cluster_v3_Cluster_CommonLbConfig_mutable_locality_weighted_lb_config(envoy_config_cluster_v3_Cluster_CommonLbConfig *msg, upb_arena *arena) {
- struct envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig* sub = (struct envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig*)envoy_config_cluster_v3_Cluster_CommonLbConfig_locality_weighted_lb_config(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig*)_upb_msg_new(&envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_Cluster_CommonLbConfig_set_locality_weighted_lb_config(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_cluster_v3_Cluster_CommonLbConfig_set_update_merge_window(envoy_config_cluster_v3_Cluster_CommonLbConfig *msg, struct google_protobuf_Duration* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_Duration*) = value;
-}
-UPB_INLINE struct google_protobuf_Duration* envoy_config_cluster_v3_Cluster_CommonLbConfig_mutable_update_merge_window(envoy_config_cluster_v3_Cluster_CommonLbConfig *msg, upb_arena *arena) {
- struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_cluster_v3_Cluster_CommonLbConfig_update_merge_window(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_Cluster_CommonLbConfig_set_update_merge_window(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_cluster_v3_Cluster_CommonLbConfig_set_ignore_new_hosts_until_first_hc(envoy_config_cluster_v3_Cluster_CommonLbConfig *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
-}
-UPB_INLINE void envoy_config_cluster_v3_Cluster_CommonLbConfig_set_close_connections_on_host_set_change(envoy_config_cluster_v3_Cluster_CommonLbConfig *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
-}
-UPB_INLINE void envoy_config_cluster_v3_Cluster_CommonLbConfig_set_consistent_hashing_lb_config(envoy_config_cluster_v3_Cluster_CommonLbConfig *msg, envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig*) = value;
-}
-UPB_INLINE struct envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig* envoy_config_cluster_v3_Cluster_CommonLbConfig_mutable_consistent_hashing_lb_config(envoy_config_cluster_v3_Cluster_CommonLbConfig *msg, upb_arena *arena) {
- struct envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig* sub = (struct envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig*)envoy_config_cluster_v3_Cluster_CommonLbConfig_consistent_hashing_lb_config(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig*)_upb_msg_new(&envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_Cluster_CommonLbConfig_set_consistent_hashing_lb_config(msg, sub);
- }
- return sub;
-}
-
-/* envoy.config.cluster.v3.Cluster.CommonLbConfig.ZoneAwareLbConfig */
-
-UPB_INLINE envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig *envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_new(upb_arena *arena) {
- return (envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig *)_upb_msg_new(&envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_msginit, arena);
-}
-UPB_INLINE envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig *envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig *ret = envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_serialize(const envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_has_routing_enabled(const envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
-UPB_INLINE const struct envoy_type_v3_Percent* envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_routing_enabled(const envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_type_v3_Percent*); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_has_min_cluster_size(const envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const struct google_protobuf_UInt64Value* envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_min_cluster_size(const envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_UInt64Value*); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_fail_traffic_on_panic(const envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); }
-
-UPB_INLINE void envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_set_routing_enabled(envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig *msg, struct envoy_type_v3_Percent* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_type_v3_Percent*) = value;
-}
-UPB_INLINE struct envoy_type_v3_Percent* envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_mutable_routing_enabled(envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig *msg, upb_arena *arena) {
- struct envoy_type_v3_Percent* sub = (struct envoy_type_v3_Percent*)envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_routing_enabled(msg);
- if (sub == NULL) {
- sub = (struct envoy_type_v3_Percent*)_upb_msg_new(&envoy_type_v3_Percent_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_set_routing_enabled(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_set_min_cluster_size(envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig *msg, struct google_protobuf_UInt64Value* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_UInt64Value*) = value;
-}
-UPB_INLINE struct google_protobuf_UInt64Value* envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_mutable_min_cluster_size(envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig *msg, upb_arena *arena) {
- struct google_protobuf_UInt64Value* sub = (struct google_protobuf_UInt64Value*)envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_min_cluster_size(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_UInt64Value*)_upb_msg_new(&google_protobuf_UInt64Value_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_set_min_cluster_size(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_set_fail_traffic_on_panic(envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
-}
-
-/* envoy.config.cluster.v3.Cluster.CommonLbConfig.LocalityWeightedLbConfig */
-
-UPB_INLINE envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig *envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig_new(upb_arena *arena) {
- return (envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig *)_upb_msg_new(&envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig_msginit, arena);
-}
-UPB_INLINE envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig *envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig *ret = envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig_serialize(const envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig_msginit, arena, len);
-}
-
-
-
-/* envoy.config.cluster.v3.Cluster.CommonLbConfig.ConsistentHashingLbConfig */
-
-UPB_INLINE envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig *envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_new(upb_arena *arena) {
- return (envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig *)_upb_msg_new(&envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_msginit, arena);
-}
-UPB_INLINE envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig *envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig *ret = envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_serialize(const envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_use_hostname_for_hashing(const envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_has_hash_balance_factor(const envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
-UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_hash_balance_factor(const envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_UInt32Value*); }
-
-UPB_INLINE void envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_set_use_hostname_for_hashing(envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
-}
-UPB_INLINE void envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_set_hash_balance_factor(envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig *msg, struct google_protobuf_UInt32Value* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_UInt32Value*) = value;
-}
-UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_mutable_hash_balance_factor(envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig *msg, upb_arena *arena) {
- struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_hash_balance_factor(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_set_hash_balance_factor(msg, sub);
- }
- return sub;
-}
-
-/* envoy.config.cluster.v3.Cluster.RefreshRate */
-
-UPB_INLINE envoy_config_cluster_v3_Cluster_RefreshRate *envoy_config_cluster_v3_Cluster_RefreshRate_new(upb_arena *arena) {
- return (envoy_config_cluster_v3_Cluster_RefreshRate *)_upb_msg_new(&envoy_config_cluster_v3_Cluster_RefreshRate_msginit, arena);
-}
-UPB_INLINE envoy_config_cluster_v3_Cluster_RefreshRate *envoy_config_cluster_v3_Cluster_RefreshRate_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_cluster_v3_Cluster_RefreshRate *ret = envoy_config_cluster_v3_Cluster_RefreshRate_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_RefreshRate_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_cluster_v3_Cluster_RefreshRate_serialize(const envoy_config_cluster_v3_Cluster_RefreshRate *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_cluster_v3_Cluster_RefreshRate_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_RefreshRate_has_base_interval(const envoy_config_cluster_v3_Cluster_RefreshRate *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE const struct google_protobuf_Duration* envoy_config_cluster_v3_Cluster_RefreshRate_base_interval(const envoy_config_cluster_v3_Cluster_RefreshRate *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct google_protobuf_Duration*); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_RefreshRate_has_max_interval(const envoy_config_cluster_v3_Cluster_RefreshRate *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
-UPB_INLINE const struct google_protobuf_Duration* envoy_config_cluster_v3_Cluster_RefreshRate_max_interval(const envoy_config_cluster_v3_Cluster_RefreshRate *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_Duration*); }
-
-UPB_INLINE void envoy_config_cluster_v3_Cluster_RefreshRate_set_base_interval(envoy_config_cluster_v3_Cluster_RefreshRate *msg, struct google_protobuf_Duration* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct google_protobuf_Duration*) = value;
-}
-UPB_INLINE struct google_protobuf_Duration* envoy_config_cluster_v3_Cluster_RefreshRate_mutable_base_interval(envoy_config_cluster_v3_Cluster_RefreshRate *msg, upb_arena *arena) {
- struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_cluster_v3_Cluster_RefreshRate_base_interval(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_Cluster_RefreshRate_set_base_interval(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_cluster_v3_Cluster_RefreshRate_set_max_interval(envoy_config_cluster_v3_Cluster_RefreshRate *msg, struct google_protobuf_Duration* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_Duration*) = value;
-}
-UPB_INLINE struct google_protobuf_Duration* envoy_config_cluster_v3_Cluster_RefreshRate_mutable_max_interval(envoy_config_cluster_v3_Cluster_RefreshRate *msg, upb_arena *arena) {
- struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_cluster_v3_Cluster_RefreshRate_max_interval(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_Cluster_RefreshRate_set_max_interval(msg, sub);
- }
- return sub;
-}
-
-/* envoy.config.cluster.v3.Cluster.PrefetchPolicy */
-
-UPB_INLINE envoy_config_cluster_v3_Cluster_PrefetchPolicy *envoy_config_cluster_v3_Cluster_PrefetchPolicy_new(upb_arena *arena) {
- return (envoy_config_cluster_v3_Cluster_PrefetchPolicy *)_upb_msg_new(&envoy_config_cluster_v3_Cluster_PrefetchPolicy_msginit, arena);
-}
-UPB_INLINE envoy_config_cluster_v3_Cluster_PrefetchPolicy *envoy_config_cluster_v3_Cluster_PrefetchPolicy_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_cluster_v3_Cluster_PrefetchPolicy *ret = envoy_config_cluster_v3_Cluster_PrefetchPolicy_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_PrefetchPolicy_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_cluster_v3_Cluster_PrefetchPolicy_serialize(const envoy_config_cluster_v3_Cluster_PrefetchPolicy *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_cluster_v3_Cluster_PrefetchPolicy_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_PrefetchPolicy_has_per_upstream_prefetch_ratio(const envoy_config_cluster_v3_Cluster_PrefetchPolicy *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE const struct google_protobuf_DoubleValue* envoy_config_cluster_v3_Cluster_PrefetchPolicy_per_upstream_prefetch_ratio(const envoy_config_cluster_v3_Cluster_PrefetchPolicy *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct google_protobuf_DoubleValue*); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_PrefetchPolicy_has_predictive_prefetch_ratio(const envoy_config_cluster_v3_Cluster_PrefetchPolicy *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
-UPB_INLINE const struct google_protobuf_DoubleValue* envoy_config_cluster_v3_Cluster_PrefetchPolicy_predictive_prefetch_ratio(const envoy_config_cluster_v3_Cluster_PrefetchPolicy *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_DoubleValue*); }
-
-UPB_INLINE void envoy_config_cluster_v3_Cluster_PrefetchPolicy_set_per_upstream_prefetch_ratio(envoy_config_cluster_v3_Cluster_PrefetchPolicy *msg, struct google_protobuf_DoubleValue* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct google_protobuf_DoubleValue*) = value;
-}
-UPB_INLINE struct google_protobuf_DoubleValue* envoy_config_cluster_v3_Cluster_PrefetchPolicy_mutable_per_upstream_prefetch_ratio(envoy_config_cluster_v3_Cluster_PrefetchPolicy *msg, upb_arena *arena) {
- struct google_protobuf_DoubleValue* sub = (struct google_protobuf_DoubleValue*)envoy_config_cluster_v3_Cluster_PrefetchPolicy_per_upstream_prefetch_ratio(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_DoubleValue*)_upb_msg_new(&google_protobuf_DoubleValue_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_Cluster_PrefetchPolicy_set_per_upstream_prefetch_ratio(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_cluster_v3_Cluster_PrefetchPolicy_set_predictive_prefetch_ratio(envoy_config_cluster_v3_Cluster_PrefetchPolicy *msg, struct google_protobuf_DoubleValue* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_DoubleValue*) = value;
-}
-UPB_INLINE struct google_protobuf_DoubleValue* envoy_config_cluster_v3_Cluster_PrefetchPolicy_mutable_predictive_prefetch_ratio(envoy_config_cluster_v3_Cluster_PrefetchPolicy *msg, upb_arena *arena) {
- struct google_protobuf_DoubleValue* sub = (struct google_protobuf_DoubleValue*)envoy_config_cluster_v3_Cluster_PrefetchPolicy_predictive_prefetch_ratio(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_DoubleValue*)_upb_msg_new(&google_protobuf_DoubleValue_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_Cluster_PrefetchPolicy_set_predictive_prefetch_ratio(msg, sub);
- }
- return sub;
-}
-
-/* envoy.config.cluster.v3.Cluster.TypedExtensionProtocolOptionsEntry */
-
-UPB_INLINE upb_strview envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry_key(const envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry *msg) {
- upb_strview ret;
- _upb_msg_map_key(msg, &ret, 0);
- return ret;
-}
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry_has_value(const envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const struct google_protobuf_Any* envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry_value(const envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry *msg) {
- struct google_protobuf_Any* ret;
- _upb_msg_map_value(msg, &ret, sizeof(ret));
- return ret;
-}
-
-UPB_INLINE void envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry_set_value(envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry *msg, struct google_protobuf_Any* value) {
- _upb_msg_map_set_value(msg, &value, sizeof(struct google_protobuf_Any*));
-}
-
-/* envoy.config.cluster.v3.LoadBalancingPolicy */
-
-UPB_INLINE envoy_config_cluster_v3_LoadBalancingPolicy *envoy_config_cluster_v3_LoadBalancingPolicy_new(upb_arena *arena) {
- return (envoy_config_cluster_v3_LoadBalancingPolicy *)_upb_msg_new(&envoy_config_cluster_v3_LoadBalancingPolicy_msginit, arena);
-}
-UPB_INLINE envoy_config_cluster_v3_LoadBalancingPolicy *envoy_config_cluster_v3_LoadBalancingPolicy_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_cluster_v3_LoadBalancingPolicy *ret = envoy_config_cluster_v3_LoadBalancingPolicy_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_cluster_v3_LoadBalancingPolicy_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_cluster_v3_LoadBalancingPolicy_serialize(const envoy_config_cluster_v3_LoadBalancingPolicy *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_cluster_v3_LoadBalancingPolicy_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_config_cluster_v3_LoadBalancingPolicy_has_policies(const envoy_config_cluster_v3_LoadBalancingPolicy *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE const envoy_config_cluster_v3_LoadBalancingPolicy_Policy* const* envoy_config_cluster_v3_LoadBalancingPolicy_policies(const envoy_config_cluster_v3_LoadBalancingPolicy *msg, size_t *len) { return (const envoy_config_cluster_v3_LoadBalancingPolicy_Policy* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
-
-UPB_INLINE envoy_config_cluster_v3_LoadBalancingPolicy_Policy** envoy_config_cluster_v3_LoadBalancingPolicy_mutable_policies(envoy_config_cluster_v3_LoadBalancingPolicy *msg, size_t *len) {
- return (envoy_config_cluster_v3_LoadBalancingPolicy_Policy**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
-}
-UPB_INLINE envoy_config_cluster_v3_LoadBalancingPolicy_Policy** envoy_config_cluster_v3_LoadBalancingPolicy_resize_policies(envoy_config_cluster_v3_LoadBalancingPolicy *msg, size_t len, upb_arena *arena) {
- return (envoy_config_cluster_v3_LoadBalancingPolicy_Policy**)_upb_array_resize_accessor(msg, UPB_SIZE(0, 0), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_config_cluster_v3_LoadBalancingPolicy_Policy* envoy_config_cluster_v3_LoadBalancingPolicy_add_policies(envoy_config_cluster_v3_LoadBalancingPolicy *msg, upb_arena *arena) {
- struct envoy_config_cluster_v3_LoadBalancingPolicy_Policy* sub = (struct envoy_config_cluster_v3_LoadBalancingPolicy_Policy*)_upb_msg_new(&envoy_config_cluster_v3_LoadBalancingPolicy_Policy_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(0, 0), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-
-/* envoy.config.cluster.v3.LoadBalancingPolicy.Policy */
-
-UPB_INLINE envoy_config_cluster_v3_LoadBalancingPolicy_Policy *envoy_config_cluster_v3_LoadBalancingPolicy_Policy_new(upb_arena *arena) {
- return (envoy_config_cluster_v3_LoadBalancingPolicy_Policy *)_upb_msg_new(&envoy_config_cluster_v3_LoadBalancingPolicy_Policy_msginit, arena);
-}
-UPB_INLINE envoy_config_cluster_v3_LoadBalancingPolicy_Policy *envoy_config_cluster_v3_LoadBalancingPolicy_Policy_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_cluster_v3_LoadBalancingPolicy_Policy *ret = envoy_config_cluster_v3_LoadBalancingPolicy_Policy_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_cluster_v3_LoadBalancingPolicy_Policy_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_cluster_v3_LoadBalancingPolicy_Policy_serialize(const envoy_config_cluster_v3_LoadBalancingPolicy_Policy *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_cluster_v3_LoadBalancingPolicy_Policy_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview envoy_config_cluster_v3_LoadBalancingPolicy_Policy_name(const envoy_config_cluster_v3_LoadBalancingPolicy_Policy *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE bool envoy_config_cluster_v3_LoadBalancingPolicy_Policy_has_typed_config(const envoy_config_cluster_v3_LoadBalancingPolicy_Policy *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const struct google_protobuf_Any* envoy_config_cluster_v3_LoadBalancingPolicy_Policy_typed_config(const envoy_config_cluster_v3_LoadBalancingPolicy_Policy *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_Any*); }
-
-UPB_INLINE void envoy_config_cluster_v3_LoadBalancingPolicy_Policy_set_name(envoy_config_cluster_v3_LoadBalancingPolicy_Policy *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_cluster_v3_LoadBalancingPolicy_Policy_set_typed_config(envoy_config_cluster_v3_LoadBalancingPolicy_Policy *msg, struct google_protobuf_Any* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_Any*) = value;
-}
-UPB_INLINE struct google_protobuf_Any* envoy_config_cluster_v3_LoadBalancingPolicy_Policy_mutable_typed_config(envoy_config_cluster_v3_LoadBalancingPolicy_Policy *msg, upb_arena *arena) {
- struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_config_cluster_v3_LoadBalancingPolicy_Policy_typed_config(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_LoadBalancingPolicy_Policy_set_typed_config(msg, sub);
- }
- return sub;
-}
-
-/* envoy.config.cluster.v3.UpstreamBindConfig */
-
-UPB_INLINE envoy_config_cluster_v3_UpstreamBindConfig *envoy_config_cluster_v3_UpstreamBindConfig_new(upb_arena *arena) {
- return (envoy_config_cluster_v3_UpstreamBindConfig *)_upb_msg_new(&envoy_config_cluster_v3_UpstreamBindConfig_msginit, arena);
-}
-UPB_INLINE envoy_config_cluster_v3_UpstreamBindConfig *envoy_config_cluster_v3_UpstreamBindConfig_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_cluster_v3_UpstreamBindConfig *ret = envoy_config_cluster_v3_UpstreamBindConfig_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_cluster_v3_UpstreamBindConfig_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_cluster_v3_UpstreamBindConfig_serialize(const envoy_config_cluster_v3_UpstreamBindConfig *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_cluster_v3_UpstreamBindConfig_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_config_cluster_v3_UpstreamBindConfig_has_source_address(const envoy_config_cluster_v3_UpstreamBindConfig *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE const struct envoy_config_core_v3_Address* envoy_config_cluster_v3_UpstreamBindConfig_source_address(const envoy_config_cluster_v3_UpstreamBindConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct envoy_config_core_v3_Address*); }
-
-UPB_INLINE void envoy_config_cluster_v3_UpstreamBindConfig_set_source_address(envoy_config_cluster_v3_UpstreamBindConfig *msg, struct envoy_config_core_v3_Address* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct envoy_config_core_v3_Address*) = value;
-}
-UPB_INLINE struct envoy_config_core_v3_Address* envoy_config_cluster_v3_UpstreamBindConfig_mutable_source_address(envoy_config_cluster_v3_UpstreamBindConfig *msg, upb_arena *arena) {
- struct envoy_config_core_v3_Address* sub = (struct envoy_config_core_v3_Address*)envoy_config_cluster_v3_UpstreamBindConfig_source_address(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_Address*)_upb_msg_new(&envoy_config_core_v3_Address_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_UpstreamBindConfig_set_source_address(msg, sub);
- }
- return sub;
-}
-
-/* envoy.config.cluster.v3.UpstreamConnectionOptions */
-
-UPB_INLINE envoy_config_cluster_v3_UpstreamConnectionOptions *envoy_config_cluster_v3_UpstreamConnectionOptions_new(upb_arena *arena) {
- return (envoy_config_cluster_v3_UpstreamConnectionOptions *)_upb_msg_new(&envoy_config_cluster_v3_UpstreamConnectionOptions_msginit, arena);
-}
-UPB_INLINE envoy_config_cluster_v3_UpstreamConnectionOptions *envoy_config_cluster_v3_UpstreamConnectionOptions_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_cluster_v3_UpstreamConnectionOptions *ret = envoy_config_cluster_v3_UpstreamConnectionOptions_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_cluster_v3_UpstreamConnectionOptions_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_cluster_v3_UpstreamConnectionOptions_serialize(const envoy_config_cluster_v3_UpstreamConnectionOptions *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_cluster_v3_UpstreamConnectionOptions_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_config_cluster_v3_UpstreamConnectionOptions_has_tcp_keepalive(const envoy_config_cluster_v3_UpstreamConnectionOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE const struct envoy_config_core_v3_TcpKeepalive* envoy_config_cluster_v3_UpstreamConnectionOptions_tcp_keepalive(const envoy_config_cluster_v3_UpstreamConnectionOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct envoy_config_core_v3_TcpKeepalive*); }
-
-UPB_INLINE void envoy_config_cluster_v3_UpstreamConnectionOptions_set_tcp_keepalive(envoy_config_cluster_v3_UpstreamConnectionOptions *msg, struct envoy_config_core_v3_TcpKeepalive* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct envoy_config_core_v3_TcpKeepalive*) = value;
-}
-UPB_INLINE struct envoy_config_core_v3_TcpKeepalive* envoy_config_cluster_v3_UpstreamConnectionOptions_mutable_tcp_keepalive(envoy_config_cluster_v3_UpstreamConnectionOptions *msg, upb_arena *arena) {
- struct envoy_config_core_v3_TcpKeepalive* sub = (struct envoy_config_core_v3_TcpKeepalive*)envoy_config_cluster_v3_UpstreamConnectionOptions_tcp_keepalive(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_TcpKeepalive*)_upb_msg_new(&envoy_config_core_v3_TcpKeepalive_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_UpstreamConnectionOptions_set_tcp_keepalive(msg, sub);
- }
- return sub;
-}
-
-/* envoy.config.cluster.v3.TrackClusterStats */
-
-UPB_INLINE envoy_config_cluster_v3_TrackClusterStats *envoy_config_cluster_v3_TrackClusterStats_new(upb_arena *arena) {
- return (envoy_config_cluster_v3_TrackClusterStats *)_upb_msg_new(&envoy_config_cluster_v3_TrackClusterStats_msginit, arena);
-}
-UPB_INLINE envoy_config_cluster_v3_TrackClusterStats *envoy_config_cluster_v3_TrackClusterStats_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_cluster_v3_TrackClusterStats *ret = envoy_config_cluster_v3_TrackClusterStats_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_cluster_v3_TrackClusterStats_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_cluster_v3_TrackClusterStats_serialize(const envoy_config_cluster_v3_TrackClusterStats *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_cluster_v3_TrackClusterStats_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_config_cluster_v3_TrackClusterStats_timeout_budgets(const envoy_config_cluster_v3_TrackClusterStats *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); }
-UPB_INLINE bool envoy_config_cluster_v3_TrackClusterStats_request_response_sizes(const envoy_config_cluster_v3_TrackClusterStats *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); }
-
-UPB_INLINE void envoy_config_cluster_v3_TrackClusterStats_set_timeout_budgets(envoy_config_cluster_v3_TrackClusterStats *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
-}
-UPB_INLINE void envoy_config_cluster_v3_TrackClusterStats_set_request_response_sizes(envoy_config_cluster_v3_TrackClusterStats *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* ENVOY_CONFIG_CLUSTER_V3_CLUSTER_PROTO_UPB_H_ */
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/cluster/v3/cluster.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_CONFIG_CLUSTER_V3_CLUSTER_PROTO_UPB_H_
+#define ENVOY_CONFIG_CLUSTER_V3_CLUSTER_PROTO_UPB_H_
+
+#include "upb/msg.h"
+#include "upb/decode.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_config_cluster_v3_ClusterCollection;
+struct envoy_config_cluster_v3_Cluster;
+struct envoy_config_cluster_v3_Cluster_TransportSocketMatch;
+struct envoy_config_cluster_v3_Cluster_CustomClusterType;
+struct envoy_config_cluster_v3_Cluster_EdsClusterConfig;
+struct envoy_config_cluster_v3_Cluster_LbSubsetConfig;
+struct envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector;
+struct envoy_config_cluster_v3_Cluster_LeastRequestLbConfig;
+struct envoy_config_cluster_v3_Cluster_RingHashLbConfig;
+struct envoy_config_cluster_v3_Cluster_MaglevLbConfig;
+struct envoy_config_cluster_v3_Cluster_OriginalDstLbConfig;
+struct envoy_config_cluster_v3_Cluster_CommonLbConfig;
+struct envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig;
+struct envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig;
+struct envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig;
+struct envoy_config_cluster_v3_Cluster_RefreshRate;
+struct envoy_config_cluster_v3_Cluster_PrefetchPolicy;
+struct envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry;
+struct envoy_config_cluster_v3_LoadBalancingPolicy;
+struct envoy_config_cluster_v3_LoadBalancingPolicy_Policy;
+struct envoy_config_cluster_v3_UpstreamBindConfig;
+struct envoy_config_cluster_v3_UpstreamConnectionOptions;
+struct envoy_config_cluster_v3_TrackClusterStats;
+typedef struct envoy_config_cluster_v3_ClusterCollection envoy_config_cluster_v3_ClusterCollection;
+typedef struct envoy_config_cluster_v3_Cluster envoy_config_cluster_v3_Cluster;
+typedef struct envoy_config_cluster_v3_Cluster_TransportSocketMatch envoy_config_cluster_v3_Cluster_TransportSocketMatch;
+typedef struct envoy_config_cluster_v3_Cluster_CustomClusterType envoy_config_cluster_v3_Cluster_CustomClusterType;
+typedef struct envoy_config_cluster_v3_Cluster_EdsClusterConfig envoy_config_cluster_v3_Cluster_EdsClusterConfig;
+typedef struct envoy_config_cluster_v3_Cluster_LbSubsetConfig envoy_config_cluster_v3_Cluster_LbSubsetConfig;
+typedef struct envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector;
+typedef struct envoy_config_cluster_v3_Cluster_LeastRequestLbConfig envoy_config_cluster_v3_Cluster_LeastRequestLbConfig;
+typedef struct envoy_config_cluster_v3_Cluster_RingHashLbConfig envoy_config_cluster_v3_Cluster_RingHashLbConfig;
+typedef struct envoy_config_cluster_v3_Cluster_MaglevLbConfig envoy_config_cluster_v3_Cluster_MaglevLbConfig;
+typedef struct envoy_config_cluster_v3_Cluster_OriginalDstLbConfig envoy_config_cluster_v3_Cluster_OriginalDstLbConfig;
+typedef struct envoy_config_cluster_v3_Cluster_CommonLbConfig envoy_config_cluster_v3_Cluster_CommonLbConfig;
+typedef struct envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig;
+typedef struct envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig;
+typedef struct envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig;
+typedef struct envoy_config_cluster_v3_Cluster_RefreshRate envoy_config_cluster_v3_Cluster_RefreshRate;
+typedef struct envoy_config_cluster_v3_Cluster_PrefetchPolicy envoy_config_cluster_v3_Cluster_PrefetchPolicy;
+typedef struct envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry;
+typedef struct envoy_config_cluster_v3_LoadBalancingPolicy envoy_config_cluster_v3_LoadBalancingPolicy;
+typedef struct envoy_config_cluster_v3_LoadBalancingPolicy_Policy envoy_config_cluster_v3_LoadBalancingPolicy_Policy;
+typedef struct envoy_config_cluster_v3_UpstreamBindConfig envoy_config_cluster_v3_UpstreamBindConfig;
+typedef struct envoy_config_cluster_v3_UpstreamConnectionOptions envoy_config_cluster_v3_UpstreamConnectionOptions;
+typedef struct envoy_config_cluster_v3_TrackClusterStats envoy_config_cluster_v3_TrackClusterStats;
+extern const upb_msglayout envoy_config_cluster_v3_ClusterCollection_msginit;
+extern const upb_msglayout envoy_config_cluster_v3_Cluster_msginit;
+extern const upb_msglayout envoy_config_cluster_v3_Cluster_TransportSocketMatch_msginit;
+extern const upb_msglayout envoy_config_cluster_v3_Cluster_CustomClusterType_msginit;
+extern const upb_msglayout envoy_config_cluster_v3_Cluster_EdsClusterConfig_msginit;
+extern const upb_msglayout envoy_config_cluster_v3_Cluster_LbSubsetConfig_msginit;
+extern const upb_msglayout envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_msginit;
+extern const upb_msglayout envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_msginit;
+extern const upb_msglayout envoy_config_cluster_v3_Cluster_RingHashLbConfig_msginit;
+extern const upb_msglayout envoy_config_cluster_v3_Cluster_MaglevLbConfig_msginit;
+extern const upb_msglayout envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_msginit;
+extern const upb_msglayout envoy_config_cluster_v3_Cluster_CommonLbConfig_msginit;
+extern const upb_msglayout envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_msginit;
+extern const upb_msglayout envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig_msginit;
+extern const upb_msglayout envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_msginit;
+extern const upb_msglayout envoy_config_cluster_v3_Cluster_RefreshRate_msginit;
+extern const upb_msglayout envoy_config_cluster_v3_Cluster_PrefetchPolicy_msginit;
+extern const upb_msglayout envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry_msginit;
+extern const upb_msglayout envoy_config_cluster_v3_LoadBalancingPolicy_msginit;
+extern const upb_msglayout envoy_config_cluster_v3_LoadBalancingPolicy_Policy_msginit;
+extern const upb_msglayout envoy_config_cluster_v3_UpstreamBindConfig_msginit;
+extern const upb_msglayout envoy_config_cluster_v3_UpstreamConnectionOptions_msginit;
+extern const upb_msglayout envoy_config_cluster_v3_TrackClusterStats_msginit;
+struct envoy_config_cluster_v3_CircuitBreakers;
+struct envoy_config_cluster_v3_Filter;
+struct envoy_config_cluster_v3_OutlierDetection;
+struct envoy_config_core_v3_Address;
+struct envoy_config_core_v3_BindConfig;
+struct envoy_config_core_v3_ConfigSource;
+struct envoy_config_core_v3_HealthCheck;
+struct envoy_config_core_v3_Http1ProtocolOptions;
+struct envoy_config_core_v3_Http2ProtocolOptions;
+struct envoy_config_core_v3_HttpProtocolOptions;
+struct envoy_config_core_v3_Metadata;
+struct envoy_config_core_v3_RuntimeDouble;
+struct envoy_config_core_v3_TcpKeepalive;
+struct envoy_config_core_v3_TransportSocket;
+struct envoy_config_core_v3_TypedExtensionConfig;
+struct envoy_config_core_v3_UpstreamHttpProtocolOptions;
+struct envoy_config_endpoint_v3_ClusterLoadAssignment;
+struct envoy_type_v3_Percent;
+struct google_protobuf_Any;
+struct google_protobuf_DoubleValue;
+struct google_protobuf_Duration;
+struct google_protobuf_Struct;
+struct google_protobuf_UInt32Value;
+struct google_protobuf_UInt64Value;
+struct udpa_core_v1_CollectionEntry;
+struct udpa_core_v1_ResourceLocator;
+extern const upb_msglayout envoy_config_cluster_v3_CircuitBreakers_msginit;
+extern const upb_msglayout envoy_config_cluster_v3_Filter_msginit;
+extern const upb_msglayout envoy_config_cluster_v3_OutlierDetection_msginit;
+extern const upb_msglayout envoy_config_core_v3_Address_msginit;
+extern const upb_msglayout envoy_config_core_v3_BindConfig_msginit;
+extern const upb_msglayout envoy_config_core_v3_ConfigSource_msginit;
+extern const upb_msglayout envoy_config_core_v3_HealthCheck_msginit;
+extern const upb_msglayout envoy_config_core_v3_Http1ProtocolOptions_msginit;
+extern const upb_msglayout envoy_config_core_v3_Http2ProtocolOptions_msginit;
+extern const upb_msglayout envoy_config_core_v3_HttpProtocolOptions_msginit;
+extern const upb_msglayout envoy_config_core_v3_Metadata_msginit;
+extern const upb_msglayout envoy_config_core_v3_RuntimeDouble_msginit;
+extern const upb_msglayout envoy_config_core_v3_TcpKeepalive_msginit;
+extern const upb_msglayout envoy_config_core_v3_TransportSocket_msginit;
+extern const upb_msglayout envoy_config_core_v3_TypedExtensionConfig_msginit;
+extern const upb_msglayout envoy_config_core_v3_UpstreamHttpProtocolOptions_msginit;
+extern const upb_msglayout envoy_config_endpoint_v3_ClusterLoadAssignment_msginit;
+extern const upb_msglayout envoy_type_v3_Percent_msginit;
+extern const upb_msglayout google_protobuf_Any_msginit;
+extern const upb_msglayout google_protobuf_DoubleValue_msginit;
+extern const upb_msglayout google_protobuf_Duration_msginit;
+extern const upb_msglayout google_protobuf_Struct_msginit;
+extern const upb_msglayout google_protobuf_UInt32Value_msginit;
+extern const upb_msglayout google_protobuf_UInt64Value_msginit;
+extern const upb_msglayout udpa_core_v1_CollectionEntry_msginit;
+extern const upb_msglayout udpa_core_v1_ResourceLocator_msginit;
+
+typedef enum {
+ envoy_config_cluster_v3_Cluster_USE_CONFIGURED_PROTOCOL = 0,
+ envoy_config_cluster_v3_Cluster_USE_DOWNSTREAM_PROTOCOL = 1
+} envoy_config_cluster_v3_Cluster_ClusterProtocolSelection;
+
+typedef enum {
+ envoy_config_cluster_v3_Cluster_STATIC = 0,
+ envoy_config_cluster_v3_Cluster_STRICT_DNS = 1,
+ envoy_config_cluster_v3_Cluster_LOGICAL_DNS = 2,
+ envoy_config_cluster_v3_Cluster_EDS = 3,
+ envoy_config_cluster_v3_Cluster_ORIGINAL_DST = 4
+} envoy_config_cluster_v3_Cluster_DiscoveryType;
+
+typedef enum {
+ envoy_config_cluster_v3_Cluster_AUTO = 0,
+ envoy_config_cluster_v3_Cluster_V4_ONLY = 1,
+ envoy_config_cluster_v3_Cluster_V6_ONLY = 2
+} envoy_config_cluster_v3_Cluster_DnsLookupFamily;
+
+typedef enum {
+ envoy_config_cluster_v3_Cluster_ROUND_ROBIN = 0,
+ envoy_config_cluster_v3_Cluster_LEAST_REQUEST = 1,
+ envoy_config_cluster_v3_Cluster_RING_HASH = 2,
+ envoy_config_cluster_v3_Cluster_RANDOM = 3,
+ envoy_config_cluster_v3_Cluster_MAGLEV = 5,
+ envoy_config_cluster_v3_Cluster_CLUSTER_PROVIDED = 6,
+ envoy_config_cluster_v3_Cluster_LOAD_BALANCING_POLICY_CONFIG = 7
+} envoy_config_cluster_v3_Cluster_LbPolicy;
+
+typedef enum {
+ envoy_config_cluster_v3_Cluster_LbSubsetConfig_NO_FALLBACK = 0,
+ envoy_config_cluster_v3_Cluster_LbSubsetConfig_ANY_ENDPOINT = 1,
+ envoy_config_cluster_v3_Cluster_LbSubsetConfig_DEFAULT_SUBSET = 2
+} envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetFallbackPolicy;
+
+typedef enum {
+ envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_NOT_DEFINED = 0,
+ envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_NO_FALLBACK = 1,
+ envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_ANY_ENDPOINT = 2,
+ envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_DEFAULT_SUBSET = 3,
+ envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_KEYS_SUBSET = 4
+} envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_LbSubsetSelectorFallbackPolicy;
+
+typedef enum {
+ envoy_config_cluster_v3_Cluster_RingHashLbConfig_XX_HASH = 0,
+ envoy_config_cluster_v3_Cluster_RingHashLbConfig_MURMUR_HASH_2 = 1
+} envoy_config_cluster_v3_Cluster_RingHashLbConfig_HashFunction;
+
+
+/* envoy.config.cluster.v3.ClusterCollection */
+
+UPB_INLINE envoy_config_cluster_v3_ClusterCollection *envoy_config_cluster_v3_ClusterCollection_new(upb_arena *arena) {
+ return (envoy_config_cluster_v3_ClusterCollection *)_upb_msg_new(&envoy_config_cluster_v3_ClusterCollection_msginit, arena);
+}
+UPB_INLINE envoy_config_cluster_v3_ClusterCollection *envoy_config_cluster_v3_ClusterCollection_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_cluster_v3_ClusterCollection *ret = envoy_config_cluster_v3_ClusterCollection_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_cluster_v3_ClusterCollection_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_cluster_v3_ClusterCollection_serialize(const envoy_config_cluster_v3_ClusterCollection *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_cluster_v3_ClusterCollection_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_cluster_v3_ClusterCollection_has_entries(const envoy_config_cluster_v3_ClusterCollection *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE const struct udpa_core_v1_CollectionEntry* envoy_config_cluster_v3_ClusterCollection_entries(const envoy_config_cluster_v3_ClusterCollection *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct udpa_core_v1_CollectionEntry*); }
+
+UPB_INLINE void envoy_config_cluster_v3_ClusterCollection_set_entries(envoy_config_cluster_v3_ClusterCollection *msg, struct udpa_core_v1_CollectionEntry* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct udpa_core_v1_CollectionEntry*) = value;
+}
+UPB_INLINE struct udpa_core_v1_CollectionEntry* envoy_config_cluster_v3_ClusterCollection_mutable_entries(envoy_config_cluster_v3_ClusterCollection *msg, upb_arena *arena) {
+ struct udpa_core_v1_CollectionEntry* sub = (struct udpa_core_v1_CollectionEntry*)envoy_config_cluster_v3_ClusterCollection_entries(msg);
+ if (sub == NULL) {
+ sub = (struct udpa_core_v1_CollectionEntry*)_upb_msg_new(&udpa_core_v1_CollectionEntry_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_ClusterCollection_set_entries(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.cluster.v3.Cluster */
+
+UPB_INLINE envoy_config_cluster_v3_Cluster *envoy_config_cluster_v3_Cluster_new(upb_arena *arena) {
+ return (envoy_config_cluster_v3_Cluster *)_upb_msg_new(&envoy_config_cluster_v3_Cluster_msginit, arena);
+}
+UPB_INLINE envoy_config_cluster_v3_Cluster *envoy_config_cluster_v3_Cluster_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_cluster_v3_Cluster *ret = envoy_config_cluster_v3_Cluster_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_cluster_v3_Cluster_serialize(const envoy_config_cluster_v3_Cluster *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_cluster_v3_Cluster_msginit, arena, len);
+}
+
+typedef enum {
+ envoy_config_cluster_v3_Cluster_cluster_discovery_type_type = 2,
+ envoy_config_cluster_v3_Cluster_cluster_discovery_type_cluster_type = 38,
+ envoy_config_cluster_v3_Cluster_cluster_discovery_type_NOT_SET = 0
+} envoy_config_cluster_v3_Cluster_cluster_discovery_type_oneofcases;
+UPB_INLINE envoy_config_cluster_v3_Cluster_cluster_discovery_type_oneofcases envoy_config_cluster_v3_Cluster_cluster_discovery_type_case(const envoy_config_cluster_v3_Cluster* msg) { return (envoy_config_cluster_v3_Cluster_cluster_discovery_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(176, 312), int32_t); }
+
+typedef enum {
+ envoy_config_cluster_v3_Cluster_lb_config_ring_hash_lb_config = 23,
+ envoy_config_cluster_v3_Cluster_lb_config_maglev_lb_config = 52,
+ envoy_config_cluster_v3_Cluster_lb_config_original_dst_lb_config = 34,
+ envoy_config_cluster_v3_Cluster_lb_config_least_request_lb_config = 37,
+ envoy_config_cluster_v3_Cluster_lb_config_NOT_SET = 0
+} envoy_config_cluster_v3_Cluster_lb_config_oneofcases;
+UPB_INLINE envoy_config_cluster_v3_Cluster_lb_config_oneofcases envoy_config_cluster_v3_Cluster_lb_config_case(const envoy_config_cluster_v3_Cluster* msg) { return (envoy_config_cluster_v3_Cluster_lb_config_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(184, 328), int32_t); }
+
+UPB_INLINE upb_strview envoy_config_cluster_v3_Cluster_name(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 32), upb_strview); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_type(const envoy_config_cluster_v3_Cluster *msg) { return _upb_getoneofcase(msg, UPB_SIZE(176, 312)) == 2; }
+UPB_INLINE int32_t envoy_config_cluster_v3_Cluster_type(const envoy_config_cluster_v3_Cluster *msg) { return UPB_READ_ONEOF(msg, int32_t, UPB_SIZE(168, 304), UPB_SIZE(176, 312), 2, 0); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_eds_cluster_config(const envoy_config_cluster_v3_Cluster *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(48, 64)); }
+UPB_INLINE const envoy_config_cluster_v3_Cluster_EdsClusterConfig* envoy_config_cluster_v3_Cluster_eds_cluster_config(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(48, 64), const envoy_config_cluster_v3_Cluster_EdsClusterConfig*); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_connect_timeout(const envoy_config_cluster_v3_Cluster *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(52, 72)); }
+UPB_INLINE const struct google_protobuf_Duration* envoy_config_cluster_v3_Cluster_connect_timeout(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(52, 72), const struct google_protobuf_Duration*); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_per_connection_buffer_limit_bytes(const envoy_config_cluster_v3_Cluster *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(56, 80)); }
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_Cluster_per_connection_buffer_limit_bytes(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(56, 80), const struct google_protobuf_UInt32Value*); }
+UPB_INLINE int32_t envoy_config_cluster_v3_Cluster_lb_policy(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_health_checks(const envoy_config_cluster_v3_Cluster *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(148, 264)); }
+UPB_INLINE const struct envoy_config_core_v3_HealthCheck* const* envoy_config_cluster_v3_Cluster_health_checks(const envoy_config_cluster_v3_Cluster *msg, size_t *len) { return (const struct envoy_config_core_v3_HealthCheck* const*)_upb_array_accessor(msg, UPB_SIZE(148, 264), len); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_max_requests_per_connection(const envoy_config_cluster_v3_Cluster *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(60, 88)); }
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_Cluster_max_requests_per_connection(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(60, 88), const struct google_protobuf_UInt32Value*); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_circuit_breakers(const envoy_config_cluster_v3_Cluster *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(64, 96)); }
+UPB_INLINE const struct envoy_config_cluster_v3_CircuitBreakers* envoy_config_cluster_v3_Cluster_circuit_breakers(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(64, 96), const struct envoy_config_cluster_v3_CircuitBreakers*); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_http_protocol_options(const envoy_config_cluster_v3_Cluster *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(68, 104)); }
+UPB_INLINE const struct envoy_config_core_v3_Http1ProtocolOptions* envoy_config_cluster_v3_Cluster_http_protocol_options(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(68, 104), const struct envoy_config_core_v3_Http1ProtocolOptions*); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_http2_protocol_options(const envoy_config_cluster_v3_Cluster *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(72, 112)); }
+UPB_INLINE const struct envoy_config_core_v3_Http2ProtocolOptions* envoy_config_cluster_v3_Cluster_http2_protocol_options(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(72, 112), const struct envoy_config_core_v3_Http2ProtocolOptions*); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_dns_refresh_rate(const envoy_config_cluster_v3_Cluster *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(76, 120)); }
+UPB_INLINE const struct google_protobuf_Duration* envoy_config_cluster_v3_Cluster_dns_refresh_rate(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(76, 120), const struct google_protobuf_Duration*); }
+UPB_INLINE int32_t envoy_config_cluster_v3_Cluster_dns_lookup_family(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_dns_resolvers(const envoy_config_cluster_v3_Cluster *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(152, 272)); }
+UPB_INLINE const struct envoy_config_core_v3_Address* const* envoy_config_cluster_v3_Cluster_dns_resolvers(const envoy_config_cluster_v3_Cluster *msg, size_t *len) { return (const struct envoy_config_core_v3_Address* const*)_upb_array_accessor(msg, UPB_SIZE(152, 272), len); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_outlier_detection(const envoy_config_cluster_v3_Cluster *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(80, 128)); }
+UPB_INLINE const struct envoy_config_cluster_v3_OutlierDetection* envoy_config_cluster_v3_Cluster_outlier_detection(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(80, 128), const struct envoy_config_cluster_v3_OutlierDetection*); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_cleanup_interval(const envoy_config_cluster_v3_Cluster *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(84, 136)); }
+UPB_INLINE const struct google_protobuf_Duration* envoy_config_cluster_v3_Cluster_cleanup_interval(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(84, 136), const struct google_protobuf_Duration*); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_upstream_bind_config(const envoy_config_cluster_v3_Cluster *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(88, 144)); }
+UPB_INLINE const struct envoy_config_core_v3_BindConfig* envoy_config_cluster_v3_Cluster_upstream_bind_config(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(88, 144), const struct envoy_config_core_v3_BindConfig*); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_lb_subset_config(const envoy_config_cluster_v3_Cluster *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(92, 152)); }
+UPB_INLINE const envoy_config_cluster_v3_Cluster_LbSubsetConfig* envoy_config_cluster_v3_Cluster_lb_subset_config(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(92, 152), const envoy_config_cluster_v3_Cluster_LbSubsetConfig*); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_ring_hash_lb_config(const envoy_config_cluster_v3_Cluster *msg) { return _upb_getoneofcase(msg, UPB_SIZE(184, 328)) == 23; }
+UPB_INLINE const envoy_config_cluster_v3_Cluster_RingHashLbConfig* envoy_config_cluster_v3_Cluster_ring_hash_lb_config(const envoy_config_cluster_v3_Cluster *msg) { return UPB_READ_ONEOF(msg, const envoy_config_cluster_v3_Cluster_RingHashLbConfig*, UPB_SIZE(180, 320), UPB_SIZE(184, 328), 23, NULL); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_transport_socket(const envoy_config_cluster_v3_Cluster *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(96, 160)); }
+UPB_INLINE const struct envoy_config_core_v3_TransportSocket* envoy_config_cluster_v3_Cluster_transport_socket(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(96, 160), const struct envoy_config_core_v3_TransportSocket*); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_metadata(const envoy_config_cluster_v3_Cluster *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(100, 168)); }
+UPB_INLINE const struct envoy_config_core_v3_Metadata* envoy_config_cluster_v3_Cluster_metadata(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(100, 168), const struct envoy_config_core_v3_Metadata*); }
+UPB_INLINE int32_t envoy_config_cluster_v3_Cluster_protocol_selection(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_common_lb_config(const envoy_config_cluster_v3_Cluster *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(104, 176)); }
+UPB_INLINE const envoy_config_cluster_v3_Cluster_CommonLbConfig* envoy_config_cluster_v3_Cluster_common_lb_config(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(104, 176), const envoy_config_cluster_v3_Cluster_CommonLbConfig*); }
+UPB_INLINE upb_strview envoy_config_cluster_v3_Cluster_alt_stat_name(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(40, 48), upb_strview); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_common_http_protocol_options(const envoy_config_cluster_v3_Cluster *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(108, 184)); }
+UPB_INLINE const struct envoy_config_core_v3_HttpProtocolOptions* envoy_config_cluster_v3_Cluster_common_http_protocol_options(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(108, 184), const struct envoy_config_core_v3_HttpProtocolOptions*); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_upstream_connection_options(const envoy_config_cluster_v3_Cluster *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(112, 192)); }
+UPB_INLINE const envoy_config_cluster_v3_UpstreamConnectionOptions* envoy_config_cluster_v3_Cluster_upstream_connection_options(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(112, 192), const envoy_config_cluster_v3_UpstreamConnectionOptions*); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_close_connections_on_host_health_failure(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_ignore_health_on_host_removal(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(25, 25), bool); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_load_assignment(const envoy_config_cluster_v3_Cluster *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(116, 200)); }
+UPB_INLINE const struct envoy_config_endpoint_v3_ClusterLoadAssignment* envoy_config_cluster_v3_Cluster_load_assignment(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(116, 200), const struct envoy_config_endpoint_v3_ClusterLoadAssignment*); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_original_dst_lb_config(const envoy_config_cluster_v3_Cluster *msg) { return _upb_getoneofcase(msg, UPB_SIZE(184, 328)) == 34; }
+UPB_INLINE const envoy_config_cluster_v3_Cluster_OriginalDstLbConfig* envoy_config_cluster_v3_Cluster_original_dst_lb_config(const envoy_config_cluster_v3_Cluster *msg) { return UPB_READ_ONEOF(msg, const envoy_config_cluster_v3_Cluster_OriginalDstLbConfig*, UPB_SIZE(180, 320), UPB_SIZE(184, 328), 34, NULL); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_typed_extension_protocol_options(const envoy_config_cluster_v3_Cluster *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(156, 280)); }
+UPB_INLINE size_t envoy_config_cluster_v3_Cluster_typed_extension_protocol_options_size(const envoy_config_cluster_v3_Cluster *msg) {return _upb_msg_map_size(msg, UPB_SIZE(156, 280)); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_typed_extension_protocol_options_get(const envoy_config_cluster_v3_Cluster *msg, upb_strview key, struct google_protobuf_Any* *val) { return _upb_msg_map_get(msg, UPB_SIZE(156, 280), &key, 0, val, sizeof(*val)); }
+UPB_INLINE const envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry* envoy_config_cluster_v3_Cluster_typed_extension_protocol_options_next(const envoy_config_cluster_v3_Cluster *msg, size_t* iter) { return (const envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry*)_upb_msg_map_next(msg, UPB_SIZE(156, 280), iter); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_least_request_lb_config(const envoy_config_cluster_v3_Cluster *msg) { return _upb_getoneofcase(msg, UPB_SIZE(184, 328)) == 37; }
+UPB_INLINE const envoy_config_cluster_v3_Cluster_LeastRequestLbConfig* envoy_config_cluster_v3_Cluster_least_request_lb_config(const envoy_config_cluster_v3_Cluster *msg) { return UPB_READ_ONEOF(msg, const envoy_config_cluster_v3_Cluster_LeastRequestLbConfig*, UPB_SIZE(180, 320), UPB_SIZE(184, 328), 37, NULL); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_cluster_type(const envoy_config_cluster_v3_Cluster *msg) { return _upb_getoneofcase(msg, UPB_SIZE(176, 312)) == 38; }
+UPB_INLINE const envoy_config_cluster_v3_Cluster_CustomClusterType* envoy_config_cluster_v3_Cluster_cluster_type(const envoy_config_cluster_v3_Cluster *msg) { return UPB_READ_ONEOF(msg, const envoy_config_cluster_v3_Cluster_CustomClusterType*, UPB_SIZE(168, 304), UPB_SIZE(176, 312), 38, NULL); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_respect_dns_ttl(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(26, 26), bool); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_filters(const envoy_config_cluster_v3_Cluster *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(160, 288)); }
+UPB_INLINE const struct envoy_config_cluster_v3_Filter* const* envoy_config_cluster_v3_Cluster_filters(const envoy_config_cluster_v3_Cluster *msg, size_t *len) { return (const struct envoy_config_cluster_v3_Filter* const*)_upb_array_accessor(msg, UPB_SIZE(160, 288), len); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_load_balancing_policy(const envoy_config_cluster_v3_Cluster *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(120, 208)); }
+UPB_INLINE const envoy_config_cluster_v3_LoadBalancingPolicy* envoy_config_cluster_v3_Cluster_load_balancing_policy(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(120, 208), const envoy_config_cluster_v3_LoadBalancingPolicy*); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_lrs_server(const envoy_config_cluster_v3_Cluster *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(124, 216)); }
+UPB_INLINE const struct envoy_config_core_v3_ConfigSource* envoy_config_cluster_v3_Cluster_lrs_server(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(124, 216), const struct envoy_config_core_v3_ConfigSource*); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_transport_socket_matches(const envoy_config_cluster_v3_Cluster *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(164, 296)); }
+UPB_INLINE const envoy_config_cluster_v3_Cluster_TransportSocketMatch* const* envoy_config_cluster_v3_Cluster_transport_socket_matches(const envoy_config_cluster_v3_Cluster *msg, size_t *len) { return (const envoy_config_cluster_v3_Cluster_TransportSocketMatch* const*)_upb_array_accessor(msg, UPB_SIZE(164, 296), len); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_dns_failure_refresh_rate(const envoy_config_cluster_v3_Cluster *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(128, 224)); }
+UPB_INLINE const envoy_config_cluster_v3_Cluster_RefreshRate* envoy_config_cluster_v3_Cluster_dns_failure_refresh_rate(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(128, 224), const envoy_config_cluster_v3_Cluster_RefreshRate*); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_use_tcp_for_dns_lookups(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(27, 27), bool); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_upstream_http_protocol_options(const envoy_config_cluster_v3_Cluster *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(132, 232)); }
+UPB_INLINE const struct envoy_config_core_v3_UpstreamHttpProtocolOptions* envoy_config_cluster_v3_Cluster_upstream_http_protocol_options(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(132, 232), const struct envoy_config_core_v3_UpstreamHttpProtocolOptions*); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_track_timeout_budgets(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 28), bool); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_upstream_config(const envoy_config_cluster_v3_Cluster *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(136, 240)); }
+UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_cluster_v3_Cluster_upstream_config(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(136, 240), const struct envoy_config_core_v3_TypedExtensionConfig*); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_track_cluster_stats(const envoy_config_cluster_v3_Cluster *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(140, 248)); }
+UPB_INLINE const envoy_config_cluster_v3_TrackClusterStats* envoy_config_cluster_v3_Cluster_track_cluster_stats(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(140, 248), const envoy_config_cluster_v3_TrackClusterStats*); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_prefetch_policy(const envoy_config_cluster_v3_Cluster *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(144, 256)); }
+UPB_INLINE const envoy_config_cluster_v3_Cluster_PrefetchPolicy* envoy_config_cluster_v3_Cluster_prefetch_policy(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(144, 256), const envoy_config_cluster_v3_Cluster_PrefetchPolicy*); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_connection_pool_per_downstream_connection(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(29, 29), bool); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_maglev_lb_config(const envoy_config_cluster_v3_Cluster *msg) { return _upb_getoneofcase(msg, UPB_SIZE(184, 328)) == 52; }
+UPB_INLINE const envoy_config_cluster_v3_Cluster_MaglevLbConfig* envoy_config_cluster_v3_Cluster_maglev_lb_config(const envoy_config_cluster_v3_Cluster *msg) { return UPB_READ_ONEOF(msg, const envoy_config_cluster_v3_Cluster_MaglevLbConfig*, UPB_SIZE(180, 320), UPB_SIZE(184, 328), 52, NULL); }
+
+UPB_INLINE void envoy_config_cluster_v3_Cluster_set_name(envoy_config_cluster_v3_Cluster *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 32), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_set_type(envoy_config_cluster_v3_Cluster *msg, int32_t value) {
+ UPB_WRITE_ONEOF(msg, int32_t, UPB_SIZE(168, 304), value, UPB_SIZE(176, 312), 2);
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_set_eds_cluster_config(envoy_config_cluster_v3_Cluster *msg, envoy_config_cluster_v3_Cluster_EdsClusterConfig* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(48, 64), envoy_config_cluster_v3_Cluster_EdsClusterConfig*) = value;
+}
+UPB_INLINE struct envoy_config_cluster_v3_Cluster_EdsClusterConfig* envoy_config_cluster_v3_Cluster_mutable_eds_cluster_config(envoy_config_cluster_v3_Cluster *msg, upb_arena *arena) {
+ struct envoy_config_cluster_v3_Cluster_EdsClusterConfig* sub = (struct envoy_config_cluster_v3_Cluster_EdsClusterConfig*)envoy_config_cluster_v3_Cluster_eds_cluster_config(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_cluster_v3_Cluster_EdsClusterConfig*)_upb_msg_new(&envoy_config_cluster_v3_Cluster_EdsClusterConfig_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_Cluster_set_eds_cluster_config(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_set_connect_timeout(envoy_config_cluster_v3_Cluster *msg, struct google_protobuf_Duration* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(52, 72), struct google_protobuf_Duration*) = value;
+}
+UPB_INLINE struct google_protobuf_Duration* envoy_config_cluster_v3_Cluster_mutable_connect_timeout(envoy_config_cluster_v3_Cluster *msg, upb_arena *arena) {
+ struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_cluster_v3_Cluster_connect_timeout(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_Cluster_set_connect_timeout(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_set_per_connection_buffer_limit_bytes(envoy_config_cluster_v3_Cluster *msg, struct google_protobuf_UInt32Value* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(56, 80), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_Cluster_mutable_per_connection_buffer_limit_bytes(envoy_config_cluster_v3_Cluster *msg, upb_arena *arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_cluster_v3_Cluster_per_connection_buffer_limit_bytes(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_Cluster_set_per_connection_buffer_limit_bytes(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_set_lb_policy(envoy_config_cluster_v3_Cluster *msg, int32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_HealthCheck** envoy_config_cluster_v3_Cluster_mutable_health_checks(envoy_config_cluster_v3_Cluster *msg, size_t *len) {
+ return (struct envoy_config_core_v3_HealthCheck**)_upb_array_mutable_accessor(msg, UPB_SIZE(148, 264), len);
+}
+UPB_INLINE struct envoy_config_core_v3_HealthCheck** envoy_config_cluster_v3_Cluster_resize_health_checks(envoy_config_cluster_v3_Cluster *msg, size_t len, upb_arena *arena) {
+ return (struct envoy_config_core_v3_HealthCheck**)_upb_array_resize_accessor(msg, UPB_SIZE(148, 264), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_config_core_v3_HealthCheck* envoy_config_cluster_v3_Cluster_add_health_checks(envoy_config_cluster_v3_Cluster *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_HealthCheck* sub = (struct envoy_config_core_v3_HealthCheck*)_upb_msg_new(&envoy_config_core_v3_HealthCheck_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(148, 264), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_set_max_requests_per_connection(envoy_config_cluster_v3_Cluster *msg, struct google_protobuf_UInt32Value* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(60, 88), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_Cluster_mutable_max_requests_per_connection(envoy_config_cluster_v3_Cluster *msg, upb_arena *arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_cluster_v3_Cluster_max_requests_per_connection(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_Cluster_set_max_requests_per_connection(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_set_circuit_breakers(envoy_config_cluster_v3_Cluster *msg, struct envoy_config_cluster_v3_CircuitBreakers* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(64, 96), struct envoy_config_cluster_v3_CircuitBreakers*) = value;
+}
+UPB_INLINE struct envoy_config_cluster_v3_CircuitBreakers* envoy_config_cluster_v3_Cluster_mutable_circuit_breakers(envoy_config_cluster_v3_Cluster *msg, upb_arena *arena) {
+ struct envoy_config_cluster_v3_CircuitBreakers* sub = (struct envoy_config_cluster_v3_CircuitBreakers*)envoy_config_cluster_v3_Cluster_circuit_breakers(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_cluster_v3_CircuitBreakers*)_upb_msg_new(&envoy_config_cluster_v3_CircuitBreakers_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_Cluster_set_circuit_breakers(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_set_http_protocol_options(envoy_config_cluster_v3_Cluster *msg, struct envoy_config_core_v3_Http1ProtocolOptions* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(68, 104), struct envoy_config_core_v3_Http1ProtocolOptions*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_Http1ProtocolOptions* envoy_config_cluster_v3_Cluster_mutable_http_protocol_options(envoy_config_cluster_v3_Cluster *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_Http1ProtocolOptions* sub = (struct envoy_config_core_v3_Http1ProtocolOptions*)envoy_config_cluster_v3_Cluster_http_protocol_options(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_Http1ProtocolOptions*)_upb_msg_new(&envoy_config_core_v3_Http1ProtocolOptions_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_Cluster_set_http_protocol_options(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_set_http2_protocol_options(envoy_config_cluster_v3_Cluster *msg, struct envoy_config_core_v3_Http2ProtocolOptions* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(72, 112), struct envoy_config_core_v3_Http2ProtocolOptions*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_Http2ProtocolOptions* envoy_config_cluster_v3_Cluster_mutable_http2_protocol_options(envoy_config_cluster_v3_Cluster *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_Http2ProtocolOptions* sub = (struct envoy_config_core_v3_Http2ProtocolOptions*)envoy_config_cluster_v3_Cluster_http2_protocol_options(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_Http2ProtocolOptions*)_upb_msg_new(&envoy_config_core_v3_Http2ProtocolOptions_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_Cluster_set_http2_protocol_options(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_set_dns_refresh_rate(envoy_config_cluster_v3_Cluster *msg, struct google_protobuf_Duration* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(76, 120), struct google_protobuf_Duration*) = value;
+}
+UPB_INLINE struct google_protobuf_Duration* envoy_config_cluster_v3_Cluster_mutable_dns_refresh_rate(envoy_config_cluster_v3_Cluster *msg, upb_arena *arena) {
+ struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_cluster_v3_Cluster_dns_refresh_rate(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_Cluster_set_dns_refresh_rate(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_set_dns_lookup_family(envoy_config_cluster_v3_Cluster *msg, int32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_Address** envoy_config_cluster_v3_Cluster_mutable_dns_resolvers(envoy_config_cluster_v3_Cluster *msg, size_t *len) {
+ return (struct envoy_config_core_v3_Address**)_upb_array_mutable_accessor(msg, UPB_SIZE(152, 272), len);
+}
+UPB_INLINE struct envoy_config_core_v3_Address** envoy_config_cluster_v3_Cluster_resize_dns_resolvers(envoy_config_cluster_v3_Cluster *msg, size_t len, upb_arena *arena) {
+ return (struct envoy_config_core_v3_Address**)_upb_array_resize_accessor(msg, UPB_SIZE(152, 272), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_config_core_v3_Address* envoy_config_cluster_v3_Cluster_add_dns_resolvers(envoy_config_cluster_v3_Cluster *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_Address* sub = (struct envoy_config_core_v3_Address*)_upb_msg_new(&envoy_config_core_v3_Address_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(152, 272), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_set_outlier_detection(envoy_config_cluster_v3_Cluster *msg, struct envoy_config_cluster_v3_OutlierDetection* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(80, 128), struct envoy_config_cluster_v3_OutlierDetection*) = value;
+}
+UPB_INLINE struct envoy_config_cluster_v3_OutlierDetection* envoy_config_cluster_v3_Cluster_mutable_outlier_detection(envoy_config_cluster_v3_Cluster *msg, upb_arena *arena) {
+ struct envoy_config_cluster_v3_OutlierDetection* sub = (struct envoy_config_cluster_v3_OutlierDetection*)envoy_config_cluster_v3_Cluster_outlier_detection(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_cluster_v3_OutlierDetection*)_upb_msg_new(&envoy_config_cluster_v3_OutlierDetection_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_Cluster_set_outlier_detection(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_set_cleanup_interval(envoy_config_cluster_v3_Cluster *msg, struct google_protobuf_Duration* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(84, 136), struct google_protobuf_Duration*) = value;
+}
+UPB_INLINE struct google_protobuf_Duration* envoy_config_cluster_v3_Cluster_mutable_cleanup_interval(envoy_config_cluster_v3_Cluster *msg, upb_arena *arena) {
+ struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_cluster_v3_Cluster_cleanup_interval(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_Cluster_set_cleanup_interval(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_set_upstream_bind_config(envoy_config_cluster_v3_Cluster *msg, struct envoy_config_core_v3_BindConfig* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(88, 144), struct envoy_config_core_v3_BindConfig*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_BindConfig* envoy_config_cluster_v3_Cluster_mutable_upstream_bind_config(envoy_config_cluster_v3_Cluster *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_BindConfig* sub = (struct envoy_config_core_v3_BindConfig*)envoy_config_cluster_v3_Cluster_upstream_bind_config(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_BindConfig*)_upb_msg_new(&envoy_config_core_v3_BindConfig_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_Cluster_set_upstream_bind_config(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_set_lb_subset_config(envoy_config_cluster_v3_Cluster *msg, envoy_config_cluster_v3_Cluster_LbSubsetConfig* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(92, 152), envoy_config_cluster_v3_Cluster_LbSubsetConfig*) = value;
+}
+UPB_INLINE struct envoy_config_cluster_v3_Cluster_LbSubsetConfig* envoy_config_cluster_v3_Cluster_mutable_lb_subset_config(envoy_config_cluster_v3_Cluster *msg, upb_arena *arena) {
+ struct envoy_config_cluster_v3_Cluster_LbSubsetConfig* sub = (struct envoy_config_cluster_v3_Cluster_LbSubsetConfig*)envoy_config_cluster_v3_Cluster_lb_subset_config(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_cluster_v3_Cluster_LbSubsetConfig*)_upb_msg_new(&envoy_config_cluster_v3_Cluster_LbSubsetConfig_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_Cluster_set_lb_subset_config(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_set_ring_hash_lb_config(envoy_config_cluster_v3_Cluster *msg, envoy_config_cluster_v3_Cluster_RingHashLbConfig* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_cluster_v3_Cluster_RingHashLbConfig*, UPB_SIZE(180, 320), value, UPB_SIZE(184, 328), 23);
+}
+UPB_INLINE struct envoy_config_cluster_v3_Cluster_RingHashLbConfig* envoy_config_cluster_v3_Cluster_mutable_ring_hash_lb_config(envoy_config_cluster_v3_Cluster *msg, upb_arena *arena) {
+ struct envoy_config_cluster_v3_Cluster_RingHashLbConfig* sub = (struct envoy_config_cluster_v3_Cluster_RingHashLbConfig*)envoy_config_cluster_v3_Cluster_ring_hash_lb_config(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_cluster_v3_Cluster_RingHashLbConfig*)_upb_msg_new(&envoy_config_cluster_v3_Cluster_RingHashLbConfig_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_Cluster_set_ring_hash_lb_config(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_set_transport_socket(envoy_config_cluster_v3_Cluster *msg, struct envoy_config_core_v3_TransportSocket* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(96, 160), struct envoy_config_core_v3_TransportSocket*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_TransportSocket* envoy_config_cluster_v3_Cluster_mutable_transport_socket(envoy_config_cluster_v3_Cluster *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_TransportSocket* sub = (struct envoy_config_core_v3_TransportSocket*)envoy_config_cluster_v3_Cluster_transport_socket(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_TransportSocket*)_upb_msg_new(&envoy_config_core_v3_TransportSocket_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_Cluster_set_transport_socket(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_set_metadata(envoy_config_cluster_v3_Cluster *msg, struct envoy_config_core_v3_Metadata* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(100, 168), struct envoy_config_core_v3_Metadata*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_Metadata* envoy_config_cluster_v3_Cluster_mutable_metadata(envoy_config_cluster_v3_Cluster *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_Metadata* sub = (struct envoy_config_core_v3_Metadata*)envoy_config_cluster_v3_Cluster_metadata(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_Metadata*)_upb_msg_new(&envoy_config_core_v3_Metadata_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_Cluster_set_metadata(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_set_protocol_selection(envoy_config_cluster_v3_Cluster *msg, int32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t) = value;
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_set_common_lb_config(envoy_config_cluster_v3_Cluster *msg, envoy_config_cluster_v3_Cluster_CommonLbConfig* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(104, 176), envoy_config_cluster_v3_Cluster_CommonLbConfig*) = value;
+}
+UPB_INLINE struct envoy_config_cluster_v3_Cluster_CommonLbConfig* envoy_config_cluster_v3_Cluster_mutable_common_lb_config(envoy_config_cluster_v3_Cluster *msg, upb_arena *arena) {
+ struct envoy_config_cluster_v3_Cluster_CommonLbConfig* sub = (struct envoy_config_cluster_v3_Cluster_CommonLbConfig*)envoy_config_cluster_v3_Cluster_common_lb_config(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_cluster_v3_Cluster_CommonLbConfig*)_upb_msg_new(&envoy_config_cluster_v3_Cluster_CommonLbConfig_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_Cluster_set_common_lb_config(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_set_alt_stat_name(envoy_config_cluster_v3_Cluster *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 48), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_set_common_http_protocol_options(envoy_config_cluster_v3_Cluster *msg, struct envoy_config_core_v3_HttpProtocolOptions* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(108, 184), struct envoy_config_core_v3_HttpProtocolOptions*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_HttpProtocolOptions* envoy_config_cluster_v3_Cluster_mutable_common_http_protocol_options(envoy_config_cluster_v3_Cluster *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_HttpProtocolOptions* sub = (struct envoy_config_core_v3_HttpProtocolOptions*)envoy_config_cluster_v3_Cluster_common_http_protocol_options(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_HttpProtocolOptions*)_upb_msg_new(&envoy_config_core_v3_HttpProtocolOptions_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_Cluster_set_common_http_protocol_options(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_set_upstream_connection_options(envoy_config_cluster_v3_Cluster *msg, envoy_config_cluster_v3_UpstreamConnectionOptions* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(112, 192), envoy_config_cluster_v3_UpstreamConnectionOptions*) = value;
+}
+UPB_INLINE struct envoy_config_cluster_v3_UpstreamConnectionOptions* envoy_config_cluster_v3_Cluster_mutable_upstream_connection_options(envoy_config_cluster_v3_Cluster *msg, upb_arena *arena) {
+ struct envoy_config_cluster_v3_UpstreamConnectionOptions* sub = (struct envoy_config_cluster_v3_UpstreamConnectionOptions*)envoy_config_cluster_v3_Cluster_upstream_connection_options(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_cluster_v3_UpstreamConnectionOptions*)_upb_msg_new(&envoy_config_cluster_v3_UpstreamConnectionOptions_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_Cluster_set_upstream_connection_options(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_set_close_connections_on_host_health_failure(envoy_config_cluster_v3_Cluster *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool) = value;
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_set_ignore_health_on_host_removal(envoy_config_cluster_v3_Cluster *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(25, 25), bool) = value;
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_set_load_assignment(envoy_config_cluster_v3_Cluster *msg, struct envoy_config_endpoint_v3_ClusterLoadAssignment* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(116, 200), struct envoy_config_endpoint_v3_ClusterLoadAssignment*) = value;
+}
+UPB_INLINE struct envoy_config_endpoint_v3_ClusterLoadAssignment* envoy_config_cluster_v3_Cluster_mutable_load_assignment(envoy_config_cluster_v3_Cluster *msg, upb_arena *arena) {
+ struct envoy_config_endpoint_v3_ClusterLoadAssignment* sub = (struct envoy_config_endpoint_v3_ClusterLoadAssignment*)envoy_config_cluster_v3_Cluster_load_assignment(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_endpoint_v3_ClusterLoadAssignment*)_upb_msg_new(&envoy_config_endpoint_v3_ClusterLoadAssignment_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_Cluster_set_load_assignment(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_set_original_dst_lb_config(envoy_config_cluster_v3_Cluster *msg, envoy_config_cluster_v3_Cluster_OriginalDstLbConfig* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_cluster_v3_Cluster_OriginalDstLbConfig*, UPB_SIZE(180, 320), value, UPB_SIZE(184, 328), 34);
+}
+UPB_INLINE struct envoy_config_cluster_v3_Cluster_OriginalDstLbConfig* envoy_config_cluster_v3_Cluster_mutable_original_dst_lb_config(envoy_config_cluster_v3_Cluster *msg, upb_arena *arena) {
+ struct envoy_config_cluster_v3_Cluster_OriginalDstLbConfig* sub = (struct envoy_config_cluster_v3_Cluster_OriginalDstLbConfig*)envoy_config_cluster_v3_Cluster_original_dst_lb_config(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_cluster_v3_Cluster_OriginalDstLbConfig*)_upb_msg_new(&envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_Cluster_set_original_dst_lb_config(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_typed_extension_protocol_options_clear(envoy_config_cluster_v3_Cluster *msg) { _upb_msg_map_clear(msg, UPB_SIZE(156, 280)); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_typed_extension_protocol_options_set(envoy_config_cluster_v3_Cluster *msg, upb_strview key, struct google_protobuf_Any* val, upb_arena *a) { return _upb_msg_map_set(msg, UPB_SIZE(156, 280), &key, 0, &val, sizeof(val), a); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_typed_extension_protocol_options_delete(envoy_config_cluster_v3_Cluster *msg, upb_strview key) { return _upb_msg_map_delete(msg, UPB_SIZE(156, 280), &key, 0); }
+UPB_INLINE envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry* envoy_config_cluster_v3_Cluster_typed_extension_protocol_options_nextmutable(envoy_config_cluster_v3_Cluster *msg, size_t* iter) { return (envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry*)_upb_msg_map_next(msg, UPB_SIZE(156, 280), iter); }
+UPB_INLINE void envoy_config_cluster_v3_Cluster_set_least_request_lb_config(envoy_config_cluster_v3_Cluster *msg, envoy_config_cluster_v3_Cluster_LeastRequestLbConfig* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_cluster_v3_Cluster_LeastRequestLbConfig*, UPB_SIZE(180, 320), value, UPB_SIZE(184, 328), 37);
+}
+UPB_INLINE struct envoy_config_cluster_v3_Cluster_LeastRequestLbConfig* envoy_config_cluster_v3_Cluster_mutable_least_request_lb_config(envoy_config_cluster_v3_Cluster *msg, upb_arena *arena) {
+ struct envoy_config_cluster_v3_Cluster_LeastRequestLbConfig* sub = (struct envoy_config_cluster_v3_Cluster_LeastRequestLbConfig*)envoy_config_cluster_v3_Cluster_least_request_lb_config(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_cluster_v3_Cluster_LeastRequestLbConfig*)_upb_msg_new(&envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_Cluster_set_least_request_lb_config(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_set_cluster_type(envoy_config_cluster_v3_Cluster *msg, envoy_config_cluster_v3_Cluster_CustomClusterType* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_cluster_v3_Cluster_CustomClusterType*, UPB_SIZE(168, 304), value, UPB_SIZE(176, 312), 38);
+}
+UPB_INLINE struct envoy_config_cluster_v3_Cluster_CustomClusterType* envoy_config_cluster_v3_Cluster_mutable_cluster_type(envoy_config_cluster_v3_Cluster *msg, upb_arena *arena) {
+ struct envoy_config_cluster_v3_Cluster_CustomClusterType* sub = (struct envoy_config_cluster_v3_Cluster_CustomClusterType*)envoy_config_cluster_v3_Cluster_cluster_type(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_cluster_v3_Cluster_CustomClusterType*)_upb_msg_new(&envoy_config_cluster_v3_Cluster_CustomClusterType_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_Cluster_set_cluster_type(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_set_respect_dns_ttl(envoy_config_cluster_v3_Cluster *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(26, 26), bool) = value;
+}
+UPB_INLINE struct envoy_config_cluster_v3_Filter** envoy_config_cluster_v3_Cluster_mutable_filters(envoy_config_cluster_v3_Cluster *msg, size_t *len) {
+ return (struct envoy_config_cluster_v3_Filter**)_upb_array_mutable_accessor(msg, UPB_SIZE(160, 288), len);
+}
+UPB_INLINE struct envoy_config_cluster_v3_Filter** envoy_config_cluster_v3_Cluster_resize_filters(envoy_config_cluster_v3_Cluster *msg, size_t len, upb_arena *arena) {
+ return (struct envoy_config_cluster_v3_Filter**)_upb_array_resize_accessor(msg, UPB_SIZE(160, 288), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_config_cluster_v3_Filter* envoy_config_cluster_v3_Cluster_add_filters(envoy_config_cluster_v3_Cluster *msg, upb_arena *arena) {
+ struct envoy_config_cluster_v3_Filter* sub = (struct envoy_config_cluster_v3_Filter*)_upb_msg_new(&envoy_config_cluster_v3_Filter_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(160, 288), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_set_load_balancing_policy(envoy_config_cluster_v3_Cluster *msg, envoy_config_cluster_v3_LoadBalancingPolicy* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(120, 208), envoy_config_cluster_v3_LoadBalancingPolicy*) = value;
+}
+UPB_INLINE struct envoy_config_cluster_v3_LoadBalancingPolicy* envoy_config_cluster_v3_Cluster_mutable_load_balancing_policy(envoy_config_cluster_v3_Cluster *msg, upb_arena *arena) {
+ struct envoy_config_cluster_v3_LoadBalancingPolicy* sub = (struct envoy_config_cluster_v3_LoadBalancingPolicy*)envoy_config_cluster_v3_Cluster_load_balancing_policy(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_cluster_v3_LoadBalancingPolicy*)_upb_msg_new(&envoy_config_cluster_v3_LoadBalancingPolicy_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_Cluster_set_load_balancing_policy(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_set_lrs_server(envoy_config_cluster_v3_Cluster *msg, struct envoy_config_core_v3_ConfigSource* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(124, 216), struct envoy_config_core_v3_ConfigSource*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_ConfigSource* envoy_config_cluster_v3_Cluster_mutable_lrs_server(envoy_config_cluster_v3_Cluster *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_ConfigSource* sub = (struct envoy_config_core_v3_ConfigSource*)envoy_config_cluster_v3_Cluster_lrs_server(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_ConfigSource*)_upb_msg_new(&envoy_config_core_v3_ConfigSource_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_Cluster_set_lrs_server(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE envoy_config_cluster_v3_Cluster_TransportSocketMatch** envoy_config_cluster_v3_Cluster_mutable_transport_socket_matches(envoy_config_cluster_v3_Cluster *msg, size_t *len) {
+ return (envoy_config_cluster_v3_Cluster_TransportSocketMatch**)_upb_array_mutable_accessor(msg, UPB_SIZE(164, 296), len);
+}
+UPB_INLINE envoy_config_cluster_v3_Cluster_TransportSocketMatch** envoy_config_cluster_v3_Cluster_resize_transport_socket_matches(envoy_config_cluster_v3_Cluster *msg, size_t len, upb_arena *arena) {
+ return (envoy_config_cluster_v3_Cluster_TransportSocketMatch**)_upb_array_resize_accessor(msg, UPB_SIZE(164, 296), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_config_cluster_v3_Cluster_TransportSocketMatch* envoy_config_cluster_v3_Cluster_add_transport_socket_matches(envoy_config_cluster_v3_Cluster *msg, upb_arena *arena) {
+ struct envoy_config_cluster_v3_Cluster_TransportSocketMatch* sub = (struct envoy_config_cluster_v3_Cluster_TransportSocketMatch*)_upb_msg_new(&envoy_config_cluster_v3_Cluster_TransportSocketMatch_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(164, 296), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_set_dns_failure_refresh_rate(envoy_config_cluster_v3_Cluster *msg, envoy_config_cluster_v3_Cluster_RefreshRate* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(128, 224), envoy_config_cluster_v3_Cluster_RefreshRate*) = value;
+}
+UPB_INLINE struct envoy_config_cluster_v3_Cluster_RefreshRate* envoy_config_cluster_v3_Cluster_mutable_dns_failure_refresh_rate(envoy_config_cluster_v3_Cluster *msg, upb_arena *arena) {
+ struct envoy_config_cluster_v3_Cluster_RefreshRate* sub = (struct envoy_config_cluster_v3_Cluster_RefreshRate*)envoy_config_cluster_v3_Cluster_dns_failure_refresh_rate(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_cluster_v3_Cluster_RefreshRate*)_upb_msg_new(&envoy_config_cluster_v3_Cluster_RefreshRate_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_Cluster_set_dns_failure_refresh_rate(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_set_use_tcp_for_dns_lookups(envoy_config_cluster_v3_Cluster *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(27, 27), bool) = value;
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_set_upstream_http_protocol_options(envoy_config_cluster_v3_Cluster *msg, struct envoy_config_core_v3_UpstreamHttpProtocolOptions* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(132, 232), struct envoy_config_core_v3_UpstreamHttpProtocolOptions*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_UpstreamHttpProtocolOptions* envoy_config_cluster_v3_Cluster_mutable_upstream_http_protocol_options(envoy_config_cluster_v3_Cluster *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_UpstreamHttpProtocolOptions* sub = (struct envoy_config_core_v3_UpstreamHttpProtocolOptions*)envoy_config_cluster_v3_Cluster_upstream_http_protocol_options(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_UpstreamHttpProtocolOptions*)_upb_msg_new(&envoy_config_core_v3_UpstreamHttpProtocolOptions_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_Cluster_set_upstream_http_protocol_options(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_set_track_timeout_budgets(envoy_config_cluster_v3_Cluster *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 28), bool) = value;
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_set_upstream_config(envoy_config_cluster_v3_Cluster *msg, struct envoy_config_core_v3_TypedExtensionConfig* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(136, 240), struct envoy_config_core_v3_TypedExtensionConfig*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_cluster_v3_Cluster_mutable_upstream_config(envoy_config_cluster_v3_Cluster *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)envoy_config_cluster_v3_Cluster_upstream_config(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_msg_new(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_Cluster_set_upstream_config(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_set_track_cluster_stats(envoy_config_cluster_v3_Cluster *msg, envoy_config_cluster_v3_TrackClusterStats* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(140, 248), envoy_config_cluster_v3_TrackClusterStats*) = value;
+}
+UPB_INLINE struct envoy_config_cluster_v3_TrackClusterStats* envoy_config_cluster_v3_Cluster_mutable_track_cluster_stats(envoy_config_cluster_v3_Cluster *msg, upb_arena *arena) {
+ struct envoy_config_cluster_v3_TrackClusterStats* sub = (struct envoy_config_cluster_v3_TrackClusterStats*)envoy_config_cluster_v3_Cluster_track_cluster_stats(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_cluster_v3_TrackClusterStats*)_upb_msg_new(&envoy_config_cluster_v3_TrackClusterStats_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_Cluster_set_track_cluster_stats(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_set_prefetch_policy(envoy_config_cluster_v3_Cluster *msg, envoy_config_cluster_v3_Cluster_PrefetchPolicy* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(144, 256), envoy_config_cluster_v3_Cluster_PrefetchPolicy*) = value;
+}
+UPB_INLINE struct envoy_config_cluster_v3_Cluster_PrefetchPolicy* envoy_config_cluster_v3_Cluster_mutable_prefetch_policy(envoy_config_cluster_v3_Cluster *msg, upb_arena *arena) {
+ struct envoy_config_cluster_v3_Cluster_PrefetchPolicy* sub = (struct envoy_config_cluster_v3_Cluster_PrefetchPolicy*)envoy_config_cluster_v3_Cluster_prefetch_policy(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_cluster_v3_Cluster_PrefetchPolicy*)_upb_msg_new(&envoy_config_cluster_v3_Cluster_PrefetchPolicy_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_Cluster_set_prefetch_policy(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_set_connection_pool_per_downstream_connection(envoy_config_cluster_v3_Cluster *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(29, 29), bool) = value;
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_set_maglev_lb_config(envoy_config_cluster_v3_Cluster *msg, envoy_config_cluster_v3_Cluster_MaglevLbConfig* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_cluster_v3_Cluster_MaglevLbConfig*, UPB_SIZE(180, 320), value, UPB_SIZE(184, 328), 52);
+}
+UPB_INLINE struct envoy_config_cluster_v3_Cluster_MaglevLbConfig* envoy_config_cluster_v3_Cluster_mutable_maglev_lb_config(envoy_config_cluster_v3_Cluster *msg, upb_arena *arena) {
+ struct envoy_config_cluster_v3_Cluster_MaglevLbConfig* sub = (struct envoy_config_cluster_v3_Cluster_MaglevLbConfig*)envoy_config_cluster_v3_Cluster_maglev_lb_config(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_cluster_v3_Cluster_MaglevLbConfig*)_upb_msg_new(&envoy_config_cluster_v3_Cluster_MaglevLbConfig_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_Cluster_set_maglev_lb_config(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.cluster.v3.Cluster.TransportSocketMatch */
+
+UPB_INLINE envoy_config_cluster_v3_Cluster_TransportSocketMatch *envoy_config_cluster_v3_Cluster_TransportSocketMatch_new(upb_arena *arena) {
+ return (envoy_config_cluster_v3_Cluster_TransportSocketMatch *)_upb_msg_new(&envoy_config_cluster_v3_Cluster_TransportSocketMatch_msginit, arena);
+}
+UPB_INLINE envoy_config_cluster_v3_Cluster_TransportSocketMatch *envoy_config_cluster_v3_Cluster_TransportSocketMatch_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_cluster_v3_Cluster_TransportSocketMatch *ret = envoy_config_cluster_v3_Cluster_TransportSocketMatch_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_TransportSocketMatch_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_cluster_v3_Cluster_TransportSocketMatch_serialize(const envoy_config_cluster_v3_Cluster_TransportSocketMatch *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_cluster_v3_Cluster_TransportSocketMatch_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview envoy_config_cluster_v3_Cluster_TransportSocketMatch_name(const envoy_config_cluster_v3_Cluster_TransportSocketMatch *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_TransportSocketMatch_has_match(const envoy_config_cluster_v3_Cluster_TransportSocketMatch *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
+UPB_INLINE const struct google_protobuf_Struct* envoy_config_cluster_v3_Cluster_TransportSocketMatch_match(const envoy_config_cluster_v3_Cluster_TransportSocketMatch *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_Struct*); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_TransportSocketMatch_has_transport_socket(const envoy_config_cluster_v3_Cluster_TransportSocketMatch *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
+UPB_INLINE const struct envoy_config_core_v3_TransportSocket* envoy_config_cluster_v3_Cluster_TransportSocketMatch_transport_socket(const envoy_config_cluster_v3_Cluster_TransportSocketMatch *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct envoy_config_core_v3_TransportSocket*); }
+
+UPB_INLINE void envoy_config_cluster_v3_Cluster_TransportSocketMatch_set_name(envoy_config_cluster_v3_Cluster_TransportSocketMatch *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_TransportSocketMatch_set_match(envoy_config_cluster_v3_Cluster_TransportSocketMatch *msg, struct google_protobuf_Struct* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_Struct*) = value;
+}
+UPB_INLINE struct google_protobuf_Struct* envoy_config_cluster_v3_Cluster_TransportSocketMatch_mutable_match(envoy_config_cluster_v3_Cluster_TransportSocketMatch *msg, upb_arena *arena) {
+ struct google_protobuf_Struct* sub = (struct google_protobuf_Struct*)envoy_config_cluster_v3_Cluster_TransportSocketMatch_match(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Struct*)_upb_msg_new(&google_protobuf_Struct_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_Cluster_TransportSocketMatch_set_match(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_TransportSocketMatch_set_transport_socket(envoy_config_cluster_v3_Cluster_TransportSocketMatch *msg, struct envoy_config_core_v3_TransportSocket* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct envoy_config_core_v3_TransportSocket*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_TransportSocket* envoy_config_cluster_v3_Cluster_TransportSocketMatch_mutable_transport_socket(envoy_config_cluster_v3_Cluster_TransportSocketMatch *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_TransportSocket* sub = (struct envoy_config_core_v3_TransportSocket*)envoy_config_cluster_v3_Cluster_TransportSocketMatch_transport_socket(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_TransportSocket*)_upb_msg_new(&envoy_config_core_v3_TransportSocket_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_Cluster_TransportSocketMatch_set_transport_socket(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.cluster.v3.Cluster.CustomClusterType */
+
+UPB_INLINE envoy_config_cluster_v3_Cluster_CustomClusterType *envoy_config_cluster_v3_Cluster_CustomClusterType_new(upb_arena *arena) {
+ return (envoy_config_cluster_v3_Cluster_CustomClusterType *)_upb_msg_new(&envoy_config_cluster_v3_Cluster_CustomClusterType_msginit, arena);
+}
+UPB_INLINE envoy_config_cluster_v3_Cluster_CustomClusterType *envoy_config_cluster_v3_Cluster_CustomClusterType_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_cluster_v3_Cluster_CustomClusterType *ret = envoy_config_cluster_v3_Cluster_CustomClusterType_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_CustomClusterType_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_cluster_v3_Cluster_CustomClusterType_serialize(const envoy_config_cluster_v3_Cluster_CustomClusterType *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_cluster_v3_Cluster_CustomClusterType_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview envoy_config_cluster_v3_Cluster_CustomClusterType_name(const envoy_config_cluster_v3_Cluster_CustomClusterType *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_CustomClusterType_has_typed_config(const envoy_config_cluster_v3_Cluster_CustomClusterType *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
+UPB_INLINE const struct google_protobuf_Any* envoy_config_cluster_v3_Cluster_CustomClusterType_typed_config(const envoy_config_cluster_v3_Cluster_CustomClusterType *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_Any*); }
+
+UPB_INLINE void envoy_config_cluster_v3_Cluster_CustomClusterType_set_name(envoy_config_cluster_v3_Cluster_CustomClusterType *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_CustomClusterType_set_typed_config(envoy_config_cluster_v3_Cluster_CustomClusterType *msg, struct google_protobuf_Any* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_Any*) = value;
+}
+UPB_INLINE struct google_protobuf_Any* envoy_config_cluster_v3_Cluster_CustomClusterType_mutable_typed_config(envoy_config_cluster_v3_Cluster_CustomClusterType *msg, upb_arena *arena) {
+ struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_config_cluster_v3_Cluster_CustomClusterType_typed_config(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_Cluster_CustomClusterType_set_typed_config(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.cluster.v3.Cluster.EdsClusterConfig */
+
+UPB_INLINE envoy_config_cluster_v3_Cluster_EdsClusterConfig *envoy_config_cluster_v3_Cluster_EdsClusterConfig_new(upb_arena *arena) {
+ return (envoy_config_cluster_v3_Cluster_EdsClusterConfig *)_upb_msg_new(&envoy_config_cluster_v3_Cluster_EdsClusterConfig_msginit, arena);
+}
+UPB_INLINE envoy_config_cluster_v3_Cluster_EdsClusterConfig *envoy_config_cluster_v3_Cluster_EdsClusterConfig_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_cluster_v3_Cluster_EdsClusterConfig *ret = envoy_config_cluster_v3_Cluster_EdsClusterConfig_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_EdsClusterConfig_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_cluster_v3_Cluster_EdsClusterConfig_serialize(const envoy_config_cluster_v3_Cluster_EdsClusterConfig *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_cluster_v3_Cluster_EdsClusterConfig_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_EdsClusterConfig_has_eds_config(const envoy_config_cluster_v3_Cluster_EdsClusterConfig *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
+UPB_INLINE const struct envoy_config_core_v3_ConfigSource* envoy_config_cluster_v3_Cluster_EdsClusterConfig_eds_config(const envoy_config_cluster_v3_Cluster_EdsClusterConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct envoy_config_core_v3_ConfigSource*); }
+UPB_INLINE upb_strview envoy_config_cluster_v3_Cluster_EdsClusterConfig_service_name(const envoy_config_cluster_v3_Cluster_EdsClusterConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_EdsClusterConfig_has_eds_resource_locator(const envoy_config_cluster_v3_Cluster_EdsClusterConfig *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
+UPB_INLINE const struct udpa_core_v1_ResourceLocator* envoy_config_cluster_v3_Cluster_EdsClusterConfig_eds_resource_locator(const envoy_config_cluster_v3_Cluster_EdsClusterConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct udpa_core_v1_ResourceLocator*); }
+
+UPB_INLINE void envoy_config_cluster_v3_Cluster_EdsClusterConfig_set_eds_config(envoy_config_cluster_v3_Cluster_EdsClusterConfig *msg, struct envoy_config_core_v3_ConfigSource* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct envoy_config_core_v3_ConfigSource*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_ConfigSource* envoy_config_cluster_v3_Cluster_EdsClusterConfig_mutable_eds_config(envoy_config_cluster_v3_Cluster_EdsClusterConfig *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_ConfigSource* sub = (struct envoy_config_core_v3_ConfigSource*)envoy_config_cluster_v3_Cluster_EdsClusterConfig_eds_config(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_ConfigSource*)_upb_msg_new(&envoy_config_core_v3_ConfigSource_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_Cluster_EdsClusterConfig_set_eds_config(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_EdsClusterConfig_set_service_name(envoy_config_cluster_v3_Cluster_EdsClusterConfig *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_EdsClusterConfig_set_eds_resource_locator(envoy_config_cluster_v3_Cluster_EdsClusterConfig *msg, struct udpa_core_v1_ResourceLocator* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct udpa_core_v1_ResourceLocator*) = value;
+}
+UPB_INLINE struct udpa_core_v1_ResourceLocator* envoy_config_cluster_v3_Cluster_EdsClusterConfig_mutable_eds_resource_locator(envoy_config_cluster_v3_Cluster_EdsClusterConfig *msg, upb_arena *arena) {
+ struct udpa_core_v1_ResourceLocator* sub = (struct udpa_core_v1_ResourceLocator*)envoy_config_cluster_v3_Cluster_EdsClusterConfig_eds_resource_locator(msg);
+ if (sub == NULL) {
+ sub = (struct udpa_core_v1_ResourceLocator*)_upb_msg_new(&udpa_core_v1_ResourceLocator_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_Cluster_EdsClusterConfig_set_eds_resource_locator(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.cluster.v3.Cluster.LbSubsetConfig */
+
+UPB_INLINE envoy_config_cluster_v3_Cluster_LbSubsetConfig *envoy_config_cluster_v3_Cluster_LbSubsetConfig_new(upb_arena *arena) {
+ return (envoy_config_cluster_v3_Cluster_LbSubsetConfig *)_upb_msg_new(&envoy_config_cluster_v3_Cluster_LbSubsetConfig_msginit, arena);
+}
+UPB_INLINE envoy_config_cluster_v3_Cluster_LbSubsetConfig *envoy_config_cluster_v3_Cluster_LbSubsetConfig_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_cluster_v3_Cluster_LbSubsetConfig *ret = envoy_config_cluster_v3_Cluster_LbSubsetConfig_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_LbSubsetConfig_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_cluster_v3_Cluster_LbSubsetConfig_serialize(const envoy_config_cluster_v3_Cluster_LbSubsetConfig *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_cluster_v3_Cluster_LbSubsetConfig_msginit, arena, len);
+}
+
+UPB_INLINE int32_t envoy_config_cluster_v3_Cluster_LbSubsetConfig_fallback_policy(const envoy_config_cluster_v3_Cluster_LbSubsetConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_LbSubsetConfig_has_default_subset(const envoy_config_cluster_v3_Cluster_LbSubsetConfig *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 16)); }
+UPB_INLINE const struct google_protobuf_Struct* envoy_config_cluster_v3_Cluster_LbSubsetConfig_default_subset(const envoy_config_cluster_v3_Cluster_LbSubsetConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const struct google_protobuf_Struct*); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_LbSubsetConfig_has_subset_selectors(const envoy_config_cluster_v3_Cluster_LbSubsetConfig *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 24)); }
+UPB_INLINE const envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector* const* envoy_config_cluster_v3_Cluster_LbSubsetConfig_subset_selectors(const envoy_config_cluster_v3_Cluster_LbSubsetConfig *msg, size_t *len) { return (const envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector* const*)_upb_array_accessor(msg, UPB_SIZE(16, 24), len); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_LbSubsetConfig_locality_weight_aware(const envoy_config_cluster_v3_Cluster_LbSubsetConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_LbSubsetConfig_scale_locality_weight(const envoy_config_cluster_v3_Cluster_LbSubsetConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(9, 9), bool); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_LbSubsetConfig_panic_mode_any(const envoy_config_cluster_v3_Cluster_LbSubsetConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(10, 10), bool); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_LbSubsetConfig_list_as_any(const envoy_config_cluster_v3_Cluster_LbSubsetConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(11, 11), bool); }
+
+UPB_INLINE void envoy_config_cluster_v3_Cluster_LbSubsetConfig_set_fallback_policy(envoy_config_cluster_v3_Cluster_LbSubsetConfig *msg, int32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_LbSubsetConfig_set_default_subset(envoy_config_cluster_v3_Cluster_LbSubsetConfig *msg, struct google_protobuf_Struct* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 16), struct google_protobuf_Struct*) = value;
+}
+UPB_INLINE struct google_protobuf_Struct* envoy_config_cluster_v3_Cluster_LbSubsetConfig_mutable_default_subset(envoy_config_cluster_v3_Cluster_LbSubsetConfig *msg, upb_arena *arena) {
+ struct google_protobuf_Struct* sub = (struct google_protobuf_Struct*)envoy_config_cluster_v3_Cluster_LbSubsetConfig_default_subset(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Struct*)_upb_msg_new(&google_protobuf_Struct_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_Cluster_LbSubsetConfig_set_default_subset(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector** envoy_config_cluster_v3_Cluster_LbSubsetConfig_mutable_subset_selectors(envoy_config_cluster_v3_Cluster_LbSubsetConfig *msg, size_t *len) {
+ return (envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector**)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 24), len);
+}
+UPB_INLINE envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector** envoy_config_cluster_v3_Cluster_LbSubsetConfig_resize_subset_selectors(envoy_config_cluster_v3_Cluster_LbSubsetConfig *msg, size_t len, upb_arena *arena) {
+ return (envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector**)_upb_array_resize_accessor(msg, UPB_SIZE(16, 24), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector* envoy_config_cluster_v3_Cluster_LbSubsetConfig_add_subset_selectors(envoy_config_cluster_v3_Cluster_LbSubsetConfig *msg, upb_arena *arena) {
+ struct envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector* sub = (struct envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector*)_upb_msg_new(&envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(16, 24), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_LbSubsetConfig_set_locality_weight_aware(envoy_config_cluster_v3_Cluster_LbSubsetConfig *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = value;
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_LbSubsetConfig_set_scale_locality_weight(envoy_config_cluster_v3_Cluster_LbSubsetConfig *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(9, 9), bool) = value;
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_LbSubsetConfig_set_panic_mode_any(envoy_config_cluster_v3_Cluster_LbSubsetConfig *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(10, 10), bool) = value;
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_LbSubsetConfig_set_list_as_any(envoy_config_cluster_v3_Cluster_LbSubsetConfig *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(11, 11), bool) = value;
+}
+
+/* envoy.config.cluster.v3.Cluster.LbSubsetConfig.LbSubsetSelector */
+
+UPB_INLINE envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector *envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_new(upb_arena *arena) {
+ return (envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector *)_upb_msg_new(&envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_msginit, arena);
+}
+UPB_INLINE envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector *envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector *ret = envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_serialize(const envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview const* envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_keys(const envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(12, 16), len); }
+UPB_INLINE int32_t envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_fallback_policy(const envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
+UPB_INLINE upb_strview const* envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_fallback_keys_subset(const envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(16, 24), len); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_single_host_per_subset(const envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool); }
+
+UPB_INLINE upb_strview* envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_mutable_keys(envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector *msg, size_t *len) {
+ return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 16), len);
+}
+UPB_INLINE upb_strview* envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_resize_keys(envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector *msg, size_t len, upb_arena *arena) {
+ return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(12, 16), len, UPB_TYPE_STRING, arena);
+}
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_add_keys(envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector *msg, upb_strview val, upb_arena *arena) {
+ return _upb_array_append_accessor(msg, UPB_SIZE(12, 16), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
+ arena);
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_set_fallback_policy(envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector *msg, int32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
+}
+UPB_INLINE upb_strview* envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_mutable_fallback_keys_subset(envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector *msg, size_t *len) {
+ return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 24), len);
+}
+UPB_INLINE upb_strview* envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_resize_fallback_keys_subset(envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector *msg, size_t len, upb_arena *arena) {
+ return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(16, 24), len, UPB_TYPE_STRING, arena);
+}
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_add_fallback_keys_subset(envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector *msg, upb_strview val, upb_arena *arena) {
+ return _upb_array_append_accessor(msg, UPB_SIZE(16, 24), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
+ arena);
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_set_single_host_per_subset(envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = value;
+}
+
+/* envoy.config.cluster.v3.Cluster.LeastRequestLbConfig */
+
+UPB_INLINE envoy_config_cluster_v3_Cluster_LeastRequestLbConfig *envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_new(upb_arena *arena) {
+ return (envoy_config_cluster_v3_Cluster_LeastRequestLbConfig *)_upb_msg_new(&envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_msginit, arena);
+}
+UPB_INLINE envoy_config_cluster_v3_Cluster_LeastRequestLbConfig *envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_cluster_v3_Cluster_LeastRequestLbConfig *ret = envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_serialize(const envoy_config_cluster_v3_Cluster_LeastRequestLbConfig *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_has_choice_count(const envoy_config_cluster_v3_Cluster_LeastRequestLbConfig *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_choice_count(const envoy_config_cluster_v3_Cluster_LeastRequestLbConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct google_protobuf_UInt32Value*); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_has_active_request_bias(const envoy_config_cluster_v3_Cluster_LeastRequestLbConfig *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
+UPB_INLINE const struct envoy_config_core_v3_RuntimeDouble* envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_active_request_bias(const envoy_config_cluster_v3_Cluster_LeastRequestLbConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_config_core_v3_RuntimeDouble*); }
+
+UPB_INLINE void envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_set_choice_count(envoy_config_cluster_v3_Cluster_LeastRequestLbConfig *msg, struct google_protobuf_UInt32Value* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_mutable_choice_count(envoy_config_cluster_v3_Cluster_LeastRequestLbConfig *msg, upb_arena *arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_choice_count(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_set_choice_count(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_set_active_request_bias(envoy_config_cluster_v3_Cluster_LeastRequestLbConfig *msg, struct envoy_config_core_v3_RuntimeDouble* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_config_core_v3_RuntimeDouble*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_RuntimeDouble* envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_mutable_active_request_bias(envoy_config_cluster_v3_Cluster_LeastRequestLbConfig *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_RuntimeDouble* sub = (struct envoy_config_core_v3_RuntimeDouble*)envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_active_request_bias(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_RuntimeDouble*)_upb_msg_new(&envoy_config_core_v3_RuntimeDouble_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_set_active_request_bias(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.cluster.v3.Cluster.RingHashLbConfig */
+
+UPB_INLINE envoy_config_cluster_v3_Cluster_RingHashLbConfig *envoy_config_cluster_v3_Cluster_RingHashLbConfig_new(upb_arena *arena) {
+ return (envoy_config_cluster_v3_Cluster_RingHashLbConfig *)_upb_msg_new(&envoy_config_cluster_v3_Cluster_RingHashLbConfig_msginit, arena);
+}
+UPB_INLINE envoy_config_cluster_v3_Cluster_RingHashLbConfig *envoy_config_cluster_v3_Cluster_RingHashLbConfig_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_cluster_v3_Cluster_RingHashLbConfig *ret = envoy_config_cluster_v3_Cluster_RingHashLbConfig_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_RingHashLbConfig_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_cluster_v3_Cluster_RingHashLbConfig_serialize(const envoy_config_cluster_v3_Cluster_RingHashLbConfig *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_cluster_v3_Cluster_RingHashLbConfig_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_RingHashLbConfig_has_minimum_ring_size(const envoy_config_cluster_v3_Cluster_RingHashLbConfig *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 8)); }
+UPB_INLINE const struct google_protobuf_UInt64Value* envoy_config_cluster_v3_Cluster_RingHashLbConfig_minimum_ring_size(const envoy_config_cluster_v3_Cluster_RingHashLbConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const struct google_protobuf_UInt64Value*); }
+UPB_INLINE int32_t envoy_config_cluster_v3_Cluster_RingHashLbConfig_hash_function(const envoy_config_cluster_v3_Cluster_RingHashLbConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_RingHashLbConfig_has_maximum_ring_size(const envoy_config_cluster_v3_Cluster_RingHashLbConfig *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 16)); }
+UPB_INLINE const struct google_protobuf_UInt64Value* envoy_config_cluster_v3_Cluster_RingHashLbConfig_maximum_ring_size(const envoy_config_cluster_v3_Cluster_RingHashLbConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const struct google_protobuf_UInt64Value*); }
+
+UPB_INLINE void envoy_config_cluster_v3_Cluster_RingHashLbConfig_set_minimum_ring_size(envoy_config_cluster_v3_Cluster_RingHashLbConfig *msg, struct google_protobuf_UInt64Value* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), struct google_protobuf_UInt64Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt64Value* envoy_config_cluster_v3_Cluster_RingHashLbConfig_mutable_minimum_ring_size(envoy_config_cluster_v3_Cluster_RingHashLbConfig *msg, upb_arena *arena) {
+ struct google_protobuf_UInt64Value* sub = (struct google_protobuf_UInt64Value*)envoy_config_cluster_v3_Cluster_RingHashLbConfig_minimum_ring_size(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt64Value*)_upb_msg_new(&google_protobuf_UInt64Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_Cluster_RingHashLbConfig_set_minimum_ring_size(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_RingHashLbConfig_set_hash_function(envoy_config_cluster_v3_Cluster_RingHashLbConfig *msg, int32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_RingHashLbConfig_set_maximum_ring_size(envoy_config_cluster_v3_Cluster_RingHashLbConfig *msg, struct google_protobuf_UInt64Value* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 16), struct google_protobuf_UInt64Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt64Value* envoy_config_cluster_v3_Cluster_RingHashLbConfig_mutable_maximum_ring_size(envoy_config_cluster_v3_Cluster_RingHashLbConfig *msg, upb_arena *arena) {
+ struct google_protobuf_UInt64Value* sub = (struct google_protobuf_UInt64Value*)envoy_config_cluster_v3_Cluster_RingHashLbConfig_maximum_ring_size(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt64Value*)_upb_msg_new(&google_protobuf_UInt64Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_Cluster_RingHashLbConfig_set_maximum_ring_size(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.cluster.v3.Cluster.MaglevLbConfig */
+
+UPB_INLINE envoy_config_cluster_v3_Cluster_MaglevLbConfig *envoy_config_cluster_v3_Cluster_MaglevLbConfig_new(upb_arena *arena) {
+ return (envoy_config_cluster_v3_Cluster_MaglevLbConfig *)_upb_msg_new(&envoy_config_cluster_v3_Cluster_MaglevLbConfig_msginit, arena);
+}
+UPB_INLINE envoy_config_cluster_v3_Cluster_MaglevLbConfig *envoy_config_cluster_v3_Cluster_MaglevLbConfig_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_cluster_v3_Cluster_MaglevLbConfig *ret = envoy_config_cluster_v3_Cluster_MaglevLbConfig_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_MaglevLbConfig_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_cluster_v3_Cluster_MaglevLbConfig_serialize(const envoy_config_cluster_v3_Cluster_MaglevLbConfig *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_cluster_v3_Cluster_MaglevLbConfig_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_MaglevLbConfig_has_table_size(const envoy_config_cluster_v3_Cluster_MaglevLbConfig *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE const struct google_protobuf_UInt64Value* envoy_config_cluster_v3_Cluster_MaglevLbConfig_table_size(const envoy_config_cluster_v3_Cluster_MaglevLbConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct google_protobuf_UInt64Value*); }
+
+UPB_INLINE void envoy_config_cluster_v3_Cluster_MaglevLbConfig_set_table_size(envoy_config_cluster_v3_Cluster_MaglevLbConfig *msg, struct google_protobuf_UInt64Value* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct google_protobuf_UInt64Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt64Value* envoy_config_cluster_v3_Cluster_MaglevLbConfig_mutable_table_size(envoy_config_cluster_v3_Cluster_MaglevLbConfig *msg, upb_arena *arena) {
+ struct google_protobuf_UInt64Value* sub = (struct google_protobuf_UInt64Value*)envoy_config_cluster_v3_Cluster_MaglevLbConfig_table_size(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt64Value*)_upb_msg_new(&google_protobuf_UInt64Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_Cluster_MaglevLbConfig_set_table_size(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.cluster.v3.Cluster.OriginalDstLbConfig */
+
+UPB_INLINE envoy_config_cluster_v3_Cluster_OriginalDstLbConfig *envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_new(upb_arena *arena) {
+ return (envoy_config_cluster_v3_Cluster_OriginalDstLbConfig *)_upb_msg_new(&envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_msginit, arena);
+}
+UPB_INLINE envoy_config_cluster_v3_Cluster_OriginalDstLbConfig *envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_cluster_v3_Cluster_OriginalDstLbConfig *ret = envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_serialize(const envoy_config_cluster_v3_Cluster_OriginalDstLbConfig *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_use_http_header(const envoy_config_cluster_v3_Cluster_OriginalDstLbConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); }
+
+UPB_INLINE void envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_set_use_http_header(envoy_config_cluster_v3_Cluster_OriginalDstLbConfig *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
+}
+
+/* envoy.config.cluster.v3.Cluster.CommonLbConfig */
+
+UPB_INLINE envoy_config_cluster_v3_Cluster_CommonLbConfig *envoy_config_cluster_v3_Cluster_CommonLbConfig_new(upb_arena *arena) {
+ return (envoy_config_cluster_v3_Cluster_CommonLbConfig *)_upb_msg_new(&envoy_config_cluster_v3_Cluster_CommonLbConfig_msginit, arena);
+}
+UPB_INLINE envoy_config_cluster_v3_Cluster_CommonLbConfig *envoy_config_cluster_v3_Cluster_CommonLbConfig_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_cluster_v3_Cluster_CommonLbConfig *ret = envoy_config_cluster_v3_Cluster_CommonLbConfig_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_CommonLbConfig_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_cluster_v3_Cluster_CommonLbConfig_serialize(const envoy_config_cluster_v3_Cluster_CommonLbConfig *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_cluster_v3_Cluster_CommonLbConfig_msginit, arena, len);
+}
+
+typedef enum {
+ envoy_config_cluster_v3_Cluster_CommonLbConfig_locality_config_specifier_zone_aware_lb_config = 2,
+ envoy_config_cluster_v3_Cluster_CommonLbConfig_locality_config_specifier_locality_weighted_lb_config = 3,
+ envoy_config_cluster_v3_Cluster_CommonLbConfig_locality_config_specifier_NOT_SET = 0
+} envoy_config_cluster_v3_Cluster_CommonLbConfig_locality_config_specifier_oneofcases;
+UPB_INLINE envoy_config_cluster_v3_Cluster_CommonLbConfig_locality_config_specifier_oneofcases envoy_config_cluster_v3_Cluster_CommonLbConfig_locality_config_specifier_case(const envoy_config_cluster_v3_Cluster_CommonLbConfig* msg) { return (envoy_config_cluster_v3_Cluster_CommonLbConfig_locality_config_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(20, 40), int32_t); }
+
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_CommonLbConfig_has_healthy_panic_threshold(const envoy_config_cluster_v3_Cluster_CommonLbConfig *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
+UPB_INLINE const struct envoy_type_v3_Percent* envoy_config_cluster_v3_Cluster_CommonLbConfig_healthy_panic_threshold(const envoy_config_cluster_v3_Cluster_CommonLbConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_type_v3_Percent*); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_CommonLbConfig_has_zone_aware_lb_config(const envoy_config_cluster_v3_Cluster_CommonLbConfig *msg) { return _upb_getoneofcase(msg, UPB_SIZE(20, 40)) == 2; }
+UPB_INLINE const envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig* envoy_config_cluster_v3_Cluster_CommonLbConfig_zone_aware_lb_config(const envoy_config_cluster_v3_Cluster_CommonLbConfig *msg) { return UPB_READ_ONEOF(msg, const envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig*, UPB_SIZE(16, 32), UPB_SIZE(20, 40), 2, NULL); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_CommonLbConfig_has_locality_weighted_lb_config(const envoy_config_cluster_v3_Cluster_CommonLbConfig *msg) { return _upb_getoneofcase(msg, UPB_SIZE(20, 40)) == 3; }
+UPB_INLINE const envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig* envoy_config_cluster_v3_Cluster_CommonLbConfig_locality_weighted_lb_config(const envoy_config_cluster_v3_Cluster_CommonLbConfig *msg) { return UPB_READ_ONEOF(msg, const envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig*, UPB_SIZE(16, 32), UPB_SIZE(20, 40), 3, NULL); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_CommonLbConfig_has_update_merge_window(const envoy_config_cluster_v3_Cluster_CommonLbConfig *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
+UPB_INLINE const struct google_protobuf_Duration* envoy_config_cluster_v3_Cluster_CommonLbConfig_update_merge_window(const envoy_config_cluster_v3_Cluster_CommonLbConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_Duration*); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_CommonLbConfig_ignore_new_hosts_until_first_hc(const envoy_config_cluster_v3_Cluster_CommonLbConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_CommonLbConfig_close_connections_on_host_set_change(const envoy_config_cluster_v3_Cluster_CommonLbConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_CommonLbConfig_has_consistent_hashing_lb_config(const envoy_config_cluster_v3_Cluster_CommonLbConfig *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
+UPB_INLINE const envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig* envoy_config_cluster_v3_Cluster_CommonLbConfig_consistent_hashing_lb_config(const envoy_config_cluster_v3_Cluster_CommonLbConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig*); }
+
+UPB_INLINE void envoy_config_cluster_v3_Cluster_CommonLbConfig_set_healthy_panic_threshold(envoy_config_cluster_v3_Cluster_CommonLbConfig *msg, struct envoy_type_v3_Percent* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_type_v3_Percent*) = value;
+}
+UPB_INLINE struct envoy_type_v3_Percent* envoy_config_cluster_v3_Cluster_CommonLbConfig_mutable_healthy_panic_threshold(envoy_config_cluster_v3_Cluster_CommonLbConfig *msg, upb_arena *arena) {
+ struct envoy_type_v3_Percent* sub = (struct envoy_type_v3_Percent*)envoy_config_cluster_v3_Cluster_CommonLbConfig_healthy_panic_threshold(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_type_v3_Percent*)_upb_msg_new(&envoy_type_v3_Percent_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_Cluster_CommonLbConfig_set_healthy_panic_threshold(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_CommonLbConfig_set_zone_aware_lb_config(envoy_config_cluster_v3_Cluster_CommonLbConfig *msg, envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig*, UPB_SIZE(16, 32), value, UPB_SIZE(20, 40), 2);
+}
+UPB_INLINE struct envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig* envoy_config_cluster_v3_Cluster_CommonLbConfig_mutable_zone_aware_lb_config(envoy_config_cluster_v3_Cluster_CommonLbConfig *msg, upb_arena *arena) {
+ struct envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig* sub = (struct envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig*)envoy_config_cluster_v3_Cluster_CommonLbConfig_zone_aware_lb_config(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig*)_upb_msg_new(&envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_Cluster_CommonLbConfig_set_zone_aware_lb_config(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_CommonLbConfig_set_locality_weighted_lb_config(envoy_config_cluster_v3_Cluster_CommonLbConfig *msg, envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig*, UPB_SIZE(16, 32), value, UPB_SIZE(20, 40), 3);
+}
+UPB_INLINE struct envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig* envoy_config_cluster_v3_Cluster_CommonLbConfig_mutable_locality_weighted_lb_config(envoy_config_cluster_v3_Cluster_CommonLbConfig *msg, upb_arena *arena) {
+ struct envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig* sub = (struct envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig*)envoy_config_cluster_v3_Cluster_CommonLbConfig_locality_weighted_lb_config(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig*)_upb_msg_new(&envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_Cluster_CommonLbConfig_set_locality_weighted_lb_config(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_CommonLbConfig_set_update_merge_window(envoy_config_cluster_v3_Cluster_CommonLbConfig *msg, struct google_protobuf_Duration* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_Duration*) = value;
+}
+UPB_INLINE struct google_protobuf_Duration* envoy_config_cluster_v3_Cluster_CommonLbConfig_mutable_update_merge_window(envoy_config_cluster_v3_Cluster_CommonLbConfig *msg, upb_arena *arena) {
+ struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_cluster_v3_Cluster_CommonLbConfig_update_merge_window(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_Cluster_CommonLbConfig_set_update_merge_window(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_CommonLbConfig_set_ignore_new_hosts_until_first_hc(envoy_config_cluster_v3_Cluster_CommonLbConfig *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_CommonLbConfig_set_close_connections_on_host_set_change(envoy_config_cluster_v3_Cluster_CommonLbConfig *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_CommonLbConfig_set_consistent_hashing_lb_config(envoy_config_cluster_v3_Cluster_CommonLbConfig *msg, envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig*) = value;
+}
+UPB_INLINE struct envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig* envoy_config_cluster_v3_Cluster_CommonLbConfig_mutable_consistent_hashing_lb_config(envoy_config_cluster_v3_Cluster_CommonLbConfig *msg, upb_arena *arena) {
+ struct envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig* sub = (struct envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig*)envoy_config_cluster_v3_Cluster_CommonLbConfig_consistent_hashing_lb_config(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig*)_upb_msg_new(&envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_Cluster_CommonLbConfig_set_consistent_hashing_lb_config(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.cluster.v3.Cluster.CommonLbConfig.ZoneAwareLbConfig */
+
+UPB_INLINE envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig *envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_new(upb_arena *arena) {
+ return (envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig *)_upb_msg_new(&envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_msginit, arena);
+}
+UPB_INLINE envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig *envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig *ret = envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_serialize(const envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_has_routing_enabled(const envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
+UPB_INLINE const struct envoy_type_v3_Percent* envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_routing_enabled(const envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_type_v3_Percent*); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_has_min_cluster_size(const envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
+UPB_INLINE const struct google_protobuf_UInt64Value* envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_min_cluster_size(const envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_UInt64Value*); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_fail_traffic_on_panic(const envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); }
+
+UPB_INLINE void envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_set_routing_enabled(envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig *msg, struct envoy_type_v3_Percent* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_type_v3_Percent*) = value;
+}
+UPB_INLINE struct envoy_type_v3_Percent* envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_mutable_routing_enabled(envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig *msg, upb_arena *arena) {
+ struct envoy_type_v3_Percent* sub = (struct envoy_type_v3_Percent*)envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_routing_enabled(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_type_v3_Percent*)_upb_msg_new(&envoy_type_v3_Percent_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_set_routing_enabled(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_set_min_cluster_size(envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig *msg, struct google_protobuf_UInt64Value* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_UInt64Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt64Value* envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_mutable_min_cluster_size(envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig *msg, upb_arena *arena) {
+ struct google_protobuf_UInt64Value* sub = (struct google_protobuf_UInt64Value*)envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_min_cluster_size(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt64Value*)_upb_msg_new(&google_protobuf_UInt64Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_set_min_cluster_size(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_set_fail_traffic_on_panic(envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
+}
+
+/* envoy.config.cluster.v3.Cluster.CommonLbConfig.LocalityWeightedLbConfig */
+
+UPB_INLINE envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig *envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig_new(upb_arena *arena) {
+ return (envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig *)_upb_msg_new(&envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig_msginit, arena);
+}
+UPB_INLINE envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig *envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig *ret = envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig_serialize(const envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig_msginit, arena, len);
+}
+
+
+
+/* envoy.config.cluster.v3.Cluster.CommonLbConfig.ConsistentHashingLbConfig */
+
+UPB_INLINE envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig *envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_new(upb_arena *arena) {
+ return (envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig *)_upb_msg_new(&envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_msginit, arena);
+}
+UPB_INLINE envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig *envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig *ret = envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_serialize(const envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_use_hostname_for_hashing(const envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_has_hash_balance_factor(const envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_hash_balance_factor(const envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_UInt32Value*); }
+
+UPB_INLINE void envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_set_use_hostname_for_hashing(envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_set_hash_balance_factor(envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig *msg, struct google_protobuf_UInt32Value* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_mutable_hash_balance_factor(envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig *msg, upb_arena *arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_hash_balance_factor(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_set_hash_balance_factor(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.cluster.v3.Cluster.RefreshRate */
+
+UPB_INLINE envoy_config_cluster_v3_Cluster_RefreshRate *envoy_config_cluster_v3_Cluster_RefreshRate_new(upb_arena *arena) {
+ return (envoy_config_cluster_v3_Cluster_RefreshRate *)_upb_msg_new(&envoy_config_cluster_v3_Cluster_RefreshRate_msginit, arena);
+}
+UPB_INLINE envoy_config_cluster_v3_Cluster_RefreshRate *envoy_config_cluster_v3_Cluster_RefreshRate_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_cluster_v3_Cluster_RefreshRate *ret = envoy_config_cluster_v3_Cluster_RefreshRate_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_RefreshRate_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_cluster_v3_Cluster_RefreshRate_serialize(const envoy_config_cluster_v3_Cluster_RefreshRate *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_cluster_v3_Cluster_RefreshRate_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_RefreshRate_has_base_interval(const envoy_config_cluster_v3_Cluster_RefreshRate *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE const struct google_protobuf_Duration* envoy_config_cluster_v3_Cluster_RefreshRate_base_interval(const envoy_config_cluster_v3_Cluster_RefreshRate *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct google_protobuf_Duration*); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_RefreshRate_has_max_interval(const envoy_config_cluster_v3_Cluster_RefreshRate *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
+UPB_INLINE const struct google_protobuf_Duration* envoy_config_cluster_v3_Cluster_RefreshRate_max_interval(const envoy_config_cluster_v3_Cluster_RefreshRate *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_Duration*); }
+
+UPB_INLINE void envoy_config_cluster_v3_Cluster_RefreshRate_set_base_interval(envoy_config_cluster_v3_Cluster_RefreshRate *msg, struct google_protobuf_Duration* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct google_protobuf_Duration*) = value;
+}
+UPB_INLINE struct google_protobuf_Duration* envoy_config_cluster_v3_Cluster_RefreshRate_mutable_base_interval(envoy_config_cluster_v3_Cluster_RefreshRate *msg, upb_arena *arena) {
+ struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_cluster_v3_Cluster_RefreshRate_base_interval(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_Cluster_RefreshRate_set_base_interval(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_RefreshRate_set_max_interval(envoy_config_cluster_v3_Cluster_RefreshRate *msg, struct google_protobuf_Duration* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_Duration*) = value;
+}
+UPB_INLINE struct google_protobuf_Duration* envoy_config_cluster_v3_Cluster_RefreshRate_mutable_max_interval(envoy_config_cluster_v3_Cluster_RefreshRate *msg, upb_arena *arena) {
+ struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_cluster_v3_Cluster_RefreshRate_max_interval(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_Cluster_RefreshRate_set_max_interval(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.cluster.v3.Cluster.PrefetchPolicy */
+
+UPB_INLINE envoy_config_cluster_v3_Cluster_PrefetchPolicy *envoy_config_cluster_v3_Cluster_PrefetchPolicy_new(upb_arena *arena) {
+ return (envoy_config_cluster_v3_Cluster_PrefetchPolicy *)_upb_msg_new(&envoy_config_cluster_v3_Cluster_PrefetchPolicy_msginit, arena);
+}
+UPB_INLINE envoy_config_cluster_v3_Cluster_PrefetchPolicy *envoy_config_cluster_v3_Cluster_PrefetchPolicy_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_cluster_v3_Cluster_PrefetchPolicy *ret = envoy_config_cluster_v3_Cluster_PrefetchPolicy_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_PrefetchPolicy_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_cluster_v3_Cluster_PrefetchPolicy_serialize(const envoy_config_cluster_v3_Cluster_PrefetchPolicy *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_cluster_v3_Cluster_PrefetchPolicy_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_PrefetchPolicy_has_per_upstream_prefetch_ratio(const envoy_config_cluster_v3_Cluster_PrefetchPolicy *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE const struct google_protobuf_DoubleValue* envoy_config_cluster_v3_Cluster_PrefetchPolicy_per_upstream_prefetch_ratio(const envoy_config_cluster_v3_Cluster_PrefetchPolicy *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct google_protobuf_DoubleValue*); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_PrefetchPolicy_has_predictive_prefetch_ratio(const envoy_config_cluster_v3_Cluster_PrefetchPolicy *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
+UPB_INLINE const struct google_protobuf_DoubleValue* envoy_config_cluster_v3_Cluster_PrefetchPolicy_predictive_prefetch_ratio(const envoy_config_cluster_v3_Cluster_PrefetchPolicy *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_DoubleValue*); }
+
+UPB_INLINE void envoy_config_cluster_v3_Cluster_PrefetchPolicy_set_per_upstream_prefetch_ratio(envoy_config_cluster_v3_Cluster_PrefetchPolicy *msg, struct google_protobuf_DoubleValue* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct google_protobuf_DoubleValue*) = value;
+}
+UPB_INLINE struct google_protobuf_DoubleValue* envoy_config_cluster_v3_Cluster_PrefetchPolicy_mutable_per_upstream_prefetch_ratio(envoy_config_cluster_v3_Cluster_PrefetchPolicy *msg, upb_arena *arena) {
+ struct google_protobuf_DoubleValue* sub = (struct google_protobuf_DoubleValue*)envoy_config_cluster_v3_Cluster_PrefetchPolicy_per_upstream_prefetch_ratio(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_DoubleValue*)_upb_msg_new(&google_protobuf_DoubleValue_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_Cluster_PrefetchPolicy_set_per_upstream_prefetch_ratio(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_PrefetchPolicy_set_predictive_prefetch_ratio(envoy_config_cluster_v3_Cluster_PrefetchPolicy *msg, struct google_protobuf_DoubleValue* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_DoubleValue*) = value;
+}
+UPB_INLINE struct google_protobuf_DoubleValue* envoy_config_cluster_v3_Cluster_PrefetchPolicy_mutable_predictive_prefetch_ratio(envoy_config_cluster_v3_Cluster_PrefetchPolicy *msg, upb_arena *arena) {
+ struct google_protobuf_DoubleValue* sub = (struct google_protobuf_DoubleValue*)envoy_config_cluster_v3_Cluster_PrefetchPolicy_predictive_prefetch_ratio(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_DoubleValue*)_upb_msg_new(&google_protobuf_DoubleValue_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_Cluster_PrefetchPolicy_set_predictive_prefetch_ratio(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.cluster.v3.Cluster.TypedExtensionProtocolOptionsEntry */
+
+UPB_INLINE upb_strview envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry_key(const envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry *msg) {
+ upb_strview ret;
+ _upb_msg_map_key(msg, &ret, 0);
+ return ret;
+}
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry_has_value(const envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
+UPB_INLINE const struct google_protobuf_Any* envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry_value(const envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry *msg) {
+ struct google_protobuf_Any* ret;
+ _upb_msg_map_value(msg, &ret, sizeof(ret));
+ return ret;
+}
+
+UPB_INLINE void envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry_set_value(envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry *msg, struct google_protobuf_Any* value) {
+ _upb_msg_map_set_value(msg, &value, sizeof(struct google_protobuf_Any*));
+}
+
+/* envoy.config.cluster.v3.LoadBalancingPolicy */
+
+UPB_INLINE envoy_config_cluster_v3_LoadBalancingPolicy *envoy_config_cluster_v3_LoadBalancingPolicy_new(upb_arena *arena) {
+ return (envoy_config_cluster_v3_LoadBalancingPolicy *)_upb_msg_new(&envoy_config_cluster_v3_LoadBalancingPolicy_msginit, arena);
+}
+UPB_INLINE envoy_config_cluster_v3_LoadBalancingPolicy *envoy_config_cluster_v3_LoadBalancingPolicy_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_cluster_v3_LoadBalancingPolicy *ret = envoy_config_cluster_v3_LoadBalancingPolicy_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_cluster_v3_LoadBalancingPolicy_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_cluster_v3_LoadBalancingPolicy_serialize(const envoy_config_cluster_v3_LoadBalancingPolicy *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_cluster_v3_LoadBalancingPolicy_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_cluster_v3_LoadBalancingPolicy_has_policies(const envoy_config_cluster_v3_LoadBalancingPolicy *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE const envoy_config_cluster_v3_LoadBalancingPolicy_Policy* const* envoy_config_cluster_v3_LoadBalancingPolicy_policies(const envoy_config_cluster_v3_LoadBalancingPolicy *msg, size_t *len) { return (const envoy_config_cluster_v3_LoadBalancingPolicy_Policy* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
+
+UPB_INLINE envoy_config_cluster_v3_LoadBalancingPolicy_Policy** envoy_config_cluster_v3_LoadBalancingPolicy_mutable_policies(envoy_config_cluster_v3_LoadBalancingPolicy *msg, size_t *len) {
+ return (envoy_config_cluster_v3_LoadBalancingPolicy_Policy**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
+}
+UPB_INLINE envoy_config_cluster_v3_LoadBalancingPolicy_Policy** envoy_config_cluster_v3_LoadBalancingPolicy_resize_policies(envoy_config_cluster_v3_LoadBalancingPolicy *msg, size_t len, upb_arena *arena) {
+ return (envoy_config_cluster_v3_LoadBalancingPolicy_Policy**)_upb_array_resize_accessor(msg, UPB_SIZE(0, 0), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_config_cluster_v3_LoadBalancingPolicy_Policy* envoy_config_cluster_v3_LoadBalancingPolicy_add_policies(envoy_config_cluster_v3_LoadBalancingPolicy *msg, upb_arena *arena) {
+ struct envoy_config_cluster_v3_LoadBalancingPolicy_Policy* sub = (struct envoy_config_cluster_v3_LoadBalancingPolicy_Policy*)_upb_msg_new(&envoy_config_cluster_v3_LoadBalancingPolicy_Policy_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(0, 0), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+
+/* envoy.config.cluster.v3.LoadBalancingPolicy.Policy */
+
+UPB_INLINE envoy_config_cluster_v3_LoadBalancingPolicy_Policy *envoy_config_cluster_v3_LoadBalancingPolicy_Policy_new(upb_arena *arena) {
+ return (envoy_config_cluster_v3_LoadBalancingPolicy_Policy *)_upb_msg_new(&envoy_config_cluster_v3_LoadBalancingPolicy_Policy_msginit, arena);
+}
+UPB_INLINE envoy_config_cluster_v3_LoadBalancingPolicy_Policy *envoy_config_cluster_v3_LoadBalancingPolicy_Policy_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_cluster_v3_LoadBalancingPolicy_Policy *ret = envoy_config_cluster_v3_LoadBalancingPolicy_Policy_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_cluster_v3_LoadBalancingPolicy_Policy_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_cluster_v3_LoadBalancingPolicy_Policy_serialize(const envoy_config_cluster_v3_LoadBalancingPolicy_Policy *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_cluster_v3_LoadBalancingPolicy_Policy_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview envoy_config_cluster_v3_LoadBalancingPolicy_Policy_name(const envoy_config_cluster_v3_LoadBalancingPolicy_Policy *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE bool envoy_config_cluster_v3_LoadBalancingPolicy_Policy_has_typed_config(const envoy_config_cluster_v3_LoadBalancingPolicy_Policy *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
+UPB_INLINE const struct google_protobuf_Any* envoy_config_cluster_v3_LoadBalancingPolicy_Policy_typed_config(const envoy_config_cluster_v3_LoadBalancingPolicy_Policy *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_Any*); }
+
+UPB_INLINE void envoy_config_cluster_v3_LoadBalancingPolicy_Policy_set_name(envoy_config_cluster_v3_LoadBalancingPolicy_Policy *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_cluster_v3_LoadBalancingPolicy_Policy_set_typed_config(envoy_config_cluster_v3_LoadBalancingPolicy_Policy *msg, struct google_protobuf_Any* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_Any*) = value;
+}
+UPB_INLINE struct google_protobuf_Any* envoy_config_cluster_v3_LoadBalancingPolicy_Policy_mutable_typed_config(envoy_config_cluster_v3_LoadBalancingPolicy_Policy *msg, upb_arena *arena) {
+ struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_config_cluster_v3_LoadBalancingPolicy_Policy_typed_config(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_LoadBalancingPolicy_Policy_set_typed_config(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.cluster.v3.UpstreamBindConfig */
+
+UPB_INLINE envoy_config_cluster_v3_UpstreamBindConfig *envoy_config_cluster_v3_UpstreamBindConfig_new(upb_arena *arena) {
+ return (envoy_config_cluster_v3_UpstreamBindConfig *)_upb_msg_new(&envoy_config_cluster_v3_UpstreamBindConfig_msginit, arena);
+}
+UPB_INLINE envoy_config_cluster_v3_UpstreamBindConfig *envoy_config_cluster_v3_UpstreamBindConfig_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_cluster_v3_UpstreamBindConfig *ret = envoy_config_cluster_v3_UpstreamBindConfig_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_cluster_v3_UpstreamBindConfig_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_cluster_v3_UpstreamBindConfig_serialize(const envoy_config_cluster_v3_UpstreamBindConfig *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_cluster_v3_UpstreamBindConfig_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_cluster_v3_UpstreamBindConfig_has_source_address(const envoy_config_cluster_v3_UpstreamBindConfig *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE const struct envoy_config_core_v3_Address* envoy_config_cluster_v3_UpstreamBindConfig_source_address(const envoy_config_cluster_v3_UpstreamBindConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct envoy_config_core_v3_Address*); }
+
+UPB_INLINE void envoy_config_cluster_v3_UpstreamBindConfig_set_source_address(envoy_config_cluster_v3_UpstreamBindConfig *msg, struct envoy_config_core_v3_Address* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct envoy_config_core_v3_Address*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_Address* envoy_config_cluster_v3_UpstreamBindConfig_mutable_source_address(envoy_config_cluster_v3_UpstreamBindConfig *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_Address* sub = (struct envoy_config_core_v3_Address*)envoy_config_cluster_v3_UpstreamBindConfig_source_address(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_Address*)_upb_msg_new(&envoy_config_core_v3_Address_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_UpstreamBindConfig_set_source_address(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.cluster.v3.UpstreamConnectionOptions */
+
+UPB_INLINE envoy_config_cluster_v3_UpstreamConnectionOptions *envoy_config_cluster_v3_UpstreamConnectionOptions_new(upb_arena *arena) {
+ return (envoy_config_cluster_v3_UpstreamConnectionOptions *)_upb_msg_new(&envoy_config_cluster_v3_UpstreamConnectionOptions_msginit, arena);
+}
+UPB_INLINE envoy_config_cluster_v3_UpstreamConnectionOptions *envoy_config_cluster_v3_UpstreamConnectionOptions_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_cluster_v3_UpstreamConnectionOptions *ret = envoy_config_cluster_v3_UpstreamConnectionOptions_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_cluster_v3_UpstreamConnectionOptions_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_cluster_v3_UpstreamConnectionOptions_serialize(const envoy_config_cluster_v3_UpstreamConnectionOptions *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_cluster_v3_UpstreamConnectionOptions_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_cluster_v3_UpstreamConnectionOptions_has_tcp_keepalive(const envoy_config_cluster_v3_UpstreamConnectionOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE const struct envoy_config_core_v3_TcpKeepalive* envoy_config_cluster_v3_UpstreamConnectionOptions_tcp_keepalive(const envoy_config_cluster_v3_UpstreamConnectionOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct envoy_config_core_v3_TcpKeepalive*); }
+
+UPB_INLINE void envoy_config_cluster_v3_UpstreamConnectionOptions_set_tcp_keepalive(envoy_config_cluster_v3_UpstreamConnectionOptions *msg, struct envoy_config_core_v3_TcpKeepalive* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct envoy_config_core_v3_TcpKeepalive*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_TcpKeepalive* envoy_config_cluster_v3_UpstreamConnectionOptions_mutable_tcp_keepalive(envoy_config_cluster_v3_UpstreamConnectionOptions *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_TcpKeepalive* sub = (struct envoy_config_core_v3_TcpKeepalive*)envoy_config_cluster_v3_UpstreamConnectionOptions_tcp_keepalive(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_TcpKeepalive*)_upb_msg_new(&envoy_config_core_v3_TcpKeepalive_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_UpstreamConnectionOptions_set_tcp_keepalive(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.cluster.v3.TrackClusterStats */
+
+UPB_INLINE envoy_config_cluster_v3_TrackClusterStats *envoy_config_cluster_v3_TrackClusterStats_new(upb_arena *arena) {
+ return (envoy_config_cluster_v3_TrackClusterStats *)_upb_msg_new(&envoy_config_cluster_v3_TrackClusterStats_msginit, arena);
+}
+UPB_INLINE envoy_config_cluster_v3_TrackClusterStats *envoy_config_cluster_v3_TrackClusterStats_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_cluster_v3_TrackClusterStats *ret = envoy_config_cluster_v3_TrackClusterStats_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_cluster_v3_TrackClusterStats_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_cluster_v3_TrackClusterStats_serialize(const envoy_config_cluster_v3_TrackClusterStats *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_cluster_v3_TrackClusterStats_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_cluster_v3_TrackClusterStats_timeout_budgets(const envoy_config_cluster_v3_TrackClusterStats *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); }
+UPB_INLINE bool envoy_config_cluster_v3_TrackClusterStats_request_response_sizes(const envoy_config_cluster_v3_TrackClusterStats *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); }
+
+UPB_INLINE void envoy_config_cluster_v3_TrackClusterStats_set_timeout_budgets(envoy_config_cluster_v3_TrackClusterStats *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
+}
+UPB_INLINE void envoy_config_cluster_v3_TrackClusterStats_set_request_response_sizes(envoy_config_cluster_v3_TrackClusterStats *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_CONFIG_CLUSTER_V3_CLUSTER_PROTO_UPB_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.c
index 9aefe1fc46b..8dfe234f39d 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.c
@@ -1,35 +1,35 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/config/cluster/v3/filter.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include <stddef.h>
-#include "upb/msg.h"
-#include "envoy/config/cluster/v3/filter.upb.h"
-#include "google/protobuf/any.upb.h"
-#include "udpa/annotations/status.upb.h"
-#include "udpa/annotations/versioning.upb.h"
-#include "validate/validate.upb.h"
-
-#include "upb/port_def.inc"
-
-static const upb_msglayout *const envoy_config_cluster_v3_Filter_submsgs[1] = {
- &google_protobuf_Any_msginit,
-};
-
-static const upb_msglayout_field envoy_config_cluster_v3_Filter__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 11, 1},
-};
-
-const upb_msglayout envoy_config_cluster_v3_Filter_msginit = {
- &envoy_config_cluster_v3_Filter_submsgs[0],
- &envoy_config_cluster_v3_Filter__fields[0],
- UPB_SIZE(16, 32), 2, false,
-};
-
-#include "upb/port_undef.inc"
-
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/cluster/v3/filter.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg.h"
+#include "envoy/config/cluster/v3/filter.upb.h"
+#include "google/protobuf/any.upb.h"
+#include "udpa/annotations/status.upb.h"
+#include "udpa/annotations/versioning.upb.h"
+#include "validate/validate.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_msglayout *const envoy_config_cluster_v3_Filter_submsgs[1] = {
+ &google_protobuf_Any_msginit,
+};
+
+static const upb_msglayout_field envoy_config_cluster_v3_Filter__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {2, UPB_SIZE(8, 16), 0, 0, 11, 1},
+};
+
+const upb_msglayout envoy_config_cluster_v3_Filter_msginit = {
+ &envoy_config_cluster_v3_Filter_submsgs[0],
+ &envoy_config_cluster_v3_Filter__fields[0],
+ UPB_SIZE(16, 32), 2, false,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.h
index 86448a77ece..016bb950679 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.h
@@ -1,69 +1,69 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/config/cluster/v3/filter.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef ENVOY_CONFIG_CLUSTER_V3_FILTER_PROTO_UPB_H_
-#define ENVOY_CONFIG_CLUSTER_V3_FILTER_PROTO_UPB_H_
-
-#include "upb/msg.h"
-#include "upb/decode.h"
-#include "upb/encode.h"
-
-#include "upb/port_def.inc"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct envoy_config_cluster_v3_Filter;
-typedef struct envoy_config_cluster_v3_Filter envoy_config_cluster_v3_Filter;
-extern const upb_msglayout envoy_config_cluster_v3_Filter_msginit;
-struct google_protobuf_Any;
-extern const upb_msglayout google_protobuf_Any_msginit;
-
-
-/* envoy.config.cluster.v3.Filter */
-
-UPB_INLINE envoy_config_cluster_v3_Filter *envoy_config_cluster_v3_Filter_new(upb_arena *arena) {
- return (envoy_config_cluster_v3_Filter *)_upb_msg_new(&envoy_config_cluster_v3_Filter_msginit, arena);
-}
-UPB_INLINE envoy_config_cluster_v3_Filter *envoy_config_cluster_v3_Filter_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_cluster_v3_Filter *ret = envoy_config_cluster_v3_Filter_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_cluster_v3_Filter_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_cluster_v3_Filter_serialize(const envoy_config_cluster_v3_Filter *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_cluster_v3_Filter_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview envoy_config_cluster_v3_Filter_name(const envoy_config_cluster_v3_Filter *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE bool envoy_config_cluster_v3_Filter_has_typed_config(const envoy_config_cluster_v3_Filter *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const struct google_protobuf_Any* envoy_config_cluster_v3_Filter_typed_config(const envoy_config_cluster_v3_Filter *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_Any*); }
-
-UPB_INLINE void envoy_config_cluster_v3_Filter_set_name(envoy_config_cluster_v3_Filter *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_cluster_v3_Filter_set_typed_config(envoy_config_cluster_v3_Filter *msg, struct google_protobuf_Any* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_Any*) = value;
-}
-UPB_INLINE struct google_protobuf_Any* envoy_config_cluster_v3_Filter_mutable_typed_config(envoy_config_cluster_v3_Filter *msg, upb_arena *arena) {
- struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_config_cluster_v3_Filter_typed_config(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_Filter_set_typed_config(msg, sub);
- }
- return sub;
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* ENVOY_CONFIG_CLUSTER_V3_FILTER_PROTO_UPB_H_ */
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/cluster/v3/filter.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_CONFIG_CLUSTER_V3_FILTER_PROTO_UPB_H_
+#define ENVOY_CONFIG_CLUSTER_V3_FILTER_PROTO_UPB_H_
+
+#include "upb/msg.h"
+#include "upb/decode.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_config_cluster_v3_Filter;
+typedef struct envoy_config_cluster_v3_Filter envoy_config_cluster_v3_Filter;
+extern const upb_msglayout envoy_config_cluster_v3_Filter_msginit;
+struct google_protobuf_Any;
+extern const upb_msglayout google_protobuf_Any_msginit;
+
+
+/* envoy.config.cluster.v3.Filter */
+
+UPB_INLINE envoy_config_cluster_v3_Filter *envoy_config_cluster_v3_Filter_new(upb_arena *arena) {
+ return (envoy_config_cluster_v3_Filter *)_upb_msg_new(&envoy_config_cluster_v3_Filter_msginit, arena);
+}
+UPB_INLINE envoy_config_cluster_v3_Filter *envoy_config_cluster_v3_Filter_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_cluster_v3_Filter *ret = envoy_config_cluster_v3_Filter_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_cluster_v3_Filter_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_cluster_v3_Filter_serialize(const envoy_config_cluster_v3_Filter *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_cluster_v3_Filter_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview envoy_config_cluster_v3_Filter_name(const envoy_config_cluster_v3_Filter *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE bool envoy_config_cluster_v3_Filter_has_typed_config(const envoy_config_cluster_v3_Filter *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
+UPB_INLINE const struct google_protobuf_Any* envoy_config_cluster_v3_Filter_typed_config(const envoy_config_cluster_v3_Filter *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_Any*); }
+
+UPB_INLINE void envoy_config_cluster_v3_Filter_set_name(envoy_config_cluster_v3_Filter *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_cluster_v3_Filter_set_typed_config(envoy_config_cluster_v3_Filter *msg, struct google_protobuf_Any* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_Any*) = value;
+}
+UPB_INLINE struct google_protobuf_Any* envoy_config_cluster_v3_Filter_mutable_typed_config(envoy_config_cluster_v3_Filter *msg, upb_arena *arena) {
+ struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_config_cluster_v3_Filter_typed_config(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_Filter_set_typed_config(msg, sub);
+ }
+ return sub;
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_CONFIG_CLUSTER_V3_FILTER_PROTO_UPB_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.c
index 7129b62295d..a6af66cd6d3 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.c
@@ -1,55 +1,55 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/config/cluster/v3/outlier_detection.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include <stddef.h>
-#include "upb/msg.h"
-#include "envoy/config/cluster/v3/outlier_detection.upb.h"
-#include "google/protobuf/duration.upb.h"
-#include "google/protobuf/wrappers.upb.h"
-#include "udpa/annotations/status.upb.h"
-#include "udpa/annotations/versioning.upb.h"
-#include "validate/validate.upb.h"
-
-#include "upb/port_def.inc"
-
-static const upb_msglayout *const envoy_config_cluster_v3_OutlierDetection_submsgs[19] = {
- &google_protobuf_Duration_msginit,
- &google_protobuf_UInt32Value_msginit,
-};
-
-static const upb_msglayout_field envoy_config_cluster_v3_OutlierDetection__fields[20] = {
- {1, UPB_SIZE(4, 8), 0, 1, 11, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 11, 1},
- {3, UPB_SIZE(12, 24), 0, 0, 11, 1},
- {4, UPB_SIZE(16, 32), 0, 1, 11, 1},
- {5, UPB_SIZE(20, 40), 0, 1, 11, 1},
- {6, UPB_SIZE(24, 48), 0, 1, 11, 1},
- {7, UPB_SIZE(28, 56), 0, 1, 11, 1},
- {8, UPB_SIZE(32, 64), 0, 1, 11, 1},
- {9, UPB_SIZE(36, 72), 0, 1, 11, 1},
- {10, UPB_SIZE(40, 80), 0, 1, 11, 1},
- {11, UPB_SIZE(44, 88), 0, 1, 11, 1},
- {12, UPB_SIZE(0, 0), 0, 0, 8, 1},
- {13, UPB_SIZE(48, 96), 0, 1, 11, 1},
- {14, UPB_SIZE(52, 104), 0, 1, 11, 1},
- {15, UPB_SIZE(56, 112), 0, 1, 11, 1},
- {16, UPB_SIZE(60, 120), 0, 1, 11, 1},
- {17, UPB_SIZE(64, 128), 0, 1, 11, 1},
- {18, UPB_SIZE(68, 136), 0, 1, 11, 1},
- {19, UPB_SIZE(72, 144), 0, 1, 11, 1},
- {20, UPB_SIZE(76, 152), 0, 1, 11, 1},
-};
-
-const upb_msglayout envoy_config_cluster_v3_OutlierDetection_msginit = {
- &envoy_config_cluster_v3_OutlierDetection_submsgs[0],
- &envoy_config_cluster_v3_OutlierDetection__fields[0],
- UPB_SIZE(80, 160), 20, false,
-};
-
-#include "upb/port_undef.inc"
-
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/cluster/v3/outlier_detection.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg.h"
+#include "envoy/config/cluster/v3/outlier_detection.upb.h"
+#include "google/protobuf/duration.upb.h"
+#include "google/protobuf/wrappers.upb.h"
+#include "udpa/annotations/status.upb.h"
+#include "udpa/annotations/versioning.upb.h"
+#include "validate/validate.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_msglayout *const envoy_config_cluster_v3_OutlierDetection_submsgs[19] = {
+ &google_protobuf_Duration_msginit,
+ &google_protobuf_UInt32Value_msginit,
+};
+
+static const upb_msglayout_field envoy_config_cluster_v3_OutlierDetection__fields[20] = {
+ {1, UPB_SIZE(4, 8), 0, 1, 11, 1},
+ {2, UPB_SIZE(8, 16), 0, 0, 11, 1},
+ {3, UPB_SIZE(12, 24), 0, 0, 11, 1},
+ {4, UPB_SIZE(16, 32), 0, 1, 11, 1},
+ {5, UPB_SIZE(20, 40), 0, 1, 11, 1},
+ {6, UPB_SIZE(24, 48), 0, 1, 11, 1},
+ {7, UPB_SIZE(28, 56), 0, 1, 11, 1},
+ {8, UPB_SIZE(32, 64), 0, 1, 11, 1},
+ {9, UPB_SIZE(36, 72), 0, 1, 11, 1},
+ {10, UPB_SIZE(40, 80), 0, 1, 11, 1},
+ {11, UPB_SIZE(44, 88), 0, 1, 11, 1},
+ {12, UPB_SIZE(0, 0), 0, 0, 8, 1},
+ {13, UPB_SIZE(48, 96), 0, 1, 11, 1},
+ {14, UPB_SIZE(52, 104), 0, 1, 11, 1},
+ {15, UPB_SIZE(56, 112), 0, 1, 11, 1},
+ {16, UPB_SIZE(60, 120), 0, 1, 11, 1},
+ {17, UPB_SIZE(64, 128), 0, 1, 11, 1},
+ {18, UPB_SIZE(68, 136), 0, 1, 11, 1},
+ {19, UPB_SIZE(72, 144), 0, 1, 11, 1},
+ {20, UPB_SIZE(76, 152), 0, 1, 11, 1},
+};
+
+const upb_msglayout envoy_config_cluster_v3_OutlierDetection_msginit = {
+ &envoy_config_cluster_v3_OutlierDetection_submsgs[0],
+ &envoy_config_cluster_v3_OutlierDetection__fields[0],
+ UPB_SIZE(80, 160), 20, false,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.h
index e82bdea16d5..d8b03a80079 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.h
@@ -1,323 +1,323 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/config/cluster/v3/outlier_detection.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef ENVOY_CONFIG_CLUSTER_V3_OUTLIER_DETECTION_PROTO_UPB_H_
-#define ENVOY_CONFIG_CLUSTER_V3_OUTLIER_DETECTION_PROTO_UPB_H_
-
-#include "upb/msg.h"
-#include "upb/decode.h"
-#include "upb/encode.h"
-
-#include "upb/port_def.inc"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct envoy_config_cluster_v3_OutlierDetection;
-typedef struct envoy_config_cluster_v3_OutlierDetection envoy_config_cluster_v3_OutlierDetection;
-extern const upb_msglayout envoy_config_cluster_v3_OutlierDetection_msginit;
-struct google_protobuf_Duration;
-struct google_protobuf_UInt32Value;
-extern const upb_msglayout google_protobuf_Duration_msginit;
-extern const upb_msglayout google_protobuf_UInt32Value_msginit;
-
-
-/* envoy.config.cluster.v3.OutlierDetection */
-
-UPB_INLINE envoy_config_cluster_v3_OutlierDetection *envoy_config_cluster_v3_OutlierDetection_new(upb_arena *arena) {
- return (envoy_config_cluster_v3_OutlierDetection *)_upb_msg_new(&envoy_config_cluster_v3_OutlierDetection_msginit, arena);
-}
-UPB_INLINE envoy_config_cluster_v3_OutlierDetection *envoy_config_cluster_v3_OutlierDetection_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_cluster_v3_OutlierDetection *ret = envoy_config_cluster_v3_OutlierDetection_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_cluster_v3_OutlierDetection_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_cluster_v3_OutlierDetection_serialize(const envoy_config_cluster_v3_OutlierDetection *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_cluster_v3_OutlierDetection_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_has_consecutive_5xx(const envoy_config_cluster_v3_OutlierDetection *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
-UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_consecutive_5xx(const envoy_config_cluster_v3_OutlierDetection *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_UInt32Value*); }
-UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_has_interval(const envoy_config_cluster_v3_OutlierDetection *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const struct google_protobuf_Duration* envoy_config_cluster_v3_OutlierDetection_interval(const envoy_config_cluster_v3_OutlierDetection *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_Duration*); }
-UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_has_base_ejection_time(const envoy_config_cluster_v3_OutlierDetection *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
-UPB_INLINE const struct google_protobuf_Duration* envoy_config_cluster_v3_OutlierDetection_base_ejection_time(const envoy_config_cluster_v3_OutlierDetection *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_protobuf_Duration*); }
-UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_has_max_ejection_percent(const envoy_config_cluster_v3_OutlierDetection *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); }
-UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_max_ejection_percent(const envoy_config_cluster_v3_OutlierDetection *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const struct google_protobuf_UInt32Value*); }
-UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_has_enforcing_consecutive_5xx(const envoy_config_cluster_v3_OutlierDetection *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 40)); }
-UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_enforcing_consecutive_5xx(const envoy_config_cluster_v3_OutlierDetection *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const struct google_protobuf_UInt32Value*); }
-UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_has_enforcing_success_rate(const envoy_config_cluster_v3_OutlierDetection *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 48)); }
-UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_enforcing_success_rate(const envoy_config_cluster_v3_OutlierDetection *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 48), const struct google_protobuf_UInt32Value*); }
-UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_has_success_rate_minimum_hosts(const envoy_config_cluster_v3_OutlierDetection *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 56)); }
-UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_success_rate_minimum_hosts(const envoy_config_cluster_v3_OutlierDetection *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 56), const struct google_protobuf_UInt32Value*); }
-UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_has_success_rate_request_volume(const envoy_config_cluster_v3_OutlierDetection *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(32, 64)); }
-UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_success_rate_request_volume(const envoy_config_cluster_v3_OutlierDetection *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 64), const struct google_protobuf_UInt32Value*); }
-UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_has_success_rate_stdev_factor(const envoy_config_cluster_v3_OutlierDetection *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(36, 72)); }
-UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_success_rate_stdev_factor(const envoy_config_cluster_v3_OutlierDetection *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(36, 72), const struct google_protobuf_UInt32Value*); }
-UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_has_consecutive_gateway_failure(const envoy_config_cluster_v3_OutlierDetection *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(40, 80)); }
-UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_consecutive_gateway_failure(const envoy_config_cluster_v3_OutlierDetection *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(40, 80), const struct google_protobuf_UInt32Value*); }
-UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_has_enforcing_consecutive_gateway_failure(const envoy_config_cluster_v3_OutlierDetection *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(44, 88)); }
-UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_enforcing_consecutive_gateway_failure(const envoy_config_cluster_v3_OutlierDetection *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(44, 88), const struct google_protobuf_UInt32Value*); }
-UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_split_external_local_origin_errors(const envoy_config_cluster_v3_OutlierDetection *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); }
-UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_has_consecutive_local_origin_failure(const envoy_config_cluster_v3_OutlierDetection *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(48, 96)); }
-UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_consecutive_local_origin_failure(const envoy_config_cluster_v3_OutlierDetection *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(48, 96), const struct google_protobuf_UInt32Value*); }
-UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_has_enforcing_consecutive_local_origin_failure(const envoy_config_cluster_v3_OutlierDetection *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(52, 104)); }
-UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_enforcing_consecutive_local_origin_failure(const envoy_config_cluster_v3_OutlierDetection *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(52, 104), const struct google_protobuf_UInt32Value*); }
-UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_has_enforcing_local_origin_success_rate(const envoy_config_cluster_v3_OutlierDetection *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(56, 112)); }
-UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_enforcing_local_origin_success_rate(const envoy_config_cluster_v3_OutlierDetection *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(56, 112), const struct google_protobuf_UInt32Value*); }
-UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_has_failure_percentage_threshold(const envoy_config_cluster_v3_OutlierDetection *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(60, 120)); }
-UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_failure_percentage_threshold(const envoy_config_cluster_v3_OutlierDetection *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(60, 120), const struct google_protobuf_UInt32Value*); }
-UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_has_enforcing_failure_percentage(const envoy_config_cluster_v3_OutlierDetection *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(64, 128)); }
-UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_enforcing_failure_percentage(const envoy_config_cluster_v3_OutlierDetection *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(64, 128), const struct google_protobuf_UInt32Value*); }
-UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_has_enforcing_failure_percentage_local_origin(const envoy_config_cluster_v3_OutlierDetection *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(68, 136)); }
-UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_enforcing_failure_percentage_local_origin(const envoy_config_cluster_v3_OutlierDetection *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(68, 136), const struct google_protobuf_UInt32Value*); }
-UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_has_failure_percentage_minimum_hosts(const envoy_config_cluster_v3_OutlierDetection *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(72, 144)); }
-UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_failure_percentage_minimum_hosts(const envoy_config_cluster_v3_OutlierDetection *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(72, 144), const struct google_protobuf_UInt32Value*); }
-UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_has_failure_percentage_request_volume(const envoy_config_cluster_v3_OutlierDetection *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(76, 152)); }
-UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_failure_percentage_request_volume(const envoy_config_cluster_v3_OutlierDetection *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(76, 152), const struct google_protobuf_UInt32Value*); }
-
-UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_set_consecutive_5xx(envoy_config_cluster_v3_OutlierDetection *msg, struct google_protobuf_UInt32Value* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_UInt32Value*) = value;
-}
-UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_mutable_consecutive_5xx(envoy_config_cluster_v3_OutlierDetection *msg, upb_arena *arena) {
- struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_cluster_v3_OutlierDetection_consecutive_5xx(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_OutlierDetection_set_consecutive_5xx(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_set_interval(envoy_config_cluster_v3_OutlierDetection *msg, struct google_protobuf_Duration* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_Duration*) = value;
-}
-UPB_INLINE struct google_protobuf_Duration* envoy_config_cluster_v3_OutlierDetection_mutable_interval(envoy_config_cluster_v3_OutlierDetection *msg, upb_arena *arena) {
- struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_cluster_v3_OutlierDetection_interval(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_OutlierDetection_set_interval(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_set_base_ejection_time(envoy_config_cluster_v3_OutlierDetection *msg, struct google_protobuf_Duration* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_protobuf_Duration*) = value;
-}
-UPB_INLINE struct google_protobuf_Duration* envoy_config_cluster_v3_OutlierDetection_mutable_base_ejection_time(envoy_config_cluster_v3_OutlierDetection *msg, upb_arena *arena) {
- struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_cluster_v3_OutlierDetection_base_ejection_time(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_OutlierDetection_set_base_ejection_time(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_set_max_ejection_percent(envoy_config_cluster_v3_OutlierDetection *msg, struct google_protobuf_UInt32Value* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(16, 32), struct google_protobuf_UInt32Value*) = value;
-}
-UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_mutable_max_ejection_percent(envoy_config_cluster_v3_OutlierDetection *msg, upb_arena *arena) {
- struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_cluster_v3_OutlierDetection_max_ejection_percent(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_OutlierDetection_set_max_ejection_percent(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_set_enforcing_consecutive_5xx(envoy_config_cluster_v3_OutlierDetection *msg, struct google_protobuf_UInt32Value* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(20, 40), struct google_protobuf_UInt32Value*) = value;
-}
-UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_mutable_enforcing_consecutive_5xx(envoy_config_cluster_v3_OutlierDetection *msg, upb_arena *arena) {
- struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_cluster_v3_OutlierDetection_enforcing_consecutive_5xx(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_OutlierDetection_set_enforcing_consecutive_5xx(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_set_enforcing_success_rate(envoy_config_cluster_v3_OutlierDetection *msg, struct google_protobuf_UInt32Value* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(24, 48), struct google_protobuf_UInt32Value*) = value;
-}
-UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_mutable_enforcing_success_rate(envoy_config_cluster_v3_OutlierDetection *msg, upb_arena *arena) {
- struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_cluster_v3_OutlierDetection_enforcing_success_rate(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_OutlierDetection_set_enforcing_success_rate(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_set_success_rate_minimum_hosts(envoy_config_cluster_v3_OutlierDetection *msg, struct google_protobuf_UInt32Value* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(28, 56), struct google_protobuf_UInt32Value*) = value;
-}
-UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_mutable_success_rate_minimum_hosts(envoy_config_cluster_v3_OutlierDetection *msg, upb_arena *arena) {
- struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_cluster_v3_OutlierDetection_success_rate_minimum_hosts(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_OutlierDetection_set_success_rate_minimum_hosts(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_set_success_rate_request_volume(envoy_config_cluster_v3_OutlierDetection *msg, struct google_protobuf_UInt32Value* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(32, 64), struct google_protobuf_UInt32Value*) = value;
-}
-UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_mutable_success_rate_request_volume(envoy_config_cluster_v3_OutlierDetection *msg, upb_arena *arena) {
- struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_cluster_v3_OutlierDetection_success_rate_request_volume(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_OutlierDetection_set_success_rate_request_volume(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_set_success_rate_stdev_factor(envoy_config_cluster_v3_OutlierDetection *msg, struct google_protobuf_UInt32Value* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(36, 72), struct google_protobuf_UInt32Value*) = value;
-}
-UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_mutable_success_rate_stdev_factor(envoy_config_cluster_v3_OutlierDetection *msg, upb_arena *arena) {
- struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_cluster_v3_OutlierDetection_success_rate_stdev_factor(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_OutlierDetection_set_success_rate_stdev_factor(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_set_consecutive_gateway_failure(envoy_config_cluster_v3_OutlierDetection *msg, struct google_protobuf_UInt32Value* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(40, 80), struct google_protobuf_UInt32Value*) = value;
-}
-UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_mutable_consecutive_gateway_failure(envoy_config_cluster_v3_OutlierDetection *msg, upb_arena *arena) {
- struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_cluster_v3_OutlierDetection_consecutive_gateway_failure(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_OutlierDetection_set_consecutive_gateway_failure(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_set_enforcing_consecutive_gateway_failure(envoy_config_cluster_v3_OutlierDetection *msg, struct google_protobuf_UInt32Value* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(44, 88), struct google_protobuf_UInt32Value*) = value;
-}
-UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_mutable_enforcing_consecutive_gateway_failure(envoy_config_cluster_v3_OutlierDetection *msg, upb_arena *arena) {
- struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_cluster_v3_OutlierDetection_enforcing_consecutive_gateway_failure(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_OutlierDetection_set_enforcing_consecutive_gateway_failure(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_set_split_external_local_origin_errors(envoy_config_cluster_v3_OutlierDetection *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
-}
-UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_set_consecutive_local_origin_failure(envoy_config_cluster_v3_OutlierDetection *msg, struct google_protobuf_UInt32Value* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(48, 96), struct google_protobuf_UInt32Value*) = value;
-}
-UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_mutable_consecutive_local_origin_failure(envoy_config_cluster_v3_OutlierDetection *msg, upb_arena *arena) {
- struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_cluster_v3_OutlierDetection_consecutive_local_origin_failure(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_OutlierDetection_set_consecutive_local_origin_failure(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_set_enforcing_consecutive_local_origin_failure(envoy_config_cluster_v3_OutlierDetection *msg, struct google_protobuf_UInt32Value* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(52, 104), struct google_protobuf_UInt32Value*) = value;
-}
-UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_mutable_enforcing_consecutive_local_origin_failure(envoy_config_cluster_v3_OutlierDetection *msg, upb_arena *arena) {
- struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_cluster_v3_OutlierDetection_enforcing_consecutive_local_origin_failure(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_OutlierDetection_set_enforcing_consecutive_local_origin_failure(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_set_enforcing_local_origin_success_rate(envoy_config_cluster_v3_OutlierDetection *msg, struct google_protobuf_UInt32Value* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(56, 112), struct google_protobuf_UInt32Value*) = value;
-}
-UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_mutable_enforcing_local_origin_success_rate(envoy_config_cluster_v3_OutlierDetection *msg, upb_arena *arena) {
- struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_cluster_v3_OutlierDetection_enforcing_local_origin_success_rate(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_OutlierDetection_set_enforcing_local_origin_success_rate(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_set_failure_percentage_threshold(envoy_config_cluster_v3_OutlierDetection *msg, struct google_protobuf_UInt32Value* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(60, 120), struct google_protobuf_UInt32Value*) = value;
-}
-UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_mutable_failure_percentage_threshold(envoy_config_cluster_v3_OutlierDetection *msg, upb_arena *arena) {
- struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_cluster_v3_OutlierDetection_failure_percentage_threshold(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_OutlierDetection_set_failure_percentage_threshold(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_set_enforcing_failure_percentage(envoy_config_cluster_v3_OutlierDetection *msg, struct google_protobuf_UInt32Value* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(64, 128), struct google_protobuf_UInt32Value*) = value;
-}
-UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_mutable_enforcing_failure_percentage(envoy_config_cluster_v3_OutlierDetection *msg, upb_arena *arena) {
- struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_cluster_v3_OutlierDetection_enforcing_failure_percentage(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_OutlierDetection_set_enforcing_failure_percentage(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_set_enforcing_failure_percentage_local_origin(envoy_config_cluster_v3_OutlierDetection *msg, struct google_protobuf_UInt32Value* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(68, 136), struct google_protobuf_UInt32Value*) = value;
-}
-UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_mutable_enforcing_failure_percentage_local_origin(envoy_config_cluster_v3_OutlierDetection *msg, upb_arena *arena) {
- struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_cluster_v3_OutlierDetection_enforcing_failure_percentage_local_origin(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_OutlierDetection_set_enforcing_failure_percentage_local_origin(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_set_failure_percentage_minimum_hosts(envoy_config_cluster_v3_OutlierDetection *msg, struct google_protobuf_UInt32Value* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(72, 144), struct google_protobuf_UInt32Value*) = value;
-}
-UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_mutable_failure_percentage_minimum_hosts(envoy_config_cluster_v3_OutlierDetection *msg, upb_arena *arena) {
- struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_cluster_v3_OutlierDetection_failure_percentage_minimum_hosts(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_OutlierDetection_set_failure_percentage_minimum_hosts(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_set_failure_percentage_request_volume(envoy_config_cluster_v3_OutlierDetection *msg, struct google_protobuf_UInt32Value* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(76, 152), struct google_protobuf_UInt32Value*) = value;
-}
-UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_mutable_failure_percentage_request_volume(envoy_config_cluster_v3_OutlierDetection *msg, upb_arena *arena) {
- struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_cluster_v3_OutlierDetection_failure_percentage_request_volume(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
- if (!sub) return NULL;
- envoy_config_cluster_v3_OutlierDetection_set_failure_percentage_request_volume(msg, sub);
- }
- return sub;
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* ENVOY_CONFIG_CLUSTER_V3_OUTLIER_DETECTION_PROTO_UPB_H_ */
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/cluster/v3/outlier_detection.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_CONFIG_CLUSTER_V3_OUTLIER_DETECTION_PROTO_UPB_H_
+#define ENVOY_CONFIG_CLUSTER_V3_OUTLIER_DETECTION_PROTO_UPB_H_
+
+#include "upb/msg.h"
+#include "upb/decode.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_config_cluster_v3_OutlierDetection;
+typedef struct envoy_config_cluster_v3_OutlierDetection envoy_config_cluster_v3_OutlierDetection;
+extern const upb_msglayout envoy_config_cluster_v3_OutlierDetection_msginit;
+struct google_protobuf_Duration;
+struct google_protobuf_UInt32Value;
+extern const upb_msglayout google_protobuf_Duration_msginit;
+extern const upb_msglayout google_protobuf_UInt32Value_msginit;
+
+
+/* envoy.config.cluster.v3.OutlierDetection */
+
+UPB_INLINE envoy_config_cluster_v3_OutlierDetection *envoy_config_cluster_v3_OutlierDetection_new(upb_arena *arena) {
+ return (envoy_config_cluster_v3_OutlierDetection *)_upb_msg_new(&envoy_config_cluster_v3_OutlierDetection_msginit, arena);
+}
+UPB_INLINE envoy_config_cluster_v3_OutlierDetection *envoy_config_cluster_v3_OutlierDetection_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_cluster_v3_OutlierDetection *ret = envoy_config_cluster_v3_OutlierDetection_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_cluster_v3_OutlierDetection_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_cluster_v3_OutlierDetection_serialize(const envoy_config_cluster_v3_OutlierDetection *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_cluster_v3_OutlierDetection_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_has_consecutive_5xx(const envoy_config_cluster_v3_OutlierDetection *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_consecutive_5xx(const envoy_config_cluster_v3_OutlierDetection *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_UInt32Value*); }
+UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_has_interval(const envoy_config_cluster_v3_OutlierDetection *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
+UPB_INLINE const struct google_protobuf_Duration* envoy_config_cluster_v3_OutlierDetection_interval(const envoy_config_cluster_v3_OutlierDetection *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_Duration*); }
+UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_has_base_ejection_time(const envoy_config_cluster_v3_OutlierDetection *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
+UPB_INLINE const struct google_protobuf_Duration* envoy_config_cluster_v3_OutlierDetection_base_ejection_time(const envoy_config_cluster_v3_OutlierDetection *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_protobuf_Duration*); }
+UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_has_max_ejection_percent(const envoy_config_cluster_v3_OutlierDetection *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); }
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_max_ejection_percent(const envoy_config_cluster_v3_OutlierDetection *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const struct google_protobuf_UInt32Value*); }
+UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_has_enforcing_consecutive_5xx(const envoy_config_cluster_v3_OutlierDetection *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 40)); }
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_enforcing_consecutive_5xx(const envoy_config_cluster_v3_OutlierDetection *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const struct google_protobuf_UInt32Value*); }
+UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_has_enforcing_success_rate(const envoy_config_cluster_v3_OutlierDetection *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 48)); }
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_enforcing_success_rate(const envoy_config_cluster_v3_OutlierDetection *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 48), const struct google_protobuf_UInt32Value*); }
+UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_has_success_rate_minimum_hosts(const envoy_config_cluster_v3_OutlierDetection *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 56)); }
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_success_rate_minimum_hosts(const envoy_config_cluster_v3_OutlierDetection *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 56), const struct google_protobuf_UInt32Value*); }
+UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_has_success_rate_request_volume(const envoy_config_cluster_v3_OutlierDetection *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(32, 64)); }
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_success_rate_request_volume(const envoy_config_cluster_v3_OutlierDetection *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 64), const struct google_protobuf_UInt32Value*); }
+UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_has_success_rate_stdev_factor(const envoy_config_cluster_v3_OutlierDetection *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(36, 72)); }
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_success_rate_stdev_factor(const envoy_config_cluster_v3_OutlierDetection *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(36, 72), const struct google_protobuf_UInt32Value*); }
+UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_has_consecutive_gateway_failure(const envoy_config_cluster_v3_OutlierDetection *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(40, 80)); }
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_consecutive_gateway_failure(const envoy_config_cluster_v3_OutlierDetection *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(40, 80), const struct google_protobuf_UInt32Value*); }
+UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_has_enforcing_consecutive_gateway_failure(const envoy_config_cluster_v3_OutlierDetection *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(44, 88)); }
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_enforcing_consecutive_gateway_failure(const envoy_config_cluster_v3_OutlierDetection *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(44, 88), const struct google_protobuf_UInt32Value*); }
+UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_split_external_local_origin_errors(const envoy_config_cluster_v3_OutlierDetection *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); }
+UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_has_consecutive_local_origin_failure(const envoy_config_cluster_v3_OutlierDetection *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(48, 96)); }
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_consecutive_local_origin_failure(const envoy_config_cluster_v3_OutlierDetection *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(48, 96), const struct google_protobuf_UInt32Value*); }
+UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_has_enforcing_consecutive_local_origin_failure(const envoy_config_cluster_v3_OutlierDetection *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(52, 104)); }
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_enforcing_consecutive_local_origin_failure(const envoy_config_cluster_v3_OutlierDetection *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(52, 104), const struct google_protobuf_UInt32Value*); }
+UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_has_enforcing_local_origin_success_rate(const envoy_config_cluster_v3_OutlierDetection *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(56, 112)); }
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_enforcing_local_origin_success_rate(const envoy_config_cluster_v3_OutlierDetection *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(56, 112), const struct google_protobuf_UInt32Value*); }
+UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_has_failure_percentage_threshold(const envoy_config_cluster_v3_OutlierDetection *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(60, 120)); }
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_failure_percentage_threshold(const envoy_config_cluster_v3_OutlierDetection *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(60, 120), const struct google_protobuf_UInt32Value*); }
+UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_has_enforcing_failure_percentage(const envoy_config_cluster_v3_OutlierDetection *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(64, 128)); }
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_enforcing_failure_percentage(const envoy_config_cluster_v3_OutlierDetection *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(64, 128), const struct google_protobuf_UInt32Value*); }
+UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_has_enforcing_failure_percentage_local_origin(const envoy_config_cluster_v3_OutlierDetection *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(68, 136)); }
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_enforcing_failure_percentage_local_origin(const envoy_config_cluster_v3_OutlierDetection *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(68, 136), const struct google_protobuf_UInt32Value*); }
+UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_has_failure_percentage_minimum_hosts(const envoy_config_cluster_v3_OutlierDetection *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(72, 144)); }
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_failure_percentage_minimum_hosts(const envoy_config_cluster_v3_OutlierDetection *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(72, 144), const struct google_protobuf_UInt32Value*); }
+UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_has_failure_percentage_request_volume(const envoy_config_cluster_v3_OutlierDetection *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(76, 152)); }
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_failure_percentage_request_volume(const envoy_config_cluster_v3_OutlierDetection *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(76, 152), const struct google_protobuf_UInt32Value*); }
+
+UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_set_consecutive_5xx(envoy_config_cluster_v3_OutlierDetection *msg, struct google_protobuf_UInt32Value* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_mutable_consecutive_5xx(envoy_config_cluster_v3_OutlierDetection *msg, upb_arena *arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_cluster_v3_OutlierDetection_consecutive_5xx(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_OutlierDetection_set_consecutive_5xx(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_set_interval(envoy_config_cluster_v3_OutlierDetection *msg, struct google_protobuf_Duration* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_Duration*) = value;
+}
+UPB_INLINE struct google_protobuf_Duration* envoy_config_cluster_v3_OutlierDetection_mutable_interval(envoy_config_cluster_v3_OutlierDetection *msg, upb_arena *arena) {
+ struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_cluster_v3_OutlierDetection_interval(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_OutlierDetection_set_interval(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_set_base_ejection_time(envoy_config_cluster_v3_OutlierDetection *msg, struct google_protobuf_Duration* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_protobuf_Duration*) = value;
+}
+UPB_INLINE struct google_protobuf_Duration* envoy_config_cluster_v3_OutlierDetection_mutable_base_ejection_time(envoy_config_cluster_v3_OutlierDetection *msg, upb_arena *arena) {
+ struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_cluster_v3_OutlierDetection_base_ejection_time(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_OutlierDetection_set_base_ejection_time(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_set_max_ejection_percent(envoy_config_cluster_v3_OutlierDetection *msg, struct google_protobuf_UInt32Value* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_mutable_max_ejection_percent(envoy_config_cluster_v3_OutlierDetection *msg, upb_arena *arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_cluster_v3_OutlierDetection_max_ejection_percent(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_OutlierDetection_set_max_ejection_percent(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_set_enforcing_consecutive_5xx(envoy_config_cluster_v3_OutlierDetection *msg, struct google_protobuf_UInt32Value* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 40), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_mutable_enforcing_consecutive_5xx(envoy_config_cluster_v3_OutlierDetection *msg, upb_arena *arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_cluster_v3_OutlierDetection_enforcing_consecutive_5xx(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_OutlierDetection_set_enforcing_consecutive_5xx(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_set_enforcing_success_rate(envoy_config_cluster_v3_OutlierDetection *msg, struct google_protobuf_UInt32Value* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 48), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_mutable_enforcing_success_rate(envoy_config_cluster_v3_OutlierDetection *msg, upb_arena *arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_cluster_v3_OutlierDetection_enforcing_success_rate(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_OutlierDetection_set_enforcing_success_rate(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_set_success_rate_minimum_hosts(envoy_config_cluster_v3_OutlierDetection *msg, struct google_protobuf_UInt32Value* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 56), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_mutable_success_rate_minimum_hosts(envoy_config_cluster_v3_OutlierDetection *msg, upb_arena *arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_cluster_v3_OutlierDetection_success_rate_minimum_hosts(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_OutlierDetection_set_success_rate_minimum_hosts(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_set_success_rate_request_volume(envoy_config_cluster_v3_OutlierDetection *msg, struct google_protobuf_UInt32Value* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 64), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_mutable_success_rate_request_volume(envoy_config_cluster_v3_OutlierDetection *msg, upb_arena *arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_cluster_v3_OutlierDetection_success_rate_request_volume(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_OutlierDetection_set_success_rate_request_volume(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_set_success_rate_stdev_factor(envoy_config_cluster_v3_OutlierDetection *msg, struct google_protobuf_UInt32Value* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(36, 72), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_mutable_success_rate_stdev_factor(envoy_config_cluster_v3_OutlierDetection *msg, upb_arena *arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_cluster_v3_OutlierDetection_success_rate_stdev_factor(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_OutlierDetection_set_success_rate_stdev_factor(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_set_consecutive_gateway_failure(envoy_config_cluster_v3_OutlierDetection *msg, struct google_protobuf_UInt32Value* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 80), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_mutable_consecutive_gateway_failure(envoy_config_cluster_v3_OutlierDetection *msg, upb_arena *arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_cluster_v3_OutlierDetection_consecutive_gateway_failure(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_OutlierDetection_set_consecutive_gateway_failure(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_set_enforcing_consecutive_gateway_failure(envoy_config_cluster_v3_OutlierDetection *msg, struct google_protobuf_UInt32Value* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(44, 88), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_mutable_enforcing_consecutive_gateway_failure(envoy_config_cluster_v3_OutlierDetection *msg, upb_arena *arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_cluster_v3_OutlierDetection_enforcing_consecutive_gateway_failure(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_OutlierDetection_set_enforcing_consecutive_gateway_failure(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_set_split_external_local_origin_errors(envoy_config_cluster_v3_OutlierDetection *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
+}
+UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_set_consecutive_local_origin_failure(envoy_config_cluster_v3_OutlierDetection *msg, struct google_protobuf_UInt32Value* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(48, 96), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_mutable_consecutive_local_origin_failure(envoy_config_cluster_v3_OutlierDetection *msg, upb_arena *arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_cluster_v3_OutlierDetection_consecutive_local_origin_failure(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_OutlierDetection_set_consecutive_local_origin_failure(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_set_enforcing_consecutive_local_origin_failure(envoy_config_cluster_v3_OutlierDetection *msg, struct google_protobuf_UInt32Value* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(52, 104), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_mutable_enforcing_consecutive_local_origin_failure(envoy_config_cluster_v3_OutlierDetection *msg, upb_arena *arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_cluster_v3_OutlierDetection_enforcing_consecutive_local_origin_failure(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_OutlierDetection_set_enforcing_consecutive_local_origin_failure(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_set_enforcing_local_origin_success_rate(envoy_config_cluster_v3_OutlierDetection *msg, struct google_protobuf_UInt32Value* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(56, 112), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_mutable_enforcing_local_origin_success_rate(envoy_config_cluster_v3_OutlierDetection *msg, upb_arena *arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_cluster_v3_OutlierDetection_enforcing_local_origin_success_rate(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_OutlierDetection_set_enforcing_local_origin_success_rate(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_set_failure_percentage_threshold(envoy_config_cluster_v3_OutlierDetection *msg, struct google_protobuf_UInt32Value* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(60, 120), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_mutable_failure_percentage_threshold(envoy_config_cluster_v3_OutlierDetection *msg, upb_arena *arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_cluster_v3_OutlierDetection_failure_percentage_threshold(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_OutlierDetection_set_failure_percentage_threshold(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_set_enforcing_failure_percentage(envoy_config_cluster_v3_OutlierDetection *msg, struct google_protobuf_UInt32Value* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(64, 128), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_mutable_enforcing_failure_percentage(envoy_config_cluster_v3_OutlierDetection *msg, upb_arena *arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_cluster_v3_OutlierDetection_enforcing_failure_percentage(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_OutlierDetection_set_enforcing_failure_percentage(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_set_enforcing_failure_percentage_local_origin(envoy_config_cluster_v3_OutlierDetection *msg, struct google_protobuf_UInt32Value* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(68, 136), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_mutable_enforcing_failure_percentage_local_origin(envoy_config_cluster_v3_OutlierDetection *msg, upb_arena *arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_cluster_v3_OutlierDetection_enforcing_failure_percentage_local_origin(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_OutlierDetection_set_enforcing_failure_percentage_local_origin(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_set_failure_percentage_minimum_hosts(envoy_config_cluster_v3_OutlierDetection *msg, struct google_protobuf_UInt32Value* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(72, 144), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_mutable_failure_percentage_minimum_hosts(envoy_config_cluster_v3_OutlierDetection *msg, upb_arena *arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_cluster_v3_OutlierDetection_failure_percentage_minimum_hosts(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_OutlierDetection_set_failure_percentage_minimum_hosts(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_set_failure_percentage_request_volume(envoy_config_cluster_v3_OutlierDetection *msg, struct google_protobuf_UInt32Value* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(76, 152), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_OutlierDetection_mutable_failure_percentage_request_volume(envoy_config_cluster_v3_OutlierDetection *msg, upb_arena *arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_cluster_v3_OutlierDetection_failure_percentage_request_volume(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_OutlierDetection_set_failure_percentage_request_volume(msg, sub);
+ }
+ return sub;
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_CONFIG_CLUSTER_V3_OUTLIER_DETECTION_PROTO_UPB_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.c
index 870ccfffc51..d381efa2270 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.c
@@ -1,124 +1,124 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/config/core/v3/address.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include <stddef.h>
-#include "upb/msg.h"
-#include "envoy/config/core/v3/address.upb.h"
-#include "envoy/config/core/v3/socket_option.upb.h"
-#include "google/protobuf/wrappers.upb.h"
-#include "udpa/annotations/status.upb.h"
-#include "udpa/annotations/versioning.upb.h"
-#include "validate/validate.upb.h"
-
-#include "upb/port_def.inc"
-
-static const upb_msglayout_field envoy_config_core_v3_Pipe__fields[2] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(0, 0), 0, 0, 13, 1},
-};
-
-const upb_msglayout envoy_config_core_v3_Pipe_msginit = {
- NULL,
- &envoy_config_core_v3_Pipe__fields[0],
- UPB_SIZE(16, 32), 2, false,
-};
-
-static const upb_msglayout_field envoy_config_core_v3_EnvoyInternalAddress__fields[1] = {
- {1, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 9, 1},
-};
-
-const upb_msglayout envoy_config_core_v3_EnvoyInternalAddress_msginit = {
- NULL,
- &envoy_config_core_v3_EnvoyInternalAddress__fields[0],
- UPB_SIZE(16, 32), 1, false,
-};
-
-static const upb_msglayout_field envoy_config_core_v3_SocketAddress__fields[6] = {
- {1, UPB_SIZE(0, 0), 0, 0, 14, 1},
- {2, UPB_SIZE(12, 16), 0, 0, 9, 1},
- {3, UPB_SIZE(28, 48), UPB_SIZE(-37, -65), 0, 13, 1},
- {4, UPB_SIZE(28, 48), UPB_SIZE(-37, -65), 0, 9, 1},
- {5, UPB_SIZE(20, 32), 0, 0, 9, 1},
- {6, UPB_SIZE(8, 8), 0, 0, 8, 1},
-};
-
-const upb_msglayout envoy_config_core_v3_SocketAddress_msginit = {
- NULL,
- &envoy_config_core_v3_SocketAddress__fields[0],
- UPB_SIZE(40, 80), 6, false,
-};
-
-static const upb_msglayout *const envoy_config_core_v3_TcpKeepalive_submsgs[3] = {
- &google_protobuf_UInt32Value_msginit,
-};
-
-static const upb_msglayout_field envoy_config_core_v3_TcpKeepalive__fields[3] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
- {2, UPB_SIZE(4, 8), 0, 0, 11, 1},
- {3, UPB_SIZE(8, 16), 0, 0, 11, 1},
-};
-
-const upb_msglayout envoy_config_core_v3_TcpKeepalive_msginit = {
- &envoy_config_core_v3_TcpKeepalive_submsgs[0],
- &envoy_config_core_v3_TcpKeepalive__fields[0],
- UPB_SIZE(12, 24), 3, false,
-};
-
-static const upb_msglayout *const envoy_config_core_v3_BindConfig_submsgs[3] = {
- &envoy_config_core_v3_SocketAddress_msginit,
- &envoy_config_core_v3_SocketOption_msginit,
- &google_protobuf_BoolValue_msginit,
-};
-
-static const upb_msglayout_field envoy_config_core_v3_BindConfig__fields[3] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
- {2, UPB_SIZE(4, 8), 0, 2, 11, 1},
- {3, UPB_SIZE(8, 16), 0, 1, 11, 3},
-};
-
-const upb_msglayout envoy_config_core_v3_BindConfig_msginit = {
- &envoy_config_core_v3_BindConfig_submsgs[0],
- &envoy_config_core_v3_BindConfig__fields[0],
- UPB_SIZE(12, 24), 3, false,
-};
-
-static const upb_msglayout *const envoy_config_core_v3_Address_submsgs[3] = {
- &envoy_config_core_v3_EnvoyInternalAddress_msginit,
- &envoy_config_core_v3_Pipe_msginit,
- &envoy_config_core_v3_SocketAddress_msginit,
-};
-
-static const upb_msglayout_field envoy_config_core_v3_Address__fields[3] = {
- {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 2, 11, 1},
- {2, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 1, 11, 1},
- {3, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, 1},
-};
-
-const upb_msglayout envoy_config_core_v3_Address_msginit = {
- &envoy_config_core_v3_Address_submsgs[0],
- &envoy_config_core_v3_Address__fields[0],
- UPB_SIZE(8, 16), 3, false,
-};
-
-static const upb_msglayout *const envoy_config_core_v3_CidrRange_submsgs[1] = {
- &google_protobuf_UInt32Value_msginit,
-};
-
-static const upb_msglayout_field envoy_config_core_v3_CidrRange__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 11, 1},
-};
-
-const upb_msglayout envoy_config_core_v3_CidrRange_msginit = {
- &envoy_config_core_v3_CidrRange_submsgs[0],
- &envoy_config_core_v3_CidrRange__fields[0],
- UPB_SIZE(16, 32), 2, false,
-};
-
-#include "upb/port_undef.inc"
-
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/core/v3/address.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg.h"
+#include "envoy/config/core/v3/address.upb.h"
+#include "envoy/config/core/v3/socket_option.upb.h"
+#include "google/protobuf/wrappers.upb.h"
+#include "udpa/annotations/status.upb.h"
+#include "udpa/annotations/versioning.upb.h"
+#include "validate/validate.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_msglayout_field envoy_config_core_v3_Pipe__fields[2] = {
+ {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
+ {2, UPB_SIZE(0, 0), 0, 0, 13, 1},
+};
+
+const upb_msglayout envoy_config_core_v3_Pipe_msginit = {
+ NULL,
+ &envoy_config_core_v3_Pipe__fields[0],
+ UPB_SIZE(16, 32), 2, false,
+};
+
+static const upb_msglayout_field envoy_config_core_v3_EnvoyInternalAddress__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 9, 1},
+};
+
+const upb_msglayout envoy_config_core_v3_EnvoyInternalAddress_msginit = {
+ NULL,
+ &envoy_config_core_v3_EnvoyInternalAddress__fields[0],
+ UPB_SIZE(16, 32), 1, false,
+};
+
+static const upb_msglayout_field envoy_config_core_v3_SocketAddress__fields[6] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 14, 1},
+ {2, UPB_SIZE(12, 16), 0, 0, 9, 1},
+ {3, UPB_SIZE(28, 48), UPB_SIZE(-37, -65), 0, 13, 1},
+ {4, UPB_SIZE(28, 48), UPB_SIZE(-37, -65), 0, 9, 1},
+ {5, UPB_SIZE(20, 32), 0, 0, 9, 1},
+ {6, UPB_SIZE(8, 8), 0, 0, 8, 1},
+};
+
+const upb_msglayout envoy_config_core_v3_SocketAddress_msginit = {
+ NULL,
+ &envoy_config_core_v3_SocketAddress__fields[0],
+ UPB_SIZE(40, 80), 6, false,
+};
+
+static const upb_msglayout *const envoy_config_core_v3_TcpKeepalive_submsgs[3] = {
+ &google_protobuf_UInt32Value_msginit,
+};
+
+static const upb_msglayout_field envoy_config_core_v3_TcpKeepalive__fields[3] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
+ {2, UPB_SIZE(4, 8), 0, 0, 11, 1},
+ {3, UPB_SIZE(8, 16), 0, 0, 11, 1},
+};
+
+const upb_msglayout envoy_config_core_v3_TcpKeepalive_msginit = {
+ &envoy_config_core_v3_TcpKeepalive_submsgs[0],
+ &envoy_config_core_v3_TcpKeepalive__fields[0],
+ UPB_SIZE(12, 24), 3, false,
+};
+
+static const upb_msglayout *const envoy_config_core_v3_BindConfig_submsgs[3] = {
+ &envoy_config_core_v3_SocketAddress_msginit,
+ &envoy_config_core_v3_SocketOption_msginit,
+ &google_protobuf_BoolValue_msginit,
+};
+
+static const upb_msglayout_field envoy_config_core_v3_BindConfig__fields[3] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
+ {2, UPB_SIZE(4, 8), 0, 2, 11, 1},
+ {3, UPB_SIZE(8, 16), 0, 1, 11, 3},
+};
+
+const upb_msglayout envoy_config_core_v3_BindConfig_msginit = {
+ &envoy_config_core_v3_BindConfig_submsgs[0],
+ &envoy_config_core_v3_BindConfig__fields[0],
+ UPB_SIZE(12, 24), 3, false,
+};
+
+static const upb_msglayout *const envoy_config_core_v3_Address_submsgs[3] = {
+ &envoy_config_core_v3_EnvoyInternalAddress_msginit,
+ &envoy_config_core_v3_Pipe_msginit,
+ &envoy_config_core_v3_SocketAddress_msginit,
+};
+
+static const upb_msglayout_field envoy_config_core_v3_Address__fields[3] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 2, 11, 1},
+ {2, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 1, 11, 1},
+ {3, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, 1},
+};
+
+const upb_msglayout envoy_config_core_v3_Address_msginit = {
+ &envoy_config_core_v3_Address_submsgs[0],
+ &envoy_config_core_v3_Address__fields[0],
+ UPB_SIZE(8, 16), 3, false,
+};
+
+static const upb_msglayout *const envoy_config_core_v3_CidrRange_submsgs[1] = {
+ &google_protobuf_UInt32Value_msginit,
+};
+
+static const upb_msglayout_field envoy_config_core_v3_CidrRange__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {2, UPB_SIZE(8, 16), 0, 0, 11, 1},
+};
+
+const upb_msglayout envoy_config_core_v3_CidrRange_msginit = {
+ &envoy_config_core_v3_CidrRange_submsgs[0],
+ &envoy_config_core_v3_CidrRange__fields[0],
+ UPB_SIZE(16, 32), 2, false,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.h
index 1aa7a24743d..e4ccd72a63c 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.h
@@ -1,379 +1,379 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/config/core/v3/address.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef ENVOY_CONFIG_CORE_V3_ADDRESS_PROTO_UPB_H_
-#define ENVOY_CONFIG_CORE_V3_ADDRESS_PROTO_UPB_H_
-
-#include "upb/msg.h"
-#include "upb/decode.h"
-#include "upb/encode.h"
-
-#include "upb/port_def.inc"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct envoy_config_core_v3_Pipe;
-struct envoy_config_core_v3_EnvoyInternalAddress;
-struct envoy_config_core_v3_SocketAddress;
-struct envoy_config_core_v3_TcpKeepalive;
-struct envoy_config_core_v3_BindConfig;
-struct envoy_config_core_v3_Address;
-struct envoy_config_core_v3_CidrRange;
-typedef struct envoy_config_core_v3_Pipe envoy_config_core_v3_Pipe;
-typedef struct envoy_config_core_v3_EnvoyInternalAddress envoy_config_core_v3_EnvoyInternalAddress;
-typedef struct envoy_config_core_v3_SocketAddress envoy_config_core_v3_SocketAddress;
-typedef struct envoy_config_core_v3_TcpKeepalive envoy_config_core_v3_TcpKeepalive;
-typedef struct envoy_config_core_v3_BindConfig envoy_config_core_v3_BindConfig;
-typedef struct envoy_config_core_v3_Address envoy_config_core_v3_Address;
-typedef struct envoy_config_core_v3_CidrRange envoy_config_core_v3_CidrRange;
-extern const upb_msglayout envoy_config_core_v3_Pipe_msginit;
-extern const upb_msglayout envoy_config_core_v3_EnvoyInternalAddress_msginit;
-extern const upb_msglayout envoy_config_core_v3_SocketAddress_msginit;
-extern const upb_msglayout envoy_config_core_v3_TcpKeepalive_msginit;
-extern const upb_msglayout envoy_config_core_v3_BindConfig_msginit;
-extern const upb_msglayout envoy_config_core_v3_Address_msginit;
-extern const upb_msglayout envoy_config_core_v3_CidrRange_msginit;
-struct envoy_config_core_v3_SocketOption;
-struct google_protobuf_BoolValue;
-struct google_protobuf_UInt32Value;
-extern const upb_msglayout envoy_config_core_v3_SocketOption_msginit;
-extern const upb_msglayout google_protobuf_BoolValue_msginit;
-extern const upb_msglayout google_protobuf_UInt32Value_msginit;
-
-typedef enum {
- envoy_config_core_v3_SocketAddress_TCP = 0,
- envoy_config_core_v3_SocketAddress_UDP = 1
-} envoy_config_core_v3_SocketAddress_Protocol;
-
-
-/* envoy.config.core.v3.Pipe */
-
-UPB_INLINE envoy_config_core_v3_Pipe *envoy_config_core_v3_Pipe_new(upb_arena *arena) {
- return (envoy_config_core_v3_Pipe *)_upb_msg_new(&envoy_config_core_v3_Pipe_msginit, arena);
-}
-UPB_INLINE envoy_config_core_v3_Pipe *envoy_config_core_v3_Pipe_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_core_v3_Pipe *ret = envoy_config_core_v3_Pipe_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_Pipe_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_core_v3_Pipe_serialize(const envoy_config_core_v3_Pipe *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_core_v3_Pipe_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview envoy_config_core_v3_Pipe_path(const envoy_config_core_v3_Pipe *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
-UPB_INLINE uint32_t envoy_config_core_v3_Pipe_mode(const envoy_config_core_v3_Pipe *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t); }
-
-UPB_INLINE void envoy_config_core_v3_Pipe_set_path(envoy_config_core_v3_Pipe *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_core_v3_Pipe_set_mode(envoy_config_core_v3_Pipe *msg, uint32_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t) = value;
-}
-
-/* envoy.config.core.v3.EnvoyInternalAddress */
-
-UPB_INLINE envoy_config_core_v3_EnvoyInternalAddress *envoy_config_core_v3_EnvoyInternalAddress_new(upb_arena *arena) {
- return (envoy_config_core_v3_EnvoyInternalAddress *)_upb_msg_new(&envoy_config_core_v3_EnvoyInternalAddress_msginit, arena);
-}
-UPB_INLINE envoy_config_core_v3_EnvoyInternalAddress *envoy_config_core_v3_EnvoyInternalAddress_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_core_v3_EnvoyInternalAddress *ret = envoy_config_core_v3_EnvoyInternalAddress_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_EnvoyInternalAddress_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_core_v3_EnvoyInternalAddress_serialize(const envoy_config_core_v3_EnvoyInternalAddress *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_core_v3_EnvoyInternalAddress_msginit, arena, len);
-}
-
-typedef enum {
- envoy_config_core_v3_EnvoyInternalAddress_address_name_specifier_server_listener_name = 1,
- envoy_config_core_v3_EnvoyInternalAddress_address_name_specifier_NOT_SET = 0
-} envoy_config_core_v3_EnvoyInternalAddress_address_name_specifier_oneofcases;
-UPB_INLINE envoy_config_core_v3_EnvoyInternalAddress_address_name_specifier_oneofcases envoy_config_core_v3_EnvoyInternalAddress_address_name_specifier_case(const envoy_config_core_v3_EnvoyInternalAddress* msg) { return (envoy_config_core_v3_EnvoyInternalAddress_address_name_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(8, 16), int32_t); }
-
-UPB_INLINE bool envoy_config_core_v3_EnvoyInternalAddress_has_server_listener_name(const envoy_config_core_v3_EnvoyInternalAddress *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 1; }
-UPB_INLINE upb_strview envoy_config_core_v3_EnvoyInternalAddress_server_listener_name(const envoy_config_core_v3_EnvoyInternalAddress *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 1, upb_strview_make("", strlen(""))); }
-
-UPB_INLINE void envoy_config_core_v3_EnvoyInternalAddress_set_server_listener_name(envoy_config_core_v3_EnvoyInternalAddress *msg, upb_strview value) {
- UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 1);
-}
-
-/* envoy.config.core.v3.SocketAddress */
-
-UPB_INLINE envoy_config_core_v3_SocketAddress *envoy_config_core_v3_SocketAddress_new(upb_arena *arena) {
- return (envoy_config_core_v3_SocketAddress *)_upb_msg_new(&envoy_config_core_v3_SocketAddress_msginit, arena);
-}
-UPB_INLINE envoy_config_core_v3_SocketAddress *envoy_config_core_v3_SocketAddress_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_core_v3_SocketAddress *ret = envoy_config_core_v3_SocketAddress_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_SocketAddress_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_core_v3_SocketAddress_serialize(const envoy_config_core_v3_SocketAddress *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_core_v3_SocketAddress_msginit, arena, len);
-}
-
-typedef enum {
- envoy_config_core_v3_SocketAddress_port_specifier_port_value = 3,
- envoy_config_core_v3_SocketAddress_port_specifier_named_port = 4,
- envoy_config_core_v3_SocketAddress_port_specifier_NOT_SET = 0
-} envoy_config_core_v3_SocketAddress_port_specifier_oneofcases;
-UPB_INLINE envoy_config_core_v3_SocketAddress_port_specifier_oneofcases envoy_config_core_v3_SocketAddress_port_specifier_case(const envoy_config_core_v3_SocketAddress* msg) { return (envoy_config_core_v3_SocketAddress_port_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(36, 64), int32_t); }
-
-UPB_INLINE int32_t envoy_config_core_v3_SocketAddress_protocol(const envoy_config_core_v3_SocketAddress *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
-UPB_INLINE upb_strview envoy_config_core_v3_SocketAddress_address(const envoy_config_core_v3_SocketAddress *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 16), upb_strview); }
-UPB_INLINE bool envoy_config_core_v3_SocketAddress_has_port_value(const envoy_config_core_v3_SocketAddress *msg) { return _upb_getoneofcase(msg, UPB_SIZE(36, 64)) == 3; }
-UPB_INLINE uint32_t envoy_config_core_v3_SocketAddress_port_value(const envoy_config_core_v3_SocketAddress *msg) { return UPB_READ_ONEOF(msg, uint32_t, UPB_SIZE(28, 48), UPB_SIZE(36, 64), 3, 0); }
-UPB_INLINE bool envoy_config_core_v3_SocketAddress_has_named_port(const envoy_config_core_v3_SocketAddress *msg) { return _upb_getoneofcase(msg, UPB_SIZE(36, 64)) == 4; }
-UPB_INLINE upb_strview envoy_config_core_v3_SocketAddress_named_port(const envoy_config_core_v3_SocketAddress *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(28, 48), UPB_SIZE(36, 64), 4, upb_strview_make("", strlen(""))); }
-UPB_INLINE upb_strview envoy_config_core_v3_SocketAddress_resolver_name(const envoy_config_core_v3_SocketAddress *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 32), upb_strview); }
-UPB_INLINE bool envoy_config_core_v3_SocketAddress_ipv4_compat(const envoy_config_core_v3_SocketAddress *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool); }
-
-UPB_INLINE void envoy_config_core_v3_SocketAddress_set_protocol(envoy_config_core_v3_SocketAddress *msg, int32_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
-}
-UPB_INLINE void envoy_config_core_v3_SocketAddress_set_address(envoy_config_core_v3_SocketAddress *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(12, 16), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_core_v3_SocketAddress_set_port_value(envoy_config_core_v3_SocketAddress *msg, uint32_t value) {
- UPB_WRITE_ONEOF(msg, uint32_t, UPB_SIZE(28, 48), value, UPB_SIZE(36, 64), 3);
-}
-UPB_INLINE void envoy_config_core_v3_SocketAddress_set_named_port(envoy_config_core_v3_SocketAddress *msg, upb_strview value) {
- UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(28, 48), value, UPB_SIZE(36, 64), 4);
-}
-UPB_INLINE void envoy_config_core_v3_SocketAddress_set_resolver_name(envoy_config_core_v3_SocketAddress *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(20, 32), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_core_v3_SocketAddress_set_ipv4_compat(envoy_config_core_v3_SocketAddress *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = value;
-}
-
-/* envoy.config.core.v3.TcpKeepalive */
-
-UPB_INLINE envoy_config_core_v3_TcpKeepalive *envoy_config_core_v3_TcpKeepalive_new(upb_arena *arena) {
- return (envoy_config_core_v3_TcpKeepalive *)_upb_msg_new(&envoy_config_core_v3_TcpKeepalive_msginit, arena);
-}
-UPB_INLINE envoy_config_core_v3_TcpKeepalive *envoy_config_core_v3_TcpKeepalive_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_core_v3_TcpKeepalive *ret = envoy_config_core_v3_TcpKeepalive_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_TcpKeepalive_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_core_v3_TcpKeepalive_serialize(const envoy_config_core_v3_TcpKeepalive *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_core_v3_TcpKeepalive_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_config_core_v3_TcpKeepalive_has_keepalive_probes(const envoy_config_core_v3_TcpKeepalive *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_core_v3_TcpKeepalive_keepalive_probes(const envoy_config_core_v3_TcpKeepalive *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct google_protobuf_UInt32Value*); }
-UPB_INLINE bool envoy_config_core_v3_TcpKeepalive_has_keepalive_time(const envoy_config_core_v3_TcpKeepalive *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
-UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_core_v3_TcpKeepalive_keepalive_time(const envoy_config_core_v3_TcpKeepalive *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_UInt32Value*); }
-UPB_INLINE bool envoy_config_core_v3_TcpKeepalive_has_keepalive_interval(const envoy_config_core_v3_TcpKeepalive *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_core_v3_TcpKeepalive_keepalive_interval(const envoy_config_core_v3_TcpKeepalive *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_UInt32Value*); }
-
-UPB_INLINE void envoy_config_core_v3_TcpKeepalive_set_keepalive_probes(envoy_config_core_v3_TcpKeepalive *msg, struct google_protobuf_UInt32Value* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct google_protobuf_UInt32Value*) = value;
-}
-UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_TcpKeepalive_mutable_keepalive_probes(envoy_config_core_v3_TcpKeepalive *msg, upb_arena *arena) {
- struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_core_v3_TcpKeepalive_keepalive_probes(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_TcpKeepalive_set_keepalive_probes(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_core_v3_TcpKeepalive_set_keepalive_time(envoy_config_core_v3_TcpKeepalive *msg, struct google_protobuf_UInt32Value* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_UInt32Value*) = value;
-}
-UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_TcpKeepalive_mutable_keepalive_time(envoy_config_core_v3_TcpKeepalive *msg, upb_arena *arena) {
- struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_core_v3_TcpKeepalive_keepalive_time(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_TcpKeepalive_set_keepalive_time(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_core_v3_TcpKeepalive_set_keepalive_interval(envoy_config_core_v3_TcpKeepalive *msg, struct google_protobuf_UInt32Value* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_UInt32Value*) = value;
-}
-UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_TcpKeepalive_mutable_keepalive_interval(envoy_config_core_v3_TcpKeepalive *msg, upb_arena *arena) {
- struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_core_v3_TcpKeepalive_keepalive_interval(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_TcpKeepalive_set_keepalive_interval(msg, sub);
- }
- return sub;
-}
-
-/* envoy.config.core.v3.BindConfig */
-
-UPB_INLINE envoy_config_core_v3_BindConfig *envoy_config_core_v3_BindConfig_new(upb_arena *arena) {
- return (envoy_config_core_v3_BindConfig *)_upb_msg_new(&envoy_config_core_v3_BindConfig_msginit, arena);
-}
-UPB_INLINE envoy_config_core_v3_BindConfig *envoy_config_core_v3_BindConfig_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_core_v3_BindConfig *ret = envoy_config_core_v3_BindConfig_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_BindConfig_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_core_v3_BindConfig_serialize(const envoy_config_core_v3_BindConfig *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_core_v3_BindConfig_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_config_core_v3_BindConfig_has_source_address(const envoy_config_core_v3_BindConfig *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE const envoy_config_core_v3_SocketAddress* envoy_config_core_v3_BindConfig_source_address(const envoy_config_core_v3_BindConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const envoy_config_core_v3_SocketAddress*); }
-UPB_INLINE bool envoy_config_core_v3_BindConfig_has_freebind(const envoy_config_core_v3_BindConfig *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
-UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_core_v3_BindConfig_freebind(const envoy_config_core_v3_BindConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_BoolValue*); }
-UPB_INLINE bool envoy_config_core_v3_BindConfig_has_socket_options(const envoy_config_core_v3_BindConfig *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const struct envoy_config_core_v3_SocketOption* const* envoy_config_core_v3_BindConfig_socket_options(const envoy_config_core_v3_BindConfig *msg, size_t *len) { return (const struct envoy_config_core_v3_SocketOption* const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len); }
-
-UPB_INLINE void envoy_config_core_v3_BindConfig_set_source_address(envoy_config_core_v3_BindConfig *msg, envoy_config_core_v3_SocketAddress* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), envoy_config_core_v3_SocketAddress*) = value;
-}
-UPB_INLINE struct envoy_config_core_v3_SocketAddress* envoy_config_core_v3_BindConfig_mutable_source_address(envoy_config_core_v3_BindConfig *msg, upb_arena *arena) {
- struct envoy_config_core_v3_SocketAddress* sub = (struct envoy_config_core_v3_SocketAddress*)envoy_config_core_v3_BindConfig_source_address(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_SocketAddress*)_upb_msg_new(&envoy_config_core_v3_SocketAddress_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_BindConfig_set_source_address(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_core_v3_BindConfig_set_freebind(envoy_config_core_v3_BindConfig *msg, struct google_protobuf_BoolValue* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_BoolValue*) = value;
-}
-UPB_INLINE struct google_protobuf_BoolValue* envoy_config_core_v3_BindConfig_mutable_freebind(envoy_config_core_v3_BindConfig *msg, upb_arena *arena) {
- struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_core_v3_BindConfig_freebind(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_BoolValue*)_upb_msg_new(&google_protobuf_BoolValue_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_BindConfig_set_freebind(msg, sub);
- }
- return sub;
-}
-UPB_INLINE struct envoy_config_core_v3_SocketOption** envoy_config_core_v3_BindConfig_mutable_socket_options(envoy_config_core_v3_BindConfig *msg, size_t *len) {
- return (struct envoy_config_core_v3_SocketOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len);
-}
-UPB_INLINE struct envoy_config_core_v3_SocketOption** envoy_config_core_v3_BindConfig_resize_socket_options(envoy_config_core_v3_BindConfig *msg, size_t len, upb_arena *arena) {
- return (struct envoy_config_core_v3_SocketOption**)_upb_array_resize_accessor(msg, UPB_SIZE(8, 16), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_config_core_v3_SocketOption* envoy_config_core_v3_BindConfig_add_socket_options(envoy_config_core_v3_BindConfig *msg, upb_arena *arena) {
- struct envoy_config_core_v3_SocketOption* sub = (struct envoy_config_core_v3_SocketOption*)_upb_msg_new(&envoy_config_core_v3_SocketOption_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(8, 16), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-
-/* envoy.config.core.v3.Address */
-
-UPB_INLINE envoy_config_core_v3_Address *envoy_config_core_v3_Address_new(upb_arena *arena) {
- return (envoy_config_core_v3_Address *)_upb_msg_new(&envoy_config_core_v3_Address_msginit, arena);
-}
-UPB_INLINE envoy_config_core_v3_Address *envoy_config_core_v3_Address_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_core_v3_Address *ret = envoy_config_core_v3_Address_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_Address_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_core_v3_Address_serialize(const envoy_config_core_v3_Address *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_core_v3_Address_msginit, arena, len);
-}
-
-typedef enum {
- envoy_config_core_v3_Address_address_socket_address = 1,
- envoy_config_core_v3_Address_address_pipe = 2,
- envoy_config_core_v3_Address_address_envoy_internal_address = 3,
- envoy_config_core_v3_Address_address_NOT_SET = 0
-} envoy_config_core_v3_Address_address_oneofcases;
-UPB_INLINE envoy_config_core_v3_Address_address_oneofcases envoy_config_core_v3_Address_address_case(const envoy_config_core_v3_Address* msg) { return (envoy_config_core_v3_Address_address_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 8), int32_t); }
-
-UPB_INLINE bool envoy_config_core_v3_Address_has_socket_address(const envoy_config_core_v3_Address *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 1; }
-UPB_INLINE const envoy_config_core_v3_SocketAddress* envoy_config_core_v3_Address_socket_address(const envoy_config_core_v3_Address *msg) { return UPB_READ_ONEOF(msg, const envoy_config_core_v3_SocketAddress*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 1, NULL); }
-UPB_INLINE bool envoy_config_core_v3_Address_has_pipe(const envoy_config_core_v3_Address *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 2; }
-UPB_INLINE const envoy_config_core_v3_Pipe* envoy_config_core_v3_Address_pipe(const envoy_config_core_v3_Address *msg) { return UPB_READ_ONEOF(msg, const envoy_config_core_v3_Pipe*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 2, NULL); }
-UPB_INLINE bool envoy_config_core_v3_Address_has_envoy_internal_address(const envoy_config_core_v3_Address *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 3; }
-UPB_INLINE const envoy_config_core_v3_EnvoyInternalAddress* envoy_config_core_v3_Address_envoy_internal_address(const envoy_config_core_v3_Address *msg) { return UPB_READ_ONEOF(msg, const envoy_config_core_v3_EnvoyInternalAddress*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 3, NULL); }
-
-UPB_INLINE void envoy_config_core_v3_Address_set_socket_address(envoy_config_core_v3_Address *msg, envoy_config_core_v3_SocketAddress* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_core_v3_SocketAddress*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 1);
-}
-UPB_INLINE struct envoy_config_core_v3_SocketAddress* envoy_config_core_v3_Address_mutable_socket_address(envoy_config_core_v3_Address *msg, upb_arena *arena) {
- struct envoy_config_core_v3_SocketAddress* sub = (struct envoy_config_core_v3_SocketAddress*)envoy_config_core_v3_Address_socket_address(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_SocketAddress*)_upb_msg_new(&envoy_config_core_v3_SocketAddress_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_Address_set_socket_address(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_core_v3_Address_set_pipe(envoy_config_core_v3_Address *msg, envoy_config_core_v3_Pipe* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_core_v3_Pipe*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 2);
-}
-UPB_INLINE struct envoy_config_core_v3_Pipe* envoy_config_core_v3_Address_mutable_pipe(envoy_config_core_v3_Address *msg, upb_arena *arena) {
- struct envoy_config_core_v3_Pipe* sub = (struct envoy_config_core_v3_Pipe*)envoy_config_core_v3_Address_pipe(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_Pipe*)_upb_msg_new(&envoy_config_core_v3_Pipe_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_Address_set_pipe(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_core_v3_Address_set_envoy_internal_address(envoy_config_core_v3_Address *msg, envoy_config_core_v3_EnvoyInternalAddress* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_core_v3_EnvoyInternalAddress*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 3);
-}
-UPB_INLINE struct envoy_config_core_v3_EnvoyInternalAddress* envoy_config_core_v3_Address_mutable_envoy_internal_address(envoy_config_core_v3_Address *msg, upb_arena *arena) {
- struct envoy_config_core_v3_EnvoyInternalAddress* sub = (struct envoy_config_core_v3_EnvoyInternalAddress*)envoy_config_core_v3_Address_envoy_internal_address(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_EnvoyInternalAddress*)_upb_msg_new(&envoy_config_core_v3_EnvoyInternalAddress_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_Address_set_envoy_internal_address(msg, sub);
- }
- return sub;
-}
-
-/* envoy.config.core.v3.CidrRange */
-
-UPB_INLINE envoy_config_core_v3_CidrRange *envoy_config_core_v3_CidrRange_new(upb_arena *arena) {
- return (envoy_config_core_v3_CidrRange *)_upb_msg_new(&envoy_config_core_v3_CidrRange_msginit, arena);
-}
-UPB_INLINE envoy_config_core_v3_CidrRange *envoy_config_core_v3_CidrRange_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_core_v3_CidrRange *ret = envoy_config_core_v3_CidrRange_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_CidrRange_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_core_v3_CidrRange_serialize(const envoy_config_core_v3_CidrRange *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_core_v3_CidrRange_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview envoy_config_core_v3_CidrRange_address_prefix(const envoy_config_core_v3_CidrRange *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE bool envoy_config_core_v3_CidrRange_has_prefix_len(const envoy_config_core_v3_CidrRange *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_core_v3_CidrRange_prefix_len(const envoy_config_core_v3_CidrRange *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_UInt32Value*); }
-
-UPB_INLINE void envoy_config_core_v3_CidrRange_set_address_prefix(envoy_config_core_v3_CidrRange *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_core_v3_CidrRange_set_prefix_len(envoy_config_core_v3_CidrRange *msg, struct google_protobuf_UInt32Value* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_UInt32Value*) = value;
-}
-UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_CidrRange_mutable_prefix_len(envoy_config_core_v3_CidrRange *msg, upb_arena *arena) {
- struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_core_v3_CidrRange_prefix_len(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_CidrRange_set_prefix_len(msg, sub);
- }
- return sub;
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* ENVOY_CONFIG_CORE_V3_ADDRESS_PROTO_UPB_H_ */
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/core/v3/address.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_CONFIG_CORE_V3_ADDRESS_PROTO_UPB_H_
+#define ENVOY_CONFIG_CORE_V3_ADDRESS_PROTO_UPB_H_
+
+#include "upb/msg.h"
+#include "upb/decode.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_config_core_v3_Pipe;
+struct envoy_config_core_v3_EnvoyInternalAddress;
+struct envoy_config_core_v3_SocketAddress;
+struct envoy_config_core_v3_TcpKeepalive;
+struct envoy_config_core_v3_BindConfig;
+struct envoy_config_core_v3_Address;
+struct envoy_config_core_v3_CidrRange;
+typedef struct envoy_config_core_v3_Pipe envoy_config_core_v3_Pipe;
+typedef struct envoy_config_core_v3_EnvoyInternalAddress envoy_config_core_v3_EnvoyInternalAddress;
+typedef struct envoy_config_core_v3_SocketAddress envoy_config_core_v3_SocketAddress;
+typedef struct envoy_config_core_v3_TcpKeepalive envoy_config_core_v3_TcpKeepalive;
+typedef struct envoy_config_core_v3_BindConfig envoy_config_core_v3_BindConfig;
+typedef struct envoy_config_core_v3_Address envoy_config_core_v3_Address;
+typedef struct envoy_config_core_v3_CidrRange envoy_config_core_v3_CidrRange;
+extern const upb_msglayout envoy_config_core_v3_Pipe_msginit;
+extern const upb_msglayout envoy_config_core_v3_EnvoyInternalAddress_msginit;
+extern const upb_msglayout envoy_config_core_v3_SocketAddress_msginit;
+extern const upb_msglayout envoy_config_core_v3_TcpKeepalive_msginit;
+extern const upb_msglayout envoy_config_core_v3_BindConfig_msginit;
+extern const upb_msglayout envoy_config_core_v3_Address_msginit;
+extern const upb_msglayout envoy_config_core_v3_CidrRange_msginit;
+struct envoy_config_core_v3_SocketOption;
+struct google_protobuf_BoolValue;
+struct google_protobuf_UInt32Value;
+extern const upb_msglayout envoy_config_core_v3_SocketOption_msginit;
+extern const upb_msglayout google_protobuf_BoolValue_msginit;
+extern const upb_msglayout google_protobuf_UInt32Value_msginit;
+
+typedef enum {
+ envoy_config_core_v3_SocketAddress_TCP = 0,
+ envoy_config_core_v3_SocketAddress_UDP = 1
+} envoy_config_core_v3_SocketAddress_Protocol;
+
+
+/* envoy.config.core.v3.Pipe */
+
+UPB_INLINE envoy_config_core_v3_Pipe *envoy_config_core_v3_Pipe_new(upb_arena *arena) {
+ return (envoy_config_core_v3_Pipe *)_upb_msg_new(&envoy_config_core_v3_Pipe_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_Pipe *envoy_config_core_v3_Pipe_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_core_v3_Pipe *ret = envoy_config_core_v3_Pipe_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_Pipe_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_core_v3_Pipe_serialize(const envoy_config_core_v3_Pipe *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_core_v3_Pipe_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview envoy_config_core_v3_Pipe_path(const envoy_config_core_v3_Pipe *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
+UPB_INLINE uint32_t envoy_config_core_v3_Pipe_mode(const envoy_config_core_v3_Pipe *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t); }
+
+UPB_INLINE void envoy_config_core_v3_Pipe_set_path(envoy_config_core_v3_Pipe *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_core_v3_Pipe_set_mode(envoy_config_core_v3_Pipe *msg, uint32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t) = value;
+}
+
+/* envoy.config.core.v3.EnvoyInternalAddress */
+
+UPB_INLINE envoy_config_core_v3_EnvoyInternalAddress *envoy_config_core_v3_EnvoyInternalAddress_new(upb_arena *arena) {
+ return (envoy_config_core_v3_EnvoyInternalAddress *)_upb_msg_new(&envoy_config_core_v3_EnvoyInternalAddress_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_EnvoyInternalAddress *envoy_config_core_v3_EnvoyInternalAddress_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_core_v3_EnvoyInternalAddress *ret = envoy_config_core_v3_EnvoyInternalAddress_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_EnvoyInternalAddress_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_core_v3_EnvoyInternalAddress_serialize(const envoy_config_core_v3_EnvoyInternalAddress *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_core_v3_EnvoyInternalAddress_msginit, arena, len);
+}
+
+typedef enum {
+ envoy_config_core_v3_EnvoyInternalAddress_address_name_specifier_server_listener_name = 1,
+ envoy_config_core_v3_EnvoyInternalAddress_address_name_specifier_NOT_SET = 0
+} envoy_config_core_v3_EnvoyInternalAddress_address_name_specifier_oneofcases;
+UPB_INLINE envoy_config_core_v3_EnvoyInternalAddress_address_name_specifier_oneofcases envoy_config_core_v3_EnvoyInternalAddress_address_name_specifier_case(const envoy_config_core_v3_EnvoyInternalAddress* msg) { return (envoy_config_core_v3_EnvoyInternalAddress_address_name_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(8, 16), int32_t); }
+
+UPB_INLINE bool envoy_config_core_v3_EnvoyInternalAddress_has_server_listener_name(const envoy_config_core_v3_EnvoyInternalAddress *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 1; }
+UPB_INLINE upb_strview envoy_config_core_v3_EnvoyInternalAddress_server_listener_name(const envoy_config_core_v3_EnvoyInternalAddress *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 1, upb_strview_make("", strlen(""))); }
+
+UPB_INLINE void envoy_config_core_v3_EnvoyInternalAddress_set_server_listener_name(envoy_config_core_v3_EnvoyInternalAddress *msg, upb_strview value) {
+ UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 1);
+}
+
+/* envoy.config.core.v3.SocketAddress */
+
+UPB_INLINE envoy_config_core_v3_SocketAddress *envoy_config_core_v3_SocketAddress_new(upb_arena *arena) {
+ return (envoy_config_core_v3_SocketAddress *)_upb_msg_new(&envoy_config_core_v3_SocketAddress_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_SocketAddress *envoy_config_core_v3_SocketAddress_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_core_v3_SocketAddress *ret = envoy_config_core_v3_SocketAddress_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_SocketAddress_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_core_v3_SocketAddress_serialize(const envoy_config_core_v3_SocketAddress *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_core_v3_SocketAddress_msginit, arena, len);
+}
+
+typedef enum {
+ envoy_config_core_v3_SocketAddress_port_specifier_port_value = 3,
+ envoy_config_core_v3_SocketAddress_port_specifier_named_port = 4,
+ envoy_config_core_v3_SocketAddress_port_specifier_NOT_SET = 0
+} envoy_config_core_v3_SocketAddress_port_specifier_oneofcases;
+UPB_INLINE envoy_config_core_v3_SocketAddress_port_specifier_oneofcases envoy_config_core_v3_SocketAddress_port_specifier_case(const envoy_config_core_v3_SocketAddress* msg) { return (envoy_config_core_v3_SocketAddress_port_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(36, 64), int32_t); }
+
+UPB_INLINE int32_t envoy_config_core_v3_SocketAddress_protocol(const envoy_config_core_v3_SocketAddress *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
+UPB_INLINE upb_strview envoy_config_core_v3_SocketAddress_address(const envoy_config_core_v3_SocketAddress *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 16), upb_strview); }
+UPB_INLINE bool envoy_config_core_v3_SocketAddress_has_port_value(const envoy_config_core_v3_SocketAddress *msg) { return _upb_getoneofcase(msg, UPB_SIZE(36, 64)) == 3; }
+UPB_INLINE uint32_t envoy_config_core_v3_SocketAddress_port_value(const envoy_config_core_v3_SocketAddress *msg) { return UPB_READ_ONEOF(msg, uint32_t, UPB_SIZE(28, 48), UPB_SIZE(36, 64), 3, 0); }
+UPB_INLINE bool envoy_config_core_v3_SocketAddress_has_named_port(const envoy_config_core_v3_SocketAddress *msg) { return _upb_getoneofcase(msg, UPB_SIZE(36, 64)) == 4; }
+UPB_INLINE upb_strview envoy_config_core_v3_SocketAddress_named_port(const envoy_config_core_v3_SocketAddress *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(28, 48), UPB_SIZE(36, 64), 4, upb_strview_make("", strlen(""))); }
+UPB_INLINE upb_strview envoy_config_core_v3_SocketAddress_resolver_name(const envoy_config_core_v3_SocketAddress *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 32), upb_strview); }
+UPB_INLINE bool envoy_config_core_v3_SocketAddress_ipv4_compat(const envoy_config_core_v3_SocketAddress *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool); }
+
+UPB_INLINE void envoy_config_core_v3_SocketAddress_set_protocol(envoy_config_core_v3_SocketAddress *msg, int32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
+}
+UPB_INLINE void envoy_config_core_v3_SocketAddress_set_address(envoy_config_core_v3_SocketAddress *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 16), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_core_v3_SocketAddress_set_port_value(envoy_config_core_v3_SocketAddress *msg, uint32_t value) {
+ UPB_WRITE_ONEOF(msg, uint32_t, UPB_SIZE(28, 48), value, UPB_SIZE(36, 64), 3);
+}
+UPB_INLINE void envoy_config_core_v3_SocketAddress_set_named_port(envoy_config_core_v3_SocketAddress *msg, upb_strview value) {
+ UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(28, 48), value, UPB_SIZE(36, 64), 4);
+}
+UPB_INLINE void envoy_config_core_v3_SocketAddress_set_resolver_name(envoy_config_core_v3_SocketAddress *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 32), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_core_v3_SocketAddress_set_ipv4_compat(envoy_config_core_v3_SocketAddress *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = value;
+}
+
+/* envoy.config.core.v3.TcpKeepalive */
+
+UPB_INLINE envoy_config_core_v3_TcpKeepalive *envoy_config_core_v3_TcpKeepalive_new(upb_arena *arena) {
+ return (envoy_config_core_v3_TcpKeepalive *)_upb_msg_new(&envoy_config_core_v3_TcpKeepalive_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_TcpKeepalive *envoy_config_core_v3_TcpKeepalive_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_core_v3_TcpKeepalive *ret = envoy_config_core_v3_TcpKeepalive_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_TcpKeepalive_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_core_v3_TcpKeepalive_serialize(const envoy_config_core_v3_TcpKeepalive *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_core_v3_TcpKeepalive_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_core_v3_TcpKeepalive_has_keepalive_probes(const envoy_config_core_v3_TcpKeepalive *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_core_v3_TcpKeepalive_keepalive_probes(const envoy_config_core_v3_TcpKeepalive *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct google_protobuf_UInt32Value*); }
+UPB_INLINE bool envoy_config_core_v3_TcpKeepalive_has_keepalive_time(const envoy_config_core_v3_TcpKeepalive *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_core_v3_TcpKeepalive_keepalive_time(const envoy_config_core_v3_TcpKeepalive *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_UInt32Value*); }
+UPB_INLINE bool envoy_config_core_v3_TcpKeepalive_has_keepalive_interval(const envoy_config_core_v3_TcpKeepalive *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_core_v3_TcpKeepalive_keepalive_interval(const envoy_config_core_v3_TcpKeepalive *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_UInt32Value*); }
+
+UPB_INLINE void envoy_config_core_v3_TcpKeepalive_set_keepalive_probes(envoy_config_core_v3_TcpKeepalive *msg, struct google_protobuf_UInt32Value* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_TcpKeepalive_mutable_keepalive_probes(envoy_config_core_v3_TcpKeepalive *msg, upb_arena *arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_core_v3_TcpKeepalive_keepalive_probes(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_TcpKeepalive_set_keepalive_probes(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_TcpKeepalive_set_keepalive_time(envoy_config_core_v3_TcpKeepalive *msg, struct google_protobuf_UInt32Value* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_TcpKeepalive_mutable_keepalive_time(envoy_config_core_v3_TcpKeepalive *msg, upb_arena *arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_core_v3_TcpKeepalive_keepalive_time(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_TcpKeepalive_set_keepalive_time(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_TcpKeepalive_set_keepalive_interval(envoy_config_core_v3_TcpKeepalive *msg, struct google_protobuf_UInt32Value* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_TcpKeepalive_mutable_keepalive_interval(envoy_config_core_v3_TcpKeepalive *msg, upb_arena *arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_core_v3_TcpKeepalive_keepalive_interval(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_TcpKeepalive_set_keepalive_interval(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.core.v3.BindConfig */
+
+UPB_INLINE envoy_config_core_v3_BindConfig *envoy_config_core_v3_BindConfig_new(upb_arena *arena) {
+ return (envoy_config_core_v3_BindConfig *)_upb_msg_new(&envoy_config_core_v3_BindConfig_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_BindConfig *envoy_config_core_v3_BindConfig_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_core_v3_BindConfig *ret = envoy_config_core_v3_BindConfig_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_BindConfig_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_core_v3_BindConfig_serialize(const envoy_config_core_v3_BindConfig *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_core_v3_BindConfig_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_core_v3_BindConfig_has_source_address(const envoy_config_core_v3_BindConfig *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE const envoy_config_core_v3_SocketAddress* envoy_config_core_v3_BindConfig_source_address(const envoy_config_core_v3_BindConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const envoy_config_core_v3_SocketAddress*); }
+UPB_INLINE bool envoy_config_core_v3_BindConfig_has_freebind(const envoy_config_core_v3_BindConfig *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
+UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_core_v3_BindConfig_freebind(const envoy_config_core_v3_BindConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_BoolValue*); }
+UPB_INLINE bool envoy_config_core_v3_BindConfig_has_socket_options(const envoy_config_core_v3_BindConfig *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
+UPB_INLINE const struct envoy_config_core_v3_SocketOption* const* envoy_config_core_v3_BindConfig_socket_options(const envoy_config_core_v3_BindConfig *msg, size_t *len) { return (const struct envoy_config_core_v3_SocketOption* const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len); }
+
+UPB_INLINE void envoy_config_core_v3_BindConfig_set_source_address(envoy_config_core_v3_BindConfig *msg, envoy_config_core_v3_SocketAddress* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), envoy_config_core_v3_SocketAddress*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_SocketAddress* envoy_config_core_v3_BindConfig_mutable_source_address(envoy_config_core_v3_BindConfig *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_SocketAddress* sub = (struct envoy_config_core_v3_SocketAddress*)envoy_config_core_v3_BindConfig_source_address(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_SocketAddress*)_upb_msg_new(&envoy_config_core_v3_SocketAddress_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_BindConfig_set_source_address(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_BindConfig_set_freebind(envoy_config_core_v3_BindConfig *msg, struct google_protobuf_BoolValue* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_BoolValue*) = value;
+}
+UPB_INLINE struct google_protobuf_BoolValue* envoy_config_core_v3_BindConfig_mutable_freebind(envoy_config_core_v3_BindConfig *msg, upb_arena *arena) {
+ struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_core_v3_BindConfig_freebind(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_BoolValue*)_upb_msg_new(&google_protobuf_BoolValue_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_BindConfig_set_freebind(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE struct envoy_config_core_v3_SocketOption** envoy_config_core_v3_BindConfig_mutable_socket_options(envoy_config_core_v3_BindConfig *msg, size_t *len) {
+ return (struct envoy_config_core_v3_SocketOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len);
+}
+UPB_INLINE struct envoy_config_core_v3_SocketOption** envoy_config_core_v3_BindConfig_resize_socket_options(envoy_config_core_v3_BindConfig *msg, size_t len, upb_arena *arena) {
+ return (struct envoy_config_core_v3_SocketOption**)_upb_array_resize_accessor(msg, UPB_SIZE(8, 16), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_config_core_v3_SocketOption* envoy_config_core_v3_BindConfig_add_socket_options(envoy_config_core_v3_BindConfig *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_SocketOption* sub = (struct envoy_config_core_v3_SocketOption*)_upb_msg_new(&envoy_config_core_v3_SocketOption_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(8, 16), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+
+/* envoy.config.core.v3.Address */
+
+UPB_INLINE envoy_config_core_v3_Address *envoy_config_core_v3_Address_new(upb_arena *arena) {
+ return (envoy_config_core_v3_Address *)_upb_msg_new(&envoy_config_core_v3_Address_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_Address *envoy_config_core_v3_Address_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_core_v3_Address *ret = envoy_config_core_v3_Address_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_Address_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_core_v3_Address_serialize(const envoy_config_core_v3_Address *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_core_v3_Address_msginit, arena, len);
+}
+
+typedef enum {
+ envoy_config_core_v3_Address_address_socket_address = 1,
+ envoy_config_core_v3_Address_address_pipe = 2,
+ envoy_config_core_v3_Address_address_envoy_internal_address = 3,
+ envoy_config_core_v3_Address_address_NOT_SET = 0
+} envoy_config_core_v3_Address_address_oneofcases;
+UPB_INLINE envoy_config_core_v3_Address_address_oneofcases envoy_config_core_v3_Address_address_case(const envoy_config_core_v3_Address* msg) { return (envoy_config_core_v3_Address_address_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 8), int32_t); }
+
+UPB_INLINE bool envoy_config_core_v3_Address_has_socket_address(const envoy_config_core_v3_Address *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 1; }
+UPB_INLINE const envoy_config_core_v3_SocketAddress* envoy_config_core_v3_Address_socket_address(const envoy_config_core_v3_Address *msg) { return UPB_READ_ONEOF(msg, const envoy_config_core_v3_SocketAddress*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 1, NULL); }
+UPB_INLINE bool envoy_config_core_v3_Address_has_pipe(const envoy_config_core_v3_Address *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 2; }
+UPB_INLINE const envoy_config_core_v3_Pipe* envoy_config_core_v3_Address_pipe(const envoy_config_core_v3_Address *msg) { return UPB_READ_ONEOF(msg, const envoy_config_core_v3_Pipe*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 2, NULL); }
+UPB_INLINE bool envoy_config_core_v3_Address_has_envoy_internal_address(const envoy_config_core_v3_Address *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 3; }
+UPB_INLINE const envoy_config_core_v3_EnvoyInternalAddress* envoy_config_core_v3_Address_envoy_internal_address(const envoy_config_core_v3_Address *msg) { return UPB_READ_ONEOF(msg, const envoy_config_core_v3_EnvoyInternalAddress*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 3, NULL); }
+
+UPB_INLINE void envoy_config_core_v3_Address_set_socket_address(envoy_config_core_v3_Address *msg, envoy_config_core_v3_SocketAddress* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_core_v3_SocketAddress*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 1);
+}
+UPB_INLINE struct envoy_config_core_v3_SocketAddress* envoy_config_core_v3_Address_mutable_socket_address(envoy_config_core_v3_Address *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_SocketAddress* sub = (struct envoy_config_core_v3_SocketAddress*)envoy_config_core_v3_Address_socket_address(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_SocketAddress*)_upb_msg_new(&envoy_config_core_v3_SocketAddress_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_Address_set_socket_address(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_Address_set_pipe(envoy_config_core_v3_Address *msg, envoy_config_core_v3_Pipe* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_core_v3_Pipe*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 2);
+}
+UPB_INLINE struct envoy_config_core_v3_Pipe* envoy_config_core_v3_Address_mutable_pipe(envoy_config_core_v3_Address *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_Pipe* sub = (struct envoy_config_core_v3_Pipe*)envoy_config_core_v3_Address_pipe(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_Pipe*)_upb_msg_new(&envoy_config_core_v3_Pipe_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_Address_set_pipe(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_Address_set_envoy_internal_address(envoy_config_core_v3_Address *msg, envoy_config_core_v3_EnvoyInternalAddress* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_core_v3_EnvoyInternalAddress*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 3);
+}
+UPB_INLINE struct envoy_config_core_v3_EnvoyInternalAddress* envoy_config_core_v3_Address_mutable_envoy_internal_address(envoy_config_core_v3_Address *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_EnvoyInternalAddress* sub = (struct envoy_config_core_v3_EnvoyInternalAddress*)envoy_config_core_v3_Address_envoy_internal_address(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_EnvoyInternalAddress*)_upb_msg_new(&envoy_config_core_v3_EnvoyInternalAddress_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_Address_set_envoy_internal_address(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.core.v3.CidrRange */
+
+UPB_INLINE envoy_config_core_v3_CidrRange *envoy_config_core_v3_CidrRange_new(upb_arena *arena) {
+ return (envoy_config_core_v3_CidrRange *)_upb_msg_new(&envoy_config_core_v3_CidrRange_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_CidrRange *envoy_config_core_v3_CidrRange_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_core_v3_CidrRange *ret = envoy_config_core_v3_CidrRange_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_CidrRange_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_core_v3_CidrRange_serialize(const envoy_config_core_v3_CidrRange *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_core_v3_CidrRange_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview envoy_config_core_v3_CidrRange_address_prefix(const envoy_config_core_v3_CidrRange *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE bool envoy_config_core_v3_CidrRange_has_prefix_len(const envoy_config_core_v3_CidrRange *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_core_v3_CidrRange_prefix_len(const envoy_config_core_v3_CidrRange *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_UInt32Value*); }
+
+UPB_INLINE void envoy_config_core_v3_CidrRange_set_address_prefix(envoy_config_core_v3_CidrRange *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_core_v3_CidrRange_set_prefix_len(envoy_config_core_v3_CidrRange *msg, struct google_protobuf_UInt32Value* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_CidrRange_mutable_prefix_len(envoy_config_core_v3_CidrRange *msg, upb_arena *arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_core_v3_CidrRange_prefix_len(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_CidrRange_set_prefix_len(msg, sub);
+ }
+ return sub;
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_CONFIG_CORE_V3_ADDRESS_PROTO_UPB_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.c
index d95348880ba..f564f333621 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.c
@@ -1,35 +1,35 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/config/core/v3/backoff.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include <stddef.h>
-#include "upb/msg.h"
-#include "envoy/config/core/v3/backoff.upb.h"
-#include "google/protobuf/duration.upb.h"
-#include "udpa/annotations/status.upb.h"
-#include "udpa/annotations/versioning.upb.h"
-#include "validate/validate.upb.h"
-
-#include "upb/port_def.inc"
-
-static const upb_msglayout *const envoy_config_core_v3_BackoffStrategy_submsgs[2] = {
- &google_protobuf_Duration_msginit,
-};
-
-static const upb_msglayout_field envoy_config_core_v3_BackoffStrategy__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
- {2, UPB_SIZE(4, 8), 0, 0, 11, 1},
-};
-
-const upb_msglayout envoy_config_core_v3_BackoffStrategy_msginit = {
- &envoy_config_core_v3_BackoffStrategy_submsgs[0],
- &envoy_config_core_v3_BackoffStrategy__fields[0],
- UPB_SIZE(8, 16), 2, false,
-};
-
-#include "upb/port_undef.inc"
-
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/core/v3/backoff.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg.h"
+#include "envoy/config/core/v3/backoff.upb.h"
+#include "google/protobuf/duration.upb.h"
+#include "udpa/annotations/status.upb.h"
+#include "udpa/annotations/versioning.upb.h"
+#include "validate/validate.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_msglayout *const envoy_config_core_v3_BackoffStrategy_submsgs[2] = {
+ &google_protobuf_Duration_msginit,
+};
+
+static const upb_msglayout_field envoy_config_core_v3_BackoffStrategy__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
+ {2, UPB_SIZE(4, 8), 0, 0, 11, 1},
+};
+
+const upb_msglayout envoy_config_core_v3_BackoffStrategy_msginit = {
+ &envoy_config_core_v3_BackoffStrategy_submsgs[0],
+ &envoy_config_core_v3_BackoffStrategy__fields[0],
+ UPB_SIZE(8, 16), 2, false,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.h
index dd9c5e4d8ca..0f843e20562 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.h
@@ -1,79 +1,79 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/config/core/v3/backoff.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef ENVOY_CONFIG_CORE_V3_BACKOFF_PROTO_UPB_H_
-#define ENVOY_CONFIG_CORE_V3_BACKOFF_PROTO_UPB_H_
-
-#include "upb/msg.h"
-#include "upb/decode.h"
-#include "upb/encode.h"
-
-#include "upb/port_def.inc"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct envoy_config_core_v3_BackoffStrategy;
-typedef struct envoy_config_core_v3_BackoffStrategy envoy_config_core_v3_BackoffStrategy;
-extern const upb_msglayout envoy_config_core_v3_BackoffStrategy_msginit;
-struct google_protobuf_Duration;
-extern const upb_msglayout google_protobuf_Duration_msginit;
-
-
-/* envoy.config.core.v3.BackoffStrategy */
-
-UPB_INLINE envoy_config_core_v3_BackoffStrategy *envoy_config_core_v3_BackoffStrategy_new(upb_arena *arena) {
- return (envoy_config_core_v3_BackoffStrategy *)_upb_msg_new(&envoy_config_core_v3_BackoffStrategy_msginit, arena);
-}
-UPB_INLINE envoy_config_core_v3_BackoffStrategy *envoy_config_core_v3_BackoffStrategy_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_core_v3_BackoffStrategy *ret = envoy_config_core_v3_BackoffStrategy_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_BackoffStrategy_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_core_v3_BackoffStrategy_serialize(const envoy_config_core_v3_BackoffStrategy *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_core_v3_BackoffStrategy_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_config_core_v3_BackoffStrategy_has_base_interval(const envoy_config_core_v3_BackoffStrategy *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE const struct google_protobuf_Duration* envoy_config_core_v3_BackoffStrategy_base_interval(const envoy_config_core_v3_BackoffStrategy *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct google_protobuf_Duration*); }
-UPB_INLINE bool envoy_config_core_v3_BackoffStrategy_has_max_interval(const envoy_config_core_v3_BackoffStrategy *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
-UPB_INLINE const struct google_protobuf_Duration* envoy_config_core_v3_BackoffStrategy_max_interval(const envoy_config_core_v3_BackoffStrategy *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_Duration*); }
-
-UPB_INLINE void envoy_config_core_v3_BackoffStrategy_set_base_interval(envoy_config_core_v3_BackoffStrategy *msg, struct google_protobuf_Duration* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct google_protobuf_Duration*) = value;
-}
-UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_BackoffStrategy_mutable_base_interval(envoy_config_core_v3_BackoffStrategy *msg, upb_arena *arena) {
- struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_core_v3_BackoffStrategy_base_interval(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_BackoffStrategy_set_base_interval(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_core_v3_BackoffStrategy_set_max_interval(envoy_config_core_v3_BackoffStrategy *msg, struct google_protobuf_Duration* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_Duration*) = value;
-}
-UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_BackoffStrategy_mutable_max_interval(envoy_config_core_v3_BackoffStrategy *msg, upb_arena *arena) {
- struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_core_v3_BackoffStrategy_max_interval(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_BackoffStrategy_set_max_interval(msg, sub);
- }
- return sub;
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* ENVOY_CONFIG_CORE_V3_BACKOFF_PROTO_UPB_H_ */
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/core/v3/backoff.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_CONFIG_CORE_V3_BACKOFF_PROTO_UPB_H_
+#define ENVOY_CONFIG_CORE_V3_BACKOFF_PROTO_UPB_H_
+
+#include "upb/msg.h"
+#include "upb/decode.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_config_core_v3_BackoffStrategy;
+typedef struct envoy_config_core_v3_BackoffStrategy envoy_config_core_v3_BackoffStrategy;
+extern const upb_msglayout envoy_config_core_v3_BackoffStrategy_msginit;
+struct google_protobuf_Duration;
+extern const upb_msglayout google_protobuf_Duration_msginit;
+
+
+/* envoy.config.core.v3.BackoffStrategy */
+
+UPB_INLINE envoy_config_core_v3_BackoffStrategy *envoy_config_core_v3_BackoffStrategy_new(upb_arena *arena) {
+ return (envoy_config_core_v3_BackoffStrategy *)_upb_msg_new(&envoy_config_core_v3_BackoffStrategy_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_BackoffStrategy *envoy_config_core_v3_BackoffStrategy_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_core_v3_BackoffStrategy *ret = envoy_config_core_v3_BackoffStrategy_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_BackoffStrategy_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_core_v3_BackoffStrategy_serialize(const envoy_config_core_v3_BackoffStrategy *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_core_v3_BackoffStrategy_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_core_v3_BackoffStrategy_has_base_interval(const envoy_config_core_v3_BackoffStrategy *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE const struct google_protobuf_Duration* envoy_config_core_v3_BackoffStrategy_base_interval(const envoy_config_core_v3_BackoffStrategy *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct google_protobuf_Duration*); }
+UPB_INLINE bool envoy_config_core_v3_BackoffStrategy_has_max_interval(const envoy_config_core_v3_BackoffStrategy *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
+UPB_INLINE const struct google_protobuf_Duration* envoy_config_core_v3_BackoffStrategy_max_interval(const envoy_config_core_v3_BackoffStrategy *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_Duration*); }
+
+UPB_INLINE void envoy_config_core_v3_BackoffStrategy_set_base_interval(envoy_config_core_v3_BackoffStrategy *msg, struct google_protobuf_Duration* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct google_protobuf_Duration*) = value;
+}
+UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_BackoffStrategy_mutable_base_interval(envoy_config_core_v3_BackoffStrategy *msg, upb_arena *arena) {
+ struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_core_v3_BackoffStrategy_base_interval(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_BackoffStrategy_set_base_interval(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_BackoffStrategy_set_max_interval(envoy_config_core_v3_BackoffStrategy *msg, struct google_protobuf_Duration* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_Duration*) = value;
+}
+UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_BackoffStrategy_mutable_max_interval(envoy_config_core_v3_BackoffStrategy *msg, upb_arena *arena) {
+ struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_core_v3_BackoffStrategy_max_interval(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_BackoffStrategy_set_max_interval(msg, sub);
+ }
+ return sub;
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_CONFIG_CORE_V3_BACKOFF_PROTO_UPB_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.c
index b8a93adde7c..a651c67d939 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.c
@@ -1,310 +1,310 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/config/core/v3/base.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include <stddef.h>
-#include "upb/msg.h"
-#include "envoy/config/core/v3/base.upb.h"
-#include "envoy/config/core/v3/address.upb.h"
-#include "envoy/config/core/v3/backoff.upb.h"
-#include "envoy/config/core/v3/http_uri.upb.h"
-#include "envoy/type/v3/percent.upb.h"
-#include "envoy/type/v3/semantic_version.upb.h"
-#include "google/protobuf/any.upb.h"
-#include "google/protobuf/duration.upb.h"
-#include "google/protobuf/struct.upb.h"
-#include "google/protobuf/wrappers.upb.h"
-#include "udpa/annotations/migrate.upb.h"
-#include "udpa/annotations/status.upb.h"
-#include "udpa/annotations/versioning.upb.h"
-#include "validate/validate.upb.h"
-
-#include "upb/port_def.inc"
-
-static const upb_msglayout_field envoy_config_core_v3_Locality__fields[3] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 9, 1},
- {3, UPB_SIZE(16, 32), 0, 0, 9, 1},
-};
-
-const upb_msglayout envoy_config_core_v3_Locality_msginit = {
- NULL,
- &envoy_config_core_v3_Locality__fields[0],
- UPB_SIZE(24, 48), 3, false,
-};
-
-static const upb_msglayout *const envoy_config_core_v3_BuildVersion_submsgs[2] = {
- &envoy_type_v3_SemanticVersion_msginit,
- &google_protobuf_Struct_msginit,
-};
-
-static const upb_msglayout_field envoy_config_core_v3_BuildVersion__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
- {2, UPB_SIZE(4, 8), 0, 1, 11, 1},
-};
-
-const upb_msglayout envoy_config_core_v3_BuildVersion_msginit = {
- &envoy_config_core_v3_BuildVersion_submsgs[0],
- &envoy_config_core_v3_BuildVersion__fields[0],
- UPB_SIZE(8, 16), 2, false,
-};
-
-static const upb_msglayout *const envoy_config_core_v3_Extension_submsgs[1] = {
- &envoy_config_core_v3_BuildVersion_msginit,
-};
-
-static const upb_msglayout_field envoy_config_core_v3_Extension__fields[5] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(12, 24), 0, 0, 9, 1},
- {3, UPB_SIZE(20, 40), 0, 0, 9, 1},
- {4, UPB_SIZE(28, 56), 0, 0, 11, 1},
- {5, UPB_SIZE(0, 0), 0, 0, 8, 1},
-};
-
-const upb_msglayout envoy_config_core_v3_Extension_msginit = {
- &envoy_config_core_v3_Extension_submsgs[0],
- &envoy_config_core_v3_Extension__fields[0],
- UPB_SIZE(32, 64), 5, false,
-};
-
-static const upb_msglayout *const envoy_config_core_v3_Node_submsgs[5] = {
- &envoy_config_core_v3_Address_msginit,
- &envoy_config_core_v3_BuildVersion_msginit,
- &envoy_config_core_v3_Extension_msginit,
- &envoy_config_core_v3_Locality_msginit,
- &google_protobuf_Struct_msginit,
-};
-
-static const upb_msglayout_field envoy_config_core_v3_Node__fields[10] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 9, 1},
- {3, UPB_SIZE(24, 48), 0, 4, 11, 1},
- {4, UPB_SIZE(28, 56), 0, 3, 11, 1},
- {6, UPB_SIZE(16, 32), 0, 0, 9, 1},
- {7, UPB_SIZE(44, 88), UPB_SIZE(-53, -105), 0, 9, 1},
- {8, UPB_SIZE(44, 88), UPB_SIZE(-53, -105), 1, 11, 1},
- {9, UPB_SIZE(32, 64), 0, 2, 11, 3},
- {10, UPB_SIZE(36, 72), 0, 0, 9, 3},
- {11, UPB_SIZE(40, 80), 0, 0, 11, 3},
-};
-
-const upb_msglayout envoy_config_core_v3_Node_msginit = {
- &envoy_config_core_v3_Node_submsgs[0],
- &envoy_config_core_v3_Node__fields[0],
- UPB_SIZE(56, 112), 10, false,
-};
-
-static const upb_msglayout *const envoy_config_core_v3_Metadata_submsgs[1] = {
- &envoy_config_core_v3_Metadata_FilterMetadataEntry_msginit,
-};
-
-static const upb_msglayout_field envoy_config_core_v3_Metadata__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, _UPB_LABEL_MAP},
-};
-
-const upb_msglayout envoy_config_core_v3_Metadata_msginit = {
- &envoy_config_core_v3_Metadata_submsgs[0],
- &envoy_config_core_v3_Metadata__fields[0],
- UPB_SIZE(4, 8), 1, false,
-};
-
-static const upb_msglayout *const envoy_config_core_v3_Metadata_FilterMetadataEntry_submsgs[1] = {
- &google_protobuf_Struct_msginit,
-};
-
-static const upb_msglayout_field envoy_config_core_v3_Metadata_FilterMetadataEntry__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 11, 1},
-};
-
-const upb_msglayout envoy_config_core_v3_Metadata_FilterMetadataEntry_msginit = {
- &envoy_config_core_v3_Metadata_FilterMetadataEntry_submsgs[0],
- &envoy_config_core_v3_Metadata_FilterMetadataEntry__fields[0],
- UPB_SIZE(16, 32), 2, false,
-};
-
-static const upb_msglayout_field envoy_config_core_v3_RuntimeUInt32__fields[2] = {
- {2, UPB_SIZE(0, 0), 0, 0, 13, 1},
- {3, UPB_SIZE(4, 8), 0, 0, 9, 1},
-};
-
-const upb_msglayout envoy_config_core_v3_RuntimeUInt32_msginit = {
- NULL,
- &envoy_config_core_v3_RuntimeUInt32__fields[0],
- UPB_SIZE(16, 32), 2, false,
-};
-
-static const upb_msglayout_field envoy_config_core_v3_RuntimeDouble__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 1, 1},
- {2, UPB_SIZE(8, 8), 0, 0, 9, 1},
-};
-
-const upb_msglayout envoy_config_core_v3_RuntimeDouble_msginit = {
- NULL,
- &envoy_config_core_v3_RuntimeDouble__fields[0],
- UPB_SIZE(16, 32), 2, false,
-};
-
-static const upb_msglayout *const envoy_config_core_v3_RuntimeFeatureFlag_submsgs[1] = {
- &google_protobuf_BoolValue_msginit,
-};
-
-static const upb_msglayout_field envoy_config_core_v3_RuntimeFeatureFlag__fields[2] = {
- {1, UPB_SIZE(8, 16), 0, 0, 11, 1},
- {2, UPB_SIZE(0, 0), 0, 0, 9, 1},
-};
-
-const upb_msglayout envoy_config_core_v3_RuntimeFeatureFlag_msginit = {
- &envoy_config_core_v3_RuntimeFeatureFlag_submsgs[0],
- &envoy_config_core_v3_RuntimeFeatureFlag__fields[0],
- UPB_SIZE(16, 32), 2, false,
-};
-
-static const upb_msglayout_field envoy_config_core_v3_HeaderValue__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 9, 1},
-};
-
-const upb_msglayout envoy_config_core_v3_HeaderValue_msginit = {
- NULL,
- &envoy_config_core_v3_HeaderValue__fields[0],
- UPB_SIZE(16, 32), 2, false,
-};
-
-static const upb_msglayout *const envoy_config_core_v3_HeaderValueOption_submsgs[2] = {
- &envoy_config_core_v3_HeaderValue_msginit,
- &google_protobuf_BoolValue_msginit,
-};
-
-static const upb_msglayout_field envoy_config_core_v3_HeaderValueOption__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
- {2, UPB_SIZE(4, 8), 0, 1, 11, 1},
-};
-
-const upb_msglayout envoy_config_core_v3_HeaderValueOption_msginit = {
- &envoy_config_core_v3_HeaderValueOption_submsgs[0],
- &envoy_config_core_v3_HeaderValueOption__fields[0],
- UPB_SIZE(8, 16), 2, false,
-};
-
-static const upb_msglayout *const envoy_config_core_v3_HeaderMap_submsgs[1] = {
- &envoy_config_core_v3_HeaderValue_msginit,
-};
-
-static const upb_msglayout_field envoy_config_core_v3_HeaderMap__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 3},
-};
-
-const upb_msglayout envoy_config_core_v3_HeaderMap_msginit = {
- &envoy_config_core_v3_HeaderMap_submsgs[0],
- &envoy_config_core_v3_HeaderMap__fields[0],
- UPB_SIZE(4, 8), 1, false,
-};
-
-static const upb_msglayout_field envoy_config_core_v3_DataSource__fields[3] = {
- {1, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 9, 1},
- {2, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 12, 1},
- {3, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 9, 1},
-};
-
-const upb_msglayout envoy_config_core_v3_DataSource_msginit = {
- NULL,
- &envoy_config_core_v3_DataSource__fields[0],
- UPB_SIZE(16, 32), 3, false,
-};
-
-static const upb_msglayout *const envoy_config_core_v3_RetryPolicy_submsgs[2] = {
- &envoy_config_core_v3_BackoffStrategy_msginit,
- &google_protobuf_UInt32Value_msginit,
-};
-
-static const upb_msglayout_field envoy_config_core_v3_RetryPolicy__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
- {2, UPB_SIZE(4, 8), 0, 1, 11, 1},
-};
-
-const upb_msglayout envoy_config_core_v3_RetryPolicy_msginit = {
- &envoy_config_core_v3_RetryPolicy_submsgs[0],
- &envoy_config_core_v3_RetryPolicy__fields[0],
- UPB_SIZE(8, 16), 2, false,
-};
-
-static const upb_msglayout *const envoy_config_core_v3_RemoteDataSource_submsgs[2] = {
- &envoy_config_core_v3_HttpUri_msginit,
- &envoy_config_core_v3_RetryPolicy_msginit,
-};
-
-static const upb_msglayout_field envoy_config_core_v3_RemoteDataSource__fields[3] = {
- {1, UPB_SIZE(8, 16), 0, 0, 11, 1},
- {2, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {3, UPB_SIZE(12, 24), 0, 1, 11, 1},
-};
-
-const upb_msglayout envoy_config_core_v3_RemoteDataSource_msginit = {
- &envoy_config_core_v3_RemoteDataSource_submsgs[0],
- &envoy_config_core_v3_RemoteDataSource__fields[0],
- UPB_SIZE(16, 32), 3, false,
-};
-
-static const upb_msglayout *const envoy_config_core_v3_AsyncDataSource_submsgs[2] = {
- &envoy_config_core_v3_DataSource_msginit,
- &envoy_config_core_v3_RemoteDataSource_msginit,
-};
-
-static const upb_msglayout_field envoy_config_core_v3_AsyncDataSource__fields[2] = {
- {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, 1},
- {2, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 1, 11, 1},
-};
-
-const upb_msglayout envoy_config_core_v3_AsyncDataSource_msginit = {
- &envoy_config_core_v3_AsyncDataSource_submsgs[0],
- &envoy_config_core_v3_AsyncDataSource__fields[0],
- UPB_SIZE(8, 16), 2, false,
-};
-
-static const upb_msglayout *const envoy_config_core_v3_TransportSocket_submsgs[1] = {
- &google_protobuf_Any_msginit,
-};
-
-static const upb_msglayout_field envoy_config_core_v3_TransportSocket__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {3, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, 1},
-};
-
-const upb_msglayout envoy_config_core_v3_TransportSocket_msginit = {
- &envoy_config_core_v3_TransportSocket_submsgs[0],
- &envoy_config_core_v3_TransportSocket__fields[0],
- UPB_SIZE(16, 32), 2, false,
-};
-
-static const upb_msglayout *const envoy_config_core_v3_RuntimeFractionalPercent_submsgs[1] = {
- &envoy_type_v3_FractionalPercent_msginit,
-};
-
-static const upb_msglayout_field envoy_config_core_v3_RuntimeFractionalPercent__fields[2] = {
- {1, UPB_SIZE(8, 16), 0, 0, 11, 1},
- {2, UPB_SIZE(0, 0), 0, 0, 9, 1},
-};
-
-const upb_msglayout envoy_config_core_v3_RuntimeFractionalPercent_msginit = {
- &envoy_config_core_v3_RuntimeFractionalPercent_submsgs[0],
- &envoy_config_core_v3_RuntimeFractionalPercent__fields[0],
- UPB_SIZE(16, 32), 2, false,
-};
-
-static const upb_msglayout_field envoy_config_core_v3_ControlPlane__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
-};
-
-const upb_msglayout envoy_config_core_v3_ControlPlane_msginit = {
- NULL,
- &envoy_config_core_v3_ControlPlane__fields[0],
- UPB_SIZE(8, 16), 1, false,
-};
-
-#include "upb/port_undef.inc"
-
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/core/v3/base.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg.h"
+#include "envoy/config/core/v3/base.upb.h"
+#include "envoy/config/core/v3/address.upb.h"
+#include "envoy/config/core/v3/backoff.upb.h"
+#include "envoy/config/core/v3/http_uri.upb.h"
+#include "envoy/type/v3/percent.upb.h"
+#include "envoy/type/v3/semantic_version.upb.h"
+#include "google/protobuf/any.upb.h"
+#include "google/protobuf/duration.upb.h"
+#include "google/protobuf/struct.upb.h"
+#include "google/protobuf/wrappers.upb.h"
+#include "udpa/annotations/migrate.upb.h"
+#include "udpa/annotations/status.upb.h"
+#include "udpa/annotations/versioning.upb.h"
+#include "validate/validate.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_msglayout_field envoy_config_core_v3_Locality__fields[3] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {2, UPB_SIZE(8, 16), 0, 0, 9, 1},
+ {3, UPB_SIZE(16, 32), 0, 0, 9, 1},
+};
+
+const upb_msglayout envoy_config_core_v3_Locality_msginit = {
+ NULL,
+ &envoy_config_core_v3_Locality__fields[0],
+ UPB_SIZE(24, 48), 3, false,
+};
+
+static const upb_msglayout *const envoy_config_core_v3_BuildVersion_submsgs[2] = {
+ &envoy_type_v3_SemanticVersion_msginit,
+ &google_protobuf_Struct_msginit,
+};
+
+static const upb_msglayout_field envoy_config_core_v3_BuildVersion__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
+ {2, UPB_SIZE(4, 8), 0, 1, 11, 1},
+};
+
+const upb_msglayout envoy_config_core_v3_BuildVersion_msginit = {
+ &envoy_config_core_v3_BuildVersion_submsgs[0],
+ &envoy_config_core_v3_BuildVersion__fields[0],
+ UPB_SIZE(8, 16), 2, false,
+};
+
+static const upb_msglayout *const envoy_config_core_v3_Extension_submsgs[1] = {
+ &envoy_config_core_v3_BuildVersion_msginit,
+};
+
+static const upb_msglayout_field envoy_config_core_v3_Extension__fields[5] = {
+ {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
+ {2, UPB_SIZE(12, 24), 0, 0, 9, 1},
+ {3, UPB_SIZE(20, 40), 0, 0, 9, 1},
+ {4, UPB_SIZE(28, 56), 0, 0, 11, 1},
+ {5, UPB_SIZE(0, 0), 0, 0, 8, 1},
+};
+
+const upb_msglayout envoy_config_core_v3_Extension_msginit = {
+ &envoy_config_core_v3_Extension_submsgs[0],
+ &envoy_config_core_v3_Extension__fields[0],
+ UPB_SIZE(32, 64), 5, false,
+};
+
+static const upb_msglayout *const envoy_config_core_v3_Node_submsgs[5] = {
+ &envoy_config_core_v3_Address_msginit,
+ &envoy_config_core_v3_BuildVersion_msginit,
+ &envoy_config_core_v3_Extension_msginit,
+ &envoy_config_core_v3_Locality_msginit,
+ &google_protobuf_Struct_msginit,
+};
+
+static const upb_msglayout_field envoy_config_core_v3_Node__fields[10] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {2, UPB_SIZE(8, 16), 0, 0, 9, 1},
+ {3, UPB_SIZE(24, 48), 0, 4, 11, 1},
+ {4, UPB_SIZE(28, 56), 0, 3, 11, 1},
+ {6, UPB_SIZE(16, 32), 0, 0, 9, 1},
+ {7, UPB_SIZE(44, 88), UPB_SIZE(-53, -105), 0, 9, 1},
+ {8, UPB_SIZE(44, 88), UPB_SIZE(-53, -105), 1, 11, 1},
+ {9, UPB_SIZE(32, 64), 0, 2, 11, 3},
+ {10, UPB_SIZE(36, 72), 0, 0, 9, 3},
+ {11, UPB_SIZE(40, 80), 0, 0, 11, 3},
+};
+
+const upb_msglayout envoy_config_core_v3_Node_msginit = {
+ &envoy_config_core_v3_Node_submsgs[0],
+ &envoy_config_core_v3_Node__fields[0],
+ UPB_SIZE(56, 112), 10, false,
+};
+
+static const upb_msglayout *const envoy_config_core_v3_Metadata_submsgs[1] = {
+ &envoy_config_core_v3_Metadata_FilterMetadataEntry_msginit,
+};
+
+static const upb_msglayout_field envoy_config_core_v3_Metadata__fields[1] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 11, _UPB_LABEL_MAP},
+};
+
+const upb_msglayout envoy_config_core_v3_Metadata_msginit = {
+ &envoy_config_core_v3_Metadata_submsgs[0],
+ &envoy_config_core_v3_Metadata__fields[0],
+ UPB_SIZE(4, 8), 1, false,
+};
+
+static const upb_msglayout *const envoy_config_core_v3_Metadata_FilterMetadataEntry_submsgs[1] = {
+ &google_protobuf_Struct_msginit,
+};
+
+static const upb_msglayout_field envoy_config_core_v3_Metadata_FilterMetadataEntry__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {2, UPB_SIZE(8, 16), 0, 0, 11, 1},
+};
+
+const upb_msglayout envoy_config_core_v3_Metadata_FilterMetadataEntry_msginit = {
+ &envoy_config_core_v3_Metadata_FilterMetadataEntry_submsgs[0],
+ &envoy_config_core_v3_Metadata_FilterMetadataEntry__fields[0],
+ UPB_SIZE(16, 32), 2, false,
+};
+
+static const upb_msglayout_field envoy_config_core_v3_RuntimeUInt32__fields[2] = {
+ {2, UPB_SIZE(0, 0), 0, 0, 13, 1},
+ {3, UPB_SIZE(4, 8), 0, 0, 9, 1},
+};
+
+const upb_msglayout envoy_config_core_v3_RuntimeUInt32_msginit = {
+ NULL,
+ &envoy_config_core_v3_RuntimeUInt32__fields[0],
+ UPB_SIZE(16, 32), 2, false,
+};
+
+static const upb_msglayout_field envoy_config_core_v3_RuntimeDouble__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 1, 1},
+ {2, UPB_SIZE(8, 8), 0, 0, 9, 1},
+};
+
+const upb_msglayout envoy_config_core_v3_RuntimeDouble_msginit = {
+ NULL,
+ &envoy_config_core_v3_RuntimeDouble__fields[0],
+ UPB_SIZE(16, 32), 2, false,
+};
+
+static const upb_msglayout *const envoy_config_core_v3_RuntimeFeatureFlag_submsgs[1] = {
+ &google_protobuf_BoolValue_msginit,
+};
+
+static const upb_msglayout_field envoy_config_core_v3_RuntimeFeatureFlag__fields[2] = {
+ {1, UPB_SIZE(8, 16), 0, 0, 11, 1},
+ {2, UPB_SIZE(0, 0), 0, 0, 9, 1},
+};
+
+const upb_msglayout envoy_config_core_v3_RuntimeFeatureFlag_msginit = {
+ &envoy_config_core_v3_RuntimeFeatureFlag_submsgs[0],
+ &envoy_config_core_v3_RuntimeFeatureFlag__fields[0],
+ UPB_SIZE(16, 32), 2, false,
+};
+
+static const upb_msglayout_field envoy_config_core_v3_HeaderValue__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {2, UPB_SIZE(8, 16), 0, 0, 9, 1},
+};
+
+const upb_msglayout envoy_config_core_v3_HeaderValue_msginit = {
+ NULL,
+ &envoy_config_core_v3_HeaderValue__fields[0],
+ UPB_SIZE(16, 32), 2, false,
+};
+
+static const upb_msglayout *const envoy_config_core_v3_HeaderValueOption_submsgs[2] = {
+ &envoy_config_core_v3_HeaderValue_msginit,
+ &google_protobuf_BoolValue_msginit,
+};
+
+static const upb_msglayout_field envoy_config_core_v3_HeaderValueOption__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
+ {2, UPB_SIZE(4, 8), 0, 1, 11, 1},
+};
+
+const upb_msglayout envoy_config_core_v3_HeaderValueOption_msginit = {
+ &envoy_config_core_v3_HeaderValueOption_submsgs[0],
+ &envoy_config_core_v3_HeaderValueOption__fields[0],
+ UPB_SIZE(8, 16), 2, false,
+};
+
+static const upb_msglayout *const envoy_config_core_v3_HeaderMap_submsgs[1] = {
+ &envoy_config_core_v3_HeaderValue_msginit,
+};
+
+static const upb_msglayout_field envoy_config_core_v3_HeaderMap__fields[1] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 11, 3},
+};
+
+const upb_msglayout envoy_config_core_v3_HeaderMap_msginit = {
+ &envoy_config_core_v3_HeaderMap_submsgs[0],
+ &envoy_config_core_v3_HeaderMap__fields[0],
+ UPB_SIZE(4, 8), 1, false,
+};
+
+static const upb_msglayout_field envoy_config_core_v3_DataSource__fields[3] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 9, 1},
+ {2, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 12, 1},
+ {3, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 9, 1},
+};
+
+const upb_msglayout envoy_config_core_v3_DataSource_msginit = {
+ NULL,
+ &envoy_config_core_v3_DataSource__fields[0],
+ UPB_SIZE(16, 32), 3, false,
+};
+
+static const upb_msglayout *const envoy_config_core_v3_RetryPolicy_submsgs[2] = {
+ &envoy_config_core_v3_BackoffStrategy_msginit,
+ &google_protobuf_UInt32Value_msginit,
+};
+
+static const upb_msglayout_field envoy_config_core_v3_RetryPolicy__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
+ {2, UPB_SIZE(4, 8), 0, 1, 11, 1},
+};
+
+const upb_msglayout envoy_config_core_v3_RetryPolicy_msginit = {
+ &envoy_config_core_v3_RetryPolicy_submsgs[0],
+ &envoy_config_core_v3_RetryPolicy__fields[0],
+ UPB_SIZE(8, 16), 2, false,
+};
+
+static const upb_msglayout *const envoy_config_core_v3_RemoteDataSource_submsgs[2] = {
+ &envoy_config_core_v3_HttpUri_msginit,
+ &envoy_config_core_v3_RetryPolicy_msginit,
+};
+
+static const upb_msglayout_field envoy_config_core_v3_RemoteDataSource__fields[3] = {
+ {1, UPB_SIZE(8, 16), 0, 0, 11, 1},
+ {2, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {3, UPB_SIZE(12, 24), 0, 1, 11, 1},
+};
+
+const upb_msglayout envoy_config_core_v3_RemoteDataSource_msginit = {
+ &envoy_config_core_v3_RemoteDataSource_submsgs[0],
+ &envoy_config_core_v3_RemoteDataSource__fields[0],
+ UPB_SIZE(16, 32), 3, false,
+};
+
+static const upb_msglayout *const envoy_config_core_v3_AsyncDataSource_submsgs[2] = {
+ &envoy_config_core_v3_DataSource_msginit,
+ &envoy_config_core_v3_RemoteDataSource_msginit,
+};
+
+static const upb_msglayout_field envoy_config_core_v3_AsyncDataSource__fields[2] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, 1},
+ {2, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 1, 11, 1},
+};
+
+const upb_msglayout envoy_config_core_v3_AsyncDataSource_msginit = {
+ &envoy_config_core_v3_AsyncDataSource_submsgs[0],
+ &envoy_config_core_v3_AsyncDataSource__fields[0],
+ UPB_SIZE(8, 16), 2, false,
+};
+
+static const upb_msglayout *const envoy_config_core_v3_TransportSocket_submsgs[1] = {
+ &google_protobuf_Any_msginit,
+};
+
+static const upb_msglayout_field envoy_config_core_v3_TransportSocket__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {3, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, 1},
+};
+
+const upb_msglayout envoy_config_core_v3_TransportSocket_msginit = {
+ &envoy_config_core_v3_TransportSocket_submsgs[0],
+ &envoy_config_core_v3_TransportSocket__fields[0],
+ UPB_SIZE(16, 32), 2, false,
+};
+
+static const upb_msglayout *const envoy_config_core_v3_RuntimeFractionalPercent_submsgs[1] = {
+ &envoy_type_v3_FractionalPercent_msginit,
+};
+
+static const upb_msglayout_field envoy_config_core_v3_RuntimeFractionalPercent__fields[2] = {
+ {1, UPB_SIZE(8, 16), 0, 0, 11, 1},
+ {2, UPB_SIZE(0, 0), 0, 0, 9, 1},
+};
+
+const upb_msglayout envoy_config_core_v3_RuntimeFractionalPercent_msginit = {
+ &envoy_config_core_v3_RuntimeFractionalPercent_submsgs[0],
+ &envoy_config_core_v3_RuntimeFractionalPercent__fields[0],
+ UPB_SIZE(16, 32), 2, false,
+};
+
+static const upb_msglayout_field envoy_config_core_v3_ControlPlane__fields[1] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+};
+
+const upb_msglayout envoy_config_core_v3_ControlPlane_msginit = {
+ NULL,
+ &envoy_config_core_v3_ControlPlane__fields[0],
+ UPB_SIZE(8, 16), 1, false,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.h
index f0375635516..21852d78c29 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.h
@@ -1,869 +1,869 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/config/core/v3/base.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef ENVOY_CONFIG_CORE_V3_BASE_PROTO_UPB_H_
-#define ENVOY_CONFIG_CORE_V3_BASE_PROTO_UPB_H_
-
-#include "upb/msg.h"
-#include "upb/decode.h"
-#include "upb/encode.h"
-
-#include "upb/port_def.inc"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct envoy_config_core_v3_Locality;
-struct envoy_config_core_v3_BuildVersion;
-struct envoy_config_core_v3_Extension;
-struct envoy_config_core_v3_Node;
-struct envoy_config_core_v3_Metadata;
-struct envoy_config_core_v3_Metadata_FilterMetadataEntry;
-struct envoy_config_core_v3_RuntimeUInt32;
-struct envoy_config_core_v3_RuntimeDouble;
-struct envoy_config_core_v3_RuntimeFeatureFlag;
-struct envoy_config_core_v3_HeaderValue;
-struct envoy_config_core_v3_HeaderValueOption;
-struct envoy_config_core_v3_HeaderMap;
-struct envoy_config_core_v3_DataSource;
-struct envoy_config_core_v3_RetryPolicy;
-struct envoy_config_core_v3_RemoteDataSource;
-struct envoy_config_core_v3_AsyncDataSource;
-struct envoy_config_core_v3_TransportSocket;
-struct envoy_config_core_v3_RuntimeFractionalPercent;
-struct envoy_config_core_v3_ControlPlane;
-typedef struct envoy_config_core_v3_Locality envoy_config_core_v3_Locality;
-typedef struct envoy_config_core_v3_BuildVersion envoy_config_core_v3_BuildVersion;
-typedef struct envoy_config_core_v3_Extension envoy_config_core_v3_Extension;
-typedef struct envoy_config_core_v3_Node envoy_config_core_v3_Node;
-typedef struct envoy_config_core_v3_Metadata envoy_config_core_v3_Metadata;
-typedef struct envoy_config_core_v3_Metadata_FilterMetadataEntry envoy_config_core_v3_Metadata_FilterMetadataEntry;
-typedef struct envoy_config_core_v3_RuntimeUInt32 envoy_config_core_v3_RuntimeUInt32;
-typedef struct envoy_config_core_v3_RuntimeDouble envoy_config_core_v3_RuntimeDouble;
-typedef struct envoy_config_core_v3_RuntimeFeatureFlag envoy_config_core_v3_RuntimeFeatureFlag;
-typedef struct envoy_config_core_v3_HeaderValue envoy_config_core_v3_HeaderValue;
-typedef struct envoy_config_core_v3_HeaderValueOption envoy_config_core_v3_HeaderValueOption;
-typedef struct envoy_config_core_v3_HeaderMap envoy_config_core_v3_HeaderMap;
-typedef struct envoy_config_core_v3_DataSource envoy_config_core_v3_DataSource;
-typedef struct envoy_config_core_v3_RetryPolicy envoy_config_core_v3_RetryPolicy;
-typedef struct envoy_config_core_v3_RemoteDataSource envoy_config_core_v3_RemoteDataSource;
-typedef struct envoy_config_core_v3_AsyncDataSource envoy_config_core_v3_AsyncDataSource;
-typedef struct envoy_config_core_v3_TransportSocket envoy_config_core_v3_TransportSocket;
-typedef struct envoy_config_core_v3_RuntimeFractionalPercent envoy_config_core_v3_RuntimeFractionalPercent;
-typedef struct envoy_config_core_v3_ControlPlane envoy_config_core_v3_ControlPlane;
-extern const upb_msglayout envoy_config_core_v3_Locality_msginit;
-extern const upb_msglayout envoy_config_core_v3_BuildVersion_msginit;
-extern const upb_msglayout envoy_config_core_v3_Extension_msginit;
-extern const upb_msglayout envoy_config_core_v3_Node_msginit;
-extern const upb_msglayout envoy_config_core_v3_Metadata_msginit;
-extern const upb_msglayout envoy_config_core_v3_Metadata_FilterMetadataEntry_msginit;
-extern const upb_msglayout envoy_config_core_v3_RuntimeUInt32_msginit;
-extern const upb_msglayout envoy_config_core_v3_RuntimeDouble_msginit;
-extern const upb_msglayout envoy_config_core_v3_RuntimeFeatureFlag_msginit;
-extern const upb_msglayout envoy_config_core_v3_HeaderValue_msginit;
-extern const upb_msglayout envoy_config_core_v3_HeaderValueOption_msginit;
-extern const upb_msglayout envoy_config_core_v3_HeaderMap_msginit;
-extern const upb_msglayout envoy_config_core_v3_DataSource_msginit;
-extern const upb_msglayout envoy_config_core_v3_RetryPolicy_msginit;
-extern const upb_msglayout envoy_config_core_v3_RemoteDataSource_msginit;
-extern const upb_msglayout envoy_config_core_v3_AsyncDataSource_msginit;
-extern const upb_msglayout envoy_config_core_v3_TransportSocket_msginit;
-extern const upb_msglayout envoy_config_core_v3_RuntimeFractionalPercent_msginit;
-extern const upb_msglayout envoy_config_core_v3_ControlPlane_msginit;
-struct envoy_config_core_v3_Address;
-struct envoy_config_core_v3_BackoffStrategy;
-struct envoy_config_core_v3_HttpUri;
-struct envoy_type_v3_FractionalPercent;
-struct envoy_type_v3_SemanticVersion;
-struct google_protobuf_Any;
-struct google_protobuf_BoolValue;
-struct google_protobuf_Struct;
-struct google_protobuf_UInt32Value;
-extern const upb_msglayout envoy_config_core_v3_Address_msginit;
-extern const upb_msglayout envoy_config_core_v3_BackoffStrategy_msginit;
-extern const upb_msglayout envoy_config_core_v3_HttpUri_msginit;
-extern const upb_msglayout envoy_type_v3_FractionalPercent_msginit;
-extern const upb_msglayout envoy_type_v3_SemanticVersion_msginit;
-extern const upb_msglayout google_protobuf_Any_msginit;
-extern const upb_msglayout google_protobuf_BoolValue_msginit;
-extern const upb_msglayout google_protobuf_Struct_msginit;
-extern const upb_msglayout google_protobuf_UInt32Value_msginit;
-
-typedef enum {
- envoy_config_core_v3_METHOD_UNSPECIFIED = 0,
- envoy_config_core_v3_GET = 1,
- envoy_config_core_v3_HEAD = 2,
- envoy_config_core_v3_POST = 3,
- envoy_config_core_v3_PUT = 4,
- envoy_config_core_v3_DELETE = 5,
- envoy_config_core_v3_CONNECT = 6,
- envoy_config_core_v3_OPTIONS = 7,
- envoy_config_core_v3_TRACE = 8,
- envoy_config_core_v3_PATCH = 9
-} envoy_config_core_v3_RequestMethod;
-
-typedef enum {
- envoy_config_core_v3_DEFAULT = 0,
- envoy_config_core_v3_HIGH = 1
-} envoy_config_core_v3_RoutingPriority;
-
-typedef enum {
- envoy_config_core_v3_UNSPECIFIED = 0,
- envoy_config_core_v3_INBOUND = 1,
- envoy_config_core_v3_OUTBOUND = 2
-} envoy_config_core_v3_TrafficDirection;
-
-
-/* envoy.config.core.v3.Locality */
-
-UPB_INLINE envoy_config_core_v3_Locality *envoy_config_core_v3_Locality_new(upb_arena *arena) {
- return (envoy_config_core_v3_Locality *)_upb_msg_new(&envoy_config_core_v3_Locality_msginit, arena);
-}
-UPB_INLINE envoy_config_core_v3_Locality *envoy_config_core_v3_Locality_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_core_v3_Locality *ret = envoy_config_core_v3_Locality_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_Locality_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_core_v3_Locality_serialize(const envoy_config_core_v3_Locality *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_core_v3_Locality_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview envoy_config_core_v3_Locality_region(const envoy_config_core_v3_Locality *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE upb_strview envoy_config_core_v3_Locality_zone(const envoy_config_core_v3_Locality *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview); }
-UPB_INLINE upb_strview envoy_config_core_v3_Locality_sub_zone(const envoy_config_core_v3_Locality *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_strview); }
-
-UPB_INLINE void envoy_config_core_v3_Locality_set_region(envoy_config_core_v3_Locality *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_core_v3_Locality_set_zone(envoy_config_core_v3_Locality *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_core_v3_Locality_set_sub_zone(envoy_config_core_v3_Locality *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_strview) = value;
-}
-
-/* envoy.config.core.v3.BuildVersion */
-
-UPB_INLINE envoy_config_core_v3_BuildVersion *envoy_config_core_v3_BuildVersion_new(upb_arena *arena) {
- return (envoy_config_core_v3_BuildVersion *)_upb_msg_new(&envoy_config_core_v3_BuildVersion_msginit, arena);
-}
-UPB_INLINE envoy_config_core_v3_BuildVersion *envoy_config_core_v3_BuildVersion_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_core_v3_BuildVersion *ret = envoy_config_core_v3_BuildVersion_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_BuildVersion_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_core_v3_BuildVersion_serialize(const envoy_config_core_v3_BuildVersion *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_core_v3_BuildVersion_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_config_core_v3_BuildVersion_has_version(const envoy_config_core_v3_BuildVersion *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE const struct envoy_type_v3_SemanticVersion* envoy_config_core_v3_BuildVersion_version(const envoy_config_core_v3_BuildVersion *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct envoy_type_v3_SemanticVersion*); }
-UPB_INLINE bool envoy_config_core_v3_BuildVersion_has_metadata(const envoy_config_core_v3_BuildVersion *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
-UPB_INLINE const struct google_protobuf_Struct* envoy_config_core_v3_BuildVersion_metadata(const envoy_config_core_v3_BuildVersion *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_Struct*); }
-
-UPB_INLINE void envoy_config_core_v3_BuildVersion_set_version(envoy_config_core_v3_BuildVersion *msg, struct envoy_type_v3_SemanticVersion* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct envoy_type_v3_SemanticVersion*) = value;
-}
-UPB_INLINE struct envoy_type_v3_SemanticVersion* envoy_config_core_v3_BuildVersion_mutable_version(envoy_config_core_v3_BuildVersion *msg, upb_arena *arena) {
- struct envoy_type_v3_SemanticVersion* sub = (struct envoy_type_v3_SemanticVersion*)envoy_config_core_v3_BuildVersion_version(msg);
- if (sub == NULL) {
- sub = (struct envoy_type_v3_SemanticVersion*)_upb_msg_new(&envoy_type_v3_SemanticVersion_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_BuildVersion_set_version(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_core_v3_BuildVersion_set_metadata(envoy_config_core_v3_BuildVersion *msg, struct google_protobuf_Struct* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_Struct*) = value;
-}
-UPB_INLINE struct google_protobuf_Struct* envoy_config_core_v3_BuildVersion_mutable_metadata(envoy_config_core_v3_BuildVersion *msg, upb_arena *arena) {
- struct google_protobuf_Struct* sub = (struct google_protobuf_Struct*)envoy_config_core_v3_BuildVersion_metadata(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Struct*)_upb_msg_new(&google_protobuf_Struct_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_BuildVersion_set_metadata(msg, sub);
- }
- return sub;
-}
-
-/* envoy.config.core.v3.Extension */
-
-UPB_INLINE envoy_config_core_v3_Extension *envoy_config_core_v3_Extension_new(upb_arena *arena) {
- return (envoy_config_core_v3_Extension *)_upb_msg_new(&envoy_config_core_v3_Extension_msginit, arena);
-}
-UPB_INLINE envoy_config_core_v3_Extension *envoy_config_core_v3_Extension_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_core_v3_Extension *ret = envoy_config_core_v3_Extension_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_Extension_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_core_v3_Extension_serialize(const envoy_config_core_v3_Extension *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_core_v3_Extension_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview envoy_config_core_v3_Extension_name(const envoy_config_core_v3_Extension *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
-UPB_INLINE upb_strview envoy_config_core_v3_Extension_category(const envoy_config_core_v3_Extension *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview); }
-UPB_INLINE upb_strview envoy_config_core_v3_Extension_type_descriptor(const envoy_config_core_v3_Extension *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_strview); }
-UPB_INLINE bool envoy_config_core_v3_Extension_has_version(const envoy_config_core_v3_Extension *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 56)); }
-UPB_INLINE const envoy_config_core_v3_BuildVersion* envoy_config_core_v3_Extension_version(const envoy_config_core_v3_Extension *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 56), const envoy_config_core_v3_BuildVersion*); }
-UPB_INLINE bool envoy_config_core_v3_Extension_disabled(const envoy_config_core_v3_Extension *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); }
-
-UPB_INLINE void envoy_config_core_v3_Extension_set_name(envoy_config_core_v3_Extension *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_core_v3_Extension_set_category(envoy_config_core_v3_Extension *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_core_v3_Extension_set_type_descriptor(envoy_config_core_v3_Extension *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_core_v3_Extension_set_version(envoy_config_core_v3_Extension *msg, envoy_config_core_v3_BuildVersion* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(28, 56), envoy_config_core_v3_BuildVersion*) = value;
-}
-UPB_INLINE struct envoy_config_core_v3_BuildVersion* envoy_config_core_v3_Extension_mutable_version(envoy_config_core_v3_Extension *msg, upb_arena *arena) {
- struct envoy_config_core_v3_BuildVersion* sub = (struct envoy_config_core_v3_BuildVersion*)envoy_config_core_v3_Extension_version(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_BuildVersion*)_upb_msg_new(&envoy_config_core_v3_BuildVersion_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_Extension_set_version(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_core_v3_Extension_set_disabled(envoy_config_core_v3_Extension *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
-}
-
-/* envoy.config.core.v3.Node */
-
-UPB_INLINE envoy_config_core_v3_Node *envoy_config_core_v3_Node_new(upb_arena *arena) {
- return (envoy_config_core_v3_Node *)_upb_msg_new(&envoy_config_core_v3_Node_msginit, arena);
-}
-UPB_INLINE envoy_config_core_v3_Node *envoy_config_core_v3_Node_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_core_v3_Node *ret = envoy_config_core_v3_Node_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_Node_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_core_v3_Node_serialize(const envoy_config_core_v3_Node *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_core_v3_Node_msginit, arena, len);
-}
-
-typedef enum {
- envoy_config_core_v3_Node_user_agent_version_type_user_agent_version = 7,
- envoy_config_core_v3_Node_user_agent_version_type_user_agent_build_version = 8,
- envoy_config_core_v3_Node_user_agent_version_type_NOT_SET = 0
-} envoy_config_core_v3_Node_user_agent_version_type_oneofcases;
-UPB_INLINE envoy_config_core_v3_Node_user_agent_version_type_oneofcases envoy_config_core_v3_Node_user_agent_version_type_case(const envoy_config_core_v3_Node* msg) { return (envoy_config_core_v3_Node_user_agent_version_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(52, 104), int32_t); }
-
-UPB_INLINE upb_strview envoy_config_core_v3_Node_id(const envoy_config_core_v3_Node *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE upb_strview envoy_config_core_v3_Node_cluster(const envoy_config_core_v3_Node *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview); }
-UPB_INLINE bool envoy_config_core_v3_Node_has_metadata(const envoy_config_core_v3_Node *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 48)); }
-UPB_INLINE const struct google_protobuf_Struct* envoy_config_core_v3_Node_metadata(const envoy_config_core_v3_Node *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 48), const struct google_protobuf_Struct*); }
-UPB_INLINE bool envoy_config_core_v3_Node_has_locality(const envoy_config_core_v3_Node *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 56)); }
-UPB_INLINE const envoy_config_core_v3_Locality* envoy_config_core_v3_Node_locality(const envoy_config_core_v3_Node *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 56), const envoy_config_core_v3_Locality*); }
-UPB_INLINE upb_strview envoy_config_core_v3_Node_user_agent_name(const envoy_config_core_v3_Node *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_strview); }
-UPB_INLINE bool envoy_config_core_v3_Node_has_user_agent_version(const envoy_config_core_v3_Node *msg) { return _upb_getoneofcase(msg, UPB_SIZE(52, 104)) == 7; }
-UPB_INLINE upb_strview envoy_config_core_v3_Node_user_agent_version(const envoy_config_core_v3_Node *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(44, 88), UPB_SIZE(52, 104), 7, upb_strview_make("", strlen(""))); }
-UPB_INLINE bool envoy_config_core_v3_Node_has_user_agent_build_version(const envoy_config_core_v3_Node *msg) { return _upb_getoneofcase(msg, UPB_SIZE(52, 104)) == 8; }
-UPB_INLINE const envoy_config_core_v3_BuildVersion* envoy_config_core_v3_Node_user_agent_build_version(const envoy_config_core_v3_Node *msg) { return UPB_READ_ONEOF(msg, const envoy_config_core_v3_BuildVersion*, UPB_SIZE(44, 88), UPB_SIZE(52, 104), 8, NULL); }
-UPB_INLINE bool envoy_config_core_v3_Node_has_extensions(const envoy_config_core_v3_Node *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(32, 64)); }
-UPB_INLINE const envoy_config_core_v3_Extension* const* envoy_config_core_v3_Node_extensions(const envoy_config_core_v3_Node *msg, size_t *len) { return (const envoy_config_core_v3_Extension* const*)_upb_array_accessor(msg, UPB_SIZE(32, 64), len); }
-UPB_INLINE upb_strview const* envoy_config_core_v3_Node_client_features(const envoy_config_core_v3_Node *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(36, 72), len); }
-UPB_INLINE bool envoy_config_core_v3_Node_has_listening_addresses(const envoy_config_core_v3_Node *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(40, 80)); }
-UPB_INLINE const struct envoy_config_core_v3_Address* const* envoy_config_core_v3_Node_listening_addresses(const envoy_config_core_v3_Node *msg, size_t *len) { return (const struct envoy_config_core_v3_Address* const*)_upb_array_accessor(msg, UPB_SIZE(40, 80), len); }
-
-UPB_INLINE void envoy_config_core_v3_Node_set_id(envoy_config_core_v3_Node *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_core_v3_Node_set_cluster(envoy_config_core_v3_Node *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_core_v3_Node_set_metadata(envoy_config_core_v3_Node *msg, struct google_protobuf_Struct* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(24, 48), struct google_protobuf_Struct*) = value;
-}
-UPB_INLINE struct google_protobuf_Struct* envoy_config_core_v3_Node_mutable_metadata(envoy_config_core_v3_Node *msg, upb_arena *arena) {
- struct google_protobuf_Struct* sub = (struct google_protobuf_Struct*)envoy_config_core_v3_Node_metadata(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Struct*)_upb_msg_new(&google_protobuf_Struct_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_Node_set_metadata(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_core_v3_Node_set_locality(envoy_config_core_v3_Node *msg, envoy_config_core_v3_Locality* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(28, 56), envoy_config_core_v3_Locality*) = value;
-}
-UPB_INLINE struct envoy_config_core_v3_Locality* envoy_config_core_v3_Node_mutable_locality(envoy_config_core_v3_Node *msg, upb_arena *arena) {
- struct envoy_config_core_v3_Locality* sub = (struct envoy_config_core_v3_Locality*)envoy_config_core_v3_Node_locality(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_Locality*)_upb_msg_new(&envoy_config_core_v3_Locality_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_Node_set_locality(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_core_v3_Node_set_user_agent_name(envoy_config_core_v3_Node *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_core_v3_Node_set_user_agent_version(envoy_config_core_v3_Node *msg, upb_strview value) {
- UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(44, 88), value, UPB_SIZE(52, 104), 7);
-}
-UPB_INLINE void envoy_config_core_v3_Node_set_user_agent_build_version(envoy_config_core_v3_Node *msg, envoy_config_core_v3_BuildVersion* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_core_v3_BuildVersion*, UPB_SIZE(44, 88), value, UPB_SIZE(52, 104), 8);
-}
-UPB_INLINE struct envoy_config_core_v3_BuildVersion* envoy_config_core_v3_Node_mutable_user_agent_build_version(envoy_config_core_v3_Node *msg, upb_arena *arena) {
- struct envoy_config_core_v3_BuildVersion* sub = (struct envoy_config_core_v3_BuildVersion*)envoy_config_core_v3_Node_user_agent_build_version(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_BuildVersion*)_upb_msg_new(&envoy_config_core_v3_BuildVersion_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_Node_set_user_agent_build_version(msg, sub);
- }
- return sub;
-}
-UPB_INLINE envoy_config_core_v3_Extension** envoy_config_core_v3_Node_mutable_extensions(envoy_config_core_v3_Node *msg, size_t *len) {
- return (envoy_config_core_v3_Extension**)_upb_array_mutable_accessor(msg, UPB_SIZE(32, 64), len);
-}
-UPB_INLINE envoy_config_core_v3_Extension** envoy_config_core_v3_Node_resize_extensions(envoy_config_core_v3_Node *msg, size_t len, upb_arena *arena) {
- return (envoy_config_core_v3_Extension**)_upb_array_resize_accessor(msg, UPB_SIZE(32, 64), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_config_core_v3_Extension* envoy_config_core_v3_Node_add_extensions(envoy_config_core_v3_Node *msg, upb_arena *arena) {
- struct envoy_config_core_v3_Extension* sub = (struct envoy_config_core_v3_Extension*)_upb_msg_new(&envoy_config_core_v3_Extension_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(32, 64), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-UPB_INLINE upb_strview* envoy_config_core_v3_Node_mutable_client_features(envoy_config_core_v3_Node *msg, size_t *len) {
- return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(36, 72), len);
-}
-UPB_INLINE upb_strview* envoy_config_core_v3_Node_resize_client_features(envoy_config_core_v3_Node *msg, size_t len, upb_arena *arena) {
- return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(36, 72), len, UPB_TYPE_STRING, arena);
-}
-UPB_INLINE bool envoy_config_core_v3_Node_add_client_features(envoy_config_core_v3_Node *msg, upb_strview val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(36, 72), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
- arena);
-}
-UPB_INLINE struct envoy_config_core_v3_Address** envoy_config_core_v3_Node_mutable_listening_addresses(envoy_config_core_v3_Node *msg, size_t *len) {
- return (struct envoy_config_core_v3_Address**)_upb_array_mutable_accessor(msg, UPB_SIZE(40, 80), len);
-}
-UPB_INLINE struct envoy_config_core_v3_Address** envoy_config_core_v3_Node_resize_listening_addresses(envoy_config_core_v3_Node *msg, size_t len, upb_arena *arena) {
- return (struct envoy_config_core_v3_Address**)_upb_array_resize_accessor(msg, UPB_SIZE(40, 80), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_config_core_v3_Address* envoy_config_core_v3_Node_add_listening_addresses(envoy_config_core_v3_Node *msg, upb_arena *arena) {
- struct envoy_config_core_v3_Address* sub = (struct envoy_config_core_v3_Address*)_upb_msg_new(&envoy_config_core_v3_Address_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(40, 80), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-
-/* envoy.config.core.v3.Metadata */
-
-UPB_INLINE envoy_config_core_v3_Metadata *envoy_config_core_v3_Metadata_new(upb_arena *arena) {
- return (envoy_config_core_v3_Metadata *)_upb_msg_new(&envoy_config_core_v3_Metadata_msginit, arena);
-}
-UPB_INLINE envoy_config_core_v3_Metadata *envoy_config_core_v3_Metadata_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_core_v3_Metadata *ret = envoy_config_core_v3_Metadata_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_Metadata_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_core_v3_Metadata_serialize(const envoy_config_core_v3_Metadata *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_core_v3_Metadata_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_config_core_v3_Metadata_has_filter_metadata(const envoy_config_core_v3_Metadata *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE size_t envoy_config_core_v3_Metadata_filter_metadata_size(const envoy_config_core_v3_Metadata *msg) {return _upb_msg_map_size(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE bool envoy_config_core_v3_Metadata_filter_metadata_get(const envoy_config_core_v3_Metadata *msg, upb_strview key, struct google_protobuf_Struct* *val) { return _upb_msg_map_get(msg, UPB_SIZE(0, 0), &key, 0, val, sizeof(*val)); }
-UPB_INLINE const envoy_config_core_v3_Metadata_FilterMetadataEntry* envoy_config_core_v3_Metadata_filter_metadata_next(const envoy_config_core_v3_Metadata *msg, size_t* iter) { return (const envoy_config_core_v3_Metadata_FilterMetadataEntry*)_upb_msg_map_next(msg, UPB_SIZE(0, 0), iter); }
-
-UPB_INLINE void envoy_config_core_v3_Metadata_filter_metadata_clear(envoy_config_core_v3_Metadata *msg) { _upb_msg_map_clear(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE bool envoy_config_core_v3_Metadata_filter_metadata_set(envoy_config_core_v3_Metadata *msg, upb_strview key, struct google_protobuf_Struct* val, upb_arena *a) { return _upb_msg_map_set(msg, UPB_SIZE(0, 0), &key, 0, &val, sizeof(val), a); }
-UPB_INLINE bool envoy_config_core_v3_Metadata_filter_metadata_delete(envoy_config_core_v3_Metadata *msg, upb_strview key) { return _upb_msg_map_delete(msg, UPB_SIZE(0, 0), &key, 0); }
-UPB_INLINE envoy_config_core_v3_Metadata_FilterMetadataEntry* envoy_config_core_v3_Metadata_filter_metadata_nextmutable(envoy_config_core_v3_Metadata *msg, size_t* iter) { return (envoy_config_core_v3_Metadata_FilterMetadataEntry*)_upb_msg_map_next(msg, UPB_SIZE(0, 0), iter); }
-
-/* envoy.config.core.v3.Metadata.FilterMetadataEntry */
-
-UPB_INLINE upb_strview envoy_config_core_v3_Metadata_FilterMetadataEntry_key(const envoy_config_core_v3_Metadata_FilterMetadataEntry *msg) {
- upb_strview ret;
- _upb_msg_map_key(msg, &ret, 0);
- return ret;
-}
-UPB_INLINE bool envoy_config_core_v3_Metadata_FilterMetadataEntry_has_value(const envoy_config_core_v3_Metadata_FilterMetadataEntry *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const struct google_protobuf_Struct* envoy_config_core_v3_Metadata_FilterMetadataEntry_value(const envoy_config_core_v3_Metadata_FilterMetadataEntry *msg) {
- struct google_protobuf_Struct* ret;
- _upb_msg_map_value(msg, &ret, sizeof(ret));
- return ret;
-}
-
-UPB_INLINE void envoy_config_core_v3_Metadata_FilterMetadataEntry_set_value(envoy_config_core_v3_Metadata_FilterMetadataEntry *msg, struct google_protobuf_Struct* value) {
- _upb_msg_map_set_value(msg, &value, sizeof(struct google_protobuf_Struct*));
-}
-
-/* envoy.config.core.v3.RuntimeUInt32 */
-
-UPB_INLINE envoy_config_core_v3_RuntimeUInt32 *envoy_config_core_v3_RuntimeUInt32_new(upb_arena *arena) {
- return (envoy_config_core_v3_RuntimeUInt32 *)_upb_msg_new(&envoy_config_core_v3_RuntimeUInt32_msginit, arena);
-}
-UPB_INLINE envoy_config_core_v3_RuntimeUInt32 *envoy_config_core_v3_RuntimeUInt32_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_core_v3_RuntimeUInt32 *ret = envoy_config_core_v3_RuntimeUInt32_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_RuntimeUInt32_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_core_v3_RuntimeUInt32_serialize(const envoy_config_core_v3_RuntimeUInt32 *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_core_v3_RuntimeUInt32_msginit, arena, len);
-}
-
-UPB_INLINE uint32_t envoy_config_core_v3_RuntimeUInt32_default_value(const envoy_config_core_v3_RuntimeUInt32 *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t); }
-UPB_INLINE upb_strview envoy_config_core_v3_RuntimeUInt32_runtime_key(const envoy_config_core_v3_RuntimeUInt32 *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
-
-UPB_INLINE void envoy_config_core_v3_RuntimeUInt32_set_default_value(envoy_config_core_v3_RuntimeUInt32 *msg, uint32_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t) = value;
-}
-UPB_INLINE void envoy_config_core_v3_RuntimeUInt32_set_runtime_key(envoy_config_core_v3_RuntimeUInt32 *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
-}
-
-/* envoy.config.core.v3.RuntimeDouble */
-
-UPB_INLINE envoy_config_core_v3_RuntimeDouble *envoy_config_core_v3_RuntimeDouble_new(upb_arena *arena) {
- return (envoy_config_core_v3_RuntimeDouble *)_upb_msg_new(&envoy_config_core_v3_RuntimeDouble_msginit, arena);
-}
-UPB_INLINE envoy_config_core_v3_RuntimeDouble *envoy_config_core_v3_RuntimeDouble_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_core_v3_RuntimeDouble *ret = envoy_config_core_v3_RuntimeDouble_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_RuntimeDouble_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_core_v3_RuntimeDouble_serialize(const envoy_config_core_v3_RuntimeDouble *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_core_v3_RuntimeDouble_msginit, arena, len);
-}
-
-UPB_INLINE double envoy_config_core_v3_RuntimeDouble_default_value(const envoy_config_core_v3_RuntimeDouble *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), double); }
-UPB_INLINE upb_strview envoy_config_core_v3_RuntimeDouble_runtime_key(const envoy_config_core_v3_RuntimeDouble *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview); }
-
-UPB_INLINE void envoy_config_core_v3_RuntimeDouble_set_default_value(envoy_config_core_v3_RuntimeDouble *msg, double value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), double) = value;
-}
-UPB_INLINE void envoy_config_core_v3_RuntimeDouble_set_runtime_key(envoy_config_core_v3_RuntimeDouble *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview) = value;
-}
-
-/* envoy.config.core.v3.RuntimeFeatureFlag */
-
-UPB_INLINE envoy_config_core_v3_RuntimeFeatureFlag *envoy_config_core_v3_RuntimeFeatureFlag_new(upb_arena *arena) {
- return (envoy_config_core_v3_RuntimeFeatureFlag *)_upb_msg_new(&envoy_config_core_v3_RuntimeFeatureFlag_msginit, arena);
-}
-UPB_INLINE envoy_config_core_v3_RuntimeFeatureFlag *envoy_config_core_v3_RuntimeFeatureFlag_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_core_v3_RuntimeFeatureFlag *ret = envoy_config_core_v3_RuntimeFeatureFlag_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_RuntimeFeatureFlag_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_core_v3_RuntimeFeatureFlag_serialize(const envoy_config_core_v3_RuntimeFeatureFlag *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_core_v3_RuntimeFeatureFlag_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_config_core_v3_RuntimeFeatureFlag_has_default_value(const envoy_config_core_v3_RuntimeFeatureFlag *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_core_v3_RuntimeFeatureFlag_default_value(const envoy_config_core_v3_RuntimeFeatureFlag *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_BoolValue*); }
-UPB_INLINE upb_strview envoy_config_core_v3_RuntimeFeatureFlag_runtime_key(const envoy_config_core_v3_RuntimeFeatureFlag *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-
-UPB_INLINE void envoy_config_core_v3_RuntimeFeatureFlag_set_default_value(envoy_config_core_v3_RuntimeFeatureFlag *msg, struct google_protobuf_BoolValue* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_BoolValue*) = value;
-}
-UPB_INLINE struct google_protobuf_BoolValue* envoy_config_core_v3_RuntimeFeatureFlag_mutable_default_value(envoy_config_core_v3_RuntimeFeatureFlag *msg, upb_arena *arena) {
- struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_core_v3_RuntimeFeatureFlag_default_value(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_BoolValue*)_upb_msg_new(&google_protobuf_BoolValue_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_RuntimeFeatureFlag_set_default_value(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_core_v3_RuntimeFeatureFlag_set_runtime_key(envoy_config_core_v3_RuntimeFeatureFlag *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-
-/* envoy.config.core.v3.HeaderValue */
-
-UPB_INLINE envoy_config_core_v3_HeaderValue *envoy_config_core_v3_HeaderValue_new(upb_arena *arena) {
- return (envoy_config_core_v3_HeaderValue *)_upb_msg_new(&envoy_config_core_v3_HeaderValue_msginit, arena);
-}
-UPB_INLINE envoy_config_core_v3_HeaderValue *envoy_config_core_v3_HeaderValue_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_core_v3_HeaderValue *ret = envoy_config_core_v3_HeaderValue_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_HeaderValue_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_core_v3_HeaderValue_serialize(const envoy_config_core_v3_HeaderValue *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_core_v3_HeaderValue_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview envoy_config_core_v3_HeaderValue_key(const envoy_config_core_v3_HeaderValue *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE upb_strview envoy_config_core_v3_HeaderValue_value(const envoy_config_core_v3_HeaderValue *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview); }
-
-UPB_INLINE void envoy_config_core_v3_HeaderValue_set_key(envoy_config_core_v3_HeaderValue *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_core_v3_HeaderValue_set_value(envoy_config_core_v3_HeaderValue *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview) = value;
-}
-
-/* envoy.config.core.v3.HeaderValueOption */
-
-UPB_INLINE envoy_config_core_v3_HeaderValueOption *envoy_config_core_v3_HeaderValueOption_new(upb_arena *arena) {
- return (envoy_config_core_v3_HeaderValueOption *)_upb_msg_new(&envoy_config_core_v3_HeaderValueOption_msginit, arena);
-}
-UPB_INLINE envoy_config_core_v3_HeaderValueOption *envoy_config_core_v3_HeaderValueOption_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_core_v3_HeaderValueOption *ret = envoy_config_core_v3_HeaderValueOption_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_HeaderValueOption_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_core_v3_HeaderValueOption_serialize(const envoy_config_core_v3_HeaderValueOption *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_core_v3_HeaderValueOption_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_config_core_v3_HeaderValueOption_has_header(const envoy_config_core_v3_HeaderValueOption *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE const envoy_config_core_v3_HeaderValue* envoy_config_core_v3_HeaderValueOption_header(const envoy_config_core_v3_HeaderValueOption *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const envoy_config_core_v3_HeaderValue*); }
-UPB_INLINE bool envoy_config_core_v3_HeaderValueOption_has_append(const envoy_config_core_v3_HeaderValueOption *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
-UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_core_v3_HeaderValueOption_append(const envoy_config_core_v3_HeaderValueOption *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_BoolValue*); }
-
-UPB_INLINE void envoy_config_core_v3_HeaderValueOption_set_header(envoy_config_core_v3_HeaderValueOption *msg, envoy_config_core_v3_HeaderValue* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), envoy_config_core_v3_HeaderValue*) = value;
-}
-UPB_INLINE struct envoy_config_core_v3_HeaderValue* envoy_config_core_v3_HeaderValueOption_mutable_header(envoy_config_core_v3_HeaderValueOption *msg, upb_arena *arena) {
- struct envoy_config_core_v3_HeaderValue* sub = (struct envoy_config_core_v3_HeaderValue*)envoy_config_core_v3_HeaderValueOption_header(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_HeaderValue*)_upb_msg_new(&envoy_config_core_v3_HeaderValue_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_HeaderValueOption_set_header(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_core_v3_HeaderValueOption_set_append(envoy_config_core_v3_HeaderValueOption *msg, struct google_protobuf_BoolValue* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_BoolValue*) = value;
-}
-UPB_INLINE struct google_protobuf_BoolValue* envoy_config_core_v3_HeaderValueOption_mutable_append(envoy_config_core_v3_HeaderValueOption *msg, upb_arena *arena) {
- struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_core_v3_HeaderValueOption_append(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_BoolValue*)_upb_msg_new(&google_protobuf_BoolValue_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_HeaderValueOption_set_append(msg, sub);
- }
- return sub;
-}
-
-/* envoy.config.core.v3.HeaderMap */
-
-UPB_INLINE envoy_config_core_v3_HeaderMap *envoy_config_core_v3_HeaderMap_new(upb_arena *arena) {
- return (envoy_config_core_v3_HeaderMap *)_upb_msg_new(&envoy_config_core_v3_HeaderMap_msginit, arena);
-}
-UPB_INLINE envoy_config_core_v3_HeaderMap *envoy_config_core_v3_HeaderMap_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_core_v3_HeaderMap *ret = envoy_config_core_v3_HeaderMap_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_HeaderMap_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_core_v3_HeaderMap_serialize(const envoy_config_core_v3_HeaderMap *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_core_v3_HeaderMap_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_config_core_v3_HeaderMap_has_headers(const envoy_config_core_v3_HeaderMap *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE const envoy_config_core_v3_HeaderValue* const* envoy_config_core_v3_HeaderMap_headers(const envoy_config_core_v3_HeaderMap *msg, size_t *len) { return (const envoy_config_core_v3_HeaderValue* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
-
-UPB_INLINE envoy_config_core_v3_HeaderValue** envoy_config_core_v3_HeaderMap_mutable_headers(envoy_config_core_v3_HeaderMap *msg, size_t *len) {
- return (envoy_config_core_v3_HeaderValue**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
-}
-UPB_INLINE envoy_config_core_v3_HeaderValue** envoy_config_core_v3_HeaderMap_resize_headers(envoy_config_core_v3_HeaderMap *msg, size_t len, upb_arena *arena) {
- return (envoy_config_core_v3_HeaderValue**)_upb_array_resize_accessor(msg, UPB_SIZE(0, 0), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_config_core_v3_HeaderValue* envoy_config_core_v3_HeaderMap_add_headers(envoy_config_core_v3_HeaderMap *msg, upb_arena *arena) {
- struct envoy_config_core_v3_HeaderValue* sub = (struct envoy_config_core_v3_HeaderValue*)_upb_msg_new(&envoy_config_core_v3_HeaderValue_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(0, 0), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-
-/* envoy.config.core.v3.DataSource */
-
-UPB_INLINE envoy_config_core_v3_DataSource *envoy_config_core_v3_DataSource_new(upb_arena *arena) {
- return (envoy_config_core_v3_DataSource *)_upb_msg_new(&envoy_config_core_v3_DataSource_msginit, arena);
-}
-UPB_INLINE envoy_config_core_v3_DataSource *envoy_config_core_v3_DataSource_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_core_v3_DataSource *ret = envoy_config_core_v3_DataSource_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_DataSource_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_core_v3_DataSource_serialize(const envoy_config_core_v3_DataSource *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_core_v3_DataSource_msginit, arena, len);
-}
-
-typedef enum {
- envoy_config_core_v3_DataSource_specifier_filename = 1,
- envoy_config_core_v3_DataSource_specifier_inline_bytes = 2,
- envoy_config_core_v3_DataSource_specifier_inline_string = 3,
- envoy_config_core_v3_DataSource_specifier_NOT_SET = 0
-} envoy_config_core_v3_DataSource_specifier_oneofcases;
-UPB_INLINE envoy_config_core_v3_DataSource_specifier_oneofcases envoy_config_core_v3_DataSource_specifier_case(const envoy_config_core_v3_DataSource* msg) { return (envoy_config_core_v3_DataSource_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(8, 16), int32_t); }
-
-UPB_INLINE bool envoy_config_core_v3_DataSource_has_filename(const envoy_config_core_v3_DataSource *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 1; }
-UPB_INLINE upb_strview envoy_config_core_v3_DataSource_filename(const envoy_config_core_v3_DataSource *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 1, upb_strview_make("", strlen(""))); }
-UPB_INLINE bool envoy_config_core_v3_DataSource_has_inline_bytes(const envoy_config_core_v3_DataSource *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 2; }
-UPB_INLINE upb_strview envoy_config_core_v3_DataSource_inline_bytes(const envoy_config_core_v3_DataSource *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 2, upb_strview_make("", strlen(""))); }
-UPB_INLINE bool envoy_config_core_v3_DataSource_has_inline_string(const envoy_config_core_v3_DataSource *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 3; }
-UPB_INLINE upb_strview envoy_config_core_v3_DataSource_inline_string(const envoy_config_core_v3_DataSource *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 3, upb_strview_make("", strlen(""))); }
-
-UPB_INLINE void envoy_config_core_v3_DataSource_set_filename(envoy_config_core_v3_DataSource *msg, upb_strview value) {
- UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 1);
-}
-UPB_INLINE void envoy_config_core_v3_DataSource_set_inline_bytes(envoy_config_core_v3_DataSource *msg, upb_strview value) {
- UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 2);
-}
-UPB_INLINE void envoy_config_core_v3_DataSource_set_inline_string(envoy_config_core_v3_DataSource *msg, upb_strview value) {
- UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 3);
-}
-
-/* envoy.config.core.v3.RetryPolicy */
-
-UPB_INLINE envoy_config_core_v3_RetryPolicy *envoy_config_core_v3_RetryPolicy_new(upb_arena *arena) {
- return (envoy_config_core_v3_RetryPolicy *)_upb_msg_new(&envoy_config_core_v3_RetryPolicy_msginit, arena);
-}
-UPB_INLINE envoy_config_core_v3_RetryPolicy *envoy_config_core_v3_RetryPolicy_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_core_v3_RetryPolicy *ret = envoy_config_core_v3_RetryPolicy_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_RetryPolicy_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_core_v3_RetryPolicy_serialize(const envoy_config_core_v3_RetryPolicy *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_core_v3_RetryPolicy_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_config_core_v3_RetryPolicy_has_retry_back_off(const envoy_config_core_v3_RetryPolicy *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE const struct envoy_config_core_v3_BackoffStrategy* envoy_config_core_v3_RetryPolicy_retry_back_off(const envoy_config_core_v3_RetryPolicy *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct envoy_config_core_v3_BackoffStrategy*); }
-UPB_INLINE bool envoy_config_core_v3_RetryPolicy_has_num_retries(const envoy_config_core_v3_RetryPolicy *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
-UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_core_v3_RetryPolicy_num_retries(const envoy_config_core_v3_RetryPolicy *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_UInt32Value*); }
-
-UPB_INLINE void envoy_config_core_v3_RetryPolicy_set_retry_back_off(envoy_config_core_v3_RetryPolicy *msg, struct envoy_config_core_v3_BackoffStrategy* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct envoy_config_core_v3_BackoffStrategy*) = value;
-}
-UPB_INLINE struct envoy_config_core_v3_BackoffStrategy* envoy_config_core_v3_RetryPolicy_mutable_retry_back_off(envoy_config_core_v3_RetryPolicy *msg, upb_arena *arena) {
- struct envoy_config_core_v3_BackoffStrategy* sub = (struct envoy_config_core_v3_BackoffStrategy*)envoy_config_core_v3_RetryPolicy_retry_back_off(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_BackoffStrategy*)_upb_msg_new(&envoy_config_core_v3_BackoffStrategy_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_RetryPolicy_set_retry_back_off(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_core_v3_RetryPolicy_set_num_retries(envoy_config_core_v3_RetryPolicy *msg, struct google_protobuf_UInt32Value* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_UInt32Value*) = value;
-}
-UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_RetryPolicy_mutable_num_retries(envoy_config_core_v3_RetryPolicy *msg, upb_arena *arena) {
- struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_core_v3_RetryPolicy_num_retries(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_RetryPolicy_set_num_retries(msg, sub);
- }
- return sub;
-}
-
-/* envoy.config.core.v3.RemoteDataSource */
-
-UPB_INLINE envoy_config_core_v3_RemoteDataSource *envoy_config_core_v3_RemoteDataSource_new(upb_arena *arena) {
- return (envoy_config_core_v3_RemoteDataSource *)_upb_msg_new(&envoy_config_core_v3_RemoteDataSource_msginit, arena);
-}
-UPB_INLINE envoy_config_core_v3_RemoteDataSource *envoy_config_core_v3_RemoteDataSource_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_core_v3_RemoteDataSource *ret = envoy_config_core_v3_RemoteDataSource_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_RemoteDataSource_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_core_v3_RemoteDataSource_serialize(const envoy_config_core_v3_RemoteDataSource *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_core_v3_RemoteDataSource_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_config_core_v3_RemoteDataSource_has_http_uri(const envoy_config_core_v3_RemoteDataSource *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const struct envoy_config_core_v3_HttpUri* envoy_config_core_v3_RemoteDataSource_http_uri(const envoy_config_core_v3_RemoteDataSource *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct envoy_config_core_v3_HttpUri*); }
-UPB_INLINE upb_strview envoy_config_core_v3_RemoteDataSource_sha256(const envoy_config_core_v3_RemoteDataSource *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE bool envoy_config_core_v3_RemoteDataSource_has_retry_policy(const envoy_config_core_v3_RemoteDataSource *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
-UPB_INLINE const envoy_config_core_v3_RetryPolicy* envoy_config_core_v3_RemoteDataSource_retry_policy(const envoy_config_core_v3_RemoteDataSource *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const envoy_config_core_v3_RetryPolicy*); }
-
-UPB_INLINE void envoy_config_core_v3_RemoteDataSource_set_http_uri(envoy_config_core_v3_RemoteDataSource *msg, struct envoy_config_core_v3_HttpUri* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct envoy_config_core_v3_HttpUri*) = value;
-}
-UPB_INLINE struct envoy_config_core_v3_HttpUri* envoy_config_core_v3_RemoteDataSource_mutable_http_uri(envoy_config_core_v3_RemoteDataSource *msg, upb_arena *arena) {
- struct envoy_config_core_v3_HttpUri* sub = (struct envoy_config_core_v3_HttpUri*)envoy_config_core_v3_RemoteDataSource_http_uri(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_HttpUri*)_upb_msg_new(&envoy_config_core_v3_HttpUri_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_RemoteDataSource_set_http_uri(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_core_v3_RemoteDataSource_set_sha256(envoy_config_core_v3_RemoteDataSource *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_core_v3_RemoteDataSource_set_retry_policy(envoy_config_core_v3_RemoteDataSource *msg, envoy_config_core_v3_RetryPolicy* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), envoy_config_core_v3_RetryPolicy*) = value;
-}
-UPB_INLINE struct envoy_config_core_v3_RetryPolicy* envoy_config_core_v3_RemoteDataSource_mutable_retry_policy(envoy_config_core_v3_RemoteDataSource *msg, upb_arena *arena) {
- struct envoy_config_core_v3_RetryPolicy* sub = (struct envoy_config_core_v3_RetryPolicy*)envoy_config_core_v3_RemoteDataSource_retry_policy(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_RetryPolicy*)_upb_msg_new(&envoy_config_core_v3_RetryPolicy_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_RemoteDataSource_set_retry_policy(msg, sub);
- }
- return sub;
-}
-
-/* envoy.config.core.v3.AsyncDataSource */
-
-UPB_INLINE envoy_config_core_v3_AsyncDataSource *envoy_config_core_v3_AsyncDataSource_new(upb_arena *arena) {
- return (envoy_config_core_v3_AsyncDataSource *)_upb_msg_new(&envoy_config_core_v3_AsyncDataSource_msginit, arena);
-}
-UPB_INLINE envoy_config_core_v3_AsyncDataSource *envoy_config_core_v3_AsyncDataSource_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_core_v3_AsyncDataSource *ret = envoy_config_core_v3_AsyncDataSource_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_AsyncDataSource_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_core_v3_AsyncDataSource_serialize(const envoy_config_core_v3_AsyncDataSource *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_core_v3_AsyncDataSource_msginit, arena, len);
-}
-
-typedef enum {
- envoy_config_core_v3_AsyncDataSource_specifier_local = 1,
- envoy_config_core_v3_AsyncDataSource_specifier_remote = 2,
- envoy_config_core_v3_AsyncDataSource_specifier_NOT_SET = 0
-} envoy_config_core_v3_AsyncDataSource_specifier_oneofcases;
-UPB_INLINE envoy_config_core_v3_AsyncDataSource_specifier_oneofcases envoy_config_core_v3_AsyncDataSource_specifier_case(const envoy_config_core_v3_AsyncDataSource* msg) { return (envoy_config_core_v3_AsyncDataSource_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 8), int32_t); }
-
-UPB_INLINE bool envoy_config_core_v3_AsyncDataSource_has_local(const envoy_config_core_v3_AsyncDataSource *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 1; }
-UPB_INLINE const envoy_config_core_v3_DataSource* envoy_config_core_v3_AsyncDataSource_local(const envoy_config_core_v3_AsyncDataSource *msg) { return UPB_READ_ONEOF(msg, const envoy_config_core_v3_DataSource*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 1, NULL); }
-UPB_INLINE bool envoy_config_core_v3_AsyncDataSource_has_remote(const envoy_config_core_v3_AsyncDataSource *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 2; }
-UPB_INLINE const envoy_config_core_v3_RemoteDataSource* envoy_config_core_v3_AsyncDataSource_remote(const envoy_config_core_v3_AsyncDataSource *msg) { return UPB_READ_ONEOF(msg, const envoy_config_core_v3_RemoteDataSource*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 2, NULL); }
-
-UPB_INLINE void envoy_config_core_v3_AsyncDataSource_set_local(envoy_config_core_v3_AsyncDataSource *msg, envoy_config_core_v3_DataSource* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_core_v3_DataSource*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 1);
-}
-UPB_INLINE struct envoy_config_core_v3_DataSource* envoy_config_core_v3_AsyncDataSource_mutable_local(envoy_config_core_v3_AsyncDataSource *msg, upb_arena *arena) {
- struct envoy_config_core_v3_DataSource* sub = (struct envoy_config_core_v3_DataSource*)envoy_config_core_v3_AsyncDataSource_local(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_DataSource*)_upb_msg_new(&envoy_config_core_v3_DataSource_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_AsyncDataSource_set_local(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_core_v3_AsyncDataSource_set_remote(envoy_config_core_v3_AsyncDataSource *msg, envoy_config_core_v3_RemoteDataSource* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_core_v3_RemoteDataSource*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 2);
-}
-UPB_INLINE struct envoy_config_core_v3_RemoteDataSource* envoy_config_core_v3_AsyncDataSource_mutable_remote(envoy_config_core_v3_AsyncDataSource *msg, upb_arena *arena) {
- struct envoy_config_core_v3_RemoteDataSource* sub = (struct envoy_config_core_v3_RemoteDataSource*)envoy_config_core_v3_AsyncDataSource_remote(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_RemoteDataSource*)_upb_msg_new(&envoy_config_core_v3_RemoteDataSource_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_AsyncDataSource_set_remote(msg, sub);
- }
- return sub;
-}
-
-/* envoy.config.core.v3.TransportSocket */
-
-UPB_INLINE envoy_config_core_v3_TransportSocket *envoy_config_core_v3_TransportSocket_new(upb_arena *arena) {
- return (envoy_config_core_v3_TransportSocket *)_upb_msg_new(&envoy_config_core_v3_TransportSocket_msginit, arena);
-}
-UPB_INLINE envoy_config_core_v3_TransportSocket *envoy_config_core_v3_TransportSocket_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_core_v3_TransportSocket *ret = envoy_config_core_v3_TransportSocket_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_TransportSocket_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_core_v3_TransportSocket_serialize(const envoy_config_core_v3_TransportSocket *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_core_v3_TransportSocket_msginit, arena, len);
-}
-
-typedef enum {
- envoy_config_core_v3_TransportSocket_config_type_typed_config = 3,
- envoy_config_core_v3_TransportSocket_config_type_NOT_SET = 0
-} envoy_config_core_v3_TransportSocket_config_type_oneofcases;
-UPB_INLINE envoy_config_core_v3_TransportSocket_config_type_oneofcases envoy_config_core_v3_TransportSocket_config_type_case(const envoy_config_core_v3_TransportSocket* msg) { return (envoy_config_core_v3_TransportSocket_config_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(12, 24), int32_t); }
-
-UPB_INLINE upb_strview envoy_config_core_v3_TransportSocket_name(const envoy_config_core_v3_TransportSocket *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE bool envoy_config_core_v3_TransportSocket_has_typed_config(const envoy_config_core_v3_TransportSocket *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 3; }
-UPB_INLINE const struct google_protobuf_Any* envoy_config_core_v3_TransportSocket_typed_config(const envoy_config_core_v3_TransportSocket *msg) { return UPB_READ_ONEOF(msg, const struct google_protobuf_Any*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 3, NULL); }
-
-UPB_INLINE void envoy_config_core_v3_TransportSocket_set_name(envoy_config_core_v3_TransportSocket *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_core_v3_TransportSocket_set_typed_config(envoy_config_core_v3_TransportSocket *msg, struct google_protobuf_Any* value) {
- UPB_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 3);
-}
-UPB_INLINE struct google_protobuf_Any* envoy_config_core_v3_TransportSocket_mutable_typed_config(envoy_config_core_v3_TransportSocket *msg, upb_arena *arena) {
- struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_config_core_v3_TransportSocket_typed_config(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_TransportSocket_set_typed_config(msg, sub);
- }
- return sub;
-}
-
-/* envoy.config.core.v3.RuntimeFractionalPercent */
-
-UPB_INLINE envoy_config_core_v3_RuntimeFractionalPercent *envoy_config_core_v3_RuntimeFractionalPercent_new(upb_arena *arena) {
- return (envoy_config_core_v3_RuntimeFractionalPercent *)_upb_msg_new(&envoy_config_core_v3_RuntimeFractionalPercent_msginit, arena);
-}
-UPB_INLINE envoy_config_core_v3_RuntimeFractionalPercent *envoy_config_core_v3_RuntimeFractionalPercent_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_core_v3_RuntimeFractionalPercent *ret = envoy_config_core_v3_RuntimeFractionalPercent_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_RuntimeFractionalPercent_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_core_v3_RuntimeFractionalPercent_serialize(const envoy_config_core_v3_RuntimeFractionalPercent *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_core_v3_RuntimeFractionalPercent_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_config_core_v3_RuntimeFractionalPercent_has_default_value(const envoy_config_core_v3_RuntimeFractionalPercent *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const struct envoy_type_v3_FractionalPercent* envoy_config_core_v3_RuntimeFractionalPercent_default_value(const envoy_config_core_v3_RuntimeFractionalPercent *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct envoy_type_v3_FractionalPercent*); }
-UPB_INLINE upb_strview envoy_config_core_v3_RuntimeFractionalPercent_runtime_key(const envoy_config_core_v3_RuntimeFractionalPercent *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-
-UPB_INLINE void envoy_config_core_v3_RuntimeFractionalPercent_set_default_value(envoy_config_core_v3_RuntimeFractionalPercent *msg, struct envoy_type_v3_FractionalPercent* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct envoy_type_v3_FractionalPercent*) = value;
-}
-UPB_INLINE struct envoy_type_v3_FractionalPercent* envoy_config_core_v3_RuntimeFractionalPercent_mutable_default_value(envoy_config_core_v3_RuntimeFractionalPercent *msg, upb_arena *arena) {
- struct envoy_type_v3_FractionalPercent* sub = (struct envoy_type_v3_FractionalPercent*)envoy_config_core_v3_RuntimeFractionalPercent_default_value(msg);
- if (sub == NULL) {
- sub = (struct envoy_type_v3_FractionalPercent*)_upb_msg_new(&envoy_type_v3_FractionalPercent_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_RuntimeFractionalPercent_set_default_value(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_core_v3_RuntimeFractionalPercent_set_runtime_key(envoy_config_core_v3_RuntimeFractionalPercent *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-
-/* envoy.config.core.v3.ControlPlane */
-
-UPB_INLINE envoy_config_core_v3_ControlPlane *envoy_config_core_v3_ControlPlane_new(upb_arena *arena) {
- return (envoy_config_core_v3_ControlPlane *)_upb_msg_new(&envoy_config_core_v3_ControlPlane_msginit, arena);
-}
-UPB_INLINE envoy_config_core_v3_ControlPlane *envoy_config_core_v3_ControlPlane_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_core_v3_ControlPlane *ret = envoy_config_core_v3_ControlPlane_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_ControlPlane_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_core_v3_ControlPlane_serialize(const envoy_config_core_v3_ControlPlane *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_core_v3_ControlPlane_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview envoy_config_core_v3_ControlPlane_identifier(const envoy_config_core_v3_ControlPlane *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-
-UPB_INLINE void envoy_config_core_v3_ControlPlane_set_identifier(envoy_config_core_v3_ControlPlane *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* ENVOY_CONFIG_CORE_V3_BASE_PROTO_UPB_H_ */
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/core/v3/base.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_CONFIG_CORE_V3_BASE_PROTO_UPB_H_
+#define ENVOY_CONFIG_CORE_V3_BASE_PROTO_UPB_H_
+
+#include "upb/msg.h"
+#include "upb/decode.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_config_core_v3_Locality;
+struct envoy_config_core_v3_BuildVersion;
+struct envoy_config_core_v3_Extension;
+struct envoy_config_core_v3_Node;
+struct envoy_config_core_v3_Metadata;
+struct envoy_config_core_v3_Metadata_FilterMetadataEntry;
+struct envoy_config_core_v3_RuntimeUInt32;
+struct envoy_config_core_v3_RuntimeDouble;
+struct envoy_config_core_v3_RuntimeFeatureFlag;
+struct envoy_config_core_v3_HeaderValue;
+struct envoy_config_core_v3_HeaderValueOption;
+struct envoy_config_core_v3_HeaderMap;
+struct envoy_config_core_v3_DataSource;
+struct envoy_config_core_v3_RetryPolicy;
+struct envoy_config_core_v3_RemoteDataSource;
+struct envoy_config_core_v3_AsyncDataSource;
+struct envoy_config_core_v3_TransportSocket;
+struct envoy_config_core_v3_RuntimeFractionalPercent;
+struct envoy_config_core_v3_ControlPlane;
+typedef struct envoy_config_core_v3_Locality envoy_config_core_v3_Locality;
+typedef struct envoy_config_core_v3_BuildVersion envoy_config_core_v3_BuildVersion;
+typedef struct envoy_config_core_v3_Extension envoy_config_core_v3_Extension;
+typedef struct envoy_config_core_v3_Node envoy_config_core_v3_Node;
+typedef struct envoy_config_core_v3_Metadata envoy_config_core_v3_Metadata;
+typedef struct envoy_config_core_v3_Metadata_FilterMetadataEntry envoy_config_core_v3_Metadata_FilterMetadataEntry;
+typedef struct envoy_config_core_v3_RuntimeUInt32 envoy_config_core_v3_RuntimeUInt32;
+typedef struct envoy_config_core_v3_RuntimeDouble envoy_config_core_v3_RuntimeDouble;
+typedef struct envoy_config_core_v3_RuntimeFeatureFlag envoy_config_core_v3_RuntimeFeatureFlag;
+typedef struct envoy_config_core_v3_HeaderValue envoy_config_core_v3_HeaderValue;
+typedef struct envoy_config_core_v3_HeaderValueOption envoy_config_core_v3_HeaderValueOption;
+typedef struct envoy_config_core_v3_HeaderMap envoy_config_core_v3_HeaderMap;
+typedef struct envoy_config_core_v3_DataSource envoy_config_core_v3_DataSource;
+typedef struct envoy_config_core_v3_RetryPolicy envoy_config_core_v3_RetryPolicy;
+typedef struct envoy_config_core_v3_RemoteDataSource envoy_config_core_v3_RemoteDataSource;
+typedef struct envoy_config_core_v3_AsyncDataSource envoy_config_core_v3_AsyncDataSource;
+typedef struct envoy_config_core_v3_TransportSocket envoy_config_core_v3_TransportSocket;
+typedef struct envoy_config_core_v3_RuntimeFractionalPercent envoy_config_core_v3_RuntimeFractionalPercent;
+typedef struct envoy_config_core_v3_ControlPlane envoy_config_core_v3_ControlPlane;
+extern const upb_msglayout envoy_config_core_v3_Locality_msginit;
+extern const upb_msglayout envoy_config_core_v3_BuildVersion_msginit;
+extern const upb_msglayout envoy_config_core_v3_Extension_msginit;
+extern const upb_msglayout envoy_config_core_v3_Node_msginit;
+extern const upb_msglayout envoy_config_core_v3_Metadata_msginit;
+extern const upb_msglayout envoy_config_core_v3_Metadata_FilterMetadataEntry_msginit;
+extern const upb_msglayout envoy_config_core_v3_RuntimeUInt32_msginit;
+extern const upb_msglayout envoy_config_core_v3_RuntimeDouble_msginit;
+extern const upb_msglayout envoy_config_core_v3_RuntimeFeatureFlag_msginit;
+extern const upb_msglayout envoy_config_core_v3_HeaderValue_msginit;
+extern const upb_msglayout envoy_config_core_v3_HeaderValueOption_msginit;
+extern const upb_msglayout envoy_config_core_v3_HeaderMap_msginit;
+extern const upb_msglayout envoy_config_core_v3_DataSource_msginit;
+extern const upb_msglayout envoy_config_core_v3_RetryPolicy_msginit;
+extern const upb_msglayout envoy_config_core_v3_RemoteDataSource_msginit;
+extern const upb_msglayout envoy_config_core_v3_AsyncDataSource_msginit;
+extern const upb_msglayout envoy_config_core_v3_TransportSocket_msginit;
+extern const upb_msglayout envoy_config_core_v3_RuntimeFractionalPercent_msginit;
+extern const upb_msglayout envoy_config_core_v3_ControlPlane_msginit;
+struct envoy_config_core_v3_Address;
+struct envoy_config_core_v3_BackoffStrategy;
+struct envoy_config_core_v3_HttpUri;
+struct envoy_type_v3_FractionalPercent;
+struct envoy_type_v3_SemanticVersion;
+struct google_protobuf_Any;
+struct google_protobuf_BoolValue;
+struct google_protobuf_Struct;
+struct google_protobuf_UInt32Value;
+extern const upb_msglayout envoy_config_core_v3_Address_msginit;
+extern const upb_msglayout envoy_config_core_v3_BackoffStrategy_msginit;
+extern const upb_msglayout envoy_config_core_v3_HttpUri_msginit;
+extern const upb_msglayout envoy_type_v3_FractionalPercent_msginit;
+extern const upb_msglayout envoy_type_v3_SemanticVersion_msginit;
+extern const upb_msglayout google_protobuf_Any_msginit;
+extern const upb_msglayout google_protobuf_BoolValue_msginit;
+extern const upb_msglayout google_protobuf_Struct_msginit;
+extern const upb_msglayout google_protobuf_UInt32Value_msginit;
+
+typedef enum {
+ envoy_config_core_v3_METHOD_UNSPECIFIED = 0,
+ envoy_config_core_v3_GET = 1,
+ envoy_config_core_v3_HEAD = 2,
+ envoy_config_core_v3_POST = 3,
+ envoy_config_core_v3_PUT = 4,
+ envoy_config_core_v3_DELETE = 5,
+ envoy_config_core_v3_CONNECT = 6,
+ envoy_config_core_v3_OPTIONS = 7,
+ envoy_config_core_v3_TRACE = 8,
+ envoy_config_core_v3_PATCH = 9
+} envoy_config_core_v3_RequestMethod;
+
+typedef enum {
+ envoy_config_core_v3_DEFAULT = 0,
+ envoy_config_core_v3_HIGH = 1
+} envoy_config_core_v3_RoutingPriority;
+
+typedef enum {
+ envoy_config_core_v3_UNSPECIFIED = 0,
+ envoy_config_core_v3_INBOUND = 1,
+ envoy_config_core_v3_OUTBOUND = 2
+} envoy_config_core_v3_TrafficDirection;
+
+
+/* envoy.config.core.v3.Locality */
+
+UPB_INLINE envoy_config_core_v3_Locality *envoy_config_core_v3_Locality_new(upb_arena *arena) {
+ return (envoy_config_core_v3_Locality *)_upb_msg_new(&envoy_config_core_v3_Locality_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_Locality *envoy_config_core_v3_Locality_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_core_v3_Locality *ret = envoy_config_core_v3_Locality_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_Locality_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_core_v3_Locality_serialize(const envoy_config_core_v3_Locality *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_core_v3_Locality_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview envoy_config_core_v3_Locality_region(const envoy_config_core_v3_Locality *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE upb_strview envoy_config_core_v3_Locality_zone(const envoy_config_core_v3_Locality *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview); }
+UPB_INLINE upb_strview envoy_config_core_v3_Locality_sub_zone(const envoy_config_core_v3_Locality *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_strview); }
+
+UPB_INLINE void envoy_config_core_v3_Locality_set_region(envoy_config_core_v3_Locality *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_core_v3_Locality_set_zone(envoy_config_core_v3_Locality *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_core_v3_Locality_set_sub_zone(envoy_config_core_v3_Locality *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_strview) = value;
+}
+
+/* envoy.config.core.v3.BuildVersion */
+
+UPB_INLINE envoy_config_core_v3_BuildVersion *envoy_config_core_v3_BuildVersion_new(upb_arena *arena) {
+ return (envoy_config_core_v3_BuildVersion *)_upb_msg_new(&envoy_config_core_v3_BuildVersion_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_BuildVersion *envoy_config_core_v3_BuildVersion_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_core_v3_BuildVersion *ret = envoy_config_core_v3_BuildVersion_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_BuildVersion_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_core_v3_BuildVersion_serialize(const envoy_config_core_v3_BuildVersion *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_core_v3_BuildVersion_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_core_v3_BuildVersion_has_version(const envoy_config_core_v3_BuildVersion *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE const struct envoy_type_v3_SemanticVersion* envoy_config_core_v3_BuildVersion_version(const envoy_config_core_v3_BuildVersion *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct envoy_type_v3_SemanticVersion*); }
+UPB_INLINE bool envoy_config_core_v3_BuildVersion_has_metadata(const envoy_config_core_v3_BuildVersion *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
+UPB_INLINE const struct google_protobuf_Struct* envoy_config_core_v3_BuildVersion_metadata(const envoy_config_core_v3_BuildVersion *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_Struct*); }
+
+UPB_INLINE void envoy_config_core_v3_BuildVersion_set_version(envoy_config_core_v3_BuildVersion *msg, struct envoy_type_v3_SemanticVersion* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct envoy_type_v3_SemanticVersion*) = value;
+}
+UPB_INLINE struct envoy_type_v3_SemanticVersion* envoy_config_core_v3_BuildVersion_mutable_version(envoy_config_core_v3_BuildVersion *msg, upb_arena *arena) {
+ struct envoy_type_v3_SemanticVersion* sub = (struct envoy_type_v3_SemanticVersion*)envoy_config_core_v3_BuildVersion_version(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_type_v3_SemanticVersion*)_upb_msg_new(&envoy_type_v3_SemanticVersion_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_BuildVersion_set_version(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_BuildVersion_set_metadata(envoy_config_core_v3_BuildVersion *msg, struct google_protobuf_Struct* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_Struct*) = value;
+}
+UPB_INLINE struct google_protobuf_Struct* envoy_config_core_v3_BuildVersion_mutable_metadata(envoy_config_core_v3_BuildVersion *msg, upb_arena *arena) {
+ struct google_protobuf_Struct* sub = (struct google_protobuf_Struct*)envoy_config_core_v3_BuildVersion_metadata(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Struct*)_upb_msg_new(&google_protobuf_Struct_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_BuildVersion_set_metadata(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.core.v3.Extension */
+
+UPB_INLINE envoy_config_core_v3_Extension *envoy_config_core_v3_Extension_new(upb_arena *arena) {
+ return (envoy_config_core_v3_Extension *)_upb_msg_new(&envoy_config_core_v3_Extension_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_Extension *envoy_config_core_v3_Extension_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_core_v3_Extension *ret = envoy_config_core_v3_Extension_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_Extension_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_core_v3_Extension_serialize(const envoy_config_core_v3_Extension *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_core_v3_Extension_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview envoy_config_core_v3_Extension_name(const envoy_config_core_v3_Extension *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
+UPB_INLINE upb_strview envoy_config_core_v3_Extension_category(const envoy_config_core_v3_Extension *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview); }
+UPB_INLINE upb_strview envoy_config_core_v3_Extension_type_descriptor(const envoy_config_core_v3_Extension *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_strview); }
+UPB_INLINE bool envoy_config_core_v3_Extension_has_version(const envoy_config_core_v3_Extension *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 56)); }
+UPB_INLINE const envoy_config_core_v3_BuildVersion* envoy_config_core_v3_Extension_version(const envoy_config_core_v3_Extension *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 56), const envoy_config_core_v3_BuildVersion*); }
+UPB_INLINE bool envoy_config_core_v3_Extension_disabled(const envoy_config_core_v3_Extension *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); }
+
+UPB_INLINE void envoy_config_core_v3_Extension_set_name(envoy_config_core_v3_Extension *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_core_v3_Extension_set_category(envoy_config_core_v3_Extension *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_core_v3_Extension_set_type_descriptor(envoy_config_core_v3_Extension *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_core_v3_Extension_set_version(envoy_config_core_v3_Extension *msg, envoy_config_core_v3_BuildVersion* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 56), envoy_config_core_v3_BuildVersion*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_BuildVersion* envoy_config_core_v3_Extension_mutable_version(envoy_config_core_v3_Extension *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_BuildVersion* sub = (struct envoy_config_core_v3_BuildVersion*)envoy_config_core_v3_Extension_version(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_BuildVersion*)_upb_msg_new(&envoy_config_core_v3_BuildVersion_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_Extension_set_version(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_Extension_set_disabled(envoy_config_core_v3_Extension *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
+}
+
+/* envoy.config.core.v3.Node */
+
+UPB_INLINE envoy_config_core_v3_Node *envoy_config_core_v3_Node_new(upb_arena *arena) {
+ return (envoy_config_core_v3_Node *)_upb_msg_new(&envoy_config_core_v3_Node_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_Node *envoy_config_core_v3_Node_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_core_v3_Node *ret = envoy_config_core_v3_Node_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_Node_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_core_v3_Node_serialize(const envoy_config_core_v3_Node *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_core_v3_Node_msginit, arena, len);
+}
+
+typedef enum {
+ envoy_config_core_v3_Node_user_agent_version_type_user_agent_version = 7,
+ envoy_config_core_v3_Node_user_agent_version_type_user_agent_build_version = 8,
+ envoy_config_core_v3_Node_user_agent_version_type_NOT_SET = 0
+} envoy_config_core_v3_Node_user_agent_version_type_oneofcases;
+UPB_INLINE envoy_config_core_v3_Node_user_agent_version_type_oneofcases envoy_config_core_v3_Node_user_agent_version_type_case(const envoy_config_core_v3_Node* msg) { return (envoy_config_core_v3_Node_user_agent_version_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(52, 104), int32_t); }
+
+UPB_INLINE upb_strview envoy_config_core_v3_Node_id(const envoy_config_core_v3_Node *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE upb_strview envoy_config_core_v3_Node_cluster(const envoy_config_core_v3_Node *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview); }
+UPB_INLINE bool envoy_config_core_v3_Node_has_metadata(const envoy_config_core_v3_Node *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 48)); }
+UPB_INLINE const struct google_protobuf_Struct* envoy_config_core_v3_Node_metadata(const envoy_config_core_v3_Node *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 48), const struct google_protobuf_Struct*); }
+UPB_INLINE bool envoy_config_core_v3_Node_has_locality(const envoy_config_core_v3_Node *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 56)); }
+UPB_INLINE const envoy_config_core_v3_Locality* envoy_config_core_v3_Node_locality(const envoy_config_core_v3_Node *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 56), const envoy_config_core_v3_Locality*); }
+UPB_INLINE upb_strview envoy_config_core_v3_Node_user_agent_name(const envoy_config_core_v3_Node *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_strview); }
+UPB_INLINE bool envoy_config_core_v3_Node_has_user_agent_version(const envoy_config_core_v3_Node *msg) { return _upb_getoneofcase(msg, UPB_SIZE(52, 104)) == 7; }
+UPB_INLINE upb_strview envoy_config_core_v3_Node_user_agent_version(const envoy_config_core_v3_Node *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(44, 88), UPB_SIZE(52, 104), 7, upb_strview_make("", strlen(""))); }
+UPB_INLINE bool envoy_config_core_v3_Node_has_user_agent_build_version(const envoy_config_core_v3_Node *msg) { return _upb_getoneofcase(msg, UPB_SIZE(52, 104)) == 8; }
+UPB_INLINE const envoy_config_core_v3_BuildVersion* envoy_config_core_v3_Node_user_agent_build_version(const envoy_config_core_v3_Node *msg) { return UPB_READ_ONEOF(msg, const envoy_config_core_v3_BuildVersion*, UPB_SIZE(44, 88), UPB_SIZE(52, 104), 8, NULL); }
+UPB_INLINE bool envoy_config_core_v3_Node_has_extensions(const envoy_config_core_v3_Node *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(32, 64)); }
+UPB_INLINE const envoy_config_core_v3_Extension* const* envoy_config_core_v3_Node_extensions(const envoy_config_core_v3_Node *msg, size_t *len) { return (const envoy_config_core_v3_Extension* const*)_upb_array_accessor(msg, UPB_SIZE(32, 64), len); }
+UPB_INLINE upb_strview const* envoy_config_core_v3_Node_client_features(const envoy_config_core_v3_Node *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(36, 72), len); }
+UPB_INLINE bool envoy_config_core_v3_Node_has_listening_addresses(const envoy_config_core_v3_Node *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(40, 80)); }
+UPB_INLINE const struct envoy_config_core_v3_Address* const* envoy_config_core_v3_Node_listening_addresses(const envoy_config_core_v3_Node *msg, size_t *len) { return (const struct envoy_config_core_v3_Address* const*)_upb_array_accessor(msg, UPB_SIZE(40, 80), len); }
+
+UPB_INLINE void envoy_config_core_v3_Node_set_id(envoy_config_core_v3_Node *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_core_v3_Node_set_cluster(envoy_config_core_v3_Node *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_core_v3_Node_set_metadata(envoy_config_core_v3_Node *msg, struct google_protobuf_Struct* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 48), struct google_protobuf_Struct*) = value;
+}
+UPB_INLINE struct google_protobuf_Struct* envoy_config_core_v3_Node_mutable_metadata(envoy_config_core_v3_Node *msg, upb_arena *arena) {
+ struct google_protobuf_Struct* sub = (struct google_protobuf_Struct*)envoy_config_core_v3_Node_metadata(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Struct*)_upb_msg_new(&google_protobuf_Struct_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_Node_set_metadata(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_Node_set_locality(envoy_config_core_v3_Node *msg, envoy_config_core_v3_Locality* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 56), envoy_config_core_v3_Locality*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_Locality* envoy_config_core_v3_Node_mutable_locality(envoy_config_core_v3_Node *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_Locality* sub = (struct envoy_config_core_v3_Locality*)envoy_config_core_v3_Node_locality(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_Locality*)_upb_msg_new(&envoy_config_core_v3_Locality_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_Node_set_locality(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_Node_set_user_agent_name(envoy_config_core_v3_Node *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_core_v3_Node_set_user_agent_version(envoy_config_core_v3_Node *msg, upb_strview value) {
+ UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(44, 88), value, UPB_SIZE(52, 104), 7);
+}
+UPB_INLINE void envoy_config_core_v3_Node_set_user_agent_build_version(envoy_config_core_v3_Node *msg, envoy_config_core_v3_BuildVersion* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_core_v3_BuildVersion*, UPB_SIZE(44, 88), value, UPB_SIZE(52, 104), 8);
+}
+UPB_INLINE struct envoy_config_core_v3_BuildVersion* envoy_config_core_v3_Node_mutable_user_agent_build_version(envoy_config_core_v3_Node *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_BuildVersion* sub = (struct envoy_config_core_v3_BuildVersion*)envoy_config_core_v3_Node_user_agent_build_version(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_BuildVersion*)_upb_msg_new(&envoy_config_core_v3_BuildVersion_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_Node_set_user_agent_build_version(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE envoy_config_core_v3_Extension** envoy_config_core_v3_Node_mutable_extensions(envoy_config_core_v3_Node *msg, size_t *len) {
+ return (envoy_config_core_v3_Extension**)_upb_array_mutable_accessor(msg, UPB_SIZE(32, 64), len);
+}
+UPB_INLINE envoy_config_core_v3_Extension** envoy_config_core_v3_Node_resize_extensions(envoy_config_core_v3_Node *msg, size_t len, upb_arena *arena) {
+ return (envoy_config_core_v3_Extension**)_upb_array_resize_accessor(msg, UPB_SIZE(32, 64), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_config_core_v3_Extension* envoy_config_core_v3_Node_add_extensions(envoy_config_core_v3_Node *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_Extension* sub = (struct envoy_config_core_v3_Extension*)_upb_msg_new(&envoy_config_core_v3_Extension_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(32, 64), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE upb_strview* envoy_config_core_v3_Node_mutable_client_features(envoy_config_core_v3_Node *msg, size_t *len) {
+ return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(36, 72), len);
+}
+UPB_INLINE upb_strview* envoy_config_core_v3_Node_resize_client_features(envoy_config_core_v3_Node *msg, size_t len, upb_arena *arena) {
+ return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(36, 72), len, UPB_TYPE_STRING, arena);
+}
+UPB_INLINE bool envoy_config_core_v3_Node_add_client_features(envoy_config_core_v3_Node *msg, upb_strview val, upb_arena *arena) {
+ return _upb_array_append_accessor(msg, UPB_SIZE(36, 72), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
+ arena);
+}
+UPB_INLINE struct envoy_config_core_v3_Address** envoy_config_core_v3_Node_mutable_listening_addresses(envoy_config_core_v3_Node *msg, size_t *len) {
+ return (struct envoy_config_core_v3_Address**)_upb_array_mutable_accessor(msg, UPB_SIZE(40, 80), len);
+}
+UPB_INLINE struct envoy_config_core_v3_Address** envoy_config_core_v3_Node_resize_listening_addresses(envoy_config_core_v3_Node *msg, size_t len, upb_arena *arena) {
+ return (struct envoy_config_core_v3_Address**)_upb_array_resize_accessor(msg, UPB_SIZE(40, 80), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_config_core_v3_Address* envoy_config_core_v3_Node_add_listening_addresses(envoy_config_core_v3_Node *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_Address* sub = (struct envoy_config_core_v3_Address*)_upb_msg_new(&envoy_config_core_v3_Address_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(40, 80), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+
+/* envoy.config.core.v3.Metadata */
+
+UPB_INLINE envoy_config_core_v3_Metadata *envoy_config_core_v3_Metadata_new(upb_arena *arena) {
+ return (envoy_config_core_v3_Metadata *)_upb_msg_new(&envoy_config_core_v3_Metadata_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_Metadata *envoy_config_core_v3_Metadata_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_core_v3_Metadata *ret = envoy_config_core_v3_Metadata_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_Metadata_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_core_v3_Metadata_serialize(const envoy_config_core_v3_Metadata *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_core_v3_Metadata_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_core_v3_Metadata_has_filter_metadata(const envoy_config_core_v3_Metadata *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE size_t envoy_config_core_v3_Metadata_filter_metadata_size(const envoy_config_core_v3_Metadata *msg) {return _upb_msg_map_size(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE bool envoy_config_core_v3_Metadata_filter_metadata_get(const envoy_config_core_v3_Metadata *msg, upb_strview key, struct google_protobuf_Struct* *val) { return _upb_msg_map_get(msg, UPB_SIZE(0, 0), &key, 0, val, sizeof(*val)); }
+UPB_INLINE const envoy_config_core_v3_Metadata_FilterMetadataEntry* envoy_config_core_v3_Metadata_filter_metadata_next(const envoy_config_core_v3_Metadata *msg, size_t* iter) { return (const envoy_config_core_v3_Metadata_FilterMetadataEntry*)_upb_msg_map_next(msg, UPB_SIZE(0, 0), iter); }
+
+UPB_INLINE void envoy_config_core_v3_Metadata_filter_metadata_clear(envoy_config_core_v3_Metadata *msg) { _upb_msg_map_clear(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE bool envoy_config_core_v3_Metadata_filter_metadata_set(envoy_config_core_v3_Metadata *msg, upb_strview key, struct google_protobuf_Struct* val, upb_arena *a) { return _upb_msg_map_set(msg, UPB_SIZE(0, 0), &key, 0, &val, sizeof(val), a); }
+UPB_INLINE bool envoy_config_core_v3_Metadata_filter_metadata_delete(envoy_config_core_v3_Metadata *msg, upb_strview key) { return _upb_msg_map_delete(msg, UPB_SIZE(0, 0), &key, 0); }
+UPB_INLINE envoy_config_core_v3_Metadata_FilterMetadataEntry* envoy_config_core_v3_Metadata_filter_metadata_nextmutable(envoy_config_core_v3_Metadata *msg, size_t* iter) { return (envoy_config_core_v3_Metadata_FilterMetadataEntry*)_upb_msg_map_next(msg, UPB_SIZE(0, 0), iter); }
+
+/* envoy.config.core.v3.Metadata.FilterMetadataEntry */
+
+UPB_INLINE upb_strview envoy_config_core_v3_Metadata_FilterMetadataEntry_key(const envoy_config_core_v3_Metadata_FilterMetadataEntry *msg) {
+ upb_strview ret;
+ _upb_msg_map_key(msg, &ret, 0);
+ return ret;
+}
+UPB_INLINE bool envoy_config_core_v3_Metadata_FilterMetadataEntry_has_value(const envoy_config_core_v3_Metadata_FilterMetadataEntry *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
+UPB_INLINE const struct google_protobuf_Struct* envoy_config_core_v3_Metadata_FilterMetadataEntry_value(const envoy_config_core_v3_Metadata_FilterMetadataEntry *msg) {
+ struct google_protobuf_Struct* ret;
+ _upb_msg_map_value(msg, &ret, sizeof(ret));
+ return ret;
+}
+
+UPB_INLINE void envoy_config_core_v3_Metadata_FilterMetadataEntry_set_value(envoy_config_core_v3_Metadata_FilterMetadataEntry *msg, struct google_protobuf_Struct* value) {
+ _upb_msg_map_set_value(msg, &value, sizeof(struct google_protobuf_Struct*));
+}
+
+/* envoy.config.core.v3.RuntimeUInt32 */
+
+UPB_INLINE envoy_config_core_v3_RuntimeUInt32 *envoy_config_core_v3_RuntimeUInt32_new(upb_arena *arena) {
+ return (envoy_config_core_v3_RuntimeUInt32 *)_upb_msg_new(&envoy_config_core_v3_RuntimeUInt32_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_RuntimeUInt32 *envoy_config_core_v3_RuntimeUInt32_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_core_v3_RuntimeUInt32 *ret = envoy_config_core_v3_RuntimeUInt32_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_RuntimeUInt32_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_core_v3_RuntimeUInt32_serialize(const envoy_config_core_v3_RuntimeUInt32 *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_core_v3_RuntimeUInt32_msginit, arena, len);
+}
+
+UPB_INLINE uint32_t envoy_config_core_v3_RuntimeUInt32_default_value(const envoy_config_core_v3_RuntimeUInt32 *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t); }
+UPB_INLINE upb_strview envoy_config_core_v3_RuntimeUInt32_runtime_key(const envoy_config_core_v3_RuntimeUInt32 *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
+
+UPB_INLINE void envoy_config_core_v3_RuntimeUInt32_set_default_value(envoy_config_core_v3_RuntimeUInt32 *msg, uint32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t) = value;
+}
+UPB_INLINE void envoy_config_core_v3_RuntimeUInt32_set_runtime_key(envoy_config_core_v3_RuntimeUInt32 *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
+}
+
+/* envoy.config.core.v3.RuntimeDouble */
+
+UPB_INLINE envoy_config_core_v3_RuntimeDouble *envoy_config_core_v3_RuntimeDouble_new(upb_arena *arena) {
+ return (envoy_config_core_v3_RuntimeDouble *)_upb_msg_new(&envoy_config_core_v3_RuntimeDouble_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_RuntimeDouble *envoy_config_core_v3_RuntimeDouble_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_core_v3_RuntimeDouble *ret = envoy_config_core_v3_RuntimeDouble_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_RuntimeDouble_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_core_v3_RuntimeDouble_serialize(const envoy_config_core_v3_RuntimeDouble *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_core_v3_RuntimeDouble_msginit, arena, len);
+}
+
+UPB_INLINE double envoy_config_core_v3_RuntimeDouble_default_value(const envoy_config_core_v3_RuntimeDouble *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), double); }
+UPB_INLINE upb_strview envoy_config_core_v3_RuntimeDouble_runtime_key(const envoy_config_core_v3_RuntimeDouble *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview); }
+
+UPB_INLINE void envoy_config_core_v3_RuntimeDouble_set_default_value(envoy_config_core_v3_RuntimeDouble *msg, double value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), double) = value;
+}
+UPB_INLINE void envoy_config_core_v3_RuntimeDouble_set_runtime_key(envoy_config_core_v3_RuntimeDouble *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview) = value;
+}
+
+/* envoy.config.core.v3.RuntimeFeatureFlag */
+
+UPB_INLINE envoy_config_core_v3_RuntimeFeatureFlag *envoy_config_core_v3_RuntimeFeatureFlag_new(upb_arena *arena) {
+ return (envoy_config_core_v3_RuntimeFeatureFlag *)_upb_msg_new(&envoy_config_core_v3_RuntimeFeatureFlag_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_RuntimeFeatureFlag *envoy_config_core_v3_RuntimeFeatureFlag_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_core_v3_RuntimeFeatureFlag *ret = envoy_config_core_v3_RuntimeFeatureFlag_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_RuntimeFeatureFlag_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_core_v3_RuntimeFeatureFlag_serialize(const envoy_config_core_v3_RuntimeFeatureFlag *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_core_v3_RuntimeFeatureFlag_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_core_v3_RuntimeFeatureFlag_has_default_value(const envoy_config_core_v3_RuntimeFeatureFlag *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
+UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_core_v3_RuntimeFeatureFlag_default_value(const envoy_config_core_v3_RuntimeFeatureFlag *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_BoolValue*); }
+UPB_INLINE upb_strview envoy_config_core_v3_RuntimeFeatureFlag_runtime_key(const envoy_config_core_v3_RuntimeFeatureFlag *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+
+UPB_INLINE void envoy_config_core_v3_RuntimeFeatureFlag_set_default_value(envoy_config_core_v3_RuntimeFeatureFlag *msg, struct google_protobuf_BoolValue* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_BoolValue*) = value;
+}
+UPB_INLINE struct google_protobuf_BoolValue* envoy_config_core_v3_RuntimeFeatureFlag_mutable_default_value(envoy_config_core_v3_RuntimeFeatureFlag *msg, upb_arena *arena) {
+ struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_core_v3_RuntimeFeatureFlag_default_value(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_BoolValue*)_upb_msg_new(&google_protobuf_BoolValue_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_RuntimeFeatureFlag_set_default_value(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_RuntimeFeatureFlag_set_runtime_key(envoy_config_core_v3_RuntimeFeatureFlag *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+
+/* envoy.config.core.v3.HeaderValue */
+
+UPB_INLINE envoy_config_core_v3_HeaderValue *envoy_config_core_v3_HeaderValue_new(upb_arena *arena) {
+ return (envoy_config_core_v3_HeaderValue *)_upb_msg_new(&envoy_config_core_v3_HeaderValue_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_HeaderValue *envoy_config_core_v3_HeaderValue_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_core_v3_HeaderValue *ret = envoy_config_core_v3_HeaderValue_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_HeaderValue_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_core_v3_HeaderValue_serialize(const envoy_config_core_v3_HeaderValue *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_core_v3_HeaderValue_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview envoy_config_core_v3_HeaderValue_key(const envoy_config_core_v3_HeaderValue *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE upb_strview envoy_config_core_v3_HeaderValue_value(const envoy_config_core_v3_HeaderValue *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview); }
+
+UPB_INLINE void envoy_config_core_v3_HeaderValue_set_key(envoy_config_core_v3_HeaderValue *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_core_v3_HeaderValue_set_value(envoy_config_core_v3_HeaderValue *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview) = value;
+}
+
+/* envoy.config.core.v3.HeaderValueOption */
+
+UPB_INLINE envoy_config_core_v3_HeaderValueOption *envoy_config_core_v3_HeaderValueOption_new(upb_arena *arena) {
+ return (envoy_config_core_v3_HeaderValueOption *)_upb_msg_new(&envoy_config_core_v3_HeaderValueOption_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_HeaderValueOption *envoy_config_core_v3_HeaderValueOption_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_core_v3_HeaderValueOption *ret = envoy_config_core_v3_HeaderValueOption_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_HeaderValueOption_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_core_v3_HeaderValueOption_serialize(const envoy_config_core_v3_HeaderValueOption *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_core_v3_HeaderValueOption_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_core_v3_HeaderValueOption_has_header(const envoy_config_core_v3_HeaderValueOption *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE const envoy_config_core_v3_HeaderValue* envoy_config_core_v3_HeaderValueOption_header(const envoy_config_core_v3_HeaderValueOption *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const envoy_config_core_v3_HeaderValue*); }
+UPB_INLINE bool envoy_config_core_v3_HeaderValueOption_has_append(const envoy_config_core_v3_HeaderValueOption *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
+UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_core_v3_HeaderValueOption_append(const envoy_config_core_v3_HeaderValueOption *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_BoolValue*); }
+
+UPB_INLINE void envoy_config_core_v3_HeaderValueOption_set_header(envoy_config_core_v3_HeaderValueOption *msg, envoy_config_core_v3_HeaderValue* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), envoy_config_core_v3_HeaderValue*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_HeaderValue* envoy_config_core_v3_HeaderValueOption_mutable_header(envoy_config_core_v3_HeaderValueOption *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_HeaderValue* sub = (struct envoy_config_core_v3_HeaderValue*)envoy_config_core_v3_HeaderValueOption_header(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_HeaderValue*)_upb_msg_new(&envoy_config_core_v3_HeaderValue_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_HeaderValueOption_set_header(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_HeaderValueOption_set_append(envoy_config_core_v3_HeaderValueOption *msg, struct google_protobuf_BoolValue* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_BoolValue*) = value;
+}
+UPB_INLINE struct google_protobuf_BoolValue* envoy_config_core_v3_HeaderValueOption_mutable_append(envoy_config_core_v3_HeaderValueOption *msg, upb_arena *arena) {
+ struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_core_v3_HeaderValueOption_append(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_BoolValue*)_upb_msg_new(&google_protobuf_BoolValue_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_HeaderValueOption_set_append(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.core.v3.HeaderMap */
+
+UPB_INLINE envoy_config_core_v3_HeaderMap *envoy_config_core_v3_HeaderMap_new(upb_arena *arena) {
+ return (envoy_config_core_v3_HeaderMap *)_upb_msg_new(&envoy_config_core_v3_HeaderMap_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_HeaderMap *envoy_config_core_v3_HeaderMap_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_core_v3_HeaderMap *ret = envoy_config_core_v3_HeaderMap_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_HeaderMap_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_core_v3_HeaderMap_serialize(const envoy_config_core_v3_HeaderMap *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_core_v3_HeaderMap_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_core_v3_HeaderMap_has_headers(const envoy_config_core_v3_HeaderMap *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE const envoy_config_core_v3_HeaderValue* const* envoy_config_core_v3_HeaderMap_headers(const envoy_config_core_v3_HeaderMap *msg, size_t *len) { return (const envoy_config_core_v3_HeaderValue* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
+
+UPB_INLINE envoy_config_core_v3_HeaderValue** envoy_config_core_v3_HeaderMap_mutable_headers(envoy_config_core_v3_HeaderMap *msg, size_t *len) {
+ return (envoy_config_core_v3_HeaderValue**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
+}
+UPB_INLINE envoy_config_core_v3_HeaderValue** envoy_config_core_v3_HeaderMap_resize_headers(envoy_config_core_v3_HeaderMap *msg, size_t len, upb_arena *arena) {
+ return (envoy_config_core_v3_HeaderValue**)_upb_array_resize_accessor(msg, UPB_SIZE(0, 0), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_config_core_v3_HeaderValue* envoy_config_core_v3_HeaderMap_add_headers(envoy_config_core_v3_HeaderMap *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_HeaderValue* sub = (struct envoy_config_core_v3_HeaderValue*)_upb_msg_new(&envoy_config_core_v3_HeaderValue_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(0, 0), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+
+/* envoy.config.core.v3.DataSource */
+
+UPB_INLINE envoy_config_core_v3_DataSource *envoy_config_core_v3_DataSource_new(upb_arena *arena) {
+ return (envoy_config_core_v3_DataSource *)_upb_msg_new(&envoy_config_core_v3_DataSource_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_DataSource *envoy_config_core_v3_DataSource_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_core_v3_DataSource *ret = envoy_config_core_v3_DataSource_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_DataSource_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_core_v3_DataSource_serialize(const envoy_config_core_v3_DataSource *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_core_v3_DataSource_msginit, arena, len);
+}
+
+typedef enum {
+ envoy_config_core_v3_DataSource_specifier_filename = 1,
+ envoy_config_core_v3_DataSource_specifier_inline_bytes = 2,
+ envoy_config_core_v3_DataSource_specifier_inline_string = 3,
+ envoy_config_core_v3_DataSource_specifier_NOT_SET = 0
+} envoy_config_core_v3_DataSource_specifier_oneofcases;
+UPB_INLINE envoy_config_core_v3_DataSource_specifier_oneofcases envoy_config_core_v3_DataSource_specifier_case(const envoy_config_core_v3_DataSource* msg) { return (envoy_config_core_v3_DataSource_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(8, 16), int32_t); }
+
+UPB_INLINE bool envoy_config_core_v3_DataSource_has_filename(const envoy_config_core_v3_DataSource *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 1; }
+UPB_INLINE upb_strview envoy_config_core_v3_DataSource_filename(const envoy_config_core_v3_DataSource *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 1, upb_strview_make("", strlen(""))); }
+UPB_INLINE bool envoy_config_core_v3_DataSource_has_inline_bytes(const envoy_config_core_v3_DataSource *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 2; }
+UPB_INLINE upb_strview envoy_config_core_v3_DataSource_inline_bytes(const envoy_config_core_v3_DataSource *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 2, upb_strview_make("", strlen(""))); }
+UPB_INLINE bool envoy_config_core_v3_DataSource_has_inline_string(const envoy_config_core_v3_DataSource *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 3; }
+UPB_INLINE upb_strview envoy_config_core_v3_DataSource_inline_string(const envoy_config_core_v3_DataSource *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 3, upb_strview_make("", strlen(""))); }
+
+UPB_INLINE void envoy_config_core_v3_DataSource_set_filename(envoy_config_core_v3_DataSource *msg, upb_strview value) {
+ UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 1);
+}
+UPB_INLINE void envoy_config_core_v3_DataSource_set_inline_bytes(envoy_config_core_v3_DataSource *msg, upb_strview value) {
+ UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 2);
+}
+UPB_INLINE void envoy_config_core_v3_DataSource_set_inline_string(envoy_config_core_v3_DataSource *msg, upb_strview value) {
+ UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 3);
+}
+
+/* envoy.config.core.v3.RetryPolicy */
+
+UPB_INLINE envoy_config_core_v3_RetryPolicy *envoy_config_core_v3_RetryPolicy_new(upb_arena *arena) {
+ return (envoy_config_core_v3_RetryPolicy *)_upb_msg_new(&envoy_config_core_v3_RetryPolicy_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_RetryPolicy *envoy_config_core_v3_RetryPolicy_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_core_v3_RetryPolicy *ret = envoy_config_core_v3_RetryPolicy_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_RetryPolicy_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_core_v3_RetryPolicy_serialize(const envoy_config_core_v3_RetryPolicy *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_core_v3_RetryPolicy_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_core_v3_RetryPolicy_has_retry_back_off(const envoy_config_core_v3_RetryPolicy *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE const struct envoy_config_core_v3_BackoffStrategy* envoy_config_core_v3_RetryPolicy_retry_back_off(const envoy_config_core_v3_RetryPolicy *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct envoy_config_core_v3_BackoffStrategy*); }
+UPB_INLINE bool envoy_config_core_v3_RetryPolicy_has_num_retries(const envoy_config_core_v3_RetryPolicy *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_core_v3_RetryPolicy_num_retries(const envoy_config_core_v3_RetryPolicy *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_UInt32Value*); }
+
+UPB_INLINE void envoy_config_core_v3_RetryPolicy_set_retry_back_off(envoy_config_core_v3_RetryPolicy *msg, struct envoy_config_core_v3_BackoffStrategy* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct envoy_config_core_v3_BackoffStrategy*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_BackoffStrategy* envoy_config_core_v3_RetryPolicy_mutable_retry_back_off(envoy_config_core_v3_RetryPolicy *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_BackoffStrategy* sub = (struct envoy_config_core_v3_BackoffStrategy*)envoy_config_core_v3_RetryPolicy_retry_back_off(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_BackoffStrategy*)_upb_msg_new(&envoy_config_core_v3_BackoffStrategy_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_RetryPolicy_set_retry_back_off(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_RetryPolicy_set_num_retries(envoy_config_core_v3_RetryPolicy *msg, struct google_protobuf_UInt32Value* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_RetryPolicy_mutable_num_retries(envoy_config_core_v3_RetryPolicy *msg, upb_arena *arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_core_v3_RetryPolicy_num_retries(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_RetryPolicy_set_num_retries(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.core.v3.RemoteDataSource */
+
+UPB_INLINE envoy_config_core_v3_RemoteDataSource *envoy_config_core_v3_RemoteDataSource_new(upb_arena *arena) {
+ return (envoy_config_core_v3_RemoteDataSource *)_upb_msg_new(&envoy_config_core_v3_RemoteDataSource_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_RemoteDataSource *envoy_config_core_v3_RemoteDataSource_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_core_v3_RemoteDataSource *ret = envoy_config_core_v3_RemoteDataSource_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_RemoteDataSource_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_core_v3_RemoteDataSource_serialize(const envoy_config_core_v3_RemoteDataSource *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_core_v3_RemoteDataSource_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_core_v3_RemoteDataSource_has_http_uri(const envoy_config_core_v3_RemoteDataSource *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
+UPB_INLINE const struct envoy_config_core_v3_HttpUri* envoy_config_core_v3_RemoteDataSource_http_uri(const envoy_config_core_v3_RemoteDataSource *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct envoy_config_core_v3_HttpUri*); }
+UPB_INLINE upb_strview envoy_config_core_v3_RemoteDataSource_sha256(const envoy_config_core_v3_RemoteDataSource *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE bool envoy_config_core_v3_RemoteDataSource_has_retry_policy(const envoy_config_core_v3_RemoteDataSource *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
+UPB_INLINE const envoy_config_core_v3_RetryPolicy* envoy_config_core_v3_RemoteDataSource_retry_policy(const envoy_config_core_v3_RemoteDataSource *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const envoy_config_core_v3_RetryPolicy*); }
+
+UPB_INLINE void envoy_config_core_v3_RemoteDataSource_set_http_uri(envoy_config_core_v3_RemoteDataSource *msg, struct envoy_config_core_v3_HttpUri* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct envoy_config_core_v3_HttpUri*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_HttpUri* envoy_config_core_v3_RemoteDataSource_mutable_http_uri(envoy_config_core_v3_RemoteDataSource *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_HttpUri* sub = (struct envoy_config_core_v3_HttpUri*)envoy_config_core_v3_RemoteDataSource_http_uri(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_HttpUri*)_upb_msg_new(&envoy_config_core_v3_HttpUri_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_RemoteDataSource_set_http_uri(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_RemoteDataSource_set_sha256(envoy_config_core_v3_RemoteDataSource *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_core_v3_RemoteDataSource_set_retry_policy(envoy_config_core_v3_RemoteDataSource *msg, envoy_config_core_v3_RetryPolicy* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), envoy_config_core_v3_RetryPolicy*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_RetryPolicy* envoy_config_core_v3_RemoteDataSource_mutable_retry_policy(envoy_config_core_v3_RemoteDataSource *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_RetryPolicy* sub = (struct envoy_config_core_v3_RetryPolicy*)envoy_config_core_v3_RemoteDataSource_retry_policy(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_RetryPolicy*)_upb_msg_new(&envoy_config_core_v3_RetryPolicy_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_RemoteDataSource_set_retry_policy(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.core.v3.AsyncDataSource */
+
+UPB_INLINE envoy_config_core_v3_AsyncDataSource *envoy_config_core_v3_AsyncDataSource_new(upb_arena *arena) {
+ return (envoy_config_core_v3_AsyncDataSource *)_upb_msg_new(&envoy_config_core_v3_AsyncDataSource_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_AsyncDataSource *envoy_config_core_v3_AsyncDataSource_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_core_v3_AsyncDataSource *ret = envoy_config_core_v3_AsyncDataSource_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_AsyncDataSource_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_core_v3_AsyncDataSource_serialize(const envoy_config_core_v3_AsyncDataSource *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_core_v3_AsyncDataSource_msginit, arena, len);
+}
+
+typedef enum {
+ envoy_config_core_v3_AsyncDataSource_specifier_local = 1,
+ envoy_config_core_v3_AsyncDataSource_specifier_remote = 2,
+ envoy_config_core_v3_AsyncDataSource_specifier_NOT_SET = 0
+} envoy_config_core_v3_AsyncDataSource_specifier_oneofcases;
+UPB_INLINE envoy_config_core_v3_AsyncDataSource_specifier_oneofcases envoy_config_core_v3_AsyncDataSource_specifier_case(const envoy_config_core_v3_AsyncDataSource* msg) { return (envoy_config_core_v3_AsyncDataSource_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 8), int32_t); }
+
+UPB_INLINE bool envoy_config_core_v3_AsyncDataSource_has_local(const envoy_config_core_v3_AsyncDataSource *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 1; }
+UPB_INLINE const envoy_config_core_v3_DataSource* envoy_config_core_v3_AsyncDataSource_local(const envoy_config_core_v3_AsyncDataSource *msg) { return UPB_READ_ONEOF(msg, const envoy_config_core_v3_DataSource*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 1, NULL); }
+UPB_INLINE bool envoy_config_core_v3_AsyncDataSource_has_remote(const envoy_config_core_v3_AsyncDataSource *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 2; }
+UPB_INLINE const envoy_config_core_v3_RemoteDataSource* envoy_config_core_v3_AsyncDataSource_remote(const envoy_config_core_v3_AsyncDataSource *msg) { return UPB_READ_ONEOF(msg, const envoy_config_core_v3_RemoteDataSource*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 2, NULL); }
+
+UPB_INLINE void envoy_config_core_v3_AsyncDataSource_set_local(envoy_config_core_v3_AsyncDataSource *msg, envoy_config_core_v3_DataSource* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_core_v3_DataSource*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 1);
+}
+UPB_INLINE struct envoy_config_core_v3_DataSource* envoy_config_core_v3_AsyncDataSource_mutable_local(envoy_config_core_v3_AsyncDataSource *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_DataSource* sub = (struct envoy_config_core_v3_DataSource*)envoy_config_core_v3_AsyncDataSource_local(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_DataSource*)_upb_msg_new(&envoy_config_core_v3_DataSource_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_AsyncDataSource_set_local(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_AsyncDataSource_set_remote(envoy_config_core_v3_AsyncDataSource *msg, envoy_config_core_v3_RemoteDataSource* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_core_v3_RemoteDataSource*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 2);
+}
+UPB_INLINE struct envoy_config_core_v3_RemoteDataSource* envoy_config_core_v3_AsyncDataSource_mutable_remote(envoy_config_core_v3_AsyncDataSource *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_RemoteDataSource* sub = (struct envoy_config_core_v3_RemoteDataSource*)envoy_config_core_v3_AsyncDataSource_remote(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_RemoteDataSource*)_upb_msg_new(&envoy_config_core_v3_RemoteDataSource_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_AsyncDataSource_set_remote(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.core.v3.TransportSocket */
+
+UPB_INLINE envoy_config_core_v3_TransportSocket *envoy_config_core_v3_TransportSocket_new(upb_arena *arena) {
+ return (envoy_config_core_v3_TransportSocket *)_upb_msg_new(&envoy_config_core_v3_TransportSocket_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_TransportSocket *envoy_config_core_v3_TransportSocket_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_core_v3_TransportSocket *ret = envoy_config_core_v3_TransportSocket_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_TransportSocket_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_core_v3_TransportSocket_serialize(const envoy_config_core_v3_TransportSocket *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_core_v3_TransportSocket_msginit, arena, len);
+}
+
+typedef enum {
+ envoy_config_core_v3_TransportSocket_config_type_typed_config = 3,
+ envoy_config_core_v3_TransportSocket_config_type_NOT_SET = 0
+} envoy_config_core_v3_TransportSocket_config_type_oneofcases;
+UPB_INLINE envoy_config_core_v3_TransportSocket_config_type_oneofcases envoy_config_core_v3_TransportSocket_config_type_case(const envoy_config_core_v3_TransportSocket* msg) { return (envoy_config_core_v3_TransportSocket_config_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(12, 24), int32_t); }
+
+UPB_INLINE upb_strview envoy_config_core_v3_TransportSocket_name(const envoy_config_core_v3_TransportSocket *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE bool envoy_config_core_v3_TransportSocket_has_typed_config(const envoy_config_core_v3_TransportSocket *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 3; }
+UPB_INLINE const struct google_protobuf_Any* envoy_config_core_v3_TransportSocket_typed_config(const envoy_config_core_v3_TransportSocket *msg) { return UPB_READ_ONEOF(msg, const struct google_protobuf_Any*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 3, NULL); }
+
+UPB_INLINE void envoy_config_core_v3_TransportSocket_set_name(envoy_config_core_v3_TransportSocket *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_core_v3_TransportSocket_set_typed_config(envoy_config_core_v3_TransportSocket *msg, struct google_protobuf_Any* value) {
+ UPB_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 3);
+}
+UPB_INLINE struct google_protobuf_Any* envoy_config_core_v3_TransportSocket_mutable_typed_config(envoy_config_core_v3_TransportSocket *msg, upb_arena *arena) {
+ struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_config_core_v3_TransportSocket_typed_config(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_TransportSocket_set_typed_config(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.core.v3.RuntimeFractionalPercent */
+
+UPB_INLINE envoy_config_core_v3_RuntimeFractionalPercent *envoy_config_core_v3_RuntimeFractionalPercent_new(upb_arena *arena) {
+ return (envoy_config_core_v3_RuntimeFractionalPercent *)_upb_msg_new(&envoy_config_core_v3_RuntimeFractionalPercent_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_RuntimeFractionalPercent *envoy_config_core_v3_RuntimeFractionalPercent_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_core_v3_RuntimeFractionalPercent *ret = envoy_config_core_v3_RuntimeFractionalPercent_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_RuntimeFractionalPercent_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_core_v3_RuntimeFractionalPercent_serialize(const envoy_config_core_v3_RuntimeFractionalPercent *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_core_v3_RuntimeFractionalPercent_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_core_v3_RuntimeFractionalPercent_has_default_value(const envoy_config_core_v3_RuntimeFractionalPercent *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
+UPB_INLINE const struct envoy_type_v3_FractionalPercent* envoy_config_core_v3_RuntimeFractionalPercent_default_value(const envoy_config_core_v3_RuntimeFractionalPercent *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct envoy_type_v3_FractionalPercent*); }
+UPB_INLINE upb_strview envoy_config_core_v3_RuntimeFractionalPercent_runtime_key(const envoy_config_core_v3_RuntimeFractionalPercent *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+
+UPB_INLINE void envoy_config_core_v3_RuntimeFractionalPercent_set_default_value(envoy_config_core_v3_RuntimeFractionalPercent *msg, struct envoy_type_v3_FractionalPercent* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct envoy_type_v3_FractionalPercent*) = value;
+}
+UPB_INLINE struct envoy_type_v3_FractionalPercent* envoy_config_core_v3_RuntimeFractionalPercent_mutable_default_value(envoy_config_core_v3_RuntimeFractionalPercent *msg, upb_arena *arena) {
+ struct envoy_type_v3_FractionalPercent* sub = (struct envoy_type_v3_FractionalPercent*)envoy_config_core_v3_RuntimeFractionalPercent_default_value(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_type_v3_FractionalPercent*)_upb_msg_new(&envoy_type_v3_FractionalPercent_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_RuntimeFractionalPercent_set_default_value(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_RuntimeFractionalPercent_set_runtime_key(envoy_config_core_v3_RuntimeFractionalPercent *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+
+/* envoy.config.core.v3.ControlPlane */
+
+UPB_INLINE envoy_config_core_v3_ControlPlane *envoy_config_core_v3_ControlPlane_new(upb_arena *arena) {
+ return (envoy_config_core_v3_ControlPlane *)_upb_msg_new(&envoy_config_core_v3_ControlPlane_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_ControlPlane *envoy_config_core_v3_ControlPlane_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_core_v3_ControlPlane *ret = envoy_config_core_v3_ControlPlane_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_ControlPlane_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_core_v3_ControlPlane_serialize(const envoy_config_core_v3_ControlPlane *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_core_v3_ControlPlane_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview envoy_config_core_v3_ControlPlane_identifier(const envoy_config_core_v3_ControlPlane *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+
+UPB_INLINE void envoy_config_core_v3_ControlPlane_set_identifier(envoy_config_core_v3_ControlPlane *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_CONFIG_CORE_V3_BASE_PROTO_UPB_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.c
index 7d992318d31..668869d5efc 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.c
@@ -1,103 +1,103 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/config/core/v3/config_source.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include <stddef.h>
-#include "upb/msg.h"
-#include "envoy/config/core/v3/config_source.upb.h"
-#include "envoy/config/core/v3/grpc_service.upb.h"
-#include "google/protobuf/duration.upb.h"
-#include "google/protobuf/wrappers.upb.h"
-#include "udpa/core/v1/authority.upb.h"
-#include "envoy/annotations/deprecation.upb.h"
-#include "udpa/annotations/status.upb.h"
-#include "udpa/annotations/versioning.upb.h"
-#include "validate/validate.upb.h"
-
-#include "upb/port_def.inc"
-
-static const upb_msglayout *const envoy_config_core_v3_ApiConfigSource_submsgs[4] = {
- &envoy_config_core_v3_GrpcService_msginit,
- &envoy_config_core_v3_RateLimitSettings_msginit,
- &google_protobuf_Duration_msginit,
-};
-
-static const upb_msglayout_field envoy_config_core_v3_ApiConfigSource__fields[8] = {
- {1, UPB_SIZE(0, 0), 0, 0, 14, 1},
- {2, UPB_SIZE(32, 48), 0, 0, 9, 3},
- {3, UPB_SIZE(20, 24), 0, 2, 11, 1},
- {4, UPB_SIZE(36, 56), 0, 0, 11, 3},
- {5, UPB_SIZE(24, 32), 0, 2, 11, 1},
- {6, UPB_SIZE(28, 40), 0, 1, 11, 1},
- {7, UPB_SIZE(16, 16), 0, 0, 8, 1},
- {8, UPB_SIZE(8, 8), 0, 0, 14, 1},
-};
-
-const upb_msglayout envoy_config_core_v3_ApiConfigSource_msginit = {
- &envoy_config_core_v3_ApiConfigSource_submsgs[0],
- &envoy_config_core_v3_ApiConfigSource__fields[0],
- UPB_SIZE(40, 64), 8, false,
-};
-
-const upb_msglayout envoy_config_core_v3_AggregatedConfigSource_msginit = {
- NULL,
- NULL,
- UPB_SIZE(0, 0), 0, false,
-};
-
-static const upb_msglayout_field envoy_config_core_v3_SelfConfigSource__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 14, 1},
-};
-
-const upb_msglayout envoy_config_core_v3_SelfConfigSource_msginit = {
- NULL,
- &envoy_config_core_v3_SelfConfigSource__fields[0],
- UPB_SIZE(8, 8), 1, false,
-};
-
-static const upb_msglayout *const envoy_config_core_v3_RateLimitSettings_submsgs[2] = {
- &google_protobuf_DoubleValue_msginit,
- &google_protobuf_UInt32Value_msginit,
-};
-
-static const upb_msglayout_field envoy_config_core_v3_RateLimitSettings__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 1, 11, 1},
- {2, UPB_SIZE(4, 8), 0, 0, 11, 1},
-};
-
-const upb_msglayout envoy_config_core_v3_RateLimitSettings_msginit = {
- &envoy_config_core_v3_RateLimitSettings_submsgs[0],
- &envoy_config_core_v3_RateLimitSettings__fields[0],
- UPB_SIZE(8, 16), 2, false,
-};
-
-static const upb_msglayout *const envoy_config_core_v3_ConfigSource_submsgs[5] = {
- &envoy_config_core_v3_AggregatedConfigSource_msginit,
- &envoy_config_core_v3_ApiConfigSource_msginit,
- &envoy_config_core_v3_SelfConfigSource_msginit,
- &google_protobuf_Duration_msginit,
- &udpa_core_v1_Authority_msginit,
-};
-
-static const upb_msglayout_field envoy_config_core_v3_ConfigSource__fields[7] = {
- {1, UPB_SIZE(16, 24), UPB_SIZE(-25, -41), 0, 9, 1},
- {2, UPB_SIZE(16, 24), UPB_SIZE(-25, -41), 1, 11, 1},
- {3, UPB_SIZE(16, 24), UPB_SIZE(-25, -41), 0, 11, 1},
- {4, UPB_SIZE(8, 8), 0, 3, 11, 1},
- {5, UPB_SIZE(16, 24), UPB_SIZE(-25, -41), 2, 11, 1},
- {6, UPB_SIZE(0, 0), 0, 0, 14, 1},
- {7, UPB_SIZE(12, 16), 0, 4, 11, 3},
-};
-
-const upb_msglayout envoy_config_core_v3_ConfigSource_msginit = {
- &envoy_config_core_v3_ConfigSource_submsgs[0],
- &envoy_config_core_v3_ConfigSource__fields[0],
- UPB_SIZE(32, 48), 7, false,
-};
-
-#include "upb/port_undef.inc"
-
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/core/v3/config_source.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg.h"
+#include "envoy/config/core/v3/config_source.upb.h"
+#include "envoy/config/core/v3/grpc_service.upb.h"
+#include "google/protobuf/duration.upb.h"
+#include "google/protobuf/wrappers.upb.h"
+#include "udpa/core/v1/authority.upb.h"
+#include "envoy/annotations/deprecation.upb.h"
+#include "udpa/annotations/status.upb.h"
+#include "udpa/annotations/versioning.upb.h"
+#include "validate/validate.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_msglayout *const envoy_config_core_v3_ApiConfigSource_submsgs[4] = {
+ &envoy_config_core_v3_GrpcService_msginit,
+ &envoy_config_core_v3_RateLimitSettings_msginit,
+ &google_protobuf_Duration_msginit,
+};
+
+static const upb_msglayout_field envoy_config_core_v3_ApiConfigSource__fields[8] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 14, 1},
+ {2, UPB_SIZE(32, 48), 0, 0, 9, 3},
+ {3, UPB_SIZE(20, 24), 0, 2, 11, 1},
+ {4, UPB_SIZE(36, 56), 0, 0, 11, 3},
+ {5, UPB_SIZE(24, 32), 0, 2, 11, 1},
+ {6, UPB_SIZE(28, 40), 0, 1, 11, 1},
+ {7, UPB_SIZE(16, 16), 0, 0, 8, 1},
+ {8, UPB_SIZE(8, 8), 0, 0, 14, 1},
+};
+
+const upb_msglayout envoy_config_core_v3_ApiConfigSource_msginit = {
+ &envoy_config_core_v3_ApiConfigSource_submsgs[0],
+ &envoy_config_core_v3_ApiConfigSource__fields[0],
+ UPB_SIZE(40, 64), 8, false,
+};
+
+const upb_msglayout envoy_config_core_v3_AggregatedConfigSource_msginit = {
+ NULL,
+ NULL,
+ UPB_SIZE(0, 0), 0, false,
+};
+
+static const upb_msglayout_field envoy_config_core_v3_SelfConfigSource__fields[1] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 14, 1},
+};
+
+const upb_msglayout envoy_config_core_v3_SelfConfigSource_msginit = {
+ NULL,
+ &envoy_config_core_v3_SelfConfigSource__fields[0],
+ UPB_SIZE(8, 8), 1, false,
+};
+
+static const upb_msglayout *const envoy_config_core_v3_RateLimitSettings_submsgs[2] = {
+ &google_protobuf_DoubleValue_msginit,
+ &google_protobuf_UInt32Value_msginit,
+};
+
+static const upb_msglayout_field envoy_config_core_v3_RateLimitSettings__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 1, 11, 1},
+ {2, UPB_SIZE(4, 8), 0, 0, 11, 1},
+};
+
+const upb_msglayout envoy_config_core_v3_RateLimitSettings_msginit = {
+ &envoy_config_core_v3_RateLimitSettings_submsgs[0],
+ &envoy_config_core_v3_RateLimitSettings__fields[0],
+ UPB_SIZE(8, 16), 2, false,
+};
+
+static const upb_msglayout *const envoy_config_core_v3_ConfigSource_submsgs[5] = {
+ &envoy_config_core_v3_AggregatedConfigSource_msginit,
+ &envoy_config_core_v3_ApiConfigSource_msginit,
+ &envoy_config_core_v3_SelfConfigSource_msginit,
+ &google_protobuf_Duration_msginit,
+ &udpa_core_v1_Authority_msginit,
+};
+
+static const upb_msglayout_field envoy_config_core_v3_ConfigSource__fields[7] = {
+ {1, UPB_SIZE(16, 24), UPB_SIZE(-25, -41), 0, 9, 1},
+ {2, UPB_SIZE(16, 24), UPB_SIZE(-25, -41), 1, 11, 1},
+ {3, UPB_SIZE(16, 24), UPB_SIZE(-25, -41), 0, 11, 1},
+ {4, UPB_SIZE(8, 8), 0, 3, 11, 1},
+ {5, UPB_SIZE(16, 24), UPB_SIZE(-25, -41), 2, 11, 1},
+ {6, UPB_SIZE(0, 0), 0, 0, 14, 1},
+ {7, UPB_SIZE(12, 16), 0, 4, 11, 3},
+};
+
+const upb_msglayout envoy_config_core_v3_ConfigSource_msginit = {
+ &envoy_config_core_v3_ConfigSource_submsgs[0],
+ &envoy_config_core_v3_ConfigSource__fields[0],
+ UPB_SIZE(32, 48), 7, false,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.h
index aeb2b0b7f0c..f57c563fc37 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.h
@@ -1,351 +1,351 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/config/core/v3/config_source.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef ENVOY_CONFIG_CORE_V3_CONFIG_SOURCE_PROTO_UPB_H_
-#define ENVOY_CONFIG_CORE_V3_CONFIG_SOURCE_PROTO_UPB_H_
-
-#include "upb/msg.h"
-#include "upb/decode.h"
-#include "upb/encode.h"
-
-#include "upb/port_def.inc"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct envoy_config_core_v3_ApiConfigSource;
-struct envoy_config_core_v3_AggregatedConfigSource;
-struct envoy_config_core_v3_SelfConfigSource;
-struct envoy_config_core_v3_RateLimitSettings;
-struct envoy_config_core_v3_ConfigSource;
-typedef struct envoy_config_core_v3_ApiConfigSource envoy_config_core_v3_ApiConfigSource;
-typedef struct envoy_config_core_v3_AggregatedConfigSource envoy_config_core_v3_AggregatedConfigSource;
-typedef struct envoy_config_core_v3_SelfConfigSource envoy_config_core_v3_SelfConfigSource;
-typedef struct envoy_config_core_v3_RateLimitSettings envoy_config_core_v3_RateLimitSettings;
-typedef struct envoy_config_core_v3_ConfigSource envoy_config_core_v3_ConfigSource;
-extern const upb_msglayout envoy_config_core_v3_ApiConfigSource_msginit;
-extern const upb_msglayout envoy_config_core_v3_AggregatedConfigSource_msginit;
-extern const upb_msglayout envoy_config_core_v3_SelfConfigSource_msginit;
-extern const upb_msglayout envoy_config_core_v3_RateLimitSettings_msginit;
-extern const upb_msglayout envoy_config_core_v3_ConfigSource_msginit;
-struct envoy_config_core_v3_GrpcService;
-struct google_protobuf_DoubleValue;
-struct google_protobuf_Duration;
-struct google_protobuf_UInt32Value;
-struct udpa_core_v1_Authority;
-extern const upb_msglayout envoy_config_core_v3_GrpcService_msginit;
-extern const upb_msglayout google_protobuf_DoubleValue_msginit;
-extern const upb_msglayout google_protobuf_Duration_msginit;
-extern const upb_msglayout google_protobuf_UInt32Value_msginit;
-extern const upb_msglayout udpa_core_v1_Authority_msginit;
-
-typedef enum {
- envoy_config_core_v3_ApiConfigSource_DEPRECATED_AND_UNAVAILABLE_DO_NOT_USE = 0,
- envoy_config_core_v3_ApiConfigSource_REST = 1,
- envoy_config_core_v3_ApiConfigSource_GRPC = 2,
- envoy_config_core_v3_ApiConfigSource_DELTA_GRPC = 3,
- envoy_config_core_v3_ApiConfigSource_AGGREGATED_GRPC = 5,
- envoy_config_core_v3_ApiConfigSource_AGGREGATED_DELTA_GRPC = 6
-} envoy_config_core_v3_ApiConfigSource_ApiType;
-
-typedef enum {
- envoy_config_core_v3_AUTO = 0,
- envoy_config_core_v3_V2 = 1,
- envoy_config_core_v3_V3 = 2
-} envoy_config_core_v3_ApiVersion;
-
-
-/* envoy.config.core.v3.ApiConfigSource */
-
-UPB_INLINE envoy_config_core_v3_ApiConfigSource *envoy_config_core_v3_ApiConfigSource_new(upb_arena *arena) {
- return (envoy_config_core_v3_ApiConfigSource *)_upb_msg_new(&envoy_config_core_v3_ApiConfigSource_msginit, arena);
-}
-UPB_INLINE envoy_config_core_v3_ApiConfigSource *envoy_config_core_v3_ApiConfigSource_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_core_v3_ApiConfigSource *ret = envoy_config_core_v3_ApiConfigSource_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_ApiConfigSource_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_core_v3_ApiConfigSource_serialize(const envoy_config_core_v3_ApiConfigSource *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_core_v3_ApiConfigSource_msginit, arena, len);
-}
-
-UPB_INLINE int32_t envoy_config_core_v3_ApiConfigSource_api_type(const envoy_config_core_v3_ApiConfigSource *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
-UPB_INLINE upb_strview const* envoy_config_core_v3_ApiConfigSource_cluster_names(const envoy_config_core_v3_ApiConfigSource *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(32, 48), len); }
-UPB_INLINE bool envoy_config_core_v3_ApiConfigSource_has_refresh_delay(const envoy_config_core_v3_ApiConfigSource *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 24)); }
-UPB_INLINE const struct google_protobuf_Duration* envoy_config_core_v3_ApiConfigSource_refresh_delay(const envoy_config_core_v3_ApiConfigSource *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 24), const struct google_protobuf_Duration*); }
-UPB_INLINE bool envoy_config_core_v3_ApiConfigSource_has_grpc_services(const envoy_config_core_v3_ApiConfigSource *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(36, 56)); }
-UPB_INLINE const struct envoy_config_core_v3_GrpcService* const* envoy_config_core_v3_ApiConfigSource_grpc_services(const envoy_config_core_v3_ApiConfigSource *msg, size_t *len) { return (const struct envoy_config_core_v3_GrpcService* const*)_upb_array_accessor(msg, UPB_SIZE(36, 56), len); }
-UPB_INLINE bool envoy_config_core_v3_ApiConfigSource_has_request_timeout(const envoy_config_core_v3_ApiConfigSource *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 32)); }
-UPB_INLINE const struct google_protobuf_Duration* envoy_config_core_v3_ApiConfigSource_request_timeout(const envoy_config_core_v3_ApiConfigSource *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 32), const struct google_protobuf_Duration*); }
-UPB_INLINE bool envoy_config_core_v3_ApiConfigSource_has_rate_limit_settings(const envoy_config_core_v3_ApiConfigSource *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 40)); }
-UPB_INLINE const envoy_config_core_v3_RateLimitSettings* envoy_config_core_v3_ApiConfigSource_rate_limit_settings(const envoy_config_core_v3_ApiConfigSource *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 40), const envoy_config_core_v3_RateLimitSettings*); }
-UPB_INLINE bool envoy_config_core_v3_ApiConfigSource_set_node_on_first_message_only(const envoy_config_core_v3_ApiConfigSource *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), bool); }
-UPB_INLINE int32_t envoy_config_core_v3_ApiConfigSource_transport_api_version(const envoy_config_core_v3_ApiConfigSource *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); }
-
-UPB_INLINE void envoy_config_core_v3_ApiConfigSource_set_api_type(envoy_config_core_v3_ApiConfigSource *msg, int32_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
-}
-UPB_INLINE upb_strview* envoy_config_core_v3_ApiConfigSource_mutable_cluster_names(envoy_config_core_v3_ApiConfigSource *msg, size_t *len) {
- return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(32, 48), len);
-}
-UPB_INLINE upb_strview* envoy_config_core_v3_ApiConfigSource_resize_cluster_names(envoy_config_core_v3_ApiConfigSource *msg, size_t len, upb_arena *arena) {
- return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(32, 48), len, UPB_TYPE_STRING, arena);
-}
-UPB_INLINE bool envoy_config_core_v3_ApiConfigSource_add_cluster_names(envoy_config_core_v3_ApiConfigSource *msg, upb_strview val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(32, 48), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
- arena);
-}
-UPB_INLINE void envoy_config_core_v3_ApiConfigSource_set_refresh_delay(envoy_config_core_v3_ApiConfigSource *msg, struct google_protobuf_Duration* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(20, 24), struct google_protobuf_Duration*) = value;
-}
-UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_ApiConfigSource_mutable_refresh_delay(envoy_config_core_v3_ApiConfigSource *msg, upb_arena *arena) {
- struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_core_v3_ApiConfigSource_refresh_delay(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_ApiConfigSource_set_refresh_delay(msg, sub);
- }
- return sub;
-}
-UPB_INLINE struct envoy_config_core_v3_GrpcService** envoy_config_core_v3_ApiConfigSource_mutable_grpc_services(envoy_config_core_v3_ApiConfigSource *msg, size_t *len) {
- return (struct envoy_config_core_v3_GrpcService**)_upb_array_mutable_accessor(msg, UPB_SIZE(36, 56), len);
-}
-UPB_INLINE struct envoy_config_core_v3_GrpcService** envoy_config_core_v3_ApiConfigSource_resize_grpc_services(envoy_config_core_v3_ApiConfigSource *msg, size_t len, upb_arena *arena) {
- return (struct envoy_config_core_v3_GrpcService**)_upb_array_resize_accessor(msg, UPB_SIZE(36, 56), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_config_core_v3_GrpcService* envoy_config_core_v3_ApiConfigSource_add_grpc_services(envoy_config_core_v3_ApiConfigSource *msg, upb_arena *arena) {
- struct envoy_config_core_v3_GrpcService* sub = (struct envoy_config_core_v3_GrpcService*)_upb_msg_new(&envoy_config_core_v3_GrpcService_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(36, 56), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-UPB_INLINE void envoy_config_core_v3_ApiConfigSource_set_request_timeout(envoy_config_core_v3_ApiConfigSource *msg, struct google_protobuf_Duration* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(24, 32), struct google_protobuf_Duration*) = value;
-}
-UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_ApiConfigSource_mutable_request_timeout(envoy_config_core_v3_ApiConfigSource *msg, upb_arena *arena) {
- struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_core_v3_ApiConfigSource_request_timeout(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_ApiConfigSource_set_request_timeout(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_core_v3_ApiConfigSource_set_rate_limit_settings(envoy_config_core_v3_ApiConfigSource *msg, envoy_config_core_v3_RateLimitSettings* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(28, 40), envoy_config_core_v3_RateLimitSettings*) = value;
-}
-UPB_INLINE struct envoy_config_core_v3_RateLimitSettings* envoy_config_core_v3_ApiConfigSource_mutable_rate_limit_settings(envoy_config_core_v3_ApiConfigSource *msg, upb_arena *arena) {
- struct envoy_config_core_v3_RateLimitSettings* sub = (struct envoy_config_core_v3_RateLimitSettings*)envoy_config_core_v3_ApiConfigSource_rate_limit_settings(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_RateLimitSettings*)_upb_msg_new(&envoy_config_core_v3_RateLimitSettings_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_ApiConfigSource_set_rate_limit_settings(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_core_v3_ApiConfigSource_set_set_node_on_first_message_only(envoy_config_core_v3_ApiConfigSource *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(16, 16), bool) = value;
-}
-UPB_INLINE void envoy_config_core_v3_ApiConfigSource_set_transport_api_version(envoy_config_core_v3_ApiConfigSource *msg, int32_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
-}
-
-/* envoy.config.core.v3.AggregatedConfigSource */
-
-UPB_INLINE envoy_config_core_v3_AggregatedConfigSource *envoy_config_core_v3_AggregatedConfigSource_new(upb_arena *arena) {
- return (envoy_config_core_v3_AggregatedConfigSource *)_upb_msg_new(&envoy_config_core_v3_AggregatedConfigSource_msginit, arena);
-}
-UPB_INLINE envoy_config_core_v3_AggregatedConfigSource *envoy_config_core_v3_AggregatedConfigSource_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_core_v3_AggregatedConfigSource *ret = envoy_config_core_v3_AggregatedConfigSource_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_AggregatedConfigSource_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_core_v3_AggregatedConfigSource_serialize(const envoy_config_core_v3_AggregatedConfigSource *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_core_v3_AggregatedConfigSource_msginit, arena, len);
-}
-
-
-
-/* envoy.config.core.v3.SelfConfigSource */
-
-UPB_INLINE envoy_config_core_v3_SelfConfigSource *envoy_config_core_v3_SelfConfigSource_new(upb_arena *arena) {
- return (envoy_config_core_v3_SelfConfigSource *)_upb_msg_new(&envoy_config_core_v3_SelfConfigSource_msginit, arena);
-}
-UPB_INLINE envoy_config_core_v3_SelfConfigSource *envoy_config_core_v3_SelfConfigSource_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_core_v3_SelfConfigSource *ret = envoy_config_core_v3_SelfConfigSource_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_SelfConfigSource_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_core_v3_SelfConfigSource_serialize(const envoy_config_core_v3_SelfConfigSource *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_core_v3_SelfConfigSource_msginit, arena, len);
-}
-
-UPB_INLINE int32_t envoy_config_core_v3_SelfConfigSource_transport_api_version(const envoy_config_core_v3_SelfConfigSource *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
-
-UPB_INLINE void envoy_config_core_v3_SelfConfigSource_set_transport_api_version(envoy_config_core_v3_SelfConfigSource *msg, int32_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
-}
-
-/* envoy.config.core.v3.RateLimitSettings */
-
-UPB_INLINE envoy_config_core_v3_RateLimitSettings *envoy_config_core_v3_RateLimitSettings_new(upb_arena *arena) {
- return (envoy_config_core_v3_RateLimitSettings *)_upb_msg_new(&envoy_config_core_v3_RateLimitSettings_msginit, arena);
-}
-UPB_INLINE envoy_config_core_v3_RateLimitSettings *envoy_config_core_v3_RateLimitSettings_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_core_v3_RateLimitSettings *ret = envoy_config_core_v3_RateLimitSettings_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_RateLimitSettings_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_core_v3_RateLimitSettings_serialize(const envoy_config_core_v3_RateLimitSettings *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_core_v3_RateLimitSettings_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_config_core_v3_RateLimitSettings_has_max_tokens(const envoy_config_core_v3_RateLimitSettings *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_core_v3_RateLimitSettings_max_tokens(const envoy_config_core_v3_RateLimitSettings *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct google_protobuf_UInt32Value*); }
-UPB_INLINE bool envoy_config_core_v3_RateLimitSettings_has_fill_rate(const envoy_config_core_v3_RateLimitSettings *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
-UPB_INLINE const struct google_protobuf_DoubleValue* envoy_config_core_v3_RateLimitSettings_fill_rate(const envoy_config_core_v3_RateLimitSettings *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_DoubleValue*); }
-
-UPB_INLINE void envoy_config_core_v3_RateLimitSettings_set_max_tokens(envoy_config_core_v3_RateLimitSettings *msg, struct google_protobuf_UInt32Value* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct google_protobuf_UInt32Value*) = value;
-}
-UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_RateLimitSettings_mutable_max_tokens(envoy_config_core_v3_RateLimitSettings *msg, upb_arena *arena) {
- struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_core_v3_RateLimitSettings_max_tokens(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_RateLimitSettings_set_max_tokens(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_core_v3_RateLimitSettings_set_fill_rate(envoy_config_core_v3_RateLimitSettings *msg, struct google_protobuf_DoubleValue* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_DoubleValue*) = value;
-}
-UPB_INLINE struct google_protobuf_DoubleValue* envoy_config_core_v3_RateLimitSettings_mutable_fill_rate(envoy_config_core_v3_RateLimitSettings *msg, upb_arena *arena) {
- struct google_protobuf_DoubleValue* sub = (struct google_protobuf_DoubleValue*)envoy_config_core_v3_RateLimitSettings_fill_rate(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_DoubleValue*)_upb_msg_new(&google_protobuf_DoubleValue_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_RateLimitSettings_set_fill_rate(msg, sub);
- }
- return sub;
-}
-
-/* envoy.config.core.v3.ConfigSource */
-
-UPB_INLINE envoy_config_core_v3_ConfigSource *envoy_config_core_v3_ConfigSource_new(upb_arena *arena) {
- return (envoy_config_core_v3_ConfigSource *)_upb_msg_new(&envoy_config_core_v3_ConfigSource_msginit, arena);
-}
-UPB_INLINE envoy_config_core_v3_ConfigSource *envoy_config_core_v3_ConfigSource_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_core_v3_ConfigSource *ret = envoy_config_core_v3_ConfigSource_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_ConfigSource_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_core_v3_ConfigSource_serialize(const envoy_config_core_v3_ConfigSource *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_core_v3_ConfigSource_msginit, arena, len);
-}
-
-typedef enum {
- envoy_config_core_v3_ConfigSource_config_source_specifier_path = 1,
- envoy_config_core_v3_ConfigSource_config_source_specifier_api_config_source = 2,
- envoy_config_core_v3_ConfigSource_config_source_specifier_ads = 3,
- envoy_config_core_v3_ConfigSource_config_source_specifier_self = 5,
- envoy_config_core_v3_ConfigSource_config_source_specifier_NOT_SET = 0
-} envoy_config_core_v3_ConfigSource_config_source_specifier_oneofcases;
-UPB_INLINE envoy_config_core_v3_ConfigSource_config_source_specifier_oneofcases envoy_config_core_v3_ConfigSource_config_source_specifier_case(const envoy_config_core_v3_ConfigSource* msg) { return (envoy_config_core_v3_ConfigSource_config_source_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(24, 40), int32_t); }
-
-UPB_INLINE bool envoy_config_core_v3_ConfigSource_has_path(const envoy_config_core_v3_ConfigSource *msg) { return _upb_getoneofcase(msg, UPB_SIZE(24, 40)) == 1; }
-UPB_INLINE upb_strview envoy_config_core_v3_ConfigSource_path(const envoy_config_core_v3_ConfigSource *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(16, 24), UPB_SIZE(24, 40), 1, upb_strview_make("", strlen(""))); }
-UPB_INLINE bool envoy_config_core_v3_ConfigSource_has_api_config_source(const envoy_config_core_v3_ConfigSource *msg) { return _upb_getoneofcase(msg, UPB_SIZE(24, 40)) == 2; }
-UPB_INLINE const envoy_config_core_v3_ApiConfigSource* envoy_config_core_v3_ConfigSource_api_config_source(const envoy_config_core_v3_ConfigSource *msg) { return UPB_READ_ONEOF(msg, const envoy_config_core_v3_ApiConfigSource*, UPB_SIZE(16, 24), UPB_SIZE(24, 40), 2, NULL); }
-UPB_INLINE bool envoy_config_core_v3_ConfigSource_has_ads(const envoy_config_core_v3_ConfigSource *msg) { return _upb_getoneofcase(msg, UPB_SIZE(24, 40)) == 3; }
-UPB_INLINE const envoy_config_core_v3_AggregatedConfigSource* envoy_config_core_v3_ConfigSource_ads(const envoy_config_core_v3_ConfigSource *msg) { return UPB_READ_ONEOF(msg, const envoy_config_core_v3_AggregatedConfigSource*, UPB_SIZE(16, 24), UPB_SIZE(24, 40), 3, NULL); }
-UPB_INLINE bool envoy_config_core_v3_ConfigSource_has_initial_fetch_timeout(const envoy_config_core_v3_ConfigSource *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 8)); }
-UPB_INLINE const struct google_protobuf_Duration* envoy_config_core_v3_ConfigSource_initial_fetch_timeout(const envoy_config_core_v3_ConfigSource *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const struct google_protobuf_Duration*); }
-UPB_INLINE bool envoy_config_core_v3_ConfigSource_has_self(const envoy_config_core_v3_ConfigSource *msg) { return _upb_getoneofcase(msg, UPB_SIZE(24, 40)) == 5; }
-UPB_INLINE const envoy_config_core_v3_SelfConfigSource* envoy_config_core_v3_ConfigSource_self(const envoy_config_core_v3_ConfigSource *msg) { return UPB_READ_ONEOF(msg, const envoy_config_core_v3_SelfConfigSource*, UPB_SIZE(16, 24), UPB_SIZE(24, 40), 5, NULL); }
-UPB_INLINE int32_t envoy_config_core_v3_ConfigSource_resource_api_version(const envoy_config_core_v3_ConfigSource *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
-UPB_INLINE bool envoy_config_core_v3_ConfigSource_has_authorities(const envoy_config_core_v3_ConfigSource *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 16)); }
-UPB_INLINE const struct udpa_core_v1_Authority* const* envoy_config_core_v3_ConfigSource_authorities(const envoy_config_core_v3_ConfigSource *msg, size_t *len) { return (const struct udpa_core_v1_Authority* const*)_upb_array_accessor(msg, UPB_SIZE(12, 16), len); }
-
-UPB_INLINE void envoy_config_core_v3_ConfigSource_set_path(envoy_config_core_v3_ConfigSource *msg, upb_strview value) {
- UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(16, 24), value, UPB_SIZE(24, 40), 1);
-}
-UPB_INLINE void envoy_config_core_v3_ConfigSource_set_api_config_source(envoy_config_core_v3_ConfigSource *msg, envoy_config_core_v3_ApiConfigSource* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_core_v3_ApiConfigSource*, UPB_SIZE(16, 24), value, UPB_SIZE(24, 40), 2);
-}
-UPB_INLINE struct envoy_config_core_v3_ApiConfigSource* envoy_config_core_v3_ConfigSource_mutable_api_config_source(envoy_config_core_v3_ConfigSource *msg, upb_arena *arena) {
- struct envoy_config_core_v3_ApiConfigSource* sub = (struct envoy_config_core_v3_ApiConfigSource*)envoy_config_core_v3_ConfigSource_api_config_source(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_ApiConfigSource*)_upb_msg_new(&envoy_config_core_v3_ApiConfigSource_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_ConfigSource_set_api_config_source(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_core_v3_ConfigSource_set_ads(envoy_config_core_v3_ConfigSource *msg, envoy_config_core_v3_AggregatedConfigSource* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_core_v3_AggregatedConfigSource*, UPB_SIZE(16, 24), value, UPB_SIZE(24, 40), 3);
-}
-UPB_INLINE struct envoy_config_core_v3_AggregatedConfigSource* envoy_config_core_v3_ConfigSource_mutable_ads(envoy_config_core_v3_ConfigSource *msg, upb_arena *arena) {
- struct envoy_config_core_v3_AggregatedConfigSource* sub = (struct envoy_config_core_v3_AggregatedConfigSource*)envoy_config_core_v3_ConfigSource_ads(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_AggregatedConfigSource*)_upb_msg_new(&envoy_config_core_v3_AggregatedConfigSource_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_ConfigSource_set_ads(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_core_v3_ConfigSource_set_initial_fetch_timeout(envoy_config_core_v3_ConfigSource *msg, struct google_protobuf_Duration* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), struct google_protobuf_Duration*) = value;
-}
-UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_ConfigSource_mutable_initial_fetch_timeout(envoy_config_core_v3_ConfigSource *msg, upb_arena *arena) {
- struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_core_v3_ConfigSource_initial_fetch_timeout(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_ConfigSource_set_initial_fetch_timeout(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_core_v3_ConfigSource_set_self(envoy_config_core_v3_ConfigSource *msg, envoy_config_core_v3_SelfConfigSource* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_core_v3_SelfConfigSource*, UPB_SIZE(16, 24), value, UPB_SIZE(24, 40), 5);
-}
-UPB_INLINE struct envoy_config_core_v3_SelfConfigSource* envoy_config_core_v3_ConfigSource_mutable_self(envoy_config_core_v3_ConfigSource *msg, upb_arena *arena) {
- struct envoy_config_core_v3_SelfConfigSource* sub = (struct envoy_config_core_v3_SelfConfigSource*)envoy_config_core_v3_ConfigSource_self(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_SelfConfigSource*)_upb_msg_new(&envoy_config_core_v3_SelfConfigSource_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_ConfigSource_set_self(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_core_v3_ConfigSource_set_resource_api_version(envoy_config_core_v3_ConfigSource *msg, int32_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
-}
-UPB_INLINE struct udpa_core_v1_Authority** envoy_config_core_v3_ConfigSource_mutable_authorities(envoy_config_core_v3_ConfigSource *msg, size_t *len) {
- return (struct udpa_core_v1_Authority**)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 16), len);
-}
-UPB_INLINE struct udpa_core_v1_Authority** envoy_config_core_v3_ConfigSource_resize_authorities(envoy_config_core_v3_ConfigSource *msg, size_t len, upb_arena *arena) {
- return (struct udpa_core_v1_Authority**)_upb_array_resize_accessor(msg, UPB_SIZE(12, 16), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct udpa_core_v1_Authority* envoy_config_core_v3_ConfigSource_add_authorities(envoy_config_core_v3_ConfigSource *msg, upb_arena *arena) {
- struct udpa_core_v1_Authority* sub = (struct udpa_core_v1_Authority*)_upb_msg_new(&udpa_core_v1_Authority_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(12, 16), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* ENVOY_CONFIG_CORE_V3_CONFIG_SOURCE_PROTO_UPB_H_ */
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/core/v3/config_source.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_CONFIG_CORE_V3_CONFIG_SOURCE_PROTO_UPB_H_
+#define ENVOY_CONFIG_CORE_V3_CONFIG_SOURCE_PROTO_UPB_H_
+
+#include "upb/msg.h"
+#include "upb/decode.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_config_core_v3_ApiConfigSource;
+struct envoy_config_core_v3_AggregatedConfigSource;
+struct envoy_config_core_v3_SelfConfigSource;
+struct envoy_config_core_v3_RateLimitSettings;
+struct envoy_config_core_v3_ConfigSource;
+typedef struct envoy_config_core_v3_ApiConfigSource envoy_config_core_v3_ApiConfigSource;
+typedef struct envoy_config_core_v3_AggregatedConfigSource envoy_config_core_v3_AggregatedConfigSource;
+typedef struct envoy_config_core_v3_SelfConfigSource envoy_config_core_v3_SelfConfigSource;
+typedef struct envoy_config_core_v3_RateLimitSettings envoy_config_core_v3_RateLimitSettings;
+typedef struct envoy_config_core_v3_ConfigSource envoy_config_core_v3_ConfigSource;
+extern const upb_msglayout envoy_config_core_v3_ApiConfigSource_msginit;
+extern const upb_msglayout envoy_config_core_v3_AggregatedConfigSource_msginit;
+extern const upb_msglayout envoy_config_core_v3_SelfConfigSource_msginit;
+extern const upb_msglayout envoy_config_core_v3_RateLimitSettings_msginit;
+extern const upb_msglayout envoy_config_core_v3_ConfigSource_msginit;
+struct envoy_config_core_v3_GrpcService;
+struct google_protobuf_DoubleValue;
+struct google_protobuf_Duration;
+struct google_protobuf_UInt32Value;
+struct udpa_core_v1_Authority;
+extern const upb_msglayout envoy_config_core_v3_GrpcService_msginit;
+extern const upb_msglayout google_protobuf_DoubleValue_msginit;
+extern const upb_msglayout google_protobuf_Duration_msginit;
+extern const upb_msglayout google_protobuf_UInt32Value_msginit;
+extern const upb_msglayout udpa_core_v1_Authority_msginit;
+
+typedef enum {
+ envoy_config_core_v3_ApiConfigSource_DEPRECATED_AND_UNAVAILABLE_DO_NOT_USE = 0,
+ envoy_config_core_v3_ApiConfigSource_REST = 1,
+ envoy_config_core_v3_ApiConfigSource_GRPC = 2,
+ envoy_config_core_v3_ApiConfigSource_DELTA_GRPC = 3,
+ envoy_config_core_v3_ApiConfigSource_AGGREGATED_GRPC = 5,
+ envoy_config_core_v3_ApiConfigSource_AGGREGATED_DELTA_GRPC = 6
+} envoy_config_core_v3_ApiConfigSource_ApiType;
+
+typedef enum {
+ envoy_config_core_v3_AUTO = 0,
+ envoy_config_core_v3_V2 = 1,
+ envoy_config_core_v3_V3 = 2
+} envoy_config_core_v3_ApiVersion;
+
+
+/* envoy.config.core.v3.ApiConfigSource */
+
+UPB_INLINE envoy_config_core_v3_ApiConfigSource *envoy_config_core_v3_ApiConfigSource_new(upb_arena *arena) {
+ return (envoy_config_core_v3_ApiConfigSource *)_upb_msg_new(&envoy_config_core_v3_ApiConfigSource_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_ApiConfigSource *envoy_config_core_v3_ApiConfigSource_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_core_v3_ApiConfigSource *ret = envoy_config_core_v3_ApiConfigSource_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_ApiConfigSource_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_core_v3_ApiConfigSource_serialize(const envoy_config_core_v3_ApiConfigSource *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_core_v3_ApiConfigSource_msginit, arena, len);
+}
+
+UPB_INLINE int32_t envoy_config_core_v3_ApiConfigSource_api_type(const envoy_config_core_v3_ApiConfigSource *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
+UPB_INLINE upb_strview const* envoy_config_core_v3_ApiConfigSource_cluster_names(const envoy_config_core_v3_ApiConfigSource *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(32, 48), len); }
+UPB_INLINE bool envoy_config_core_v3_ApiConfigSource_has_refresh_delay(const envoy_config_core_v3_ApiConfigSource *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 24)); }
+UPB_INLINE const struct google_protobuf_Duration* envoy_config_core_v3_ApiConfigSource_refresh_delay(const envoy_config_core_v3_ApiConfigSource *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 24), const struct google_protobuf_Duration*); }
+UPB_INLINE bool envoy_config_core_v3_ApiConfigSource_has_grpc_services(const envoy_config_core_v3_ApiConfigSource *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(36, 56)); }
+UPB_INLINE const struct envoy_config_core_v3_GrpcService* const* envoy_config_core_v3_ApiConfigSource_grpc_services(const envoy_config_core_v3_ApiConfigSource *msg, size_t *len) { return (const struct envoy_config_core_v3_GrpcService* const*)_upb_array_accessor(msg, UPB_SIZE(36, 56), len); }
+UPB_INLINE bool envoy_config_core_v3_ApiConfigSource_has_request_timeout(const envoy_config_core_v3_ApiConfigSource *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 32)); }
+UPB_INLINE const struct google_protobuf_Duration* envoy_config_core_v3_ApiConfigSource_request_timeout(const envoy_config_core_v3_ApiConfigSource *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 32), const struct google_protobuf_Duration*); }
+UPB_INLINE bool envoy_config_core_v3_ApiConfigSource_has_rate_limit_settings(const envoy_config_core_v3_ApiConfigSource *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 40)); }
+UPB_INLINE const envoy_config_core_v3_RateLimitSettings* envoy_config_core_v3_ApiConfigSource_rate_limit_settings(const envoy_config_core_v3_ApiConfigSource *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 40), const envoy_config_core_v3_RateLimitSettings*); }
+UPB_INLINE bool envoy_config_core_v3_ApiConfigSource_set_node_on_first_message_only(const envoy_config_core_v3_ApiConfigSource *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), bool); }
+UPB_INLINE int32_t envoy_config_core_v3_ApiConfigSource_transport_api_version(const envoy_config_core_v3_ApiConfigSource *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); }
+
+UPB_INLINE void envoy_config_core_v3_ApiConfigSource_set_api_type(envoy_config_core_v3_ApiConfigSource *msg, int32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
+}
+UPB_INLINE upb_strview* envoy_config_core_v3_ApiConfigSource_mutable_cluster_names(envoy_config_core_v3_ApiConfigSource *msg, size_t *len) {
+ return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(32, 48), len);
+}
+UPB_INLINE upb_strview* envoy_config_core_v3_ApiConfigSource_resize_cluster_names(envoy_config_core_v3_ApiConfigSource *msg, size_t len, upb_arena *arena) {
+ return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(32, 48), len, UPB_TYPE_STRING, arena);
+}
+UPB_INLINE bool envoy_config_core_v3_ApiConfigSource_add_cluster_names(envoy_config_core_v3_ApiConfigSource *msg, upb_strview val, upb_arena *arena) {
+ return _upb_array_append_accessor(msg, UPB_SIZE(32, 48), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
+ arena);
+}
+UPB_INLINE void envoy_config_core_v3_ApiConfigSource_set_refresh_delay(envoy_config_core_v3_ApiConfigSource *msg, struct google_protobuf_Duration* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 24), struct google_protobuf_Duration*) = value;
+}
+UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_ApiConfigSource_mutable_refresh_delay(envoy_config_core_v3_ApiConfigSource *msg, upb_arena *arena) {
+ struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_core_v3_ApiConfigSource_refresh_delay(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_ApiConfigSource_set_refresh_delay(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE struct envoy_config_core_v3_GrpcService** envoy_config_core_v3_ApiConfigSource_mutable_grpc_services(envoy_config_core_v3_ApiConfigSource *msg, size_t *len) {
+ return (struct envoy_config_core_v3_GrpcService**)_upb_array_mutable_accessor(msg, UPB_SIZE(36, 56), len);
+}
+UPB_INLINE struct envoy_config_core_v3_GrpcService** envoy_config_core_v3_ApiConfigSource_resize_grpc_services(envoy_config_core_v3_ApiConfigSource *msg, size_t len, upb_arena *arena) {
+ return (struct envoy_config_core_v3_GrpcService**)_upb_array_resize_accessor(msg, UPB_SIZE(36, 56), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_config_core_v3_GrpcService* envoy_config_core_v3_ApiConfigSource_add_grpc_services(envoy_config_core_v3_ApiConfigSource *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_GrpcService* sub = (struct envoy_config_core_v3_GrpcService*)_upb_msg_new(&envoy_config_core_v3_GrpcService_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(36, 56), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_ApiConfigSource_set_request_timeout(envoy_config_core_v3_ApiConfigSource *msg, struct google_protobuf_Duration* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 32), struct google_protobuf_Duration*) = value;
+}
+UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_ApiConfigSource_mutable_request_timeout(envoy_config_core_v3_ApiConfigSource *msg, upb_arena *arena) {
+ struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_core_v3_ApiConfigSource_request_timeout(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_ApiConfigSource_set_request_timeout(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_ApiConfigSource_set_rate_limit_settings(envoy_config_core_v3_ApiConfigSource *msg, envoy_config_core_v3_RateLimitSettings* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 40), envoy_config_core_v3_RateLimitSettings*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_RateLimitSettings* envoy_config_core_v3_ApiConfigSource_mutable_rate_limit_settings(envoy_config_core_v3_ApiConfigSource *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_RateLimitSettings* sub = (struct envoy_config_core_v3_RateLimitSettings*)envoy_config_core_v3_ApiConfigSource_rate_limit_settings(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_RateLimitSettings*)_upb_msg_new(&envoy_config_core_v3_RateLimitSettings_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_ApiConfigSource_set_rate_limit_settings(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_ApiConfigSource_set_set_node_on_first_message_only(envoy_config_core_v3_ApiConfigSource *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 16), bool) = value;
+}
+UPB_INLINE void envoy_config_core_v3_ApiConfigSource_set_transport_api_version(envoy_config_core_v3_ApiConfigSource *msg, int32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
+}
+
+/* envoy.config.core.v3.AggregatedConfigSource */
+
+UPB_INLINE envoy_config_core_v3_AggregatedConfigSource *envoy_config_core_v3_AggregatedConfigSource_new(upb_arena *arena) {
+ return (envoy_config_core_v3_AggregatedConfigSource *)_upb_msg_new(&envoy_config_core_v3_AggregatedConfigSource_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_AggregatedConfigSource *envoy_config_core_v3_AggregatedConfigSource_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_core_v3_AggregatedConfigSource *ret = envoy_config_core_v3_AggregatedConfigSource_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_AggregatedConfigSource_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_core_v3_AggregatedConfigSource_serialize(const envoy_config_core_v3_AggregatedConfigSource *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_core_v3_AggregatedConfigSource_msginit, arena, len);
+}
+
+
+
+/* envoy.config.core.v3.SelfConfigSource */
+
+UPB_INLINE envoy_config_core_v3_SelfConfigSource *envoy_config_core_v3_SelfConfigSource_new(upb_arena *arena) {
+ return (envoy_config_core_v3_SelfConfigSource *)_upb_msg_new(&envoy_config_core_v3_SelfConfigSource_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_SelfConfigSource *envoy_config_core_v3_SelfConfigSource_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_core_v3_SelfConfigSource *ret = envoy_config_core_v3_SelfConfigSource_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_SelfConfigSource_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_core_v3_SelfConfigSource_serialize(const envoy_config_core_v3_SelfConfigSource *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_core_v3_SelfConfigSource_msginit, arena, len);
+}
+
+UPB_INLINE int32_t envoy_config_core_v3_SelfConfigSource_transport_api_version(const envoy_config_core_v3_SelfConfigSource *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
+
+UPB_INLINE void envoy_config_core_v3_SelfConfigSource_set_transport_api_version(envoy_config_core_v3_SelfConfigSource *msg, int32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
+}
+
+/* envoy.config.core.v3.RateLimitSettings */
+
+UPB_INLINE envoy_config_core_v3_RateLimitSettings *envoy_config_core_v3_RateLimitSettings_new(upb_arena *arena) {
+ return (envoy_config_core_v3_RateLimitSettings *)_upb_msg_new(&envoy_config_core_v3_RateLimitSettings_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_RateLimitSettings *envoy_config_core_v3_RateLimitSettings_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_core_v3_RateLimitSettings *ret = envoy_config_core_v3_RateLimitSettings_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_RateLimitSettings_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_core_v3_RateLimitSettings_serialize(const envoy_config_core_v3_RateLimitSettings *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_core_v3_RateLimitSettings_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_core_v3_RateLimitSettings_has_max_tokens(const envoy_config_core_v3_RateLimitSettings *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_core_v3_RateLimitSettings_max_tokens(const envoy_config_core_v3_RateLimitSettings *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct google_protobuf_UInt32Value*); }
+UPB_INLINE bool envoy_config_core_v3_RateLimitSettings_has_fill_rate(const envoy_config_core_v3_RateLimitSettings *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
+UPB_INLINE const struct google_protobuf_DoubleValue* envoy_config_core_v3_RateLimitSettings_fill_rate(const envoy_config_core_v3_RateLimitSettings *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_DoubleValue*); }
+
+UPB_INLINE void envoy_config_core_v3_RateLimitSettings_set_max_tokens(envoy_config_core_v3_RateLimitSettings *msg, struct google_protobuf_UInt32Value* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_RateLimitSettings_mutable_max_tokens(envoy_config_core_v3_RateLimitSettings *msg, upb_arena *arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_core_v3_RateLimitSettings_max_tokens(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_RateLimitSettings_set_max_tokens(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_RateLimitSettings_set_fill_rate(envoy_config_core_v3_RateLimitSettings *msg, struct google_protobuf_DoubleValue* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_DoubleValue*) = value;
+}
+UPB_INLINE struct google_protobuf_DoubleValue* envoy_config_core_v3_RateLimitSettings_mutable_fill_rate(envoy_config_core_v3_RateLimitSettings *msg, upb_arena *arena) {
+ struct google_protobuf_DoubleValue* sub = (struct google_protobuf_DoubleValue*)envoy_config_core_v3_RateLimitSettings_fill_rate(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_DoubleValue*)_upb_msg_new(&google_protobuf_DoubleValue_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_RateLimitSettings_set_fill_rate(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.core.v3.ConfigSource */
+
+UPB_INLINE envoy_config_core_v3_ConfigSource *envoy_config_core_v3_ConfigSource_new(upb_arena *arena) {
+ return (envoy_config_core_v3_ConfigSource *)_upb_msg_new(&envoy_config_core_v3_ConfigSource_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_ConfigSource *envoy_config_core_v3_ConfigSource_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_core_v3_ConfigSource *ret = envoy_config_core_v3_ConfigSource_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_ConfigSource_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_core_v3_ConfigSource_serialize(const envoy_config_core_v3_ConfigSource *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_core_v3_ConfigSource_msginit, arena, len);
+}
+
+typedef enum {
+ envoy_config_core_v3_ConfigSource_config_source_specifier_path = 1,
+ envoy_config_core_v3_ConfigSource_config_source_specifier_api_config_source = 2,
+ envoy_config_core_v3_ConfigSource_config_source_specifier_ads = 3,
+ envoy_config_core_v3_ConfigSource_config_source_specifier_self = 5,
+ envoy_config_core_v3_ConfigSource_config_source_specifier_NOT_SET = 0
+} envoy_config_core_v3_ConfigSource_config_source_specifier_oneofcases;
+UPB_INLINE envoy_config_core_v3_ConfigSource_config_source_specifier_oneofcases envoy_config_core_v3_ConfigSource_config_source_specifier_case(const envoy_config_core_v3_ConfigSource* msg) { return (envoy_config_core_v3_ConfigSource_config_source_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(24, 40), int32_t); }
+
+UPB_INLINE bool envoy_config_core_v3_ConfigSource_has_path(const envoy_config_core_v3_ConfigSource *msg) { return _upb_getoneofcase(msg, UPB_SIZE(24, 40)) == 1; }
+UPB_INLINE upb_strview envoy_config_core_v3_ConfigSource_path(const envoy_config_core_v3_ConfigSource *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(16, 24), UPB_SIZE(24, 40), 1, upb_strview_make("", strlen(""))); }
+UPB_INLINE bool envoy_config_core_v3_ConfigSource_has_api_config_source(const envoy_config_core_v3_ConfigSource *msg) { return _upb_getoneofcase(msg, UPB_SIZE(24, 40)) == 2; }
+UPB_INLINE const envoy_config_core_v3_ApiConfigSource* envoy_config_core_v3_ConfigSource_api_config_source(const envoy_config_core_v3_ConfigSource *msg) { return UPB_READ_ONEOF(msg, const envoy_config_core_v3_ApiConfigSource*, UPB_SIZE(16, 24), UPB_SIZE(24, 40), 2, NULL); }
+UPB_INLINE bool envoy_config_core_v3_ConfigSource_has_ads(const envoy_config_core_v3_ConfigSource *msg) { return _upb_getoneofcase(msg, UPB_SIZE(24, 40)) == 3; }
+UPB_INLINE const envoy_config_core_v3_AggregatedConfigSource* envoy_config_core_v3_ConfigSource_ads(const envoy_config_core_v3_ConfigSource *msg) { return UPB_READ_ONEOF(msg, const envoy_config_core_v3_AggregatedConfigSource*, UPB_SIZE(16, 24), UPB_SIZE(24, 40), 3, NULL); }
+UPB_INLINE bool envoy_config_core_v3_ConfigSource_has_initial_fetch_timeout(const envoy_config_core_v3_ConfigSource *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 8)); }
+UPB_INLINE const struct google_protobuf_Duration* envoy_config_core_v3_ConfigSource_initial_fetch_timeout(const envoy_config_core_v3_ConfigSource *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const struct google_protobuf_Duration*); }
+UPB_INLINE bool envoy_config_core_v3_ConfigSource_has_self(const envoy_config_core_v3_ConfigSource *msg) { return _upb_getoneofcase(msg, UPB_SIZE(24, 40)) == 5; }
+UPB_INLINE const envoy_config_core_v3_SelfConfigSource* envoy_config_core_v3_ConfigSource_self(const envoy_config_core_v3_ConfigSource *msg) { return UPB_READ_ONEOF(msg, const envoy_config_core_v3_SelfConfigSource*, UPB_SIZE(16, 24), UPB_SIZE(24, 40), 5, NULL); }
+UPB_INLINE int32_t envoy_config_core_v3_ConfigSource_resource_api_version(const envoy_config_core_v3_ConfigSource *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
+UPB_INLINE bool envoy_config_core_v3_ConfigSource_has_authorities(const envoy_config_core_v3_ConfigSource *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 16)); }
+UPB_INLINE const struct udpa_core_v1_Authority* const* envoy_config_core_v3_ConfigSource_authorities(const envoy_config_core_v3_ConfigSource *msg, size_t *len) { return (const struct udpa_core_v1_Authority* const*)_upb_array_accessor(msg, UPB_SIZE(12, 16), len); }
+
+UPB_INLINE void envoy_config_core_v3_ConfigSource_set_path(envoy_config_core_v3_ConfigSource *msg, upb_strview value) {
+ UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(16, 24), value, UPB_SIZE(24, 40), 1);
+}
+UPB_INLINE void envoy_config_core_v3_ConfigSource_set_api_config_source(envoy_config_core_v3_ConfigSource *msg, envoy_config_core_v3_ApiConfigSource* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_core_v3_ApiConfigSource*, UPB_SIZE(16, 24), value, UPB_SIZE(24, 40), 2);
+}
+UPB_INLINE struct envoy_config_core_v3_ApiConfigSource* envoy_config_core_v3_ConfigSource_mutable_api_config_source(envoy_config_core_v3_ConfigSource *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_ApiConfigSource* sub = (struct envoy_config_core_v3_ApiConfigSource*)envoy_config_core_v3_ConfigSource_api_config_source(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_ApiConfigSource*)_upb_msg_new(&envoy_config_core_v3_ApiConfigSource_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_ConfigSource_set_api_config_source(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_ConfigSource_set_ads(envoy_config_core_v3_ConfigSource *msg, envoy_config_core_v3_AggregatedConfigSource* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_core_v3_AggregatedConfigSource*, UPB_SIZE(16, 24), value, UPB_SIZE(24, 40), 3);
+}
+UPB_INLINE struct envoy_config_core_v3_AggregatedConfigSource* envoy_config_core_v3_ConfigSource_mutable_ads(envoy_config_core_v3_ConfigSource *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_AggregatedConfigSource* sub = (struct envoy_config_core_v3_AggregatedConfigSource*)envoy_config_core_v3_ConfigSource_ads(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_AggregatedConfigSource*)_upb_msg_new(&envoy_config_core_v3_AggregatedConfigSource_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_ConfigSource_set_ads(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_ConfigSource_set_initial_fetch_timeout(envoy_config_core_v3_ConfigSource *msg, struct google_protobuf_Duration* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), struct google_protobuf_Duration*) = value;
+}
+UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_ConfigSource_mutable_initial_fetch_timeout(envoy_config_core_v3_ConfigSource *msg, upb_arena *arena) {
+ struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_core_v3_ConfigSource_initial_fetch_timeout(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_ConfigSource_set_initial_fetch_timeout(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_ConfigSource_set_self(envoy_config_core_v3_ConfigSource *msg, envoy_config_core_v3_SelfConfigSource* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_core_v3_SelfConfigSource*, UPB_SIZE(16, 24), value, UPB_SIZE(24, 40), 5);
+}
+UPB_INLINE struct envoy_config_core_v3_SelfConfigSource* envoy_config_core_v3_ConfigSource_mutable_self(envoy_config_core_v3_ConfigSource *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_SelfConfigSource* sub = (struct envoy_config_core_v3_SelfConfigSource*)envoy_config_core_v3_ConfigSource_self(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_SelfConfigSource*)_upb_msg_new(&envoy_config_core_v3_SelfConfigSource_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_ConfigSource_set_self(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_ConfigSource_set_resource_api_version(envoy_config_core_v3_ConfigSource *msg, int32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
+}
+UPB_INLINE struct udpa_core_v1_Authority** envoy_config_core_v3_ConfigSource_mutable_authorities(envoy_config_core_v3_ConfigSource *msg, size_t *len) {
+ return (struct udpa_core_v1_Authority**)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 16), len);
+}
+UPB_INLINE struct udpa_core_v1_Authority** envoy_config_core_v3_ConfigSource_resize_authorities(envoy_config_core_v3_ConfigSource *msg, size_t len, upb_arena *arena) {
+ return (struct udpa_core_v1_Authority**)_upb_array_resize_accessor(msg, UPB_SIZE(12, 16), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct udpa_core_v1_Authority* envoy_config_core_v3_ConfigSource_add_authorities(envoy_config_core_v3_ConfigSource *msg, upb_arena *arena) {
+ struct udpa_core_v1_Authority* sub = (struct udpa_core_v1_Authority*)_upb_msg_new(&udpa_core_v1_Authority_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(12, 16), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_CONFIG_CORE_V3_CONFIG_SOURCE_PROTO_UPB_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.c
index 2b7c5e6c0dc..1d02920ee9a 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.c
@@ -1,34 +1,34 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/config/core/v3/event_service_config.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include <stddef.h>
-#include "upb/msg.h"
-#include "envoy/config/core/v3/event_service_config.upb.h"
-#include "envoy/config/core/v3/grpc_service.upb.h"
-#include "udpa/annotations/status.upb.h"
-#include "udpa/annotations/versioning.upb.h"
-#include "validate/validate.upb.h"
-
-#include "upb/port_def.inc"
-
-static const upb_msglayout *const envoy_config_core_v3_EventServiceConfig_submsgs[1] = {
- &envoy_config_core_v3_GrpcService_msginit,
-};
-
-static const upb_msglayout_field envoy_config_core_v3_EventServiceConfig__fields[1] = {
- {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, 1},
-};
-
-const upb_msglayout envoy_config_core_v3_EventServiceConfig_msginit = {
- &envoy_config_core_v3_EventServiceConfig_submsgs[0],
- &envoy_config_core_v3_EventServiceConfig__fields[0],
- UPB_SIZE(8, 16), 1, false,
-};
-
-#include "upb/port_undef.inc"
-
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/core/v3/event_service_config.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg.h"
+#include "envoy/config/core/v3/event_service_config.upb.h"
+#include "envoy/config/core/v3/grpc_service.upb.h"
+#include "udpa/annotations/status.upb.h"
+#include "udpa/annotations/versioning.upb.h"
+#include "validate/validate.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_msglayout *const envoy_config_core_v3_EventServiceConfig_submsgs[1] = {
+ &envoy_config_core_v3_GrpcService_msginit,
+};
+
+static const upb_msglayout_field envoy_config_core_v3_EventServiceConfig__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, 1},
+};
+
+const upb_msglayout envoy_config_core_v3_EventServiceConfig_msginit = {
+ &envoy_config_core_v3_EventServiceConfig_submsgs[0],
+ &envoy_config_core_v3_EventServiceConfig__fields[0],
+ UPB_SIZE(8, 16), 1, false,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.h
index 24fd4f1bfa3..3d7bb0ad547 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.h
@@ -1,71 +1,71 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/config/core/v3/event_service_config.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef ENVOY_CONFIG_CORE_V3_EVENT_SERVICE_CONFIG_PROTO_UPB_H_
-#define ENVOY_CONFIG_CORE_V3_EVENT_SERVICE_CONFIG_PROTO_UPB_H_
-
-#include "upb/msg.h"
-#include "upb/decode.h"
-#include "upb/encode.h"
-
-#include "upb/port_def.inc"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct envoy_config_core_v3_EventServiceConfig;
-typedef struct envoy_config_core_v3_EventServiceConfig envoy_config_core_v3_EventServiceConfig;
-extern const upb_msglayout envoy_config_core_v3_EventServiceConfig_msginit;
-struct envoy_config_core_v3_GrpcService;
-extern const upb_msglayout envoy_config_core_v3_GrpcService_msginit;
-
-
-/* envoy.config.core.v3.EventServiceConfig */
-
-UPB_INLINE envoy_config_core_v3_EventServiceConfig *envoy_config_core_v3_EventServiceConfig_new(upb_arena *arena) {
- return (envoy_config_core_v3_EventServiceConfig *)_upb_msg_new(&envoy_config_core_v3_EventServiceConfig_msginit, arena);
-}
-UPB_INLINE envoy_config_core_v3_EventServiceConfig *envoy_config_core_v3_EventServiceConfig_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_core_v3_EventServiceConfig *ret = envoy_config_core_v3_EventServiceConfig_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_EventServiceConfig_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_core_v3_EventServiceConfig_serialize(const envoy_config_core_v3_EventServiceConfig *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_core_v3_EventServiceConfig_msginit, arena, len);
-}
-
-typedef enum {
- envoy_config_core_v3_EventServiceConfig_config_source_specifier_grpc_service = 1,
- envoy_config_core_v3_EventServiceConfig_config_source_specifier_NOT_SET = 0
-} envoy_config_core_v3_EventServiceConfig_config_source_specifier_oneofcases;
-UPB_INLINE envoy_config_core_v3_EventServiceConfig_config_source_specifier_oneofcases envoy_config_core_v3_EventServiceConfig_config_source_specifier_case(const envoy_config_core_v3_EventServiceConfig* msg) { return (envoy_config_core_v3_EventServiceConfig_config_source_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 8), int32_t); }
-
-UPB_INLINE bool envoy_config_core_v3_EventServiceConfig_has_grpc_service(const envoy_config_core_v3_EventServiceConfig *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 1; }
-UPB_INLINE const struct envoy_config_core_v3_GrpcService* envoy_config_core_v3_EventServiceConfig_grpc_service(const envoy_config_core_v3_EventServiceConfig *msg) { return UPB_READ_ONEOF(msg, const struct envoy_config_core_v3_GrpcService*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 1, NULL); }
-
-UPB_INLINE void envoy_config_core_v3_EventServiceConfig_set_grpc_service(envoy_config_core_v3_EventServiceConfig *msg, struct envoy_config_core_v3_GrpcService* value) {
- UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_GrpcService*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 1);
-}
-UPB_INLINE struct envoy_config_core_v3_GrpcService* envoy_config_core_v3_EventServiceConfig_mutable_grpc_service(envoy_config_core_v3_EventServiceConfig *msg, upb_arena *arena) {
- struct envoy_config_core_v3_GrpcService* sub = (struct envoy_config_core_v3_GrpcService*)envoy_config_core_v3_EventServiceConfig_grpc_service(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_GrpcService*)_upb_msg_new(&envoy_config_core_v3_GrpcService_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_EventServiceConfig_set_grpc_service(msg, sub);
- }
- return sub;
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* ENVOY_CONFIG_CORE_V3_EVENT_SERVICE_CONFIG_PROTO_UPB_H_ */
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/core/v3/event_service_config.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_CONFIG_CORE_V3_EVENT_SERVICE_CONFIG_PROTO_UPB_H_
+#define ENVOY_CONFIG_CORE_V3_EVENT_SERVICE_CONFIG_PROTO_UPB_H_
+
+#include "upb/msg.h"
+#include "upb/decode.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_config_core_v3_EventServiceConfig;
+typedef struct envoy_config_core_v3_EventServiceConfig envoy_config_core_v3_EventServiceConfig;
+extern const upb_msglayout envoy_config_core_v3_EventServiceConfig_msginit;
+struct envoy_config_core_v3_GrpcService;
+extern const upb_msglayout envoy_config_core_v3_GrpcService_msginit;
+
+
+/* envoy.config.core.v3.EventServiceConfig */
+
+UPB_INLINE envoy_config_core_v3_EventServiceConfig *envoy_config_core_v3_EventServiceConfig_new(upb_arena *arena) {
+ return (envoy_config_core_v3_EventServiceConfig *)_upb_msg_new(&envoy_config_core_v3_EventServiceConfig_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_EventServiceConfig *envoy_config_core_v3_EventServiceConfig_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_core_v3_EventServiceConfig *ret = envoy_config_core_v3_EventServiceConfig_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_EventServiceConfig_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_core_v3_EventServiceConfig_serialize(const envoy_config_core_v3_EventServiceConfig *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_core_v3_EventServiceConfig_msginit, arena, len);
+}
+
+typedef enum {
+ envoy_config_core_v3_EventServiceConfig_config_source_specifier_grpc_service = 1,
+ envoy_config_core_v3_EventServiceConfig_config_source_specifier_NOT_SET = 0
+} envoy_config_core_v3_EventServiceConfig_config_source_specifier_oneofcases;
+UPB_INLINE envoy_config_core_v3_EventServiceConfig_config_source_specifier_oneofcases envoy_config_core_v3_EventServiceConfig_config_source_specifier_case(const envoy_config_core_v3_EventServiceConfig* msg) { return (envoy_config_core_v3_EventServiceConfig_config_source_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 8), int32_t); }
+
+UPB_INLINE bool envoy_config_core_v3_EventServiceConfig_has_grpc_service(const envoy_config_core_v3_EventServiceConfig *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 1; }
+UPB_INLINE const struct envoy_config_core_v3_GrpcService* envoy_config_core_v3_EventServiceConfig_grpc_service(const envoy_config_core_v3_EventServiceConfig *msg) { return UPB_READ_ONEOF(msg, const struct envoy_config_core_v3_GrpcService*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 1, NULL); }
+
+UPB_INLINE void envoy_config_core_v3_EventServiceConfig_set_grpc_service(envoy_config_core_v3_EventServiceConfig *msg, struct envoy_config_core_v3_GrpcService* value) {
+ UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_GrpcService*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 1);
+}
+UPB_INLINE struct envoy_config_core_v3_GrpcService* envoy_config_core_v3_EventServiceConfig_mutable_grpc_service(envoy_config_core_v3_EventServiceConfig *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_GrpcService* sub = (struct envoy_config_core_v3_GrpcService*)envoy_config_core_v3_EventServiceConfig_grpc_service(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_GrpcService*)_upb_msg_new(&envoy_config_core_v3_GrpcService_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_EventServiceConfig_set_grpc_service(msg, sub);
+ }
+ return sub;
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_CONFIG_CORE_V3_EVENT_SERVICE_CONFIG_PROTO_UPB_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.c
index 02a04bf2f17..0fe1d608ddc 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.c
@@ -1,53 +1,53 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/config/core/v3/extension.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include <stddef.h>
-#include "upb/msg.h"
-#include "envoy/config/core/v3/extension.upb.h"
-#include "envoy/config/core/v3/config_source.upb.h"
-#include "google/protobuf/any.upb.h"
-#include "udpa/annotations/status.upb.h"
-#include "validate/validate.upb.h"
-
-#include "upb/port_def.inc"
-
-static const upb_msglayout *const envoy_config_core_v3_TypedExtensionConfig_submsgs[1] = {
- &google_protobuf_Any_msginit,
-};
-
-static const upb_msglayout_field envoy_config_core_v3_TypedExtensionConfig__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 11, 1},
-};
-
-const upb_msglayout envoy_config_core_v3_TypedExtensionConfig_msginit = {
- &envoy_config_core_v3_TypedExtensionConfig_submsgs[0],
- &envoy_config_core_v3_TypedExtensionConfig__fields[0],
- UPB_SIZE(16, 32), 2, false,
-};
-
-static const upb_msglayout *const envoy_config_core_v3_ExtensionConfigSource_submsgs[2] = {
- &envoy_config_core_v3_ConfigSource_msginit,
- &google_protobuf_Any_msginit,
-};
-
-static const upb_msglayout_field envoy_config_core_v3_ExtensionConfigSource__fields[4] = {
- {1, UPB_SIZE(4, 8), 0, 0, 11, 1},
- {2, UPB_SIZE(8, 16), 0, 1, 11, 1},
- {3, UPB_SIZE(0, 0), 0, 0, 8, 1},
- {4, UPB_SIZE(12, 24), 0, 0, 9, 3},
-};
-
-const upb_msglayout envoy_config_core_v3_ExtensionConfigSource_msginit = {
- &envoy_config_core_v3_ExtensionConfigSource_submsgs[0],
- &envoy_config_core_v3_ExtensionConfigSource__fields[0],
- UPB_SIZE(16, 32), 4, false,
-};
-
-#include "upb/port_undef.inc"
-
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/core/v3/extension.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg.h"
+#include "envoy/config/core/v3/extension.upb.h"
+#include "envoy/config/core/v3/config_source.upb.h"
+#include "google/protobuf/any.upb.h"
+#include "udpa/annotations/status.upb.h"
+#include "validate/validate.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_msglayout *const envoy_config_core_v3_TypedExtensionConfig_submsgs[1] = {
+ &google_protobuf_Any_msginit,
+};
+
+static const upb_msglayout_field envoy_config_core_v3_TypedExtensionConfig__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {2, UPB_SIZE(8, 16), 0, 0, 11, 1},
+};
+
+const upb_msglayout envoy_config_core_v3_TypedExtensionConfig_msginit = {
+ &envoy_config_core_v3_TypedExtensionConfig_submsgs[0],
+ &envoy_config_core_v3_TypedExtensionConfig__fields[0],
+ UPB_SIZE(16, 32), 2, false,
+};
+
+static const upb_msglayout *const envoy_config_core_v3_ExtensionConfigSource_submsgs[2] = {
+ &envoy_config_core_v3_ConfigSource_msginit,
+ &google_protobuf_Any_msginit,
+};
+
+static const upb_msglayout_field envoy_config_core_v3_ExtensionConfigSource__fields[4] = {
+ {1, UPB_SIZE(4, 8), 0, 0, 11, 1},
+ {2, UPB_SIZE(8, 16), 0, 1, 11, 1},
+ {3, UPB_SIZE(0, 0), 0, 0, 8, 1},
+ {4, UPB_SIZE(12, 24), 0, 0, 9, 3},
+};
+
+const upb_msglayout envoy_config_core_v3_ExtensionConfigSource_msginit = {
+ &envoy_config_core_v3_ExtensionConfigSource_submsgs[0],
+ &envoy_config_core_v3_ExtensionConfigSource__fields[0],
+ UPB_SIZE(16, 32), 4, false,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.h
index 5a6a54f2e35..d70b5bc8c65 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.h
@@ -1,133 +1,133 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/config/core/v3/extension.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef ENVOY_CONFIG_CORE_V3_EXTENSION_PROTO_UPB_H_
-#define ENVOY_CONFIG_CORE_V3_EXTENSION_PROTO_UPB_H_
-
-#include "upb/msg.h"
-#include "upb/decode.h"
-#include "upb/encode.h"
-
-#include "upb/port_def.inc"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct envoy_config_core_v3_TypedExtensionConfig;
-struct envoy_config_core_v3_ExtensionConfigSource;
-typedef struct envoy_config_core_v3_TypedExtensionConfig envoy_config_core_v3_TypedExtensionConfig;
-typedef struct envoy_config_core_v3_ExtensionConfigSource envoy_config_core_v3_ExtensionConfigSource;
-extern const upb_msglayout envoy_config_core_v3_TypedExtensionConfig_msginit;
-extern const upb_msglayout envoy_config_core_v3_ExtensionConfigSource_msginit;
-struct envoy_config_core_v3_ConfigSource;
-struct google_protobuf_Any;
-extern const upb_msglayout envoy_config_core_v3_ConfigSource_msginit;
-extern const upb_msglayout google_protobuf_Any_msginit;
-
-
-/* envoy.config.core.v3.TypedExtensionConfig */
-
-UPB_INLINE envoy_config_core_v3_TypedExtensionConfig *envoy_config_core_v3_TypedExtensionConfig_new(upb_arena *arena) {
- return (envoy_config_core_v3_TypedExtensionConfig *)_upb_msg_new(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena);
-}
-UPB_INLINE envoy_config_core_v3_TypedExtensionConfig *envoy_config_core_v3_TypedExtensionConfig_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_core_v3_TypedExtensionConfig *ret = envoy_config_core_v3_TypedExtensionConfig_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_TypedExtensionConfig_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_core_v3_TypedExtensionConfig_serialize(const envoy_config_core_v3_TypedExtensionConfig *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_core_v3_TypedExtensionConfig_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview envoy_config_core_v3_TypedExtensionConfig_name(const envoy_config_core_v3_TypedExtensionConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE bool envoy_config_core_v3_TypedExtensionConfig_has_typed_config(const envoy_config_core_v3_TypedExtensionConfig *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const struct google_protobuf_Any* envoy_config_core_v3_TypedExtensionConfig_typed_config(const envoy_config_core_v3_TypedExtensionConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_Any*); }
-
-UPB_INLINE void envoy_config_core_v3_TypedExtensionConfig_set_name(envoy_config_core_v3_TypedExtensionConfig *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_core_v3_TypedExtensionConfig_set_typed_config(envoy_config_core_v3_TypedExtensionConfig *msg, struct google_protobuf_Any* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_Any*) = value;
-}
-UPB_INLINE struct google_protobuf_Any* envoy_config_core_v3_TypedExtensionConfig_mutable_typed_config(envoy_config_core_v3_TypedExtensionConfig *msg, upb_arena *arena) {
- struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_config_core_v3_TypedExtensionConfig_typed_config(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_TypedExtensionConfig_set_typed_config(msg, sub);
- }
- return sub;
-}
-
-/* envoy.config.core.v3.ExtensionConfigSource */
-
-UPB_INLINE envoy_config_core_v3_ExtensionConfigSource *envoy_config_core_v3_ExtensionConfigSource_new(upb_arena *arena) {
- return (envoy_config_core_v3_ExtensionConfigSource *)_upb_msg_new(&envoy_config_core_v3_ExtensionConfigSource_msginit, arena);
-}
-UPB_INLINE envoy_config_core_v3_ExtensionConfigSource *envoy_config_core_v3_ExtensionConfigSource_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_core_v3_ExtensionConfigSource *ret = envoy_config_core_v3_ExtensionConfigSource_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_ExtensionConfigSource_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_core_v3_ExtensionConfigSource_serialize(const envoy_config_core_v3_ExtensionConfigSource *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_core_v3_ExtensionConfigSource_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_config_core_v3_ExtensionConfigSource_has_config_source(const envoy_config_core_v3_ExtensionConfigSource *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
-UPB_INLINE const struct envoy_config_core_v3_ConfigSource* envoy_config_core_v3_ExtensionConfigSource_config_source(const envoy_config_core_v3_ExtensionConfigSource *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_config_core_v3_ConfigSource*); }
-UPB_INLINE bool envoy_config_core_v3_ExtensionConfigSource_has_default_config(const envoy_config_core_v3_ExtensionConfigSource *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const struct google_protobuf_Any* envoy_config_core_v3_ExtensionConfigSource_default_config(const envoy_config_core_v3_ExtensionConfigSource *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_Any*); }
-UPB_INLINE bool envoy_config_core_v3_ExtensionConfigSource_apply_default_config_without_warming(const envoy_config_core_v3_ExtensionConfigSource *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); }
-UPB_INLINE upb_strview const* envoy_config_core_v3_ExtensionConfigSource_type_urls(const envoy_config_core_v3_ExtensionConfigSource *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(12, 24), len); }
-
-UPB_INLINE void envoy_config_core_v3_ExtensionConfigSource_set_config_source(envoy_config_core_v3_ExtensionConfigSource *msg, struct envoy_config_core_v3_ConfigSource* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_config_core_v3_ConfigSource*) = value;
-}
-UPB_INLINE struct envoy_config_core_v3_ConfigSource* envoy_config_core_v3_ExtensionConfigSource_mutable_config_source(envoy_config_core_v3_ExtensionConfigSource *msg, upb_arena *arena) {
- struct envoy_config_core_v3_ConfigSource* sub = (struct envoy_config_core_v3_ConfigSource*)envoy_config_core_v3_ExtensionConfigSource_config_source(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_ConfigSource*)_upb_msg_new(&envoy_config_core_v3_ConfigSource_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_ExtensionConfigSource_set_config_source(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_core_v3_ExtensionConfigSource_set_default_config(envoy_config_core_v3_ExtensionConfigSource *msg, struct google_protobuf_Any* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_Any*) = value;
-}
-UPB_INLINE struct google_protobuf_Any* envoy_config_core_v3_ExtensionConfigSource_mutable_default_config(envoy_config_core_v3_ExtensionConfigSource *msg, upb_arena *arena) {
- struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_config_core_v3_ExtensionConfigSource_default_config(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_ExtensionConfigSource_set_default_config(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_core_v3_ExtensionConfigSource_set_apply_default_config_without_warming(envoy_config_core_v3_ExtensionConfigSource *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
-}
-UPB_INLINE upb_strview* envoy_config_core_v3_ExtensionConfigSource_mutable_type_urls(envoy_config_core_v3_ExtensionConfigSource *msg, size_t *len) {
- return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 24), len);
-}
-UPB_INLINE upb_strview* envoy_config_core_v3_ExtensionConfigSource_resize_type_urls(envoy_config_core_v3_ExtensionConfigSource *msg, size_t len, upb_arena *arena) {
- return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(12, 24), len, UPB_TYPE_STRING, arena);
-}
-UPB_INLINE bool envoy_config_core_v3_ExtensionConfigSource_add_type_urls(envoy_config_core_v3_ExtensionConfigSource *msg, upb_strview val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(12, 24), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
- arena);
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* ENVOY_CONFIG_CORE_V3_EXTENSION_PROTO_UPB_H_ */
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/core/v3/extension.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_CONFIG_CORE_V3_EXTENSION_PROTO_UPB_H_
+#define ENVOY_CONFIG_CORE_V3_EXTENSION_PROTO_UPB_H_
+
+#include "upb/msg.h"
+#include "upb/decode.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_config_core_v3_TypedExtensionConfig;
+struct envoy_config_core_v3_ExtensionConfigSource;
+typedef struct envoy_config_core_v3_TypedExtensionConfig envoy_config_core_v3_TypedExtensionConfig;
+typedef struct envoy_config_core_v3_ExtensionConfigSource envoy_config_core_v3_ExtensionConfigSource;
+extern const upb_msglayout envoy_config_core_v3_TypedExtensionConfig_msginit;
+extern const upb_msglayout envoy_config_core_v3_ExtensionConfigSource_msginit;
+struct envoy_config_core_v3_ConfigSource;
+struct google_protobuf_Any;
+extern const upb_msglayout envoy_config_core_v3_ConfigSource_msginit;
+extern const upb_msglayout google_protobuf_Any_msginit;
+
+
+/* envoy.config.core.v3.TypedExtensionConfig */
+
+UPB_INLINE envoy_config_core_v3_TypedExtensionConfig *envoy_config_core_v3_TypedExtensionConfig_new(upb_arena *arena) {
+ return (envoy_config_core_v3_TypedExtensionConfig *)_upb_msg_new(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_TypedExtensionConfig *envoy_config_core_v3_TypedExtensionConfig_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_core_v3_TypedExtensionConfig *ret = envoy_config_core_v3_TypedExtensionConfig_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_TypedExtensionConfig_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_core_v3_TypedExtensionConfig_serialize(const envoy_config_core_v3_TypedExtensionConfig *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_core_v3_TypedExtensionConfig_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview envoy_config_core_v3_TypedExtensionConfig_name(const envoy_config_core_v3_TypedExtensionConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE bool envoy_config_core_v3_TypedExtensionConfig_has_typed_config(const envoy_config_core_v3_TypedExtensionConfig *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
+UPB_INLINE const struct google_protobuf_Any* envoy_config_core_v3_TypedExtensionConfig_typed_config(const envoy_config_core_v3_TypedExtensionConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_Any*); }
+
+UPB_INLINE void envoy_config_core_v3_TypedExtensionConfig_set_name(envoy_config_core_v3_TypedExtensionConfig *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_core_v3_TypedExtensionConfig_set_typed_config(envoy_config_core_v3_TypedExtensionConfig *msg, struct google_protobuf_Any* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_Any*) = value;
+}
+UPB_INLINE struct google_protobuf_Any* envoy_config_core_v3_TypedExtensionConfig_mutable_typed_config(envoy_config_core_v3_TypedExtensionConfig *msg, upb_arena *arena) {
+ struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_config_core_v3_TypedExtensionConfig_typed_config(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_TypedExtensionConfig_set_typed_config(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.core.v3.ExtensionConfigSource */
+
+UPB_INLINE envoy_config_core_v3_ExtensionConfigSource *envoy_config_core_v3_ExtensionConfigSource_new(upb_arena *arena) {
+ return (envoy_config_core_v3_ExtensionConfigSource *)_upb_msg_new(&envoy_config_core_v3_ExtensionConfigSource_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_ExtensionConfigSource *envoy_config_core_v3_ExtensionConfigSource_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_core_v3_ExtensionConfigSource *ret = envoy_config_core_v3_ExtensionConfigSource_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_ExtensionConfigSource_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_core_v3_ExtensionConfigSource_serialize(const envoy_config_core_v3_ExtensionConfigSource *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_core_v3_ExtensionConfigSource_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_core_v3_ExtensionConfigSource_has_config_source(const envoy_config_core_v3_ExtensionConfigSource *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
+UPB_INLINE const struct envoy_config_core_v3_ConfigSource* envoy_config_core_v3_ExtensionConfigSource_config_source(const envoy_config_core_v3_ExtensionConfigSource *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_config_core_v3_ConfigSource*); }
+UPB_INLINE bool envoy_config_core_v3_ExtensionConfigSource_has_default_config(const envoy_config_core_v3_ExtensionConfigSource *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
+UPB_INLINE const struct google_protobuf_Any* envoy_config_core_v3_ExtensionConfigSource_default_config(const envoy_config_core_v3_ExtensionConfigSource *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_Any*); }
+UPB_INLINE bool envoy_config_core_v3_ExtensionConfigSource_apply_default_config_without_warming(const envoy_config_core_v3_ExtensionConfigSource *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); }
+UPB_INLINE upb_strview const* envoy_config_core_v3_ExtensionConfigSource_type_urls(const envoy_config_core_v3_ExtensionConfigSource *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(12, 24), len); }
+
+UPB_INLINE void envoy_config_core_v3_ExtensionConfigSource_set_config_source(envoy_config_core_v3_ExtensionConfigSource *msg, struct envoy_config_core_v3_ConfigSource* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_config_core_v3_ConfigSource*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_ConfigSource* envoy_config_core_v3_ExtensionConfigSource_mutable_config_source(envoy_config_core_v3_ExtensionConfigSource *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_ConfigSource* sub = (struct envoy_config_core_v3_ConfigSource*)envoy_config_core_v3_ExtensionConfigSource_config_source(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_ConfigSource*)_upb_msg_new(&envoy_config_core_v3_ConfigSource_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_ExtensionConfigSource_set_config_source(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_ExtensionConfigSource_set_default_config(envoy_config_core_v3_ExtensionConfigSource *msg, struct google_protobuf_Any* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_Any*) = value;
+}
+UPB_INLINE struct google_protobuf_Any* envoy_config_core_v3_ExtensionConfigSource_mutable_default_config(envoy_config_core_v3_ExtensionConfigSource *msg, upb_arena *arena) {
+ struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_config_core_v3_ExtensionConfigSource_default_config(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_ExtensionConfigSource_set_default_config(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_ExtensionConfigSource_set_apply_default_config_without_warming(envoy_config_core_v3_ExtensionConfigSource *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
+}
+UPB_INLINE upb_strview* envoy_config_core_v3_ExtensionConfigSource_mutable_type_urls(envoy_config_core_v3_ExtensionConfigSource *msg, size_t *len) {
+ return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 24), len);
+}
+UPB_INLINE upb_strview* envoy_config_core_v3_ExtensionConfigSource_resize_type_urls(envoy_config_core_v3_ExtensionConfigSource *msg, size_t len, upb_arena *arena) {
+ return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(12, 24), len, UPB_TYPE_STRING, arena);
+}
+UPB_INLINE bool envoy_config_core_v3_ExtensionConfigSource_add_type_urls(envoy_config_core_v3_ExtensionConfigSource *msg, upb_strview val, upb_arena *arena) {
+ return _upb_array_append_accessor(msg, UPB_SIZE(12, 24), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
+ arena);
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_CONFIG_CORE_V3_EXTENSION_PROTO_UPB_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.c
index 6da01a3e18a..f956bb44eea 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.c
@@ -1,241 +1,241 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/config/core/v3/grpc_service.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include <stddef.h>
-#include "upb/msg.h"
-#include "envoy/config/core/v3/grpc_service.upb.h"
-#include "envoy/config/core/v3/base.upb.h"
-#include "google/protobuf/any.upb.h"
-#include "google/protobuf/duration.upb.h"
-#include "google/protobuf/empty.upb.h"
-#include "google/protobuf/struct.upb.h"
-#include "google/protobuf/wrappers.upb.h"
-#include "udpa/annotations/sensitive.upb.h"
-#include "udpa/annotations/status.upb.h"
-#include "udpa/annotations/versioning.upb.h"
-#include "validate/validate.upb.h"
-
-#include "upb/port_def.inc"
-
-static const upb_msglayout *const envoy_config_core_v3_GrpcService_submsgs[4] = {
- &envoy_config_core_v3_GrpcService_EnvoyGrpc_msginit,
- &envoy_config_core_v3_GrpcService_GoogleGrpc_msginit,
- &envoy_config_core_v3_HeaderValue_msginit,
- &google_protobuf_Duration_msginit,
-};
-
-static const upb_msglayout_field envoy_config_core_v3_GrpcService__fields[4] = {
- {1, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, 1},
- {2, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 1, 11, 1},
- {3, UPB_SIZE(0, 0), 0, 3, 11, 1},
- {5, UPB_SIZE(4, 8), 0, 2, 11, 3},
-};
-
-const upb_msglayout envoy_config_core_v3_GrpcService_msginit = {
- &envoy_config_core_v3_GrpcService_submsgs[0],
- &envoy_config_core_v3_GrpcService__fields[0],
- UPB_SIZE(16, 32), 4, false,
-};
-
-static const upb_msglayout_field envoy_config_core_v3_GrpcService_EnvoyGrpc__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 9, 1},
-};
-
-const upb_msglayout envoy_config_core_v3_GrpcService_EnvoyGrpc_msginit = {
- NULL,
- &envoy_config_core_v3_GrpcService_EnvoyGrpc__fields[0],
- UPB_SIZE(16, 32), 2, false,
-};
-
-static const upb_msglayout *const envoy_config_core_v3_GrpcService_GoogleGrpc_submsgs[5] = {
- &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_msginit,
- &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_msginit,
- &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_msginit,
- &google_protobuf_Struct_msginit,
- &google_protobuf_UInt32Value_msginit,
-};
-
-static const upb_msglayout_field envoy_config_core_v3_GrpcService_GoogleGrpc__fields[8] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(24, 48), 0, 2, 11, 1},
- {3, UPB_SIZE(40, 80), 0, 0, 11, 3},
- {4, UPB_SIZE(8, 16), 0, 0, 9, 1},
- {5, UPB_SIZE(16, 32), 0, 0, 9, 1},
- {6, UPB_SIZE(28, 56), 0, 3, 11, 1},
- {7, UPB_SIZE(32, 64), 0, 4, 11, 1},
- {8, UPB_SIZE(36, 72), 0, 1, 11, 1},
-};
-
-const upb_msglayout envoy_config_core_v3_GrpcService_GoogleGrpc_msginit = {
- &envoy_config_core_v3_GrpcService_GoogleGrpc_submsgs[0],
- &envoy_config_core_v3_GrpcService_GoogleGrpc__fields[0],
- UPB_SIZE(48, 96), 8, false,
-};
-
-static const upb_msglayout *const envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_submsgs[3] = {
- &envoy_config_core_v3_DataSource_msginit,
-};
-
-static const upb_msglayout_field envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials__fields[3] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
- {2, UPB_SIZE(4, 8), 0, 0, 11, 1},
- {3, UPB_SIZE(8, 16), 0, 0, 11, 1},
-};
-
-const upb_msglayout envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_msginit = {
- &envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_submsgs[0],
- &envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials__fields[0],
- UPB_SIZE(12, 24), 3, false,
-};
-
-const upb_msglayout envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials_msginit = {
- NULL,
- NULL,
- UPB_SIZE(0, 0), 0, false,
-};
-
-static const upb_msglayout *const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_submsgs[3] = {
- &envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials_msginit,
- &envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_msginit,
- &google_protobuf_Empty_msginit,
-};
-
-static const upb_msglayout_field envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials__fields[3] = {
- {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 1, 11, 1},
- {2, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 2, 11, 1},
- {3, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, 1},
-};
-
-const upb_msglayout envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_msginit = {
- &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_submsgs[0],
- &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials__fields[0],
- UPB_SIZE(8, 16), 3, false,
-};
-
-static const upb_msglayout *const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_submsgs[5] = {
- &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_msginit,
- &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_msginit,
- &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_msginit,
- &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_msginit,
- &google_protobuf_Empty_msginit,
-};
-
-static const upb_msglayout_field envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials__fields[7] = {
- {1, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 9, 1},
- {2, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 4, 11, 1},
- {3, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 9, 1},
- {4, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 2, 11, 1},
- {5, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 11, 1},
- {6, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 1, 11, 1},
- {7, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 3, 11, 1},
-};
-
-const upb_msglayout envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_msginit = {
- &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_submsgs[0],
- &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials__fields[0],
- UPB_SIZE(16, 32), 7, false,
-};
-
-static const upb_msglayout_field envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials__fields[2] = {
- {1, UPB_SIZE(8, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(0, 0), 0, 0, 4, 1},
-};
-
-const upb_msglayout envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_msginit = {
- NULL,
- &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials__fields[0],
- UPB_SIZE(16, 32), 2, false,
-};
-
-static const upb_msglayout_field envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 9, 1},
-};
-
-const upb_msglayout envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_msginit = {
- NULL,
- &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials__fields[0],
- UPB_SIZE(16, 32), 2, false,
-};
-
-static const upb_msglayout *const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_submsgs[1] = {
- &google_protobuf_Any_msginit,
-};
-
-static const upb_msglayout_field envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {3, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, 1},
-};
-
-const upb_msglayout envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_msginit = {
- &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_submsgs[0],
- &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin__fields[0],
- UPB_SIZE(16, 32), 2, false,
-};
-
-static const upb_msglayout_field envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService__fields[9] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 9, 1},
- {3, UPB_SIZE(16, 32), 0, 0, 9, 1},
- {4, UPB_SIZE(24, 48), 0, 0, 9, 1},
- {5, UPB_SIZE(32, 64), 0, 0, 9, 1},
- {6, UPB_SIZE(40, 80), 0, 0, 9, 1},
- {7, UPB_SIZE(48, 96), 0, 0, 9, 1},
- {8, UPB_SIZE(56, 112), 0, 0, 9, 1},
- {9, UPB_SIZE(64, 128), 0, 0, 9, 1},
-};
-
-const upb_msglayout envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_msginit = {
- NULL,
- &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService__fields[0],
- UPB_SIZE(72, 144), 9, false,
-};
-
-static const upb_msglayout *const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_submsgs[1] = {
- &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry_msginit,
-};
-
-static const upb_msglayout_field envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, _UPB_LABEL_MAP},
-};
-
-const upb_msglayout envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_msginit = {
- &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_submsgs[0],
- &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs__fields[0],
- UPB_SIZE(4, 8), 1, false,
-};
-
-static const upb_msglayout_field envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value__fields[2] = {
- {1, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 9, 1},
- {2, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 3, 1},
-};
-
-const upb_msglayout envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_msginit = {
- NULL,
- &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value__fields[0],
- UPB_SIZE(16, 32), 2, false,
-};
-
-static const upb_msglayout *const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry_submsgs[1] = {
- &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_msginit,
-};
-
-static const upb_msglayout_field envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 11, 1},
-};
-
-const upb_msglayout envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry_msginit = {
- &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry_submsgs[0],
- &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry__fields[0],
- UPB_SIZE(16, 32), 2, false,
-};
-
-#include "upb/port_undef.inc"
-
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/core/v3/grpc_service.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg.h"
+#include "envoy/config/core/v3/grpc_service.upb.h"
+#include "envoy/config/core/v3/base.upb.h"
+#include "google/protobuf/any.upb.h"
+#include "google/protobuf/duration.upb.h"
+#include "google/protobuf/empty.upb.h"
+#include "google/protobuf/struct.upb.h"
+#include "google/protobuf/wrappers.upb.h"
+#include "udpa/annotations/sensitive.upb.h"
+#include "udpa/annotations/status.upb.h"
+#include "udpa/annotations/versioning.upb.h"
+#include "validate/validate.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_msglayout *const envoy_config_core_v3_GrpcService_submsgs[4] = {
+ &envoy_config_core_v3_GrpcService_EnvoyGrpc_msginit,
+ &envoy_config_core_v3_GrpcService_GoogleGrpc_msginit,
+ &envoy_config_core_v3_HeaderValue_msginit,
+ &google_protobuf_Duration_msginit,
+};
+
+static const upb_msglayout_field envoy_config_core_v3_GrpcService__fields[4] = {
+ {1, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, 1},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 1, 11, 1},
+ {3, UPB_SIZE(0, 0), 0, 3, 11, 1},
+ {5, UPB_SIZE(4, 8), 0, 2, 11, 3},
+};
+
+const upb_msglayout envoy_config_core_v3_GrpcService_msginit = {
+ &envoy_config_core_v3_GrpcService_submsgs[0],
+ &envoy_config_core_v3_GrpcService__fields[0],
+ UPB_SIZE(16, 32), 4, false,
+};
+
+static const upb_msglayout_field envoy_config_core_v3_GrpcService_EnvoyGrpc__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {2, UPB_SIZE(8, 16), 0, 0, 9, 1},
+};
+
+const upb_msglayout envoy_config_core_v3_GrpcService_EnvoyGrpc_msginit = {
+ NULL,
+ &envoy_config_core_v3_GrpcService_EnvoyGrpc__fields[0],
+ UPB_SIZE(16, 32), 2, false,
+};
+
+static const upb_msglayout *const envoy_config_core_v3_GrpcService_GoogleGrpc_submsgs[5] = {
+ &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_msginit,
+ &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_msginit,
+ &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_msginit,
+ &google_protobuf_Struct_msginit,
+ &google_protobuf_UInt32Value_msginit,
+};
+
+static const upb_msglayout_field envoy_config_core_v3_GrpcService_GoogleGrpc__fields[8] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {2, UPB_SIZE(24, 48), 0, 2, 11, 1},
+ {3, UPB_SIZE(40, 80), 0, 0, 11, 3},
+ {4, UPB_SIZE(8, 16), 0, 0, 9, 1},
+ {5, UPB_SIZE(16, 32), 0, 0, 9, 1},
+ {6, UPB_SIZE(28, 56), 0, 3, 11, 1},
+ {7, UPB_SIZE(32, 64), 0, 4, 11, 1},
+ {8, UPB_SIZE(36, 72), 0, 1, 11, 1},
+};
+
+const upb_msglayout envoy_config_core_v3_GrpcService_GoogleGrpc_msginit = {
+ &envoy_config_core_v3_GrpcService_GoogleGrpc_submsgs[0],
+ &envoy_config_core_v3_GrpcService_GoogleGrpc__fields[0],
+ UPB_SIZE(48, 96), 8, false,
+};
+
+static const upb_msglayout *const envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_submsgs[3] = {
+ &envoy_config_core_v3_DataSource_msginit,
+};
+
+static const upb_msglayout_field envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials__fields[3] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
+ {2, UPB_SIZE(4, 8), 0, 0, 11, 1},
+ {3, UPB_SIZE(8, 16), 0, 0, 11, 1},
+};
+
+const upb_msglayout envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_msginit = {
+ &envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_submsgs[0],
+ &envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials__fields[0],
+ UPB_SIZE(12, 24), 3, false,
+};
+
+const upb_msglayout envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials_msginit = {
+ NULL,
+ NULL,
+ UPB_SIZE(0, 0), 0, false,
+};
+
+static const upb_msglayout *const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_submsgs[3] = {
+ &envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials_msginit,
+ &envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_msginit,
+ &google_protobuf_Empty_msginit,
+};
+
+static const upb_msglayout_field envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials__fields[3] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 1, 11, 1},
+ {2, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 2, 11, 1},
+ {3, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, 1},
+};
+
+const upb_msglayout envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_msginit = {
+ &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_submsgs[0],
+ &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials__fields[0],
+ UPB_SIZE(8, 16), 3, false,
+};
+
+static const upb_msglayout *const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_submsgs[5] = {
+ &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_msginit,
+ &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_msginit,
+ &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_msginit,
+ &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_msginit,
+ &google_protobuf_Empty_msginit,
+};
+
+static const upb_msglayout_field envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials__fields[7] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 9, 1},
+ {2, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 4, 11, 1},
+ {3, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 9, 1},
+ {4, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 2, 11, 1},
+ {5, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 11, 1},
+ {6, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 1, 11, 1},
+ {7, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 3, 11, 1},
+};
+
+const upb_msglayout envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_msginit = {
+ &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_submsgs[0],
+ &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials__fields[0],
+ UPB_SIZE(16, 32), 7, false,
+};
+
+static const upb_msglayout_field envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials__fields[2] = {
+ {1, UPB_SIZE(8, 8), 0, 0, 9, 1},
+ {2, UPB_SIZE(0, 0), 0, 0, 4, 1},
+};
+
+const upb_msglayout envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_msginit = {
+ NULL,
+ &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials__fields[0],
+ UPB_SIZE(16, 32), 2, false,
+};
+
+static const upb_msglayout_field envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {2, UPB_SIZE(8, 16), 0, 0, 9, 1},
+};
+
+const upb_msglayout envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_msginit = {
+ NULL,
+ &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials__fields[0],
+ UPB_SIZE(16, 32), 2, false,
+};
+
+static const upb_msglayout *const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_submsgs[1] = {
+ &google_protobuf_Any_msginit,
+};
+
+static const upb_msglayout_field envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {3, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, 1},
+};
+
+const upb_msglayout envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_msginit = {
+ &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_submsgs[0],
+ &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin__fields[0],
+ UPB_SIZE(16, 32), 2, false,
+};
+
+static const upb_msglayout_field envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService__fields[9] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {2, UPB_SIZE(8, 16), 0, 0, 9, 1},
+ {3, UPB_SIZE(16, 32), 0, 0, 9, 1},
+ {4, UPB_SIZE(24, 48), 0, 0, 9, 1},
+ {5, UPB_SIZE(32, 64), 0, 0, 9, 1},
+ {6, UPB_SIZE(40, 80), 0, 0, 9, 1},
+ {7, UPB_SIZE(48, 96), 0, 0, 9, 1},
+ {8, UPB_SIZE(56, 112), 0, 0, 9, 1},
+ {9, UPB_SIZE(64, 128), 0, 0, 9, 1},
+};
+
+const upb_msglayout envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_msginit = {
+ NULL,
+ &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService__fields[0],
+ UPB_SIZE(72, 144), 9, false,
+};
+
+static const upb_msglayout *const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_submsgs[1] = {
+ &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry_msginit,
+};
+
+static const upb_msglayout_field envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs__fields[1] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 11, _UPB_LABEL_MAP},
+};
+
+const upb_msglayout envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_msginit = {
+ &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_submsgs[0],
+ &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs__fields[0],
+ UPB_SIZE(4, 8), 1, false,
+};
+
+static const upb_msglayout_field envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value__fields[2] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 9, 1},
+ {2, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 3, 1},
+};
+
+const upb_msglayout envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_msginit = {
+ NULL,
+ &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value__fields[0],
+ UPB_SIZE(16, 32), 2, false,
+};
+
+static const upb_msglayout *const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry_submsgs[1] = {
+ &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_msginit,
+};
+
+static const upb_msglayout_field envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {2, UPB_SIZE(8, 16), 0, 0, 11, 1},
+};
+
+const upb_msglayout envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry_msginit = {
+ &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry_submsgs[0],
+ &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry__fields[0],
+ UPB_SIZE(16, 32), 2, false,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.h
index b6ffe6189d1..0f8accaaaa0 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.h
@@ -1,752 +1,752 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/config/core/v3/grpc_service.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef ENVOY_CONFIG_CORE_V3_GRPC_SERVICE_PROTO_UPB_H_
-#define ENVOY_CONFIG_CORE_V3_GRPC_SERVICE_PROTO_UPB_H_
-
-#include "upb/msg.h"
-#include "upb/decode.h"
-#include "upb/encode.h"
-
-#include "upb/port_def.inc"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct envoy_config_core_v3_GrpcService;
-struct envoy_config_core_v3_GrpcService_EnvoyGrpc;
-struct envoy_config_core_v3_GrpcService_GoogleGrpc;
-struct envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials;
-struct envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials;
-struct envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials;
-struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials;
-struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials;
-struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials;
-struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin;
-struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService;
-struct envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs;
-struct envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value;
-struct envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry;
-typedef struct envoy_config_core_v3_GrpcService envoy_config_core_v3_GrpcService;
-typedef struct envoy_config_core_v3_GrpcService_EnvoyGrpc envoy_config_core_v3_GrpcService_EnvoyGrpc;
-typedef struct envoy_config_core_v3_GrpcService_GoogleGrpc envoy_config_core_v3_GrpcService_GoogleGrpc;
-typedef struct envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials;
-typedef struct envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials;
-typedef struct envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials;
-typedef struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials;
-typedef struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials;
-typedef struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials;
-typedef struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin;
-typedef struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService;
-typedef struct envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs;
-typedef struct envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value;
-typedef struct envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry;
-extern const upb_msglayout envoy_config_core_v3_GrpcService_msginit;
-extern const upb_msglayout envoy_config_core_v3_GrpcService_EnvoyGrpc_msginit;
-extern const upb_msglayout envoy_config_core_v3_GrpcService_GoogleGrpc_msginit;
-extern const upb_msglayout envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_msginit;
-extern const upb_msglayout envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials_msginit;
-extern const upb_msglayout envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_msginit;
-extern const upb_msglayout envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_msginit;
-extern const upb_msglayout envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_msginit;
-extern const upb_msglayout envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_msginit;
-extern const upb_msglayout envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_msginit;
-extern const upb_msglayout envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_msginit;
-extern const upb_msglayout envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_msginit;
-extern const upb_msglayout envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_msginit;
-extern const upb_msglayout envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry_msginit;
-struct envoy_config_core_v3_DataSource;
-struct envoy_config_core_v3_HeaderValue;
-struct google_protobuf_Any;
-struct google_protobuf_Duration;
-struct google_protobuf_Empty;
-struct google_protobuf_Struct;
-struct google_protobuf_UInt32Value;
-extern const upb_msglayout envoy_config_core_v3_DataSource_msginit;
-extern const upb_msglayout envoy_config_core_v3_HeaderValue_msginit;
-extern const upb_msglayout google_protobuf_Any_msginit;
-extern const upb_msglayout google_protobuf_Duration_msginit;
-extern const upb_msglayout google_protobuf_Empty_msginit;
-extern const upb_msglayout google_protobuf_Struct_msginit;
-extern const upb_msglayout google_protobuf_UInt32Value_msginit;
-
-
-/* envoy.config.core.v3.GrpcService */
-
-UPB_INLINE envoy_config_core_v3_GrpcService *envoy_config_core_v3_GrpcService_new(upb_arena *arena) {
- return (envoy_config_core_v3_GrpcService *)_upb_msg_new(&envoy_config_core_v3_GrpcService_msginit, arena);
-}
-UPB_INLINE envoy_config_core_v3_GrpcService *envoy_config_core_v3_GrpcService_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_core_v3_GrpcService *ret = envoy_config_core_v3_GrpcService_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_GrpcService_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_core_v3_GrpcService_serialize(const envoy_config_core_v3_GrpcService *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_core_v3_GrpcService_msginit, arena, len);
-}
-
-typedef enum {
- envoy_config_core_v3_GrpcService_target_specifier_envoy_grpc = 1,
- envoy_config_core_v3_GrpcService_target_specifier_google_grpc = 2,
- envoy_config_core_v3_GrpcService_target_specifier_NOT_SET = 0
-} envoy_config_core_v3_GrpcService_target_specifier_oneofcases;
-UPB_INLINE envoy_config_core_v3_GrpcService_target_specifier_oneofcases envoy_config_core_v3_GrpcService_target_specifier_case(const envoy_config_core_v3_GrpcService* msg) { return (envoy_config_core_v3_GrpcService_target_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(12, 24), int32_t); }
-
-UPB_INLINE bool envoy_config_core_v3_GrpcService_has_envoy_grpc(const envoy_config_core_v3_GrpcService *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 1; }
-UPB_INLINE const envoy_config_core_v3_GrpcService_EnvoyGrpc* envoy_config_core_v3_GrpcService_envoy_grpc(const envoy_config_core_v3_GrpcService *msg) { return UPB_READ_ONEOF(msg, const envoy_config_core_v3_GrpcService_EnvoyGrpc*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 1, NULL); }
-UPB_INLINE bool envoy_config_core_v3_GrpcService_has_google_grpc(const envoy_config_core_v3_GrpcService *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 2; }
-UPB_INLINE const envoy_config_core_v3_GrpcService_GoogleGrpc* envoy_config_core_v3_GrpcService_google_grpc(const envoy_config_core_v3_GrpcService *msg) { return UPB_READ_ONEOF(msg, const envoy_config_core_v3_GrpcService_GoogleGrpc*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 2, NULL); }
-UPB_INLINE bool envoy_config_core_v3_GrpcService_has_timeout(const envoy_config_core_v3_GrpcService *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE const struct google_protobuf_Duration* envoy_config_core_v3_GrpcService_timeout(const envoy_config_core_v3_GrpcService *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct google_protobuf_Duration*); }
-UPB_INLINE bool envoy_config_core_v3_GrpcService_has_initial_metadata(const envoy_config_core_v3_GrpcService *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
-UPB_INLINE const struct envoy_config_core_v3_HeaderValue* const* envoy_config_core_v3_GrpcService_initial_metadata(const envoy_config_core_v3_GrpcService *msg, size_t *len) { return (const struct envoy_config_core_v3_HeaderValue* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len); }
-
-UPB_INLINE void envoy_config_core_v3_GrpcService_set_envoy_grpc(envoy_config_core_v3_GrpcService *msg, envoy_config_core_v3_GrpcService_EnvoyGrpc* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_core_v3_GrpcService_EnvoyGrpc*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 1);
-}
-UPB_INLINE struct envoy_config_core_v3_GrpcService_EnvoyGrpc* envoy_config_core_v3_GrpcService_mutable_envoy_grpc(envoy_config_core_v3_GrpcService *msg, upb_arena *arena) {
- struct envoy_config_core_v3_GrpcService_EnvoyGrpc* sub = (struct envoy_config_core_v3_GrpcService_EnvoyGrpc*)envoy_config_core_v3_GrpcService_envoy_grpc(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_GrpcService_EnvoyGrpc*)_upb_msg_new(&envoy_config_core_v3_GrpcService_EnvoyGrpc_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_GrpcService_set_envoy_grpc(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_core_v3_GrpcService_set_google_grpc(envoy_config_core_v3_GrpcService *msg, envoy_config_core_v3_GrpcService_GoogleGrpc* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_core_v3_GrpcService_GoogleGrpc*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 2);
-}
-UPB_INLINE struct envoy_config_core_v3_GrpcService_GoogleGrpc* envoy_config_core_v3_GrpcService_mutable_google_grpc(envoy_config_core_v3_GrpcService *msg, upb_arena *arena) {
- struct envoy_config_core_v3_GrpcService_GoogleGrpc* sub = (struct envoy_config_core_v3_GrpcService_GoogleGrpc*)envoy_config_core_v3_GrpcService_google_grpc(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_GrpcService_GoogleGrpc*)_upb_msg_new(&envoy_config_core_v3_GrpcService_GoogleGrpc_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_GrpcService_set_google_grpc(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_core_v3_GrpcService_set_timeout(envoy_config_core_v3_GrpcService *msg, struct google_protobuf_Duration* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct google_protobuf_Duration*) = value;
-}
-UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_GrpcService_mutable_timeout(envoy_config_core_v3_GrpcService *msg, upb_arena *arena) {
- struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_core_v3_GrpcService_timeout(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_GrpcService_set_timeout(msg, sub);
- }
- return sub;
-}
-UPB_INLINE struct envoy_config_core_v3_HeaderValue** envoy_config_core_v3_GrpcService_mutable_initial_metadata(envoy_config_core_v3_GrpcService *msg, size_t *len) {
- return (struct envoy_config_core_v3_HeaderValue**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len);
-}
-UPB_INLINE struct envoy_config_core_v3_HeaderValue** envoy_config_core_v3_GrpcService_resize_initial_metadata(envoy_config_core_v3_GrpcService *msg, size_t len, upb_arena *arena) {
- return (struct envoy_config_core_v3_HeaderValue**)_upb_array_resize_accessor(msg, UPB_SIZE(4, 8), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_config_core_v3_HeaderValue* envoy_config_core_v3_GrpcService_add_initial_metadata(envoy_config_core_v3_GrpcService *msg, upb_arena *arena) {
- struct envoy_config_core_v3_HeaderValue* sub = (struct envoy_config_core_v3_HeaderValue*)_upb_msg_new(&envoy_config_core_v3_HeaderValue_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(4, 8), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-
-/* envoy.config.core.v3.GrpcService.EnvoyGrpc */
-
-UPB_INLINE envoy_config_core_v3_GrpcService_EnvoyGrpc *envoy_config_core_v3_GrpcService_EnvoyGrpc_new(upb_arena *arena) {
- return (envoy_config_core_v3_GrpcService_EnvoyGrpc *)_upb_msg_new(&envoy_config_core_v3_GrpcService_EnvoyGrpc_msginit, arena);
-}
-UPB_INLINE envoy_config_core_v3_GrpcService_EnvoyGrpc *envoy_config_core_v3_GrpcService_EnvoyGrpc_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_core_v3_GrpcService_EnvoyGrpc *ret = envoy_config_core_v3_GrpcService_EnvoyGrpc_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_GrpcService_EnvoyGrpc_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_core_v3_GrpcService_EnvoyGrpc_serialize(const envoy_config_core_v3_GrpcService_EnvoyGrpc *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_core_v3_GrpcService_EnvoyGrpc_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview envoy_config_core_v3_GrpcService_EnvoyGrpc_cluster_name(const envoy_config_core_v3_GrpcService_EnvoyGrpc *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE upb_strview envoy_config_core_v3_GrpcService_EnvoyGrpc_authority(const envoy_config_core_v3_GrpcService_EnvoyGrpc *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview); }
-
-UPB_INLINE void envoy_config_core_v3_GrpcService_EnvoyGrpc_set_cluster_name(envoy_config_core_v3_GrpcService_EnvoyGrpc *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_core_v3_GrpcService_EnvoyGrpc_set_authority(envoy_config_core_v3_GrpcService_EnvoyGrpc *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview) = value;
-}
-
-/* envoy.config.core.v3.GrpcService.GoogleGrpc */
-
-UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc *envoy_config_core_v3_GrpcService_GoogleGrpc_new(upb_arena *arena) {
- return (envoy_config_core_v3_GrpcService_GoogleGrpc *)_upb_msg_new(&envoy_config_core_v3_GrpcService_GoogleGrpc_msginit, arena);
-}
-UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc *envoy_config_core_v3_GrpcService_GoogleGrpc_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_core_v3_GrpcService_GoogleGrpc *ret = envoy_config_core_v3_GrpcService_GoogleGrpc_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_core_v3_GrpcService_GoogleGrpc_serialize(const envoy_config_core_v3_GrpcService_GoogleGrpc *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview envoy_config_core_v3_GrpcService_GoogleGrpc_target_uri(const envoy_config_core_v3_GrpcService_GoogleGrpc *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_has_channel_credentials(const envoy_config_core_v3_GrpcService_GoogleGrpc *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 48)); }
-UPB_INLINE const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials* envoy_config_core_v3_GrpcService_GoogleGrpc_channel_credentials(const envoy_config_core_v3_GrpcService_GoogleGrpc *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 48), const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials*); }
-UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_has_call_credentials(const envoy_config_core_v3_GrpcService_GoogleGrpc *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(40, 80)); }
-UPB_INLINE const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials* const* envoy_config_core_v3_GrpcService_GoogleGrpc_call_credentials(const envoy_config_core_v3_GrpcService_GoogleGrpc *msg, size_t *len) { return (const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials* const*)_upb_array_accessor(msg, UPB_SIZE(40, 80), len); }
-UPB_INLINE upb_strview envoy_config_core_v3_GrpcService_GoogleGrpc_stat_prefix(const envoy_config_core_v3_GrpcService_GoogleGrpc *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview); }
-UPB_INLINE upb_strview envoy_config_core_v3_GrpcService_GoogleGrpc_credentials_factory_name(const envoy_config_core_v3_GrpcService_GoogleGrpc *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_strview); }
-UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_has_config(const envoy_config_core_v3_GrpcService_GoogleGrpc *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 56)); }
-UPB_INLINE const struct google_protobuf_Struct* envoy_config_core_v3_GrpcService_GoogleGrpc_config(const envoy_config_core_v3_GrpcService_GoogleGrpc *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 56), const struct google_protobuf_Struct*); }
-UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_has_per_stream_buffer_limit_bytes(const envoy_config_core_v3_GrpcService_GoogleGrpc *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(32, 64)); }
-UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_core_v3_GrpcService_GoogleGrpc_per_stream_buffer_limit_bytes(const envoy_config_core_v3_GrpcService_GoogleGrpc *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 64), const struct google_protobuf_UInt32Value*); }
-UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_has_channel_args(const envoy_config_core_v3_GrpcService_GoogleGrpc *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(36, 72)); }
-UPB_INLINE const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs* envoy_config_core_v3_GrpcService_GoogleGrpc_channel_args(const envoy_config_core_v3_GrpcService_GoogleGrpc *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(36, 72), const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs*); }
-
-UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_set_target_uri(envoy_config_core_v3_GrpcService_GoogleGrpc *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_set_channel_credentials(envoy_config_core_v3_GrpcService_GoogleGrpc *msg, envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(24, 48), envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials*) = value;
-}
-UPB_INLINE struct envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials* envoy_config_core_v3_GrpcService_GoogleGrpc_mutable_channel_credentials(envoy_config_core_v3_GrpcService_GoogleGrpc *msg, upb_arena *arena) {
- struct envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials* sub = (struct envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials*)envoy_config_core_v3_GrpcService_GoogleGrpc_channel_credentials(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials*)_upb_msg_new(&envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_GrpcService_GoogleGrpc_set_channel_credentials(msg, sub);
- }
- return sub;
-}
-UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials** envoy_config_core_v3_GrpcService_GoogleGrpc_mutable_call_credentials(envoy_config_core_v3_GrpcService_GoogleGrpc *msg, size_t *len) {
- return (envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials**)_upb_array_mutable_accessor(msg, UPB_SIZE(40, 80), len);
-}
-UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials** envoy_config_core_v3_GrpcService_GoogleGrpc_resize_call_credentials(envoy_config_core_v3_GrpcService_GoogleGrpc *msg, size_t len, upb_arena *arena) {
- return (envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials**)_upb_array_resize_accessor(msg, UPB_SIZE(40, 80), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials* envoy_config_core_v3_GrpcService_GoogleGrpc_add_call_credentials(envoy_config_core_v3_GrpcService_GoogleGrpc *msg, upb_arena *arena) {
- struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials* sub = (struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials*)_upb_msg_new(&envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(40, 80), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_set_stat_prefix(envoy_config_core_v3_GrpcService_GoogleGrpc *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_set_credentials_factory_name(envoy_config_core_v3_GrpcService_GoogleGrpc *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_set_config(envoy_config_core_v3_GrpcService_GoogleGrpc *msg, struct google_protobuf_Struct* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(28, 56), struct google_protobuf_Struct*) = value;
-}
-UPB_INLINE struct google_protobuf_Struct* envoy_config_core_v3_GrpcService_GoogleGrpc_mutable_config(envoy_config_core_v3_GrpcService_GoogleGrpc *msg, upb_arena *arena) {
- struct google_protobuf_Struct* sub = (struct google_protobuf_Struct*)envoy_config_core_v3_GrpcService_GoogleGrpc_config(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Struct*)_upb_msg_new(&google_protobuf_Struct_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_GrpcService_GoogleGrpc_set_config(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_set_per_stream_buffer_limit_bytes(envoy_config_core_v3_GrpcService_GoogleGrpc *msg, struct google_protobuf_UInt32Value* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(32, 64), struct google_protobuf_UInt32Value*) = value;
-}
-UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_GrpcService_GoogleGrpc_mutable_per_stream_buffer_limit_bytes(envoy_config_core_v3_GrpcService_GoogleGrpc *msg, upb_arena *arena) {
- struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_core_v3_GrpcService_GoogleGrpc_per_stream_buffer_limit_bytes(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_GrpcService_GoogleGrpc_set_per_stream_buffer_limit_bytes(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_set_channel_args(envoy_config_core_v3_GrpcService_GoogleGrpc *msg, envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(36, 72), envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs*) = value;
-}
-UPB_INLINE struct envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs* envoy_config_core_v3_GrpcService_GoogleGrpc_mutable_channel_args(envoy_config_core_v3_GrpcService_GoogleGrpc *msg, upb_arena *arena) {
- struct envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs* sub = (struct envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs*)envoy_config_core_v3_GrpcService_GoogleGrpc_channel_args(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs*)_upb_msg_new(&envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_GrpcService_GoogleGrpc_set_channel_args(msg, sub);
- }
- return sub;
-}
-
-/* envoy.config.core.v3.GrpcService.GoogleGrpc.SslCredentials */
-
-UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials *envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_new(upb_arena *arena) {
- return (envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials *)_upb_msg_new(&envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_msginit, arena);
-}
-UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials *envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials *ret = envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_serialize(const envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_has_root_certs(const envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE const struct envoy_config_core_v3_DataSource* envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_root_certs(const envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct envoy_config_core_v3_DataSource*); }
-UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_has_private_key(const envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
-UPB_INLINE const struct envoy_config_core_v3_DataSource* envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_private_key(const envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_config_core_v3_DataSource*); }
-UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_has_cert_chain(const envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const struct envoy_config_core_v3_DataSource* envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_cert_chain(const envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct envoy_config_core_v3_DataSource*); }
-
-UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_set_root_certs(envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials *msg, struct envoy_config_core_v3_DataSource* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct envoy_config_core_v3_DataSource*) = value;
-}
-UPB_INLINE struct envoy_config_core_v3_DataSource* envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_mutable_root_certs(envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials *msg, upb_arena *arena) {
- struct envoy_config_core_v3_DataSource* sub = (struct envoy_config_core_v3_DataSource*)envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_root_certs(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_DataSource*)_upb_msg_new(&envoy_config_core_v3_DataSource_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_set_root_certs(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_set_private_key(envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials *msg, struct envoy_config_core_v3_DataSource* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_config_core_v3_DataSource*) = value;
-}
-UPB_INLINE struct envoy_config_core_v3_DataSource* envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_mutable_private_key(envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials *msg, upb_arena *arena) {
- struct envoy_config_core_v3_DataSource* sub = (struct envoy_config_core_v3_DataSource*)envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_private_key(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_DataSource*)_upb_msg_new(&envoy_config_core_v3_DataSource_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_set_private_key(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_set_cert_chain(envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials *msg, struct envoy_config_core_v3_DataSource* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct envoy_config_core_v3_DataSource*) = value;
-}
-UPB_INLINE struct envoy_config_core_v3_DataSource* envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_mutable_cert_chain(envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials *msg, upb_arena *arena) {
- struct envoy_config_core_v3_DataSource* sub = (struct envoy_config_core_v3_DataSource*)envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_cert_chain(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_DataSource*)_upb_msg_new(&envoy_config_core_v3_DataSource_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_set_cert_chain(msg, sub);
- }
- return sub;
-}
-
-/* envoy.config.core.v3.GrpcService.GoogleGrpc.GoogleLocalCredentials */
-
-UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials *envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials_new(upb_arena *arena) {
- return (envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials *)_upb_msg_new(&envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials_msginit, arena);
-}
-UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials *envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials *ret = envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials_serialize(const envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials_msginit, arena, len);
-}
-
-
-
-/* envoy.config.core.v3.GrpcService.GoogleGrpc.ChannelCredentials */
-
-UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials *envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_new(upb_arena *arena) {
- return (envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials *)_upb_msg_new(&envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_msginit, arena);
-}
-UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials *envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials *ret = envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_serialize(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_msginit, arena, len);
-}
-
-typedef enum {
- envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_credential_specifier_ssl_credentials = 1,
- envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_credential_specifier_google_default = 2,
- envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_credential_specifier_local_credentials = 3,
- envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_credential_specifier_NOT_SET = 0
-} envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_credential_specifier_oneofcases;
-UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_credential_specifier_oneofcases envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_credential_specifier_case(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials* msg) { return (envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_credential_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 8), int32_t); }
-
-UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_has_ssl_credentials(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 1; }
-UPB_INLINE const envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials* envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_ssl_credentials(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials *msg) { return UPB_READ_ONEOF(msg, const envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 1, NULL); }
-UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_has_google_default(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 2; }
-UPB_INLINE const struct google_protobuf_Empty* envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_google_default(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials *msg) { return UPB_READ_ONEOF(msg, const struct google_protobuf_Empty*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 2, NULL); }
-UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_has_local_credentials(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 3; }
-UPB_INLINE const envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials* envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_local_credentials(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials *msg) { return UPB_READ_ONEOF(msg, const envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 3, NULL); }
-
-UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_set_ssl_credentials(envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials *msg, envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 1);
-}
-UPB_INLINE struct envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials* envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_mutable_ssl_credentials(envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials *msg, upb_arena *arena) {
- struct envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials* sub = (struct envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials*)envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_ssl_credentials(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials*)_upb_msg_new(&envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_set_ssl_credentials(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_set_google_default(envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials *msg, struct google_protobuf_Empty* value) {
- UPB_WRITE_ONEOF(msg, struct google_protobuf_Empty*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 2);
-}
-UPB_INLINE struct google_protobuf_Empty* envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_mutable_google_default(envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials *msg, upb_arena *arena) {
- struct google_protobuf_Empty* sub = (struct google_protobuf_Empty*)envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_google_default(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Empty*)_upb_msg_new(&google_protobuf_Empty_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_set_google_default(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_set_local_credentials(envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials *msg, envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 3);
-}
-UPB_INLINE struct envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials* envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_mutable_local_credentials(envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials *msg, upb_arena *arena) {
- struct envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials* sub = (struct envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials*)envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_local_credentials(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials*)_upb_msg_new(&envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_set_local_credentials(msg, sub);
- }
- return sub;
-}
-
-/* envoy.config.core.v3.GrpcService.GoogleGrpc.CallCredentials */
-
-UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials *envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_new(upb_arena *arena) {
- return (envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials *)_upb_msg_new(&envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_msginit, arena);
-}
-UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials *envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials *ret = envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_serialize(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_msginit, arena, len);
-}
-
-typedef enum {
- envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_credential_specifier_access_token = 1,
- envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_credential_specifier_google_compute_engine = 2,
- envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_credential_specifier_google_refresh_token = 3,
- envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_credential_specifier_service_account_jwt_access = 4,
- envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_credential_specifier_google_iam = 5,
- envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_credential_specifier_from_plugin = 6,
- envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_credential_specifier_sts_service = 7,
- envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_credential_specifier_NOT_SET = 0
-} envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_credential_specifier_oneofcases;
-UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_credential_specifier_oneofcases envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_credential_specifier_case(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials* msg) { return (envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_credential_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(8, 16), int32_t); }
-
-UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_has_access_token(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 1; }
-UPB_INLINE upb_strview envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_access_token(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 1, upb_strview_make("", strlen(""))); }
-UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_has_google_compute_engine(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 2; }
-UPB_INLINE const struct google_protobuf_Empty* envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_google_compute_engine(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials *msg) { return UPB_READ_ONEOF(msg, const struct google_protobuf_Empty*, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 2, NULL); }
-UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_has_google_refresh_token(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 3; }
-UPB_INLINE upb_strview envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_google_refresh_token(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 3, upb_strview_make("", strlen(""))); }
-UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_has_service_account_jwt_access(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 4; }
-UPB_INLINE const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials* envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_service_account_jwt_access(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials *msg) { return UPB_READ_ONEOF(msg, const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials*, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 4, NULL); }
-UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_has_google_iam(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 5; }
-UPB_INLINE const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials* envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_google_iam(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials *msg) { return UPB_READ_ONEOF(msg, const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials*, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 5, NULL); }
-UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_has_from_plugin(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 6; }
-UPB_INLINE const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin* envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_from_plugin(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials *msg) { return UPB_READ_ONEOF(msg, const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin*, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 6, NULL); }
-UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_has_sts_service(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 7; }
-UPB_INLINE const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService* envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_sts_service(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials *msg) { return UPB_READ_ONEOF(msg, const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService*, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 7, NULL); }
-
-UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_set_access_token(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials *msg, upb_strview value) {
- UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 1);
-}
-UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_set_google_compute_engine(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials *msg, struct google_protobuf_Empty* value) {
- UPB_WRITE_ONEOF(msg, struct google_protobuf_Empty*, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 2);
-}
-UPB_INLINE struct google_protobuf_Empty* envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_mutable_google_compute_engine(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials *msg, upb_arena *arena) {
- struct google_protobuf_Empty* sub = (struct google_protobuf_Empty*)envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_google_compute_engine(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Empty*)_upb_msg_new(&google_protobuf_Empty_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_set_google_compute_engine(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_set_google_refresh_token(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials *msg, upb_strview value) {
- UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 3);
-}
-UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_set_service_account_jwt_access(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials *msg, envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials*, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 4);
-}
-UPB_INLINE struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials* envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_mutable_service_account_jwt_access(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials *msg, upb_arena *arena) {
- struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials* sub = (struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials*)envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_service_account_jwt_access(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials*)_upb_msg_new(&envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_set_service_account_jwt_access(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_set_google_iam(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials *msg, envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials*, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 5);
-}
-UPB_INLINE struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials* envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_mutable_google_iam(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials *msg, upb_arena *arena) {
- struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials* sub = (struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials*)envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_google_iam(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials*)_upb_msg_new(&envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_set_google_iam(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_set_from_plugin(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials *msg, envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin*, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 6);
-}
-UPB_INLINE struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin* envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_mutable_from_plugin(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials *msg, upb_arena *arena) {
- struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin* sub = (struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin*)envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_from_plugin(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin*)_upb_msg_new(&envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_set_from_plugin(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_set_sts_service(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials *msg, envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService*, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 7);
-}
-UPB_INLINE struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService* envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_mutable_sts_service(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials *msg, upb_arena *arena) {
- struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService* sub = (struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService*)envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_sts_service(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService*)_upb_msg_new(&envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_set_sts_service(msg, sub);
- }
- return sub;
-}
-
-/* envoy.config.core.v3.GrpcService.GoogleGrpc.CallCredentials.ServiceAccountJWTAccessCredentials */
-
-UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials *envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_new(upb_arena *arena) {
- return (envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials *)_upb_msg_new(&envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_msginit, arena);
-}
-UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials *envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials *ret = envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_serialize(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_json_key(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview); }
-UPB_INLINE uint64_t envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_token_lifetime_seconds(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint64_t); }
-
-UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_set_json_key(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_set_token_lifetime_seconds(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials *msg, uint64_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint64_t) = value;
-}
-
-/* envoy.config.core.v3.GrpcService.GoogleGrpc.CallCredentials.GoogleIAMCredentials */
-
-UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials *envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_new(upb_arena *arena) {
- return (envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials *)_upb_msg_new(&envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_msginit, arena);
-}
-UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials *envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials *ret = envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_serialize(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_authorization_token(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE upb_strview envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_authority_selector(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview); }
-
-UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_set_authorization_token(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_set_authority_selector(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview) = value;
-}
-
-/* envoy.config.core.v3.GrpcService.GoogleGrpc.CallCredentials.MetadataCredentialsFromPlugin */
-
-UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin *envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_new(upb_arena *arena) {
- return (envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin *)_upb_msg_new(&envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_msginit, arena);
-}
-UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin *envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin *ret = envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_serialize(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_msginit, arena, len);
-}
-
-typedef enum {
- envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_config_type_typed_config = 3,
- envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_config_type_NOT_SET = 0
-} envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_config_type_oneofcases;
-UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_config_type_oneofcases envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_config_type_case(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin* msg) { return (envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_config_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(12, 24), int32_t); }
-
-UPB_INLINE upb_strview envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_name(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_has_typed_config(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 3; }
-UPB_INLINE const struct google_protobuf_Any* envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_typed_config(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin *msg) { return UPB_READ_ONEOF(msg, const struct google_protobuf_Any*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 3, NULL); }
-
-UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_set_name(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_set_typed_config(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin *msg, struct google_protobuf_Any* value) {
- UPB_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 3);
-}
-UPB_INLINE struct google_protobuf_Any* envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_mutable_typed_config(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin *msg, upb_arena *arena) {
- struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_typed_config(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_set_typed_config(msg, sub);
- }
- return sub;
-}
-
-/* envoy.config.core.v3.GrpcService.GoogleGrpc.CallCredentials.StsService */
-
-UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService *envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_new(upb_arena *arena) {
- return (envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService *)_upb_msg_new(&envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_msginit, arena);
-}
-UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService *envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService *ret = envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_serialize(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_token_exchange_service_uri(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE upb_strview envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_resource(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview); }
-UPB_INLINE upb_strview envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_audience(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_strview); }
-UPB_INLINE upb_strview envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_scope(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 48), upb_strview); }
-UPB_INLINE upb_strview envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_requested_token_type(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 64), upb_strview); }
-UPB_INLINE upb_strview envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_subject_token_path(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(40, 80), upb_strview); }
-UPB_INLINE upb_strview envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_subject_token_type(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(48, 96), upb_strview); }
-UPB_INLINE upb_strview envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_actor_token_path(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(56, 112), upb_strview); }
-UPB_INLINE upb_strview envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_actor_token_type(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(64, 128), upb_strview); }
-
-UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_set_token_exchange_service_uri(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_set_resource(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_set_audience(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_set_scope(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(24, 48), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_set_requested_token_type(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(32, 64), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_set_subject_token_path(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(40, 80), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_set_subject_token_type(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(48, 96), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_set_actor_token_path(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(56, 112), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_set_actor_token_type(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(64, 128), upb_strview) = value;
-}
-
-/* envoy.config.core.v3.GrpcService.GoogleGrpc.ChannelArgs */
-
-UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs *envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_new(upb_arena *arena) {
- return (envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs *)_upb_msg_new(&envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_msginit, arena);
-}
-UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs *envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs *ret = envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_serialize(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_has_args(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE size_t envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_args_size(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs *msg) {return _upb_msg_map_size(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_args_get(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs *msg, upb_strview key, envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value* *val) { return _upb_msg_map_get(msg, UPB_SIZE(0, 0), &key, 0, val, sizeof(*val)); }
-UPB_INLINE const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry* envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_args_next(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs *msg, size_t* iter) { return (const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry*)_upb_msg_map_next(msg, UPB_SIZE(0, 0), iter); }
-
-UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_args_clear(envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs *msg) { _upb_msg_map_clear(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_args_set(envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs *msg, upb_strview key, envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value* val, upb_arena *a) { return _upb_msg_map_set(msg, UPB_SIZE(0, 0), &key, 0, &val, sizeof(val), a); }
-UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_args_delete(envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs *msg, upb_strview key) { return _upb_msg_map_delete(msg, UPB_SIZE(0, 0), &key, 0); }
-UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry* envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_args_nextmutable(envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs *msg, size_t* iter) { return (envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry*)_upb_msg_map_next(msg, UPB_SIZE(0, 0), iter); }
-
-/* envoy.config.core.v3.GrpcService.GoogleGrpc.ChannelArgs.Value */
-
-UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value *envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_new(upb_arena *arena) {
- return (envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value *)_upb_msg_new(&envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_msginit, arena);
-}
-UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value *envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value *ret = envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_serialize(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_msginit, arena, len);
-}
-
-typedef enum {
- envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_value_specifier_string_value = 1,
- envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_value_specifier_int_value = 2,
- envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_value_specifier_NOT_SET = 0
-} envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_value_specifier_oneofcases;
-UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_value_specifier_oneofcases envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_value_specifier_case(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value* msg) { return (envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_value_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(8, 16), int32_t); }
-
-UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_has_string_value(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 1; }
-UPB_INLINE upb_strview envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_string_value(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 1, upb_strview_make("", strlen(""))); }
-UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_has_int_value(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 2; }
-UPB_INLINE int64_t envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_int_value(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value *msg) { return UPB_READ_ONEOF(msg, int64_t, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 2, 0); }
-
-UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_set_string_value(envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value *msg, upb_strview value) {
- UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 1);
-}
-UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_set_int_value(envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value *msg, int64_t value) {
- UPB_WRITE_ONEOF(msg, int64_t, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 2);
-}
-
-/* envoy.config.core.v3.GrpcService.GoogleGrpc.ChannelArgs.ArgsEntry */
-
-UPB_INLINE upb_strview envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry_key(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry *msg) {
- upb_strview ret;
- _upb_msg_map_key(msg, &ret, 0);
- return ret;
-}
-UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry_has_value(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value* envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry_value(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry *msg) {
- envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value* ret;
- _upb_msg_map_value(msg, &ret, sizeof(ret));
- return ret;
-}
-
-UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry_set_value(envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry *msg, envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value* value) {
- _upb_msg_map_set_value(msg, &value, sizeof(envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value*));
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* ENVOY_CONFIG_CORE_V3_GRPC_SERVICE_PROTO_UPB_H_ */
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/core/v3/grpc_service.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_CONFIG_CORE_V3_GRPC_SERVICE_PROTO_UPB_H_
+#define ENVOY_CONFIG_CORE_V3_GRPC_SERVICE_PROTO_UPB_H_
+
+#include "upb/msg.h"
+#include "upb/decode.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_config_core_v3_GrpcService;
+struct envoy_config_core_v3_GrpcService_EnvoyGrpc;
+struct envoy_config_core_v3_GrpcService_GoogleGrpc;
+struct envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials;
+struct envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials;
+struct envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials;
+struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials;
+struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials;
+struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials;
+struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin;
+struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService;
+struct envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs;
+struct envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value;
+struct envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry;
+typedef struct envoy_config_core_v3_GrpcService envoy_config_core_v3_GrpcService;
+typedef struct envoy_config_core_v3_GrpcService_EnvoyGrpc envoy_config_core_v3_GrpcService_EnvoyGrpc;
+typedef struct envoy_config_core_v3_GrpcService_GoogleGrpc envoy_config_core_v3_GrpcService_GoogleGrpc;
+typedef struct envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials;
+typedef struct envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials;
+typedef struct envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials;
+typedef struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials;
+typedef struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials;
+typedef struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials;
+typedef struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin;
+typedef struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService;
+typedef struct envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs;
+typedef struct envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value;
+typedef struct envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry;
+extern const upb_msglayout envoy_config_core_v3_GrpcService_msginit;
+extern const upb_msglayout envoy_config_core_v3_GrpcService_EnvoyGrpc_msginit;
+extern const upb_msglayout envoy_config_core_v3_GrpcService_GoogleGrpc_msginit;
+extern const upb_msglayout envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_msginit;
+extern const upb_msglayout envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials_msginit;
+extern const upb_msglayout envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_msginit;
+extern const upb_msglayout envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_msginit;
+extern const upb_msglayout envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_msginit;
+extern const upb_msglayout envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_msginit;
+extern const upb_msglayout envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_msginit;
+extern const upb_msglayout envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_msginit;
+extern const upb_msglayout envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_msginit;
+extern const upb_msglayout envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_msginit;
+extern const upb_msglayout envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry_msginit;
+struct envoy_config_core_v3_DataSource;
+struct envoy_config_core_v3_HeaderValue;
+struct google_protobuf_Any;
+struct google_protobuf_Duration;
+struct google_protobuf_Empty;
+struct google_protobuf_Struct;
+struct google_protobuf_UInt32Value;
+extern const upb_msglayout envoy_config_core_v3_DataSource_msginit;
+extern const upb_msglayout envoy_config_core_v3_HeaderValue_msginit;
+extern const upb_msglayout google_protobuf_Any_msginit;
+extern const upb_msglayout google_protobuf_Duration_msginit;
+extern const upb_msglayout google_protobuf_Empty_msginit;
+extern const upb_msglayout google_protobuf_Struct_msginit;
+extern const upb_msglayout google_protobuf_UInt32Value_msginit;
+
+
+/* envoy.config.core.v3.GrpcService */
+
+UPB_INLINE envoy_config_core_v3_GrpcService *envoy_config_core_v3_GrpcService_new(upb_arena *arena) {
+ return (envoy_config_core_v3_GrpcService *)_upb_msg_new(&envoy_config_core_v3_GrpcService_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_GrpcService *envoy_config_core_v3_GrpcService_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_core_v3_GrpcService *ret = envoy_config_core_v3_GrpcService_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_GrpcService_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_core_v3_GrpcService_serialize(const envoy_config_core_v3_GrpcService *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_core_v3_GrpcService_msginit, arena, len);
+}
+
+typedef enum {
+ envoy_config_core_v3_GrpcService_target_specifier_envoy_grpc = 1,
+ envoy_config_core_v3_GrpcService_target_specifier_google_grpc = 2,
+ envoy_config_core_v3_GrpcService_target_specifier_NOT_SET = 0
+} envoy_config_core_v3_GrpcService_target_specifier_oneofcases;
+UPB_INLINE envoy_config_core_v3_GrpcService_target_specifier_oneofcases envoy_config_core_v3_GrpcService_target_specifier_case(const envoy_config_core_v3_GrpcService* msg) { return (envoy_config_core_v3_GrpcService_target_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(12, 24), int32_t); }
+
+UPB_INLINE bool envoy_config_core_v3_GrpcService_has_envoy_grpc(const envoy_config_core_v3_GrpcService *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 1; }
+UPB_INLINE const envoy_config_core_v3_GrpcService_EnvoyGrpc* envoy_config_core_v3_GrpcService_envoy_grpc(const envoy_config_core_v3_GrpcService *msg) { return UPB_READ_ONEOF(msg, const envoy_config_core_v3_GrpcService_EnvoyGrpc*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 1, NULL); }
+UPB_INLINE bool envoy_config_core_v3_GrpcService_has_google_grpc(const envoy_config_core_v3_GrpcService *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 2; }
+UPB_INLINE const envoy_config_core_v3_GrpcService_GoogleGrpc* envoy_config_core_v3_GrpcService_google_grpc(const envoy_config_core_v3_GrpcService *msg) { return UPB_READ_ONEOF(msg, const envoy_config_core_v3_GrpcService_GoogleGrpc*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 2, NULL); }
+UPB_INLINE bool envoy_config_core_v3_GrpcService_has_timeout(const envoy_config_core_v3_GrpcService *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE const struct google_protobuf_Duration* envoy_config_core_v3_GrpcService_timeout(const envoy_config_core_v3_GrpcService *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct google_protobuf_Duration*); }
+UPB_INLINE bool envoy_config_core_v3_GrpcService_has_initial_metadata(const envoy_config_core_v3_GrpcService *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
+UPB_INLINE const struct envoy_config_core_v3_HeaderValue* const* envoy_config_core_v3_GrpcService_initial_metadata(const envoy_config_core_v3_GrpcService *msg, size_t *len) { return (const struct envoy_config_core_v3_HeaderValue* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len); }
+
+UPB_INLINE void envoy_config_core_v3_GrpcService_set_envoy_grpc(envoy_config_core_v3_GrpcService *msg, envoy_config_core_v3_GrpcService_EnvoyGrpc* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_core_v3_GrpcService_EnvoyGrpc*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 1);
+}
+UPB_INLINE struct envoy_config_core_v3_GrpcService_EnvoyGrpc* envoy_config_core_v3_GrpcService_mutable_envoy_grpc(envoy_config_core_v3_GrpcService *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_GrpcService_EnvoyGrpc* sub = (struct envoy_config_core_v3_GrpcService_EnvoyGrpc*)envoy_config_core_v3_GrpcService_envoy_grpc(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_GrpcService_EnvoyGrpc*)_upb_msg_new(&envoy_config_core_v3_GrpcService_EnvoyGrpc_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_GrpcService_set_envoy_grpc(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_GrpcService_set_google_grpc(envoy_config_core_v3_GrpcService *msg, envoy_config_core_v3_GrpcService_GoogleGrpc* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_core_v3_GrpcService_GoogleGrpc*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 2);
+}
+UPB_INLINE struct envoy_config_core_v3_GrpcService_GoogleGrpc* envoy_config_core_v3_GrpcService_mutable_google_grpc(envoy_config_core_v3_GrpcService *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_GrpcService_GoogleGrpc* sub = (struct envoy_config_core_v3_GrpcService_GoogleGrpc*)envoy_config_core_v3_GrpcService_google_grpc(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_GrpcService_GoogleGrpc*)_upb_msg_new(&envoy_config_core_v3_GrpcService_GoogleGrpc_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_GrpcService_set_google_grpc(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_GrpcService_set_timeout(envoy_config_core_v3_GrpcService *msg, struct google_protobuf_Duration* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct google_protobuf_Duration*) = value;
+}
+UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_GrpcService_mutable_timeout(envoy_config_core_v3_GrpcService *msg, upb_arena *arena) {
+ struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_core_v3_GrpcService_timeout(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_GrpcService_set_timeout(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE struct envoy_config_core_v3_HeaderValue** envoy_config_core_v3_GrpcService_mutable_initial_metadata(envoy_config_core_v3_GrpcService *msg, size_t *len) {
+ return (struct envoy_config_core_v3_HeaderValue**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len);
+}
+UPB_INLINE struct envoy_config_core_v3_HeaderValue** envoy_config_core_v3_GrpcService_resize_initial_metadata(envoy_config_core_v3_GrpcService *msg, size_t len, upb_arena *arena) {
+ return (struct envoy_config_core_v3_HeaderValue**)_upb_array_resize_accessor(msg, UPB_SIZE(4, 8), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_config_core_v3_HeaderValue* envoy_config_core_v3_GrpcService_add_initial_metadata(envoy_config_core_v3_GrpcService *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_HeaderValue* sub = (struct envoy_config_core_v3_HeaderValue*)_upb_msg_new(&envoy_config_core_v3_HeaderValue_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(4, 8), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+
+/* envoy.config.core.v3.GrpcService.EnvoyGrpc */
+
+UPB_INLINE envoy_config_core_v3_GrpcService_EnvoyGrpc *envoy_config_core_v3_GrpcService_EnvoyGrpc_new(upb_arena *arena) {
+ return (envoy_config_core_v3_GrpcService_EnvoyGrpc *)_upb_msg_new(&envoy_config_core_v3_GrpcService_EnvoyGrpc_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_GrpcService_EnvoyGrpc *envoy_config_core_v3_GrpcService_EnvoyGrpc_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_core_v3_GrpcService_EnvoyGrpc *ret = envoy_config_core_v3_GrpcService_EnvoyGrpc_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_GrpcService_EnvoyGrpc_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_core_v3_GrpcService_EnvoyGrpc_serialize(const envoy_config_core_v3_GrpcService_EnvoyGrpc *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_core_v3_GrpcService_EnvoyGrpc_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview envoy_config_core_v3_GrpcService_EnvoyGrpc_cluster_name(const envoy_config_core_v3_GrpcService_EnvoyGrpc *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE upb_strview envoy_config_core_v3_GrpcService_EnvoyGrpc_authority(const envoy_config_core_v3_GrpcService_EnvoyGrpc *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview); }
+
+UPB_INLINE void envoy_config_core_v3_GrpcService_EnvoyGrpc_set_cluster_name(envoy_config_core_v3_GrpcService_EnvoyGrpc *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_core_v3_GrpcService_EnvoyGrpc_set_authority(envoy_config_core_v3_GrpcService_EnvoyGrpc *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview) = value;
+}
+
+/* envoy.config.core.v3.GrpcService.GoogleGrpc */
+
+UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc *envoy_config_core_v3_GrpcService_GoogleGrpc_new(upb_arena *arena) {
+ return (envoy_config_core_v3_GrpcService_GoogleGrpc *)_upb_msg_new(&envoy_config_core_v3_GrpcService_GoogleGrpc_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc *envoy_config_core_v3_GrpcService_GoogleGrpc_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_core_v3_GrpcService_GoogleGrpc *ret = envoy_config_core_v3_GrpcService_GoogleGrpc_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_core_v3_GrpcService_GoogleGrpc_serialize(const envoy_config_core_v3_GrpcService_GoogleGrpc *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview envoy_config_core_v3_GrpcService_GoogleGrpc_target_uri(const envoy_config_core_v3_GrpcService_GoogleGrpc *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_has_channel_credentials(const envoy_config_core_v3_GrpcService_GoogleGrpc *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 48)); }
+UPB_INLINE const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials* envoy_config_core_v3_GrpcService_GoogleGrpc_channel_credentials(const envoy_config_core_v3_GrpcService_GoogleGrpc *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 48), const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials*); }
+UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_has_call_credentials(const envoy_config_core_v3_GrpcService_GoogleGrpc *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(40, 80)); }
+UPB_INLINE const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials* const* envoy_config_core_v3_GrpcService_GoogleGrpc_call_credentials(const envoy_config_core_v3_GrpcService_GoogleGrpc *msg, size_t *len) { return (const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials* const*)_upb_array_accessor(msg, UPB_SIZE(40, 80), len); }
+UPB_INLINE upb_strview envoy_config_core_v3_GrpcService_GoogleGrpc_stat_prefix(const envoy_config_core_v3_GrpcService_GoogleGrpc *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview); }
+UPB_INLINE upb_strview envoy_config_core_v3_GrpcService_GoogleGrpc_credentials_factory_name(const envoy_config_core_v3_GrpcService_GoogleGrpc *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_strview); }
+UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_has_config(const envoy_config_core_v3_GrpcService_GoogleGrpc *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 56)); }
+UPB_INLINE const struct google_protobuf_Struct* envoy_config_core_v3_GrpcService_GoogleGrpc_config(const envoy_config_core_v3_GrpcService_GoogleGrpc *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 56), const struct google_protobuf_Struct*); }
+UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_has_per_stream_buffer_limit_bytes(const envoy_config_core_v3_GrpcService_GoogleGrpc *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(32, 64)); }
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_core_v3_GrpcService_GoogleGrpc_per_stream_buffer_limit_bytes(const envoy_config_core_v3_GrpcService_GoogleGrpc *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 64), const struct google_protobuf_UInt32Value*); }
+UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_has_channel_args(const envoy_config_core_v3_GrpcService_GoogleGrpc *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(36, 72)); }
+UPB_INLINE const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs* envoy_config_core_v3_GrpcService_GoogleGrpc_channel_args(const envoy_config_core_v3_GrpcService_GoogleGrpc *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(36, 72), const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs*); }
+
+UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_set_target_uri(envoy_config_core_v3_GrpcService_GoogleGrpc *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_set_channel_credentials(envoy_config_core_v3_GrpcService_GoogleGrpc *msg, envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 48), envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials* envoy_config_core_v3_GrpcService_GoogleGrpc_mutable_channel_credentials(envoy_config_core_v3_GrpcService_GoogleGrpc *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials* sub = (struct envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials*)envoy_config_core_v3_GrpcService_GoogleGrpc_channel_credentials(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials*)_upb_msg_new(&envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_GrpcService_GoogleGrpc_set_channel_credentials(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials** envoy_config_core_v3_GrpcService_GoogleGrpc_mutable_call_credentials(envoy_config_core_v3_GrpcService_GoogleGrpc *msg, size_t *len) {
+ return (envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials**)_upb_array_mutable_accessor(msg, UPB_SIZE(40, 80), len);
+}
+UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials** envoy_config_core_v3_GrpcService_GoogleGrpc_resize_call_credentials(envoy_config_core_v3_GrpcService_GoogleGrpc *msg, size_t len, upb_arena *arena) {
+ return (envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials**)_upb_array_resize_accessor(msg, UPB_SIZE(40, 80), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials* envoy_config_core_v3_GrpcService_GoogleGrpc_add_call_credentials(envoy_config_core_v3_GrpcService_GoogleGrpc *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials* sub = (struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials*)_upb_msg_new(&envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(40, 80), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_set_stat_prefix(envoy_config_core_v3_GrpcService_GoogleGrpc *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_set_credentials_factory_name(envoy_config_core_v3_GrpcService_GoogleGrpc *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_set_config(envoy_config_core_v3_GrpcService_GoogleGrpc *msg, struct google_protobuf_Struct* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 56), struct google_protobuf_Struct*) = value;
+}
+UPB_INLINE struct google_protobuf_Struct* envoy_config_core_v3_GrpcService_GoogleGrpc_mutable_config(envoy_config_core_v3_GrpcService_GoogleGrpc *msg, upb_arena *arena) {
+ struct google_protobuf_Struct* sub = (struct google_protobuf_Struct*)envoy_config_core_v3_GrpcService_GoogleGrpc_config(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Struct*)_upb_msg_new(&google_protobuf_Struct_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_GrpcService_GoogleGrpc_set_config(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_set_per_stream_buffer_limit_bytes(envoy_config_core_v3_GrpcService_GoogleGrpc *msg, struct google_protobuf_UInt32Value* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 64), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_GrpcService_GoogleGrpc_mutable_per_stream_buffer_limit_bytes(envoy_config_core_v3_GrpcService_GoogleGrpc *msg, upb_arena *arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_core_v3_GrpcService_GoogleGrpc_per_stream_buffer_limit_bytes(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_GrpcService_GoogleGrpc_set_per_stream_buffer_limit_bytes(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_set_channel_args(envoy_config_core_v3_GrpcService_GoogleGrpc *msg, envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(36, 72), envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs* envoy_config_core_v3_GrpcService_GoogleGrpc_mutable_channel_args(envoy_config_core_v3_GrpcService_GoogleGrpc *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs* sub = (struct envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs*)envoy_config_core_v3_GrpcService_GoogleGrpc_channel_args(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs*)_upb_msg_new(&envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_GrpcService_GoogleGrpc_set_channel_args(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.core.v3.GrpcService.GoogleGrpc.SslCredentials */
+
+UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials *envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_new(upb_arena *arena) {
+ return (envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials *)_upb_msg_new(&envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials *envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials *ret = envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_serialize(const envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_has_root_certs(const envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE const struct envoy_config_core_v3_DataSource* envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_root_certs(const envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct envoy_config_core_v3_DataSource*); }
+UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_has_private_key(const envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
+UPB_INLINE const struct envoy_config_core_v3_DataSource* envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_private_key(const envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_config_core_v3_DataSource*); }
+UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_has_cert_chain(const envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
+UPB_INLINE const struct envoy_config_core_v3_DataSource* envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_cert_chain(const envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct envoy_config_core_v3_DataSource*); }
+
+UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_set_root_certs(envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials *msg, struct envoy_config_core_v3_DataSource* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct envoy_config_core_v3_DataSource*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_DataSource* envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_mutable_root_certs(envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_DataSource* sub = (struct envoy_config_core_v3_DataSource*)envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_root_certs(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_DataSource*)_upb_msg_new(&envoy_config_core_v3_DataSource_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_set_root_certs(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_set_private_key(envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials *msg, struct envoy_config_core_v3_DataSource* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_config_core_v3_DataSource*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_DataSource* envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_mutable_private_key(envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_DataSource* sub = (struct envoy_config_core_v3_DataSource*)envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_private_key(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_DataSource*)_upb_msg_new(&envoy_config_core_v3_DataSource_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_set_private_key(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_set_cert_chain(envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials *msg, struct envoy_config_core_v3_DataSource* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct envoy_config_core_v3_DataSource*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_DataSource* envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_mutable_cert_chain(envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_DataSource* sub = (struct envoy_config_core_v3_DataSource*)envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_cert_chain(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_DataSource*)_upb_msg_new(&envoy_config_core_v3_DataSource_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_set_cert_chain(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.core.v3.GrpcService.GoogleGrpc.GoogleLocalCredentials */
+
+UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials *envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials_new(upb_arena *arena) {
+ return (envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials *)_upb_msg_new(&envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials *envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials *ret = envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials_serialize(const envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials_msginit, arena, len);
+}
+
+
+
+/* envoy.config.core.v3.GrpcService.GoogleGrpc.ChannelCredentials */
+
+UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials *envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_new(upb_arena *arena) {
+ return (envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials *)_upb_msg_new(&envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials *envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials *ret = envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_serialize(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_msginit, arena, len);
+}
+
+typedef enum {
+ envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_credential_specifier_ssl_credentials = 1,
+ envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_credential_specifier_google_default = 2,
+ envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_credential_specifier_local_credentials = 3,
+ envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_credential_specifier_NOT_SET = 0
+} envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_credential_specifier_oneofcases;
+UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_credential_specifier_oneofcases envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_credential_specifier_case(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials* msg) { return (envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_credential_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 8), int32_t); }
+
+UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_has_ssl_credentials(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 1; }
+UPB_INLINE const envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials* envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_ssl_credentials(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials *msg) { return UPB_READ_ONEOF(msg, const envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 1, NULL); }
+UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_has_google_default(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 2; }
+UPB_INLINE const struct google_protobuf_Empty* envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_google_default(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials *msg) { return UPB_READ_ONEOF(msg, const struct google_protobuf_Empty*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 2, NULL); }
+UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_has_local_credentials(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 3; }
+UPB_INLINE const envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials* envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_local_credentials(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials *msg) { return UPB_READ_ONEOF(msg, const envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 3, NULL); }
+
+UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_set_ssl_credentials(envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials *msg, envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 1);
+}
+UPB_INLINE struct envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials* envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_mutable_ssl_credentials(envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials* sub = (struct envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials*)envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_ssl_credentials(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials*)_upb_msg_new(&envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_set_ssl_credentials(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_set_google_default(envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials *msg, struct google_protobuf_Empty* value) {
+ UPB_WRITE_ONEOF(msg, struct google_protobuf_Empty*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 2);
+}
+UPB_INLINE struct google_protobuf_Empty* envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_mutable_google_default(envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials *msg, upb_arena *arena) {
+ struct google_protobuf_Empty* sub = (struct google_protobuf_Empty*)envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_google_default(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Empty*)_upb_msg_new(&google_protobuf_Empty_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_set_google_default(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_set_local_credentials(envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials *msg, envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 3);
+}
+UPB_INLINE struct envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials* envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_mutable_local_credentials(envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials* sub = (struct envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials*)envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_local_credentials(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials*)_upb_msg_new(&envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_set_local_credentials(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.core.v3.GrpcService.GoogleGrpc.CallCredentials */
+
+UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials *envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_new(upb_arena *arena) {
+ return (envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials *)_upb_msg_new(&envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials *envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials *ret = envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_serialize(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_msginit, arena, len);
+}
+
+typedef enum {
+ envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_credential_specifier_access_token = 1,
+ envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_credential_specifier_google_compute_engine = 2,
+ envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_credential_specifier_google_refresh_token = 3,
+ envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_credential_specifier_service_account_jwt_access = 4,
+ envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_credential_specifier_google_iam = 5,
+ envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_credential_specifier_from_plugin = 6,
+ envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_credential_specifier_sts_service = 7,
+ envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_credential_specifier_NOT_SET = 0
+} envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_credential_specifier_oneofcases;
+UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_credential_specifier_oneofcases envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_credential_specifier_case(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials* msg) { return (envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_credential_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(8, 16), int32_t); }
+
+UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_has_access_token(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 1; }
+UPB_INLINE upb_strview envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_access_token(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 1, upb_strview_make("", strlen(""))); }
+UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_has_google_compute_engine(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 2; }
+UPB_INLINE const struct google_protobuf_Empty* envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_google_compute_engine(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials *msg) { return UPB_READ_ONEOF(msg, const struct google_protobuf_Empty*, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 2, NULL); }
+UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_has_google_refresh_token(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 3; }
+UPB_INLINE upb_strview envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_google_refresh_token(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 3, upb_strview_make("", strlen(""))); }
+UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_has_service_account_jwt_access(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 4; }
+UPB_INLINE const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials* envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_service_account_jwt_access(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials *msg) { return UPB_READ_ONEOF(msg, const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials*, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 4, NULL); }
+UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_has_google_iam(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 5; }
+UPB_INLINE const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials* envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_google_iam(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials *msg) { return UPB_READ_ONEOF(msg, const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials*, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 5, NULL); }
+UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_has_from_plugin(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 6; }
+UPB_INLINE const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin* envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_from_plugin(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials *msg) { return UPB_READ_ONEOF(msg, const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin*, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 6, NULL); }
+UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_has_sts_service(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 7; }
+UPB_INLINE const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService* envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_sts_service(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials *msg) { return UPB_READ_ONEOF(msg, const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService*, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 7, NULL); }
+
+UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_set_access_token(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials *msg, upb_strview value) {
+ UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 1);
+}
+UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_set_google_compute_engine(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials *msg, struct google_protobuf_Empty* value) {
+ UPB_WRITE_ONEOF(msg, struct google_protobuf_Empty*, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 2);
+}
+UPB_INLINE struct google_protobuf_Empty* envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_mutable_google_compute_engine(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials *msg, upb_arena *arena) {
+ struct google_protobuf_Empty* sub = (struct google_protobuf_Empty*)envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_google_compute_engine(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Empty*)_upb_msg_new(&google_protobuf_Empty_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_set_google_compute_engine(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_set_google_refresh_token(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials *msg, upb_strview value) {
+ UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 3);
+}
+UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_set_service_account_jwt_access(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials *msg, envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials*, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 4);
+}
+UPB_INLINE struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials* envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_mutable_service_account_jwt_access(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials* sub = (struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials*)envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_service_account_jwt_access(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials*)_upb_msg_new(&envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_set_service_account_jwt_access(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_set_google_iam(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials *msg, envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials*, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 5);
+}
+UPB_INLINE struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials* envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_mutable_google_iam(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials* sub = (struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials*)envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_google_iam(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials*)_upb_msg_new(&envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_set_google_iam(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_set_from_plugin(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials *msg, envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin*, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 6);
+}
+UPB_INLINE struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin* envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_mutable_from_plugin(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin* sub = (struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin*)envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_from_plugin(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin*)_upb_msg_new(&envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_set_from_plugin(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_set_sts_service(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials *msg, envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService*, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 7);
+}
+UPB_INLINE struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService* envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_mutable_sts_service(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService* sub = (struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService*)envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_sts_service(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService*)_upb_msg_new(&envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_set_sts_service(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.core.v3.GrpcService.GoogleGrpc.CallCredentials.ServiceAccountJWTAccessCredentials */
+
+UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials *envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_new(upb_arena *arena) {
+ return (envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials *)_upb_msg_new(&envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials *envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials *ret = envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_serialize(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_json_key(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview); }
+UPB_INLINE uint64_t envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_token_lifetime_seconds(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint64_t); }
+
+UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_set_json_key(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_set_token_lifetime_seconds(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials *msg, uint64_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint64_t) = value;
+}
+
+/* envoy.config.core.v3.GrpcService.GoogleGrpc.CallCredentials.GoogleIAMCredentials */
+
+UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials *envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_new(upb_arena *arena) {
+ return (envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials *)_upb_msg_new(&envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials *envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials *ret = envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_serialize(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_authorization_token(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE upb_strview envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_authority_selector(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview); }
+
+UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_set_authorization_token(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_set_authority_selector(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview) = value;
+}
+
+/* envoy.config.core.v3.GrpcService.GoogleGrpc.CallCredentials.MetadataCredentialsFromPlugin */
+
+UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin *envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_new(upb_arena *arena) {
+ return (envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin *)_upb_msg_new(&envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin *envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin *ret = envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_serialize(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_msginit, arena, len);
+}
+
+typedef enum {
+ envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_config_type_typed_config = 3,
+ envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_config_type_NOT_SET = 0
+} envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_config_type_oneofcases;
+UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_config_type_oneofcases envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_config_type_case(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin* msg) { return (envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_config_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(12, 24), int32_t); }
+
+UPB_INLINE upb_strview envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_name(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_has_typed_config(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 3; }
+UPB_INLINE const struct google_protobuf_Any* envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_typed_config(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin *msg) { return UPB_READ_ONEOF(msg, const struct google_protobuf_Any*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 3, NULL); }
+
+UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_set_name(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_set_typed_config(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin *msg, struct google_protobuf_Any* value) {
+ UPB_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 3);
+}
+UPB_INLINE struct google_protobuf_Any* envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_mutable_typed_config(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin *msg, upb_arena *arena) {
+ struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_typed_config(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_set_typed_config(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.core.v3.GrpcService.GoogleGrpc.CallCredentials.StsService */
+
+UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService *envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_new(upb_arena *arena) {
+ return (envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService *)_upb_msg_new(&envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService *envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService *ret = envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_serialize(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_token_exchange_service_uri(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE upb_strview envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_resource(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview); }
+UPB_INLINE upb_strview envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_audience(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_strview); }
+UPB_INLINE upb_strview envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_scope(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 48), upb_strview); }
+UPB_INLINE upb_strview envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_requested_token_type(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 64), upb_strview); }
+UPB_INLINE upb_strview envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_subject_token_path(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(40, 80), upb_strview); }
+UPB_INLINE upb_strview envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_subject_token_type(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(48, 96), upb_strview); }
+UPB_INLINE upb_strview envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_actor_token_path(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(56, 112), upb_strview); }
+UPB_INLINE upb_strview envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_actor_token_type(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(64, 128), upb_strview); }
+
+UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_set_token_exchange_service_uri(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_set_resource(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_set_audience(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_set_scope(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 48), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_set_requested_token_type(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 64), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_set_subject_token_path(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 80), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_set_subject_token_type(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(48, 96), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_set_actor_token_path(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(56, 112), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_set_actor_token_type(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(64, 128), upb_strview) = value;
+}
+
+/* envoy.config.core.v3.GrpcService.GoogleGrpc.ChannelArgs */
+
+UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs *envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_new(upb_arena *arena) {
+ return (envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs *)_upb_msg_new(&envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs *envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs *ret = envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_serialize(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_has_args(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE size_t envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_args_size(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs *msg) {return _upb_msg_map_size(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_args_get(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs *msg, upb_strview key, envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value* *val) { return _upb_msg_map_get(msg, UPB_SIZE(0, 0), &key, 0, val, sizeof(*val)); }
+UPB_INLINE const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry* envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_args_next(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs *msg, size_t* iter) { return (const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry*)_upb_msg_map_next(msg, UPB_SIZE(0, 0), iter); }
+
+UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_args_clear(envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs *msg) { _upb_msg_map_clear(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_args_set(envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs *msg, upb_strview key, envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value* val, upb_arena *a) { return _upb_msg_map_set(msg, UPB_SIZE(0, 0), &key, 0, &val, sizeof(val), a); }
+UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_args_delete(envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs *msg, upb_strview key) { return _upb_msg_map_delete(msg, UPB_SIZE(0, 0), &key, 0); }
+UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry* envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_args_nextmutable(envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs *msg, size_t* iter) { return (envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry*)_upb_msg_map_next(msg, UPB_SIZE(0, 0), iter); }
+
+/* envoy.config.core.v3.GrpcService.GoogleGrpc.ChannelArgs.Value */
+
+UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value *envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_new(upb_arena *arena) {
+ return (envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value *)_upb_msg_new(&envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value *envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value *ret = envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_serialize(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_msginit, arena, len);
+}
+
+typedef enum {
+ envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_value_specifier_string_value = 1,
+ envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_value_specifier_int_value = 2,
+ envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_value_specifier_NOT_SET = 0
+} envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_value_specifier_oneofcases;
+UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_value_specifier_oneofcases envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_value_specifier_case(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value* msg) { return (envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_value_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(8, 16), int32_t); }
+
+UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_has_string_value(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 1; }
+UPB_INLINE upb_strview envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_string_value(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 1, upb_strview_make("", strlen(""))); }
+UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_has_int_value(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 2; }
+UPB_INLINE int64_t envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_int_value(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value *msg) { return UPB_READ_ONEOF(msg, int64_t, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 2, 0); }
+
+UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_set_string_value(envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value *msg, upb_strview value) {
+ UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 1);
+}
+UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_set_int_value(envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value *msg, int64_t value) {
+ UPB_WRITE_ONEOF(msg, int64_t, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 2);
+}
+
+/* envoy.config.core.v3.GrpcService.GoogleGrpc.ChannelArgs.ArgsEntry */
+
+UPB_INLINE upb_strview envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry_key(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry *msg) {
+ upb_strview ret;
+ _upb_msg_map_key(msg, &ret, 0);
+ return ret;
+}
+UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry_has_value(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
+UPB_INLINE const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value* envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry_value(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry *msg) {
+ envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value* ret;
+ _upb_msg_map_value(msg, &ret, sizeof(ret));
+ return ret;
+}
+
+UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry_set_value(envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry *msg, envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value* value) {
+ _upb_msg_map_set_value(msg, &value, sizeof(envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value*));
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_CONFIG_CORE_V3_GRPC_SERVICE_PROTO_UPB_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.c
index 6f81f0c97e8..ce69337c5d7 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.c
@@ -1,170 +1,170 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/config/core/v3/health_check.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include <stddef.h>
-#include "upb/msg.h"
-#include "envoy/config/core/v3/health_check.upb.h"
-#include "envoy/config/core/v3/base.upb.h"
-#include "envoy/config/core/v3/event_service_config.upb.h"
-#include "envoy/type/matcher/v3/string.upb.h"
-#include "envoy/type/v3/http.upb.h"
-#include "envoy/type/v3/range.upb.h"
-#include "google/protobuf/any.upb.h"
-#include "google/protobuf/duration.upb.h"
-#include "google/protobuf/struct.upb.h"
-#include "google/protobuf/wrappers.upb.h"
-#include "envoy/annotations/deprecation.upb.h"
-#include "udpa/annotations/status.upb.h"
-#include "udpa/annotations/versioning.upb.h"
-#include "validate/validate.upb.h"
-
-#include "upb/port_def.inc"
-
-static const upb_msglayout *const envoy_config_core_v3_HealthCheck_submsgs[19] = {
- &envoy_config_core_v3_EventServiceConfig_msginit,
- &envoy_config_core_v3_HealthCheck_CustomHealthCheck_msginit,
- &envoy_config_core_v3_HealthCheck_GrpcHealthCheck_msginit,
- &envoy_config_core_v3_HealthCheck_HttpHealthCheck_msginit,
- &envoy_config_core_v3_HealthCheck_TcpHealthCheck_msginit,
- &envoy_config_core_v3_HealthCheck_TlsOptions_msginit,
- &google_protobuf_BoolValue_msginit,
- &google_protobuf_Duration_msginit,
- &google_protobuf_Struct_msginit,
- &google_protobuf_UInt32Value_msginit,
-};
-
-static const upb_msglayout_field envoy_config_core_v3_HealthCheck__fields[22] = {
- {1, UPB_SIZE(16, 24), 0, 7, 11, 1},
- {2, UPB_SIZE(20, 32), 0, 7, 11, 1},
- {3, UPB_SIZE(24, 40), 0, 7, 11, 1},
- {4, UPB_SIZE(28, 48), 0, 9, 11, 1},
- {5, UPB_SIZE(32, 56), 0, 9, 11, 1},
- {6, UPB_SIZE(36, 64), 0, 9, 11, 1},
- {7, UPB_SIZE(40, 72), 0, 6, 11, 1},
- {8, UPB_SIZE(76, 144), UPB_SIZE(-81, -153), 3, 11, 1},
- {9, UPB_SIZE(76, 144), UPB_SIZE(-81, -153), 4, 11, 1},
- {11, UPB_SIZE(76, 144), UPB_SIZE(-81, -153), 2, 11, 1},
- {12, UPB_SIZE(44, 80), 0, 7, 11, 1},
- {13, UPB_SIZE(76, 144), UPB_SIZE(-81, -153), 1, 11, 1},
- {14, UPB_SIZE(48, 88), 0, 7, 11, 1},
- {15, UPB_SIZE(52, 96), 0, 7, 11, 1},
- {16, UPB_SIZE(56, 104), 0, 7, 11, 1},
- {17, UPB_SIZE(8, 8), 0, 0, 9, 1},
- {18, UPB_SIZE(0, 0), 0, 0, 13, 1},
- {19, UPB_SIZE(4, 4), 0, 0, 8, 1},
- {20, UPB_SIZE(60, 112), 0, 7, 11, 1},
- {21, UPB_SIZE(64, 120), 0, 5, 11, 1},
- {22, UPB_SIZE(68, 128), 0, 0, 11, 1},
- {23, UPB_SIZE(72, 136), 0, 8, 11, 1},
-};
-
-const upb_msglayout envoy_config_core_v3_HealthCheck_msginit = {
- &envoy_config_core_v3_HealthCheck_submsgs[0],
- &envoy_config_core_v3_HealthCheck__fields[0],
- UPB_SIZE(88, 160), 22, false,
-};
-
-static const upb_msglayout_field envoy_config_core_v3_HealthCheck_Payload__fields[2] = {
- {1, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 9, 1},
- {2, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 12, 1},
-};
-
-const upb_msglayout envoy_config_core_v3_HealthCheck_Payload_msginit = {
- NULL,
- &envoy_config_core_v3_HealthCheck_Payload__fields[0],
- UPB_SIZE(16, 32), 2, false,
-};
-
-static const upb_msglayout *const envoy_config_core_v3_HealthCheck_HttpHealthCheck_submsgs[5] = {
- &envoy_config_core_v3_HeaderValueOption_msginit,
- &envoy_config_core_v3_HealthCheck_Payload_msginit,
- &envoy_type_matcher_v3_StringMatcher_msginit,
- &envoy_type_v3_Int64Range_msginit,
-};
-
-static const upb_msglayout_field envoy_config_core_v3_HealthCheck_HttpHealthCheck__fields[9] = {
- {1, UPB_SIZE(8, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(16, 24), 0, 0, 9, 1},
- {3, UPB_SIZE(24, 40), 0, 1, 11, 1},
- {4, UPB_SIZE(28, 48), 0, 1, 11, 1},
- {6, UPB_SIZE(36, 64), 0, 0, 11, 3},
- {8, UPB_SIZE(40, 72), 0, 0, 9, 3},
- {9, UPB_SIZE(44, 80), 0, 3, 11, 3},
- {10, UPB_SIZE(0, 0), 0, 0, 14, 1},
- {11, UPB_SIZE(32, 56), 0, 2, 11, 1},
-};
-
-const upb_msglayout envoy_config_core_v3_HealthCheck_HttpHealthCheck_msginit = {
- &envoy_config_core_v3_HealthCheck_HttpHealthCheck_submsgs[0],
- &envoy_config_core_v3_HealthCheck_HttpHealthCheck__fields[0],
- UPB_SIZE(48, 96), 9, false,
-};
-
-static const upb_msglayout *const envoy_config_core_v3_HealthCheck_TcpHealthCheck_submsgs[2] = {
- &envoy_config_core_v3_HealthCheck_Payload_msginit,
-};
-
-static const upb_msglayout_field envoy_config_core_v3_HealthCheck_TcpHealthCheck__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
- {2, UPB_SIZE(4, 8), 0, 0, 11, 3},
-};
-
-const upb_msglayout envoy_config_core_v3_HealthCheck_TcpHealthCheck_msginit = {
- &envoy_config_core_v3_HealthCheck_TcpHealthCheck_submsgs[0],
- &envoy_config_core_v3_HealthCheck_TcpHealthCheck__fields[0],
- UPB_SIZE(8, 16), 2, false,
-};
-
-static const upb_msglayout_field envoy_config_core_v3_HealthCheck_RedisHealthCheck__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
-};
-
-const upb_msglayout envoy_config_core_v3_HealthCheck_RedisHealthCheck_msginit = {
- NULL,
- &envoy_config_core_v3_HealthCheck_RedisHealthCheck__fields[0],
- UPB_SIZE(8, 16), 1, false,
-};
-
-static const upb_msglayout_field envoy_config_core_v3_HealthCheck_GrpcHealthCheck__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 9, 1},
-};
-
-const upb_msglayout envoy_config_core_v3_HealthCheck_GrpcHealthCheck_msginit = {
- NULL,
- &envoy_config_core_v3_HealthCheck_GrpcHealthCheck__fields[0],
- UPB_SIZE(16, 32), 2, false,
-};
-
-static const upb_msglayout *const envoy_config_core_v3_HealthCheck_CustomHealthCheck_submsgs[1] = {
- &google_protobuf_Any_msginit,
-};
-
-static const upb_msglayout_field envoy_config_core_v3_HealthCheck_CustomHealthCheck__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {3, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, 1},
-};
-
-const upb_msglayout envoy_config_core_v3_HealthCheck_CustomHealthCheck_msginit = {
- &envoy_config_core_v3_HealthCheck_CustomHealthCheck_submsgs[0],
- &envoy_config_core_v3_HealthCheck_CustomHealthCheck__fields[0],
- UPB_SIZE(16, 32), 2, false,
-};
-
-static const upb_msglayout_field envoy_config_core_v3_HealthCheck_TlsOptions__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 3},
-};
-
-const upb_msglayout envoy_config_core_v3_HealthCheck_TlsOptions_msginit = {
- NULL,
- &envoy_config_core_v3_HealthCheck_TlsOptions__fields[0],
- UPB_SIZE(4, 8), 1, false,
-};
-
-#include "upb/port_undef.inc"
-
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/core/v3/health_check.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg.h"
+#include "envoy/config/core/v3/health_check.upb.h"
+#include "envoy/config/core/v3/base.upb.h"
+#include "envoy/config/core/v3/event_service_config.upb.h"
+#include "envoy/type/matcher/v3/string.upb.h"
+#include "envoy/type/v3/http.upb.h"
+#include "envoy/type/v3/range.upb.h"
+#include "google/protobuf/any.upb.h"
+#include "google/protobuf/duration.upb.h"
+#include "google/protobuf/struct.upb.h"
+#include "google/protobuf/wrappers.upb.h"
+#include "envoy/annotations/deprecation.upb.h"
+#include "udpa/annotations/status.upb.h"
+#include "udpa/annotations/versioning.upb.h"
+#include "validate/validate.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_msglayout *const envoy_config_core_v3_HealthCheck_submsgs[19] = {
+ &envoy_config_core_v3_EventServiceConfig_msginit,
+ &envoy_config_core_v3_HealthCheck_CustomHealthCheck_msginit,
+ &envoy_config_core_v3_HealthCheck_GrpcHealthCheck_msginit,
+ &envoy_config_core_v3_HealthCheck_HttpHealthCheck_msginit,
+ &envoy_config_core_v3_HealthCheck_TcpHealthCheck_msginit,
+ &envoy_config_core_v3_HealthCheck_TlsOptions_msginit,
+ &google_protobuf_BoolValue_msginit,
+ &google_protobuf_Duration_msginit,
+ &google_protobuf_Struct_msginit,
+ &google_protobuf_UInt32Value_msginit,
+};
+
+static const upb_msglayout_field envoy_config_core_v3_HealthCheck__fields[22] = {
+ {1, UPB_SIZE(16, 24), 0, 7, 11, 1},
+ {2, UPB_SIZE(20, 32), 0, 7, 11, 1},
+ {3, UPB_SIZE(24, 40), 0, 7, 11, 1},
+ {4, UPB_SIZE(28, 48), 0, 9, 11, 1},
+ {5, UPB_SIZE(32, 56), 0, 9, 11, 1},
+ {6, UPB_SIZE(36, 64), 0, 9, 11, 1},
+ {7, UPB_SIZE(40, 72), 0, 6, 11, 1},
+ {8, UPB_SIZE(76, 144), UPB_SIZE(-81, -153), 3, 11, 1},
+ {9, UPB_SIZE(76, 144), UPB_SIZE(-81, -153), 4, 11, 1},
+ {11, UPB_SIZE(76, 144), UPB_SIZE(-81, -153), 2, 11, 1},
+ {12, UPB_SIZE(44, 80), 0, 7, 11, 1},
+ {13, UPB_SIZE(76, 144), UPB_SIZE(-81, -153), 1, 11, 1},
+ {14, UPB_SIZE(48, 88), 0, 7, 11, 1},
+ {15, UPB_SIZE(52, 96), 0, 7, 11, 1},
+ {16, UPB_SIZE(56, 104), 0, 7, 11, 1},
+ {17, UPB_SIZE(8, 8), 0, 0, 9, 1},
+ {18, UPB_SIZE(0, 0), 0, 0, 13, 1},
+ {19, UPB_SIZE(4, 4), 0, 0, 8, 1},
+ {20, UPB_SIZE(60, 112), 0, 7, 11, 1},
+ {21, UPB_SIZE(64, 120), 0, 5, 11, 1},
+ {22, UPB_SIZE(68, 128), 0, 0, 11, 1},
+ {23, UPB_SIZE(72, 136), 0, 8, 11, 1},
+};
+
+const upb_msglayout envoy_config_core_v3_HealthCheck_msginit = {
+ &envoy_config_core_v3_HealthCheck_submsgs[0],
+ &envoy_config_core_v3_HealthCheck__fields[0],
+ UPB_SIZE(88, 160), 22, false,
+};
+
+static const upb_msglayout_field envoy_config_core_v3_HealthCheck_Payload__fields[2] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 9, 1},
+ {2, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 12, 1},
+};
+
+const upb_msglayout envoy_config_core_v3_HealthCheck_Payload_msginit = {
+ NULL,
+ &envoy_config_core_v3_HealthCheck_Payload__fields[0],
+ UPB_SIZE(16, 32), 2, false,
+};
+
+static const upb_msglayout *const envoy_config_core_v3_HealthCheck_HttpHealthCheck_submsgs[5] = {
+ &envoy_config_core_v3_HeaderValueOption_msginit,
+ &envoy_config_core_v3_HealthCheck_Payload_msginit,
+ &envoy_type_matcher_v3_StringMatcher_msginit,
+ &envoy_type_v3_Int64Range_msginit,
+};
+
+static const upb_msglayout_field envoy_config_core_v3_HealthCheck_HttpHealthCheck__fields[9] = {
+ {1, UPB_SIZE(8, 8), 0, 0, 9, 1},
+ {2, UPB_SIZE(16, 24), 0, 0, 9, 1},
+ {3, UPB_SIZE(24, 40), 0, 1, 11, 1},
+ {4, UPB_SIZE(28, 48), 0, 1, 11, 1},
+ {6, UPB_SIZE(36, 64), 0, 0, 11, 3},
+ {8, UPB_SIZE(40, 72), 0, 0, 9, 3},
+ {9, UPB_SIZE(44, 80), 0, 3, 11, 3},
+ {10, UPB_SIZE(0, 0), 0, 0, 14, 1},
+ {11, UPB_SIZE(32, 56), 0, 2, 11, 1},
+};
+
+const upb_msglayout envoy_config_core_v3_HealthCheck_HttpHealthCheck_msginit = {
+ &envoy_config_core_v3_HealthCheck_HttpHealthCheck_submsgs[0],
+ &envoy_config_core_v3_HealthCheck_HttpHealthCheck__fields[0],
+ UPB_SIZE(48, 96), 9, false,
+};
+
+static const upb_msglayout *const envoy_config_core_v3_HealthCheck_TcpHealthCheck_submsgs[2] = {
+ &envoy_config_core_v3_HealthCheck_Payload_msginit,
+};
+
+static const upb_msglayout_field envoy_config_core_v3_HealthCheck_TcpHealthCheck__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
+ {2, UPB_SIZE(4, 8), 0, 0, 11, 3},
+};
+
+const upb_msglayout envoy_config_core_v3_HealthCheck_TcpHealthCheck_msginit = {
+ &envoy_config_core_v3_HealthCheck_TcpHealthCheck_submsgs[0],
+ &envoy_config_core_v3_HealthCheck_TcpHealthCheck__fields[0],
+ UPB_SIZE(8, 16), 2, false,
+};
+
+static const upb_msglayout_field envoy_config_core_v3_HealthCheck_RedisHealthCheck__fields[1] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+};
+
+const upb_msglayout envoy_config_core_v3_HealthCheck_RedisHealthCheck_msginit = {
+ NULL,
+ &envoy_config_core_v3_HealthCheck_RedisHealthCheck__fields[0],
+ UPB_SIZE(8, 16), 1, false,
+};
+
+static const upb_msglayout_field envoy_config_core_v3_HealthCheck_GrpcHealthCheck__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {2, UPB_SIZE(8, 16), 0, 0, 9, 1},
+};
+
+const upb_msglayout envoy_config_core_v3_HealthCheck_GrpcHealthCheck_msginit = {
+ NULL,
+ &envoy_config_core_v3_HealthCheck_GrpcHealthCheck__fields[0],
+ UPB_SIZE(16, 32), 2, false,
+};
+
+static const upb_msglayout *const envoy_config_core_v3_HealthCheck_CustomHealthCheck_submsgs[1] = {
+ &google_protobuf_Any_msginit,
+};
+
+static const upb_msglayout_field envoy_config_core_v3_HealthCheck_CustomHealthCheck__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {3, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, 1},
+};
+
+const upb_msglayout envoy_config_core_v3_HealthCheck_CustomHealthCheck_msginit = {
+ &envoy_config_core_v3_HealthCheck_CustomHealthCheck_submsgs[0],
+ &envoy_config_core_v3_HealthCheck_CustomHealthCheck__fields[0],
+ UPB_SIZE(16, 32), 2, false,
+};
+
+static const upb_msglayout_field envoy_config_core_v3_HealthCheck_TlsOptions__fields[1] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 3},
+};
+
+const upb_msglayout envoy_config_core_v3_HealthCheck_TlsOptions_msginit = {
+ NULL,
+ &envoy_config_core_v3_HealthCheck_TlsOptions__fields[0],
+ UPB_SIZE(4, 8), 1, false,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.h
index 9cadab23ba3..aa8c7d3ab8d 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.h
@@ -1,684 +1,684 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/config/core/v3/health_check.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef ENVOY_CONFIG_CORE_V3_HEALTH_CHECK_PROTO_UPB_H_
-#define ENVOY_CONFIG_CORE_V3_HEALTH_CHECK_PROTO_UPB_H_
-
-#include "upb/msg.h"
-#include "upb/decode.h"
-#include "upb/encode.h"
-
-#include "upb/port_def.inc"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct envoy_config_core_v3_HealthCheck;
-struct envoy_config_core_v3_HealthCheck_Payload;
-struct envoy_config_core_v3_HealthCheck_HttpHealthCheck;
-struct envoy_config_core_v3_HealthCheck_TcpHealthCheck;
-struct envoy_config_core_v3_HealthCheck_RedisHealthCheck;
-struct envoy_config_core_v3_HealthCheck_GrpcHealthCheck;
-struct envoy_config_core_v3_HealthCheck_CustomHealthCheck;
-struct envoy_config_core_v3_HealthCheck_TlsOptions;
-typedef struct envoy_config_core_v3_HealthCheck envoy_config_core_v3_HealthCheck;
-typedef struct envoy_config_core_v3_HealthCheck_Payload envoy_config_core_v3_HealthCheck_Payload;
-typedef struct envoy_config_core_v3_HealthCheck_HttpHealthCheck envoy_config_core_v3_HealthCheck_HttpHealthCheck;
-typedef struct envoy_config_core_v3_HealthCheck_TcpHealthCheck envoy_config_core_v3_HealthCheck_TcpHealthCheck;
-typedef struct envoy_config_core_v3_HealthCheck_RedisHealthCheck envoy_config_core_v3_HealthCheck_RedisHealthCheck;
-typedef struct envoy_config_core_v3_HealthCheck_GrpcHealthCheck envoy_config_core_v3_HealthCheck_GrpcHealthCheck;
-typedef struct envoy_config_core_v3_HealthCheck_CustomHealthCheck envoy_config_core_v3_HealthCheck_CustomHealthCheck;
-typedef struct envoy_config_core_v3_HealthCheck_TlsOptions envoy_config_core_v3_HealthCheck_TlsOptions;
-extern const upb_msglayout envoy_config_core_v3_HealthCheck_msginit;
-extern const upb_msglayout envoy_config_core_v3_HealthCheck_Payload_msginit;
-extern const upb_msglayout envoy_config_core_v3_HealthCheck_HttpHealthCheck_msginit;
-extern const upb_msglayout envoy_config_core_v3_HealthCheck_TcpHealthCheck_msginit;
-extern const upb_msglayout envoy_config_core_v3_HealthCheck_RedisHealthCheck_msginit;
-extern const upb_msglayout envoy_config_core_v3_HealthCheck_GrpcHealthCheck_msginit;
-extern const upb_msglayout envoy_config_core_v3_HealthCheck_CustomHealthCheck_msginit;
-extern const upb_msglayout envoy_config_core_v3_HealthCheck_TlsOptions_msginit;
-struct envoy_config_core_v3_EventServiceConfig;
-struct envoy_config_core_v3_HeaderValueOption;
-struct envoy_type_matcher_v3_StringMatcher;
-struct envoy_type_v3_Int64Range;
-struct google_protobuf_Any;
-struct google_protobuf_BoolValue;
-struct google_protobuf_Duration;
-struct google_protobuf_Struct;
-struct google_protobuf_UInt32Value;
-extern const upb_msglayout envoy_config_core_v3_EventServiceConfig_msginit;
-extern const upb_msglayout envoy_config_core_v3_HeaderValueOption_msginit;
-extern const upb_msglayout envoy_type_matcher_v3_StringMatcher_msginit;
-extern const upb_msglayout envoy_type_v3_Int64Range_msginit;
-extern const upb_msglayout google_protobuf_Any_msginit;
-extern const upb_msglayout google_protobuf_BoolValue_msginit;
-extern const upb_msglayout google_protobuf_Duration_msginit;
-extern const upb_msglayout google_protobuf_Struct_msginit;
-extern const upb_msglayout google_protobuf_UInt32Value_msginit;
-
-typedef enum {
- envoy_config_core_v3_UNKNOWN = 0,
- envoy_config_core_v3_HEALTHY = 1,
- envoy_config_core_v3_UNHEALTHY = 2,
- envoy_config_core_v3_DRAINING = 3,
- envoy_config_core_v3_TIMEOUT = 4,
- envoy_config_core_v3_DEGRADED = 5
-} envoy_config_core_v3_HealthStatus;
-
-
-/* envoy.config.core.v3.HealthCheck */
-
-UPB_INLINE envoy_config_core_v3_HealthCheck *envoy_config_core_v3_HealthCheck_new(upb_arena *arena) {
- return (envoy_config_core_v3_HealthCheck *)_upb_msg_new(&envoy_config_core_v3_HealthCheck_msginit, arena);
-}
-UPB_INLINE envoy_config_core_v3_HealthCheck *envoy_config_core_v3_HealthCheck_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_core_v3_HealthCheck *ret = envoy_config_core_v3_HealthCheck_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_core_v3_HealthCheck_serialize(const envoy_config_core_v3_HealthCheck *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_core_v3_HealthCheck_msginit, arena, len);
-}
-
-typedef enum {
- envoy_config_core_v3_HealthCheck_health_checker_http_health_check = 8,
- envoy_config_core_v3_HealthCheck_health_checker_tcp_health_check = 9,
- envoy_config_core_v3_HealthCheck_health_checker_grpc_health_check = 11,
- envoy_config_core_v3_HealthCheck_health_checker_custom_health_check = 13,
- envoy_config_core_v3_HealthCheck_health_checker_NOT_SET = 0
-} envoy_config_core_v3_HealthCheck_health_checker_oneofcases;
-UPB_INLINE envoy_config_core_v3_HealthCheck_health_checker_oneofcases envoy_config_core_v3_HealthCheck_health_checker_case(const envoy_config_core_v3_HealthCheck* msg) { return (envoy_config_core_v3_HealthCheck_health_checker_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(80, 152), int32_t); }
-
-UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_timeout(const envoy_config_core_v3_HealthCheck *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 24)); }
-UPB_INLINE const struct google_protobuf_Duration* envoy_config_core_v3_HealthCheck_timeout(const envoy_config_core_v3_HealthCheck *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const struct google_protobuf_Duration*); }
-UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_interval(const envoy_config_core_v3_HealthCheck *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 32)); }
-UPB_INLINE const struct google_protobuf_Duration* envoy_config_core_v3_HealthCheck_interval(const envoy_config_core_v3_HealthCheck *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const struct google_protobuf_Duration*); }
-UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_interval_jitter(const envoy_config_core_v3_HealthCheck *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 40)); }
-UPB_INLINE const struct google_protobuf_Duration* envoy_config_core_v3_HealthCheck_interval_jitter(const envoy_config_core_v3_HealthCheck *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const struct google_protobuf_Duration*); }
-UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_unhealthy_threshold(const envoy_config_core_v3_HealthCheck *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 48)); }
-UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_core_v3_HealthCheck_unhealthy_threshold(const envoy_config_core_v3_HealthCheck *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 48), const struct google_protobuf_UInt32Value*); }
-UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_healthy_threshold(const envoy_config_core_v3_HealthCheck *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(32, 56)); }
-UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_core_v3_HealthCheck_healthy_threshold(const envoy_config_core_v3_HealthCheck *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 56), const struct google_protobuf_UInt32Value*); }
-UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_alt_port(const envoy_config_core_v3_HealthCheck *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(36, 64)); }
-UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_core_v3_HealthCheck_alt_port(const envoy_config_core_v3_HealthCheck *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(36, 64), const struct google_protobuf_UInt32Value*); }
-UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_reuse_connection(const envoy_config_core_v3_HealthCheck *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(40, 72)); }
-UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_core_v3_HealthCheck_reuse_connection(const envoy_config_core_v3_HealthCheck *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(40, 72), const struct google_protobuf_BoolValue*); }
-UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_http_health_check(const envoy_config_core_v3_HealthCheck *msg) { return _upb_getoneofcase(msg, UPB_SIZE(80, 152)) == 8; }
-UPB_INLINE const envoy_config_core_v3_HealthCheck_HttpHealthCheck* envoy_config_core_v3_HealthCheck_http_health_check(const envoy_config_core_v3_HealthCheck *msg) { return UPB_READ_ONEOF(msg, const envoy_config_core_v3_HealthCheck_HttpHealthCheck*, UPB_SIZE(76, 144), UPB_SIZE(80, 152), 8, NULL); }
-UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_tcp_health_check(const envoy_config_core_v3_HealthCheck *msg) { return _upb_getoneofcase(msg, UPB_SIZE(80, 152)) == 9; }
-UPB_INLINE const envoy_config_core_v3_HealthCheck_TcpHealthCheck* envoy_config_core_v3_HealthCheck_tcp_health_check(const envoy_config_core_v3_HealthCheck *msg) { return UPB_READ_ONEOF(msg, const envoy_config_core_v3_HealthCheck_TcpHealthCheck*, UPB_SIZE(76, 144), UPB_SIZE(80, 152), 9, NULL); }
-UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_grpc_health_check(const envoy_config_core_v3_HealthCheck *msg) { return _upb_getoneofcase(msg, UPB_SIZE(80, 152)) == 11; }
-UPB_INLINE const envoy_config_core_v3_HealthCheck_GrpcHealthCheck* envoy_config_core_v3_HealthCheck_grpc_health_check(const envoy_config_core_v3_HealthCheck *msg) { return UPB_READ_ONEOF(msg, const envoy_config_core_v3_HealthCheck_GrpcHealthCheck*, UPB_SIZE(76, 144), UPB_SIZE(80, 152), 11, NULL); }
-UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_no_traffic_interval(const envoy_config_core_v3_HealthCheck *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(44, 80)); }
-UPB_INLINE const struct google_protobuf_Duration* envoy_config_core_v3_HealthCheck_no_traffic_interval(const envoy_config_core_v3_HealthCheck *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(44, 80), const struct google_protobuf_Duration*); }
-UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_custom_health_check(const envoy_config_core_v3_HealthCheck *msg) { return _upb_getoneofcase(msg, UPB_SIZE(80, 152)) == 13; }
-UPB_INLINE const envoy_config_core_v3_HealthCheck_CustomHealthCheck* envoy_config_core_v3_HealthCheck_custom_health_check(const envoy_config_core_v3_HealthCheck *msg) { return UPB_READ_ONEOF(msg, const envoy_config_core_v3_HealthCheck_CustomHealthCheck*, UPB_SIZE(76, 144), UPB_SIZE(80, 152), 13, NULL); }
-UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_unhealthy_interval(const envoy_config_core_v3_HealthCheck *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(48, 88)); }
-UPB_INLINE const struct google_protobuf_Duration* envoy_config_core_v3_HealthCheck_unhealthy_interval(const envoy_config_core_v3_HealthCheck *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(48, 88), const struct google_protobuf_Duration*); }
-UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_unhealthy_edge_interval(const envoy_config_core_v3_HealthCheck *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(52, 96)); }
-UPB_INLINE const struct google_protobuf_Duration* envoy_config_core_v3_HealthCheck_unhealthy_edge_interval(const envoy_config_core_v3_HealthCheck *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(52, 96), const struct google_protobuf_Duration*); }
-UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_healthy_edge_interval(const envoy_config_core_v3_HealthCheck *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(56, 104)); }
-UPB_INLINE const struct google_protobuf_Duration* envoy_config_core_v3_HealthCheck_healthy_edge_interval(const envoy_config_core_v3_HealthCheck *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(56, 104), const struct google_protobuf_Duration*); }
-UPB_INLINE upb_strview envoy_config_core_v3_HealthCheck_event_log_path(const envoy_config_core_v3_HealthCheck *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview); }
-UPB_INLINE uint32_t envoy_config_core_v3_HealthCheck_interval_jitter_percent(const envoy_config_core_v3_HealthCheck *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t); }
-UPB_INLINE bool envoy_config_core_v3_HealthCheck_always_log_health_check_failures(const envoy_config_core_v3_HealthCheck *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool); }
-UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_initial_jitter(const envoy_config_core_v3_HealthCheck *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(60, 112)); }
-UPB_INLINE const struct google_protobuf_Duration* envoy_config_core_v3_HealthCheck_initial_jitter(const envoy_config_core_v3_HealthCheck *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(60, 112), const struct google_protobuf_Duration*); }
-UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_tls_options(const envoy_config_core_v3_HealthCheck *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(64, 120)); }
-UPB_INLINE const envoy_config_core_v3_HealthCheck_TlsOptions* envoy_config_core_v3_HealthCheck_tls_options(const envoy_config_core_v3_HealthCheck *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(64, 120), const envoy_config_core_v3_HealthCheck_TlsOptions*); }
-UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_event_service(const envoy_config_core_v3_HealthCheck *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(68, 128)); }
-UPB_INLINE const struct envoy_config_core_v3_EventServiceConfig* envoy_config_core_v3_HealthCheck_event_service(const envoy_config_core_v3_HealthCheck *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(68, 128), const struct envoy_config_core_v3_EventServiceConfig*); }
-UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_transport_socket_match_criteria(const envoy_config_core_v3_HealthCheck *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(72, 136)); }
-UPB_INLINE const struct google_protobuf_Struct* envoy_config_core_v3_HealthCheck_transport_socket_match_criteria(const envoy_config_core_v3_HealthCheck *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(72, 136), const struct google_protobuf_Struct*); }
-
-UPB_INLINE void envoy_config_core_v3_HealthCheck_set_timeout(envoy_config_core_v3_HealthCheck *msg, struct google_protobuf_Duration* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(16, 24), struct google_protobuf_Duration*) = value;
-}
-UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_HealthCheck_mutable_timeout(envoy_config_core_v3_HealthCheck *msg, upb_arena *arena) {
- struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_core_v3_HealthCheck_timeout(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_HealthCheck_set_timeout(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_core_v3_HealthCheck_set_interval(envoy_config_core_v3_HealthCheck *msg, struct google_protobuf_Duration* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(20, 32), struct google_protobuf_Duration*) = value;
-}
-UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_HealthCheck_mutable_interval(envoy_config_core_v3_HealthCheck *msg, upb_arena *arena) {
- struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_core_v3_HealthCheck_interval(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_HealthCheck_set_interval(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_core_v3_HealthCheck_set_interval_jitter(envoy_config_core_v3_HealthCheck *msg, struct google_protobuf_Duration* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(24, 40), struct google_protobuf_Duration*) = value;
-}
-UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_HealthCheck_mutable_interval_jitter(envoy_config_core_v3_HealthCheck *msg, upb_arena *arena) {
- struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_core_v3_HealthCheck_interval_jitter(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_HealthCheck_set_interval_jitter(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_core_v3_HealthCheck_set_unhealthy_threshold(envoy_config_core_v3_HealthCheck *msg, struct google_protobuf_UInt32Value* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(28, 48), struct google_protobuf_UInt32Value*) = value;
-}
-UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_HealthCheck_mutable_unhealthy_threshold(envoy_config_core_v3_HealthCheck *msg, upb_arena *arena) {
- struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_core_v3_HealthCheck_unhealthy_threshold(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_HealthCheck_set_unhealthy_threshold(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_core_v3_HealthCheck_set_healthy_threshold(envoy_config_core_v3_HealthCheck *msg, struct google_protobuf_UInt32Value* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(32, 56), struct google_protobuf_UInt32Value*) = value;
-}
-UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_HealthCheck_mutable_healthy_threshold(envoy_config_core_v3_HealthCheck *msg, upb_arena *arena) {
- struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_core_v3_HealthCheck_healthy_threshold(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_HealthCheck_set_healthy_threshold(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_core_v3_HealthCheck_set_alt_port(envoy_config_core_v3_HealthCheck *msg, struct google_protobuf_UInt32Value* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(36, 64), struct google_protobuf_UInt32Value*) = value;
-}
-UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_HealthCheck_mutable_alt_port(envoy_config_core_v3_HealthCheck *msg, upb_arena *arena) {
- struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_core_v3_HealthCheck_alt_port(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_HealthCheck_set_alt_port(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_core_v3_HealthCheck_set_reuse_connection(envoy_config_core_v3_HealthCheck *msg, struct google_protobuf_BoolValue* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(40, 72), struct google_protobuf_BoolValue*) = value;
-}
-UPB_INLINE struct google_protobuf_BoolValue* envoy_config_core_v3_HealthCheck_mutable_reuse_connection(envoy_config_core_v3_HealthCheck *msg, upb_arena *arena) {
- struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_core_v3_HealthCheck_reuse_connection(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_BoolValue*)_upb_msg_new(&google_protobuf_BoolValue_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_HealthCheck_set_reuse_connection(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_core_v3_HealthCheck_set_http_health_check(envoy_config_core_v3_HealthCheck *msg, envoy_config_core_v3_HealthCheck_HttpHealthCheck* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_core_v3_HealthCheck_HttpHealthCheck*, UPB_SIZE(76, 144), value, UPB_SIZE(80, 152), 8);
-}
-UPB_INLINE struct envoy_config_core_v3_HealthCheck_HttpHealthCheck* envoy_config_core_v3_HealthCheck_mutable_http_health_check(envoy_config_core_v3_HealthCheck *msg, upb_arena *arena) {
- struct envoy_config_core_v3_HealthCheck_HttpHealthCheck* sub = (struct envoy_config_core_v3_HealthCheck_HttpHealthCheck*)envoy_config_core_v3_HealthCheck_http_health_check(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_HealthCheck_HttpHealthCheck*)_upb_msg_new(&envoy_config_core_v3_HealthCheck_HttpHealthCheck_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_HealthCheck_set_http_health_check(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_core_v3_HealthCheck_set_tcp_health_check(envoy_config_core_v3_HealthCheck *msg, envoy_config_core_v3_HealthCheck_TcpHealthCheck* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_core_v3_HealthCheck_TcpHealthCheck*, UPB_SIZE(76, 144), value, UPB_SIZE(80, 152), 9);
-}
-UPB_INLINE struct envoy_config_core_v3_HealthCheck_TcpHealthCheck* envoy_config_core_v3_HealthCheck_mutable_tcp_health_check(envoy_config_core_v3_HealthCheck *msg, upb_arena *arena) {
- struct envoy_config_core_v3_HealthCheck_TcpHealthCheck* sub = (struct envoy_config_core_v3_HealthCheck_TcpHealthCheck*)envoy_config_core_v3_HealthCheck_tcp_health_check(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_HealthCheck_TcpHealthCheck*)_upb_msg_new(&envoy_config_core_v3_HealthCheck_TcpHealthCheck_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_HealthCheck_set_tcp_health_check(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_core_v3_HealthCheck_set_grpc_health_check(envoy_config_core_v3_HealthCheck *msg, envoy_config_core_v3_HealthCheck_GrpcHealthCheck* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_core_v3_HealthCheck_GrpcHealthCheck*, UPB_SIZE(76, 144), value, UPB_SIZE(80, 152), 11);
-}
-UPB_INLINE struct envoy_config_core_v3_HealthCheck_GrpcHealthCheck* envoy_config_core_v3_HealthCheck_mutable_grpc_health_check(envoy_config_core_v3_HealthCheck *msg, upb_arena *arena) {
- struct envoy_config_core_v3_HealthCheck_GrpcHealthCheck* sub = (struct envoy_config_core_v3_HealthCheck_GrpcHealthCheck*)envoy_config_core_v3_HealthCheck_grpc_health_check(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_HealthCheck_GrpcHealthCheck*)_upb_msg_new(&envoy_config_core_v3_HealthCheck_GrpcHealthCheck_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_HealthCheck_set_grpc_health_check(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_core_v3_HealthCheck_set_no_traffic_interval(envoy_config_core_v3_HealthCheck *msg, struct google_protobuf_Duration* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(44, 80), struct google_protobuf_Duration*) = value;
-}
-UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_HealthCheck_mutable_no_traffic_interval(envoy_config_core_v3_HealthCheck *msg, upb_arena *arena) {
- struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_core_v3_HealthCheck_no_traffic_interval(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_HealthCheck_set_no_traffic_interval(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_core_v3_HealthCheck_set_custom_health_check(envoy_config_core_v3_HealthCheck *msg, envoy_config_core_v3_HealthCheck_CustomHealthCheck* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_core_v3_HealthCheck_CustomHealthCheck*, UPB_SIZE(76, 144), value, UPB_SIZE(80, 152), 13);
-}
-UPB_INLINE struct envoy_config_core_v3_HealthCheck_CustomHealthCheck* envoy_config_core_v3_HealthCheck_mutable_custom_health_check(envoy_config_core_v3_HealthCheck *msg, upb_arena *arena) {
- struct envoy_config_core_v3_HealthCheck_CustomHealthCheck* sub = (struct envoy_config_core_v3_HealthCheck_CustomHealthCheck*)envoy_config_core_v3_HealthCheck_custom_health_check(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_HealthCheck_CustomHealthCheck*)_upb_msg_new(&envoy_config_core_v3_HealthCheck_CustomHealthCheck_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_HealthCheck_set_custom_health_check(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_core_v3_HealthCheck_set_unhealthy_interval(envoy_config_core_v3_HealthCheck *msg, struct google_protobuf_Duration* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(48, 88), struct google_protobuf_Duration*) = value;
-}
-UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_HealthCheck_mutable_unhealthy_interval(envoy_config_core_v3_HealthCheck *msg, upb_arena *arena) {
- struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_core_v3_HealthCheck_unhealthy_interval(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_HealthCheck_set_unhealthy_interval(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_core_v3_HealthCheck_set_unhealthy_edge_interval(envoy_config_core_v3_HealthCheck *msg, struct google_protobuf_Duration* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(52, 96), struct google_protobuf_Duration*) = value;
-}
-UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_HealthCheck_mutable_unhealthy_edge_interval(envoy_config_core_v3_HealthCheck *msg, upb_arena *arena) {
- struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_core_v3_HealthCheck_unhealthy_edge_interval(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_HealthCheck_set_unhealthy_edge_interval(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_core_v3_HealthCheck_set_healthy_edge_interval(envoy_config_core_v3_HealthCheck *msg, struct google_protobuf_Duration* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(56, 104), struct google_protobuf_Duration*) = value;
-}
-UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_HealthCheck_mutable_healthy_edge_interval(envoy_config_core_v3_HealthCheck *msg, upb_arena *arena) {
- struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_core_v3_HealthCheck_healthy_edge_interval(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_HealthCheck_set_healthy_edge_interval(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_core_v3_HealthCheck_set_event_log_path(envoy_config_core_v3_HealthCheck *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_core_v3_HealthCheck_set_interval_jitter_percent(envoy_config_core_v3_HealthCheck *msg, uint32_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t) = value;
-}
-UPB_INLINE void envoy_config_core_v3_HealthCheck_set_always_log_health_check_failures(envoy_config_core_v3_HealthCheck *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool) = value;
-}
-UPB_INLINE void envoy_config_core_v3_HealthCheck_set_initial_jitter(envoy_config_core_v3_HealthCheck *msg, struct google_protobuf_Duration* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(60, 112), struct google_protobuf_Duration*) = value;
-}
-UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_HealthCheck_mutable_initial_jitter(envoy_config_core_v3_HealthCheck *msg, upb_arena *arena) {
- struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_core_v3_HealthCheck_initial_jitter(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_HealthCheck_set_initial_jitter(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_core_v3_HealthCheck_set_tls_options(envoy_config_core_v3_HealthCheck *msg, envoy_config_core_v3_HealthCheck_TlsOptions* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(64, 120), envoy_config_core_v3_HealthCheck_TlsOptions*) = value;
-}
-UPB_INLINE struct envoy_config_core_v3_HealthCheck_TlsOptions* envoy_config_core_v3_HealthCheck_mutable_tls_options(envoy_config_core_v3_HealthCheck *msg, upb_arena *arena) {
- struct envoy_config_core_v3_HealthCheck_TlsOptions* sub = (struct envoy_config_core_v3_HealthCheck_TlsOptions*)envoy_config_core_v3_HealthCheck_tls_options(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_HealthCheck_TlsOptions*)_upb_msg_new(&envoy_config_core_v3_HealthCheck_TlsOptions_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_HealthCheck_set_tls_options(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_core_v3_HealthCheck_set_event_service(envoy_config_core_v3_HealthCheck *msg, struct envoy_config_core_v3_EventServiceConfig* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(68, 128), struct envoy_config_core_v3_EventServiceConfig*) = value;
-}
-UPB_INLINE struct envoy_config_core_v3_EventServiceConfig* envoy_config_core_v3_HealthCheck_mutable_event_service(envoy_config_core_v3_HealthCheck *msg, upb_arena *arena) {
- struct envoy_config_core_v3_EventServiceConfig* sub = (struct envoy_config_core_v3_EventServiceConfig*)envoy_config_core_v3_HealthCheck_event_service(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_EventServiceConfig*)_upb_msg_new(&envoy_config_core_v3_EventServiceConfig_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_HealthCheck_set_event_service(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_core_v3_HealthCheck_set_transport_socket_match_criteria(envoy_config_core_v3_HealthCheck *msg, struct google_protobuf_Struct* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(72, 136), struct google_protobuf_Struct*) = value;
-}
-UPB_INLINE struct google_protobuf_Struct* envoy_config_core_v3_HealthCheck_mutable_transport_socket_match_criteria(envoy_config_core_v3_HealthCheck *msg, upb_arena *arena) {
- struct google_protobuf_Struct* sub = (struct google_protobuf_Struct*)envoy_config_core_v3_HealthCheck_transport_socket_match_criteria(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Struct*)_upb_msg_new(&google_protobuf_Struct_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_HealthCheck_set_transport_socket_match_criteria(msg, sub);
- }
- return sub;
-}
-
-/* envoy.config.core.v3.HealthCheck.Payload */
-
-UPB_INLINE envoy_config_core_v3_HealthCheck_Payload *envoy_config_core_v3_HealthCheck_Payload_new(upb_arena *arena) {
- return (envoy_config_core_v3_HealthCheck_Payload *)_upb_msg_new(&envoy_config_core_v3_HealthCheck_Payload_msginit, arena);
-}
-UPB_INLINE envoy_config_core_v3_HealthCheck_Payload *envoy_config_core_v3_HealthCheck_Payload_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_core_v3_HealthCheck_Payload *ret = envoy_config_core_v3_HealthCheck_Payload_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_Payload_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_core_v3_HealthCheck_Payload_serialize(const envoy_config_core_v3_HealthCheck_Payload *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_core_v3_HealthCheck_Payload_msginit, arena, len);
-}
-
-typedef enum {
- envoy_config_core_v3_HealthCheck_Payload_payload_text = 1,
- envoy_config_core_v3_HealthCheck_Payload_payload_binary = 2,
- envoy_config_core_v3_HealthCheck_Payload_payload_NOT_SET = 0
-} envoy_config_core_v3_HealthCheck_Payload_payload_oneofcases;
-UPB_INLINE envoy_config_core_v3_HealthCheck_Payload_payload_oneofcases envoy_config_core_v3_HealthCheck_Payload_payload_case(const envoy_config_core_v3_HealthCheck_Payload* msg) { return (envoy_config_core_v3_HealthCheck_Payload_payload_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(8, 16), int32_t); }
-
-UPB_INLINE bool envoy_config_core_v3_HealthCheck_Payload_has_text(const envoy_config_core_v3_HealthCheck_Payload *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 1; }
-UPB_INLINE upb_strview envoy_config_core_v3_HealthCheck_Payload_text(const envoy_config_core_v3_HealthCheck_Payload *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 1, upb_strview_make("", strlen(""))); }
-UPB_INLINE bool envoy_config_core_v3_HealthCheck_Payload_has_binary(const envoy_config_core_v3_HealthCheck_Payload *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 2; }
-UPB_INLINE upb_strview envoy_config_core_v3_HealthCheck_Payload_binary(const envoy_config_core_v3_HealthCheck_Payload *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 2, upb_strview_make("", strlen(""))); }
-
-UPB_INLINE void envoy_config_core_v3_HealthCheck_Payload_set_text(envoy_config_core_v3_HealthCheck_Payload *msg, upb_strview value) {
- UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 1);
-}
-UPB_INLINE void envoy_config_core_v3_HealthCheck_Payload_set_binary(envoy_config_core_v3_HealthCheck_Payload *msg, upb_strview value) {
- UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 2);
-}
-
-/* envoy.config.core.v3.HealthCheck.HttpHealthCheck */
-
-UPB_INLINE envoy_config_core_v3_HealthCheck_HttpHealthCheck *envoy_config_core_v3_HealthCheck_HttpHealthCheck_new(upb_arena *arena) {
- return (envoy_config_core_v3_HealthCheck_HttpHealthCheck *)_upb_msg_new(&envoy_config_core_v3_HealthCheck_HttpHealthCheck_msginit, arena);
-}
-UPB_INLINE envoy_config_core_v3_HealthCheck_HttpHealthCheck *envoy_config_core_v3_HealthCheck_HttpHealthCheck_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_core_v3_HealthCheck_HttpHealthCheck *ret = envoy_config_core_v3_HealthCheck_HttpHealthCheck_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_HttpHealthCheck_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_core_v3_HealthCheck_HttpHealthCheck_serialize(const envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_core_v3_HealthCheck_HttpHealthCheck_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview envoy_config_core_v3_HealthCheck_HttpHealthCheck_host(const envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview); }
-UPB_INLINE upb_strview envoy_config_core_v3_HealthCheck_HttpHealthCheck_path(const envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_strview); }
-UPB_INLINE bool envoy_config_core_v3_HealthCheck_HttpHealthCheck_has_send(const envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 40)); }
-UPB_INLINE const envoy_config_core_v3_HealthCheck_Payload* envoy_config_core_v3_HealthCheck_HttpHealthCheck_send(const envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const envoy_config_core_v3_HealthCheck_Payload*); }
-UPB_INLINE bool envoy_config_core_v3_HealthCheck_HttpHealthCheck_has_receive(const envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 48)); }
-UPB_INLINE const envoy_config_core_v3_HealthCheck_Payload* envoy_config_core_v3_HealthCheck_HttpHealthCheck_receive(const envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 48), const envoy_config_core_v3_HealthCheck_Payload*); }
-UPB_INLINE bool envoy_config_core_v3_HealthCheck_HttpHealthCheck_has_request_headers_to_add(const envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(36, 64)); }
-UPB_INLINE const struct envoy_config_core_v3_HeaderValueOption* const* envoy_config_core_v3_HealthCheck_HttpHealthCheck_request_headers_to_add(const envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg, size_t *len) { return (const struct envoy_config_core_v3_HeaderValueOption* const*)_upb_array_accessor(msg, UPB_SIZE(36, 64), len); }
-UPB_INLINE upb_strview const* envoy_config_core_v3_HealthCheck_HttpHealthCheck_request_headers_to_remove(const envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(40, 72), len); }
-UPB_INLINE bool envoy_config_core_v3_HealthCheck_HttpHealthCheck_has_expected_statuses(const envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(44, 80)); }
-UPB_INLINE const struct envoy_type_v3_Int64Range* const* envoy_config_core_v3_HealthCheck_HttpHealthCheck_expected_statuses(const envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg, size_t *len) { return (const struct envoy_type_v3_Int64Range* const*)_upb_array_accessor(msg, UPB_SIZE(44, 80), len); }
-UPB_INLINE int32_t envoy_config_core_v3_HealthCheck_HttpHealthCheck_codec_client_type(const envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
-UPB_INLINE bool envoy_config_core_v3_HealthCheck_HttpHealthCheck_has_service_name_matcher(const envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(32, 56)); }
-UPB_INLINE const struct envoy_type_matcher_v3_StringMatcher* envoy_config_core_v3_HealthCheck_HttpHealthCheck_service_name_matcher(const envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 56), const struct envoy_type_matcher_v3_StringMatcher*); }
-
-UPB_INLINE void envoy_config_core_v3_HealthCheck_HttpHealthCheck_set_host(envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_core_v3_HealthCheck_HttpHealthCheck_set_path(envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_core_v3_HealthCheck_HttpHealthCheck_set_send(envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg, envoy_config_core_v3_HealthCheck_Payload* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(24, 40), envoy_config_core_v3_HealthCheck_Payload*) = value;
-}
-UPB_INLINE struct envoy_config_core_v3_HealthCheck_Payload* envoy_config_core_v3_HealthCheck_HttpHealthCheck_mutable_send(envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg, upb_arena *arena) {
- struct envoy_config_core_v3_HealthCheck_Payload* sub = (struct envoy_config_core_v3_HealthCheck_Payload*)envoy_config_core_v3_HealthCheck_HttpHealthCheck_send(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_HealthCheck_Payload*)_upb_msg_new(&envoy_config_core_v3_HealthCheck_Payload_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_HealthCheck_HttpHealthCheck_set_send(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_core_v3_HealthCheck_HttpHealthCheck_set_receive(envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg, envoy_config_core_v3_HealthCheck_Payload* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(28, 48), envoy_config_core_v3_HealthCheck_Payload*) = value;
-}
-UPB_INLINE struct envoy_config_core_v3_HealthCheck_Payload* envoy_config_core_v3_HealthCheck_HttpHealthCheck_mutable_receive(envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg, upb_arena *arena) {
- struct envoy_config_core_v3_HealthCheck_Payload* sub = (struct envoy_config_core_v3_HealthCheck_Payload*)envoy_config_core_v3_HealthCheck_HttpHealthCheck_receive(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_HealthCheck_Payload*)_upb_msg_new(&envoy_config_core_v3_HealthCheck_Payload_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_HealthCheck_HttpHealthCheck_set_receive(msg, sub);
- }
- return sub;
-}
-UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_config_core_v3_HealthCheck_HttpHealthCheck_mutable_request_headers_to_add(envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg, size_t *len) {
- return (struct envoy_config_core_v3_HeaderValueOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(36, 64), len);
-}
-UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_config_core_v3_HealthCheck_HttpHealthCheck_resize_request_headers_to_add(envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg, size_t len, upb_arena *arena) {
- return (struct envoy_config_core_v3_HeaderValueOption**)_upb_array_resize_accessor(msg, UPB_SIZE(36, 64), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_config_core_v3_HeaderValueOption* envoy_config_core_v3_HealthCheck_HttpHealthCheck_add_request_headers_to_add(envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg, upb_arena *arena) {
- struct envoy_config_core_v3_HeaderValueOption* sub = (struct envoy_config_core_v3_HeaderValueOption*)_upb_msg_new(&envoy_config_core_v3_HeaderValueOption_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(36, 64), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-UPB_INLINE upb_strview* envoy_config_core_v3_HealthCheck_HttpHealthCheck_mutable_request_headers_to_remove(envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg, size_t *len) {
- return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(40, 72), len);
-}
-UPB_INLINE upb_strview* envoy_config_core_v3_HealthCheck_HttpHealthCheck_resize_request_headers_to_remove(envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg, size_t len, upb_arena *arena) {
- return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(40, 72), len, UPB_TYPE_STRING, arena);
-}
-UPB_INLINE bool envoy_config_core_v3_HealthCheck_HttpHealthCheck_add_request_headers_to_remove(envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg, upb_strview val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(40, 72), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
- arena);
-}
-UPB_INLINE struct envoy_type_v3_Int64Range** envoy_config_core_v3_HealthCheck_HttpHealthCheck_mutable_expected_statuses(envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg, size_t *len) {
- return (struct envoy_type_v3_Int64Range**)_upb_array_mutable_accessor(msg, UPB_SIZE(44, 80), len);
-}
-UPB_INLINE struct envoy_type_v3_Int64Range** envoy_config_core_v3_HealthCheck_HttpHealthCheck_resize_expected_statuses(envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg, size_t len, upb_arena *arena) {
- return (struct envoy_type_v3_Int64Range**)_upb_array_resize_accessor(msg, UPB_SIZE(44, 80), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_type_v3_Int64Range* envoy_config_core_v3_HealthCheck_HttpHealthCheck_add_expected_statuses(envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg, upb_arena *arena) {
- struct envoy_type_v3_Int64Range* sub = (struct envoy_type_v3_Int64Range*)_upb_msg_new(&envoy_type_v3_Int64Range_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(44, 80), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-UPB_INLINE void envoy_config_core_v3_HealthCheck_HttpHealthCheck_set_codec_client_type(envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg, int32_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
-}
-UPB_INLINE void envoy_config_core_v3_HealthCheck_HttpHealthCheck_set_service_name_matcher(envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg, struct envoy_type_matcher_v3_StringMatcher* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(32, 56), struct envoy_type_matcher_v3_StringMatcher*) = value;
-}
-UPB_INLINE struct envoy_type_matcher_v3_StringMatcher* envoy_config_core_v3_HealthCheck_HttpHealthCheck_mutable_service_name_matcher(envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg, upb_arena *arena) {
- struct envoy_type_matcher_v3_StringMatcher* sub = (struct envoy_type_matcher_v3_StringMatcher*)envoy_config_core_v3_HealthCheck_HttpHealthCheck_service_name_matcher(msg);
- if (sub == NULL) {
- sub = (struct envoy_type_matcher_v3_StringMatcher*)_upb_msg_new(&envoy_type_matcher_v3_StringMatcher_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_HealthCheck_HttpHealthCheck_set_service_name_matcher(msg, sub);
- }
- return sub;
-}
-
-/* envoy.config.core.v3.HealthCheck.TcpHealthCheck */
-
-UPB_INLINE envoy_config_core_v3_HealthCheck_TcpHealthCheck *envoy_config_core_v3_HealthCheck_TcpHealthCheck_new(upb_arena *arena) {
- return (envoy_config_core_v3_HealthCheck_TcpHealthCheck *)_upb_msg_new(&envoy_config_core_v3_HealthCheck_TcpHealthCheck_msginit, arena);
-}
-UPB_INLINE envoy_config_core_v3_HealthCheck_TcpHealthCheck *envoy_config_core_v3_HealthCheck_TcpHealthCheck_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_core_v3_HealthCheck_TcpHealthCheck *ret = envoy_config_core_v3_HealthCheck_TcpHealthCheck_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_TcpHealthCheck_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_core_v3_HealthCheck_TcpHealthCheck_serialize(const envoy_config_core_v3_HealthCheck_TcpHealthCheck *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_core_v3_HealthCheck_TcpHealthCheck_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_config_core_v3_HealthCheck_TcpHealthCheck_has_send(const envoy_config_core_v3_HealthCheck_TcpHealthCheck *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE const envoy_config_core_v3_HealthCheck_Payload* envoy_config_core_v3_HealthCheck_TcpHealthCheck_send(const envoy_config_core_v3_HealthCheck_TcpHealthCheck *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const envoy_config_core_v3_HealthCheck_Payload*); }
-UPB_INLINE bool envoy_config_core_v3_HealthCheck_TcpHealthCheck_has_receive(const envoy_config_core_v3_HealthCheck_TcpHealthCheck *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
-UPB_INLINE const envoy_config_core_v3_HealthCheck_Payload* const* envoy_config_core_v3_HealthCheck_TcpHealthCheck_receive(const envoy_config_core_v3_HealthCheck_TcpHealthCheck *msg, size_t *len) { return (const envoy_config_core_v3_HealthCheck_Payload* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len); }
-
-UPB_INLINE void envoy_config_core_v3_HealthCheck_TcpHealthCheck_set_send(envoy_config_core_v3_HealthCheck_TcpHealthCheck *msg, envoy_config_core_v3_HealthCheck_Payload* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), envoy_config_core_v3_HealthCheck_Payload*) = value;
-}
-UPB_INLINE struct envoy_config_core_v3_HealthCheck_Payload* envoy_config_core_v3_HealthCheck_TcpHealthCheck_mutable_send(envoy_config_core_v3_HealthCheck_TcpHealthCheck *msg, upb_arena *arena) {
- struct envoy_config_core_v3_HealthCheck_Payload* sub = (struct envoy_config_core_v3_HealthCheck_Payload*)envoy_config_core_v3_HealthCheck_TcpHealthCheck_send(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_HealthCheck_Payload*)_upb_msg_new(&envoy_config_core_v3_HealthCheck_Payload_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_HealthCheck_TcpHealthCheck_set_send(msg, sub);
- }
- return sub;
-}
-UPB_INLINE envoy_config_core_v3_HealthCheck_Payload** envoy_config_core_v3_HealthCheck_TcpHealthCheck_mutable_receive(envoy_config_core_v3_HealthCheck_TcpHealthCheck *msg, size_t *len) {
- return (envoy_config_core_v3_HealthCheck_Payload**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len);
-}
-UPB_INLINE envoy_config_core_v3_HealthCheck_Payload** envoy_config_core_v3_HealthCheck_TcpHealthCheck_resize_receive(envoy_config_core_v3_HealthCheck_TcpHealthCheck *msg, size_t len, upb_arena *arena) {
- return (envoy_config_core_v3_HealthCheck_Payload**)_upb_array_resize_accessor(msg, UPB_SIZE(4, 8), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_config_core_v3_HealthCheck_Payload* envoy_config_core_v3_HealthCheck_TcpHealthCheck_add_receive(envoy_config_core_v3_HealthCheck_TcpHealthCheck *msg, upb_arena *arena) {
- struct envoy_config_core_v3_HealthCheck_Payload* sub = (struct envoy_config_core_v3_HealthCheck_Payload*)_upb_msg_new(&envoy_config_core_v3_HealthCheck_Payload_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(4, 8), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-
-/* envoy.config.core.v3.HealthCheck.RedisHealthCheck */
-
-UPB_INLINE envoy_config_core_v3_HealthCheck_RedisHealthCheck *envoy_config_core_v3_HealthCheck_RedisHealthCheck_new(upb_arena *arena) {
- return (envoy_config_core_v3_HealthCheck_RedisHealthCheck *)_upb_msg_new(&envoy_config_core_v3_HealthCheck_RedisHealthCheck_msginit, arena);
-}
-UPB_INLINE envoy_config_core_v3_HealthCheck_RedisHealthCheck *envoy_config_core_v3_HealthCheck_RedisHealthCheck_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_core_v3_HealthCheck_RedisHealthCheck *ret = envoy_config_core_v3_HealthCheck_RedisHealthCheck_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_RedisHealthCheck_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_core_v3_HealthCheck_RedisHealthCheck_serialize(const envoy_config_core_v3_HealthCheck_RedisHealthCheck *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_core_v3_HealthCheck_RedisHealthCheck_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview envoy_config_core_v3_HealthCheck_RedisHealthCheck_key(const envoy_config_core_v3_HealthCheck_RedisHealthCheck *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-
-UPB_INLINE void envoy_config_core_v3_HealthCheck_RedisHealthCheck_set_key(envoy_config_core_v3_HealthCheck_RedisHealthCheck *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-
-/* envoy.config.core.v3.HealthCheck.GrpcHealthCheck */
-
-UPB_INLINE envoy_config_core_v3_HealthCheck_GrpcHealthCheck *envoy_config_core_v3_HealthCheck_GrpcHealthCheck_new(upb_arena *arena) {
- return (envoy_config_core_v3_HealthCheck_GrpcHealthCheck *)_upb_msg_new(&envoy_config_core_v3_HealthCheck_GrpcHealthCheck_msginit, arena);
-}
-UPB_INLINE envoy_config_core_v3_HealthCheck_GrpcHealthCheck *envoy_config_core_v3_HealthCheck_GrpcHealthCheck_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_core_v3_HealthCheck_GrpcHealthCheck *ret = envoy_config_core_v3_HealthCheck_GrpcHealthCheck_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_GrpcHealthCheck_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_core_v3_HealthCheck_GrpcHealthCheck_serialize(const envoy_config_core_v3_HealthCheck_GrpcHealthCheck *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_core_v3_HealthCheck_GrpcHealthCheck_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview envoy_config_core_v3_HealthCheck_GrpcHealthCheck_service_name(const envoy_config_core_v3_HealthCheck_GrpcHealthCheck *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE upb_strview envoy_config_core_v3_HealthCheck_GrpcHealthCheck_authority(const envoy_config_core_v3_HealthCheck_GrpcHealthCheck *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview); }
-
-UPB_INLINE void envoy_config_core_v3_HealthCheck_GrpcHealthCheck_set_service_name(envoy_config_core_v3_HealthCheck_GrpcHealthCheck *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_core_v3_HealthCheck_GrpcHealthCheck_set_authority(envoy_config_core_v3_HealthCheck_GrpcHealthCheck *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview) = value;
-}
-
-/* envoy.config.core.v3.HealthCheck.CustomHealthCheck */
-
-UPB_INLINE envoy_config_core_v3_HealthCheck_CustomHealthCheck *envoy_config_core_v3_HealthCheck_CustomHealthCheck_new(upb_arena *arena) {
- return (envoy_config_core_v3_HealthCheck_CustomHealthCheck *)_upb_msg_new(&envoy_config_core_v3_HealthCheck_CustomHealthCheck_msginit, arena);
-}
-UPB_INLINE envoy_config_core_v3_HealthCheck_CustomHealthCheck *envoy_config_core_v3_HealthCheck_CustomHealthCheck_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_core_v3_HealthCheck_CustomHealthCheck *ret = envoy_config_core_v3_HealthCheck_CustomHealthCheck_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_CustomHealthCheck_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_core_v3_HealthCheck_CustomHealthCheck_serialize(const envoy_config_core_v3_HealthCheck_CustomHealthCheck *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_core_v3_HealthCheck_CustomHealthCheck_msginit, arena, len);
-}
-
-typedef enum {
- envoy_config_core_v3_HealthCheck_CustomHealthCheck_config_type_typed_config = 3,
- envoy_config_core_v3_HealthCheck_CustomHealthCheck_config_type_NOT_SET = 0
-} envoy_config_core_v3_HealthCheck_CustomHealthCheck_config_type_oneofcases;
-UPB_INLINE envoy_config_core_v3_HealthCheck_CustomHealthCheck_config_type_oneofcases envoy_config_core_v3_HealthCheck_CustomHealthCheck_config_type_case(const envoy_config_core_v3_HealthCheck_CustomHealthCheck* msg) { return (envoy_config_core_v3_HealthCheck_CustomHealthCheck_config_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(12, 24), int32_t); }
-
-UPB_INLINE upb_strview envoy_config_core_v3_HealthCheck_CustomHealthCheck_name(const envoy_config_core_v3_HealthCheck_CustomHealthCheck *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE bool envoy_config_core_v3_HealthCheck_CustomHealthCheck_has_typed_config(const envoy_config_core_v3_HealthCheck_CustomHealthCheck *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 3; }
-UPB_INLINE const struct google_protobuf_Any* envoy_config_core_v3_HealthCheck_CustomHealthCheck_typed_config(const envoy_config_core_v3_HealthCheck_CustomHealthCheck *msg) { return UPB_READ_ONEOF(msg, const struct google_protobuf_Any*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 3, NULL); }
-
-UPB_INLINE void envoy_config_core_v3_HealthCheck_CustomHealthCheck_set_name(envoy_config_core_v3_HealthCheck_CustomHealthCheck *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_core_v3_HealthCheck_CustomHealthCheck_set_typed_config(envoy_config_core_v3_HealthCheck_CustomHealthCheck *msg, struct google_protobuf_Any* value) {
- UPB_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 3);
-}
-UPB_INLINE struct google_protobuf_Any* envoy_config_core_v3_HealthCheck_CustomHealthCheck_mutable_typed_config(envoy_config_core_v3_HealthCheck_CustomHealthCheck *msg, upb_arena *arena) {
- struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_config_core_v3_HealthCheck_CustomHealthCheck_typed_config(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_HealthCheck_CustomHealthCheck_set_typed_config(msg, sub);
- }
- return sub;
-}
-
-/* envoy.config.core.v3.HealthCheck.TlsOptions */
-
-UPB_INLINE envoy_config_core_v3_HealthCheck_TlsOptions *envoy_config_core_v3_HealthCheck_TlsOptions_new(upb_arena *arena) {
- return (envoy_config_core_v3_HealthCheck_TlsOptions *)_upb_msg_new(&envoy_config_core_v3_HealthCheck_TlsOptions_msginit, arena);
-}
-UPB_INLINE envoy_config_core_v3_HealthCheck_TlsOptions *envoy_config_core_v3_HealthCheck_TlsOptions_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_core_v3_HealthCheck_TlsOptions *ret = envoy_config_core_v3_HealthCheck_TlsOptions_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_TlsOptions_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_core_v3_HealthCheck_TlsOptions_serialize(const envoy_config_core_v3_HealthCheck_TlsOptions *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_core_v3_HealthCheck_TlsOptions_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview const* envoy_config_core_v3_HealthCheck_TlsOptions_alpn_protocols(const envoy_config_core_v3_HealthCheck_TlsOptions *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
-
-UPB_INLINE upb_strview* envoy_config_core_v3_HealthCheck_TlsOptions_mutable_alpn_protocols(envoy_config_core_v3_HealthCheck_TlsOptions *msg, size_t *len) {
- return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
-}
-UPB_INLINE upb_strview* envoy_config_core_v3_HealthCheck_TlsOptions_resize_alpn_protocols(envoy_config_core_v3_HealthCheck_TlsOptions *msg, size_t len, upb_arena *arena) {
- return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(0, 0), len, UPB_TYPE_STRING, arena);
-}
-UPB_INLINE bool envoy_config_core_v3_HealthCheck_TlsOptions_add_alpn_protocols(envoy_config_core_v3_HealthCheck_TlsOptions *msg, upb_strview val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(0, 0), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
- arena);
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* ENVOY_CONFIG_CORE_V3_HEALTH_CHECK_PROTO_UPB_H_ */
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/core/v3/health_check.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_CONFIG_CORE_V3_HEALTH_CHECK_PROTO_UPB_H_
+#define ENVOY_CONFIG_CORE_V3_HEALTH_CHECK_PROTO_UPB_H_
+
+#include "upb/msg.h"
+#include "upb/decode.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_config_core_v3_HealthCheck;
+struct envoy_config_core_v3_HealthCheck_Payload;
+struct envoy_config_core_v3_HealthCheck_HttpHealthCheck;
+struct envoy_config_core_v3_HealthCheck_TcpHealthCheck;
+struct envoy_config_core_v3_HealthCheck_RedisHealthCheck;
+struct envoy_config_core_v3_HealthCheck_GrpcHealthCheck;
+struct envoy_config_core_v3_HealthCheck_CustomHealthCheck;
+struct envoy_config_core_v3_HealthCheck_TlsOptions;
+typedef struct envoy_config_core_v3_HealthCheck envoy_config_core_v3_HealthCheck;
+typedef struct envoy_config_core_v3_HealthCheck_Payload envoy_config_core_v3_HealthCheck_Payload;
+typedef struct envoy_config_core_v3_HealthCheck_HttpHealthCheck envoy_config_core_v3_HealthCheck_HttpHealthCheck;
+typedef struct envoy_config_core_v3_HealthCheck_TcpHealthCheck envoy_config_core_v3_HealthCheck_TcpHealthCheck;
+typedef struct envoy_config_core_v3_HealthCheck_RedisHealthCheck envoy_config_core_v3_HealthCheck_RedisHealthCheck;
+typedef struct envoy_config_core_v3_HealthCheck_GrpcHealthCheck envoy_config_core_v3_HealthCheck_GrpcHealthCheck;
+typedef struct envoy_config_core_v3_HealthCheck_CustomHealthCheck envoy_config_core_v3_HealthCheck_CustomHealthCheck;
+typedef struct envoy_config_core_v3_HealthCheck_TlsOptions envoy_config_core_v3_HealthCheck_TlsOptions;
+extern const upb_msglayout envoy_config_core_v3_HealthCheck_msginit;
+extern const upb_msglayout envoy_config_core_v3_HealthCheck_Payload_msginit;
+extern const upb_msglayout envoy_config_core_v3_HealthCheck_HttpHealthCheck_msginit;
+extern const upb_msglayout envoy_config_core_v3_HealthCheck_TcpHealthCheck_msginit;
+extern const upb_msglayout envoy_config_core_v3_HealthCheck_RedisHealthCheck_msginit;
+extern const upb_msglayout envoy_config_core_v3_HealthCheck_GrpcHealthCheck_msginit;
+extern const upb_msglayout envoy_config_core_v3_HealthCheck_CustomHealthCheck_msginit;
+extern const upb_msglayout envoy_config_core_v3_HealthCheck_TlsOptions_msginit;
+struct envoy_config_core_v3_EventServiceConfig;
+struct envoy_config_core_v3_HeaderValueOption;
+struct envoy_type_matcher_v3_StringMatcher;
+struct envoy_type_v3_Int64Range;
+struct google_protobuf_Any;
+struct google_protobuf_BoolValue;
+struct google_protobuf_Duration;
+struct google_protobuf_Struct;
+struct google_protobuf_UInt32Value;
+extern const upb_msglayout envoy_config_core_v3_EventServiceConfig_msginit;
+extern const upb_msglayout envoy_config_core_v3_HeaderValueOption_msginit;
+extern const upb_msglayout envoy_type_matcher_v3_StringMatcher_msginit;
+extern const upb_msglayout envoy_type_v3_Int64Range_msginit;
+extern const upb_msglayout google_protobuf_Any_msginit;
+extern const upb_msglayout google_protobuf_BoolValue_msginit;
+extern const upb_msglayout google_protobuf_Duration_msginit;
+extern const upb_msglayout google_protobuf_Struct_msginit;
+extern const upb_msglayout google_protobuf_UInt32Value_msginit;
+
+typedef enum {
+ envoy_config_core_v3_UNKNOWN = 0,
+ envoy_config_core_v3_HEALTHY = 1,
+ envoy_config_core_v3_UNHEALTHY = 2,
+ envoy_config_core_v3_DRAINING = 3,
+ envoy_config_core_v3_TIMEOUT = 4,
+ envoy_config_core_v3_DEGRADED = 5
+} envoy_config_core_v3_HealthStatus;
+
+
+/* envoy.config.core.v3.HealthCheck */
+
+UPB_INLINE envoy_config_core_v3_HealthCheck *envoy_config_core_v3_HealthCheck_new(upb_arena *arena) {
+ return (envoy_config_core_v3_HealthCheck *)_upb_msg_new(&envoy_config_core_v3_HealthCheck_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_HealthCheck *envoy_config_core_v3_HealthCheck_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_core_v3_HealthCheck *ret = envoy_config_core_v3_HealthCheck_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_core_v3_HealthCheck_serialize(const envoy_config_core_v3_HealthCheck *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_core_v3_HealthCheck_msginit, arena, len);
+}
+
+typedef enum {
+ envoy_config_core_v3_HealthCheck_health_checker_http_health_check = 8,
+ envoy_config_core_v3_HealthCheck_health_checker_tcp_health_check = 9,
+ envoy_config_core_v3_HealthCheck_health_checker_grpc_health_check = 11,
+ envoy_config_core_v3_HealthCheck_health_checker_custom_health_check = 13,
+ envoy_config_core_v3_HealthCheck_health_checker_NOT_SET = 0
+} envoy_config_core_v3_HealthCheck_health_checker_oneofcases;
+UPB_INLINE envoy_config_core_v3_HealthCheck_health_checker_oneofcases envoy_config_core_v3_HealthCheck_health_checker_case(const envoy_config_core_v3_HealthCheck* msg) { return (envoy_config_core_v3_HealthCheck_health_checker_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(80, 152), int32_t); }
+
+UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_timeout(const envoy_config_core_v3_HealthCheck *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 24)); }
+UPB_INLINE const struct google_protobuf_Duration* envoy_config_core_v3_HealthCheck_timeout(const envoy_config_core_v3_HealthCheck *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const struct google_protobuf_Duration*); }
+UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_interval(const envoy_config_core_v3_HealthCheck *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 32)); }
+UPB_INLINE const struct google_protobuf_Duration* envoy_config_core_v3_HealthCheck_interval(const envoy_config_core_v3_HealthCheck *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const struct google_protobuf_Duration*); }
+UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_interval_jitter(const envoy_config_core_v3_HealthCheck *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 40)); }
+UPB_INLINE const struct google_protobuf_Duration* envoy_config_core_v3_HealthCheck_interval_jitter(const envoy_config_core_v3_HealthCheck *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const struct google_protobuf_Duration*); }
+UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_unhealthy_threshold(const envoy_config_core_v3_HealthCheck *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 48)); }
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_core_v3_HealthCheck_unhealthy_threshold(const envoy_config_core_v3_HealthCheck *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 48), const struct google_protobuf_UInt32Value*); }
+UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_healthy_threshold(const envoy_config_core_v3_HealthCheck *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(32, 56)); }
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_core_v3_HealthCheck_healthy_threshold(const envoy_config_core_v3_HealthCheck *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 56), const struct google_protobuf_UInt32Value*); }
+UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_alt_port(const envoy_config_core_v3_HealthCheck *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(36, 64)); }
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_core_v3_HealthCheck_alt_port(const envoy_config_core_v3_HealthCheck *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(36, 64), const struct google_protobuf_UInt32Value*); }
+UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_reuse_connection(const envoy_config_core_v3_HealthCheck *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(40, 72)); }
+UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_core_v3_HealthCheck_reuse_connection(const envoy_config_core_v3_HealthCheck *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(40, 72), const struct google_protobuf_BoolValue*); }
+UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_http_health_check(const envoy_config_core_v3_HealthCheck *msg) { return _upb_getoneofcase(msg, UPB_SIZE(80, 152)) == 8; }
+UPB_INLINE const envoy_config_core_v3_HealthCheck_HttpHealthCheck* envoy_config_core_v3_HealthCheck_http_health_check(const envoy_config_core_v3_HealthCheck *msg) { return UPB_READ_ONEOF(msg, const envoy_config_core_v3_HealthCheck_HttpHealthCheck*, UPB_SIZE(76, 144), UPB_SIZE(80, 152), 8, NULL); }
+UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_tcp_health_check(const envoy_config_core_v3_HealthCheck *msg) { return _upb_getoneofcase(msg, UPB_SIZE(80, 152)) == 9; }
+UPB_INLINE const envoy_config_core_v3_HealthCheck_TcpHealthCheck* envoy_config_core_v3_HealthCheck_tcp_health_check(const envoy_config_core_v3_HealthCheck *msg) { return UPB_READ_ONEOF(msg, const envoy_config_core_v3_HealthCheck_TcpHealthCheck*, UPB_SIZE(76, 144), UPB_SIZE(80, 152), 9, NULL); }
+UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_grpc_health_check(const envoy_config_core_v3_HealthCheck *msg) { return _upb_getoneofcase(msg, UPB_SIZE(80, 152)) == 11; }
+UPB_INLINE const envoy_config_core_v3_HealthCheck_GrpcHealthCheck* envoy_config_core_v3_HealthCheck_grpc_health_check(const envoy_config_core_v3_HealthCheck *msg) { return UPB_READ_ONEOF(msg, const envoy_config_core_v3_HealthCheck_GrpcHealthCheck*, UPB_SIZE(76, 144), UPB_SIZE(80, 152), 11, NULL); }
+UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_no_traffic_interval(const envoy_config_core_v3_HealthCheck *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(44, 80)); }
+UPB_INLINE const struct google_protobuf_Duration* envoy_config_core_v3_HealthCheck_no_traffic_interval(const envoy_config_core_v3_HealthCheck *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(44, 80), const struct google_protobuf_Duration*); }
+UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_custom_health_check(const envoy_config_core_v3_HealthCheck *msg) { return _upb_getoneofcase(msg, UPB_SIZE(80, 152)) == 13; }
+UPB_INLINE const envoy_config_core_v3_HealthCheck_CustomHealthCheck* envoy_config_core_v3_HealthCheck_custom_health_check(const envoy_config_core_v3_HealthCheck *msg) { return UPB_READ_ONEOF(msg, const envoy_config_core_v3_HealthCheck_CustomHealthCheck*, UPB_SIZE(76, 144), UPB_SIZE(80, 152), 13, NULL); }
+UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_unhealthy_interval(const envoy_config_core_v3_HealthCheck *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(48, 88)); }
+UPB_INLINE const struct google_protobuf_Duration* envoy_config_core_v3_HealthCheck_unhealthy_interval(const envoy_config_core_v3_HealthCheck *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(48, 88), const struct google_protobuf_Duration*); }
+UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_unhealthy_edge_interval(const envoy_config_core_v3_HealthCheck *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(52, 96)); }
+UPB_INLINE const struct google_protobuf_Duration* envoy_config_core_v3_HealthCheck_unhealthy_edge_interval(const envoy_config_core_v3_HealthCheck *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(52, 96), const struct google_protobuf_Duration*); }
+UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_healthy_edge_interval(const envoy_config_core_v3_HealthCheck *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(56, 104)); }
+UPB_INLINE const struct google_protobuf_Duration* envoy_config_core_v3_HealthCheck_healthy_edge_interval(const envoy_config_core_v3_HealthCheck *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(56, 104), const struct google_protobuf_Duration*); }
+UPB_INLINE upb_strview envoy_config_core_v3_HealthCheck_event_log_path(const envoy_config_core_v3_HealthCheck *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview); }
+UPB_INLINE uint32_t envoy_config_core_v3_HealthCheck_interval_jitter_percent(const envoy_config_core_v3_HealthCheck *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t); }
+UPB_INLINE bool envoy_config_core_v3_HealthCheck_always_log_health_check_failures(const envoy_config_core_v3_HealthCheck *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool); }
+UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_initial_jitter(const envoy_config_core_v3_HealthCheck *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(60, 112)); }
+UPB_INLINE const struct google_protobuf_Duration* envoy_config_core_v3_HealthCheck_initial_jitter(const envoy_config_core_v3_HealthCheck *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(60, 112), const struct google_protobuf_Duration*); }
+UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_tls_options(const envoy_config_core_v3_HealthCheck *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(64, 120)); }
+UPB_INLINE const envoy_config_core_v3_HealthCheck_TlsOptions* envoy_config_core_v3_HealthCheck_tls_options(const envoy_config_core_v3_HealthCheck *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(64, 120), const envoy_config_core_v3_HealthCheck_TlsOptions*); }
+UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_event_service(const envoy_config_core_v3_HealthCheck *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(68, 128)); }
+UPB_INLINE const struct envoy_config_core_v3_EventServiceConfig* envoy_config_core_v3_HealthCheck_event_service(const envoy_config_core_v3_HealthCheck *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(68, 128), const struct envoy_config_core_v3_EventServiceConfig*); }
+UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_transport_socket_match_criteria(const envoy_config_core_v3_HealthCheck *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(72, 136)); }
+UPB_INLINE const struct google_protobuf_Struct* envoy_config_core_v3_HealthCheck_transport_socket_match_criteria(const envoy_config_core_v3_HealthCheck *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(72, 136), const struct google_protobuf_Struct*); }
+
+UPB_INLINE void envoy_config_core_v3_HealthCheck_set_timeout(envoy_config_core_v3_HealthCheck *msg, struct google_protobuf_Duration* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), struct google_protobuf_Duration*) = value;
+}
+UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_HealthCheck_mutable_timeout(envoy_config_core_v3_HealthCheck *msg, upb_arena *arena) {
+ struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_core_v3_HealthCheck_timeout(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_HealthCheck_set_timeout(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_HealthCheck_set_interval(envoy_config_core_v3_HealthCheck *msg, struct google_protobuf_Duration* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 32), struct google_protobuf_Duration*) = value;
+}
+UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_HealthCheck_mutable_interval(envoy_config_core_v3_HealthCheck *msg, upb_arena *arena) {
+ struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_core_v3_HealthCheck_interval(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_HealthCheck_set_interval(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_HealthCheck_set_interval_jitter(envoy_config_core_v3_HealthCheck *msg, struct google_protobuf_Duration* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 40), struct google_protobuf_Duration*) = value;
+}
+UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_HealthCheck_mutable_interval_jitter(envoy_config_core_v3_HealthCheck *msg, upb_arena *arena) {
+ struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_core_v3_HealthCheck_interval_jitter(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_HealthCheck_set_interval_jitter(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_HealthCheck_set_unhealthy_threshold(envoy_config_core_v3_HealthCheck *msg, struct google_protobuf_UInt32Value* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 48), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_HealthCheck_mutable_unhealthy_threshold(envoy_config_core_v3_HealthCheck *msg, upb_arena *arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_core_v3_HealthCheck_unhealthy_threshold(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_HealthCheck_set_unhealthy_threshold(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_HealthCheck_set_healthy_threshold(envoy_config_core_v3_HealthCheck *msg, struct google_protobuf_UInt32Value* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 56), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_HealthCheck_mutable_healthy_threshold(envoy_config_core_v3_HealthCheck *msg, upb_arena *arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_core_v3_HealthCheck_healthy_threshold(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_HealthCheck_set_healthy_threshold(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_HealthCheck_set_alt_port(envoy_config_core_v3_HealthCheck *msg, struct google_protobuf_UInt32Value* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(36, 64), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_HealthCheck_mutable_alt_port(envoy_config_core_v3_HealthCheck *msg, upb_arena *arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_core_v3_HealthCheck_alt_port(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_HealthCheck_set_alt_port(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_HealthCheck_set_reuse_connection(envoy_config_core_v3_HealthCheck *msg, struct google_protobuf_BoolValue* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 72), struct google_protobuf_BoolValue*) = value;
+}
+UPB_INLINE struct google_protobuf_BoolValue* envoy_config_core_v3_HealthCheck_mutable_reuse_connection(envoy_config_core_v3_HealthCheck *msg, upb_arena *arena) {
+ struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_core_v3_HealthCheck_reuse_connection(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_BoolValue*)_upb_msg_new(&google_protobuf_BoolValue_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_HealthCheck_set_reuse_connection(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_HealthCheck_set_http_health_check(envoy_config_core_v3_HealthCheck *msg, envoy_config_core_v3_HealthCheck_HttpHealthCheck* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_core_v3_HealthCheck_HttpHealthCheck*, UPB_SIZE(76, 144), value, UPB_SIZE(80, 152), 8);
+}
+UPB_INLINE struct envoy_config_core_v3_HealthCheck_HttpHealthCheck* envoy_config_core_v3_HealthCheck_mutable_http_health_check(envoy_config_core_v3_HealthCheck *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_HealthCheck_HttpHealthCheck* sub = (struct envoy_config_core_v3_HealthCheck_HttpHealthCheck*)envoy_config_core_v3_HealthCheck_http_health_check(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_HealthCheck_HttpHealthCheck*)_upb_msg_new(&envoy_config_core_v3_HealthCheck_HttpHealthCheck_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_HealthCheck_set_http_health_check(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_HealthCheck_set_tcp_health_check(envoy_config_core_v3_HealthCheck *msg, envoy_config_core_v3_HealthCheck_TcpHealthCheck* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_core_v3_HealthCheck_TcpHealthCheck*, UPB_SIZE(76, 144), value, UPB_SIZE(80, 152), 9);
+}
+UPB_INLINE struct envoy_config_core_v3_HealthCheck_TcpHealthCheck* envoy_config_core_v3_HealthCheck_mutable_tcp_health_check(envoy_config_core_v3_HealthCheck *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_HealthCheck_TcpHealthCheck* sub = (struct envoy_config_core_v3_HealthCheck_TcpHealthCheck*)envoy_config_core_v3_HealthCheck_tcp_health_check(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_HealthCheck_TcpHealthCheck*)_upb_msg_new(&envoy_config_core_v3_HealthCheck_TcpHealthCheck_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_HealthCheck_set_tcp_health_check(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_HealthCheck_set_grpc_health_check(envoy_config_core_v3_HealthCheck *msg, envoy_config_core_v3_HealthCheck_GrpcHealthCheck* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_core_v3_HealthCheck_GrpcHealthCheck*, UPB_SIZE(76, 144), value, UPB_SIZE(80, 152), 11);
+}
+UPB_INLINE struct envoy_config_core_v3_HealthCheck_GrpcHealthCheck* envoy_config_core_v3_HealthCheck_mutable_grpc_health_check(envoy_config_core_v3_HealthCheck *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_HealthCheck_GrpcHealthCheck* sub = (struct envoy_config_core_v3_HealthCheck_GrpcHealthCheck*)envoy_config_core_v3_HealthCheck_grpc_health_check(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_HealthCheck_GrpcHealthCheck*)_upb_msg_new(&envoy_config_core_v3_HealthCheck_GrpcHealthCheck_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_HealthCheck_set_grpc_health_check(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_HealthCheck_set_no_traffic_interval(envoy_config_core_v3_HealthCheck *msg, struct google_protobuf_Duration* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(44, 80), struct google_protobuf_Duration*) = value;
+}
+UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_HealthCheck_mutable_no_traffic_interval(envoy_config_core_v3_HealthCheck *msg, upb_arena *arena) {
+ struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_core_v3_HealthCheck_no_traffic_interval(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_HealthCheck_set_no_traffic_interval(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_HealthCheck_set_custom_health_check(envoy_config_core_v3_HealthCheck *msg, envoy_config_core_v3_HealthCheck_CustomHealthCheck* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_core_v3_HealthCheck_CustomHealthCheck*, UPB_SIZE(76, 144), value, UPB_SIZE(80, 152), 13);
+}
+UPB_INLINE struct envoy_config_core_v3_HealthCheck_CustomHealthCheck* envoy_config_core_v3_HealthCheck_mutable_custom_health_check(envoy_config_core_v3_HealthCheck *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_HealthCheck_CustomHealthCheck* sub = (struct envoy_config_core_v3_HealthCheck_CustomHealthCheck*)envoy_config_core_v3_HealthCheck_custom_health_check(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_HealthCheck_CustomHealthCheck*)_upb_msg_new(&envoy_config_core_v3_HealthCheck_CustomHealthCheck_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_HealthCheck_set_custom_health_check(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_HealthCheck_set_unhealthy_interval(envoy_config_core_v3_HealthCheck *msg, struct google_protobuf_Duration* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(48, 88), struct google_protobuf_Duration*) = value;
+}
+UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_HealthCheck_mutable_unhealthy_interval(envoy_config_core_v3_HealthCheck *msg, upb_arena *arena) {
+ struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_core_v3_HealthCheck_unhealthy_interval(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_HealthCheck_set_unhealthy_interval(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_HealthCheck_set_unhealthy_edge_interval(envoy_config_core_v3_HealthCheck *msg, struct google_protobuf_Duration* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(52, 96), struct google_protobuf_Duration*) = value;
+}
+UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_HealthCheck_mutable_unhealthy_edge_interval(envoy_config_core_v3_HealthCheck *msg, upb_arena *arena) {
+ struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_core_v3_HealthCheck_unhealthy_edge_interval(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_HealthCheck_set_unhealthy_edge_interval(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_HealthCheck_set_healthy_edge_interval(envoy_config_core_v3_HealthCheck *msg, struct google_protobuf_Duration* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(56, 104), struct google_protobuf_Duration*) = value;
+}
+UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_HealthCheck_mutable_healthy_edge_interval(envoy_config_core_v3_HealthCheck *msg, upb_arena *arena) {
+ struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_core_v3_HealthCheck_healthy_edge_interval(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_HealthCheck_set_healthy_edge_interval(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_HealthCheck_set_event_log_path(envoy_config_core_v3_HealthCheck *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_core_v3_HealthCheck_set_interval_jitter_percent(envoy_config_core_v3_HealthCheck *msg, uint32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t) = value;
+}
+UPB_INLINE void envoy_config_core_v3_HealthCheck_set_always_log_health_check_failures(envoy_config_core_v3_HealthCheck *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool) = value;
+}
+UPB_INLINE void envoy_config_core_v3_HealthCheck_set_initial_jitter(envoy_config_core_v3_HealthCheck *msg, struct google_protobuf_Duration* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(60, 112), struct google_protobuf_Duration*) = value;
+}
+UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_HealthCheck_mutable_initial_jitter(envoy_config_core_v3_HealthCheck *msg, upb_arena *arena) {
+ struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_core_v3_HealthCheck_initial_jitter(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_HealthCheck_set_initial_jitter(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_HealthCheck_set_tls_options(envoy_config_core_v3_HealthCheck *msg, envoy_config_core_v3_HealthCheck_TlsOptions* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(64, 120), envoy_config_core_v3_HealthCheck_TlsOptions*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_HealthCheck_TlsOptions* envoy_config_core_v3_HealthCheck_mutable_tls_options(envoy_config_core_v3_HealthCheck *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_HealthCheck_TlsOptions* sub = (struct envoy_config_core_v3_HealthCheck_TlsOptions*)envoy_config_core_v3_HealthCheck_tls_options(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_HealthCheck_TlsOptions*)_upb_msg_new(&envoy_config_core_v3_HealthCheck_TlsOptions_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_HealthCheck_set_tls_options(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_HealthCheck_set_event_service(envoy_config_core_v3_HealthCheck *msg, struct envoy_config_core_v3_EventServiceConfig* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(68, 128), struct envoy_config_core_v3_EventServiceConfig*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_EventServiceConfig* envoy_config_core_v3_HealthCheck_mutable_event_service(envoy_config_core_v3_HealthCheck *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_EventServiceConfig* sub = (struct envoy_config_core_v3_EventServiceConfig*)envoy_config_core_v3_HealthCheck_event_service(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_EventServiceConfig*)_upb_msg_new(&envoy_config_core_v3_EventServiceConfig_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_HealthCheck_set_event_service(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_HealthCheck_set_transport_socket_match_criteria(envoy_config_core_v3_HealthCheck *msg, struct google_protobuf_Struct* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(72, 136), struct google_protobuf_Struct*) = value;
+}
+UPB_INLINE struct google_protobuf_Struct* envoy_config_core_v3_HealthCheck_mutable_transport_socket_match_criteria(envoy_config_core_v3_HealthCheck *msg, upb_arena *arena) {
+ struct google_protobuf_Struct* sub = (struct google_protobuf_Struct*)envoy_config_core_v3_HealthCheck_transport_socket_match_criteria(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Struct*)_upb_msg_new(&google_protobuf_Struct_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_HealthCheck_set_transport_socket_match_criteria(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.core.v3.HealthCheck.Payload */
+
+UPB_INLINE envoy_config_core_v3_HealthCheck_Payload *envoy_config_core_v3_HealthCheck_Payload_new(upb_arena *arena) {
+ return (envoy_config_core_v3_HealthCheck_Payload *)_upb_msg_new(&envoy_config_core_v3_HealthCheck_Payload_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_HealthCheck_Payload *envoy_config_core_v3_HealthCheck_Payload_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_core_v3_HealthCheck_Payload *ret = envoy_config_core_v3_HealthCheck_Payload_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_Payload_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_core_v3_HealthCheck_Payload_serialize(const envoy_config_core_v3_HealthCheck_Payload *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_core_v3_HealthCheck_Payload_msginit, arena, len);
+}
+
+typedef enum {
+ envoy_config_core_v3_HealthCheck_Payload_payload_text = 1,
+ envoy_config_core_v3_HealthCheck_Payload_payload_binary = 2,
+ envoy_config_core_v3_HealthCheck_Payload_payload_NOT_SET = 0
+} envoy_config_core_v3_HealthCheck_Payload_payload_oneofcases;
+UPB_INLINE envoy_config_core_v3_HealthCheck_Payload_payload_oneofcases envoy_config_core_v3_HealthCheck_Payload_payload_case(const envoy_config_core_v3_HealthCheck_Payload* msg) { return (envoy_config_core_v3_HealthCheck_Payload_payload_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(8, 16), int32_t); }
+
+UPB_INLINE bool envoy_config_core_v3_HealthCheck_Payload_has_text(const envoy_config_core_v3_HealthCheck_Payload *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 1; }
+UPB_INLINE upb_strview envoy_config_core_v3_HealthCheck_Payload_text(const envoy_config_core_v3_HealthCheck_Payload *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 1, upb_strview_make("", strlen(""))); }
+UPB_INLINE bool envoy_config_core_v3_HealthCheck_Payload_has_binary(const envoy_config_core_v3_HealthCheck_Payload *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 2; }
+UPB_INLINE upb_strview envoy_config_core_v3_HealthCheck_Payload_binary(const envoy_config_core_v3_HealthCheck_Payload *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 2, upb_strview_make("", strlen(""))); }
+
+UPB_INLINE void envoy_config_core_v3_HealthCheck_Payload_set_text(envoy_config_core_v3_HealthCheck_Payload *msg, upb_strview value) {
+ UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 1);
+}
+UPB_INLINE void envoy_config_core_v3_HealthCheck_Payload_set_binary(envoy_config_core_v3_HealthCheck_Payload *msg, upb_strview value) {
+ UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 2);
+}
+
+/* envoy.config.core.v3.HealthCheck.HttpHealthCheck */
+
+UPB_INLINE envoy_config_core_v3_HealthCheck_HttpHealthCheck *envoy_config_core_v3_HealthCheck_HttpHealthCheck_new(upb_arena *arena) {
+ return (envoy_config_core_v3_HealthCheck_HttpHealthCheck *)_upb_msg_new(&envoy_config_core_v3_HealthCheck_HttpHealthCheck_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_HealthCheck_HttpHealthCheck *envoy_config_core_v3_HealthCheck_HttpHealthCheck_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_core_v3_HealthCheck_HttpHealthCheck *ret = envoy_config_core_v3_HealthCheck_HttpHealthCheck_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_HttpHealthCheck_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_core_v3_HealthCheck_HttpHealthCheck_serialize(const envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_core_v3_HealthCheck_HttpHealthCheck_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview envoy_config_core_v3_HealthCheck_HttpHealthCheck_host(const envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview); }
+UPB_INLINE upb_strview envoy_config_core_v3_HealthCheck_HttpHealthCheck_path(const envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_strview); }
+UPB_INLINE bool envoy_config_core_v3_HealthCheck_HttpHealthCheck_has_send(const envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 40)); }
+UPB_INLINE const envoy_config_core_v3_HealthCheck_Payload* envoy_config_core_v3_HealthCheck_HttpHealthCheck_send(const envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const envoy_config_core_v3_HealthCheck_Payload*); }
+UPB_INLINE bool envoy_config_core_v3_HealthCheck_HttpHealthCheck_has_receive(const envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 48)); }
+UPB_INLINE const envoy_config_core_v3_HealthCheck_Payload* envoy_config_core_v3_HealthCheck_HttpHealthCheck_receive(const envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 48), const envoy_config_core_v3_HealthCheck_Payload*); }
+UPB_INLINE bool envoy_config_core_v3_HealthCheck_HttpHealthCheck_has_request_headers_to_add(const envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(36, 64)); }
+UPB_INLINE const struct envoy_config_core_v3_HeaderValueOption* const* envoy_config_core_v3_HealthCheck_HttpHealthCheck_request_headers_to_add(const envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg, size_t *len) { return (const struct envoy_config_core_v3_HeaderValueOption* const*)_upb_array_accessor(msg, UPB_SIZE(36, 64), len); }
+UPB_INLINE upb_strview const* envoy_config_core_v3_HealthCheck_HttpHealthCheck_request_headers_to_remove(const envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(40, 72), len); }
+UPB_INLINE bool envoy_config_core_v3_HealthCheck_HttpHealthCheck_has_expected_statuses(const envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(44, 80)); }
+UPB_INLINE const struct envoy_type_v3_Int64Range* const* envoy_config_core_v3_HealthCheck_HttpHealthCheck_expected_statuses(const envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg, size_t *len) { return (const struct envoy_type_v3_Int64Range* const*)_upb_array_accessor(msg, UPB_SIZE(44, 80), len); }
+UPB_INLINE int32_t envoy_config_core_v3_HealthCheck_HttpHealthCheck_codec_client_type(const envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
+UPB_INLINE bool envoy_config_core_v3_HealthCheck_HttpHealthCheck_has_service_name_matcher(const envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(32, 56)); }
+UPB_INLINE const struct envoy_type_matcher_v3_StringMatcher* envoy_config_core_v3_HealthCheck_HttpHealthCheck_service_name_matcher(const envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 56), const struct envoy_type_matcher_v3_StringMatcher*); }
+
+UPB_INLINE void envoy_config_core_v3_HealthCheck_HttpHealthCheck_set_host(envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_core_v3_HealthCheck_HttpHealthCheck_set_path(envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_core_v3_HealthCheck_HttpHealthCheck_set_send(envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg, envoy_config_core_v3_HealthCheck_Payload* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 40), envoy_config_core_v3_HealthCheck_Payload*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_HealthCheck_Payload* envoy_config_core_v3_HealthCheck_HttpHealthCheck_mutable_send(envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_HealthCheck_Payload* sub = (struct envoy_config_core_v3_HealthCheck_Payload*)envoy_config_core_v3_HealthCheck_HttpHealthCheck_send(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_HealthCheck_Payload*)_upb_msg_new(&envoy_config_core_v3_HealthCheck_Payload_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_HealthCheck_HttpHealthCheck_set_send(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_HealthCheck_HttpHealthCheck_set_receive(envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg, envoy_config_core_v3_HealthCheck_Payload* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 48), envoy_config_core_v3_HealthCheck_Payload*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_HealthCheck_Payload* envoy_config_core_v3_HealthCheck_HttpHealthCheck_mutable_receive(envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_HealthCheck_Payload* sub = (struct envoy_config_core_v3_HealthCheck_Payload*)envoy_config_core_v3_HealthCheck_HttpHealthCheck_receive(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_HealthCheck_Payload*)_upb_msg_new(&envoy_config_core_v3_HealthCheck_Payload_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_HealthCheck_HttpHealthCheck_set_receive(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_config_core_v3_HealthCheck_HttpHealthCheck_mutable_request_headers_to_add(envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg, size_t *len) {
+ return (struct envoy_config_core_v3_HeaderValueOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(36, 64), len);
+}
+UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_config_core_v3_HealthCheck_HttpHealthCheck_resize_request_headers_to_add(envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg, size_t len, upb_arena *arena) {
+ return (struct envoy_config_core_v3_HeaderValueOption**)_upb_array_resize_accessor(msg, UPB_SIZE(36, 64), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_config_core_v3_HeaderValueOption* envoy_config_core_v3_HealthCheck_HttpHealthCheck_add_request_headers_to_add(envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_HeaderValueOption* sub = (struct envoy_config_core_v3_HeaderValueOption*)_upb_msg_new(&envoy_config_core_v3_HeaderValueOption_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(36, 64), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE upb_strview* envoy_config_core_v3_HealthCheck_HttpHealthCheck_mutable_request_headers_to_remove(envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg, size_t *len) {
+ return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(40, 72), len);
+}
+UPB_INLINE upb_strview* envoy_config_core_v3_HealthCheck_HttpHealthCheck_resize_request_headers_to_remove(envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg, size_t len, upb_arena *arena) {
+ return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(40, 72), len, UPB_TYPE_STRING, arena);
+}
+UPB_INLINE bool envoy_config_core_v3_HealthCheck_HttpHealthCheck_add_request_headers_to_remove(envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg, upb_strview val, upb_arena *arena) {
+ return _upb_array_append_accessor(msg, UPB_SIZE(40, 72), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
+ arena);
+}
+UPB_INLINE struct envoy_type_v3_Int64Range** envoy_config_core_v3_HealthCheck_HttpHealthCheck_mutable_expected_statuses(envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg, size_t *len) {
+ return (struct envoy_type_v3_Int64Range**)_upb_array_mutable_accessor(msg, UPB_SIZE(44, 80), len);
+}
+UPB_INLINE struct envoy_type_v3_Int64Range** envoy_config_core_v3_HealthCheck_HttpHealthCheck_resize_expected_statuses(envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg, size_t len, upb_arena *arena) {
+ return (struct envoy_type_v3_Int64Range**)_upb_array_resize_accessor(msg, UPB_SIZE(44, 80), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_type_v3_Int64Range* envoy_config_core_v3_HealthCheck_HttpHealthCheck_add_expected_statuses(envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg, upb_arena *arena) {
+ struct envoy_type_v3_Int64Range* sub = (struct envoy_type_v3_Int64Range*)_upb_msg_new(&envoy_type_v3_Int64Range_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(44, 80), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_HealthCheck_HttpHealthCheck_set_codec_client_type(envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg, int32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
+}
+UPB_INLINE void envoy_config_core_v3_HealthCheck_HttpHealthCheck_set_service_name_matcher(envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg, struct envoy_type_matcher_v3_StringMatcher* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 56), struct envoy_type_matcher_v3_StringMatcher*) = value;
+}
+UPB_INLINE struct envoy_type_matcher_v3_StringMatcher* envoy_config_core_v3_HealthCheck_HttpHealthCheck_mutable_service_name_matcher(envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg, upb_arena *arena) {
+ struct envoy_type_matcher_v3_StringMatcher* sub = (struct envoy_type_matcher_v3_StringMatcher*)envoy_config_core_v3_HealthCheck_HttpHealthCheck_service_name_matcher(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_type_matcher_v3_StringMatcher*)_upb_msg_new(&envoy_type_matcher_v3_StringMatcher_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_HealthCheck_HttpHealthCheck_set_service_name_matcher(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.core.v3.HealthCheck.TcpHealthCheck */
+
+UPB_INLINE envoy_config_core_v3_HealthCheck_TcpHealthCheck *envoy_config_core_v3_HealthCheck_TcpHealthCheck_new(upb_arena *arena) {
+ return (envoy_config_core_v3_HealthCheck_TcpHealthCheck *)_upb_msg_new(&envoy_config_core_v3_HealthCheck_TcpHealthCheck_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_HealthCheck_TcpHealthCheck *envoy_config_core_v3_HealthCheck_TcpHealthCheck_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_core_v3_HealthCheck_TcpHealthCheck *ret = envoy_config_core_v3_HealthCheck_TcpHealthCheck_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_TcpHealthCheck_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_core_v3_HealthCheck_TcpHealthCheck_serialize(const envoy_config_core_v3_HealthCheck_TcpHealthCheck *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_core_v3_HealthCheck_TcpHealthCheck_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_core_v3_HealthCheck_TcpHealthCheck_has_send(const envoy_config_core_v3_HealthCheck_TcpHealthCheck *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE const envoy_config_core_v3_HealthCheck_Payload* envoy_config_core_v3_HealthCheck_TcpHealthCheck_send(const envoy_config_core_v3_HealthCheck_TcpHealthCheck *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const envoy_config_core_v3_HealthCheck_Payload*); }
+UPB_INLINE bool envoy_config_core_v3_HealthCheck_TcpHealthCheck_has_receive(const envoy_config_core_v3_HealthCheck_TcpHealthCheck *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
+UPB_INLINE const envoy_config_core_v3_HealthCheck_Payload* const* envoy_config_core_v3_HealthCheck_TcpHealthCheck_receive(const envoy_config_core_v3_HealthCheck_TcpHealthCheck *msg, size_t *len) { return (const envoy_config_core_v3_HealthCheck_Payload* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len); }
+
+UPB_INLINE void envoy_config_core_v3_HealthCheck_TcpHealthCheck_set_send(envoy_config_core_v3_HealthCheck_TcpHealthCheck *msg, envoy_config_core_v3_HealthCheck_Payload* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), envoy_config_core_v3_HealthCheck_Payload*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_HealthCheck_Payload* envoy_config_core_v3_HealthCheck_TcpHealthCheck_mutable_send(envoy_config_core_v3_HealthCheck_TcpHealthCheck *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_HealthCheck_Payload* sub = (struct envoy_config_core_v3_HealthCheck_Payload*)envoy_config_core_v3_HealthCheck_TcpHealthCheck_send(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_HealthCheck_Payload*)_upb_msg_new(&envoy_config_core_v3_HealthCheck_Payload_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_HealthCheck_TcpHealthCheck_set_send(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE envoy_config_core_v3_HealthCheck_Payload** envoy_config_core_v3_HealthCheck_TcpHealthCheck_mutable_receive(envoy_config_core_v3_HealthCheck_TcpHealthCheck *msg, size_t *len) {
+ return (envoy_config_core_v3_HealthCheck_Payload**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len);
+}
+UPB_INLINE envoy_config_core_v3_HealthCheck_Payload** envoy_config_core_v3_HealthCheck_TcpHealthCheck_resize_receive(envoy_config_core_v3_HealthCheck_TcpHealthCheck *msg, size_t len, upb_arena *arena) {
+ return (envoy_config_core_v3_HealthCheck_Payload**)_upb_array_resize_accessor(msg, UPB_SIZE(4, 8), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_config_core_v3_HealthCheck_Payload* envoy_config_core_v3_HealthCheck_TcpHealthCheck_add_receive(envoy_config_core_v3_HealthCheck_TcpHealthCheck *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_HealthCheck_Payload* sub = (struct envoy_config_core_v3_HealthCheck_Payload*)_upb_msg_new(&envoy_config_core_v3_HealthCheck_Payload_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(4, 8), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+
+/* envoy.config.core.v3.HealthCheck.RedisHealthCheck */
+
+UPB_INLINE envoy_config_core_v3_HealthCheck_RedisHealthCheck *envoy_config_core_v3_HealthCheck_RedisHealthCheck_new(upb_arena *arena) {
+ return (envoy_config_core_v3_HealthCheck_RedisHealthCheck *)_upb_msg_new(&envoy_config_core_v3_HealthCheck_RedisHealthCheck_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_HealthCheck_RedisHealthCheck *envoy_config_core_v3_HealthCheck_RedisHealthCheck_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_core_v3_HealthCheck_RedisHealthCheck *ret = envoy_config_core_v3_HealthCheck_RedisHealthCheck_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_RedisHealthCheck_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_core_v3_HealthCheck_RedisHealthCheck_serialize(const envoy_config_core_v3_HealthCheck_RedisHealthCheck *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_core_v3_HealthCheck_RedisHealthCheck_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview envoy_config_core_v3_HealthCheck_RedisHealthCheck_key(const envoy_config_core_v3_HealthCheck_RedisHealthCheck *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+
+UPB_INLINE void envoy_config_core_v3_HealthCheck_RedisHealthCheck_set_key(envoy_config_core_v3_HealthCheck_RedisHealthCheck *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+
+/* envoy.config.core.v3.HealthCheck.GrpcHealthCheck */
+
+UPB_INLINE envoy_config_core_v3_HealthCheck_GrpcHealthCheck *envoy_config_core_v3_HealthCheck_GrpcHealthCheck_new(upb_arena *arena) {
+ return (envoy_config_core_v3_HealthCheck_GrpcHealthCheck *)_upb_msg_new(&envoy_config_core_v3_HealthCheck_GrpcHealthCheck_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_HealthCheck_GrpcHealthCheck *envoy_config_core_v3_HealthCheck_GrpcHealthCheck_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_core_v3_HealthCheck_GrpcHealthCheck *ret = envoy_config_core_v3_HealthCheck_GrpcHealthCheck_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_GrpcHealthCheck_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_core_v3_HealthCheck_GrpcHealthCheck_serialize(const envoy_config_core_v3_HealthCheck_GrpcHealthCheck *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_core_v3_HealthCheck_GrpcHealthCheck_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview envoy_config_core_v3_HealthCheck_GrpcHealthCheck_service_name(const envoy_config_core_v3_HealthCheck_GrpcHealthCheck *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE upb_strview envoy_config_core_v3_HealthCheck_GrpcHealthCheck_authority(const envoy_config_core_v3_HealthCheck_GrpcHealthCheck *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview); }
+
+UPB_INLINE void envoy_config_core_v3_HealthCheck_GrpcHealthCheck_set_service_name(envoy_config_core_v3_HealthCheck_GrpcHealthCheck *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_core_v3_HealthCheck_GrpcHealthCheck_set_authority(envoy_config_core_v3_HealthCheck_GrpcHealthCheck *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview) = value;
+}
+
+/* envoy.config.core.v3.HealthCheck.CustomHealthCheck */
+
+UPB_INLINE envoy_config_core_v3_HealthCheck_CustomHealthCheck *envoy_config_core_v3_HealthCheck_CustomHealthCheck_new(upb_arena *arena) {
+ return (envoy_config_core_v3_HealthCheck_CustomHealthCheck *)_upb_msg_new(&envoy_config_core_v3_HealthCheck_CustomHealthCheck_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_HealthCheck_CustomHealthCheck *envoy_config_core_v3_HealthCheck_CustomHealthCheck_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_core_v3_HealthCheck_CustomHealthCheck *ret = envoy_config_core_v3_HealthCheck_CustomHealthCheck_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_CustomHealthCheck_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_core_v3_HealthCheck_CustomHealthCheck_serialize(const envoy_config_core_v3_HealthCheck_CustomHealthCheck *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_core_v3_HealthCheck_CustomHealthCheck_msginit, arena, len);
+}
+
+typedef enum {
+ envoy_config_core_v3_HealthCheck_CustomHealthCheck_config_type_typed_config = 3,
+ envoy_config_core_v3_HealthCheck_CustomHealthCheck_config_type_NOT_SET = 0
+} envoy_config_core_v3_HealthCheck_CustomHealthCheck_config_type_oneofcases;
+UPB_INLINE envoy_config_core_v3_HealthCheck_CustomHealthCheck_config_type_oneofcases envoy_config_core_v3_HealthCheck_CustomHealthCheck_config_type_case(const envoy_config_core_v3_HealthCheck_CustomHealthCheck* msg) { return (envoy_config_core_v3_HealthCheck_CustomHealthCheck_config_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(12, 24), int32_t); }
+
+UPB_INLINE upb_strview envoy_config_core_v3_HealthCheck_CustomHealthCheck_name(const envoy_config_core_v3_HealthCheck_CustomHealthCheck *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE bool envoy_config_core_v3_HealthCheck_CustomHealthCheck_has_typed_config(const envoy_config_core_v3_HealthCheck_CustomHealthCheck *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 3; }
+UPB_INLINE const struct google_protobuf_Any* envoy_config_core_v3_HealthCheck_CustomHealthCheck_typed_config(const envoy_config_core_v3_HealthCheck_CustomHealthCheck *msg) { return UPB_READ_ONEOF(msg, const struct google_protobuf_Any*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 3, NULL); }
+
+UPB_INLINE void envoy_config_core_v3_HealthCheck_CustomHealthCheck_set_name(envoy_config_core_v3_HealthCheck_CustomHealthCheck *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_core_v3_HealthCheck_CustomHealthCheck_set_typed_config(envoy_config_core_v3_HealthCheck_CustomHealthCheck *msg, struct google_protobuf_Any* value) {
+ UPB_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 3);
+}
+UPB_INLINE struct google_protobuf_Any* envoy_config_core_v3_HealthCheck_CustomHealthCheck_mutable_typed_config(envoy_config_core_v3_HealthCheck_CustomHealthCheck *msg, upb_arena *arena) {
+ struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_config_core_v3_HealthCheck_CustomHealthCheck_typed_config(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_HealthCheck_CustomHealthCheck_set_typed_config(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.core.v3.HealthCheck.TlsOptions */
+
+UPB_INLINE envoy_config_core_v3_HealthCheck_TlsOptions *envoy_config_core_v3_HealthCheck_TlsOptions_new(upb_arena *arena) {
+ return (envoy_config_core_v3_HealthCheck_TlsOptions *)_upb_msg_new(&envoy_config_core_v3_HealthCheck_TlsOptions_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_HealthCheck_TlsOptions *envoy_config_core_v3_HealthCheck_TlsOptions_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_core_v3_HealthCheck_TlsOptions *ret = envoy_config_core_v3_HealthCheck_TlsOptions_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_TlsOptions_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_core_v3_HealthCheck_TlsOptions_serialize(const envoy_config_core_v3_HealthCheck_TlsOptions *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_core_v3_HealthCheck_TlsOptions_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview const* envoy_config_core_v3_HealthCheck_TlsOptions_alpn_protocols(const envoy_config_core_v3_HealthCheck_TlsOptions *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
+
+UPB_INLINE upb_strview* envoy_config_core_v3_HealthCheck_TlsOptions_mutable_alpn_protocols(envoy_config_core_v3_HealthCheck_TlsOptions *msg, size_t *len) {
+ return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
+}
+UPB_INLINE upb_strview* envoy_config_core_v3_HealthCheck_TlsOptions_resize_alpn_protocols(envoy_config_core_v3_HealthCheck_TlsOptions *msg, size_t len, upb_arena *arena) {
+ return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(0, 0), len, UPB_TYPE_STRING, arena);
+}
+UPB_INLINE bool envoy_config_core_v3_HealthCheck_TlsOptions_add_alpn_protocols(envoy_config_core_v3_HealthCheck_TlsOptions *msg, upb_strview val, upb_arena *arena) {
+ return _upb_array_append_accessor(msg, UPB_SIZE(0, 0), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
+ arena);
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_CONFIG_CORE_V3_HEALTH_CHECK_PROTO_UPB_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.c
index 72ed5db11f6..b8ac727fea6 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.c
@@ -1,36 +1,36 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/config/core/v3/http_uri.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include <stddef.h>
-#include "upb/msg.h"
-#include "envoy/config/core/v3/http_uri.upb.h"
-#include "google/protobuf/duration.upb.h"
-#include "udpa/annotations/status.upb.h"
-#include "udpa/annotations/versioning.upb.h"
-#include "validate/validate.upb.h"
-
-#include "upb/port_def.inc"
-
-static const upb_msglayout *const envoy_config_core_v3_HttpUri_submsgs[1] = {
- &google_protobuf_Duration_msginit,
-};
-
-static const upb_msglayout_field envoy_config_core_v3_HttpUri__fields[3] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(12, 24), UPB_SIZE(-21, -41), 0, 9, 1},
- {3, UPB_SIZE(8, 16), 0, 0, 11, 1},
-};
-
-const upb_msglayout envoy_config_core_v3_HttpUri_msginit = {
- &envoy_config_core_v3_HttpUri_submsgs[0],
- &envoy_config_core_v3_HttpUri__fields[0],
- UPB_SIZE(24, 48), 3, false,
-};
-
-#include "upb/port_undef.inc"
-
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/core/v3/http_uri.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg.h"
+#include "envoy/config/core/v3/http_uri.upb.h"
+#include "google/protobuf/duration.upb.h"
+#include "udpa/annotations/status.upb.h"
+#include "udpa/annotations/versioning.upb.h"
+#include "validate/validate.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_msglayout *const envoy_config_core_v3_HttpUri_submsgs[1] = {
+ &google_protobuf_Duration_msginit,
+};
+
+static const upb_msglayout_field envoy_config_core_v3_HttpUri__fields[3] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {2, UPB_SIZE(12, 24), UPB_SIZE(-21, -41), 0, 9, 1},
+ {3, UPB_SIZE(8, 16), 0, 0, 11, 1},
+};
+
+const upb_msglayout envoy_config_core_v3_HttpUri_msginit = {
+ &envoy_config_core_v3_HttpUri_submsgs[0],
+ &envoy_config_core_v3_HttpUri__fields[0],
+ UPB_SIZE(24, 48), 3, false,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.h
index c2c7e2467d9..8682067e283 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.h
@@ -1,80 +1,80 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/config/core/v3/http_uri.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef ENVOY_CONFIG_CORE_V3_HTTP_URI_PROTO_UPB_H_
-#define ENVOY_CONFIG_CORE_V3_HTTP_URI_PROTO_UPB_H_
-
-#include "upb/msg.h"
-#include "upb/decode.h"
-#include "upb/encode.h"
-
-#include "upb/port_def.inc"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct envoy_config_core_v3_HttpUri;
-typedef struct envoy_config_core_v3_HttpUri envoy_config_core_v3_HttpUri;
-extern const upb_msglayout envoy_config_core_v3_HttpUri_msginit;
-struct google_protobuf_Duration;
-extern const upb_msglayout google_protobuf_Duration_msginit;
-
-
-/* envoy.config.core.v3.HttpUri */
-
-UPB_INLINE envoy_config_core_v3_HttpUri *envoy_config_core_v3_HttpUri_new(upb_arena *arena) {
- return (envoy_config_core_v3_HttpUri *)_upb_msg_new(&envoy_config_core_v3_HttpUri_msginit, arena);
-}
-UPB_INLINE envoy_config_core_v3_HttpUri *envoy_config_core_v3_HttpUri_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_core_v3_HttpUri *ret = envoy_config_core_v3_HttpUri_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_HttpUri_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_core_v3_HttpUri_serialize(const envoy_config_core_v3_HttpUri *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_core_v3_HttpUri_msginit, arena, len);
-}
-
-typedef enum {
- envoy_config_core_v3_HttpUri_http_upstream_type_cluster = 2,
- envoy_config_core_v3_HttpUri_http_upstream_type_NOT_SET = 0
-} envoy_config_core_v3_HttpUri_http_upstream_type_oneofcases;
-UPB_INLINE envoy_config_core_v3_HttpUri_http_upstream_type_oneofcases envoy_config_core_v3_HttpUri_http_upstream_type_case(const envoy_config_core_v3_HttpUri* msg) { return (envoy_config_core_v3_HttpUri_http_upstream_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(20, 40), int32_t); }
-
-UPB_INLINE upb_strview envoy_config_core_v3_HttpUri_uri(const envoy_config_core_v3_HttpUri *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE bool envoy_config_core_v3_HttpUri_has_cluster(const envoy_config_core_v3_HttpUri *msg) { return _upb_getoneofcase(msg, UPB_SIZE(20, 40)) == 2; }
-UPB_INLINE upb_strview envoy_config_core_v3_HttpUri_cluster(const envoy_config_core_v3_HttpUri *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(12, 24), UPB_SIZE(20, 40), 2, upb_strview_make("", strlen(""))); }
-UPB_INLINE bool envoy_config_core_v3_HttpUri_has_timeout(const envoy_config_core_v3_HttpUri *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const struct google_protobuf_Duration* envoy_config_core_v3_HttpUri_timeout(const envoy_config_core_v3_HttpUri *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_Duration*); }
-
-UPB_INLINE void envoy_config_core_v3_HttpUri_set_uri(envoy_config_core_v3_HttpUri *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_core_v3_HttpUri_set_cluster(envoy_config_core_v3_HttpUri *msg, upb_strview value) {
- UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(12, 24), value, UPB_SIZE(20, 40), 2);
-}
-UPB_INLINE void envoy_config_core_v3_HttpUri_set_timeout(envoy_config_core_v3_HttpUri *msg, struct google_protobuf_Duration* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_Duration*) = value;
-}
-UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_HttpUri_mutable_timeout(envoy_config_core_v3_HttpUri *msg, upb_arena *arena) {
- struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_core_v3_HttpUri_timeout(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_HttpUri_set_timeout(msg, sub);
- }
- return sub;
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* ENVOY_CONFIG_CORE_V3_HTTP_URI_PROTO_UPB_H_ */
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/core/v3/http_uri.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_CONFIG_CORE_V3_HTTP_URI_PROTO_UPB_H_
+#define ENVOY_CONFIG_CORE_V3_HTTP_URI_PROTO_UPB_H_
+
+#include "upb/msg.h"
+#include "upb/decode.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_config_core_v3_HttpUri;
+typedef struct envoy_config_core_v3_HttpUri envoy_config_core_v3_HttpUri;
+extern const upb_msglayout envoy_config_core_v3_HttpUri_msginit;
+struct google_protobuf_Duration;
+extern const upb_msglayout google_protobuf_Duration_msginit;
+
+
+/* envoy.config.core.v3.HttpUri */
+
+UPB_INLINE envoy_config_core_v3_HttpUri *envoy_config_core_v3_HttpUri_new(upb_arena *arena) {
+ return (envoy_config_core_v3_HttpUri *)_upb_msg_new(&envoy_config_core_v3_HttpUri_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_HttpUri *envoy_config_core_v3_HttpUri_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_core_v3_HttpUri *ret = envoy_config_core_v3_HttpUri_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_HttpUri_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_core_v3_HttpUri_serialize(const envoy_config_core_v3_HttpUri *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_core_v3_HttpUri_msginit, arena, len);
+}
+
+typedef enum {
+ envoy_config_core_v3_HttpUri_http_upstream_type_cluster = 2,
+ envoy_config_core_v3_HttpUri_http_upstream_type_NOT_SET = 0
+} envoy_config_core_v3_HttpUri_http_upstream_type_oneofcases;
+UPB_INLINE envoy_config_core_v3_HttpUri_http_upstream_type_oneofcases envoy_config_core_v3_HttpUri_http_upstream_type_case(const envoy_config_core_v3_HttpUri* msg) { return (envoy_config_core_v3_HttpUri_http_upstream_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(20, 40), int32_t); }
+
+UPB_INLINE upb_strview envoy_config_core_v3_HttpUri_uri(const envoy_config_core_v3_HttpUri *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE bool envoy_config_core_v3_HttpUri_has_cluster(const envoy_config_core_v3_HttpUri *msg) { return _upb_getoneofcase(msg, UPB_SIZE(20, 40)) == 2; }
+UPB_INLINE upb_strview envoy_config_core_v3_HttpUri_cluster(const envoy_config_core_v3_HttpUri *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(12, 24), UPB_SIZE(20, 40), 2, upb_strview_make("", strlen(""))); }
+UPB_INLINE bool envoy_config_core_v3_HttpUri_has_timeout(const envoy_config_core_v3_HttpUri *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
+UPB_INLINE const struct google_protobuf_Duration* envoy_config_core_v3_HttpUri_timeout(const envoy_config_core_v3_HttpUri *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_Duration*); }
+
+UPB_INLINE void envoy_config_core_v3_HttpUri_set_uri(envoy_config_core_v3_HttpUri *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_core_v3_HttpUri_set_cluster(envoy_config_core_v3_HttpUri *msg, upb_strview value) {
+ UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(12, 24), value, UPB_SIZE(20, 40), 2);
+}
+UPB_INLINE void envoy_config_core_v3_HttpUri_set_timeout(envoy_config_core_v3_HttpUri *msg, struct google_protobuf_Duration* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_Duration*) = value;
+}
+UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_HttpUri_mutable_timeout(envoy_config_core_v3_HttpUri *msg, upb_arena *arena) {
+ struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_core_v3_HttpUri_timeout(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_HttpUri_set_timeout(msg, sub);
+ }
+ return sub;
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_CONFIG_CORE_V3_HTTP_URI_PROTO_UPB_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.c
index 06e88b2720d..000be1039c7 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.c
@@ -1,176 +1,176 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/config/core/v3/protocol.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include <stddef.h>
-#include "upb/msg.h"
-#include "envoy/config/core/v3/protocol.upb.h"
-#include "envoy/type/v3/percent.upb.h"
-#include "google/protobuf/duration.upb.h"
-#include "google/protobuf/wrappers.upb.h"
-#include "udpa/annotations/status.upb.h"
-#include "udpa/annotations/versioning.upb.h"
-#include "validate/validate.upb.h"
-
-#include "upb/port_def.inc"
-
-const upb_msglayout envoy_config_core_v3_TcpProtocolOptions_msginit = {
- NULL,
- NULL,
- UPB_SIZE(0, 0), 0, false,
-};
-
-static const upb_msglayout_field envoy_config_core_v3_UpstreamHttpProtocolOptions__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 8, 1},
- {2, UPB_SIZE(1, 1), 0, 0, 8, 1},
-};
-
-const upb_msglayout envoy_config_core_v3_UpstreamHttpProtocolOptions_msginit = {
- NULL,
- &envoy_config_core_v3_UpstreamHttpProtocolOptions__fields[0],
- UPB_SIZE(2, 2), 2, false,
-};
-
-static const upb_msglayout *const envoy_config_core_v3_HttpProtocolOptions_submsgs[4] = {
- &google_protobuf_Duration_msginit,
- &google_protobuf_UInt32Value_msginit,
-};
-
-static const upb_msglayout_field envoy_config_core_v3_HttpProtocolOptions__fields[5] = {
- {1, UPB_SIZE(8, 8), 0, 0, 11, 1},
- {2, UPB_SIZE(12, 16), 0, 1, 11, 1},
- {3, UPB_SIZE(16, 24), 0, 0, 11, 1},
- {4, UPB_SIZE(20, 32), 0, 0, 11, 1},
- {5, UPB_SIZE(0, 0), 0, 0, 14, 1},
-};
-
-const upb_msglayout envoy_config_core_v3_HttpProtocolOptions_msginit = {
- &envoy_config_core_v3_HttpProtocolOptions_submsgs[0],
- &envoy_config_core_v3_HttpProtocolOptions__fields[0],
- UPB_SIZE(24, 40), 5, false,
-};
-
-static const upb_msglayout *const envoy_config_core_v3_Http1ProtocolOptions_submsgs[3] = {
- &envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_msginit,
- &google_protobuf_BoolValue_msginit,
-};
-
-static const upb_msglayout_field envoy_config_core_v3_Http1ProtocolOptions__fields[7] = {
- {1, UPB_SIZE(12, 24), 0, 1, 11, 1},
- {2, UPB_SIZE(0, 0), 0, 0, 8, 1},
- {3, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {4, UPB_SIZE(16, 32), 0, 0, 11, 1},
- {5, UPB_SIZE(1, 1), 0, 0, 8, 1},
- {6, UPB_SIZE(2, 2), 0, 0, 8, 1},
- {7, UPB_SIZE(20, 40), 0, 1, 11, 1},
-};
-
-const upb_msglayout envoy_config_core_v3_Http1ProtocolOptions_msginit = {
- &envoy_config_core_v3_Http1ProtocolOptions_submsgs[0],
- &envoy_config_core_v3_Http1ProtocolOptions__fields[0],
- UPB_SIZE(24, 48), 7, false,
-};
-
-static const upb_msglayout *const envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_submsgs[1] = {
- &envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_msginit,
-};
-
-static const upb_msglayout_field envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat__fields[1] = {
- {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, 1},
-};
-
-const upb_msglayout envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_msginit = {
- &envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_submsgs[0],
- &envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat__fields[0],
- UPB_SIZE(8, 16), 1, false,
-};
-
-const upb_msglayout envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_msginit = {
- NULL,
- NULL,
- UPB_SIZE(0, 0), 0, false,
-};
-
-static const upb_msglayout *const envoy_config_core_v3_KeepaliveSettings_submsgs[3] = {
- &envoy_type_v3_Percent_msginit,
- &google_protobuf_Duration_msginit,
-};
-
-static const upb_msglayout_field envoy_config_core_v3_KeepaliveSettings__fields[3] = {
- {1, UPB_SIZE(0, 0), 0, 1, 11, 1},
- {2, UPB_SIZE(4, 8), 0, 1, 11, 1},
- {3, UPB_SIZE(8, 16), 0, 0, 11, 1},
-};
-
-const upb_msglayout envoy_config_core_v3_KeepaliveSettings_msginit = {
- &envoy_config_core_v3_KeepaliveSettings_submsgs[0],
- &envoy_config_core_v3_KeepaliveSettings__fields[0],
- UPB_SIZE(12, 24), 3, false,
-};
-
-static const upb_msglayout *const envoy_config_core_v3_Http2ProtocolOptions_submsgs[12] = {
- &envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_msginit,
- &envoy_config_core_v3_KeepaliveSettings_msginit,
- &google_protobuf_BoolValue_msginit,
- &google_protobuf_UInt32Value_msginit,
-};
-
-static const upb_msglayout_field envoy_config_core_v3_Http2ProtocolOptions__fields[15] = {
- {1, UPB_SIZE(4, 8), 0, 3, 11, 1},
- {2, UPB_SIZE(8, 16), 0, 3, 11, 1},
- {3, UPB_SIZE(12, 24), 0, 3, 11, 1},
- {4, UPB_SIZE(16, 32), 0, 3, 11, 1},
- {5, UPB_SIZE(0, 0), 0, 0, 8, 1},
- {6, UPB_SIZE(1, 1), 0, 0, 8, 1},
- {7, UPB_SIZE(20, 40), 0, 3, 11, 1},
- {8, UPB_SIZE(24, 48), 0, 3, 11, 1},
- {9, UPB_SIZE(28, 56), 0, 3, 11, 1},
- {10, UPB_SIZE(32, 64), 0, 3, 11, 1},
- {11, UPB_SIZE(36, 72), 0, 3, 11, 1},
- {12, UPB_SIZE(2, 2), 0, 0, 8, 1},
- {13, UPB_SIZE(48, 96), 0, 0, 11, 3},
- {14, UPB_SIZE(40, 80), 0, 2, 11, 1},
- {15, UPB_SIZE(44, 88), 0, 1, 11, 1},
-};
-
-const upb_msglayout envoy_config_core_v3_Http2ProtocolOptions_msginit = {
- &envoy_config_core_v3_Http2ProtocolOptions_submsgs[0],
- &envoy_config_core_v3_Http2ProtocolOptions__fields[0],
- UPB_SIZE(52, 104), 15, false,
-};
-
-static const upb_msglayout *const envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_submsgs[2] = {
- &google_protobuf_UInt32Value_msginit,
-};
-
-static const upb_msglayout_field envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
- {2, UPB_SIZE(4, 8), 0, 0, 11, 1},
-};
-
-const upb_msglayout envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_msginit = {
- &envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_submsgs[0],
- &envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter__fields[0],
- UPB_SIZE(8, 16), 2, false,
-};
-
-static const upb_msglayout *const envoy_config_core_v3_GrpcProtocolOptions_submsgs[1] = {
- &envoy_config_core_v3_Http2ProtocolOptions_msginit,
-};
-
-static const upb_msglayout_field envoy_config_core_v3_GrpcProtocolOptions__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
-};
-
-const upb_msglayout envoy_config_core_v3_GrpcProtocolOptions_msginit = {
- &envoy_config_core_v3_GrpcProtocolOptions_submsgs[0],
- &envoy_config_core_v3_GrpcProtocolOptions__fields[0],
- UPB_SIZE(4, 8), 1, false,
-};
-
-#include "upb/port_undef.inc"
-
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/core/v3/protocol.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg.h"
+#include "envoy/config/core/v3/protocol.upb.h"
+#include "envoy/type/v3/percent.upb.h"
+#include "google/protobuf/duration.upb.h"
+#include "google/protobuf/wrappers.upb.h"
+#include "udpa/annotations/status.upb.h"
+#include "udpa/annotations/versioning.upb.h"
+#include "validate/validate.upb.h"
+
+#include "upb/port_def.inc"
+
+const upb_msglayout envoy_config_core_v3_TcpProtocolOptions_msginit = {
+ NULL,
+ NULL,
+ UPB_SIZE(0, 0), 0, false,
+};
+
+static const upb_msglayout_field envoy_config_core_v3_UpstreamHttpProtocolOptions__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 8, 1},
+ {2, UPB_SIZE(1, 1), 0, 0, 8, 1},
+};
+
+const upb_msglayout envoy_config_core_v3_UpstreamHttpProtocolOptions_msginit = {
+ NULL,
+ &envoy_config_core_v3_UpstreamHttpProtocolOptions__fields[0],
+ UPB_SIZE(2, 2), 2, false,
+};
+
+static const upb_msglayout *const envoy_config_core_v3_HttpProtocolOptions_submsgs[4] = {
+ &google_protobuf_Duration_msginit,
+ &google_protobuf_UInt32Value_msginit,
+};
+
+static const upb_msglayout_field envoy_config_core_v3_HttpProtocolOptions__fields[5] = {
+ {1, UPB_SIZE(8, 8), 0, 0, 11, 1},
+ {2, UPB_SIZE(12, 16), 0, 1, 11, 1},
+ {3, UPB_SIZE(16, 24), 0, 0, 11, 1},
+ {4, UPB_SIZE(20, 32), 0, 0, 11, 1},
+ {5, UPB_SIZE(0, 0), 0, 0, 14, 1},
+};
+
+const upb_msglayout envoy_config_core_v3_HttpProtocolOptions_msginit = {
+ &envoy_config_core_v3_HttpProtocolOptions_submsgs[0],
+ &envoy_config_core_v3_HttpProtocolOptions__fields[0],
+ UPB_SIZE(24, 40), 5, false,
+};
+
+static const upb_msglayout *const envoy_config_core_v3_Http1ProtocolOptions_submsgs[3] = {
+ &envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_msginit,
+ &google_protobuf_BoolValue_msginit,
+};
+
+static const upb_msglayout_field envoy_config_core_v3_Http1ProtocolOptions__fields[7] = {
+ {1, UPB_SIZE(12, 24), 0, 1, 11, 1},
+ {2, UPB_SIZE(0, 0), 0, 0, 8, 1},
+ {3, UPB_SIZE(4, 8), 0, 0, 9, 1},
+ {4, UPB_SIZE(16, 32), 0, 0, 11, 1},
+ {5, UPB_SIZE(1, 1), 0, 0, 8, 1},
+ {6, UPB_SIZE(2, 2), 0, 0, 8, 1},
+ {7, UPB_SIZE(20, 40), 0, 1, 11, 1},
+};
+
+const upb_msglayout envoy_config_core_v3_Http1ProtocolOptions_msginit = {
+ &envoy_config_core_v3_Http1ProtocolOptions_submsgs[0],
+ &envoy_config_core_v3_Http1ProtocolOptions__fields[0],
+ UPB_SIZE(24, 48), 7, false,
+};
+
+static const upb_msglayout *const envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_submsgs[1] = {
+ &envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_msginit,
+};
+
+static const upb_msglayout_field envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, 1},
+};
+
+const upb_msglayout envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_msginit = {
+ &envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_submsgs[0],
+ &envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat__fields[0],
+ UPB_SIZE(8, 16), 1, false,
+};
+
+const upb_msglayout envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_msginit = {
+ NULL,
+ NULL,
+ UPB_SIZE(0, 0), 0, false,
+};
+
+static const upb_msglayout *const envoy_config_core_v3_KeepaliveSettings_submsgs[3] = {
+ &envoy_type_v3_Percent_msginit,
+ &google_protobuf_Duration_msginit,
+};
+
+static const upb_msglayout_field envoy_config_core_v3_KeepaliveSettings__fields[3] = {
+ {1, UPB_SIZE(0, 0), 0, 1, 11, 1},
+ {2, UPB_SIZE(4, 8), 0, 1, 11, 1},
+ {3, UPB_SIZE(8, 16), 0, 0, 11, 1},
+};
+
+const upb_msglayout envoy_config_core_v3_KeepaliveSettings_msginit = {
+ &envoy_config_core_v3_KeepaliveSettings_submsgs[0],
+ &envoy_config_core_v3_KeepaliveSettings__fields[0],
+ UPB_SIZE(12, 24), 3, false,
+};
+
+static const upb_msglayout *const envoy_config_core_v3_Http2ProtocolOptions_submsgs[12] = {
+ &envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_msginit,
+ &envoy_config_core_v3_KeepaliveSettings_msginit,
+ &google_protobuf_BoolValue_msginit,
+ &google_protobuf_UInt32Value_msginit,
+};
+
+static const upb_msglayout_field envoy_config_core_v3_Http2ProtocolOptions__fields[15] = {
+ {1, UPB_SIZE(4, 8), 0, 3, 11, 1},
+ {2, UPB_SIZE(8, 16), 0, 3, 11, 1},
+ {3, UPB_SIZE(12, 24), 0, 3, 11, 1},
+ {4, UPB_SIZE(16, 32), 0, 3, 11, 1},
+ {5, UPB_SIZE(0, 0), 0, 0, 8, 1},
+ {6, UPB_SIZE(1, 1), 0, 0, 8, 1},
+ {7, UPB_SIZE(20, 40), 0, 3, 11, 1},
+ {8, UPB_SIZE(24, 48), 0, 3, 11, 1},
+ {9, UPB_SIZE(28, 56), 0, 3, 11, 1},
+ {10, UPB_SIZE(32, 64), 0, 3, 11, 1},
+ {11, UPB_SIZE(36, 72), 0, 3, 11, 1},
+ {12, UPB_SIZE(2, 2), 0, 0, 8, 1},
+ {13, UPB_SIZE(48, 96), 0, 0, 11, 3},
+ {14, UPB_SIZE(40, 80), 0, 2, 11, 1},
+ {15, UPB_SIZE(44, 88), 0, 1, 11, 1},
+};
+
+const upb_msglayout envoy_config_core_v3_Http2ProtocolOptions_msginit = {
+ &envoy_config_core_v3_Http2ProtocolOptions_submsgs[0],
+ &envoy_config_core_v3_Http2ProtocolOptions__fields[0],
+ UPB_SIZE(52, 104), 15, false,
+};
+
+static const upb_msglayout *const envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_submsgs[2] = {
+ &google_protobuf_UInt32Value_msginit,
+};
+
+static const upb_msglayout_field envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
+ {2, UPB_SIZE(4, 8), 0, 0, 11, 1},
+};
+
+const upb_msglayout envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_msginit = {
+ &envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_submsgs[0],
+ &envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter__fields[0],
+ UPB_SIZE(8, 16), 2, false,
+};
+
+static const upb_msglayout *const envoy_config_core_v3_GrpcProtocolOptions_submsgs[1] = {
+ &envoy_config_core_v3_Http2ProtocolOptions_msginit,
+};
+
+static const upb_msglayout_field envoy_config_core_v3_GrpcProtocolOptions__fields[1] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
+};
+
+const upb_msglayout envoy_config_core_v3_GrpcProtocolOptions_msginit = {
+ &envoy_config_core_v3_GrpcProtocolOptions_submsgs[0],
+ &envoy_config_core_v3_GrpcProtocolOptions__fields[0],
+ UPB_SIZE(4, 8), 1, false,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.h
index a40535371b9..d895036236a 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.h
@@ -1,645 +1,645 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/config/core/v3/protocol.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef ENVOY_CONFIG_CORE_V3_PROTOCOL_PROTO_UPB_H_
-#define ENVOY_CONFIG_CORE_V3_PROTOCOL_PROTO_UPB_H_
-
-#include "upb/msg.h"
-#include "upb/decode.h"
-#include "upb/encode.h"
-
-#include "upb/port_def.inc"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct envoy_config_core_v3_TcpProtocolOptions;
-struct envoy_config_core_v3_UpstreamHttpProtocolOptions;
-struct envoy_config_core_v3_HttpProtocolOptions;
-struct envoy_config_core_v3_Http1ProtocolOptions;
-struct envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat;
-struct envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords;
-struct envoy_config_core_v3_KeepaliveSettings;
-struct envoy_config_core_v3_Http2ProtocolOptions;
-struct envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter;
-struct envoy_config_core_v3_GrpcProtocolOptions;
-typedef struct envoy_config_core_v3_TcpProtocolOptions envoy_config_core_v3_TcpProtocolOptions;
-typedef struct envoy_config_core_v3_UpstreamHttpProtocolOptions envoy_config_core_v3_UpstreamHttpProtocolOptions;
-typedef struct envoy_config_core_v3_HttpProtocolOptions envoy_config_core_v3_HttpProtocolOptions;
-typedef struct envoy_config_core_v3_Http1ProtocolOptions envoy_config_core_v3_Http1ProtocolOptions;
-typedef struct envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat;
-typedef struct envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords;
-typedef struct envoy_config_core_v3_KeepaliveSettings envoy_config_core_v3_KeepaliveSettings;
-typedef struct envoy_config_core_v3_Http2ProtocolOptions envoy_config_core_v3_Http2ProtocolOptions;
-typedef struct envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter;
-typedef struct envoy_config_core_v3_GrpcProtocolOptions envoy_config_core_v3_GrpcProtocolOptions;
-extern const upb_msglayout envoy_config_core_v3_TcpProtocolOptions_msginit;
-extern const upb_msglayout envoy_config_core_v3_UpstreamHttpProtocolOptions_msginit;
-extern const upb_msglayout envoy_config_core_v3_HttpProtocolOptions_msginit;
-extern const upb_msglayout envoy_config_core_v3_Http1ProtocolOptions_msginit;
-extern const upb_msglayout envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_msginit;
-extern const upb_msglayout envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_msginit;
-extern const upb_msglayout envoy_config_core_v3_KeepaliveSettings_msginit;
-extern const upb_msglayout envoy_config_core_v3_Http2ProtocolOptions_msginit;
-extern const upb_msglayout envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_msginit;
-extern const upb_msglayout envoy_config_core_v3_GrpcProtocolOptions_msginit;
-struct envoy_type_v3_Percent;
-struct google_protobuf_BoolValue;
-struct google_protobuf_Duration;
-struct google_protobuf_UInt32Value;
-extern const upb_msglayout envoy_type_v3_Percent_msginit;
-extern const upb_msglayout google_protobuf_BoolValue_msginit;
-extern const upb_msglayout google_protobuf_Duration_msginit;
-extern const upb_msglayout google_protobuf_UInt32Value_msginit;
-
-typedef enum {
- envoy_config_core_v3_HttpProtocolOptions_ALLOW = 0,
- envoy_config_core_v3_HttpProtocolOptions_REJECT_REQUEST = 1,
- envoy_config_core_v3_HttpProtocolOptions_DROP_HEADER = 2
-} envoy_config_core_v3_HttpProtocolOptions_HeadersWithUnderscoresAction;
-
-
-/* envoy.config.core.v3.TcpProtocolOptions */
-
-UPB_INLINE envoy_config_core_v3_TcpProtocolOptions *envoy_config_core_v3_TcpProtocolOptions_new(upb_arena *arena) {
- return (envoy_config_core_v3_TcpProtocolOptions *)_upb_msg_new(&envoy_config_core_v3_TcpProtocolOptions_msginit, arena);
-}
-UPB_INLINE envoy_config_core_v3_TcpProtocolOptions *envoy_config_core_v3_TcpProtocolOptions_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_core_v3_TcpProtocolOptions *ret = envoy_config_core_v3_TcpProtocolOptions_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_TcpProtocolOptions_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_core_v3_TcpProtocolOptions_serialize(const envoy_config_core_v3_TcpProtocolOptions *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_core_v3_TcpProtocolOptions_msginit, arena, len);
-}
-
-
-
-/* envoy.config.core.v3.UpstreamHttpProtocolOptions */
-
-UPB_INLINE envoy_config_core_v3_UpstreamHttpProtocolOptions *envoy_config_core_v3_UpstreamHttpProtocolOptions_new(upb_arena *arena) {
- return (envoy_config_core_v3_UpstreamHttpProtocolOptions *)_upb_msg_new(&envoy_config_core_v3_UpstreamHttpProtocolOptions_msginit, arena);
-}
-UPB_INLINE envoy_config_core_v3_UpstreamHttpProtocolOptions *envoy_config_core_v3_UpstreamHttpProtocolOptions_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_core_v3_UpstreamHttpProtocolOptions *ret = envoy_config_core_v3_UpstreamHttpProtocolOptions_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_UpstreamHttpProtocolOptions_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_core_v3_UpstreamHttpProtocolOptions_serialize(const envoy_config_core_v3_UpstreamHttpProtocolOptions *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_core_v3_UpstreamHttpProtocolOptions_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_config_core_v3_UpstreamHttpProtocolOptions_auto_sni(const envoy_config_core_v3_UpstreamHttpProtocolOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); }
-UPB_INLINE bool envoy_config_core_v3_UpstreamHttpProtocolOptions_auto_san_validation(const envoy_config_core_v3_UpstreamHttpProtocolOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); }
-
-UPB_INLINE void envoy_config_core_v3_UpstreamHttpProtocolOptions_set_auto_sni(envoy_config_core_v3_UpstreamHttpProtocolOptions *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
-}
-UPB_INLINE void envoy_config_core_v3_UpstreamHttpProtocolOptions_set_auto_san_validation(envoy_config_core_v3_UpstreamHttpProtocolOptions *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
-}
-
-/* envoy.config.core.v3.HttpProtocolOptions */
-
-UPB_INLINE envoy_config_core_v3_HttpProtocolOptions *envoy_config_core_v3_HttpProtocolOptions_new(upb_arena *arena) {
- return (envoy_config_core_v3_HttpProtocolOptions *)_upb_msg_new(&envoy_config_core_v3_HttpProtocolOptions_msginit, arena);
-}
-UPB_INLINE envoy_config_core_v3_HttpProtocolOptions *envoy_config_core_v3_HttpProtocolOptions_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_core_v3_HttpProtocolOptions *ret = envoy_config_core_v3_HttpProtocolOptions_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_HttpProtocolOptions_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_core_v3_HttpProtocolOptions_serialize(const envoy_config_core_v3_HttpProtocolOptions *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_core_v3_HttpProtocolOptions_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_config_core_v3_HttpProtocolOptions_has_idle_timeout(const envoy_config_core_v3_HttpProtocolOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 8)); }
-UPB_INLINE const struct google_protobuf_Duration* envoy_config_core_v3_HttpProtocolOptions_idle_timeout(const envoy_config_core_v3_HttpProtocolOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const struct google_protobuf_Duration*); }
-UPB_INLINE bool envoy_config_core_v3_HttpProtocolOptions_has_max_headers_count(const envoy_config_core_v3_HttpProtocolOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 16)); }
-UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_core_v3_HttpProtocolOptions_max_headers_count(const envoy_config_core_v3_HttpProtocolOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const struct google_protobuf_UInt32Value*); }
-UPB_INLINE bool envoy_config_core_v3_HttpProtocolOptions_has_max_connection_duration(const envoy_config_core_v3_HttpProtocolOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 24)); }
-UPB_INLINE const struct google_protobuf_Duration* envoy_config_core_v3_HttpProtocolOptions_max_connection_duration(const envoy_config_core_v3_HttpProtocolOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const struct google_protobuf_Duration*); }
-UPB_INLINE bool envoy_config_core_v3_HttpProtocolOptions_has_max_stream_duration(const envoy_config_core_v3_HttpProtocolOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 32)); }
-UPB_INLINE const struct google_protobuf_Duration* envoy_config_core_v3_HttpProtocolOptions_max_stream_duration(const envoy_config_core_v3_HttpProtocolOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const struct google_protobuf_Duration*); }
-UPB_INLINE int32_t envoy_config_core_v3_HttpProtocolOptions_headers_with_underscores_action(const envoy_config_core_v3_HttpProtocolOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
-
-UPB_INLINE void envoy_config_core_v3_HttpProtocolOptions_set_idle_timeout(envoy_config_core_v3_HttpProtocolOptions *msg, struct google_protobuf_Duration* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), struct google_protobuf_Duration*) = value;
-}
-UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_HttpProtocolOptions_mutable_idle_timeout(envoy_config_core_v3_HttpProtocolOptions *msg, upb_arena *arena) {
- struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_core_v3_HttpProtocolOptions_idle_timeout(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_HttpProtocolOptions_set_idle_timeout(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_core_v3_HttpProtocolOptions_set_max_headers_count(envoy_config_core_v3_HttpProtocolOptions *msg, struct google_protobuf_UInt32Value* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(12, 16), struct google_protobuf_UInt32Value*) = value;
-}
-UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_HttpProtocolOptions_mutable_max_headers_count(envoy_config_core_v3_HttpProtocolOptions *msg, upb_arena *arena) {
- struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_core_v3_HttpProtocolOptions_max_headers_count(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_HttpProtocolOptions_set_max_headers_count(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_core_v3_HttpProtocolOptions_set_max_connection_duration(envoy_config_core_v3_HttpProtocolOptions *msg, struct google_protobuf_Duration* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(16, 24), struct google_protobuf_Duration*) = value;
-}
-UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_HttpProtocolOptions_mutable_max_connection_duration(envoy_config_core_v3_HttpProtocolOptions *msg, upb_arena *arena) {
- struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_core_v3_HttpProtocolOptions_max_connection_duration(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_HttpProtocolOptions_set_max_connection_duration(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_core_v3_HttpProtocolOptions_set_max_stream_duration(envoy_config_core_v3_HttpProtocolOptions *msg, struct google_protobuf_Duration* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(20, 32), struct google_protobuf_Duration*) = value;
-}
-UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_HttpProtocolOptions_mutable_max_stream_duration(envoy_config_core_v3_HttpProtocolOptions *msg, upb_arena *arena) {
- struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_core_v3_HttpProtocolOptions_max_stream_duration(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_HttpProtocolOptions_set_max_stream_duration(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_core_v3_HttpProtocolOptions_set_headers_with_underscores_action(envoy_config_core_v3_HttpProtocolOptions *msg, int32_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
-}
-
-/* envoy.config.core.v3.Http1ProtocolOptions */
-
-UPB_INLINE envoy_config_core_v3_Http1ProtocolOptions *envoy_config_core_v3_Http1ProtocolOptions_new(upb_arena *arena) {
- return (envoy_config_core_v3_Http1ProtocolOptions *)_upb_msg_new(&envoy_config_core_v3_Http1ProtocolOptions_msginit, arena);
-}
-UPB_INLINE envoy_config_core_v3_Http1ProtocolOptions *envoy_config_core_v3_Http1ProtocolOptions_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_core_v3_Http1ProtocolOptions *ret = envoy_config_core_v3_Http1ProtocolOptions_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_Http1ProtocolOptions_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_core_v3_Http1ProtocolOptions_serialize(const envoy_config_core_v3_Http1ProtocolOptions *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_core_v3_Http1ProtocolOptions_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_config_core_v3_Http1ProtocolOptions_has_allow_absolute_url(const envoy_config_core_v3_Http1ProtocolOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
-UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_core_v3_Http1ProtocolOptions_allow_absolute_url(const envoy_config_core_v3_Http1ProtocolOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_protobuf_BoolValue*); }
-UPB_INLINE bool envoy_config_core_v3_Http1ProtocolOptions_accept_http_10(const envoy_config_core_v3_Http1ProtocolOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); }
-UPB_INLINE upb_strview envoy_config_core_v3_Http1ProtocolOptions_default_host_for_http_10(const envoy_config_core_v3_Http1ProtocolOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
-UPB_INLINE bool envoy_config_core_v3_Http1ProtocolOptions_has_header_key_format(const envoy_config_core_v3_Http1ProtocolOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); }
-UPB_INLINE const envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat* envoy_config_core_v3_Http1ProtocolOptions_header_key_format(const envoy_config_core_v3_Http1ProtocolOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat*); }
-UPB_INLINE bool envoy_config_core_v3_Http1ProtocolOptions_enable_trailers(const envoy_config_core_v3_Http1ProtocolOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); }
-UPB_INLINE bool envoy_config_core_v3_Http1ProtocolOptions_allow_chunked_length(const envoy_config_core_v3_Http1ProtocolOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool); }
-UPB_INLINE bool envoy_config_core_v3_Http1ProtocolOptions_has_override_stream_error_on_invalid_http_message(const envoy_config_core_v3_Http1ProtocolOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 40)); }
-UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_core_v3_Http1ProtocolOptions_override_stream_error_on_invalid_http_message(const envoy_config_core_v3_Http1ProtocolOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const struct google_protobuf_BoolValue*); }
-
-UPB_INLINE void envoy_config_core_v3_Http1ProtocolOptions_set_allow_absolute_url(envoy_config_core_v3_Http1ProtocolOptions *msg, struct google_protobuf_BoolValue* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_protobuf_BoolValue*) = value;
-}
-UPB_INLINE struct google_protobuf_BoolValue* envoy_config_core_v3_Http1ProtocolOptions_mutable_allow_absolute_url(envoy_config_core_v3_Http1ProtocolOptions *msg, upb_arena *arena) {
- struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_core_v3_Http1ProtocolOptions_allow_absolute_url(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_BoolValue*)_upb_msg_new(&google_protobuf_BoolValue_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_Http1ProtocolOptions_set_allow_absolute_url(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_core_v3_Http1ProtocolOptions_set_accept_http_10(envoy_config_core_v3_Http1ProtocolOptions *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
-}
-UPB_INLINE void envoy_config_core_v3_Http1ProtocolOptions_set_default_host_for_http_10(envoy_config_core_v3_Http1ProtocolOptions *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_core_v3_Http1ProtocolOptions_set_header_key_format(envoy_config_core_v3_Http1ProtocolOptions *msg, envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(16, 32), envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat*) = value;
-}
-UPB_INLINE struct envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat* envoy_config_core_v3_Http1ProtocolOptions_mutable_header_key_format(envoy_config_core_v3_Http1ProtocolOptions *msg, upb_arena *arena) {
- struct envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat* sub = (struct envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat*)envoy_config_core_v3_Http1ProtocolOptions_header_key_format(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat*)_upb_msg_new(&envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_Http1ProtocolOptions_set_header_key_format(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_core_v3_Http1ProtocolOptions_set_enable_trailers(envoy_config_core_v3_Http1ProtocolOptions *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
-}
-UPB_INLINE void envoy_config_core_v3_Http1ProtocolOptions_set_allow_chunked_length(envoy_config_core_v3_Http1ProtocolOptions *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = value;
-}
-UPB_INLINE void envoy_config_core_v3_Http1ProtocolOptions_set_override_stream_error_on_invalid_http_message(envoy_config_core_v3_Http1ProtocolOptions *msg, struct google_protobuf_BoolValue* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(20, 40), struct google_protobuf_BoolValue*) = value;
-}
-UPB_INLINE struct google_protobuf_BoolValue* envoy_config_core_v3_Http1ProtocolOptions_mutable_override_stream_error_on_invalid_http_message(envoy_config_core_v3_Http1ProtocolOptions *msg, upb_arena *arena) {
- struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_core_v3_Http1ProtocolOptions_override_stream_error_on_invalid_http_message(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_BoolValue*)_upb_msg_new(&google_protobuf_BoolValue_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_Http1ProtocolOptions_set_override_stream_error_on_invalid_http_message(msg, sub);
- }
- return sub;
-}
-
-/* envoy.config.core.v3.Http1ProtocolOptions.HeaderKeyFormat */
-
-UPB_INLINE envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat *envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_new(upb_arena *arena) {
- return (envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat *)_upb_msg_new(&envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_msginit, arena);
-}
-UPB_INLINE envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat *envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat *ret = envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_serialize(const envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_msginit, arena, len);
-}
-
-typedef enum {
- envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_header_format_proper_case_words = 1,
- envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_header_format_NOT_SET = 0
-} envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_header_format_oneofcases;
-UPB_INLINE envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_header_format_oneofcases envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_header_format_case(const envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat* msg) { return (envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_header_format_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 8), int32_t); }
-
-UPB_INLINE bool envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_has_proper_case_words(const envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 1; }
-UPB_INLINE const envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords* envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_proper_case_words(const envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat *msg) { return UPB_READ_ONEOF(msg, const envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 1, NULL); }
-
-UPB_INLINE void envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_set_proper_case_words(envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat *msg, envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 1);
-}
-UPB_INLINE struct envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords* envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_mutable_proper_case_words(envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat *msg, upb_arena *arena) {
- struct envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords* sub = (struct envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords*)envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_proper_case_words(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords*)_upb_msg_new(&envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_set_proper_case_words(msg, sub);
- }
- return sub;
-}
-
-/* envoy.config.core.v3.Http1ProtocolOptions.HeaderKeyFormat.ProperCaseWords */
-
-UPB_INLINE envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords *envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_new(upb_arena *arena) {
- return (envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords *)_upb_msg_new(&envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_msginit, arena);
-}
-UPB_INLINE envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords *envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords *ret = envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_serialize(const envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_msginit, arena, len);
-}
-
-
-
-/* envoy.config.core.v3.KeepaliveSettings */
-
-UPB_INLINE envoy_config_core_v3_KeepaliveSettings *envoy_config_core_v3_KeepaliveSettings_new(upb_arena *arena) {
- return (envoy_config_core_v3_KeepaliveSettings *)_upb_msg_new(&envoy_config_core_v3_KeepaliveSettings_msginit, arena);
-}
-UPB_INLINE envoy_config_core_v3_KeepaliveSettings *envoy_config_core_v3_KeepaliveSettings_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_core_v3_KeepaliveSettings *ret = envoy_config_core_v3_KeepaliveSettings_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_KeepaliveSettings_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_core_v3_KeepaliveSettings_serialize(const envoy_config_core_v3_KeepaliveSettings *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_core_v3_KeepaliveSettings_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_config_core_v3_KeepaliveSettings_has_interval(const envoy_config_core_v3_KeepaliveSettings *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE const struct google_protobuf_Duration* envoy_config_core_v3_KeepaliveSettings_interval(const envoy_config_core_v3_KeepaliveSettings *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct google_protobuf_Duration*); }
-UPB_INLINE bool envoy_config_core_v3_KeepaliveSettings_has_timeout(const envoy_config_core_v3_KeepaliveSettings *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
-UPB_INLINE const struct google_protobuf_Duration* envoy_config_core_v3_KeepaliveSettings_timeout(const envoy_config_core_v3_KeepaliveSettings *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_Duration*); }
-UPB_INLINE bool envoy_config_core_v3_KeepaliveSettings_has_interval_jitter(const envoy_config_core_v3_KeepaliveSettings *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const struct envoy_type_v3_Percent* envoy_config_core_v3_KeepaliveSettings_interval_jitter(const envoy_config_core_v3_KeepaliveSettings *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct envoy_type_v3_Percent*); }
-
-UPB_INLINE void envoy_config_core_v3_KeepaliveSettings_set_interval(envoy_config_core_v3_KeepaliveSettings *msg, struct google_protobuf_Duration* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct google_protobuf_Duration*) = value;
-}
-UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_KeepaliveSettings_mutable_interval(envoy_config_core_v3_KeepaliveSettings *msg, upb_arena *arena) {
- struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_core_v3_KeepaliveSettings_interval(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_KeepaliveSettings_set_interval(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_core_v3_KeepaliveSettings_set_timeout(envoy_config_core_v3_KeepaliveSettings *msg, struct google_protobuf_Duration* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_Duration*) = value;
-}
-UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_KeepaliveSettings_mutable_timeout(envoy_config_core_v3_KeepaliveSettings *msg, upb_arena *arena) {
- struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_core_v3_KeepaliveSettings_timeout(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_KeepaliveSettings_set_timeout(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_core_v3_KeepaliveSettings_set_interval_jitter(envoy_config_core_v3_KeepaliveSettings *msg, struct envoy_type_v3_Percent* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct envoy_type_v3_Percent*) = value;
-}
-UPB_INLINE struct envoy_type_v3_Percent* envoy_config_core_v3_KeepaliveSettings_mutable_interval_jitter(envoy_config_core_v3_KeepaliveSettings *msg, upb_arena *arena) {
- struct envoy_type_v3_Percent* sub = (struct envoy_type_v3_Percent*)envoy_config_core_v3_KeepaliveSettings_interval_jitter(msg);
- if (sub == NULL) {
- sub = (struct envoy_type_v3_Percent*)_upb_msg_new(&envoy_type_v3_Percent_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_KeepaliveSettings_set_interval_jitter(msg, sub);
- }
- return sub;
-}
-
-/* envoy.config.core.v3.Http2ProtocolOptions */
-
-UPB_INLINE envoy_config_core_v3_Http2ProtocolOptions *envoy_config_core_v3_Http2ProtocolOptions_new(upb_arena *arena) {
- return (envoy_config_core_v3_Http2ProtocolOptions *)_upb_msg_new(&envoy_config_core_v3_Http2ProtocolOptions_msginit, arena);
-}
-UPB_INLINE envoy_config_core_v3_Http2ProtocolOptions *envoy_config_core_v3_Http2ProtocolOptions_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_core_v3_Http2ProtocolOptions *ret = envoy_config_core_v3_Http2ProtocolOptions_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_Http2ProtocolOptions_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_core_v3_Http2ProtocolOptions_serialize(const envoy_config_core_v3_Http2ProtocolOptions *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_core_v3_Http2ProtocolOptions_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_config_core_v3_Http2ProtocolOptions_has_hpack_table_size(const envoy_config_core_v3_Http2ProtocolOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
-UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_core_v3_Http2ProtocolOptions_hpack_table_size(const envoy_config_core_v3_Http2ProtocolOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_UInt32Value*); }
-UPB_INLINE bool envoy_config_core_v3_Http2ProtocolOptions_has_max_concurrent_streams(const envoy_config_core_v3_Http2ProtocolOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_core_v3_Http2ProtocolOptions_max_concurrent_streams(const envoy_config_core_v3_Http2ProtocolOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_UInt32Value*); }
-UPB_INLINE bool envoy_config_core_v3_Http2ProtocolOptions_has_initial_stream_window_size(const envoy_config_core_v3_Http2ProtocolOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
-UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_core_v3_Http2ProtocolOptions_initial_stream_window_size(const envoy_config_core_v3_Http2ProtocolOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_protobuf_UInt32Value*); }
-UPB_INLINE bool envoy_config_core_v3_Http2ProtocolOptions_has_initial_connection_window_size(const envoy_config_core_v3_Http2ProtocolOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); }
-UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_core_v3_Http2ProtocolOptions_initial_connection_window_size(const envoy_config_core_v3_Http2ProtocolOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const struct google_protobuf_UInt32Value*); }
-UPB_INLINE bool envoy_config_core_v3_Http2ProtocolOptions_allow_connect(const envoy_config_core_v3_Http2ProtocolOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); }
-UPB_INLINE bool envoy_config_core_v3_Http2ProtocolOptions_allow_metadata(const envoy_config_core_v3_Http2ProtocolOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); }
-UPB_INLINE bool envoy_config_core_v3_Http2ProtocolOptions_has_max_outbound_frames(const envoy_config_core_v3_Http2ProtocolOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 40)); }
-UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_core_v3_Http2ProtocolOptions_max_outbound_frames(const envoy_config_core_v3_Http2ProtocolOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const struct google_protobuf_UInt32Value*); }
-UPB_INLINE bool envoy_config_core_v3_Http2ProtocolOptions_has_max_outbound_control_frames(const envoy_config_core_v3_Http2ProtocolOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 48)); }
-UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_core_v3_Http2ProtocolOptions_max_outbound_control_frames(const envoy_config_core_v3_Http2ProtocolOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 48), const struct google_protobuf_UInt32Value*); }
-UPB_INLINE bool envoy_config_core_v3_Http2ProtocolOptions_has_max_consecutive_inbound_frames_with_empty_payload(const envoy_config_core_v3_Http2ProtocolOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 56)); }
-UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_core_v3_Http2ProtocolOptions_max_consecutive_inbound_frames_with_empty_payload(const envoy_config_core_v3_Http2ProtocolOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 56), const struct google_protobuf_UInt32Value*); }
-UPB_INLINE bool envoy_config_core_v3_Http2ProtocolOptions_has_max_inbound_priority_frames_per_stream(const envoy_config_core_v3_Http2ProtocolOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(32, 64)); }
-UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_core_v3_Http2ProtocolOptions_max_inbound_priority_frames_per_stream(const envoy_config_core_v3_Http2ProtocolOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 64), const struct google_protobuf_UInt32Value*); }
-UPB_INLINE bool envoy_config_core_v3_Http2ProtocolOptions_has_max_inbound_window_update_frames_per_data_frame_sent(const envoy_config_core_v3_Http2ProtocolOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(36, 72)); }
-UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_core_v3_Http2ProtocolOptions_max_inbound_window_update_frames_per_data_frame_sent(const envoy_config_core_v3_Http2ProtocolOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(36, 72), const struct google_protobuf_UInt32Value*); }
-UPB_INLINE bool envoy_config_core_v3_Http2ProtocolOptions_stream_error_on_invalid_http_messaging(const envoy_config_core_v3_Http2ProtocolOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool); }
-UPB_INLINE bool envoy_config_core_v3_Http2ProtocolOptions_has_custom_settings_parameters(const envoy_config_core_v3_Http2ProtocolOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(48, 96)); }
-UPB_INLINE const envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter* const* envoy_config_core_v3_Http2ProtocolOptions_custom_settings_parameters(const envoy_config_core_v3_Http2ProtocolOptions *msg, size_t *len) { return (const envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter* const*)_upb_array_accessor(msg, UPB_SIZE(48, 96), len); }
-UPB_INLINE bool envoy_config_core_v3_Http2ProtocolOptions_has_override_stream_error_on_invalid_http_message(const envoy_config_core_v3_Http2ProtocolOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(40, 80)); }
-UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_core_v3_Http2ProtocolOptions_override_stream_error_on_invalid_http_message(const envoy_config_core_v3_Http2ProtocolOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(40, 80), const struct google_protobuf_BoolValue*); }
-UPB_INLINE bool envoy_config_core_v3_Http2ProtocolOptions_has_connection_keepalive(const envoy_config_core_v3_Http2ProtocolOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(44, 88)); }
-UPB_INLINE const envoy_config_core_v3_KeepaliveSettings* envoy_config_core_v3_Http2ProtocolOptions_connection_keepalive(const envoy_config_core_v3_Http2ProtocolOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(44, 88), const envoy_config_core_v3_KeepaliveSettings*); }
-
-UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_set_hpack_table_size(envoy_config_core_v3_Http2ProtocolOptions *msg, struct google_protobuf_UInt32Value* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_UInt32Value*) = value;
-}
-UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_Http2ProtocolOptions_mutable_hpack_table_size(envoy_config_core_v3_Http2ProtocolOptions *msg, upb_arena *arena) {
- struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_core_v3_Http2ProtocolOptions_hpack_table_size(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_Http2ProtocolOptions_set_hpack_table_size(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_set_max_concurrent_streams(envoy_config_core_v3_Http2ProtocolOptions *msg, struct google_protobuf_UInt32Value* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_UInt32Value*) = value;
-}
-UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_Http2ProtocolOptions_mutable_max_concurrent_streams(envoy_config_core_v3_Http2ProtocolOptions *msg, upb_arena *arena) {
- struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_core_v3_Http2ProtocolOptions_max_concurrent_streams(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_Http2ProtocolOptions_set_max_concurrent_streams(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_set_initial_stream_window_size(envoy_config_core_v3_Http2ProtocolOptions *msg, struct google_protobuf_UInt32Value* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_protobuf_UInt32Value*) = value;
-}
-UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_Http2ProtocolOptions_mutable_initial_stream_window_size(envoy_config_core_v3_Http2ProtocolOptions *msg, upb_arena *arena) {
- struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_core_v3_Http2ProtocolOptions_initial_stream_window_size(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_Http2ProtocolOptions_set_initial_stream_window_size(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_set_initial_connection_window_size(envoy_config_core_v3_Http2ProtocolOptions *msg, struct google_protobuf_UInt32Value* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(16, 32), struct google_protobuf_UInt32Value*) = value;
-}
-UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_Http2ProtocolOptions_mutable_initial_connection_window_size(envoy_config_core_v3_Http2ProtocolOptions *msg, upb_arena *arena) {
- struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_core_v3_Http2ProtocolOptions_initial_connection_window_size(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_Http2ProtocolOptions_set_initial_connection_window_size(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_set_allow_connect(envoy_config_core_v3_Http2ProtocolOptions *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
-}
-UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_set_allow_metadata(envoy_config_core_v3_Http2ProtocolOptions *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
-}
-UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_set_max_outbound_frames(envoy_config_core_v3_Http2ProtocolOptions *msg, struct google_protobuf_UInt32Value* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(20, 40), struct google_protobuf_UInt32Value*) = value;
-}
-UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_Http2ProtocolOptions_mutable_max_outbound_frames(envoy_config_core_v3_Http2ProtocolOptions *msg, upb_arena *arena) {
- struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_core_v3_Http2ProtocolOptions_max_outbound_frames(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_Http2ProtocolOptions_set_max_outbound_frames(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_set_max_outbound_control_frames(envoy_config_core_v3_Http2ProtocolOptions *msg, struct google_protobuf_UInt32Value* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(24, 48), struct google_protobuf_UInt32Value*) = value;
-}
-UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_Http2ProtocolOptions_mutable_max_outbound_control_frames(envoy_config_core_v3_Http2ProtocolOptions *msg, upb_arena *arena) {
- struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_core_v3_Http2ProtocolOptions_max_outbound_control_frames(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_Http2ProtocolOptions_set_max_outbound_control_frames(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_set_max_consecutive_inbound_frames_with_empty_payload(envoy_config_core_v3_Http2ProtocolOptions *msg, struct google_protobuf_UInt32Value* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(28, 56), struct google_protobuf_UInt32Value*) = value;
-}
-UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_Http2ProtocolOptions_mutable_max_consecutive_inbound_frames_with_empty_payload(envoy_config_core_v3_Http2ProtocolOptions *msg, upb_arena *arena) {
- struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_core_v3_Http2ProtocolOptions_max_consecutive_inbound_frames_with_empty_payload(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_Http2ProtocolOptions_set_max_consecutive_inbound_frames_with_empty_payload(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_set_max_inbound_priority_frames_per_stream(envoy_config_core_v3_Http2ProtocolOptions *msg, struct google_protobuf_UInt32Value* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(32, 64), struct google_protobuf_UInt32Value*) = value;
-}
-UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_Http2ProtocolOptions_mutable_max_inbound_priority_frames_per_stream(envoy_config_core_v3_Http2ProtocolOptions *msg, upb_arena *arena) {
- struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_core_v3_Http2ProtocolOptions_max_inbound_priority_frames_per_stream(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_Http2ProtocolOptions_set_max_inbound_priority_frames_per_stream(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_set_max_inbound_window_update_frames_per_data_frame_sent(envoy_config_core_v3_Http2ProtocolOptions *msg, struct google_protobuf_UInt32Value* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(36, 72), struct google_protobuf_UInt32Value*) = value;
-}
-UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_Http2ProtocolOptions_mutable_max_inbound_window_update_frames_per_data_frame_sent(envoy_config_core_v3_Http2ProtocolOptions *msg, upb_arena *arena) {
- struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_core_v3_Http2ProtocolOptions_max_inbound_window_update_frames_per_data_frame_sent(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_Http2ProtocolOptions_set_max_inbound_window_update_frames_per_data_frame_sent(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_set_stream_error_on_invalid_http_messaging(envoy_config_core_v3_Http2ProtocolOptions *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = value;
-}
-UPB_INLINE envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter** envoy_config_core_v3_Http2ProtocolOptions_mutable_custom_settings_parameters(envoy_config_core_v3_Http2ProtocolOptions *msg, size_t *len) {
- return (envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter**)_upb_array_mutable_accessor(msg, UPB_SIZE(48, 96), len);
-}
-UPB_INLINE envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter** envoy_config_core_v3_Http2ProtocolOptions_resize_custom_settings_parameters(envoy_config_core_v3_Http2ProtocolOptions *msg, size_t len, upb_arena *arena) {
- return (envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter**)_upb_array_resize_accessor(msg, UPB_SIZE(48, 96), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter* envoy_config_core_v3_Http2ProtocolOptions_add_custom_settings_parameters(envoy_config_core_v3_Http2ProtocolOptions *msg, upb_arena *arena) {
- struct envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter* sub = (struct envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter*)_upb_msg_new(&envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(48, 96), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_set_override_stream_error_on_invalid_http_message(envoy_config_core_v3_Http2ProtocolOptions *msg, struct google_protobuf_BoolValue* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(40, 80), struct google_protobuf_BoolValue*) = value;
-}
-UPB_INLINE struct google_protobuf_BoolValue* envoy_config_core_v3_Http2ProtocolOptions_mutable_override_stream_error_on_invalid_http_message(envoy_config_core_v3_Http2ProtocolOptions *msg, upb_arena *arena) {
- struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_core_v3_Http2ProtocolOptions_override_stream_error_on_invalid_http_message(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_BoolValue*)_upb_msg_new(&google_protobuf_BoolValue_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_Http2ProtocolOptions_set_override_stream_error_on_invalid_http_message(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_set_connection_keepalive(envoy_config_core_v3_Http2ProtocolOptions *msg, envoy_config_core_v3_KeepaliveSettings* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(44, 88), envoy_config_core_v3_KeepaliveSettings*) = value;
-}
-UPB_INLINE struct envoy_config_core_v3_KeepaliveSettings* envoy_config_core_v3_Http2ProtocolOptions_mutable_connection_keepalive(envoy_config_core_v3_Http2ProtocolOptions *msg, upb_arena *arena) {
- struct envoy_config_core_v3_KeepaliveSettings* sub = (struct envoy_config_core_v3_KeepaliveSettings*)envoy_config_core_v3_Http2ProtocolOptions_connection_keepalive(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_KeepaliveSettings*)_upb_msg_new(&envoy_config_core_v3_KeepaliveSettings_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_Http2ProtocolOptions_set_connection_keepalive(msg, sub);
- }
- return sub;
-}
-
-/* envoy.config.core.v3.Http2ProtocolOptions.SettingsParameter */
-
-UPB_INLINE envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter *envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_new(upb_arena *arena) {
- return (envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter *)_upb_msg_new(&envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_msginit, arena);
-}
-UPB_INLINE envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter *envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter *ret = envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_serialize(const envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_has_identifier(const envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_identifier(const envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct google_protobuf_UInt32Value*); }
-UPB_INLINE bool envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_has_value(const envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
-UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_value(const envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_UInt32Value*); }
-
-UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_set_identifier(envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter *msg, struct google_protobuf_UInt32Value* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct google_protobuf_UInt32Value*) = value;
-}
-UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_mutable_identifier(envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter *msg, upb_arena *arena) {
- struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_identifier(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_set_identifier(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_set_value(envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter *msg, struct google_protobuf_UInt32Value* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_UInt32Value*) = value;
-}
-UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_mutable_value(envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter *msg, upb_arena *arena) {
- struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_value(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_set_value(msg, sub);
- }
- return sub;
-}
-
-/* envoy.config.core.v3.GrpcProtocolOptions */
-
-UPB_INLINE envoy_config_core_v3_GrpcProtocolOptions *envoy_config_core_v3_GrpcProtocolOptions_new(upb_arena *arena) {
- return (envoy_config_core_v3_GrpcProtocolOptions *)_upb_msg_new(&envoy_config_core_v3_GrpcProtocolOptions_msginit, arena);
-}
-UPB_INLINE envoy_config_core_v3_GrpcProtocolOptions *envoy_config_core_v3_GrpcProtocolOptions_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_core_v3_GrpcProtocolOptions *ret = envoy_config_core_v3_GrpcProtocolOptions_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_GrpcProtocolOptions_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_core_v3_GrpcProtocolOptions_serialize(const envoy_config_core_v3_GrpcProtocolOptions *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_core_v3_GrpcProtocolOptions_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_config_core_v3_GrpcProtocolOptions_has_http2_protocol_options(const envoy_config_core_v3_GrpcProtocolOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE const envoy_config_core_v3_Http2ProtocolOptions* envoy_config_core_v3_GrpcProtocolOptions_http2_protocol_options(const envoy_config_core_v3_GrpcProtocolOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const envoy_config_core_v3_Http2ProtocolOptions*); }
-
-UPB_INLINE void envoy_config_core_v3_GrpcProtocolOptions_set_http2_protocol_options(envoy_config_core_v3_GrpcProtocolOptions *msg, envoy_config_core_v3_Http2ProtocolOptions* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), envoy_config_core_v3_Http2ProtocolOptions*) = value;
-}
-UPB_INLINE struct envoy_config_core_v3_Http2ProtocolOptions* envoy_config_core_v3_GrpcProtocolOptions_mutable_http2_protocol_options(envoy_config_core_v3_GrpcProtocolOptions *msg, upb_arena *arena) {
- struct envoy_config_core_v3_Http2ProtocolOptions* sub = (struct envoy_config_core_v3_Http2ProtocolOptions*)envoy_config_core_v3_GrpcProtocolOptions_http2_protocol_options(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_Http2ProtocolOptions*)_upb_msg_new(&envoy_config_core_v3_Http2ProtocolOptions_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_GrpcProtocolOptions_set_http2_protocol_options(msg, sub);
- }
- return sub;
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* ENVOY_CONFIG_CORE_V3_PROTOCOL_PROTO_UPB_H_ */
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/core/v3/protocol.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_CONFIG_CORE_V3_PROTOCOL_PROTO_UPB_H_
+#define ENVOY_CONFIG_CORE_V3_PROTOCOL_PROTO_UPB_H_
+
+#include "upb/msg.h"
+#include "upb/decode.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_config_core_v3_TcpProtocolOptions;
+struct envoy_config_core_v3_UpstreamHttpProtocolOptions;
+struct envoy_config_core_v3_HttpProtocolOptions;
+struct envoy_config_core_v3_Http1ProtocolOptions;
+struct envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat;
+struct envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords;
+struct envoy_config_core_v3_KeepaliveSettings;
+struct envoy_config_core_v3_Http2ProtocolOptions;
+struct envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter;
+struct envoy_config_core_v3_GrpcProtocolOptions;
+typedef struct envoy_config_core_v3_TcpProtocolOptions envoy_config_core_v3_TcpProtocolOptions;
+typedef struct envoy_config_core_v3_UpstreamHttpProtocolOptions envoy_config_core_v3_UpstreamHttpProtocolOptions;
+typedef struct envoy_config_core_v3_HttpProtocolOptions envoy_config_core_v3_HttpProtocolOptions;
+typedef struct envoy_config_core_v3_Http1ProtocolOptions envoy_config_core_v3_Http1ProtocolOptions;
+typedef struct envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat;
+typedef struct envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords;
+typedef struct envoy_config_core_v3_KeepaliveSettings envoy_config_core_v3_KeepaliveSettings;
+typedef struct envoy_config_core_v3_Http2ProtocolOptions envoy_config_core_v3_Http2ProtocolOptions;
+typedef struct envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter;
+typedef struct envoy_config_core_v3_GrpcProtocolOptions envoy_config_core_v3_GrpcProtocolOptions;
+extern const upb_msglayout envoy_config_core_v3_TcpProtocolOptions_msginit;
+extern const upb_msglayout envoy_config_core_v3_UpstreamHttpProtocolOptions_msginit;
+extern const upb_msglayout envoy_config_core_v3_HttpProtocolOptions_msginit;
+extern const upb_msglayout envoy_config_core_v3_Http1ProtocolOptions_msginit;
+extern const upb_msglayout envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_msginit;
+extern const upb_msglayout envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_msginit;
+extern const upb_msglayout envoy_config_core_v3_KeepaliveSettings_msginit;
+extern const upb_msglayout envoy_config_core_v3_Http2ProtocolOptions_msginit;
+extern const upb_msglayout envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_msginit;
+extern const upb_msglayout envoy_config_core_v3_GrpcProtocolOptions_msginit;
+struct envoy_type_v3_Percent;
+struct google_protobuf_BoolValue;
+struct google_protobuf_Duration;
+struct google_protobuf_UInt32Value;
+extern const upb_msglayout envoy_type_v3_Percent_msginit;
+extern const upb_msglayout google_protobuf_BoolValue_msginit;
+extern const upb_msglayout google_protobuf_Duration_msginit;
+extern const upb_msglayout google_protobuf_UInt32Value_msginit;
+
+typedef enum {
+ envoy_config_core_v3_HttpProtocolOptions_ALLOW = 0,
+ envoy_config_core_v3_HttpProtocolOptions_REJECT_REQUEST = 1,
+ envoy_config_core_v3_HttpProtocolOptions_DROP_HEADER = 2
+} envoy_config_core_v3_HttpProtocolOptions_HeadersWithUnderscoresAction;
+
+
+/* envoy.config.core.v3.TcpProtocolOptions */
+
+UPB_INLINE envoy_config_core_v3_TcpProtocolOptions *envoy_config_core_v3_TcpProtocolOptions_new(upb_arena *arena) {
+ return (envoy_config_core_v3_TcpProtocolOptions *)_upb_msg_new(&envoy_config_core_v3_TcpProtocolOptions_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_TcpProtocolOptions *envoy_config_core_v3_TcpProtocolOptions_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_core_v3_TcpProtocolOptions *ret = envoy_config_core_v3_TcpProtocolOptions_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_TcpProtocolOptions_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_core_v3_TcpProtocolOptions_serialize(const envoy_config_core_v3_TcpProtocolOptions *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_core_v3_TcpProtocolOptions_msginit, arena, len);
+}
+
+
+
+/* envoy.config.core.v3.UpstreamHttpProtocolOptions */
+
+UPB_INLINE envoy_config_core_v3_UpstreamHttpProtocolOptions *envoy_config_core_v3_UpstreamHttpProtocolOptions_new(upb_arena *arena) {
+ return (envoy_config_core_v3_UpstreamHttpProtocolOptions *)_upb_msg_new(&envoy_config_core_v3_UpstreamHttpProtocolOptions_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_UpstreamHttpProtocolOptions *envoy_config_core_v3_UpstreamHttpProtocolOptions_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_core_v3_UpstreamHttpProtocolOptions *ret = envoy_config_core_v3_UpstreamHttpProtocolOptions_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_UpstreamHttpProtocolOptions_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_core_v3_UpstreamHttpProtocolOptions_serialize(const envoy_config_core_v3_UpstreamHttpProtocolOptions *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_core_v3_UpstreamHttpProtocolOptions_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_core_v3_UpstreamHttpProtocolOptions_auto_sni(const envoy_config_core_v3_UpstreamHttpProtocolOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); }
+UPB_INLINE bool envoy_config_core_v3_UpstreamHttpProtocolOptions_auto_san_validation(const envoy_config_core_v3_UpstreamHttpProtocolOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); }
+
+UPB_INLINE void envoy_config_core_v3_UpstreamHttpProtocolOptions_set_auto_sni(envoy_config_core_v3_UpstreamHttpProtocolOptions *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
+}
+UPB_INLINE void envoy_config_core_v3_UpstreamHttpProtocolOptions_set_auto_san_validation(envoy_config_core_v3_UpstreamHttpProtocolOptions *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
+}
+
+/* envoy.config.core.v3.HttpProtocolOptions */
+
+UPB_INLINE envoy_config_core_v3_HttpProtocolOptions *envoy_config_core_v3_HttpProtocolOptions_new(upb_arena *arena) {
+ return (envoy_config_core_v3_HttpProtocolOptions *)_upb_msg_new(&envoy_config_core_v3_HttpProtocolOptions_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_HttpProtocolOptions *envoy_config_core_v3_HttpProtocolOptions_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_core_v3_HttpProtocolOptions *ret = envoy_config_core_v3_HttpProtocolOptions_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_HttpProtocolOptions_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_core_v3_HttpProtocolOptions_serialize(const envoy_config_core_v3_HttpProtocolOptions *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_core_v3_HttpProtocolOptions_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_core_v3_HttpProtocolOptions_has_idle_timeout(const envoy_config_core_v3_HttpProtocolOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 8)); }
+UPB_INLINE const struct google_protobuf_Duration* envoy_config_core_v3_HttpProtocolOptions_idle_timeout(const envoy_config_core_v3_HttpProtocolOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const struct google_protobuf_Duration*); }
+UPB_INLINE bool envoy_config_core_v3_HttpProtocolOptions_has_max_headers_count(const envoy_config_core_v3_HttpProtocolOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 16)); }
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_core_v3_HttpProtocolOptions_max_headers_count(const envoy_config_core_v3_HttpProtocolOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const struct google_protobuf_UInt32Value*); }
+UPB_INLINE bool envoy_config_core_v3_HttpProtocolOptions_has_max_connection_duration(const envoy_config_core_v3_HttpProtocolOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 24)); }
+UPB_INLINE const struct google_protobuf_Duration* envoy_config_core_v3_HttpProtocolOptions_max_connection_duration(const envoy_config_core_v3_HttpProtocolOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const struct google_protobuf_Duration*); }
+UPB_INLINE bool envoy_config_core_v3_HttpProtocolOptions_has_max_stream_duration(const envoy_config_core_v3_HttpProtocolOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 32)); }
+UPB_INLINE const struct google_protobuf_Duration* envoy_config_core_v3_HttpProtocolOptions_max_stream_duration(const envoy_config_core_v3_HttpProtocolOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const struct google_protobuf_Duration*); }
+UPB_INLINE int32_t envoy_config_core_v3_HttpProtocolOptions_headers_with_underscores_action(const envoy_config_core_v3_HttpProtocolOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
+
+UPB_INLINE void envoy_config_core_v3_HttpProtocolOptions_set_idle_timeout(envoy_config_core_v3_HttpProtocolOptions *msg, struct google_protobuf_Duration* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), struct google_protobuf_Duration*) = value;
+}
+UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_HttpProtocolOptions_mutable_idle_timeout(envoy_config_core_v3_HttpProtocolOptions *msg, upb_arena *arena) {
+ struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_core_v3_HttpProtocolOptions_idle_timeout(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_HttpProtocolOptions_set_idle_timeout(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_HttpProtocolOptions_set_max_headers_count(envoy_config_core_v3_HttpProtocolOptions *msg, struct google_protobuf_UInt32Value* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 16), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_HttpProtocolOptions_mutable_max_headers_count(envoy_config_core_v3_HttpProtocolOptions *msg, upb_arena *arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_core_v3_HttpProtocolOptions_max_headers_count(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_HttpProtocolOptions_set_max_headers_count(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_HttpProtocolOptions_set_max_connection_duration(envoy_config_core_v3_HttpProtocolOptions *msg, struct google_protobuf_Duration* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), struct google_protobuf_Duration*) = value;
+}
+UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_HttpProtocolOptions_mutable_max_connection_duration(envoy_config_core_v3_HttpProtocolOptions *msg, upb_arena *arena) {
+ struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_core_v3_HttpProtocolOptions_max_connection_duration(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_HttpProtocolOptions_set_max_connection_duration(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_HttpProtocolOptions_set_max_stream_duration(envoy_config_core_v3_HttpProtocolOptions *msg, struct google_protobuf_Duration* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 32), struct google_protobuf_Duration*) = value;
+}
+UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_HttpProtocolOptions_mutable_max_stream_duration(envoy_config_core_v3_HttpProtocolOptions *msg, upb_arena *arena) {
+ struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_core_v3_HttpProtocolOptions_max_stream_duration(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_HttpProtocolOptions_set_max_stream_duration(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_HttpProtocolOptions_set_headers_with_underscores_action(envoy_config_core_v3_HttpProtocolOptions *msg, int32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
+}
+
+/* envoy.config.core.v3.Http1ProtocolOptions */
+
+UPB_INLINE envoy_config_core_v3_Http1ProtocolOptions *envoy_config_core_v3_Http1ProtocolOptions_new(upb_arena *arena) {
+ return (envoy_config_core_v3_Http1ProtocolOptions *)_upb_msg_new(&envoy_config_core_v3_Http1ProtocolOptions_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_Http1ProtocolOptions *envoy_config_core_v3_Http1ProtocolOptions_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_core_v3_Http1ProtocolOptions *ret = envoy_config_core_v3_Http1ProtocolOptions_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_Http1ProtocolOptions_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_core_v3_Http1ProtocolOptions_serialize(const envoy_config_core_v3_Http1ProtocolOptions *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_core_v3_Http1ProtocolOptions_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_core_v3_Http1ProtocolOptions_has_allow_absolute_url(const envoy_config_core_v3_Http1ProtocolOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
+UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_core_v3_Http1ProtocolOptions_allow_absolute_url(const envoy_config_core_v3_Http1ProtocolOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_protobuf_BoolValue*); }
+UPB_INLINE bool envoy_config_core_v3_Http1ProtocolOptions_accept_http_10(const envoy_config_core_v3_Http1ProtocolOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); }
+UPB_INLINE upb_strview envoy_config_core_v3_Http1ProtocolOptions_default_host_for_http_10(const envoy_config_core_v3_Http1ProtocolOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
+UPB_INLINE bool envoy_config_core_v3_Http1ProtocolOptions_has_header_key_format(const envoy_config_core_v3_Http1ProtocolOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); }
+UPB_INLINE const envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat* envoy_config_core_v3_Http1ProtocolOptions_header_key_format(const envoy_config_core_v3_Http1ProtocolOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat*); }
+UPB_INLINE bool envoy_config_core_v3_Http1ProtocolOptions_enable_trailers(const envoy_config_core_v3_Http1ProtocolOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); }
+UPB_INLINE bool envoy_config_core_v3_Http1ProtocolOptions_allow_chunked_length(const envoy_config_core_v3_Http1ProtocolOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool); }
+UPB_INLINE bool envoy_config_core_v3_Http1ProtocolOptions_has_override_stream_error_on_invalid_http_message(const envoy_config_core_v3_Http1ProtocolOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 40)); }
+UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_core_v3_Http1ProtocolOptions_override_stream_error_on_invalid_http_message(const envoy_config_core_v3_Http1ProtocolOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const struct google_protobuf_BoolValue*); }
+
+UPB_INLINE void envoy_config_core_v3_Http1ProtocolOptions_set_allow_absolute_url(envoy_config_core_v3_Http1ProtocolOptions *msg, struct google_protobuf_BoolValue* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_protobuf_BoolValue*) = value;
+}
+UPB_INLINE struct google_protobuf_BoolValue* envoy_config_core_v3_Http1ProtocolOptions_mutable_allow_absolute_url(envoy_config_core_v3_Http1ProtocolOptions *msg, upb_arena *arena) {
+ struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_core_v3_Http1ProtocolOptions_allow_absolute_url(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_BoolValue*)_upb_msg_new(&google_protobuf_BoolValue_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_Http1ProtocolOptions_set_allow_absolute_url(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_Http1ProtocolOptions_set_accept_http_10(envoy_config_core_v3_Http1ProtocolOptions *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
+}
+UPB_INLINE void envoy_config_core_v3_Http1ProtocolOptions_set_default_host_for_http_10(envoy_config_core_v3_Http1ProtocolOptions *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_core_v3_Http1ProtocolOptions_set_header_key_format(envoy_config_core_v3_Http1ProtocolOptions *msg, envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat* envoy_config_core_v3_Http1ProtocolOptions_mutable_header_key_format(envoy_config_core_v3_Http1ProtocolOptions *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat* sub = (struct envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat*)envoy_config_core_v3_Http1ProtocolOptions_header_key_format(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat*)_upb_msg_new(&envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_Http1ProtocolOptions_set_header_key_format(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_Http1ProtocolOptions_set_enable_trailers(envoy_config_core_v3_Http1ProtocolOptions *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
+}
+UPB_INLINE void envoy_config_core_v3_Http1ProtocolOptions_set_allow_chunked_length(envoy_config_core_v3_Http1ProtocolOptions *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = value;
+}
+UPB_INLINE void envoy_config_core_v3_Http1ProtocolOptions_set_override_stream_error_on_invalid_http_message(envoy_config_core_v3_Http1ProtocolOptions *msg, struct google_protobuf_BoolValue* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 40), struct google_protobuf_BoolValue*) = value;
+}
+UPB_INLINE struct google_protobuf_BoolValue* envoy_config_core_v3_Http1ProtocolOptions_mutable_override_stream_error_on_invalid_http_message(envoy_config_core_v3_Http1ProtocolOptions *msg, upb_arena *arena) {
+ struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_core_v3_Http1ProtocolOptions_override_stream_error_on_invalid_http_message(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_BoolValue*)_upb_msg_new(&google_protobuf_BoolValue_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_Http1ProtocolOptions_set_override_stream_error_on_invalid_http_message(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.core.v3.Http1ProtocolOptions.HeaderKeyFormat */
+
+UPB_INLINE envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat *envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_new(upb_arena *arena) {
+ return (envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat *)_upb_msg_new(&envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat *envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat *ret = envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_serialize(const envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_msginit, arena, len);
+}
+
+typedef enum {
+ envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_header_format_proper_case_words = 1,
+ envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_header_format_NOT_SET = 0
+} envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_header_format_oneofcases;
+UPB_INLINE envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_header_format_oneofcases envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_header_format_case(const envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat* msg) { return (envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_header_format_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 8), int32_t); }
+
+UPB_INLINE bool envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_has_proper_case_words(const envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 1; }
+UPB_INLINE const envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords* envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_proper_case_words(const envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat *msg) { return UPB_READ_ONEOF(msg, const envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 1, NULL); }
+
+UPB_INLINE void envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_set_proper_case_words(envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat *msg, envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 1);
+}
+UPB_INLINE struct envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords* envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_mutable_proper_case_words(envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords* sub = (struct envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords*)envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_proper_case_words(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords*)_upb_msg_new(&envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_set_proper_case_words(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.core.v3.Http1ProtocolOptions.HeaderKeyFormat.ProperCaseWords */
+
+UPB_INLINE envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords *envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_new(upb_arena *arena) {
+ return (envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords *)_upb_msg_new(&envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords *envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords *ret = envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_serialize(const envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_msginit, arena, len);
+}
+
+
+
+/* envoy.config.core.v3.KeepaliveSettings */
+
+UPB_INLINE envoy_config_core_v3_KeepaliveSettings *envoy_config_core_v3_KeepaliveSettings_new(upb_arena *arena) {
+ return (envoy_config_core_v3_KeepaliveSettings *)_upb_msg_new(&envoy_config_core_v3_KeepaliveSettings_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_KeepaliveSettings *envoy_config_core_v3_KeepaliveSettings_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_core_v3_KeepaliveSettings *ret = envoy_config_core_v3_KeepaliveSettings_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_KeepaliveSettings_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_core_v3_KeepaliveSettings_serialize(const envoy_config_core_v3_KeepaliveSettings *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_core_v3_KeepaliveSettings_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_core_v3_KeepaliveSettings_has_interval(const envoy_config_core_v3_KeepaliveSettings *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE const struct google_protobuf_Duration* envoy_config_core_v3_KeepaliveSettings_interval(const envoy_config_core_v3_KeepaliveSettings *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct google_protobuf_Duration*); }
+UPB_INLINE bool envoy_config_core_v3_KeepaliveSettings_has_timeout(const envoy_config_core_v3_KeepaliveSettings *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
+UPB_INLINE const struct google_protobuf_Duration* envoy_config_core_v3_KeepaliveSettings_timeout(const envoy_config_core_v3_KeepaliveSettings *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_Duration*); }
+UPB_INLINE bool envoy_config_core_v3_KeepaliveSettings_has_interval_jitter(const envoy_config_core_v3_KeepaliveSettings *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
+UPB_INLINE const struct envoy_type_v3_Percent* envoy_config_core_v3_KeepaliveSettings_interval_jitter(const envoy_config_core_v3_KeepaliveSettings *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct envoy_type_v3_Percent*); }
+
+UPB_INLINE void envoy_config_core_v3_KeepaliveSettings_set_interval(envoy_config_core_v3_KeepaliveSettings *msg, struct google_protobuf_Duration* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct google_protobuf_Duration*) = value;
+}
+UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_KeepaliveSettings_mutable_interval(envoy_config_core_v3_KeepaliveSettings *msg, upb_arena *arena) {
+ struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_core_v3_KeepaliveSettings_interval(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_KeepaliveSettings_set_interval(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_KeepaliveSettings_set_timeout(envoy_config_core_v3_KeepaliveSettings *msg, struct google_protobuf_Duration* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_Duration*) = value;
+}
+UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_KeepaliveSettings_mutable_timeout(envoy_config_core_v3_KeepaliveSettings *msg, upb_arena *arena) {
+ struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_core_v3_KeepaliveSettings_timeout(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_KeepaliveSettings_set_timeout(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_KeepaliveSettings_set_interval_jitter(envoy_config_core_v3_KeepaliveSettings *msg, struct envoy_type_v3_Percent* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct envoy_type_v3_Percent*) = value;
+}
+UPB_INLINE struct envoy_type_v3_Percent* envoy_config_core_v3_KeepaliveSettings_mutable_interval_jitter(envoy_config_core_v3_KeepaliveSettings *msg, upb_arena *arena) {
+ struct envoy_type_v3_Percent* sub = (struct envoy_type_v3_Percent*)envoy_config_core_v3_KeepaliveSettings_interval_jitter(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_type_v3_Percent*)_upb_msg_new(&envoy_type_v3_Percent_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_KeepaliveSettings_set_interval_jitter(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.core.v3.Http2ProtocolOptions */
+
+UPB_INLINE envoy_config_core_v3_Http2ProtocolOptions *envoy_config_core_v3_Http2ProtocolOptions_new(upb_arena *arena) {
+ return (envoy_config_core_v3_Http2ProtocolOptions *)_upb_msg_new(&envoy_config_core_v3_Http2ProtocolOptions_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_Http2ProtocolOptions *envoy_config_core_v3_Http2ProtocolOptions_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_core_v3_Http2ProtocolOptions *ret = envoy_config_core_v3_Http2ProtocolOptions_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_Http2ProtocolOptions_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_core_v3_Http2ProtocolOptions_serialize(const envoy_config_core_v3_Http2ProtocolOptions *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_core_v3_Http2ProtocolOptions_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_core_v3_Http2ProtocolOptions_has_hpack_table_size(const envoy_config_core_v3_Http2ProtocolOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_core_v3_Http2ProtocolOptions_hpack_table_size(const envoy_config_core_v3_Http2ProtocolOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_UInt32Value*); }
+UPB_INLINE bool envoy_config_core_v3_Http2ProtocolOptions_has_max_concurrent_streams(const envoy_config_core_v3_Http2ProtocolOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_core_v3_Http2ProtocolOptions_max_concurrent_streams(const envoy_config_core_v3_Http2ProtocolOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_UInt32Value*); }
+UPB_INLINE bool envoy_config_core_v3_Http2ProtocolOptions_has_initial_stream_window_size(const envoy_config_core_v3_Http2ProtocolOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_core_v3_Http2ProtocolOptions_initial_stream_window_size(const envoy_config_core_v3_Http2ProtocolOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_protobuf_UInt32Value*); }
+UPB_INLINE bool envoy_config_core_v3_Http2ProtocolOptions_has_initial_connection_window_size(const envoy_config_core_v3_Http2ProtocolOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); }
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_core_v3_Http2ProtocolOptions_initial_connection_window_size(const envoy_config_core_v3_Http2ProtocolOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const struct google_protobuf_UInt32Value*); }
+UPB_INLINE bool envoy_config_core_v3_Http2ProtocolOptions_allow_connect(const envoy_config_core_v3_Http2ProtocolOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); }
+UPB_INLINE bool envoy_config_core_v3_Http2ProtocolOptions_allow_metadata(const envoy_config_core_v3_Http2ProtocolOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); }
+UPB_INLINE bool envoy_config_core_v3_Http2ProtocolOptions_has_max_outbound_frames(const envoy_config_core_v3_Http2ProtocolOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 40)); }
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_core_v3_Http2ProtocolOptions_max_outbound_frames(const envoy_config_core_v3_Http2ProtocolOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const struct google_protobuf_UInt32Value*); }
+UPB_INLINE bool envoy_config_core_v3_Http2ProtocolOptions_has_max_outbound_control_frames(const envoy_config_core_v3_Http2ProtocolOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 48)); }
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_core_v3_Http2ProtocolOptions_max_outbound_control_frames(const envoy_config_core_v3_Http2ProtocolOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 48), const struct google_protobuf_UInt32Value*); }
+UPB_INLINE bool envoy_config_core_v3_Http2ProtocolOptions_has_max_consecutive_inbound_frames_with_empty_payload(const envoy_config_core_v3_Http2ProtocolOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 56)); }
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_core_v3_Http2ProtocolOptions_max_consecutive_inbound_frames_with_empty_payload(const envoy_config_core_v3_Http2ProtocolOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 56), const struct google_protobuf_UInt32Value*); }
+UPB_INLINE bool envoy_config_core_v3_Http2ProtocolOptions_has_max_inbound_priority_frames_per_stream(const envoy_config_core_v3_Http2ProtocolOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(32, 64)); }
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_core_v3_Http2ProtocolOptions_max_inbound_priority_frames_per_stream(const envoy_config_core_v3_Http2ProtocolOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 64), const struct google_protobuf_UInt32Value*); }
+UPB_INLINE bool envoy_config_core_v3_Http2ProtocolOptions_has_max_inbound_window_update_frames_per_data_frame_sent(const envoy_config_core_v3_Http2ProtocolOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(36, 72)); }
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_core_v3_Http2ProtocolOptions_max_inbound_window_update_frames_per_data_frame_sent(const envoy_config_core_v3_Http2ProtocolOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(36, 72), const struct google_protobuf_UInt32Value*); }
+UPB_INLINE bool envoy_config_core_v3_Http2ProtocolOptions_stream_error_on_invalid_http_messaging(const envoy_config_core_v3_Http2ProtocolOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool); }
+UPB_INLINE bool envoy_config_core_v3_Http2ProtocolOptions_has_custom_settings_parameters(const envoy_config_core_v3_Http2ProtocolOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(48, 96)); }
+UPB_INLINE const envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter* const* envoy_config_core_v3_Http2ProtocolOptions_custom_settings_parameters(const envoy_config_core_v3_Http2ProtocolOptions *msg, size_t *len) { return (const envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter* const*)_upb_array_accessor(msg, UPB_SIZE(48, 96), len); }
+UPB_INLINE bool envoy_config_core_v3_Http2ProtocolOptions_has_override_stream_error_on_invalid_http_message(const envoy_config_core_v3_Http2ProtocolOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(40, 80)); }
+UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_core_v3_Http2ProtocolOptions_override_stream_error_on_invalid_http_message(const envoy_config_core_v3_Http2ProtocolOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(40, 80), const struct google_protobuf_BoolValue*); }
+UPB_INLINE bool envoy_config_core_v3_Http2ProtocolOptions_has_connection_keepalive(const envoy_config_core_v3_Http2ProtocolOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(44, 88)); }
+UPB_INLINE const envoy_config_core_v3_KeepaliveSettings* envoy_config_core_v3_Http2ProtocolOptions_connection_keepalive(const envoy_config_core_v3_Http2ProtocolOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(44, 88), const envoy_config_core_v3_KeepaliveSettings*); }
+
+UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_set_hpack_table_size(envoy_config_core_v3_Http2ProtocolOptions *msg, struct google_protobuf_UInt32Value* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_Http2ProtocolOptions_mutable_hpack_table_size(envoy_config_core_v3_Http2ProtocolOptions *msg, upb_arena *arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_core_v3_Http2ProtocolOptions_hpack_table_size(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_Http2ProtocolOptions_set_hpack_table_size(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_set_max_concurrent_streams(envoy_config_core_v3_Http2ProtocolOptions *msg, struct google_protobuf_UInt32Value* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_Http2ProtocolOptions_mutable_max_concurrent_streams(envoy_config_core_v3_Http2ProtocolOptions *msg, upb_arena *arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_core_v3_Http2ProtocolOptions_max_concurrent_streams(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_Http2ProtocolOptions_set_max_concurrent_streams(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_set_initial_stream_window_size(envoy_config_core_v3_Http2ProtocolOptions *msg, struct google_protobuf_UInt32Value* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_Http2ProtocolOptions_mutable_initial_stream_window_size(envoy_config_core_v3_Http2ProtocolOptions *msg, upb_arena *arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_core_v3_Http2ProtocolOptions_initial_stream_window_size(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_Http2ProtocolOptions_set_initial_stream_window_size(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_set_initial_connection_window_size(envoy_config_core_v3_Http2ProtocolOptions *msg, struct google_protobuf_UInt32Value* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_Http2ProtocolOptions_mutable_initial_connection_window_size(envoy_config_core_v3_Http2ProtocolOptions *msg, upb_arena *arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_core_v3_Http2ProtocolOptions_initial_connection_window_size(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_Http2ProtocolOptions_set_initial_connection_window_size(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_set_allow_connect(envoy_config_core_v3_Http2ProtocolOptions *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
+}
+UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_set_allow_metadata(envoy_config_core_v3_Http2ProtocolOptions *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
+}
+UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_set_max_outbound_frames(envoy_config_core_v3_Http2ProtocolOptions *msg, struct google_protobuf_UInt32Value* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 40), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_Http2ProtocolOptions_mutable_max_outbound_frames(envoy_config_core_v3_Http2ProtocolOptions *msg, upb_arena *arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_core_v3_Http2ProtocolOptions_max_outbound_frames(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_Http2ProtocolOptions_set_max_outbound_frames(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_set_max_outbound_control_frames(envoy_config_core_v3_Http2ProtocolOptions *msg, struct google_protobuf_UInt32Value* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 48), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_Http2ProtocolOptions_mutable_max_outbound_control_frames(envoy_config_core_v3_Http2ProtocolOptions *msg, upb_arena *arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_core_v3_Http2ProtocolOptions_max_outbound_control_frames(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_Http2ProtocolOptions_set_max_outbound_control_frames(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_set_max_consecutive_inbound_frames_with_empty_payload(envoy_config_core_v3_Http2ProtocolOptions *msg, struct google_protobuf_UInt32Value* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 56), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_Http2ProtocolOptions_mutable_max_consecutive_inbound_frames_with_empty_payload(envoy_config_core_v3_Http2ProtocolOptions *msg, upb_arena *arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_core_v3_Http2ProtocolOptions_max_consecutive_inbound_frames_with_empty_payload(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_Http2ProtocolOptions_set_max_consecutive_inbound_frames_with_empty_payload(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_set_max_inbound_priority_frames_per_stream(envoy_config_core_v3_Http2ProtocolOptions *msg, struct google_protobuf_UInt32Value* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 64), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_Http2ProtocolOptions_mutable_max_inbound_priority_frames_per_stream(envoy_config_core_v3_Http2ProtocolOptions *msg, upb_arena *arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_core_v3_Http2ProtocolOptions_max_inbound_priority_frames_per_stream(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_Http2ProtocolOptions_set_max_inbound_priority_frames_per_stream(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_set_max_inbound_window_update_frames_per_data_frame_sent(envoy_config_core_v3_Http2ProtocolOptions *msg, struct google_protobuf_UInt32Value* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(36, 72), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_Http2ProtocolOptions_mutable_max_inbound_window_update_frames_per_data_frame_sent(envoy_config_core_v3_Http2ProtocolOptions *msg, upb_arena *arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_core_v3_Http2ProtocolOptions_max_inbound_window_update_frames_per_data_frame_sent(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_Http2ProtocolOptions_set_max_inbound_window_update_frames_per_data_frame_sent(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_set_stream_error_on_invalid_http_messaging(envoy_config_core_v3_Http2ProtocolOptions *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = value;
+}
+UPB_INLINE envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter** envoy_config_core_v3_Http2ProtocolOptions_mutable_custom_settings_parameters(envoy_config_core_v3_Http2ProtocolOptions *msg, size_t *len) {
+ return (envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter**)_upb_array_mutable_accessor(msg, UPB_SIZE(48, 96), len);
+}
+UPB_INLINE envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter** envoy_config_core_v3_Http2ProtocolOptions_resize_custom_settings_parameters(envoy_config_core_v3_Http2ProtocolOptions *msg, size_t len, upb_arena *arena) {
+ return (envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter**)_upb_array_resize_accessor(msg, UPB_SIZE(48, 96), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter* envoy_config_core_v3_Http2ProtocolOptions_add_custom_settings_parameters(envoy_config_core_v3_Http2ProtocolOptions *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter* sub = (struct envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter*)_upb_msg_new(&envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(48, 96), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_set_override_stream_error_on_invalid_http_message(envoy_config_core_v3_Http2ProtocolOptions *msg, struct google_protobuf_BoolValue* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 80), struct google_protobuf_BoolValue*) = value;
+}
+UPB_INLINE struct google_protobuf_BoolValue* envoy_config_core_v3_Http2ProtocolOptions_mutable_override_stream_error_on_invalid_http_message(envoy_config_core_v3_Http2ProtocolOptions *msg, upb_arena *arena) {
+ struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_core_v3_Http2ProtocolOptions_override_stream_error_on_invalid_http_message(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_BoolValue*)_upb_msg_new(&google_protobuf_BoolValue_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_Http2ProtocolOptions_set_override_stream_error_on_invalid_http_message(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_set_connection_keepalive(envoy_config_core_v3_Http2ProtocolOptions *msg, envoy_config_core_v3_KeepaliveSettings* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(44, 88), envoy_config_core_v3_KeepaliveSettings*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_KeepaliveSettings* envoy_config_core_v3_Http2ProtocolOptions_mutable_connection_keepalive(envoy_config_core_v3_Http2ProtocolOptions *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_KeepaliveSettings* sub = (struct envoy_config_core_v3_KeepaliveSettings*)envoy_config_core_v3_Http2ProtocolOptions_connection_keepalive(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_KeepaliveSettings*)_upb_msg_new(&envoy_config_core_v3_KeepaliveSettings_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_Http2ProtocolOptions_set_connection_keepalive(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.core.v3.Http2ProtocolOptions.SettingsParameter */
+
+UPB_INLINE envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter *envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_new(upb_arena *arena) {
+ return (envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter *)_upb_msg_new(&envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter *envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter *ret = envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_serialize(const envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_has_identifier(const envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_identifier(const envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct google_protobuf_UInt32Value*); }
+UPB_INLINE bool envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_has_value(const envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_value(const envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_UInt32Value*); }
+
+UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_set_identifier(envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter *msg, struct google_protobuf_UInt32Value* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_mutable_identifier(envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter *msg, upb_arena *arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_identifier(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_set_identifier(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_set_value(envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter *msg, struct google_protobuf_UInt32Value* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_mutable_value(envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter *msg, upb_arena *arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_value(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_set_value(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.core.v3.GrpcProtocolOptions */
+
+UPB_INLINE envoy_config_core_v3_GrpcProtocolOptions *envoy_config_core_v3_GrpcProtocolOptions_new(upb_arena *arena) {
+ return (envoy_config_core_v3_GrpcProtocolOptions *)_upb_msg_new(&envoy_config_core_v3_GrpcProtocolOptions_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_GrpcProtocolOptions *envoy_config_core_v3_GrpcProtocolOptions_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_core_v3_GrpcProtocolOptions *ret = envoy_config_core_v3_GrpcProtocolOptions_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_GrpcProtocolOptions_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_core_v3_GrpcProtocolOptions_serialize(const envoy_config_core_v3_GrpcProtocolOptions *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_core_v3_GrpcProtocolOptions_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_core_v3_GrpcProtocolOptions_has_http2_protocol_options(const envoy_config_core_v3_GrpcProtocolOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE const envoy_config_core_v3_Http2ProtocolOptions* envoy_config_core_v3_GrpcProtocolOptions_http2_protocol_options(const envoy_config_core_v3_GrpcProtocolOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const envoy_config_core_v3_Http2ProtocolOptions*); }
+
+UPB_INLINE void envoy_config_core_v3_GrpcProtocolOptions_set_http2_protocol_options(envoy_config_core_v3_GrpcProtocolOptions *msg, envoy_config_core_v3_Http2ProtocolOptions* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), envoy_config_core_v3_Http2ProtocolOptions*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_Http2ProtocolOptions* envoy_config_core_v3_GrpcProtocolOptions_mutable_http2_protocol_options(envoy_config_core_v3_GrpcProtocolOptions *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_Http2ProtocolOptions* sub = (struct envoy_config_core_v3_Http2ProtocolOptions*)envoy_config_core_v3_GrpcProtocolOptions_http2_protocol_options(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_Http2ProtocolOptions*)_upb_msg_new(&envoy_config_core_v3_Http2ProtocolOptions_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_GrpcProtocolOptions_set_http2_protocol_options(msg, sub);
+ }
+ return sub;
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_CONFIG_CORE_V3_PROTOCOL_PROTO_UPB_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.c
index 4c46752dc65..7ac6d144b6d 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.c
@@ -1,28 +1,28 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/config/core/v3/proxy_protocol.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include <stddef.h>
-#include "upb/msg.h"
-#include "envoy/config/core/v3/proxy_protocol.upb.h"
-#include "udpa/annotations/status.upb.h"
-#include "validate/validate.upb.h"
-
-#include "upb/port_def.inc"
-
-static const upb_msglayout_field envoy_config_core_v3_ProxyProtocolConfig__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 14, 1},
-};
-
-const upb_msglayout envoy_config_core_v3_ProxyProtocolConfig_msginit = {
- NULL,
- &envoy_config_core_v3_ProxyProtocolConfig__fields[0],
- UPB_SIZE(8, 8), 1, false,
-};
-
-#include "upb/port_undef.inc"
-
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/core/v3/proxy_protocol.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg.h"
+#include "envoy/config/core/v3/proxy_protocol.upb.h"
+#include "udpa/annotations/status.upb.h"
+#include "validate/validate.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_msglayout_field envoy_config_core_v3_ProxyProtocolConfig__fields[1] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 14, 1},
+};
+
+const upb_msglayout envoy_config_core_v3_ProxyProtocolConfig_msginit = {
+ NULL,
+ &envoy_config_core_v3_ProxyProtocolConfig__fields[0],
+ UPB_SIZE(8, 8), 1, false,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.h
index e6aaa70d668..9eebc0ea108 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.h
@@ -1,58 +1,58 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/config/core/v3/proxy_protocol.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef ENVOY_CONFIG_CORE_V3_PROXY_PROTOCOL_PROTO_UPB_H_
-#define ENVOY_CONFIG_CORE_V3_PROXY_PROTOCOL_PROTO_UPB_H_
-
-#include "upb/msg.h"
-#include "upb/decode.h"
-#include "upb/encode.h"
-
-#include "upb/port_def.inc"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct envoy_config_core_v3_ProxyProtocolConfig;
-typedef struct envoy_config_core_v3_ProxyProtocolConfig envoy_config_core_v3_ProxyProtocolConfig;
-extern const upb_msglayout envoy_config_core_v3_ProxyProtocolConfig_msginit;
-
-typedef enum {
- envoy_config_core_v3_ProxyProtocolConfig_V1 = 0,
- envoy_config_core_v3_ProxyProtocolConfig_V2 = 1
-} envoy_config_core_v3_ProxyProtocolConfig_Version;
-
-
-/* envoy.config.core.v3.ProxyProtocolConfig */
-
-UPB_INLINE envoy_config_core_v3_ProxyProtocolConfig *envoy_config_core_v3_ProxyProtocolConfig_new(upb_arena *arena) {
- return (envoy_config_core_v3_ProxyProtocolConfig *)_upb_msg_new(&envoy_config_core_v3_ProxyProtocolConfig_msginit, arena);
-}
-UPB_INLINE envoy_config_core_v3_ProxyProtocolConfig *envoy_config_core_v3_ProxyProtocolConfig_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_core_v3_ProxyProtocolConfig *ret = envoy_config_core_v3_ProxyProtocolConfig_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_ProxyProtocolConfig_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_core_v3_ProxyProtocolConfig_serialize(const envoy_config_core_v3_ProxyProtocolConfig *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_core_v3_ProxyProtocolConfig_msginit, arena, len);
-}
-
-UPB_INLINE int32_t envoy_config_core_v3_ProxyProtocolConfig_version(const envoy_config_core_v3_ProxyProtocolConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
-
-UPB_INLINE void envoy_config_core_v3_ProxyProtocolConfig_set_version(envoy_config_core_v3_ProxyProtocolConfig *msg, int32_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* ENVOY_CONFIG_CORE_V3_PROXY_PROTOCOL_PROTO_UPB_H_ */
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/core/v3/proxy_protocol.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_CONFIG_CORE_V3_PROXY_PROTOCOL_PROTO_UPB_H_
+#define ENVOY_CONFIG_CORE_V3_PROXY_PROTOCOL_PROTO_UPB_H_
+
+#include "upb/msg.h"
+#include "upb/decode.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_config_core_v3_ProxyProtocolConfig;
+typedef struct envoy_config_core_v3_ProxyProtocolConfig envoy_config_core_v3_ProxyProtocolConfig;
+extern const upb_msglayout envoy_config_core_v3_ProxyProtocolConfig_msginit;
+
+typedef enum {
+ envoy_config_core_v3_ProxyProtocolConfig_V1 = 0,
+ envoy_config_core_v3_ProxyProtocolConfig_V2 = 1
+} envoy_config_core_v3_ProxyProtocolConfig_Version;
+
+
+/* envoy.config.core.v3.ProxyProtocolConfig */
+
+UPB_INLINE envoy_config_core_v3_ProxyProtocolConfig *envoy_config_core_v3_ProxyProtocolConfig_new(upb_arena *arena) {
+ return (envoy_config_core_v3_ProxyProtocolConfig *)_upb_msg_new(&envoy_config_core_v3_ProxyProtocolConfig_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_ProxyProtocolConfig *envoy_config_core_v3_ProxyProtocolConfig_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_core_v3_ProxyProtocolConfig *ret = envoy_config_core_v3_ProxyProtocolConfig_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_ProxyProtocolConfig_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_core_v3_ProxyProtocolConfig_serialize(const envoy_config_core_v3_ProxyProtocolConfig *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_core_v3_ProxyProtocolConfig_msginit, arena, len);
+}
+
+UPB_INLINE int32_t envoy_config_core_v3_ProxyProtocolConfig_version(const envoy_config_core_v3_ProxyProtocolConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
+
+UPB_INLINE void envoy_config_core_v3_ProxyProtocolConfig_set_version(envoy_config_core_v3_ProxyProtocolConfig *msg, int32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_CONFIG_CORE_V3_PROXY_PROTOCOL_PROTO_UPB_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.c
index 1560ef96f7b..d723cd644c4 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.c
@@ -1,34 +1,34 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/config/core/v3/socket_option.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include <stddef.h>
-#include "upb/msg.h"
-#include "envoy/config/core/v3/socket_option.upb.h"
-#include "udpa/annotations/status.upb.h"
-#include "udpa/annotations/versioning.upb.h"
-#include "validate/validate.upb.h"
-
-#include "upb/port_def.inc"
-
-static const upb_msglayout_field envoy_config_core_v3_SocketOption__fields[6] = {
- {1, UPB_SIZE(24, 24), 0, 0, 9, 1},
- {2, UPB_SIZE(0, 0), 0, 0, 3, 1},
- {3, UPB_SIZE(8, 8), 0, 0, 3, 1},
- {4, UPB_SIZE(32, 40), UPB_SIZE(-41, -57), 0, 3, 1},
- {5, UPB_SIZE(32, 40), UPB_SIZE(-41, -57), 0, 12, 1},
- {6, UPB_SIZE(16, 16), 0, 0, 14, 1},
-};
-
-const upb_msglayout envoy_config_core_v3_SocketOption_msginit = {
- NULL,
- &envoy_config_core_v3_SocketOption__fields[0],
- UPB_SIZE(48, 64), 6, false,
-};
-
-#include "upb/port_undef.inc"
-
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/core/v3/socket_option.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg.h"
+#include "envoy/config/core/v3/socket_option.upb.h"
+#include "udpa/annotations/status.upb.h"
+#include "udpa/annotations/versioning.upb.h"
+#include "validate/validate.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_msglayout_field envoy_config_core_v3_SocketOption__fields[6] = {
+ {1, UPB_SIZE(24, 24), 0, 0, 9, 1},
+ {2, UPB_SIZE(0, 0), 0, 0, 3, 1},
+ {3, UPB_SIZE(8, 8), 0, 0, 3, 1},
+ {4, UPB_SIZE(32, 40), UPB_SIZE(-41, -57), 0, 3, 1},
+ {5, UPB_SIZE(32, 40), UPB_SIZE(-41, -57), 0, 12, 1},
+ {6, UPB_SIZE(16, 16), 0, 0, 14, 1},
+};
+
+const upb_msglayout envoy_config_core_v3_SocketOption_msginit = {
+ NULL,
+ &envoy_config_core_v3_SocketOption__fields[0],
+ UPB_SIZE(48, 64), 6, false,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.h
index d9c727c27ea..55baf60c04f 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.h
@@ -1,88 +1,88 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/config/core/v3/socket_option.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef ENVOY_CONFIG_CORE_V3_SOCKET_OPTION_PROTO_UPB_H_
-#define ENVOY_CONFIG_CORE_V3_SOCKET_OPTION_PROTO_UPB_H_
-
-#include "upb/msg.h"
-#include "upb/decode.h"
-#include "upb/encode.h"
-
-#include "upb/port_def.inc"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct envoy_config_core_v3_SocketOption;
-typedef struct envoy_config_core_v3_SocketOption envoy_config_core_v3_SocketOption;
-extern const upb_msglayout envoy_config_core_v3_SocketOption_msginit;
-
-typedef enum {
- envoy_config_core_v3_SocketOption_STATE_PREBIND = 0,
- envoy_config_core_v3_SocketOption_STATE_BOUND = 1,
- envoy_config_core_v3_SocketOption_STATE_LISTENING = 2
-} envoy_config_core_v3_SocketOption_SocketState;
-
-
-/* envoy.config.core.v3.SocketOption */
-
-UPB_INLINE envoy_config_core_v3_SocketOption *envoy_config_core_v3_SocketOption_new(upb_arena *arena) {
- return (envoy_config_core_v3_SocketOption *)_upb_msg_new(&envoy_config_core_v3_SocketOption_msginit, arena);
-}
-UPB_INLINE envoy_config_core_v3_SocketOption *envoy_config_core_v3_SocketOption_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_core_v3_SocketOption *ret = envoy_config_core_v3_SocketOption_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_SocketOption_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_core_v3_SocketOption_serialize(const envoy_config_core_v3_SocketOption *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_core_v3_SocketOption_msginit, arena, len);
-}
-
-typedef enum {
- envoy_config_core_v3_SocketOption_value_int_value = 4,
- envoy_config_core_v3_SocketOption_value_buf_value = 5,
- envoy_config_core_v3_SocketOption_value_NOT_SET = 0
-} envoy_config_core_v3_SocketOption_value_oneofcases;
-UPB_INLINE envoy_config_core_v3_SocketOption_value_oneofcases envoy_config_core_v3_SocketOption_value_case(const envoy_config_core_v3_SocketOption* msg) { return (envoy_config_core_v3_SocketOption_value_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(40, 56), int32_t); }
-
-UPB_INLINE upb_strview envoy_config_core_v3_SocketOption_description(const envoy_config_core_v3_SocketOption *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), upb_strview); }
-UPB_INLINE int64_t envoy_config_core_v3_SocketOption_level(const envoy_config_core_v3_SocketOption *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int64_t); }
-UPB_INLINE int64_t envoy_config_core_v3_SocketOption_name(const envoy_config_core_v3_SocketOption *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int64_t); }
-UPB_INLINE bool envoy_config_core_v3_SocketOption_has_int_value(const envoy_config_core_v3_SocketOption *msg) { return _upb_getoneofcase(msg, UPB_SIZE(40, 56)) == 4; }
-UPB_INLINE int64_t envoy_config_core_v3_SocketOption_int_value(const envoy_config_core_v3_SocketOption *msg) { return UPB_READ_ONEOF(msg, int64_t, UPB_SIZE(32, 40), UPB_SIZE(40, 56), 4, 0); }
-UPB_INLINE bool envoy_config_core_v3_SocketOption_has_buf_value(const envoy_config_core_v3_SocketOption *msg) { return _upb_getoneofcase(msg, UPB_SIZE(40, 56)) == 5; }
-UPB_INLINE upb_strview envoy_config_core_v3_SocketOption_buf_value(const envoy_config_core_v3_SocketOption *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(32, 40), UPB_SIZE(40, 56), 5, upb_strview_make("", strlen(""))); }
-UPB_INLINE int32_t envoy_config_core_v3_SocketOption_state(const envoy_config_core_v3_SocketOption *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t); }
-
-UPB_INLINE void envoy_config_core_v3_SocketOption_set_description(envoy_config_core_v3_SocketOption *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(24, 24), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_core_v3_SocketOption_set_level(envoy_config_core_v3_SocketOption *msg, int64_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int64_t) = value;
-}
-UPB_INLINE void envoy_config_core_v3_SocketOption_set_name(envoy_config_core_v3_SocketOption *msg, int64_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int64_t) = value;
-}
-UPB_INLINE void envoy_config_core_v3_SocketOption_set_int_value(envoy_config_core_v3_SocketOption *msg, int64_t value) {
- UPB_WRITE_ONEOF(msg, int64_t, UPB_SIZE(32, 40), value, UPB_SIZE(40, 56), 4);
-}
-UPB_INLINE void envoy_config_core_v3_SocketOption_set_buf_value(envoy_config_core_v3_SocketOption *msg, upb_strview value) {
- UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(32, 40), value, UPB_SIZE(40, 56), 5);
-}
-UPB_INLINE void envoy_config_core_v3_SocketOption_set_state(envoy_config_core_v3_SocketOption *msg, int32_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t) = value;
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* ENVOY_CONFIG_CORE_V3_SOCKET_OPTION_PROTO_UPB_H_ */
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/core/v3/socket_option.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_CONFIG_CORE_V3_SOCKET_OPTION_PROTO_UPB_H_
+#define ENVOY_CONFIG_CORE_V3_SOCKET_OPTION_PROTO_UPB_H_
+
+#include "upb/msg.h"
+#include "upb/decode.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_config_core_v3_SocketOption;
+typedef struct envoy_config_core_v3_SocketOption envoy_config_core_v3_SocketOption;
+extern const upb_msglayout envoy_config_core_v3_SocketOption_msginit;
+
+typedef enum {
+ envoy_config_core_v3_SocketOption_STATE_PREBIND = 0,
+ envoy_config_core_v3_SocketOption_STATE_BOUND = 1,
+ envoy_config_core_v3_SocketOption_STATE_LISTENING = 2
+} envoy_config_core_v3_SocketOption_SocketState;
+
+
+/* envoy.config.core.v3.SocketOption */
+
+UPB_INLINE envoy_config_core_v3_SocketOption *envoy_config_core_v3_SocketOption_new(upb_arena *arena) {
+ return (envoy_config_core_v3_SocketOption *)_upb_msg_new(&envoy_config_core_v3_SocketOption_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_SocketOption *envoy_config_core_v3_SocketOption_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_core_v3_SocketOption *ret = envoy_config_core_v3_SocketOption_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_SocketOption_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_core_v3_SocketOption_serialize(const envoy_config_core_v3_SocketOption *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_core_v3_SocketOption_msginit, arena, len);
+}
+
+typedef enum {
+ envoy_config_core_v3_SocketOption_value_int_value = 4,
+ envoy_config_core_v3_SocketOption_value_buf_value = 5,
+ envoy_config_core_v3_SocketOption_value_NOT_SET = 0
+} envoy_config_core_v3_SocketOption_value_oneofcases;
+UPB_INLINE envoy_config_core_v3_SocketOption_value_oneofcases envoy_config_core_v3_SocketOption_value_case(const envoy_config_core_v3_SocketOption* msg) { return (envoy_config_core_v3_SocketOption_value_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(40, 56), int32_t); }
+
+UPB_INLINE upb_strview envoy_config_core_v3_SocketOption_description(const envoy_config_core_v3_SocketOption *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), upb_strview); }
+UPB_INLINE int64_t envoy_config_core_v3_SocketOption_level(const envoy_config_core_v3_SocketOption *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int64_t); }
+UPB_INLINE int64_t envoy_config_core_v3_SocketOption_name(const envoy_config_core_v3_SocketOption *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int64_t); }
+UPB_INLINE bool envoy_config_core_v3_SocketOption_has_int_value(const envoy_config_core_v3_SocketOption *msg) { return _upb_getoneofcase(msg, UPB_SIZE(40, 56)) == 4; }
+UPB_INLINE int64_t envoy_config_core_v3_SocketOption_int_value(const envoy_config_core_v3_SocketOption *msg) { return UPB_READ_ONEOF(msg, int64_t, UPB_SIZE(32, 40), UPB_SIZE(40, 56), 4, 0); }
+UPB_INLINE bool envoy_config_core_v3_SocketOption_has_buf_value(const envoy_config_core_v3_SocketOption *msg) { return _upb_getoneofcase(msg, UPB_SIZE(40, 56)) == 5; }
+UPB_INLINE upb_strview envoy_config_core_v3_SocketOption_buf_value(const envoy_config_core_v3_SocketOption *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(32, 40), UPB_SIZE(40, 56), 5, upb_strview_make("", strlen(""))); }
+UPB_INLINE int32_t envoy_config_core_v3_SocketOption_state(const envoy_config_core_v3_SocketOption *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t); }
+
+UPB_INLINE void envoy_config_core_v3_SocketOption_set_description(envoy_config_core_v3_SocketOption *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 24), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_core_v3_SocketOption_set_level(envoy_config_core_v3_SocketOption *msg, int64_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int64_t) = value;
+}
+UPB_INLINE void envoy_config_core_v3_SocketOption_set_name(envoy_config_core_v3_SocketOption *msg, int64_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int64_t) = value;
+}
+UPB_INLINE void envoy_config_core_v3_SocketOption_set_int_value(envoy_config_core_v3_SocketOption *msg, int64_t value) {
+ UPB_WRITE_ONEOF(msg, int64_t, UPB_SIZE(32, 40), value, UPB_SIZE(40, 56), 4);
+}
+UPB_INLINE void envoy_config_core_v3_SocketOption_set_buf_value(envoy_config_core_v3_SocketOption *msg, upb_strview value) {
+ UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(32, 40), value, UPB_SIZE(40, 56), 5);
+}
+UPB_INLINE void envoy_config_core_v3_SocketOption_set_state(envoy_config_core_v3_SocketOption *msg, int32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t) = value;
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_CONFIG_CORE_V3_SOCKET_OPTION_PROTO_UPB_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.c
index 207cd1ebcd8..9a85f056180 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.c
@@ -1,36 +1,36 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/config/core/v3/substitution_format_string.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include <stddef.h>
-#include "upb/msg.h"
-#include "envoy/config/core/v3/substitution_format_string.upb.h"
-#include "google/protobuf/struct.upb.h"
-#include "udpa/annotations/status.upb.h"
-#include "validate/validate.upb.h"
-
-#include "upb/port_def.inc"
-
-static const upb_msglayout *const envoy_config_core_v3_SubstitutionFormatString_submsgs[1] = {
- &google_protobuf_Struct_msginit,
-};
-
-static const upb_msglayout_field envoy_config_core_v3_SubstitutionFormatString__fields[4] = {
- {1, UPB_SIZE(12, 24), UPB_SIZE(-21, -41), 0, 9, 1},
- {2, UPB_SIZE(12, 24), UPB_SIZE(-21, -41), 0, 11, 1},
- {3, UPB_SIZE(0, 0), 0, 0, 8, 1},
- {4, UPB_SIZE(4, 8), 0, 0, 9, 1},
-};
-
-const upb_msglayout envoy_config_core_v3_SubstitutionFormatString_msginit = {
- &envoy_config_core_v3_SubstitutionFormatString_submsgs[0],
- &envoy_config_core_v3_SubstitutionFormatString__fields[0],
- UPB_SIZE(24, 48), 4, false,
-};
-
-#include "upb/port_undef.inc"
-
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/core/v3/substitution_format_string.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg.h"
+#include "envoy/config/core/v3/substitution_format_string.upb.h"
+#include "google/protobuf/struct.upb.h"
+#include "udpa/annotations/status.upb.h"
+#include "validate/validate.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_msglayout *const envoy_config_core_v3_SubstitutionFormatString_submsgs[1] = {
+ &google_protobuf_Struct_msginit,
+};
+
+static const upb_msglayout_field envoy_config_core_v3_SubstitutionFormatString__fields[4] = {
+ {1, UPB_SIZE(12, 24), UPB_SIZE(-21, -41), 0, 9, 1},
+ {2, UPB_SIZE(12, 24), UPB_SIZE(-21, -41), 0, 11, 1},
+ {3, UPB_SIZE(0, 0), 0, 0, 8, 1},
+ {4, UPB_SIZE(4, 8), 0, 0, 9, 1},
+};
+
+const upb_msglayout envoy_config_core_v3_SubstitutionFormatString_msginit = {
+ &envoy_config_core_v3_SubstitutionFormatString_submsgs[0],
+ &envoy_config_core_v3_SubstitutionFormatString__fields[0],
+ UPB_SIZE(24, 48), 4, false,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.h
index acf527c0713..3f78910b63d 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.h
@@ -1,85 +1,85 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/config/core/v3/substitution_format_string.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef ENVOY_CONFIG_CORE_V3_SUBSTITUTION_FORMAT_STRING_PROTO_UPB_H_
-#define ENVOY_CONFIG_CORE_V3_SUBSTITUTION_FORMAT_STRING_PROTO_UPB_H_
-
-#include "upb/msg.h"
-#include "upb/decode.h"
-#include "upb/encode.h"
-
-#include "upb/port_def.inc"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct envoy_config_core_v3_SubstitutionFormatString;
-typedef struct envoy_config_core_v3_SubstitutionFormatString envoy_config_core_v3_SubstitutionFormatString;
-extern const upb_msglayout envoy_config_core_v3_SubstitutionFormatString_msginit;
-struct google_protobuf_Struct;
-extern const upb_msglayout google_protobuf_Struct_msginit;
-
-
-/* envoy.config.core.v3.SubstitutionFormatString */
-
-UPB_INLINE envoy_config_core_v3_SubstitutionFormatString *envoy_config_core_v3_SubstitutionFormatString_new(upb_arena *arena) {
- return (envoy_config_core_v3_SubstitutionFormatString *)_upb_msg_new(&envoy_config_core_v3_SubstitutionFormatString_msginit, arena);
-}
-UPB_INLINE envoy_config_core_v3_SubstitutionFormatString *envoy_config_core_v3_SubstitutionFormatString_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_core_v3_SubstitutionFormatString *ret = envoy_config_core_v3_SubstitutionFormatString_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_SubstitutionFormatString_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_core_v3_SubstitutionFormatString_serialize(const envoy_config_core_v3_SubstitutionFormatString *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_core_v3_SubstitutionFormatString_msginit, arena, len);
-}
-
-typedef enum {
- envoy_config_core_v3_SubstitutionFormatString_format_text_format = 1,
- envoy_config_core_v3_SubstitutionFormatString_format_json_format = 2,
- envoy_config_core_v3_SubstitutionFormatString_format_NOT_SET = 0
-} envoy_config_core_v3_SubstitutionFormatString_format_oneofcases;
-UPB_INLINE envoy_config_core_v3_SubstitutionFormatString_format_oneofcases envoy_config_core_v3_SubstitutionFormatString_format_case(const envoy_config_core_v3_SubstitutionFormatString* msg) { return (envoy_config_core_v3_SubstitutionFormatString_format_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(20, 40), int32_t); }
-
-UPB_INLINE bool envoy_config_core_v3_SubstitutionFormatString_has_text_format(const envoy_config_core_v3_SubstitutionFormatString *msg) { return _upb_getoneofcase(msg, UPB_SIZE(20, 40)) == 1; }
-UPB_INLINE upb_strview envoy_config_core_v3_SubstitutionFormatString_text_format(const envoy_config_core_v3_SubstitutionFormatString *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(12, 24), UPB_SIZE(20, 40), 1, upb_strview_make("", strlen(""))); }
-UPB_INLINE bool envoy_config_core_v3_SubstitutionFormatString_has_json_format(const envoy_config_core_v3_SubstitutionFormatString *msg) { return _upb_getoneofcase(msg, UPB_SIZE(20, 40)) == 2; }
-UPB_INLINE const struct google_protobuf_Struct* envoy_config_core_v3_SubstitutionFormatString_json_format(const envoy_config_core_v3_SubstitutionFormatString *msg) { return UPB_READ_ONEOF(msg, const struct google_protobuf_Struct*, UPB_SIZE(12, 24), UPB_SIZE(20, 40), 2, NULL); }
-UPB_INLINE bool envoy_config_core_v3_SubstitutionFormatString_omit_empty_values(const envoy_config_core_v3_SubstitutionFormatString *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); }
-UPB_INLINE upb_strview envoy_config_core_v3_SubstitutionFormatString_content_type(const envoy_config_core_v3_SubstitutionFormatString *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
-
-UPB_INLINE void envoy_config_core_v3_SubstitutionFormatString_set_text_format(envoy_config_core_v3_SubstitutionFormatString *msg, upb_strview value) {
- UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(12, 24), value, UPB_SIZE(20, 40), 1);
-}
-UPB_INLINE void envoy_config_core_v3_SubstitutionFormatString_set_json_format(envoy_config_core_v3_SubstitutionFormatString *msg, struct google_protobuf_Struct* value) {
- UPB_WRITE_ONEOF(msg, struct google_protobuf_Struct*, UPB_SIZE(12, 24), value, UPB_SIZE(20, 40), 2);
-}
-UPB_INLINE struct google_protobuf_Struct* envoy_config_core_v3_SubstitutionFormatString_mutable_json_format(envoy_config_core_v3_SubstitutionFormatString *msg, upb_arena *arena) {
- struct google_protobuf_Struct* sub = (struct google_protobuf_Struct*)envoy_config_core_v3_SubstitutionFormatString_json_format(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Struct*)_upb_msg_new(&google_protobuf_Struct_msginit, arena);
- if (!sub) return NULL;
- envoy_config_core_v3_SubstitutionFormatString_set_json_format(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_core_v3_SubstitutionFormatString_set_omit_empty_values(envoy_config_core_v3_SubstitutionFormatString *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
-}
-UPB_INLINE void envoy_config_core_v3_SubstitutionFormatString_set_content_type(envoy_config_core_v3_SubstitutionFormatString *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* ENVOY_CONFIG_CORE_V3_SUBSTITUTION_FORMAT_STRING_PROTO_UPB_H_ */
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/core/v3/substitution_format_string.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_CONFIG_CORE_V3_SUBSTITUTION_FORMAT_STRING_PROTO_UPB_H_
+#define ENVOY_CONFIG_CORE_V3_SUBSTITUTION_FORMAT_STRING_PROTO_UPB_H_
+
+#include "upb/msg.h"
+#include "upb/decode.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_config_core_v3_SubstitutionFormatString;
+typedef struct envoy_config_core_v3_SubstitutionFormatString envoy_config_core_v3_SubstitutionFormatString;
+extern const upb_msglayout envoy_config_core_v3_SubstitutionFormatString_msginit;
+struct google_protobuf_Struct;
+extern const upb_msglayout google_protobuf_Struct_msginit;
+
+
+/* envoy.config.core.v3.SubstitutionFormatString */
+
+UPB_INLINE envoy_config_core_v3_SubstitutionFormatString *envoy_config_core_v3_SubstitutionFormatString_new(upb_arena *arena) {
+ return (envoy_config_core_v3_SubstitutionFormatString *)_upb_msg_new(&envoy_config_core_v3_SubstitutionFormatString_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_SubstitutionFormatString *envoy_config_core_v3_SubstitutionFormatString_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_core_v3_SubstitutionFormatString *ret = envoy_config_core_v3_SubstitutionFormatString_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_SubstitutionFormatString_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_core_v3_SubstitutionFormatString_serialize(const envoy_config_core_v3_SubstitutionFormatString *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_core_v3_SubstitutionFormatString_msginit, arena, len);
+}
+
+typedef enum {
+ envoy_config_core_v3_SubstitutionFormatString_format_text_format = 1,
+ envoy_config_core_v3_SubstitutionFormatString_format_json_format = 2,
+ envoy_config_core_v3_SubstitutionFormatString_format_NOT_SET = 0
+} envoy_config_core_v3_SubstitutionFormatString_format_oneofcases;
+UPB_INLINE envoy_config_core_v3_SubstitutionFormatString_format_oneofcases envoy_config_core_v3_SubstitutionFormatString_format_case(const envoy_config_core_v3_SubstitutionFormatString* msg) { return (envoy_config_core_v3_SubstitutionFormatString_format_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(20, 40), int32_t); }
+
+UPB_INLINE bool envoy_config_core_v3_SubstitutionFormatString_has_text_format(const envoy_config_core_v3_SubstitutionFormatString *msg) { return _upb_getoneofcase(msg, UPB_SIZE(20, 40)) == 1; }
+UPB_INLINE upb_strview envoy_config_core_v3_SubstitutionFormatString_text_format(const envoy_config_core_v3_SubstitutionFormatString *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(12, 24), UPB_SIZE(20, 40), 1, upb_strview_make("", strlen(""))); }
+UPB_INLINE bool envoy_config_core_v3_SubstitutionFormatString_has_json_format(const envoy_config_core_v3_SubstitutionFormatString *msg) { return _upb_getoneofcase(msg, UPB_SIZE(20, 40)) == 2; }
+UPB_INLINE const struct google_protobuf_Struct* envoy_config_core_v3_SubstitutionFormatString_json_format(const envoy_config_core_v3_SubstitutionFormatString *msg) { return UPB_READ_ONEOF(msg, const struct google_protobuf_Struct*, UPB_SIZE(12, 24), UPB_SIZE(20, 40), 2, NULL); }
+UPB_INLINE bool envoy_config_core_v3_SubstitutionFormatString_omit_empty_values(const envoy_config_core_v3_SubstitutionFormatString *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); }
+UPB_INLINE upb_strview envoy_config_core_v3_SubstitutionFormatString_content_type(const envoy_config_core_v3_SubstitutionFormatString *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
+
+UPB_INLINE void envoy_config_core_v3_SubstitutionFormatString_set_text_format(envoy_config_core_v3_SubstitutionFormatString *msg, upb_strview value) {
+ UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(12, 24), value, UPB_SIZE(20, 40), 1);
+}
+UPB_INLINE void envoy_config_core_v3_SubstitutionFormatString_set_json_format(envoy_config_core_v3_SubstitutionFormatString *msg, struct google_protobuf_Struct* value) {
+ UPB_WRITE_ONEOF(msg, struct google_protobuf_Struct*, UPB_SIZE(12, 24), value, UPB_SIZE(20, 40), 2);
+}
+UPB_INLINE struct google_protobuf_Struct* envoy_config_core_v3_SubstitutionFormatString_mutable_json_format(envoy_config_core_v3_SubstitutionFormatString *msg, upb_arena *arena) {
+ struct google_protobuf_Struct* sub = (struct google_protobuf_Struct*)envoy_config_core_v3_SubstitutionFormatString_json_format(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Struct*)_upb_msg_new(&google_protobuf_Struct_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_SubstitutionFormatString_set_json_format(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_SubstitutionFormatString_set_omit_empty_values(envoy_config_core_v3_SubstitutionFormatString *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
+}
+UPB_INLINE void envoy_config_core_v3_SubstitutionFormatString_set_content_type(envoy_config_core_v3_SubstitutionFormatString *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_CONFIG_CORE_V3_SUBSTITUTION_FORMAT_STRING_PROTO_UPB_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.c
index ae64d4eeca3..58fbccdbc6e 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.c
@@ -1,91 +1,91 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/config/endpoint/v3/endpoint.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include <stddef.h>
-#include "upb/msg.h"
-#include "envoy/config/endpoint/v3/endpoint.upb.h"
-#include "envoy/config/endpoint/v3/endpoint_components.upb.h"
-#include "envoy/type/v3/percent.upb.h"
-#include "google/api/annotations.upb.h"
-#include "google/protobuf/duration.upb.h"
-#include "google/protobuf/wrappers.upb.h"
-#include "udpa/annotations/status.upb.h"
-#include "udpa/annotations/versioning.upb.h"
-#include "validate/validate.upb.h"
-
-#include "upb/port_def.inc"
-
-static const upb_msglayout *const envoy_config_endpoint_v3_ClusterLoadAssignment_submsgs[3] = {
- &envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry_msginit,
- &envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_msginit,
- &envoy_config_endpoint_v3_LocalityLbEndpoints_msginit,
-};
-
-static const upb_msglayout_field envoy_config_endpoint_v3_ClusterLoadAssignment__fields[4] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(12, 24), 0, 2, 11, 3},
- {4, UPB_SIZE(8, 16), 0, 1, 11, 1},
- {5, UPB_SIZE(16, 32), 0, 0, 11, _UPB_LABEL_MAP},
-};
-
-const upb_msglayout envoy_config_endpoint_v3_ClusterLoadAssignment_msginit = {
- &envoy_config_endpoint_v3_ClusterLoadAssignment_submsgs[0],
- &envoy_config_endpoint_v3_ClusterLoadAssignment__fields[0],
- UPB_SIZE(24, 48), 4, false,
-};
-
-static const upb_msglayout *const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_submsgs[3] = {
- &envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_msginit,
- &google_protobuf_Duration_msginit,
- &google_protobuf_UInt32Value_msginit,
-};
-
-static const upb_msglayout_field envoy_config_endpoint_v3_ClusterLoadAssignment_Policy__fields[3] = {
- {2, UPB_SIZE(8, 16), 0, 0, 11, 3},
- {3, UPB_SIZE(0, 0), 0, 2, 11, 1},
- {4, UPB_SIZE(4, 8), 0, 1, 11, 1},
-};
-
-const upb_msglayout envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_msginit = {
- &envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_submsgs[0],
- &envoy_config_endpoint_v3_ClusterLoadAssignment_Policy__fields[0],
- UPB_SIZE(12, 24), 3, false,
-};
-
-static const upb_msglayout *const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_submsgs[1] = {
- &envoy_type_v3_FractionalPercent_msginit,
-};
-
-static const upb_msglayout_field envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 11, 1},
-};
-
-const upb_msglayout envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_msginit = {
- &envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_submsgs[0],
- &envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload__fields[0],
- UPB_SIZE(16, 32), 2, false,
-};
-
-static const upb_msglayout *const envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry_submsgs[1] = {
- &envoy_config_endpoint_v3_Endpoint_msginit,
-};
-
-static const upb_msglayout_field envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 11, 1},
-};
-
-const upb_msglayout envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry_msginit = {
- &envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry_submsgs[0],
- &envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry__fields[0],
- UPB_SIZE(16, 32), 2, false,
-};
-
-#include "upb/port_undef.inc"
-
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/endpoint/v3/endpoint.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg.h"
+#include "envoy/config/endpoint/v3/endpoint.upb.h"
+#include "envoy/config/endpoint/v3/endpoint_components.upb.h"
+#include "envoy/type/v3/percent.upb.h"
+#include "google/api/annotations.upb.h"
+#include "google/protobuf/duration.upb.h"
+#include "google/protobuf/wrappers.upb.h"
+#include "udpa/annotations/status.upb.h"
+#include "udpa/annotations/versioning.upb.h"
+#include "validate/validate.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_msglayout *const envoy_config_endpoint_v3_ClusterLoadAssignment_submsgs[3] = {
+ &envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry_msginit,
+ &envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_msginit,
+ &envoy_config_endpoint_v3_LocalityLbEndpoints_msginit,
+};
+
+static const upb_msglayout_field envoy_config_endpoint_v3_ClusterLoadAssignment__fields[4] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {2, UPB_SIZE(12, 24), 0, 2, 11, 3},
+ {4, UPB_SIZE(8, 16), 0, 1, 11, 1},
+ {5, UPB_SIZE(16, 32), 0, 0, 11, _UPB_LABEL_MAP},
+};
+
+const upb_msglayout envoy_config_endpoint_v3_ClusterLoadAssignment_msginit = {
+ &envoy_config_endpoint_v3_ClusterLoadAssignment_submsgs[0],
+ &envoy_config_endpoint_v3_ClusterLoadAssignment__fields[0],
+ UPB_SIZE(24, 48), 4, false,
+};
+
+static const upb_msglayout *const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_submsgs[3] = {
+ &envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_msginit,
+ &google_protobuf_Duration_msginit,
+ &google_protobuf_UInt32Value_msginit,
+};
+
+static const upb_msglayout_field envoy_config_endpoint_v3_ClusterLoadAssignment_Policy__fields[3] = {
+ {2, UPB_SIZE(8, 16), 0, 0, 11, 3},
+ {3, UPB_SIZE(0, 0), 0, 2, 11, 1},
+ {4, UPB_SIZE(4, 8), 0, 1, 11, 1},
+};
+
+const upb_msglayout envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_msginit = {
+ &envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_submsgs[0],
+ &envoy_config_endpoint_v3_ClusterLoadAssignment_Policy__fields[0],
+ UPB_SIZE(12, 24), 3, false,
+};
+
+static const upb_msglayout *const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_submsgs[1] = {
+ &envoy_type_v3_FractionalPercent_msginit,
+};
+
+static const upb_msglayout_field envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {2, UPB_SIZE(8, 16), 0, 0, 11, 1},
+};
+
+const upb_msglayout envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_msginit = {
+ &envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_submsgs[0],
+ &envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload__fields[0],
+ UPB_SIZE(16, 32), 2, false,
+};
+
+static const upb_msglayout *const envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry_submsgs[1] = {
+ &envoy_config_endpoint_v3_Endpoint_msginit,
+};
+
+static const upb_msglayout_field envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {2, UPB_SIZE(8, 16), 0, 0, 11, 1},
+};
+
+const upb_msglayout envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry_msginit = {
+ &envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry_submsgs[0],
+ &envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry__fields[0],
+ UPB_SIZE(16, 32), 2, false,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.h
index 06e132eb884..be00783f59f 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.h
@@ -1,220 +1,220 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/config/endpoint/v3/endpoint.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef ENVOY_CONFIG_ENDPOINT_V3_ENDPOINT_PROTO_UPB_H_
-#define ENVOY_CONFIG_ENDPOINT_V3_ENDPOINT_PROTO_UPB_H_
-
-#include "upb/msg.h"
-#include "upb/decode.h"
-#include "upb/encode.h"
-
-#include "upb/port_def.inc"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct envoy_config_endpoint_v3_ClusterLoadAssignment;
-struct envoy_config_endpoint_v3_ClusterLoadAssignment_Policy;
-struct envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload;
-struct envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry;
-typedef struct envoy_config_endpoint_v3_ClusterLoadAssignment envoy_config_endpoint_v3_ClusterLoadAssignment;
-typedef struct envoy_config_endpoint_v3_ClusterLoadAssignment_Policy envoy_config_endpoint_v3_ClusterLoadAssignment_Policy;
-typedef struct envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload;
-typedef struct envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry;
-extern const upb_msglayout envoy_config_endpoint_v3_ClusterLoadAssignment_msginit;
-extern const upb_msglayout envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_msginit;
-extern const upb_msglayout envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_msginit;
-extern const upb_msglayout envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry_msginit;
-struct envoy_config_endpoint_v3_Endpoint;
-struct envoy_config_endpoint_v3_LocalityLbEndpoints;
-struct envoy_type_v3_FractionalPercent;
-struct google_protobuf_Duration;
-struct google_protobuf_UInt32Value;
-extern const upb_msglayout envoy_config_endpoint_v3_Endpoint_msginit;
-extern const upb_msglayout envoy_config_endpoint_v3_LocalityLbEndpoints_msginit;
-extern const upb_msglayout envoy_type_v3_FractionalPercent_msginit;
-extern const upb_msglayout google_protobuf_Duration_msginit;
-extern const upb_msglayout google_protobuf_UInt32Value_msginit;
-
-
-/* envoy.config.endpoint.v3.ClusterLoadAssignment */
-
-UPB_INLINE envoy_config_endpoint_v3_ClusterLoadAssignment *envoy_config_endpoint_v3_ClusterLoadAssignment_new(upb_arena *arena) {
- return (envoy_config_endpoint_v3_ClusterLoadAssignment *)_upb_msg_new(&envoy_config_endpoint_v3_ClusterLoadAssignment_msginit, arena);
-}
-UPB_INLINE envoy_config_endpoint_v3_ClusterLoadAssignment *envoy_config_endpoint_v3_ClusterLoadAssignment_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_endpoint_v3_ClusterLoadAssignment *ret = envoy_config_endpoint_v3_ClusterLoadAssignment_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_endpoint_v3_ClusterLoadAssignment_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_endpoint_v3_ClusterLoadAssignment_serialize(const envoy_config_endpoint_v3_ClusterLoadAssignment *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_endpoint_v3_ClusterLoadAssignment_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview envoy_config_endpoint_v3_ClusterLoadAssignment_cluster_name(const envoy_config_endpoint_v3_ClusterLoadAssignment *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE bool envoy_config_endpoint_v3_ClusterLoadAssignment_has_endpoints(const envoy_config_endpoint_v3_ClusterLoadAssignment *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
-UPB_INLINE const struct envoy_config_endpoint_v3_LocalityLbEndpoints* const* envoy_config_endpoint_v3_ClusterLoadAssignment_endpoints(const envoy_config_endpoint_v3_ClusterLoadAssignment *msg, size_t *len) { return (const struct envoy_config_endpoint_v3_LocalityLbEndpoints* const*)_upb_array_accessor(msg, UPB_SIZE(12, 24), len); }
-UPB_INLINE bool envoy_config_endpoint_v3_ClusterLoadAssignment_has_policy(const envoy_config_endpoint_v3_ClusterLoadAssignment *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy* envoy_config_endpoint_v3_ClusterLoadAssignment_policy(const envoy_config_endpoint_v3_ClusterLoadAssignment *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy*); }
-UPB_INLINE bool envoy_config_endpoint_v3_ClusterLoadAssignment_has_named_endpoints(const envoy_config_endpoint_v3_ClusterLoadAssignment *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); }
-UPB_INLINE size_t envoy_config_endpoint_v3_ClusterLoadAssignment_named_endpoints_size(const envoy_config_endpoint_v3_ClusterLoadAssignment *msg) {return _upb_msg_map_size(msg, UPB_SIZE(16, 32)); }
-UPB_INLINE bool envoy_config_endpoint_v3_ClusterLoadAssignment_named_endpoints_get(const envoy_config_endpoint_v3_ClusterLoadAssignment *msg, upb_strview key, struct envoy_config_endpoint_v3_Endpoint* *val) { return _upb_msg_map_get(msg, UPB_SIZE(16, 32), &key, 0, val, sizeof(*val)); }
-UPB_INLINE const envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry* envoy_config_endpoint_v3_ClusterLoadAssignment_named_endpoints_next(const envoy_config_endpoint_v3_ClusterLoadAssignment *msg, size_t* iter) { return (const envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry*)_upb_msg_map_next(msg, UPB_SIZE(16, 32), iter); }
-
-UPB_INLINE void envoy_config_endpoint_v3_ClusterLoadAssignment_set_cluster_name(envoy_config_endpoint_v3_ClusterLoadAssignment *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-UPB_INLINE struct envoy_config_endpoint_v3_LocalityLbEndpoints** envoy_config_endpoint_v3_ClusterLoadAssignment_mutable_endpoints(envoy_config_endpoint_v3_ClusterLoadAssignment *msg, size_t *len) {
- return (struct envoy_config_endpoint_v3_LocalityLbEndpoints**)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 24), len);
-}
-UPB_INLINE struct envoy_config_endpoint_v3_LocalityLbEndpoints** envoy_config_endpoint_v3_ClusterLoadAssignment_resize_endpoints(envoy_config_endpoint_v3_ClusterLoadAssignment *msg, size_t len, upb_arena *arena) {
- return (struct envoy_config_endpoint_v3_LocalityLbEndpoints**)_upb_array_resize_accessor(msg, UPB_SIZE(12, 24), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_config_endpoint_v3_LocalityLbEndpoints* envoy_config_endpoint_v3_ClusterLoadAssignment_add_endpoints(envoy_config_endpoint_v3_ClusterLoadAssignment *msg, upb_arena *arena) {
- struct envoy_config_endpoint_v3_LocalityLbEndpoints* sub = (struct envoy_config_endpoint_v3_LocalityLbEndpoints*)_upb_msg_new(&envoy_config_endpoint_v3_LocalityLbEndpoints_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(12, 24), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-UPB_INLINE void envoy_config_endpoint_v3_ClusterLoadAssignment_set_policy(envoy_config_endpoint_v3_ClusterLoadAssignment *msg, envoy_config_endpoint_v3_ClusterLoadAssignment_Policy* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), envoy_config_endpoint_v3_ClusterLoadAssignment_Policy*) = value;
-}
-UPB_INLINE struct envoy_config_endpoint_v3_ClusterLoadAssignment_Policy* envoy_config_endpoint_v3_ClusterLoadAssignment_mutable_policy(envoy_config_endpoint_v3_ClusterLoadAssignment *msg, upb_arena *arena) {
- struct envoy_config_endpoint_v3_ClusterLoadAssignment_Policy* sub = (struct envoy_config_endpoint_v3_ClusterLoadAssignment_Policy*)envoy_config_endpoint_v3_ClusterLoadAssignment_policy(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_endpoint_v3_ClusterLoadAssignment_Policy*)_upb_msg_new(&envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_msginit, arena);
- if (!sub) return NULL;
- envoy_config_endpoint_v3_ClusterLoadAssignment_set_policy(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_endpoint_v3_ClusterLoadAssignment_named_endpoints_clear(envoy_config_endpoint_v3_ClusterLoadAssignment *msg) { _upb_msg_map_clear(msg, UPB_SIZE(16, 32)); }
-UPB_INLINE bool envoy_config_endpoint_v3_ClusterLoadAssignment_named_endpoints_set(envoy_config_endpoint_v3_ClusterLoadAssignment *msg, upb_strview key, struct envoy_config_endpoint_v3_Endpoint* val, upb_arena *a) { return _upb_msg_map_set(msg, UPB_SIZE(16, 32), &key, 0, &val, sizeof(val), a); }
-UPB_INLINE bool envoy_config_endpoint_v3_ClusterLoadAssignment_named_endpoints_delete(envoy_config_endpoint_v3_ClusterLoadAssignment *msg, upb_strview key) { return _upb_msg_map_delete(msg, UPB_SIZE(16, 32), &key, 0); }
-UPB_INLINE envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry* envoy_config_endpoint_v3_ClusterLoadAssignment_named_endpoints_nextmutable(envoy_config_endpoint_v3_ClusterLoadAssignment *msg, size_t* iter) { return (envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry*)_upb_msg_map_next(msg, UPB_SIZE(16, 32), iter); }
-
-/* envoy.config.endpoint.v3.ClusterLoadAssignment.Policy */
-
-UPB_INLINE envoy_config_endpoint_v3_ClusterLoadAssignment_Policy *envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_new(upb_arena *arena) {
- return (envoy_config_endpoint_v3_ClusterLoadAssignment_Policy *)_upb_msg_new(&envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_msginit, arena);
-}
-UPB_INLINE envoy_config_endpoint_v3_ClusterLoadAssignment_Policy *envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_endpoint_v3_ClusterLoadAssignment_Policy *ret = envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_serialize(const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_has_drop_overloads(const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload* const* envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_drop_overloads(const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy *msg, size_t *len) { return (const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload* const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len); }
-UPB_INLINE bool envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_has_overprovisioning_factor(const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_overprovisioning_factor(const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct google_protobuf_UInt32Value*); }
-UPB_INLINE bool envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_has_endpoint_stale_after(const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
-UPB_INLINE const struct google_protobuf_Duration* envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_endpoint_stale_after(const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_Duration*); }
-
-UPB_INLINE envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload** envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_mutable_drop_overloads(envoy_config_endpoint_v3_ClusterLoadAssignment_Policy *msg, size_t *len) {
- return (envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload**)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len);
-}
-UPB_INLINE envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload** envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_resize_drop_overloads(envoy_config_endpoint_v3_ClusterLoadAssignment_Policy *msg, size_t len, upb_arena *arena) {
- return (envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload**)_upb_array_resize_accessor(msg, UPB_SIZE(8, 16), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload* envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_add_drop_overloads(envoy_config_endpoint_v3_ClusterLoadAssignment_Policy *msg, upb_arena *arena) {
- struct envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload* sub = (struct envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload*)_upb_msg_new(&envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(8, 16), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-UPB_INLINE void envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_set_overprovisioning_factor(envoy_config_endpoint_v3_ClusterLoadAssignment_Policy *msg, struct google_protobuf_UInt32Value* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct google_protobuf_UInt32Value*) = value;
-}
-UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_mutable_overprovisioning_factor(envoy_config_endpoint_v3_ClusterLoadAssignment_Policy *msg, upb_arena *arena) {
- struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_overprovisioning_factor(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
- if (!sub) return NULL;
- envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_set_overprovisioning_factor(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_set_endpoint_stale_after(envoy_config_endpoint_v3_ClusterLoadAssignment_Policy *msg, struct google_protobuf_Duration* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_Duration*) = value;
-}
-UPB_INLINE struct google_protobuf_Duration* envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_mutable_endpoint_stale_after(envoy_config_endpoint_v3_ClusterLoadAssignment_Policy *msg, upb_arena *arena) {
- struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_endpoint_stale_after(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
- if (!sub) return NULL;
- envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_set_endpoint_stale_after(msg, sub);
- }
- return sub;
-}
-
-/* envoy.config.endpoint.v3.ClusterLoadAssignment.Policy.DropOverload */
-
-UPB_INLINE envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload *envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_new(upb_arena *arena) {
- return (envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload *)_upb_msg_new(&envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_msginit, arena);
-}
-UPB_INLINE envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload *envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload *ret = envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_serialize(const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_category(const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE bool envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_has_drop_percentage(const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const struct envoy_type_v3_FractionalPercent* envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_drop_percentage(const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct envoy_type_v3_FractionalPercent*); }
-
-UPB_INLINE void envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_set_category(envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_set_drop_percentage(envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload *msg, struct envoy_type_v3_FractionalPercent* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct envoy_type_v3_FractionalPercent*) = value;
-}
-UPB_INLINE struct envoy_type_v3_FractionalPercent* envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_mutable_drop_percentage(envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload *msg, upb_arena *arena) {
- struct envoy_type_v3_FractionalPercent* sub = (struct envoy_type_v3_FractionalPercent*)envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_drop_percentage(msg);
- if (sub == NULL) {
- sub = (struct envoy_type_v3_FractionalPercent*)_upb_msg_new(&envoy_type_v3_FractionalPercent_msginit, arena);
- if (!sub) return NULL;
- envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_set_drop_percentage(msg, sub);
- }
- return sub;
-}
-
-/* envoy.config.endpoint.v3.ClusterLoadAssignment.NamedEndpointsEntry */
-
-UPB_INLINE upb_strview envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry_key(const envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry *msg) {
- upb_strview ret;
- _upb_msg_map_key(msg, &ret, 0);
- return ret;
-}
-UPB_INLINE bool envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry_has_value(const envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const struct envoy_config_endpoint_v3_Endpoint* envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry_value(const envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry *msg) {
- struct envoy_config_endpoint_v3_Endpoint* ret;
- _upb_msg_map_value(msg, &ret, sizeof(ret));
- return ret;
-}
-
-UPB_INLINE void envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry_set_value(envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry *msg, struct envoy_config_endpoint_v3_Endpoint* value) {
- _upb_msg_map_set_value(msg, &value, sizeof(struct envoy_config_endpoint_v3_Endpoint*));
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* ENVOY_CONFIG_ENDPOINT_V3_ENDPOINT_PROTO_UPB_H_ */
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/endpoint/v3/endpoint.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_CONFIG_ENDPOINT_V3_ENDPOINT_PROTO_UPB_H_
+#define ENVOY_CONFIG_ENDPOINT_V3_ENDPOINT_PROTO_UPB_H_
+
+#include "upb/msg.h"
+#include "upb/decode.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_config_endpoint_v3_ClusterLoadAssignment;
+struct envoy_config_endpoint_v3_ClusterLoadAssignment_Policy;
+struct envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload;
+struct envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry;
+typedef struct envoy_config_endpoint_v3_ClusterLoadAssignment envoy_config_endpoint_v3_ClusterLoadAssignment;
+typedef struct envoy_config_endpoint_v3_ClusterLoadAssignment_Policy envoy_config_endpoint_v3_ClusterLoadAssignment_Policy;
+typedef struct envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload;
+typedef struct envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry;
+extern const upb_msglayout envoy_config_endpoint_v3_ClusterLoadAssignment_msginit;
+extern const upb_msglayout envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_msginit;
+extern const upb_msglayout envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_msginit;
+extern const upb_msglayout envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry_msginit;
+struct envoy_config_endpoint_v3_Endpoint;
+struct envoy_config_endpoint_v3_LocalityLbEndpoints;
+struct envoy_type_v3_FractionalPercent;
+struct google_protobuf_Duration;
+struct google_protobuf_UInt32Value;
+extern const upb_msglayout envoy_config_endpoint_v3_Endpoint_msginit;
+extern const upb_msglayout envoy_config_endpoint_v3_LocalityLbEndpoints_msginit;
+extern const upb_msglayout envoy_type_v3_FractionalPercent_msginit;
+extern const upb_msglayout google_protobuf_Duration_msginit;
+extern const upb_msglayout google_protobuf_UInt32Value_msginit;
+
+
+/* envoy.config.endpoint.v3.ClusterLoadAssignment */
+
+UPB_INLINE envoy_config_endpoint_v3_ClusterLoadAssignment *envoy_config_endpoint_v3_ClusterLoadAssignment_new(upb_arena *arena) {
+ return (envoy_config_endpoint_v3_ClusterLoadAssignment *)_upb_msg_new(&envoy_config_endpoint_v3_ClusterLoadAssignment_msginit, arena);
+}
+UPB_INLINE envoy_config_endpoint_v3_ClusterLoadAssignment *envoy_config_endpoint_v3_ClusterLoadAssignment_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_endpoint_v3_ClusterLoadAssignment *ret = envoy_config_endpoint_v3_ClusterLoadAssignment_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_endpoint_v3_ClusterLoadAssignment_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_endpoint_v3_ClusterLoadAssignment_serialize(const envoy_config_endpoint_v3_ClusterLoadAssignment *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_endpoint_v3_ClusterLoadAssignment_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview envoy_config_endpoint_v3_ClusterLoadAssignment_cluster_name(const envoy_config_endpoint_v3_ClusterLoadAssignment *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE bool envoy_config_endpoint_v3_ClusterLoadAssignment_has_endpoints(const envoy_config_endpoint_v3_ClusterLoadAssignment *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
+UPB_INLINE const struct envoy_config_endpoint_v3_LocalityLbEndpoints* const* envoy_config_endpoint_v3_ClusterLoadAssignment_endpoints(const envoy_config_endpoint_v3_ClusterLoadAssignment *msg, size_t *len) { return (const struct envoy_config_endpoint_v3_LocalityLbEndpoints* const*)_upb_array_accessor(msg, UPB_SIZE(12, 24), len); }
+UPB_INLINE bool envoy_config_endpoint_v3_ClusterLoadAssignment_has_policy(const envoy_config_endpoint_v3_ClusterLoadAssignment *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
+UPB_INLINE const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy* envoy_config_endpoint_v3_ClusterLoadAssignment_policy(const envoy_config_endpoint_v3_ClusterLoadAssignment *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy*); }
+UPB_INLINE bool envoy_config_endpoint_v3_ClusterLoadAssignment_has_named_endpoints(const envoy_config_endpoint_v3_ClusterLoadAssignment *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); }
+UPB_INLINE size_t envoy_config_endpoint_v3_ClusterLoadAssignment_named_endpoints_size(const envoy_config_endpoint_v3_ClusterLoadAssignment *msg) {return _upb_msg_map_size(msg, UPB_SIZE(16, 32)); }
+UPB_INLINE bool envoy_config_endpoint_v3_ClusterLoadAssignment_named_endpoints_get(const envoy_config_endpoint_v3_ClusterLoadAssignment *msg, upb_strview key, struct envoy_config_endpoint_v3_Endpoint* *val) { return _upb_msg_map_get(msg, UPB_SIZE(16, 32), &key, 0, val, sizeof(*val)); }
+UPB_INLINE const envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry* envoy_config_endpoint_v3_ClusterLoadAssignment_named_endpoints_next(const envoy_config_endpoint_v3_ClusterLoadAssignment *msg, size_t* iter) { return (const envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry*)_upb_msg_map_next(msg, UPB_SIZE(16, 32), iter); }
+
+UPB_INLINE void envoy_config_endpoint_v3_ClusterLoadAssignment_set_cluster_name(envoy_config_endpoint_v3_ClusterLoadAssignment *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+UPB_INLINE struct envoy_config_endpoint_v3_LocalityLbEndpoints** envoy_config_endpoint_v3_ClusterLoadAssignment_mutable_endpoints(envoy_config_endpoint_v3_ClusterLoadAssignment *msg, size_t *len) {
+ return (struct envoy_config_endpoint_v3_LocalityLbEndpoints**)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 24), len);
+}
+UPB_INLINE struct envoy_config_endpoint_v3_LocalityLbEndpoints** envoy_config_endpoint_v3_ClusterLoadAssignment_resize_endpoints(envoy_config_endpoint_v3_ClusterLoadAssignment *msg, size_t len, upb_arena *arena) {
+ return (struct envoy_config_endpoint_v3_LocalityLbEndpoints**)_upb_array_resize_accessor(msg, UPB_SIZE(12, 24), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_config_endpoint_v3_LocalityLbEndpoints* envoy_config_endpoint_v3_ClusterLoadAssignment_add_endpoints(envoy_config_endpoint_v3_ClusterLoadAssignment *msg, upb_arena *arena) {
+ struct envoy_config_endpoint_v3_LocalityLbEndpoints* sub = (struct envoy_config_endpoint_v3_LocalityLbEndpoints*)_upb_msg_new(&envoy_config_endpoint_v3_LocalityLbEndpoints_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(12, 24), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE void envoy_config_endpoint_v3_ClusterLoadAssignment_set_policy(envoy_config_endpoint_v3_ClusterLoadAssignment *msg, envoy_config_endpoint_v3_ClusterLoadAssignment_Policy* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), envoy_config_endpoint_v3_ClusterLoadAssignment_Policy*) = value;
+}
+UPB_INLINE struct envoy_config_endpoint_v3_ClusterLoadAssignment_Policy* envoy_config_endpoint_v3_ClusterLoadAssignment_mutable_policy(envoy_config_endpoint_v3_ClusterLoadAssignment *msg, upb_arena *arena) {
+ struct envoy_config_endpoint_v3_ClusterLoadAssignment_Policy* sub = (struct envoy_config_endpoint_v3_ClusterLoadAssignment_Policy*)envoy_config_endpoint_v3_ClusterLoadAssignment_policy(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_endpoint_v3_ClusterLoadAssignment_Policy*)_upb_msg_new(&envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_endpoint_v3_ClusterLoadAssignment_set_policy(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_endpoint_v3_ClusterLoadAssignment_named_endpoints_clear(envoy_config_endpoint_v3_ClusterLoadAssignment *msg) { _upb_msg_map_clear(msg, UPB_SIZE(16, 32)); }
+UPB_INLINE bool envoy_config_endpoint_v3_ClusterLoadAssignment_named_endpoints_set(envoy_config_endpoint_v3_ClusterLoadAssignment *msg, upb_strview key, struct envoy_config_endpoint_v3_Endpoint* val, upb_arena *a) { return _upb_msg_map_set(msg, UPB_SIZE(16, 32), &key, 0, &val, sizeof(val), a); }
+UPB_INLINE bool envoy_config_endpoint_v3_ClusterLoadAssignment_named_endpoints_delete(envoy_config_endpoint_v3_ClusterLoadAssignment *msg, upb_strview key) { return _upb_msg_map_delete(msg, UPB_SIZE(16, 32), &key, 0); }
+UPB_INLINE envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry* envoy_config_endpoint_v3_ClusterLoadAssignment_named_endpoints_nextmutable(envoy_config_endpoint_v3_ClusterLoadAssignment *msg, size_t* iter) { return (envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry*)_upb_msg_map_next(msg, UPB_SIZE(16, 32), iter); }
+
+/* envoy.config.endpoint.v3.ClusterLoadAssignment.Policy */
+
+UPB_INLINE envoy_config_endpoint_v3_ClusterLoadAssignment_Policy *envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_new(upb_arena *arena) {
+ return (envoy_config_endpoint_v3_ClusterLoadAssignment_Policy *)_upb_msg_new(&envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_msginit, arena);
+}
+UPB_INLINE envoy_config_endpoint_v3_ClusterLoadAssignment_Policy *envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_endpoint_v3_ClusterLoadAssignment_Policy *ret = envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_serialize(const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_has_drop_overloads(const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
+UPB_INLINE const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload* const* envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_drop_overloads(const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy *msg, size_t *len) { return (const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload* const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len); }
+UPB_INLINE bool envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_has_overprovisioning_factor(const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_overprovisioning_factor(const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct google_protobuf_UInt32Value*); }
+UPB_INLINE bool envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_has_endpoint_stale_after(const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
+UPB_INLINE const struct google_protobuf_Duration* envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_endpoint_stale_after(const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_Duration*); }
+
+UPB_INLINE envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload** envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_mutable_drop_overloads(envoy_config_endpoint_v3_ClusterLoadAssignment_Policy *msg, size_t *len) {
+ return (envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload**)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len);
+}
+UPB_INLINE envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload** envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_resize_drop_overloads(envoy_config_endpoint_v3_ClusterLoadAssignment_Policy *msg, size_t len, upb_arena *arena) {
+ return (envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload**)_upb_array_resize_accessor(msg, UPB_SIZE(8, 16), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload* envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_add_drop_overloads(envoy_config_endpoint_v3_ClusterLoadAssignment_Policy *msg, upb_arena *arena) {
+ struct envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload* sub = (struct envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload*)_upb_msg_new(&envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(8, 16), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE void envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_set_overprovisioning_factor(envoy_config_endpoint_v3_ClusterLoadAssignment_Policy *msg, struct google_protobuf_UInt32Value* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_mutable_overprovisioning_factor(envoy_config_endpoint_v3_ClusterLoadAssignment_Policy *msg, upb_arena *arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_overprovisioning_factor(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_set_overprovisioning_factor(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_set_endpoint_stale_after(envoy_config_endpoint_v3_ClusterLoadAssignment_Policy *msg, struct google_protobuf_Duration* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_Duration*) = value;
+}
+UPB_INLINE struct google_protobuf_Duration* envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_mutable_endpoint_stale_after(envoy_config_endpoint_v3_ClusterLoadAssignment_Policy *msg, upb_arena *arena) {
+ struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_endpoint_stale_after(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_set_endpoint_stale_after(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.endpoint.v3.ClusterLoadAssignment.Policy.DropOverload */
+
+UPB_INLINE envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload *envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_new(upb_arena *arena) {
+ return (envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload *)_upb_msg_new(&envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_msginit, arena);
+}
+UPB_INLINE envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload *envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload *ret = envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_serialize(const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_category(const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE bool envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_has_drop_percentage(const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
+UPB_INLINE const struct envoy_type_v3_FractionalPercent* envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_drop_percentage(const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct envoy_type_v3_FractionalPercent*); }
+
+UPB_INLINE void envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_set_category(envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_set_drop_percentage(envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload *msg, struct envoy_type_v3_FractionalPercent* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct envoy_type_v3_FractionalPercent*) = value;
+}
+UPB_INLINE struct envoy_type_v3_FractionalPercent* envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_mutable_drop_percentage(envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload *msg, upb_arena *arena) {
+ struct envoy_type_v3_FractionalPercent* sub = (struct envoy_type_v3_FractionalPercent*)envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_drop_percentage(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_type_v3_FractionalPercent*)_upb_msg_new(&envoy_type_v3_FractionalPercent_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_set_drop_percentage(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.endpoint.v3.ClusterLoadAssignment.NamedEndpointsEntry */
+
+UPB_INLINE upb_strview envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry_key(const envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry *msg) {
+ upb_strview ret;
+ _upb_msg_map_key(msg, &ret, 0);
+ return ret;
+}
+UPB_INLINE bool envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry_has_value(const envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
+UPB_INLINE const struct envoy_config_endpoint_v3_Endpoint* envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry_value(const envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry *msg) {
+ struct envoy_config_endpoint_v3_Endpoint* ret;
+ _upb_msg_map_value(msg, &ret, sizeof(ret));
+ return ret;
+}
+
+UPB_INLINE void envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry_set_value(envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry *msg, struct envoy_config_endpoint_v3_Endpoint* value) {
+ _upb_msg_map_set_value(msg, &value, sizeof(struct envoy_config_endpoint_v3_Endpoint*));
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_CONFIG_ENDPOINT_V3_ENDPOINT_PROTO_UPB_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.c
index 9ad12869f0f..fbd0ce86273 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.c
@@ -1,91 +1,91 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/config/endpoint/v3/endpoint_components.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include <stddef.h>
-#include "upb/msg.h"
-#include "envoy/config/endpoint/v3/endpoint_components.upb.h"
-#include "envoy/config/core/v3/address.upb.h"
-#include "envoy/config/core/v3/base.upb.h"
-#include "envoy/config/core/v3/health_check.upb.h"
-#include "google/protobuf/wrappers.upb.h"
-#include "udpa/annotations/status.upb.h"
-#include "udpa/annotations/versioning.upb.h"
-#include "validate/validate.upb.h"
-
-#include "upb/port_def.inc"
-
-static const upb_msglayout *const envoy_config_endpoint_v3_Endpoint_submsgs[2] = {
- &envoy_config_core_v3_Address_msginit,
- &envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_msginit,
-};
-
-static const upb_msglayout_field envoy_config_endpoint_v3_Endpoint__fields[3] = {
- {1, UPB_SIZE(8, 16), 0, 0, 11, 1},
- {2, UPB_SIZE(12, 24), 0, 1, 11, 1},
- {3, UPB_SIZE(0, 0), 0, 0, 9, 1},
-};
-
-const upb_msglayout envoy_config_endpoint_v3_Endpoint_msginit = {
- &envoy_config_endpoint_v3_Endpoint_submsgs[0],
- &envoy_config_endpoint_v3_Endpoint__fields[0],
- UPB_SIZE(16, 32), 3, false,
-};
-
-static const upb_msglayout_field envoy_config_endpoint_v3_Endpoint_HealthCheckConfig__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 13, 1},
- {2, UPB_SIZE(4, 8), 0, 0, 9, 1},
-};
-
-const upb_msglayout envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_msginit = {
- NULL,
- &envoy_config_endpoint_v3_Endpoint_HealthCheckConfig__fields[0],
- UPB_SIZE(16, 32), 2, false,
-};
-
-static const upb_msglayout *const envoy_config_endpoint_v3_LbEndpoint_submsgs[3] = {
- &envoy_config_core_v3_Metadata_msginit,
- &envoy_config_endpoint_v3_Endpoint_msginit,
- &google_protobuf_UInt32Value_msginit,
-};
-
-static const upb_msglayout_field envoy_config_endpoint_v3_LbEndpoint__fields[5] = {
- {1, UPB_SIZE(16, 24), UPB_SIZE(-25, -41), 1, 11, 1},
- {2, UPB_SIZE(0, 0), 0, 0, 14, 1},
- {3, UPB_SIZE(8, 8), 0, 0, 11, 1},
- {4, UPB_SIZE(12, 16), 0, 2, 11, 1},
- {5, UPB_SIZE(16, 24), UPB_SIZE(-25, -41), 0, 9, 1},
-};
-
-const upb_msglayout envoy_config_endpoint_v3_LbEndpoint_msginit = {
- &envoy_config_endpoint_v3_LbEndpoint_submsgs[0],
- &envoy_config_endpoint_v3_LbEndpoint__fields[0],
- UPB_SIZE(32, 48), 5, false,
-};
-
-static const upb_msglayout *const envoy_config_endpoint_v3_LocalityLbEndpoints_submsgs[4] = {
- &envoy_config_core_v3_Locality_msginit,
- &envoy_config_endpoint_v3_LbEndpoint_msginit,
- &google_protobuf_UInt32Value_msginit,
-};
-
-static const upb_msglayout_field envoy_config_endpoint_v3_LocalityLbEndpoints__fields[5] = {
- {1, UPB_SIZE(4, 8), 0, 0, 11, 1},
- {2, UPB_SIZE(16, 32), 0, 1, 11, 3},
- {3, UPB_SIZE(8, 16), 0, 2, 11, 1},
- {5, UPB_SIZE(0, 0), 0, 0, 13, 1},
- {6, UPB_SIZE(12, 24), 0, 2, 11, 1},
-};
-
-const upb_msglayout envoy_config_endpoint_v3_LocalityLbEndpoints_msginit = {
- &envoy_config_endpoint_v3_LocalityLbEndpoints_submsgs[0],
- &envoy_config_endpoint_v3_LocalityLbEndpoints__fields[0],
- UPB_SIZE(20, 40), 5, false,
-};
-
-#include "upb/port_undef.inc"
-
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/endpoint/v3/endpoint_components.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg.h"
+#include "envoy/config/endpoint/v3/endpoint_components.upb.h"
+#include "envoy/config/core/v3/address.upb.h"
+#include "envoy/config/core/v3/base.upb.h"
+#include "envoy/config/core/v3/health_check.upb.h"
+#include "google/protobuf/wrappers.upb.h"
+#include "udpa/annotations/status.upb.h"
+#include "udpa/annotations/versioning.upb.h"
+#include "validate/validate.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_msglayout *const envoy_config_endpoint_v3_Endpoint_submsgs[2] = {
+ &envoy_config_core_v3_Address_msginit,
+ &envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_msginit,
+};
+
+static const upb_msglayout_field envoy_config_endpoint_v3_Endpoint__fields[3] = {
+ {1, UPB_SIZE(8, 16), 0, 0, 11, 1},
+ {2, UPB_SIZE(12, 24), 0, 1, 11, 1},
+ {3, UPB_SIZE(0, 0), 0, 0, 9, 1},
+};
+
+const upb_msglayout envoy_config_endpoint_v3_Endpoint_msginit = {
+ &envoy_config_endpoint_v3_Endpoint_submsgs[0],
+ &envoy_config_endpoint_v3_Endpoint__fields[0],
+ UPB_SIZE(16, 32), 3, false,
+};
+
+static const upb_msglayout_field envoy_config_endpoint_v3_Endpoint_HealthCheckConfig__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 13, 1},
+ {2, UPB_SIZE(4, 8), 0, 0, 9, 1},
+};
+
+const upb_msglayout envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_msginit = {
+ NULL,
+ &envoy_config_endpoint_v3_Endpoint_HealthCheckConfig__fields[0],
+ UPB_SIZE(16, 32), 2, false,
+};
+
+static const upb_msglayout *const envoy_config_endpoint_v3_LbEndpoint_submsgs[3] = {
+ &envoy_config_core_v3_Metadata_msginit,
+ &envoy_config_endpoint_v3_Endpoint_msginit,
+ &google_protobuf_UInt32Value_msginit,
+};
+
+static const upb_msglayout_field envoy_config_endpoint_v3_LbEndpoint__fields[5] = {
+ {1, UPB_SIZE(16, 24), UPB_SIZE(-25, -41), 1, 11, 1},
+ {2, UPB_SIZE(0, 0), 0, 0, 14, 1},
+ {3, UPB_SIZE(8, 8), 0, 0, 11, 1},
+ {4, UPB_SIZE(12, 16), 0, 2, 11, 1},
+ {5, UPB_SIZE(16, 24), UPB_SIZE(-25, -41), 0, 9, 1},
+};
+
+const upb_msglayout envoy_config_endpoint_v3_LbEndpoint_msginit = {
+ &envoy_config_endpoint_v3_LbEndpoint_submsgs[0],
+ &envoy_config_endpoint_v3_LbEndpoint__fields[0],
+ UPB_SIZE(32, 48), 5, false,
+};
+
+static const upb_msglayout *const envoy_config_endpoint_v3_LocalityLbEndpoints_submsgs[4] = {
+ &envoy_config_core_v3_Locality_msginit,
+ &envoy_config_endpoint_v3_LbEndpoint_msginit,
+ &google_protobuf_UInt32Value_msginit,
+};
+
+static const upb_msglayout_field envoy_config_endpoint_v3_LocalityLbEndpoints__fields[5] = {
+ {1, UPB_SIZE(4, 8), 0, 0, 11, 1},
+ {2, UPB_SIZE(16, 32), 0, 1, 11, 3},
+ {3, UPB_SIZE(8, 16), 0, 2, 11, 1},
+ {5, UPB_SIZE(0, 0), 0, 0, 13, 1},
+ {6, UPB_SIZE(12, 24), 0, 2, 11, 1},
+};
+
+const upb_msglayout envoy_config_endpoint_v3_LocalityLbEndpoints_msginit = {
+ &envoy_config_endpoint_v3_LocalityLbEndpoints_submsgs[0],
+ &envoy_config_endpoint_v3_LocalityLbEndpoints__fields[0],
+ UPB_SIZE(20, 40), 5, false,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.h
index 0355e7af0b9..56d20024b0b 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.h
@@ -1,273 +1,273 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/config/endpoint/v3/endpoint_components.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef ENVOY_CONFIG_ENDPOINT_V3_ENDPOINT_COMPONENTS_PROTO_UPB_H_
-#define ENVOY_CONFIG_ENDPOINT_V3_ENDPOINT_COMPONENTS_PROTO_UPB_H_
-
-#include "upb/msg.h"
-#include "upb/decode.h"
-#include "upb/encode.h"
-
-#include "upb/port_def.inc"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct envoy_config_endpoint_v3_Endpoint;
-struct envoy_config_endpoint_v3_Endpoint_HealthCheckConfig;
-struct envoy_config_endpoint_v3_LbEndpoint;
-struct envoy_config_endpoint_v3_LocalityLbEndpoints;
-typedef struct envoy_config_endpoint_v3_Endpoint envoy_config_endpoint_v3_Endpoint;
-typedef struct envoy_config_endpoint_v3_Endpoint_HealthCheckConfig envoy_config_endpoint_v3_Endpoint_HealthCheckConfig;
-typedef struct envoy_config_endpoint_v3_LbEndpoint envoy_config_endpoint_v3_LbEndpoint;
-typedef struct envoy_config_endpoint_v3_LocalityLbEndpoints envoy_config_endpoint_v3_LocalityLbEndpoints;
-extern const upb_msglayout envoy_config_endpoint_v3_Endpoint_msginit;
-extern const upb_msglayout envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_msginit;
-extern const upb_msglayout envoy_config_endpoint_v3_LbEndpoint_msginit;
-extern const upb_msglayout envoy_config_endpoint_v3_LocalityLbEndpoints_msginit;
-struct envoy_config_core_v3_Address;
-struct envoy_config_core_v3_Locality;
-struct envoy_config_core_v3_Metadata;
-struct google_protobuf_UInt32Value;
-extern const upb_msglayout envoy_config_core_v3_Address_msginit;
-extern const upb_msglayout envoy_config_core_v3_Locality_msginit;
-extern const upb_msglayout envoy_config_core_v3_Metadata_msginit;
-extern const upb_msglayout google_protobuf_UInt32Value_msginit;
-
-
-/* envoy.config.endpoint.v3.Endpoint */
-
-UPB_INLINE envoy_config_endpoint_v3_Endpoint *envoy_config_endpoint_v3_Endpoint_new(upb_arena *arena) {
- return (envoy_config_endpoint_v3_Endpoint *)_upb_msg_new(&envoy_config_endpoint_v3_Endpoint_msginit, arena);
-}
-UPB_INLINE envoy_config_endpoint_v3_Endpoint *envoy_config_endpoint_v3_Endpoint_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_endpoint_v3_Endpoint *ret = envoy_config_endpoint_v3_Endpoint_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_endpoint_v3_Endpoint_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_endpoint_v3_Endpoint_serialize(const envoy_config_endpoint_v3_Endpoint *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_endpoint_v3_Endpoint_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_config_endpoint_v3_Endpoint_has_address(const envoy_config_endpoint_v3_Endpoint *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const struct envoy_config_core_v3_Address* envoy_config_endpoint_v3_Endpoint_address(const envoy_config_endpoint_v3_Endpoint *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct envoy_config_core_v3_Address*); }
-UPB_INLINE bool envoy_config_endpoint_v3_Endpoint_has_health_check_config(const envoy_config_endpoint_v3_Endpoint *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
-UPB_INLINE const envoy_config_endpoint_v3_Endpoint_HealthCheckConfig* envoy_config_endpoint_v3_Endpoint_health_check_config(const envoy_config_endpoint_v3_Endpoint *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const envoy_config_endpoint_v3_Endpoint_HealthCheckConfig*); }
-UPB_INLINE upb_strview envoy_config_endpoint_v3_Endpoint_hostname(const envoy_config_endpoint_v3_Endpoint *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-
-UPB_INLINE void envoy_config_endpoint_v3_Endpoint_set_address(envoy_config_endpoint_v3_Endpoint *msg, struct envoy_config_core_v3_Address* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct envoy_config_core_v3_Address*) = value;
-}
-UPB_INLINE struct envoy_config_core_v3_Address* envoy_config_endpoint_v3_Endpoint_mutable_address(envoy_config_endpoint_v3_Endpoint *msg, upb_arena *arena) {
- struct envoy_config_core_v3_Address* sub = (struct envoy_config_core_v3_Address*)envoy_config_endpoint_v3_Endpoint_address(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_Address*)_upb_msg_new(&envoy_config_core_v3_Address_msginit, arena);
- if (!sub) return NULL;
- envoy_config_endpoint_v3_Endpoint_set_address(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_endpoint_v3_Endpoint_set_health_check_config(envoy_config_endpoint_v3_Endpoint *msg, envoy_config_endpoint_v3_Endpoint_HealthCheckConfig* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), envoy_config_endpoint_v3_Endpoint_HealthCheckConfig*) = value;
-}
-UPB_INLINE struct envoy_config_endpoint_v3_Endpoint_HealthCheckConfig* envoy_config_endpoint_v3_Endpoint_mutable_health_check_config(envoy_config_endpoint_v3_Endpoint *msg, upb_arena *arena) {
- struct envoy_config_endpoint_v3_Endpoint_HealthCheckConfig* sub = (struct envoy_config_endpoint_v3_Endpoint_HealthCheckConfig*)envoy_config_endpoint_v3_Endpoint_health_check_config(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_endpoint_v3_Endpoint_HealthCheckConfig*)_upb_msg_new(&envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_msginit, arena);
- if (!sub) return NULL;
- envoy_config_endpoint_v3_Endpoint_set_health_check_config(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_endpoint_v3_Endpoint_set_hostname(envoy_config_endpoint_v3_Endpoint *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-
-/* envoy.config.endpoint.v3.Endpoint.HealthCheckConfig */
-
-UPB_INLINE envoy_config_endpoint_v3_Endpoint_HealthCheckConfig *envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_new(upb_arena *arena) {
- return (envoy_config_endpoint_v3_Endpoint_HealthCheckConfig *)_upb_msg_new(&envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_msginit, arena);
-}
-UPB_INLINE envoy_config_endpoint_v3_Endpoint_HealthCheckConfig *envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_endpoint_v3_Endpoint_HealthCheckConfig *ret = envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_serialize(const envoy_config_endpoint_v3_Endpoint_HealthCheckConfig *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_msginit, arena, len);
-}
-
-UPB_INLINE uint32_t envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_port_value(const envoy_config_endpoint_v3_Endpoint_HealthCheckConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t); }
-UPB_INLINE upb_strview envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_hostname(const envoy_config_endpoint_v3_Endpoint_HealthCheckConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
-
-UPB_INLINE void envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_set_port_value(envoy_config_endpoint_v3_Endpoint_HealthCheckConfig *msg, uint32_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t) = value;
-}
-UPB_INLINE void envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_set_hostname(envoy_config_endpoint_v3_Endpoint_HealthCheckConfig *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
-}
-
-/* envoy.config.endpoint.v3.LbEndpoint */
-
-UPB_INLINE envoy_config_endpoint_v3_LbEndpoint *envoy_config_endpoint_v3_LbEndpoint_new(upb_arena *arena) {
- return (envoy_config_endpoint_v3_LbEndpoint *)_upb_msg_new(&envoy_config_endpoint_v3_LbEndpoint_msginit, arena);
-}
-UPB_INLINE envoy_config_endpoint_v3_LbEndpoint *envoy_config_endpoint_v3_LbEndpoint_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_endpoint_v3_LbEndpoint *ret = envoy_config_endpoint_v3_LbEndpoint_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_endpoint_v3_LbEndpoint_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_endpoint_v3_LbEndpoint_serialize(const envoy_config_endpoint_v3_LbEndpoint *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_endpoint_v3_LbEndpoint_msginit, arena, len);
-}
-
-typedef enum {
- envoy_config_endpoint_v3_LbEndpoint_host_identifier_endpoint = 1,
- envoy_config_endpoint_v3_LbEndpoint_host_identifier_endpoint_name = 5,
- envoy_config_endpoint_v3_LbEndpoint_host_identifier_NOT_SET = 0
-} envoy_config_endpoint_v3_LbEndpoint_host_identifier_oneofcases;
-UPB_INLINE envoy_config_endpoint_v3_LbEndpoint_host_identifier_oneofcases envoy_config_endpoint_v3_LbEndpoint_host_identifier_case(const envoy_config_endpoint_v3_LbEndpoint* msg) { return (envoy_config_endpoint_v3_LbEndpoint_host_identifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(24, 40), int32_t); }
-
-UPB_INLINE bool envoy_config_endpoint_v3_LbEndpoint_has_endpoint(const envoy_config_endpoint_v3_LbEndpoint *msg) { return _upb_getoneofcase(msg, UPB_SIZE(24, 40)) == 1; }
-UPB_INLINE const envoy_config_endpoint_v3_Endpoint* envoy_config_endpoint_v3_LbEndpoint_endpoint(const envoy_config_endpoint_v3_LbEndpoint *msg) { return UPB_READ_ONEOF(msg, const envoy_config_endpoint_v3_Endpoint*, UPB_SIZE(16, 24), UPB_SIZE(24, 40), 1, NULL); }
-UPB_INLINE int32_t envoy_config_endpoint_v3_LbEndpoint_health_status(const envoy_config_endpoint_v3_LbEndpoint *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
-UPB_INLINE bool envoy_config_endpoint_v3_LbEndpoint_has_metadata(const envoy_config_endpoint_v3_LbEndpoint *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 8)); }
-UPB_INLINE const struct envoy_config_core_v3_Metadata* envoy_config_endpoint_v3_LbEndpoint_metadata(const envoy_config_endpoint_v3_LbEndpoint *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const struct envoy_config_core_v3_Metadata*); }
-UPB_INLINE bool envoy_config_endpoint_v3_LbEndpoint_has_load_balancing_weight(const envoy_config_endpoint_v3_LbEndpoint *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 16)); }
-UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_endpoint_v3_LbEndpoint_load_balancing_weight(const envoy_config_endpoint_v3_LbEndpoint *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const struct google_protobuf_UInt32Value*); }
-UPB_INLINE bool envoy_config_endpoint_v3_LbEndpoint_has_endpoint_name(const envoy_config_endpoint_v3_LbEndpoint *msg) { return _upb_getoneofcase(msg, UPB_SIZE(24, 40)) == 5; }
-UPB_INLINE upb_strview envoy_config_endpoint_v3_LbEndpoint_endpoint_name(const envoy_config_endpoint_v3_LbEndpoint *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(16, 24), UPB_SIZE(24, 40), 5, upb_strview_make("", strlen(""))); }
-
-UPB_INLINE void envoy_config_endpoint_v3_LbEndpoint_set_endpoint(envoy_config_endpoint_v3_LbEndpoint *msg, envoy_config_endpoint_v3_Endpoint* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_endpoint_v3_Endpoint*, UPB_SIZE(16, 24), value, UPB_SIZE(24, 40), 1);
-}
-UPB_INLINE struct envoy_config_endpoint_v3_Endpoint* envoy_config_endpoint_v3_LbEndpoint_mutable_endpoint(envoy_config_endpoint_v3_LbEndpoint *msg, upb_arena *arena) {
- struct envoy_config_endpoint_v3_Endpoint* sub = (struct envoy_config_endpoint_v3_Endpoint*)envoy_config_endpoint_v3_LbEndpoint_endpoint(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_endpoint_v3_Endpoint*)_upb_msg_new(&envoy_config_endpoint_v3_Endpoint_msginit, arena);
- if (!sub) return NULL;
- envoy_config_endpoint_v3_LbEndpoint_set_endpoint(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_endpoint_v3_LbEndpoint_set_health_status(envoy_config_endpoint_v3_LbEndpoint *msg, int32_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
-}
-UPB_INLINE void envoy_config_endpoint_v3_LbEndpoint_set_metadata(envoy_config_endpoint_v3_LbEndpoint *msg, struct envoy_config_core_v3_Metadata* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), struct envoy_config_core_v3_Metadata*) = value;
-}
-UPB_INLINE struct envoy_config_core_v3_Metadata* envoy_config_endpoint_v3_LbEndpoint_mutable_metadata(envoy_config_endpoint_v3_LbEndpoint *msg, upb_arena *arena) {
- struct envoy_config_core_v3_Metadata* sub = (struct envoy_config_core_v3_Metadata*)envoy_config_endpoint_v3_LbEndpoint_metadata(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_Metadata*)_upb_msg_new(&envoy_config_core_v3_Metadata_msginit, arena);
- if (!sub) return NULL;
- envoy_config_endpoint_v3_LbEndpoint_set_metadata(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_endpoint_v3_LbEndpoint_set_load_balancing_weight(envoy_config_endpoint_v3_LbEndpoint *msg, struct google_protobuf_UInt32Value* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(12, 16), struct google_protobuf_UInt32Value*) = value;
-}
-UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_endpoint_v3_LbEndpoint_mutable_load_balancing_weight(envoy_config_endpoint_v3_LbEndpoint *msg, upb_arena *arena) {
- struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_endpoint_v3_LbEndpoint_load_balancing_weight(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
- if (!sub) return NULL;
- envoy_config_endpoint_v3_LbEndpoint_set_load_balancing_weight(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_endpoint_v3_LbEndpoint_set_endpoint_name(envoy_config_endpoint_v3_LbEndpoint *msg, upb_strview value) {
- UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(16, 24), value, UPB_SIZE(24, 40), 5);
-}
-
-/* envoy.config.endpoint.v3.LocalityLbEndpoints */
-
-UPB_INLINE envoy_config_endpoint_v3_LocalityLbEndpoints *envoy_config_endpoint_v3_LocalityLbEndpoints_new(upb_arena *arena) {
- return (envoy_config_endpoint_v3_LocalityLbEndpoints *)_upb_msg_new(&envoy_config_endpoint_v3_LocalityLbEndpoints_msginit, arena);
-}
-UPB_INLINE envoy_config_endpoint_v3_LocalityLbEndpoints *envoy_config_endpoint_v3_LocalityLbEndpoints_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_endpoint_v3_LocalityLbEndpoints *ret = envoy_config_endpoint_v3_LocalityLbEndpoints_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_endpoint_v3_LocalityLbEndpoints_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_endpoint_v3_LocalityLbEndpoints_serialize(const envoy_config_endpoint_v3_LocalityLbEndpoints *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_endpoint_v3_LocalityLbEndpoints_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_config_endpoint_v3_LocalityLbEndpoints_has_locality(const envoy_config_endpoint_v3_LocalityLbEndpoints *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
-UPB_INLINE const struct envoy_config_core_v3_Locality* envoy_config_endpoint_v3_LocalityLbEndpoints_locality(const envoy_config_endpoint_v3_LocalityLbEndpoints *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_config_core_v3_Locality*); }
-UPB_INLINE bool envoy_config_endpoint_v3_LocalityLbEndpoints_has_lb_endpoints(const envoy_config_endpoint_v3_LocalityLbEndpoints *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); }
-UPB_INLINE const envoy_config_endpoint_v3_LbEndpoint* const* envoy_config_endpoint_v3_LocalityLbEndpoints_lb_endpoints(const envoy_config_endpoint_v3_LocalityLbEndpoints *msg, size_t *len) { return (const envoy_config_endpoint_v3_LbEndpoint* const*)_upb_array_accessor(msg, UPB_SIZE(16, 32), len); }
-UPB_INLINE bool envoy_config_endpoint_v3_LocalityLbEndpoints_has_load_balancing_weight(const envoy_config_endpoint_v3_LocalityLbEndpoints *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_endpoint_v3_LocalityLbEndpoints_load_balancing_weight(const envoy_config_endpoint_v3_LocalityLbEndpoints *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_UInt32Value*); }
-UPB_INLINE uint32_t envoy_config_endpoint_v3_LocalityLbEndpoints_priority(const envoy_config_endpoint_v3_LocalityLbEndpoints *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t); }
-UPB_INLINE bool envoy_config_endpoint_v3_LocalityLbEndpoints_has_proximity(const envoy_config_endpoint_v3_LocalityLbEndpoints *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
-UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_endpoint_v3_LocalityLbEndpoints_proximity(const envoy_config_endpoint_v3_LocalityLbEndpoints *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_protobuf_UInt32Value*); }
-
-UPB_INLINE void envoy_config_endpoint_v3_LocalityLbEndpoints_set_locality(envoy_config_endpoint_v3_LocalityLbEndpoints *msg, struct envoy_config_core_v3_Locality* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_config_core_v3_Locality*) = value;
-}
-UPB_INLINE struct envoy_config_core_v3_Locality* envoy_config_endpoint_v3_LocalityLbEndpoints_mutable_locality(envoy_config_endpoint_v3_LocalityLbEndpoints *msg, upb_arena *arena) {
- struct envoy_config_core_v3_Locality* sub = (struct envoy_config_core_v3_Locality*)envoy_config_endpoint_v3_LocalityLbEndpoints_locality(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_Locality*)_upb_msg_new(&envoy_config_core_v3_Locality_msginit, arena);
- if (!sub) return NULL;
- envoy_config_endpoint_v3_LocalityLbEndpoints_set_locality(msg, sub);
- }
- return sub;
-}
-UPB_INLINE envoy_config_endpoint_v3_LbEndpoint** envoy_config_endpoint_v3_LocalityLbEndpoints_mutable_lb_endpoints(envoy_config_endpoint_v3_LocalityLbEndpoints *msg, size_t *len) {
- return (envoy_config_endpoint_v3_LbEndpoint**)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 32), len);
-}
-UPB_INLINE envoy_config_endpoint_v3_LbEndpoint** envoy_config_endpoint_v3_LocalityLbEndpoints_resize_lb_endpoints(envoy_config_endpoint_v3_LocalityLbEndpoints *msg, size_t len, upb_arena *arena) {
- return (envoy_config_endpoint_v3_LbEndpoint**)_upb_array_resize_accessor(msg, UPB_SIZE(16, 32), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_config_endpoint_v3_LbEndpoint* envoy_config_endpoint_v3_LocalityLbEndpoints_add_lb_endpoints(envoy_config_endpoint_v3_LocalityLbEndpoints *msg, upb_arena *arena) {
- struct envoy_config_endpoint_v3_LbEndpoint* sub = (struct envoy_config_endpoint_v3_LbEndpoint*)_upb_msg_new(&envoy_config_endpoint_v3_LbEndpoint_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(16, 32), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-UPB_INLINE void envoy_config_endpoint_v3_LocalityLbEndpoints_set_load_balancing_weight(envoy_config_endpoint_v3_LocalityLbEndpoints *msg, struct google_protobuf_UInt32Value* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_UInt32Value*) = value;
-}
-UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_endpoint_v3_LocalityLbEndpoints_mutable_load_balancing_weight(envoy_config_endpoint_v3_LocalityLbEndpoints *msg, upb_arena *arena) {
- struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_endpoint_v3_LocalityLbEndpoints_load_balancing_weight(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
- if (!sub) return NULL;
- envoy_config_endpoint_v3_LocalityLbEndpoints_set_load_balancing_weight(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_endpoint_v3_LocalityLbEndpoints_set_priority(envoy_config_endpoint_v3_LocalityLbEndpoints *msg, uint32_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t) = value;
-}
-UPB_INLINE void envoy_config_endpoint_v3_LocalityLbEndpoints_set_proximity(envoy_config_endpoint_v3_LocalityLbEndpoints *msg, struct google_protobuf_UInt32Value* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_protobuf_UInt32Value*) = value;
-}
-UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_endpoint_v3_LocalityLbEndpoints_mutable_proximity(envoy_config_endpoint_v3_LocalityLbEndpoints *msg, upb_arena *arena) {
- struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_endpoint_v3_LocalityLbEndpoints_proximity(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
- if (!sub) return NULL;
- envoy_config_endpoint_v3_LocalityLbEndpoints_set_proximity(msg, sub);
- }
- return sub;
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* ENVOY_CONFIG_ENDPOINT_V3_ENDPOINT_COMPONENTS_PROTO_UPB_H_ */
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/endpoint/v3/endpoint_components.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_CONFIG_ENDPOINT_V3_ENDPOINT_COMPONENTS_PROTO_UPB_H_
+#define ENVOY_CONFIG_ENDPOINT_V3_ENDPOINT_COMPONENTS_PROTO_UPB_H_
+
+#include "upb/msg.h"
+#include "upb/decode.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_config_endpoint_v3_Endpoint;
+struct envoy_config_endpoint_v3_Endpoint_HealthCheckConfig;
+struct envoy_config_endpoint_v3_LbEndpoint;
+struct envoy_config_endpoint_v3_LocalityLbEndpoints;
+typedef struct envoy_config_endpoint_v3_Endpoint envoy_config_endpoint_v3_Endpoint;
+typedef struct envoy_config_endpoint_v3_Endpoint_HealthCheckConfig envoy_config_endpoint_v3_Endpoint_HealthCheckConfig;
+typedef struct envoy_config_endpoint_v3_LbEndpoint envoy_config_endpoint_v3_LbEndpoint;
+typedef struct envoy_config_endpoint_v3_LocalityLbEndpoints envoy_config_endpoint_v3_LocalityLbEndpoints;
+extern const upb_msglayout envoy_config_endpoint_v3_Endpoint_msginit;
+extern const upb_msglayout envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_msginit;
+extern const upb_msglayout envoy_config_endpoint_v3_LbEndpoint_msginit;
+extern const upb_msglayout envoy_config_endpoint_v3_LocalityLbEndpoints_msginit;
+struct envoy_config_core_v3_Address;
+struct envoy_config_core_v3_Locality;
+struct envoy_config_core_v3_Metadata;
+struct google_protobuf_UInt32Value;
+extern const upb_msglayout envoy_config_core_v3_Address_msginit;
+extern const upb_msglayout envoy_config_core_v3_Locality_msginit;
+extern const upb_msglayout envoy_config_core_v3_Metadata_msginit;
+extern const upb_msglayout google_protobuf_UInt32Value_msginit;
+
+
+/* envoy.config.endpoint.v3.Endpoint */
+
+UPB_INLINE envoy_config_endpoint_v3_Endpoint *envoy_config_endpoint_v3_Endpoint_new(upb_arena *arena) {
+ return (envoy_config_endpoint_v3_Endpoint *)_upb_msg_new(&envoy_config_endpoint_v3_Endpoint_msginit, arena);
+}
+UPB_INLINE envoy_config_endpoint_v3_Endpoint *envoy_config_endpoint_v3_Endpoint_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_endpoint_v3_Endpoint *ret = envoy_config_endpoint_v3_Endpoint_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_endpoint_v3_Endpoint_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_endpoint_v3_Endpoint_serialize(const envoy_config_endpoint_v3_Endpoint *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_endpoint_v3_Endpoint_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_endpoint_v3_Endpoint_has_address(const envoy_config_endpoint_v3_Endpoint *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
+UPB_INLINE const struct envoy_config_core_v3_Address* envoy_config_endpoint_v3_Endpoint_address(const envoy_config_endpoint_v3_Endpoint *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct envoy_config_core_v3_Address*); }
+UPB_INLINE bool envoy_config_endpoint_v3_Endpoint_has_health_check_config(const envoy_config_endpoint_v3_Endpoint *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
+UPB_INLINE const envoy_config_endpoint_v3_Endpoint_HealthCheckConfig* envoy_config_endpoint_v3_Endpoint_health_check_config(const envoy_config_endpoint_v3_Endpoint *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const envoy_config_endpoint_v3_Endpoint_HealthCheckConfig*); }
+UPB_INLINE upb_strview envoy_config_endpoint_v3_Endpoint_hostname(const envoy_config_endpoint_v3_Endpoint *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+
+UPB_INLINE void envoy_config_endpoint_v3_Endpoint_set_address(envoy_config_endpoint_v3_Endpoint *msg, struct envoy_config_core_v3_Address* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct envoy_config_core_v3_Address*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_Address* envoy_config_endpoint_v3_Endpoint_mutable_address(envoy_config_endpoint_v3_Endpoint *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_Address* sub = (struct envoy_config_core_v3_Address*)envoy_config_endpoint_v3_Endpoint_address(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_Address*)_upb_msg_new(&envoy_config_core_v3_Address_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_endpoint_v3_Endpoint_set_address(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_endpoint_v3_Endpoint_set_health_check_config(envoy_config_endpoint_v3_Endpoint *msg, envoy_config_endpoint_v3_Endpoint_HealthCheckConfig* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), envoy_config_endpoint_v3_Endpoint_HealthCheckConfig*) = value;
+}
+UPB_INLINE struct envoy_config_endpoint_v3_Endpoint_HealthCheckConfig* envoy_config_endpoint_v3_Endpoint_mutable_health_check_config(envoy_config_endpoint_v3_Endpoint *msg, upb_arena *arena) {
+ struct envoy_config_endpoint_v3_Endpoint_HealthCheckConfig* sub = (struct envoy_config_endpoint_v3_Endpoint_HealthCheckConfig*)envoy_config_endpoint_v3_Endpoint_health_check_config(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_endpoint_v3_Endpoint_HealthCheckConfig*)_upb_msg_new(&envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_endpoint_v3_Endpoint_set_health_check_config(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_endpoint_v3_Endpoint_set_hostname(envoy_config_endpoint_v3_Endpoint *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+
+/* envoy.config.endpoint.v3.Endpoint.HealthCheckConfig */
+
+UPB_INLINE envoy_config_endpoint_v3_Endpoint_HealthCheckConfig *envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_new(upb_arena *arena) {
+ return (envoy_config_endpoint_v3_Endpoint_HealthCheckConfig *)_upb_msg_new(&envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_msginit, arena);
+}
+UPB_INLINE envoy_config_endpoint_v3_Endpoint_HealthCheckConfig *envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_endpoint_v3_Endpoint_HealthCheckConfig *ret = envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_serialize(const envoy_config_endpoint_v3_Endpoint_HealthCheckConfig *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_msginit, arena, len);
+}
+
+UPB_INLINE uint32_t envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_port_value(const envoy_config_endpoint_v3_Endpoint_HealthCheckConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t); }
+UPB_INLINE upb_strview envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_hostname(const envoy_config_endpoint_v3_Endpoint_HealthCheckConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
+
+UPB_INLINE void envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_set_port_value(envoy_config_endpoint_v3_Endpoint_HealthCheckConfig *msg, uint32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t) = value;
+}
+UPB_INLINE void envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_set_hostname(envoy_config_endpoint_v3_Endpoint_HealthCheckConfig *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
+}
+
+/* envoy.config.endpoint.v3.LbEndpoint */
+
+UPB_INLINE envoy_config_endpoint_v3_LbEndpoint *envoy_config_endpoint_v3_LbEndpoint_new(upb_arena *arena) {
+ return (envoy_config_endpoint_v3_LbEndpoint *)_upb_msg_new(&envoy_config_endpoint_v3_LbEndpoint_msginit, arena);
+}
+UPB_INLINE envoy_config_endpoint_v3_LbEndpoint *envoy_config_endpoint_v3_LbEndpoint_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_endpoint_v3_LbEndpoint *ret = envoy_config_endpoint_v3_LbEndpoint_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_endpoint_v3_LbEndpoint_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_endpoint_v3_LbEndpoint_serialize(const envoy_config_endpoint_v3_LbEndpoint *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_endpoint_v3_LbEndpoint_msginit, arena, len);
+}
+
+typedef enum {
+ envoy_config_endpoint_v3_LbEndpoint_host_identifier_endpoint = 1,
+ envoy_config_endpoint_v3_LbEndpoint_host_identifier_endpoint_name = 5,
+ envoy_config_endpoint_v3_LbEndpoint_host_identifier_NOT_SET = 0
+} envoy_config_endpoint_v3_LbEndpoint_host_identifier_oneofcases;
+UPB_INLINE envoy_config_endpoint_v3_LbEndpoint_host_identifier_oneofcases envoy_config_endpoint_v3_LbEndpoint_host_identifier_case(const envoy_config_endpoint_v3_LbEndpoint* msg) { return (envoy_config_endpoint_v3_LbEndpoint_host_identifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(24, 40), int32_t); }
+
+UPB_INLINE bool envoy_config_endpoint_v3_LbEndpoint_has_endpoint(const envoy_config_endpoint_v3_LbEndpoint *msg) { return _upb_getoneofcase(msg, UPB_SIZE(24, 40)) == 1; }
+UPB_INLINE const envoy_config_endpoint_v3_Endpoint* envoy_config_endpoint_v3_LbEndpoint_endpoint(const envoy_config_endpoint_v3_LbEndpoint *msg) { return UPB_READ_ONEOF(msg, const envoy_config_endpoint_v3_Endpoint*, UPB_SIZE(16, 24), UPB_SIZE(24, 40), 1, NULL); }
+UPB_INLINE int32_t envoy_config_endpoint_v3_LbEndpoint_health_status(const envoy_config_endpoint_v3_LbEndpoint *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
+UPB_INLINE bool envoy_config_endpoint_v3_LbEndpoint_has_metadata(const envoy_config_endpoint_v3_LbEndpoint *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 8)); }
+UPB_INLINE const struct envoy_config_core_v3_Metadata* envoy_config_endpoint_v3_LbEndpoint_metadata(const envoy_config_endpoint_v3_LbEndpoint *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const struct envoy_config_core_v3_Metadata*); }
+UPB_INLINE bool envoy_config_endpoint_v3_LbEndpoint_has_load_balancing_weight(const envoy_config_endpoint_v3_LbEndpoint *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 16)); }
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_endpoint_v3_LbEndpoint_load_balancing_weight(const envoy_config_endpoint_v3_LbEndpoint *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const struct google_protobuf_UInt32Value*); }
+UPB_INLINE bool envoy_config_endpoint_v3_LbEndpoint_has_endpoint_name(const envoy_config_endpoint_v3_LbEndpoint *msg) { return _upb_getoneofcase(msg, UPB_SIZE(24, 40)) == 5; }
+UPB_INLINE upb_strview envoy_config_endpoint_v3_LbEndpoint_endpoint_name(const envoy_config_endpoint_v3_LbEndpoint *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(16, 24), UPB_SIZE(24, 40), 5, upb_strview_make("", strlen(""))); }
+
+UPB_INLINE void envoy_config_endpoint_v3_LbEndpoint_set_endpoint(envoy_config_endpoint_v3_LbEndpoint *msg, envoy_config_endpoint_v3_Endpoint* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_endpoint_v3_Endpoint*, UPB_SIZE(16, 24), value, UPB_SIZE(24, 40), 1);
+}
+UPB_INLINE struct envoy_config_endpoint_v3_Endpoint* envoy_config_endpoint_v3_LbEndpoint_mutable_endpoint(envoy_config_endpoint_v3_LbEndpoint *msg, upb_arena *arena) {
+ struct envoy_config_endpoint_v3_Endpoint* sub = (struct envoy_config_endpoint_v3_Endpoint*)envoy_config_endpoint_v3_LbEndpoint_endpoint(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_endpoint_v3_Endpoint*)_upb_msg_new(&envoy_config_endpoint_v3_Endpoint_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_endpoint_v3_LbEndpoint_set_endpoint(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_endpoint_v3_LbEndpoint_set_health_status(envoy_config_endpoint_v3_LbEndpoint *msg, int32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
+}
+UPB_INLINE void envoy_config_endpoint_v3_LbEndpoint_set_metadata(envoy_config_endpoint_v3_LbEndpoint *msg, struct envoy_config_core_v3_Metadata* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), struct envoy_config_core_v3_Metadata*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_Metadata* envoy_config_endpoint_v3_LbEndpoint_mutable_metadata(envoy_config_endpoint_v3_LbEndpoint *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_Metadata* sub = (struct envoy_config_core_v3_Metadata*)envoy_config_endpoint_v3_LbEndpoint_metadata(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_Metadata*)_upb_msg_new(&envoy_config_core_v3_Metadata_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_endpoint_v3_LbEndpoint_set_metadata(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_endpoint_v3_LbEndpoint_set_load_balancing_weight(envoy_config_endpoint_v3_LbEndpoint *msg, struct google_protobuf_UInt32Value* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 16), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_endpoint_v3_LbEndpoint_mutable_load_balancing_weight(envoy_config_endpoint_v3_LbEndpoint *msg, upb_arena *arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_endpoint_v3_LbEndpoint_load_balancing_weight(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_endpoint_v3_LbEndpoint_set_load_balancing_weight(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_endpoint_v3_LbEndpoint_set_endpoint_name(envoy_config_endpoint_v3_LbEndpoint *msg, upb_strview value) {
+ UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(16, 24), value, UPB_SIZE(24, 40), 5);
+}
+
+/* envoy.config.endpoint.v3.LocalityLbEndpoints */
+
+UPB_INLINE envoy_config_endpoint_v3_LocalityLbEndpoints *envoy_config_endpoint_v3_LocalityLbEndpoints_new(upb_arena *arena) {
+ return (envoy_config_endpoint_v3_LocalityLbEndpoints *)_upb_msg_new(&envoy_config_endpoint_v3_LocalityLbEndpoints_msginit, arena);
+}
+UPB_INLINE envoy_config_endpoint_v3_LocalityLbEndpoints *envoy_config_endpoint_v3_LocalityLbEndpoints_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_endpoint_v3_LocalityLbEndpoints *ret = envoy_config_endpoint_v3_LocalityLbEndpoints_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_endpoint_v3_LocalityLbEndpoints_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_endpoint_v3_LocalityLbEndpoints_serialize(const envoy_config_endpoint_v3_LocalityLbEndpoints *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_endpoint_v3_LocalityLbEndpoints_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_endpoint_v3_LocalityLbEndpoints_has_locality(const envoy_config_endpoint_v3_LocalityLbEndpoints *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
+UPB_INLINE const struct envoy_config_core_v3_Locality* envoy_config_endpoint_v3_LocalityLbEndpoints_locality(const envoy_config_endpoint_v3_LocalityLbEndpoints *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_config_core_v3_Locality*); }
+UPB_INLINE bool envoy_config_endpoint_v3_LocalityLbEndpoints_has_lb_endpoints(const envoy_config_endpoint_v3_LocalityLbEndpoints *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); }
+UPB_INLINE const envoy_config_endpoint_v3_LbEndpoint* const* envoy_config_endpoint_v3_LocalityLbEndpoints_lb_endpoints(const envoy_config_endpoint_v3_LocalityLbEndpoints *msg, size_t *len) { return (const envoy_config_endpoint_v3_LbEndpoint* const*)_upb_array_accessor(msg, UPB_SIZE(16, 32), len); }
+UPB_INLINE bool envoy_config_endpoint_v3_LocalityLbEndpoints_has_load_balancing_weight(const envoy_config_endpoint_v3_LocalityLbEndpoints *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_endpoint_v3_LocalityLbEndpoints_load_balancing_weight(const envoy_config_endpoint_v3_LocalityLbEndpoints *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_UInt32Value*); }
+UPB_INLINE uint32_t envoy_config_endpoint_v3_LocalityLbEndpoints_priority(const envoy_config_endpoint_v3_LocalityLbEndpoints *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t); }
+UPB_INLINE bool envoy_config_endpoint_v3_LocalityLbEndpoints_has_proximity(const envoy_config_endpoint_v3_LocalityLbEndpoints *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_endpoint_v3_LocalityLbEndpoints_proximity(const envoy_config_endpoint_v3_LocalityLbEndpoints *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_protobuf_UInt32Value*); }
+
+UPB_INLINE void envoy_config_endpoint_v3_LocalityLbEndpoints_set_locality(envoy_config_endpoint_v3_LocalityLbEndpoints *msg, struct envoy_config_core_v3_Locality* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_config_core_v3_Locality*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_Locality* envoy_config_endpoint_v3_LocalityLbEndpoints_mutable_locality(envoy_config_endpoint_v3_LocalityLbEndpoints *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_Locality* sub = (struct envoy_config_core_v3_Locality*)envoy_config_endpoint_v3_LocalityLbEndpoints_locality(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_Locality*)_upb_msg_new(&envoy_config_core_v3_Locality_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_endpoint_v3_LocalityLbEndpoints_set_locality(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE envoy_config_endpoint_v3_LbEndpoint** envoy_config_endpoint_v3_LocalityLbEndpoints_mutable_lb_endpoints(envoy_config_endpoint_v3_LocalityLbEndpoints *msg, size_t *len) {
+ return (envoy_config_endpoint_v3_LbEndpoint**)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 32), len);
+}
+UPB_INLINE envoy_config_endpoint_v3_LbEndpoint** envoy_config_endpoint_v3_LocalityLbEndpoints_resize_lb_endpoints(envoy_config_endpoint_v3_LocalityLbEndpoints *msg, size_t len, upb_arena *arena) {
+ return (envoy_config_endpoint_v3_LbEndpoint**)_upb_array_resize_accessor(msg, UPB_SIZE(16, 32), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_config_endpoint_v3_LbEndpoint* envoy_config_endpoint_v3_LocalityLbEndpoints_add_lb_endpoints(envoy_config_endpoint_v3_LocalityLbEndpoints *msg, upb_arena *arena) {
+ struct envoy_config_endpoint_v3_LbEndpoint* sub = (struct envoy_config_endpoint_v3_LbEndpoint*)_upb_msg_new(&envoy_config_endpoint_v3_LbEndpoint_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(16, 32), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE void envoy_config_endpoint_v3_LocalityLbEndpoints_set_load_balancing_weight(envoy_config_endpoint_v3_LocalityLbEndpoints *msg, struct google_protobuf_UInt32Value* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_endpoint_v3_LocalityLbEndpoints_mutable_load_balancing_weight(envoy_config_endpoint_v3_LocalityLbEndpoints *msg, upb_arena *arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_endpoint_v3_LocalityLbEndpoints_load_balancing_weight(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_endpoint_v3_LocalityLbEndpoints_set_load_balancing_weight(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_endpoint_v3_LocalityLbEndpoints_set_priority(envoy_config_endpoint_v3_LocalityLbEndpoints *msg, uint32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t) = value;
+}
+UPB_INLINE void envoy_config_endpoint_v3_LocalityLbEndpoints_set_proximity(envoy_config_endpoint_v3_LocalityLbEndpoints *msg, struct google_protobuf_UInt32Value* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_endpoint_v3_LocalityLbEndpoints_mutable_proximity(envoy_config_endpoint_v3_LocalityLbEndpoints *msg, upb_arena *arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_endpoint_v3_LocalityLbEndpoints_proximity(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_endpoint_v3_LocalityLbEndpoints_set_proximity(msg, sub);
+ }
+ return sub;
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_CONFIG_ENDPOINT_V3_ENDPOINT_COMPONENTS_PROTO_UPB_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.c
index 8e0f9d2e7cb..9bb6385e9de 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.c
@@ -1,112 +1,112 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/config/endpoint/v3/load_report.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include <stddef.h>
-#include "upb/msg.h"
-#include "envoy/config/endpoint/v3/load_report.upb.h"
-#include "envoy/config/core/v3/address.upb.h"
-#include "envoy/config/core/v3/base.upb.h"
-#include "google/protobuf/duration.upb.h"
-#include "google/protobuf/struct.upb.h"
-#include "udpa/annotations/status.upb.h"
-#include "udpa/annotations/versioning.upb.h"
-#include "validate/validate.upb.h"
-
-#include "upb/port_def.inc"
-
-static const upb_msglayout *const envoy_config_endpoint_v3_UpstreamLocalityStats_submsgs[3] = {
- &envoy_config_core_v3_Locality_msginit,
- &envoy_config_endpoint_v3_EndpointLoadMetricStats_msginit,
- &envoy_config_endpoint_v3_UpstreamEndpointStats_msginit,
-};
-
-static const upb_msglayout_field envoy_config_endpoint_v3_UpstreamLocalityStats__fields[8] = {
- {1, UPB_SIZE(36, 40), 0, 0, 11, 1},
- {2, UPB_SIZE(0, 0), 0, 0, 4, 1},
- {3, UPB_SIZE(8, 8), 0, 0, 4, 1},
- {4, UPB_SIZE(16, 16), 0, 0, 4, 1},
- {5, UPB_SIZE(40, 48), 0, 1, 11, 3},
- {6, UPB_SIZE(32, 32), 0, 0, 13, 1},
- {7, UPB_SIZE(44, 56), 0, 2, 11, 3},
- {8, UPB_SIZE(24, 24), 0, 0, 4, 1},
-};
-
-const upb_msglayout envoy_config_endpoint_v3_UpstreamLocalityStats_msginit = {
- &envoy_config_endpoint_v3_UpstreamLocalityStats_submsgs[0],
- &envoy_config_endpoint_v3_UpstreamLocalityStats__fields[0],
- UPB_SIZE(48, 64), 8, false,
-};
-
-static const upb_msglayout *const envoy_config_endpoint_v3_UpstreamEndpointStats_submsgs[3] = {
- &envoy_config_core_v3_Address_msginit,
- &envoy_config_endpoint_v3_EndpointLoadMetricStats_msginit,
- &google_protobuf_Struct_msginit,
-};
-
-static const upb_msglayout_field envoy_config_endpoint_v3_UpstreamEndpointStats__fields[7] = {
- {1, UPB_SIZE(32, 32), 0, 0, 11, 1},
- {2, UPB_SIZE(0, 0), 0, 0, 4, 1},
- {3, UPB_SIZE(8, 8), 0, 0, 4, 1},
- {4, UPB_SIZE(16, 16), 0, 0, 4, 1},
- {5, UPB_SIZE(40, 48), 0, 1, 11, 3},
- {6, UPB_SIZE(36, 40), 0, 2, 11, 1},
- {7, UPB_SIZE(24, 24), 0, 0, 4, 1},
-};
-
-const upb_msglayout envoy_config_endpoint_v3_UpstreamEndpointStats_msginit = {
- &envoy_config_endpoint_v3_UpstreamEndpointStats_submsgs[0],
- &envoy_config_endpoint_v3_UpstreamEndpointStats__fields[0],
- UPB_SIZE(48, 56), 7, false,
-};
-
-static const upb_msglayout_field envoy_config_endpoint_v3_EndpointLoadMetricStats__fields[3] = {
- {1, UPB_SIZE(16, 16), 0, 0, 9, 1},
- {2, UPB_SIZE(0, 0), 0, 0, 4, 1},
- {3, UPB_SIZE(8, 8), 0, 0, 1, 1},
-};
-
-const upb_msglayout envoy_config_endpoint_v3_EndpointLoadMetricStats_msginit = {
- NULL,
- &envoy_config_endpoint_v3_EndpointLoadMetricStats__fields[0],
- UPB_SIZE(24, 32), 3, false,
-};
-
-static const upb_msglayout *const envoy_config_endpoint_v3_ClusterStats_submsgs[3] = {
- &envoy_config_endpoint_v3_ClusterStats_DroppedRequests_msginit,
- &envoy_config_endpoint_v3_UpstreamLocalityStats_msginit,
- &google_protobuf_Duration_msginit,
-};
-
-static const upb_msglayout_field envoy_config_endpoint_v3_ClusterStats__fields[6] = {
- {1, UPB_SIZE(8, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(28, 48), 0, 1, 11, 3},
- {3, UPB_SIZE(0, 0), 0, 0, 4, 1},
- {4, UPB_SIZE(24, 40), 0, 2, 11, 1},
- {5, UPB_SIZE(32, 56), 0, 0, 11, 3},
- {6, UPB_SIZE(16, 24), 0, 0, 9, 1},
-};
-
-const upb_msglayout envoy_config_endpoint_v3_ClusterStats_msginit = {
- &envoy_config_endpoint_v3_ClusterStats_submsgs[0],
- &envoy_config_endpoint_v3_ClusterStats__fields[0],
- UPB_SIZE(40, 64), 6, false,
-};
-
-static const upb_msglayout_field envoy_config_endpoint_v3_ClusterStats_DroppedRequests__fields[2] = {
- {1, UPB_SIZE(8, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(0, 0), 0, 0, 4, 1},
-};
-
-const upb_msglayout envoy_config_endpoint_v3_ClusterStats_DroppedRequests_msginit = {
- NULL,
- &envoy_config_endpoint_v3_ClusterStats_DroppedRequests__fields[0],
- UPB_SIZE(16, 32), 2, false,
-};
-
-#include "upb/port_undef.inc"
-
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/endpoint/v3/load_report.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg.h"
+#include "envoy/config/endpoint/v3/load_report.upb.h"
+#include "envoy/config/core/v3/address.upb.h"
+#include "envoy/config/core/v3/base.upb.h"
+#include "google/protobuf/duration.upb.h"
+#include "google/protobuf/struct.upb.h"
+#include "udpa/annotations/status.upb.h"
+#include "udpa/annotations/versioning.upb.h"
+#include "validate/validate.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_msglayout *const envoy_config_endpoint_v3_UpstreamLocalityStats_submsgs[3] = {
+ &envoy_config_core_v3_Locality_msginit,
+ &envoy_config_endpoint_v3_EndpointLoadMetricStats_msginit,
+ &envoy_config_endpoint_v3_UpstreamEndpointStats_msginit,
+};
+
+static const upb_msglayout_field envoy_config_endpoint_v3_UpstreamLocalityStats__fields[8] = {
+ {1, UPB_SIZE(36, 40), 0, 0, 11, 1},
+ {2, UPB_SIZE(0, 0), 0, 0, 4, 1},
+ {3, UPB_SIZE(8, 8), 0, 0, 4, 1},
+ {4, UPB_SIZE(16, 16), 0, 0, 4, 1},
+ {5, UPB_SIZE(40, 48), 0, 1, 11, 3},
+ {6, UPB_SIZE(32, 32), 0, 0, 13, 1},
+ {7, UPB_SIZE(44, 56), 0, 2, 11, 3},
+ {8, UPB_SIZE(24, 24), 0, 0, 4, 1},
+};
+
+const upb_msglayout envoy_config_endpoint_v3_UpstreamLocalityStats_msginit = {
+ &envoy_config_endpoint_v3_UpstreamLocalityStats_submsgs[0],
+ &envoy_config_endpoint_v3_UpstreamLocalityStats__fields[0],
+ UPB_SIZE(48, 64), 8, false,
+};
+
+static const upb_msglayout *const envoy_config_endpoint_v3_UpstreamEndpointStats_submsgs[3] = {
+ &envoy_config_core_v3_Address_msginit,
+ &envoy_config_endpoint_v3_EndpointLoadMetricStats_msginit,
+ &google_protobuf_Struct_msginit,
+};
+
+static const upb_msglayout_field envoy_config_endpoint_v3_UpstreamEndpointStats__fields[7] = {
+ {1, UPB_SIZE(32, 32), 0, 0, 11, 1},
+ {2, UPB_SIZE(0, 0), 0, 0, 4, 1},
+ {3, UPB_SIZE(8, 8), 0, 0, 4, 1},
+ {4, UPB_SIZE(16, 16), 0, 0, 4, 1},
+ {5, UPB_SIZE(40, 48), 0, 1, 11, 3},
+ {6, UPB_SIZE(36, 40), 0, 2, 11, 1},
+ {7, UPB_SIZE(24, 24), 0, 0, 4, 1},
+};
+
+const upb_msglayout envoy_config_endpoint_v3_UpstreamEndpointStats_msginit = {
+ &envoy_config_endpoint_v3_UpstreamEndpointStats_submsgs[0],
+ &envoy_config_endpoint_v3_UpstreamEndpointStats__fields[0],
+ UPB_SIZE(48, 56), 7, false,
+};
+
+static const upb_msglayout_field envoy_config_endpoint_v3_EndpointLoadMetricStats__fields[3] = {
+ {1, UPB_SIZE(16, 16), 0, 0, 9, 1},
+ {2, UPB_SIZE(0, 0), 0, 0, 4, 1},
+ {3, UPB_SIZE(8, 8), 0, 0, 1, 1},
+};
+
+const upb_msglayout envoy_config_endpoint_v3_EndpointLoadMetricStats_msginit = {
+ NULL,
+ &envoy_config_endpoint_v3_EndpointLoadMetricStats__fields[0],
+ UPB_SIZE(24, 32), 3, false,
+};
+
+static const upb_msglayout *const envoy_config_endpoint_v3_ClusterStats_submsgs[3] = {
+ &envoy_config_endpoint_v3_ClusterStats_DroppedRequests_msginit,
+ &envoy_config_endpoint_v3_UpstreamLocalityStats_msginit,
+ &google_protobuf_Duration_msginit,
+};
+
+static const upb_msglayout_field envoy_config_endpoint_v3_ClusterStats__fields[6] = {
+ {1, UPB_SIZE(8, 8), 0, 0, 9, 1},
+ {2, UPB_SIZE(28, 48), 0, 1, 11, 3},
+ {3, UPB_SIZE(0, 0), 0, 0, 4, 1},
+ {4, UPB_SIZE(24, 40), 0, 2, 11, 1},
+ {5, UPB_SIZE(32, 56), 0, 0, 11, 3},
+ {6, UPB_SIZE(16, 24), 0, 0, 9, 1},
+};
+
+const upb_msglayout envoy_config_endpoint_v3_ClusterStats_msginit = {
+ &envoy_config_endpoint_v3_ClusterStats_submsgs[0],
+ &envoy_config_endpoint_v3_ClusterStats__fields[0],
+ UPB_SIZE(40, 64), 6, false,
+};
+
+static const upb_msglayout_field envoy_config_endpoint_v3_ClusterStats_DroppedRequests__fields[2] = {
+ {1, UPB_SIZE(8, 8), 0, 0, 9, 1},
+ {2, UPB_SIZE(0, 0), 0, 0, 4, 1},
+};
+
+const upb_msglayout envoy_config_endpoint_v3_ClusterStats_DroppedRequests_msginit = {
+ NULL,
+ &envoy_config_endpoint_v3_ClusterStats_DroppedRequests__fields[0],
+ UPB_SIZE(16, 32), 2, false,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.h
index 4ad6d799514..65c11a9bddc 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.h
@@ -1,332 +1,332 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/config/endpoint/v3/load_report.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef ENVOY_CONFIG_ENDPOINT_V3_LOAD_REPORT_PROTO_UPB_H_
-#define ENVOY_CONFIG_ENDPOINT_V3_LOAD_REPORT_PROTO_UPB_H_
-
-#include "upb/msg.h"
-#include "upb/decode.h"
-#include "upb/encode.h"
-
-#include "upb/port_def.inc"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct envoy_config_endpoint_v3_UpstreamLocalityStats;
-struct envoy_config_endpoint_v3_UpstreamEndpointStats;
-struct envoy_config_endpoint_v3_EndpointLoadMetricStats;
-struct envoy_config_endpoint_v3_ClusterStats;
-struct envoy_config_endpoint_v3_ClusterStats_DroppedRequests;
-typedef struct envoy_config_endpoint_v3_UpstreamLocalityStats envoy_config_endpoint_v3_UpstreamLocalityStats;
-typedef struct envoy_config_endpoint_v3_UpstreamEndpointStats envoy_config_endpoint_v3_UpstreamEndpointStats;
-typedef struct envoy_config_endpoint_v3_EndpointLoadMetricStats envoy_config_endpoint_v3_EndpointLoadMetricStats;
-typedef struct envoy_config_endpoint_v3_ClusterStats envoy_config_endpoint_v3_ClusterStats;
-typedef struct envoy_config_endpoint_v3_ClusterStats_DroppedRequests envoy_config_endpoint_v3_ClusterStats_DroppedRequests;
-extern const upb_msglayout envoy_config_endpoint_v3_UpstreamLocalityStats_msginit;
-extern const upb_msglayout envoy_config_endpoint_v3_UpstreamEndpointStats_msginit;
-extern const upb_msglayout envoy_config_endpoint_v3_EndpointLoadMetricStats_msginit;
-extern const upb_msglayout envoy_config_endpoint_v3_ClusterStats_msginit;
-extern const upb_msglayout envoy_config_endpoint_v3_ClusterStats_DroppedRequests_msginit;
-struct envoy_config_core_v3_Address;
-struct envoy_config_core_v3_Locality;
-struct google_protobuf_Duration;
-struct google_protobuf_Struct;
-extern const upb_msglayout envoy_config_core_v3_Address_msginit;
-extern const upb_msglayout envoy_config_core_v3_Locality_msginit;
-extern const upb_msglayout google_protobuf_Duration_msginit;
-extern const upb_msglayout google_protobuf_Struct_msginit;
-
-
-/* envoy.config.endpoint.v3.UpstreamLocalityStats */
-
-UPB_INLINE envoy_config_endpoint_v3_UpstreamLocalityStats *envoy_config_endpoint_v3_UpstreamLocalityStats_new(upb_arena *arena) {
- return (envoy_config_endpoint_v3_UpstreamLocalityStats *)_upb_msg_new(&envoy_config_endpoint_v3_UpstreamLocalityStats_msginit, arena);
-}
-UPB_INLINE envoy_config_endpoint_v3_UpstreamLocalityStats *envoy_config_endpoint_v3_UpstreamLocalityStats_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_endpoint_v3_UpstreamLocalityStats *ret = envoy_config_endpoint_v3_UpstreamLocalityStats_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_endpoint_v3_UpstreamLocalityStats_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_endpoint_v3_UpstreamLocalityStats_serialize(const envoy_config_endpoint_v3_UpstreamLocalityStats *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_endpoint_v3_UpstreamLocalityStats_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_config_endpoint_v3_UpstreamLocalityStats_has_locality(const envoy_config_endpoint_v3_UpstreamLocalityStats *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(36, 40)); }
-UPB_INLINE const struct envoy_config_core_v3_Locality* envoy_config_endpoint_v3_UpstreamLocalityStats_locality(const envoy_config_endpoint_v3_UpstreamLocalityStats *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(36, 40), const struct envoy_config_core_v3_Locality*); }
-UPB_INLINE uint64_t envoy_config_endpoint_v3_UpstreamLocalityStats_total_successful_requests(const envoy_config_endpoint_v3_UpstreamLocalityStats *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint64_t); }
-UPB_INLINE uint64_t envoy_config_endpoint_v3_UpstreamLocalityStats_total_requests_in_progress(const envoy_config_endpoint_v3_UpstreamLocalityStats *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint64_t); }
-UPB_INLINE uint64_t envoy_config_endpoint_v3_UpstreamLocalityStats_total_error_requests(const envoy_config_endpoint_v3_UpstreamLocalityStats *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), uint64_t); }
-UPB_INLINE bool envoy_config_endpoint_v3_UpstreamLocalityStats_has_load_metric_stats(const envoy_config_endpoint_v3_UpstreamLocalityStats *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(40, 48)); }
-UPB_INLINE const envoy_config_endpoint_v3_EndpointLoadMetricStats* const* envoy_config_endpoint_v3_UpstreamLocalityStats_load_metric_stats(const envoy_config_endpoint_v3_UpstreamLocalityStats *msg, size_t *len) { return (const envoy_config_endpoint_v3_EndpointLoadMetricStats* const*)_upb_array_accessor(msg, UPB_SIZE(40, 48), len); }
-UPB_INLINE uint32_t envoy_config_endpoint_v3_UpstreamLocalityStats_priority(const envoy_config_endpoint_v3_UpstreamLocalityStats *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 32), uint32_t); }
-UPB_INLINE bool envoy_config_endpoint_v3_UpstreamLocalityStats_has_upstream_endpoint_stats(const envoy_config_endpoint_v3_UpstreamLocalityStats *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(44, 56)); }
-UPB_INLINE const envoy_config_endpoint_v3_UpstreamEndpointStats* const* envoy_config_endpoint_v3_UpstreamLocalityStats_upstream_endpoint_stats(const envoy_config_endpoint_v3_UpstreamLocalityStats *msg, size_t *len) { return (const envoy_config_endpoint_v3_UpstreamEndpointStats* const*)_upb_array_accessor(msg, UPB_SIZE(44, 56), len); }
-UPB_INLINE uint64_t envoy_config_endpoint_v3_UpstreamLocalityStats_total_issued_requests(const envoy_config_endpoint_v3_UpstreamLocalityStats *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), uint64_t); }
-
-UPB_INLINE void envoy_config_endpoint_v3_UpstreamLocalityStats_set_locality(envoy_config_endpoint_v3_UpstreamLocalityStats *msg, struct envoy_config_core_v3_Locality* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(36, 40), struct envoy_config_core_v3_Locality*) = value;
-}
-UPB_INLINE struct envoy_config_core_v3_Locality* envoy_config_endpoint_v3_UpstreamLocalityStats_mutable_locality(envoy_config_endpoint_v3_UpstreamLocalityStats *msg, upb_arena *arena) {
- struct envoy_config_core_v3_Locality* sub = (struct envoy_config_core_v3_Locality*)envoy_config_endpoint_v3_UpstreamLocalityStats_locality(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_Locality*)_upb_msg_new(&envoy_config_core_v3_Locality_msginit, arena);
- if (!sub) return NULL;
- envoy_config_endpoint_v3_UpstreamLocalityStats_set_locality(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_endpoint_v3_UpstreamLocalityStats_set_total_successful_requests(envoy_config_endpoint_v3_UpstreamLocalityStats *msg, uint64_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint64_t) = value;
-}
-UPB_INLINE void envoy_config_endpoint_v3_UpstreamLocalityStats_set_total_requests_in_progress(envoy_config_endpoint_v3_UpstreamLocalityStats *msg, uint64_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint64_t) = value;
-}
-UPB_INLINE void envoy_config_endpoint_v3_UpstreamLocalityStats_set_total_error_requests(envoy_config_endpoint_v3_UpstreamLocalityStats *msg, uint64_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(16, 16), uint64_t) = value;
-}
-UPB_INLINE envoy_config_endpoint_v3_EndpointLoadMetricStats** envoy_config_endpoint_v3_UpstreamLocalityStats_mutable_load_metric_stats(envoy_config_endpoint_v3_UpstreamLocalityStats *msg, size_t *len) {
- return (envoy_config_endpoint_v3_EndpointLoadMetricStats**)_upb_array_mutable_accessor(msg, UPB_SIZE(40, 48), len);
-}
-UPB_INLINE envoy_config_endpoint_v3_EndpointLoadMetricStats** envoy_config_endpoint_v3_UpstreamLocalityStats_resize_load_metric_stats(envoy_config_endpoint_v3_UpstreamLocalityStats *msg, size_t len, upb_arena *arena) {
- return (envoy_config_endpoint_v3_EndpointLoadMetricStats**)_upb_array_resize_accessor(msg, UPB_SIZE(40, 48), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_config_endpoint_v3_EndpointLoadMetricStats* envoy_config_endpoint_v3_UpstreamLocalityStats_add_load_metric_stats(envoy_config_endpoint_v3_UpstreamLocalityStats *msg, upb_arena *arena) {
- struct envoy_config_endpoint_v3_EndpointLoadMetricStats* sub = (struct envoy_config_endpoint_v3_EndpointLoadMetricStats*)_upb_msg_new(&envoy_config_endpoint_v3_EndpointLoadMetricStats_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(40, 48), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-UPB_INLINE void envoy_config_endpoint_v3_UpstreamLocalityStats_set_priority(envoy_config_endpoint_v3_UpstreamLocalityStats *msg, uint32_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(32, 32), uint32_t) = value;
-}
-UPB_INLINE envoy_config_endpoint_v3_UpstreamEndpointStats** envoy_config_endpoint_v3_UpstreamLocalityStats_mutable_upstream_endpoint_stats(envoy_config_endpoint_v3_UpstreamLocalityStats *msg, size_t *len) {
- return (envoy_config_endpoint_v3_UpstreamEndpointStats**)_upb_array_mutable_accessor(msg, UPB_SIZE(44, 56), len);
-}
-UPB_INLINE envoy_config_endpoint_v3_UpstreamEndpointStats** envoy_config_endpoint_v3_UpstreamLocalityStats_resize_upstream_endpoint_stats(envoy_config_endpoint_v3_UpstreamLocalityStats *msg, size_t len, upb_arena *arena) {
- return (envoy_config_endpoint_v3_UpstreamEndpointStats**)_upb_array_resize_accessor(msg, UPB_SIZE(44, 56), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_config_endpoint_v3_UpstreamEndpointStats* envoy_config_endpoint_v3_UpstreamLocalityStats_add_upstream_endpoint_stats(envoy_config_endpoint_v3_UpstreamLocalityStats *msg, upb_arena *arena) {
- struct envoy_config_endpoint_v3_UpstreamEndpointStats* sub = (struct envoy_config_endpoint_v3_UpstreamEndpointStats*)_upb_msg_new(&envoy_config_endpoint_v3_UpstreamEndpointStats_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(44, 56), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-UPB_INLINE void envoy_config_endpoint_v3_UpstreamLocalityStats_set_total_issued_requests(envoy_config_endpoint_v3_UpstreamLocalityStats *msg, uint64_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(24, 24), uint64_t) = value;
-}
-
-/* envoy.config.endpoint.v3.UpstreamEndpointStats */
-
-UPB_INLINE envoy_config_endpoint_v3_UpstreamEndpointStats *envoy_config_endpoint_v3_UpstreamEndpointStats_new(upb_arena *arena) {
- return (envoy_config_endpoint_v3_UpstreamEndpointStats *)_upb_msg_new(&envoy_config_endpoint_v3_UpstreamEndpointStats_msginit, arena);
-}
-UPB_INLINE envoy_config_endpoint_v3_UpstreamEndpointStats *envoy_config_endpoint_v3_UpstreamEndpointStats_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_endpoint_v3_UpstreamEndpointStats *ret = envoy_config_endpoint_v3_UpstreamEndpointStats_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_endpoint_v3_UpstreamEndpointStats_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_endpoint_v3_UpstreamEndpointStats_serialize(const envoy_config_endpoint_v3_UpstreamEndpointStats *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_endpoint_v3_UpstreamEndpointStats_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_config_endpoint_v3_UpstreamEndpointStats_has_address(const envoy_config_endpoint_v3_UpstreamEndpointStats *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(32, 32)); }
-UPB_INLINE const struct envoy_config_core_v3_Address* envoy_config_endpoint_v3_UpstreamEndpointStats_address(const envoy_config_endpoint_v3_UpstreamEndpointStats *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 32), const struct envoy_config_core_v3_Address*); }
-UPB_INLINE uint64_t envoy_config_endpoint_v3_UpstreamEndpointStats_total_successful_requests(const envoy_config_endpoint_v3_UpstreamEndpointStats *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint64_t); }
-UPB_INLINE uint64_t envoy_config_endpoint_v3_UpstreamEndpointStats_total_requests_in_progress(const envoy_config_endpoint_v3_UpstreamEndpointStats *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint64_t); }
-UPB_INLINE uint64_t envoy_config_endpoint_v3_UpstreamEndpointStats_total_error_requests(const envoy_config_endpoint_v3_UpstreamEndpointStats *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), uint64_t); }
-UPB_INLINE bool envoy_config_endpoint_v3_UpstreamEndpointStats_has_load_metric_stats(const envoy_config_endpoint_v3_UpstreamEndpointStats *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(40, 48)); }
-UPB_INLINE const envoy_config_endpoint_v3_EndpointLoadMetricStats* const* envoy_config_endpoint_v3_UpstreamEndpointStats_load_metric_stats(const envoy_config_endpoint_v3_UpstreamEndpointStats *msg, size_t *len) { return (const envoy_config_endpoint_v3_EndpointLoadMetricStats* const*)_upb_array_accessor(msg, UPB_SIZE(40, 48), len); }
-UPB_INLINE bool envoy_config_endpoint_v3_UpstreamEndpointStats_has_metadata(const envoy_config_endpoint_v3_UpstreamEndpointStats *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(36, 40)); }
-UPB_INLINE const struct google_protobuf_Struct* envoy_config_endpoint_v3_UpstreamEndpointStats_metadata(const envoy_config_endpoint_v3_UpstreamEndpointStats *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(36, 40), const struct google_protobuf_Struct*); }
-UPB_INLINE uint64_t envoy_config_endpoint_v3_UpstreamEndpointStats_total_issued_requests(const envoy_config_endpoint_v3_UpstreamEndpointStats *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), uint64_t); }
-
-UPB_INLINE void envoy_config_endpoint_v3_UpstreamEndpointStats_set_address(envoy_config_endpoint_v3_UpstreamEndpointStats *msg, struct envoy_config_core_v3_Address* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(32, 32), struct envoy_config_core_v3_Address*) = value;
-}
-UPB_INLINE struct envoy_config_core_v3_Address* envoy_config_endpoint_v3_UpstreamEndpointStats_mutable_address(envoy_config_endpoint_v3_UpstreamEndpointStats *msg, upb_arena *arena) {
- struct envoy_config_core_v3_Address* sub = (struct envoy_config_core_v3_Address*)envoy_config_endpoint_v3_UpstreamEndpointStats_address(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_Address*)_upb_msg_new(&envoy_config_core_v3_Address_msginit, arena);
- if (!sub) return NULL;
- envoy_config_endpoint_v3_UpstreamEndpointStats_set_address(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_endpoint_v3_UpstreamEndpointStats_set_total_successful_requests(envoy_config_endpoint_v3_UpstreamEndpointStats *msg, uint64_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint64_t) = value;
-}
-UPB_INLINE void envoy_config_endpoint_v3_UpstreamEndpointStats_set_total_requests_in_progress(envoy_config_endpoint_v3_UpstreamEndpointStats *msg, uint64_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint64_t) = value;
-}
-UPB_INLINE void envoy_config_endpoint_v3_UpstreamEndpointStats_set_total_error_requests(envoy_config_endpoint_v3_UpstreamEndpointStats *msg, uint64_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(16, 16), uint64_t) = value;
-}
-UPB_INLINE envoy_config_endpoint_v3_EndpointLoadMetricStats** envoy_config_endpoint_v3_UpstreamEndpointStats_mutable_load_metric_stats(envoy_config_endpoint_v3_UpstreamEndpointStats *msg, size_t *len) {
- return (envoy_config_endpoint_v3_EndpointLoadMetricStats**)_upb_array_mutable_accessor(msg, UPB_SIZE(40, 48), len);
-}
-UPB_INLINE envoy_config_endpoint_v3_EndpointLoadMetricStats** envoy_config_endpoint_v3_UpstreamEndpointStats_resize_load_metric_stats(envoy_config_endpoint_v3_UpstreamEndpointStats *msg, size_t len, upb_arena *arena) {
- return (envoy_config_endpoint_v3_EndpointLoadMetricStats**)_upb_array_resize_accessor(msg, UPB_SIZE(40, 48), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_config_endpoint_v3_EndpointLoadMetricStats* envoy_config_endpoint_v3_UpstreamEndpointStats_add_load_metric_stats(envoy_config_endpoint_v3_UpstreamEndpointStats *msg, upb_arena *arena) {
- struct envoy_config_endpoint_v3_EndpointLoadMetricStats* sub = (struct envoy_config_endpoint_v3_EndpointLoadMetricStats*)_upb_msg_new(&envoy_config_endpoint_v3_EndpointLoadMetricStats_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(40, 48), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-UPB_INLINE void envoy_config_endpoint_v3_UpstreamEndpointStats_set_metadata(envoy_config_endpoint_v3_UpstreamEndpointStats *msg, struct google_protobuf_Struct* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(36, 40), struct google_protobuf_Struct*) = value;
-}
-UPB_INLINE struct google_protobuf_Struct* envoy_config_endpoint_v3_UpstreamEndpointStats_mutable_metadata(envoy_config_endpoint_v3_UpstreamEndpointStats *msg, upb_arena *arena) {
- struct google_protobuf_Struct* sub = (struct google_protobuf_Struct*)envoy_config_endpoint_v3_UpstreamEndpointStats_metadata(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Struct*)_upb_msg_new(&google_protobuf_Struct_msginit, arena);
- if (!sub) return NULL;
- envoy_config_endpoint_v3_UpstreamEndpointStats_set_metadata(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_endpoint_v3_UpstreamEndpointStats_set_total_issued_requests(envoy_config_endpoint_v3_UpstreamEndpointStats *msg, uint64_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(24, 24), uint64_t) = value;
-}
-
-/* envoy.config.endpoint.v3.EndpointLoadMetricStats */
-
-UPB_INLINE envoy_config_endpoint_v3_EndpointLoadMetricStats *envoy_config_endpoint_v3_EndpointLoadMetricStats_new(upb_arena *arena) {
- return (envoy_config_endpoint_v3_EndpointLoadMetricStats *)_upb_msg_new(&envoy_config_endpoint_v3_EndpointLoadMetricStats_msginit, arena);
-}
-UPB_INLINE envoy_config_endpoint_v3_EndpointLoadMetricStats *envoy_config_endpoint_v3_EndpointLoadMetricStats_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_endpoint_v3_EndpointLoadMetricStats *ret = envoy_config_endpoint_v3_EndpointLoadMetricStats_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_endpoint_v3_EndpointLoadMetricStats_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_endpoint_v3_EndpointLoadMetricStats_serialize(const envoy_config_endpoint_v3_EndpointLoadMetricStats *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_endpoint_v3_EndpointLoadMetricStats_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview envoy_config_endpoint_v3_EndpointLoadMetricStats_metric_name(const envoy_config_endpoint_v3_EndpointLoadMetricStats *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), upb_strview); }
-UPB_INLINE uint64_t envoy_config_endpoint_v3_EndpointLoadMetricStats_num_requests_finished_with_metric(const envoy_config_endpoint_v3_EndpointLoadMetricStats *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint64_t); }
-UPB_INLINE double envoy_config_endpoint_v3_EndpointLoadMetricStats_total_metric_value(const envoy_config_endpoint_v3_EndpointLoadMetricStats *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), double); }
-
-UPB_INLINE void envoy_config_endpoint_v3_EndpointLoadMetricStats_set_metric_name(envoy_config_endpoint_v3_EndpointLoadMetricStats *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(16, 16), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_endpoint_v3_EndpointLoadMetricStats_set_num_requests_finished_with_metric(envoy_config_endpoint_v3_EndpointLoadMetricStats *msg, uint64_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint64_t) = value;
-}
-UPB_INLINE void envoy_config_endpoint_v3_EndpointLoadMetricStats_set_total_metric_value(envoy_config_endpoint_v3_EndpointLoadMetricStats *msg, double value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), double) = value;
-}
-
-/* envoy.config.endpoint.v3.ClusterStats */
-
-UPB_INLINE envoy_config_endpoint_v3_ClusterStats *envoy_config_endpoint_v3_ClusterStats_new(upb_arena *arena) {
- return (envoy_config_endpoint_v3_ClusterStats *)_upb_msg_new(&envoy_config_endpoint_v3_ClusterStats_msginit, arena);
-}
-UPB_INLINE envoy_config_endpoint_v3_ClusterStats *envoy_config_endpoint_v3_ClusterStats_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_endpoint_v3_ClusterStats *ret = envoy_config_endpoint_v3_ClusterStats_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_endpoint_v3_ClusterStats_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_endpoint_v3_ClusterStats_serialize(const envoy_config_endpoint_v3_ClusterStats *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_endpoint_v3_ClusterStats_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview envoy_config_endpoint_v3_ClusterStats_cluster_name(const envoy_config_endpoint_v3_ClusterStats *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview); }
-UPB_INLINE bool envoy_config_endpoint_v3_ClusterStats_has_upstream_locality_stats(const envoy_config_endpoint_v3_ClusterStats *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 48)); }
-UPB_INLINE const envoy_config_endpoint_v3_UpstreamLocalityStats* const* envoy_config_endpoint_v3_ClusterStats_upstream_locality_stats(const envoy_config_endpoint_v3_ClusterStats *msg, size_t *len) { return (const envoy_config_endpoint_v3_UpstreamLocalityStats* const*)_upb_array_accessor(msg, UPB_SIZE(28, 48), len); }
-UPB_INLINE uint64_t envoy_config_endpoint_v3_ClusterStats_total_dropped_requests(const envoy_config_endpoint_v3_ClusterStats *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint64_t); }
-UPB_INLINE bool envoy_config_endpoint_v3_ClusterStats_has_load_report_interval(const envoy_config_endpoint_v3_ClusterStats *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 40)); }
-UPB_INLINE const struct google_protobuf_Duration* envoy_config_endpoint_v3_ClusterStats_load_report_interval(const envoy_config_endpoint_v3_ClusterStats *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const struct google_protobuf_Duration*); }
-UPB_INLINE bool envoy_config_endpoint_v3_ClusterStats_has_dropped_requests(const envoy_config_endpoint_v3_ClusterStats *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(32, 56)); }
-UPB_INLINE const envoy_config_endpoint_v3_ClusterStats_DroppedRequests* const* envoy_config_endpoint_v3_ClusterStats_dropped_requests(const envoy_config_endpoint_v3_ClusterStats *msg, size_t *len) { return (const envoy_config_endpoint_v3_ClusterStats_DroppedRequests* const*)_upb_array_accessor(msg, UPB_SIZE(32, 56), len); }
-UPB_INLINE upb_strview envoy_config_endpoint_v3_ClusterStats_cluster_service_name(const envoy_config_endpoint_v3_ClusterStats *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_strview); }
-
-UPB_INLINE void envoy_config_endpoint_v3_ClusterStats_set_cluster_name(envoy_config_endpoint_v3_ClusterStats *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview) = value;
-}
-UPB_INLINE envoy_config_endpoint_v3_UpstreamLocalityStats** envoy_config_endpoint_v3_ClusterStats_mutable_upstream_locality_stats(envoy_config_endpoint_v3_ClusterStats *msg, size_t *len) {
- return (envoy_config_endpoint_v3_UpstreamLocalityStats**)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 48), len);
-}
-UPB_INLINE envoy_config_endpoint_v3_UpstreamLocalityStats** envoy_config_endpoint_v3_ClusterStats_resize_upstream_locality_stats(envoy_config_endpoint_v3_ClusterStats *msg, size_t len, upb_arena *arena) {
- return (envoy_config_endpoint_v3_UpstreamLocalityStats**)_upb_array_resize_accessor(msg, UPB_SIZE(28, 48), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_config_endpoint_v3_UpstreamLocalityStats* envoy_config_endpoint_v3_ClusterStats_add_upstream_locality_stats(envoy_config_endpoint_v3_ClusterStats *msg, upb_arena *arena) {
- struct envoy_config_endpoint_v3_UpstreamLocalityStats* sub = (struct envoy_config_endpoint_v3_UpstreamLocalityStats*)_upb_msg_new(&envoy_config_endpoint_v3_UpstreamLocalityStats_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(28, 48), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-UPB_INLINE void envoy_config_endpoint_v3_ClusterStats_set_total_dropped_requests(envoy_config_endpoint_v3_ClusterStats *msg, uint64_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint64_t) = value;
-}
-UPB_INLINE void envoy_config_endpoint_v3_ClusterStats_set_load_report_interval(envoy_config_endpoint_v3_ClusterStats *msg, struct google_protobuf_Duration* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(24, 40), struct google_protobuf_Duration*) = value;
-}
-UPB_INLINE struct google_protobuf_Duration* envoy_config_endpoint_v3_ClusterStats_mutable_load_report_interval(envoy_config_endpoint_v3_ClusterStats *msg, upb_arena *arena) {
- struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_endpoint_v3_ClusterStats_load_report_interval(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
- if (!sub) return NULL;
- envoy_config_endpoint_v3_ClusterStats_set_load_report_interval(msg, sub);
- }
- return sub;
-}
-UPB_INLINE envoy_config_endpoint_v3_ClusterStats_DroppedRequests** envoy_config_endpoint_v3_ClusterStats_mutable_dropped_requests(envoy_config_endpoint_v3_ClusterStats *msg, size_t *len) {
- return (envoy_config_endpoint_v3_ClusterStats_DroppedRequests**)_upb_array_mutable_accessor(msg, UPB_SIZE(32, 56), len);
-}
-UPB_INLINE envoy_config_endpoint_v3_ClusterStats_DroppedRequests** envoy_config_endpoint_v3_ClusterStats_resize_dropped_requests(envoy_config_endpoint_v3_ClusterStats *msg, size_t len, upb_arena *arena) {
- return (envoy_config_endpoint_v3_ClusterStats_DroppedRequests**)_upb_array_resize_accessor(msg, UPB_SIZE(32, 56), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_config_endpoint_v3_ClusterStats_DroppedRequests* envoy_config_endpoint_v3_ClusterStats_add_dropped_requests(envoy_config_endpoint_v3_ClusterStats *msg, upb_arena *arena) {
- struct envoy_config_endpoint_v3_ClusterStats_DroppedRequests* sub = (struct envoy_config_endpoint_v3_ClusterStats_DroppedRequests*)_upb_msg_new(&envoy_config_endpoint_v3_ClusterStats_DroppedRequests_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(32, 56), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-UPB_INLINE void envoy_config_endpoint_v3_ClusterStats_set_cluster_service_name(envoy_config_endpoint_v3_ClusterStats *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_strview) = value;
-}
-
-/* envoy.config.endpoint.v3.ClusterStats.DroppedRequests */
-
-UPB_INLINE envoy_config_endpoint_v3_ClusterStats_DroppedRequests *envoy_config_endpoint_v3_ClusterStats_DroppedRequests_new(upb_arena *arena) {
- return (envoy_config_endpoint_v3_ClusterStats_DroppedRequests *)_upb_msg_new(&envoy_config_endpoint_v3_ClusterStats_DroppedRequests_msginit, arena);
-}
-UPB_INLINE envoy_config_endpoint_v3_ClusterStats_DroppedRequests *envoy_config_endpoint_v3_ClusterStats_DroppedRequests_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_endpoint_v3_ClusterStats_DroppedRequests *ret = envoy_config_endpoint_v3_ClusterStats_DroppedRequests_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_endpoint_v3_ClusterStats_DroppedRequests_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_endpoint_v3_ClusterStats_DroppedRequests_serialize(const envoy_config_endpoint_v3_ClusterStats_DroppedRequests *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_endpoint_v3_ClusterStats_DroppedRequests_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview envoy_config_endpoint_v3_ClusterStats_DroppedRequests_category(const envoy_config_endpoint_v3_ClusterStats_DroppedRequests *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview); }
-UPB_INLINE uint64_t envoy_config_endpoint_v3_ClusterStats_DroppedRequests_dropped_count(const envoy_config_endpoint_v3_ClusterStats_DroppedRequests *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint64_t); }
-
-UPB_INLINE void envoy_config_endpoint_v3_ClusterStats_DroppedRequests_set_category(envoy_config_endpoint_v3_ClusterStats_DroppedRequests *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_endpoint_v3_ClusterStats_DroppedRequests_set_dropped_count(envoy_config_endpoint_v3_ClusterStats_DroppedRequests *msg, uint64_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint64_t) = value;
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* ENVOY_CONFIG_ENDPOINT_V3_LOAD_REPORT_PROTO_UPB_H_ */
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/endpoint/v3/load_report.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_CONFIG_ENDPOINT_V3_LOAD_REPORT_PROTO_UPB_H_
+#define ENVOY_CONFIG_ENDPOINT_V3_LOAD_REPORT_PROTO_UPB_H_
+
+#include "upb/msg.h"
+#include "upb/decode.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_config_endpoint_v3_UpstreamLocalityStats;
+struct envoy_config_endpoint_v3_UpstreamEndpointStats;
+struct envoy_config_endpoint_v3_EndpointLoadMetricStats;
+struct envoy_config_endpoint_v3_ClusterStats;
+struct envoy_config_endpoint_v3_ClusterStats_DroppedRequests;
+typedef struct envoy_config_endpoint_v3_UpstreamLocalityStats envoy_config_endpoint_v3_UpstreamLocalityStats;
+typedef struct envoy_config_endpoint_v3_UpstreamEndpointStats envoy_config_endpoint_v3_UpstreamEndpointStats;
+typedef struct envoy_config_endpoint_v3_EndpointLoadMetricStats envoy_config_endpoint_v3_EndpointLoadMetricStats;
+typedef struct envoy_config_endpoint_v3_ClusterStats envoy_config_endpoint_v3_ClusterStats;
+typedef struct envoy_config_endpoint_v3_ClusterStats_DroppedRequests envoy_config_endpoint_v3_ClusterStats_DroppedRequests;
+extern const upb_msglayout envoy_config_endpoint_v3_UpstreamLocalityStats_msginit;
+extern const upb_msglayout envoy_config_endpoint_v3_UpstreamEndpointStats_msginit;
+extern const upb_msglayout envoy_config_endpoint_v3_EndpointLoadMetricStats_msginit;
+extern const upb_msglayout envoy_config_endpoint_v3_ClusterStats_msginit;
+extern const upb_msglayout envoy_config_endpoint_v3_ClusterStats_DroppedRequests_msginit;
+struct envoy_config_core_v3_Address;
+struct envoy_config_core_v3_Locality;
+struct google_protobuf_Duration;
+struct google_protobuf_Struct;
+extern const upb_msglayout envoy_config_core_v3_Address_msginit;
+extern const upb_msglayout envoy_config_core_v3_Locality_msginit;
+extern const upb_msglayout google_protobuf_Duration_msginit;
+extern const upb_msglayout google_protobuf_Struct_msginit;
+
+
+/* envoy.config.endpoint.v3.UpstreamLocalityStats */
+
+UPB_INLINE envoy_config_endpoint_v3_UpstreamLocalityStats *envoy_config_endpoint_v3_UpstreamLocalityStats_new(upb_arena *arena) {
+ return (envoy_config_endpoint_v3_UpstreamLocalityStats *)_upb_msg_new(&envoy_config_endpoint_v3_UpstreamLocalityStats_msginit, arena);
+}
+UPB_INLINE envoy_config_endpoint_v3_UpstreamLocalityStats *envoy_config_endpoint_v3_UpstreamLocalityStats_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_endpoint_v3_UpstreamLocalityStats *ret = envoy_config_endpoint_v3_UpstreamLocalityStats_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_endpoint_v3_UpstreamLocalityStats_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_endpoint_v3_UpstreamLocalityStats_serialize(const envoy_config_endpoint_v3_UpstreamLocalityStats *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_endpoint_v3_UpstreamLocalityStats_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_endpoint_v3_UpstreamLocalityStats_has_locality(const envoy_config_endpoint_v3_UpstreamLocalityStats *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(36, 40)); }
+UPB_INLINE const struct envoy_config_core_v3_Locality* envoy_config_endpoint_v3_UpstreamLocalityStats_locality(const envoy_config_endpoint_v3_UpstreamLocalityStats *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(36, 40), const struct envoy_config_core_v3_Locality*); }
+UPB_INLINE uint64_t envoy_config_endpoint_v3_UpstreamLocalityStats_total_successful_requests(const envoy_config_endpoint_v3_UpstreamLocalityStats *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint64_t); }
+UPB_INLINE uint64_t envoy_config_endpoint_v3_UpstreamLocalityStats_total_requests_in_progress(const envoy_config_endpoint_v3_UpstreamLocalityStats *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint64_t); }
+UPB_INLINE uint64_t envoy_config_endpoint_v3_UpstreamLocalityStats_total_error_requests(const envoy_config_endpoint_v3_UpstreamLocalityStats *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), uint64_t); }
+UPB_INLINE bool envoy_config_endpoint_v3_UpstreamLocalityStats_has_load_metric_stats(const envoy_config_endpoint_v3_UpstreamLocalityStats *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(40, 48)); }
+UPB_INLINE const envoy_config_endpoint_v3_EndpointLoadMetricStats* const* envoy_config_endpoint_v3_UpstreamLocalityStats_load_metric_stats(const envoy_config_endpoint_v3_UpstreamLocalityStats *msg, size_t *len) { return (const envoy_config_endpoint_v3_EndpointLoadMetricStats* const*)_upb_array_accessor(msg, UPB_SIZE(40, 48), len); }
+UPB_INLINE uint32_t envoy_config_endpoint_v3_UpstreamLocalityStats_priority(const envoy_config_endpoint_v3_UpstreamLocalityStats *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 32), uint32_t); }
+UPB_INLINE bool envoy_config_endpoint_v3_UpstreamLocalityStats_has_upstream_endpoint_stats(const envoy_config_endpoint_v3_UpstreamLocalityStats *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(44, 56)); }
+UPB_INLINE const envoy_config_endpoint_v3_UpstreamEndpointStats* const* envoy_config_endpoint_v3_UpstreamLocalityStats_upstream_endpoint_stats(const envoy_config_endpoint_v3_UpstreamLocalityStats *msg, size_t *len) { return (const envoy_config_endpoint_v3_UpstreamEndpointStats* const*)_upb_array_accessor(msg, UPB_SIZE(44, 56), len); }
+UPB_INLINE uint64_t envoy_config_endpoint_v3_UpstreamLocalityStats_total_issued_requests(const envoy_config_endpoint_v3_UpstreamLocalityStats *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), uint64_t); }
+
+UPB_INLINE void envoy_config_endpoint_v3_UpstreamLocalityStats_set_locality(envoy_config_endpoint_v3_UpstreamLocalityStats *msg, struct envoy_config_core_v3_Locality* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(36, 40), struct envoy_config_core_v3_Locality*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_Locality* envoy_config_endpoint_v3_UpstreamLocalityStats_mutable_locality(envoy_config_endpoint_v3_UpstreamLocalityStats *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_Locality* sub = (struct envoy_config_core_v3_Locality*)envoy_config_endpoint_v3_UpstreamLocalityStats_locality(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_Locality*)_upb_msg_new(&envoy_config_core_v3_Locality_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_endpoint_v3_UpstreamLocalityStats_set_locality(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_endpoint_v3_UpstreamLocalityStats_set_total_successful_requests(envoy_config_endpoint_v3_UpstreamLocalityStats *msg, uint64_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint64_t) = value;
+}
+UPB_INLINE void envoy_config_endpoint_v3_UpstreamLocalityStats_set_total_requests_in_progress(envoy_config_endpoint_v3_UpstreamLocalityStats *msg, uint64_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint64_t) = value;
+}
+UPB_INLINE void envoy_config_endpoint_v3_UpstreamLocalityStats_set_total_error_requests(envoy_config_endpoint_v3_UpstreamLocalityStats *msg, uint64_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 16), uint64_t) = value;
+}
+UPB_INLINE envoy_config_endpoint_v3_EndpointLoadMetricStats** envoy_config_endpoint_v3_UpstreamLocalityStats_mutable_load_metric_stats(envoy_config_endpoint_v3_UpstreamLocalityStats *msg, size_t *len) {
+ return (envoy_config_endpoint_v3_EndpointLoadMetricStats**)_upb_array_mutable_accessor(msg, UPB_SIZE(40, 48), len);
+}
+UPB_INLINE envoy_config_endpoint_v3_EndpointLoadMetricStats** envoy_config_endpoint_v3_UpstreamLocalityStats_resize_load_metric_stats(envoy_config_endpoint_v3_UpstreamLocalityStats *msg, size_t len, upb_arena *arena) {
+ return (envoy_config_endpoint_v3_EndpointLoadMetricStats**)_upb_array_resize_accessor(msg, UPB_SIZE(40, 48), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_config_endpoint_v3_EndpointLoadMetricStats* envoy_config_endpoint_v3_UpstreamLocalityStats_add_load_metric_stats(envoy_config_endpoint_v3_UpstreamLocalityStats *msg, upb_arena *arena) {
+ struct envoy_config_endpoint_v3_EndpointLoadMetricStats* sub = (struct envoy_config_endpoint_v3_EndpointLoadMetricStats*)_upb_msg_new(&envoy_config_endpoint_v3_EndpointLoadMetricStats_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(40, 48), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE void envoy_config_endpoint_v3_UpstreamLocalityStats_set_priority(envoy_config_endpoint_v3_UpstreamLocalityStats *msg, uint32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 32), uint32_t) = value;
+}
+UPB_INLINE envoy_config_endpoint_v3_UpstreamEndpointStats** envoy_config_endpoint_v3_UpstreamLocalityStats_mutable_upstream_endpoint_stats(envoy_config_endpoint_v3_UpstreamLocalityStats *msg, size_t *len) {
+ return (envoy_config_endpoint_v3_UpstreamEndpointStats**)_upb_array_mutable_accessor(msg, UPB_SIZE(44, 56), len);
+}
+UPB_INLINE envoy_config_endpoint_v3_UpstreamEndpointStats** envoy_config_endpoint_v3_UpstreamLocalityStats_resize_upstream_endpoint_stats(envoy_config_endpoint_v3_UpstreamLocalityStats *msg, size_t len, upb_arena *arena) {
+ return (envoy_config_endpoint_v3_UpstreamEndpointStats**)_upb_array_resize_accessor(msg, UPB_SIZE(44, 56), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_config_endpoint_v3_UpstreamEndpointStats* envoy_config_endpoint_v3_UpstreamLocalityStats_add_upstream_endpoint_stats(envoy_config_endpoint_v3_UpstreamLocalityStats *msg, upb_arena *arena) {
+ struct envoy_config_endpoint_v3_UpstreamEndpointStats* sub = (struct envoy_config_endpoint_v3_UpstreamEndpointStats*)_upb_msg_new(&envoy_config_endpoint_v3_UpstreamEndpointStats_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(44, 56), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE void envoy_config_endpoint_v3_UpstreamLocalityStats_set_total_issued_requests(envoy_config_endpoint_v3_UpstreamLocalityStats *msg, uint64_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 24), uint64_t) = value;
+}
+
+/* envoy.config.endpoint.v3.UpstreamEndpointStats */
+
+UPB_INLINE envoy_config_endpoint_v3_UpstreamEndpointStats *envoy_config_endpoint_v3_UpstreamEndpointStats_new(upb_arena *arena) {
+ return (envoy_config_endpoint_v3_UpstreamEndpointStats *)_upb_msg_new(&envoy_config_endpoint_v3_UpstreamEndpointStats_msginit, arena);
+}
+UPB_INLINE envoy_config_endpoint_v3_UpstreamEndpointStats *envoy_config_endpoint_v3_UpstreamEndpointStats_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_endpoint_v3_UpstreamEndpointStats *ret = envoy_config_endpoint_v3_UpstreamEndpointStats_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_endpoint_v3_UpstreamEndpointStats_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_endpoint_v3_UpstreamEndpointStats_serialize(const envoy_config_endpoint_v3_UpstreamEndpointStats *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_endpoint_v3_UpstreamEndpointStats_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_endpoint_v3_UpstreamEndpointStats_has_address(const envoy_config_endpoint_v3_UpstreamEndpointStats *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(32, 32)); }
+UPB_INLINE const struct envoy_config_core_v3_Address* envoy_config_endpoint_v3_UpstreamEndpointStats_address(const envoy_config_endpoint_v3_UpstreamEndpointStats *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 32), const struct envoy_config_core_v3_Address*); }
+UPB_INLINE uint64_t envoy_config_endpoint_v3_UpstreamEndpointStats_total_successful_requests(const envoy_config_endpoint_v3_UpstreamEndpointStats *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint64_t); }
+UPB_INLINE uint64_t envoy_config_endpoint_v3_UpstreamEndpointStats_total_requests_in_progress(const envoy_config_endpoint_v3_UpstreamEndpointStats *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint64_t); }
+UPB_INLINE uint64_t envoy_config_endpoint_v3_UpstreamEndpointStats_total_error_requests(const envoy_config_endpoint_v3_UpstreamEndpointStats *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), uint64_t); }
+UPB_INLINE bool envoy_config_endpoint_v3_UpstreamEndpointStats_has_load_metric_stats(const envoy_config_endpoint_v3_UpstreamEndpointStats *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(40, 48)); }
+UPB_INLINE const envoy_config_endpoint_v3_EndpointLoadMetricStats* const* envoy_config_endpoint_v3_UpstreamEndpointStats_load_metric_stats(const envoy_config_endpoint_v3_UpstreamEndpointStats *msg, size_t *len) { return (const envoy_config_endpoint_v3_EndpointLoadMetricStats* const*)_upb_array_accessor(msg, UPB_SIZE(40, 48), len); }
+UPB_INLINE bool envoy_config_endpoint_v3_UpstreamEndpointStats_has_metadata(const envoy_config_endpoint_v3_UpstreamEndpointStats *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(36, 40)); }
+UPB_INLINE const struct google_protobuf_Struct* envoy_config_endpoint_v3_UpstreamEndpointStats_metadata(const envoy_config_endpoint_v3_UpstreamEndpointStats *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(36, 40), const struct google_protobuf_Struct*); }
+UPB_INLINE uint64_t envoy_config_endpoint_v3_UpstreamEndpointStats_total_issued_requests(const envoy_config_endpoint_v3_UpstreamEndpointStats *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), uint64_t); }
+
+UPB_INLINE void envoy_config_endpoint_v3_UpstreamEndpointStats_set_address(envoy_config_endpoint_v3_UpstreamEndpointStats *msg, struct envoy_config_core_v3_Address* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 32), struct envoy_config_core_v3_Address*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_Address* envoy_config_endpoint_v3_UpstreamEndpointStats_mutable_address(envoy_config_endpoint_v3_UpstreamEndpointStats *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_Address* sub = (struct envoy_config_core_v3_Address*)envoy_config_endpoint_v3_UpstreamEndpointStats_address(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_Address*)_upb_msg_new(&envoy_config_core_v3_Address_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_endpoint_v3_UpstreamEndpointStats_set_address(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_endpoint_v3_UpstreamEndpointStats_set_total_successful_requests(envoy_config_endpoint_v3_UpstreamEndpointStats *msg, uint64_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint64_t) = value;
+}
+UPB_INLINE void envoy_config_endpoint_v3_UpstreamEndpointStats_set_total_requests_in_progress(envoy_config_endpoint_v3_UpstreamEndpointStats *msg, uint64_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint64_t) = value;
+}
+UPB_INLINE void envoy_config_endpoint_v3_UpstreamEndpointStats_set_total_error_requests(envoy_config_endpoint_v3_UpstreamEndpointStats *msg, uint64_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 16), uint64_t) = value;
+}
+UPB_INLINE envoy_config_endpoint_v3_EndpointLoadMetricStats** envoy_config_endpoint_v3_UpstreamEndpointStats_mutable_load_metric_stats(envoy_config_endpoint_v3_UpstreamEndpointStats *msg, size_t *len) {
+ return (envoy_config_endpoint_v3_EndpointLoadMetricStats**)_upb_array_mutable_accessor(msg, UPB_SIZE(40, 48), len);
+}
+UPB_INLINE envoy_config_endpoint_v3_EndpointLoadMetricStats** envoy_config_endpoint_v3_UpstreamEndpointStats_resize_load_metric_stats(envoy_config_endpoint_v3_UpstreamEndpointStats *msg, size_t len, upb_arena *arena) {
+ return (envoy_config_endpoint_v3_EndpointLoadMetricStats**)_upb_array_resize_accessor(msg, UPB_SIZE(40, 48), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_config_endpoint_v3_EndpointLoadMetricStats* envoy_config_endpoint_v3_UpstreamEndpointStats_add_load_metric_stats(envoy_config_endpoint_v3_UpstreamEndpointStats *msg, upb_arena *arena) {
+ struct envoy_config_endpoint_v3_EndpointLoadMetricStats* sub = (struct envoy_config_endpoint_v3_EndpointLoadMetricStats*)_upb_msg_new(&envoy_config_endpoint_v3_EndpointLoadMetricStats_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(40, 48), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE void envoy_config_endpoint_v3_UpstreamEndpointStats_set_metadata(envoy_config_endpoint_v3_UpstreamEndpointStats *msg, struct google_protobuf_Struct* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(36, 40), struct google_protobuf_Struct*) = value;
+}
+UPB_INLINE struct google_protobuf_Struct* envoy_config_endpoint_v3_UpstreamEndpointStats_mutable_metadata(envoy_config_endpoint_v3_UpstreamEndpointStats *msg, upb_arena *arena) {
+ struct google_protobuf_Struct* sub = (struct google_protobuf_Struct*)envoy_config_endpoint_v3_UpstreamEndpointStats_metadata(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Struct*)_upb_msg_new(&google_protobuf_Struct_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_endpoint_v3_UpstreamEndpointStats_set_metadata(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_endpoint_v3_UpstreamEndpointStats_set_total_issued_requests(envoy_config_endpoint_v3_UpstreamEndpointStats *msg, uint64_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 24), uint64_t) = value;
+}
+
+/* envoy.config.endpoint.v3.EndpointLoadMetricStats */
+
+UPB_INLINE envoy_config_endpoint_v3_EndpointLoadMetricStats *envoy_config_endpoint_v3_EndpointLoadMetricStats_new(upb_arena *arena) {
+ return (envoy_config_endpoint_v3_EndpointLoadMetricStats *)_upb_msg_new(&envoy_config_endpoint_v3_EndpointLoadMetricStats_msginit, arena);
+}
+UPB_INLINE envoy_config_endpoint_v3_EndpointLoadMetricStats *envoy_config_endpoint_v3_EndpointLoadMetricStats_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_endpoint_v3_EndpointLoadMetricStats *ret = envoy_config_endpoint_v3_EndpointLoadMetricStats_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_endpoint_v3_EndpointLoadMetricStats_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_endpoint_v3_EndpointLoadMetricStats_serialize(const envoy_config_endpoint_v3_EndpointLoadMetricStats *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_endpoint_v3_EndpointLoadMetricStats_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview envoy_config_endpoint_v3_EndpointLoadMetricStats_metric_name(const envoy_config_endpoint_v3_EndpointLoadMetricStats *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), upb_strview); }
+UPB_INLINE uint64_t envoy_config_endpoint_v3_EndpointLoadMetricStats_num_requests_finished_with_metric(const envoy_config_endpoint_v3_EndpointLoadMetricStats *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint64_t); }
+UPB_INLINE double envoy_config_endpoint_v3_EndpointLoadMetricStats_total_metric_value(const envoy_config_endpoint_v3_EndpointLoadMetricStats *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), double); }
+
+UPB_INLINE void envoy_config_endpoint_v3_EndpointLoadMetricStats_set_metric_name(envoy_config_endpoint_v3_EndpointLoadMetricStats *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 16), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_endpoint_v3_EndpointLoadMetricStats_set_num_requests_finished_with_metric(envoy_config_endpoint_v3_EndpointLoadMetricStats *msg, uint64_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint64_t) = value;
+}
+UPB_INLINE void envoy_config_endpoint_v3_EndpointLoadMetricStats_set_total_metric_value(envoy_config_endpoint_v3_EndpointLoadMetricStats *msg, double value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), double) = value;
+}
+
+/* envoy.config.endpoint.v3.ClusterStats */
+
+UPB_INLINE envoy_config_endpoint_v3_ClusterStats *envoy_config_endpoint_v3_ClusterStats_new(upb_arena *arena) {
+ return (envoy_config_endpoint_v3_ClusterStats *)_upb_msg_new(&envoy_config_endpoint_v3_ClusterStats_msginit, arena);
+}
+UPB_INLINE envoy_config_endpoint_v3_ClusterStats *envoy_config_endpoint_v3_ClusterStats_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_endpoint_v3_ClusterStats *ret = envoy_config_endpoint_v3_ClusterStats_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_endpoint_v3_ClusterStats_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_endpoint_v3_ClusterStats_serialize(const envoy_config_endpoint_v3_ClusterStats *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_endpoint_v3_ClusterStats_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview envoy_config_endpoint_v3_ClusterStats_cluster_name(const envoy_config_endpoint_v3_ClusterStats *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview); }
+UPB_INLINE bool envoy_config_endpoint_v3_ClusterStats_has_upstream_locality_stats(const envoy_config_endpoint_v3_ClusterStats *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 48)); }
+UPB_INLINE const envoy_config_endpoint_v3_UpstreamLocalityStats* const* envoy_config_endpoint_v3_ClusterStats_upstream_locality_stats(const envoy_config_endpoint_v3_ClusterStats *msg, size_t *len) { return (const envoy_config_endpoint_v3_UpstreamLocalityStats* const*)_upb_array_accessor(msg, UPB_SIZE(28, 48), len); }
+UPB_INLINE uint64_t envoy_config_endpoint_v3_ClusterStats_total_dropped_requests(const envoy_config_endpoint_v3_ClusterStats *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint64_t); }
+UPB_INLINE bool envoy_config_endpoint_v3_ClusterStats_has_load_report_interval(const envoy_config_endpoint_v3_ClusterStats *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 40)); }
+UPB_INLINE const struct google_protobuf_Duration* envoy_config_endpoint_v3_ClusterStats_load_report_interval(const envoy_config_endpoint_v3_ClusterStats *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const struct google_protobuf_Duration*); }
+UPB_INLINE bool envoy_config_endpoint_v3_ClusterStats_has_dropped_requests(const envoy_config_endpoint_v3_ClusterStats *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(32, 56)); }
+UPB_INLINE const envoy_config_endpoint_v3_ClusterStats_DroppedRequests* const* envoy_config_endpoint_v3_ClusterStats_dropped_requests(const envoy_config_endpoint_v3_ClusterStats *msg, size_t *len) { return (const envoy_config_endpoint_v3_ClusterStats_DroppedRequests* const*)_upb_array_accessor(msg, UPB_SIZE(32, 56), len); }
+UPB_INLINE upb_strview envoy_config_endpoint_v3_ClusterStats_cluster_service_name(const envoy_config_endpoint_v3_ClusterStats *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_strview); }
+
+UPB_INLINE void envoy_config_endpoint_v3_ClusterStats_set_cluster_name(envoy_config_endpoint_v3_ClusterStats *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview) = value;
+}
+UPB_INLINE envoy_config_endpoint_v3_UpstreamLocalityStats** envoy_config_endpoint_v3_ClusterStats_mutable_upstream_locality_stats(envoy_config_endpoint_v3_ClusterStats *msg, size_t *len) {
+ return (envoy_config_endpoint_v3_UpstreamLocalityStats**)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 48), len);
+}
+UPB_INLINE envoy_config_endpoint_v3_UpstreamLocalityStats** envoy_config_endpoint_v3_ClusterStats_resize_upstream_locality_stats(envoy_config_endpoint_v3_ClusterStats *msg, size_t len, upb_arena *arena) {
+ return (envoy_config_endpoint_v3_UpstreamLocalityStats**)_upb_array_resize_accessor(msg, UPB_SIZE(28, 48), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_config_endpoint_v3_UpstreamLocalityStats* envoy_config_endpoint_v3_ClusterStats_add_upstream_locality_stats(envoy_config_endpoint_v3_ClusterStats *msg, upb_arena *arena) {
+ struct envoy_config_endpoint_v3_UpstreamLocalityStats* sub = (struct envoy_config_endpoint_v3_UpstreamLocalityStats*)_upb_msg_new(&envoy_config_endpoint_v3_UpstreamLocalityStats_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(28, 48), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE void envoy_config_endpoint_v3_ClusterStats_set_total_dropped_requests(envoy_config_endpoint_v3_ClusterStats *msg, uint64_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint64_t) = value;
+}
+UPB_INLINE void envoy_config_endpoint_v3_ClusterStats_set_load_report_interval(envoy_config_endpoint_v3_ClusterStats *msg, struct google_protobuf_Duration* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 40), struct google_protobuf_Duration*) = value;
+}
+UPB_INLINE struct google_protobuf_Duration* envoy_config_endpoint_v3_ClusterStats_mutable_load_report_interval(envoy_config_endpoint_v3_ClusterStats *msg, upb_arena *arena) {
+ struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_endpoint_v3_ClusterStats_load_report_interval(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_endpoint_v3_ClusterStats_set_load_report_interval(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE envoy_config_endpoint_v3_ClusterStats_DroppedRequests** envoy_config_endpoint_v3_ClusterStats_mutable_dropped_requests(envoy_config_endpoint_v3_ClusterStats *msg, size_t *len) {
+ return (envoy_config_endpoint_v3_ClusterStats_DroppedRequests**)_upb_array_mutable_accessor(msg, UPB_SIZE(32, 56), len);
+}
+UPB_INLINE envoy_config_endpoint_v3_ClusterStats_DroppedRequests** envoy_config_endpoint_v3_ClusterStats_resize_dropped_requests(envoy_config_endpoint_v3_ClusterStats *msg, size_t len, upb_arena *arena) {
+ return (envoy_config_endpoint_v3_ClusterStats_DroppedRequests**)_upb_array_resize_accessor(msg, UPB_SIZE(32, 56), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_config_endpoint_v3_ClusterStats_DroppedRequests* envoy_config_endpoint_v3_ClusterStats_add_dropped_requests(envoy_config_endpoint_v3_ClusterStats *msg, upb_arena *arena) {
+ struct envoy_config_endpoint_v3_ClusterStats_DroppedRequests* sub = (struct envoy_config_endpoint_v3_ClusterStats_DroppedRequests*)_upb_msg_new(&envoy_config_endpoint_v3_ClusterStats_DroppedRequests_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(32, 56), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE void envoy_config_endpoint_v3_ClusterStats_set_cluster_service_name(envoy_config_endpoint_v3_ClusterStats *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_strview) = value;
+}
+
+/* envoy.config.endpoint.v3.ClusterStats.DroppedRequests */
+
+UPB_INLINE envoy_config_endpoint_v3_ClusterStats_DroppedRequests *envoy_config_endpoint_v3_ClusterStats_DroppedRequests_new(upb_arena *arena) {
+ return (envoy_config_endpoint_v3_ClusterStats_DroppedRequests *)_upb_msg_new(&envoy_config_endpoint_v3_ClusterStats_DroppedRequests_msginit, arena);
+}
+UPB_INLINE envoy_config_endpoint_v3_ClusterStats_DroppedRequests *envoy_config_endpoint_v3_ClusterStats_DroppedRequests_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_endpoint_v3_ClusterStats_DroppedRequests *ret = envoy_config_endpoint_v3_ClusterStats_DroppedRequests_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_endpoint_v3_ClusterStats_DroppedRequests_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_endpoint_v3_ClusterStats_DroppedRequests_serialize(const envoy_config_endpoint_v3_ClusterStats_DroppedRequests *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_endpoint_v3_ClusterStats_DroppedRequests_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview envoy_config_endpoint_v3_ClusterStats_DroppedRequests_category(const envoy_config_endpoint_v3_ClusterStats_DroppedRequests *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview); }
+UPB_INLINE uint64_t envoy_config_endpoint_v3_ClusterStats_DroppedRequests_dropped_count(const envoy_config_endpoint_v3_ClusterStats_DroppedRequests *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint64_t); }
+
+UPB_INLINE void envoy_config_endpoint_v3_ClusterStats_DroppedRequests_set_category(envoy_config_endpoint_v3_ClusterStats_DroppedRequests *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_endpoint_v3_ClusterStats_DroppedRequests_set_dropped_count(envoy_config_endpoint_v3_ClusterStats_DroppedRequests *msg, uint64_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint64_t) = value;
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_CONFIG_ENDPOINT_V3_LOAD_REPORT_PROTO_UPB_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.c
index d5c589cd071..7d0a105b95a 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.c
@@ -1,33 +1,33 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/config/listener/v3/api_listener.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include <stddef.h>
-#include "upb/msg.h"
-#include "envoy/config/listener/v3/api_listener.upb.h"
-#include "google/protobuf/any.upb.h"
-#include "udpa/annotations/status.upb.h"
-#include "udpa/annotations/versioning.upb.h"
-
-#include "upb/port_def.inc"
-
-static const upb_msglayout *const envoy_config_listener_v3_ApiListener_submsgs[1] = {
- &google_protobuf_Any_msginit,
-};
-
-static const upb_msglayout_field envoy_config_listener_v3_ApiListener__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
-};
-
-const upb_msglayout envoy_config_listener_v3_ApiListener_msginit = {
- &envoy_config_listener_v3_ApiListener_submsgs[0],
- &envoy_config_listener_v3_ApiListener__fields[0],
- UPB_SIZE(4, 8), 1, false,
-};
-
-#include "upb/port_undef.inc"
-
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/listener/v3/api_listener.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg.h"
+#include "envoy/config/listener/v3/api_listener.upb.h"
+#include "google/protobuf/any.upb.h"
+#include "udpa/annotations/status.upb.h"
+#include "udpa/annotations/versioning.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_msglayout *const envoy_config_listener_v3_ApiListener_submsgs[1] = {
+ &google_protobuf_Any_msginit,
+};
+
+static const upb_msglayout_field envoy_config_listener_v3_ApiListener__fields[1] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
+};
+
+const upb_msglayout envoy_config_listener_v3_ApiListener_msginit = {
+ &envoy_config_listener_v3_ApiListener_submsgs[0],
+ &envoy_config_listener_v3_ApiListener__fields[0],
+ UPB_SIZE(4, 8), 1, false,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.h
index e2af56fd23a..81fbf6b7041 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.h
@@ -1,65 +1,65 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/config/listener/v3/api_listener.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef ENVOY_CONFIG_LISTENER_V3_API_LISTENER_PROTO_UPB_H_
-#define ENVOY_CONFIG_LISTENER_V3_API_LISTENER_PROTO_UPB_H_
-
-#include "upb/msg.h"
-#include "upb/decode.h"
-#include "upb/encode.h"
-
-#include "upb/port_def.inc"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct envoy_config_listener_v3_ApiListener;
-typedef struct envoy_config_listener_v3_ApiListener envoy_config_listener_v3_ApiListener;
-extern const upb_msglayout envoy_config_listener_v3_ApiListener_msginit;
-struct google_protobuf_Any;
-extern const upb_msglayout google_protobuf_Any_msginit;
-
-
-/* envoy.config.listener.v3.ApiListener */
-
-UPB_INLINE envoy_config_listener_v3_ApiListener *envoy_config_listener_v3_ApiListener_new(upb_arena *arena) {
- return (envoy_config_listener_v3_ApiListener *)_upb_msg_new(&envoy_config_listener_v3_ApiListener_msginit, arena);
-}
-UPB_INLINE envoy_config_listener_v3_ApiListener *envoy_config_listener_v3_ApiListener_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_listener_v3_ApiListener *ret = envoy_config_listener_v3_ApiListener_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_listener_v3_ApiListener_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_listener_v3_ApiListener_serialize(const envoy_config_listener_v3_ApiListener *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_listener_v3_ApiListener_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_config_listener_v3_ApiListener_has_api_listener(const envoy_config_listener_v3_ApiListener *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE const struct google_protobuf_Any* envoy_config_listener_v3_ApiListener_api_listener(const envoy_config_listener_v3_ApiListener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct google_protobuf_Any*); }
-
-UPB_INLINE void envoy_config_listener_v3_ApiListener_set_api_listener(envoy_config_listener_v3_ApiListener *msg, struct google_protobuf_Any* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct google_protobuf_Any*) = value;
-}
-UPB_INLINE struct google_protobuf_Any* envoy_config_listener_v3_ApiListener_mutable_api_listener(envoy_config_listener_v3_ApiListener *msg, upb_arena *arena) {
- struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_config_listener_v3_ApiListener_api_listener(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena);
- if (!sub) return NULL;
- envoy_config_listener_v3_ApiListener_set_api_listener(msg, sub);
- }
- return sub;
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* ENVOY_CONFIG_LISTENER_V3_API_LISTENER_PROTO_UPB_H_ */
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/listener/v3/api_listener.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_CONFIG_LISTENER_V3_API_LISTENER_PROTO_UPB_H_
+#define ENVOY_CONFIG_LISTENER_V3_API_LISTENER_PROTO_UPB_H_
+
+#include "upb/msg.h"
+#include "upb/decode.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_config_listener_v3_ApiListener;
+typedef struct envoy_config_listener_v3_ApiListener envoy_config_listener_v3_ApiListener;
+extern const upb_msglayout envoy_config_listener_v3_ApiListener_msginit;
+struct google_protobuf_Any;
+extern const upb_msglayout google_protobuf_Any_msginit;
+
+
+/* envoy.config.listener.v3.ApiListener */
+
+UPB_INLINE envoy_config_listener_v3_ApiListener *envoy_config_listener_v3_ApiListener_new(upb_arena *arena) {
+ return (envoy_config_listener_v3_ApiListener *)_upb_msg_new(&envoy_config_listener_v3_ApiListener_msginit, arena);
+}
+UPB_INLINE envoy_config_listener_v3_ApiListener *envoy_config_listener_v3_ApiListener_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_listener_v3_ApiListener *ret = envoy_config_listener_v3_ApiListener_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_listener_v3_ApiListener_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_listener_v3_ApiListener_serialize(const envoy_config_listener_v3_ApiListener *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_listener_v3_ApiListener_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_listener_v3_ApiListener_has_api_listener(const envoy_config_listener_v3_ApiListener *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE const struct google_protobuf_Any* envoy_config_listener_v3_ApiListener_api_listener(const envoy_config_listener_v3_ApiListener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct google_protobuf_Any*); }
+
+UPB_INLINE void envoy_config_listener_v3_ApiListener_set_api_listener(envoy_config_listener_v3_ApiListener *msg, struct google_protobuf_Any* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct google_protobuf_Any*) = value;
+}
+UPB_INLINE struct google_protobuf_Any* envoy_config_listener_v3_ApiListener_mutable_api_listener(envoy_config_listener_v3_ApiListener *msg, upb_arena *arena) {
+ struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_config_listener_v3_ApiListener_api_listener(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_listener_v3_ApiListener_set_api_listener(msg, sub);
+ }
+ return sub;
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_CONFIG_LISTENER_V3_API_LISTENER_PROTO_UPB_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.c
index d104664f241..4fe3ca748a7 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.c
@@ -1,128 +1,128 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/config/listener/v3/listener.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include <stddef.h>
-#include "upb/msg.h"
-#include "envoy/config/listener/v3/listener.upb.h"
-#include "envoy/config/accesslog/v3/accesslog.upb.h"
-#include "envoy/config/core/v3/address.upb.h"
-#include "envoy/config/core/v3/base.upb.h"
-#include "envoy/config/core/v3/extension.upb.h"
-#include "envoy/config/core/v3/socket_option.upb.h"
-#include "envoy/config/listener/v3/api_listener.upb.h"
-#include "envoy/config/listener/v3/listener_components.upb.h"
-#include "envoy/config/listener/v3/udp_listener_config.upb.h"
-#include "google/api/annotations.upb.h"
-#include "google/protobuf/duration.upb.h"
-#include "google/protobuf/wrappers.upb.h"
-#include "udpa/core/v1/collection_entry.upb.h"
-#include "udpa/annotations/security.upb.h"
-#include "udpa/annotations/status.upb.h"
-#include "udpa/annotations/versioning.upb.h"
-#include "validate/validate.upb.h"
-
-#include "upb/port_def.inc"
-
-static const upb_msglayout *const envoy_config_listener_v3_ListenerCollection_submsgs[1] = {
- &udpa_core_v1_CollectionEntry_msginit,
-};
-
-static const upb_msglayout_field envoy_config_listener_v3_ListenerCollection__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 3},
-};
-
-const upb_msglayout envoy_config_listener_v3_ListenerCollection_msginit = {
- &envoy_config_listener_v3_ListenerCollection_submsgs[0],
- &envoy_config_listener_v3_ListenerCollection__fields[0],
- UPB_SIZE(4, 8), 1, false,
-};
-
-static const upb_msglayout *const envoy_config_listener_v3_Listener_submsgs[17] = {
- &envoy_config_accesslog_v3_AccessLog_msginit,
- &envoy_config_core_v3_Address_msginit,
- &envoy_config_core_v3_Metadata_msginit,
- &envoy_config_core_v3_SocketOption_msginit,
- &envoy_config_core_v3_TypedExtensionConfig_msginit,
- &envoy_config_listener_v3_ApiListener_msginit,
- &envoy_config_listener_v3_FilterChain_msginit,
- &envoy_config_listener_v3_Listener_ConnectionBalanceConfig_msginit,
- &envoy_config_listener_v3_Listener_DeprecatedV1_msginit,
- &envoy_config_listener_v3_ListenerFilter_msginit,
- &envoy_config_listener_v3_UdpListenerConfig_msginit,
- &google_protobuf_BoolValue_msginit,
- &google_protobuf_Duration_msginit,
- &google_protobuf_UInt32Value_msginit,
-};
-
-static const upb_msglayout_field envoy_config_listener_v3_Listener__fields[22] = {
- {1, UPB_SIZE(20, 24), 0, 0, 9, 1},
- {2, UPB_SIZE(28, 40), 0, 1, 11, 1},
- {3, UPB_SIZE(80, 144), 0, 6, 11, 3},
- {5, UPB_SIZE(32, 48), 0, 13, 11, 1},
- {6, UPB_SIZE(36, 56), 0, 2, 11, 1},
- {7, UPB_SIZE(40, 64), 0, 8, 11, 1},
- {8, UPB_SIZE(0, 0), 0, 0, 14, 1},
- {9, UPB_SIZE(84, 152), 0, 9, 11, 3},
- {10, UPB_SIZE(44, 72), 0, 11, 11, 1},
- {11, UPB_SIZE(48, 80), 0, 11, 11, 1},
- {12, UPB_SIZE(52, 88), 0, 13, 11, 1},
- {13, UPB_SIZE(88, 160), 0, 3, 11, 3},
- {15, UPB_SIZE(56, 96), 0, 12, 11, 1},
- {16, UPB_SIZE(8, 8), 0, 0, 14, 1},
- {17, UPB_SIZE(16, 16), 0, 0, 8, 1},
- {18, UPB_SIZE(60, 104), 0, 10, 11, 1},
- {19, UPB_SIZE(64, 112), 0, 5, 11, 1},
- {20, UPB_SIZE(68, 120), 0, 7, 11, 1},
- {21, UPB_SIZE(17, 17), 0, 0, 8, 1},
- {22, UPB_SIZE(92, 168), 0, 0, 11, 3},
- {23, UPB_SIZE(72, 128), 0, 4, 11, 1},
- {24, UPB_SIZE(76, 136), 0, 13, 11, 1},
-};
-
-const upb_msglayout envoy_config_listener_v3_Listener_msginit = {
- &envoy_config_listener_v3_Listener_submsgs[0],
- &envoy_config_listener_v3_Listener__fields[0],
- UPB_SIZE(96, 176), 22, false,
-};
-
-static const upb_msglayout *const envoy_config_listener_v3_Listener_DeprecatedV1_submsgs[1] = {
- &google_protobuf_BoolValue_msginit,
-};
-
-static const upb_msglayout_field envoy_config_listener_v3_Listener_DeprecatedV1__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
-};
-
-const upb_msglayout envoy_config_listener_v3_Listener_DeprecatedV1_msginit = {
- &envoy_config_listener_v3_Listener_DeprecatedV1_submsgs[0],
- &envoy_config_listener_v3_Listener_DeprecatedV1__fields[0],
- UPB_SIZE(4, 8), 1, false,
-};
-
-static const upb_msglayout *const envoy_config_listener_v3_Listener_ConnectionBalanceConfig_submsgs[1] = {
- &envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance_msginit,
-};
-
-static const upb_msglayout_field envoy_config_listener_v3_Listener_ConnectionBalanceConfig__fields[1] = {
- {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, 1},
-};
-
-const upb_msglayout envoy_config_listener_v3_Listener_ConnectionBalanceConfig_msginit = {
- &envoy_config_listener_v3_Listener_ConnectionBalanceConfig_submsgs[0],
- &envoy_config_listener_v3_Listener_ConnectionBalanceConfig__fields[0],
- UPB_SIZE(8, 16), 1, false,
-};
-
-const upb_msglayout envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance_msginit = {
- NULL,
- NULL,
- UPB_SIZE(0, 0), 0, false,
-};
-
-#include "upb/port_undef.inc"
-
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/listener/v3/listener.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg.h"
+#include "envoy/config/listener/v3/listener.upb.h"
+#include "envoy/config/accesslog/v3/accesslog.upb.h"
+#include "envoy/config/core/v3/address.upb.h"
+#include "envoy/config/core/v3/base.upb.h"
+#include "envoy/config/core/v3/extension.upb.h"
+#include "envoy/config/core/v3/socket_option.upb.h"
+#include "envoy/config/listener/v3/api_listener.upb.h"
+#include "envoy/config/listener/v3/listener_components.upb.h"
+#include "envoy/config/listener/v3/udp_listener_config.upb.h"
+#include "google/api/annotations.upb.h"
+#include "google/protobuf/duration.upb.h"
+#include "google/protobuf/wrappers.upb.h"
+#include "udpa/core/v1/collection_entry.upb.h"
+#include "udpa/annotations/security.upb.h"
+#include "udpa/annotations/status.upb.h"
+#include "udpa/annotations/versioning.upb.h"
+#include "validate/validate.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_msglayout *const envoy_config_listener_v3_ListenerCollection_submsgs[1] = {
+ &udpa_core_v1_CollectionEntry_msginit,
+};
+
+static const upb_msglayout_field envoy_config_listener_v3_ListenerCollection__fields[1] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 11, 3},
+};
+
+const upb_msglayout envoy_config_listener_v3_ListenerCollection_msginit = {
+ &envoy_config_listener_v3_ListenerCollection_submsgs[0],
+ &envoy_config_listener_v3_ListenerCollection__fields[0],
+ UPB_SIZE(4, 8), 1, false,
+};
+
+static const upb_msglayout *const envoy_config_listener_v3_Listener_submsgs[17] = {
+ &envoy_config_accesslog_v3_AccessLog_msginit,
+ &envoy_config_core_v3_Address_msginit,
+ &envoy_config_core_v3_Metadata_msginit,
+ &envoy_config_core_v3_SocketOption_msginit,
+ &envoy_config_core_v3_TypedExtensionConfig_msginit,
+ &envoy_config_listener_v3_ApiListener_msginit,
+ &envoy_config_listener_v3_FilterChain_msginit,
+ &envoy_config_listener_v3_Listener_ConnectionBalanceConfig_msginit,
+ &envoy_config_listener_v3_Listener_DeprecatedV1_msginit,
+ &envoy_config_listener_v3_ListenerFilter_msginit,
+ &envoy_config_listener_v3_UdpListenerConfig_msginit,
+ &google_protobuf_BoolValue_msginit,
+ &google_protobuf_Duration_msginit,
+ &google_protobuf_UInt32Value_msginit,
+};
+
+static const upb_msglayout_field envoy_config_listener_v3_Listener__fields[22] = {
+ {1, UPB_SIZE(20, 24), 0, 0, 9, 1},
+ {2, UPB_SIZE(28, 40), 0, 1, 11, 1},
+ {3, UPB_SIZE(80, 144), 0, 6, 11, 3},
+ {5, UPB_SIZE(32, 48), 0, 13, 11, 1},
+ {6, UPB_SIZE(36, 56), 0, 2, 11, 1},
+ {7, UPB_SIZE(40, 64), 0, 8, 11, 1},
+ {8, UPB_SIZE(0, 0), 0, 0, 14, 1},
+ {9, UPB_SIZE(84, 152), 0, 9, 11, 3},
+ {10, UPB_SIZE(44, 72), 0, 11, 11, 1},
+ {11, UPB_SIZE(48, 80), 0, 11, 11, 1},
+ {12, UPB_SIZE(52, 88), 0, 13, 11, 1},
+ {13, UPB_SIZE(88, 160), 0, 3, 11, 3},
+ {15, UPB_SIZE(56, 96), 0, 12, 11, 1},
+ {16, UPB_SIZE(8, 8), 0, 0, 14, 1},
+ {17, UPB_SIZE(16, 16), 0, 0, 8, 1},
+ {18, UPB_SIZE(60, 104), 0, 10, 11, 1},
+ {19, UPB_SIZE(64, 112), 0, 5, 11, 1},
+ {20, UPB_SIZE(68, 120), 0, 7, 11, 1},
+ {21, UPB_SIZE(17, 17), 0, 0, 8, 1},
+ {22, UPB_SIZE(92, 168), 0, 0, 11, 3},
+ {23, UPB_SIZE(72, 128), 0, 4, 11, 1},
+ {24, UPB_SIZE(76, 136), 0, 13, 11, 1},
+};
+
+const upb_msglayout envoy_config_listener_v3_Listener_msginit = {
+ &envoy_config_listener_v3_Listener_submsgs[0],
+ &envoy_config_listener_v3_Listener__fields[0],
+ UPB_SIZE(96, 176), 22, false,
+};
+
+static const upb_msglayout *const envoy_config_listener_v3_Listener_DeprecatedV1_submsgs[1] = {
+ &google_protobuf_BoolValue_msginit,
+};
+
+static const upb_msglayout_field envoy_config_listener_v3_Listener_DeprecatedV1__fields[1] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
+};
+
+const upb_msglayout envoy_config_listener_v3_Listener_DeprecatedV1_msginit = {
+ &envoy_config_listener_v3_Listener_DeprecatedV1_submsgs[0],
+ &envoy_config_listener_v3_Listener_DeprecatedV1__fields[0],
+ UPB_SIZE(4, 8), 1, false,
+};
+
+static const upb_msglayout *const envoy_config_listener_v3_Listener_ConnectionBalanceConfig_submsgs[1] = {
+ &envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance_msginit,
+};
+
+static const upb_msglayout_field envoy_config_listener_v3_Listener_ConnectionBalanceConfig__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, 1},
+};
+
+const upb_msglayout envoy_config_listener_v3_Listener_ConnectionBalanceConfig_msginit = {
+ &envoy_config_listener_v3_Listener_ConnectionBalanceConfig_submsgs[0],
+ &envoy_config_listener_v3_Listener_ConnectionBalanceConfig__fields[0],
+ UPB_SIZE(8, 16), 1, false,
+};
+
+const upb_msglayout envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance_msginit = {
+ NULL,
+ NULL,
+ UPB_SIZE(0, 0), 0, false,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.h
index f33c7a4283a..0bc3ca36990 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.h
@@ -1,467 +1,467 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/config/listener/v3/listener.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef ENVOY_CONFIG_LISTENER_V3_LISTENER_PROTO_UPB_H_
-#define ENVOY_CONFIG_LISTENER_V3_LISTENER_PROTO_UPB_H_
-
-#include "upb/msg.h"
-#include "upb/decode.h"
-#include "upb/encode.h"
-
-#include "upb/port_def.inc"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct envoy_config_listener_v3_ListenerCollection;
-struct envoy_config_listener_v3_Listener;
-struct envoy_config_listener_v3_Listener_DeprecatedV1;
-struct envoy_config_listener_v3_Listener_ConnectionBalanceConfig;
-struct envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance;
-typedef struct envoy_config_listener_v3_ListenerCollection envoy_config_listener_v3_ListenerCollection;
-typedef struct envoy_config_listener_v3_Listener envoy_config_listener_v3_Listener;
-typedef struct envoy_config_listener_v3_Listener_DeprecatedV1 envoy_config_listener_v3_Listener_DeprecatedV1;
-typedef struct envoy_config_listener_v3_Listener_ConnectionBalanceConfig envoy_config_listener_v3_Listener_ConnectionBalanceConfig;
-typedef struct envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance;
-extern const upb_msglayout envoy_config_listener_v3_ListenerCollection_msginit;
-extern const upb_msglayout envoy_config_listener_v3_Listener_msginit;
-extern const upb_msglayout envoy_config_listener_v3_Listener_DeprecatedV1_msginit;
-extern const upb_msglayout envoy_config_listener_v3_Listener_ConnectionBalanceConfig_msginit;
-extern const upb_msglayout envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance_msginit;
-struct envoy_config_accesslog_v3_AccessLog;
-struct envoy_config_core_v3_Address;
-struct envoy_config_core_v3_Metadata;
-struct envoy_config_core_v3_SocketOption;
-struct envoy_config_core_v3_TypedExtensionConfig;
-struct envoy_config_listener_v3_ApiListener;
-struct envoy_config_listener_v3_FilterChain;
-struct envoy_config_listener_v3_ListenerFilter;
-struct envoy_config_listener_v3_UdpListenerConfig;
-struct google_protobuf_BoolValue;
-struct google_protobuf_Duration;
-struct google_protobuf_UInt32Value;
-struct udpa_core_v1_CollectionEntry;
-extern const upb_msglayout envoy_config_accesslog_v3_AccessLog_msginit;
-extern const upb_msglayout envoy_config_core_v3_Address_msginit;
-extern const upb_msglayout envoy_config_core_v3_Metadata_msginit;
-extern const upb_msglayout envoy_config_core_v3_SocketOption_msginit;
-extern const upb_msglayout envoy_config_core_v3_TypedExtensionConfig_msginit;
-extern const upb_msglayout envoy_config_listener_v3_ApiListener_msginit;
-extern const upb_msglayout envoy_config_listener_v3_FilterChain_msginit;
-extern const upb_msglayout envoy_config_listener_v3_ListenerFilter_msginit;
-extern const upb_msglayout envoy_config_listener_v3_UdpListenerConfig_msginit;
-extern const upb_msglayout google_protobuf_BoolValue_msginit;
-extern const upb_msglayout google_protobuf_Duration_msginit;
-extern const upb_msglayout google_protobuf_UInt32Value_msginit;
-extern const upb_msglayout udpa_core_v1_CollectionEntry_msginit;
-
-typedef enum {
- envoy_config_listener_v3_Listener_DEFAULT = 0,
- envoy_config_listener_v3_Listener_MODIFY_ONLY = 1
-} envoy_config_listener_v3_Listener_DrainType;
-
-
-/* envoy.config.listener.v3.ListenerCollection */
-
-UPB_INLINE envoy_config_listener_v3_ListenerCollection *envoy_config_listener_v3_ListenerCollection_new(upb_arena *arena) {
- return (envoy_config_listener_v3_ListenerCollection *)_upb_msg_new(&envoy_config_listener_v3_ListenerCollection_msginit, arena);
-}
-UPB_INLINE envoy_config_listener_v3_ListenerCollection *envoy_config_listener_v3_ListenerCollection_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_listener_v3_ListenerCollection *ret = envoy_config_listener_v3_ListenerCollection_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_listener_v3_ListenerCollection_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_listener_v3_ListenerCollection_serialize(const envoy_config_listener_v3_ListenerCollection *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_listener_v3_ListenerCollection_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_config_listener_v3_ListenerCollection_has_entries(const envoy_config_listener_v3_ListenerCollection *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE const struct udpa_core_v1_CollectionEntry* const* envoy_config_listener_v3_ListenerCollection_entries(const envoy_config_listener_v3_ListenerCollection *msg, size_t *len) { return (const struct udpa_core_v1_CollectionEntry* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
-
-UPB_INLINE struct udpa_core_v1_CollectionEntry** envoy_config_listener_v3_ListenerCollection_mutable_entries(envoy_config_listener_v3_ListenerCollection *msg, size_t *len) {
- return (struct udpa_core_v1_CollectionEntry**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
-}
-UPB_INLINE struct udpa_core_v1_CollectionEntry** envoy_config_listener_v3_ListenerCollection_resize_entries(envoy_config_listener_v3_ListenerCollection *msg, size_t len, upb_arena *arena) {
- return (struct udpa_core_v1_CollectionEntry**)_upb_array_resize_accessor(msg, UPB_SIZE(0, 0), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct udpa_core_v1_CollectionEntry* envoy_config_listener_v3_ListenerCollection_add_entries(envoy_config_listener_v3_ListenerCollection *msg, upb_arena *arena) {
- struct udpa_core_v1_CollectionEntry* sub = (struct udpa_core_v1_CollectionEntry*)_upb_msg_new(&udpa_core_v1_CollectionEntry_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(0, 0), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-
-/* envoy.config.listener.v3.Listener */
-
-UPB_INLINE envoy_config_listener_v3_Listener *envoy_config_listener_v3_Listener_new(upb_arena *arena) {
- return (envoy_config_listener_v3_Listener *)_upb_msg_new(&envoy_config_listener_v3_Listener_msginit, arena);
-}
-UPB_INLINE envoy_config_listener_v3_Listener *envoy_config_listener_v3_Listener_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_listener_v3_Listener *ret = envoy_config_listener_v3_Listener_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_listener_v3_Listener_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_listener_v3_Listener_serialize(const envoy_config_listener_v3_Listener *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_listener_v3_Listener_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview envoy_config_listener_v3_Listener_name(const envoy_config_listener_v3_Listener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 24), upb_strview); }
-UPB_INLINE bool envoy_config_listener_v3_Listener_has_address(const envoy_config_listener_v3_Listener *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 40)); }
-UPB_INLINE const struct envoy_config_core_v3_Address* envoy_config_listener_v3_Listener_address(const envoy_config_listener_v3_Listener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 40), const struct envoy_config_core_v3_Address*); }
-UPB_INLINE bool envoy_config_listener_v3_Listener_has_filter_chains(const envoy_config_listener_v3_Listener *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(80, 144)); }
-UPB_INLINE const struct envoy_config_listener_v3_FilterChain* const* envoy_config_listener_v3_Listener_filter_chains(const envoy_config_listener_v3_Listener *msg, size_t *len) { return (const struct envoy_config_listener_v3_FilterChain* const*)_upb_array_accessor(msg, UPB_SIZE(80, 144), len); }
-UPB_INLINE bool envoy_config_listener_v3_Listener_has_per_connection_buffer_limit_bytes(const envoy_config_listener_v3_Listener *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(32, 48)); }
-UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_listener_v3_Listener_per_connection_buffer_limit_bytes(const envoy_config_listener_v3_Listener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 48), const struct google_protobuf_UInt32Value*); }
-UPB_INLINE bool envoy_config_listener_v3_Listener_has_metadata(const envoy_config_listener_v3_Listener *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(36, 56)); }
-UPB_INLINE const struct envoy_config_core_v3_Metadata* envoy_config_listener_v3_Listener_metadata(const envoy_config_listener_v3_Listener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(36, 56), const struct envoy_config_core_v3_Metadata*); }
-UPB_INLINE bool envoy_config_listener_v3_Listener_has_deprecated_v1(const envoy_config_listener_v3_Listener *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(40, 64)); }
-UPB_INLINE const envoy_config_listener_v3_Listener_DeprecatedV1* envoy_config_listener_v3_Listener_deprecated_v1(const envoy_config_listener_v3_Listener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(40, 64), const envoy_config_listener_v3_Listener_DeprecatedV1*); }
-UPB_INLINE int32_t envoy_config_listener_v3_Listener_drain_type(const envoy_config_listener_v3_Listener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
-UPB_INLINE bool envoy_config_listener_v3_Listener_has_listener_filters(const envoy_config_listener_v3_Listener *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(84, 152)); }
-UPB_INLINE const struct envoy_config_listener_v3_ListenerFilter* const* envoy_config_listener_v3_Listener_listener_filters(const envoy_config_listener_v3_Listener *msg, size_t *len) { return (const struct envoy_config_listener_v3_ListenerFilter* const*)_upb_array_accessor(msg, UPB_SIZE(84, 152), len); }
-UPB_INLINE bool envoy_config_listener_v3_Listener_has_transparent(const envoy_config_listener_v3_Listener *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(44, 72)); }
-UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_listener_v3_Listener_transparent(const envoy_config_listener_v3_Listener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(44, 72), const struct google_protobuf_BoolValue*); }
-UPB_INLINE bool envoy_config_listener_v3_Listener_has_freebind(const envoy_config_listener_v3_Listener *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(48, 80)); }
-UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_listener_v3_Listener_freebind(const envoy_config_listener_v3_Listener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(48, 80), const struct google_protobuf_BoolValue*); }
-UPB_INLINE bool envoy_config_listener_v3_Listener_has_tcp_fast_open_queue_length(const envoy_config_listener_v3_Listener *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(52, 88)); }
-UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_listener_v3_Listener_tcp_fast_open_queue_length(const envoy_config_listener_v3_Listener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(52, 88), const struct google_protobuf_UInt32Value*); }
-UPB_INLINE bool envoy_config_listener_v3_Listener_has_socket_options(const envoy_config_listener_v3_Listener *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(88, 160)); }
-UPB_INLINE const struct envoy_config_core_v3_SocketOption* const* envoy_config_listener_v3_Listener_socket_options(const envoy_config_listener_v3_Listener *msg, size_t *len) { return (const struct envoy_config_core_v3_SocketOption* const*)_upb_array_accessor(msg, UPB_SIZE(88, 160), len); }
-UPB_INLINE bool envoy_config_listener_v3_Listener_has_listener_filters_timeout(const envoy_config_listener_v3_Listener *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(56, 96)); }
-UPB_INLINE const struct google_protobuf_Duration* envoy_config_listener_v3_Listener_listener_filters_timeout(const envoy_config_listener_v3_Listener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(56, 96), const struct google_protobuf_Duration*); }
-UPB_INLINE int32_t envoy_config_listener_v3_Listener_traffic_direction(const envoy_config_listener_v3_Listener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); }
-UPB_INLINE bool envoy_config_listener_v3_Listener_continue_on_listener_filters_timeout(const envoy_config_listener_v3_Listener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), bool); }
-UPB_INLINE bool envoy_config_listener_v3_Listener_has_udp_listener_config(const envoy_config_listener_v3_Listener *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(60, 104)); }
-UPB_INLINE const struct envoy_config_listener_v3_UdpListenerConfig* envoy_config_listener_v3_Listener_udp_listener_config(const envoy_config_listener_v3_Listener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(60, 104), const struct envoy_config_listener_v3_UdpListenerConfig*); }
-UPB_INLINE bool envoy_config_listener_v3_Listener_has_api_listener(const envoy_config_listener_v3_Listener *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(64, 112)); }
-UPB_INLINE const struct envoy_config_listener_v3_ApiListener* envoy_config_listener_v3_Listener_api_listener(const envoy_config_listener_v3_Listener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(64, 112), const struct envoy_config_listener_v3_ApiListener*); }
-UPB_INLINE bool envoy_config_listener_v3_Listener_has_connection_balance_config(const envoy_config_listener_v3_Listener *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(68, 120)); }
-UPB_INLINE const envoy_config_listener_v3_Listener_ConnectionBalanceConfig* envoy_config_listener_v3_Listener_connection_balance_config(const envoy_config_listener_v3_Listener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(68, 120), const envoy_config_listener_v3_Listener_ConnectionBalanceConfig*); }
-UPB_INLINE bool envoy_config_listener_v3_Listener_reuse_port(const envoy_config_listener_v3_Listener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(17, 17), bool); }
-UPB_INLINE bool envoy_config_listener_v3_Listener_has_access_log(const envoy_config_listener_v3_Listener *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(92, 168)); }
-UPB_INLINE const struct envoy_config_accesslog_v3_AccessLog* const* envoy_config_listener_v3_Listener_access_log(const envoy_config_listener_v3_Listener *msg, size_t *len) { return (const struct envoy_config_accesslog_v3_AccessLog* const*)_upb_array_accessor(msg, UPB_SIZE(92, 168), len); }
-UPB_INLINE bool envoy_config_listener_v3_Listener_has_udp_writer_config(const envoy_config_listener_v3_Listener *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(72, 128)); }
-UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_listener_v3_Listener_udp_writer_config(const envoy_config_listener_v3_Listener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(72, 128), const struct envoy_config_core_v3_TypedExtensionConfig*); }
-UPB_INLINE bool envoy_config_listener_v3_Listener_has_tcp_backlog_size(const envoy_config_listener_v3_Listener *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(76, 136)); }
-UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_listener_v3_Listener_tcp_backlog_size(const envoy_config_listener_v3_Listener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(76, 136), const struct google_protobuf_UInt32Value*); }
-
-UPB_INLINE void envoy_config_listener_v3_Listener_set_name(envoy_config_listener_v3_Listener *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(20, 24), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_listener_v3_Listener_set_address(envoy_config_listener_v3_Listener *msg, struct envoy_config_core_v3_Address* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(28, 40), struct envoy_config_core_v3_Address*) = value;
-}
-UPB_INLINE struct envoy_config_core_v3_Address* envoy_config_listener_v3_Listener_mutable_address(envoy_config_listener_v3_Listener *msg, upb_arena *arena) {
- struct envoy_config_core_v3_Address* sub = (struct envoy_config_core_v3_Address*)envoy_config_listener_v3_Listener_address(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_Address*)_upb_msg_new(&envoy_config_core_v3_Address_msginit, arena);
- if (!sub) return NULL;
- envoy_config_listener_v3_Listener_set_address(msg, sub);
- }
- return sub;
-}
-UPB_INLINE struct envoy_config_listener_v3_FilterChain** envoy_config_listener_v3_Listener_mutable_filter_chains(envoy_config_listener_v3_Listener *msg, size_t *len) {
- return (struct envoy_config_listener_v3_FilterChain**)_upb_array_mutable_accessor(msg, UPB_SIZE(80, 144), len);
-}
-UPB_INLINE struct envoy_config_listener_v3_FilterChain** envoy_config_listener_v3_Listener_resize_filter_chains(envoy_config_listener_v3_Listener *msg, size_t len, upb_arena *arena) {
- return (struct envoy_config_listener_v3_FilterChain**)_upb_array_resize_accessor(msg, UPB_SIZE(80, 144), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_config_listener_v3_FilterChain* envoy_config_listener_v3_Listener_add_filter_chains(envoy_config_listener_v3_Listener *msg, upb_arena *arena) {
- struct envoy_config_listener_v3_FilterChain* sub = (struct envoy_config_listener_v3_FilterChain*)_upb_msg_new(&envoy_config_listener_v3_FilterChain_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(80, 144), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-UPB_INLINE void envoy_config_listener_v3_Listener_set_per_connection_buffer_limit_bytes(envoy_config_listener_v3_Listener *msg, struct google_protobuf_UInt32Value* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(32, 48), struct google_protobuf_UInt32Value*) = value;
-}
-UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_listener_v3_Listener_mutable_per_connection_buffer_limit_bytes(envoy_config_listener_v3_Listener *msg, upb_arena *arena) {
- struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_listener_v3_Listener_per_connection_buffer_limit_bytes(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
- if (!sub) return NULL;
- envoy_config_listener_v3_Listener_set_per_connection_buffer_limit_bytes(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_listener_v3_Listener_set_metadata(envoy_config_listener_v3_Listener *msg, struct envoy_config_core_v3_Metadata* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(36, 56), struct envoy_config_core_v3_Metadata*) = value;
-}
-UPB_INLINE struct envoy_config_core_v3_Metadata* envoy_config_listener_v3_Listener_mutable_metadata(envoy_config_listener_v3_Listener *msg, upb_arena *arena) {
- struct envoy_config_core_v3_Metadata* sub = (struct envoy_config_core_v3_Metadata*)envoy_config_listener_v3_Listener_metadata(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_Metadata*)_upb_msg_new(&envoy_config_core_v3_Metadata_msginit, arena);
- if (!sub) return NULL;
- envoy_config_listener_v3_Listener_set_metadata(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_listener_v3_Listener_set_deprecated_v1(envoy_config_listener_v3_Listener *msg, envoy_config_listener_v3_Listener_DeprecatedV1* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(40, 64), envoy_config_listener_v3_Listener_DeprecatedV1*) = value;
-}
-UPB_INLINE struct envoy_config_listener_v3_Listener_DeprecatedV1* envoy_config_listener_v3_Listener_mutable_deprecated_v1(envoy_config_listener_v3_Listener *msg, upb_arena *arena) {
- struct envoy_config_listener_v3_Listener_DeprecatedV1* sub = (struct envoy_config_listener_v3_Listener_DeprecatedV1*)envoy_config_listener_v3_Listener_deprecated_v1(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_listener_v3_Listener_DeprecatedV1*)_upb_msg_new(&envoy_config_listener_v3_Listener_DeprecatedV1_msginit, arena);
- if (!sub) return NULL;
- envoy_config_listener_v3_Listener_set_deprecated_v1(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_listener_v3_Listener_set_drain_type(envoy_config_listener_v3_Listener *msg, int32_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
-}
-UPB_INLINE struct envoy_config_listener_v3_ListenerFilter** envoy_config_listener_v3_Listener_mutable_listener_filters(envoy_config_listener_v3_Listener *msg, size_t *len) {
- return (struct envoy_config_listener_v3_ListenerFilter**)_upb_array_mutable_accessor(msg, UPB_SIZE(84, 152), len);
-}
-UPB_INLINE struct envoy_config_listener_v3_ListenerFilter** envoy_config_listener_v3_Listener_resize_listener_filters(envoy_config_listener_v3_Listener *msg, size_t len, upb_arena *arena) {
- return (struct envoy_config_listener_v3_ListenerFilter**)_upb_array_resize_accessor(msg, UPB_SIZE(84, 152), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_config_listener_v3_ListenerFilter* envoy_config_listener_v3_Listener_add_listener_filters(envoy_config_listener_v3_Listener *msg, upb_arena *arena) {
- struct envoy_config_listener_v3_ListenerFilter* sub = (struct envoy_config_listener_v3_ListenerFilter*)_upb_msg_new(&envoy_config_listener_v3_ListenerFilter_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(84, 152), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-UPB_INLINE void envoy_config_listener_v3_Listener_set_transparent(envoy_config_listener_v3_Listener *msg, struct google_protobuf_BoolValue* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(44, 72), struct google_protobuf_BoolValue*) = value;
-}
-UPB_INLINE struct google_protobuf_BoolValue* envoy_config_listener_v3_Listener_mutable_transparent(envoy_config_listener_v3_Listener *msg, upb_arena *arena) {
- struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_listener_v3_Listener_transparent(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_BoolValue*)_upb_msg_new(&google_protobuf_BoolValue_msginit, arena);
- if (!sub) return NULL;
- envoy_config_listener_v3_Listener_set_transparent(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_listener_v3_Listener_set_freebind(envoy_config_listener_v3_Listener *msg, struct google_protobuf_BoolValue* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(48, 80), struct google_protobuf_BoolValue*) = value;
-}
-UPB_INLINE struct google_protobuf_BoolValue* envoy_config_listener_v3_Listener_mutable_freebind(envoy_config_listener_v3_Listener *msg, upb_arena *arena) {
- struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_listener_v3_Listener_freebind(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_BoolValue*)_upb_msg_new(&google_protobuf_BoolValue_msginit, arena);
- if (!sub) return NULL;
- envoy_config_listener_v3_Listener_set_freebind(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_listener_v3_Listener_set_tcp_fast_open_queue_length(envoy_config_listener_v3_Listener *msg, struct google_protobuf_UInt32Value* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(52, 88), struct google_protobuf_UInt32Value*) = value;
-}
-UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_listener_v3_Listener_mutable_tcp_fast_open_queue_length(envoy_config_listener_v3_Listener *msg, upb_arena *arena) {
- struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_listener_v3_Listener_tcp_fast_open_queue_length(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
- if (!sub) return NULL;
- envoy_config_listener_v3_Listener_set_tcp_fast_open_queue_length(msg, sub);
- }
- return sub;
-}
-UPB_INLINE struct envoy_config_core_v3_SocketOption** envoy_config_listener_v3_Listener_mutable_socket_options(envoy_config_listener_v3_Listener *msg, size_t *len) {
- return (struct envoy_config_core_v3_SocketOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(88, 160), len);
-}
-UPB_INLINE struct envoy_config_core_v3_SocketOption** envoy_config_listener_v3_Listener_resize_socket_options(envoy_config_listener_v3_Listener *msg, size_t len, upb_arena *arena) {
- return (struct envoy_config_core_v3_SocketOption**)_upb_array_resize_accessor(msg, UPB_SIZE(88, 160), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_config_core_v3_SocketOption* envoy_config_listener_v3_Listener_add_socket_options(envoy_config_listener_v3_Listener *msg, upb_arena *arena) {
- struct envoy_config_core_v3_SocketOption* sub = (struct envoy_config_core_v3_SocketOption*)_upb_msg_new(&envoy_config_core_v3_SocketOption_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(88, 160), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-UPB_INLINE void envoy_config_listener_v3_Listener_set_listener_filters_timeout(envoy_config_listener_v3_Listener *msg, struct google_protobuf_Duration* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(56, 96), struct google_protobuf_Duration*) = value;
-}
-UPB_INLINE struct google_protobuf_Duration* envoy_config_listener_v3_Listener_mutable_listener_filters_timeout(envoy_config_listener_v3_Listener *msg, upb_arena *arena) {
- struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_listener_v3_Listener_listener_filters_timeout(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
- if (!sub) return NULL;
- envoy_config_listener_v3_Listener_set_listener_filters_timeout(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_listener_v3_Listener_set_traffic_direction(envoy_config_listener_v3_Listener *msg, int32_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
-}
-UPB_INLINE void envoy_config_listener_v3_Listener_set_continue_on_listener_filters_timeout(envoy_config_listener_v3_Listener *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(16, 16), bool) = value;
-}
-UPB_INLINE void envoy_config_listener_v3_Listener_set_udp_listener_config(envoy_config_listener_v3_Listener *msg, struct envoy_config_listener_v3_UdpListenerConfig* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(60, 104), struct envoy_config_listener_v3_UdpListenerConfig*) = value;
-}
-UPB_INLINE struct envoy_config_listener_v3_UdpListenerConfig* envoy_config_listener_v3_Listener_mutable_udp_listener_config(envoy_config_listener_v3_Listener *msg, upb_arena *arena) {
- struct envoy_config_listener_v3_UdpListenerConfig* sub = (struct envoy_config_listener_v3_UdpListenerConfig*)envoy_config_listener_v3_Listener_udp_listener_config(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_listener_v3_UdpListenerConfig*)_upb_msg_new(&envoy_config_listener_v3_UdpListenerConfig_msginit, arena);
- if (!sub) return NULL;
- envoy_config_listener_v3_Listener_set_udp_listener_config(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_listener_v3_Listener_set_api_listener(envoy_config_listener_v3_Listener *msg, struct envoy_config_listener_v3_ApiListener* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(64, 112), struct envoy_config_listener_v3_ApiListener*) = value;
-}
-UPB_INLINE struct envoy_config_listener_v3_ApiListener* envoy_config_listener_v3_Listener_mutable_api_listener(envoy_config_listener_v3_Listener *msg, upb_arena *arena) {
- struct envoy_config_listener_v3_ApiListener* sub = (struct envoy_config_listener_v3_ApiListener*)envoy_config_listener_v3_Listener_api_listener(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_listener_v3_ApiListener*)_upb_msg_new(&envoy_config_listener_v3_ApiListener_msginit, arena);
- if (!sub) return NULL;
- envoy_config_listener_v3_Listener_set_api_listener(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_listener_v3_Listener_set_connection_balance_config(envoy_config_listener_v3_Listener *msg, envoy_config_listener_v3_Listener_ConnectionBalanceConfig* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(68, 120), envoy_config_listener_v3_Listener_ConnectionBalanceConfig*) = value;
-}
-UPB_INLINE struct envoy_config_listener_v3_Listener_ConnectionBalanceConfig* envoy_config_listener_v3_Listener_mutable_connection_balance_config(envoy_config_listener_v3_Listener *msg, upb_arena *arena) {
- struct envoy_config_listener_v3_Listener_ConnectionBalanceConfig* sub = (struct envoy_config_listener_v3_Listener_ConnectionBalanceConfig*)envoy_config_listener_v3_Listener_connection_balance_config(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_listener_v3_Listener_ConnectionBalanceConfig*)_upb_msg_new(&envoy_config_listener_v3_Listener_ConnectionBalanceConfig_msginit, arena);
- if (!sub) return NULL;
- envoy_config_listener_v3_Listener_set_connection_balance_config(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_listener_v3_Listener_set_reuse_port(envoy_config_listener_v3_Listener *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(17, 17), bool) = value;
-}
-UPB_INLINE struct envoy_config_accesslog_v3_AccessLog** envoy_config_listener_v3_Listener_mutable_access_log(envoy_config_listener_v3_Listener *msg, size_t *len) {
- return (struct envoy_config_accesslog_v3_AccessLog**)_upb_array_mutable_accessor(msg, UPB_SIZE(92, 168), len);
-}
-UPB_INLINE struct envoy_config_accesslog_v3_AccessLog** envoy_config_listener_v3_Listener_resize_access_log(envoy_config_listener_v3_Listener *msg, size_t len, upb_arena *arena) {
- return (struct envoy_config_accesslog_v3_AccessLog**)_upb_array_resize_accessor(msg, UPB_SIZE(92, 168), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_config_accesslog_v3_AccessLog* envoy_config_listener_v3_Listener_add_access_log(envoy_config_listener_v3_Listener *msg, upb_arena *arena) {
- struct envoy_config_accesslog_v3_AccessLog* sub = (struct envoy_config_accesslog_v3_AccessLog*)_upb_msg_new(&envoy_config_accesslog_v3_AccessLog_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(92, 168), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-UPB_INLINE void envoy_config_listener_v3_Listener_set_udp_writer_config(envoy_config_listener_v3_Listener *msg, struct envoy_config_core_v3_TypedExtensionConfig* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(72, 128), struct envoy_config_core_v3_TypedExtensionConfig*) = value;
-}
-UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_listener_v3_Listener_mutable_udp_writer_config(envoy_config_listener_v3_Listener *msg, upb_arena *arena) {
- struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)envoy_config_listener_v3_Listener_udp_writer_config(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_msg_new(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena);
- if (!sub) return NULL;
- envoy_config_listener_v3_Listener_set_udp_writer_config(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_listener_v3_Listener_set_tcp_backlog_size(envoy_config_listener_v3_Listener *msg, struct google_protobuf_UInt32Value* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(76, 136), struct google_protobuf_UInt32Value*) = value;
-}
-UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_listener_v3_Listener_mutable_tcp_backlog_size(envoy_config_listener_v3_Listener *msg, upb_arena *arena) {
- struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_listener_v3_Listener_tcp_backlog_size(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
- if (!sub) return NULL;
- envoy_config_listener_v3_Listener_set_tcp_backlog_size(msg, sub);
- }
- return sub;
-}
-
-/* envoy.config.listener.v3.Listener.DeprecatedV1 */
-
-UPB_INLINE envoy_config_listener_v3_Listener_DeprecatedV1 *envoy_config_listener_v3_Listener_DeprecatedV1_new(upb_arena *arena) {
- return (envoy_config_listener_v3_Listener_DeprecatedV1 *)_upb_msg_new(&envoy_config_listener_v3_Listener_DeprecatedV1_msginit, arena);
-}
-UPB_INLINE envoy_config_listener_v3_Listener_DeprecatedV1 *envoy_config_listener_v3_Listener_DeprecatedV1_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_listener_v3_Listener_DeprecatedV1 *ret = envoy_config_listener_v3_Listener_DeprecatedV1_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_listener_v3_Listener_DeprecatedV1_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_listener_v3_Listener_DeprecatedV1_serialize(const envoy_config_listener_v3_Listener_DeprecatedV1 *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_listener_v3_Listener_DeprecatedV1_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_config_listener_v3_Listener_DeprecatedV1_has_bind_to_port(const envoy_config_listener_v3_Listener_DeprecatedV1 *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_listener_v3_Listener_DeprecatedV1_bind_to_port(const envoy_config_listener_v3_Listener_DeprecatedV1 *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct google_protobuf_BoolValue*); }
-
-UPB_INLINE void envoy_config_listener_v3_Listener_DeprecatedV1_set_bind_to_port(envoy_config_listener_v3_Listener_DeprecatedV1 *msg, struct google_protobuf_BoolValue* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct google_protobuf_BoolValue*) = value;
-}
-UPB_INLINE struct google_protobuf_BoolValue* envoy_config_listener_v3_Listener_DeprecatedV1_mutable_bind_to_port(envoy_config_listener_v3_Listener_DeprecatedV1 *msg, upb_arena *arena) {
- struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_listener_v3_Listener_DeprecatedV1_bind_to_port(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_BoolValue*)_upb_msg_new(&google_protobuf_BoolValue_msginit, arena);
- if (!sub) return NULL;
- envoy_config_listener_v3_Listener_DeprecatedV1_set_bind_to_port(msg, sub);
- }
- return sub;
-}
-
-/* envoy.config.listener.v3.Listener.ConnectionBalanceConfig */
-
-UPB_INLINE envoy_config_listener_v3_Listener_ConnectionBalanceConfig *envoy_config_listener_v3_Listener_ConnectionBalanceConfig_new(upb_arena *arena) {
- return (envoy_config_listener_v3_Listener_ConnectionBalanceConfig *)_upb_msg_new(&envoy_config_listener_v3_Listener_ConnectionBalanceConfig_msginit, arena);
-}
-UPB_INLINE envoy_config_listener_v3_Listener_ConnectionBalanceConfig *envoy_config_listener_v3_Listener_ConnectionBalanceConfig_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_listener_v3_Listener_ConnectionBalanceConfig *ret = envoy_config_listener_v3_Listener_ConnectionBalanceConfig_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_listener_v3_Listener_ConnectionBalanceConfig_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_listener_v3_Listener_ConnectionBalanceConfig_serialize(const envoy_config_listener_v3_Listener_ConnectionBalanceConfig *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_listener_v3_Listener_ConnectionBalanceConfig_msginit, arena, len);
-}
-
-typedef enum {
- envoy_config_listener_v3_Listener_ConnectionBalanceConfig_balance_type_exact_balance = 1,
- envoy_config_listener_v3_Listener_ConnectionBalanceConfig_balance_type_NOT_SET = 0
-} envoy_config_listener_v3_Listener_ConnectionBalanceConfig_balance_type_oneofcases;
-UPB_INLINE envoy_config_listener_v3_Listener_ConnectionBalanceConfig_balance_type_oneofcases envoy_config_listener_v3_Listener_ConnectionBalanceConfig_balance_type_case(const envoy_config_listener_v3_Listener_ConnectionBalanceConfig* msg) { return (envoy_config_listener_v3_Listener_ConnectionBalanceConfig_balance_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 8), int32_t); }
-
-UPB_INLINE bool envoy_config_listener_v3_Listener_ConnectionBalanceConfig_has_exact_balance(const envoy_config_listener_v3_Listener_ConnectionBalanceConfig *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 1; }
-UPB_INLINE const envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance* envoy_config_listener_v3_Listener_ConnectionBalanceConfig_exact_balance(const envoy_config_listener_v3_Listener_ConnectionBalanceConfig *msg) { return UPB_READ_ONEOF(msg, const envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 1, NULL); }
-
-UPB_INLINE void envoy_config_listener_v3_Listener_ConnectionBalanceConfig_set_exact_balance(envoy_config_listener_v3_Listener_ConnectionBalanceConfig *msg, envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 1);
-}
-UPB_INLINE struct envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance* envoy_config_listener_v3_Listener_ConnectionBalanceConfig_mutable_exact_balance(envoy_config_listener_v3_Listener_ConnectionBalanceConfig *msg, upb_arena *arena) {
- struct envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance* sub = (struct envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance*)envoy_config_listener_v3_Listener_ConnectionBalanceConfig_exact_balance(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance*)_upb_msg_new(&envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance_msginit, arena);
- if (!sub) return NULL;
- envoy_config_listener_v3_Listener_ConnectionBalanceConfig_set_exact_balance(msg, sub);
- }
- return sub;
-}
-
-/* envoy.config.listener.v3.Listener.ConnectionBalanceConfig.ExactBalance */
-
-UPB_INLINE envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance *envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance_new(upb_arena *arena) {
- return (envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance *)_upb_msg_new(&envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance_msginit, arena);
-}
-UPB_INLINE envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance *envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance *ret = envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance_serialize(const envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance_msginit, arena, len);
-}
-
-
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* ENVOY_CONFIG_LISTENER_V3_LISTENER_PROTO_UPB_H_ */
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/listener/v3/listener.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_CONFIG_LISTENER_V3_LISTENER_PROTO_UPB_H_
+#define ENVOY_CONFIG_LISTENER_V3_LISTENER_PROTO_UPB_H_
+
+#include "upb/msg.h"
+#include "upb/decode.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_config_listener_v3_ListenerCollection;
+struct envoy_config_listener_v3_Listener;
+struct envoy_config_listener_v3_Listener_DeprecatedV1;
+struct envoy_config_listener_v3_Listener_ConnectionBalanceConfig;
+struct envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance;
+typedef struct envoy_config_listener_v3_ListenerCollection envoy_config_listener_v3_ListenerCollection;
+typedef struct envoy_config_listener_v3_Listener envoy_config_listener_v3_Listener;
+typedef struct envoy_config_listener_v3_Listener_DeprecatedV1 envoy_config_listener_v3_Listener_DeprecatedV1;
+typedef struct envoy_config_listener_v3_Listener_ConnectionBalanceConfig envoy_config_listener_v3_Listener_ConnectionBalanceConfig;
+typedef struct envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance;
+extern const upb_msglayout envoy_config_listener_v3_ListenerCollection_msginit;
+extern const upb_msglayout envoy_config_listener_v3_Listener_msginit;
+extern const upb_msglayout envoy_config_listener_v3_Listener_DeprecatedV1_msginit;
+extern const upb_msglayout envoy_config_listener_v3_Listener_ConnectionBalanceConfig_msginit;
+extern const upb_msglayout envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance_msginit;
+struct envoy_config_accesslog_v3_AccessLog;
+struct envoy_config_core_v3_Address;
+struct envoy_config_core_v3_Metadata;
+struct envoy_config_core_v3_SocketOption;
+struct envoy_config_core_v3_TypedExtensionConfig;
+struct envoy_config_listener_v3_ApiListener;
+struct envoy_config_listener_v3_FilterChain;
+struct envoy_config_listener_v3_ListenerFilter;
+struct envoy_config_listener_v3_UdpListenerConfig;
+struct google_protobuf_BoolValue;
+struct google_protobuf_Duration;
+struct google_protobuf_UInt32Value;
+struct udpa_core_v1_CollectionEntry;
+extern const upb_msglayout envoy_config_accesslog_v3_AccessLog_msginit;
+extern const upb_msglayout envoy_config_core_v3_Address_msginit;
+extern const upb_msglayout envoy_config_core_v3_Metadata_msginit;
+extern const upb_msglayout envoy_config_core_v3_SocketOption_msginit;
+extern const upb_msglayout envoy_config_core_v3_TypedExtensionConfig_msginit;
+extern const upb_msglayout envoy_config_listener_v3_ApiListener_msginit;
+extern const upb_msglayout envoy_config_listener_v3_FilterChain_msginit;
+extern const upb_msglayout envoy_config_listener_v3_ListenerFilter_msginit;
+extern const upb_msglayout envoy_config_listener_v3_UdpListenerConfig_msginit;
+extern const upb_msglayout google_protobuf_BoolValue_msginit;
+extern const upb_msglayout google_protobuf_Duration_msginit;
+extern const upb_msglayout google_protobuf_UInt32Value_msginit;
+extern const upb_msglayout udpa_core_v1_CollectionEntry_msginit;
+
+typedef enum {
+ envoy_config_listener_v3_Listener_DEFAULT = 0,
+ envoy_config_listener_v3_Listener_MODIFY_ONLY = 1
+} envoy_config_listener_v3_Listener_DrainType;
+
+
+/* envoy.config.listener.v3.ListenerCollection */
+
+UPB_INLINE envoy_config_listener_v3_ListenerCollection *envoy_config_listener_v3_ListenerCollection_new(upb_arena *arena) {
+ return (envoy_config_listener_v3_ListenerCollection *)_upb_msg_new(&envoy_config_listener_v3_ListenerCollection_msginit, arena);
+}
+UPB_INLINE envoy_config_listener_v3_ListenerCollection *envoy_config_listener_v3_ListenerCollection_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_listener_v3_ListenerCollection *ret = envoy_config_listener_v3_ListenerCollection_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_listener_v3_ListenerCollection_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_listener_v3_ListenerCollection_serialize(const envoy_config_listener_v3_ListenerCollection *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_listener_v3_ListenerCollection_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_listener_v3_ListenerCollection_has_entries(const envoy_config_listener_v3_ListenerCollection *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE const struct udpa_core_v1_CollectionEntry* const* envoy_config_listener_v3_ListenerCollection_entries(const envoy_config_listener_v3_ListenerCollection *msg, size_t *len) { return (const struct udpa_core_v1_CollectionEntry* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
+
+UPB_INLINE struct udpa_core_v1_CollectionEntry** envoy_config_listener_v3_ListenerCollection_mutable_entries(envoy_config_listener_v3_ListenerCollection *msg, size_t *len) {
+ return (struct udpa_core_v1_CollectionEntry**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
+}
+UPB_INLINE struct udpa_core_v1_CollectionEntry** envoy_config_listener_v3_ListenerCollection_resize_entries(envoy_config_listener_v3_ListenerCollection *msg, size_t len, upb_arena *arena) {
+ return (struct udpa_core_v1_CollectionEntry**)_upb_array_resize_accessor(msg, UPB_SIZE(0, 0), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct udpa_core_v1_CollectionEntry* envoy_config_listener_v3_ListenerCollection_add_entries(envoy_config_listener_v3_ListenerCollection *msg, upb_arena *arena) {
+ struct udpa_core_v1_CollectionEntry* sub = (struct udpa_core_v1_CollectionEntry*)_upb_msg_new(&udpa_core_v1_CollectionEntry_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(0, 0), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+
+/* envoy.config.listener.v3.Listener */
+
+UPB_INLINE envoy_config_listener_v3_Listener *envoy_config_listener_v3_Listener_new(upb_arena *arena) {
+ return (envoy_config_listener_v3_Listener *)_upb_msg_new(&envoy_config_listener_v3_Listener_msginit, arena);
+}
+UPB_INLINE envoy_config_listener_v3_Listener *envoy_config_listener_v3_Listener_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_listener_v3_Listener *ret = envoy_config_listener_v3_Listener_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_listener_v3_Listener_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_listener_v3_Listener_serialize(const envoy_config_listener_v3_Listener *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_listener_v3_Listener_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview envoy_config_listener_v3_Listener_name(const envoy_config_listener_v3_Listener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 24), upb_strview); }
+UPB_INLINE bool envoy_config_listener_v3_Listener_has_address(const envoy_config_listener_v3_Listener *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 40)); }
+UPB_INLINE const struct envoy_config_core_v3_Address* envoy_config_listener_v3_Listener_address(const envoy_config_listener_v3_Listener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 40), const struct envoy_config_core_v3_Address*); }
+UPB_INLINE bool envoy_config_listener_v3_Listener_has_filter_chains(const envoy_config_listener_v3_Listener *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(80, 144)); }
+UPB_INLINE const struct envoy_config_listener_v3_FilterChain* const* envoy_config_listener_v3_Listener_filter_chains(const envoy_config_listener_v3_Listener *msg, size_t *len) { return (const struct envoy_config_listener_v3_FilterChain* const*)_upb_array_accessor(msg, UPB_SIZE(80, 144), len); }
+UPB_INLINE bool envoy_config_listener_v3_Listener_has_per_connection_buffer_limit_bytes(const envoy_config_listener_v3_Listener *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(32, 48)); }
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_listener_v3_Listener_per_connection_buffer_limit_bytes(const envoy_config_listener_v3_Listener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 48), const struct google_protobuf_UInt32Value*); }
+UPB_INLINE bool envoy_config_listener_v3_Listener_has_metadata(const envoy_config_listener_v3_Listener *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(36, 56)); }
+UPB_INLINE const struct envoy_config_core_v3_Metadata* envoy_config_listener_v3_Listener_metadata(const envoy_config_listener_v3_Listener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(36, 56), const struct envoy_config_core_v3_Metadata*); }
+UPB_INLINE bool envoy_config_listener_v3_Listener_has_deprecated_v1(const envoy_config_listener_v3_Listener *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(40, 64)); }
+UPB_INLINE const envoy_config_listener_v3_Listener_DeprecatedV1* envoy_config_listener_v3_Listener_deprecated_v1(const envoy_config_listener_v3_Listener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(40, 64), const envoy_config_listener_v3_Listener_DeprecatedV1*); }
+UPB_INLINE int32_t envoy_config_listener_v3_Listener_drain_type(const envoy_config_listener_v3_Listener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
+UPB_INLINE bool envoy_config_listener_v3_Listener_has_listener_filters(const envoy_config_listener_v3_Listener *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(84, 152)); }
+UPB_INLINE const struct envoy_config_listener_v3_ListenerFilter* const* envoy_config_listener_v3_Listener_listener_filters(const envoy_config_listener_v3_Listener *msg, size_t *len) { return (const struct envoy_config_listener_v3_ListenerFilter* const*)_upb_array_accessor(msg, UPB_SIZE(84, 152), len); }
+UPB_INLINE bool envoy_config_listener_v3_Listener_has_transparent(const envoy_config_listener_v3_Listener *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(44, 72)); }
+UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_listener_v3_Listener_transparent(const envoy_config_listener_v3_Listener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(44, 72), const struct google_protobuf_BoolValue*); }
+UPB_INLINE bool envoy_config_listener_v3_Listener_has_freebind(const envoy_config_listener_v3_Listener *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(48, 80)); }
+UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_listener_v3_Listener_freebind(const envoy_config_listener_v3_Listener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(48, 80), const struct google_protobuf_BoolValue*); }
+UPB_INLINE bool envoy_config_listener_v3_Listener_has_tcp_fast_open_queue_length(const envoy_config_listener_v3_Listener *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(52, 88)); }
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_listener_v3_Listener_tcp_fast_open_queue_length(const envoy_config_listener_v3_Listener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(52, 88), const struct google_protobuf_UInt32Value*); }
+UPB_INLINE bool envoy_config_listener_v3_Listener_has_socket_options(const envoy_config_listener_v3_Listener *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(88, 160)); }
+UPB_INLINE const struct envoy_config_core_v3_SocketOption* const* envoy_config_listener_v3_Listener_socket_options(const envoy_config_listener_v3_Listener *msg, size_t *len) { return (const struct envoy_config_core_v3_SocketOption* const*)_upb_array_accessor(msg, UPB_SIZE(88, 160), len); }
+UPB_INLINE bool envoy_config_listener_v3_Listener_has_listener_filters_timeout(const envoy_config_listener_v3_Listener *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(56, 96)); }
+UPB_INLINE const struct google_protobuf_Duration* envoy_config_listener_v3_Listener_listener_filters_timeout(const envoy_config_listener_v3_Listener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(56, 96), const struct google_protobuf_Duration*); }
+UPB_INLINE int32_t envoy_config_listener_v3_Listener_traffic_direction(const envoy_config_listener_v3_Listener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); }
+UPB_INLINE bool envoy_config_listener_v3_Listener_continue_on_listener_filters_timeout(const envoy_config_listener_v3_Listener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), bool); }
+UPB_INLINE bool envoy_config_listener_v3_Listener_has_udp_listener_config(const envoy_config_listener_v3_Listener *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(60, 104)); }
+UPB_INLINE const struct envoy_config_listener_v3_UdpListenerConfig* envoy_config_listener_v3_Listener_udp_listener_config(const envoy_config_listener_v3_Listener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(60, 104), const struct envoy_config_listener_v3_UdpListenerConfig*); }
+UPB_INLINE bool envoy_config_listener_v3_Listener_has_api_listener(const envoy_config_listener_v3_Listener *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(64, 112)); }
+UPB_INLINE const struct envoy_config_listener_v3_ApiListener* envoy_config_listener_v3_Listener_api_listener(const envoy_config_listener_v3_Listener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(64, 112), const struct envoy_config_listener_v3_ApiListener*); }
+UPB_INLINE bool envoy_config_listener_v3_Listener_has_connection_balance_config(const envoy_config_listener_v3_Listener *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(68, 120)); }
+UPB_INLINE const envoy_config_listener_v3_Listener_ConnectionBalanceConfig* envoy_config_listener_v3_Listener_connection_balance_config(const envoy_config_listener_v3_Listener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(68, 120), const envoy_config_listener_v3_Listener_ConnectionBalanceConfig*); }
+UPB_INLINE bool envoy_config_listener_v3_Listener_reuse_port(const envoy_config_listener_v3_Listener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(17, 17), bool); }
+UPB_INLINE bool envoy_config_listener_v3_Listener_has_access_log(const envoy_config_listener_v3_Listener *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(92, 168)); }
+UPB_INLINE const struct envoy_config_accesslog_v3_AccessLog* const* envoy_config_listener_v3_Listener_access_log(const envoy_config_listener_v3_Listener *msg, size_t *len) { return (const struct envoy_config_accesslog_v3_AccessLog* const*)_upb_array_accessor(msg, UPB_SIZE(92, 168), len); }
+UPB_INLINE bool envoy_config_listener_v3_Listener_has_udp_writer_config(const envoy_config_listener_v3_Listener *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(72, 128)); }
+UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_listener_v3_Listener_udp_writer_config(const envoy_config_listener_v3_Listener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(72, 128), const struct envoy_config_core_v3_TypedExtensionConfig*); }
+UPB_INLINE bool envoy_config_listener_v3_Listener_has_tcp_backlog_size(const envoy_config_listener_v3_Listener *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(76, 136)); }
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_listener_v3_Listener_tcp_backlog_size(const envoy_config_listener_v3_Listener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(76, 136), const struct google_protobuf_UInt32Value*); }
+
+UPB_INLINE void envoy_config_listener_v3_Listener_set_name(envoy_config_listener_v3_Listener *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 24), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_listener_v3_Listener_set_address(envoy_config_listener_v3_Listener *msg, struct envoy_config_core_v3_Address* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 40), struct envoy_config_core_v3_Address*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_Address* envoy_config_listener_v3_Listener_mutable_address(envoy_config_listener_v3_Listener *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_Address* sub = (struct envoy_config_core_v3_Address*)envoy_config_listener_v3_Listener_address(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_Address*)_upb_msg_new(&envoy_config_core_v3_Address_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_listener_v3_Listener_set_address(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE struct envoy_config_listener_v3_FilterChain** envoy_config_listener_v3_Listener_mutable_filter_chains(envoy_config_listener_v3_Listener *msg, size_t *len) {
+ return (struct envoy_config_listener_v3_FilterChain**)_upb_array_mutable_accessor(msg, UPB_SIZE(80, 144), len);
+}
+UPB_INLINE struct envoy_config_listener_v3_FilterChain** envoy_config_listener_v3_Listener_resize_filter_chains(envoy_config_listener_v3_Listener *msg, size_t len, upb_arena *arena) {
+ return (struct envoy_config_listener_v3_FilterChain**)_upb_array_resize_accessor(msg, UPB_SIZE(80, 144), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_config_listener_v3_FilterChain* envoy_config_listener_v3_Listener_add_filter_chains(envoy_config_listener_v3_Listener *msg, upb_arena *arena) {
+ struct envoy_config_listener_v3_FilterChain* sub = (struct envoy_config_listener_v3_FilterChain*)_upb_msg_new(&envoy_config_listener_v3_FilterChain_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(80, 144), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE void envoy_config_listener_v3_Listener_set_per_connection_buffer_limit_bytes(envoy_config_listener_v3_Listener *msg, struct google_protobuf_UInt32Value* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 48), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_listener_v3_Listener_mutable_per_connection_buffer_limit_bytes(envoy_config_listener_v3_Listener *msg, upb_arena *arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_listener_v3_Listener_per_connection_buffer_limit_bytes(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_listener_v3_Listener_set_per_connection_buffer_limit_bytes(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_listener_v3_Listener_set_metadata(envoy_config_listener_v3_Listener *msg, struct envoy_config_core_v3_Metadata* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(36, 56), struct envoy_config_core_v3_Metadata*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_Metadata* envoy_config_listener_v3_Listener_mutable_metadata(envoy_config_listener_v3_Listener *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_Metadata* sub = (struct envoy_config_core_v3_Metadata*)envoy_config_listener_v3_Listener_metadata(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_Metadata*)_upb_msg_new(&envoy_config_core_v3_Metadata_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_listener_v3_Listener_set_metadata(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_listener_v3_Listener_set_deprecated_v1(envoy_config_listener_v3_Listener *msg, envoy_config_listener_v3_Listener_DeprecatedV1* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 64), envoy_config_listener_v3_Listener_DeprecatedV1*) = value;
+}
+UPB_INLINE struct envoy_config_listener_v3_Listener_DeprecatedV1* envoy_config_listener_v3_Listener_mutable_deprecated_v1(envoy_config_listener_v3_Listener *msg, upb_arena *arena) {
+ struct envoy_config_listener_v3_Listener_DeprecatedV1* sub = (struct envoy_config_listener_v3_Listener_DeprecatedV1*)envoy_config_listener_v3_Listener_deprecated_v1(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_listener_v3_Listener_DeprecatedV1*)_upb_msg_new(&envoy_config_listener_v3_Listener_DeprecatedV1_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_listener_v3_Listener_set_deprecated_v1(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_listener_v3_Listener_set_drain_type(envoy_config_listener_v3_Listener *msg, int32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
+}
+UPB_INLINE struct envoy_config_listener_v3_ListenerFilter** envoy_config_listener_v3_Listener_mutable_listener_filters(envoy_config_listener_v3_Listener *msg, size_t *len) {
+ return (struct envoy_config_listener_v3_ListenerFilter**)_upb_array_mutable_accessor(msg, UPB_SIZE(84, 152), len);
+}
+UPB_INLINE struct envoy_config_listener_v3_ListenerFilter** envoy_config_listener_v3_Listener_resize_listener_filters(envoy_config_listener_v3_Listener *msg, size_t len, upb_arena *arena) {
+ return (struct envoy_config_listener_v3_ListenerFilter**)_upb_array_resize_accessor(msg, UPB_SIZE(84, 152), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_config_listener_v3_ListenerFilter* envoy_config_listener_v3_Listener_add_listener_filters(envoy_config_listener_v3_Listener *msg, upb_arena *arena) {
+ struct envoy_config_listener_v3_ListenerFilter* sub = (struct envoy_config_listener_v3_ListenerFilter*)_upb_msg_new(&envoy_config_listener_v3_ListenerFilter_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(84, 152), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE void envoy_config_listener_v3_Listener_set_transparent(envoy_config_listener_v3_Listener *msg, struct google_protobuf_BoolValue* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(44, 72), struct google_protobuf_BoolValue*) = value;
+}
+UPB_INLINE struct google_protobuf_BoolValue* envoy_config_listener_v3_Listener_mutable_transparent(envoy_config_listener_v3_Listener *msg, upb_arena *arena) {
+ struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_listener_v3_Listener_transparent(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_BoolValue*)_upb_msg_new(&google_protobuf_BoolValue_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_listener_v3_Listener_set_transparent(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_listener_v3_Listener_set_freebind(envoy_config_listener_v3_Listener *msg, struct google_protobuf_BoolValue* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(48, 80), struct google_protobuf_BoolValue*) = value;
+}
+UPB_INLINE struct google_protobuf_BoolValue* envoy_config_listener_v3_Listener_mutable_freebind(envoy_config_listener_v3_Listener *msg, upb_arena *arena) {
+ struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_listener_v3_Listener_freebind(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_BoolValue*)_upb_msg_new(&google_protobuf_BoolValue_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_listener_v3_Listener_set_freebind(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_listener_v3_Listener_set_tcp_fast_open_queue_length(envoy_config_listener_v3_Listener *msg, struct google_protobuf_UInt32Value* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(52, 88), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_listener_v3_Listener_mutable_tcp_fast_open_queue_length(envoy_config_listener_v3_Listener *msg, upb_arena *arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_listener_v3_Listener_tcp_fast_open_queue_length(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_listener_v3_Listener_set_tcp_fast_open_queue_length(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE struct envoy_config_core_v3_SocketOption** envoy_config_listener_v3_Listener_mutable_socket_options(envoy_config_listener_v3_Listener *msg, size_t *len) {
+ return (struct envoy_config_core_v3_SocketOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(88, 160), len);
+}
+UPB_INLINE struct envoy_config_core_v3_SocketOption** envoy_config_listener_v3_Listener_resize_socket_options(envoy_config_listener_v3_Listener *msg, size_t len, upb_arena *arena) {
+ return (struct envoy_config_core_v3_SocketOption**)_upb_array_resize_accessor(msg, UPB_SIZE(88, 160), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_config_core_v3_SocketOption* envoy_config_listener_v3_Listener_add_socket_options(envoy_config_listener_v3_Listener *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_SocketOption* sub = (struct envoy_config_core_v3_SocketOption*)_upb_msg_new(&envoy_config_core_v3_SocketOption_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(88, 160), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE void envoy_config_listener_v3_Listener_set_listener_filters_timeout(envoy_config_listener_v3_Listener *msg, struct google_protobuf_Duration* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(56, 96), struct google_protobuf_Duration*) = value;
+}
+UPB_INLINE struct google_protobuf_Duration* envoy_config_listener_v3_Listener_mutable_listener_filters_timeout(envoy_config_listener_v3_Listener *msg, upb_arena *arena) {
+ struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_listener_v3_Listener_listener_filters_timeout(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_listener_v3_Listener_set_listener_filters_timeout(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_listener_v3_Listener_set_traffic_direction(envoy_config_listener_v3_Listener *msg, int32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
+}
+UPB_INLINE void envoy_config_listener_v3_Listener_set_continue_on_listener_filters_timeout(envoy_config_listener_v3_Listener *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 16), bool) = value;
+}
+UPB_INLINE void envoy_config_listener_v3_Listener_set_udp_listener_config(envoy_config_listener_v3_Listener *msg, struct envoy_config_listener_v3_UdpListenerConfig* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(60, 104), struct envoy_config_listener_v3_UdpListenerConfig*) = value;
+}
+UPB_INLINE struct envoy_config_listener_v3_UdpListenerConfig* envoy_config_listener_v3_Listener_mutable_udp_listener_config(envoy_config_listener_v3_Listener *msg, upb_arena *arena) {
+ struct envoy_config_listener_v3_UdpListenerConfig* sub = (struct envoy_config_listener_v3_UdpListenerConfig*)envoy_config_listener_v3_Listener_udp_listener_config(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_listener_v3_UdpListenerConfig*)_upb_msg_new(&envoy_config_listener_v3_UdpListenerConfig_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_listener_v3_Listener_set_udp_listener_config(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_listener_v3_Listener_set_api_listener(envoy_config_listener_v3_Listener *msg, struct envoy_config_listener_v3_ApiListener* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(64, 112), struct envoy_config_listener_v3_ApiListener*) = value;
+}
+UPB_INLINE struct envoy_config_listener_v3_ApiListener* envoy_config_listener_v3_Listener_mutable_api_listener(envoy_config_listener_v3_Listener *msg, upb_arena *arena) {
+ struct envoy_config_listener_v3_ApiListener* sub = (struct envoy_config_listener_v3_ApiListener*)envoy_config_listener_v3_Listener_api_listener(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_listener_v3_ApiListener*)_upb_msg_new(&envoy_config_listener_v3_ApiListener_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_listener_v3_Listener_set_api_listener(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_listener_v3_Listener_set_connection_balance_config(envoy_config_listener_v3_Listener *msg, envoy_config_listener_v3_Listener_ConnectionBalanceConfig* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(68, 120), envoy_config_listener_v3_Listener_ConnectionBalanceConfig*) = value;
+}
+UPB_INLINE struct envoy_config_listener_v3_Listener_ConnectionBalanceConfig* envoy_config_listener_v3_Listener_mutable_connection_balance_config(envoy_config_listener_v3_Listener *msg, upb_arena *arena) {
+ struct envoy_config_listener_v3_Listener_ConnectionBalanceConfig* sub = (struct envoy_config_listener_v3_Listener_ConnectionBalanceConfig*)envoy_config_listener_v3_Listener_connection_balance_config(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_listener_v3_Listener_ConnectionBalanceConfig*)_upb_msg_new(&envoy_config_listener_v3_Listener_ConnectionBalanceConfig_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_listener_v3_Listener_set_connection_balance_config(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_listener_v3_Listener_set_reuse_port(envoy_config_listener_v3_Listener *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(17, 17), bool) = value;
+}
+UPB_INLINE struct envoy_config_accesslog_v3_AccessLog** envoy_config_listener_v3_Listener_mutable_access_log(envoy_config_listener_v3_Listener *msg, size_t *len) {
+ return (struct envoy_config_accesslog_v3_AccessLog**)_upb_array_mutable_accessor(msg, UPB_SIZE(92, 168), len);
+}
+UPB_INLINE struct envoy_config_accesslog_v3_AccessLog** envoy_config_listener_v3_Listener_resize_access_log(envoy_config_listener_v3_Listener *msg, size_t len, upb_arena *arena) {
+ return (struct envoy_config_accesslog_v3_AccessLog**)_upb_array_resize_accessor(msg, UPB_SIZE(92, 168), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_config_accesslog_v3_AccessLog* envoy_config_listener_v3_Listener_add_access_log(envoy_config_listener_v3_Listener *msg, upb_arena *arena) {
+ struct envoy_config_accesslog_v3_AccessLog* sub = (struct envoy_config_accesslog_v3_AccessLog*)_upb_msg_new(&envoy_config_accesslog_v3_AccessLog_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(92, 168), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE void envoy_config_listener_v3_Listener_set_udp_writer_config(envoy_config_listener_v3_Listener *msg, struct envoy_config_core_v3_TypedExtensionConfig* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(72, 128), struct envoy_config_core_v3_TypedExtensionConfig*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_listener_v3_Listener_mutable_udp_writer_config(envoy_config_listener_v3_Listener *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)envoy_config_listener_v3_Listener_udp_writer_config(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_msg_new(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_listener_v3_Listener_set_udp_writer_config(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_listener_v3_Listener_set_tcp_backlog_size(envoy_config_listener_v3_Listener *msg, struct google_protobuf_UInt32Value* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(76, 136), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_listener_v3_Listener_mutable_tcp_backlog_size(envoy_config_listener_v3_Listener *msg, upb_arena *arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_listener_v3_Listener_tcp_backlog_size(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_listener_v3_Listener_set_tcp_backlog_size(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.listener.v3.Listener.DeprecatedV1 */
+
+UPB_INLINE envoy_config_listener_v3_Listener_DeprecatedV1 *envoy_config_listener_v3_Listener_DeprecatedV1_new(upb_arena *arena) {
+ return (envoy_config_listener_v3_Listener_DeprecatedV1 *)_upb_msg_new(&envoy_config_listener_v3_Listener_DeprecatedV1_msginit, arena);
+}
+UPB_INLINE envoy_config_listener_v3_Listener_DeprecatedV1 *envoy_config_listener_v3_Listener_DeprecatedV1_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_listener_v3_Listener_DeprecatedV1 *ret = envoy_config_listener_v3_Listener_DeprecatedV1_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_listener_v3_Listener_DeprecatedV1_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_listener_v3_Listener_DeprecatedV1_serialize(const envoy_config_listener_v3_Listener_DeprecatedV1 *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_listener_v3_Listener_DeprecatedV1_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_listener_v3_Listener_DeprecatedV1_has_bind_to_port(const envoy_config_listener_v3_Listener_DeprecatedV1 *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_listener_v3_Listener_DeprecatedV1_bind_to_port(const envoy_config_listener_v3_Listener_DeprecatedV1 *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct google_protobuf_BoolValue*); }
+
+UPB_INLINE void envoy_config_listener_v3_Listener_DeprecatedV1_set_bind_to_port(envoy_config_listener_v3_Listener_DeprecatedV1 *msg, struct google_protobuf_BoolValue* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct google_protobuf_BoolValue*) = value;
+}
+UPB_INLINE struct google_protobuf_BoolValue* envoy_config_listener_v3_Listener_DeprecatedV1_mutable_bind_to_port(envoy_config_listener_v3_Listener_DeprecatedV1 *msg, upb_arena *arena) {
+ struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_listener_v3_Listener_DeprecatedV1_bind_to_port(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_BoolValue*)_upb_msg_new(&google_protobuf_BoolValue_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_listener_v3_Listener_DeprecatedV1_set_bind_to_port(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.listener.v3.Listener.ConnectionBalanceConfig */
+
+UPB_INLINE envoy_config_listener_v3_Listener_ConnectionBalanceConfig *envoy_config_listener_v3_Listener_ConnectionBalanceConfig_new(upb_arena *arena) {
+ return (envoy_config_listener_v3_Listener_ConnectionBalanceConfig *)_upb_msg_new(&envoy_config_listener_v3_Listener_ConnectionBalanceConfig_msginit, arena);
+}
+UPB_INLINE envoy_config_listener_v3_Listener_ConnectionBalanceConfig *envoy_config_listener_v3_Listener_ConnectionBalanceConfig_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_listener_v3_Listener_ConnectionBalanceConfig *ret = envoy_config_listener_v3_Listener_ConnectionBalanceConfig_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_listener_v3_Listener_ConnectionBalanceConfig_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_listener_v3_Listener_ConnectionBalanceConfig_serialize(const envoy_config_listener_v3_Listener_ConnectionBalanceConfig *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_listener_v3_Listener_ConnectionBalanceConfig_msginit, arena, len);
+}
+
+typedef enum {
+ envoy_config_listener_v3_Listener_ConnectionBalanceConfig_balance_type_exact_balance = 1,
+ envoy_config_listener_v3_Listener_ConnectionBalanceConfig_balance_type_NOT_SET = 0
+} envoy_config_listener_v3_Listener_ConnectionBalanceConfig_balance_type_oneofcases;
+UPB_INLINE envoy_config_listener_v3_Listener_ConnectionBalanceConfig_balance_type_oneofcases envoy_config_listener_v3_Listener_ConnectionBalanceConfig_balance_type_case(const envoy_config_listener_v3_Listener_ConnectionBalanceConfig* msg) { return (envoy_config_listener_v3_Listener_ConnectionBalanceConfig_balance_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 8), int32_t); }
+
+UPB_INLINE bool envoy_config_listener_v3_Listener_ConnectionBalanceConfig_has_exact_balance(const envoy_config_listener_v3_Listener_ConnectionBalanceConfig *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 1; }
+UPB_INLINE const envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance* envoy_config_listener_v3_Listener_ConnectionBalanceConfig_exact_balance(const envoy_config_listener_v3_Listener_ConnectionBalanceConfig *msg) { return UPB_READ_ONEOF(msg, const envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 1, NULL); }
+
+UPB_INLINE void envoy_config_listener_v3_Listener_ConnectionBalanceConfig_set_exact_balance(envoy_config_listener_v3_Listener_ConnectionBalanceConfig *msg, envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 1);
+}
+UPB_INLINE struct envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance* envoy_config_listener_v3_Listener_ConnectionBalanceConfig_mutable_exact_balance(envoy_config_listener_v3_Listener_ConnectionBalanceConfig *msg, upb_arena *arena) {
+ struct envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance* sub = (struct envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance*)envoy_config_listener_v3_Listener_ConnectionBalanceConfig_exact_balance(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance*)_upb_msg_new(&envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_listener_v3_Listener_ConnectionBalanceConfig_set_exact_balance(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.listener.v3.Listener.ConnectionBalanceConfig.ExactBalance */
+
+UPB_INLINE envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance *envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance_new(upb_arena *arena) {
+ return (envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance *)_upb_msg_new(&envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance_msginit, arena);
+}
+UPB_INLINE envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance *envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance *ret = envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance_serialize(const envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance_msginit, arena, len);
+}
+
+
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_CONFIG_LISTENER_V3_LISTENER_PROTO_UPB_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.c
index 182aa68bc7a..c303dabab3f 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.c
@@ -1,155 +1,155 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/config/listener/v3/listener_components.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include <stddef.h>
-#include "upb/msg.h"
-#include "envoy/config/listener/v3/listener_components.upb.h"
-#include "envoy/config/core/v3/address.upb.h"
-#include "envoy/config/core/v3/base.upb.h"
-#include "envoy/type/v3/range.upb.h"
-#include "google/protobuf/any.upb.h"
-#include "google/protobuf/duration.upb.h"
-#include "google/protobuf/struct.upb.h"
-#include "google/protobuf/wrappers.upb.h"
-#include "udpa/annotations/status.upb.h"
-#include "udpa/annotations/versioning.upb.h"
-#include "validate/validate.upb.h"
-
-#include "upb/port_def.inc"
-
-static const upb_msglayout *const envoy_config_listener_v3_Filter_submsgs[1] = {
- &google_protobuf_Any_msginit,
-};
-
-static const upb_msglayout_field envoy_config_listener_v3_Filter__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {4, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, 1},
-};
-
-const upb_msglayout envoy_config_listener_v3_Filter_msginit = {
- &envoy_config_listener_v3_Filter_submsgs[0],
- &envoy_config_listener_v3_Filter__fields[0],
- UPB_SIZE(16, 32), 2, false,
-};
-
-static const upb_msglayout *const envoy_config_listener_v3_FilterChainMatch_submsgs[4] = {
- &envoy_config_core_v3_CidrRange_msginit,
- &google_protobuf_UInt32Value_msginit,
-};
-
-static const upb_msglayout_field envoy_config_listener_v3_FilterChainMatch__fields[10] = {
- {3, UPB_SIZE(32, 56), 0, 0, 11, 3},
- {4, UPB_SIZE(8, 8), 0, 0, 9, 1},
- {5, UPB_SIZE(24, 40), 0, 1, 11, 1},
- {6, UPB_SIZE(36, 64), 0, 0, 11, 3},
- {7, UPB_SIZE(40, 72), 0, 0, 13, _UPB_LABEL_PACKED},
- {8, UPB_SIZE(28, 48), 0, 1, 11, 1},
- {9, UPB_SIZE(16, 24), 0, 0, 9, 1},
- {10, UPB_SIZE(44, 80), 0, 0, 9, 3},
- {11, UPB_SIZE(48, 88), 0, 0, 9, 3},
- {12, UPB_SIZE(0, 0), 0, 0, 14, 1},
-};
-
-const upb_msglayout envoy_config_listener_v3_FilterChainMatch_msginit = {
- &envoy_config_listener_v3_FilterChainMatch_submsgs[0],
- &envoy_config_listener_v3_FilterChainMatch__fields[0],
- UPB_SIZE(56, 96), 10, false,
-};
-
-static const upb_msglayout *const envoy_config_listener_v3_FilterChain_submsgs[6] = {
- &envoy_config_core_v3_Metadata_msginit,
- &envoy_config_core_v3_TransportSocket_msginit,
- &envoy_config_listener_v3_Filter_msginit,
- &envoy_config_listener_v3_FilterChain_OnDemandConfiguration_msginit,
- &envoy_config_listener_v3_FilterChainMatch_msginit,
- &google_protobuf_BoolValue_msginit,
-};
-
-static const upb_msglayout_field envoy_config_listener_v3_FilterChain__fields[7] = {
- {1, UPB_SIZE(8, 16), 0, 4, 11, 1},
- {3, UPB_SIZE(28, 56), 0, 2, 11, 3},
- {4, UPB_SIZE(12, 24), 0, 5, 11, 1},
- {5, UPB_SIZE(16, 32), 0, 0, 11, 1},
- {6, UPB_SIZE(20, 40), 0, 1, 11, 1},
- {7, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {8, UPB_SIZE(24, 48), 0, 3, 11, 1},
-};
-
-const upb_msglayout envoy_config_listener_v3_FilterChain_msginit = {
- &envoy_config_listener_v3_FilterChain_submsgs[0],
- &envoy_config_listener_v3_FilterChain__fields[0],
- UPB_SIZE(32, 64), 7, false,
-};
-
-static const upb_msglayout *const envoy_config_listener_v3_FilterChain_OnDemandConfiguration_submsgs[1] = {
- &google_protobuf_Duration_msginit,
-};
-
-static const upb_msglayout_field envoy_config_listener_v3_FilterChain_OnDemandConfiguration__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
-};
-
-const upb_msglayout envoy_config_listener_v3_FilterChain_OnDemandConfiguration_msginit = {
- &envoy_config_listener_v3_FilterChain_OnDemandConfiguration_submsgs[0],
- &envoy_config_listener_v3_FilterChain_OnDemandConfiguration__fields[0],
- UPB_SIZE(4, 8), 1, false,
-};
-
-static const upb_msglayout *const envoy_config_listener_v3_ListenerFilterChainMatchPredicate_submsgs[4] = {
- &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_msginit,
- &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_msginit,
- &envoy_type_v3_Int32Range_msginit,
-};
-
-static const upb_msglayout_field envoy_config_listener_v3_ListenerFilterChainMatchPredicate__fields[5] = {
- {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 1, 11, 1},
- {2, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 1, 11, 1},
- {3, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, 1},
- {4, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 8, 1},
- {5, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 2, 11, 1},
-};
-
-const upb_msglayout envoy_config_listener_v3_ListenerFilterChainMatchPredicate_msginit = {
- &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_submsgs[0],
- &envoy_config_listener_v3_ListenerFilterChainMatchPredicate__fields[0],
- UPB_SIZE(8, 16), 5, false,
-};
-
-static const upb_msglayout *const envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_submsgs[1] = {
- &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_msginit,
-};
-
-static const upb_msglayout_field envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 3},
-};
-
-const upb_msglayout envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_msginit = {
- &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_submsgs[0],
- &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet__fields[0],
- UPB_SIZE(4, 8), 1, false,
-};
-
-static const upb_msglayout *const envoy_config_listener_v3_ListenerFilter_submsgs[2] = {
- &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_msginit,
- &google_protobuf_Any_msginit,
-};
-
-static const upb_msglayout_field envoy_config_listener_v3_ListenerFilter__fields[3] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {3, UPB_SIZE(12, 24), UPB_SIZE(-17, -33), 1, 11, 1},
- {4, UPB_SIZE(8, 16), 0, 0, 11, 1},
-};
-
-const upb_msglayout envoy_config_listener_v3_ListenerFilter_msginit = {
- &envoy_config_listener_v3_ListenerFilter_submsgs[0],
- &envoy_config_listener_v3_ListenerFilter__fields[0],
- UPB_SIZE(24, 48), 3, false,
-};
-
-#include "upb/port_undef.inc"
-
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/listener/v3/listener_components.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg.h"
+#include "envoy/config/listener/v3/listener_components.upb.h"
+#include "envoy/config/core/v3/address.upb.h"
+#include "envoy/config/core/v3/base.upb.h"
+#include "envoy/type/v3/range.upb.h"
+#include "google/protobuf/any.upb.h"
+#include "google/protobuf/duration.upb.h"
+#include "google/protobuf/struct.upb.h"
+#include "google/protobuf/wrappers.upb.h"
+#include "udpa/annotations/status.upb.h"
+#include "udpa/annotations/versioning.upb.h"
+#include "validate/validate.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_msglayout *const envoy_config_listener_v3_Filter_submsgs[1] = {
+ &google_protobuf_Any_msginit,
+};
+
+static const upb_msglayout_field envoy_config_listener_v3_Filter__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {4, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, 1},
+};
+
+const upb_msglayout envoy_config_listener_v3_Filter_msginit = {
+ &envoy_config_listener_v3_Filter_submsgs[0],
+ &envoy_config_listener_v3_Filter__fields[0],
+ UPB_SIZE(16, 32), 2, false,
+};
+
+static const upb_msglayout *const envoy_config_listener_v3_FilterChainMatch_submsgs[4] = {
+ &envoy_config_core_v3_CidrRange_msginit,
+ &google_protobuf_UInt32Value_msginit,
+};
+
+static const upb_msglayout_field envoy_config_listener_v3_FilterChainMatch__fields[10] = {
+ {3, UPB_SIZE(32, 56), 0, 0, 11, 3},
+ {4, UPB_SIZE(8, 8), 0, 0, 9, 1},
+ {5, UPB_SIZE(24, 40), 0, 1, 11, 1},
+ {6, UPB_SIZE(36, 64), 0, 0, 11, 3},
+ {7, UPB_SIZE(40, 72), 0, 0, 13, _UPB_LABEL_PACKED},
+ {8, UPB_SIZE(28, 48), 0, 1, 11, 1},
+ {9, UPB_SIZE(16, 24), 0, 0, 9, 1},
+ {10, UPB_SIZE(44, 80), 0, 0, 9, 3},
+ {11, UPB_SIZE(48, 88), 0, 0, 9, 3},
+ {12, UPB_SIZE(0, 0), 0, 0, 14, 1},
+};
+
+const upb_msglayout envoy_config_listener_v3_FilterChainMatch_msginit = {
+ &envoy_config_listener_v3_FilterChainMatch_submsgs[0],
+ &envoy_config_listener_v3_FilterChainMatch__fields[0],
+ UPB_SIZE(56, 96), 10, false,
+};
+
+static const upb_msglayout *const envoy_config_listener_v3_FilterChain_submsgs[6] = {
+ &envoy_config_core_v3_Metadata_msginit,
+ &envoy_config_core_v3_TransportSocket_msginit,
+ &envoy_config_listener_v3_Filter_msginit,
+ &envoy_config_listener_v3_FilterChain_OnDemandConfiguration_msginit,
+ &envoy_config_listener_v3_FilterChainMatch_msginit,
+ &google_protobuf_BoolValue_msginit,
+};
+
+static const upb_msglayout_field envoy_config_listener_v3_FilterChain__fields[7] = {
+ {1, UPB_SIZE(8, 16), 0, 4, 11, 1},
+ {3, UPB_SIZE(28, 56), 0, 2, 11, 3},
+ {4, UPB_SIZE(12, 24), 0, 5, 11, 1},
+ {5, UPB_SIZE(16, 32), 0, 0, 11, 1},
+ {6, UPB_SIZE(20, 40), 0, 1, 11, 1},
+ {7, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {8, UPB_SIZE(24, 48), 0, 3, 11, 1},
+};
+
+const upb_msglayout envoy_config_listener_v3_FilterChain_msginit = {
+ &envoy_config_listener_v3_FilterChain_submsgs[0],
+ &envoy_config_listener_v3_FilterChain__fields[0],
+ UPB_SIZE(32, 64), 7, false,
+};
+
+static const upb_msglayout *const envoy_config_listener_v3_FilterChain_OnDemandConfiguration_submsgs[1] = {
+ &google_protobuf_Duration_msginit,
+};
+
+static const upb_msglayout_field envoy_config_listener_v3_FilterChain_OnDemandConfiguration__fields[1] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
+};
+
+const upb_msglayout envoy_config_listener_v3_FilterChain_OnDemandConfiguration_msginit = {
+ &envoy_config_listener_v3_FilterChain_OnDemandConfiguration_submsgs[0],
+ &envoy_config_listener_v3_FilterChain_OnDemandConfiguration__fields[0],
+ UPB_SIZE(4, 8), 1, false,
+};
+
+static const upb_msglayout *const envoy_config_listener_v3_ListenerFilterChainMatchPredicate_submsgs[4] = {
+ &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_msginit,
+ &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_msginit,
+ &envoy_type_v3_Int32Range_msginit,
+};
+
+static const upb_msglayout_field envoy_config_listener_v3_ListenerFilterChainMatchPredicate__fields[5] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 1, 11, 1},
+ {2, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 1, 11, 1},
+ {3, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, 1},
+ {4, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 8, 1},
+ {5, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 2, 11, 1},
+};
+
+const upb_msglayout envoy_config_listener_v3_ListenerFilterChainMatchPredicate_msginit = {
+ &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_submsgs[0],
+ &envoy_config_listener_v3_ListenerFilterChainMatchPredicate__fields[0],
+ UPB_SIZE(8, 16), 5, false,
+};
+
+static const upb_msglayout *const envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_submsgs[1] = {
+ &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_msginit,
+};
+
+static const upb_msglayout_field envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet__fields[1] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 11, 3},
+};
+
+const upb_msglayout envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_msginit = {
+ &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_submsgs[0],
+ &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet__fields[0],
+ UPB_SIZE(4, 8), 1, false,
+};
+
+static const upb_msglayout *const envoy_config_listener_v3_ListenerFilter_submsgs[2] = {
+ &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_msginit,
+ &google_protobuf_Any_msginit,
+};
+
+static const upb_msglayout_field envoy_config_listener_v3_ListenerFilter__fields[3] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {3, UPB_SIZE(12, 24), UPB_SIZE(-17, -33), 1, 11, 1},
+ {4, UPB_SIZE(8, 16), 0, 0, 11, 1},
+};
+
+const upb_msglayout envoy_config_listener_v3_ListenerFilter_msginit = {
+ &envoy_config_listener_v3_ListenerFilter_submsgs[0],
+ &envoy_config_listener_v3_ListenerFilter__fields[0],
+ UPB_SIZE(24, 48), 3, false,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.h
index d0e58c76272..626f53c3192 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.h
@@ -1,539 +1,539 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/config/listener/v3/listener_components.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef ENVOY_CONFIG_LISTENER_V3_LISTENER_COMPONENTS_PROTO_UPB_H_
-#define ENVOY_CONFIG_LISTENER_V3_LISTENER_COMPONENTS_PROTO_UPB_H_
-
-#include "upb/msg.h"
-#include "upb/decode.h"
-#include "upb/encode.h"
-
-#include "upb/port_def.inc"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct envoy_config_listener_v3_Filter;
-struct envoy_config_listener_v3_FilterChainMatch;
-struct envoy_config_listener_v3_FilterChain;
-struct envoy_config_listener_v3_FilterChain_OnDemandConfiguration;
-struct envoy_config_listener_v3_ListenerFilterChainMatchPredicate;
-struct envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet;
-struct envoy_config_listener_v3_ListenerFilter;
-typedef struct envoy_config_listener_v3_Filter envoy_config_listener_v3_Filter;
-typedef struct envoy_config_listener_v3_FilterChainMatch envoy_config_listener_v3_FilterChainMatch;
-typedef struct envoy_config_listener_v3_FilterChain envoy_config_listener_v3_FilterChain;
-typedef struct envoy_config_listener_v3_FilterChain_OnDemandConfiguration envoy_config_listener_v3_FilterChain_OnDemandConfiguration;
-typedef struct envoy_config_listener_v3_ListenerFilterChainMatchPredicate envoy_config_listener_v3_ListenerFilterChainMatchPredicate;
-typedef struct envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet;
-typedef struct envoy_config_listener_v3_ListenerFilter envoy_config_listener_v3_ListenerFilter;
-extern const upb_msglayout envoy_config_listener_v3_Filter_msginit;
-extern const upb_msglayout envoy_config_listener_v3_FilterChainMatch_msginit;
-extern const upb_msglayout envoy_config_listener_v3_FilterChain_msginit;
-extern const upb_msglayout envoy_config_listener_v3_FilterChain_OnDemandConfiguration_msginit;
-extern const upb_msglayout envoy_config_listener_v3_ListenerFilterChainMatchPredicate_msginit;
-extern const upb_msglayout envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_msginit;
-extern const upb_msglayout envoy_config_listener_v3_ListenerFilter_msginit;
-struct envoy_config_core_v3_CidrRange;
-struct envoy_config_core_v3_Metadata;
-struct envoy_config_core_v3_TransportSocket;
-struct envoy_type_v3_Int32Range;
-struct google_protobuf_Any;
-struct google_protobuf_BoolValue;
-struct google_protobuf_Duration;
-struct google_protobuf_UInt32Value;
-extern const upb_msglayout envoy_config_core_v3_CidrRange_msginit;
-extern const upb_msglayout envoy_config_core_v3_Metadata_msginit;
-extern const upb_msglayout envoy_config_core_v3_TransportSocket_msginit;
-extern const upb_msglayout envoy_type_v3_Int32Range_msginit;
-extern const upb_msglayout google_protobuf_Any_msginit;
-extern const upb_msglayout google_protobuf_BoolValue_msginit;
-extern const upb_msglayout google_protobuf_Duration_msginit;
-extern const upb_msglayout google_protobuf_UInt32Value_msginit;
-
-typedef enum {
- envoy_config_listener_v3_FilterChainMatch_ANY = 0,
- envoy_config_listener_v3_FilterChainMatch_SAME_IP_OR_LOOPBACK = 1,
- envoy_config_listener_v3_FilterChainMatch_EXTERNAL = 2
-} envoy_config_listener_v3_FilterChainMatch_ConnectionSourceType;
-
-
-/* envoy.config.listener.v3.Filter */
-
-UPB_INLINE envoy_config_listener_v3_Filter *envoy_config_listener_v3_Filter_new(upb_arena *arena) {
- return (envoy_config_listener_v3_Filter *)_upb_msg_new(&envoy_config_listener_v3_Filter_msginit, arena);
-}
-UPB_INLINE envoy_config_listener_v3_Filter *envoy_config_listener_v3_Filter_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_listener_v3_Filter *ret = envoy_config_listener_v3_Filter_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_listener_v3_Filter_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_listener_v3_Filter_serialize(const envoy_config_listener_v3_Filter *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_listener_v3_Filter_msginit, arena, len);
-}
-
-typedef enum {
- envoy_config_listener_v3_Filter_config_type_typed_config = 4,
- envoy_config_listener_v3_Filter_config_type_NOT_SET = 0
-} envoy_config_listener_v3_Filter_config_type_oneofcases;
-UPB_INLINE envoy_config_listener_v3_Filter_config_type_oneofcases envoy_config_listener_v3_Filter_config_type_case(const envoy_config_listener_v3_Filter* msg) { return (envoy_config_listener_v3_Filter_config_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(12, 24), int32_t); }
-
-UPB_INLINE upb_strview envoy_config_listener_v3_Filter_name(const envoy_config_listener_v3_Filter *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE bool envoy_config_listener_v3_Filter_has_typed_config(const envoy_config_listener_v3_Filter *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 4; }
-UPB_INLINE const struct google_protobuf_Any* envoy_config_listener_v3_Filter_typed_config(const envoy_config_listener_v3_Filter *msg) { return UPB_READ_ONEOF(msg, const struct google_protobuf_Any*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 4, NULL); }
-
-UPB_INLINE void envoy_config_listener_v3_Filter_set_name(envoy_config_listener_v3_Filter *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_listener_v3_Filter_set_typed_config(envoy_config_listener_v3_Filter *msg, struct google_protobuf_Any* value) {
- UPB_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 4);
-}
-UPB_INLINE struct google_protobuf_Any* envoy_config_listener_v3_Filter_mutable_typed_config(envoy_config_listener_v3_Filter *msg, upb_arena *arena) {
- struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_config_listener_v3_Filter_typed_config(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena);
- if (!sub) return NULL;
- envoy_config_listener_v3_Filter_set_typed_config(msg, sub);
- }
- return sub;
-}
-
-/* envoy.config.listener.v3.FilterChainMatch */
-
-UPB_INLINE envoy_config_listener_v3_FilterChainMatch *envoy_config_listener_v3_FilterChainMatch_new(upb_arena *arena) {
- return (envoy_config_listener_v3_FilterChainMatch *)_upb_msg_new(&envoy_config_listener_v3_FilterChainMatch_msginit, arena);
-}
-UPB_INLINE envoy_config_listener_v3_FilterChainMatch *envoy_config_listener_v3_FilterChainMatch_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_listener_v3_FilterChainMatch *ret = envoy_config_listener_v3_FilterChainMatch_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_listener_v3_FilterChainMatch_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_listener_v3_FilterChainMatch_serialize(const envoy_config_listener_v3_FilterChainMatch *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_listener_v3_FilterChainMatch_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_config_listener_v3_FilterChainMatch_has_prefix_ranges(const envoy_config_listener_v3_FilterChainMatch *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(32, 56)); }
-UPB_INLINE const struct envoy_config_core_v3_CidrRange* const* envoy_config_listener_v3_FilterChainMatch_prefix_ranges(const envoy_config_listener_v3_FilterChainMatch *msg, size_t *len) { return (const struct envoy_config_core_v3_CidrRange* const*)_upb_array_accessor(msg, UPB_SIZE(32, 56), len); }
-UPB_INLINE upb_strview envoy_config_listener_v3_FilterChainMatch_address_suffix(const envoy_config_listener_v3_FilterChainMatch *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview); }
-UPB_INLINE bool envoy_config_listener_v3_FilterChainMatch_has_suffix_len(const envoy_config_listener_v3_FilterChainMatch *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 40)); }
-UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_listener_v3_FilterChainMatch_suffix_len(const envoy_config_listener_v3_FilterChainMatch *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const struct google_protobuf_UInt32Value*); }
-UPB_INLINE bool envoy_config_listener_v3_FilterChainMatch_has_source_prefix_ranges(const envoy_config_listener_v3_FilterChainMatch *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(36, 64)); }
-UPB_INLINE const struct envoy_config_core_v3_CidrRange* const* envoy_config_listener_v3_FilterChainMatch_source_prefix_ranges(const envoy_config_listener_v3_FilterChainMatch *msg, size_t *len) { return (const struct envoy_config_core_v3_CidrRange* const*)_upb_array_accessor(msg, UPB_SIZE(36, 64), len); }
-UPB_INLINE uint32_t const* envoy_config_listener_v3_FilterChainMatch_source_ports(const envoy_config_listener_v3_FilterChainMatch *msg, size_t *len) { return (uint32_t const*)_upb_array_accessor(msg, UPB_SIZE(40, 72), len); }
-UPB_INLINE bool envoy_config_listener_v3_FilterChainMatch_has_destination_port(const envoy_config_listener_v3_FilterChainMatch *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 48)); }
-UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_listener_v3_FilterChainMatch_destination_port(const envoy_config_listener_v3_FilterChainMatch *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 48), const struct google_protobuf_UInt32Value*); }
-UPB_INLINE upb_strview envoy_config_listener_v3_FilterChainMatch_transport_protocol(const envoy_config_listener_v3_FilterChainMatch *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_strview); }
-UPB_INLINE upb_strview const* envoy_config_listener_v3_FilterChainMatch_application_protocols(const envoy_config_listener_v3_FilterChainMatch *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(44, 80), len); }
-UPB_INLINE upb_strview const* envoy_config_listener_v3_FilterChainMatch_server_names(const envoy_config_listener_v3_FilterChainMatch *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(48, 88), len); }
-UPB_INLINE int32_t envoy_config_listener_v3_FilterChainMatch_source_type(const envoy_config_listener_v3_FilterChainMatch *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
-
-UPB_INLINE struct envoy_config_core_v3_CidrRange** envoy_config_listener_v3_FilterChainMatch_mutable_prefix_ranges(envoy_config_listener_v3_FilterChainMatch *msg, size_t *len) {
- return (struct envoy_config_core_v3_CidrRange**)_upb_array_mutable_accessor(msg, UPB_SIZE(32, 56), len);
-}
-UPB_INLINE struct envoy_config_core_v3_CidrRange** envoy_config_listener_v3_FilterChainMatch_resize_prefix_ranges(envoy_config_listener_v3_FilterChainMatch *msg, size_t len, upb_arena *arena) {
- return (struct envoy_config_core_v3_CidrRange**)_upb_array_resize_accessor(msg, UPB_SIZE(32, 56), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_config_core_v3_CidrRange* envoy_config_listener_v3_FilterChainMatch_add_prefix_ranges(envoy_config_listener_v3_FilterChainMatch *msg, upb_arena *arena) {
- struct envoy_config_core_v3_CidrRange* sub = (struct envoy_config_core_v3_CidrRange*)_upb_msg_new(&envoy_config_core_v3_CidrRange_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(32, 56), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-UPB_INLINE void envoy_config_listener_v3_FilterChainMatch_set_address_suffix(envoy_config_listener_v3_FilterChainMatch *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_listener_v3_FilterChainMatch_set_suffix_len(envoy_config_listener_v3_FilterChainMatch *msg, struct google_protobuf_UInt32Value* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(24, 40), struct google_protobuf_UInt32Value*) = value;
-}
-UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_listener_v3_FilterChainMatch_mutable_suffix_len(envoy_config_listener_v3_FilterChainMatch *msg, upb_arena *arena) {
- struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_listener_v3_FilterChainMatch_suffix_len(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
- if (!sub) return NULL;
- envoy_config_listener_v3_FilterChainMatch_set_suffix_len(msg, sub);
- }
- return sub;
-}
-UPB_INLINE struct envoy_config_core_v3_CidrRange** envoy_config_listener_v3_FilterChainMatch_mutable_source_prefix_ranges(envoy_config_listener_v3_FilterChainMatch *msg, size_t *len) {
- return (struct envoy_config_core_v3_CidrRange**)_upb_array_mutable_accessor(msg, UPB_SIZE(36, 64), len);
-}
-UPB_INLINE struct envoy_config_core_v3_CidrRange** envoy_config_listener_v3_FilterChainMatch_resize_source_prefix_ranges(envoy_config_listener_v3_FilterChainMatch *msg, size_t len, upb_arena *arena) {
- return (struct envoy_config_core_v3_CidrRange**)_upb_array_resize_accessor(msg, UPB_SIZE(36, 64), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_config_core_v3_CidrRange* envoy_config_listener_v3_FilterChainMatch_add_source_prefix_ranges(envoy_config_listener_v3_FilterChainMatch *msg, upb_arena *arena) {
- struct envoy_config_core_v3_CidrRange* sub = (struct envoy_config_core_v3_CidrRange*)_upb_msg_new(&envoy_config_core_v3_CidrRange_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(36, 64), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-UPB_INLINE uint32_t* envoy_config_listener_v3_FilterChainMatch_mutable_source_ports(envoy_config_listener_v3_FilterChainMatch *msg, size_t *len) {
- return (uint32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(40, 72), len);
-}
-UPB_INLINE uint32_t* envoy_config_listener_v3_FilterChainMatch_resize_source_ports(envoy_config_listener_v3_FilterChainMatch *msg, size_t len, upb_arena *arena) {
- return (uint32_t*)_upb_array_resize_accessor(msg, UPB_SIZE(40, 72), len, UPB_TYPE_UINT32, arena);
-}
-UPB_INLINE bool envoy_config_listener_v3_FilterChainMatch_add_source_ports(envoy_config_listener_v3_FilterChainMatch *msg, uint32_t val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(40, 72), UPB_SIZE(4, 4), UPB_TYPE_UINT32, &val,
- arena);
-}
-UPB_INLINE void envoy_config_listener_v3_FilterChainMatch_set_destination_port(envoy_config_listener_v3_FilterChainMatch *msg, struct google_protobuf_UInt32Value* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(28, 48), struct google_protobuf_UInt32Value*) = value;
-}
-UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_listener_v3_FilterChainMatch_mutable_destination_port(envoy_config_listener_v3_FilterChainMatch *msg, upb_arena *arena) {
- struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_listener_v3_FilterChainMatch_destination_port(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
- if (!sub) return NULL;
- envoy_config_listener_v3_FilterChainMatch_set_destination_port(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_listener_v3_FilterChainMatch_set_transport_protocol(envoy_config_listener_v3_FilterChainMatch *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_strview) = value;
-}
-UPB_INLINE upb_strview* envoy_config_listener_v3_FilterChainMatch_mutable_application_protocols(envoy_config_listener_v3_FilterChainMatch *msg, size_t *len) {
- return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(44, 80), len);
-}
-UPB_INLINE upb_strview* envoy_config_listener_v3_FilterChainMatch_resize_application_protocols(envoy_config_listener_v3_FilterChainMatch *msg, size_t len, upb_arena *arena) {
- return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(44, 80), len, UPB_TYPE_STRING, arena);
-}
-UPB_INLINE bool envoy_config_listener_v3_FilterChainMatch_add_application_protocols(envoy_config_listener_v3_FilterChainMatch *msg, upb_strview val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(44, 80), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
- arena);
-}
-UPB_INLINE upb_strview* envoy_config_listener_v3_FilterChainMatch_mutable_server_names(envoy_config_listener_v3_FilterChainMatch *msg, size_t *len) {
- return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(48, 88), len);
-}
-UPB_INLINE upb_strview* envoy_config_listener_v3_FilterChainMatch_resize_server_names(envoy_config_listener_v3_FilterChainMatch *msg, size_t len, upb_arena *arena) {
- return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(48, 88), len, UPB_TYPE_STRING, arena);
-}
-UPB_INLINE bool envoy_config_listener_v3_FilterChainMatch_add_server_names(envoy_config_listener_v3_FilterChainMatch *msg, upb_strview val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(48, 88), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
- arena);
-}
-UPB_INLINE void envoy_config_listener_v3_FilterChainMatch_set_source_type(envoy_config_listener_v3_FilterChainMatch *msg, int32_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
-}
-
-/* envoy.config.listener.v3.FilterChain */
-
-UPB_INLINE envoy_config_listener_v3_FilterChain *envoy_config_listener_v3_FilterChain_new(upb_arena *arena) {
- return (envoy_config_listener_v3_FilterChain *)_upb_msg_new(&envoy_config_listener_v3_FilterChain_msginit, arena);
-}
-UPB_INLINE envoy_config_listener_v3_FilterChain *envoy_config_listener_v3_FilterChain_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_listener_v3_FilterChain *ret = envoy_config_listener_v3_FilterChain_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_listener_v3_FilterChain_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_listener_v3_FilterChain_serialize(const envoy_config_listener_v3_FilterChain *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_listener_v3_FilterChain_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_config_listener_v3_FilterChain_has_filter_chain_match(const envoy_config_listener_v3_FilterChain *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const envoy_config_listener_v3_FilterChainMatch* envoy_config_listener_v3_FilterChain_filter_chain_match(const envoy_config_listener_v3_FilterChain *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const envoy_config_listener_v3_FilterChainMatch*); }
-UPB_INLINE bool envoy_config_listener_v3_FilterChain_has_filters(const envoy_config_listener_v3_FilterChain *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 56)); }
-UPB_INLINE const envoy_config_listener_v3_Filter* const* envoy_config_listener_v3_FilterChain_filters(const envoy_config_listener_v3_FilterChain *msg, size_t *len) { return (const envoy_config_listener_v3_Filter* const*)_upb_array_accessor(msg, UPB_SIZE(28, 56), len); }
-UPB_INLINE bool envoy_config_listener_v3_FilterChain_has_use_proxy_proto(const envoy_config_listener_v3_FilterChain *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
-UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_listener_v3_FilterChain_use_proxy_proto(const envoy_config_listener_v3_FilterChain *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_protobuf_BoolValue*); }
-UPB_INLINE bool envoy_config_listener_v3_FilterChain_has_metadata(const envoy_config_listener_v3_FilterChain *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); }
-UPB_INLINE const struct envoy_config_core_v3_Metadata* envoy_config_listener_v3_FilterChain_metadata(const envoy_config_listener_v3_FilterChain *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const struct envoy_config_core_v3_Metadata*); }
-UPB_INLINE bool envoy_config_listener_v3_FilterChain_has_transport_socket(const envoy_config_listener_v3_FilterChain *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 40)); }
-UPB_INLINE const struct envoy_config_core_v3_TransportSocket* envoy_config_listener_v3_FilterChain_transport_socket(const envoy_config_listener_v3_FilterChain *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const struct envoy_config_core_v3_TransportSocket*); }
-UPB_INLINE upb_strview envoy_config_listener_v3_FilterChain_name(const envoy_config_listener_v3_FilterChain *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE bool envoy_config_listener_v3_FilterChain_has_on_demand_configuration(const envoy_config_listener_v3_FilterChain *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 48)); }
-UPB_INLINE const envoy_config_listener_v3_FilterChain_OnDemandConfiguration* envoy_config_listener_v3_FilterChain_on_demand_configuration(const envoy_config_listener_v3_FilterChain *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 48), const envoy_config_listener_v3_FilterChain_OnDemandConfiguration*); }
-
-UPB_INLINE void envoy_config_listener_v3_FilterChain_set_filter_chain_match(envoy_config_listener_v3_FilterChain *msg, envoy_config_listener_v3_FilterChainMatch* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), envoy_config_listener_v3_FilterChainMatch*) = value;
-}
-UPB_INLINE struct envoy_config_listener_v3_FilterChainMatch* envoy_config_listener_v3_FilterChain_mutable_filter_chain_match(envoy_config_listener_v3_FilterChain *msg, upb_arena *arena) {
- struct envoy_config_listener_v3_FilterChainMatch* sub = (struct envoy_config_listener_v3_FilterChainMatch*)envoy_config_listener_v3_FilterChain_filter_chain_match(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_listener_v3_FilterChainMatch*)_upb_msg_new(&envoy_config_listener_v3_FilterChainMatch_msginit, arena);
- if (!sub) return NULL;
- envoy_config_listener_v3_FilterChain_set_filter_chain_match(msg, sub);
- }
- return sub;
-}
-UPB_INLINE envoy_config_listener_v3_Filter** envoy_config_listener_v3_FilterChain_mutable_filters(envoy_config_listener_v3_FilterChain *msg, size_t *len) {
- return (envoy_config_listener_v3_Filter**)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 56), len);
-}
-UPB_INLINE envoy_config_listener_v3_Filter** envoy_config_listener_v3_FilterChain_resize_filters(envoy_config_listener_v3_FilterChain *msg, size_t len, upb_arena *arena) {
- return (envoy_config_listener_v3_Filter**)_upb_array_resize_accessor(msg, UPB_SIZE(28, 56), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_config_listener_v3_Filter* envoy_config_listener_v3_FilterChain_add_filters(envoy_config_listener_v3_FilterChain *msg, upb_arena *arena) {
- struct envoy_config_listener_v3_Filter* sub = (struct envoy_config_listener_v3_Filter*)_upb_msg_new(&envoy_config_listener_v3_Filter_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(28, 56), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-UPB_INLINE void envoy_config_listener_v3_FilterChain_set_use_proxy_proto(envoy_config_listener_v3_FilterChain *msg, struct google_protobuf_BoolValue* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_protobuf_BoolValue*) = value;
-}
-UPB_INLINE struct google_protobuf_BoolValue* envoy_config_listener_v3_FilterChain_mutable_use_proxy_proto(envoy_config_listener_v3_FilterChain *msg, upb_arena *arena) {
- struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_listener_v3_FilterChain_use_proxy_proto(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_BoolValue*)_upb_msg_new(&google_protobuf_BoolValue_msginit, arena);
- if (!sub) return NULL;
- envoy_config_listener_v3_FilterChain_set_use_proxy_proto(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_listener_v3_FilterChain_set_metadata(envoy_config_listener_v3_FilterChain *msg, struct envoy_config_core_v3_Metadata* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(16, 32), struct envoy_config_core_v3_Metadata*) = value;
-}
-UPB_INLINE struct envoy_config_core_v3_Metadata* envoy_config_listener_v3_FilterChain_mutable_metadata(envoy_config_listener_v3_FilterChain *msg, upb_arena *arena) {
- struct envoy_config_core_v3_Metadata* sub = (struct envoy_config_core_v3_Metadata*)envoy_config_listener_v3_FilterChain_metadata(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_Metadata*)_upb_msg_new(&envoy_config_core_v3_Metadata_msginit, arena);
- if (!sub) return NULL;
- envoy_config_listener_v3_FilterChain_set_metadata(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_listener_v3_FilterChain_set_transport_socket(envoy_config_listener_v3_FilterChain *msg, struct envoy_config_core_v3_TransportSocket* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(20, 40), struct envoy_config_core_v3_TransportSocket*) = value;
-}
-UPB_INLINE struct envoy_config_core_v3_TransportSocket* envoy_config_listener_v3_FilterChain_mutable_transport_socket(envoy_config_listener_v3_FilterChain *msg, upb_arena *arena) {
- struct envoy_config_core_v3_TransportSocket* sub = (struct envoy_config_core_v3_TransportSocket*)envoy_config_listener_v3_FilterChain_transport_socket(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_TransportSocket*)_upb_msg_new(&envoy_config_core_v3_TransportSocket_msginit, arena);
- if (!sub) return NULL;
- envoy_config_listener_v3_FilterChain_set_transport_socket(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_listener_v3_FilterChain_set_name(envoy_config_listener_v3_FilterChain *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_listener_v3_FilterChain_set_on_demand_configuration(envoy_config_listener_v3_FilterChain *msg, envoy_config_listener_v3_FilterChain_OnDemandConfiguration* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(24, 48), envoy_config_listener_v3_FilterChain_OnDemandConfiguration*) = value;
-}
-UPB_INLINE struct envoy_config_listener_v3_FilterChain_OnDemandConfiguration* envoy_config_listener_v3_FilterChain_mutable_on_demand_configuration(envoy_config_listener_v3_FilterChain *msg, upb_arena *arena) {
- struct envoy_config_listener_v3_FilterChain_OnDemandConfiguration* sub = (struct envoy_config_listener_v3_FilterChain_OnDemandConfiguration*)envoy_config_listener_v3_FilterChain_on_demand_configuration(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_listener_v3_FilterChain_OnDemandConfiguration*)_upb_msg_new(&envoy_config_listener_v3_FilterChain_OnDemandConfiguration_msginit, arena);
- if (!sub) return NULL;
- envoy_config_listener_v3_FilterChain_set_on_demand_configuration(msg, sub);
- }
- return sub;
-}
-
-/* envoy.config.listener.v3.FilterChain.OnDemandConfiguration */
-
-UPB_INLINE envoy_config_listener_v3_FilterChain_OnDemandConfiguration *envoy_config_listener_v3_FilterChain_OnDemandConfiguration_new(upb_arena *arena) {
- return (envoy_config_listener_v3_FilterChain_OnDemandConfiguration *)_upb_msg_new(&envoy_config_listener_v3_FilterChain_OnDemandConfiguration_msginit, arena);
-}
-UPB_INLINE envoy_config_listener_v3_FilterChain_OnDemandConfiguration *envoy_config_listener_v3_FilterChain_OnDemandConfiguration_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_listener_v3_FilterChain_OnDemandConfiguration *ret = envoy_config_listener_v3_FilterChain_OnDemandConfiguration_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_listener_v3_FilterChain_OnDemandConfiguration_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_listener_v3_FilterChain_OnDemandConfiguration_serialize(const envoy_config_listener_v3_FilterChain_OnDemandConfiguration *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_listener_v3_FilterChain_OnDemandConfiguration_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_config_listener_v3_FilterChain_OnDemandConfiguration_has_rebuild_timeout(const envoy_config_listener_v3_FilterChain_OnDemandConfiguration *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE const struct google_protobuf_Duration* envoy_config_listener_v3_FilterChain_OnDemandConfiguration_rebuild_timeout(const envoy_config_listener_v3_FilterChain_OnDemandConfiguration *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct google_protobuf_Duration*); }
-
-UPB_INLINE void envoy_config_listener_v3_FilterChain_OnDemandConfiguration_set_rebuild_timeout(envoy_config_listener_v3_FilterChain_OnDemandConfiguration *msg, struct google_protobuf_Duration* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct google_protobuf_Duration*) = value;
-}
-UPB_INLINE struct google_protobuf_Duration* envoy_config_listener_v3_FilterChain_OnDemandConfiguration_mutable_rebuild_timeout(envoy_config_listener_v3_FilterChain_OnDemandConfiguration *msg, upb_arena *arena) {
- struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_listener_v3_FilterChain_OnDemandConfiguration_rebuild_timeout(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
- if (!sub) return NULL;
- envoy_config_listener_v3_FilterChain_OnDemandConfiguration_set_rebuild_timeout(msg, sub);
- }
- return sub;
-}
-
-/* envoy.config.listener.v3.ListenerFilterChainMatchPredicate */
-
-UPB_INLINE envoy_config_listener_v3_ListenerFilterChainMatchPredicate *envoy_config_listener_v3_ListenerFilterChainMatchPredicate_new(upb_arena *arena) {
- return (envoy_config_listener_v3_ListenerFilterChainMatchPredicate *)_upb_msg_new(&envoy_config_listener_v3_ListenerFilterChainMatchPredicate_msginit, arena);
-}
-UPB_INLINE envoy_config_listener_v3_ListenerFilterChainMatchPredicate *envoy_config_listener_v3_ListenerFilterChainMatchPredicate_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_listener_v3_ListenerFilterChainMatchPredicate *ret = envoy_config_listener_v3_ListenerFilterChainMatchPredicate_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_listener_v3_ListenerFilterChainMatchPredicate_serialize(const envoy_config_listener_v3_ListenerFilterChainMatchPredicate *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_msginit, arena, len);
-}
-
-typedef enum {
- envoy_config_listener_v3_ListenerFilterChainMatchPredicate_rule_or_match = 1,
- envoy_config_listener_v3_ListenerFilterChainMatchPredicate_rule_and_match = 2,
- envoy_config_listener_v3_ListenerFilterChainMatchPredicate_rule_not_match = 3,
- envoy_config_listener_v3_ListenerFilterChainMatchPredicate_rule_any_match = 4,
- envoy_config_listener_v3_ListenerFilterChainMatchPredicate_rule_destination_port_range = 5,
- envoy_config_listener_v3_ListenerFilterChainMatchPredicate_rule_NOT_SET = 0
-} envoy_config_listener_v3_ListenerFilterChainMatchPredicate_rule_oneofcases;
-UPB_INLINE envoy_config_listener_v3_ListenerFilterChainMatchPredicate_rule_oneofcases envoy_config_listener_v3_ListenerFilterChainMatchPredicate_rule_case(const envoy_config_listener_v3_ListenerFilterChainMatchPredicate* msg) { return (envoy_config_listener_v3_ListenerFilterChainMatchPredicate_rule_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 8), int32_t); }
-
-UPB_INLINE bool envoy_config_listener_v3_ListenerFilterChainMatchPredicate_has_or_match(const envoy_config_listener_v3_ListenerFilterChainMatchPredicate *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 1; }
-UPB_INLINE const envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet* envoy_config_listener_v3_ListenerFilterChainMatchPredicate_or_match(const envoy_config_listener_v3_ListenerFilterChainMatchPredicate *msg) { return UPB_READ_ONEOF(msg, const envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 1, NULL); }
-UPB_INLINE bool envoy_config_listener_v3_ListenerFilterChainMatchPredicate_has_and_match(const envoy_config_listener_v3_ListenerFilterChainMatchPredicate *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 2; }
-UPB_INLINE const envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet* envoy_config_listener_v3_ListenerFilterChainMatchPredicate_and_match(const envoy_config_listener_v3_ListenerFilterChainMatchPredicate *msg) { return UPB_READ_ONEOF(msg, const envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 2, NULL); }
-UPB_INLINE bool envoy_config_listener_v3_ListenerFilterChainMatchPredicate_has_not_match(const envoy_config_listener_v3_ListenerFilterChainMatchPredicate *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 3; }
-UPB_INLINE const envoy_config_listener_v3_ListenerFilterChainMatchPredicate* envoy_config_listener_v3_ListenerFilterChainMatchPredicate_not_match(const envoy_config_listener_v3_ListenerFilterChainMatchPredicate *msg) { return UPB_READ_ONEOF(msg, const envoy_config_listener_v3_ListenerFilterChainMatchPredicate*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 3, NULL); }
-UPB_INLINE bool envoy_config_listener_v3_ListenerFilterChainMatchPredicate_has_any_match(const envoy_config_listener_v3_ListenerFilterChainMatchPredicate *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 4; }
-UPB_INLINE bool envoy_config_listener_v3_ListenerFilterChainMatchPredicate_any_match(const envoy_config_listener_v3_ListenerFilterChainMatchPredicate *msg) { return UPB_READ_ONEOF(msg, bool, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 4, false); }
-UPB_INLINE bool envoy_config_listener_v3_ListenerFilterChainMatchPredicate_has_destination_port_range(const envoy_config_listener_v3_ListenerFilterChainMatchPredicate *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 5; }
-UPB_INLINE const struct envoy_type_v3_Int32Range* envoy_config_listener_v3_ListenerFilterChainMatchPredicate_destination_port_range(const envoy_config_listener_v3_ListenerFilterChainMatchPredicate *msg) { return UPB_READ_ONEOF(msg, const struct envoy_type_v3_Int32Range*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 5, NULL); }
-
-UPB_INLINE void envoy_config_listener_v3_ListenerFilterChainMatchPredicate_set_or_match(envoy_config_listener_v3_ListenerFilterChainMatchPredicate *msg, envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 1);
-}
-UPB_INLINE struct envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet* envoy_config_listener_v3_ListenerFilterChainMatchPredicate_mutable_or_match(envoy_config_listener_v3_ListenerFilterChainMatchPredicate *msg, upb_arena *arena) {
- struct envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet* sub = (struct envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet*)envoy_config_listener_v3_ListenerFilterChainMatchPredicate_or_match(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet*)_upb_msg_new(&envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_msginit, arena);
- if (!sub) return NULL;
- envoy_config_listener_v3_ListenerFilterChainMatchPredicate_set_or_match(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_listener_v3_ListenerFilterChainMatchPredicate_set_and_match(envoy_config_listener_v3_ListenerFilterChainMatchPredicate *msg, envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 2);
-}
-UPB_INLINE struct envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet* envoy_config_listener_v3_ListenerFilterChainMatchPredicate_mutable_and_match(envoy_config_listener_v3_ListenerFilterChainMatchPredicate *msg, upb_arena *arena) {
- struct envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet* sub = (struct envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet*)envoy_config_listener_v3_ListenerFilterChainMatchPredicate_and_match(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet*)_upb_msg_new(&envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_msginit, arena);
- if (!sub) return NULL;
- envoy_config_listener_v3_ListenerFilterChainMatchPredicate_set_and_match(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_listener_v3_ListenerFilterChainMatchPredicate_set_not_match(envoy_config_listener_v3_ListenerFilterChainMatchPredicate *msg, envoy_config_listener_v3_ListenerFilterChainMatchPredicate* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_listener_v3_ListenerFilterChainMatchPredicate*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 3);
-}
-UPB_INLINE struct envoy_config_listener_v3_ListenerFilterChainMatchPredicate* envoy_config_listener_v3_ListenerFilterChainMatchPredicate_mutable_not_match(envoy_config_listener_v3_ListenerFilterChainMatchPredicate *msg, upb_arena *arena) {
- struct envoy_config_listener_v3_ListenerFilterChainMatchPredicate* sub = (struct envoy_config_listener_v3_ListenerFilterChainMatchPredicate*)envoy_config_listener_v3_ListenerFilterChainMatchPredicate_not_match(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_listener_v3_ListenerFilterChainMatchPredicate*)_upb_msg_new(&envoy_config_listener_v3_ListenerFilterChainMatchPredicate_msginit, arena);
- if (!sub) return NULL;
- envoy_config_listener_v3_ListenerFilterChainMatchPredicate_set_not_match(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_listener_v3_ListenerFilterChainMatchPredicate_set_any_match(envoy_config_listener_v3_ListenerFilterChainMatchPredicate *msg, bool value) {
- UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 4);
-}
-UPB_INLINE void envoy_config_listener_v3_ListenerFilterChainMatchPredicate_set_destination_port_range(envoy_config_listener_v3_ListenerFilterChainMatchPredicate *msg, struct envoy_type_v3_Int32Range* value) {
- UPB_WRITE_ONEOF(msg, struct envoy_type_v3_Int32Range*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 5);
-}
-UPB_INLINE struct envoy_type_v3_Int32Range* envoy_config_listener_v3_ListenerFilterChainMatchPredicate_mutable_destination_port_range(envoy_config_listener_v3_ListenerFilterChainMatchPredicate *msg, upb_arena *arena) {
- struct envoy_type_v3_Int32Range* sub = (struct envoy_type_v3_Int32Range*)envoy_config_listener_v3_ListenerFilterChainMatchPredicate_destination_port_range(msg);
- if (sub == NULL) {
- sub = (struct envoy_type_v3_Int32Range*)_upb_msg_new(&envoy_type_v3_Int32Range_msginit, arena);
- if (!sub) return NULL;
- envoy_config_listener_v3_ListenerFilterChainMatchPredicate_set_destination_port_range(msg, sub);
- }
- return sub;
-}
-
-/* envoy.config.listener.v3.ListenerFilterChainMatchPredicate.MatchSet */
-
-UPB_INLINE envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet *envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_new(upb_arena *arena) {
- return (envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet *)_upb_msg_new(&envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_msginit, arena);
-}
-UPB_INLINE envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet *envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet *ret = envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_serialize(const envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_has_rules(const envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE const envoy_config_listener_v3_ListenerFilterChainMatchPredicate* const* envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_rules(const envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet *msg, size_t *len) { return (const envoy_config_listener_v3_ListenerFilterChainMatchPredicate* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
-
-UPB_INLINE envoy_config_listener_v3_ListenerFilterChainMatchPredicate** envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_mutable_rules(envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet *msg, size_t *len) {
- return (envoy_config_listener_v3_ListenerFilterChainMatchPredicate**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
-}
-UPB_INLINE envoy_config_listener_v3_ListenerFilterChainMatchPredicate** envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_resize_rules(envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet *msg, size_t len, upb_arena *arena) {
- return (envoy_config_listener_v3_ListenerFilterChainMatchPredicate**)_upb_array_resize_accessor(msg, UPB_SIZE(0, 0), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_config_listener_v3_ListenerFilterChainMatchPredicate* envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_add_rules(envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet *msg, upb_arena *arena) {
- struct envoy_config_listener_v3_ListenerFilterChainMatchPredicate* sub = (struct envoy_config_listener_v3_ListenerFilterChainMatchPredicate*)_upb_msg_new(&envoy_config_listener_v3_ListenerFilterChainMatchPredicate_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(0, 0), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-
-/* envoy.config.listener.v3.ListenerFilter */
-
-UPB_INLINE envoy_config_listener_v3_ListenerFilter *envoy_config_listener_v3_ListenerFilter_new(upb_arena *arena) {
- return (envoy_config_listener_v3_ListenerFilter *)_upb_msg_new(&envoy_config_listener_v3_ListenerFilter_msginit, arena);
-}
-UPB_INLINE envoy_config_listener_v3_ListenerFilter *envoy_config_listener_v3_ListenerFilter_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_listener_v3_ListenerFilter *ret = envoy_config_listener_v3_ListenerFilter_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_listener_v3_ListenerFilter_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_listener_v3_ListenerFilter_serialize(const envoy_config_listener_v3_ListenerFilter *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_listener_v3_ListenerFilter_msginit, arena, len);
-}
-
-typedef enum {
- envoy_config_listener_v3_ListenerFilter_config_type_typed_config = 3,
- envoy_config_listener_v3_ListenerFilter_config_type_NOT_SET = 0
-} envoy_config_listener_v3_ListenerFilter_config_type_oneofcases;
-UPB_INLINE envoy_config_listener_v3_ListenerFilter_config_type_oneofcases envoy_config_listener_v3_ListenerFilter_config_type_case(const envoy_config_listener_v3_ListenerFilter* msg) { return (envoy_config_listener_v3_ListenerFilter_config_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(16, 32), int32_t); }
-
-UPB_INLINE upb_strview envoy_config_listener_v3_ListenerFilter_name(const envoy_config_listener_v3_ListenerFilter *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE bool envoy_config_listener_v3_ListenerFilter_has_typed_config(const envoy_config_listener_v3_ListenerFilter *msg) { return _upb_getoneofcase(msg, UPB_SIZE(16, 32)) == 3; }
-UPB_INLINE const struct google_protobuf_Any* envoy_config_listener_v3_ListenerFilter_typed_config(const envoy_config_listener_v3_ListenerFilter *msg) { return UPB_READ_ONEOF(msg, const struct google_protobuf_Any*, UPB_SIZE(12, 24), UPB_SIZE(16, 32), 3, NULL); }
-UPB_INLINE bool envoy_config_listener_v3_ListenerFilter_has_filter_disabled(const envoy_config_listener_v3_ListenerFilter *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const envoy_config_listener_v3_ListenerFilterChainMatchPredicate* envoy_config_listener_v3_ListenerFilter_filter_disabled(const envoy_config_listener_v3_ListenerFilter *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const envoy_config_listener_v3_ListenerFilterChainMatchPredicate*); }
-
-UPB_INLINE void envoy_config_listener_v3_ListenerFilter_set_name(envoy_config_listener_v3_ListenerFilter *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_listener_v3_ListenerFilter_set_typed_config(envoy_config_listener_v3_ListenerFilter *msg, struct google_protobuf_Any* value) {
- UPB_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(12, 24), value, UPB_SIZE(16, 32), 3);
-}
-UPB_INLINE struct google_protobuf_Any* envoy_config_listener_v3_ListenerFilter_mutable_typed_config(envoy_config_listener_v3_ListenerFilter *msg, upb_arena *arena) {
- struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_config_listener_v3_ListenerFilter_typed_config(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena);
- if (!sub) return NULL;
- envoy_config_listener_v3_ListenerFilter_set_typed_config(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_listener_v3_ListenerFilter_set_filter_disabled(envoy_config_listener_v3_ListenerFilter *msg, envoy_config_listener_v3_ListenerFilterChainMatchPredicate* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), envoy_config_listener_v3_ListenerFilterChainMatchPredicate*) = value;
-}
-UPB_INLINE struct envoy_config_listener_v3_ListenerFilterChainMatchPredicate* envoy_config_listener_v3_ListenerFilter_mutable_filter_disabled(envoy_config_listener_v3_ListenerFilter *msg, upb_arena *arena) {
- struct envoy_config_listener_v3_ListenerFilterChainMatchPredicate* sub = (struct envoy_config_listener_v3_ListenerFilterChainMatchPredicate*)envoy_config_listener_v3_ListenerFilter_filter_disabled(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_listener_v3_ListenerFilterChainMatchPredicate*)_upb_msg_new(&envoy_config_listener_v3_ListenerFilterChainMatchPredicate_msginit, arena);
- if (!sub) return NULL;
- envoy_config_listener_v3_ListenerFilter_set_filter_disabled(msg, sub);
- }
- return sub;
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* ENVOY_CONFIG_LISTENER_V3_LISTENER_COMPONENTS_PROTO_UPB_H_ */
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/listener/v3/listener_components.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_CONFIG_LISTENER_V3_LISTENER_COMPONENTS_PROTO_UPB_H_
+#define ENVOY_CONFIG_LISTENER_V3_LISTENER_COMPONENTS_PROTO_UPB_H_
+
+#include "upb/msg.h"
+#include "upb/decode.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_config_listener_v3_Filter;
+struct envoy_config_listener_v3_FilterChainMatch;
+struct envoy_config_listener_v3_FilterChain;
+struct envoy_config_listener_v3_FilterChain_OnDemandConfiguration;
+struct envoy_config_listener_v3_ListenerFilterChainMatchPredicate;
+struct envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet;
+struct envoy_config_listener_v3_ListenerFilter;
+typedef struct envoy_config_listener_v3_Filter envoy_config_listener_v3_Filter;
+typedef struct envoy_config_listener_v3_FilterChainMatch envoy_config_listener_v3_FilterChainMatch;
+typedef struct envoy_config_listener_v3_FilterChain envoy_config_listener_v3_FilterChain;
+typedef struct envoy_config_listener_v3_FilterChain_OnDemandConfiguration envoy_config_listener_v3_FilterChain_OnDemandConfiguration;
+typedef struct envoy_config_listener_v3_ListenerFilterChainMatchPredicate envoy_config_listener_v3_ListenerFilterChainMatchPredicate;
+typedef struct envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet;
+typedef struct envoy_config_listener_v3_ListenerFilter envoy_config_listener_v3_ListenerFilter;
+extern const upb_msglayout envoy_config_listener_v3_Filter_msginit;
+extern const upb_msglayout envoy_config_listener_v3_FilterChainMatch_msginit;
+extern const upb_msglayout envoy_config_listener_v3_FilterChain_msginit;
+extern const upb_msglayout envoy_config_listener_v3_FilterChain_OnDemandConfiguration_msginit;
+extern const upb_msglayout envoy_config_listener_v3_ListenerFilterChainMatchPredicate_msginit;
+extern const upb_msglayout envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_msginit;
+extern const upb_msglayout envoy_config_listener_v3_ListenerFilter_msginit;
+struct envoy_config_core_v3_CidrRange;
+struct envoy_config_core_v3_Metadata;
+struct envoy_config_core_v3_TransportSocket;
+struct envoy_type_v3_Int32Range;
+struct google_protobuf_Any;
+struct google_protobuf_BoolValue;
+struct google_protobuf_Duration;
+struct google_protobuf_UInt32Value;
+extern const upb_msglayout envoy_config_core_v3_CidrRange_msginit;
+extern const upb_msglayout envoy_config_core_v3_Metadata_msginit;
+extern const upb_msglayout envoy_config_core_v3_TransportSocket_msginit;
+extern const upb_msglayout envoy_type_v3_Int32Range_msginit;
+extern const upb_msglayout google_protobuf_Any_msginit;
+extern const upb_msglayout google_protobuf_BoolValue_msginit;
+extern const upb_msglayout google_protobuf_Duration_msginit;
+extern const upb_msglayout google_protobuf_UInt32Value_msginit;
+
+typedef enum {
+ envoy_config_listener_v3_FilterChainMatch_ANY = 0,
+ envoy_config_listener_v3_FilterChainMatch_SAME_IP_OR_LOOPBACK = 1,
+ envoy_config_listener_v3_FilterChainMatch_EXTERNAL = 2
+} envoy_config_listener_v3_FilterChainMatch_ConnectionSourceType;
+
+
+/* envoy.config.listener.v3.Filter */
+
+UPB_INLINE envoy_config_listener_v3_Filter *envoy_config_listener_v3_Filter_new(upb_arena *arena) {
+ return (envoy_config_listener_v3_Filter *)_upb_msg_new(&envoy_config_listener_v3_Filter_msginit, arena);
+}
+UPB_INLINE envoy_config_listener_v3_Filter *envoy_config_listener_v3_Filter_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_listener_v3_Filter *ret = envoy_config_listener_v3_Filter_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_listener_v3_Filter_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_listener_v3_Filter_serialize(const envoy_config_listener_v3_Filter *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_listener_v3_Filter_msginit, arena, len);
+}
+
+typedef enum {
+ envoy_config_listener_v3_Filter_config_type_typed_config = 4,
+ envoy_config_listener_v3_Filter_config_type_NOT_SET = 0
+} envoy_config_listener_v3_Filter_config_type_oneofcases;
+UPB_INLINE envoy_config_listener_v3_Filter_config_type_oneofcases envoy_config_listener_v3_Filter_config_type_case(const envoy_config_listener_v3_Filter* msg) { return (envoy_config_listener_v3_Filter_config_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(12, 24), int32_t); }
+
+UPB_INLINE upb_strview envoy_config_listener_v3_Filter_name(const envoy_config_listener_v3_Filter *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE bool envoy_config_listener_v3_Filter_has_typed_config(const envoy_config_listener_v3_Filter *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 4; }
+UPB_INLINE const struct google_protobuf_Any* envoy_config_listener_v3_Filter_typed_config(const envoy_config_listener_v3_Filter *msg) { return UPB_READ_ONEOF(msg, const struct google_protobuf_Any*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 4, NULL); }
+
+UPB_INLINE void envoy_config_listener_v3_Filter_set_name(envoy_config_listener_v3_Filter *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_listener_v3_Filter_set_typed_config(envoy_config_listener_v3_Filter *msg, struct google_protobuf_Any* value) {
+ UPB_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 4);
+}
+UPB_INLINE struct google_protobuf_Any* envoy_config_listener_v3_Filter_mutable_typed_config(envoy_config_listener_v3_Filter *msg, upb_arena *arena) {
+ struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_config_listener_v3_Filter_typed_config(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_listener_v3_Filter_set_typed_config(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.listener.v3.FilterChainMatch */
+
+UPB_INLINE envoy_config_listener_v3_FilterChainMatch *envoy_config_listener_v3_FilterChainMatch_new(upb_arena *arena) {
+ return (envoy_config_listener_v3_FilterChainMatch *)_upb_msg_new(&envoy_config_listener_v3_FilterChainMatch_msginit, arena);
+}
+UPB_INLINE envoy_config_listener_v3_FilterChainMatch *envoy_config_listener_v3_FilterChainMatch_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_listener_v3_FilterChainMatch *ret = envoy_config_listener_v3_FilterChainMatch_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_listener_v3_FilterChainMatch_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_listener_v3_FilterChainMatch_serialize(const envoy_config_listener_v3_FilterChainMatch *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_listener_v3_FilterChainMatch_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_listener_v3_FilterChainMatch_has_prefix_ranges(const envoy_config_listener_v3_FilterChainMatch *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(32, 56)); }
+UPB_INLINE const struct envoy_config_core_v3_CidrRange* const* envoy_config_listener_v3_FilterChainMatch_prefix_ranges(const envoy_config_listener_v3_FilterChainMatch *msg, size_t *len) { return (const struct envoy_config_core_v3_CidrRange* const*)_upb_array_accessor(msg, UPB_SIZE(32, 56), len); }
+UPB_INLINE upb_strview envoy_config_listener_v3_FilterChainMatch_address_suffix(const envoy_config_listener_v3_FilterChainMatch *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview); }
+UPB_INLINE bool envoy_config_listener_v3_FilterChainMatch_has_suffix_len(const envoy_config_listener_v3_FilterChainMatch *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 40)); }
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_listener_v3_FilterChainMatch_suffix_len(const envoy_config_listener_v3_FilterChainMatch *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const struct google_protobuf_UInt32Value*); }
+UPB_INLINE bool envoy_config_listener_v3_FilterChainMatch_has_source_prefix_ranges(const envoy_config_listener_v3_FilterChainMatch *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(36, 64)); }
+UPB_INLINE const struct envoy_config_core_v3_CidrRange* const* envoy_config_listener_v3_FilterChainMatch_source_prefix_ranges(const envoy_config_listener_v3_FilterChainMatch *msg, size_t *len) { return (const struct envoy_config_core_v3_CidrRange* const*)_upb_array_accessor(msg, UPB_SIZE(36, 64), len); }
+UPB_INLINE uint32_t const* envoy_config_listener_v3_FilterChainMatch_source_ports(const envoy_config_listener_v3_FilterChainMatch *msg, size_t *len) { return (uint32_t const*)_upb_array_accessor(msg, UPB_SIZE(40, 72), len); }
+UPB_INLINE bool envoy_config_listener_v3_FilterChainMatch_has_destination_port(const envoy_config_listener_v3_FilterChainMatch *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 48)); }
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_listener_v3_FilterChainMatch_destination_port(const envoy_config_listener_v3_FilterChainMatch *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 48), const struct google_protobuf_UInt32Value*); }
+UPB_INLINE upb_strview envoy_config_listener_v3_FilterChainMatch_transport_protocol(const envoy_config_listener_v3_FilterChainMatch *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_strview); }
+UPB_INLINE upb_strview const* envoy_config_listener_v3_FilterChainMatch_application_protocols(const envoy_config_listener_v3_FilterChainMatch *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(44, 80), len); }
+UPB_INLINE upb_strview const* envoy_config_listener_v3_FilterChainMatch_server_names(const envoy_config_listener_v3_FilterChainMatch *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(48, 88), len); }
+UPB_INLINE int32_t envoy_config_listener_v3_FilterChainMatch_source_type(const envoy_config_listener_v3_FilterChainMatch *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
+
+UPB_INLINE struct envoy_config_core_v3_CidrRange** envoy_config_listener_v3_FilterChainMatch_mutable_prefix_ranges(envoy_config_listener_v3_FilterChainMatch *msg, size_t *len) {
+ return (struct envoy_config_core_v3_CidrRange**)_upb_array_mutable_accessor(msg, UPB_SIZE(32, 56), len);
+}
+UPB_INLINE struct envoy_config_core_v3_CidrRange** envoy_config_listener_v3_FilterChainMatch_resize_prefix_ranges(envoy_config_listener_v3_FilterChainMatch *msg, size_t len, upb_arena *arena) {
+ return (struct envoy_config_core_v3_CidrRange**)_upb_array_resize_accessor(msg, UPB_SIZE(32, 56), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_config_core_v3_CidrRange* envoy_config_listener_v3_FilterChainMatch_add_prefix_ranges(envoy_config_listener_v3_FilterChainMatch *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_CidrRange* sub = (struct envoy_config_core_v3_CidrRange*)_upb_msg_new(&envoy_config_core_v3_CidrRange_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(32, 56), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE void envoy_config_listener_v3_FilterChainMatch_set_address_suffix(envoy_config_listener_v3_FilterChainMatch *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_listener_v3_FilterChainMatch_set_suffix_len(envoy_config_listener_v3_FilterChainMatch *msg, struct google_protobuf_UInt32Value* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 40), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_listener_v3_FilterChainMatch_mutable_suffix_len(envoy_config_listener_v3_FilterChainMatch *msg, upb_arena *arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_listener_v3_FilterChainMatch_suffix_len(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_listener_v3_FilterChainMatch_set_suffix_len(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE struct envoy_config_core_v3_CidrRange** envoy_config_listener_v3_FilterChainMatch_mutable_source_prefix_ranges(envoy_config_listener_v3_FilterChainMatch *msg, size_t *len) {
+ return (struct envoy_config_core_v3_CidrRange**)_upb_array_mutable_accessor(msg, UPB_SIZE(36, 64), len);
+}
+UPB_INLINE struct envoy_config_core_v3_CidrRange** envoy_config_listener_v3_FilterChainMatch_resize_source_prefix_ranges(envoy_config_listener_v3_FilterChainMatch *msg, size_t len, upb_arena *arena) {
+ return (struct envoy_config_core_v3_CidrRange**)_upb_array_resize_accessor(msg, UPB_SIZE(36, 64), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_config_core_v3_CidrRange* envoy_config_listener_v3_FilterChainMatch_add_source_prefix_ranges(envoy_config_listener_v3_FilterChainMatch *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_CidrRange* sub = (struct envoy_config_core_v3_CidrRange*)_upb_msg_new(&envoy_config_core_v3_CidrRange_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(36, 64), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE uint32_t* envoy_config_listener_v3_FilterChainMatch_mutable_source_ports(envoy_config_listener_v3_FilterChainMatch *msg, size_t *len) {
+ return (uint32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(40, 72), len);
+}
+UPB_INLINE uint32_t* envoy_config_listener_v3_FilterChainMatch_resize_source_ports(envoy_config_listener_v3_FilterChainMatch *msg, size_t len, upb_arena *arena) {
+ return (uint32_t*)_upb_array_resize_accessor(msg, UPB_SIZE(40, 72), len, UPB_TYPE_UINT32, arena);
+}
+UPB_INLINE bool envoy_config_listener_v3_FilterChainMatch_add_source_ports(envoy_config_listener_v3_FilterChainMatch *msg, uint32_t val, upb_arena *arena) {
+ return _upb_array_append_accessor(msg, UPB_SIZE(40, 72), UPB_SIZE(4, 4), UPB_TYPE_UINT32, &val,
+ arena);
+}
+UPB_INLINE void envoy_config_listener_v3_FilterChainMatch_set_destination_port(envoy_config_listener_v3_FilterChainMatch *msg, struct google_protobuf_UInt32Value* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 48), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_listener_v3_FilterChainMatch_mutable_destination_port(envoy_config_listener_v3_FilterChainMatch *msg, upb_arena *arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_listener_v3_FilterChainMatch_destination_port(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_listener_v3_FilterChainMatch_set_destination_port(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_listener_v3_FilterChainMatch_set_transport_protocol(envoy_config_listener_v3_FilterChainMatch *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_strview) = value;
+}
+UPB_INLINE upb_strview* envoy_config_listener_v3_FilterChainMatch_mutable_application_protocols(envoy_config_listener_v3_FilterChainMatch *msg, size_t *len) {
+ return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(44, 80), len);
+}
+UPB_INLINE upb_strview* envoy_config_listener_v3_FilterChainMatch_resize_application_protocols(envoy_config_listener_v3_FilterChainMatch *msg, size_t len, upb_arena *arena) {
+ return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(44, 80), len, UPB_TYPE_STRING, arena);
+}
+UPB_INLINE bool envoy_config_listener_v3_FilterChainMatch_add_application_protocols(envoy_config_listener_v3_FilterChainMatch *msg, upb_strview val, upb_arena *arena) {
+ return _upb_array_append_accessor(msg, UPB_SIZE(44, 80), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
+ arena);
+}
+UPB_INLINE upb_strview* envoy_config_listener_v3_FilterChainMatch_mutable_server_names(envoy_config_listener_v3_FilterChainMatch *msg, size_t *len) {
+ return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(48, 88), len);
+}
+UPB_INLINE upb_strview* envoy_config_listener_v3_FilterChainMatch_resize_server_names(envoy_config_listener_v3_FilterChainMatch *msg, size_t len, upb_arena *arena) {
+ return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(48, 88), len, UPB_TYPE_STRING, arena);
+}
+UPB_INLINE bool envoy_config_listener_v3_FilterChainMatch_add_server_names(envoy_config_listener_v3_FilterChainMatch *msg, upb_strview val, upb_arena *arena) {
+ return _upb_array_append_accessor(msg, UPB_SIZE(48, 88), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
+ arena);
+}
+UPB_INLINE void envoy_config_listener_v3_FilterChainMatch_set_source_type(envoy_config_listener_v3_FilterChainMatch *msg, int32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
+}
+
+/* envoy.config.listener.v3.FilterChain */
+
+UPB_INLINE envoy_config_listener_v3_FilterChain *envoy_config_listener_v3_FilterChain_new(upb_arena *arena) {
+ return (envoy_config_listener_v3_FilterChain *)_upb_msg_new(&envoy_config_listener_v3_FilterChain_msginit, arena);
+}
+UPB_INLINE envoy_config_listener_v3_FilterChain *envoy_config_listener_v3_FilterChain_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_listener_v3_FilterChain *ret = envoy_config_listener_v3_FilterChain_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_listener_v3_FilterChain_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_listener_v3_FilterChain_serialize(const envoy_config_listener_v3_FilterChain *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_listener_v3_FilterChain_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_listener_v3_FilterChain_has_filter_chain_match(const envoy_config_listener_v3_FilterChain *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
+UPB_INLINE const envoy_config_listener_v3_FilterChainMatch* envoy_config_listener_v3_FilterChain_filter_chain_match(const envoy_config_listener_v3_FilterChain *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const envoy_config_listener_v3_FilterChainMatch*); }
+UPB_INLINE bool envoy_config_listener_v3_FilterChain_has_filters(const envoy_config_listener_v3_FilterChain *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 56)); }
+UPB_INLINE const envoy_config_listener_v3_Filter* const* envoy_config_listener_v3_FilterChain_filters(const envoy_config_listener_v3_FilterChain *msg, size_t *len) { return (const envoy_config_listener_v3_Filter* const*)_upb_array_accessor(msg, UPB_SIZE(28, 56), len); }
+UPB_INLINE bool envoy_config_listener_v3_FilterChain_has_use_proxy_proto(const envoy_config_listener_v3_FilterChain *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
+UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_listener_v3_FilterChain_use_proxy_proto(const envoy_config_listener_v3_FilterChain *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_protobuf_BoolValue*); }
+UPB_INLINE bool envoy_config_listener_v3_FilterChain_has_metadata(const envoy_config_listener_v3_FilterChain *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); }
+UPB_INLINE const struct envoy_config_core_v3_Metadata* envoy_config_listener_v3_FilterChain_metadata(const envoy_config_listener_v3_FilterChain *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const struct envoy_config_core_v3_Metadata*); }
+UPB_INLINE bool envoy_config_listener_v3_FilterChain_has_transport_socket(const envoy_config_listener_v3_FilterChain *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 40)); }
+UPB_INLINE const struct envoy_config_core_v3_TransportSocket* envoy_config_listener_v3_FilterChain_transport_socket(const envoy_config_listener_v3_FilterChain *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const struct envoy_config_core_v3_TransportSocket*); }
+UPB_INLINE upb_strview envoy_config_listener_v3_FilterChain_name(const envoy_config_listener_v3_FilterChain *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE bool envoy_config_listener_v3_FilterChain_has_on_demand_configuration(const envoy_config_listener_v3_FilterChain *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 48)); }
+UPB_INLINE const envoy_config_listener_v3_FilterChain_OnDemandConfiguration* envoy_config_listener_v3_FilterChain_on_demand_configuration(const envoy_config_listener_v3_FilterChain *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 48), const envoy_config_listener_v3_FilterChain_OnDemandConfiguration*); }
+
+UPB_INLINE void envoy_config_listener_v3_FilterChain_set_filter_chain_match(envoy_config_listener_v3_FilterChain *msg, envoy_config_listener_v3_FilterChainMatch* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), envoy_config_listener_v3_FilterChainMatch*) = value;
+}
+UPB_INLINE struct envoy_config_listener_v3_FilterChainMatch* envoy_config_listener_v3_FilterChain_mutable_filter_chain_match(envoy_config_listener_v3_FilterChain *msg, upb_arena *arena) {
+ struct envoy_config_listener_v3_FilterChainMatch* sub = (struct envoy_config_listener_v3_FilterChainMatch*)envoy_config_listener_v3_FilterChain_filter_chain_match(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_listener_v3_FilterChainMatch*)_upb_msg_new(&envoy_config_listener_v3_FilterChainMatch_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_listener_v3_FilterChain_set_filter_chain_match(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE envoy_config_listener_v3_Filter** envoy_config_listener_v3_FilterChain_mutable_filters(envoy_config_listener_v3_FilterChain *msg, size_t *len) {
+ return (envoy_config_listener_v3_Filter**)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 56), len);
+}
+UPB_INLINE envoy_config_listener_v3_Filter** envoy_config_listener_v3_FilterChain_resize_filters(envoy_config_listener_v3_FilterChain *msg, size_t len, upb_arena *arena) {
+ return (envoy_config_listener_v3_Filter**)_upb_array_resize_accessor(msg, UPB_SIZE(28, 56), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_config_listener_v3_Filter* envoy_config_listener_v3_FilterChain_add_filters(envoy_config_listener_v3_FilterChain *msg, upb_arena *arena) {
+ struct envoy_config_listener_v3_Filter* sub = (struct envoy_config_listener_v3_Filter*)_upb_msg_new(&envoy_config_listener_v3_Filter_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(28, 56), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE void envoy_config_listener_v3_FilterChain_set_use_proxy_proto(envoy_config_listener_v3_FilterChain *msg, struct google_protobuf_BoolValue* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_protobuf_BoolValue*) = value;
+}
+UPB_INLINE struct google_protobuf_BoolValue* envoy_config_listener_v3_FilterChain_mutable_use_proxy_proto(envoy_config_listener_v3_FilterChain *msg, upb_arena *arena) {
+ struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_listener_v3_FilterChain_use_proxy_proto(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_BoolValue*)_upb_msg_new(&google_protobuf_BoolValue_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_listener_v3_FilterChain_set_use_proxy_proto(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_listener_v3_FilterChain_set_metadata(envoy_config_listener_v3_FilterChain *msg, struct envoy_config_core_v3_Metadata* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), struct envoy_config_core_v3_Metadata*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_Metadata* envoy_config_listener_v3_FilterChain_mutable_metadata(envoy_config_listener_v3_FilterChain *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_Metadata* sub = (struct envoy_config_core_v3_Metadata*)envoy_config_listener_v3_FilterChain_metadata(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_Metadata*)_upb_msg_new(&envoy_config_core_v3_Metadata_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_listener_v3_FilterChain_set_metadata(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_listener_v3_FilterChain_set_transport_socket(envoy_config_listener_v3_FilterChain *msg, struct envoy_config_core_v3_TransportSocket* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 40), struct envoy_config_core_v3_TransportSocket*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_TransportSocket* envoy_config_listener_v3_FilterChain_mutable_transport_socket(envoy_config_listener_v3_FilterChain *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_TransportSocket* sub = (struct envoy_config_core_v3_TransportSocket*)envoy_config_listener_v3_FilterChain_transport_socket(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_TransportSocket*)_upb_msg_new(&envoy_config_core_v3_TransportSocket_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_listener_v3_FilterChain_set_transport_socket(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_listener_v3_FilterChain_set_name(envoy_config_listener_v3_FilterChain *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_listener_v3_FilterChain_set_on_demand_configuration(envoy_config_listener_v3_FilterChain *msg, envoy_config_listener_v3_FilterChain_OnDemandConfiguration* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 48), envoy_config_listener_v3_FilterChain_OnDemandConfiguration*) = value;
+}
+UPB_INLINE struct envoy_config_listener_v3_FilterChain_OnDemandConfiguration* envoy_config_listener_v3_FilterChain_mutable_on_demand_configuration(envoy_config_listener_v3_FilterChain *msg, upb_arena *arena) {
+ struct envoy_config_listener_v3_FilterChain_OnDemandConfiguration* sub = (struct envoy_config_listener_v3_FilterChain_OnDemandConfiguration*)envoy_config_listener_v3_FilterChain_on_demand_configuration(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_listener_v3_FilterChain_OnDemandConfiguration*)_upb_msg_new(&envoy_config_listener_v3_FilterChain_OnDemandConfiguration_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_listener_v3_FilterChain_set_on_demand_configuration(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.listener.v3.FilterChain.OnDemandConfiguration */
+
+UPB_INLINE envoy_config_listener_v3_FilterChain_OnDemandConfiguration *envoy_config_listener_v3_FilterChain_OnDemandConfiguration_new(upb_arena *arena) {
+ return (envoy_config_listener_v3_FilterChain_OnDemandConfiguration *)_upb_msg_new(&envoy_config_listener_v3_FilterChain_OnDemandConfiguration_msginit, arena);
+}
+UPB_INLINE envoy_config_listener_v3_FilterChain_OnDemandConfiguration *envoy_config_listener_v3_FilterChain_OnDemandConfiguration_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_listener_v3_FilterChain_OnDemandConfiguration *ret = envoy_config_listener_v3_FilterChain_OnDemandConfiguration_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_listener_v3_FilterChain_OnDemandConfiguration_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_listener_v3_FilterChain_OnDemandConfiguration_serialize(const envoy_config_listener_v3_FilterChain_OnDemandConfiguration *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_listener_v3_FilterChain_OnDemandConfiguration_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_listener_v3_FilterChain_OnDemandConfiguration_has_rebuild_timeout(const envoy_config_listener_v3_FilterChain_OnDemandConfiguration *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE const struct google_protobuf_Duration* envoy_config_listener_v3_FilterChain_OnDemandConfiguration_rebuild_timeout(const envoy_config_listener_v3_FilterChain_OnDemandConfiguration *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct google_protobuf_Duration*); }
+
+UPB_INLINE void envoy_config_listener_v3_FilterChain_OnDemandConfiguration_set_rebuild_timeout(envoy_config_listener_v3_FilterChain_OnDemandConfiguration *msg, struct google_protobuf_Duration* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct google_protobuf_Duration*) = value;
+}
+UPB_INLINE struct google_protobuf_Duration* envoy_config_listener_v3_FilterChain_OnDemandConfiguration_mutable_rebuild_timeout(envoy_config_listener_v3_FilterChain_OnDemandConfiguration *msg, upb_arena *arena) {
+ struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_listener_v3_FilterChain_OnDemandConfiguration_rebuild_timeout(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_listener_v3_FilterChain_OnDemandConfiguration_set_rebuild_timeout(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.listener.v3.ListenerFilterChainMatchPredicate */
+
+UPB_INLINE envoy_config_listener_v3_ListenerFilterChainMatchPredicate *envoy_config_listener_v3_ListenerFilterChainMatchPredicate_new(upb_arena *arena) {
+ return (envoy_config_listener_v3_ListenerFilterChainMatchPredicate *)_upb_msg_new(&envoy_config_listener_v3_ListenerFilterChainMatchPredicate_msginit, arena);
+}
+UPB_INLINE envoy_config_listener_v3_ListenerFilterChainMatchPredicate *envoy_config_listener_v3_ListenerFilterChainMatchPredicate_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_listener_v3_ListenerFilterChainMatchPredicate *ret = envoy_config_listener_v3_ListenerFilterChainMatchPredicate_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_listener_v3_ListenerFilterChainMatchPredicate_serialize(const envoy_config_listener_v3_ListenerFilterChainMatchPredicate *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_msginit, arena, len);
+}
+
+typedef enum {
+ envoy_config_listener_v3_ListenerFilterChainMatchPredicate_rule_or_match = 1,
+ envoy_config_listener_v3_ListenerFilterChainMatchPredicate_rule_and_match = 2,
+ envoy_config_listener_v3_ListenerFilterChainMatchPredicate_rule_not_match = 3,
+ envoy_config_listener_v3_ListenerFilterChainMatchPredicate_rule_any_match = 4,
+ envoy_config_listener_v3_ListenerFilterChainMatchPredicate_rule_destination_port_range = 5,
+ envoy_config_listener_v3_ListenerFilterChainMatchPredicate_rule_NOT_SET = 0
+} envoy_config_listener_v3_ListenerFilterChainMatchPredicate_rule_oneofcases;
+UPB_INLINE envoy_config_listener_v3_ListenerFilterChainMatchPredicate_rule_oneofcases envoy_config_listener_v3_ListenerFilterChainMatchPredicate_rule_case(const envoy_config_listener_v3_ListenerFilterChainMatchPredicate* msg) { return (envoy_config_listener_v3_ListenerFilterChainMatchPredicate_rule_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 8), int32_t); }
+
+UPB_INLINE bool envoy_config_listener_v3_ListenerFilterChainMatchPredicate_has_or_match(const envoy_config_listener_v3_ListenerFilterChainMatchPredicate *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 1; }
+UPB_INLINE const envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet* envoy_config_listener_v3_ListenerFilterChainMatchPredicate_or_match(const envoy_config_listener_v3_ListenerFilterChainMatchPredicate *msg) { return UPB_READ_ONEOF(msg, const envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 1, NULL); }
+UPB_INLINE bool envoy_config_listener_v3_ListenerFilterChainMatchPredicate_has_and_match(const envoy_config_listener_v3_ListenerFilterChainMatchPredicate *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 2; }
+UPB_INLINE const envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet* envoy_config_listener_v3_ListenerFilterChainMatchPredicate_and_match(const envoy_config_listener_v3_ListenerFilterChainMatchPredicate *msg) { return UPB_READ_ONEOF(msg, const envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 2, NULL); }
+UPB_INLINE bool envoy_config_listener_v3_ListenerFilterChainMatchPredicate_has_not_match(const envoy_config_listener_v3_ListenerFilterChainMatchPredicate *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 3; }
+UPB_INLINE const envoy_config_listener_v3_ListenerFilterChainMatchPredicate* envoy_config_listener_v3_ListenerFilterChainMatchPredicate_not_match(const envoy_config_listener_v3_ListenerFilterChainMatchPredicate *msg) { return UPB_READ_ONEOF(msg, const envoy_config_listener_v3_ListenerFilterChainMatchPredicate*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 3, NULL); }
+UPB_INLINE bool envoy_config_listener_v3_ListenerFilterChainMatchPredicate_has_any_match(const envoy_config_listener_v3_ListenerFilterChainMatchPredicate *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 4; }
+UPB_INLINE bool envoy_config_listener_v3_ListenerFilterChainMatchPredicate_any_match(const envoy_config_listener_v3_ListenerFilterChainMatchPredicate *msg) { return UPB_READ_ONEOF(msg, bool, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 4, false); }
+UPB_INLINE bool envoy_config_listener_v3_ListenerFilterChainMatchPredicate_has_destination_port_range(const envoy_config_listener_v3_ListenerFilterChainMatchPredicate *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 5; }
+UPB_INLINE const struct envoy_type_v3_Int32Range* envoy_config_listener_v3_ListenerFilterChainMatchPredicate_destination_port_range(const envoy_config_listener_v3_ListenerFilterChainMatchPredicate *msg) { return UPB_READ_ONEOF(msg, const struct envoy_type_v3_Int32Range*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 5, NULL); }
+
+UPB_INLINE void envoy_config_listener_v3_ListenerFilterChainMatchPredicate_set_or_match(envoy_config_listener_v3_ListenerFilterChainMatchPredicate *msg, envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 1);
+}
+UPB_INLINE struct envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet* envoy_config_listener_v3_ListenerFilterChainMatchPredicate_mutable_or_match(envoy_config_listener_v3_ListenerFilterChainMatchPredicate *msg, upb_arena *arena) {
+ struct envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet* sub = (struct envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet*)envoy_config_listener_v3_ListenerFilterChainMatchPredicate_or_match(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet*)_upb_msg_new(&envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_listener_v3_ListenerFilterChainMatchPredicate_set_or_match(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_listener_v3_ListenerFilterChainMatchPredicate_set_and_match(envoy_config_listener_v3_ListenerFilterChainMatchPredicate *msg, envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 2);
+}
+UPB_INLINE struct envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet* envoy_config_listener_v3_ListenerFilterChainMatchPredicate_mutable_and_match(envoy_config_listener_v3_ListenerFilterChainMatchPredicate *msg, upb_arena *arena) {
+ struct envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet* sub = (struct envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet*)envoy_config_listener_v3_ListenerFilterChainMatchPredicate_and_match(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet*)_upb_msg_new(&envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_listener_v3_ListenerFilterChainMatchPredicate_set_and_match(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_listener_v3_ListenerFilterChainMatchPredicate_set_not_match(envoy_config_listener_v3_ListenerFilterChainMatchPredicate *msg, envoy_config_listener_v3_ListenerFilterChainMatchPredicate* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_listener_v3_ListenerFilterChainMatchPredicate*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 3);
+}
+UPB_INLINE struct envoy_config_listener_v3_ListenerFilterChainMatchPredicate* envoy_config_listener_v3_ListenerFilterChainMatchPredicate_mutable_not_match(envoy_config_listener_v3_ListenerFilterChainMatchPredicate *msg, upb_arena *arena) {
+ struct envoy_config_listener_v3_ListenerFilterChainMatchPredicate* sub = (struct envoy_config_listener_v3_ListenerFilterChainMatchPredicate*)envoy_config_listener_v3_ListenerFilterChainMatchPredicate_not_match(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_listener_v3_ListenerFilterChainMatchPredicate*)_upb_msg_new(&envoy_config_listener_v3_ListenerFilterChainMatchPredicate_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_listener_v3_ListenerFilterChainMatchPredicate_set_not_match(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_listener_v3_ListenerFilterChainMatchPredicate_set_any_match(envoy_config_listener_v3_ListenerFilterChainMatchPredicate *msg, bool value) {
+ UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 4);
+}
+UPB_INLINE void envoy_config_listener_v3_ListenerFilterChainMatchPredicate_set_destination_port_range(envoy_config_listener_v3_ListenerFilterChainMatchPredicate *msg, struct envoy_type_v3_Int32Range* value) {
+ UPB_WRITE_ONEOF(msg, struct envoy_type_v3_Int32Range*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 5);
+}
+UPB_INLINE struct envoy_type_v3_Int32Range* envoy_config_listener_v3_ListenerFilterChainMatchPredicate_mutable_destination_port_range(envoy_config_listener_v3_ListenerFilterChainMatchPredicate *msg, upb_arena *arena) {
+ struct envoy_type_v3_Int32Range* sub = (struct envoy_type_v3_Int32Range*)envoy_config_listener_v3_ListenerFilterChainMatchPredicate_destination_port_range(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_type_v3_Int32Range*)_upb_msg_new(&envoy_type_v3_Int32Range_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_listener_v3_ListenerFilterChainMatchPredicate_set_destination_port_range(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.listener.v3.ListenerFilterChainMatchPredicate.MatchSet */
+
+UPB_INLINE envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet *envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_new(upb_arena *arena) {
+ return (envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet *)_upb_msg_new(&envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_msginit, arena);
+}
+UPB_INLINE envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet *envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet *ret = envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_serialize(const envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_has_rules(const envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE const envoy_config_listener_v3_ListenerFilterChainMatchPredicate* const* envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_rules(const envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet *msg, size_t *len) { return (const envoy_config_listener_v3_ListenerFilterChainMatchPredicate* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
+
+UPB_INLINE envoy_config_listener_v3_ListenerFilterChainMatchPredicate** envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_mutable_rules(envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet *msg, size_t *len) {
+ return (envoy_config_listener_v3_ListenerFilterChainMatchPredicate**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
+}
+UPB_INLINE envoy_config_listener_v3_ListenerFilterChainMatchPredicate** envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_resize_rules(envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet *msg, size_t len, upb_arena *arena) {
+ return (envoy_config_listener_v3_ListenerFilterChainMatchPredicate**)_upb_array_resize_accessor(msg, UPB_SIZE(0, 0), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_config_listener_v3_ListenerFilterChainMatchPredicate* envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_add_rules(envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet *msg, upb_arena *arena) {
+ struct envoy_config_listener_v3_ListenerFilterChainMatchPredicate* sub = (struct envoy_config_listener_v3_ListenerFilterChainMatchPredicate*)_upb_msg_new(&envoy_config_listener_v3_ListenerFilterChainMatchPredicate_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(0, 0), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+
+/* envoy.config.listener.v3.ListenerFilter */
+
+UPB_INLINE envoy_config_listener_v3_ListenerFilter *envoy_config_listener_v3_ListenerFilter_new(upb_arena *arena) {
+ return (envoy_config_listener_v3_ListenerFilter *)_upb_msg_new(&envoy_config_listener_v3_ListenerFilter_msginit, arena);
+}
+UPB_INLINE envoy_config_listener_v3_ListenerFilter *envoy_config_listener_v3_ListenerFilter_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_listener_v3_ListenerFilter *ret = envoy_config_listener_v3_ListenerFilter_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_listener_v3_ListenerFilter_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_listener_v3_ListenerFilter_serialize(const envoy_config_listener_v3_ListenerFilter *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_listener_v3_ListenerFilter_msginit, arena, len);
+}
+
+typedef enum {
+ envoy_config_listener_v3_ListenerFilter_config_type_typed_config = 3,
+ envoy_config_listener_v3_ListenerFilter_config_type_NOT_SET = 0
+} envoy_config_listener_v3_ListenerFilter_config_type_oneofcases;
+UPB_INLINE envoy_config_listener_v3_ListenerFilter_config_type_oneofcases envoy_config_listener_v3_ListenerFilter_config_type_case(const envoy_config_listener_v3_ListenerFilter* msg) { return (envoy_config_listener_v3_ListenerFilter_config_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(16, 32), int32_t); }
+
+UPB_INLINE upb_strview envoy_config_listener_v3_ListenerFilter_name(const envoy_config_listener_v3_ListenerFilter *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE bool envoy_config_listener_v3_ListenerFilter_has_typed_config(const envoy_config_listener_v3_ListenerFilter *msg) { return _upb_getoneofcase(msg, UPB_SIZE(16, 32)) == 3; }
+UPB_INLINE const struct google_protobuf_Any* envoy_config_listener_v3_ListenerFilter_typed_config(const envoy_config_listener_v3_ListenerFilter *msg) { return UPB_READ_ONEOF(msg, const struct google_protobuf_Any*, UPB_SIZE(12, 24), UPB_SIZE(16, 32), 3, NULL); }
+UPB_INLINE bool envoy_config_listener_v3_ListenerFilter_has_filter_disabled(const envoy_config_listener_v3_ListenerFilter *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
+UPB_INLINE const envoy_config_listener_v3_ListenerFilterChainMatchPredicate* envoy_config_listener_v3_ListenerFilter_filter_disabled(const envoy_config_listener_v3_ListenerFilter *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const envoy_config_listener_v3_ListenerFilterChainMatchPredicate*); }
+
+UPB_INLINE void envoy_config_listener_v3_ListenerFilter_set_name(envoy_config_listener_v3_ListenerFilter *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_listener_v3_ListenerFilter_set_typed_config(envoy_config_listener_v3_ListenerFilter *msg, struct google_protobuf_Any* value) {
+ UPB_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(12, 24), value, UPB_SIZE(16, 32), 3);
+}
+UPB_INLINE struct google_protobuf_Any* envoy_config_listener_v3_ListenerFilter_mutable_typed_config(envoy_config_listener_v3_ListenerFilter *msg, upb_arena *arena) {
+ struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_config_listener_v3_ListenerFilter_typed_config(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_listener_v3_ListenerFilter_set_typed_config(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_listener_v3_ListenerFilter_set_filter_disabled(envoy_config_listener_v3_ListenerFilter *msg, envoy_config_listener_v3_ListenerFilterChainMatchPredicate* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), envoy_config_listener_v3_ListenerFilterChainMatchPredicate*) = value;
+}
+UPB_INLINE struct envoy_config_listener_v3_ListenerFilterChainMatchPredicate* envoy_config_listener_v3_ListenerFilter_mutable_filter_disabled(envoy_config_listener_v3_ListenerFilter *msg, upb_arena *arena) {
+ struct envoy_config_listener_v3_ListenerFilterChainMatchPredicate* sub = (struct envoy_config_listener_v3_ListenerFilterChainMatchPredicate*)envoy_config_listener_v3_ListenerFilter_filter_disabled(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_listener_v3_ListenerFilterChainMatchPredicate*)_upb_msg_new(&envoy_config_listener_v3_ListenerFilterChainMatchPredicate_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_listener_v3_ListenerFilter_set_filter_disabled(msg, sub);
+ }
+ return sub;
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_CONFIG_LISTENER_V3_LISTENER_COMPONENTS_PROTO_UPB_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.c
index 732b6227637..67a5dded23a 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.c
@@ -1,41 +1,41 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/config/listener/v3/udp_listener_config.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include <stddef.h>
-#include "upb/msg.h"
-#include "envoy/config/listener/v3/udp_listener_config.upb.h"
-#include "google/protobuf/any.upb.h"
-#include "google/protobuf/struct.upb.h"
-#include "udpa/annotations/status.upb.h"
-#include "udpa/annotations/versioning.upb.h"
-
-#include "upb/port_def.inc"
-
-static const upb_msglayout *const envoy_config_listener_v3_UdpListenerConfig_submsgs[1] = {
- &google_protobuf_Any_msginit,
-};
-
-static const upb_msglayout_field envoy_config_listener_v3_UdpListenerConfig__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {3, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, 1},
-};
-
-const upb_msglayout envoy_config_listener_v3_UdpListenerConfig_msginit = {
- &envoy_config_listener_v3_UdpListenerConfig_submsgs[0],
- &envoy_config_listener_v3_UdpListenerConfig__fields[0],
- UPB_SIZE(16, 32), 2, false,
-};
-
-const upb_msglayout envoy_config_listener_v3_ActiveRawUdpListenerConfig_msginit = {
- NULL,
- NULL,
- UPB_SIZE(0, 0), 0, false,
-};
-
-#include "upb/port_undef.inc"
-
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/listener/v3/udp_listener_config.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg.h"
+#include "envoy/config/listener/v3/udp_listener_config.upb.h"
+#include "google/protobuf/any.upb.h"
+#include "google/protobuf/struct.upb.h"
+#include "udpa/annotations/status.upb.h"
+#include "udpa/annotations/versioning.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_msglayout *const envoy_config_listener_v3_UdpListenerConfig_submsgs[1] = {
+ &google_protobuf_Any_msginit,
+};
+
+static const upb_msglayout_field envoy_config_listener_v3_UdpListenerConfig__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {3, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, 1},
+};
+
+const upb_msglayout envoy_config_listener_v3_UdpListenerConfig_msginit = {
+ &envoy_config_listener_v3_UdpListenerConfig_submsgs[0],
+ &envoy_config_listener_v3_UdpListenerConfig__fields[0],
+ UPB_SIZE(16, 32), 2, false,
+};
+
+const upb_msglayout envoy_config_listener_v3_ActiveRawUdpListenerConfig_msginit = {
+ NULL,
+ NULL,
+ UPB_SIZE(0, 0), 0, false,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.h
index acb0f81960b..e7fe65a5e26 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.h
@@ -1,94 +1,94 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/config/listener/v3/udp_listener_config.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef ENVOY_CONFIG_LISTENER_V3_UDP_LISTENER_CONFIG_PROTO_UPB_H_
-#define ENVOY_CONFIG_LISTENER_V3_UDP_LISTENER_CONFIG_PROTO_UPB_H_
-
-#include "upb/msg.h"
-#include "upb/decode.h"
-#include "upb/encode.h"
-
-#include "upb/port_def.inc"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct envoy_config_listener_v3_UdpListenerConfig;
-struct envoy_config_listener_v3_ActiveRawUdpListenerConfig;
-typedef struct envoy_config_listener_v3_UdpListenerConfig envoy_config_listener_v3_UdpListenerConfig;
-typedef struct envoy_config_listener_v3_ActiveRawUdpListenerConfig envoy_config_listener_v3_ActiveRawUdpListenerConfig;
-extern const upb_msglayout envoy_config_listener_v3_UdpListenerConfig_msginit;
-extern const upb_msglayout envoy_config_listener_v3_ActiveRawUdpListenerConfig_msginit;
-struct google_protobuf_Any;
-extern const upb_msglayout google_protobuf_Any_msginit;
-
-
-/* envoy.config.listener.v3.UdpListenerConfig */
-
-UPB_INLINE envoy_config_listener_v3_UdpListenerConfig *envoy_config_listener_v3_UdpListenerConfig_new(upb_arena *arena) {
- return (envoy_config_listener_v3_UdpListenerConfig *)_upb_msg_new(&envoy_config_listener_v3_UdpListenerConfig_msginit, arena);
-}
-UPB_INLINE envoy_config_listener_v3_UdpListenerConfig *envoy_config_listener_v3_UdpListenerConfig_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_listener_v3_UdpListenerConfig *ret = envoy_config_listener_v3_UdpListenerConfig_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_listener_v3_UdpListenerConfig_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_listener_v3_UdpListenerConfig_serialize(const envoy_config_listener_v3_UdpListenerConfig *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_listener_v3_UdpListenerConfig_msginit, arena, len);
-}
-
-typedef enum {
- envoy_config_listener_v3_UdpListenerConfig_config_type_typed_config = 3,
- envoy_config_listener_v3_UdpListenerConfig_config_type_NOT_SET = 0
-} envoy_config_listener_v3_UdpListenerConfig_config_type_oneofcases;
-UPB_INLINE envoy_config_listener_v3_UdpListenerConfig_config_type_oneofcases envoy_config_listener_v3_UdpListenerConfig_config_type_case(const envoy_config_listener_v3_UdpListenerConfig* msg) { return (envoy_config_listener_v3_UdpListenerConfig_config_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(12, 24), int32_t); }
-
-UPB_INLINE upb_strview envoy_config_listener_v3_UdpListenerConfig_udp_listener_name(const envoy_config_listener_v3_UdpListenerConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE bool envoy_config_listener_v3_UdpListenerConfig_has_typed_config(const envoy_config_listener_v3_UdpListenerConfig *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 3; }
-UPB_INLINE const struct google_protobuf_Any* envoy_config_listener_v3_UdpListenerConfig_typed_config(const envoy_config_listener_v3_UdpListenerConfig *msg) { return UPB_READ_ONEOF(msg, const struct google_protobuf_Any*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 3, NULL); }
-
-UPB_INLINE void envoy_config_listener_v3_UdpListenerConfig_set_udp_listener_name(envoy_config_listener_v3_UdpListenerConfig *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_listener_v3_UdpListenerConfig_set_typed_config(envoy_config_listener_v3_UdpListenerConfig *msg, struct google_protobuf_Any* value) {
- UPB_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 3);
-}
-UPB_INLINE struct google_protobuf_Any* envoy_config_listener_v3_UdpListenerConfig_mutable_typed_config(envoy_config_listener_v3_UdpListenerConfig *msg, upb_arena *arena) {
- struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_config_listener_v3_UdpListenerConfig_typed_config(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena);
- if (!sub) return NULL;
- envoy_config_listener_v3_UdpListenerConfig_set_typed_config(msg, sub);
- }
- return sub;
-}
-
-/* envoy.config.listener.v3.ActiveRawUdpListenerConfig */
-
-UPB_INLINE envoy_config_listener_v3_ActiveRawUdpListenerConfig *envoy_config_listener_v3_ActiveRawUdpListenerConfig_new(upb_arena *arena) {
- return (envoy_config_listener_v3_ActiveRawUdpListenerConfig *)_upb_msg_new(&envoy_config_listener_v3_ActiveRawUdpListenerConfig_msginit, arena);
-}
-UPB_INLINE envoy_config_listener_v3_ActiveRawUdpListenerConfig *envoy_config_listener_v3_ActiveRawUdpListenerConfig_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_listener_v3_ActiveRawUdpListenerConfig *ret = envoy_config_listener_v3_ActiveRawUdpListenerConfig_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_listener_v3_ActiveRawUdpListenerConfig_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_listener_v3_ActiveRawUdpListenerConfig_serialize(const envoy_config_listener_v3_ActiveRawUdpListenerConfig *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_listener_v3_ActiveRawUdpListenerConfig_msginit, arena, len);
-}
-
-
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* ENVOY_CONFIG_LISTENER_V3_UDP_LISTENER_CONFIG_PROTO_UPB_H_ */
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/listener/v3/udp_listener_config.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_CONFIG_LISTENER_V3_UDP_LISTENER_CONFIG_PROTO_UPB_H_
+#define ENVOY_CONFIG_LISTENER_V3_UDP_LISTENER_CONFIG_PROTO_UPB_H_
+
+#include "upb/msg.h"
+#include "upb/decode.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_config_listener_v3_UdpListenerConfig;
+struct envoy_config_listener_v3_ActiveRawUdpListenerConfig;
+typedef struct envoy_config_listener_v3_UdpListenerConfig envoy_config_listener_v3_UdpListenerConfig;
+typedef struct envoy_config_listener_v3_ActiveRawUdpListenerConfig envoy_config_listener_v3_ActiveRawUdpListenerConfig;
+extern const upb_msglayout envoy_config_listener_v3_UdpListenerConfig_msginit;
+extern const upb_msglayout envoy_config_listener_v3_ActiveRawUdpListenerConfig_msginit;
+struct google_protobuf_Any;
+extern const upb_msglayout google_protobuf_Any_msginit;
+
+
+/* envoy.config.listener.v3.UdpListenerConfig */
+
+UPB_INLINE envoy_config_listener_v3_UdpListenerConfig *envoy_config_listener_v3_UdpListenerConfig_new(upb_arena *arena) {
+ return (envoy_config_listener_v3_UdpListenerConfig *)_upb_msg_new(&envoy_config_listener_v3_UdpListenerConfig_msginit, arena);
+}
+UPB_INLINE envoy_config_listener_v3_UdpListenerConfig *envoy_config_listener_v3_UdpListenerConfig_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_listener_v3_UdpListenerConfig *ret = envoy_config_listener_v3_UdpListenerConfig_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_listener_v3_UdpListenerConfig_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_listener_v3_UdpListenerConfig_serialize(const envoy_config_listener_v3_UdpListenerConfig *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_listener_v3_UdpListenerConfig_msginit, arena, len);
+}
+
+typedef enum {
+ envoy_config_listener_v3_UdpListenerConfig_config_type_typed_config = 3,
+ envoy_config_listener_v3_UdpListenerConfig_config_type_NOT_SET = 0
+} envoy_config_listener_v3_UdpListenerConfig_config_type_oneofcases;
+UPB_INLINE envoy_config_listener_v3_UdpListenerConfig_config_type_oneofcases envoy_config_listener_v3_UdpListenerConfig_config_type_case(const envoy_config_listener_v3_UdpListenerConfig* msg) { return (envoy_config_listener_v3_UdpListenerConfig_config_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(12, 24), int32_t); }
+
+UPB_INLINE upb_strview envoy_config_listener_v3_UdpListenerConfig_udp_listener_name(const envoy_config_listener_v3_UdpListenerConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE bool envoy_config_listener_v3_UdpListenerConfig_has_typed_config(const envoy_config_listener_v3_UdpListenerConfig *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 3; }
+UPB_INLINE const struct google_protobuf_Any* envoy_config_listener_v3_UdpListenerConfig_typed_config(const envoy_config_listener_v3_UdpListenerConfig *msg) { return UPB_READ_ONEOF(msg, const struct google_protobuf_Any*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 3, NULL); }
+
+UPB_INLINE void envoy_config_listener_v3_UdpListenerConfig_set_udp_listener_name(envoy_config_listener_v3_UdpListenerConfig *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_listener_v3_UdpListenerConfig_set_typed_config(envoy_config_listener_v3_UdpListenerConfig *msg, struct google_protobuf_Any* value) {
+ UPB_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 3);
+}
+UPB_INLINE struct google_protobuf_Any* envoy_config_listener_v3_UdpListenerConfig_mutable_typed_config(envoy_config_listener_v3_UdpListenerConfig *msg, upb_arena *arena) {
+ struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_config_listener_v3_UdpListenerConfig_typed_config(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_listener_v3_UdpListenerConfig_set_typed_config(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.listener.v3.ActiveRawUdpListenerConfig */
+
+UPB_INLINE envoy_config_listener_v3_ActiveRawUdpListenerConfig *envoy_config_listener_v3_ActiveRawUdpListenerConfig_new(upb_arena *arena) {
+ return (envoy_config_listener_v3_ActiveRawUdpListenerConfig *)_upb_msg_new(&envoy_config_listener_v3_ActiveRawUdpListenerConfig_msginit, arena);
+}
+UPB_INLINE envoy_config_listener_v3_ActiveRawUdpListenerConfig *envoy_config_listener_v3_ActiveRawUdpListenerConfig_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_listener_v3_ActiveRawUdpListenerConfig *ret = envoy_config_listener_v3_ActiveRawUdpListenerConfig_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_listener_v3_ActiveRawUdpListenerConfig_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_listener_v3_ActiveRawUdpListenerConfig_serialize(const envoy_config_listener_v3_ActiveRawUdpListenerConfig *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_listener_v3_ActiveRawUdpListenerConfig_msginit, arena, len);
+}
+
+
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_CONFIG_LISTENER_V3_UDP_LISTENER_CONFIG_PROTO_UPB_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.c
index 90485ff7818..bf4f865f8ea 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.c
@@ -1,178 +1,178 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/config/rbac/v3/rbac.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include <stddef.h>
-#include "upb/msg.h"
-#include "envoy/config/rbac/v3/rbac.upb.h"
-#include "envoy/config/core/v3/address.upb.h"
-#include "envoy/config/route/v3/route_components.upb.h"
-#include "envoy/type/matcher/v3/metadata.upb.h"
-#include "envoy/type/matcher/v3/path.upb.h"
-#include "envoy/type/matcher/v3/string.upb.h"
-#include "google/api/expr/v1alpha1/checked.upb.h"
-#include "google/api/expr/v1alpha1/syntax.upb.h"
-#include "udpa/annotations/migrate.upb.h"
-#include "udpa/annotations/status.upb.h"
-#include "udpa/annotations/versioning.upb.h"
-#include "validate/validate.upb.h"
-
-#include "upb/port_def.inc"
-
-static const upb_msglayout *const envoy_config_rbac_v3_RBAC_submsgs[1] = {
- &envoy_config_rbac_v3_RBAC_PoliciesEntry_msginit,
-};
-
-static const upb_msglayout_field envoy_config_rbac_v3_RBAC__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 14, 1},
- {2, UPB_SIZE(8, 8), 0, 0, 11, _UPB_LABEL_MAP},
-};
-
-const upb_msglayout envoy_config_rbac_v3_RBAC_msginit = {
- &envoy_config_rbac_v3_RBAC_submsgs[0],
- &envoy_config_rbac_v3_RBAC__fields[0],
- UPB_SIZE(16, 16), 2, false,
-};
-
-static const upb_msglayout *const envoy_config_rbac_v3_RBAC_PoliciesEntry_submsgs[1] = {
- &envoy_config_rbac_v3_Policy_msginit,
-};
-
-static const upb_msglayout_field envoy_config_rbac_v3_RBAC_PoliciesEntry__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 11, 1},
-};
-
-const upb_msglayout envoy_config_rbac_v3_RBAC_PoliciesEntry_msginit = {
- &envoy_config_rbac_v3_RBAC_PoliciesEntry_submsgs[0],
- &envoy_config_rbac_v3_RBAC_PoliciesEntry__fields[0],
- UPB_SIZE(16, 32), 2, false,
-};
-
-static const upb_msglayout *const envoy_config_rbac_v3_Policy_submsgs[4] = {
- &envoy_config_rbac_v3_Permission_msginit,
- &envoy_config_rbac_v3_Principal_msginit,
- &google_api_expr_v1alpha1_CheckedExpr_msginit,
- &google_api_expr_v1alpha1_Expr_msginit,
-};
-
-static const upb_msglayout_field envoy_config_rbac_v3_Policy__fields[4] = {
- {1, UPB_SIZE(8, 16), 0, 0, 11, 3},
- {2, UPB_SIZE(12, 24), 0, 1, 11, 3},
- {3, UPB_SIZE(0, 0), 0, 3, 11, 1},
- {4, UPB_SIZE(4, 8), 0, 2, 11, 1},
-};
-
-const upb_msglayout envoy_config_rbac_v3_Policy_msginit = {
- &envoy_config_rbac_v3_Policy_submsgs[0],
- &envoy_config_rbac_v3_Policy__fields[0],
- UPB_SIZE(16, 32), 4, false,
-};
-
-static const upb_msglayout *const envoy_config_rbac_v3_Permission_submsgs[8] = {
- &envoy_config_core_v3_CidrRange_msginit,
- &envoy_config_rbac_v3_Permission_msginit,
- &envoy_config_rbac_v3_Permission_Set_msginit,
- &envoy_config_route_v3_HeaderMatcher_msginit,
- &envoy_type_matcher_v3_MetadataMatcher_msginit,
- &envoy_type_matcher_v3_PathMatcher_msginit,
- &envoy_type_matcher_v3_StringMatcher_msginit,
-};
-
-static const upb_msglayout_field envoy_config_rbac_v3_Permission__fields[10] = {
- {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 2, 11, 1},
- {2, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 2, 11, 1},
- {3, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 8, 1},
- {4, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 3, 11, 1},
- {5, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, 1},
- {6, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 13, 1},
- {7, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 4, 11, 1},
- {8, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 1, 11, 1},
- {9, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 6, 11, 1},
- {10, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 5, 11, 1},
-};
-
-const upb_msglayout envoy_config_rbac_v3_Permission_msginit = {
- &envoy_config_rbac_v3_Permission_submsgs[0],
- &envoy_config_rbac_v3_Permission__fields[0],
- UPB_SIZE(8, 16), 10, false,
-};
-
-static const upb_msglayout *const envoy_config_rbac_v3_Permission_Set_submsgs[1] = {
- &envoy_config_rbac_v3_Permission_msginit,
-};
-
-static const upb_msglayout_field envoy_config_rbac_v3_Permission_Set__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 3},
-};
-
-const upb_msglayout envoy_config_rbac_v3_Permission_Set_msginit = {
- &envoy_config_rbac_v3_Permission_Set_submsgs[0],
- &envoy_config_rbac_v3_Permission_Set__fields[0],
- UPB_SIZE(4, 8), 1, false,
-};
-
-static const upb_msglayout *const envoy_config_rbac_v3_Principal_submsgs[10] = {
- &envoy_config_core_v3_CidrRange_msginit,
- &envoy_config_rbac_v3_Principal_msginit,
- &envoy_config_rbac_v3_Principal_Authenticated_msginit,
- &envoy_config_rbac_v3_Principal_Set_msginit,
- &envoy_config_route_v3_HeaderMatcher_msginit,
- &envoy_type_matcher_v3_MetadataMatcher_msginit,
- &envoy_type_matcher_v3_PathMatcher_msginit,
-};
-
-static const upb_msglayout_field envoy_config_rbac_v3_Principal__fields[11] = {
- {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 3, 11, 1},
- {2, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 3, 11, 1},
- {3, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 8, 1},
- {4, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 2, 11, 1},
- {5, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, 1},
- {6, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 4, 11, 1},
- {7, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 5, 11, 1},
- {8, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 1, 11, 1},
- {9, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 6, 11, 1},
- {10, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, 1},
- {11, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, 1},
-};
-
-const upb_msglayout envoy_config_rbac_v3_Principal_msginit = {
- &envoy_config_rbac_v3_Principal_submsgs[0],
- &envoy_config_rbac_v3_Principal__fields[0],
- UPB_SIZE(8, 16), 11, false,
-};
-
-static const upb_msglayout *const envoy_config_rbac_v3_Principal_Set_submsgs[1] = {
- &envoy_config_rbac_v3_Principal_msginit,
-};
-
-static const upb_msglayout_field envoy_config_rbac_v3_Principal_Set__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 3},
-};
-
-const upb_msglayout envoy_config_rbac_v3_Principal_Set_msginit = {
- &envoy_config_rbac_v3_Principal_Set_submsgs[0],
- &envoy_config_rbac_v3_Principal_Set__fields[0],
- UPB_SIZE(4, 8), 1, false,
-};
-
-static const upb_msglayout *const envoy_config_rbac_v3_Principal_Authenticated_submsgs[1] = {
- &envoy_type_matcher_v3_StringMatcher_msginit,
-};
-
-static const upb_msglayout_field envoy_config_rbac_v3_Principal_Authenticated__fields[1] = {
- {2, UPB_SIZE(0, 0), 0, 0, 11, 1},
-};
-
-const upb_msglayout envoy_config_rbac_v3_Principal_Authenticated_msginit = {
- &envoy_config_rbac_v3_Principal_Authenticated_submsgs[0],
- &envoy_config_rbac_v3_Principal_Authenticated__fields[0],
- UPB_SIZE(4, 8), 1, false,
-};
-
-#include "upb/port_undef.inc"
-
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/rbac/v3/rbac.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg.h"
+#include "envoy/config/rbac/v3/rbac.upb.h"
+#include "envoy/config/core/v3/address.upb.h"
+#include "envoy/config/route/v3/route_components.upb.h"
+#include "envoy/type/matcher/v3/metadata.upb.h"
+#include "envoy/type/matcher/v3/path.upb.h"
+#include "envoy/type/matcher/v3/string.upb.h"
+#include "google/api/expr/v1alpha1/checked.upb.h"
+#include "google/api/expr/v1alpha1/syntax.upb.h"
+#include "udpa/annotations/migrate.upb.h"
+#include "udpa/annotations/status.upb.h"
+#include "udpa/annotations/versioning.upb.h"
+#include "validate/validate.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_msglayout *const envoy_config_rbac_v3_RBAC_submsgs[1] = {
+ &envoy_config_rbac_v3_RBAC_PoliciesEntry_msginit,
+};
+
+static const upb_msglayout_field envoy_config_rbac_v3_RBAC__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 14, 1},
+ {2, UPB_SIZE(8, 8), 0, 0, 11, _UPB_LABEL_MAP},
+};
+
+const upb_msglayout envoy_config_rbac_v3_RBAC_msginit = {
+ &envoy_config_rbac_v3_RBAC_submsgs[0],
+ &envoy_config_rbac_v3_RBAC__fields[0],
+ UPB_SIZE(16, 16), 2, false,
+};
+
+static const upb_msglayout *const envoy_config_rbac_v3_RBAC_PoliciesEntry_submsgs[1] = {
+ &envoy_config_rbac_v3_Policy_msginit,
+};
+
+static const upb_msglayout_field envoy_config_rbac_v3_RBAC_PoliciesEntry__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {2, UPB_SIZE(8, 16), 0, 0, 11, 1},
+};
+
+const upb_msglayout envoy_config_rbac_v3_RBAC_PoliciesEntry_msginit = {
+ &envoy_config_rbac_v3_RBAC_PoliciesEntry_submsgs[0],
+ &envoy_config_rbac_v3_RBAC_PoliciesEntry__fields[0],
+ UPB_SIZE(16, 32), 2, false,
+};
+
+static const upb_msglayout *const envoy_config_rbac_v3_Policy_submsgs[4] = {
+ &envoy_config_rbac_v3_Permission_msginit,
+ &envoy_config_rbac_v3_Principal_msginit,
+ &google_api_expr_v1alpha1_CheckedExpr_msginit,
+ &google_api_expr_v1alpha1_Expr_msginit,
+};
+
+static const upb_msglayout_field envoy_config_rbac_v3_Policy__fields[4] = {
+ {1, UPB_SIZE(8, 16), 0, 0, 11, 3},
+ {2, UPB_SIZE(12, 24), 0, 1, 11, 3},
+ {3, UPB_SIZE(0, 0), 0, 3, 11, 1},
+ {4, UPB_SIZE(4, 8), 0, 2, 11, 1},
+};
+
+const upb_msglayout envoy_config_rbac_v3_Policy_msginit = {
+ &envoy_config_rbac_v3_Policy_submsgs[0],
+ &envoy_config_rbac_v3_Policy__fields[0],
+ UPB_SIZE(16, 32), 4, false,
+};
+
+static const upb_msglayout *const envoy_config_rbac_v3_Permission_submsgs[8] = {
+ &envoy_config_core_v3_CidrRange_msginit,
+ &envoy_config_rbac_v3_Permission_msginit,
+ &envoy_config_rbac_v3_Permission_Set_msginit,
+ &envoy_config_route_v3_HeaderMatcher_msginit,
+ &envoy_type_matcher_v3_MetadataMatcher_msginit,
+ &envoy_type_matcher_v3_PathMatcher_msginit,
+ &envoy_type_matcher_v3_StringMatcher_msginit,
+};
+
+static const upb_msglayout_field envoy_config_rbac_v3_Permission__fields[10] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 2, 11, 1},
+ {2, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 2, 11, 1},
+ {3, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 8, 1},
+ {4, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 3, 11, 1},
+ {5, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, 1},
+ {6, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 13, 1},
+ {7, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 4, 11, 1},
+ {8, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 1, 11, 1},
+ {9, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 6, 11, 1},
+ {10, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 5, 11, 1},
+};
+
+const upb_msglayout envoy_config_rbac_v3_Permission_msginit = {
+ &envoy_config_rbac_v3_Permission_submsgs[0],
+ &envoy_config_rbac_v3_Permission__fields[0],
+ UPB_SIZE(8, 16), 10, false,
+};
+
+static const upb_msglayout *const envoy_config_rbac_v3_Permission_Set_submsgs[1] = {
+ &envoy_config_rbac_v3_Permission_msginit,
+};
+
+static const upb_msglayout_field envoy_config_rbac_v3_Permission_Set__fields[1] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 11, 3},
+};
+
+const upb_msglayout envoy_config_rbac_v3_Permission_Set_msginit = {
+ &envoy_config_rbac_v3_Permission_Set_submsgs[0],
+ &envoy_config_rbac_v3_Permission_Set__fields[0],
+ UPB_SIZE(4, 8), 1, false,
+};
+
+static const upb_msglayout *const envoy_config_rbac_v3_Principal_submsgs[10] = {
+ &envoy_config_core_v3_CidrRange_msginit,
+ &envoy_config_rbac_v3_Principal_msginit,
+ &envoy_config_rbac_v3_Principal_Authenticated_msginit,
+ &envoy_config_rbac_v3_Principal_Set_msginit,
+ &envoy_config_route_v3_HeaderMatcher_msginit,
+ &envoy_type_matcher_v3_MetadataMatcher_msginit,
+ &envoy_type_matcher_v3_PathMatcher_msginit,
+};
+
+static const upb_msglayout_field envoy_config_rbac_v3_Principal__fields[11] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 3, 11, 1},
+ {2, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 3, 11, 1},
+ {3, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 8, 1},
+ {4, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 2, 11, 1},
+ {5, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, 1},
+ {6, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 4, 11, 1},
+ {7, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 5, 11, 1},
+ {8, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 1, 11, 1},
+ {9, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 6, 11, 1},
+ {10, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, 1},
+ {11, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, 1},
+};
+
+const upb_msglayout envoy_config_rbac_v3_Principal_msginit = {
+ &envoy_config_rbac_v3_Principal_submsgs[0],
+ &envoy_config_rbac_v3_Principal__fields[0],
+ UPB_SIZE(8, 16), 11, false,
+};
+
+static const upb_msglayout *const envoy_config_rbac_v3_Principal_Set_submsgs[1] = {
+ &envoy_config_rbac_v3_Principal_msginit,
+};
+
+static const upb_msglayout_field envoy_config_rbac_v3_Principal_Set__fields[1] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 11, 3},
+};
+
+const upb_msglayout envoy_config_rbac_v3_Principal_Set_msginit = {
+ &envoy_config_rbac_v3_Principal_Set_submsgs[0],
+ &envoy_config_rbac_v3_Principal_Set__fields[0],
+ UPB_SIZE(4, 8), 1, false,
+};
+
+static const upb_msglayout *const envoy_config_rbac_v3_Principal_Authenticated_submsgs[1] = {
+ &envoy_type_matcher_v3_StringMatcher_msginit,
+};
+
+static const upb_msglayout_field envoy_config_rbac_v3_Principal_Authenticated__fields[1] = {
+ {2, UPB_SIZE(0, 0), 0, 0, 11, 1},
+};
+
+const upb_msglayout envoy_config_rbac_v3_Principal_Authenticated_msginit = {
+ &envoy_config_rbac_v3_Principal_Authenticated_submsgs[0],
+ &envoy_config_rbac_v3_Principal_Authenticated__fields[0],
+ UPB_SIZE(4, 8), 1, false,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.h
index 048f7c761a0..b5a3c558d63 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.h
@@ -1,616 +1,616 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/config/rbac/v3/rbac.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef ENVOY_CONFIG_RBAC_V3_RBAC_PROTO_UPB_H_
-#define ENVOY_CONFIG_RBAC_V3_RBAC_PROTO_UPB_H_
-
-#include "upb/msg.h"
-#include "upb/decode.h"
-#include "upb/encode.h"
-
-#include "upb/port_def.inc"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct envoy_config_rbac_v3_RBAC;
-struct envoy_config_rbac_v3_RBAC_PoliciesEntry;
-struct envoy_config_rbac_v3_Policy;
-struct envoy_config_rbac_v3_Permission;
-struct envoy_config_rbac_v3_Permission_Set;
-struct envoy_config_rbac_v3_Principal;
-struct envoy_config_rbac_v3_Principal_Set;
-struct envoy_config_rbac_v3_Principal_Authenticated;
-typedef struct envoy_config_rbac_v3_RBAC envoy_config_rbac_v3_RBAC;
-typedef struct envoy_config_rbac_v3_RBAC_PoliciesEntry envoy_config_rbac_v3_RBAC_PoliciesEntry;
-typedef struct envoy_config_rbac_v3_Policy envoy_config_rbac_v3_Policy;
-typedef struct envoy_config_rbac_v3_Permission envoy_config_rbac_v3_Permission;
-typedef struct envoy_config_rbac_v3_Permission_Set envoy_config_rbac_v3_Permission_Set;
-typedef struct envoy_config_rbac_v3_Principal envoy_config_rbac_v3_Principal;
-typedef struct envoy_config_rbac_v3_Principal_Set envoy_config_rbac_v3_Principal_Set;
-typedef struct envoy_config_rbac_v3_Principal_Authenticated envoy_config_rbac_v3_Principal_Authenticated;
-extern const upb_msglayout envoy_config_rbac_v3_RBAC_msginit;
-extern const upb_msglayout envoy_config_rbac_v3_RBAC_PoliciesEntry_msginit;
-extern const upb_msglayout envoy_config_rbac_v3_Policy_msginit;
-extern const upb_msglayout envoy_config_rbac_v3_Permission_msginit;
-extern const upb_msglayout envoy_config_rbac_v3_Permission_Set_msginit;
-extern const upb_msglayout envoy_config_rbac_v3_Principal_msginit;
-extern const upb_msglayout envoy_config_rbac_v3_Principal_Set_msginit;
-extern const upb_msglayout envoy_config_rbac_v3_Principal_Authenticated_msginit;
-struct envoy_config_core_v3_CidrRange;
-struct envoy_config_route_v3_HeaderMatcher;
-struct envoy_type_matcher_v3_MetadataMatcher;
-struct envoy_type_matcher_v3_PathMatcher;
-struct envoy_type_matcher_v3_StringMatcher;
-struct google_api_expr_v1alpha1_CheckedExpr;
-struct google_api_expr_v1alpha1_Expr;
-extern const upb_msglayout envoy_config_core_v3_CidrRange_msginit;
-extern const upb_msglayout envoy_config_route_v3_HeaderMatcher_msginit;
-extern const upb_msglayout envoy_type_matcher_v3_MetadataMatcher_msginit;
-extern const upb_msglayout envoy_type_matcher_v3_PathMatcher_msginit;
-extern const upb_msglayout envoy_type_matcher_v3_StringMatcher_msginit;
-extern const upb_msglayout google_api_expr_v1alpha1_CheckedExpr_msginit;
-extern const upb_msglayout google_api_expr_v1alpha1_Expr_msginit;
-
-typedef enum {
- envoy_config_rbac_v3_RBAC_ALLOW = 0,
- envoy_config_rbac_v3_RBAC_DENY = 1,
- envoy_config_rbac_v3_RBAC_LOG = 2
-} envoy_config_rbac_v3_RBAC_Action;
-
-
-/* envoy.config.rbac.v3.RBAC */
-
-UPB_INLINE envoy_config_rbac_v3_RBAC *envoy_config_rbac_v3_RBAC_new(upb_arena *arena) {
- return (envoy_config_rbac_v3_RBAC *)_upb_msg_new(&envoy_config_rbac_v3_RBAC_msginit, arena);
-}
-UPB_INLINE envoy_config_rbac_v3_RBAC *envoy_config_rbac_v3_RBAC_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_rbac_v3_RBAC *ret = envoy_config_rbac_v3_RBAC_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_rbac_v3_RBAC_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_rbac_v3_RBAC_serialize(const envoy_config_rbac_v3_RBAC *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_rbac_v3_RBAC_msginit, arena, len);
-}
-
-UPB_INLINE int32_t envoy_config_rbac_v3_RBAC_action(const envoy_config_rbac_v3_RBAC *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
-UPB_INLINE bool envoy_config_rbac_v3_RBAC_has_policies(const envoy_config_rbac_v3_RBAC *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 8)); }
-UPB_INLINE size_t envoy_config_rbac_v3_RBAC_policies_size(const envoy_config_rbac_v3_RBAC *msg) {return _upb_msg_map_size(msg, UPB_SIZE(8, 8)); }
-UPB_INLINE bool envoy_config_rbac_v3_RBAC_policies_get(const envoy_config_rbac_v3_RBAC *msg, upb_strview key, envoy_config_rbac_v3_Policy* *val) { return _upb_msg_map_get(msg, UPB_SIZE(8, 8), &key, 0, val, sizeof(*val)); }
-UPB_INLINE const envoy_config_rbac_v3_RBAC_PoliciesEntry* envoy_config_rbac_v3_RBAC_policies_next(const envoy_config_rbac_v3_RBAC *msg, size_t* iter) { return (const envoy_config_rbac_v3_RBAC_PoliciesEntry*)_upb_msg_map_next(msg, UPB_SIZE(8, 8), iter); }
-
-UPB_INLINE void envoy_config_rbac_v3_RBAC_set_action(envoy_config_rbac_v3_RBAC *msg, int32_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
-}
-UPB_INLINE void envoy_config_rbac_v3_RBAC_policies_clear(envoy_config_rbac_v3_RBAC *msg) { _upb_msg_map_clear(msg, UPB_SIZE(8, 8)); }
-UPB_INLINE bool envoy_config_rbac_v3_RBAC_policies_set(envoy_config_rbac_v3_RBAC *msg, upb_strview key, envoy_config_rbac_v3_Policy* val, upb_arena *a) { return _upb_msg_map_set(msg, UPB_SIZE(8, 8), &key, 0, &val, sizeof(val), a); }
-UPB_INLINE bool envoy_config_rbac_v3_RBAC_policies_delete(envoy_config_rbac_v3_RBAC *msg, upb_strview key) { return _upb_msg_map_delete(msg, UPB_SIZE(8, 8), &key, 0); }
-UPB_INLINE envoy_config_rbac_v3_RBAC_PoliciesEntry* envoy_config_rbac_v3_RBAC_policies_nextmutable(envoy_config_rbac_v3_RBAC *msg, size_t* iter) { return (envoy_config_rbac_v3_RBAC_PoliciesEntry*)_upb_msg_map_next(msg, UPB_SIZE(8, 8), iter); }
-
-/* envoy.config.rbac.v3.RBAC.PoliciesEntry */
-
-UPB_INLINE upb_strview envoy_config_rbac_v3_RBAC_PoliciesEntry_key(const envoy_config_rbac_v3_RBAC_PoliciesEntry *msg) {
- upb_strview ret;
- _upb_msg_map_key(msg, &ret, 0);
- return ret;
-}
-UPB_INLINE bool envoy_config_rbac_v3_RBAC_PoliciesEntry_has_value(const envoy_config_rbac_v3_RBAC_PoliciesEntry *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const envoy_config_rbac_v3_Policy* envoy_config_rbac_v3_RBAC_PoliciesEntry_value(const envoy_config_rbac_v3_RBAC_PoliciesEntry *msg) {
- envoy_config_rbac_v3_Policy* ret;
- _upb_msg_map_value(msg, &ret, sizeof(ret));
- return ret;
-}
-
-UPB_INLINE void envoy_config_rbac_v3_RBAC_PoliciesEntry_set_value(envoy_config_rbac_v3_RBAC_PoliciesEntry *msg, envoy_config_rbac_v3_Policy* value) {
- _upb_msg_map_set_value(msg, &value, sizeof(envoy_config_rbac_v3_Policy*));
-}
-
-/* envoy.config.rbac.v3.Policy */
-
-UPB_INLINE envoy_config_rbac_v3_Policy *envoy_config_rbac_v3_Policy_new(upb_arena *arena) {
- return (envoy_config_rbac_v3_Policy *)_upb_msg_new(&envoy_config_rbac_v3_Policy_msginit, arena);
-}
-UPB_INLINE envoy_config_rbac_v3_Policy *envoy_config_rbac_v3_Policy_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_rbac_v3_Policy *ret = envoy_config_rbac_v3_Policy_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_rbac_v3_Policy_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_rbac_v3_Policy_serialize(const envoy_config_rbac_v3_Policy *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_rbac_v3_Policy_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_config_rbac_v3_Policy_has_permissions(const envoy_config_rbac_v3_Policy *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const envoy_config_rbac_v3_Permission* const* envoy_config_rbac_v3_Policy_permissions(const envoy_config_rbac_v3_Policy *msg, size_t *len) { return (const envoy_config_rbac_v3_Permission* const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len); }
-UPB_INLINE bool envoy_config_rbac_v3_Policy_has_principals(const envoy_config_rbac_v3_Policy *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
-UPB_INLINE const envoy_config_rbac_v3_Principal* const* envoy_config_rbac_v3_Policy_principals(const envoy_config_rbac_v3_Policy *msg, size_t *len) { return (const envoy_config_rbac_v3_Principal* const*)_upb_array_accessor(msg, UPB_SIZE(12, 24), len); }
-UPB_INLINE bool envoy_config_rbac_v3_Policy_has_condition(const envoy_config_rbac_v3_Policy *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE const struct google_api_expr_v1alpha1_Expr* envoy_config_rbac_v3_Policy_condition(const envoy_config_rbac_v3_Policy *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct google_api_expr_v1alpha1_Expr*); }
-UPB_INLINE bool envoy_config_rbac_v3_Policy_has_checked_condition(const envoy_config_rbac_v3_Policy *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
-UPB_INLINE const struct google_api_expr_v1alpha1_CheckedExpr* envoy_config_rbac_v3_Policy_checked_condition(const envoy_config_rbac_v3_Policy *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_api_expr_v1alpha1_CheckedExpr*); }
-
-UPB_INLINE envoy_config_rbac_v3_Permission** envoy_config_rbac_v3_Policy_mutable_permissions(envoy_config_rbac_v3_Policy *msg, size_t *len) {
- return (envoy_config_rbac_v3_Permission**)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len);
-}
-UPB_INLINE envoy_config_rbac_v3_Permission** envoy_config_rbac_v3_Policy_resize_permissions(envoy_config_rbac_v3_Policy *msg, size_t len, upb_arena *arena) {
- return (envoy_config_rbac_v3_Permission**)_upb_array_resize_accessor(msg, UPB_SIZE(8, 16), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_config_rbac_v3_Permission* envoy_config_rbac_v3_Policy_add_permissions(envoy_config_rbac_v3_Policy *msg, upb_arena *arena) {
- struct envoy_config_rbac_v3_Permission* sub = (struct envoy_config_rbac_v3_Permission*)_upb_msg_new(&envoy_config_rbac_v3_Permission_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(8, 16), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-UPB_INLINE envoy_config_rbac_v3_Principal** envoy_config_rbac_v3_Policy_mutable_principals(envoy_config_rbac_v3_Policy *msg, size_t *len) {
- return (envoy_config_rbac_v3_Principal**)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 24), len);
-}
-UPB_INLINE envoy_config_rbac_v3_Principal** envoy_config_rbac_v3_Policy_resize_principals(envoy_config_rbac_v3_Policy *msg, size_t len, upb_arena *arena) {
- return (envoy_config_rbac_v3_Principal**)_upb_array_resize_accessor(msg, UPB_SIZE(12, 24), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_config_rbac_v3_Principal* envoy_config_rbac_v3_Policy_add_principals(envoy_config_rbac_v3_Policy *msg, upb_arena *arena) {
- struct envoy_config_rbac_v3_Principal* sub = (struct envoy_config_rbac_v3_Principal*)_upb_msg_new(&envoy_config_rbac_v3_Principal_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(12, 24), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-UPB_INLINE void envoy_config_rbac_v3_Policy_set_condition(envoy_config_rbac_v3_Policy *msg, struct google_api_expr_v1alpha1_Expr* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct google_api_expr_v1alpha1_Expr*) = value;
-}
-UPB_INLINE struct google_api_expr_v1alpha1_Expr* envoy_config_rbac_v3_Policy_mutable_condition(envoy_config_rbac_v3_Policy *msg, upb_arena *arena) {
- struct google_api_expr_v1alpha1_Expr* sub = (struct google_api_expr_v1alpha1_Expr*)envoy_config_rbac_v3_Policy_condition(msg);
- if (sub == NULL) {
- sub = (struct google_api_expr_v1alpha1_Expr*)_upb_msg_new(&google_api_expr_v1alpha1_Expr_msginit, arena);
- if (!sub) return NULL;
- envoy_config_rbac_v3_Policy_set_condition(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_rbac_v3_Policy_set_checked_condition(envoy_config_rbac_v3_Policy *msg, struct google_api_expr_v1alpha1_CheckedExpr* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_api_expr_v1alpha1_CheckedExpr*) = value;
-}
-UPB_INLINE struct google_api_expr_v1alpha1_CheckedExpr* envoy_config_rbac_v3_Policy_mutable_checked_condition(envoy_config_rbac_v3_Policy *msg, upb_arena *arena) {
- struct google_api_expr_v1alpha1_CheckedExpr* sub = (struct google_api_expr_v1alpha1_CheckedExpr*)envoy_config_rbac_v3_Policy_checked_condition(msg);
- if (sub == NULL) {
- sub = (struct google_api_expr_v1alpha1_CheckedExpr*)_upb_msg_new(&google_api_expr_v1alpha1_CheckedExpr_msginit, arena);
- if (!sub) return NULL;
- envoy_config_rbac_v3_Policy_set_checked_condition(msg, sub);
- }
- return sub;
-}
-
-/* envoy.config.rbac.v3.Permission */
-
-UPB_INLINE envoy_config_rbac_v3_Permission *envoy_config_rbac_v3_Permission_new(upb_arena *arena) {
- return (envoy_config_rbac_v3_Permission *)_upb_msg_new(&envoy_config_rbac_v3_Permission_msginit, arena);
-}
-UPB_INLINE envoy_config_rbac_v3_Permission *envoy_config_rbac_v3_Permission_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_rbac_v3_Permission *ret = envoy_config_rbac_v3_Permission_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_rbac_v3_Permission_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_rbac_v3_Permission_serialize(const envoy_config_rbac_v3_Permission *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_rbac_v3_Permission_msginit, arena, len);
-}
-
-typedef enum {
- envoy_config_rbac_v3_Permission_rule_and_rules = 1,
- envoy_config_rbac_v3_Permission_rule_or_rules = 2,
- envoy_config_rbac_v3_Permission_rule_any = 3,
- envoy_config_rbac_v3_Permission_rule_header = 4,
- envoy_config_rbac_v3_Permission_rule_url_path = 10,
- envoy_config_rbac_v3_Permission_rule_destination_ip = 5,
- envoy_config_rbac_v3_Permission_rule_destination_port = 6,
- envoy_config_rbac_v3_Permission_rule_metadata = 7,
- envoy_config_rbac_v3_Permission_rule_not_rule = 8,
- envoy_config_rbac_v3_Permission_rule_requested_server_name = 9,
- envoy_config_rbac_v3_Permission_rule_NOT_SET = 0
-} envoy_config_rbac_v3_Permission_rule_oneofcases;
-UPB_INLINE envoy_config_rbac_v3_Permission_rule_oneofcases envoy_config_rbac_v3_Permission_rule_case(const envoy_config_rbac_v3_Permission* msg) { return (envoy_config_rbac_v3_Permission_rule_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 8), int32_t); }
-
-UPB_INLINE bool envoy_config_rbac_v3_Permission_has_and_rules(const envoy_config_rbac_v3_Permission *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 1; }
-UPB_INLINE const envoy_config_rbac_v3_Permission_Set* envoy_config_rbac_v3_Permission_and_rules(const envoy_config_rbac_v3_Permission *msg) { return UPB_READ_ONEOF(msg, const envoy_config_rbac_v3_Permission_Set*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 1, NULL); }
-UPB_INLINE bool envoy_config_rbac_v3_Permission_has_or_rules(const envoy_config_rbac_v3_Permission *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 2; }
-UPB_INLINE const envoy_config_rbac_v3_Permission_Set* envoy_config_rbac_v3_Permission_or_rules(const envoy_config_rbac_v3_Permission *msg) { return UPB_READ_ONEOF(msg, const envoy_config_rbac_v3_Permission_Set*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 2, NULL); }
-UPB_INLINE bool envoy_config_rbac_v3_Permission_has_any(const envoy_config_rbac_v3_Permission *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 3; }
-UPB_INLINE bool envoy_config_rbac_v3_Permission_any(const envoy_config_rbac_v3_Permission *msg) { return UPB_READ_ONEOF(msg, bool, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 3, false); }
-UPB_INLINE bool envoy_config_rbac_v3_Permission_has_header(const envoy_config_rbac_v3_Permission *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 4; }
-UPB_INLINE const struct envoy_config_route_v3_HeaderMatcher* envoy_config_rbac_v3_Permission_header(const envoy_config_rbac_v3_Permission *msg) { return UPB_READ_ONEOF(msg, const struct envoy_config_route_v3_HeaderMatcher*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 4, NULL); }
-UPB_INLINE bool envoy_config_rbac_v3_Permission_has_destination_ip(const envoy_config_rbac_v3_Permission *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 5; }
-UPB_INLINE const struct envoy_config_core_v3_CidrRange* envoy_config_rbac_v3_Permission_destination_ip(const envoy_config_rbac_v3_Permission *msg) { return UPB_READ_ONEOF(msg, const struct envoy_config_core_v3_CidrRange*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 5, NULL); }
-UPB_INLINE bool envoy_config_rbac_v3_Permission_has_destination_port(const envoy_config_rbac_v3_Permission *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 6; }
-UPB_INLINE uint32_t envoy_config_rbac_v3_Permission_destination_port(const envoy_config_rbac_v3_Permission *msg) { return UPB_READ_ONEOF(msg, uint32_t, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 6, 0); }
-UPB_INLINE bool envoy_config_rbac_v3_Permission_has_metadata(const envoy_config_rbac_v3_Permission *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 7; }
-UPB_INLINE const struct envoy_type_matcher_v3_MetadataMatcher* envoy_config_rbac_v3_Permission_metadata(const envoy_config_rbac_v3_Permission *msg) { return UPB_READ_ONEOF(msg, const struct envoy_type_matcher_v3_MetadataMatcher*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 7, NULL); }
-UPB_INLINE bool envoy_config_rbac_v3_Permission_has_not_rule(const envoy_config_rbac_v3_Permission *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 8; }
-UPB_INLINE const envoy_config_rbac_v3_Permission* envoy_config_rbac_v3_Permission_not_rule(const envoy_config_rbac_v3_Permission *msg) { return UPB_READ_ONEOF(msg, const envoy_config_rbac_v3_Permission*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 8, NULL); }
-UPB_INLINE bool envoy_config_rbac_v3_Permission_has_requested_server_name(const envoy_config_rbac_v3_Permission *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 9; }
-UPB_INLINE const struct envoy_type_matcher_v3_StringMatcher* envoy_config_rbac_v3_Permission_requested_server_name(const envoy_config_rbac_v3_Permission *msg) { return UPB_READ_ONEOF(msg, const struct envoy_type_matcher_v3_StringMatcher*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 9, NULL); }
-UPB_INLINE bool envoy_config_rbac_v3_Permission_has_url_path(const envoy_config_rbac_v3_Permission *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 10; }
-UPB_INLINE const struct envoy_type_matcher_v3_PathMatcher* envoy_config_rbac_v3_Permission_url_path(const envoy_config_rbac_v3_Permission *msg) { return UPB_READ_ONEOF(msg, const struct envoy_type_matcher_v3_PathMatcher*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 10, NULL); }
-
-UPB_INLINE void envoy_config_rbac_v3_Permission_set_and_rules(envoy_config_rbac_v3_Permission *msg, envoy_config_rbac_v3_Permission_Set* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_rbac_v3_Permission_Set*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 1);
-}
-UPB_INLINE struct envoy_config_rbac_v3_Permission_Set* envoy_config_rbac_v3_Permission_mutable_and_rules(envoy_config_rbac_v3_Permission *msg, upb_arena *arena) {
- struct envoy_config_rbac_v3_Permission_Set* sub = (struct envoy_config_rbac_v3_Permission_Set*)envoy_config_rbac_v3_Permission_and_rules(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_rbac_v3_Permission_Set*)_upb_msg_new(&envoy_config_rbac_v3_Permission_Set_msginit, arena);
- if (!sub) return NULL;
- envoy_config_rbac_v3_Permission_set_and_rules(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_rbac_v3_Permission_set_or_rules(envoy_config_rbac_v3_Permission *msg, envoy_config_rbac_v3_Permission_Set* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_rbac_v3_Permission_Set*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 2);
-}
-UPB_INLINE struct envoy_config_rbac_v3_Permission_Set* envoy_config_rbac_v3_Permission_mutable_or_rules(envoy_config_rbac_v3_Permission *msg, upb_arena *arena) {
- struct envoy_config_rbac_v3_Permission_Set* sub = (struct envoy_config_rbac_v3_Permission_Set*)envoy_config_rbac_v3_Permission_or_rules(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_rbac_v3_Permission_Set*)_upb_msg_new(&envoy_config_rbac_v3_Permission_Set_msginit, arena);
- if (!sub) return NULL;
- envoy_config_rbac_v3_Permission_set_or_rules(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_rbac_v3_Permission_set_any(envoy_config_rbac_v3_Permission *msg, bool value) {
- UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 3);
-}
-UPB_INLINE void envoy_config_rbac_v3_Permission_set_header(envoy_config_rbac_v3_Permission *msg, struct envoy_config_route_v3_HeaderMatcher* value) {
- UPB_WRITE_ONEOF(msg, struct envoy_config_route_v3_HeaderMatcher*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 4);
-}
-UPB_INLINE struct envoy_config_route_v3_HeaderMatcher* envoy_config_rbac_v3_Permission_mutable_header(envoy_config_rbac_v3_Permission *msg, upb_arena *arena) {
- struct envoy_config_route_v3_HeaderMatcher* sub = (struct envoy_config_route_v3_HeaderMatcher*)envoy_config_rbac_v3_Permission_header(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_route_v3_HeaderMatcher*)_upb_msg_new(&envoy_config_route_v3_HeaderMatcher_msginit, arena);
- if (!sub) return NULL;
- envoy_config_rbac_v3_Permission_set_header(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_rbac_v3_Permission_set_destination_ip(envoy_config_rbac_v3_Permission *msg, struct envoy_config_core_v3_CidrRange* value) {
- UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_CidrRange*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 5);
-}
-UPB_INLINE struct envoy_config_core_v3_CidrRange* envoy_config_rbac_v3_Permission_mutable_destination_ip(envoy_config_rbac_v3_Permission *msg, upb_arena *arena) {
- struct envoy_config_core_v3_CidrRange* sub = (struct envoy_config_core_v3_CidrRange*)envoy_config_rbac_v3_Permission_destination_ip(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_CidrRange*)_upb_msg_new(&envoy_config_core_v3_CidrRange_msginit, arena);
- if (!sub) return NULL;
- envoy_config_rbac_v3_Permission_set_destination_ip(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_rbac_v3_Permission_set_destination_port(envoy_config_rbac_v3_Permission *msg, uint32_t value) {
- UPB_WRITE_ONEOF(msg, uint32_t, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 6);
-}
-UPB_INLINE void envoy_config_rbac_v3_Permission_set_metadata(envoy_config_rbac_v3_Permission *msg, struct envoy_type_matcher_v3_MetadataMatcher* value) {
- UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_MetadataMatcher*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 7);
-}
-UPB_INLINE struct envoy_type_matcher_v3_MetadataMatcher* envoy_config_rbac_v3_Permission_mutable_metadata(envoy_config_rbac_v3_Permission *msg, upb_arena *arena) {
- struct envoy_type_matcher_v3_MetadataMatcher* sub = (struct envoy_type_matcher_v3_MetadataMatcher*)envoy_config_rbac_v3_Permission_metadata(msg);
- if (sub == NULL) {
- sub = (struct envoy_type_matcher_v3_MetadataMatcher*)_upb_msg_new(&envoy_type_matcher_v3_MetadataMatcher_msginit, arena);
- if (!sub) return NULL;
- envoy_config_rbac_v3_Permission_set_metadata(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_rbac_v3_Permission_set_not_rule(envoy_config_rbac_v3_Permission *msg, envoy_config_rbac_v3_Permission* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_rbac_v3_Permission*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 8);
-}
-UPB_INLINE struct envoy_config_rbac_v3_Permission* envoy_config_rbac_v3_Permission_mutable_not_rule(envoy_config_rbac_v3_Permission *msg, upb_arena *arena) {
- struct envoy_config_rbac_v3_Permission* sub = (struct envoy_config_rbac_v3_Permission*)envoy_config_rbac_v3_Permission_not_rule(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_rbac_v3_Permission*)_upb_msg_new(&envoy_config_rbac_v3_Permission_msginit, arena);
- if (!sub) return NULL;
- envoy_config_rbac_v3_Permission_set_not_rule(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_rbac_v3_Permission_set_requested_server_name(envoy_config_rbac_v3_Permission *msg, struct envoy_type_matcher_v3_StringMatcher* value) {
- UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_StringMatcher*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 9);
-}
-UPB_INLINE struct envoy_type_matcher_v3_StringMatcher* envoy_config_rbac_v3_Permission_mutable_requested_server_name(envoy_config_rbac_v3_Permission *msg, upb_arena *arena) {
- struct envoy_type_matcher_v3_StringMatcher* sub = (struct envoy_type_matcher_v3_StringMatcher*)envoy_config_rbac_v3_Permission_requested_server_name(msg);
- if (sub == NULL) {
- sub = (struct envoy_type_matcher_v3_StringMatcher*)_upb_msg_new(&envoy_type_matcher_v3_StringMatcher_msginit, arena);
- if (!sub) return NULL;
- envoy_config_rbac_v3_Permission_set_requested_server_name(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_rbac_v3_Permission_set_url_path(envoy_config_rbac_v3_Permission *msg, struct envoy_type_matcher_v3_PathMatcher* value) {
- UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_PathMatcher*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 10);
-}
-UPB_INLINE struct envoy_type_matcher_v3_PathMatcher* envoy_config_rbac_v3_Permission_mutable_url_path(envoy_config_rbac_v3_Permission *msg, upb_arena *arena) {
- struct envoy_type_matcher_v3_PathMatcher* sub = (struct envoy_type_matcher_v3_PathMatcher*)envoy_config_rbac_v3_Permission_url_path(msg);
- if (sub == NULL) {
- sub = (struct envoy_type_matcher_v3_PathMatcher*)_upb_msg_new(&envoy_type_matcher_v3_PathMatcher_msginit, arena);
- if (!sub) return NULL;
- envoy_config_rbac_v3_Permission_set_url_path(msg, sub);
- }
- return sub;
-}
-
-/* envoy.config.rbac.v3.Permission.Set */
-
-UPB_INLINE envoy_config_rbac_v3_Permission_Set *envoy_config_rbac_v3_Permission_Set_new(upb_arena *arena) {
- return (envoy_config_rbac_v3_Permission_Set *)_upb_msg_new(&envoy_config_rbac_v3_Permission_Set_msginit, arena);
-}
-UPB_INLINE envoy_config_rbac_v3_Permission_Set *envoy_config_rbac_v3_Permission_Set_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_rbac_v3_Permission_Set *ret = envoy_config_rbac_v3_Permission_Set_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_rbac_v3_Permission_Set_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_rbac_v3_Permission_Set_serialize(const envoy_config_rbac_v3_Permission_Set *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_rbac_v3_Permission_Set_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_config_rbac_v3_Permission_Set_has_rules(const envoy_config_rbac_v3_Permission_Set *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE const envoy_config_rbac_v3_Permission* const* envoy_config_rbac_v3_Permission_Set_rules(const envoy_config_rbac_v3_Permission_Set *msg, size_t *len) { return (const envoy_config_rbac_v3_Permission* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
-
-UPB_INLINE envoy_config_rbac_v3_Permission** envoy_config_rbac_v3_Permission_Set_mutable_rules(envoy_config_rbac_v3_Permission_Set *msg, size_t *len) {
- return (envoy_config_rbac_v3_Permission**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
-}
-UPB_INLINE envoy_config_rbac_v3_Permission** envoy_config_rbac_v3_Permission_Set_resize_rules(envoy_config_rbac_v3_Permission_Set *msg, size_t len, upb_arena *arena) {
- return (envoy_config_rbac_v3_Permission**)_upb_array_resize_accessor(msg, UPB_SIZE(0, 0), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_config_rbac_v3_Permission* envoy_config_rbac_v3_Permission_Set_add_rules(envoy_config_rbac_v3_Permission_Set *msg, upb_arena *arena) {
- struct envoy_config_rbac_v3_Permission* sub = (struct envoy_config_rbac_v3_Permission*)_upb_msg_new(&envoy_config_rbac_v3_Permission_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(0, 0), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-
-/* envoy.config.rbac.v3.Principal */
-
-UPB_INLINE envoy_config_rbac_v3_Principal *envoy_config_rbac_v3_Principal_new(upb_arena *arena) {
- return (envoy_config_rbac_v3_Principal *)_upb_msg_new(&envoy_config_rbac_v3_Principal_msginit, arena);
-}
-UPB_INLINE envoy_config_rbac_v3_Principal *envoy_config_rbac_v3_Principal_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_rbac_v3_Principal *ret = envoy_config_rbac_v3_Principal_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_rbac_v3_Principal_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_rbac_v3_Principal_serialize(const envoy_config_rbac_v3_Principal *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_rbac_v3_Principal_msginit, arena, len);
-}
-
-typedef enum {
- envoy_config_rbac_v3_Principal_identifier_and_ids = 1,
- envoy_config_rbac_v3_Principal_identifier_or_ids = 2,
- envoy_config_rbac_v3_Principal_identifier_any = 3,
- envoy_config_rbac_v3_Principal_identifier_authenticated = 4,
- envoy_config_rbac_v3_Principal_identifier_source_ip = 5,
- envoy_config_rbac_v3_Principal_identifier_direct_remote_ip = 10,
- envoy_config_rbac_v3_Principal_identifier_remote_ip = 11,
- envoy_config_rbac_v3_Principal_identifier_header = 6,
- envoy_config_rbac_v3_Principal_identifier_url_path = 9,
- envoy_config_rbac_v3_Principal_identifier_metadata = 7,
- envoy_config_rbac_v3_Principal_identifier_not_id = 8,
- envoy_config_rbac_v3_Principal_identifier_NOT_SET = 0
-} envoy_config_rbac_v3_Principal_identifier_oneofcases;
-UPB_INLINE envoy_config_rbac_v3_Principal_identifier_oneofcases envoy_config_rbac_v3_Principal_identifier_case(const envoy_config_rbac_v3_Principal* msg) { return (envoy_config_rbac_v3_Principal_identifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 8), int32_t); }
-
-UPB_INLINE bool envoy_config_rbac_v3_Principal_has_and_ids(const envoy_config_rbac_v3_Principal *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 1; }
-UPB_INLINE const envoy_config_rbac_v3_Principal_Set* envoy_config_rbac_v3_Principal_and_ids(const envoy_config_rbac_v3_Principal *msg) { return UPB_READ_ONEOF(msg, const envoy_config_rbac_v3_Principal_Set*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 1, NULL); }
-UPB_INLINE bool envoy_config_rbac_v3_Principal_has_or_ids(const envoy_config_rbac_v3_Principal *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 2; }
-UPB_INLINE const envoy_config_rbac_v3_Principal_Set* envoy_config_rbac_v3_Principal_or_ids(const envoy_config_rbac_v3_Principal *msg) { return UPB_READ_ONEOF(msg, const envoy_config_rbac_v3_Principal_Set*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 2, NULL); }
-UPB_INLINE bool envoy_config_rbac_v3_Principal_has_any(const envoy_config_rbac_v3_Principal *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 3; }
-UPB_INLINE bool envoy_config_rbac_v3_Principal_any(const envoy_config_rbac_v3_Principal *msg) { return UPB_READ_ONEOF(msg, bool, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 3, false); }
-UPB_INLINE bool envoy_config_rbac_v3_Principal_has_authenticated(const envoy_config_rbac_v3_Principal *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 4; }
-UPB_INLINE const envoy_config_rbac_v3_Principal_Authenticated* envoy_config_rbac_v3_Principal_authenticated(const envoy_config_rbac_v3_Principal *msg) { return UPB_READ_ONEOF(msg, const envoy_config_rbac_v3_Principal_Authenticated*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 4, NULL); }
-UPB_INLINE bool envoy_config_rbac_v3_Principal_has_source_ip(const envoy_config_rbac_v3_Principal *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 5; }
-UPB_INLINE const struct envoy_config_core_v3_CidrRange* envoy_config_rbac_v3_Principal_source_ip(const envoy_config_rbac_v3_Principal *msg) { return UPB_READ_ONEOF(msg, const struct envoy_config_core_v3_CidrRange*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 5, NULL); }
-UPB_INLINE bool envoy_config_rbac_v3_Principal_has_header(const envoy_config_rbac_v3_Principal *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 6; }
-UPB_INLINE const struct envoy_config_route_v3_HeaderMatcher* envoy_config_rbac_v3_Principal_header(const envoy_config_rbac_v3_Principal *msg) { return UPB_READ_ONEOF(msg, const struct envoy_config_route_v3_HeaderMatcher*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 6, NULL); }
-UPB_INLINE bool envoy_config_rbac_v3_Principal_has_metadata(const envoy_config_rbac_v3_Principal *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 7; }
-UPB_INLINE const struct envoy_type_matcher_v3_MetadataMatcher* envoy_config_rbac_v3_Principal_metadata(const envoy_config_rbac_v3_Principal *msg) { return UPB_READ_ONEOF(msg, const struct envoy_type_matcher_v3_MetadataMatcher*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 7, NULL); }
-UPB_INLINE bool envoy_config_rbac_v3_Principal_has_not_id(const envoy_config_rbac_v3_Principal *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 8; }
-UPB_INLINE const envoy_config_rbac_v3_Principal* envoy_config_rbac_v3_Principal_not_id(const envoy_config_rbac_v3_Principal *msg) { return UPB_READ_ONEOF(msg, const envoy_config_rbac_v3_Principal*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 8, NULL); }
-UPB_INLINE bool envoy_config_rbac_v3_Principal_has_url_path(const envoy_config_rbac_v3_Principal *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 9; }
-UPB_INLINE const struct envoy_type_matcher_v3_PathMatcher* envoy_config_rbac_v3_Principal_url_path(const envoy_config_rbac_v3_Principal *msg) { return UPB_READ_ONEOF(msg, const struct envoy_type_matcher_v3_PathMatcher*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 9, NULL); }
-UPB_INLINE bool envoy_config_rbac_v3_Principal_has_direct_remote_ip(const envoy_config_rbac_v3_Principal *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 10; }
-UPB_INLINE const struct envoy_config_core_v3_CidrRange* envoy_config_rbac_v3_Principal_direct_remote_ip(const envoy_config_rbac_v3_Principal *msg) { return UPB_READ_ONEOF(msg, const struct envoy_config_core_v3_CidrRange*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 10, NULL); }
-UPB_INLINE bool envoy_config_rbac_v3_Principal_has_remote_ip(const envoy_config_rbac_v3_Principal *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 11; }
-UPB_INLINE const struct envoy_config_core_v3_CidrRange* envoy_config_rbac_v3_Principal_remote_ip(const envoy_config_rbac_v3_Principal *msg) { return UPB_READ_ONEOF(msg, const struct envoy_config_core_v3_CidrRange*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 11, NULL); }
-
-UPB_INLINE void envoy_config_rbac_v3_Principal_set_and_ids(envoy_config_rbac_v3_Principal *msg, envoy_config_rbac_v3_Principal_Set* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_rbac_v3_Principal_Set*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 1);
-}
-UPB_INLINE struct envoy_config_rbac_v3_Principal_Set* envoy_config_rbac_v3_Principal_mutable_and_ids(envoy_config_rbac_v3_Principal *msg, upb_arena *arena) {
- struct envoy_config_rbac_v3_Principal_Set* sub = (struct envoy_config_rbac_v3_Principal_Set*)envoy_config_rbac_v3_Principal_and_ids(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_rbac_v3_Principal_Set*)_upb_msg_new(&envoy_config_rbac_v3_Principal_Set_msginit, arena);
- if (!sub) return NULL;
- envoy_config_rbac_v3_Principal_set_and_ids(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_rbac_v3_Principal_set_or_ids(envoy_config_rbac_v3_Principal *msg, envoy_config_rbac_v3_Principal_Set* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_rbac_v3_Principal_Set*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 2);
-}
-UPB_INLINE struct envoy_config_rbac_v3_Principal_Set* envoy_config_rbac_v3_Principal_mutable_or_ids(envoy_config_rbac_v3_Principal *msg, upb_arena *arena) {
- struct envoy_config_rbac_v3_Principal_Set* sub = (struct envoy_config_rbac_v3_Principal_Set*)envoy_config_rbac_v3_Principal_or_ids(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_rbac_v3_Principal_Set*)_upb_msg_new(&envoy_config_rbac_v3_Principal_Set_msginit, arena);
- if (!sub) return NULL;
- envoy_config_rbac_v3_Principal_set_or_ids(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_rbac_v3_Principal_set_any(envoy_config_rbac_v3_Principal *msg, bool value) {
- UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 3);
-}
-UPB_INLINE void envoy_config_rbac_v3_Principal_set_authenticated(envoy_config_rbac_v3_Principal *msg, envoy_config_rbac_v3_Principal_Authenticated* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_rbac_v3_Principal_Authenticated*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 4);
-}
-UPB_INLINE struct envoy_config_rbac_v3_Principal_Authenticated* envoy_config_rbac_v3_Principal_mutable_authenticated(envoy_config_rbac_v3_Principal *msg, upb_arena *arena) {
- struct envoy_config_rbac_v3_Principal_Authenticated* sub = (struct envoy_config_rbac_v3_Principal_Authenticated*)envoy_config_rbac_v3_Principal_authenticated(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_rbac_v3_Principal_Authenticated*)_upb_msg_new(&envoy_config_rbac_v3_Principal_Authenticated_msginit, arena);
- if (!sub) return NULL;
- envoy_config_rbac_v3_Principal_set_authenticated(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_rbac_v3_Principal_set_source_ip(envoy_config_rbac_v3_Principal *msg, struct envoy_config_core_v3_CidrRange* value) {
- UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_CidrRange*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 5);
-}
-UPB_INLINE struct envoy_config_core_v3_CidrRange* envoy_config_rbac_v3_Principal_mutable_source_ip(envoy_config_rbac_v3_Principal *msg, upb_arena *arena) {
- struct envoy_config_core_v3_CidrRange* sub = (struct envoy_config_core_v3_CidrRange*)envoy_config_rbac_v3_Principal_source_ip(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_CidrRange*)_upb_msg_new(&envoy_config_core_v3_CidrRange_msginit, arena);
- if (!sub) return NULL;
- envoy_config_rbac_v3_Principal_set_source_ip(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_rbac_v3_Principal_set_header(envoy_config_rbac_v3_Principal *msg, struct envoy_config_route_v3_HeaderMatcher* value) {
- UPB_WRITE_ONEOF(msg, struct envoy_config_route_v3_HeaderMatcher*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 6);
-}
-UPB_INLINE struct envoy_config_route_v3_HeaderMatcher* envoy_config_rbac_v3_Principal_mutable_header(envoy_config_rbac_v3_Principal *msg, upb_arena *arena) {
- struct envoy_config_route_v3_HeaderMatcher* sub = (struct envoy_config_route_v3_HeaderMatcher*)envoy_config_rbac_v3_Principal_header(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_route_v3_HeaderMatcher*)_upb_msg_new(&envoy_config_route_v3_HeaderMatcher_msginit, arena);
- if (!sub) return NULL;
- envoy_config_rbac_v3_Principal_set_header(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_rbac_v3_Principal_set_metadata(envoy_config_rbac_v3_Principal *msg, struct envoy_type_matcher_v3_MetadataMatcher* value) {
- UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_MetadataMatcher*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 7);
-}
-UPB_INLINE struct envoy_type_matcher_v3_MetadataMatcher* envoy_config_rbac_v3_Principal_mutable_metadata(envoy_config_rbac_v3_Principal *msg, upb_arena *arena) {
- struct envoy_type_matcher_v3_MetadataMatcher* sub = (struct envoy_type_matcher_v3_MetadataMatcher*)envoy_config_rbac_v3_Principal_metadata(msg);
- if (sub == NULL) {
- sub = (struct envoy_type_matcher_v3_MetadataMatcher*)_upb_msg_new(&envoy_type_matcher_v3_MetadataMatcher_msginit, arena);
- if (!sub) return NULL;
- envoy_config_rbac_v3_Principal_set_metadata(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_rbac_v3_Principal_set_not_id(envoy_config_rbac_v3_Principal *msg, envoy_config_rbac_v3_Principal* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_rbac_v3_Principal*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 8);
-}
-UPB_INLINE struct envoy_config_rbac_v3_Principal* envoy_config_rbac_v3_Principal_mutable_not_id(envoy_config_rbac_v3_Principal *msg, upb_arena *arena) {
- struct envoy_config_rbac_v3_Principal* sub = (struct envoy_config_rbac_v3_Principal*)envoy_config_rbac_v3_Principal_not_id(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_rbac_v3_Principal*)_upb_msg_new(&envoy_config_rbac_v3_Principal_msginit, arena);
- if (!sub) return NULL;
- envoy_config_rbac_v3_Principal_set_not_id(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_rbac_v3_Principal_set_url_path(envoy_config_rbac_v3_Principal *msg, struct envoy_type_matcher_v3_PathMatcher* value) {
- UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_PathMatcher*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 9);
-}
-UPB_INLINE struct envoy_type_matcher_v3_PathMatcher* envoy_config_rbac_v3_Principal_mutable_url_path(envoy_config_rbac_v3_Principal *msg, upb_arena *arena) {
- struct envoy_type_matcher_v3_PathMatcher* sub = (struct envoy_type_matcher_v3_PathMatcher*)envoy_config_rbac_v3_Principal_url_path(msg);
- if (sub == NULL) {
- sub = (struct envoy_type_matcher_v3_PathMatcher*)_upb_msg_new(&envoy_type_matcher_v3_PathMatcher_msginit, arena);
- if (!sub) return NULL;
- envoy_config_rbac_v3_Principal_set_url_path(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_rbac_v3_Principal_set_direct_remote_ip(envoy_config_rbac_v3_Principal *msg, struct envoy_config_core_v3_CidrRange* value) {
- UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_CidrRange*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 10);
-}
-UPB_INLINE struct envoy_config_core_v3_CidrRange* envoy_config_rbac_v3_Principal_mutable_direct_remote_ip(envoy_config_rbac_v3_Principal *msg, upb_arena *arena) {
- struct envoy_config_core_v3_CidrRange* sub = (struct envoy_config_core_v3_CidrRange*)envoy_config_rbac_v3_Principal_direct_remote_ip(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_CidrRange*)_upb_msg_new(&envoy_config_core_v3_CidrRange_msginit, arena);
- if (!sub) return NULL;
- envoy_config_rbac_v3_Principal_set_direct_remote_ip(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_rbac_v3_Principal_set_remote_ip(envoy_config_rbac_v3_Principal *msg, struct envoy_config_core_v3_CidrRange* value) {
- UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_CidrRange*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 11);
-}
-UPB_INLINE struct envoy_config_core_v3_CidrRange* envoy_config_rbac_v3_Principal_mutable_remote_ip(envoy_config_rbac_v3_Principal *msg, upb_arena *arena) {
- struct envoy_config_core_v3_CidrRange* sub = (struct envoy_config_core_v3_CidrRange*)envoy_config_rbac_v3_Principal_remote_ip(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_CidrRange*)_upb_msg_new(&envoy_config_core_v3_CidrRange_msginit, arena);
- if (!sub) return NULL;
- envoy_config_rbac_v3_Principal_set_remote_ip(msg, sub);
- }
- return sub;
-}
-
-/* envoy.config.rbac.v3.Principal.Set */
-
-UPB_INLINE envoy_config_rbac_v3_Principal_Set *envoy_config_rbac_v3_Principal_Set_new(upb_arena *arena) {
- return (envoy_config_rbac_v3_Principal_Set *)_upb_msg_new(&envoy_config_rbac_v3_Principal_Set_msginit, arena);
-}
-UPB_INLINE envoy_config_rbac_v3_Principal_Set *envoy_config_rbac_v3_Principal_Set_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_rbac_v3_Principal_Set *ret = envoy_config_rbac_v3_Principal_Set_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_rbac_v3_Principal_Set_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_rbac_v3_Principal_Set_serialize(const envoy_config_rbac_v3_Principal_Set *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_rbac_v3_Principal_Set_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_config_rbac_v3_Principal_Set_has_ids(const envoy_config_rbac_v3_Principal_Set *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE const envoy_config_rbac_v3_Principal* const* envoy_config_rbac_v3_Principal_Set_ids(const envoy_config_rbac_v3_Principal_Set *msg, size_t *len) { return (const envoy_config_rbac_v3_Principal* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
-
-UPB_INLINE envoy_config_rbac_v3_Principal** envoy_config_rbac_v3_Principal_Set_mutable_ids(envoy_config_rbac_v3_Principal_Set *msg, size_t *len) {
- return (envoy_config_rbac_v3_Principal**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
-}
-UPB_INLINE envoy_config_rbac_v3_Principal** envoy_config_rbac_v3_Principal_Set_resize_ids(envoy_config_rbac_v3_Principal_Set *msg, size_t len, upb_arena *arena) {
- return (envoy_config_rbac_v3_Principal**)_upb_array_resize_accessor(msg, UPB_SIZE(0, 0), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_config_rbac_v3_Principal* envoy_config_rbac_v3_Principal_Set_add_ids(envoy_config_rbac_v3_Principal_Set *msg, upb_arena *arena) {
- struct envoy_config_rbac_v3_Principal* sub = (struct envoy_config_rbac_v3_Principal*)_upb_msg_new(&envoy_config_rbac_v3_Principal_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(0, 0), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-
-/* envoy.config.rbac.v3.Principal.Authenticated */
-
-UPB_INLINE envoy_config_rbac_v3_Principal_Authenticated *envoy_config_rbac_v3_Principal_Authenticated_new(upb_arena *arena) {
- return (envoy_config_rbac_v3_Principal_Authenticated *)_upb_msg_new(&envoy_config_rbac_v3_Principal_Authenticated_msginit, arena);
-}
-UPB_INLINE envoy_config_rbac_v3_Principal_Authenticated *envoy_config_rbac_v3_Principal_Authenticated_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_rbac_v3_Principal_Authenticated *ret = envoy_config_rbac_v3_Principal_Authenticated_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_rbac_v3_Principal_Authenticated_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_rbac_v3_Principal_Authenticated_serialize(const envoy_config_rbac_v3_Principal_Authenticated *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_rbac_v3_Principal_Authenticated_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_config_rbac_v3_Principal_Authenticated_has_principal_name(const envoy_config_rbac_v3_Principal_Authenticated *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE const struct envoy_type_matcher_v3_StringMatcher* envoy_config_rbac_v3_Principal_Authenticated_principal_name(const envoy_config_rbac_v3_Principal_Authenticated *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct envoy_type_matcher_v3_StringMatcher*); }
-
-UPB_INLINE void envoy_config_rbac_v3_Principal_Authenticated_set_principal_name(envoy_config_rbac_v3_Principal_Authenticated *msg, struct envoy_type_matcher_v3_StringMatcher* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct envoy_type_matcher_v3_StringMatcher*) = value;
-}
-UPB_INLINE struct envoy_type_matcher_v3_StringMatcher* envoy_config_rbac_v3_Principal_Authenticated_mutable_principal_name(envoy_config_rbac_v3_Principal_Authenticated *msg, upb_arena *arena) {
- struct envoy_type_matcher_v3_StringMatcher* sub = (struct envoy_type_matcher_v3_StringMatcher*)envoy_config_rbac_v3_Principal_Authenticated_principal_name(msg);
- if (sub == NULL) {
- sub = (struct envoy_type_matcher_v3_StringMatcher*)_upb_msg_new(&envoy_type_matcher_v3_StringMatcher_msginit, arena);
- if (!sub) return NULL;
- envoy_config_rbac_v3_Principal_Authenticated_set_principal_name(msg, sub);
- }
- return sub;
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* ENVOY_CONFIG_RBAC_V3_RBAC_PROTO_UPB_H_ */
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/rbac/v3/rbac.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_CONFIG_RBAC_V3_RBAC_PROTO_UPB_H_
+#define ENVOY_CONFIG_RBAC_V3_RBAC_PROTO_UPB_H_
+
+#include "upb/msg.h"
+#include "upb/decode.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_config_rbac_v3_RBAC;
+struct envoy_config_rbac_v3_RBAC_PoliciesEntry;
+struct envoy_config_rbac_v3_Policy;
+struct envoy_config_rbac_v3_Permission;
+struct envoy_config_rbac_v3_Permission_Set;
+struct envoy_config_rbac_v3_Principal;
+struct envoy_config_rbac_v3_Principal_Set;
+struct envoy_config_rbac_v3_Principal_Authenticated;
+typedef struct envoy_config_rbac_v3_RBAC envoy_config_rbac_v3_RBAC;
+typedef struct envoy_config_rbac_v3_RBAC_PoliciesEntry envoy_config_rbac_v3_RBAC_PoliciesEntry;
+typedef struct envoy_config_rbac_v3_Policy envoy_config_rbac_v3_Policy;
+typedef struct envoy_config_rbac_v3_Permission envoy_config_rbac_v3_Permission;
+typedef struct envoy_config_rbac_v3_Permission_Set envoy_config_rbac_v3_Permission_Set;
+typedef struct envoy_config_rbac_v3_Principal envoy_config_rbac_v3_Principal;
+typedef struct envoy_config_rbac_v3_Principal_Set envoy_config_rbac_v3_Principal_Set;
+typedef struct envoy_config_rbac_v3_Principal_Authenticated envoy_config_rbac_v3_Principal_Authenticated;
+extern const upb_msglayout envoy_config_rbac_v3_RBAC_msginit;
+extern const upb_msglayout envoy_config_rbac_v3_RBAC_PoliciesEntry_msginit;
+extern const upb_msglayout envoy_config_rbac_v3_Policy_msginit;
+extern const upb_msglayout envoy_config_rbac_v3_Permission_msginit;
+extern const upb_msglayout envoy_config_rbac_v3_Permission_Set_msginit;
+extern const upb_msglayout envoy_config_rbac_v3_Principal_msginit;
+extern const upb_msglayout envoy_config_rbac_v3_Principal_Set_msginit;
+extern const upb_msglayout envoy_config_rbac_v3_Principal_Authenticated_msginit;
+struct envoy_config_core_v3_CidrRange;
+struct envoy_config_route_v3_HeaderMatcher;
+struct envoy_type_matcher_v3_MetadataMatcher;
+struct envoy_type_matcher_v3_PathMatcher;
+struct envoy_type_matcher_v3_StringMatcher;
+struct google_api_expr_v1alpha1_CheckedExpr;
+struct google_api_expr_v1alpha1_Expr;
+extern const upb_msglayout envoy_config_core_v3_CidrRange_msginit;
+extern const upb_msglayout envoy_config_route_v3_HeaderMatcher_msginit;
+extern const upb_msglayout envoy_type_matcher_v3_MetadataMatcher_msginit;
+extern const upb_msglayout envoy_type_matcher_v3_PathMatcher_msginit;
+extern const upb_msglayout envoy_type_matcher_v3_StringMatcher_msginit;
+extern const upb_msglayout google_api_expr_v1alpha1_CheckedExpr_msginit;
+extern const upb_msglayout google_api_expr_v1alpha1_Expr_msginit;
+
+typedef enum {
+ envoy_config_rbac_v3_RBAC_ALLOW = 0,
+ envoy_config_rbac_v3_RBAC_DENY = 1,
+ envoy_config_rbac_v3_RBAC_LOG = 2
+} envoy_config_rbac_v3_RBAC_Action;
+
+
+/* envoy.config.rbac.v3.RBAC */
+
+UPB_INLINE envoy_config_rbac_v3_RBAC *envoy_config_rbac_v3_RBAC_new(upb_arena *arena) {
+ return (envoy_config_rbac_v3_RBAC *)_upb_msg_new(&envoy_config_rbac_v3_RBAC_msginit, arena);
+}
+UPB_INLINE envoy_config_rbac_v3_RBAC *envoy_config_rbac_v3_RBAC_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_rbac_v3_RBAC *ret = envoy_config_rbac_v3_RBAC_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_rbac_v3_RBAC_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_rbac_v3_RBAC_serialize(const envoy_config_rbac_v3_RBAC *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_rbac_v3_RBAC_msginit, arena, len);
+}
+
+UPB_INLINE int32_t envoy_config_rbac_v3_RBAC_action(const envoy_config_rbac_v3_RBAC *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
+UPB_INLINE bool envoy_config_rbac_v3_RBAC_has_policies(const envoy_config_rbac_v3_RBAC *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 8)); }
+UPB_INLINE size_t envoy_config_rbac_v3_RBAC_policies_size(const envoy_config_rbac_v3_RBAC *msg) {return _upb_msg_map_size(msg, UPB_SIZE(8, 8)); }
+UPB_INLINE bool envoy_config_rbac_v3_RBAC_policies_get(const envoy_config_rbac_v3_RBAC *msg, upb_strview key, envoy_config_rbac_v3_Policy* *val) { return _upb_msg_map_get(msg, UPB_SIZE(8, 8), &key, 0, val, sizeof(*val)); }
+UPB_INLINE const envoy_config_rbac_v3_RBAC_PoliciesEntry* envoy_config_rbac_v3_RBAC_policies_next(const envoy_config_rbac_v3_RBAC *msg, size_t* iter) { return (const envoy_config_rbac_v3_RBAC_PoliciesEntry*)_upb_msg_map_next(msg, UPB_SIZE(8, 8), iter); }
+
+UPB_INLINE void envoy_config_rbac_v3_RBAC_set_action(envoy_config_rbac_v3_RBAC *msg, int32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
+}
+UPB_INLINE void envoy_config_rbac_v3_RBAC_policies_clear(envoy_config_rbac_v3_RBAC *msg) { _upb_msg_map_clear(msg, UPB_SIZE(8, 8)); }
+UPB_INLINE bool envoy_config_rbac_v3_RBAC_policies_set(envoy_config_rbac_v3_RBAC *msg, upb_strview key, envoy_config_rbac_v3_Policy* val, upb_arena *a) { return _upb_msg_map_set(msg, UPB_SIZE(8, 8), &key, 0, &val, sizeof(val), a); }
+UPB_INLINE bool envoy_config_rbac_v3_RBAC_policies_delete(envoy_config_rbac_v3_RBAC *msg, upb_strview key) { return _upb_msg_map_delete(msg, UPB_SIZE(8, 8), &key, 0); }
+UPB_INLINE envoy_config_rbac_v3_RBAC_PoliciesEntry* envoy_config_rbac_v3_RBAC_policies_nextmutable(envoy_config_rbac_v3_RBAC *msg, size_t* iter) { return (envoy_config_rbac_v3_RBAC_PoliciesEntry*)_upb_msg_map_next(msg, UPB_SIZE(8, 8), iter); }
+
+/* envoy.config.rbac.v3.RBAC.PoliciesEntry */
+
+UPB_INLINE upb_strview envoy_config_rbac_v3_RBAC_PoliciesEntry_key(const envoy_config_rbac_v3_RBAC_PoliciesEntry *msg) {
+ upb_strview ret;
+ _upb_msg_map_key(msg, &ret, 0);
+ return ret;
+}
+UPB_INLINE bool envoy_config_rbac_v3_RBAC_PoliciesEntry_has_value(const envoy_config_rbac_v3_RBAC_PoliciesEntry *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
+UPB_INLINE const envoy_config_rbac_v3_Policy* envoy_config_rbac_v3_RBAC_PoliciesEntry_value(const envoy_config_rbac_v3_RBAC_PoliciesEntry *msg) {
+ envoy_config_rbac_v3_Policy* ret;
+ _upb_msg_map_value(msg, &ret, sizeof(ret));
+ return ret;
+}
+
+UPB_INLINE void envoy_config_rbac_v3_RBAC_PoliciesEntry_set_value(envoy_config_rbac_v3_RBAC_PoliciesEntry *msg, envoy_config_rbac_v3_Policy* value) {
+ _upb_msg_map_set_value(msg, &value, sizeof(envoy_config_rbac_v3_Policy*));
+}
+
+/* envoy.config.rbac.v3.Policy */
+
+UPB_INLINE envoy_config_rbac_v3_Policy *envoy_config_rbac_v3_Policy_new(upb_arena *arena) {
+ return (envoy_config_rbac_v3_Policy *)_upb_msg_new(&envoy_config_rbac_v3_Policy_msginit, arena);
+}
+UPB_INLINE envoy_config_rbac_v3_Policy *envoy_config_rbac_v3_Policy_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_rbac_v3_Policy *ret = envoy_config_rbac_v3_Policy_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_rbac_v3_Policy_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_rbac_v3_Policy_serialize(const envoy_config_rbac_v3_Policy *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_rbac_v3_Policy_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_rbac_v3_Policy_has_permissions(const envoy_config_rbac_v3_Policy *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
+UPB_INLINE const envoy_config_rbac_v3_Permission* const* envoy_config_rbac_v3_Policy_permissions(const envoy_config_rbac_v3_Policy *msg, size_t *len) { return (const envoy_config_rbac_v3_Permission* const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len); }
+UPB_INLINE bool envoy_config_rbac_v3_Policy_has_principals(const envoy_config_rbac_v3_Policy *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
+UPB_INLINE const envoy_config_rbac_v3_Principal* const* envoy_config_rbac_v3_Policy_principals(const envoy_config_rbac_v3_Policy *msg, size_t *len) { return (const envoy_config_rbac_v3_Principal* const*)_upb_array_accessor(msg, UPB_SIZE(12, 24), len); }
+UPB_INLINE bool envoy_config_rbac_v3_Policy_has_condition(const envoy_config_rbac_v3_Policy *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE const struct google_api_expr_v1alpha1_Expr* envoy_config_rbac_v3_Policy_condition(const envoy_config_rbac_v3_Policy *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct google_api_expr_v1alpha1_Expr*); }
+UPB_INLINE bool envoy_config_rbac_v3_Policy_has_checked_condition(const envoy_config_rbac_v3_Policy *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
+UPB_INLINE const struct google_api_expr_v1alpha1_CheckedExpr* envoy_config_rbac_v3_Policy_checked_condition(const envoy_config_rbac_v3_Policy *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_api_expr_v1alpha1_CheckedExpr*); }
+
+UPB_INLINE envoy_config_rbac_v3_Permission** envoy_config_rbac_v3_Policy_mutable_permissions(envoy_config_rbac_v3_Policy *msg, size_t *len) {
+ return (envoy_config_rbac_v3_Permission**)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len);
+}
+UPB_INLINE envoy_config_rbac_v3_Permission** envoy_config_rbac_v3_Policy_resize_permissions(envoy_config_rbac_v3_Policy *msg, size_t len, upb_arena *arena) {
+ return (envoy_config_rbac_v3_Permission**)_upb_array_resize_accessor(msg, UPB_SIZE(8, 16), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_config_rbac_v3_Permission* envoy_config_rbac_v3_Policy_add_permissions(envoy_config_rbac_v3_Policy *msg, upb_arena *arena) {
+ struct envoy_config_rbac_v3_Permission* sub = (struct envoy_config_rbac_v3_Permission*)_upb_msg_new(&envoy_config_rbac_v3_Permission_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(8, 16), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE envoy_config_rbac_v3_Principal** envoy_config_rbac_v3_Policy_mutable_principals(envoy_config_rbac_v3_Policy *msg, size_t *len) {
+ return (envoy_config_rbac_v3_Principal**)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 24), len);
+}
+UPB_INLINE envoy_config_rbac_v3_Principal** envoy_config_rbac_v3_Policy_resize_principals(envoy_config_rbac_v3_Policy *msg, size_t len, upb_arena *arena) {
+ return (envoy_config_rbac_v3_Principal**)_upb_array_resize_accessor(msg, UPB_SIZE(12, 24), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_config_rbac_v3_Principal* envoy_config_rbac_v3_Policy_add_principals(envoy_config_rbac_v3_Policy *msg, upb_arena *arena) {
+ struct envoy_config_rbac_v3_Principal* sub = (struct envoy_config_rbac_v3_Principal*)_upb_msg_new(&envoy_config_rbac_v3_Principal_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(12, 24), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE void envoy_config_rbac_v3_Policy_set_condition(envoy_config_rbac_v3_Policy *msg, struct google_api_expr_v1alpha1_Expr* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct google_api_expr_v1alpha1_Expr*) = value;
+}
+UPB_INLINE struct google_api_expr_v1alpha1_Expr* envoy_config_rbac_v3_Policy_mutable_condition(envoy_config_rbac_v3_Policy *msg, upb_arena *arena) {
+ struct google_api_expr_v1alpha1_Expr* sub = (struct google_api_expr_v1alpha1_Expr*)envoy_config_rbac_v3_Policy_condition(msg);
+ if (sub == NULL) {
+ sub = (struct google_api_expr_v1alpha1_Expr*)_upb_msg_new(&google_api_expr_v1alpha1_Expr_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_rbac_v3_Policy_set_condition(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_rbac_v3_Policy_set_checked_condition(envoy_config_rbac_v3_Policy *msg, struct google_api_expr_v1alpha1_CheckedExpr* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_api_expr_v1alpha1_CheckedExpr*) = value;
+}
+UPB_INLINE struct google_api_expr_v1alpha1_CheckedExpr* envoy_config_rbac_v3_Policy_mutable_checked_condition(envoy_config_rbac_v3_Policy *msg, upb_arena *arena) {
+ struct google_api_expr_v1alpha1_CheckedExpr* sub = (struct google_api_expr_v1alpha1_CheckedExpr*)envoy_config_rbac_v3_Policy_checked_condition(msg);
+ if (sub == NULL) {
+ sub = (struct google_api_expr_v1alpha1_CheckedExpr*)_upb_msg_new(&google_api_expr_v1alpha1_CheckedExpr_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_rbac_v3_Policy_set_checked_condition(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.rbac.v3.Permission */
+
+UPB_INLINE envoy_config_rbac_v3_Permission *envoy_config_rbac_v3_Permission_new(upb_arena *arena) {
+ return (envoy_config_rbac_v3_Permission *)_upb_msg_new(&envoy_config_rbac_v3_Permission_msginit, arena);
+}
+UPB_INLINE envoy_config_rbac_v3_Permission *envoy_config_rbac_v3_Permission_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_rbac_v3_Permission *ret = envoy_config_rbac_v3_Permission_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_rbac_v3_Permission_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_rbac_v3_Permission_serialize(const envoy_config_rbac_v3_Permission *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_rbac_v3_Permission_msginit, arena, len);
+}
+
+typedef enum {
+ envoy_config_rbac_v3_Permission_rule_and_rules = 1,
+ envoy_config_rbac_v3_Permission_rule_or_rules = 2,
+ envoy_config_rbac_v3_Permission_rule_any = 3,
+ envoy_config_rbac_v3_Permission_rule_header = 4,
+ envoy_config_rbac_v3_Permission_rule_url_path = 10,
+ envoy_config_rbac_v3_Permission_rule_destination_ip = 5,
+ envoy_config_rbac_v3_Permission_rule_destination_port = 6,
+ envoy_config_rbac_v3_Permission_rule_metadata = 7,
+ envoy_config_rbac_v3_Permission_rule_not_rule = 8,
+ envoy_config_rbac_v3_Permission_rule_requested_server_name = 9,
+ envoy_config_rbac_v3_Permission_rule_NOT_SET = 0
+} envoy_config_rbac_v3_Permission_rule_oneofcases;
+UPB_INLINE envoy_config_rbac_v3_Permission_rule_oneofcases envoy_config_rbac_v3_Permission_rule_case(const envoy_config_rbac_v3_Permission* msg) { return (envoy_config_rbac_v3_Permission_rule_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 8), int32_t); }
+
+UPB_INLINE bool envoy_config_rbac_v3_Permission_has_and_rules(const envoy_config_rbac_v3_Permission *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 1; }
+UPB_INLINE const envoy_config_rbac_v3_Permission_Set* envoy_config_rbac_v3_Permission_and_rules(const envoy_config_rbac_v3_Permission *msg) { return UPB_READ_ONEOF(msg, const envoy_config_rbac_v3_Permission_Set*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 1, NULL); }
+UPB_INLINE bool envoy_config_rbac_v3_Permission_has_or_rules(const envoy_config_rbac_v3_Permission *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 2; }
+UPB_INLINE const envoy_config_rbac_v3_Permission_Set* envoy_config_rbac_v3_Permission_or_rules(const envoy_config_rbac_v3_Permission *msg) { return UPB_READ_ONEOF(msg, const envoy_config_rbac_v3_Permission_Set*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 2, NULL); }
+UPB_INLINE bool envoy_config_rbac_v3_Permission_has_any(const envoy_config_rbac_v3_Permission *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 3; }
+UPB_INLINE bool envoy_config_rbac_v3_Permission_any(const envoy_config_rbac_v3_Permission *msg) { return UPB_READ_ONEOF(msg, bool, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 3, false); }
+UPB_INLINE bool envoy_config_rbac_v3_Permission_has_header(const envoy_config_rbac_v3_Permission *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 4; }
+UPB_INLINE const struct envoy_config_route_v3_HeaderMatcher* envoy_config_rbac_v3_Permission_header(const envoy_config_rbac_v3_Permission *msg) { return UPB_READ_ONEOF(msg, const struct envoy_config_route_v3_HeaderMatcher*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 4, NULL); }
+UPB_INLINE bool envoy_config_rbac_v3_Permission_has_destination_ip(const envoy_config_rbac_v3_Permission *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 5; }
+UPB_INLINE const struct envoy_config_core_v3_CidrRange* envoy_config_rbac_v3_Permission_destination_ip(const envoy_config_rbac_v3_Permission *msg) { return UPB_READ_ONEOF(msg, const struct envoy_config_core_v3_CidrRange*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 5, NULL); }
+UPB_INLINE bool envoy_config_rbac_v3_Permission_has_destination_port(const envoy_config_rbac_v3_Permission *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 6; }
+UPB_INLINE uint32_t envoy_config_rbac_v3_Permission_destination_port(const envoy_config_rbac_v3_Permission *msg) { return UPB_READ_ONEOF(msg, uint32_t, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 6, 0); }
+UPB_INLINE bool envoy_config_rbac_v3_Permission_has_metadata(const envoy_config_rbac_v3_Permission *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 7; }
+UPB_INLINE const struct envoy_type_matcher_v3_MetadataMatcher* envoy_config_rbac_v3_Permission_metadata(const envoy_config_rbac_v3_Permission *msg) { return UPB_READ_ONEOF(msg, const struct envoy_type_matcher_v3_MetadataMatcher*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 7, NULL); }
+UPB_INLINE bool envoy_config_rbac_v3_Permission_has_not_rule(const envoy_config_rbac_v3_Permission *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 8; }
+UPB_INLINE const envoy_config_rbac_v3_Permission* envoy_config_rbac_v3_Permission_not_rule(const envoy_config_rbac_v3_Permission *msg) { return UPB_READ_ONEOF(msg, const envoy_config_rbac_v3_Permission*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 8, NULL); }
+UPB_INLINE bool envoy_config_rbac_v3_Permission_has_requested_server_name(const envoy_config_rbac_v3_Permission *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 9; }
+UPB_INLINE const struct envoy_type_matcher_v3_StringMatcher* envoy_config_rbac_v3_Permission_requested_server_name(const envoy_config_rbac_v3_Permission *msg) { return UPB_READ_ONEOF(msg, const struct envoy_type_matcher_v3_StringMatcher*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 9, NULL); }
+UPB_INLINE bool envoy_config_rbac_v3_Permission_has_url_path(const envoy_config_rbac_v3_Permission *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 10; }
+UPB_INLINE const struct envoy_type_matcher_v3_PathMatcher* envoy_config_rbac_v3_Permission_url_path(const envoy_config_rbac_v3_Permission *msg) { return UPB_READ_ONEOF(msg, const struct envoy_type_matcher_v3_PathMatcher*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 10, NULL); }
+
+UPB_INLINE void envoy_config_rbac_v3_Permission_set_and_rules(envoy_config_rbac_v3_Permission *msg, envoy_config_rbac_v3_Permission_Set* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_rbac_v3_Permission_Set*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 1);
+}
+UPB_INLINE struct envoy_config_rbac_v3_Permission_Set* envoy_config_rbac_v3_Permission_mutable_and_rules(envoy_config_rbac_v3_Permission *msg, upb_arena *arena) {
+ struct envoy_config_rbac_v3_Permission_Set* sub = (struct envoy_config_rbac_v3_Permission_Set*)envoy_config_rbac_v3_Permission_and_rules(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_rbac_v3_Permission_Set*)_upb_msg_new(&envoy_config_rbac_v3_Permission_Set_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_rbac_v3_Permission_set_and_rules(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_rbac_v3_Permission_set_or_rules(envoy_config_rbac_v3_Permission *msg, envoy_config_rbac_v3_Permission_Set* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_rbac_v3_Permission_Set*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 2);
+}
+UPB_INLINE struct envoy_config_rbac_v3_Permission_Set* envoy_config_rbac_v3_Permission_mutable_or_rules(envoy_config_rbac_v3_Permission *msg, upb_arena *arena) {
+ struct envoy_config_rbac_v3_Permission_Set* sub = (struct envoy_config_rbac_v3_Permission_Set*)envoy_config_rbac_v3_Permission_or_rules(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_rbac_v3_Permission_Set*)_upb_msg_new(&envoy_config_rbac_v3_Permission_Set_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_rbac_v3_Permission_set_or_rules(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_rbac_v3_Permission_set_any(envoy_config_rbac_v3_Permission *msg, bool value) {
+ UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 3);
+}
+UPB_INLINE void envoy_config_rbac_v3_Permission_set_header(envoy_config_rbac_v3_Permission *msg, struct envoy_config_route_v3_HeaderMatcher* value) {
+ UPB_WRITE_ONEOF(msg, struct envoy_config_route_v3_HeaderMatcher*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 4);
+}
+UPB_INLINE struct envoy_config_route_v3_HeaderMatcher* envoy_config_rbac_v3_Permission_mutable_header(envoy_config_rbac_v3_Permission *msg, upb_arena *arena) {
+ struct envoy_config_route_v3_HeaderMatcher* sub = (struct envoy_config_route_v3_HeaderMatcher*)envoy_config_rbac_v3_Permission_header(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_route_v3_HeaderMatcher*)_upb_msg_new(&envoy_config_route_v3_HeaderMatcher_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_rbac_v3_Permission_set_header(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_rbac_v3_Permission_set_destination_ip(envoy_config_rbac_v3_Permission *msg, struct envoy_config_core_v3_CidrRange* value) {
+ UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_CidrRange*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 5);
+}
+UPB_INLINE struct envoy_config_core_v3_CidrRange* envoy_config_rbac_v3_Permission_mutable_destination_ip(envoy_config_rbac_v3_Permission *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_CidrRange* sub = (struct envoy_config_core_v3_CidrRange*)envoy_config_rbac_v3_Permission_destination_ip(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_CidrRange*)_upb_msg_new(&envoy_config_core_v3_CidrRange_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_rbac_v3_Permission_set_destination_ip(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_rbac_v3_Permission_set_destination_port(envoy_config_rbac_v3_Permission *msg, uint32_t value) {
+ UPB_WRITE_ONEOF(msg, uint32_t, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 6);
+}
+UPB_INLINE void envoy_config_rbac_v3_Permission_set_metadata(envoy_config_rbac_v3_Permission *msg, struct envoy_type_matcher_v3_MetadataMatcher* value) {
+ UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_MetadataMatcher*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 7);
+}
+UPB_INLINE struct envoy_type_matcher_v3_MetadataMatcher* envoy_config_rbac_v3_Permission_mutable_metadata(envoy_config_rbac_v3_Permission *msg, upb_arena *arena) {
+ struct envoy_type_matcher_v3_MetadataMatcher* sub = (struct envoy_type_matcher_v3_MetadataMatcher*)envoy_config_rbac_v3_Permission_metadata(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_type_matcher_v3_MetadataMatcher*)_upb_msg_new(&envoy_type_matcher_v3_MetadataMatcher_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_rbac_v3_Permission_set_metadata(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_rbac_v3_Permission_set_not_rule(envoy_config_rbac_v3_Permission *msg, envoy_config_rbac_v3_Permission* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_rbac_v3_Permission*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 8);
+}
+UPB_INLINE struct envoy_config_rbac_v3_Permission* envoy_config_rbac_v3_Permission_mutable_not_rule(envoy_config_rbac_v3_Permission *msg, upb_arena *arena) {
+ struct envoy_config_rbac_v3_Permission* sub = (struct envoy_config_rbac_v3_Permission*)envoy_config_rbac_v3_Permission_not_rule(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_rbac_v3_Permission*)_upb_msg_new(&envoy_config_rbac_v3_Permission_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_rbac_v3_Permission_set_not_rule(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_rbac_v3_Permission_set_requested_server_name(envoy_config_rbac_v3_Permission *msg, struct envoy_type_matcher_v3_StringMatcher* value) {
+ UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_StringMatcher*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 9);
+}
+UPB_INLINE struct envoy_type_matcher_v3_StringMatcher* envoy_config_rbac_v3_Permission_mutable_requested_server_name(envoy_config_rbac_v3_Permission *msg, upb_arena *arena) {
+ struct envoy_type_matcher_v3_StringMatcher* sub = (struct envoy_type_matcher_v3_StringMatcher*)envoy_config_rbac_v3_Permission_requested_server_name(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_type_matcher_v3_StringMatcher*)_upb_msg_new(&envoy_type_matcher_v3_StringMatcher_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_rbac_v3_Permission_set_requested_server_name(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_rbac_v3_Permission_set_url_path(envoy_config_rbac_v3_Permission *msg, struct envoy_type_matcher_v3_PathMatcher* value) {
+ UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_PathMatcher*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 10);
+}
+UPB_INLINE struct envoy_type_matcher_v3_PathMatcher* envoy_config_rbac_v3_Permission_mutable_url_path(envoy_config_rbac_v3_Permission *msg, upb_arena *arena) {
+ struct envoy_type_matcher_v3_PathMatcher* sub = (struct envoy_type_matcher_v3_PathMatcher*)envoy_config_rbac_v3_Permission_url_path(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_type_matcher_v3_PathMatcher*)_upb_msg_new(&envoy_type_matcher_v3_PathMatcher_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_rbac_v3_Permission_set_url_path(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.rbac.v3.Permission.Set */
+
+UPB_INLINE envoy_config_rbac_v3_Permission_Set *envoy_config_rbac_v3_Permission_Set_new(upb_arena *arena) {
+ return (envoy_config_rbac_v3_Permission_Set *)_upb_msg_new(&envoy_config_rbac_v3_Permission_Set_msginit, arena);
+}
+UPB_INLINE envoy_config_rbac_v3_Permission_Set *envoy_config_rbac_v3_Permission_Set_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_rbac_v3_Permission_Set *ret = envoy_config_rbac_v3_Permission_Set_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_rbac_v3_Permission_Set_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_rbac_v3_Permission_Set_serialize(const envoy_config_rbac_v3_Permission_Set *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_rbac_v3_Permission_Set_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_rbac_v3_Permission_Set_has_rules(const envoy_config_rbac_v3_Permission_Set *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE const envoy_config_rbac_v3_Permission* const* envoy_config_rbac_v3_Permission_Set_rules(const envoy_config_rbac_v3_Permission_Set *msg, size_t *len) { return (const envoy_config_rbac_v3_Permission* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
+
+UPB_INLINE envoy_config_rbac_v3_Permission** envoy_config_rbac_v3_Permission_Set_mutable_rules(envoy_config_rbac_v3_Permission_Set *msg, size_t *len) {
+ return (envoy_config_rbac_v3_Permission**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
+}
+UPB_INLINE envoy_config_rbac_v3_Permission** envoy_config_rbac_v3_Permission_Set_resize_rules(envoy_config_rbac_v3_Permission_Set *msg, size_t len, upb_arena *arena) {
+ return (envoy_config_rbac_v3_Permission**)_upb_array_resize_accessor(msg, UPB_SIZE(0, 0), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_config_rbac_v3_Permission* envoy_config_rbac_v3_Permission_Set_add_rules(envoy_config_rbac_v3_Permission_Set *msg, upb_arena *arena) {
+ struct envoy_config_rbac_v3_Permission* sub = (struct envoy_config_rbac_v3_Permission*)_upb_msg_new(&envoy_config_rbac_v3_Permission_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(0, 0), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+
+/* envoy.config.rbac.v3.Principal */
+
+UPB_INLINE envoy_config_rbac_v3_Principal *envoy_config_rbac_v3_Principal_new(upb_arena *arena) {
+ return (envoy_config_rbac_v3_Principal *)_upb_msg_new(&envoy_config_rbac_v3_Principal_msginit, arena);
+}
+UPB_INLINE envoy_config_rbac_v3_Principal *envoy_config_rbac_v3_Principal_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_rbac_v3_Principal *ret = envoy_config_rbac_v3_Principal_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_rbac_v3_Principal_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_rbac_v3_Principal_serialize(const envoy_config_rbac_v3_Principal *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_rbac_v3_Principal_msginit, arena, len);
+}
+
+typedef enum {
+ envoy_config_rbac_v3_Principal_identifier_and_ids = 1,
+ envoy_config_rbac_v3_Principal_identifier_or_ids = 2,
+ envoy_config_rbac_v3_Principal_identifier_any = 3,
+ envoy_config_rbac_v3_Principal_identifier_authenticated = 4,
+ envoy_config_rbac_v3_Principal_identifier_source_ip = 5,
+ envoy_config_rbac_v3_Principal_identifier_direct_remote_ip = 10,
+ envoy_config_rbac_v3_Principal_identifier_remote_ip = 11,
+ envoy_config_rbac_v3_Principal_identifier_header = 6,
+ envoy_config_rbac_v3_Principal_identifier_url_path = 9,
+ envoy_config_rbac_v3_Principal_identifier_metadata = 7,
+ envoy_config_rbac_v3_Principal_identifier_not_id = 8,
+ envoy_config_rbac_v3_Principal_identifier_NOT_SET = 0
+} envoy_config_rbac_v3_Principal_identifier_oneofcases;
+UPB_INLINE envoy_config_rbac_v3_Principal_identifier_oneofcases envoy_config_rbac_v3_Principal_identifier_case(const envoy_config_rbac_v3_Principal* msg) { return (envoy_config_rbac_v3_Principal_identifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 8), int32_t); }
+
+UPB_INLINE bool envoy_config_rbac_v3_Principal_has_and_ids(const envoy_config_rbac_v3_Principal *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 1; }
+UPB_INLINE const envoy_config_rbac_v3_Principal_Set* envoy_config_rbac_v3_Principal_and_ids(const envoy_config_rbac_v3_Principal *msg) { return UPB_READ_ONEOF(msg, const envoy_config_rbac_v3_Principal_Set*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 1, NULL); }
+UPB_INLINE bool envoy_config_rbac_v3_Principal_has_or_ids(const envoy_config_rbac_v3_Principal *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 2; }
+UPB_INLINE const envoy_config_rbac_v3_Principal_Set* envoy_config_rbac_v3_Principal_or_ids(const envoy_config_rbac_v3_Principal *msg) { return UPB_READ_ONEOF(msg, const envoy_config_rbac_v3_Principal_Set*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 2, NULL); }
+UPB_INLINE bool envoy_config_rbac_v3_Principal_has_any(const envoy_config_rbac_v3_Principal *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 3; }
+UPB_INLINE bool envoy_config_rbac_v3_Principal_any(const envoy_config_rbac_v3_Principal *msg) { return UPB_READ_ONEOF(msg, bool, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 3, false); }
+UPB_INLINE bool envoy_config_rbac_v3_Principal_has_authenticated(const envoy_config_rbac_v3_Principal *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 4; }
+UPB_INLINE const envoy_config_rbac_v3_Principal_Authenticated* envoy_config_rbac_v3_Principal_authenticated(const envoy_config_rbac_v3_Principal *msg) { return UPB_READ_ONEOF(msg, const envoy_config_rbac_v3_Principal_Authenticated*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 4, NULL); }
+UPB_INLINE bool envoy_config_rbac_v3_Principal_has_source_ip(const envoy_config_rbac_v3_Principal *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 5; }
+UPB_INLINE const struct envoy_config_core_v3_CidrRange* envoy_config_rbac_v3_Principal_source_ip(const envoy_config_rbac_v3_Principal *msg) { return UPB_READ_ONEOF(msg, const struct envoy_config_core_v3_CidrRange*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 5, NULL); }
+UPB_INLINE bool envoy_config_rbac_v3_Principal_has_header(const envoy_config_rbac_v3_Principal *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 6; }
+UPB_INLINE const struct envoy_config_route_v3_HeaderMatcher* envoy_config_rbac_v3_Principal_header(const envoy_config_rbac_v3_Principal *msg) { return UPB_READ_ONEOF(msg, const struct envoy_config_route_v3_HeaderMatcher*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 6, NULL); }
+UPB_INLINE bool envoy_config_rbac_v3_Principal_has_metadata(const envoy_config_rbac_v3_Principal *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 7; }
+UPB_INLINE const struct envoy_type_matcher_v3_MetadataMatcher* envoy_config_rbac_v3_Principal_metadata(const envoy_config_rbac_v3_Principal *msg) { return UPB_READ_ONEOF(msg, const struct envoy_type_matcher_v3_MetadataMatcher*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 7, NULL); }
+UPB_INLINE bool envoy_config_rbac_v3_Principal_has_not_id(const envoy_config_rbac_v3_Principal *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 8; }
+UPB_INLINE const envoy_config_rbac_v3_Principal* envoy_config_rbac_v3_Principal_not_id(const envoy_config_rbac_v3_Principal *msg) { return UPB_READ_ONEOF(msg, const envoy_config_rbac_v3_Principal*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 8, NULL); }
+UPB_INLINE bool envoy_config_rbac_v3_Principal_has_url_path(const envoy_config_rbac_v3_Principal *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 9; }
+UPB_INLINE const struct envoy_type_matcher_v3_PathMatcher* envoy_config_rbac_v3_Principal_url_path(const envoy_config_rbac_v3_Principal *msg) { return UPB_READ_ONEOF(msg, const struct envoy_type_matcher_v3_PathMatcher*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 9, NULL); }
+UPB_INLINE bool envoy_config_rbac_v3_Principal_has_direct_remote_ip(const envoy_config_rbac_v3_Principal *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 10; }
+UPB_INLINE const struct envoy_config_core_v3_CidrRange* envoy_config_rbac_v3_Principal_direct_remote_ip(const envoy_config_rbac_v3_Principal *msg) { return UPB_READ_ONEOF(msg, const struct envoy_config_core_v3_CidrRange*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 10, NULL); }
+UPB_INLINE bool envoy_config_rbac_v3_Principal_has_remote_ip(const envoy_config_rbac_v3_Principal *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 11; }
+UPB_INLINE const struct envoy_config_core_v3_CidrRange* envoy_config_rbac_v3_Principal_remote_ip(const envoy_config_rbac_v3_Principal *msg) { return UPB_READ_ONEOF(msg, const struct envoy_config_core_v3_CidrRange*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 11, NULL); }
+
+UPB_INLINE void envoy_config_rbac_v3_Principal_set_and_ids(envoy_config_rbac_v3_Principal *msg, envoy_config_rbac_v3_Principal_Set* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_rbac_v3_Principal_Set*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 1);
+}
+UPB_INLINE struct envoy_config_rbac_v3_Principal_Set* envoy_config_rbac_v3_Principal_mutable_and_ids(envoy_config_rbac_v3_Principal *msg, upb_arena *arena) {
+ struct envoy_config_rbac_v3_Principal_Set* sub = (struct envoy_config_rbac_v3_Principal_Set*)envoy_config_rbac_v3_Principal_and_ids(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_rbac_v3_Principal_Set*)_upb_msg_new(&envoy_config_rbac_v3_Principal_Set_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_rbac_v3_Principal_set_and_ids(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_rbac_v3_Principal_set_or_ids(envoy_config_rbac_v3_Principal *msg, envoy_config_rbac_v3_Principal_Set* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_rbac_v3_Principal_Set*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 2);
+}
+UPB_INLINE struct envoy_config_rbac_v3_Principal_Set* envoy_config_rbac_v3_Principal_mutable_or_ids(envoy_config_rbac_v3_Principal *msg, upb_arena *arena) {
+ struct envoy_config_rbac_v3_Principal_Set* sub = (struct envoy_config_rbac_v3_Principal_Set*)envoy_config_rbac_v3_Principal_or_ids(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_rbac_v3_Principal_Set*)_upb_msg_new(&envoy_config_rbac_v3_Principal_Set_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_rbac_v3_Principal_set_or_ids(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_rbac_v3_Principal_set_any(envoy_config_rbac_v3_Principal *msg, bool value) {
+ UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 3);
+}
+UPB_INLINE void envoy_config_rbac_v3_Principal_set_authenticated(envoy_config_rbac_v3_Principal *msg, envoy_config_rbac_v3_Principal_Authenticated* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_rbac_v3_Principal_Authenticated*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 4);
+}
+UPB_INLINE struct envoy_config_rbac_v3_Principal_Authenticated* envoy_config_rbac_v3_Principal_mutable_authenticated(envoy_config_rbac_v3_Principal *msg, upb_arena *arena) {
+ struct envoy_config_rbac_v3_Principal_Authenticated* sub = (struct envoy_config_rbac_v3_Principal_Authenticated*)envoy_config_rbac_v3_Principal_authenticated(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_rbac_v3_Principal_Authenticated*)_upb_msg_new(&envoy_config_rbac_v3_Principal_Authenticated_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_rbac_v3_Principal_set_authenticated(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_rbac_v3_Principal_set_source_ip(envoy_config_rbac_v3_Principal *msg, struct envoy_config_core_v3_CidrRange* value) {
+ UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_CidrRange*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 5);
+}
+UPB_INLINE struct envoy_config_core_v3_CidrRange* envoy_config_rbac_v3_Principal_mutable_source_ip(envoy_config_rbac_v3_Principal *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_CidrRange* sub = (struct envoy_config_core_v3_CidrRange*)envoy_config_rbac_v3_Principal_source_ip(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_CidrRange*)_upb_msg_new(&envoy_config_core_v3_CidrRange_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_rbac_v3_Principal_set_source_ip(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_rbac_v3_Principal_set_header(envoy_config_rbac_v3_Principal *msg, struct envoy_config_route_v3_HeaderMatcher* value) {
+ UPB_WRITE_ONEOF(msg, struct envoy_config_route_v3_HeaderMatcher*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 6);
+}
+UPB_INLINE struct envoy_config_route_v3_HeaderMatcher* envoy_config_rbac_v3_Principal_mutable_header(envoy_config_rbac_v3_Principal *msg, upb_arena *arena) {
+ struct envoy_config_route_v3_HeaderMatcher* sub = (struct envoy_config_route_v3_HeaderMatcher*)envoy_config_rbac_v3_Principal_header(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_route_v3_HeaderMatcher*)_upb_msg_new(&envoy_config_route_v3_HeaderMatcher_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_rbac_v3_Principal_set_header(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_rbac_v3_Principal_set_metadata(envoy_config_rbac_v3_Principal *msg, struct envoy_type_matcher_v3_MetadataMatcher* value) {
+ UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_MetadataMatcher*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 7);
+}
+UPB_INLINE struct envoy_type_matcher_v3_MetadataMatcher* envoy_config_rbac_v3_Principal_mutable_metadata(envoy_config_rbac_v3_Principal *msg, upb_arena *arena) {
+ struct envoy_type_matcher_v3_MetadataMatcher* sub = (struct envoy_type_matcher_v3_MetadataMatcher*)envoy_config_rbac_v3_Principal_metadata(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_type_matcher_v3_MetadataMatcher*)_upb_msg_new(&envoy_type_matcher_v3_MetadataMatcher_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_rbac_v3_Principal_set_metadata(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_rbac_v3_Principal_set_not_id(envoy_config_rbac_v3_Principal *msg, envoy_config_rbac_v3_Principal* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_rbac_v3_Principal*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 8);
+}
+UPB_INLINE struct envoy_config_rbac_v3_Principal* envoy_config_rbac_v3_Principal_mutable_not_id(envoy_config_rbac_v3_Principal *msg, upb_arena *arena) {
+ struct envoy_config_rbac_v3_Principal* sub = (struct envoy_config_rbac_v3_Principal*)envoy_config_rbac_v3_Principal_not_id(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_rbac_v3_Principal*)_upb_msg_new(&envoy_config_rbac_v3_Principal_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_rbac_v3_Principal_set_not_id(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_rbac_v3_Principal_set_url_path(envoy_config_rbac_v3_Principal *msg, struct envoy_type_matcher_v3_PathMatcher* value) {
+ UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_PathMatcher*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 9);
+}
+UPB_INLINE struct envoy_type_matcher_v3_PathMatcher* envoy_config_rbac_v3_Principal_mutable_url_path(envoy_config_rbac_v3_Principal *msg, upb_arena *arena) {
+ struct envoy_type_matcher_v3_PathMatcher* sub = (struct envoy_type_matcher_v3_PathMatcher*)envoy_config_rbac_v3_Principal_url_path(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_type_matcher_v3_PathMatcher*)_upb_msg_new(&envoy_type_matcher_v3_PathMatcher_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_rbac_v3_Principal_set_url_path(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_rbac_v3_Principal_set_direct_remote_ip(envoy_config_rbac_v3_Principal *msg, struct envoy_config_core_v3_CidrRange* value) {
+ UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_CidrRange*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 10);
+}
+UPB_INLINE struct envoy_config_core_v3_CidrRange* envoy_config_rbac_v3_Principal_mutable_direct_remote_ip(envoy_config_rbac_v3_Principal *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_CidrRange* sub = (struct envoy_config_core_v3_CidrRange*)envoy_config_rbac_v3_Principal_direct_remote_ip(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_CidrRange*)_upb_msg_new(&envoy_config_core_v3_CidrRange_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_rbac_v3_Principal_set_direct_remote_ip(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_rbac_v3_Principal_set_remote_ip(envoy_config_rbac_v3_Principal *msg, struct envoy_config_core_v3_CidrRange* value) {
+ UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_CidrRange*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 11);
+}
+UPB_INLINE struct envoy_config_core_v3_CidrRange* envoy_config_rbac_v3_Principal_mutable_remote_ip(envoy_config_rbac_v3_Principal *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_CidrRange* sub = (struct envoy_config_core_v3_CidrRange*)envoy_config_rbac_v3_Principal_remote_ip(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_CidrRange*)_upb_msg_new(&envoy_config_core_v3_CidrRange_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_rbac_v3_Principal_set_remote_ip(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.rbac.v3.Principal.Set */
+
+UPB_INLINE envoy_config_rbac_v3_Principal_Set *envoy_config_rbac_v3_Principal_Set_new(upb_arena *arena) {
+ return (envoy_config_rbac_v3_Principal_Set *)_upb_msg_new(&envoy_config_rbac_v3_Principal_Set_msginit, arena);
+}
+UPB_INLINE envoy_config_rbac_v3_Principal_Set *envoy_config_rbac_v3_Principal_Set_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_rbac_v3_Principal_Set *ret = envoy_config_rbac_v3_Principal_Set_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_rbac_v3_Principal_Set_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_rbac_v3_Principal_Set_serialize(const envoy_config_rbac_v3_Principal_Set *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_rbac_v3_Principal_Set_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_rbac_v3_Principal_Set_has_ids(const envoy_config_rbac_v3_Principal_Set *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE const envoy_config_rbac_v3_Principal* const* envoy_config_rbac_v3_Principal_Set_ids(const envoy_config_rbac_v3_Principal_Set *msg, size_t *len) { return (const envoy_config_rbac_v3_Principal* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
+
+UPB_INLINE envoy_config_rbac_v3_Principal** envoy_config_rbac_v3_Principal_Set_mutable_ids(envoy_config_rbac_v3_Principal_Set *msg, size_t *len) {
+ return (envoy_config_rbac_v3_Principal**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
+}
+UPB_INLINE envoy_config_rbac_v3_Principal** envoy_config_rbac_v3_Principal_Set_resize_ids(envoy_config_rbac_v3_Principal_Set *msg, size_t len, upb_arena *arena) {
+ return (envoy_config_rbac_v3_Principal**)_upb_array_resize_accessor(msg, UPB_SIZE(0, 0), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_config_rbac_v3_Principal* envoy_config_rbac_v3_Principal_Set_add_ids(envoy_config_rbac_v3_Principal_Set *msg, upb_arena *arena) {
+ struct envoy_config_rbac_v3_Principal* sub = (struct envoy_config_rbac_v3_Principal*)_upb_msg_new(&envoy_config_rbac_v3_Principal_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(0, 0), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+
+/* envoy.config.rbac.v3.Principal.Authenticated */
+
+UPB_INLINE envoy_config_rbac_v3_Principal_Authenticated *envoy_config_rbac_v3_Principal_Authenticated_new(upb_arena *arena) {
+ return (envoy_config_rbac_v3_Principal_Authenticated *)_upb_msg_new(&envoy_config_rbac_v3_Principal_Authenticated_msginit, arena);
+}
+UPB_INLINE envoy_config_rbac_v3_Principal_Authenticated *envoy_config_rbac_v3_Principal_Authenticated_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_rbac_v3_Principal_Authenticated *ret = envoy_config_rbac_v3_Principal_Authenticated_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_rbac_v3_Principal_Authenticated_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_rbac_v3_Principal_Authenticated_serialize(const envoy_config_rbac_v3_Principal_Authenticated *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_rbac_v3_Principal_Authenticated_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_rbac_v3_Principal_Authenticated_has_principal_name(const envoy_config_rbac_v3_Principal_Authenticated *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE const struct envoy_type_matcher_v3_StringMatcher* envoy_config_rbac_v3_Principal_Authenticated_principal_name(const envoy_config_rbac_v3_Principal_Authenticated *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct envoy_type_matcher_v3_StringMatcher*); }
+
+UPB_INLINE void envoy_config_rbac_v3_Principal_Authenticated_set_principal_name(envoy_config_rbac_v3_Principal_Authenticated *msg, struct envoy_type_matcher_v3_StringMatcher* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct envoy_type_matcher_v3_StringMatcher*) = value;
+}
+UPB_INLINE struct envoy_type_matcher_v3_StringMatcher* envoy_config_rbac_v3_Principal_Authenticated_mutable_principal_name(envoy_config_rbac_v3_Principal_Authenticated *msg, upb_arena *arena) {
+ struct envoy_type_matcher_v3_StringMatcher* sub = (struct envoy_type_matcher_v3_StringMatcher*)envoy_config_rbac_v3_Principal_Authenticated_principal_name(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_type_matcher_v3_StringMatcher*)_upb_msg_new(&envoy_type_matcher_v3_StringMatcher_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_rbac_v3_Principal_Authenticated_set_principal_name(msg, sub);
+ }
+ return sub;
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_CONFIG_RBAC_V3_RBAC_PROTO_UPB_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.c
index 0827f0d17b1..6ad24422585 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.c
@@ -1,63 +1,63 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/config/route/v3/route.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include <stddef.h>
-#include "upb/msg.h"
-#include "envoy/config/route/v3/route.upb.h"
-#include "envoy/config/core/v3/base.upb.h"
-#include "envoy/config/core/v3/config_source.upb.h"
-#include "envoy/config/route/v3/route_components.upb.h"
-#include "google/protobuf/wrappers.upb.h"
-#include "udpa/annotations/status.upb.h"
-#include "udpa/annotations/versioning.upb.h"
-#include "validate/validate.upb.h"
-
-#include "upb/port_def.inc"
-
-static const upb_msglayout *const envoy_config_route_v3_RouteConfiguration_submsgs[5] = {
- &envoy_config_core_v3_HeaderValueOption_msginit,
- &envoy_config_route_v3_Vhds_msginit,
- &envoy_config_route_v3_VirtualHost_msginit,
- &google_protobuf_BoolValue_msginit,
-};
-
-static const upb_msglayout_field envoy_config_route_v3_RouteConfiguration__fields[10] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(20, 40), 0, 2, 11, 3},
- {3, UPB_SIZE(24, 48), 0, 0, 9, 3},
- {4, UPB_SIZE(28, 56), 0, 0, 11, 3},
- {5, UPB_SIZE(32, 64), 0, 0, 9, 3},
- {6, UPB_SIZE(36, 72), 0, 0, 11, 3},
- {7, UPB_SIZE(12, 24), 0, 3, 11, 1},
- {8, UPB_SIZE(40, 80), 0, 0, 9, 3},
- {9, UPB_SIZE(16, 32), 0, 1, 11, 1},
- {10, UPB_SIZE(0, 0), 0, 0, 8, 1},
-};
-
-const upb_msglayout envoy_config_route_v3_RouteConfiguration_msginit = {
- &envoy_config_route_v3_RouteConfiguration_submsgs[0],
- &envoy_config_route_v3_RouteConfiguration__fields[0],
- UPB_SIZE(48, 96), 10, false,
-};
-
-static const upb_msglayout *const envoy_config_route_v3_Vhds_submsgs[1] = {
- &envoy_config_core_v3_ConfigSource_msginit,
-};
-
-static const upb_msglayout_field envoy_config_route_v3_Vhds__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
-};
-
-const upb_msglayout envoy_config_route_v3_Vhds_msginit = {
- &envoy_config_route_v3_Vhds_submsgs[0],
- &envoy_config_route_v3_Vhds__fields[0],
- UPB_SIZE(4, 8), 1, false,
-};
-
-#include "upb/port_undef.inc"
-
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/route/v3/route.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg.h"
+#include "envoy/config/route/v3/route.upb.h"
+#include "envoy/config/core/v3/base.upb.h"
+#include "envoy/config/core/v3/config_source.upb.h"
+#include "envoy/config/route/v3/route_components.upb.h"
+#include "google/protobuf/wrappers.upb.h"
+#include "udpa/annotations/status.upb.h"
+#include "udpa/annotations/versioning.upb.h"
+#include "validate/validate.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_msglayout *const envoy_config_route_v3_RouteConfiguration_submsgs[5] = {
+ &envoy_config_core_v3_HeaderValueOption_msginit,
+ &envoy_config_route_v3_Vhds_msginit,
+ &envoy_config_route_v3_VirtualHost_msginit,
+ &google_protobuf_BoolValue_msginit,
+};
+
+static const upb_msglayout_field envoy_config_route_v3_RouteConfiguration__fields[10] = {
+ {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
+ {2, UPB_SIZE(20, 40), 0, 2, 11, 3},
+ {3, UPB_SIZE(24, 48), 0, 0, 9, 3},
+ {4, UPB_SIZE(28, 56), 0, 0, 11, 3},
+ {5, UPB_SIZE(32, 64), 0, 0, 9, 3},
+ {6, UPB_SIZE(36, 72), 0, 0, 11, 3},
+ {7, UPB_SIZE(12, 24), 0, 3, 11, 1},
+ {8, UPB_SIZE(40, 80), 0, 0, 9, 3},
+ {9, UPB_SIZE(16, 32), 0, 1, 11, 1},
+ {10, UPB_SIZE(0, 0), 0, 0, 8, 1},
+};
+
+const upb_msglayout envoy_config_route_v3_RouteConfiguration_msginit = {
+ &envoy_config_route_v3_RouteConfiguration_submsgs[0],
+ &envoy_config_route_v3_RouteConfiguration__fields[0],
+ UPB_SIZE(48, 96), 10, false,
+};
+
+static const upb_msglayout *const envoy_config_route_v3_Vhds_submsgs[1] = {
+ &envoy_config_core_v3_ConfigSource_msginit,
+};
+
+static const upb_msglayout_field envoy_config_route_v3_Vhds__fields[1] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
+};
+
+const upb_msglayout envoy_config_route_v3_Vhds_msginit = {
+ &envoy_config_route_v3_Vhds_submsgs[0],
+ &envoy_config_route_v3_Vhds__fields[0],
+ UPB_SIZE(4, 8), 1, false,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.h
index b87931e75cf..4e5adc0c34e 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.h
@@ -1,204 +1,204 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/config/route/v3/route.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef ENVOY_CONFIG_ROUTE_V3_ROUTE_PROTO_UPB_H_
-#define ENVOY_CONFIG_ROUTE_V3_ROUTE_PROTO_UPB_H_
-
-#include "upb/msg.h"
-#include "upb/decode.h"
-#include "upb/encode.h"
-
-#include "upb/port_def.inc"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct envoy_config_route_v3_RouteConfiguration;
-struct envoy_config_route_v3_Vhds;
-typedef struct envoy_config_route_v3_RouteConfiguration envoy_config_route_v3_RouteConfiguration;
-typedef struct envoy_config_route_v3_Vhds envoy_config_route_v3_Vhds;
-extern const upb_msglayout envoy_config_route_v3_RouteConfiguration_msginit;
-extern const upb_msglayout envoy_config_route_v3_Vhds_msginit;
-struct envoy_config_core_v3_ConfigSource;
-struct envoy_config_core_v3_HeaderValueOption;
-struct envoy_config_route_v3_VirtualHost;
-struct google_protobuf_BoolValue;
-extern const upb_msglayout envoy_config_core_v3_ConfigSource_msginit;
-extern const upb_msglayout envoy_config_core_v3_HeaderValueOption_msginit;
-extern const upb_msglayout envoy_config_route_v3_VirtualHost_msginit;
-extern const upb_msglayout google_protobuf_BoolValue_msginit;
-
-
-/* envoy.config.route.v3.RouteConfiguration */
-
-UPB_INLINE envoy_config_route_v3_RouteConfiguration *envoy_config_route_v3_RouteConfiguration_new(upb_arena *arena) {
- return (envoy_config_route_v3_RouteConfiguration *)_upb_msg_new(&envoy_config_route_v3_RouteConfiguration_msginit, arena);
-}
-UPB_INLINE envoy_config_route_v3_RouteConfiguration *envoy_config_route_v3_RouteConfiguration_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_route_v3_RouteConfiguration *ret = envoy_config_route_v3_RouteConfiguration_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RouteConfiguration_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_route_v3_RouteConfiguration_serialize(const envoy_config_route_v3_RouteConfiguration *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_route_v3_RouteConfiguration_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview envoy_config_route_v3_RouteConfiguration_name(const envoy_config_route_v3_RouteConfiguration *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
-UPB_INLINE bool envoy_config_route_v3_RouteConfiguration_has_virtual_hosts(const envoy_config_route_v3_RouteConfiguration *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 40)); }
-UPB_INLINE const struct envoy_config_route_v3_VirtualHost* const* envoy_config_route_v3_RouteConfiguration_virtual_hosts(const envoy_config_route_v3_RouteConfiguration *msg, size_t *len) { return (const struct envoy_config_route_v3_VirtualHost* const*)_upb_array_accessor(msg, UPB_SIZE(20, 40), len); }
-UPB_INLINE upb_strview const* envoy_config_route_v3_RouteConfiguration_internal_only_headers(const envoy_config_route_v3_RouteConfiguration *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(24, 48), len); }
-UPB_INLINE bool envoy_config_route_v3_RouteConfiguration_has_response_headers_to_add(const envoy_config_route_v3_RouteConfiguration *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 56)); }
-UPB_INLINE const struct envoy_config_core_v3_HeaderValueOption* const* envoy_config_route_v3_RouteConfiguration_response_headers_to_add(const envoy_config_route_v3_RouteConfiguration *msg, size_t *len) { return (const struct envoy_config_core_v3_HeaderValueOption* const*)_upb_array_accessor(msg, UPB_SIZE(28, 56), len); }
-UPB_INLINE upb_strview const* envoy_config_route_v3_RouteConfiguration_response_headers_to_remove(const envoy_config_route_v3_RouteConfiguration *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(32, 64), len); }
-UPB_INLINE bool envoy_config_route_v3_RouteConfiguration_has_request_headers_to_add(const envoy_config_route_v3_RouteConfiguration *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(36, 72)); }
-UPB_INLINE const struct envoy_config_core_v3_HeaderValueOption* const* envoy_config_route_v3_RouteConfiguration_request_headers_to_add(const envoy_config_route_v3_RouteConfiguration *msg, size_t *len) { return (const struct envoy_config_core_v3_HeaderValueOption* const*)_upb_array_accessor(msg, UPB_SIZE(36, 72), len); }
-UPB_INLINE bool envoy_config_route_v3_RouteConfiguration_has_validate_clusters(const envoy_config_route_v3_RouteConfiguration *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
-UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_route_v3_RouteConfiguration_validate_clusters(const envoy_config_route_v3_RouteConfiguration *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_protobuf_BoolValue*); }
-UPB_INLINE upb_strview const* envoy_config_route_v3_RouteConfiguration_request_headers_to_remove(const envoy_config_route_v3_RouteConfiguration *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(40, 80), len); }
-UPB_INLINE bool envoy_config_route_v3_RouteConfiguration_has_vhds(const envoy_config_route_v3_RouteConfiguration *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); }
-UPB_INLINE const envoy_config_route_v3_Vhds* envoy_config_route_v3_RouteConfiguration_vhds(const envoy_config_route_v3_RouteConfiguration *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const envoy_config_route_v3_Vhds*); }
-UPB_INLINE bool envoy_config_route_v3_RouteConfiguration_most_specific_header_mutations_wins(const envoy_config_route_v3_RouteConfiguration *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); }
-
-UPB_INLINE void envoy_config_route_v3_RouteConfiguration_set_name(envoy_config_route_v3_RouteConfiguration *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
-}
-UPB_INLINE struct envoy_config_route_v3_VirtualHost** envoy_config_route_v3_RouteConfiguration_mutable_virtual_hosts(envoy_config_route_v3_RouteConfiguration *msg, size_t *len) {
- return (struct envoy_config_route_v3_VirtualHost**)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 40), len);
-}
-UPB_INLINE struct envoy_config_route_v3_VirtualHost** envoy_config_route_v3_RouteConfiguration_resize_virtual_hosts(envoy_config_route_v3_RouteConfiguration *msg, size_t len, upb_arena *arena) {
- return (struct envoy_config_route_v3_VirtualHost**)_upb_array_resize_accessor(msg, UPB_SIZE(20, 40), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_config_route_v3_VirtualHost* envoy_config_route_v3_RouteConfiguration_add_virtual_hosts(envoy_config_route_v3_RouteConfiguration *msg, upb_arena *arena) {
- struct envoy_config_route_v3_VirtualHost* sub = (struct envoy_config_route_v3_VirtualHost*)_upb_msg_new(&envoy_config_route_v3_VirtualHost_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(20, 40), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-UPB_INLINE upb_strview* envoy_config_route_v3_RouteConfiguration_mutable_internal_only_headers(envoy_config_route_v3_RouteConfiguration *msg, size_t *len) {
- return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 48), len);
-}
-UPB_INLINE upb_strview* envoy_config_route_v3_RouteConfiguration_resize_internal_only_headers(envoy_config_route_v3_RouteConfiguration *msg, size_t len, upb_arena *arena) {
- return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(24, 48), len, UPB_TYPE_STRING, arena);
-}
-UPB_INLINE bool envoy_config_route_v3_RouteConfiguration_add_internal_only_headers(envoy_config_route_v3_RouteConfiguration *msg, upb_strview val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(24, 48), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
- arena);
-}
-UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_config_route_v3_RouteConfiguration_mutable_response_headers_to_add(envoy_config_route_v3_RouteConfiguration *msg, size_t *len) {
- return (struct envoy_config_core_v3_HeaderValueOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 56), len);
-}
-UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_config_route_v3_RouteConfiguration_resize_response_headers_to_add(envoy_config_route_v3_RouteConfiguration *msg, size_t len, upb_arena *arena) {
- return (struct envoy_config_core_v3_HeaderValueOption**)_upb_array_resize_accessor(msg, UPB_SIZE(28, 56), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_config_core_v3_HeaderValueOption* envoy_config_route_v3_RouteConfiguration_add_response_headers_to_add(envoy_config_route_v3_RouteConfiguration *msg, upb_arena *arena) {
- struct envoy_config_core_v3_HeaderValueOption* sub = (struct envoy_config_core_v3_HeaderValueOption*)_upb_msg_new(&envoy_config_core_v3_HeaderValueOption_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(28, 56), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-UPB_INLINE upb_strview* envoy_config_route_v3_RouteConfiguration_mutable_response_headers_to_remove(envoy_config_route_v3_RouteConfiguration *msg, size_t *len) {
- return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(32, 64), len);
-}
-UPB_INLINE upb_strview* envoy_config_route_v3_RouteConfiguration_resize_response_headers_to_remove(envoy_config_route_v3_RouteConfiguration *msg, size_t len, upb_arena *arena) {
- return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(32, 64), len, UPB_TYPE_STRING, arena);
-}
-UPB_INLINE bool envoy_config_route_v3_RouteConfiguration_add_response_headers_to_remove(envoy_config_route_v3_RouteConfiguration *msg, upb_strview val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(32, 64), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
- arena);
-}
-UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_config_route_v3_RouteConfiguration_mutable_request_headers_to_add(envoy_config_route_v3_RouteConfiguration *msg, size_t *len) {
- return (struct envoy_config_core_v3_HeaderValueOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(36, 72), len);
-}
-UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_config_route_v3_RouteConfiguration_resize_request_headers_to_add(envoy_config_route_v3_RouteConfiguration *msg, size_t len, upb_arena *arena) {
- return (struct envoy_config_core_v3_HeaderValueOption**)_upb_array_resize_accessor(msg, UPB_SIZE(36, 72), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_config_core_v3_HeaderValueOption* envoy_config_route_v3_RouteConfiguration_add_request_headers_to_add(envoy_config_route_v3_RouteConfiguration *msg, upb_arena *arena) {
- struct envoy_config_core_v3_HeaderValueOption* sub = (struct envoy_config_core_v3_HeaderValueOption*)_upb_msg_new(&envoy_config_core_v3_HeaderValueOption_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(36, 72), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-UPB_INLINE void envoy_config_route_v3_RouteConfiguration_set_validate_clusters(envoy_config_route_v3_RouteConfiguration *msg, struct google_protobuf_BoolValue* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_protobuf_BoolValue*) = value;
-}
-UPB_INLINE struct google_protobuf_BoolValue* envoy_config_route_v3_RouteConfiguration_mutable_validate_clusters(envoy_config_route_v3_RouteConfiguration *msg, upb_arena *arena) {
- struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_route_v3_RouteConfiguration_validate_clusters(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_BoolValue*)_upb_msg_new(&google_protobuf_BoolValue_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_RouteConfiguration_set_validate_clusters(msg, sub);
- }
- return sub;
-}
-UPB_INLINE upb_strview* envoy_config_route_v3_RouteConfiguration_mutable_request_headers_to_remove(envoy_config_route_v3_RouteConfiguration *msg, size_t *len) {
- return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(40, 80), len);
-}
-UPB_INLINE upb_strview* envoy_config_route_v3_RouteConfiguration_resize_request_headers_to_remove(envoy_config_route_v3_RouteConfiguration *msg, size_t len, upb_arena *arena) {
- return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(40, 80), len, UPB_TYPE_STRING, arena);
-}
-UPB_INLINE bool envoy_config_route_v3_RouteConfiguration_add_request_headers_to_remove(envoy_config_route_v3_RouteConfiguration *msg, upb_strview val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(40, 80), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
- arena);
-}
-UPB_INLINE void envoy_config_route_v3_RouteConfiguration_set_vhds(envoy_config_route_v3_RouteConfiguration *msg, envoy_config_route_v3_Vhds* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(16, 32), envoy_config_route_v3_Vhds*) = value;
-}
-UPB_INLINE struct envoy_config_route_v3_Vhds* envoy_config_route_v3_RouteConfiguration_mutable_vhds(envoy_config_route_v3_RouteConfiguration *msg, upb_arena *arena) {
- struct envoy_config_route_v3_Vhds* sub = (struct envoy_config_route_v3_Vhds*)envoy_config_route_v3_RouteConfiguration_vhds(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_route_v3_Vhds*)_upb_msg_new(&envoy_config_route_v3_Vhds_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_RouteConfiguration_set_vhds(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_route_v3_RouteConfiguration_set_most_specific_header_mutations_wins(envoy_config_route_v3_RouteConfiguration *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
-}
-
-/* envoy.config.route.v3.Vhds */
-
-UPB_INLINE envoy_config_route_v3_Vhds *envoy_config_route_v3_Vhds_new(upb_arena *arena) {
- return (envoy_config_route_v3_Vhds *)_upb_msg_new(&envoy_config_route_v3_Vhds_msginit, arena);
-}
-UPB_INLINE envoy_config_route_v3_Vhds *envoy_config_route_v3_Vhds_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_route_v3_Vhds *ret = envoy_config_route_v3_Vhds_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_Vhds_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_route_v3_Vhds_serialize(const envoy_config_route_v3_Vhds *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_route_v3_Vhds_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_config_route_v3_Vhds_has_config_source(const envoy_config_route_v3_Vhds *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE const struct envoy_config_core_v3_ConfigSource* envoy_config_route_v3_Vhds_config_source(const envoy_config_route_v3_Vhds *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct envoy_config_core_v3_ConfigSource*); }
-
-UPB_INLINE void envoy_config_route_v3_Vhds_set_config_source(envoy_config_route_v3_Vhds *msg, struct envoy_config_core_v3_ConfigSource* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct envoy_config_core_v3_ConfigSource*) = value;
-}
-UPB_INLINE struct envoy_config_core_v3_ConfigSource* envoy_config_route_v3_Vhds_mutable_config_source(envoy_config_route_v3_Vhds *msg, upb_arena *arena) {
- struct envoy_config_core_v3_ConfigSource* sub = (struct envoy_config_core_v3_ConfigSource*)envoy_config_route_v3_Vhds_config_source(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_ConfigSource*)_upb_msg_new(&envoy_config_core_v3_ConfigSource_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_Vhds_set_config_source(msg, sub);
- }
- return sub;
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* ENVOY_CONFIG_ROUTE_V3_ROUTE_PROTO_UPB_H_ */
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/route/v3/route.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_CONFIG_ROUTE_V3_ROUTE_PROTO_UPB_H_
+#define ENVOY_CONFIG_ROUTE_V3_ROUTE_PROTO_UPB_H_
+
+#include "upb/msg.h"
+#include "upb/decode.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_config_route_v3_RouteConfiguration;
+struct envoy_config_route_v3_Vhds;
+typedef struct envoy_config_route_v3_RouteConfiguration envoy_config_route_v3_RouteConfiguration;
+typedef struct envoy_config_route_v3_Vhds envoy_config_route_v3_Vhds;
+extern const upb_msglayout envoy_config_route_v3_RouteConfiguration_msginit;
+extern const upb_msglayout envoy_config_route_v3_Vhds_msginit;
+struct envoy_config_core_v3_ConfigSource;
+struct envoy_config_core_v3_HeaderValueOption;
+struct envoy_config_route_v3_VirtualHost;
+struct google_protobuf_BoolValue;
+extern const upb_msglayout envoy_config_core_v3_ConfigSource_msginit;
+extern const upb_msglayout envoy_config_core_v3_HeaderValueOption_msginit;
+extern const upb_msglayout envoy_config_route_v3_VirtualHost_msginit;
+extern const upb_msglayout google_protobuf_BoolValue_msginit;
+
+
+/* envoy.config.route.v3.RouteConfiguration */
+
+UPB_INLINE envoy_config_route_v3_RouteConfiguration *envoy_config_route_v3_RouteConfiguration_new(upb_arena *arena) {
+ return (envoy_config_route_v3_RouteConfiguration *)_upb_msg_new(&envoy_config_route_v3_RouteConfiguration_msginit, arena);
+}
+UPB_INLINE envoy_config_route_v3_RouteConfiguration *envoy_config_route_v3_RouteConfiguration_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_route_v3_RouteConfiguration *ret = envoy_config_route_v3_RouteConfiguration_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RouteConfiguration_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_route_v3_RouteConfiguration_serialize(const envoy_config_route_v3_RouteConfiguration *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_route_v3_RouteConfiguration_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview envoy_config_route_v3_RouteConfiguration_name(const envoy_config_route_v3_RouteConfiguration *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
+UPB_INLINE bool envoy_config_route_v3_RouteConfiguration_has_virtual_hosts(const envoy_config_route_v3_RouteConfiguration *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 40)); }
+UPB_INLINE const struct envoy_config_route_v3_VirtualHost* const* envoy_config_route_v3_RouteConfiguration_virtual_hosts(const envoy_config_route_v3_RouteConfiguration *msg, size_t *len) { return (const struct envoy_config_route_v3_VirtualHost* const*)_upb_array_accessor(msg, UPB_SIZE(20, 40), len); }
+UPB_INLINE upb_strview const* envoy_config_route_v3_RouteConfiguration_internal_only_headers(const envoy_config_route_v3_RouteConfiguration *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(24, 48), len); }
+UPB_INLINE bool envoy_config_route_v3_RouteConfiguration_has_response_headers_to_add(const envoy_config_route_v3_RouteConfiguration *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 56)); }
+UPB_INLINE const struct envoy_config_core_v3_HeaderValueOption* const* envoy_config_route_v3_RouteConfiguration_response_headers_to_add(const envoy_config_route_v3_RouteConfiguration *msg, size_t *len) { return (const struct envoy_config_core_v3_HeaderValueOption* const*)_upb_array_accessor(msg, UPB_SIZE(28, 56), len); }
+UPB_INLINE upb_strview const* envoy_config_route_v3_RouteConfiguration_response_headers_to_remove(const envoy_config_route_v3_RouteConfiguration *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(32, 64), len); }
+UPB_INLINE bool envoy_config_route_v3_RouteConfiguration_has_request_headers_to_add(const envoy_config_route_v3_RouteConfiguration *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(36, 72)); }
+UPB_INLINE const struct envoy_config_core_v3_HeaderValueOption* const* envoy_config_route_v3_RouteConfiguration_request_headers_to_add(const envoy_config_route_v3_RouteConfiguration *msg, size_t *len) { return (const struct envoy_config_core_v3_HeaderValueOption* const*)_upb_array_accessor(msg, UPB_SIZE(36, 72), len); }
+UPB_INLINE bool envoy_config_route_v3_RouteConfiguration_has_validate_clusters(const envoy_config_route_v3_RouteConfiguration *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
+UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_route_v3_RouteConfiguration_validate_clusters(const envoy_config_route_v3_RouteConfiguration *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_protobuf_BoolValue*); }
+UPB_INLINE upb_strview const* envoy_config_route_v3_RouteConfiguration_request_headers_to_remove(const envoy_config_route_v3_RouteConfiguration *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(40, 80), len); }
+UPB_INLINE bool envoy_config_route_v3_RouteConfiguration_has_vhds(const envoy_config_route_v3_RouteConfiguration *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); }
+UPB_INLINE const envoy_config_route_v3_Vhds* envoy_config_route_v3_RouteConfiguration_vhds(const envoy_config_route_v3_RouteConfiguration *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const envoy_config_route_v3_Vhds*); }
+UPB_INLINE bool envoy_config_route_v3_RouteConfiguration_most_specific_header_mutations_wins(const envoy_config_route_v3_RouteConfiguration *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); }
+
+UPB_INLINE void envoy_config_route_v3_RouteConfiguration_set_name(envoy_config_route_v3_RouteConfiguration *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
+}
+UPB_INLINE struct envoy_config_route_v3_VirtualHost** envoy_config_route_v3_RouteConfiguration_mutable_virtual_hosts(envoy_config_route_v3_RouteConfiguration *msg, size_t *len) {
+ return (struct envoy_config_route_v3_VirtualHost**)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 40), len);
+}
+UPB_INLINE struct envoy_config_route_v3_VirtualHost** envoy_config_route_v3_RouteConfiguration_resize_virtual_hosts(envoy_config_route_v3_RouteConfiguration *msg, size_t len, upb_arena *arena) {
+ return (struct envoy_config_route_v3_VirtualHost**)_upb_array_resize_accessor(msg, UPB_SIZE(20, 40), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_config_route_v3_VirtualHost* envoy_config_route_v3_RouteConfiguration_add_virtual_hosts(envoy_config_route_v3_RouteConfiguration *msg, upb_arena *arena) {
+ struct envoy_config_route_v3_VirtualHost* sub = (struct envoy_config_route_v3_VirtualHost*)_upb_msg_new(&envoy_config_route_v3_VirtualHost_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(20, 40), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE upb_strview* envoy_config_route_v3_RouteConfiguration_mutable_internal_only_headers(envoy_config_route_v3_RouteConfiguration *msg, size_t *len) {
+ return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 48), len);
+}
+UPB_INLINE upb_strview* envoy_config_route_v3_RouteConfiguration_resize_internal_only_headers(envoy_config_route_v3_RouteConfiguration *msg, size_t len, upb_arena *arena) {
+ return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(24, 48), len, UPB_TYPE_STRING, arena);
+}
+UPB_INLINE bool envoy_config_route_v3_RouteConfiguration_add_internal_only_headers(envoy_config_route_v3_RouteConfiguration *msg, upb_strview val, upb_arena *arena) {
+ return _upb_array_append_accessor(msg, UPB_SIZE(24, 48), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
+ arena);
+}
+UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_config_route_v3_RouteConfiguration_mutable_response_headers_to_add(envoy_config_route_v3_RouteConfiguration *msg, size_t *len) {
+ return (struct envoy_config_core_v3_HeaderValueOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 56), len);
+}
+UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_config_route_v3_RouteConfiguration_resize_response_headers_to_add(envoy_config_route_v3_RouteConfiguration *msg, size_t len, upb_arena *arena) {
+ return (struct envoy_config_core_v3_HeaderValueOption**)_upb_array_resize_accessor(msg, UPB_SIZE(28, 56), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_config_core_v3_HeaderValueOption* envoy_config_route_v3_RouteConfiguration_add_response_headers_to_add(envoy_config_route_v3_RouteConfiguration *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_HeaderValueOption* sub = (struct envoy_config_core_v3_HeaderValueOption*)_upb_msg_new(&envoy_config_core_v3_HeaderValueOption_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(28, 56), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE upb_strview* envoy_config_route_v3_RouteConfiguration_mutable_response_headers_to_remove(envoy_config_route_v3_RouteConfiguration *msg, size_t *len) {
+ return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(32, 64), len);
+}
+UPB_INLINE upb_strview* envoy_config_route_v3_RouteConfiguration_resize_response_headers_to_remove(envoy_config_route_v3_RouteConfiguration *msg, size_t len, upb_arena *arena) {
+ return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(32, 64), len, UPB_TYPE_STRING, arena);
+}
+UPB_INLINE bool envoy_config_route_v3_RouteConfiguration_add_response_headers_to_remove(envoy_config_route_v3_RouteConfiguration *msg, upb_strview val, upb_arena *arena) {
+ return _upb_array_append_accessor(msg, UPB_SIZE(32, 64), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
+ arena);
+}
+UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_config_route_v3_RouteConfiguration_mutable_request_headers_to_add(envoy_config_route_v3_RouteConfiguration *msg, size_t *len) {
+ return (struct envoy_config_core_v3_HeaderValueOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(36, 72), len);
+}
+UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_config_route_v3_RouteConfiguration_resize_request_headers_to_add(envoy_config_route_v3_RouteConfiguration *msg, size_t len, upb_arena *arena) {
+ return (struct envoy_config_core_v3_HeaderValueOption**)_upb_array_resize_accessor(msg, UPB_SIZE(36, 72), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_config_core_v3_HeaderValueOption* envoy_config_route_v3_RouteConfiguration_add_request_headers_to_add(envoy_config_route_v3_RouteConfiguration *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_HeaderValueOption* sub = (struct envoy_config_core_v3_HeaderValueOption*)_upb_msg_new(&envoy_config_core_v3_HeaderValueOption_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(36, 72), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE void envoy_config_route_v3_RouteConfiguration_set_validate_clusters(envoy_config_route_v3_RouteConfiguration *msg, struct google_protobuf_BoolValue* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_protobuf_BoolValue*) = value;
+}
+UPB_INLINE struct google_protobuf_BoolValue* envoy_config_route_v3_RouteConfiguration_mutable_validate_clusters(envoy_config_route_v3_RouteConfiguration *msg, upb_arena *arena) {
+ struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_route_v3_RouteConfiguration_validate_clusters(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_BoolValue*)_upb_msg_new(&google_protobuf_BoolValue_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_RouteConfiguration_set_validate_clusters(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE upb_strview* envoy_config_route_v3_RouteConfiguration_mutable_request_headers_to_remove(envoy_config_route_v3_RouteConfiguration *msg, size_t *len) {
+ return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(40, 80), len);
+}
+UPB_INLINE upb_strview* envoy_config_route_v3_RouteConfiguration_resize_request_headers_to_remove(envoy_config_route_v3_RouteConfiguration *msg, size_t len, upb_arena *arena) {
+ return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(40, 80), len, UPB_TYPE_STRING, arena);
+}
+UPB_INLINE bool envoy_config_route_v3_RouteConfiguration_add_request_headers_to_remove(envoy_config_route_v3_RouteConfiguration *msg, upb_strview val, upb_arena *arena) {
+ return _upb_array_append_accessor(msg, UPB_SIZE(40, 80), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
+ arena);
+}
+UPB_INLINE void envoy_config_route_v3_RouteConfiguration_set_vhds(envoy_config_route_v3_RouteConfiguration *msg, envoy_config_route_v3_Vhds* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), envoy_config_route_v3_Vhds*) = value;
+}
+UPB_INLINE struct envoy_config_route_v3_Vhds* envoy_config_route_v3_RouteConfiguration_mutable_vhds(envoy_config_route_v3_RouteConfiguration *msg, upb_arena *arena) {
+ struct envoy_config_route_v3_Vhds* sub = (struct envoy_config_route_v3_Vhds*)envoy_config_route_v3_RouteConfiguration_vhds(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_route_v3_Vhds*)_upb_msg_new(&envoy_config_route_v3_Vhds_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_RouteConfiguration_set_vhds(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_route_v3_RouteConfiguration_set_most_specific_header_mutations_wins(envoy_config_route_v3_RouteConfiguration *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
+}
+
+/* envoy.config.route.v3.Vhds */
+
+UPB_INLINE envoy_config_route_v3_Vhds *envoy_config_route_v3_Vhds_new(upb_arena *arena) {
+ return (envoy_config_route_v3_Vhds *)_upb_msg_new(&envoy_config_route_v3_Vhds_msginit, arena);
+}
+UPB_INLINE envoy_config_route_v3_Vhds *envoy_config_route_v3_Vhds_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_route_v3_Vhds *ret = envoy_config_route_v3_Vhds_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_Vhds_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_route_v3_Vhds_serialize(const envoy_config_route_v3_Vhds *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_route_v3_Vhds_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_route_v3_Vhds_has_config_source(const envoy_config_route_v3_Vhds *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE const struct envoy_config_core_v3_ConfigSource* envoy_config_route_v3_Vhds_config_source(const envoy_config_route_v3_Vhds *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct envoy_config_core_v3_ConfigSource*); }
+
+UPB_INLINE void envoy_config_route_v3_Vhds_set_config_source(envoy_config_route_v3_Vhds *msg, struct envoy_config_core_v3_ConfigSource* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct envoy_config_core_v3_ConfigSource*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_ConfigSource* envoy_config_route_v3_Vhds_mutable_config_source(envoy_config_route_v3_Vhds *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_ConfigSource* sub = (struct envoy_config_core_v3_ConfigSource*)envoy_config_route_v3_Vhds_config_source(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_ConfigSource*)_upb_msg_new(&envoy_config_core_v3_ConfigSource_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_Vhds_set_config_source(msg, sub);
+ }
+ return sub;
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_CONFIG_ROUTE_V3_ROUTE_PROTO_UPB_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.c
index 5531b0415a2..8f1675c7e6e 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.c
@@ -1,900 +1,900 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/config/route/v3/route_components.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include <stddef.h>
-#include "upb/msg.h"
-#include "envoy/config/route/v3/route_components.upb.h"
-#include "envoy/config/core/v3/base.upb.h"
-#include "envoy/config/core/v3/extension.upb.h"
-#include "envoy/config/core/v3/proxy_protocol.upb.h"
-#include "envoy/type/matcher/v3/regex.upb.h"
-#include "envoy/type/matcher/v3/string.upb.h"
-#include "envoy/type/metadata/v3/metadata.upb.h"
-#include "envoy/type/tracing/v3/custom_tag.upb.h"
-#include "envoy/type/v3/percent.upb.h"
-#include "envoy/type/v3/range.upb.h"
-#include "google/protobuf/any.upb.h"
-#include "google/protobuf/duration.upb.h"
-#include "google/protobuf/struct.upb.h"
-#include "google/protobuf/wrappers.upb.h"
-#include "envoy/annotations/deprecation.upb.h"
-#include "udpa/annotations/migrate.upb.h"
-#include "udpa/annotations/status.upb.h"
-#include "udpa/annotations/versioning.upb.h"
-#include "validate/validate.upb.h"
-
-#include "upb/port_def.inc"
-
-static const upb_msglayout *const envoy_config_route_v3_VirtualHost_submsgs[11] = {
- &envoy_config_core_v3_HeaderValueOption_msginit,
- &envoy_config_route_v3_CorsPolicy_msginit,
- &envoy_config_route_v3_HedgePolicy_msginit,
- &envoy_config_route_v3_RateLimit_msginit,
- &envoy_config_route_v3_RetryPolicy_msginit,
- &envoy_config_route_v3_Route_msginit,
- &envoy_config_route_v3_VirtualCluster_msginit,
- &envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry_msginit,
- &google_protobuf_Any_msginit,
- &google_protobuf_UInt32Value_msginit,
-};
-
-static const upb_msglayout_field envoy_config_route_v3_VirtualHost__fields[18] = {
- {1, UPB_SIZE(12, 16), 0, 0, 9, 1},
- {2, UPB_SIZE(40, 72), 0, 0, 9, 3},
- {3, UPB_SIZE(44, 80), 0, 5, 11, 3},
- {4, UPB_SIZE(0, 0), 0, 0, 14, 1},
- {5, UPB_SIZE(48, 88), 0, 6, 11, 3},
- {6, UPB_SIZE(52, 96), 0, 3, 11, 3},
- {7, UPB_SIZE(56, 104), 0, 0, 11, 3},
- {8, UPB_SIZE(20, 32), 0, 1, 11, 1},
- {10, UPB_SIZE(60, 112), 0, 0, 11, 3},
- {11, UPB_SIZE(64, 120), 0, 0, 9, 3},
- {13, UPB_SIZE(68, 128), 0, 0, 9, 3},
- {14, UPB_SIZE(8, 8), 0, 0, 8, 1},
- {15, UPB_SIZE(72, 136), 0, 7, 11, _UPB_LABEL_MAP},
- {16, UPB_SIZE(24, 40), 0, 4, 11, 1},
- {17, UPB_SIZE(28, 48), 0, 2, 11, 1},
- {18, UPB_SIZE(32, 56), 0, 9, 11, 1},
- {19, UPB_SIZE(9, 9), 0, 0, 8, 1},
- {20, UPB_SIZE(36, 64), 0, 8, 11, 1},
-};
-
-const upb_msglayout envoy_config_route_v3_VirtualHost_msginit = {
- &envoy_config_route_v3_VirtualHost_submsgs[0],
- &envoy_config_route_v3_VirtualHost__fields[0],
- UPB_SIZE(80, 144), 18, false,
-};
-
-static const upb_msglayout *const envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry_submsgs[1] = {
- &google_protobuf_Any_msginit,
-};
-
-static const upb_msglayout_field envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 11, 1},
-};
-
-const upb_msglayout envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry_msginit = {
- &envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry_submsgs[0],
- &envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry__fields[0],
- UPB_SIZE(16, 32), 2, false,
-};
-
-static const upb_msglayout *const envoy_config_route_v3_FilterAction_submsgs[1] = {
- &google_protobuf_Any_msginit,
-};
-
-static const upb_msglayout_field envoy_config_route_v3_FilterAction__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
-};
-
-const upb_msglayout envoy_config_route_v3_FilterAction_msginit = {
- &envoy_config_route_v3_FilterAction_submsgs[0],
- &envoy_config_route_v3_FilterAction__fields[0],
- UPB_SIZE(4, 8), 1, false,
-};
-
-static const upb_msglayout *const envoy_config_route_v3_Route_submsgs[12] = {
- &envoy_config_core_v3_HeaderValueOption_msginit,
- &envoy_config_core_v3_Metadata_msginit,
- &envoy_config_route_v3_Decorator_msginit,
- &envoy_config_route_v3_DirectResponseAction_msginit,
- &envoy_config_route_v3_FilterAction_msginit,
- &envoy_config_route_v3_RedirectAction_msginit,
- &envoy_config_route_v3_Route_TypedPerFilterConfigEntry_msginit,
- &envoy_config_route_v3_RouteAction_msginit,
- &envoy_config_route_v3_RouteMatch_msginit,
- &envoy_config_route_v3_Tracing_msginit,
- &google_protobuf_UInt32Value_msginit,
-};
-
-static const upb_msglayout_field envoy_config_route_v3_Route__fields[15] = {
- {1, UPB_SIZE(8, 16), 0, 8, 11, 1},
- {2, UPB_SIZE(48, 96), UPB_SIZE(-53, -105), 7, 11, 1},
- {3, UPB_SIZE(48, 96), UPB_SIZE(-53, -105), 5, 11, 1},
- {4, UPB_SIZE(12, 24), 0, 1, 11, 1},
- {5, UPB_SIZE(16, 32), 0, 2, 11, 1},
- {7, UPB_SIZE(48, 96), UPB_SIZE(-53, -105), 3, 11, 1},
- {9, UPB_SIZE(28, 56), 0, 0, 11, 3},
- {10, UPB_SIZE(32, 64), 0, 0, 11, 3},
- {11, UPB_SIZE(36, 72), 0, 0, 9, 3},
- {12, UPB_SIZE(40, 80), 0, 0, 9, 3},
- {13, UPB_SIZE(44, 88), 0, 6, 11, _UPB_LABEL_MAP},
- {14, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {15, UPB_SIZE(20, 40), 0, 9, 11, 1},
- {16, UPB_SIZE(24, 48), 0, 10, 11, 1},
- {17, UPB_SIZE(48, 96), UPB_SIZE(-53, -105), 4, 11, 1},
-};
-
-const upb_msglayout envoy_config_route_v3_Route_msginit = {
- &envoy_config_route_v3_Route_submsgs[0],
- &envoy_config_route_v3_Route__fields[0],
- UPB_SIZE(56, 112), 15, false,
-};
-
-static const upb_msglayout *const envoy_config_route_v3_Route_TypedPerFilterConfigEntry_submsgs[1] = {
- &google_protobuf_Any_msginit,
-};
-
-static const upb_msglayout_field envoy_config_route_v3_Route_TypedPerFilterConfigEntry__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 11, 1},
-};
-
-const upb_msglayout envoy_config_route_v3_Route_TypedPerFilterConfigEntry_msginit = {
- &envoy_config_route_v3_Route_TypedPerFilterConfigEntry_submsgs[0],
- &envoy_config_route_v3_Route_TypedPerFilterConfigEntry__fields[0],
- UPB_SIZE(16, 32), 2, false,
-};
-
-static const upb_msglayout *const envoy_config_route_v3_WeightedCluster_submsgs[2] = {
- &envoy_config_route_v3_WeightedCluster_ClusterWeight_msginit,
- &google_protobuf_UInt32Value_msginit,
-};
-
-static const upb_msglayout_field envoy_config_route_v3_WeightedCluster__fields[3] = {
- {1, UPB_SIZE(12, 24), 0, 0, 11, 3},
- {2, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {3, UPB_SIZE(8, 16), 0, 1, 11, 1},
-};
-
-const upb_msglayout envoy_config_route_v3_WeightedCluster_msginit = {
- &envoy_config_route_v3_WeightedCluster_submsgs[0],
- &envoy_config_route_v3_WeightedCluster__fields[0],
- UPB_SIZE(16, 32), 3, false,
-};
-
-static const upb_msglayout *const envoy_config_route_v3_WeightedCluster_ClusterWeight_submsgs[5] = {
- &envoy_config_core_v3_HeaderValueOption_msginit,
- &envoy_config_core_v3_Metadata_msginit,
- &envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry_msginit,
- &google_protobuf_UInt32Value_msginit,
-};
-
-static const upb_msglayout_field envoy_config_route_v3_WeightedCluster_ClusterWeight__fields[8] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 3, 11, 1},
- {3, UPB_SIZE(12, 24), 0, 1, 11, 1},
- {4, UPB_SIZE(16, 32), 0, 0, 11, 3},
- {5, UPB_SIZE(20, 40), 0, 0, 11, 3},
- {6, UPB_SIZE(24, 48), 0, 0, 9, 3},
- {9, UPB_SIZE(28, 56), 0, 0, 9, 3},
- {10, UPB_SIZE(32, 64), 0, 2, 11, _UPB_LABEL_MAP},
-};
-
-const upb_msglayout envoy_config_route_v3_WeightedCluster_ClusterWeight_msginit = {
- &envoy_config_route_v3_WeightedCluster_ClusterWeight_submsgs[0],
- &envoy_config_route_v3_WeightedCluster_ClusterWeight__fields[0],
- UPB_SIZE(40, 80), 8, false,
-};
-
-static const upb_msglayout *const envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry_submsgs[1] = {
- &google_protobuf_Any_msginit,
-};
-
-static const upb_msglayout_field envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 11, 1},
-};
-
-const upb_msglayout envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry_msginit = {
- &envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry_submsgs[0],
- &envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry__fields[0],
- UPB_SIZE(16, 32), 2, false,
-};
-
-static const upb_msglayout *const envoy_config_route_v3_RouteMatch_submsgs[8] = {
- &envoy_config_core_v3_RuntimeFractionalPercent_msginit,
- &envoy_config_route_v3_HeaderMatcher_msginit,
- &envoy_config_route_v3_QueryParameterMatcher_msginit,
- &envoy_config_route_v3_RouteMatch_ConnectMatcher_msginit,
- &envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions_msginit,
- &envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_msginit,
- &envoy_type_matcher_v3_RegexMatcher_msginit,
- &google_protobuf_BoolValue_msginit,
-};
-
-static const upb_msglayout_field envoy_config_route_v3_RouteMatch__fields[10] = {
- {1, UPB_SIZE(24, 48), UPB_SIZE(-33, -65), 0, 9, 1},
- {2, UPB_SIZE(24, 48), UPB_SIZE(-33, -65), 0, 9, 1},
- {4, UPB_SIZE(0, 0), 0, 7, 11, 1},
- {6, UPB_SIZE(16, 32), 0, 1, 11, 3},
- {7, UPB_SIZE(20, 40), 0, 2, 11, 3},
- {8, UPB_SIZE(4, 8), 0, 4, 11, 1},
- {9, UPB_SIZE(8, 16), 0, 0, 11, 1},
- {10, UPB_SIZE(24, 48), UPB_SIZE(-33, -65), 6, 11, 1},
- {11, UPB_SIZE(12, 24), 0, 5, 11, 1},
- {12, UPB_SIZE(24, 48), UPB_SIZE(-33, -65), 3, 11, 1},
-};
-
-const upb_msglayout envoy_config_route_v3_RouteMatch_msginit = {
- &envoy_config_route_v3_RouteMatch_submsgs[0],
- &envoy_config_route_v3_RouteMatch__fields[0],
- UPB_SIZE(40, 80), 10, false,
-};
-
-const upb_msglayout envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions_msginit = {
- NULL,
- NULL,
- UPB_SIZE(0, 0), 0, false,
-};
-
-static const upb_msglayout *const envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_submsgs[2] = {
- &google_protobuf_BoolValue_msginit,
-};
-
-static const upb_msglayout_field envoy_config_route_v3_RouteMatch_TlsContextMatchOptions__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
- {2, UPB_SIZE(4, 8), 0, 0, 11, 1},
-};
-
-const upb_msglayout envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_msginit = {
- &envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_submsgs[0],
- &envoy_config_route_v3_RouteMatch_TlsContextMatchOptions__fields[0],
- UPB_SIZE(8, 16), 2, false,
-};
-
-const upb_msglayout envoy_config_route_v3_RouteMatch_ConnectMatcher_msginit = {
- NULL,
- NULL,
- UPB_SIZE(0, 0), 0, false,
-};
-
-static const upb_msglayout *const envoy_config_route_v3_CorsPolicy_submsgs[4] = {
- &envoy_config_core_v3_RuntimeFractionalPercent_msginit,
- &envoy_type_matcher_v3_StringMatcher_msginit,
- &google_protobuf_BoolValue_msginit,
-};
-
-static const upb_msglayout_field envoy_config_route_v3_CorsPolicy__fields[8] = {
- {2, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {3, UPB_SIZE(8, 16), 0, 0, 9, 1},
- {4, UPB_SIZE(16, 32), 0, 0, 9, 1},
- {5, UPB_SIZE(24, 48), 0, 0, 9, 1},
- {6, UPB_SIZE(32, 64), 0, 2, 11, 1},
- {9, UPB_SIZE(44, 88), UPB_SIZE(-49, -97), 0, 11, 1},
- {10, UPB_SIZE(36, 72), 0, 0, 11, 1},
- {11, UPB_SIZE(40, 80), 0, 1, 11, 3},
-};
-
-const upb_msglayout envoy_config_route_v3_CorsPolicy_msginit = {
- &envoy_config_route_v3_CorsPolicy_submsgs[0],
- &envoy_config_route_v3_CorsPolicy__fields[0],
- UPB_SIZE(56, 112), 8, false,
-};
-
-static const upb_msglayout *const envoy_config_route_v3_RouteAction_submsgs[21] = {
- &envoy_config_core_v3_Metadata_msginit,
- &envoy_config_route_v3_CorsPolicy_msginit,
- &envoy_config_route_v3_HedgePolicy_msginit,
- &envoy_config_route_v3_InternalRedirectPolicy_msginit,
- &envoy_config_route_v3_RateLimit_msginit,
- &envoy_config_route_v3_RetryPolicy_msginit,
- &envoy_config_route_v3_RouteAction_HashPolicy_msginit,
- &envoy_config_route_v3_RouteAction_MaxStreamDuration_msginit,
- &envoy_config_route_v3_RouteAction_RequestMirrorPolicy_msginit,
- &envoy_config_route_v3_RouteAction_UpgradeConfig_msginit,
- &envoy_config_route_v3_WeightedCluster_msginit,
- &envoy_type_matcher_v3_RegexMatchAndSubstitute_msginit,
- &google_protobuf_Any_msginit,
- &google_protobuf_BoolValue_msginit,
- &google_protobuf_Duration_msginit,
- &google_protobuf_UInt32Value_msginit,
-};
-
-static const upb_msglayout_field envoy_config_route_v3_RouteAction__fields[29] = {
- {1, UPB_SIZE(104, 184), UPB_SIZE(-113, -201), 0, 9, 1},
- {2, UPB_SIZE(104, 184), UPB_SIZE(-113, -201), 0, 9, 1},
- {3, UPB_SIZE(104, 184), UPB_SIZE(-113, -201), 10, 11, 1},
- {4, UPB_SIZE(32, 40), 0, 0, 11, 1},
- {5, UPB_SIZE(24, 24), 0, 0, 9, 1},
- {6, UPB_SIZE(116, 208), UPB_SIZE(-125, -225), 0, 9, 1},
- {7, UPB_SIZE(116, 208), UPB_SIZE(-125, -225), 13, 11, 1},
- {8, UPB_SIZE(36, 48), 0, 14, 11, 1},
- {9, UPB_SIZE(40, 56), 0, 5, 11, 1},
- {11, UPB_SIZE(0, 0), 0, 0, 14, 1},
- {13, UPB_SIZE(88, 152), 0, 4, 11, 3},
- {14, UPB_SIZE(44, 64), 0, 13, 11, 1},
- {15, UPB_SIZE(92, 160), 0, 6, 11, 3},
- {17, UPB_SIZE(48, 72), 0, 1, 11, 1},
- {20, UPB_SIZE(8, 8), 0, 0, 14, 1},
- {23, UPB_SIZE(52, 80), 0, 14, 11, 1},
- {24, UPB_SIZE(56, 88), 0, 14, 11, 1},
- {25, UPB_SIZE(96, 168), 0, 9, 11, 3},
- {26, UPB_SIZE(16, 16), 0, 0, 14, 1},
- {27, UPB_SIZE(60, 96), 0, 2, 11, 1},
- {28, UPB_SIZE(64, 104), 0, 14, 11, 1},
- {29, UPB_SIZE(116, 208), UPB_SIZE(-125, -225), 0, 9, 1},
- {30, UPB_SIZE(100, 176), 0, 8, 11, 3},
- {31, UPB_SIZE(68, 112), 0, 15, 11, 1},
- {32, UPB_SIZE(72, 120), 0, 11, 11, 1},
- {33, UPB_SIZE(76, 128), 0, 12, 11, 1},
- {34, UPB_SIZE(80, 136), 0, 3, 11, 1},
- {35, UPB_SIZE(116, 208), UPB_SIZE(-125, -225), 11, 11, 1},
- {36, UPB_SIZE(84, 144), 0, 7, 11, 1},
-};
-
-const upb_msglayout envoy_config_route_v3_RouteAction_msginit = {
- &envoy_config_route_v3_RouteAction_submsgs[0],
- &envoy_config_route_v3_RouteAction__fields[0],
- UPB_SIZE(128, 240), 29, false,
-};
-
-static const upb_msglayout *const envoy_config_route_v3_RouteAction_RequestMirrorPolicy_submsgs[2] = {
- &envoy_config_core_v3_RuntimeFractionalPercent_msginit,
- &google_protobuf_BoolValue_msginit,
-};
-
-static const upb_msglayout_field envoy_config_route_v3_RouteAction_RequestMirrorPolicy__fields[3] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {3, UPB_SIZE(8, 16), 0, 0, 11, 1},
- {4, UPB_SIZE(12, 24), 0, 1, 11, 1},
-};
-
-const upb_msglayout envoy_config_route_v3_RouteAction_RequestMirrorPolicy_msginit = {
- &envoy_config_route_v3_RouteAction_RequestMirrorPolicy_submsgs[0],
- &envoy_config_route_v3_RouteAction_RequestMirrorPolicy__fields[0],
- UPB_SIZE(16, 32), 3, false,
-};
-
-static const upb_msglayout *const envoy_config_route_v3_RouteAction_HashPolicy_submsgs[5] = {
- &envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_msginit,
- &envoy_config_route_v3_RouteAction_HashPolicy_Cookie_msginit,
- &envoy_config_route_v3_RouteAction_HashPolicy_FilterState_msginit,
- &envoy_config_route_v3_RouteAction_HashPolicy_Header_msginit,
- &envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_msginit,
-};
-
-static const upb_msglayout_field envoy_config_route_v3_RouteAction_HashPolicy__fields[6] = {
- {1, UPB_SIZE(4, 8), UPB_SIZE(-9, -17), 3, 11, 1},
- {2, UPB_SIZE(4, 8), UPB_SIZE(-9, -17), 1, 11, 1},
- {3, UPB_SIZE(4, 8), UPB_SIZE(-9, -17), 0, 11, 1},
- {4, UPB_SIZE(0, 0), 0, 0, 8, 1},
- {5, UPB_SIZE(4, 8), UPB_SIZE(-9, -17), 4, 11, 1},
- {6, UPB_SIZE(4, 8), UPB_SIZE(-9, -17), 2, 11, 1},
-};
-
-const upb_msglayout envoy_config_route_v3_RouteAction_HashPolicy_msginit = {
- &envoy_config_route_v3_RouteAction_HashPolicy_submsgs[0],
- &envoy_config_route_v3_RouteAction_HashPolicy__fields[0],
- UPB_SIZE(12, 24), 6, false,
-};
-
-static const upb_msglayout *const envoy_config_route_v3_RouteAction_HashPolicy_Header_submsgs[1] = {
- &envoy_type_matcher_v3_RegexMatchAndSubstitute_msginit,
-};
-
-static const upb_msglayout_field envoy_config_route_v3_RouteAction_HashPolicy_Header__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 11, 1},
-};
-
-const upb_msglayout envoy_config_route_v3_RouteAction_HashPolicy_Header_msginit = {
- &envoy_config_route_v3_RouteAction_HashPolicy_Header_submsgs[0],
- &envoy_config_route_v3_RouteAction_HashPolicy_Header__fields[0],
- UPB_SIZE(16, 32), 2, false,
-};
-
-static const upb_msglayout *const envoy_config_route_v3_RouteAction_HashPolicy_Cookie_submsgs[1] = {
- &google_protobuf_Duration_msginit,
-};
-
-static const upb_msglayout_field envoy_config_route_v3_RouteAction_HashPolicy_Cookie__fields[3] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(16, 32), 0, 0, 11, 1},
- {3, UPB_SIZE(8, 16), 0, 0, 9, 1},
-};
-
-const upb_msglayout envoy_config_route_v3_RouteAction_HashPolicy_Cookie_msginit = {
- &envoy_config_route_v3_RouteAction_HashPolicy_Cookie_submsgs[0],
- &envoy_config_route_v3_RouteAction_HashPolicy_Cookie__fields[0],
- UPB_SIZE(24, 48), 3, false,
-};
-
-static const upb_msglayout_field envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 8, 1},
-};
-
-const upb_msglayout envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_msginit = {
- NULL,
- &envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties__fields[0],
- UPB_SIZE(1, 1), 1, false,
-};
-
-static const upb_msglayout_field envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
-};
-
-const upb_msglayout envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_msginit = {
- NULL,
- &envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter__fields[0],
- UPB_SIZE(8, 16), 1, false,
-};
-
-static const upb_msglayout_field envoy_config_route_v3_RouteAction_HashPolicy_FilterState__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
-};
-
-const upb_msglayout envoy_config_route_v3_RouteAction_HashPolicy_FilterState_msginit = {
- NULL,
- &envoy_config_route_v3_RouteAction_HashPolicy_FilterState__fields[0],
- UPB_SIZE(8, 16), 1, false,
-};
-
-static const upb_msglayout *const envoy_config_route_v3_RouteAction_UpgradeConfig_submsgs[2] = {
- &envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_msginit,
- &google_protobuf_BoolValue_msginit,
-};
-
-static const upb_msglayout_field envoy_config_route_v3_RouteAction_UpgradeConfig__fields[3] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 1, 11, 1},
- {3, UPB_SIZE(12, 24), 0, 0, 11, 1},
-};
-
-const upb_msglayout envoy_config_route_v3_RouteAction_UpgradeConfig_msginit = {
- &envoy_config_route_v3_RouteAction_UpgradeConfig_submsgs[0],
- &envoy_config_route_v3_RouteAction_UpgradeConfig__fields[0],
- UPB_SIZE(16, 32), 3, false,
-};
-
-static const upb_msglayout *const envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_submsgs[1] = {
- &envoy_config_core_v3_ProxyProtocolConfig_msginit,
-};
-
-static const upb_msglayout_field envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
-};
-
-const upb_msglayout envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_msginit = {
- &envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_submsgs[0],
- &envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig__fields[0],
- UPB_SIZE(4, 8), 1, false,
-};
-
-static const upb_msglayout *const envoy_config_route_v3_RouteAction_MaxStreamDuration_submsgs[3] = {
- &google_protobuf_Duration_msginit,
-};
-
-static const upb_msglayout_field envoy_config_route_v3_RouteAction_MaxStreamDuration__fields[3] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
- {2, UPB_SIZE(4, 8), 0, 0, 11, 1},
- {3, UPB_SIZE(8, 16), 0, 0, 11, 1},
-};
-
-const upb_msglayout envoy_config_route_v3_RouteAction_MaxStreamDuration_msginit = {
- &envoy_config_route_v3_RouteAction_MaxStreamDuration_submsgs[0],
- &envoy_config_route_v3_RouteAction_MaxStreamDuration__fields[0],
- UPB_SIZE(12, 24), 3, false,
-};
-
-static const upb_msglayout *const envoy_config_route_v3_RetryPolicy_submsgs[8] = {
- &envoy_config_route_v3_HeaderMatcher_msginit,
- &envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_msginit,
- &envoy_config_route_v3_RetryPolicy_RetryBackOff_msginit,
- &envoy_config_route_v3_RetryPolicy_RetryHostPredicate_msginit,
- &envoy_config_route_v3_RetryPolicy_RetryPriority_msginit,
- &google_protobuf_Duration_msginit,
- &google_protobuf_UInt32Value_msginit,
-};
-
-static const upb_msglayout_field envoy_config_route_v3_RetryPolicy__fields[11] = {
- {1, UPB_SIZE(8, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(16, 24), 0, 6, 11, 1},
- {3, UPB_SIZE(20, 32), 0, 5, 11, 1},
- {4, UPB_SIZE(24, 40), 0, 4, 11, 1},
- {5, UPB_SIZE(36, 64), 0, 3, 11, 3},
- {6, UPB_SIZE(0, 0), 0, 0, 3, 1},
- {7, UPB_SIZE(40, 72), 0, 0, 13, _UPB_LABEL_PACKED},
- {8, UPB_SIZE(28, 48), 0, 2, 11, 1},
- {9, UPB_SIZE(44, 80), 0, 0, 11, 3},
- {10, UPB_SIZE(48, 88), 0, 0, 11, 3},
- {11, UPB_SIZE(32, 56), 0, 1, 11, 1},
-};
-
-const upb_msglayout envoy_config_route_v3_RetryPolicy_msginit = {
- &envoy_config_route_v3_RetryPolicy_submsgs[0],
- &envoy_config_route_v3_RetryPolicy__fields[0],
- UPB_SIZE(56, 96), 11, false,
-};
-
-static const upb_msglayout *const envoy_config_route_v3_RetryPolicy_RetryPriority_submsgs[1] = {
- &google_protobuf_Any_msginit,
-};
-
-static const upb_msglayout_field envoy_config_route_v3_RetryPolicy_RetryPriority__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {3, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, 1},
-};
-
-const upb_msglayout envoy_config_route_v3_RetryPolicy_RetryPriority_msginit = {
- &envoy_config_route_v3_RetryPolicy_RetryPriority_submsgs[0],
- &envoy_config_route_v3_RetryPolicy_RetryPriority__fields[0],
- UPB_SIZE(16, 32), 2, false,
-};
-
-static const upb_msglayout *const envoy_config_route_v3_RetryPolicy_RetryHostPredicate_submsgs[1] = {
- &google_protobuf_Any_msginit,
-};
-
-static const upb_msglayout_field envoy_config_route_v3_RetryPolicy_RetryHostPredicate__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {3, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, 1},
-};
-
-const upb_msglayout envoy_config_route_v3_RetryPolicy_RetryHostPredicate_msginit = {
- &envoy_config_route_v3_RetryPolicy_RetryHostPredicate_submsgs[0],
- &envoy_config_route_v3_RetryPolicy_RetryHostPredicate__fields[0],
- UPB_SIZE(16, 32), 2, false,
-};
-
-static const upb_msglayout *const envoy_config_route_v3_RetryPolicy_RetryBackOff_submsgs[2] = {
- &google_protobuf_Duration_msginit,
-};
-
-static const upb_msglayout_field envoy_config_route_v3_RetryPolicy_RetryBackOff__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
- {2, UPB_SIZE(4, 8), 0, 0, 11, 1},
-};
-
-const upb_msglayout envoy_config_route_v3_RetryPolicy_RetryBackOff_msginit = {
- &envoy_config_route_v3_RetryPolicy_RetryBackOff_submsgs[0],
- &envoy_config_route_v3_RetryPolicy_RetryBackOff__fields[0],
- UPB_SIZE(8, 16), 2, false,
-};
-
-static const upb_msglayout_field envoy_config_route_v3_RetryPolicy_ResetHeader__fields[2] = {
- {1, UPB_SIZE(8, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(0, 0), 0, 0, 14, 1},
-};
-
-const upb_msglayout envoy_config_route_v3_RetryPolicy_ResetHeader_msginit = {
- NULL,
- &envoy_config_route_v3_RetryPolicy_ResetHeader__fields[0],
- UPB_SIZE(16, 32), 2, false,
-};
-
-static const upb_msglayout *const envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_submsgs[2] = {
- &envoy_config_route_v3_RetryPolicy_ResetHeader_msginit,
- &google_protobuf_Duration_msginit,
-};
-
-static const upb_msglayout_field envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff__fields[2] = {
- {1, UPB_SIZE(4, 8), 0, 0, 11, 3},
- {2, UPB_SIZE(0, 0), 0, 1, 11, 1},
-};
-
-const upb_msglayout envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_msginit = {
- &envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_submsgs[0],
- &envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff__fields[0],
- UPB_SIZE(8, 16), 2, false,
-};
-
-static const upb_msglayout *const envoy_config_route_v3_HedgePolicy_submsgs[2] = {
- &envoy_type_v3_FractionalPercent_msginit,
- &google_protobuf_UInt32Value_msginit,
-};
-
-static const upb_msglayout_field envoy_config_route_v3_HedgePolicy__fields[3] = {
- {1, UPB_SIZE(4, 8), 0, 1, 11, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 11, 1},
- {3, UPB_SIZE(0, 0), 0, 0, 8, 1},
-};
-
-const upb_msglayout envoy_config_route_v3_HedgePolicy_msginit = {
- &envoy_config_route_v3_HedgePolicy_submsgs[0],
- &envoy_config_route_v3_HedgePolicy__fields[0],
- UPB_SIZE(12, 24), 3, false,
-};
-
-static const upb_msglayout_field envoy_config_route_v3_RedirectAction__fields[8] = {
- {1, UPB_SIZE(16, 16), 0, 0, 9, 1},
- {2, UPB_SIZE(24, 32), UPB_SIZE(-33, -49), 0, 9, 1},
- {3, UPB_SIZE(0, 0), 0, 0, 14, 1},
- {4, UPB_SIZE(36, 56), UPB_SIZE(-45, -73), 0, 8, 1},
- {5, UPB_SIZE(24, 32), UPB_SIZE(-33, -49), 0, 9, 1},
- {6, UPB_SIZE(12, 12), 0, 0, 8, 1},
- {7, UPB_SIZE(36, 56), UPB_SIZE(-45, -73), 0, 9, 1},
- {8, UPB_SIZE(8, 8), 0, 0, 13, 1},
-};
-
-const upb_msglayout envoy_config_route_v3_RedirectAction_msginit = {
- NULL,
- &envoy_config_route_v3_RedirectAction__fields[0],
- UPB_SIZE(48, 80), 8, false,
-};
-
-static const upb_msglayout *const envoy_config_route_v3_DirectResponseAction_submsgs[1] = {
- &envoy_config_core_v3_DataSource_msginit,
-};
-
-static const upb_msglayout_field envoy_config_route_v3_DirectResponseAction__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 13, 1},
- {2, UPB_SIZE(4, 8), 0, 0, 11, 1},
-};
-
-const upb_msglayout envoy_config_route_v3_DirectResponseAction_msginit = {
- &envoy_config_route_v3_DirectResponseAction_submsgs[0],
- &envoy_config_route_v3_DirectResponseAction__fields[0],
- UPB_SIZE(8, 16), 2, false,
-};
-
-static const upb_msglayout *const envoy_config_route_v3_Decorator_submsgs[1] = {
- &google_protobuf_BoolValue_msginit,
-};
-
-static const upb_msglayout_field envoy_config_route_v3_Decorator__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 11, 1},
-};
-
-const upb_msglayout envoy_config_route_v3_Decorator_msginit = {
- &envoy_config_route_v3_Decorator_submsgs[0],
- &envoy_config_route_v3_Decorator__fields[0],
- UPB_SIZE(16, 32), 2, false,
-};
-
-static const upb_msglayout *const envoy_config_route_v3_Tracing_submsgs[4] = {
- &envoy_type_tracing_v3_CustomTag_msginit,
- &envoy_type_v3_FractionalPercent_msginit,
-};
-
-static const upb_msglayout_field envoy_config_route_v3_Tracing__fields[4] = {
- {1, UPB_SIZE(0, 0), 0, 1, 11, 1},
- {2, UPB_SIZE(4, 8), 0, 1, 11, 1},
- {3, UPB_SIZE(8, 16), 0, 1, 11, 1},
- {4, UPB_SIZE(12, 24), 0, 0, 11, 3},
-};
-
-const upb_msglayout envoy_config_route_v3_Tracing_msginit = {
- &envoy_config_route_v3_Tracing_submsgs[0],
- &envoy_config_route_v3_Tracing__fields[0],
- UPB_SIZE(16, 32), 4, false,
-};
-
-static const upb_msglayout *const envoy_config_route_v3_VirtualCluster_submsgs[1] = {
- &envoy_config_route_v3_HeaderMatcher_msginit,
-};
-
-static const upb_msglayout_field envoy_config_route_v3_VirtualCluster__fields[2] = {
- {2, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {4, UPB_SIZE(8, 16), 0, 0, 11, 3},
-};
-
-const upb_msglayout envoy_config_route_v3_VirtualCluster_msginit = {
- &envoy_config_route_v3_VirtualCluster_submsgs[0],
- &envoy_config_route_v3_VirtualCluster__fields[0],
- UPB_SIZE(16, 32), 2, false,
-};
-
-static const upb_msglayout *const envoy_config_route_v3_RateLimit_submsgs[3] = {
- &envoy_config_route_v3_RateLimit_Action_msginit,
- &envoy_config_route_v3_RateLimit_Override_msginit,
- &google_protobuf_UInt32Value_msginit,
-};
-
-static const upb_msglayout_field envoy_config_route_v3_RateLimit__fields[4] = {
- {1, UPB_SIZE(8, 16), 0, 2, 11, 1},
- {2, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {3, UPB_SIZE(16, 32), 0, 0, 11, 3},
- {4, UPB_SIZE(12, 24), 0, 1, 11, 1},
-};
-
-const upb_msglayout envoy_config_route_v3_RateLimit_msginit = {
- &envoy_config_route_v3_RateLimit_submsgs[0],
- &envoy_config_route_v3_RateLimit__fields[0],
- UPB_SIZE(24, 48), 4, false,
-};
-
-static const upb_msglayout *const envoy_config_route_v3_RateLimit_Action_submsgs[7] = {
- &envoy_config_route_v3_RateLimit_Action_DestinationCluster_msginit,
- &envoy_config_route_v3_RateLimit_Action_DynamicMetaData_msginit,
- &envoy_config_route_v3_RateLimit_Action_GenericKey_msginit,
- &envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_msginit,
- &envoy_config_route_v3_RateLimit_Action_RemoteAddress_msginit,
- &envoy_config_route_v3_RateLimit_Action_RequestHeaders_msginit,
- &envoy_config_route_v3_RateLimit_Action_SourceCluster_msginit,
-};
-
-static const upb_msglayout_field envoy_config_route_v3_RateLimit_Action__fields[7] = {
- {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 6, 11, 1},
- {2, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, 1},
- {3, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 5, 11, 1},
- {4, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 4, 11, 1},
- {5, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 2, 11, 1},
- {6, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 3, 11, 1},
- {7, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 1, 11, 1},
-};
-
-const upb_msglayout envoy_config_route_v3_RateLimit_Action_msginit = {
- &envoy_config_route_v3_RateLimit_Action_submsgs[0],
- &envoy_config_route_v3_RateLimit_Action__fields[0],
- UPB_SIZE(8, 16), 7, false,
-};
-
-const upb_msglayout envoy_config_route_v3_RateLimit_Action_SourceCluster_msginit = {
- NULL,
- NULL,
- UPB_SIZE(0, 0), 0, false,
-};
-
-const upb_msglayout envoy_config_route_v3_RateLimit_Action_DestinationCluster_msginit = {
- NULL,
- NULL,
- UPB_SIZE(0, 0), 0, false,
-};
-
-static const upb_msglayout_field envoy_config_route_v3_RateLimit_Action_RequestHeaders__fields[3] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(12, 24), 0, 0, 9, 1},
- {3, UPB_SIZE(0, 0), 0, 0, 8, 1},
-};
-
-const upb_msglayout envoy_config_route_v3_RateLimit_Action_RequestHeaders_msginit = {
- NULL,
- &envoy_config_route_v3_RateLimit_Action_RequestHeaders__fields[0],
- UPB_SIZE(24, 48), 3, false,
-};
-
-const upb_msglayout envoy_config_route_v3_RateLimit_Action_RemoteAddress_msginit = {
- NULL,
- NULL,
- UPB_SIZE(0, 0), 0, false,
-};
-
-static const upb_msglayout_field envoy_config_route_v3_RateLimit_Action_GenericKey__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 9, 1},
-};
-
-const upb_msglayout envoy_config_route_v3_RateLimit_Action_GenericKey_msginit = {
- NULL,
- &envoy_config_route_v3_RateLimit_Action_GenericKey__fields[0],
- UPB_SIZE(16, 32), 2, false,
-};
-
-static const upb_msglayout *const envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_submsgs[2] = {
- &envoy_config_route_v3_HeaderMatcher_msginit,
- &google_protobuf_BoolValue_msginit,
-};
-
-static const upb_msglayout_field envoy_config_route_v3_RateLimit_Action_HeaderValueMatch__fields[3] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 1, 11, 1},
- {3, UPB_SIZE(12, 24), 0, 0, 11, 3},
-};
-
-const upb_msglayout envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_msginit = {
- &envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_submsgs[0],
- &envoy_config_route_v3_RateLimit_Action_HeaderValueMatch__fields[0],
- UPB_SIZE(16, 32), 3, false,
-};
-
-static const upb_msglayout *const envoy_config_route_v3_RateLimit_Action_DynamicMetaData_submsgs[1] = {
- &envoy_type_metadata_v3_MetadataKey_msginit,
-};
-
-static const upb_msglayout_field envoy_config_route_v3_RateLimit_Action_DynamicMetaData__fields[3] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(16, 32), 0, 0, 11, 1},
- {3, UPB_SIZE(8, 16), 0, 0, 9, 1},
-};
-
-const upb_msglayout envoy_config_route_v3_RateLimit_Action_DynamicMetaData_msginit = {
- &envoy_config_route_v3_RateLimit_Action_DynamicMetaData_submsgs[0],
- &envoy_config_route_v3_RateLimit_Action_DynamicMetaData__fields[0],
- UPB_SIZE(24, 48), 3, false,
-};
-
-static const upb_msglayout *const envoy_config_route_v3_RateLimit_Override_submsgs[1] = {
- &envoy_config_route_v3_RateLimit_Override_DynamicMetadata_msginit,
-};
-
-static const upb_msglayout_field envoy_config_route_v3_RateLimit_Override__fields[1] = {
- {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, 1},
-};
-
-const upb_msglayout envoy_config_route_v3_RateLimit_Override_msginit = {
- &envoy_config_route_v3_RateLimit_Override_submsgs[0],
- &envoy_config_route_v3_RateLimit_Override__fields[0],
- UPB_SIZE(8, 16), 1, false,
-};
-
-static const upb_msglayout *const envoy_config_route_v3_RateLimit_Override_DynamicMetadata_submsgs[1] = {
- &envoy_type_metadata_v3_MetadataKey_msginit,
-};
-
-static const upb_msglayout_field envoy_config_route_v3_RateLimit_Override_DynamicMetadata__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
-};
-
-const upb_msglayout envoy_config_route_v3_RateLimit_Override_DynamicMetadata_msginit = {
- &envoy_config_route_v3_RateLimit_Override_DynamicMetadata_submsgs[0],
- &envoy_config_route_v3_RateLimit_Override_DynamicMetadata__fields[0],
- UPB_SIZE(4, 8), 1, false,
-};
-
-static const upb_msglayout *const envoy_config_route_v3_HeaderMatcher_submsgs[2] = {
- &envoy_type_matcher_v3_RegexMatcher_msginit,
- &envoy_type_v3_Int64Range_msginit,
-};
-
-static const upb_msglayout_field envoy_config_route_v3_HeaderMatcher__fields[9] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {4, UPB_SIZE(12, 24), UPB_SIZE(-21, -41), 0, 9, 1},
- {6, UPB_SIZE(12, 24), UPB_SIZE(-21, -41), 1, 11, 1},
- {7, UPB_SIZE(12, 24), UPB_SIZE(-21, -41), 0, 8, 1},
- {8, UPB_SIZE(0, 0), 0, 0, 8, 1},
- {9, UPB_SIZE(12, 24), UPB_SIZE(-21, -41), 0, 9, 1},
- {10, UPB_SIZE(12, 24), UPB_SIZE(-21, -41), 0, 9, 1},
- {11, UPB_SIZE(12, 24), UPB_SIZE(-21, -41), 0, 11, 1},
- {12, UPB_SIZE(12, 24), UPB_SIZE(-21, -41), 0, 9, 1},
-};
-
-const upb_msglayout envoy_config_route_v3_HeaderMatcher_msginit = {
- &envoy_config_route_v3_HeaderMatcher_submsgs[0],
- &envoy_config_route_v3_HeaderMatcher__fields[0],
- UPB_SIZE(24, 48), 9, false,
-};
-
-static const upb_msglayout *const envoy_config_route_v3_QueryParameterMatcher_submsgs[1] = {
- &envoy_type_matcher_v3_StringMatcher_msginit,
-};
-
-static const upb_msglayout_field envoy_config_route_v3_QueryParameterMatcher__fields[3] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {5, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, 1},
- {6, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 8, 1},
-};
-
-const upb_msglayout envoy_config_route_v3_QueryParameterMatcher_msginit = {
- &envoy_config_route_v3_QueryParameterMatcher_submsgs[0],
- &envoy_config_route_v3_QueryParameterMatcher__fields[0],
- UPB_SIZE(16, 32), 3, false,
-};
-
-static const upb_msglayout *const envoy_config_route_v3_InternalRedirectPolicy_submsgs[2] = {
- &envoy_config_core_v3_TypedExtensionConfig_msginit,
- &google_protobuf_UInt32Value_msginit,
-};
-
-static const upb_msglayout_field envoy_config_route_v3_InternalRedirectPolicy__fields[4] = {
- {1, UPB_SIZE(4, 8), 0, 1, 11, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 13, _UPB_LABEL_PACKED},
- {3, UPB_SIZE(12, 24), 0, 0, 11, 3},
- {4, UPB_SIZE(0, 0), 0, 0, 8, 1},
-};
-
-const upb_msglayout envoy_config_route_v3_InternalRedirectPolicy_msginit = {
- &envoy_config_route_v3_InternalRedirectPolicy_submsgs[0],
- &envoy_config_route_v3_InternalRedirectPolicy__fields[0],
- UPB_SIZE(16, 32), 4, false,
-};
-
-#include "upb/port_undef.inc"
-
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/route/v3/route_components.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg.h"
+#include "envoy/config/route/v3/route_components.upb.h"
+#include "envoy/config/core/v3/base.upb.h"
+#include "envoy/config/core/v3/extension.upb.h"
+#include "envoy/config/core/v3/proxy_protocol.upb.h"
+#include "envoy/type/matcher/v3/regex.upb.h"
+#include "envoy/type/matcher/v3/string.upb.h"
+#include "envoy/type/metadata/v3/metadata.upb.h"
+#include "envoy/type/tracing/v3/custom_tag.upb.h"
+#include "envoy/type/v3/percent.upb.h"
+#include "envoy/type/v3/range.upb.h"
+#include "google/protobuf/any.upb.h"
+#include "google/protobuf/duration.upb.h"
+#include "google/protobuf/struct.upb.h"
+#include "google/protobuf/wrappers.upb.h"
+#include "envoy/annotations/deprecation.upb.h"
+#include "udpa/annotations/migrate.upb.h"
+#include "udpa/annotations/status.upb.h"
+#include "udpa/annotations/versioning.upb.h"
+#include "validate/validate.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_msglayout *const envoy_config_route_v3_VirtualHost_submsgs[11] = {
+ &envoy_config_core_v3_HeaderValueOption_msginit,
+ &envoy_config_route_v3_CorsPolicy_msginit,
+ &envoy_config_route_v3_HedgePolicy_msginit,
+ &envoy_config_route_v3_RateLimit_msginit,
+ &envoy_config_route_v3_RetryPolicy_msginit,
+ &envoy_config_route_v3_Route_msginit,
+ &envoy_config_route_v3_VirtualCluster_msginit,
+ &envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry_msginit,
+ &google_protobuf_Any_msginit,
+ &google_protobuf_UInt32Value_msginit,
+};
+
+static const upb_msglayout_field envoy_config_route_v3_VirtualHost__fields[18] = {
+ {1, UPB_SIZE(12, 16), 0, 0, 9, 1},
+ {2, UPB_SIZE(40, 72), 0, 0, 9, 3},
+ {3, UPB_SIZE(44, 80), 0, 5, 11, 3},
+ {4, UPB_SIZE(0, 0), 0, 0, 14, 1},
+ {5, UPB_SIZE(48, 88), 0, 6, 11, 3},
+ {6, UPB_SIZE(52, 96), 0, 3, 11, 3},
+ {7, UPB_SIZE(56, 104), 0, 0, 11, 3},
+ {8, UPB_SIZE(20, 32), 0, 1, 11, 1},
+ {10, UPB_SIZE(60, 112), 0, 0, 11, 3},
+ {11, UPB_SIZE(64, 120), 0, 0, 9, 3},
+ {13, UPB_SIZE(68, 128), 0, 0, 9, 3},
+ {14, UPB_SIZE(8, 8), 0, 0, 8, 1},
+ {15, UPB_SIZE(72, 136), 0, 7, 11, _UPB_LABEL_MAP},
+ {16, UPB_SIZE(24, 40), 0, 4, 11, 1},
+ {17, UPB_SIZE(28, 48), 0, 2, 11, 1},
+ {18, UPB_SIZE(32, 56), 0, 9, 11, 1},
+ {19, UPB_SIZE(9, 9), 0, 0, 8, 1},
+ {20, UPB_SIZE(36, 64), 0, 8, 11, 1},
+};
+
+const upb_msglayout envoy_config_route_v3_VirtualHost_msginit = {
+ &envoy_config_route_v3_VirtualHost_submsgs[0],
+ &envoy_config_route_v3_VirtualHost__fields[0],
+ UPB_SIZE(80, 144), 18, false,
+};
+
+static const upb_msglayout *const envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry_submsgs[1] = {
+ &google_protobuf_Any_msginit,
+};
+
+static const upb_msglayout_field envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {2, UPB_SIZE(8, 16), 0, 0, 11, 1},
+};
+
+const upb_msglayout envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry_msginit = {
+ &envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry_submsgs[0],
+ &envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry__fields[0],
+ UPB_SIZE(16, 32), 2, false,
+};
+
+static const upb_msglayout *const envoy_config_route_v3_FilterAction_submsgs[1] = {
+ &google_protobuf_Any_msginit,
+};
+
+static const upb_msglayout_field envoy_config_route_v3_FilterAction__fields[1] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
+};
+
+const upb_msglayout envoy_config_route_v3_FilterAction_msginit = {
+ &envoy_config_route_v3_FilterAction_submsgs[0],
+ &envoy_config_route_v3_FilterAction__fields[0],
+ UPB_SIZE(4, 8), 1, false,
+};
+
+static const upb_msglayout *const envoy_config_route_v3_Route_submsgs[12] = {
+ &envoy_config_core_v3_HeaderValueOption_msginit,
+ &envoy_config_core_v3_Metadata_msginit,
+ &envoy_config_route_v3_Decorator_msginit,
+ &envoy_config_route_v3_DirectResponseAction_msginit,
+ &envoy_config_route_v3_FilterAction_msginit,
+ &envoy_config_route_v3_RedirectAction_msginit,
+ &envoy_config_route_v3_Route_TypedPerFilterConfigEntry_msginit,
+ &envoy_config_route_v3_RouteAction_msginit,
+ &envoy_config_route_v3_RouteMatch_msginit,
+ &envoy_config_route_v3_Tracing_msginit,
+ &google_protobuf_UInt32Value_msginit,
+};
+
+static const upb_msglayout_field envoy_config_route_v3_Route__fields[15] = {
+ {1, UPB_SIZE(8, 16), 0, 8, 11, 1},
+ {2, UPB_SIZE(48, 96), UPB_SIZE(-53, -105), 7, 11, 1},
+ {3, UPB_SIZE(48, 96), UPB_SIZE(-53, -105), 5, 11, 1},
+ {4, UPB_SIZE(12, 24), 0, 1, 11, 1},
+ {5, UPB_SIZE(16, 32), 0, 2, 11, 1},
+ {7, UPB_SIZE(48, 96), UPB_SIZE(-53, -105), 3, 11, 1},
+ {9, UPB_SIZE(28, 56), 0, 0, 11, 3},
+ {10, UPB_SIZE(32, 64), 0, 0, 11, 3},
+ {11, UPB_SIZE(36, 72), 0, 0, 9, 3},
+ {12, UPB_SIZE(40, 80), 0, 0, 9, 3},
+ {13, UPB_SIZE(44, 88), 0, 6, 11, _UPB_LABEL_MAP},
+ {14, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {15, UPB_SIZE(20, 40), 0, 9, 11, 1},
+ {16, UPB_SIZE(24, 48), 0, 10, 11, 1},
+ {17, UPB_SIZE(48, 96), UPB_SIZE(-53, -105), 4, 11, 1},
+};
+
+const upb_msglayout envoy_config_route_v3_Route_msginit = {
+ &envoy_config_route_v3_Route_submsgs[0],
+ &envoy_config_route_v3_Route__fields[0],
+ UPB_SIZE(56, 112), 15, false,
+};
+
+static const upb_msglayout *const envoy_config_route_v3_Route_TypedPerFilterConfigEntry_submsgs[1] = {
+ &google_protobuf_Any_msginit,
+};
+
+static const upb_msglayout_field envoy_config_route_v3_Route_TypedPerFilterConfigEntry__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {2, UPB_SIZE(8, 16), 0, 0, 11, 1},
+};
+
+const upb_msglayout envoy_config_route_v3_Route_TypedPerFilterConfigEntry_msginit = {
+ &envoy_config_route_v3_Route_TypedPerFilterConfigEntry_submsgs[0],
+ &envoy_config_route_v3_Route_TypedPerFilterConfigEntry__fields[0],
+ UPB_SIZE(16, 32), 2, false,
+};
+
+static const upb_msglayout *const envoy_config_route_v3_WeightedCluster_submsgs[2] = {
+ &envoy_config_route_v3_WeightedCluster_ClusterWeight_msginit,
+ &google_protobuf_UInt32Value_msginit,
+};
+
+static const upb_msglayout_field envoy_config_route_v3_WeightedCluster__fields[3] = {
+ {1, UPB_SIZE(12, 24), 0, 0, 11, 3},
+ {2, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {3, UPB_SIZE(8, 16), 0, 1, 11, 1},
+};
+
+const upb_msglayout envoy_config_route_v3_WeightedCluster_msginit = {
+ &envoy_config_route_v3_WeightedCluster_submsgs[0],
+ &envoy_config_route_v3_WeightedCluster__fields[0],
+ UPB_SIZE(16, 32), 3, false,
+};
+
+static const upb_msglayout *const envoy_config_route_v3_WeightedCluster_ClusterWeight_submsgs[5] = {
+ &envoy_config_core_v3_HeaderValueOption_msginit,
+ &envoy_config_core_v3_Metadata_msginit,
+ &envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry_msginit,
+ &google_protobuf_UInt32Value_msginit,
+};
+
+static const upb_msglayout_field envoy_config_route_v3_WeightedCluster_ClusterWeight__fields[8] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {2, UPB_SIZE(8, 16), 0, 3, 11, 1},
+ {3, UPB_SIZE(12, 24), 0, 1, 11, 1},
+ {4, UPB_SIZE(16, 32), 0, 0, 11, 3},
+ {5, UPB_SIZE(20, 40), 0, 0, 11, 3},
+ {6, UPB_SIZE(24, 48), 0, 0, 9, 3},
+ {9, UPB_SIZE(28, 56), 0, 0, 9, 3},
+ {10, UPB_SIZE(32, 64), 0, 2, 11, _UPB_LABEL_MAP},
+};
+
+const upb_msglayout envoy_config_route_v3_WeightedCluster_ClusterWeight_msginit = {
+ &envoy_config_route_v3_WeightedCluster_ClusterWeight_submsgs[0],
+ &envoy_config_route_v3_WeightedCluster_ClusterWeight__fields[0],
+ UPB_SIZE(40, 80), 8, false,
+};
+
+static const upb_msglayout *const envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry_submsgs[1] = {
+ &google_protobuf_Any_msginit,
+};
+
+static const upb_msglayout_field envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {2, UPB_SIZE(8, 16), 0, 0, 11, 1},
+};
+
+const upb_msglayout envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry_msginit = {
+ &envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry_submsgs[0],
+ &envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry__fields[0],
+ UPB_SIZE(16, 32), 2, false,
+};
+
+static const upb_msglayout *const envoy_config_route_v3_RouteMatch_submsgs[8] = {
+ &envoy_config_core_v3_RuntimeFractionalPercent_msginit,
+ &envoy_config_route_v3_HeaderMatcher_msginit,
+ &envoy_config_route_v3_QueryParameterMatcher_msginit,
+ &envoy_config_route_v3_RouteMatch_ConnectMatcher_msginit,
+ &envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions_msginit,
+ &envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_msginit,
+ &envoy_type_matcher_v3_RegexMatcher_msginit,
+ &google_protobuf_BoolValue_msginit,
+};
+
+static const upb_msglayout_field envoy_config_route_v3_RouteMatch__fields[10] = {
+ {1, UPB_SIZE(24, 48), UPB_SIZE(-33, -65), 0, 9, 1},
+ {2, UPB_SIZE(24, 48), UPB_SIZE(-33, -65), 0, 9, 1},
+ {4, UPB_SIZE(0, 0), 0, 7, 11, 1},
+ {6, UPB_SIZE(16, 32), 0, 1, 11, 3},
+ {7, UPB_SIZE(20, 40), 0, 2, 11, 3},
+ {8, UPB_SIZE(4, 8), 0, 4, 11, 1},
+ {9, UPB_SIZE(8, 16), 0, 0, 11, 1},
+ {10, UPB_SIZE(24, 48), UPB_SIZE(-33, -65), 6, 11, 1},
+ {11, UPB_SIZE(12, 24), 0, 5, 11, 1},
+ {12, UPB_SIZE(24, 48), UPB_SIZE(-33, -65), 3, 11, 1},
+};
+
+const upb_msglayout envoy_config_route_v3_RouteMatch_msginit = {
+ &envoy_config_route_v3_RouteMatch_submsgs[0],
+ &envoy_config_route_v3_RouteMatch__fields[0],
+ UPB_SIZE(40, 80), 10, false,
+};
+
+const upb_msglayout envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions_msginit = {
+ NULL,
+ NULL,
+ UPB_SIZE(0, 0), 0, false,
+};
+
+static const upb_msglayout *const envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_submsgs[2] = {
+ &google_protobuf_BoolValue_msginit,
+};
+
+static const upb_msglayout_field envoy_config_route_v3_RouteMatch_TlsContextMatchOptions__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
+ {2, UPB_SIZE(4, 8), 0, 0, 11, 1},
+};
+
+const upb_msglayout envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_msginit = {
+ &envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_submsgs[0],
+ &envoy_config_route_v3_RouteMatch_TlsContextMatchOptions__fields[0],
+ UPB_SIZE(8, 16), 2, false,
+};
+
+const upb_msglayout envoy_config_route_v3_RouteMatch_ConnectMatcher_msginit = {
+ NULL,
+ NULL,
+ UPB_SIZE(0, 0), 0, false,
+};
+
+static const upb_msglayout *const envoy_config_route_v3_CorsPolicy_submsgs[4] = {
+ &envoy_config_core_v3_RuntimeFractionalPercent_msginit,
+ &envoy_type_matcher_v3_StringMatcher_msginit,
+ &google_protobuf_BoolValue_msginit,
+};
+
+static const upb_msglayout_field envoy_config_route_v3_CorsPolicy__fields[8] = {
+ {2, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {3, UPB_SIZE(8, 16), 0, 0, 9, 1},
+ {4, UPB_SIZE(16, 32), 0, 0, 9, 1},
+ {5, UPB_SIZE(24, 48), 0, 0, 9, 1},
+ {6, UPB_SIZE(32, 64), 0, 2, 11, 1},
+ {9, UPB_SIZE(44, 88), UPB_SIZE(-49, -97), 0, 11, 1},
+ {10, UPB_SIZE(36, 72), 0, 0, 11, 1},
+ {11, UPB_SIZE(40, 80), 0, 1, 11, 3},
+};
+
+const upb_msglayout envoy_config_route_v3_CorsPolicy_msginit = {
+ &envoy_config_route_v3_CorsPolicy_submsgs[0],
+ &envoy_config_route_v3_CorsPolicy__fields[0],
+ UPB_SIZE(56, 112), 8, false,
+};
+
+static const upb_msglayout *const envoy_config_route_v3_RouteAction_submsgs[21] = {
+ &envoy_config_core_v3_Metadata_msginit,
+ &envoy_config_route_v3_CorsPolicy_msginit,
+ &envoy_config_route_v3_HedgePolicy_msginit,
+ &envoy_config_route_v3_InternalRedirectPolicy_msginit,
+ &envoy_config_route_v3_RateLimit_msginit,
+ &envoy_config_route_v3_RetryPolicy_msginit,
+ &envoy_config_route_v3_RouteAction_HashPolicy_msginit,
+ &envoy_config_route_v3_RouteAction_MaxStreamDuration_msginit,
+ &envoy_config_route_v3_RouteAction_RequestMirrorPolicy_msginit,
+ &envoy_config_route_v3_RouteAction_UpgradeConfig_msginit,
+ &envoy_config_route_v3_WeightedCluster_msginit,
+ &envoy_type_matcher_v3_RegexMatchAndSubstitute_msginit,
+ &google_protobuf_Any_msginit,
+ &google_protobuf_BoolValue_msginit,
+ &google_protobuf_Duration_msginit,
+ &google_protobuf_UInt32Value_msginit,
+};
+
+static const upb_msglayout_field envoy_config_route_v3_RouteAction__fields[29] = {
+ {1, UPB_SIZE(104, 184), UPB_SIZE(-113, -201), 0, 9, 1},
+ {2, UPB_SIZE(104, 184), UPB_SIZE(-113, -201), 0, 9, 1},
+ {3, UPB_SIZE(104, 184), UPB_SIZE(-113, -201), 10, 11, 1},
+ {4, UPB_SIZE(32, 40), 0, 0, 11, 1},
+ {5, UPB_SIZE(24, 24), 0, 0, 9, 1},
+ {6, UPB_SIZE(116, 208), UPB_SIZE(-125, -225), 0, 9, 1},
+ {7, UPB_SIZE(116, 208), UPB_SIZE(-125, -225), 13, 11, 1},
+ {8, UPB_SIZE(36, 48), 0, 14, 11, 1},
+ {9, UPB_SIZE(40, 56), 0, 5, 11, 1},
+ {11, UPB_SIZE(0, 0), 0, 0, 14, 1},
+ {13, UPB_SIZE(88, 152), 0, 4, 11, 3},
+ {14, UPB_SIZE(44, 64), 0, 13, 11, 1},
+ {15, UPB_SIZE(92, 160), 0, 6, 11, 3},
+ {17, UPB_SIZE(48, 72), 0, 1, 11, 1},
+ {20, UPB_SIZE(8, 8), 0, 0, 14, 1},
+ {23, UPB_SIZE(52, 80), 0, 14, 11, 1},
+ {24, UPB_SIZE(56, 88), 0, 14, 11, 1},
+ {25, UPB_SIZE(96, 168), 0, 9, 11, 3},
+ {26, UPB_SIZE(16, 16), 0, 0, 14, 1},
+ {27, UPB_SIZE(60, 96), 0, 2, 11, 1},
+ {28, UPB_SIZE(64, 104), 0, 14, 11, 1},
+ {29, UPB_SIZE(116, 208), UPB_SIZE(-125, -225), 0, 9, 1},
+ {30, UPB_SIZE(100, 176), 0, 8, 11, 3},
+ {31, UPB_SIZE(68, 112), 0, 15, 11, 1},
+ {32, UPB_SIZE(72, 120), 0, 11, 11, 1},
+ {33, UPB_SIZE(76, 128), 0, 12, 11, 1},
+ {34, UPB_SIZE(80, 136), 0, 3, 11, 1},
+ {35, UPB_SIZE(116, 208), UPB_SIZE(-125, -225), 11, 11, 1},
+ {36, UPB_SIZE(84, 144), 0, 7, 11, 1},
+};
+
+const upb_msglayout envoy_config_route_v3_RouteAction_msginit = {
+ &envoy_config_route_v3_RouteAction_submsgs[0],
+ &envoy_config_route_v3_RouteAction__fields[0],
+ UPB_SIZE(128, 240), 29, false,
+};
+
+static const upb_msglayout *const envoy_config_route_v3_RouteAction_RequestMirrorPolicy_submsgs[2] = {
+ &envoy_config_core_v3_RuntimeFractionalPercent_msginit,
+ &google_protobuf_BoolValue_msginit,
+};
+
+static const upb_msglayout_field envoy_config_route_v3_RouteAction_RequestMirrorPolicy__fields[3] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {3, UPB_SIZE(8, 16), 0, 0, 11, 1},
+ {4, UPB_SIZE(12, 24), 0, 1, 11, 1},
+};
+
+const upb_msglayout envoy_config_route_v3_RouteAction_RequestMirrorPolicy_msginit = {
+ &envoy_config_route_v3_RouteAction_RequestMirrorPolicy_submsgs[0],
+ &envoy_config_route_v3_RouteAction_RequestMirrorPolicy__fields[0],
+ UPB_SIZE(16, 32), 3, false,
+};
+
+static const upb_msglayout *const envoy_config_route_v3_RouteAction_HashPolicy_submsgs[5] = {
+ &envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_msginit,
+ &envoy_config_route_v3_RouteAction_HashPolicy_Cookie_msginit,
+ &envoy_config_route_v3_RouteAction_HashPolicy_FilterState_msginit,
+ &envoy_config_route_v3_RouteAction_HashPolicy_Header_msginit,
+ &envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_msginit,
+};
+
+static const upb_msglayout_field envoy_config_route_v3_RouteAction_HashPolicy__fields[6] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(-9, -17), 3, 11, 1},
+ {2, UPB_SIZE(4, 8), UPB_SIZE(-9, -17), 1, 11, 1},
+ {3, UPB_SIZE(4, 8), UPB_SIZE(-9, -17), 0, 11, 1},
+ {4, UPB_SIZE(0, 0), 0, 0, 8, 1},
+ {5, UPB_SIZE(4, 8), UPB_SIZE(-9, -17), 4, 11, 1},
+ {6, UPB_SIZE(4, 8), UPB_SIZE(-9, -17), 2, 11, 1},
+};
+
+const upb_msglayout envoy_config_route_v3_RouteAction_HashPolicy_msginit = {
+ &envoy_config_route_v3_RouteAction_HashPolicy_submsgs[0],
+ &envoy_config_route_v3_RouteAction_HashPolicy__fields[0],
+ UPB_SIZE(12, 24), 6, false,
+};
+
+static const upb_msglayout *const envoy_config_route_v3_RouteAction_HashPolicy_Header_submsgs[1] = {
+ &envoy_type_matcher_v3_RegexMatchAndSubstitute_msginit,
+};
+
+static const upb_msglayout_field envoy_config_route_v3_RouteAction_HashPolicy_Header__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {2, UPB_SIZE(8, 16), 0, 0, 11, 1},
+};
+
+const upb_msglayout envoy_config_route_v3_RouteAction_HashPolicy_Header_msginit = {
+ &envoy_config_route_v3_RouteAction_HashPolicy_Header_submsgs[0],
+ &envoy_config_route_v3_RouteAction_HashPolicy_Header__fields[0],
+ UPB_SIZE(16, 32), 2, false,
+};
+
+static const upb_msglayout *const envoy_config_route_v3_RouteAction_HashPolicy_Cookie_submsgs[1] = {
+ &google_protobuf_Duration_msginit,
+};
+
+static const upb_msglayout_field envoy_config_route_v3_RouteAction_HashPolicy_Cookie__fields[3] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {2, UPB_SIZE(16, 32), 0, 0, 11, 1},
+ {3, UPB_SIZE(8, 16), 0, 0, 9, 1},
+};
+
+const upb_msglayout envoy_config_route_v3_RouteAction_HashPolicy_Cookie_msginit = {
+ &envoy_config_route_v3_RouteAction_HashPolicy_Cookie_submsgs[0],
+ &envoy_config_route_v3_RouteAction_HashPolicy_Cookie__fields[0],
+ UPB_SIZE(24, 48), 3, false,
+};
+
+static const upb_msglayout_field envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties__fields[1] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 8, 1},
+};
+
+const upb_msglayout envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_msginit = {
+ NULL,
+ &envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties__fields[0],
+ UPB_SIZE(1, 1), 1, false,
+};
+
+static const upb_msglayout_field envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter__fields[1] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+};
+
+const upb_msglayout envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_msginit = {
+ NULL,
+ &envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter__fields[0],
+ UPB_SIZE(8, 16), 1, false,
+};
+
+static const upb_msglayout_field envoy_config_route_v3_RouteAction_HashPolicy_FilterState__fields[1] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+};
+
+const upb_msglayout envoy_config_route_v3_RouteAction_HashPolicy_FilterState_msginit = {
+ NULL,
+ &envoy_config_route_v3_RouteAction_HashPolicy_FilterState__fields[0],
+ UPB_SIZE(8, 16), 1, false,
+};
+
+static const upb_msglayout *const envoy_config_route_v3_RouteAction_UpgradeConfig_submsgs[2] = {
+ &envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_msginit,
+ &google_protobuf_BoolValue_msginit,
+};
+
+static const upb_msglayout_field envoy_config_route_v3_RouteAction_UpgradeConfig__fields[3] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {2, UPB_SIZE(8, 16), 0, 1, 11, 1},
+ {3, UPB_SIZE(12, 24), 0, 0, 11, 1},
+};
+
+const upb_msglayout envoy_config_route_v3_RouteAction_UpgradeConfig_msginit = {
+ &envoy_config_route_v3_RouteAction_UpgradeConfig_submsgs[0],
+ &envoy_config_route_v3_RouteAction_UpgradeConfig__fields[0],
+ UPB_SIZE(16, 32), 3, false,
+};
+
+static const upb_msglayout *const envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_submsgs[1] = {
+ &envoy_config_core_v3_ProxyProtocolConfig_msginit,
+};
+
+static const upb_msglayout_field envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig__fields[1] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
+};
+
+const upb_msglayout envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_msginit = {
+ &envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_submsgs[0],
+ &envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig__fields[0],
+ UPB_SIZE(4, 8), 1, false,
+};
+
+static const upb_msglayout *const envoy_config_route_v3_RouteAction_MaxStreamDuration_submsgs[3] = {
+ &google_protobuf_Duration_msginit,
+};
+
+static const upb_msglayout_field envoy_config_route_v3_RouteAction_MaxStreamDuration__fields[3] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
+ {2, UPB_SIZE(4, 8), 0, 0, 11, 1},
+ {3, UPB_SIZE(8, 16), 0, 0, 11, 1},
+};
+
+const upb_msglayout envoy_config_route_v3_RouteAction_MaxStreamDuration_msginit = {
+ &envoy_config_route_v3_RouteAction_MaxStreamDuration_submsgs[0],
+ &envoy_config_route_v3_RouteAction_MaxStreamDuration__fields[0],
+ UPB_SIZE(12, 24), 3, false,
+};
+
+static const upb_msglayout *const envoy_config_route_v3_RetryPolicy_submsgs[8] = {
+ &envoy_config_route_v3_HeaderMatcher_msginit,
+ &envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_msginit,
+ &envoy_config_route_v3_RetryPolicy_RetryBackOff_msginit,
+ &envoy_config_route_v3_RetryPolicy_RetryHostPredicate_msginit,
+ &envoy_config_route_v3_RetryPolicy_RetryPriority_msginit,
+ &google_protobuf_Duration_msginit,
+ &google_protobuf_UInt32Value_msginit,
+};
+
+static const upb_msglayout_field envoy_config_route_v3_RetryPolicy__fields[11] = {
+ {1, UPB_SIZE(8, 8), 0, 0, 9, 1},
+ {2, UPB_SIZE(16, 24), 0, 6, 11, 1},
+ {3, UPB_SIZE(20, 32), 0, 5, 11, 1},
+ {4, UPB_SIZE(24, 40), 0, 4, 11, 1},
+ {5, UPB_SIZE(36, 64), 0, 3, 11, 3},
+ {6, UPB_SIZE(0, 0), 0, 0, 3, 1},
+ {7, UPB_SIZE(40, 72), 0, 0, 13, _UPB_LABEL_PACKED},
+ {8, UPB_SIZE(28, 48), 0, 2, 11, 1},
+ {9, UPB_SIZE(44, 80), 0, 0, 11, 3},
+ {10, UPB_SIZE(48, 88), 0, 0, 11, 3},
+ {11, UPB_SIZE(32, 56), 0, 1, 11, 1},
+};
+
+const upb_msglayout envoy_config_route_v3_RetryPolicy_msginit = {
+ &envoy_config_route_v3_RetryPolicy_submsgs[0],
+ &envoy_config_route_v3_RetryPolicy__fields[0],
+ UPB_SIZE(56, 96), 11, false,
+};
+
+static const upb_msglayout *const envoy_config_route_v3_RetryPolicy_RetryPriority_submsgs[1] = {
+ &google_protobuf_Any_msginit,
+};
+
+static const upb_msglayout_field envoy_config_route_v3_RetryPolicy_RetryPriority__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {3, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, 1},
+};
+
+const upb_msglayout envoy_config_route_v3_RetryPolicy_RetryPriority_msginit = {
+ &envoy_config_route_v3_RetryPolicy_RetryPriority_submsgs[0],
+ &envoy_config_route_v3_RetryPolicy_RetryPriority__fields[0],
+ UPB_SIZE(16, 32), 2, false,
+};
+
+static const upb_msglayout *const envoy_config_route_v3_RetryPolicy_RetryHostPredicate_submsgs[1] = {
+ &google_protobuf_Any_msginit,
+};
+
+static const upb_msglayout_field envoy_config_route_v3_RetryPolicy_RetryHostPredicate__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {3, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, 1},
+};
+
+const upb_msglayout envoy_config_route_v3_RetryPolicy_RetryHostPredicate_msginit = {
+ &envoy_config_route_v3_RetryPolicy_RetryHostPredicate_submsgs[0],
+ &envoy_config_route_v3_RetryPolicy_RetryHostPredicate__fields[0],
+ UPB_SIZE(16, 32), 2, false,
+};
+
+static const upb_msglayout *const envoy_config_route_v3_RetryPolicy_RetryBackOff_submsgs[2] = {
+ &google_protobuf_Duration_msginit,
+};
+
+static const upb_msglayout_field envoy_config_route_v3_RetryPolicy_RetryBackOff__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
+ {2, UPB_SIZE(4, 8), 0, 0, 11, 1},
+};
+
+const upb_msglayout envoy_config_route_v3_RetryPolicy_RetryBackOff_msginit = {
+ &envoy_config_route_v3_RetryPolicy_RetryBackOff_submsgs[0],
+ &envoy_config_route_v3_RetryPolicy_RetryBackOff__fields[0],
+ UPB_SIZE(8, 16), 2, false,
+};
+
+static const upb_msglayout_field envoy_config_route_v3_RetryPolicy_ResetHeader__fields[2] = {
+ {1, UPB_SIZE(8, 8), 0, 0, 9, 1},
+ {2, UPB_SIZE(0, 0), 0, 0, 14, 1},
+};
+
+const upb_msglayout envoy_config_route_v3_RetryPolicy_ResetHeader_msginit = {
+ NULL,
+ &envoy_config_route_v3_RetryPolicy_ResetHeader__fields[0],
+ UPB_SIZE(16, 32), 2, false,
+};
+
+static const upb_msglayout *const envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_submsgs[2] = {
+ &envoy_config_route_v3_RetryPolicy_ResetHeader_msginit,
+ &google_protobuf_Duration_msginit,
+};
+
+static const upb_msglayout_field envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff__fields[2] = {
+ {1, UPB_SIZE(4, 8), 0, 0, 11, 3},
+ {2, UPB_SIZE(0, 0), 0, 1, 11, 1},
+};
+
+const upb_msglayout envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_msginit = {
+ &envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_submsgs[0],
+ &envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff__fields[0],
+ UPB_SIZE(8, 16), 2, false,
+};
+
+static const upb_msglayout *const envoy_config_route_v3_HedgePolicy_submsgs[2] = {
+ &envoy_type_v3_FractionalPercent_msginit,
+ &google_protobuf_UInt32Value_msginit,
+};
+
+static const upb_msglayout_field envoy_config_route_v3_HedgePolicy__fields[3] = {
+ {1, UPB_SIZE(4, 8), 0, 1, 11, 1},
+ {2, UPB_SIZE(8, 16), 0, 0, 11, 1},
+ {3, UPB_SIZE(0, 0), 0, 0, 8, 1},
+};
+
+const upb_msglayout envoy_config_route_v3_HedgePolicy_msginit = {
+ &envoy_config_route_v3_HedgePolicy_submsgs[0],
+ &envoy_config_route_v3_HedgePolicy__fields[0],
+ UPB_SIZE(12, 24), 3, false,
+};
+
+static const upb_msglayout_field envoy_config_route_v3_RedirectAction__fields[8] = {
+ {1, UPB_SIZE(16, 16), 0, 0, 9, 1},
+ {2, UPB_SIZE(24, 32), UPB_SIZE(-33, -49), 0, 9, 1},
+ {3, UPB_SIZE(0, 0), 0, 0, 14, 1},
+ {4, UPB_SIZE(36, 56), UPB_SIZE(-45, -73), 0, 8, 1},
+ {5, UPB_SIZE(24, 32), UPB_SIZE(-33, -49), 0, 9, 1},
+ {6, UPB_SIZE(12, 12), 0, 0, 8, 1},
+ {7, UPB_SIZE(36, 56), UPB_SIZE(-45, -73), 0, 9, 1},
+ {8, UPB_SIZE(8, 8), 0, 0, 13, 1},
+};
+
+const upb_msglayout envoy_config_route_v3_RedirectAction_msginit = {
+ NULL,
+ &envoy_config_route_v3_RedirectAction__fields[0],
+ UPB_SIZE(48, 80), 8, false,
+};
+
+static const upb_msglayout *const envoy_config_route_v3_DirectResponseAction_submsgs[1] = {
+ &envoy_config_core_v3_DataSource_msginit,
+};
+
+static const upb_msglayout_field envoy_config_route_v3_DirectResponseAction__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 13, 1},
+ {2, UPB_SIZE(4, 8), 0, 0, 11, 1},
+};
+
+const upb_msglayout envoy_config_route_v3_DirectResponseAction_msginit = {
+ &envoy_config_route_v3_DirectResponseAction_submsgs[0],
+ &envoy_config_route_v3_DirectResponseAction__fields[0],
+ UPB_SIZE(8, 16), 2, false,
+};
+
+static const upb_msglayout *const envoy_config_route_v3_Decorator_submsgs[1] = {
+ &google_protobuf_BoolValue_msginit,
+};
+
+static const upb_msglayout_field envoy_config_route_v3_Decorator__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {2, UPB_SIZE(8, 16), 0, 0, 11, 1},
+};
+
+const upb_msglayout envoy_config_route_v3_Decorator_msginit = {
+ &envoy_config_route_v3_Decorator_submsgs[0],
+ &envoy_config_route_v3_Decorator__fields[0],
+ UPB_SIZE(16, 32), 2, false,
+};
+
+static const upb_msglayout *const envoy_config_route_v3_Tracing_submsgs[4] = {
+ &envoy_type_tracing_v3_CustomTag_msginit,
+ &envoy_type_v3_FractionalPercent_msginit,
+};
+
+static const upb_msglayout_field envoy_config_route_v3_Tracing__fields[4] = {
+ {1, UPB_SIZE(0, 0), 0, 1, 11, 1},
+ {2, UPB_SIZE(4, 8), 0, 1, 11, 1},
+ {3, UPB_SIZE(8, 16), 0, 1, 11, 1},
+ {4, UPB_SIZE(12, 24), 0, 0, 11, 3},
+};
+
+const upb_msglayout envoy_config_route_v3_Tracing_msginit = {
+ &envoy_config_route_v3_Tracing_submsgs[0],
+ &envoy_config_route_v3_Tracing__fields[0],
+ UPB_SIZE(16, 32), 4, false,
+};
+
+static const upb_msglayout *const envoy_config_route_v3_VirtualCluster_submsgs[1] = {
+ &envoy_config_route_v3_HeaderMatcher_msginit,
+};
+
+static const upb_msglayout_field envoy_config_route_v3_VirtualCluster__fields[2] = {
+ {2, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {4, UPB_SIZE(8, 16), 0, 0, 11, 3},
+};
+
+const upb_msglayout envoy_config_route_v3_VirtualCluster_msginit = {
+ &envoy_config_route_v3_VirtualCluster_submsgs[0],
+ &envoy_config_route_v3_VirtualCluster__fields[0],
+ UPB_SIZE(16, 32), 2, false,
+};
+
+static const upb_msglayout *const envoy_config_route_v3_RateLimit_submsgs[3] = {
+ &envoy_config_route_v3_RateLimit_Action_msginit,
+ &envoy_config_route_v3_RateLimit_Override_msginit,
+ &google_protobuf_UInt32Value_msginit,
+};
+
+static const upb_msglayout_field envoy_config_route_v3_RateLimit__fields[4] = {
+ {1, UPB_SIZE(8, 16), 0, 2, 11, 1},
+ {2, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {3, UPB_SIZE(16, 32), 0, 0, 11, 3},
+ {4, UPB_SIZE(12, 24), 0, 1, 11, 1},
+};
+
+const upb_msglayout envoy_config_route_v3_RateLimit_msginit = {
+ &envoy_config_route_v3_RateLimit_submsgs[0],
+ &envoy_config_route_v3_RateLimit__fields[0],
+ UPB_SIZE(24, 48), 4, false,
+};
+
+static const upb_msglayout *const envoy_config_route_v3_RateLimit_Action_submsgs[7] = {
+ &envoy_config_route_v3_RateLimit_Action_DestinationCluster_msginit,
+ &envoy_config_route_v3_RateLimit_Action_DynamicMetaData_msginit,
+ &envoy_config_route_v3_RateLimit_Action_GenericKey_msginit,
+ &envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_msginit,
+ &envoy_config_route_v3_RateLimit_Action_RemoteAddress_msginit,
+ &envoy_config_route_v3_RateLimit_Action_RequestHeaders_msginit,
+ &envoy_config_route_v3_RateLimit_Action_SourceCluster_msginit,
+};
+
+static const upb_msglayout_field envoy_config_route_v3_RateLimit_Action__fields[7] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 6, 11, 1},
+ {2, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, 1},
+ {3, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 5, 11, 1},
+ {4, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 4, 11, 1},
+ {5, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 2, 11, 1},
+ {6, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 3, 11, 1},
+ {7, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 1, 11, 1},
+};
+
+const upb_msglayout envoy_config_route_v3_RateLimit_Action_msginit = {
+ &envoy_config_route_v3_RateLimit_Action_submsgs[0],
+ &envoy_config_route_v3_RateLimit_Action__fields[0],
+ UPB_SIZE(8, 16), 7, false,
+};
+
+const upb_msglayout envoy_config_route_v3_RateLimit_Action_SourceCluster_msginit = {
+ NULL,
+ NULL,
+ UPB_SIZE(0, 0), 0, false,
+};
+
+const upb_msglayout envoy_config_route_v3_RateLimit_Action_DestinationCluster_msginit = {
+ NULL,
+ NULL,
+ UPB_SIZE(0, 0), 0, false,
+};
+
+static const upb_msglayout_field envoy_config_route_v3_RateLimit_Action_RequestHeaders__fields[3] = {
+ {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
+ {2, UPB_SIZE(12, 24), 0, 0, 9, 1},
+ {3, UPB_SIZE(0, 0), 0, 0, 8, 1},
+};
+
+const upb_msglayout envoy_config_route_v3_RateLimit_Action_RequestHeaders_msginit = {
+ NULL,
+ &envoy_config_route_v3_RateLimit_Action_RequestHeaders__fields[0],
+ UPB_SIZE(24, 48), 3, false,
+};
+
+const upb_msglayout envoy_config_route_v3_RateLimit_Action_RemoteAddress_msginit = {
+ NULL,
+ NULL,
+ UPB_SIZE(0, 0), 0, false,
+};
+
+static const upb_msglayout_field envoy_config_route_v3_RateLimit_Action_GenericKey__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {2, UPB_SIZE(8, 16), 0, 0, 9, 1},
+};
+
+const upb_msglayout envoy_config_route_v3_RateLimit_Action_GenericKey_msginit = {
+ NULL,
+ &envoy_config_route_v3_RateLimit_Action_GenericKey__fields[0],
+ UPB_SIZE(16, 32), 2, false,
+};
+
+static const upb_msglayout *const envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_submsgs[2] = {
+ &envoy_config_route_v3_HeaderMatcher_msginit,
+ &google_protobuf_BoolValue_msginit,
+};
+
+static const upb_msglayout_field envoy_config_route_v3_RateLimit_Action_HeaderValueMatch__fields[3] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {2, UPB_SIZE(8, 16), 0, 1, 11, 1},
+ {3, UPB_SIZE(12, 24), 0, 0, 11, 3},
+};
+
+const upb_msglayout envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_msginit = {
+ &envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_submsgs[0],
+ &envoy_config_route_v3_RateLimit_Action_HeaderValueMatch__fields[0],
+ UPB_SIZE(16, 32), 3, false,
+};
+
+static const upb_msglayout *const envoy_config_route_v3_RateLimit_Action_DynamicMetaData_submsgs[1] = {
+ &envoy_type_metadata_v3_MetadataKey_msginit,
+};
+
+static const upb_msglayout_field envoy_config_route_v3_RateLimit_Action_DynamicMetaData__fields[3] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {2, UPB_SIZE(16, 32), 0, 0, 11, 1},
+ {3, UPB_SIZE(8, 16), 0, 0, 9, 1},
+};
+
+const upb_msglayout envoy_config_route_v3_RateLimit_Action_DynamicMetaData_msginit = {
+ &envoy_config_route_v3_RateLimit_Action_DynamicMetaData_submsgs[0],
+ &envoy_config_route_v3_RateLimit_Action_DynamicMetaData__fields[0],
+ UPB_SIZE(24, 48), 3, false,
+};
+
+static const upb_msglayout *const envoy_config_route_v3_RateLimit_Override_submsgs[1] = {
+ &envoy_config_route_v3_RateLimit_Override_DynamicMetadata_msginit,
+};
+
+static const upb_msglayout_field envoy_config_route_v3_RateLimit_Override__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, 1},
+};
+
+const upb_msglayout envoy_config_route_v3_RateLimit_Override_msginit = {
+ &envoy_config_route_v3_RateLimit_Override_submsgs[0],
+ &envoy_config_route_v3_RateLimit_Override__fields[0],
+ UPB_SIZE(8, 16), 1, false,
+};
+
+static const upb_msglayout *const envoy_config_route_v3_RateLimit_Override_DynamicMetadata_submsgs[1] = {
+ &envoy_type_metadata_v3_MetadataKey_msginit,
+};
+
+static const upb_msglayout_field envoy_config_route_v3_RateLimit_Override_DynamicMetadata__fields[1] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
+};
+
+const upb_msglayout envoy_config_route_v3_RateLimit_Override_DynamicMetadata_msginit = {
+ &envoy_config_route_v3_RateLimit_Override_DynamicMetadata_submsgs[0],
+ &envoy_config_route_v3_RateLimit_Override_DynamicMetadata__fields[0],
+ UPB_SIZE(4, 8), 1, false,
+};
+
+static const upb_msglayout *const envoy_config_route_v3_HeaderMatcher_submsgs[2] = {
+ &envoy_type_matcher_v3_RegexMatcher_msginit,
+ &envoy_type_v3_Int64Range_msginit,
+};
+
+static const upb_msglayout_field envoy_config_route_v3_HeaderMatcher__fields[9] = {
+ {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
+ {4, UPB_SIZE(12, 24), UPB_SIZE(-21, -41), 0, 9, 1},
+ {6, UPB_SIZE(12, 24), UPB_SIZE(-21, -41), 1, 11, 1},
+ {7, UPB_SIZE(12, 24), UPB_SIZE(-21, -41), 0, 8, 1},
+ {8, UPB_SIZE(0, 0), 0, 0, 8, 1},
+ {9, UPB_SIZE(12, 24), UPB_SIZE(-21, -41), 0, 9, 1},
+ {10, UPB_SIZE(12, 24), UPB_SIZE(-21, -41), 0, 9, 1},
+ {11, UPB_SIZE(12, 24), UPB_SIZE(-21, -41), 0, 11, 1},
+ {12, UPB_SIZE(12, 24), UPB_SIZE(-21, -41), 0, 9, 1},
+};
+
+const upb_msglayout envoy_config_route_v3_HeaderMatcher_msginit = {
+ &envoy_config_route_v3_HeaderMatcher_submsgs[0],
+ &envoy_config_route_v3_HeaderMatcher__fields[0],
+ UPB_SIZE(24, 48), 9, false,
+};
+
+static const upb_msglayout *const envoy_config_route_v3_QueryParameterMatcher_submsgs[1] = {
+ &envoy_type_matcher_v3_StringMatcher_msginit,
+};
+
+static const upb_msglayout_field envoy_config_route_v3_QueryParameterMatcher__fields[3] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {5, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, 1},
+ {6, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 8, 1},
+};
+
+const upb_msglayout envoy_config_route_v3_QueryParameterMatcher_msginit = {
+ &envoy_config_route_v3_QueryParameterMatcher_submsgs[0],
+ &envoy_config_route_v3_QueryParameterMatcher__fields[0],
+ UPB_SIZE(16, 32), 3, false,
+};
+
+static const upb_msglayout *const envoy_config_route_v3_InternalRedirectPolicy_submsgs[2] = {
+ &envoy_config_core_v3_TypedExtensionConfig_msginit,
+ &google_protobuf_UInt32Value_msginit,
+};
+
+static const upb_msglayout_field envoy_config_route_v3_InternalRedirectPolicy__fields[4] = {
+ {1, UPB_SIZE(4, 8), 0, 1, 11, 1},
+ {2, UPB_SIZE(8, 16), 0, 0, 13, _UPB_LABEL_PACKED},
+ {3, UPB_SIZE(12, 24), 0, 0, 11, 3},
+ {4, UPB_SIZE(0, 0), 0, 0, 8, 1},
+};
+
+const upb_msglayout envoy_config_route_v3_InternalRedirectPolicy_msginit = {
+ &envoy_config_route_v3_InternalRedirectPolicy_submsgs[0],
+ &envoy_config_route_v3_InternalRedirectPolicy__fields[0],
+ UPB_SIZE(16, 32), 4, false,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.h
index 4d880f55db0..863c7a6b6a4 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.h
@@ -1,3290 +1,3290 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/config/route/v3/route_components.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef ENVOY_CONFIG_ROUTE_V3_ROUTE_COMPONENTS_PROTO_UPB_H_
-#define ENVOY_CONFIG_ROUTE_V3_ROUTE_COMPONENTS_PROTO_UPB_H_
-
-#include "upb/msg.h"
-#include "upb/decode.h"
-#include "upb/encode.h"
-
-#include "upb/port_def.inc"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct envoy_config_route_v3_VirtualHost;
-struct envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry;
-struct envoy_config_route_v3_FilterAction;
-struct envoy_config_route_v3_Route;
-struct envoy_config_route_v3_Route_TypedPerFilterConfigEntry;
-struct envoy_config_route_v3_WeightedCluster;
-struct envoy_config_route_v3_WeightedCluster_ClusterWeight;
-struct envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry;
-struct envoy_config_route_v3_RouteMatch;
-struct envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions;
-struct envoy_config_route_v3_RouteMatch_TlsContextMatchOptions;
-struct envoy_config_route_v3_RouteMatch_ConnectMatcher;
-struct envoy_config_route_v3_CorsPolicy;
-struct envoy_config_route_v3_RouteAction;
-struct envoy_config_route_v3_RouteAction_RequestMirrorPolicy;
-struct envoy_config_route_v3_RouteAction_HashPolicy;
-struct envoy_config_route_v3_RouteAction_HashPolicy_Header;
-struct envoy_config_route_v3_RouteAction_HashPolicy_Cookie;
-struct envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties;
-struct envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter;
-struct envoy_config_route_v3_RouteAction_HashPolicy_FilterState;
-struct envoy_config_route_v3_RouteAction_UpgradeConfig;
-struct envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig;
-struct envoy_config_route_v3_RouteAction_MaxStreamDuration;
-struct envoy_config_route_v3_RetryPolicy;
-struct envoy_config_route_v3_RetryPolicy_RetryPriority;
-struct envoy_config_route_v3_RetryPolicy_RetryHostPredicate;
-struct envoy_config_route_v3_RetryPolicy_RetryBackOff;
-struct envoy_config_route_v3_RetryPolicy_ResetHeader;
-struct envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff;
-struct envoy_config_route_v3_HedgePolicy;
-struct envoy_config_route_v3_RedirectAction;
-struct envoy_config_route_v3_DirectResponseAction;
-struct envoy_config_route_v3_Decorator;
-struct envoy_config_route_v3_Tracing;
-struct envoy_config_route_v3_VirtualCluster;
-struct envoy_config_route_v3_RateLimit;
-struct envoy_config_route_v3_RateLimit_Action;
-struct envoy_config_route_v3_RateLimit_Action_SourceCluster;
-struct envoy_config_route_v3_RateLimit_Action_DestinationCluster;
-struct envoy_config_route_v3_RateLimit_Action_RequestHeaders;
-struct envoy_config_route_v3_RateLimit_Action_RemoteAddress;
-struct envoy_config_route_v3_RateLimit_Action_GenericKey;
-struct envoy_config_route_v3_RateLimit_Action_HeaderValueMatch;
-struct envoy_config_route_v3_RateLimit_Action_DynamicMetaData;
-struct envoy_config_route_v3_RateLimit_Override;
-struct envoy_config_route_v3_RateLimit_Override_DynamicMetadata;
-struct envoy_config_route_v3_HeaderMatcher;
-struct envoy_config_route_v3_QueryParameterMatcher;
-struct envoy_config_route_v3_InternalRedirectPolicy;
-typedef struct envoy_config_route_v3_VirtualHost envoy_config_route_v3_VirtualHost;
-typedef struct envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry;
-typedef struct envoy_config_route_v3_FilterAction envoy_config_route_v3_FilterAction;
-typedef struct envoy_config_route_v3_Route envoy_config_route_v3_Route;
-typedef struct envoy_config_route_v3_Route_TypedPerFilterConfigEntry envoy_config_route_v3_Route_TypedPerFilterConfigEntry;
-typedef struct envoy_config_route_v3_WeightedCluster envoy_config_route_v3_WeightedCluster;
-typedef struct envoy_config_route_v3_WeightedCluster_ClusterWeight envoy_config_route_v3_WeightedCluster_ClusterWeight;
-typedef struct envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry;
-typedef struct envoy_config_route_v3_RouteMatch envoy_config_route_v3_RouteMatch;
-typedef struct envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions;
-typedef struct envoy_config_route_v3_RouteMatch_TlsContextMatchOptions envoy_config_route_v3_RouteMatch_TlsContextMatchOptions;
-typedef struct envoy_config_route_v3_RouteMatch_ConnectMatcher envoy_config_route_v3_RouteMatch_ConnectMatcher;
-typedef struct envoy_config_route_v3_CorsPolicy envoy_config_route_v3_CorsPolicy;
-typedef struct envoy_config_route_v3_RouteAction envoy_config_route_v3_RouteAction;
-typedef struct envoy_config_route_v3_RouteAction_RequestMirrorPolicy envoy_config_route_v3_RouteAction_RequestMirrorPolicy;
-typedef struct envoy_config_route_v3_RouteAction_HashPolicy envoy_config_route_v3_RouteAction_HashPolicy;
-typedef struct envoy_config_route_v3_RouteAction_HashPolicy_Header envoy_config_route_v3_RouteAction_HashPolicy_Header;
-typedef struct envoy_config_route_v3_RouteAction_HashPolicy_Cookie envoy_config_route_v3_RouteAction_HashPolicy_Cookie;
-typedef struct envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties;
-typedef struct envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter;
-typedef struct envoy_config_route_v3_RouteAction_HashPolicy_FilterState envoy_config_route_v3_RouteAction_HashPolicy_FilterState;
-typedef struct envoy_config_route_v3_RouteAction_UpgradeConfig envoy_config_route_v3_RouteAction_UpgradeConfig;
-typedef struct envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig;
-typedef struct envoy_config_route_v3_RouteAction_MaxStreamDuration envoy_config_route_v3_RouteAction_MaxStreamDuration;
-typedef struct envoy_config_route_v3_RetryPolicy envoy_config_route_v3_RetryPolicy;
-typedef struct envoy_config_route_v3_RetryPolicy_RetryPriority envoy_config_route_v3_RetryPolicy_RetryPriority;
-typedef struct envoy_config_route_v3_RetryPolicy_RetryHostPredicate envoy_config_route_v3_RetryPolicy_RetryHostPredicate;
-typedef struct envoy_config_route_v3_RetryPolicy_RetryBackOff envoy_config_route_v3_RetryPolicy_RetryBackOff;
-typedef struct envoy_config_route_v3_RetryPolicy_ResetHeader envoy_config_route_v3_RetryPolicy_ResetHeader;
-typedef struct envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff;
-typedef struct envoy_config_route_v3_HedgePolicy envoy_config_route_v3_HedgePolicy;
-typedef struct envoy_config_route_v3_RedirectAction envoy_config_route_v3_RedirectAction;
-typedef struct envoy_config_route_v3_DirectResponseAction envoy_config_route_v3_DirectResponseAction;
-typedef struct envoy_config_route_v3_Decorator envoy_config_route_v3_Decorator;
-typedef struct envoy_config_route_v3_Tracing envoy_config_route_v3_Tracing;
-typedef struct envoy_config_route_v3_VirtualCluster envoy_config_route_v3_VirtualCluster;
-typedef struct envoy_config_route_v3_RateLimit envoy_config_route_v3_RateLimit;
-typedef struct envoy_config_route_v3_RateLimit_Action envoy_config_route_v3_RateLimit_Action;
-typedef struct envoy_config_route_v3_RateLimit_Action_SourceCluster envoy_config_route_v3_RateLimit_Action_SourceCluster;
-typedef struct envoy_config_route_v3_RateLimit_Action_DestinationCluster envoy_config_route_v3_RateLimit_Action_DestinationCluster;
-typedef struct envoy_config_route_v3_RateLimit_Action_RequestHeaders envoy_config_route_v3_RateLimit_Action_RequestHeaders;
-typedef struct envoy_config_route_v3_RateLimit_Action_RemoteAddress envoy_config_route_v3_RateLimit_Action_RemoteAddress;
-typedef struct envoy_config_route_v3_RateLimit_Action_GenericKey envoy_config_route_v3_RateLimit_Action_GenericKey;
-typedef struct envoy_config_route_v3_RateLimit_Action_HeaderValueMatch envoy_config_route_v3_RateLimit_Action_HeaderValueMatch;
-typedef struct envoy_config_route_v3_RateLimit_Action_DynamicMetaData envoy_config_route_v3_RateLimit_Action_DynamicMetaData;
-typedef struct envoy_config_route_v3_RateLimit_Override envoy_config_route_v3_RateLimit_Override;
-typedef struct envoy_config_route_v3_RateLimit_Override_DynamicMetadata envoy_config_route_v3_RateLimit_Override_DynamicMetadata;
-typedef struct envoy_config_route_v3_HeaderMatcher envoy_config_route_v3_HeaderMatcher;
-typedef struct envoy_config_route_v3_QueryParameterMatcher envoy_config_route_v3_QueryParameterMatcher;
-typedef struct envoy_config_route_v3_InternalRedirectPolicy envoy_config_route_v3_InternalRedirectPolicy;
-extern const upb_msglayout envoy_config_route_v3_VirtualHost_msginit;
-extern const upb_msglayout envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry_msginit;
-extern const upb_msglayout envoy_config_route_v3_FilterAction_msginit;
-extern const upb_msglayout envoy_config_route_v3_Route_msginit;
-extern const upb_msglayout envoy_config_route_v3_Route_TypedPerFilterConfigEntry_msginit;
-extern const upb_msglayout envoy_config_route_v3_WeightedCluster_msginit;
-extern const upb_msglayout envoy_config_route_v3_WeightedCluster_ClusterWeight_msginit;
-extern const upb_msglayout envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry_msginit;
-extern const upb_msglayout envoy_config_route_v3_RouteMatch_msginit;
-extern const upb_msglayout envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions_msginit;
-extern const upb_msglayout envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_msginit;
-extern const upb_msglayout envoy_config_route_v3_RouteMatch_ConnectMatcher_msginit;
-extern const upb_msglayout envoy_config_route_v3_CorsPolicy_msginit;
-extern const upb_msglayout envoy_config_route_v3_RouteAction_msginit;
-extern const upb_msglayout envoy_config_route_v3_RouteAction_RequestMirrorPolicy_msginit;
-extern const upb_msglayout envoy_config_route_v3_RouteAction_HashPolicy_msginit;
-extern const upb_msglayout envoy_config_route_v3_RouteAction_HashPolicy_Header_msginit;
-extern const upb_msglayout envoy_config_route_v3_RouteAction_HashPolicy_Cookie_msginit;
-extern const upb_msglayout envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_msginit;
-extern const upb_msglayout envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_msginit;
-extern const upb_msglayout envoy_config_route_v3_RouteAction_HashPolicy_FilterState_msginit;
-extern const upb_msglayout envoy_config_route_v3_RouteAction_UpgradeConfig_msginit;
-extern const upb_msglayout envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_msginit;
-extern const upb_msglayout envoy_config_route_v3_RouteAction_MaxStreamDuration_msginit;
-extern const upb_msglayout envoy_config_route_v3_RetryPolicy_msginit;
-extern const upb_msglayout envoy_config_route_v3_RetryPolicy_RetryPriority_msginit;
-extern const upb_msglayout envoy_config_route_v3_RetryPolicy_RetryHostPredicate_msginit;
-extern const upb_msglayout envoy_config_route_v3_RetryPolicy_RetryBackOff_msginit;
-extern const upb_msglayout envoy_config_route_v3_RetryPolicy_ResetHeader_msginit;
-extern const upb_msglayout envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_msginit;
-extern const upb_msglayout envoy_config_route_v3_HedgePolicy_msginit;
-extern const upb_msglayout envoy_config_route_v3_RedirectAction_msginit;
-extern const upb_msglayout envoy_config_route_v3_DirectResponseAction_msginit;
-extern const upb_msglayout envoy_config_route_v3_Decorator_msginit;
-extern const upb_msglayout envoy_config_route_v3_Tracing_msginit;
-extern const upb_msglayout envoy_config_route_v3_VirtualCluster_msginit;
-extern const upb_msglayout envoy_config_route_v3_RateLimit_msginit;
-extern const upb_msglayout envoy_config_route_v3_RateLimit_Action_msginit;
-extern const upb_msglayout envoy_config_route_v3_RateLimit_Action_SourceCluster_msginit;
-extern const upb_msglayout envoy_config_route_v3_RateLimit_Action_DestinationCluster_msginit;
-extern const upb_msglayout envoy_config_route_v3_RateLimit_Action_RequestHeaders_msginit;
-extern const upb_msglayout envoy_config_route_v3_RateLimit_Action_RemoteAddress_msginit;
-extern const upb_msglayout envoy_config_route_v3_RateLimit_Action_GenericKey_msginit;
-extern const upb_msglayout envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_msginit;
-extern const upb_msglayout envoy_config_route_v3_RateLimit_Action_DynamicMetaData_msginit;
-extern const upb_msglayout envoy_config_route_v3_RateLimit_Override_msginit;
-extern const upb_msglayout envoy_config_route_v3_RateLimit_Override_DynamicMetadata_msginit;
-extern const upb_msglayout envoy_config_route_v3_HeaderMatcher_msginit;
-extern const upb_msglayout envoy_config_route_v3_QueryParameterMatcher_msginit;
-extern const upb_msglayout envoy_config_route_v3_InternalRedirectPolicy_msginit;
-struct envoy_config_core_v3_DataSource;
-struct envoy_config_core_v3_HeaderValueOption;
-struct envoy_config_core_v3_Metadata;
-struct envoy_config_core_v3_ProxyProtocolConfig;
-struct envoy_config_core_v3_RuntimeFractionalPercent;
-struct envoy_config_core_v3_TypedExtensionConfig;
-struct envoy_type_matcher_v3_RegexMatchAndSubstitute;
-struct envoy_type_matcher_v3_RegexMatcher;
-struct envoy_type_matcher_v3_StringMatcher;
-struct envoy_type_metadata_v3_MetadataKey;
-struct envoy_type_tracing_v3_CustomTag;
-struct envoy_type_v3_FractionalPercent;
-struct envoy_type_v3_Int64Range;
-struct google_protobuf_Any;
-struct google_protobuf_BoolValue;
-struct google_protobuf_Duration;
-struct google_protobuf_UInt32Value;
-extern const upb_msglayout envoy_config_core_v3_DataSource_msginit;
-extern const upb_msglayout envoy_config_core_v3_HeaderValueOption_msginit;
-extern const upb_msglayout envoy_config_core_v3_Metadata_msginit;
-extern const upb_msglayout envoy_config_core_v3_ProxyProtocolConfig_msginit;
-extern const upb_msglayout envoy_config_core_v3_RuntimeFractionalPercent_msginit;
-extern const upb_msglayout envoy_config_core_v3_TypedExtensionConfig_msginit;
-extern const upb_msglayout envoy_type_matcher_v3_RegexMatchAndSubstitute_msginit;
-extern const upb_msglayout envoy_type_matcher_v3_RegexMatcher_msginit;
-extern const upb_msglayout envoy_type_matcher_v3_StringMatcher_msginit;
-extern const upb_msglayout envoy_type_metadata_v3_MetadataKey_msginit;
-extern const upb_msglayout envoy_type_tracing_v3_CustomTag_msginit;
-extern const upb_msglayout envoy_type_v3_FractionalPercent_msginit;
-extern const upb_msglayout envoy_type_v3_Int64Range_msginit;
-extern const upb_msglayout google_protobuf_Any_msginit;
-extern const upb_msglayout google_protobuf_BoolValue_msginit;
-extern const upb_msglayout google_protobuf_Duration_msginit;
-extern const upb_msglayout google_protobuf_UInt32Value_msginit;
-
-typedef enum {
- envoy_config_route_v3_RedirectAction_MOVED_PERMANENTLY = 0,
- envoy_config_route_v3_RedirectAction_FOUND = 1,
- envoy_config_route_v3_RedirectAction_SEE_OTHER = 2,
- envoy_config_route_v3_RedirectAction_TEMPORARY_REDIRECT = 3,
- envoy_config_route_v3_RedirectAction_PERMANENT_REDIRECT = 4
-} envoy_config_route_v3_RedirectAction_RedirectResponseCode;
-
-typedef enum {
- envoy_config_route_v3_RetryPolicy_SECONDS = 0,
- envoy_config_route_v3_RetryPolicy_UNIX_TIMESTAMP = 1
-} envoy_config_route_v3_RetryPolicy_ResetHeaderFormat;
-
-typedef enum {
- envoy_config_route_v3_RouteAction_SERVICE_UNAVAILABLE = 0,
- envoy_config_route_v3_RouteAction_NOT_FOUND = 1
-} envoy_config_route_v3_RouteAction_ClusterNotFoundResponseCode;
-
-typedef enum {
- envoy_config_route_v3_RouteAction_PASS_THROUGH_INTERNAL_REDIRECT = 0,
- envoy_config_route_v3_RouteAction_HANDLE_INTERNAL_REDIRECT = 1
-} envoy_config_route_v3_RouteAction_InternalRedirectAction;
-
-typedef enum {
- envoy_config_route_v3_VirtualHost_NONE = 0,
- envoy_config_route_v3_VirtualHost_EXTERNAL_ONLY = 1,
- envoy_config_route_v3_VirtualHost_ALL = 2
-} envoy_config_route_v3_VirtualHost_TlsRequirementType;
-
-
-/* envoy.config.route.v3.VirtualHost */
-
-UPB_INLINE envoy_config_route_v3_VirtualHost *envoy_config_route_v3_VirtualHost_new(upb_arena *arena) {
- return (envoy_config_route_v3_VirtualHost *)_upb_msg_new(&envoy_config_route_v3_VirtualHost_msginit, arena);
-}
-UPB_INLINE envoy_config_route_v3_VirtualHost *envoy_config_route_v3_VirtualHost_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_route_v3_VirtualHost *ret = envoy_config_route_v3_VirtualHost_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_VirtualHost_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_route_v3_VirtualHost_serialize(const envoy_config_route_v3_VirtualHost *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_route_v3_VirtualHost_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview envoy_config_route_v3_VirtualHost_name(const envoy_config_route_v3_VirtualHost *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 16), upb_strview); }
-UPB_INLINE upb_strview const* envoy_config_route_v3_VirtualHost_domains(const envoy_config_route_v3_VirtualHost *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(40, 72), len); }
-UPB_INLINE bool envoy_config_route_v3_VirtualHost_has_routes(const envoy_config_route_v3_VirtualHost *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(44, 80)); }
-UPB_INLINE const envoy_config_route_v3_Route* const* envoy_config_route_v3_VirtualHost_routes(const envoy_config_route_v3_VirtualHost *msg, size_t *len) { return (const envoy_config_route_v3_Route* const*)_upb_array_accessor(msg, UPB_SIZE(44, 80), len); }
-UPB_INLINE int32_t envoy_config_route_v3_VirtualHost_require_tls(const envoy_config_route_v3_VirtualHost *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
-UPB_INLINE bool envoy_config_route_v3_VirtualHost_has_virtual_clusters(const envoy_config_route_v3_VirtualHost *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(48, 88)); }
-UPB_INLINE const envoy_config_route_v3_VirtualCluster* const* envoy_config_route_v3_VirtualHost_virtual_clusters(const envoy_config_route_v3_VirtualHost *msg, size_t *len) { return (const envoy_config_route_v3_VirtualCluster* const*)_upb_array_accessor(msg, UPB_SIZE(48, 88), len); }
-UPB_INLINE bool envoy_config_route_v3_VirtualHost_has_rate_limits(const envoy_config_route_v3_VirtualHost *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(52, 96)); }
-UPB_INLINE const envoy_config_route_v3_RateLimit* const* envoy_config_route_v3_VirtualHost_rate_limits(const envoy_config_route_v3_VirtualHost *msg, size_t *len) { return (const envoy_config_route_v3_RateLimit* const*)_upb_array_accessor(msg, UPB_SIZE(52, 96), len); }
-UPB_INLINE bool envoy_config_route_v3_VirtualHost_has_request_headers_to_add(const envoy_config_route_v3_VirtualHost *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(56, 104)); }
-UPB_INLINE const struct envoy_config_core_v3_HeaderValueOption* const* envoy_config_route_v3_VirtualHost_request_headers_to_add(const envoy_config_route_v3_VirtualHost *msg, size_t *len) { return (const struct envoy_config_core_v3_HeaderValueOption* const*)_upb_array_accessor(msg, UPB_SIZE(56, 104), len); }
-UPB_INLINE bool envoy_config_route_v3_VirtualHost_has_cors(const envoy_config_route_v3_VirtualHost *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 32)); }
-UPB_INLINE const envoy_config_route_v3_CorsPolicy* envoy_config_route_v3_VirtualHost_cors(const envoy_config_route_v3_VirtualHost *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const envoy_config_route_v3_CorsPolicy*); }
-UPB_INLINE bool envoy_config_route_v3_VirtualHost_has_response_headers_to_add(const envoy_config_route_v3_VirtualHost *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(60, 112)); }
-UPB_INLINE const struct envoy_config_core_v3_HeaderValueOption* const* envoy_config_route_v3_VirtualHost_response_headers_to_add(const envoy_config_route_v3_VirtualHost *msg, size_t *len) { return (const struct envoy_config_core_v3_HeaderValueOption* const*)_upb_array_accessor(msg, UPB_SIZE(60, 112), len); }
-UPB_INLINE upb_strview const* envoy_config_route_v3_VirtualHost_response_headers_to_remove(const envoy_config_route_v3_VirtualHost *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(64, 120), len); }
-UPB_INLINE upb_strview const* envoy_config_route_v3_VirtualHost_request_headers_to_remove(const envoy_config_route_v3_VirtualHost *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(68, 128), len); }
-UPB_INLINE bool envoy_config_route_v3_VirtualHost_include_request_attempt_count(const envoy_config_route_v3_VirtualHost *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool); }
-UPB_INLINE bool envoy_config_route_v3_VirtualHost_has_typed_per_filter_config(const envoy_config_route_v3_VirtualHost *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(72, 136)); }
-UPB_INLINE size_t envoy_config_route_v3_VirtualHost_typed_per_filter_config_size(const envoy_config_route_v3_VirtualHost *msg) {return _upb_msg_map_size(msg, UPB_SIZE(72, 136)); }
-UPB_INLINE bool envoy_config_route_v3_VirtualHost_typed_per_filter_config_get(const envoy_config_route_v3_VirtualHost *msg, upb_strview key, struct google_protobuf_Any* *val) { return _upb_msg_map_get(msg, UPB_SIZE(72, 136), &key, 0, val, sizeof(*val)); }
-UPB_INLINE const envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry* envoy_config_route_v3_VirtualHost_typed_per_filter_config_next(const envoy_config_route_v3_VirtualHost *msg, size_t* iter) { return (const envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry*)_upb_msg_map_next(msg, UPB_SIZE(72, 136), iter); }
-UPB_INLINE bool envoy_config_route_v3_VirtualHost_has_retry_policy(const envoy_config_route_v3_VirtualHost *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 40)); }
-UPB_INLINE const envoy_config_route_v3_RetryPolicy* envoy_config_route_v3_VirtualHost_retry_policy(const envoy_config_route_v3_VirtualHost *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const envoy_config_route_v3_RetryPolicy*); }
-UPB_INLINE bool envoy_config_route_v3_VirtualHost_has_hedge_policy(const envoy_config_route_v3_VirtualHost *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 48)); }
-UPB_INLINE const envoy_config_route_v3_HedgePolicy* envoy_config_route_v3_VirtualHost_hedge_policy(const envoy_config_route_v3_VirtualHost *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 48), const envoy_config_route_v3_HedgePolicy*); }
-UPB_INLINE bool envoy_config_route_v3_VirtualHost_has_per_request_buffer_limit_bytes(const envoy_config_route_v3_VirtualHost *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(32, 56)); }
-UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_route_v3_VirtualHost_per_request_buffer_limit_bytes(const envoy_config_route_v3_VirtualHost *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 56), const struct google_protobuf_UInt32Value*); }
-UPB_INLINE bool envoy_config_route_v3_VirtualHost_include_attempt_count_in_response(const envoy_config_route_v3_VirtualHost *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(9, 9), bool); }
-UPB_INLINE bool envoy_config_route_v3_VirtualHost_has_retry_policy_typed_config(const envoy_config_route_v3_VirtualHost *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(36, 64)); }
-UPB_INLINE const struct google_protobuf_Any* envoy_config_route_v3_VirtualHost_retry_policy_typed_config(const envoy_config_route_v3_VirtualHost *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(36, 64), const struct google_protobuf_Any*); }
-
-UPB_INLINE void envoy_config_route_v3_VirtualHost_set_name(envoy_config_route_v3_VirtualHost *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(12, 16), upb_strview) = value;
-}
-UPB_INLINE upb_strview* envoy_config_route_v3_VirtualHost_mutable_domains(envoy_config_route_v3_VirtualHost *msg, size_t *len) {
- return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(40, 72), len);
-}
-UPB_INLINE upb_strview* envoy_config_route_v3_VirtualHost_resize_domains(envoy_config_route_v3_VirtualHost *msg, size_t len, upb_arena *arena) {
- return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(40, 72), len, UPB_TYPE_STRING, arena);
-}
-UPB_INLINE bool envoy_config_route_v3_VirtualHost_add_domains(envoy_config_route_v3_VirtualHost *msg, upb_strview val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(40, 72), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
- arena);
-}
-UPB_INLINE envoy_config_route_v3_Route** envoy_config_route_v3_VirtualHost_mutable_routes(envoy_config_route_v3_VirtualHost *msg, size_t *len) {
- return (envoy_config_route_v3_Route**)_upb_array_mutable_accessor(msg, UPB_SIZE(44, 80), len);
-}
-UPB_INLINE envoy_config_route_v3_Route** envoy_config_route_v3_VirtualHost_resize_routes(envoy_config_route_v3_VirtualHost *msg, size_t len, upb_arena *arena) {
- return (envoy_config_route_v3_Route**)_upb_array_resize_accessor(msg, UPB_SIZE(44, 80), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_config_route_v3_Route* envoy_config_route_v3_VirtualHost_add_routes(envoy_config_route_v3_VirtualHost *msg, upb_arena *arena) {
- struct envoy_config_route_v3_Route* sub = (struct envoy_config_route_v3_Route*)_upb_msg_new(&envoy_config_route_v3_Route_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(44, 80), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-UPB_INLINE void envoy_config_route_v3_VirtualHost_set_require_tls(envoy_config_route_v3_VirtualHost *msg, int32_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
-}
-UPB_INLINE envoy_config_route_v3_VirtualCluster** envoy_config_route_v3_VirtualHost_mutable_virtual_clusters(envoy_config_route_v3_VirtualHost *msg, size_t *len) {
- return (envoy_config_route_v3_VirtualCluster**)_upb_array_mutable_accessor(msg, UPB_SIZE(48, 88), len);
-}
-UPB_INLINE envoy_config_route_v3_VirtualCluster** envoy_config_route_v3_VirtualHost_resize_virtual_clusters(envoy_config_route_v3_VirtualHost *msg, size_t len, upb_arena *arena) {
- return (envoy_config_route_v3_VirtualCluster**)_upb_array_resize_accessor(msg, UPB_SIZE(48, 88), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_config_route_v3_VirtualCluster* envoy_config_route_v3_VirtualHost_add_virtual_clusters(envoy_config_route_v3_VirtualHost *msg, upb_arena *arena) {
- struct envoy_config_route_v3_VirtualCluster* sub = (struct envoy_config_route_v3_VirtualCluster*)_upb_msg_new(&envoy_config_route_v3_VirtualCluster_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(48, 88), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-UPB_INLINE envoy_config_route_v3_RateLimit** envoy_config_route_v3_VirtualHost_mutable_rate_limits(envoy_config_route_v3_VirtualHost *msg, size_t *len) {
- return (envoy_config_route_v3_RateLimit**)_upb_array_mutable_accessor(msg, UPB_SIZE(52, 96), len);
-}
-UPB_INLINE envoy_config_route_v3_RateLimit** envoy_config_route_v3_VirtualHost_resize_rate_limits(envoy_config_route_v3_VirtualHost *msg, size_t len, upb_arena *arena) {
- return (envoy_config_route_v3_RateLimit**)_upb_array_resize_accessor(msg, UPB_SIZE(52, 96), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_config_route_v3_RateLimit* envoy_config_route_v3_VirtualHost_add_rate_limits(envoy_config_route_v3_VirtualHost *msg, upb_arena *arena) {
- struct envoy_config_route_v3_RateLimit* sub = (struct envoy_config_route_v3_RateLimit*)_upb_msg_new(&envoy_config_route_v3_RateLimit_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(52, 96), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_config_route_v3_VirtualHost_mutable_request_headers_to_add(envoy_config_route_v3_VirtualHost *msg, size_t *len) {
- return (struct envoy_config_core_v3_HeaderValueOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(56, 104), len);
-}
-UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_config_route_v3_VirtualHost_resize_request_headers_to_add(envoy_config_route_v3_VirtualHost *msg, size_t len, upb_arena *arena) {
- return (struct envoy_config_core_v3_HeaderValueOption**)_upb_array_resize_accessor(msg, UPB_SIZE(56, 104), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_config_core_v3_HeaderValueOption* envoy_config_route_v3_VirtualHost_add_request_headers_to_add(envoy_config_route_v3_VirtualHost *msg, upb_arena *arena) {
- struct envoy_config_core_v3_HeaderValueOption* sub = (struct envoy_config_core_v3_HeaderValueOption*)_upb_msg_new(&envoy_config_core_v3_HeaderValueOption_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(56, 104), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-UPB_INLINE void envoy_config_route_v3_VirtualHost_set_cors(envoy_config_route_v3_VirtualHost *msg, envoy_config_route_v3_CorsPolicy* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(20, 32), envoy_config_route_v3_CorsPolicy*) = value;
-}
-UPB_INLINE struct envoy_config_route_v3_CorsPolicy* envoy_config_route_v3_VirtualHost_mutable_cors(envoy_config_route_v3_VirtualHost *msg, upb_arena *arena) {
- struct envoy_config_route_v3_CorsPolicy* sub = (struct envoy_config_route_v3_CorsPolicy*)envoy_config_route_v3_VirtualHost_cors(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_route_v3_CorsPolicy*)_upb_msg_new(&envoy_config_route_v3_CorsPolicy_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_VirtualHost_set_cors(msg, sub);
- }
- return sub;
-}
-UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_config_route_v3_VirtualHost_mutable_response_headers_to_add(envoy_config_route_v3_VirtualHost *msg, size_t *len) {
- return (struct envoy_config_core_v3_HeaderValueOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(60, 112), len);
-}
-UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_config_route_v3_VirtualHost_resize_response_headers_to_add(envoy_config_route_v3_VirtualHost *msg, size_t len, upb_arena *arena) {
- return (struct envoy_config_core_v3_HeaderValueOption**)_upb_array_resize_accessor(msg, UPB_SIZE(60, 112), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_config_core_v3_HeaderValueOption* envoy_config_route_v3_VirtualHost_add_response_headers_to_add(envoy_config_route_v3_VirtualHost *msg, upb_arena *arena) {
- struct envoy_config_core_v3_HeaderValueOption* sub = (struct envoy_config_core_v3_HeaderValueOption*)_upb_msg_new(&envoy_config_core_v3_HeaderValueOption_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(60, 112), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-UPB_INLINE upb_strview* envoy_config_route_v3_VirtualHost_mutable_response_headers_to_remove(envoy_config_route_v3_VirtualHost *msg, size_t *len) {
- return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(64, 120), len);
-}
-UPB_INLINE upb_strview* envoy_config_route_v3_VirtualHost_resize_response_headers_to_remove(envoy_config_route_v3_VirtualHost *msg, size_t len, upb_arena *arena) {
- return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(64, 120), len, UPB_TYPE_STRING, arena);
-}
-UPB_INLINE bool envoy_config_route_v3_VirtualHost_add_response_headers_to_remove(envoy_config_route_v3_VirtualHost *msg, upb_strview val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(64, 120), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
- arena);
-}
-UPB_INLINE upb_strview* envoy_config_route_v3_VirtualHost_mutable_request_headers_to_remove(envoy_config_route_v3_VirtualHost *msg, size_t *len) {
- return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(68, 128), len);
-}
-UPB_INLINE upb_strview* envoy_config_route_v3_VirtualHost_resize_request_headers_to_remove(envoy_config_route_v3_VirtualHost *msg, size_t len, upb_arena *arena) {
- return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(68, 128), len, UPB_TYPE_STRING, arena);
-}
-UPB_INLINE bool envoy_config_route_v3_VirtualHost_add_request_headers_to_remove(envoy_config_route_v3_VirtualHost *msg, upb_strview val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(68, 128), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
- arena);
-}
-UPB_INLINE void envoy_config_route_v3_VirtualHost_set_include_request_attempt_count(envoy_config_route_v3_VirtualHost *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = value;
-}
-UPB_INLINE void envoy_config_route_v3_VirtualHost_typed_per_filter_config_clear(envoy_config_route_v3_VirtualHost *msg) { _upb_msg_map_clear(msg, UPB_SIZE(72, 136)); }
-UPB_INLINE bool envoy_config_route_v3_VirtualHost_typed_per_filter_config_set(envoy_config_route_v3_VirtualHost *msg, upb_strview key, struct google_protobuf_Any* val, upb_arena *a) { return _upb_msg_map_set(msg, UPB_SIZE(72, 136), &key, 0, &val, sizeof(val), a); }
-UPB_INLINE bool envoy_config_route_v3_VirtualHost_typed_per_filter_config_delete(envoy_config_route_v3_VirtualHost *msg, upb_strview key) { return _upb_msg_map_delete(msg, UPB_SIZE(72, 136), &key, 0); }
-UPB_INLINE envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry* envoy_config_route_v3_VirtualHost_typed_per_filter_config_nextmutable(envoy_config_route_v3_VirtualHost *msg, size_t* iter) { return (envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry*)_upb_msg_map_next(msg, UPB_SIZE(72, 136), iter); }
-UPB_INLINE void envoy_config_route_v3_VirtualHost_set_retry_policy(envoy_config_route_v3_VirtualHost *msg, envoy_config_route_v3_RetryPolicy* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(24, 40), envoy_config_route_v3_RetryPolicy*) = value;
-}
-UPB_INLINE struct envoy_config_route_v3_RetryPolicy* envoy_config_route_v3_VirtualHost_mutable_retry_policy(envoy_config_route_v3_VirtualHost *msg, upb_arena *arena) {
- struct envoy_config_route_v3_RetryPolicy* sub = (struct envoy_config_route_v3_RetryPolicy*)envoy_config_route_v3_VirtualHost_retry_policy(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_route_v3_RetryPolicy*)_upb_msg_new(&envoy_config_route_v3_RetryPolicy_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_VirtualHost_set_retry_policy(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_route_v3_VirtualHost_set_hedge_policy(envoy_config_route_v3_VirtualHost *msg, envoy_config_route_v3_HedgePolicy* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(28, 48), envoy_config_route_v3_HedgePolicy*) = value;
-}
-UPB_INLINE struct envoy_config_route_v3_HedgePolicy* envoy_config_route_v3_VirtualHost_mutable_hedge_policy(envoy_config_route_v3_VirtualHost *msg, upb_arena *arena) {
- struct envoy_config_route_v3_HedgePolicy* sub = (struct envoy_config_route_v3_HedgePolicy*)envoy_config_route_v3_VirtualHost_hedge_policy(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_route_v3_HedgePolicy*)_upb_msg_new(&envoy_config_route_v3_HedgePolicy_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_VirtualHost_set_hedge_policy(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_route_v3_VirtualHost_set_per_request_buffer_limit_bytes(envoy_config_route_v3_VirtualHost *msg, struct google_protobuf_UInt32Value* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(32, 56), struct google_protobuf_UInt32Value*) = value;
-}
-UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_route_v3_VirtualHost_mutable_per_request_buffer_limit_bytes(envoy_config_route_v3_VirtualHost *msg, upb_arena *arena) {
- struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_route_v3_VirtualHost_per_request_buffer_limit_bytes(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_VirtualHost_set_per_request_buffer_limit_bytes(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_route_v3_VirtualHost_set_include_attempt_count_in_response(envoy_config_route_v3_VirtualHost *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(9, 9), bool) = value;
-}
-UPB_INLINE void envoy_config_route_v3_VirtualHost_set_retry_policy_typed_config(envoy_config_route_v3_VirtualHost *msg, struct google_protobuf_Any* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(36, 64), struct google_protobuf_Any*) = value;
-}
-UPB_INLINE struct google_protobuf_Any* envoy_config_route_v3_VirtualHost_mutable_retry_policy_typed_config(envoy_config_route_v3_VirtualHost *msg, upb_arena *arena) {
- struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_config_route_v3_VirtualHost_retry_policy_typed_config(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_VirtualHost_set_retry_policy_typed_config(msg, sub);
- }
- return sub;
-}
-
-/* envoy.config.route.v3.VirtualHost.TypedPerFilterConfigEntry */
-
-UPB_INLINE upb_strview envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry_key(const envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry *msg) {
- upb_strview ret;
- _upb_msg_map_key(msg, &ret, 0);
- return ret;
-}
-UPB_INLINE bool envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry_has_value(const envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const struct google_protobuf_Any* envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry_value(const envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry *msg) {
- struct google_protobuf_Any* ret;
- _upb_msg_map_value(msg, &ret, sizeof(ret));
- return ret;
-}
-
-UPB_INLINE void envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry_set_value(envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry *msg, struct google_protobuf_Any* value) {
- _upb_msg_map_set_value(msg, &value, sizeof(struct google_protobuf_Any*));
-}
-
-/* envoy.config.route.v3.FilterAction */
-
-UPB_INLINE envoy_config_route_v3_FilterAction *envoy_config_route_v3_FilterAction_new(upb_arena *arena) {
- return (envoy_config_route_v3_FilterAction *)_upb_msg_new(&envoy_config_route_v3_FilterAction_msginit, arena);
-}
-UPB_INLINE envoy_config_route_v3_FilterAction *envoy_config_route_v3_FilterAction_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_route_v3_FilterAction *ret = envoy_config_route_v3_FilterAction_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_FilterAction_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_route_v3_FilterAction_serialize(const envoy_config_route_v3_FilterAction *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_route_v3_FilterAction_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_config_route_v3_FilterAction_has_action(const envoy_config_route_v3_FilterAction *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE const struct google_protobuf_Any* envoy_config_route_v3_FilterAction_action(const envoy_config_route_v3_FilterAction *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct google_protobuf_Any*); }
-
-UPB_INLINE void envoy_config_route_v3_FilterAction_set_action(envoy_config_route_v3_FilterAction *msg, struct google_protobuf_Any* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct google_protobuf_Any*) = value;
-}
-UPB_INLINE struct google_protobuf_Any* envoy_config_route_v3_FilterAction_mutable_action(envoy_config_route_v3_FilterAction *msg, upb_arena *arena) {
- struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_config_route_v3_FilterAction_action(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_FilterAction_set_action(msg, sub);
- }
- return sub;
-}
-
-/* envoy.config.route.v3.Route */
-
-UPB_INLINE envoy_config_route_v3_Route *envoy_config_route_v3_Route_new(upb_arena *arena) {
- return (envoy_config_route_v3_Route *)_upb_msg_new(&envoy_config_route_v3_Route_msginit, arena);
-}
-UPB_INLINE envoy_config_route_v3_Route *envoy_config_route_v3_Route_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_route_v3_Route *ret = envoy_config_route_v3_Route_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_Route_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_route_v3_Route_serialize(const envoy_config_route_v3_Route *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_route_v3_Route_msginit, arena, len);
-}
-
-typedef enum {
- envoy_config_route_v3_Route_action_route = 2,
- envoy_config_route_v3_Route_action_redirect = 3,
- envoy_config_route_v3_Route_action_direct_response = 7,
- envoy_config_route_v3_Route_action_filter_action = 17,
- envoy_config_route_v3_Route_action_NOT_SET = 0
-} envoy_config_route_v3_Route_action_oneofcases;
-UPB_INLINE envoy_config_route_v3_Route_action_oneofcases envoy_config_route_v3_Route_action_case(const envoy_config_route_v3_Route* msg) { return (envoy_config_route_v3_Route_action_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(52, 104), int32_t); }
-
-UPB_INLINE bool envoy_config_route_v3_Route_has_match(const envoy_config_route_v3_Route *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const envoy_config_route_v3_RouteMatch* envoy_config_route_v3_Route_match(const envoy_config_route_v3_Route *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const envoy_config_route_v3_RouteMatch*); }
-UPB_INLINE bool envoy_config_route_v3_Route_has_route(const envoy_config_route_v3_Route *msg) { return _upb_getoneofcase(msg, UPB_SIZE(52, 104)) == 2; }
-UPB_INLINE const envoy_config_route_v3_RouteAction* envoy_config_route_v3_Route_route(const envoy_config_route_v3_Route *msg) { return UPB_READ_ONEOF(msg, const envoy_config_route_v3_RouteAction*, UPB_SIZE(48, 96), UPB_SIZE(52, 104), 2, NULL); }
-UPB_INLINE bool envoy_config_route_v3_Route_has_redirect(const envoy_config_route_v3_Route *msg) { return _upb_getoneofcase(msg, UPB_SIZE(52, 104)) == 3; }
-UPB_INLINE const envoy_config_route_v3_RedirectAction* envoy_config_route_v3_Route_redirect(const envoy_config_route_v3_Route *msg) { return UPB_READ_ONEOF(msg, const envoy_config_route_v3_RedirectAction*, UPB_SIZE(48, 96), UPB_SIZE(52, 104), 3, NULL); }
-UPB_INLINE bool envoy_config_route_v3_Route_has_metadata(const envoy_config_route_v3_Route *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
-UPB_INLINE const struct envoy_config_core_v3_Metadata* envoy_config_route_v3_Route_metadata(const envoy_config_route_v3_Route *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct envoy_config_core_v3_Metadata*); }
-UPB_INLINE bool envoy_config_route_v3_Route_has_decorator(const envoy_config_route_v3_Route *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); }
-UPB_INLINE const envoy_config_route_v3_Decorator* envoy_config_route_v3_Route_decorator(const envoy_config_route_v3_Route *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const envoy_config_route_v3_Decorator*); }
-UPB_INLINE bool envoy_config_route_v3_Route_has_direct_response(const envoy_config_route_v3_Route *msg) { return _upb_getoneofcase(msg, UPB_SIZE(52, 104)) == 7; }
-UPB_INLINE const envoy_config_route_v3_DirectResponseAction* envoy_config_route_v3_Route_direct_response(const envoy_config_route_v3_Route *msg) { return UPB_READ_ONEOF(msg, const envoy_config_route_v3_DirectResponseAction*, UPB_SIZE(48, 96), UPB_SIZE(52, 104), 7, NULL); }
-UPB_INLINE bool envoy_config_route_v3_Route_has_request_headers_to_add(const envoy_config_route_v3_Route *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 56)); }
-UPB_INLINE const struct envoy_config_core_v3_HeaderValueOption* const* envoy_config_route_v3_Route_request_headers_to_add(const envoy_config_route_v3_Route *msg, size_t *len) { return (const struct envoy_config_core_v3_HeaderValueOption* const*)_upb_array_accessor(msg, UPB_SIZE(28, 56), len); }
-UPB_INLINE bool envoy_config_route_v3_Route_has_response_headers_to_add(const envoy_config_route_v3_Route *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(32, 64)); }
-UPB_INLINE const struct envoy_config_core_v3_HeaderValueOption* const* envoy_config_route_v3_Route_response_headers_to_add(const envoy_config_route_v3_Route *msg, size_t *len) { return (const struct envoy_config_core_v3_HeaderValueOption* const*)_upb_array_accessor(msg, UPB_SIZE(32, 64), len); }
-UPB_INLINE upb_strview const* envoy_config_route_v3_Route_response_headers_to_remove(const envoy_config_route_v3_Route *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(36, 72), len); }
-UPB_INLINE upb_strview const* envoy_config_route_v3_Route_request_headers_to_remove(const envoy_config_route_v3_Route *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(40, 80), len); }
-UPB_INLINE bool envoy_config_route_v3_Route_has_typed_per_filter_config(const envoy_config_route_v3_Route *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(44, 88)); }
-UPB_INLINE size_t envoy_config_route_v3_Route_typed_per_filter_config_size(const envoy_config_route_v3_Route *msg) {return _upb_msg_map_size(msg, UPB_SIZE(44, 88)); }
-UPB_INLINE bool envoy_config_route_v3_Route_typed_per_filter_config_get(const envoy_config_route_v3_Route *msg, upb_strview key, struct google_protobuf_Any* *val) { return _upb_msg_map_get(msg, UPB_SIZE(44, 88), &key, 0, val, sizeof(*val)); }
-UPB_INLINE const envoy_config_route_v3_Route_TypedPerFilterConfigEntry* envoy_config_route_v3_Route_typed_per_filter_config_next(const envoy_config_route_v3_Route *msg, size_t* iter) { return (const envoy_config_route_v3_Route_TypedPerFilterConfigEntry*)_upb_msg_map_next(msg, UPB_SIZE(44, 88), iter); }
-UPB_INLINE upb_strview envoy_config_route_v3_Route_name(const envoy_config_route_v3_Route *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE bool envoy_config_route_v3_Route_has_tracing(const envoy_config_route_v3_Route *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 40)); }
-UPB_INLINE const envoy_config_route_v3_Tracing* envoy_config_route_v3_Route_tracing(const envoy_config_route_v3_Route *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const envoy_config_route_v3_Tracing*); }
-UPB_INLINE bool envoy_config_route_v3_Route_has_per_request_buffer_limit_bytes(const envoy_config_route_v3_Route *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 48)); }
-UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_route_v3_Route_per_request_buffer_limit_bytes(const envoy_config_route_v3_Route *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 48), const struct google_protobuf_UInt32Value*); }
-UPB_INLINE bool envoy_config_route_v3_Route_has_filter_action(const envoy_config_route_v3_Route *msg) { return _upb_getoneofcase(msg, UPB_SIZE(52, 104)) == 17; }
-UPB_INLINE const envoy_config_route_v3_FilterAction* envoy_config_route_v3_Route_filter_action(const envoy_config_route_v3_Route *msg) { return UPB_READ_ONEOF(msg, const envoy_config_route_v3_FilterAction*, UPB_SIZE(48, 96), UPB_SIZE(52, 104), 17, NULL); }
-
-UPB_INLINE void envoy_config_route_v3_Route_set_match(envoy_config_route_v3_Route *msg, envoy_config_route_v3_RouteMatch* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), envoy_config_route_v3_RouteMatch*) = value;
-}
-UPB_INLINE struct envoy_config_route_v3_RouteMatch* envoy_config_route_v3_Route_mutable_match(envoy_config_route_v3_Route *msg, upb_arena *arena) {
- struct envoy_config_route_v3_RouteMatch* sub = (struct envoy_config_route_v3_RouteMatch*)envoy_config_route_v3_Route_match(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_route_v3_RouteMatch*)_upb_msg_new(&envoy_config_route_v3_RouteMatch_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_Route_set_match(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_route_v3_Route_set_route(envoy_config_route_v3_Route *msg, envoy_config_route_v3_RouteAction* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RouteAction*, UPB_SIZE(48, 96), value, UPB_SIZE(52, 104), 2);
-}
-UPB_INLINE struct envoy_config_route_v3_RouteAction* envoy_config_route_v3_Route_mutable_route(envoy_config_route_v3_Route *msg, upb_arena *arena) {
- struct envoy_config_route_v3_RouteAction* sub = (struct envoy_config_route_v3_RouteAction*)envoy_config_route_v3_Route_route(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_route_v3_RouteAction*)_upb_msg_new(&envoy_config_route_v3_RouteAction_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_Route_set_route(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_route_v3_Route_set_redirect(envoy_config_route_v3_Route *msg, envoy_config_route_v3_RedirectAction* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RedirectAction*, UPB_SIZE(48, 96), value, UPB_SIZE(52, 104), 3);
-}
-UPB_INLINE struct envoy_config_route_v3_RedirectAction* envoy_config_route_v3_Route_mutable_redirect(envoy_config_route_v3_Route *msg, upb_arena *arena) {
- struct envoy_config_route_v3_RedirectAction* sub = (struct envoy_config_route_v3_RedirectAction*)envoy_config_route_v3_Route_redirect(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_route_v3_RedirectAction*)_upb_msg_new(&envoy_config_route_v3_RedirectAction_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_Route_set_redirect(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_route_v3_Route_set_metadata(envoy_config_route_v3_Route *msg, struct envoy_config_core_v3_Metadata* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct envoy_config_core_v3_Metadata*) = value;
-}
-UPB_INLINE struct envoy_config_core_v3_Metadata* envoy_config_route_v3_Route_mutable_metadata(envoy_config_route_v3_Route *msg, upb_arena *arena) {
- struct envoy_config_core_v3_Metadata* sub = (struct envoy_config_core_v3_Metadata*)envoy_config_route_v3_Route_metadata(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_Metadata*)_upb_msg_new(&envoy_config_core_v3_Metadata_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_Route_set_metadata(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_route_v3_Route_set_decorator(envoy_config_route_v3_Route *msg, envoy_config_route_v3_Decorator* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(16, 32), envoy_config_route_v3_Decorator*) = value;
-}
-UPB_INLINE struct envoy_config_route_v3_Decorator* envoy_config_route_v3_Route_mutable_decorator(envoy_config_route_v3_Route *msg, upb_arena *arena) {
- struct envoy_config_route_v3_Decorator* sub = (struct envoy_config_route_v3_Decorator*)envoy_config_route_v3_Route_decorator(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_route_v3_Decorator*)_upb_msg_new(&envoy_config_route_v3_Decorator_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_Route_set_decorator(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_route_v3_Route_set_direct_response(envoy_config_route_v3_Route *msg, envoy_config_route_v3_DirectResponseAction* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_route_v3_DirectResponseAction*, UPB_SIZE(48, 96), value, UPB_SIZE(52, 104), 7);
-}
-UPB_INLINE struct envoy_config_route_v3_DirectResponseAction* envoy_config_route_v3_Route_mutable_direct_response(envoy_config_route_v3_Route *msg, upb_arena *arena) {
- struct envoy_config_route_v3_DirectResponseAction* sub = (struct envoy_config_route_v3_DirectResponseAction*)envoy_config_route_v3_Route_direct_response(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_route_v3_DirectResponseAction*)_upb_msg_new(&envoy_config_route_v3_DirectResponseAction_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_Route_set_direct_response(msg, sub);
- }
- return sub;
-}
-UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_config_route_v3_Route_mutable_request_headers_to_add(envoy_config_route_v3_Route *msg, size_t *len) {
- return (struct envoy_config_core_v3_HeaderValueOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 56), len);
-}
-UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_config_route_v3_Route_resize_request_headers_to_add(envoy_config_route_v3_Route *msg, size_t len, upb_arena *arena) {
- return (struct envoy_config_core_v3_HeaderValueOption**)_upb_array_resize_accessor(msg, UPB_SIZE(28, 56), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_config_core_v3_HeaderValueOption* envoy_config_route_v3_Route_add_request_headers_to_add(envoy_config_route_v3_Route *msg, upb_arena *arena) {
- struct envoy_config_core_v3_HeaderValueOption* sub = (struct envoy_config_core_v3_HeaderValueOption*)_upb_msg_new(&envoy_config_core_v3_HeaderValueOption_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(28, 56), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_config_route_v3_Route_mutable_response_headers_to_add(envoy_config_route_v3_Route *msg, size_t *len) {
- return (struct envoy_config_core_v3_HeaderValueOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(32, 64), len);
-}
-UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_config_route_v3_Route_resize_response_headers_to_add(envoy_config_route_v3_Route *msg, size_t len, upb_arena *arena) {
- return (struct envoy_config_core_v3_HeaderValueOption**)_upb_array_resize_accessor(msg, UPB_SIZE(32, 64), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_config_core_v3_HeaderValueOption* envoy_config_route_v3_Route_add_response_headers_to_add(envoy_config_route_v3_Route *msg, upb_arena *arena) {
- struct envoy_config_core_v3_HeaderValueOption* sub = (struct envoy_config_core_v3_HeaderValueOption*)_upb_msg_new(&envoy_config_core_v3_HeaderValueOption_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(32, 64), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-UPB_INLINE upb_strview* envoy_config_route_v3_Route_mutable_response_headers_to_remove(envoy_config_route_v3_Route *msg, size_t *len) {
- return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(36, 72), len);
-}
-UPB_INLINE upb_strview* envoy_config_route_v3_Route_resize_response_headers_to_remove(envoy_config_route_v3_Route *msg, size_t len, upb_arena *arena) {
- return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(36, 72), len, UPB_TYPE_STRING, arena);
-}
-UPB_INLINE bool envoy_config_route_v3_Route_add_response_headers_to_remove(envoy_config_route_v3_Route *msg, upb_strview val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(36, 72), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
- arena);
-}
-UPB_INLINE upb_strview* envoy_config_route_v3_Route_mutable_request_headers_to_remove(envoy_config_route_v3_Route *msg, size_t *len) {
- return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(40, 80), len);
-}
-UPB_INLINE upb_strview* envoy_config_route_v3_Route_resize_request_headers_to_remove(envoy_config_route_v3_Route *msg, size_t len, upb_arena *arena) {
- return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(40, 80), len, UPB_TYPE_STRING, arena);
-}
-UPB_INLINE bool envoy_config_route_v3_Route_add_request_headers_to_remove(envoy_config_route_v3_Route *msg, upb_strview val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(40, 80), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
- arena);
-}
-UPB_INLINE void envoy_config_route_v3_Route_typed_per_filter_config_clear(envoy_config_route_v3_Route *msg) { _upb_msg_map_clear(msg, UPB_SIZE(44, 88)); }
-UPB_INLINE bool envoy_config_route_v3_Route_typed_per_filter_config_set(envoy_config_route_v3_Route *msg, upb_strview key, struct google_protobuf_Any* val, upb_arena *a) { return _upb_msg_map_set(msg, UPB_SIZE(44, 88), &key, 0, &val, sizeof(val), a); }
-UPB_INLINE bool envoy_config_route_v3_Route_typed_per_filter_config_delete(envoy_config_route_v3_Route *msg, upb_strview key) { return _upb_msg_map_delete(msg, UPB_SIZE(44, 88), &key, 0); }
-UPB_INLINE envoy_config_route_v3_Route_TypedPerFilterConfigEntry* envoy_config_route_v3_Route_typed_per_filter_config_nextmutable(envoy_config_route_v3_Route *msg, size_t* iter) { return (envoy_config_route_v3_Route_TypedPerFilterConfigEntry*)_upb_msg_map_next(msg, UPB_SIZE(44, 88), iter); }
-UPB_INLINE void envoy_config_route_v3_Route_set_name(envoy_config_route_v3_Route *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_route_v3_Route_set_tracing(envoy_config_route_v3_Route *msg, envoy_config_route_v3_Tracing* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(20, 40), envoy_config_route_v3_Tracing*) = value;
-}
-UPB_INLINE struct envoy_config_route_v3_Tracing* envoy_config_route_v3_Route_mutable_tracing(envoy_config_route_v3_Route *msg, upb_arena *arena) {
- struct envoy_config_route_v3_Tracing* sub = (struct envoy_config_route_v3_Tracing*)envoy_config_route_v3_Route_tracing(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_route_v3_Tracing*)_upb_msg_new(&envoy_config_route_v3_Tracing_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_Route_set_tracing(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_route_v3_Route_set_per_request_buffer_limit_bytes(envoy_config_route_v3_Route *msg, struct google_protobuf_UInt32Value* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(24, 48), struct google_protobuf_UInt32Value*) = value;
-}
-UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_route_v3_Route_mutable_per_request_buffer_limit_bytes(envoy_config_route_v3_Route *msg, upb_arena *arena) {
- struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_route_v3_Route_per_request_buffer_limit_bytes(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_Route_set_per_request_buffer_limit_bytes(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_route_v3_Route_set_filter_action(envoy_config_route_v3_Route *msg, envoy_config_route_v3_FilterAction* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_route_v3_FilterAction*, UPB_SIZE(48, 96), value, UPB_SIZE(52, 104), 17);
-}
-UPB_INLINE struct envoy_config_route_v3_FilterAction* envoy_config_route_v3_Route_mutable_filter_action(envoy_config_route_v3_Route *msg, upb_arena *arena) {
- struct envoy_config_route_v3_FilterAction* sub = (struct envoy_config_route_v3_FilterAction*)envoy_config_route_v3_Route_filter_action(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_route_v3_FilterAction*)_upb_msg_new(&envoy_config_route_v3_FilterAction_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_Route_set_filter_action(msg, sub);
- }
- return sub;
-}
-
-/* envoy.config.route.v3.Route.TypedPerFilterConfigEntry */
-
-UPB_INLINE upb_strview envoy_config_route_v3_Route_TypedPerFilterConfigEntry_key(const envoy_config_route_v3_Route_TypedPerFilterConfigEntry *msg) {
- upb_strview ret;
- _upb_msg_map_key(msg, &ret, 0);
- return ret;
-}
-UPB_INLINE bool envoy_config_route_v3_Route_TypedPerFilterConfigEntry_has_value(const envoy_config_route_v3_Route_TypedPerFilterConfigEntry *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const struct google_protobuf_Any* envoy_config_route_v3_Route_TypedPerFilterConfigEntry_value(const envoy_config_route_v3_Route_TypedPerFilterConfigEntry *msg) {
- struct google_protobuf_Any* ret;
- _upb_msg_map_value(msg, &ret, sizeof(ret));
- return ret;
-}
-
-UPB_INLINE void envoy_config_route_v3_Route_TypedPerFilterConfigEntry_set_value(envoy_config_route_v3_Route_TypedPerFilterConfigEntry *msg, struct google_protobuf_Any* value) {
- _upb_msg_map_set_value(msg, &value, sizeof(struct google_protobuf_Any*));
-}
-
-/* envoy.config.route.v3.WeightedCluster */
-
-UPB_INLINE envoy_config_route_v3_WeightedCluster *envoy_config_route_v3_WeightedCluster_new(upb_arena *arena) {
- return (envoy_config_route_v3_WeightedCluster *)_upb_msg_new(&envoy_config_route_v3_WeightedCluster_msginit, arena);
-}
-UPB_INLINE envoy_config_route_v3_WeightedCluster *envoy_config_route_v3_WeightedCluster_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_route_v3_WeightedCluster *ret = envoy_config_route_v3_WeightedCluster_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_WeightedCluster_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_route_v3_WeightedCluster_serialize(const envoy_config_route_v3_WeightedCluster *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_route_v3_WeightedCluster_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_config_route_v3_WeightedCluster_has_clusters(const envoy_config_route_v3_WeightedCluster *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
-UPB_INLINE const envoy_config_route_v3_WeightedCluster_ClusterWeight* const* envoy_config_route_v3_WeightedCluster_clusters(const envoy_config_route_v3_WeightedCluster *msg, size_t *len) { return (const envoy_config_route_v3_WeightedCluster_ClusterWeight* const*)_upb_array_accessor(msg, UPB_SIZE(12, 24), len); }
-UPB_INLINE upb_strview envoy_config_route_v3_WeightedCluster_runtime_key_prefix(const envoy_config_route_v3_WeightedCluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE bool envoy_config_route_v3_WeightedCluster_has_total_weight(const envoy_config_route_v3_WeightedCluster *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_route_v3_WeightedCluster_total_weight(const envoy_config_route_v3_WeightedCluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_UInt32Value*); }
-
-UPB_INLINE envoy_config_route_v3_WeightedCluster_ClusterWeight** envoy_config_route_v3_WeightedCluster_mutable_clusters(envoy_config_route_v3_WeightedCluster *msg, size_t *len) {
- return (envoy_config_route_v3_WeightedCluster_ClusterWeight**)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 24), len);
-}
-UPB_INLINE envoy_config_route_v3_WeightedCluster_ClusterWeight** envoy_config_route_v3_WeightedCluster_resize_clusters(envoy_config_route_v3_WeightedCluster *msg, size_t len, upb_arena *arena) {
- return (envoy_config_route_v3_WeightedCluster_ClusterWeight**)_upb_array_resize_accessor(msg, UPB_SIZE(12, 24), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_config_route_v3_WeightedCluster_ClusterWeight* envoy_config_route_v3_WeightedCluster_add_clusters(envoy_config_route_v3_WeightedCluster *msg, upb_arena *arena) {
- struct envoy_config_route_v3_WeightedCluster_ClusterWeight* sub = (struct envoy_config_route_v3_WeightedCluster_ClusterWeight*)_upb_msg_new(&envoy_config_route_v3_WeightedCluster_ClusterWeight_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(12, 24), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-UPB_INLINE void envoy_config_route_v3_WeightedCluster_set_runtime_key_prefix(envoy_config_route_v3_WeightedCluster *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_route_v3_WeightedCluster_set_total_weight(envoy_config_route_v3_WeightedCluster *msg, struct google_protobuf_UInt32Value* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_UInt32Value*) = value;
-}
-UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_route_v3_WeightedCluster_mutable_total_weight(envoy_config_route_v3_WeightedCluster *msg, upb_arena *arena) {
- struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_route_v3_WeightedCluster_total_weight(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_WeightedCluster_set_total_weight(msg, sub);
- }
- return sub;
-}
-
-/* envoy.config.route.v3.WeightedCluster.ClusterWeight */
-
-UPB_INLINE envoy_config_route_v3_WeightedCluster_ClusterWeight *envoy_config_route_v3_WeightedCluster_ClusterWeight_new(upb_arena *arena) {
- return (envoy_config_route_v3_WeightedCluster_ClusterWeight *)_upb_msg_new(&envoy_config_route_v3_WeightedCluster_ClusterWeight_msginit, arena);
-}
-UPB_INLINE envoy_config_route_v3_WeightedCluster_ClusterWeight *envoy_config_route_v3_WeightedCluster_ClusterWeight_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_route_v3_WeightedCluster_ClusterWeight *ret = envoy_config_route_v3_WeightedCluster_ClusterWeight_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_WeightedCluster_ClusterWeight_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_route_v3_WeightedCluster_ClusterWeight_serialize(const envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_route_v3_WeightedCluster_ClusterWeight_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview envoy_config_route_v3_WeightedCluster_ClusterWeight_name(const envoy_config_route_v3_WeightedCluster_ClusterWeight *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE bool envoy_config_route_v3_WeightedCluster_ClusterWeight_has_weight(const envoy_config_route_v3_WeightedCluster_ClusterWeight *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_route_v3_WeightedCluster_ClusterWeight_weight(const envoy_config_route_v3_WeightedCluster_ClusterWeight *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_UInt32Value*); }
-UPB_INLINE bool envoy_config_route_v3_WeightedCluster_ClusterWeight_has_metadata_match(const envoy_config_route_v3_WeightedCluster_ClusterWeight *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
-UPB_INLINE const struct envoy_config_core_v3_Metadata* envoy_config_route_v3_WeightedCluster_ClusterWeight_metadata_match(const envoy_config_route_v3_WeightedCluster_ClusterWeight *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct envoy_config_core_v3_Metadata*); }
-UPB_INLINE bool envoy_config_route_v3_WeightedCluster_ClusterWeight_has_request_headers_to_add(const envoy_config_route_v3_WeightedCluster_ClusterWeight *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); }
-UPB_INLINE const struct envoy_config_core_v3_HeaderValueOption* const* envoy_config_route_v3_WeightedCluster_ClusterWeight_request_headers_to_add(const envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, size_t *len) { return (const struct envoy_config_core_v3_HeaderValueOption* const*)_upb_array_accessor(msg, UPB_SIZE(16, 32), len); }
-UPB_INLINE bool envoy_config_route_v3_WeightedCluster_ClusterWeight_has_response_headers_to_add(const envoy_config_route_v3_WeightedCluster_ClusterWeight *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 40)); }
-UPB_INLINE const struct envoy_config_core_v3_HeaderValueOption* const* envoy_config_route_v3_WeightedCluster_ClusterWeight_response_headers_to_add(const envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, size_t *len) { return (const struct envoy_config_core_v3_HeaderValueOption* const*)_upb_array_accessor(msg, UPB_SIZE(20, 40), len); }
-UPB_INLINE upb_strview const* envoy_config_route_v3_WeightedCluster_ClusterWeight_response_headers_to_remove(const envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(24, 48), len); }
-UPB_INLINE upb_strview const* envoy_config_route_v3_WeightedCluster_ClusterWeight_request_headers_to_remove(const envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(28, 56), len); }
-UPB_INLINE bool envoy_config_route_v3_WeightedCluster_ClusterWeight_has_typed_per_filter_config(const envoy_config_route_v3_WeightedCluster_ClusterWeight *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(32, 64)); }
-UPB_INLINE size_t envoy_config_route_v3_WeightedCluster_ClusterWeight_typed_per_filter_config_size(const envoy_config_route_v3_WeightedCluster_ClusterWeight *msg) {return _upb_msg_map_size(msg, UPB_SIZE(32, 64)); }
-UPB_INLINE bool envoy_config_route_v3_WeightedCluster_ClusterWeight_typed_per_filter_config_get(const envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, upb_strview key, struct google_protobuf_Any* *val) { return _upb_msg_map_get(msg, UPB_SIZE(32, 64), &key, 0, val, sizeof(*val)); }
-UPB_INLINE const envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry* envoy_config_route_v3_WeightedCluster_ClusterWeight_typed_per_filter_config_next(const envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, size_t* iter) { return (const envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry*)_upb_msg_map_next(msg, UPB_SIZE(32, 64), iter); }
-
-UPB_INLINE void envoy_config_route_v3_WeightedCluster_ClusterWeight_set_name(envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_route_v3_WeightedCluster_ClusterWeight_set_weight(envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, struct google_protobuf_UInt32Value* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_UInt32Value*) = value;
-}
-UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_route_v3_WeightedCluster_ClusterWeight_mutable_weight(envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, upb_arena *arena) {
- struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_route_v3_WeightedCluster_ClusterWeight_weight(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_WeightedCluster_ClusterWeight_set_weight(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_route_v3_WeightedCluster_ClusterWeight_set_metadata_match(envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, struct envoy_config_core_v3_Metadata* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct envoy_config_core_v3_Metadata*) = value;
-}
-UPB_INLINE struct envoy_config_core_v3_Metadata* envoy_config_route_v3_WeightedCluster_ClusterWeight_mutable_metadata_match(envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, upb_arena *arena) {
- struct envoy_config_core_v3_Metadata* sub = (struct envoy_config_core_v3_Metadata*)envoy_config_route_v3_WeightedCluster_ClusterWeight_metadata_match(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_Metadata*)_upb_msg_new(&envoy_config_core_v3_Metadata_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_WeightedCluster_ClusterWeight_set_metadata_match(msg, sub);
- }
- return sub;
-}
-UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_config_route_v3_WeightedCluster_ClusterWeight_mutable_request_headers_to_add(envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, size_t *len) {
- return (struct envoy_config_core_v3_HeaderValueOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 32), len);
-}
-UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_config_route_v3_WeightedCluster_ClusterWeight_resize_request_headers_to_add(envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, size_t len, upb_arena *arena) {
- return (struct envoy_config_core_v3_HeaderValueOption**)_upb_array_resize_accessor(msg, UPB_SIZE(16, 32), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_config_core_v3_HeaderValueOption* envoy_config_route_v3_WeightedCluster_ClusterWeight_add_request_headers_to_add(envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, upb_arena *arena) {
- struct envoy_config_core_v3_HeaderValueOption* sub = (struct envoy_config_core_v3_HeaderValueOption*)_upb_msg_new(&envoy_config_core_v3_HeaderValueOption_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(16, 32), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_config_route_v3_WeightedCluster_ClusterWeight_mutable_response_headers_to_add(envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, size_t *len) {
- return (struct envoy_config_core_v3_HeaderValueOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 40), len);
-}
-UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_config_route_v3_WeightedCluster_ClusterWeight_resize_response_headers_to_add(envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, size_t len, upb_arena *arena) {
- return (struct envoy_config_core_v3_HeaderValueOption**)_upb_array_resize_accessor(msg, UPB_SIZE(20, 40), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_config_core_v3_HeaderValueOption* envoy_config_route_v3_WeightedCluster_ClusterWeight_add_response_headers_to_add(envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, upb_arena *arena) {
- struct envoy_config_core_v3_HeaderValueOption* sub = (struct envoy_config_core_v3_HeaderValueOption*)_upb_msg_new(&envoy_config_core_v3_HeaderValueOption_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(20, 40), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-UPB_INLINE upb_strview* envoy_config_route_v3_WeightedCluster_ClusterWeight_mutable_response_headers_to_remove(envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, size_t *len) {
- return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 48), len);
-}
-UPB_INLINE upb_strview* envoy_config_route_v3_WeightedCluster_ClusterWeight_resize_response_headers_to_remove(envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, size_t len, upb_arena *arena) {
- return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(24, 48), len, UPB_TYPE_STRING, arena);
-}
-UPB_INLINE bool envoy_config_route_v3_WeightedCluster_ClusterWeight_add_response_headers_to_remove(envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, upb_strview val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(24, 48), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
- arena);
-}
-UPB_INLINE upb_strview* envoy_config_route_v3_WeightedCluster_ClusterWeight_mutable_request_headers_to_remove(envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, size_t *len) {
- return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 56), len);
-}
-UPB_INLINE upb_strview* envoy_config_route_v3_WeightedCluster_ClusterWeight_resize_request_headers_to_remove(envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, size_t len, upb_arena *arena) {
- return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(28, 56), len, UPB_TYPE_STRING, arena);
-}
-UPB_INLINE bool envoy_config_route_v3_WeightedCluster_ClusterWeight_add_request_headers_to_remove(envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, upb_strview val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(28, 56), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
- arena);
-}
-UPB_INLINE void envoy_config_route_v3_WeightedCluster_ClusterWeight_typed_per_filter_config_clear(envoy_config_route_v3_WeightedCluster_ClusterWeight *msg) { _upb_msg_map_clear(msg, UPB_SIZE(32, 64)); }
-UPB_INLINE bool envoy_config_route_v3_WeightedCluster_ClusterWeight_typed_per_filter_config_set(envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, upb_strview key, struct google_protobuf_Any* val, upb_arena *a) { return _upb_msg_map_set(msg, UPB_SIZE(32, 64), &key, 0, &val, sizeof(val), a); }
-UPB_INLINE bool envoy_config_route_v3_WeightedCluster_ClusterWeight_typed_per_filter_config_delete(envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, upb_strview key) { return _upb_msg_map_delete(msg, UPB_SIZE(32, 64), &key, 0); }
-UPB_INLINE envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry* envoy_config_route_v3_WeightedCluster_ClusterWeight_typed_per_filter_config_nextmutable(envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, size_t* iter) { return (envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry*)_upb_msg_map_next(msg, UPB_SIZE(32, 64), iter); }
-
-/* envoy.config.route.v3.WeightedCluster.ClusterWeight.TypedPerFilterConfigEntry */
-
-UPB_INLINE upb_strview envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry_key(const envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry *msg) {
- upb_strview ret;
- _upb_msg_map_key(msg, &ret, 0);
- return ret;
-}
-UPB_INLINE bool envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry_has_value(const envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const struct google_protobuf_Any* envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry_value(const envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry *msg) {
- struct google_protobuf_Any* ret;
- _upb_msg_map_value(msg, &ret, sizeof(ret));
- return ret;
-}
-
-UPB_INLINE void envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry_set_value(envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry *msg, struct google_protobuf_Any* value) {
- _upb_msg_map_set_value(msg, &value, sizeof(struct google_protobuf_Any*));
-}
-
-/* envoy.config.route.v3.RouteMatch */
-
-UPB_INLINE envoy_config_route_v3_RouteMatch *envoy_config_route_v3_RouteMatch_new(upb_arena *arena) {
- return (envoy_config_route_v3_RouteMatch *)_upb_msg_new(&envoy_config_route_v3_RouteMatch_msginit, arena);
-}
-UPB_INLINE envoy_config_route_v3_RouteMatch *envoy_config_route_v3_RouteMatch_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_route_v3_RouteMatch *ret = envoy_config_route_v3_RouteMatch_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RouteMatch_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_route_v3_RouteMatch_serialize(const envoy_config_route_v3_RouteMatch *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_route_v3_RouteMatch_msginit, arena, len);
-}
-
-typedef enum {
- envoy_config_route_v3_RouteMatch_path_specifier_prefix = 1,
- envoy_config_route_v3_RouteMatch_path_specifier_path = 2,
- envoy_config_route_v3_RouteMatch_path_specifier_safe_regex = 10,
- envoy_config_route_v3_RouteMatch_path_specifier_connect_matcher = 12,
- envoy_config_route_v3_RouteMatch_path_specifier_NOT_SET = 0
-} envoy_config_route_v3_RouteMatch_path_specifier_oneofcases;
-UPB_INLINE envoy_config_route_v3_RouteMatch_path_specifier_oneofcases envoy_config_route_v3_RouteMatch_path_specifier_case(const envoy_config_route_v3_RouteMatch* msg) { return (envoy_config_route_v3_RouteMatch_path_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(32, 64), int32_t); }
-
-UPB_INLINE bool envoy_config_route_v3_RouteMatch_has_prefix(const envoy_config_route_v3_RouteMatch *msg) { return _upb_getoneofcase(msg, UPB_SIZE(32, 64)) == 1; }
-UPB_INLINE upb_strview envoy_config_route_v3_RouteMatch_prefix(const envoy_config_route_v3_RouteMatch *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(24, 48), UPB_SIZE(32, 64), 1, upb_strview_make("", strlen(""))); }
-UPB_INLINE bool envoy_config_route_v3_RouteMatch_has_path(const envoy_config_route_v3_RouteMatch *msg) { return _upb_getoneofcase(msg, UPB_SIZE(32, 64)) == 2; }
-UPB_INLINE upb_strview envoy_config_route_v3_RouteMatch_path(const envoy_config_route_v3_RouteMatch *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(24, 48), UPB_SIZE(32, 64), 2, upb_strview_make("", strlen(""))); }
-UPB_INLINE bool envoy_config_route_v3_RouteMatch_has_case_sensitive(const envoy_config_route_v3_RouteMatch *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_route_v3_RouteMatch_case_sensitive(const envoy_config_route_v3_RouteMatch *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct google_protobuf_BoolValue*); }
-UPB_INLINE bool envoy_config_route_v3_RouteMatch_has_headers(const envoy_config_route_v3_RouteMatch *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); }
-UPB_INLINE const envoy_config_route_v3_HeaderMatcher* const* envoy_config_route_v3_RouteMatch_headers(const envoy_config_route_v3_RouteMatch *msg, size_t *len) { return (const envoy_config_route_v3_HeaderMatcher* const*)_upb_array_accessor(msg, UPB_SIZE(16, 32), len); }
-UPB_INLINE bool envoy_config_route_v3_RouteMatch_has_query_parameters(const envoy_config_route_v3_RouteMatch *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 40)); }
-UPB_INLINE const envoy_config_route_v3_QueryParameterMatcher* const* envoy_config_route_v3_RouteMatch_query_parameters(const envoy_config_route_v3_RouteMatch *msg, size_t *len) { return (const envoy_config_route_v3_QueryParameterMatcher* const*)_upb_array_accessor(msg, UPB_SIZE(20, 40), len); }
-UPB_INLINE bool envoy_config_route_v3_RouteMatch_has_grpc(const envoy_config_route_v3_RouteMatch *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
-UPB_INLINE const envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions* envoy_config_route_v3_RouteMatch_grpc(const envoy_config_route_v3_RouteMatch *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions*); }
-UPB_INLINE bool envoy_config_route_v3_RouteMatch_has_runtime_fraction(const envoy_config_route_v3_RouteMatch *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const struct envoy_config_core_v3_RuntimeFractionalPercent* envoy_config_route_v3_RouteMatch_runtime_fraction(const envoy_config_route_v3_RouteMatch *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct envoy_config_core_v3_RuntimeFractionalPercent*); }
-UPB_INLINE bool envoy_config_route_v3_RouteMatch_has_safe_regex(const envoy_config_route_v3_RouteMatch *msg) { return _upb_getoneofcase(msg, UPB_SIZE(32, 64)) == 10; }
-UPB_INLINE const struct envoy_type_matcher_v3_RegexMatcher* envoy_config_route_v3_RouteMatch_safe_regex(const envoy_config_route_v3_RouteMatch *msg) { return UPB_READ_ONEOF(msg, const struct envoy_type_matcher_v3_RegexMatcher*, UPB_SIZE(24, 48), UPB_SIZE(32, 64), 10, NULL); }
-UPB_INLINE bool envoy_config_route_v3_RouteMatch_has_tls_context(const envoy_config_route_v3_RouteMatch *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
-UPB_INLINE const envoy_config_route_v3_RouteMatch_TlsContextMatchOptions* envoy_config_route_v3_RouteMatch_tls_context(const envoy_config_route_v3_RouteMatch *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const envoy_config_route_v3_RouteMatch_TlsContextMatchOptions*); }
-UPB_INLINE bool envoy_config_route_v3_RouteMatch_has_connect_matcher(const envoy_config_route_v3_RouteMatch *msg) { return _upb_getoneofcase(msg, UPB_SIZE(32, 64)) == 12; }
-UPB_INLINE const envoy_config_route_v3_RouteMatch_ConnectMatcher* envoy_config_route_v3_RouteMatch_connect_matcher(const envoy_config_route_v3_RouteMatch *msg) { return UPB_READ_ONEOF(msg, const envoy_config_route_v3_RouteMatch_ConnectMatcher*, UPB_SIZE(24, 48), UPB_SIZE(32, 64), 12, NULL); }
-
-UPB_INLINE void envoy_config_route_v3_RouteMatch_set_prefix(envoy_config_route_v3_RouteMatch *msg, upb_strview value) {
- UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(24, 48), value, UPB_SIZE(32, 64), 1);
-}
-UPB_INLINE void envoy_config_route_v3_RouteMatch_set_path(envoy_config_route_v3_RouteMatch *msg, upb_strview value) {
- UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(24, 48), value, UPB_SIZE(32, 64), 2);
-}
-UPB_INLINE void envoy_config_route_v3_RouteMatch_set_case_sensitive(envoy_config_route_v3_RouteMatch *msg, struct google_protobuf_BoolValue* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct google_protobuf_BoolValue*) = value;
-}
-UPB_INLINE struct google_protobuf_BoolValue* envoy_config_route_v3_RouteMatch_mutable_case_sensitive(envoy_config_route_v3_RouteMatch *msg, upb_arena *arena) {
- struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_route_v3_RouteMatch_case_sensitive(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_BoolValue*)_upb_msg_new(&google_protobuf_BoolValue_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_RouteMatch_set_case_sensitive(msg, sub);
- }
- return sub;
-}
-UPB_INLINE envoy_config_route_v3_HeaderMatcher** envoy_config_route_v3_RouteMatch_mutable_headers(envoy_config_route_v3_RouteMatch *msg, size_t *len) {
- return (envoy_config_route_v3_HeaderMatcher**)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 32), len);
-}
-UPB_INLINE envoy_config_route_v3_HeaderMatcher** envoy_config_route_v3_RouteMatch_resize_headers(envoy_config_route_v3_RouteMatch *msg, size_t len, upb_arena *arena) {
- return (envoy_config_route_v3_HeaderMatcher**)_upb_array_resize_accessor(msg, UPB_SIZE(16, 32), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_config_route_v3_HeaderMatcher* envoy_config_route_v3_RouteMatch_add_headers(envoy_config_route_v3_RouteMatch *msg, upb_arena *arena) {
- struct envoy_config_route_v3_HeaderMatcher* sub = (struct envoy_config_route_v3_HeaderMatcher*)_upb_msg_new(&envoy_config_route_v3_HeaderMatcher_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(16, 32), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-UPB_INLINE envoy_config_route_v3_QueryParameterMatcher** envoy_config_route_v3_RouteMatch_mutable_query_parameters(envoy_config_route_v3_RouteMatch *msg, size_t *len) {
- return (envoy_config_route_v3_QueryParameterMatcher**)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 40), len);
-}
-UPB_INLINE envoy_config_route_v3_QueryParameterMatcher** envoy_config_route_v3_RouteMatch_resize_query_parameters(envoy_config_route_v3_RouteMatch *msg, size_t len, upb_arena *arena) {
- return (envoy_config_route_v3_QueryParameterMatcher**)_upb_array_resize_accessor(msg, UPB_SIZE(20, 40), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_config_route_v3_QueryParameterMatcher* envoy_config_route_v3_RouteMatch_add_query_parameters(envoy_config_route_v3_RouteMatch *msg, upb_arena *arena) {
- struct envoy_config_route_v3_QueryParameterMatcher* sub = (struct envoy_config_route_v3_QueryParameterMatcher*)_upb_msg_new(&envoy_config_route_v3_QueryParameterMatcher_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(20, 40), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-UPB_INLINE void envoy_config_route_v3_RouteMatch_set_grpc(envoy_config_route_v3_RouteMatch *msg, envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions*) = value;
-}
-UPB_INLINE struct envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions* envoy_config_route_v3_RouteMatch_mutable_grpc(envoy_config_route_v3_RouteMatch *msg, upb_arena *arena) {
- struct envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions* sub = (struct envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions*)envoy_config_route_v3_RouteMatch_grpc(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions*)_upb_msg_new(&envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_RouteMatch_set_grpc(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_route_v3_RouteMatch_set_runtime_fraction(envoy_config_route_v3_RouteMatch *msg, struct envoy_config_core_v3_RuntimeFractionalPercent* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct envoy_config_core_v3_RuntimeFractionalPercent*) = value;
-}
-UPB_INLINE struct envoy_config_core_v3_RuntimeFractionalPercent* envoy_config_route_v3_RouteMatch_mutable_runtime_fraction(envoy_config_route_v3_RouteMatch *msg, upb_arena *arena) {
- struct envoy_config_core_v3_RuntimeFractionalPercent* sub = (struct envoy_config_core_v3_RuntimeFractionalPercent*)envoy_config_route_v3_RouteMatch_runtime_fraction(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_RuntimeFractionalPercent*)_upb_msg_new(&envoy_config_core_v3_RuntimeFractionalPercent_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_RouteMatch_set_runtime_fraction(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_route_v3_RouteMatch_set_safe_regex(envoy_config_route_v3_RouteMatch *msg, struct envoy_type_matcher_v3_RegexMatcher* value) {
- UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_RegexMatcher*, UPB_SIZE(24, 48), value, UPB_SIZE(32, 64), 10);
-}
-UPB_INLINE struct envoy_type_matcher_v3_RegexMatcher* envoy_config_route_v3_RouteMatch_mutable_safe_regex(envoy_config_route_v3_RouteMatch *msg, upb_arena *arena) {
- struct envoy_type_matcher_v3_RegexMatcher* sub = (struct envoy_type_matcher_v3_RegexMatcher*)envoy_config_route_v3_RouteMatch_safe_regex(msg);
- if (sub == NULL) {
- sub = (struct envoy_type_matcher_v3_RegexMatcher*)_upb_msg_new(&envoy_type_matcher_v3_RegexMatcher_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_RouteMatch_set_safe_regex(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_route_v3_RouteMatch_set_tls_context(envoy_config_route_v3_RouteMatch *msg, envoy_config_route_v3_RouteMatch_TlsContextMatchOptions* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), envoy_config_route_v3_RouteMatch_TlsContextMatchOptions*) = value;
-}
-UPB_INLINE struct envoy_config_route_v3_RouteMatch_TlsContextMatchOptions* envoy_config_route_v3_RouteMatch_mutable_tls_context(envoy_config_route_v3_RouteMatch *msg, upb_arena *arena) {
- struct envoy_config_route_v3_RouteMatch_TlsContextMatchOptions* sub = (struct envoy_config_route_v3_RouteMatch_TlsContextMatchOptions*)envoy_config_route_v3_RouteMatch_tls_context(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_route_v3_RouteMatch_TlsContextMatchOptions*)_upb_msg_new(&envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_RouteMatch_set_tls_context(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_route_v3_RouteMatch_set_connect_matcher(envoy_config_route_v3_RouteMatch *msg, envoy_config_route_v3_RouteMatch_ConnectMatcher* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RouteMatch_ConnectMatcher*, UPB_SIZE(24, 48), value, UPB_SIZE(32, 64), 12);
-}
-UPB_INLINE struct envoy_config_route_v3_RouteMatch_ConnectMatcher* envoy_config_route_v3_RouteMatch_mutable_connect_matcher(envoy_config_route_v3_RouteMatch *msg, upb_arena *arena) {
- struct envoy_config_route_v3_RouteMatch_ConnectMatcher* sub = (struct envoy_config_route_v3_RouteMatch_ConnectMatcher*)envoy_config_route_v3_RouteMatch_connect_matcher(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_route_v3_RouteMatch_ConnectMatcher*)_upb_msg_new(&envoy_config_route_v3_RouteMatch_ConnectMatcher_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_RouteMatch_set_connect_matcher(msg, sub);
- }
- return sub;
-}
-
-/* envoy.config.route.v3.RouteMatch.GrpcRouteMatchOptions */
-
-UPB_INLINE envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions *envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions_new(upb_arena *arena) {
- return (envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions *)_upb_msg_new(&envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions_msginit, arena);
-}
-UPB_INLINE envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions *envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions *ret = envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions_serialize(const envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions_msginit, arena, len);
-}
-
-
-
-/* envoy.config.route.v3.RouteMatch.TlsContextMatchOptions */
-
-UPB_INLINE envoy_config_route_v3_RouteMatch_TlsContextMatchOptions *envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_new(upb_arena *arena) {
- return (envoy_config_route_v3_RouteMatch_TlsContextMatchOptions *)_upb_msg_new(&envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_msginit, arena);
-}
-UPB_INLINE envoy_config_route_v3_RouteMatch_TlsContextMatchOptions *envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_route_v3_RouteMatch_TlsContextMatchOptions *ret = envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_serialize(const envoy_config_route_v3_RouteMatch_TlsContextMatchOptions *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_has_presented(const envoy_config_route_v3_RouteMatch_TlsContextMatchOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_presented(const envoy_config_route_v3_RouteMatch_TlsContextMatchOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct google_protobuf_BoolValue*); }
-UPB_INLINE bool envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_has_validated(const envoy_config_route_v3_RouteMatch_TlsContextMatchOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
-UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_validated(const envoy_config_route_v3_RouteMatch_TlsContextMatchOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_BoolValue*); }
-
-UPB_INLINE void envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_set_presented(envoy_config_route_v3_RouteMatch_TlsContextMatchOptions *msg, struct google_protobuf_BoolValue* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct google_protobuf_BoolValue*) = value;
-}
-UPB_INLINE struct google_protobuf_BoolValue* envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_mutable_presented(envoy_config_route_v3_RouteMatch_TlsContextMatchOptions *msg, upb_arena *arena) {
- struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_presented(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_BoolValue*)_upb_msg_new(&google_protobuf_BoolValue_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_set_presented(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_set_validated(envoy_config_route_v3_RouteMatch_TlsContextMatchOptions *msg, struct google_protobuf_BoolValue* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_BoolValue*) = value;
-}
-UPB_INLINE struct google_protobuf_BoolValue* envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_mutable_validated(envoy_config_route_v3_RouteMatch_TlsContextMatchOptions *msg, upb_arena *arena) {
- struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_validated(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_BoolValue*)_upb_msg_new(&google_protobuf_BoolValue_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_set_validated(msg, sub);
- }
- return sub;
-}
-
-/* envoy.config.route.v3.RouteMatch.ConnectMatcher */
-
-UPB_INLINE envoy_config_route_v3_RouteMatch_ConnectMatcher *envoy_config_route_v3_RouteMatch_ConnectMatcher_new(upb_arena *arena) {
- return (envoy_config_route_v3_RouteMatch_ConnectMatcher *)_upb_msg_new(&envoy_config_route_v3_RouteMatch_ConnectMatcher_msginit, arena);
-}
-UPB_INLINE envoy_config_route_v3_RouteMatch_ConnectMatcher *envoy_config_route_v3_RouteMatch_ConnectMatcher_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_route_v3_RouteMatch_ConnectMatcher *ret = envoy_config_route_v3_RouteMatch_ConnectMatcher_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RouteMatch_ConnectMatcher_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_route_v3_RouteMatch_ConnectMatcher_serialize(const envoy_config_route_v3_RouteMatch_ConnectMatcher *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_route_v3_RouteMatch_ConnectMatcher_msginit, arena, len);
-}
-
-
-
-/* envoy.config.route.v3.CorsPolicy */
-
-UPB_INLINE envoy_config_route_v3_CorsPolicy *envoy_config_route_v3_CorsPolicy_new(upb_arena *arena) {
- return (envoy_config_route_v3_CorsPolicy *)_upb_msg_new(&envoy_config_route_v3_CorsPolicy_msginit, arena);
-}
-UPB_INLINE envoy_config_route_v3_CorsPolicy *envoy_config_route_v3_CorsPolicy_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_route_v3_CorsPolicy *ret = envoy_config_route_v3_CorsPolicy_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_CorsPolicy_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_route_v3_CorsPolicy_serialize(const envoy_config_route_v3_CorsPolicy *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_route_v3_CorsPolicy_msginit, arena, len);
-}
-
-typedef enum {
- envoy_config_route_v3_CorsPolicy_enabled_specifier_filter_enabled = 9,
- envoy_config_route_v3_CorsPolicy_enabled_specifier_NOT_SET = 0
-} envoy_config_route_v3_CorsPolicy_enabled_specifier_oneofcases;
-UPB_INLINE envoy_config_route_v3_CorsPolicy_enabled_specifier_oneofcases envoy_config_route_v3_CorsPolicy_enabled_specifier_case(const envoy_config_route_v3_CorsPolicy* msg) { return (envoy_config_route_v3_CorsPolicy_enabled_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(48, 96), int32_t); }
-
-UPB_INLINE upb_strview envoy_config_route_v3_CorsPolicy_allow_methods(const envoy_config_route_v3_CorsPolicy *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE upb_strview envoy_config_route_v3_CorsPolicy_allow_headers(const envoy_config_route_v3_CorsPolicy *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview); }
-UPB_INLINE upb_strview envoy_config_route_v3_CorsPolicy_expose_headers(const envoy_config_route_v3_CorsPolicy *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_strview); }
-UPB_INLINE upb_strview envoy_config_route_v3_CorsPolicy_max_age(const envoy_config_route_v3_CorsPolicy *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 48), upb_strview); }
-UPB_INLINE bool envoy_config_route_v3_CorsPolicy_has_allow_credentials(const envoy_config_route_v3_CorsPolicy *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(32, 64)); }
-UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_route_v3_CorsPolicy_allow_credentials(const envoy_config_route_v3_CorsPolicy *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 64), const struct google_protobuf_BoolValue*); }
-UPB_INLINE bool envoy_config_route_v3_CorsPolicy_has_filter_enabled(const envoy_config_route_v3_CorsPolicy *msg) { return _upb_getoneofcase(msg, UPB_SIZE(48, 96)) == 9; }
-UPB_INLINE const struct envoy_config_core_v3_RuntimeFractionalPercent* envoy_config_route_v3_CorsPolicy_filter_enabled(const envoy_config_route_v3_CorsPolicy *msg) { return UPB_READ_ONEOF(msg, const struct envoy_config_core_v3_RuntimeFractionalPercent*, UPB_SIZE(44, 88), UPB_SIZE(48, 96), 9, NULL); }
-UPB_INLINE bool envoy_config_route_v3_CorsPolicy_has_shadow_enabled(const envoy_config_route_v3_CorsPolicy *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(36, 72)); }
-UPB_INLINE const struct envoy_config_core_v3_RuntimeFractionalPercent* envoy_config_route_v3_CorsPolicy_shadow_enabled(const envoy_config_route_v3_CorsPolicy *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(36, 72), const struct envoy_config_core_v3_RuntimeFractionalPercent*); }
-UPB_INLINE bool envoy_config_route_v3_CorsPolicy_has_allow_origin_string_match(const envoy_config_route_v3_CorsPolicy *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(40, 80)); }
-UPB_INLINE const struct envoy_type_matcher_v3_StringMatcher* const* envoy_config_route_v3_CorsPolicy_allow_origin_string_match(const envoy_config_route_v3_CorsPolicy *msg, size_t *len) { return (const struct envoy_type_matcher_v3_StringMatcher* const*)_upb_array_accessor(msg, UPB_SIZE(40, 80), len); }
-
-UPB_INLINE void envoy_config_route_v3_CorsPolicy_set_allow_methods(envoy_config_route_v3_CorsPolicy *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_route_v3_CorsPolicy_set_allow_headers(envoy_config_route_v3_CorsPolicy *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_route_v3_CorsPolicy_set_expose_headers(envoy_config_route_v3_CorsPolicy *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_route_v3_CorsPolicy_set_max_age(envoy_config_route_v3_CorsPolicy *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(24, 48), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_route_v3_CorsPolicy_set_allow_credentials(envoy_config_route_v3_CorsPolicy *msg, struct google_protobuf_BoolValue* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(32, 64), struct google_protobuf_BoolValue*) = value;
-}
-UPB_INLINE struct google_protobuf_BoolValue* envoy_config_route_v3_CorsPolicy_mutable_allow_credentials(envoy_config_route_v3_CorsPolicy *msg, upb_arena *arena) {
- struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_route_v3_CorsPolicy_allow_credentials(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_BoolValue*)_upb_msg_new(&google_protobuf_BoolValue_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_CorsPolicy_set_allow_credentials(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_route_v3_CorsPolicy_set_filter_enabled(envoy_config_route_v3_CorsPolicy *msg, struct envoy_config_core_v3_RuntimeFractionalPercent* value) {
- UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_RuntimeFractionalPercent*, UPB_SIZE(44, 88), value, UPB_SIZE(48, 96), 9);
-}
-UPB_INLINE struct envoy_config_core_v3_RuntimeFractionalPercent* envoy_config_route_v3_CorsPolicy_mutable_filter_enabled(envoy_config_route_v3_CorsPolicy *msg, upb_arena *arena) {
- struct envoy_config_core_v3_RuntimeFractionalPercent* sub = (struct envoy_config_core_v3_RuntimeFractionalPercent*)envoy_config_route_v3_CorsPolicy_filter_enabled(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_RuntimeFractionalPercent*)_upb_msg_new(&envoy_config_core_v3_RuntimeFractionalPercent_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_CorsPolicy_set_filter_enabled(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_route_v3_CorsPolicy_set_shadow_enabled(envoy_config_route_v3_CorsPolicy *msg, struct envoy_config_core_v3_RuntimeFractionalPercent* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(36, 72), struct envoy_config_core_v3_RuntimeFractionalPercent*) = value;
-}
-UPB_INLINE struct envoy_config_core_v3_RuntimeFractionalPercent* envoy_config_route_v3_CorsPolicy_mutable_shadow_enabled(envoy_config_route_v3_CorsPolicy *msg, upb_arena *arena) {
- struct envoy_config_core_v3_RuntimeFractionalPercent* sub = (struct envoy_config_core_v3_RuntimeFractionalPercent*)envoy_config_route_v3_CorsPolicy_shadow_enabled(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_RuntimeFractionalPercent*)_upb_msg_new(&envoy_config_core_v3_RuntimeFractionalPercent_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_CorsPolicy_set_shadow_enabled(msg, sub);
- }
- return sub;
-}
-UPB_INLINE struct envoy_type_matcher_v3_StringMatcher** envoy_config_route_v3_CorsPolicy_mutable_allow_origin_string_match(envoy_config_route_v3_CorsPolicy *msg, size_t *len) {
- return (struct envoy_type_matcher_v3_StringMatcher**)_upb_array_mutable_accessor(msg, UPB_SIZE(40, 80), len);
-}
-UPB_INLINE struct envoy_type_matcher_v3_StringMatcher** envoy_config_route_v3_CorsPolicy_resize_allow_origin_string_match(envoy_config_route_v3_CorsPolicy *msg, size_t len, upb_arena *arena) {
- return (struct envoy_type_matcher_v3_StringMatcher**)_upb_array_resize_accessor(msg, UPB_SIZE(40, 80), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_type_matcher_v3_StringMatcher* envoy_config_route_v3_CorsPolicy_add_allow_origin_string_match(envoy_config_route_v3_CorsPolicy *msg, upb_arena *arena) {
- struct envoy_type_matcher_v3_StringMatcher* sub = (struct envoy_type_matcher_v3_StringMatcher*)_upb_msg_new(&envoy_type_matcher_v3_StringMatcher_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(40, 80), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-
-/* envoy.config.route.v3.RouteAction */
-
-UPB_INLINE envoy_config_route_v3_RouteAction *envoy_config_route_v3_RouteAction_new(upb_arena *arena) {
- return (envoy_config_route_v3_RouteAction *)_upb_msg_new(&envoy_config_route_v3_RouteAction_msginit, arena);
-}
-UPB_INLINE envoy_config_route_v3_RouteAction *envoy_config_route_v3_RouteAction_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_route_v3_RouteAction *ret = envoy_config_route_v3_RouteAction_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RouteAction_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_route_v3_RouteAction_serialize(const envoy_config_route_v3_RouteAction *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_route_v3_RouteAction_msginit, arena, len);
-}
-
-typedef enum {
- envoy_config_route_v3_RouteAction_cluster_specifier_cluster = 1,
- envoy_config_route_v3_RouteAction_cluster_specifier_cluster_header = 2,
- envoy_config_route_v3_RouteAction_cluster_specifier_weighted_clusters = 3,
- envoy_config_route_v3_RouteAction_cluster_specifier_NOT_SET = 0
-} envoy_config_route_v3_RouteAction_cluster_specifier_oneofcases;
-UPB_INLINE envoy_config_route_v3_RouteAction_cluster_specifier_oneofcases envoy_config_route_v3_RouteAction_cluster_specifier_case(const envoy_config_route_v3_RouteAction* msg) { return (envoy_config_route_v3_RouteAction_cluster_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(112, 200), int32_t); }
-
-typedef enum {
- envoy_config_route_v3_RouteAction_host_rewrite_specifier_host_rewrite_literal = 6,
- envoy_config_route_v3_RouteAction_host_rewrite_specifier_auto_host_rewrite = 7,
- envoy_config_route_v3_RouteAction_host_rewrite_specifier_host_rewrite_header = 29,
- envoy_config_route_v3_RouteAction_host_rewrite_specifier_host_rewrite_path_regex = 35,
- envoy_config_route_v3_RouteAction_host_rewrite_specifier_NOT_SET = 0
-} envoy_config_route_v3_RouteAction_host_rewrite_specifier_oneofcases;
-UPB_INLINE envoy_config_route_v3_RouteAction_host_rewrite_specifier_oneofcases envoy_config_route_v3_RouteAction_host_rewrite_specifier_case(const envoy_config_route_v3_RouteAction* msg) { return (envoy_config_route_v3_RouteAction_host_rewrite_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(124, 224), int32_t); }
-
-UPB_INLINE bool envoy_config_route_v3_RouteAction_has_cluster(const envoy_config_route_v3_RouteAction *msg) { return _upb_getoneofcase(msg, UPB_SIZE(112, 200)) == 1; }
-UPB_INLINE upb_strview envoy_config_route_v3_RouteAction_cluster(const envoy_config_route_v3_RouteAction *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(104, 184), UPB_SIZE(112, 200), 1, upb_strview_make("", strlen(""))); }
-UPB_INLINE bool envoy_config_route_v3_RouteAction_has_cluster_header(const envoy_config_route_v3_RouteAction *msg) { return _upb_getoneofcase(msg, UPB_SIZE(112, 200)) == 2; }
-UPB_INLINE upb_strview envoy_config_route_v3_RouteAction_cluster_header(const envoy_config_route_v3_RouteAction *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(104, 184), UPB_SIZE(112, 200), 2, upb_strview_make("", strlen(""))); }
-UPB_INLINE bool envoy_config_route_v3_RouteAction_has_weighted_clusters(const envoy_config_route_v3_RouteAction *msg) { return _upb_getoneofcase(msg, UPB_SIZE(112, 200)) == 3; }
-UPB_INLINE const envoy_config_route_v3_WeightedCluster* envoy_config_route_v3_RouteAction_weighted_clusters(const envoy_config_route_v3_RouteAction *msg) { return UPB_READ_ONEOF(msg, const envoy_config_route_v3_WeightedCluster*, UPB_SIZE(104, 184), UPB_SIZE(112, 200), 3, NULL); }
-UPB_INLINE bool envoy_config_route_v3_RouteAction_has_metadata_match(const envoy_config_route_v3_RouteAction *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(32, 40)); }
-UPB_INLINE const struct envoy_config_core_v3_Metadata* envoy_config_route_v3_RouteAction_metadata_match(const envoy_config_route_v3_RouteAction *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 40), const struct envoy_config_core_v3_Metadata*); }
-UPB_INLINE upb_strview envoy_config_route_v3_RouteAction_prefix_rewrite(const envoy_config_route_v3_RouteAction *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), upb_strview); }
-UPB_INLINE bool envoy_config_route_v3_RouteAction_has_host_rewrite_literal(const envoy_config_route_v3_RouteAction *msg) { return _upb_getoneofcase(msg, UPB_SIZE(124, 224)) == 6; }
-UPB_INLINE upb_strview envoy_config_route_v3_RouteAction_host_rewrite_literal(const envoy_config_route_v3_RouteAction *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(116, 208), UPB_SIZE(124, 224), 6, upb_strview_make("", strlen(""))); }
-UPB_INLINE bool envoy_config_route_v3_RouteAction_has_auto_host_rewrite(const envoy_config_route_v3_RouteAction *msg) { return _upb_getoneofcase(msg, UPB_SIZE(124, 224)) == 7; }
-UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_route_v3_RouteAction_auto_host_rewrite(const envoy_config_route_v3_RouteAction *msg) { return UPB_READ_ONEOF(msg, const struct google_protobuf_BoolValue*, UPB_SIZE(116, 208), UPB_SIZE(124, 224), 7, NULL); }
-UPB_INLINE bool envoy_config_route_v3_RouteAction_has_timeout(const envoy_config_route_v3_RouteAction *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(36, 48)); }
-UPB_INLINE const struct google_protobuf_Duration* envoy_config_route_v3_RouteAction_timeout(const envoy_config_route_v3_RouteAction *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(36, 48), const struct google_protobuf_Duration*); }
-UPB_INLINE bool envoy_config_route_v3_RouteAction_has_retry_policy(const envoy_config_route_v3_RouteAction *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(40, 56)); }
-UPB_INLINE const envoy_config_route_v3_RetryPolicy* envoy_config_route_v3_RouteAction_retry_policy(const envoy_config_route_v3_RouteAction *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(40, 56), const envoy_config_route_v3_RetryPolicy*); }
-UPB_INLINE int32_t envoy_config_route_v3_RouteAction_priority(const envoy_config_route_v3_RouteAction *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
-UPB_INLINE bool envoy_config_route_v3_RouteAction_has_rate_limits(const envoy_config_route_v3_RouteAction *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(88, 152)); }
-UPB_INLINE const envoy_config_route_v3_RateLimit* const* envoy_config_route_v3_RouteAction_rate_limits(const envoy_config_route_v3_RouteAction *msg, size_t *len) { return (const envoy_config_route_v3_RateLimit* const*)_upb_array_accessor(msg, UPB_SIZE(88, 152), len); }
-UPB_INLINE bool envoy_config_route_v3_RouteAction_has_include_vh_rate_limits(const envoy_config_route_v3_RouteAction *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(44, 64)); }
-UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_route_v3_RouteAction_include_vh_rate_limits(const envoy_config_route_v3_RouteAction *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(44, 64), const struct google_protobuf_BoolValue*); }
-UPB_INLINE bool envoy_config_route_v3_RouteAction_has_hash_policy(const envoy_config_route_v3_RouteAction *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(92, 160)); }
-UPB_INLINE const envoy_config_route_v3_RouteAction_HashPolicy* const* envoy_config_route_v3_RouteAction_hash_policy(const envoy_config_route_v3_RouteAction *msg, size_t *len) { return (const envoy_config_route_v3_RouteAction_HashPolicy* const*)_upb_array_accessor(msg, UPB_SIZE(92, 160), len); }
-UPB_INLINE bool envoy_config_route_v3_RouteAction_has_cors(const envoy_config_route_v3_RouteAction *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(48, 72)); }
-UPB_INLINE const envoy_config_route_v3_CorsPolicy* envoy_config_route_v3_RouteAction_cors(const envoy_config_route_v3_RouteAction *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(48, 72), const envoy_config_route_v3_CorsPolicy*); }
-UPB_INLINE int32_t envoy_config_route_v3_RouteAction_cluster_not_found_response_code(const envoy_config_route_v3_RouteAction *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); }
-UPB_INLINE bool envoy_config_route_v3_RouteAction_has_max_grpc_timeout(const envoy_config_route_v3_RouteAction *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(52, 80)); }
-UPB_INLINE const struct google_protobuf_Duration* envoy_config_route_v3_RouteAction_max_grpc_timeout(const envoy_config_route_v3_RouteAction *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(52, 80), const struct google_protobuf_Duration*); }
-UPB_INLINE bool envoy_config_route_v3_RouteAction_has_idle_timeout(const envoy_config_route_v3_RouteAction *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(56, 88)); }
-UPB_INLINE const struct google_protobuf_Duration* envoy_config_route_v3_RouteAction_idle_timeout(const envoy_config_route_v3_RouteAction *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(56, 88), const struct google_protobuf_Duration*); }
-UPB_INLINE bool envoy_config_route_v3_RouteAction_has_upgrade_configs(const envoy_config_route_v3_RouteAction *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(96, 168)); }
-UPB_INLINE const envoy_config_route_v3_RouteAction_UpgradeConfig* const* envoy_config_route_v3_RouteAction_upgrade_configs(const envoy_config_route_v3_RouteAction *msg, size_t *len) { return (const envoy_config_route_v3_RouteAction_UpgradeConfig* const*)_upb_array_accessor(msg, UPB_SIZE(96, 168), len); }
-UPB_INLINE int32_t envoy_config_route_v3_RouteAction_internal_redirect_action(const envoy_config_route_v3_RouteAction *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t); }
-UPB_INLINE bool envoy_config_route_v3_RouteAction_has_hedge_policy(const envoy_config_route_v3_RouteAction *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(60, 96)); }
-UPB_INLINE const envoy_config_route_v3_HedgePolicy* envoy_config_route_v3_RouteAction_hedge_policy(const envoy_config_route_v3_RouteAction *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(60, 96), const envoy_config_route_v3_HedgePolicy*); }
-UPB_INLINE bool envoy_config_route_v3_RouteAction_has_grpc_timeout_offset(const envoy_config_route_v3_RouteAction *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(64, 104)); }
-UPB_INLINE const struct google_protobuf_Duration* envoy_config_route_v3_RouteAction_grpc_timeout_offset(const envoy_config_route_v3_RouteAction *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(64, 104), const struct google_protobuf_Duration*); }
-UPB_INLINE bool envoy_config_route_v3_RouteAction_has_host_rewrite_header(const envoy_config_route_v3_RouteAction *msg) { return _upb_getoneofcase(msg, UPB_SIZE(124, 224)) == 29; }
-UPB_INLINE upb_strview envoy_config_route_v3_RouteAction_host_rewrite_header(const envoy_config_route_v3_RouteAction *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(116, 208), UPB_SIZE(124, 224), 29, upb_strview_make("", strlen(""))); }
-UPB_INLINE bool envoy_config_route_v3_RouteAction_has_request_mirror_policies(const envoy_config_route_v3_RouteAction *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(100, 176)); }
-UPB_INLINE const envoy_config_route_v3_RouteAction_RequestMirrorPolicy* const* envoy_config_route_v3_RouteAction_request_mirror_policies(const envoy_config_route_v3_RouteAction *msg, size_t *len) { return (const envoy_config_route_v3_RouteAction_RequestMirrorPolicy* const*)_upb_array_accessor(msg, UPB_SIZE(100, 176), len); }
-UPB_INLINE bool envoy_config_route_v3_RouteAction_has_max_internal_redirects(const envoy_config_route_v3_RouteAction *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(68, 112)); }
-UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_route_v3_RouteAction_max_internal_redirects(const envoy_config_route_v3_RouteAction *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(68, 112), const struct google_protobuf_UInt32Value*); }
-UPB_INLINE bool envoy_config_route_v3_RouteAction_has_regex_rewrite(const envoy_config_route_v3_RouteAction *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(72, 120)); }
-UPB_INLINE const struct envoy_type_matcher_v3_RegexMatchAndSubstitute* envoy_config_route_v3_RouteAction_regex_rewrite(const envoy_config_route_v3_RouteAction *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(72, 120), const struct envoy_type_matcher_v3_RegexMatchAndSubstitute*); }
-UPB_INLINE bool envoy_config_route_v3_RouteAction_has_retry_policy_typed_config(const envoy_config_route_v3_RouteAction *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(76, 128)); }
-UPB_INLINE const struct google_protobuf_Any* envoy_config_route_v3_RouteAction_retry_policy_typed_config(const envoy_config_route_v3_RouteAction *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(76, 128), const struct google_protobuf_Any*); }
-UPB_INLINE bool envoy_config_route_v3_RouteAction_has_internal_redirect_policy(const envoy_config_route_v3_RouteAction *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(80, 136)); }
-UPB_INLINE const envoy_config_route_v3_InternalRedirectPolicy* envoy_config_route_v3_RouteAction_internal_redirect_policy(const envoy_config_route_v3_RouteAction *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(80, 136), const envoy_config_route_v3_InternalRedirectPolicy*); }
-UPB_INLINE bool envoy_config_route_v3_RouteAction_has_host_rewrite_path_regex(const envoy_config_route_v3_RouteAction *msg) { return _upb_getoneofcase(msg, UPB_SIZE(124, 224)) == 35; }
-UPB_INLINE const struct envoy_type_matcher_v3_RegexMatchAndSubstitute* envoy_config_route_v3_RouteAction_host_rewrite_path_regex(const envoy_config_route_v3_RouteAction *msg) { return UPB_READ_ONEOF(msg, const struct envoy_type_matcher_v3_RegexMatchAndSubstitute*, UPB_SIZE(116, 208), UPB_SIZE(124, 224), 35, NULL); }
-UPB_INLINE bool envoy_config_route_v3_RouteAction_has_max_stream_duration(const envoy_config_route_v3_RouteAction *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(84, 144)); }
-UPB_INLINE const envoy_config_route_v3_RouteAction_MaxStreamDuration* envoy_config_route_v3_RouteAction_max_stream_duration(const envoy_config_route_v3_RouteAction *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(84, 144), const envoy_config_route_v3_RouteAction_MaxStreamDuration*); }
-
-UPB_INLINE void envoy_config_route_v3_RouteAction_set_cluster(envoy_config_route_v3_RouteAction *msg, upb_strview value) {
- UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(104, 184), value, UPB_SIZE(112, 200), 1);
-}
-UPB_INLINE void envoy_config_route_v3_RouteAction_set_cluster_header(envoy_config_route_v3_RouteAction *msg, upb_strview value) {
- UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(104, 184), value, UPB_SIZE(112, 200), 2);
-}
-UPB_INLINE void envoy_config_route_v3_RouteAction_set_weighted_clusters(envoy_config_route_v3_RouteAction *msg, envoy_config_route_v3_WeightedCluster* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_route_v3_WeightedCluster*, UPB_SIZE(104, 184), value, UPB_SIZE(112, 200), 3);
-}
-UPB_INLINE struct envoy_config_route_v3_WeightedCluster* envoy_config_route_v3_RouteAction_mutable_weighted_clusters(envoy_config_route_v3_RouteAction *msg, upb_arena *arena) {
- struct envoy_config_route_v3_WeightedCluster* sub = (struct envoy_config_route_v3_WeightedCluster*)envoy_config_route_v3_RouteAction_weighted_clusters(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_route_v3_WeightedCluster*)_upb_msg_new(&envoy_config_route_v3_WeightedCluster_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_RouteAction_set_weighted_clusters(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_route_v3_RouteAction_set_metadata_match(envoy_config_route_v3_RouteAction *msg, struct envoy_config_core_v3_Metadata* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(32, 40), struct envoy_config_core_v3_Metadata*) = value;
-}
-UPB_INLINE struct envoy_config_core_v3_Metadata* envoy_config_route_v3_RouteAction_mutable_metadata_match(envoy_config_route_v3_RouteAction *msg, upb_arena *arena) {
- struct envoy_config_core_v3_Metadata* sub = (struct envoy_config_core_v3_Metadata*)envoy_config_route_v3_RouteAction_metadata_match(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_Metadata*)_upb_msg_new(&envoy_config_core_v3_Metadata_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_RouteAction_set_metadata_match(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_route_v3_RouteAction_set_prefix_rewrite(envoy_config_route_v3_RouteAction *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(24, 24), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_route_v3_RouteAction_set_host_rewrite_literal(envoy_config_route_v3_RouteAction *msg, upb_strview value) {
- UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(116, 208), value, UPB_SIZE(124, 224), 6);
-}
-UPB_INLINE void envoy_config_route_v3_RouteAction_set_auto_host_rewrite(envoy_config_route_v3_RouteAction *msg, struct google_protobuf_BoolValue* value) {
- UPB_WRITE_ONEOF(msg, struct google_protobuf_BoolValue*, UPB_SIZE(116, 208), value, UPB_SIZE(124, 224), 7);
-}
-UPB_INLINE struct google_protobuf_BoolValue* envoy_config_route_v3_RouteAction_mutable_auto_host_rewrite(envoy_config_route_v3_RouteAction *msg, upb_arena *arena) {
- struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_route_v3_RouteAction_auto_host_rewrite(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_BoolValue*)_upb_msg_new(&google_protobuf_BoolValue_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_RouteAction_set_auto_host_rewrite(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_route_v3_RouteAction_set_timeout(envoy_config_route_v3_RouteAction *msg, struct google_protobuf_Duration* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(36, 48), struct google_protobuf_Duration*) = value;
-}
-UPB_INLINE struct google_protobuf_Duration* envoy_config_route_v3_RouteAction_mutable_timeout(envoy_config_route_v3_RouteAction *msg, upb_arena *arena) {
- struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_route_v3_RouteAction_timeout(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_RouteAction_set_timeout(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_route_v3_RouteAction_set_retry_policy(envoy_config_route_v3_RouteAction *msg, envoy_config_route_v3_RetryPolicy* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(40, 56), envoy_config_route_v3_RetryPolicy*) = value;
-}
-UPB_INLINE struct envoy_config_route_v3_RetryPolicy* envoy_config_route_v3_RouteAction_mutable_retry_policy(envoy_config_route_v3_RouteAction *msg, upb_arena *arena) {
- struct envoy_config_route_v3_RetryPolicy* sub = (struct envoy_config_route_v3_RetryPolicy*)envoy_config_route_v3_RouteAction_retry_policy(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_route_v3_RetryPolicy*)_upb_msg_new(&envoy_config_route_v3_RetryPolicy_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_RouteAction_set_retry_policy(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_route_v3_RouteAction_set_priority(envoy_config_route_v3_RouteAction *msg, int32_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
-}
-UPB_INLINE envoy_config_route_v3_RateLimit** envoy_config_route_v3_RouteAction_mutable_rate_limits(envoy_config_route_v3_RouteAction *msg, size_t *len) {
- return (envoy_config_route_v3_RateLimit**)_upb_array_mutable_accessor(msg, UPB_SIZE(88, 152), len);
-}
-UPB_INLINE envoy_config_route_v3_RateLimit** envoy_config_route_v3_RouteAction_resize_rate_limits(envoy_config_route_v3_RouteAction *msg, size_t len, upb_arena *arena) {
- return (envoy_config_route_v3_RateLimit**)_upb_array_resize_accessor(msg, UPB_SIZE(88, 152), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_config_route_v3_RateLimit* envoy_config_route_v3_RouteAction_add_rate_limits(envoy_config_route_v3_RouteAction *msg, upb_arena *arena) {
- struct envoy_config_route_v3_RateLimit* sub = (struct envoy_config_route_v3_RateLimit*)_upb_msg_new(&envoy_config_route_v3_RateLimit_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(88, 152), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-UPB_INLINE void envoy_config_route_v3_RouteAction_set_include_vh_rate_limits(envoy_config_route_v3_RouteAction *msg, struct google_protobuf_BoolValue* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(44, 64), struct google_protobuf_BoolValue*) = value;
-}
-UPB_INLINE struct google_protobuf_BoolValue* envoy_config_route_v3_RouteAction_mutable_include_vh_rate_limits(envoy_config_route_v3_RouteAction *msg, upb_arena *arena) {
- struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_route_v3_RouteAction_include_vh_rate_limits(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_BoolValue*)_upb_msg_new(&google_protobuf_BoolValue_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_RouteAction_set_include_vh_rate_limits(msg, sub);
- }
- return sub;
-}
-UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy** envoy_config_route_v3_RouteAction_mutable_hash_policy(envoy_config_route_v3_RouteAction *msg, size_t *len) {
- return (envoy_config_route_v3_RouteAction_HashPolicy**)_upb_array_mutable_accessor(msg, UPB_SIZE(92, 160), len);
-}
-UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy** envoy_config_route_v3_RouteAction_resize_hash_policy(envoy_config_route_v3_RouteAction *msg, size_t len, upb_arena *arena) {
- return (envoy_config_route_v3_RouteAction_HashPolicy**)_upb_array_resize_accessor(msg, UPB_SIZE(92, 160), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_config_route_v3_RouteAction_HashPolicy* envoy_config_route_v3_RouteAction_add_hash_policy(envoy_config_route_v3_RouteAction *msg, upb_arena *arena) {
- struct envoy_config_route_v3_RouteAction_HashPolicy* sub = (struct envoy_config_route_v3_RouteAction_HashPolicy*)_upb_msg_new(&envoy_config_route_v3_RouteAction_HashPolicy_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(92, 160), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-UPB_INLINE void envoy_config_route_v3_RouteAction_set_cors(envoy_config_route_v3_RouteAction *msg, envoy_config_route_v3_CorsPolicy* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(48, 72), envoy_config_route_v3_CorsPolicy*) = value;
-}
-UPB_INLINE struct envoy_config_route_v3_CorsPolicy* envoy_config_route_v3_RouteAction_mutable_cors(envoy_config_route_v3_RouteAction *msg, upb_arena *arena) {
- struct envoy_config_route_v3_CorsPolicy* sub = (struct envoy_config_route_v3_CorsPolicy*)envoy_config_route_v3_RouteAction_cors(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_route_v3_CorsPolicy*)_upb_msg_new(&envoy_config_route_v3_CorsPolicy_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_RouteAction_set_cors(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_route_v3_RouteAction_set_cluster_not_found_response_code(envoy_config_route_v3_RouteAction *msg, int32_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
-}
-UPB_INLINE void envoy_config_route_v3_RouteAction_set_max_grpc_timeout(envoy_config_route_v3_RouteAction *msg, struct google_protobuf_Duration* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(52, 80), struct google_protobuf_Duration*) = value;
-}
-UPB_INLINE struct google_protobuf_Duration* envoy_config_route_v3_RouteAction_mutable_max_grpc_timeout(envoy_config_route_v3_RouteAction *msg, upb_arena *arena) {
- struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_route_v3_RouteAction_max_grpc_timeout(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_RouteAction_set_max_grpc_timeout(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_route_v3_RouteAction_set_idle_timeout(envoy_config_route_v3_RouteAction *msg, struct google_protobuf_Duration* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(56, 88), struct google_protobuf_Duration*) = value;
-}
-UPB_INLINE struct google_protobuf_Duration* envoy_config_route_v3_RouteAction_mutable_idle_timeout(envoy_config_route_v3_RouteAction *msg, upb_arena *arena) {
- struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_route_v3_RouteAction_idle_timeout(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_RouteAction_set_idle_timeout(msg, sub);
- }
- return sub;
-}
-UPB_INLINE envoy_config_route_v3_RouteAction_UpgradeConfig** envoy_config_route_v3_RouteAction_mutable_upgrade_configs(envoy_config_route_v3_RouteAction *msg, size_t *len) {
- return (envoy_config_route_v3_RouteAction_UpgradeConfig**)_upb_array_mutable_accessor(msg, UPB_SIZE(96, 168), len);
-}
-UPB_INLINE envoy_config_route_v3_RouteAction_UpgradeConfig** envoy_config_route_v3_RouteAction_resize_upgrade_configs(envoy_config_route_v3_RouteAction *msg, size_t len, upb_arena *arena) {
- return (envoy_config_route_v3_RouteAction_UpgradeConfig**)_upb_array_resize_accessor(msg, UPB_SIZE(96, 168), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_config_route_v3_RouteAction_UpgradeConfig* envoy_config_route_v3_RouteAction_add_upgrade_configs(envoy_config_route_v3_RouteAction *msg, upb_arena *arena) {
- struct envoy_config_route_v3_RouteAction_UpgradeConfig* sub = (struct envoy_config_route_v3_RouteAction_UpgradeConfig*)_upb_msg_new(&envoy_config_route_v3_RouteAction_UpgradeConfig_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(96, 168), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-UPB_INLINE void envoy_config_route_v3_RouteAction_set_internal_redirect_action(envoy_config_route_v3_RouteAction *msg, int32_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t) = value;
-}
-UPB_INLINE void envoy_config_route_v3_RouteAction_set_hedge_policy(envoy_config_route_v3_RouteAction *msg, envoy_config_route_v3_HedgePolicy* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(60, 96), envoy_config_route_v3_HedgePolicy*) = value;
-}
-UPB_INLINE struct envoy_config_route_v3_HedgePolicy* envoy_config_route_v3_RouteAction_mutable_hedge_policy(envoy_config_route_v3_RouteAction *msg, upb_arena *arena) {
- struct envoy_config_route_v3_HedgePolicy* sub = (struct envoy_config_route_v3_HedgePolicy*)envoy_config_route_v3_RouteAction_hedge_policy(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_route_v3_HedgePolicy*)_upb_msg_new(&envoy_config_route_v3_HedgePolicy_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_RouteAction_set_hedge_policy(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_route_v3_RouteAction_set_grpc_timeout_offset(envoy_config_route_v3_RouteAction *msg, struct google_protobuf_Duration* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(64, 104), struct google_protobuf_Duration*) = value;
-}
-UPB_INLINE struct google_protobuf_Duration* envoy_config_route_v3_RouteAction_mutable_grpc_timeout_offset(envoy_config_route_v3_RouteAction *msg, upb_arena *arena) {
- struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_route_v3_RouteAction_grpc_timeout_offset(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_RouteAction_set_grpc_timeout_offset(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_route_v3_RouteAction_set_host_rewrite_header(envoy_config_route_v3_RouteAction *msg, upb_strview value) {
- UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(116, 208), value, UPB_SIZE(124, 224), 29);
-}
-UPB_INLINE envoy_config_route_v3_RouteAction_RequestMirrorPolicy** envoy_config_route_v3_RouteAction_mutable_request_mirror_policies(envoy_config_route_v3_RouteAction *msg, size_t *len) {
- return (envoy_config_route_v3_RouteAction_RequestMirrorPolicy**)_upb_array_mutable_accessor(msg, UPB_SIZE(100, 176), len);
-}
-UPB_INLINE envoy_config_route_v3_RouteAction_RequestMirrorPolicy** envoy_config_route_v3_RouteAction_resize_request_mirror_policies(envoy_config_route_v3_RouteAction *msg, size_t len, upb_arena *arena) {
- return (envoy_config_route_v3_RouteAction_RequestMirrorPolicy**)_upb_array_resize_accessor(msg, UPB_SIZE(100, 176), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_config_route_v3_RouteAction_RequestMirrorPolicy* envoy_config_route_v3_RouteAction_add_request_mirror_policies(envoy_config_route_v3_RouteAction *msg, upb_arena *arena) {
- struct envoy_config_route_v3_RouteAction_RequestMirrorPolicy* sub = (struct envoy_config_route_v3_RouteAction_RequestMirrorPolicy*)_upb_msg_new(&envoy_config_route_v3_RouteAction_RequestMirrorPolicy_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(100, 176), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-UPB_INLINE void envoy_config_route_v3_RouteAction_set_max_internal_redirects(envoy_config_route_v3_RouteAction *msg, struct google_protobuf_UInt32Value* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(68, 112), struct google_protobuf_UInt32Value*) = value;
-}
-UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_route_v3_RouteAction_mutable_max_internal_redirects(envoy_config_route_v3_RouteAction *msg, upb_arena *arena) {
- struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_route_v3_RouteAction_max_internal_redirects(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_RouteAction_set_max_internal_redirects(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_route_v3_RouteAction_set_regex_rewrite(envoy_config_route_v3_RouteAction *msg, struct envoy_type_matcher_v3_RegexMatchAndSubstitute* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(72, 120), struct envoy_type_matcher_v3_RegexMatchAndSubstitute*) = value;
-}
-UPB_INLINE struct envoy_type_matcher_v3_RegexMatchAndSubstitute* envoy_config_route_v3_RouteAction_mutable_regex_rewrite(envoy_config_route_v3_RouteAction *msg, upb_arena *arena) {
- struct envoy_type_matcher_v3_RegexMatchAndSubstitute* sub = (struct envoy_type_matcher_v3_RegexMatchAndSubstitute*)envoy_config_route_v3_RouteAction_regex_rewrite(msg);
- if (sub == NULL) {
- sub = (struct envoy_type_matcher_v3_RegexMatchAndSubstitute*)_upb_msg_new(&envoy_type_matcher_v3_RegexMatchAndSubstitute_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_RouteAction_set_regex_rewrite(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_route_v3_RouteAction_set_retry_policy_typed_config(envoy_config_route_v3_RouteAction *msg, struct google_protobuf_Any* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(76, 128), struct google_protobuf_Any*) = value;
-}
-UPB_INLINE struct google_protobuf_Any* envoy_config_route_v3_RouteAction_mutable_retry_policy_typed_config(envoy_config_route_v3_RouteAction *msg, upb_arena *arena) {
- struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_config_route_v3_RouteAction_retry_policy_typed_config(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_RouteAction_set_retry_policy_typed_config(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_route_v3_RouteAction_set_internal_redirect_policy(envoy_config_route_v3_RouteAction *msg, envoy_config_route_v3_InternalRedirectPolicy* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(80, 136), envoy_config_route_v3_InternalRedirectPolicy*) = value;
-}
-UPB_INLINE struct envoy_config_route_v3_InternalRedirectPolicy* envoy_config_route_v3_RouteAction_mutable_internal_redirect_policy(envoy_config_route_v3_RouteAction *msg, upb_arena *arena) {
- struct envoy_config_route_v3_InternalRedirectPolicy* sub = (struct envoy_config_route_v3_InternalRedirectPolicy*)envoy_config_route_v3_RouteAction_internal_redirect_policy(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_route_v3_InternalRedirectPolicy*)_upb_msg_new(&envoy_config_route_v3_InternalRedirectPolicy_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_RouteAction_set_internal_redirect_policy(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_route_v3_RouteAction_set_host_rewrite_path_regex(envoy_config_route_v3_RouteAction *msg, struct envoy_type_matcher_v3_RegexMatchAndSubstitute* value) {
- UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_RegexMatchAndSubstitute*, UPB_SIZE(116, 208), value, UPB_SIZE(124, 224), 35);
-}
-UPB_INLINE struct envoy_type_matcher_v3_RegexMatchAndSubstitute* envoy_config_route_v3_RouteAction_mutable_host_rewrite_path_regex(envoy_config_route_v3_RouteAction *msg, upb_arena *arena) {
- struct envoy_type_matcher_v3_RegexMatchAndSubstitute* sub = (struct envoy_type_matcher_v3_RegexMatchAndSubstitute*)envoy_config_route_v3_RouteAction_host_rewrite_path_regex(msg);
- if (sub == NULL) {
- sub = (struct envoy_type_matcher_v3_RegexMatchAndSubstitute*)_upb_msg_new(&envoy_type_matcher_v3_RegexMatchAndSubstitute_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_RouteAction_set_host_rewrite_path_regex(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_route_v3_RouteAction_set_max_stream_duration(envoy_config_route_v3_RouteAction *msg, envoy_config_route_v3_RouteAction_MaxStreamDuration* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(84, 144), envoy_config_route_v3_RouteAction_MaxStreamDuration*) = value;
-}
-UPB_INLINE struct envoy_config_route_v3_RouteAction_MaxStreamDuration* envoy_config_route_v3_RouteAction_mutable_max_stream_duration(envoy_config_route_v3_RouteAction *msg, upb_arena *arena) {
- struct envoy_config_route_v3_RouteAction_MaxStreamDuration* sub = (struct envoy_config_route_v3_RouteAction_MaxStreamDuration*)envoy_config_route_v3_RouteAction_max_stream_duration(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_route_v3_RouteAction_MaxStreamDuration*)_upb_msg_new(&envoy_config_route_v3_RouteAction_MaxStreamDuration_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_RouteAction_set_max_stream_duration(msg, sub);
- }
- return sub;
-}
-
-/* envoy.config.route.v3.RouteAction.RequestMirrorPolicy */
-
-UPB_INLINE envoy_config_route_v3_RouteAction_RequestMirrorPolicy *envoy_config_route_v3_RouteAction_RequestMirrorPolicy_new(upb_arena *arena) {
- return (envoy_config_route_v3_RouteAction_RequestMirrorPolicy *)_upb_msg_new(&envoy_config_route_v3_RouteAction_RequestMirrorPolicy_msginit, arena);
-}
-UPB_INLINE envoy_config_route_v3_RouteAction_RequestMirrorPolicy *envoy_config_route_v3_RouteAction_RequestMirrorPolicy_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_route_v3_RouteAction_RequestMirrorPolicy *ret = envoy_config_route_v3_RouteAction_RequestMirrorPolicy_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RouteAction_RequestMirrorPolicy_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_route_v3_RouteAction_RequestMirrorPolicy_serialize(const envoy_config_route_v3_RouteAction_RequestMirrorPolicy *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_route_v3_RouteAction_RequestMirrorPolicy_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview envoy_config_route_v3_RouteAction_RequestMirrorPolicy_cluster(const envoy_config_route_v3_RouteAction_RequestMirrorPolicy *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE bool envoy_config_route_v3_RouteAction_RequestMirrorPolicy_has_runtime_fraction(const envoy_config_route_v3_RouteAction_RequestMirrorPolicy *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const struct envoy_config_core_v3_RuntimeFractionalPercent* envoy_config_route_v3_RouteAction_RequestMirrorPolicy_runtime_fraction(const envoy_config_route_v3_RouteAction_RequestMirrorPolicy *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct envoy_config_core_v3_RuntimeFractionalPercent*); }
-UPB_INLINE bool envoy_config_route_v3_RouteAction_RequestMirrorPolicy_has_trace_sampled(const envoy_config_route_v3_RouteAction_RequestMirrorPolicy *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
-UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_route_v3_RouteAction_RequestMirrorPolicy_trace_sampled(const envoy_config_route_v3_RouteAction_RequestMirrorPolicy *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_protobuf_BoolValue*); }
-
-UPB_INLINE void envoy_config_route_v3_RouteAction_RequestMirrorPolicy_set_cluster(envoy_config_route_v3_RouteAction_RequestMirrorPolicy *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_route_v3_RouteAction_RequestMirrorPolicy_set_runtime_fraction(envoy_config_route_v3_RouteAction_RequestMirrorPolicy *msg, struct envoy_config_core_v3_RuntimeFractionalPercent* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct envoy_config_core_v3_RuntimeFractionalPercent*) = value;
-}
-UPB_INLINE struct envoy_config_core_v3_RuntimeFractionalPercent* envoy_config_route_v3_RouteAction_RequestMirrorPolicy_mutable_runtime_fraction(envoy_config_route_v3_RouteAction_RequestMirrorPolicy *msg, upb_arena *arena) {
- struct envoy_config_core_v3_RuntimeFractionalPercent* sub = (struct envoy_config_core_v3_RuntimeFractionalPercent*)envoy_config_route_v3_RouteAction_RequestMirrorPolicy_runtime_fraction(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_RuntimeFractionalPercent*)_upb_msg_new(&envoy_config_core_v3_RuntimeFractionalPercent_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_RouteAction_RequestMirrorPolicy_set_runtime_fraction(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_route_v3_RouteAction_RequestMirrorPolicy_set_trace_sampled(envoy_config_route_v3_RouteAction_RequestMirrorPolicy *msg, struct google_protobuf_BoolValue* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_protobuf_BoolValue*) = value;
-}
-UPB_INLINE struct google_protobuf_BoolValue* envoy_config_route_v3_RouteAction_RequestMirrorPolicy_mutable_trace_sampled(envoy_config_route_v3_RouteAction_RequestMirrorPolicy *msg, upb_arena *arena) {
- struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_route_v3_RouteAction_RequestMirrorPolicy_trace_sampled(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_BoolValue*)_upb_msg_new(&google_protobuf_BoolValue_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_RouteAction_RequestMirrorPolicy_set_trace_sampled(msg, sub);
- }
- return sub;
-}
-
-/* envoy.config.route.v3.RouteAction.HashPolicy */
-
-UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy *envoy_config_route_v3_RouteAction_HashPolicy_new(upb_arena *arena) {
- return (envoy_config_route_v3_RouteAction_HashPolicy *)_upb_msg_new(&envoy_config_route_v3_RouteAction_HashPolicy_msginit, arena);
-}
-UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy *envoy_config_route_v3_RouteAction_HashPolicy_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_route_v3_RouteAction_HashPolicy *ret = envoy_config_route_v3_RouteAction_HashPolicy_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RouteAction_HashPolicy_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_route_v3_RouteAction_HashPolicy_serialize(const envoy_config_route_v3_RouteAction_HashPolicy *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_route_v3_RouteAction_HashPolicy_msginit, arena, len);
-}
-
-typedef enum {
- envoy_config_route_v3_RouteAction_HashPolicy_policy_specifier_header = 1,
- envoy_config_route_v3_RouteAction_HashPolicy_policy_specifier_cookie = 2,
- envoy_config_route_v3_RouteAction_HashPolicy_policy_specifier_connection_properties = 3,
- envoy_config_route_v3_RouteAction_HashPolicy_policy_specifier_query_parameter = 5,
- envoy_config_route_v3_RouteAction_HashPolicy_policy_specifier_filter_state = 6,
- envoy_config_route_v3_RouteAction_HashPolicy_policy_specifier_NOT_SET = 0
-} envoy_config_route_v3_RouteAction_HashPolicy_policy_specifier_oneofcases;
-UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy_policy_specifier_oneofcases envoy_config_route_v3_RouteAction_HashPolicy_policy_specifier_case(const envoy_config_route_v3_RouteAction_HashPolicy* msg) { return (envoy_config_route_v3_RouteAction_HashPolicy_policy_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(8, 16), int32_t); }
-
-UPB_INLINE bool envoy_config_route_v3_RouteAction_HashPolicy_has_header(const envoy_config_route_v3_RouteAction_HashPolicy *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 1; }
-UPB_INLINE const envoy_config_route_v3_RouteAction_HashPolicy_Header* envoy_config_route_v3_RouteAction_HashPolicy_header(const envoy_config_route_v3_RouteAction_HashPolicy *msg) { return UPB_READ_ONEOF(msg, const envoy_config_route_v3_RouteAction_HashPolicy_Header*, UPB_SIZE(4, 8), UPB_SIZE(8, 16), 1, NULL); }
-UPB_INLINE bool envoy_config_route_v3_RouteAction_HashPolicy_has_cookie(const envoy_config_route_v3_RouteAction_HashPolicy *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 2; }
-UPB_INLINE const envoy_config_route_v3_RouteAction_HashPolicy_Cookie* envoy_config_route_v3_RouteAction_HashPolicy_cookie(const envoy_config_route_v3_RouteAction_HashPolicy *msg) { return UPB_READ_ONEOF(msg, const envoy_config_route_v3_RouteAction_HashPolicy_Cookie*, UPB_SIZE(4, 8), UPB_SIZE(8, 16), 2, NULL); }
-UPB_INLINE bool envoy_config_route_v3_RouteAction_HashPolicy_has_connection_properties(const envoy_config_route_v3_RouteAction_HashPolicy *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 3; }
-UPB_INLINE const envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties* envoy_config_route_v3_RouteAction_HashPolicy_connection_properties(const envoy_config_route_v3_RouteAction_HashPolicy *msg) { return UPB_READ_ONEOF(msg, const envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties*, UPB_SIZE(4, 8), UPB_SIZE(8, 16), 3, NULL); }
-UPB_INLINE bool envoy_config_route_v3_RouteAction_HashPolicy_terminal(const envoy_config_route_v3_RouteAction_HashPolicy *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); }
-UPB_INLINE bool envoy_config_route_v3_RouteAction_HashPolicy_has_query_parameter(const envoy_config_route_v3_RouteAction_HashPolicy *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 5; }
-UPB_INLINE const envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter* envoy_config_route_v3_RouteAction_HashPolicy_query_parameter(const envoy_config_route_v3_RouteAction_HashPolicy *msg) { return UPB_READ_ONEOF(msg, const envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter*, UPB_SIZE(4, 8), UPB_SIZE(8, 16), 5, NULL); }
-UPB_INLINE bool envoy_config_route_v3_RouteAction_HashPolicy_has_filter_state(const envoy_config_route_v3_RouteAction_HashPolicy *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 6; }
-UPB_INLINE const envoy_config_route_v3_RouteAction_HashPolicy_FilterState* envoy_config_route_v3_RouteAction_HashPolicy_filter_state(const envoy_config_route_v3_RouteAction_HashPolicy *msg) { return UPB_READ_ONEOF(msg, const envoy_config_route_v3_RouteAction_HashPolicy_FilterState*, UPB_SIZE(4, 8), UPB_SIZE(8, 16), 6, NULL); }
-
-UPB_INLINE void envoy_config_route_v3_RouteAction_HashPolicy_set_header(envoy_config_route_v3_RouteAction_HashPolicy *msg, envoy_config_route_v3_RouteAction_HashPolicy_Header* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RouteAction_HashPolicy_Header*, UPB_SIZE(4, 8), value, UPB_SIZE(8, 16), 1);
-}
-UPB_INLINE struct envoy_config_route_v3_RouteAction_HashPolicy_Header* envoy_config_route_v3_RouteAction_HashPolicy_mutable_header(envoy_config_route_v3_RouteAction_HashPolicy *msg, upb_arena *arena) {
- struct envoy_config_route_v3_RouteAction_HashPolicy_Header* sub = (struct envoy_config_route_v3_RouteAction_HashPolicy_Header*)envoy_config_route_v3_RouteAction_HashPolicy_header(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_route_v3_RouteAction_HashPolicy_Header*)_upb_msg_new(&envoy_config_route_v3_RouteAction_HashPolicy_Header_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_RouteAction_HashPolicy_set_header(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_route_v3_RouteAction_HashPolicy_set_cookie(envoy_config_route_v3_RouteAction_HashPolicy *msg, envoy_config_route_v3_RouteAction_HashPolicy_Cookie* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RouteAction_HashPolicy_Cookie*, UPB_SIZE(4, 8), value, UPB_SIZE(8, 16), 2);
-}
-UPB_INLINE struct envoy_config_route_v3_RouteAction_HashPolicy_Cookie* envoy_config_route_v3_RouteAction_HashPolicy_mutable_cookie(envoy_config_route_v3_RouteAction_HashPolicy *msg, upb_arena *arena) {
- struct envoy_config_route_v3_RouteAction_HashPolicy_Cookie* sub = (struct envoy_config_route_v3_RouteAction_HashPolicy_Cookie*)envoy_config_route_v3_RouteAction_HashPolicy_cookie(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_route_v3_RouteAction_HashPolicy_Cookie*)_upb_msg_new(&envoy_config_route_v3_RouteAction_HashPolicy_Cookie_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_RouteAction_HashPolicy_set_cookie(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_route_v3_RouteAction_HashPolicy_set_connection_properties(envoy_config_route_v3_RouteAction_HashPolicy *msg, envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties*, UPB_SIZE(4, 8), value, UPB_SIZE(8, 16), 3);
-}
-UPB_INLINE struct envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties* envoy_config_route_v3_RouteAction_HashPolicy_mutable_connection_properties(envoy_config_route_v3_RouteAction_HashPolicy *msg, upb_arena *arena) {
- struct envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties* sub = (struct envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties*)envoy_config_route_v3_RouteAction_HashPolicy_connection_properties(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties*)_upb_msg_new(&envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_RouteAction_HashPolicy_set_connection_properties(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_route_v3_RouteAction_HashPolicy_set_terminal(envoy_config_route_v3_RouteAction_HashPolicy *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
-}
-UPB_INLINE void envoy_config_route_v3_RouteAction_HashPolicy_set_query_parameter(envoy_config_route_v3_RouteAction_HashPolicy *msg, envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter*, UPB_SIZE(4, 8), value, UPB_SIZE(8, 16), 5);
-}
-UPB_INLINE struct envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter* envoy_config_route_v3_RouteAction_HashPolicy_mutable_query_parameter(envoy_config_route_v3_RouteAction_HashPolicy *msg, upb_arena *arena) {
- struct envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter* sub = (struct envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter*)envoy_config_route_v3_RouteAction_HashPolicy_query_parameter(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter*)_upb_msg_new(&envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_RouteAction_HashPolicy_set_query_parameter(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_route_v3_RouteAction_HashPolicy_set_filter_state(envoy_config_route_v3_RouteAction_HashPolicy *msg, envoy_config_route_v3_RouteAction_HashPolicy_FilterState* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RouteAction_HashPolicy_FilterState*, UPB_SIZE(4, 8), value, UPB_SIZE(8, 16), 6);
-}
-UPB_INLINE struct envoy_config_route_v3_RouteAction_HashPolicy_FilterState* envoy_config_route_v3_RouteAction_HashPolicy_mutable_filter_state(envoy_config_route_v3_RouteAction_HashPolicy *msg, upb_arena *arena) {
- struct envoy_config_route_v3_RouteAction_HashPolicy_FilterState* sub = (struct envoy_config_route_v3_RouteAction_HashPolicy_FilterState*)envoy_config_route_v3_RouteAction_HashPolicy_filter_state(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_route_v3_RouteAction_HashPolicy_FilterState*)_upb_msg_new(&envoy_config_route_v3_RouteAction_HashPolicy_FilterState_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_RouteAction_HashPolicy_set_filter_state(msg, sub);
- }
- return sub;
-}
-
-/* envoy.config.route.v3.RouteAction.HashPolicy.Header */
-
-UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy_Header *envoy_config_route_v3_RouteAction_HashPolicy_Header_new(upb_arena *arena) {
- return (envoy_config_route_v3_RouteAction_HashPolicy_Header *)_upb_msg_new(&envoy_config_route_v3_RouteAction_HashPolicy_Header_msginit, arena);
-}
-UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy_Header *envoy_config_route_v3_RouteAction_HashPolicy_Header_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_route_v3_RouteAction_HashPolicy_Header *ret = envoy_config_route_v3_RouteAction_HashPolicy_Header_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RouteAction_HashPolicy_Header_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_route_v3_RouteAction_HashPolicy_Header_serialize(const envoy_config_route_v3_RouteAction_HashPolicy_Header *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_route_v3_RouteAction_HashPolicy_Header_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview envoy_config_route_v3_RouteAction_HashPolicy_Header_header_name(const envoy_config_route_v3_RouteAction_HashPolicy_Header *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE bool envoy_config_route_v3_RouteAction_HashPolicy_Header_has_regex_rewrite(const envoy_config_route_v3_RouteAction_HashPolicy_Header *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const struct envoy_type_matcher_v3_RegexMatchAndSubstitute* envoy_config_route_v3_RouteAction_HashPolicy_Header_regex_rewrite(const envoy_config_route_v3_RouteAction_HashPolicy_Header *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct envoy_type_matcher_v3_RegexMatchAndSubstitute*); }
-
-UPB_INLINE void envoy_config_route_v3_RouteAction_HashPolicy_Header_set_header_name(envoy_config_route_v3_RouteAction_HashPolicy_Header *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_route_v3_RouteAction_HashPolicy_Header_set_regex_rewrite(envoy_config_route_v3_RouteAction_HashPolicy_Header *msg, struct envoy_type_matcher_v3_RegexMatchAndSubstitute* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct envoy_type_matcher_v3_RegexMatchAndSubstitute*) = value;
-}
-UPB_INLINE struct envoy_type_matcher_v3_RegexMatchAndSubstitute* envoy_config_route_v3_RouteAction_HashPolicy_Header_mutable_regex_rewrite(envoy_config_route_v3_RouteAction_HashPolicy_Header *msg, upb_arena *arena) {
- struct envoy_type_matcher_v3_RegexMatchAndSubstitute* sub = (struct envoy_type_matcher_v3_RegexMatchAndSubstitute*)envoy_config_route_v3_RouteAction_HashPolicy_Header_regex_rewrite(msg);
- if (sub == NULL) {
- sub = (struct envoy_type_matcher_v3_RegexMatchAndSubstitute*)_upb_msg_new(&envoy_type_matcher_v3_RegexMatchAndSubstitute_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_RouteAction_HashPolicy_Header_set_regex_rewrite(msg, sub);
- }
- return sub;
-}
-
-/* envoy.config.route.v3.RouteAction.HashPolicy.Cookie */
-
-UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy_Cookie *envoy_config_route_v3_RouteAction_HashPolicy_Cookie_new(upb_arena *arena) {
- return (envoy_config_route_v3_RouteAction_HashPolicy_Cookie *)_upb_msg_new(&envoy_config_route_v3_RouteAction_HashPolicy_Cookie_msginit, arena);
-}
-UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy_Cookie *envoy_config_route_v3_RouteAction_HashPolicy_Cookie_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_route_v3_RouteAction_HashPolicy_Cookie *ret = envoy_config_route_v3_RouteAction_HashPolicy_Cookie_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RouteAction_HashPolicy_Cookie_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_route_v3_RouteAction_HashPolicy_Cookie_serialize(const envoy_config_route_v3_RouteAction_HashPolicy_Cookie *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_route_v3_RouteAction_HashPolicy_Cookie_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview envoy_config_route_v3_RouteAction_HashPolicy_Cookie_name(const envoy_config_route_v3_RouteAction_HashPolicy_Cookie *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE bool envoy_config_route_v3_RouteAction_HashPolicy_Cookie_has_ttl(const envoy_config_route_v3_RouteAction_HashPolicy_Cookie *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); }
-UPB_INLINE const struct google_protobuf_Duration* envoy_config_route_v3_RouteAction_HashPolicy_Cookie_ttl(const envoy_config_route_v3_RouteAction_HashPolicy_Cookie *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const struct google_protobuf_Duration*); }
-UPB_INLINE upb_strview envoy_config_route_v3_RouteAction_HashPolicy_Cookie_path(const envoy_config_route_v3_RouteAction_HashPolicy_Cookie *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview); }
-
-UPB_INLINE void envoy_config_route_v3_RouteAction_HashPolicy_Cookie_set_name(envoy_config_route_v3_RouteAction_HashPolicy_Cookie *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_route_v3_RouteAction_HashPolicy_Cookie_set_ttl(envoy_config_route_v3_RouteAction_HashPolicy_Cookie *msg, struct google_protobuf_Duration* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(16, 32), struct google_protobuf_Duration*) = value;
-}
-UPB_INLINE struct google_protobuf_Duration* envoy_config_route_v3_RouteAction_HashPolicy_Cookie_mutable_ttl(envoy_config_route_v3_RouteAction_HashPolicy_Cookie *msg, upb_arena *arena) {
- struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_route_v3_RouteAction_HashPolicy_Cookie_ttl(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_RouteAction_HashPolicy_Cookie_set_ttl(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_route_v3_RouteAction_HashPolicy_Cookie_set_path(envoy_config_route_v3_RouteAction_HashPolicy_Cookie *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview) = value;
-}
-
-/* envoy.config.route.v3.RouteAction.HashPolicy.ConnectionProperties */
-
-UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties *envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_new(upb_arena *arena) {
- return (envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties *)_upb_msg_new(&envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_msginit, arena);
-}
-UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties *envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties *ret = envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_serialize(const envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_source_ip(const envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); }
-
-UPB_INLINE void envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_set_source_ip(envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
-}
-
-/* envoy.config.route.v3.RouteAction.HashPolicy.QueryParameter */
-
-UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter *envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_new(upb_arena *arena) {
- return (envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter *)_upb_msg_new(&envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_msginit, arena);
-}
-UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter *envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter *ret = envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_serialize(const envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_name(const envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-
-UPB_INLINE void envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_set_name(envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-
-/* envoy.config.route.v3.RouteAction.HashPolicy.FilterState */
-
-UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy_FilterState *envoy_config_route_v3_RouteAction_HashPolicy_FilterState_new(upb_arena *arena) {
- return (envoy_config_route_v3_RouteAction_HashPolicy_FilterState *)_upb_msg_new(&envoy_config_route_v3_RouteAction_HashPolicy_FilterState_msginit, arena);
-}
-UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy_FilterState *envoy_config_route_v3_RouteAction_HashPolicy_FilterState_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_route_v3_RouteAction_HashPolicy_FilterState *ret = envoy_config_route_v3_RouteAction_HashPolicy_FilterState_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RouteAction_HashPolicy_FilterState_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_route_v3_RouteAction_HashPolicy_FilterState_serialize(const envoy_config_route_v3_RouteAction_HashPolicy_FilterState *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_route_v3_RouteAction_HashPolicy_FilterState_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview envoy_config_route_v3_RouteAction_HashPolicy_FilterState_key(const envoy_config_route_v3_RouteAction_HashPolicy_FilterState *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-
-UPB_INLINE void envoy_config_route_v3_RouteAction_HashPolicy_FilterState_set_key(envoy_config_route_v3_RouteAction_HashPolicy_FilterState *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-
-/* envoy.config.route.v3.RouteAction.UpgradeConfig */
-
-UPB_INLINE envoy_config_route_v3_RouteAction_UpgradeConfig *envoy_config_route_v3_RouteAction_UpgradeConfig_new(upb_arena *arena) {
- return (envoy_config_route_v3_RouteAction_UpgradeConfig *)_upb_msg_new(&envoy_config_route_v3_RouteAction_UpgradeConfig_msginit, arena);
-}
-UPB_INLINE envoy_config_route_v3_RouteAction_UpgradeConfig *envoy_config_route_v3_RouteAction_UpgradeConfig_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_route_v3_RouteAction_UpgradeConfig *ret = envoy_config_route_v3_RouteAction_UpgradeConfig_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RouteAction_UpgradeConfig_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_route_v3_RouteAction_UpgradeConfig_serialize(const envoy_config_route_v3_RouteAction_UpgradeConfig *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_route_v3_RouteAction_UpgradeConfig_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview envoy_config_route_v3_RouteAction_UpgradeConfig_upgrade_type(const envoy_config_route_v3_RouteAction_UpgradeConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE bool envoy_config_route_v3_RouteAction_UpgradeConfig_has_enabled(const envoy_config_route_v3_RouteAction_UpgradeConfig *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_route_v3_RouteAction_UpgradeConfig_enabled(const envoy_config_route_v3_RouteAction_UpgradeConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_BoolValue*); }
-UPB_INLINE bool envoy_config_route_v3_RouteAction_UpgradeConfig_has_connect_config(const envoy_config_route_v3_RouteAction_UpgradeConfig *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
-UPB_INLINE const envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig* envoy_config_route_v3_RouteAction_UpgradeConfig_connect_config(const envoy_config_route_v3_RouteAction_UpgradeConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig*); }
-
-UPB_INLINE void envoy_config_route_v3_RouteAction_UpgradeConfig_set_upgrade_type(envoy_config_route_v3_RouteAction_UpgradeConfig *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_route_v3_RouteAction_UpgradeConfig_set_enabled(envoy_config_route_v3_RouteAction_UpgradeConfig *msg, struct google_protobuf_BoolValue* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_BoolValue*) = value;
-}
-UPB_INLINE struct google_protobuf_BoolValue* envoy_config_route_v3_RouteAction_UpgradeConfig_mutable_enabled(envoy_config_route_v3_RouteAction_UpgradeConfig *msg, upb_arena *arena) {
- struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_route_v3_RouteAction_UpgradeConfig_enabled(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_BoolValue*)_upb_msg_new(&google_protobuf_BoolValue_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_RouteAction_UpgradeConfig_set_enabled(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_route_v3_RouteAction_UpgradeConfig_set_connect_config(envoy_config_route_v3_RouteAction_UpgradeConfig *msg, envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig*) = value;
-}
-UPB_INLINE struct envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig* envoy_config_route_v3_RouteAction_UpgradeConfig_mutable_connect_config(envoy_config_route_v3_RouteAction_UpgradeConfig *msg, upb_arena *arena) {
- struct envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig* sub = (struct envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig*)envoy_config_route_v3_RouteAction_UpgradeConfig_connect_config(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig*)_upb_msg_new(&envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_RouteAction_UpgradeConfig_set_connect_config(msg, sub);
- }
- return sub;
-}
-
-/* envoy.config.route.v3.RouteAction.UpgradeConfig.ConnectConfig */
-
-UPB_INLINE envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig *envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_new(upb_arena *arena) {
- return (envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig *)_upb_msg_new(&envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_msginit, arena);
-}
-UPB_INLINE envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig *envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig *ret = envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_serialize(const envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_has_proxy_protocol_config(const envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE const struct envoy_config_core_v3_ProxyProtocolConfig* envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_proxy_protocol_config(const envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct envoy_config_core_v3_ProxyProtocolConfig*); }
-
-UPB_INLINE void envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_set_proxy_protocol_config(envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig *msg, struct envoy_config_core_v3_ProxyProtocolConfig* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct envoy_config_core_v3_ProxyProtocolConfig*) = value;
-}
-UPB_INLINE struct envoy_config_core_v3_ProxyProtocolConfig* envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_mutable_proxy_protocol_config(envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig *msg, upb_arena *arena) {
- struct envoy_config_core_v3_ProxyProtocolConfig* sub = (struct envoy_config_core_v3_ProxyProtocolConfig*)envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_proxy_protocol_config(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_ProxyProtocolConfig*)_upb_msg_new(&envoy_config_core_v3_ProxyProtocolConfig_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_set_proxy_protocol_config(msg, sub);
- }
- return sub;
-}
-
-/* envoy.config.route.v3.RouteAction.MaxStreamDuration */
-
-UPB_INLINE envoy_config_route_v3_RouteAction_MaxStreamDuration *envoy_config_route_v3_RouteAction_MaxStreamDuration_new(upb_arena *arena) {
- return (envoy_config_route_v3_RouteAction_MaxStreamDuration *)_upb_msg_new(&envoy_config_route_v3_RouteAction_MaxStreamDuration_msginit, arena);
-}
-UPB_INLINE envoy_config_route_v3_RouteAction_MaxStreamDuration *envoy_config_route_v3_RouteAction_MaxStreamDuration_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_route_v3_RouteAction_MaxStreamDuration *ret = envoy_config_route_v3_RouteAction_MaxStreamDuration_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RouteAction_MaxStreamDuration_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_route_v3_RouteAction_MaxStreamDuration_serialize(const envoy_config_route_v3_RouteAction_MaxStreamDuration *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_route_v3_RouteAction_MaxStreamDuration_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_config_route_v3_RouteAction_MaxStreamDuration_has_max_stream_duration(const envoy_config_route_v3_RouteAction_MaxStreamDuration *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE const struct google_protobuf_Duration* envoy_config_route_v3_RouteAction_MaxStreamDuration_max_stream_duration(const envoy_config_route_v3_RouteAction_MaxStreamDuration *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct google_protobuf_Duration*); }
-UPB_INLINE bool envoy_config_route_v3_RouteAction_MaxStreamDuration_has_grpc_timeout_header_max(const envoy_config_route_v3_RouteAction_MaxStreamDuration *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
-UPB_INLINE const struct google_protobuf_Duration* envoy_config_route_v3_RouteAction_MaxStreamDuration_grpc_timeout_header_max(const envoy_config_route_v3_RouteAction_MaxStreamDuration *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_Duration*); }
-UPB_INLINE bool envoy_config_route_v3_RouteAction_MaxStreamDuration_has_grpc_timeout_header_offset(const envoy_config_route_v3_RouteAction_MaxStreamDuration *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const struct google_protobuf_Duration* envoy_config_route_v3_RouteAction_MaxStreamDuration_grpc_timeout_header_offset(const envoy_config_route_v3_RouteAction_MaxStreamDuration *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_Duration*); }
-
-UPB_INLINE void envoy_config_route_v3_RouteAction_MaxStreamDuration_set_max_stream_duration(envoy_config_route_v3_RouteAction_MaxStreamDuration *msg, struct google_protobuf_Duration* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct google_protobuf_Duration*) = value;
-}
-UPB_INLINE struct google_protobuf_Duration* envoy_config_route_v3_RouteAction_MaxStreamDuration_mutable_max_stream_duration(envoy_config_route_v3_RouteAction_MaxStreamDuration *msg, upb_arena *arena) {
- struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_route_v3_RouteAction_MaxStreamDuration_max_stream_duration(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_RouteAction_MaxStreamDuration_set_max_stream_duration(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_route_v3_RouteAction_MaxStreamDuration_set_grpc_timeout_header_max(envoy_config_route_v3_RouteAction_MaxStreamDuration *msg, struct google_protobuf_Duration* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_Duration*) = value;
-}
-UPB_INLINE struct google_protobuf_Duration* envoy_config_route_v3_RouteAction_MaxStreamDuration_mutable_grpc_timeout_header_max(envoy_config_route_v3_RouteAction_MaxStreamDuration *msg, upb_arena *arena) {
- struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_route_v3_RouteAction_MaxStreamDuration_grpc_timeout_header_max(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_RouteAction_MaxStreamDuration_set_grpc_timeout_header_max(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_route_v3_RouteAction_MaxStreamDuration_set_grpc_timeout_header_offset(envoy_config_route_v3_RouteAction_MaxStreamDuration *msg, struct google_protobuf_Duration* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_Duration*) = value;
-}
-UPB_INLINE struct google_protobuf_Duration* envoy_config_route_v3_RouteAction_MaxStreamDuration_mutable_grpc_timeout_header_offset(envoy_config_route_v3_RouteAction_MaxStreamDuration *msg, upb_arena *arena) {
- struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_route_v3_RouteAction_MaxStreamDuration_grpc_timeout_header_offset(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_RouteAction_MaxStreamDuration_set_grpc_timeout_header_offset(msg, sub);
- }
- return sub;
-}
-
-/* envoy.config.route.v3.RetryPolicy */
-
-UPB_INLINE envoy_config_route_v3_RetryPolicy *envoy_config_route_v3_RetryPolicy_new(upb_arena *arena) {
- return (envoy_config_route_v3_RetryPolicy *)_upb_msg_new(&envoy_config_route_v3_RetryPolicy_msginit, arena);
-}
-UPB_INLINE envoy_config_route_v3_RetryPolicy *envoy_config_route_v3_RetryPolicy_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_route_v3_RetryPolicy *ret = envoy_config_route_v3_RetryPolicy_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RetryPolicy_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_route_v3_RetryPolicy_serialize(const envoy_config_route_v3_RetryPolicy *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_route_v3_RetryPolicy_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview envoy_config_route_v3_RetryPolicy_retry_on(const envoy_config_route_v3_RetryPolicy *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview); }
-UPB_INLINE bool envoy_config_route_v3_RetryPolicy_has_num_retries(const envoy_config_route_v3_RetryPolicy *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 24)); }
-UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_route_v3_RetryPolicy_num_retries(const envoy_config_route_v3_RetryPolicy *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const struct google_protobuf_UInt32Value*); }
-UPB_INLINE bool envoy_config_route_v3_RetryPolicy_has_per_try_timeout(const envoy_config_route_v3_RetryPolicy *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 32)); }
-UPB_INLINE const struct google_protobuf_Duration* envoy_config_route_v3_RetryPolicy_per_try_timeout(const envoy_config_route_v3_RetryPolicy *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const struct google_protobuf_Duration*); }
-UPB_INLINE bool envoy_config_route_v3_RetryPolicy_has_retry_priority(const envoy_config_route_v3_RetryPolicy *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 40)); }
-UPB_INLINE const envoy_config_route_v3_RetryPolicy_RetryPriority* envoy_config_route_v3_RetryPolicy_retry_priority(const envoy_config_route_v3_RetryPolicy *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const envoy_config_route_v3_RetryPolicy_RetryPriority*); }
-UPB_INLINE bool envoy_config_route_v3_RetryPolicy_has_retry_host_predicate(const envoy_config_route_v3_RetryPolicy *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(36, 64)); }
-UPB_INLINE const envoy_config_route_v3_RetryPolicy_RetryHostPredicate* const* envoy_config_route_v3_RetryPolicy_retry_host_predicate(const envoy_config_route_v3_RetryPolicy *msg, size_t *len) { return (const envoy_config_route_v3_RetryPolicy_RetryHostPredicate* const*)_upb_array_accessor(msg, UPB_SIZE(36, 64), len); }
-UPB_INLINE int64_t envoy_config_route_v3_RetryPolicy_host_selection_retry_max_attempts(const envoy_config_route_v3_RetryPolicy *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int64_t); }
-UPB_INLINE uint32_t const* envoy_config_route_v3_RetryPolicy_retriable_status_codes(const envoy_config_route_v3_RetryPolicy *msg, size_t *len) { return (uint32_t const*)_upb_array_accessor(msg, UPB_SIZE(40, 72), len); }
-UPB_INLINE bool envoy_config_route_v3_RetryPolicy_has_retry_back_off(const envoy_config_route_v3_RetryPolicy *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 48)); }
-UPB_INLINE const envoy_config_route_v3_RetryPolicy_RetryBackOff* envoy_config_route_v3_RetryPolicy_retry_back_off(const envoy_config_route_v3_RetryPolicy *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 48), const envoy_config_route_v3_RetryPolicy_RetryBackOff*); }
-UPB_INLINE bool envoy_config_route_v3_RetryPolicy_has_retriable_headers(const envoy_config_route_v3_RetryPolicy *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(44, 80)); }
-UPB_INLINE const envoy_config_route_v3_HeaderMatcher* const* envoy_config_route_v3_RetryPolicy_retriable_headers(const envoy_config_route_v3_RetryPolicy *msg, size_t *len) { return (const envoy_config_route_v3_HeaderMatcher* const*)_upb_array_accessor(msg, UPB_SIZE(44, 80), len); }
-UPB_INLINE bool envoy_config_route_v3_RetryPolicy_has_retriable_request_headers(const envoy_config_route_v3_RetryPolicy *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(48, 88)); }
-UPB_INLINE const envoy_config_route_v3_HeaderMatcher* const* envoy_config_route_v3_RetryPolicy_retriable_request_headers(const envoy_config_route_v3_RetryPolicy *msg, size_t *len) { return (const envoy_config_route_v3_HeaderMatcher* const*)_upb_array_accessor(msg, UPB_SIZE(48, 88), len); }
-UPB_INLINE bool envoy_config_route_v3_RetryPolicy_has_rate_limited_retry_back_off(const envoy_config_route_v3_RetryPolicy *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(32, 56)); }
-UPB_INLINE const envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff* envoy_config_route_v3_RetryPolicy_rate_limited_retry_back_off(const envoy_config_route_v3_RetryPolicy *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 56), const envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff*); }
-
-UPB_INLINE void envoy_config_route_v3_RetryPolicy_set_retry_on(envoy_config_route_v3_RetryPolicy *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_route_v3_RetryPolicy_set_num_retries(envoy_config_route_v3_RetryPolicy *msg, struct google_protobuf_UInt32Value* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(16, 24), struct google_protobuf_UInt32Value*) = value;
-}
-UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_route_v3_RetryPolicy_mutable_num_retries(envoy_config_route_v3_RetryPolicy *msg, upb_arena *arena) {
- struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_route_v3_RetryPolicy_num_retries(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_RetryPolicy_set_num_retries(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_route_v3_RetryPolicy_set_per_try_timeout(envoy_config_route_v3_RetryPolicy *msg, struct google_protobuf_Duration* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(20, 32), struct google_protobuf_Duration*) = value;
-}
-UPB_INLINE struct google_protobuf_Duration* envoy_config_route_v3_RetryPolicy_mutable_per_try_timeout(envoy_config_route_v3_RetryPolicy *msg, upb_arena *arena) {
- struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_route_v3_RetryPolicy_per_try_timeout(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_RetryPolicy_set_per_try_timeout(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_route_v3_RetryPolicy_set_retry_priority(envoy_config_route_v3_RetryPolicy *msg, envoy_config_route_v3_RetryPolicy_RetryPriority* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(24, 40), envoy_config_route_v3_RetryPolicy_RetryPriority*) = value;
-}
-UPB_INLINE struct envoy_config_route_v3_RetryPolicy_RetryPriority* envoy_config_route_v3_RetryPolicy_mutable_retry_priority(envoy_config_route_v3_RetryPolicy *msg, upb_arena *arena) {
- struct envoy_config_route_v3_RetryPolicy_RetryPriority* sub = (struct envoy_config_route_v3_RetryPolicy_RetryPriority*)envoy_config_route_v3_RetryPolicy_retry_priority(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_route_v3_RetryPolicy_RetryPriority*)_upb_msg_new(&envoy_config_route_v3_RetryPolicy_RetryPriority_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_RetryPolicy_set_retry_priority(msg, sub);
- }
- return sub;
-}
-UPB_INLINE envoy_config_route_v3_RetryPolicy_RetryHostPredicate** envoy_config_route_v3_RetryPolicy_mutable_retry_host_predicate(envoy_config_route_v3_RetryPolicy *msg, size_t *len) {
- return (envoy_config_route_v3_RetryPolicy_RetryHostPredicate**)_upb_array_mutable_accessor(msg, UPB_SIZE(36, 64), len);
-}
-UPB_INLINE envoy_config_route_v3_RetryPolicy_RetryHostPredicate** envoy_config_route_v3_RetryPolicy_resize_retry_host_predicate(envoy_config_route_v3_RetryPolicy *msg, size_t len, upb_arena *arena) {
- return (envoy_config_route_v3_RetryPolicy_RetryHostPredicate**)_upb_array_resize_accessor(msg, UPB_SIZE(36, 64), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_config_route_v3_RetryPolicy_RetryHostPredicate* envoy_config_route_v3_RetryPolicy_add_retry_host_predicate(envoy_config_route_v3_RetryPolicy *msg, upb_arena *arena) {
- struct envoy_config_route_v3_RetryPolicy_RetryHostPredicate* sub = (struct envoy_config_route_v3_RetryPolicy_RetryHostPredicate*)_upb_msg_new(&envoy_config_route_v3_RetryPolicy_RetryHostPredicate_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(36, 64), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-UPB_INLINE void envoy_config_route_v3_RetryPolicy_set_host_selection_retry_max_attempts(envoy_config_route_v3_RetryPolicy *msg, int64_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int64_t) = value;
-}
-UPB_INLINE uint32_t* envoy_config_route_v3_RetryPolicy_mutable_retriable_status_codes(envoy_config_route_v3_RetryPolicy *msg, size_t *len) {
- return (uint32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(40, 72), len);
-}
-UPB_INLINE uint32_t* envoy_config_route_v3_RetryPolicy_resize_retriable_status_codes(envoy_config_route_v3_RetryPolicy *msg, size_t len, upb_arena *arena) {
- return (uint32_t*)_upb_array_resize_accessor(msg, UPB_SIZE(40, 72), len, UPB_TYPE_UINT32, arena);
-}
-UPB_INLINE bool envoy_config_route_v3_RetryPolicy_add_retriable_status_codes(envoy_config_route_v3_RetryPolicy *msg, uint32_t val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(40, 72), UPB_SIZE(4, 4), UPB_TYPE_UINT32, &val,
- arena);
-}
-UPB_INLINE void envoy_config_route_v3_RetryPolicy_set_retry_back_off(envoy_config_route_v3_RetryPolicy *msg, envoy_config_route_v3_RetryPolicy_RetryBackOff* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(28, 48), envoy_config_route_v3_RetryPolicy_RetryBackOff*) = value;
-}
-UPB_INLINE struct envoy_config_route_v3_RetryPolicy_RetryBackOff* envoy_config_route_v3_RetryPolicy_mutable_retry_back_off(envoy_config_route_v3_RetryPolicy *msg, upb_arena *arena) {
- struct envoy_config_route_v3_RetryPolicy_RetryBackOff* sub = (struct envoy_config_route_v3_RetryPolicy_RetryBackOff*)envoy_config_route_v3_RetryPolicy_retry_back_off(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_route_v3_RetryPolicy_RetryBackOff*)_upb_msg_new(&envoy_config_route_v3_RetryPolicy_RetryBackOff_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_RetryPolicy_set_retry_back_off(msg, sub);
- }
- return sub;
-}
-UPB_INLINE envoy_config_route_v3_HeaderMatcher** envoy_config_route_v3_RetryPolicy_mutable_retriable_headers(envoy_config_route_v3_RetryPolicy *msg, size_t *len) {
- return (envoy_config_route_v3_HeaderMatcher**)_upb_array_mutable_accessor(msg, UPB_SIZE(44, 80), len);
-}
-UPB_INLINE envoy_config_route_v3_HeaderMatcher** envoy_config_route_v3_RetryPolicy_resize_retriable_headers(envoy_config_route_v3_RetryPolicy *msg, size_t len, upb_arena *arena) {
- return (envoy_config_route_v3_HeaderMatcher**)_upb_array_resize_accessor(msg, UPB_SIZE(44, 80), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_config_route_v3_HeaderMatcher* envoy_config_route_v3_RetryPolicy_add_retriable_headers(envoy_config_route_v3_RetryPolicy *msg, upb_arena *arena) {
- struct envoy_config_route_v3_HeaderMatcher* sub = (struct envoy_config_route_v3_HeaderMatcher*)_upb_msg_new(&envoy_config_route_v3_HeaderMatcher_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(44, 80), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-UPB_INLINE envoy_config_route_v3_HeaderMatcher** envoy_config_route_v3_RetryPolicy_mutable_retriable_request_headers(envoy_config_route_v3_RetryPolicy *msg, size_t *len) {
- return (envoy_config_route_v3_HeaderMatcher**)_upb_array_mutable_accessor(msg, UPB_SIZE(48, 88), len);
-}
-UPB_INLINE envoy_config_route_v3_HeaderMatcher** envoy_config_route_v3_RetryPolicy_resize_retriable_request_headers(envoy_config_route_v3_RetryPolicy *msg, size_t len, upb_arena *arena) {
- return (envoy_config_route_v3_HeaderMatcher**)_upb_array_resize_accessor(msg, UPB_SIZE(48, 88), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_config_route_v3_HeaderMatcher* envoy_config_route_v3_RetryPolicy_add_retriable_request_headers(envoy_config_route_v3_RetryPolicy *msg, upb_arena *arena) {
- struct envoy_config_route_v3_HeaderMatcher* sub = (struct envoy_config_route_v3_HeaderMatcher*)_upb_msg_new(&envoy_config_route_v3_HeaderMatcher_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(48, 88), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-UPB_INLINE void envoy_config_route_v3_RetryPolicy_set_rate_limited_retry_back_off(envoy_config_route_v3_RetryPolicy *msg, envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(32, 56), envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff*) = value;
-}
-UPB_INLINE struct envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff* envoy_config_route_v3_RetryPolicy_mutable_rate_limited_retry_back_off(envoy_config_route_v3_RetryPolicy *msg, upb_arena *arena) {
- struct envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff* sub = (struct envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff*)envoy_config_route_v3_RetryPolicy_rate_limited_retry_back_off(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff*)_upb_msg_new(&envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_RetryPolicy_set_rate_limited_retry_back_off(msg, sub);
- }
- return sub;
-}
-
-/* envoy.config.route.v3.RetryPolicy.RetryPriority */
-
-UPB_INLINE envoy_config_route_v3_RetryPolicy_RetryPriority *envoy_config_route_v3_RetryPolicy_RetryPriority_new(upb_arena *arena) {
- return (envoy_config_route_v3_RetryPolicy_RetryPriority *)_upb_msg_new(&envoy_config_route_v3_RetryPolicy_RetryPriority_msginit, arena);
-}
-UPB_INLINE envoy_config_route_v3_RetryPolicy_RetryPriority *envoy_config_route_v3_RetryPolicy_RetryPriority_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_route_v3_RetryPolicy_RetryPriority *ret = envoy_config_route_v3_RetryPolicy_RetryPriority_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RetryPolicy_RetryPriority_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_route_v3_RetryPolicy_RetryPriority_serialize(const envoy_config_route_v3_RetryPolicy_RetryPriority *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_route_v3_RetryPolicy_RetryPriority_msginit, arena, len);
-}
-
-typedef enum {
- envoy_config_route_v3_RetryPolicy_RetryPriority_config_type_typed_config = 3,
- envoy_config_route_v3_RetryPolicy_RetryPriority_config_type_NOT_SET = 0
-} envoy_config_route_v3_RetryPolicy_RetryPriority_config_type_oneofcases;
-UPB_INLINE envoy_config_route_v3_RetryPolicy_RetryPriority_config_type_oneofcases envoy_config_route_v3_RetryPolicy_RetryPriority_config_type_case(const envoy_config_route_v3_RetryPolicy_RetryPriority* msg) { return (envoy_config_route_v3_RetryPolicy_RetryPriority_config_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(12, 24), int32_t); }
-
-UPB_INLINE upb_strview envoy_config_route_v3_RetryPolicy_RetryPriority_name(const envoy_config_route_v3_RetryPolicy_RetryPriority *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE bool envoy_config_route_v3_RetryPolicy_RetryPriority_has_typed_config(const envoy_config_route_v3_RetryPolicy_RetryPriority *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 3; }
-UPB_INLINE const struct google_protobuf_Any* envoy_config_route_v3_RetryPolicy_RetryPriority_typed_config(const envoy_config_route_v3_RetryPolicy_RetryPriority *msg) { return UPB_READ_ONEOF(msg, const struct google_protobuf_Any*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 3, NULL); }
-
-UPB_INLINE void envoy_config_route_v3_RetryPolicy_RetryPriority_set_name(envoy_config_route_v3_RetryPolicy_RetryPriority *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_route_v3_RetryPolicy_RetryPriority_set_typed_config(envoy_config_route_v3_RetryPolicy_RetryPriority *msg, struct google_protobuf_Any* value) {
- UPB_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 3);
-}
-UPB_INLINE struct google_protobuf_Any* envoy_config_route_v3_RetryPolicy_RetryPriority_mutable_typed_config(envoy_config_route_v3_RetryPolicy_RetryPriority *msg, upb_arena *arena) {
- struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_config_route_v3_RetryPolicy_RetryPriority_typed_config(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_RetryPolicy_RetryPriority_set_typed_config(msg, sub);
- }
- return sub;
-}
-
-/* envoy.config.route.v3.RetryPolicy.RetryHostPredicate */
-
-UPB_INLINE envoy_config_route_v3_RetryPolicy_RetryHostPredicate *envoy_config_route_v3_RetryPolicy_RetryHostPredicate_new(upb_arena *arena) {
- return (envoy_config_route_v3_RetryPolicy_RetryHostPredicate *)_upb_msg_new(&envoy_config_route_v3_RetryPolicy_RetryHostPredicate_msginit, arena);
-}
-UPB_INLINE envoy_config_route_v3_RetryPolicy_RetryHostPredicate *envoy_config_route_v3_RetryPolicy_RetryHostPredicate_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_route_v3_RetryPolicy_RetryHostPredicate *ret = envoy_config_route_v3_RetryPolicy_RetryHostPredicate_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RetryPolicy_RetryHostPredicate_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_route_v3_RetryPolicy_RetryHostPredicate_serialize(const envoy_config_route_v3_RetryPolicy_RetryHostPredicate *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_route_v3_RetryPolicy_RetryHostPredicate_msginit, arena, len);
-}
-
-typedef enum {
- envoy_config_route_v3_RetryPolicy_RetryHostPredicate_config_type_typed_config = 3,
- envoy_config_route_v3_RetryPolicy_RetryHostPredicate_config_type_NOT_SET = 0
-} envoy_config_route_v3_RetryPolicy_RetryHostPredicate_config_type_oneofcases;
-UPB_INLINE envoy_config_route_v3_RetryPolicy_RetryHostPredicate_config_type_oneofcases envoy_config_route_v3_RetryPolicy_RetryHostPredicate_config_type_case(const envoy_config_route_v3_RetryPolicy_RetryHostPredicate* msg) { return (envoy_config_route_v3_RetryPolicy_RetryHostPredicate_config_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(12, 24), int32_t); }
-
-UPB_INLINE upb_strview envoy_config_route_v3_RetryPolicy_RetryHostPredicate_name(const envoy_config_route_v3_RetryPolicy_RetryHostPredicate *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE bool envoy_config_route_v3_RetryPolicy_RetryHostPredicate_has_typed_config(const envoy_config_route_v3_RetryPolicy_RetryHostPredicate *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 3; }
-UPB_INLINE const struct google_protobuf_Any* envoy_config_route_v3_RetryPolicy_RetryHostPredicate_typed_config(const envoy_config_route_v3_RetryPolicy_RetryHostPredicate *msg) { return UPB_READ_ONEOF(msg, const struct google_protobuf_Any*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 3, NULL); }
-
-UPB_INLINE void envoy_config_route_v3_RetryPolicy_RetryHostPredicate_set_name(envoy_config_route_v3_RetryPolicy_RetryHostPredicate *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_route_v3_RetryPolicy_RetryHostPredicate_set_typed_config(envoy_config_route_v3_RetryPolicy_RetryHostPredicate *msg, struct google_protobuf_Any* value) {
- UPB_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 3);
-}
-UPB_INLINE struct google_protobuf_Any* envoy_config_route_v3_RetryPolicy_RetryHostPredicate_mutable_typed_config(envoy_config_route_v3_RetryPolicy_RetryHostPredicate *msg, upb_arena *arena) {
- struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_config_route_v3_RetryPolicy_RetryHostPredicate_typed_config(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_RetryPolicy_RetryHostPredicate_set_typed_config(msg, sub);
- }
- return sub;
-}
-
-/* envoy.config.route.v3.RetryPolicy.RetryBackOff */
-
-UPB_INLINE envoy_config_route_v3_RetryPolicy_RetryBackOff *envoy_config_route_v3_RetryPolicy_RetryBackOff_new(upb_arena *arena) {
- return (envoy_config_route_v3_RetryPolicy_RetryBackOff *)_upb_msg_new(&envoy_config_route_v3_RetryPolicy_RetryBackOff_msginit, arena);
-}
-UPB_INLINE envoy_config_route_v3_RetryPolicy_RetryBackOff *envoy_config_route_v3_RetryPolicy_RetryBackOff_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_route_v3_RetryPolicy_RetryBackOff *ret = envoy_config_route_v3_RetryPolicy_RetryBackOff_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RetryPolicy_RetryBackOff_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_route_v3_RetryPolicy_RetryBackOff_serialize(const envoy_config_route_v3_RetryPolicy_RetryBackOff *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_route_v3_RetryPolicy_RetryBackOff_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_config_route_v3_RetryPolicy_RetryBackOff_has_base_interval(const envoy_config_route_v3_RetryPolicy_RetryBackOff *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE const struct google_protobuf_Duration* envoy_config_route_v3_RetryPolicy_RetryBackOff_base_interval(const envoy_config_route_v3_RetryPolicy_RetryBackOff *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct google_protobuf_Duration*); }
-UPB_INLINE bool envoy_config_route_v3_RetryPolicy_RetryBackOff_has_max_interval(const envoy_config_route_v3_RetryPolicy_RetryBackOff *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
-UPB_INLINE const struct google_protobuf_Duration* envoy_config_route_v3_RetryPolicy_RetryBackOff_max_interval(const envoy_config_route_v3_RetryPolicy_RetryBackOff *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_Duration*); }
-
-UPB_INLINE void envoy_config_route_v3_RetryPolicy_RetryBackOff_set_base_interval(envoy_config_route_v3_RetryPolicy_RetryBackOff *msg, struct google_protobuf_Duration* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct google_protobuf_Duration*) = value;
-}
-UPB_INLINE struct google_protobuf_Duration* envoy_config_route_v3_RetryPolicy_RetryBackOff_mutable_base_interval(envoy_config_route_v3_RetryPolicy_RetryBackOff *msg, upb_arena *arena) {
- struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_route_v3_RetryPolicy_RetryBackOff_base_interval(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_RetryPolicy_RetryBackOff_set_base_interval(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_route_v3_RetryPolicy_RetryBackOff_set_max_interval(envoy_config_route_v3_RetryPolicy_RetryBackOff *msg, struct google_protobuf_Duration* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_Duration*) = value;
-}
-UPB_INLINE struct google_protobuf_Duration* envoy_config_route_v3_RetryPolicy_RetryBackOff_mutable_max_interval(envoy_config_route_v3_RetryPolicy_RetryBackOff *msg, upb_arena *arena) {
- struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_route_v3_RetryPolicy_RetryBackOff_max_interval(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_RetryPolicy_RetryBackOff_set_max_interval(msg, sub);
- }
- return sub;
-}
-
-/* envoy.config.route.v3.RetryPolicy.ResetHeader */
-
-UPB_INLINE envoy_config_route_v3_RetryPolicy_ResetHeader *envoy_config_route_v3_RetryPolicy_ResetHeader_new(upb_arena *arena) {
- return (envoy_config_route_v3_RetryPolicy_ResetHeader *)_upb_msg_new(&envoy_config_route_v3_RetryPolicy_ResetHeader_msginit, arena);
-}
-UPB_INLINE envoy_config_route_v3_RetryPolicy_ResetHeader *envoy_config_route_v3_RetryPolicy_ResetHeader_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_route_v3_RetryPolicy_ResetHeader *ret = envoy_config_route_v3_RetryPolicy_ResetHeader_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RetryPolicy_ResetHeader_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_route_v3_RetryPolicy_ResetHeader_serialize(const envoy_config_route_v3_RetryPolicy_ResetHeader *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_route_v3_RetryPolicy_ResetHeader_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview envoy_config_route_v3_RetryPolicy_ResetHeader_name(const envoy_config_route_v3_RetryPolicy_ResetHeader *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview); }
-UPB_INLINE int32_t envoy_config_route_v3_RetryPolicy_ResetHeader_format(const envoy_config_route_v3_RetryPolicy_ResetHeader *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
-
-UPB_INLINE void envoy_config_route_v3_RetryPolicy_ResetHeader_set_name(envoy_config_route_v3_RetryPolicy_ResetHeader *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_route_v3_RetryPolicy_ResetHeader_set_format(envoy_config_route_v3_RetryPolicy_ResetHeader *msg, int32_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
-}
-
-/* envoy.config.route.v3.RetryPolicy.RateLimitedRetryBackOff */
-
-UPB_INLINE envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff *envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_new(upb_arena *arena) {
- return (envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff *)_upb_msg_new(&envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_msginit, arena);
-}
-UPB_INLINE envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff *envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff *ret = envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_serialize(const envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_has_reset_headers(const envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
-UPB_INLINE const envoy_config_route_v3_RetryPolicy_ResetHeader* const* envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_reset_headers(const envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff *msg, size_t *len) { return (const envoy_config_route_v3_RetryPolicy_ResetHeader* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len); }
-UPB_INLINE bool envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_has_max_interval(const envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE const struct google_protobuf_Duration* envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_max_interval(const envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct google_protobuf_Duration*); }
-
-UPB_INLINE envoy_config_route_v3_RetryPolicy_ResetHeader** envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_mutable_reset_headers(envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff *msg, size_t *len) {
- return (envoy_config_route_v3_RetryPolicy_ResetHeader**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len);
-}
-UPB_INLINE envoy_config_route_v3_RetryPolicy_ResetHeader** envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_resize_reset_headers(envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff *msg, size_t len, upb_arena *arena) {
- return (envoy_config_route_v3_RetryPolicy_ResetHeader**)_upb_array_resize_accessor(msg, UPB_SIZE(4, 8), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_config_route_v3_RetryPolicy_ResetHeader* envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_add_reset_headers(envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff *msg, upb_arena *arena) {
- struct envoy_config_route_v3_RetryPolicy_ResetHeader* sub = (struct envoy_config_route_v3_RetryPolicy_ResetHeader*)_upb_msg_new(&envoy_config_route_v3_RetryPolicy_ResetHeader_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(4, 8), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-UPB_INLINE void envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_set_max_interval(envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff *msg, struct google_protobuf_Duration* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct google_protobuf_Duration*) = value;
-}
-UPB_INLINE struct google_protobuf_Duration* envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_mutable_max_interval(envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff *msg, upb_arena *arena) {
- struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_max_interval(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_set_max_interval(msg, sub);
- }
- return sub;
-}
-
-/* envoy.config.route.v3.HedgePolicy */
-
-UPB_INLINE envoy_config_route_v3_HedgePolicy *envoy_config_route_v3_HedgePolicy_new(upb_arena *arena) {
- return (envoy_config_route_v3_HedgePolicy *)_upb_msg_new(&envoy_config_route_v3_HedgePolicy_msginit, arena);
-}
-UPB_INLINE envoy_config_route_v3_HedgePolicy *envoy_config_route_v3_HedgePolicy_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_route_v3_HedgePolicy *ret = envoy_config_route_v3_HedgePolicy_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_HedgePolicy_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_route_v3_HedgePolicy_serialize(const envoy_config_route_v3_HedgePolicy *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_route_v3_HedgePolicy_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_config_route_v3_HedgePolicy_has_initial_requests(const envoy_config_route_v3_HedgePolicy *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
-UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_route_v3_HedgePolicy_initial_requests(const envoy_config_route_v3_HedgePolicy *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_UInt32Value*); }
-UPB_INLINE bool envoy_config_route_v3_HedgePolicy_has_additional_request_chance(const envoy_config_route_v3_HedgePolicy *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const struct envoy_type_v3_FractionalPercent* envoy_config_route_v3_HedgePolicy_additional_request_chance(const envoy_config_route_v3_HedgePolicy *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct envoy_type_v3_FractionalPercent*); }
-UPB_INLINE bool envoy_config_route_v3_HedgePolicy_hedge_on_per_try_timeout(const envoy_config_route_v3_HedgePolicy *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); }
-
-UPB_INLINE void envoy_config_route_v3_HedgePolicy_set_initial_requests(envoy_config_route_v3_HedgePolicy *msg, struct google_protobuf_UInt32Value* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_UInt32Value*) = value;
-}
-UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_route_v3_HedgePolicy_mutable_initial_requests(envoy_config_route_v3_HedgePolicy *msg, upb_arena *arena) {
- struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_route_v3_HedgePolicy_initial_requests(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_HedgePolicy_set_initial_requests(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_route_v3_HedgePolicy_set_additional_request_chance(envoy_config_route_v3_HedgePolicy *msg, struct envoy_type_v3_FractionalPercent* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct envoy_type_v3_FractionalPercent*) = value;
-}
-UPB_INLINE struct envoy_type_v3_FractionalPercent* envoy_config_route_v3_HedgePolicy_mutable_additional_request_chance(envoy_config_route_v3_HedgePolicy *msg, upb_arena *arena) {
- struct envoy_type_v3_FractionalPercent* sub = (struct envoy_type_v3_FractionalPercent*)envoy_config_route_v3_HedgePolicy_additional_request_chance(msg);
- if (sub == NULL) {
- sub = (struct envoy_type_v3_FractionalPercent*)_upb_msg_new(&envoy_type_v3_FractionalPercent_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_HedgePolicy_set_additional_request_chance(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_route_v3_HedgePolicy_set_hedge_on_per_try_timeout(envoy_config_route_v3_HedgePolicy *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
-}
-
-/* envoy.config.route.v3.RedirectAction */
-
-UPB_INLINE envoy_config_route_v3_RedirectAction *envoy_config_route_v3_RedirectAction_new(upb_arena *arena) {
- return (envoy_config_route_v3_RedirectAction *)_upb_msg_new(&envoy_config_route_v3_RedirectAction_msginit, arena);
-}
-UPB_INLINE envoy_config_route_v3_RedirectAction *envoy_config_route_v3_RedirectAction_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_route_v3_RedirectAction *ret = envoy_config_route_v3_RedirectAction_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RedirectAction_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_route_v3_RedirectAction_serialize(const envoy_config_route_v3_RedirectAction *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_route_v3_RedirectAction_msginit, arena, len);
-}
-
-typedef enum {
- envoy_config_route_v3_RedirectAction_scheme_rewrite_specifier_https_redirect = 4,
- envoy_config_route_v3_RedirectAction_scheme_rewrite_specifier_scheme_redirect = 7,
- envoy_config_route_v3_RedirectAction_scheme_rewrite_specifier_NOT_SET = 0
-} envoy_config_route_v3_RedirectAction_scheme_rewrite_specifier_oneofcases;
-UPB_INLINE envoy_config_route_v3_RedirectAction_scheme_rewrite_specifier_oneofcases envoy_config_route_v3_RedirectAction_scheme_rewrite_specifier_case(const envoy_config_route_v3_RedirectAction* msg) { return (envoy_config_route_v3_RedirectAction_scheme_rewrite_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(44, 72), int32_t); }
-
-typedef enum {
- envoy_config_route_v3_RedirectAction_path_rewrite_specifier_path_redirect = 2,
- envoy_config_route_v3_RedirectAction_path_rewrite_specifier_prefix_rewrite = 5,
- envoy_config_route_v3_RedirectAction_path_rewrite_specifier_NOT_SET = 0
-} envoy_config_route_v3_RedirectAction_path_rewrite_specifier_oneofcases;
-UPB_INLINE envoy_config_route_v3_RedirectAction_path_rewrite_specifier_oneofcases envoy_config_route_v3_RedirectAction_path_rewrite_specifier_case(const envoy_config_route_v3_RedirectAction* msg) { return (envoy_config_route_v3_RedirectAction_path_rewrite_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(32, 48), int32_t); }
-
-UPB_INLINE upb_strview envoy_config_route_v3_RedirectAction_host_redirect(const envoy_config_route_v3_RedirectAction *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), upb_strview); }
-UPB_INLINE bool envoy_config_route_v3_RedirectAction_has_path_redirect(const envoy_config_route_v3_RedirectAction *msg) { return _upb_getoneofcase(msg, UPB_SIZE(32, 48)) == 2; }
-UPB_INLINE upb_strview envoy_config_route_v3_RedirectAction_path_redirect(const envoy_config_route_v3_RedirectAction *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(24, 32), UPB_SIZE(32, 48), 2, upb_strview_make("", strlen(""))); }
-UPB_INLINE int32_t envoy_config_route_v3_RedirectAction_response_code(const envoy_config_route_v3_RedirectAction *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
-UPB_INLINE bool envoy_config_route_v3_RedirectAction_has_https_redirect(const envoy_config_route_v3_RedirectAction *msg) { return _upb_getoneofcase(msg, UPB_SIZE(44, 72)) == 4; }
-UPB_INLINE bool envoy_config_route_v3_RedirectAction_https_redirect(const envoy_config_route_v3_RedirectAction *msg) { return UPB_READ_ONEOF(msg, bool, UPB_SIZE(36, 56), UPB_SIZE(44, 72), 4, false); }
-UPB_INLINE bool envoy_config_route_v3_RedirectAction_has_prefix_rewrite(const envoy_config_route_v3_RedirectAction *msg) { return _upb_getoneofcase(msg, UPB_SIZE(32, 48)) == 5; }
-UPB_INLINE upb_strview envoy_config_route_v3_RedirectAction_prefix_rewrite(const envoy_config_route_v3_RedirectAction *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(24, 32), UPB_SIZE(32, 48), 5, upb_strview_make("", strlen(""))); }
-UPB_INLINE bool envoy_config_route_v3_RedirectAction_strip_query(const envoy_config_route_v3_RedirectAction *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 12), bool); }
-UPB_INLINE bool envoy_config_route_v3_RedirectAction_has_scheme_redirect(const envoy_config_route_v3_RedirectAction *msg) { return _upb_getoneofcase(msg, UPB_SIZE(44, 72)) == 7; }
-UPB_INLINE upb_strview envoy_config_route_v3_RedirectAction_scheme_redirect(const envoy_config_route_v3_RedirectAction *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(36, 56), UPB_SIZE(44, 72), 7, upb_strview_make("", strlen(""))); }
-UPB_INLINE uint32_t envoy_config_route_v3_RedirectAction_port_redirect(const envoy_config_route_v3_RedirectAction *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint32_t); }
-
-UPB_INLINE void envoy_config_route_v3_RedirectAction_set_host_redirect(envoy_config_route_v3_RedirectAction *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(16, 16), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_route_v3_RedirectAction_set_path_redirect(envoy_config_route_v3_RedirectAction *msg, upb_strview value) {
- UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(24, 32), value, UPB_SIZE(32, 48), 2);
-}
-UPB_INLINE void envoy_config_route_v3_RedirectAction_set_response_code(envoy_config_route_v3_RedirectAction *msg, int32_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
-}
-UPB_INLINE void envoy_config_route_v3_RedirectAction_set_https_redirect(envoy_config_route_v3_RedirectAction *msg, bool value) {
- UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(36, 56), value, UPB_SIZE(44, 72), 4);
-}
-UPB_INLINE void envoy_config_route_v3_RedirectAction_set_prefix_rewrite(envoy_config_route_v3_RedirectAction *msg, upb_strview value) {
- UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(24, 32), value, UPB_SIZE(32, 48), 5);
-}
-UPB_INLINE void envoy_config_route_v3_RedirectAction_set_strip_query(envoy_config_route_v3_RedirectAction *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(12, 12), bool) = value;
-}
-UPB_INLINE void envoy_config_route_v3_RedirectAction_set_scheme_redirect(envoy_config_route_v3_RedirectAction *msg, upb_strview value) {
- UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(36, 56), value, UPB_SIZE(44, 72), 7);
-}
-UPB_INLINE void envoy_config_route_v3_RedirectAction_set_port_redirect(envoy_config_route_v3_RedirectAction *msg, uint32_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint32_t) = value;
-}
-
-/* envoy.config.route.v3.DirectResponseAction */
-
-UPB_INLINE envoy_config_route_v3_DirectResponseAction *envoy_config_route_v3_DirectResponseAction_new(upb_arena *arena) {
- return (envoy_config_route_v3_DirectResponseAction *)_upb_msg_new(&envoy_config_route_v3_DirectResponseAction_msginit, arena);
-}
-UPB_INLINE envoy_config_route_v3_DirectResponseAction *envoy_config_route_v3_DirectResponseAction_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_route_v3_DirectResponseAction *ret = envoy_config_route_v3_DirectResponseAction_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_DirectResponseAction_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_route_v3_DirectResponseAction_serialize(const envoy_config_route_v3_DirectResponseAction *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_route_v3_DirectResponseAction_msginit, arena, len);
-}
-
-UPB_INLINE uint32_t envoy_config_route_v3_DirectResponseAction_status(const envoy_config_route_v3_DirectResponseAction *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t); }
-UPB_INLINE bool envoy_config_route_v3_DirectResponseAction_has_body(const envoy_config_route_v3_DirectResponseAction *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
-UPB_INLINE const struct envoy_config_core_v3_DataSource* envoy_config_route_v3_DirectResponseAction_body(const envoy_config_route_v3_DirectResponseAction *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_config_core_v3_DataSource*); }
-
-UPB_INLINE void envoy_config_route_v3_DirectResponseAction_set_status(envoy_config_route_v3_DirectResponseAction *msg, uint32_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t) = value;
-}
-UPB_INLINE void envoy_config_route_v3_DirectResponseAction_set_body(envoy_config_route_v3_DirectResponseAction *msg, struct envoy_config_core_v3_DataSource* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_config_core_v3_DataSource*) = value;
-}
-UPB_INLINE struct envoy_config_core_v3_DataSource* envoy_config_route_v3_DirectResponseAction_mutable_body(envoy_config_route_v3_DirectResponseAction *msg, upb_arena *arena) {
- struct envoy_config_core_v3_DataSource* sub = (struct envoy_config_core_v3_DataSource*)envoy_config_route_v3_DirectResponseAction_body(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_DataSource*)_upb_msg_new(&envoy_config_core_v3_DataSource_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_DirectResponseAction_set_body(msg, sub);
- }
- return sub;
-}
-
-/* envoy.config.route.v3.Decorator */
-
-UPB_INLINE envoy_config_route_v3_Decorator *envoy_config_route_v3_Decorator_new(upb_arena *arena) {
- return (envoy_config_route_v3_Decorator *)_upb_msg_new(&envoy_config_route_v3_Decorator_msginit, arena);
-}
-UPB_INLINE envoy_config_route_v3_Decorator *envoy_config_route_v3_Decorator_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_route_v3_Decorator *ret = envoy_config_route_v3_Decorator_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_Decorator_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_route_v3_Decorator_serialize(const envoy_config_route_v3_Decorator *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_route_v3_Decorator_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview envoy_config_route_v3_Decorator_operation(const envoy_config_route_v3_Decorator *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE bool envoy_config_route_v3_Decorator_has_propagate(const envoy_config_route_v3_Decorator *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_route_v3_Decorator_propagate(const envoy_config_route_v3_Decorator *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_BoolValue*); }
-
-UPB_INLINE void envoy_config_route_v3_Decorator_set_operation(envoy_config_route_v3_Decorator *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_route_v3_Decorator_set_propagate(envoy_config_route_v3_Decorator *msg, struct google_protobuf_BoolValue* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_BoolValue*) = value;
-}
-UPB_INLINE struct google_protobuf_BoolValue* envoy_config_route_v3_Decorator_mutable_propagate(envoy_config_route_v3_Decorator *msg, upb_arena *arena) {
- struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_route_v3_Decorator_propagate(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_BoolValue*)_upb_msg_new(&google_protobuf_BoolValue_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_Decorator_set_propagate(msg, sub);
- }
- return sub;
-}
-
-/* envoy.config.route.v3.Tracing */
-
-UPB_INLINE envoy_config_route_v3_Tracing *envoy_config_route_v3_Tracing_new(upb_arena *arena) {
- return (envoy_config_route_v3_Tracing *)_upb_msg_new(&envoy_config_route_v3_Tracing_msginit, arena);
-}
-UPB_INLINE envoy_config_route_v3_Tracing *envoy_config_route_v3_Tracing_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_route_v3_Tracing *ret = envoy_config_route_v3_Tracing_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_Tracing_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_route_v3_Tracing_serialize(const envoy_config_route_v3_Tracing *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_route_v3_Tracing_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_config_route_v3_Tracing_has_client_sampling(const envoy_config_route_v3_Tracing *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE const struct envoy_type_v3_FractionalPercent* envoy_config_route_v3_Tracing_client_sampling(const envoy_config_route_v3_Tracing *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct envoy_type_v3_FractionalPercent*); }
-UPB_INLINE bool envoy_config_route_v3_Tracing_has_random_sampling(const envoy_config_route_v3_Tracing *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
-UPB_INLINE const struct envoy_type_v3_FractionalPercent* envoy_config_route_v3_Tracing_random_sampling(const envoy_config_route_v3_Tracing *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_type_v3_FractionalPercent*); }
-UPB_INLINE bool envoy_config_route_v3_Tracing_has_overall_sampling(const envoy_config_route_v3_Tracing *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const struct envoy_type_v3_FractionalPercent* envoy_config_route_v3_Tracing_overall_sampling(const envoy_config_route_v3_Tracing *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct envoy_type_v3_FractionalPercent*); }
-UPB_INLINE bool envoy_config_route_v3_Tracing_has_custom_tags(const envoy_config_route_v3_Tracing *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
-UPB_INLINE const struct envoy_type_tracing_v3_CustomTag* const* envoy_config_route_v3_Tracing_custom_tags(const envoy_config_route_v3_Tracing *msg, size_t *len) { return (const struct envoy_type_tracing_v3_CustomTag* const*)_upb_array_accessor(msg, UPB_SIZE(12, 24), len); }
-
-UPB_INLINE void envoy_config_route_v3_Tracing_set_client_sampling(envoy_config_route_v3_Tracing *msg, struct envoy_type_v3_FractionalPercent* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct envoy_type_v3_FractionalPercent*) = value;
-}
-UPB_INLINE struct envoy_type_v3_FractionalPercent* envoy_config_route_v3_Tracing_mutable_client_sampling(envoy_config_route_v3_Tracing *msg, upb_arena *arena) {
- struct envoy_type_v3_FractionalPercent* sub = (struct envoy_type_v3_FractionalPercent*)envoy_config_route_v3_Tracing_client_sampling(msg);
- if (sub == NULL) {
- sub = (struct envoy_type_v3_FractionalPercent*)_upb_msg_new(&envoy_type_v3_FractionalPercent_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_Tracing_set_client_sampling(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_route_v3_Tracing_set_random_sampling(envoy_config_route_v3_Tracing *msg, struct envoy_type_v3_FractionalPercent* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_type_v3_FractionalPercent*) = value;
-}
-UPB_INLINE struct envoy_type_v3_FractionalPercent* envoy_config_route_v3_Tracing_mutable_random_sampling(envoy_config_route_v3_Tracing *msg, upb_arena *arena) {
- struct envoy_type_v3_FractionalPercent* sub = (struct envoy_type_v3_FractionalPercent*)envoy_config_route_v3_Tracing_random_sampling(msg);
- if (sub == NULL) {
- sub = (struct envoy_type_v3_FractionalPercent*)_upb_msg_new(&envoy_type_v3_FractionalPercent_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_Tracing_set_random_sampling(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_route_v3_Tracing_set_overall_sampling(envoy_config_route_v3_Tracing *msg, struct envoy_type_v3_FractionalPercent* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct envoy_type_v3_FractionalPercent*) = value;
-}
-UPB_INLINE struct envoy_type_v3_FractionalPercent* envoy_config_route_v3_Tracing_mutable_overall_sampling(envoy_config_route_v3_Tracing *msg, upb_arena *arena) {
- struct envoy_type_v3_FractionalPercent* sub = (struct envoy_type_v3_FractionalPercent*)envoy_config_route_v3_Tracing_overall_sampling(msg);
- if (sub == NULL) {
- sub = (struct envoy_type_v3_FractionalPercent*)_upb_msg_new(&envoy_type_v3_FractionalPercent_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_Tracing_set_overall_sampling(msg, sub);
- }
- return sub;
-}
-UPB_INLINE struct envoy_type_tracing_v3_CustomTag** envoy_config_route_v3_Tracing_mutable_custom_tags(envoy_config_route_v3_Tracing *msg, size_t *len) {
- return (struct envoy_type_tracing_v3_CustomTag**)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 24), len);
-}
-UPB_INLINE struct envoy_type_tracing_v3_CustomTag** envoy_config_route_v3_Tracing_resize_custom_tags(envoy_config_route_v3_Tracing *msg, size_t len, upb_arena *arena) {
- return (struct envoy_type_tracing_v3_CustomTag**)_upb_array_resize_accessor(msg, UPB_SIZE(12, 24), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_type_tracing_v3_CustomTag* envoy_config_route_v3_Tracing_add_custom_tags(envoy_config_route_v3_Tracing *msg, upb_arena *arena) {
- struct envoy_type_tracing_v3_CustomTag* sub = (struct envoy_type_tracing_v3_CustomTag*)_upb_msg_new(&envoy_type_tracing_v3_CustomTag_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(12, 24), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-
-/* envoy.config.route.v3.VirtualCluster */
-
-UPB_INLINE envoy_config_route_v3_VirtualCluster *envoy_config_route_v3_VirtualCluster_new(upb_arena *arena) {
- return (envoy_config_route_v3_VirtualCluster *)_upb_msg_new(&envoy_config_route_v3_VirtualCluster_msginit, arena);
-}
-UPB_INLINE envoy_config_route_v3_VirtualCluster *envoy_config_route_v3_VirtualCluster_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_route_v3_VirtualCluster *ret = envoy_config_route_v3_VirtualCluster_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_VirtualCluster_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_route_v3_VirtualCluster_serialize(const envoy_config_route_v3_VirtualCluster *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_route_v3_VirtualCluster_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview envoy_config_route_v3_VirtualCluster_name(const envoy_config_route_v3_VirtualCluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE bool envoy_config_route_v3_VirtualCluster_has_headers(const envoy_config_route_v3_VirtualCluster *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const envoy_config_route_v3_HeaderMatcher* const* envoy_config_route_v3_VirtualCluster_headers(const envoy_config_route_v3_VirtualCluster *msg, size_t *len) { return (const envoy_config_route_v3_HeaderMatcher* const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len); }
-
-UPB_INLINE void envoy_config_route_v3_VirtualCluster_set_name(envoy_config_route_v3_VirtualCluster *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-UPB_INLINE envoy_config_route_v3_HeaderMatcher** envoy_config_route_v3_VirtualCluster_mutable_headers(envoy_config_route_v3_VirtualCluster *msg, size_t *len) {
- return (envoy_config_route_v3_HeaderMatcher**)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len);
-}
-UPB_INLINE envoy_config_route_v3_HeaderMatcher** envoy_config_route_v3_VirtualCluster_resize_headers(envoy_config_route_v3_VirtualCluster *msg, size_t len, upb_arena *arena) {
- return (envoy_config_route_v3_HeaderMatcher**)_upb_array_resize_accessor(msg, UPB_SIZE(8, 16), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_config_route_v3_HeaderMatcher* envoy_config_route_v3_VirtualCluster_add_headers(envoy_config_route_v3_VirtualCluster *msg, upb_arena *arena) {
- struct envoy_config_route_v3_HeaderMatcher* sub = (struct envoy_config_route_v3_HeaderMatcher*)_upb_msg_new(&envoy_config_route_v3_HeaderMatcher_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(8, 16), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-
-/* envoy.config.route.v3.RateLimit */
-
-UPB_INLINE envoy_config_route_v3_RateLimit *envoy_config_route_v3_RateLimit_new(upb_arena *arena) {
- return (envoy_config_route_v3_RateLimit *)_upb_msg_new(&envoy_config_route_v3_RateLimit_msginit, arena);
-}
-UPB_INLINE envoy_config_route_v3_RateLimit *envoy_config_route_v3_RateLimit_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_route_v3_RateLimit *ret = envoy_config_route_v3_RateLimit_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RateLimit_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_route_v3_RateLimit_serialize(const envoy_config_route_v3_RateLimit *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_route_v3_RateLimit_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_config_route_v3_RateLimit_has_stage(const envoy_config_route_v3_RateLimit *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_route_v3_RateLimit_stage(const envoy_config_route_v3_RateLimit *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_UInt32Value*); }
-UPB_INLINE upb_strview envoy_config_route_v3_RateLimit_disable_key(const envoy_config_route_v3_RateLimit *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE bool envoy_config_route_v3_RateLimit_has_actions(const envoy_config_route_v3_RateLimit *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); }
-UPB_INLINE const envoy_config_route_v3_RateLimit_Action* const* envoy_config_route_v3_RateLimit_actions(const envoy_config_route_v3_RateLimit *msg, size_t *len) { return (const envoy_config_route_v3_RateLimit_Action* const*)_upb_array_accessor(msg, UPB_SIZE(16, 32), len); }
-UPB_INLINE bool envoy_config_route_v3_RateLimit_has_limit(const envoy_config_route_v3_RateLimit *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
-UPB_INLINE const envoy_config_route_v3_RateLimit_Override* envoy_config_route_v3_RateLimit_limit(const envoy_config_route_v3_RateLimit *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const envoy_config_route_v3_RateLimit_Override*); }
-
-UPB_INLINE void envoy_config_route_v3_RateLimit_set_stage(envoy_config_route_v3_RateLimit *msg, struct google_protobuf_UInt32Value* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_UInt32Value*) = value;
-}
-UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_route_v3_RateLimit_mutable_stage(envoy_config_route_v3_RateLimit *msg, upb_arena *arena) {
- struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_route_v3_RateLimit_stage(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_RateLimit_set_stage(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_route_v3_RateLimit_set_disable_key(envoy_config_route_v3_RateLimit *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-UPB_INLINE envoy_config_route_v3_RateLimit_Action** envoy_config_route_v3_RateLimit_mutable_actions(envoy_config_route_v3_RateLimit *msg, size_t *len) {
- return (envoy_config_route_v3_RateLimit_Action**)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 32), len);
-}
-UPB_INLINE envoy_config_route_v3_RateLimit_Action** envoy_config_route_v3_RateLimit_resize_actions(envoy_config_route_v3_RateLimit *msg, size_t len, upb_arena *arena) {
- return (envoy_config_route_v3_RateLimit_Action**)_upb_array_resize_accessor(msg, UPB_SIZE(16, 32), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_config_route_v3_RateLimit_Action* envoy_config_route_v3_RateLimit_add_actions(envoy_config_route_v3_RateLimit *msg, upb_arena *arena) {
- struct envoy_config_route_v3_RateLimit_Action* sub = (struct envoy_config_route_v3_RateLimit_Action*)_upb_msg_new(&envoy_config_route_v3_RateLimit_Action_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(16, 32), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-UPB_INLINE void envoy_config_route_v3_RateLimit_set_limit(envoy_config_route_v3_RateLimit *msg, envoy_config_route_v3_RateLimit_Override* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), envoy_config_route_v3_RateLimit_Override*) = value;
-}
-UPB_INLINE struct envoy_config_route_v3_RateLimit_Override* envoy_config_route_v3_RateLimit_mutable_limit(envoy_config_route_v3_RateLimit *msg, upb_arena *arena) {
- struct envoy_config_route_v3_RateLimit_Override* sub = (struct envoy_config_route_v3_RateLimit_Override*)envoy_config_route_v3_RateLimit_limit(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_route_v3_RateLimit_Override*)_upb_msg_new(&envoy_config_route_v3_RateLimit_Override_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_RateLimit_set_limit(msg, sub);
- }
- return sub;
-}
-
-/* envoy.config.route.v3.RateLimit.Action */
-
-UPB_INLINE envoy_config_route_v3_RateLimit_Action *envoy_config_route_v3_RateLimit_Action_new(upb_arena *arena) {
- return (envoy_config_route_v3_RateLimit_Action *)_upb_msg_new(&envoy_config_route_v3_RateLimit_Action_msginit, arena);
-}
-UPB_INLINE envoy_config_route_v3_RateLimit_Action *envoy_config_route_v3_RateLimit_Action_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_route_v3_RateLimit_Action *ret = envoy_config_route_v3_RateLimit_Action_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_route_v3_RateLimit_Action_serialize(const envoy_config_route_v3_RateLimit_Action *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_route_v3_RateLimit_Action_msginit, arena, len);
-}
-
-typedef enum {
- envoy_config_route_v3_RateLimit_Action_action_specifier_source_cluster = 1,
- envoy_config_route_v3_RateLimit_Action_action_specifier_destination_cluster = 2,
- envoy_config_route_v3_RateLimit_Action_action_specifier_request_headers = 3,
- envoy_config_route_v3_RateLimit_Action_action_specifier_remote_address = 4,
- envoy_config_route_v3_RateLimit_Action_action_specifier_generic_key = 5,
- envoy_config_route_v3_RateLimit_Action_action_specifier_header_value_match = 6,
- envoy_config_route_v3_RateLimit_Action_action_specifier_dynamic_metadata = 7,
- envoy_config_route_v3_RateLimit_Action_action_specifier_NOT_SET = 0
-} envoy_config_route_v3_RateLimit_Action_action_specifier_oneofcases;
-UPB_INLINE envoy_config_route_v3_RateLimit_Action_action_specifier_oneofcases envoy_config_route_v3_RateLimit_Action_action_specifier_case(const envoy_config_route_v3_RateLimit_Action* msg) { return (envoy_config_route_v3_RateLimit_Action_action_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 8), int32_t); }
-
-UPB_INLINE bool envoy_config_route_v3_RateLimit_Action_has_source_cluster(const envoy_config_route_v3_RateLimit_Action *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 1; }
-UPB_INLINE const envoy_config_route_v3_RateLimit_Action_SourceCluster* envoy_config_route_v3_RateLimit_Action_source_cluster(const envoy_config_route_v3_RateLimit_Action *msg) { return UPB_READ_ONEOF(msg, const envoy_config_route_v3_RateLimit_Action_SourceCluster*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 1, NULL); }
-UPB_INLINE bool envoy_config_route_v3_RateLimit_Action_has_destination_cluster(const envoy_config_route_v3_RateLimit_Action *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 2; }
-UPB_INLINE const envoy_config_route_v3_RateLimit_Action_DestinationCluster* envoy_config_route_v3_RateLimit_Action_destination_cluster(const envoy_config_route_v3_RateLimit_Action *msg) { return UPB_READ_ONEOF(msg, const envoy_config_route_v3_RateLimit_Action_DestinationCluster*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 2, NULL); }
-UPB_INLINE bool envoy_config_route_v3_RateLimit_Action_has_request_headers(const envoy_config_route_v3_RateLimit_Action *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 3; }
-UPB_INLINE const envoy_config_route_v3_RateLimit_Action_RequestHeaders* envoy_config_route_v3_RateLimit_Action_request_headers(const envoy_config_route_v3_RateLimit_Action *msg) { return UPB_READ_ONEOF(msg, const envoy_config_route_v3_RateLimit_Action_RequestHeaders*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 3, NULL); }
-UPB_INLINE bool envoy_config_route_v3_RateLimit_Action_has_remote_address(const envoy_config_route_v3_RateLimit_Action *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 4; }
-UPB_INLINE const envoy_config_route_v3_RateLimit_Action_RemoteAddress* envoy_config_route_v3_RateLimit_Action_remote_address(const envoy_config_route_v3_RateLimit_Action *msg) { return UPB_READ_ONEOF(msg, const envoy_config_route_v3_RateLimit_Action_RemoteAddress*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 4, NULL); }
-UPB_INLINE bool envoy_config_route_v3_RateLimit_Action_has_generic_key(const envoy_config_route_v3_RateLimit_Action *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 5; }
-UPB_INLINE const envoy_config_route_v3_RateLimit_Action_GenericKey* envoy_config_route_v3_RateLimit_Action_generic_key(const envoy_config_route_v3_RateLimit_Action *msg) { return UPB_READ_ONEOF(msg, const envoy_config_route_v3_RateLimit_Action_GenericKey*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 5, NULL); }
-UPB_INLINE bool envoy_config_route_v3_RateLimit_Action_has_header_value_match(const envoy_config_route_v3_RateLimit_Action *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 6; }
-UPB_INLINE const envoy_config_route_v3_RateLimit_Action_HeaderValueMatch* envoy_config_route_v3_RateLimit_Action_header_value_match(const envoy_config_route_v3_RateLimit_Action *msg) { return UPB_READ_ONEOF(msg, const envoy_config_route_v3_RateLimit_Action_HeaderValueMatch*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 6, NULL); }
-UPB_INLINE bool envoy_config_route_v3_RateLimit_Action_has_dynamic_metadata(const envoy_config_route_v3_RateLimit_Action *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 7; }
-UPB_INLINE const envoy_config_route_v3_RateLimit_Action_DynamicMetaData* envoy_config_route_v3_RateLimit_Action_dynamic_metadata(const envoy_config_route_v3_RateLimit_Action *msg) { return UPB_READ_ONEOF(msg, const envoy_config_route_v3_RateLimit_Action_DynamicMetaData*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 7, NULL); }
-
-UPB_INLINE void envoy_config_route_v3_RateLimit_Action_set_source_cluster(envoy_config_route_v3_RateLimit_Action *msg, envoy_config_route_v3_RateLimit_Action_SourceCluster* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RateLimit_Action_SourceCluster*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 1);
-}
-UPB_INLINE struct envoy_config_route_v3_RateLimit_Action_SourceCluster* envoy_config_route_v3_RateLimit_Action_mutable_source_cluster(envoy_config_route_v3_RateLimit_Action *msg, upb_arena *arena) {
- struct envoy_config_route_v3_RateLimit_Action_SourceCluster* sub = (struct envoy_config_route_v3_RateLimit_Action_SourceCluster*)envoy_config_route_v3_RateLimit_Action_source_cluster(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_route_v3_RateLimit_Action_SourceCluster*)_upb_msg_new(&envoy_config_route_v3_RateLimit_Action_SourceCluster_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_RateLimit_Action_set_source_cluster(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_route_v3_RateLimit_Action_set_destination_cluster(envoy_config_route_v3_RateLimit_Action *msg, envoy_config_route_v3_RateLimit_Action_DestinationCluster* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RateLimit_Action_DestinationCluster*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 2);
-}
-UPB_INLINE struct envoy_config_route_v3_RateLimit_Action_DestinationCluster* envoy_config_route_v3_RateLimit_Action_mutable_destination_cluster(envoy_config_route_v3_RateLimit_Action *msg, upb_arena *arena) {
- struct envoy_config_route_v3_RateLimit_Action_DestinationCluster* sub = (struct envoy_config_route_v3_RateLimit_Action_DestinationCluster*)envoy_config_route_v3_RateLimit_Action_destination_cluster(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_route_v3_RateLimit_Action_DestinationCluster*)_upb_msg_new(&envoy_config_route_v3_RateLimit_Action_DestinationCluster_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_RateLimit_Action_set_destination_cluster(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_route_v3_RateLimit_Action_set_request_headers(envoy_config_route_v3_RateLimit_Action *msg, envoy_config_route_v3_RateLimit_Action_RequestHeaders* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RateLimit_Action_RequestHeaders*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 3);
-}
-UPB_INLINE struct envoy_config_route_v3_RateLimit_Action_RequestHeaders* envoy_config_route_v3_RateLimit_Action_mutable_request_headers(envoy_config_route_v3_RateLimit_Action *msg, upb_arena *arena) {
- struct envoy_config_route_v3_RateLimit_Action_RequestHeaders* sub = (struct envoy_config_route_v3_RateLimit_Action_RequestHeaders*)envoy_config_route_v3_RateLimit_Action_request_headers(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_route_v3_RateLimit_Action_RequestHeaders*)_upb_msg_new(&envoy_config_route_v3_RateLimit_Action_RequestHeaders_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_RateLimit_Action_set_request_headers(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_route_v3_RateLimit_Action_set_remote_address(envoy_config_route_v3_RateLimit_Action *msg, envoy_config_route_v3_RateLimit_Action_RemoteAddress* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RateLimit_Action_RemoteAddress*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 4);
-}
-UPB_INLINE struct envoy_config_route_v3_RateLimit_Action_RemoteAddress* envoy_config_route_v3_RateLimit_Action_mutable_remote_address(envoy_config_route_v3_RateLimit_Action *msg, upb_arena *arena) {
- struct envoy_config_route_v3_RateLimit_Action_RemoteAddress* sub = (struct envoy_config_route_v3_RateLimit_Action_RemoteAddress*)envoy_config_route_v3_RateLimit_Action_remote_address(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_route_v3_RateLimit_Action_RemoteAddress*)_upb_msg_new(&envoy_config_route_v3_RateLimit_Action_RemoteAddress_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_RateLimit_Action_set_remote_address(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_route_v3_RateLimit_Action_set_generic_key(envoy_config_route_v3_RateLimit_Action *msg, envoy_config_route_v3_RateLimit_Action_GenericKey* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RateLimit_Action_GenericKey*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 5);
-}
-UPB_INLINE struct envoy_config_route_v3_RateLimit_Action_GenericKey* envoy_config_route_v3_RateLimit_Action_mutable_generic_key(envoy_config_route_v3_RateLimit_Action *msg, upb_arena *arena) {
- struct envoy_config_route_v3_RateLimit_Action_GenericKey* sub = (struct envoy_config_route_v3_RateLimit_Action_GenericKey*)envoy_config_route_v3_RateLimit_Action_generic_key(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_route_v3_RateLimit_Action_GenericKey*)_upb_msg_new(&envoy_config_route_v3_RateLimit_Action_GenericKey_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_RateLimit_Action_set_generic_key(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_route_v3_RateLimit_Action_set_header_value_match(envoy_config_route_v3_RateLimit_Action *msg, envoy_config_route_v3_RateLimit_Action_HeaderValueMatch* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RateLimit_Action_HeaderValueMatch*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 6);
-}
-UPB_INLINE struct envoy_config_route_v3_RateLimit_Action_HeaderValueMatch* envoy_config_route_v3_RateLimit_Action_mutable_header_value_match(envoy_config_route_v3_RateLimit_Action *msg, upb_arena *arena) {
- struct envoy_config_route_v3_RateLimit_Action_HeaderValueMatch* sub = (struct envoy_config_route_v3_RateLimit_Action_HeaderValueMatch*)envoy_config_route_v3_RateLimit_Action_header_value_match(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_route_v3_RateLimit_Action_HeaderValueMatch*)_upb_msg_new(&envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_RateLimit_Action_set_header_value_match(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_route_v3_RateLimit_Action_set_dynamic_metadata(envoy_config_route_v3_RateLimit_Action *msg, envoy_config_route_v3_RateLimit_Action_DynamicMetaData* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RateLimit_Action_DynamicMetaData*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 7);
-}
-UPB_INLINE struct envoy_config_route_v3_RateLimit_Action_DynamicMetaData* envoy_config_route_v3_RateLimit_Action_mutable_dynamic_metadata(envoy_config_route_v3_RateLimit_Action *msg, upb_arena *arena) {
- struct envoy_config_route_v3_RateLimit_Action_DynamicMetaData* sub = (struct envoy_config_route_v3_RateLimit_Action_DynamicMetaData*)envoy_config_route_v3_RateLimit_Action_dynamic_metadata(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_route_v3_RateLimit_Action_DynamicMetaData*)_upb_msg_new(&envoy_config_route_v3_RateLimit_Action_DynamicMetaData_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_RateLimit_Action_set_dynamic_metadata(msg, sub);
- }
- return sub;
-}
-
-/* envoy.config.route.v3.RateLimit.Action.SourceCluster */
-
-UPB_INLINE envoy_config_route_v3_RateLimit_Action_SourceCluster *envoy_config_route_v3_RateLimit_Action_SourceCluster_new(upb_arena *arena) {
- return (envoy_config_route_v3_RateLimit_Action_SourceCluster *)_upb_msg_new(&envoy_config_route_v3_RateLimit_Action_SourceCluster_msginit, arena);
-}
-UPB_INLINE envoy_config_route_v3_RateLimit_Action_SourceCluster *envoy_config_route_v3_RateLimit_Action_SourceCluster_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_route_v3_RateLimit_Action_SourceCluster *ret = envoy_config_route_v3_RateLimit_Action_SourceCluster_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_SourceCluster_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_route_v3_RateLimit_Action_SourceCluster_serialize(const envoy_config_route_v3_RateLimit_Action_SourceCluster *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_route_v3_RateLimit_Action_SourceCluster_msginit, arena, len);
-}
-
-
-
-/* envoy.config.route.v3.RateLimit.Action.DestinationCluster */
-
-UPB_INLINE envoy_config_route_v3_RateLimit_Action_DestinationCluster *envoy_config_route_v3_RateLimit_Action_DestinationCluster_new(upb_arena *arena) {
- return (envoy_config_route_v3_RateLimit_Action_DestinationCluster *)_upb_msg_new(&envoy_config_route_v3_RateLimit_Action_DestinationCluster_msginit, arena);
-}
-UPB_INLINE envoy_config_route_v3_RateLimit_Action_DestinationCluster *envoy_config_route_v3_RateLimit_Action_DestinationCluster_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_route_v3_RateLimit_Action_DestinationCluster *ret = envoy_config_route_v3_RateLimit_Action_DestinationCluster_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_DestinationCluster_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_route_v3_RateLimit_Action_DestinationCluster_serialize(const envoy_config_route_v3_RateLimit_Action_DestinationCluster *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_route_v3_RateLimit_Action_DestinationCluster_msginit, arena, len);
-}
-
-
-
-/* envoy.config.route.v3.RateLimit.Action.RequestHeaders */
-
-UPB_INLINE envoy_config_route_v3_RateLimit_Action_RequestHeaders *envoy_config_route_v3_RateLimit_Action_RequestHeaders_new(upb_arena *arena) {
- return (envoy_config_route_v3_RateLimit_Action_RequestHeaders *)_upb_msg_new(&envoy_config_route_v3_RateLimit_Action_RequestHeaders_msginit, arena);
-}
-UPB_INLINE envoy_config_route_v3_RateLimit_Action_RequestHeaders *envoy_config_route_v3_RateLimit_Action_RequestHeaders_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_route_v3_RateLimit_Action_RequestHeaders *ret = envoy_config_route_v3_RateLimit_Action_RequestHeaders_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_RequestHeaders_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_route_v3_RateLimit_Action_RequestHeaders_serialize(const envoy_config_route_v3_RateLimit_Action_RequestHeaders *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_route_v3_RateLimit_Action_RequestHeaders_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview envoy_config_route_v3_RateLimit_Action_RequestHeaders_header_name(const envoy_config_route_v3_RateLimit_Action_RequestHeaders *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
-UPB_INLINE upb_strview envoy_config_route_v3_RateLimit_Action_RequestHeaders_descriptor_key(const envoy_config_route_v3_RateLimit_Action_RequestHeaders *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview); }
-UPB_INLINE bool envoy_config_route_v3_RateLimit_Action_RequestHeaders_skip_if_absent(const envoy_config_route_v3_RateLimit_Action_RequestHeaders *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); }
-
-UPB_INLINE void envoy_config_route_v3_RateLimit_Action_RequestHeaders_set_header_name(envoy_config_route_v3_RateLimit_Action_RequestHeaders *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_route_v3_RateLimit_Action_RequestHeaders_set_descriptor_key(envoy_config_route_v3_RateLimit_Action_RequestHeaders *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_route_v3_RateLimit_Action_RequestHeaders_set_skip_if_absent(envoy_config_route_v3_RateLimit_Action_RequestHeaders *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
-}
-
-/* envoy.config.route.v3.RateLimit.Action.RemoteAddress */
-
-UPB_INLINE envoy_config_route_v3_RateLimit_Action_RemoteAddress *envoy_config_route_v3_RateLimit_Action_RemoteAddress_new(upb_arena *arena) {
- return (envoy_config_route_v3_RateLimit_Action_RemoteAddress *)_upb_msg_new(&envoy_config_route_v3_RateLimit_Action_RemoteAddress_msginit, arena);
-}
-UPB_INLINE envoy_config_route_v3_RateLimit_Action_RemoteAddress *envoy_config_route_v3_RateLimit_Action_RemoteAddress_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_route_v3_RateLimit_Action_RemoteAddress *ret = envoy_config_route_v3_RateLimit_Action_RemoteAddress_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_RemoteAddress_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_route_v3_RateLimit_Action_RemoteAddress_serialize(const envoy_config_route_v3_RateLimit_Action_RemoteAddress *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_route_v3_RateLimit_Action_RemoteAddress_msginit, arena, len);
-}
-
-
-
-/* envoy.config.route.v3.RateLimit.Action.GenericKey */
-
-UPB_INLINE envoy_config_route_v3_RateLimit_Action_GenericKey *envoy_config_route_v3_RateLimit_Action_GenericKey_new(upb_arena *arena) {
- return (envoy_config_route_v3_RateLimit_Action_GenericKey *)_upb_msg_new(&envoy_config_route_v3_RateLimit_Action_GenericKey_msginit, arena);
-}
-UPB_INLINE envoy_config_route_v3_RateLimit_Action_GenericKey *envoy_config_route_v3_RateLimit_Action_GenericKey_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_route_v3_RateLimit_Action_GenericKey *ret = envoy_config_route_v3_RateLimit_Action_GenericKey_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_GenericKey_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_route_v3_RateLimit_Action_GenericKey_serialize(const envoy_config_route_v3_RateLimit_Action_GenericKey *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_route_v3_RateLimit_Action_GenericKey_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview envoy_config_route_v3_RateLimit_Action_GenericKey_descriptor_value(const envoy_config_route_v3_RateLimit_Action_GenericKey *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE upb_strview envoy_config_route_v3_RateLimit_Action_GenericKey_descriptor_key(const envoy_config_route_v3_RateLimit_Action_GenericKey *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview); }
-
-UPB_INLINE void envoy_config_route_v3_RateLimit_Action_GenericKey_set_descriptor_value(envoy_config_route_v3_RateLimit_Action_GenericKey *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_route_v3_RateLimit_Action_GenericKey_set_descriptor_key(envoy_config_route_v3_RateLimit_Action_GenericKey *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview) = value;
-}
-
-/* envoy.config.route.v3.RateLimit.Action.HeaderValueMatch */
-
-UPB_INLINE envoy_config_route_v3_RateLimit_Action_HeaderValueMatch *envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_new(upb_arena *arena) {
- return (envoy_config_route_v3_RateLimit_Action_HeaderValueMatch *)_upb_msg_new(&envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_msginit, arena);
-}
-UPB_INLINE envoy_config_route_v3_RateLimit_Action_HeaderValueMatch *envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_route_v3_RateLimit_Action_HeaderValueMatch *ret = envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_serialize(const envoy_config_route_v3_RateLimit_Action_HeaderValueMatch *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_descriptor_value(const envoy_config_route_v3_RateLimit_Action_HeaderValueMatch *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE bool envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_has_expect_match(const envoy_config_route_v3_RateLimit_Action_HeaderValueMatch *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_expect_match(const envoy_config_route_v3_RateLimit_Action_HeaderValueMatch *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_BoolValue*); }
-UPB_INLINE bool envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_has_headers(const envoy_config_route_v3_RateLimit_Action_HeaderValueMatch *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
-UPB_INLINE const envoy_config_route_v3_HeaderMatcher* const* envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_headers(const envoy_config_route_v3_RateLimit_Action_HeaderValueMatch *msg, size_t *len) { return (const envoy_config_route_v3_HeaderMatcher* const*)_upb_array_accessor(msg, UPB_SIZE(12, 24), len); }
-
-UPB_INLINE void envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_set_descriptor_value(envoy_config_route_v3_RateLimit_Action_HeaderValueMatch *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_set_expect_match(envoy_config_route_v3_RateLimit_Action_HeaderValueMatch *msg, struct google_protobuf_BoolValue* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_BoolValue*) = value;
-}
-UPB_INLINE struct google_protobuf_BoolValue* envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_mutable_expect_match(envoy_config_route_v3_RateLimit_Action_HeaderValueMatch *msg, upb_arena *arena) {
- struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_expect_match(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_BoolValue*)_upb_msg_new(&google_protobuf_BoolValue_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_set_expect_match(msg, sub);
- }
- return sub;
-}
-UPB_INLINE envoy_config_route_v3_HeaderMatcher** envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_mutable_headers(envoy_config_route_v3_RateLimit_Action_HeaderValueMatch *msg, size_t *len) {
- return (envoy_config_route_v3_HeaderMatcher**)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 24), len);
-}
-UPB_INLINE envoy_config_route_v3_HeaderMatcher** envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_resize_headers(envoy_config_route_v3_RateLimit_Action_HeaderValueMatch *msg, size_t len, upb_arena *arena) {
- return (envoy_config_route_v3_HeaderMatcher**)_upb_array_resize_accessor(msg, UPB_SIZE(12, 24), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_config_route_v3_HeaderMatcher* envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_add_headers(envoy_config_route_v3_RateLimit_Action_HeaderValueMatch *msg, upb_arena *arena) {
- struct envoy_config_route_v3_HeaderMatcher* sub = (struct envoy_config_route_v3_HeaderMatcher*)_upb_msg_new(&envoy_config_route_v3_HeaderMatcher_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(12, 24), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-
-/* envoy.config.route.v3.RateLimit.Action.DynamicMetaData */
-
-UPB_INLINE envoy_config_route_v3_RateLimit_Action_DynamicMetaData *envoy_config_route_v3_RateLimit_Action_DynamicMetaData_new(upb_arena *arena) {
- return (envoy_config_route_v3_RateLimit_Action_DynamicMetaData *)_upb_msg_new(&envoy_config_route_v3_RateLimit_Action_DynamicMetaData_msginit, arena);
-}
-UPB_INLINE envoy_config_route_v3_RateLimit_Action_DynamicMetaData *envoy_config_route_v3_RateLimit_Action_DynamicMetaData_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_route_v3_RateLimit_Action_DynamicMetaData *ret = envoy_config_route_v3_RateLimit_Action_DynamicMetaData_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_DynamicMetaData_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_route_v3_RateLimit_Action_DynamicMetaData_serialize(const envoy_config_route_v3_RateLimit_Action_DynamicMetaData *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_route_v3_RateLimit_Action_DynamicMetaData_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview envoy_config_route_v3_RateLimit_Action_DynamicMetaData_descriptor_key(const envoy_config_route_v3_RateLimit_Action_DynamicMetaData *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE bool envoy_config_route_v3_RateLimit_Action_DynamicMetaData_has_metadata_key(const envoy_config_route_v3_RateLimit_Action_DynamicMetaData *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); }
-UPB_INLINE const struct envoy_type_metadata_v3_MetadataKey* envoy_config_route_v3_RateLimit_Action_DynamicMetaData_metadata_key(const envoy_config_route_v3_RateLimit_Action_DynamicMetaData *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const struct envoy_type_metadata_v3_MetadataKey*); }
-UPB_INLINE upb_strview envoy_config_route_v3_RateLimit_Action_DynamicMetaData_default_value(const envoy_config_route_v3_RateLimit_Action_DynamicMetaData *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview); }
-
-UPB_INLINE void envoy_config_route_v3_RateLimit_Action_DynamicMetaData_set_descriptor_key(envoy_config_route_v3_RateLimit_Action_DynamicMetaData *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_route_v3_RateLimit_Action_DynamicMetaData_set_metadata_key(envoy_config_route_v3_RateLimit_Action_DynamicMetaData *msg, struct envoy_type_metadata_v3_MetadataKey* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(16, 32), struct envoy_type_metadata_v3_MetadataKey*) = value;
-}
-UPB_INLINE struct envoy_type_metadata_v3_MetadataKey* envoy_config_route_v3_RateLimit_Action_DynamicMetaData_mutable_metadata_key(envoy_config_route_v3_RateLimit_Action_DynamicMetaData *msg, upb_arena *arena) {
- struct envoy_type_metadata_v3_MetadataKey* sub = (struct envoy_type_metadata_v3_MetadataKey*)envoy_config_route_v3_RateLimit_Action_DynamicMetaData_metadata_key(msg);
- if (sub == NULL) {
- sub = (struct envoy_type_metadata_v3_MetadataKey*)_upb_msg_new(&envoy_type_metadata_v3_MetadataKey_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_RateLimit_Action_DynamicMetaData_set_metadata_key(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_route_v3_RateLimit_Action_DynamicMetaData_set_default_value(envoy_config_route_v3_RateLimit_Action_DynamicMetaData *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview) = value;
-}
-
-/* envoy.config.route.v3.RateLimit.Override */
-
-UPB_INLINE envoy_config_route_v3_RateLimit_Override *envoy_config_route_v3_RateLimit_Override_new(upb_arena *arena) {
- return (envoy_config_route_v3_RateLimit_Override *)_upb_msg_new(&envoy_config_route_v3_RateLimit_Override_msginit, arena);
-}
-UPB_INLINE envoy_config_route_v3_RateLimit_Override *envoy_config_route_v3_RateLimit_Override_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_route_v3_RateLimit_Override *ret = envoy_config_route_v3_RateLimit_Override_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Override_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_route_v3_RateLimit_Override_serialize(const envoy_config_route_v3_RateLimit_Override *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_route_v3_RateLimit_Override_msginit, arena, len);
-}
-
-typedef enum {
- envoy_config_route_v3_RateLimit_Override_override_specifier_dynamic_metadata = 1,
- envoy_config_route_v3_RateLimit_Override_override_specifier_NOT_SET = 0
-} envoy_config_route_v3_RateLimit_Override_override_specifier_oneofcases;
-UPB_INLINE envoy_config_route_v3_RateLimit_Override_override_specifier_oneofcases envoy_config_route_v3_RateLimit_Override_override_specifier_case(const envoy_config_route_v3_RateLimit_Override* msg) { return (envoy_config_route_v3_RateLimit_Override_override_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 8), int32_t); }
-
-UPB_INLINE bool envoy_config_route_v3_RateLimit_Override_has_dynamic_metadata(const envoy_config_route_v3_RateLimit_Override *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 1; }
-UPB_INLINE const envoy_config_route_v3_RateLimit_Override_DynamicMetadata* envoy_config_route_v3_RateLimit_Override_dynamic_metadata(const envoy_config_route_v3_RateLimit_Override *msg) { return UPB_READ_ONEOF(msg, const envoy_config_route_v3_RateLimit_Override_DynamicMetadata*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 1, NULL); }
-
-UPB_INLINE void envoy_config_route_v3_RateLimit_Override_set_dynamic_metadata(envoy_config_route_v3_RateLimit_Override *msg, envoy_config_route_v3_RateLimit_Override_DynamicMetadata* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RateLimit_Override_DynamicMetadata*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 1);
-}
-UPB_INLINE struct envoy_config_route_v3_RateLimit_Override_DynamicMetadata* envoy_config_route_v3_RateLimit_Override_mutable_dynamic_metadata(envoy_config_route_v3_RateLimit_Override *msg, upb_arena *arena) {
- struct envoy_config_route_v3_RateLimit_Override_DynamicMetadata* sub = (struct envoy_config_route_v3_RateLimit_Override_DynamicMetadata*)envoy_config_route_v3_RateLimit_Override_dynamic_metadata(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_route_v3_RateLimit_Override_DynamicMetadata*)_upb_msg_new(&envoy_config_route_v3_RateLimit_Override_DynamicMetadata_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_RateLimit_Override_set_dynamic_metadata(msg, sub);
- }
- return sub;
-}
-
-/* envoy.config.route.v3.RateLimit.Override.DynamicMetadata */
-
-UPB_INLINE envoy_config_route_v3_RateLimit_Override_DynamicMetadata *envoy_config_route_v3_RateLimit_Override_DynamicMetadata_new(upb_arena *arena) {
- return (envoy_config_route_v3_RateLimit_Override_DynamicMetadata *)_upb_msg_new(&envoy_config_route_v3_RateLimit_Override_DynamicMetadata_msginit, arena);
-}
-UPB_INLINE envoy_config_route_v3_RateLimit_Override_DynamicMetadata *envoy_config_route_v3_RateLimit_Override_DynamicMetadata_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_route_v3_RateLimit_Override_DynamicMetadata *ret = envoy_config_route_v3_RateLimit_Override_DynamicMetadata_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Override_DynamicMetadata_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_route_v3_RateLimit_Override_DynamicMetadata_serialize(const envoy_config_route_v3_RateLimit_Override_DynamicMetadata *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_route_v3_RateLimit_Override_DynamicMetadata_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_config_route_v3_RateLimit_Override_DynamicMetadata_has_metadata_key(const envoy_config_route_v3_RateLimit_Override_DynamicMetadata *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE const struct envoy_type_metadata_v3_MetadataKey* envoy_config_route_v3_RateLimit_Override_DynamicMetadata_metadata_key(const envoy_config_route_v3_RateLimit_Override_DynamicMetadata *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct envoy_type_metadata_v3_MetadataKey*); }
-
-UPB_INLINE void envoy_config_route_v3_RateLimit_Override_DynamicMetadata_set_metadata_key(envoy_config_route_v3_RateLimit_Override_DynamicMetadata *msg, struct envoy_type_metadata_v3_MetadataKey* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct envoy_type_metadata_v3_MetadataKey*) = value;
-}
-UPB_INLINE struct envoy_type_metadata_v3_MetadataKey* envoy_config_route_v3_RateLimit_Override_DynamicMetadata_mutable_metadata_key(envoy_config_route_v3_RateLimit_Override_DynamicMetadata *msg, upb_arena *arena) {
- struct envoy_type_metadata_v3_MetadataKey* sub = (struct envoy_type_metadata_v3_MetadataKey*)envoy_config_route_v3_RateLimit_Override_DynamicMetadata_metadata_key(msg);
- if (sub == NULL) {
- sub = (struct envoy_type_metadata_v3_MetadataKey*)_upb_msg_new(&envoy_type_metadata_v3_MetadataKey_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_RateLimit_Override_DynamicMetadata_set_metadata_key(msg, sub);
- }
- return sub;
-}
-
-/* envoy.config.route.v3.HeaderMatcher */
-
-UPB_INLINE envoy_config_route_v3_HeaderMatcher *envoy_config_route_v3_HeaderMatcher_new(upb_arena *arena) {
- return (envoy_config_route_v3_HeaderMatcher *)_upb_msg_new(&envoy_config_route_v3_HeaderMatcher_msginit, arena);
-}
-UPB_INLINE envoy_config_route_v3_HeaderMatcher *envoy_config_route_v3_HeaderMatcher_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_route_v3_HeaderMatcher *ret = envoy_config_route_v3_HeaderMatcher_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_HeaderMatcher_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_route_v3_HeaderMatcher_serialize(const envoy_config_route_v3_HeaderMatcher *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_route_v3_HeaderMatcher_msginit, arena, len);
-}
-
-typedef enum {
- envoy_config_route_v3_HeaderMatcher_header_match_specifier_exact_match = 4,
- envoy_config_route_v3_HeaderMatcher_header_match_specifier_safe_regex_match = 11,
- envoy_config_route_v3_HeaderMatcher_header_match_specifier_range_match = 6,
- envoy_config_route_v3_HeaderMatcher_header_match_specifier_present_match = 7,
- envoy_config_route_v3_HeaderMatcher_header_match_specifier_prefix_match = 9,
- envoy_config_route_v3_HeaderMatcher_header_match_specifier_suffix_match = 10,
- envoy_config_route_v3_HeaderMatcher_header_match_specifier_contains_match = 12,
- envoy_config_route_v3_HeaderMatcher_header_match_specifier_NOT_SET = 0
-} envoy_config_route_v3_HeaderMatcher_header_match_specifier_oneofcases;
-UPB_INLINE envoy_config_route_v3_HeaderMatcher_header_match_specifier_oneofcases envoy_config_route_v3_HeaderMatcher_header_match_specifier_case(const envoy_config_route_v3_HeaderMatcher* msg) { return (envoy_config_route_v3_HeaderMatcher_header_match_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(20, 40), int32_t); }
-
-UPB_INLINE upb_strview envoy_config_route_v3_HeaderMatcher_name(const envoy_config_route_v3_HeaderMatcher *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
-UPB_INLINE bool envoy_config_route_v3_HeaderMatcher_has_exact_match(const envoy_config_route_v3_HeaderMatcher *msg) { return _upb_getoneofcase(msg, UPB_SIZE(20, 40)) == 4; }
-UPB_INLINE upb_strview envoy_config_route_v3_HeaderMatcher_exact_match(const envoy_config_route_v3_HeaderMatcher *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(12, 24), UPB_SIZE(20, 40), 4, upb_strview_make("", strlen(""))); }
-UPB_INLINE bool envoy_config_route_v3_HeaderMatcher_has_range_match(const envoy_config_route_v3_HeaderMatcher *msg) { return _upb_getoneofcase(msg, UPB_SIZE(20, 40)) == 6; }
-UPB_INLINE const struct envoy_type_v3_Int64Range* envoy_config_route_v3_HeaderMatcher_range_match(const envoy_config_route_v3_HeaderMatcher *msg) { return UPB_READ_ONEOF(msg, const struct envoy_type_v3_Int64Range*, UPB_SIZE(12, 24), UPB_SIZE(20, 40), 6, NULL); }
-UPB_INLINE bool envoy_config_route_v3_HeaderMatcher_has_present_match(const envoy_config_route_v3_HeaderMatcher *msg) { return _upb_getoneofcase(msg, UPB_SIZE(20, 40)) == 7; }
-UPB_INLINE bool envoy_config_route_v3_HeaderMatcher_present_match(const envoy_config_route_v3_HeaderMatcher *msg) { return UPB_READ_ONEOF(msg, bool, UPB_SIZE(12, 24), UPB_SIZE(20, 40), 7, false); }
-UPB_INLINE bool envoy_config_route_v3_HeaderMatcher_invert_match(const envoy_config_route_v3_HeaderMatcher *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); }
-UPB_INLINE bool envoy_config_route_v3_HeaderMatcher_has_prefix_match(const envoy_config_route_v3_HeaderMatcher *msg) { return _upb_getoneofcase(msg, UPB_SIZE(20, 40)) == 9; }
-UPB_INLINE upb_strview envoy_config_route_v3_HeaderMatcher_prefix_match(const envoy_config_route_v3_HeaderMatcher *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(12, 24), UPB_SIZE(20, 40), 9, upb_strview_make("", strlen(""))); }
-UPB_INLINE bool envoy_config_route_v3_HeaderMatcher_has_suffix_match(const envoy_config_route_v3_HeaderMatcher *msg) { return _upb_getoneofcase(msg, UPB_SIZE(20, 40)) == 10; }
-UPB_INLINE upb_strview envoy_config_route_v3_HeaderMatcher_suffix_match(const envoy_config_route_v3_HeaderMatcher *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(12, 24), UPB_SIZE(20, 40), 10, upb_strview_make("", strlen(""))); }
-UPB_INLINE bool envoy_config_route_v3_HeaderMatcher_has_safe_regex_match(const envoy_config_route_v3_HeaderMatcher *msg) { return _upb_getoneofcase(msg, UPB_SIZE(20, 40)) == 11; }
-UPB_INLINE const struct envoy_type_matcher_v3_RegexMatcher* envoy_config_route_v3_HeaderMatcher_safe_regex_match(const envoy_config_route_v3_HeaderMatcher *msg) { return UPB_READ_ONEOF(msg, const struct envoy_type_matcher_v3_RegexMatcher*, UPB_SIZE(12, 24), UPB_SIZE(20, 40), 11, NULL); }
-UPB_INLINE bool envoy_config_route_v3_HeaderMatcher_has_contains_match(const envoy_config_route_v3_HeaderMatcher *msg) { return _upb_getoneofcase(msg, UPB_SIZE(20, 40)) == 12; }
-UPB_INLINE upb_strview envoy_config_route_v3_HeaderMatcher_contains_match(const envoy_config_route_v3_HeaderMatcher *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(12, 24), UPB_SIZE(20, 40), 12, upb_strview_make("", strlen(""))); }
-
-UPB_INLINE void envoy_config_route_v3_HeaderMatcher_set_name(envoy_config_route_v3_HeaderMatcher *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_route_v3_HeaderMatcher_set_exact_match(envoy_config_route_v3_HeaderMatcher *msg, upb_strview value) {
- UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(12, 24), value, UPB_SIZE(20, 40), 4);
-}
-UPB_INLINE void envoy_config_route_v3_HeaderMatcher_set_range_match(envoy_config_route_v3_HeaderMatcher *msg, struct envoy_type_v3_Int64Range* value) {
- UPB_WRITE_ONEOF(msg, struct envoy_type_v3_Int64Range*, UPB_SIZE(12, 24), value, UPB_SIZE(20, 40), 6);
-}
-UPB_INLINE struct envoy_type_v3_Int64Range* envoy_config_route_v3_HeaderMatcher_mutable_range_match(envoy_config_route_v3_HeaderMatcher *msg, upb_arena *arena) {
- struct envoy_type_v3_Int64Range* sub = (struct envoy_type_v3_Int64Range*)envoy_config_route_v3_HeaderMatcher_range_match(msg);
- if (sub == NULL) {
- sub = (struct envoy_type_v3_Int64Range*)_upb_msg_new(&envoy_type_v3_Int64Range_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_HeaderMatcher_set_range_match(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_route_v3_HeaderMatcher_set_present_match(envoy_config_route_v3_HeaderMatcher *msg, bool value) {
- UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(12, 24), value, UPB_SIZE(20, 40), 7);
-}
-UPB_INLINE void envoy_config_route_v3_HeaderMatcher_set_invert_match(envoy_config_route_v3_HeaderMatcher *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
-}
-UPB_INLINE void envoy_config_route_v3_HeaderMatcher_set_prefix_match(envoy_config_route_v3_HeaderMatcher *msg, upb_strview value) {
- UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(12, 24), value, UPB_SIZE(20, 40), 9);
-}
-UPB_INLINE void envoy_config_route_v3_HeaderMatcher_set_suffix_match(envoy_config_route_v3_HeaderMatcher *msg, upb_strview value) {
- UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(12, 24), value, UPB_SIZE(20, 40), 10);
-}
-UPB_INLINE void envoy_config_route_v3_HeaderMatcher_set_safe_regex_match(envoy_config_route_v3_HeaderMatcher *msg, struct envoy_type_matcher_v3_RegexMatcher* value) {
- UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_RegexMatcher*, UPB_SIZE(12, 24), value, UPB_SIZE(20, 40), 11);
-}
-UPB_INLINE struct envoy_type_matcher_v3_RegexMatcher* envoy_config_route_v3_HeaderMatcher_mutable_safe_regex_match(envoy_config_route_v3_HeaderMatcher *msg, upb_arena *arena) {
- struct envoy_type_matcher_v3_RegexMatcher* sub = (struct envoy_type_matcher_v3_RegexMatcher*)envoy_config_route_v3_HeaderMatcher_safe_regex_match(msg);
- if (sub == NULL) {
- sub = (struct envoy_type_matcher_v3_RegexMatcher*)_upb_msg_new(&envoy_type_matcher_v3_RegexMatcher_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_HeaderMatcher_set_safe_regex_match(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_route_v3_HeaderMatcher_set_contains_match(envoy_config_route_v3_HeaderMatcher *msg, upb_strview value) {
- UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(12, 24), value, UPB_SIZE(20, 40), 12);
-}
-
-/* envoy.config.route.v3.QueryParameterMatcher */
-
-UPB_INLINE envoy_config_route_v3_QueryParameterMatcher *envoy_config_route_v3_QueryParameterMatcher_new(upb_arena *arena) {
- return (envoy_config_route_v3_QueryParameterMatcher *)_upb_msg_new(&envoy_config_route_v3_QueryParameterMatcher_msginit, arena);
-}
-UPB_INLINE envoy_config_route_v3_QueryParameterMatcher *envoy_config_route_v3_QueryParameterMatcher_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_route_v3_QueryParameterMatcher *ret = envoy_config_route_v3_QueryParameterMatcher_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_QueryParameterMatcher_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_route_v3_QueryParameterMatcher_serialize(const envoy_config_route_v3_QueryParameterMatcher *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_route_v3_QueryParameterMatcher_msginit, arena, len);
-}
-
-typedef enum {
- envoy_config_route_v3_QueryParameterMatcher_query_parameter_match_specifier_string_match = 5,
- envoy_config_route_v3_QueryParameterMatcher_query_parameter_match_specifier_present_match = 6,
- envoy_config_route_v3_QueryParameterMatcher_query_parameter_match_specifier_NOT_SET = 0
-} envoy_config_route_v3_QueryParameterMatcher_query_parameter_match_specifier_oneofcases;
-UPB_INLINE envoy_config_route_v3_QueryParameterMatcher_query_parameter_match_specifier_oneofcases envoy_config_route_v3_QueryParameterMatcher_query_parameter_match_specifier_case(const envoy_config_route_v3_QueryParameterMatcher* msg) { return (envoy_config_route_v3_QueryParameterMatcher_query_parameter_match_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(12, 24), int32_t); }
-
-UPB_INLINE upb_strview envoy_config_route_v3_QueryParameterMatcher_name(const envoy_config_route_v3_QueryParameterMatcher *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE bool envoy_config_route_v3_QueryParameterMatcher_has_string_match(const envoy_config_route_v3_QueryParameterMatcher *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 5; }
-UPB_INLINE const struct envoy_type_matcher_v3_StringMatcher* envoy_config_route_v3_QueryParameterMatcher_string_match(const envoy_config_route_v3_QueryParameterMatcher *msg) { return UPB_READ_ONEOF(msg, const struct envoy_type_matcher_v3_StringMatcher*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 5, NULL); }
-UPB_INLINE bool envoy_config_route_v3_QueryParameterMatcher_has_present_match(const envoy_config_route_v3_QueryParameterMatcher *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 6; }
-UPB_INLINE bool envoy_config_route_v3_QueryParameterMatcher_present_match(const envoy_config_route_v3_QueryParameterMatcher *msg) { return UPB_READ_ONEOF(msg, bool, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 6, false); }
-
-UPB_INLINE void envoy_config_route_v3_QueryParameterMatcher_set_name(envoy_config_route_v3_QueryParameterMatcher *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_route_v3_QueryParameterMatcher_set_string_match(envoy_config_route_v3_QueryParameterMatcher *msg, struct envoy_type_matcher_v3_StringMatcher* value) {
- UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_StringMatcher*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 5);
-}
-UPB_INLINE struct envoy_type_matcher_v3_StringMatcher* envoy_config_route_v3_QueryParameterMatcher_mutable_string_match(envoy_config_route_v3_QueryParameterMatcher *msg, upb_arena *arena) {
- struct envoy_type_matcher_v3_StringMatcher* sub = (struct envoy_type_matcher_v3_StringMatcher*)envoy_config_route_v3_QueryParameterMatcher_string_match(msg);
- if (sub == NULL) {
- sub = (struct envoy_type_matcher_v3_StringMatcher*)_upb_msg_new(&envoy_type_matcher_v3_StringMatcher_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_QueryParameterMatcher_set_string_match(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_route_v3_QueryParameterMatcher_set_present_match(envoy_config_route_v3_QueryParameterMatcher *msg, bool value) {
- UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 6);
-}
-
-/* envoy.config.route.v3.InternalRedirectPolicy */
-
-UPB_INLINE envoy_config_route_v3_InternalRedirectPolicy *envoy_config_route_v3_InternalRedirectPolicy_new(upb_arena *arena) {
- return (envoy_config_route_v3_InternalRedirectPolicy *)_upb_msg_new(&envoy_config_route_v3_InternalRedirectPolicy_msginit, arena);
-}
-UPB_INLINE envoy_config_route_v3_InternalRedirectPolicy *envoy_config_route_v3_InternalRedirectPolicy_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_route_v3_InternalRedirectPolicy *ret = envoy_config_route_v3_InternalRedirectPolicy_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_InternalRedirectPolicy_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_route_v3_InternalRedirectPolicy_serialize(const envoy_config_route_v3_InternalRedirectPolicy *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_route_v3_InternalRedirectPolicy_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_config_route_v3_InternalRedirectPolicy_has_max_internal_redirects(const envoy_config_route_v3_InternalRedirectPolicy *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
-UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_route_v3_InternalRedirectPolicy_max_internal_redirects(const envoy_config_route_v3_InternalRedirectPolicy *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_UInt32Value*); }
-UPB_INLINE uint32_t const* envoy_config_route_v3_InternalRedirectPolicy_redirect_response_codes(const envoy_config_route_v3_InternalRedirectPolicy *msg, size_t *len) { return (uint32_t const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len); }
-UPB_INLINE bool envoy_config_route_v3_InternalRedirectPolicy_has_predicates(const envoy_config_route_v3_InternalRedirectPolicy *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
-UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* const* envoy_config_route_v3_InternalRedirectPolicy_predicates(const envoy_config_route_v3_InternalRedirectPolicy *msg, size_t *len) { return (const struct envoy_config_core_v3_TypedExtensionConfig* const*)_upb_array_accessor(msg, UPB_SIZE(12, 24), len); }
-UPB_INLINE bool envoy_config_route_v3_InternalRedirectPolicy_allow_cross_scheme_redirect(const envoy_config_route_v3_InternalRedirectPolicy *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); }
-
-UPB_INLINE void envoy_config_route_v3_InternalRedirectPolicy_set_max_internal_redirects(envoy_config_route_v3_InternalRedirectPolicy *msg, struct google_protobuf_UInt32Value* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_UInt32Value*) = value;
-}
-UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_route_v3_InternalRedirectPolicy_mutable_max_internal_redirects(envoy_config_route_v3_InternalRedirectPolicy *msg, upb_arena *arena) {
- struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_route_v3_InternalRedirectPolicy_max_internal_redirects(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_InternalRedirectPolicy_set_max_internal_redirects(msg, sub);
- }
- return sub;
-}
-UPB_INLINE uint32_t* envoy_config_route_v3_InternalRedirectPolicy_mutable_redirect_response_codes(envoy_config_route_v3_InternalRedirectPolicy *msg, size_t *len) {
- return (uint32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len);
-}
-UPB_INLINE uint32_t* envoy_config_route_v3_InternalRedirectPolicy_resize_redirect_response_codes(envoy_config_route_v3_InternalRedirectPolicy *msg, size_t len, upb_arena *arena) {
- return (uint32_t*)_upb_array_resize_accessor(msg, UPB_SIZE(8, 16), len, UPB_TYPE_UINT32, arena);
-}
-UPB_INLINE bool envoy_config_route_v3_InternalRedirectPolicy_add_redirect_response_codes(envoy_config_route_v3_InternalRedirectPolicy *msg, uint32_t val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(8, 16), UPB_SIZE(4, 4), UPB_TYPE_UINT32, &val,
- arena);
-}
-UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig** envoy_config_route_v3_InternalRedirectPolicy_mutable_predicates(envoy_config_route_v3_InternalRedirectPolicy *msg, size_t *len) {
- return (struct envoy_config_core_v3_TypedExtensionConfig**)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 24), len);
-}
-UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig** envoy_config_route_v3_InternalRedirectPolicy_resize_predicates(envoy_config_route_v3_InternalRedirectPolicy *msg, size_t len, upb_arena *arena) {
- return (struct envoy_config_core_v3_TypedExtensionConfig**)_upb_array_resize_accessor(msg, UPB_SIZE(12, 24), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_route_v3_InternalRedirectPolicy_add_predicates(envoy_config_route_v3_InternalRedirectPolicy *msg, upb_arena *arena) {
- struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_msg_new(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(12, 24), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-UPB_INLINE void envoy_config_route_v3_InternalRedirectPolicy_set_allow_cross_scheme_redirect(envoy_config_route_v3_InternalRedirectPolicy *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* ENVOY_CONFIG_ROUTE_V3_ROUTE_COMPONENTS_PROTO_UPB_H_ */
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/route/v3/route_components.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_CONFIG_ROUTE_V3_ROUTE_COMPONENTS_PROTO_UPB_H_
+#define ENVOY_CONFIG_ROUTE_V3_ROUTE_COMPONENTS_PROTO_UPB_H_
+
+#include "upb/msg.h"
+#include "upb/decode.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_config_route_v3_VirtualHost;
+struct envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry;
+struct envoy_config_route_v3_FilterAction;
+struct envoy_config_route_v3_Route;
+struct envoy_config_route_v3_Route_TypedPerFilterConfigEntry;
+struct envoy_config_route_v3_WeightedCluster;
+struct envoy_config_route_v3_WeightedCluster_ClusterWeight;
+struct envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry;
+struct envoy_config_route_v3_RouteMatch;
+struct envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions;
+struct envoy_config_route_v3_RouteMatch_TlsContextMatchOptions;
+struct envoy_config_route_v3_RouteMatch_ConnectMatcher;
+struct envoy_config_route_v3_CorsPolicy;
+struct envoy_config_route_v3_RouteAction;
+struct envoy_config_route_v3_RouteAction_RequestMirrorPolicy;
+struct envoy_config_route_v3_RouteAction_HashPolicy;
+struct envoy_config_route_v3_RouteAction_HashPolicy_Header;
+struct envoy_config_route_v3_RouteAction_HashPolicy_Cookie;
+struct envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties;
+struct envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter;
+struct envoy_config_route_v3_RouteAction_HashPolicy_FilterState;
+struct envoy_config_route_v3_RouteAction_UpgradeConfig;
+struct envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig;
+struct envoy_config_route_v3_RouteAction_MaxStreamDuration;
+struct envoy_config_route_v3_RetryPolicy;
+struct envoy_config_route_v3_RetryPolicy_RetryPriority;
+struct envoy_config_route_v3_RetryPolicy_RetryHostPredicate;
+struct envoy_config_route_v3_RetryPolicy_RetryBackOff;
+struct envoy_config_route_v3_RetryPolicy_ResetHeader;
+struct envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff;
+struct envoy_config_route_v3_HedgePolicy;
+struct envoy_config_route_v3_RedirectAction;
+struct envoy_config_route_v3_DirectResponseAction;
+struct envoy_config_route_v3_Decorator;
+struct envoy_config_route_v3_Tracing;
+struct envoy_config_route_v3_VirtualCluster;
+struct envoy_config_route_v3_RateLimit;
+struct envoy_config_route_v3_RateLimit_Action;
+struct envoy_config_route_v3_RateLimit_Action_SourceCluster;
+struct envoy_config_route_v3_RateLimit_Action_DestinationCluster;
+struct envoy_config_route_v3_RateLimit_Action_RequestHeaders;
+struct envoy_config_route_v3_RateLimit_Action_RemoteAddress;
+struct envoy_config_route_v3_RateLimit_Action_GenericKey;
+struct envoy_config_route_v3_RateLimit_Action_HeaderValueMatch;
+struct envoy_config_route_v3_RateLimit_Action_DynamicMetaData;
+struct envoy_config_route_v3_RateLimit_Override;
+struct envoy_config_route_v3_RateLimit_Override_DynamicMetadata;
+struct envoy_config_route_v3_HeaderMatcher;
+struct envoy_config_route_v3_QueryParameterMatcher;
+struct envoy_config_route_v3_InternalRedirectPolicy;
+typedef struct envoy_config_route_v3_VirtualHost envoy_config_route_v3_VirtualHost;
+typedef struct envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry;
+typedef struct envoy_config_route_v3_FilterAction envoy_config_route_v3_FilterAction;
+typedef struct envoy_config_route_v3_Route envoy_config_route_v3_Route;
+typedef struct envoy_config_route_v3_Route_TypedPerFilterConfigEntry envoy_config_route_v3_Route_TypedPerFilterConfigEntry;
+typedef struct envoy_config_route_v3_WeightedCluster envoy_config_route_v3_WeightedCluster;
+typedef struct envoy_config_route_v3_WeightedCluster_ClusterWeight envoy_config_route_v3_WeightedCluster_ClusterWeight;
+typedef struct envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry;
+typedef struct envoy_config_route_v3_RouteMatch envoy_config_route_v3_RouteMatch;
+typedef struct envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions;
+typedef struct envoy_config_route_v3_RouteMatch_TlsContextMatchOptions envoy_config_route_v3_RouteMatch_TlsContextMatchOptions;
+typedef struct envoy_config_route_v3_RouteMatch_ConnectMatcher envoy_config_route_v3_RouteMatch_ConnectMatcher;
+typedef struct envoy_config_route_v3_CorsPolicy envoy_config_route_v3_CorsPolicy;
+typedef struct envoy_config_route_v3_RouteAction envoy_config_route_v3_RouteAction;
+typedef struct envoy_config_route_v3_RouteAction_RequestMirrorPolicy envoy_config_route_v3_RouteAction_RequestMirrorPolicy;
+typedef struct envoy_config_route_v3_RouteAction_HashPolicy envoy_config_route_v3_RouteAction_HashPolicy;
+typedef struct envoy_config_route_v3_RouteAction_HashPolicy_Header envoy_config_route_v3_RouteAction_HashPolicy_Header;
+typedef struct envoy_config_route_v3_RouteAction_HashPolicy_Cookie envoy_config_route_v3_RouteAction_HashPolicy_Cookie;
+typedef struct envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties;
+typedef struct envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter;
+typedef struct envoy_config_route_v3_RouteAction_HashPolicy_FilterState envoy_config_route_v3_RouteAction_HashPolicy_FilterState;
+typedef struct envoy_config_route_v3_RouteAction_UpgradeConfig envoy_config_route_v3_RouteAction_UpgradeConfig;
+typedef struct envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig;
+typedef struct envoy_config_route_v3_RouteAction_MaxStreamDuration envoy_config_route_v3_RouteAction_MaxStreamDuration;
+typedef struct envoy_config_route_v3_RetryPolicy envoy_config_route_v3_RetryPolicy;
+typedef struct envoy_config_route_v3_RetryPolicy_RetryPriority envoy_config_route_v3_RetryPolicy_RetryPriority;
+typedef struct envoy_config_route_v3_RetryPolicy_RetryHostPredicate envoy_config_route_v3_RetryPolicy_RetryHostPredicate;
+typedef struct envoy_config_route_v3_RetryPolicy_RetryBackOff envoy_config_route_v3_RetryPolicy_RetryBackOff;
+typedef struct envoy_config_route_v3_RetryPolicy_ResetHeader envoy_config_route_v3_RetryPolicy_ResetHeader;
+typedef struct envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff;
+typedef struct envoy_config_route_v3_HedgePolicy envoy_config_route_v3_HedgePolicy;
+typedef struct envoy_config_route_v3_RedirectAction envoy_config_route_v3_RedirectAction;
+typedef struct envoy_config_route_v3_DirectResponseAction envoy_config_route_v3_DirectResponseAction;
+typedef struct envoy_config_route_v3_Decorator envoy_config_route_v3_Decorator;
+typedef struct envoy_config_route_v3_Tracing envoy_config_route_v3_Tracing;
+typedef struct envoy_config_route_v3_VirtualCluster envoy_config_route_v3_VirtualCluster;
+typedef struct envoy_config_route_v3_RateLimit envoy_config_route_v3_RateLimit;
+typedef struct envoy_config_route_v3_RateLimit_Action envoy_config_route_v3_RateLimit_Action;
+typedef struct envoy_config_route_v3_RateLimit_Action_SourceCluster envoy_config_route_v3_RateLimit_Action_SourceCluster;
+typedef struct envoy_config_route_v3_RateLimit_Action_DestinationCluster envoy_config_route_v3_RateLimit_Action_DestinationCluster;
+typedef struct envoy_config_route_v3_RateLimit_Action_RequestHeaders envoy_config_route_v3_RateLimit_Action_RequestHeaders;
+typedef struct envoy_config_route_v3_RateLimit_Action_RemoteAddress envoy_config_route_v3_RateLimit_Action_RemoteAddress;
+typedef struct envoy_config_route_v3_RateLimit_Action_GenericKey envoy_config_route_v3_RateLimit_Action_GenericKey;
+typedef struct envoy_config_route_v3_RateLimit_Action_HeaderValueMatch envoy_config_route_v3_RateLimit_Action_HeaderValueMatch;
+typedef struct envoy_config_route_v3_RateLimit_Action_DynamicMetaData envoy_config_route_v3_RateLimit_Action_DynamicMetaData;
+typedef struct envoy_config_route_v3_RateLimit_Override envoy_config_route_v3_RateLimit_Override;
+typedef struct envoy_config_route_v3_RateLimit_Override_DynamicMetadata envoy_config_route_v3_RateLimit_Override_DynamicMetadata;
+typedef struct envoy_config_route_v3_HeaderMatcher envoy_config_route_v3_HeaderMatcher;
+typedef struct envoy_config_route_v3_QueryParameterMatcher envoy_config_route_v3_QueryParameterMatcher;
+typedef struct envoy_config_route_v3_InternalRedirectPolicy envoy_config_route_v3_InternalRedirectPolicy;
+extern const upb_msglayout envoy_config_route_v3_VirtualHost_msginit;
+extern const upb_msglayout envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry_msginit;
+extern const upb_msglayout envoy_config_route_v3_FilterAction_msginit;
+extern const upb_msglayout envoy_config_route_v3_Route_msginit;
+extern const upb_msglayout envoy_config_route_v3_Route_TypedPerFilterConfigEntry_msginit;
+extern const upb_msglayout envoy_config_route_v3_WeightedCluster_msginit;
+extern const upb_msglayout envoy_config_route_v3_WeightedCluster_ClusterWeight_msginit;
+extern const upb_msglayout envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry_msginit;
+extern const upb_msglayout envoy_config_route_v3_RouteMatch_msginit;
+extern const upb_msglayout envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions_msginit;
+extern const upb_msglayout envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_msginit;
+extern const upb_msglayout envoy_config_route_v3_RouteMatch_ConnectMatcher_msginit;
+extern const upb_msglayout envoy_config_route_v3_CorsPolicy_msginit;
+extern const upb_msglayout envoy_config_route_v3_RouteAction_msginit;
+extern const upb_msglayout envoy_config_route_v3_RouteAction_RequestMirrorPolicy_msginit;
+extern const upb_msglayout envoy_config_route_v3_RouteAction_HashPolicy_msginit;
+extern const upb_msglayout envoy_config_route_v3_RouteAction_HashPolicy_Header_msginit;
+extern const upb_msglayout envoy_config_route_v3_RouteAction_HashPolicy_Cookie_msginit;
+extern const upb_msglayout envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_msginit;
+extern const upb_msglayout envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_msginit;
+extern const upb_msglayout envoy_config_route_v3_RouteAction_HashPolicy_FilterState_msginit;
+extern const upb_msglayout envoy_config_route_v3_RouteAction_UpgradeConfig_msginit;
+extern const upb_msglayout envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_msginit;
+extern const upb_msglayout envoy_config_route_v3_RouteAction_MaxStreamDuration_msginit;
+extern const upb_msglayout envoy_config_route_v3_RetryPolicy_msginit;
+extern const upb_msglayout envoy_config_route_v3_RetryPolicy_RetryPriority_msginit;
+extern const upb_msglayout envoy_config_route_v3_RetryPolicy_RetryHostPredicate_msginit;
+extern const upb_msglayout envoy_config_route_v3_RetryPolicy_RetryBackOff_msginit;
+extern const upb_msglayout envoy_config_route_v3_RetryPolicy_ResetHeader_msginit;
+extern const upb_msglayout envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_msginit;
+extern const upb_msglayout envoy_config_route_v3_HedgePolicy_msginit;
+extern const upb_msglayout envoy_config_route_v3_RedirectAction_msginit;
+extern const upb_msglayout envoy_config_route_v3_DirectResponseAction_msginit;
+extern const upb_msglayout envoy_config_route_v3_Decorator_msginit;
+extern const upb_msglayout envoy_config_route_v3_Tracing_msginit;
+extern const upb_msglayout envoy_config_route_v3_VirtualCluster_msginit;
+extern const upb_msglayout envoy_config_route_v3_RateLimit_msginit;
+extern const upb_msglayout envoy_config_route_v3_RateLimit_Action_msginit;
+extern const upb_msglayout envoy_config_route_v3_RateLimit_Action_SourceCluster_msginit;
+extern const upb_msglayout envoy_config_route_v3_RateLimit_Action_DestinationCluster_msginit;
+extern const upb_msglayout envoy_config_route_v3_RateLimit_Action_RequestHeaders_msginit;
+extern const upb_msglayout envoy_config_route_v3_RateLimit_Action_RemoteAddress_msginit;
+extern const upb_msglayout envoy_config_route_v3_RateLimit_Action_GenericKey_msginit;
+extern const upb_msglayout envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_msginit;
+extern const upb_msglayout envoy_config_route_v3_RateLimit_Action_DynamicMetaData_msginit;
+extern const upb_msglayout envoy_config_route_v3_RateLimit_Override_msginit;
+extern const upb_msglayout envoy_config_route_v3_RateLimit_Override_DynamicMetadata_msginit;
+extern const upb_msglayout envoy_config_route_v3_HeaderMatcher_msginit;
+extern const upb_msglayout envoy_config_route_v3_QueryParameterMatcher_msginit;
+extern const upb_msglayout envoy_config_route_v3_InternalRedirectPolicy_msginit;
+struct envoy_config_core_v3_DataSource;
+struct envoy_config_core_v3_HeaderValueOption;
+struct envoy_config_core_v3_Metadata;
+struct envoy_config_core_v3_ProxyProtocolConfig;
+struct envoy_config_core_v3_RuntimeFractionalPercent;
+struct envoy_config_core_v3_TypedExtensionConfig;
+struct envoy_type_matcher_v3_RegexMatchAndSubstitute;
+struct envoy_type_matcher_v3_RegexMatcher;
+struct envoy_type_matcher_v3_StringMatcher;
+struct envoy_type_metadata_v3_MetadataKey;
+struct envoy_type_tracing_v3_CustomTag;
+struct envoy_type_v3_FractionalPercent;
+struct envoy_type_v3_Int64Range;
+struct google_protobuf_Any;
+struct google_protobuf_BoolValue;
+struct google_protobuf_Duration;
+struct google_protobuf_UInt32Value;
+extern const upb_msglayout envoy_config_core_v3_DataSource_msginit;
+extern const upb_msglayout envoy_config_core_v3_HeaderValueOption_msginit;
+extern const upb_msglayout envoy_config_core_v3_Metadata_msginit;
+extern const upb_msglayout envoy_config_core_v3_ProxyProtocolConfig_msginit;
+extern const upb_msglayout envoy_config_core_v3_RuntimeFractionalPercent_msginit;
+extern const upb_msglayout envoy_config_core_v3_TypedExtensionConfig_msginit;
+extern const upb_msglayout envoy_type_matcher_v3_RegexMatchAndSubstitute_msginit;
+extern const upb_msglayout envoy_type_matcher_v3_RegexMatcher_msginit;
+extern const upb_msglayout envoy_type_matcher_v3_StringMatcher_msginit;
+extern const upb_msglayout envoy_type_metadata_v3_MetadataKey_msginit;
+extern const upb_msglayout envoy_type_tracing_v3_CustomTag_msginit;
+extern const upb_msglayout envoy_type_v3_FractionalPercent_msginit;
+extern const upb_msglayout envoy_type_v3_Int64Range_msginit;
+extern const upb_msglayout google_protobuf_Any_msginit;
+extern const upb_msglayout google_protobuf_BoolValue_msginit;
+extern const upb_msglayout google_protobuf_Duration_msginit;
+extern const upb_msglayout google_protobuf_UInt32Value_msginit;
+
+typedef enum {
+ envoy_config_route_v3_RedirectAction_MOVED_PERMANENTLY = 0,
+ envoy_config_route_v3_RedirectAction_FOUND = 1,
+ envoy_config_route_v3_RedirectAction_SEE_OTHER = 2,
+ envoy_config_route_v3_RedirectAction_TEMPORARY_REDIRECT = 3,
+ envoy_config_route_v3_RedirectAction_PERMANENT_REDIRECT = 4
+} envoy_config_route_v3_RedirectAction_RedirectResponseCode;
+
+typedef enum {
+ envoy_config_route_v3_RetryPolicy_SECONDS = 0,
+ envoy_config_route_v3_RetryPolicy_UNIX_TIMESTAMP = 1
+} envoy_config_route_v3_RetryPolicy_ResetHeaderFormat;
+
+typedef enum {
+ envoy_config_route_v3_RouteAction_SERVICE_UNAVAILABLE = 0,
+ envoy_config_route_v3_RouteAction_NOT_FOUND = 1
+} envoy_config_route_v3_RouteAction_ClusterNotFoundResponseCode;
+
+typedef enum {
+ envoy_config_route_v3_RouteAction_PASS_THROUGH_INTERNAL_REDIRECT = 0,
+ envoy_config_route_v3_RouteAction_HANDLE_INTERNAL_REDIRECT = 1
+} envoy_config_route_v3_RouteAction_InternalRedirectAction;
+
+typedef enum {
+ envoy_config_route_v3_VirtualHost_NONE = 0,
+ envoy_config_route_v3_VirtualHost_EXTERNAL_ONLY = 1,
+ envoy_config_route_v3_VirtualHost_ALL = 2
+} envoy_config_route_v3_VirtualHost_TlsRequirementType;
+
+
+/* envoy.config.route.v3.VirtualHost */
+
+UPB_INLINE envoy_config_route_v3_VirtualHost *envoy_config_route_v3_VirtualHost_new(upb_arena *arena) {
+ return (envoy_config_route_v3_VirtualHost *)_upb_msg_new(&envoy_config_route_v3_VirtualHost_msginit, arena);
+}
+UPB_INLINE envoy_config_route_v3_VirtualHost *envoy_config_route_v3_VirtualHost_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_route_v3_VirtualHost *ret = envoy_config_route_v3_VirtualHost_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_VirtualHost_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_route_v3_VirtualHost_serialize(const envoy_config_route_v3_VirtualHost *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_route_v3_VirtualHost_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview envoy_config_route_v3_VirtualHost_name(const envoy_config_route_v3_VirtualHost *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 16), upb_strview); }
+UPB_INLINE upb_strview const* envoy_config_route_v3_VirtualHost_domains(const envoy_config_route_v3_VirtualHost *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(40, 72), len); }
+UPB_INLINE bool envoy_config_route_v3_VirtualHost_has_routes(const envoy_config_route_v3_VirtualHost *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(44, 80)); }
+UPB_INLINE const envoy_config_route_v3_Route* const* envoy_config_route_v3_VirtualHost_routes(const envoy_config_route_v3_VirtualHost *msg, size_t *len) { return (const envoy_config_route_v3_Route* const*)_upb_array_accessor(msg, UPB_SIZE(44, 80), len); }
+UPB_INLINE int32_t envoy_config_route_v3_VirtualHost_require_tls(const envoy_config_route_v3_VirtualHost *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
+UPB_INLINE bool envoy_config_route_v3_VirtualHost_has_virtual_clusters(const envoy_config_route_v3_VirtualHost *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(48, 88)); }
+UPB_INLINE const envoy_config_route_v3_VirtualCluster* const* envoy_config_route_v3_VirtualHost_virtual_clusters(const envoy_config_route_v3_VirtualHost *msg, size_t *len) { return (const envoy_config_route_v3_VirtualCluster* const*)_upb_array_accessor(msg, UPB_SIZE(48, 88), len); }
+UPB_INLINE bool envoy_config_route_v3_VirtualHost_has_rate_limits(const envoy_config_route_v3_VirtualHost *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(52, 96)); }
+UPB_INLINE const envoy_config_route_v3_RateLimit* const* envoy_config_route_v3_VirtualHost_rate_limits(const envoy_config_route_v3_VirtualHost *msg, size_t *len) { return (const envoy_config_route_v3_RateLimit* const*)_upb_array_accessor(msg, UPB_SIZE(52, 96), len); }
+UPB_INLINE bool envoy_config_route_v3_VirtualHost_has_request_headers_to_add(const envoy_config_route_v3_VirtualHost *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(56, 104)); }
+UPB_INLINE const struct envoy_config_core_v3_HeaderValueOption* const* envoy_config_route_v3_VirtualHost_request_headers_to_add(const envoy_config_route_v3_VirtualHost *msg, size_t *len) { return (const struct envoy_config_core_v3_HeaderValueOption* const*)_upb_array_accessor(msg, UPB_SIZE(56, 104), len); }
+UPB_INLINE bool envoy_config_route_v3_VirtualHost_has_cors(const envoy_config_route_v3_VirtualHost *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 32)); }
+UPB_INLINE const envoy_config_route_v3_CorsPolicy* envoy_config_route_v3_VirtualHost_cors(const envoy_config_route_v3_VirtualHost *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const envoy_config_route_v3_CorsPolicy*); }
+UPB_INLINE bool envoy_config_route_v3_VirtualHost_has_response_headers_to_add(const envoy_config_route_v3_VirtualHost *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(60, 112)); }
+UPB_INLINE const struct envoy_config_core_v3_HeaderValueOption* const* envoy_config_route_v3_VirtualHost_response_headers_to_add(const envoy_config_route_v3_VirtualHost *msg, size_t *len) { return (const struct envoy_config_core_v3_HeaderValueOption* const*)_upb_array_accessor(msg, UPB_SIZE(60, 112), len); }
+UPB_INLINE upb_strview const* envoy_config_route_v3_VirtualHost_response_headers_to_remove(const envoy_config_route_v3_VirtualHost *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(64, 120), len); }
+UPB_INLINE upb_strview const* envoy_config_route_v3_VirtualHost_request_headers_to_remove(const envoy_config_route_v3_VirtualHost *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(68, 128), len); }
+UPB_INLINE bool envoy_config_route_v3_VirtualHost_include_request_attempt_count(const envoy_config_route_v3_VirtualHost *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool); }
+UPB_INLINE bool envoy_config_route_v3_VirtualHost_has_typed_per_filter_config(const envoy_config_route_v3_VirtualHost *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(72, 136)); }
+UPB_INLINE size_t envoy_config_route_v3_VirtualHost_typed_per_filter_config_size(const envoy_config_route_v3_VirtualHost *msg) {return _upb_msg_map_size(msg, UPB_SIZE(72, 136)); }
+UPB_INLINE bool envoy_config_route_v3_VirtualHost_typed_per_filter_config_get(const envoy_config_route_v3_VirtualHost *msg, upb_strview key, struct google_protobuf_Any* *val) { return _upb_msg_map_get(msg, UPB_SIZE(72, 136), &key, 0, val, sizeof(*val)); }
+UPB_INLINE const envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry* envoy_config_route_v3_VirtualHost_typed_per_filter_config_next(const envoy_config_route_v3_VirtualHost *msg, size_t* iter) { return (const envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry*)_upb_msg_map_next(msg, UPB_SIZE(72, 136), iter); }
+UPB_INLINE bool envoy_config_route_v3_VirtualHost_has_retry_policy(const envoy_config_route_v3_VirtualHost *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 40)); }
+UPB_INLINE const envoy_config_route_v3_RetryPolicy* envoy_config_route_v3_VirtualHost_retry_policy(const envoy_config_route_v3_VirtualHost *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const envoy_config_route_v3_RetryPolicy*); }
+UPB_INLINE bool envoy_config_route_v3_VirtualHost_has_hedge_policy(const envoy_config_route_v3_VirtualHost *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 48)); }
+UPB_INLINE const envoy_config_route_v3_HedgePolicy* envoy_config_route_v3_VirtualHost_hedge_policy(const envoy_config_route_v3_VirtualHost *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 48), const envoy_config_route_v3_HedgePolicy*); }
+UPB_INLINE bool envoy_config_route_v3_VirtualHost_has_per_request_buffer_limit_bytes(const envoy_config_route_v3_VirtualHost *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(32, 56)); }
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_route_v3_VirtualHost_per_request_buffer_limit_bytes(const envoy_config_route_v3_VirtualHost *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 56), const struct google_protobuf_UInt32Value*); }
+UPB_INLINE bool envoy_config_route_v3_VirtualHost_include_attempt_count_in_response(const envoy_config_route_v3_VirtualHost *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(9, 9), bool); }
+UPB_INLINE bool envoy_config_route_v3_VirtualHost_has_retry_policy_typed_config(const envoy_config_route_v3_VirtualHost *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(36, 64)); }
+UPB_INLINE const struct google_protobuf_Any* envoy_config_route_v3_VirtualHost_retry_policy_typed_config(const envoy_config_route_v3_VirtualHost *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(36, 64), const struct google_protobuf_Any*); }
+
+UPB_INLINE void envoy_config_route_v3_VirtualHost_set_name(envoy_config_route_v3_VirtualHost *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 16), upb_strview) = value;
+}
+UPB_INLINE upb_strview* envoy_config_route_v3_VirtualHost_mutable_domains(envoy_config_route_v3_VirtualHost *msg, size_t *len) {
+ return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(40, 72), len);
+}
+UPB_INLINE upb_strview* envoy_config_route_v3_VirtualHost_resize_domains(envoy_config_route_v3_VirtualHost *msg, size_t len, upb_arena *arena) {
+ return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(40, 72), len, UPB_TYPE_STRING, arena);
+}
+UPB_INLINE bool envoy_config_route_v3_VirtualHost_add_domains(envoy_config_route_v3_VirtualHost *msg, upb_strview val, upb_arena *arena) {
+ return _upb_array_append_accessor(msg, UPB_SIZE(40, 72), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
+ arena);
+}
+UPB_INLINE envoy_config_route_v3_Route** envoy_config_route_v3_VirtualHost_mutable_routes(envoy_config_route_v3_VirtualHost *msg, size_t *len) {
+ return (envoy_config_route_v3_Route**)_upb_array_mutable_accessor(msg, UPB_SIZE(44, 80), len);
+}
+UPB_INLINE envoy_config_route_v3_Route** envoy_config_route_v3_VirtualHost_resize_routes(envoy_config_route_v3_VirtualHost *msg, size_t len, upb_arena *arena) {
+ return (envoy_config_route_v3_Route**)_upb_array_resize_accessor(msg, UPB_SIZE(44, 80), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_config_route_v3_Route* envoy_config_route_v3_VirtualHost_add_routes(envoy_config_route_v3_VirtualHost *msg, upb_arena *arena) {
+ struct envoy_config_route_v3_Route* sub = (struct envoy_config_route_v3_Route*)_upb_msg_new(&envoy_config_route_v3_Route_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(44, 80), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE void envoy_config_route_v3_VirtualHost_set_require_tls(envoy_config_route_v3_VirtualHost *msg, int32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
+}
+UPB_INLINE envoy_config_route_v3_VirtualCluster** envoy_config_route_v3_VirtualHost_mutable_virtual_clusters(envoy_config_route_v3_VirtualHost *msg, size_t *len) {
+ return (envoy_config_route_v3_VirtualCluster**)_upb_array_mutable_accessor(msg, UPB_SIZE(48, 88), len);
+}
+UPB_INLINE envoy_config_route_v3_VirtualCluster** envoy_config_route_v3_VirtualHost_resize_virtual_clusters(envoy_config_route_v3_VirtualHost *msg, size_t len, upb_arena *arena) {
+ return (envoy_config_route_v3_VirtualCluster**)_upb_array_resize_accessor(msg, UPB_SIZE(48, 88), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_config_route_v3_VirtualCluster* envoy_config_route_v3_VirtualHost_add_virtual_clusters(envoy_config_route_v3_VirtualHost *msg, upb_arena *arena) {
+ struct envoy_config_route_v3_VirtualCluster* sub = (struct envoy_config_route_v3_VirtualCluster*)_upb_msg_new(&envoy_config_route_v3_VirtualCluster_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(48, 88), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE envoy_config_route_v3_RateLimit** envoy_config_route_v3_VirtualHost_mutable_rate_limits(envoy_config_route_v3_VirtualHost *msg, size_t *len) {
+ return (envoy_config_route_v3_RateLimit**)_upb_array_mutable_accessor(msg, UPB_SIZE(52, 96), len);
+}
+UPB_INLINE envoy_config_route_v3_RateLimit** envoy_config_route_v3_VirtualHost_resize_rate_limits(envoy_config_route_v3_VirtualHost *msg, size_t len, upb_arena *arena) {
+ return (envoy_config_route_v3_RateLimit**)_upb_array_resize_accessor(msg, UPB_SIZE(52, 96), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_config_route_v3_RateLimit* envoy_config_route_v3_VirtualHost_add_rate_limits(envoy_config_route_v3_VirtualHost *msg, upb_arena *arena) {
+ struct envoy_config_route_v3_RateLimit* sub = (struct envoy_config_route_v3_RateLimit*)_upb_msg_new(&envoy_config_route_v3_RateLimit_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(52, 96), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_config_route_v3_VirtualHost_mutable_request_headers_to_add(envoy_config_route_v3_VirtualHost *msg, size_t *len) {
+ return (struct envoy_config_core_v3_HeaderValueOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(56, 104), len);
+}
+UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_config_route_v3_VirtualHost_resize_request_headers_to_add(envoy_config_route_v3_VirtualHost *msg, size_t len, upb_arena *arena) {
+ return (struct envoy_config_core_v3_HeaderValueOption**)_upb_array_resize_accessor(msg, UPB_SIZE(56, 104), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_config_core_v3_HeaderValueOption* envoy_config_route_v3_VirtualHost_add_request_headers_to_add(envoy_config_route_v3_VirtualHost *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_HeaderValueOption* sub = (struct envoy_config_core_v3_HeaderValueOption*)_upb_msg_new(&envoy_config_core_v3_HeaderValueOption_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(56, 104), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE void envoy_config_route_v3_VirtualHost_set_cors(envoy_config_route_v3_VirtualHost *msg, envoy_config_route_v3_CorsPolicy* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 32), envoy_config_route_v3_CorsPolicy*) = value;
+}
+UPB_INLINE struct envoy_config_route_v3_CorsPolicy* envoy_config_route_v3_VirtualHost_mutable_cors(envoy_config_route_v3_VirtualHost *msg, upb_arena *arena) {
+ struct envoy_config_route_v3_CorsPolicy* sub = (struct envoy_config_route_v3_CorsPolicy*)envoy_config_route_v3_VirtualHost_cors(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_route_v3_CorsPolicy*)_upb_msg_new(&envoy_config_route_v3_CorsPolicy_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_VirtualHost_set_cors(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_config_route_v3_VirtualHost_mutable_response_headers_to_add(envoy_config_route_v3_VirtualHost *msg, size_t *len) {
+ return (struct envoy_config_core_v3_HeaderValueOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(60, 112), len);
+}
+UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_config_route_v3_VirtualHost_resize_response_headers_to_add(envoy_config_route_v3_VirtualHost *msg, size_t len, upb_arena *arena) {
+ return (struct envoy_config_core_v3_HeaderValueOption**)_upb_array_resize_accessor(msg, UPB_SIZE(60, 112), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_config_core_v3_HeaderValueOption* envoy_config_route_v3_VirtualHost_add_response_headers_to_add(envoy_config_route_v3_VirtualHost *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_HeaderValueOption* sub = (struct envoy_config_core_v3_HeaderValueOption*)_upb_msg_new(&envoy_config_core_v3_HeaderValueOption_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(60, 112), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE upb_strview* envoy_config_route_v3_VirtualHost_mutable_response_headers_to_remove(envoy_config_route_v3_VirtualHost *msg, size_t *len) {
+ return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(64, 120), len);
+}
+UPB_INLINE upb_strview* envoy_config_route_v3_VirtualHost_resize_response_headers_to_remove(envoy_config_route_v3_VirtualHost *msg, size_t len, upb_arena *arena) {
+ return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(64, 120), len, UPB_TYPE_STRING, arena);
+}
+UPB_INLINE bool envoy_config_route_v3_VirtualHost_add_response_headers_to_remove(envoy_config_route_v3_VirtualHost *msg, upb_strview val, upb_arena *arena) {
+ return _upb_array_append_accessor(msg, UPB_SIZE(64, 120), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
+ arena);
+}
+UPB_INLINE upb_strview* envoy_config_route_v3_VirtualHost_mutable_request_headers_to_remove(envoy_config_route_v3_VirtualHost *msg, size_t *len) {
+ return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(68, 128), len);
+}
+UPB_INLINE upb_strview* envoy_config_route_v3_VirtualHost_resize_request_headers_to_remove(envoy_config_route_v3_VirtualHost *msg, size_t len, upb_arena *arena) {
+ return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(68, 128), len, UPB_TYPE_STRING, arena);
+}
+UPB_INLINE bool envoy_config_route_v3_VirtualHost_add_request_headers_to_remove(envoy_config_route_v3_VirtualHost *msg, upb_strview val, upb_arena *arena) {
+ return _upb_array_append_accessor(msg, UPB_SIZE(68, 128), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
+ arena);
+}
+UPB_INLINE void envoy_config_route_v3_VirtualHost_set_include_request_attempt_count(envoy_config_route_v3_VirtualHost *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = value;
+}
+UPB_INLINE void envoy_config_route_v3_VirtualHost_typed_per_filter_config_clear(envoy_config_route_v3_VirtualHost *msg) { _upb_msg_map_clear(msg, UPB_SIZE(72, 136)); }
+UPB_INLINE bool envoy_config_route_v3_VirtualHost_typed_per_filter_config_set(envoy_config_route_v3_VirtualHost *msg, upb_strview key, struct google_protobuf_Any* val, upb_arena *a) { return _upb_msg_map_set(msg, UPB_SIZE(72, 136), &key, 0, &val, sizeof(val), a); }
+UPB_INLINE bool envoy_config_route_v3_VirtualHost_typed_per_filter_config_delete(envoy_config_route_v3_VirtualHost *msg, upb_strview key) { return _upb_msg_map_delete(msg, UPB_SIZE(72, 136), &key, 0); }
+UPB_INLINE envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry* envoy_config_route_v3_VirtualHost_typed_per_filter_config_nextmutable(envoy_config_route_v3_VirtualHost *msg, size_t* iter) { return (envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry*)_upb_msg_map_next(msg, UPB_SIZE(72, 136), iter); }
+UPB_INLINE void envoy_config_route_v3_VirtualHost_set_retry_policy(envoy_config_route_v3_VirtualHost *msg, envoy_config_route_v3_RetryPolicy* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 40), envoy_config_route_v3_RetryPolicy*) = value;
+}
+UPB_INLINE struct envoy_config_route_v3_RetryPolicy* envoy_config_route_v3_VirtualHost_mutable_retry_policy(envoy_config_route_v3_VirtualHost *msg, upb_arena *arena) {
+ struct envoy_config_route_v3_RetryPolicy* sub = (struct envoy_config_route_v3_RetryPolicy*)envoy_config_route_v3_VirtualHost_retry_policy(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_route_v3_RetryPolicy*)_upb_msg_new(&envoy_config_route_v3_RetryPolicy_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_VirtualHost_set_retry_policy(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_route_v3_VirtualHost_set_hedge_policy(envoy_config_route_v3_VirtualHost *msg, envoy_config_route_v3_HedgePolicy* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 48), envoy_config_route_v3_HedgePolicy*) = value;
+}
+UPB_INLINE struct envoy_config_route_v3_HedgePolicy* envoy_config_route_v3_VirtualHost_mutable_hedge_policy(envoy_config_route_v3_VirtualHost *msg, upb_arena *arena) {
+ struct envoy_config_route_v3_HedgePolicy* sub = (struct envoy_config_route_v3_HedgePolicy*)envoy_config_route_v3_VirtualHost_hedge_policy(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_route_v3_HedgePolicy*)_upb_msg_new(&envoy_config_route_v3_HedgePolicy_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_VirtualHost_set_hedge_policy(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_route_v3_VirtualHost_set_per_request_buffer_limit_bytes(envoy_config_route_v3_VirtualHost *msg, struct google_protobuf_UInt32Value* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 56), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_route_v3_VirtualHost_mutable_per_request_buffer_limit_bytes(envoy_config_route_v3_VirtualHost *msg, upb_arena *arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_route_v3_VirtualHost_per_request_buffer_limit_bytes(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_VirtualHost_set_per_request_buffer_limit_bytes(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_route_v3_VirtualHost_set_include_attempt_count_in_response(envoy_config_route_v3_VirtualHost *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(9, 9), bool) = value;
+}
+UPB_INLINE void envoy_config_route_v3_VirtualHost_set_retry_policy_typed_config(envoy_config_route_v3_VirtualHost *msg, struct google_protobuf_Any* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(36, 64), struct google_protobuf_Any*) = value;
+}
+UPB_INLINE struct google_protobuf_Any* envoy_config_route_v3_VirtualHost_mutable_retry_policy_typed_config(envoy_config_route_v3_VirtualHost *msg, upb_arena *arena) {
+ struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_config_route_v3_VirtualHost_retry_policy_typed_config(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_VirtualHost_set_retry_policy_typed_config(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.route.v3.VirtualHost.TypedPerFilterConfigEntry */
+
+UPB_INLINE upb_strview envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry_key(const envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry *msg) {
+ upb_strview ret;
+ _upb_msg_map_key(msg, &ret, 0);
+ return ret;
+}
+UPB_INLINE bool envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry_has_value(const envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
+UPB_INLINE const struct google_protobuf_Any* envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry_value(const envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry *msg) {
+ struct google_protobuf_Any* ret;
+ _upb_msg_map_value(msg, &ret, sizeof(ret));
+ return ret;
+}
+
+UPB_INLINE void envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry_set_value(envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry *msg, struct google_protobuf_Any* value) {
+ _upb_msg_map_set_value(msg, &value, sizeof(struct google_protobuf_Any*));
+}
+
+/* envoy.config.route.v3.FilterAction */
+
+UPB_INLINE envoy_config_route_v3_FilterAction *envoy_config_route_v3_FilterAction_new(upb_arena *arena) {
+ return (envoy_config_route_v3_FilterAction *)_upb_msg_new(&envoy_config_route_v3_FilterAction_msginit, arena);
+}
+UPB_INLINE envoy_config_route_v3_FilterAction *envoy_config_route_v3_FilterAction_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_route_v3_FilterAction *ret = envoy_config_route_v3_FilterAction_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_FilterAction_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_route_v3_FilterAction_serialize(const envoy_config_route_v3_FilterAction *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_route_v3_FilterAction_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_route_v3_FilterAction_has_action(const envoy_config_route_v3_FilterAction *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE const struct google_protobuf_Any* envoy_config_route_v3_FilterAction_action(const envoy_config_route_v3_FilterAction *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct google_protobuf_Any*); }
+
+UPB_INLINE void envoy_config_route_v3_FilterAction_set_action(envoy_config_route_v3_FilterAction *msg, struct google_protobuf_Any* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct google_protobuf_Any*) = value;
+}
+UPB_INLINE struct google_protobuf_Any* envoy_config_route_v3_FilterAction_mutable_action(envoy_config_route_v3_FilterAction *msg, upb_arena *arena) {
+ struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_config_route_v3_FilterAction_action(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_FilterAction_set_action(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.route.v3.Route */
+
+UPB_INLINE envoy_config_route_v3_Route *envoy_config_route_v3_Route_new(upb_arena *arena) {
+ return (envoy_config_route_v3_Route *)_upb_msg_new(&envoy_config_route_v3_Route_msginit, arena);
+}
+UPB_INLINE envoy_config_route_v3_Route *envoy_config_route_v3_Route_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_route_v3_Route *ret = envoy_config_route_v3_Route_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_Route_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_route_v3_Route_serialize(const envoy_config_route_v3_Route *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_route_v3_Route_msginit, arena, len);
+}
+
+typedef enum {
+ envoy_config_route_v3_Route_action_route = 2,
+ envoy_config_route_v3_Route_action_redirect = 3,
+ envoy_config_route_v3_Route_action_direct_response = 7,
+ envoy_config_route_v3_Route_action_filter_action = 17,
+ envoy_config_route_v3_Route_action_NOT_SET = 0
+} envoy_config_route_v3_Route_action_oneofcases;
+UPB_INLINE envoy_config_route_v3_Route_action_oneofcases envoy_config_route_v3_Route_action_case(const envoy_config_route_v3_Route* msg) { return (envoy_config_route_v3_Route_action_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(52, 104), int32_t); }
+
+UPB_INLINE bool envoy_config_route_v3_Route_has_match(const envoy_config_route_v3_Route *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
+UPB_INLINE const envoy_config_route_v3_RouteMatch* envoy_config_route_v3_Route_match(const envoy_config_route_v3_Route *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const envoy_config_route_v3_RouteMatch*); }
+UPB_INLINE bool envoy_config_route_v3_Route_has_route(const envoy_config_route_v3_Route *msg) { return _upb_getoneofcase(msg, UPB_SIZE(52, 104)) == 2; }
+UPB_INLINE const envoy_config_route_v3_RouteAction* envoy_config_route_v3_Route_route(const envoy_config_route_v3_Route *msg) { return UPB_READ_ONEOF(msg, const envoy_config_route_v3_RouteAction*, UPB_SIZE(48, 96), UPB_SIZE(52, 104), 2, NULL); }
+UPB_INLINE bool envoy_config_route_v3_Route_has_redirect(const envoy_config_route_v3_Route *msg) { return _upb_getoneofcase(msg, UPB_SIZE(52, 104)) == 3; }
+UPB_INLINE const envoy_config_route_v3_RedirectAction* envoy_config_route_v3_Route_redirect(const envoy_config_route_v3_Route *msg) { return UPB_READ_ONEOF(msg, const envoy_config_route_v3_RedirectAction*, UPB_SIZE(48, 96), UPB_SIZE(52, 104), 3, NULL); }
+UPB_INLINE bool envoy_config_route_v3_Route_has_metadata(const envoy_config_route_v3_Route *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
+UPB_INLINE const struct envoy_config_core_v3_Metadata* envoy_config_route_v3_Route_metadata(const envoy_config_route_v3_Route *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct envoy_config_core_v3_Metadata*); }
+UPB_INLINE bool envoy_config_route_v3_Route_has_decorator(const envoy_config_route_v3_Route *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); }
+UPB_INLINE const envoy_config_route_v3_Decorator* envoy_config_route_v3_Route_decorator(const envoy_config_route_v3_Route *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const envoy_config_route_v3_Decorator*); }
+UPB_INLINE bool envoy_config_route_v3_Route_has_direct_response(const envoy_config_route_v3_Route *msg) { return _upb_getoneofcase(msg, UPB_SIZE(52, 104)) == 7; }
+UPB_INLINE const envoy_config_route_v3_DirectResponseAction* envoy_config_route_v3_Route_direct_response(const envoy_config_route_v3_Route *msg) { return UPB_READ_ONEOF(msg, const envoy_config_route_v3_DirectResponseAction*, UPB_SIZE(48, 96), UPB_SIZE(52, 104), 7, NULL); }
+UPB_INLINE bool envoy_config_route_v3_Route_has_request_headers_to_add(const envoy_config_route_v3_Route *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 56)); }
+UPB_INLINE const struct envoy_config_core_v3_HeaderValueOption* const* envoy_config_route_v3_Route_request_headers_to_add(const envoy_config_route_v3_Route *msg, size_t *len) { return (const struct envoy_config_core_v3_HeaderValueOption* const*)_upb_array_accessor(msg, UPB_SIZE(28, 56), len); }
+UPB_INLINE bool envoy_config_route_v3_Route_has_response_headers_to_add(const envoy_config_route_v3_Route *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(32, 64)); }
+UPB_INLINE const struct envoy_config_core_v3_HeaderValueOption* const* envoy_config_route_v3_Route_response_headers_to_add(const envoy_config_route_v3_Route *msg, size_t *len) { return (const struct envoy_config_core_v3_HeaderValueOption* const*)_upb_array_accessor(msg, UPB_SIZE(32, 64), len); }
+UPB_INLINE upb_strview const* envoy_config_route_v3_Route_response_headers_to_remove(const envoy_config_route_v3_Route *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(36, 72), len); }
+UPB_INLINE upb_strview const* envoy_config_route_v3_Route_request_headers_to_remove(const envoy_config_route_v3_Route *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(40, 80), len); }
+UPB_INLINE bool envoy_config_route_v3_Route_has_typed_per_filter_config(const envoy_config_route_v3_Route *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(44, 88)); }
+UPB_INLINE size_t envoy_config_route_v3_Route_typed_per_filter_config_size(const envoy_config_route_v3_Route *msg) {return _upb_msg_map_size(msg, UPB_SIZE(44, 88)); }
+UPB_INLINE bool envoy_config_route_v3_Route_typed_per_filter_config_get(const envoy_config_route_v3_Route *msg, upb_strview key, struct google_protobuf_Any* *val) { return _upb_msg_map_get(msg, UPB_SIZE(44, 88), &key, 0, val, sizeof(*val)); }
+UPB_INLINE const envoy_config_route_v3_Route_TypedPerFilterConfigEntry* envoy_config_route_v3_Route_typed_per_filter_config_next(const envoy_config_route_v3_Route *msg, size_t* iter) { return (const envoy_config_route_v3_Route_TypedPerFilterConfigEntry*)_upb_msg_map_next(msg, UPB_SIZE(44, 88), iter); }
+UPB_INLINE upb_strview envoy_config_route_v3_Route_name(const envoy_config_route_v3_Route *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE bool envoy_config_route_v3_Route_has_tracing(const envoy_config_route_v3_Route *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 40)); }
+UPB_INLINE const envoy_config_route_v3_Tracing* envoy_config_route_v3_Route_tracing(const envoy_config_route_v3_Route *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const envoy_config_route_v3_Tracing*); }
+UPB_INLINE bool envoy_config_route_v3_Route_has_per_request_buffer_limit_bytes(const envoy_config_route_v3_Route *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 48)); }
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_route_v3_Route_per_request_buffer_limit_bytes(const envoy_config_route_v3_Route *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 48), const struct google_protobuf_UInt32Value*); }
+UPB_INLINE bool envoy_config_route_v3_Route_has_filter_action(const envoy_config_route_v3_Route *msg) { return _upb_getoneofcase(msg, UPB_SIZE(52, 104)) == 17; }
+UPB_INLINE const envoy_config_route_v3_FilterAction* envoy_config_route_v3_Route_filter_action(const envoy_config_route_v3_Route *msg) { return UPB_READ_ONEOF(msg, const envoy_config_route_v3_FilterAction*, UPB_SIZE(48, 96), UPB_SIZE(52, 104), 17, NULL); }
+
+UPB_INLINE void envoy_config_route_v3_Route_set_match(envoy_config_route_v3_Route *msg, envoy_config_route_v3_RouteMatch* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), envoy_config_route_v3_RouteMatch*) = value;
+}
+UPB_INLINE struct envoy_config_route_v3_RouteMatch* envoy_config_route_v3_Route_mutable_match(envoy_config_route_v3_Route *msg, upb_arena *arena) {
+ struct envoy_config_route_v3_RouteMatch* sub = (struct envoy_config_route_v3_RouteMatch*)envoy_config_route_v3_Route_match(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_route_v3_RouteMatch*)_upb_msg_new(&envoy_config_route_v3_RouteMatch_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_Route_set_match(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_route_v3_Route_set_route(envoy_config_route_v3_Route *msg, envoy_config_route_v3_RouteAction* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RouteAction*, UPB_SIZE(48, 96), value, UPB_SIZE(52, 104), 2);
+}
+UPB_INLINE struct envoy_config_route_v3_RouteAction* envoy_config_route_v3_Route_mutable_route(envoy_config_route_v3_Route *msg, upb_arena *arena) {
+ struct envoy_config_route_v3_RouteAction* sub = (struct envoy_config_route_v3_RouteAction*)envoy_config_route_v3_Route_route(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_route_v3_RouteAction*)_upb_msg_new(&envoy_config_route_v3_RouteAction_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_Route_set_route(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_route_v3_Route_set_redirect(envoy_config_route_v3_Route *msg, envoy_config_route_v3_RedirectAction* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RedirectAction*, UPB_SIZE(48, 96), value, UPB_SIZE(52, 104), 3);
+}
+UPB_INLINE struct envoy_config_route_v3_RedirectAction* envoy_config_route_v3_Route_mutable_redirect(envoy_config_route_v3_Route *msg, upb_arena *arena) {
+ struct envoy_config_route_v3_RedirectAction* sub = (struct envoy_config_route_v3_RedirectAction*)envoy_config_route_v3_Route_redirect(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_route_v3_RedirectAction*)_upb_msg_new(&envoy_config_route_v3_RedirectAction_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_Route_set_redirect(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_route_v3_Route_set_metadata(envoy_config_route_v3_Route *msg, struct envoy_config_core_v3_Metadata* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct envoy_config_core_v3_Metadata*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_Metadata* envoy_config_route_v3_Route_mutable_metadata(envoy_config_route_v3_Route *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_Metadata* sub = (struct envoy_config_core_v3_Metadata*)envoy_config_route_v3_Route_metadata(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_Metadata*)_upb_msg_new(&envoy_config_core_v3_Metadata_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_Route_set_metadata(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_route_v3_Route_set_decorator(envoy_config_route_v3_Route *msg, envoy_config_route_v3_Decorator* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), envoy_config_route_v3_Decorator*) = value;
+}
+UPB_INLINE struct envoy_config_route_v3_Decorator* envoy_config_route_v3_Route_mutable_decorator(envoy_config_route_v3_Route *msg, upb_arena *arena) {
+ struct envoy_config_route_v3_Decorator* sub = (struct envoy_config_route_v3_Decorator*)envoy_config_route_v3_Route_decorator(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_route_v3_Decorator*)_upb_msg_new(&envoy_config_route_v3_Decorator_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_Route_set_decorator(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_route_v3_Route_set_direct_response(envoy_config_route_v3_Route *msg, envoy_config_route_v3_DirectResponseAction* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_route_v3_DirectResponseAction*, UPB_SIZE(48, 96), value, UPB_SIZE(52, 104), 7);
+}
+UPB_INLINE struct envoy_config_route_v3_DirectResponseAction* envoy_config_route_v3_Route_mutable_direct_response(envoy_config_route_v3_Route *msg, upb_arena *arena) {
+ struct envoy_config_route_v3_DirectResponseAction* sub = (struct envoy_config_route_v3_DirectResponseAction*)envoy_config_route_v3_Route_direct_response(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_route_v3_DirectResponseAction*)_upb_msg_new(&envoy_config_route_v3_DirectResponseAction_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_Route_set_direct_response(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_config_route_v3_Route_mutable_request_headers_to_add(envoy_config_route_v3_Route *msg, size_t *len) {
+ return (struct envoy_config_core_v3_HeaderValueOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 56), len);
+}
+UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_config_route_v3_Route_resize_request_headers_to_add(envoy_config_route_v3_Route *msg, size_t len, upb_arena *arena) {
+ return (struct envoy_config_core_v3_HeaderValueOption**)_upb_array_resize_accessor(msg, UPB_SIZE(28, 56), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_config_core_v3_HeaderValueOption* envoy_config_route_v3_Route_add_request_headers_to_add(envoy_config_route_v3_Route *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_HeaderValueOption* sub = (struct envoy_config_core_v3_HeaderValueOption*)_upb_msg_new(&envoy_config_core_v3_HeaderValueOption_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(28, 56), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_config_route_v3_Route_mutable_response_headers_to_add(envoy_config_route_v3_Route *msg, size_t *len) {
+ return (struct envoy_config_core_v3_HeaderValueOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(32, 64), len);
+}
+UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_config_route_v3_Route_resize_response_headers_to_add(envoy_config_route_v3_Route *msg, size_t len, upb_arena *arena) {
+ return (struct envoy_config_core_v3_HeaderValueOption**)_upb_array_resize_accessor(msg, UPB_SIZE(32, 64), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_config_core_v3_HeaderValueOption* envoy_config_route_v3_Route_add_response_headers_to_add(envoy_config_route_v3_Route *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_HeaderValueOption* sub = (struct envoy_config_core_v3_HeaderValueOption*)_upb_msg_new(&envoy_config_core_v3_HeaderValueOption_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(32, 64), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE upb_strview* envoy_config_route_v3_Route_mutable_response_headers_to_remove(envoy_config_route_v3_Route *msg, size_t *len) {
+ return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(36, 72), len);
+}
+UPB_INLINE upb_strview* envoy_config_route_v3_Route_resize_response_headers_to_remove(envoy_config_route_v3_Route *msg, size_t len, upb_arena *arena) {
+ return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(36, 72), len, UPB_TYPE_STRING, arena);
+}
+UPB_INLINE bool envoy_config_route_v3_Route_add_response_headers_to_remove(envoy_config_route_v3_Route *msg, upb_strview val, upb_arena *arena) {
+ return _upb_array_append_accessor(msg, UPB_SIZE(36, 72), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
+ arena);
+}
+UPB_INLINE upb_strview* envoy_config_route_v3_Route_mutable_request_headers_to_remove(envoy_config_route_v3_Route *msg, size_t *len) {
+ return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(40, 80), len);
+}
+UPB_INLINE upb_strview* envoy_config_route_v3_Route_resize_request_headers_to_remove(envoy_config_route_v3_Route *msg, size_t len, upb_arena *arena) {
+ return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(40, 80), len, UPB_TYPE_STRING, arena);
+}
+UPB_INLINE bool envoy_config_route_v3_Route_add_request_headers_to_remove(envoy_config_route_v3_Route *msg, upb_strview val, upb_arena *arena) {
+ return _upb_array_append_accessor(msg, UPB_SIZE(40, 80), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
+ arena);
+}
+UPB_INLINE void envoy_config_route_v3_Route_typed_per_filter_config_clear(envoy_config_route_v3_Route *msg) { _upb_msg_map_clear(msg, UPB_SIZE(44, 88)); }
+UPB_INLINE bool envoy_config_route_v3_Route_typed_per_filter_config_set(envoy_config_route_v3_Route *msg, upb_strview key, struct google_protobuf_Any* val, upb_arena *a) { return _upb_msg_map_set(msg, UPB_SIZE(44, 88), &key, 0, &val, sizeof(val), a); }
+UPB_INLINE bool envoy_config_route_v3_Route_typed_per_filter_config_delete(envoy_config_route_v3_Route *msg, upb_strview key) { return _upb_msg_map_delete(msg, UPB_SIZE(44, 88), &key, 0); }
+UPB_INLINE envoy_config_route_v3_Route_TypedPerFilterConfigEntry* envoy_config_route_v3_Route_typed_per_filter_config_nextmutable(envoy_config_route_v3_Route *msg, size_t* iter) { return (envoy_config_route_v3_Route_TypedPerFilterConfigEntry*)_upb_msg_map_next(msg, UPB_SIZE(44, 88), iter); }
+UPB_INLINE void envoy_config_route_v3_Route_set_name(envoy_config_route_v3_Route *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_route_v3_Route_set_tracing(envoy_config_route_v3_Route *msg, envoy_config_route_v3_Tracing* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 40), envoy_config_route_v3_Tracing*) = value;
+}
+UPB_INLINE struct envoy_config_route_v3_Tracing* envoy_config_route_v3_Route_mutable_tracing(envoy_config_route_v3_Route *msg, upb_arena *arena) {
+ struct envoy_config_route_v3_Tracing* sub = (struct envoy_config_route_v3_Tracing*)envoy_config_route_v3_Route_tracing(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_route_v3_Tracing*)_upb_msg_new(&envoy_config_route_v3_Tracing_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_Route_set_tracing(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_route_v3_Route_set_per_request_buffer_limit_bytes(envoy_config_route_v3_Route *msg, struct google_protobuf_UInt32Value* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 48), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_route_v3_Route_mutable_per_request_buffer_limit_bytes(envoy_config_route_v3_Route *msg, upb_arena *arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_route_v3_Route_per_request_buffer_limit_bytes(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_Route_set_per_request_buffer_limit_bytes(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_route_v3_Route_set_filter_action(envoy_config_route_v3_Route *msg, envoy_config_route_v3_FilterAction* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_route_v3_FilterAction*, UPB_SIZE(48, 96), value, UPB_SIZE(52, 104), 17);
+}
+UPB_INLINE struct envoy_config_route_v3_FilterAction* envoy_config_route_v3_Route_mutable_filter_action(envoy_config_route_v3_Route *msg, upb_arena *arena) {
+ struct envoy_config_route_v3_FilterAction* sub = (struct envoy_config_route_v3_FilterAction*)envoy_config_route_v3_Route_filter_action(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_route_v3_FilterAction*)_upb_msg_new(&envoy_config_route_v3_FilterAction_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_Route_set_filter_action(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.route.v3.Route.TypedPerFilterConfigEntry */
+
+UPB_INLINE upb_strview envoy_config_route_v3_Route_TypedPerFilterConfigEntry_key(const envoy_config_route_v3_Route_TypedPerFilterConfigEntry *msg) {
+ upb_strview ret;
+ _upb_msg_map_key(msg, &ret, 0);
+ return ret;
+}
+UPB_INLINE bool envoy_config_route_v3_Route_TypedPerFilterConfigEntry_has_value(const envoy_config_route_v3_Route_TypedPerFilterConfigEntry *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
+UPB_INLINE const struct google_protobuf_Any* envoy_config_route_v3_Route_TypedPerFilterConfigEntry_value(const envoy_config_route_v3_Route_TypedPerFilterConfigEntry *msg) {
+ struct google_protobuf_Any* ret;
+ _upb_msg_map_value(msg, &ret, sizeof(ret));
+ return ret;
+}
+
+UPB_INLINE void envoy_config_route_v3_Route_TypedPerFilterConfigEntry_set_value(envoy_config_route_v3_Route_TypedPerFilterConfigEntry *msg, struct google_protobuf_Any* value) {
+ _upb_msg_map_set_value(msg, &value, sizeof(struct google_protobuf_Any*));
+}
+
+/* envoy.config.route.v3.WeightedCluster */
+
+UPB_INLINE envoy_config_route_v3_WeightedCluster *envoy_config_route_v3_WeightedCluster_new(upb_arena *arena) {
+ return (envoy_config_route_v3_WeightedCluster *)_upb_msg_new(&envoy_config_route_v3_WeightedCluster_msginit, arena);
+}
+UPB_INLINE envoy_config_route_v3_WeightedCluster *envoy_config_route_v3_WeightedCluster_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_route_v3_WeightedCluster *ret = envoy_config_route_v3_WeightedCluster_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_WeightedCluster_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_route_v3_WeightedCluster_serialize(const envoy_config_route_v3_WeightedCluster *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_route_v3_WeightedCluster_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_route_v3_WeightedCluster_has_clusters(const envoy_config_route_v3_WeightedCluster *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
+UPB_INLINE const envoy_config_route_v3_WeightedCluster_ClusterWeight* const* envoy_config_route_v3_WeightedCluster_clusters(const envoy_config_route_v3_WeightedCluster *msg, size_t *len) { return (const envoy_config_route_v3_WeightedCluster_ClusterWeight* const*)_upb_array_accessor(msg, UPB_SIZE(12, 24), len); }
+UPB_INLINE upb_strview envoy_config_route_v3_WeightedCluster_runtime_key_prefix(const envoy_config_route_v3_WeightedCluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE bool envoy_config_route_v3_WeightedCluster_has_total_weight(const envoy_config_route_v3_WeightedCluster *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_route_v3_WeightedCluster_total_weight(const envoy_config_route_v3_WeightedCluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_UInt32Value*); }
+
+UPB_INLINE envoy_config_route_v3_WeightedCluster_ClusterWeight** envoy_config_route_v3_WeightedCluster_mutable_clusters(envoy_config_route_v3_WeightedCluster *msg, size_t *len) {
+ return (envoy_config_route_v3_WeightedCluster_ClusterWeight**)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 24), len);
+}
+UPB_INLINE envoy_config_route_v3_WeightedCluster_ClusterWeight** envoy_config_route_v3_WeightedCluster_resize_clusters(envoy_config_route_v3_WeightedCluster *msg, size_t len, upb_arena *arena) {
+ return (envoy_config_route_v3_WeightedCluster_ClusterWeight**)_upb_array_resize_accessor(msg, UPB_SIZE(12, 24), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_config_route_v3_WeightedCluster_ClusterWeight* envoy_config_route_v3_WeightedCluster_add_clusters(envoy_config_route_v3_WeightedCluster *msg, upb_arena *arena) {
+ struct envoy_config_route_v3_WeightedCluster_ClusterWeight* sub = (struct envoy_config_route_v3_WeightedCluster_ClusterWeight*)_upb_msg_new(&envoy_config_route_v3_WeightedCluster_ClusterWeight_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(12, 24), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE void envoy_config_route_v3_WeightedCluster_set_runtime_key_prefix(envoy_config_route_v3_WeightedCluster *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_route_v3_WeightedCluster_set_total_weight(envoy_config_route_v3_WeightedCluster *msg, struct google_protobuf_UInt32Value* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_route_v3_WeightedCluster_mutable_total_weight(envoy_config_route_v3_WeightedCluster *msg, upb_arena *arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_route_v3_WeightedCluster_total_weight(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_WeightedCluster_set_total_weight(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.route.v3.WeightedCluster.ClusterWeight */
+
+UPB_INLINE envoy_config_route_v3_WeightedCluster_ClusterWeight *envoy_config_route_v3_WeightedCluster_ClusterWeight_new(upb_arena *arena) {
+ return (envoy_config_route_v3_WeightedCluster_ClusterWeight *)_upb_msg_new(&envoy_config_route_v3_WeightedCluster_ClusterWeight_msginit, arena);
+}
+UPB_INLINE envoy_config_route_v3_WeightedCluster_ClusterWeight *envoy_config_route_v3_WeightedCluster_ClusterWeight_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_route_v3_WeightedCluster_ClusterWeight *ret = envoy_config_route_v3_WeightedCluster_ClusterWeight_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_WeightedCluster_ClusterWeight_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_route_v3_WeightedCluster_ClusterWeight_serialize(const envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_route_v3_WeightedCluster_ClusterWeight_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview envoy_config_route_v3_WeightedCluster_ClusterWeight_name(const envoy_config_route_v3_WeightedCluster_ClusterWeight *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE bool envoy_config_route_v3_WeightedCluster_ClusterWeight_has_weight(const envoy_config_route_v3_WeightedCluster_ClusterWeight *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_route_v3_WeightedCluster_ClusterWeight_weight(const envoy_config_route_v3_WeightedCluster_ClusterWeight *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_UInt32Value*); }
+UPB_INLINE bool envoy_config_route_v3_WeightedCluster_ClusterWeight_has_metadata_match(const envoy_config_route_v3_WeightedCluster_ClusterWeight *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
+UPB_INLINE const struct envoy_config_core_v3_Metadata* envoy_config_route_v3_WeightedCluster_ClusterWeight_metadata_match(const envoy_config_route_v3_WeightedCluster_ClusterWeight *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct envoy_config_core_v3_Metadata*); }
+UPB_INLINE bool envoy_config_route_v3_WeightedCluster_ClusterWeight_has_request_headers_to_add(const envoy_config_route_v3_WeightedCluster_ClusterWeight *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); }
+UPB_INLINE const struct envoy_config_core_v3_HeaderValueOption* const* envoy_config_route_v3_WeightedCluster_ClusterWeight_request_headers_to_add(const envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, size_t *len) { return (const struct envoy_config_core_v3_HeaderValueOption* const*)_upb_array_accessor(msg, UPB_SIZE(16, 32), len); }
+UPB_INLINE bool envoy_config_route_v3_WeightedCluster_ClusterWeight_has_response_headers_to_add(const envoy_config_route_v3_WeightedCluster_ClusterWeight *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 40)); }
+UPB_INLINE const struct envoy_config_core_v3_HeaderValueOption* const* envoy_config_route_v3_WeightedCluster_ClusterWeight_response_headers_to_add(const envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, size_t *len) { return (const struct envoy_config_core_v3_HeaderValueOption* const*)_upb_array_accessor(msg, UPB_SIZE(20, 40), len); }
+UPB_INLINE upb_strview const* envoy_config_route_v3_WeightedCluster_ClusterWeight_response_headers_to_remove(const envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(24, 48), len); }
+UPB_INLINE upb_strview const* envoy_config_route_v3_WeightedCluster_ClusterWeight_request_headers_to_remove(const envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(28, 56), len); }
+UPB_INLINE bool envoy_config_route_v3_WeightedCluster_ClusterWeight_has_typed_per_filter_config(const envoy_config_route_v3_WeightedCluster_ClusterWeight *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(32, 64)); }
+UPB_INLINE size_t envoy_config_route_v3_WeightedCluster_ClusterWeight_typed_per_filter_config_size(const envoy_config_route_v3_WeightedCluster_ClusterWeight *msg) {return _upb_msg_map_size(msg, UPB_SIZE(32, 64)); }
+UPB_INLINE bool envoy_config_route_v3_WeightedCluster_ClusterWeight_typed_per_filter_config_get(const envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, upb_strview key, struct google_protobuf_Any* *val) { return _upb_msg_map_get(msg, UPB_SIZE(32, 64), &key, 0, val, sizeof(*val)); }
+UPB_INLINE const envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry* envoy_config_route_v3_WeightedCluster_ClusterWeight_typed_per_filter_config_next(const envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, size_t* iter) { return (const envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry*)_upb_msg_map_next(msg, UPB_SIZE(32, 64), iter); }
+
+UPB_INLINE void envoy_config_route_v3_WeightedCluster_ClusterWeight_set_name(envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_route_v3_WeightedCluster_ClusterWeight_set_weight(envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, struct google_protobuf_UInt32Value* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_route_v3_WeightedCluster_ClusterWeight_mutable_weight(envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, upb_arena *arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_route_v3_WeightedCluster_ClusterWeight_weight(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_WeightedCluster_ClusterWeight_set_weight(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_route_v3_WeightedCluster_ClusterWeight_set_metadata_match(envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, struct envoy_config_core_v3_Metadata* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct envoy_config_core_v3_Metadata*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_Metadata* envoy_config_route_v3_WeightedCluster_ClusterWeight_mutable_metadata_match(envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_Metadata* sub = (struct envoy_config_core_v3_Metadata*)envoy_config_route_v3_WeightedCluster_ClusterWeight_metadata_match(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_Metadata*)_upb_msg_new(&envoy_config_core_v3_Metadata_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_WeightedCluster_ClusterWeight_set_metadata_match(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_config_route_v3_WeightedCluster_ClusterWeight_mutable_request_headers_to_add(envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, size_t *len) {
+ return (struct envoy_config_core_v3_HeaderValueOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 32), len);
+}
+UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_config_route_v3_WeightedCluster_ClusterWeight_resize_request_headers_to_add(envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, size_t len, upb_arena *arena) {
+ return (struct envoy_config_core_v3_HeaderValueOption**)_upb_array_resize_accessor(msg, UPB_SIZE(16, 32), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_config_core_v3_HeaderValueOption* envoy_config_route_v3_WeightedCluster_ClusterWeight_add_request_headers_to_add(envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_HeaderValueOption* sub = (struct envoy_config_core_v3_HeaderValueOption*)_upb_msg_new(&envoy_config_core_v3_HeaderValueOption_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(16, 32), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_config_route_v3_WeightedCluster_ClusterWeight_mutable_response_headers_to_add(envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, size_t *len) {
+ return (struct envoy_config_core_v3_HeaderValueOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 40), len);
+}
+UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_config_route_v3_WeightedCluster_ClusterWeight_resize_response_headers_to_add(envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, size_t len, upb_arena *arena) {
+ return (struct envoy_config_core_v3_HeaderValueOption**)_upb_array_resize_accessor(msg, UPB_SIZE(20, 40), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_config_core_v3_HeaderValueOption* envoy_config_route_v3_WeightedCluster_ClusterWeight_add_response_headers_to_add(envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_HeaderValueOption* sub = (struct envoy_config_core_v3_HeaderValueOption*)_upb_msg_new(&envoy_config_core_v3_HeaderValueOption_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(20, 40), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE upb_strview* envoy_config_route_v3_WeightedCluster_ClusterWeight_mutable_response_headers_to_remove(envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, size_t *len) {
+ return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 48), len);
+}
+UPB_INLINE upb_strview* envoy_config_route_v3_WeightedCluster_ClusterWeight_resize_response_headers_to_remove(envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, size_t len, upb_arena *arena) {
+ return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(24, 48), len, UPB_TYPE_STRING, arena);
+}
+UPB_INLINE bool envoy_config_route_v3_WeightedCluster_ClusterWeight_add_response_headers_to_remove(envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, upb_strview val, upb_arena *arena) {
+ return _upb_array_append_accessor(msg, UPB_SIZE(24, 48), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
+ arena);
+}
+UPB_INLINE upb_strview* envoy_config_route_v3_WeightedCluster_ClusterWeight_mutable_request_headers_to_remove(envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, size_t *len) {
+ return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 56), len);
+}
+UPB_INLINE upb_strview* envoy_config_route_v3_WeightedCluster_ClusterWeight_resize_request_headers_to_remove(envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, size_t len, upb_arena *arena) {
+ return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(28, 56), len, UPB_TYPE_STRING, arena);
+}
+UPB_INLINE bool envoy_config_route_v3_WeightedCluster_ClusterWeight_add_request_headers_to_remove(envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, upb_strview val, upb_arena *arena) {
+ return _upb_array_append_accessor(msg, UPB_SIZE(28, 56), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
+ arena);
+}
+UPB_INLINE void envoy_config_route_v3_WeightedCluster_ClusterWeight_typed_per_filter_config_clear(envoy_config_route_v3_WeightedCluster_ClusterWeight *msg) { _upb_msg_map_clear(msg, UPB_SIZE(32, 64)); }
+UPB_INLINE bool envoy_config_route_v3_WeightedCluster_ClusterWeight_typed_per_filter_config_set(envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, upb_strview key, struct google_protobuf_Any* val, upb_arena *a) { return _upb_msg_map_set(msg, UPB_SIZE(32, 64), &key, 0, &val, sizeof(val), a); }
+UPB_INLINE bool envoy_config_route_v3_WeightedCluster_ClusterWeight_typed_per_filter_config_delete(envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, upb_strview key) { return _upb_msg_map_delete(msg, UPB_SIZE(32, 64), &key, 0); }
+UPB_INLINE envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry* envoy_config_route_v3_WeightedCluster_ClusterWeight_typed_per_filter_config_nextmutable(envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, size_t* iter) { return (envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry*)_upb_msg_map_next(msg, UPB_SIZE(32, 64), iter); }
+
+/* envoy.config.route.v3.WeightedCluster.ClusterWeight.TypedPerFilterConfigEntry */
+
+UPB_INLINE upb_strview envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry_key(const envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry *msg) {
+ upb_strview ret;
+ _upb_msg_map_key(msg, &ret, 0);
+ return ret;
+}
+UPB_INLINE bool envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry_has_value(const envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
+UPB_INLINE const struct google_protobuf_Any* envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry_value(const envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry *msg) {
+ struct google_protobuf_Any* ret;
+ _upb_msg_map_value(msg, &ret, sizeof(ret));
+ return ret;
+}
+
+UPB_INLINE void envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry_set_value(envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry *msg, struct google_protobuf_Any* value) {
+ _upb_msg_map_set_value(msg, &value, sizeof(struct google_protobuf_Any*));
+}
+
+/* envoy.config.route.v3.RouteMatch */
+
+UPB_INLINE envoy_config_route_v3_RouteMatch *envoy_config_route_v3_RouteMatch_new(upb_arena *arena) {
+ return (envoy_config_route_v3_RouteMatch *)_upb_msg_new(&envoy_config_route_v3_RouteMatch_msginit, arena);
+}
+UPB_INLINE envoy_config_route_v3_RouteMatch *envoy_config_route_v3_RouteMatch_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_route_v3_RouteMatch *ret = envoy_config_route_v3_RouteMatch_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RouteMatch_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_route_v3_RouteMatch_serialize(const envoy_config_route_v3_RouteMatch *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_route_v3_RouteMatch_msginit, arena, len);
+}
+
+typedef enum {
+ envoy_config_route_v3_RouteMatch_path_specifier_prefix = 1,
+ envoy_config_route_v3_RouteMatch_path_specifier_path = 2,
+ envoy_config_route_v3_RouteMatch_path_specifier_safe_regex = 10,
+ envoy_config_route_v3_RouteMatch_path_specifier_connect_matcher = 12,
+ envoy_config_route_v3_RouteMatch_path_specifier_NOT_SET = 0
+} envoy_config_route_v3_RouteMatch_path_specifier_oneofcases;
+UPB_INLINE envoy_config_route_v3_RouteMatch_path_specifier_oneofcases envoy_config_route_v3_RouteMatch_path_specifier_case(const envoy_config_route_v3_RouteMatch* msg) { return (envoy_config_route_v3_RouteMatch_path_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(32, 64), int32_t); }
+
+UPB_INLINE bool envoy_config_route_v3_RouteMatch_has_prefix(const envoy_config_route_v3_RouteMatch *msg) { return _upb_getoneofcase(msg, UPB_SIZE(32, 64)) == 1; }
+UPB_INLINE upb_strview envoy_config_route_v3_RouteMatch_prefix(const envoy_config_route_v3_RouteMatch *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(24, 48), UPB_SIZE(32, 64), 1, upb_strview_make("", strlen(""))); }
+UPB_INLINE bool envoy_config_route_v3_RouteMatch_has_path(const envoy_config_route_v3_RouteMatch *msg) { return _upb_getoneofcase(msg, UPB_SIZE(32, 64)) == 2; }
+UPB_INLINE upb_strview envoy_config_route_v3_RouteMatch_path(const envoy_config_route_v3_RouteMatch *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(24, 48), UPB_SIZE(32, 64), 2, upb_strview_make("", strlen(""))); }
+UPB_INLINE bool envoy_config_route_v3_RouteMatch_has_case_sensitive(const envoy_config_route_v3_RouteMatch *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_route_v3_RouteMatch_case_sensitive(const envoy_config_route_v3_RouteMatch *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct google_protobuf_BoolValue*); }
+UPB_INLINE bool envoy_config_route_v3_RouteMatch_has_headers(const envoy_config_route_v3_RouteMatch *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); }
+UPB_INLINE const envoy_config_route_v3_HeaderMatcher* const* envoy_config_route_v3_RouteMatch_headers(const envoy_config_route_v3_RouteMatch *msg, size_t *len) { return (const envoy_config_route_v3_HeaderMatcher* const*)_upb_array_accessor(msg, UPB_SIZE(16, 32), len); }
+UPB_INLINE bool envoy_config_route_v3_RouteMatch_has_query_parameters(const envoy_config_route_v3_RouteMatch *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 40)); }
+UPB_INLINE const envoy_config_route_v3_QueryParameterMatcher* const* envoy_config_route_v3_RouteMatch_query_parameters(const envoy_config_route_v3_RouteMatch *msg, size_t *len) { return (const envoy_config_route_v3_QueryParameterMatcher* const*)_upb_array_accessor(msg, UPB_SIZE(20, 40), len); }
+UPB_INLINE bool envoy_config_route_v3_RouteMatch_has_grpc(const envoy_config_route_v3_RouteMatch *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
+UPB_INLINE const envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions* envoy_config_route_v3_RouteMatch_grpc(const envoy_config_route_v3_RouteMatch *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions*); }
+UPB_INLINE bool envoy_config_route_v3_RouteMatch_has_runtime_fraction(const envoy_config_route_v3_RouteMatch *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
+UPB_INLINE const struct envoy_config_core_v3_RuntimeFractionalPercent* envoy_config_route_v3_RouteMatch_runtime_fraction(const envoy_config_route_v3_RouteMatch *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct envoy_config_core_v3_RuntimeFractionalPercent*); }
+UPB_INLINE bool envoy_config_route_v3_RouteMatch_has_safe_regex(const envoy_config_route_v3_RouteMatch *msg) { return _upb_getoneofcase(msg, UPB_SIZE(32, 64)) == 10; }
+UPB_INLINE const struct envoy_type_matcher_v3_RegexMatcher* envoy_config_route_v3_RouteMatch_safe_regex(const envoy_config_route_v3_RouteMatch *msg) { return UPB_READ_ONEOF(msg, const struct envoy_type_matcher_v3_RegexMatcher*, UPB_SIZE(24, 48), UPB_SIZE(32, 64), 10, NULL); }
+UPB_INLINE bool envoy_config_route_v3_RouteMatch_has_tls_context(const envoy_config_route_v3_RouteMatch *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
+UPB_INLINE const envoy_config_route_v3_RouteMatch_TlsContextMatchOptions* envoy_config_route_v3_RouteMatch_tls_context(const envoy_config_route_v3_RouteMatch *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const envoy_config_route_v3_RouteMatch_TlsContextMatchOptions*); }
+UPB_INLINE bool envoy_config_route_v3_RouteMatch_has_connect_matcher(const envoy_config_route_v3_RouteMatch *msg) { return _upb_getoneofcase(msg, UPB_SIZE(32, 64)) == 12; }
+UPB_INLINE const envoy_config_route_v3_RouteMatch_ConnectMatcher* envoy_config_route_v3_RouteMatch_connect_matcher(const envoy_config_route_v3_RouteMatch *msg) { return UPB_READ_ONEOF(msg, const envoy_config_route_v3_RouteMatch_ConnectMatcher*, UPB_SIZE(24, 48), UPB_SIZE(32, 64), 12, NULL); }
+
+UPB_INLINE void envoy_config_route_v3_RouteMatch_set_prefix(envoy_config_route_v3_RouteMatch *msg, upb_strview value) {
+ UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(24, 48), value, UPB_SIZE(32, 64), 1);
+}
+UPB_INLINE void envoy_config_route_v3_RouteMatch_set_path(envoy_config_route_v3_RouteMatch *msg, upb_strview value) {
+ UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(24, 48), value, UPB_SIZE(32, 64), 2);
+}
+UPB_INLINE void envoy_config_route_v3_RouteMatch_set_case_sensitive(envoy_config_route_v3_RouteMatch *msg, struct google_protobuf_BoolValue* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct google_protobuf_BoolValue*) = value;
+}
+UPB_INLINE struct google_protobuf_BoolValue* envoy_config_route_v3_RouteMatch_mutable_case_sensitive(envoy_config_route_v3_RouteMatch *msg, upb_arena *arena) {
+ struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_route_v3_RouteMatch_case_sensitive(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_BoolValue*)_upb_msg_new(&google_protobuf_BoolValue_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_RouteMatch_set_case_sensitive(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE envoy_config_route_v3_HeaderMatcher** envoy_config_route_v3_RouteMatch_mutable_headers(envoy_config_route_v3_RouteMatch *msg, size_t *len) {
+ return (envoy_config_route_v3_HeaderMatcher**)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 32), len);
+}
+UPB_INLINE envoy_config_route_v3_HeaderMatcher** envoy_config_route_v3_RouteMatch_resize_headers(envoy_config_route_v3_RouteMatch *msg, size_t len, upb_arena *arena) {
+ return (envoy_config_route_v3_HeaderMatcher**)_upb_array_resize_accessor(msg, UPB_SIZE(16, 32), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_config_route_v3_HeaderMatcher* envoy_config_route_v3_RouteMatch_add_headers(envoy_config_route_v3_RouteMatch *msg, upb_arena *arena) {
+ struct envoy_config_route_v3_HeaderMatcher* sub = (struct envoy_config_route_v3_HeaderMatcher*)_upb_msg_new(&envoy_config_route_v3_HeaderMatcher_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(16, 32), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE envoy_config_route_v3_QueryParameterMatcher** envoy_config_route_v3_RouteMatch_mutable_query_parameters(envoy_config_route_v3_RouteMatch *msg, size_t *len) {
+ return (envoy_config_route_v3_QueryParameterMatcher**)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 40), len);
+}
+UPB_INLINE envoy_config_route_v3_QueryParameterMatcher** envoy_config_route_v3_RouteMatch_resize_query_parameters(envoy_config_route_v3_RouteMatch *msg, size_t len, upb_arena *arena) {
+ return (envoy_config_route_v3_QueryParameterMatcher**)_upb_array_resize_accessor(msg, UPB_SIZE(20, 40), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_config_route_v3_QueryParameterMatcher* envoy_config_route_v3_RouteMatch_add_query_parameters(envoy_config_route_v3_RouteMatch *msg, upb_arena *arena) {
+ struct envoy_config_route_v3_QueryParameterMatcher* sub = (struct envoy_config_route_v3_QueryParameterMatcher*)_upb_msg_new(&envoy_config_route_v3_QueryParameterMatcher_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(20, 40), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE void envoy_config_route_v3_RouteMatch_set_grpc(envoy_config_route_v3_RouteMatch *msg, envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions*) = value;
+}
+UPB_INLINE struct envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions* envoy_config_route_v3_RouteMatch_mutable_grpc(envoy_config_route_v3_RouteMatch *msg, upb_arena *arena) {
+ struct envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions* sub = (struct envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions*)envoy_config_route_v3_RouteMatch_grpc(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions*)_upb_msg_new(&envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_RouteMatch_set_grpc(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_route_v3_RouteMatch_set_runtime_fraction(envoy_config_route_v3_RouteMatch *msg, struct envoy_config_core_v3_RuntimeFractionalPercent* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct envoy_config_core_v3_RuntimeFractionalPercent*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_RuntimeFractionalPercent* envoy_config_route_v3_RouteMatch_mutable_runtime_fraction(envoy_config_route_v3_RouteMatch *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_RuntimeFractionalPercent* sub = (struct envoy_config_core_v3_RuntimeFractionalPercent*)envoy_config_route_v3_RouteMatch_runtime_fraction(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_RuntimeFractionalPercent*)_upb_msg_new(&envoy_config_core_v3_RuntimeFractionalPercent_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_RouteMatch_set_runtime_fraction(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_route_v3_RouteMatch_set_safe_regex(envoy_config_route_v3_RouteMatch *msg, struct envoy_type_matcher_v3_RegexMatcher* value) {
+ UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_RegexMatcher*, UPB_SIZE(24, 48), value, UPB_SIZE(32, 64), 10);
+}
+UPB_INLINE struct envoy_type_matcher_v3_RegexMatcher* envoy_config_route_v3_RouteMatch_mutable_safe_regex(envoy_config_route_v3_RouteMatch *msg, upb_arena *arena) {
+ struct envoy_type_matcher_v3_RegexMatcher* sub = (struct envoy_type_matcher_v3_RegexMatcher*)envoy_config_route_v3_RouteMatch_safe_regex(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_type_matcher_v3_RegexMatcher*)_upb_msg_new(&envoy_type_matcher_v3_RegexMatcher_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_RouteMatch_set_safe_regex(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_route_v3_RouteMatch_set_tls_context(envoy_config_route_v3_RouteMatch *msg, envoy_config_route_v3_RouteMatch_TlsContextMatchOptions* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), envoy_config_route_v3_RouteMatch_TlsContextMatchOptions*) = value;
+}
+UPB_INLINE struct envoy_config_route_v3_RouteMatch_TlsContextMatchOptions* envoy_config_route_v3_RouteMatch_mutable_tls_context(envoy_config_route_v3_RouteMatch *msg, upb_arena *arena) {
+ struct envoy_config_route_v3_RouteMatch_TlsContextMatchOptions* sub = (struct envoy_config_route_v3_RouteMatch_TlsContextMatchOptions*)envoy_config_route_v3_RouteMatch_tls_context(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_route_v3_RouteMatch_TlsContextMatchOptions*)_upb_msg_new(&envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_RouteMatch_set_tls_context(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_route_v3_RouteMatch_set_connect_matcher(envoy_config_route_v3_RouteMatch *msg, envoy_config_route_v3_RouteMatch_ConnectMatcher* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RouteMatch_ConnectMatcher*, UPB_SIZE(24, 48), value, UPB_SIZE(32, 64), 12);
+}
+UPB_INLINE struct envoy_config_route_v3_RouteMatch_ConnectMatcher* envoy_config_route_v3_RouteMatch_mutable_connect_matcher(envoy_config_route_v3_RouteMatch *msg, upb_arena *arena) {
+ struct envoy_config_route_v3_RouteMatch_ConnectMatcher* sub = (struct envoy_config_route_v3_RouteMatch_ConnectMatcher*)envoy_config_route_v3_RouteMatch_connect_matcher(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_route_v3_RouteMatch_ConnectMatcher*)_upb_msg_new(&envoy_config_route_v3_RouteMatch_ConnectMatcher_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_RouteMatch_set_connect_matcher(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.route.v3.RouteMatch.GrpcRouteMatchOptions */
+
+UPB_INLINE envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions *envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions_new(upb_arena *arena) {
+ return (envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions *)_upb_msg_new(&envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions_msginit, arena);
+}
+UPB_INLINE envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions *envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions *ret = envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions_serialize(const envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions_msginit, arena, len);
+}
+
+
+
+/* envoy.config.route.v3.RouteMatch.TlsContextMatchOptions */
+
+UPB_INLINE envoy_config_route_v3_RouteMatch_TlsContextMatchOptions *envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_new(upb_arena *arena) {
+ return (envoy_config_route_v3_RouteMatch_TlsContextMatchOptions *)_upb_msg_new(&envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_msginit, arena);
+}
+UPB_INLINE envoy_config_route_v3_RouteMatch_TlsContextMatchOptions *envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_route_v3_RouteMatch_TlsContextMatchOptions *ret = envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_serialize(const envoy_config_route_v3_RouteMatch_TlsContextMatchOptions *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_has_presented(const envoy_config_route_v3_RouteMatch_TlsContextMatchOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_presented(const envoy_config_route_v3_RouteMatch_TlsContextMatchOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct google_protobuf_BoolValue*); }
+UPB_INLINE bool envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_has_validated(const envoy_config_route_v3_RouteMatch_TlsContextMatchOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
+UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_validated(const envoy_config_route_v3_RouteMatch_TlsContextMatchOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_BoolValue*); }
+
+UPB_INLINE void envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_set_presented(envoy_config_route_v3_RouteMatch_TlsContextMatchOptions *msg, struct google_protobuf_BoolValue* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct google_protobuf_BoolValue*) = value;
+}
+UPB_INLINE struct google_protobuf_BoolValue* envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_mutable_presented(envoy_config_route_v3_RouteMatch_TlsContextMatchOptions *msg, upb_arena *arena) {
+ struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_presented(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_BoolValue*)_upb_msg_new(&google_protobuf_BoolValue_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_set_presented(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_set_validated(envoy_config_route_v3_RouteMatch_TlsContextMatchOptions *msg, struct google_protobuf_BoolValue* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_BoolValue*) = value;
+}
+UPB_INLINE struct google_protobuf_BoolValue* envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_mutable_validated(envoy_config_route_v3_RouteMatch_TlsContextMatchOptions *msg, upb_arena *arena) {
+ struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_validated(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_BoolValue*)_upb_msg_new(&google_protobuf_BoolValue_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_set_validated(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.route.v3.RouteMatch.ConnectMatcher */
+
+UPB_INLINE envoy_config_route_v3_RouteMatch_ConnectMatcher *envoy_config_route_v3_RouteMatch_ConnectMatcher_new(upb_arena *arena) {
+ return (envoy_config_route_v3_RouteMatch_ConnectMatcher *)_upb_msg_new(&envoy_config_route_v3_RouteMatch_ConnectMatcher_msginit, arena);
+}
+UPB_INLINE envoy_config_route_v3_RouteMatch_ConnectMatcher *envoy_config_route_v3_RouteMatch_ConnectMatcher_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_route_v3_RouteMatch_ConnectMatcher *ret = envoy_config_route_v3_RouteMatch_ConnectMatcher_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RouteMatch_ConnectMatcher_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_route_v3_RouteMatch_ConnectMatcher_serialize(const envoy_config_route_v3_RouteMatch_ConnectMatcher *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_route_v3_RouteMatch_ConnectMatcher_msginit, arena, len);
+}
+
+
+
+/* envoy.config.route.v3.CorsPolicy */
+
+UPB_INLINE envoy_config_route_v3_CorsPolicy *envoy_config_route_v3_CorsPolicy_new(upb_arena *arena) {
+ return (envoy_config_route_v3_CorsPolicy *)_upb_msg_new(&envoy_config_route_v3_CorsPolicy_msginit, arena);
+}
+UPB_INLINE envoy_config_route_v3_CorsPolicy *envoy_config_route_v3_CorsPolicy_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_route_v3_CorsPolicy *ret = envoy_config_route_v3_CorsPolicy_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_CorsPolicy_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_route_v3_CorsPolicy_serialize(const envoy_config_route_v3_CorsPolicy *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_route_v3_CorsPolicy_msginit, arena, len);
+}
+
+typedef enum {
+ envoy_config_route_v3_CorsPolicy_enabled_specifier_filter_enabled = 9,
+ envoy_config_route_v3_CorsPolicy_enabled_specifier_NOT_SET = 0
+} envoy_config_route_v3_CorsPolicy_enabled_specifier_oneofcases;
+UPB_INLINE envoy_config_route_v3_CorsPolicy_enabled_specifier_oneofcases envoy_config_route_v3_CorsPolicy_enabled_specifier_case(const envoy_config_route_v3_CorsPolicy* msg) { return (envoy_config_route_v3_CorsPolicy_enabled_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(48, 96), int32_t); }
+
+UPB_INLINE upb_strview envoy_config_route_v3_CorsPolicy_allow_methods(const envoy_config_route_v3_CorsPolicy *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE upb_strview envoy_config_route_v3_CorsPolicy_allow_headers(const envoy_config_route_v3_CorsPolicy *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview); }
+UPB_INLINE upb_strview envoy_config_route_v3_CorsPolicy_expose_headers(const envoy_config_route_v3_CorsPolicy *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_strview); }
+UPB_INLINE upb_strview envoy_config_route_v3_CorsPolicy_max_age(const envoy_config_route_v3_CorsPolicy *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 48), upb_strview); }
+UPB_INLINE bool envoy_config_route_v3_CorsPolicy_has_allow_credentials(const envoy_config_route_v3_CorsPolicy *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(32, 64)); }
+UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_route_v3_CorsPolicy_allow_credentials(const envoy_config_route_v3_CorsPolicy *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 64), const struct google_protobuf_BoolValue*); }
+UPB_INLINE bool envoy_config_route_v3_CorsPolicy_has_filter_enabled(const envoy_config_route_v3_CorsPolicy *msg) { return _upb_getoneofcase(msg, UPB_SIZE(48, 96)) == 9; }
+UPB_INLINE const struct envoy_config_core_v3_RuntimeFractionalPercent* envoy_config_route_v3_CorsPolicy_filter_enabled(const envoy_config_route_v3_CorsPolicy *msg) { return UPB_READ_ONEOF(msg, const struct envoy_config_core_v3_RuntimeFractionalPercent*, UPB_SIZE(44, 88), UPB_SIZE(48, 96), 9, NULL); }
+UPB_INLINE bool envoy_config_route_v3_CorsPolicy_has_shadow_enabled(const envoy_config_route_v3_CorsPolicy *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(36, 72)); }
+UPB_INLINE const struct envoy_config_core_v3_RuntimeFractionalPercent* envoy_config_route_v3_CorsPolicy_shadow_enabled(const envoy_config_route_v3_CorsPolicy *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(36, 72), const struct envoy_config_core_v3_RuntimeFractionalPercent*); }
+UPB_INLINE bool envoy_config_route_v3_CorsPolicy_has_allow_origin_string_match(const envoy_config_route_v3_CorsPolicy *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(40, 80)); }
+UPB_INLINE const struct envoy_type_matcher_v3_StringMatcher* const* envoy_config_route_v3_CorsPolicy_allow_origin_string_match(const envoy_config_route_v3_CorsPolicy *msg, size_t *len) { return (const struct envoy_type_matcher_v3_StringMatcher* const*)_upb_array_accessor(msg, UPB_SIZE(40, 80), len); }
+
+UPB_INLINE void envoy_config_route_v3_CorsPolicy_set_allow_methods(envoy_config_route_v3_CorsPolicy *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_route_v3_CorsPolicy_set_allow_headers(envoy_config_route_v3_CorsPolicy *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_route_v3_CorsPolicy_set_expose_headers(envoy_config_route_v3_CorsPolicy *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_route_v3_CorsPolicy_set_max_age(envoy_config_route_v3_CorsPolicy *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 48), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_route_v3_CorsPolicy_set_allow_credentials(envoy_config_route_v3_CorsPolicy *msg, struct google_protobuf_BoolValue* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 64), struct google_protobuf_BoolValue*) = value;
+}
+UPB_INLINE struct google_protobuf_BoolValue* envoy_config_route_v3_CorsPolicy_mutable_allow_credentials(envoy_config_route_v3_CorsPolicy *msg, upb_arena *arena) {
+ struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_route_v3_CorsPolicy_allow_credentials(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_BoolValue*)_upb_msg_new(&google_protobuf_BoolValue_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_CorsPolicy_set_allow_credentials(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_route_v3_CorsPolicy_set_filter_enabled(envoy_config_route_v3_CorsPolicy *msg, struct envoy_config_core_v3_RuntimeFractionalPercent* value) {
+ UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_RuntimeFractionalPercent*, UPB_SIZE(44, 88), value, UPB_SIZE(48, 96), 9);
+}
+UPB_INLINE struct envoy_config_core_v3_RuntimeFractionalPercent* envoy_config_route_v3_CorsPolicy_mutable_filter_enabled(envoy_config_route_v3_CorsPolicy *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_RuntimeFractionalPercent* sub = (struct envoy_config_core_v3_RuntimeFractionalPercent*)envoy_config_route_v3_CorsPolicy_filter_enabled(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_RuntimeFractionalPercent*)_upb_msg_new(&envoy_config_core_v3_RuntimeFractionalPercent_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_CorsPolicy_set_filter_enabled(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_route_v3_CorsPolicy_set_shadow_enabled(envoy_config_route_v3_CorsPolicy *msg, struct envoy_config_core_v3_RuntimeFractionalPercent* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(36, 72), struct envoy_config_core_v3_RuntimeFractionalPercent*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_RuntimeFractionalPercent* envoy_config_route_v3_CorsPolicy_mutable_shadow_enabled(envoy_config_route_v3_CorsPolicy *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_RuntimeFractionalPercent* sub = (struct envoy_config_core_v3_RuntimeFractionalPercent*)envoy_config_route_v3_CorsPolicy_shadow_enabled(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_RuntimeFractionalPercent*)_upb_msg_new(&envoy_config_core_v3_RuntimeFractionalPercent_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_CorsPolicy_set_shadow_enabled(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE struct envoy_type_matcher_v3_StringMatcher** envoy_config_route_v3_CorsPolicy_mutable_allow_origin_string_match(envoy_config_route_v3_CorsPolicy *msg, size_t *len) {
+ return (struct envoy_type_matcher_v3_StringMatcher**)_upb_array_mutable_accessor(msg, UPB_SIZE(40, 80), len);
+}
+UPB_INLINE struct envoy_type_matcher_v3_StringMatcher** envoy_config_route_v3_CorsPolicy_resize_allow_origin_string_match(envoy_config_route_v3_CorsPolicy *msg, size_t len, upb_arena *arena) {
+ return (struct envoy_type_matcher_v3_StringMatcher**)_upb_array_resize_accessor(msg, UPB_SIZE(40, 80), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_type_matcher_v3_StringMatcher* envoy_config_route_v3_CorsPolicy_add_allow_origin_string_match(envoy_config_route_v3_CorsPolicy *msg, upb_arena *arena) {
+ struct envoy_type_matcher_v3_StringMatcher* sub = (struct envoy_type_matcher_v3_StringMatcher*)_upb_msg_new(&envoy_type_matcher_v3_StringMatcher_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(40, 80), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+
+/* envoy.config.route.v3.RouteAction */
+
+UPB_INLINE envoy_config_route_v3_RouteAction *envoy_config_route_v3_RouteAction_new(upb_arena *arena) {
+ return (envoy_config_route_v3_RouteAction *)_upb_msg_new(&envoy_config_route_v3_RouteAction_msginit, arena);
+}
+UPB_INLINE envoy_config_route_v3_RouteAction *envoy_config_route_v3_RouteAction_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_route_v3_RouteAction *ret = envoy_config_route_v3_RouteAction_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RouteAction_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_route_v3_RouteAction_serialize(const envoy_config_route_v3_RouteAction *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_route_v3_RouteAction_msginit, arena, len);
+}
+
+typedef enum {
+ envoy_config_route_v3_RouteAction_cluster_specifier_cluster = 1,
+ envoy_config_route_v3_RouteAction_cluster_specifier_cluster_header = 2,
+ envoy_config_route_v3_RouteAction_cluster_specifier_weighted_clusters = 3,
+ envoy_config_route_v3_RouteAction_cluster_specifier_NOT_SET = 0
+} envoy_config_route_v3_RouteAction_cluster_specifier_oneofcases;
+UPB_INLINE envoy_config_route_v3_RouteAction_cluster_specifier_oneofcases envoy_config_route_v3_RouteAction_cluster_specifier_case(const envoy_config_route_v3_RouteAction* msg) { return (envoy_config_route_v3_RouteAction_cluster_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(112, 200), int32_t); }
+
+typedef enum {
+ envoy_config_route_v3_RouteAction_host_rewrite_specifier_host_rewrite_literal = 6,
+ envoy_config_route_v3_RouteAction_host_rewrite_specifier_auto_host_rewrite = 7,
+ envoy_config_route_v3_RouteAction_host_rewrite_specifier_host_rewrite_header = 29,
+ envoy_config_route_v3_RouteAction_host_rewrite_specifier_host_rewrite_path_regex = 35,
+ envoy_config_route_v3_RouteAction_host_rewrite_specifier_NOT_SET = 0
+} envoy_config_route_v3_RouteAction_host_rewrite_specifier_oneofcases;
+UPB_INLINE envoy_config_route_v3_RouteAction_host_rewrite_specifier_oneofcases envoy_config_route_v3_RouteAction_host_rewrite_specifier_case(const envoy_config_route_v3_RouteAction* msg) { return (envoy_config_route_v3_RouteAction_host_rewrite_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(124, 224), int32_t); }
+
+UPB_INLINE bool envoy_config_route_v3_RouteAction_has_cluster(const envoy_config_route_v3_RouteAction *msg) { return _upb_getoneofcase(msg, UPB_SIZE(112, 200)) == 1; }
+UPB_INLINE upb_strview envoy_config_route_v3_RouteAction_cluster(const envoy_config_route_v3_RouteAction *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(104, 184), UPB_SIZE(112, 200), 1, upb_strview_make("", strlen(""))); }
+UPB_INLINE bool envoy_config_route_v3_RouteAction_has_cluster_header(const envoy_config_route_v3_RouteAction *msg) { return _upb_getoneofcase(msg, UPB_SIZE(112, 200)) == 2; }
+UPB_INLINE upb_strview envoy_config_route_v3_RouteAction_cluster_header(const envoy_config_route_v3_RouteAction *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(104, 184), UPB_SIZE(112, 200), 2, upb_strview_make("", strlen(""))); }
+UPB_INLINE bool envoy_config_route_v3_RouteAction_has_weighted_clusters(const envoy_config_route_v3_RouteAction *msg) { return _upb_getoneofcase(msg, UPB_SIZE(112, 200)) == 3; }
+UPB_INLINE const envoy_config_route_v3_WeightedCluster* envoy_config_route_v3_RouteAction_weighted_clusters(const envoy_config_route_v3_RouteAction *msg) { return UPB_READ_ONEOF(msg, const envoy_config_route_v3_WeightedCluster*, UPB_SIZE(104, 184), UPB_SIZE(112, 200), 3, NULL); }
+UPB_INLINE bool envoy_config_route_v3_RouteAction_has_metadata_match(const envoy_config_route_v3_RouteAction *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(32, 40)); }
+UPB_INLINE const struct envoy_config_core_v3_Metadata* envoy_config_route_v3_RouteAction_metadata_match(const envoy_config_route_v3_RouteAction *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 40), const struct envoy_config_core_v3_Metadata*); }
+UPB_INLINE upb_strview envoy_config_route_v3_RouteAction_prefix_rewrite(const envoy_config_route_v3_RouteAction *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), upb_strview); }
+UPB_INLINE bool envoy_config_route_v3_RouteAction_has_host_rewrite_literal(const envoy_config_route_v3_RouteAction *msg) { return _upb_getoneofcase(msg, UPB_SIZE(124, 224)) == 6; }
+UPB_INLINE upb_strview envoy_config_route_v3_RouteAction_host_rewrite_literal(const envoy_config_route_v3_RouteAction *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(116, 208), UPB_SIZE(124, 224), 6, upb_strview_make("", strlen(""))); }
+UPB_INLINE bool envoy_config_route_v3_RouteAction_has_auto_host_rewrite(const envoy_config_route_v3_RouteAction *msg) { return _upb_getoneofcase(msg, UPB_SIZE(124, 224)) == 7; }
+UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_route_v3_RouteAction_auto_host_rewrite(const envoy_config_route_v3_RouteAction *msg) { return UPB_READ_ONEOF(msg, const struct google_protobuf_BoolValue*, UPB_SIZE(116, 208), UPB_SIZE(124, 224), 7, NULL); }
+UPB_INLINE bool envoy_config_route_v3_RouteAction_has_timeout(const envoy_config_route_v3_RouteAction *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(36, 48)); }
+UPB_INLINE const struct google_protobuf_Duration* envoy_config_route_v3_RouteAction_timeout(const envoy_config_route_v3_RouteAction *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(36, 48), const struct google_protobuf_Duration*); }
+UPB_INLINE bool envoy_config_route_v3_RouteAction_has_retry_policy(const envoy_config_route_v3_RouteAction *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(40, 56)); }
+UPB_INLINE const envoy_config_route_v3_RetryPolicy* envoy_config_route_v3_RouteAction_retry_policy(const envoy_config_route_v3_RouteAction *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(40, 56), const envoy_config_route_v3_RetryPolicy*); }
+UPB_INLINE int32_t envoy_config_route_v3_RouteAction_priority(const envoy_config_route_v3_RouteAction *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
+UPB_INLINE bool envoy_config_route_v3_RouteAction_has_rate_limits(const envoy_config_route_v3_RouteAction *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(88, 152)); }
+UPB_INLINE const envoy_config_route_v3_RateLimit* const* envoy_config_route_v3_RouteAction_rate_limits(const envoy_config_route_v3_RouteAction *msg, size_t *len) { return (const envoy_config_route_v3_RateLimit* const*)_upb_array_accessor(msg, UPB_SIZE(88, 152), len); }
+UPB_INLINE bool envoy_config_route_v3_RouteAction_has_include_vh_rate_limits(const envoy_config_route_v3_RouteAction *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(44, 64)); }
+UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_route_v3_RouteAction_include_vh_rate_limits(const envoy_config_route_v3_RouteAction *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(44, 64), const struct google_protobuf_BoolValue*); }
+UPB_INLINE bool envoy_config_route_v3_RouteAction_has_hash_policy(const envoy_config_route_v3_RouteAction *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(92, 160)); }
+UPB_INLINE const envoy_config_route_v3_RouteAction_HashPolicy* const* envoy_config_route_v3_RouteAction_hash_policy(const envoy_config_route_v3_RouteAction *msg, size_t *len) { return (const envoy_config_route_v3_RouteAction_HashPolicy* const*)_upb_array_accessor(msg, UPB_SIZE(92, 160), len); }
+UPB_INLINE bool envoy_config_route_v3_RouteAction_has_cors(const envoy_config_route_v3_RouteAction *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(48, 72)); }
+UPB_INLINE const envoy_config_route_v3_CorsPolicy* envoy_config_route_v3_RouteAction_cors(const envoy_config_route_v3_RouteAction *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(48, 72), const envoy_config_route_v3_CorsPolicy*); }
+UPB_INLINE int32_t envoy_config_route_v3_RouteAction_cluster_not_found_response_code(const envoy_config_route_v3_RouteAction *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); }
+UPB_INLINE bool envoy_config_route_v3_RouteAction_has_max_grpc_timeout(const envoy_config_route_v3_RouteAction *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(52, 80)); }
+UPB_INLINE const struct google_protobuf_Duration* envoy_config_route_v3_RouteAction_max_grpc_timeout(const envoy_config_route_v3_RouteAction *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(52, 80), const struct google_protobuf_Duration*); }
+UPB_INLINE bool envoy_config_route_v3_RouteAction_has_idle_timeout(const envoy_config_route_v3_RouteAction *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(56, 88)); }
+UPB_INLINE const struct google_protobuf_Duration* envoy_config_route_v3_RouteAction_idle_timeout(const envoy_config_route_v3_RouteAction *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(56, 88), const struct google_protobuf_Duration*); }
+UPB_INLINE bool envoy_config_route_v3_RouteAction_has_upgrade_configs(const envoy_config_route_v3_RouteAction *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(96, 168)); }
+UPB_INLINE const envoy_config_route_v3_RouteAction_UpgradeConfig* const* envoy_config_route_v3_RouteAction_upgrade_configs(const envoy_config_route_v3_RouteAction *msg, size_t *len) { return (const envoy_config_route_v3_RouteAction_UpgradeConfig* const*)_upb_array_accessor(msg, UPB_SIZE(96, 168), len); }
+UPB_INLINE int32_t envoy_config_route_v3_RouteAction_internal_redirect_action(const envoy_config_route_v3_RouteAction *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t); }
+UPB_INLINE bool envoy_config_route_v3_RouteAction_has_hedge_policy(const envoy_config_route_v3_RouteAction *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(60, 96)); }
+UPB_INLINE const envoy_config_route_v3_HedgePolicy* envoy_config_route_v3_RouteAction_hedge_policy(const envoy_config_route_v3_RouteAction *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(60, 96), const envoy_config_route_v3_HedgePolicy*); }
+UPB_INLINE bool envoy_config_route_v3_RouteAction_has_grpc_timeout_offset(const envoy_config_route_v3_RouteAction *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(64, 104)); }
+UPB_INLINE const struct google_protobuf_Duration* envoy_config_route_v3_RouteAction_grpc_timeout_offset(const envoy_config_route_v3_RouteAction *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(64, 104), const struct google_protobuf_Duration*); }
+UPB_INLINE bool envoy_config_route_v3_RouteAction_has_host_rewrite_header(const envoy_config_route_v3_RouteAction *msg) { return _upb_getoneofcase(msg, UPB_SIZE(124, 224)) == 29; }
+UPB_INLINE upb_strview envoy_config_route_v3_RouteAction_host_rewrite_header(const envoy_config_route_v3_RouteAction *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(116, 208), UPB_SIZE(124, 224), 29, upb_strview_make("", strlen(""))); }
+UPB_INLINE bool envoy_config_route_v3_RouteAction_has_request_mirror_policies(const envoy_config_route_v3_RouteAction *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(100, 176)); }
+UPB_INLINE const envoy_config_route_v3_RouteAction_RequestMirrorPolicy* const* envoy_config_route_v3_RouteAction_request_mirror_policies(const envoy_config_route_v3_RouteAction *msg, size_t *len) { return (const envoy_config_route_v3_RouteAction_RequestMirrorPolicy* const*)_upb_array_accessor(msg, UPB_SIZE(100, 176), len); }
+UPB_INLINE bool envoy_config_route_v3_RouteAction_has_max_internal_redirects(const envoy_config_route_v3_RouteAction *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(68, 112)); }
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_route_v3_RouteAction_max_internal_redirects(const envoy_config_route_v3_RouteAction *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(68, 112), const struct google_protobuf_UInt32Value*); }
+UPB_INLINE bool envoy_config_route_v3_RouteAction_has_regex_rewrite(const envoy_config_route_v3_RouteAction *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(72, 120)); }
+UPB_INLINE const struct envoy_type_matcher_v3_RegexMatchAndSubstitute* envoy_config_route_v3_RouteAction_regex_rewrite(const envoy_config_route_v3_RouteAction *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(72, 120), const struct envoy_type_matcher_v3_RegexMatchAndSubstitute*); }
+UPB_INLINE bool envoy_config_route_v3_RouteAction_has_retry_policy_typed_config(const envoy_config_route_v3_RouteAction *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(76, 128)); }
+UPB_INLINE const struct google_protobuf_Any* envoy_config_route_v3_RouteAction_retry_policy_typed_config(const envoy_config_route_v3_RouteAction *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(76, 128), const struct google_protobuf_Any*); }
+UPB_INLINE bool envoy_config_route_v3_RouteAction_has_internal_redirect_policy(const envoy_config_route_v3_RouteAction *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(80, 136)); }
+UPB_INLINE const envoy_config_route_v3_InternalRedirectPolicy* envoy_config_route_v3_RouteAction_internal_redirect_policy(const envoy_config_route_v3_RouteAction *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(80, 136), const envoy_config_route_v3_InternalRedirectPolicy*); }
+UPB_INLINE bool envoy_config_route_v3_RouteAction_has_host_rewrite_path_regex(const envoy_config_route_v3_RouteAction *msg) { return _upb_getoneofcase(msg, UPB_SIZE(124, 224)) == 35; }
+UPB_INLINE const struct envoy_type_matcher_v3_RegexMatchAndSubstitute* envoy_config_route_v3_RouteAction_host_rewrite_path_regex(const envoy_config_route_v3_RouteAction *msg) { return UPB_READ_ONEOF(msg, const struct envoy_type_matcher_v3_RegexMatchAndSubstitute*, UPB_SIZE(116, 208), UPB_SIZE(124, 224), 35, NULL); }
+UPB_INLINE bool envoy_config_route_v3_RouteAction_has_max_stream_duration(const envoy_config_route_v3_RouteAction *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(84, 144)); }
+UPB_INLINE const envoy_config_route_v3_RouteAction_MaxStreamDuration* envoy_config_route_v3_RouteAction_max_stream_duration(const envoy_config_route_v3_RouteAction *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(84, 144), const envoy_config_route_v3_RouteAction_MaxStreamDuration*); }
+
+UPB_INLINE void envoy_config_route_v3_RouteAction_set_cluster(envoy_config_route_v3_RouteAction *msg, upb_strview value) {
+ UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(104, 184), value, UPB_SIZE(112, 200), 1);
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_set_cluster_header(envoy_config_route_v3_RouteAction *msg, upb_strview value) {
+ UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(104, 184), value, UPB_SIZE(112, 200), 2);
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_set_weighted_clusters(envoy_config_route_v3_RouteAction *msg, envoy_config_route_v3_WeightedCluster* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_route_v3_WeightedCluster*, UPB_SIZE(104, 184), value, UPB_SIZE(112, 200), 3);
+}
+UPB_INLINE struct envoy_config_route_v3_WeightedCluster* envoy_config_route_v3_RouteAction_mutable_weighted_clusters(envoy_config_route_v3_RouteAction *msg, upb_arena *arena) {
+ struct envoy_config_route_v3_WeightedCluster* sub = (struct envoy_config_route_v3_WeightedCluster*)envoy_config_route_v3_RouteAction_weighted_clusters(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_route_v3_WeightedCluster*)_upb_msg_new(&envoy_config_route_v3_WeightedCluster_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_RouteAction_set_weighted_clusters(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_set_metadata_match(envoy_config_route_v3_RouteAction *msg, struct envoy_config_core_v3_Metadata* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 40), struct envoy_config_core_v3_Metadata*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_Metadata* envoy_config_route_v3_RouteAction_mutable_metadata_match(envoy_config_route_v3_RouteAction *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_Metadata* sub = (struct envoy_config_core_v3_Metadata*)envoy_config_route_v3_RouteAction_metadata_match(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_Metadata*)_upb_msg_new(&envoy_config_core_v3_Metadata_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_RouteAction_set_metadata_match(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_set_prefix_rewrite(envoy_config_route_v3_RouteAction *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 24), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_set_host_rewrite_literal(envoy_config_route_v3_RouteAction *msg, upb_strview value) {
+ UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(116, 208), value, UPB_SIZE(124, 224), 6);
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_set_auto_host_rewrite(envoy_config_route_v3_RouteAction *msg, struct google_protobuf_BoolValue* value) {
+ UPB_WRITE_ONEOF(msg, struct google_protobuf_BoolValue*, UPB_SIZE(116, 208), value, UPB_SIZE(124, 224), 7);
+}
+UPB_INLINE struct google_protobuf_BoolValue* envoy_config_route_v3_RouteAction_mutable_auto_host_rewrite(envoy_config_route_v3_RouteAction *msg, upb_arena *arena) {
+ struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_route_v3_RouteAction_auto_host_rewrite(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_BoolValue*)_upb_msg_new(&google_protobuf_BoolValue_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_RouteAction_set_auto_host_rewrite(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_set_timeout(envoy_config_route_v3_RouteAction *msg, struct google_protobuf_Duration* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(36, 48), struct google_protobuf_Duration*) = value;
+}
+UPB_INLINE struct google_protobuf_Duration* envoy_config_route_v3_RouteAction_mutable_timeout(envoy_config_route_v3_RouteAction *msg, upb_arena *arena) {
+ struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_route_v3_RouteAction_timeout(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_RouteAction_set_timeout(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_set_retry_policy(envoy_config_route_v3_RouteAction *msg, envoy_config_route_v3_RetryPolicy* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 56), envoy_config_route_v3_RetryPolicy*) = value;
+}
+UPB_INLINE struct envoy_config_route_v3_RetryPolicy* envoy_config_route_v3_RouteAction_mutable_retry_policy(envoy_config_route_v3_RouteAction *msg, upb_arena *arena) {
+ struct envoy_config_route_v3_RetryPolicy* sub = (struct envoy_config_route_v3_RetryPolicy*)envoy_config_route_v3_RouteAction_retry_policy(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_route_v3_RetryPolicy*)_upb_msg_new(&envoy_config_route_v3_RetryPolicy_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_RouteAction_set_retry_policy(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_set_priority(envoy_config_route_v3_RouteAction *msg, int32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
+}
+UPB_INLINE envoy_config_route_v3_RateLimit** envoy_config_route_v3_RouteAction_mutable_rate_limits(envoy_config_route_v3_RouteAction *msg, size_t *len) {
+ return (envoy_config_route_v3_RateLimit**)_upb_array_mutable_accessor(msg, UPB_SIZE(88, 152), len);
+}
+UPB_INLINE envoy_config_route_v3_RateLimit** envoy_config_route_v3_RouteAction_resize_rate_limits(envoy_config_route_v3_RouteAction *msg, size_t len, upb_arena *arena) {
+ return (envoy_config_route_v3_RateLimit**)_upb_array_resize_accessor(msg, UPB_SIZE(88, 152), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_config_route_v3_RateLimit* envoy_config_route_v3_RouteAction_add_rate_limits(envoy_config_route_v3_RouteAction *msg, upb_arena *arena) {
+ struct envoy_config_route_v3_RateLimit* sub = (struct envoy_config_route_v3_RateLimit*)_upb_msg_new(&envoy_config_route_v3_RateLimit_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(88, 152), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_set_include_vh_rate_limits(envoy_config_route_v3_RouteAction *msg, struct google_protobuf_BoolValue* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(44, 64), struct google_protobuf_BoolValue*) = value;
+}
+UPB_INLINE struct google_protobuf_BoolValue* envoy_config_route_v3_RouteAction_mutable_include_vh_rate_limits(envoy_config_route_v3_RouteAction *msg, upb_arena *arena) {
+ struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_route_v3_RouteAction_include_vh_rate_limits(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_BoolValue*)_upb_msg_new(&google_protobuf_BoolValue_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_RouteAction_set_include_vh_rate_limits(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy** envoy_config_route_v3_RouteAction_mutable_hash_policy(envoy_config_route_v3_RouteAction *msg, size_t *len) {
+ return (envoy_config_route_v3_RouteAction_HashPolicy**)_upb_array_mutable_accessor(msg, UPB_SIZE(92, 160), len);
+}
+UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy** envoy_config_route_v3_RouteAction_resize_hash_policy(envoy_config_route_v3_RouteAction *msg, size_t len, upb_arena *arena) {
+ return (envoy_config_route_v3_RouteAction_HashPolicy**)_upb_array_resize_accessor(msg, UPB_SIZE(92, 160), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_config_route_v3_RouteAction_HashPolicy* envoy_config_route_v3_RouteAction_add_hash_policy(envoy_config_route_v3_RouteAction *msg, upb_arena *arena) {
+ struct envoy_config_route_v3_RouteAction_HashPolicy* sub = (struct envoy_config_route_v3_RouteAction_HashPolicy*)_upb_msg_new(&envoy_config_route_v3_RouteAction_HashPolicy_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(92, 160), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_set_cors(envoy_config_route_v3_RouteAction *msg, envoy_config_route_v3_CorsPolicy* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(48, 72), envoy_config_route_v3_CorsPolicy*) = value;
+}
+UPB_INLINE struct envoy_config_route_v3_CorsPolicy* envoy_config_route_v3_RouteAction_mutable_cors(envoy_config_route_v3_RouteAction *msg, upb_arena *arena) {
+ struct envoy_config_route_v3_CorsPolicy* sub = (struct envoy_config_route_v3_CorsPolicy*)envoy_config_route_v3_RouteAction_cors(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_route_v3_CorsPolicy*)_upb_msg_new(&envoy_config_route_v3_CorsPolicy_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_RouteAction_set_cors(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_set_cluster_not_found_response_code(envoy_config_route_v3_RouteAction *msg, int32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_set_max_grpc_timeout(envoy_config_route_v3_RouteAction *msg, struct google_protobuf_Duration* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(52, 80), struct google_protobuf_Duration*) = value;
+}
+UPB_INLINE struct google_protobuf_Duration* envoy_config_route_v3_RouteAction_mutable_max_grpc_timeout(envoy_config_route_v3_RouteAction *msg, upb_arena *arena) {
+ struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_route_v3_RouteAction_max_grpc_timeout(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_RouteAction_set_max_grpc_timeout(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_set_idle_timeout(envoy_config_route_v3_RouteAction *msg, struct google_protobuf_Duration* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(56, 88), struct google_protobuf_Duration*) = value;
+}
+UPB_INLINE struct google_protobuf_Duration* envoy_config_route_v3_RouteAction_mutable_idle_timeout(envoy_config_route_v3_RouteAction *msg, upb_arena *arena) {
+ struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_route_v3_RouteAction_idle_timeout(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_RouteAction_set_idle_timeout(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE envoy_config_route_v3_RouteAction_UpgradeConfig** envoy_config_route_v3_RouteAction_mutable_upgrade_configs(envoy_config_route_v3_RouteAction *msg, size_t *len) {
+ return (envoy_config_route_v3_RouteAction_UpgradeConfig**)_upb_array_mutable_accessor(msg, UPB_SIZE(96, 168), len);
+}
+UPB_INLINE envoy_config_route_v3_RouteAction_UpgradeConfig** envoy_config_route_v3_RouteAction_resize_upgrade_configs(envoy_config_route_v3_RouteAction *msg, size_t len, upb_arena *arena) {
+ return (envoy_config_route_v3_RouteAction_UpgradeConfig**)_upb_array_resize_accessor(msg, UPB_SIZE(96, 168), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_config_route_v3_RouteAction_UpgradeConfig* envoy_config_route_v3_RouteAction_add_upgrade_configs(envoy_config_route_v3_RouteAction *msg, upb_arena *arena) {
+ struct envoy_config_route_v3_RouteAction_UpgradeConfig* sub = (struct envoy_config_route_v3_RouteAction_UpgradeConfig*)_upb_msg_new(&envoy_config_route_v3_RouteAction_UpgradeConfig_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(96, 168), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_set_internal_redirect_action(envoy_config_route_v3_RouteAction *msg, int32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t) = value;
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_set_hedge_policy(envoy_config_route_v3_RouteAction *msg, envoy_config_route_v3_HedgePolicy* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(60, 96), envoy_config_route_v3_HedgePolicy*) = value;
+}
+UPB_INLINE struct envoy_config_route_v3_HedgePolicy* envoy_config_route_v3_RouteAction_mutable_hedge_policy(envoy_config_route_v3_RouteAction *msg, upb_arena *arena) {
+ struct envoy_config_route_v3_HedgePolicy* sub = (struct envoy_config_route_v3_HedgePolicy*)envoy_config_route_v3_RouteAction_hedge_policy(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_route_v3_HedgePolicy*)_upb_msg_new(&envoy_config_route_v3_HedgePolicy_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_RouteAction_set_hedge_policy(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_set_grpc_timeout_offset(envoy_config_route_v3_RouteAction *msg, struct google_protobuf_Duration* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(64, 104), struct google_protobuf_Duration*) = value;
+}
+UPB_INLINE struct google_protobuf_Duration* envoy_config_route_v3_RouteAction_mutable_grpc_timeout_offset(envoy_config_route_v3_RouteAction *msg, upb_arena *arena) {
+ struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_route_v3_RouteAction_grpc_timeout_offset(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_RouteAction_set_grpc_timeout_offset(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_set_host_rewrite_header(envoy_config_route_v3_RouteAction *msg, upb_strview value) {
+ UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(116, 208), value, UPB_SIZE(124, 224), 29);
+}
+UPB_INLINE envoy_config_route_v3_RouteAction_RequestMirrorPolicy** envoy_config_route_v3_RouteAction_mutable_request_mirror_policies(envoy_config_route_v3_RouteAction *msg, size_t *len) {
+ return (envoy_config_route_v3_RouteAction_RequestMirrorPolicy**)_upb_array_mutable_accessor(msg, UPB_SIZE(100, 176), len);
+}
+UPB_INLINE envoy_config_route_v3_RouteAction_RequestMirrorPolicy** envoy_config_route_v3_RouteAction_resize_request_mirror_policies(envoy_config_route_v3_RouteAction *msg, size_t len, upb_arena *arena) {
+ return (envoy_config_route_v3_RouteAction_RequestMirrorPolicy**)_upb_array_resize_accessor(msg, UPB_SIZE(100, 176), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_config_route_v3_RouteAction_RequestMirrorPolicy* envoy_config_route_v3_RouteAction_add_request_mirror_policies(envoy_config_route_v3_RouteAction *msg, upb_arena *arena) {
+ struct envoy_config_route_v3_RouteAction_RequestMirrorPolicy* sub = (struct envoy_config_route_v3_RouteAction_RequestMirrorPolicy*)_upb_msg_new(&envoy_config_route_v3_RouteAction_RequestMirrorPolicy_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(100, 176), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_set_max_internal_redirects(envoy_config_route_v3_RouteAction *msg, struct google_protobuf_UInt32Value* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(68, 112), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_route_v3_RouteAction_mutable_max_internal_redirects(envoy_config_route_v3_RouteAction *msg, upb_arena *arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_route_v3_RouteAction_max_internal_redirects(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_RouteAction_set_max_internal_redirects(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_set_regex_rewrite(envoy_config_route_v3_RouteAction *msg, struct envoy_type_matcher_v3_RegexMatchAndSubstitute* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(72, 120), struct envoy_type_matcher_v3_RegexMatchAndSubstitute*) = value;
+}
+UPB_INLINE struct envoy_type_matcher_v3_RegexMatchAndSubstitute* envoy_config_route_v3_RouteAction_mutable_regex_rewrite(envoy_config_route_v3_RouteAction *msg, upb_arena *arena) {
+ struct envoy_type_matcher_v3_RegexMatchAndSubstitute* sub = (struct envoy_type_matcher_v3_RegexMatchAndSubstitute*)envoy_config_route_v3_RouteAction_regex_rewrite(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_type_matcher_v3_RegexMatchAndSubstitute*)_upb_msg_new(&envoy_type_matcher_v3_RegexMatchAndSubstitute_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_RouteAction_set_regex_rewrite(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_set_retry_policy_typed_config(envoy_config_route_v3_RouteAction *msg, struct google_protobuf_Any* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(76, 128), struct google_protobuf_Any*) = value;
+}
+UPB_INLINE struct google_protobuf_Any* envoy_config_route_v3_RouteAction_mutable_retry_policy_typed_config(envoy_config_route_v3_RouteAction *msg, upb_arena *arena) {
+ struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_config_route_v3_RouteAction_retry_policy_typed_config(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_RouteAction_set_retry_policy_typed_config(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_set_internal_redirect_policy(envoy_config_route_v3_RouteAction *msg, envoy_config_route_v3_InternalRedirectPolicy* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(80, 136), envoy_config_route_v3_InternalRedirectPolicy*) = value;
+}
+UPB_INLINE struct envoy_config_route_v3_InternalRedirectPolicy* envoy_config_route_v3_RouteAction_mutable_internal_redirect_policy(envoy_config_route_v3_RouteAction *msg, upb_arena *arena) {
+ struct envoy_config_route_v3_InternalRedirectPolicy* sub = (struct envoy_config_route_v3_InternalRedirectPolicy*)envoy_config_route_v3_RouteAction_internal_redirect_policy(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_route_v3_InternalRedirectPolicy*)_upb_msg_new(&envoy_config_route_v3_InternalRedirectPolicy_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_RouteAction_set_internal_redirect_policy(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_set_host_rewrite_path_regex(envoy_config_route_v3_RouteAction *msg, struct envoy_type_matcher_v3_RegexMatchAndSubstitute* value) {
+ UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_RegexMatchAndSubstitute*, UPB_SIZE(116, 208), value, UPB_SIZE(124, 224), 35);
+}
+UPB_INLINE struct envoy_type_matcher_v3_RegexMatchAndSubstitute* envoy_config_route_v3_RouteAction_mutable_host_rewrite_path_regex(envoy_config_route_v3_RouteAction *msg, upb_arena *arena) {
+ struct envoy_type_matcher_v3_RegexMatchAndSubstitute* sub = (struct envoy_type_matcher_v3_RegexMatchAndSubstitute*)envoy_config_route_v3_RouteAction_host_rewrite_path_regex(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_type_matcher_v3_RegexMatchAndSubstitute*)_upb_msg_new(&envoy_type_matcher_v3_RegexMatchAndSubstitute_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_RouteAction_set_host_rewrite_path_regex(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_set_max_stream_duration(envoy_config_route_v3_RouteAction *msg, envoy_config_route_v3_RouteAction_MaxStreamDuration* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(84, 144), envoy_config_route_v3_RouteAction_MaxStreamDuration*) = value;
+}
+UPB_INLINE struct envoy_config_route_v3_RouteAction_MaxStreamDuration* envoy_config_route_v3_RouteAction_mutable_max_stream_duration(envoy_config_route_v3_RouteAction *msg, upb_arena *arena) {
+ struct envoy_config_route_v3_RouteAction_MaxStreamDuration* sub = (struct envoy_config_route_v3_RouteAction_MaxStreamDuration*)envoy_config_route_v3_RouteAction_max_stream_duration(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_route_v3_RouteAction_MaxStreamDuration*)_upb_msg_new(&envoy_config_route_v3_RouteAction_MaxStreamDuration_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_RouteAction_set_max_stream_duration(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.route.v3.RouteAction.RequestMirrorPolicy */
+
+UPB_INLINE envoy_config_route_v3_RouteAction_RequestMirrorPolicy *envoy_config_route_v3_RouteAction_RequestMirrorPolicy_new(upb_arena *arena) {
+ return (envoy_config_route_v3_RouteAction_RequestMirrorPolicy *)_upb_msg_new(&envoy_config_route_v3_RouteAction_RequestMirrorPolicy_msginit, arena);
+}
+UPB_INLINE envoy_config_route_v3_RouteAction_RequestMirrorPolicy *envoy_config_route_v3_RouteAction_RequestMirrorPolicy_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_route_v3_RouteAction_RequestMirrorPolicy *ret = envoy_config_route_v3_RouteAction_RequestMirrorPolicy_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RouteAction_RequestMirrorPolicy_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_route_v3_RouteAction_RequestMirrorPolicy_serialize(const envoy_config_route_v3_RouteAction_RequestMirrorPolicy *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_route_v3_RouteAction_RequestMirrorPolicy_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview envoy_config_route_v3_RouteAction_RequestMirrorPolicy_cluster(const envoy_config_route_v3_RouteAction_RequestMirrorPolicy *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE bool envoy_config_route_v3_RouteAction_RequestMirrorPolicy_has_runtime_fraction(const envoy_config_route_v3_RouteAction_RequestMirrorPolicy *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
+UPB_INLINE const struct envoy_config_core_v3_RuntimeFractionalPercent* envoy_config_route_v3_RouteAction_RequestMirrorPolicy_runtime_fraction(const envoy_config_route_v3_RouteAction_RequestMirrorPolicy *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct envoy_config_core_v3_RuntimeFractionalPercent*); }
+UPB_INLINE bool envoy_config_route_v3_RouteAction_RequestMirrorPolicy_has_trace_sampled(const envoy_config_route_v3_RouteAction_RequestMirrorPolicy *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
+UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_route_v3_RouteAction_RequestMirrorPolicy_trace_sampled(const envoy_config_route_v3_RouteAction_RequestMirrorPolicy *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_protobuf_BoolValue*); }
+
+UPB_INLINE void envoy_config_route_v3_RouteAction_RequestMirrorPolicy_set_cluster(envoy_config_route_v3_RouteAction_RequestMirrorPolicy *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_RequestMirrorPolicy_set_runtime_fraction(envoy_config_route_v3_RouteAction_RequestMirrorPolicy *msg, struct envoy_config_core_v3_RuntimeFractionalPercent* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct envoy_config_core_v3_RuntimeFractionalPercent*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_RuntimeFractionalPercent* envoy_config_route_v3_RouteAction_RequestMirrorPolicy_mutable_runtime_fraction(envoy_config_route_v3_RouteAction_RequestMirrorPolicy *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_RuntimeFractionalPercent* sub = (struct envoy_config_core_v3_RuntimeFractionalPercent*)envoy_config_route_v3_RouteAction_RequestMirrorPolicy_runtime_fraction(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_RuntimeFractionalPercent*)_upb_msg_new(&envoy_config_core_v3_RuntimeFractionalPercent_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_RouteAction_RequestMirrorPolicy_set_runtime_fraction(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_RequestMirrorPolicy_set_trace_sampled(envoy_config_route_v3_RouteAction_RequestMirrorPolicy *msg, struct google_protobuf_BoolValue* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_protobuf_BoolValue*) = value;
+}
+UPB_INLINE struct google_protobuf_BoolValue* envoy_config_route_v3_RouteAction_RequestMirrorPolicy_mutable_trace_sampled(envoy_config_route_v3_RouteAction_RequestMirrorPolicy *msg, upb_arena *arena) {
+ struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_route_v3_RouteAction_RequestMirrorPolicy_trace_sampled(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_BoolValue*)_upb_msg_new(&google_protobuf_BoolValue_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_RouteAction_RequestMirrorPolicy_set_trace_sampled(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.route.v3.RouteAction.HashPolicy */
+
+UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy *envoy_config_route_v3_RouteAction_HashPolicy_new(upb_arena *arena) {
+ return (envoy_config_route_v3_RouteAction_HashPolicy *)_upb_msg_new(&envoy_config_route_v3_RouteAction_HashPolicy_msginit, arena);
+}
+UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy *envoy_config_route_v3_RouteAction_HashPolicy_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_route_v3_RouteAction_HashPolicy *ret = envoy_config_route_v3_RouteAction_HashPolicy_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RouteAction_HashPolicy_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_route_v3_RouteAction_HashPolicy_serialize(const envoy_config_route_v3_RouteAction_HashPolicy *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_route_v3_RouteAction_HashPolicy_msginit, arena, len);
+}
+
+typedef enum {
+ envoy_config_route_v3_RouteAction_HashPolicy_policy_specifier_header = 1,
+ envoy_config_route_v3_RouteAction_HashPolicy_policy_specifier_cookie = 2,
+ envoy_config_route_v3_RouteAction_HashPolicy_policy_specifier_connection_properties = 3,
+ envoy_config_route_v3_RouteAction_HashPolicy_policy_specifier_query_parameter = 5,
+ envoy_config_route_v3_RouteAction_HashPolicy_policy_specifier_filter_state = 6,
+ envoy_config_route_v3_RouteAction_HashPolicy_policy_specifier_NOT_SET = 0
+} envoy_config_route_v3_RouteAction_HashPolicy_policy_specifier_oneofcases;
+UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy_policy_specifier_oneofcases envoy_config_route_v3_RouteAction_HashPolicy_policy_specifier_case(const envoy_config_route_v3_RouteAction_HashPolicy* msg) { return (envoy_config_route_v3_RouteAction_HashPolicy_policy_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(8, 16), int32_t); }
+
+UPB_INLINE bool envoy_config_route_v3_RouteAction_HashPolicy_has_header(const envoy_config_route_v3_RouteAction_HashPolicy *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 1; }
+UPB_INLINE const envoy_config_route_v3_RouteAction_HashPolicy_Header* envoy_config_route_v3_RouteAction_HashPolicy_header(const envoy_config_route_v3_RouteAction_HashPolicy *msg) { return UPB_READ_ONEOF(msg, const envoy_config_route_v3_RouteAction_HashPolicy_Header*, UPB_SIZE(4, 8), UPB_SIZE(8, 16), 1, NULL); }
+UPB_INLINE bool envoy_config_route_v3_RouteAction_HashPolicy_has_cookie(const envoy_config_route_v3_RouteAction_HashPolicy *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 2; }
+UPB_INLINE const envoy_config_route_v3_RouteAction_HashPolicy_Cookie* envoy_config_route_v3_RouteAction_HashPolicy_cookie(const envoy_config_route_v3_RouteAction_HashPolicy *msg) { return UPB_READ_ONEOF(msg, const envoy_config_route_v3_RouteAction_HashPolicy_Cookie*, UPB_SIZE(4, 8), UPB_SIZE(8, 16), 2, NULL); }
+UPB_INLINE bool envoy_config_route_v3_RouteAction_HashPolicy_has_connection_properties(const envoy_config_route_v3_RouteAction_HashPolicy *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 3; }
+UPB_INLINE const envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties* envoy_config_route_v3_RouteAction_HashPolicy_connection_properties(const envoy_config_route_v3_RouteAction_HashPolicy *msg) { return UPB_READ_ONEOF(msg, const envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties*, UPB_SIZE(4, 8), UPB_SIZE(8, 16), 3, NULL); }
+UPB_INLINE bool envoy_config_route_v3_RouteAction_HashPolicy_terminal(const envoy_config_route_v3_RouteAction_HashPolicy *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); }
+UPB_INLINE bool envoy_config_route_v3_RouteAction_HashPolicy_has_query_parameter(const envoy_config_route_v3_RouteAction_HashPolicy *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 5; }
+UPB_INLINE const envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter* envoy_config_route_v3_RouteAction_HashPolicy_query_parameter(const envoy_config_route_v3_RouteAction_HashPolicy *msg) { return UPB_READ_ONEOF(msg, const envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter*, UPB_SIZE(4, 8), UPB_SIZE(8, 16), 5, NULL); }
+UPB_INLINE bool envoy_config_route_v3_RouteAction_HashPolicy_has_filter_state(const envoy_config_route_v3_RouteAction_HashPolicy *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 6; }
+UPB_INLINE const envoy_config_route_v3_RouteAction_HashPolicy_FilterState* envoy_config_route_v3_RouteAction_HashPolicy_filter_state(const envoy_config_route_v3_RouteAction_HashPolicy *msg) { return UPB_READ_ONEOF(msg, const envoy_config_route_v3_RouteAction_HashPolicy_FilterState*, UPB_SIZE(4, 8), UPB_SIZE(8, 16), 6, NULL); }
+
+UPB_INLINE void envoy_config_route_v3_RouteAction_HashPolicy_set_header(envoy_config_route_v3_RouteAction_HashPolicy *msg, envoy_config_route_v3_RouteAction_HashPolicy_Header* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RouteAction_HashPolicy_Header*, UPB_SIZE(4, 8), value, UPB_SIZE(8, 16), 1);
+}
+UPB_INLINE struct envoy_config_route_v3_RouteAction_HashPolicy_Header* envoy_config_route_v3_RouteAction_HashPolicy_mutable_header(envoy_config_route_v3_RouteAction_HashPolicy *msg, upb_arena *arena) {
+ struct envoy_config_route_v3_RouteAction_HashPolicy_Header* sub = (struct envoy_config_route_v3_RouteAction_HashPolicy_Header*)envoy_config_route_v3_RouteAction_HashPolicy_header(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_route_v3_RouteAction_HashPolicy_Header*)_upb_msg_new(&envoy_config_route_v3_RouteAction_HashPolicy_Header_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_RouteAction_HashPolicy_set_header(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_HashPolicy_set_cookie(envoy_config_route_v3_RouteAction_HashPolicy *msg, envoy_config_route_v3_RouteAction_HashPolicy_Cookie* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RouteAction_HashPolicy_Cookie*, UPB_SIZE(4, 8), value, UPB_SIZE(8, 16), 2);
+}
+UPB_INLINE struct envoy_config_route_v3_RouteAction_HashPolicy_Cookie* envoy_config_route_v3_RouteAction_HashPolicy_mutable_cookie(envoy_config_route_v3_RouteAction_HashPolicy *msg, upb_arena *arena) {
+ struct envoy_config_route_v3_RouteAction_HashPolicy_Cookie* sub = (struct envoy_config_route_v3_RouteAction_HashPolicy_Cookie*)envoy_config_route_v3_RouteAction_HashPolicy_cookie(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_route_v3_RouteAction_HashPolicy_Cookie*)_upb_msg_new(&envoy_config_route_v3_RouteAction_HashPolicy_Cookie_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_RouteAction_HashPolicy_set_cookie(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_HashPolicy_set_connection_properties(envoy_config_route_v3_RouteAction_HashPolicy *msg, envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties*, UPB_SIZE(4, 8), value, UPB_SIZE(8, 16), 3);
+}
+UPB_INLINE struct envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties* envoy_config_route_v3_RouteAction_HashPolicy_mutable_connection_properties(envoy_config_route_v3_RouteAction_HashPolicy *msg, upb_arena *arena) {
+ struct envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties* sub = (struct envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties*)envoy_config_route_v3_RouteAction_HashPolicy_connection_properties(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties*)_upb_msg_new(&envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_RouteAction_HashPolicy_set_connection_properties(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_HashPolicy_set_terminal(envoy_config_route_v3_RouteAction_HashPolicy *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_HashPolicy_set_query_parameter(envoy_config_route_v3_RouteAction_HashPolicy *msg, envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter*, UPB_SIZE(4, 8), value, UPB_SIZE(8, 16), 5);
+}
+UPB_INLINE struct envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter* envoy_config_route_v3_RouteAction_HashPolicy_mutable_query_parameter(envoy_config_route_v3_RouteAction_HashPolicy *msg, upb_arena *arena) {
+ struct envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter* sub = (struct envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter*)envoy_config_route_v3_RouteAction_HashPolicy_query_parameter(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter*)_upb_msg_new(&envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_RouteAction_HashPolicy_set_query_parameter(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_HashPolicy_set_filter_state(envoy_config_route_v3_RouteAction_HashPolicy *msg, envoy_config_route_v3_RouteAction_HashPolicy_FilterState* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RouteAction_HashPolicy_FilterState*, UPB_SIZE(4, 8), value, UPB_SIZE(8, 16), 6);
+}
+UPB_INLINE struct envoy_config_route_v3_RouteAction_HashPolicy_FilterState* envoy_config_route_v3_RouteAction_HashPolicy_mutable_filter_state(envoy_config_route_v3_RouteAction_HashPolicy *msg, upb_arena *arena) {
+ struct envoy_config_route_v3_RouteAction_HashPolicy_FilterState* sub = (struct envoy_config_route_v3_RouteAction_HashPolicy_FilterState*)envoy_config_route_v3_RouteAction_HashPolicy_filter_state(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_route_v3_RouteAction_HashPolicy_FilterState*)_upb_msg_new(&envoy_config_route_v3_RouteAction_HashPolicy_FilterState_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_RouteAction_HashPolicy_set_filter_state(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.route.v3.RouteAction.HashPolicy.Header */
+
+UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy_Header *envoy_config_route_v3_RouteAction_HashPolicy_Header_new(upb_arena *arena) {
+ return (envoy_config_route_v3_RouteAction_HashPolicy_Header *)_upb_msg_new(&envoy_config_route_v3_RouteAction_HashPolicy_Header_msginit, arena);
+}
+UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy_Header *envoy_config_route_v3_RouteAction_HashPolicy_Header_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_route_v3_RouteAction_HashPolicy_Header *ret = envoy_config_route_v3_RouteAction_HashPolicy_Header_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RouteAction_HashPolicy_Header_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_route_v3_RouteAction_HashPolicy_Header_serialize(const envoy_config_route_v3_RouteAction_HashPolicy_Header *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_route_v3_RouteAction_HashPolicy_Header_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview envoy_config_route_v3_RouteAction_HashPolicy_Header_header_name(const envoy_config_route_v3_RouteAction_HashPolicy_Header *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE bool envoy_config_route_v3_RouteAction_HashPolicy_Header_has_regex_rewrite(const envoy_config_route_v3_RouteAction_HashPolicy_Header *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
+UPB_INLINE const struct envoy_type_matcher_v3_RegexMatchAndSubstitute* envoy_config_route_v3_RouteAction_HashPolicy_Header_regex_rewrite(const envoy_config_route_v3_RouteAction_HashPolicy_Header *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct envoy_type_matcher_v3_RegexMatchAndSubstitute*); }
+
+UPB_INLINE void envoy_config_route_v3_RouteAction_HashPolicy_Header_set_header_name(envoy_config_route_v3_RouteAction_HashPolicy_Header *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_HashPolicy_Header_set_regex_rewrite(envoy_config_route_v3_RouteAction_HashPolicy_Header *msg, struct envoy_type_matcher_v3_RegexMatchAndSubstitute* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct envoy_type_matcher_v3_RegexMatchAndSubstitute*) = value;
+}
+UPB_INLINE struct envoy_type_matcher_v3_RegexMatchAndSubstitute* envoy_config_route_v3_RouteAction_HashPolicy_Header_mutable_regex_rewrite(envoy_config_route_v3_RouteAction_HashPolicy_Header *msg, upb_arena *arena) {
+ struct envoy_type_matcher_v3_RegexMatchAndSubstitute* sub = (struct envoy_type_matcher_v3_RegexMatchAndSubstitute*)envoy_config_route_v3_RouteAction_HashPolicy_Header_regex_rewrite(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_type_matcher_v3_RegexMatchAndSubstitute*)_upb_msg_new(&envoy_type_matcher_v3_RegexMatchAndSubstitute_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_RouteAction_HashPolicy_Header_set_regex_rewrite(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.route.v3.RouteAction.HashPolicy.Cookie */
+
+UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy_Cookie *envoy_config_route_v3_RouteAction_HashPolicy_Cookie_new(upb_arena *arena) {
+ return (envoy_config_route_v3_RouteAction_HashPolicy_Cookie *)_upb_msg_new(&envoy_config_route_v3_RouteAction_HashPolicy_Cookie_msginit, arena);
+}
+UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy_Cookie *envoy_config_route_v3_RouteAction_HashPolicy_Cookie_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_route_v3_RouteAction_HashPolicy_Cookie *ret = envoy_config_route_v3_RouteAction_HashPolicy_Cookie_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RouteAction_HashPolicy_Cookie_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_route_v3_RouteAction_HashPolicy_Cookie_serialize(const envoy_config_route_v3_RouteAction_HashPolicy_Cookie *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_route_v3_RouteAction_HashPolicy_Cookie_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview envoy_config_route_v3_RouteAction_HashPolicy_Cookie_name(const envoy_config_route_v3_RouteAction_HashPolicy_Cookie *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE bool envoy_config_route_v3_RouteAction_HashPolicy_Cookie_has_ttl(const envoy_config_route_v3_RouteAction_HashPolicy_Cookie *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); }
+UPB_INLINE const struct google_protobuf_Duration* envoy_config_route_v3_RouteAction_HashPolicy_Cookie_ttl(const envoy_config_route_v3_RouteAction_HashPolicy_Cookie *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const struct google_protobuf_Duration*); }
+UPB_INLINE upb_strview envoy_config_route_v3_RouteAction_HashPolicy_Cookie_path(const envoy_config_route_v3_RouteAction_HashPolicy_Cookie *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview); }
+
+UPB_INLINE void envoy_config_route_v3_RouteAction_HashPolicy_Cookie_set_name(envoy_config_route_v3_RouteAction_HashPolicy_Cookie *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_HashPolicy_Cookie_set_ttl(envoy_config_route_v3_RouteAction_HashPolicy_Cookie *msg, struct google_protobuf_Duration* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), struct google_protobuf_Duration*) = value;
+}
+UPB_INLINE struct google_protobuf_Duration* envoy_config_route_v3_RouteAction_HashPolicy_Cookie_mutable_ttl(envoy_config_route_v3_RouteAction_HashPolicy_Cookie *msg, upb_arena *arena) {
+ struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_route_v3_RouteAction_HashPolicy_Cookie_ttl(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_RouteAction_HashPolicy_Cookie_set_ttl(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_HashPolicy_Cookie_set_path(envoy_config_route_v3_RouteAction_HashPolicy_Cookie *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview) = value;
+}
+
+/* envoy.config.route.v3.RouteAction.HashPolicy.ConnectionProperties */
+
+UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties *envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_new(upb_arena *arena) {
+ return (envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties *)_upb_msg_new(&envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_msginit, arena);
+}
+UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties *envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties *ret = envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_serialize(const envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_source_ip(const envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); }
+
+UPB_INLINE void envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_set_source_ip(envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
+}
+
+/* envoy.config.route.v3.RouteAction.HashPolicy.QueryParameter */
+
+UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter *envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_new(upb_arena *arena) {
+ return (envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter *)_upb_msg_new(&envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_msginit, arena);
+}
+UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter *envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter *ret = envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_serialize(const envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_name(const envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+
+UPB_INLINE void envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_set_name(envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+
+/* envoy.config.route.v3.RouteAction.HashPolicy.FilterState */
+
+UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy_FilterState *envoy_config_route_v3_RouteAction_HashPolicy_FilterState_new(upb_arena *arena) {
+ return (envoy_config_route_v3_RouteAction_HashPolicy_FilterState *)_upb_msg_new(&envoy_config_route_v3_RouteAction_HashPolicy_FilterState_msginit, arena);
+}
+UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy_FilterState *envoy_config_route_v3_RouteAction_HashPolicy_FilterState_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_route_v3_RouteAction_HashPolicy_FilterState *ret = envoy_config_route_v3_RouteAction_HashPolicy_FilterState_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RouteAction_HashPolicy_FilterState_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_route_v3_RouteAction_HashPolicy_FilterState_serialize(const envoy_config_route_v3_RouteAction_HashPolicy_FilterState *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_route_v3_RouteAction_HashPolicy_FilterState_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview envoy_config_route_v3_RouteAction_HashPolicy_FilterState_key(const envoy_config_route_v3_RouteAction_HashPolicy_FilterState *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+
+UPB_INLINE void envoy_config_route_v3_RouteAction_HashPolicy_FilterState_set_key(envoy_config_route_v3_RouteAction_HashPolicy_FilterState *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+
+/* envoy.config.route.v3.RouteAction.UpgradeConfig */
+
+UPB_INLINE envoy_config_route_v3_RouteAction_UpgradeConfig *envoy_config_route_v3_RouteAction_UpgradeConfig_new(upb_arena *arena) {
+ return (envoy_config_route_v3_RouteAction_UpgradeConfig *)_upb_msg_new(&envoy_config_route_v3_RouteAction_UpgradeConfig_msginit, arena);
+}
+UPB_INLINE envoy_config_route_v3_RouteAction_UpgradeConfig *envoy_config_route_v3_RouteAction_UpgradeConfig_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_route_v3_RouteAction_UpgradeConfig *ret = envoy_config_route_v3_RouteAction_UpgradeConfig_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RouteAction_UpgradeConfig_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_route_v3_RouteAction_UpgradeConfig_serialize(const envoy_config_route_v3_RouteAction_UpgradeConfig *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_route_v3_RouteAction_UpgradeConfig_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview envoy_config_route_v3_RouteAction_UpgradeConfig_upgrade_type(const envoy_config_route_v3_RouteAction_UpgradeConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE bool envoy_config_route_v3_RouteAction_UpgradeConfig_has_enabled(const envoy_config_route_v3_RouteAction_UpgradeConfig *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
+UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_route_v3_RouteAction_UpgradeConfig_enabled(const envoy_config_route_v3_RouteAction_UpgradeConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_BoolValue*); }
+UPB_INLINE bool envoy_config_route_v3_RouteAction_UpgradeConfig_has_connect_config(const envoy_config_route_v3_RouteAction_UpgradeConfig *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
+UPB_INLINE const envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig* envoy_config_route_v3_RouteAction_UpgradeConfig_connect_config(const envoy_config_route_v3_RouteAction_UpgradeConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig*); }
+
+UPB_INLINE void envoy_config_route_v3_RouteAction_UpgradeConfig_set_upgrade_type(envoy_config_route_v3_RouteAction_UpgradeConfig *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_UpgradeConfig_set_enabled(envoy_config_route_v3_RouteAction_UpgradeConfig *msg, struct google_protobuf_BoolValue* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_BoolValue*) = value;
+}
+UPB_INLINE struct google_protobuf_BoolValue* envoy_config_route_v3_RouteAction_UpgradeConfig_mutable_enabled(envoy_config_route_v3_RouteAction_UpgradeConfig *msg, upb_arena *arena) {
+ struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_route_v3_RouteAction_UpgradeConfig_enabled(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_BoolValue*)_upb_msg_new(&google_protobuf_BoolValue_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_RouteAction_UpgradeConfig_set_enabled(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_UpgradeConfig_set_connect_config(envoy_config_route_v3_RouteAction_UpgradeConfig *msg, envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig*) = value;
+}
+UPB_INLINE struct envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig* envoy_config_route_v3_RouteAction_UpgradeConfig_mutable_connect_config(envoy_config_route_v3_RouteAction_UpgradeConfig *msg, upb_arena *arena) {
+ struct envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig* sub = (struct envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig*)envoy_config_route_v3_RouteAction_UpgradeConfig_connect_config(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig*)_upb_msg_new(&envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_RouteAction_UpgradeConfig_set_connect_config(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.route.v3.RouteAction.UpgradeConfig.ConnectConfig */
+
+UPB_INLINE envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig *envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_new(upb_arena *arena) {
+ return (envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig *)_upb_msg_new(&envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_msginit, arena);
+}
+UPB_INLINE envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig *envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig *ret = envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_serialize(const envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_has_proxy_protocol_config(const envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE const struct envoy_config_core_v3_ProxyProtocolConfig* envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_proxy_protocol_config(const envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct envoy_config_core_v3_ProxyProtocolConfig*); }
+
+UPB_INLINE void envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_set_proxy_protocol_config(envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig *msg, struct envoy_config_core_v3_ProxyProtocolConfig* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct envoy_config_core_v3_ProxyProtocolConfig*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_ProxyProtocolConfig* envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_mutable_proxy_protocol_config(envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_ProxyProtocolConfig* sub = (struct envoy_config_core_v3_ProxyProtocolConfig*)envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_proxy_protocol_config(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_ProxyProtocolConfig*)_upb_msg_new(&envoy_config_core_v3_ProxyProtocolConfig_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_set_proxy_protocol_config(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.route.v3.RouteAction.MaxStreamDuration */
+
+UPB_INLINE envoy_config_route_v3_RouteAction_MaxStreamDuration *envoy_config_route_v3_RouteAction_MaxStreamDuration_new(upb_arena *arena) {
+ return (envoy_config_route_v3_RouteAction_MaxStreamDuration *)_upb_msg_new(&envoy_config_route_v3_RouteAction_MaxStreamDuration_msginit, arena);
+}
+UPB_INLINE envoy_config_route_v3_RouteAction_MaxStreamDuration *envoy_config_route_v3_RouteAction_MaxStreamDuration_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_route_v3_RouteAction_MaxStreamDuration *ret = envoy_config_route_v3_RouteAction_MaxStreamDuration_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RouteAction_MaxStreamDuration_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_route_v3_RouteAction_MaxStreamDuration_serialize(const envoy_config_route_v3_RouteAction_MaxStreamDuration *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_route_v3_RouteAction_MaxStreamDuration_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_route_v3_RouteAction_MaxStreamDuration_has_max_stream_duration(const envoy_config_route_v3_RouteAction_MaxStreamDuration *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE const struct google_protobuf_Duration* envoy_config_route_v3_RouteAction_MaxStreamDuration_max_stream_duration(const envoy_config_route_v3_RouteAction_MaxStreamDuration *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct google_protobuf_Duration*); }
+UPB_INLINE bool envoy_config_route_v3_RouteAction_MaxStreamDuration_has_grpc_timeout_header_max(const envoy_config_route_v3_RouteAction_MaxStreamDuration *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
+UPB_INLINE const struct google_protobuf_Duration* envoy_config_route_v3_RouteAction_MaxStreamDuration_grpc_timeout_header_max(const envoy_config_route_v3_RouteAction_MaxStreamDuration *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_Duration*); }
+UPB_INLINE bool envoy_config_route_v3_RouteAction_MaxStreamDuration_has_grpc_timeout_header_offset(const envoy_config_route_v3_RouteAction_MaxStreamDuration *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
+UPB_INLINE const struct google_protobuf_Duration* envoy_config_route_v3_RouteAction_MaxStreamDuration_grpc_timeout_header_offset(const envoy_config_route_v3_RouteAction_MaxStreamDuration *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_Duration*); }
+
+UPB_INLINE void envoy_config_route_v3_RouteAction_MaxStreamDuration_set_max_stream_duration(envoy_config_route_v3_RouteAction_MaxStreamDuration *msg, struct google_protobuf_Duration* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct google_protobuf_Duration*) = value;
+}
+UPB_INLINE struct google_protobuf_Duration* envoy_config_route_v3_RouteAction_MaxStreamDuration_mutable_max_stream_duration(envoy_config_route_v3_RouteAction_MaxStreamDuration *msg, upb_arena *arena) {
+ struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_route_v3_RouteAction_MaxStreamDuration_max_stream_duration(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_RouteAction_MaxStreamDuration_set_max_stream_duration(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_MaxStreamDuration_set_grpc_timeout_header_max(envoy_config_route_v3_RouteAction_MaxStreamDuration *msg, struct google_protobuf_Duration* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_Duration*) = value;
+}
+UPB_INLINE struct google_protobuf_Duration* envoy_config_route_v3_RouteAction_MaxStreamDuration_mutable_grpc_timeout_header_max(envoy_config_route_v3_RouteAction_MaxStreamDuration *msg, upb_arena *arena) {
+ struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_route_v3_RouteAction_MaxStreamDuration_grpc_timeout_header_max(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_RouteAction_MaxStreamDuration_set_grpc_timeout_header_max(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_MaxStreamDuration_set_grpc_timeout_header_offset(envoy_config_route_v3_RouteAction_MaxStreamDuration *msg, struct google_protobuf_Duration* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_Duration*) = value;
+}
+UPB_INLINE struct google_protobuf_Duration* envoy_config_route_v3_RouteAction_MaxStreamDuration_mutable_grpc_timeout_header_offset(envoy_config_route_v3_RouteAction_MaxStreamDuration *msg, upb_arena *arena) {
+ struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_route_v3_RouteAction_MaxStreamDuration_grpc_timeout_header_offset(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_RouteAction_MaxStreamDuration_set_grpc_timeout_header_offset(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.route.v3.RetryPolicy */
+
+UPB_INLINE envoy_config_route_v3_RetryPolicy *envoy_config_route_v3_RetryPolicy_new(upb_arena *arena) {
+ return (envoy_config_route_v3_RetryPolicy *)_upb_msg_new(&envoy_config_route_v3_RetryPolicy_msginit, arena);
+}
+UPB_INLINE envoy_config_route_v3_RetryPolicy *envoy_config_route_v3_RetryPolicy_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_route_v3_RetryPolicy *ret = envoy_config_route_v3_RetryPolicy_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RetryPolicy_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_route_v3_RetryPolicy_serialize(const envoy_config_route_v3_RetryPolicy *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_route_v3_RetryPolicy_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview envoy_config_route_v3_RetryPolicy_retry_on(const envoy_config_route_v3_RetryPolicy *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview); }
+UPB_INLINE bool envoy_config_route_v3_RetryPolicy_has_num_retries(const envoy_config_route_v3_RetryPolicy *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 24)); }
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_route_v3_RetryPolicy_num_retries(const envoy_config_route_v3_RetryPolicy *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const struct google_protobuf_UInt32Value*); }
+UPB_INLINE bool envoy_config_route_v3_RetryPolicy_has_per_try_timeout(const envoy_config_route_v3_RetryPolicy *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 32)); }
+UPB_INLINE const struct google_protobuf_Duration* envoy_config_route_v3_RetryPolicy_per_try_timeout(const envoy_config_route_v3_RetryPolicy *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const struct google_protobuf_Duration*); }
+UPB_INLINE bool envoy_config_route_v3_RetryPolicy_has_retry_priority(const envoy_config_route_v3_RetryPolicy *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 40)); }
+UPB_INLINE const envoy_config_route_v3_RetryPolicy_RetryPriority* envoy_config_route_v3_RetryPolicy_retry_priority(const envoy_config_route_v3_RetryPolicy *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const envoy_config_route_v3_RetryPolicy_RetryPriority*); }
+UPB_INLINE bool envoy_config_route_v3_RetryPolicy_has_retry_host_predicate(const envoy_config_route_v3_RetryPolicy *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(36, 64)); }
+UPB_INLINE const envoy_config_route_v3_RetryPolicy_RetryHostPredicate* const* envoy_config_route_v3_RetryPolicy_retry_host_predicate(const envoy_config_route_v3_RetryPolicy *msg, size_t *len) { return (const envoy_config_route_v3_RetryPolicy_RetryHostPredicate* const*)_upb_array_accessor(msg, UPB_SIZE(36, 64), len); }
+UPB_INLINE int64_t envoy_config_route_v3_RetryPolicy_host_selection_retry_max_attempts(const envoy_config_route_v3_RetryPolicy *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int64_t); }
+UPB_INLINE uint32_t const* envoy_config_route_v3_RetryPolicy_retriable_status_codes(const envoy_config_route_v3_RetryPolicy *msg, size_t *len) { return (uint32_t const*)_upb_array_accessor(msg, UPB_SIZE(40, 72), len); }
+UPB_INLINE bool envoy_config_route_v3_RetryPolicy_has_retry_back_off(const envoy_config_route_v3_RetryPolicy *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 48)); }
+UPB_INLINE const envoy_config_route_v3_RetryPolicy_RetryBackOff* envoy_config_route_v3_RetryPolicy_retry_back_off(const envoy_config_route_v3_RetryPolicy *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 48), const envoy_config_route_v3_RetryPolicy_RetryBackOff*); }
+UPB_INLINE bool envoy_config_route_v3_RetryPolicy_has_retriable_headers(const envoy_config_route_v3_RetryPolicy *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(44, 80)); }
+UPB_INLINE const envoy_config_route_v3_HeaderMatcher* const* envoy_config_route_v3_RetryPolicy_retriable_headers(const envoy_config_route_v3_RetryPolicy *msg, size_t *len) { return (const envoy_config_route_v3_HeaderMatcher* const*)_upb_array_accessor(msg, UPB_SIZE(44, 80), len); }
+UPB_INLINE bool envoy_config_route_v3_RetryPolicy_has_retriable_request_headers(const envoy_config_route_v3_RetryPolicy *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(48, 88)); }
+UPB_INLINE const envoy_config_route_v3_HeaderMatcher* const* envoy_config_route_v3_RetryPolicy_retriable_request_headers(const envoy_config_route_v3_RetryPolicy *msg, size_t *len) { return (const envoy_config_route_v3_HeaderMatcher* const*)_upb_array_accessor(msg, UPB_SIZE(48, 88), len); }
+UPB_INLINE bool envoy_config_route_v3_RetryPolicy_has_rate_limited_retry_back_off(const envoy_config_route_v3_RetryPolicy *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(32, 56)); }
+UPB_INLINE const envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff* envoy_config_route_v3_RetryPolicy_rate_limited_retry_back_off(const envoy_config_route_v3_RetryPolicy *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 56), const envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff*); }
+
+UPB_INLINE void envoy_config_route_v3_RetryPolicy_set_retry_on(envoy_config_route_v3_RetryPolicy *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_route_v3_RetryPolicy_set_num_retries(envoy_config_route_v3_RetryPolicy *msg, struct google_protobuf_UInt32Value* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_route_v3_RetryPolicy_mutable_num_retries(envoy_config_route_v3_RetryPolicy *msg, upb_arena *arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_route_v3_RetryPolicy_num_retries(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_RetryPolicy_set_num_retries(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_route_v3_RetryPolicy_set_per_try_timeout(envoy_config_route_v3_RetryPolicy *msg, struct google_protobuf_Duration* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 32), struct google_protobuf_Duration*) = value;
+}
+UPB_INLINE struct google_protobuf_Duration* envoy_config_route_v3_RetryPolicy_mutable_per_try_timeout(envoy_config_route_v3_RetryPolicy *msg, upb_arena *arena) {
+ struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_route_v3_RetryPolicy_per_try_timeout(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_RetryPolicy_set_per_try_timeout(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_route_v3_RetryPolicy_set_retry_priority(envoy_config_route_v3_RetryPolicy *msg, envoy_config_route_v3_RetryPolicy_RetryPriority* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 40), envoy_config_route_v3_RetryPolicy_RetryPriority*) = value;
+}
+UPB_INLINE struct envoy_config_route_v3_RetryPolicy_RetryPriority* envoy_config_route_v3_RetryPolicy_mutable_retry_priority(envoy_config_route_v3_RetryPolicy *msg, upb_arena *arena) {
+ struct envoy_config_route_v3_RetryPolicy_RetryPriority* sub = (struct envoy_config_route_v3_RetryPolicy_RetryPriority*)envoy_config_route_v3_RetryPolicy_retry_priority(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_route_v3_RetryPolicy_RetryPriority*)_upb_msg_new(&envoy_config_route_v3_RetryPolicy_RetryPriority_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_RetryPolicy_set_retry_priority(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE envoy_config_route_v3_RetryPolicy_RetryHostPredicate** envoy_config_route_v3_RetryPolicy_mutable_retry_host_predicate(envoy_config_route_v3_RetryPolicy *msg, size_t *len) {
+ return (envoy_config_route_v3_RetryPolicy_RetryHostPredicate**)_upb_array_mutable_accessor(msg, UPB_SIZE(36, 64), len);
+}
+UPB_INLINE envoy_config_route_v3_RetryPolicy_RetryHostPredicate** envoy_config_route_v3_RetryPolicy_resize_retry_host_predicate(envoy_config_route_v3_RetryPolicy *msg, size_t len, upb_arena *arena) {
+ return (envoy_config_route_v3_RetryPolicy_RetryHostPredicate**)_upb_array_resize_accessor(msg, UPB_SIZE(36, 64), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_config_route_v3_RetryPolicy_RetryHostPredicate* envoy_config_route_v3_RetryPolicy_add_retry_host_predicate(envoy_config_route_v3_RetryPolicy *msg, upb_arena *arena) {
+ struct envoy_config_route_v3_RetryPolicy_RetryHostPredicate* sub = (struct envoy_config_route_v3_RetryPolicy_RetryHostPredicate*)_upb_msg_new(&envoy_config_route_v3_RetryPolicy_RetryHostPredicate_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(36, 64), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE void envoy_config_route_v3_RetryPolicy_set_host_selection_retry_max_attempts(envoy_config_route_v3_RetryPolicy *msg, int64_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int64_t) = value;
+}
+UPB_INLINE uint32_t* envoy_config_route_v3_RetryPolicy_mutable_retriable_status_codes(envoy_config_route_v3_RetryPolicy *msg, size_t *len) {
+ return (uint32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(40, 72), len);
+}
+UPB_INLINE uint32_t* envoy_config_route_v3_RetryPolicy_resize_retriable_status_codes(envoy_config_route_v3_RetryPolicy *msg, size_t len, upb_arena *arena) {
+ return (uint32_t*)_upb_array_resize_accessor(msg, UPB_SIZE(40, 72), len, UPB_TYPE_UINT32, arena);
+}
+UPB_INLINE bool envoy_config_route_v3_RetryPolicy_add_retriable_status_codes(envoy_config_route_v3_RetryPolicy *msg, uint32_t val, upb_arena *arena) {
+ return _upb_array_append_accessor(msg, UPB_SIZE(40, 72), UPB_SIZE(4, 4), UPB_TYPE_UINT32, &val,
+ arena);
+}
+UPB_INLINE void envoy_config_route_v3_RetryPolicy_set_retry_back_off(envoy_config_route_v3_RetryPolicy *msg, envoy_config_route_v3_RetryPolicy_RetryBackOff* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 48), envoy_config_route_v3_RetryPolicy_RetryBackOff*) = value;
+}
+UPB_INLINE struct envoy_config_route_v3_RetryPolicy_RetryBackOff* envoy_config_route_v3_RetryPolicy_mutable_retry_back_off(envoy_config_route_v3_RetryPolicy *msg, upb_arena *arena) {
+ struct envoy_config_route_v3_RetryPolicy_RetryBackOff* sub = (struct envoy_config_route_v3_RetryPolicy_RetryBackOff*)envoy_config_route_v3_RetryPolicy_retry_back_off(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_route_v3_RetryPolicy_RetryBackOff*)_upb_msg_new(&envoy_config_route_v3_RetryPolicy_RetryBackOff_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_RetryPolicy_set_retry_back_off(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE envoy_config_route_v3_HeaderMatcher** envoy_config_route_v3_RetryPolicy_mutable_retriable_headers(envoy_config_route_v3_RetryPolicy *msg, size_t *len) {
+ return (envoy_config_route_v3_HeaderMatcher**)_upb_array_mutable_accessor(msg, UPB_SIZE(44, 80), len);
+}
+UPB_INLINE envoy_config_route_v3_HeaderMatcher** envoy_config_route_v3_RetryPolicy_resize_retriable_headers(envoy_config_route_v3_RetryPolicy *msg, size_t len, upb_arena *arena) {
+ return (envoy_config_route_v3_HeaderMatcher**)_upb_array_resize_accessor(msg, UPB_SIZE(44, 80), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_config_route_v3_HeaderMatcher* envoy_config_route_v3_RetryPolicy_add_retriable_headers(envoy_config_route_v3_RetryPolicy *msg, upb_arena *arena) {
+ struct envoy_config_route_v3_HeaderMatcher* sub = (struct envoy_config_route_v3_HeaderMatcher*)_upb_msg_new(&envoy_config_route_v3_HeaderMatcher_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(44, 80), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE envoy_config_route_v3_HeaderMatcher** envoy_config_route_v3_RetryPolicy_mutable_retriable_request_headers(envoy_config_route_v3_RetryPolicy *msg, size_t *len) {
+ return (envoy_config_route_v3_HeaderMatcher**)_upb_array_mutable_accessor(msg, UPB_SIZE(48, 88), len);
+}
+UPB_INLINE envoy_config_route_v3_HeaderMatcher** envoy_config_route_v3_RetryPolicy_resize_retriable_request_headers(envoy_config_route_v3_RetryPolicy *msg, size_t len, upb_arena *arena) {
+ return (envoy_config_route_v3_HeaderMatcher**)_upb_array_resize_accessor(msg, UPB_SIZE(48, 88), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_config_route_v3_HeaderMatcher* envoy_config_route_v3_RetryPolicy_add_retriable_request_headers(envoy_config_route_v3_RetryPolicy *msg, upb_arena *arena) {
+ struct envoy_config_route_v3_HeaderMatcher* sub = (struct envoy_config_route_v3_HeaderMatcher*)_upb_msg_new(&envoy_config_route_v3_HeaderMatcher_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(48, 88), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE void envoy_config_route_v3_RetryPolicy_set_rate_limited_retry_back_off(envoy_config_route_v3_RetryPolicy *msg, envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 56), envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff*) = value;
+}
+UPB_INLINE struct envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff* envoy_config_route_v3_RetryPolicy_mutable_rate_limited_retry_back_off(envoy_config_route_v3_RetryPolicy *msg, upb_arena *arena) {
+ struct envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff* sub = (struct envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff*)envoy_config_route_v3_RetryPolicy_rate_limited_retry_back_off(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff*)_upb_msg_new(&envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_RetryPolicy_set_rate_limited_retry_back_off(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.route.v3.RetryPolicy.RetryPriority */
+
+UPB_INLINE envoy_config_route_v3_RetryPolicy_RetryPriority *envoy_config_route_v3_RetryPolicy_RetryPriority_new(upb_arena *arena) {
+ return (envoy_config_route_v3_RetryPolicy_RetryPriority *)_upb_msg_new(&envoy_config_route_v3_RetryPolicy_RetryPriority_msginit, arena);
+}
+UPB_INLINE envoy_config_route_v3_RetryPolicy_RetryPriority *envoy_config_route_v3_RetryPolicy_RetryPriority_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_route_v3_RetryPolicy_RetryPriority *ret = envoy_config_route_v3_RetryPolicy_RetryPriority_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RetryPolicy_RetryPriority_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_route_v3_RetryPolicy_RetryPriority_serialize(const envoy_config_route_v3_RetryPolicy_RetryPriority *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_route_v3_RetryPolicy_RetryPriority_msginit, arena, len);
+}
+
+typedef enum {
+ envoy_config_route_v3_RetryPolicy_RetryPriority_config_type_typed_config = 3,
+ envoy_config_route_v3_RetryPolicy_RetryPriority_config_type_NOT_SET = 0
+} envoy_config_route_v3_RetryPolicy_RetryPriority_config_type_oneofcases;
+UPB_INLINE envoy_config_route_v3_RetryPolicy_RetryPriority_config_type_oneofcases envoy_config_route_v3_RetryPolicy_RetryPriority_config_type_case(const envoy_config_route_v3_RetryPolicy_RetryPriority* msg) { return (envoy_config_route_v3_RetryPolicy_RetryPriority_config_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(12, 24), int32_t); }
+
+UPB_INLINE upb_strview envoy_config_route_v3_RetryPolicy_RetryPriority_name(const envoy_config_route_v3_RetryPolicy_RetryPriority *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE bool envoy_config_route_v3_RetryPolicy_RetryPriority_has_typed_config(const envoy_config_route_v3_RetryPolicy_RetryPriority *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 3; }
+UPB_INLINE const struct google_protobuf_Any* envoy_config_route_v3_RetryPolicy_RetryPriority_typed_config(const envoy_config_route_v3_RetryPolicy_RetryPriority *msg) { return UPB_READ_ONEOF(msg, const struct google_protobuf_Any*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 3, NULL); }
+
+UPB_INLINE void envoy_config_route_v3_RetryPolicy_RetryPriority_set_name(envoy_config_route_v3_RetryPolicy_RetryPriority *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_route_v3_RetryPolicy_RetryPriority_set_typed_config(envoy_config_route_v3_RetryPolicy_RetryPriority *msg, struct google_protobuf_Any* value) {
+ UPB_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 3);
+}
+UPB_INLINE struct google_protobuf_Any* envoy_config_route_v3_RetryPolicy_RetryPriority_mutable_typed_config(envoy_config_route_v3_RetryPolicy_RetryPriority *msg, upb_arena *arena) {
+ struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_config_route_v3_RetryPolicy_RetryPriority_typed_config(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_RetryPolicy_RetryPriority_set_typed_config(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.route.v3.RetryPolicy.RetryHostPredicate */
+
+UPB_INLINE envoy_config_route_v3_RetryPolicy_RetryHostPredicate *envoy_config_route_v3_RetryPolicy_RetryHostPredicate_new(upb_arena *arena) {
+ return (envoy_config_route_v3_RetryPolicy_RetryHostPredicate *)_upb_msg_new(&envoy_config_route_v3_RetryPolicy_RetryHostPredicate_msginit, arena);
+}
+UPB_INLINE envoy_config_route_v3_RetryPolicy_RetryHostPredicate *envoy_config_route_v3_RetryPolicy_RetryHostPredicate_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_route_v3_RetryPolicy_RetryHostPredicate *ret = envoy_config_route_v3_RetryPolicy_RetryHostPredicate_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RetryPolicy_RetryHostPredicate_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_route_v3_RetryPolicy_RetryHostPredicate_serialize(const envoy_config_route_v3_RetryPolicy_RetryHostPredicate *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_route_v3_RetryPolicy_RetryHostPredicate_msginit, arena, len);
+}
+
+typedef enum {
+ envoy_config_route_v3_RetryPolicy_RetryHostPredicate_config_type_typed_config = 3,
+ envoy_config_route_v3_RetryPolicy_RetryHostPredicate_config_type_NOT_SET = 0
+} envoy_config_route_v3_RetryPolicy_RetryHostPredicate_config_type_oneofcases;
+UPB_INLINE envoy_config_route_v3_RetryPolicy_RetryHostPredicate_config_type_oneofcases envoy_config_route_v3_RetryPolicy_RetryHostPredicate_config_type_case(const envoy_config_route_v3_RetryPolicy_RetryHostPredicate* msg) { return (envoy_config_route_v3_RetryPolicy_RetryHostPredicate_config_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(12, 24), int32_t); }
+
+UPB_INLINE upb_strview envoy_config_route_v3_RetryPolicy_RetryHostPredicate_name(const envoy_config_route_v3_RetryPolicy_RetryHostPredicate *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE bool envoy_config_route_v3_RetryPolicy_RetryHostPredicate_has_typed_config(const envoy_config_route_v3_RetryPolicy_RetryHostPredicate *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 3; }
+UPB_INLINE const struct google_protobuf_Any* envoy_config_route_v3_RetryPolicy_RetryHostPredicate_typed_config(const envoy_config_route_v3_RetryPolicy_RetryHostPredicate *msg) { return UPB_READ_ONEOF(msg, const struct google_protobuf_Any*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 3, NULL); }
+
+UPB_INLINE void envoy_config_route_v3_RetryPolicy_RetryHostPredicate_set_name(envoy_config_route_v3_RetryPolicy_RetryHostPredicate *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_route_v3_RetryPolicy_RetryHostPredicate_set_typed_config(envoy_config_route_v3_RetryPolicy_RetryHostPredicate *msg, struct google_protobuf_Any* value) {
+ UPB_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 3);
+}
+UPB_INLINE struct google_protobuf_Any* envoy_config_route_v3_RetryPolicy_RetryHostPredicate_mutable_typed_config(envoy_config_route_v3_RetryPolicy_RetryHostPredicate *msg, upb_arena *arena) {
+ struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_config_route_v3_RetryPolicy_RetryHostPredicate_typed_config(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_RetryPolicy_RetryHostPredicate_set_typed_config(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.route.v3.RetryPolicy.RetryBackOff */
+
+UPB_INLINE envoy_config_route_v3_RetryPolicy_RetryBackOff *envoy_config_route_v3_RetryPolicy_RetryBackOff_new(upb_arena *arena) {
+ return (envoy_config_route_v3_RetryPolicy_RetryBackOff *)_upb_msg_new(&envoy_config_route_v3_RetryPolicy_RetryBackOff_msginit, arena);
+}
+UPB_INLINE envoy_config_route_v3_RetryPolicy_RetryBackOff *envoy_config_route_v3_RetryPolicy_RetryBackOff_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_route_v3_RetryPolicy_RetryBackOff *ret = envoy_config_route_v3_RetryPolicy_RetryBackOff_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RetryPolicy_RetryBackOff_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_route_v3_RetryPolicy_RetryBackOff_serialize(const envoy_config_route_v3_RetryPolicy_RetryBackOff *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_route_v3_RetryPolicy_RetryBackOff_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_route_v3_RetryPolicy_RetryBackOff_has_base_interval(const envoy_config_route_v3_RetryPolicy_RetryBackOff *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE const struct google_protobuf_Duration* envoy_config_route_v3_RetryPolicy_RetryBackOff_base_interval(const envoy_config_route_v3_RetryPolicy_RetryBackOff *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct google_protobuf_Duration*); }
+UPB_INLINE bool envoy_config_route_v3_RetryPolicy_RetryBackOff_has_max_interval(const envoy_config_route_v3_RetryPolicy_RetryBackOff *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
+UPB_INLINE const struct google_protobuf_Duration* envoy_config_route_v3_RetryPolicy_RetryBackOff_max_interval(const envoy_config_route_v3_RetryPolicy_RetryBackOff *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_Duration*); }
+
+UPB_INLINE void envoy_config_route_v3_RetryPolicy_RetryBackOff_set_base_interval(envoy_config_route_v3_RetryPolicy_RetryBackOff *msg, struct google_protobuf_Duration* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct google_protobuf_Duration*) = value;
+}
+UPB_INLINE struct google_protobuf_Duration* envoy_config_route_v3_RetryPolicy_RetryBackOff_mutable_base_interval(envoy_config_route_v3_RetryPolicy_RetryBackOff *msg, upb_arena *arena) {
+ struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_route_v3_RetryPolicy_RetryBackOff_base_interval(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_RetryPolicy_RetryBackOff_set_base_interval(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_route_v3_RetryPolicy_RetryBackOff_set_max_interval(envoy_config_route_v3_RetryPolicy_RetryBackOff *msg, struct google_protobuf_Duration* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_Duration*) = value;
+}
+UPB_INLINE struct google_protobuf_Duration* envoy_config_route_v3_RetryPolicy_RetryBackOff_mutable_max_interval(envoy_config_route_v3_RetryPolicy_RetryBackOff *msg, upb_arena *arena) {
+ struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_route_v3_RetryPolicy_RetryBackOff_max_interval(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_RetryPolicy_RetryBackOff_set_max_interval(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.route.v3.RetryPolicy.ResetHeader */
+
+UPB_INLINE envoy_config_route_v3_RetryPolicy_ResetHeader *envoy_config_route_v3_RetryPolicy_ResetHeader_new(upb_arena *arena) {
+ return (envoy_config_route_v3_RetryPolicy_ResetHeader *)_upb_msg_new(&envoy_config_route_v3_RetryPolicy_ResetHeader_msginit, arena);
+}
+UPB_INLINE envoy_config_route_v3_RetryPolicy_ResetHeader *envoy_config_route_v3_RetryPolicy_ResetHeader_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_route_v3_RetryPolicy_ResetHeader *ret = envoy_config_route_v3_RetryPolicy_ResetHeader_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RetryPolicy_ResetHeader_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_route_v3_RetryPolicy_ResetHeader_serialize(const envoy_config_route_v3_RetryPolicy_ResetHeader *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_route_v3_RetryPolicy_ResetHeader_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview envoy_config_route_v3_RetryPolicy_ResetHeader_name(const envoy_config_route_v3_RetryPolicy_ResetHeader *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview); }
+UPB_INLINE int32_t envoy_config_route_v3_RetryPolicy_ResetHeader_format(const envoy_config_route_v3_RetryPolicy_ResetHeader *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
+
+UPB_INLINE void envoy_config_route_v3_RetryPolicy_ResetHeader_set_name(envoy_config_route_v3_RetryPolicy_ResetHeader *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_route_v3_RetryPolicy_ResetHeader_set_format(envoy_config_route_v3_RetryPolicy_ResetHeader *msg, int32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
+}
+
+/* envoy.config.route.v3.RetryPolicy.RateLimitedRetryBackOff */
+
+UPB_INLINE envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff *envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_new(upb_arena *arena) {
+ return (envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff *)_upb_msg_new(&envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_msginit, arena);
+}
+UPB_INLINE envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff *envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff *ret = envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_serialize(const envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_has_reset_headers(const envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
+UPB_INLINE const envoy_config_route_v3_RetryPolicy_ResetHeader* const* envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_reset_headers(const envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff *msg, size_t *len) { return (const envoy_config_route_v3_RetryPolicy_ResetHeader* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len); }
+UPB_INLINE bool envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_has_max_interval(const envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE const struct google_protobuf_Duration* envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_max_interval(const envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct google_protobuf_Duration*); }
+
+UPB_INLINE envoy_config_route_v3_RetryPolicy_ResetHeader** envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_mutable_reset_headers(envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff *msg, size_t *len) {
+ return (envoy_config_route_v3_RetryPolicy_ResetHeader**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len);
+}
+UPB_INLINE envoy_config_route_v3_RetryPolicy_ResetHeader** envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_resize_reset_headers(envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff *msg, size_t len, upb_arena *arena) {
+ return (envoy_config_route_v3_RetryPolicy_ResetHeader**)_upb_array_resize_accessor(msg, UPB_SIZE(4, 8), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_config_route_v3_RetryPolicy_ResetHeader* envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_add_reset_headers(envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff *msg, upb_arena *arena) {
+ struct envoy_config_route_v3_RetryPolicy_ResetHeader* sub = (struct envoy_config_route_v3_RetryPolicy_ResetHeader*)_upb_msg_new(&envoy_config_route_v3_RetryPolicy_ResetHeader_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(4, 8), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE void envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_set_max_interval(envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff *msg, struct google_protobuf_Duration* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct google_protobuf_Duration*) = value;
+}
+UPB_INLINE struct google_protobuf_Duration* envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_mutable_max_interval(envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff *msg, upb_arena *arena) {
+ struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_max_interval(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_set_max_interval(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.route.v3.HedgePolicy */
+
+UPB_INLINE envoy_config_route_v3_HedgePolicy *envoy_config_route_v3_HedgePolicy_new(upb_arena *arena) {
+ return (envoy_config_route_v3_HedgePolicy *)_upb_msg_new(&envoy_config_route_v3_HedgePolicy_msginit, arena);
+}
+UPB_INLINE envoy_config_route_v3_HedgePolicy *envoy_config_route_v3_HedgePolicy_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_route_v3_HedgePolicy *ret = envoy_config_route_v3_HedgePolicy_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_HedgePolicy_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_route_v3_HedgePolicy_serialize(const envoy_config_route_v3_HedgePolicy *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_route_v3_HedgePolicy_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_route_v3_HedgePolicy_has_initial_requests(const envoy_config_route_v3_HedgePolicy *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_route_v3_HedgePolicy_initial_requests(const envoy_config_route_v3_HedgePolicy *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_UInt32Value*); }
+UPB_INLINE bool envoy_config_route_v3_HedgePolicy_has_additional_request_chance(const envoy_config_route_v3_HedgePolicy *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
+UPB_INLINE const struct envoy_type_v3_FractionalPercent* envoy_config_route_v3_HedgePolicy_additional_request_chance(const envoy_config_route_v3_HedgePolicy *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct envoy_type_v3_FractionalPercent*); }
+UPB_INLINE bool envoy_config_route_v3_HedgePolicy_hedge_on_per_try_timeout(const envoy_config_route_v3_HedgePolicy *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); }
+
+UPB_INLINE void envoy_config_route_v3_HedgePolicy_set_initial_requests(envoy_config_route_v3_HedgePolicy *msg, struct google_protobuf_UInt32Value* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_route_v3_HedgePolicy_mutable_initial_requests(envoy_config_route_v3_HedgePolicy *msg, upb_arena *arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_route_v3_HedgePolicy_initial_requests(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_HedgePolicy_set_initial_requests(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_route_v3_HedgePolicy_set_additional_request_chance(envoy_config_route_v3_HedgePolicy *msg, struct envoy_type_v3_FractionalPercent* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct envoy_type_v3_FractionalPercent*) = value;
+}
+UPB_INLINE struct envoy_type_v3_FractionalPercent* envoy_config_route_v3_HedgePolicy_mutable_additional_request_chance(envoy_config_route_v3_HedgePolicy *msg, upb_arena *arena) {
+ struct envoy_type_v3_FractionalPercent* sub = (struct envoy_type_v3_FractionalPercent*)envoy_config_route_v3_HedgePolicy_additional_request_chance(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_type_v3_FractionalPercent*)_upb_msg_new(&envoy_type_v3_FractionalPercent_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_HedgePolicy_set_additional_request_chance(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_route_v3_HedgePolicy_set_hedge_on_per_try_timeout(envoy_config_route_v3_HedgePolicy *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
+}
+
+/* envoy.config.route.v3.RedirectAction */
+
+UPB_INLINE envoy_config_route_v3_RedirectAction *envoy_config_route_v3_RedirectAction_new(upb_arena *arena) {
+ return (envoy_config_route_v3_RedirectAction *)_upb_msg_new(&envoy_config_route_v3_RedirectAction_msginit, arena);
+}
+UPB_INLINE envoy_config_route_v3_RedirectAction *envoy_config_route_v3_RedirectAction_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_route_v3_RedirectAction *ret = envoy_config_route_v3_RedirectAction_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RedirectAction_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_route_v3_RedirectAction_serialize(const envoy_config_route_v3_RedirectAction *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_route_v3_RedirectAction_msginit, arena, len);
+}
+
+typedef enum {
+ envoy_config_route_v3_RedirectAction_scheme_rewrite_specifier_https_redirect = 4,
+ envoy_config_route_v3_RedirectAction_scheme_rewrite_specifier_scheme_redirect = 7,
+ envoy_config_route_v3_RedirectAction_scheme_rewrite_specifier_NOT_SET = 0
+} envoy_config_route_v3_RedirectAction_scheme_rewrite_specifier_oneofcases;
+UPB_INLINE envoy_config_route_v3_RedirectAction_scheme_rewrite_specifier_oneofcases envoy_config_route_v3_RedirectAction_scheme_rewrite_specifier_case(const envoy_config_route_v3_RedirectAction* msg) { return (envoy_config_route_v3_RedirectAction_scheme_rewrite_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(44, 72), int32_t); }
+
+typedef enum {
+ envoy_config_route_v3_RedirectAction_path_rewrite_specifier_path_redirect = 2,
+ envoy_config_route_v3_RedirectAction_path_rewrite_specifier_prefix_rewrite = 5,
+ envoy_config_route_v3_RedirectAction_path_rewrite_specifier_NOT_SET = 0
+} envoy_config_route_v3_RedirectAction_path_rewrite_specifier_oneofcases;
+UPB_INLINE envoy_config_route_v3_RedirectAction_path_rewrite_specifier_oneofcases envoy_config_route_v3_RedirectAction_path_rewrite_specifier_case(const envoy_config_route_v3_RedirectAction* msg) { return (envoy_config_route_v3_RedirectAction_path_rewrite_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(32, 48), int32_t); }
+
+UPB_INLINE upb_strview envoy_config_route_v3_RedirectAction_host_redirect(const envoy_config_route_v3_RedirectAction *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), upb_strview); }
+UPB_INLINE bool envoy_config_route_v3_RedirectAction_has_path_redirect(const envoy_config_route_v3_RedirectAction *msg) { return _upb_getoneofcase(msg, UPB_SIZE(32, 48)) == 2; }
+UPB_INLINE upb_strview envoy_config_route_v3_RedirectAction_path_redirect(const envoy_config_route_v3_RedirectAction *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(24, 32), UPB_SIZE(32, 48), 2, upb_strview_make("", strlen(""))); }
+UPB_INLINE int32_t envoy_config_route_v3_RedirectAction_response_code(const envoy_config_route_v3_RedirectAction *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
+UPB_INLINE bool envoy_config_route_v3_RedirectAction_has_https_redirect(const envoy_config_route_v3_RedirectAction *msg) { return _upb_getoneofcase(msg, UPB_SIZE(44, 72)) == 4; }
+UPB_INLINE bool envoy_config_route_v3_RedirectAction_https_redirect(const envoy_config_route_v3_RedirectAction *msg) { return UPB_READ_ONEOF(msg, bool, UPB_SIZE(36, 56), UPB_SIZE(44, 72), 4, false); }
+UPB_INLINE bool envoy_config_route_v3_RedirectAction_has_prefix_rewrite(const envoy_config_route_v3_RedirectAction *msg) { return _upb_getoneofcase(msg, UPB_SIZE(32, 48)) == 5; }
+UPB_INLINE upb_strview envoy_config_route_v3_RedirectAction_prefix_rewrite(const envoy_config_route_v3_RedirectAction *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(24, 32), UPB_SIZE(32, 48), 5, upb_strview_make("", strlen(""))); }
+UPB_INLINE bool envoy_config_route_v3_RedirectAction_strip_query(const envoy_config_route_v3_RedirectAction *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 12), bool); }
+UPB_INLINE bool envoy_config_route_v3_RedirectAction_has_scheme_redirect(const envoy_config_route_v3_RedirectAction *msg) { return _upb_getoneofcase(msg, UPB_SIZE(44, 72)) == 7; }
+UPB_INLINE upb_strview envoy_config_route_v3_RedirectAction_scheme_redirect(const envoy_config_route_v3_RedirectAction *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(36, 56), UPB_SIZE(44, 72), 7, upb_strview_make("", strlen(""))); }
+UPB_INLINE uint32_t envoy_config_route_v3_RedirectAction_port_redirect(const envoy_config_route_v3_RedirectAction *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint32_t); }
+
+UPB_INLINE void envoy_config_route_v3_RedirectAction_set_host_redirect(envoy_config_route_v3_RedirectAction *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 16), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_route_v3_RedirectAction_set_path_redirect(envoy_config_route_v3_RedirectAction *msg, upb_strview value) {
+ UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(24, 32), value, UPB_SIZE(32, 48), 2);
+}
+UPB_INLINE void envoy_config_route_v3_RedirectAction_set_response_code(envoy_config_route_v3_RedirectAction *msg, int32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
+}
+UPB_INLINE void envoy_config_route_v3_RedirectAction_set_https_redirect(envoy_config_route_v3_RedirectAction *msg, bool value) {
+ UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(36, 56), value, UPB_SIZE(44, 72), 4);
+}
+UPB_INLINE void envoy_config_route_v3_RedirectAction_set_prefix_rewrite(envoy_config_route_v3_RedirectAction *msg, upb_strview value) {
+ UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(24, 32), value, UPB_SIZE(32, 48), 5);
+}
+UPB_INLINE void envoy_config_route_v3_RedirectAction_set_strip_query(envoy_config_route_v3_RedirectAction *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 12), bool) = value;
+}
+UPB_INLINE void envoy_config_route_v3_RedirectAction_set_scheme_redirect(envoy_config_route_v3_RedirectAction *msg, upb_strview value) {
+ UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(36, 56), value, UPB_SIZE(44, 72), 7);
+}
+UPB_INLINE void envoy_config_route_v3_RedirectAction_set_port_redirect(envoy_config_route_v3_RedirectAction *msg, uint32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint32_t) = value;
+}
+
+/* envoy.config.route.v3.DirectResponseAction */
+
+UPB_INLINE envoy_config_route_v3_DirectResponseAction *envoy_config_route_v3_DirectResponseAction_new(upb_arena *arena) {
+ return (envoy_config_route_v3_DirectResponseAction *)_upb_msg_new(&envoy_config_route_v3_DirectResponseAction_msginit, arena);
+}
+UPB_INLINE envoy_config_route_v3_DirectResponseAction *envoy_config_route_v3_DirectResponseAction_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_route_v3_DirectResponseAction *ret = envoy_config_route_v3_DirectResponseAction_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_DirectResponseAction_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_route_v3_DirectResponseAction_serialize(const envoy_config_route_v3_DirectResponseAction *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_route_v3_DirectResponseAction_msginit, arena, len);
+}
+
+UPB_INLINE uint32_t envoy_config_route_v3_DirectResponseAction_status(const envoy_config_route_v3_DirectResponseAction *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t); }
+UPB_INLINE bool envoy_config_route_v3_DirectResponseAction_has_body(const envoy_config_route_v3_DirectResponseAction *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
+UPB_INLINE const struct envoy_config_core_v3_DataSource* envoy_config_route_v3_DirectResponseAction_body(const envoy_config_route_v3_DirectResponseAction *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_config_core_v3_DataSource*); }
+
+UPB_INLINE void envoy_config_route_v3_DirectResponseAction_set_status(envoy_config_route_v3_DirectResponseAction *msg, uint32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t) = value;
+}
+UPB_INLINE void envoy_config_route_v3_DirectResponseAction_set_body(envoy_config_route_v3_DirectResponseAction *msg, struct envoy_config_core_v3_DataSource* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_config_core_v3_DataSource*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_DataSource* envoy_config_route_v3_DirectResponseAction_mutable_body(envoy_config_route_v3_DirectResponseAction *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_DataSource* sub = (struct envoy_config_core_v3_DataSource*)envoy_config_route_v3_DirectResponseAction_body(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_DataSource*)_upb_msg_new(&envoy_config_core_v3_DataSource_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_DirectResponseAction_set_body(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.route.v3.Decorator */
+
+UPB_INLINE envoy_config_route_v3_Decorator *envoy_config_route_v3_Decorator_new(upb_arena *arena) {
+ return (envoy_config_route_v3_Decorator *)_upb_msg_new(&envoy_config_route_v3_Decorator_msginit, arena);
+}
+UPB_INLINE envoy_config_route_v3_Decorator *envoy_config_route_v3_Decorator_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_route_v3_Decorator *ret = envoy_config_route_v3_Decorator_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_Decorator_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_route_v3_Decorator_serialize(const envoy_config_route_v3_Decorator *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_route_v3_Decorator_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview envoy_config_route_v3_Decorator_operation(const envoy_config_route_v3_Decorator *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE bool envoy_config_route_v3_Decorator_has_propagate(const envoy_config_route_v3_Decorator *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
+UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_route_v3_Decorator_propagate(const envoy_config_route_v3_Decorator *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_BoolValue*); }
+
+UPB_INLINE void envoy_config_route_v3_Decorator_set_operation(envoy_config_route_v3_Decorator *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_route_v3_Decorator_set_propagate(envoy_config_route_v3_Decorator *msg, struct google_protobuf_BoolValue* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_BoolValue*) = value;
+}
+UPB_INLINE struct google_protobuf_BoolValue* envoy_config_route_v3_Decorator_mutable_propagate(envoy_config_route_v3_Decorator *msg, upb_arena *arena) {
+ struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_route_v3_Decorator_propagate(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_BoolValue*)_upb_msg_new(&google_protobuf_BoolValue_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_Decorator_set_propagate(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.route.v3.Tracing */
+
+UPB_INLINE envoy_config_route_v3_Tracing *envoy_config_route_v3_Tracing_new(upb_arena *arena) {
+ return (envoy_config_route_v3_Tracing *)_upb_msg_new(&envoy_config_route_v3_Tracing_msginit, arena);
+}
+UPB_INLINE envoy_config_route_v3_Tracing *envoy_config_route_v3_Tracing_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_route_v3_Tracing *ret = envoy_config_route_v3_Tracing_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_Tracing_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_route_v3_Tracing_serialize(const envoy_config_route_v3_Tracing *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_route_v3_Tracing_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_route_v3_Tracing_has_client_sampling(const envoy_config_route_v3_Tracing *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE const struct envoy_type_v3_FractionalPercent* envoy_config_route_v3_Tracing_client_sampling(const envoy_config_route_v3_Tracing *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct envoy_type_v3_FractionalPercent*); }
+UPB_INLINE bool envoy_config_route_v3_Tracing_has_random_sampling(const envoy_config_route_v3_Tracing *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
+UPB_INLINE const struct envoy_type_v3_FractionalPercent* envoy_config_route_v3_Tracing_random_sampling(const envoy_config_route_v3_Tracing *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_type_v3_FractionalPercent*); }
+UPB_INLINE bool envoy_config_route_v3_Tracing_has_overall_sampling(const envoy_config_route_v3_Tracing *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
+UPB_INLINE const struct envoy_type_v3_FractionalPercent* envoy_config_route_v3_Tracing_overall_sampling(const envoy_config_route_v3_Tracing *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct envoy_type_v3_FractionalPercent*); }
+UPB_INLINE bool envoy_config_route_v3_Tracing_has_custom_tags(const envoy_config_route_v3_Tracing *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
+UPB_INLINE const struct envoy_type_tracing_v3_CustomTag* const* envoy_config_route_v3_Tracing_custom_tags(const envoy_config_route_v3_Tracing *msg, size_t *len) { return (const struct envoy_type_tracing_v3_CustomTag* const*)_upb_array_accessor(msg, UPB_SIZE(12, 24), len); }
+
+UPB_INLINE void envoy_config_route_v3_Tracing_set_client_sampling(envoy_config_route_v3_Tracing *msg, struct envoy_type_v3_FractionalPercent* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct envoy_type_v3_FractionalPercent*) = value;
+}
+UPB_INLINE struct envoy_type_v3_FractionalPercent* envoy_config_route_v3_Tracing_mutable_client_sampling(envoy_config_route_v3_Tracing *msg, upb_arena *arena) {
+ struct envoy_type_v3_FractionalPercent* sub = (struct envoy_type_v3_FractionalPercent*)envoy_config_route_v3_Tracing_client_sampling(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_type_v3_FractionalPercent*)_upb_msg_new(&envoy_type_v3_FractionalPercent_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_Tracing_set_client_sampling(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_route_v3_Tracing_set_random_sampling(envoy_config_route_v3_Tracing *msg, struct envoy_type_v3_FractionalPercent* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_type_v3_FractionalPercent*) = value;
+}
+UPB_INLINE struct envoy_type_v3_FractionalPercent* envoy_config_route_v3_Tracing_mutable_random_sampling(envoy_config_route_v3_Tracing *msg, upb_arena *arena) {
+ struct envoy_type_v3_FractionalPercent* sub = (struct envoy_type_v3_FractionalPercent*)envoy_config_route_v3_Tracing_random_sampling(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_type_v3_FractionalPercent*)_upb_msg_new(&envoy_type_v3_FractionalPercent_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_Tracing_set_random_sampling(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_route_v3_Tracing_set_overall_sampling(envoy_config_route_v3_Tracing *msg, struct envoy_type_v3_FractionalPercent* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct envoy_type_v3_FractionalPercent*) = value;
+}
+UPB_INLINE struct envoy_type_v3_FractionalPercent* envoy_config_route_v3_Tracing_mutable_overall_sampling(envoy_config_route_v3_Tracing *msg, upb_arena *arena) {
+ struct envoy_type_v3_FractionalPercent* sub = (struct envoy_type_v3_FractionalPercent*)envoy_config_route_v3_Tracing_overall_sampling(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_type_v3_FractionalPercent*)_upb_msg_new(&envoy_type_v3_FractionalPercent_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_Tracing_set_overall_sampling(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE struct envoy_type_tracing_v3_CustomTag** envoy_config_route_v3_Tracing_mutable_custom_tags(envoy_config_route_v3_Tracing *msg, size_t *len) {
+ return (struct envoy_type_tracing_v3_CustomTag**)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 24), len);
+}
+UPB_INLINE struct envoy_type_tracing_v3_CustomTag** envoy_config_route_v3_Tracing_resize_custom_tags(envoy_config_route_v3_Tracing *msg, size_t len, upb_arena *arena) {
+ return (struct envoy_type_tracing_v3_CustomTag**)_upb_array_resize_accessor(msg, UPB_SIZE(12, 24), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_type_tracing_v3_CustomTag* envoy_config_route_v3_Tracing_add_custom_tags(envoy_config_route_v3_Tracing *msg, upb_arena *arena) {
+ struct envoy_type_tracing_v3_CustomTag* sub = (struct envoy_type_tracing_v3_CustomTag*)_upb_msg_new(&envoy_type_tracing_v3_CustomTag_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(12, 24), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+
+/* envoy.config.route.v3.VirtualCluster */
+
+UPB_INLINE envoy_config_route_v3_VirtualCluster *envoy_config_route_v3_VirtualCluster_new(upb_arena *arena) {
+ return (envoy_config_route_v3_VirtualCluster *)_upb_msg_new(&envoy_config_route_v3_VirtualCluster_msginit, arena);
+}
+UPB_INLINE envoy_config_route_v3_VirtualCluster *envoy_config_route_v3_VirtualCluster_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_route_v3_VirtualCluster *ret = envoy_config_route_v3_VirtualCluster_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_VirtualCluster_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_route_v3_VirtualCluster_serialize(const envoy_config_route_v3_VirtualCluster *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_route_v3_VirtualCluster_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview envoy_config_route_v3_VirtualCluster_name(const envoy_config_route_v3_VirtualCluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE bool envoy_config_route_v3_VirtualCluster_has_headers(const envoy_config_route_v3_VirtualCluster *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
+UPB_INLINE const envoy_config_route_v3_HeaderMatcher* const* envoy_config_route_v3_VirtualCluster_headers(const envoy_config_route_v3_VirtualCluster *msg, size_t *len) { return (const envoy_config_route_v3_HeaderMatcher* const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len); }
+
+UPB_INLINE void envoy_config_route_v3_VirtualCluster_set_name(envoy_config_route_v3_VirtualCluster *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+UPB_INLINE envoy_config_route_v3_HeaderMatcher** envoy_config_route_v3_VirtualCluster_mutable_headers(envoy_config_route_v3_VirtualCluster *msg, size_t *len) {
+ return (envoy_config_route_v3_HeaderMatcher**)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len);
+}
+UPB_INLINE envoy_config_route_v3_HeaderMatcher** envoy_config_route_v3_VirtualCluster_resize_headers(envoy_config_route_v3_VirtualCluster *msg, size_t len, upb_arena *arena) {
+ return (envoy_config_route_v3_HeaderMatcher**)_upb_array_resize_accessor(msg, UPB_SIZE(8, 16), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_config_route_v3_HeaderMatcher* envoy_config_route_v3_VirtualCluster_add_headers(envoy_config_route_v3_VirtualCluster *msg, upb_arena *arena) {
+ struct envoy_config_route_v3_HeaderMatcher* sub = (struct envoy_config_route_v3_HeaderMatcher*)_upb_msg_new(&envoy_config_route_v3_HeaderMatcher_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(8, 16), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+
+/* envoy.config.route.v3.RateLimit */
+
+UPB_INLINE envoy_config_route_v3_RateLimit *envoy_config_route_v3_RateLimit_new(upb_arena *arena) {
+ return (envoy_config_route_v3_RateLimit *)_upb_msg_new(&envoy_config_route_v3_RateLimit_msginit, arena);
+}
+UPB_INLINE envoy_config_route_v3_RateLimit *envoy_config_route_v3_RateLimit_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_route_v3_RateLimit *ret = envoy_config_route_v3_RateLimit_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RateLimit_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_route_v3_RateLimit_serialize(const envoy_config_route_v3_RateLimit *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_route_v3_RateLimit_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_route_v3_RateLimit_has_stage(const envoy_config_route_v3_RateLimit *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_route_v3_RateLimit_stage(const envoy_config_route_v3_RateLimit *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_UInt32Value*); }
+UPB_INLINE upb_strview envoy_config_route_v3_RateLimit_disable_key(const envoy_config_route_v3_RateLimit *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE bool envoy_config_route_v3_RateLimit_has_actions(const envoy_config_route_v3_RateLimit *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); }
+UPB_INLINE const envoy_config_route_v3_RateLimit_Action* const* envoy_config_route_v3_RateLimit_actions(const envoy_config_route_v3_RateLimit *msg, size_t *len) { return (const envoy_config_route_v3_RateLimit_Action* const*)_upb_array_accessor(msg, UPB_SIZE(16, 32), len); }
+UPB_INLINE bool envoy_config_route_v3_RateLimit_has_limit(const envoy_config_route_v3_RateLimit *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
+UPB_INLINE const envoy_config_route_v3_RateLimit_Override* envoy_config_route_v3_RateLimit_limit(const envoy_config_route_v3_RateLimit *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const envoy_config_route_v3_RateLimit_Override*); }
+
+UPB_INLINE void envoy_config_route_v3_RateLimit_set_stage(envoy_config_route_v3_RateLimit *msg, struct google_protobuf_UInt32Value* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_route_v3_RateLimit_mutable_stage(envoy_config_route_v3_RateLimit *msg, upb_arena *arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_route_v3_RateLimit_stage(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_RateLimit_set_stage(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_route_v3_RateLimit_set_disable_key(envoy_config_route_v3_RateLimit *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+UPB_INLINE envoy_config_route_v3_RateLimit_Action** envoy_config_route_v3_RateLimit_mutable_actions(envoy_config_route_v3_RateLimit *msg, size_t *len) {
+ return (envoy_config_route_v3_RateLimit_Action**)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 32), len);
+}
+UPB_INLINE envoy_config_route_v3_RateLimit_Action** envoy_config_route_v3_RateLimit_resize_actions(envoy_config_route_v3_RateLimit *msg, size_t len, upb_arena *arena) {
+ return (envoy_config_route_v3_RateLimit_Action**)_upb_array_resize_accessor(msg, UPB_SIZE(16, 32), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_config_route_v3_RateLimit_Action* envoy_config_route_v3_RateLimit_add_actions(envoy_config_route_v3_RateLimit *msg, upb_arena *arena) {
+ struct envoy_config_route_v3_RateLimit_Action* sub = (struct envoy_config_route_v3_RateLimit_Action*)_upb_msg_new(&envoy_config_route_v3_RateLimit_Action_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(16, 32), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE void envoy_config_route_v3_RateLimit_set_limit(envoy_config_route_v3_RateLimit *msg, envoy_config_route_v3_RateLimit_Override* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), envoy_config_route_v3_RateLimit_Override*) = value;
+}
+UPB_INLINE struct envoy_config_route_v3_RateLimit_Override* envoy_config_route_v3_RateLimit_mutable_limit(envoy_config_route_v3_RateLimit *msg, upb_arena *arena) {
+ struct envoy_config_route_v3_RateLimit_Override* sub = (struct envoy_config_route_v3_RateLimit_Override*)envoy_config_route_v3_RateLimit_limit(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_route_v3_RateLimit_Override*)_upb_msg_new(&envoy_config_route_v3_RateLimit_Override_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_RateLimit_set_limit(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.route.v3.RateLimit.Action */
+
+UPB_INLINE envoy_config_route_v3_RateLimit_Action *envoy_config_route_v3_RateLimit_Action_new(upb_arena *arena) {
+ return (envoy_config_route_v3_RateLimit_Action *)_upb_msg_new(&envoy_config_route_v3_RateLimit_Action_msginit, arena);
+}
+UPB_INLINE envoy_config_route_v3_RateLimit_Action *envoy_config_route_v3_RateLimit_Action_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_route_v3_RateLimit_Action *ret = envoy_config_route_v3_RateLimit_Action_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_route_v3_RateLimit_Action_serialize(const envoy_config_route_v3_RateLimit_Action *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_route_v3_RateLimit_Action_msginit, arena, len);
+}
+
+typedef enum {
+ envoy_config_route_v3_RateLimit_Action_action_specifier_source_cluster = 1,
+ envoy_config_route_v3_RateLimit_Action_action_specifier_destination_cluster = 2,
+ envoy_config_route_v3_RateLimit_Action_action_specifier_request_headers = 3,
+ envoy_config_route_v3_RateLimit_Action_action_specifier_remote_address = 4,
+ envoy_config_route_v3_RateLimit_Action_action_specifier_generic_key = 5,
+ envoy_config_route_v3_RateLimit_Action_action_specifier_header_value_match = 6,
+ envoy_config_route_v3_RateLimit_Action_action_specifier_dynamic_metadata = 7,
+ envoy_config_route_v3_RateLimit_Action_action_specifier_NOT_SET = 0
+} envoy_config_route_v3_RateLimit_Action_action_specifier_oneofcases;
+UPB_INLINE envoy_config_route_v3_RateLimit_Action_action_specifier_oneofcases envoy_config_route_v3_RateLimit_Action_action_specifier_case(const envoy_config_route_v3_RateLimit_Action* msg) { return (envoy_config_route_v3_RateLimit_Action_action_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 8), int32_t); }
+
+UPB_INLINE bool envoy_config_route_v3_RateLimit_Action_has_source_cluster(const envoy_config_route_v3_RateLimit_Action *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 1; }
+UPB_INLINE const envoy_config_route_v3_RateLimit_Action_SourceCluster* envoy_config_route_v3_RateLimit_Action_source_cluster(const envoy_config_route_v3_RateLimit_Action *msg) { return UPB_READ_ONEOF(msg, const envoy_config_route_v3_RateLimit_Action_SourceCluster*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 1, NULL); }
+UPB_INLINE bool envoy_config_route_v3_RateLimit_Action_has_destination_cluster(const envoy_config_route_v3_RateLimit_Action *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 2; }
+UPB_INLINE const envoy_config_route_v3_RateLimit_Action_DestinationCluster* envoy_config_route_v3_RateLimit_Action_destination_cluster(const envoy_config_route_v3_RateLimit_Action *msg) { return UPB_READ_ONEOF(msg, const envoy_config_route_v3_RateLimit_Action_DestinationCluster*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 2, NULL); }
+UPB_INLINE bool envoy_config_route_v3_RateLimit_Action_has_request_headers(const envoy_config_route_v3_RateLimit_Action *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 3; }
+UPB_INLINE const envoy_config_route_v3_RateLimit_Action_RequestHeaders* envoy_config_route_v3_RateLimit_Action_request_headers(const envoy_config_route_v3_RateLimit_Action *msg) { return UPB_READ_ONEOF(msg, const envoy_config_route_v3_RateLimit_Action_RequestHeaders*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 3, NULL); }
+UPB_INLINE bool envoy_config_route_v3_RateLimit_Action_has_remote_address(const envoy_config_route_v3_RateLimit_Action *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 4; }
+UPB_INLINE const envoy_config_route_v3_RateLimit_Action_RemoteAddress* envoy_config_route_v3_RateLimit_Action_remote_address(const envoy_config_route_v3_RateLimit_Action *msg) { return UPB_READ_ONEOF(msg, const envoy_config_route_v3_RateLimit_Action_RemoteAddress*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 4, NULL); }
+UPB_INLINE bool envoy_config_route_v3_RateLimit_Action_has_generic_key(const envoy_config_route_v3_RateLimit_Action *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 5; }
+UPB_INLINE const envoy_config_route_v3_RateLimit_Action_GenericKey* envoy_config_route_v3_RateLimit_Action_generic_key(const envoy_config_route_v3_RateLimit_Action *msg) { return UPB_READ_ONEOF(msg, const envoy_config_route_v3_RateLimit_Action_GenericKey*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 5, NULL); }
+UPB_INLINE bool envoy_config_route_v3_RateLimit_Action_has_header_value_match(const envoy_config_route_v3_RateLimit_Action *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 6; }
+UPB_INLINE const envoy_config_route_v3_RateLimit_Action_HeaderValueMatch* envoy_config_route_v3_RateLimit_Action_header_value_match(const envoy_config_route_v3_RateLimit_Action *msg) { return UPB_READ_ONEOF(msg, const envoy_config_route_v3_RateLimit_Action_HeaderValueMatch*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 6, NULL); }
+UPB_INLINE bool envoy_config_route_v3_RateLimit_Action_has_dynamic_metadata(const envoy_config_route_v3_RateLimit_Action *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 7; }
+UPB_INLINE const envoy_config_route_v3_RateLimit_Action_DynamicMetaData* envoy_config_route_v3_RateLimit_Action_dynamic_metadata(const envoy_config_route_v3_RateLimit_Action *msg) { return UPB_READ_ONEOF(msg, const envoy_config_route_v3_RateLimit_Action_DynamicMetaData*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 7, NULL); }
+
+UPB_INLINE void envoy_config_route_v3_RateLimit_Action_set_source_cluster(envoy_config_route_v3_RateLimit_Action *msg, envoy_config_route_v3_RateLimit_Action_SourceCluster* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RateLimit_Action_SourceCluster*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 1);
+}
+UPB_INLINE struct envoy_config_route_v3_RateLimit_Action_SourceCluster* envoy_config_route_v3_RateLimit_Action_mutable_source_cluster(envoy_config_route_v3_RateLimit_Action *msg, upb_arena *arena) {
+ struct envoy_config_route_v3_RateLimit_Action_SourceCluster* sub = (struct envoy_config_route_v3_RateLimit_Action_SourceCluster*)envoy_config_route_v3_RateLimit_Action_source_cluster(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_route_v3_RateLimit_Action_SourceCluster*)_upb_msg_new(&envoy_config_route_v3_RateLimit_Action_SourceCluster_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_RateLimit_Action_set_source_cluster(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_route_v3_RateLimit_Action_set_destination_cluster(envoy_config_route_v3_RateLimit_Action *msg, envoy_config_route_v3_RateLimit_Action_DestinationCluster* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RateLimit_Action_DestinationCluster*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 2);
+}
+UPB_INLINE struct envoy_config_route_v3_RateLimit_Action_DestinationCluster* envoy_config_route_v3_RateLimit_Action_mutable_destination_cluster(envoy_config_route_v3_RateLimit_Action *msg, upb_arena *arena) {
+ struct envoy_config_route_v3_RateLimit_Action_DestinationCluster* sub = (struct envoy_config_route_v3_RateLimit_Action_DestinationCluster*)envoy_config_route_v3_RateLimit_Action_destination_cluster(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_route_v3_RateLimit_Action_DestinationCluster*)_upb_msg_new(&envoy_config_route_v3_RateLimit_Action_DestinationCluster_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_RateLimit_Action_set_destination_cluster(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_route_v3_RateLimit_Action_set_request_headers(envoy_config_route_v3_RateLimit_Action *msg, envoy_config_route_v3_RateLimit_Action_RequestHeaders* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RateLimit_Action_RequestHeaders*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 3);
+}
+UPB_INLINE struct envoy_config_route_v3_RateLimit_Action_RequestHeaders* envoy_config_route_v3_RateLimit_Action_mutable_request_headers(envoy_config_route_v3_RateLimit_Action *msg, upb_arena *arena) {
+ struct envoy_config_route_v3_RateLimit_Action_RequestHeaders* sub = (struct envoy_config_route_v3_RateLimit_Action_RequestHeaders*)envoy_config_route_v3_RateLimit_Action_request_headers(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_route_v3_RateLimit_Action_RequestHeaders*)_upb_msg_new(&envoy_config_route_v3_RateLimit_Action_RequestHeaders_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_RateLimit_Action_set_request_headers(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_route_v3_RateLimit_Action_set_remote_address(envoy_config_route_v3_RateLimit_Action *msg, envoy_config_route_v3_RateLimit_Action_RemoteAddress* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RateLimit_Action_RemoteAddress*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 4);
+}
+UPB_INLINE struct envoy_config_route_v3_RateLimit_Action_RemoteAddress* envoy_config_route_v3_RateLimit_Action_mutable_remote_address(envoy_config_route_v3_RateLimit_Action *msg, upb_arena *arena) {
+ struct envoy_config_route_v3_RateLimit_Action_RemoteAddress* sub = (struct envoy_config_route_v3_RateLimit_Action_RemoteAddress*)envoy_config_route_v3_RateLimit_Action_remote_address(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_route_v3_RateLimit_Action_RemoteAddress*)_upb_msg_new(&envoy_config_route_v3_RateLimit_Action_RemoteAddress_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_RateLimit_Action_set_remote_address(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_route_v3_RateLimit_Action_set_generic_key(envoy_config_route_v3_RateLimit_Action *msg, envoy_config_route_v3_RateLimit_Action_GenericKey* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RateLimit_Action_GenericKey*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 5);
+}
+UPB_INLINE struct envoy_config_route_v3_RateLimit_Action_GenericKey* envoy_config_route_v3_RateLimit_Action_mutable_generic_key(envoy_config_route_v3_RateLimit_Action *msg, upb_arena *arena) {
+ struct envoy_config_route_v3_RateLimit_Action_GenericKey* sub = (struct envoy_config_route_v3_RateLimit_Action_GenericKey*)envoy_config_route_v3_RateLimit_Action_generic_key(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_route_v3_RateLimit_Action_GenericKey*)_upb_msg_new(&envoy_config_route_v3_RateLimit_Action_GenericKey_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_RateLimit_Action_set_generic_key(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_route_v3_RateLimit_Action_set_header_value_match(envoy_config_route_v3_RateLimit_Action *msg, envoy_config_route_v3_RateLimit_Action_HeaderValueMatch* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RateLimit_Action_HeaderValueMatch*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 6);
+}
+UPB_INLINE struct envoy_config_route_v3_RateLimit_Action_HeaderValueMatch* envoy_config_route_v3_RateLimit_Action_mutable_header_value_match(envoy_config_route_v3_RateLimit_Action *msg, upb_arena *arena) {
+ struct envoy_config_route_v3_RateLimit_Action_HeaderValueMatch* sub = (struct envoy_config_route_v3_RateLimit_Action_HeaderValueMatch*)envoy_config_route_v3_RateLimit_Action_header_value_match(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_route_v3_RateLimit_Action_HeaderValueMatch*)_upb_msg_new(&envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_RateLimit_Action_set_header_value_match(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_route_v3_RateLimit_Action_set_dynamic_metadata(envoy_config_route_v3_RateLimit_Action *msg, envoy_config_route_v3_RateLimit_Action_DynamicMetaData* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RateLimit_Action_DynamicMetaData*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 7);
+}
+UPB_INLINE struct envoy_config_route_v3_RateLimit_Action_DynamicMetaData* envoy_config_route_v3_RateLimit_Action_mutable_dynamic_metadata(envoy_config_route_v3_RateLimit_Action *msg, upb_arena *arena) {
+ struct envoy_config_route_v3_RateLimit_Action_DynamicMetaData* sub = (struct envoy_config_route_v3_RateLimit_Action_DynamicMetaData*)envoy_config_route_v3_RateLimit_Action_dynamic_metadata(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_route_v3_RateLimit_Action_DynamicMetaData*)_upb_msg_new(&envoy_config_route_v3_RateLimit_Action_DynamicMetaData_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_RateLimit_Action_set_dynamic_metadata(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.route.v3.RateLimit.Action.SourceCluster */
+
+UPB_INLINE envoy_config_route_v3_RateLimit_Action_SourceCluster *envoy_config_route_v3_RateLimit_Action_SourceCluster_new(upb_arena *arena) {
+ return (envoy_config_route_v3_RateLimit_Action_SourceCluster *)_upb_msg_new(&envoy_config_route_v3_RateLimit_Action_SourceCluster_msginit, arena);
+}
+UPB_INLINE envoy_config_route_v3_RateLimit_Action_SourceCluster *envoy_config_route_v3_RateLimit_Action_SourceCluster_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_route_v3_RateLimit_Action_SourceCluster *ret = envoy_config_route_v3_RateLimit_Action_SourceCluster_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_SourceCluster_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_route_v3_RateLimit_Action_SourceCluster_serialize(const envoy_config_route_v3_RateLimit_Action_SourceCluster *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_route_v3_RateLimit_Action_SourceCluster_msginit, arena, len);
+}
+
+
+
+/* envoy.config.route.v3.RateLimit.Action.DestinationCluster */
+
+UPB_INLINE envoy_config_route_v3_RateLimit_Action_DestinationCluster *envoy_config_route_v3_RateLimit_Action_DestinationCluster_new(upb_arena *arena) {
+ return (envoy_config_route_v3_RateLimit_Action_DestinationCluster *)_upb_msg_new(&envoy_config_route_v3_RateLimit_Action_DestinationCluster_msginit, arena);
+}
+UPB_INLINE envoy_config_route_v3_RateLimit_Action_DestinationCluster *envoy_config_route_v3_RateLimit_Action_DestinationCluster_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_route_v3_RateLimit_Action_DestinationCluster *ret = envoy_config_route_v3_RateLimit_Action_DestinationCluster_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_DestinationCluster_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_route_v3_RateLimit_Action_DestinationCluster_serialize(const envoy_config_route_v3_RateLimit_Action_DestinationCluster *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_route_v3_RateLimit_Action_DestinationCluster_msginit, arena, len);
+}
+
+
+
+/* envoy.config.route.v3.RateLimit.Action.RequestHeaders */
+
+UPB_INLINE envoy_config_route_v3_RateLimit_Action_RequestHeaders *envoy_config_route_v3_RateLimit_Action_RequestHeaders_new(upb_arena *arena) {
+ return (envoy_config_route_v3_RateLimit_Action_RequestHeaders *)_upb_msg_new(&envoy_config_route_v3_RateLimit_Action_RequestHeaders_msginit, arena);
+}
+UPB_INLINE envoy_config_route_v3_RateLimit_Action_RequestHeaders *envoy_config_route_v3_RateLimit_Action_RequestHeaders_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_route_v3_RateLimit_Action_RequestHeaders *ret = envoy_config_route_v3_RateLimit_Action_RequestHeaders_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_RequestHeaders_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_route_v3_RateLimit_Action_RequestHeaders_serialize(const envoy_config_route_v3_RateLimit_Action_RequestHeaders *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_route_v3_RateLimit_Action_RequestHeaders_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview envoy_config_route_v3_RateLimit_Action_RequestHeaders_header_name(const envoy_config_route_v3_RateLimit_Action_RequestHeaders *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
+UPB_INLINE upb_strview envoy_config_route_v3_RateLimit_Action_RequestHeaders_descriptor_key(const envoy_config_route_v3_RateLimit_Action_RequestHeaders *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview); }
+UPB_INLINE bool envoy_config_route_v3_RateLimit_Action_RequestHeaders_skip_if_absent(const envoy_config_route_v3_RateLimit_Action_RequestHeaders *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); }
+
+UPB_INLINE void envoy_config_route_v3_RateLimit_Action_RequestHeaders_set_header_name(envoy_config_route_v3_RateLimit_Action_RequestHeaders *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_route_v3_RateLimit_Action_RequestHeaders_set_descriptor_key(envoy_config_route_v3_RateLimit_Action_RequestHeaders *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_route_v3_RateLimit_Action_RequestHeaders_set_skip_if_absent(envoy_config_route_v3_RateLimit_Action_RequestHeaders *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
+}
+
+/* envoy.config.route.v3.RateLimit.Action.RemoteAddress */
+
+UPB_INLINE envoy_config_route_v3_RateLimit_Action_RemoteAddress *envoy_config_route_v3_RateLimit_Action_RemoteAddress_new(upb_arena *arena) {
+ return (envoy_config_route_v3_RateLimit_Action_RemoteAddress *)_upb_msg_new(&envoy_config_route_v3_RateLimit_Action_RemoteAddress_msginit, arena);
+}
+UPB_INLINE envoy_config_route_v3_RateLimit_Action_RemoteAddress *envoy_config_route_v3_RateLimit_Action_RemoteAddress_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_route_v3_RateLimit_Action_RemoteAddress *ret = envoy_config_route_v3_RateLimit_Action_RemoteAddress_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_RemoteAddress_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_route_v3_RateLimit_Action_RemoteAddress_serialize(const envoy_config_route_v3_RateLimit_Action_RemoteAddress *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_route_v3_RateLimit_Action_RemoteAddress_msginit, arena, len);
+}
+
+
+
+/* envoy.config.route.v3.RateLimit.Action.GenericKey */
+
+UPB_INLINE envoy_config_route_v3_RateLimit_Action_GenericKey *envoy_config_route_v3_RateLimit_Action_GenericKey_new(upb_arena *arena) {
+ return (envoy_config_route_v3_RateLimit_Action_GenericKey *)_upb_msg_new(&envoy_config_route_v3_RateLimit_Action_GenericKey_msginit, arena);
+}
+UPB_INLINE envoy_config_route_v3_RateLimit_Action_GenericKey *envoy_config_route_v3_RateLimit_Action_GenericKey_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_route_v3_RateLimit_Action_GenericKey *ret = envoy_config_route_v3_RateLimit_Action_GenericKey_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_GenericKey_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_route_v3_RateLimit_Action_GenericKey_serialize(const envoy_config_route_v3_RateLimit_Action_GenericKey *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_route_v3_RateLimit_Action_GenericKey_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview envoy_config_route_v3_RateLimit_Action_GenericKey_descriptor_value(const envoy_config_route_v3_RateLimit_Action_GenericKey *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE upb_strview envoy_config_route_v3_RateLimit_Action_GenericKey_descriptor_key(const envoy_config_route_v3_RateLimit_Action_GenericKey *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview); }
+
+UPB_INLINE void envoy_config_route_v3_RateLimit_Action_GenericKey_set_descriptor_value(envoy_config_route_v3_RateLimit_Action_GenericKey *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_route_v3_RateLimit_Action_GenericKey_set_descriptor_key(envoy_config_route_v3_RateLimit_Action_GenericKey *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview) = value;
+}
+
+/* envoy.config.route.v3.RateLimit.Action.HeaderValueMatch */
+
+UPB_INLINE envoy_config_route_v3_RateLimit_Action_HeaderValueMatch *envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_new(upb_arena *arena) {
+ return (envoy_config_route_v3_RateLimit_Action_HeaderValueMatch *)_upb_msg_new(&envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_msginit, arena);
+}
+UPB_INLINE envoy_config_route_v3_RateLimit_Action_HeaderValueMatch *envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_route_v3_RateLimit_Action_HeaderValueMatch *ret = envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_serialize(const envoy_config_route_v3_RateLimit_Action_HeaderValueMatch *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_descriptor_value(const envoy_config_route_v3_RateLimit_Action_HeaderValueMatch *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE bool envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_has_expect_match(const envoy_config_route_v3_RateLimit_Action_HeaderValueMatch *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
+UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_expect_match(const envoy_config_route_v3_RateLimit_Action_HeaderValueMatch *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_BoolValue*); }
+UPB_INLINE bool envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_has_headers(const envoy_config_route_v3_RateLimit_Action_HeaderValueMatch *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
+UPB_INLINE const envoy_config_route_v3_HeaderMatcher* const* envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_headers(const envoy_config_route_v3_RateLimit_Action_HeaderValueMatch *msg, size_t *len) { return (const envoy_config_route_v3_HeaderMatcher* const*)_upb_array_accessor(msg, UPB_SIZE(12, 24), len); }
+
+UPB_INLINE void envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_set_descriptor_value(envoy_config_route_v3_RateLimit_Action_HeaderValueMatch *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_set_expect_match(envoy_config_route_v3_RateLimit_Action_HeaderValueMatch *msg, struct google_protobuf_BoolValue* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_BoolValue*) = value;
+}
+UPB_INLINE struct google_protobuf_BoolValue* envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_mutable_expect_match(envoy_config_route_v3_RateLimit_Action_HeaderValueMatch *msg, upb_arena *arena) {
+ struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_expect_match(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_BoolValue*)_upb_msg_new(&google_protobuf_BoolValue_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_set_expect_match(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE envoy_config_route_v3_HeaderMatcher** envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_mutable_headers(envoy_config_route_v3_RateLimit_Action_HeaderValueMatch *msg, size_t *len) {
+ return (envoy_config_route_v3_HeaderMatcher**)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 24), len);
+}
+UPB_INLINE envoy_config_route_v3_HeaderMatcher** envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_resize_headers(envoy_config_route_v3_RateLimit_Action_HeaderValueMatch *msg, size_t len, upb_arena *arena) {
+ return (envoy_config_route_v3_HeaderMatcher**)_upb_array_resize_accessor(msg, UPB_SIZE(12, 24), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_config_route_v3_HeaderMatcher* envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_add_headers(envoy_config_route_v3_RateLimit_Action_HeaderValueMatch *msg, upb_arena *arena) {
+ struct envoy_config_route_v3_HeaderMatcher* sub = (struct envoy_config_route_v3_HeaderMatcher*)_upb_msg_new(&envoy_config_route_v3_HeaderMatcher_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(12, 24), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+
+/* envoy.config.route.v3.RateLimit.Action.DynamicMetaData */
+
+UPB_INLINE envoy_config_route_v3_RateLimit_Action_DynamicMetaData *envoy_config_route_v3_RateLimit_Action_DynamicMetaData_new(upb_arena *arena) {
+ return (envoy_config_route_v3_RateLimit_Action_DynamicMetaData *)_upb_msg_new(&envoy_config_route_v3_RateLimit_Action_DynamicMetaData_msginit, arena);
+}
+UPB_INLINE envoy_config_route_v3_RateLimit_Action_DynamicMetaData *envoy_config_route_v3_RateLimit_Action_DynamicMetaData_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_route_v3_RateLimit_Action_DynamicMetaData *ret = envoy_config_route_v3_RateLimit_Action_DynamicMetaData_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_DynamicMetaData_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_route_v3_RateLimit_Action_DynamicMetaData_serialize(const envoy_config_route_v3_RateLimit_Action_DynamicMetaData *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_route_v3_RateLimit_Action_DynamicMetaData_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview envoy_config_route_v3_RateLimit_Action_DynamicMetaData_descriptor_key(const envoy_config_route_v3_RateLimit_Action_DynamicMetaData *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE bool envoy_config_route_v3_RateLimit_Action_DynamicMetaData_has_metadata_key(const envoy_config_route_v3_RateLimit_Action_DynamicMetaData *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); }
+UPB_INLINE const struct envoy_type_metadata_v3_MetadataKey* envoy_config_route_v3_RateLimit_Action_DynamicMetaData_metadata_key(const envoy_config_route_v3_RateLimit_Action_DynamicMetaData *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const struct envoy_type_metadata_v3_MetadataKey*); }
+UPB_INLINE upb_strview envoy_config_route_v3_RateLimit_Action_DynamicMetaData_default_value(const envoy_config_route_v3_RateLimit_Action_DynamicMetaData *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview); }
+
+UPB_INLINE void envoy_config_route_v3_RateLimit_Action_DynamicMetaData_set_descriptor_key(envoy_config_route_v3_RateLimit_Action_DynamicMetaData *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_route_v3_RateLimit_Action_DynamicMetaData_set_metadata_key(envoy_config_route_v3_RateLimit_Action_DynamicMetaData *msg, struct envoy_type_metadata_v3_MetadataKey* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), struct envoy_type_metadata_v3_MetadataKey*) = value;
+}
+UPB_INLINE struct envoy_type_metadata_v3_MetadataKey* envoy_config_route_v3_RateLimit_Action_DynamicMetaData_mutable_metadata_key(envoy_config_route_v3_RateLimit_Action_DynamicMetaData *msg, upb_arena *arena) {
+ struct envoy_type_metadata_v3_MetadataKey* sub = (struct envoy_type_metadata_v3_MetadataKey*)envoy_config_route_v3_RateLimit_Action_DynamicMetaData_metadata_key(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_type_metadata_v3_MetadataKey*)_upb_msg_new(&envoy_type_metadata_v3_MetadataKey_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_RateLimit_Action_DynamicMetaData_set_metadata_key(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_route_v3_RateLimit_Action_DynamicMetaData_set_default_value(envoy_config_route_v3_RateLimit_Action_DynamicMetaData *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview) = value;
+}
+
+/* envoy.config.route.v3.RateLimit.Override */
+
+UPB_INLINE envoy_config_route_v3_RateLimit_Override *envoy_config_route_v3_RateLimit_Override_new(upb_arena *arena) {
+ return (envoy_config_route_v3_RateLimit_Override *)_upb_msg_new(&envoy_config_route_v3_RateLimit_Override_msginit, arena);
+}
+UPB_INLINE envoy_config_route_v3_RateLimit_Override *envoy_config_route_v3_RateLimit_Override_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_route_v3_RateLimit_Override *ret = envoy_config_route_v3_RateLimit_Override_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Override_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_route_v3_RateLimit_Override_serialize(const envoy_config_route_v3_RateLimit_Override *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_route_v3_RateLimit_Override_msginit, arena, len);
+}
+
+typedef enum {
+ envoy_config_route_v3_RateLimit_Override_override_specifier_dynamic_metadata = 1,
+ envoy_config_route_v3_RateLimit_Override_override_specifier_NOT_SET = 0
+} envoy_config_route_v3_RateLimit_Override_override_specifier_oneofcases;
+UPB_INLINE envoy_config_route_v3_RateLimit_Override_override_specifier_oneofcases envoy_config_route_v3_RateLimit_Override_override_specifier_case(const envoy_config_route_v3_RateLimit_Override* msg) { return (envoy_config_route_v3_RateLimit_Override_override_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 8), int32_t); }
+
+UPB_INLINE bool envoy_config_route_v3_RateLimit_Override_has_dynamic_metadata(const envoy_config_route_v3_RateLimit_Override *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 1; }
+UPB_INLINE const envoy_config_route_v3_RateLimit_Override_DynamicMetadata* envoy_config_route_v3_RateLimit_Override_dynamic_metadata(const envoy_config_route_v3_RateLimit_Override *msg) { return UPB_READ_ONEOF(msg, const envoy_config_route_v3_RateLimit_Override_DynamicMetadata*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 1, NULL); }
+
+UPB_INLINE void envoy_config_route_v3_RateLimit_Override_set_dynamic_metadata(envoy_config_route_v3_RateLimit_Override *msg, envoy_config_route_v3_RateLimit_Override_DynamicMetadata* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RateLimit_Override_DynamicMetadata*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 1);
+}
+UPB_INLINE struct envoy_config_route_v3_RateLimit_Override_DynamicMetadata* envoy_config_route_v3_RateLimit_Override_mutable_dynamic_metadata(envoy_config_route_v3_RateLimit_Override *msg, upb_arena *arena) {
+ struct envoy_config_route_v3_RateLimit_Override_DynamicMetadata* sub = (struct envoy_config_route_v3_RateLimit_Override_DynamicMetadata*)envoy_config_route_v3_RateLimit_Override_dynamic_metadata(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_route_v3_RateLimit_Override_DynamicMetadata*)_upb_msg_new(&envoy_config_route_v3_RateLimit_Override_DynamicMetadata_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_RateLimit_Override_set_dynamic_metadata(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.route.v3.RateLimit.Override.DynamicMetadata */
+
+UPB_INLINE envoy_config_route_v3_RateLimit_Override_DynamicMetadata *envoy_config_route_v3_RateLimit_Override_DynamicMetadata_new(upb_arena *arena) {
+ return (envoy_config_route_v3_RateLimit_Override_DynamicMetadata *)_upb_msg_new(&envoy_config_route_v3_RateLimit_Override_DynamicMetadata_msginit, arena);
+}
+UPB_INLINE envoy_config_route_v3_RateLimit_Override_DynamicMetadata *envoy_config_route_v3_RateLimit_Override_DynamicMetadata_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_route_v3_RateLimit_Override_DynamicMetadata *ret = envoy_config_route_v3_RateLimit_Override_DynamicMetadata_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Override_DynamicMetadata_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_route_v3_RateLimit_Override_DynamicMetadata_serialize(const envoy_config_route_v3_RateLimit_Override_DynamicMetadata *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_route_v3_RateLimit_Override_DynamicMetadata_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_route_v3_RateLimit_Override_DynamicMetadata_has_metadata_key(const envoy_config_route_v3_RateLimit_Override_DynamicMetadata *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE const struct envoy_type_metadata_v3_MetadataKey* envoy_config_route_v3_RateLimit_Override_DynamicMetadata_metadata_key(const envoy_config_route_v3_RateLimit_Override_DynamicMetadata *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct envoy_type_metadata_v3_MetadataKey*); }
+
+UPB_INLINE void envoy_config_route_v3_RateLimit_Override_DynamicMetadata_set_metadata_key(envoy_config_route_v3_RateLimit_Override_DynamicMetadata *msg, struct envoy_type_metadata_v3_MetadataKey* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct envoy_type_metadata_v3_MetadataKey*) = value;
+}
+UPB_INLINE struct envoy_type_metadata_v3_MetadataKey* envoy_config_route_v3_RateLimit_Override_DynamicMetadata_mutable_metadata_key(envoy_config_route_v3_RateLimit_Override_DynamicMetadata *msg, upb_arena *arena) {
+ struct envoy_type_metadata_v3_MetadataKey* sub = (struct envoy_type_metadata_v3_MetadataKey*)envoy_config_route_v3_RateLimit_Override_DynamicMetadata_metadata_key(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_type_metadata_v3_MetadataKey*)_upb_msg_new(&envoy_type_metadata_v3_MetadataKey_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_RateLimit_Override_DynamicMetadata_set_metadata_key(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.route.v3.HeaderMatcher */
+
+UPB_INLINE envoy_config_route_v3_HeaderMatcher *envoy_config_route_v3_HeaderMatcher_new(upb_arena *arena) {
+ return (envoy_config_route_v3_HeaderMatcher *)_upb_msg_new(&envoy_config_route_v3_HeaderMatcher_msginit, arena);
+}
+UPB_INLINE envoy_config_route_v3_HeaderMatcher *envoy_config_route_v3_HeaderMatcher_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_route_v3_HeaderMatcher *ret = envoy_config_route_v3_HeaderMatcher_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_HeaderMatcher_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_route_v3_HeaderMatcher_serialize(const envoy_config_route_v3_HeaderMatcher *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_route_v3_HeaderMatcher_msginit, arena, len);
+}
+
+typedef enum {
+ envoy_config_route_v3_HeaderMatcher_header_match_specifier_exact_match = 4,
+ envoy_config_route_v3_HeaderMatcher_header_match_specifier_safe_regex_match = 11,
+ envoy_config_route_v3_HeaderMatcher_header_match_specifier_range_match = 6,
+ envoy_config_route_v3_HeaderMatcher_header_match_specifier_present_match = 7,
+ envoy_config_route_v3_HeaderMatcher_header_match_specifier_prefix_match = 9,
+ envoy_config_route_v3_HeaderMatcher_header_match_specifier_suffix_match = 10,
+ envoy_config_route_v3_HeaderMatcher_header_match_specifier_contains_match = 12,
+ envoy_config_route_v3_HeaderMatcher_header_match_specifier_NOT_SET = 0
+} envoy_config_route_v3_HeaderMatcher_header_match_specifier_oneofcases;
+UPB_INLINE envoy_config_route_v3_HeaderMatcher_header_match_specifier_oneofcases envoy_config_route_v3_HeaderMatcher_header_match_specifier_case(const envoy_config_route_v3_HeaderMatcher* msg) { return (envoy_config_route_v3_HeaderMatcher_header_match_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(20, 40), int32_t); }
+
+UPB_INLINE upb_strview envoy_config_route_v3_HeaderMatcher_name(const envoy_config_route_v3_HeaderMatcher *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
+UPB_INLINE bool envoy_config_route_v3_HeaderMatcher_has_exact_match(const envoy_config_route_v3_HeaderMatcher *msg) { return _upb_getoneofcase(msg, UPB_SIZE(20, 40)) == 4; }
+UPB_INLINE upb_strview envoy_config_route_v3_HeaderMatcher_exact_match(const envoy_config_route_v3_HeaderMatcher *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(12, 24), UPB_SIZE(20, 40), 4, upb_strview_make("", strlen(""))); }
+UPB_INLINE bool envoy_config_route_v3_HeaderMatcher_has_range_match(const envoy_config_route_v3_HeaderMatcher *msg) { return _upb_getoneofcase(msg, UPB_SIZE(20, 40)) == 6; }
+UPB_INLINE const struct envoy_type_v3_Int64Range* envoy_config_route_v3_HeaderMatcher_range_match(const envoy_config_route_v3_HeaderMatcher *msg) { return UPB_READ_ONEOF(msg, const struct envoy_type_v3_Int64Range*, UPB_SIZE(12, 24), UPB_SIZE(20, 40), 6, NULL); }
+UPB_INLINE bool envoy_config_route_v3_HeaderMatcher_has_present_match(const envoy_config_route_v3_HeaderMatcher *msg) { return _upb_getoneofcase(msg, UPB_SIZE(20, 40)) == 7; }
+UPB_INLINE bool envoy_config_route_v3_HeaderMatcher_present_match(const envoy_config_route_v3_HeaderMatcher *msg) { return UPB_READ_ONEOF(msg, bool, UPB_SIZE(12, 24), UPB_SIZE(20, 40), 7, false); }
+UPB_INLINE bool envoy_config_route_v3_HeaderMatcher_invert_match(const envoy_config_route_v3_HeaderMatcher *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); }
+UPB_INLINE bool envoy_config_route_v3_HeaderMatcher_has_prefix_match(const envoy_config_route_v3_HeaderMatcher *msg) { return _upb_getoneofcase(msg, UPB_SIZE(20, 40)) == 9; }
+UPB_INLINE upb_strview envoy_config_route_v3_HeaderMatcher_prefix_match(const envoy_config_route_v3_HeaderMatcher *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(12, 24), UPB_SIZE(20, 40), 9, upb_strview_make("", strlen(""))); }
+UPB_INLINE bool envoy_config_route_v3_HeaderMatcher_has_suffix_match(const envoy_config_route_v3_HeaderMatcher *msg) { return _upb_getoneofcase(msg, UPB_SIZE(20, 40)) == 10; }
+UPB_INLINE upb_strview envoy_config_route_v3_HeaderMatcher_suffix_match(const envoy_config_route_v3_HeaderMatcher *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(12, 24), UPB_SIZE(20, 40), 10, upb_strview_make("", strlen(""))); }
+UPB_INLINE bool envoy_config_route_v3_HeaderMatcher_has_safe_regex_match(const envoy_config_route_v3_HeaderMatcher *msg) { return _upb_getoneofcase(msg, UPB_SIZE(20, 40)) == 11; }
+UPB_INLINE const struct envoy_type_matcher_v3_RegexMatcher* envoy_config_route_v3_HeaderMatcher_safe_regex_match(const envoy_config_route_v3_HeaderMatcher *msg) { return UPB_READ_ONEOF(msg, const struct envoy_type_matcher_v3_RegexMatcher*, UPB_SIZE(12, 24), UPB_SIZE(20, 40), 11, NULL); }
+UPB_INLINE bool envoy_config_route_v3_HeaderMatcher_has_contains_match(const envoy_config_route_v3_HeaderMatcher *msg) { return _upb_getoneofcase(msg, UPB_SIZE(20, 40)) == 12; }
+UPB_INLINE upb_strview envoy_config_route_v3_HeaderMatcher_contains_match(const envoy_config_route_v3_HeaderMatcher *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(12, 24), UPB_SIZE(20, 40), 12, upb_strview_make("", strlen(""))); }
+
+UPB_INLINE void envoy_config_route_v3_HeaderMatcher_set_name(envoy_config_route_v3_HeaderMatcher *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_route_v3_HeaderMatcher_set_exact_match(envoy_config_route_v3_HeaderMatcher *msg, upb_strview value) {
+ UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(12, 24), value, UPB_SIZE(20, 40), 4);
+}
+UPB_INLINE void envoy_config_route_v3_HeaderMatcher_set_range_match(envoy_config_route_v3_HeaderMatcher *msg, struct envoy_type_v3_Int64Range* value) {
+ UPB_WRITE_ONEOF(msg, struct envoy_type_v3_Int64Range*, UPB_SIZE(12, 24), value, UPB_SIZE(20, 40), 6);
+}
+UPB_INLINE struct envoy_type_v3_Int64Range* envoy_config_route_v3_HeaderMatcher_mutable_range_match(envoy_config_route_v3_HeaderMatcher *msg, upb_arena *arena) {
+ struct envoy_type_v3_Int64Range* sub = (struct envoy_type_v3_Int64Range*)envoy_config_route_v3_HeaderMatcher_range_match(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_type_v3_Int64Range*)_upb_msg_new(&envoy_type_v3_Int64Range_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_HeaderMatcher_set_range_match(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_route_v3_HeaderMatcher_set_present_match(envoy_config_route_v3_HeaderMatcher *msg, bool value) {
+ UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(12, 24), value, UPB_SIZE(20, 40), 7);
+}
+UPB_INLINE void envoy_config_route_v3_HeaderMatcher_set_invert_match(envoy_config_route_v3_HeaderMatcher *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
+}
+UPB_INLINE void envoy_config_route_v3_HeaderMatcher_set_prefix_match(envoy_config_route_v3_HeaderMatcher *msg, upb_strview value) {
+ UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(12, 24), value, UPB_SIZE(20, 40), 9);
+}
+UPB_INLINE void envoy_config_route_v3_HeaderMatcher_set_suffix_match(envoy_config_route_v3_HeaderMatcher *msg, upb_strview value) {
+ UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(12, 24), value, UPB_SIZE(20, 40), 10);
+}
+UPB_INLINE void envoy_config_route_v3_HeaderMatcher_set_safe_regex_match(envoy_config_route_v3_HeaderMatcher *msg, struct envoy_type_matcher_v3_RegexMatcher* value) {
+ UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_RegexMatcher*, UPB_SIZE(12, 24), value, UPB_SIZE(20, 40), 11);
+}
+UPB_INLINE struct envoy_type_matcher_v3_RegexMatcher* envoy_config_route_v3_HeaderMatcher_mutable_safe_regex_match(envoy_config_route_v3_HeaderMatcher *msg, upb_arena *arena) {
+ struct envoy_type_matcher_v3_RegexMatcher* sub = (struct envoy_type_matcher_v3_RegexMatcher*)envoy_config_route_v3_HeaderMatcher_safe_regex_match(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_type_matcher_v3_RegexMatcher*)_upb_msg_new(&envoy_type_matcher_v3_RegexMatcher_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_HeaderMatcher_set_safe_regex_match(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_route_v3_HeaderMatcher_set_contains_match(envoy_config_route_v3_HeaderMatcher *msg, upb_strview value) {
+ UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(12, 24), value, UPB_SIZE(20, 40), 12);
+}
+
+/* envoy.config.route.v3.QueryParameterMatcher */
+
+UPB_INLINE envoy_config_route_v3_QueryParameterMatcher *envoy_config_route_v3_QueryParameterMatcher_new(upb_arena *arena) {
+ return (envoy_config_route_v3_QueryParameterMatcher *)_upb_msg_new(&envoy_config_route_v3_QueryParameterMatcher_msginit, arena);
+}
+UPB_INLINE envoy_config_route_v3_QueryParameterMatcher *envoy_config_route_v3_QueryParameterMatcher_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_route_v3_QueryParameterMatcher *ret = envoy_config_route_v3_QueryParameterMatcher_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_QueryParameterMatcher_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_route_v3_QueryParameterMatcher_serialize(const envoy_config_route_v3_QueryParameterMatcher *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_route_v3_QueryParameterMatcher_msginit, arena, len);
+}
+
+typedef enum {
+ envoy_config_route_v3_QueryParameterMatcher_query_parameter_match_specifier_string_match = 5,
+ envoy_config_route_v3_QueryParameterMatcher_query_parameter_match_specifier_present_match = 6,
+ envoy_config_route_v3_QueryParameterMatcher_query_parameter_match_specifier_NOT_SET = 0
+} envoy_config_route_v3_QueryParameterMatcher_query_parameter_match_specifier_oneofcases;
+UPB_INLINE envoy_config_route_v3_QueryParameterMatcher_query_parameter_match_specifier_oneofcases envoy_config_route_v3_QueryParameterMatcher_query_parameter_match_specifier_case(const envoy_config_route_v3_QueryParameterMatcher* msg) { return (envoy_config_route_v3_QueryParameterMatcher_query_parameter_match_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(12, 24), int32_t); }
+
+UPB_INLINE upb_strview envoy_config_route_v3_QueryParameterMatcher_name(const envoy_config_route_v3_QueryParameterMatcher *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE bool envoy_config_route_v3_QueryParameterMatcher_has_string_match(const envoy_config_route_v3_QueryParameterMatcher *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 5; }
+UPB_INLINE const struct envoy_type_matcher_v3_StringMatcher* envoy_config_route_v3_QueryParameterMatcher_string_match(const envoy_config_route_v3_QueryParameterMatcher *msg) { return UPB_READ_ONEOF(msg, const struct envoy_type_matcher_v3_StringMatcher*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 5, NULL); }
+UPB_INLINE bool envoy_config_route_v3_QueryParameterMatcher_has_present_match(const envoy_config_route_v3_QueryParameterMatcher *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 6; }
+UPB_INLINE bool envoy_config_route_v3_QueryParameterMatcher_present_match(const envoy_config_route_v3_QueryParameterMatcher *msg) { return UPB_READ_ONEOF(msg, bool, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 6, false); }
+
+UPB_INLINE void envoy_config_route_v3_QueryParameterMatcher_set_name(envoy_config_route_v3_QueryParameterMatcher *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_route_v3_QueryParameterMatcher_set_string_match(envoy_config_route_v3_QueryParameterMatcher *msg, struct envoy_type_matcher_v3_StringMatcher* value) {
+ UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_StringMatcher*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 5);
+}
+UPB_INLINE struct envoy_type_matcher_v3_StringMatcher* envoy_config_route_v3_QueryParameterMatcher_mutable_string_match(envoy_config_route_v3_QueryParameterMatcher *msg, upb_arena *arena) {
+ struct envoy_type_matcher_v3_StringMatcher* sub = (struct envoy_type_matcher_v3_StringMatcher*)envoy_config_route_v3_QueryParameterMatcher_string_match(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_type_matcher_v3_StringMatcher*)_upb_msg_new(&envoy_type_matcher_v3_StringMatcher_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_QueryParameterMatcher_set_string_match(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_route_v3_QueryParameterMatcher_set_present_match(envoy_config_route_v3_QueryParameterMatcher *msg, bool value) {
+ UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 6);
+}
+
+/* envoy.config.route.v3.InternalRedirectPolicy */
+
+UPB_INLINE envoy_config_route_v3_InternalRedirectPolicy *envoy_config_route_v3_InternalRedirectPolicy_new(upb_arena *arena) {
+ return (envoy_config_route_v3_InternalRedirectPolicy *)_upb_msg_new(&envoy_config_route_v3_InternalRedirectPolicy_msginit, arena);
+}
+UPB_INLINE envoy_config_route_v3_InternalRedirectPolicy *envoy_config_route_v3_InternalRedirectPolicy_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_route_v3_InternalRedirectPolicy *ret = envoy_config_route_v3_InternalRedirectPolicy_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_InternalRedirectPolicy_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_route_v3_InternalRedirectPolicy_serialize(const envoy_config_route_v3_InternalRedirectPolicy *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_route_v3_InternalRedirectPolicy_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_route_v3_InternalRedirectPolicy_has_max_internal_redirects(const envoy_config_route_v3_InternalRedirectPolicy *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_route_v3_InternalRedirectPolicy_max_internal_redirects(const envoy_config_route_v3_InternalRedirectPolicy *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_UInt32Value*); }
+UPB_INLINE uint32_t const* envoy_config_route_v3_InternalRedirectPolicy_redirect_response_codes(const envoy_config_route_v3_InternalRedirectPolicy *msg, size_t *len) { return (uint32_t const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len); }
+UPB_INLINE bool envoy_config_route_v3_InternalRedirectPolicy_has_predicates(const envoy_config_route_v3_InternalRedirectPolicy *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
+UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* const* envoy_config_route_v3_InternalRedirectPolicy_predicates(const envoy_config_route_v3_InternalRedirectPolicy *msg, size_t *len) { return (const struct envoy_config_core_v3_TypedExtensionConfig* const*)_upb_array_accessor(msg, UPB_SIZE(12, 24), len); }
+UPB_INLINE bool envoy_config_route_v3_InternalRedirectPolicy_allow_cross_scheme_redirect(const envoy_config_route_v3_InternalRedirectPolicy *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); }
+
+UPB_INLINE void envoy_config_route_v3_InternalRedirectPolicy_set_max_internal_redirects(envoy_config_route_v3_InternalRedirectPolicy *msg, struct google_protobuf_UInt32Value* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_route_v3_InternalRedirectPolicy_mutable_max_internal_redirects(envoy_config_route_v3_InternalRedirectPolicy *msg, upb_arena *arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_route_v3_InternalRedirectPolicy_max_internal_redirects(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_InternalRedirectPolicy_set_max_internal_redirects(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE uint32_t* envoy_config_route_v3_InternalRedirectPolicy_mutable_redirect_response_codes(envoy_config_route_v3_InternalRedirectPolicy *msg, size_t *len) {
+ return (uint32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len);
+}
+UPB_INLINE uint32_t* envoy_config_route_v3_InternalRedirectPolicy_resize_redirect_response_codes(envoy_config_route_v3_InternalRedirectPolicy *msg, size_t len, upb_arena *arena) {
+ return (uint32_t*)_upb_array_resize_accessor(msg, UPB_SIZE(8, 16), len, UPB_TYPE_UINT32, arena);
+}
+UPB_INLINE bool envoy_config_route_v3_InternalRedirectPolicy_add_redirect_response_codes(envoy_config_route_v3_InternalRedirectPolicy *msg, uint32_t val, upb_arena *arena) {
+ return _upb_array_append_accessor(msg, UPB_SIZE(8, 16), UPB_SIZE(4, 4), UPB_TYPE_UINT32, &val,
+ arena);
+}
+UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig** envoy_config_route_v3_InternalRedirectPolicy_mutable_predicates(envoy_config_route_v3_InternalRedirectPolicy *msg, size_t *len) {
+ return (struct envoy_config_core_v3_TypedExtensionConfig**)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 24), len);
+}
+UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig** envoy_config_route_v3_InternalRedirectPolicy_resize_predicates(envoy_config_route_v3_InternalRedirectPolicy *msg, size_t len, upb_arena *arena) {
+ return (struct envoy_config_core_v3_TypedExtensionConfig**)_upb_array_resize_accessor(msg, UPB_SIZE(12, 24), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_route_v3_InternalRedirectPolicy_add_predicates(envoy_config_route_v3_InternalRedirectPolicy *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_msg_new(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(12, 24), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE void envoy_config_route_v3_InternalRedirectPolicy_set_allow_cross_scheme_redirect(envoy_config_route_v3_InternalRedirectPolicy *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_CONFIG_ROUTE_V3_ROUTE_COMPONENTS_PROTO_UPB_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.c
index 29f6019b0f6..0dd0a7010ba 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.c
@@ -1,60 +1,60 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/config/route/v3/scoped_route.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include <stddef.h>
-#include "upb/msg.h"
-#include "envoy/config/route/v3/scoped_route.upb.h"
-#include "udpa/annotations/status.upb.h"
-#include "udpa/annotations/versioning.upb.h"
-#include "validate/validate.upb.h"
-
-#include "upb/port_def.inc"
-
-static const upb_msglayout *const envoy_config_route_v3_ScopedRouteConfiguration_submsgs[1] = {
- &envoy_config_route_v3_ScopedRouteConfiguration_Key_msginit,
-};
-
-static const upb_msglayout_field envoy_config_route_v3_ScopedRouteConfiguration__fields[4] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(12, 24), 0, 0, 9, 1},
- {3, UPB_SIZE(20, 40), 0, 0, 11, 1},
- {4, UPB_SIZE(0, 0), 0, 0, 8, 1},
-};
-
-const upb_msglayout envoy_config_route_v3_ScopedRouteConfiguration_msginit = {
- &envoy_config_route_v3_ScopedRouteConfiguration_submsgs[0],
- &envoy_config_route_v3_ScopedRouteConfiguration__fields[0],
- UPB_SIZE(24, 48), 4, false,
-};
-
-static const upb_msglayout *const envoy_config_route_v3_ScopedRouteConfiguration_Key_submsgs[1] = {
- &envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_msginit,
-};
-
-static const upb_msglayout_field envoy_config_route_v3_ScopedRouteConfiguration_Key__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 3},
-};
-
-const upb_msglayout envoy_config_route_v3_ScopedRouteConfiguration_Key_msginit = {
- &envoy_config_route_v3_ScopedRouteConfiguration_Key_submsgs[0],
- &envoy_config_route_v3_ScopedRouteConfiguration_Key__fields[0],
- UPB_SIZE(4, 8), 1, false,
-};
-
-static const upb_msglayout_field envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment__fields[1] = {
- {1, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 9, 1},
-};
-
-const upb_msglayout envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_msginit = {
- NULL,
- &envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment__fields[0],
- UPB_SIZE(16, 32), 1, false,
-};
-
-#include "upb/port_undef.inc"
-
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/route/v3/scoped_route.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg.h"
+#include "envoy/config/route/v3/scoped_route.upb.h"
+#include "udpa/annotations/status.upb.h"
+#include "udpa/annotations/versioning.upb.h"
+#include "validate/validate.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_msglayout *const envoy_config_route_v3_ScopedRouteConfiguration_submsgs[1] = {
+ &envoy_config_route_v3_ScopedRouteConfiguration_Key_msginit,
+};
+
+static const upb_msglayout_field envoy_config_route_v3_ScopedRouteConfiguration__fields[4] = {
+ {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
+ {2, UPB_SIZE(12, 24), 0, 0, 9, 1},
+ {3, UPB_SIZE(20, 40), 0, 0, 11, 1},
+ {4, UPB_SIZE(0, 0), 0, 0, 8, 1},
+};
+
+const upb_msglayout envoy_config_route_v3_ScopedRouteConfiguration_msginit = {
+ &envoy_config_route_v3_ScopedRouteConfiguration_submsgs[0],
+ &envoy_config_route_v3_ScopedRouteConfiguration__fields[0],
+ UPB_SIZE(24, 48), 4, false,
+};
+
+static const upb_msglayout *const envoy_config_route_v3_ScopedRouteConfiguration_Key_submsgs[1] = {
+ &envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_msginit,
+};
+
+static const upb_msglayout_field envoy_config_route_v3_ScopedRouteConfiguration_Key__fields[1] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 11, 3},
+};
+
+const upb_msglayout envoy_config_route_v3_ScopedRouteConfiguration_Key_msginit = {
+ &envoy_config_route_v3_ScopedRouteConfiguration_Key_submsgs[0],
+ &envoy_config_route_v3_ScopedRouteConfiguration_Key__fields[0],
+ UPB_SIZE(4, 8), 1, false,
+};
+
+static const upb_msglayout_field envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 9, 1},
+};
+
+const upb_msglayout envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_msginit = {
+ NULL,
+ &envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment__fields[0],
+ UPB_SIZE(16, 32), 1, false,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.h
index 51edd7f3c91..979510ecfd4 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.h
@@ -1,139 +1,139 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/config/route/v3/scoped_route.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef ENVOY_CONFIG_ROUTE_V3_SCOPED_ROUTE_PROTO_UPB_H_
-#define ENVOY_CONFIG_ROUTE_V3_SCOPED_ROUTE_PROTO_UPB_H_
-
-#include "upb/msg.h"
-#include "upb/decode.h"
-#include "upb/encode.h"
-
-#include "upb/port_def.inc"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct envoy_config_route_v3_ScopedRouteConfiguration;
-struct envoy_config_route_v3_ScopedRouteConfiguration_Key;
-struct envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment;
-typedef struct envoy_config_route_v3_ScopedRouteConfiguration envoy_config_route_v3_ScopedRouteConfiguration;
-typedef struct envoy_config_route_v3_ScopedRouteConfiguration_Key envoy_config_route_v3_ScopedRouteConfiguration_Key;
-typedef struct envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment;
-extern const upb_msglayout envoy_config_route_v3_ScopedRouteConfiguration_msginit;
-extern const upb_msglayout envoy_config_route_v3_ScopedRouteConfiguration_Key_msginit;
-extern const upb_msglayout envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_msginit;
-
-
-/* envoy.config.route.v3.ScopedRouteConfiguration */
-
-UPB_INLINE envoy_config_route_v3_ScopedRouteConfiguration *envoy_config_route_v3_ScopedRouteConfiguration_new(upb_arena *arena) {
- return (envoy_config_route_v3_ScopedRouteConfiguration *)_upb_msg_new(&envoy_config_route_v3_ScopedRouteConfiguration_msginit, arena);
-}
-UPB_INLINE envoy_config_route_v3_ScopedRouteConfiguration *envoy_config_route_v3_ScopedRouteConfiguration_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_route_v3_ScopedRouteConfiguration *ret = envoy_config_route_v3_ScopedRouteConfiguration_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_ScopedRouteConfiguration_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_route_v3_ScopedRouteConfiguration_serialize(const envoy_config_route_v3_ScopedRouteConfiguration *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_route_v3_ScopedRouteConfiguration_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview envoy_config_route_v3_ScopedRouteConfiguration_name(const envoy_config_route_v3_ScopedRouteConfiguration *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
-UPB_INLINE upb_strview envoy_config_route_v3_ScopedRouteConfiguration_route_configuration_name(const envoy_config_route_v3_ScopedRouteConfiguration *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview); }
-UPB_INLINE bool envoy_config_route_v3_ScopedRouteConfiguration_has_key(const envoy_config_route_v3_ScopedRouteConfiguration *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 40)); }
-UPB_INLINE const envoy_config_route_v3_ScopedRouteConfiguration_Key* envoy_config_route_v3_ScopedRouteConfiguration_key(const envoy_config_route_v3_ScopedRouteConfiguration *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const envoy_config_route_v3_ScopedRouteConfiguration_Key*); }
-UPB_INLINE bool envoy_config_route_v3_ScopedRouteConfiguration_on_demand(const envoy_config_route_v3_ScopedRouteConfiguration *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); }
-
-UPB_INLINE void envoy_config_route_v3_ScopedRouteConfiguration_set_name(envoy_config_route_v3_ScopedRouteConfiguration *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_route_v3_ScopedRouteConfiguration_set_route_configuration_name(envoy_config_route_v3_ScopedRouteConfiguration *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_route_v3_ScopedRouteConfiguration_set_key(envoy_config_route_v3_ScopedRouteConfiguration *msg, envoy_config_route_v3_ScopedRouteConfiguration_Key* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(20, 40), envoy_config_route_v3_ScopedRouteConfiguration_Key*) = value;
-}
-UPB_INLINE struct envoy_config_route_v3_ScopedRouteConfiguration_Key* envoy_config_route_v3_ScopedRouteConfiguration_mutable_key(envoy_config_route_v3_ScopedRouteConfiguration *msg, upb_arena *arena) {
- struct envoy_config_route_v3_ScopedRouteConfiguration_Key* sub = (struct envoy_config_route_v3_ScopedRouteConfiguration_Key*)envoy_config_route_v3_ScopedRouteConfiguration_key(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_route_v3_ScopedRouteConfiguration_Key*)_upb_msg_new(&envoy_config_route_v3_ScopedRouteConfiguration_Key_msginit, arena);
- if (!sub) return NULL;
- envoy_config_route_v3_ScopedRouteConfiguration_set_key(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_config_route_v3_ScopedRouteConfiguration_set_on_demand(envoy_config_route_v3_ScopedRouteConfiguration *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
-}
-
-/* envoy.config.route.v3.ScopedRouteConfiguration.Key */
-
-UPB_INLINE envoy_config_route_v3_ScopedRouteConfiguration_Key *envoy_config_route_v3_ScopedRouteConfiguration_Key_new(upb_arena *arena) {
- return (envoy_config_route_v3_ScopedRouteConfiguration_Key *)_upb_msg_new(&envoy_config_route_v3_ScopedRouteConfiguration_Key_msginit, arena);
-}
-UPB_INLINE envoy_config_route_v3_ScopedRouteConfiguration_Key *envoy_config_route_v3_ScopedRouteConfiguration_Key_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_route_v3_ScopedRouteConfiguration_Key *ret = envoy_config_route_v3_ScopedRouteConfiguration_Key_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_ScopedRouteConfiguration_Key_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_route_v3_ScopedRouteConfiguration_Key_serialize(const envoy_config_route_v3_ScopedRouteConfiguration_Key *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_route_v3_ScopedRouteConfiguration_Key_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_config_route_v3_ScopedRouteConfiguration_Key_has_fragments(const envoy_config_route_v3_ScopedRouteConfiguration_Key *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE const envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment* const* envoy_config_route_v3_ScopedRouteConfiguration_Key_fragments(const envoy_config_route_v3_ScopedRouteConfiguration_Key *msg, size_t *len) { return (const envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
-
-UPB_INLINE envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment** envoy_config_route_v3_ScopedRouteConfiguration_Key_mutable_fragments(envoy_config_route_v3_ScopedRouteConfiguration_Key *msg, size_t *len) {
- return (envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
-}
-UPB_INLINE envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment** envoy_config_route_v3_ScopedRouteConfiguration_Key_resize_fragments(envoy_config_route_v3_ScopedRouteConfiguration_Key *msg, size_t len, upb_arena *arena) {
- return (envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment**)_upb_array_resize_accessor(msg, UPB_SIZE(0, 0), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment* envoy_config_route_v3_ScopedRouteConfiguration_Key_add_fragments(envoy_config_route_v3_ScopedRouteConfiguration_Key *msg, upb_arena *arena) {
- struct envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment* sub = (struct envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment*)_upb_msg_new(&envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(0, 0), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-
-/* envoy.config.route.v3.ScopedRouteConfiguration.Key.Fragment */
-
-UPB_INLINE envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment *envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_new(upb_arena *arena) {
- return (envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment *)_upb_msg_new(&envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_msginit, arena);
-}
-UPB_INLINE envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment *envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment *ret = envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_serialize(const envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_msginit, arena, len);
-}
-
-typedef enum {
- envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_type_string_key = 1,
- envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_type_NOT_SET = 0
-} envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_type_oneofcases;
-UPB_INLINE envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_type_oneofcases envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_type_case(const envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment* msg) { return (envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(8, 16), int32_t); }
-
-UPB_INLINE bool envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_has_string_key(const envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 1; }
-UPB_INLINE upb_strview envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_string_key(const envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 1, upb_strview_make("", strlen(""))); }
-
-UPB_INLINE void envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_set_string_key(envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment *msg, upb_strview value) {
- UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 1);
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* ENVOY_CONFIG_ROUTE_V3_SCOPED_ROUTE_PROTO_UPB_H_ */
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/route/v3/scoped_route.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_CONFIG_ROUTE_V3_SCOPED_ROUTE_PROTO_UPB_H_
+#define ENVOY_CONFIG_ROUTE_V3_SCOPED_ROUTE_PROTO_UPB_H_
+
+#include "upb/msg.h"
+#include "upb/decode.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_config_route_v3_ScopedRouteConfiguration;
+struct envoy_config_route_v3_ScopedRouteConfiguration_Key;
+struct envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment;
+typedef struct envoy_config_route_v3_ScopedRouteConfiguration envoy_config_route_v3_ScopedRouteConfiguration;
+typedef struct envoy_config_route_v3_ScopedRouteConfiguration_Key envoy_config_route_v3_ScopedRouteConfiguration_Key;
+typedef struct envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment;
+extern const upb_msglayout envoy_config_route_v3_ScopedRouteConfiguration_msginit;
+extern const upb_msglayout envoy_config_route_v3_ScopedRouteConfiguration_Key_msginit;
+extern const upb_msglayout envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_msginit;
+
+
+/* envoy.config.route.v3.ScopedRouteConfiguration */
+
+UPB_INLINE envoy_config_route_v3_ScopedRouteConfiguration *envoy_config_route_v3_ScopedRouteConfiguration_new(upb_arena *arena) {
+ return (envoy_config_route_v3_ScopedRouteConfiguration *)_upb_msg_new(&envoy_config_route_v3_ScopedRouteConfiguration_msginit, arena);
+}
+UPB_INLINE envoy_config_route_v3_ScopedRouteConfiguration *envoy_config_route_v3_ScopedRouteConfiguration_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_route_v3_ScopedRouteConfiguration *ret = envoy_config_route_v3_ScopedRouteConfiguration_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_ScopedRouteConfiguration_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_route_v3_ScopedRouteConfiguration_serialize(const envoy_config_route_v3_ScopedRouteConfiguration *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_route_v3_ScopedRouteConfiguration_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview envoy_config_route_v3_ScopedRouteConfiguration_name(const envoy_config_route_v3_ScopedRouteConfiguration *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
+UPB_INLINE upb_strview envoy_config_route_v3_ScopedRouteConfiguration_route_configuration_name(const envoy_config_route_v3_ScopedRouteConfiguration *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview); }
+UPB_INLINE bool envoy_config_route_v3_ScopedRouteConfiguration_has_key(const envoy_config_route_v3_ScopedRouteConfiguration *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 40)); }
+UPB_INLINE const envoy_config_route_v3_ScopedRouteConfiguration_Key* envoy_config_route_v3_ScopedRouteConfiguration_key(const envoy_config_route_v3_ScopedRouteConfiguration *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const envoy_config_route_v3_ScopedRouteConfiguration_Key*); }
+UPB_INLINE bool envoy_config_route_v3_ScopedRouteConfiguration_on_demand(const envoy_config_route_v3_ScopedRouteConfiguration *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); }
+
+UPB_INLINE void envoy_config_route_v3_ScopedRouteConfiguration_set_name(envoy_config_route_v3_ScopedRouteConfiguration *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_route_v3_ScopedRouteConfiguration_set_route_configuration_name(envoy_config_route_v3_ScopedRouteConfiguration *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_route_v3_ScopedRouteConfiguration_set_key(envoy_config_route_v3_ScopedRouteConfiguration *msg, envoy_config_route_v3_ScopedRouteConfiguration_Key* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 40), envoy_config_route_v3_ScopedRouteConfiguration_Key*) = value;
+}
+UPB_INLINE struct envoy_config_route_v3_ScopedRouteConfiguration_Key* envoy_config_route_v3_ScopedRouteConfiguration_mutable_key(envoy_config_route_v3_ScopedRouteConfiguration *msg, upb_arena *arena) {
+ struct envoy_config_route_v3_ScopedRouteConfiguration_Key* sub = (struct envoy_config_route_v3_ScopedRouteConfiguration_Key*)envoy_config_route_v3_ScopedRouteConfiguration_key(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_route_v3_ScopedRouteConfiguration_Key*)_upb_msg_new(&envoy_config_route_v3_ScopedRouteConfiguration_Key_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_ScopedRouteConfiguration_set_key(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_route_v3_ScopedRouteConfiguration_set_on_demand(envoy_config_route_v3_ScopedRouteConfiguration *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
+}
+
+/* envoy.config.route.v3.ScopedRouteConfiguration.Key */
+
+UPB_INLINE envoy_config_route_v3_ScopedRouteConfiguration_Key *envoy_config_route_v3_ScopedRouteConfiguration_Key_new(upb_arena *arena) {
+ return (envoy_config_route_v3_ScopedRouteConfiguration_Key *)_upb_msg_new(&envoy_config_route_v3_ScopedRouteConfiguration_Key_msginit, arena);
+}
+UPB_INLINE envoy_config_route_v3_ScopedRouteConfiguration_Key *envoy_config_route_v3_ScopedRouteConfiguration_Key_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_route_v3_ScopedRouteConfiguration_Key *ret = envoy_config_route_v3_ScopedRouteConfiguration_Key_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_ScopedRouteConfiguration_Key_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_route_v3_ScopedRouteConfiguration_Key_serialize(const envoy_config_route_v3_ScopedRouteConfiguration_Key *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_route_v3_ScopedRouteConfiguration_Key_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_route_v3_ScopedRouteConfiguration_Key_has_fragments(const envoy_config_route_v3_ScopedRouteConfiguration_Key *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE const envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment* const* envoy_config_route_v3_ScopedRouteConfiguration_Key_fragments(const envoy_config_route_v3_ScopedRouteConfiguration_Key *msg, size_t *len) { return (const envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
+
+UPB_INLINE envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment** envoy_config_route_v3_ScopedRouteConfiguration_Key_mutable_fragments(envoy_config_route_v3_ScopedRouteConfiguration_Key *msg, size_t *len) {
+ return (envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
+}
+UPB_INLINE envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment** envoy_config_route_v3_ScopedRouteConfiguration_Key_resize_fragments(envoy_config_route_v3_ScopedRouteConfiguration_Key *msg, size_t len, upb_arena *arena) {
+ return (envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment**)_upb_array_resize_accessor(msg, UPB_SIZE(0, 0), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment* envoy_config_route_v3_ScopedRouteConfiguration_Key_add_fragments(envoy_config_route_v3_ScopedRouteConfiguration_Key *msg, upb_arena *arena) {
+ struct envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment* sub = (struct envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment*)_upb_msg_new(&envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(0, 0), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+
+/* envoy.config.route.v3.ScopedRouteConfiguration.Key.Fragment */
+
+UPB_INLINE envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment *envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_new(upb_arena *arena) {
+ return (envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment *)_upb_msg_new(&envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_msginit, arena);
+}
+UPB_INLINE envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment *envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment *ret = envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_serialize(const envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_msginit, arena, len);
+}
+
+typedef enum {
+ envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_type_string_key = 1,
+ envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_type_NOT_SET = 0
+} envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_type_oneofcases;
+UPB_INLINE envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_type_oneofcases envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_type_case(const envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment* msg) { return (envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(8, 16), int32_t); }
+
+UPB_INLINE bool envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_has_string_key(const envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 1; }
+UPB_INLINE upb_strview envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_string_key(const envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 1, upb_strview_make("", strlen(""))); }
+
+UPB_INLINE void envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_set_string_key(envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment *msg, upb_strview value) {
+ UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 1);
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_CONFIG_ROUTE_V3_SCOPED_ROUTE_PROTO_UPB_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.c
index 57d1f1c2a98..8771e2c4d0d 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.c
@@ -1,50 +1,50 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/config/trace/v3/http_tracer.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include <stddef.h>
-#include "upb/msg.h"
-#include "envoy/config/trace/v3/http_tracer.upb.h"
-#include "google/protobuf/any.upb.h"
-#include "google/protobuf/struct.upb.h"
-#include "udpa/annotations/status.upb.h"
-#include "udpa/annotations/versioning.upb.h"
-#include "validate/validate.upb.h"
-
-#include "upb/port_def.inc"
-
-static const upb_msglayout *const envoy_config_trace_v3_Tracing_submsgs[1] = {
- &envoy_config_trace_v3_Tracing_Http_msginit,
-};
-
-static const upb_msglayout_field envoy_config_trace_v3_Tracing__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
-};
-
-const upb_msglayout envoy_config_trace_v3_Tracing_msginit = {
- &envoy_config_trace_v3_Tracing_submsgs[0],
- &envoy_config_trace_v3_Tracing__fields[0],
- UPB_SIZE(4, 8), 1, false,
-};
-
-static const upb_msglayout *const envoy_config_trace_v3_Tracing_Http_submsgs[1] = {
- &google_protobuf_Any_msginit,
-};
-
-static const upb_msglayout_field envoy_config_trace_v3_Tracing_Http__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {3, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, 1},
-};
-
-const upb_msglayout envoy_config_trace_v3_Tracing_Http_msginit = {
- &envoy_config_trace_v3_Tracing_Http_submsgs[0],
- &envoy_config_trace_v3_Tracing_Http__fields[0],
- UPB_SIZE(16, 32), 2, false,
-};
-
-#include "upb/port_undef.inc"
-
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/trace/v3/http_tracer.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg.h"
+#include "envoy/config/trace/v3/http_tracer.upb.h"
+#include "google/protobuf/any.upb.h"
+#include "google/protobuf/struct.upb.h"
+#include "udpa/annotations/status.upb.h"
+#include "udpa/annotations/versioning.upb.h"
+#include "validate/validate.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_msglayout *const envoy_config_trace_v3_Tracing_submsgs[1] = {
+ &envoy_config_trace_v3_Tracing_Http_msginit,
+};
+
+static const upb_msglayout_field envoy_config_trace_v3_Tracing__fields[1] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
+};
+
+const upb_msglayout envoy_config_trace_v3_Tracing_msginit = {
+ &envoy_config_trace_v3_Tracing_submsgs[0],
+ &envoy_config_trace_v3_Tracing__fields[0],
+ UPB_SIZE(4, 8), 1, false,
+};
+
+static const upb_msglayout *const envoy_config_trace_v3_Tracing_Http_submsgs[1] = {
+ &google_protobuf_Any_msginit,
+};
+
+static const upb_msglayout_field envoy_config_trace_v3_Tracing_Http__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {3, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, 1},
+};
+
+const upb_msglayout envoy_config_trace_v3_Tracing_Http_msginit = {
+ &envoy_config_trace_v3_Tracing_Http_submsgs[0],
+ &envoy_config_trace_v3_Tracing_Http__fields[0],
+ UPB_SIZE(16, 32), 2, false,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.h
index a3c804f6e41..7f97caca7bf 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.h
@@ -1,108 +1,108 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/config/trace/v3/http_tracer.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef ENVOY_CONFIG_TRACE_V3_HTTP_TRACER_PROTO_UPB_H_
-#define ENVOY_CONFIG_TRACE_V3_HTTP_TRACER_PROTO_UPB_H_
-
-#include "upb/msg.h"
-#include "upb/decode.h"
-#include "upb/encode.h"
-
-#include "upb/port_def.inc"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct envoy_config_trace_v3_Tracing;
-struct envoy_config_trace_v3_Tracing_Http;
-typedef struct envoy_config_trace_v3_Tracing envoy_config_trace_v3_Tracing;
-typedef struct envoy_config_trace_v3_Tracing_Http envoy_config_trace_v3_Tracing_Http;
-extern const upb_msglayout envoy_config_trace_v3_Tracing_msginit;
-extern const upb_msglayout envoy_config_trace_v3_Tracing_Http_msginit;
-struct google_protobuf_Any;
-extern const upb_msglayout google_protobuf_Any_msginit;
-
-
-/* envoy.config.trace.v3.Tracing */
-
-UPB_INLINE envoy_config_trace_v3_Tracing *envoy_config_trace_v3_Tracing_new(upb_arena *arena) {
- return (envoy_config_trace_v3_Tracing *)_upb_msg_new(&envoy_config_trace_v3_Tracing_msginit, arena);
-}
-UPB_INLINE envoy_config_trace_v3_Tracing *envoy_config_trace_v3_Tracing_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_trace_v3_Tracing *ret = envoy_config_trace_v3_Tracing_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_trace_v3_Tracing_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_trace_v3_Tracing_serialize(const envoy_config_trace_v3_Tracing *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_trace_v3_Tracing_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_config_trace_v3_Tracing_has_http(const envoy_config_trace_v3_Tracing *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE const envoy_config_trace_v3_Tracing_Http* envoy_config_trace_v3_Tracing_http(const envoy_config_trace_v3_Tracing *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const envoy_config_trace_v3_Tracing_Http*); }
-
-UPB_INLINE void envoy_config_trace_v3_Tracing_set_http(envoy_config_trace_v3_Tracing *msg, envoy_config_trace_v3_Tracing_Http* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), envoy_config_trace_v3_Tracing_Http*) = value;
-}
-UPB_INLINE struct envoy_config_trace_v3_Tracing_Http* envoy_config_trace_v3_Tracing_mutable_http(envoy_config_trace_v3_Tracing *msg, upb_arena *arena) {
- struct envoy_config_trace_v3_Tracing_Http* sub = (struct envoy_config_trace_v3_Tracing_Http*)envoy_config_trace_v3_Tracing_http(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_trace_v3_Tracing_Http*)_upb_msg_new(&envoy_config_trace_v3_Tracing_Http_msginit, arena);
- if (!sub) return NULL;
- envoy_config_trace_v3_Tracing_set_http(msg, sub);
- }
- return sub;
-}
-
-/* envoy.config.trace.v3.Tracing.Http */
-
-UPB_INLINE envoy_config_trace_v3_Tracing_Http *envoy_config_trace_v3_Tracing_Http_new(upb_arena *arena) {
- return (envoy_config_trace_v3_Tracing_Http *)_upb_msg_new(&envoy_config_trace_v3_Tracing_Http_msginit, arena);
-}
-UPB_INLINE envoy_config_trace_v3_Tracing_Http *envoy_config_trace_v3_Tracing_Http_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_trace_v3_Tracing_Http *ret = envoy_config_trace_v3_Tracing_Http_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_trace_v3_Tracing_Http_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_trace_v3_Tracing_Http_serialize(const envoy_config_trace_v3_Tracing_Http *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_trace_v3_Tracing_Http_msginit, arena, len);
-}
-
-typedef enum {
- envoy_config_trace_v3_Tracing_Http_config_type_typed_config = 3,
- envoy_config_trace_v3_Tracing_Http_config_type_NOT_SET = 0
-} envoy_config_trace_v3_Tracing_Http_config_type_oneofcases;
-UPB_INLINE envoy_config_trace_v3_Tracing_Http_config_type_oneofcases envoy_config_trace_v3_Tracing_Http_config_type_case(const envoy_config_trace_v3_Tracing_Http* msg) { return (envoy_config_trace_v3_Tracing_Http_config_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(12, 24), int32_t); }
-
-UPB_INLINE upb_strview envoy_config_trace_v3_Tracing_Http_name(const envoy_config_trace_v3_Tracing_Http *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE bool envoy_config_trace_v3_Tracing_Http_has_typed_config(const envoy_config_trace_v3_Tracing_Http *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 3; }
-UPB_INLINE const struct google_protobuf_Any* envoy_config_trace_v3_Tracing_Http_typed_config(const envoy_config_trace_v3_Tracing_Http *msg) { return UPB_READ_ONEOF(msg, const struct google_protobuf_Any*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 3, NULL); }
-
-UPB_INLINE void envoy_config_trace_v3_Tracing_Http_set_name(envoy_config_trace_v3_Tracing_Http *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_trace_v3_Tracing_Http_set_typed_config(envoy_config_trace_v3_Tracing_Http *msg, struct google_protobuf_Any* value) {
- UPB_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 3);
-}
-UPB_INLINE struct google_protobuf_Any* envoy_config_trace_v3_Tracing_Http_mutable_typed_config(envoy_config_trace_v3_Tracing_Http *msg, upb_arena *arena) {
- struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_config_trace_v3_Tracing_Http_typed_config(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena);
- if (!sub) return NULL;
- envoy_config_trace_v3_Tracing_Http_set_typed_config(msg, sub);
- }
- return sub;
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* ENVOY_CONFIG_TRACE_V3_HTTP_TRACER_PROTO_UPB_H_ */
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/trace/v3/http_tracer.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_CONFIG_TRACE_V3_HTTP_TRACER_PROTO_UPB_H_
+#define ENVOY_CONFIG_TRACE_V3_HTTP_TRACER_PROTO_UPB_H_
+
+#include "upb/msg.h"
+#include "upb/decode.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_config_trace_v3_Tracing;
+struct envoy_config_trace_v3_Tracing_Http;
+typedef struct envoy_config_trace_v3_Tracing envoy_config_trace_v3_Tracing;
+typedef struct envoy_config_trace_v3_Tracing_Http envoy_config_trace_v3_Tracing_Http;
+extern const upb_msglayout envoy_config_trace_v3_Tracing_msginit;
+extern const upb_msglayout envoy_config_trace_v3_Tracing_Http_msginit;
+struct google_protobuf_Any;
+extern const upb_msglayout google_protobuf_Any_msginit;
+
+
+/* envoy.config.trace.v3.Tracing */
+
+UPB_INLINE envoy_config_trace_v3_Tracing *envoy_config_trace_v3_Tracing_new(upb_arena *arena) {
+ return (envoy_config_trace_v3_Tracing *)_upb_msg_new(&envoy_config_trace_v3_Tracing_msginit, arena);
+}
+UPB_INLINE envoy_config_trace_v3_Tracing *envoy_config_trace_v3_Tracing_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_trace_v3_Tracing *ret = envoy_config_trace_v3_Tracing_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_trace_v3_Tracing_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_trace_v3_Tracing_serialize(const envoy_config_trace_v3_Tracing *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_trace_v3_Tracing_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_trace_v3_Tracing_has_http(const envoy_config_trace_v3_Tracing *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE const envoy_config_trace_v3_Tracing_Http* envoy_config_trace_v3_Tracing_http(const envoy_config_trace_v3_Tracing *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const envoy_config_trace_v3_Tracing_Http*); }
+
+UPB_INLINE void envoy_config_trace_v3_Tracing_set_http(envoy_config_trace_v3_Tracing *msg, envoy_config_trace_v3_Tracing_Http* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), envoy_config_trace_v3_Tracing_Http*) = value;
+}
+UPB_INLINE struct envoy_config_trace_v3_Tracing_Http* envoy_config_trace_v3_Tracing_mutable_http(envoy_config_trace_v3_Tracing *msg, upb_arena *arena) {
+ struct envoy_config_trace_v3_Tracing_Http* sub = (struct envoy_config_trace_v3_Tracing_Http*)envoy_config_trace_v3_Tracing_http(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_trace_v3_Tracing_Http*)_upb_msg_new(&envoy_config_trace_v3_Tracing_Http_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_trace_v3_Tracing_set_http(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.trace.v3.Tracing.Http */
+
+UPB_INLINE envoy_config_trace_v3_Tracing_Http *envoy_config_trace_v3_Tracing_Http_new(upb_arena *arena) {
+ return (envoy_config_trace_v3_Tracing_Http *)_upb_msg_new(&envoy_config_trace_v3_Tracing_Http_msginit, arena);
+}
+UPB_INLINE envoy_config_trace_v3_Tracing_Http *envoy_config_trace_v3_Tracing_Http_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_trace_v3_Tracing_Http *ret = envoy_config_trace_v3_Tracing_Http_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_config_trace_v3_Tracing_Http_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_config_trace_v3_Tracing_Http_serialize(const envoy_config_trace_v3_Tracing_Http *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_trace_v3_Tracing_Http_msginit, arena, len);
+}
+
+typedef enum {
+ envoy_config_trace_v3_Tracing_Http_config_type_typed_config = 3,
+ envoy_config_trace_v3_Tracing_Http_config_type_NOT_SET = 0
+} envoy_config_trace_v3_Tracing_Http_config_type_oneofcases;
+UPB_INLINE envoy_config_trace_v3_Tracing_Http_config_type_oneofcases envoy_config_trace_v3_Tracing_Http_config_type_case(const envoy_config_trace_v3_Tracing_Http* msg) { return (envoy_config_trace_v3_Tracing_Http_config_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(12, 24), int32_t); }
+
+UPB_INLINE upb_strview envoy_config_trace_v3_Tracing_Http_name(const envoy_config_trace_v3_Tracing_Http *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE bool envoy_config_trace_v3_Tracing_Http_has_typed_config(const envoy_config_trace_v3_Tracing_Http *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 3; }
+UPB_INLINE const struct google_protobuf_Any* envoy_config_trace_v3_Tracing_Http_typed_config(const envoy_config_trace_v3_Tracing_Http *msg) { return UPB_READ_ONEOF(msg, const struct google_protobuf_Any*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 3, NULL); }
+
+UPB_INLINE void envoy_config_trace_v3_Tracing_Http_set_name(envoy_config_trace_v3_Tracing_Http *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_trace_v3_Tracing_Http_set_typed_config(envoy_config_trace_v3_Tracing_Http *msg, struct google_protobuf_Any* value) {
+ UPB_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 3);
+}
+UPB_INLINE struct google_protobuf_Any* envoy_config_trace_v3_Tracing_Http_mutable_typed_config(envoy_config_trace_v3_Tracing_Http *msg, upb_arena *arena) {
+ struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_config_trace_v3_Tracing_Http_typed_config(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_trace_v3_Tracing_Http_set_typed_config(msg, sub);
+ }
+ return sub;
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_CONFIG_TRACE_V3_HTTP_TRACER_PROTO_UPB_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c
index 95d0bd760cb..2adecb7a830 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c
@@ -1,364 +1,364 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include <stddef.h>
-#include "upb/msg.h"
-#include "envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h"
-#include "envoy/config/accesslog/v3/accesslog.upb.h"
-#include "envoy/config/core/v3/base.upb.h"
-#include "envoy/config/core/v3/config_source.upb.h"
-#include "envoy/config/core/v3/extension.upb.h"
-#include "envoy/config/core/v3/protocol.upb.h"
-#include "envoy/config/core/v3/substitution_format_string.upb.h"
-#include "envoy/config/route/v3/route.upb.h"
-#include "envoy/config/route/v3/scoped_route.upb.h"
-#include "envoy/config/trace/v3/http_tracer.upb.h"
-#include "envoy/type/tracing/v3/custom_tag.upb.h"
-#include "envoy/type/v3/percent.upb.h"
-#include "google/protobuf/any.upb.h"
-#include "google/protobuf/duration.upb.h"
-#include "google/protobuf/struct.upb.h"
-#include "google/protobuf/wrappers.upb.h"
-#include "udpa/core/v1/resource_locator.upb.h"
-#include "envoy/annotations/deprecation.upb.h"
-#include "udpa/annotations/migrate.upb.h"
-#include "udpa/annotations/security.upb.h"
-#include "udpa/annotations/status.upb.h"
-#include "udpa/annotations/versioning.upb.h"
-#include "validate/validate.upb.h"
-
-#include "upb/port_def.inc"
-
-static const upb_msglayout *const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_submsgs[24] = {
- &envoy_config_accesslog_v3_AccessLog_msginit,
- &envoy_config_core_v3_Http1ProtocolOptions_msginit,
- &envoy_config_core_v3_Http2ProtocolOptions_msginit,
- &envoy_config_core_v3_HttpProtocolOptions_msginit,
- &envoy_config_route_v3_RouteConfiguration_msginit,
- &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_msginit,
- &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_msginit,
- &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_msginit,
- &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_msginit,
- &envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_msginit,
- &envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_msginit,
- &envoy_extensions_filters_network_http_connection_manager_v3_Rds_msginit,
- &envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_msginit,
- &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_msginit,
- &google_protobuf_BoolValue_msginit,
- &google_protobuf_Duration_msginit,
- &google_protobuf_UInt32Value_msginit,
-};
-
-static const upb_msglayout_field envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager__fields[38] = {
- {1, UPB_SIZE(0, 0), 0, 0, 14, 1},
- {2, UPB_SIZE(36, 40), 0, 0, 9, 1},
- {3, UPB_SIZE(144, 256), UPB_SIZE(-149, -265), 11, 11, 1},
- {4, UPB_SIZE(144, 256), UPB_SIZE(-149, -265), 4, 11, 1},
- {5, UPB_SIZE(132, 232), 0, 9, 11, 3},
- {6, UPB_SIZE(60, 88), 0, 14, 11, 1},
- {7, UPB_SIZE(64, 96), 0, 7, 11, 1},
- {8, UPB_SIZE(68, 104), 0, 1, 11, 1},
- {9, UPB_SIZE(72, 112), 0, 2, 11, 1},
- {10, UPB_SIZE(44, 56), 0, 0, 9, 1},
- {12, UPB_SIZE(76, 120), 0, 15, 11, 1},
- {13, UPB_SIZE(136, 240), 0, 0, 11, 3},
- {14, UPB_SIZE(80, 128), 0, 14, 11, 1},
- {15, UPB_SIZE(84, 136), 0, 14, 11, 1},
- {16, UPB_SIZE(8, 8), 0, 0, 14, 1},
- {17, UPB_SIZE(88, 144), 0, 6, 11, 1},
- {18, UPB_SIZE(28, 28), 0, 0, 8, 1},
- {19, UPB_SIZE(24, 24), 0, 0, 13, 1},
- {20, UPB_SIZE(29, 29), 0, 0, 8, 1},
- {21, UPB_SIZE(30, 30), 0, 0, 8, 1},
- {22, UPB_SIZE(52, 72), 0, 0, 9, 1},
- {23, UPB_SIZE(140, 248), 0, 8, 11, 3},
- {24, UPB_SIZE(92, 152), 0, 15, 11, 1},
- {25, UPB_SIZE(96, 160), 0, 5, 11, 1},
- {26, UPB_SIZE(100, 168), 0, 15, 11, 1},
- {28, UPB_SIZE(104, 176), 0, 15, 11, 1},
- {29, UPB_SIZE(108, 184), 0, 16, 11, 1},
- {30, UPB_SIZE(112, 192), 0, 14, 11, 1},
- {31, UPB_SIZE(144, 256), UPB_SIZE(-149, -265), 13, 11, 1},
- {32, UPB_SIZE(31, 31), 0, 0, 8, 1},
- {33, UPB_SIZE(32, 32), 0, 0, 8, 1},
- {34, UPB_SIZE(16, 16), 0, 0, 14, 1},
- {35, UPB_SIZE(116, 200), 0, 3, 11, 1},
- {36, UPB_SIZE(120, 208), 0, 12, 11, 1},
- {37, UPB_SIZE(33, 33), 0, 0, 8, 1},
- {38, UPB_SIZE(124, 216), 0, 10, 11, 1},
- {39, UPB_SIZE(34, 34), 0, 0, 8, 1},
- {40, UPB_SIZE(128, 224), 0, 14, 11, 1},
-};
-
-const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_msginit = {
- &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_submsgs[0],
- &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager__fields[0],
- UPB_SIZE(152, 272), 38, false,
-};
-
-static const upb_msglayout *const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_submsgs[6] = {
- &envoy_config_trace_v3_Tracing_Http_msginit,
- &envoy_type_tracing_v3_CustomTag_msginit,
- &envoy_type_v3_Percent_msginit,
- &google_protobuf_UInt32Value_msginit,
-};
-
-static const upb_msglayout_field envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing__fields[7] = {
- {3, UPB_SIZE(4, 8), 0, 2, 11, 1},
- {4, UPB_SIZE(8, 16), 0, 2, 11, 1},
- {5, UPB_SIZE(12, 24), 0, 2, 11, 1},
- {6, UPB_SIZE(0, 0), 0, 0, 8, 1},
- {7, UPB_SIZE(16, 32), 0, 3, 11, 1},
- {8, UPB_SIZE(24, 48), 0, 1, 11, 3},
- {9, UPB_SIZE(20, 40), 0, 0, 11, 1},
-};
-
-const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_msginit = {
- &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_submsgs[0],
- &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing__fields[0],
- UPB_SIZE(28, 56), 7, false,
-};
-
-static const upb_msglayout_field envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 8, 1},
-};
-
-const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_msginit = {
- NULL,
- &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig__fields[0],
- UPB_SIZE(1, 1), 1, false,
-};
-
-static const upb_msglayout *const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_submsgs[1] = {
- &google_protobuf_BoolValue_msginit,
-};
-
-static const upb_msglayout_field envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails__fields[5] = {
- {1, UPB_SIZE(4, 8), 0, 0, 11, 1},
- {3, UPB_SIZE(0, 0), 0, 0, 8, 1},
- {4, UPB_SIZE(1, 1), 0, 0, 8, 1},
- {5, UPB_SIZE(2, 2), 0, 0, 8, 1},
- {6, UPB_SIZE(3, 3), 0, 0, 8, 1},
-};
-
-const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_msginit = {
- &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_submsgs[0],
- &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails__fields[0],
- UPB_SIZE(8, 16), 5, false,
-};
-
-static const upb_msglayout *const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_submsgs[2] = {
- &envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_msginit,
- &google_protobuf_BoolValue_msginit,
-};
-
-static const upb_msglayout_field envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig__fields[3] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(12, 24), 0, 0, 11, 3},
- {3, UPB_SIZE(8, 16), 0, 1, 11, 1},
-};
-
-const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_msginit = {
- &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_submsgs[0],
- &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig__fields[0],
- UPB_SIZE(16, 32), 3, false,
-};
-
-static const upb_msglayout *const envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_submsgs[2] = {
- &envoy_config_core_v3_SubstitutionFormatString_msginit,
- &envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_msginit,
-};
-
-static const upb_msglayout_field envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig__fields[2] = {
- {1, UPB_SIZE(4, 8), 0, 1, 11, 3},
- {2, UPB_SIZE(0, 0), 0, 0, 11, 1},
-};
-
-const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_msginit = {
- &envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_submsgs[0],
- &envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig__fields[0],
- UPB_SIZE(8, 16), 2, false,
-};
-
-static const upb_msglayout *const envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_submsgs[5] = {
- &envoy_config_accesslog_v3_AccessLogFilter_msginit,
- &envoy_config_core_v3_DataSource_msginit,
- &envoy_config_core_v3_HeaderValueOption_msginit,
- &envoy_config_core_v3_SubstitutionFormatString_msginit,
- &google_protobuf_UInt32Value_msginit,
-};
-
-static const upb_msglayout_field envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper__fields[5] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
- {2, UPB_SIZE(4, 8), 0, 4, 11, 1},
- {3, UPB_SIZE(8, 16), 0, 1, 11, 1},
- {4, UPB_SIZE(12, 24), 0, 3, 11, 1},
- {5, UPB_SIZE(16, 32), 0, 2, 11, 3},
-};
-
-const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_msginit = {
- &envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_submsgs[0],
- &envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper__fields[0],
- UPB_SIZE(20, 40), 5, false,
-};
-
-static const upb_msglayout *const envoy_extensions_filters_network_http_connection_manager_v3_Rds_submsgs[2] = {
- &envoy_config_core_v3_ConfigSource_msginit,
- &udpa_core_v1_ResourceLocator_msginit,
-};
-
-static const upb_msglayout_field envoy_extensions_filters_network_http_connection_manager_v3_Rds__fields[3] = {
- {1, UPB_SIZE(8, 16), 0, 0, 11, 1},
- {2, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {3, UPB_SIZE(12, 24), 0, 1, 11, 1},
-};
-
-const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_Rds_msginit = {
- &envoy_extensions_filters_network_http_connection_manager_v3_Rds_submsgs[0],
- &envoy_extensions_filters_network_http_connection_manager_v3_Rds__fields[0],
- UPB_SIZE(16, 32), 3, false,
-};
-
-static const upb_msglayout *const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_submsgs[1] = {
- &envoy_config_route_v3_ScopedRouteConfiguration_msginit,
-};
-
-static const upb_msglayout_field envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 3},
-};
-
-const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_msginit = {
- &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_submsgs[0],
- &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList__fields[0],
- UPB_SIZE(4, 8), 1, false,
-};
-
-static const upb_msglayout *const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_submsgs[4] = {
- &envoy_config_core_v3_ConfigSource_msginit,
- &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_msginit,
- &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_msginit,
- &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_msginit,
-};
-
-static const upb_msglayout_field envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes__fields[5] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 3, 11, 1},
- {3, UPB_SIZE(12, 24), 0, 0, 11, 1},
- {4, UPB_SIZE(16, 32), UPB_SIZE(-21, -41), 2, 11, 1},
- {5, UPB_SIZE(16, 32), UPB_SIZE(-21, -41), 1, 11, 1},
-};
-
-const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_msginit = {
- &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_submsgs[0],
- &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes__fields[0],
- UPB_SIZE(24, 48), 5, false,
-};
-
-static const upb_msglayout *const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_submsgs[1] = {
- &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_msginit,
-};
-
-static const upb_msglayout_field envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 3},
-};
-
-const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_msginit = {
- &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_submsgs[0],
- &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder__fields[0],
- UPB_SIZE(4, 8), 1, false,
-};
-
-static const upb_msglayout *const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_submsgs[1] = {
- &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_msginit,
-};
-
-static const upb_msglayout_field envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder__fields[1] = {
- {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, 1},
-};
-
-const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_msginit = {
- &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_submsgs[0],
- &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder__fields[0],
- UPB_SIZE(8, 16), 1, false,
-};
-
-static const upb_msglayout *const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_submsgs[1] = {
- &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_msginit,
-};
-
-static const upb_msglayout_field envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor__fields[4] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 9, 1},
- {3, UPB_SIZE(16, 32), UPB_SIZE(-21, -41), 0, 13, 1},
- {4, UPB_SIZE(16, 32), UPB_SIZE(-21, -41), 0, 11, 1},
-};
-
-const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_msginit = {
- &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_submsgs[0],
- &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor__fields[0],
- UPB_SIZE(24, 48), 4, false,
-};
-
-static const upb_msglayout_field envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 9, 1},
-};
-
-const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_msginit = {
- NULL,
- &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement__fields[0],
- UPB_SIZE(16, 32), 2, false,
-};
-
-static const upb_msglayout *const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_submsgs[1] = {
- &envoy_config_core_v3_ConfigSource_msginit,
-};
-
-static const upb_msglayout_field envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
-};
-
-const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_msginit = {
- &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_submsgs[0],
- &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds__fields[0],
- UPB_SIZE(4, 8), 1, false,
-};
-
-static const upb_msglayout *const envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_submsgs[2] = {
- &envoy_config_core_v3_ExtensionConfigSource_msginit,
- &google_protobuf_Any_msginit,
-};
-
-static const upb_msglayout_field envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter__fields[3] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {4, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 1, 11, 1},
- {5, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, 1},
-};
-
-const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_msginit = {
- &envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_submsgs[0],
- &envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter__fields[0],
- UPB_SIZE(16, 32), 3, false,
-};
-
-static const upb_msglayout *const envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_submsgs[1] = {
- &google_protobuf_Any_msginit,
-};
-
-static const upb_msglayout_field envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
-};
-
-const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_msginit = {
- &envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_submsgs[0],
- &envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension__fields[0],
- UPB_SIZE(4, 8), 1, false,
-};
-
-#include "upb/port_undef.inc"
-
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg.h"
+#include "envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h"
+#include "envoy/config/accesslog/v3/accesslog.upb.h"
+#include "envoy/config/core/v3/base.upb.h"
+#include "envoy/config/core/v3/config_source.upb.h"
+#include "envoy/config/core/v3/extension.upb.h"
+#include "envoy/config/core/v3/protocol.upb.h"
+#include "envoy/config/core/v3/substitution_format_string.upb.h"
+#include "envoy/config/route/v3/route.upb.h"
+#include "envoy/config/route/v3/scoped_route.upb.h"
+#include "envoy/config/trace/v3/http_tracer.upb.h"
+#include "envoy/type/tracing/v3/custom_tag.upb.h"
+#include "envoy/type/v3/percent.upb.h"
+#include "google/protobuf/any.upb.h"
+#include "google/protobuf/duration.upb.h"
+#include "google/protobuf/struct.upb.h"
+#include "google/protobuf/wrappers.upb.h"
+#include "udpa/core/v1/resource_locator.upb.h"
+#include "envoy/annotations/deprecation.upb.h"
+#include "udpa/annotations/migrate.upb.h"
+#include "udpa/annotations/security.upb.h"
+#include "udpa/annotations/status.upb.h"
+#include "udpa/annotations/versioning.upb.h"
+#include "validate/validate.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_msglayout *const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_submsgs[24] = {
+ &envoy_config_accesslog_v3_AccessLog_msginit,
+ &envoy_config_core_v3_Http1ProtocolOptions_msginit,
+ &envoy_config_core_v3_Http2ProtocolOptions_msginit,
+ &envoy_config_core_v3_HttpProtocolOptions_msginit,
+ &envoy_config_route_v3_RouteConfiguration_msginit,
+ &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_msginit,
+ &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_msginit,
+ &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_msginit,
+ &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_msginit,
+ &envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_msginit,
+ &envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_msginit,
+ &envoy_extensions_filters_network_http_connection_manager_v3_Rds_msginit,
+ &envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_msginit,
+ &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_msginit,
+ &google_protobuf_BoolValue_msginit,
+ &google_protobuf_Duration_msginit,
+ &google_protobuf_UInt32Value_msginit,
+};
+
+static const upb_msglayout_field envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager__fields[38] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 14, 1},
+ {2, UPB_SIZE(36, 40), 0, 0, 9, 1},
+ {3, UPB_SIZE(144, 256), UPB_SIZE(-149, -265), 11, 11, 1},
+ {4, UPB_SIZE(144, 256), UPB_SIZE(-149, -265), 4, 11, 1},
+ {5, UPB_SIZE(132, 232), 0, 9, 11, 3},
+ {6, UPB_SIZE(60, 88), 0, 14, 11, 1},
+ {7, UPB_SIZE(64, 96), 0, 7, 11, 1},
+ {8, UPB_SIZE(68, 104), 0, 1, 11, 1},
+ {9, UPB_SIZE(72, 112), 0, 2, 11, 1},
+ {10, UPB_SIZE(44, 56), 0, 0, 9, 1},
+ {12, UPB_SIZE(76, 120), 0, 15, 11, 1},
+ {13, UPB_SIZE(136, 240), 0, 0, 11, 3},
+ {14, UPB_SIZE(80, 128), 0, 14, 11, 1},
+ {15, UPB_SIZE(84, 136), 0, 14, 11, 1},
+ {16, UPB_SIZE(8, 8), 0, 0, 14, 1},
+ {17, UPB_SIZE(88, 144), 0, 6, 11, 1},
+ {18, UPB_SIZE(28, 28), 0, 0, 8, 1},
+ {19, UPB_SIZE(24, 24), 0, 0, 13, 1},
+ {20, UPB_SIZE(29, 29), 0, 0, 8, 1},
+ {21, UPB_SIZE(30, 30), 0, 0, 8, 1},
+ {22, UPB_SIZE(52, 72), 0, 0, 9, 1},
+ {23, UPB_SIZE(140, 248), 0, 8, 11, 3},
+ {24, UPB_SIZE(92, 152), 0, 15, 11, 1},
+ {25, UPB_SIZE(96, 160), 0, 5, 11, 1},
+ {26, UPB_SIZE(100, 168), 0, 15, 11, 1},
+ {28, UPB_SIZE(104, 176), 0, 15, 11, 1},
+ {29, UPB_SIZE(108, 184), 0, 16, 11, 1},
+ {30, UPB_SIZE(112, 192), 0, 14, 11, 1},
+ {31, UPB_SIZE(144, 256), UPB_SIZE(-149, -265), 13, 11, 1},
+ {32, UPB_SIZE(31, 31), 0, 0, 8, 1},
+ {33, UPB_SIZE(32, 32), 0, 0, 8, 1},
+ {34, UPB_SIZE(16, 16), 0, 0, 14, 1},
+ {35, UPB_SIZE(116, 200), 0, 3, 11, 1},
+ {36, UPB_SIZE(120, 208), 0, 12, 11, 1},
+ {37, UPB_SIZE(33, 33), 0, 0, 8, 1},
+ {38, UPB_SIZE(124, 216), 0, 10, 11, 1},
+ {39, UPB_SIZE(34, 34), 0, 0, 8, 1},
+ {40, UPB_SIZE(128, 224), 0, 14, 11, 1},
+};
+
+const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_msginit = {
+ &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_submsgs[0],
+ &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager__fields[0],
+ UPB_SIZE(152, 272), 38, false,
+};
+
+static const upb_msglayout *const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_submsgs[6] = {
+ &envoy_config_trace_v3_Tracing_Http_msginit,
+ &envoy_type_tracing_v3_CustomTag_msginit,
+ &envoy_type_v3_Percent_msginit,
+ &google_protobuf_UInt32Value_msginit,
+};
+
+static const upb_msglayout_field envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing__fields[7] = {
+ {3, UPB_SIZE(4, 8), 0, 2, 11, 1},
+ {4, UPB_SIZE(8, 16), 0, 2, 11, 1},
+ {5, UPB_SIZE(12, 24), 0, 2, 11, 1},
+ {6, UPB_SIZE(0, 0), 0, 0, 8, 1},
+ {7, UPB_SIZE(16, 32), 0, 3, 11, 1},
+ {8, UPB_SIZE(24, 48), 0, 1, 11, 3},
+ {9, UPB_SIZE(20, 40), 0, 0, 11, 1},
+};
+
+const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_msginit = {
+ &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_submsgs[0],
+ &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing__fields[0],
+ UPB_SIZE(28, 56), 7, false,
+};
+
+static const upb_msglayout_field envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig__fields[1] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 8, 1},
+};
+
+const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_msginit = {
+ NULL,
+ &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig__fields[0],
+ UPB_SIZE(1, 1), 1, false,
+};
+
+static const upb_msglayout *const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_submsgs[1] = {
+ &google_protobuf_BoolValue_msginit,
+};
+
+static const upb_msglayout_field envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails__fields[5] = {
+ {1, UPB_SIZE(4, 8), 0, 0, 11, 1},
+ {3, UPB_SIZE(0, 0), 0, 0, 8, 1},
+ {4, UPB_SIZE(1, 1), 0, 0, 8, 1},
+ {5, UPB_SIZE(2, 2), 0, 0, 8, 1},
+ {6, UPB_SIZE(3, 3), 0, 0, 8, 1},
+};
+
+const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_msginit = {
+ &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_submsgs[0],
+ &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails__fields[0],
+ UPB_SIZE(8, 16), 5, false,
+};
+
+static const upb_msglayout *const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_submsgs[2] = {
+ &envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_msginit,
+ &google_protobuf_BoolValue_msginit,
+};
+
+static const upb_msglayout_field envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig__fields[3] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {2, UPB_SIZE(12, 24), 0, 0, 11, 3},
+ {3, UPB_SIZE(8, 16), 0, 1, 11, 1},
+};
+
+const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_msginit = {
+ &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_submsgs[0],
+ &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig__fields[0],
+ UPB_SIZE(16, 32), 3, false,
+};
+
+static const upb_msglayout *const envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_submsgs[2] = {
+ &envoy_config_core_v3_SubstitutionFormatString_msginit,
+ &envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_msginit,
+};
+
+static const upb_msglayout_field envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig__fields[2] = {
+ {1, UPB_SIZE(4, 8), 0, 1, 11, 3},
+ {2, UPB_SIZE(0, 0), 0, 0, 11, 1},
+};
+
+const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_msginit = {
+ &envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_submsgs[0],
+ &envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig__fields[0],
+ UPB_SIZE(8, 16), 2, false,
+};
+
+static const upb_msglayout *const envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_submsgs[5] = {
+ &envoy_config_accesslog_v3_AccessLogFilter_msginit,
+ &envoy_config_core_v3_DataSource_msginit,
+ &envoy_config_core_v3_HeaderValueOption_msginit,
+ &envoy_config_core_v3_SubstitutionFormatString_msginit,
+ &google_protobuf_UInt32Value_msginit,
+};
+
+static const upb_msglayout_field envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper__fields[5] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
+ {2, UPB_SIZE(4, 8), 0, 4, 11, 1},
+ {3, UPB_SIZE(8, 16), 0, 1, 11, 1},
+ {4, UPB_SIZE(12, 24), 0, 3, 11, 1},
+ {5, UPB_SIZE(16, 32), 0, 2, 11, 3},
+};
+
+const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_msginit = {
+ &envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_submsgs[0],
+ &envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper__fields[0],
+ UPB_SIZE(20, 40), 5, false,
+};
+
+static const upb_msglayout *const envoy_extensions_filters_network_http_connection_manager_v3_Rds_submsgs[2] = {
+ &envoy_config_core_v3_ConfigSource_msginit,
+ &udpa_core_v1_ResourceLocator_msginit,
+};
+
+static const upb_msglayout_field envoy_extensions_filters_network_http_connection_manager_v3_Rds__fields[3] = {
+ {1, UPB_SIZE(8, 16), 0, 0, 11, 1},
+ {2, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {3, UPB_SIZE(12, 24), 0, 1, 11, 1},
+};
+
+const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_Rds_msginit = {
+ &envoy_extensions_filters_network_http_connection_manager_v3_Rds_submsgs[0],
+ &envoy_extensions_filters_network_http_connection_manager_v3_Rds__fields[0],
+ UPB_SIZE(16, 32), 3, false,
+};
+
+static const upb_msglayout *const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_submsgs[1] = {
+ &envoy_config_route_v3_ScopedRouteConfiguration_msginit,
+};
+
+static const upb_msglayout_field envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList__fields[1] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 11, 3},
+};
+
+const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_msginit = {
+ &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_submsgs[0],
+ &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList__fields[0],
+ UPB_SIZE(4, 8), 1, false,
+};
+
+static const upb_msglayout *const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_submsgs[4] = {
+ &envoy_config_core_v3_ConfigSource_msginit,
+ &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_msginit,
+ &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_msginit,
+ &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_msginit,
+};
+
+static const upb_msglayout_field envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes__fields[5] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {2, UPB_SIZE(8, 16), 0, 3, 11, 1},
+ {3, UPB_SIZE(12, 24), 0, 0, 11, 1},
+ {4, UPB_SIZE(16, 32), UPB_SIZE(-21, -41), 2, 11, 1},
+ {5, UPB_SIZE(16, 32), UPB_SIZE(-21, -41), 1, 11, 1},
+};
+
+const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_msginit = {
+ &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_submsgs[0],
+ &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes__fields[0],
+ UPB_SIZE(24, 48), 5, false,
+};
+
+static const upb_msglayout *const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_submsgs[1] = {
+ &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_msginit,
+};
+
+static const upb_msglayout_field envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder__fields[1] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 11, 3},
+};
+
+const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_msginit = {
+ &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_submsgs[0],
+ &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder__fields[0],
+ UPB_SIZE(4, 8), 1, false,
+};
+
+static const upb_msglayout *const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_submsgs[1] = {
+ &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_msginit,
+};
+
+static const upb_msglayout_field envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, 1},
+};
+
+const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_msginit = {
+ &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_submsgs[0],
+ &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder__fields[0],
+ UPB_SIZE(8, 16), 1, false,
+};
+
+static const upb_msglayout *const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_submsgs[1] = {
+ &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_msginit,
+};
+
+static const upb_msglayout_field envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor__fields[4] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {2, UPB_SIZE(8, 16), 0, 0, 9, 1},
+ {3, UPB_SIZE(16, 32), UPB_SIZE(-21, -41), 0, 13, 1},
+ {4, UPB_SIZE(16, 32), UPB_SIZE(-21, -41), 0, 11, 1},
+};
+
+const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_msginit = {
+ &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_submsgs[0],
+ &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor__fields[0],
+ UPB_SIZE(24, 48), 4, false,
+};
+
+static const upb_msglayout_field envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {2, UPB_SIZE(8, 16), 0, 0, 9, 1},
+};
+
+const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_msginit = {
+ NULL,
+ &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement__fields[0],
+ UPB_SIZE(16, 32), 2, false,
+};
+
+static const upb_msglayout *const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_submsgs[1] = {
+ &envoy_config_core_v3_ConfigSource_msginit,
+};
+
+static const upb_msglayout_field envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds__fields[1] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
+};
+
+const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_msginit = {
+ &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_submsgs[0],
+ &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds__fields[0],
+ UPB_SIZE(4, 8), 1, false,
+};
+
+static const upb_msglayout *const envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_submsgs[2] = {
+ &envoy_config_core_v3_ExtensionConfigSource_msginit,
+ &google_protobuf_Any_msginit,
+};
+
+static const upb_msglayout_field envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter__fields[3] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {4, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 1, 11, 1},
+ {5, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, 1},
+};
+
+const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_msginit = {
+ &envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_submsgs[0],
+ &envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter__fields[0],
+ UPB_SIZE(16, 32), 3, false,
+};
+
+static const upb_msglayout *const envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_submsgs[1] = {
+ &google_protobuf_Any_msginit,
+};
+
+static const upb_msglayout_field envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension__fields[1] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
+};
+
+const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_msginit = {
+ &envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_submsgs[0],
+ &envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension__fields[0],
+ UPB_SIZE(4, 8), 1, false,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h
index 95339c45ce0..87005ae05b9 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h
@@ -1,1336 +1,1336 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef ENVOY_EXTENSIONS_FILTERS_NETWORK_HTTP_CONNECTION_MANAGER_V3_HTTP_CONNECTION_MANAGER_PROTO_UPB_H_
-#define ENVOY_EXTENSIONS_FILTERS_NETWORK_HTTP_CONNECTION_MANAGER_V3_HTTP_CONNECTION_MANAGER_PROTO_UPB_H_
-
-#include "upb/msg.h"
-#include "upb/decode.h"
-#include "upb/encode.h"
-
-#include "upb/port_def.inc"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager;
-struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing;
-struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig;
-struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails;
-struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig;
-struct envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig;
-struct envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper;
-struct envoy_extensions_filters_network_http_connection_manager_v3_Rds;
-struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList;
-struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes;
-struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder;
-struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder;
-struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor;
-struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement;
-struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds;
-struct envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter;
-struct envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension;
-typedef struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager;
-typedef struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing;
-typedef struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig;
-typedef struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails;
-typedef struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig;
-typedef struct envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig;
-typedef struct envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper;
-typedef struct envoy_extensions_filters_network_http_connection_manager_v3_Rds envoy_extensions_filters_network_http_connection_manager_v3_Rds;
-typedef struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList;
-typedef struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes;
-typedef struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder;
-typedef struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder;
-typedef struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor;
-typedef struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement;
-typedef struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds;
-typedef struct envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter;
-typedef struct envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension;
-extern const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_msginit;
-extern const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_msginit;
-extern const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_msginit;
-extern const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_msginit;
-extern const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_msginit;
-extern const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_msginit;
-extern const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_msginit;
-extern const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_Rds_msginit;
-extern const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_msginit;
-extern const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_msginit;
-extern const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_msginit;
-extern const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_msginit;
-extern const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_msginit;
-extern const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_msginit;
-extern const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_msginit;
-extern const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_msginit;
-extern const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_msginit;
-struct envoy_config_accesslog_v3_AccessLog;
-struct envoy_config_accesslog_v3_AccessLogFilter;
-struct envoy_config_core_v3_ConfigSource;
-struct envoy_config_core_v3_DataSource;
-struct envoy_config_core_v3_ExtensionConfigSource;
-struct envoy_config_core_v3_HeaderValueOption;
-struct envoy_config_core_v3_Http1ProtocolOptions;
-struct envoy_config_core_v3_Http2ProtocolOptions;
-struct envoy_config_core_v3_HttpProtocolOptions;
-struct envoy_config_core_v3_SubstitutionFormatString;
-struct envoy_config_route_v3_RouteConfiguration;
-struct envoy_config_route_v3_ScopedRouteConfiguration;
-struct envoy_config_trace_v3_Tracing_Http;
-struct envoy_type_tracing_v3_CustomTag;
-struct envoy_type_v3_Percent;
-struct google_protobuf_Any;
-struct google_protobuf_BoolValue;
-struct google_protobuf_Duration;
-struct google_protobuf_UInt32Value;
-struct udpa_core_v1_ResourceLocator;
-extern const upb_msglayout envoy_config_accesslog_v3_AccessLog_msginit;
-extern const upb_msglayout envoy_config_accesslog_v3_AccessLogFilter_msginit;
-extern const upb_msglayout envoy_config_core_v3_ConfigSource_msginit;
-extern const upb_msglayout envoy_config_core_v3_DataSource_msginit;
-extern const upb_msglayout envoy_config_core_v3_ExtensionConfigSource_msginit;
-extern const upb_msglayout envoy_config_core_v3_HeaderValueOption_msginit;
-extern const upb_msglayout envoy_config_core_v3_Http1ProtocolOptions_msginit;
-extern const upb_msglayout envoy_config_core_v3_Http2ProtocolOptions_msginit;
-extern const upb_msglayout envoy_config_core_v3_HttpProtocolOptions_msginit;
-extern const upb_msglayout envoy_config_core_v3_SubstitutionFormatString_msginit;
-extern const upb_msglayout envoy_config_route_v3_RouteConfiguration_msginit;
-extern const upb_msglayout envoy_config_route_v3_ScopedRouteConfiguration_msginit;
-extern const upb_msglayout envoy_config_trace_v3_Tracing_Http_msginit;
-extern const upb_msglayout envoy_type_tracing_v3_CustomTag_msginit;
-extern const upb_msglayout envoy_type_v3_Percent_msginit;
-extern const upb_msglayout google_protobuf_Any_msginit;
-extern const upb_msglayout google_protobuf_BoolValue_msginit;
-extern const upb_msglayout google_protobuf_Duration_msginit;
-extern const upb_msglayout google_protobuf_UInt32Value_msginit;
-extern const upb_msglayout udpa_core_v1_ResourceLocator_msginit;
-
-typedef enum {
- envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_AUTO = 0,
- envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_HTTP1 = 1,
- envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_HTTP2 = 2,
- envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_HTTP3 = 3
-} envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_CodecType;
-
-typedef enum {
- envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SANITIZE = 0,
- envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_FORWARD_ONLY = 1,
- envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_APPEND_FORWARD = 2,
- envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SANITIZE_SET = 3,
- envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ALWAYS_FORWARD_ONLY = 4
-} envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ForwardClientCertDetails;
-
-typedef enum {
- envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_OVERWRITE = 0,
- envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_APPEND_IF_ABSENT = 1,
- envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PASS_THROUGH = 2
-} envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ServerHeaderTransformation;
-
-typedef enum {
- envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_INGRESS = 0,
- envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_EGRESS = 1
-} envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_OperationName;
-
-
-/* envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager */
-
-UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_new(upb_arena *arena) {
- return (envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *)_upb_msg_new(&envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_msginit, arena);
-}
-UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *ret = envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_serialize(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_msginit, arena, len);
-}
-
-typedef enum {
- envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_route_specifier_rds = 3,
- envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_route_specifier_route_config = 4,
- envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_route_specifier_scoped_routes = 31,
- envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_route_specifier_NOT_SET = 0
-} envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_route_specifier_oneofcases;
-UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_route_specifier_oneofcases envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_route_specifier_case(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { return (envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_route_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(148, 264), int32_t); }
-
-UPB_INLINE int32_t envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_codec_type(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
-UPB_INLINE upb_strview envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_stat_prefix(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(36, 40), upb_strview); }
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_rds(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_getoneofcase(msg, UPB_SIZE(148, 264)) == 3; }
-UPB_INLINE const envoy_extensions_filters_network_http_connection_manager_v3_Rds* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_rds(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return UPB_READ_ONEOF(msg, const envoy_extensions_filters_network_http_connection_manager_v3_Rds*, UPB_SIZE(144, 256), UPB_SIZE(148, 264), 3, NULL); }
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_route_config(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_getoneofcase(msg, UPB_SIZE(148, 264)) == 4; }
-UPB_INLINE const struct envoy_config_route_v3_RouteConfiguration* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_route_config(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return UPB_READ_ONEOF(msg, const struct envoy_config_route_v3_RouteConfiguration*, UPB_SIZE(144, 256), UPB_SIZE(148, 264), 4, NULL); }
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_http_filters(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(132, 232)); }
-UPB_INLINE const envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter* const* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_http_filters(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, size_t *len) { return (const envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter* const*)_upb_array_accessor(msg, UPB_SIZE(132, 232), len); }
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_add_user_agent(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(60, 88)); }
-UPB_INLINE const struct google_protobuf_BoolValue* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_add_user_agent(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(60, 88), const struct google_protobuf_BoolValue*); }
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_tracing(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(64, 96)); }
-UPB_INLINE const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_tracing(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(64, 96), const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing*); }
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_http_protocol_options(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(68, 104)); }
-UPB_INLINE const struct envoy_config_core_v3_Http1ProtocolOptions* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_http_protocol_options(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(68, 104), const struct envoy_config_core_v3_Http1ProtocolOptions*); }
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_http2_protocol_options(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(72, 112)); }
-UPB_INLINE const struct envoy_config_core_v3_Http2ProtocolOptions* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_http2_protocol_options(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(72, 112), const struct envoy_config_core_v3_Http2ProtocolOptions*); }
-UPB_INLINE upb_strview envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_server_name(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(44, 56), upb_strview); }
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_drain_timeout(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(76, 120)); }
-UPB_INLINE const struct google_protobuf_Duration* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_drain_timeout(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(76, 120), const struct google_protobuf_Duration*); }
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_access_log(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(136, 240)); }
-UPB_INLINE const struct envoy_config_accesslog_v3_AccessLog* const* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_access_log(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, size_t *len) { return (const struct envoy_config_accesslog_v3_AccessLog* const*)_upb_array_accessor(msg, UPB_SIZE(136, 240), len); }
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_use_remote_address(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(80, 128)); }
-UPB_INLINE const struct google_protobuf_BoolValue* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_use_remote_address(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(80, 128), const struct google_protobuf_BoolValue*); }
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_generate_request_id(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(84, 136)); }
-UPB_INLINE const struct google_protobuf_BoolValue* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_generate_request_id(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(84, 136), const struct google_protobuf_BoolValue*); }
-UPB_INLINE int32_t envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_forward_client_cert_details(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); }
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_set_current_client_cert_details(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(88, 144)); }
-UPB_INLINE const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_current_client_cert_details(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(88, 144), const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails*); }
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_proxy_100_continue(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 28), bool); }
-UPB_INLINE uint32_t envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_xff_num_trusted_hops(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), uint32_t); }
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_represent_ipv4_remote_address_as_ipv4_mapped_ipv6(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(29, 29), bool); }
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_skip_xff_append(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(30, 30), bool); }
-UPB_INLINE upb_strview envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_via(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(52, 72), upb_strview); }
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_upgrade_configs(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(140, 248)); }
-UPB_INLINE const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig* const* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_upgrade_configs(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, size_t *len) { return (const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig* const*)_upb_array_accessor(msg, UPB_SIZE(140, 248), len); }
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_stream_idle_timeout(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(92, 152)); }
-UPB_INLINE const struct google_protobuf_Duration* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_stream_idle_timeout(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(92, 152), const struct google_protobuf_Duration*); }
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_internal_address_config(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(96, 160)); }
-UPB_INLINE const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_internal_address_config(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(96, 160), const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig*); }
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_delayed_close_timeout(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(100, 168)); }
-UPB_INLINE const struct google_protobuf_Duration* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_delayed_close_timeout(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(100, 168), const struct google_protobuf_Duration*); }
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_request_timeout(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(104, 176)); }
-UPB_INLINE const struct google_protobuf_Duration* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_request_timeout(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(104, 176), const struct google_protobuf_Duration*); }
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_max_request_headers_kb(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(108, 184)); }
-UPB_INLINE const struct google_protobuf_UInt32Value* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_max_request_headers_kb(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(108, 184), const struct google_protobuf_UInt32Value*); }
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_normalize_path(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(112, 192)); }
-UPB_INLINE const struct google_protobuf_BoolValue* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_normalize_path(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(112, 192), const struct google_protobuf_BoolValue*); }
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_scoped_routes(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_getoneofcase(msg, UPB_SIZE(148, 264)) == 31; }
-UPB_INLINE const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_scoped_routes(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return UPB_READ_ONEOF(msg, const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes*, UPB_SIZE(144, 256), UPB_SIZE(148, 264), 31, NULL); }
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_preserve_external_request_id(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(31, 31), bool); }
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_merge_slashes(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 32), bool); }
-UPB_INLINE int32_t envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_server_header_transformation(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t); }
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_common_http_protocol_options(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(116, 200)); }
-UPB_INLINE const struct envoy_config_core_v3_HttpProtocolOptions* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_common_http_protocol_options(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(116, 200), const struct envoy_config_core_v3_HttpProtocolOptions*); }
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_request_id_extension(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(120, 208)); }
-UPB_INLINE const envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_request_id_extension(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(120, 208), const envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension*); }
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_always_set_request_id_in_response(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(33, 33), bool); }
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_local_reply_config(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(124, 216)); }
-UPB_INLINE const envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_local_reply_config(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(124, 216), const envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig*); }
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_strip_matching_host_port(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(34, 34), bool); }
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_stream_error_on_invalid_http_message(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(128, 224)); }
-UPB_INLINE const struct google_protobuf_BoolValue* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_stream_error_on_invalid_http_message(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(128, 224), const struct google_protobuf_BoolValue*); }
-
-UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_codec_type(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, int32_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
-}
-UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_stat_prefix(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(36, 40), upb_strview) = value;
-}
-UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_rds(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, envoy_extensions_filters_network_http_connection_manager_v3_Rds* value) {
- UPB_WRITE_ONEOF(msg, envoy_extensions_filters_network_http_connection_manager_v3_Rds*, UPB_SIZE(144, 256), value, UPB_SIZE(148, 264), 3);
-}
-UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_Rds* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_rds(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_arena *arena) {
- struct envoy_extensions_filters_network_http_connection_manager_v3_Rds* sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_Rds*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_rds(msg);
- if (sub == NULL) {
- sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_Rds*)_upb_msg_new(&envoy_extensions_filters_network_http_connection_manager_v3_Rds_msginit, arena);
- if (!sub) return NULL;
- envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_rds(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_route_config(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, struct envoy_config_route_v3_RouteConfiguration* value) {
- UPB_WRITE_ONEOF(msg, struct envoy_config_route_v3_RouteConfiguration*, UPB_SIZE(144, 256), value, UPB_SIZE(148, 264), 4);
-}
-UPB_INLINE struct envoy_config_route_v3_RouteConfiguration* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_route_config(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_arena *arena) {
- struct envoy_config_route_v3_RouteConfiguration* sub = (struct envoy_config_route_v3_RouteConfiguration*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_route_config(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_route_v3_RouteConfiguration*)_upb_msg_new(&envoy_config_route_v3_RouteConfiguration_msginit, arena);
- if (!sub) return NULL;
- envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_route_config(msg, sub);
- }
- return sub;
-}
-UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter** envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_http_filters(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, size_t *len) {
- return (envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter**)_upb_array_mutable_accessor(msg, UPB_SIZE(132, 232), len);
-}
-UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter** envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_resize_http_filters(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, size_t len, upb_arena *arena) {
- return (envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter**)_upb_array_resize_accessor(msg, UPB_SIZE(132, 232), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_add_http_filters(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_arena *arena) {
- struct envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter* sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter*)_upb_msg_new(&envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(132, 232), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_add_user_agent(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, struct google_protobuf_BoolValue* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(60, 88), struct google_protobuf_BoolValue*) = value;
-}
-UPB_INLINE struct google_protobuf_BoolValue* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_add_user_agent(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_arena *arena) {
- struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_add_user_agent(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_BoolValue*)_upb_msg_new(&google_protobuf_BoolValue_msginit, arena);
- if (!sub) return NULL;
- envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_add_user_agent(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_tracing(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(64, 96), envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing*) = value;
-}
-UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_tracing(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_arena *arena) {
- struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing* sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_tracing(msg);
- if (sub == NULL) {
- sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing*)_upb_msg_new(&envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_msginit, arena);
- if (!sub) return NULL;
- envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_tracing(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_http_protocol_options(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, struct envoy_config_core_v3_Http1ProtocolOptions* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(68, 104), struct envoy_config_core_v3_Http1ProtocolOptions*) = value;
-}
-UPB_INLINE struct envoy_config_core_v3_Http1ProtocolOptions* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_http_protocol_options(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_arena *arena) {
- struct envoy_config_core_v3_Http1ProtocolOptions* sub = (struct envoy_config_core_v3_Http1ProtocolOptions*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_http_protocol_options(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_Http1ProtocolOptions*)_upb_msg_new(&envoy_config_core_v3_Http1ProtocolOptions_msginit, arena);
- if (!sub) return NULL;
- envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_http_protocol_options(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_http2_protocol_options(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, struct envoy_config_core_v3_Http2ProtocolOptions* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(72, 112), struct envoy_config_core_v3_Http2ProtocolOptions*) = value;
-}
-UPB_INLINE struct envoy_config_core_v3_Http2ProtocolOptions* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_http2_protocol_options(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_arena *arena) {
- struct envoy_config_core_v3_Http2ProtocolOptions* sub = (struct envoy_config_core_v3_Http2ProtocolOptions*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_http2_protocol_options(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_Http2ProtocolOptions*)_upb_msg_new(&envoy_config_core_v3_Http2ProtocolOptions_msginit, arena);
- if (!sub) return NULL;
- envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_http2_protocol_options(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_server_name(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(44, 56), upb_strview) = value;
-}
-UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_drain_timeout(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, struct google_protobuf_Duration* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(76, 120), struct google_protobuf_Duration*) = value;
-}
-UPB_INLINE struct google_protobuf_Duration* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_drain_timeout(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_arena *arena) {
- struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_drain_timeout(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
- if (!sub) return NULL;
- envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_drain_timeout(msg, sub);
- }
- return sub;
-}
-UPB_INLINE struct envoy_config_accesslog_v3_AccessLog** envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_access_log(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, size_t *len) {
- return (struct envoy_config_accesslog_v3_AccessLog**)_upb_array_mutable_accessor(msg, UPB_SIZE(136, 240), len);
-}
-UPB_INLINE struct envoy_config_accesslog_v3_AccessLog** envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_resize_access_log(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, size_t len, upb_arena *arena) {
- return (struct envoy_config_accesslog_v3_AccessLog**)_upb_array_resize_accessor(msg, UPB_SIZE(136, 240), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_config_accesslog_v3_AccessLog* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_add_access_log(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_arena *arena) {
- struct envoy_config_accesslog_v3_AccessLog* sub = (struct envoy_config_accesslog_v3_AccessLog*)_upb_msg_new(&envoy_config_accesslog_v3_AccessLog_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(136, 240), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_use_remote_address(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, struct google_protobuf_BoolValue* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(80, 128), struct google_protobuf_BoolValue*) = value;
-}
-UPB_INLINE struct google_protobuf_BoolValue* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_use_remote_address(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_arena *arena) {
- struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_use_remote_address(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_BoolValue*)_upb_msg_new(&google_protobuf_BoolValue_msginit, arena);
- if (!sub) return NULL;
- envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_use_remote_address(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_generate_request_id(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, struct google_protobuf_BoolValue* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(84, 136), struct google_protobuf_BoolValue*) = value;
-}
-UPB_INLINE struct google_protobuf_BoolValue* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_generate_request_id(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_arena *arena) {
- struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_generate_request_id(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_BoolValue*)_upb_msg_new(&google_protobuf_BoolValue_msginit, arena);
- if (!sub) return NULL;
- envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_generate_request_id(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_forward_client_cert_details(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, int32_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
-}
-UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_set_current_client_cert_details(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(88, 144), envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails*) = value;
-}
-UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_set_current_client_cert_details(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_arena *arena) {
- struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails* sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_current_client_cert_details(msg);
- if (sub == NULL) {
- sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails*)_upb_msg_new(&envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_msginit, arena);
- if (!sub) return NULL;
- envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_set_current_client_cert_details(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_proxy_100_continue(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(28, 28), bool) = value;
-}
-UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_xff_num_trusted_hops(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, uint32_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(24, 24), uint32_t) = value;
-}
-UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_represent_ipv4_remote_address_as_ipv4_mapped_ipv6(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(29, 29), bool) = value;
-}
-UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_skip_xff_append(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(30, 30), bool) = value;
-}
-UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_via(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(52, 72), upb_strview) = value;
-}
-UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig** envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_upgrade_configs(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, size_t *len) {
- return (envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig**)_upb_array_mutable_accessor(msg, UPB_SIZE(140, 248), len);
-}
-UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig** envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_resize_upgrade_configs(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, size_t len, upb_arena *arena) {
- return (envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig**)_upb_array_resize_accessor(msg, UPB_SIZE(140, 248), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_add_upgrade_configs(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_arena *arena) {
- struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig* sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig*)_upb_msg_new(&envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(140, 248), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_stream_idle_timeout(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, struct google_protobuf_Duration* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(92, 152), struct google_protobuf_Duration*) = value;
-}
-UPB_INLINE struct google_protobuf_Duration* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_stream_idle_timeout(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_arena *arena) {
- struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_stream_idle_timeout(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
- if (!sub) return NULL;
- envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_stream_idle_timeout(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_internal_address_config(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(96, 160), envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig*) = value;
-}
-UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_internal_address_config(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_arena *arena) {
- struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig* sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_internal_address_config(msg);
- if (sub == NULL) {
- sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig*)_upb_msg_new(&envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_msginit, arena);
- if (!sub) return NULL;
- envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_internal_address_config(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_delayed_close_timeout(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, struct google_protobuf_Duration* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(100, 168), struct google_protobuf_Duration*) = value;
-}
-UPB_INLINE struct google_protobuf_Duration* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_delayed_close_timeout(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_arena *arena) {
- struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_delayed_close_timeout(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
- if (!sub) return NULL;
- envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_delayed_close_timeout(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_request_timeout(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, struct google_protobuf_Duration* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(104, 176), struct google_protobuf_Duration*) = value;
-}
-UPB_INLINE struct google_protobuf_Duration* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_request_timeout(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_arena *arena) {
- struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_request_timeout(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
- if (!sub) return NULL;
- envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_request_timeout(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_max_request_headers_kb(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, struct google_protobuf_UInt32Value* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(108, 184), struct google_protobuf_UInt32Value*) = value;
-}
-UPB_INLINE struct google_protobuf_UInt32Value* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_max_request_headers_kb(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_arena *arena) {
- struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_max_request_headers_kb(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
- if (!sub) return NULL;
- envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_max_request_headers_kb(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_normalize_path(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, struct google_protobuf_BoolValue* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(112, 192), struct google_protobuf_BoolValue*) = value;
-}
-UPB_INLINE struct google_protobuf_BoolValue* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_normalize_path(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_arena *arena) {
- struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_normalize_path(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_BoolValue*)_upb_msg_new(&google_protobuf_BoolValue_msginit, arena);
- if (!sub) return NULL;
- envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_normalize_path(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_scoped_routes(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes* value) {
- UPB_WRITE_ONEOF(msg, envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes*, UPB_SIZE(144, 256), value, UPB_SIZE(148, 264), 31);
-}
-UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_scoped_routes(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_arena *arena) {
- struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes* sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_scoped_routes(msg);
- if (sub == NULL) {
- sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes*)_upb_msg_new(&envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_msginit, arena);
- if (!sub) return NULL;
- envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_scoped_routes(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_preserve_external_request_id(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(31, 31), bool) = value;
-}
-UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_merge_slashes(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(32, 32), bool) = value;
-}
-UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_server_header_transformation(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, int32_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t) = value;
-}
-UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_common_http_protocol_options(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, struct envoy_config_core_v3_HttpProtocolOptions* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(116, 200), struct envoy_config_core_v3_HttpProtocolOptions*) = value;
-}
-UPB_INLINE struct envoy_config_core_v3_HttpProtocolOptions* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_common_http_protocol_options(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_arena *arena) {
- struct envoy_config_core_v3_HttpProtocolOptions* sub = (struct envoy_config_core_v3_HttpProtocolOptions*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_common_http_protocol_options(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_HttpProtocolOptions*)_upb_msg_new(&envoy_config_core_v3_HttpProtocolOptions_msginit, arena);
- if (!sub) return NULL;
- envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_common_http_protocol_options(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_request_id_extension(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(120, 208), envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension*) = value;
-}
-UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_request_id_extension(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_arena *arena) {
- struct envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension* sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_request_id_extension(msg);
- if (sub == NULL) {
- sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension*)_upb_msg_new(&envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_msginit, arena);
- if (!sub) return NULL;
- envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_request_id_extension(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_always_set_request_id_in_response(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(33, 33), bool) = value;
-}
-UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_local_reply_config(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(124, 216), envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig*) = value;
-}
-UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_local_reply_config(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_arena *arena) {
- struct envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig* sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_local_reply_config(msg);
- if (sub == NULL) {
- sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig*)_upb_msg_new(&envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_msginit, arena);
- if (!sub) return NULL;
- envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_local_reply_config(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_strip_matching_host_port(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(34, 34), bool) = value;
-}
-UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_stream_error_on_invalid_http_message(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, struct google_protobuf_BoolValue* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(128, 224), struct google_protobuf_BoolValue*) = value;
-}
-UPB_INLINE struct google_protobuf_BoolValue* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_stream_error_on_invalid_http_message(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_arena *arena) {
- struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_stream_error_on_invalid_http_message(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_BoolValue*)_upb_msg_new(&google_protobuf_BoolValue_msginit, arena);
- if (!sub) return NULL;
- envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_stream_error_on_invalid_http_message(msg, sub);
- }
- return sub;
-}
-
-/* envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.Tracing */
-
-UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing *envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_new(upb_arena *arena) {
- return (envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing *)_upb_msg_new(&envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_msginit, arena);
-}
-UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing *envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing *ret = envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_serialize(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_has_client_sampling(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
-UPB_INLINE const struct envoy_type_v3_Percent* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_client_sampling(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_type_v3_Percent*); }
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_has_random_sampling(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const struct envoy_type_v3_Percent* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_random_sampling(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct envoy_type_v3_Percent*); }
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_has_overall_sampling(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
-UPB_INLINE const struct envoy_type_v3_Percent* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_overall_sampling(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct envoy_type_v3_Percent*); }
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_verbose(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); }
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_has_max_path_tag_length(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); }
-UPB_INLINE const struct google_protobuf_UInt32Value* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_max_path_tag_length(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const struct google_protobuf_UInt32Value*); }
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_has_custom_tags(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 48)); }
-UPB_INLINE const struct envoy_type_tracing_v3_CustomTag* const* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_custom_tags(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing *msg, size_t *len) { return (const struct envoy_type_tracing_v3_CustomTag* const*)_upb_array_accessor(msg, UPB_SIZE(24, 48), len); }
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_has_provider(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 40)); }
-UPB_INLINE const struct envoy_config_trace_v3_Tracing_Http* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_provider(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const struct envoy_config_trace_v3_Tracing_Http*); }
-
-UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_set_client_sampling(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing *msg, struct envoy_type_v3_Percent* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_type_v3_Percent*) = value;
-}
-UPB_INLINE struct envoy_type_v3_Percent* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_mutable_client_sampling(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing *msg, upb_arena *arena) {
- struct envoy_type_v3_Percent* sub = (struct envoy_type_v3_Percent*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_client_sampling(msg);
- if (sub == NULL) {
- sub = (struct envoy_type_v3_Percent*)_upb_msg_new(&envoy_type_v3_Percent_msginit, arena);
- if (!sub) return NULL;
- envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_set_client_sampling(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_set_random_sampling(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing *msg, struct envoy_type_v3_Percent* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct envoy_type_v3_Percent*) = value;
-}
-UPB_INLINE struct envoy_type_v3_Percent* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_mutable_random_sampling(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing *msg, upb_arena *arena) {
- struct envoy_type_v3_Percent* sub = (struct envoy_type_v3_Percent*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_random_sampling(msg);
- if (sub == NULL) {
- sub = (struct envoy_type_v3_Percent*)_upb_msg_new(&envoy_type_v3_Percent_msginit, arena);
- if (!sub) return NULL;
- envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_set_random_sampling(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_set_overall_sampling(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing *msg, struct envoy_type_v3_Percent* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct envoy_type_v3_Percent*) = value;
-}
-UPB_INLINE struct envoy_type_v3_Percent* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_mutable_overall_sampling(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing *msg, upb_arena *arena) {
- struct envoy_type_v3_Percent* sub = (struct envoy_type_v3_Percent*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_overall_sampling(msg);
- if (sub == NULL) {
- sub = (struct envoy_type_v3_Percent*)_upb_msg_new(&envoy_type_v3_Percent_msginit, arena);
- if (!sub) return NULL;
- envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_set_overall_sampling(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_set_verbose(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
-}
-UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_set_max_path_tag_length(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing *msg, struct google_protobuf_UInt32Value* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(16, 32), struct google_protobuf_UInt32Value*) = value;
-}
-UPB_INLINE struct google_protobuf_UInt32Value* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_mutable_max_path_tag_length(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing *msg, upb_arena *arena) {
- struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_max_path_tag_length(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
- if (!sub) return NULL;
- envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_set_max_path_tag_length(msg, sub);
- }
- return sub;
-}
-UPB_INLINE struct envoy_type_tracing_v3_CustomTag** envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_mutable_custom_tags(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing *msg, size_t *len) {
- return (struct envoy_type_tracing_v3_CustomTag**)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 48), len);
-}
-UPB_INLINE struct envoy_type_tracing_v3_CustomTag** envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_resize_custom_tags(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing *msg, size_t len, upb_arena *arena) {
- return (struct envoy_type_tracing_v3_CustomTag**)_upb_array_resize_accessor(msg, UPB_SIZE(24, 48), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_type_tracing_v3_CustomTag* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_add_custom_tags(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing *msg, upb_arena *arena) {
- struct envoy_type_tracing_v3_CustomTag* sub = (struct envoy_type_tracing_v3_CustomTag*)_upb_msg_new(&envoy_type_tracing_v3_CustomTag_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(24, 48), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_set_provider(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing *msg, struct envoy_config_trace_v3_Tracing_Http* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(20, 40), struct envoy_config_trace_v3_Tracing_Http*) = value;
-}
-UPB_INLINE struct envoy_config_trace_v3_Tracing_Http* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_mutable_provider(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing *msg, upb_arena *arena) {
- struct envoy_config_trace_v3_Tracing_Http* sub = (struct envoy_config_trace_v3_Tracing_Http*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_provider(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_trace_v3_Tracing_Http*)_upb_msg_new(&envoy_config_trace_v3_Tracing_Http_msginit, arena);
- if (!sub) return NULL;
- envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_set_provider(msg, sub);
- }
- return sub;
-}
-
-/* envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.InternalAddressConfig */
-
-UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig *envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_new(upb_arena *arena) {
- return (envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig *)_upb_msg_new(&envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_msginit, arena);
-}
-UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig *envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig *ret = envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_serialize(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_unix_sockets(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); }
-
-UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_set_unix_sockets(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
-}
-
-/* envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.SetCurrentClientCertDetails */
-
-UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails *envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_new(upb_arena *arena) {
- return (envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails *)_upb_msg_new(&envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_msginit, arena);
-}
-UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails *envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails *ret = envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_serialize(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_has_subject(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
-UPB_INLINE const struct google_protobuf_BoolValue* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_subject(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_BoolValue*); }
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_cert(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); }
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_dns(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); }
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_uri(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool); }
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_chain(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(3, 3), bool); }
-
-UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_set_subject(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails *msg, struct google_protobuf_BoolValue* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_BoolValue*) = value;
-}
-UPB_INLINE struct google_protobuf_BoolValue* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_mutable_subject(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails *msg, upb_arena *arena) {
- struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_subject(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_BoolValue*)_upb_msg_new(&google_protobuf_BoolValue_msginit, arena);
- if (!sub) return NULL;
- envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_set_subject(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_set_cert(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
-}
-UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_set_dns(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
-}
-UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_set_uri(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = value;
-}
-UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_set_chain(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(3, 3), bool) = value;
-}
-
-/* envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.UpgradeConfig */
-
-UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig *envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_new(upb_arena *arena) {
- return (envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig *)_upb_msg_new(&envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_msginit, arena);
-}
-UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig *envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig *ret = envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_serialize(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_upgrade_type(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_has_filters(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
-UPB_INLINE const envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter* const* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_filters(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig *msg, size_t *len) { return (const envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter* const*)_upb_array_accessor(msg, UPB_SIZE(12, 24), len); }
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_has_enabled(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const struct google_protobuf_BoolValue* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_enabled(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_BoolValue*); }
-
-UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_set_upgrade_type(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter** envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_mutable_filters(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig *msg, size_t *len) {
- return (envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter**)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 24), len);
-}
-UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter** envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_resize_filters(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig *msg, size_t len, upb_arena *arena) {
- return (envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter**)_upb_array_resize_accessor(msg, UPB_SIZE(12, 24), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_add_filters(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig *msg, upb_arena *arena) {
- struct envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter* sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter*)_upb_msg_new(&envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(12, 24), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_set_enabled(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig *msg, struct google_protobuf_BoolValue* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_BoolValue*) = value;
-}
-UPB_INLINE struct google_protobuf_BoolValue* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_mutable_enabled(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig *msg, upb_arena *arena) {
- struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_enabled(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_BoolValue*)_upb_msg_new(&google_protobuf_BoolValue_msginit, arena);
- if (!sub) return NULL;
- envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_set_enabled(msg, sub);
- }
- return sub;
-}
-
-/* envoy.extensions.filters.network.http_connection_manager.v3.LocalReplyConfig */
-
-UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig *envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_new(upb_arena *arena) {
- return (envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig *)_upb_msg_new(&envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_msginit, arena);
-}
-UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig *envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig *ret = envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_serialize(const envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_has_mappers(const envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
-UPB_INLINE const envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper* const* envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_mappers(const envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig *msg, size_t *len) { return (const envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len); }
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_has_body_format(const envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE const struct envoy_config_core_v3_SubstitutionFormatString* envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_body_format(const envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct envoy_config_core_v3_SubstitutionFormatString*); }
-
-UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper** envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_mutable_mappers(envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig *msg, size_t *len) {
- return (envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len);
-}
-UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper** envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_resize_mappers(envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig *msg, size_t len, upb_arena *arena) {
- return (envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper**)_upb_array_resize_accessor(msg, UPB_SIZE(4, 8), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper* envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_add_mappers(envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig *msg, upb_arena *arena) {
- struct envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper* sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper*)_upb_msg_new(&envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(4, 8), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_set_body_format(envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig *msg, struct envoy_config_core_v3_SubstitutionFormatString* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct envoy_config_core_v3_SubstitutionFormatString*) = value;
-}
-UPB_INLINE struct envoy_config_core_v3_SubstitutionFormatString* envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_mutable_body_format(envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig *msg, upb_arena *arena) {
- struct envoy_config_core_v3_SubstitutionFormatString* sub = (struct envoy_config_core_v3_SubstitutionFormatString*)envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_body_format(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_SubstitutionFormatString*)_upb_msg_new(&envoy_config_core_v3_SubstitutionFormatString_msginit, arena);
- if (!sub) return NULL;
- envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_set_body_format(msg, sub);
- }
- return sub;
-}
-
-/* envoy.extensions.filters.network.http_connection_manager.v3.ResponseMapper */
-
-UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper *envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_new(upb_arena *arena) {
- return (envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper *)_upb_msg_new(&envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_msginit, arena);
-}
-UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper *envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper *ret = envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_serialize(const envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_has_filter(const envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE const struct envoy_config_accesslog_v3_AccessLogFilter* envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_filter(const envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct envoy_config_accesslog_v3_AccessLogFilter*); }
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_has_status_code(const envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
-UPB_INLINE const struct google_protobuf_UInt32Value* envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_status_code(const envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_UInt32Value*); }
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_has_body(const envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const struct envoy_config_core_v3_DataSource* envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_body(const envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct envoy_config_core_v3_DataSource*); }
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_has_body_format_override(const envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
-UPB_INLINE const struct envoy_config_core_v3_SubstitutionFormatString* envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_body_format_override(const envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct envoy_config_core_v3_SubstitutionFormatString*); }
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_has_headers_to_add(const envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); }
-UPB_INLINE const struct envoy_config_core_v3_HeaderValueOption* const* envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_headers_to_add(const envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper *msg, size_t *len) { return (const struct envoy_config_core_v3_HeaderValueOption* const*)_upb_array_accessor(msg, UPB_SIZE(16, 32), len); }
-
-UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_set_filter(envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper *msg, struct envoy_config_accesslog_v3_AccessLogFilter* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct envoy_config_accesslog_v3_AccessLogFilter*) = value;
-}
-UPB_INLINE struct envoy_config_accesslog_v3_AccessLogFilter* envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_mutable_filter(envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper *msg, upb_arena *arena) {
- struct envoy_config_accesslog_v3_AccessLogFilter* sub = (struct envoy_config_accesslog_v3_AccessLogFilter*)envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_filter(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_accesslog_v3_AccessLogFilter*)_upb_msg_new(&envoy_config_accesslog_v3_AccessLogFilter_msginit, arena);
- if (!sub) return NULL;
- envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_set_filter(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_set_status_code(envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper *msg, struct google_protobuf_UInt32Value* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_UInt32Value*) = value;
-}
-UPB_INLINE struct google_protobuf_UInt32Value* envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_mutable_status_code(envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper *msg, upb_arena *arena) {
- struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_status_code(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
- if (!sub) return NULL;
- envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_set_status_code(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_set_body(envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper *msg, struct envoy_config_core_v3_DataSource* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct envoy_config_core_v3_DataSource*) = value;
-}
-UPB_INLINE struct envoy_config_core_v3_DataSource* envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_mutable_body(envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper *msg, upb_arena *arena) {
- struct envoy_config_core_v3_DataSource* sub = (struct envoy_config_core_v3_DataSource*)envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_body(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_DataSource*)_upb_msg_new(&envoy_config_core_v3_DataSource_msginit, arena);
- if (!sub) return NULL;
- envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_set_body(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_set_body_format_override(envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper *msg, struct envoy_config_core_v3_SubstitutionFormatString* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct envoy_config_core_v3_SubstitutionFormatString*) = value;
-}
-UPB_INLINE struct envoy_config_core_v3_SubstitutionFormatString* envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_mutable_body_format_override(envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper *msg, upb_arena *arena) {
- struct envoy_config_core_v3_SubstitutionFormatString* sub = (struct envoy_config_core_v3_SubstitutionFormatString*)envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_body_format_override(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_SubstitutionFormatString*)_upb_msg_new(&envoy_config_core_v3_SubstitutionFormatString_msginit, arena);
- if (!sub) return NULL;
- envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_set_body_format_override(msg, sub);
- }
- return sub;
-}
-UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_mutable_headers_to_add(envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper *msg, size_t *len) {
- return (struct envoy_config_core_v3_HeaderValueOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 32), len);
-}
-UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_resize_headers_to_add(envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper *msg, size_t len, upb_arena *arena) {
- return (struct envoy_config_core_v3_HeaderValueOption**)_upb_array_resize_accessor(msg, UPB_SIZE(16, 32), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_config_core_v3_HeaderValueOption* envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_add_headers_to_add(envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper *msg, upb_arena *arena) {
- struct envoy_config_core_v3_HeaderValueOption* sub = (struct envoy_config_core_v3_HeaderValueOption*)_upb_msg_new(&envoy_config_core_v3_HeaderValueOption_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(16, 32), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-
-/* envoy.extensions.filters.network.http_connection_manager.v3.Rds */
-
-UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_Rds *envoy_extensions_filters_network_http_connection_manager_v3_Rds_new(upb_arena *arena) {
- return (envoy_extensions_filters_network_http_connection_manager_v3_Rds *)_upb_msg_new(&envoy_extensions_filters_network_http_connection_manager_v3_Rds_msginit, arena);
-}
-UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_Rds *envoy_extensions_filters_network_http_connection_manager_v3_Rds_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_extensions_filters_network_http_connection_manager_v3_Rds *ret = envoy_extensions_filters_network_http_connection_manager_v3_Rds_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_Rds_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_extensions_filters_network_http_connection_manager_v3_Rds_serialize(const envoy_extensions_filters_network_http_connection_manager_v3_Rds *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_Rds_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_Rds_has_config_source(const envoy_extensions_filters_network_http_connection_manager_v3_Rds *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const struct envoy_config_core_v3_ConfigSource* envoy_extensions_filters_network_http_connection_manager_v3_Rds_config_source(const envoy_extensions_filters_network_http_connection_manager_v3_Rds *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct envoy_config_core_v3_ConfigSource*); }
-UPB_INLINE upb_strview envoy_extensions_filters_network_http_connection_manager_v3_Rds_route_config_name(const envoy_extensions_filters_network_http_connection_manager_v3_Rds *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_Rds_has_rds_resource_locator(const envoy_extensions_filters_network_http_connection_manager_v3_Rds *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
-UPB_INLINE const struct udpa_core_v1_ResourceLocator* envoy_extensions_filters_network_http_connection_manager_v3_Rds_rds_resource_locator(const envoy_extensions_filters_network_http_connection_manager_v3_Rds *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct udpa_core_v1_ResourceLocator*); }
-
-UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_Rds_set_config_source(envoy_extensions_filters_network_http_connection_manager_v3_Rds *msg, struct envoy_config_core_v3_ConfigSource* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct envoy_config_core_v3_ConfigSource*) = value;
-}
-UPB_INLINE struct envoy_config_core_v3_ConfigSource* envoy_extensions_filters_network_http_connection_manager_v3_Rds_mutable_config_source(envoy_extensions_filters_network_http_connection_manager_v3_Rds *msg, upb_arena *arena) {
- struct envoy_config_core_v3_ConfigSource* sub = (struct envoy_config_core_v3_ConfigSource*)envoy_extensions_filters_network_http_connection_manager_v3_Rds_config_source(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_ConfigSource*)_upb_msg_new(&envoy_config_core_v3_ConfigSource_msginit, arena);
- if (!sub) return NULL;
- envoy_extensions_filters_network_http_connection_manager_v3_Rds_set_config_source(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_Rds_set_route_config_name(envoy_extensions_filters_network_http_connection_manager_v3_Rds *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_Rds_set_rds_resource_locator(envoy_extensions_filters_network_http_connection_manager_v3_Rds *msg, struct udpa_core_v1_ResourceLocator* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct udpa_core_v1_ResourceLocator*) = value;
-}
-UPB_INLINE struct udpa_core_v1_ResourceLocator* envoy_extensions_filters_network_http_connection_manager_v3_Rds_mutable_rds_resource_locator(envoy_extensions_filters_network_http_connection_manager_v3_Rds *msg, upb_arena *arena) {
- struct udpa_core_v1_ResourceLocator* sub = (struct udpa_core_v1_ResourceLocator*)envoy_extensions_filters_network_http_connection_manager_v3_Rds_rds_resource_locator(msg);
- if (sub == NULL) {
- sub = (struct udpa_core_v1_ResourceLocator*)_upb_msg_new(&udpa_core_v1_ResourceLocator_msginit, arena);
- if (!sub) return NULL;
- envoy_extensions_filters_network_http_connection_manager_v3_Rds_set_rds_resource_locator(msg, sub);
- }
- return sub;
-}
-
-/* envoy.extensions.filters.network.http_connection_manager.v3.ScopedRouteConfigurationsList */
-
-UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList *envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_new(upb_arena *arena) {
- return (envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList *)_upb_msg_new(&envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_msginit, arena);
-}
-UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList *envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList *ret = envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_serialize(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_has_scoped_route_configurations(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE const struct envoy_config_route_v3_ScopedRouteConfiguration* const* envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_scoped_route_configurations(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList *msg, size_t *len) { return (const struct envoy_config_route_v3_ScopedRouteConfiguration* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
-
-UPB_INLINE struct envoy_config_route_v3_ScopedRouteConfiguration** envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_mutable_scoped_route_configurations(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList *msg, size_t *len) {
- return (struct envoy_config_route_v3_ScopedRouteConfiguration**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
-}
-UPB_INLINE struct envoy_config_route_v3_ScopedRouteConfiguration** envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_resize_scoped_route_configurations(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList *msg, size_t len, upb_arena *arena) {
- return (struct envoy_config_route_v3_ScopedRouteConfiguration**)_upb_array_resize_accessor(msg, UPB_SIZE(0, 0), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_config_route_v3_ScopedRouteConfiguration* envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_add_scoped_route_configurations(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList *msg, upb_arena *arena) {
- struct envoy_config_route_v3_ScopedRouteConfiguration* sub = (struct envoy_config_route_v3_ScopedRouteConfiguration*)_upb_msg_new(&envoy_config_route_v3_ScopedRouteConfiguration_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(0, 0), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-
-/* envoy.extensions.filters.network.http_connection_manager.v3.ScopedRoutes */
-
-UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes *envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_new(upb_arena *arena) {
- return (envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes *)_upb_msg_new(&envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_msginit, arena);
-}
-UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes *envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes *ret = envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_serialize(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_msginit, arena, len);
-}
-
-typedef enum {
- envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_config_specifier_scoped_route_configurations_list = 4,
- envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_config_specifier_scoped_rds = 5,
- envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_config_specifier_NOT_SET = 0
-} envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_config_specifier_oneofcases;
-UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_config_specifier_oneofcases envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_config_specifier_case(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes* msg) { return (envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_config_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(20, 40), int32_t); }
-
-UPB_INLINE upb_strview envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_name(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_has_scope_key_builder(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder* envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_scope_key_builder(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder*); }
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_has_rds_config_source(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
-UPB_INLINE const struct envoy_config_core_v3_ConfigSource* envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_rds_config_source(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct envoy_config_core_v3_ConfigSource*); }
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_has_scoped_route_configurations_list(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes *msg) { return _upb_getoneofcase(msg, UPB_SIZE(20, 40)) == 4; }
-UPB_INLINE const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList* envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_scoped_route_configurations_list(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes *msg) { return UPB_READ_ONEOF(msg, const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList*, UPB_SIZE(16, 32), UPB_SIZE(20, 40), 4, NULL); }
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_has_scoped_rds(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes *msg) { return _upb_getoneofcase(msg, UPB_SIZE(20, 40)) == 5; }
-UPB_INLINE const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds* envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_scoped_rds(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes *msg) { return UPB_READ_ONEOF(msg, const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds*, UPB_SIZE(16, 32), UPB_SIZE(20, 40), 5, NULL); }
-
-UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_set_name(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_set_scope_key_builder(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes *msg, envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder*) = value;
-}
-UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder* envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_mutable_scope_key_builder(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes *msg, upb_arena *arena) {
- struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder* sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder*)envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_scope_key_builder(msg);
- if (sub == NULL) {
- sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder*)_upb_msg_new(&envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_msginit, arena);
- if (!sub) return NULL;
- envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_set_scope_key_builder(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_set_rds_config_source(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes *msg, struct envoy_config_core_v3_ConfigSource* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct envoy_config_core_v3_ConfigSource*) = value;
-}
-UPB_INLINE struct envoy_config_core_v3_ConfigSource* envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_mutable_rds_config_source(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes *msg, upb_arena *arena) {
- struct envoy_config_core_v3_ConfigSource* sub = (struct envoy_config_core_v3_ConfigSource*)envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_rds_config_source(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_ConfigSource*)_upb_msg_new(&envoy_config_core_v3_ConfigSource_msginit, arena);
- if (!sub) return NULL;
- envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_set_rds_config_source(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_set_scoped_route_configurations_list(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes *msg, envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList* value) {
- UPB_WRITE_ONEOF(msg, envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList*, UPB_SIZE(16, 32), value, UPB_SIZE(20, 40), 4);
-}
-UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList* envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_mutable_scoped_route_configurations_list(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes *msg, upb_arena *arena) {
- struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList* sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList*)envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_scoped_route_configurations_list(msg);
- if (sub == NULL) {
- sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList*)_upb_msg_new(&envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_msginit, arena);
- if (!sub) return NULL;
- envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_set_scoped_route_configurations_list(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_set_scoped_rds(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes *msg, envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds* value) {
- UPB_WRITE_ONEOF(msg, envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds*, UPB_SIZE(16, 32), value, UPB_SIZE(20, 40), 5);
-}
-UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds* envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_mutable_scoped_rds(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes *msg, upb_arena *arena) {
- struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds* sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds*)envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_scoped_rds(msg);
- if (sub == NULL) {
- sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds*)_upb_msg_new(&envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_msginit, arena);
- if (!sub) return NULL;
- envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_set_scoped_rds(msg, sub);
- }
- return sub;
-}
-
-/* envoy.extensions.filters.network.http_connection_manager.v3.ScopedRoutes.ScopeKeyBuilder */
-
-UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder *envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_new(upb_arena *arena) {
- return (envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder *)_upb_msg_new(&envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_msginit, arena);
-}
-UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder *envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder *ret = envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_serialize(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_has_fragments(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder* const* envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_fragments(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder *msg, size_t *len) { return (const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
-
-UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder** envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_mutable_fragments(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder *msg, size_t *len) {
- return (envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
-}
-UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder** envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_resize_fragments(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder *msg, size_t len, upb_arena *arena) {
- return (envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder**)_upb_array_resize_accessor(msg, UPB_SIZE(0, 0), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder* envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_add_fragments(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder *msg, upb_arena *arena) {
- struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder* sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder*)_upb_msg_new(&envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(0, 0), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-
-/* envoy.extensions.filters.network.http_connection_manager.v3.ScopedRoutes.ScopeKeyBuilder.FragmentBuilder */
-
-UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder *envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_new(upb_arena *arena) {
- return (envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder *)_upb_msg_new(&envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_msginit, arena);
-}
-UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder *envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder *ret = envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_serialize(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_msginit, arena, len);
-}
-
-typedef enum {
- envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_type_header_value_extractor = 1,
- envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_type_NOT_SET = 0
-} envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_type_oneofcases;
-UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_type_oneofcases envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_type_case(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder* msg) { return (envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 8), int32_t); }
-
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_has_header_value_extractor(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 1; }
-UPB_INLINE const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor* envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_header_value_extractor(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder *msg) { return UPB_READ_ONEOF(msg, const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 1, NULL); }
-
-UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_set_header_value_extractor(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder *msg, envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor* value) {
- UPB_WRITE_ONEOF(msg, envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 1);
-}
-UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor* envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_mutable_header_value_extractor(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder *msg, upb_arena *arena) {
- struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor* sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor*)envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_header_value_extractor(msg);
- if (sub == NULL) {
- sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor*)_upb_msg_new(&envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_msginit, arena);
- if (!sub) return NULL;
- envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_set_header_value_extractor(msg, sub);
- }
- return sub;
-}
-
-/* envoy.extensions.filters.network.http_connection_manager.v3.ScopedRoutes.ScopeKeyBuilder.FragmentBuilder.HeaderValueExtractor */
-
-UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor *envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_new(upb_arena *arena) {
- return (envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor *)_upb_msg_new(&envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_msginit, arena);
-}
-UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor *envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor *ret = envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_serialize(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_msginit, arena, len);
-}
-
-typedef enum {
- envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_extract_type_index = 3,
- envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_extract_type_element = 4,
- envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_extract_type_NOT_SET = 0
-} envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_extract_type_oneofcases;
-UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_extract_type_oneofcases envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_extract_type_case(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor* msg) { return (envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_extract_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(20, 40), int32_t); }
-
-UPB_INLINE upb_strview envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_name(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE upb_strview envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_element_separator(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview); }
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_has_index(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor *msg) { return _upb_getoneofcase(msg, UPB_SIZE(20, 40)) == 3; }
-UPB_INLINE uint32_t envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_index(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor *msg) { return UPB_READ_ONEOF(msg, uint32_t, UPB_SIZE(16, 32), UPB_SIZE(20, 40), 3, 0); }
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_has_element(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor *msg) { return _upb_getoneofcase(msg, UPB_SIZE(20, 40)) == 4; }
-UPB_INLINE const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement* envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_element(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor *msg) { return UPB_READ_ONEOF(msg, const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement*, UPB_SIZE(16, 32), UPB_SIZE(20, 40), 4, NULL); }
-
-UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_set_name(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_set_element_separator(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview) = value;
-}
-UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_set_index(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor *msg, uint32_t value) {
- UPB_WRITE_ONEOF(msg, uint32_t, UPB_SIZE(16, 32), value, UPB_SIZE(20, 40), 3);
-}
-UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_set_element(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor *msg, envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement* value) {
- UPB_WRITE_ONEOF(msg, envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement*, UPB_SIZE(16, 32), value, UPB_SIZE(20, 40), 4);
-}
-UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement* envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_mutable_element(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor *msg, upb_arena *arena) {
- struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement* sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement*)envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_element(msg);
- if (sub == NULL) {
- sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement*)_upb_msg_new(&envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_msginit, arena);
- if (!sub) return NULL;
- envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_set_element(msg, sub);
- }
- return sub;
-}
-
-/* envoy.extensions.filters.network.http_connection_manager.v3.ScopedRoutes.ScopeKeyBuilder.FragmentBuilder.HeaderValueExtractor.KvElement */
-
-UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement *envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_new(upb_arena *arena) {
- return (envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement *)_upb_msg_new(&envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_msginit, arena);
-}
-UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement *envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement *ret = envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_serialize(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_separator(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE upb_strview envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_key(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview); }
-
-UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_set_separator(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_set_key(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview) = value;
-}
-
-/* envoy.extensions.filters.network.http_connection_manager.v3.ScopedRds */
-
-UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds *envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_new(upb_arena *arena) {
- return (envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds *)_upb_msg_new(&envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_msginit, arena);
-}
-UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds *envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds *ret = envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_serialize(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_has_scoped_rds_config_source(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE const struct envoy_config_core_v3_ConfigSource* envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_scoped_rds_config_source(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct envoy_config_core_v3_ConfigSource*); }
-
-UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_set_scoped_rds_config_source(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds *msg, struct envoy_config_core_v3_ConfigSource* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct envoy_config_core_v3_ConfigSource*) = value;
-}
-UPB_INLINE struct envoy_config_core_v3_ConfigSource* envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_mutable_scoped_rds_config_source(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds *msg, upb_arena *arena) {
- struct envoy_config_core_v3_ConfigSource* sub = (struct envoy_config_core_v3_ConfigSource*)envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_scoped_rds_config_source(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_ConfigSource*)_upb_msg_new(&envoy_config_core_v3_ConfigSource_msginit, arena);
- if (!sub) return NULL;
- envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_set_scoped_rds_config_source(msg, sub);
- }
- return sub;
-}
-
-/* envoy.extensions.filters.network.http_connection_manager.v3.HttpFilter */
-
-UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter *envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_new(upb_arena *arena) {
- return (envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter *)_upb_msg_new(&envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_msginit, arena);
-}
-UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter *envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter *ret = envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_serialize(const envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_msginit, arena, len);
-}
-
-typedef enum {
- envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_config_type_typed_config = 4,
- envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_config_type_config_discovery = 5,
- envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_config_type_NOT_SET = 0
-} envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_config_type_oneofcases;
-UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_config_type_oneofcases envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_config_type_case(const envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter* msg) { return (envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_config_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(12, 24), int32_t); }
-
-UPB_INLINE upb_strview envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_name(const envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_has_typed_config(const envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 4; }
-UPB_INLINE const struct google_protobuf_Any* envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_typed_config(const envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter *msg) { return UPB_READ_ONEOF(msg, const struct google_protobuf_Any*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 4, NULL); }
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_has_config_discovery(const envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 5; }
-UPB_INLINE const struct envoy_config_core_v3_ExtensionConfigSource* envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_config_discovery(const envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter *msg) { return UPB_READ_ONEOF(msg, const struct envoy_config_core_v3_ExtensionConfigSource*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 5, NULL); }
-
-UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_set_name(envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_set_typed_config(envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter *msg, struct google_protobuf_Any* value) {
- UPB_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 4);
-}
-UPB_INLINE struct google_protobuf_Any* envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_mutable_typed_config(envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter *msg, upb_arena *arena) {
- struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_typed_config(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena);
- if (!sub) return NULL;
- envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_set_typed_config(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_set_config_discovery(envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter *msg, struct envoy_config_core_v3_ExtensionConfigSource* value) {
- UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_ExtensionConfigSource*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 5);
-}
-UPB_INLINE struct envoy_config_core_v3_ExtensionConfigSource* envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_mutable_config_discovery(envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter *msg, upb_arena *arena) {
- struct envoy_config_core_v3_ExtensionConfigSource* sub = (struct envoy_config_core_v3_ExtensionConfigSource*)envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_config_discovery(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_ExtensionConfigSource*)_upb_msg_new(&envoy_config_core_v3_ExtensionConfigSource_msginit, arena);
- if (!sub) return NULL;
- envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_set_config_discovery(msg, sub);
- }
- return sub;
-}
-
-/* envoy.extensions.filters.network.http_connection_manager.v3.RequestIDExtension */
-
-UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension *envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_new(upb_arena *arena) {
- return (envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension *)_upb_msg_new(&envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_msginit, arena);
-}
-UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension *envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension *ret = envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_serialize(const envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_has_typed_config(const envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE const struct google_protobuf_Any* envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_typed_config(const envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct google_protobuf_Any*); }
-
-UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_set_typed_config(envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension *msg, struct google_protobuf_Any* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct google_protobuf_Any*) = value;
-}
-UPB_INLINE struct google_protobuf_Any* envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_mutable_typed_config(envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension *msg, upb_arena *arena) {
- struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_typed_config(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena);
- if (!sub) return NULL;
- envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_set_typed_config(msg, sub);
- }
- return sub;
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* ENVOY_EXTENSIONS_FILTERS_NETWORK_HTTP_CONNECTION_MANAGER_V3_HTTP_CONNECTION_MANAGER_PROTO_UPB_H_ */
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_EXTENSIONS_FILTERS_NETWORK_HTTP_CONNECTION_MANAGER_V3_HTTP_CONNECTION_MANAGER_PROTO_UPB_H_
+#define ENVOY_EXTENSIONS_FILTERS_NETWORK_HTTP_CONNECTION_MANAGER_V3_HTTP_CONNECTION_MANAGER_PROTO_UPB_H_
+
+#include "upb/msg.h"
+#include "upb/decode.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager;
+struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing;
+struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig;
+struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails;
+struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig;
+struct envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig;
+struct envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper;
+struct envoy_extensions_filters_network_http_connection_manager_v3_Rds;
+struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList;
+struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes;
+struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder;
+struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder;
+struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor;
+struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement;
+struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds;
+struct envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter;
+struct envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension;
+typedef struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager;
+typedef struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing;
+typedef struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig;
+typedef struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails;
+typedef struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig;
+typedef struct envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig;
+typedef struct envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper;
+typedef struct envoy_extensions_filters_network_http_connection_manager_v3_Rds envoy_extensions_filters_network_http_connection_manager_v3_Rds;
+typedef struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList;
+typedef struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes;
+typedef struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder;
+typedef struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder;
+typedef struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor;
+typedef struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement;
+typedef struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds;
+typedef struct envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter;
+typedef struct envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension;
+extern const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_msginit;
+extern const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_msginit;
+extern const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_msginit;
+extern const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_msginit;
+extern const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_msginit;
+extern const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_msginit;
+extern const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_msginit;
+extern const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_Rds_msginit;
+extern const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_msginit;
+extern const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_msginit;
+extern const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_msginit;
+extern const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_msginit;
+extern const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_msginit;
+extern const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_msginit;
+extern const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_msginit;
+extern const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_msginit;
+extern const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_msginit;
+struct envoy_config_accesslog_v3_AccessLog;
+struct envoy_config_accesslog_v3_AccessLogFilter;
+struct envoy_config_core_v3_ConfigSource;
+struct envoy_config_core_v3_DataSource;
+struct envoy_config_core_v3_ExtensionConfigSource;
+struct envoy_config_core_v3_HeaderValueOption;
+struct envoy_config_core_v3_Http1ProtocolOptions;
+struct envoy_config_core_v3_Http2ProtocolOptions;
+struct envoy_config_core_v3_HttpProtocolOptions;
+struct envoy_config_core_v3_SubstitutionFormatString;
+struct envoy_config_route_v3_RouteConfiguration;
+struct envoy_config_route_v3_ScopedRouteConfiguration;
+struct envoy_config_trace_v3_Tracing_Http;
+struct envoy_type_tracing_v3_CustomTag;
+struct envoy_type_v3_Percent;
+struct google_protobuf_Any;
+struct google_protobuf_BoolValue;
+struct google_protobuf_Duration;
+struct google_protobuf_UInt32Value;
+struct udpa_core_v1_ResourceLocator;
+extern const upb_msglayout envoy_config_accesslog_v3_AccessLog_msginit;
+extern const upb_msglayout envoy_config_accesslog_v3_AccessLogFilter_msginit;
+extern const upb_msglayout envoy_config_core_v3_ConfigSource_msginit;
+extern const upb_msglayout envoy_config_core_v3_DataSource_msginit;
+extern const upb_msglayout envoy_config_core_v3_ExtensionConfigSource_msginit;
+extern const upb_msglayout envoy_config_core_v3_HeaderValueOption_msginit;
+extern const upb_msglayout envoy_config_core_v3_Http1ProtocolOptions_msginit;
+extern const upb_msglayout envoy_config_core_v3_Http2ProtocolOptions_msginit;
+extern const upb_msglayout envoy_config_core_v3_HttpProtocolOptions_msginit;
+extern const upb_msglayout envoy_config_core_v3_SubstitutionFormatString_msginit;
+extern const upb_msglayout envoy_config_route_v3_RouteConfiguration_msginit;
+extern const upb_msglayout envoy_config_route_v3_ScopedRouteConfiguration_msginit;
+extern const upb_msglayout envoy_config_trace_v3_Tracing_Http_msginit;
+extern const upb_msglayout envoy_type_tracing_v3_CustomTag_msginit;
+extern const upb_msglayout envoy_type_v3_Percent_msginit;
+extern const upb_msglayout google_protobuf_Any_msginit;
+extern const upb_msglayout google_protobuf_BoolValue_msginit;
+extern const upb_msglayout google_protobuf_Duration_msginit;
+extern const upb_msglayout google_protobuf_UInt32Value_msginit;
+extern const upb_msglayout udpa_core_v1_ResourceLocator_msginit;
+
+typedef enum {
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_AUTO = 0,
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_HTTP1 = 1,
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_HTTP2 = 2,
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_HTTP3 = 3
+} envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_CodecType;
+
+typedef enum {
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SANITIZE = 0,
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_FORWARD_ONLY = 1,
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_APPEND_FORWARD = 2,
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SANITIZE_SET = 3,
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ALWAYS_FORWARD_ONLY = 4
+} envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ForwardClientCertDetails;
+
+typedef enum {
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_OVERWRITE = 0,
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_APPEND_IF_ABSENT = 1,
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PASS_THROUGH = 2
+} envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ServerHeaderTransformation;
+
+typedef enum {
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_INGRESS = 0,
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_EGRESS = 1
+} envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_OperationName;
+
+
+/* envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager */
+
+UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_new(upb_arena *arena) {
+ return (envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *)_upb_msg_new(&envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_msginit, arena);
+}
+UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *ret = envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_serialize(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_msginit, arena, len);
+}
+
+typedef enum {
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_route_specifier_rds = 3,
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_route_specifier_route_config = 4,
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_route_specifier_scoped_routes = 31,
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_route_specifier_NOT_SET = 0
+} envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_route_specifier_oneofcases;
+UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_route_specifier_oneofcases envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_route_specifier_case(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { return (envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_route_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(148, 264), int32_t); }
+
+UPB_INLINE int32_t envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_codec_type(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
+UPB_INLINE upb_strview envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_stat_prefix(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(36, 40), upb_strview); }
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_rds(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_getoneofcase(msg, UPB_SIZE(148, 264)) == 3; }
+UPB_INLINE const envoy_extensions_filters_network_http_connection_manager_v3_Rds* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_rds(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return UPB_READ_ONEOF(msg, const envoy_extensions_filters_network_http_connection_manager_v3_Rds*, UPB_SIZE(144, 256), UPB_SIZE(148, 264), 3, NULL); }
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_route_config(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_getoneofcase(msg, UPB_SIZE(148, 264)) == 4; }
+UPB_INLINE const struct envoy_config_route_v3_RouteConfiguration* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_route_config(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return UPB_READ_ONEOF(msg, const struct envoy_config_route_v3_RouteConfiguration*, UPB_SIZE(144, 256), UPB_SIZE(148, 264), 4, NULL); }
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_http_filters(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(132, 232)); }
+UPB_INLINE const envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter* const* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_http_filters(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, size_t *len) { return (const envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter* const*)_upb_array_accessor(msg, UPB_SIZE(132, 232), len); }
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_add_user_agent(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(60, 88)); }
+UPB_INLINE const struct google_protobuf_BoolValue* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_add_user_agent(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(60, 88), const struct google_protobuf_BoolValue*); }
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_tracing(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(64, 96)); }
+UPB_INLINE const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_tracing(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(64, 96), const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing*); }
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_http_protocol_options(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(68, 104)); }
+UPB_INLINE const struct envoy_config_core_v3_Http1ProtocolOptions* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_http_protocol_options(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(68, 104), const struct envoy_config_core_v3_Http1ProtocolOptions*); }
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_http2_protocol_options(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(72, 112)); }
+UPB_INLINE const struct envoy_config_core_v3_Http2ProtocolOptions* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_http2_protocol_options(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(72, 112), const struct envoy_config_core_v3_Http2ProtocolOptions*); }
+UPB_INLINE upb_strview envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_server_name(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(44, 56), upb_strview); }
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_drain_timeout(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(76, 120)); }
+UPB_INLINE const struct google_protobuf_Duration* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_drain_timeout(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(76, 120), const struct google_protobuf_Duration*); }
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_access_log(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(136, 240)); }
+UPB_INLINE const struct envoy_config_accesslog_v3_AccessLog* const* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_access_log(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, size_t *len) { return (const struct envoy_config_accesslog_v3_AccessLog* const*)_upb_array_accessor(msg, UPB_SIZE(136, 240), len); }
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_use_remote_address(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(80, 128)); }
+UPB_INLINE const struct google_protobuf_BoolValue* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_use_remote_address(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(80, 128), const struct google_protobuf_BoolValue*); }
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_generate_request_id(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(84, 136)); }
+UPB_INLINE const struct google_protobuf_BoolValue* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_generate_request_id(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(84, 136), const struct google_protobuf_BoolValue*); }
+UPB_INLINE int32_t envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_forward_client_cert_details(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); }
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_set_current_client_cert_details(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(88, 144)); }
+UPB_INLINE const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_current_client_cert_details(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(88, 144), const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails*); }
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_proxy_100_continue(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 28), bool); }
+UPB_INLINE uint32_t envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_xff_num_trusted_hops(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), uint32_t); }
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_represent_ipv4_remote_address_as_ipv4_mapped_ipv6(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(29, 29), bool); }
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_skip_xff_append(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(30, 30), bool); }
+UPB_INLINE upb_strview envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_via(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(52, 72), upb_strview); }
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_upgrade_configs(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(140, 248)); }
+UPB_INLINE const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig* const* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_upgrade_configs(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, size_t *len) { return (const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig* const*)_upb_array_accessor(msg, UPB_SIZE(140, 248), len); }
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_stream_idle_timeout(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(92, 152)); }
+UPB_INLINE const struct google_protobuf_Duration* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_stream_idle_timeout(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(92, 152), const struct google_protobuf_Duration*); }
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_internal_address_config(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(96, 160)); }
+UPB_INLINE const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_internal_address_config(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(96, 160), const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig*); }
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_delayed_close_timeout(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(100, 168)); }
+UPB_INLINE const struct google_protobuf_Duration* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_delayed_close_timeout(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(100, 168), const struct google_protobuf_Duration*); }
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_request_timeout(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(104, 176)); }
+UPB_INLINE const struct google_protobuf_Duration* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_request_timeout(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(104, 176), const struct google_protobuf_Duration*); }
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_max_request_headers_kb(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(108, 184)); }
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_max_request_headers_kb(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(108, 184), const struct google_protobuf_UInt32Value*); }
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_normalize_path(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(112, 192)); }
+UPB_INLINE const struct google_protobuf_BoolValue* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_normalize_path(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(112, 192), const struct google_protobuf_BoolValue*); }
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_scoped_routes(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_getoneofcase(msg, UPB_SIZE(148, 264)) == 31; }
+UPB_INLINE const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_scoped_routes(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return UPB_READ_ONEOF(msg, const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes*, UPB_SIZE(144, 256), UPB_SIZE(148, 264), 31, NULL); }
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_preserve_external_request_id(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(31, 31), bool); }
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_merge_slashes(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 32), bool); }
+UPB_INLINE int32_t envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_server_header_transformation(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t); }
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_common_http_protocol_options(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(116, 200)); }
+UPB_INLINE const struct envoy_config_core_v3_HttpProtocolOptions* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_common_http_protocol_options(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(116, 200), const struct envoy_config_core_v3_HttpProtocolOptions*); }
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_request_id_extension(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(120, 208)); }
+UPB_INLINE const envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_request_id_extension(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(120, 208), const envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension*); }
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_always_set_request_id_in_response(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(33, 33), bool); }
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_local_reply_config(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(124, 216)); }
+UPB_INLINE const envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_local_reply_config(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(124, 216), const envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig*); }
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_strip_matching_host_port(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(34, 34), bool); }
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_stream_error_on_invalid_http_message(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(128, 224)); }
+UPB_INLINE const struct google_protobuf_BoolValue* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_stream_error_on_invalid_http_message(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(128, 224), const struct google_protobuf_BoolValue*); }
+
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_codec_type(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, int32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_stat_prefix(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(36, 40), upb_strview) = value;
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_rds(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, envoy_extensions_filters_network_http_connection_manager_v3_Rds* value) {
+ UPB_WRITE_ONEOF(msg, envoy_extensions_filters_network_http_connection_manager_v3_Rds*, UPB_SIZE(144, 256), value, UPB_SIZE(148, 264), 3);
+}
+UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_Rds* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_rds(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_arena *arena) {
+ struct envoy_extensions_filters_network_http_connection_manager_v3_Rds* sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_Rds*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_rds(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_Rds*)_upb_msg_new(&envoy_extensions_filters_network_http_connection_manager_v3_Rds_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_rds(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_route_config(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, struct envoy_config_route_v3_RouteConfiguration* value) {
+ UPB_WRITE_ONEOF(msg, struct envoy_config_route_v3_RouteConfiguration*, UPB_SIZE(144, 256), value, UPB_SIZE(148, 264), 4);
+}
+UPB_INLINE struct envoy_config_route_v3_RouteConfiguration* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_route_config(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_arena *arena) {
+ struct envoy_config_route_v3_RouteConfiguration* sub = (struct envoy_config_route_v3_RouteConfiguration*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_route_config(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_route_v3_RouteConfiguration*)_upb_msg_new(&envoy_config_route_v3_RouteConfiguration_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_route_config(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter** envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_http_filters(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, size_t *len) {
+ return (envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter**)_upb_array_mutable_accessor(msg, UPB_SIZE(132, 232), len);
+}
+UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter** envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_resize_http_filters(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, size_t len, upb_arena *arena) {
+ return (envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter**)_upb_array_resize_accessor(msg, UPB_SIZE(132, 232), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_add_http_filters(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_arena *arena) {
+ struct envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter* sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter*)_upb_msg_new(&envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(132, 232), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_add_user_agent(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, struct google_protobuf_BoolValue* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(60, 88), struct google_protobuf_BoolValue*) = value;
+}
+UPB_INLINE struct google_protobuf_BoolValue* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_add_user_agent(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_arena *arena) {
+ struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_add_user_agent(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_BoolValue*)_upb_msg_new(&google_protobuf_BoolValue_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_add_user_agent(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_tracing(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(64, 96), envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing*) = value;
+}
+UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_tracing(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_arena *arena) {
+ struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing* sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_tracing(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing*)_upb_msg_new(&envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_tracing(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_http_protocol_options(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, struct envoy_config_core_v3_Http1ProtocolOptions* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(68, 104), struct envoy_config_core_v3_Http1ProtocolOptions*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_Http1ProtocolOptions* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_http_protocol_options(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_Http1ProtocolOptions* sub = (struct envoy_config_core_v3_Http1ProtocolOptions*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_http_protocol_options(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_Http1ProtocolOptions*)_upb_msg_new(&envoy_config_core_v3_Http1ProtocolOptions_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_http_protocol_options(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_http2_protocol_options(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, struct envoy_config_core_v3_Http2ProtocolOptions* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(72, 112), struct envoy_config_core_v3_Http2ProtocolOptions*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_Http2ProtocolOptions* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_http2_protocol_options(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_Http2ProtocolOptions* sub = (struct envoy_config_core_v3_Http2ProtocolOptions*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_http2_protocol_options(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_Http2ProtocolOptions*)_upb_msg_new(&envoy_config_core_v3_Http2ProtocolOptions_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_http2_protocol_options(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_server_name(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(44, 56), upb_strview) = value;
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_drain_timeout(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, struct google_protobuf_Duration* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(76, 120), struct google_protobuf_Duration*) = value;
+}
+UPB_INLINE struct google_protobuf_Duration* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_drain_timeout(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_arena *arena) {
+ struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_drain_timeout(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_drain_timeout(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE struct envoy_config_accesslog_v3_AccessLog** envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_access_log(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, size_t *len) {
+ return (struct envoy_config_accesslog_v3_AccessLog**)_upb_array_mutable_accessor(msg, UPB_SIZE(136, 240), len);
+}
+UPB_INLINE struct envoy_config_accesslog_v3_AccessLog** envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_resize_access_log(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, size_t len, upb_arena *arena) {
+ return (struct envoy_config_accesslog_v3_AccessLog**)_upb_array_resize_accessor(msg, UPB_SIZE(136, 240), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_config_accesslog_v3_AccessLog* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_add_access_log(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_arena *arena) {
+ struct envoy_config_accesslog_v3_AccessLog* sub = (struct envoy_config_accesslog_v3_AccessLog*)_upb_msg_new(&envoy_config_accesslog_v3_AccessLog_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(136, 240), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_use_remote_address(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, struct google_protobuf_BoolValue* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(80, 128), struct google_protobuf_BoolValue*) = value;
+}
+UPB_INLINE struct google_protobuf_BoolValue* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_use_remote_address(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_arena *arena) {
+ struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_use_remote_address(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_BoolValue*)_upb_msg_new(&google_protobuf_BoolValue_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_use_remote_address(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_generate_request_id(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, struct google_protobuf_BoolValue* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(84, 136), struct google_protobuf_BoolValue*) = value;
+}
+UPB_INLINE struct google_protobuf_BoolValue* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_generate_request_id(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_arena *arena) {
+ struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_generate_request_id(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_BoolValue*)_upb_msg_new(&google_protobuf_BoolValue_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_generate_request_id(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_forward_client_cert_details(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, int32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_set_current_client_cert_details(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(88, 144), envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails*) = value;
+}
+UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_set_current_client_cert_details(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_arena *arena) {
+ struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails* sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_current_client_cert_details(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails*)_upb_msg_new(&envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_set_current_client_cert_details(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_proxy_100_continue(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 28), bool) = value;
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_xff_num_trusted_hops(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, uint32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 24), uint32_t) = value;
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_represent_ipv4_remote_address_as_ipv4_mapped_ipv6(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(29, 29), bool) = value;
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_skip_xff_append(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(30, 30), bool) = value;
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_via(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(52, 72), upb_strview) = value;
+}
+UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig** envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_upgrade_configs(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, size_t *len) {
+ return (envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig**)_upb_array_mutable_accessor(msg, UPB_SIZE(140, 248), len);
+}
+UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig** envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_resize_upgrade_configs(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, size_t len, upb_arena *arena) {
+ return (envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig**)_upb_array_resize_accessor(msg, UPB_SIZE(140, 248), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_add_upgrade_configs(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_arena *arena) {
+ struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig* sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig*)_upb_msg_new(&envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(140, 248), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_stream_idle_timeout(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, struct google_protobuf_Duration* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(92, 152), struct google_protobuf_Duration*) = value;
+}
+UPB_INLINE struct google_protobuf_Duration* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_stream_idle_timeout(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_arena *arena) {
+ struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_stream_idle_timeout(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_stream_idle_timeout(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_internal_address_config(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(96, 160), envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig*) = value;
+}
+UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_internal_address_config(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_arena *arena) {
+ struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig* sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_internal_address_config(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig*)_upb_msg_new(&envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_internal_address_config(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_delayed_close_timeout(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, struct google_protobuf_Duration* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(100, 168), struct google_protobuf_Duration*) = value;
+}
+UPB_INLINE struct google_protobuf_Duration* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_delayed_close_timeout(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_arena *arena) {
+ struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_delayed_close_timeout(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_delayed_close_timeout(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_request_timeout(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, struct google_protobuf_Duration* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(104, 176), struct google_protobuf_Duration*) = value;
+}
+UPB_INLINE struct google_protobuf_Duration* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_request_timeout(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_arena *arena) {
+ struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_request_timeout(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_request_timeout(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_max_request_headers_kb(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, struct google_protobuf_UInt32Value* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(108, 184), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_max_request_headers_kb(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_arena *arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_max_request_headers_kb(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_max_request_headers_kb(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_normalize_path(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, struct google_protobuf_BoolValue* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(112, 192), struct google_protobuf_BoolValue*) = value;
+}
+UPB_INLINE struct google_protobuf_BoolValue* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_normalize_path(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_arena *arena) {
+ struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_normalize_path(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_BoolValue*)_upb_msg_new(&google_protobuf_BoolValue_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_normalize_path(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_scoped_routes(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes* value) {
+ UPB_WRITE_ONEOF(msg, envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes*, UPB_SIZE(144, 256), value, UPB_SIZE(148, 264), 31);
+}
+UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_scoped_routes(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_arena *arena) {
+ struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes* sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_scoped_routes(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes*)_upb_msg_new(&envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_scoped_routes(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_preserve_external_request_id(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(31, 31), bool) = value;
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_merge_slashes(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 32), bool) = value;
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_server_header_transformation(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, int32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t) = value;
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_common_http_protocol_options(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, struct envoy_config_core_v3_HttpProtocolOptions* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(116, 200), struct envoy_config_core_v3_HttpProtocolOptions*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_HttpProtocolOptions* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_common_http_protocol_options(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_HttpProtocolOptions* sub = (struct envoy_config_core_v3_HttpProtocolOptions*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_common_http_protocol_options(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_HttpProtocolOptions*)_upb_msg_new(&envoy_config_core_v3_HttpProtocolOptions_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_common_http_protocol_options(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_request_id_extension(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(120, 208), envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension*) = value;
+}
+UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_request_id_extension(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_arena *arena) {
+ struct envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension* sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_request_id_extension(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension*)_upb_msg_new(&envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_request_id_extension(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_always_set_request_id_in_response(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(33, 33), bool) = value;
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_local_reply_config(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(124, 216), envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig*) = value;
+}
+UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_local_reply_config(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_arena *arena) {
+ struct envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig* sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_local_reply_config(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig*)_upb_msg_new(&envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_local_reply_config(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_strip_matching_host_port(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(34, 34), bool) = value;
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_stream_error_on_invalid_http_message(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, struct google_protobuf_BoolValue* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(128, 224), struct google_protobuf_BoolValue*) = value;
+}
+UPB_INLINE struct google_protobuf_BoolValue* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_stream_error_on_invalid_http_message(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_arena *arena) {
+ struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_stream_error_on_invalid_http_message(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_BoolValue*)_upb_msg_new(&google_protobuf_BoolValue_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_stream_error_on_invalid_http_message(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.Tracing */
+
+UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing *envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_new(upb_arena *arena) {
+ return (envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing *)_upb_msg_new(&envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_msginit, arena);
+}
+UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing *envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing *ret = envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_serialize(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_has_client_sampling(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
+UPB_INLINE const struct envoy_type_v3_Percent* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_client_sampling(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_type_v3_Percent*); }
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_has_random_sampling(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
+UPB_INLINE const struct envoy_type_v3_Percent* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_random_sampling(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct envoy_type_v3_Percent*); }
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_has_overall_sampling(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
+UPB_INLINE const struct envoy_type_v3_Percent* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_overall_sampling(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct envoy_type_v3_Percent*); }
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_verbose(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); }
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_has_max_path_tag_length(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); }
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_max_path_tag_length(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const struct google_protobuf_UInt32Value*); }
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_has_custom_tags(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 48)); }
+UPB_INLINE const struct envoy_type_tracing_v3_CustomTag* const* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_custom_tags(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing *msg, size_t *len) { return (const struct envoy_type_tracing_v3_CustomTag* const*)_upb_array_accessor(msg, UPB_SIZE(24, 48), len); }
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_has_provider(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 40)); }
+UPB_INLINE const struct envoy_config_trace_v3_Tracing_Http* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_provider(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const struct envoy_config_trace_v3_Tracing_Http*); }
+
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_set_client_sampling(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing *msg, struct envoy_type_v3_Percent* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_type_v3_Percent*) = value;
+}
+UPB_INLINE struct envoy_type_v3_Percent* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_mutable_client_sampling(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing *msg, upb_arena *arena) {
+ struct envoy_type_v3_Percent* sub = (struct envoy_type_v3_Percent*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_client_sampling(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_type_v3_Percent*)_upb_msg_new(&envoy_type_v3_Percent_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_set_client_sampling(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_set_random_sampling(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing *msg, struct envoy_type_v3_Percent* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct envoy_type_v3_Percent*) = value;
+}
+UPB_INLINE struct envoy_type_v3_Percent* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_mutable_random_sampling(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing *msg, upb_arena *arena) {
+ struct envoy_type_v3_Percent* sub = (struct envoy_type_v3_Percent*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_random_sampling(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_type_v3_Percent*)_upb_msg_new(&envoy_type_v3_Percent_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_set_random_sampling(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_set_overall_sampling(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing *msg, struct envoy_type_v3_Percent* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct envoy_type_v3_Percent*) = value;
+}
+UPB_INLINE struct envoy_type_v3_Percent* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_mutable_overall_sampling(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing *msg, upb_arena *arena) {
+ struct envoy_type_v3_Percent* sub = (struct envoy_type_v3_Percent*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_overall_sampling(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_type_v3_Percent*)_upb_msg_new(&envoy_type_v3_Percent_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_set_overall_sampling(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_set_verbose(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_set_max_path_tag_length(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing *msg, struct google_protobuf_UInt32Value* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_mutable_max_path_tag_length(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing *msg, upb_arena *arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_max_path_tag_length(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_set_max_path_tag_length(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE struct envoy_type_tracing_v3_CustomTag** envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_mutable_custom_tags(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing *msg, size_t *len) {
+ return (struct envoy_type_tracing_v3_CustomTag**)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 48), len);
+}
+UPB_INLINE struct envoy_type_tracing_v3_CustomTag** envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_resize_custom_tags(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing *msg, size_t len, upb_arena *arena) {
+ return (struct envoy_type_tracing_v3_CustomTag**)_upb_array_resize_accessor(msg, UPB_SIZE(24, 48), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_type_tracing_v3_CustomTag* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_add_custom_tags(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing *msg, upb_arena *arena) {
+ struct envoy_type_tracing_v3_CustomTag* sub = (struct envoy_type_tracing_v3_CustomTag*)_upb_msg_new(&envoy_type_tracing_v3_CustomTag_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(24, 48), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_set_provider(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing *msg, struct envoy_config_trace_v3_Tracing_Http* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 40), struct envoy_config_trace_v3_Tracing_Http*) = value;
+}
+UPB_INLINE struct envoy_config_trace_v3_Tracing_Http* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_mutable_provider(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing *msg, upb_arena *arena) {
+ struct envoy_config_trace_v3_Tracing_Http* sub = (struct envoy_config_trace_v3_Tracing_Http*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_provider(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_trace_v3_Tracing_Http*)_upb_msg_new(&envoy_config_trace_v3_Tracing_Http_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_set_provider(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.InternalAddressConfig */
+
+UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig *envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_new(upb_arena *arena) {
+ return (envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig *)_upb_msg_new(&envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_msginit, arena);
+}
+UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig *envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig *ret = envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_serialize(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_unix_sockets(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); }
+
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_set_unix_sockets(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
+}
+
+/* envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.SetCurrentClientCertDetails */
+
+UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails *envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_new(upb_arena *arena) {
+ return (envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails *)_upb_msg_new(&envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_msginit, arena);
+}
+UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails *envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails *ret = envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_serialize(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_has_subject(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
+UPB_INLINE const struct google_protobuf_BoolValue* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_subject(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_BoolValue*); }
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_cert(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); }
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_dns(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); }
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_uri(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool); }
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_chain(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(3, 3), bool); }
+
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_set_subject(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails *msg, struct google_protobuf_BoolValue* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_BoolValue*) = value;
+}
+UPB_INLINE struct google_protobuf_BoolValue* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_mutable_subject(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails *msg, upb_arena *arena) {
+ struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_subject(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_BoolValue*)_upb_msg_new(&google_protobuf_BoolValue_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_set_subject(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_set_cert(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_set_dns(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_set_uri(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = value;
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_set_chain(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(3, 3), bool) = value;
+}
+
+/* envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.UpgradeConfig */
+
+UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig *envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_new(upb_arena *arena) {
+ return (envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig *)_upb_msg_new(&envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_msginit, arena);
+}
+UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig *envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig *ret = envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_serialize(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_upgrade_type(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_has_filters(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
+UPB_INLINE const envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter* const* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_filters(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig *msg, size_t *len) { return (const envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter* const*)_upb_array_accessor(msg, UPB_SIZE(12, 24), len); }
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_has_enabled(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
+UPB_INLINE const struct google_protobuf_BoolValue* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_enabled(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_BoolValue*); }
+
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_set_upgrade_type(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter** envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_mutable_filters(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig *msg, size_t *len) {
+ return (envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter**)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 24), len);
+}
+UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter** envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_resize_filters(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig *msg, size_t len, upb_arena *arena) {
+ return (envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter**)_upb_array_resize_accessor(msg, UPB_SIZE(12, 24), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_add_filters(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig *msg, upb_arena *arena) {
+ struct envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter* sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter*)_upb_msg_new(&envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(12, 24), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_set_enabled(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig *msg, struct google_protobuf_BoolValue* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_BoolValue*) = value;
+}
+UPB_INLINE struct google_protobuf_BoolValue* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_mutable_enabled(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig *msg, upb_arena *arena) {
+ struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_enabled(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_BoolValue*)_upb_msg_new(&google_protobuf_BoolValue_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_set_enabled(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.extensions.filters.network.http_connection_manager.v3.LocalReplyConfig */
+
+UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig *envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_new(upb_arena *arena) {
+ return (envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig *)_upb_msg_new(&envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_msginit, arena);
+}
+UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig *envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig *ret = envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_serialize(const envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_has_mappers(const envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
+UPB_INLINE const envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper* const* envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_mappers(const envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig *msg, size_t *len) { return (const envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len); }
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_has_body_format(const envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE const struct envoy_config_core_v3_SubstitutionFormatString* envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_body_format(const envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct envoy_config_core_v3_SubstitutionFormatString*); }
+
+UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper** envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_mutable_mappers(envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig *msg, size_t *len) {
+ return (envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len);
+}
+UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper** envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_resize_mappers(envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig *msg, size_t len, upb_arena *arena) {
+ return (envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper**)_upb_array_resize_accessor(msg, UPB_SIZE(4, 8), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper* envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_add_mappers(envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig *msg, upb_arena *arena) {
+ struct envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper* sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper*)_upb_msg_new(&envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(4, 8), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_set_body_format(envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig *msg, struct envoy_config_core_v3_SubstitutionFormatString* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct envoy_config_core_v3_SubstitutionFormatString*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_SubstitutionFormatString* envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_mutable_body_format(envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_SubstitutionFormatString* sub = (struct envoy_config_core_v3_SubstitutionFormatString*)envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_body_format(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_SubstitutionFormatString*)_upb_msg_new(&envoy_config_core_v3_SubstitutionFormatString_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_set_body_format(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.extensions.filters.network.http_connection_manager.v3.ResponseMapper */
+
+UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper *envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_new(upb_arena *arena) {
+ return (envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper *)_upb_msg_new(&envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_msginit, arena);
+}
+UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper *envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper *ret = envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_serialize(const envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_has_filter(const envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE const struct envoy_config_accesslog_v3_AccessLogFilter* envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_filter(const envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct envoy_config_accesslog_v3_AccessLogFilter*); }
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_has_status_code(const envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_status_code(const envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_UInt32Value*); }
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_has_body(const envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
+UPB_INLINE const struct envoy_config_core_v3_DataSource* envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_body(const envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct envoy_config_core_v3_DataSource*); }
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_has_body_format_override(const envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
+UPB_INLINE const struct envoy_config_core_v3_SubstitutionFormatString* envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_body_format_override(const envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct envoy_config_core_v3_SubstitutionFormatString*); }
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_has_headers_to_add(const envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); }
+UPB_INLINE const struct envoy_config_core_v3_HeaderValueOption* const* envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_headers_to_add(const envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper *msg, size_t *len) { return (const struct envoy_config_core_v3_HeaderValueOption* const*)_upb_array_accessor(msg, UPB_SIZE(16, 32), len); }
+
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_set_filter(envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper *msg, struct envoy_config_accesslog_v3_AccessLogFilter* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct envoy_config_accesslog_v3_AccessLogFilter*) = value;
+}
+UPB_INLINE struct envoy_config_accesslog_v3_AccessLogFilter* envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_mutable_filter(envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper *msg, upb_arena *arena) {
+ struct envoy_config_accesslog_v3_AccessLogFilter* sub = (struct envoy_config_accesslog_v3_AccessLogFilter*)envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_filter(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_accesslog_v3_AccessLogFilter*)_upb_msg_new(&envoy_config_accesslog_v3_AccessLogFilter_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_set_filter(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_set_status_code(envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper *msg, struct google_protobuf_UInt32Value* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_mutable_status_code(envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper *msg, upb_arena *arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_status_code(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_set_status_code(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_set_body(envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper *msg, struct envoy_config_core_v3_DataSource* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct envoy_config_core_v3_DataSource*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_DataSource* envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_mutable_body(envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_DataSource* sub = (struct envoy_config_core_v3_DataSource*)envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_body(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_DataSource*)_upb_msg_new(&envoy_config_core_v3_DataSource_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_set_body(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_set_body_format_override(envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper *msg, struct envoy_config_core_v3_SubstitutionFormatString* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct envoy_config_core_v3_SubstitutionFormatString*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_SubstitutionFormatString* envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_mutable_body_format_override(envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_SubstitutionFormatString* sub = (struct envoy_config_core_v3_SubstitutionFormatString*)envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_body_format_override(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_SubstitutionFormatString*)_upb_msg_new(&envoy_config_core_v3_SubstitutionFormatString_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_set_body_format_override(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_mutable_headers_to_add(envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper *msg, size_t *len) {
+ return (struct envoy_config_core_v3_HeaderValueOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 32), len);
+}
+UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_resize_headers_to_add(envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper *msg, size_t len, upb_arena *arena) {
+ return (struct envoy_config_core_v3_HeaderValueOption**)_upb_array_resize_accessor(msg, UPB_SIZE(16, 32), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_config_core_v3_HeaderValueOption* envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_add_headers_to_add(envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_HeaderValueOption* sub = (struct envoy_config_core_v3_HeaderValueOption*)_upb_msg_new(&envoy_config_core_v3_HeaderValueOption_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(16, 32), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+
+/* envoy.extensions.filters.network.http_connection_manager.v3.Rds */
+
+UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_Rds *envoy_extensions_filters_network_http_connection_manager_v3_Rds_new(upb_arena *arena) {
+ return (envoy_extensions_filters_network_http_connection_manager_v3_Rds *)_upb_msg_new(&envoy_extensions_filters_network_http_connection_manager_v3_Rds_msginit, arena);
+}
+UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_Rds *envoy_extensions_filters_network_http_connection_manager_v3_Rds_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_extensions_filters_network_http_connection_manager_v3_Rds *ret = envoy_extensions_filters_network_http_connection_manager_v3_Rds_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_Rds_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_extensions_filters_network_http_connection_manager_v3_Rds_serialize(const envoy_extensions_filters_network_http_connection_manager_v3_Rds *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_Rds_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_Rds_has_config_source(const envoy_extensions_filters_network_http_connection_manager_v3_Rds *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
+UPB_INLINE const struct envoy_config_core_v3_ConfigSource* envoy_extensions_filters_network_http_connection_manager_v3_Rds_config_source(const envoy_extensions_filters_network_http_connection_manager_v3_Rds *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct envoy_config_core_v3_ConfigSource*); }
+UPB_INLINE upb_strview envoy_extensions_filters_network_http_connection_manager_v3_Rds_route_config_name(const envoy_extensions_filters_network_http_connection_manager_v3_Rds *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_Rds_has_rds_resource_locator(const envoy_extensions_filters_network_http_connection_manager_v3_Rds *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
+UPB_INLINE const struct udpa_core_v1_ResourceLocator* envoy_extensions_filters_network_http_connection_manager_v3_Rds_rds_resource_locator(const envoy_extensions_filters_network_http_connection_manager_v3_Rds *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct udpa_core_v1_ResourceLocator*); }
+
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_Rds_set_config_source(envoy_extensions_filters_network_http_connection_manager_v3_Rds *msg, struct envoy_config_core_v3_ConfigSource* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct envoy_config_core_v3_ConfigSource*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_ConfigSource* envoy_extensions_filters_network_http_connection_manager_v3_Rds_mutable_config_source(envoy_extensions_filters_network_http_connection_manager_v3_Rds *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_ConfigSource* sub = (struct envoy_config_core_v3_ConfigSource*)envoy_extensions_filters_network_http_connection_manager_v3_Rds_config_source(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_ConfigSource*)_upb_msg_new(&envoy_config_core_v3_ConfigSource_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_filters_network_http_connection_manager_v3_Rds_set_config_source(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_Rds_set_route_config_name(envoy_extensions_filters_network_http_connection_manager_v3_Rds *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_Rds_set_rds_resource_locator(envoy_extensions_filters_network_http_connection_manager_v3_Rds *msg, struct udpa_core_v1_ResourceLocator* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct udpa_core_v1_ResourceLocator*) = value;
+}
+UPB_INLINE struct udpa_core_v1_ResourceLocator* envoy_extensions_filters_network_http_connection_manager_v3_Rds_mutable_rds_resource_locator(envoy_extensions_filters_network_http_connection_manager_v3_Rds *msg, upb_arena *arena) {
+ struct udpa_core_v1_ResourceLocator* sub = (struct udpa_core_v1_ResourceLocator*)envoy_extensions_filters_network_http_connection_manager_v3_Rds_rds_resource_locator(msg);
+ if (sub == NULL) {
+ sub = (struct udpa_core_v1_ResourceLocator*)_upb_msg_new(&udpa_core_v1_ResourceLocator_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_filters_network_http_connection_manager_v3_Rds_set_rds_resource_locator(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.extensions.filters.network.http_connection_manager.v3.ScopedRouteConfigurationsList */
+
+UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList *envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_new(upb_arena *arena) {
+ return (envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList *)_upb_msg_new(&envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_msginit, arena);
+}
+UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList *envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList *ret = envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_serialize(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_has_scoped_route_configurations(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE const struct envoy_config_route_v3_ScopedRouteConfiguration* const* envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_scoped_route_configurations(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList *msg, size_t *len) { return (const struct envoy_config_route_v3_ScopedRouteConfiguration* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
+
+UPB_INLINE struct envoy_config_route_v3_ScopedRouteConfiguration** envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_mutable_scoped_route_configurations(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList *msg, size_t *len) {
+ return (struct envoy_config_route_v3_ScopedRouteConfiguration**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
+}
+UPB_INLINE struct envoy_config_route_v3_ScopedRouteConfiguration** envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_resize_scoped_route_configurations(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList *msg, size_t len, upb_arena *arena) {
+ return (struct envoy_config_route_v3_ScopedRouteConfiguration**)_upb_array_resize_accessor(msg, UPB_SIZE(0, 0), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_config_route_v3_ScopedRouteConfiguration* envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_add_scoped_route_configurations(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList *msg, upb_arena *arena) {
+ struct envoy_config_route_v3_ScopedRouteConfiguration* sub = (struct envoy_config_route_v3_ScopedRouteConfiguration*)_upb_msg_new(&envoy_config_route_v3_ScopedRouteConfiguration_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(0, 0), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+
+/* envoy.extensions.filters.network.http_connection_manager.v3.ScopedRoutes */
+
+UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes *envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_new(upb_arena *arena) {
+ return (envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes *)_upb_msg_new(&envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_msginit, arena);
+}
+UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes *envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes *ret = envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_serialize(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_msginit, arena, len);
+}
+
+typedef enum {
+ envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_config_specifier_scoped_route_configurations_list = 4,
+ envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_config_specifier_scoped_rds = 5,
+ envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_config_specifier_NOT_SET = 0
+} envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_config_specifier_oneofcases;
+UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_config_specifier_oneofcases envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_config_specifier_case(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes* msg) { return (envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_config_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(20, 40), int32_t); }
+
+UPB_INLINE upb_strview envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_name(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_has_scope_key_builder(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
+UPB_INLINE const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder* envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_scope_key_builder(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder*); }
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_has_rds_config_source(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
+UPB_INLINE const struct envoy_config_core_v3_ConfigSource* envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_rds_config_source(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct envoy_config_core_v3_ConfigSource*); }
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_has_scoped_route_configurations_list(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes *msg) { return _upb_getoneofcase(msg, UPB_SIZE(20, 40)) == 4; }
+UPB_INLINE const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList* envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_scoped_route_configurations_list(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes *msg) { return UPB_READ_ONEOF(msg, const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList*, UPB_SIZE(16, 32), UPB_SIZE(20, 40), 4, NULL); }
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_has_scoped_rds(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes *msg) { return _upb_getoneofcase(msg, UPB_SIZE(20, 40)) == 5; }
+UPB_INLINE const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds* envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_scoped_rds(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes *msg) { return UPB_READ_ONEOF(msg, const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds*, UPB_SIZE(16, 32), UPB_SIZE(20, 40), 5, NULL); }
+
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_set_name(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_set_scope_key_builder(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes *msg, envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder*) = value;
+}
+UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder* envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_mutable_scope_key_builder(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes *msg, upb_arena *arena) {
+ struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder* sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder*)envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_scope_key_builder(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder*)_upb_msg_new(&envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_set_scope_key_builder(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_set_rds_config_source(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes *msg, struct envoy_config_core_v3_ConfigSource* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct envoy_config_core_v3_ConfigSource*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_ConfigSource* envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_mutable_rds_config_source(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_ConfigSource* sub = (struct envoy_config_core_v3_ConfigSource*)envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_rds_config_source(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_ConfigSource*)_upb_msg_new(&envoy_config_core_v3_ConfigSource_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_set_rds_config_source(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_set_scoped_route_configurations_list(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes *msg, envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList* value) {
+ UPB_WRITE_ONEOF(msg, envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList*, UPB_SIZE(16, 32), value, UPB_SIZE(20, 40), 4);
+}
+UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList* envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_mutable_scoped_route_configurations_list(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes *msg, upb_arena *arena) {
+ struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList* sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList*)envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_scoped_route_configurations_list(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList*)_upb_msg_new(&envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_set_scoped_route_configurations_list(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_set_scoped_rds(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes *msg, envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds* value) {
+ UPB_WRITE_ONEOF(msg, envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds*, UPB_SIZE(16, 32), value, UPB_SIZE(20, 40), 5);
+}
+UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds* envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_mutable_scoped_rds(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes *msg, upb_arena *arena) {
+ struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds* sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds*)envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_scoped_rds(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds*)_upb_msg_new(&envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_set_scoped_rds(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.extensions.filters.network.http_connection_manager.v3.ScopedRoutes.ScopeKeyBuilder */
+
+UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder *envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_new(upb_arena *arena) {
+ return (envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder *)_upb_msg_new(&envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_msginit, arena);
+}
+UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder *envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder *ret = envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_serialize(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_has_fragments(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder* const* envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_fragments(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder *msg, size_t *len) { return (const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
+
+UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder** envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_mutable_fragments(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder *msg, size_t *len) {
+ return (envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
+}
+UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder** envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_resize_fragments(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder *msg, size_t len, upb_arena *arena) {
+ return (envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder**)_upb_array_resize_accessor(msg, UPB_SIZE(0, 0), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder* envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_add_fragments(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder *msg, upb_arena *arena) {
+ struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder* sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder*)_upb_msg_new(&envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(0, 0), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+
+/* envoy.extensions.filters.network.http_connection_manager.v3.ScopedRoutes.ScopeKeyBuilder.FragmentBuilder */
+
+UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder *envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_new(upb_arena *arena) {
+ return (envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder *)_upb_msg_new(&envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_msginit, arena);
+}
+UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder *envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder *ret = envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_serialize(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_msginit, arena, len);
+}
+
+typedef enum {
+ envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_type_header_value_extractor = 1,
+ envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_type_NOT_SET = 0
+} envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_type_oneofcases;
+UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_type_oneofcases envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_type_case(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder* msg) { return (envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 8), int32_t); }
+
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_has_header_value_extractor(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 1; }
+UPB_INLINE const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor* envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_header_value_extractor(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder *msg) { return UPB_READ_ONEOF(msg, const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 1, NULL); }
+
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_set_header_value_extractor(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder *msg, envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor* value) {
+ UPB_WRITE_ONEOF(msg, envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 1);
+}
+UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor* envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_mutable_header_value_extractor(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder *msg, upb_arena *arena) {
+ struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor* sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor*)envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_header_value_extractor(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor*)_upb_msg_new(&envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_set_header_value_extractor(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.extensions.filters.network.http_connection_manager.v3.ScopedRoutes.ScopeKeyBuilder.FragmentBuilder.HeaderValueExtractor */
+
+UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor *envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_new(upb_arena *arena) {
+ return (envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor *)_upb_msg_new(&envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_msginit, arena);
+}
+UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor *envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor *ret = envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_serialize(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_msginit, arena, len);
+}
+
+typedef enum {
+ envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_extract_type_index = 3,
+ envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_extract_type_element = 4,
+ envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_extract_type_NOT_SET = 0
+} envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_extract_type_oneofcases;
+UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_extract_type_oneofcases envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_extract_type_case(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor* msg) { return (envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_extract_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(20, 40), int32_t); }
+
+UPB_INLINE upb_strview envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_name(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE upb_strview envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_element_separator(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview); }
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_has_index(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor *msg) { return _upb_getoneofcase(msg, UPB_SIZE(20, 40)) == 3; }
+UPB_INLINE uint32_t envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_index(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor *msg) { return UPB_READ_ONEOF(msg, uint32_t, UPB_SIZE(16, 32), UPB_SIZE(20, 40), 3, 0); }
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_has_element(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor *msg) { return _upb_getoneofcase(msg, UPB_SIZE(20, 40)) == 4; }
+UPB_INLINE const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement* envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_element(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor *msg) { return UPB_READ_ONEOF(msg, const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement*, UPB_SIZE(16, 32), UPB_SIZE(20, 40), 4, NULL); }
+
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_set_name(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_set_element_separator(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview) = value;
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_set_index(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor *msg, uint32_t value) {
+ UPB_WRITE_ONEOF(msg, uint32_t, UPB_SIZE(16, 32), value, UPB_SIZE(20, 40), 3);
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_set_element(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor *msg, envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement* value) {
+ UPB_WRITE_ONEOF(msg, envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement*, UPB_SIZE(16, 32), value, UPB_SIZE(20, 40), 4);
+}
+UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement* envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_mutable_element(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor *msg, upb_arena *arena) {
+ struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement* sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement*)envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_element(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement*)_upb_msg_new(&envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_set_element(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.extensions.filters.network.http_connection_manager.v3.ScopedRoutes.ScopeKeyBuilder.FragmentBuilder.HeaderValueExtractor.KvElement */
+
+UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement *envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_new(upb_arena *arena) {
+ return (envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement *)_upb_msg_new(&envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_msginit, arena);
+}
+UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement *envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement *ret = envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_serialize(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_separator(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE upb_strview envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_key(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview); }
+
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_set_separator(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_set_key(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview) = value;
+}
+
+/* envoy.extensions.filters.network.http_connection_manager.v3.ScopedRds */
+
+UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds *envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_new(upb_arena *arena) {
+ return (envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds *)_upb_msg_new(&envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_msginit, arena);
+}
+UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds *envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds *ret = envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_serialize(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_has_scoped_rds_config_source(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE const struct envoy_config_core_v3_ConfigSource* envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_scoped_rds_config_source(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct envoy_config_core_v3_ConfigSource*); }
+
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_set_scoped_rds_config_source(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds *msg, struct envoy_config_core_v3_ConfigSource* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct envoy_config_core_v3_ConfigSource*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_ConfigSource* envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_mutable_scoped_rds_config_source(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_ConfigSource* sub = (struct envoy_config_core_v3_ConfigSource*)envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_scoped_rds_config_source(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_ConfigSource*)_upb_msg_new(&envoy_config_core_v3_ConfigSource_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_set_scoped_rds_config_source(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.extensions.filters.network.http_connection_manager.v3.HttpFilter */
+
+UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter *envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_new(upb_arena *arena) {
+ return (envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter *)_upb_msg_new(&envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_msginit, arena);
+}
+UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter *envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter *ret = envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_serialize(const envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_msginit, arena, len);
+}
+
+typedef enum {
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_config_type_typed_config = 4,
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_config_type_config_discovery = 5,
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_config_type_NOT_SET = 0
+} envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_config_type_oneofcases;
+UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_config_type_oneofcases envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_config_type_case(const envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter* msg) { return (envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_config_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(12, 24), int32_t); }
+
+UPB_INLINE upb_strview envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_name(const envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_has_typed_config(const envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 4; }
+UPB_INLINE const struct google_protobuf_Any* envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_typed_config(const envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter *msg) { return UPB_READ_ONEOF(msg, const struct google_protobuf_Any*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 4, NULL); }
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_has_config_discovery(const envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 5; }
+UPB_INLINE const struct envoy_config_core_v3_ExtensionConfigSource* envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_config_discovery(const envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter *msg) { return UPB_READ_ONEOF(msg, const struct envoy_config_core_v3_ExtensionConfigSource*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 5, NULL); }
+
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_set_name(envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_set_typed_config(envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter *msg, struct google_protobuf_Any* value) {
+ UPB_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 4);
+}
+UPB_INLINE struct google_protobuf_Any* envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_mutable_typed_config(envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter *msg, upb_arena *arena) {
+ struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_typed_config(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_set_typed_config(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_set_config_discovery(envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter *msg, struct envoy_config_core_v3_ExtensionConfigSource* value) {
+ UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_ExtensionConfigSource*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 5);
+}
+UPB_INLINE struct envoy_config_core_v3_ExtensionConfigSource* envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_mutable_config_discovery(envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_ExtensionConfigSource* sub = (struct envoy_config_core_v3_ExtensionConfigSource*)envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_config_discovery(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_ExtensionConfigSource*)_upb_msg_new(&envoy_config_core_v3_ExtensionConfigSource_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_set_config_discovery(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.extensions.filters.network.http_connection_manager.v3.RequestIDExtension */
+
+UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension *envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_new(upb_arena *arena) {
+ return (envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension *)_upb_msg_new(&envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_msginit, arena);
+}
+UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension *envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension *ret = envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_serialize(const envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_has_typed_config(const envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE const struct google_protobuf_Any* envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_typed_config(const envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct google_protobuf_Any*); }
+
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_set_typed_config(envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension *msg, struct google_protobuf_Any* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct google_protobuf_Any*) = value;
+}
+UPB_INLINE struct google_protobuf_Any* envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_mutable_typed_config(envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension *msg, upb_arena *arena) {
+ struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_typed_config(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_set_typed_config(msg, sub);
+ }
+ return sub;
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_EXTENSIONS_FILTERS_NETWORK_HTTP_CONNECTION_MANAGER_V3_HTTP_CONNECTION_MANAGER_PROTO_UPB_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.c
index 3b90e81513e..9ae915cd093 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.c
@@ -1,20 +1,20 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/extensions/transport_sockets/tls/v3/cert.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include <stddef.h>
-#include "upb/msg.h"
-#include "envoy/extensions/transport_sockets/tls/v3/cert.upb.h"
-#include "udpa/annotations/status.upb.h"
-#include "envoy/extensions/transport_sockets/tls/v3/common.upb.h"
-#include "envoy/extensions/transport_sockets/tls/v3/secret.upb.h"
-#include "envoy/extensions/transport_sockets/tls/v3/tls.upb.h"
-
-#include "upb/port_def.inc"
-
-#include "upb/port_undef.inc"
-
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/extensions/transport_sockets/tls/v3/cert.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg.h"
+#include "envoy/extensions/transport_sockets/tls/v3/cert.upb.h"
+#include "udpa/annotations/status.upb.h"
+#include "envoy/extensions/transport_sockets/tls/v3/common.upb.h"
+#include "envoy/extensions/transport_sockets/tls/v3/secret.upb.h"
+#include "envoy/extensions/transport_sockets/tls/v3/tls.upb.h"
+
+#include "upb/port_def.inc"
+
+#include "upb/port_undef.inc"
+
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.h
index 795e7b42aaf..318be48eba1 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.h
@@ -1,34 +1,34 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/extensions/transport_sockets/tls/v3/cert.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef ENVOY_EXTENSIONS_TRANSPORT_SOCKETS_TLS_V3_CERT_PROTO_UPB_H_
-#define ENVOY_EXTENSIONS_TRANSPORT_SOCKETS_TLS_V3_CERT_PROTO_UPB_H_
-
-#include "upb/msg.h"
-#include "upb/decode.h"
-#include "upb/encode.h"
-
-/* Public Imports. */
-#include "envoy/extensions/transport_sockets/tls/v3/common.upb.h"
-#include "envoy/extensions/transport_sockets/tls/v3/secret.upb.h"
-#include "envoy/extensions/transport_sockets/tls/v3/tls.upb.h"
-
-#include "upb/port_def.inc"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* ENVOY_EXTENSIONS_TRANSPORT_SOCKETS_TLS_V3_CERT_PROTO_UPB_H_ */
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/extensions/transport_sockets/tls/v3/cert.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_EXTENSIONS_TRANSPORT_SOCKETS_TLS_V3_CERT_PROTO_UPB_H_
+#define ENVOY_EXTENSIONS_TRANSPORT_SOCKETS_TLS_V3_CERT_PROTO_UPB_H_
+
+#include "upb/msg.h"
+#include "upb/decode.h"
+#include "upb/encode.h"
+
+/* Public Imports. */
+#include "envoy/extensions/transport_sockets/tls/v3/common.upb.h"
+#include "envoy/extensions/transport_sockets/tls/v3/secret.upb.h"
+#include "envoy/extensions/transport_sockets/tls/v3/tls.upb.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_EXTENSIONS_TRANSPORT_SOCKETS_TLS_V3_CERT_PROTO_UPB_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.c
index e7d722d3af5..f292720df5a 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.c
@@ -1,110 +1,110 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/extensions/transport_sockets/tls/v3/common.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include <stddef.h>
-#include "upb/msg.h"
-#include "envoy/extensions/transport_sockets/tls/v3/common.upb.h"
-#include "envoy/config/core/v3/base.upb.h"
-#include "envoy/type/matcher/v3/string.upb.h"
-#include "google/protobuf/any.upb.h"
-#include "google/protobuf/struct.upb.h"
-#include "google/protobuf/wrappers.upb.h"
-#include "udpa/annotations/sensitive.upb.h"
-#include "udpa/annotations/status.upb.h"
-#include "udpa/annotations/versioning.upb.h"
-#include "validate/validate.upb.h"
-
-#include "upb/port_def.inc"
-
-static const upb_msglayout_field envoy_extensions_transport_sockets_tls_v3_TlsParameters__fields[4] = {
- {1, UPB_SIZE(0, 0), 0, 0, 14, 1},
- {2, UPB_SIZE(8, 8), 0, 0, 14, 1},
- {3, UPB_SIZE(16, 16), 0, 0, 9, 3},
- {4, UPB_SIZE(20, 24), 0, 0, 9, 3},
-};
-
-const upb_msglayout envoy_extensions_transport_sockets_tls_v3_TlsParameters_msginit = {
- NULL,
- &envoy_extensions_transport_sockets_tls_v3_TlsParameters__fields[0],
- UPB_SIZE(24, 32), 4, false,
-};
-
-static const upb_msglayout *const envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_submsgs[1] = {
- &google_protobuf_Any_msginit,
-};
-
-static const upb_msglayout_field envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {3, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, 1},
-};
-
-const upb_msglayout envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_msginit = {
- &envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_submsgs[0],
- &envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider__fields[0],
- UPB_SIZE(16, 32), 2, false,
-};
-
-static const upb_msglayout *const envoy_extensions_transport_sockets_tls_v3_TlsCertificate_submsgs[6] = {
- &envoy_config_core_v3_DataSource_msginit,
- &envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_msginit,
-};
-
-static const upb_msglayout_field envoy_extensions_transport_sockets_tls_v3_TlsCertificate__fields[6] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
- {2, UPB_SIZE(4, 8), 0, 0, 11, 1},
- {3, UPB_SIZE(8, 16), 0, 0, 11, 1},
- {4, UPB_SIZE(12, 24), 0, 0, 11, 1},
- {5, UPB_SIZE(20, 40), 0, 0, 11, 3},
- {6, UPB_SIZE(16, 32), 0, 1, 11, 1},
-};
-
-const upb_msglayout envoy_extensions_transport_sockets_tls_v3_TlsCertificate_msginit = {
- &envoy_extensions_transport_sockets_tls_v3_TlsCertificate_submsgs[0],
- &envoy_extensions_transport_sockets_tls_v3_TlsCertificate__fields[0],
- UPB_SIZE(24, 48), 6, false,
-};
-
-static const upb_msglayout *const envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_submsgs[1] = {
- &envoy_config_core_v3_DataSource_msginit,
-};
-
-static const upb_msglayout_field envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 3},
-};
-
-const upb_msglayout envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_msginit = {
- &envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_submsgs[0],
- &envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys__fields[0],
- UPB_SIZE(4, 8), 1, false,
-};
-
-static const upb_msglayout *const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_submsgs[4] = {
- &envoy_config_core_v3_DataSource_msginit,
- &envoy_type_matcher_v3_StringMatcher_msginit,
- &google_protobuf_BoolValue_msginit,
-};
-
-static const upb_msglayout_field envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext__fields[8] = {
- {1, UPB_SIZE(12, 16), 0, 0, 11, 1},
- {2, UPB_SIZE(24, 40), 0, 0, 9, 3},
- {3, UPB_SIZE(28, 48), 0, 0, 9, 3},
- {6, UPB_SIZE(16, 24), 0, 2, 11, 1},
- {7, UPB_SIZE(20, 32), 0, 0, 11, 1},
- {8, UPB_SIZE(8, 8), 0, 0, 8, 1},
- {9, UPB_SIZE(32, 56), 0, 1, 11, 3},
- {10, UPB_SIZE(0, 0), 0, 0, 14, 1},
-};
-
-const upb_msglayout envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msginit = {
- &envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_submsgs[0],
- &envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext__fields[0],
- UPB_SIZE(40, 64), 8, false,
-};
-
-#include "upb/port_undef.inc"
-
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/extensions/transport_sockets/tls/v3/common.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg.h"
+#include "envoy/extensions/transport_sockets/tls/v3/common.upb.h"
+#include "envoy/config/core/v3/base.upb.h"
+#include "envoy/type/matcher/v3/string.upb.h"
+#include "google/protobuf/any.upb.h"
+#include "google/protobuf/struct.upb.h"
+#include "google/protobuf/wrappers.upb.h"
+#include "udpa/annotations/sensitive.upb.h"
+#include "udpa/annotations/status.upb.h"
+#include "udpa/annotations/versioning.upb.h"
+#include "validate/validate.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_msglayout_field envoy_extensions_transport_sockets_tls_v3_TlsParameters__fields[4] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 14, 1},
+ {2, UPB_SIZE(8, 8), 0, 0, 14, 1},
+ {3, UPB_SIZE(16, 16), 0, 0, 9, 3},
+ {4, UPB_SIZE(20, 24), 0, 0, 9, 3},
+};
+
+const upb_msglayout envoy_extensions_transport_sockets_tls_v3_TlsParameters_msginit = {
+ NULL,
+ &envoy_extensions_transport_sockets_tls_v3_TlsParameters__fields[0],
+ UPB_SIZE(24, 32), 4, false,
+};
+
+static const upb_msglayout *const envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_submsgs[1] = {
+ &google_protobuf_Any_msginit,
+};
+
+static const upb_msglayout_field envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {3, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, 1},
+};
+
+const upb_msglayout envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_msginit = {
+ &envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_submsgs[0],
+ &envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider__fields[0],
+ UPB_SIZE(16, 32), 2, false,
+};
+
+static const upb_msglayout *const envoy_extensions_transport_sockets_tls_v3_TlsCertificate_submsgs[6] = {
+ &envoy_config_core_v3_DataSource_msginit,
+ &envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_msginit,
+};
+
+static const upb_msglayout_field envoy_extensions_transport_sockets_tls_v3_TlsCertificate__fields[6] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
+ {2, UPB_SIZE(4, 8), 0, 0, 11, 1},
+ {3, UPB_SIZE(8, 16), 0, 0, 11, 1},
+ {4, UPB_SIZE(12, 24), 0, 0, 11, 1},
+ {5, UPB_SIZE(20, 40), 0, 0, 11, 3},
+ {6, UPB_SIZE(16, 32), 0, 1, 11, 1},
+};
+
+const upb_msglayout envoy_extensions_transport_sockets_tls_v3_TlsCertificate_msginit = {
+ &envoy_extensions_transport_sockets_tls_v3_TlsCertificate_submsgs[0],
+ &envoy_extensions_transport_sockets_tls_v3_TlsCertificate__fields[0],
+ UPB_SIZE(24, 48), 6, false,
+};
+
+static const upb_msglayout *const envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_submsgs[1] = {
+ &envoy_config_core_v3_DataSource_msginit,
+};
+
+static const upb_msglayout_field envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys__fields[1] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 11, 3},
+};
+
+const upb_msglayout envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_msginit = {
+ &envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_submsgs[0],
+ &envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys__fields[0],
+ UPB_SIZE(4, 8), 1, false,
+};
+
+static const upb_msglayout *const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_submsgs[4] = {
+ &envoy_config_core_v3_DataSource_msginit,
+ &envoy_type_matcher_v3_StringMatcher_msginit,
+ &google_protobuf_BoolValue_msginit,
+};
+
+static const upb_msglayout_field envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext__fields[8] = {
+ {1, UPB_SIZE(12, 16), 0, 0, 11, 1},
+ {2, UPB_SIZE(24, 40), 0, 0, 9, 3},
+ {3, UPB_SIZE(28, 48), 0, 0, 9, 3},
+ {6, UPB_SIZE(16, 24), 0, 2, 11, 1},
+ {7, UPB_SIZE(20, 32), 0, 0, 11, 1},
+ {8, UPB_SIZE(8, 8), 0, 0, 8, 1},
+ {9, UPB_SIZE(32, 56), 0, 1, 11, 3},
+ {10, UPB_SIZE(0, 0), 0, 0, 14, 1},
+};
+
+const upb_msglayout envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msginit = {
+ &envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_submsgs[0],
+ &envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext__fields[0],
+ UPB_SIZE(40, 64), 8, false,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.h
index 46ea5b7ddbc..c2d25814f9f 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.h
@@ -1,387 +1,387 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/extensions/transport_sockets/tls/v3/common.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef ENVOY_EXTENSIONS_TRANSPORT_SOCKETS_TLS_V3_COMMON_PROTO_UPB_H_
-#define ENVOY_EXTENSIONS_TRANSPORT_SOCKETS_TLS_V3_COMMON_PROTO_UPB_H_
-
-#include "upb/msg.h"
-#include "upb/decode.h"
-#include "upb/encode.h"
-
-#include "upb/port_def.inc"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct envoy_extensions_transport_sockets_tls_v3_TlsParameters;
-struct envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider;
-struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate;
-struct envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys;
-struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext;
-typedef struct envoy_extensions_transport_sockets_tls_v3_TlsParameters envoy_extensions_transport_sockets_tls_v3_TlsParameters;
-typedef struct envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider;
-typedef struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate envoy_extensions_transport_sockets_tls_v3_TlsCertificate;
-typedef struct envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys;
-typedef struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext;
-extern const upb_msglayout envoy_extensions_transport_sockets_tls_v3_TlsParameters_msginit;
-extern const upb_msglayout envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_msginit;
-extern const upb_msglayout envoy_extensions_transport_sockets_tls_v3_TlsCertificate_msginit;
-extern const upb_msglayout envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_msginit;
-extern const upb_msglayout envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msginit;
-struct envoy_config_core_v3_DataSource;
-struct envoy_type_matcher_v3_StringMatcher;
-struct google_protobuf_Any;
-struct google_protobuf_BoolValue;
-extern const upb_msglayout envoy_config_core_v3_DataSource_msginit;
-extern const upb_msglayout envoy_type_matcher_v3_StringMatcher_msginit;
-extern const upb_msglayout google_protobuf_Any_msginit;
-extern const upb_msglayout google_protobuf_BoolValue_msginit;
-
-typedef enum {
- envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_VERIFY_TRUST_CHAIN = 0,
- envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_ACCEPT_UNTRUSTED = 1
-} envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_TrustChainVerification;
-
-typedef enum {
- envoy_extensions_transport_sockets_tls_v3_TlsParameters_TLS_AUTO = 0,
- envoy_extensions_transport_sockets_tls_v3_TlsParameters_TLSv1_0 = 1,
- envoy_extensions_transport_sockets_tls_v3_TlsParameters_TLSv1_1 = 2,
- envoy_extensions_transport_sockets_tls_v3_TlsParameters_TLSv1_2 = 3,
- envoy_extensions_transport_sockets_tls_v3_TlsParameters_TLSv1_3 = 4
-} envoy_extensions_transport_sockets_tls_v3_TlsParameters_TlsProtocol;
-
-
-/* envoy.extensions.transport_sockets.tls.v3.TlsParameters */
-
-UPB_INLINE envoy_extensions_transport_sockets_tls_v3_TlsParameters *envoy_extensions_transport_sockets_tls_v3_TlsParameters_new(upb_arena *arena) {
- return (envoy_extensions_transport_sockets_tls_v3_TlsParameters *)_upb_msg_new(&envoy_extensions_transport_sockets_tls_v3_TlsParameters_msginit, arena);
-}
-UPB_INLINE envoy_extensions_transport_sockets_tls_v3_TlsParameters *envoy_extensions_transport_sockets_tls_v3_TlsParameters_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_extensions_transport_sockets_tls_v3_TlsParameters *ret = envoy_extensions_transport_sockets_tls_v3_TlsParameters_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_TlsParameters_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_extensions_transport_sockets_tls_v3_TlsParameters_serialize(const envoy_extensions_transport_sockets_tls_v3_TlsParameters *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_extensions_transport_sockets_tls_v3_TlsParameters_msginit, arena, len);
-}
-
-UPB_INLINE int32_t envoy_extensions_transport_sockets_tls_v3_TlsParameters_tls_minimum_protocol_version(const envoy_extensions_transport_sockets_tls_v3_TlsParameters *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
-UPB_INLINE int32_t envoy_extensions_transport_sockets_tls_v3_TlsParameters_tls_maximum_protocol_version(const envoy_extensions_transport_sockets_tls_v3_TlsParameters *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); }
-UPB_INLINE upb_strview const* envoy_extensions_transport_sockets_tls_v3_TlsParameters_cipher_suites(const envoy_extensions_transport_sockets_tls_v3_TlsParameters *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(16, 16), len); }
-UPB_INLINE upb_strview const* envoy_extensions_transport_sockets_tls_v3_TlsParameters_ecdh_curves(const envoy_extensions_transport_sockets_tls_v3_TlsParameters *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(20, 24), len); }
-
-UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_TlsParameters_set_tls_minimum_protocol_version(envoy_extensions_transport_sockets_tls_v3_TlsParameters *msg, int32_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
-}
-UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_TlsParameters_set_tls_maximum_protocol_version(envoy_extensions_transport_sockets_tls_v3_TlsParameters *msg, int32_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
-}
-UPB_INLINE upb_strview* envoy_extensions_transport_sockets_tls_v3_TlsParameters_mutable_cipher_suites(envoy_extensions_transport_sockets_tls_v3_TlsParameters *msg, size_t *len) {
- return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 16), len);
-}
-UPB_INLINE upb_strview* envoy_extensions_transport_sockets_tls_v3_TlsParameters_resize_cipher_suites(envoy_extensions_transport_sockets_tls_v3_TlsParameters *msg, size_t len, upb_arena *arena) {
- return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(16, 16), len, UPB_TYPE_STRING, arena);
-}
-UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_TlsParameters_add_cipher_suites(envoy_extensions_transport_sockets_tls_v3_TlsParameters *msg, upb_strview val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(16, 16), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
- arena);
-}
-UPB_INLINE upb_strview* envoy_extensions_transport_sockets_tls_v3_TlsParameters_mutable_ecdh_curves(envoy_extensions_transport_sockets_tls_v3_TlsParameters *msg, size_t *len) {
- return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 24), len);
-}
-UPB_INLINE upb_strview* envoy_extensions_transport_sockets_tls_v3_TlsParameters_resize_ecdh_curves(envoy_extensions_transport_sockets_tls_v3_TlsParameters *msg, size_t len, upb_arena *arena) {
- return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(20, 24), len, UPB_TYPE_STRING, arena);
-}
-UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_TlsParameters_add_ecdh_curves(envoy_extensions_transport_sockets_tls_v3_TlsParameters *msg, upb_strview val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(20, 24), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
- arena);
-}
-
-/* envoy.extensions.transport_sockets.tls.v3.PrivateKeyProvider */
-
-UPB_INLINE envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider *envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_new(upb_arena *arena) {
- return (envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider *)_upb_msg_new(&envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_msginit, arena);
-}
-UPB_INLINE envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider *envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider *ret = envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_serialize(const envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_msginit, arena, len);
-}
-
-typedef enum {
- envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_config_type_typed_config = 3,
- envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_config_type_NOT_SET = 0
-} envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_config_type_oneofcases;
-UPB_INLINE envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_config_type_oneofcases envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_config_type_case(const envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider* msg) { return (envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_config_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(12, 24), int32_t); }
-
-UPB_INLINE upb_strview envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_provider_name(const envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_has_typed_config(const envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 3; }
-UPB_INLINE const struct google_protobuf_Any* envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_typed_config(const envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider *msg) { return UPB_READ_ONEOF(msg, const struct google_protobuf_Any*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 3, NULL); }
-
-UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_set_provider_name(envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_set_typed_config(envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider *msg, struct google_protobuf_Any* value) {
- UPB_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 3);
-}
-UPB_INLINE struct google_protobuf_Any* envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_mutable_typed_config(envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider *msg, upb_arena *arena) {
- struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_typed_config(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena);
- if (!sub) return NULL;
- envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_set_typed_config(msg, sub);
- }
- return sub;
-}
-
-/* envoy.extensions.transport_sockets.tls.v3.TlsCertificate */
-
-UPB_INLINE envoy_extensions_transport_sockets_tls_v3_TlsCertificate *envoy_extensions_transport_sockets_tls_v3_TlsCertificate_new(upb_arena *arena) {
- return (envoy_extensions_transport_sockets_tls_v3_TlsCertificate *)_upb_msg_new(&envoy_extensions_transport_sockets_tls_v3_TlsCertificate_msginit, arena);
-}
-UPB_INLINE envoy_extensions_transport_sockets_tls_v3_TlsCertificate *envoy_extensions_transport_sockets_tls_v3_TlsCertificate_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_extensions_transport_sockets_tls_v3_TlsCertificate *ret = envoy_extensions_transport_sockets_tls_v3_TlsCertificate_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_TlsCertificate_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_extensions_transport_sockets_tls_v3_TlsCertificate_serialize(const envoy_extensions_transport_sockets_tls_v3_TlsCertificate *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_extensions_transport_sockets_tls_v3_TlsCertificate_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_TlsCertificate_has_certificate_chain(const envoy_extensions_transport_sockets_tls_v3_TlsCertificate *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE const struct envoy_config_core_v3_DataSource* envoy_extensions_transport_sockets_tls_v3_TlsCertificate_certificate_chain(const envoy_extensions_transport_sockets_tls_v3_TlsCertificate *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct envoy_config_core_v3_DataSource*); }
-UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_TlsCertificate_has_private_key(const envoy_extensions_transport_sockets_tls_v3_TlsCertificate *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
-UPB_INLINE const struct envoy_config_core_v3_DataSource* envoy_extensions_transport_sockets_tls_v3_TlsCertificate_private_key(const envoy_extensions_transport_sockets_tls_v3_TlsCertificate *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_config_core_v3_DataSource*); }
-UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_TlsCertificate_has_password(const envoy_extensions_transport_sockets_tls_v3_TlsCertificate *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const struct envoy_config_core_v3_DataSource* envoy_extensions_transport_sockets_tls_v3_TlsCertificate_password(const envoy_extensions_transport_sockets_tls_v3_TlsCertificate *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct envoy_config_core_v3_DataSource*); }
-UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_TlsCertificate_has_ocsp_staple(const envoy_extensions_transport_sockets_tls_v3_TlsCertificate *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
-UPB_INLINE const struct envoy_config_core_v3_DataSource* envoy_extensions_transport_sockets_tls_v3_TlsCertificate_ocsp_staple(const envoy_extensions_transport_sockets_tls_v3_TlsCertificate *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct envoy_config_core_v3_DataSource*); }
-UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_TlsCertificate_has_signed_certificate_timestamp(const envoy_extensions_transport_sockets_tls_v3_TlsCertificate *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 40)); }
-UPB_INLINE const struct envoy_config_core_v3_DataSource* const* envoy_extensions_transport_sockets_tls_v3_TlsCertificate_signed_certificate_timestamp(const envoy_extensions_transport_sockets_tls_v3_TlsCertificate *msg, size_t *len) { return (const struct envoy_config_core_v3_DataSource* const*)_upb_array_accessor(msg, UPB_SIZE(20, 40), len); }
-UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_TlsCertificate_has_private_key_provider(const envoy_extensions_transport_sockets_tls_v3_TlsCertificate *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); }
-UPB_INLINE const envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider* envoy_extensions_transport_sockets_tls_v3_TlsCertificate_private_key_provider(const envoy_extensions_transport_sockets_tls_v3_TlsCertificate *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider*); }
-
-UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_TlsCertificate_set_certificate_chain(envoy_extensions_transport_sockets_tls_v3_TlsCertificate *msg, struct envoy_config_core_v3_DataSource* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct envoy_config_core_v3_DataSource*) = value;
-}
-UPB_INLINE struct envoy_config_core_v3_DataSource* envoy_extensions_transport_sockets_tls_v3_TlsCertificate_mutable_certificate_chain(envoy_extensions_transport_sockets_tls_v3_TlsCertificate *msg, upb_arena *arena) {
- struct envoy_config_core_v3_DataSource* sub = (struct envoy_config_core_v3_DataSource*)envoy_extensions_transport_sockets_tls_v3_TlsCertificate_certificate_chain(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_DataSource*)_upb_msg_new(&envoy_config_core_v3_DataSource_msginit, arena);
- if (!sub) return NULL;
- envoy_extensions_transport_sockets_tls_v3_TlsCertificate_set_certificate_chain(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_TlsCertificate_set_private_key(envoy_extensions_transport_sockets_tls_v3_TlsCertificate *msg, struct envoy_config_core_v3_DataSource* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_config_core_v3_DataSource*) = value;
-}
-UPB_INLINE struct envoy_config_core_v3_DataSource* envoy_extensions_transport_sockets_tls_v3_TlsCertificate_mutable_private_key(envoy_extensions_transport_sockets_tls_v3_TlsCertificate *msg, upb_arena *arena) {
- struct envoy_config_core_v3_DataSource* sub = (struct envoy_config_core_v3_DataSource*)envoy_extensions_transport_sockets_tls_v3_TlsCertificate_private_key(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_DataSource*)_upb_msg_new(&envoy_config_core_v3_DataSource_msginit, arena);
- if (!sub) return NULL;
- envoy_extensions_transport_sockets_tls_v3_TlsCertificate_set_private_key(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_TlsCertificate_set_password(envoy_extensions_transport_sockets_tls_v3_TlsCertificate *msg, struct envoy_config_core_v3_DataSource* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct envoy_config_core_v3_DataSource*) = value;
-}
-UPB_INLINE struct envoy_config_core_v3_DataSource* envoy_extensions_transport_sockets_tls_v3_TlsCertificate_mutable_password(envoy_extensions_transport_sockets_tls_v3_TlsCertificate *msg, upb_arena *arena) {
- struct envoy_config_core_v3_DataSource* sub = (struct envoy_config_core_v3_DataSource*)envoy_extensions_transport_sockets_tls_v3_TlsCertificate_password(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_DataSource*)_upb_msg_new(&envoy_config_core_v3_DataSource_msginit, arena);
- if (!sub) return NULL;
- envoy_extensions_transport_sockets_tls_v3_TlsCertificate_set_password(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_TlsCertificate_set_ocsp_staple(envoy_extensions_transport_sockets_tls_v3_TlsCertificate *msg, struct envoy_config_core_v3_DataSource* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct envoy_config_core_v3_DataSource*) = value;
-}
-UPB_INLINE struct envoy_config_core_v3_DataSource* envoy_extensions_transport_sockets_tls_v3_TlsCertificate_mutable_ocsp_staple(envoy_extensions_transport_sockets_tls_v3_TlsCertificate *msg, upb_arena *arena) {
- struct envoy_config_core_v3_DataSource* sub = (struct envoy_config_core_v3_DataSource*)envoy_extensions_transport_sockets_tls_v3_TlsCertificate_ocsp_staple(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_DataSource*)_upb_msg_new(&envoy_config_core_v3_DataSource_msginit, arena);
- if (!sub) return NULL;
- envoy_extensions_transport_sockets_tls_v3_TlsCertificate_set_ocsp_staple(msg, sub);
- }
- return sub;
-}
-UPB_INLINE struct envoy_config_core_v3_DataSource** envoy_extensions_transport_sockets_tls_v3_TlsCertificate_mutable_signed_certificate_timestamp(envoy_extensions_transport_sockets_tls_v3_TlsCertificate *msg, size_t *len) {
- return (struct envoy_config_core_v3_DataSource**)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 40), len);
-}
-UPB_INLINE struct envoy_config_core_v3_DataSource** envoy_extensions_transport_sockets_tls_v3_TlsCertificate_resize_signed_certificate_timestamp(envoy_extensions_transport_sockets_tls_v3_TlsCertificate *msg, size_t len, upb_arena *arena) {
- return (struct envoy_config_core_v3_DataSource**)_upb_array_resize_accessor(msg, UPB_SIZE(20, 40), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_config_core_v3_DataSource* envoy_extensions_transport_sockets_tls_v3_TlsCertificate_add_signed_certificate_timestamp(envoy_extensions_transport_sockets_tls_v3_TlsCertificate *msg, upb_arena *arena) {
- struct envoy_config_core_v3_DataSource* sub = (struct envoy_config_core_v3_DataSource*)_upb_msg_new(&envoy_config_core_v3_DataSource_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(20, 40), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_TlsCertificate_set_private_key_provider(envoy_extensions_transport_sockets_tls_v3_TlsCertificate *msg, envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(16, 32), envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider*) = value;
-}
-UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider* envoy_extensions_transport_sockets_tls_v3_TlsCertificate_mutable_private_key_provider(envoy_extensions_transport_sockets_tls_v3_TlsCertificate *msg, upb_arena *arena) {
- struct envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider* sub = (struct envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider*)envoy_extensions_transport_sockets_tls_v3_TlsCertificate_private_key_provider(msg);
- if (sub == NULL) {
- sub = (struct envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider*)_upb_msg_new(&envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_msginit, arena);
- if (!sub) return NULL;
- envoy_extensions_transport_sockets_tls_v3_TlsCertificate_set_private_key_provider(msg, sub);
- }
- return sub;
-}
-
-/* envoy.extensions.transport_sockets.tls.v3.TlsSessionTicketKeys */
-
-UPB_INLINE envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys *envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_new(upb_arena *arena) {
- return (envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys *)_upb_msg_new(&envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_msginit, arena);
-}
-UPB_INLINE envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys *envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys *ret = envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_serialize(const envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_has_keys(const envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE const struct envoy_config_core_v3_DataSource* const* envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_keys(const envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys *msg, size_t *len) { return (const struct envoy_config_core_v3_DataSource* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
-
-UPB_INLINE struct envoy_config_core_v3_DataSource** envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_mutable_keys(envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys *msg, size_t *len) {
- return (struct envoy_config_core_v3_DataSource**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
-}
-UPB_INLINE struct envoy_config_core_v3_DataSource** envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_resize_keys(envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys *msg, size_t len, upb_arena *arena) {
- return (struct envoy_config_core_v3_DataSource**)_upb_array_resize_accessor(msg, UPB_SIZE(0, 0), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_config_core_v3_DataSource* envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_add_keys(envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys *msg, upb_arena *arena) {
- struct envoy_config_core_v3_DataSource* sub = (struct envoy_config_core_v3_DataSource*)_upb_msg_new(&envoy_config_core_v3_DataSource_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(0, 0), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-
-/* envoy.extensions.transport_sockets.tls.v3.CertificateValidationContext */
-
-UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_new(upb_arena *arena) {
- return (envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *)_upb_msg_new(&envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msginit, arena);
-}
-UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *ret = envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_serialize(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_has_trusted_ca(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 16)); }
-UPB_INLINE const struct envoy_config_core_v3_DataSource* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_trusted_ca(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const struct envoy_config_core_v3_DataSource*); }
-UPB_INLINE upb_strview const* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_verify_certificate_hash(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(24, 40), len); }
-UPB_INLINE upb_strview const* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_verify_certificate_spki(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(28, 48), len); }
-UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_has_require_signed_certificate_timestamp(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 24)); }
-UPB_INLINE const struct google_protobuf_BoolValue* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_require_signed_certificate_timestamp(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const struct google_protobuf_BoolValue*); }
-UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_has_crl(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 32)); }
-UPB_INLINE const struct envoy_config_core_v3_DataSource* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_crl(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const struct envoy_config_core_v3_DataSource*); }
-UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_allow_expired_certificate(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool); }
-UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_has_match_subject_alt_names(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(32, 56)); }
-UPB_INLINE const struct envoy_type_matcher_v3_StringMatcher* const* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_match_subject_alt_names(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg, size_t *len) { return (const struct envoy_type_matcher_v3_StringMatcher* const*)_upb_array_accessor(msg, UPB_SIZE(32, 56), len); }
-UPB_INLINE int32_t envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_trust_chain_verification(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
-
-UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_set_trusted_ca(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg, struct envoy_config_core_v3_DataSource* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(12, 16), struct envoy_config_core_v3_DataSource*) = value;
-}
-UPB_INLINE struct envoy_config_core_v3_DataSource* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_mutable_trusted_ca(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg, upb_arena *arena) {
- struct envoy_config_core_v3_DataSource* sub = (struct envoy_config_core_v3_DataSource*)envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_trusted_ca(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_DataSource*)_upb_msg_new(&envoy_config_core_v3_DataSource_msginit, arena);
- if (!sub) return NULL;
- envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_set_trusted_ca(msg, sub);
- }
- return sub;
-}
-UPB_INLINE upb_strview* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_mutable_verify_certificate_hash(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg, size_t *len) {
- return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 40), len);
-}
-UPB_INLINE upb_strview* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_resize_verify_certificate_hash(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg, size_t len, upb_arena *arena) {
- return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(24, 40), len, UPB_TYPE_STRING, arena);
-}
-UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_add_verify_certificate_hash(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg, upb_strview val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(24, 40), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
- arena);
-}
-UPB_INLINE upb_strview* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_mutable_verify_certificate_spki(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg, size_t *len) {
- return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 48), len);
-}
-UPB_INLINE upb_strview* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_resize_verify_certificate_spki(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg, size_t len, upb_arena *arena) {
- return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(28, 48), len, UPB_TYPE_STRING, arena);
-}
-UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_add_verify_certificate_spki(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg, upb_strview val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(28, 48), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
- arena);
-}
-UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_set_require_signed_certificate_timestamp(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg, struct google_protobuf_BoolValue* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(16, 24), struct google_protobuf_BoolValue*) = value;
-}
-UPB_INLINE struct google_protobuf_BoolValue* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_mutable_require_signed_certificate_timestamp(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg, upb_arena *arena) {
- struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_require_signed_certificate_timestamp(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_BoolValue*)_upb_msg_new(&google_protobuf_BoolValue_msginit, arena);
- if (!sub) return NULL;
- envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_set_require_signed_certificate_timestamp(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_set_crl(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg, struct envoy_config_core_v3_DataSource* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(20, 32), struct envoy_config_core_v3_DataSource*) = value;
-}
-UPB_INLINE struct envoy_config_core_v3_DataSource* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_mutable_crl(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg, upb_arena *arena) {
- struct envoy_config_core_v3_DataSource* sub = (struct envoy_config_core_v3_DataSource*)envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_crl(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_DataSource*)_upb_msg_new(&envoy_config_core_v3_DataSource_msginit, arena);
- if (!sub) return NULL;
- envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_set_crl(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_set_allow_expired_certificate(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = value;
-}
-UPB_INLINE struct envoy_type_matcher_v3_StringMatcher** envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_mutable_match_subject_alt_names(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg, size_t *len) {
- return (struct envoy_type_matcher_v3_StringMatcher**)_upb_array_mutable_accessor(msg, UPB_SIZE(32, 56), len);
-}
-UPB_INLINE struct envoy_type_matcher_v3_StringMatcher** envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_resize_match_subject_alt_names(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg, size_t len, upb_arena *arena) {
- return (struct envoy_type_matcher_v3_StringMatcher**)_upb_array_resize_accessor(msg, UPB_SIZE(32, 56), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_type_matcher_v3_StringMatcher* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_add_match_subject_alt_names(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg, upb_arena *arena) {
- struct envoy_type_matcher_v3_StringMatcher* sub = (struct envoy_type_matcher_v3_StringMatcher*)_upb_msg_new(&envoy_type_matcher_v3_StringMatcher_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(32, 56), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_set_trust_chain_verification(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg, int32_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* ENVOY_EXTENSIONS_TRANSPORT_SOCKETS_TLS_V3_COMMON_PROTO_UPB_H_ */
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/extensions/transport_sockets/tls/v3/common.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_EXTENSIONS_TRANSPORT_SOCKETS_TLS_V3_COMMON_PROTO_UPB_H_
+#define ENVOY_EXTENSIONS_TRANSPORT_SOCKETS_TLS_V3_COMMON_PROTO_UPB_H_
+
+#include "upb/msg.h"
+#include "upb/decode.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_extensions_transport_sockets_tls_v3_TlsParameters;
+struct envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider;
+struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate;
+struct envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys;
+struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext;
+typedef struct envoy_extensions_transport_sockets_tls_v3_TlsParameters envoy_extensions_transport_sockets_tls_v3_TlsParameters;
+typedef struct envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider;
+typedef struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate envoy_extensions_transport_sockets_tls_v3_TlsCertificate;
+typedef struct envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys;
+typedef struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext;
+extern const upb_msglayout envoy_extensions_transport_sockets_tls_v3_TlsParameters_msginit;
+extern const upb_msglayout envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_msginit;
+extern const upb_msglayout envoy_extensions_transport_sockets_tls_v3_TlsCertificate_msginit;
+extern const upb_msglayout envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_msginit;
+extern const upb_msglayout envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msginit;
+struct envoy_config_core_v3_DataSource;
+struct envoy_type_matcher_v3_StringMatcher;
+struct google_protobuf_Any;
+struct google_protobuf_BoolValue;
+extern const upb_msglayout envoy_config_core_v3_DataSource_msginit;
+extern const upb_msglayout envoy_type_matcher_v3_StringMatcher_msginit;
+extern const upb_msglayout google_protobuf_Any_msginit;
+extern const upb_msglayout google_protobuf_BoolValue_msginit;
+
+typedef enum {
+ envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_VERIFY_TRUST_CHAIN = 0,
+ envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_ACCEPT_UNTRUSTED = 1
+} envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_TrustChainVerification;
+
+typedef enum {
+ envoy_extensions_transport_sockets_tls_v3_TlsParameters_TLS_AUTO = 0,
+ envoy_extensions_transport_sockets_tls_v3_TlsParameters_TLSv1_0 = 1,
+ envoy_extensions_transport_sockets_tls_v3_TlsParameters_TLSv1_1 = 2,
+ envoy_extensions_transport_sockets_tls_v3_TlsParameters_TLSv1_2 = 3,
+ envoy_extensions_transport_sockets_tls_v3_TlsParameters_TLSv1_3 = 4
+} envoy_extensions_transport_sockets_tls_v3_TlsParameters_TlsProtocol;
+
+
+/* envoy.extensions.transport_sockets.tls.v3.TlsParameters */
+
+UPB_INLINE envoy_extensions_transport_sockets_tls_v3_TlsParameters *envoy_extensions_transport_sockets_tls_v3_TlsParameters_new(upb_arena *arena) {
+ return (envoy_extensions_transport_sockets_tls_v3_TlsParameters *)_upb_msg_new(&envoy_extensions_transport_sockets_tls_v3_TlsParameters_msginit, arena);
+}
+UPB_INLINE envoy_extensions_transport_sockets_tls_v3_TlsParameters *envoy_extensions_transport_sockets_tls_v3_TlsParameters_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_extensions_transport_sockets_tls_v3_TlsParameters *ret = envoy_extensions_transport_sockets_tls_v3_TlsParameters_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_TlsParameters_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_extensions_transport_sockets_tls_v3_TlsParameters_serialize(const envoy_extensions_transport_sockets_tls_v3_TlsParameters *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_extensions_transport_sockets_tls_v3_TlsParameters_msginit, arena, len);
+}
+
+UPB_INLINE int32_t envoy_extensions_transport_sockets_tls_v3_TlsParameters_tls_minimum_protocol_version(const envoy_extensions_transport_sockets_tls_v3_TlsParameters *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
+UPB_INLINE int32_t envoy_extensions_transport_sockets_tls_v3_TlsParameters_tls_maximum_protocol_version(const envoy_extensions_transport_sockets_tls_v3_TlsParameters *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); }
+UPB_INLINE upb_strview const* envoy_extensions_transport_sockets_tls_v3_TlsParameters_cipher_suites(const envoy_extensions_transport_sockets_tls_v3_TlsParameters *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(16, 16), len); }
+UPB_INLINE upb_strview const* envoy_extensions_transport_sockets_tls_v3_TlsParameters_ecdh_curves(const envoy_extensions_transport_sockets_tls_v3_TlsParameters *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(20, 24), len); }
+
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_TlsParameters_set_tls_minimum_protocol_version(envoy_extensions_transport_sockets_tls_v3_TlsParameters *msg, int32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_TlsParameters_set_tls_maximum_protocol_version(envoy_extensions_transport_sockets_tls_v3_TlsParameters *msg, int32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
+}
+UPB_INLINE upb_strview* envoy_extensions_transport_sockets_tls_v3_TlsParameters_mutable_cipher_suites(envoy_extensions_transport_sockets_tls_v3_TlsParameters *msg, size_t *len) {
+ return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 16), len);
+}
+UPB_INLINE upb_strview* envoy_extensions_transport_sockets_tls_v3_TlsParameters_resize_cipher_suites(envoy_extensions_transport_sockets_tls_v3_TlsParameters *msg, size_t len, upb_arena *arena) {
+ return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(16, 16), len, UPB_TYPE_STRING, arena);
+}
+UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_TlsParameters_add_cipher_suites(envoy_extensions_transport_sockets_tls_v3_TlsParameters *msg, upb_strview val, upb_arena *arena) {
+ return _upb_array_append_accessor(msg, UPB_SIZE(16, 16), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
+ arena);
+}
+UPB_INLINE upb_strview* envoy_extensions_transport_sockets_tls_v3_TlsParameters_mutable_ecdh_curves(envoy_extensions_transport_sockets_tls_v3_TlsParameters *msg, size_t *len) {
+ return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 24), len);
+}
+UPB_INLINE upb_strview* envoy_extensions_transport_sockets_tls_v3_TlsParameters_resize_ecdh_curves(envoy_extensions_transport_sockets_tls_v3_TlsParameters *msg, size_t len, upb_arena *arena) {
+ return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(20, 24), len, UPB_TYPE_STRING, arena);
+}
+UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_TlsParameters_add_ecdh_curves(envoy_extensions_transport_sockets_tls_v3_TlsParameters *msg, upb_strview val, upb_arena *arena) {
+ return _upb_array_append_accessor(msg, UPB_SIZE(20, 24), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
+ arena);
+}
+
+/* envoy.extensions.transport_sockets.tls.v3.PrivateKeyProvider */
+
+UPB_INLINE envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider *envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_new(upb_arena *arena) {
+ return (envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider *)_upb_msg_new(&envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_msginit, arena);
+}
+UPB_INLINE envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider *envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider *ret = envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_serialize(const envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_msginit, arena, len);
+}
+
+typedef enum {
+ envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_config_type_typed_config = 3,
+ envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_config_type_NOT_SET = 0
+} envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_config_type_oneofcases;
+UPB_INLINE envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_config_type_oneofcases envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_config_type_case(const envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider* msg) { return (envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_config_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(12, 24), int32_t); }
+
+UPB_INLINE upb_strview envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_provider_name(const envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_has_typed_config(const envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 3; }
+UPB_INLINE const struct google_protobuf_Any* envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_typed_config(const envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider *msg) { return UPB_READ_ONEOF(msg, const struct google_protobuf_Any*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 3, NULL); }
+
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_set_provider_name(envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_set_typed_config(envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider *msg, struct google_protobuf_Any* value) {
+ UPB_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 3);
+}
+UPB_INLINE struct google_protobuf_Any* envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_mutable_typed_config(envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider *msg, upb_arena *arena) {
+ struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_typed_config(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_set_typed_config(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.extensions.transport_sockets.tls.v3.TlsCertificate */
+
+UPB_INLINE envoy_extensions_transport_sockets_tls_v3_TlsCertificate *envoy_extensions_transport_sockets_tls_v3_TlsCertificate_new(upb_arena *arena) {
+ return (envoy_extensions_transport_sockets_tls_v3_TlsCertificate *)_upb_msg_new(&envoy_extensions_transport_sockets_tls_v3_TlsCertificate_msginit, arena);
+}
+UPB_INLINE envoy_extensions_transport_sockets_tls_v3_TlsCertificate *envoy_extensions_transport_sockets_tls_v3_TlsCertificate_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_extensions_transport_sockets_tls_v3_TlsCertificate *ret = envoy_extensions_transport_sockets_tls_v3_TlsCertificate_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_TlsCertificate_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_extensions_transport_sockets_tls_v3_TlsCertificate_serialize(const envoy_extensions_transport_sockets_tls_v3_TlsCertificate *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_extensions_transport_sockets_tls_v3_TlsCertificate_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_TlsCertificate_has_certificate_chain(const envoy_extensions_transport_sockets_tls_v3_TlsCertificate *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE const struct envoy_config_core_v3_DataSource* envoy_extensions_transport_sockets_tls_v3_TlsCertificate_certificate_chain(const envoy_extensions_transport_sockets_tls_v3_TlsCertificate *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct envoy_config_core_v3_DataSource*); }
+UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_TlsCertificate_has_private_key(const envoy_extensions_transport_sockets_tls_v3_TlsCertificate *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
+UPB_INLINE const struct envoy_config_core_v3_DataSource* envoy_extensions_transport_sockets_tls_v3_TlsCertificate_private_key(const envoy_extensions_transport_sockets_tls_v3_TlsCertificate *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_config_core_v3_DataSource*); }
+UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_TlsCertificate_has_password(const envoy_extensions_transport_sockets_tls_v3_TlsCertificate *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
+UPB_INLINE const struct envoy_config_core_v3_DataSource* envoy_extensions_transport_sockets_tls_v3_TlsCertificate_password(const envoy_extensions_transport_sockets_tls_v3_TlsCertificate *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct envoy_config_core_v3_DataSource*); }
+UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_TlsCertificate_has_ocsp_staple(const envoy_extensions_transport_sockets_tls_v3_TlsCertificate *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
+UPB_INLINE const struct envoy_config_core_v3_DataSource* envoy_extensions_transport_sockets_tls_v3_TlsCertificate_ocsp_staple(const envoy_extensions_transport_sockets_tls_v3_TlsCertificate *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct envoy_config_core_v3_DataSource*); }
+UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_TlsCertificate_has_signed_certificate_timestamp(const envoy_extensions_transport_sockets_tls_v3_TlsCertificate *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 40)); }
+UPB_INLINE const struct envoy_config_core_v3_DataSource* const* envoy_extensions_transport_sockets_tls_v3_TlsCertificate_signed_certificate_timestamp(const envoy_extensions_transport_sockets_tls_v3_TlsCertificate *msg, size_t *len) { return (const struct envoy_config_core_v3_DataSource* const*)_upb_array_accessor(msg, UPB_SIZE(20, 40), len); }
+UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_TlsCertificate_has_private_key_provider(const envoy_extensions_transport_sockets_tls_v3_TlsCertificate *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); }
+UPB_INLINE const envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider* envoy_extensions_transport_sockets_tls_v3_TlsCertificate_private_key_provider(const envoy_extensions_transport_sockets_tls_v3_TlsCertificate *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider*); }
+
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_TlsCertificate_set_certificate_chain(envoy_extensions_transport_sockets_tls_v3_TlsCertificate *msg, struct envoy_config_core_v3_DataSource* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct envoy_config_core_v3_DataSource*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_DataSource* envoy_extensions_transport_sockets_tls_v3_TlsCertificate_mutable_certificate_chain(envoy_extensions_transport_sockets_tls_v3_TlsCertificate *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_DataSource* sub = (struct envoy_config_core_v3_DataSource*)envoy_extensions_transport_sockets_tls_v3_TlsCertificate_certificate_chain(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_DataSource*)_upb_msg_new(&envoy_config_core_v3_DataSource_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_transport_sockets_tls_v3_TlsCertificate_set_certificate_chain(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_TlsCertificate_set_private_key(envoy_extensions_transport_sockets_tls_v3_TlsCertificate *msg, struct envoy_config_core_v3_DataSource* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_config_core_v3_DataSource*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_DataSource* envoy_extensions_transport_sockets_tls_v3_TlsCertificate_mutable_private_key(envoy_extensions_transport_sockets_tls_v3_TlsCertificate *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_DataSource* sub = (struct envoy_config_core_v3_DataSource*)envoy_extensions_transport_sockets_tls_v3_TlsCertificate_private_key(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_DataSource*)_upb_msg_new(&envoy_config_core_v3_DataSource_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_transport_sockets_tls_v3_TlsCertificate_set_private_key(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_TlsCertificate_set_password(envoy_extensions_transport_sockets_tls_v3_TlsCertificate *msg, struct envoy_config_core_v3_DataSource* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct envoy_config_core_v3_DataSource*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_DataSource* envoy_extensions_transport_sockets_tls_v3_TlsCertificate_mutable_password(envoy_extensions_transport_sockets_tls_v3_TlsCertificate *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_DataSource* sub = (struct envoy_config_core_v3_DataSource*)envoy_extensions_transport_sockets_tls_v3_TlsCertificate_password(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_DataSource*)_upb_msg_new(&envoy_config_core_v3_DataSource_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_transport_sockets_tls_v3_TlsCertificate_set_password(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_TlsCertificate_set_ocsp_staple(envoy_extensions_transport_sockets_tls_v3_TlsCertificate *msg, struct envoy_config_core_v3_DataSource* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct envoy_config_core_v3_DataSource*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_DataSource* envoy_extensions_transport_sockets_tls_v3_TlsCertificate_mutable_ocsp_staple(envoy_extensions_transport_sockets_tls_v3_TlsCertificate *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_DataSource* sub = (struct envoy_config_core_v3_DataSource*)envoy_extensions_transport_sockets_tls_v3_TlsCertificate_ocsp_staple(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_DataSource*)_upb_msg_new(&envoy_config_core_v3_DataSource_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_transport_sockets_tls_v3_TlsCertificate_set_ocsp_staple(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE struct envoy_config_core_v3_DataSource** envoy_extensions_transport_sockets_tls_v3_TlsCertificate_mutable_signed_certificate_timestamp(envoy_extensions_transport_sockets_tls_v3_TlsCertificate *msg, size_t *len) {
+ return (struct envoy_config_core_v3_DataSource**)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 40), len);
+}
+UPB_INLINE struct envoy_config_core_v3_DataSource** envoy_extensions_transport_sockets_tls_v3_TlsCertificate_resize_signed_certificate_timestamp(envoy_extensions_transport_sockets_tls_v3_TlsCertificate *msg, size_t len, upb_arena *arena) {
+ return (struct envoy_config_core_v3_DataSource**)_upb_array_resize_accessor(msg, UPB_SIZE(20, 40), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_config_core_v3_DataSource* envoy_extensions_transport_sockets_tls_v3_TlsCertificate_add_signed_certificate_timestamp(envoy_extensions_transport_sockets_tls_v3_TlsCertificate *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_DataSource* sub = (struct envoy_config_core_v3_DataSource*)_upb_msg_new(&envoy_config_core_v3_DataSource_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(20, 40), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_TlsCertificate_set_private_key_provider(envoy_extensions_transport_sockets_tls_v3_TlsCertificate *msg, envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider*) = value;
+}
+UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider* envoy_extensions_transport_sockets_tls_v3_TlsCertificate_mutable_private_key_provider(envoy_extensions_transport_sockets_tls_v3_TlsCertificate *msg, upb_arena *arena) {
+ struct envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider* sub = (struct envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider*)envoy_extensions_transport_sockets_tls_v3_TlsCertificate_private_key_provider(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider*)_upb_msg_new(&envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_transport_sockets_tls_v3_TlsCertificate_set_private_key_provider(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.extensions.transport_sockets.tls.v3.TlsSessionTicketKeys */
+
+UPB_INLINE envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys *envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_new(upb_arena *arena) {
+ return (envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys *)_upb_msg_new(&envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_msginit, arena);
+}
+UPB_INLINE envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys *envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys *ret = envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_serialize(const envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_has_keys(const envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE const struct envoy_config_core_v3_DataSource* const* envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_keys(const envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys *msg, size_t *len) { return (const struct envoy_config_core_v3_DataSource* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
+
+UPB_INLINE struct envoy_config_core_v3_DataSource** envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_mutable_keys(envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys *msg, size_t *len) {
+ return (struct envoy_config_core_v3_DataSource**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
+}
+UPB_INLINE struct envoy_config_core_v3_DataSource** envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_resize_keys(envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys *msg, size_t len, upb_arena *arena) {
+ return (struct envoy_config_core_v3_DataSource**)_upb_array_resize_accessor(msg, UPB_SIZE(0, 0), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_config_core_v3_DataSource* envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_add_keys(envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_DataSource* sub = (struct envoy_config_core_v3_DataSource*)_upb_msg_new(&envoy_config_core_v3_DataSource_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(0, 0), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+
+/* envoy.extensions.transport_sockets.tls.v3.CertificateValidationContext */
+
+UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_new(upb_arena *arena) {
+ return (envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *)_upb_msg_new(&envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msginit, arena);
+}
+UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *ret = envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_serialize(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_has_trusted_ca(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 16)); }
+UPB_INLINE const struct envoy_config_core_v3_DataSource* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_trusted_ca(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const struct envoy_config_core_v3_DataSource*); }
+UPB_INLINE upb_strview const* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_verify_certificate_hash(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(24, 40), len); }
+UPB_INLINE upb_strview const* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_verify_certificate_spki(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(28, 48), len); }
+UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_has_require_signed_certificate_timestamp(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 24)); }
+UPB_INLINE const struct google_protobuf_BoolValue* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_require_signed_certificate_timestamp(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const struct google_protobuf_BoolValue*); }
+UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_has_crl(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 32)); }
+UPB_INLINE const struct envoy_config_core_v3_DataSource* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_crl(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const struct envoy_config_core_v3_DataSource*); }
+UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_allow_expired_certificate(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool); }
+UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_has_match_subject_alt_names(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(32, 56)); }
+UPB_INLINE const struct envoy_type_matcher_v3_StringMatcher* const* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_match_subject_alt_names(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg, size_t *len) { return (const struct envoy_type_matcher_v3_StringMatcher* const*)_upb_array_accessor(msg, UPB_SIZE(32, 56), len); }
+UPB_INLINE int32_t envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_trust_chain_verification(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
+
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_set_trusted_ca(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg, struct envoy_config_core_v3_DataSource* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 16), struct envoy_config_core_v3_DataSource*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_DataSource* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_mutable_trusted_ca(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_DataSource* sub = (struct envoy_config_core_v3_DataSource*)envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_trusted_ca(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_DataSource*)_upb_msg_new(&envoy_config_core_v3_DataSource_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_set_trusted_ca(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE upb_strview* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_mutable_verify_certificate_hash(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg, size_t *len) {
+ return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 40), len);
+}
+UPB_INLINE upb_strview* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_resize_verify_certificate_hash(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg, size_t len, upb_arena *arena) {
+ return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(24, 40), len, UPB_TYPE_STRING, arena);
+}
+UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_add_verify_certificate_hash(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg, upb_strview val, upb_arena *arena) {
+ return _upb_array_append_accessor(msg, UPB_SIZE(24, 40), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
+ arena);
+}
+UPB_INLINE upb_strview* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_mutable_verify_certificate_spki(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg, size_t *len) {
+ return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 48), len);
+}
+UPB_INLINE upb_strview* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_resize_verify_certificate_spki(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg, size_t len, upb_arena *arena) {
+ return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(28, 48), len, UPB_TYPE_STRING, arena);
+}
+UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_add_verify_certificate_spki(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg, upb_strview val, upb_arena *arena) {
+ return _upb_array_append_accessor(msg, UPB_SIZE(28, 48), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
+ arena);
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_set_require_signed_certificate_timestamp(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg, struct google_protobuf_BoolValue* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), struct google_protobuf_BoolValue*) = value;
+}
+UPB_INLINE struct google_protobuf_BoolValue* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_mutable_require_signed_certificate_timestamp(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg, upb_arena *arena) {
+ struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_require_signed_certificate_timestamp(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_BoolValue*)_upb_msg_new(&google_protobuf_BoolValue_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_set_require_signed_certificate_timestamp(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_set_crl(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg, struct envoy_config_core_v3_DataSource* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 32), struct envoy_config_core_v3_DataSource*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_DataSource* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_mutable_crl(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_DataSource* sub = (struct envoy_config_core_v3_DataSource*)envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_crl(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_DataSource*)_upb_msg_new(&envoy_config_core_v3_DataSource_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_set_crl(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_set_allow_expired_certificate(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = value;
+}
+UPB_INLINE struct envoy_type_matcher_v3_StringMatcher** envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_mutable_match_subject_alt_names(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg, size_t *len) {
+ return (struct envoy_type_matcher_v3_StringMatcher**)_upb_array_mutable_accessor(msg, UPB_SIZE(32, 56), len);
+}
+UPB_INLINE struct envoy_type_matcher_v3_StringMatcher** envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_resize_match_subject_alt_names(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg, size_t len, upb_arena *arena) {
+ return (struct envoy_type_matcher_v3_StringMatcher**)_upb_array_resize_accessor(msg, UPB_SIZE(32, 56), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_type_matcher_v3_StringMatcher* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_add_match_subject_alt_names(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg, upb_arena *arena) {
+ struct envoy_type_matcher_v3_StringMatcher* sub = (struct envoy_type_matcher_v3_StringMatcher*)_upb_msg_new(&envoy_type_matcher_v3_StringMatcher_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(32, 56), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_set_trust_chain_verification(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg, int32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_EXTENSIONS_TRANSPORT_SOCKETS_TLS_V3_COMMON_PROTO_UPB_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.c
index c686fbb7f54..cbd77b5246f 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.c
@@ -1,76 +1,76 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/extensions/transport_sockets/tls/v3/secret.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include <stddef.h>
-#include "upb/msg.h"
-#include "envoy/extensions/transport_sockets/tls/v3/secret.upb.h"
-#include "envoy/config/core/v3/base.upb.h"
-#include "envoy/config/core/v3/config_source.upb.h"
-#include "envoy/extensions/transport_sockets/tls/v3/common.upb.h"
-#include "udpa/core/v1/resource_locator.upb.h"
-#include "udpa/annotations/migrate.upb.h"
-#include "udpa/annotations/sensitive.upb.h"
-#include "udpa/annotations/status.upb.h"
-#include "udpa/annotations/versioning.upb.h"
-
-#include "upb/port_def.inc"
-
-static const upb_msglayout *const envoy_extensions_transport_sockets_tls_v3_GenericSecret_submsgs[1] = {
- &envoy_config_core_v3_DataSource_msginit,
-};
-
-static const upb_msglayout_field envoy_extensions_transport_sockets_tls_v3_GenericSecret__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
-};
-
-const upb_msglayout envoy_extensions_transport_sockets_tls_v3_GenericSecret_msginit = {
- &envoy_extensions_transport_sockets_tls_v3_GenericSecret_submsgs[0],
- &envoy_extensions_transport_sockets_tls_v3_GenericSecret__fields[0],
- UPB_SIZE(4, 8), 1, false,
-};
-
-static const upb_msglayout *const envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_submsgs[2] = {
- &envoy_config_core_v3_ConfigSource_msginit,
- &udpa_core_v1_ResourceLocator_msginit,
-};
-
-static const upb_msglayout_field envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig__fields[3] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 11, 1},
- {3, UPB_SIZE(12, 24), 0, 1, 11, 1},
-};
-
-const upb_msglayout envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msginit = {
- &envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_submsgs[0],
- &envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig__fields[0],
- UPB_SIZE(16, 32), 3, false,
-};
-
-static const upb_msglayout *const envoy_extensions_transport_sockets_tls_v3_Secret_submsgs[4] = {
- &envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msginit,
- &envoy_extensions_transport_sockets_tls_v3_GenericSecret_msginit,
- &envoy_extensions_transport_sockets_tls_v3_TlsCertificate_msginit,
- &envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_msginit,
-};
-
-static const upb_msglayout_field envoy_extensions_transport_sockets_tls_v3_Secret__fields[5] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 2, 11, 1},
- {3, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 3, 11, 1},
- {4, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, 1},
- {5, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 1, 11, 1},
-};
-
-const upb_msglayout envoy_extensions_transport_sockets_tls_v3_Secret_msginit = {
- &envoy_extensions_transport_sockets_tls_v3_Secret_submsgs[0],
- &envoy_extensions_transport_sockets_tls_v3_Secret__fields[0],
- UPB_SIZE(16, 32), 5, false,
-};
-
-#include "upb/port_undef.inc"
-
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/extensions/transport_sockets/tls/v3/secret.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg.h"
+#include "envoy/extensions/transport_sockets/tls/v3/secret.upb.h"
+#include "envoy/config/core/v3/base.upb.h"
+#include "envoy/config/core/v3/config_source.upb.h"
+#include "envoy/extensions/transport_sockets/tls/v3/common.upb.h"
+#include "udpa/core/v1/resource_locator.upb.h"
+#include "udpa/annotations/migrate.upb.h"
+#include "udpa/annotations/sensitive.upb.h"
+#include "udpa/annotations/status.upb.h"
+#include "udpa/annotations/versioning.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_msglayout *const envoy_extensions_transport_sockets_tls_v3_GenericSecret_submsgs[1] = {
+ &envoy_config_core_v3_DataSource_msginit,
+};
+
+static const upb_msglayout_field envoy_extensions_transport_sockets_tls_v3_GenericSecret__fields[1] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
+};
+
+const upb_msglayout envoy_extensions_transport_sockets_tls_v3_GenericSecret_msginit = {
+ &envoy_extensions_transport_sockets_tls_v3_GenericSecret_submsgs[0],
+ &envoy_extensions_transport_sockets_tls_v3_GenericSecret__fields[0],
+ UPB_SIZE(4, 8), 1, false,
+};
+
+static const upb_msglayout *const envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_submsgs[2] = {
+ &envoy_config_core_v3_ConfigSource_msginit,
+ &udpa_core_v1_ResourceLocator_msginit,
+};
+
+static const upb_msglayout_field envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig__fields[3] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {2, UPB_SIZE(8, 16), 0, 0, 11, 1},
+ {3, UPB_SIZE(12, 24), 0, 1, 11, 1},
+};
+
+const upb_msglayout envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msginit = {
+ &envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_submsgs[0],
+ &envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig__fields[0],
+ UPB_SIZE(16, 32), 3, false,
+};
+
+static const upb_msglayout *const envoy_extensions_transport_sockets_tls_v3_Secret_submsgs[4] = {
+ &envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msginit,
+ &envoy_extensions_transport_sockets_tls_v3_GenericSecret_msginit,
+ &envoy_extensions_transport_sockets_tls_v3_TlsCertificate_msginit,
+ &envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_msginit,
+};
+
+static const upb_msglayout_field envoy_extensions_transport_sockets_tls_v3_Secret__fields[5] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 2, 11, 1},
+ {3, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 3, 11, 1},
+ {4, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, 1},
+ {5, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 1, 11, 1},
+};
+
+const upb_msglayout envoy_extensions_transport_sockets_tls_v3_Secret_msginit = {
+ &envoy_extensions_transport_sockets_tls_v3_Secret_submsgs[0],
+ &envoy_extensions_transport_sockets_tls_v3_Secret__fields[0],
+ UPB_SIZE(16, 32), 5, false,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.h
index 3b1862472f3..2a4438d9c86 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.h
@@ -1,214 +1,214 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/extensions/transport_sockets/tls/v3/secret.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef ENVOY_EXTENSIONS_TRANSPORT_SOCKETS_TLS_V3_SECRET_PROTO_UPB_H_
-#define ENVOY_EXTENSIONS_TRANSPORT_SOCKETS_TLS_V3_SECRET_PROTO_UPB_H_
-
-#include "upb/msg.h"
-#include "upb/decode.h"
-#include "upb/encode.h"
-
-#include "upb/port_def.inc"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct envoy_extensions_transport_sockets_tls_v3_GenericSecret;
-struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig;
-struct envoy_extensions_transport_sockets_tls_v3_Secret;
-typedef struct envoy_extensions_transport_sockets_tls_v3_GenericSecret envoy_extensions_transport_sockets_tls_v3_GenericSecret;
-typedef struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig;
-typedef struct envoy_extensions_transport_sockets_tls_v3_Secret envoy_extensions_transport_sockets_tls_v3_Secret;
-extern const upb_msglayout envoy_extensions_transport_sockets_tls_v3_GenericSecret_msginit;
-extern const upb_msglayout envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msginit;
-extern const upb_msglayout envoy_extensions_transport_sockets_tls_v3_Secret_msginit;
-struct envoy_config_core_v3_ConfigSource;
-struct envoy_config_core_v3_DataSource;
-struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext;
-struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate;
-struct envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys;
-struct udpa_core_v1_ResourceLocator;
-extern const upb_msglayout envoy_config_core_v3_ConfigSource_msginit;
-extern const upb_msglayout envoy_config_core_v3_DataSource_msginit;
-extern const upb_msglayout envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msginit;
-extern const upb_msglayout envoy_extensions_transport_sockets_tls_v3_TlsCertificate_msginit;
-extern const upb_msglayout envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_msginit;
-extern const upb_msglayout udpa_core_v1_ResourceLocator_msginit;
-
-
-/* envoy.extensions.transport_sockets.tls.v3.GenericSecret */
-
-UPB_INLINE envoy_extensions_transport_sockets_tls_v3_GenericSecret *envoy_extensions_transport_sockets_tls_v3_GenericSecret_new(upb_arena *arena) {
- return (envoy_extensions_transport_sockets_tls_v3_GenericSecret *)_upb_msg_new(&envoy_extensions_transport_sockets_tls_v3_GenericSecret_msginit, arena);
-}
-UPB_INLINE envoy_extensions_transport_sockets_tls_v3_GenericSecret *envoy_extensions_transport_sockets_tls_v3_GenericSecret_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_extensions_transport_sockets_tls_v3_GenericSecret *ret = envoy_extensions_transport_sockets_tls_v3_GenericSecret_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_GenericSecret_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_extensions_transport_sockets_tls_v3_GenericSecret_serialize(const envoy_extensions_transport_sockets_tls_v3_GenericSecret *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_extensions_transport_sockets_tls_v3_GenericSecret_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_GenericSecret_has_secret(const envoy_extensions_transport_sockets_tls_v3_GenericSecret *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE const struct envoy_config_core_v3_DataSource* envoy_extensions_transport_sockets_tls_v3_GenericSecret_secret(const envoy_extensions_transport_sockets_tls_v3_GenericSecret *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct envoy_config_core_v3_DataSource*); }
-
-UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_GenericSecret_set_secret(envoy_extensions_transport_sockets_tls_v3_GenericSecret *msg, struct envoy_config_core_v3_DataSource* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct envoy_config_core_v3_DataSource*) = value;
-}
-UPB_INLINE struct envoy_config_core_v3_DataSource* envoy_extensions_transport_sockets_tls_v3_GenericSecret_mutable_secret(envoy_extensions_transport_sockets_tls_v3_GenericSecret *msg, upb_arena *arena) {
- struct envoy_config_core_v3_DataSource* sub = (struct envoy_config_core_v3_DataSource*)envoy_extensions_transport_sockets_tls_v3_GenericSecret_secret(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_DataSource*)_upb_msg_new(&envoy_config_core_v3_DataSource_msginit, arena);
- if (!sub) return NULL;
- envoy_extensions_transport_sockets_tls_v3_GenericSecret_set_secret(msg, sub);
- }
- return sub;
-}
-
-/* envoy.extensions.transport_sockets.tls.v3.SdsSecretConfig */
-
-UPB_INLINE envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig *envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_new(upb_arena *arena) {
- return (envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig *)_upb_msg_new(&envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msginit, arena);
-}
-UPB_INLINE envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig *envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig *ret = envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_serialize(const envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_name(const envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_has_sds_config(const envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const struct envoy_config_core_v3_ConfigSource* envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_sds_config(const envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct envoy_config_core_v3_ConfigSource*); }
-UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_has_sds_resource_locator(const envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
-UPB_INLINE const struct udpa_core_v1_ResourceLocator* envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_sds_resource_locator(const envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct udpa_core_v1_ResourceLocator*); }
-
-UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_set_name(envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_set_sds_config(envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig *msg, struct envoy_config_core_v3_ConfigSource* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct envoy_config_core_v3_ConfigSource*) = value;
-}
-UPB_INLINE struct envoy_config_core_v3_ConfigSource* envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_mutable_sds_config(envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig *msg, upb_arena *arena) {
- struct envoy_config_core_v3_ConfigSource* sub = (struct envoy_config_core_v3_ConfigSource*)envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_sds_config(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_ConfigSource*)_upb_msg_new(&envoy_config_core_v3_ConfigSource_msginit, arena);
- if (!sub) return NULL;
- envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_set_sds_config(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_set_sds_resource_locator(envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig *msg, struct udpa_core_v1_ResourceLocator* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct udpa_core_v1_ResourceLocator*) = value;
-}
-UPB_INLINE struct udpa_core_v1_ResourceLocator* envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_mutable_sds_resource_locator(envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig *msg, upb_arena *arena) {
- struct udpa_core_v1_ResourceLocator* sub = (struct udpa_core_v1_ResourceLocator*)envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_sds_resource_locator(msg);
- if (sub == NULL) {
- sub = (struct udpa_core_v1_ResourceLocator*)_upb_msg_new(&udpa_core_v1_ResourceLocator_msginit, arena);
- if (!sub) return NULL;
- envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_set_sds_resource_locator(msg, sub);
- }
- return sub;
-}
-
-/* envoy.extensions.transport_sockets.tls.v3.Secret */
-
-UPB_INLINE envoy_extensions_transport_sockets_tls_v3_Secret *envoy_extensions_transport_sockets_tls_v3_Secret_new(upb_arena *arena) {
- return (envoy_extensions_transport_sockets_tls_v3_Secret *)_upb_msg_new(&envoy_extensions_transport_sockets_tls_v3_Secret_msginit, arena);
-}
-UPB_INLINE envoy_extensions_transport_sockets_tls_v3_Secret *envoy_extensions_transport_sockets_tls_v3_Secret_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_extensions_transport_sockets_tls_v3_Secret *ret = envoy_extensions_transport_sockets_tls_v3_Secret_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_Secret_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_extensions_transport_sockets_tls_v3_Secret_serialize(const envoy_extensions_transport_sockets_tls_v3_Secret *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_extensions_transport_sockets_tls_v3_Secret_msginit, arena, len);
-}
-
-typedef enum {
- envoy_extensions_transport_sockets_tls_v3_Secret_type_tls_certificate = 2,
- envoy_extensions_transport_sockets_tls_v3_Secret_type_session_ticket_keys = 3,
- envoy_extensions_transport_sockets_tls_v3_Secret_type_validation_context = 4,
- envoy_extensions_transport_sockets_tls_v3_Secret_type_generic_secret = 5,
- envoy_extensions_transport_sockets_tls_v3_Secret_type_NOT_SET = 0
-} envoy_extensions_transport_sockets_tls_v3_Secret_type_oneofcases;
-UPB_INLINE envoy_extensions_transport_sockets_tls_v3_Secret_type_oneofcases envoy_extensions_transport_sockets_tls_v3_Secret_type_case(const envoy_extensions_transport_sockets_tls_v3_Secret* msg) { return (envoy_extensions_transport_sockets_tls_v3_Secret_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(12, 24), int32_t); }
-
-UPB_INLINE upb_strview envoy_extensions_transport_sockets_tls_v3_Secret_name(const envoy_extensions_transport_sockets_tls_v3_Secret *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_Secret_has_tls_certificate(const envoy_extensions_transport_sockets_tls_v3_Secret *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 2; }
-UPB_INLINE const struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate* envoy_extensions_transport_sockets_tls_v3_Secret_tls_certificate(const envoy_extensions_transport_sockets_tls_v3_Secret *msg) { return UPB_READ_ONEOF(msg, const struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 2, NULL); }
-UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_Secret_has_session_ticket_keys(const envoy_extensions_transport_sockets_tls_v3_Secret *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 3; }
-UPB_INLINE const struct envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys* envoy_extensions_transport_sockets_tls_v3_Secret_session_ticket_keys(const envoy_extensions_transport_sockets_tls_v3_Secret *msg) { return UPB_READ_ONEOF(msg, const struct envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 3, NULL); }
-UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_Secret_has_validation_context(const envoy_extensions_transport_sockets_tls_v3_Secret *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 4; }
-UPB_INLINE const struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* envoy_extensions_transport_sockets_tls_v3_Secret_validation_context(const envoy_extensions_transport_sockets_tls_v3_Secret *msg) { return UPB_READ_ONEOF(msg, const struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 4, NULL); }
-UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_Secret_has_generic_secret(const envoy_extensions_transport_sockets_tls_v3_Secret *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 5; }
-UPB_INLINE const envoy_extensions_transport_sockets_tls_v3_GenericSecret* envoy_extensions_transport_sockets_tls_v3_Secret_generic_secret(const envoy_extensions_transport_sockets_tls_v3_Secret *msg) { return UPB_READ_ONEOF(msg, const envoy_extensions_transport_sockets_tls_v3_GenericSecret*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 5, NULL); }
-
-UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_Secret_set_name(envoy_extensions_transport_sockets_tls_v3_Secret *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_Secret_set_tls_certificate(envoy_extensions_transport_sockets_tls_v3_Secret *msg, struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate* value) {
- UPB_WRITE_ONEOF(msg, struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 2);
-}
-UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate* envoy_extensions_transport_sockets_tls_v3_Secret_mutable_tls_certificate(envoy_extensions_transport_sockets_tls_v3_Secret *msg, upb_arena *arena) {
- struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate* sub = (struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate*)envoy_extensions_transport_sockets_tls_v3_Secret_tls_certificate(msg);
- if (sub == NULL) {
- sub = (struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate*)_upb_msg_new(&envoy_extensions_transport_sockets_tls_v3_TlsCertificate_msginit, arena);
- if (!sub) return NULL;
- envoy_extensions_transport_sockets_tls_v3_Secret_set_tls_certificate(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_Secret_set_session_ticket_keys(envoy_extensions_transport_sockets_tls_v3_Secret *msg, struct envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys* value) {
- UPB_WRITE_ONEOF(msg, struct envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 3);
-}
-UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys* envoy_extensions_transport_sockets_tls_v3_Secret_mutable_session_ticket_keys(envoy_extensions_transport_sockets_tls_v3_Secret *msg, upb_arena *arena) {
- struct envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys* sub = (struct envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys*)envoy_extensions_transport_sockets_tls_v3_Secret_session_ticket_keys(msg);
- if (sub == NULL) {
- sub = (struct envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys*)_upb_msg_new(&envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_msginit, arena);
- if (!sub) return NULL;
- envoy_extensions_transport_sockets_tls_v3_Secret_set_session_ticket_keys(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_Secret_set_validation_context(envoy_extensions_transport_sockets_tls_v3_Secret *msg, struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* value) {
- UPB_WRITE_ONEOF(msg, struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 4);
-}
-UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* envoy_extensions_transport_sockets_tls_v3_Secret_mutable_validation_context(envoy_extensions_transport_sockets_tls_v3_Secret *msg, upb_arena *arena) {
- struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* sub = (struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext*)envoy_extensions_transport_sockets_tls_v3_Secret_validation_context(msg);
- if (sub == NULL) {
- sub = (struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext*)_upb_msg_new(&envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msginit, arena);
- if (!sub) return NULL;
- envoy_extensions_transport_sockets_tls_v3_Secret_set_validation_context(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_Secret_set_generic_secret(envoy_extensions_transport_sockets_tls_v3_Secret *msg, envoy_extensions_transport_sockets_tls_v3_GenericSecret* value) {
- UPB_WRITE_ONEOF(msg, envoy_extensions_transport_sockets_tls_v3_GenericSecret*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 5);
-}
-UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_GenericSecret* envoy_extensions_transport_sockets_tls_v3_Secret_mutable_generic_secret(envoy_extensions_transport_sockets_tls_v3_Secret *msg, upb_arena *arena) {
- struct envoy_extensions_transport_sockets_tls_v3_GenericSecret* sub = (struct envoy_extensions_transport_sockets_tls_v3_GenericSecret*)envoy_extensions_transport_sockets_tls_v3_Secret_generic_secret(msg);
- if (sub == NULL) {
- sub = (struct envoy_extensions_transport_sockets_tls_v3_GenericSecret*)_upb_msg_new(&envoy_extensions_transport_sockets_tls_v3_GenericSecret_msginit, arena);
- if (!sub) return NULL;
- envoy_extensions_transport_sockets_tls_v3_Secret_set_generic_secret(msg, sub);
- }
- return sub;
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* ENVOY_EXTENSIONS_TRANSPORT_SOCKETS_TLS_V3_SECRET_PROTO_UPB_H_ */
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/extensions/transport_sockets/tls/v3/secret.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_EXTENSIONS_TRANSPORT_SOCKETS_TLS_V3_SECRET_PROTO_UPB_H_
+#define ENVOY_EXTENSIONS_TRANSPORT_SOCKETS_TLS_V3_SECRET_PROTO_UPB_H_
+
+#include "upb/msg.h"
+#include "upb/decode.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_extensions_transport_sockets_tls_v3_GenericSecret;
+struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig;
+struct envoy_extensions_transport_sockets_tls_v3_Secret;
+typedef struct envoy_extensions_transport_sockets_tls_v3_GenericSecret envoy_extensions_transport_sockets_tls_v3_GenericSecret;
+typedef struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig;
+typedef struct envoy_extensions_transport_sockets_tls_v3_Secret envoy_extensions_transport_sockets_tls_v3_Secret;
+extern const upb_msglayout envoy_extensions_transport_sockets_tls_v3_GenericSecret_msginit;
+extern const upb_msglayout envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msginit;
+extern const upb_msglayout envoy_extensions_transport_sockets_tls_v3_Secret_msginit;
+struct envoy_config_core_v3_ConfigSource;
+struct envoy_config_core_v3_DataSource;
+struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext;
+struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate;
+struct envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys;
+struct udpa_core_v1_ResourceLocator;
+extern const upb_msglayout envoy_config_core_v3_ConfigSource_msginit;
+extern const upb_msglayout envoy_config_core_v3_DataSource_msginit;
+extern const upb_msglayout envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msginit;
+extern const upb_msglayout envoy_extensions_transport_sockets_tls_v3_TlsCertificate_msginit;
+extern const upb_msglayout envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_msginit;
+extern const upb_msglayout udpa_core_v1_ResourceLocator_msginit;
+
+
+/* envoy.extensions.transport_sockets.tls.v3.GenericSecret */
+
+UPB_INLINE envoy_extensions_transport_sockets_tls_v3_GenericSecret *envoy_extensions_transport_sockets_tls_v3_GenericSecret_new(upb_arena *arena) {
+ return (envoy_extensions_transport_sockets_tls_v3_GenericSecret *)_upb_msg_new(&envoy_extensions_transport_sockets_tls_v3_GenericSecret_msginit, arena);
+}
+UPB_INLINE envoy_extensions_transport_sockets_tls_v3_GenericSecret *envoy_extensions_transport_sockets_tls_v3_GenericSecret_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_extensions_transport_sockets_tls_v3_GenericSecret *ret = envoy_extensions_transport_sockets_tls_v3_GenericSecret_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_GenericSecret_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_extensions_transport_sockets_tls_v3_GenericSecret_serialize(const envoy_extensions_transport_sockets_tls_v3_GenericSecret *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_extensions_transport_sockets_tls_v3_GenericSecret_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_GenericSecret_has_secret(const envoy_extensions_transport_sockets_tls_v3_GenericSecret *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE const struct envoy_config_core_v3_DataSource* envoy_extensions_transport_sockets_tls_v3_GenericSecret_secret(const envoy_extensions_transport_sockets_tls_v3_GenericSecret *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct envoy_config_core_v3_DataSource*); }
+
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_GenericSecret_set_secret(envoy_extensions_transport_sockets_tls_v3_GenericSecret *msg, struct envoy_config_core_v3_DataSource* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct envoy_config_core_v3_DataSource*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_DataSource* envoy_extensions_transport_sockets_tls_v3_GenericSecret_mutable_secret(envoy_extensions_transport_sockets_tls_v3_GenericSecret *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_DataSource* sub = (struct envoy_config_core_v3_DataSource*)envoy_extensions_transport_sockets_tls_v3_GenericSecret_secret(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_DataSource*)_upb_msg_new(&envoy_config_core_v3_DataSource_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_transport_sockets_tls_v3_GenericSecret_set_secret(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.extensions.transport_sockets.tls.v3.SdsSecretConfig */
+
+UPB_INLINE envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig *envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_new(upb_arena *arena) {
+ return (envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig *)_upb_msg_new(&envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msginit, arena);
+}
+UPB_INLINE envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig *envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig *ret = envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_serialize(const envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_name(const envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_has_sds_config(const envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
+UPB_INLINE const struct envoy_config_core_v3_ConfigSource* envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_sds_config(const envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct envoy_config_core_v3_ConfigSource*); }
+UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_has_sds_resource_locator(const envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
+UPB_INLINE const struct udpa_core_v1_ResourceLocator* envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_sds_resource_locator(const envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct udpa_core_v1_ResourceLocator*); }
+
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_set_name(envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_set_sds_config(envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig *msg, struct envoy_config_core_v3_ConfigSource* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct envoy_config_core_v3_ConfigSource*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_ConfigSource* envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_mutable_sds_config(envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_ConfigSource* sub = (struct envoy_config_core_v3_ConfigSource*)envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_sds_config(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_ConfigSource*)_upb_msg_new(&envoy_config_core_v3_ConfigSource_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_set_sds_config(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_set_sds_resource_locator(envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig *msg, struct udpa_core_v1_ResourceLocator* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct udpa_core_v1_ResourceLocator*) = value;
+}
+UPB_INLINE struct udpa_core_v1_ResourceLocator* envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_mutable_sds_resource_locator(envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig *msg, upb_arena *arena) {
+ struct udpa_core_v1_ResourceLocator* sub = (struct udpa_core_v1_ResourceLocator*)envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_sds_resource_locator(msg);
+ if (sub == NULL) {
+ sub = (struct udpa_core_v1_ResourceLocator*)_upb_msg_new(&udpa_core_v1_ResourceLocator_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_set_sds_resource_locator(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.extensions.transport_sockets.tls.v3.Secret */
+
+UPB_INLINE envoy_extensions_transport_sockets_tls_v3_Secret *envoy_extensions_transport_sockets_tls_v3_Secret_new(upb_arena *arena) {
+ return (envoy_extensions_transport_sockets_tls_v3_Secret *)_upb_msg_new(&envoy_extensions_transport_sockets_tls_v3_Secret_msginit, arena);
+}
+UPB_INLINE envoy_extensions_transport_sockets_tls_v3_Secret *envoy_extensions_transport_sockets_tls_v3_Secret_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_extensions_transport_sockets_tls_v3_Secret *ret = envoy_extensions_transport_sockets_tls_v3_Secret_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_Secret_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_extensions_transport_sockets_tls_v3_Secret_serialize(const envoy_extensions_transport_sockets_tls_v3_Secret *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_extensions_transport_sockets_tls_v3_Secret_msginit, arena, len);
+}
+
+typedef enum {
+ envoy_extensions_transport_sockets_tls_v3_Secret_type_tls_certificate = 2,
+ envoy_extensions_transport_sockets_tls_v3_Secret_type_session_ticket_keys = 3,
+ envoy_extensions_transport_sockets_tls_v3_Secret_type_validation_context = 4,
+ envoy_extensions_transport_sockets_tls_v3_Secret_type_generic_secret = 5,
+ envoy_extensions_transport_sockets_tls_v3_Secret_type_NOT_SET = 0
+} envoy_extensions_transport_sockets_tls_v3_Secret_type_oneofcases;
+UPB_INLINE envoy_extensions_transport_sockets_tls_v3_Secret_type_oneofcases envoy_extensions_transport_sockets_tls_v3_Secret_type_case(const envoy_extensions_transport_sockets_tls_v3_Secret* msg) { return (envoy_extensions_transport_sockets_tls_v3_Secret_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(12, 24), int32_t); }
+
+UPB_INLINE upb_strview envoy_extensions_transport_sockets_tls_v3_Secret_name(const envoy_extensions_transport_sockets_tls_v3_Secret *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_Secret_has_tls_certificate(const envoy_extensions_transport_sockets_tls_v3_Secret *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 2; }
+UPB_INLINE const struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate* envoy_extensions_transport_sockets_tls_v3_Secret_tls_certificate(const envoy_extensions_transport_sockets_tls_v3_Secret *msg) { return UPB_READ_ONEOF(msg, const struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 2, NULL); }
+UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_Secret_has_session_ticket_keys(const envoy_extensions_transport_sockets_tls_v3_Secret *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 3; }
+UPB_INLINE const struct envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys* envoy_extensions_transport_sockets_tls_v3_Secret_session_ticket_keys(const envoy_extensions_transport_sockets_tls_v3_Secret *msg) { return UPB_READ_ONEOF(msg, const struct envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 3, NULL); }
+UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_Secret_has_validation_context(const envoy_extensions_transport_sockets_tls_v3_Secret *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 4; }
+UPB_INLINE const struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* envoy_extensions_transport_sockets_tls_v3_Secret_validation_context(const envoy_extensions_transport_sockets_tls_v3_Secret *msg) { return UPB_READ_ONEOF(msg, const struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 4, NULL); }
+UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_Secret_has_generic_secret(const envoy_extensions_transport_sockets_tls_v3_Secret *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 5; }
+UPB_INLINE const envoy_extensions_transport_sockets_tls_v3_GenericSecret* envoy_extensions_transport_sockets_tls_v3_Secret_generic_secret(const envoy_extensions_transport_sockets_tls_v3_Secret *msg) { return UPB_READ_ONEOF(msg, const envoy_extensions_transport_sockets_tls_v3_GenericSecret*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 5, NULL); }
+
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_Secret_set_name(envoy_extensions_transport_sockets_tls_v3_Secret *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_Secret_set_tls_certificate(envoy_extensions_transport_sockets_tls_v3_Secret *msg, struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate* value) {
+ UPB_WRITE_ONEOF(msg, struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 2);
+}
+UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate* envoy_extensions_transport_sockets_tls_v3_Secret_mutable_tls_certificate(envoy_extensions_transport_sockets_tls_v3_Secret *msg, upb_arena *arena) {
+ struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate* sub = (struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate*)envoy_extensions_transport_sockets_tls_v3_Secret_tls_certificate(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate*)_upb_msg_new(&envoy_extensions_transport_sockets_tls_v3_TlsCertificate_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_transport_sockets_tls_v3_Secret_set_tls_certificate(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_Secret_set_session_ticket_keys(envoy_extensions_transport_sockets_tls_v3_Secret *msg, struct envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys* value) {
+ UPB_WRITE_ONEOF(msg, struct envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 3);
+}
+UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys* envoy_extensions_transport_sockets_tls_v3_Secret_mutable_session_ticket_keys(envoy_extensions_transport_sockets_tls_v3_Secret *msg, upb_arena *arena) {
+ struct envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys* sub = (struct envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys*)envoy_extensions_transport_sockets_tls_v3_Secret_session_ticket_keys(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys*)_upb_msg_new(&envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_transport_sockets_tls_v3_Secret_set_session_ticket_keys(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_Secret_set_validation_context(envoy_extensions_transport_sockets_tls_v3_Secret *msg, struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* value) {
+ UPB_WRITE_ONEOF(msg, struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 4);
+}
+UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* envoy_extensions_transport_sockets_tls_v3_Secret_mutable_validation_context(envoy_extensions_transport_sockets_tls_v3_Secret *msg, upb_arena *arena) {
+ struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* sub = (struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext*)envoy_extensions_transport_sockets_tls_v3_Secret_validation_context(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext*)_upb_msg_new(&envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_transport_sockets_tls_v3_Secret_set_validation_context(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_Secret_set_generic_secret(envoy_extensions_transport_sockets_tls_v3_Secret *msg, envoy_extensions_transport_sockets_tls_v3_GenericSecret* value) {
+ UPB_WRITE_ONEOF(msg, envoy_extensions_transport_sockets_tls_v3_GenericSecret*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 5);
+}
+UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_GenericSecret* envoy_extensions_transport_sockets_tls_v3_Secret_mutable_generic_secret(envoy_extensions_transport_sockets_tls_v3_Secret *msg, upb_arena *arena) {
+ struct envoy_extensions_transport_sockets_tls_v3_GenericSecret* sub = (struct envoy_extensions_transport_sockets_tls_v3_GenericSecret*)envoy_extensions_transport_sockets_tls_v3_Secret_generic_secret(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_extensions_transport_sockets_tls_v3_GenericSecret*)_upb_msg_new(&envoy_extensions_transport_sockets_tls_v3_GenericSecret_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_transport_sockets_tls_v3_Secret_set_generic_secret(msg, sub);
+ }
+ return sub;
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_EXTENSIONS_TRANSPORT_SOCKETS_TLS_V3_SECRET_PROTO_UPB_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.c
index 4f49e06efaa..c38e5d97016 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.c
@@ -1,147 +1,147 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/extensions/transport_sockets/tls/v3/tls.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include <stddef.h>
-#include "upb/msg.h"
-#include "envoy/extensions/transport_sockets/tls/v3/tls.upb.h"
-#include "envoy/config/core/v3/extension.upb.h"
-#include "envoy/extensions/transport_sockets/tls/v3/common.upb.h"
-#include "envoy/extensions/transport_sockets/tls/v3/secret.upb.h"
-#include "google/protobuf/any.upb.h"
-#include "google/protobuf/duration.upb.h"
-#include "google/protobuf/wrappers.upb.h"
-#include "udpa/annotations/migrate.upb.h"
-#include "udpa/annotations/status.upb.h"
-#include "udpa/annotations/versioning.upb.h"
-#include "validate/validate.upb.h"
-
-#include "upb/port_def.inc"
-
-static const upb_msglayout *const envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_submsgs[2] = {
- &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_msginit,
- &google_protobuf_UInt32Value_msginit,
-};
-
-static const upb_msglayout_field envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext__fields[4] = {
- {1, UPB_SIZE(12, 24), 0, 0, 11, 1},
- {2, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {3, UPB_SIZE(0, 0), 0, 0, 8, 1},
- {4, UPB_SIZE(16, 32), 0, 1, 11, 1},
-};
-
-const upb_msglayout envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_msginit = {
- &envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_submsgs[0],
- &envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext__fields[0],
- UPB_SIZE(24, 48), 4, false,
-};
-
-static const upb_msglayout *const envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_submsgs[6] = {
- &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_msginit,
- &envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msginit,
- &envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_msginit,
- &google_protobuf_BoolValue_msginit,
- &google_protobuf_Duration_msginit,
-};
-
-static const upb_msglayout_field envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext__fields[8] = {
- {1, UPB_SIZE(8, 8), 0, 0, 11, 1},
- {2, UPB_SIZE(12, 16), 0, 3, 11, 1},
- {3, UPB_SIZE(16, 24), 0, 3, 11, 1},
- {4, UPB_SIZE(24, 40), UPB_SIZE(-29, -49), 2, 11, 1},
- {5, UPB_SIZE(24, 40), UPB_SIZE(-29, -49), 1, 11, 1},
- {6, UPB_SIZE(20, 32), 0, 4, 11, 1},
- {7, UPB_SIZE(24, 40), UPB_SIZE(-29, -49), 0, 8, 1},
- {8, UPB_SIZE(0, 0), 0, 0, 14, 1},
-};
-
-const upb_msglayout envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_msginit = {
- &envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_submsgs[0],
- &envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext__fields[0],
- UPB_SIZE(32, 56), 8, false,
-};
-
-static const upb_msglayout *const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_submsgs[11] = {
- &envoy_config_core_v3_TypedExtensionConfig_msginit,
- &envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msginit,
- &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_msginit,
- &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_msginit,
- &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_msginit,
- &envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msginit,
- &envoy_extensions_transport_sockets_tls_v3_TlsCertificate_msginit,
- &envoy_extensions_transport_sockets_tls_v3_TlsParameters_msginit,
-};
-
-static const upb_msglayout_field envoy_extensions_transport_sockets_tls_v3_CommonTlsContext__fields[12] = {
- {1, UPB_SIZE(0, 0), 0, 7, 11, 1},
- {2, UPB_SIZE(16, 32), 0, 6, 11, 3},
- {3, UPB_SIZE(28, 56), UPB_SIZE(-33, -65), 1, 11, 1},
- {4, UPB_SIZE(20, 40), 0, 0, 9, 3},
- {6, UPB_SIZE(24, 48), 0, 5, 11, 3},
- {7, UPB_SIZE(28, 56), UPB_SIZE(-33, -65), 5, 11, 1},
- {8, UPB_SIZE(28, 56), UPB_SIZE(-33, -65), 4, 11, 1},
- {9, UPB_SIZE(4, 8), 0, 2, 11, 1},
- {10, UPB_SIZE(28, 56), UPB_SIZE(-33, -65), 2, 11, 1},
- {11, UPB_SIZE(8, 16), 0, 3, 11, 1},
- {12, UPB_SIZE(28, 56), UPB_SIZE(-33, -65), 3, 11, 1},
- {13, UPB_SIZE(12, 24), 0, 0, 11, 1},
-};
-
-const upb_msglayout envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_msginit = {
- &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_submsgs[0],
- &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext__fields[0],
- UPB_SIZE(36, 72), 12, false,
-};
-
-static const upb_msglayout *const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_submsgs[1] = {
- &envoy_config_core_v3_TypedExtensionConfig_msginit,
-};
-
-static const upb_msglayout_field envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, 1},
-};
-
-const upb_msglayout envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_msginit = {
- &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_submsgs[0],
- &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider__fields[0],
- UPB_SIZE(16, 32), 2, false,
-};
-
-static const upb_msglayout_field envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 9, 1},
-};
-
-const upb_msglayout envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_msginit = {
- NULL,
- &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance__fields[0],
- UPB_SIZE(16, 32), 2, false,
-};
-
-static const upb_msglayout *const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_submsgs[4] = {
- &envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msginit,
- &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_msginit,
- &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_msginit,
- &envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msginit,
-};
-
-static const upb_msglayout_field envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext__fields[4] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
- {2, UPB_SIZE(4, 8), 0, 3, 11, 1},
- {3, UPB_SIZE(8, 16), 0, 1, 11, 1},
- {4, UPB_SIZE(12, 24), 0, 2, 11, 1},
-};
-
-const upb_msglayout envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_msginit = {
- &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_submsgs[0],
- &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext__fields[0],
- UPB_SIZE(16, 32), 4, false,
-};
-
-#include "upb/port_undef.inc"
-
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/extensions/transport_sockets/tls/v3/tls.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg.h"
+#include "envoy/extensions/transport_sockets/tls/v3/tls.upb.h"
+#include "envoy/config/core/v3/extension.upb.h"
+#include "envoy/extensions/transport_sockets/tls/v3/common.upb.h"
+#include "envoy/extensions/transport_sockets/tls/v3/secret.upb.h"
+#include "google/protobuf/any.upb.h"
+#include "google/protobuf/duration.upb.h"
+#include "google/protobuf/wrappers.upb.h"
+#include "udpa/annotations/migrate.upb.h"
+#include "udpa/annotations/status.upb.h"
+#include "udpa/annotations/versioning.upb.h"
+#include "validate/validate.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_msglayout *const envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_submsgs[2] = {
+ &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_msginit,
+ &google_protobuf_UInt32Value_msginit,
+};
+
+static const upb_msglayout_field envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext__fields[4] = {
+ {1, UPB_SIZE(12, 24), 0, 0, 11, 1},
+ {2, UPB_SIZE(4, 8), 0, 0, 9, 1},
+ {3, UPB_SIZE(0, 0), 0, 0, 8, 1},
+ {4, UPB_SIZE(16, 32), 0, 1, 11, 1},
+};
+
+const upb_msglayout envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_msginit = {
+ &envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_submsgs[0],
+ &envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext__fields[0],
+ UPB_SIZE(24, 48), 4, false,
+};
+
+static const upb_msglayout *const envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_submsgs[6] = {
+ &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_msginit,
+ &envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msginit,
+ &envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_msginit,
+ &google_protobuf_BoolValue_msginit,
+ &google_protobuf_Duration_msginit,
+};
+
+static const upb_msglayout_field envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext__fields[8] = {
+ {1, UPB_SIZE(8, 8), 0, 0, 11, 1},
+ {2, UPB_SIZE(12, 16), 0, 3, 11, 1},
+ {3, UPB_SIZE(16, 24), 0, 3, 11, 1},
+ {4, UPB_SIZE(24, 40), UPB_SIZE(-29, -49), 2, 11, 1},
+ {5, UPB_SIZE(24, 40), UPB_SIZE(-29, -49), 1, 11, 1},
+ {6, UPB_SIZE(20, 32), 0, 4, 11, 1},
+ {7, UPB_SIZE(24, 40), UPB_SIZE(-29, -49), 0, 8, 1},
+ {8, UPB_SIZE(0, 0), 0, 0, 14, 1},
+};
+
+const upb_msglayout envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_msginit = {
+ &envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_submsgs[0],
+ &envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext__fields[0],
+ UPB_SIZE(32, 56), 8, false,
+};
+
+static const upb_msglayout *const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_submsgs[11] = {
+ &envoy_config_core_v3_TypedExtensionConfig_msginit,
+ &envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msginit,
+ &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_msginit,
+ &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_msginit,
+ &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_msginit,
+ &envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msginit,
+ &envoy_extensions_transport_sockets_tls_v3_TlsCertificate_msginit,
+ &envoy_extensions_transport_sockets_tls_v3_TlsParameters_msginit,
+};
+
+static const upb_msglayout_field envoy_extensions_transport_sockets_tls_v3_CommonTlsContext__fields[12] = {
+ {1, UPB_SIZE(0, 0), 0, 7, 11, 1},
+ {2, UPB_SIZE(16, 32), 0, 6, 11, 3},
+ {3, UPB_SIZE(28, 56), UPB_SIZE(-33, -65), 1, 11, 1},
+ {4, UPB_SIZE(20, 40), 0, 0, 9, 3},
+ {6, UPB_SIZE(24, 48), 0, 5, 11, 3},
+ {7, UPB_SIZE(28, 56), UPB_SIZE(-33, -65), 5, 11, 1},
+ {8, UPB_SIZE(28, 56), UPB_SIZE(-33, -65), 4, 11, 1},
+ {9, UPB_SIZE(4, 8), 0, 2, 11, 1},
+ {10, UPB_SIZE(28, 56), UPB_SIZE(-33, -65), 2, 11, 1},
+ {11, UPB_SIZE(8, 16), 0, 3, 11, 1},
+ {12, UPB_SIZE(28, 56), UPB_SIZE(-33, -65), 3, 11, 1},
+ {13, UPB_SIZE(12, 24), 0, 0, 11, 1},
+};
+
+const upb_msglayout envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_msginit = {
+ &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_submsgs[0],
+ &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext__fields[0],
+ UPB_SIZE(36, 72), 12, false,
+};
+
+static const upb_msglayout *const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_submsgs[1] = {
+ &envoy_config_core_v3_TypedExtensionConfig_msginit,
+};
+
+static const upb_msglayout_field envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, 1},
+};
+
+const upb_msglayout envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_msginit = {
+ &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_submsgs[0],
+ &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider__fields[0],
+ UPB_SIZE(16, 32), 2, false,
+};
+
+static const upb_msglayout_field envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {2, UPB_SIZE(8, 16), 0, 0, 9, 1},
+};
+
+const upb_msglayout envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_msginit = {
+ NULL,
+ &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance__fields[0],
+ UPB_SIZE(16, 32), 2, false,
+};
+
+static const upb_msglayout *const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_submsgs[4] = {
+ &envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msginit,
+ &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_msginit,
+ &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_msginit,
+ &envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msginit,
+};
+
+static const upb_msglayout_field envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext__fields[4] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
+ {2, UPB_SIZE(4, 8), 0, 3, 11, 1},
+ {3, UPB_SIZE(8, 16), 0, 1, 11, 1},
+ {4, UPB_SIZE(12, 24), 0, 2, 11, 1},
+};
+
+const upb_msglayout envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_msginit = {
+ &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_submsgs[0],
+ &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext__fields[0],
+ UPB_SIZE(16, 32), 4, false,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.h
index 94ffb8e9316..8fc0ad2cec9 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.h
@@ -1,570 +1,570 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/extensions/transport_sockets/tls/v3/tls.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef ENVOY_EXTENSIONS_TRANSPORT_SOCKETS_TLS_V3_TLS_PROTO_UPB_H_
-#define ENVOY_EXTENSIONS_TRANSPORT_SOCKETS_TLS_V3_TLS_PROTO_UPB_H_
-
-#include "upb/msg.h"
-#include "upb/decode.h"
-#include "upb/encode.h"
-
-#include "upb/port_def.inc"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext;
-struct envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext;
-struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext;
-struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider;
-struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance;
-struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext;
-typedef struct envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext;
-typedef struct envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext;
-typedef struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext envoy_extensions_transport_sockets_tls_v3_CommonTlsContext;
-typedef struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider;
-typedef struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance;
-typedef struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext;
-extern const upb_msglayout envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_msginit;
-extern const upb_msglayout envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_msginit;
-extern const upb_msglayout envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_msginit;
-extern const upb_msglayout envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_msginit;
-extern const upb_msglayout envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_msginit;
-extern const upb_msglayout envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_msginit;
-struct envoy_config_core_v3_TypedExtensionConfig;
-struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext;
-struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig;
-struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate;
-struct envoy_extensions_transport_sockets_tls_v3_TlsParameters;
-struct envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys;
-struct google_protobuf_BoolValue;
-struct google_protobuf_Duration;
-struct google_protobuf_UInt32Value;
-extern const upb_msglayout envoy_config_core_v3_TypedExtensionConfig_msginit;
-extern const upb_msglayout envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msginit;
-extern const upb_msglayout envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msginit;
-extern const upb_msglayout envoy_extensions_transport_sockets_tls_v3_TlsCertificate_msginit;
-extern const upb_msglayout envoy_extensions_transport_sockets_tls_v3_TlsParameters_msginit;
-extern const upb_msglayout envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_msginit;
-extern const upb_msglayout google_protobuf_BoolValue_msginit;
-extern const upb_msglayout google_protobuf_Duration_msginit;
-extern const upb_msglayout google_protobuf_UInt32Value_msginit;
-
-typedef enum {
- envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_LENIENT_STAPLING = 0,
- envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_STRICT_STAPLING = 1,
- envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_MUST_STAPLE = 2
-} envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_OcspStaplePolicy;
-
-
-/* envoy.extensions.transport_sockets.tls.v3.UpstreamTlsContext */
-
-UPB_INLINE envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext *envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_new(upb_arena *arena) {
- return (envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext *)_upb_msg_new(&envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_msginit, arena);
-}
-UPB_INLINE envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext *envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext *ret = envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_serialize(const envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_has_common_tls_context(const envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
-UPB_INLINE const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_common_tls_context(const envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext*); }
-UPB_INLINE upb_strview envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_sni(const envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
-UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_allow_renegotiation(const envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); }
-UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_has_max_session_keys(const envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); }
-UPB_INLINE const struct google_protobuf_UInt32Value* envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_max_session_keys(const envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const struct google_protobuf_UInt32Value*); }
-
-UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_set_common_tls_context(envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext *msg, envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), envoy_extensions_transport_sockets_tls_v3_CommonTlsContext*) = value;
-}
-UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_mutable_common_tls_context(envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext *msg, upb_arena *arena) {
- struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* sub = (struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext*)envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_common_tls_context(msg);
- if (sub == NULL) {
- sub = (struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext*)_upb_msg_new(&envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_msginit, arena);
- if (!sub) return NULL;
- envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_set_common_tls_context(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_set_sni(envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
-}
-UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_set_allow_renegotiation(envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
-}
-UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_set_max_session_keys(envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext *msg, struct google_protobuf_UInt32Value* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(16, 32), struct google_protobuf_UInt32Value*) = value;
-}
-UPB_INLINE struct google_protobuf_UInt32Value* envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_mutable_max_session_keys(envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext *msg, upb_arena *arena) {
- struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_max_session_keys(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
- if (!sub) return NULL;
- envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_set_max_session_keys(msg, sub);
- }
- return sub;
-}
-
-/* envoy.extensions.transport_sockets.tls.v3.DownstreamTlsContext */
-
-UPB_INLINE envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_new(upb_arena *arena) {
- return (envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *)_upb_msg_new(&envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_msginit, arena);
-}
-UPB_INLINE envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *ret = envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_serialize(const envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_msginit, arena, len);
-}
-
-typedef enum {
- envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_session_ticket_keys_type_session_ticket_keys = 4,
- envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_session_ticket_keys_type_session_ticket_keys_sds_secret_config = 5,
- envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_session_ticket_keys_type_disable_stateless_session_resumption = 7,
- envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_session_ticket_keys_type_NOT_SET = 0
-} envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_session_ticket_keys_type_oneofcases;
-UPB_INLINE envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_session_ticket_keys_type_oneofcases envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_session_ticket_keys_type_case(const envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext* msg) { return (envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_session_ticket_keys_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(28, 48), int32_t); }
-
-UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_has_common_tls_context(const envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 8)); }
-UPB_INLINE const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_common_tls_context(const envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext*); }
-UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_has_require_client_certificate(const envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 16)); }
-UPB_INLINE const struct google_protobuf_BoolValue* envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_require_client_certificate(const envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const struct google_protobuf_BoolValue*); }
-UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_has_require_sni(const envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 24)); }
-UPB_INLINE const struct google_protobuf_BoolValue* envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_require_sni(const envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const struct google_protobuf_BoolValue*); }
-UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_has_session_ticket_keys(const envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *msg) { return _upb_getoneofcase(msg, UPB_SIZE(28, 48)) == 4; }
-UPB_INLINE const struct envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys* envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_session_ticket_keys(const envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *msg) { return UPB_READ_ONEOF(msg, const struct envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys*, UPB_SIZE(24, 40), UPB_SIZE(28, 48), 4, NULL); }
-UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_has_session_ticket_keys_sds_secret_config(const envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *msg) { return _upb_getoneofcase(msg, UPB_SIZE(28, 48)) == 5; }
-UPB_INLINE const struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_session_ticket_keys_sds_secret_config(const envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *msg) { return UPB_READ_ONEOF(msg, const struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig*, UPB_SIZE(24, 40), UPB_SIZE(28, 48), 5, NULL); }
-UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_has_session_timeout(const envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 32)); }
-UPB_INLINE const struct google_protobuf_Duration* envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_session_timeout(const envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const struct google_protobuf_Duration*); }
-UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_has_disable_stateless_session_resumption(const envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *msg) { return _upb_getoneofcase(msg, UPB_SIZE(28, 48)) == 7; }
-UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_disable_stateless_session_resumption(const envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *msg) { return UPB_READ_ONEOF(msg, bool, UPB_SIZE(24, 40), UPB_SIZE(28, 48), 7, false); }
-UPB_INLINE int32_t envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_ocsp_staple_policy(const envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
-
-UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_set_common_tls_context(envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *msg, envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), envoy_extensions_transport_sockets_tls_v3_CommonTlsContext*) = value;
-}
-UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_mutable_common_tls_context(envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *msg, upb_arena *arena) {
- struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* sub = (struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext*)envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_common_tls_context(msg);
- if (sub == NULL) {
- sub = (struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext*)_upb_msg_new(&envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_msginit, arena);
- if (!sub) return NULL;
- envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_set_common_tls_context(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_set_require_client_certificate(envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *msg, struct google_protobuf_BoolValue* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(12, 16), struct google_protobuf_BoolValue*) = value;
-}
-UPB_INLINE struct google_protobuf_BoolValue* envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_mutable_require_client_certificate(envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *msg, upb_arena *arena) {
- struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_require_client_certificate(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_BoolValue*)_upb_msg_new(&google_protobuf_BoolValue_msginit, arena);
- if (!sub) return NULL;
- envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_set_require_client_certificate(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_set_require_sni(envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *msg, struct google_protobuf_BoolValue* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(16, 24), struct google_protobuf_BoolValue*) = value;
-}
-UPB_INLINE struct google_protobuf_BoolValue* envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_mutable_require_sni(envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *msg, upb_arena *arena) {
- struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_require_sni(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_BoolValue*)_upb_msg_new(&google_protobuf_BoolValue_msginit, arena);
- if (!sub) return NULL;
- envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_set_require_sni(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_set_session_ticket_keys(envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *msg, struct envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys* value) {
- UPB_WRITE_ONEOF(msg, struct envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys*, UPB_SIZE(24, 40), value, UPB_SIZE(28, 48), 4);
-}
-UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys* envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_mutable_session_ticket_keys(envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *msg, upb_arena *arena) {
- struct envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys* sub = (struct envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys*)envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_session_ticket_keys(msg);
- if (sub == NULL) {
- sub = (struct envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys*)_upb_msg_new(&envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_msginit, arena);
- if (!sub) return NULL;
- envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_set_session_ticket_keys(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_set_session_ticket_keys_sds_secret_config(envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *msg, struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* value) {
- UPB_WRITE_ONEOF(msg, struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig*, UPB_SIZE(24, 40), value, UPB_SIZE(28, 48), 5);
-}
-UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_mutable_session_ticket_keys_sds_secret_config(envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *msg, upb_arena *arena) {
- struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* sub = (struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig*)envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_session_ticket_keys_sds_secret_config(msg);
- if (sub == NULL) {
- sub = (struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig*)_upb_msg_new(&envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msginit, arena);
- if (!sub) return NULL;
- envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_set_session_ticket_keys_sds_secret_config(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_set_session_timeout(envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *msg, struct google_protobuf_Duration* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(20, 32), struct google_protobuf_Duration*) = value;
-}
-UPB_INLINE struct google_protobuf_Duration* envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_mutable_session_timeout(envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *msg, upb_arena *arena) {
- struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_session_timeout(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
- if (!sub) return NULL;
- envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_set_session_timeout(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_set_disable_stateless_session_resumption(envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *msg, bool value) {
- UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(24, 40), value, UPB_SIZE(28, 48), 7);
-}
-UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_set_ocsp_staple_policy(envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *msg, int32_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
-}
-
-/* envoy.extensions.transport_sockets.tls.v3.CommonTlsContext */
-
-UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_new(upb_arena *arena) {
- return (envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *)_upb_msg_new(&envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_msginit, arena);
-}
-UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *ret = envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_serialize(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_msginit, arena, len);
-}
-
-typedef enum {
- envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_validation_context_type_validation_context = 3,
- envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_validation_context_type_validation_context_sds_secret_config = 7,
- envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_validation_context_type_combined_validation_context = 8,
- envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_validation_context_type_validation_context_certificate_provider = 10,
- envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_validation_context_type_validation_context_certificate_provider_instance = 12,
- envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_validation_context_type_NOT_SET = 0
-} envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_validation_context_type_oneofcases;
-UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_validation_context_type_oneofcases envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_validation_context_type_case(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) { return (envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_validation_context_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(32, 64), int32_t); }
-
-UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_has_tls_params(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE const struct envoy_extensions_transport_sockets_tls_v3_TlsParameters* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_tls_params(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct envoy_extensions_transport_sockets_tls_v3_TlsParameters*); }
-UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_has_tls_certificates(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); }
-UPB_INLINE const struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate* const* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_tls_certificates(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, size_t *len) { return (const struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate* const*)_upb_array_accessor(msg, UPB_SIZE(16, 32), len); }
-UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_has_validation_context(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg) { return _upb_getoneofcase(msg, UPB_SIZE(32, 64)) == 3; }
-UPB_INLINE const struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_validation_context(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg) { return UPB_READ_ONEOF(msg, const struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext*, UPB_SIZE(28, 56), UPB_SIZE(32, 64), 3, NULL); }
-UPB_INLINE upb_strview const* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_alpn_protocols(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(20, 40), len); }
-UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_has_tls_certificate_sds_secret_configs(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 48)); }
-UPB_INLINE const struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* const* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_tls_certificate_sds_secret_configs(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, size_t *len) { return (const struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* const*)_upb_array_accessor(msg, UPB_SIZE(24, 48), len); }
-UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_has_validation_context_sds_secret_config(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg) { return _upb_getoneofcase(msg, UPB_SIZE(32, 64)) == 7; }
-UPB_INLINE const struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_validation_context_sds_secret_config(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg) { return UPB_READ_ONEOF(msg, const struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig*, UPB_SIZE(28, 56), UPB_SIZE(32, 64), 7, NULL); }
-UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_has_combined_validation_context(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg) { return _upb_getoneofcase(msg, UPB_SIZE(32, 64)) == 8; }
-UPB_INLINE const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_combined_validation_context(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg) { return UPB_READ_ONEOF(msg, const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext*, UPB_SIZE(28, 56), UPB_SIZE(32, 64), 8, NULL); }
-UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_has_tls_certificate_certificate_provider(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
-UPB_INLINE const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_tls_certificate_certificate_provider(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider*); }
-UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_has_validation_context_certificate_provider(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg) { return _upb_getoneofcase(msg, UPB_SIZE(32, 64)) == 10; }
-UPB_INLINE const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_validation_context_certificate_provider(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg) { return UPB_READ_ONEOF(msg, const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider*, UPB_SIZE(28, 56), UPB_SIZE(32, 64), 10, NULL); }
-UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_has_tls_certificate_certificate_provider_instance(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_tls_certificate_certificate_provider_instance(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance*); }
-UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_has_validation_context_certificate_provider_instance(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg) { return _upb_getoneofcase(msg, UPB_SIZE(32, 64)) == 12; }
-UPB_INLINE const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_validation_context_certificate_provider_instance(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg) { return UPB_READ_ONEOF(msg, const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance*, UPB_SIZE(28, 56), UPB_SIZE(32, 64), 12, NULL); }
-UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_has_custom_handshaker(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
-UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_custom_handshaker(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct envoy_config_core_v3_TypedExtensionConfig*); }
-
-UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_set_tls_params(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, struct envoy_extensions_transport_sockets_tls_v3_TlsParameters* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct envoy_extensions_transport_sockets_tls_v3_TlsParameters*) = value;
-}
-UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_TlsParameters* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_mutable_tls_params(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, upb_arena *arena) {
- struct envoy_extensions_transport_sockets_tls_v3_TlsParameters* sub = (struct envoy_extensions_transport_sockets_tls_v3_TlsParameters*)envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_tls_params(msg);
- if (sub == NULL) {
- sub = (struct envoy_extensions_transport_sockets_tls_v3_TlsParameters*)_upb_msg_new(&envoy_extensions_transport_sockets_tls_v3_TlsParameters_msginit, arena);
- if (!sub) return NULL;
- envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_set_tls_params(msg, sub);
- }
- return sub;
-}
-UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate** envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_mutable_tls_certificates(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, size_t *len) {
- return (struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate**)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 32), len);
-}
-UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate** envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_resize_tls_certificates(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, size_t len, upb_arena *arena) {
- return (struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate**)_upb_array_resize_accessor(msg, UPB_SIZE(16, 32), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_add_tls_certificates(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, upb_arena *arena) {
- struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate* sub = (struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate*)_upb_msg_new(&envoy_extensions_transport_sockets_tls_v3_TlsCertificate_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(16, 32), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_set_validation_context(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* value) {
- UPB_WRITE_ONEOF(msg, struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext*, UPB_SIZE(28, 56), value, UPB_SIZE(32, 64), 3);
-}
-UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_mutable_validation_context(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, upb_arena *arena) {
- struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* sub = (struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext*)envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_validation_context(msg);
- if (sub == NULL) {
- sub = (struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext*)_upb_msg_new(&envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msginit, arena);
- if (!sub) return NULL;
- envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_set_validation_context(msg, sub);
- }
- return sub;
-}
-UPB_INLINE upb_strview* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_mutable_alpn_protocols(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, size_t *len) {
- return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 40), len);
-}
-UPB_INLINE upb_strview* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_resize_alpn_protocols(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, size_t len, upb_arena *arena) {
- return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(20, 40), len, UPB_TYPE_STRING, arena);
-}
-UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_add_alpn_protocols(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, upb_strview val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(20, 40), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
- arena);
-}
-UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig** envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_mutable_tls_certificate_sds_secret_configs(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, size_t *len) {
- return (struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig**)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 48), len);
-}
-UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig** envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_resize_tls_certificate_sds_secret_configs(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, size_t len, upb_arena *arena) {
- return (struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig**)_upb_array_resize_accessor(msg, UPB_SIZE(24, 48), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_add_tls_certificate_sds_secret_configs(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, upb_arena *arena) {
- struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* sub = (struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig*)_upb_msg_new(&envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(24, 48), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_set_validation_context_sds_secret_config(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* value) {
- UPB_WRITE_ONEOF(msg, struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig*, UPB_SIZE(28, 56), value, UPB_SIZE(32, 64), 7);
-}
-UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_mutable_validation_context_sds_secret_config(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, upb_arena *arena) {
- struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* sub = (struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig*)envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_validation_context_sds_secret_config(msg);
- if (sub == NULL) {
- sub = (struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig*)_upb_msg_new(&envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msginit, arena);
- if (!sub) return NULL;
- envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_set_validation_context_sds_secret_config(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_set_combined_validation_context(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext* value) {
- UPB_WRITE_ONEOF(msg, envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext*, UPB_SIZE(28, 56), value, UPB_SIZE(32, 64), 8);
-}
-UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_mutable_combined_validation_context(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, upb_arena *arena) {
- struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext* sub = (struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext*)envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_combined_validation_context(msg);
- if (sub == NULL) {
- sub = (struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext*)_upb_msg_new(&envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_msginit, arena);
- if (!sub) return NULL;
- envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_set_combined_validation_context(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_set_tls_certificate_certificate_provider(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider*) = value;
-}
-UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_mutable_tls_certificate_certificate_provider(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, upb_arena *arena) {
- struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider* sub = (struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider*)envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_tls_certificate_certificate_provider(msg);
- if (sub == NULL) {
- sub = (struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider*)_upb_msg_new(&envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_msginit, arena);
- if (!sub) return NULL;
- envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_set_tls_certificate_certificate_provider(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_set_validation_context_certificate_provider(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider* value) {
- UPB_WRITE_ONEOF(msg, envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider*, UPB_SIZE(28, 56), value, UPB_SIZE(32, 64), 10);
-}
-UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_mutable_validation_context_certificate_provider(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, upb_arena *arena) {
- struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider* sub = (struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider*)envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_validation_context_certificate_provider(msg);
- if (sub == NULL) {
- sub = (struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider*)_upb_msg_new(&envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_msginit, arena);
- if (!sub) return NULL;
- envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_set_validation_context_certificate_provider(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_set_tls_certificate_certificate_provider_instance(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance*) = value;
-}
-UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_mutable_tls_certificate_certificate_provider_instance(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, upb_arena *arena) {
- struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance* sub = (struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance*)envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_tls_certificate_certificate_provider_instance(msg);
- if (sub == NULL) {
- sub = (struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance*)_upb_msg_new(&envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_msginit, arena);
- if (!sub) return NULL;
- envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_set_tls_certificate_certificate_provider_instance(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_set_validation_context_certificate_provider_instance(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance* value) {
- UPB_WRITE_ONEOF(msg, envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance*, UPB_SIZE(28, 56), value, UPB_SIZE(32, 64), 12);
-}
-UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_mutable_validation_context_certificate_provider_instance(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, upb_arena *arena) {
- struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance* sub = (struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance*)envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_validation_context_certificate_provider_instance(msg);
- if (sub == NULL) {
- sub = (struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance*)_upb_msg_new(&envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_msginit, arena);
- if (!sub) return NULL;
- envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_set_validation_context_certificate_provider_instance(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_set_custom_handshaker(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, struct envoy_config_core_v3_TypedExtensionConfig* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct envoy_config_core_v3_TypedExtensionConfig*) = value;
-}
-UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_mutable_custom_handshaker(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, upb_arena *arena) {
- struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_custom_handshaker(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_msg_new(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena);
- if (!sub) return NULL;
- envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_set_custom_handshaker(msg, sub);
- }
- return sub;
-}
-
-/* envoy.extensions.transport_sockets.tls.v3.CommonTlsContext.CertificateProvider */
-
-UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider *envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_new(upb_arena *arena) {
- return (envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider *)_upb_msg_new(&envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_msginit, arena);
-}
-UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider *envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider *ret = envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_serialize(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_msginit, arena, len);
-}
-
-typedef enum {
- envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_config_typed_config = 2,
- envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_config_NOT_SET = 0
-} envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_config_oneofcases;
-UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_config_oneofcases envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_config_case(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider* msg) { return (envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_config_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(12, 24), int32_t); }
-
-UPB_INLINE upb_strview envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_name(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_has_typed_config(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 2; }
-UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_typed_config(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider *msg) { return UPB_READ_ONEOF(msg, const struct envoy_config_core_v3_TypedExtensionConfig*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 2, NULL); }
-
-UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_set_name(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_set_typed_config(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider *msg, struct envoy_config_core_v3_TypedExtensionConfig* value) {
- UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_TypedExtensionConfig*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 2);
-}
-UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_mutable_typed_config(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider *msg, upb_arena *arena) {
- struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_typed_config(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_msg_new(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena);
- if (!sub) return NULL;
- envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_set_typed_config(msg, sub);
- }
- return sub;
-}
-
-/* envoy.extensions.transport_sockets.tls.v3.CommonTlsContext.CertificateProviderInstance */
-
-UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance *envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_new(upb_arena *arena) {
- return (envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance *)_upb_msg_new(&envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_msginit, arena);
-}
-UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance *envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance *ret = envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_serialize(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_instance_name(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE upb_strview envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_certificate_name(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview); }
-
-UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_set_instance_name(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_set_certificate_name(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview) = value;
-}
-
-/* envoy.extensions.transport_sockets.tls.v3.CommonTlsContext.CombinedCertificateValidationContext */
-
-UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext *envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_new(upb_arena *arena) {
- return (envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext *)_upb_msg_new(&envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_msginit, arena);
-}
-UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext *envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext *ret = envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_serialize(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_has_default_validation_context(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE const struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_default_validation_context(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext*); }
-UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_has_validation_context_sds_secret_config(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
-UPB_INLINE const struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_validation_context_sds_secret_config(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig*); }
-UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_has_validation_context_certificate_provider(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_validation_context_certificate_provider(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider*); }
-UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_has_validation_context_certificate_provider_instance(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
-UPB_INLINE const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_validation_context_certificate_provider_instance(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance*); }
-
-UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_set_default_validation_context(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext *msg, struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext*) = value;
-}
-UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_mutable_default_validation_context(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext *msg, upb_arena *arena) {
- struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* sub = (struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext*)envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_default_validation_context(msg);
- if (sub == NULL) {
- sub = (struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext*)_upb_msg_new(&envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msginit, arena);
- if (!sub) return NULL;
- envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_set_default_validation_context(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_set_validation_context_sds_secret_config(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext *msg, struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig*) = value;
-}
-UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_mutable_validation_context_sds_secret_config(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext *msg, upb_arena *arena) {
- struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* sub = (struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig*)envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_validation_context_sds_secret_config(msg);
- if (sub == NULL) {
- sub = (struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig*)_upb_msg_new(&envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msginit, arena);
- if (!sub) return NULL;
- envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_set_validation_context_sds_secret_config(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_set_validation_context_certificate_provider(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext *msg, envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider*) = value;
-}
-UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_mutable_validation_context_certificate_provider(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext *msg, upb_arena *arena) {
- struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider* sub = (struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider*)envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_validation_context_certificate_provider(msg);
- if (sub == NULL) {
- sub = (struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider*)_upb_msg_new(&envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_msginit, arena);
- if (!sub) return NULL;
- envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_set_validation_context_certificate_provider(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_set_validation_context_certificate_provider_instance(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext *msg, envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance*) = value;
-}
-UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_mutable_validation_context_certificate_provider_instance(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext *msg, upb_arena *arena) {
- struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance* sub = (struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance*)envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_validation_context_certificate_provider_instance(msg);
- if (sub == NULL) {
- sub = (struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance*)_upb_msg_new(&envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_msginit, arena);
- if (!sub) return NULL;
- envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_set_validation_context_certificate_provider_instance(msg, sub);
- }
- return sub;
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* ENVOY_EXTENSIONS_TRANSPORT_SOCKETS_TLS_V3_TLS_PROTO_UPB_H_ */
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/extensions/transport_sockets/tls/v3/tls.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_EXTENSIONS_TRANSPORT_SOCKETS_TLS_V3_TLS_PROTO_UPB_H_
+#define ENVOY_EXTENSIONS_TRANSPORT_SOCKETS_TLS_V3_TLS_PROTO_UPB_H_
+
+#include "upb/msg.h"
+#include "upb/decode.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext;
+struct envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext;
+struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext;
+struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider;
+struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance;
+struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext;
+typedef struct envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext;
+typedef struct envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext;
+typedef struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext envoy_extensions_transport_sockets_tls_v3_CommonTlsContext;
+typedef struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider;
+typedef struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance;
+typedef struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext;
+extern const upb_msglayout envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_msginit;
+extern const upb_msglayout envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_msginit;
+extern const upb_msglayout envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_msginit;
+extern const upb_msglayout envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_msginit;
+extern const upb_msglayout envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_msginit;
+extern const upb_msglayout envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_msginit;
+struct envoy_config_core_v3_TypedExtensionConfig;
+struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext;
+struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig;
+struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate;
+struct envoy_extensions_transport_sockets_tls_v3_TlsParameters;
+struct envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys;
+struct google_protobuf_BoolValue;
+struct google_protobuf_Duration;
+struct google_protobuf_UInt32Value;
+extern const upb_msglayout envoy_config_core_v3_TypedExtensionConfig_msginit;
+extern const upb_msglayout envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msginit;
+extern const upb_msglayout envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msginit;
+extern const upb_msglayout envoy_extensions_transport_sockets_tls_v3_TlsCertificate_msginit;
+extern const upb_msglayout envoy_extensions_transport_sockets_tls_v3_TlsParameters_msginit;
+extern const upb_msglayout envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_msginit;
+extern const upb_msglayout google_protobuf_BoolValue_msginit;
+extern const upb_msglayout google_protobuf_Duration_msginit;
+extern const upb_msglayout google_protobuf_UInt32Value_msginit;
+
+typedef enum {
+ envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_LENIENT_STAPLING = 0,
+ envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_STRICT_STAPLING = 1,
+ envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_MUST_STAPLE = 2
+} envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_OcspStaplePolicy;
+
+
+/* envoy.extensions.transport_sockets.tls.v3.UpstreamTlsContext */
+
+UPB_INLINE envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext *envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_new(upb_arena *arena) {
+ return (envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext *)_upb_msg_new(&envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_msginit, arena);
+}
+UPB_INLINE envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext *envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext *ret = envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_serialize(const envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_has_common_tls_context(const envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
+UPB_INLINE const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_common_tls_context(const envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext*); }
+UPB_INLINE upb_strview envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_sni(const envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
+UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_allow_renegotiation(const envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); }
+UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_has_max_session_keys(const envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); }
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_max_session_keys(const envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const struct google_protobuf_UInt32Value*); }
+
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_set_common_tls_context(envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext *msg, envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), envoy_extensions_transport_sockets_tls_v3_CommonTlsContext*) = value;
+}
+UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_mutable_common_tls_context(envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext *msg, upb_arena *arena) {
+ struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* sub = (struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext*)envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_common_tls_context(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext*)_upb_msg_new(&envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_set_common_tls_context(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_set_sni(envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_set_allow_renegotiation(envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_set_max_session_keys(envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext *msg, struct google_protobuf_UInt32Value* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_mutable_max_session_keys(envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext *msg, upb_arena *arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_max_session_keys(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_set_max_session_keys(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.extensions.transport_sockets.tls.v3.DownstreamTlsContext */
+
+UPB_INLINE envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_new(upb_arena *arena) {
+ return (envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *)_upb_msg_new(&envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_msginit, arena);
+}
+UPB_INLINE envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *ret = envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_serialize(const envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_msginit, arena, len);
+}
+
+typedef enum {
+ envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_session_ticket_keys_type_session_ticket_keys = 4,
+ envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_session_ticket_keys_type_session_ticket_keys_sds_secret_config = 5,
+ envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_session_ticket_keys_type_disable_stateless_session_resumption = 7,
+ envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_session_ticket_keys_type_NOT_SET = 0
+} envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_session_ticket_keys_type_oneofcases;
+UPB_INLINE envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_session_ticket_keys_type_oneofcases envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_session_ticket_keys_type_case(const envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext* msg) { return (envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_session_ticket_keys_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(28, 48), int32_t); }
+
+UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_has_common_tls_context(const envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 8)); }
+UPB_INLINE const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_common_tls_context(const envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext*); }
+UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_has_require_client_certificate(const envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 16)); }
+UPB_INLINE const struct google_protobuf_BoolValue* envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_require_client_certificate(const envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const struct google_protobuf_BoolValue*); }
+UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_has_require_sni(const envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 24)); }
+UPB_INLINE const struct google_protobuf_BoolValue* envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_require_sni(const envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const struct google_protobuf_BoolValue*); }
+UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_has_session_ticket_keys(const envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *msg) { return _upb_getoneofcase(msg, UPB_SIZE(28, 48)) == 4; }
+UPB_INLINE const struct envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys* envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_session_ticket_keys(const envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *msg) { return UPB_READ_ONEOF(msg, const struct envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys*, UPB_SIZE(24, 40), UPB_SIZE(28, 48), 4, NULL); }
+UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_has_session_ticket_keys_sds_secret_config(const envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *msg) { return _upb_getoneofcase(msg, UPB_SIZE(28, 48)) == 5; }
+UPB_INLINE const struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_session_ticket_keys_sds_secret_config(const envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *msg) { return UPB_READ_ONEOF(msg, const struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig*, UPB_SIZE(24, 40), UPB_SIZE(28, 48), 5, NULL); }
+UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_has_session_timeout(const envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 32)); }
+UPB_INLINE const struct google_protobuf_Duration* envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_session_timeout(const envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const struct google_protobuf_Duration*); }
+UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_has_disable_stateless_session_resumption(const envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *msg) { return _upb_getoneofcase(msg, UPB_SIZE(28, 48)) == 7; }
+UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_disable_stateless_session_resumption(const envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *msg) { return UPB_READ_ONEOF(msg, bool, UPB_SIZE(24, 40), UPB_SIZE(28, 48), 7, false); }
+UPB_INLINE int32_t envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_ocsp_staple_policy(const envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
+
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_set_common_tls_context(envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *msg, envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), envoy_extensions_transport_sockets_tls_v3_CommonTlsContext*) = value;
+}
+UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_mutable_common_tls_context(envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *msg, upb_arena *arena) {
+ struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* sub = (struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext*)envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_common_tls_context(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext*)_upb_msg_new(&envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_set_common_tls_context(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_set_require_client_certificate(envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *msg, struct google_protobuf_BoolValue* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 16), struct google_protobuf_BoolValue*) = value;
+}
+UPB_INLINE struct google_protobuf_BoolValue* envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_mutable_require_client_certificate(envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *msg, upb_arena *arena) {
+ struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_require_client_certificate(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_BoolValue*)_upb_msg_new(&google_protobuf_BoolValue_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_set_require_client_certificate(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_set_require_sni(envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *msg, struct google_protobuf_BoolValue* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), struct google_protobuf_BoolValue*) = value;
+}
+UPB_INLINE struct google_protobuf_BoolValue* envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_mutable_require_sni(envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *msg, upb_arena *arena) {
+ struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_require_sni(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_BoolValue*)_upb_msg_new(&google_protobuf_BoolValue_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_set_require_sni(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_set_session_ticket_keys(envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *msg, struct envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys* value) {
+ UPB_WRITE_ONEOF(msg, struct envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys*, UPB_SIZE(24, 40), value, UPB_SIZE(28, 48), 4);
+}
+UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys* envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_mutable_session_ticket_keys(envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *msg, upb_arena *arena) {
+ struct envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys* sub = (struct envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys*)envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_session_ticket_keys(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys*)_upb_msg_new(&envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_set_session_ticket_keys(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_set_session_ticket_keys_sds_secret_config(envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *msg, struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* value) {
+ UPB_WRITE_ONEOF(msg, struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig*, UPB_SIZE(24, 40), value, UPB_SIZE(28, 48), 5);
+}
+UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_mutable_session_ticket_keys_sds_secret_config(envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *msg, upb_arena *arena) {
+ struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* sub = (struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig*)envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_session_ticket_keys_sds_secret_config(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig*)_upb_msg_new(&envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_set_session_ticket_keys_sds_secret_config(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_set_session_timeout(envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *msg, struct google_protobuf_Duration* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 32), struct google_protobuf_Duration*) = value;
+}
+UPB_INLINE struct google_protobuf_Duration* envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_mutable_session_timeout(envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *msg, upb_arena *arena) {
+ struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_session_timeout(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_set_session_timeout(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_set_disable_stateless_session_resumption(envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *msg, bool value) {
+ UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(24, 40), value, UPB_SIZE(28, 48), 7);
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_set_ocsp_staple_policy(envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *msg, int32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
+}
+
+/* envoy.extensions.transport_sockets.tls.v3.CommonTlsContext */
+
+UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_new(upb_arena *arena) {
+ return (envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *)_upb_msg_new(&envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_msginit, arena);
+}
+UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *ret = envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_serialize(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_msginit, arena, len);
+}
+
+typedef enum {
+ envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_validation_context_type_validation_context = 3,
+ envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_validation_context_type_validation_context_sds_secret_config = 7,
+ envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_validation_context_type_combined_validation_context = 8,
+ envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_validation_context_type_validation_context_certificate_provider = 10,
+ envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_validation_context_type_validation_context_certificate_provider_instance = 12,
+ envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_validation_context_type_NOT_SET = 0
+} envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_validation_context_type_oneofcases;
+UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_validation_context_type_oneofcases envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_validation_context_type_case(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) { return (envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_validation_context_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(32, 64), int32_t); }
+
+UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_has_tls_params(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE const struct envoy_extensions_transport_sockets_tls_v3_TlsParameters* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_tls_params(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct envoy_extensions_transport_sockets_tls_v3_TlsParameters*); }
+UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_has_tls_certificates(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); }
+UPB_INLINE const struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate* const* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_tls_certificates(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, size_t *len) { return (const struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate* const*)_upb_array_accessor(msg, UPB_SIZE(16, 32), len); }
+UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_has_validation_context(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg) { return _upb_getoneofcase(msg, UPB_SIZE(32, 64)) == 3; }
+UPB_INLINE const struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_validation_context(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg) { return UPB_READ_ONEOF(msg, const struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext*, UPB_SIZE(28, 56), UPB_SIZE(32, 64), 3, NULL); }
+UPB_INLINE upb_strview const* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_alpn_protocols(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(20, 40), len); }
+UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_has_tls_certificate_sds_secret_configs(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 48)); }
+UPB_INLINE const struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* const* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_tls_certificate_sds_secret_configs(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, size_t *len) { return (const struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* const*)_upb_array_accessor(msg, UPB_SIZE(24, 48), len); }
+UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_has_validation_context_sds_secret_config(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg) { return _upb_getoneofcase(msg, UPB_SIZE(32, 64)) == 7; }
+UPB_INLINE const struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_validation_context_sds_secret_config(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg) { return UPB_READ_ONEOF(msg, const struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig*, UPB_SIZE(28, 56), UPB_SIZE(32, 64), 7, NULL); }
+UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_has_combined_validation_context(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg) { return _upb_getoneofcase(msg, UPB_SIZE(32, 64)) == 8; }
+UPB_INLINE const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_combined_validation_context(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg) { return UPB_READ_ONEOF(msg, const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext*, UPB_SIZE(28, 56), UPB_SIZE(32, 64), 8, NULL); }
+UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_has_tls_certificate_certificate_provider(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
+UPB_INLINE const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_tls_certificate_certificate_provider(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider*); }
+UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_has_validation_context_certificate_provider(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg) { return _upb_getoneofcase(msg, UPB_SIZE(32, 64)) == 10; }
+UPB_INLINE const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_validation_context_certificate_provider(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg) { return UPB_READ_ONEOF(msg, const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider*, UPB_SIZE(28, 56), UPB_SIZE(32, 64), 10, NULL); }
+UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_has_tls_certificate_certificate_provider_instance(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
+UPB_INLINE const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_tls_certificate_certificate_provider_instance(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance*); }
+UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_has_validation_context_certificate_provider_instance(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg) { return _upb_getoneofcase(msg, UPB_SIZE(32, 64)) == 12; }
+UPB_INLINE const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_validation_context_certificate_provider_instance(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg) { return UPB_READ_ONEOF(msg, const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance*, UPB_SIZE(28, 56), UPB_SIZE(32, 64), 12, NULL); }
+UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_has_custom_handshaker(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
+UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_custom_handshaker(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct envoy_config_core_v3_TypedExtensionConfig*); }
+
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_set_tls_params(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, struct envoy_extensions_transport_sockets_tls_v3_TlsParameters* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct envoy_extensions_transport_sockets_tls_v3_TlsParameters*) = value;
+}
+UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_TlsParameters* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_mutable_tls_params(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, upb_arena *arena) {
+ struct envoy_extensions_transport_sockets_tls_v3_TlsParameters* sub = (struct envoy_extensions_transport_sockets_tls_v3_TlsParameters*)envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_tls_params(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_extensions_transport_sockets_tls_v3_TlsParameters*)_upb_msg_new(&envoy_extensions_transport_sockets_tls_v3_TlsParameters_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_set_tls_params(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate** envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_mutable_tls_certificates(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, size_t *len) {
+ return (struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate**)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 32), len);
+}
+UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate** envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_resize_tls_certificates(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, size_t len, upb_arena *arena) {
+ return (struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate**)_upb_array_resize_accessor(msg, UPB_SIZE(16, 32), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_add_tls_certificates(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, upb_arena *arena) {
+ struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate* sub = (struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate*)_upb_msg_new(&envoy_extensions_transport_sockets_tls_v3_TlsCertificate_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(16, 32), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_set_validation_context(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* value) {
+ UPB_WRITE_ONEOF(msg, struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext*, UPB_SIZE(28, 56), value, UPB_SIZE(32, 64), 3);
+}
+UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_mutable_validation_context(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, upb_arena *arena) {
+ struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* sub = (struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext*)envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_validation_context(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext*)_upb_msg_new(&envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_set_validation_context(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE upb_strview* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_mutable_alpn_protocols(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, size_t *len) {
+ return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 40), len);
+}
+UPB_INLINE upb_strview* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_resize_alpn_protocols(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, size_t len, upb_arena *arena) {
+ return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(20, 40), len, UPB_TYPE_STRING, arena);
+}
+UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_add_alpn_protocols(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, upb_strview val, upb_arena *arena) {
+ return _upb_array_append_accessor(msg, UPB_SIZE(20, 40), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
+ arena);
+}
+UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig** envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_mutable_tls_certificate_sds_secret_configs(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, size_t *len) {
+ return (struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig**)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 48), len);
+}
+UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig** envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_resize_tls_certificate_sds_secret_configs(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, size_t len, upb_arena *arena) {
+ return (struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig**)_upb_array_resize_accessor(msg, UPB_SIZE(24, 48), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_add_tls_certificate_sds_secret_configs(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, upb_arena *arena) {
+ struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* sub = (struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig*)_upb_msg_new(&envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(24, 48), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_set_validation_context_sds_secret_config(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* value) {
+ UPB_WRITE_ONEOF(msg, struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig*, UPB_SIZE(28, 56), value, UPB_SIZE(32, 64), 7);
+}
+UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_mutable_validation_context_sds_secret_config(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, upb_arena *arena) {
+ struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* sub = (struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig*)envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_validation_context_sds_secret_config(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig*)_upb_msg_new(&envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_set_validation_context_sds_secret_config(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_set_combined_validation_context(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext* value) {
+ UPB_WRITE_ONEOF(msg, envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext*, UPB_SIZE(28, 56), value, UPB_SIZE(32, 64), 8);
+}
+UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_mutable_combined_validation_context(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, upb_arena *arena) {
+ struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext* sub = (struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext*)envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_combined_validation_context(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext*)_upb_msg_new(&envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_set_combined_validation_context(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_set_tls_certificate_certificate_provider(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider*) = value;
+}
+UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_mutable_tls_certificate_certificate_provider(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, upb_arena *arena) {
+ struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider* sub = (struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider*)envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_tls_certificate_certificate_provider(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider*)_upb_msg_new(&envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_set_tls_certificate_certificate_provider(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_set_validation_context_certificate_provider(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider* value) {
+ UPB_WRITE_ONEOF(msg, envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider*, UPB_SIZE(28, 56), value, UPB_SIZE(32, 64), 10);
+}
+UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_mutable_validation_context_certificate_provider(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, upb_arena *arena) {
+ struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider* sub = (struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider*)envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_validation_context_certificate_provider(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider*)_upb_msg_new(&envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_set_validation_context_certificate_provider(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_set_tls_certificate_certificate_provider_instance(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance*) = value;
+}
+UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_mutable_tls_certificate_certificate_provider_instance(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, upb_arena *arena) {
+ struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance* sub = (struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance*)envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_tls_certificate_certificate_provider_instance(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance*)_upb_msg_new(&envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_set_tls_certificate_certificate_provider_instance(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_set_validation_context_certificate_provider_instance(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance* value) {
+ UPB_WRITE_ONEOF(msg, envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance*, UPB_SIZE(28, 56), value, UPB_SIZE(32, 64), 12);
+}
+UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_mutable_validation_context_certificate_provider_instance(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, upb_arena *arena) {
+ struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance* sub = (struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance*)envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_validation_context_certificate_provider_instance(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance*)_upb_msg_new(&envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_set_validation_context_certificate_provider_instance(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_set_custom_handshaker(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, struct envoy_config_core_v3_TypedExtensionConfig* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct envoy_config_core_v3_TypedExtensionConfig*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_mutable_custom_handshaker(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_custom_handshaker(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_msg_new(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_set_custom_handshaker(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.extensions.transport_sockets.tls.v3.CommonTlsContext.CertificateProvider */
+
+UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider *envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_new(upb_arena *arena) {
+ return (envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider *)_upb_msg_new(&envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_msginit, arena);
+}
+UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider *envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider *ret = envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_serialize(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_msginit, arena, len);
+}
+
+typedef enum {
+ envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_config_typed_config = 2,
+ envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_config_NOT_SET = 0
+} envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_config_oneofcases;
+UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_config_oneofcases envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_config_case(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider* msg) { return (envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_config_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(12, 24), int32_t); }
+
+UPB_INLINE upb_strview envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_name(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_has_typed_config(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 2; }
+UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_typed_config(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider *msg) { return UPB_READ_ONEOF(msg, const struct envoy_config_core_v3_TypedExtensionConfig*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 2, NULL); }
+
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_set_name(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_set_typed_config(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider *msg, struct envoy_config_core_v3_TypedExtensionConfig* value) {
+ UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_TypedExtensionConfig*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 2);
+}
+UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_mutable_typed_config(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_typed_config(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_msg_new(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_set_typed_config(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.extensions.transport_sockets.tls.v3.CommonTlsContext.CertificateProviderInstance */
+
+UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance *envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_new(upb_arena *arena) {
+ return (envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance *)_upb_msg_new(&envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_msginit, arena);
+}
+UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance *envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance *ret = envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_serialize(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_instance_name(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE upb_strview envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_certificate_name(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview); }
+
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_set_instance_name(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_set_certificate_name(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview) = value;
+}
+
+/* envoy.extensions.transport_sockets.tls.v3.CommonTlsContext.CombinedCertificateValidationContext */
+
+UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext *envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_new(upb_arena *arena) {
+ return (envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext *)_upb_msg_new(&envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_msginit, arena);
+}
+UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext *envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext *ret = envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_serialize(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_has_default_validation_context(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE const struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_default_validation_context(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext*); }
+UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_has_validation_context_sds_secret_config(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
+UPB_INLINE const struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_validation_context_sds_secret_config(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig*); }
+UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_has_validation_context_certificate_provider(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
+UPB_INLINE const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_validation_context_certificate_provider(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider*); }
+UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_has_validation_context_certificate_provider_instance(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
+UPB_INLINE const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_validation_context_certificate_provider_instance(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance*); }
+
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_set_default_validation_context(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext *msg, struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext*) = value;
+}
+UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_mutable_default_validation_context(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext *msg, upb_arena *arena) {
+ struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* sub = (struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext*)envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_default_validation_context(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext*)_upb_msg_new(&envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_set_default_validation_context(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_set_validation_context_sds_secret_config(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext *msg, struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig*) = value;
+}
+UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_mutable_validation_context_sds_secret_config(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext *msg, upb_arena *arena) {
+ struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* sub = (struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig*)envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_validation_context_sds_secret_config(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig*)_upb_msg_new(&envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_set_validation_context_sds_secret_config(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_set_validation_context_certificate_provider(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext *msg, envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider*) = value;
+}
+UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_mutable_validation_context_certificate_provider(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext *msg, upb_arena *arena) {
+ struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider* sub = (struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider*)envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_validation_context_certificate_provider(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider*)_upb_msg_new(&envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_set_validation_context_certificate_provider(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_set_validation_context_certificate_provider_instance(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext *msg, envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance*) = value;
+}
+UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_mutable_validation_context_certificate_provider_instance(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext *msg, upb_arena *arena) {
+ struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance* sub = (struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance*)envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_validation_context_certificate_provider_instance(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance*)_upb_msg_new(&envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_set_validation_context_certificate_provider_instance(msg, sub);
+ }
+ return sub;
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_EXTENSIONS_TRANSPORT_SOCKETS_TLS_V3_TLS_PROTO_UPB_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/cluster/v3/cds.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/cluster/v3/cds.upb.c
index 53f3990ae10..c8660dbd536 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/cluster/v3/cds.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/cluster/v3/cds.upb.c
@@ -1,27 +1,27 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/service/cluster/v3/cds.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include <stddef.h>
-#include "upb/msg.h"
-#include "envoy/service/cluster/v3/cds.upb.h"
-#include "envoy/service/discovery/v3/discovery.upb.h"
-#include "google/api/annotations.upb.h"
-#include "envoy/annotations/resource.upb.h"
-#include "udpa/annotations/status.upb.h"
-#include "udpa/annotations/versioning.upb.h"
-
-#include "upb/port_def.inc"
-
-const upb_msglayout envoy_service_cluster_v3_CdsDummy_msginit = {
- NULL,
- NULL,
- UPB_SIZE(0, 0), 0, false,
-};
-
-#include "upb/port_undef.inc"
-
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/service/cluster/v3/cds.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg.h"
+#include "envoy/service/cluster/v3/cds.upb.h"
+#include "envoy/service/discovery/v3/discovery.upb.h"
+#include "google/api/annotations.upb.h"
+#include "envoy/annotations/resource.upb.h"
+#include "udpa/annotations/status.upb.h"
+#include "udpa/annotations/versioning.upb.h"
+
+#include "upb/port_def.inc"
+
+const upb_msglayout envoy_service_cluster_v3_CdsDummy_msginit = {
+ NULL,
+ NULL,
+ UPB_SIZE(0, 0), 0, false,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/cluster/v3/cds.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/cluster/v3/cds.upb.h
index aee6fa71a5c..11d8572c4a3 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/cluster/v3/cds.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/cluster/v3/cds.upb.h
@@ -1,49 +1,49 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/service/cluster/v3/cds.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef ENVOY_SERVICE_CLUSTER_V3_CDS_PROTO_UPB_H_
-#define ENVOY_SERVICE_CLUSTER_V3_CDS_PROTO_UPB_H_
-
-#include "upb/msg.h"
-#include "upb/decode.h"
-#include "upb/encode.h"
-
-#include "upb/port_def.inc"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct envoy_service_cluster_v3_CdsDummy;
-typedef struct envoy_service_cluster_v3_CdsDummy envoy_service_cluster_v3_CdsDummy;
-extern const upb_msglayout envoy_service_cluster_v3_CdsDummy_msginit;
-
-
-/* envoy.service.cluster.v3.CdsDummy */
-
-UPB_INLINE envoy_service_cluster_v3_CdsDummy *envoy_service_cluster_v3_CdsDummy_new(upb_arena *arena) {
- return (envoy_service_cluster_v3_CdsDummy *)_upb_msg_new(&envoy_service_cluster_v3_CdsDummy_msginit, arena);
-}
-UPB_INLINE envoy_service_cluster_v3_CdsDummy *envoy_service_cluster_v3_CdsDummy_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_service_cluster_v3_CdsDummy *ret = envoy_service_cluster_v3_CdsDummy_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_service_cluster_v3_CdsDummy_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_service_cluster_v3_CdsDummy_serialize(const envoy_service_cluster_v3_CdsDummy *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_service_cluster_v3_CdsDummy_msginit, arena, len);
-}
-
-
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* ENVOY_SERVICE_CLUSTER_V3_CDS_PROTO_UPB_H_ */
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/service/cluster/v3/cds.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_SERVICE_CLUSTER_V3_CDS_PROTO_UPB_H_
+#define ENVOY_SERVICE_CLUSTER_V3_CDS_PROTO_UPB_H_
+
+#include "upb/msg.h"
+#include "upb/decode.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_service_cluster_v3_CdsDummy;
+typedef struct envoy_service_cluster_v3_CdsDummy envoy_service_cluster_v3_CdsDummy;
+extern const upb_msglayout envoy_service_cluster_v3_CdsDummy_msginit;
+
+
+/* envoy.service.cluster.v3.CdsDummy */
+
+UPB_INLINE envoy_service_cluster_v3_CdsDummy *envoy_service_cluster_v3_CdsDummy_new(upb_arena *arena) {
+ return (envoy_service_cluster_v3_CdsDummy *)_upb_msg_new(&envoy_service_cluster_v3_CdsDummy_msginit, arena);
+}
+UPB_INLINE envoy_service_cluster_v3_CdsDummy *envoy_service_cluster_v3_CdsDummy_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_service_cluster_v3_CdsDummy *ret = envoy_service_cluster_v3_CdsDummy_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_service_cluster_v3_CdsDummy_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_service_cluster_v3_CdsDummy_serialize(const envoy_service_cluster_v3_CdsDummy *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_service_cluster_v3_CdsDummy_msginit, arena, len);
+}
+
+
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_SERVICE_CLUSTER_V3_CDS_PROTO_UPB_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.c
index 3749618a67e..959e3cbea22 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.c
@@ -1,25 +1,25 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/service/discovery/v3/ads.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include <stddef.h>
-#include "upb/msg.h"
-#include "envoy/service/discovery/v3/ads.upb.h"
-#include "envoy/service/discovery/v3/discovery.upb.h"
-#include "udpa/annotations/status.upb.h"
-#include "udpa/annotations/versioning.upb.h"
-
-#include "upb/port_def.inc"
-
-const upb_msglayout envoy_service_discovery_v3_AdsDummy_msginit = {
- NULL,
- NULL,
- UPB_SIZE(0, 0), 0, false,
-};
-
-#include "upb/port_undef.inc"
-
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/service/discovery/v3/ads.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg.h"
+#include "envoy/service/discovery/v3/ads.upb.h"
+#include "envoy/service/discovery/v3/discovery.upb.h"
+#include "udpa/annotations/status.upb.h"
+#include "udpa/annotations/versioning.upb.h"
+
+#include "upb/port_def.inc"
+
+const upb_msglayout envoy_service_discovery_v3_AdsDummy_msginit = {
+ NULL,
+ NULL,
+ UPB_SIZE(0, 0), 0, false,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.h
index 020ede32894..41dc6428d13 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.h
@@ -1,49 +1,49 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/service/discovery/v3/ads.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef ENVOY_SERVICE_DISCOVERY_V3_ADS_PROTO_UPB_H_
-#define ENVOY_SERVICE_DISCOVERY_V3_ADS_PROTO_UPB_H_
-
-#include "upb/msg.h"
-#include "upb/decode.h"
-#include "upb/encode.h"
-
-#include "upb/port_def.inc"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct envoy_service_discovery_v3_AdsDummy;
-typedef struct envoy_service_discovery_v3_AdsDummy envoy_service_discovery_v3_AdsDummy;
-extern const upb_msglayout envoy_service_discovery_v3_AdsDummy_msginit;
-
-
-/* envoy.service.discovery.v3.AdsDummy */
-
-UPB_INLINE envoy_service_discovery_v3_AdsDummy *envoy_service_discovery_v3_AdsDummy_new(upb_arena *arena) {
- return (envoy_service_discovery_v3_AdsDummy *)_upb_msg_new(&envoy_service_discovery_v3_AdsDummy_msginit, arena);
-}
-UPB_INLINE envoy_service_discovery_v3_AdsDummy *envoy_service_discovery_v3_AdsDummy_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_service_discovery_v3_AdsDummy *ret = envoy_service_discovery_v3_AdsDummy_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_service_discovery_v3_AdsDummy_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_service_discovery_v3_AdsDummy_serialize(const envoy_service_discovery_v3_AdsDummy *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_service_discovery_v3_AdsDummy_msginit, arena, len);
-}
-
-
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* ENVOY_SERVICE_DISCOVERY_V3_ADS_PROTO_UPB_H_ */
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/service/discovery/v3/ads.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_SERVICE_DISCOVERY_V3_ADS_PROTO_UPB_H_
+#define ENVOY_SERVICE_DISCOVERY_V3_ADS_PROTO_UPB_H_
+
+#include "upb/msg.h"
+#include "upb/decode.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_service_discovery_v3_AdsDummy;
+typedef struct envoy_service_discovery_v3_AdsDummy envoy_service_discovery_v3_AdsDummy;
+extern const upb_msglayout envoy_service_discovery_v3_AdsDummy_msginit;
+
+
+/* envoy.service.discovery.v3.AdsDummy */
+
+UPB_INLINE envoy_service_discovery_v3_AdsDummy *envoy_service_discovery_v3_AdsDummy_new(upb_arena *arena) {
+ return (envoy_service_discovery_v3_AdsDummy *)_upb_msg_new(&envoy_service_discovery_v3_AdsDummy_msginit, arena);
+}
+UPB_INLINE envoy_service_discovery_v3_AdsDummy *envoy_service_discovery_v3_AdsDummy_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_service_discovery_v3_AdsDummy *ret = envoy_service_discovery_v3_AdsDummy_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_service_discovery_v3_AdsDummy_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_service_discovery_v3_AdsDummy_serialize(const envoy_service_discovery_v3_AdsDummy *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_service_discovery_v3_AdsDummy_msginit, arena, len);
+}
+
+
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_SERVICE_DISCOVERY_V3_ADS_PROTO_UPB_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.c
index db4ac38dae0..2c76a985cba 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.c
@@ -1,139 +1,139 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/service/discovery/v3/discovery.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include <stddef.h>
-#include "upb/msg.h"
-#include "envoy/service/discovery/v3/discovery.upb.h"
-#include "envoy/config/core/v3/base.upb.h"
-#include "google/protobuf/any.upb.h"
-#include "google/rpc/status.upb.h"
-#include "udpa/core/v1/resource_locator.upb.h"
-#include "udpa/core/v1/resource_name.upb.h"
-#include "udpa/annotations/migrate.upb.h"
-#include "udpa/annotations/status.upb.h"
-#include "udpa/annotations/versioning.upb.h"
-
-#include "upb/port_def.inc"
-
-static const upb_msglayout *const envoy_service_discovery_v3_DiscoveryRequest_submsgs[2] = {
- &envoy_config_core_v3_Node_msginit,
- &google_rpc_Status_msginit,
-};
-
-static const upb_msglayout_field envoy_service_discovery_v3_DiscoveryRequest__fields[6] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(24, 48), 0, 0, 11, 1},
- {3, UPB_SIZE(32, 64), 0, 0, 9, 3},
- {4, UPB_SIZE(8, 16), 0, 0, 9, 1},
- {5, UPB_SIZE(16, 32), 0, 0, 9, 1},
- {6, UPB_SIZE(28, 56), 0, 1, 11, 1},
-};
-
-const upb_msglayout envoy_service_discovery_v3_DiscoveryRequest_msginit = {
- &envoy_service_discovery_v3_DiscoveryRequest_submsgs[0],
- &envoy_service_discovery_v3_DiscoveryRequest__fields[0],
- UPB_SIZE(40, 80), 6, false,
-};
-
-static const upb_msglayout *const envoy_service_discovery_v3_DiscoveryResponse_submsgs[2] = {
- &envoy_config_core_v3_ControlPlane_msginit,
- &google_protobuf_Any_msginit,
-};
-
-static const upb_msglayout_field envoy_service_discovery_v3_DiscoveryResponse__fields[6] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(32, 64), 0, 1, 11, 3},
- {3, UPB_SIZE(0, 0), 0, 0, 8, 1},
- {4, UPB_SIZE(12, 24), 0, 0, 9, 1},
- {5, UPB_SIZE(20, 40), 0, 0, 9, 1},
- {6, UPB_SIZE(28, 56), 0, 0, 11, 1},
-};
-
-const upb_msglayout envoy_service_discovery_v3_DiscoveryResponse_msginit = {
- &envoy_service_discovery_v3_DiscoveryResponse_submsgs[0],
- &envoy_service_discovery_v3_DiscoveryResponse__fields[0],
- UPB_SIZE(40, 80), 6, false,
-};
-
-static const upb_msglayout *const envoy_service_discovery_v3_DeltaDiscoveryRequest_submsgs[5] = {
- &envoy_config_core_v3_Node_msginit,
- &envoy_service_discovery_v3_DeltaDiscoveryRequest_InitialResourceVersionsEntry_msginit,
- &google_rpc_Status_msginit,
- &udpa_core_v1_ResourceLocator_msginit,
-};
-
-static const upb_msglayout_field envoy_service_discovery_v3_DeltaDiscoveryRequest__fields[9] = {
- {1, UPB_SIZE(16, 32), 0, 0, 11, 1},
- {2, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {3, UPB_SIZE(24, 48), 0, 0, 9, 3},
- {4, UPB_SIZE(28, 56), 0, 0, 9, 3},
- {5, UPB_SIZE(32, 64), 0, 1, 11, _UPB_LABEL_MAP},
- {6, UPB_SIZE(8, 16), 0, 0, 9, 1},
- {7, UPB_SIZE(20, 40), 0, 2, 11, 1},
- {8, UPB_SIZE(36, 72), 0, 3, 11, 3},
- {9, UPB_SIZE(40, 80), 0, 3, 11, 3},
-};
-
-const upb_msglayout envoy_service_discovery_v3_DeltaDiscoveryRequest_msginit = {
- &envoy_service_discovery_v3_DeltaDiscoveryRequest_submsgs[0],
- &envoy_service_discovery_v3_DeltaDiscoveryRequest__fields[0],
- UPB_SIZE(48, 96), 9, false,
-};
-
-static const upb_msglayout_field envoy_service_discovery_v3_DeltaDiscoveryRequest_InitialResourceVersionsEntry__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 9, 1},
-};
-
-const upb_msglayout envoy_service_discovery_v3_DeltaDiscoveryRequest_InitialResourceVersionsEntry_msginit = {
- NULL,
- &envoy_service_discovery_v3_DeltaDiscoveryRequest_InitialResourceVersionsEntry__fields[0],
- UPB_SIZE(16, 32), 2, false,
-};
-
-static const upb_msglayout *const envoy_service_discovery_v3_DeltaDiscoveryResponse_submsgs[2] = {
- &envoy_service_discovery_v3_Resource_msginit,
- &udpa_core_v1_ResourceName_msginit,
-};
-
-static const upb_msglayout_field envoy_service_discovery_v3_DeltaDiscoveryResponse__fields[6] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(24, 48), 0, 0, 11, 3},
- {4, UPB_SIZE(8, 16), 0, 0, 9, 1},
- {5, UPB_SIZE(16, 32), 0, 0, 9, 1},
- {6, UPB_SIZE(28, 56), 0, 0, 9, 3},
- {7, UPB_SIZE(32, 64), 0, 1, 11, 3},
-};
-
-const upb_msglayout envoy_service_discovery_v3_DeltaDiscoveryResponse_msginit = {
- &envoy_service_discovery_v3_DeltaDiscoveryResponse_submsgs[0],
- &envoy_service_discovery_v3_DeltaDiscoveryResponse__fields[0],
- UPB_SIZE(40, 80), 6, false,
-};
-
-static const upb_msglayout *const envoy_service_discovery_v3_Resource_submsgs[2] = {
- &google_protobuf_Any_msginit,
- &udpa_core_v1_ResourceName_msginit,
-};
-
-static const upb_msglayout_field envoy_service_discovery_v3_Resource__fields[5] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(16, 32), 0, 0, 11, 1},
- {3, UPB_SIZE(8, 16), 0, 0, 9, 1},
- {4, UPB_SIZE(24, 48), 0, 0, 9, 3},
- {5, UPB_SIZE(20, 40), 0, 1, 11, 1},
-};
-
-const upb_msglayout envoy_service_discovery_v3_Resource_msginit = {
- &envoy_service_discovery_v3_Resource_submsgs[0],
- &envoy_service_discovery_v3_Resource__fields[0],
- UPB_SIZE(32, 64), 5, false,
-};
-
-#include "upb/port_undef.inc"
-
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/service/discovery/v3/discovery.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg.h"
+#include "envoy/service/discovery/v3/discovery.upb.h"
+#include "envoy/config/core/v3/base.upb.h"
+#include "google/protobuf/any.upb.h"
+#include "google/rpc/status.upb.h"
+#include "udpa/core/v1/resource_locator.upb.h"
+#include "udpa/core/v1/resource_name.upb.h"
+#include "udpa/annotations/migrate.upb.h"
+#include "udpa/annotations/status.upb.h"
+#include "udpa/annotations/versioning.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_msglayout *const envoy_service_discovery_v3_DiscoveryRequest_submsgs[2] = {
+ &envoy_config_core_v3_Node_msginit,
+ &google_rpc_Status_msginit,
+};
+
+static const upb_msglayout_field envoy_service_discovery_v3_DiscoveryRequest__fields[6] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {2, UPB_SIZE(24, 48), 0, 0, 11, 1},
+ {3, UPB_SIZE(32, 64), 0, 0, 9, 3},
+ {4, UPB_SIZE(8, 16), 0, 0, 9, 1},
+ {5, UPB_SIZE(16, 32), 0, 0, 9, 1},
+ {6, UPB_SIZE(28, 56), 0, 1, 11, 1},
+};
+
+const upb_msglayout envoy_service_discovery_v3_DiscoveryRequest_msginit = {
+ &envoy_service_discovery_v3_DiscoveryRequest_submsgs[0],
+ &envoy_service_discovery_v3_DiscoveryRequest__fields[0],
+ UPB_SIZE(40, 80), 6, false,
+};
+
+static const upb_msglayout *const envoy_service_discovery_v3_DiscoveryResponse_submsgs[2] = {
+ &envoy_config_core_v3_ControlPlane_msginit,
+ &google_protobuf_Any_msginit,
+};
+
+static const upb_msglayout_field envoy_service_discovery_v3_DiscoveryResponse__fields[6] = {
+ {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
+ {2, UPB_SIZE(32, 64), 0, 1, 11, 3},
+ {3, UPB_SIZE(0, 0), 0, 0, 8, 1},
+ {4, UPB_SIZE(12, 24), 0, 0, 9, 1},
+ {5, UPB_SIZE(20, 40), 0, 0, 9, 1},
+ {6, UPB_SIZE(28, 56), 0, 0, 11, 1},
+};
+
+const upb_msglayout envoy_service_discovery_v3_DiscoveryResponse_msginit = {
+ &envoy_service_discovery_v3_DiscoveryResponse_submsgs[0],
+ &envoy_service_discovery_v3_DiscoveryResponse__fields[0],
+ UPB_SIZE(40, 80), 6, false,
+};
+
+static const upb_msglayout *const envoy_service_discovery_v3_DeltaDiscoveryRequest_submsgs[5] = {
+ &envoy_config_core_v3_Node_msginit,
+ &envoy_service_discovery_v3_DeltaDiscoveryRequest_InitialResourceVersionsEntry_msginit,
+ &google_rpc_Status_msginit,
+ &udpa_core_v1_ResourceLocator_msginit,
+};
+
+static const upb_msglayout_field envoy_service_discovery_v3_DeltaDiscoveryRequest__fields[9] = {
+ {1, UPB_SIZE(16, 32), 0, 0, 11, 1},
+ {2, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {3, UPB_SIZE(24, 48), 0, 0, 9, 3},
+ {4, UPB_SIZE(28, 56), 0, 0, 9, 3},
+ {5, UPB_SIZE(32, 64), 0, 1, 11, _UPB_LABEL_MAP},
+ {6, UPB_SIZE(8, 16), 0, 0, 9, 1},
+ {7, UPB_SIZE(20, 40), 0, 2, 11, 1},
+ {8, UPB_SIZE(36, 72), 0, 3, 11, 3},
+ {9, UPB_SIZE(40, 80), 0, 3, 11, 3},
+};
+
+const upb_msglayout envoy_service_discovery_v3_DeltaDiscoveryRequest_msginit = {
+ &envoy_service_discovery_v3_DeltaDiscoveryRequest_submsgs[0],
+ &envoy_service_discovery_v3_DeltaDiscoveryRequest__fields[0],
+ UPB_SIZE(48, 96), 9, false,
+};
+
+static const upb_msglayout_field envoy_service_discovery_v3_DeltaDiscoveryRequest_InitialResourceVersionsEntry__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {2, UPB_SIZE(8, 16), 0, 0, 9, 1},
+};
+
+const upb_msglayout envoy_service_discovery_v3_DeltaDiscoveryRequest_InitialResourceVersionsEntry_msginit = {
+ NULL,
+ &envoy_service_discovery_v3_DeltaDiscoveryRequest_InitialResourceVersionsEntry__fields[0],
+ UPB_SIZE(16, 32), 2, false,
+};
+
+static const upb_msglayout *const envoy_service_discovery_v3_DeltaDiscoveryResponse_submsgs[2] = {
+ &envoy_service_discovery_v3_Resource_msginit,
+ &udpa_core_v1_ResourceName_msginit,
+};
+
+static const upb_msglayout_field envoy_service_discovery_v3_DeltaDiscoveryResponse__fields[6] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {2, UPB_SIZE(24, 48), 0, 0, 11, 3},
+ {4, UPB_SIZE(8, 16), 0, 0, 9, 1},
+ {5, UPB_SIZE(16, 32), 0, 0, 9, 1},
+ {6, UPB_SIZE(28, 56), 0, 0, 9, 3},
+ {7, UPB_SIZE(32, 64), 0, 1, 11, 3},
+};
+
+const upb_msglayout envoy_service_discovery_v3_DeltaDiscoveryResponse_msginit = {
+ &envoy_service_discovery_v3_DeltaDiscoveryResponse_submsgs[0],
+ &envoy_service_discovery_v3_DeltaDiscoveryResponse__fields[0],
+ UPB_SIZE(40, 80), 6, false,
+};
+
+static const upb_msglayout *const envoy_service_discovery_v3_Resource_submsgs[2] = {
+ &google_protobuf_Any_msginit,
+ &udpa_core_v1_ResourceName_msginit,
+};
+
+static const upb_msglayout_field envoy_service_discovery_v3_Resource__fields[5] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {2, UPB_SIZE(16, 32), 0, 0, 11, 1},
+ {3, UPB_SIZE(8, 16), 0, 0, 9, 1},
+ {4, UPB_SIZE(24, 48), 0, 0, 9, 3},
+ {5, UPB_SIZE(20, 40), 0, 1, 11, 1},
+};
+
+const upb_msglayout envoy_service_discovery_v3_Resource_msginit = {
+ &envoy_service_discovery_v3_Resource_submsgs[0],
+ &envoy_service_discovery_v3_Resource__fields[0],
+ UPB_SIZE(32, 64), 5, false,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.h
index 02ef84a2b7b..87af22db378 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.h
@@ -1,449 +1,449 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/service/discovery/v3/discovery.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef ENVOY_SERVICE_DISCOVERY_V3_DISCOVERY_PROTO_UPB_H_
-#define ENVOY_SERVICE_DISCOVERY_V3_DISCOVERY_PROTO_UPB_H_
-
-#include "upb/msg.h"
-#include "upb/decode.h"
-#include "upb/encode.h"
-
-#include "upb/port_def.inc"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct envoy_service_discovery_v3_DiscoveryRequest;
-struct envoy_service_discovery_v3_DiscoveryResponse;
-struct envoy_service_discovery_v3_DeltaDiscoveryRequest;
-struct envoy_service_discovery_v3_DeltaDiscoveryRequest_InitialResourceVersionsEntry;
-struct envoy_service_discovery_v3_DeltaDiscoveryResponse;
-struct envoy_service_discovery_v3_Resource;
-typedef struct envoy_service_discovery_v3_DiscoveryRequest envoy_service_discovery_v3_DiscoveryRequest;
-typedef struct envoy_service_discovery_v3_DiscoveryResponse envoy_service_discovery_v3_DiscoveryResponse;
-typedef struct envoy_service_discovery_v3_DeltaDiscoveryRequest envoy_service_discovery_v3_DeltaDiscoveryRequest;
-typedef struct envoy_service_discovery_v3_DeltaDiscoveryRequest_InitialResourceVersionsEntry envoy_service_discovery_v3_DeltaDiscoveryRequest_InitialResourceVersionsEntry;
-typedef struct envoy_service_discovery_v3_DeltaDiscoveryResponse envoy_service_discovery_v3_DeltaDiscoveryResponse;
-typedef struct envoy_service_discovery_v3_Resource envoy_service_discovery_v3_Resource;
-extern const upb_msglayout envoy_service_discovery_v3_DiscoveryRequest_msginit;
-extern const upb_msglayout envoy_service_discovery_v3_DiscoveryResponse_msginit;
-extern const upb_msglayout envoy_service_discovery_v3_DeltaDiscoveryRequest_msginit;
-extern const upb_msglayout envoy_service_discovery_v3_DeltaDiscoveryRequest_InitialResourceVersionsEntry_msginit;
-extern const upb_msglayout envoy_service_discovery_v3_DeltaDiscoveryResponse_msginit;
-extern const upb_msglayout envoy_service_discovery_v3_Resource_msginit;
-struct envoy_config_core_v3_ControlPlane;
-struct envoy_config_core_v3_Node;
-struct google_protobuf_Any;
-struct google_rpc_Status;
-struct udpa_core_v1_ResourceLocator;
-struct udpa_core_v1_ResourceName;
-extern const upb_msglayout envoy_config_core_v3_ControlPlane_msginit;
-extern const upb_msglayout envoy_config_core_v3_Node_msginit;
-extern const upb_msglayout google_protobuf_Any_msginit;
-extern const upb_msglayout google_rpc_Status_msginit;
-extern const upb_msglayout udpa_core_v1_ResourceLocator_msginit;
-extern const upb_msglayout udpa_core_v1_ResourceName_msginit;
-
-
-/* envoy.service.discovery.v3.DiscoveryRequest */
-
-UPB_INLINE envoy_service_discovery_v3_DiscoveryRequest *envoy_service_discovery_v3_DiscoveryRequest_new(upb_arena *arena) {
- return (envoy_service_discovery_v3_DiscoveryRequest *)_upb_msg_new(&envoy_service_discovery_v3_DiscoveryRequest_msginit, arena);
-}
-UPB_INLINE envoy_service_discovery_v3_DiscoveryRequest *envoy_service_discovery_v3_DiscoveryRequest_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_service_discovery_v3_DiscoveryRequest *ret = envoy_service_discovery_v3_DiscoveryRequest_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_service_discovery_v3_DiscoveryRequest_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_service_discovery_v3_DiscoveryRequest_serialize(const envoy_service_discovery_v3_DiscoveryRequest *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_service_discovery_v3_DiscoveryRequest_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview envoy_service_discovery_v3_DiscoveryRequest_version_info(const envoy_service_discovery_v3_DiscoveryRequest *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE bool envoy_service_discovery_v3_DiscoveryRequest_has_node(const envoy_service_discovery_v3_DiscoveryRequest *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 48)); }
-UPB_INLINE const struct envoy_config_core_v3_Node* envoy_service_discovery_v3_DiscoveryRequest_node(const envoy_service_discovery_v3_DiscoveryRequest *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 48), const struct envoy_config_core_v3_Node*); }
-UPB_INLINE upb_strview const* envoy_service_discovery_v3_DiscoveryRequest_resource_names(const envoy_service_discovery_v3_DiscoveryRequest *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(32, 64), len); }
-UPB_INLINE upb_strview envoy_service_discovery_v3_DiscoveryRequest_type_url(const envoy_service_discovery_v3_DiscoveryRequest *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview); }
-UPB_INLINE upb_strview envoy_service_discovery_v3_DiscoveryRequest_response_nonce(const envoy_service_discovery_v3_DiscoveryRequest *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_strview); }
-UPB_INLINE bool envoy_service_discovery_v3_DiscoveryRequest_has_error_detail(const envoy_service_discovery_v3_DiscoveryRequest *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 56)); }
-UPB_INLINE const struct google_rpc_Status* envoy_service_discovery_v3_DiscoveryRequest_error_detail(const envoy_service_discovery_v3_DiscoveryRequest *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 56), const struct google_rpc_Status*); }
-
-UPB_INLINE void envoy_service_discovery_v3_DiscoveryRequest_set_version_info(envoy_service_discovery_v3_DiscoveryRequest *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-UPB_INLINE void envoy_service_discovery_v3_DiscoveryRequest_set_node(envoy_service_discovery_v3_DiscoveryRequest *msg, struct envoy_config_core_v3_Node* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(24, 48), struct envoy_config_core_v3_Node*) = value;
-}
-UPB_INLINE struct envoy_config_core_v3_Node* envoy_service_discovery_v3_DiscoveryRequest_mutable_node(envoy_service_discovery_v3_DiscoveryRequest *msg, upb_arena *arena) {
- struct envoy_config_core_v3_Node* sub = (struct envoy_config_core_v3_Node*)envoy_service_discovery_v3_DiscoveryRequest_node(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_Node*)_upb_msg_new(&envoy_config_core_v3_Node_msginit, arena);
- if (!sub) return NULL;
- envoy_service_discovery_v3_DiscoveryRequest_set_node(msg, sub);
- }
- return sub;
-}
-UPB_INLINE upb_strview* envoy_service_discovery_v3_DiscoveryRequest_mutable_resource_names(envoy_service_discovery_v3_DiscoveryRequest *msg, size_t *len) {
- return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(32, 64), len);
-}
-UPB_INLINE upb_strview* envoy_service_discovery_v3_DiscoveryRequest_resize_resource_names(envoy_service_discovery_v3_DiscoveryRequest *msg, size_t len, upb_arena *arena) {
- return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(32, 64), len, UPB_TYPE_STRING, arena);
-}
-UPB_INLINE bool envoy_service_discovery_v3_DiscoveryRequest_add_resource_names(envoy_service_discovery_v3_DiscoveryRequest *msg, upb_strview val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(32, 64), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
- arena);
-}
-UPB_INLINE void envoy_service_discovery_v3_DiscoveryRequest_set_type_url(envoy_service_discovery_v3_DiscoveryRequest *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview) = value;
-}
-UPB_INLINE void envoy_service_discovery_v3_DiscoveryRequest_set_response_nonce(envoy_service_discovery_v3_DiscoveryRequest *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_strview) = value;
-}
-UPB_INLINE void envoy_service_discovery_v3_DiscoveryRequest_set_error_detail(envoy_service_discovery_v3_DiscoveryRequest *msg, struct google_rpc_Status* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(28, 56), struct google_rpc_Status*) = value;
-}
-UPB_INLINE struct google_rpc_Status* envoy_service_discovery_v3_DiscoveryRequest_mutable_error_detail(envoy_service_discovery_v3_DiscoveryRequest *msg, upb_arena *arena) {
- struct google_rpc_Status* sub = (struct google_rpc_Status*)envoy_service_discovery_v3_DiscoveryRequest_error_detail(msg);
- if (sub == NULL) {
- sub = (struct google_rpc_Status*)_upb_msg_new(&google_rpc_Status_msginit, arena);
- if (!sub) return NULL;
- envoy_service_discovery_v3_DiscoveryRequest_set_error_detail(msg, sub);
- }
- return sub;
-}
-
-/* envoy.service.discovery.v3.DiscoveryResponse */
-
-UPB_INLINE envoy_service_discovery_v3_DiscoveryResponse *envoy_service_discovery_v3_DiscoveryResponse_new(upb_arena *arena) {
- return (envoy_service_discovery_v3_DiscoveryResponse *)_upb_msg_new(&envoy_service_discovery_v3_DiscoveryResponse_msginit, arena);
-}
-UPB_INLINE envoy_service_discovery_v3_DiscoveryResponse *envoy_service_discovery_v3_DiscoveryResponse_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_service_discovery_v3_DiscoveryResponse *ret = envoy_service_discovery_v3_DiscoveryResponse_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_service_discovery_v3_DiscoveryResponse_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_service_discovery_v3_DiscoveryResponse_serialize(const envoy_service_discovery_v3_DiscoveryResponse *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_service_discovery_v3_DiscoveryResponse_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview envoy_service_discovery_v3_DiscoveryResponse_version_info(const envoy_service_discovery_v3_DiscoveryResponse *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
-UPB_INLINE bool envoy_service_discovery_v3_DiscoveryResponse_has_resources(const envoy_service_discovery_v3_DiscoveryResponse *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(32, 64)); }
-UPB_INLINE const struct google_protobuf_Any* const* envoy_service_discovery_v3_DiscoveryResponse_resources(const envoy_service_discovery_v3_DiscoveryResponse *msg, size_t *len) { return (const struct google_protobuf_Any* const*)_upb_array_accessor(msg, UPB_SIZE(32, 64), len); }
-UPB_INLINE bool envoy_service_discovery_v3_DiscoveryResponse_canary(const envoy_service_discovery_v3_DiscoveryResponse *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); }
-UPB_INLINE upb_strview envoy_service_discovery_v3_DiscoveryResponse_type_url(const envoy_service_discovery_v3_DiscoveryResponse *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview); }
-UPB_INLINE upb_strview envoy_service_discovery_v3_DiscoveryResponse_nonce(const envoy_service_discovery_v3_DiscoveryResponse *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_strview); }
-UPB_INLINE bool envoy_service_discovery_v3_DiscoveryResponse_has_control_plane(const envoy_service_discovery_v3_DiscoveryResponse *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 56)); }
-UPB_INLINE const struct envoy_config_core_v3_ControlPlane* envoy_service_discovery_v3_DiscoveryResponse_control_plane(const envoy_service_discovery_v3_DiscoveryResponse *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 56), const struct envoy_config_core_v3_ControlPlane*); }
-
-UPB_INLINE void envoy_service_discovery_v3_DiscoveryResponse_set_version_info(envoy_service_discovery_v3_DiscoveryResponse *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
-}
-UPB_INLINE struct google_protobuf_Any** envoy_service_discovery_v3_DiscoveryResponse_mutable_resources(envoy_service_discovery_v3_DiscoveryResponse *msg, size_t *len) {
- return (struct google_protobuf_Any**)_upb_array_mutable_accessor(msg, UPB_SIZE(32, 64), len);
-}
-UPB_INLINE struct google_protobuf_Any** envoy_service_discovery_v3_DiscoveryResponse_resize_resources(envoy_service_discovery_v3_DiscoveryResponse *msg, size_t len, upb_arena *arena) {
- return (struct google_protobuf_Any**)_upb_array_resize_accessor(msg, UPB_SIZE(32, 64), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct google_protobuf_Any* envoy_service_discovery_v3_DiscoveryResponse_add_resources(envoy_service_discovery_v3_DiscoveryResponse *msg, upb_arena *arena) {
- struct google_protobuf_Any* sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(32, 64), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-UPB_INLINE void envoy_service_discovery_v3_DiscoveryResponse_set_canary(envoy_service_discovery_v3_DiscoveryResponse *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
-}
-UPB_INLINE void envoy_service_discovery_v3_DiscoveryResponse_set_type_url(envoy_service_discovery_v3_DiscoveryResponse *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview) = value;
-}
-UPB_INLINE void envoy_service_discovery_v3_DiscoveryResponse_set_nonce(envoy_service_discovery_v3_DiscoveryResponse *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_strview) = value;
-}
-UPB_INLINE void envoy_service_discovery_v3_DiscoveryResponse_set_control_plane(envoy_service_discovery_v3_DiscoveryResponse *msg, struct envoy_config_core_v3_ControlPlane* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(28, 56), struct envoy_config_core_v3_ControlPlane*) = value;
-}
-UPB_INLINE struct envoy_config_core_v3_ControlPlane* envoy_service_discovery_v3_DiscoveryResponse_mutable_control_plane(envoy_service_discovery_v3_DiscoveryResponse *msg, upb_arena *arena) {
- struct envoy_config_core_v3_ControlPlane* sub = (struct envoy_config_core_v3_ControlPlane*)envoy_service_discovery_v3_DiscoveryResponse_control_plane(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_ControlPlane*)_upb_msg_new(&envoy_config_core_v3_ControlPlane_msginit, arena);
- if (!sub) return NULL;
- envoy_service_discovery_v3_DiscoveryResponse_set_control_plane(msg, sub);
- }
- return sub;
-}
-
-/* envoy.service.discovery.v3.DeltaDiscoveryRequest */
-
-UPB_INLINE envoy_service_discovery_v3_DeltaDiscoveryRequest *envoy_service_discovery_v3_DeltaDiscoveryRequest_new(upb_arena *arena) {
- return (envoy_service_discovery_v3_DeltaDiscoveryRequest *)_upb_msg_new(&envoy_service_discovery_v3_DeltaDiscoveryRequest_msginit, arena);
-}
-UPB_INLINE envoy_service_discovery_v3_DeltaDiscoveryRequest *envoy_service_discovery_v3_DeltaDiscoveryRequest_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_service_discovery_v3_DeltaDiscoveryRequest *ret = envoy_service_discovery_v3_DeltaDiscoveryRequest_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_service_discovery_v3_DeltaDiscoveryRequest_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_service_discovery_v3_DeltaDiscoveryRequest_serialize(const envoy_service_discovery_v3_DeltaDiscoveryRequest *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_service_discovery_v3_DeltaDiscoveryRequest_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_service_discovery_v3_DeltaDiscoveryRequest_has_node(const envoy_service_discovery_v3_DeltaDiscoveryRequest *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); }
-UPB_INLINE const struct envoy_config_core_v3_Node* envoy_service_discovery_v3_DeltaDiscoveryRequest_node(const envoy_service_discovery_v3_DeltaDiscoveryRequest *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const struct envoy_config_core_v3_Node*); }
-UPB_INLINE upb_strview envoy_service_discovery_v3_DeltaDiscoveryRequest_type_url(const envoy_service_discovery_v3_DeltaDiscoveryRequest *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE upb_strview const* envoy_service_discovery_v3_DeltaDiscoveryRequest_resource_names_subscribe(const envoy_service_discovery_v3_DeltaDiscoveryRequest *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(24, 48), len); }
-UPB_INLINE upb_strview const* envoy_service_discovery_v3_DeltaDiscoveryRequest_resource_names_unsubscribe(const envoy_service_discovery_v3_DeltaDiscoveryRequest *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(28, 56), len); }
-UPB_INLINE bool envoy_service_discovery_v3_DeltaDiscoveryRequest_has_initial_resource_versions(const envoy_service_discovery_v3_DeltaDiscoveryRequest *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(32, 64)); }
-UPB_INLINE size_t envoy_service_discovery_v3_DeltaDiscoveryRequest_initial_resource_versions_size(const envoy_service_discovery_v3_DeltaDiscoveryRequest *msg) {return _upb_msg_map_size(msg, UPB_SIZE(32, 64)); }
-UPB_INLINE bool envoy_service_discovery_v3_DeltaDiscoveryRequest_initial_resource_versions_get(const envoy_service_discovery_v3_DeltaDiscoveryRequest *msg, upb_strview key, upb_strview *val) { return _upb_msg_map_get(msg, UPB_SIZE(32, 64), &key, 0, val, 0); }
-UPB_INLINE const envoy_service_discovery_v3_DeltaDiscoveryRequest_InitialResourceVersionsEntry* envoy_service_discovery_v3_DeltaDiscoveryRequest_initial_resource_versions_next(const envoy_service_discovery_v3_DeltaDiscoveryRequest *msg, size_t* iter) { return (const envoy_service_discovery_v3_DeltaDiscoveryRequest_InitialResourceVersionsEntry*)_upb_msg_map_next(msg, UPB_SIZE(32, 64), iter); }
-UPB_INLINE upb_strview envoy_service_discovery_v3_DeltaDiscoveryRequest_response_nonce(const envoy_service_discovery_v3_DeltaDiscoveryRequest *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview); }
-UPB_INLINE bool envoy_service_discovery_v3_DeltaDiscoveryRequest_has_error_detail(const envoy_service_discovery_v3_DeltaDiscoveryRequest *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 40)); }
-UPB_INLINE const struct google_rpc_Status* envoy_service_discovery_v3_DeltaDiscoveryRequest_error_detail(const envoy_service_discovery_v3_DeltaDiscoveryRequest *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const struct google_rpc_Status*); }
-UPB_INLINE bool envoy_service_discovery_v3_DeltaDiscoveryRequest_has_udpa_resources_subscribe(const envoy_service_discovery_v3_DeltaDiscoveryRequest *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(36, 72)); }
-UPB_INLINE const struct udpa_core_v1_ResourceLocator* const* envoy_service_discovery_v3_DeltaDiscoveryRequest_udpa_resources_subscribe(const envoy_service_discovery_v3_DeltaDiscoveryRequest *msg, size_t *len) { return (const struct udpa_core_v1_ResourceLocator* const*)_upb_array_accessor(msg, UPB_SIZE(36, 72), len); }
-UPB_INLINE bool envoy_service_discovery_v3_DeltaDiscoveryRequest_has_udpa_resources_unsubscribe(const envoy_service_discovery_v3_DeltaDiscoveryRequest *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(40, 80)); }
-UPB_INLINE const struct udpa_core_v1_ResourceLocator* const* envoy_service_discovery_v3_DeltaDiscoveryRequest_udpa_resources_unsubscribe(const envoy_service_discovery_v3_DeltaDiscoveryRequest *msg, size_t *len) { return (const struct udpa_core_v1_ResourceLocator* const*)_upb_array_accessor(msg, UPB_SIZE(40, 80), len); }
-
-UPB_INLINE void envoy_service_discovery_v3_DeltaDiscoveryRequest_set_node(envoy_service_discovery_v3_DeltaDiscoveryRequest *msg, struct envoy_config_core_v3_Node* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(16, 32), struct envoy_config_core_v3_Node*) = value;
-}
-UPB_INLINE struct envoy_config_core_v3_Node* envoy_service_discovery_v3_DeltaDiscoveryRequest_mutable_node(envoy_service_discovery_v3_DeltaDiscoveryRequest *msg, upb_arena *arena) {
- struct envoy_config_core_v3_Node* sub = (struct envoy_config_core_v3_Node*)envoy_service_discovery_v3_DeltaDiscoveryRequest_node(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_Node*)_upb_msg_new(&envoy_config_core_v3_Node_msginit, arena);
- if (!sub) return NULL;
- envoy_service_discovery_v3_DeltaDiscoveryRequest_set_node(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_service_discovery_v3_DeltaDiscoveryRequest_set_type_url(envoy_service_discovery_v3_DeltaDiscoveryRequest *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-UPB_INLINE upb_strview* envoy_service_discovery_v3_DeltaDiscoveryRequest_mutable_resource_names_subscribe(envoy_service_discovery_v3_DeltaDiscoveryRequest *msg, size_t *len) {
- return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 48), len);
-}
-UPB_INLINE upb_strview* envoy_service_discovery_v3_DeltaDiscoveryRequest_resize_resource_names_subscribe(envoy_service_discovery_v3_DeltaDiscoveryRequest *msg, size_t len, upb_arena *arena) {
- return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(24, 48), len, UPB_TYPE_STRING, arena);
-}
-UPB_INLINE bool envoy_service_discovery_v3_DeltaDiscoveryRequest_add_resource_names_subscribe(envoy_service_discovery_v3_DeltaDiscoveryRequest *msg, upb_strview val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(24, 48), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
- arena);
-}
-UPB_INLINE upb_strview* envoy_service_discovery_v3_DeltaDiscoveryRequest_mutable_resource_names_unsubscribe(envoy_service_discovery_v3_DeltaDiscoveryRequest *msg, size_t *len) {
- return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 56), len);
-}
-UPB_INLINE upb_strview* envoy_service_discovery_v3_DeltaDiscoveryRequest_resize_resource_names_unsubscribe(envoy_service_discovery_v3_DeltaDiscoveryRequest *msg, size_t len, upb_arena *arena) {
- return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(28, 56), len, UPB_TYPE_STRING, arena);
-}
-UPB_INLINE bool envoy_service_discovery_v3_DeltaDiscoveryRequest_add_resource_names_unsubscribe(envoy_service_discovery_v3_DeltaDiscoveryRequest *msg, upb_strview val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(28, 56), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
- arena);
-}
-UPB_INLINE void envoy_service_discovery_v3_DeltaDiscoveryRequest_initial_resource_versions_clear(envoy_service_discovery_v3_DeltaDiscoveryRequest *msg) { _upb_msg_map_clear(msg, UPB_SIZE(32, 64)); }
-UPB_INLINE bool envoy_service_discovery_v3_DeltaDiscoveryRequest_initial_resource_versions_set(envoy_service_discovery_v3_DeltaDiscoveryRequest *msg, upb_strview key, upb_strview val, upb_arena *a) { return _upb_msg_map_set(msg, UPB_SIZE(32, 64), &key, 0, &val, 0, a); }
-UPB_INLINE bool envoy_service_discovery_v3_DeltaDiscoveryRequest_initial_resource_versions_delete(envoy_service_discovery_v3_DeltaDiscoveryRequest *msg, upb_strview key) { return _upb_msg_map_delete(msg, UPB_SIZE(32, 64), &key, 0); }
-UPB_INLINE envoy_service_discovery_v3_DeltaDiscoveryRequest_InitialResourceVersionsEntry* envoy_service_discovery_v3_DeltaDiscoveryRequest_initial_resource_versions_nextmutable(envoy_service_discovery_v3_DeltaDiscoveryRequest *msg, size_t* iter) { return (envoy_service_discovery_v3_DeltaDiscoveryRequest_InitialResourceVersionsEntry*)_upb_msg_map_next(msg, UPB_SIZE(32, 64), iter); }
-UPB_INLINE void envoy_service_discovery_v3_DeltaDiscoveryRequest_set_response_nonce(envoy_service_discovery_v3_DeltaDiscoveryRequest *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview) = value;
-}
-UPB_INLINE void envoy_service_discovery_v3_DeltaDiscoveryRequest_set_error_detail(envoy_service_discovery_v3_DeltaDiscoveryRequest *msg, struct google_rpc_Status* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(20, 40), struct google_rpc_Status*) = value;
-}
-UPB_INLINE struct google_rpc_Status* envoy_service_discovery_v3_DeltaDiscoveryRequest_mutable_error_detail(envoy_service_discovery_v3_DeltaDiscoveryRequest *msg, upb_arena *arena) {
- struct google_rpc_Status* sub = (struct google_rpc_Status*)envoy_service_discovery_v3_DeltaDiscoveryRequest_error_detail(msg);
- if (sub == NULL) {
- sub = (struct google_rpc_Status*)_upb_msg_new(&google_rpc_Status_msginit, arena);
- if (!sub) return NULL;
- envoy_service_discovery_v3_DeltaDiscoveryRequest_set_error_detail(msg, sub);
- }
- return sub;
-}
-UPB_INLINE struct udpa_core_v1_ResourceLocator** envoy_service_discovery_v3_DeltaDiscoveryRequest_mutable_udpa_resources_subscribe(envoy_service_discovery_v3_DeltaDiscoveryRequest *msg, size_t *len) {
- return (struct udpa_core_v1_ResourceLocator**)_upb_array_mutable_accessor(msg, UPB_SIZE(36, 72), len);
-}
-UPB_INLINE struct udpa_core_v1_ResourceLocator** envoy_service_discovery_v3_DeltaDiscoveryRequest_resize_udpa_resources_subscribe(envoy_service_discovery_v3_DeltaDiscoveryRequest *msg, size_t len, upb_arena *arena) {
- return (struct udpa_core_v1_ResourceLocator**)_upb_array_resize_accessor(msg, UPB_SIZE(36, 72), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct udpa_core_v1_ResourceLocator* envoy_service_discovery_v3_DeltaDiscoveryRequest_add_udpa_resources_subscribe(envoy_service_discovery_v3_DeltaDiscoveryRequest *msg, upb_arena *arena) {
- struct udpa_core_v1_ResourceLocator* sub = (struct udpa_core_v1_ResourceLocator*)_upb_msg_new(&udpa_core_v1_ResourceLocator_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(36, 72), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-UPB_INLINE struct udpa_core_v1_ResourceLocator** envoy_service_discovery_v3_DeltaDiscoveryRequest_mutable_udpa_resources_unsubscribe(envoy_service_discovery_v3_DeltaDiscoveryRequest *msg, size_t *len) {
- return (struct udpa_core_v1_ResourceLocator**)_upb_array_mutable_accessor(msg, UPB_SIZE(40, 80), len);
-}
-UPB_INLINE struct udpa_core_v1_ResourceLocator** envoy_service_discovery_v3_DeltaDiscoveryRequest_resize_udpa_resources_unsubscribe(envoy_service_discovery_v3_DeltaDiscoveryRequest *msg, size_t len, upb_arena *arena) {
- return (struct udpa_core_v1_ResourceLocator**)_upb_array_resize_accessor(msg, UPB_SIZE(40, 80), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct udpa_core_v1_ResourceLocator* envoy_service_discovery_v3_DeltaDiscoveryRequest_add_udpa_resources_unsubscribe(envoy_service_discovery_v3_DeltaDiscoveryRequest *msg, upb_arena *arena) {
- struct udpa_core_v1_ResourceLocator* sub = (struct udpa_core_v1_ResourceLocator*)_upb_msg_new(&udpa_core_v1_ResourceLocator_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(40, 80), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-
-/* envoy.service.discovery.v3.DeltaDiscoveryRequest.InitialResourceVersionsEntry */
-
-UPB_INLINE upb_strview envoy_service_discovery_v3_DeltaDiscoveryRequest_InitialResourceVersionsEntry_key(const envoy_service_discovery_v3_DeltaDiscoveryRequest_InitialResourceVersionsEntry *msg) {
- upb_strview ret;
- _upb_msg_map_key(msg, &ret, 0);
- return ret;
-}
-UPB_INLINE upb_strview envoy_service_discovery_v3_DeltaDiscoveryRequest_InitialResourceVersionsEntry_value(const envoy_service_discovery_v3_DeltaDiscoveryRequest_InitialResourceVersionsEntry *msg) {
- upb_strview ret;
- _upb_msg_map_value(msg, &ret, 0);
- return ret;
-}
-
-UPB_INLINE void envoy_service_discovery_v3_DeltaDiscoveryRequest_InitialResourceVersionsEntry_set_value(envoy_service_discovery_v3_DeltaDiscoveryRequest_InitialResourceVersionsEntry *msg, upb_strview value) {
- _upb_msg_map_set_value(msg, &value, 0);
-}
-
-/* envoy.service.discovery.v3.DeltaDiscoveryResponse */
-
-UPB_INLINE envoy_service_discovery_v3_DeltaDiscoveryResponse *envoy_service_discovery_v3_DeltaDiscoveryResponse_new(upb_arena *arena) {
- return (envoy_service_discovery_v3_DeltaDiscoveryResponse *)_upb_msg_new(&envoy_service_discovery_v3_DeltaDiscoveryResponse_msginit, arena);
-}
-UPB_INLINE envoy_service_discovery_v3_DeltaDiscoveryResponse *envoy_service_discovery_v3_DeltaDiscoveryResponse_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_service_discovery_v3_DeltaDiscoveryResponse *ret = envoy_service_discovery_v3_DeltaDiscoveryResponse_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_service_discovery_v3_DeltaDiscoveryResponse_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_service_discovery_v3_DeltaDiscoveryResponse_serialize(const envoy_service_discovery_v3_DeltaDiscoveryResponse *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_service_discovery_v3_DeltaDiscoveryResponse_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview envoy_service_discovery_v3_DeltaDiscoveryResponse_system_version_info(const envoy_service_discovery_v3_DeltaDiscoveryResponse *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE bool envoy_service_discovery_v3_DeltaDiscoveryResponse_has_resources(const envoy_service_discovery_v3_DeltaDiscoveryResponse *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 48)); }
-UPB_INLINE const envoy_service_discovery_v3_Resource* const* envoy_service_discovery_v3_DeltaDiscoveryResponse_resources(const envoy_service_discovery_v3_DeltaDiscoveryResponse *msg, size_t *len) { return (const envoy_service_discovery_v3_Resource* const*)_upb_array_accessor(msg, UPB_SIZE(24, 48), len); }
-UPB_INLINE upb_strview envoy_service_discovery_v3_DeltaDiscoveryResponse_type_url(const envoy_service_discovery_v3_DeltaDiscoveryResponse *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview); }
-UPB_INLINE upb_strview envoy_service_discovery_v3_DeltaDiscoveryResponse_nonce(const envoy_service_discovery_v3_DeltaDiscoveryResponse *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_strview); }
-UPB_INLINE upb_strview const* envoy_service_discovery_v3_DeltaDiscoveryResponse_removed_resources(const envoy_service_discovery_v3_DeltaDiscoveryResponse *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(28, 56), len); }
-UPB_INLINE bool envoy_service_discovery_v3_DeltaDiscoveryResponse_has_udpa_removed_resources(const envoy_service_discovery_v3_DeltaDiscoveryResponse *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(32, 64)); }
-UPB_INLINE const struct udpa_core_v1_ResourceName* const* envoy_service_discovery_v3_DeltaDiscoveryResponse_udpa_removed_resources(const envoy_service_discovery_v3_DeltaDiscoveryResponse *msg, size_t *len) { return (const struct udpa_core_v1_ResourceName* const*)_upb_array_accessor(msg, UPB_SIZE(32, 64), len); }
-
-UPB_INLINE void envoy_service_discovery_v3_DeltaDiscoveryResponse_set_system_version_info(envoy_service_discovery_v3_DeltaDiscoveryResponse *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-UPB_INLINE envoy_service_discovery_v3_Resource** envoy_service_discovery_v3_DeltaDiscoveryResponse_mutable_resources(envoy_service_discovery_v3_DeltaDiscoveryResponse *msg, size_t *len) {
- return (envoy_service_discovery_v3_Resource**)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 48), len);
-}
-UPB_INLINE envoy_service_discovery_v3_Resource** envoy_service_discovery_v3_DeltaDiscoveryResponse_resize_resources(envoy_service_discovery_v3_DeltaDiscoveryResponse *msg, size_t len, upb_arena *arena) {
- return (envoy_service_discovery_v3_Resource**)_upb_array_resize_accessor(msg, UPB_SIZE(24, 48), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_service_discovery_v3_Resource* envoy_service_discovery_v3_DeltaDiscoveryResponse_add_resources(envoy_service_discovery_v3_DeltaDiscoveryResponse *msg, upb_arena *arena) {
- struct envoy_service_discovery_v3_Resource* sub = (struct envoy_service_discovery_v3_Resource*)_upb_msg_new(&envoy_service_discovery_v3_Resource_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(24, 48), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-UPB_INLINE void envoy_service_discovery_v3_DeltaDiscoveryResponse_set_type_url(envoy_service_discovery_v3_DeltaDiscoveryResponse *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview) = value;
-}
-UPB_INLINE void envoy_service_discovery_v3_DeltaDiscoveryResponse_set_nonce(envoy_service_discovery_v3_DeltaDiscoveryResponse *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_strview) = value;
-}
-UPB_INLINE upb_strview* envoy_service_discovery_v3_DeltaDiscoveryResponse_mutable_removed_resources(envoy_service_discovery_v3_DeltaDiscoveryResponse *msg, size_t *len) {
- return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 56), len);
-}
-UPB_INLINE upb_strview* envoy_service_discovery_v3_DeltaDiscoveryResponse_resize_removed_resources(envoy_service_discovery_v3_DeltaDiscoveryResponse *msg, size_t len, upb_arena *arena) {
- return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(28, 56), len, UPB_TYPE_STRING, arena);
-}
-UPB_INLINE bool envoy_service_discovery_v3_DeltaDiscoveryResponse_add_removed_resources(envoy_service_discovery_v3_DeltaDiscoveryResponse *msg, upb_strview val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(28, 56), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
- arena);
-}
-UPB_INLINE struct udpa_core_v1_ResourceName** envoy_service_discovery_v3_DeltaDiscoveryResponse_mutable_udpa_removed_resources(envoy_service_discovery_v3_DeltaDiscoveryResponse *msg, size_t *len) {
- return (struct udpa_core_v1_ResourceName**)_upb_array_mutable_accessor(msg, UPB_SIZE(32, 64), len);
-}
-UPB_INLINE struct udpa_core_v1_ResourceName** envoy_service_discovery_v3_DeltaDiscoveryResponse_resize_udpa_removed_resources(envoy_service_discovery_v3_DeltaDiscoveryResponse *msg, size_t len, upb_arena *arena) {
- return (struct udpa_core_v1_ResourceName**)_upb_array_resize_accessor(msg, UPB_SIZE(32, 64), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct udpa_core_v1_ResourceName* envoy_service_discovery_v3_DeltaDiscoveryResponse_add_udpa_removed_resources(envoy_service_discovery_v3_DeltaDiscoveryResponse *msg, upb_arena *arena) {
- struct udpa_core_v1_ResourceName* sub = (struct udpa_core_v1_ResourceName*)_upb_msg_new(&udpa_core_v1_ResourceName_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(32, 64), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-
-/* envoy.service.discovery.v3.Resource */
-
-UPB_INLINE envoy_service_discovery_v3_Resource *envoy_service_discovery_v3_Resource_new(upb_arena *arena) {
- return (envoy_service_discovery_v3_Resource *)_upb_msg_new(&envoy_service_discovery_v3_Resource_msginit, arena);
-}
-UPB_INLINE envoy_service_discovery_v3_Resource *envoy_service_discovery_v3_Resource_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_service_discovery_v3_Resource *ret = envoy_service_discovery_v3_Resource_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_service_discovery_v3_Resource_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_service_discovery_v3_Resource_serialize(const envoy_service_discovery_v3_Resource *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_service_discovery_v3_Resource_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview envoy_service_discovery_v3_Resource_version(const envoy_service_discovery_v3_Resource *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE bool envoy_service_discovery_v3_Resource_has_resource(const envoy_service_discovery_v3_Resource *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); }
-UPB_INLINE const struct google_protobuf_Any* envoy_service_discovery_v3_Resource_resource(const envoy_service_discovery_v3_Resource *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const struct google_protobuf_Any*); }
-UPB_INLINE upb_strview envoy_service_discovery_v3_Resource_name(const envoy_service_discovery_v3_Resource *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview); }
-UPB_INLINE upb_strview const* envoy_service_discovery_v3_Resource_aliases(const envoy_service_discovery_v3_Resource *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(24, 48), len); }
-UPB_INLINE bool envoy_service_discovery_v3_Resource_has_udpa_resource_name(const envoy_service_discovery_v3_Resource *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 40)); }
-UPB_INLINE const struct udpa_core_v1_ResourceName* envoy_service_discovery_v3_Resource_udpa_resource_name(const envoy_service_discovery_v3_Resource *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const struct udpa_core_v1_ResourceName*); }
-
-UPB_INLINE void envoy_service_discovery_v3_Resource_set_version(envoy_service_discovery_v3_Resource *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-UPB_INLINE void envoy_service_discovery_v3_Resource_set_resource(envoy_service_discovery_v3_Resource *msg, struct google_protobuf_Any* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(16, 32), struct google_protobuf_Any*) = value;
-}
-UPB_INLINE struct google_protobuf_Any* envoy_service_discovery_v3_Resource_mutable_resource(envoy_service_discovery_v3_Resource *msg, upb_arena *arena) {
- struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_service_discovery_v3_Resource_resource(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena);
- if (!sub) return NULL;
- envoy_service_discovery_v3_Resource_set_resource(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_service_discovery_v3_Resource_set_name(envoy_service_discovery_v3_Resource *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview) = value;
-}
-UPB_INLINE upb_strview* envoy_service_discovery_v3_Resource_mutable_aliases(envoy_service_discovery_v3_Resource *msg, size_t *len) {
- return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 48), len);
-}
-UPB_INLINE upb_strview* envoy_service_discovery_v3_Resource_resize_aliases(envoy_service_discovery_v3_Resource *msg, size_t len, upb_arena *arena) {
- return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(24, 48), len, UPB_TYPE_STRING, arena);
-}
-UPB_INLINE bool envoy_service_discovery_v3_Resource_add_aliases(envoy_service_discovery_v3_Resource *msg, upb_strview val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(24, 48), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
- arena);
-}
-UPB_INLINE void envoy_service_discovery_v3_Resource_set_udpa_resource_name(envoy_service_discovery_v3_Resource *msg, struct udpa_core_v1_ResourceName* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(20, 40), struct udpa_core_v1_ResourceName*) = value;
-}
-UPB_INLINE struct udpa_core_v1_ResourceName* envoy_service_discovery_v3_Resource_mutable_udpa_resource_name(envoy_service_discovery_v3_Resource *msg, upb_arena *arena) {
- struct udpa_core_v1_ResourceName* sub = (struct udpa_core_v1_ResourceName*)envoy_service_discovery_v3_Resource_udpa_resource_name(msg);
- if (sub == NULL) {
- sub = (struct udpa_core_v1_ResourceName*)_upb_msg_new(&udpa_core_v1_ResourceName_msginit, arena);
- if (!sub) return NULL;
- envoy_service_discovery_v3_Resource_set_udpa_resource_name(msg, sub);
- }
- return sub;
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* ENVOY_SERVICE_DISCOVERY_V3_DISCOVERY_PROTO_UPB_H_ */
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/service/discovery/v3/discovery.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_SERVICE_DISCOVERY_V3_DISCOVERY_PROTO_UPB_H_
+#define ENVOY_SERVICE_DISCOVERY_V3_DISCOVERY_PROTO_UPB_H_
+
+#include "upb/msg.h"
+#include "upb/decode.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_service_discovery_v3_DiscoveryRequest;
+struct envoy_service_discovery_v3_DiscoveryResponse;
+struct envoy_service_discovery_v3_DeltaDiscoveryRequest;
+struct envoy_service_discovery_v3_DeltaDiscoveryRequest_InitialResourceVersionsEntry;
+struct envoy_service_discovery_v3_DeltaDiscoveryResponse;
+struct envoy_service_discovery_v3_Resource;
+typedef struct envoy_service_discovery_v3_DiscoveryRequest envoy_service_discovery_v3_DiscoveryRequest;
+typedef struct envoy_service_discovery_v3_DiscoveryResponse envoy_service_discovery_v3_DiscoveryResponse;
+typedef struct envoy_service_discovery_v3_DeltaDiscoveryRequest envoy_service_discovery_v3_DeltaDiscoveryRequest;
+typedef struct envoy_service_discovery_v3_DeltaDiscoveryRequest_InitialResourceVersionsEntry envoy_service_discovery_v3_DeltaDiscoveryRequest_InitialResourceVersionsEntry;
+typedef struct envoy_service_discovery_v3_DeltaDiscoveryResponse envoy_service_discovery_v3_DeltaDiscoveryResponse;
+typedef struct envoy_service_discovery_v3_Resource envoy_service_discovery_v3_Resource;
+extern const upb_msglayout envoy_service_discovery_v3_DiscoveryRequest_msginit;
+extern const upb_msglayout envoy_service_discovery_v3_DiscoveryResponse_msginit;
+extern const upb_msglayout envoy_service_discovery_v3_DeltaDiscoveryRequest_msginit;
+extern const upb_msglayout envoy_service_discovery_v3_DeltaDiscoveryRequest_InitialResourceVersionsEntry_msginit;
+extern const upb_msglayout envoy_service_discovery_v3_DeltaDiscoveryResponse_msginit;
+extern const upb_msglayout envoy_service_discovery_v3_Resource_msginit;
+struct envoy_config_core_v3_ControlPlane;
+struct envoy_config_core_v3_Node;
+struct google_protobuf_Any;
+struct google_rpc_Status;
+struct udpa_core_v1_ResourceLocator;
+struct udpa_core_v1_ResourceName;
+extern const upb_msglayout envoy_config_core_v3_ControlPlane_msginit;
+extern const upb_msglayout envoy_config_core_v3_Node_msginit;
+extern const upb_msglayout google_protobuf_Any_msginit;
+extern const upb_msglayout google_rpc_Status_msginit;
+extern const upb_msglayout udpa_core_v1_ResourceLocator_msginit;
+extern const upb_msglayout udpa_core_v1_ResourceName_msginit;
+
+
+/* envoy.service.discovery.v3.DiscoveryRequest */
+
+UPB_INLINE envoy_service_discovery_v3_DiscoveryRequest *envoy_service_discovery_v3_DiscoveryRequest_new(upb_arena *arena) {
+ return (envoy_service_discovery_v3_DiscoveryRequest *)_upb_msg_new(&envoy_service_discovery_v3_DiscoveryRequest_msginit, arena);
+}
+UPB_INLINE envoy_service_discovery_v3_DiscoveryRequest *envoy_service_discovery_v3_DiscoveryRequest_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_service_discovery_v3_DiscoveryRequest *ret = envoy_service_discovery_v3_DiscoveryRequest_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_service_discovery_v3_DiscoveryRequest_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_service_discovery_v3_DiscoveryRequest_serialize(const envoy_service_discovery_v3_DiscoveryRequest *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_service_discovery_v3_DiscoveryRequest_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview envoy_service_discovery_v3_DiscoveryRequest_version_info(const envoy_service_discovery_v3_DiscoveryRequest *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE bool envoy_service_discovery_v3_DiscoveryRequest_has_node(const envoy_service_discovery_v3_DiscoveryRequest *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 48)); }
+UPB_INLINE const struct envoy_config_core_v3_Node* envoy_service_discovery_v3_DiscoveryRequest_node(const envoy_service_discovery_v3_DiscoveryRequest *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 48), const struct envoy_config_core_v3_Node*); }
+UPB_INLINE upb_strview const* envoy_service_discovery_v3_DiscoveryRequest_resource_names(const envoy_service_discovery_v3_DiscoveryRequest *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(32, 64), len); }
+UPB_INLINE upb_strview envoy_service_discovery_v3_DiscoveryRequest_type_url(const envoy_service_discovery_v3_DiscoveryRequest *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview); }
+UPB_INLINE upb_strview envoy_service_discovery_v3_DiscoveryRequest_response_nonce(const envoy_service_discovery_v3_DiscoveryRequest *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_strview); }
+UPB_INLINE bool envoy_service_discovery_v3_DiscoveryRequest_has_error_detail(const envoy_service_discovery_v3_DiscoveryRequest *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 56)); }
+UPB_INLINE const struct google_rpc_Status* envoy_service_discovery_v3_DiscoveryRequest_error_detail(const envoy_service_discovery_v3_DiscoveryRequest *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 56), const struct google_rpc_Status*); }
+
+UPB_INLINE void envoy_service_discovery_v3_DiscoveryRequest_set_version_info(envoy_service_discovery_v3_DiscoveryRequest *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+UPB_INLINE void envoy_service_discovery_v3_DiscoveryRequest_set_node(envoy_service_discovery_v3_DiscoveryRequest *msg, struct envoy_config_core_v3_Node* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 48), struct envoy_config_core_v3_Node*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_Node* envoy_service_discovery_v3_DiscoveryRequest_mutable_node(envoy_service_discovery_v3_DiscoveryRequest *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_Node* sub = (struct envoy_config_core_v3_Node*)envoy_service_discovery_v3_DiscoveryRequest_node(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_Node*)_upb_msg_new(&envoy_config_core_v3_Node_msginit, arena);
+ if (!sub) return NULL;
+ envoy_service_discovery_v3_DiscoveryRequest_set_node(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE upb_strview* envoy_service_discovery_v3_DiscoveryRequest_mutable_resource_names(envoy_service_discovery_v3_DiscoveryRequest *msg, size_t *len) {
+ return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(32, 64), len);
+}
+UPB_INLINE upb_strview* envoy_service_discovery_v3_DiscoveryRequest_resize_resource_names(envoy_service_discovery_v3_DiscoveryRequest *msg, size_t len, upb_arena *arena) {
+ return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(32, 64), len, UPB_TYPE_STRING, arena);
+}
+UPB_INLINE bool envoy_service_discovery_v3_DiscoveryRequest_add_resource_names(envoy_service_discovery_v3_DiscoveryRequest *msg, upb_strview val, upb_arena *arena) {
+ return _upb_array_append_accessor(msg, UPB_SIZE(32, 64), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
+ arena);
+}
+UPB_INLINE void envoy_service_discovery_v3_DiscoveryRequest_set_type_url(envoy_service_discovery_v3_DiscoveryRequest *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview) = value;
+}
+UPB_INLINE void envoy_service_discovery_v3_DiscoveryRequest_set_response_nonce(envoy_service_discovery_v3_DiscoveryRequest *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_strview) = value;
+}
+UPB_INLINE void envoy_service_discovery_v3_DiscoveryRequest_set_error_detail(envoy_service_discovery_v3_DiscoveryRequest *msg, struct google_rpc_Status* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 56), struct google_rpc_Status*) = value;
+}
+UPB_INLINE struct google_rpc_Status* envoy_service_discovery_v3_DiscoveryRequest_mutable_error_detail(envoy_service_discovery_v3_DiscoveryRequest *msg, upb_arena *arena) {
+ struct google_rpc_Status* sub = (struct google_rpc_Status*)envoy_service_discovery_v3_DiscoveryRequest_error_detail(msg);
+ if (sub == NULL) {
+ sub = (struct google_rpc_Status*)_upb_msg_new(&google_rpc_Status_msginit, arena);
+ if (!sub) return NULL;
+ envoy_service_discovery_v3_DiscoveryRequest_set_error_detail(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.service.discovery.v3.DiscoveryResponse */
+
+UPB_INLINE envoy_service_discovery_v3_DiscoveryResponse *envoy_service_discovery_v3_DiscoveryResponse_new(upb_arena *arena) {
+ return (envoy_service_discovery_v3_DiscoveryResponse *)_upb_msg_new(&envoy_service_discovery_v3_DiscoveryResponse_msginit, arena);
+}
+UPB_INLINE envoy_service_discovery_v3_DiscoveryResponse *envoy_service_discovery_v3_DiscoveryResponse_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_service_discovery_v3_DiscoveryResponse *ret = envoy_service_discovery_v3_DiscoveryResponse_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_service_discovery_v3_DiscoveryResponse_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_service_discovery_v3_DiscoveryResponse_serialize(const envoy_service_discovery_v3_DiscoveryResponse *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_service_discovery_v3_DiscoveryResponse_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview envoy_service_discovery_v3_DiscoveryResponse_version_info(const envoy_service_discovery_v3_DiscoveryResponse *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
+UPB_INLINE bool envoy_service_discovery_v3_DiscoveryResponse_has_resources(const envoy_service_discovery_v3_DiscoveryResponse *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(32, 64)); }
+UPB_INLINE const struct google_protobuf_Any* const* envoy_service_discovery_v3_DiscoveryResponse_resources(const envoy_service_discovery_v3_DiscoveryResponse *msg, size_t *len) { return (const struct google_protobuf_Any* const*)_upb_array_accessor(msg, UPB_SIZE(32, 64), len); }
+UPB_INLINE bool envoy_service_discovery_v3_DiscoveryResponse_canary(const envoy_service_discovery_v3_DiscoveryResponse *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); }
+UPB_INLINE upb_strview envoy_service_discovery_v3_DiscoveryResponse_type_url(const envoy_service_discovery_v3_DiscoveryResponse *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview); }
+UPB_INLINE upb_strview envoy_service_discovery_v3_DiscoveryResponse_nonce(const envoy_service_discovery_v3_DiscoveryResponse *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_strview); }
+UPB_INLINE bool envoy_service_discovery_v3_DiscoveryResponse_has_control_plane(const envoy_service_discovery_v3_DiscoveryResponse *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 56)); }
+UPB_INLINE const struct envoy_config_core_v3_ControlPlane* envoy_service_discovery_v3_DiscoveryResponse_control_plane(const envoy_service_discovery_v3_DiscoveryResponse *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 56), const struct envoy_config_core_v3_ControlPlane*); }
+
+UPB_INLINE void envoy_service_discovery_v3_DiscoveryResponse_set_version_info(envoy_service_discovery_v3_DiscoveryResponse *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
+}
+UPB_INLINE struct google_protobuf_Any** envoy_service_discovery_v3_DiscoveryResponse_mutable_resources(envoy_service_discovery_v3_DiscoveryResponse *msg, size_t *len) {
+ return (struct google_protobuf_Any**)_upb_array_mutable_accessor(msg, UPB_SIZE(32, 64), len);
+}
+UPB_INLINE struct google_protobuf_Any** envoy_service_discovery_v3_DiscoveryResponse_resize_resources(envoy_service_discovery_v3_DiscoveryResponse *msg, size_t len, upb_arena *arena) {
+ return (struct google_protobuf_Any**)_upb_array_resize_accessor(msg, UPB_SIZE(32, 64), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct google_protobuf_Any* envoy_service_discovery_v3_DiscoveryResponse_add_resources(envoy_service_discovery_v3_DiscoveryResponse *msg, upb_arena *arena) {
+ struct google_protobuf_Any* sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(32, 64), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE void envoy_service_discovery_v3_DiscoveryResponse_set_canary(envoy_service_discovery_v3_DiscoveryResponse *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
+}
+UPB_INLINE void envoy_service_discovery_v3_DiscoveryResponse_set_type_url(envoy_service_discovery_v3_DiscoveryResponse *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview) = value;
+}
+UPB_INLINE void envoy_service_discovery_v3_DiscoveryResponse_set_nonce(envoy_service_discovery_v3_DiscoveryResponse *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_strview) = value;
+}
+UPB_INLINE void envoy_service_discovery_v3_DiscoveryResponse_set_control_plane(envoy_service_discovery_v3_DiscoveryResponse *msg, struct envoy_config_core_v3_ControlPlane* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 56), struct envoy_config_core_v3_ControlPlane*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_ControlPlane* envoy_service_discovery_v3_DiscoveryResponse_mutable_control_plane(envoy_service_discovery_v3_DiscoveryResponse *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_ControlPlane* sub = (struct envoy_config_core_v3_ControlPlane*)envoy_service_discovery_v3_DiscoveryResponse_control_plane(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_ControlPlane*)_upb_msg_new(&envoy_config_core_v3_ControlPlane_msginit, arena);
+ if (!sub) return NULL;
+ envoy_service_discovery_v3_DiscoveryResponse_set_control_plane(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.service.discovery.v3.DeltaDiscoveryRequest */
+
+UPB_INLINE envoy_service_discovery_v3_DeltaDiscoveryRequest *envoy_service_discovery_v3_DeltaDiscoveryRequest_new(upb_arena *arena) {
+ return (envoy_service_discovery_v3_DeltaDiscoveryRequest *)_upb_msg_new(&envoy_service_discovery_v3_DeltaDiscoveryRequest_msginit, arena);
+}
+UPB_INLINE envoy_service_discovery_v3_DeltaDiscoveryRequest *envoy_service_discovery_v3_DeltaDiscoveryRequest_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_service_discovery_v3_DeltaDiscoveryRequest *ret = envoy_service_discovery_v3_DeltaDiscoveryRequest_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_service_discovery_v3_DeltaDiscoveryRequest_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_service_discovery_v3_DeltaDiscoveryRequest_serialize(const envoy_service_discovery_v3_DeltaDiscoveryRequest *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_service_discovery_v3_DeltaDiscoveryRequest_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_service_discovery_v3_DeltaDiscoveryRequest_has_node(const envoy_service_discovery_v3_DeltaDiscoveryRequest *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); }
+UPB_INLINE const struct envoy_config_core_v3_Node* envoy_service_discovery_v3_DeltaDiscoveryRequest_node(const envoy_service_discovery_v3_DeltaDiscoveryRequest *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const struct envoy_config_core_v3_Node*); }
+UPB_INLINE upb_strview envoy_service_discovery_v3_DeltaDiscoveryRequest_type_url(const envoy_service_discovery_v3_DeltaDiscoveryRequest *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE upb_strview const* envoy_service_discovery_v3_DeltaDiscoveryRequest_resource_names_subscribe(const envoy_service_discovery_v3_DeltaDiscoveryRequest *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(24, 48), len); }
+UPB_INLINE upb_strview const* envoy_service_discovery_v3_DeltaDiscoveryRequest_resource_names_unsubscribe(const envoy_service_discovery_v3_DeltaDiscoveryRequest *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(28, 56), len); }
+UPB_INLINE bool envoy_service_discovery_v3_DeltaDiscoveryRequest_has_initial_resource_versions(const envoy_service_discovery_v3_DeltaDiscoveryRequest *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(32, 64)); }
+UPB_INLINE size_t envoy_service_discovery_v3_DeltaDiscoveryRequest_initial_resource_versions_size(const envoy_service_discovery_v3_DeltaDiscoveryRequest *msg) {return _upb_msg_map_size(msg, UPB_SIZE(32, 64)); }
+UPB_INLINE bool envoy_service_discovery_v3_DeltaDiscoveryRequest_initial_resource_versions_get(const envoy_service_discovery_v3_DeltaDiscoveryRequest *msg, upb_strview key, upb_strview *val) { return _upb_msg_map_get(msg, UPB_SIZE(32, 64), &key, 0, val, 0); }
+UPB_INLINE const envoy_service_discovery_v3_DeltaDiscoveryRequest_InitialResourceVersionsEntry* envoy_service_discovery_v3_DeltaDiscoveryRequest_initial_resource_versions_next(const envoy_service_discovery_v3_DeltaDiscoveryRequest *msg, size_t* iter) { return (const envoy_service_discovery_v3_DeltaDiscoveryRequest_InitialResourceVersionsEntry*)_upb_msg_map_next(msg, UPB_SIZE(32, 64), iter); }
+UPB_INLINE upb_strview envoy_service_discovery_v3_DeltaDiscoveryRequest_response_nonce(const envoy_service_discovery_v3_DeltaDiscoveryRequest *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview); }
+UPB_INLINE bool envoy_service_discovery_v3_DeltaDiscoveryRequest_has_error_detail(const envoy_service_discovery_v3_DeltaDiscoveryRequest *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 40)); }
+UPB_INLINE const struct google_rpc_Status* envoy_service_discovery_v3_DeltaDiscoveryRequest_error_detail(const envoy_service_discovery_v3_DeltaDiscoveryRequest *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const struct google_rpc_Status*); }
+UPB_INLINE bool envoy_service_discovery_v3_DeltaDiscoveryRequest_has_udpa_resources_subscribe(const envoy_service_discovery_v3_DeltaDiscoveryRequest *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(36, 72)); }
+UPB_INLINE const struct udpa_core_v1_ResourceLocator* const* envoy_service_discovery_v3_DeltaDiscoveryRequest_udpa_resources_subscribe(const envoy_service_discovery_v3_DeltaDiscoveryRequest *msg, size_t *len) { return (const struct udpa_core_v1_ResourceLocator* const*)_upb_array_accessor(msg, UPB_SIZE(36, 72), len); }
+UPB_INLINE bool envoy_service_discovery_v3_DeltaDiscoveryRequest_has_udpa_resources_unsubscribe(const envoy_service_discovery_v3_DeltaDiscoveryRequest *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(40, 80)); }
+UPB_INLINE const struct udpa_core_v1_ResourceLocator* const* envoy_service_discovery_v3_DeltaDiscoveryRequest_udpa_resources_unsubscribe(const envoy_service_discovery_v3_DeltaDiscoveryRequest *msg, size_t *len) { return (const struct udpa_core_v1_ResourceLocator* const*)_upb_array_accessor(msg, UPB_SIZE(40, 80), len); }
+
+UPB_INLINE void envoy_service_discovery_v3_DeltaDiscoveryRequest_set_node(envoy_service_discovery_v3_DeltaDiscoveryRequest *msg, struct envoy_config_core_v3_Node* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), struct envoy_config_core_v3_Node*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_Node* envoy_service_discovery_v3_DeltaDiscoveryRequest_mutable_node(envoy_service_discovery_v3_DeltaDiscoveryRequest *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_Node* sub = (struct envoy_config_core_v3_Node*)envoy_service_discovery_v3_DeltaDiscoveryRequest_node(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_Node*)_upb_msg_new(&envoy_config_core_v3_Node_msginit, arena);
+ if (!sub) return NULL;
+ envoy_service_discovery_v3_DeltaDiscoveryRequest_set_node(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_service_discovery_v3_DeltaDiscoveryRequest_set_type_url(envoy_service_discovery_v3_DeltaDiscoveryRequest *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+UPB_INLINE upb_strview* envoy_service_discovery_v3_DeltaDiscoveryRequest_mutable_resource_names_subscribe(envoy_service_discovery_v3_DeltaDiscoveryRequest *msg, size_t *len) {
+ return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 48), len);
+}
+UPB_INLINE upb_strview* envoy_service_discovery_v3_DeltaDiscoveryRequest_resize_resource_names_subscribe(envoy_service_discovery_v3_DeltaDiscoveryRequest *msg, size_t len, upb_arena *arena) {
+ return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(24, 48), len, UPB_TYPE_STRING, arena);
+}
+UPB_INLINE bool envoy_service_discovery_v3_DeltaDiscoveryRequest_add_resource_names_subscribe(envoy_service_discovery_v3_DeltaDiscoveryRequest *msg, upb_strview val, upb_arena *arena) {
+ return _upb_array_append_accessor(msg, UPB_SIZE(24, 48), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
+ arena);
+}
+UPB_INLINE upb_strview* envoy_service_discovery_v3_DeltaDiscoveryRequest_mutable_resource_names_unsubscribe(envoy_service_discovery_v3_DeltaDiscoveryRequest *msg, size_t *len) {
+ return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 56), len);
+}
+UPB_INLINE upb_strview* envoy_service_discovery_v3_DeltaDiscoveryRequest_resize_resource_names_unsubscribe(envoy_service_discovery_v3_DeltaDiscoveryRequest *msg, size_t len, upb_arena *arena) {
+ return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(28, 56), len, UPB_TYPE_STRING, arena);
+}
+UPB_INLINE bool envoy_service_discovery_v3_DeltaDiscoveryRequest_add_resource_names_unsubscribe(envoy_service_discovery_v3_DeltaDiscoveryRequest *msg, upb_strview val, upb_arena *arena) {
+ return _upb_array_append_accessor(msg, UPB_SIZE(28, 56), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
+ arena);
+}
+UPB_INLINE void envoy_service_discovery_v3_DeltaDiscoveryRequest_initial_resource_versions_clear(envoy_service_discovery_v3_DeltaDiscoveryRequest *msg) { _upb_msg_map_clear(msg, UPB_SIZE(32, 64)); }
+UPB_INLINE bool envoy_service_discovery_v3_DeltaDiscoveryRequest_initial_resource_versions_set(envoy_service_discovery_v3_DeltaDiscoveryRequest *msg, upb_strview key, upb_strview val, upb_arena *a) { return _upb_msg_map_set(msg, UPB_SIZE(32, 64), &key, 0, &val, 0, a); }
+UPB_INLINE bool envoy_service_discovery_v3_DeltaDiscoveryRequest_initial_resource_versions_delete(envoy_service_discovery_v3_DeltaDiscoveryRequest *msg, upb_strview key) { return _upb_msg_map_delete(msg, UPB_SIZE(32, 64), &key, 0); }
+UPB_INLINE envoy_service_discovery_v3_DeltaDiscoveryRequest_InitialResourceVersionsEntry* envoy_service_discovery_v3_DeltaDiscoveryRequest_initial_resource_versions_nextmutable(envoy_service_discovery_v3_DeltaDiscoveryRequest *msg, size_t* iter) { return (envoy_service_discovery_v3_DeltaDiscoveryRequest_InitialResourceVersionsEntry*)_upb_msg_map_next(msg, UPB_SIZE(32, 64), iter); }
+UPB_INLINE void envoy_service_discovery_v3_DeltaDiscoveryRequest_set_response_nonce(envoy_service_discovery_v3_DeltaDiscoveryRequest *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview) = value;
+}
+UPB_INLINE void envoy_service_discovery_v3_DeltaDiscoveryRequest_set_error_detail(envoy_service_discovery_v3_DeltaDiscoveryRequest *msg, struct google_rpc_Status* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 40), struct google_rpc_Status*) = value;
+}
+UPB_INLINE struct google_rpc_Status* envoy_service_discovery_v3_DeltaDiscoveryRequest_mutable_error_detail(envoy_service_discovery_v3_DeltaDiscoveryRequest *msg, upb_arena *arena) {
+ struct google_rpc_Status* sub = (struct google_rpc_Status*)envoy_service_discovery_v3_DeltaDiscoveryRequest_error_detail(msg);
+ if (sub == NULL) {
+ sub = (struct google_rpc_Status*)_upb_msg_new(&google_rpc_Status_msginit, arena);
+ if (!sub) return NULL;
+ envoy_service_discovery_v3_DeltaDiscoveryRequest_set_error_detail(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE struct udpa_core_v1_ResourceLocator** envoy_service_discovery_v3_DeltaDiscoveryRequest_mutable_udpa_resources_subscribe(envoy_service_discovery_v3_DeltaDiscoveryRequest *msg, size_t *len) {
+ return (struct udpa_core_v1_ResourceLocator**)_upb_array_mutable_accessor(msg, UPB_SIZE(36, 72), len);
+}
+UPB_INLINE struct udpa_core_v1_ResourceLocator** envoy_service_discovery_v3_DeltaDiscoveryRequest_resize_udpa_resources_subscribe(envoy_service_discovery_v3_DeltaDiscoveryRequest *msg, size_t len, upb_arena *arena) {
+ return (struct udpa_core_v1_ResourceLocator**)_upb_array_resize_accessor(msg, UPB_SIZE(36, 72), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct udpa_core_v1_ResourceLocator* envoy_service_discovery_v3_DeltaDiscoveryRequest_add_udpa_resources_subscribe(envoy_service_discovery_v3_DeltaDiscoveryRequest *msg, upb_arena *arena) {
+ struct udpa_core_v1_ResourceLocator* sub = (struct udpa_core_v1_ResourceLocator*)_upb_msg_new(&udpa_core_v1_ResourceLocator_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(36, 72), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE struct udpa_core_v1_ResourceLocator** envoy_service_discovery_v3_DeltaDiscoveryRequest_mutable_udpa_resources_unsubscribe(envoy_service_discovery_v3_DeltaDiscoveryRequest *msg, size_t *len) {
+ return (struct udpa_core_v1_ResourceLocator**)_upb_array_mutable_accessor(msg, UPB_SIZE(40, 80), len);
+}
+UPB_INLINE struct udpa_core_v1_ResourceLocator** envoy_service_discovery_v3_DeltaDiscoveryRequest_resize_udpa_resources_unsubscribe(envoy_service_discovery_v3_DeltaDiscoveryRequest *msg, size_t len, upb_arena *arena) {
+ return (struct udpa_core_v1_ResourceLocator**)_upb_array_resize_accessor(msg, UPB_SIZE(40, 80), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct udpa_core_v1_ResourceLocator* envoy_service_discovery_v3_DeltaDiscoveryRequest_add_udpa_resources_unsubscribe(envoy_service_discovery_v3_DeltaDiscoveryRequest *msg, upb_arena *arena) {
+ struct udpa_core_v1_ResourceLocator* sub = (struct udpa_core_v1_ResourceLocator*)_upb_msg_new(&udpa_core_v1_ResourceLocator_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(40, 80), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+
+/* envoy.service.discovery.v3.DeltaDiscoveryRequest.InitialResourceVersionsEntry */
+
+UPB_INLINE upb_strview envoy_service_discovery_v3_DeltaDiscoveryRequest_InitialResourceVersionsEntry_key(const envoy_service_discovery_v3_DeltaDiscoveryRequest_InitialResourceVersionsEntry *msg) {
+ upb_strview ret;
+ _upb_msg_map_key(msg, &ret, 0);
+ return ret;
+}
+UPB_INLINE upb_strview envoy_service_discovery_v3_DeltaDiscoveryRequest_InitialResourceVersionsEntry_value(const envoy_service_discovery_v3_DeltaDiscoveryRequest_InitialResourceVersionsEntry *msg) {
+ upb_strview ret;
+ _upb_msg_map_value(msg, &ret, 0);
+ return ret;
+}
+
+UPB_INLINE void envoy_service_discovery_v3_DeltaDiscoveryRequest_InitialResourceVersionsEntry_set_value(envoy_service_discovery_v3_DeltaDiscoveryRequest_InitialResourceVersionsEntry *msg, upb_strview value) {
+ _upb_msg_map_set_value(msg, &value, 0);
+}
+
+/* envoy.service.discovery.v3.DeltaDiscoveryResponse */
+
+UPB_INLINE envoy_service_discovery_v3_DeltaDiscoveryResponse *envoy_service_discovery_v3_DeltaDiscoveryResponse_new(upb_arena *arena) {
+ return (envoy_service_discovery_v3_DeltaDiscoveryResponse *)_upb_msg_new(&envoy_service_discovery_v3_DeltaDiscoveryResponse_msginit, arena);
+}
+UPB_INLINE envoy_service_discovery_v3_DeltaDiscoveryResponse *envoy_service_discovery_v3_DeltaDiscoveryResponse_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_service_discovery_v3_DeltaDiscoveryResponse *ret = envoy_service_discovery_v3_DeltaDiscoveryResponse_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_service_discovery_v3_DeltaDiscoveryResponse_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_service_discovery_v3_DeltaDiscoveryResponse_serialize(const envoy_service_discovery_v3_DeltaDiscoveryResponse *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_service_discovery_v3_DeltaDiscoveryResponse_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview envoy_service_discovery_v3_DeltaDiscoveryResponse_system_version_info(const envoy_service_discovery_v3_DeltaDiscoveryResponse *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE bool envoy_service_discovery_v3_DeltaDiscoveryResponse_has_resources(const envoy_service_discovery_v3_DeltaDiscoveryResponse *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 48)); }
+UPB_INLINE const envoy_service_discovery_v3_Resource* const* envoy_service_discovery_v3_DeltaDiscoveryResponse_resources(const envoy_service_discovery_v3_DeltaDiscoveryResponse *msg, size_t *len) { return (const envoy_service_discovery_v3_Resource* const*)_upb_array_accessor(msg, UPB_SIZE(24, 48), len); }
+UPB_INLINE upb_strview envoy_service_discovery_v3_DeltaDiscoveryResponse_type_url(const envoy_service_discovery_v3_DeltaDiscoveryResponse *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview); }
+UPB_INLINE upb_strview envoy_service_discovery_v3_DeltaDiscoveryResponse_nonce(const envoy_service_discovery_v3_DeltaDiscoveryResponse *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_strview); }
+UPB_INLINE upb_strview const* envoy_service_discovery_v3_DeltaDiscoveryResponse_removed_resources(const envoy_service_discovery_v3_DeltaDiscoveryResponse *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(28, 56), len); }
+UPB_INLINE bool envoy_service_discovery_v3_DeltaDiscoveryResponse_has_udpa_removed_resources(const envoy_service_discovery_v3_DeltaDiscoveryResponse *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(32, 64)); }
+UPB_INLINE const struct udpa_core_v1_ResourceName* const* envoy_service_discovery_v3_DeltaDiscoveryResponse_udpa_removed_resources(const envoy_service_discovery_v3_DeltaDiscoveryResponse *msg, size_t *len) { return (const struct udpa_core_v1_ResourceName* const*)_upb_array_accessor(msg, UPB_SIZE(32, 64), len); }
+
+UPB_INLINE void envoy_service_discovery_v3_DeltaDiscoveryResponse_set_system_version_info(envoy_service_discovery_v3_DeltaDiscoveryResponse *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+UPB_INLINE envoy_service_discovery_v3_Resource** envoy_service_discovery_v3_DeltaDiscoveryResponse_mutable_resources(envoy_service_discovery_v3_DeltaDiscoveryResponse *msg, size_t *len) {
+ return (envoy_service_discovery_v3_Resource**)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 48), len);
+}
+UPB_INLINE envoy_service_discovery_v3_Resource** envoy_service_discovery_v3_DeltaDiscoveryResponse_resize_resources(envoy_service_discovery_v3_DeltaDiscoveryResponse *msg, size_t len, upb_arena *arena) {
+ return (envoy_service_discovery_v3_Resource**)_upb_array_resize_accessor(msg, UPB_SIZE(24, 48), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_service_discovery_v3_Resource* envoy_service_discovery_v3_DeltaDiscoveryResponse_add_resources(envoy_service_discovery_v3_DeltaDiscoveryResponse *msg, upb_arena *arena) {
+ struct envoy_service_discovery_v3_Resource* sub = (struct envoy_service_discovery_v3_Resource*)_upb_msg_new(&envoy_service_discovery_v3_Resource_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(24, 48), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE void envoy_service_discovery_v3_DeltaDiscoveryResponse_set_type_url(envoy_service_discovery_v3_DeltaDiscoveryResponse *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview) = value;
+}
+UPB_INLINE void envoy_service_discovery_v3_DeltaDiscoveryResponse_set_nonce(envoy_service_discovery_v3_DeltaDiscoveryResponse *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_strview) = value;
+}
+UPB_INLINE upb_strview* envoy_service_discovery_v3_DeltaDiscoveryResponse_mutable_removed_resources(envoy_service_discovery_v3_DeltaDiscoveryResponse *msg, size_t *len) {
+ return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 56), len);
+}
+UPB_INLINE upb_strview* envoy_service_discovery_v3_DeltaDiscoveryResponse_resize_removed_resources(envoy_service_discovery_v3_DeltaDiscoveryResponse *msg, size_t len, upb_arena *arena) {
+ return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(28, 56), len, UPB_TYPE_STRING, arena);
+}
+UPB_INLINE bool envoy_service_discovery_v3_DeltaDiscoveryResponse_add_removed_resources(envoy_service_discovery_v3_DeltaDiscoveryResponse *msg, upb_strview val, upb_arena *arena) {
+ return _upb_array_append_accessor(msg, UPB_SIZE(28, 56), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
+ arena);
+}
+UPB_INLINE struct udpa_core_v1_ResourceName** envoy_service_discovery_v3_DeltaDiscoveryResponse_mutable_udpa_removed_resources(envoy_service_discovery_v3_DeltaDiscoveryResponse *msg, size_t *len) {
+ return (struct udpa_core_v1_ResourceName**)_upb_array_mutable_accessor(msg, UPB_SIZE(32, 64), len);
+}
+UPB_INLINE struct udpa_core_v1_ResourceName** envoy_service_discovery_v3_DeltaDiscoveryResponse_resize_udpa_removed_resources(envoy_service_discovery_v3_DeltaDiscoveryResponse *msg, size_t len, upb_arena *arena) {
+ return (struct udpa_core_v1_ResourceName**)_upb_array_resize_accessor(msg, UPB_SIZE(32, 64), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct udpa_core_v1_ResourceName* envoy_service_discovery_v3_DeltaDiscoveryResponse_add_udpa_removed_resources(envoy_service_discovery_v3_DeltaDiscoveryResponse *msg, upb_arena *arena) {
+ struct udpa_core_v1_ResourceName* sub = (struct udpa_core_v1_ResourceName*)_upb_msg_new(&udpa_core_v1_ResourceName_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(32, 64), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+
+/* envoy.service.discovery.v3.Resource */
+
+UPB_INLINE envoy_service_discovery_v3_Resource *envoy_service_discovery_v3_Resource_new(upb_arena *arena) {
+ return (envoy_service_discovery_v3_Resource *)_upb_msg_new(&envoy_service_discovery_v3_Resource_msginit, arena);
+}
+UPB_INLINE envoy_service_discovery_v3_Resource *envoy_service_discovery_v3_Resource_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_service_discovery_v3_Resource *ret = envoy_service_discovery_v3_Resource_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_service_discovery_v3_Resource_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_service_discovery_v3_Resource_serialize(const envoy_service_discovery_v3_Resource *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_service_discovery_v3_Resource_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview envoy_service_discovery_v3_Resource_version(const envoy_service_discovery_v3_Resource *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE bool envoy_service_discovery_v3_Resource_has_resource(const envoy_service_discovery_v3_Resource *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); }
+UPB_INLINE const struct google_protobuf_Any* envoy_service_discovery_v3_Resource_resource(const envoy_service_discovery_v3_Resource *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const struct google_protobuf_Any*); }
+UPB_INLINE upb_strview envoy_service_discovery_v3_Resource_name(const envoy_service_discovery_v3_Resource *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview); }
+UPB_INLINE upb_strview const* envoy_service_discovery_v3_Resource_aliases(const envoy_service_discovery_v3_Resource *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(24, 48), len); }
+UPB_INLINE bool envoy_service_discovery_v3_Resource_has_udpa_resource_name(const envoy_service_discovery_v3_Resource *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 40)); }
+UPB_INLINE const struct udpa_core_v1_ResourceName* envoy_service_discovery_v3_Resource_udpa_resource_name(const envoy_service_discovery_v3_Resource *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const struct udpa_core_v1_ResourceName*); }
+
+UPB_INLINE void envoy_service_discovery_v3_Resource_set_version(envoy_service_discovery_v3_Resource *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+UPB_INLINE void envoy_service_discovery_v3_Resource_set_resource(envoy_service_discovery_v3_Resource *msg, struct google_protobuf_Any* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), struct google_protobuf_Any*) = value;
+}
+UPB_INLINE struct google_protobuf_Any* envoy_service_discovery_v3_Resource_mutable_resource(envoy_service_discovery_v3_Resource *msg, upb_arena *arena) {
+ struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_service_discovery_v3_Resource_resource(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena);
+ if (!sub) return NULL;
+ envoy_service_discovery_v3_Resource_set_resource(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_service_discovery_v3_Resource_set_name(envoy_service_discovery_v3_Resource *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview) = value;
+}
+UPB_INLINE upb_strview* envoy_service_discovery_v3_Resource_mutable_aliases(envoy_service_discovery_v3_Resource *msg, size_t *len) {
+ return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 48), len);
+}
+UPB_INLINE upb_strview* envoy_service_discovery_v3_Resource_resize_aliases(envoy_service_discovery_v3_Resource *msg, size_t len, upb_arena *arena) {
+ return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(24, 48), len, UPB_TYPE_STRING, arena);
+}
+UPB_INLINE bool envoy_service_discovery_v3_Resource_add_aliases(envoy_service_discovery_v3_Resource *msg, upb_strview val, upb_arena *arena) {
+ return _upb_array_append_accessor(msg, UPB_SIZE(24, 48), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
+ arena);
+}
+UPB_INLINE void envoy_service_discovery_v3_Resource_set_udpa_resource_name(envoy_service_discovery_v3_Resource *msg, struct udpa_core_v1_ResourceName* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 40), struct udpa_core_v1_ResourceName*) = value;
+}
+UPB_INLINE struct udpa_core_v1_ResourceName* envoy_service_discovery_v3_Resource_mutable_udpa_resource_name(envoy_service_discovery_v3_Resource *msg, upb_arena *arena) {
+ struct udpa_core_v1_ResourceName* sub = (struct udpa_core_v1_ResourceName*)envoy_service_discovery_v3_Resource_udpa_resource_name(msg);
+ if (sub == NULL) {
+ sub = (struct udpa_core_v1_ResourceName*)_upb_msg_new(&udpa_core_v1_ResourceName_msginit, arena);
+ if (!sub) return NULL;
+ envoy_service_discovery_v3_Resource_set_udpa_resource_name(msg, sub);
+ }
+ return sub;
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_SERVICE_DISCOVERY_V3_DISCOVERY_PROTO_UPB_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/endpoint/v3/eds.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/endpoint/v3/eds.upb.c
index 00eda0c3226..3006037b8be 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/endpoint/v3/eds.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/endpoint/v3/eds.upb.c
@@ -1,30 +1,30 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/service/endpoint/v3/eds.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include <stddef.h>
-#include "upb/msg.h"
-#include "envoy/service/endpoint/v3/eds.upb.h"
-#include "envoy/service/discovery/v3/discovery.upb.h"
-#include "google/api/annotations.upb.h"
-#include "google/protobuf/duration.upb.h"
-#include "google/protobuf/wrappers.upb.h"
-#include "envoy/annotations/resource.upb.h"
-#include "udpa/annotations/status.upb.h"
-#include "udpa/annotations/versioning.upb.h"
-#include "validate/validate.upb.h"
-
-#include "upb/port_def.inc"
-
-const upb_msglayout envoy_service_endpoint_v3_EdsDummy_msginit = {
- NULL,
- NULL,
- UPB_SIZE(0, 0), 0, false,
-};
-
-#include "upb/port_undef.inc"
-
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/service/endpoint/v3/eds.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg.h"
+#include "envoy/service/endpoint/v3/eds.upb.h"
+#include "envoy/service/discovery/v3/discovery.upb.h"
+#include "google/api/annotations.upb.h"
+#include "google/protobuf/duration.upb.h"
+#include "google/protobuf/wrappers.upb.h"
+#include "envoy/annotations/resource.upb.h"
+#include "udpa/annotations/status.upb.h"
+#include "udpa/annotations/versioning.upb.h"
+#include "validate/validate.upb.h"
+
+#include "upb/port_def.inc"
+
+const upb_msglayout envoy_service_endpoint_v3_EdsDummy_msginit = {
+ NULL,
+ NULL,
+ UPB_SIZE(0, 0), 0, false,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/endpoint/v3/eds.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/endpoint/v3/eds.upb.h
index 674080c5c82..f9c36a0707a 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/endpoint/v3/eds.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/endpoint/v3/eds.upb.h
@@ -1,49 +1,49 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/service/endpoint/v3/eds.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef ENVOY_SERVICE_ENDPOINT_V3_EDS_PROTO_UPB_H_
-#define ENVOY_SERVICE_ENDPOINT_V3_EDS_PROTO_UPB_H_
-
-#include "upb/msg.h"
-#include "upb/decode.h"
-#include "upb/encode.h"
-
-#include "upb/port_def.inc"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct envoy_service_endpoint_v3_EdsDummy;
-typedef struct envoy_service_endpoint_v3_EdsDummy envoy_service_endpoint_v3_EdsDummy;
-extern const upb_msglayout envoy_service_endpoint_v3_EdsDummy_msginit;
-
-
-/* envoy.service.endpoint.v3.EdsDummy */
-
-UPB_INLINE envoy_service_endpoint_v3_EdsDummy *envoy_service_endpoint_v3_EdsDummy_new(upb_arena *arena) {
- return (envoy_service_endpoint_v3_EdsDummy *)_upb_msg_new(&envoy_service_endpoint_v3_EdsDummy_msginit, arena);
-}
-UPB_INLINE envoy_service_endpoint_v3_EdsDummy *envoy_service_endpoint_v3_EdsDummy_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_service_endpoint_v3_EdsDummy *ret = envoy_service_endpoint_v3_EdsDummy_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_service_endpoint_v3_EdsDummy_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_service_endpoint_v3_EdsDummy_serialize(const envoy_service_endpoint_v3_EdsDummy *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_service_endpoint_v3_EdsDummy_msginit, arena, len);
-}
-
-
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* ENVOY_SERVICE_ENDPOINT_V3_EDS_PROTO_UPB_H_ */
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/service/endpoint/v3/eds.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_SERVICE_ENDPOINT_V3_EDS_PROTO_UPB_H_
+#define ENVOY_SERVICE_ENDPOINT_V3_EDS_PROTO_UPB_H_
+
+#include "upb/msg.h"
+#include "upb/decode.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_service_endpoint_v3_EdsDummy;
+typedef struct envoy_service_endpoint_v3_EdsDummy envoy_service_endpoint_v3_EdsDummy;
+extern const upb_msglayout envoy_service_endpoint_v3_EdsDummy_msginit;
+
+
+/* envoy.service.endpoint.v3.EdsDummy */
+
+UPB_INLINE envoy_service_endpoint_v3_EdsDummy *envoy_service_endpoint_v3_EdsDummy_new(upb_arena *arena) {
+ return (envoy_service_endpoint_v3_EdsDummy *)_upb_msg_new(&envoy_service_endpoint_v3_EdsDummy_msginit, arena);
+}
+UPB_INLINE envoy_service_endpoint_v3_EdsDummy *envoy_service_endpoint_v3_EdsDummy_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_service_endpoint_v3_EdsDummy *ret = envoy_service_endpoint_v3_EdsDummy_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_service_endpoint_v3_EdsDummy_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_service_endpoint_v3_EdsDummy_serialize(const envoy_service_endpoint_v3_EdsDummy *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_service_endpoint_v3_EdsDummy_msginit, arena, len);
+}
+
+
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_SERVICE_ENDPOINT_V3_EDS_PROTO_UPB_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/listener/v3/lds.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/listener/v3/lds.upb.c
index 510cb84f459..a0f7024331e 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/listener/v3/lds.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/listener/v3/lds.upb.c
@@ -1,30 +1,30 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/service/listener/v3/lds.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include <stddef.h>
-#include "upb/msg.h"
-#include "envoy/service/listener/v3/lds.upb.h"
-#include "envoy/service/discovery/v3/discovery.upb.h"
-#include "google/api/annotations.upb.h"
-#include "google/protobuf/duration.upb.h"
-#include "google/protobuf/wrappers.upb.h"
-#include "envoy/annotations/resource.upb.h"
-#include "udpa/annotations/status.upb.h"
-#include "udpa/annotations/versioning.upb.h"
-#include "validate/validate.upb.h"
-
-#include "upb/port_def.inc"
-
-const upb_msglayout envoy_service_listener_v3_LdsDummy_msginit = {
- NULL,
- NULL,
- UPB_SIZE(0, 0), 0, false,
-};
-
-#include "upb/port_undef.inc"
-
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/service/listener/v3/lds.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg.h"
+#include "envoy/service/listener/v3/lds.upb.h"
+#include "envoy/service/discovery/v3/discovery.upb.h"
+#include "google/api/annotations.upb.h"
+#include "google/protobuf/duration.upb.h"
+#include "google/protobuf/wrappers.upb.h"
+#include "envoy/annotations/resource.upb.h"
+#include "udpa/annotations/status.upb.h"
+#include "udpa/annotations/versioning.upb.h"
+#include "validate/validate.upb.h"
+
+#include "upb/port_def.inc"
+
+const upb_msglayout envoy_service_listener_v3_LdsDummy_msginit = {
+ NULL,
+ NULL,
+ UPB_SIZE(0, 0), 0, false,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/listener/v3/lds.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/listener/v3/lds.upb.h
index 65bb4bc46bd..c427dc3d338 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/listener/v3/lds.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/listener/v3/lds.upb.h
@@ -1,49 +1,49 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/service/listener/v3/lds.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef ENVOY_SERVICE_LISTENER_V3_LDS_PROTO_UPB_H_
-#define ENVOY_SERVICE_LISTENER_V3_LDS_PROTO_UPB_H_
-
-#include "upb/msg.h"
-#include "upb/decode.h"
-#include "upb/encode.h"
-
-#include "upb/port_def.inc"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct envoy_service_listener_v3_LdsDummy;
-typedef struct envoy_service_listener_v3_LdsDummy envoy_service_listener_v3_LdsDummy;
-extern const upb_msglayout envoy_service_listener_v3_LdsDummy_msginit;
-
-
-/* envoy.service.listener.v3.LdsDummy */
-
-UPB_INLINE envoy_service_listener_v3_LdsDummy *envoy_service_listener_v3_LdsDummy_new(upb_arena *arena) {
- return (envoy_service_listener_v3_LdsDummy *)_upb_msg_new(&envoy_service_listener_v3_LdsDummy_msginit, arena);
-}
-UPB_INLINE envoy_service_listener_v3_LdsDummy *envoy_service_listener_v3_LdsDummy_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_service_listener_v3_LdsDummy *ret = envoy_service_listener_v3_LdsDummy_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_service_listener_v3_LdsDummy_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_service_listener_v3_LdsDummy_serialize(const envoy_service_listener_v3_LdsDummy *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_service_listener_v3_LdsDummy_msginit, arena, len);
-}
-
-
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* ENVOY_SERVICE_LISTENER_V3_LDS_PROTO_UPB_H_ */
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/service/listener/v3/lds.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_SERVICE_LISTENER_V3_LDS_PROTO_UPB_H_
+#define ENVOY_SERVICE_LISTENER_V3_LDS_PROTO_UPB_H_
+
+#include "upb/msg.h"
+#include "upb/decode.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_service_listener_v3_LdsDummy;
+typedef struct envoy_service_listener_v3_LdsDummy envoy_service_listener_v3_LdsDummy;
+extern const upb_msglayout envoy_service_listener_v3_LdsDummy_msginit;
+
+
+/* envoy.service.listener.v3.LdsDummy */
+
+UPB_INLINE envoy_service_listener_v3_LdsDummy *envoy_service_listener_v3_LdsDummy_new(upb_arena *arena) {
+ return (envoy_service_listener_v3_LdsDummy *)_upb_msg_new(&envoy_service_listener_v3_LdsDummy_msginit, arena);
+}
+UPB_INLINE envoy_service_listener_v3_LdsDummy *envoy_service_listener_v3_LdsDummy_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_service_listener_v3_LdsDummy *ret = envoy_service_listener_v3_LdsDummy_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_service_listener_v3_LdsDummy_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_service_listener_v3_LdsDummy_serialize(const envoy_service_listener_v3_LdsDummy *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_service_listener_v3_LdsDummy_msginit, arena, len);
+}
+
+
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_SERVICE_LISTENER_V3_LDS_PROTO_UPB_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.c
index 0f7f76e3322..0b084142920 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.c
@@ -1,55 +1,55 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/service/load_stats/v3/lrs.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include <stddef.h>
-#include "upb/msg.h"
-#include "envoy/service/load_stats/v3/lrs.upb.h"
-#include "envoy/config/core/v3/base.upb.h"
-#include "envoy/config/endpoint/v3/load_report.upb.h"
-#include "google/protobuf/duration.upb.h"
-#include "udpa/annotations/status.upb.h"
-#include "udpa/annotations/versioning.upb.h"
-#include "validate/validate.upb.h"
-
-#include "upb/port_def.inc"
-
-static const upb_msglayout *const envoy_service_load_stats_v3_LoadStatsRequest_submsgs[2] = {
- &envoy_config_core_v3_Node_msginit,
- &envoy_config_endpoint_v3_ClusterStats_msginit,
-};
-
-static const upb_msglayout_field envoy_service_load_stats_v3_LoadStatsRequest__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
- {2, UPB_SIZE(4, 8), 0, 1, 11, 3},
-};
-
-const upb_msglayout envoy_service_load_stats_v3_LoadStatsRequest_msginit = {
- &envoy_service_load_stats_v3_LoadStatsRequest_submsgs[0],
- &envoy_service_load_stats_v3_LoadStatsRequest__fields[0],
- UPB_SIZE(8, 16), 2, false,
-};
-
-static const upb_msglayout *const envoy_service_load_stats_v3_LoadStatsResponse_submsgs[1] = {
- &google_protobuf_Duration_msginit,
-};
-
-static const upb_msglayout_field envoy_service_load_stats_v3_LoadStatsResponse__fields[4] = {
- {1, UPB_SIZE(8, 16), 0, 0, 9, 3},
- {2, UPB_SIZE(4, 8), 0, 0, 11, 1},
- {3, UPB_SIZE(0, 0), 0, 0, 8, 1},
- {4, UPB_SIZE(1, 1), 0, 0, 8, 1},
-};
-
-const upb_msglayout envoy_service_load_stats_v3_LoadStatsResponse_msginit = {
- &envoy_service_load_stats_v3_LoadStatsResponse_submsgs[0],
- &envoy_service_load_stats_v3_LoadStatsResponse__fields[0],
- UPB_SIZE(12, 24), 4, false,
-};
-
-#include "upb/port_undef.inc"
-
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/service/load_stats/v3/lrs.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg.h"
+#include "envoy/service/load_stats/v3/lrs.upb.h"
+#include "envoy/config/core/v3/base.upb.h"
+#include "envoy/config/endpoint/v3/load_report.upb.h"
+#include "google/protobuf/duration.upb.h"
+#include "udpa/annotations/status.upb.h"
+#include "udpa/annotations/versioning.upb.h"
+#include "validate/validate.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_msglayout *const envoy_service_load_stats_v3_LoadStatsRequest_submsgs[2] = {
+ &envoy_config_core_v3_Node_msginit,
+ &envoy_config_endpoint_v3_ClusterStats_msginit,
+};
+
+static const upb_msglayout_field envoy_service_load_stats_v3_LoadStatsRequest__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
+ {2, UPB_SIZE(4, 8), 0, 1, 11, 3},
+};
+
+const upb_msglayout envoy_service_load_stats_v3_LoadStatsRequest_msginit = {
+ &envoy_service_load_stats_v3_LoadStatsRequest_submsgs[0],
+ &envoy_service_load_stats_v3_LoadStatsRequest__fields[0],
+ UPB_SIZE(8, 16), 2, false,
+};
+
+static const upb_msglayout *const envoy_service_load_stats_v3_LoadStatsResponse_submsgs[1] = {
+ &google_protobuf_Duration_msginit,
+};
+
+static const upb_msglayout_field envoy_service_load_stats_v3_LoadStatsResponse__fields[4] = {
+ {1, UPB_SIZE(8, 16), 0, 0, 9, 3},
+ {2, UPB_SIZE(4, 8), 0, 0, 11, 1},
+ {3, UPB_SIZE(0, 0), 0, 0, 8, 1},
+ {4, UPB_SIZE(1, 1), 0, 0, 8, 1},
+};
+
+const upb_msglayout envoy_service_load_stats_v3_LoadStatsResponse_msginit = {
+ &envoy_service_load_stats_v3_LoadStatsResponse_submsgs[0],
+ &envoy_service_load_stats_v3_LoadStatsResponse__fields[0],
+ UPB_SIZE(12, 24), 4, false,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.h
index 813082f7d94..0ec4da5c363 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.h
@@ -1,136 +1,136 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/service/load_stats/v3/lrs.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef ENVOY_SERVICE_LOAD_STATS_V3_LRS_PROTO_UPB_H_
-#define ENVOY_SERVICE_LOAD_STATS_V3_LRS_PROTO_UPB_H_
-
-#include "upb/msg.h"
-#include "upb/decode.h"
-#include "upb/encode.h"
-
-#include "upb/port_def.inc"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct envoy_service_load_stats_v3_LoadStatsRequest;
-struct envoy_service_load_stats_v3_LoadStatsResponse;
-typedef struct envoy_service_load_stats_v3_LoadStatsRequest envoy_service_load_stats_v3_LoadStatsRequest;
-typedef struct envoy_service_load_stats_v3_LoadStatsResponse envoy_service_load_stats_v3_LoadStatsResponse;
-extern const upb_msglayout envoy_service_load_stats_v3_LoadStatsRequest_msginit;
-extern const upb_msglayout envoy_service_load_stats_v3_LoadStatsResponse_msginit;
-struct envoy_config_core_v3_Node;
-struct envoy_config_endpoint_v3_ClusterStats;
-struct google_protobuf_Duration;
-extern const upb_msglayout envoy_config_core_v3_Node_msginit;
-extern const upb_msglayout envoy_config_endpoint_v3_ClusterStats_msginit;
-extern const upb_msglayout google_protobuf_Duration_msginit;
-
-
-/* envoy.service.load_stats.v3.LoadStatsRequest */
-
-UPB_INLINE envoy_service_load_stats_v3_LoadStatsRequest *envoy_service_load_stats_v3_LoadStatsRequest_new(upb_arena *arena) {
- return (envoy_service_load_stats_v3_LoadStatsRequest *)_upb_msg_new(&envoy_service_load_stats_v3_LoadStatsRequest_msginit, arena);
-}
-UPB_INLINE envoy_service_load_stats_v3_LoadStatsRequest *envoy_service_load_stats_v3_LoadStatsRequest_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_service_load_stats_v3_LoadStatsRequest *ret = envoy_service_load_stats_v3_LoadStatsRequest_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_service_load_stats_v3_LoadStatsRequest_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_service_load_stats_v3_LoadStatsRequest_serialize(const envoy_service_load_stats_v3_LoadStatsRequest *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_service_load_stats_v3_LoadStatsRequest_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_service_load_stats_v3_LoadStatsRequest_has_node(const envoy_service_load_stats_v3_LoadStatsRequest *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE const struct envoy_config_core_v3_Node* envoy_service_load_stats_v3_LoadStatsRequest_node(const envoy_service_load_stats_v3_LoadStatsRequest *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct envoy_config_core_v3_Node*); }
-UPB_INLINE bool envoy_service_load_stats_v3_LoadStatsRequest_has_cluster_stats(const envoy_service_load_stats_v3_LoadStatsRequest *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
-UPB_INLINE const struct envoy_config_endpoint_v3_ClusterStats* const* envoy_service_load_stats_v3_LoadStatsRequest_cluster_stats(const envoy_service_load_stats_v3_LoadStatsRequest *msg, size_t *len) { return (const struct envoy_config_endpoint_v3_ClusterStats* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len); }
-
-UPB_INLINE void envoy_service_load_stats_v3_LoadStatsRequest_set_node(envoy_service_load_stats_v3_LoadStatsRequest *msg, struct envoy_config_core_v3_Node* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct envoy_config_core_v3_Node*) = value;
-}
-UPB_INLINE struct envoy_config_core_v3_Node* envoy_service_load_stats_v3_LoadStatsRequest_mutable_node(envoy_service_load_stats_v3_LoadStatsRequest *msg, upb_arena *arena) {
- struct envoy_config_core_v3_Node* sub = (struct envoy_config_core_v3_Node*)envoy_service_load_stats_v3_LoadStatsRequest_node(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_Node*)_upb_msg_new(&envoy_config_core_v3_Node_msginit, arena);
- if (!sub) return NULL;
- envoy_service_load_stats_v3_LoadStatsRequest_set_node(msg, sub);
- }
- return sub;
-}
-UPB_INLINE struct envoy_config_endpoint_v3_ClusterStats** envoy_service_load_stats_v3_LoadStatsRequest_mutable_cluster_stats(envoy_service_load_stats_v3_LoadStatsRequest *msg, size_t *len) {
- return (struct envoy_config_endpoint_v3_ClusterStats**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len);
-}
-UPB_INLINE struct envoy_config_endpoint_v3_ClusterStats** envoy_service_load_stats_v3_LoadStatsRequest_resize_cluster_stats(envoy_service_load_stats_v3_LoadStatsRequest *msg, size_t len, upb_arena *arena) {
- return (struct envoy_config_endpoint_v3_ClusterStats**)_upb_array_resize_accessor(msg, UPB_SIZE(4, 8), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_config_endpoint_v3_ClusterStats* envoy_service_load_stats_v3_LoadStatsRequest_add_cluster_stats(envoy_service_load_stats_v3_LoadStatsRequest *msg, upb_arena *arena) {
- struct envoy_config_endpoint_v3_ClusterStats* sub = (struct envoy_config_endpoint_v3_ClusterStats*)_upb_msg_new(&envoy_config_endpoint_v3_ClusterStats_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(4, 8), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-
-/* envoy.service.load_stats.v3.LoadStatsResponse */
-
-UPB_INLINE envoy_service_load_stats_v3_LoadStatsResponse *envoy_service_load_stats_v3_LoadStatsResponse_new(upb_arena *arena) {
- return (envoy_service_load_stats_v3_LoadStatsResponse *)_upb_msg_new(&envoy_service_load_stats_v3_LoadStatsResponse_msginit, arena);
-}
-UPB_INLINE envoy_service_load_stats_v3_LoadStatsResponse *envoy_service_load_stats_v3_LoadStatsResponse_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_service_load_stats_v3_LoadStatsResponse *ret = envoy_service_load_stats_v3_LoadStatsResponse_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_service_load_stats_v3_LoadStatsResponse_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_service_load_stats_v3_LoadStatsResponse_serialize(const envoy_service_load_stats_v3_LoadStatsResponse *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_service_load_stats_v3_LoadStatsResponse_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview const* envoy_service_load_stats_v3_LoadStatsResponse_clusters(const envoy_service_load_stats_v3_LoadStatsResponse *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len); }
-UPB_INLINE bool envoy_service_load_stats_v3_LoadStatsResponse_has_load_reporting_interval(const envoy_service_load_stats_v3_LoadStatsResponse *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
-UPB_INLINE const struct google_protobuf_Duration* envoy_service_load_stats_v3_LoadStatsResponse_load_reporting_interval(const envoy_service_load_stats_v3_LoadStatsResponse *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_Duration*); }
-UPB_INLINE bool envoy_service_load_stats_v3_LoadStatsResponse_report_endpoint_granularity(const envoy_service_load_stats_v3_LoadStatsResponse *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); }
-UPB_INLINE bool envoy_service_load_stats_v3_LoadStatsResponse_send_all_clusters(const envoy_service_load_stats_v3_LoadStatsResponse *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); }
-
-UPB_INLINE upb_strview* envoy_service_load_stats_v3_LoadStatsResponse_mutable_clusters(envoy_service_load_stats_v3_LoadStatsResponse *msg, size_t *len) {
- return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len);
-}
-UPB_INLINE upb_strview* envoy_service_load_stats_v3_LoadStatsResponse_resize_clusters(envoy_service_load_stats_v3_LoadStatsResponse *msg, size_t len, upb_arena *arena) {
- return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(8, 16), len, UPB_TYPE_STRING, arena);
-}
-UPB_INLINE bool envoy_service_load_stats_v3_LoadStatsResponse_add_clusters(envoy_service_load_stats_v3_LoadStatsResponse *msg, upb_strview val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(8, 16), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
- arena);
-}
-UPB_INLINE void envoy_service_load_stats_v3_LoadStatsResponse_set_load_reporting_interval(envoy_service_load_stats_v3_LoadStatsResponse *msg, struct google_protobuf_Duration* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_Duration*) = value;
-}
-UPB_INLINE struct google_protobuf_Duration* envoy_service_load_stats_v3_LoadStatsResponse_mutable_load_reporting_interval(envoy_service_load_stats_v3_LoadStatsResponse *msg, upb_arena *arena) {
- struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_service_load_stats_v3_LoadStatsResponse_load_reporting_interval(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
- if (!sub) return NULL;
- envoy_service_load_stats_v3_LoadStatsResponse_set_load_reporting_interval(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_service_load_stats_v3_LoadStatsResponse_set_report_endpoint_granularity(envoy_service_load_stats_v3_LoadStatsResponse *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
-}
-UPB_INLINE void envoy_service_load_stats_v3_LoadStatsResponse_set_send_all_clusters(envoy_service_load_stats_v3_LoadStatsResponse *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* ENVOY_SERVICE_LOAD_STATS_V3_LRS_PROTO_UPB_H_ */
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/service/load_stats/v3/lrs.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_SERVICE_LOAD_STATS_V3_LRS_PROTO_UPB_H_
+#define ENVOY_SERVICE_LOAD_STATS_V3_LRS_PROTO_UPB_H_
+
+#include "upb/msg.h"
+#include "upb/decode.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_service_load_stats_v3_LoadStatsRequest;
+struct envoy_service_load_stats_v3_LoadStatsResponse;
+typedef struct envoy_service_load_stats_v3_LoadStatsRequest envoy_service_load_stats_v3_LoadStatsRequest;
+typedef struct envoy_service_load_stats_v3_LoadStatsResponse envoy_service_load_stats_v3_LoadStatsResponse;
+extern const upb_msglayout envoy_service_load_stats_v3_LoadStatsRequest_msginit;
+extern const upb_msglayout envoy_service_load_stats_v3_LoadStatsResponse_msginit;
+struct envoy_config_core_v3_Node;
+struct envoy_config_endpoint_v3_ClusterStats;
+struct google_protobuf_Duration;
+extern const upb_msglayout envoy_config_core_v3_Node_msginit;
+extern const upb_msglayout envoy_config_endpoint_v3_ClusterStats_msginit;
+extern const upb_msglayout google_protobuf_Duration_msginit;
+
+
+/* envoy.service.load_stats.v3.LoadStatsRequest */
+
+UPB_INLINE envoy_service_load_stats_v3_LoadStatsRequest *envoy_service_load_stats_v3_LoadStatsRequest_new(upb_arena *arena) {
+ return (envoy_service_load_stats_v3_LoadStatsRequest *)_upb_msg_new(&envoy_service_load_stats_v3_LoadStatsRequest_msginit, arena);
+}
+UPB_INLINE envoy_service_load_stats_v3_LoadStatsRequest *envoy_service_load_stats_v3_LoadStatsRequest_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_service_load_stats_v3_LoadStatsRequest *ret = envoy_service_load_stats_v3_LoadStatsRequest_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_service_load_stats_v3_LoadStatsRequest_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_service_load_stats_v3_LoadStatsRequest_serialize(const envoy_service_load_stats_v3_LoadStatsRequest *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_service_load_stats_v3_LoadStatsRequest_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_service_load_stats_v3_LoadStatsRequest_has_node(const envoy_service_load_stats_v3_LoadStatsRequest *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE const struct envoy_config_core_v3_Node* envoy_service_load_stats_v3_LoadStatsRequest_node(const envoy_service_load_stats_v3_LoadStatsRequest *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct envoy_config_core_v3_Node*); }
+UPB_INLINE bool envoy_service_load_stats_v3_LoadStatsRequest_has_cluster_stats(const envoy_service_load_stats_v3_LoadStatsRequest *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
+UPB_INLINE const struct envoy_config_endpoint_v3_ClusterStats* const* envoy_service_load_stats_v3_LoadStatsRequest_cluster_stats(const envoy_service_load_stats_v3_LoadStatsRequest *msg, size_t *len) { return (const struct envoy_config_endpoint_v3_ClusterStats* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len); }
+
+UPB_INLINE void envoy_service_load_stats_v3_LoadStatsRequest_set_node(envoy_service_load_stats_v3_LoadStatsRequest *msg, struct envoy_config_core_v3_Node* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct envoy_config_core_v3_Node*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_Node* envoy_service_load_stats_v3_LoadStatsRequest_mutable_node(envoy_service_load_stats_v3_LoadStatsRequest *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_Node* sub = (struct envoy_config_core_v3_Node*)envoy_service_load_stats_v3_LoadStatsRequest_node(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_Node*)_upb_msg_new(&envoy_config_core_v3_Node_msginit, arena);
+ if (!sub) return NULL;
+ envoy_service_load_stats_v3_LoadStatsRequest_set_node(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE struct envoy_config_endpoint_v3_ClusterStats** envoy_service_load_stats_v3_LoadStatsRequest_mutable_cluster_stats(envoy_service_load_stats_v3_LoadStatsRequest *msg, size_t *len) {
+ return (struct envoy_config_endpoint_v3_ClusterStats**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len);
+}
+UPB_INLINE struct envoy_config_endpoint_v3_ClusterStats** envoy_service_load_stats_v3_LoadStatsRequest_resize_cluster_stats(envoy_service_load_stats_v3_LoadStatsRequest *msg, size_t len, upb_arena *arena) {
+ return (struct envoy_config_endpoint_v3_ClusterStats**)_upb_array_resize_accessor(msg, UPB_SIZE(4, 8), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_config_endpoint_v3_ClusterStats* envoy_service_load_stats_v3_LoadStatsRequest_add_cluster_stats(envoy_service_load_stats_v3_LoadStatsRequest *msg, upb_arena *arena) {
+ struct envoy_config_endpoint_v3_ClusterStats* sub = (struct envoy_config_endpoint_v3_ClusterStats*)_upb_msg_new(&envoy_config_endpoint_v3_ClusterStats_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(4, 8), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+
+/* envoy.service.load_stats.v3.LoadStatsResponse */
+
+UPB_INLINE envoy_service_load_stats_v3_LoadStatsResponse *envoy_service_load_stats_v3_LoadStatsResponse_new(upb_arena *arena) {
+ return (envoy_service_load_stats_v3_LoadStatsResponse *)_upb_msg_new(&envoy_service_load_stats_v3_LoadStatsResponse_msginit, arena);
+}
+UPB_INLINE envoy_service_load_stats_v3_LoadStatsResponse *envoy_service_load_stats_v3_LoadStatsResponse_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_service_load_stats_v3_LoadStatsResponse *ret = envoy_service_load_stats_v3_LoadStatsResponse_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_service_load_stats_v3_LoadStatsResponse_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_service_load_stats_v3_LoadStatsResponse_serialize(const envoy_service_load_stats_v3_LoadStatsResponse *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_service_load_stats_v3_LoadStatsResponse_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview const* envoy_service_load_stats_v3_LoadStatsResponse_clusters(const envoy_service_load_stats_v3_LoadStatsResponse *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len); }
+UPB_INLINE bool envoy_service_load_stats_v3_LoadStatsResponse_has_load_reporting_interval(const envoy_service_load_stats_v3_LoadStatsResponse *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
+UPB_INLINE const struct google_protobuf_Duration* envoy_service_load_stats_v3_LoadStatsResponse_load_reporting_interval(const envoy_service_load_stats_v3_LoadStatsResponse *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_Duration*); }
+UPB_INLINE bool envoy_service_load_stats_v3_LoadStatsResponse_report_endpoint_granularity(const envoy_service_load_stats_v3_LoadStatsResponse *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); }
+UPB_INLINE bool envoy_service_load_stats_v3_LoadStatsResponse_send_all_clusters(const envoy_service_load_stats_v3_LoadStatsResponse *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); }
+
+UPB_INLINE upb_strview* envoy_service_load_stats_v3_LoadStatsResponse_mutable_clusters(envoy_service_load_stats_v3_LoadStatsResponse *msg, size_t *len) {
+ return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len);
+}
+UPB_INLINE upb_strview* envoy_service_load_stats_v3_LoadStatsResponse_resize_clusters(envoy_service_load_stats_v3_LoadStatsResponse *msg, size_t len, upb_arena *arena) {
+ return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(8, 16), len, UPB_TYPE_STRING, arena);
+}
+UPB_INLINE bool envoy_service_load_stats_v3_LoadStatsResponse_add_clusters(envoy_service_load_stats_v3_LoadStatsResponse *msg, upb_strview val, upb_arena *arena) {
+ return _upb_array_append_accessor(msg, UPB_SIZE(8, 16), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
+ arena);
+}
+UPB_INLINE void envoy_service_load_stats_v3_LoadStatsResponse_set_load_reporting_interval(envoy_service_load_stats_v3_LoadStatsResponse *msg, struct google_protobuf_Duration* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_Duration*) = value;
+}
+UPB_INLINE struct google_protobuf_Duration* envoy_service_load_stats_v3_LoadStatsResponse_mutable_load_reporting_interval(envoy_service_load_stats_v3_LoadStatsResponse *msg, upb_arena *arena) {
+ struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_service_load_stats_v3_LoadStatsResponse_load_reporting_interval(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
+ if (!sub) return NULL;
+ envoy_service_load_stats_v3_LoadStatsResponse_set_load_reporting_interval(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_service_load_stats_v3_LoadStatsResponse_set_report_endpoint_granularity(envoy_service_load_stats_v3_LoadStatsResponse *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
+}
+UPB_INLINE void envoy_service_load_stats_v3_LoadStatsResponse_set_send_all_clusters(envoy_service_load_stats_v3_LoadStatsResponse *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_SERVICE_LOAD_STATS_V3_LRS_PROTO_UPB_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/route/v3/rds.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/route/v3/rds.upb.c
index 059c890c921..56e83f9ba9f 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/route/v3/rds.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/route/v3/rds.upb.c
@@ -1,29 +1,29 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/service/route/v3/rds.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include <stddef.h>
-#include "upb/msg.h"
-#include "envoy/service/route/v3/rds.upb.h"
-#include "envoy/service/discovery/v3/discovery.upb.h"
-#include "google/api/annotations.upb.h"
-#include "google/protobuf/wrappers.upb.h"
-#include "envoy/annotations/resource.upb.h"
-#include "udpa/annotations/status.upb.h"
-#include "udpa/annotations/versioning.upb.h"
-#include "validate/validate.upb.h"
-
-#include "upb/port_def.inc"
-
-const upb_msglayout envoy_service_route_v3_RdsDummy_msginit = {
- NULL,
- NULL,
- UPB_SIZE(0, 0), 0, false,
-};
-
-#include "upb/port_undef.inc"
-
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/service/route/v3/rds.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg.h"
+#include "envoy/service/route/v3/rds.upb.h"
+#include "envoy/service/discovery/v3/discovery.upb.h"
+#include "google/api/annotations.upb.h"
+#include "google/protobuf/wrappers.upb.h"
+#include "envoy/annotations/resource.upb.h"
+#include "udpa/annotations/status.upb.h"
+#include "udpa/annotations/versioning.upb.h"
+#include "validate/validate.upb.h"
+
+#include "upb/port_def.inc"
+
+const upb_msglayout envoy_service_route_v3_RdsDummy_msginit = {
+ NULL,
+ NULL,
+ UPB_SIZE(0, 0), 0, false,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/route/v3/rds.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/route/v3/rds.upb.h
index e764bb80c04..c7e4fa421dd 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/route/v3/rds.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/route/v3/rds.upb.h
@@ -1,49 +1,49 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/service/route/v3/rds.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef ENVOY_SERVICE_ROUTE_V3_RDS_PROTO_UPB_H_
-#define ENVOY_SERVICE_ROUTE_V3_RDS_PROTO_UPB_H_
-
-#include "upb/msg.h"
-#include "upb/decode.h"
-#include "upb/encode.h"
-
-#include "upb/port_def.inc"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct envoy_service_route_v3_RdsDummy;
-typedef struct envoy_service_route_v3_RdsDummy envoy_service_route_v3_RdsDummy;
-extern const upb_msglayout envoy_service_route_v3_RdsDummy_msginit;
-
-
-/* envoy.service.route.v3.RdsDummy */
-
-UPB_INLINE envoy_service_route_v3_RdsDummy *envoy_service_route_v3_RdsDummy_new(upb_arena *arena) {
- return (envoy_service_route_v3_RdsDummy *)_upb_msg_new(&envoy_service_route_v3_RdsDummy_msginit, arena);
-}
-UPB_INLINE envoy_service_route_v3_RdsDummy *envoy_service_route_v3_RdsDummy_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_service_route_v3_RdsDummy *ret = envoy_service_route_v3_RdsDummy_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_service_route_v3_RdsDummy_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_service_route_v3_RdsDummy_serialize(const envoy_service_route_v3_RdsDummy *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_service_route_v3_RdsDummy_msginit, arena, len);
-}
-
-
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* ENVOY_SERVICE_ROUTE_V3_RDS_PROTO_UPB_H_ */
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/service/route/v3/rds.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_SERVICE_ROUTE_V3_RDS_PROTO_UPB_H_
+#define ENVOY_SERVICE_ROUTE_V3_RDS_PROTO_UPB_H_
+
+#include "upb/msg.h"
+#include "upb/decode.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_service_route_v3_RdsDummy;
+typedef struct envoy_service_route_v3_RdsDummy envoy_service_route_v3_RdsDummy;
+extern const upb_msglayout envoy_service_route_v3_RdsDummy_msginit;
+
+
+/* envoy.service.route.v3.RdsDummy */
+
+UPB_INLINE envoy_service_route_v3_RdsDummy *envoy_service_route_v3_RdsDummy_new(upb_arena *arena) {
+ return (envoy_service_route_v3_RdsDummy *)_upb_msg_new(&envoy_service_route_v3_RdsDummy_msginit, arena);
+}
+UPB_INLINE envoy_service_route_v3_RdsDummy *envoy_service_route_v3_RdsDummy_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_service_route_v3_RdsDummy *ret = envoy_service_route_v3_RdsDummy_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_service_route_v3_RdsDummy_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_service_route_v3_RdsDummy_serialize(const envoy_service_route_v3_RdsDummy *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_service_route_v3_RdsDummy_msginit, arena, len);
+}
+
+
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_SERVICE_ROUTE_V3_RDS_PROTO_UPB_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/route/v3/srds.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/route/v3/srds.upb.c
index 50030c4838d..12145377c64 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/route/v3/srds.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/route/v3/srds.upb.c
@@ -1,27 +1,27 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/service/route/v3/srds.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include <stddef.h>
-#include "upb/msg.h"
-#include "envoy/service/route/v3/srds.upb.h"
-#include "envoy/service/discovery/v3/discovery.upb.h"
-#include "google/api/annotations.upb.h"
-#include "envoy/annotations/resource.upb.h"
-#include "udpa/annotations/status.upb.h"
-#include "udpa/annotations/versioning.upb.h"
-
-#include "upb/port_def.inc"
-
-const upb_msglayout envoy_service_route_v3_SrdsDummy_msginit = {
- NULL,
- NULL,
- UPB_SIZE(0, 0), 0, false,
-};
-
-#include "upb/port_undef.inc"
-
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/service/route/v3/srds.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg.h"
+#include "envoy/service/route/v3/srds.upb.h"
+#include "envoy/service/discovery/v3/discovery.upb.h"
+#include "google/api/annotations.upb.h"
+#include "envoy/annotations/resource.upb.h"
+#include "udpa/annotations/status.upb.h"
+#include "udpa/annotations/versioning.upb.h"
+
+#include "upb/port_def.inc"
+
+const upb_msglayout envoy_service_route_v3_SrdsDummy_msginit = {
+ NULL,
+ NULL,
+ UPB_SIZE(0, 0), 0, false,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/route/v3/srds.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/route/v3/srds.upb.h
index 344c3a38814..504cffc9a5b 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/route/v3/srds.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/route/v3/srds.upb.h
@@ -1,49 +1,49 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/service/route/v3/srds.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef ENVOY_SERVICE_ROUTE_V3_SRDS_PROTO_UPB_H_
-#define ENVOY_SERVICE_ROUTE_V3_SRDS_PROTO_UPB_H_
-
-#include "upb/msg.h"
-#include "upb/decode.h"
-#include "upb/encode.h"
-
-#include "upb/port_def.inc"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct envoy_service_route_v3_SrdsDummy;
-typedef struct envoy_service_route_v3_SrdsDummy envoy_service_route_v3_SrdsDummy;
-extern const upb_msglayout envoy_service_route_v3_SrdsDummy_msginit;
-
-
-/* envoy.service.route.v3.SrdsDummy */
-
-UPB_INLINE envoy_service_route_v3_SrdsDummy *envoy_service_route_v3_SrdsDummy_new(upb_arena *arena) {
- return (envoy_service_route_v3_SrdsDummy *)_upb_msg_new(&envoy_service_route_v3_SrdsDummy_msginit, arena);
-}
-UPB_INLINE envoy_service_route_v3_SrdsDummy *envoy_service_route_v3_SrdsDummy_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_service_route_v3_SrdsDummy *ret = envoy_service_route_v3_SrdsDummy_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_service_route_v3_SrdsDummy_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_service_route_v3_SrdsDummy_serialize(const envoy_service_route_v3_SrdsDummy *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_service_route_v3_SrdsDummy_msginit, arena, len);
-}
-
-
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* ENVOY_SERVICE_ROUTE_V3_SRDS_PROTO_UPB_H_ */
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/service/route/v3/srds.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_SERVICE_ROUTE_V3_SRDS_PROTO_UPB_H_
+#define ENVOY_SERVICE_ROUTE_V3_SRDS_PROTO_UPB_H_
+
+#include "upb/msg.h"
+#include "upb/decode.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_service_route_v3_SrdsDummy;
+typedef struct envoy_service_route_v3_SrdsDummy envoy_service_route_v3_SrdsDummy;
+extern const upb_msglayout envoy_service_route_v3_SrdsDummy_msginit;
+
+
+/* envoy.service.route.v3.SrdsDummy */
+
+UPB_INLINE envoy_service_route_v3_SrdsDummy *envoy_service_route_v3_SrdsDummy_new(upb_arena *arena) {
+ return (envoy_service_route_v3_SrdsDummy *)_upb_msg_new(&envoy_service_route_v3_SrdsDummy_msginit, arena);
+}
+UPB_INLINE envoy_service_route_v3_SrdsDummy *envoy_service_route_v3_SrdsDummy_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_service_route_v3_SrdsDummy *ret = envoy_service_route_v3_SrdsDummy_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_service_route_v3_SrdsDummy_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_service_route_v3_SrdsDummy_serialize(const envoy_service_route_v3_SrdsDummy *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_service_route_v3_SrdsDummy_msginit, arena, len);
+}
+
+
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_SERVICE_ROUTE_V3_SRDS_PROTO_UPB_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.c
index 653d9a558c3..e5e4720354a 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.c
@@ -1,47 +1,47 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/type/matcher/v3/metadata.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include <stddef.h>
-#include "upb/msg.h"
-#include "envoy/type/matcher/v3/metadata.upb.h"
-#include "envoy/type/matcher/v3/value.upb.h"
-#include "udpa/annotations/status.upb.h"
-#include "udpa/annotations/versioning.upb.h"
-#include "validate/validate.upb.h"
-
-#include "upb/port_def.inc"
-
-static const upb_msglayout *const envoy_type_matcher_v3_MetadataMatcher_submsgs[2] = {
- &envoy_type_matcher_v3_MetadataMatcher_PathSegment_msginit,
- &envoy_type_matcher_v3_ValueMatcher_msginit,
-};
-
-static const upb_msglayout_field envoy_type_matcher_v3_MetadataMatcher__fields[3] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(12, 24), 0, 0, 11, 3},
- {3, UPB_SIZE(8, 16), 0, 1, 11, 1},
-};
-
-const upb_msglayout envoy_type_matcher_v3_MetadataMatcher_msginit = {
- &envoy_type_matcher_v3_MetadataMatcher_submsgs[0],
- &envoy_type_matcher_v3_MetadataMatcher__fields[0],
- UPB_SIZE(16, 32), 3, false,
-};
-
-static const upb_msglayout_field envoy_type_matcher_v3_MetadataMatcher_PathSegment__fields[1] = {
- {1, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 9, 1},
-};
-
-const upb_msglayout envoy_type_matcher_v3_MetadataMatcher_PathSegment_msginit = {
- NULL,
- &envoy_type_matcher_v3_MetadataMatcher_PathSegment__fields[0],
- UPB_SIZE(16, 32), 1, false,
-};
-
-#include "upb/port_undef.inc"
-
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/type/matcher/v3/metadata.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg.h"
+#include "envoy/type/matcher/v3/metadata.upb.h"
+#include "envoy/type/matcher/v3/value.upb.h"
+#include "udpa/annotations/status.upb.h"
+#include "udpa/annotations/versioning.upb.h"
+#include "validate/validate.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_msglayout *const envoy_type_matcher_v3_MetadataMatcher_submsgs[2] = {
+ &envoy_type_matcher_v3_MetadataMatcher_PathSegment_msginit,
+ &envoy_type_matcher_v3_ValueMatcher_msginit,
+};
+
+static const upb_msglayout_field envoy_type_matcher_v3_MetadataMatcher__fields[3] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {2, UPB_SIZE(12, 24), 0, 0, 11, 3},
+ {3, UPB_SIZE(8, 16), 0, 1, 11, 1},
+};
+
+const upb_msglayout envoy_type_matcher_v3_MetadataMatcher_msginit = {
+ &envoy_type_matcher_v3_MetadataMatcher_submsgs[0],
+ &envoy_type_matcher_v3_MetadataMatcher__fields[0],
+ UPB_SIZE(16, 32), 3, false,
+};
+
+static const upb_msglayout_field envoy_type_matcher_v3_MetadataMatcher_PathSegment__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 9, 1},
+};
+
+const upb_msglayout envoy_type_matcher_v3_MetadataMatcher_PathSegment_msginit = {
+ NULL,
+ &envoy_type_matcher_v3_MetadataMatcher_PathSegment__fields[0],
+ UPB_SIZE(16, 32), 1, false,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.h
index 6d44671ce58..71111fff169 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.h
@@ -1,114 +1,114 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/type/matcher/v3/metadata.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef ENVOY_TYPE_MATCHER_V3_METADATA_PROTO_UPB_H_
-#define ENVOY_TYPE_MATCHER_V3_METADATA_PROTO_UPB_H_
-
-#include "upb/msg.h"
-#include "upb/decode.h"
-#include "upb/encode.h"
-
-#include "upb/port_def.inc"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct envoy_type_matcher_v3_MetadataMatcher;
-struct envoy_type_matcher_v3_MetadataMatcher_PathSegment;
-typedef struct envoy_type_matcher_v3_MetadataMatcher envoy_type_matcher_v3_MetadataMatcher;
-typedef struct envoy_type_matcher_v3_MetadataMatcher_PathSegment envoy_type_matcher_v3_MetadataMatcher_PathSegment;
-extern const upb_msglayout envoy_type_matcher_v3_MetadataMatcher_msginit;
-extern const upb_msglayout envoy_type_matcher_v3_MetadataMatcher_PathSegment_msginit;
-struct envoy_type_matcher_v3_ValueMatcher;
-extern const upb_msglayout envoy_type_matcher_v3_ValueMatcher_msginit;
-
-
-/* envoy.type.matcher.v3.MetadataMatcher */
-
-UPB_INLINE envoy_type_matcher_v3_MetadataMatcher *envoy_type_matcher_v3_MetadataMatcher_new(upb_arena *arena) {
- return (envoy_type_matcher_v3_MetadataMatcher *)_upb_msg_new(&envoy_type_matcher_v3_MetadataMatcher_msginit, arena);
-}
-UPB_INLINE envoy_type_matcher_v3_MetadataMatcher *envoy_type_matcher_v3_MetadataMatcher_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_type_matcher_v3_MetadataMatcher *ret = envoy_type_matcher_v3_MetadataMatcher_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_type_matcher_v3_MetadataMatcher_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_type_matcher_v3_MetadataMatcher_serialize(const envoy_type_matcher_v3_MetadataMatcher *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_type_matcher_v3_MetadataMatcher_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview envoy_type_matcher_v3_MetadataMatcher_filter(const envoy_type_matcher_v3_MetadataMatcher *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE bool envoy_type_matcher_v3_MetadataMatcher_has_path(const envoy_type_matcher_v3_MetadataMatcher *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
-UPB_INLINE const envoy_type_matcher_v3_MetadataMatcher_PathSegment* const* envoy_type_matcher_v3_MetadataMatcher_path(const envoy_type_matcher_v3_MetadataMatcher *msg, size_t *len) { return (const envoy_type_matcher_v3_MetadataMatcher_PathSegment* const*)_upb_array_accessor(msg, UPB_SIZE(12, 24), len); }
-UPB_INLINE bool envoy_type_matcher_v3_MetadataMatcher_has_value(const envoy_type_matcher_v3_MetadataMatcher *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const struct envoy_type_matcher_v3_ValueMatcher* envoy_type_matcher_v3_MetadataMatcher_value(const envoy_type_matcher_v3_MetadataMatcher *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct envoy_type_matcher_v3_ValueMatcher*); }
-
-UPB_INLINE void envoy_type_matcher_v3_MetadataMatcher_set_filter(envoy_type_matcher_v3_MetadataMatcher *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-UPB_INLINE envoy_type_matcher_v3_MetadataMatcher_PathSegment** envoy_type_matcher_v3_MetadataMatcher_mutable_path(envoy_type_matcher_v3_MetadataMatcher *msg, size_t *len) {
- return (envoy_type_matcher_v3_MetadataMatcher_PathSegment**)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 24), len);
-}
-UPB_INLINE envoy_type_matcher_v3_MetadataMatcher_PathSegment** envoy_type_matcher_v3_MetadataMatcher_resize_path(envoy_type_matcher_v3_MetadataMatcher *msg, size_t len, upb_arena *arena) {
- return (envoy_type_matcher_v3_MetadataMatcher_PathSegment**)_upb_array_resize_accessor(msg, UPB_SIZE(12, 24), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_type_matcher_v3_MetadataMatcher_PathSegment* envoy_type_matcher_v3_MetadataMatcher_add_path(envoy_type_matcher_v3_MetadataMatcher *msg, upb_arena *arena) {
- struct envoy_type_matcher_v3_MetadataMatcher_PathSegment* sub = (struct envoy_type_matcher_v3_MetadataMatcher_PathSegment*)_upb_msg_new(&envoy_type_matcher_v3_MetadataMatcher_PathSegment_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(12, 24), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-UPB_INLINE void envoy_type_matcher_v3_MetadataMatcher_set_value(envoy_type_matcher_v3_MetadataMatcher *msg, struct envoy_type_matcher_v3_ValueMatcher* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct envoy_type_matcher_v3_ValueMatcher*) = value;
-}
-UPB_INLINE struct envoy_type_matcher_v3_ValueMatcher* envoy_type_matcher_v3_MetadataMatcher_mutable_value(envoy_type_matcher_v3_MetadataMatcher *msg, upb_arena *arena) {
- struct envoy_type_matcher_v3_ValueMatcher* sub = (struct envoy_type_matcher_v3_ValueMatcher*)envoy_type_matcher_v3_MetadataMatcher_value(msg);
- if (sub == NULL) {
- sub = (struct envoy_type_matcher_v3_ValueMatcher*)_upb_msg_new(&envoy_type_matcher_v3_ValueMatcher_msginit, arena);
- if (!sub) return NULL;
- envoy_type_matcher_v3_MetadataMatcher_set_value(msg, sub);
- }
- return sub;
-}
-
-/* envoy.type.matcher.v3.MetadataMatcher.PathSegment */
-
-UPB_INLINE envoy_type_matcher_v3_MetadataMatcher_PathSegment *envoy_type_matcher_v3_MetadataMatcher_PathSegment_new(upb_arena *arena) {
- return (envoy_type_matcher_v3_MetadataMatcher_PathSegment *)_upb_msg_new(&envoy_type_matcher_v3_MetadataMatcher_PathSegment_msginit, arena);
-}
-UPB_INLINE envoy_type_matcher_v3_MetadataMatcher_PathSegment *envoy_type_matcher_v3_MetadataMatcher_PathSegment_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_type_matcher_v3_MetadataMatcher_PathSegment *ret = envoy_type_matcher_v3_MetadataMatcher_PathSegment_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_type_matcher_v3_MetadataMatcher_PathSegment_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_type_matcher_v3_MetadataMatcher_PathSegment_serialize(const envoy_type_matcher_v3_MetadataMatcher_PathSegment *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_type_matcher_v3_MetadataMatcher_PathSegment_msginit, arena, len);
-}
-
-typedef enum {
- envoy_type_matcher_v3_MetadataMatcher_PathSegment_segment_key = 1,
- envoy_type_matcher_v3_MetadataMatcher_PathSegment_segment_NOT_SET = 0
-} envoy_type_matcher_v3_MetadataMatcher_PathSegment_segment_oneofcases;
-UPB_INLINE envoy_type_matcher_v3_MetadataMatcher_PathSegment_segment_oneofcases envoy_type_matcher_v3_MetadataMatcher_PathSegment_segment_case(const envoy_type_matcher_v3_MetadataMatcher_PathSegment* msg) { return (envoy_type_matcher_v3_MetadataMatcher_PathSegment_segment_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(8, 16), int32_t); }
-
-UPB_INLINE bool envoy_type_matcher_v3_MetadataMatcher_PathSegment_has_key(const envoy_type_matcher_v3_MetadataMatcher_PathSegment *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 1; }
-UPB_INLINE upb_strview envoy_type_matcher_v3_MetadataMatcher_PathSegment_key(const envoy_type_matcher_v3_MetadataMatcher_PathSegment *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 1, upb_strview_make("", strlen(""))); }
-
-UPB_INLINE void envoy_type_matcher_v3_MetadataMatcher_PathSegment_set_key(envoy_type_matcher_v3_MetadataMatcher_PathSegment *msg, upb_strview value) {
- UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 1);
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* ENVOY_TYPE_MATCHER_V3_METADATA_PROTO_UPB_H_ */
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/type/matcher/v3/metadata.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_TYPE_MATCHER_V3_METADATA_PROTO_UPB_H_
+#define ENVOY_TYPE_MATCHER_V3_METADATA_PROTO_UPB_H_
+
+#include "upb/msg.h"
+#include "upb/decode.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_type_matcher_v3_MetadataMatcher;
+struct envoy_type_matcher_v3_MetadataMatcher_PathSegment;
+typedef struct envoy_type_matcher_v3_MetadataMatcher envoy_type_matcher_v3_MetadataMatcher;
+typedef struct envoy_type_matcher_v3_MetadataMatcher_PathSegment envoy_type_matcher_v3_MetadataMatcher_PathSegment;
+extern const upb_msglayout envoy_type_matcher_v3_MetadataMatcher_msginit;
+extern const upb_msglayout envoy_type_matcher_v3_MetadataMatcher_PathSegment_msginit;
+struct envoy_type_matcher_v3_ValueMatcher;
+extern const upb_msglayout envoy_type_matcher_v3_ValueMatcher_msginit;
+
+
+/* envoy.type.matcher.v3.MetadataMatcher */
+
+UPB_INLINE envoy_type_matcher_v3_MetadataMatcher *envoy_type_matcher_v3_MetadataMatcher_new(upb_arena *arena) {
+ return (envoy_type_matcher_v3_MetadataMatcher *)_upb_msg_new(&envoy_type_matcher_v3_MetadataMatcher_msginit, arena);
+}
+UPB_INLINE envoy_type_matcher_v3_MetadataMatcher *envoy_type_matcher_v3_MetadataMatcher_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_type_matcher_v3_MetadataMatcher *ret = envoy_type_matcher_v3_MetadataMatcher_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_type_matcher_v3_MetadataMatcher_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_type_matcher_v3_MetadataMatcher_serialize(const envoy_type_matcher_v3_MetadataMatcher *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_type_matcher_v3_MetadataMatcher_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview envoy_type_matcher_v3_MetadataMatcher_filter(const envoy_type_matcher_v3_MetadataMatcher *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE bool envoy_type_matcher_v3_MetadataMatcher_has_path(const envoy_type_matcher_v3_MetadataMatcher *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
+UPB_INLINE const envoy_type_matcher_v3_MetadataMatcher_PathSegment* const* envoy_type_matcher_v3_MetadataMatcher_path(const envoy_type_matcher_v3_MetadataMatcher *msg, size_t *len) { return (const envoy_type_matcher_v3_MetadataMatcher_PathSegment* const*)_upb_array_accessor(msg, UPB_SIZE(12, 24), len); }
+UPB_INLINE bool envoy_type_matcher_v3_MetadataMatcher_has_value(const envoy_type_matcher_v3_MetadataMatcher *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
+UPB_INLINE const struct envoy_type_matcher_v3_ValueMatcher* envoy_type_matcher_v3_MetadataMatcher_value(const envoy_type_matcher_v3_MetadataMatcher *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct envoy_type_matcher_v3_ValueMatcher*); }
+
+UPB_INLINE void envoy_type_matcher_v3_MetadataMatcher_set_filter(envoy_type_matcher_v3_MetadataMatcher *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+UPB_INLINE envoy_type_matcher_v3_MetadataMatcher_PathSegment** envoy_type_matcher_v3_MetadataMatcher_mutable_path(envoy_type_matcher_v3_MetadataMatcher *msg, size_t *len) {
+ return (envoy_type_matcher_v3_MetadataMatcher_PathSegment**)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 24), len);
+}
+UPB_INLINE envoy_type_matcher_v3_MetadataMatcher_PathSegment** envoy_type_matcher_v3_MetadataMatcher_resize_path(envoy_type_matcher_v3_MetadataMatcher *msg, size_t len, upb_arena *arena) {
+ return (envoy_type_matcher_v3_MetadataMatcher_PathSegment**)_upb_array_resize_accessor(msg, UPB_SIZE(12, 24), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_type_matcher_v3_MetadataMatcher_PathSegment* envoy_type_matcher_v3_MetadataMatcher_add_path(envoy_type_matcher_v3_MetadataMatcher *msg, upb_arena *arena) {
+ struct envoy_type_matcher_v3_MetadataMatcher_PathSegment* sub = (struct envoy_type_matcher_v3_MetadataMatcher_PathSegment*)_upb_msg_new(&envoy_type_matcher_v3_MetadataMatcher_PathSegment_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(12, 24), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE void envoy_type_matcher_v3_MetadataMatcher_set_value(envoy_type_matcher_v3_MetadataMatcher *msg, struct envoy_type_matcher_v3_ValueMatcher* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct envoy_type_matcher_v3_ValueMatcher*) = value;
+}
+UPB_INLINE struct envoy_type_matcher_v3_ValueMatcher* envoy_type_matcher_v3_MetadataMatcher_mutable_value(envoy_type_matcher_v3_MetadataMatcher *msg, upb_arena *arena) {
+ struct envoy_type_matcher_v3_ValueMatcher* sub = (struct envoy_type_matcher_v3_ValueMatcher*)envoy_type_matcher_v3_MetadataMatcher_value(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_type_matcher_v3_ValueMatcher*)_upb_msg_new(&envoy_type_matcher_v3_ValueMatcher_msginit, arena);
+ if (!sub) return NULL;
+ envoy_type_matcher_v3_MetadataMatcher_set_value(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.type.matcher.v3.MetadataMatcher.PathSegment */
+
+UPB_INLINE envoy_type_matcher_v3_MetadataMatcher_PathSegment *envoy_type_matcher_v3_MetadataMatcher_PathSegment_new(upb_arena *arena) {
+ return (envoy_type_matcher_v3_MetadataMatcher_PathSegment *)_upb_msg_new(&envoy_type_matcher_v3_MetadataMatcher_PathSegment_msginit, arena);
+}
+UPB_INLINE envoy_type_matcher_v3_MetadataMatcher_PathSegment *envoy_type_matcher_v3_MetadataMatcher_PathSegment_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_type_matcher_v3_MetadataMatcher_PathSegment *ret = envoy_type_matcher_v3_MetadataMatcher_PathSegment_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_type_matcher_v3_MetadataMatcher_PathSegment_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_type_matcher_v3_MetadataMatcher_PathSegment_serialize(const envoy_type_matcher_v3_MetadataMatcher_PathSegment *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_type_matcher_v3_MetadataMatcher_PathSegment_msginit, arena, len);
+}
+
+typedef enum {
+ envoy_type_matcher_v3_MetadataMatcher_PathSegment_segment_key = 1,
+ envoy_type_matcher_v3_MetadataMatcher_PathSegment_segment_NOT_SET = 0
+} envoy_type_matcher_v3_MetadataMatcher_PathSegment_segment_oneofcases;
+UPB_INLINE envoy_type_matcher_v3_MetadataMatcher_PathSegment_segment_oneofcases envoy_type_matcher_v3_MetadataMatcher_PathSegment_segment_case(const envoy_type_matcher_v3_MetadataMatcher_PathSegment* msg) { return (envoy_type_matcher_v3_MetadataMatcher_PathSegment_segment_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(8, 16), int32_t); }
+
+UPB_INLINE bool envoy_type_matcher_v3_MetadataMatcher_PathSegment_has_key(const envoy_type_matcher_v3_MetadataMatcher_PathSegment *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 1; }
+UPB_INLINE upb_strview envoy_type_matcher_v3_MetadataMatcher_PathSegment_key(const envoy_type_matcher_v3_MetadataMatcher_PathSegment *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 1, upb_strview_make("", strlen(""))); }
+
+UPB_INLINE void envoy_type_matcher_v3_MetadataMatcher_PathSegment_set_key(envoy_type_matcher_v3_MetadataMatcher_PathSegment *msg, upb_strview value) {
+ UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 1);
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_TYPE_MATCHER_V3_METADATA_PROTO_UPB_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.c
index f2cb25cd799..7d61b981580 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.c
@@ -1,35 +1,35 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/type/matcher/v3/number.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include <stddef.h>
-#include "upb/msg.h"
-#include "envoy/type/matcher/v3/number.upb.h"
-#include "envoy/type/v3/range.upb.h"
-#include "udpa/annotations/status.upb.h"
-#include "udpa/annotations/versioning.upb.h"
-#include "validate/validate.upb.h"
-
-#include "upb/port_def.inc"
-
-static const upb_msglayout *const envoy_type_matcher_v3_DoubleMatcher_submsgs[1] = {
- &envoy_type_v3_DoubleRange_msginit,
-};
-
-static const upb_msglayout_field envoy_type_matcher_v3_DoubleMatcher__fields[2] = {
- {1, UPB_SIZE(0, 0), UPB_SIZE(-9, -9), 0, 11, 1},
- {2, UPB_SIZE(0, 0), UPB_SIZE(-9, -9), 0, 1, 1},
-};
-
-const upb_msglayout envoy_type_matcher_v3_DoubleMatcher_msginit = {
- &envoy_type_matcher_v3_DoubleMatcher_submsgs[0],
- &envoy_type_matcher_v3_DoubleMatcher__fields[0],
- UPB_SIZE(16, 16), 2, false,
-};
-
-#include "upb/port_undef.inc"
-
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/type/matcher/v3/number.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg.h"
+#include "envoy/type/matcher/v3/number.upb.h"
+#include "envoy/type/v3/range.upb.h"
+#include "udpa/annotations/status.upb.h"
+#include "udpa/annotations/versioning.upb.h"
+#include "validate/validate.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_msglayout *const envoy_type_matcher_v3_DoubleMatcher_submsgs[1] = {
+ &envoy_type_v3_DoubleRange_msginit,
+};
+
+static const upb_msglayout_field envoy_type_matcher_v3_DoubleMatcher__fields[2] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(-9, -9), 0, 11, 1},
+ {2, UPB_SIZE(0, 0), UPB_SIZE(-9, -9), 0, 1, 1},
+};
+
+const upb_msglayout envoy_type_matcher_v3_DoubleMatcher_msginit = {
+ &envoy_type_matcher_v3_DoubleMatcher_submsgs[0],
+ &envoy_type_matcher_v3_DoubleMatcher__fields[0],
+ UPB_SIZE(16, 16), 2, false,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.h
index e9a2746e0c1..a6112daf90f 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.h
@@ -1,77 +1,77 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/type/matcher/v3/number.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef ENVOY_TYPE_MATCHER_V3_NUMBER_PROTO_UPB_H_
-#define ENVOY_TYPE_MATCHER_V3_NUMBER_PROTO_UPB_H_
-
-#include "upb/msg.h"
-#include "upb/decode.h"
-#include "upb/encode.h"
-
-#include "upb/port_def.inc"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct envoy_type_matcher_v3_DoubleMatcher;
-typedef struct envoy_type_matcher_v3_DoubleMatcher envoy_type_matcher_v3_DoubleMatcher;
-extern const upb_msglayout envoy_type_matcher_v3_DoubleMatcher_msginit;
-struct envoy_type_v3_DoubleRange;
-extern const upb_msglayout envoy_type_v3_DoubleRange_msginit;
-
-
-/* envoy.type.matcher.v3.DoubleMatcher */
-
-UPB_INLINE envoy_type_matcher_v3_DoubleMatcher *envoy_type_matcher_v3_DoubleMatcher_new(upb_arena *arena) {
- return (envoy_type_matcher_v3_DoubleMatcher *)_upb_msg_new(&envoy_type_matcher_v3_DoubleMatcher_msginit, arena);
-}
-UPB_INLINE envoy_type_matcher_v3_DoubleMatcher *envoy_type_matcher_v3_DoubleMatcher_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_type_matcher_v3_DoubleMatcher *ret = envoy_type_matcher_v3_DoubleMatcher_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_type_matcher_v3_DoubleMatcher_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_type_matcher_v3_DoubleMatcher_serialize(const envoy_type_matcher_v3_DoubleMatcher *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_type_matcher_v3_DoubleMatcher_msginit, arena, len);
-}
-
-typedef enum {
- envoy_type_matcher_v3_DoubleMatcher_match_pattern_range = 1,
- envoy_type_matcher_v3_DoubleMatcher_match_pattern_exact = 2,
- envoy_type_matcher_v3_DoubleMatcher_match_pattern_NOT_SET = 0
-} envoy_type_matcher_v3_DoubleMatcher_match_pattern_oneofcases;
-UPB_INLINE envoy_type_matcher_v3_DoubleMatcher_match_pattern_oneofcases envoy_type_matcher_v3_DoubleMatcher_match_pattern_case(const envoy_type_matcher_v3_DoubleMatcher* msg) { return (envoy_type_matcher_v3_DoubleMatcher_match_pattern_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); }
-
-UPB_INLINE bool envoy_type_matcher_v3_DoubleMatcher_has_range(const envoy_type_matcher_v3_DoubleMatcher *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 8)) == 1; }
-UPB_INLINE const struct envoy_type_v3_DoubleRange* envoy_type_matcher_v3_DoubleMatcher_range(const envoy_type_matcher_v3_DoubleMatcher *msg) { return UPB_READ_ONEOF(msg, const struct envoy_type_v3_DoubleRange*, UPB_SIZE(0, 0), UPB_SIZE(8, 8), 1, NULL); }
-UPB_INLINE bool envoy_type_matcher_v3_DoubleMatcher_has_exact(const envoy_type_matcher_v3_DoubleMatcher *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 8)) == 2; }
-UPB_INLINE double envoy_type_matcher_v3_DoubleMatcher_exact(const envoy_type_matcher_v3_DoubleMatcher *msg) { return UPB_READ_ONEOF(msg, double, UPB_SIZE(0, 0), UPB_SIZE(8, 8), 2, 0); }
-
-UPB_INLINE void envoy_type_matcher_v3_DoubleMatcher_set_range(envoy_type_matcher_v3_DoubleMatcher *msg, struct envoy_type_v3_DoubleRange* value) {
- UPB_WRITE_ONEOF(msg, struct envoy_type_v3_DoubleRange*, UPB_SIZE(0, 0), value, UPB_SIZE(8, 8), 1);
-}
-UPB_INLINE struct envoy_type_v3_DoubleRange* envoy_type_matcher_v3_DoubleMatcher_mutable_range(envoy_type_matcher_v3_DoubleMatcher *msg, upb_arena *arena) {
- struct envoy_type_v3_DoubleRange* sub = (struct envoy_type_v3_DoubleRange*)envoy_type_matcher_v3_DoubleMatcher_range(msg);
- if (sub == NULL) {
- sub = (struct envoy_type_v3_DoubleRange*)_upb_msg_new(&envoy_type_v3_DoubleRange_msginit, arena);
- if (!sub) return NULL;
- envoy_type_matcher_v3_DoubleMatcher_set_range(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_type_matcher_v3_DoubleMatcher_set_exact(envoy_type_matcher_v3_DoubleMatcher *msg, double value) {
- UPB_WRITE_ONEOF(msg, double, UPB_SIZE(0, 0), value, UPB_SIZE(8, 8), 2);
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* ENVOY_TYPE_MATCHER_V3_NUMBER_PROTO_UPB_H_ */
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/type/matcher/v3/number.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_TYPE_MATCHER_V3_NUMBER_PROTO_UPB_H_
+#define ENVOY_TYPE_MATCHER_V3_NUMBER_PROTO_UPB_H_
+
+#include "upb/msg.h"
+#include "upb/decode.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_type_matcher_v3_DoubleMatcher;
+typedef struct envoy_type_matcher_v3_DoubleMatcher envoy_type_matcher_v3_DoubleMatcher;
+extern const upb_msglayout envoy_type_matcher_v3_DoubleMatcher_msginit;
+struct envoy_type_v3_DoubleRange;
+extern const upb_msglayout envoy_type_v3_DoubleRange_msginit;
+
+
+/* envoy.type.matcher.v3.DoubleMatcher */
+
+UPB_INLINE envoy_type_matcher_v3_DoubleMatcher *envoy_type_matcher_v3_DoubleMatcher_new(upb_arena *arena) {
+ return (envoy_type_matcher_v3_DoubleMatcher *)_upb_msg_new(&envoy_type_matcher_v3_DoubleMatcher_msginit, arena);
+}
+UPB_INLINE envoy_type_matcher_v3_DoubleMatcher *envoy_type_matcher_v3_DoubleMatcher_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_type_matcher_v3_DoubleMatcher *ret = envoy_type_matcher_v3_DoubleMatcher_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_type_matcher_v3_DoubleMatcher_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_type_matcher_v3_DoubleMatcher_serialize(const envoy_type_matcher_v3_DoubleMatcher *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_type_matcher_v3_DoubleMatcher_msginit, arena, len);
+}
+
+typedef enum {
+ envoy_type_matcher_v3_DoubleMatcher_match_pattern_range = 1,
+ envoy_type_matcher_v3_DoubleMatcher_match_pattern_exact = 2,
+ envoy_type_matcher_v3_DoubleMatcher_match_pattern_NOT_SET = 0
+} envoy_type_matcher_v3_DoubleMatcher_match_pattern_oneofcases;
+UPB_INLINE envoy_type_matcher_v3_DoubleMatcher_match_pattern_oneofcases envoy_type_matcher_v3_DoubleMatcher_match_pattern_case(const envoy_type_matcher_v3_DoubleMatcher* msg) { return (envoy_type_matcher_v3_DoubleMatcher_match_pattern_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); }
+
+UPB_INLINE bool envoy_type_matcher_v3_DoubleMatcher_has_range(const envoy_type_matcher_v3_DoubleMatcher *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 8)) == 1; }
+UPB_INLINE const struct envoy_type_v3_DoubleRange* envoy_type_matcher_v3_DoubleMatcher_range(const envoy_type_matcher_v3_DoubleMatcher *msg) { return UPB_READ_ONEOF(msg, const struct envoy_type_v3_DoubleRange*, UPB_SIZE(0, 0), UPB_SIZE(8, 8), 1, NULL); }
+UPB_INLINE bool envoy_type_matcher_v3_DoubleMatcher_has_exact(const envoy_type_matcher_v3_DoubleMatcher *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 8)) == 2; }
+UPB_INLINE double envoy_type_matcher_v3_DoubleMatcher_exact(const envoy_type_matcher_v3_DoubleMatcher *msg) { return UPB_READ_ONEOF(msg, double, UPB_SIZE(0, 0), UPB_SIZE(8, 8), 2, 0); }
+
+UPB_INLINE void envoy_type_matcher_v3_DoubleMatcher_set_range(envoy_type_matcher_v3_DoubleMatcher *msg, struct envoy_type_v3_DoubleRange* value) {
+ UPB_WRITE_ONEOF(msg, struct envoy_type_v3_DoubleRange*, UPB_SIZE(0, 0), value, UPB_SIZE(8, 8), 1);
+}
+UPB_INLINE struct envoy_type_v3_DoubleRange* envoy_type_matcher_v3_DoubleMatcher_mutable_range(envoy_type_matcher_v3_DoubleMatcher *msg, upb_arena *arena) {
+ struct envoy_type_v3_DoubleRange* sub = (struct envoy_type_v3_DoubleRange*)envoy_type_matcher_v3_DoubleMatcher_range(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_type_v3_DoubleRange*)_upb_msg_new(&envoy_type_v3_DoubleRange_msginit, arena);
+ if (!sub) return NULL;
+ envoy_type_matcher_v3_DoubleMatcher_set_range(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_type_matcher_v3_DoubleMatcher_set_exact(envoy_type_matcher_v3_DoubleMatcher *msg, double value) {
+ UPB_WRITE_ONEOF(msg, double, UPB_SIZE(0, 0), value, UPB_SIZE(8, 8), 2);
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_TYPE_MATCHER_V3_NUMBER_PROTO_UPB_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.c
index d6d20ac4655..0f0f080f048 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.c
@@ -1,34 +1,34 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/type/matcher/v3/path.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include <stddef.h>
-#include "upb/msg.h"
-#include "envoy/type/matcher/v3/path.upb.h"
-#include "envoy/type/matcher/v3/string.upb.h"
-#include "udpa/annotations/status.upb.h"
-#include "udpa/annotations/versioning.upb.h"
-#include "validate/validate.upb.h"
-
-#include "upb/port_def.inc"
-
-static const upb_msglayout *const envoy_type_matcher_v3_PathMatcher_submsgs[1] = {
- &envoy_type_matcher_v3_StringMatcher_msginit,
-};
-
-static const upb_msglayout_field envoy_type_matcher_v3_PathMatcher__fields[1] = {
- {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, 1},
-};
-
-const upb_msglayout envoy_type_matcher_v3_PathMatcher_msginit = {
- &envoy_type_matcher_v3_PathMatcher_submsgs[0],
- &envoy_type_matcher_v3_PathMatcher__fields[0],
- UPB_SIZE(8, 16), 1, false,
-};
-
-#include "upb/port_undef.inc"
-
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/type/matcher/v3/path.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg.h"
+#include "envoy/type/matcher/v3/path.upb.h"
+#include "envoy/type/matcher/v3/string.upb.h"
+#include "udpa/annotations/status.upb.h"
+#include "udpa/annotations/versioning.upb.h"
+#include "validate/validate.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_msglayout *const envoy_type_matcher_v3_PathMatcher_submsgs[1] = {
+ &envoy_type_matcher_v3_StringMatcher_msginit,
+};
+
+static const upb_msglayout_field envoy_type_matcher_v3_PathMatcher__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, 1},
+};
+
+const upb_msglayout envoy_type_matcher_v3_PathMatcher_msginit = {
+ &envoy_type_matcher_v3_PathMatcher_submsgs[0],
+ &envoy_type_matcher_v3_PathMatcher__fields[0],
+ UPB_SIZE(8, 16), 1, false,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.h
index 587d7553754..fb9910f9294 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.h
@@ -1,71 +1,71 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/type/matcher/v3/path.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef ENVOY_TYPE_MATCHER_V3_PATH_PROTO_UPB_H_
-#define ENVOY_TYPE_MATCHER_V3_PATH_PROTO_UPB_H_
-
-#include "upb/msg.h"
-#include "upb/decode.h"
-#include "upb/encode.h"
-
-#include "upb/port_def.inc"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct envoy_type_matcher_v3_PathMatcher;
-typedef struct envoy_type_matcher_v3_PathMatcher envoy_type_matcher_v3_PathMatcher;
-extern const upb_msglayout envoy_type_matcher_v3_PathMatcher_msginit;
-struct envoy_type_matcher_v3_StringMatcher;
-extern const upb_msglayout envoy_type_matcher_v3_StringMatcher_msginit;
-
-
-/* envoy.type.matcher.v3.PathMatcher */
-
-UPB_INLINE envoy_type_matcher_v3_PathMatcher *envoy_type_matcher_v3_PathMatcher_new(upb_arena *arena) {
- return (envoy_type_matcher_v3_PathMatcher *)_upb_msg_new(&envoy_type_matcher_v3_PathMatcher_msginit, arena);
-}
-UPB_INLINE envoy_type_matcher_v3_PathMatcher *envoy_type_matcher_v3_PathMatcher_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_type_matcher_v3_PathMatcher *ret = envoy_type_matcher_v3_PathMatcher_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_type_matcher_v3_PathMatcher_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_type_matcher_v3_PathMatcher_serialize(const envoy_type_matcher_v3_PathMatcher *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_type_matcher_v3_PathMatcher_msginit, arena, len);
-}
-
-typedef enum {
- envoy_type_matcher_v3_PathMatcher_rule_path = 1,
- envoy_type_matcher_v3_PathMatcher_rule_NOT_SET = 0
-} envoy_type_matcher_v3_PathMatcher_rule_oneofcases;
-UPB_INLINE envoy_type_matcher_v3_PathMatcher_rule_oneofcases envoy_type_matcher_v3_PathMatcher_rule_case(const envoy_type_matcher_v3_PathMatcher* msg) { return (envoy_type_matcher_v3_PathMatcher_rule_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 8), int32_t); }
-
-UPB_INLINE bool envoy_type_matcher_v3_PathMatcher_has_path(const envoy_type_matcher_v3_PathMatcher *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 1; }
-UPB_INLINE const struct envoy_type_matcher_v3_StringMatcher* envoy_type_matcher_v3_PathMatcher_path(const envoy_type_matcher_v3_PathMatcher *msg) { return UPB_READ_ONEOF(msg, const struct envoy_type_matcher_v3_StringMatcher*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 1, NULL); }
-
-UPB_INLINE void envoy_type_matcher_v3_PathMatcher_set_path(envoy_type_matcher_v3_PathMatcher *msg, struct envoy_type_matcher_v3_StringMatcher* value) {
- UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_StringMatcher*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 1);
-}
-UPB_INLINE struct envoy_type_matcher_v3_StringMatcher* envoy_type_matcher_v3_PathMatcher_mutable_path(envoy_type_matcher_v3_PathMatcher *msg, upb_arena *arena) {
- struct envoy_type_matcher_v3_StringMatcher* sub = (struct envoy_type_matcher_v3_StringMatcher*)envoy_type_matcher_v3_PathMatcher_path(msg);
- if (sub == NULL) {
- sub = (struct envoy_type_matcher_v3_StringMatcher*)_upb_msg_new(&envoy_type_matcher_v3_StringMatcher_msginit, arena);
- if (!sub) return NULL;
- envoy_type_matcher_v3_PathMatcher_set_path(msg, sub);
- }
- return sub;
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* ENVOY_TYPE_MATCHER_V3_PATH_PROTO_UPB_H_ */
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/type/matcher/v3/path.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_TYPE_MATCHER_V3_PATH_PROTO_UPB_H_
+#define ENVOY_TYPE_MATCHER_V3_PATH_PROTO_UPB_H_
+
+#include "upb/msg.h"
+#include "upb/decode.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_type_matcher_v3_PathMatcher;
+typedef struct envoy_type_matcher_v3_PathMatcher envoy_type_matcher_v3_PathMatcher;
+extern const upb_msglayout envoy_type_matcher_v3_PathMatcher_msginit;
+struct envoy_type_matcher_v3_StringMatcher;
+extern const upb_msglayout envoy_type_matcher_v3_StringMatcher_msginit;
+
+
+/* envoy.type.matcher.v3.PathMatcher */
+
+UPB_INLINE envoy_type_matcher_v3_PathMatcher *envoy_type_matcher_v3_PathMatcher_new(upb_arena *arena) {
+ return (envoy_type_matcher_v3_PathMatcher *)_upb_msg_new(&envoy_type_matcher_v3_PathMatcher_msginit, arena);
+}
+UPB_INLINE envoy_type_matcher_v3_PathMatcher *envoy_type_matcher_v3_PathMatcher_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_type_matcher_v3_PathMatcher *ret = envoy_type_matcher_v3_PathMatcher_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_type_matcher_v3_PathMatcher_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_type_matcher_v3_PathMatcher_serialize(const envoy_type_matcher_v3_PathMatcher *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_type_matcher_v3_PathMatcher_msginit, arena, len);
+}
+
+typedef enum {
+ envoy_type_matcher_v3_PathMatcher_rule_path = 1,
+ envoy_type_matcher_v3_PathMatcher_rule_NOT_SET = 0
+} envoy_type_matcher_v3_PathMatcher_rule_oneofcases;
+UPB_INLINE envoy_type_matcher_v3_PathMatcher_rule_oneofcases envoy_type_matcher_v3_PathMatcher_rule_case(const envoy_type_matcher_v3_PathMatcher* msg) { return (envoy_type_matcher_v3_PathMatcher_rule_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 8), int32_t); }
+
+UPB_INLINE bool envoy_type_matcher_v3_PathMatcher_has_path(const envoy_type_matcher_v3_PathMatcher *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 1; }
+UPB_INLINE const struct envoy_type_matcher_v3_StringMatcher* envoy_type_matcher_v3_PathMatcher_path(const envoy_type_matcher_v3_PathMatcher *msg) { return UPB_READ_ONEOF(msg, const struct envoy_type_matcher_v3_StringMatcher*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 1, NULL); }
+
+UPB_INLINE void envoy_type_matcher_v3_PathMatcher_set_path(envoy_type_matcher_v3_PathMatcher *msg, struct envoy_type_matcher_v3_StringMatcher* value) {
+ UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_StringMatcher*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 1);
+}
+UPB_INLINE struct envoy_type_matcher_v3_StringMatcher* envoy_type_matcher_v3_PathMatcher_mutable_path(envoy_type_matcher_v3_PathMatcher *msg, upb_arena *arena) {
+ struct envoy_type_matcher_v3_StringMatcher* sub = (struct envoy_type_matcher_v3_StringMatcher*)envoy_type_matcher_v3_PathMatcher_path(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_type_matcher_v3_StringMatcher*)_upb_msg_new(&envoy_type_matcher_v3_StringMatcher_msginit, arena);
+ if (!sub) return NULL;
+ envoy_type_matcher_v3_PathMatcher_set_path(msg, sub);
+ }
+ return sub;
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_TYPE_MATCHER_V3_PATH_PROTO_UPB_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.c
index 1507660d9ed..ba642570812 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.c
@@ -1,64 +1,64 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/type/matcher/v3/regex.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include <stddef.h>
-#include "upb/msg.h"
-#include "envoy/type/matcher/v3/regex.upb.h"
-#include "google/protobuf/wrappers.upb.h"
-#include "udpa/annotations/status.upb.h"
-#include "udpa/annotations/versioning.upb.h"
-#include "validate/validate.upb.h"
-
-#include "upb/port_def.inc"
-
-static const upb_msglayout *const envoy_type_matcher_v3_RegexMatcher_submsgs[1] = {
- &envoy_type_matcher_v3_RegexMatcher_GoogleRE2_msginit,
-};
-
-static const upb_msglayout_field envoy_type_matcher_v3_RegexMatcher__fields[2] = {
- {1, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, 1},
- {2, UPB_SIZE(0, 0), 0, 0, 9, 1},
-};
-
-const upb_msglayout envoy_type_matcher_v3_RegexMatcher_msginit = {
- &envoy_type_matcher_v3_RegexMatcher_submsgs[0],
- &envoy_type_matcher_v3_RegexMatcher__fields[0],
- UPB_SIZE(16, 32), 2, false,
-};
-
-static const upb_msglayout *const envoy_type_matcher_v3_RegexMatcher_GoogleRE2_submsgs[1] = {
- &google_protobuf_UInt32Value_msginit,
-};
-
-static const upb_msglayout_field envoy_type_matcher_v3_RegexMatcher_GoogleRE2__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
-};
-
-const upb_msglayout envoy_type_matcher_v3_RegexMatcher_GoogleRE2_msginit = {
- &envoy_type_matcher_v3_RegexMatcher_GoogleRE2_submsgs[0],
- &envoy_type_matcher_v3_RegexMatcher_GoogleRE2__fields[0],
- UPB_SIZE(4, 8), 1, false,
-};
-
-static const upb_msglayout *const envoy_type_matcher_v3_RegexMatchAndSubstitute_submsgs[1] = {
- &envoy_type_matcher_v3_RegexMatcher_msginit,
-};
-
-static const upb_msglayout_field envoy_type_matcher_v3_RegexMatchAndSubstitute__fields[2] = {
- {1, UPB_SIZE(8, 16), 0, 0, 11, 1},
- {2, UPB_SIZE(0, 0), 0, 0, 9, 1},
-};
-
-const upb_msglayout envoy_type_matcher_v3_RegexMatchAndSubstitute_msginit = {
- &envoy_type_matcher_v3_RegexMatchAndSubstitute_submsgs[0],
- &envoy_type_matcher_v3_RegexMatchAndSubstitute__fields[0],
- UPB_SIZE(16, 32), 2, false,
-};
-
-#include "upb/port_undef.inc"
-
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/type/matcher/v3/regex.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg.h"
+#include "envoy/type/matcher/v3/regex.upb.h"
+#include "google/protobuf/wrappers.upb.h"
+#include "udpa/annotations/status.upb.h"
+#include "udpa/annotations/versioning.upb.h"
+#include "validate/validate.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_msglayout *const envoy_type_matcher_v3_RegexMatcher_submsgs[1] = {
+ &envoy_type_matcher_v3_RegexMatcher_GoogleRE2_msginit,
+};
+
+static const upb_msglayout_field envoy_type_matcher_v3_RegexMatcher__fields[2] = {
+ {1, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, 1},
+ {2, UPB_SIZE(0, 0), 0, 0, 9, 1},
+};
+
+const upb_msglayout envoy_type_matcher_v3_RegexMatcher_msginit = {
+ &envoy_type_matcher_v3_RegexMatcher_submsgs[0],
+ &envoy_type_matcher_v3_RegexMatcher__fields[0],
+ UPB_SIZE(16, 32), 2, false,
+};
+
+static const upb_msglayout *const envoy_type_matcher_v3_RegexMatcher_GoogleRE2_submsgs[1] = {
+ &google_protobuf_UInt32Value_msginit,
+};
+
+static const upb_msglayout_field envoy_type_matcher_v3_RegexMatcher_GoogleRE2__fields[1] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
+};
+
+const upb_msglayout envoy_type_matcher_v3_RegexMatcher_GoogleRE2_msginit = {
+ &envoy_type_matcher_v3_RegexMatcher_GoogleRE2_submsgs[0],
+ &envoy_type_matcher_v3_RegexMatcher_GoogleRE2__fields[0],
+ UPB_SIZE(4, 8), 1, false,
+};
+
+static const upb_msglayout *const envoy_type_matcher_v3_RegexMatchAndSubstitute_submsgs[1] = {
+ &envoy_type_matcher_v3_RegexMatcher_msginit,
+};
+
+static const upb_msglayout_field envoy_type_matcher_v3_RegexMatchAndSubstitute__fields[2] = {
+ {1, UPB_SIZE(8, 16), 0, 0, 11, 1},
+ {2, UPB_SIZE(0, 0), 0, 0, 9, 1},
+};
+
+const upb_msglayout envoy_type_matcher_v3_RegexMatchAndSubstitute_msginit = {
+ &envoy_type_matcher_v3_RegexMatchAndSubstitute_submsgs[0],
+ &envoy_type_matcher_v3_RegexMatchAndSubstitute__fields[0],
+ UPB_SIZE(16, 32), 2, false,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.h
index cc707e1ee80..def56ed496a 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.h
@@ -1,145 +1,145 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/type/matcher/v3/regex.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef ENVOY_TYPE_MATCHER_V3_REGEX_PROTO_UPB_H_
-#define ENVOY_TYPE_MATCHER_V3_REGEX_PROTO_UPB_H_
-
-#include "upb/msg.h"
-#include "upb/decode.h"
-#include "upb/encode.h"
-
-#include "upb/port_def.inc"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct envoy_type_matcher_v3_RegexMatcher;
-struct envoy_type_matcher_v3_RegexMatcher_GoogleRE2;
-struct envoy_type_matcher_v3_RegexMatchAndSubstitute;
-typedef struct envoy_type_matcher_v3_RegexMatcher envoy_type_matcher_v3_RegexMatcher;
-typedef struct envoy_type_matcher_v3_RegexMatcher_GoogleRE2 envoy_type_matcher_v3_RegexMatcher_GoogleRE2;
-typedef struct envoy_type_matcher_v3_RegexMatchAndSubstitute envoy_type_matcher_v3_RegexMatchAndSubstitute;
-extern const upb_msglayout envoy_type_matcher_v3_RegexMatcher_msginit;
-extern const upb_msglayout envoy_type_matcher_v3_RegexMatcher_GoogleRE2_msginit;
-extern const upb_msglayout envoy_type_matcher_v3_RegexMatchAndSubstitute_msginit;
-struct google_protobuf_UInt32Value;
-extern const upb_msglayout google_protobuf_UInt32Value_msginit;
-
-
-/* envoy.type.matcher.v3.RegexMatcher */
-
-UPB_INLINE envoy_type_matcher_v3_RegexMatcher *envoy_type_matcher_v3_RegexMatcher_new(upb_arena *arena) {
- return (envoy_type_matcher_v3_RegexMatcher *)_upb_msg_new(&envoy_type_matcher_v3_RegexMatcher_msginit, arena);
-}
-UPB_INLINE envoy_type_matcher_v3_RegexMatcher *envoy_type_matcher_v3_RegexMatcher_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_type_matcher_v3_RegexMatcher *ret = envoy_type_matcher_v3_RegexMatcher_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_type_matcher_v3_RegexMatcher_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_type_matcher_v3_RegexMatcher_serialize(const envoy_type_matcher_v3_RegexMatcher *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_type_matcher_v3_RegexMatcher_msginit, arena, len);
-}
-
-typedef enum {
- envoy_type_matcher_v3_RegexMatcher_engine_type_google_re2 = 1,
- envoy_type_matcher_v3_RegexMatcher_engine_type_NOT_SET = 0
-} envoy_type_matcher_v3_RegexMatcher_engine_type_oneofcases;
-UPB_INLINE envoy_type_matcher_v3_RegexMatcher_engine_type_oneofcases envoy_type_matcher_v3_RegexMatcher_engine_type_case(const envoy_type_matcher_v3_RegexMatcher* msg) { return (envoy_type_matcher_v3_RegexMatcher_engine_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(12, 24), int32_t); }
-
-UPB_INLINE bool envoy_type_matcher_v3_RegexMatcher_has_google_re2(const envoy_type_matcher_v3_RegexMatcher *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 1; }
-UPB_INLINE const envoy_type_matcher_v3_RegexMatcher_GoogleRE2* envoy_type_matcher_v3_RegexMatcher_google_re2(const envoy_type_matcher_v3_RegexMatcher *msg) { return UPB_READ_ONEOF(msg, const envoy_type_matcher_v3_RegexMatcher_GoogleRE2*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 1, NULL); }
-UPB_INLINE upb_strview envoy_type_matcher_v3_RegexMatcher_regex(const envoy_type_matcher_v3_RegexMatcher *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-
-UPB_INLINE void envoy_type_matcher_v3_RegexMatcher_set_google_re2(envoy_type_matcher_v3_RegexMatcher *msg, envoy_type_matcher_v3_RegexMatcher_GoogleRE2* value) {
- UPB_WRITE_ONEOF(msg, envoy_type_matcher_v3_RegexMatcher_GoogleRE2*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 1);
-}
-UPB_INLINE struct envoy_type_matcher_v3_RegexMatcher_GoogleRE2* envoy_type_matcher_v3_RegexMatcher_mutable_google_re2(envoy_type_matcher_v3_RegexMatcher *msg, upb_arena *arena) {
- struct envoy_type_matcher_v3_RegexMatcher_GoogleRE2* sub = (struct envoy_type_matcher_v3_RegexMatcher_GoogleRE2*)envoy_type_matcher_v3_RegexMatcher_google_re2(msg);
- if (sub == NULL) {
- sub = (struct envoy_type_matcher_v3_RegexMatcher_GoogleRE2*)_upb_msg_new(&envoy_type_matcher_v3_RegexMatcher_GoogleRE2_msginit, arena);
- if (!sub) return NULL;
- envoy_type_matcher_v3_RegexMatcher_set_google_re2(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_type_matcher_v3_RegexMatcher_set_regex(envoy_type_matcher_v3_RegexMatcher *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-
-/* envoy.type.matcher.v3.RegexMatcher.GoogleRE2 */
-
-UPB_INLINE envoy_type_matcher_v3_RegexMatcher_GoogleRE2 *envoy_type_matcher_v3_RegexMatcher_GoogleRE2_new(upb_arena *arena) {
- return (envoy_type_matcher_v3_RegexMatcher_GoogleRE2 *)_upb_msg_new(&envoy_type_matcher_v3_RegexMatcher_GoogleRE2_msginit, arena);
-}
-UPB_INLINE envoy_type_matcher_v3_RegexMatcher_GoogleRE2 *envoy_type_matcher_v3_RegexMatcher_GoogleRE2_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_type_matcher_v3_RegexMatcher_GoogleRE2 *ret = envoy_type_matcher_v3_RegexMatcher_GoogleRE2_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_type_matcher_v3_RegexMatcher_GoogleRE2_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_type_matcher_v3_RegexMatcher_GoogleRE2_serialize(const envoy_type_matcher_v3_RegexMatcher_GoogleRE2 *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_type_matcher_v3_RegexMatcher_GoogleRE2_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_type_matcher_v3_RegexMatcher_GoogleRE2_has_max_program_size(const envoy_type_matcher_v3_RegexMatcher_GoogleRE2 *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE const struct google_protobuf_UInt32Value* envoy_type_matcher_v3_RegexMatcher_GoogleRE2_max_program_size(const envoy_type_matcher_v3_RegexMatcher_GoogleRE2 *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct google_protobuf_UInt32Value*); }
-
-UPB_INLINE void envoy_type_matcher_v3_RegexMatcher_GoogleRE2_set_max_program_size(envoy_type_matcher_v3_RegexMatcher_GoogleRE2 *msg, struct google_protobuf_UInt32Value* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct google_protobuf_UInt32Value*) = value;
-}
-UPB_INLINE struct google_protobuf_UInt32Value* envoy_type_matcher_v3_RegexMatcher_GoogleRE2_mutable_max_program_size(envoy_type_matcher_v3_RegexMatcher_GoogleRE2 *msg, upb_arena *arena) {
- struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_type_matcher_v3_RegexMatcher_GoogleRE2_max_program_size(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
- if (!sub) return NULL;
- envoy_type_matcher_v3_RegexMatcher_GoogleRE2_set_max_program_size(msg, sub);
- }
- return sub;
-}
-
-/* envoy.type.matcher.v3.RegexMatchAndSubstitute */
-
-UPB_INLINE envoy_type_matcher_v3_RegexMatchAndSubstitute *envoy_type_matcher_v3_RegexMatchAndSubstitute_new(upb_arena *arena) {
- return (envoy_type_matcher_v3_RegexMatchAndSubstitute *)_upb_msg_new(&envoy_type_matcher_v3_RegexMatchAndSubstitute_msginit, arena);
-}
-UPB_INLINE envoy_type_matcher_v3_RegexMatchAndSubstitute *envoy_type_matcher_v3_RegexMatchAndSubstitute_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_type_matcher_v3_RegexMatchAndSubstitute *ret = envoy_type_matcher_v3_RegexMatchAndSubstitute_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_type_matcher_v3_RegexMatchAndSubstitute_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_type_matcher_v3_RegexMatchAndSubstitute_serialize(const envoy_type_matcher_v3_RegexMatchAndSubstitute *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_type_matcher_v3_RegexMatchAndSubstitute_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_type_matcher_v3_RegexMatchAndSubstitute_has_pattern(const envoy_type_matcher_v3_RegexMatchAndSubstitute *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const envoy_type_matcher_v3_RegexMatcher* envoy_type_matcher_v3_RegexMatchAndSubstitute_pattern(const envoy_type_matcher_v3_RegexMatchAndSubstitute *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const envoy_type_matcher_v3_RegexMatcher*); }
-UPB_INLINE upb_strview envoy_type_matcher_v3_RegexMatchAndSubstitute_substitution(const envoy_type_matcher_v3_RegexMatchAndSubstitute *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-
-UPB_INLINE void envoy_type_matcher_v3_RegexMatchAndSubstitute_set_pattern(envoy_type_matcher_v3_RegexMatchAndSubstitute *msg, envoy_type_matcher_v3_RegexMatcher* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), envoy_type_matcher_v3_RegexMatcher*) = value;
-}
-UPB_INLINE struct envoy_type_matcher_v3_RegexMatcher* envoy_type_matcher_v3_RegexMatchAndSubstitute_mutable_pattern(envoy_type_matcher_v3_RegexMatchAndSubstitute *msg, upb_arena *arena) {
- struct envoy_type_matcher_v3_RegexMatcher* sub = (struct envoy_type_matcher_v3_RegexMatcher*)envoy_type_matcher_v3_RegexMatchAndSubstitute_pattern(msg);
- if (sub == NULL) {
- sub = (struct envoy_type_matcher_v3_RegexMatcher*)_upb_msg_new(&envoy_type_matcher_v3_RegexMatcher_msginit, arena);
- if (!sub) return NULL;
- envoy_type_matcher_v3_RegexMatchAndSubstitute_set_pattern(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_type_matcher_v3_RegexMatchAndSubstitute_set_substitution(envoy_type_matcher_v3_RegexMatchAndSubstitute *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* ENVOY_TYPE_MATCHER_V3_REGEX_PROTO_UPB_H_ */
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/type/matcher/v3/regex.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_TYPE_MATCHER_V3_REGEX_PROTO_UPB_H_
+#define ENVOY_TYPE_MATCHER_V3_REGEX_PROTO_UPB_H_
+
+#include "upb/msg.h"
+#include "upb/decode.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_type_matcher_v3_RegexMatcher;
+struct envoy_type_matcher_v3_RegexMatcher_GoogleRE2;
+struct envoy_type_matcher_v3_RegexMatchAndSubstitute;
+typedef struct envoy_type_matcher_v3_RegexMatcher envoy_type_matcher_v3_RegexMatcher;
+typedef struct envoy_type_matcher_v3_RegexMatcher_GoogleRE2 envoy_type_matcher_v3_RegexMatcher_GoogleRE2;
+typedef struct envoy_type_matcher_v3_RegexMatchAndSubstitute envoy_type_matcher_v3_RegexMatchAndSubstitute;
+extern const upb_msglayout envoy_type_matcher_v3_RegexMatcher_msginit;
+extern const upb_msglayout envoy_type_matcher_v3_RegexMatcher_GoogleRE2_msginit;
+extern const upb_msglayout envoy_type_matcher_v3_RegexMatchAndSubstitute_msginit;
+struct google_protobuf_UInt32Value;
+extern const upb_msglayout google_protobuf_UInt32Value_msginit;
+
+
+/* envoy.type.matcher.v3.RegexMatcher */
+
+UPB_INLINE envoy_type_matcher_v3_RegexMatcher *envoy_type_matcher_v3_RegexMatcher_new(upb_arena *arena) {
+ return (envoy_type_matcher_v3_RegexMatcher *)_upb_msg_new(&envoy_type_matcher_v3_RegexMatcher_msginit, arena);
+}
+UPB_INLINE envoy_type_matcher_v3_RegexMatcher *envoy_type_matcher_v3_RegexMatcher_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_type_matcher_v3_RegexMatcher *ret = envoy_type_matcher_v3_RegexMatcher_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_type_matcher_v3_RegexMatcher_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_type_matcher_v3_RegexMatcher_serialize(const envoy_type_matcher_v3_RegexMatcher *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_type_matcher_v3_RegexMatcher_msginit, arena, len);
+}
+
+typedef enum {
+ envoy_type_matcher_v3_RegexMatcher_engine_type_google_re2 = 1,
+ envoy_type_matcher_v3_RegexMatcher_engine_type_NOT_SET = 0
+} envoy_type_matcher_v3_RegexMatcher_engine_type_oneofcases;
+UPB_INLINE envoy_type_matcher_v3_RegexMatcher_engine_type_oneofcases envoy_type_matcher_v3_RegexMatcher_engine_type_case(const envoy_type_matcher_v3_RegexMatcher* msg) { return (envoy_type_matcher_v3_RegexMatcher_engine_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(12, 24), int32_t); }
+
+UPB_INLINE bool envoy_type_matcher_v3_RegexMatcher_has_google_re2(const envoy_type_matcher_v3_RegexMatcher *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 1; }
+UPB_INLINE const envoy_type_matcher_v3_RegexMatcher_GoogleRE2* envoy_type_matcher_v3_RegexMatcher_google_re2(const envoy_type_matcher_v3_RegexMatcher *msg) { return UPB_READ_ONEOF(msg, const envoy_type_matcher_v3_RegexMatcher_GoogleRE2*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 1, NULL); }
+UPB_INLINE upb_strview envoy_type_matcher_v3_RegexMatcher_regex(const envoy_type_matcher_v3_RegexMatcher *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+
+UPB_INLINE void envoy_type_matcher_v3_RegexMatcher_set_google_re2(envoy_type_matcher_v3_RegexMatcher *msg, envoy_type_matcher_v3_RegexMatcher_GoogleRE2* value) {
+ UPB_WRITE_ONEOF(msg, envoy_type_matcher_v3_RegexMatcher_GoogleRE2*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 1);
+}
+UPB_INLINE struct envoy_type_matcher_v3_RegexMatcher_GoogleRE2* envoy_type_matcher_v3_RegexMatcher_mutable_google_re2(envoy_type_matcher_v3_RegexMatcher *msg, upb_arena *arena) {
+ struct envoy_type_matcher_v3_RegexMatcher_GoogleRE2* sub = (struct envoy_type_matcher_v3_RegexMatcher_GoogleRE2*)envoy_type_matcher_v3_RegexMatcher_google_re2(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_type_matcher_v3_RegexMatcher_GoogleRE2*)_upb_msg_new(&envoy_type_matcher_v3_RegexMatcher_GoogleRE2_msginit, arena);
+ if (!sub) return NULL;
+ envoy_type_matcher_v3_RegexMatcher_set_google_re2(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_type_matcher_v3_RegexMatcher_set_regex(envoy_type_matcher_v3_RegexMatcher *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+
+/* envoy.type.matcher.v3.RegexMatcher.GoogleRE2 */
+
+UPB_INLINE envoy_type_matcher_v3_RegexMatcher_GoogleRE2 *envoy_type_matcher_v3_RegexMatcher_GoogleRE2_new(upb_arena *arena) {
+ return (envoy_type_matcher_v3_RegexMatcher_GoogleRE2 *)_upb_msg_new(&envoy_type_matcher_v3_RegexMatcher_GoogleRE2_msginit, arena);
+}
+UPB_INLINE envoy_type_matcher_v3_RegexMatcher_GoogleRE2 *envoy_type_matcher_v3_RegexMatcher_GoogleRE2_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_type_matcher_v3_RegexMatcher_GoogleRE2 *ret = envoy_type_matcher_v3_RegexMatcher_GoogleRE2_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_type_matcher_v3_RegexMatcher_GoogleRE2_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_type_matcher_v3_RegexMatcher_GoogleRE2_serialize(const envoy_type_matcher_v3_RegexMatcher_GoogleRE2 *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_type_matcher_v3_RegexMatcher_GoogleRE2_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_type_matcher_v3_RegexMatcher_GoogleRE2_has_max_program_size(const envoy_type_matcher_v3_RegexMatcher_GoogleRE2 *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_type_matcher_v3_RegexMatcher_GoogleRE2_max_program_size(const envoy_type_matcher_v3_RegexMatcher_GoogleRE2 *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct google_protobuf_UInt32Value*); }
+
+UPB_INLINE void envoy_type_matcher_v3_RegexMatcher_GoogleRE2_set_max_program_size(envoy_type_matcher_v3_RegexMatcher_GoogleRE2 *msg, struct google_protobuf_UInt32Value* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_type_matcher_v3_RegexMatcher_GoogleRE2_mutable_max_program_size(envoy_type_matcher_v3_RegexMatcher_GoogleRE2 *msg, upb_arena *arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_type_matcher_v3_RegexMatcher_GoogleRE2_max_program_size(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_type_matcher_v3_RegexMatcher_GoogleRE2_set_max_program_size(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.type.matcher.v3.RegexMatchAndSubstitute */
+
+UPB_INLINE envoy_type_matcher_v3_RegexMatchAndSubstitute *envoy_type_matcher_v3_RegexMatchAndSubstitute_new(upb_arena *arena) {
+ return (envoy_type_matcher_v3_RegexMatchAndSubstitute *)_upb_msg_new(&envoy_type_matcher_v3_RegexMatchAndSubstitute_msginit, arena);
+}
+UPB_INLINE envoy_type_matcher_v3_RegexMatchAndSubstitute *envoy_type_matcher_v3_RegexMatchAndSubstitute_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_type_matcher_v3_RegexMatchAndSubstitute *ret = envoy_type_matcher_v3_RegexMatchAndSubstitute_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_type_matcher_v3_RegexMatchAndSubstitute_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_type_matcher_v3_RegexMatchAndSubstitute_serialize(const envoy_type_matcher_v3_RegexMatchAndSubstitute *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_type_matcher_v3_RegexMatchAndSubstitute_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_type_matcher_v3_RegexMatchAndSubstitute_has_pattern(const envoy_type_matcher_v3_RegexMatchAndSubstitute *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
+UPB_INLINE const envoy_type_matcher_v3_RegexMatcher* envoy_type_matcher_v3_RegexMatchAndSubstitute_pattern(const envoy_type_matcher_v3_RegexMatchAndSubstitute *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const envoy_type_matcher_v3_RegexMatcher*); }
+UPB_INLINE upb_strview envoy_type_matcher_v3_RegexMatchAndSubstitute_substitution(const envoy_type_matcher_v3_RegexMatchAndSubstitute *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+
+UPB_INLINE void envoy_type_matcher_v3_RegexMatchAndSubstitute_set_pattern(envoy_type_matcher_v3_RegexMatchAndSubstitute *msg, envoy_type_matcher_v3_RegexMatcher* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), envoy_type_matcher_v3_RegexMatcher*) = value;
+}
+UPB_INLINE struct envoy_type_matcher_v3_RegexMatcher* envoy_type_matcher_v3_RegexMatchAndSubstitute_mutable_pattern(envoy_type_matcher_v3_RegexMatchAndSubstitute *msg, upb_arena *arena) {
+ struct envoy_type_matcher_v3_RegexMatcher* sub = (struct envoy_type_matcher_v3_RegexMatcher*)envoy_type_matcher_v3_RegexMatchAndSubstitute_pattern(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_type_matcher_v3_RegexMatcher*)_upb_msg_new(&envoy_type_matcher_v3_RegexMatcher_msginit, arena);
+ if (!sub) return NULL;
+ envoy_type_matcher_v3_RegexMatchAndSubstitute_set_pattern(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_type_matcher_v3_RegexMatchAndSubstitute_set_substitution(envoy_type_matcher_v3_RegexMatchAndSubstitute *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_TYPE_MATCHER_V3_REGEX_PROTO_UPB_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.c
index 106b1e7dd51..969d45b0daf 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.c
@@ -1,54 +1,54 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/type/matcher/v3/string.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include <stddef.h>
-#include "upb/msg.h"
-#include "envoy/type/matcher/v3/string.upb.h"
-#include "envoy/type/matcher/v3/regex.upb.h"
-#include "envoy/annotations/deprecation.upb.h"
-#include "udpa/annotations/status.upb.h"
-#include "udpa/annotations/versioning.upb.h"
-#include "validate/validate.upb.h"
-
-#include "upb/port_def.inc"
-
-static const upb_msglayout *const envoy_type_matcher_v3_StringMatcher_submsgs[1] = {
- &envoy_type_matcher_v3_RegexMatcher_msginit,
-};
-
-static const upb_msglayout_field envoy_type_matcher_v3_StringMatcher__fields[6] = {
- {1, UPB_SIZE(4, 8), UPB_SIZE(-13, -25), 0, 9, 1},
- {2, UPB_SIZE(4, 8), UPB_SIZE(-13, -25), 0, 9, 1},
- {3, UPB_SIZE(4, 8), UPB_SIZE(-13, -25), 0, 9, 1},
- {5, UPB_SIZE(4, 8), UPB_SIZE(-13, -25), 0, 11, 1},
- {6, UPB_SIZE(0, 0), 0, 0, 8, 1},
- {7, UPB_SIZE(4, 8), UPB_SIZE(-13, -25), 0, 9, 1},
-};
-
-const upb_msglayout envoy_type_matcher_v3_StringMatcher_msginit = {
- &envoy_type_matcher_v3_StringMatcher_submsgs[0],
- &envoy_type_matcher_v3_StringMatcher__fields[0],
- UPB_SIZE(16, 32), 6, false,
-};
-
-static const upb_msglayout *const envoy_type_matcher_v3_ListStringMatcher_submsgs[1] = {
- &envoy_type_matcher_v3_StringMatcher_msginit,
-};
-
-static const upb_msglayout_field envoy_type_matcher_v3_ListStringMatcher__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 3},
-};
-
-const upb_msglayout envoy_type_matcher_v3_ListStringMatcher_msginit = {
- &envoy_type_matcher_v3_ListStringMatcher_submsgs[0],
- &envoy_type_matcher_v3_ListStringMatcher__fields[0],
- UPB_SIZE(4, 8), 1, false,
-};
-
-#include "upb/port_undef.inc"
-
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/type/matcher/v3/string.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg.h"
+#include "envoy/type/matcher/v3/string.upb.h"
+#include "envoy/type/matcher/v3/regex.upb.h"
+#include "envoy/annotations/deprecation.upb.h"
+#include "udpa/annotations/status.upb.h"
+#include "udpa/annotations/versioning.upb.h"
+#include "validate/validate.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_msglayout *const envoy_type_matcher_v3_StringMatcher_submsgs[1] = {
+ &envoy_type_matcher_v3_RegexMatcher_msginit,
+};
+
+static const upb_msglayout_field envoy_type_matcher_v3_StringMatcher__fields[6] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(-13, -25), 0, 9, 1},
+ {2, UPB_SIZE(4, 8), UPB_SIZE(-13, -25), 0, 9, 1},
+ {3, UPB_SIZE(4, 8), UPB_SIZE(-13, -25), 0, 9, 1},
+ {5, UPB_SIZE(4, 8), UPB_SIZE(-13, -25), 0, 11, 1},
+ {6, UPB_SIZE(0, 0), 0, 0, 8, 1},
+ {7, UPB_SIZE(4, 8), UPB_SIZE(-13, -25), 0, 9, 1},
+};
+
+const upb_msglayout envoy_type_matcher_v3_StringMatcher_msginit = {
+ &envoy_type_matcher_v3_StringMatcher_submsgs[0],
+ &envoy_type_matcher_v3_StringMatcher__fields[0],
+ UPB_SIZE(16, 32), 6, false,
+};
+
+static const upb_msglayout *const envoy_type_matcher_v3_ListStringMatcher_submsgs[1] = {
+ &envoy_type_matcher_v3_StringMatcher_msginit,
+};
+
+static const upb_msglayout_field envoy_type_matcher_v3_ListStringMatcher__fields[1] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 11, 3},
+};
+
+const upb_msglayout envoy_type_matcher_v3_ListStringMatcher_msginit = {
+ &envoy_type_matcher_v3_ListStringMatcher_submsgs[0],
+ &envoy_type_matcher_v3_ListStringMatcher__fields[0],
+ UPB_SIZE(4, 8), 1, false,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.h
index 494c808de7e..760956b9cd2 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.h
@@ -1,133 +1,133 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/type/matcher/v3/string.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef ENVOY_TYPE_MATCHER_V3_STRING_PROTO_UPB_H_
-#define ENVOY_TYPE_MATCHER_V3_STRING_PROTO_UPB_H_
-
-#include "upb/msg.h"
-#include "upb/decode.h"
-#include "upb/encode.h"
-
-#include "upb/port_def.inc"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct envoy_type_matcher_v3_StringMatcher;
-struct envoy_type_matcher_v3_ListStringMatcher;
-typedef struct envoy_type_matcher_v3_StringMatcher envoy_type_matcher_v3_StringMatcher;
-typedef struct envoy_type_matcher_v3_ListStringMatcher envoy_type_matcher_v3_ListStringMatcher;
-extern const upb_msglayout envoy_type_matcher_v3_StringMatcher_msginit;
-extern const upb_msglayout envoy_type_matcher_v3_ListStringMatcher_msginit;
-struct envoy_type_matcher_v3_RegexMatcher;
-extern const upb_msglayout envoy_type_matcher_v3_RegexMatcher_msginit;
-
-
-/* envoy.type.matcher.v3.StringMatcher */
-
-UPB_INLINE envoy_type_matcher_v3_StringMatcher *envoy_type_matcher_v3_StringMatcher_new(upb_arena *arena) {
- return (envoy_type_matcher_v3_StringMatcher *)_upb_msg_new(&envoy_type_matcher_v3_StringMatcher_msginit, arena);
-}
-UPB_INLINE envoy_type_matcher_v3_StringMatcher *envoy_type_matcher_v3_StringMatcher_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_type_matcher_v3_StringMatcher *ret = envoy_type_matcher_v3_StringMatcher_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_type_matcher_v3_StringMatcher_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_type_matcher_v3_StringMatcher_serialize(const envoy_type_matcher_v3_StringMatcher *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_type_matcher_v3_StringMatcher_msginit, arena, len);
-}
-
-typedef enum {
- envoy_type_matcher_v3_StringMatcher_match_pattern_exact = 1,
- envoy_type_matcher_v3_StringMatcher_match_pattern_prefix = 2,
- envoy_type_matcher_v3_StringMatcher_match_pattern_suffix = 3,
- envoy_type_matcher_v3_StringMatcher_match_pattern_safe_regex = 5,
- envoy_type_matcher_v3_StringMatcher_match_pattern_contains = 7,
- envoy_type_matcher_v3_StringMatcher_match_pattern_NOT_SET = 0
-} envoy_type_matcher_v3_StringMatcher_match_pattern_oneofcases;
-UPB_INLINE envoy_type_matcher_v3_StringMatcher_match_pattern_oneofcases envoy_type_matcher_v3_StringMatcher_match_pattern_case(const envoy_type_matcher_v3_StringMatcher* msg) { return (envoy_type_matcher_v3_StringMatcher_match_pattern_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(12, 24), int32_t); }
-
-UPB_INLINE bool envoy_type_matcher_v3_StringMatcher_has_exact(const envoy_type_matcher_v3_StringMatcher *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 1; }
-UPB_INLINE upb_strview envoy_type_matcher_v3_StringMatcher_exact(const envoy_type_matcher_v3_StringMatcher *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(4, 8), UPB_SIZE(12, 24), 1, upb_strview_make("", strlen(""))); }
-UPB_INLINE bool envoy_type_matcher_v3_StringMatcher_has_prefix(const envoy_type_matcher_v3_StringMatcher *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 2; }
-UPB_INLINE upb_strview envoy_type_matcher_v3_StringMatcher_prefix(const envoy_type_matcher_v3_StringMatcher *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(4, 8), UPB_SIZE(12, 24), 2, upb_strview_make("", strlen(""))); }
-UPB_INLINE bool envoy_type_matcher_v3_StringMatcher_has_suffix(const envoy_type_matcher_v3_StringMatcher *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 3; }
-UPB_INLINE upb_strview envoy_type_matcher_v3_StringMatcher_suffix(const envoy_type_matcher_v3_StringMatcher *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(4, 8), UPB_SIZE(12, 24), 3, upb_strview_make("", strlen(""))); }
-UPB_INLINE bool envoy_type_matcher_v3_StringMatcher_has_safe_regex(const envoy_type_matcher_v3_StringMatcher *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 5; }
-UPB_INLINE const struct envoy_type_matcher_v3_RegexMatcher* envoy_type_matcher_v3_StringMatcher_safe_regex(const envoy_type_matcher_v3_StringMatcher *msg) { return UPB_READ_ONEOF(msg, const struct envoy_type_matcher_v3_RegexMatcher*, UPB_SIZE(4, 8), UPB_SIZE(12, 24), 5, NULL); }
-UPB_INLINE bool envoy_type_matcher_v3_StringMatcher_ignore_case(const envoy_type_matcher_v3_StringMatcher *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); }
-UPB_INLINE bool envoy_type_matcher_v3_StringMatcher_has_contains(const envoy_type_matcher_v3_StringMatcher *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 7; }
-UPB_INLINE upb_strview envoy_type_matcher_v3_StringMatcher_contains(const envoy_type_matcher_v3_StringMatcher *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(4, 8), UPB_SIZE(12, 24), 7, upb_strview_make("", strlen(""))); }
-
-UPB_INLINE void envoy_type_matcher_v3_StringMatcher_set_exact(envoy_type_matcher_v3_StringMatcher *msg, upb_strview value) {
- UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(4, 8), value, UPB_SIZE(12, 24), 1);
-}
-UPB_INLINE void envoy_type_matcher_v3_StringMatcher_set_prefix(envoy_type_matcher_v3_StringMatcher *msg, upb_strview value) {
- UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(4, 8), value, UPB_SIZE(12, 24), 2);
-}
-UPB_INLINE void envoy_type_matcher_v3_StringMatcher_set_suffix(envoy_type_matcher_v3_StringMatcher *msg, upb_strview value) {
- UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(4, 8), value, UPB_SIZE(12, 24), 3);
-}
-UPB_INLINE void envoy_type_matcher_v3_StringMatcher_set_safe_regex(envoy_type_matcher_v3_StringMatcher *msg, struct envoy_type_matcher_v3_RegexMatcher* value) {
- UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_RegexMatcher*, UPB_SIZE(4, 8), value, UPB_SIZE(12, 24), 5);
-}
-UPB_INLINE struct envoy_type_matcher_v3_RegexMatcher* envoy_type_matcher_v3_StringMatcher_mutable_safe_regex(envoy_type_matcher_v3_StringMatcher *msg, upb_arena *arena) {
- struct envoy_type_matcher_v3_RegexMatcher* sub = (struct envoy_type_matcher_v3_RegexMatcher*)envoy_type_matcher_v3_StringMatcher_safe_regex(msg);
- if (sub == NULL) {
- sub = (struct envoy_type_matcher_v3_RegexMatcher*)_upb_msg_new(&envoy_type_matcher_v3_RegexMatcher_msginit, arena);
- if (!sub) return NULL;
- envoy_type_matcher_v3_StringMatcher_set_safe_regex(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_type_matcher_v3_StringMatcher_set_ignore_case(envoy_type_matcher_v3_StringMatcher *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
-}
-UPB_INLINE void envoy_type_matcher_v3_StringMatcher_set_contains(envoy_type_matcher_v3_StringMatcher *msg, upb_strview value) {
- UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(4, 8), value, UPB_SIZE(12, 24), 7);
-}
-
-/* envoy.type.matcher.v3.ListStringMatcher */
-
-UPB_INLINE envoy_type_matcher_v3_ListStringMatcher *envoy_type_matcher_v3_ListStringMatcher_new(upb_arena *arena) {
- return (envoy_type_matcher_v3_ListStringMatcher *)_upb_msg_new(&envoy_type_matcher_v3_ListStringMatcher_msginit, arena);
-}
-UPB_INLINE envoy_type_matcher_v3_ListStringMatcher *envoy_type_matcher_v3_ListStringMatcher_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_type_matcher_v3_ListStringMatcher *ret = envoy_type_matcher_v3_ListStringMatcher_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_type_matcher_v3_ListStringMatcher_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_type_matcher_v3_ListStringMatcher_serialize(const envoy_type_matcher_v3_ListStringMatcher *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_type_matcher_v3_ListStringMatcher_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_type_matcher_v3_ListStringMatcher_has_patterns(const envoy_type_matcher_v3_ListStringMatcher *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE const envoy_type_matcher_v3_StringMatcher* const* envoy_type_matcher_v3_ListStringMatcher_patterns(const envoy_type_matcher_v3_ListStringMatcher *msg, size_t *len) { return (const envoy_type_matcher_v3_StringMatcher* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
-
-UPB_INLINE envoy_type_matcher_v3_StringMatcher** envoy_type_matcher_v3_ListStringMatcher_mutable_patterns(envoy_type_matcher_v3_ListStringMatcher *msg, size_t *len) {
- return (envoy_type_matcher_v3_StringMatcher**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
-}
-UPB_INLINE envoy_type_matcher_v3_StringMatcher** envoy_type_matcher_v3_ListStringMatcher_resize_patterns(envoy_type_matcher_v3_ListStringMatcher *msg, size_t len, upb_arena *arena) {
- return (envoy_type_matcher_v3_StringMatcher**)_upb_array_resize_accessor(msg, UPB_SIZE(0, 0), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_type_matcher_v3_StringMatcher* envoy_type_matcher_v3_ListStringMatcher_add_patterns(envoy_type_matcher_v3_ListStringMatcher *msg, upb_arena *arena) {
- struct envoy_type_matcher_v3_StringMatcher* sub = (struct envoy_type_matcher_v3_StringMatcher*)_upb_msg_new(&envoy_type_matcher_v3_StringMatcher_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(0, 0), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* ENVOY_TYPE_MATCHER_V3_STRING_PROTO_UPB_H_ */
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/type/matcher/v3/string.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_TYPE_MATCHER_V3_STRING_PROTO_UPB_H_
+#define ENVOY_TYPE_MATCHER_V3_STRING_PROTO_UPB_H_
+
+#include "upb/msg.h"
+#include "upb/decode.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_type_matcher_v3_StringMatcher;
+struct envoy_type_matcher_v3_ListStringMatcher;
+typedef struct envoy_type_matcher_v3_StringMatcher envoy_type_matcher_v3_StringMatcher;
+typedef struct envoy_type_matcher_v3_ListStringMatcher envoy_type_matcher_v3_ListStringMatcher;
+extern const upb_msglayout envoy_type_matcher_v3_StringMatcher_msginit;
+extern const upb_msglayout envoy_type_matcher_v3_ListStringMatcher_msginit;
+struct envoy_type_matcher_v3_RegexMatcher;
+extern const upb_msglayout envoy_type_matcher_v3_RegexMatcher_msginit;
+
+
+/* envoy.type.matcher.v3.StringMatcher */
+
+UPB_INLINE envoy_type_matcher_v3_StringMatcher *envoy_type_matcher_v3_StringMatcher_new(upb_arena *arena) {
+ return (envoy_type_matcher_v3_StringMatcher *)_upb_msg_new(&envoy_type_matcher_v3_StringMatcher_msginit, arena);
+}
+UPB_INLINE envoy_type_matcher_v3_StringMatcher *envoy_type_matcher_v3_StringMatcher_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_type_matcher_v3_StringMatcher *ret = envoy_type_matcher_v3_StringMatcher_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_type_matcher_v3_StringMatcher_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_type_matcher_v3_StringMatcher_serialize(const envoy_type_matcher_v3_StringMatcher *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_type_matcher_v3_StringMatcher_msginit, arena, len);
+}
+
+typedef enum {
+ envoy_type_matcher_v3_StringMatcher_match_pattern_exact = 1,
+ envoy_type_matcher_v3_StringMatcher_match_pattern_prefix = 2,
+ envoy_type_matcher_v3_StringMatcher_match_pattern_suffix = 3,
+ envoy_type_matcher_v3_StringMatcher_match_pattern_safe_regex = 5,
+ envoy_type_matcher_v3_StringMatcher_match_pattern_contains = 7,
+ envoy_type_matcher_v3_StringMatcher_match_pattern_NOT_SET = 0
+} envoy_type_matcher_v3_StringMatcher_match_pattern_oneofcases;
+UPB_INLINE envoy_type_matcher_v3_StringMatcher_match_pattern_oneofcases envoy_type_matcher_v3_StringMatcher_match_pattern_case(const envoy_type_matcher_v3_StringMatcher* msg) { return (envoy_type_matcher_v3_StringMatcher_match_pattern_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(12, 24), int32_t); }
+
+UPB_INLINE bool envoy_type_matcher_v3_StringMatcher_has_exact(const envoy_type_matcher_v3_StringMatcher *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 1; }
+UPB_INLINE upb_strview envoy_type_matcher_v3_StringMatcher_exact(const envoy_type_matcher_v3_StringMatcher *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(4, 8), UPB_SIZE(12, 24), 1, upb_strview_make("", strlen(""))); }
+UPB_INLINE bool envoy_type_matcher_v3_StringMatcher_has_prefix(const envoy_type_matcher_v3_StringMatcher *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 2; }
+UPB_INLINE upb_strview envoy_type_matcher_v3_StringMatcher_prefix(const envoy_type_matcher_v3_StringMatcher *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(4, 8), UPB_SIZE(12, 24), 2, upb_strview_make("", strlen(""))); }
+UPB_INLINE bool envoy_type_matcher_v3_StringMatcher_has_suffix(const envoy_type_matcher_v3_StringMatcher *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 3; }
+UPB_INLINE upb_strview envoy_type_matcher_v3_StringMatcher_suffix(const envoy_type_matcher_v3_StringMatcher *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(4, 8), UPB_SIZE(12, 24), 3, upb_strview_make("", strlen(""))); }
+UPB_INLINE bool envoy_type_matcher_v3_StringMatcher_has_safe_regex(const envoy_type_matcher_v3_StringMatcher *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 5; }
+UPB_INLINE const struct envoy_type_matcher_v3_RegexMatcher* envoy_type_matcher_v3_StringMatcher_safe_regex(const envoy_type_matcher_v3_StringMatcher *msg) { return UPB_READ_ONEOF(msg, const struct envoy_type_matcher_v3_RegexMatcher*, UPB_SIZE(4, 8), UPB_SIZE(12, 24), 5, NULL); }
+UPB_INLINE bool envoy_type_matcher_v3_StringMatcher_ignore_case(const envoy_type_matcher_v3_StringMatcher *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); }
+UPB_INLINE bool envoy_type_matcher_v3_StringMatcher_has_contains(const envoy_type_matcher_v3_StringMatcher *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 7; }
+UPB_INLINE upb_strview envoy_type_matcher_v3_StringMatcher_contains(const envoy_type_matcher_v3_StringMatcher *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(4, 8), UPB_SIZE(12, 24), 7, upb_strview_make("", strlen(""))); }
+
+UPB_INLINE void envoy_type_matcher_v3_StringMatcher_set_exact(envoy_type_matcher_v3_StringMatcher *msg, upb_strview value) {
+ UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(4, 8), value, UPB_SIZE(12, 24), 1);
+}
+UPB_INLINE void envoy_type_matcher_v3_StringMatcher_set_prefix(envoy_type_matcher_v3_StringMatcher *msg, upb_strview value) {
+ UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(4, 8), value, UPB_SIZE(12, 24), 2);
+}
+UPB_INLINE void envoy_type_matcher_v3_StringMatcher_set_suffix(envoy_type_matcher_v3_StringMatcher *msg, upb_strview value) {
+ UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(4, 8), value, UPB_SIZE(12, 24), 3);
+}
+UPB_INLINE void envoy_type_matcher_v3_StringMatcher_set_safe_regex(envoy_type_matcher_v3_StringMatcher *msg, struct envoy_type_matcher_v3_RegexMatcher* value) {
+ UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_RegexMatcher*, UPB_SIZE(4, 8), value, UPB_SIZE(12, 24), 5);
+}
+UPB_INLINE struct envoy_type_matcher_v3_RegexMatcher* envoy_type_matcher_v3_StringMatcher_mutable_safe_regex(envoy_type_matcher_v3_StringMatcher *msg, upb_arena *arena) {
+ struct envoy_type_matcher_v3_RegexMatcher* sub = (struct envoy_type_matcher_v3_RegexMatcher*)envoy_type_matcher_v3_StringMatcher_safe_regex(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_type_matcher_v3_RegexMatcher*)_upb_msg_new(&envoy_type_matcher_v3_RegexMatcher_msginit, arena);
+ if (!sub) return NULL;
+ envoy_type_matcher_v3_StringMatcher_set_safe_regex(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_type_matcher_v3_StringMatcher_set_ignore_case(envoy_type_matcher_v3_StringMatcher *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
+}
+UPB_INLINE void envoy_type_matcher_v3_StringMatcher_set_contains(envoy_type_matcher_v3_StringMatcher *msg, upb_strview value) {
+ UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(4, 8), value, UPB_SIZE(12, 24), 7);
+}
+
+/* envoy.type.matcher.v3.ListStringMatcher */
+
+UPB_INLINE envoy_type_matcher_v3_ListStringMatcher *envoy_type_matcher_v3_ListStringMatcher_new(upb_arena *arena) {
+ return (envoy_type_matcher_v3_ListStringMatcher *)_upb_msg_new(&envoy_type_matcher_v3_ListStringMatcher_msginit, arena);
+}
+UPB_INLINE envoy_type_matcher_v3_ListStringMatcher *envoy_type_matcher_v3_ListStringMatcher_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_type_matcher_v3_ListStringMatcher *ret = envoy_type_matcher_v3_ListStringMatcher_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_type_matcher_v3_ListStringMatcher_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_type_matcher_v3_ListStringMatcher_serialize(const envoy_type_matcher_v3_ListStringMatcher *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_type_matcher_v3_ListStringMatcher_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_type_matcher_v3_ListStringMatcher_has_patterns(const envoy_type_matcher_v3_ListStringMatcher *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE const envoy_type_matcher_v3_StringMatcher* const* envoy_type_matcher_v3_ListStringMatcher_patterns(const envoy_type_matcher_v3_ListStringMatcher *msg, size_t *len) { return (const envoy_type_matcher_v3_StringMatcher* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
+
+UPB_INLINE envoy_type_matcher_v3_StringMatcher** envoy_type_matcher_v3_ListStringMatcher_mutable_patterns(envoy_type_matcher_v3_ListStringMatcher *msg, size_t *len) {
+ return (envoy_type_matcher_v3_StringMatcher**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
+}
+UPB_INLINE envoy_type_matcher_v3_StringMatcher** envoy_type_matcher_v3_ListStringMatcher_resize_patterns(envoy_type_matcher_v3_ListStringMatcher *msg, size_t len, upb_arena *arena) {
+ return (envoy_type_matcher_v3_StringMatcher**)_upb_array_resize_accessor(msg, UPB_SIZE(0, 0), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_type_matcher_v3_StringMatcher* envoy_type_matcher_v3_ListStringMatcher_add_patterns(envoy_type_matcher_v3_ListStringMatcher *msg, upb_arena *arena) {
+ struct envoy_type_matcher_v3_StringMatcher* sub = (struct envoy_type_matcher_v3_StringMatcher*)_upb_msg_new(&envoy_type_matcher_v3_StringMatcher_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(0, 0), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_TYPE_MATCHER_V3_STRING_PROTO_UPB_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.c
index 79093198be1..a2ab19e1896 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.c
@@ -1,63 +1,63 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/type/matcher/v3/value.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include <stddef.h>
-#include "upb/msg.h"
-#include "envoy/type/matcher/v3/value.upb.h"
-#include "envoy/type/matcher/v3/number.upb.h"
-#include "envoy/type/matcher/v3/string.upb.h"
-#include "udpa/annotations/status.upb.h"
-#include "udpa/annotations/versioning.upb.h"
-#include "validate/validate.upb.h"
-
-#include "upb/port_def.inc"
-
-static const upb_msglayout *const envoy_type_matcher_v3_ValueMatcher_submsgs[4] = {
- &envoy_type_matcher_v3_DoubleMatcher_msginit,
- &envoy_type_matcher_v3_ListMatcher_msginit,
- &envoy_type_matcher_v3_StringMatcher_msginit,
- &envoy_type_matcher_v3_ValueMatcher_NullMatch_msginit,
-};
-
-static const upb_msglayout_field envoy_type_matcher_v3_ValueMatcher__fields[6] = {
- {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 3, 11, 1},
- {2, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, 1},
- {3, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 2, 11, 1},
- {4, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 8, 1},
- {5, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 8, 1},
- {6, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 1, 11, 1},
-};
-
-const upb_msglayout envoy_type_matcher_v3_ValueMatcher_msginit = {
- &envoy_type_matcher_v3_ValueMatcher_submsgs[0],
- &envoy_type_matcher_v3_ValueMatcher__fields[0],
- UPB_SIZE(8, 16), 6, false,
-};
-
-const upb_msglayout envoy_type_matcher_v3_ValueMatcher_NullMatch_msginit = {
- NULL,
- NULL,
- UPB_SIZE(0, 0), 0, false,
-};
-
-static const upb_msglayout *const envoy_type_matcher_v3_ListMatcher_submsgs[1] = {
- &envoy_type_matcher_v3_ValueMatcher_msginit,
-};
-
-static const upb_msglayout_field envoy_type_matcher_v3_ListMatcher__fields[1] = {
- {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, 1},
-};
-
-const upb_msglayout envoy_type_matcher_v3_ListMatcher_msginit = {
- &envoy_type_matcher_v3_ListMatcher_submsgs[0],
- &envoy_type_matcher_v3_ListMatcher__fields[0],
- UPB_SIZE(8, 16), 1, false,
-};
-
-#include "upb/port_undef.inc"
-
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/type/matcher/v3/value.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg.h"
+#include "envoy/type/matcher/v3/value.upb.h"
+#include "envoy/type/matcher/v3/number.upb.h"
+#include "envoy/type/matcher/v3/string.upb.h"
+#include "udpa/annotations/status.upb.h"
+#include "udpa/annotations/versioning.upb.h"
+#include "validate/validate.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_msglayout *const envoy_type_matcher_v3_ValueMatcher_submsgs[4] = {
+ &envoy_type_matcher_v3_DoubleMatcher_msginit,
+ &envoy_type_matcher_v3_ListMatcher_msginit,
+ &envoy_type_matcher_v3_StringMatcher_msginit,
+ &envoy_type_matcher_v3_ValueMatcher_NullMatch_msginit,
+};
+
+static const upb_msglayout_field envoy_type_matcher_v3_ValueMatcher__fields[6] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 3, 11, 1},
+ {2, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, 1},
+ {3, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 2, 11, 1},
+ {4, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 8, 1},
+ {5, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 8, 1},
+ {6, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 1, 11, 1},
+};
+
+const upb_msglayout envoy_type_matcher_v3_ValueMatcher_msginit = {
+ &envoy_type_matcher_v3_ValueMatcher_submsgs[0],
+ &envoy_type_matcher_v3_ValueMatcher__fields[0],
+ UPB_SIZE(8, 16), 6, false,
+};
+
+const upb_msglayout envoy_type_matcher_v3_ValueMatcher_NullMatch_msginit = {
+ NULL,
+ NULL,
+ UPB_SIZE(0, 0), 0, false,
+};
+
+static const upb_msglayout *const envoy_type_matcher_v3_ListMatcher_submsgs[1] = {
+ &envoy_type_matcher_v3_ValueMatcher_msginit,
+};
+
+static const upb_msglayout_field envoy_type_matcher_v3_ListMatcher__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, 1},
+};
+
+const upb_msglayout envoy_type_matcher_v3_ListMatcher_msginit = {
+ &envoy_type_matcher_v3_ListMatcher_submsgs[0],
+ &envoy_type_matcher_v3_ListMatcher__fields[0],
+ UPB_SIZE(8, 16), 1, false,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.h
index 69fe9dc0f51..5ff8ccd9985 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.h
@@ -1,188 +1,188 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/type/matcher/v3/value.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef ENVOY_TYPE_MATCHER_V3_VALUE_PROTO_UPB_H_
-#define ENVOY_TYPE_MATCHER_V3_VALUE_PROTO_UPB_H_
-
-#include "upb/msg.h"
-#include "upb/decode.h"
-#include "upb/encode.h"
-
-#include "upb/port_def.inc"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct envoy_type_matcher_v3_ValueMatcher;
-struct envoy_type_matcher_v3_ValueMatcher_NullMatch;
-struct envoy_type_matcher_v3_ListMatcher;
-typedef struct envoy_type_matcher_v3_ValueMatcher envoy_type_matcher_v3_ValueMatcher;
-typedef struct envoy_type_matcher_v3_ValueMatcher_NullMatch envoy_type_matcher_v3_ValueMatcher_NullMatch;
-typedef struct envoy_type_matcher_v3_ListMatcher envoy_type_matcher_v3_ListMatcher;
-extern const upb_msglayout envoy_type_matcher_v3_ValueMatcher_msginit;
-extern const upb_msglayout envoy_type_matcher_v3_ValueMatcher_NullMatch_msginit;
-extern const upb_msglayout envoy_type_matcher_v3_ListMatcher_msginit;
-struct envoy_type_matcher_v3_DoubleMatcher;
-struct envoy_type_matcher_v3_StringMatcher;
-extern const upb_msglayout envoy_type_matcher_v3_DoubleMatcher_msginit;
-extern const upb_msglayout envoy_type_matcher_v3_StringMatcher_msginit;
-
-
-/* envoy.type.matcher.v3.ValueMatcher */
-
-UPB_INLINE envoy_type_matcher_v3_ValueMatcher *envoy_type_matcher_v3_ValueMatcher_new(upb_arena *arena) {
- return (envoy_type_matcher_v3_ValueMatcher *)_upb_msg_new(&envoy_type_matcher_v3_ValueMatcher_msginit, arena);
-}
-UPB_INLINE envoy_type_matcher_v3_ValueMatcher *envoy_type_matcher_v3_ValueMatcher_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_type_matcher_v3_ValueMatcher *ret = envoy_type_matcher_v3_ValueMatcher_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_type_matcher_v3_ValueMatcher_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_type_matcher_v3_ValueMatcher_serialize(const envoy_type_matcher_v3_ValueMatcher *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_type_matcher_v3_ValueMatcher_msginit, arena, len);
-}
-
-typedef enum {
- envoy_type_matcher_v3_ValueMatcher_match_pattern_null_match = 1,
- envoy_type_matcher_v3_ValueMatcher_match_pattern_double_match = 2,
- envoy_type_matcher_v3_ValueMatcher_match_pattern_string_match = 3,
- envoy_type_matcher_v3_ValueMatcher_match_pattern_bool_match = 4,
- envoy_type_matcher_v3_ValueMatcher_match_pattern_present_match = 5,
- envoy_type_matcher_v3_ValueMatcher_match_pattern_list_match = 6,
- envoy_type_matcher_v3_ValueMatcher_match_pattern_NOT_SET = 0
-} envoy_type_matcher_v3_ValueMatcher_match_pattern_oneofcases;
-UPB_INLINE envoy_type_matcher_v3_ValueMatcher_match_pattern_oneofcases envoy_type_matcher_v3_ValueMatcher_match_pattern_case(const envoy_type_matcher_v3_ValueMatcher* msg) { return (envoy_type_matcher_v3_ValueMatcher_match_pattern_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 8), int32_t); }
-
-UPB_INLINE bool envoy_type_matcher_v3_ValueMatcher_has_null_match(const envoy_type_matcher_v3_ValueMatcher *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 1; }
-UPB_INLINE const envoy_type_matcher_v3_ValueMatcher_NullMatch* envoy_type_matcher_v3_ValueMatcher_null_match(const envoy_type_matcher_v3_ValueMatcher *msg) { return UPB_READ_ONEOF(msg, const envoy_type_matcher_v3_ValueMatcher_NullMatch*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 1, NULL); }
-UPB_INLINE bool envoy_type_matcher_v3_ValueMatcher_has_double_match(const envoy_type_matcher_v3_ValueMatcher *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 2; }
-UPB_INLINE const struct envoy_type_matcher_v3_DoubleMatcher* envoy_type_matcher_v3_ValueMatcher_double_match(const envoy_type_matcher_v3_ValueMatcher *msg) { return UPB_READ_ONEOF(msg, const struct envoy_type_matcher_v3_DoubleMatcher*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 2, NULL); }
-UPB_INLINE bool envoy_type_matcher_v3_ValueMatcher_has_string_match(const envoy_type_matcher_v3_ValueMatcher *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 3; }
-UPB_INLINE const struct envoy_type_matcher_v3_StringMatcher* envoy_type_matcher_v3_ValueMatcher_string_match(const envoy_type_matcher_v3_ValueMatcher *msg) { return UPB_READ_ONEOF(msg, const struct envoy_type_matcher_v3_StringMatcher*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 3, NULL); }
-UPB_INLINE bool envoy_type_matcher_v3_ValueMatcher_has_bool_match(const envoy_type_matcher_v3_ValueMatcher *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 4; }
-UPB_INLINE bool envoy_type_matcher_v3_ValueMatcher_bool_match(const envoy_type_matcher_v3_ValueMatcher *msg) { return UPB_READ_ONEOF(msg, bool, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 4, false); }
-UPB_INLINE bool envoy_type_matcher_v3_ValueMatcher_has_present_match(const envoy_type_matcher_v3_ValueMatcher *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 5; }
-UPB_INLINE bool envoy_type_matcher_v3_ValueMatcher_present_match(const envoy_type_matcher_v3_ValueMatcher *msg) { return UPB_READ_ONEOF(msg, bool, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 5, false); }
-UPB_INLINE bool envoy_type_matcher_v3_ValueMatcher_has_list_match(const envoy_type_matcher_v3_ValueMatcher *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 6; }
-UPB_INLINE const envoy_type_matcher_v3_ListMatcher* envoy_type_matcher_v3_ValueMatcher_list_match(const envoy_type_matcher_v3_ValueMatcher *msg) { return UPB_READ_ONEOF(msg, const envoy_type_matcher_v3_ListMatcher*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 6, NULL); }
-
-UPB_INLINE void envoy_type_matcher_v3_ValueMatcher_set_null_match(envoy_type_matcher_v3_ValueMatcher *msg, envoy_type_matcher_v3_ValueMatcher_NullMatch* value) {
- UPB_WRITE_ONEOF(msg, envoy_type_matcher_v3_ValueMatcher_NullMatch*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 1);
-}
-UPB_INLINE struct envoy_type_matcher_v3_ValueMatcher_NullMatch* envoy_type_matcher_v3_ValueMatcher_mutable_null_match(envoy_type_matcher_v3_ValueMatcher *msg, upb_arena *arena) {
- struct envoy_type_matcher_v3_ValueMatcher_NullMatch* sub = (struct envoy_type_matcher_v3_ValueMatcher_NullMatch*)envoy_type_matcher_v3_ValueMatcher_null_match(msg);
- if (sub == NULL) {
- sub = (struct envoy_type_matcher_v3_ValueMatcher_NullMatch*)_upb_msg_new(&envoy_type_matcher_v3_ValueMatcher_NullMatch_msginit, arena);
- if (!sub) return NULL;
- envoy_type_matcher_v3_ValueMatcher_set_null_match(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_type_matcher_v3_ValueMatcher_set_double_match(envoy_type_matcher_v3_ValueMatcher *msg, struct envoy_type_matcher_v3_DoubleMatcher* value) {
- UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_DoubleMatcher*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 2);
-}
-UPB_INLINE struct envoy_type_matcher_v3_DoubleMatcher* envoy_type_matcher_v3_ValueMatcher_mutable_double_match(envoy_type_matcher_v3_ValueMatcher *msg, upb_arena *arena) {
- struct envoy_type_matcher_v3_DoubleMatcher* sub = (struct envoy_type_matcher_v3_DoubleMatcher*)envoy_type_matcher_v3_ValueMatcher_double_match(msg);
- if (sub == NULL) {
- sub = (struct envoy_type_matcher_v3_DoubleMatcher*)_upb_msg_new(&envoy_type_matcher_v3_DoubleMatcher_msginit, arena);
- if (!sub) return NULL;
- envoy_type_matcher_v3_ValueMatcher_set_double_match(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_type_matcher_v3_ValueMatcher_set_string_match(envoy_type_matcher_v3_ValueMatcher *msg, struct envoy_type_matcher_v3_StringMatcher* value) {
- UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_StringMatcher*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 3);
-}
-UPB_INLINE struct envoy_type_matcher_v3_StringMatcher* envoy_type_matcher_v3_ValueMatcher_mutable_string_match(envoy_type_matcher_v3_ValueMatcher *msg, upb_arena *arena) {
- struct envoy_type_matcher_v3_StringMatcher* sub = (struct envoy_type_matcher_v3_StringMatcher*)envoy_type_matcher_v3_ValueMatcher_string_match(msg);
- if (sub == NULL) {
- sub = (struct envoy_type_matcher_v3_StringMatcher*)_upb_msg_new(&envoy_type_matcher_v3_StringMatcher_msginit, arena);
- if (!sub) return NULL;
- envoy_type_matcher_v3_ValueMatcher_set_string_match(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_type_matcher_v3_ValueMatcher_set_bool_match(envoy_type_matcher_v3_ValueMatcher *msg, bool value) {
- UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 4);
-}
-UPB_INLINE void envoy_type_matcher_v3_ValueMatcher_set_present_match(envoy_type_matcher_v3_ValueMatcher *msg, bool value) {
- UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 5);
-}
-UPB_INLINE void envoy_type_matcher_v3_ValueMatcher_set_list_match(envoy_type_matcher_v3_ValueMatcher *msg, envoy_type_matcher_v3_ListMatcher* value) {
- UPB_WRITE_ONEOF(msg, envoy_type_matcher_v3_ListMatcher*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 6);
-}
-UPB_INLINE struct envoy_type_matcher_v3_ListMatcher* envoy_type_matcher_v3_ValueMatcher_mutable_list_match(envoy_type_matcher_v3_ValueMatcher *msg, upb_arena *arena) {
- struct envoy_type_matcher_v3_ListMatcher* sub = (struct envoy_type_matcher_v3_ListMatcher*)envoy_type_matcher_v3_ValueMatcher_list_match(msg);
- if (sub == NULL) {
- sub = (struct envoy_type_matcher_v3_ListMatcher*)_upb_msg_new(&envoy_type_matcher_v3_ListMatcher_msginit, arena);
- if (!sub) return NULL;
- envoy_type_matcher_v3_ValueMatcher_set_list_match(msg, sub);
- }
- return sub;
-}
-
-/* envoy.type.matcher.v3.ValueMatcher.NullMatch */
-
-UPB_INLINE envoy_type_matcher_v3_ValueMatcher_NullMatch *envoy_type_matcher_v3_ValueMatcher_NullMatch_new(upb_arena *arena) {
- return (envoy_type_matcher_v3_ValueMatcher_NullMatch *)_upb_msg_new(&envoy_type_matcher_v3_ValueMatcher_NullMatch_msginit, arena);
-}
-UPB_INLINE envoy_type_matcher_v3_ValueMatcher_NullMatch *envoy_type_matcher_v3_ValueMatcher_NullMatch_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_type_matcher_v3_ValueMatcher_NullMatch *ret = envoy_type_matcher_v3_ValueMatcher_NullMatch_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_type_matcher_v3_ValueMatcher_NullMatch_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_type_matcher_v3_ValueMatcher_NullMatch_serialize(const envoy_type_matcher_v3_ValueMatcher_NullMatch *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_type_matcher_v3_ValueMatcher_NullMatch_msginit, arena, len);
-}
-
-
-
-/* envoy.type.matcher.v3.ListMatcher */
-
-UPB_INLINE envoy_type_matcher_v3_ListMatcher *envoy_type_matcher_v3_ListMatcher_new(upb_arena *arena) {
- return (envoy_type_matcher_v3_ListMatcher *)_upb_msg_new(&envoy_type_matcher_v3_ListMatcher_msginit, arena);
-}
-UPB_INLINE envoy_type_matcher_v3_ListMatcher *envoy_type_matcher_v3_ListMatcher_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_type_matcher_v3_ListMatcher *ret = envoy_type_matcher_v3_ListMatcher_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_type_matcher_v3_ListMatcher_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_type_matcher_v3_ListMatcher_serialize(const envoy_type_matcher_v3_ListMatcher *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_type_matcher_v3_ListMatcher_msginit, arena, len);
-}
-
-typedef enum {
- envoy_type_matcher_v3_ListMatcher_match_pattern_one_of = 1,
- envoy_type_matcher_v3_ListMatcher_match_pattern_NOT_SET = 0
-} envoy_type_matcher_v3_ListMatcher_match_pattern_oneofcases;
-UPB_INLINE envoy_type_matcher_v3_ListMatcher_match_pattern_oneofcases envoy_type_matcher_v3_ListMatcher_match_pattern_case(const envoy_type_matcher_v3_ListMatcher* msg) { return (envoy_type_matcher_v3_ListMatcher_match_pattern_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 8), int32_t); }
-
-UPB_INLINE bool envoy_type_matcher_v3_ListMatcher_has_one_of(const envoy_type_matcher_v3_ListMatcher *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 1; }
-UPB_INLINE const envoy_type_matcher_v3_ValueMatcher* envoy_type_matcher_v3_ListMatcher_one_of(const envoy_type_matcher_v3_ListMatcher *msg) { return UPB_READ_ONEOF(msg, const envoy_type_matcher_v3_ValueMatcher*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 1, NULL); }
-
-UPB_INLINE void envoy_type_matcher_v3_ListMatcher_set_one_of(envoy_type_matcher_v3_ListMatcher *msg, envoy_type_matcher_v3_ValueMatcher* value) {
- UPB_WRITE_ONEOF(msg, envoy_type_matcher_v3_ValueMatcher*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 1);
-}
-UPB_INLINE struct envoy_type_matcher_v3_ValueMatcher* envoy_type_matcher_v3_ListMatcher_mutable_one_of(envoy_type_matcher_v3_ListMatcher *msg, upb_arena *arena) {
- struct envoy_type_matcher_v3_ValueMatcher* sub = (struct envoy_type_matcher_v3_ValueMatcher*)envoy_type_matcher_v3_ListMatcher_one_of(msg);
- if (sub == NULL) {
- sub = (struct envoy_type_matcher_v3_ValueMatcher*)_upb_msg_new(&envoy_type_matcher_v3_ValueMatcher_msginit, arena);
- if (!sub) return NULL;
- envoy_type_matcher_v3_ListMatcher_set_one_of(msg, sub);
- }
- return sub;
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* ENVOY_TYPE_MATCHER_V3_VALUE_PROTO_UPB_H_ */
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/type/matcher/v3/value.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_TYPE_MATCHER_V3_VALUE_PROTO_UPB_H_
+#define ENVOY_TYPE_MATCHER_V3_VALUE_PROTO_UPB_H_
+
+#include "upb/msg.h"
+#include "upb/decode.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_type_matcher_v3_ValueMatcher;
+struct envoy_type_matcher_v3_ValueMatcher_NullMatch;
+struct envoy_type_matcher_v3_ListMatcher;
+typedef struct envoy_type_matcher_v3_ValueMatcher envoy_type_matcher_v3_ValueMatcher;
+typedef struct envoy_type_matcher_v3_ValueMatcher_NullMatch envoy_type_matcher_v3_ValueMatcher_NullMatch;
+typedef struct envoy_type_matcher_v3_ListMatcher envoy_type_matcher_v3_ListMatcher;
+extern const upb_msglayout envoy_type_matcher_v3_ValueMatcher_msginit;
+extern const upb_msglayout envoy_type_matcher_v3_ValueMatcher_NullMatch_msginit;
+extern const upb_msglayout envoy_type_matcher_v3_ListMatcher_msginit;
+struct envoy_type_matcher_v3_DoubleMatcher;
+struct envoy_type_matcher_v3_StringMatcher;
+extern const upb_msglayout envoy_type_matcher_v3_DoubleMatcher_msginit;
+extern const upb_msglayout envoy_type_matcher_v3_StringMatcher_msginit;
+
+
+/* envoy.type.matcher.v3.ValueMatcher */
+
+UPB_INLINE envoy_type_matcher_v3_ValueMatcher *envoy_type_matcher_v3_ValueMatcher_new(upb_arena *arena) {
+ return (envoy_type_matcher_v3_ValueMatcher *)_upb_msg_new(&envoy_type_matcher_v3_ValueMatcher_msginit, arena);
+}
+UPB_INLINE envoy_type_matcher_v3_ValueMatcher *envoy_type_matcher_v3_ValueMatcher_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_type_matcher_v3_ValueMatcher *ret = envoy_type_matcher_v3_ValueMatcher_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_type_matcher_v3_ValueMatcher_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_type_matcher_v3_ValueMatcher_serialize(const envoy_type_matcher_v3_ValueMatcher *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_type_matcher_v3_ValueMatcher_msginit, arena, len);
+}
+
+typedef enum {
+ envoy_type_matcher_v3_ValueMatcher_match_pattern_null_match = 1,
+ envoy_type_matcher_v3_ValueMatcher_match_pattern_double_match = 2,
+ envoy_type_matcher_v3_ValueMatcher_match_pattern_string_match = 3,
+ envoy_type_matcher_v3_ValueMatcher_match_pattern_bool_match = 4,
+ envoy_type_matcher_v3_ValueMatcher_match_pattern_present_match = 5,
+ envoy_type_matcher_v3_ValueMatcher_match_pattern_list_match = 6,
+ envoy_type_matcher_v3_ValueMatcher_match_pattern_NOT_SET = 0
+} envoy_type_matcher_v3_ValueMatcher_match_pattern_oneofcases;
+UPB_INLINE envoy_type_matcher_v3_ValueMatcher_match_pattern_oneofcases envoy_type_matcher_v3_ValueMatcher_match_pattern_case(const envoy_type_matcher_v3_ValueMatcher* msg) { return (envoy_type_matcher_v3_ValueMatcher_match_pattern_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 8), int32_t); }
+
+UPB_INLINE bool envoy_type_matcher_v3_ValueMatcher_has_null_match(const envoy_type_matcher_v3_ValueMatcher *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 1; }
+UPB_INLINE const envoy_type_matcher_v3_ValueMatcher_NullMatch* envoy_type_matcher_v3_ValueMatcher_null_match(const envoy_type_matcher_v3_ValueMatcher *msg) { return UPB_READ_ONEOF(msg, const envoy_type_matcher_v3_ValueMatcher_NullMatch*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 1, NULL); }
+UPB_INLINE bool envoy_type_matcher_v3_ValueMatcher_has_double_match(const envoy_type_matcher_v3_ValueMatcher *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 2; }
+UPB_INLINE const struct envoy_type_matcher_v3_DoubleMatcher* envoy_type_matcher_v3_ValueMatcher_double_match(const envoy_type_matcher_v3_ValueMatcher *msg) { return UPB_READ_ONEOF(msg, const struct envoy_type_matcher_v3_DoubleMatcher*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 2, NULL); }
+UPB_INLINE bool envoy_type_matcher_v3_ValueMatcher_has_string_match(const envoy_type_matcher_v3_ValueMatcher *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 3; }
+UPB_INLINE const struct envoy_type_matcher_v3_StringMatcher* envoy_type_matcher_v3_ValueMatcher_string_match(const envoy_type_matcher_v3_ValueMatcher *msg) { return UPB_READ_ONEOF(msg, const struct envoy_type_matcher_v3_StringMatcher*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 3, NULL); }
+UPB_INLINE bool envoy_type_matcher_v3_ValueMatcher_has_bool_match(const envoy_type_matcher_v3_ValueMatcher *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 4; }
+UPB_INLINE bool envoy_type_matcher_v3_ValueMatcher_bool_match(const envoy_type_matcher_v3_ValueMatcher *msg) { return UPB_READ_ONEOF(msg, bool, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 4, false); }
+UPB_INLINE bool envoy_type_matcher_v3_ValueMatcher_has_present_match(const envoy_type_matcher_v3_ValueMatcher *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 5; }
+UPB_INLINE bool envoy_type_matcher_v3_ValueMatcher_present_match(const envoy_type_matcher_v3_ValueMatcher *msg) { return UPB_READ_ONEOF(msg, bool, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 5, false); }
+UPB_INLINE bool envoy_type_matcher_v3_ValueMatcher_has_list_match(const envoy_type_matcher_v3_ValueMatcher *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 6; }
+UPB_INLINE const envoy_type_matcher_v3_ListMatcher* envoy_type_matcher_v3_ValueMatcher_list_match(const envoy_type_matcher_v3_ValueMatcher *msg) { return UPB_READ_ONEOF(msg, const envoy_type_matcher_v3_ListMatcher*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 6, NULL); }
+
+UPB_INLINE void envoy_type_matcher_v3_ValueMatcher_set_null_match(envoy_type_matcher_v3_ValueMatcher *msg, envoy_type_matcher_v3_ValueMatcher_NullMatch* value) {
+ UPB_WRITE_ONEOF(msg, envoy_type_matcher_v3_ValueMatcher_NullMatch*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 1);
+}
+UPB_INLINE struct envoy_type_matcher_v3_ValueMatcher_NullMatch* envoy_type_matcher_v3_ValueMatcher_mutable_null_match(envoy_type_matcher_v3_ValueMatcher *msg, upb_arena *arena) {
+ struct envoy_type_matcher_v3_ValueMatcher_NullMatch* sub = (struct envoy_type_matcher_v3_ValueMatcher_NullMatch*)envoy_type_matcher_v3_ValueMatcher_null_match(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_type_matcher_v3_ValueMatcher_NullMatch*)_upb_msg_new(&envoy_type_matcher_v3_ValueMatcher_NullMatch_msginit, arena);
+ if (!sub) return NULL;
+ envoy_type_matcher_v3_ValueMatcher_set_null_match(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_type_matcher_v3_ValueMatcher_set_double_match(envoy_type_matcher_v3_ValueMatcher *msg, struct envoy_type_matcher_v3_DoubleMatcher* value) {
+ UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_DoubleMatcher*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 2);
+}
+UPB_INLINE struct envoy_type_matcher_v3_DoubleMatcher* envoy_type_matcher_v3_ValueMatcher_mutable_double_match(envoy_type_matcher_v3_ValueMatcher *msg, upb_arena *arena) {
+ struct envoy_type_matcher_v3_DoubleMatcher* sub = (struct envoy_type_matcher_v3_DoubleMatcher*)envoy_type_matcher_v3_ValueMatcher_double_match(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_type_matcher_v3_DoubleMatcher*)_upb_msg_new(&envoy_type_matcher_v3_DoubleMatcher_msginit, arena);
+ if (!sub) return NULL;
+ envoy_type_matcher_v3_ValueMatcher_set_double_match(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_type_matcher_v3_ValueMatcher_set_string_match(envoy_type_matcher_v3_ValueMatcher *msg, struct envoy_type_matcher_v3_StringMatcher* value) {
+ UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_StringMatcher*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 3);
+}
+UPB_INLINE struct envoy_type_matcher_v3_StringMatcher* envoy_type_matcher_v3_ValueMatcher_mutable_string_match(envoy_type_matcher_v3_ValueMatcher *msg, upb_arena *arena) {
+ struct envoy_type_matcher_v3_StringMatcher* sub = (struct envoy_type_matcher_v3_StringMatcher*)envoy_type_matcher_v3_ValueMatcher_string_match(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_type_matcher_v3_StringMatcher*)_upb_msg_new(&envoy_type_matcher_v3_StringMatcher_msginit, arena);
+ if (!sub) return NULL;
+ envoy_type_matcher_v3_ValueMatcher_set_string_match(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_type_matcher_v3_ValueMatcher_set_bool_match(envoy_type_matcher_v3_ValueMatcher *msg, bool value) {
+ UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 4);
+}
+UPB_INLINE void envoy_type_matcher_v3_ValueMatcher_set_present_match(envoy_type_matcher_v3_ValueMatcher *msg, bool value) {
+ UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 5);
+}
+UPB_INLINE void envoy_type_matcher_v3_ValueMatcher_set_list_match(envoy_type_matcher_v3_ValueMatcher *msg, envoy_type_matcher_v3_ListMatcher* value) {
+ UPB_WRITE_ONEOF(msg, envoy_type_matcher_v3_ListMatcher*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 6);
+}
+UPB_INLINE struct envoy_type_matcher_v3_ListMatcher* envoy_type_matcher_v3_ValueMatcher_mutable_list_match(envoy_type_matcher_v3_ValueMatcher *msg, upb_arena *arena) {
+ struct envoy_type_matcher_v3_ListMatcher* sub = (struct envoy_type_matcher_v3_ListMatcher*)envoy_type_matcher_v3_ValueMatcher_list_match(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_type_matcher_v3_ListMatcher*)_upb_msg_new(&envoy_type_matcher_v3_ListMatcher_msginit, arena);
+ if (!sub) return NULL;
+ envoy_type_matcher_v3_ValueMatcher_set_list_match(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.type.matcher.v3.ValueMatcher.NullMatch */
+
+UPB_INLINE envoy_type_matcher_v3_ValueMatcher_NullMatch *envoy_type_matcher_v3_ValueMatcher_NullMatch_new(upb_arena *arena) {
+ return (envoy_type_matcher_v3_ValueMatcher_NullMatch *)_upb_msg_new(&envoy_type_matcher_v3_ValueMatcher_NullMatch_msginit, arena);
+}
+UPB_INLINE envoy_type_matcher_v3_ValueMatcher_NullMatch *envoy_type_matcher_v3_ValueMatcher_NullMatch_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_type_matcher_v3_ValueMatcher_NullMatch *ret = envoy_type_matcher_v3_ValueMatcher_NullMatch_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_type_matcher_v3_ValueMatcher_NullMatch_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_type_matcher_v3_ValueMatcher_NullMatch_serialize(const envoy_type_matcher_v3_ValueMatcher_NullMatch *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_type_matcher_v3_ValueMatcher_NullMatch_msginit, arena, len);
+}
+
+
+
+/* envoy.type.matcher.v3.ListMatcher */
+
+UPB_INLINE envoy_type_matcher_v3_ListMatcher *envoy_type_matcher_v3_ListMatcher_new(upb_arena *arena) {
+ return (envoy_type_matcher_v3_ListMatcher *)_upb_msg_new(&envoy_type_matcher_v3_ListMatcher_msginit, arena);
+}
+UPB_INLINE envoy_type_matcher_v3_ListMatcher *envoy_type_matcher_v3_ListMatcher_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_type_matcher_v3_ListMatcher *ret = envoy_type_matcher_v3_ListMatcher_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_type_matcher_v3_ListMatcher_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_type_matcher_v3_ListMatcher_serialize(const envoy_type_matcher_v3_ListMatcher *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_type_matcher_v3_ListMatcher_msginit, arena, len);
+}
+
+typedef enum {
+ envoy_type_matcher_v3_ListMatcher_match_pattern_one_of = 1,
+ envoy_type_matcher_v3_ListMatcher_match_pattern_NOT_SET = 0
+} envoy_type_matcher_v3_ListMatcher_match_pattern_oneofcases;
+UPB_INLINE envoy_type_matcher_v3_ListMatcher_match_pattern_oneofcases envoy_type_matcher_v3_ListMatcher_match_pattern_case(const envoy_type_matcher_v3_ListMatcher* msg) { return (envoy_type_matcher_v3_ListMatcher_match_pattern_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 8), int32_t); }
+
+UPB_INLINE bool envoy_type_matcher_v3_ListMatcher_has_one_of(const envoy_type_matcher_v3_ListMatcher *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 1; }
+UPB_INLINE const envoy_type_matcher_v3_ValueMatcher* envoy_type_matcher_v3_ListMatcher_one_of(const envoy_type_matcher_v3_ListMatcher *msg) { return UPB_READ_ONEOF(msg, const envoy_type_matcher_v3_ValueMatcher*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 1, NULL); }
+
+UPB_INLINE void envoy_type_matcher_v3_ListMatcher_set_one_of(envoy_type_matcher_v3_ListMatcher *msg, envoy_type_matcher_v3_ValueMatcher* value) {
+ UPB_WRITE_ONEOF(msg, envoy_type_matcher_v3_ValueMatcher*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 1);
+}
+UPB_INLINE struct envoy_type_matcher_v3_ValueMatcher* envoy_type_matcher_v3_ListMatcher_mutable_one_of(envoy_type_matcher_v3_ListMatcher *msg, upb_arena *arena) {
+ struct envoy_type_matcher_v3_ValueMatcher* sub = (struct envoy_type_matcher_v3_ValueMatcher*)envoy_type_matcher_v3_ListMatcher_one_of(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_type_matcher_v3_ValueMatcher*)_upb_msg_new(&envoy_type_matcher_v3_ValueMatcher_msginit, arena);
+ if (!sub) return NULL;
+ envoy_type_matcher_v3_ListMatcher_set_one_of(msg, sub);
+ }
+ return sub;
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_TYPE_MATCHER_V3_VALUE_PROTO_UPB_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.c
index 7fbc6b52220..1dbd48defbd 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.c
@@ -1,88 +1,88 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/type/metadata/v3/metadata.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include <stddef.h>
-#include "upb/msg.h"
-#include "envoy/type/metadata/v3/metadata.upb.h"
-#include "udpa/annotations/status.upb.h"
-#include "udpa/annotations/versioning.upb.h"
-#include "validate/validate.upb.h"
-
-#include "upb/port_def.inc"
-
-static const upb_msglayout *const envoy_type_metadata_v3_MetadataKey_submsgs[1] = {
- &envoy_type_metadata_v3_MetadataKey_PathSegment_msginit,
-};
-
-static const upb_msglayout_field envoy_type_metadata_v3_MetadataKey__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 11, 3},
-};
-
-const upb_msglayout envoy_type_metadata_v3_MetadataKey_msginit = {
- &envoy_type_metadata_v3_MetadataKey_submsgs[0],
- &envoy_type_metadata_v3_MetadataKey__fields[0],
- UPB_SIZE(16, 32), 2, false,
-};
-
-static const upb_msglayout_field envoy_type_metadata_v3_MetadataKey_PathSegment__fields[1] = {
- {1, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 9, 1},
-};
-
-const upb_msglayout envoy_type_metadata_v3_MetadataKey_PathSegment_msginit = {
- NULL,
- &envoy_type_metadata_v3_MetadataKey_PathSegment__fields[0],
- UPB_SIZE(16, 32), 1, false,
-};
-
-static const upb_msglayout *const envoy_type_metadata_v3_MetadataKind_submsgs[4] = {
- &envoy_type_metadata_v3_MetadataKind_Cluster_msginit,
- &envoy_type_metadata_v3_MetadataKind_Host_msginit,
- &envoy_type_metadata_v3_MetadataKind_Request_msginit,
- &envoy_type_metadata_v3_MetadataKind_Route_msginit,
-};
-
-static const upb_msglayout_field envoy_type_metadata_v3_MetadataKind__fields[4] = {
- {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 2, 11, 1},
- {2, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 3, 11, 1},
- {3, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, 1},
- {4, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 1, 11, 1},
-};
-
-const upb_msglayout envoy_type_metadata_v3_MetadataKind_msginit = {
- &envoy_type_metadata_v3_MetadataKind_submsgs[0],
- &envoy_type_metadata_v3_MetadataKind__fields[0],
- UPB_SIZE(8, 16), 4, false,
-};
-
-const upb_msglayout envoy_type_metadata_v3_MetadataKind_Request_msginit = {
- NULL,
- NULL,
- UPB_SIZE(0, 0), 0, false,
-};
-
-const upb_msglayout envoy_type_metadata_v3_MetadataKind_Route_msginit = {
- NULL,
- NULL,
- UPB_SIZE(0, 0), 0, false,
-};
-
-const upb_msglayout envoy_type_metadata_v3_MetadataKind_Cluster_msginit = {
- NULL,
- NULL,
- UPB_SIZE(0, 0), 0, false,
-};
-
-const upb_msglayout envoy_type_metadata_v3_MetadataKind_Host_msginit = {
- NULL,
- NULL,
- UPB_SIZE(0, 0), 0, false,
-};
-
-#include "upb/port_undef.inc"
-
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/type/metadata/v3/metadata.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg.h"
+#include "envoy/type/metadata/v3/metadata.upb.h"
+#include "udpa/annotations/status.upb.h"
+#include "udpa/annotations/versioning.upb.h"
+#include "validate/validate.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_msglayout *const envoy_type_metadata_v3_MetadataKey_submsgs[1] = {
+ &envoy_type_metadata_v3_MetadataKey_PathSegment_msginit,
+};
+
+static const upb_msglayout_field envoy_type_metadata_v3_MetadataKey__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {2, UPB_SIZE(8, 16), 0, 0, 11, 3},
+};
+
+const upb_msglayout envoy_type_metadata_v3_MetadataKey_msginit = {
+ &envoy_type_metadata_v3_MetadataKey_submsgs[0],
+ &envoy_type_metadata_v3_MetadataKey__fields[0],
+ UPB_SIZE(16, 32), 2, false,
+};
+
+static const upb_msglayout_field envoy_type_metadata_v3_MetadataKey_PathSegment__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 9, 1},
+};
+
+const upb_msglayout envoy_type_metadata_v3_MetadataKey_PathSegment_msginit = {
+ NULL,
+ &envoy_type_metadata_v3_MetadataKey_PathSegment__fields[0],
+ UPB_SIZE(16, 32), 1, false,
+};
+
+static const upb_msglayout *const envoy_type_metadata_v3_MetadataKind_submsgs[4] = {
+ &envoy_type_metadata_v3_MetadataKind_Cluster_msginit,
+ &envoy_type_metadata_v3_MetadataKind_Host_msginit,
+ &envoy_type_metadata_v3_MetadataKind_Request_msginit,
+ &envoy_type_metadata_v3_MetadataKind_Route_msginit,
+};
+
+static const upb_msglayout_field envoy_type_metadata_v3_MetadataKind__fields[4] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 2, 11, 1},
+ {2, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 3, 11, 1},
+ {3, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, 1},
+ {4, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 1, 11, 1},
+};
+
+const upb_msglayout envoy_type_metadata_v3_MetadataKind_msginit = {
+ &envoy_type_metadata_v3_MetadataKind_submsgs[0],
+ &envoy_type_metadata_v3_MetadataKind__fields[0],
+ UPB_SIZE(8, 16), 4, false,
+};
+
+const upb_msglayout envoy_type_metadata_v3_MetadataKind_Request_msginit = {
+ NULL,
+ NULL,
+ UPB_SIZE(0, 0), 0, false,
+};
+
+const upb_msglayout envoy_type_metadata_v3_MetadataKind_Route_msginit = {
+ NULL,
+ NULL,
+ UPB_SIZE(0, 0), 0, false,
+};
+
+const upb_msglayout envoy_type_metadata_v3_MetadataKind_Cluster_msginit = {
+ NULL,
+ NULL,
+ UPB_SIZE(0, 0), 0, false,
+};
+
+const upb_msglayout envoy_type_metadata_v3_MetadataKind_Host_msginit = {
+ NULL,
+ NULL,
+ UPB_SIZE(0, 0), 0, false,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.h
index ac33d719358..4aeccf5e8ea 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.h
@@ -1,258 +1,258 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/type/metadata/v3/metadata.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef ENVOY_TYPE_METADATA_V3_METADATA_PROTO_UPB_H_
-#define ENVOY_TYPE_METADATA_V3_METADATA_PROTO_UPB_H_
-
-#include "upb/msg.h"
-#include "upb/decode.h"
-#include "upb/encode.h"
-
-#include "upb/port_def.inc"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct envoy_type_metadata_v3_MetadataKey;
-struct envoy_type_metadata_v3_MetadataKey_PathSegment;
-struct envoy_type_metadata_v3_MetadataKind;
-struct envoy_type_metadata_v3_MetadataKind_Request;
-struct envoy_type_metadata_v3_MetadataKind_Route;
-struct envoy_type_metadata_v3_MetadataKind_Cluster;
-struct envoy_type_metadata_v3_MetadataKind_Host;
-typedef struct envoy_type_metadata_v3_MetadataKey envoy_type_metadata_v3_MetadataKey;
-typedef struct envoy_type_metadata_v3_MetadataKey_PathSegment envoy_type_metadata_v3_MetadataKey_PathSegment;
-typedef struct envoy_type_metadata_v3_MetadataKind envoy_type_metadata_v3_MetadataKind;
-typedef struct envoy_type_metadata_v3_MetadataKind_Request envoy_type_metadata_v3_MetadataKind_Request;
-typedef struct envoy_type_metadata_v3_MetadataKind_Route envoy_type_metadata_v3_MetadataKind_Route;
-typedef struct envoy_type_metadata_v3_MetadataKind_Cluster envoy_type_metadata_v3_MetadataKind_Cluster;
-typedef struct envoy_type_metadata_v3_MetadataKind_Host envoy_type_metadata_v3_MetadataKind_Host;
-extern const upb_msglayout envoy_type_metadata_v3_MetadataKey_msginit;
-extern const upb_msglayout envoy_type_metadata_v3_MetadataKey_PathSegment_msginit;
-extern const upb_msglayout envoy_type_metadata_v3_MetadataKind_msginit;
-extern const upb_msglayout envoy_type_metadata_v3_MetadataKind_Request_msginit;
-extern const upb_msglayout envoy_type_metadata_v3_MetadataKind_Route_msginit;
-extern const upb_msglayout envoy_type_metadata_v3_MetadataKind_Cluster_msginit;
-extern const upb_msglayout envoy_type_metadata_v3_MetadataKind_Host_msginit;
-
-
-/* envoy.type.metadata.v3.MetadataKey */
-
-UPB_INLINE envoy_type_metadata_v3_MetadataKey *envoy_type_metadata_v3_MetadataKey_new(upb_arena *arena) {
- return (envoy_type_metadata_v3_MetadataKey *)_upb_msg_new(&envoy_type_metadata_v3_MetadataKey_msginit, arena);
-}
-UPB_INLINE envoy_type_metadata_v3_MetadataKey *envoy_type_metadata_v3_MetadataKey_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_type_metadata_v3_MetadataKey *ret = envoy_type_metadata_v3_MetadataKey_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_type_metadata_v3_MetadataKey_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_type_metadata_v3_MetadataKey_serialize(const envoy_type_metadata_v3_MetadataKey *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_type_metadata_v3_MetadataKey_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview envoy_type_metadata_v3_MetadataKey_key(const envoy_type_metadata_v3_MetadataKey *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE bool envoy_type_metadata_v3_MetadataKey_has_path(const envoy_type_metadata_v3_MetadataKey *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const envoy_type_metadata_v3_MetadataKey_PathSegment* const* envoy_type_metadata_v3_MetadataKey_path(const envoy_type_metadata_v3_MetadataKey *msg, size_t *len) { return (const envoy_type_metadata_v3_MetadataKey_PathSegment* const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len); }
-
-UPB_INLINE void envoy_type_metadata_v3_MetadataKey_set_key(envoy_type_metadata_v3_MetadataKey *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-UPB_INLINE envoy_type_metadata_v3_MetadataKey_PathSegment** envoy_type_metadata_v3_MetadataKey_mutable_path(envoy_type_metadata_v3_MetadataKey *msg, size_t *len) {
- return (envoy_type_metadata_v3_MetadataKey_PathSegment**)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len);
-}
-UPB_INLINE envoy_type_metadata_v3_MetadataKey_PathSegment** envoy_type_metadata_v3_MetadataKey_resize_path(envoy_type_metadata_v3_MetadataKey *msg, size_t len, upb_arena *arena) {
- return (envoy_type_metadata_v3_MetadataKey_PathSegment**)_upb_array_resize_accessor(msg, UPB_SIZE(8, 16), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct envoy_type_metadata_v3_MetadataKey_PathSegment* envoy_type_metadata_v3_MetadataKey_add_path(envoy_type_metadata_v3_MetadataKey *msg, upb_arena *arena) {
- struct envoy_type_metadata_v3_MetadataKey_PathSegment* sub = (struct envoy_type_metadata_v3_MetadataKey_PathSegment*)_upb_msg_new(&envoy_type_metadata_v3_MetadataKey_PathSegment_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(8, 16), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-
-/* envoy.type.metadata.v3.MetadataKey.PathSegment */
-
-UPB_INLINE envoy_type_metadata_v3_MetadataKey_PathSegment *envoy_type_metadata_v3_MetadataKey_PathSegment_new(upb_arena *arena) {
- return (envoy_type_metadata_v3_MetadataKey_PathSegment *)_upb_msg_new(&envoy_type_metadata_v3_MetadataKey_PathSegment_msginit, arena);
-}
-UPB_INLINE envoy_type_metadata_v3_MetadataKey_PathSegment *envoy_type_metadata_v3_MetadataKey_PathSegment_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_type_metadata_v3_MetadataKey_PathSegment *ret = envoy_type_metadata_v3_MetadataKey_PathSegment_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_type_metadata_v3_MetadataKey_PathSegment_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_type_metadata_v3_MetadataKey_PathSegment_serialize(const envoy_type_metadata_v3_MetadataKey_PathSegment *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_type_metadata_v3_MetadataKey_PathSegment_msginit, arena, len);
-}
-
-typedef enum {
- envoy_type_metadata_v3_MetadataKey_PathSegment_segment_key = 1,
- envoy_type_metadata_v3_MetadataKey_PathSegment_segment_NOT_SET = 0
-} envoy_type_metadata_v3_MetadataKey_PathSegment_segment_oneofcases;
-UPB_INLINE envoy_type_metadata_v3_MetadataKey_PathSegment_segment_oneofcases envoy_type_metadata_v3_MetadataKey_PathSegment_segment_case(const envoy_type_metadata_v3_MetadataKey_PathSegment* msg) { return (envoy_type_metadata_v3_MetadataKey_PathSegment_segment_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(8, 16), int32_t); }
-
-UPB_INLINE bool envoy_type_metadata_v3_MetadataKey_PathSegment_has_key(const envoy_type_metadata_v3_MetadataKey_PathSegment *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 1; }
-UPB_INLINE upb_strview envoy_type_metadata_v3_MetadataKey_PathSegment_key(const envoy_type_metadata_v3_MetadataKey_PathSegment *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 1, upb_strview_make("", strlen(""))); }
-
-UPB_INLINE void envoy_type_metadata_v3_MetadataKey_PathSegment_set_key(envoy_type_metadata_v3_MetadataKey_PathSegment *msg, upb_strview value) {
- UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 1);
-}
-
-/* envoy.type.metadata.v3.MetadataKind */
-
-UPB_INLINE envoy_type_metadata_v3_MetadataKind *envoy_type_metadata_v3_MetadataKind_new(upb_arena *arena) {
- return (envoy_type_metadata_v3_MetadataKind *)_upb_msg_new(&envoy_type_metadata_v3_MetadataKind_msginit, arena);
-}
-UPB_INLINE envoy_type_metadata_v3_MetadataKind *envoy_type_metadata_v3_MetadataKind_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_type_metadata_v3_MetadataKind *ret = envoy_type_metadata_v3_MetadataKind_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_type_metadata_v3_MetadataKind_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_type_metadata_v3_MetadataKind_serialize(const envoy_type_metadata_v3_MetadataKind *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_type_metadata_v3_MetadataKind_msginit, arena, len);
-}
-
-typedef enum {
- envoy_type_metadata_v3_MetadataKind_kind_request = 1,
- envoy_type_metadata_v3_MetadataKind_kind_route = 2,
- envoy_type_metadata_v3_MetadataKind_kind_cluster = 3,
- envoy_type_metadata_v3_MetadataKind_kind_host = 4,
- envoy_type_metadata_v3_MetadataKind_kind_NOT_SET = 0
-} envoy_type_metadata_v3_MetadataKind_kind_oneofcases;
-UPB_INLINE envoy_type_metadata_v3_MetadataKind_kind_oneofcases envoy_type_metadata_v3_MetadataKind_kind_case(const envoy_type_metadata_v3_MetadataKind* msg) { return (envoy_type_metadata_v3_MetadataKind_kind_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 8), int32_t); }
-
-UPB_INLINE bool envoy_type_metadata_v3_MetadataKind_has_request(const envoy_type_metadata_v3_MetadataKind *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 1; }
-UPB_INLINE const envoy_type_metadata_v3_MetadataKind_Request* envoy_type_metadata_v3_MetadataKind_request(const envoy_type_metadata_v3_MetadataKind *msg) { return UPB_READ_ONEOF(msg, const envoy_type_metadata_v3_MetadataKind_Request*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 1, NULL); }
-UPB_INLINE bool envoy_type_metadata_v3_MetadataKind_has_route(const envoy_type_metadata_v3_MetadataKind *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 2; }
-UPB_INLINE const envoy_type_metadata_v3_MetadataKind_Route* envoy_type_metadata_v3_MetadataKind_route(const envoy_type_metadata_v3_MetadataKind *msg) { return UPB_READ_ONEOF(msg, const envoy_type_metadata_v3_MetadataKind_Route*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 2, NULL); }
-UPB_INLINE bool envoy_type_metadata_v3_MetadataKind_has_cluster(const envoy_type_metadata_v3_MetadataKind *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 3; }
-UPB_INLINE const envoy_type_metadata_v3_MetadataKind_Cluster* envoy_type_metadata_v3_MetadataKind_cluster(const envoy_type_metadata_v3_MetadataKind *msg) { return UPB_READ_ONEOF(msg, const envoy_type_metadata_v3_MetadataKind_Cluster*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 3, NULL); }
-UPB_INLINE bool envoy_type_metadata_v3_MetadataKind_has_host(const envoy_type_metadata_v3_MetadataKind *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 4; }
-UPB_INLINE const envoy_type_metadata_v3_MetadataKind_Host* envoy_type_metadata_v3_MetadataKind_host(const envoy_type_metadata_v3_MetadataKind *msg) { return UPB_READ_ONEOF(msg, const envoy_type_metadata_v3_MetadataKind_Host*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 4, NULL); }
-
-UPB_INLINE void envoy_type_metadata_v3_MetadataKind_set_request(envoy_type_metadata_v3_MetadataKind *msg, envoy_type_metadata_v3_MetadataKind_Request* value) {
- UPB_WRITE_ONEOF(msg, envoy_type_metadata_v3_MetadataKind_Request*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 1);
-}
-UPB_INLINE struct envoy_type_metadata_v3_MetadataKind_Request* envoy_type_metadata_v3_MetadataKind_mutable_request(envoy_type_metadata_v3_MetadataKind *msg, upb_arena *arena) {
- struct envoy_type_metadata_v3_MetadataKind_Request* sub = (struct envoy_type_metadata_v3_MetadataKind_Request*)envoy_type_metadata_v3_MetadataKind_request(msg);
- if (sub == NULL) {
- sub = (struct envoy_type_metadata_v3_MetadataKind_Request*)_upb_msg_new(&envoy_type_metadata_v3_MetadataKind_Request_msginit, arena);
- if (!sub) return NULL;
- envoy_type_metadata_v3_MetadataKind_set_request(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_type_metadata_v3_MetadataKind_set_route(envoy_type_metadata_v3_MetadataKind *msg, envoy_type_metadata_v3_MetadataKind_Route* value) {
- UPB_WRITE_ONEOF(msg, envoy_type_metadata_v3_MetadataKind_Route*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 2);
-}
-UPB_INLINE struct envoy_type_metadata_v3_MetadataKind_Route* envoy_type_metadata_v3_MetadataKind_mutable_route(envoy_type_metadata_v3_MetadataKind *msg, upb_arena *arena) {
- struct envoy_type_metadata_v3_MetadataKind_Route* sub = (struct envoy_type_metadata_v3_MetadataKind_Route*)envoy_type_metadata_v3_MetadataKind_route(msg);
- if (sub == NULL) {
- sub = (struct envoy_type_metadata_v3_MetadataKind_Route*)_upb_msg_new(&envoy_type_metadata_v3_MetadataKind_Route_msginit, arena);
- if (!sub) return NULL;
- envoy_type_metadata_v3_MetadataKind_set_route(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_type_metadata_v3_MetadataKind_set_cluster(envoy_type_metadata_v3_MetadataKind *msg, envoy_type_metadata_v3_MetadataKind_Cluster* value) {
- UPB_WRITE_ONEOF(msg, envoy_type_metadata_v3_MetadataKind_Cluster*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 3);
-}
-UPB_INLINE struct envoy_type_metadata_v3_MetadataKind_Cluster* envoy_type_metadata_v3_MetadataKind_mutable_cluster(envoy_type_metadata_v3_MetadataKind *msg, upb_arena *arena) {
- struct envoy_type_metadata_v3_MetadataKind_Cluster* sub = (struct envoy_type_metadata_v3_MetadataKind_Cluster*)envoy_type_metadata_v3_MetadataKind_cluster(msg);
- if (sub == NULL) {
- sub = (struct envoy_type_metadata_v3_MetadataKind_Cluster*)_upb_msg_new(&envoy_type_metadata_v3_MetadataKind_Cluster_msginit, arena);
- if (!sub) return NULL;
- envoy_type_metadata_v3_MetadataKind_set_cluster(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_type_metadata_v3_MetadataKind_set_host(envoy_type_metadata_v3_MetadataKind *msg, envoy_type_metadata_v3_MetadataKind_Host* value) {
- UPB_WRITE_ONEOF(msg, envoy_type_metadata_v3_MetadataKind_Host*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 4);
-}
-UPB_INLINE struct envoy_type_metadata_v3_MetadataKind_Host* envoy_type_metadata_v3_MetadataKind_mutable_host(envoy_type_metadata_v3_MetadataKind *msg, upb_arena *arena) {
- struct envoy_type_metadata_v3_MetadataKind_Host* sub = (struct envoy_type_metadata_v3_MetadataKind_Host*)envoy_type_metadata_v3_MetadataKind_host(msg);
- if (sub == NULL) {
- sub = (struct envoy_type_metadata_v3_MetadataKind_Host*)_upb_msg_new(&envoy_type_metadata_v3_MetadataKind_Host_msginit, arena);
- if (!sub) return NULL;
- envoy_type_metadata_v3_MetadataKind_set_host(msg, sub);
- }
- return sub;
-}
-
-/* envoy.type.metadata.v3.MetadataKind.Request */
-
-UPB_INLINE envoy_type_metadata_v3_MetadataKind_Request *envoy_type_metadata_v3_MetadataKind_Request_new(upb_arena *arena) {
- return (envoy_type_metadata_v3_MetadataKind_Request *)_upb_msg_new(&envoy_type_metadata_v3_MetadataKind_Request_msginit, arena);
-}
-UPB_INLINE envoy_type_metadata_v3_MetadataKind_Request *envoy_type_metadata_v3_MetadataKind_Request_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_type_metadata_v3_MetadataKind_Request *ret = envoy_type_metadata_v3_MetadataKind_Request_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_type_metadata_v3_MetadataKind_Request_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_type_metadata_v3_MetadataKind_Request_serialize(const envoy_type_metadata_v3_MetadataKind_Request *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_type_metadata_v3_MetadataKind_Request_msginit, arena, len);
-}
-
-
-
-/* envoy.type.metadata.v3.MetadataKind.Route */
-
-UPB_INLINE envoy_type_metadata_v3_MetadataKind_Route *envoy_type_metadata_v3_MetadataKind_Route_new(upb_arena *arena) {
- return (envoy_type_metadata_v3_MetadataKind_Route *)_upb_msg_new(&envoy_type_metadata_v3_MetadataKind_Route_msginit, arena);
-}
-UPB_INLINE envoy_type_metadata_v3_MetadataKind_Route *envoy_type_metadata_v3_MetadataKind_Route_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_type_metadata_v3_MetadataKind_Route *ret = envoy_type_metadata_v3_MetadataKind_Route_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_type_metadata_v3_MetadataKind_Route_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_type_metadata_v3_MetadataKind_Route_serialize(const envoy_type_metadata_v3_MetadataKind_Route *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_type_metadata_v3_MetadataKind_Route_msginit, arena, len);
-}
-
-
-
-/* envoy.type.metadata.v3.MetadataKind.Cluster */
-
-UPB_INLINE envoy_type_metadata_v3_MetadataKind_Cluster *envoy_type_metadata_v3_MetadataKind_Cluster_new(upb_arena *arena) {
- return (envoy_type_metadata_v3_MetadataKind_Cluster *)_upb_msg_new(&envoy_type_metadata_v3_MetadataKind_Cluster_msginit, arena);
-}
-UPB_INLINE envoy_type_metadata_v3_MetadataKind_Cluster *envoy_type_metadata_v3_MetadataKind_Cluster_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_type_metadata_v3_MetadataKind_Cluster *ret = envoy_type_metadata_v3_MetadataKind_Cluster_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_type_metadata_v3_MetadataKind_Cluster_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_type_metadata_v3_MetadataKind_Cluster_serialize(const envoy_type_metadata_v3_MetadataKind_Cluster *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_type_metadata_v3_MetadataKind_Cluster_msginit, arena, len);
-}
-
-
-
-/* envoy.type.metadata.v3.MetadataKind.Host */
-
-UPB_INLINE envoy_type_metadata_v3_MetadataKind_Host *envoy_type_metadata_v3_MetadataKind_Host_new(upb_arena *arena) {
- return (envoy_type_metadata_v3_MetadataKind_Host *)_upb_msg_new(&envoy_type_metadata_v3_MetadataKind_Host_msginit, arena);
-}
-UPB_INLINE envoy_type_metadata_v3_MetadataKind_Host *envoy_type_metadata_v3_MetadataKind_Host_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_type_metadata_v3_MetadataKind_Host *ret = envoy_type_metadata_v3_MetadataKind_Host_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_type_metadata_v3_MetadataKind_Host_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_type_metadata_v3_MetadataKind_Host_serialize(const envoy_type_metadata_v3_MetadataKind_Host *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_type_metadata_v3_MetadataKind_Host_msginit, arena, len);
-}
-
-
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* ENVOY_TYPE_METADATA_V3_METADATA_PROTO_UPB_H_ */
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/type/metadata/v3/metadata.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_TYPE_METADATA_V3_METADATA_PROTO_UPB_H_
+#define ENVOY_TYPE_METADATA_V3_METADATA_PROTO_UPB_H_
+
+#include "upb/msg.h"
+#include "upb/decode.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_type_metadata_v3_MetadataKey;
+struct envoy_type_metadata_v3_MetadataKey_PathSegment;
+struct envoy_type_metadata_v3_MetadataKind;
+struct envoy_type_metadata_v3_MetadataKind_Request;
+struct envoy_type_metadata_v3_MetadataKind_Route;
+struct envoy_type_metadata_v3_MetadataKind_Cluster;
+struct envoy_type_metadata_v3_MetadataKind_Host;
+typedef struct envoy_type_metadata_v3_MetadataKey envoy_type_metadata_v3_MetadataKey;
+typedef struct envoy_type_metadata_v3_MetadataKey_PathSegment envoy_type_metadata_v3_MetadataKey_PathSegment;
+typedef struct envoy_type_metadata_v3_MetadataKind envoy_type_metadata_v3_MetadataKind;
+typedef struct envoy_type_metadata_v3_MetadataKind_Request envoy_type_metadata_v3_MetadataKind_Request;
+typedef struct envoy_type_metadata_v3_MetadataKind_Route envoy_type_metadata_v3_MetadataKind_Route;
+typedef struct envoy_type_metadata_v3_MetadataKind_Cluster envoy_type_metadata_v3_MetadataKind_Cluster;
+typedef struct envoy_type_metadata_v3_MetadataKind_Host envoy_type_metadata_v3_MetadataKind_Host;
+extern const upb_msglayout envoy_type_metadata_v3_MetadataKey_msginit;
+extern const upb_msglayout envoy_type_metadata_v3_MetadataKey_PathSegment_msginit;
+extern const upb_msglayout envoy_type_metadata_v3_MetadataKind_msginit;
+extern const upb_msglayout envoy_type_metadata_v3_MetadataKind_Request_msginit;
+extern const upb_msglayout envoy_type_metadata_v3_MetadataKind_Route_msginit;
+extern const upb_msglayout envoy_type_metadata_v3_MetadataKind_Cluster_msginit;
+extern const upb_msglayout envoy_type_metadata_v3_MetadataKind_Host_msginit;
+
+
+/* envoy.type.metadata.v3.MetadataKey */
+
+UPB_INLINE envoy_type_metadata_v3_MetadataKey *envoy_type_metadata_v3_MetadataKey_new(upb_arena *arena) {
+ return (envoy_type_metadata_v3_MetadataKey *)_upb_msg_new(&envoy_type_metadata_v3_MetadataKey_msginit, arena);
+}
+UPB_INLINE envoy_type_metadata_v3_MetadataKey *envoy_type_metadata_v3_MetadataKey_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_type_metadata_v3_MetadataKey *ret = envoy_type_metadata_v3_MetadataKey_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_type_metadata_v3_MetadataKey_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_type_metadata_v3_MetadataKey_serialize(const envoy_type_metadata_v3_MetadataKey *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_type_metadata_v3_MetadataKey_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview envoy_type_metadata_v3_MetadataKey_key(const envoy_type_metadata_v3_MetadataKey *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE bool envoy_type_metadata_v3_MetadataKey_has_path(const envoy_type_metadata_v3_MetadataKey *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
+UPB_INLINE const envoy_type_metadata_v3_MetadataKey_PathSegment* const* envoy_type_metadata_v3_MetadataKey_path(const envoy_type_metadata_v3_MetadataKey *msg, size_t *len) { return (const envoy_type_metadata_v3_MetadataKey_PathSegment* const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len); }
+
+UPB_INLINE void envoy_type_metadata_v3_MetadataKey_set_key(envoy_type_metadata_v3_MetadataKey *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+UPB_INLINE envoy_type_metadata_v3_MetadataKey_PathSegment** envoy_type_metadata_v3_MetadataKey_mutable_path(envoy_type_metadata_v3_MetadataKey *msg, size_t *len) {
+ return (envoy_type_metadata_v3_MetadataKey_PathSegment**)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len);
+}
+UPB_INLINE envoy_type_metadata_v3_MetadataKey_PathSegment** envoy_type_metadata_v3_MetadataKey_resize_path(envoy_type_metadata_v3_MetadataKey *msg, size_t len, upb_arena *arena) {
+ return (envoy_type_metadata_v3_MetadataKey_PathSegment**)_upb_array_resize_accessor(msg, UPB_SIZE(8, 16), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct envoy_type_metadata_v3_MetadataKey_PathSegment* envoy_type_metadata_v3_MetadataKey_add_path(envoy_type_metadata_v3_MetadataKey *msg, upb_arena *arena) {
+ struct envoy_type_metadata_v3_MetadataKey_PathSegment* sub = (struct envoy_type_metadata_v3_MetadataKey_PathSegment*)_upb_msg_new(&envoy_type_metadata_v3_MetadataKey_PathSegment_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(8, 16), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+
+/* envoy.type.metadata.v3.MetadataKey.PathSegment */
+
+UPB_INLINE envoy_type_metadata_v3_MetadataKey_PathSegment *envoy_type_metadata_v3_MetadataKey_PathSegment_new(upb_arena *arena) {
+ return (envoy_type_metadata_v3_MetadataKey_PathSegment *)_upb_msg_new(&envoy_type_metadata_v3_MetadataKey_PathSegment_msginit, arena);
+}
+UPB_INLINE envoy_type_metadata_v3_MetadataKey_PathSegment *envoy_type_metadata_v3_MetadataKey_PathSegment_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_type_metadata_v3_MetadataKey_PathSegment *ret = envoy_type_metadata_v3_MetadataKey_PathSegment_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_type_metadata_v3_MetadataKey_PathSegment_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_type_metadata_v3_MetadataKey_PathSegment_serialize(const envoy_type_metadata_v3_MetadataKey_PathSegment *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_type_metadata_v3_MetadataKey_PathSegment_msginit, arena, len);
+}
+
+typedef enum {
+ envoy_type_metadata_v3_MetadataKey_PathSegment_segment_key = 1,
+ envoy_type_metadata_v3_MetadataKey_PathSegment_segment_NOT_SET = 0
+} envoy_type_metadata_v3_MetadataKey_PathSegment_segment_oneofcases;
+UPB_INLINE envoy_type_metadata_v3_MetadataKey_PathSegment_segment_oneofcases envoy_type_metadata_v3_MetadataKey_PathSegment_segment_case(const envoy_type_metadata_v3_MetadataKey_PathSegment* msg) { return (envoy_type_metadata_v3_MetadataKey_PathSegment_segment_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(8, 16), int32_t); }
+
+UPB_INLINE bool envoy_type_metadata_v3_MetadataKey_PathSegment_has_key(const envoy_type_metadata_v3_MetadataKey_PathSegment *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 1; }
+UPB_INLINE upb_strview envoy_type_metadata_v3_MetadataKey_PathSegment_key(const envoy_type_metadata_v3_MetadataKey_PathSegment *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 1, upb_strview_make("", strlen(""))); }
+
+UPB_INLINE void envoy_type_metadata_v3_MetadataKey_PathSegment_set_key(envoy_type_metadata_v3_MetadataKey_PathSegment *msg, upb_strview value) {
+ UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 1);
+}
+
+/* envoy.type.metadata.v3.MetadataKind */
+
+UPB_INLINE envoy_type_metadata_v3_MetadataKind *envoy_type_metadata_v3_MetadataKind_new(upb_arena *arena) {
+ return (envoy_type_metadata_v3_MetadataKind *)_upb_msg_new(&envoy_type_metadata_v3_MetadataKind_msginit, arena);
+}
+UPB_INLINE envoy_type_metadata_v3_MetadataKind *envoy_type_metadata_v3_MetadataKind_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_type_metadata_v3_MetadataKind *ret = envoy_type_metadata_v3_MetadataKind_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_type_metadata_v3_MetadataKind_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_type_metadata_v3_MetadataKind_serialize(const envoy_type_metadata_v3_MetadataKind *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_type_metadata_v3_MetadataKind_msginit, arena, len);
+}
+
+typedef enum {
+ envoy_type_metadata_v3_MetadataKind_kind_request = 1,
+ envoy_type_metadata_v3_MetadataKind_kind_route = 2,
+ envoy_type_metadata_v3_MetadataKind_kind_cluster = 3,
+ envoy_type_metadata_v3_MetadataKind_kind_host = 4,
+ envoy_type_metadata_v3_MetadataKind_kind_NOT_SET = 0
+} envoy_type_metadata_v3_MetadataKind_kind_oneofcases;
+UPB_INLINE envoy_type_metadata_v3_MetadataKind_kind_oneofcases envoy_type_metadata_v3_MetadataKind_kind_case(const envoy_type_metadata_v3_MetadataKind* msg) { return (envoy_type_metadata_v3_MetadataKind_kind_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 8), int32_t); }
+
+UPB_INLINE bool envoy_type_metadata_v3_MetadataKind_has_request(const envoy_type_metadata_v3_MetadataKind *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 1; }
+UPB_INLINE const envoy_type_metadata_v3_MetadataKind_Request* envoy_type_metadata_v3_MetadataKind_request(const envoy_type_metadata_v3_MetadataKind *msg) { return UPB_READ_ONEOF(msg, const envoy_type_metadata_v3_MetadataKind_Request*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 1, NULL); }
+UPB_INLINE bool envoy_type_metadata_v3_MetadataKind_has_route(const envoy_type_metadata_v3_MetadataKind *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 2; }
+UPB_INLINE const envoy_type_metadata_v3_MetadataKind_Route* envoy_type_metadata_v3_MetadataKind_route(const envoy_type_metadata_v3_MetadataKind *msg) { return UPB_READ_ONEOF(msg, const envoy_type_metadata_v3_MetadataKind_Route*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 2, NULL); }
+UPB_INLINE bool envoy_type_metadata_v3_MetadataKind_has_cluster(const envoy_type_metadata_v3_MetadataKind *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 3; }
+UPB_INLINE const envoy_type_metadata_v3_MetadataKind_Cluster* envoy_type_metadata_v3_MetadataKind_cluster(const envoy_type_metadata_v3_MetadataKind *msg) { return UPB_READ_ONEOF(msg, const envoy_type_metadata_v3_MetadataKind_Cluster*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 3, NULL); }
+UPB_INLINE bool envoy_type_metadata_v3_MetadataKind_has_host(const envoy_type_metadata_v3_MetadataKind *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 4; }
+UPB_INLINE const envoy_type_metadata_v3_MetadataKind_Host* envoy_type_metadata_v3_MetadataKind_host(const envoy_type_metadata_v3_MetadataKind *msg) { return UPB_READ_ONEOF(msg, const envoy_type_metadata_v3_MetadataKind_Host*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 4, NULL); }
+
+UPB_INLINE void envoy_type_metadata_v3_MetadataKind_set_request(envoy_type_metadata_v3_MetadataKind *msg, envoy_type_metadata_v3_MetadataKind_Request* value) {
+ UPB_WRITE_ONEOF(msg, envoy_type_metadata_v3_MetadataKind_Request*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 1);
+}
+UPB_INLINE struct envoy_type_metadata_v3_MetadataKind_Request* envoy_type_metadata_v3_MetadataKind_mutable_request(envoy_type_metadata_v3_MetadataKind *msg, upb_arena *arena) {
+ struct envoy_type_metadata_v3_MetadataKind_Request* sub = (struct envoy_type_metadata_v3_MetadataKind_Request*)envoy_type_metadata_v3_MetadataKind_request(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_type_metadata_v3_MetadataKind_Request*)_upb_msg_new(&envoy_type_metadata_v3_MetadataKind_Request_msginit, arena);
+ if (!sub) return NULL;
+ envoy_type_metadata_v3_MetadataKind_set_request(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_type_metadata_v3_MetadataKind_set_route(envoy_type_metadata_v3_MetadataKind *msg, envoy_type_metadata_v3_MetadataKind_Route* value) {
+ UPB_WRITE_ONEOF(msg, envoy_type_metadata_v3_MetadataKind_Route*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 2);
+}
+UPB_INLINE struct envoy_type_metadata_v3_MetadataKind_Route* envoy_type_metadata_v3_MetadataKind_mutable_route(envoy_type_metadata_v3_MetadataKind *msg, upb_arena *arena) {
+ struct envoy_type_metadata_v3_MetadataKind_Route* sub = (struct envoy_type_metadata_v3_MetadataKind_Route*)envoy_type_metadata_v3_MetadataKind_route(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_type_metadata_v3_MetadataKind_Route*)_upb_msg_new(&envoy_type_metadata_v3_MetadataKind_Route_msginit, arena);
+ if (!sub) return NULL;
+ envoy_type_metadata_v3_MetadataKind_set_route(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_type_metadata_v3_MetadataKind_set_cluster(envoy_type_metadata_v3_MetadataKind *msg, envoy_type_metadata_v3_MetadataKind_Cluster* value) {
+ UPB_WRITE_ONEOF(msg, envoy_type_metadata_v3_MetadataKind_Cluster*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 3);
+}
+UPB_INLINE struct envoy_type_metadata_v3_MetadataKind_Cluster* envoy_type_metadata_v3_MetadataKind_mutable_cluster(envoy_type_metadata_v3_MetadataKind *msg, upb_arena *arena) {
+ struct envoy_type_metadata_v3_MetadataKind_Cluster* sub = (struct envoy_type_metadata_v3_MetadataKind_Cluster*)envoy_type_metadata_v3_MetadataKind_cluster(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_type_metadata_v3_MetadataKind_Cluster*)_upb_msg_new(&envoy_type_metadata_v3_MetadataKind_Cluster_msginit, arena);
+ if (!sub) return NULL;
+ envoy_type_metadata_v3_MetadataKind_set_cluster(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_type_metadata_v3_MetadataKind_set_host(envoy_type_metadata_v3_MetadataKind *msg, envoy_type_metadata_v3_MetadataKind_Host* value) {
+ UPB_WRITE_ONEOF(msg, envoy_type_metadata_v3_MetadataKind_Host*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 4);
+}
+UPB_INLINE struct envoy_type_metadata_v3_MetadataKind_Host* envoy_type_metadata_v3_MetadataKind_mutable_host(envoy_type_metadata_v3_MetadataKind *msg, upb_arena *arena) {
+ struct envoy_type_metadata_v3_MetadataKind_Host* sub = (struct envoy_type_metadata_v3_MetadataKind_Host*)envoy_type_metadata_v3_MetadataKind_host(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_type_metadata_v3_MetadataKind_Host*)_upb_msg_new(&envoy_type_metadata_v3_MetadataKind_Host_msginit, arena);
+ if (!sub) return NULL;
+ envoy_type_metadata_v3_MetadataKind_set_host(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.type.metadata.v3.MetadataKind.Request */
+
+UPB_INLINE envoy_type_metadata_v3_MetadataKind_Request *envoy_type_metadata_v3_MetadataKind_Request_new(upb_arena *arena) {
+ return (envoy_type_metadata_v3_MetadataKind_Request *)_upb_msg_new(&envoy_type_metadata_v3_MetadataKind_Request_msginit, arena);
+}
+UPB_INLINE envoy_type_metadata_v3_MetadataKind_Request *envoy_type_metadata_v3_MetadataKind_Request_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_type_metadata_v3_MetadataKind_Request *ret = envoy_type_metadata_v3_MetadataKind_Request_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_type_metadata_v3_MetadataKind_Request_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_type_metadata_v3_MetadataKind_Request_serialize(const envoy_type_metadata_v3_MetadataKind_Request *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_type_metadata_v3_MetadataKind_Request_msginit, arena, len);
+}
+
+
+
+/* envoy.type.metadata.v3.MetadataKind.Route */
+
+UPB_INLINE envoy_type_metadata_v3_MetadataKind_Route *envoy_type_metadata_v3_MetadataKind_Route_new(upb_arena *arena) {
+ return (envoy_type_metadata_v3_MetadataKind_Route *)_upb_msg_new(&envoy_type_metadata_v3_MetadataKind_Route_msginit, arena);
+}
+UPB_INLINE envoy_type_metadata_v3_MetadataKind_Route *envoy_type_metadata_v3_MetadataKind_Route_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_type_metadata_v3_MetadataKind_Route *ret = envoy_type_metadata_v3_MetadataKind_Route_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_type_metadata_v3_MetadataKind_Route_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_type_metadata_v3_MetadataKind_Route_serialize(const envoy_type_metadata_v3_MetadataKind_Route *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_type_metadata_v3_MetadataKind_Route_msginit, arena, len);
+}
+
+
+
+/* envoy.type.metadata.v3.MetadataKind.Cluster */
+
+UPB_INLINE envoy_type_metadata_v3_MetadataKind_Cluster *envoy_type_metadata_v3_MetadataKind_Cluster_new(upb_arena *arena) {
+ return (envoy_type_metadata_v3_MetadataKind_Cluster *)_upb_msg_new(&envoy_type_metadata_v3_MetadataKind_Cluster_msginit, arena);
+}
+UPB_INLINE envoy_type_metadata_v3_MetadataKind_Cluster *envoy_type_metadata_v3_MetadataKind_Cluster_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_type_metadata_v3_MetadataKind_Cluster *ret = envoy_type_metadata_v3_MetadataKind_Cluster_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_type_metadata_v3_MetadataKind_Cluster_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_type_metadata_v3_MetadataKind_Cluster_serialize(const envoy_type_metadata_v3_MetadataKind_Cluster *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_type_metadata_v3_MetadataKind_Cluster_msginit, arena, len);
+}
+
+
+
+/* envoy.type.metadata.v3.MetadataKind.Host */
+
+UPB_INLINE envoy_type_metadata_v3_MetadataKind_Host *envoy_type_metadata_v3_MetadataKind_Host_new(upb_arena *arena) {
+ return (envoy_type_metadata_v3_MetadataKind_Host *)_upb_msg_new(&envoy_type_metadata_v3_MetadataKind_Host_msginit, arena);
+}
+UPB_INLINE envoy_type_metadata_v3_MetadataKind_Host *envoy_type_metadata_v3_MetadataKind_Host_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_type_metadata_v3_MetadataKind_Host *ret = envoy_type_metadata_v3_MetadataKind_Host_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_type_metadata_v3_MetadataKind_Host_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_type_metadata_v3_MetadataKind_Host_serialize(const envoy_type_metadata_v3_MetadataKind_Host *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_type_metadata_v3_MetadataKind_Host_msginit, arena, len);
+}
+
+
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_TYPE_METADATA_V3_METADATA_PROTO_UPB_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.c
index 3d97470ac47..6db08468a5a 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.c
@@ -1,90 +1,90 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/type/tracing/v3/custom_tag.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include <stddef.h>
-#include "upb/msg.h"
-#include "envoy/type/tracing/v3/custom_tag.upb.h"
-#include "envoy/type/metadata/v3/metadata.upb.h"
-#include "udpa/annotations/status.upb.h"
-#include "udpa/annotations/versioning.upb.h"
-#include "validate/validate.upb.h"
-
-#include "upb/port_def.inc"
-
-static const upb_msglayout *const envoy_type_tracing_v3_CustomTag_submsgs[4] = {
- &envoy_type_tracing_v3_CustomTag_Environment_msginit,
- &envoy_type_tracing_v3_CustomTag_Header_msginit,
- &envoy_type_tracing_v3_CustomTag_Literal_msginit,
- &envoy_type_tracing_v3_CustomTag_Metadata_msginit,
-};
-
-static const upb_msglayout_field envoy_type_tracing_v3_CustomTag__fields[5] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 2, 11, 1},
- {3, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, 1},
- {4, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 1, 11, 1},
- {5, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 3, 11, 1},
-};
-
-const upb_msglayout envoy_type_tracing_v3_CustomTag_msginit = {
- &envoy_type_tracing_v3_CustomTag_submsgs[0],
- &envoy_type_tracing_v3_CustomTag__fields[0],
- UPB_SIZE(16, 32), 5, false,
-};
-
-static const upb_msglayout_field envoy_type_tracing_v3_CustomTag_Literal__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
-};
-
-const upb_msglayout envoy_type_tracing_v3_CustomTag_Literal_msginit = {
- NULL,
- &envoy_type_tracing_v3_CustomTag_Literal__fields[0],
- UPB_SIZE(8, 16), 1, false,
-};
-
-static const upb_msglayout_field envoy_type_tracing_v3_CustomTag_Environment__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 9, 1},
-};
-
-const upb_msglayout envoy_type_tracing_v3_CustomTag_Environment_msginit = {
- NULL,
- &envoy_type_tracing_v3_CustomTag_Environment__fields[0],
- UPB_SIZE(16, 32), 2, false,
-};
-
-static const upb_msglayout_field envoy_type_tracing_v3_CustomTag_Header__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 9, 1},
-};
-
-const upb_msglayout envoy_type_tracing_v3_CustomTag_Header_msginit = {
- NULL,
- &envoy_type_tracing_v3_CustomTag_Header__fields[0],
- UPB_SIZE(16, 32), 2, false,
-};
-
-static const upb_msglayout *const envoy_type_tracing_v3_CustomTag_Metadata_submsgs[2] = {
- &envoy_type_metadata_v3_MetadataKey_msginit,
- &envoy_type_metadata_v3_MetadataKind_msginit,
-};
-
-static const upb_msglayout_field envoy_type_tracing_v3_CustomTag_Metadata__fields[3] = {
- {1, UPB_SIZE(8, 16), 0, 1, 11, 1},
- {2, UPB_SIZE(12, 24), 0, 0, 11, 1},
- {3, UPB_SIZE(0, 0), 0, 0, 9, 1},
-};
-
-const upb_msglayout envoy_type_tracing_v3_CustomTag_Metadata_msginit = {
- &envoy_type_tracing_v3_CustomTag_Metadata_submsgs[0],
- &envoy_type_tracing_v3_CustomTag_Metadata__fields[0],
- UPB_SIZE(16, 32), 3, false,
-};
-
-#include "upb/port_undef.inc"
-
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/type/tracing/v3/custom_tag.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg.h"
+#include "envoy/type/tracing/v3/custom_tag.upb.h"
+#include "envoy/type/metadata/v3/metadata.upb.h"
+#include "udpa/annotations/status.upb.h"
+#include "udpa/annotations/versioning.upb.h"
+#include "validate/validate.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_msglayout *const envoy_type_tracing_v3_CustomTag_submsgs[4] = {
+ &envoy_type_tracing_v3_CustomTag_Environment_msginit,
+ &envoy_type_tracing_v3_CustomTag_Header_msginit,
+ &envoy_type_tracing_v3_CustomTag_Literal_msginit,
+ &envoy_type_tracing_v3_CustomTag_Metadata_msginit,
+};
+
+static const upb_msglayout_field envoy_type_tracing_v3_CustomTag__fields[5] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 2, 11, 1},
+ {3, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, 1},
+ {4, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 1, 11, 1},
+ {5, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 3, 11, 1},
+};
+
+const upb_msglayout envoy_type_tracing_v3_CustomTag_msginit = {
+ &envoy_type_tracing_v3_CustomTag_submsgs[0],
+ &envoy_type_tracing_v3_CustomTag__fields[0],
+ UPB_SIZE(16, 32), 5, false,
+};
+
+static const upb_msglayout_field envoy_type_tracing_v3_CustomTag_Literal__fields[1] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+};
+
+const upb_msglayout envoy_type_tracing_v3_CustomTag_Literal_msginit = {
+ NULL,
+ &envoy_type_tracing_v3_CustomTag_Literal__fields[0],
+ UPB_SIZE(8, 16), 1, false,
+};
+
+static const upb_msglayout_field envoy_type_tracing_v3_CustomTag_Environment__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {2, UPB_SIZE(8, 16), 0, 0, 9, 1},
+};
+
+const upb_msglayout envoy_type_tracing_v3_CustomTag_Environment_msginit = {
+ NULL,
+ &envoy_type_tracing_v3_CustomTag_Environment__fields[0],
+ UPB_SIZE(16, 32), 2, false,
+};
+
+static const upb_msglayout_field envoy_type_tracing_v3_CustomTag_Header__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {2, UPB_SIZE(8, 16), 0, 0, 9, 1},
+};
+
+const upb_msglayout envoy_type_tracing_v3_CustomTag_Header_msginit = {
+ NULL,
+ &envoy_type_tracing_v3_CustomTag_Header__fields[0],
+ UPB_SIZE(16, 32), 2, false,
+};
+
+static const upb_msglayout *const envoy_type_tracing_v3_CustomTag_Metadata_submsgs[2] = {
+ &envoy_type_metadata_v3_MetadataKey_msginit,
+ &envoy_type_metadata_v3_MetadataKind_msginit,
+};
+
+static const upb_msglayout_field envoy_type_tracing_v3_CustomTag_Metadata__fields[3] = {
+ {1, UPB_SIZE(8, 16), 0, 1, 11, 1},
+ {2, UPB_SIZE(12, 24), 0, 0, 11, 1},
+ {3, UPB_SIZE(0, 0), 0, 0, 9, 1},
+};
+
+const upb_msglayout envoy_type_tracing_v3_CustomTag_Metadata_msginit = {
+ &envoy_type_tracing_v3_CustomTag_Metadata_submsgs[0],
+ &envoy_type_tracing_v3_CustomTag_Metadata__fields[0],
+ UPB_SIZE(16, 32), 3, false,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.h
index d73ebcf93a8..f72eac43ad4 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.h
@@ -1,250 +1,250 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/type/tracing/v3/custom_tag.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef ENVOY_TYPE_TRACING_V3_CUSTOM_TAG_PROTO_UPB_H_
-#define ENVOY_TYPE_TRACING_V3_CUSTOM_TAG_PROTO_UPB_H_
-
-#include "upb/msg.h"
-#include "upb/decode.h"
-#include "upb/encode.h"
-
-#include "upb/port_def.inc"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct envoy_type_tracing_v3_CustomTag;
-struct envoy_type_tracing_v3_CustomTag_Literal;
-struct envoy_type_tracing_v3_CustomTag_Environment;
-struct envoy_type_tracing_v3_CustomTag_Header;
-struct envoy_type_tracing_v3_CustomTag_Metadata;
-typedef struct envoy_type_tracing_v3_CustomTag envoy_type_tracing_v3_CustomTag;
-typedef struct envoy_type_tracing_v3_CustomTag_Literal envoy_type_tracing_v3_CustomTag_Literal;
-typedef struct envoy_type_tracing_v3_CustomTag_Environment envoy_type_tracing_v3_CustomTag_Environment;
-typedef struct envoy_type_tracing_v3_CustomTag_Header envoy_type_tracing_v3_CustomTag_Header;
-typedef struct envoy_type_tracing_v3_CustomTag_Metadata envoy_type_tracing_v3_CustomTag_Metadata;
-extern const upb_msglayout envoy_type_tracing_v3_CustomTag_msginit;
-extern const upb_msglayout envoy_type_tracing_v3_CustomTag_Literal_msginit;
-extern const upb_msglayout envoy_type_tracing_v3_CustomTag_Environment_msginit;
-extern const upb_msglayout envoy_type_tracing_v3_CustomTag_Header_msginit;
-extern const upb_msglayout envoy_type_tracing_v3_CustomTag_Metadata_msginit;
-struct envoy_type_metadata_v3_MetadataKey;
-struct envoy_type_metadata_v3_MetadataKind;
-extern const upb_msglayout envoy_type_metadata_v3_MetadataKey_msginit;
-extern const upb_msglayout envoy_type_metadata_v3_MetadataKind_msginit;
-
-
-/* envoy.type.tracing.v3.CustomTag */
-
-UPB_INLINE envoy_type_tracing_v3_CustomTag *envoy_type_tracing_v3_CustomTag_new(upb_arena *arena) {
- return (envoy_type_tracing_v3_CustomTag *)_upb_msg_new(&envoy_type_tracing_v3_CustomTag_msginit, arena);
-}
-UPB_INLINE envoy_type_tracing_v3_CustomTag *envoy_type_tracing_v3_CustomTag_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_type_tracing_v3_CustomTag *ret = envoy_type_tracing_v3_CustomTag_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_type_tracing_v3_CustomTag_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_type_tracing_v3_CustomTag_serialize(const envoy_type_tracing_v3_CustomTag *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_type_tracing_v3_CustomTag_msginit, arena, len);
-}
-
-typedef enum {
- envoy_type_tracing_v3_CustomTag_type_literal = 2,
- envoy_type_tracing_v3_CustomTag_type_environment = 3,
- envoy_type_tracing_v3_CustomTag_type_request_header = 4,
- envoy_type_tracing_v3_CustomTag_type_metadata = 5,
- envoy_type_tracing_v3_CustomTag_type_NOT_SET = 0
-} envoy_type_tracing_v3_CustomTag_type_oneofcases;
-UPB_INLINE envoy_type_tracing_v3_CustomTag_type_oneofcases envoy_type_tracing_v3_CustomTag_type_case(const envoy_type_tracing_v3_CustomTag* msg) { return (envoy_type_tracing_v3_CustomTag_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(12, 24), int32_t); }
-
-UPB_INLINE upb_strview envoy_type_tracing_v3_CustomTag_tag(const envoy_type_tracing_v3_CustomTag *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE bool envoy_type_tracing_v3_CustomTag_has_literal(const envoy_type_tracing_v3_CustomTag *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 2; }
-UPB_INLINE const envoy_type_tracing_v3_CustomTag_Literal* envoy_type_tracing_v3_CustomTag_literal(const envoy_type_tracing_v3_CustomTag *msg) { return UPB_READ_ONEOF(msg, const envoy_type_tracing_v3_CustomTag_Literal*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 2, NULL); }
-UPB_INLINE bool envoy_type_tracing_v3_CustomTag_has_environment(const envoy_type_tracing_v3_CustomTag *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 3; }
-UPB_INLINE const envoy_type_tracing_v3_CustomTag_Environment* envoy_type_tracing_v3_CustomTag_environment(const envoy_type_tracing_v3_CustomTag *msg) { return UPB_READ_ONEOF(msg, const envoy_type_tracing_v3_CustomTag_Environment*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 3, NULL); }
-UPB_INLINE bool envoy_type_tracing_v3_CustomTag_has_request_header(const envoy_type_tracing_v3_CustomTag *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 4; }
-UPB_INLINE const envoy_type_tracing_v3_CustomTag_Header* envoy_type_tracing_v3_CustomTag_request_header(const envoy_type_tracing_v3_CustomTag *msg) { return UPB_READ_ONEOF(msg, const envoy_type_tracing_v3_CustomTag_Header*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 4, NULL); }
-UPB_INLINE bool envoy_type_tracing_v3_CustomTag_has_metadata(const envoy_type_tracing_v3_CustomTag *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 5; }
-UPB_INLINE const envoy_type_tracing_v3_CustomTag_Metadata* envoy_type_tracing_v3_CustomTag_metadata(const envoy_type_tracing_v3_CustomTag *msg) { return UPB_READ_ONEOF(msg, const envoy_type_tracing_v3_CustomTag_Metadata*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 5, NULL); }
-
-UPB_INLINE void envoy_type_tracing_v3_CustomTag_set_tag(envoy_type_tracing_v3_CustomTag *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-UPB_INLINE void envoy_type_tracing_v3_CustomTag_set_literal(envoy_type_tracing_v3_CustomTag *msg, envoy_type_tracing_v3_CustomTag_Literal* value) {
- UPB_WRITE_ONEOF(msg, envoy_type_tracing_v3_CustomTag_Literal*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 2);
-}
-UPB_INLINE struct envoy_type_tracing_v3_CustomTag_Literal* envoy_type_tracing_v3_CustomTag_mutable_literal(envoy_type_tracing_v3_CustomTag *msg, upb_arena *arena) {
- struct envoy_type_tracing_v3_CustomTag_Literal* sub = (struct envoy_type_tracing_v3_CustomTag_Literal*)envoy_type_tracing_v3_CustomTag_literal(msg);
- if (sub == NULL) {
- sub = (struct envoy_type_tracing_v3_CustomTag_Literal*)_upb_msg_new(&envoy_type_tracing_v3_CustomTag_Literal_msginit, arena);
- if (!sub) return NULL;
- envoy_type_tracing_v3_CustomTag_set_literal(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_type_tracing_v3_CustomTag_set_environment(envoy_type_tracing_v3_CustomTag *msg, envoy_type_tracing_v3_CustomTag_Environment* value) {
- UPB_WRITE_ONEOF(msg, envoy_type_tracing_v3_CustomTag_Environment*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 3);
-}
-UPB_INLINE struct envoy_type_tracing_v3_CustomTag_Environment* envoy_type_tracing_v3_CustomTag_mutable_environment(envoy_type_tracing_v3_CustomTag *msg, upb_arena *arena) {
- struct envoy_type_tracing_v3_CustomTag_Environment* sub = (struct envoy_type_tracing_v3_CustomTag_Environment*)envoy_type_tracing_v3_CustomTag_environment(msg);
- if (sub == NULL) {
- sub = (struct envoy_type_tracing_v3_CustomTag_Environment*)_upb_msg_new(&envoy_type_tracing_v3_CustomTag_Environment_msginit, arena);
- if (!sub) return NULL;
- envoy_type_tracing_v3_CustomTag_set_environment(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_type_tracing_v3_CustomTag_set_request_header(envoy_type_tracing_v3_CustomTag *msg, envoy_type_tracing_v3_CustomTag_Header* value) {
- UPB_WRITE_ONEOF(msg, envoy_type_tracing_v3_CustomTag_Header*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 4);
-}
-UPB_INLINE struct envoy_type_tracing_v3_CustomTag_Header* envoy_type_tracing_v3_CustomTag_mutable_request_header(envoy_type_tracing_v3_CustomTag *msg, upb_arena *arena) {
- struct envoy_type_tracing_v3_CustomTag_Header* sub = (struct envoy_type_tracing_v3_CustomTag_Header*)envoy_type_tracing_v3_CustomTag_request_header(msg);
- if (sub == NULL) {
- sub = (struct envoy_type_tracing_v3_CustomTag_Header*)_upb_msg_new(&envoy_type_tracing_v3_CustomTag_Header_msginit, arena);
- if (!sub) return NULL;
- envoy_type_tracing_v3_CustomTag_set_request_header(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_type_tracing_v3_CustomTag_set_metadata(envoy_type_tracing_v3_CustomTag *msg, envoy_type_tracing_v3_CustomTag_Metadata* value) {
- UPB_WRITE_ONEOF(msg, envoy_type_tracing_v3_CustomTag_Metadata*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 5);
-}
-UPB_INLINE struct envoy_type_tracing_v3_CustomTag_Metadata* envoy_type_tracing_v3_CustomTag_mutable_metadata(envoy_type_tracing_v3_CustomTag *msg, upb_arena *arena) {
- struct envoy_type_tracing_v3_CustomTag_Metadata* sub = (struct envoy_type_tracing_v3_CustomTag_Metadata*)envoy_type_tracing_v3_CustomTag_metadata(msg);
- if (sub == NULL) {
- sub = (struct envoy_type_tracing_v3_CustomTag_Metadata*)_upb_msg_new(&envoy_type_tracing_v3_CustomTag_Metadata_msginit, arena);
- if (!sub) return NULL;
- envoy_type_tracing_v3_CustomTag_set_metadata(msg, sub);
- }
- return sub;
-}
-
-/* envoy.type.tracing.v3.CustomTag.Literal */
-
-UPB_INLINE envoy_type_tracing_v3_CustomTag_Literal *envoy_type_tracing_v3_CustomTag_Literal_new(upb_arena *arena) {
- return (envoy_type_tracing_v3_CustomTag_Literal *)_upb_msg_new(&envoy_type_tracing_v3_CustomTag_Literal_msginit, arena);
-}
-UPB_INLINE envoy_type_tracing_v3_CustomTag_Literal *envoy_type_tracing_v3_CustomTag_Literal_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_type_tracing_v3_CustomTag_Literal *ret = envoy_type_tracing_v3_CustomTag_Literal_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_type_tracing_v3_CustomTag_Literal_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_type_tracing_v3_CustomTag_Literal_serialize(const envoy_type_tracing_v3_CustomTag_Literal *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_type_tracing_v3_CustomTag_Literal_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview envoy_type_tracing_v3_CustomTag_Literal_value(const envoy_type_tracing_v3_CustomTag_Literal *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-
-UPB_INLINE void envoy_type_tracing_v3_CustomTag_Literal_set_value(envoy_type_tracing_v3_CustomTag_Literal *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-
-/* envoy.type.tracing.v3.CustomTag.Environment */
-
-UPB_INLINE envoy_type_tracing_v3_CustomTag_Environment *envoy_type_tracing_v3_CustomTag_Environment_new(upb_arena *arena) {
- return (envoy_type_tracing_v3_CustomTag_Environment *)_upb_msg_new(&envoy_type_tracing_v3_CustomTag_Environment_msginit, arena);
-}
-UPB_INLINE envoy_type_tracing_v3_CustomTag_Environment *envoy_type_tracing_v3_CustomTag_Environment_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_type_tracing_v3_CustomTag_Environment *ret = envoy_type_tracing_v3_CustomTag_Environment_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_type_tracing_v3_CustomTag_Environment_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_type_tracing_v3_CustomTag_Environment_serialize(const envoy_type_tracing_v3_CustomTag_Environment *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_type_tracing_v3_CustomTag_Environment_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview envoy_type_tracing_v3_CustomTag_Environment_name(const envoy_type_tracing_v3_CustomTag_Environment *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE upb_strview envoy_type_tracing_v3_CustomTag_Environment_default_value(const envoy_type_tracing_v3_CustomTag_Environment *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview); }
-
-UPB_INLINE void envoy_type_tracing_v3_CustomTag_Environment_set_name(envoy_type_tracing_v3_CustomTag_Environment *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-UPB_INLINE void envoy_type_tracing_v3_CustomTag_Environment_set_default_value(envoy_type_tracing_v3_CustomTag_Environment *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview) = value;
-}
-
-/* envoy.type.tracing.v3.CustomTag.Header */
-
-UPB_INLINE envoy_type_tracing_v3_CustomTag_Header *envoy_type_tracing_v3_CustomTag_Header_new(upb_arena *arena) {
- return (envoy_type_tracing_v3_CustomTag_Header *)_upb_msg_new(&envoy_type_tracing_v3_CustomTag_Header_msginit, arena);
-}
-UPB_INLINE envoy_type_tracing_v3_CustomTag_Header *envoy_type_tracing_v3_CustomTag_Header_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_type_tracing_v3_CustomTag_Header *ret = envoy_type_tracing_v3_CustomTag_Header_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_type_tracing_v3_CustomTag_Header_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_type_tracing_v3_CustomTag_Header_serialize(const envoy_type_tracing_v3_CustomTag_Header *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_type_tracing_v3_CustomTag_Header_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview envoy_type_tracing_v3_CustomTag_Header_name(const envoy_type_tracing_v3_CustomTag_Header *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE upb_strview envoy_type_tracing_v3_CustomTag_Header_default_value(const envoy_type_tracing_v3_CustomTag_Header *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview); }
-
-UPB_INLINE void envoy_type_tracing_v3_CustomTag_Header_set_name(envoy_type_tracing_v3_CustomTag_Header *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-UPB_INLINE void envoy_type_tracing_v3_CustomTag_Header_set_default_value(envoy_type_tracing_v3_CustomTag_Header *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview) = value;
-}
-
-/* envoy.type.tracing.v3.CustomTag.Metadata */
-
-UPB_INLINE envoy_type_tracing_v3_CustomTag_Metadata *envoy_type_tracing_v3_CustomTag_Metadata_new(upb_arena *arena) {
- return (envoy_type_tracing_v3_CustomTag_Metadata *)_upb_msg_new(&envoy_type_tracing_v3_CustomTag_Metadata_msginit, arena);
-}
-UPB_INLINE envoy_type_tracing_v3_CustomTag_Metadata *envoy_type_tracing_v3_CustomTag_Metadata_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_type_tracing_v3_CustomTag_Metadata *ret = envoy_type_tracing_v3_CustomTag_Metadata_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_type_tracing_v3_CustomTag_Metadata_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_type_tracing_v3_CustomTag_Metadata_serialize(const envoy_type_tracing_v3_CustomTag_Metadata *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_type_tracing_v3_CustomTag_Metadata_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_type_tracing_v3_CustomTag_Metadata_has_kind(const envoy_type_tracing_v3_CustomTag_Metadata *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const struct envoy_type_metadata_v3_MetadataKind* envoy_type_tracing_v3_CustomTag_Metadata_kind(const envoy_type_tracing_v3_CustomTag_Metadata *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct envoy_type_metadata_v3_MetadataKind*); }
-UPB_INLINE bool envoy_type_tracing_v3_CustomTag_Metadata_has_metadata_key(const envoy_type_tracing_v3_CustomTag_Metadata *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
-UPB_INLINE const struct envoy_type_metadata_v3_MetadataKey* envoy_type_tracing_v3_CustomTag_Metadata_metadata_key(const envoy_type_tracing_v3_CustomTag_Metadata *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct envoy_type_metadata_v3_MetadataKey*); }
-UPB_INLINE upb_strview envoy_type_tracing_v3_CustomTag_Metadata_default_value(const envoy_type_tracing_v3_CustomTag_Metadata *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-
-UPB_INLINE void envoy_type_tracing_v3_CustomTag_Metadata_set_kind(envoy_type_tracing_v3_CustomTag_Metadata *msg, struct envoy_type_metadata_v3_MetadataKind* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct envoy_type_metadata_v3_MetadataKind*) = value;
-}
-UPB_INLINE struct envoy_type_metadata_v3_MetadataKind* envoy_type_tracing_v3_CustomTag_Metadata_mutable_kind(envoy_type_tracing_v3_CustomTag_Metadata *msg, upb_arena *arena) {
- struct envoy_type_metadata_v3_MetadataKind* sub = (struct envoy_type_metadata_v3_MetadataKind*)envoy_type_tracing_v3_CustomTag_Metadata_kind(msg);
- if (sub == NULL) {
- sub = (struct envoy_type_metadata_v3_MetadataKind*)_upb_msg_new(&envoy_type_metadata_v3_MetadataKind_msginit, arena);
- if (!sub) return NULL;
- envoy_type_tracing_v3_CustomTag_Metadata_set_kind(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_type_tracing_v3_CustomTag_Metadata_set_metadata_key(envoy_type_tracing_v3_CustomTag_Metadata *msg, struct envoy_type_metadata_v3_MetadataKey* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct envoy_type_metadata_v3_MetadataKey*) = value;
-}
-UPB_INLINE struct envoy_type_metadata_v3_MetadataKey* envoy_type_tracing_v3_CustomTag_Metadata_mutable_metadata_key(envoy_type_tracing_v3_CustomTag_Metadata *msg, upb_arena *arena) {
- struct envoy_type_metadata_v3_MetadataKey* sub = (struct envoy_type_metadata_v3_MetadataKey*)envoy_type_tracing_v3_CustomTag_Metadata_metadata_key(msg);
- if (sub == NULL) {
- sub = (struct envoy_type_metadata_v3_MetadataKey*)_upb_msg_new(&envoy_type_metadata_v3_MetadataKey_msginit, arena);
- if (!sub) return NULL;
- envoy_type_tracing_v3_CustomTag_Metadata_set_metadata_key(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void envoy_type_tracing_v3_CustomTag_Metadata_set_default_value(envoy_type_tracing_v3_CustomTag_Metadata *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* ENVOY_TYPE_TRACING_V3_CUSTOM_TAG_PROTO_UPB_H_ */
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/type/tracing/v3/custom_tag.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_TYPE_TRACING_V3_CUSTOM_TAG_PROTO_UPB_H_
+#define ENVOY_TYPE_TRACING_V3_CUSTOM_TAG_PROTO_UPB_H_
+
+#include "upb/msg.h"
+#include "upb/decode.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_type_tracing_v3_CustomTag;
+struct envoy_type_tracing_v3_CustomTag_Literal;
+struct envoy_type_tracing_v3_CustomTag_Environment;
+struct envoy_type_tracing_v3_CustomTag_Header;
+struct envoy_type_tracing_v3_CustomTag_Metadata;
+typedef struct envoy_type_tracing_v3_CustomTag envoy_type_tracing_v3_CustomTag;
+typedef struct envoy_type_tracing_v3_CustomTag_Literal envoy_type_tracing_v3_CustomTag_Literal;
+typedef struct envoy_type_tracing_v3_CustomTag_Environment envoy_type_tracing_v3_CustomTag_Environment;
+typedef struct envoy_type_tracing_v3_CustomTag_Header envoy_type_tracing_v3_CustomTag_Header;
+typedef struct envoy_type_tracing_v3_CustomTag_Metadata envoy_type_tracing_v3_CustomTag_Metadata;
+extern const upb_msglayout envoy_type_tracing_v3_CustomTag_msginit;
+extern const upb_msglayout envoy_type_tracing_v3_CustomTag_Literal_msginit;
+extern const upb_msglayout envoy_type_tracing_v3_CustomTag_Environment_msginit;
+extern const upb_msglayout envoy_type_tracing_v3_CustomTag_Header_msginit;
+extern const upb_msglayout envoy_type_tracing_v3_CustomTag_Metadata_msginit;
+struct envoy_type_metadata_v3_MetadataKey;
+struct envoy_type_metadata_v3_MetadataKind;
+extern const upb_msglayout envoy_type_metadata_v3_MetadataKey_msginit;
+extern const upb_msglayout envoy_type_metadata_v3_MetadataKind_msginit;
+
+
+/* envoy.type.tracing.v3.CustomTag */
+
+UPB_INLINE envoy_type_tracing_v3_CustomTag *envoy_type_tracing_v3_CustomTag_new(upb_arena *arena) {
+ return (envoy_type_tracing_v3_CustomTag *)_upb_msg_new(&envoy_type_tracing_v3_CustomTag_msginit, arena);
+}
+UPB_INLINE envoy_type_tracing_v3_CustomTag *envoy_type_tracing_v3_CustomTag_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_type_tracing_v3_CustomTag *ret = envoy_type_tracing_v3_CustomTag_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_type_tracing_v3_CustomTag_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_type_tracing_v3_CustomTag_serialize(const envoy_type_tracing_v3_CustomTag *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_type_tracing_v3_CustomTag_msginit, arena, len);
+}
+
+typedef enum {
+ envoy_type_tracing_v3_CustomTag_type_literal = 2,
+ envoy_type_tracing_v3_CustomTag_type_environment = 3,
+ envoy_type_tracing_v3_CustomTag_type_request_header = 4,
+ envoy_type_tracing_v3_CustomTag_type_metadata = 5,
+ envoy_type_tracing_v3_CustomTag_type_NOT_SET = 0
+} envoy_type_tracing_v3_CustomTag_type_oneofcases;
+UPB_INLINE envoy_type_tracing_v3_CustomTag_type_oneofcases envoy_type_tracing_v3_CustomTag_type_case(const envoy_type_tracing_v3_CustomTag* msg) { return (envoy_type_tracing_v3_CustomTag_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(12, 24), int32_t); }
+
+UPB_INLINE upb_strview envoy_type_tracing_v3_CustomTag_tag(const envoy_type_tracing_v3_CustomTag *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE bool envoy_type_tracing_v3_CustomTag_has_literal(const envoy_type_tracing_v3_CustomTag *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 2; }
+UPB_INLINE const envoy_type_tracing_v3_CustomTag_Literal* envoy_type_tracing_v3_CustomTag_literal(const envoy_type_tracing_v3_CustomTag *msg) { return UPB_READ_ONEOF(msg, const envoy_type_tracing_v3_CustomTag_Literal*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 2, NULL); }
+UPB_INLINE bool envoy_type_tracing_v3_CustomTag_has_environment(const envoy_type_tracing_v3_CustomTag *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 3; }
+UPB_INLINE const envoy_type_tracing_v3_CustomTag_Environment* envoy_type_tracing_v3_CustomTag_environment(const envoy_type_tracing_v3_CustomTag *msg) { return UPB_READ_ONEOF(msg, const envoy_type_tracing_v3_CustomTag_Environment*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 3, NULL); }
+UPB_INLINE bool envoy_type_tracing_v3_CustomTag_has_request_header(const envoy_type_tracing_v3_CustomTag *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 4; }
+UPB_INLINE const envoy_type_tracing_v3_CustomTag_Header* envoy_type_tracing_v3_CustomTag_request_header(const envoy_type_tracing_v3_CustomTag *msg) { return UPB_READ_ONEOF(msg, const envoy_type_tracing_v3_CustomTag_Header*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 4, NULL); }
+UPB_INLINE bool envoy_type_tracing_v3_CustomTag_has_metadata(const envoy_type_tracing_v3_CustomTag *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 5; }
+UPB_INLINE const envoy_type_tracing_v3_CustomTag_Metadata* envoy_type_tracing_v3_CustomTag_metadata(const envoy_type_tracing_v3_CustomTag *msg) { return UPB_READ_ONEOF(msg, const envoy_type_tracing_v3_CustomTag_Metadata*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 5, NULL); }
+
+UPB_INLINE void envoy_type_tracing_v3_CustomTag_set_tag(envoy_type_tracing_v3_CustomTag *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+UPB_INLINE void envoy_type_tracing_v3_CustomTag_set_literal(envoy_type_tracing_v3_CustomTag *msg, envoy_type_tracing_v3_CustomTag_Literal* value) {
+ UPB_WRITE_ONEOF(msg, envoy_type_tracing_v3_CustomTag_Literal*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 2);
+}
+UPB_INLINE struct envoy_type_tracing_v3_CustomTag_Literal* envoy_type_tracing_v3_CustomTag_mutable_literal(envoy_type_tracing_v3_CustomTag *msg, upb_arena *arena) {
+ struct envoy_type_tracing_v3_CustomTag_Literal* sub = (struct envoy_type_tracing_v3_CustomTag_Literal*)envoy_type_tracing_v3_CustomTag_literal(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_type_tracing_v3_CustomTag_Literal*)_upb_msg_new(&envoy_type_tracing_v3_CustomTag_Literal_msginit, arena);
+ if (!sub) return NULL;
+ envoy_type_tracing_v3_CustomTag_set_literal(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_type_tracing_v3_CustomTag_set_environment(envoy_type_tracing_v3_CustomTag *msg, envoy_type_tracing_v3_CustomTag_Environment* value) {
+ UPB_WRITE_ONEOF(msg, envoy_type_tracing_v3_CustomTag_Environment*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 3);
+}
+UPB_INLINE struct envoy_type_tracing_v3_CustomTag_Environment* envoy_type_tracing_v3_CustomTag_mutable_environment(envoy_type_tracing_v3_CustomTag *msg, upb_arena *arena) {
+ struct envoy_type_tracing_v3_CustomTag_Environment* sub = (struct envoy_type_tracing_v3_CustomTag_Environment*)envoy_type_tracing_v3_CustomTag_environment(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_type_tracing_v3_CustomTag_Environment*)_upb_msg_new(&envoy_type_tracing_v3_CustomTag_Environment_msginit, arena);
+ if (!sub) return NULL;
+ envoy_type_tracing_v3_CustomTag_set_environment(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_type_tracing_v3_CustomTag_set_request_header(envoy_type_tracing_v3_CustomTag *msg, envoy_type_tracing_v3_CustomTag_Header* value) {
+ UPB_WRITE_ONEOF(msg, envoy_type_tracing_v3_CustomTag_Header*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 4);
+}
+UPB_INLINE struct envoy_type_tracing_v3_CustomTag_Header* envoy_type_tracing_v3_CustomTag_mutable_request_header(envoy_type_tracing_v3_CustomTag *msg, upb_arena *arena) {
+ struct envoy_type_tracing_v3_CustomTag_Header* sub = (struct envoy_type_tracing_v3_CustomTag_Header*)envoy_type_tracing_v3_CustomTag_request_header(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_type_tracing_v3_CustomTag_Header*)_upb_msg_new(&envoy_type_tracing_v3_CustomTag_Header_msginit, arena);
+ if (!sub) return NULL;
+ envoy_type_tracing_v3_CustomTag_set_request_header(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_type_tracing_v3_CustomTag_set_metadata(envoy_type_tracing_v3_CustomTag *msg, envoy_type_tracing_v3_CustomTag_Metadata* value) {
+ UPB_WRITE_ONEOF(msg, envoy_type_tracing_v3_CustomTag_Metadata*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 5);
+}
+UPB_INLINE struct envoy_type_tracing_v3_CustomTag_Metadata* envoy_type_tracing_v3_CustomTag_mutable_metadata(envoy_type_tracing_v3_CustomTag *msg, upb_arena *arena) {
+ struct envoy_type_tracing_v3_CustomTag_Metadata* sub = (struct envoy_type_tracing_v3_CustomTag_Metadata*)envoy_type_tracing_v3_CustomTag_metadata(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_type_tracing_v3_CustomTag_Metadata*)_upb_msg_new(&envoy_type_tracing_v3_CustomTag_Metadata_msginit, arena);
+ if (!sub) return NULL;
+ envoy_type_tracing_v3_CustomTag_set_metadata(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.type.tracing.v3.CustomTag.Literal */
+
+UPB_INLINE envoy_type_tracing_v3_CustomTag_Literal *envoy_type_tracing_v3_CustomTag_Literal_new(upb_arena *arena) {
+ return (envoy_type_tracing_v3_CustomTag_Literal *)_upb_msg_new(&envoy_type_tracing_v3_CustomTag_Literal_msginit, arena);
+}
+UPB_INLINE envoy_type_tracing_v3_CustomTag_Literal *envoy_type_tracing_v3_CustomTag_Literal_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_type_tracing_v3_CustomTag_Literal *ret = envoy_type_tracing_v3_CustomTag_Literal_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_type_tracing_v3_CustomTag_Literal_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_type_tracing_v3_CustomTag_Literal_serialize(const envoy_type_tracing_v3_CustomTag_Literal *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_type_tracing_v3_CustomTag_Literal_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview envoy_type_tracing_v3_CustomTag_Literal_value(const envoy_type_tracing_v3_CustomTag_Literal *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+
+UPB_INLINE void envoy_type_tracing_v3_CustomTag_Literal_set_value(envoy_type_tracing_v3_CustomTag_Literal *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+
+/* envoy.type.tracing.v3.CustomTag.Environment */
+
+UPB_INLINE envoy_type_tracing_v3_CustomTag_Environment *envoy_type_tracing_v3_CustomTag_Environment_new(upb_arena *arena) {
+ return (envoy_type_tracing_v3_CustomTag_Environment *)_upb_msg_new(&envoy_type_tracing_v3_CustomTag_Environment_msginit, arena);
+}
+UPB_INLINE envoy_type_tracing_v3_CustomTag_Environment *envoy_type_tracing_v3_CustomTag_Environment_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_type_tracing_v3_CustomTag_Environment *ret = envoy_type_tracing_v3_CustomTag_Environment_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_type_tracing_v3_CustomTag_Environment_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_type_tracing_v3_CustomTag_Environment_serialize(const envoy_type_tracing_v3_CustomTag_Environment *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_type_tracing_v3_CustomTag_Environment_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview envoy_type_tracing_v3_CustomTag_Environment_name(const envoy_type_tracing_v3_CustomTag_Environment *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE upb_strview envoy_type_tracing_v3_CustomTag_Environment_default_value(const envoy_type_tracing_v3_CustomTag_Environment *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview); }
+
+UPB_INLINE void envoy_type_tracing_v3_CustomTag_Environment_set_name(envoy_type_tracing_v3_CustomTag_Environment *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+UPB_INLINE void envoy_type_tracing_v3_CustomTag_Environment_set_default_value(envoy_type_tracing_v3_CustomTag_Environment *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview) = value;
+}
+
+/* envoy.type.tracing.v3.CustomTag.Header */
+
+UPB_INLINE envoy_type_tracing_v3_CustomTag_Header *envoy_type_tracing_v3_CustomTag_Header_new(upb_arena *arena) {
+ return (envoy_type_tracing_v3_CustomTag_Header *)_upb_msg_new(&envoy_type_tracing_v3_CustomTag_Header_msginit, arena);
+}
+UPB_INLINE envoy_type_tracing_v3_CustomTag_Header *envoy_type_tracing_v3_CustomTag_Header_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_type_tracing_v3_CustomTag_Header *ret = envoy_type_tracing_v3_CustomTag_Header_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_type_tracing_v3_CustomTag_Header_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_type_tracing_v3_CustomTag_Header_serialize(const envoy_type_tracing_v3_CustomTag_Header *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_type_tracing_v3_CustomTag_Header_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview envoy_type_tracing_v3_CustomTag_Header_name(const envoy_type_tracing_v3_CustomTag_Header *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE upb_strview envoy_type_tracing_v3_CustomTag_Header_default_value(const envoy_type_tracing_v3_CustomTag_Header *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview); }
+
+UPB_INLINE void envoy_type_tracing_v3_CustomTag_Header_set_name(envoy_type_tracing_v3_CustomTag_Header *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+UPB_INLINE void envoy_type_tracing_v3_CustomTag_Header_set_default_value(envoy_type_tracing_v3_CustomTag_Header *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview) = value;
+}
+
+/* envoy.type.tracing.v3.CustomTag.Metadata */
+
+UPB_INLINE envoy_type_tracing_v3_CustomTag_Metadata *envoy_type_tracing_v3_CustomTag_Metadata_new(upb_arena *arena) {
+ return (envoy_type_tracing_v3_CustomTag_Metadata *)_upb_msg_new(&envoy_type_tracing_v3_CustomTag_Metadata_msginit, arena);
+}
+UPB_INLINE envoy_type_tracing_v3_CustomTag_Metadata *envoy_type_tracing_v3_CustomTag_Metadata_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_type_tracing_v3_CustomTag_Metadata *ret = envoy_type_tracing_v3_CustomTag_Metadata_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_type_tracing_v3_CustomTag_Metadata_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_type_tracing_v3_CustomTag_Metadata_serialize(const envoy_type_tracing_v3_CustomTag_Metadata *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_type_tracing_v3_CustomTag_Metadata_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_type_tracing_v3_CustomTag_Metadata_has_kind(const envoy_type_tracing_v3_CustomTag_Metadata *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
+UPB_INLINE const struct envoy_type_metadata_v3_MetadataKind* envoy_type_tracing_v3_CustomTag_Metadata_kind(const envoy_type_tracing_v3_CustomTag_Metadata *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct envoy_type_metadata_v3_MetadataKind*); }
+UPB_INLINE bool envoy_type_tracing_v3_CustomTag_Metadata_has_metadata_key(const envoy_type_tracing_v3_CustomTag_Metadata *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
+UPB_INLINE const struct envoy_type_metadata_v3_MetadataKey* envoy_type_tracing_v3_CustomTag_Metadata_metadata_key(const envoy_type_tracing_v3_CustomTag_Metadata *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct envoy_type_metadata_v3_MetadataKey*); }
+UPB_INLINE upb_strview envoy_type_tracing_v3_CustomTag_Metadata_default_value(const envoy_type_tracing_v3_CustomTag_Metadata *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+
+UPB_INLINE void envoy_type_tracing_v3_CustomTag_Metadata_set_kind(envoy_type_tracing_v3_CustomTag_Metadata *msg, struct envoy_type_metadata_v3_MetadataKind* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct envoy_type_metadata_v3_MetadataKind*) = value;
+}
+UPB_INLINE struct envoy_type_metadata_v3_MetadataKind* envoy_type_tracing_v3_CustomTag_Metadata_mutable_kind(envoy_type_tracing_v3_CustomTag_Metadata *msg, upb_arena *arena) {
+ struct envoy_type_metadata_v3_MetadataKind* sub = (struct envoy_type_metadata_v3_MetadataKind*)envoy_type_tracing_v3_CustomTag_Metadata_kind(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_type_metadata_v3_MetadataKind*)_upb_msg_new(&envoy_type_metadata_v3_MetadataKind_msginit, arena);
+ if (!sub) return NULL;
+ envoy_type_tracing_v3_CustomTag_Metadata_set_kind(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_type_tracing_v3_CustomTag_Metadata_set_metadata_key(envoy_type_tracing_v3_CustomTag_Metadata *msg, struct envoy_type_metadata_v3_MetadataKey* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct envoy_type_metadata_v3_MetadataKey*) = value;
+}
+UPB_INLINE struct envoy_type_metadata_v3_MetadataKey* envoy_type_tracing_v3_CustomTag_Metadata_mutable_metadata_key(envoy_type_tracing_v3_CustomTag_Metadata *msg, upb_arena *arena) {
+ struct envoy_type_metadata_v3_MetadataKey* sub = (struct envoy_type_metadata_v3_MetadataKey*)envoy_type_tracing_v3_CustomTag_Metadata_metadata_key(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_type_metadata_v3_MetadataKey*)_upb_msg_new(&envoy_type_metadata_v3_MetadataKey_msginit, arena);
+ if (!sub) return NULL;
+ envoy_type_tracing_v3_CustomTag_Metadata_set_metadata_key(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_type_tracing_v3_CustomTag_Metadata_set_default_value(envoy_type_tracing_v3_CustomTag_Metadata *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_TYPE_TRACING_V3_CUSTOM_TAG_PROTO_UPB_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/v3/http.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/v3/http.upb.c
index 1a5302518b1..c4a03ae8cad 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/v3/http.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/v3/http.upb.c
@@ -1,17 +1,17 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/type/v3/http.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include <stddef.h>
-#include "upb/msg.h"
-#include "envoy/type/v3/http.upb.h"
-#include "udpa/annotations/status.upb.h"
-
-#include "upb/port_def.inc"
-
-#include "upb/port_undef.inc"
-
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/type/v3/http.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg.h"
+#include "envoy/type/v3/http.upb.h"
+#include "udpa/annotations/status.upb.h"
+
+#include "upb/port_def.inc"
+
+#include "upb/port_undef.inc"
+
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/v3/http.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/v3/http.upb.h
index 672ca460d37..9e505a4616c 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/v3/http.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/v3/http.upb.h
@@ -1,35 +1,35 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/type/v3/http.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef ENVOY_TYPE_V3_HTTP_PROTO_UPB_H_
-#define ENVOY_TYPE_V3_HTTP_PROTO_UPB_H_
-
-#include "upb/msg.h"
-#include "upb/decode.h"
-#include "upb/encode.h"
-
-#include "upb/port_def.inc"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef enum {
- envoy_type_v3_HTTP1 = 0,
- envoy_type_v3_HTTP2 = 1,
- envoy_type_v3_HTTP3 = 2
-} envoy_type_v3_CodecClientType;
-
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* ENVOY_TYPE_V3_HTTP_PROTO_UPB_H_ */
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/type/v3/http.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_TYPE_V3_HTTP_PROTO_UPB_H_
+#define ENVOY_TYPE_V3_HTTP_PROTO_UPB_H_
+
+#include "upb/msg.h"
+#include "upb/decode.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef enum {
+ envoy_type_v3_HTTP1 = 0,
+ envoy_type_v3_HTTP2 = 1,
+ envoy_type_v3_HTTP3 = 2
+} envoy_type_v3_CodecClientType;
+
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_TYPE_V3_HTTP_PROTO_UPB_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/v3/percent.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/v3/percent.upb.c
index 960b491763c..e53879288e0 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/v3/percent.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/v3/percent.upb.c
@@ -1,40 +1,40 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/type/v3/percent.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include <stddef.h>
-#include "upb/msg.h"
-#include "envoy/type/v3/percent.upb.h"
-#include "udpa/annotations/status.upb.h"
-#include "udpa/annotations/versioning.upb.h"
-#include "validate/validate.upb.h"
-
-#include "upb/port_def.inc"
-
-static const upb_msglayout_field envoy_type_v3_Percent__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 1, 1},
-};
-
-const upb_msglayout envoy_type_v3_Percent_msginit = {
- NULL,
- &envoy_type_v3_Percent__fields[0],
- UPB_SIZE(8, 8), 1, false,
-};
-
-static const upb_msglayout_field envoy_type_v3_FractionalPercent__fields[2] = {
- {1, UPB_SIZE(8, 8), 0, 0, 13, 1},
- {2, UPB_SIZE(0, 0), 0, 0, 14, 1},
-};
-
-const upb_msglayout envoy_type_v3_FractionalPercent_msginit = {
- NULL,
- &envoy_type_v3_FractionalPercent__fields[0],
- UPB_SIZE(16, 16), 2, false,
-};
-
-#include "upb/port_undef.inc"
-
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/type/v3/percent.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg.h"
+#include "envoy/type/v3/percent.upb.h"
+#include "udpa/annotations/status.upb.h"
+#include "udpa/annotations/versioning.upb.h"
+#include "validate/validate.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_msglayout_field envoy_type_v3_Percent__fields[1] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 1, 1},
+};
+
+const upb_msglayout envoy_type_v3_Percent_msginit = {
+ NULL,
+ &envoy_type_v3_Percent__fields[0],
+ UPB_SIZE(8, 8), 1, false,
+};
+
+static const upb_msglayout_field envoy_type_v3_FractionalPercent__fields[2] = {
+ {1, UPB_SIZE(8, 8), 0, 0, 13, 1},
+ {2, UPB_SIZE(0, 0), 0, 0, 14, 1},
+};
+
+const upb_msglayout envoy_type_v3_FractionalPercent_msginit = {
+ NULL,
+ &envoy_type_v3_FractionalPercent__fields[0],
+ UPB_SIZE(16, 16), 2, false,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/v3/percent.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/v3/percent.upb.h
index b000ebe3280..fd111fe322b 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/v3/percent.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/v3/percent.upb.h
@@ -1,86 +1,86 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/type/v3/percent.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef ENVOY_TYPE_V3_PERCENT_PROTO_UPB_H_
-#define ENVOY_TYPE_V3_PERCENT_PROTO_UPB_H_
-
-#include "upb/msg.h"
-#include "upb/decode.h"
-#include "upb/encode.h"
-
-#include "upb/port_def.inc"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct envoy_type_v3_Percent;
-struct envoy_type_v3_FractionalPercent;
-typedef struct envoy_type_v3_Percent envoy_type_v3_Percent;
-typedef struct envoy_type_v3_FractionalPercent envoy_type_v3_FractionalPercent;
-extern const upb_msglayout envoy_type_v3_Percent_msginit;
-extern const upb_msglayout envoy_type_v3_FractionalPercent_msginit;
-
-typedef enum {
- envoy_type_v3_FractionalPercent_HUNDRED = 0,
- envoy_type_v3_FractionalPercent_TEN_THOUSAND = 1,
- envoy_type_v3_FractionalPercent_MILLION = 2
-} envoy_type_v3_FractionalPercent_DenominatorType;
-
-
-/* envoy.type.v3.Percent */
-
-UPB_INLINE envoy_type_v3_Percent *envoy_type_v3_Percent_new(upb_arena *arena) {
- return (envoy_type_v3_Percent *)_upb_msg_new(&envoy_type_v3_Percent_msginit, arena);
-}
-UPB_INLINE envoy_type_v3_Percent *envoy_type_v3_Percent_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_type_v3_Percent *ret = envoy_type_v3_Percent_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_type_v3_Percent_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_type_v3_Percent_serialize(const envoy_type_v3_Percent *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_type_v3_Percent_msginit, arena, len);
-}
-
-UPB_INLINE double envoy_type_v3_Percent_value(const envoy_type_v3_Percent *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), double); }
-
-UPB_INLINE void envoy_type_v3_Percent_set_value(envoy_type_v3_Percent *msg, double value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), double) = value;
-}
-
-/* envoy.type.v3.FractionalPercent */
-
-UPB_INLINE envoy_type_v3_FractionalPercent *envoy_type_v3_FractionalPercent_new(upb_arena *arena) {
- return (envoy_type_v3_FractionalPercent *)_upb_msg_new(&envoy_type_v3_FractionalPercent_msginit, arena);
-}
-UPB_INLINE envoy_type_v3_FractionalPercent *envoy_type_v3_FractionalPercent_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_type_v3_FractionalPercent *ret = envoy_type_v3_FractionalPercent_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_type_v3_FractionalPercent_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_type_v3_FractionalPercent_serialize(const envoy_type_v3_FractionalPercent *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_type_v3_FractionalPercent_msginit, arena, len);
-}
-
-UPB_INLINE uint32_t envoy_type_v3_FractionalPercent_numerator(const envoy_type_v3_FractionalPercent *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint32_t); }
-UPB_INLINE int32_t envoy_type_v3_FractionalPercent_denominator(const envoy_type_v3_FractionalPercent *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
-
-UPB_INLINE void envoy_type_v3_FractionalPercent_set_numerator(envoy_type_v3_FractionalPercent *msg, uint32_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint32_t) = value;
-}
-UPB_INLINE void envoy_type_v3_FractionalPercent_set_denominator(envoy_type_v3_FractionalPercent *msg, int32_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* ENVOY_TYPE_V3_PERCENT_PROTO_UPB_H_ */
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/type/v3/percent.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_TYPE_V3_PERCENT_PROTO_UPB_H_
+#define ENVOY_TYPE_V3_PERCENT_PROTO_UPB_H_
+
+#include "upb/msg.h"
+#include "upb/decode.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_type_v3_Percent;
+struct envoy_type_v3_FractionalPercent;
+typedef struct envoy_type_v3_Percent envoy_type_v3_Percent;
+typedef struct envoy_type_v3_FractionalPercent envoy_type_v3_FractionalPercent;
+extern const upb_msglayout envoy_type_v3_Percent_msginit;
+extern const upb_msglayout envoy_type_v3_FractionalPercent_msginit;
+
+typedef enum {
+ envoy_type_v3_FractionalPercent_HUNDRED = 0,
+ envoy_type_v3_FractionalPercent_TEN_THOUSAND = 1,
+ envoy_type_v3_FractionalPercent_MILLION = 2
+} envoy_type_v3_FractionalPercent_DenominatorType;
+
+
+/* envoy.type.v3.Percent */
+
+UPB_INLINE envoy_type_v3_Percent *envoy_type_v3_Percent_new(upb_arena *arena) {
+ return (envoy_type_v3_Percent *)_upb_msg_new(&envoy_type_v3_Percent_msginit, arena);
+}
+UPB_INLINE envoy_type_v3_Percent *envoy_type_v3_Percent_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_type_v3_Percent *ret = envoy_type_v3_Percent_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_type_v3_Percent_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_type_v3_Percent_serialize(const envoy_type_v3_Percent *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_type_v3_Percent_msginit, arena, len);
+}
+
+UPB_INLINE double envoy_type_v3_Percent_value(const envoy_type_v3_Percent *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), double); }
+
+UPB_INLINE void envoy_type_v3_Percent_set_value(envoy_type_v3_Percent *msg, double value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), double) = value;
+}
+
+/* envoy.type.v3.FractionalPercent */
+
+UPB_INLINE envoy_type_v3_FractionalPercent *envoy_type_v3_FractionalPercent_new(upb_arena *arena) {
+ return (envoy_type_v3_FractionalPercent *)_upb_msg_new(&envoy_type_v3_FractionalPercent_msginit, arena);
+}
+UPB_INLINE envoy_type_v3_FractionalPercent *envoy_type_v3_FractionalPercent_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_type_v3_FractionalPercent *ret = envoy_type_v3_FractionalPercent_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_type_v3_FractionalPercent_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_type_v3_FractionalPercent_serialize(const envoy_type_v3_FractionalPercent *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_type_v3_FractionalPercent_msginit, arena, len);
+}
+
+UPB_INLINE uint32_t envoy_type_v3_FractionalPercent_numerator(const envoy_type_v3_FractionalPercent *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint32_t); }
+UPB_INLINE int32_t envoy_type_v3_FractionalPercent_denominator(const envoy_type_v3_FractionalPercent *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
+
+UPB_INLINE void envoy_type_v3_FractionalPercent_set_numerator(envoy_type_v3_FractionalPercent *msg, uint32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint32_t) = value;
+}
+UPB_INLINE void envoy_type_v3_FractionalPercent_set_denominator(envoy_type_v3_FractionalPercent *msg, int32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_TYPE_V3_PERCENT_PROTO_UPB_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/v3/range.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/v3/range.upb.c
index 4219d98f0d3..0e21fed9c47 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/v3/range.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/v3/range.upb.c
@@ -1,51 +1,51 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/type/v3/range.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include <stddef.h>
-#include "upb/msg.h"
-#include "envoy/type/v3/range.upb.h"
-#include "udpa/annotations/status.upb.h"
-#include "udpa/annotations/versioning.upb.h"
-
-#include "upb/port_def.inc"
-
-static const upb_msglayout_field envoy_type_v3_Int64Range__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 3, 1},
- {2, UPB_SIZE(8, 8), 0, 0, 3, 1},
-};
-
-const upb_msglayout envoy_type_v3_Int64Range_msginit = {
- NULL,
- &envoy_type_v3_Int64Range__fields[0],
- UPB_SIZE(16, 16), 2, false,
-};
-
-static const upb_msglayout_field envoy_type_v3_Int32Range__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 5, 1},
- {2, UPB_SIZE(4, 4), 0, 0, 5, 1},
-};
-
-const upb_msglayout envoy_type_v3_Int32Range_msginit = {
- NULL,
- &envoy_type_v3_Int32Range__fields[0],
- UPB_SIZE(8, 8), 2, false,
-};
-
-static const upb_msglayout_field envoy_type_v3_DoubleRange__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 1, 1},
- {2, UPB_SIZE(8, 8), 0, 0, 1, 1},
-};
-
-const upb_msglayout envoy_type_v3_DoubleRange_msginit = {
- NULL,
- &envoy_type_v3_DoubleRange__fields[0],
- UPB_SIZE(16, 16), 2, false,
-};
-
-#include "upb/port_undef.inc"
-
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/type/v3/range.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg.h"
+#include "envoy/type/v3/range.upb.h"
+#include "udpa/annotations/status.upb.h"
+#include "udpa/annotations/versioning.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_msglayout_field envoy_type_v3_Int64Range__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 3, 1},
+ {2, UPB_SIZE(8, 8), 0, 0, 3, 1},
+};
+
+const upb_msglayout envoy_type_v3_Int64Range_msginit = {
+ NULL,
+ &envoy_type_v3_Int64Range__fields[0],
+ UPB_SIZE(16, 16), 2, false,
+};
+
+static const upb_msglayout_field envoy_type_v3_Int32Range__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 5, 1},
+ {2, UPB_SIZE(4, 4), 0, 0, 5, 1},
+};
+
+const upb_msglayout envoy_type_v3_Int32Range_msginit = {
+ NULL,
+ &envoy_type_v3_Int32Range__fields[0],
+ UPB_SIZE(8, 8), 2, false,
+};
+
+static const upb_msglayout_field envoy_type_v3_DoubleRange__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 1, 1},
+ {2, UPB_SIZE(8, 8), 0, 0, 1, 1},
+};
+
+const upb_msglayout envoy_type_v3_DoubleRange_msginit = {
+ NULL,
+ &envoy_type_v3_DoubleRange__fields[0],
+ UPB_SIZE(16, 16), 2, false,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/v3/range.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/v3/range.upb.h
index 1013f63897f..71453aabc7f 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/v3/range.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/v3/range.upb.h
@@ -1,111 +1,111 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/type/v3/range.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef ENVOY_TYPE_V3_RANGE_PROTO_UPB_H_
-#define ENVOY_TYPE_V3_RANGE_PROTO_UPB_H_
-
-#include "upb/msg.h"
-#include "upb/decode.h"
-#include "upb/encode.h"
-
-#include "upb/port_def.inc"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct envoy_type_v3_Int64Range;
-struct envoy_type_v3_Int32Range;
-struct envoy_type_v3_DoubleRange;
-typedef struct envoy_type_v3_Int64Range envoy_type_v3_Int64Range;
-typedef struct envoy_type_v3_Int32Range envoy_type_v3_Int32Range;
-typedef struct envoy_type_v3_DoubleRange envoy_type_v3_DoubleRange;
-extern const upb_msglayout envoy_type_v3_Int64Range_msginit;
-extern const upb_msglayout envoy_type_v3_Int32Range_msginit;
-extern const upb_msglayout envoy_type_v3_DoubleRange_msginit;
-
-
-/* envoy.type.v3.Int64Range */
-
-UPB_INLINE envoy_type_v3_Int64Range *envoy_type_v3_Int64Range_new(upb_arena *arena) {
- return (envoy_type_v3_Int64Range *)_upb_msg_new(&envoy_type_v3_Int64Range_msginit, arena);
-}
-UPB_INLINE envoy_type_v3_Int64Range *envoy_type_v3_Int64Range_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_type_v3_Int64Range *ret = envoy_type_v3_Int64Range_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_type_v3_Int64Range_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_type_v3_Int64Range_serialize(const envoy_type_v3_Int64Range *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_type_v3_Int64Range_msginit, arena, len);
-}
-
-UPB_INLINE int64_t envoy_type_v3_Int64Range_start(const envoy_type_v3_Int64Range *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int64_t); }
-UPB_INLINE int64_t envoy_type_v3_Int64Range_end(const envoy_type_v3_Int64Range *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int64_t); }
-
-UPB_INLINE void envoy_type_v3_Int64Range_set_start(envoy_type_v3_Int64Range *msg, int64_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int64_t) = value;
-}
-UPB_INLINE void envoy_type_v3_Int64Range_set_end(envoy_type_v3_Int64Range *msg, int64_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int64_t) = value;
-}
-
-/* envoy.type.v3.Int32Range */
-
-UPB_INLINE envoy_type_v3_Int32Range *envoy_type_v3_Int32Range_new(upb_arena *arena) {
- return (envoy_type_v3_Int32Range *)_upb_msg_new(&envoy_type_v3_Int32Range_msginit, arena);
-}
-UPB_INLINE envoy_type_v3_Int32Range *envoy_type_v3_Int32Range_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_type_v3_Int32Range *ret = envoy_type_v3_Int32Range_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_type_v3_Int32Range_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_type_v3_Int32Range_serialize(const envoy_type_v3_Int32Range *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_type_v3_Int32Range_msginit, arena, len);
-}
-
-UPB_INLINE int32_t envoy_type_v3_Int32Range_start(const envoy_type_v3_Int32Range *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
-UPB_INLINE int32_t envoy_type_v3_Int32Range_end(const envoy_type_v3_Int32Range *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); }
-
-UPB_INLINE void envoy_type_v3_Int32Range_set_start(envoy_type_v3_Int32Range *msg, int32_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
-}
-UPB_INLINE void envoy_type_v3_Int32Range_set_end(envoy_type_v3_Int32Range *msg, int32_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value;
-}
-
-/* envoy.type.v3.DoubleRange */
-
-UPB_INLINE envoy_type_v3_DoubleRange *envoy_type_v3_DoubleRange_new(upb_arena *arena) {
- return (envoy_type_v3_DoubleRange *)_upb_msg_new(&envoy_type_v3_DoubleRange_msginit, arena);
-}
-UPB_INLINE envoy_type_v3_DoubleRange *envoy_type_v3_DoubleRange_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_type_v3_DoubleRange *ret = envoy_type_v3_DoubleRange_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_type_v3_DoubleRange_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_type_v3_DoubleRange_serialize(const envoy_type_v3_DoubleRange *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_type_v3_DoubleRange_msginit, arena, len);
-}
-
-UPB_INLINE double envoy_type_v3_DoubleRange_start(const envoy_type_v3_DoubleRange *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), double); }
-UPB_INLINE double envoy_type_v3_DoubleRange_end(const envoy_type_v3_DoubleRange *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), double); }
-
-UPB_INLINE void envoy_type_v3_DoubleRange_set_start(envoy_type_v3_DoubleRange *msg, double value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), double) = value;
-}
-UPB_INLINE void envoy_type_v3_DoubleRange_set_end(envoy_type_v3_DoubleRange *msg, double value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), double) = value;
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* ENVOY_TYPE_V3_RANGE_PROTO_UPB_H_ */
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/type/v3/range.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_TYPE_V3_RANGE_PROTO_UPB_H_
+#define ENVOY_TYPE_V3_RANGE_PROTO_UPB_H_
+
+#include "upb/msg.h"
+#include "upb/decode.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_type_v3_Int64Range;
+struct envoy_type_v3_Int32Range;
+struct envoy_type_v3_DoubleRange;
+typedef struct envoy_type_v3_Int64Range envoy_type_v3_Int64Range;
+typedef struct envoy_type_v3_Int32Range envoy_type_v3_Int32Range;
+typedef struct envoy_type_v3_DoubleRange envoy_type_v3_DoubleRange;
+extern const upb_msglayout envoy_type_v3_Int64Range_msginit;
+extern const upb_msglayout envoy_type_v3_Int32Range_msginit;
+extern const upb_msglayout envoy_type_v3_DoubleRange_msginit;
+
+
+/* envoy.type.v3.Int64Range */
+
+UPB_INLINE envoy_type_v3_Int64Range *envoy_type_v3_Int64Range_new(upb_arena *arena) {
+ return (envoy_type_v3_Int64Range *)_upb_msg_new(&envoy_type_v3_Int64Range_msginit, arena);
+}
+UPB_INLINE envoy_type_v3_Int64Range *envoy_type_v3_Int64Range_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_type_v3_Int64Range *ret = envoy_type_v3_Int64Range_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_type_v3_Int64Range_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_type_v3_Int64Range_serialize(const envoy_type_v3_Int64Range *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_type_v3_Int64Range_msginit, arena, len);
+}
+
+UPB_INLINE int64_t envoy_type_v3_Int64Range_start(const envoy_type_v3_Int64Range *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int64_t); }
+UPB_INLINE int64_t envoy_type_v3_Int64Range_end(const envoy_type_v3_Int64Range *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int64_t); }
+
+UPB_INLINE void envoy_type_v3_Int64Range_set_start(envoy_type_v3_Int64Range *msg, int64_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int64_t) = value;
+}
+UPB_INLINE void envoy_type_v3_Int64Range_set_end(envoy_type_v3_Int64Range *msg, int64_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int64_t) = value;
+}
+
+/* envoy.type.v3.Int32Range */
+
+UPB_INLINE envoy_type_v3_Int32Range *envoy_type_v3_Int32Range_new(upb_arena *arena) {
+ return (envoy_type_v3_Int32Range *)_upb_msg_new(&envoy_type_v3_Int32Range_msginit, arena);
+}
+UPB_INLINE envoy_type_v3_Int32Range *envoy_type_v3_Int32Range_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_type_v3_Int32Range *ret = envoy_type_v3_Int32Range_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_type_v3_Int32Range_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_type_v3_Int32Range_serialize(const envoy_type_v3_Int32Range *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_type_v3_Int32Range_msginit, arena, len);
+}
+
+UPB_INLINE int32_t envoy_type_v3_Int32Range_start(const envoy_type_v3_Int32Range *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
+UPB_INLINE int32_t envoy_type_v3_Int32Range_end(const envoy_type_v3_Int32Range *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); }
+
+UPB_INLINE void envoy_type_v3_Int32Range_set_start(envoy_type_v3_Int32Range *msg, int32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
+}
+UPB_INLINE void envoy_type_v3_Int32Range_set_end(envoy_type_v3_Int32Range *msg, int32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value;
+}
+
+/* envoy.type.v3.DoubleRange */
+
+UPB_INLINE envoy_type_v3_DoubleRange *envoy_type_v3_DoubleRange_new(upb_arena *arena) {
+ return (envoy_type_v3_DoubleRange *)_upb_msg_new(&envoy_type_v3_DoubleRange_msginit, arena);
+}
+UPB_INLINE envoy_type_v3_DoubleRange *envoy_type_v3_DoubleRange_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_type_v3_DoubleRange *ret = envoy_type_v3_DoubleRange_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_type_v3_DoubleRange_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_type_v3_DoubleRange_serialize(const envoy_type_v3_DoubleRange *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_type_v3_DoubleRange_msginit, arena, len);
+}
+
+UPB_INLINE double envoy_type_v3_DoubleRange_start(const envoy_type_v3_DoubleRange *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), double); }
+UPB_INLINE double envoy_type_v3_DoubleRange_end(const envoy_type_v3_DoubleRange *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), double); }
+
+UPB_INLINE void envoy_type_v3_DoubleRange_set_start(envoy_type_v3_DoubleRange *msg, double value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), double) = value;
+}
+UPB_INLINE void envoy_type_v3_DoubleRange_set_end(envoy_type_v3_DoubleRange *msg, double value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), double) = value;
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_TYPE_V3_RANGE_PROTO_UPB_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.c
index d16f1367334..5eb014a526e 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.c
@@ -1,30 +1,30 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/type/v3/semantic_version.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include <stddef.h>
-#include "upb/msg.h"
-#include "envoy/type/v3/semantic_version.upb.h"
-#include "udpa/annotations/status.upb.h"
-#include "udpa/annotations/versioning.upb.h"
-
-#include "upb/port_def.inc"
-
-static const upb_msglayout_field envoy_type_v3_SemanticVersion__fields[3] = {
- {1, UPB_SIZE(0, 0), 0, 0, 13, 1},
- {2, UPB_SIZE(4, 4), 0, 0, 13, 1},
- {3, UPB_SIZE(8, 8), 0, 0, 13, 1},
-};
-
-const upb_msglayout envoy_type_v3_SemanticVersion_msginit = {
- NULL,
- &envoy_type_v3_SemanticVersion__fields[0],
- UPB_SIZE(12, 12), 3, false,
-};
-
-#include "upb/port_undef.inc"
-
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/type/v3/semantic_version.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg.h"
+#include "envoy/type/v3/semantic_version.upb.h"
+#include "udpa/annotations/status.upb.h"
+#include "udpa/annotations/versioning.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_msglayout_field envoy_type_v3_SemanticVersion__fields[3] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 13, 1},
+ {2, UPB_SIZE(4, 4), 0, 0, 13, 1},
+ {3, UPB_SIZE(8, 8), 0, 0, 13, 1},
+};
+
+const upb_msglayout envoy_type_v3_SemanticVersion_msginit = {
+ NULL,
+ &envoy_type_v3_SemanticVersion__fields[0],
+ UPB_SIZE(12, 12), 3, false,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.h
index a42d0222471..8d53babc9b7 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.h
@@ -1,61 +1,61 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * envoy/type/v3/semantic_version.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef ENVOY_TYPE_V3_SEMANTIC_VERSION_PROTO_UPB_H_
-#define ENVOY_TYPE_V3_SEMANTIC_VERSION_PROTO_UPB_H_
-
-#include "upb/msg.h"
-#include "upb/decode.h"
-#include "upb/encode.h"
-
-#include "upb/port_def.inc"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct envoy_type_v3_SemanticVersion;
-typedef struct envoy_type_v3_SemanticVersion envoy_type_v3_SemanticVersion;
-extern const upb_msglayout envoy_type_v3_SemanticVersion_msginit;
-
-
-/* envoy.type.v3.SemanticVersion */
-
-UPB_INLINE envoy_type_v3_SemanticVersion *envoy_type_v3_SemanticVersion_new(upb_arena *arena) {
- return (envoy_type_v3_SemanticVersion *)_upb_msg_new(&envoy_type_v3_SemanticVersion_msginit, arena);
-}
-UPB_INLINE envoy_type_v3_SemanticVersion *envoy_type_v3_SemanticVersion_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_type_v3_SemanticVersion *ret = envoy_type_v3_SemanticVersion_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_type_v3_SemanticVersion_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *envoy_type_v3_SemanticVersion_serialize(const envoy_type_v3_SemanticVersion *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_type_v3_SemanticVersion_msginit, arena, len);
-}
-
-UPB_INLINE uint32_t envoy_type_v3_SemanticVersion_major_number(const envoy_type_v3_SemanticVersion *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t); }
-UPB_INLINE uint32_t envoy_type_v3_SemanticVersion_minor_number(const envoy_type_v3_SemanticVersion *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t); }
-UPB_INLINE uint32_t envoy_type_v3_SemanticVersion_patch(const envoy_type_v3_SemanticVersion *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint32_t); }
-
-UPB_INLINE void envoy_type_v3_SemanticVersion_set_major_number(envoy_type_v3_SemanticVersion *msg, uint32_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t) = value;
-}
-UPB_INLINE void envoy_type_v3_SemanticVersion_set_minor_number(envoy_type_v3_SemanticVersion *msg, uint32_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t) = value;
-}
-UPB_INLINE void envoy_type_v3_SemanticVersion_set_patch(envoy_type_v3_SemanticVersion *msg, uint32_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint32_t) = value;
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* ENVOY_TYPE_V3_SEMANTIC_VERSION_PROTO_UPB_H_ */
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/type/v3/semantic_version.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_TYPE_V3_SEMANTIC_VERSION_PROTO_UPB_H_
+#define ENVOY_TYPE_V3_SEMANTIC_VERSION_PROTO_UPB_H_
+
+#include "upb/msg.h"
+#include "upb/decode.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_type_v3_SemanticVersion;
+typedef struct envoy_type_v3_SemanticVersion envoy_type_v3_SemanticVersion;
+extern const upb_msglayout envoy_type_v3_SemanticVersion_msginit;
+
+
+/* envoy.type.v3.SemanticVersion */
+
+UPB_INLINE envoy_type_v3_SemanticVersion *envoy_type_v3_SemanticVersion_new(upb_arena *arena) {
+ return (envoy_type_v3_SemanticVersion *)_upb_msg_new(&envoy_type_v3_SemanticVersion_msginit, arena);
+}
+UPB_INLINE envoy_type_v3_SemanticVersion *envoy_type_v3_SemanticVersion_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_type_v3_SemanticVersion *ret = envoy_type_v3_SemanticVersion_new(arena);
+ return (ret && upb_decode(buf, size, ret, &envoy_type_v3_SemanticVersion_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *envoy_type_v3_SemanticVersion_serialize(const envoy_type_v3_SemanticVersion *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_type_v3_SemanticVersion_msginit, arena, len);
+}
+
+UPB_INLINE uint32_t envoy_type_v3_SemanticVersion_major_number(const envoy_type_v3_SemanticVersion *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t); }
+UPB_INLINE uint32_t envoy_type_v3_SemanticVersion_minor_number(const envoy_type_v3_SemanticVersion *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t); }
+UPB_INLINE uint32_t envoy_type_v3_SemanticVersion_patch(const envoy_type_v3_SemanticVersion *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint32_t); }
+
+UPB_INLINE void envoy_type_v3_SemanticVersion_set_major_number(envoy_type_v3_SemanticVersion *msg, uint32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t) = value;
+}
+UPB_INLINE void envoy_type_v3_SemanticVersion_set_minor_number(envoy_type_v3_SemanticVersion *msg, uint32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t) = value;
+}
+UPB_INLINE void envoy_type_v3_SemanticVersion_set_patch(envoy_type_v3_SemanticVersion *msg, uint32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint32_t) = value;
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_TYPE_V3_SEMANTIC_VERSION_PROTO_UPB_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.c
index 13e9c0e8ed7..5728a1063eb 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.c
@@ -1,242 +1,242 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * google/api/expr/v1alpha1/checked.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include <stddef.h>
-#include "upb/msg.h"
-#include "google/api/expr/v1alpha1/checked.upb.h"
-#include "google/api/expr/v1alpha1/syntax.upb.h"
-#include "google/protobuf/empty.upb.h"
-#include "google/protobuf/struct.upb.h"
-
-#include "upb/port_def.inc"
-
-static const upb_msglayout *const google_api_expr_v1alpha1_CheckedExpr_submsgs[4] = {
- &google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry_msginit,
- &google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry_msginit,
- &google_api_expr_v1alpha1_Expr_msginit,
- &google_api_expr_v1alpha1_SourceInfo_msginit,
-};
-
-static const upb_msglayout_field google_api_expr_v1alpha1_CheckedExpr__fields[4] = {
- {2, UPB_SIZE(8, 16), 0, 0, 11, _UPB_LABEL_MAP},
- {3, UPB_SIZE(12, 24), 0, 1, 11, _UPB_LABEL_MAP},
- {4, UPB_SIZE(0, 0), 0, 2, 11, 1},
- {5, UPB_SIZE(4, 8), 0, 3, 11, 1},
-};
-
-const upb_msglayout google_api_expr_v1alpha1_CheckedExpr_msginit = {
- &google_api_expr_v1alpha1_CheckedExpr_submsgs[0],
- &google_api_expr_v1alpha1_CheckedExpr__fields[0],
- UPB_SIZE(16, 32), 4, false,
-};
-
-static const upb_msglayout *const google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry_submsgs[1] = {
- &google_api_expr_v1alpha1_Reference_msginit,
-};
-
-static const upb_msglayout_field google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 3, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 11, 1},
-};
-
-const upb_msglayout google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry_msginit = {
- &google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry_submsgs[0],
- &google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry__fields[0],
- UPB_SIZE(16, 32), 2, false,
-};
-
-static const upb_msglayout *const google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry_submsgs[1] = {
- &google_api_expr_v1alpha1_Type_msginit,
-};
-
-static const upb_msglayout_field google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 3, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 11, 1},
-};
-
-const upb_msglayout google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry_msginit = {
- &google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry_submsgs[0],
- &google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry__fields[0],
- UPB_SIZE(16, 32), 2, false,
-};
-
-static const upb_msglayout *const google_api_expr_v1alpha1_Type_submsgs[7] = {
- &google_api_expr_v1alpha1_Type_msginit,
- &google_api_expr_v1alpha1_Type_AbstractType_msginit,
- &google_api_expr_v1alpha1_Type_FunctionType_msginit,
- &google_api_expr_v1alpha1_Type_ListType_msginit,
- &google_api_expr_v1alpha1_Type_MapType_msginit,
- &google_protobuf_Empty_msginit,
-};
-
-static const upb_msglayout_field google_api_expr_v1alpha1_Type__fields[13] = {
- {1, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 5, 11, 1},
- {2, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 14, 1},
- {3, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 14, 1},
- {4, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 14, 1},
- {5, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 14, 1},
- {6, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 3, 11, 1},
- {7, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 4, 11, 1},
- {8, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 2, 11, 1},
- {9, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 9, 1},
- {10, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 9, 1},
- {11, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 11, 1},
- {12, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 5, 11, 1},
- {14, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 1, 11, 1},
-};
-
-const upb_msglayout google_api_expr_v1alpha1_Type_msginit = {
- &google_api_expr_v1alpha1_Type_submsgs[0],
- &google_api_expr_v1alpha1_Type__fields[0],
- UPB_SIZE(16, 32), 13, false,
-};
-
-static const upb_msglayout *const google_api_expr_v1alpha1_Type_ListType_submsgs[1] = {
- &google_api_expr_v1alpha1_Type_msginit,
-};
-
-static const upb_msglayout_field google_api_expr_v1alpha1_Type_ListType__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
-};
-
-const upb_msglayout google_api_expr_v1alpha1_Type_ListType_msginit = {
- &google_api_expr_v1alpha1_Type_ListType_submsgs[0],
- &google_api_expr_v1alpha1_Type_ListType__fields[0],
- UPB_SIZE(4, 8), 1, false,
-};
-
-static const upb_msglayout *const google_api_expr_v1alpha1_Type_MapType_submsgs[2] = {
- &google_api_expr_v1alpha1_Type_msginit,
-};
-
-static const upb_msglayout_field google_api_expr_v1alpha1_Type_MapType__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
- {2, UPB_SIZE(4, 8), 0, 0, 11, 1},
-};
-
-const upb_msglayout google_api_expr_v1alpha1_Type_MapType_msginit = {
- &google_api_expr_v1alpha1_Type_MapType_submsgs[0],
- &google_api_expr_v1alpha1_Type_MapType__fields[0],
- UPB_SIZE(8, 16), 2, false,
-};
-
-static const upb_msglayout *const google_api_expr_v1alpha1_Type_FunctionType_submsgs[2] = {
- &google_api_expr_v1alpha1_Type_msginit,
-};
-
-static const upb_msglayout_field google_api_expr_v1alpha1_Type_FunctionType__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
- {2, UPB_SIZE(4, 8), 0, 0, 11, 3},
-};
-
-const upb_msglayout google_api_expr_v1alpha1_Type_FunctionType_msginit = {
- &google_api_expr_v1alpha1_Type_FunctionType_submsgs[0],
- &google_api_expr_v1alpha1_Type_FunctionType__fields[0],
- UPB_SIZE(8, 16), 2, false,
-};
-
-static const upb_msglayout *const google_api_expr_v1alpha1_Type_AbstractType_submsgs[1] = {
- &google_api_expr_v1alpha1_Type_msginit,
-};
-
-static const upb_msglayout_field google_api_expr_v1alpha1_Type_AbstractType__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 11, 3},
-};
-
-const upb_msglayout google_api_expr_v1alpha1_Type_AbstractType_msginit = {
- &google_api_expr_v1alpha1_Type_AbstractType_submsgs[0],
- &google_api_expr_v1alpha1_Type_AbstractType__fields[0],
- UPB_SIZE(16, 32), 2, false,
-};
-
-static const upb_msglayout *const google_api_expr_v1alpha1_Decl_submsgs[2] = {
- &google_api_expr_v1alpha1_Decl_FunctionDecl_msginit,
- &google_api_expr_v1alpha1_Decl_IdentDecl_msginit,
-};
-
-static const upb_msglayout_field google_api_expr_v1alpha1_Decl__fields[3] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 1, 11, 1},
- {3, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, 1},
-};
-
-const upb_msglayout google_api_expr_v1alpha1_Decl_msginit = {
- &google_api_expr_v1alpha1_Decl_submsgs[0],
- &google_api_expr_v1alpha1_Decl__fields[0],
- UPB_SIZE(16, 32), 3, false,
-};
-
-static const upb_msglayout *const google_api_expr_v1alpha1_Decl_IdentDecl_submsgs[2] = {
- &google_api_expr_v1alpha1_Constant_msginit,
- &google_api_expr_v1alpha1_Type_msginit,
-};
-
-static const upb_msglayout_field google_api_expr_v1alpha1_Decl_IdentDecl__fields[3] = {
- {1, UPB_SIZE(8, 16), 0, 1, 11, 1},
- {2, UPB_SIZE(12, 24), 0, 0, 11, 1},
- {3, UPB_SIZE(0, 0), 0, 0, 9, 1},
-};
-
-const upb_msglayout google_api_expr_v1alpha1_Decl_IdentDecl_msginit = {
- &google_api_expr_v1alpha1_Decl_IdentDecl_submsgs[0],
- &google_api_expr_v1alpha1_Decl_IdentDecl__fields[0],
- UPB_SIZE(16, 32), 3, false,
-};
-
-static const upb_msglayout *const google_api_expr_v1alpha1_Decl_FunctionDecl_submsgs[1] = {
- &google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_msginit,
-};
-
-static const upb_msglayout_field google_api_expr_v1alpha1_Decl_FunctionDecl__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 3},
-};
-
-const upb_msglayout google_api_expr_v1alpha1_Decl_FunctionDecl_msginit = {
- &google_api_expr_v1alpha1_Decl_FunctionDecl_submsgs[0],
- &google_api_expr_v1alpha1_Decl_FunctionDecl__fields[0],
- UPB_SIZE(4, 8), 1, false,
-};
-
-static const upb_msglayout *const google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_submsgs[2] = {
- &google_api_expr_v1alpha1_Type_msginit,
-};
-
-static const upb_msglayout_field google_api_expr_v1alpha1_Decl_FunctionDecl_Overload__fields[6] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(24, 48), 0, 0, 11, 3},
- {3, UPB_SIZE(28, 56), 0, 0, 9, 3},
- {4, UPB_SIZE(20, 40), 0, 0, 11, 1},
- {5, UPB_SIZE(0, 0), 0, 0, 8, 1},
- {6, UPB_SIZE(12, 24), 0, 0, 9, 1},
-};
-
-const upb_msglayout google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_msginit = {
- &google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_submsgs[0],
- &google_api_expr_v1alpha1_Decl_FunctionDecl_Overload__fields[0],
- UPB_SIZE(32, 64), 6, false,
-};
-
-static const upb_msglayout *const google_api_expr_v1alpha1_Reference_submsgs[1] = {
- &google_api_expr_v1alpha1_Constant_msginit,
-};
-
-static const upb_msglayout_field google_api_expr_v1alpha1_Reference__fields[3] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {3, UPB_SIZE(12, 24), 0, 0, 9, 3},
- {4, UPB_SIZE(8, 16), 0, 0, 11, 1},
-};
-
-const upb_msglayout google_api_expr_v1alpha1_Reference_msginit = {
- &google_api_expr_v1alpha1_Reference_submsgs[0],
- &google_api_expr_v1alpha1_Reference__fields[0],
- UPB_SIZE(16, 32), 3, false,
-};
-
-#include "upb/port_undef.inc"
-
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * google/api/expr/v1alpha1/checked.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg.h"
+#include "google/api/expr/v1alpha1/checked.upb.h"
+#include "google/api/expr/v1alpha1/syntax.upb.h"
+#include "google/protobuf/empty.upb.h"
+#include "google/protobuf/struct.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_msglayout *const google_api_expr_v1alpha1_CheckedExpr_submsgs[4] = {
+ &google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry_msginit,
+ &google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry_msginit,
+ &google_api_expr_v1alpha1_Expr_msginit,
+ &google_api_expr_v1alpha1_SourceInfo_msginit,
+};
+
+static const upb_msglayout_field google_api_expr_v1alpha1_CheckedExpr__fields[4] = {
+ {2, UPB_SIZE(8, 16), 0, 0, 11, _UPB_LABEL_MAP},
+ {3, UPB_SIZE(12, 24), 0, 1, 11, _UPB_LABEL_MAP},
+ {4, UPB_SIZE(0, 0), 0, 2, 11, 1},
+ {5, UPB_SIZE(4, 8), 0, 3, 11, 1},
+};
+
+const upb_msglayout google_api_expr_v1alpha1_CheckedExpr_msginit = {
+ &google_api_expr_v1alpha1_CheckedExpr_submsgs[0],
+ &google_api_expr_v1alpha1_CheckedExpr__fields[0],
+ UPB_SIZE(16, 32), 4, false,
+};
+
+static const upb_msglayout *const google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry_submsgs[1] = {
+ &google_api_expr_v1alpha1_Reference_msginit,
+};
+
+static const upb_msglayout_field google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 3, 1},
+ {2, UPB_SIZE(8, 16), 0, 0, 11, 1},
+};
+
+const upb_msglayout google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry_msginit = {
+ &google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry_submsgs[0],
+ &google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry__fields[0],
+ UPB_SIZE(16, 32), 2, false,
+};
+
+static const upb_msglayout *const google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry_submsgs[1] = {
+ &google_api_expr_v1alpha1_Type_msginit,
+};
+
+static const upb_msglayout_field google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 3, 1},
+ {2, UPB_SIZE(8, 16), 0, 0, 11, 1},
+};
+
+const upb_msglayout google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry_msginit = {
+ &google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry_submsgs[0],
+ &google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry__fields[0],
+ UPB_SIZE(16, 32), 2, false,
+};
+
+static const upb_msglayout *const google_api_expr_v1alpha1_Type_submsgs[7] = {
+ &google_api_expr_v1alpha1_Type_msginit,
+ &google_api_expr_v1alpha1_Type_AbstractType_msginit,
+ &google_api_expr_v1alpha1_Type_FunctionType_msginit,
+ &google_api_expr_v1alpha1_Type_ListType_msginit,
+ &google_api_expr_v1alpha1_Type_MapType_msginit,
+ &google_protobuf_Empty_msginit,
+};
+
+static const upb_msglayout_field google_api_expr_v1alpha1_Type__fields[13] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 5, 11, 1},
+ {2, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 14, 1},
+ {3, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 14, 1},
+ {4, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 14, 1},
+ {5, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 14, 1},
+ {6, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 3, 11, 1},
+ {7, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 4, 11, 1},
+ {8, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 2, 11, 1},
+ {9, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 9, 1},
+ {10, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 9, 1},
+ {11, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 11, 1},
+ {12, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 5, 11, 1},
+ {14, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 1, 11, 1},
+};
+
+const upb_msglayout google_api_expr_v1alpha1_Type_msginit = {
+ &google_api_expr_v1alpha1_Type_submsgs[0],
+ &google_api_expr_v1alpha1_Type__fields[0],
+ UPB_SIZE(16, 32), 13, false,
+};
+
+static const upb_msglayout *const google_api_expr_v1alpha1_Type_ListType_submsgs[1] = {
+ &google_api_expr_v1alpha1_Type_msginit,
+};
+
+static const upb_msglayout_field google_api_expr_v1alpha1_Type_ListType__fields[1] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
+};
+
+const upb_msglayout google_api_expr_v1alpha1_Type_ListType_msginit = {
+ &google_api_expr_v1alpha1_Type_ListType_submsgs[0],
+ &google_api_expr_v1alpha1_Type_ListType__fields[0],
+ UPB_SIZE(4, 8), 1, false,
+};
+
+static const upb_msglayout *const google_api_expr_v1alpha1_Type_MapType_submsgs[2] = {
+ &google_api_expr_v1alpha1_Type_msginit,
+};
+
+static const upb_msglayout_field google_api_expr_v1alpha1_Type_MapType__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
+ {2, UPB_SIZE(4, 8), 0, 0, 11, 1},
+};
+
+const upb_msglayout google_api_expr_v1alpha1_Type_MapType_msginit = {
+ &google_api_expr_v1alpha1_Type_MapType_submsgs[0],
+ &google_api_expr_v1alpha1_Type_MapType__fields[0],
+ UPB_SIZE(8, 16), 2, false,
+};
+
+static const upb_msglayout *const google_api_expr_v1alpha1_Type_FunctionType_submsgs[2] = {
+ &google_api_expr_v1alpha1_Type_msginit,
+};
+
+static const upb_msglayout_field google_api_expr_v1alpha1_Type_FunctionType__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 11, 1},
+ {2, UPB_SIZE(4, 8), 0, 0, 11, 3},
+};
+
+const upb_msglayout google_api_expr_v1alpha1_Type_FunctionType_msginit = {
+ &google_api_expr_v1alpha1_Type_FunctionType_submsgs[0],
+ &google_api_expr_v1alpha1_Type_FunctionType__fields[0],
+ UPB_SIZE(8, 16), 2, false,
+};
+
+static const upb_msglayout *const google_api_expr_v1alpha1_Type_AbstractType_submsgs[1] = {
+ &google_api_expr_v1alpha1_Type_msginit,
+};
+
+static const upb_msglayout_field google_api_expr_v1alpha1_Type_AbstractType__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {2, UPB_SIZE(8, 16), 0, 0, 11, 3},
+};
+
+const upb_msglayout google_api_expr_v1alpha1_Type_AbstractType_msginit = {
+ &google_api_expr_v1alpha1_Type_AbstractType_submsgs[0],
+ &google_api_expr_v1alpha1_Type_AbstractType__fields[0],
+ UPB_SIZE(16, 32), 2, false,
+};
+
+static const upb_msglayout *const google_api_expr_v1alpha1_Decl_submsgs[2] = {
+ &google_api_expr_v1alpha1_Decl_FunctionDecl_msginit,
+ &google_api_expr_v1alpha1_Decl_IdentDecl_msginit,
+};
+
+static const upb_msglayout_field google_api_expr_v1alpha1_Decl__fields[3] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 1, 11, 1},
+ {3, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, 1},
+};
+
+const upb_msglayout google_api_expr_v1alpha1_Decl_msginit = {
+ &google_api_expr_v1alpha1_Decl_submsgs[0],
+ &google_api_expr_v1alpha1_Decl__fields[0],
+ UPB_SIZE(16, 32), 3, false,
+};
+
+static const upb_msglayout *const google_api_expr_v1alpha1_Decl_IdentDecl_submsgs[2] = {
+ &google_api_expr_v1alpha1_Constant_msginit,
+ &google_api_expr_v1alpha1_Type_msginit,
+};
+
+static const upb_msglayout_field google_api_expr_v1alpha1_Decl_IdentDecl__fields[3] = {
+ {1, UPB_SIZE(8, 16), 0, 1, 11, 1},
+ {2, UPB_SIZE(12, 24), 0, 0, 11, 1},
+ {3, UPB_SIZE(0, 0), 0, 0, 9, 1},
+};
+
+const upb_msglayout google_api_expr_v1alpha1_Decl_IdentDecl_msginit = {
+ &google_api_expr_v1alpha1_Decl_IdentDecl_submsgs[0],
+ &google_api_expr_v1alpha1_Decl_IdentDecl__fields[0],
+ UPB_SIZE(16, 32), 3, false,
+};
+
+static const upb_msglayout *const google_api_expr_v1alpha1_Decl_FunctionDecl_submsgs[1] = {
+ &google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_msginit,
+};
+
+static const upb_msglayout_field google_api_expr_v1alpha1_Decl_FunctionDecl__fields[1] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 11, 3},
+};
+
+const upb_msglayout google_api_expr_v1alpha1_Decl_FunctionDecl_msginit = {
+ &google_api_expr_v1alpha1_Decl_FunctionDecl_submsgs[0],
+ &google_api_expr_v1alpha1_Decl_FunctionDecl__fields[0],
+ UPB_SIZE(4, 8), 1, false,
+};
+
+static const upb_msglayout *const google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_submsgs[2] = {
+ &google_api_expr_v1alpha1_Type_msginit,
+};
+
+static const upb_msglayout_field google_api_expr_v1alpha1_Decl_FunctionDecl_Overload__fields[6] = {
+ {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
+ {2, UPB_SIZE(24, 48), 0, 0, 11, 3},
+ {3, UPB_SIZE(28, 56), 0, 0, 9, 3},
+ {4, UPB_SIZE(20, 40), 0, 0, 11, 1},
+ {5, UPB_SIZE(0, 0), 0, 0, 8, 1},
+ {6, UPB_SIZE(12, 24), 0, 0, 9, 1},
+};
+
+const upb_msglayout google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_msginit = {
+ &google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_submsgs[0],
+ &google_api_expr_v1alpha1_Decl_FunctionDecl_Overload__fields[0],
+ UPB_SIZE(32, 64), 6, false,
+};
+
+static const upb_msglayout *const google_api_expr_v1alpha1_Reference_submsgs[1] = {
+ &google_api_expr_v1alpha1_Constant_msginit,
+};
+
+static const upb_msglayout_field google_api_expr_v1alpha1_Reference__fields[3] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {3, UPB_SIZE(12, 24), 0, 0, 9, 3},
+ {4, UPB_SIZE(8, 16), 0, 0, 11, 1},
+};
+
+const upb_msglayout google_api_expr_v1alpha1_Reference_msginit = {
+ &google_api_expr_v1alpha1_Reference_submsgs[0],
+ &google_api_expr_v1alpha1_Reference__fields[0],
+ UPB_SIZE(16, 32), 3, false,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.h
index 38e3b6f32ab..a5b9f0cb822 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.h
@@ -1,753 +1,753 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * google/api/expr/v1alpha1/checked.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef GOOGLE_API_EXPR_V1ALPHA1_CHECKED_PROTO_UPB_H_
-#define GOOGLE_API_EXPR_V1ALPHA1_CHECKED_PROTO_UPB_H_
-
-#include "upb/msg.h"
-#include "upb/decode.h"
-#include "upb/encode.h"
-
-#include "upb/port_def.inc"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct google_api_expr_v1alpha1_CheckedExpr;
-struct google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry;
-struct google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry;
-struct google_api_expr_v1alpha1_Type;
-struct google_api_expr_v1alpha1_Type_ListType;
-struct google_api_expr_v1alpha1_Type_MapType;
-struct google_api_expr_v1alpha1_Type_FunctionType;
-struct google_api_expr_v1alpha1_Type_AbstractType;
-struct google_api_expr_v1alpha1_Decl;
-struct google_api_expr_v1alpha1_Decl_IdentDecl;
-struct google_api_expr_v1alpha1_Decl_FunctionDecl;
-struct google_api_expr_v1alpha1_Decl_FunctionDecl_Overload;
-struct google_api_expr_v1alpha1_Reference;
-typedef struct google_api_expr_v1alpha1_CheckedExpr google_api_expr_v1alpha1_CheckedExpr;
-typedef struct google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry;
-typedef struct google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry;
-typedef struct google_api_expr_v1alpha1_Type google_api_expr_v1alpha1_Type;
-typedef struct google_api_expr_v1alpha1_Type_ListType google_api_expr_v1alpha1_Type_ListType;
-typedef struct google_api_expr_v1alpha1_Type_MapType google_api_expr_v1alpha1_Type_MapType;
-typedef struct google_api_expr_v1alpha1_Type_FunctionType google_api_expr_v1alpha1_Type_FunctionType;
-typedef struct google_api_expr_v1alpha1_Type_AbstractType google_api_expr_v1alpha1_Type_AbstractType;
-typedef struct google_api_expr_v1alpha1_Decl google_api_expr_v1alpha1_Decl;
-typedef struct google_api_expr_v1alpha1_Decl_IdentDecl google_api_expr_v1alpha1_Decl_IdentDecl;
-typedef struct google_api_expr_v1alpha1_Decl_FunctionDecl google_api_expr_v1alpha1_Decl_FunctionDecl;
-typedef struct google_api_expr_v1alpha1_Decl_FunctionDecl_Overload google_api_expr_v1alpha1_Decl_FunctionDecl_Overload;
-typedef struct google_api_expr_v1alpha1_Reference google_api_expr_v1alpha1_Reference;
-extern const upb_msglayout google_api_expr_v1alpha1_CheckedExpr_msginit;
-extern const upb_msglayout google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry_msginit;
-extern const upb_msglayout google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry_msginit;
-extern const upb_msglayout google_api_expr_v1alpha1_Type_msginit;
-extern const upb_msglayout google_api_expr_v1alpha1_Type_ListType_msginit;
-extern const upb_msglayout google_api_expr_v1alpha1_Type_MapType_msginit;
-extern const upb_msglayout google_api_expr_v1alpha1_Type_FunctionType_msginit;
-extern const upb_msglayout google_api_expr_v1alpha1_Type_AbstractType_msginit;
-extern const upb_msglayout google_api_expr_v1alpha1_Decl_msginit;
-extern const upb_msglayout google_api_expr_v1alpha1_Decl_IdentDecl_msginit;
-extern const upb_msglayout google_api_expr_v1alpha1_Decl_FunctionDecl_msginit;
-extern const upb_msglayout google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_msginit;
-extern const upb_msglayout google_api_expr_v1alpha1_Reference_msginit;
-struct google_api_expr_v1alpha1_Constant;
-struct google_api_expr_v1alpha1_Expr;
-struct google_api_expr_v1alpha1_SourceInfo;
-struct google_protobuf_Empty;
-extern const upb_msglayout google_api_expr_v1alpha1_Constant_msginit;
-extern const upb_msglayout google_api_expr_v1alpha1_Expr_msginit;
-extern const upb_msglayout google_api_expr_v1alpha1_SourceInfo_msginit;
-extern const upb_msglayout google_protobuf_Empty_msginit;
-
-typedef enum {
- google_api_expr_v1alpha1_Type_PRIMITIVE_TYPE_UNSPECIFIED = 0,
- google_api_expr_v1alpha1_Type_BOOL = 1,
- google_api_expr_v1alpha1_Type_INT64 = 2,
- google_api_expr_v1alpha1_Type_UINT64 = 3,
- google_api_expr_v1alpha1_Type_DOUBLE = 4,
- google_api_expr_v1alpha1_Type_STRING = 5,
- google_api_expr_v1alpha1_Type_BYTES = 6
-} google_api_expr_v1alpha1_Type_PrimitiveType;
-
-typedef enum {
- google_api_expr_v1alpha1_Type_WELL_KNOWN_TYPE_UNSPECIFIED = 0,
- google_api_expr_v1alpha1_Type_ANY = 1,
- google_api_expr_v1alpha1_Type_TIMESTAMP = 2,
- google_api_expr_v1alpha1_Type_DURATION = 3
-} google_api_expr_v1alpha1_Type_WellKnownType;
-
-
-/* google.api.expr.v1alpha1.CheckedExpr */
-
-UPB_INLINE google_api_expr_v1alpha1_CheckedExpr *google_api_expr_v1alpha1_CheckedExpr_new(upb_arena *arena) {
- return (google_api_expr_v1alpha1_CheckedExpr *)_upb_msg_new(&google_api_expr_v1alpha1_CheckedExpr_msginit, arena);
-}
-UPB_INLINE google_api_expr_v1alpha1_CheckedExpr *google_api_expr_v1alpha1_CheckedExpr_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_api_expr_v1alpha1_CheckedExpr *ret = google_api_expr_v1alpha1_CheckedExpr_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_api_expr_v1alpha1_CheckedExpr_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *google_api_expr_v1alpha1_CheckedExpr_serialize(const google_api_expr_v1alpha1_CheckedExpr *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &google_api_expr_v1alpha1_CheckedExpr_msginit, arena, len);
-}
-
-UPB_INLINE bool google_api_expr_v1alpha1_CheckedExpr_has_reference_map(const google_api_expr_v1alpha1_CheckedExpr *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE size_t google_api_expr_v1alpha1_CheckedExpr_reference_map_size(const google_api_expr_v1alpha1_CheckedExpr *msg) {return _upb_msg_map_size(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE bool google_api_expr_v1alpha1_CheckedExpr_reference_map_get(const google_api_expr_v1alpha1_CheckedExpr *msg, int64_t key, google_api_expr_v1alpha1_Reference* *val) { return _upb_msg_map_get(msg, UPB_SIZE(8, 16), &key, sizeof(key), val, sizeof(*val)); }
-UPB_INLINE const google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry* google_api_expr_v1alpha1_CheckedExpr_reference_map_next(const google_api_expr_v1alpha1_CheckedExpr *msg, size_t* iter) { return (const google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry*)_upb_msg_map_next(msg, UPB_SIZE(8, 16), iter); }
-UPB_INLINE bool google_api_expr_v1alpha1_CheckedExpr_has_type_map(const google_api_expr_v1alpha1_CheckedExpr *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
-UPB_INLINE size_t google_api_expr_v1alpha1_CheckedExpr_type_map_size(const google_api_expr_v1alpha1_CheckedExpr *msg) {return _upb_msg_map_size(msg, UPB_SIZE(12, 24)); }
-UPB_INLINE bool google_api_expr_v1alpha1_CheckedExpr_type_map_get(const google_api_expr_v1alpha1_CheckedExpr *msg, int64_t key, google_api_expr_v1alpha1_Type* *val) { return _upb_msg_map_get(msg, UPB_SIZE(12, 24), &key, sizeof(key), val, sizeof(*val)); }
-UPB_INLINE const google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry* google_api_expr_v1alpha1_CheckedExpr_type_map_next(const google_api_expr_v1alpha1_CheckedExpr *msg, size_t* iter) { return (const google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry*)_upb_msg_map_next(msg, UPB_SIZE(12, 24), iter); }
-UPB_INLINE bool google_api_expr_v1alpha1_CheckedExpr_has_expr(const google_api_expr_v1alpha1_CheckedExpr *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE const struct google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_CheckedExpr_expr(const google_api_expr_v1alpha1_CheckedExpr *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct google_api_expr_v1alpha1_Expr*); }
-UPB_INLINE bool google_api_expr_v1alpha1_CheckedExpr_has_source_info(const google_api_expr_v1alpha1_CheckedExpr *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
-UPB_INLINE const struct google_api_expr_v1alpha1_SourceInfo* google_api_expr_v1alpha1_CheckedExpr_source_info(const google_api_expr_v1alpha1_CheckedExpr *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_api_expr_v1alpha1_SourceInfo*); }
-
-UPB_INLINE void google_api_expr_v1alpha1_CheckedExpr_reference_map_clear(google_api_expr_v1alpha1_CheckedExpr *msg) { _upb_msg_map_clear(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE bool google_api_expr_v1alpha1_CheckedExpr_reference_map_set(google_api_expr_v1alpha1_CheckedExpr *msg, int64_t key, google_api_expr_v1alpha1_Reference* val, upb_arena *a) { return _upb_msg_map_set(msg, UPB_SIZE(8, 16), &key, sizeof(key), &val, sizeof(val), a); }
-UPB_INLINE bool google_api_expr_v1alpha1_CheckedExpr_reference_map_delete(google_api_expr_v1alpha1_CheckedExpr *msg, int64_t key) { return _upb_msg_map_delete(msg, UPB_SIZE(8, 16), &key, sizeof(key)); }
-UPB_INLINE google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry* google_api_expr_v1alpha1_CheckedExpr_reference_map_nextmutable(google_api_expr_v1alpha1_CheckedExpr *msg, size_t* iter) { return (google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry*)_upb_msg_map_next(msg, UPB_SIZE(8, 16), iter); }
-UPB_INLINE void google_api_expr_v1alpha1_CheckedExpr_type_map_clear(google_api_expr_v1alpha1_CheckedExpr *msg) { _upb_msg_map_clear(msg, UPB_SIZE(12, 24)); }
-UPB_INLINE bool google_api_expr_v1alpha1_CheckedExpr_type_map_set(google_api_expr_v1alpha1_CheckedExpr *msg, int64_t key, google_api_expr_v1alpha1_Type* val, upb_arena *a) { return _upb_msg_map_set(msg, UPB_SIZE(12, 24), &key, sizeof(key), &val, sizeof(val), a); }
-UPB_INLINE bool google_api_expr_v1alpha1_CheckedExpr_type_map_delete(google_api_expr_v1alpha1_CheckedExpr *msg, int64_t key) { return _upb_msg_map_delete(msg, UPB_SIZE(12, 24), &key, sizeof(key)); }
-UPB_INLINE google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry* google_api_expr_v1alpha1_CheckedExpr_type_map_nextmutable(google_api_expr_v1alpha1_CheckedExpr *msg, size_t* iter) { return (google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry*)_upb_msg_map_next(msg, UPB_SIZE(12, 24), iter); }
-UPB_INLINE void google_api_expr_v1alpha1_CheckedExpr_set_expr(google_api_expr_v1alpha1_CheckedExpr *msg, struct google_api_expr_v1alpha1_Expr* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct google_api_expr_v1alpha1_Expr*) = value;
-}
-UPB_INLINE struct google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_CheckedExpr_mutable_expr(google_api_expr_v1alpha1_CheckedExpr *msg, upb_arena *arena) {
- struct google_api_expr_v1alpha1_Expr* sub = (struct google_api_expr_v1alpha1_Expr*)google_api_expr_v1alpha1_CheckedExpr_expr(msg);
- if (sub == NULL) {
- sub = (struct google_api_expr_v1alpha1_Expr*)_upb_msg_new(&google_api_expr_v1alpha1_Expr_msginit, arena);
- if (!sub) return NULL;
- google_api_expr_v1alpha1_CheckedExpr_set_expr(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void google_api_expr_v1alpha1_CheckedExpr_set_source_info(google_api_expr_v1alpha1_CheckedExpr *msg, struct google_api_expr_v1alpha1_SourceInfo* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_api_expr_v1alpha1_SourceInfo*) = value;
-}
-UPB_INLINE struct google_api_expr_v1alpha1_SourceInfo* google_api_expr_v1alpha1_CheckedExpr_mutable_source_info(google_api_expr_v1alpha1_CheckedExpr *msg, upb_arena *arena) {
- struct google_api_expr_v1alpha1_SourceInfo* sub = (struct google_api_expr_v1alpha1_SourceInfo*)google_api_expr_v1alpha1_CheckedExpr_source_info(msg);
- if (sub == NULL) {
- sub = (struct google_api_expr_v1alpha1_SourceInfo*)_upb_msg_new(&google_api_expr_v1alpha1_SourceInfo_msginit, arena);
- if (!sub) return NULL;
- google_api_expr_v1alpha1_CheckedExpr_set_source_info(msg, sub);
- }
- return sub;
-}
-
-/* google.api.expr.v1alpha1.CheckedExpr.ReferenceMapEntry */
-
-UPB_INLINE int64_t google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry_key(const google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry *msg) {
- int64_t ret;
- _upb_msg_map_key(msg, &ret, sizeof(ret));
- return ret;
-}
-UPB_INLINE bool google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry_has_value(const google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const google_api_expr_v1alpha1_Reference* google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry_value(const google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry *msg) {
- google_api_expr_v1alpha1_Reference* ret;
- _upb_msg_map_value(msg, &ret, sizeof(ret));
- return ret;
-}
-
-UPB_INLINE void google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry_set_value(google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry *msg, google_api_expr_v1alpha1_Reference* value) {
- _upb_msg_map_set_value(msg, &value, sizeof(google_api_expr_v1alpha1_Reference*));
-}
-
-/* google.api.expr.v1alpha1.CheckedExpr.TypeMapEntry */
-
-UPB_INLINE int64_t google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry_key(const google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry *msg) {
- int64_t ret;
- _upb_msg_map_key(msg, &ret, sizeof(ret));
- return ret;
-}
-UPB_INLINE bool google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry_has_value(const google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const google_api_expr_v1alpha1_Type* google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry_value(const google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry *msg) {
- google_api_expr_v1alpha1_Type* ret;
- _upb_msg_map_value(msg, &ret, sizeof(ret));
- return ret;
-}
-
-UPB_INLINE void google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry_set_value(google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry *msg, google_api_expr_v1alpha1_Type* value) {
- _upb_msg_map_set_value(msg, &value, sizeof(google_api_expr_v1alpha1_Type*));
-}
-
-/* google.api.expr.v1alpha1.Type */
-
-UPB_INLINE google_api_expr_v1alpha1_Type *google_api_expr_v1alpha1_Type_new(upb_arena *arena) {
- return (google_api_expr_v1alpha1_Type *)_upb_msg_new(&google_api_expr_v1alpha1_Type_msginit, arena);
-}
-UPB_INLINE google_api_expr_v1alpha1_Type *google_api_expr_v1alpha1_Type_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_api_expr_v1alpha1_Type *ret = google_api_expr_v1alpha1_Type_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Type_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *google_api_expr_v1alpha1_Type_serialize(const google_api_expr_v1alpha1_Type *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &google_api_expr_v1alpha1_Type_msginit, arena, len);
-}
-
-typedef enum {
- google_api_expr_v1alpha1_Type_type_kind_dyn = 1,
- google_api_expr_v1alpha1_Type_type_kind_null = 2,
- google_api_expr_v1alpha1_Type_type_kind_primitive = 3,
- google_api_expr_v1alpha1_Type_type_kind_wrapper = 4,
- google_api_expr_v1alpha1_Type_type_kind_well_known = 5,
- google_api_expr_v1alpha1_Type_type_kind_list_type = 6,
- google_api_expr_v1alpha1_Type_type_kind_map_type = 7,
- google_api_expr_v1alpha1_Type_type_kind_function = 8,
- google_api_expr_v1alpha1_Type_type_kind_message_type = 9,
- google_api_expr_v1alpha1_Type_type_kind_type_param = 10,
- google_api_expr_v1alpha1_Type_type_kind_type = 11,
- google_api_expr_v1alpha1_Type_type_kind_error = 12,
- google_api_expr_v1alpha1_Type_type_kind_abstract_type = 14,
- google_api_expr_v1alpha1_Type_type_kind_NOT_SET = 0
-} google_api_expr_v1alpha1_Type_type_kind_oneofcases;
-UPB_INLINE google_api_expr_v1alpha1_Type_type_kind_oneofcases google_api_expr_v1alpha1_Type_type_kind_case(const google_api_expr_v1alpha1_Type* msg) { return (google_api_expr_v1alpha1_Type_type_kind_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(8, 16), int32_t); }
-
-UPB_INLINE bool google_api_expr_v1alpha1_Type_has_dyn(const google_api_expr_v1alpha1_Type *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 1; }
-UPB_INLINE const struct google_protobuf_Empty* google_api_expr_v1alpha1_Type_dyn(const google_api_expr_v1alpha1_Type *msg) { return UPB_READ_ONEOF(msg, const struct google_protobuf_Empty*, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 1, NULL); }
-UPB_INLINE bool google_api_expr_v1alpha1_Type_has_null(const google_api_expr_v1alpha1_Type *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 2; }
-UPB_INLINE int32_t google_api_expr_v1alpha1_Type_null(const google_api_expr_v1alpha1_Type *msg) { return UPB_READ_ONEOF(msg, int32_t, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 2, 0); }
-UPB_INLINE bool google_api_expr_v1alpha1_Type_has_primitive(const google_api_expr_v1alpha1_Type *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 3; }
-UPB_INLINE int32_t google_api_expr_v1alpha1_Type_primitive(const google_api_expr_v1alpha1_Type *msg) { return UPB_READ_ONEOF(msg, int32_t, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 3, 0); }
-UPB_INLINE bool google_api_expr_v1alpha1_Type_has_wrapper(const google_api_expr_v1alpha1_Type *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 4; }
-UPB_INLINE int32_t google_api_expr_v1alpha1_Type_wrapper(const google_api_expr_v1alpha1_Type *msg) { return UPB_READ_ONEOF(msg, int32_t, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 4, 0); }
-UPB_INLINE bool google_api_expr_v1alpha1_Type_has_well_known(const google_api_expr_v1alpha1_Type *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 5; }
-UPB_INLINE int32_t google_api_expr_v1alpha1_Type_well_known(const google_api_expr_v1alpha1_Type *msg) { return UPB_READ_ONEOF(msg, int32_t, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 5, 0); }
-UPB_INLINE bool google_api_expr_v1alpha1_Type_has_list_type(const google_api_expr_v1alpha1_Type *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 6; }
-UPB_INLINE const google_api_expr_v1alpha1_Type_ListType* google_api_expr_v1alpha1_Type_list_type(const google_api_expr_v1alpha1_Type *msg) { return UPB_READ_ONEOF(msg, const google_api_expr_v1alpha1_Type_ListType*, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 6, NULL); }
-UPB_INLINE bool google_api_expr_v1alpha1_Type_has_map_type(const google_api_expr_v1alpha1_Type *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 7; }
-UPB_INLINE const google_api_expr_v1alpha1_Type_MapType* google_api_expr_v1alpha1_Type_map_type(const google_api_expr_v1alpha1_Type *msg) { return UPB_READ_ONEOF(msg, const google_api_expr_v1alpha1_Type_MapType*, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 7, NULL); }
-UPB_INLINE bool google_api_expr_v1alpha1_Type_has_function(const google_api_expr_v1alpha1_Type *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 8; }
-UPB_INLINE const google_api_expr_v1alpha1_Type_FunctionType* google_api_expr_v1alpha1_Type_function(const google_api_expr_v1alpha1_Type *msg) { return UPB_READ_ONEOF(msg, const google_api_expr_v1alpha1_Type_FunctionType*, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 8, NULL); }
-UPB_INLINE bool google_api_expr_v1alpha1_Type_has_message_type(const google_api_expr_v1alpha1_Type *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 9; }
-UPB_INLINE upb_strview google_api_expr_v1alpha1_Type_message_type(const google_api_expr_v1alpha1_Type *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 9, upb_strview_make("", strlen(""))); }
-UPB_INLINE bool google_api_expr_v1alpha1_Type_has_type_param(const google_api_expr_v1alpha1_Type *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 10; }
-UPB_INLINE upb_strview google_api_expr_v1alpha1_Type_type_param(const google_api_expr_v1alpha1_Type *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 10, upb_strview_make("", strlen(""))); }
-UPB_INLINE bool google_api_expr_v1alpha1_Type_has_type(const google_api_expr_v1alpha1_Type *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 11; }
-UPB_INLINE const google_api_expr_v1alpha1_Type* google_api_expr_v1alpha1_Type_type(const google_api_expr_v1alpha1_Type *msg) { return UPB_READ_ONEOF(msg, const google_api_expr_v1alpha1_Type*, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 11, NULL); }
-UPB_INLINE bool google_api_expr_v1alpha1_Type_has_error(const google_api_expr_v1alpha1_Type *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 12; }
-UPB_INLINE const struct google_protobuf_Empty* google_api_expr_v1alpha1_Type_error(const google_api_expr_v1alpha1_Type *msg) { return UPB_READ_ONEOF(msg, const struct google_protobuf_Empty*, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 12, NULL); }
-UPB_INLINE bool google_api_expr_v1alpha1_Type_has_abstract_type(const google_api_expr_v1alpha1_Type *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 14; }
-UPB_INLINE const google_api_expr_v1alpha1_Type_AbstractType* google_api_expr_v1alpha1_Type_abstract_type(const google_api_expr_v1alpha1_Type *msg) { return UPB_READ_ONEOF(msg, const google_api_expr_v1alpha1_Type_AbstractType*, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 14, NULL); }
-
-UPB_INLINE void google_api_expr_v1alpha1_Type_set_dyn(google_api_expr_v1alpha1_Type *msg, struct google_protobuf_Empty* value) {
- UPB_WRITE_ONEOF(msg, struct google_protobuf_Empty*, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 1);
-}
-UPB_INLINE struct google_protobuf_Empty* google_api_expr_v1alpha1_Type_mutable_dyn(google_api_expr_v1alpha1_Type *msg, upb_arena *arena) {
- struct google_protobuf_Empty* sub = (struct google_protobuf_Empty*)google_api_expr_v1alpha1_Type_dyn(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Empty*)_upb_msg_new(&google_protobuf_Empty_msginit, arena);
- if (!sub) return NULL;
- google_api_expr_v1alpha1_Type_set_dyn(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void google_api_expr_v1alpha1_Type_set_null(google_api_expr_v1alpha1_Type *msg, int32_t value) {
- UPB_WRITE_ONEOF(msg, int32_t, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 2);
-}
-UPB_INLINE void google_api_expr_v1alpha1_Type_set_primitive(google_api_expr_v1alpha1_Type *msg, int32_t value) {
- UPB_WRITE_ONEOF(msg, int32_t, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 3);
-}
-UPB_INLINE void google_api_expr_v1alpha1_Type_set_wrapper(google_api_expr_v1alpha1_Type *msg, int32_t value) {
- UPB_WRITE_ONEOF(msg, int32_t, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 4);
-}
-UPB_INLINE void google_api_expr_v1alpha1_Type_set_well_known(google_api_expr_v1alpha1_Type *msg, int32_t value) {
- UPB_WRITE_ONEOF(msg, int32_t, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 5);
-}
-UPB_INLINE void google_api_expr_v1alpha1_Type_set_list_type(google_api_expr_v1alpha1_Type *msg, google_api_expr_v1alpha1_Type_ListType* value) {
- UPB_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Type_ListType*, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 6);
-}
-UPB_INLINE struct google_api_expr_v1alpha1_Type_ListType* google_api_expr_v1alpha1_Type_mutable_list_type(google_api_expr_v1alpha1_Type *msg, upb_arena *arena) {
- struct google_api_expr_v1alpha1_Type_ListType* sub = (struct google_api_expr_v1alpha1_Type_ListType*)google_api_expr_v1alpha1_Type_list_type(msg);
- if (sub == NULL) {
- sub = (struct google_api_expr_v1alpha1_Type_ListType*)_upb_msg_new(&google_api_expr_v1alpha1_Type_ListType_msginit, arena);
- if (!sub) return NULL;
- google_api_expr_v1alpha1_Type_set_list_type(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void google_api_expr_v1alpha1_Type_set_map_type(google_api_expr_v1alpha1_Type *msg, google_api_expr_v1alpha1_Type_MapType* value) {
- UPB_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Type_MapType*, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 7);
-}
-UPB_INLINE struct google_api_expr_v1alpha1_Type_MapType* google_api_expr_v1alpha1_Type_mutable_map_type(google_api_expr_v1alpha1_Type *msg, upb_arena *arena) {
- struct google_api_expr_v1alpha1_Type_MapType* sub = (struct google_api_expr_v1alpha1_Type_MapType*)google_api_expr_v1alpha1_Type_map_type(msg);
- if (sub == NULL) {
- sub = (struct google_api_expr_v1alpha1_Type_MapType*)_upb_msg_new(&google_api_expr_v1alpha1_Type_MapType_msginit, arena);
- if (!sub) return NULL;
- google_api_expr_v1alpha1_Type_set_map_type(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void google_api_expr_v1alpha1_Type_set_function(google_api_expr_v1alpha1_Type *msg, google_api_expr_v1alpha1_Type_FunctionType* value) {
- UPB_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Type_FunctionType*, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 8);
-}
-UPB_INLINE struct google_api_expr_v1alpha1_Type_FunctionType* google_api_expr_v1alpha1_Type_mutable_function(google_api_expr_v1alpha1_Type *msg, upb_arena *arena) {
- struct google_api_expr_v1alpha1_Type_FunctionType* sub = (struct google_api_expr_v1alpha1_Type_FunctionType*)google_api_expr_v1alpha1_Type_function(msg);
- if (sub == NULL) {
- sub = (struct google_api_expr_v1alpha1_Type_FunctionType*)_upb_msg_new(&google_api_expr_v1alpha1_Type_FunctionType_msginit, arena);
- if (!sub) return NULL;
- google_api_expr_v1alpha1_Type_set_function(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void google_api_expr_v1alpha1_Type_set_message_type(google_api_expr_v1alpha1_Type *msg, upb_strview value) {
- UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 9);
-}
-UPB_INLINE void google_api_expr_v1alpha1_Type_set_type_param(google_api_expr_v1alpha1_Type *msg, upb_strview value) {
- UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 10);
-}
-UPB_INLINE void google_api_expr_v1alpha1_Type_set_type(google_api_expr_v1alpha1_Type *msg, google_api_expr_v1alpha1_Type* value) {
- UPB_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Type*, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 11);
-}
-UPB_INLINE struct google_api_expr_v1alpha1_Type* google_api_expr_v1alpha1_Type_mutable_type(google_api_expr_v1alpha1_Type *msg, upb_arena *arena) {
- struct google_api_expr_v1alpha1_Type* sub = (struct google_api_expr_v1alpha1_Type*)google_api_expr_v1alpha1_Type_type(msg);
- if (sub == NULL) {
- sub = (struct google_api_expr_v1alpha1_Type*)_upb_msg_new(&google_api_expr_v1alpha1_Type_msginit, arena);
- if (!sub) return NULL;
- google_api_expr_v1alpha1_Type_set_type(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void google_api_expr_v1alpha1_Type_set_error(google_api_expr_v1alpha1_Type *msg, struct google_protobuf_Empty* value) {
- UPB_WRITE_ONEOF(msg, struct google_protobuf_Empty*, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 12);
-}
-UPB_INLINE struct google_protobuf_Empty* google_api_expr_v1alpha1_Type_mutable_error(google_api_expr_v1alpha1_Type *msg, upb_arena *arena) {
- struct google_protobuf_Empty* sub = (struct google_protobuf_Empty*)google_api_expr_v1alpha1_Type_error(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Empty*)_upb_msg_new(&google_protobuf_Empty_msginit, arena);
- if (!sub) return NULL;
- google_api_expr_v1alpha1_Type_set_error(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void google_api_expr_v1alpha1_Type_set_abstract_type(google_api_expr_v1alpha1_Type *msg, google_api_expr_v1alpha1_Type_AbstractType* value) {
- UPB_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Type_AbstractType*, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 14);
-}
-UPB_INLINE struct google_api_expr_v1alpha1_Type_AbstractType* google_api_expr_v1alpha1_Type_mutable_abstract_type(google_api_expr_v1alpha1_Type *msg, upb_arena *arena) {
- struct google_api_expr_v1alpha1_Type_AbstractType* sub = (struct google_api_expr_v1alpha1_Type_AbstractType*)google_api_expr_v1alpha1_Type_abstract_type(msg);
- if (sub == NULL) {
- sub = (struct google_api_expr_v1alpha1_Type_AbstractType*)_upb_msg_new(&google_api_expr_v1alpha1_Type_AbstractType_msginit, arena);
- if (!sub) return NULL;
- google_api_expr_v1alpha1_Type_set_abstract_type(msg, sub);
- }
- return sub;
-}
-
-/* google.api.expr.v1alpha1.Type.ListType */
-
-UPB_INLINE google_api_expr_v1alpha1_Type_ListType *google_api_expr_v1alpha1_Type_ListType_new(upb_arena *arena) {
- return (google_api_expr_v1alpha1_Type_ListType *)_upb_msg_new(&google_api_expr_v1alpha1_Type_ListType_msginit, arena);
-}
-UPB_INLINE google_api_expr_v1alpha1_Type_ListType *google_api_expr_v1alpha1_Type_ListType_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_api_expr_v1alpha1_Type_ListType *ret = google_api_expr_v1alpha1_Type_ListType_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Type_ListType_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *google_api_expr_v1alpha1_Type_ListType_serialize(const google_api_expr_v1alpha1_Type_ListType *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &google_api_expr_v1alpha1_Type_ListType_msginit, arena, len);
-}
-
-UPB_INLINE bool google_api_expr_v1alpha1_Type_ListType_has_elem_type(const google_api_expr_v1alpha1_Type_ListType *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE const google_api_expr_v1alpha1_Type* google_api_expr_v1alpha1_Type_ListType_elem_type(const google_api_expr_v1alpha1_Type_ListType *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const google_api_expr_v1alpha1_Type*); }
-
-UPB_INLINE void google_api_expr_v1alpha1_Type_ListType_set_elem_type(google_api_expr_v1alpha1_Type_ListType *msg, google_api_expr_v1alpha1_Type* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), google_api_expr_v1alpha1_Type*) = value;
-}
-UPB_INLINE struct google_api_expr_v1alpha1_Type* google_api_expr_v1alpha1_Type_ListType_mutable_elem_type(google_api_expr_v1alpha1_Type_ListType *msg, upb_arena *arena) {
- struct google_api_expr_v1alpha1_Type* sub = (struct google_api_expr_v1alpha1_Type*)google_api_expr_v1alpha1_Type_ListType_elem_type(msg);
- if (sub == NULL) {
- sub = (struct google_api_expr_v1alpha1_Type*)_upb_msg_new(&google_api_expr_v1alpha1_Type_msginit, arena);
- if (!sub) return NULL;
- google_api_expr_v1alpha1_Type_ListType_set_elem_type(msg, sub);
- }
- return sub;
-}
-
-/* google.api.expr.v1alpha1.Type.MapType */
-
-UPB_INLINE google_api_expr_v1alpha1_Type_MapType *google_api_expr_v1alpha1_Type_MapType_new(upb_arena *arena) {
- return (google_api_expr_v1alpha1_Type_MapType *)_upb_msg_new(&google_api_expr_v1alpha1_Type_MapType_msginit, arena);
-}
-UPB_INLINE google_api_expr_v1alpha1_Type_MapType *google_api_expr_v1alpha1_Type_MapType_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_api_expr_v1alpha1_Type_MapType *ret = google_api_expr_v1alpha1_Type_MapType_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Type_MapType_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *google_api_expr_v1alpha1_Type_MapType_serialize(const google_api_expr_v1alpha1_Type_MapType *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &google_api_expr_v1alpha1_Type_MapType_msginit, arena, len);
-}
-
-UPB_INLINE bool google_api_expr_v1alpha1_Type_MapType_has_key_type(const google_api_expr_v1alpha1_Type_MapType *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE const google_api_expr_v1alpha1_Type* google_api_expr_v1alpha1_Type_MapType_key_type(const google_api_expr_v1alpha1_Type_MapType *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const google_api_expr_v1alpha1_Type*); }
-UPB_INLINE bool google_api_expr_v1alpha1_Type_MapType_has_value_type(const google_api_expr_v1alpha1_Type_MapType *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
-UPB_INLINE const google_api_expr_v1alpha1_Type* google_api_expr_v1alpha1_Type_MapType_value_type(const google_api_expr_v1alpha1_Type_MapType *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const google_api_expr_v1alpha1_Type*); }
-
-UPB_INLINE void google_api_expr_v1alpha1_Type_MapType_set_key_type(google_api_expr_v1alpha1_Type_MapType *msg, google_api_expr_v1alpha1_Type* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), google_api_expr_v1alpha1_Type*) = value;
-}
-UPB_INLINE struct google_api_expr_v1alpha1_Type* google_api_expr_v1alpha1_Type_MapType_mutable_key_type(google_api_expr_v1alpha1_Type_MapType *msg, upb_arena *arena) {
- struct google_api_expr_v1alpha1_Type* sub = (struct google_api_expr_v1alpha1_Type*)google_api_expr_v1alpha1_Type_MapType_key_type(msg);
- if (sub == NULL) {
- sub = (struct google_api_expr_v1alpha1_Type*)_upb_msg_new(&google_api_expr_v1alpha1_Type_msginit, arena);
- if (!sub) return NULL;
- google_api_expr_v1alpha1_Type_MapType_set_key_type(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void google_api_expr_v1alpha1_Type_MapType_set_value_type(google_api_expr_v1alpha1_Type_MapType *msg, google_api_expr_v1alpha1_Type* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), google_api_expr_v1alpha1_Type*) = value;
-}
-UPB_INLINE struct google_api_expr_v1alpha1_Type* google_api_expr_v1alpha1_Type_MapType_mutable_value_type(google_api_expr_v1alpha1_Type_MapType *msg, upb_arena *arena) {
- struct google_api_expr_v1alpha1_Type* sub = (struct google_api_expr_v1alpha1_Type*)google_api_expr_v1alpha1_Type_MapType_value_type(msg);
- if (sub == NULL) {
- sub = (struct google_api_expr_v1alpha1_Type*)_upb_msg_new(&google_api_expr_v1alpha1_Type_msginit, arena);
- if (!sub) return NULL;
- google_api_expr_v1alpha1_Type_MapType_set_value_type(msg, sub);
- }
- return sub;
-}
-
-/* google.api.expr.v1alpha1.Type.FunctionType */
-
-UPB_INLINE google_api_expr_v1alpha1_Type_FunctionType *google_api_expr_v1alpha1_Type_FunctionType_new(upb_arena *arena) {
- return (google_api_expr_v1alpha1_Type_FunctionType *)_upb_msg_new(&google_api_expr_v1alpha1_Type_FunctionType_msginit, arena);
-}
-UPB_INLINE google_api_expr_v1alpha1_Type_FunctionType *google_api_expr_v1alpha1_Type_FunctionType_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_api_expr_v1alpha1_Type_FunctionType *ret = google_api_expr_v1alpha1_Type_FunctionType_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Type_FunctionType_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *google_api_expr_v1alpha1_Type_FunctionType_serialize(const google_api_expr_v1alpha1_Type_FunctionType *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &google_api_expr_v1alpha1_Type_FunctionType_msginit, arena, len);
-}
-
-UPB_INLINE bool google_api_expr_v1alpha1_Type_FunctionType_has_result_type(const google_api_expr_v1alpha1_Type_FunctionType *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE const google_api_expr_v1alpha1_Type* google_api_expr_v1alpha1_Type_FunctionType_result_type(const google_api_expr_v1alpha1_Type_FunctionType *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const google_api_expr_v1alpha1_Type*); }
-UPB_INLINE bool google_api_expr_v1alpha1_Type_FunctionType_has_arg_types(const google_api_expr_v1alpha1_Type_FunctionType *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
-UPB_INLINE const google_api_expr_v1alpha1_Type* const* google_api_expr_v1alpha1_Type_FunctionType_arg_types(const google_api_expr_v1alpha1_Type_FunctionType *msg, size_t *len) { return (const google_api_expr_v1alpha1_Type* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len); }
-
-UPB_INLINE void google_api_expr_v1alpha1_Type_FunctionType_set_result_type(google_api_expr_v1alpha1_Type_FunctionType *msg, google_api_expr_v1alpha1_Type* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), google_api_expr_v1alpha1_Type*) = value;
-}
-UPB_INLINE struct google_api_expr_v1alpha1_Type* google_api_expr_v1alpha1_Type_FunctionType_mutable_result_type(google_api_expr_v1alpha1_Type_FunctionType *msg, upb_arena *arena) {
- struct google_api_expr_v1alpha1_Type* sub = (struct google_api_expr_v1alpha1_Type*)google_api_expr_v1alpha1_Type_FunctionType_result_type(msg);
- if (sub == NULL) {
- sub = (struct google_api_expr_v1alpha1_Type*)_upb_msg_new(&google_api_expr_v1alpha1_Type_msginit, arena);
- if (!sub) return NULL;
- google_api_expr_v1alpha1_Type_FunctionType_set_result_type(msg, sub);
- }
- return sub;
-}
-UPB_INLINE google_api_expr_v1alpha1_Type** google_api_expr_v1alpha1_Type_FunctionType_mutable_arg_types(google_api_expr_v1alpha1_Type_FunctionType *msg, size_t *len) {
- return (google_api_expr_v1alpha1_Type**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len);
-}
-UPB_INLINE google_api_expr_v1alpha1_Type** google_api_expr_v1alpha1_Type_FunctionType_resize_arg_types(google_api_expr_v1alpha1_Type_FunctionType *msg, size_t len, upb_arena *arena) {
- return (google_api_expr_v1alpha1_Type**)_upb_array_resize_accessor(msg, UPB_SIZE(4, 8), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct google_api_expr_v1alpha1_Type* google_api_expr_v1alpha1_Type_FunctionType_add_arg_types(google_api_expr_v1alpha1_Type_FunctionType *msg, upb_arena *arena) {
- struct google_api_expr_v1alpha1_Type* sub = (struct google_api_expr_v1alpha1_Type*)_upb_msg_new(&google_api_expr_v1alpha1_Type_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(4, 8), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-
-/* google.api.expr.v1alpha1.Type.AbstractType */
-
-UPB_INLINE google_api_expr_v1alpha1_Type_AbstractType *google_api_expr_v1alpha1_Type_AbstractType_new(upb_arena *arena) {
- return (google_api_expr_v1alpha1_Type_AbstractType *)_upb_msg_new(&google_api_expr_v1alpha1_Type_AbstractType_msginit, arena);
-}
-UPB_INLINE google_api_expr_v1alpha1_Type_AbstractType *google_api_expr_v1alpha1_Type_AbstractType_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_api_expr_v1alpha1_Type_AbstractType *ret = google_api_expr_v1alpha1_Type_AbstractType_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Type_AbstractType_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *google_api_expr_v1alpha1_Type_AbstractType_serialize(const google_api_expr_v1alpha1_Type_AbstractType *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &google_api_expr_v1alpha1_Type_AbstractType_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview google_api_expr_v1alpha1_Type_AbstractType_name(const google_api_expr_v1alpha1_Type_AbstractType *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE bool google_api_expr_v1alpha1_Type_AbstractType_has_parameter_types(const google_api_expr_v1alpha1_Type_AbstractType *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const google_api_expr_v1alpha1_Type* const* google_api_expr_v1alpha1_Type_AbstractType_parameter_types(const google_api_expr_v1alpha1_Type_AbstractType *msg, size_t *len) { return (const google_api_expr_v1alpha1_Type* const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len); }
-
-UPB_INLINE void google_api_expr_v1alpha1_Type_AbstractType_set_name(google_api_expr_v1alpha1_Type_AbstractType *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-UPB_INLINE google_api_expr_v1alpha1_Type** google_api_expr_v1alpha1_Type_AbstractType_mutable_parameter_types(google_api_expr_v1alpha1_Type_AbstractType *msg, size_t *len) {
- return (google_api_expr_v1alpha1_Type**)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len);
-}
-UPB_INLINE google_api_expr_v1alpha1_Type** google_api_expr_v1alpha1_Type_AbstractType_resize_parameter_types(google_api_expr_v1alpha1_Type_AbstractType *msg, size_t len, upb_arena *arena) {
- return (google_api_expr_v1alpha1_Type**)_upb_array_resize_accessor(msg, UPB_SIZE(8, 16), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct google_api_expr_v1alpha1_Type* google_api_expr_v1alpha1_Type_AbstractType_add_parameter_types(google_api_expr_v1alpha1_Type_AbstractType *msg, upb_arena *arena) {
- struct google_api_expr_v1alpha1_Type* sub = (struct google_api_expr_v1alpha1_Type*)_upb_msg_new(&google_api_expr_v1alpha1_Type_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(8, 16), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-
-/* google.api.expr.v1alpha1.Decl */
-
-UPB_INLINE google_api_expr_v1alpha1_Decl *google_api_expr_v1alpha1_Decl_new(upb_arena *arena) {
- return (google_api_expr_v1alpha1_Decl *)_upb_msg_new(&google_api_expr_v1alpha1_Decl_msginit, arena);
-}
-UPB_INLINE google_api_expr_v1alpha1_Decl *google_api_expr_v1alpha1_Decl_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_api_expr_v1alpha1_Decl *ret = google_api_expr_v1alpha1_Decl_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Decl_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *google_api_expr_v1alpha1_Decl_serialize(const google_api_expr_v1alpha1_Decl *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &google_api_expr_v1alpha1_Decl_msginit, arena, len);
-}
-
-typedef enum {
- google_api_expr_v1alpha1_Decl_decl_kind_ident = 2,
- google_api_expr_v1alpha1_Decl_decl_kind_function = 3,
- google_api_expr_v1alpha1_Decl_decl_kind_NOT_SET = 0
-} google_api_expr_v1alpha1_Decl_decl_kind_oneofcases;
-UPB_INLINE google_api_expr_v1alpha1_Decl_decl_kind_oneofcases google_api_expr_v1alpha1_Decl_decl_kind_case(const google_api_expr_v1alpha1_Decl* msg) { return (google_api_expr_v1alpha1_Decl_decl_kind_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(12, 24), int32_t); }
-
-UPB_INLINE upb_strview google_api_expr_v1alpha1_Decl_name(const google_api_expr_v1alpha1_Decl *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE bool google_api_expr_v1alpha1_Decl_has_ident(const google_api_expr_v1alpha1_Decl *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 2; }
-UPB_INLINE const google_api_expr_v1alpha1_Decl_IdentDecl* google_api_expr_v1alpha1_Decl_ident(const google_api_expr_v1alpha1_Decl *msg) { return UPB_READ_ONEOF(msg, const google_api_expr_v1alpha1_Decl_IdentDecl*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 2, NULL); }
-UPB_INLINE bool google_api_expr_v1alpha1_Decl_has_function(const google_api_expr_v1alpha1_Decl *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 3; }
-UPB_INLINE const google_api_expr_v1alpha1_Decl_FunctionDecl* google_api_expr_v1alpha1_Decl_function(const google_api_expr_v1alpha1_Decl *msg) { return UPB_READ_ONEOF(msg, const google_api_expr_v1alpha1_Decl_FunctionDecl*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 3, NULL); }
-
-UPB_INLINE void google_api_expr_v1alpha1_Decl_set_name(google_api_expr_v1alpha1_Decl *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-UPB_INLINE void google_api_expr_v1alpha1_Decl_set_ident(google_api_expr_v1alpha1_Decl *msg, google_api_expr_v1alpha1_Decl_IdentDecl* value) {
- UPB_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Decl_IdentDecl*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 2);
-}
-UPB_INLINE struct google_api_expr_v1alpha1_Decl_IdentDecl* google_api_expr_v1alpha1_Decl_mutable_ident(google_api_expr_v1alpha1_Decl *msg, upb_arena *arena) {
- struct google_api_expr_v1alpha1_Decl_IdentDecl* sub = (struct google_api_expr_v1alpha1_Decl_IdentDecl*)google_api_expr_v1alpha1_Decl_ident(msg);
- if (sub == NULL) {
- sub = (struct google_api_expr_v1alpha1_Decl_IdentDecl*)_upb_msg_new(&google_api_expr_v1alpha1_Decl_IdentDecl_msginit, arena);
- if (!sub) return NULL;
- google_api_expr_v1alpha1_Decl_set_ident(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void google_api_expr_v1alpha1_Decl_set_function(google_api_expr_v1alpha1_Decl *msg, google_api_expr_v1alpha1_Decl_FunctionDecl* value) {
- UPB_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Decl_FunctionDecl*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 3);
-}
-UPB_INLINE struct google_api_expr_v1alpha1_Decl_FunctionDecl* google_api_expr_v1alpha1_Decl_mutable_function(google_api_expr_v1alpha1_Decl *msg, upb_arena *arena) {
- struct google_api_expr_v1alpha1_Decl_FunctionDecl* sub = (struct google_api_expr_v1alpha1_Decl_FunctionDecl*)google_api_expr_v1alpha1_Decl_function(msg);
- if (sub == NULL) {
- sub = (struct google_api_expr_v1alpha1_Decl_FunctionDecl*)_upb_msg_new(&google_api_expr_v1alpha1_Decl_FunctionDecl_msginit, arena);
- if (!sub) return NULL;
- google_api_expr_v1alpha1_Decl_set_function(msg, sub);
- }
- return sub;
-}
-
-/* google.api.expr.v1alpha1.Decl.IdentDecl */
-
-UPB_INLINE google_api_expr_v1alpha1_Decl_IdentDecl *google_api_expr_v1alpha1_Decl_IdentDecl_new(upb_arena *arena) {
- return (google_api_expr_v1alpha1_Decl_IdentDecl *)_upb_msg_new(&google_api_expr_v1alpha1_Decl_IdentDecl_msginit, arena);
-}
-UPB_INLINE google_api_expr_v1alpha1_Decl_IdentDecl *google_api_expr_v1alpha1_Decl_IdentDecl_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_api_expr_v1alpha1_Decl_IdentDecl *ret = google_api_expr_v1alpha1_Decl_IdentDecl_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Decl_IdentDecl_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *google_api_expr_v1alpha1_Decl_IdentDecl_serialize(const google_api_expr_v1alpha1_Decl_IdentDecl *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &google_api_expr_v1alpha1_Decl_IdentDecl_msginit, arena, len);
-}
-
-UPB_INLINE bool google_api_expr_v1alpha1_Decl_IdentDecl_has_type(const google_api_expr_v1alpha1_Decl_IdentDecl *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const google_api_expr_v1alpha1_Type* google_api_expr_v1alpha1_Decl_IdentDecl_type(const google_api_expr_v1alpha1_Decl_IdentDecl *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const google_api_expr_v1alpha1_Type*); }
-UPB_INLINE bool google_api_expr_v1alpha1_Decl_IdentDecl_has_value(const google_api_expr_v1alpha1_Decl_IdentDecl *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
-UPB_INLINE const struct google_api_expr_v1alpha1_Constant* google_api_expr_v1alpha1_Decl_IdentDecl_value(const google_api_expr_v1alpha1_Decl_IdentDecl *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_api_expr_v1alpha1_Constant*); }
-UPB_INLINE upb_strview google_api_expr_v1alpha1_Decl_IdentDecl_doc(const google_api_expr_v1alpha1_Decl_IdentDecl *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-
-UPB_INLINE void google_api_expr_v1alpha1_Decl_IdentDecl_set_type(google_api_expr_v1alpha1_Decl_IdentDecl *msg, google_api_expr_v1alpha1_Type* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), google_api_expr_v1alpha1_Type*) = value;
-}
-UPB_INLINE struct google_api_expr_v1alpha1_Type* google_api_expr_v1alpha1_Decl_IdentDecl_mutable_type(google_api_expr_v1alpha1_Decl_IdentDecl *msg, upb_arena *arena) {
- struct google_api_expr_v1alpha1_Type* sub = (struct google_api_expr_v1alpha1_Type*)google_api_expr_v1alpha1_Decl_IdentDecl_type(msg);
- if (sub == NULL) {
- sub = (struct google_api_expr_v1alpha1_Type*)_upb_msg_new(&google_api_expr_v1alpha1_Type_msginit, arena);
- if (!sub) return NULL;
- google_api_expr_v1alpha1_Decl_IdentDecl_set_type(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void google_api_expr_v1alpha1_Decl_IdentDecl_set_value(google_api_expr_v1alpha1_Decl_IdentDecl *msg, struct google_api_expr_v1alpha1_Constant* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_api_expr_v1alpha1_Constant*) = value;
-}
-UPB_INLINE struct google_api_expr_v1alpha1_Constant* google_api_expr_v1alpha1_Decl_IdentDecl_mutable_value(google_api_expr_v1alpha1_Decl_IdentDecl *msg, upb_arena *arena) {
- struct google_api_expr_v1alpha1_Constant* sub = (struct google_api_expr_v1alpha1_Constant*)google_api_expr_v1alpha1_Decl_IdentDecl_value(msg);
- if (sub == NULL) {
- sub = (struct google_api_expr_v1alpha1_Constant*)_upb_msg_new(&google_api_expr_v1alpha1_Constant_msginit, arena);
- if (!sub) return NULL;
- google_api_expr_v1alpha1_Decl_IdentDecl_set_value(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void google_api_expr_v1alpha1_Decl_IdentDecl_set_doc(google_api_expr_v1alpha1_Decl_IdentDecl *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-
-/* google.api.expr.v1alpha1.Decl.FunctionDecl */
-
-UPB_INLINE google_api_expr_v1alpha1_Decl_FunctionDecl *google_api_expr_v1alpha1_Decl_FunctionDecl_new(upb_arena *arena) {
- return (google_api_expr_v1alpha1_Decl_FunctionDecl *)_upb_msg_new(&google_api_expr_v1alpha1_Decl_FunctionDecl_msginit, arena);
-}
-UPB_INLINE google_api_expr_v1alpha1_Decl_FunctionDecl *google_api_expr_v1alpha1_Decl_FunctionDecl_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_api_expr_v1alpha1_Decl_FunctionDecl *ret = google_api_expr_v1alpha1_Decl_FunctionDecl_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Decl_FunctionDecl_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *google_api_expr_v1alpha1_Decl_FunctionDecl_serialize(const google_api_expr_v1alpha1_Decl_FunctionDecl *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &google_api_expr_v1alpha1_Decl_FunctionDecl_msginit, arena, len);
-}
-
-UPB_INLINE bool google_api_expr_v1alpha1_Decl_FunctionDecl_has_overloads(const google_api_expr_v1alpha1_Decl_FunctionDecl *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE const google_api_expr_v1alpha1_Decl_FunctionDecl_Overload* const* google_api_expr_v1alpha1_Decl_FunctionDecl_overloads(const google_api_expr_v1alpha1_Decl_FunctionDecl *msg, size_t *len) { return (const google_api_expr_v1alpha1_Decl_FunctionDecl_Overload* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
-
-UPB_INLINE google_api_expr_v1alpha1_Decl_FunctionDecl_Overload** google_api_expr_v1alpha1_Decl_FunctionDecl_mutable_overloads(google_api_expr_v1alpha1_Decl_FunctionDecl *msg, size_t *len) {
- return (google_api_expr_v1alpha1_Decl_FunctionDecl_Overload**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
-}
-UPB_INLINE google_api_expr_v1alpha1_Decl_FunctionDecl_Overload** google_api_expr_v1alpha1_Decl_FunctionDecl_resize_overloads(google_api_expr_v1alpha1_Decl_FunctionDecl *msg, size_t len, upb_arena *arena) {
- return (google_api_expr_v1alpha1_Decl_FunctionDecl_Overload**)_upb_array_resize_accessor(msg, UPB_SIZE(0, 0), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct google_api_expr_v1alpha1_Decl_FunctionDecl_Overload* google_api_expr_v1alpha1_Decl_FunctionDecl_add_overloads(google_api_expr_v1alpha1_Decl_FunctionDecl *msg, upb_arena *arena) {
- struct google_api_expr_v1alpha1_Decl_FunctionDecl_Overload* sub = (struct google_api_expr_v1alpha1_Decl_FunctionDecl_Overload*)_upb_msg_new(&google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(0, 0), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-
-/* google.api.expr.v1alpha1.Decl.FunctionDecl.Overload */
-
-UPB_INLINE google_api_expr_v1alpha1_Decl_FunctionDecl_Overload *google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_new(upb_arena *arena) {
- return (google_api_expr_v1alpha1_Decl_FunctionDecl_Overload *)_upb_msg_new(&google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_msginit, arena);
-}
-UPB_INLINE google_api_expr_v1alpha1_Decl_FunctionDecl_Overload *google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_api_expr_v1alpha1_Decl_FunctionDecl_Overload *ret = google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_serialize(const google_api_expr_v1alpha1_Decl_FunctionDecl_Overload *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_overload_id(const google_api_expr_v1alpha1_Decl_FunctionDecl_Overload *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
-UPB_INLINE bool google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_has_params(const google_api_expr_v1alpha1_Decl_FunctionDecl_Overload *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 48)); }
-UPB_INLINE const google_api_expr_v1alpha1_Type* const* google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_params(const google_api_expr_v1alpha1_Decl_FunctionDecl_Overload *msg, size_t *len) { return (const google_api_expr_v1alpha1_Type* const*)_upb_array_accessor(msg, UPB_SIZE(24, 48), len); }
-UPB_INLINE upb_strview const* google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_type_params(const google_api_expr_v1alpha1_Decl_FunctionDecl_Overload *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(28, 56), len); }
-UPB_INLINE bool google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_has_result_type(const google_api_expr_v1alpha1_Decl_FunctionDecl_Overload *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 40)); }
-UPB_INLINE const google_api_expr_v1alpha1_Type* google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_result_type(const google_api_expr_v1alpha1_Decl_FunctionDecl_Overload *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const google_api_expr_v1alpha1_Type*); }
-UPB_INLINE bool google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_is_instance_function(const google_api_expr_v1alpha1_Decl_FunctionDecl_Overload *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); }
-UPB_INLINE upb_strview google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_doc(const google_api_expr_v1alpha1_Decl_FunctionDecl_Overload *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview); }
-
-UPB_INLINE void google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_set_overload_id(google_api_expr_v1alpha1_Decl_FunctionDecl_Overload *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
-}
-UPB_INLINE google_api_expr_v1alpha1_Type** google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_mutable_params(google_api_expr_v1alpha1_Decl_FunctionDecl_Overload *msg, size_t *len) {
- return (google_api_expr_v1alpha1_Type**)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 48), len);
-}
-UPB_INLINE google_api_expr_v1alpha1_Type** google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_resize_params(google_api_expr_v1alpha1_Decl_FunctionDecl_Overload *msg, size_t len, upb_arena *arena) {
- return (google_api_expr_v1alpha1_Type**)_upb_array_resize_accessor(msg, UPB_SIZE(24, 48), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct google_api_expr_v1alpha1_Type* google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_add_params(google_api_expr_v1alpha1_Decl_FunctionDecl_Overload *msg, upb_arena *arena) {
- struct google_api_expr_v1alpha1_Type* sub = (struct google_api_expr_v1alpha1_Type*)_upb_msg_new(&google_api_expr_v1alpha1_Type_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(24, 48), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-UPB_INLINE upb_strview* google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_mutable_type_params(google_api_expr_v1alpha1_Decl_FunctionDecl_Overload *msg, size_t *len) {
- return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 56), len);
-}
-UPB_INLINE upb_strview* google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_resize_type_params(google_api_expr_v1alpha1_Decl_FunctionDecl_Overload *msg, size_t len, upb_arena *arena) {
- return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(28, 56), len, UPB_TYPE_STRING, arena);
-}
-UPB_INLINE bool google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_add_type_params(google_api_expr_v1alpha1_Decl_FunctionDecl_Overload *msg, upb_strview val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(28, 56), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
- arena);
-}
-UPB_INLINE void google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_set_result_type(google_api_expr_v1alpha1_Decl_FunctionDecl_Overload *msg, google_api_expr_v1alpha1_Type* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(20, 40), google_api_expr_v1alpha1_Type*) = value;
-}
-UPB_INLINE struct google_api_expr_v1alpha1_Type* google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_mutable_result_type(google_api_expr_v1alpha1_Decl_FunctionDecl_Overload *msg, upb_arena *arena) {
- struct google_api_expr_v1alpha1_Type* sub = (struct google_api_expr_v1alpha1_Type*)google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_result_type(msg);
- if (sub == NULL) {
- sub = (struct google_api_expr_v1alpha1_Type*)_upb_msg_new(&google_api_expr_v1alpha1_Type_msginit, arena);
- if (!sub) return NULL;
- google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_set_result_type(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_set_is_instance_function(google_api_expr_v1alpha1_Decl_FunctionDecl_Overload *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
-}
-UPB_INLINE void google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_set_doc(google_api_expr_v1alpha1_Decl_FunctionDecl_Overload *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview) = value;
-}
-
-/* google.api.expr.v1alpha1.Reference */
-
-UPB_INLINE google_api_expr_v1alpha1_Reference *google_api_expr_v1alpha1_Reference_new(upb_arena *arena) {
- return (google_api_expr_v1alpha1_Reference *)_upb_msg_new(&google_api_expr_v1alpha1_Reference_msginit, arena);
-}
-UPB_INLINE google_api_expr_v1alpha1_Reference *google_api_expr_v1alpha1_Reference_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_api_expr_v1alpha1_Reference *ret = google_api_expr_v1alpha1_Reference_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Reference_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *google_api_expr_v1alpha1_Reference_serialize(const google_api_expr_v1alpha1_Reference *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &google_api_expr_v1alpha1_Reference_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview google_api_expr_v1alpha1_Reference_name(const google_api_expr_v1alpha1_Reference *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE upb_strview const* google_api_expr_v1alpha1_Reference_overload_id(const google_api_expr_v1alpha1_Reference *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(12, 24), len); }
-UPB_INLINE bool google_api_expr_v1alpha1_Reference_has_value(const google_api_expr_v1alpha1_Reference *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const struct google_api_expr_v1alpha1_Constant* google_api_expr_v1alpha1_Reference_value(const google_api_expr_v1alpha1_Reference *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_api_expr_v1alpha1_Constant*); }
-
-UPB_INLINE void google_api_expr_v1alpha1_Reference_set_name(google_api_expr_v1alpha1_Reference *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-UPB_INLINE upb_strview* google_api_expr_v1alpha1_Reference_mutable_overload_id(google_api_expr_v1alpha1_Reference *msg, size_t *len) {
- return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 24), len);
-}
-UPB_INLINE upb_strview* google_api_expr_v1alpha1_Reference_resize_overload_id(google_api_expr_v1alpha1_Reference *msg, size_t len, upb_arena *arena) {
- return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(12, 24), len, UPB_TYPE_STRING, arena);
-}
-UPB_INLINE bool google_api_expr_v1alpha1_Reference_add_overload_id(google_api_expr_v1alpha1_Reference *msg, upb_strview val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(12, 24), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
- arena);
-}
-UPB_INLINE void google_api_expr_v1alpha1_Reference_set_value(google_api_expr_v1alpha1_Reference *msg, struct google_api_expr_v1alpha1_Constant* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_api_expr_v1alpha1_Constant*) = value;
-}
-UPB_INLINE struct google_api_expr_v1alpha1_Constant* google_api_expr_v1alpha1_Reference_mutable_value(google_api_expr_v1alpha1_Reference *msg, upb_arena *arena) {
- struct google_api_expr_v1alpha1_Constant* sub = (struct google_api_expr_v1alpha1_Constant*)google_api_expr_v1alpha1_Reference_value(msg);
- if (sub == NULL) {
- sub = (struct google_api_expr_v1alpha1_Constant*)_upb_msg_new(&google_api_expr_v1alpha1_Constant_msginit, arena);
- if (!sub) return NULL;
- google_api_expr_v1alpha1_Reference_set_value(msg, sub);
- }
- return sub;
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* GOOGLE_API_EXPR_V1ALPHA1_CHECKED_PROTO_UPB_H_ */
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * google/api/expr/v1alpha1/checked.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef GOOGLE_API_EXPR_V1ALPHA1_CHECKED_PROTO_UPB_H_
+#define GOOGLE_API_EXPR_V1ALPHA1_CHECKED_PROTO_UPB_H_
+
+#include "upb/msg.h"
+#include "upb/decode.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct google_api_expr_v1alpha1_CheckedExpr;
+struct google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry;
+struct google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry;
+struct google_api_expr_v1alpha1_Type;
+struct google_api_expr_v1alpha1_Type_ListType;
+struct google_api_expr_v1alpha1_Type_MapType;
+struct google_api_expr_v1alpha1_Type_FunctionType;
+struct google_api_expr_v1alpha1_Type_AbstractType;
+struct google_api_expr_v1alpha1_Decl;
+struct google_api_expr_v1alpha1_Decl_IdentDecl;
+struct google_api_expr_v1alpha1_Decl_FunctionDecl;
+struct google_api_expr_v1alpha1_Decl_FunctionDecl_Overload;
+struct google_api_expr_v1alpha1_Reference;
+typedef struct google_api_expr_v1alpha1_CheckedExpr google_api_expr_v1alpha1_CheckedExpr;
+typedef struct google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry;
+typedef struct google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry;
+typedef struct google_api_expr_v1alpha1_Type google_api_expr_v1alpha1_Type;
+typedef struct google_api_expr_v1alpha1_Type_ListType google_api_expr_v1alpha1_Type_ListType;
+typedef struct google_api_expr_v1alpha1_Type_MapType google_api_expr_v1alpha1_Type_MapType;
+typedef struct google_api_expr_v1alpha1_Type_FunctionType google_api_expr_v1alpha1_Type_FunctionType;
+typedef struct google_api_expr_v1alpha1_Type_AbstractType google_api_expr_v1alpha1_Type_AbstractType;
+typedef struct google_api_expr_v1alpha1_Decl google_api_expr_v1alpha1_Decl;
+typedef struct google_api_expr_v1alpha1_Decl_IdentDecl google_api_expr_v1alpha1_Decl_IdentDecl;
+typedef struct google_api_expr_v1alpha1_Decl_FunctionDecl google_api_expr_v1alpha1_Decl_FunctionDecl;
+typedef struct google_api_expr_v1alpha1_Decl_FunctionDecl_Overload google_api_expr_v1alpha1_Decl_FunctionDecl_Overload;
+typedef struct google_api_expr_v1alpha1_Reference google_api_expr_v1alpha1_Reference;
+extern const upb_msglayout google_api_expr_v1alpha1_CheckedExpr_msginit;
+extern const upb_msglayout google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry_msginit;
+extern const upb_msglayout google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry_msginit;
+extern const upb_msglayout google_api_expr_v1alpha1_Type_msginit;
+extern const upb_msglayout google_api_expr_v1alpha1_Type_ListType_msginit;
+extern const upb_msglayout google_api_expr_v1alpha1_Type_MapType_msginit;
+extern const upb_msglayout google_api_expr_v1alpha1_Type_FunctionType_msginit;
+extern const upb_msglayout google_api_expr_v1alpha1_Type_AbstractType_msginit;
+extern const upb_msglayout google_api_expr_v1alpha1_Decl_msginit;
+extern const upb_msglayout google_api_expr_v1alpha1_Decl_IdentDecl_msginit;
+extern const upb_msglayout google_api_expr_v1alpha1_Decl_FunctionDecl_msginit;
+extern const upb_msglayout google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_msginit;
+extern const upb_msglayout google_api_expr_v1alpha1_Reference_msginit;
+struct google_api_expr_v1alpha1_Constant;
+struct google_api_expr_v1alpha1_Expr;
+struct google_api_expr_v1alpha1_SourceInfo;
+struct google_protobuf_Empty;
+extern const upb_msglayout google_api_expr_v1alpha1_Constant_msginit;
+extern const upb_msglayout google_api_expr_v1alpha1_Expr_msginit;
+extern const upb_msglayout google_api_expr_v1alpha1_SourceInfo_msginit;
+extern const upb_msglayout google_protobuf_Empty_msginit;
+
+typedef enum {
+ google_api_expr_v1alpha1_Type_PRIMITIVE_TYPE_UNSPECIFIED = 0,
+ google_api_expr_v1alpha1_Type_BOOL = 1,
+ google_api_expr_v1alpha1_Type_INT64 = 2,
+ google_api_expr_v1alpha1_Type_UINT64 = 3,
+ google_api_expr_v1alpha1_Type_DOUBLE = 4,
+ google_api_expr_v1alpha1_Type_STRING = 5,
+ google_api_expr_v1alpha1_Type_BYTES = 6
+} google_api_expr_v1alpha1_Type_PrimitiveType;
+
+typedef enum {
+ google_api_expr_v1alpha1_Type_WELL_KNOWN_TYPE_UNSPECIFIED = 0,
+ google_api_expr_v1alpha1_Type_ANY = 1,
+ google_api_expr_v1alpha1_Type_TIMESTAMP = 2,
+ google_api_expr_v1alpha1_Type_DURATION = 3
+} google_api_expr_v1alpha1_Type_WellKnownType;
+
+
+/* google.api.expr.v1alpha1.CheckedExpr */
+
+UPB_INLINE google_api_expr_v1alpha1_CheckedExpr *google_api_expr_v1alpha1_CheckedExpr_new(upb_arena *arena) {
+ return (google_api_expr_v1alpha1_CheckedExpr *)_upb_msg_new(&google_api_expr_v1alpha1_CheckedExpr_msginit, arena);
+}
+UPB_INLINE google_api_expr_v1alpha1_CheckedExpr *google_api_expr_v1alpha1_CheckedExpr_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ google_api_expr_v1alpha1_CheckedExpr *ret = google_api_expr_v1alpha1_CheckedExpr_new(arena);
+ return (ret && upb_decode(buf, size, ret, &google_api_expr_v1alpha1_CheckedExpr_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *google_api_expr_v1alpha1_CheckedExpr_serialize(const google_api_expr_v1alpha1_CheckedExpr *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &google_api_expr_v1alpha1_CheckedExpr_msginit, arena, len);
+}
+
+UPB_INLINE bool google_api_expr_v1alpha1_CheckedExpr_has_reference_map(const google_api_expr_v1alpha1_CheckedExpr *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
+UPB_INLINE size_t google_api_expr_v1alpha1_CheckedExpr_reference_map_size(const google_api_expr_v1alpha1_CheckedExpr *msg) {return _upb_msg_map_size(msg, UPB_SIZE(8, 16)); }
+UPB_INLINE bool google_api_expr_v1alpha1_CheckedExpr_reference_map_get(const google_api_expr_v1alpha1_CheckedExpr *msg, int64_t key, google_api_expr_v1alpha1_Reference* *val) { return _upb_msg_map_get(msg, UPB_SIZE(8, 16), &key, sizeof(key), val, sizeof(*val)); }
+UPB_INLINE const google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry* google_api_expr_v1alpha1_CheckedExpr_reference_map_next(const google_api_expr_v1alpha1_CheckedExpr *msg, size_t* iter) { return (const google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry*)_upb_msg_map_next(msg, UPB_SIZE(8, 16), iter); }
+UPB_INLINE bool google_api_expr_v1alpha1_CheckedExpr_has_type_map(const google_api_expr_v1alpha1_CheckedExpr *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
+UPB_INLINE size_t google_api_expr_v1alpha1_CheckedExpr_type_map_size(const google_api_expr_v1alpha1_CheckedExpr *msg) {return _upb_msg_map_size(msg, UPB_SIZE(12, 24)); }
+UPB_INLINE bool google_api_expr_v1alpha1_CheckedExpr_type_map_get(const google_api_expr_v1alpha1_CheckedExpr *msg, int64_t key, google_api_expr_v1alpha1_Type* *val) { return _upb_msg_map_get(msg, UPB_SIZE(12, 24), &key, sizeof(key), val, sizeof(*val)); }
+UPB_INLINE const google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry* google_api_expr_v1alpha1_CheckedExpr_type_map_next(const google_api_expr_v1alpha1_CheckedExpr *msg, size_t* iter) { return (const google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry*)_upb_msg_map_next(msg, UPB_SIZE(12, 24), iter); }
+UPB_INLINE bool google_api_expr_v1alpha1_CheckedExpr_has_expr(const google_api_expr_v1alpha1_CheckedExpr *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE const struct google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_CheckedExpr_expr(const google_api_expr_v1alpha1_CheckedExpr *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const struct google_api_expr_v1alpha1_Expr*); }
+UPB_INLINE bool google_api_expr_v1alpha1_CheckedExpr_has_source_info(const google_api_expr_v1alpha1_CheckedExpr *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
+UPB_INLINE const struct google_api_expr_v1alpha1_SourceInfo* google_api_expr_v1alpha1_CheckedExpr_source_info(const google_api_expr_v1alpha1_CheckedExpr *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_api_expr_v1alpha1_SourceInfo*); }
+
+UPB_INLINE void google_api_expr_v1alpha1_CheckedExpr_reference_map_clear(google_api_expr_v1alpha1_CheckedExpr *msg) { _upb_msg_map_clear(msg, UPB_SIZE(8, 16)); }
+UPB_INLINE bool google_api_expr_v1alpha1_CheckedExpr_reference_map_set(google_api_expr_v1alpha1_CheckedExpr *msg, int64_t key, google_api_expr_v1alpha1_Reference* val, upb_arena *a) { return _upb_msg_map_set(msg, UPB_SIZE(8, 16), &key, sizeof(key), &val, sizeof(val), a); }
+UPB_INLINE bool google_api_expr_v1alpha1_CheckedExpr_reference_map_delete(google_api_expr_v1alpha1_CheckedExpr *msg, int64_t key) { return _upb_msg_map_delete(msg, UPB_SIZE(8, 16), &key, sizeof(key)); }
+UPB_INLINE google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry* google_api_expr_v1alpha1_CheckedExpr_reference_map_nextmutable(google_api_expr_v1alpha1_CheckedExpr *msg, size_t* iter) { return (google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry*)_upb_msg_map_next(msg, UPB_SIZE(8, 16), iter); }
+UPB_INLINE void google_api_expr_v1alpha1_CheckedExpr_type_map_clear(google_api_expr_v1alpha1_CheckedExpr *msg) { _upb_msg_map_clear(msg, UPB_SIZE(12, 24)); }
+UPB_INLINE bool google_api_expr_v1alpha1_CheckedExpr_type_map_set(google_api_expr_v1alpha1_CheckedExpr *msg, int64_t key, google_api_expr_v1alpha1_Type* val, upb_arena *a) { return _upb_msg_map_set(msg, UPB_SIZE(12, 24), &key, sizeof(key), &val, sizeof(val), a); }
+UPB_INLINE bool google_api_expr_v1alpha1_CheckedExpr_type_map_delete(google_api_expr_v1alpha1_CheckedExpr *msg, int64_t key) { return _upb_msg_map_delete(msg, UPB_SIZE(12, 24), &key, sizeof(key)); }
+UPB_INLINE google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry* google_api_expr_v1alpha1_CheckedExpr_type_map_nextmutable(google_api_expr_v1alpha1_CheckedExpr *msg, size_t* iter) { return (google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry*)_upb_msg_map_next(msg, UPB_SIZE(12, 24), iter); }
+UPB_INLINE void google_api_expr_v1alpha1_CheckedExpr_set_expr(google_api_expr_v1alpha1_CheckedExpr *msg, struct google_api_expr_v1alpha1_Expr* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), struct google_api_expr_v1alpha1_Expr*) = value;
+}
+UPB_INLINE struct google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_CheckedExpr_mutable_expr(google_api_expr_v1alpha1_CheckedExpr *msg, upb_arena *arena) {
+ struct google_api_expr_v1alpha1_Expr* sub = (struct google_api_expr_v1alpha1_Expr*)google_api_expr_v1alpha1_CheckedExpr_expr(msg);
+ if (sub == NULL) {
+ sub = (struct google_api_expr_v1alpha1_Expr*)_upb_msg_new(&google_api_expr_v1alpha1_Expr_msginit, arena);
+ if (!sub) return NULL;
+ google_api_expr_v1alpha1_CheckedExpr_set_expr(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void google_api_expr_v1alpha1_CheckedExpr_set_source_info(google_api_expr_v1alpha1_CheckedExpr *msg, struct google_api_expr_v1alpha1_SourceInfo* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_api_expr_v1alpha1_SourceInfo*) = value;
+}
+UPB_INLINE struct google_api_expr_v1alpha1_SourceInfo* google_api_expr_v1alpha1_CheckedExpr_mutable_source_info(google_api_expr_v1alpha1_CheckedExpr *msg, upb_arena *arena) {
+ struct google_api_expr_v1alpha1_SourceInfo* sub = (struct google_api_expr_v1alpha1_SourceInfo*)google_api_expr_v1alpha1_CheckedExpr_source_info(msg);
+ if (sub == NULL) {
+ sub = (struct google_api_expr_v1alpha1_SourceInfo*)_upb_msg_new(&google_api_expr_v1alpha1_SourceInfo_msginit, arena);
+ if (!sub) return NULL;
+ google_api_expr_v1alpha1_CheckedExpr_set_source_info(msg, sub);
+ }
+ return sub;
+}
+
+/* google.api.expr.v1alpha1.CheckedExpr.ReferenceMapEntry */
+
+UPB_INLINE int64_t google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry_key(const google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry *msg) {
+ int64_t ret;
+ _upb_msg_map_key(msg, &ret, sizeof(ret));
+ return ret;
+}
+UPB_INLINE bool google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry_has_value(const google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
+UPB_INLINE const google_api_expr_v1alpha1_Reference* google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry_value(const google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry *msg) {
+ google_api_expr_v1alpha1_Reference* ret;
+ _upb_msg_map_value(msg, &ret, sizeof(ret));
+ return ret;
+}
+
+UPB_INLINE void google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry_set_value(google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry *msg, google_api_expr_v1alpha1_Reference* value) {
+ _upb_msg_map_set_value(msg, &value, sizeof(google_api_expr_v1alpha1_Reference*));
+}
+
+/* google.api.expr.v1alpha1.CheckedExpr.TypeMapEntry */
+
+UPB_INLINE int64_t google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry_key(const google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry *msg) {
+ int64_t ret;
+ _upb_msg_map_key(msg, &ret, sizeof(ret));
+ return ret;
+}
+UPB_INLINE bool google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry_has_value(const google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
+UPB_INLINE const google_api_expr_v1alpha1_Type* google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry_value(const google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry *msg) {
+ google_api_expr_v1alpha1_Type* ret;
+ _upb_msg_map_value(msg, &ret, sizeof(ret));
+ return ret;
+}
+
+UPB_INLINE void google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry_set_value(google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry *msg, google_api_expr_v1alpha1_Type* value) {
+ _upb_msg_map_set_value(msg, &value, sizeof(google_api_expr_v1alpha1_Type*));
+}
+
+/* google.api.expr.v1alpha1.Type */
+
+UPB_INLINE google_api_expr_v1alpha1_Type *google_api_expr_v1alpha1_Type_new(upb_arena *arena) {
+ return (google_api_expr_v1alpha1_Type *)_upb_msg_new(&google_api_expr_v1alpha1_Type_msginit, arena);
+}
+UPB_INLINE google_api_expr_v1alpha1_Type *google_api_expr_v1alpha1_Type_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ google_api_expr_v1alpha1_Type *ret = google_api_expr_v1alpha1_Type_new(arena);
+ return (ret && upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Type_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *google_api_expr_v1alpha1_Type_serialize(const google_api_expr_v1alpha1_Type *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &google_api_expr_v1alpha1_Type_msginit, arena, len);
+}
+
+typedef enum {
+ google_api_expr_v1alpha1_Type_type_kind_dyn = 1,
+ google_api_expr_v1alpha1_Type_type_kind_null = 2,
+ google_api_expr_v1alpha1_Type_type_kind_primitive = 3,
+ google_api_expr_v1alpha1_Type_type_kind_wrapper = 4,
+ google_api_expr_v1alpha1_Type_type_kind_well_known = 5,
+ google_api_expr_v1alpha1_Type_type_kind_list_type = 6,
+ google_api_expr_v1alpha1_Type_type_kind_map_type = 7,
+ google_api_expr_v1alpha1_Type_type_kind_function = 8,
+ google_api_expr_v1alpha1_Type_type_kind_message_type = 9,
+ google_api_expr_v1alpha1_Type_type_kind_type_param = 10,
+ google_api_expr_v1alpha1_Type_type_kind_type = 11,
+ google_api_expr_v1alpha1_Type_type_kind_error = 12,
+ google_api_expr_v1alpha1_Type_type_kind_abstract_type = 14,
+ google_api_expr_v1alpha1_Type_type_kind_NOT_SET = 0
+} google_api_expr_v1alpha1_Type_type_kind_oneofcases;
+UPB_INLINE google_api_expr_v1alpha1_Type_type_kind_oneofcases google_api_expr_v1alpha1_Type_type_kind_case(const google_api_expr_v1alpha1_Type* msg) { return (google_api_expr_v1alpha1_Type_type_kind_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(8, 16), int32_t); }
+
+UPB_INLINE bool google_api_expr_v1alpha1_Type_has_dyn(const google_api_expr_v1alpha1_Type *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 1; }
+UPB_INLINE const struct google_protobuf_Empty* google_api_expr_v1alpha1_Type_dyn(const google_api_expr_v1alpha1_Type *msg) { return UPB_READ_ONEOF(msg, const struct google_protobuf_Empty*, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 1, NULL); }
+UPB_INLINE bool google_api_expr_v1alpha1_Type_has_null(const google_api_expr_v1alpha1_Type *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 2; }
+UPB_INLINE int32_t google_api_expr_v1alpha1_Type_null(const google_api_expr_v1alpha1_Type *msg) { return UPB_READ_ONEOF(msg, int32_t, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 2, 0); }
+UPB_INLINE bool google_api_expr_v1alpha1_Type_has_primitive(const google_api_expr_v1alpha1_Type *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 3; }
+UPB_INLINE int32_t google_api_expr_v1alpha1_Type_primitive(const google_api_expr_v1alpha1_Type *msg) { return UPB_READ_ONEOF(msg, int32_t, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 3, 0); }
+UPB_INLINE bool google_api_expr_v1alpha1_Type_has_wrapper(const google_api_expr_v1alpha1_Type *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 4; }
+UPB_INLINE int32_t google_api_expr_v1alpha1_Type_wrapper(const google_api_expr_v1alpha1_Type *msg) { return UPB_READ_ONEOF(msg, int32_t, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 4, 0); }
+UPB_INLINE bool google_api_expr_v1alpha1_Type_has_well_known(const google_api_expr_v1alpha1_Type *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 5; }
+UPB_INLINE int32_t google_api_expr_v1alpha1_Type_well_known(const google_api_expr_v1alpha1_Type *msg) { return UPB_READ_ONEOF(msg, int32_t, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 5, 0); }
+UPB_INLINE bool google_api_expr_v1alpha1_Type_has_list_type(const google_api_expr_v1alpha1_Type *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 6; }
+UPB_INLINE const google_api_expr_v1alpha1_Type_ListType* google_api_expr_v1alpha1_Type_list_type(const google_api_expr_v1alpha1_Type *msg) { return UPB_READ_ONEOF(msg, const google_api_expr_v1alpha1_Type_ListType*, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 6, NULL); }
+UPB_INLINE bool google_api_expr_v1alpha1_Type_has_map_type(const google_api_expr_v1alpha1_Type *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 7; }
+UPB_INLINE const google_api_expr_v1alpha1_Type_MapType* google_api_expr_v1alpha1_Type_map_type(const google_api_expr_v1alpha1_Type *msg) { return UPB_READ_ONEOF(msg, const google_api_expr_v1alpha1_Type_MapType*, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 7, NULL); }
+UPB_INLINE bool google_api_expr_v1alpha1_Type_has_function(const google_api_expr_v1alpha1_Type *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 8; }
+UPB_INLINE const google_api_expr_v1alpha1_Type_FunctionType* google_api_expr_v1alpha1_Type_function(const google_api_expr_v1alpha1_Type *msg) { return UPB_READ_ONEOF(msg, const google_api_expr_v1alpha1_Type_FunctionType*, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 8, NULL); }
+UPB_INLINE bool google_api_expr_v1alpha1_Type_has_message_type(const google_api_expr_v1alpha1_Type *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 9; }
+UPB_INLINE upb_strview google_api_expr_v1alpha1_Type_message_type(const google_api_expr_v1alpha1_Type *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 9, upb_strview_make("", strlen(""))); }
+UPB_INLINE bool google_api_expr_v1alpha1_Type_has_type_param(const google_api_expr_v1alpha1_Type *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 10; }
+UPB_INLINE upb_strview google_api_expr_v1alpha1_Type_type_param(const google_api_expr_v1alpha1_Type *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 10, upb_strview_make("", strlen(""))); }
+UPB_INLINE bool google_api_expr_v1alpha1_Type_has_type(const google_api_expr_v1alpha1_Type *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 11; }
+UPB_INLINE const google_api_expr_v1alpha1_Type* google_api_expr_v1alpha1_Type_type(const google_api_expr_v1alpha1_Type *msg) { return UPB_READ_ONEOF(msg, const google_api_expr_v1alpha1_Type*, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 11, NULL); }
+UPB_INLINE bool google_api_expr_v1alpha1_Type_has_error(const google_api_expr_v1alpha1_Type *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 12; }
+UPB_INLINE const struct google_protobuf_Empty* google_api_expr_v1alpha1_Type_error(const google_api_expr_v1alpha1_Type *msg) { return UPB_READ_ONEOF(msg, const struct google_protobuf_Empty*, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 12, NULL); }
+UPB_INLINE bool google_api_expr_v1alpha1_Type_has_abstract_type(const google_api_expr_v1alpha1_Type *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 14; }
+UPB_INLINE const google_api_expr_v1alpha1_Type_AbstractType* google_api_expr_v1alpha1_Type_abstract_type(const google_api_expr_v1alpha1_Type *msg) { return UPB_READ_ONEOF(msg, const google_api_expr_v1alpha1_Type_AbstractType*, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 14, NULL); }
+
+UPB_INLINE void google_api_expr_v1alpha1_Type_set_dyn(google_api_expr_v1alpha1_Type *msg, struct google_protobuf_Empty* value) {
+ UPB_WRITE_ONEOF(msg, struct google_protobuf_Empty*, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 1);
+}
+UPB_INLINE struct google_protobuf_Empty* google_api_expr_v1alpha1_Type_mutable_dyn(google_api_expr_v1alpha1_Type *msg, upb_arena *arena) {
+ struct google_protobuf_Empty* sub = (struct google_protobuf_Empty*)google_api_expr_v1alpha1_Type_dyn(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Empty*)_upb_msg_new(&google_protobuf_Empty_msginit, arena);
+ if (!sub) return NULL;
+ google_api_expr_v1alpha1_Type_set_dyn(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void google_api_expr_v1alpha1_Type_set_null(google_api_expr_v1alpha1_Type *msg, int32_t value) {
+ UPB_WRITE_ONEOF(msg, int32_t, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 2);
+}
+UPB_INLINE void google_api_expr_v1alpha1_Type_set_primitive(google_api_expr_v1alpha1_Type *msg, int32_t value) {
+ UPB_WRITE_ONEOF(msg, int32_t, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 3);
+}
+UPB_INLINE void google_api_expr_v1alpha1_Type_set_wrapper(google_api_expr_v1alpha1_Type *msg, int32_t value) {
+ UPB_WRITE_ONEOF(msg, int32_t, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 4);
+}
+UPB_INLINE void google_api_expr_v1alpha1_Type_set_well_known(google_api_expr_v1alpha1_Type *msg, int32_t value) {
+ UPB_WRITE_ONEOF(msg, int32_t, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 5);
+}
+UPB_INLINE void google_api_expr_v1alpha1_Type_set_list_type(google_api_expr_v1alpha1_Type *msg, google_api_expr_v1alpha1_Type_ListType* value) {
+ UPB_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Type_ListType*, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 6);
+}
+UPB_INLINE struct google_api_expr_v1alpha1_Type_ListType* google_api_expr_v1alpha1_Type_mutable_list_type(google_api_expr_v1alpha1_Type *msg, upb_arena *arena) {
+ struct google_api_expr_v1alpha1_Type_ListType* sub = (struct google_api_expr_v1alpha1_Type_ListType*)google_api_expr_v1alpha1_Type_list_type(msg);
+ if (sub == NULL) {
+ sub = (struct google_api_expr_v1alpha1_Type_ListType*)_upb_msg_new(&google_api_expr_v1alpha1_Type_ListType_msginit, arena);
+ if (!sub) return NULL;
+ google_api_expr_v1alpha1_Type_set_list_type(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void google_api_expr_v1alpha1_Type_set_map_type(google_api_expr_v1alpha1_Type *msg, google_api_expr_v1alpha1_Type_MapType* value) {
+ UPB_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Type_MapType*, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 7);
+}
+UPB_INLINE struct google_api_expr_v1alpha1_Type_MapType* google_api_expr_v1alpha1_Type_mutable_map_type(google_api_expr_v1alpha1_Type *msg, upb_arena *arena) {
+ struct google_api_expr_v1alpha1_Type_MapType* sub = (struct google_api_expr_v1alpha1_Type_MapType*)google_api_expr_v1alpha1_Type_map_type(msg);
+ if (sub == NULL) {
+ sub = (struct google_api_expr_v1alpha1_Type_MapType*)_upb_msg_new(&google_api_expr_v1alpha1_Type_MapType_msginit, arena);
+ if (!sub) return NULL;
+ google_api_expr_v1alpha1_Type_set_map_type(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void google_api_expr_v1alpha1_Type_set_function(google_api_expr_v1alpha1_Type *msg, google_api_expr_v1alpha1_Type_FunctionType* value) {
+ UPB_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Type_FunctionType*, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 8);
+}
+UPB_INLINE struct google_api_expr_v1alpha1_Type_FunctionType* google_api_expr_v1alpha1_Type_mutable_function(google_api_expr_v1alpha1_Type *msg, upb_arena *arena) {
+ struct google_api_expr_v1alpha1_Type_FunctionType* sub = (struct google_api_expr_v1alpha1_Type_FunctionType*)google_api_expr_v1alpha1_Type_function(msg);
+ if (sub == NULL) {
+ sub = (struct google_api_expr_v1alpha1_Type_FunctionType*)_upb_msg_new(&google_api_expr_v1alpha1_Type_FunctionType_msginit, arena);
+ if (!sub) return NULL;
+ google_api_expr_v1alpha1_Type_set_function(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void google_api_expr_v1alpha1_Type_set_message_type(google_api_expr_v1alpha1_Type *msg, upb_strview value) {
+ UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 9);
+}
+UPB_INLINE void google_api_expr_v1alpha1_Type_set_type_param(google_api_expr_v1alpha1_Type *msg, upb_strview value) {
+ UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 10);
+}
+UPB_INLINE void google_api_expr_v1alpha1_Type_set_type(google_api_expr_v1alpha1_Type *msg, google_api_expr_v1alpha1_Type* value) {
+ UPB_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Type*, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 11);
+}
+UPB_INLINE struct google_api_expr_v1alpha1_Type* google_api_expr_v1alpha1_Type_mutable_type(google_api_expr_v1alpha1_Type *msg, upb_arena *arena) {
+ struct google_api_expr_v1alpha1_Type* sub = (struct google_api_expr_v1alpha1_Type*)google_api_expr_v1alpha1_Type_type(msg);
+ if (sub == NULL) {
+ sub = (struct google_api_expr_v1alpha1_Type*)_upb_msg_new(&google_api_expr_v1alpha1_Type_msginit, arena);
+ if (!sub) return NULL;
+ google_api_expr_v1alpha1_Type_set_type(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void google_api_expr_v1alpha1_Type_set_error(google_api_expr_v1alpha1_Type *msg, struct google_protobuf_Empty* value) {
+ UPB_WRITE_ONEOF(msg, struct google_protobuf_Empty*, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 12);
+}
+UPB_INLINE struct google_protobuf_Empty* google_api_expr_v1alpha1_Type_mutable_error(google_api_expr_v1alpha1_Type *msg, upb_arena *arena) {
+ struct google_protobuf_Empty* sub = (struct google_protobuf_Empty*)google_api_expr_v1alpha1_Type_error(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Empty*)_upb_msg_new(&google_protobuf_Empty_msginit, arena);
+ if (!sub) return NULL;
+ google_api_expr_v1alpha1_Type_set_error(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void google_api_expr_v1alpha1_Type_set_abstract_type(google_api_expr_v1alpha1_Type *msg, google_api_expr_v1alpha1_Type_AbstractType* value) {
+ UPB_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Type_AbstractType*, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 14);
+}
+UPB_INLINE struct google_api_expr_v1alpha1_Type_AbstractType* google_api_expr_v1alpha1_Type_mutable_abstract_type(google_api_expr_v1alpha1_Type *msg, upb_arena *arena) {
+ struct google_api_expr_v1alpha1_Type_AbstractType* sub = (struct google_api_expr_v1alpha1_Type_AbstractType*)google_api_expr_v1alpha1_Type_abstract_type(msg);
+ if (sub == NULL) {
+ sub = (struct google_api_expr_v1alpha1_Type_AbstractType*)_upb_msg_new(&google_api_expr_v1alpha1_Type_AbstractType_msginit, arena);
+ if (!sub) return NULL;
+ google_api_expr_v1alpha1_Type_set_abstract_type(msg, sub);
+ }
+ return sub;
+}
+
+/* google.api.expr.v1alpha1.Type.ListType */
+
+UPB_INLINE google_api_expr_v1alpha1_Type_ListType *google_api_expr_v1alpha1_Type_ListType_new(upb_arena *arena) {
+ return (google_api_expr_v1alpha1_Type_ListType *)_upb_msg_new(&google_api_expr_v1alpha1_Type_ListType_msginit, arena);
+}
+UPB_INLINE google_api_expr_v1alpha1_Type_ListType *google_api_expr_v1alpha1_Type_ListType_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ google_api_expr_v1alpha1_Type_ListType *ret = google_api_expr_v1alpha1_Type_ListType_new(arena);
+ return (ret && upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Type_ListType_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *google_api_expr_v1alpha1_Type_ListType_serialize(const google_api_expr_v1alpha1_Type_ListType *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &google_api_expr_v1alpha1_Type_ListType_msginit, arena, len);
+}
+
+UPB_INLINE bool google_api_expr_v1alpha1_Type_ListType_has_elem_type(const google_api_expr_v1alpha1_Type_ListType *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE const google_api_expr_v1alpha1_Type* google_api_expr_v1alpha1_Type_ListType_elem_type(const google_api_expr_v1alpha1_Type_ListType *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const google_api_expr_v1alpha1_Type*); }
+
+UPB_INLINE void google_api_expr_v1alpha1_Type_ListType_set_elem_type(google_api_expr_v1alpha1_Type_ListType *msg, google_api_expr_v1alpha1_Type* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), google_api_expr_v1alpha1_Type*) = value;
+}
+UPB_INLINE struct google_api_expr_v1alpha1_Type* google_api_expr_v1alpha1_Type_ListType_mutable_elem_type(google_api_expr_v1alpha1_Type_ListType *msg, upb_arena *arena) {
+ struct google_api_expr_v1alpha1_Type* sub = (struct google_api_expr_v1alpha1_Type*)google_api_expr_v1alpha1_Type_ListType_elem_type(msg);
+ if (sub == NULL) {
+ sub = (struct google_api_expr_v1alpha1_Type*)_upb_msg_new(&google_api_expr_v1alpha1_Type_msginit, arena);
+ if (!sub) return NULL;
+ google_api_expr_v1alpha1_Type_ListType_set_elem_type(msg, sub);
+ }
+ return sub;
+}
+
+/* google.api.expr.v1alpha1.Type.MapType */
+
+UPB_INLINE google_api_expr_v1alpha1_Type_MapType *google_api_expr_v1alpha1_Type_MapType_new(upb_arena *arena) {
+ return (google_api_expr_v1alpha1_Type_MapType *)_upb_msg_new(&google_api_expr_v1alpha1_Type_MapType_msginit, arena);
+}
+UPB_INLINE google_api_expr_v1alpha1_Type_MapType *google_api_expr_v1alpha1_Type_MapType_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ google_api_expr_v1alpha1_Type_MapType *ret = google_api_expr_v1alpha1_Type_MapType_new(arena);
+ return (ret && upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Type_MapType_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *google_api_expr_v1alpha1_Type_MapType_serialize(const google_api_expr_v1alpha1_Type_MapType *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &google_api_expr_v1alpha1_Type_MapType_msginit, arena, len);
+}
+
+UPB_INLINE bool google_api_expr_v1alpha1_Type_MapType_has_key_type(const google_api_expr_v1alpha1_Type_MapType *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE const google_api_expr_v1alpha1_Type* google_api_expr_v1alpha1_Type_MapType_key_type(const google_api_expr_v1alpha1_Type_MapType *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const google_api_expr_v1alpha1_Type*); }
+UPB_INLINE bool google_api_expr_v1alpha1_Type_MapType_has_value_type(const google_api_expr_v1alpha1_Type_MapType *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
+UPB_INLINE const google_api_expr_v1alpha1_Type* google_api_expr_v1alpha1_Type_MapType_value_type(const google_api_expr_v1alpha1_Type_MapType *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const google_api_expr_v1alpha1_Type*); }
+
+UPB_INLINE void google_api_expr_v1alpha1_Type_MapType_set_key_type(google_api_expr_v1alpha1_Type_MapType *msg, google_api_expr_v1alpha1_Type* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), google_api_expr_v1alpha1_Type*) = value;
+}
+UPB_INLINE struct google_api_expr_v1alpha1_Type* google_api_expr_v1alpha1_Type_MapType_mutable_key_type(google_api_expr_v1alpha1_Type_MapType *msg, upb_arena *arena) {
+ struct google_api_expr_v1alpha1_Type* sub = (struct google_api_expr_v1alpha1_Type*)google_api_expr_v1alpha1_Type_MapType_key_type(msg);
+ if (sub == NULL) {
+ sub = (struct google_api_expr_v1alpha1_Type*)_upb_msg_new(&google_api_expr_v1alpha1_Type_msginit, arena);
+ if (!sub) return NULL;
+ google_api_expr_v1alpha1_Type_MapType_set_key_type(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void google_api_expr_v1alpha1_Type_MapType_set_value_type(google_api_expr_v1alpha1_Type_MapType *msg, google_api_expr_v1alpha1_Type* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), google_api_expr_v1alpha1_Type*) = value;
+}
+UPB_INLINE struct google_api_expr_v1alpha1_Type* google_api_expr_v1alpha1_Type_MapType_mutable_value_type(google_api_expr_v1alpha1_Type_MapType *msg, upb_arena *arena) {
+ struct google_api_expr_v1alpha1_Type* sub = (struct google_api_expr_v1alpha1_Type*)google_api_expr_v1alpha1_Type_MapType_value_type(msg);
+ if (sub == NULL) {
+ sub = (struct google_api_expr_v1alpha1_Type*)_upb_msg_new(&google_api_expr_v1alpha1_Type_msginit, arena);
+ if (!sub) return NULL;
+ google_api_expr_v1alpha1_Type_MapType_set_value_type(msg, sub);
+ }
+ return sub;
+}
+
+/* google.api.expr.v1alpha1.Type.FunctionType */
+
+UPB_INLINE google_api_expr_v1alpha1_Type_FunctionType *google_api_expr_v1alpha1_Type_FunctionType_new(upb_arena *arena) {
+ return (google_api_expr_v1alpha1_Type_FunctionType *)_upb_msg_new(&google_api_expr_v1alpha1_Type_FunctionType_msginit, arena);
+}
+UPB_INLINE google_api_expr_v1alpha1_Type_FunctionType *google_api_expr_v1alpha1_Type_FunctionType_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ google_api_expr_v1alpha1_Type_FunctionType *ret = google_api_expr_v1alpha1_Type_FunctionType_new(arena);
+ return (ret && upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Type_FunctionType_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *google_api_expr_v1alpha1_Type_FunctionType_serialize(const google_api_expr_v1alpha1_Type_FunctionType *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &google_api_expr_v1alpha1_Type_FunctionType_msginit, arena, len);
+}
+
+UPB_INLINE bool google_api_expr_v1alpha1_Type_FunctionType_has_result_type(const google_api_expr_v1alpha1_Type_FunctionType *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE const google_api_expr_v1alpha1_Type* google_api_expr_v1alpha1_Type_FunctionType_result_type(const google_api_expr_v1alpha1_Type_FunctionType *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const google_api_expr_v1alpha1_Type*); }
+UPB_INLINE bool google_api_expr_v1alpha1_Type_FunctionType_has_arg_types(const google_api_expr_v1alpha1_Type_FunctionType *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
+UPB_INLINE const google_api_expr_v1alpha1_Type* const* google_api_expr_v1alpha1_Type_FunctionType_arg_types(const google_api_expr_v1alpha1_Type_FunctionType *msg, size_t *len) { return (const google_api_expr_v1alpha1_Type* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len); }
+
+UPB_INLINE void google_api_expr_v1alpha1_Type_FunctionType_set_result_type(google_api_expr_v1alpha1_Type_FunctionType *msg, google_api_expr_v1alpha1_Type* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), google_api_expr_v1alpha1_Type*) = value;
+}
+UPB_INLINE struct google_api_expr_v1alpha1_Type* google_api_expr_v1alpha1_Type_FunctionType_mutable_result_type(google_api_expr_v1alpha1_Type_FunctionType *msg, upb_arena *arena) {
+ struct google_api_expr_v1alpha1_Type* sub = (struct google_api_expr_v1alpha1_Type*)google_api_expr_v1alpha1_Type_FunctionType_result_type(msg);
+ if (sub == NULL) {
+ sub = (struct google_api_expr_v1alpha1_Type*)_upb_msg_new(&google_api_expr_v1alpha1_Type_msginit, arena);
+ if (!sub) return NULL;
+ google_api_expr_v1alpha1_Type_FunctionType_set_result_type(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE google_api_expr_v1alpha1_Type** google_api_expr_v1alpha1_Type_FunctionType_mutable_arg_types(google_api_expr_v1alpha1_Type_FunctionType *msg, size_t *len) {
+ return (google_api_expr_v1alpha1_Type**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len);
+}
+UPB_INLINE google_api_expr_v1alpha1_Type** google_api_expr_v1alpha1_Type_FunctionType_resize_arg_types(google_api_expr_v1alpha1_Type_FunctionType *msg, size_t len, upb_arena *arena) {
+ return (google_api_expr_v1alpha1_Type**)_upb_array_resize_accessor(msg, UPB_SIZE(4, 8), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct google_api_expr_v1alpha1_Type* google_api_expr_v1alpha1_Type_FunctionType_add_arg_types(google_api_expr_v1alpha1_Type_FunctionType *msg, upb_arena *arena) {
+ struct google_api_expr_v1alpha1_Type* sub = (struct google_api_expr_v1alpha1_Type*)_upb_msg_new(&google_api_expr_v1alpha1_Type_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(4, 8), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+
+/* google.api.expr.v1alpha1.Type.AbstractType */
+
+UPB_INLINE google_api_expr_v1alpha1_Type_AbstractType *google_api_expr_v1alpha1_Type_AbstractType_new(upb_arena *arena) {
+ return (google_api_expr_v1alpha1_Type_AbstractType *)_upb_msg_new(&google_api_expr_v1alpha1_Type_AbstractType_msginit, arena);
+}
+UPB_INLINE google_api_expr_v1alpha1_Type_AbstractType *google_api_expr_v1alpha1_Type_AbstractType_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ google_api_expr_v1alpha1_Type_AbstractType *ret = google_api_expr_v1alpha1_Type_AbstractType_new(arena);
+ return (ret && upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Type_AbstractType_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *google_api_expr_v1alpha1_Type_AbstractType_serialize(const google_api_expr_v1alpha1_Type_AbstractType *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &google_api_expr_v1alpha1_Type_AbstractType_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview google_api_expr_v1alpha1_Type_AbstractType_name(const google_api_expr_v1alpha1_Type_AbstractType *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE bool google_api_expr_v1alpha1_Type_AbstractType_has_parameter_types(const google_api_expr_v1alpha1_Type_AbstractType *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
+UPB_INLINE const google_api_expr_v1alpha1_Type* const* google_api_expr_v1alpha1_Type_AbstractType_parameter_types(const google_api_expr_v1alpha1_Type_AbstractType *msg, size_t *len) { return (const google_api_expr_v1alpha1_Type* const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len); }
+
+UPB_INLINE void google_api_expr_v1alpha1_Type_AbstractType_set_name(google_api_expr_v1alpha1_Type_AbstractType *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+UPB_INLINE google_api_expr_v1alpha1_Type** google_api_expr_v1alpha1_Type_AbstractType_mutable_parameter_types(google_api_expr_v1alpha1_Type_AbstractType *msg, size_t *len) {
+ return (google_api_expr_v1alpha1_Type**)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len);
+}
+UPB_INLINE google_api_expr_v1alpha1_Type** google_api_expr_v1alpha1_Type_AbstractType_resize_parameter_types(google_api_expr_v1alpha1_Type_AbstractType *msg, size_t len, upb_arena *arena) {
+ return (google_api_expr_v1alpha1_Type**)_upb_array_resize_accessor(msg, UPB_SIZE(8, 16), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct google_api_expr_v1alpha1_Type* google_api_expr_v1alpha1_Type_AbstractType_add_parameter_types(google_api_expr_v1alpha1_Type_AbstractType *msg, upb_arena *arena) {
+ struct google_api_expr_v1alpha1_Type* sub = (struct google_api_expr_v1alpha1_Type*)_upb_msg_new(&google_api_expr_v1alpha1_Type_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(8, 16), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+
+/* google.api.expr.v1alpha1.Decl */
+
+UPB_INLINE google_api_expr_v1alpha1_Decl *google_api_expr_v1alpha1_Decl_new(upb_arena *arena) {
+ return (google_api_expr_v1alpha1_Decl *)_upb_msg_new(&google_api_expr_v1alpha1_Decl_msginit, arena);
+}
+UPB_INLINE google_api_expr_v1alpha1_Decl *google_api_expr_v1alpha1_Decl_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ google_api_expr_v1alpha1_Decl *ret = google_api_expr_v1alpha1_Decl_new(arena);
+ return (ret && upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Decl_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *google_api_expr_v1alpha1_Decl_serialize(const google_api_expr_v1alpha1_Decl *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &google_api_expr_v1alpha1_Decl_msginit, arena, len);
+}
+
+typedef enum {
+ google_api_expr_v1alpha1_Decl_decl_kind_ident = 2,
+ google_api_expr_v1alpha1_Decl_decl_kind_function = 3,
+ google_api_expr_v1alpha1_Decl_decl_kind_NOT_SET = 0
+} google_api_expr_v1alpha1_Decl_decl_kind_oneofcases;
+UPB_INLINE google_api_expr_v1alpha1_Decl_decl_kind_oneofcases google_api_expr_v1alpha1_Decl_decl_kind_case(const google_api_expr_v1alpha1_Decl* msg) { return (google_api_expr_v1alpha1_Decl_decl_kind_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(12, 24), int32_t); }
+
+UPB_INLINE upb_strview google_api_expr_v1alpha1_Decl_name(const google_api_expr_v1alpha1_Decl *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE bool google_api_expr_v1alpha1_Decl_has_ident(const google_api_expr_v1alpha1_Decl *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 2; }
+UPB_INLINE const google_api_expr_v1alpha1_Decl_IdentDecl* google_api_expr_v1alpha1_Decl_ident(const google_api_expr_v1alpha1_Decl *msg) { return UPB_READ_ONEOF(msg, const google_api_expr_v1alpha1_Decl_IdentDecl*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 2, NULL); }
+UPB_INLINE bool google_api_expr_v1alpha1_Decl_has_function(const google_api_expr_v1alpha1_Decl *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 3; }
+UPB_INLINE const google_api_expr_v1alpha1_Decl_FunctionDecl* google_api_expr_v1alpha1_Decl_function(const google_api_expr_v1alpha1_Decl *msg) { return UPB_READ_ONEOF(msg, const google_api_expr_v1alpha1_Decl_FunctionDecl*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 3, NULL); }
+
+UPB_INLINE void google_api_expr_v1alpha1_Decl_set_name(google_api_expr_v1alpha1_Decl *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+UPB_INLINE void google_api_expr_v1alpha1_Decl_set_ident(google_api_expr_v1alpha1_Decl *msg, google_api_expr_v1alpha1_Decl_IdentDecl* value) {
+ UPB_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Decl_IdentDecl*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 2);
+}
+UPB_INLINE struct google_api_expr_v1alpha1_Decl_IdentDecl* google_api_expr_v1alpha1_Decl_mutable_ident(google_api_expr_v1alpha1_Decl *msg, upb_arena *arena) {
+ struct google_api_expr_v1alpha1_Decl_IdentDecl* sub = (struct google_api_expr_v1alpha1_Decl_IdentDecl*)google_api_expr_v1alpha1_Decl_ident(msg);
+ if (sub == NULL) {
+ sub = (struct google_api_expr_v1alpha1_Decl_IdentDecl*)_upb_msg_new(&google_api_expr_v1alpha1_Decl_IdentDecl_msginit, arena);
+ if (!sub) return NULL;
+ google_api_expr_v1alpha1_Decl_set_ident(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void google_api_expr_v1alpha1_Decl_set_function(google_api_expr_v1alpha1_Decl *msg, google_api_expr_v1alpha1_Decl_FunctionDecl* value) {
+ UPB_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Decl_FunctionDecl*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 3);
+}
+UPB_INLINE struct google_api_expr_v1alpha1_Decl_FunctionDecl* google_api_expr_v1alpha1_Decl_mutable_function(google_api_expr_v1alpha1_Decl *msg, upb_arena *arena) {
+ struct google_api_expr_v1alpha1_Decl_FunctionDecl* sub = (struct google_api_expr_v1alpha1_Decl_FunctionDecl*)google_api_expr_v1alpha1_Decl_function(msg);
+ if (sub == NULL) {
+ sub = (struct google_api_expr_v1alpha1_Decl_FunctionDecl*)_upb_msg_new(&google_api_expr_v1alpha1_Decl_FunctionDecl_msginit, arena);
+ if (!sub) return NULL;
+ google_api_expr_v1alpha1_Decl_set_function(msg, sub);
+ }
+ return sub;
+}
+
+/* google.api.expr.v1alpha1.Decl.IdentDecl */
+
+UPB_INLINE google_api_expr_v1alpha1_Decl_IdentDecl *google_api_expr_v1alpha1_Decl_IdentDecl_new(upb_arena *arena) {
+ return (google_api_expr_v1alpha1_Decl_IdentDecl *)_upb_msg_new(&google_api_expr_v1alpha1_Decl_IdentDecl_msginit, arena);
+}
+UPB_INLINE google_api_expr_v1alpha1_Decl_IdentDecl *google_api_expr_v1alpha1_Decl_IdentDecl_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ google_api_expr_v1alpha1_Decl_IdentDecl *ret = google_api_expr_v1alpha1_Decl_IdentDecl_new(arena);
+ return (ret && upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Decl_IdentDecl_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *google_api_expr_v1alpha1_Decl_IdentDecl_serialize(const google_api_expr_v1alpha1_Decl_IdentDecl *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &google_api_expr_v1alpha1_Decl_IdentDecl_msginit, arena, len);
+}
+
+UPB_INLINE bool google_api_expr_v1alpha1_Decl_IdentDecl_has_type(const google_api_expr_v1alpha1_Decl_IdentDecl *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
+UPB_INLINE const google_api_expr_v1alpha1_Type* google_api_expr_v1alpha1_Decl_IdentDecl_type(const google_api_expr_v1alpha1_Decl_IdentDecl *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const google_api_expr_v1alpha1_Type*); }
+UPB_INLINE bool google_api_expr_v1alpha1_Decl_IdentDecl_has_value(const google_api_expr_v1alpha1_Decl_IdentDecl *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
+UPB_INLINE const struct google_api_expr_v1alpha1_Constant* google_api_expr_v1alpha1_Decl_IdentDecl_value(const google_api_expr_v1alpha1_Decl_IdentDecl *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_api_expr_v1alpha1_Constant*); }
+UPB_INLINE upb_strview google_api_expr_v1alpha1_Decl_IdentDecl_doc(const google_api_expr_v1alpha1_Decl_IdentDecl *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+
+UPB_INLINE void google_api_expr_v1alpha1_Decl_IdentDecl_set_type(google_api_expr_v1alpha1_Decl_IdentDecl *msg, google_api_expr_v1alpha1_Type* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), google_api_expr_v1alpha1_Type*) = value;
+}
+UPB_INLINE struct google_api_expr_v1alpha1_Type* google_api_expr_v1alpha1_Decl_IdentDecl_mutable_type(google_api_expr_v1alpha1_Decl_IdentDecl *msg, upb_arena *arena) {
+ struct google_api_expr_v1alpha1_Type* sub = (struct google_api_expr_v1alpha1_Type*)google_api_expr_v1alpha1_Decl_IdentDecl_type(msg);
+ if (sub == NULL) {
+ sub = (struct google_api_expr_v1alpha1_Type*)_upb_msg_new(&google_api_expr_v1alpha1_Type_msginit, arena);
+ if (!sub) return NULL;
+ google_api_expr_v1alpha1_Decl_IdentDecl_set_type(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void google_api_expr_v1alpha1_Decl_IdentDecl_set_value(google_api_expr_v1alpha1_Decl_IdentDecl *msg, struct google_api_expr_v1alpha1_Constant* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_api_expr_v1alpha1_Constant*) = value;
+}
+UPB_INLINE struct google_api_expr_v1alpha1_Constant* google_api_expr_v1alpha1_Decl_IdentDecl_mutable_value(google_api_expr_v1alpha1_Decl_IdentDecl *msg, upb_arena *arena) {
+ struct google_api_expr_v1alpha1_Constant* sub = (struct google_api_expr_v1alpha1_Constant*)google_api_expr_v1alpha1_Decl_IdentDecl_value(msg);
+ if (sub == NULL) {
+ sub = (struct google_api_expr_v1alpha1_Constant*)_upb_msg_new(&google_api_expr_v1alpha1_Constant_msginit, arena);
+ if (!sub) return NULL;
+ google_api_expr_v1alpha1_Decl_IdentDecl_set_value(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void google_api_expr_v1alpha1_Decl_IdentDecl_set_doc(google_api_expr_v1alpha1_Decl_IdentDecl *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+
+/* google.api.expr.v1alpha1.Decl.FunctionDecl */
+
+UPB_INLINE google_api_expr_v1alpha1_Decl_FunctionDecl *google_api_expr_v1alpha1_Decl_FunctionDecl_new(upb_arena *arena) {
+ return (google_api_expr_v1alpha1_Decl_FunctionDecl *)_upb_msg_new(&google_api_expr_v1alpha1_Decl_FunctionDecl_msginit, arena);
+}
+UPB_INLINE google_api_expr_v1alpha1_Decl_FunctionDecl *google_api_expr_v1alpha1_Decl_FunctionDecl_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ google_api_expr_v1alpha1_Decl_FunctionDecl *ret = google_api_expr_v1alpha1_Decl_FunctionDecl_new(arena);
+ return (ret && upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Decl_FunctionDecl_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *google_api_expr_v1alpha1_Decl_FunctionDecl_serialize(const google_api_expr_v1alpha1_Decl_FunctionDecl *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &google_api_expr_v1alpha1_Decl_FunctionDecl_msginit, arena, len);
+}
+
+UPB_INLINE bool google_api_expr_v1alpha1_Decl_FunctionDecl_has_overloads(const google_api_expr_v1alpha1_Decl_FunctionDecl *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE const google_api_expr_v1alpha1_Decl_FunctionDecl_Overload* const* google_api_expr_v1alpha1_Decl_FunctionDecl_overloads(const google_api_expr_v1alpha1_Decl_FunctionDecl *msg, size_t *len) { return (const google_api_expr_v1alpha1_Decl_FunctionDecl_Overload* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
+
+UPB_INLINE google_api_expr_v1alpha1_Decl_FunctionDecl_Overload** google_api_expr_v1alpha1_Decl_FunctionDecl_mutable_overloads(google_api_expr_v1alpha1_Decl_FunctionDecl *msg, size_t *len) {
+ return (google_api_expr_v1alpha1_Decl_FunctionDecl_Overload**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
+}
+UPB_INLINE google_api_expr_v1alpha1_Decl_FunctionDecl_Overload** google_api_expr_v1alpha1_Decl_FunctionDecl_resize_overloads(google_api_expr_v1alpha1_Decl_FunctionDecl *msg, size_t len, upb_arena *arena) {
+ return (google_api_expr_v1alpha1_Decl_FunctionDecl_Overload**)_upb_array_resize_accessor(msg, UPB_SIZE(0, 0), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct google_api_expr_v1alpha1_Decl_FunctionDecl_Overload* google_api_expr_v1alpha1_Decl_FunctionDecl_add_overloads(google_api_expr_v1alpha1_Decl_FunctionDecl *msg, upb_arena *arena) {
+ struct google_api_expr_v1alpha1_Decl_FunctionDecl_Overload* sub = (struct google_api_expr_v1alpha1_Decl_FunctionDecl_Overload*)_upb_msg_new(&google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(0, 0), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+
+/* google.api.expr.v1alpha1.Decl.FunctionDecl.Overload */
+
+UPB_INLINE google_api_expr_v1alpha1_Decl_FunctionDecl_Overload *google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_new(upb_arena *arena) {
+ return (google_api_expr_v1alpha1_Decl_FunctionDecl_Overload *)_upb_msg_new(&google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_msginit, arena);
+}
+UPB_INLINE google_api_expr_v1alpha1_Decl_FunctionDecl_Overload *google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ google_api_expr_v1alpha1_Decl_FunctionDecl_Overload *ret = google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_new(arena);
+ return (ret && upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_serialize(const google_api_expr_v1alpha1_Decl_FunctionDecl_Overload *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_overload_id(const google_api_expr_v1alpha1_Decl_FunctionDecl_Overload *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
+UPB_INLINE bool google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_has_params(const google_api_expr_v1alpha1_Decl_FunctionDecl_Overload *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 48)); }
+UPB_INLINE const google_api_expr_v1alpha1_Type* const* google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_params(const google_api_expr_v1alpha1_Decl_FunctionDecl_Overload *msg, size_t *len) { return (const google_api_expr_v1alpha1_Type* const*)_upb_array_accessor(msg, UPB_SIZE(24, 48), len); }
+UPB_INLINE upb_strview const* google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_type_params(const google_api_expr_v1alpha1_Decl_FunctionDecl_Overload *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(28, 56), len); }
+UPB_INLINE bool google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_has_result_type(const google_api_expr_v1alpha1_Decl_FunctionDecl_Overload *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 40)); }
+UPB_INLINE const google_api_expr_v1alpha1_Type* google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_result_type(const google_api_expr_v1alpha1_Decl_FunctionDecl_Overload *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const google_api_expr_v1alpha1_Type*); }
+UPB_INLINE bool google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_is_instance_function(const google_api_expr_v1alpha1_Decl_FunctionDecl_Overload *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); }
+UPB_INLINE upb_strview google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_doc(const google_api_expr_v1alpha1_Decl_FunctionDecl_Overload *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview); }
+
+UPB_INLINE void google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_set_overload_id(google_api_expr_v1alpha1_Decl_FunctionDecl_Overload *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
+}
+UPB_INLINE google_api_expr_v1alpha1_Type** google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_mutable_params(google_api_expr_v1alpha1_Decl_FunctionDecl_Overload *msg, size_t *len) {
+ return (google_api_expr_v1alpha1_Type**)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 48), len);
+}
+UPB_INLINE google_api_expr_v1alpha1_Type** google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_resize_params(google_api_expr_v1alpha1_Decl_FunctionDecl_Overload *msg, size_t len, upb_arena *arena) {
+ return (google_api_expr_v1alpha1_Type**)_upb_array_resize_accessor(msg, UPB_SIZE(24, 48), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct google_api_expr_v1alpha1_Type* google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_add_params(google_api_expr_v1alpha1_Decl_FunctionDecl_Overload *msg, upb_arena *arena) {
+ struct google_api_expr_v1alpha1_Type* sub = (struct google_api_expr_v1alpha1_Type*)_upb_msg_new(&google_api_expr_v1alpha1_Type_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(24, 48), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE upb_strview* google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_mutable_type_params(google_api_expr_v1alpha1_Decl_FunctionDecl_Overload *msg, size_t *len) {
+ return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 56), len);
+}
+UPB_INLINE upb_strview* google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_resize_type_params(google_api_expr_v1alpha1_Decl_FunctionDecl_Overload *msg, size_t len, upb_arena *arena) {
+ return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(28, 56), len, UPB_TYPE_STRING, arena);
+}
+UPB_INLINE bool google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_add_type_params(google_api_expr_v1alpha1_Decl_FunctionDecl_Overload *msg, upb_strview val, upb_arena *arena) {
+ return _upb_array_append_accessor(msg, UPB_SIZE(28, 56), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
+ arena);
+}
+UPB_INLINE void google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_set_result_type(google_api_expr_v1alpha1_Decl_FunctionDecl_Overload *msg, google_api_expr_v1alpha1_Type* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 40), google_api_expr_v1alpha1_Type*) = value;
+}
+UPB_INLINE struct google_api_expr_v1alpha1_Type* google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_mutable_result_type(google_api_expr_v1alpha1_Decl_FunctionDecl_Overload *msg, upb_arena *arena) {
+ struct google_api_expr_v1alpha1_Type* sub = (struct google_api_expr_v1alpha1_Type*)google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_result_type(msg);
+ if (sub == NULL) {
+ sub = (struct google_api_expr_v1alpha1_Type*)_upb_msg_new(&google_api_expr_v1alpha1_Type_msginit, arena);
+ if (!sub) return NULL;
+ google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_set_result_type(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_set_is_instance_function(google_api_expr_v1alpha1_Decl_FunctionDecl_Overload *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
+}
+UPB_INLINE void google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_set_doc(google_api_expr_v1alpha1_Decl_FunctionDecl_Overload *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview) = value;
+}
+
+/* google.api.expr.v1alpha1.Reference */
+
+UPB_INLINE google_api_expr_v1alpha1_Reference *google_api_expr_v1alpha1_Reference_new(upb_arena *arena) {
+ return (google_api_expr_v1alpha1_Reference *)_upb_msg_new(&google_api_expr_v1alpha1_Reference_msginit, arena);
+}
+UPB_INLINE google_api_expr_v1alpha1_Reference *google_api_expr_v1alpha1_Reference_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ google_api_expr_v1alpha1_Reference *ret = google_api_expr_v1alpha1_Reference_new(arena);
+ return (ret && upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Reference_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *google_api_expr_v1alpha1_Reference_serialize(const google_api_expr_v1alpha1_Reference *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &google_api_expr_v1alpha1_Reference_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview google_api_expr_v1alpha1_Reference_name(const google_api_expr_v1alpha1_Reference *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE upb_strview const* google_api_expr_v1alpha1_Reference_overload_id(const google_api_expr_v1alpha1_Reference *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(12, 24), len); }
+UPB_INLINE bool google_api_expr_v1alpha1_Reference_has_value(const google_api_expr_v1alpha1_Reference *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
+UPB_INLINE const struct google_api_expr_v1alpha1_Constant* google_api_expr_v1alpha1_Reference_value(const google_api_expr_v1alpha1_Reference *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_api_expr_v1alpha1_Constant*); }
+
+UPB_INLINE void google_api_expr_v1alpha1_Reference_set_name(google_api_expr_v1alpha1_Reference *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+UPB_INLINE upb_strview* google_api_expr_v1alpha1_Reference_mutable_overload_id(google_api_expr_v1alpha1_Reference *msg, size_t *len) {
+ return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 24), len);
+}
+UPB_INLINE upb_strview* google_api_expr_v1alpha1_Reference_resize_overload_id(google_api_expr_v1alpha1_Reference *msg, size_t len, upb_arena *arena) {
+ return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(12, 24), len, UPB_TYPE_STRING, arena);
+}
+UPB_INLINE bool google_api_expr_v1alpha1_Reference_add_overload_id(google_api_expr_v1alpha1_Reference *msg, upb_strview val, upb_arena *arena) {
+ return _upb_array_append_accessor(msg, UPB_SIZE(12, 24), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
+ arena);
+}
+UPB_INLINE void google_api_expr_v1alpha1_Reference_set_value(google_api_expr_v1alpha1_Reference *msg, struct google_api_expr_v1alpha1_Constant* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_api_expr_v1alpha1_Constant*) = value;
+}
+UPB_INLINE struct google_api_expr_v1alpha1_Constant* google_api_expr_v1alpha1_Reference_mutable_value(google_api_expr_v1alpha1_Reference *msg, upb_arena *arena) {
+ struct google_api_expr_v1alpha1_Constant* sub = (struct google_api_expr_v1alpha1_Constant*)google_api_expr_v1alpha1_Reference_value(msg);
+ if (sub == NULL) {
+ sub = (struct google_api_expr_v1alpha1_Constant*)_upb_msg_new(&google_api_expr_v1alpha1_Constant_msginit, arena);
+ if (!sub) return NULL;
+ google_api_expr_v1alpha1_Reference_set_value(msg, sub);
+ }
+ return sub;
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* GOOGLE_API_EXPR_V1ALPHA1_CHECKED_PROTO_UPB_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.c
index 973e1c90cdf..0169d39b4dd 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.c
@@ -1,234 +1,234 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * google/api/expr/v1alpha1/syntax.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include <stddef.h>
-#include "upb/msg.h"
-#include "google/api/expr/v1alpha1/syntax.upb.h"
-#include "google/protobuf/duration.upb.h"
-#include "google/protobuf/struct.upb.h"
-#include "google/protobuf/timestamp.upb.h"
-
-#include "upb/port_def.inc"
-
-static const upb_msglayout *const google_api_expr_v1alpha1_ParsedExpr_submsgs[2] = {
- &google_api_expr_v1alpha1_Expr_msginit,
- &google_api_expr_v1alpha1_SourceInfo_msginit,
-};
-
-static const upb_msglayout_field google_api_expr_v1alpha1_ParsedExpr__fields[2] = {
- {2, UPB_SIZE(0, 0), 0, 0, 11, 1},
- {3, UPB_SIZE(4, 8), 0, 1, 11, 1},
-};
-
-const upb_msglayout google_api_expr_v1alpha1_ParsedExpr_msginit = {
- &google_api_expr_v1alpha1_ParsedExpr_submsgs[0],
- &google_api_expr_v1alpha1_ParsedExpr__fields[0],
- UPB_SIZE(8, 16), 2, false,
-};
-
-static const upb_msglayout *const google_api_expr_v1alpha1_Expr_submsgs[7] = {
- &google_api_expr_v1alpha1_Constant_msginit,
- &google_api_expr_v1alpha1_Expr_Call_msginit,
- &google_api_expr_v1alpha1_Expr_Comprehension_msginit,
- &google_api_expr_v1alpha1_Expr_CreateList_msginit,
- &google_api_expr_v1alpha1_Expr_CreateStruct_msginit,
- &google_api_expr_v1alpha1_Expr_Ident_msginit,
- &google_api_expr_v1alpha1_Expr_Select_msginit,
-};
-
-static const upb_msglayout_field google_api_expr_v1alpha1_Expr__fields[8] = {
- {2, UPB_SIZE(0, 0), 0, 0, 3, 1},
- {3, UPB_SIZE(8, 8), UPB_SIZE(-13, -17), 0, 11, 1},
- {4, UPB_SIZE(8, 8), UPB_SIZE(-13, -17), 5, 11, 1},
- {5, UPB_SIZE(8, 8), UPB_SIZE(-13, -17), 6, 11, 1},
- {6, UPB_SIZE(8, 8), UPB_SIZE(-13, -17), 1, 11, 1},
- {7, UPB_SIZE(8, 8), UPB_SIZE(-13, -17), 3, 11, 1},
- {8, UPB_SIZE(8, 8), UPB_SIZE(-13, -17), 4, 11, 1},
- {9, UPB_SIZE(8, 8), UPB_SIZE(-13, -17), 2, 11, 1},
-};
-
-const upb_msglayout google_api_expr_v1alpha1_Expr_msginit = {
- &google_api_expr_v1alpha1_Expr_submsgs[0],
- &google_api_expr_v1alpha1_Expr__fields[0],
- UPB_SIZE(16, 24), 8, false,
-};
-
-static const upb_msglayout_field google_api_expr_v1alpha1_Expr_Ident__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
-};
-
-const upb_msglayout google_api_expr_v1alpha1_Expr_Ident_msginit = {
- NULL,
- &google_api_expr_v1alpha1_Expr_Ident__fields[0],
- UPB_SIZE(8, 16), 1, false,
-};
-
-static const upb_msglayout *const google_api_expr_v1alpha1_Expr_Select_submsgs[1] = {
- &google_api_expr_v1alpha1_Expr_msginit,
-};
-
-static const upb_msglayout_field google_api_expr_v1alpha1_Expr_Select__fields[3] = {
- {1, UPB_SIZE(12, 24), 0, 0, 11, 1},
- {2, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {3, UPB_SIZE(0, 0), 0, 0, 8, 1},
-};
-
-const upb_msglayout google_api_expr_v1alpha1_Expr_Select_msginit = {
- &google_api_expr_v1alpha1_Expr_Select_submsgs[0],
- &google_api_expr_v1alpha1_Expr_Select__fields[0],
- UPB_SIZE(16, 32), 3, false,
-};
-
-static const upb_msglayout *const google_api_expr_v1alpha1_Expr_Call_submsgs[2] = {
- &google_api_expr_v1alpha1_Expr_msginit,
-};
-
-static const upb_msglayout_field google_api_expr_v1alpha1_Expr_Call__fields[3] = {
- {1, UPB_SIZE(8, 16), 0, 0, 11, 1},
- {2, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {3, UPB_SIZE(12, 24), 0, 0, 11, 3},
-};
-
-const upb_msglayout google_api_expr_v1alpha1_Expr_Call_msginit = {
- &google_api_expr_v1alpha1_Expr_Call_submsgs[0],
- &google_api_expr_v1alpha1_Expr_Call__fields[0],
- UPB_SIZE(16, 32), 3, false,
-};
-
-static const upb_msglayout *const google_api_expr_v1alpha1_Expr_CreateList_submsgs[1] = {
- &google_api_expr_v1alpha1_Expr_msginit,
-};
-
-static const upb_msglayout_field google_api_expr_v1alpha1_Expr_CreateList__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 3},
-};
-
-const upb_msglayout google_api_expr_v1alpha1_Expr_CreateList_msginit = {
- &google_api_expr_v1alpha1_Expr_CreateList_submsgs[0],
- &google_api_expr_v1alpha1_Expr_CreateList__fields[0],
- UPB_SIZE(4, 8), 1, false,
-};
-
-static const upb_msglayout *const google_api_expr_v1alpha1_Expr_CreateStruct_submsgs[1] = {
- &google_api_expr_v1alpha1_Expr_CreateStruct_Entry_msginit,
-};
-
-static const upb_msglayout_field google_api_expr_v1alpha1_Expr_CreateStruct__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 11, 3},
-};
-
-const upb_msglayout google_api_expr_v1alpha1_Expr_CreateStruct_msginit = {
- &google_api_expr_v1alpha1_Expr_CreateStruct_submsgs[0],
- &google_api_expr_v1alpha1_Expr_CreateStruct__fields[0],
- UPB_SIZE(16, 32), 2, false,
-};
-
-static const upb_msglayout *const google_api_expr_v1alpha1_Expr_CreateStruct_Entry_submsgs[2] = {
- &google_api_expr_v1alpha1_Expr_msginit,
-};
-
-static const upb_msglayout_field google_api_expr_v1alpha1_Expr_CreateStruct_Entry__fields[4] = {
- {1, UPB_SIZE(0, 0), 0, 0, 3, 1},
- {2, UPB_SIZE(12, 16), UPB_SIZE(-21, -33), 0, 9, 1},
- {3, UPB_SIZE(12, 16), UPB_SIZE(-21, -33), 0, 11, 1},
- {4, UPB_SIZE(8, 8), 0, 0, 11, 1},
-};
-
-const upb_msglayout google_api_expr_v1alpha1_Expr_CreateStruct_Entry_msginit = {
- &google_api_expr_v1alpha1_Expr_CreateStruct_Entry_submsgs[0],
- &google_api_expr_v1alpha1_Expr_CreateStruct_Entry__fields[0],
- UPB_SIZE(24, 48), 4, false,
-};
-
-static const upb_msglayout *const google_api_expr_v1alpha1_Expr_Comprehension_submsgs[5] = {
- &google_api_expr_v1alpha1_Expr_msginit,
-};
-
-static const upb_msglayout_field google_api_expr_v1alpha1_Expr_Comprehension__fields[7] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(16, 32), 0, 0, 11, 1},
- {3, UPB_SIZE(8, 16), 0, 0, 9, 1},
- {4, UPB_SIZE(20, 40), 0, 0, 11, 1},
- {5, UPB_SIZE(24, 48), 0, 0, 11, 1},
- {6, UPB_SIZE(28, 56), 0, 0, 11, 1},
- {7, UPB_SIZE(32, 64), 0, 0, 11, 1},
-};
-
-const upb_msglayout google_api_expr_v1alpha1_Expr_Comprehension_msginit = {
- &google_api_expr_v1alpha1_Expr_Comprehension_submsgs[0],
- &google_api_expr_v1alpha1_Expr_Comprehension__fields[0],
- UPB_SIZE(40, 80), 7, false,
-};
-
-static const upb_msglayout *const google_api_expr_v1alpha1_Constant_submsgs[2] = {
- &google_protobuf_Duration_msginit,
- &google_protobuf_Timestamp_msginit,
-};
-
-static const upb_msglayout_field google_api_expr_v1alpha1_Constant__fields[9] = {
- {1, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 14, 1},
- {2, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 8, 1},
- {3, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 3, 1},
- {4, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 4, 1},
- {5, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 1, 1},
- {6, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 9, 1},
- {7, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 12, 1},
- {8, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 11, 1},
- {9, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 1, 11, 1},
-};
-
-const upb_msglayout google_api_expr_v1alpha1_Constant_msginit = {
- &google_api_expr_v1alpha1_Constant_submsgs[0],
- &google_api_expr_v1alpha1_Constant__fields[0],
- UPB_SIZE(16, 32), 9, false,
-};
-
-static const upb_msglayout *const google_api_expr_v1alpha1_SourceInfo_submsgs[1] = {
- &google_api_expr_v1alpha1_SourceInfo_PositionsEntry_msginit,
-};
-
-static const upb_msglayout_field google_api_expr_v1alpha1_SourceInfo__fields[4] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 9, 1},
- {3, UPB_SIZE(16, 32), 0, 0, 5, _UPB_LABEL_PACKED},
- {4, UPB_SIZE(20, 40), 0, 0, 11, _UPB_LABEL_MAP},
-};
-
-const upb_msglayout google_api_expr_v1alpha1_SourceInfo_msginit = {
- &google_api_expr_v1alpha1_SourceInfo_submsgs[0],
- &google_api_expr_v1alpha1_SourceInfo__fields[0],
- UPB_SIZE(24, 48), 4, false,
-};
-
-static const upb_msglayout_field google_api_expr_v1alpha1_SourceInfo_PositionsEntry__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 3, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 5, 1},
-};
-
-const upb_msglayout google_api_expr_v1alpha1_SourceInfo_PositionsEntry_msginit = {
- NULL,
- &google_api_expr_v1alpha1_SourceInfo_PositionsEntry__fields[0],
- UPB_SIZE(16, 32), 2, false,
-};
-
-static const upb_msglayout_field google_api_expr_v1alpha1_SourcePosition__fields[4] = {
- {1, UPB_SIZE(12, 16), 0, 0, 9, 1},
- {2, UPB_SIZE(0, 0), 0, 0, 5, 1},
- {3, UPB_SIZE(4, 4), 0, 0, 5, 1},
- {4, UPB_SIZE(8, 8), 0, 0, 5, 1},
-};
-
-const upb_msglayout google_api_expr_v1alpha1_SourcePosition_msginit = {
- NULL,
- &google_api_expr_v1alpha1_SourcePosition__fields[0],
- UPB_SIZE(24, 32), 4, false,
-};
-
-#include "upb/port_undef.inc"
-
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * google/api/expr/v1alpha1/syntax.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg.h"
+#include "google/api/expr/v1alpha1/syntax.upb.h"
+#include "google/protobuf/duration.upb.h"
+#include "google/protobuf/struct.upb.h"
+#include "google/protobuf/timestamp.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_msglayout *const google_api_expr_v1alpha1_ParsedExpr_submsgs[2] = {
+ &google_api_expr_v1alpha1_Expr_msginit,
+ &google_api_expr_v1alpha1_SourceInfo_msginit,
+};
+
+static const upb_msglayout_field google_api_expr_v1alpha1_ParsedExpr__fields[2] = {
+ {2, UPB_SIZE(0, 0), 0, 0, 11, 1},
+ {3, UPB_SIZE(4, 8), 0, 1, 11, 1},
+};
+
+const upb_msglayout google_api_expr_v1alpha1_ParsedExpr_msginit = {
+ &google_api_expr_v1alpha1_ParsedExpr_submsgs[0],
+ &google_api_expr_v1alpha1_ParsedExpr__fields[0],
+ UPB_SIZE(8, 16), 2, false,
+};
+
+static const upb_msglayout *const google_api_expr_v1alpha1_Expr_submsgs[7] = {
+ &google_api_expr_v1alpha1_Constant_msginit,
+ &google_api_expr_v1alpha1_Expr_Call_msginit,
+ &google_api_expr_v1alpha1_Expr_Comprehension_msginit,
+ &google_api_expr_v1alpha1_Expr_CreateList_msginit,
+ &google_api_expr_v1alpha1_Expr_CreateStruct_msginit,
+ &google_api_expr_v1alpha1_Expr_Ident_msginit,
+ &google_api_expr_v1alpha1_Expr_Select_msginit,
+};
+
+static const upb_msglayout_field google_api_expr_v1alpha1_Expr__fields[8] = {
+ {2, UPB_SIZE(0, 0), 0, 0, 3, 1},
+ {3, UPB_SIZE(8, 8), UPB_SIZE(-13, -17), 0, 11, 1},
+ {4, UPB_SIZE(8, 8), UPB_SIZE(-13, -17), 5, 11, 1},
+ {5, UPB_SIZE(8, 8), UPB_SIZE(-13, -17), 6, 11, 1},
+ {6, UPB_SIZE(8, 8), UPB_SIZE(-13, -17), 1, 11, 1},
+ {7, UPB_SIZE(8, 8), UPB_SIZE(-13, -17), 3, 11, 1},
+ {8, UPB_SIZE(8, 8), UPB_SIZE(-13, -17), 4, 11, 1},
+ {9, UPB_SIZE(8, 8), UPB_SIZE(-13, -17), 2, 11, 1},
+};
+
+const upb_msglayout google_api_expr_v1alpha1_Expr_msginit = {
+ &google_api_expr_v1alpha1_Expr_submsgs[0],
+ &google_api_expr_v1alpha1_Expr__fields[0],
+ UPB_SIZE(16, 24), 8, false,
+};
+
+static const upb_msglayout_field google_api_expr_v1alpha1_Expr_Ident__fields[1] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+};
+
+const upb_msglayout google_api_expr_v1alpha1_Expr_Ident_msginit = {
+ NULL,
+ &google_api_expr_v1alpha1_Expr_Ident__fields[0],
+ UPB_SIZE(8, 16), 1, false,
+};
+
+static const upb_msglayout *const google_api_expr_v1alpha1_Expr_Select_submsgs[1] = {
+ &google_api_expr_v1alpha1_Expr_msginit,
+};
+
+static const upb_msglayout_field google_api_expr_v1alpha1_Expr_Select__fields[3] = {
+ {1, UPB_SIZE(12, 24), 0, 0, 11, 1},
+ {2, UPB_SIZE(4, 8), 0, 0, 9, 1},
+ {3, UPB_SIZE(0, 0), 0, 0, 8, 1},
+};
+
+const upb_msglayout google_api_expr_v1alpha1_Expr_Select_msginit = {
+ &google_api_expr_v1alpha1_Expr_Select_submsgs[0],
+ &google_api_expr_v1alpha1_Expr_Select__fields[0],
+ UPB_SIZE(16, 32), 3, false,
+};
+
+static const upb_msglayout *const google_api_expr_v1alpha1_Expr_Call_submsgs[2] = {
+ &google_api_expr_v1alpha1_Expr_msginit,
+};
+
+static const upb_msglayout_field google_api_expr_v1alpha1_Expr_Call__fields[3] = {
+ {1, UPB_SIZE(8, 16), 0, 0, 11, 1},
+ {2, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {3, UPB_SIZE(12, 24), 0, 0, 11, 3},
+};
+
+const upb_msglayout google_api_expr_v1alpha1_Expr_Call_msginit = {
+ &google_api_expr_v1alpha1_Expr_Call_submsgs[0],
+ &google_api_expr_v1alpha1_Expr_Call__fields[0],
+ UPB_SIZE(16, 32), 3, false,
+};
+
+static const upb_msglayout *const google_api_expr_v1alpha1_Expr_CreateList_submsgs[1] = {
+ &google_api_expr_v1alpha1_Expr_msginit,
+};
+
+static const upb_msglayout_field google_api_expr_v1alpha1_Expr_CreateList__fields[1] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 11, 3},
+};
+
+const upb_msglayout google_api_expr_v1alpha1_Expr_CreateList_msginit = {
+ &google_api_expr_v1alpha1_Expr_CreateList_submsgs[0],
+ &google_api_expr_v1alpha1_Expr_CreateList__fields[0],
+ UPB_SIZE(4, 8), 1, false,
+};
+
+static const upb_msglayout *const google_api_expr_v1alpha1_Expr_CreateStruct_submsgs[1] = {
+ &google_api_expr_v1alpha1_Expr_CreateStruct_Entry_msginit,
+};
+
+static const upb_msglayout_field google_api_expr_v1alpha1_Expr_CreateStruct__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {2, UPB_SIZE(8, 16), 0, 0, 11, 3},
+};
+
+const upb_msglayout google_api_expr_v1alpha1_Expr_CreateStruct_msginit = {
+ &google_api_expr_v1alpha1_Expr_CreateStruct_submsgs[0],
+ &google_api_expr_v1alpha1_Expr_CreateStruct__fields[0],
+ UPB_SIZE(16, 32), 2, false,
+};
+
+static const upb_msglayout *const google_api_expr_v1alpha1_Expr_CreateStruct_Entry_submsgs[2] = {
+ &google_api_expr_v1alpha1_Expr_msginit,
+};
+
+static const upb_msglayout_field google_api_expr_v1alpha1_Expr_CreateStruct_Entry__fields[4] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 3, 1},
+ {2, UPB_SIZE(12, 16), UPB_SIZE(-21, -33), 0, 9, 1},
+ {3, UPB_SIZE(12, 16), UPB_SIZE(-21, -33), 0, 11, 1},
+ {4, UPB_SIZE(8, 8), 0, 0, 11, 1},
+};
+
+const upb_msglayout google_api_expr_v1alpha1_Expr_CreateStruct_Entry_msginit = {
+ &google_api_expr_v1alpha1_Expr_CreateStruct_Entry_submsgs[0],
+ &google_api_expr_v1alpha1_Expr_CreateStruct_Entry__fields[0],
+ UPB_SIZE(24, 48), 4, false,
+};
+
+static const upb_msglayout *const google_api_expr_v1alpha1_Expr_Comprehension_submsgs[5] = {
+ &google_api_expr_v1alpha1_Expr_msginit,
+};
+
+static const upb_msglayout_field google_api_expr_v1alpha1_Expr_Comprehension__fields[7] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {2, UPB_SIZE(16, 32), 0, 0, 11, 1},
+ {3, UPB_SIZE(8, 16), 0, 0, 9, 1},
+ {4, UPB_SIZE(20, 40), 0, 0, 11, 1},
+ {5, UPB_SIZE(24, 48), 0, 0, 11, 1},
+ {6, UPB_SIZE(28, 56), 0, 0, 11, 1},
+ {7, UPB_SIZE(32, 64), 0, 0, 11, 1},
+};
+
+const upb_msglayout google_api_expr_v1alpha1_Expr_Comprehension_msginit = {
+ &google_api_expr_v1alpha1_Expr_Comprehension_submsgs[0],
+ &google_api_expr_v1alpha1_Expr_Comprehension__fields[0],
+ UPB_SIZE(40, 80), 7, false,
+};
+
+static const upb_msglayout *const google_api_expr_v1alpha1_Constant_submsgs[2] = {
+ &google_protobuf_Duration_msginit,
+ &google_protobuf_Timestamp_msginit,
+};
+
+static const upb_msglayout_field google_api_expr_v1alpha1_Constant__fields[9] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 14, 1},
+ {2, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 8, 1},
+ {3, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 3, 1},
+ {4, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 4, 1},
+ {5, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 1, 1},
+ {6, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 9, 1},
+ {7, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 12, 1},
+ {8, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 11, 1},
+ {9, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 1, 11, 1},
+};
+
+const upb_msglayout google_api_expr_v1alpha1_Constant_msginit = {
+ &google_api_expr_v1alpha1_Constant_submsgs[0],
+ &google_api_expr_v1alpha1_Constant__fields[0],
+ UPB_SIZE(16, 32), 9, false,
+};
+
+static const upb_msglayout *const google_api_expr_v1alpha1_SourceInfo_submsgs[1] = {
+ &google_api_expr_v1alpha1_SourceInfo_PositionsEntry_msginit,
+};
+
+static const upb_msglayout_field google_api_expr_v1alpha1_SourceInfo__fields[4] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {2, UPB_SIZE(8, 16), 0, 0, 9, 1},
+ {3, UPB_SIZE(16, 32), 0, 0, 5, _UPB_LABEL_PACKED},
+ {4, UPB_SIZE(20, 40), 0, 0, 11, _UPB_LABEL_MAP},
+};
+
+const upb_msglayout google_api_expr_v1alpha1_SourceInfo_msginit = {
+ &google_api_expr_v1alpha1_SourceInfo_submsgs[0],
+ &google_api_expr_v1alpha1_SourceInfo__fields[0],
+ UPB_SIZE(24, 48), 4, false,
+};
+
+static const upb_msglayout_field google_api_expr_v1alpha1_SourceInfo_PositionsEntry__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 3, 1},
+ {2, UPB_SIZE(8, 16), 0, 0, 5, 1},
+};
+
+const upb_msglayout google_api_expr_v1alpha1_SourceInfo_PositionsEntry_msginit = {
+ NULL,
+ &google_api_expr_v1alpha1_SourceInfo_PositionsEntry__fields[0],
+ UPB_SIZE(16, 32), 2, false,
+};
+
+static const upb_msglayout_field google_api_expr_v1alpha1_SourcePosition__fields[4] = {
+ {1, UPB_SIZE(12, 16), 0, 0, 9, 1},
+ {2, UPB_SIZE(0, 0), 0, 0, 5, 1},
+ {3, UPB_SIZE(4, 4), 0, 0, 5, 1},
+ {4, UPB_SIZE(8, 8), 0, 0, 5, 1},
+};
+
+const upb_msglayout google_api_expr_v1alpha1_SourcePosition_msginit = {
+ NULL,
+ &google_api_expr_v1alpha1_SourcePosition__fields[0],
+ UPB_SIZE(24, 32), 4, false,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.h
index 227248ea3d8..6c4b7f81eb1 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.h
@@ -1,759 +1,759 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * google/api/expr/v1alpha1/syntax.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef GOOGLE_API_EXPR_V1ALPHA1_SYNTAX_PROTO_UPB_H_
-#define GOOGLE_API_EXPR_V1ALPHA1_SYNTAX_PROTO_UPB_H_
-
-#include "upb/msg.h"
-#include "upb/decode.h"
-#include "upb/encode.h"
-
-#include "upb/port_def.inc"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct google_api_expr_v1alpha1_ParsedExpr;
-struct google_api_expr_v1alpha1_Expr;
-struct google_api_expr_v1alpha1_Expr_Ident;
-struct google_api_expr_v1alpha1_Expr_Select;
-struct google_api_expr_v1alpha1_Expr_Call;
-struct google_api_expr_v1alpha1_Expr_CreateList;
-struct google_api_expr_v1alpha1_Expr_CreateStruct;
-struct google_api_expr_v1alpha1_Expr_CreateStruct_Entry;
-struct google_api_expr_v1alpha1_Expr_Comprehension;
-struct google_api_expr_v1alpha1_Constant;
-struct google_api_expr_v1alpha1_SourceInfo;
-struct google_api_expr_v1alpha1_SourceInfo_PositionsEntry;
-struct google_api_expr_v1alpha1_SourcePosition;
-typedef struct google_api_expr_v1alpha1_ParsedExpr google_api_expr_v1alpha1_ParsedExpr;
-typedef struct google_api_expr_v1alpha1_Expr google_api_expr_v1alpha1_Expr;
-typedef struct google_api_expr_v1alpha1_Expr_Ident google_api_expr_v1alpha1_Expr_Ident;
-typedef struct google_api_expr_v1alpha1_Expr_Select google_api_expr_v1alpha1_Expr_Select;
-typedef struct google_api_expr_v1alpha1_Expr_Call google_api_expr_v1alpha1_Expr_Call;
-typedef struct google_api_expr_v1alpha1_Expr_CreateList google_api_expr_v1alpha1_Expr_CreateList;
-typedef struct google_api_expr_v1alpha1_Expr_CreateStruct google_api_expr_v1alpha1_Expr_CreateStruct;
-typedef struct google_api_expr_v1alpha1_Expr_CreateStruct_Entry google_api_expr_v1alpha1_Expr_CreateStruct_Entry;
-typedef struct google_api_expr_v1alpha1_Expr_Comprehension google_api_expr_v1alpha1_Expr_Comprehension;
-typedef struct google_api_expr_v1alpha1_Constant google_api_expr_v1alpha1_Constant;
-typedef struct google_api_expr_v1alpha1_SourceInfo google_api_expr_v1alpha1_SourceInfo;
-typedef struct google_api_expr_v1alpha1_SourceInfo_PositionsEntry google_api_expr_v1alpha1_SourceInfo_PositionsEntry;
-typedef struct google_api_expr_v1alpha1_SourcePosition google_api_expr_v1alpha1_SourcePosition;
-extern const upb_msglayout google_api_expr_v1alpha1_ParsedExpr_msginit;
-extern const upb_msglayout google_api_expr_v1alpha1_Expr_msginit;
-extern const upb_msglayout google_api_expr_v1alpha1_Expr_Ident_msginit;
-extern const upb_msglayout google_api_expr_v1alpha1_Expr_Select_msginit;
-extern const upb_msglayout google_api_expr_v1alpha1_Expr_Call_msginit;
-extern const upb_msglayout google_api_expr_v1alpha1_Expr_CreateList_msginit;
-extern const upb_msglayout google_api_expr_v1alpha1_Expr_CreateStruct_msginit;
-extern const upb_msglayout google_api_expr_v1alpha1_Expr_CreateStruct_Entry_msginit;
-extern const upb_msglayout google_api_expr_v1alpha1_Expr_Comprehension_msginit;
-extern const upb_msglayout google_api_expr_v1alpha1_Constant_msginit;
-extern const upb_msglayout google_api_expr_v1alpha1_SourceInfo_msginit;
-extern const upb_msglayout google_api_expr_v1alpha1_SourceInfo_PositionsEntry_msginit;
-extern const upb_msglayout google_api_expr_v1alpha1_SourcePosition_msginit;
-struct google_protobuf_Duration;
-struct google_protobuf_Timestamp;
-extern const upb_msglayout google_protobuf_Duration_msginit;
-extern const upb_msglayout google_protobuf_Timestamp_msginit;
-
-
-/* google.api.expr.v1alpha1.ParsedExpr */
-
-UPB_INLINE google_api_expr_v1alpha1_ParsedExpr *google_api_expr_v1alpha1_ParsedExpr_new(upb_arena *arena) {
- return (google_api_expr_v1alpha1_ParsedExpr *)_upb_msg_new(&google_api_expr_v1alpha1_ParsedExpr_msginit, arena);
-}
-UPB_INLINE google_api_expr_v1alpha1_ParsedExpr *google_api_expr_v1alpha1_ParsedExpr_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_api_expr_v1alpha1_ParsedExpr *ret = google_api_expr_v1alpha1_ParsedExpr_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_api_expr_v1alpha1_ParsedExpr_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *google_api_expr_v1alpha1_ParsedExpr_serialize(const google_api_expr_v1alpha1_ParsedExpr *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &google_api_expr_v1alpha1_ParsedExpr_msginit, arena, len);
-}
-
-UPB_INLINE bool google_api_expr_v1alpha1_ParsedExpr_has_expr(const google_api_expr_v1alpha1_ParsedExpr *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE const google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_ParsedExpr_expr(const google_api_expr_v1alpha1_ParsedExpr *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const google_api_expr_v1alpha1_Expr*); }
-UPB_INLINE bool google_api_expr_v1alpha1_ParsedExpr_has_source_info(const google_api_expr_v1alpha1_ParsedExpr *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
-UPB_INLINE const google_api_expr_v1alpha1_SourceInfo* google_api_expr_v1alpha1_ParsedExpr_source_info(const google_api_expr_v1alpha1_ParsedExpr *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const google_api_expr_v1alpha1_SourceInfo*); }
-
-UPB_INLINE void google_api_expr_v1alpha1_ParsedExpr_set_expr(google_api_expr_v1alpha1_ParsedExpr *msg, google_api_expr_v1alpha1_Expr* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), google_api_expr_v1alpha1_Expr*) = value;
-}
-UPB_INLINE struct google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_ParsedExpr_mutable_expr(google_api_expr_v1alpha1_ParsedExpr *msg, upb_arena *arena) {
- struct google_api_expr_v1alpha1_Expr* sub = (struct google_api_expr_v1alpha1_Expr*)google_api_expr_v1alpha1_ParsedExpr_expr(msg);
- if (sub == NULL) {
- sub = (struct google_api_expr_v1alpha1_Expr*)_upb_msg_new(&google_api_expr_v1alpha1_Expr_msginit, arena);
- if (!sub) return NULL;
- google_api_expr_v1alpha1_ParsedExpr_set_expr(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void google_api_expr_v1alpha1_ParsedExpr_set_source_info(google_api_expr_v1alpha1_ParsedExpr *msg, google_api_expr_v1alpha1_SourceInfo* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), google_api_expr_v1alpha1_SourceInfo*) = value;
-}
-UPB_INLINE struct google_api_expr_v1alpha1_SourceInfo* google_api_expr_v1alpha1_ParsedExpr_mutable_source_info(google_api_expr_v1alpha1_ParsedExpr *msg, upb_arena *arena) {
- struct google_api_expr_v1alpha1_SourceInfo* sub = (struct google_api_expr_v1alpha1_SourceInfo*)google_api_expr_v1alpha1_ParsedExpr_source_info(msg);
- if (sub == NULL) {
- sub = (struct google_api_expr_v1alpha1_SourceInfo*)_upb_msg_new(&google_api_expr_v1alpha1_SourceInfo_msginit, arena);
- if (!sub) return NULL;
- google_api_expr_v1alpha1_ParsedExpr_set_source_info(msg, sub);
- }
- return sub;
-}
-
-/* google.api.expr.v1alpha1.Expr */
-
-UPB_INLINE google_api_expr_v1alpha1_Expr *google_api_expr_v1alpha1_Expr_new(upb_arena *arena) {
- return (google_api_expr_v1alpha1_Expr *)_upb_msg_new(&google_api_expr_v1alpha1_Expr_msginit, arena);
-}
-UPB_INLINE google_api_expr_v1alpha1_Expr *google_api_expr_v1alpha1_Expr_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_api_expr_v1alpha1_Expr *ret = google_api_expr_v1alpha1_Expr_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *google_api_expr_v1alpha1_Expr_serialize(const google_api_expr_v1alpha1_Expr *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &google_api_expr_v1alpha1_Expr_msginit, arena, len);
-}
-
-typedef enum {
- google_api_expr_v1alpha1_Expr_expr_kind_const_expr = 3,
- google_api_expr_v1alpha1_Expr_expr_kind_ident_expr = 4,
- google_api_expr_v1alpha1_Expr_expr_kind_select_expr = 5,
- google_api_expr_v1alpha1_Expr_expr_kind_call_expr = 6,
- google_api_expr_v1alpha1_Expr_expr_kind_list_expr = 7,
- google_api_expr_v1alpha1_Expr_expr_kind_struct_expr = 8,
- google_api_expr_v1alpha1_Expr_expr_kind_comprehension_expr = 9,
- google_api_expr_v1alpha1_Expr_expr_kind_NOT_SET = 0
-} google_api_expr_v1alpha1_Expr_expr_kind_oneofcases;
-UPB_INLINE google_api_expr_v1alpha1_Expr_expr_kind_oneofcases google_api_expr_v1alpha1_Expr_expr_kind_case(const google_api_expr_v1alpha1_Expr* msg) { return (google_api_expr_v1alpha1_Expr_expr_kind_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(12, 16), int32_t); }
-
-UPB_INLINE int64_t google_api_expr_v1alpha1_Expr_id(const google_api_expr_v1alpha1_Expr *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int64_t); }
-UPB_INLINE bool google_api_expr_v1alpha1_Expr_has_const_expr(const google_api_expr_v1alpha1_Expr *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 16)) == 3; }
-UPB_INLINE const google_api_expr_v1alpha1_Constant* google_api_expr_v1alpha1_Expr_const_expr(const google_api_expr_v1alpha1_Expr *msg) { return UPB_READ_ONEOF(msg, const google_api_expr_v1alpha1_Constant*, UPB_SIZE(8, 8), UPB_SIZE(12, 16), 3, NULL); }
-UPB_INLINE bool google_api_expr_v1alpha1_Expr_has_ident_expr(const google_api_expr_v1alpha1_Expr *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 16)) == 4; }
-UPB_INLINE const google_api_expr_v1alpha1_Expr_Ident* google_api_expr_v1alpha1_Expr_ident_expr(const google_api_expr_v1alpha1_Expr *msg) { return UPB_READ_ONEOF(msg, const google_api_expr_v1alpha1_Expr_Ident*, UPB_SIZE(8, 8), UPB_SIZE(12, 16), 4, NULL); }
-UPB_INLINE bool google_api_expr_v1alpha1_Expr_has_select_expr(const google_api_expr_v1alpha1_Expr *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 16)) == 5; }
-UPB_INLINE const google_api_expr_v1alpha1_Expr_Select* google_api_expr_v1alpha1_Expr_select_expr(const google_api_expr_v1alpha1_Expr *msg) { return UPB_READ_ONEOF(msg, const google_api_expr_v1alpha1_Expr_Select*, UPB_SIZE(8, 8), UPB_SIZE(12, 16), 5, NULL); }
-UPB_INLINE bool google_api_expr_v1alpha1_Expr_has_call_expr(const google_api_expr_v1alpha1_Expr *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 16)) == 6; }
-UPB_INLINE const google_api_expr_v1alpha1_Expr_Call* google_api_expr_v1alpha1_Expr_call_expr(const google_api_expr_v1alpha1_Expr *msg) { return UPB_READ_ONEOF(msg, const google_api_expr_v1alpha1_Expr_Call*, UPB_SIZE(8, 8), UPB_SIZE(12, 16), 6, NULL); }
-UPB_INLINE bool google_api_expr_v1alpha1_Expr_has_list_expr(const google_api_expr_v1alpha1_Expr *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 16)) == 7; }
-UPB_INLINE const google_api_expr_v1alpha1_Expr_CreateList* google_api_expr_v1alpha1_Expr_list_expr(const google_api_expr_v1alpha1_Expr *msg) { return UPB_READ_ONEOF(msg, const google_api_expr_v1alpha1_Expr_CreateList*, UPB_SIZE(8, 8), UPB_SIZE(12, 16), 7, NULL); }
-UPB_INLINE bool google_api_expr_v1alpha1_Expr_has_struct_expr(const google_api_expr_v1alpha1_Expr *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 16)) == 8; }
-UPB_INLINE const google_api_expr_v1alpha1_Expr_CreateStruct* google_api_expr_v1alpha1_Expr_struct_expr(const google_api_expr_v1alpha1_Expr *msg) { return UPB_READ_ONEOF(msg, const google_api_expr_v1alpha1_Expr_CreateStruct*, UPB_SIZE(8, 8), UPB_SIZE(12, 16), 8, NULL); }
-UPB_INLINE bool google_api_expr_v1alpha1_Expr_has_comprehension_expr(const google_api_expr_v1alpha1_Expr *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 16)) == 9; }
-UPB_INLINE const google_api_expr_v1alpha1_Expr_Comprehension* google_api_expr_v1alpha1_Expr_comprehension_expr(const google_api_expr_v1alpha1_Expr *msg) { return UPB_READ_ONEOF(msg, const google_api_expr_v1alpha1_Expr_Comprehension*, UPB_SIZE(8, 8), UPB_SIZE(12, 16), 9, NULL); }
-
-UPB_INLINE void google_api_expr_v1alpha1_Expr_set_id(google_api_expr_v1alpha1_Expr *msg, int64_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int64_t) = value;
-}
-UPB_INLINE void google_api_expr_v1alpha1_Expr_set_const_expr(google_api_expr_v1alpha1_Expr *msg, google_api_expr_v1alpha1_Constant* value) {
- UPB_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Constant*, UPB_SIZE(8, 8), value, UPB_SIZE(12, 16), 3);
-}
-UPB_INLINE struct google_api_expr_v1alpha1_Constant* google_api_expr_v1alpha1_Expr_mutable_const_expr(google_api_expr_v1alpha1_Expr *msg, upb_arena *arena) {
- struct google_api_expr_v1alpha1_Constant* sub = (struct google_api_expr_v1alpha1_Constant*)google_api_expr_v1alpha1_Expr_const_expr(msg);
- if (sub == NULL) {
- sub = (struct google_api_expr_v1alpha1_Constant*)_upb_msg_new(&google_api_expr_v1alpha1_Constant_msginit, arena);
- if (!sub) return NULL;
- google_api_expr_v1alpha1_Expr_set_const_expr(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void google_api_expr_v1alpha1_Expr_set_ident_expr(google_api_expr_v1alpha1_Expr *msg, google_api_expr_v1alpha1_Expr_Ident* value) {
- UPB_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Expr_Ident*, UPB_SIZE(8, 8), value, UPB_SIZE(12, 16), 4);
-}
-UPB_INLINE struct google_api_expr_v1alpha1_Expr_Ident* google_api_expr_v1alpha1_Expr_mutable_ident_expr(google_api_expr_v1alpha1_Expr *msg, upb_arena *arena) {
- struct google_api_expr_v1alpha1_Expr_Ident* sub = (struct google_api_expr_v1alpha1_Expr_Ident*)google_api_expr_v1alpha1_Expr_ident_expr(msg);
- if (sub == NULL) {
- sub = (struct google_api_expr_v1alpha1_Expr_Ident*)_upb_msg_new(&google_api_expr_v1alpha1_Expr_Ident_msginit, arena);
- if (!sub) return NULL;
- google_api_expr_v1alpha1_Expr_set_ident_expr(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void google_api_expr_v1alpha1_Expr_set_select_expr(google_api_expr_v1alpha1_Expr *msg, google_api_expr_v1alpha1_Expr_Select* value) {
- UPB_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Expr_Select*, UPB_SIZE(8, 8), value, UPB_SIZE(12, 16), 5);
-}
-UPB_INLINE struct google_api_expr_v1alpha1_Expr_Select* google_api_expr_v1alpha1_Expr_mutable_select_expr(google_api_expr_v1alpha1_Expr *msg, upb_arena *arena) {
- struct google_api_expr_v1alpha1_Expr_Select* sub = (struct google_api_expr_v1alpha1_Expr_Select*)google_api_expr_v1alpha1_Expr_select_expr(msg);
- if (sub == NULL) {
- sub = (struct google_api_expr_v1alpha1_Expr_Select*)_upb_msg_new(&google_api_expr_v1alpha1_Expr_Select_msginit, arena);
- if (!sub) return NULL;
- google_api_expr_v1alpha1_Expr_set_select_expr(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void google_api_expr_v1alpha1_Expr_set_call_expr(google_api_expr_v1alpha1_Expr *msg, google_api_expr_v1alpha1_Expr_Call* value) {
- UPB_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Expr_Call*, UPB_SIZE(8, 8), value, UPB_SIZE(12, 16), 6);
-}
-UPB_INLINE struct google_api_expr_v1alpha1_Expr_Call* google_api_expr_v1alpha1_Expr_mutable_call_expr(google_api_expr_v1alpha1_Expr *msg, upb_arena *arena) {
- struct google_api_expr_v1alpha1_Expr_Call* sub = (struct google_api_expr_v1alpha1_Expr_Call*)google_api_expr_v1alpha1_Expr_call_expr(msg);
- if (sub == NULL) {
- sub = (struct google_api_expr_v1alpha1_Expr_Call*)_upb_msg_new(&google_api_expr_v1alpha1_Expr_Call_msginit, arena);
- if (!sub) return NULL;
- google_api_expr_v1alpha1_Expr_set_call_expr(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void google_api_expr_v1alpha1_Expr_set_list_expr(google_api_expr_v1alpha1_Expr *msg, google_api_expr_v1alpha1_Expr_CreateList* value) {
- UPB_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Expr_CreateList*, UPB_SIZE(8, 8), value, UPB_SIZE(12, 16), 7);
-}
-UPB_INLINE struct google_api_expr_v1alpha1_Expr_CreateList* google_api_expr_v1alpha1_Expr_mutable_list_expr(google_api_expr_v1alpha1_Expr *msg, upb_arena *arena) {
- struct google_api_expr_v1alpha1_Expr_CreateList* sub = (struct google_api_expr_v1alpha1_Expr_CreateList*)google_api_expr_v1alpha1_Expr_list_expr(msg);
- if (sub == NULL) {
- sub = (struct google_api_expr_v1alpha1_Expr_CreateList*)_upb_msg_new(&google_api_expr_v1alpha1_Expr_CreateList_msginit, arena);
- if (!sub) return NULL;
- google_api_expr_v1alpha1_Expr_set_list_expr(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void google_api_expr_v1alpha1_Expr_set_struct_expr(google_api_expr_v1alpha1_Expr *msg, google_api_expr_v1alpha1_Expr_CreateStruct* value) {
- UPB_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Expr_CreateStruct*, UPB_SIZE(8, 8), value, UPB_SIZE(12, 16), 8);
-}
-UPB_INLINE struct google_api_expr_v1alpha1_Expr_CreateStruct* google_api_expr_v1alpha1_Expr_mutable_struct_expr(google_api_expr_v1alpha1_Expr *msg, upb_arena *arena) {
- struct google_api_expr_v1alpha1_Expr_CreateStruct* sub = (struct google_api_expr_v1alpha1_Expr_CreateStruct*)google_api_expr_v1alpha1_Expr_struct_expr(msg);
- if (sub == NULL) {
- sub = (struct google_api_expr_v1alpha1_Expr_CreateStruct*)_upb_msg_new(&google_api_expr_v1alpha1_Expr_CreateStruct_msginit, arena);
- if (!sub) return NULL;
- google_api_expr_v1alpha1_Expr_set_struct_expr(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void google_api_expr_v1alpha1_Expr_set_comprehension_expr(google_api_expr_v1alpha1_Expr *msg, google_api_expr_v1alpha1_Expr_Comprehension* value) {
- UPB_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Expr_Comprehension*, UPB_SIZE(8, 8), value, UPB_SIZE(12, 16), 9);
-}
-UPB_INLINE struct google_api_expr_v1alpha1_Expr_Comprehension* google_api_expr_v1alpha1_Expr_mutable_comprehension_expr(google_api_expr_v1alpha1_Expr *msg, upb_arena *arena) {
- struct google_api_expr_v1alpha1_Expr_Comprehension* sub = (struct google_api_expr_v1alpha1_Expr_Comprehension*)google_api_expr_v1alpha1_Expr_comprehension_expr(msg);
- if (sub == NULL) {
- sub = (struct google_api_expr_v1alpha1_Expr_Comprehension*)_upb_msg_new(&google_api_expr_v1alpha1_Expr_Comprehension_msginit, arena);
- if (!sub) return NULL;
- google_api_expr_v1alpha1_Expr_set_comprehension_expr(msg, sub);
- }
- return sub;
-}
-
-/* google.api.expr.v1alpha1.Expr.Ident */
-
-UPB_INLINE google_api_expr_v1alpha1_Expr_Ident *google_api_expr_v1alpha1_Expr_Ident_new(upb_arena *arena) {
- return (google_api_expr_v1alpha1_Expr_Ident *)_upb_msg_new(&google_api_expr_v1alpha1_Expr_Ident_msginit, arena);
-}
-UPB_INLINE google_api_expr_v1alpha1_Expr_Ident *google_api_expr_v1alpha1_Expr_Ident_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_api_expr_v1alpha1_Expr_Ident *ret = google_api_expr_v1alpha1_Expr_Ident_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_Ident_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *google_api_expr_v1alpha1_Expr_Ident_serialize(const google_api_expr_v1alpha1_Expr_Ident *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &google_api_expr_v1alpha1_Expr_Ident_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview google_api_expr_v1alpha1_Expr_Ident_name(const google_api_expr_v1alpha1_Expr_Ident *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-
-UPB_INLINE void google_api_expr_v1alpha1_Expr_Ident_set_name(google_api_expr_v1alpha1_Expr_Ident *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-
-/* google.api.expr.v1alpha1.Expr.Select */
-
-UPB_INLINE google_api_expr_v1alpha1_Expr_Select *google_api_expr_v1alpha1_Expr_Select_new(upb_arena *arena) {
- return (google_api_expr_v1alpha1_Expr_Select *)_upb_msg_new(&google_api_expr_v1alpha1_Expr_Select_msginit, arena);
-}
-UPB_INLINE google_api_expr_v1alpha1_Expr_Select *google_api_expr_v1alpha1_Expr_Select_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_api_expr_v1alpha1_Expr_Select *ret = google_api_expr_v1alpha1_Expr_Select_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_Select_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *google_api_expr_v1alpha1_Expr_Select_serialize(const google_api_expr_v1alpha1_Expr_Select *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &google_api_expr_v1alpha1_Expr_Select_msginit, arena, len);
-}
-
-UPB_INLINE bool google_api_expr_v1alpha1_Expr_Select_has_operand(const google_api_expr_v1alpha1_Expr_Select *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
-UPB_INLINE const google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_Expr_Select_operand(const google_api_expr_v1alpha1_Expr_Select *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const google_api_expr_v1alpha1_Expr*); }
-UPB_INLINE upb_strview google_api_expr_v1alpha1_Expr_Select_field(const google_api_expr_v1alpha1_Expr_Select *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
-UPB_INLINE bool google_api_expr_v1alpha1_Expr_Select_test_only(const google_api_expr_v1alpha1_Expr_Select *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); }
-
-UPB_INLINE void google_api_expr_v1alpha1_Expr_Select_set_operand(google_api_expr_v1alpha1_Expr_Select *msg, google_api_expr_v1alpha1_Expr* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), google_api_expr_v1alpha1_Expr*) = value;
-}
-UPB_INLINE struct google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_Expr_Select_mutable_operand(google_api_expr_v1alpha1_Expr_Select *msg, upb_arena *arena) {
- struct google_api_expr_v1alpha1_Expr* sub = (struct google_api_expr_v1alpha1_Expr*)google_api_expr_v1alpha1_Expr_Select_operand(msg);
- if (sub == NULL) {
- sub = (struct google_api_expr_v1alpha1_Expr*)_upb_msg_new(&google_api_expr_v1alpha1_Expr_msginit, arena);
- if (!sub) return NULL;
- google_api_expr_v1alpha1_Expr_Select_set_operand(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void google_api_expr_v1alpha1_Expr_Select_set_field(google_api_expr_v1alpha1_Expr_Select *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
-}
-UPB_INLINE void google_api_expr_v1alpha1_Expr_Select_set_test_only(google_api_expr_v1alpha1_Expr_Select *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
-}
-
-/* google.api.expr.v1alpha1.Expr.Call */
-
-UPB_INLINE google_api_expr_v1alpha1_Expr_Call *google_api_expr_v1alpha1_Expr_Call_new(upb_arena *arena) {
- return (google_api_expr_v1alpha1_Expr_Call *)_upb_msg_new(&google_api_expr_v1alpha1_Expr_Call_msginit, arena);
-}
-UPB_INLINE google_api_expr_v1alpha1_Expr_Call *google_api_expr_v1alpha1_Expr_Call_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_api_expr_v1alpha1_Expr_Call *ret = google_api_expr_v1alpha1_Expr_Call_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_Call_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *google_api_expr_v1alpha1_Expr_Call_serialize(const google_api_expr_v1alpha1_Expr_Call *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &google_api_expr_v1alpha1_Expr_Call_msginit, arena, len);
-}
-
-UPB_INLINE bool google_api_expr_v1alpha1_Expr_Call_has_target(const google_api_expr_v1alpha1_Expr_Call *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_Expr_Call_target(const google_api_expr_v1alpha1_Expr_Call *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const google_api_expr_v1alpha1_Expr*); }
-UPB_INLINE upb_strview google_api_expr_v1alpha1_Expr_Call_function(const google_api_expr_v1alpha1_Expr_Call *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE bool google_api_expr_v1alpha1_Expr_Call_has_args(const google_api_expr_v1alpha1_Expr_Call *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
-UPB_INLINE const google_api_expr_v1alpha1_Expr* const* google_api_expr_v1alpha1_Expr_Call_args(const google_api_expr_v1alpha1_Expr_Call *msg, size_t *len) { return (const google_api_expr_v1alpha1_Expr* const*)_upb_array_accessor(msg, UPB_SIZE(12, 24), len); }
-
-UPB_INLINE void google_api_expr_v1alpha1_Expr_Call_set_target(google_api_expr_v1alpha1_Expr_Call *msg, google_api_expr_v1alpha1_Expr* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), google_api_expr_v1alpha1_Expr*) = value;
-}
-UPB_INLINE struct google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_Expr_Call_mutable_target(google_api_expr_v1alpha1_Expr_Call *msg, upb_arena *arena) {
- struct google_api_expr_v1alpha1_Expr* sub = (struct google_api_expr_v1alpha1_Expr*)google_api_expr_v1alpha1_Expr_Call_target(msg);
- if (sub == NULL) {
- sub = (struct google_api_expr_v1alpha1_Expr*)_upb_msg_new(&google_api_expr_v1alpha1_Expr_msginit, arena);
- if (!sub) return NULL;
- google_api_expr_v1alpha1_Expr_Call_set_target(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void google_api_expr_v1alpha1_Expr_Call_set_function(google_api_expr_v1alpha1_Expr_Call *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-UPB_INLINE google_api_expr_v1alpha1_Expr** google_api_expr_v1alpha1_Expr_Call_mutable_args(google_api_expr_v1alpha1_Expr_Call *msg, size_t *len) {
- return (google_api_expr_v1alpha1_Expr**)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 24), len);
-}
-UPB_INLINE google_api_expr_v1alpha1_Expr** google_api_expr_v1alpha1_Expr_Call_resize_args(google_api_expr_v1alpha1_Expr_Call *msg, size_t len, upb_arena *arena) {
- return (google_api_expr_v1alpha1_Expr**)_upb_array_resize_accessor(msg, UPB_SIZE(12, 24), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_Expr_Call_add_args(google_api_expr_v1alpha1_Expr_Call *msg, upb_arena *arena) {
- struct google_api_expr_v1alpha1_Expr* sub = (struct google_api_expr_v1alpha1_Expr*)_upb_msg_new(&google_api_expr_v1alpha1_Expr_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(12, 24), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-
-/* google.api.expr.v1alpha1.Expr.CreateList */
-
-UPB_INLINE google_api_expr_v1alpha1_Expr_CreateList *google_api_expr_v1alpha1_Expr_CreateList_new(upb_arena *arena) {
- return (google_api_expr_v1alpha1_Expr_CreateList *)_upb_msg_new(&google_api_expr_v1alpha1_Expr_CreateList_msginit, arena);
-}
-UPB_INLINE google_api_expr_v1alpha1_Expr_CreateList *google_api_expr_v1alpha1_Expr_CreateList_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_api_expr_v1alpha1_Expr_CreateList *ret = google_api_expr_v1alpha1_Expr_CreateList_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_CreateList_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *google_api_expr_v1alpha1_Expr_CreateList_serialize(const google_api_expr_v1alpha1_Expr_CreateList *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &google_api_expr_v1alpha1_Expr_CreateList_msginit, arena, len);
-}
-
-UPB_INLINE bool google_api_expr_v1alpha1_Expr_CreateList_has_elements(const google_api_expr_v1alpha1_Expr_CreateList *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE const google_api_expr_v1alpha1_Expr* const* google_api_expr_v1alpha1_Expr_CreateList_elements(const google_api_expr_v1alpha1_Expr_CreateList *msg, size_t *len) { return (const google_api_expr_v1alpha1_Expr* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
-
-UPB_INLINE google_api_expr_v1alpha1_Expr** google_api_expr_v1alpha1_Expr_CreateList_mutable_elements(google_api_expr_v1alpha1_Expr_CreateList *msg, size_t *len) {
- return (google_api_expr_v1alpha1_Expr**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
-}
-UPB_INLINE google_api_expr_v1alpha1_Expr** google_api_expr_v1alpha1_Expr_CreateList_resize_elements(google_api_expr_v1alpha1_Expr_CreateList *msg, size_t len, upb_arena *arena) {
- return (google_api_expr_v1alpha1_Expr**)_upb_array_resize_accessor(msg, UPB_SIZE(0, 0), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_Expr_CreateList_add_elements(google_api_expr_v1alpha1_Expr_CreateList *msg, upb_arena *arena) {
- struct google_api_expr_v1alpha1_Expr* sub = (struct google_api_expr_v1alpha1_Expr*)_upb_msg_new(&google_api_expr_v1alpha1_Expr_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(0, 0), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-
-/* google.api.expr.v1alpha1.Expr.CreateStruct */
-
-UPB_INLINE google_api_expr_v1alpha1_Expr_CreateStruct *google_api_expr_v1alpha1_Expr_CreateStruct_new(upb_arena *arena) {
- return (google_api_expr_v1alpha1_Expr_CreateStruct *)_upb_msg_new(&google_api_expr_v1alpha1_Expr_CreateStruct_msginit, arena);
-}
-UPB_INLINE google_api_expr_v1alpha1_Expr_CreateStruct *google_api_expr_v1alpha1_Expr_CreateStruct_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_api_expr_v1alpha1_Expr_CreateStruct *ret = google_api_expr_v1alpha1_Expr_CreateStruct_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_CreateStruct_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *google_api_expr_v1alpha1_Expr_CreateStruct_serialize(const google_api_expr_v1alpha1_Expr_CreateStruct *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &google_api_expr_v1alpha1_Expr_CreateStruct_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview google_api_expr_v1alpha1_Expr_CreateStruct_message_name(const google_api_expr_v1alpha1_Expr_CreateStruct *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE bool google_api_expr_v1alpha1_Expr_CreateStruct_has_entries(const google_api_expr_v1alpha1_Expr_CreateStruct *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const google_api_expr_v1alpha1_Expr_CreateStruct_Entry* const* google_api_expr_v1alpha1_Expr_CreateStruct_entries(const google_api_expr_v1alpha1_Expr_CreateStruct *msg, size_t *len) { return (const google_api_expr_v1alpha1_Expr_CreateStruct_Entry* const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len); }
-
-UPB_INLINE void google_api_expr_v1alpha1_Expr_CreateStruct_set_message_name(google_api_expr_v1alpha1_Expr_CreateStruct *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-UPB_INLINE google_api_expr_v1alpha1_Expr_CreateStruct_Entry** google_api_expr_v1alpha1_Expr_CreateStruct_mutable_entries(google_api_expr_v1alpha1_Expr_CreateStruct *msg, size_t *len) {
- return (google_api_expr_v1alpha1_Expr_CreateStruct_Entry**)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len);
-}
-UPB_INLINE google_api_expr_v1alpha1_Expr_CreateStruct_Entry** google_api_expr_v1alpha1_Expr_CreateStruct_resize_entries(google_api_expr_v1alpha1_Expr_CreateStruct *msg, size_t len, upb_arena *arena) {
- return (google_api_expr_v1alpha1_Expr_CreateStruct_Entry**)_upb_array_resize_accessor(msg, UPB_SIZE(8, 16), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct google_api_expr_v1alpha1_Expr_CreateStruct_Entry* google_api_expr_v1alpha1_Expr_CreateStruct_add_entries(google_api_expr_v1alpha1_Expr_CreateStruct *msg, upb_arena *arena) {
- struct google_api_expr_v1alpha1_Expr_CreateStruct_Entry* sub = (struct google_api_expr_v1alpha1_Expr_CreateStruct_Entry*)_upb_msg_new(&google_api_expr_v1alpha1_Expr_CreateStruct_Entry_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(8, 16), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-
-/* google.api.expr.v1alpha1.Expr.CreateStruct.Entry */
-
-UPB_INLINE google_api_expr_v1alpha1_Expr_CreateStruct_Entry *google_api_expr_v1alpha1_Expr_CreateStruct_Entry_new(upb_arena *arena) {
- return (google_api_expr_v1alpha1_Expr_CreateStruct_Entry *)_upb_msg_new(&google_api_expr_v1alpha1_Expr_CreateStruct_Entry_msginit, arena);
-}
-UPB_INLINE google_api_expr_v1alpha1_Expr_CreateStruct_Entry *google_api_expr_v1alpha1_Expr_CreateStruct_Entry_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_api_expr_v1alpha1_Expr_CreateStruct_Entry *ret = google_api_expr_v1alpha1_Expr_CreateStruct_Entry_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_CreateStruct_Entry_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *google_api_expr_v1alpha1_Expr_CreateStruct_Entry_serialize(const google_api_expr_v1alpha1_Expr_CreateStruct_Entry *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &google_api_expr_v1alpha1_Expr_CreateStruct_Entry_msginit, arena, len);
-}
-
-typedef enum {
- google_api_expr_v1alpha1_Expr_CreateStruct_Entry_key_kind_field_key = 2,
- google_api_expr_v1alpha1_Expr_CreateStruct_Entry_key_kind_map_key = 3,
- google_api_expr_v1alpha1_Expr_CreateStruct_Entry_key_kind_NOT_SET = 0
-} google_api_expr_v1alpha1_Expr_CreateStruct_Entry_key_kind_oneofcases;
-UPB_INLINE google_api_expr_v1alpha1_Expr_CreateStruct_Entry_key_kind_oneofcases google_api_expr_v1alpha1_Expr_CreateStruct_Entry_key_kind_case(const google_api_expr_v1alpha1_Expr_CreateStruct_Entry* msg) { return (google_api_expr_v1alpha1_Expr_CreateStruct_Entry_key_kind_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(20, 32), int32_t); }
-
-UPB_INLINE int64_t google_api_expr_v1alpha1_Expr_CreateStruct_Entry_id(const google_api_expr_v1alpha1_Expr_CreateStruct_Entry *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int64_t); }
-UPB_INLINE bool google_api_expr_v1alpha1_Expr_CreateStruct_Entry_has_field_key(const google_api_expr_v1alpha1_Expr_CreateStruct_Entry *msg) { return _upb_getoneofcase(msg, UPB_SIZE(20, 32)) == 2; }
-UPB_INLINE upb_strview google_api_expr_v1alpha1_Expr_CreateStruct_Entry_field_key(const google_api_expr_v1alpha1_Expr_CreateStruct_Entry *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(12, 16), UPB_SIZE(20, 32), 2, upb_strview_make("", strlen(""))); }
-UPB_INLINE bool google_api_expr_v1alpha1_Expr_CreateStruct_Entry_has_map_key(const google_api_expr_v1alpha1_Expr_CreateStruct_Entry *msg) { return _upb_getoneofcase(msg, UPB_SIZE(20, 32)) == 3; }
-UPB_INLINE const google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_Expr_CreateStruct_Entry_map_key(const google_api_expr_v1alpha1_Expr_CreateStruct_Entry *msg) { return UPB_READ_ONEOF(msg, const google_api_expr_v1alpha1_Expr*, UPB_SIZE(12, 16), UPB_SIZE(20, 32), 3, NULL); }
-UPB_INLINE bool google_api_expr_v1alpha1_Expr_CreateStruct_Entry_has_value(const google_api_expr_v1alpha1_Expr_CreateStruct_Entry *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 8)); }
-UPB_INLINE const google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_Expr_CreateStruct_Entry_value(const google_api_expr_v1alpha1_Expr_CreateStruct_Entry *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const google_api_expr_v1alpha1_Expr*); }
-
-UPB_INLINE void google_api_expr_v1alpha1_Expr_CreateStruct_Entry_set_id(google_api_expr_v1alpha1_Expr_CreateStruct_Entry *msg, int64_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int64_t) = value;
-}
-UPB_INLINE void google_api_expr_v1alpha1_Expr_CreateStruct_Entry_set_field_key(google_api_expr_v1alpha1_Expr_CreateStruct_Entry *msg, upb_strview value) {
- UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(12, 16), value, UPB_SIZE(20, 32), 2);
-}
-UPB_INLINE void google_api_expr_v1alpha1_Expr_CreateStruct_Entry_set_map_key(google_api_expr_v1alpha1_Expr_CreateStruct_Entry *msg, google_api_expr_v1alpha1_Expr* value) {
- UPB_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Expr*, UPB_SIZE(12, 16), value, UPB_SIZE(20, 32), 3);
-}
-UPB_INLINE struct google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_Expr_CreateStruct_Entry_mutable_map_key(google_api_expr_v1alpha1_Expr_CreateStruct_Entry *msg, upb_arena *arena) {
- struct google_api_expr_v1alpha1_Expr* sub = (struct google_api_expr_v1alpha1_Expr*)google_api_expr_v1alpha1_Expr_CreateStruct_Entry_map_key(msg);
- if (sub == NULL) {
- sub = (struct google_api_expr_v1alpha1_Expr*)_upb_msg_new(&google_api_expr_v1alpha1_Expr_msginit, arena);
- if (!sub) return NULL;
- google_api_expr_v1alpha1_Expr_CreateStruct_Entry_set_map_key(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void google_api_expr_v1alpha1_Expr_CreateStruct_Entry_set_value(google_api_expr_v1alpha1_Expr_CreateStruct_Entry *msg, google_api_expr_v1alpha1_Expr* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), google_api_expr_v1alpha1_Expr*) = value;
-}
-UPB_INLINE struct google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_Expr_CreateStruct_Entry_mutable_value(google_api_expr_v1alpha1_Expr_CreateStruct_Entry *msg, upb_arena *arena) {
- struct google_api_expr_v1alpha1_Expr* sub = (struct google_api_expr_v1alpha1_Expr*)google_api_expr_v1alpha1_Expr_CreateStruct_Entry_value(msg);
- if (sub == NULL) {
- sub = (struct google_api_expr_v1alpha1_Expr*)_upb_msg_new(&google_api_expr_v1alpha1_Expr_msginit, arena);
- if (!sub) return NULL;
- google_api_expr_v1alpha1_Expr_CreateStruct_Entry_set_value(msg, sub);
- }
- return sub;
-}
-
-/* google.api.expr.v1alpha1.Expr.Comprehension */
-
-UPB_INLINE google_api_expr_v1alpha1_Expr_Comprehension *google_api_expr_v1alpha1_Expr_Comprehension_new(upb_arena *arena) {
- return (google_api_expr_v1alpha1_Expr_Comprehension *)_upb_msg_new(&google_api_expr_v1alpha1_Expr_Comprehension_msginit, arena);
-}
-UPB_INLINE google_api_expr_v1alpha1_Expr_Comprehension *google_api_expr_v1alpha1_Expr_Comprehension_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_api_expr_v1alpha1_Expr_Comprehension *ret = google_api_expr_v1alpha1_Expr_Comprehension_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_Comprehension_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *google_api_expr_v1alpha1_Expr_Comprehension_serialize(const google_api_expr_v1alpha1_Expr_Comprehension *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &google_api_expr_v1alpha1_Expr_Comprehension_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview google_api_expr_v1alpha1_Expr_Comprehension_iter_var(const google_api_expr_v1alpha1_Expr_Comprehension *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE bool google_api_expr_v1alpha1_Expr_Comprehension_has_iter_range(const google_api_expr_v1alpha1_Expr_Comprehension *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); }
-UPB_INLINE const google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_Expr_Comprehension_iter_range(const google_api_expr_v1alpha1_Expr_Comprehension *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const google_api_expr_v1alpha1_Expr*); }
-UPB_INLINE upb_strview google_api_expr_v1alpha1_Expr_Comprehension_accu_var(const google_api_expr_v1alpha1_Expr_Comprehension *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview); }
-UPB_INLINE bool google_api_expr_v1alpha1_Expr_Comprehension_has_accu_init(const google_api_expr_v1alpha1_Expr_Comprehension *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 40)); }
-UPB_INLINE const google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_Expr_Comprehension_accu_init(const google_api_expr_v1alpha1_Expr_Comprehension *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const google_api_expr_v1alpha1_Expr*); }
-UPB_INLINE bool google_api_expr_v1alpha1_Expr_Comprehension_has_loop_condition(const google_api_expr_v1alpha1_Expr_Comprehension *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 48)); }
-UPB_INLINE const google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_Expr_Comprehension_loop_condition(const google_api_expr_v1alpha1_Expr_Comprehension *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 48), const google_api_expr_v1alpha1_Expr*); }
-UPB_INLINE bool google_api_expr_v1alpha1_Expr_Comprehension_has_loop_step(const google_api_expr_v1alpha1_Expr_Comprehension *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 56)); }
-UPB_INLINE const google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_Expr_Comprehension_loop_step(const google_api_expr_v1alpha1_Expr_Comprehension *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 56), const google_api_expr_v1alpha1_Expr*); }
-UPB_INLINE bool google_api_expr_v1alpha1_Expr_Comprehension_has_result(const google_api_expr_v1alpha1_Expr_Comprehension *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(32, 64)); }
-UPB_INLINE const google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_Expr_Comprehension_result(const google_api_expr_v1alpha1_Expr_Comprehension *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 64), const google_api_expr_v1alpha1_Expr*); }
-
-UPB_INLINE void google_api_expr_v1alpha1_Expr_Comprehension_set_iter_var(google_api_expr_v1alpha1_Expr_Comprehension *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-UPB_INLINE void google_api_expr_v1alpha1_Expr_Comprehension_set_iter_range(google_api_expr_v1alpha1_Expr_Comprehension *msg, google_api_expr_v1alpha1_Expr* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(16, 32), google_api_expr_v1alpha1_Expr*) = value;
-}
-UPB_INLINE struct google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_Expr_Comprehension_mutable_iter_range(google_api_expr_v1alpha1_Expr_Comprehension *msg, upb_arena *arena) {
- struct google_api_expr_v1alpha1_Expr* sub = (struct google_api_expr_v1alpha1_Expr*)google_api_expr_v1alpha1_Expr_Comprehension_iter_range(msg);
- if (sub == NULL) {
- sub = (struct google_api_expr_v1alpha1_Expr*)_upb_msg_new(&google_api_expr_v1alpha1_Expr_msginit, arena);
- if (!sub) return NULL;
- google_api_expr_v1alpha1_Expr_Comprehension_set_iter_range(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void google_api_expr_v1alpha1_Expr_Comprehension_set_accu_var(google_api_expr_v1alpha1_Expr_Comprehension *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview) = value;
-}
-UPB_INLINE void google_api_expr_v1alpha1_Expr_Comprehension_set_accu_init(google_api_expr_v1alpha1_Expr_Comprehension *msg, google_api_expr_v1alpha1_Expr* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(20, 40), google_api_expr_v1alpha1_Expr*) = value;
-}
-UPB_INLINE struct google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_Expr_Comprehension_mutable_accu_init(google_api_expr_v1alpha1_Expr_Comprehension *msg, upb_arena *arena) {
- struct google_api_expr_v1alpha1_Expr* sub = (struct google_api_expr_v1alpha1_Expr*)google_api_expr_v1alpha1_Expr_Comprehension_accu_init(msg);
- if (sub == NULL) {
- sub = (struct google_api_expr_v1alpha1_Expr*)_upb_msg_new(&google_api_expr_v1alpha1_Expr_msginit, arena);
- if (!sub) return NULL;
- google_api_expr_v1alpha1_Expr_Comprehension_set_accu_init(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void google_api_expr_v1alpha1_Expr_Comprehension_set_loop_condition(google_api_expr_v1alpha1_Expr_Comprehension *msg, google_api_expr_v1alpha1_Expr* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(24, 48), google_api_expr_v1alpha1_Expr*) = value;
-}
-UPB_INLINE struct google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_Expr_Comprehension_mutable_loop_condition(google_api_expr_v1alpha1_Expr_Comprehension *msg, upb_arena *arena) {
- struct google_api_expr_v1alpha1_Expr* sub = (struct google_api_expr_v1alpha1_Expr*)google_api_expr_v1alpha1_Expr_Comprehension_loop_condition(msg);
- if (sub == NULL) {
- sub = (struct google_api_expr_v1alpha1_Expr*)_upb_msg_new(&google_api_expr_v1alpha1_Expr_msginit, arena);
- if (!sub) return NULL;
- google_api_expr_v1alpha1_Expr_Comprehension_set_loop_condition(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void google_api_expr_v1alpha1_Expr_Comprehension_set_loop_step(google_api_expr_v1alpha1_Expr_Comprehension *msg, google_api_expr_v1alpha1_Expr* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(28, 56), google_api_expr_v1alpha1_Expr*) = value;
-}
-UPB_INLINE struct google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_Expr_Comprehension_mutable_loop_step(google_api_expr_v1alpha1_Expr_Comprehension *msg, upb_arena *arena) {
- struct google_api_expr_v1alpha1_Expr* sub = (struct google_api_expr_v1alpha1_Expr*)google_api_expr_v1alpha1_Expr_Comprehension_loop_step(msg);
- if (sub == NULL) {
- sub = (struct google_api_expr_v1alpha1_Expr*)_upb_msg_new(&google_api_expr_v1alpha1_Expr_msginit, arena);
- if (!sub) return NULL;
- google_api_expr_v1alpha1_Expr_Comprehension_set_loop_step(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void google_api_expr_v1alpha1_Expr_Comprehension_set_result(google_api_expr_v1alpha1_Expr_Comprehension *msg, google_api_expr_v1alpha1_Expr* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(32, 64), google_api_expr_v1alpha1_Expr*) = value;
-}
-UPB_INLINE struct google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_Expr_Comprehension_mutable_result(google_api_expr_v1alpha1_Expr_Comprehension *msg, upb_arena *arena) {
- struct google_api_expr_v1alpha1_Expr* sub = (struct google_api_expr_v1alpha1_Expr*)google_api_expr_v1alpha1_Expr_Comprehension_result(msg);
- if (sub == NULL) {
- sub = (struct google_api_expr_v1alpha1_Expr*)_upb_msg_new(&google_api_expr_v1alpha1_Expr_msginit, arena);
- if (!sub) return NULL;
- google_api_expr_v1alpha1_Expr_Comprehension_set_result(msg, sub);
- }
- return sub;
-}
-
-/* google.api.expr.v1alpha1.Constant */
-
-UPB_INLINE google_api_expr_v1alpha1_Constant *google_api_expr_v1alpha1_Constant_new(upb_arena *arena) {
- return (google_api_expr_v1alpha1_Constant *)_upb_msg_new(&google_api_expr_v1alpha1_Constant_msginit, arena);
-}
-UPB_INLINE google_api_expr_v1alpha1_Constant *google_api_expr_v1alpha1_Constant_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_api_expr_v1alpha1_Constant *ret = google_api_expr_v1alpha1_Constant_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Constant_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *google_api_expr_v1alpha1_Constant_serialize(const google_api_expr_v1alpha1_Constant *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &google_api_expr_v1alpha1_Constant_msginit, arena, len);
-}
-
-typedef enum {
- google_api_expr_v1alpha1_Constant_constant_kind_null_value = 1,
- google_api_expr_v1alpha1_Constant_constant_kind_bool_value = 2,
- google_api_expr_v1alpha1_Constant_constant_kind_int64_value = 3,
- google_api_expr_v1alpha1_Constant_constant_kind_uint64_value = 4,
- google_api_expr_v1alpha1_Constant_constant_kind_double_value = 5,
- google_api_expr_v1alpha1_Constant_constant_kind_string_value = 6,
- google_api_expr_v1alpha1_Constant_constant_kind_bytes_value = 7,
- google_api_expr_v1alpha1_Constant_constant_kind_duration_value = 8,
- google_api_expr_v1alpha1_Constant_constant_kind_timestamp_value = 9,
- google_api_expr_v1alpha1_Constant_constant_kind_NOT_SET = 0
-} google_api_expr_v1alpha1_Constant_constant_kind_oneofcases;
-UPB_INLINE google_api_expr_v1alpha1_Constant_constant_kind_oneofcases google_api_expr_v1alpha1_Constant_constant_kind_case(const google_api_expr_v1alpha1_Constant* msg) { return (google_api_expr_v1alpha1_Constant_constant_kind_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(8, 16), int32_t); }
-
-UPB_INLINE bool google_api_expr_v1alpha1_Constant_has_null_value(const google_api_expr_v1alpha1_Constant *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 1; }
-UPB_INLINE int32_t google_api_expr_v1alpha1_Constant_null_value(const google_api_expr_v1alpha1_Constant *msg) { return UPB_READ_ONEOF(msg, int32_t, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 1, 0); }
-UPB_INLINE bool google_api_expr_v1alpha1_Constant_has_bool_value(const google_api_expr_v1alpha1_Constant *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 2; }
-UPB_INLINE bool google_api_expr_v1alpha1_Constant_bool_value(const google_api_expr_v1alpha1_Constant *msg) { return UPB_READ_ONEOF(msg, bool, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 2, false); }
-UPB_INLINE bool google_api_expr_v1alpha1_Constant_has_int64_value(const google_api_expr_v1alpha1_Constant *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 3; }
-UPB_INLINE int64_t google_api_expr_v1alpha1_Constant_int64_value(const google_api_expr_v1alpha1_Constant *msg) { return UPB_READ_ONEOF(msg, int64_t, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 3, 0); }
-UPB_INLINE bool google_api_expr_v1alpha1_Constant_has_uint64_value(const google_api_expr_v1alpha1_Constant *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 4; }
-UPB_INLINE uint64_t google_api_expr_v1alpha1_Constant_uint64_value(const google_api_expr_v1alpha1_Constant *msg) { return UPB_READ_ONEOF(msg, uint64_t, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 4, 0); }
-UPB_INLINE bool google_api_expr_v1alpha1_Constant_has_double_value(const google_api_expr_v1alpha1_Constant *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 5; }
-UPB_INLINE double google_api_expr_v1alpha1_Constant_double_value(const google_api_expr_v1alpha1_Constant *msg) { return UPB_READ_ONEOF(msg, double, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 5, 0); }
-UPB_INLINE bool google_api_expr_v1alpha1_Constant_has_string_value(const google_api_expr_v1alpha1_Constant *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 6; }
-UPB_INLINE upb_strview google_api_expr_v1alpha1_Constant_string_value(const google_api_expr_v1alpha1_Constant *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 6, upb_strview_make("", strlen(""))); }
-UPB_INLINE bool google_api_expr_v1alpha1_Constant_has_bytes_value(const google_api_expr_v1alpha1_Constant *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 7; }
-UPB_INLINE upb_strview google_api_expr_v1alpha1_Constant_bytes_value(const google_api_expr_v1alpha1_Constant *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 7, upb_strview_make("", strlen(""))); }
-UPB_INLINE bool google_api_expr_v1alpha1_Constant_has_duration_value(const google_api_expr_v1alpha1_Constant *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 8; }
-UPB_INLINE const struct google_protobuf_Duration* google_api_expr_v1alpha1_Constant_duration_value(const google_api_expr_v1alpha1_Constant *msg) { return UPB_READ_ONEOF(msg, const struct google_protobuf_Duration*, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 8, NULL); }
-UPB_INLINE bool google_api_expr_v1alpha1_Constant_has_timestamp_value(const google_api_expr_v1alpha1_Constant *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 9; }
-UPB_INLINE const struct google_protobuf_Timestamp* google_api_expr_v1alpha1_Constant_timestamp_value(const google_api_expr_v1alpha1_Constant *msg) { return UPB_READ_ONEOF(msg, const struct google_protobuf_Timestamp*, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 9, NULL); }
-
-UPB_INLINE void google_api_expr_v1alpha1_Constant_set_null_value(google_api_expr_v1alpha1_Constant *msg, int32_t value) {
- UPB_WRITE_ONEOF(msg, int32_t, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 1);
-}
-UPB_INLINE void google_api_expr_v1alpha1_Constant_set_bool_value(google_api_expr_v1alpha1_Constant *msg, bool value) {
- UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 2);
-}
-UPB_INLINE void google_api_expr_v1alpha1_Constant_set_int64_value(google_api_expr_v1alpha1_Constant *msg, int64_t value) {
- UPB_WRITE_ONEOF(msg, int64_t, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 3);
-}
-UPB_INLINE void google_api_expr_v1alpha1_Constant_set_uint64_value(google_api_expr_v1alpha1_Constant *msg, uint64_t value) {
- UPB_WRITE_ONEOF(msg, uint64_t, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 4);
-}
-UPB_INLINE void google_api_expr_v1alpha1_Constant_set_double_value(google_api_expr_v1alpha1_Constant *msg, double value) {
- UPB_WRITE_ONEOF(msg, double, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 5);
-}
-UPB_INLINE void google_api_expr_v1alpha1_Constant_set_string_value(google_api_expr_v1alpha1_Constant *msg, upb_strview value) {
- UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 6);
-}
-UPB_INLINE void google_api_expr_v1alpha1_Constant_set_bytes_value(google_api_expr_v1alpha1_Constant *msg, upb_strview value) {
- UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 7);
-}
-UPB_INLINE void google_api_expr_v1alpha1_Constant_set_duration_value(google_api_expr_v1alpha1_Constant *msg, struct google_protobuf_Duration* value) {
- UPB_WRITE_ONEOF(msg, struct google_protobuf_Duration*, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 8);
-}
-UPB_INLINE struct google_protobuf_Duration* google_api_expr_v1alpha1_Constant_mutable_duration_value(google_api_expr_v1alpha1_Constant *msg, upb_arena *arena) {
- struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)google_api_expr_v1alpha1_Constant_duration_value(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
- if (!sub) return NULL;
- google_api_expr_v1alpha1_Constant_set_duration_value(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void google_api_expr_v1alpha1_Constant_set_timestamp_value(google_api_expr_v1alpha1_Constant *msg, struct google_protobuf_Timestamp* value) {
- UPB_WRITE_ONEOF(msg, struct google_protobuf_Timestamp*, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 9);
-}
-UPB_INLINE struct google_protobuf_Timestamp* google_api_expr_v1alpha1_Constant_mutable_timestamp_value(google_api_expr_v1alpha1_Constant *msg, upb_arena *arena) {
- struct google_protobuf_Timestamp* sub = (struct google_protobuf_Timestamp*)google_api_expr_v1alpha1_Constant_timestamp_value(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Timestamp*)_upb_msg_new(&google_protobuf_Timestamp_msginit, arena);
- if (!sub) return NULL;
- google_api_expr_v1alpha1_Constant_set_timestamp_value(msg, sub);
- }
- return sub;
-}
-
-/* google.api.expr.v1alpha1.SourceInfo */
-
-UPB_INLINE google_api_expr_v1alpha1_SourceInfo *google_api_expr_v1alpha1_SourceInfo_new(upb_arena *arena) {
- return (google_api_expr_v1alpha1_SourceInfo *)_upb_msg_new(&google_api_expr_v1alpha1_SourceInfo_msginit, arena);
-}
-UPB_INLINE google_api_expr_v1alpha1_SourceInfo *google_api_expr_v1alpha1_SourceInfo_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_api_expr_v1alpha1_SourceInfo *ret = google_api_expr_v1alpha1_SourceInfo_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_api_expr_v1alpha1_SourceInfo_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *google_api_expr_v1alpha1_SourceInfo_serialize(const google_api_expr_v1alpha1_SourceInfo *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &google_api_expr_v1alpha1_SourceInfo_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview google_api_expr_v1alpha1_SourceInfo_syntax_version(const google_api_expr_v1alpha1_SourceInfo *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE upb_strview google_api_expr_v1alpha1_SourceInfo_location(const google_api_expr_v1alpha1_SourceInfo *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview); }
-UPB_INLINE int32_t const* google_api_expr_v1alpha1_SourceInfo_line_offsets(const google_api_expr_v1alpha1_SourceInfo *msg, size_t *len) { return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(16, 32), len); }
-UPB_INLINE bool google_api_expr_v1alpha1_SourceInfo_has_positions(const google_api_expr_v1alpha1_SourceInfo *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 40)); }
-UPB_INLINE size_t google_api_expr_v1alpha1_SourceInfo_positions_size(const google_api_expr_v1alpha1_SourceInfo *msg) {return _upb_msg_map_size(msg, UPB_SIZE(20, 40)); }
-UPB_INLINE bool google_api_expr_v1alpha1_SourceInfo_positions_get(const google_api_expr_v1alpha1_SourceInfo *msg, int64_t key, int32_t *val) { return _upb_msg_map_get(msg, UPB_SIZE(20, 40), &key, sizeof(key), val, sizeof(*val)); }
-UPB_INLINE const google_api_expr_v1alpha1_SourceInfo_PositionsEntry* google_api_expr_v1alpha1_SourceInfo_positions_next(const google_api_expr_v1alpha1_SourceInfo *msg, size_t* iter) { return (const google_api_expr_v1alpha1_SourceInfo_PositionsEntry*)_upb_msg_map_next(msg, UPB_SIZE(20, 40), iter); }
-
-UPB_INLINE void google_api_expr_v1alpha1_SourceInfo_set_syntax_version(google_api_expr_v1alpha1_SourceInfo *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-UPB_INLINE void google_api_expr_v1alpha1_SourceInfo_set_location(google_api_expr_v1alpha1_SourceInfo *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview) = value;
-}
-UPB_INLINE int32_t* google_api_expr_v1alpha1_SourceInfo_mutable_line_offsets(google_api_expr_v1alpha1_SourceInfo *msg, size_t *len) {
- return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 32), len);
-}
-UPB_INLINE int32_t* google_api_expr_v1alpha1_SourceInfo_resize_line_offsets(google_api_expr_v1alpha1_SourceInfo *msg, size_t len, upb_arena *arena) {
- return (int32_t*)_upb_array_resize_accessor(msg, UPB_SIZE(16, 32), len, UPB_TYPE_INT32, arena);
-}
-UPB_INLINE bool google_api_expr_v1alpha1_SourceInfo_add_line_offsets(google_api_expr_v1alpha1_SourceInfo *msg, int32_t val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(16, 32), UPB_SIZE(4, 4), UPB_TYPE_INT32, &val,
- arena);
-}
-UPB_INLINE void google_api_expr_v1alpha1_SourceInfo_positions_clear(google_api_expr_v1alpha1_SourceInfo *msg) { _upb_msg_map_clear(msg, UPB_SIZE(20, 40)); }
-UPB_INLINE bool google_api_expr_v1alpha1_SourceInfo_positions_set(google_api_expr_v1alpha1_SourceInfo *msg, int64_t key, int32_t val, upb_arena *a) { return _upb_msg_map_set(msg, UPB_SIZE(20, 40), &key, sizeof(key), &val, sizeof(val), a); }
-UPB_INLINE bool google_api_expr_v1alpha1_SourceInfo_positions_delete(google_api_expr_v1alpha1_SourceInfo *msg, int64_t key) { return _upb_msg_map_delete(msg, UPB_SIZE(20, 40), &key, sizeof(key)); }
-UPB_INLINE google_api_expr_v1alpha1_SourceInfo_PositionsEntry* google_api_expr_v1alpha1_SourceInfo_positions_nextmutable(google_api_expr_v1alpha1_SourceInfo *msg, size_t* iter) { return (google_api_expr_v1alpha1_SourceInfo_PositionsEntry*)_upb_msg_map_next(msg, UPB_SIZE(20, 40), iter); }
-
-/* google.api.expr.v1alpha1.SourceInfo.PositionsEntry */
-
-UPB_INLINE int64_t google_api_expr_v1alpha1_SourceInfo_PositionsEntry_key(const google_api_expr_v1alpha1_SourceInfo_PositionsEntry *msg) {
- int64_t ret;
- _upb_msg_map_key(msg, &ret, sizeof(ret));
- return ret;
-}
-UPB_INLINE int32_t google_api_expr_v1alpha1_SourceInfo_PositionsEntry_value(const google_api_expr_v1alpha1_SourceInfo_PositionsEntry *msg) {
- int32_t ret;
- _upb_msg_map_value(msg, &ret, sizeof(ret));
- return ret;
-}
-
-UPB_INLINE void google_api_expr_v1alpha1_SourceInfo_PositionsEntry_set_value(google_api_expr_v1alpha1_SourceInfo_PositionsEntry *msg, int32_t value) {
- _upb_msg_map_set_value(msg, &value, sizeof(int32_t));
-}
-
-/* google.api.expr.v1alpha1.SourcePosition */
-
-UPB_INLINE google_api_expr_v1alpha1_SourcePosition *google_api_expr_v1alpha1_SourcePosition_new(upb_arena *arena) {
- return (google_api_expr_v1alpha1_SourcePosition *)_upb_msg_new(&google_api_expr_v1alpha1_SourcePosition_msginit, arena);
-}
-UPB_INLINE google_api_expr_v1alpha1_SourcePosition *google_api_expr_v1alpha1_SourcePosition_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_api_expr_v1alpha1_SourcePosition *ret = google_api_expr_v1alpha1_SourcePosition_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_api_expr_v1alpha1_SourcePosition_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *google_api_expr_v1alpha1_SourcePosition_serialize(const google_api_expr_v1alpha1_SourcePosition *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &google_api_expr_v1alpha1_SourcePosition_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview google_api_expr_v1alpha1_SourcePosition_location(const google_api_expr_v1alpha1_SourcePosition *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 16), upb_strview); }
-UPB_INLINE int32_t google_api_expr_v1alpha1_SourcePosition_offset(const google_api_expr_v1alpha1_SourcePosition *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
-UPB_INLINE int32_t google_api_expr_v1alpha1_SourcePosition_line(const google_api_expr_v1alpha1_SourcePosition *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); }
-UPB_INLINE int32_t google_api_expr_v1alpha1_SourcePosition_column(const google_api_expr_v1alpha1_SourcePosition *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); }
-
-UPB_INLINE void google_api_expr_v1alpha1_SourcePosition_set_location(google_api_expr_v1alpha1_SourcePosition *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(12, 16), upb_strview) = value;
-}
-UPB_INLINE void google_api_expr_v1alpha1_SourcePosition_set_offset(google_api_expr_v1alpha1_SourcePosition *msg, int32_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
-}
-UPB_INLINE void google_api_expr_v1alpha1_SourcePosition_set_line(google_api_expr_v1alpha1_SourcePosition *msg, int32_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value;
-}
-UPB_INLINE void google_api_expr_v1alpha1_SourcePosition_set_column(google_api_expr_v1alpha1_SourcePosition *msg, int32_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* GOOGLE_API_EXPR_V1ALPHA1_SYNTAX_PROTO_UPB_H_ */
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * google/api/expr/v1alpha1/syntax.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef GOOGLE_API_EXPR_V1ALPHA1_SYNTAX_PROTO_UPB_H_
+#define GOOGLE_API_EXPR_V1ALPHA1_SYNTAX_PROTO_UPB_H_
+
+#include "upb/msg.h"
+#include "upb/decode.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct google_api_expr_v1alpha1_ParsedExpr;
+struct google_api_expr_v1alpha1_Expr;
+struct google_api_expr_v1alpha1_Expr_Ident;
+struct google_api_expr_v1alpha1_Expr_Select;
+struct google_api_expr_v1alpha1_Expr_Call;
+struct google_api_expr_v1alpha1_Expr_CreateList;
+struct google_api_expr_v1alpha1_Expr_CreateStruct;
+struct google_api_expr_v1alpha1_Expr_CreateStruct_Entry;
+struct google_api_expr_v1alpha1_Expr_Comprehension;
+struct google_api_expr_v1alpha1_Constant;
+struct google_api_expr_v1alpha1_SourceInfo;
+struct google_api_expr_v1alpha1_SourceInfo_PositionsEntry;
+struct google_api_expr_v1alpha1_SourcePosition;
+typedef struct google_api_expr_v1alpha1_ParsedExpr google_api_expr_v1alpha1_ParsedExpr;
+typedef struct google_api_expr_v1alpha1_Expr google_api_expr_v1alpha1_Expr;
+typedef struct google_api_expr_v1alpha1_Expr_Ident google_api_expr_v1alpha1_Expr_Ident;
+typedef struct google_api_expr_v1alpha1_Expr_Select google_api_expr_v1alpha1_Expr_Select;
+typedef struct google_api_expr_v1alpha1_Expr_Call google_api_expr_v1alpha1_Expr_Call;
+typedef struct google_api_expr_v1alpha1_Expr_CreateList google_api_expr_v1alpha1_Expr_CreateList;
+typedef struct google_api_expr_v1alpha1_Expr_CreateStruct google_api_expr_v1alpha1_Expr_CreateStruct;
+typedef struct google_api_expr_v1alpha1_Expr_CreateStruct_Entry google_api_expr_v1alpha1_Expr_CreateStruct_Entry;
+typedef struct google_api_expr_v1alpha1_Expr_Comprehension google_api_expr_v1alpha1_Expr_Comprehension;
+typedef struct google_api_expr_v1alpha1_Constant google_api_expr_v1alpha1_Constant;
+typedef struct google_api_expr_v1alpha1_SourceInfo google_api_expr_v1alpha1_SourceInfo;
+typedef struct google_api_expr_v1alpha1_SourceInfo_PositionsEntry google_api_expr_v1alpha1_SourceInfo_PositionsEntry;
+typedef struct google_api_expr_v1alpha1_SourcePosition google_api_expr_v1alpha1_SourcePosition;
+extern const upb_msglayout google_api_expr_v1alpha1_ParsedExpr_msginit;
+extern const upb_msglayout google_api_expr_v1alpha1_Expr_msginit;
+extern const upb_msglayout google_api_expr_v1alpha1_Expr_Ident_msginit;
+extern const upb_msglayout google_api_expr_v1alpha1_Expr_Select_msginit;
+extern const upb_msglayout google_api_expr_v1alpha1_Expr_Call_msginit;
+extern const upb_msglayout google_api_expr_v1alpha1_Expr_CreateList_msginit;
+extern const upb_msglayout google_api_expr_v1alpha1_Expr_CreateStruct_msginit;
+extern const upb_msglayout google_api_expr_v1alpha1_Expr_CreateStruct_Entry_msginit;
+extern const upb_msglayout google_api_expr_v1alpha1_Expr_Comprehension_msginit;
+extern const upb_msglayout google_api_expr_v1alpha1_Constant_msginit;
+extern const upb_msglayout google_api_expr_v1alpha1_SourceInfo_msginit;
+extern const upb_msglayout google_api_expr_v1alpha1_SourceInfo_PositionsEntry_msginit;
+extern const upb_msglayout google_api_expr_v1alpha1_SourcePosition_msginit;
+struct google_protobuf_Duration;
+struct google_protobuf_Timestamp;
+extern const upb_msglayout google_protobuf_Duration_msginit;
+extern const upb_msglayout google_protobuf_Timestamp_msginit;
+
+
+/* google.api.expr.v1alpha1.ParsedExpr */
+
+UPB_INLINE google_api_expr_v1alpha1_ParsedExpr *google_api_expr_v1alpha1_ParsedExpr_new(upb_arena *arena) {
+ return (google_api_expr_v1alpha1_ParsedExpr *)_upb_msg_new(&google_api_expr_v1alpha1_ParsedExpr_msginit, arena);
+}
+UPB_INLINE google_api_expr_v1alpha1_ParsedExpr *google_api_expr_v1alpha1_ParsedExpr_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ google_api_expr_v1alpha1_ParsedExpr *ret = google_api_expr_v1alpha1_ParsedExpr_new(arena);
+ return (ret && upb_decode(buf, size, ret, &google_api_expr_v1alpha1_ParsedExpr_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *google_api_expr_v1alpha1_ParsedExpr_serialize(const google_api_expr_v1alpha1_ParsedExpr *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &google_api_expr_v1alpha1_ParsedExpr_msginit, arena, len);
+}
+
+UPB_INLINE bool google_api_expr_v1alpha1_ParsedExpr_has_expr(const google_api_expr_v1alpha1_ParsedExpr *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE const google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_ParsedExpr_expr(const google_api_expr_v1alpha1_ParsedExpr *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const google_api_expr_v1alpha1_Expr*); }
+UPB_INLINE bool google_api_expr_v1alpha1_ParsedExpr_has_source_info(const google_api_expr_v1alpha1_ParsedExpr *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
+UPB_INLINE const google_api_expr_v1alpha1_SourceInfo* google_api_expr_v1alpha1_ParsedExpr_source_info(const google_api_expr_v1alpha1_ParsedExpr *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const google_api_expr_v1alpha1_SourceInfo*); }
+
+UPB_INLINE void google_api_expr_v1alpha1_ParsedExpr_set_expr(google_api_expr_v1alpha1_ParsedExpr *msg, google_api_expr_v1alpha1_Expr* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), google_api_expr_v1alpha1_Expr*) = value;
+}
+UPB_INLINE struct google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_ParsedExpr_mutable_expr(google_api_expr_v1alpha1_ParsedExpr *msg, upb_arena *arena) {
+ struct google_api_expr_v1alpha1_Expr* sub = (struct google_api_expr_v1alpha1_Expr*)google_api_expr_v1alpha1_ParsedExpr_expr(msg);
+ if (sub == NULL) {
+ sub = (struct google_api_expr_v1alpha1_Expr*)_upb_msg_new(&google_api_expr_v1alpha1_Expr_msginit, arena);
+ if (!sub) return NULL;
+ google_api_expr_v1alpha1_ParsedExpr_set_expr(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void google_api_expr_v1alpha1_ParsedExpr_set_source_info(google_api_expr_v1alpha1_ParsedExpr *msg, google_api_expr_v1alpha1_SourceInfo* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), google_api_expr_v1alpha1_SourceInfo*) = value;
+}
+UPB_INLINE struct google_api_expr_v1alpha1_SourceInfo* google_api_expr_v1alpha1_ParsedExpr_mutable_source_info(google_api_expr_v1alpha1_ParsedExpr *msg, upb_arena *arena) {
+ struct google_api_expr_v1alpha1_SourceInfo* sub = (struct google_api_expr_v1alpha1_SourceInfo*)google_api_expr_v1alpha1_ParsedExpr_source_info(msg);
+ if (sub == NULL) {
+ sub = (struct google_api_expr_v1alpha1_SourceInfo*)_upb_msg_new(&google_api_expr_v1alpha1_SourceInfo_msginit, arena);
+ if (!sub) return NULL;
+ google_api_expr_v1alpha1_ParsedExpr_set_source_info(msg, sub);
+ }
+ return sub;
+}
+
+/* google.api.expr.v1alpha1.Expr */
+
+UPB_INLINE google_api_expr_v1alpha1_Expr *google_api_expr_v1alpha1_Expr_new(upb_arena *arena) {
+ return (google_api_expr_v1alpha1_Expr *)_upb_msg_new(&google_api_expr_v1alpha1_Expr_msginit, arena);
+}
+UPB_INLINE google_api_expr_v1alpha1_Expr *google_api_expr_v1alpha1_Expr_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ google_api_expr_v1alpha1_Expr *ret = google_api_expr_v1alpha1_Expr_new(arena);
+ return (ret && upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *google_api_expr_v1alpha1_Expr_serialize(const google_api_expr_v1alpha1_Expr *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &google_api_expr_v1alpha1_Expr_msginit, arena, len);
+}
+
+typedef enum {
+ google_api_expr_v1alpha1_Expr_expr_kind_const_expr = 3,
+ google_api_expr_v1alpha1_Expr_expr_kind_ident_expr = 4,
+ google_api_expr_v1alpha1_Expr_expr_kind_select_expr = 5,
+ google_api_expr_v1alpha1_Expr_expr_kind_call_expr = 6,
+ google_api_expr_v1alpha1_Expr_expr_kind_list_expr = 7,
+ google_api_expr_v1alpha1_Expr_expr_kind_struct_expr = 8,
+ google_api_expr_v1alpha1_Expr_expr_kind_comprehension_expr = 9,
+ google_api_expr_v1alpha1_Expr_expr_kind_NOT_SET = 0
+} google_api_expr_v1alpha1_Expr_expr_kind_oneofcases;
+UPB_INLINE google_api_expr_v1alpha1_Expr_expr_kind_oneofcases google_api_expr_v1alpha1_Expr_expr_kind_case(const google_api_expr_v1alpha1_Expr* msg) { return (google_api_expr_v1alpha1_Expr_expr_kind_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(12, 16), int32_t); }
+
+UPB_INLINE int64_t google_api_expr_v1alpha1_Expr_id(const google_api_expr_v1alpha1_Expr *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int64_t); }
+UPB_INLINE bool google_api_expr_v1alpha1_Expr_has_const_expr(const google_api_expr_v1alpha1_Expr *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 16)) == 3; }
+UPB_INLINE const google_api_expr_v1alpha1_Constant* google_api_expr_v1alpha1_Expr_const_expr(const google_api_expr_v1alpha1_Expr *msg) { return UPB_READ_ONEOF(msg, const google_api_expr_v1alpha1_Constant*, UPB_SIZE(8, 8), UPB_SIZE(12, 16), 3, NULL); }
+UPB_INLINE bool google_api_expr_v1alpha1_Expr_has_ident_expr(const google_api_expr_v1alpha1_Expr *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 16)) == 4; }
+UPB_INLINE const google_api_expr_v1alpha1_Expr_Ident* google_api_expr_v1alpha1_Expr_ident_expr(const google_api_expr_v1alpha1_Expr *msg) { return UPB_READ_ONEOF(msg, const google_api_expr_v1alpha1_Expr_Ident*, UPB_SIZE(8, 8), UPB_SIZE(12, 16), 4, NULL); }
+UPB_INLINE bool google_api_expr_v1alpha1_Expr_has_select_expr(const google_api_expr_v1alpha1_Expr *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 16)) == 5; }
+UPB_INLINE const google_api_expr_v1alpha1_Expr_Select* google_api_expr_v1alpha1_Expr_select_expr(const google_api_expr_v1alpha1_Expr *msg) { return UPB_READ_ONEOF(msg, const google_api_expr_v1alpha1_Expr_Select*, UPB_SIZE(8, 8), UPB_SIZE(12, 16), 5, NULL); }
+UPB_INLINE bool google_api_expr_v1alpha1_Expr_has_call_expr(const google_api_expr_v1alpha1_Expr *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 16)) == 6; }
+UPB_INLINE const google_api_expr_v1alpha1_Expr_Call* google_api_expr_v1alpha1_Expr_call_expr(const google_api_expr_v1alpha1_Expr *msg) { return UPB_READ_ONEOF(msg, const google_api_expr_v1alpha1_Expr_Call*, UPB_SIZE(8, 8), UPB_SIZE(12, 16), 6, NULL); }
+UPB_INLINE bool google_api_expr_v1alpha1_Expr_has_list_expr(const google_api_expr_v1alpha1_Expr *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 16)) == 7; }
+UPB_INLINE const google_api_expr_v1alpha1_Expr_CreateList* google_api_expr_v1alpha1_Expr_list_expr(const google_api_expr_v1alpha1_Expr *msg) { return UPB_READ_ONEOF(msg, const google_api_expr_v1alpha1_Expr_CreateList*, UPB_SIZE(8, 8), UPB_SIZE(12, 16), 7, NULL); }
+UPB_INLINE bool google_api_expr_v1alpha1_Expr_has_struct_expr(const google_api_expr_v1alpha1_Expr *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 16)) == 8; }
+UPB_INLINE const google_api_expr_v1alpha1_Expr_CreateStruct* google_api_expr_v1alpha1_Expr_struct_expr(const google_api_expr_v1alpha1_Expr *msg) { return UPB_READ_ONEOF(msg, const google_api_expr_v1alpha1_Expr_CreateStruct*, UPB_SIZE(8, 8), UPB_SIZE(12, 16), 8, NULL); }
+UPB_INLINE bool google_api_expr_v1alpha1_Expr_has_comprehension_expr(const google_api_expr_v1alpha1_Expr *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 16)) == 9; }
+UPB_INLINE const google_api_expr_v1alpha1_Expr_Comprehension* google_api_expr_v1alpha1_Expr_comprehension_expr(const google_api_expr_v1alpha1_Expr *msg) { return UPB_READ_ONEOF(msg, const google_api_expr_v1alpha1_Expr_Comprehension*, UPB_SIZE(8, 8), UPB_SIZE(12, 16), 9, NULL); }
+
+UPB_INLINE void google_api_expr_v1alpha1_Expr_set_id(google_api_expr_v1alpha1_Expr *msg, int64_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int64_t) = value;
+}
+UPB_INLINE void google_api_expr_v1alpha1_Expr_set_const_expr(google_api_expr_v1alpha1_Expr *msg, google_api_expr_v1alpha1_Constant* value) {
+ UPB_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Constant*, UPB_SIZE(8, 8), value, UPB_SIZE(12, 16), 3);
+}
+UPB_INLINE struct google_api_expr_v1alpha1_Constant* google_api_expr_v1alpha1_Expr_mutable_const_expr(google_api_expr_v1alpha1_Expr *msg, upb_arena *arena) {
+ struct google_api_expr_v1alpha1_Constant* sub = (struct google_api_expr_v1alpha1_Constant*)google_api_expr_v1alpha1_Expr_const_expr(msg);
+ if (sub == NULL) {
+ sub = (struct google_api_expr_v1alpha1_Constant*)_upb_msg_new(&google_api_expr_v1alpha1_Constant_msginit, arena);
+ if (!sub) return NULL;
+ google_api_expr_v1alpha1_Expr_set_const_expr(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void google_api_expr_v1alpha1_Expr_set_ident_expr(google_api_expr_v1alpha1_Expr *msg, google_api_expr_v1alpha1_Expr_Ident* value) {
+ UPB_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Expr_Ident*, UPB_SIZE(8, 8), value, UPB_SIZE(12, 16), 4);
+}
+UPB_INLINE struct google_api_expr_v1alpha1_Expr_Ident* google_api_expr_v1alpha1_Expr_mutable_ident_expr(google_api_expr_v1alpha1_Expr *msg, upb_arena *arena) {
+ struct google_api_expr_v1alpha1_Expr_Ident* sub = (struct google_api_expr_v1alpha1_Expr_Ident*)google_api_expr_v1alpha1_Expr_ident_expr(msg);
+ if (sub == NULL) {
+ sub = (struct google_api_expr_v1alpha1_Expr_Ident*)_upb_msg_new(&google_api_expr_v1alpha1_Expr_Ident_msginit, arena);
+ if (!sub) return NULL;
+ google_api_expr_v1alpha1_Expr_set_ident_expr(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void google_api_expr_v1alpha1_Expr_set_select_expr(google_api_expr_v1alpha1_Expr *msg, google_api_expr_v1alpha1_Expr_Select* value) {
+ UPB_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Expr_Select*, UPB_SIZE(8, 8), value, UPB_SIZE(12, 16), 5);
+}
+UPB_INLINE struct google_api_expr_v1alpha1_Expr_Select* google_api_expr_v1alpha1_Expr_mutable_select_expr(google_api_expr_v1alpha1_Expr *msg, upb_arena *arena) {
+ struct google_api_expr_v1alpha1_Expr_Select* sub = (struct google_api_expr_v1alpha1_Expr_Select*)google_api_expr_v1alpha1_Expr_select_expr(msg);
+ if (sub == NULL) {
+ sub = (struct google_api_expr_v1alpha1_Expr_Select*)_upb_msg_new(&google_api_expr_v1alpha1_Expr_Select_msginit, arena);
+ if (!sub) return NULL;
+ google_api_expr_v1alpha1_Expr_set_select_expr(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void google_api_expr_v1alpha1_Expr_set_call_expr(google_api_expr_v1alpha1_Expr *msg, google_api_expr_v1alpha1_Expr_Call* value) {
+ UPB_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Expr_Call*, UPB_SIZE(8, 8), value, UPB_SIZE(12, 16), 6);
+}
+UPB_INLINE struct google_api_expr_v1alpha1_Expr_Call* google_api_expr_v1alpha1_Expr_mutable_call_expr(google_api_expr_v1alpha1_Expr *msg, upb_arena *arena) {
+ struct google_api_expr_v1alpha1_Expr_Call* sub = (struct google_api_expr_v1alpha1_Expr_Call*)google_api_expr_v1alpha1_Expr_call_expr(msg);
+ if (sub == NULL) {
+ sub = (struct google_api_expr_v1alpha1_Expr_Call*)_upb_msg_new(&google_api_expr_v1alpha1_Expr_Call_msginit, arena);
+ if (!sub) return NULL;
+ google_api_expr_v1alpha1_Expr_set_call_expr(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void google_api_expr_v1alpha1_Expr_set_list_expr(google_api_expr_v1alpha1_Expr *msg, google_api_expr_v1alpha1_Expr_CreateList* value) {
+ UPB_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Expr_CreateList*, UPB_SIZE(8, 8), value, UPB_SIZE(12, 16), 7);
+}
+UPB_INLINE struct google_api_expr_v1alpha1_Expr_CreateList* google_api_expr_v1alpha1_Expr_mutable_list_expr(google_api_expr_v1alpha1_Expr *msg, upb_arena *arena) {
+ struct google_api_expr_v1alpha1_Expr_CreateList* sub = (struct google_api_expr_v1alpha1_Expr_CreateList*)google_api_expr_v1alpha1_Expr_list_expr(msg);
+ if (sub == NULL) {
+ sub = (struct google_api_expr_v1alpha1_Expr_CreateList*)_upb_msg_new(&google_api_expr_v1alpha1_Expr_CreateList_msginit, arena);
+ if (!sub) return NULL;
+ google_api_expr_v1alpha1_Expr_set_list_expr(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void google_api_expr_v1alpha1_Expr_set_struct_expr(google_api_expr_v1alpha1_Expr *msg, google_api_expr_v1alpha1_Expr_CreateStruct* value) {
+ UPB_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Expr_CreateStruct*, UPB_SIZE(8, 8), value, UPB_SIZE(12, 16), 8);
+}
+UPB_INLINE struct google_api_expr_v1alpha1_Expr_CreateStruct* google_api_expr_v1alpha1_Expr_mutable_struct_expr(google_api_expr_v1alpha1_Expr *msg, upb_arena *arena) {
+ struct google_api_expr_v1alpha1_Expr_CreateStruct* sub = (struct google_api_expr_v1alpha1_Expr_CreateStruct*)google_api_expr_v1alpha1_Expr_struct_expr(msg);
+ if (sub == NULL) {
+ sub = (struct google_api_expr_v1alpha1_Expr_CreateStruct*)_upb_msg_new(&google_api_expr_v1alpha1_Expr_CreateStruct_msginit, arena);
+ if (!sub) return NULL;
+ google_api_expr_v1alpha1_Expr_set_struct_expr(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void google_api_expr_v1alpha1_Expr_set_comprehension_expr(google_api_expr_v1alpha1_Expr *msg, google_api_expr_v1alpha1_Expr_Comprehension* value) {
+ UPB_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Expr_Comprehension*, UPB_SIZE(8, 8), value, UPB_SIZE(12, 16), 9);
+}
+UPB_INLINE struct google_api_expr_v1alpha1_Expr_Comprehension* google_api_expr_v1alpha1_Expr_mutable_comprehension_expr(google_api_expr_v1alpha1_Expr *msg, upb_arena *arena) {
+ struct google_api_expr_v1alpha1_Expr_Comprehension* sub = (struct google_api_expr_v1alpha1_Expr_Comprehension*)google_api_expr_v1alpha1_Expr_comprehension_expr(msg);
+ if (sub == NULL) {
+ sub = (struct google_api_expr_v1alpha1_Expr_Comprehension*)_upb_msg_new(&google_api_expr_v1alpha1_Expr_Comprehension_msginit, arena);
+ if (!sub) return NULL;
+ google_api_expr_v1alpha1_Expr_set_comprehension_expr(msg, sub);
+ }
+ return sub;
+}
+
+/* google.api.expr.v1alpha1.Expr.Ident */
+
+UPB_INLINE google_api_expr_v1alpha1_Expr_Ident *google_api_expr_v1alpha1_Expr_Ident_new(upb_arena *arena) {
+ return (google_api_expr_v1alpha1_Expr_Ident *)_upb_msg_new(&google_api_expr_v1alpha1_Expr_Ident_msginit, arena);
+}
+UPB_INLINE google_api_expr_v1alpha1_Expr_Ident *google_api_expr_v1alpha1_Expr_Ident_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ google_api_expr_v1alpha1_Expr_Ident *ret = google_api_expr_v1alpha1_Expr_Ident_new(arena);
+ return (ret && upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_Ident_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *google_api_expr_v1alpha1_Expr_Ident_serialize(const google_api_expr_v1alpha1_Expr_Ident *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &google_api_expr_v1alpha1_Expr_Ident_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview google_api_expr_v1alpha1_Expr_Ident_name(const google_api_expr_v1alpha1_Expr_Ident *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+
+UPB_INLINE void google_api_expr_v1alpha1_Expr_Ident_set_name(google_api_expr_v1alpha1_Expr_Ident *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+
+/* google.api.expr.v1alpha1.Expr.Select */
+
+UPB_INLINE google_api_expr_v1alpha1_Expr_Select *google_api_expr_v1alpha1_Expr_Select_new(upb_arena *arena) {
+ return (google_api_expr_v1alpha1_Expr_Select *)_upb_msg_new(&google_api_expr_v1alpha1_Expr_Select_msginit, arena);
+}
+UPB_INLINE google_api_expr_v1alpha1_Expr_Select *google_api_expr_v1alpha1_Expr_Select_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ google_api_expr_v1alpha1_Expr_Select *ret = google_api_expr_v1alpha1_Expr_Select_new(arena);
+ return (ret && upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_Select_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *google_api_expr_v1alpha1_Expr_Select_serialize(const google_api_expr_v1alpha1_Expr_Select *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &google_api_expr_v1alpha1_Expr_Select_msginit, arena, len);
+}
+
+UPB_INLINE bool google_api_expr_v1alpha1_Expr_Select_has_operand(const google_api_expr_v1alpha1_Expr_Select *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
+UPB_INLINE const google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_Expr_Select_operand(const google_api_expr_v1alpha1_Expr_Select *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const google_api_expr_v1alpha1_Expr*); }
+UPB_INLINE upb_strview google_api_expr_v1alpha1_Expr_Select_field(const google_api_expr_v1alpha1_Expr_Select *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
+UPB_INLINE bool google_api_expr_v1alpha1_Expr_Select_test_only(const google_api_expr_v1alpha1_Expr_Select *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); }
+
+UPB_INLINE void google_api_expr_v1alpha1_Expr_Select_set_operand(google_api_expr_v1alpha1_Expr_Select *msg, google_api_expr_v1alpha1_Expr* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), google_api_expr_v1alpha1_Expr*) = value;
+}
+UPB_INLINE struct google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_Expr_Select_mutable_operand(google_api_expr_v1alpha1_Expr_Select *msg, upb_arena *arena) {
+ struct google_api_expr_v1alpha1_Expr* sub = (struct google_api_expr_v1alpha1_Expr*)google_api_expr_v1alpha1_Expr_Select_operand(msg);
+ if (sub == NULL) {
+ sub = (struct google_api_expr_v1alpha1_Expr*)_upb_msg_new(&google_api_expr_v1alpha1_Expr_msginit, arena);
+ if (!sub) return NULL;
+ google_api_expr_v1alpha1_Expr_Select_set_operand(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void google_api_expr_v1alpha1_Expr_Select_set_field(google_api_expr_v1alpha1_Expr_Select *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
+}
+UPB_INLINE void google_api_expr_v1alpha1_Expr_Select_set_test_only(google_api_expr_v1alpha1_Expr_Select *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
+}
+
+/* google.api.expr.v1alpha1.Expr.Call */
+
+UPB_INLINE google_api_expr_v1alpha1_Expr_Call *google_api_expr_v1alpha1_Expr_Call_new(upb_arena *arena) {
+ return (google_api_expr_v1alpha1_Expr_Call *)_upb_msg_new(&google_api_expr_v1alpha1_Expr_Call_msginit, arena);
+}
+UPB_INLINE google_api_expr_v1alpha1_Expr_Call *google_api_expr_v1alpha1_Expr_Call_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ google_api_expr_v1alpha1_Expr_Call *ret = google_api_expr_v1alpha1_Expr_Call_new(arena);
+ return (ret && upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_Call_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *google_api_expr_v1alpha1_Expr_Call_serialize(const google_api_expr_v1alpha1_Expr_Call *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &google_api_expr_v1alpha1_Expr_Call_msginit, arena, len);
+}
+
+UPB_INLINE bool google_api_expr_v1alpha1_Expr_Call_has_target(const google_api_expr_v1alpha1_Expr_Call *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
+UPB_INLINE const google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_Expr_Call_target(const google_api_expr_v1alpha1_Expr_Call *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const google_api_expr_v1alpha1_Expr*); }
+UPB_INLINE upb_strview google_api_expr_v1alpha1_Expr_Call_function(const google_api_expr_v1alpha1_Expr_Call *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE bool google_api_expr_v1alpha1_Expr_Call_has_args(const google_api_expr_v1alpha1_Expr_Call *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
+UPB_INLINE const google_api_expr_v1alpha1_Expr* const* google_api_expr_v1alpha1_Expr_Call_args(const google_api_expr_v1alpha1_Expr_Call *msg, size_t *len) { return (const google_api_expr_v1alpha1_Expr* const*)_upb_array_accessor(msg, UPB_SIZE(12, 24), len); }
+
+UPB_INLINE void google_api_expr_v1alpha1_Expr_Call_set_target(google_api_expr_v1alpha1_Expr_Call *msg, google_api_expr_v1alpha1_Expr* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), google_api_expr_v1alpha1_Expr*) = value;
+}
+UPB_INLINE struct google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_Expr_Call_mutable_target(google_api_expr_v1alpha1_Expr_Call *msg, upb_arena *arena) {
+ struct google_api_expr_v1alpha1_Expr* sub = (struct google_api_expr_v1alpha1_Expr*)google_api_expr_v1alpha1_Expr_Call_target(msg);
+ if (sub == NULL) {
+ sub = (struct google_api_expr_v1alpha1_Expr*)_upb_msg_new(&google_api_expr_v1alpha1_Expr_msginit, arena);
+ if (!sub) return NULL;
+ google_api_expr_v1alpha1_Expr_Call_set_target(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void google_api_expr_v1alpha1_Expr_Call_set_function(google_api_expr_v1alpha1_Expr_Call *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+UPB_INLINE google_api_expr_v1alpha1_Expr** google_api_expr_v1alpha1_Expr_Call_mutable_args(google_api_expr_v1alpha1_Expr_Call *msg, size_t *len) {
+ return (google_api_expr_v1alpha1_Expr**)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 24), len);
+}
+UPB_INLINE google_api_expr_v1alpha1_Expr** google_api_expr_v1alpha1_Expr_Call_resize_args(google_api_expr_v1alpha1_Expr_Call *msg, size_t len, upb_arena *arena) {
+ return (google_api_expr_v1alpha1_Expr**)_upb_array_resize_accessor(msg, UPB_SIZE(12, 24), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_Expr_Call_add_args(google_api_expr_v1alpha1_Expr_Call *msg, upb_arena *arena) {
+ struct google_api_expr_v1alpha1_Expr* sub = (struct google_api_expr_v1alpha1_Expr*)_upb_msg_new(&google_api_expr_v1alpha1_Expr_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(12, 24), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+
+/* google.api.expr.v1alpha1.Expr.CreateList */
+
+UPB_INLINE google_api_expr_v1alpha1_Expr_CreateList *google_api_expr_v1alpha1_Expr_CreateList_new(upb_arena *arena) {
+ return (google_api_expr_v1alpha1_Expr_CreateList *)_upb_msg_new(&google_api_expr_v1alpha1_Expr_CreateList_msginit, arena);
+}
+UPB_INLINE google_api_expr_v1alpha1_Expr_CreateList *google_api_expr_v1alpha1_Expr_CreateList_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ google_api_expr_v1alpha1_Expr_CreateList *ret = google_api_expr_v1alpha1_Expr_CreateList_new(arena);
+ return (ret && upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_CreateList_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *google_api_expr_v1alpha1_Expr_CreateList_serialize(const google_api_expr_v1alpha1_Expr_CreateList *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &google_api_expr_v1alpha1_Expr_CreateList_msginit, arena, len);
+}
+
+UPB_INLINE bool google_api_expr_v1alpha1_Expr_CreateList_has_elements(const google_api_expr_v1alpha1_Expr_CreateList *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE const google_api_expr_v1alpha1_Expr* const* google_api_expr_v1alpha1_Expr_CreateList_elements(const google_api_expr_v1alpha1_Expr_CreateList *msg, size_t *len) { return (const google_api_expr_v1alpha1_Expr* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
+
+UPB_INLINE google_api_expr_v1alpha1_Expr** google_api_expr_v1alpha1_Expr_CreateList_mutable_elements(google_api_expr_v1alpha1_Expr_CreateList *msg, size_t *len) {
+ return (google_api_expr_v1alpha1_Expr**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
+}
+UPB_INLINE google_api_expr_v1alpha1_Expr** google_api_expr_v1alpha1_Expr_CreateList_resize_elements(google_api_expr_v1alpha1_Expr_CreateList *msg, size_t len, upb_arena *arena) {
+ return (google_api_expr_v1alpha1_Expr**)_upb_array_resize_accessor(msg, UPB_SIZE(0, 0), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_Expr_CreateList_add_elements(google_api_expr_v1alpha1_Expr_CreateList *msg, upb_arena *arena) {
+ struct google_api_expr_v1alpha1_Expr* sub = (struct google_api_expr_v1alpha1_Expr*)_upb_msg_new(&google_api_expr_v1alpha1_Expr_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(0, 0), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+
+/* google.api.expr.v1alpha1.Expr.CreateStruct */
+
+UPB_INLINE google_api_expr_v1alpha1_Expr_CreateStruct *google_api_expr_v1alpha1_Expr_CreateStruct_new(upb_arena *arena) {
+ return (google_api_expr_v1alpha1_Expr_CreateStruct *)_upb_msg_new(&google_api_expr_v1alpha1_Expr_CreateStruct_msginit, arena);
+}
+UPB_INLINE google_api_expr_v1alpha1_Expr_CreateStruct *google_api_expr_v1alpha1_Expr_CreateStruct_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ google_api_expr_v1alpha1_Expr_CreateStruct *ret = google_api_expr_v1alpha1_Expr_CreateStruct_new(arena);
+ return (ret && upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_CreateStruct_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *google_api_expr_v1alpha1_Expr_CreateStruct_serialize(const google_api_expr_v1alpha1_Expr_CreateStruct *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &google_api_expr_v1alpha1_Expr_CreateStruct_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview google_api_expr_v1alpha1_Expr_CreateStruct_message_name(const google_api_expr_v1alpha1_Expr_CreateStruct *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE bool google_api_expr_v1alpha1_Expr_CreateStruct_has_entries(const google_api_expr_v1alpha1_Expr_CreateStruct *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
+UPB_INLINE const google_api_expr_v1alpha1_Expr_CreateStruct_Entry* const* google_api_expr_v1alpha1_Expr_CreateStruct_entries(const google_api_expr_v1alpha1_Expr_CreateStruct *msg, size_t *len) { return (const google_api_expr_v1alpha1_Expr_CreateStruct_Entry* const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len); }
+
+UPB_INLINE void google_api_expr_v1alpha1_Expr_CreateStruct_set_message_name(google_api_expr_v1alpha1_Expr_CreateStruct *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+UPB_INLINE google_api_expr_v1alpha1_Expr_CreateStruct_Entry** google_api_expr_v1alpha1_Expr_CreateStruct_mutable_entries(google_api_expr_v1alpha1_Expr_CreateStruct *msg, size_t *len) {
+ return (google_api_expr_v1alpha1_Expr_CreateStruct_Entry**)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len);
+}
+UPB_INLINE google_api_expr_v1alpha1_Expr_CreateStruct_Entry** google_api_expr_v1alpha1_Expr_CreateStruct_resize_entries(google_api_expr_v1alpha1_Expr_CreateStruct *msg, size_t len, upb_arena *arena) {
+ return (google_api_expr_v1alpha1_Expr_CreateStruct_Entry**)_upb_array_resize_accessor(msg, UPB_SIZE(8, 16), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct google_api_expr_v1alpha1_Expr_CreateStruct_Entry* google_api_expr_v1alpha1_Expr_CreateStruct_add_entries(google_api_expr_v1alpha1_Expr_CreateStruct *msg, upb_arena *arena) {
+ struct google_api_expr_v1alpha1_Expr_CreateStruct_Entry* sub = (struct google_api_expr_v1alpha1_Expr_CreateStruct_Entry*)_upb_msg_new(&google_api_expr_v1alpha1_Expr_CreateStruct_Entry_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(8, 16), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+
+/* google.api.expr.v1alpha1.Expr.CreateStruct.Entry */
+
+UPB_INLINE google_api_expr_v1alpha1_Expr_CreateStruct_Entry *google_api_expr_v1alpha1_Expr_CreateStruct_Entry_new(upb_arena *arena) {
+ return (google_api_expr_v1alpha1_Expr_CreateStruct_Entry *)_upb_msg_new(&google_api_expr_v1alpha1_Expr_CreateStruct_Entry_msginit, arena);
+}
+UPB_INLINE google_api_expr_v1alpha1_Expr_CreateStruct_Entry *google_api_expr_v1alpha1_Expr_CreateStruct_Entry_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ google_api_expr_v1alpha1_Expr_CreateStruct_Entry *ret = google_api_expr_v1alpha1_Expr_CreateStruct_Entry_new(arena);
+ return (ret && upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_CreateStruct_Entry_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *google_api_expr_v1alpha1_Expr_CreateStruct_Entry_serialize(const google_api_expr_v1alpha1_Expr_CreateStruct_Entry *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &google_api_expr_v1alpha1_Expr_CreateStruct_Entry_msginit, arena, len);
+}
+
+typedef enum {
+ google_api_expr_v1alpha1_Expr_CreateStruct_Entry_key_kind_field_key = 2,
+ google_api_expr_v1alpha1_Expr_CreateStruct_Entry_key_kind_map_key = 3,
+ google_api_expr_v1alpha1_Expr_CreateStruct_Entry_key_kind_NOT_SET = 0
+} google_api_expr_v1alpha1_Expr_CreateStruct_Entry_key_kind_oneofcases;
+UPB_INLINE google_api_expr_v1alpha1_Expr_CreateStruct_Entry_key_kind_oneofcases google_api_expr_v1alpha1_Expr_CreateStruct_Entry_key_kind_case(const google_api_expr_v1alpha1_Expr_CreateStruct_Entry* msg) { return (google_api_expr_v1alpha1_Expr_CreateStruct_Entry_key_kind_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(20, 32), int32_t); }
+
+UPB_INLINE int64_t google_api_expr_v1alpha1_Expr_CreateStruct_Entry_id(const google_api_expr_v1alpha1_Expr_CreateStruct_Entry *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int64_t); }
+UPB_INLINE bool google_api_expr_v1alpha1_Expr_CreateStruct_Entry_has_field_key(const google_api_expr_v1alpha1_Expr_CreateStruct_Entry *msg) { return _upb_getoneofcase(msg, UPB_SIZE(20, 32)) == 2; }
+UPB_INLINE upb_strview google_api_expr_v1alpha1_Expr_CreateStruct_Entry_field_key(const google_api_expr_v1alpha1_Expr_CreateStruct_Entry *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(12, 16), UPB_SIZE(20, 32), 2, upb_strview_make("", strlen(""))); }
+UPB_INLINE bool google_api_expr_v1alpha1_Expr_CreateStruct_Entry_has_map_key(const google_api_expr_v1alpha1_Expr_CreateStruct_Entry *msg) { return _upb_getoneofcase(msg, UPB_SIZE(20, 32)) == 3; }
+UPB_INLINE const google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_Expr_CreateStruct_Entry_map_key(const google_api_expr_v1alpha1_Expr_CreateStruct_Entry *msg) { return UPB_READ_ONEOF(msg, const google_api_expr_v1alpha1_Expr*, UPB_SIZE(12, 16), UPB_SIZE(20, 32), 3, NULL); }
+UPB_INLINE bool google_api_expr_v1alpha1_Expr_CreateStruct_Entry_has_value(const google_api_expr_v1alpha1_Expr_CreateStruct_Entry *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 8)); }
+UPB_INLINE const google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_Expr_CreateStruct_Entry_value(const google_api_expr_v1alpha1_Expr_CreateStruct_Entry *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const google_api_expr_v1alpha1_Expr*); }
+
+UPB_INLINE void google_api_expr_v1alpha1_Expr_CreateStruct_Entry_set_id(google_api_expr_v1alpha1_Expr_CreateStruct_Entry *msg, int64_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int64_t) = value;
+}
+UPB_INLINE void google_api_expr_v1alpha1_Expr_CreateStruct_Entry_set_field_key(google_api_expr_v1alpha1_Expr_CreateStruct_Entry *msg, upb_strview value) {
+ UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(12, 16), value, UPB_SIZE(20, 32), 2);
+}
+UPB_INLINE void google_api_expr_v1alpha1_Expr_CreateStruct_Entry_set_map_key(google_api_expr_v1alpha1_Expr_CreateStruct_Entry *msg, google_api_expr_v1alpha1_Expr* value) {
+ UPB_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Expr*, UPB_SIZE(12, 16), value, UPB_SIZE(20, 32), 3);
+}
+UPB_INLINE struct google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_Expr_CreateStruct_Entry_mutable_map_key(google_api_expr_v1alpha1_Expr_CreateStruct_Entry *msg, upb_arena *arena) {
+ struct google_api_expr_v1alpha1_Expr* sub = (struct google_api_expr_v1alpha1_Expr*)google_api_expr_v1alpha1_Expr_CreateStruct_Entry_map_key(msg);
+ if (sub == NULL) {
+ sub = (struct google_api_expr_v1alpha1_Expr*)_upb_msg_new(&google_api_expr_v1alpha1_Expr_msginit, arena);
+ if (!sub) return NULL;
+ google_api_expr_v1alpha1_Expr_CreateStruct_Entry_set_map_key(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void google_api_expr_v1alpha1_Expr_CreateStruct_Entry_set_value(google_api_expr_v1alpha1_Expr_CreateStruct_Entry *msg, google_api_expr_v1alpha1_Expr* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), google_api_expr_v1alpha1_Expr*) = value;
+}
+UPB_INLINE struct google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_Expr_CreateStruct_Entry_mutable_value(google_api_expr_v1alpha1_Expr_CreateStruct_Entry *msg, upb_arena *arena) {
+ struct google_api_expr_v1alpha1_Expr* sub = (struct google_api_expr_v1alpha1_Expr*)google_api_expr_v1alpha1_Expr_CreateStruct_Entry_value(msg);
+ if (sub == NULL) {
+ sub = (struct google_api_expr_v1alpha1_Expr*)_upb_msg_new(&google_api_expr_v1alpha1_Expr_msginit, arena);
+ if (!sub) return NULL;
+ google_api_expr_v1alpha1_Expr_CreateStruct_Entry_set_value(msg, sub);
+ }
+ return sub;
+}
+
+/* google.api.expr.v1alpha1.Expr.Comprehension */
+
+UPB_INLINE google_api_expr_v1alpha1_Expr_Comprehension *google_api_expr_v1alpha1_Expr_Comprehension_new(upb_arena *arena) {
+ return (google_api_expr_v1alpha1_Expr_Comprehension *)_upb_msg_new(&google_api_expr_v1alpha1_Expr_Comprehension_msginit, arena);
+}
+UPB_INLINE google_api_expr_v1alpha1_Expr_Comprehension *google_api_expr_v1alpha1_Expr_Comprehension_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ google_api_expr_v1alpha1_Expr_Comprehension *ret = google_api_expr_v1alpha1_Expr_Comprehension_new(arena);
+ return (ret && upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_Comprehension_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *google_api_expr_v1alpha1_Expr_Comprehension_serialize(const google_api_expr_v1alpha1_Expr_Comprehension *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &google_api_expr_v1alpha1_Expr_Comprehension_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview google_api_expr_v1alpha1_Expr_Comprehension_iter_var(const google_api_expr_v1alpha1_Expr_Comprehension *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE bool google_api_expr_v1alpha1_Expr_Comprehension_has_iter_range(const google_api_expr_v1alpha1_Expr_Comprehension *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); }
+UPB_INLINE const google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_Expr_Comprehension_iter_range(const google_api_expr_v1alpha1_Expr_Comprehension *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const google_api_expr_v1alpha1_Expr*); }
+UPB_INLINE upb_strview google_api_expr_v1alpha1_Expr_Comprehension_accu_var(const google_api_expr_v1alpha1_Expr_Comprehension *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview); }
+UPB_INLINE bool google_api_expr_v1alpha1_Expr_Comprehension_has_accu_init(const google_api_expr_v1alpha1_Expr_Comprehension *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 40)); }
+UPB_INLINE const google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_Expr_Comprehension_accu_init(const google_api_expr_v1alpha1_Expr_Comprehension *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const google_api_expr_v1alpha1_Expr*); }
+UPB_INLINE bool google_api_expr_v1alpha1_Expr_Comprehension_has_loop_condition(const google_api_expr_v1alpha1_Expr_Comprehension *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 48)); }
+UPB_INLINE const google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_Expr_Comprehension_loop_condition(const google_api_expr_v1alpha1_Expr_Comprehension *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 48), const google_api_expr_v1alpha1_Expr*); }
+UPB_INLINE bool google_api_expr_v1alpha1_Expr_Comprehension_has_loop_step(const google_api_expr_v1alpha1_Expr_Comprehension *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 56)); }
+UPB_INLINE const google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_Expr_Comprehension_loop_step(const google_api_expr_v1alpha1_Expr_Comprehension *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 56), const google_api_expr_v1alpha1_Expr*); }
+UPB_INLINE bool google_api_expr_v1alpha1_Expr_Comprehension_has_result(const google_api_expr_v1alpha1_Expr_Comprehension *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(32, 64)); }
+UPB_INLINE const google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_Expr_Comprehension_result(const google_api_expr_v1alpha1_Expr_Comprehension *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 64), const google_api_expr_v1alpha1_Expr*); }
+
+UPB_INLINE void google_api_expr_v1alpha1_Expr_Comprehension_set_iter_var(google_api_expr_v1alpha1_Expr_Comprehension *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+UPB_INLINE void google_api_expr_v1alpha1_Expr_Comprehension_set_iter_range(google_api_expr_v1alpha1_Expr_Comprehension *msg, google_api_expr_v1alpha1_Expr* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), google_api_expr_v1alpha1_Expr*) = value;
+}
+UPB_INLINE struct google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_Expr_Comprehension_mutable_iter_range(google_api_expr_v1alpha1_Expr_Comprehension *msg, upb_arena *arena) {
+ struct google_api_expr_v1alpha1_Expr* sub = (struct google_api_expr_v1alpha1_Expr*)google_api_expr_v1alpha1_Expr_Comprehension_iter_range(msg);
+ if (sub == NULL) {
+ sub = (struct google_api_expr_v1alpha1_Expr*)_upb_msg_new(&google_api_expr_v1alpha1_Expr_msginit, arena);
+ if (!sub) return NULL;
+ google_api_expr_v1alpha1_Expr_Comprehension_set_iter_range(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void google_api_expr_v1alpha1_Expr_Comprehension_set_accu_var(google_api_expr_v1alpha1_Expr_Comprehension *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview) = value;
+}
+UPB_INLINE void google_api_expr_v1alpha1_Expr_Comprehension_set_accu_init(google_api_expr_v1alpha1_Expr_Comprehension *msg, google_api_expr_v1alpha1_Expr* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 40), google_api_expr_v1alpha1_Expr*) = value;
+}
+UPB_INLINE struct google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_Expr_Comprehension_mutable_accu_init(google_api_expr_v1alpha1_Expr_Comprehension *msg, upb_arena *arena) {
+ struct google_api_expr_v1alpha1_Expr* sub = (struct google_api_expr_v1alpha1_Expr*)google_api_expr_v1alpha1_Expr_Comprehension_accu_init(msg);
+ if (sub == NULL) {
+ sub = (struct google_api_expr_v1alpha1_Expr*)_upb_msg_new(&google_api_expr_v1alpha1_Expr_msginit, arena);
+ if (!sub) return NULL;
+ google_api_expr_v1alpha1_Expr_Comprehension_set_accu_init(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void google_api_expr_v1alpha1_Expr_Comprehension_set_loop_condition(google_api_expr_v1alpha1_Expr_Comprehension *msg, google_api_expr_v1alpha1_Expr* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 48), google_api_expr_v1alpha1_Expr*) = value;
+}
+UPB_INLINE struct google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_Expr_Comprehension_mutable_loop_condition(google_api_expr_v1alpha1_Expr_Comprehension *msg, upb_arena *arena) {
+ struct google_api_expr_v1alpha1_Expr* sub = (struct google_api_expr_v1alpha1_Expr*)google_api_expr_v1alpha1_Expr_Comprehension_loop_condition(msg);
+ if (sub == NULL) {
+ sub = (struct google_api_expr_v1alpha1_Expr*)_upb_msg_new(&google_api_expr_v1alpha1_Expr_msginit, arena);
+ if (!sub) return NULL;
+ google_api_expr_v1alpha1_Expr_Comprehension_set_loop_condition(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void google_api_expr_v1alpha1_Expr_Comprehension_set_loop_step(google_api_expr_v1alpha1_Expr_Comprehension *msg, google_api_expr_v1alpha1_Expr* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 56), google_api_expr_v1alpha1_Expr*) = value;
+}
+UPB_INLINE struct google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_Expr_Comprehension_mutable_loop_step(google_api_expr_v1alpha1_Expr_Comprehension *msg, upb_arena *arena) {
+ struct google_api_expr_v1alpha1_Expr* sub = (struct google_api_expr_v1alpha1_Expr*)google_api_expr_v1alpha1_Expr_Comprehension_loop_step(msg);
+ if (sub == NULL) {
+ sub = (struct google_api_expr_v1alpha1_Expr*)_upb_msg_new(&google_api_expr_v1alpha1_Expr_msginit, arena);
+ if (!sub) return NULL;
+ google_api_expr_v1alpha1_Expr_Comprehension_set_loop_step(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void google_api_expr_v1alpha1_Expr_Comprehension_set_result(google_api_expr_v1alpha1_Expr_Comprehension *msg, google_api_expr_v1alpha1_Expr* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 64), google_api_expr_v1alpha1_Expr*) = value;
+}
+UPB_INLINE struct google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_Expr_Comprehension_mutable_result(google_api_expr_v1alpha1_Expr_Comprehension *msg, upb_arena *arena) {
+ struct google_api_expr_v1alpha1_Expr* sub = (struct google_api_expr_v1alpha1_Expr*)google_api_expr_v1alpha1_Expr_Comprehension_result(msg);
+ if (sub == NULL) {
+ sub = (struct google_api_expr_v1alpha1_Expr*)_upb_msg_new(&google_api_expr_v1alpha1_Expr_msginit, arena);
+ if (!sub) return NULL;
+ google_api_expr_v1alpha1_Expr_Comprehension_set_result(msg, sub);
+ }
+ return sub;
+}
+
+/* google.api.expr.v1alpha1.Constant */
+
+UPB_INLINE google_api_expr_v1alpha1_Constant *google_api_expr_v1alpha1_Constant_new(upb_arena *arena) {
+ return (google_api_expr_v1alpha1_Constant *)_upb_msg_new(&google_api_expr_v1alpha1_Constant_msginit, arena);
+}
+UPB_INLINE google_api_expr_v1alpha1_Constant *google_api_expr_v1alpha1_Constant_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ google_api_expr_v1alpha1_Constant *ret = google_api_expr_v1alpha1_Constant_new(arena);
+ return (ret && upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Constant_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *google_api_expr_v1alpha1_Constant_serialize(const google_api_expr_v1alpha1_Constant *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &google_api_expr_v1alpha1_Constant_msginit, arena, len);
+}
+
+typedef enum {
+ google_api_expr_v1alpha1_Constant_constant_kind_null_value = 1,
+ google_api_expr_v1alpha1_Constant_constant_kind_bool_value = 2,
+ google_api_expr_v1alpha1_Constant_constant_kind_int64_value = 3,
+ google_api_expr_v1alpha1_Constant_constant_kind_uint64_value = 4,
+ google_api_expr_v1alpha1_Constant_constant_kind_double_value = 5,
+ google_api_expr_v1alpha1_Constant_constant_kind_string_value = 6,
+ google_api_expr_v1alpha1_Constant_constant_kind_bytes_value = 7,
+ google_api_expr_v1alpha1_Constant_constant_kind_duration_value = 8,
+ google_api_expr_v1alpha1_Constant_constant_kind_timestamp_value = 9,
+ google_api_expr_v1alpha1_Constant_constant_kind_NOT_SET = 0
+} google_api_expr_v1alpha1_Constant_constant_kind_oneofcases;
+UPB_INLINE google_api_expr_v1alpha1_Constant_constant_kind_oneofcases google_api_expr_v1alpha1_Constant_constant_kind_case(const google_api_expr_v1alpha1_Constant* msg) { return (google_api_expr_v1alpha1_Constant_constant_kind_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(8, 16), int32_t); }
+
+UPB_INLINE bool google_api_expr_v1alpha1_Constant_has_null_value(const google_api_expr_v1alpha1_Constant *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 1; }
+UPB_INLINE int32_t google_api_expr_v1alpha1_Constant_null_value(const google_api_expr_v1alpha1_Constant *msg) { return UPB_READ_ONEOF(msg, int32_t, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 1, 0); }
+UPB_INLINE bool google_api_expr_v1alpha1_Constant_has_bool_value(const google_api_expr_v1alpha1_Constant *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 2; }
+UPB_INLINE bool google_api_expr_v1alpha1_Constant_bool_value(const google_api_expr_v1alpha1_Constant *msg) { return UPB_READ_ONEOF(msg, bool, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 2, false); }
+UPB_INLINE bool google_api_expr_v1alpha1_Constant_has_int64_value(const google_api_expr_v1alpha1_Constant *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 3; }
+UPB_INLINE int64_t google_api_expr_v1alpha1_Constant_int64_value(const google_api_expr_v1alpha1_Constant *msg) { return UPB_READ_ONEOF(msg, int64_t, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 3, 0); }
+UPB_INLINE bool google_api_expr_v1alpha1_Constant_has_uint64_value(const google_api_expr_v1alpha1_Constant *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 4; }
+UPB_INLINE uint64_t google_api_expr_v1alpha1_Constant_uint64_value(const google_api_expr_v1alpha1_Constant *msg) { return UPB_READ_ONEOF(msg, uint64_t, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 4, 0); }
+UPB_INLINE bool google_api_expr_v1alpha1_Constant_has_double_value(const google_api_expr_v1alpha1_Constant *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 5; }
+UPB_INLINE double google_api_expr_v1alpha1_Constant_double_value(const google_api_expr_v1alpha1_Constant *msg) { return UPB_READ_ONEOF(msg, double, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 5, 0); }
+UPB_INLINE bool google_api_expr_v1alpha1_Constant_has_string_value(const google_api_expr_v1alpha1_Constant *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 6; }
+UPB_INLINE upb_strview google_api_expr_v1alpha1_Constant_string_value(const google_api_expr_v1alpha1_Constant *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 6, upb_strview_make("", strlen(""))); }
+UPB_INLINE bool google_api_expr_v1alpha1_Constant_has_bytes_value(const google_api_expr_v1alpha1_Constant *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 7; }
+UPB_INLINE upb_strview google_api_expr_v1alpha1_Constant_bytes_value(const google_api_expr_v1alpha1_Constant *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 7, upb_strview_make("", strlen(""))); }
+UPB_INLINE bool google_api_expr_v1alpha1_Constant_has_duration_value(const google_api_expr_v1alpha1_Constant *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 8; }
+UPB_INLINE const struct google_protobuf_Duration* google_api_expr_v1alpha1_Constant_duration_value(const google_api_expr_v1alpha1_Constant *msg) { return UPB_READ_ONEOF(msg, const struct google_protobuf_Duration*, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 8, NULL); }
+UPB_INLINE bool google_api_expr_v1alpha1_Constant_has_timestamp_value(const google_api_expr_v1alpha1_Constant *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 9; }
+UPB_INLINE const struct google_protobuf_Timestamp* google_api_expr_v1alpha1_Constant_timestamp_value(const google_api_expr_v1alpha1_Constant *msg) { return UPB_READ_ONEOF(msg, const struct google_protobuf_Timestamp*, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 9, NULL); }
+
+UPB_INLINE void google_api_expr_v1alpha1_Constant_set_null_value(google_api_expr_v1alpha1_Constant *msg, int32_t value) {
+ UPB_WRITE_ONEOF(msg, int32_t, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 1);
+}
+UPB_INLINE void google_api_expr_v1alpha1_Constant_set_bool_value(google_api_expr_v1alpha1_Constant *msg, bool value) {
+ UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 2);
+}
+UPB_INLINE void google_api_expr_v1alpha1_Constant_set_int64_value(google_api_expr_v1alpha1_Constant *msg, int64_t value) {
+ UPB_WRITE_ONEOF(msg, int64_t, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 3);
+}
+UPB_INLINE void google_api_expr_v1alpha1_Constant_set_uint64_value(google_api_expr_v1alpha1_Constant *msg, uint64_t value) {
+ UPB_WRITE_ONEOF(msg, uint64_t, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 4);
+}
+UPB_INLINE void google_api_expr_v1alpha1_Constant_set_double_value(google_api_expr_v1alpha1_Constant *msg, double value) {
+ UPB_WRITE_ONEOF(msg, double, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 5);
+}
+UPB_INLINE void google_api_expr_v1alpha1_Constant_set_string_value(google_api_expr_v1alpha1_Constant *msg, upb_strview value) {
+ UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 6);
+}
+UPB_INLINE void google_api_expr_v1alpha1_Constant_set_bytes_value(google_api_expr_v1alpha1_Constant *msg, upb_strview value) {
+ UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 7);
+}
+UPB_INLINE void google_api_expr_v1alpha1_Constant_set_duration_value(google_api_expr_v1alpha1_Constant *msg, struct google_protobuf_Duration* value) {
+ UPB_WRITE_ONEOF(msg, struct google_protobuf_Duration*, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 8);
+}
+UPB_INLINE struct google_protobuf_Duration* google_api_expr_v1alpha1_Constant_mutable_duration_value(google_api_expr_v1alpha1_Constant *msg, upb_arena *arena) {
+ struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)google_api_expr_v1alpha1_Constant_duration_value(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
+ if (!sub) return NULL;
+ google_api_expr_v1alpha1_Constant_set_duration_value(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void google_api_expr_v1alpha1_Constant_set_timestamp_value(google_api_expr_v1alpha1_Constant *msg, struct google_protobuf_Timestamp* value) {
+ UPB_WRITE_ONEOF(msg, struct google_protobuf_Timestamp*, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 9);
+}
+UPB_INLINE struct google_protobuf_Timestamp* google_api_expr_v1alpha1_Constant_mutable_timestamp_value(google_api_expr_v1alpha1_Constant *msg, upb_arena *arena) {
+ struct google_protobuf_Timestamp* sub = (struct google_protobuf_Timestamp*)google_api_expr_v1alpha1_Constant_timestamp_value(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Timestamp*)_upb_msg_new(&google_protobuf_Timestamp_msginit, arena);
+ if (!sub) return NULL;
+ google_api_expr_v1alpha1_Constant_set_timestamp_value(msg, sub);
+ }
+ return sub;
+}
+
+/* google.api.expr.v1alpha1.SourceInfo */
+
+UPB_INLINE google_api_expr_v1alpha1_SourceInfo *google_api_expr_v1alpha1_SourceInfo_new(upb_arena *arena) {
+ return (google_api_expr_v1alpha1_SourceInfo *)_upb_msg_new(&google_api_expr_v1alpha1_SourceInfo_msginit, arena);
+}
+UPB_INLINE google_api_expr_v1alpha1_SourceInfo *google_api_expr_v1alpha1_SourceInfo_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ google_api_expr_v1alpha1_SourceInfo *ret = google_api_expr_v1alpha1_SourceInfo_new(arena);
+ return (ret && upb_decode(buf, size, ret, &google_api_expr_v1alpha1_SourceInfo_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *google_api_expr_v1alpha1_SourceInfo_serialize(const google_api_expr_v1alpha1_SourceInfo *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &google_api_expr_v1alpha1_SourceInfo_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview google_api_expr_v1alpha1_SourceInfo_syntax_version(const google_api_expr_v1alpha1_SourceInfo *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE upb_strview google_api_expr_v1alpha1_SourceInfo_location(const google_api_expr_v1alpha1_SourceInfo *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview); }
+UPB_INLINE int32_t const* google_api_expr_v1alpha1_SourceInfo_line_offsets(const google_api_expr_v1alpha1_SourceInfo *msg, size_t *len) { return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(16, 32), len); }
+UPB_INLINE bool google_api_expr_v1alpha1_SourceInfo_has_positions(const google_api_expr_v1alpha1_SourceInfo *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 40)); }
+UPB_INLINE size_t google_api_expr_v1alpha1_SourceInfo_positions_size(const google_api_expr_v1alpha1_SourceInfo *msg) {return _upb_msg_map_size(msg, UPB_SIZE(20, 40)); }
+UPB_INLINE bool google_api_expr_v1alpha1_SourceInfo_positions_get(const google_api_expr_v1alpha1_SourceInfo *msg, int64_t key, int32_t *val) { return _upb_msg_map_get(msg, UPB_SIZE(20, 40), &key, sizeof(key), val, sizeof(*val)); }
+UPB_INLINE const google_api_expr_v1alpha1_SourceInfo_PositionsEntry* google_api_expr_v1alpha1_SourceInfo_positions_next(const google_api_expr_v1alpha1_SourceInfo *msg, size_t* iter) { return (const google_api_expr_v1alpha1_SourceInfo_PositionsEntry*)_upb_msg_map_next(msg, UPB_SIZE(20, 40), iter); }
+
+UPB_INLINE void google_api_expr_v1alpha1_SourceInfo_set_syntax_version(google_api_expr_v1alpha1_SourceInfo *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+UPB_INLINE void google_api_expr_v1alpha1_SourceInfo_set_location(google_api_expr_v1alpha1_SourceInfo *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview) = value;
+}
+UPB_INLINE int32_t* google_api_expr_v1alpha1_SourceInfo_mutable_line_offsets(google_api_expr_v1alpha1_SourceInfo *msg, size_t *len) {
+ return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 32), len);
+}
+UPB_INLINE int32_t* google_api_expr_v1alpha1_SourceInfo_resize_line_offsets(google_api_expr_v1alpha1_SourceInfo *msg, size_t len, upb_arena *arena) {
+ return (int32_t*)_upb_array_resize_accessor(msg, UPB_SIZE(16, 32), len, UPB_TYPE_INT32, arena);
+}
+UPB_INLINE bool google_api_expr_v1alpha1_SourceInfo_add_line_offsets(google_api_expr_v1alpha1_SourceInfo *msg, int32_t val, upb_arena *arena) {
+ return _upb_array_append_accessor(msg, UPB_SIZE(16, 32), UPB_SIZE(4, 4), UPB_TYPE_INT32, &val,
+ arena);
+}
+UPB_INLINE void google_api_expr_v1alpha1_SourceInfo_positions_clear(google_api_expr_v1alpha1_SourceInfo *msg) { _upb_msg_map_clear(msg, UPB_SIZE(20, 40)); }
+UPB_INLINE bool google_api_expr_v1alpha1_SourceInfo_positions_set(google_api_expr_v1alpha1_SourceInfo *msg, int64_t key, int32_t val, upb_arena *a) { return _upb_msg_map_set(msg, UPB_SIZE(20, 40), &key, sizeof(key), &val, sizeof(val), a); }
+UPB_INLINE bool google_api_expr_v1alpha1_SourceInfo_positions_delete(google_api_expr_v1alpha1_SourceInfo *msg, int64_t key) { return _upb_msg_map_delete(msg, UPB_SIZE(20, 40), &key, sizeof(key)); }
+UPB_INLINE google_api_expr_v1alpha1_SourceInfo_PositionsEntry* google_api_expr_v1alpha1_SourceInfo_positions_nextmutable(google_api_expr_v1alpha1_SourceInfo *msg, size_t* iter) { return (google_api_expr_v1alpha1_SourceInfo_PositionsEntry*)_upb_msg_map_next(msg, UPB_SIZE(20, 40), iter); }
+
+/* google.api.expr.v1alpha1.SourceInfo.PositionsEntry */
+
+UPB_INLINE int64_t google_api_expr_v1alpha1_SourceInfo_PositionsEntry_key(const google_api_expr_v1alpha1_SourceInfo_PositionsEntry *msg) {
+ int64_t ret;
+ _upb_msg_map_key(msg, &ret, sizeof(ret));
+ return ret;
+}
+UPB_INLINE int32_t google_api_expr_v1alpha1_SourceInfo_PositionsEntry_value(const google_api_expr_v1alpha1_SourceInfo_PositionsEntry *msg) {
+ int32_t ret;
+ _upb_msg_map_value(msg, &ret, sizeof(ret));
+ return ret;
+}
+
+UPB_INLINE void google_api_expr_v1alpha1_SourceInfo_PositionsEntry_set_value(google_api_expr_v1alpha1_SourceInfo_PositionsEntry *msg, int32_t value) {
+ _upb_msg_map_set_value(msg, &value, sizeof(int32_t));
+}
+
+/* google.api.expr.v1alpha1.SourcePosition */
+
+UPB_INLINE google_api_expr_v1alpha1_SourcePosition *google_api_expr_v1alpha1_SourcePosition_new(upb_arena *arena) {
+ return (google_api_expr_v1alpha1_SourcePosition *)_upb_msg_new(&google_api_expr_v1alpha1_SourcePosition_msginit, arena);
+}
+UPB_INLINE google_api_expr_v1alpha1_SourcePosition *google_api_expr_v1alpha1_SourcePosition_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ google_api_expr_v1alpha1_SourcePosition *ret = google_api_expr_v1alpha1_SourcePosition_new(arena);
+ return (ret && upb_decode(buf, size, ret, &google_api_expr_v1alpha1_SourcePosition_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *google_api_expr_v1alpha1_SourcePosition_serialize(const google_api_expr_v1alpha1_SourcePosition *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &google_api_expr_v1alpha1_SourcePosition_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview google_api_expr_v1alpha1_SourcePosition_location(const google_api_expr_v1alpha1_SourcePosition *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 16), upb_strview); }
+UPB_INLINE int32_t google_api_expr_v1alpha1_SourcePosition_offset(const google_api_expr_v1alpha1_SourcePosition *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
+UPB_INLINE int32_t google_api_expr_v1alpha1_SourcePosition_line(const google_api_expr_v1alpha1_SourcePosition *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); }
+UPB_INLINE int32_t google_api_expr_v1alpha1_SourcePosition_column(const google_api_expr_v1alpha1_SourcePosition *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); }
+
+UPB_INLINE void google_api_expr_v1alpha1_SourcePosition_set_location(google_api_expr_v1alpha1_SourcePosition *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 16), upb_strview) = value;
+}
+UPB_INLINE void google_api_expr_v1alpha1_SourcePosition_set_offset(google_api_expr_v1alpha1_SourcePosition *msg, int32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
+}
+UPB_INLINE void google_api_expr_v1alpha1_SourcePosition_set_line(google_api_expr_v1alpha1_SourcePosition *msg, int32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value;
+}
+UPB_INLINE void google_api_expr_v1alpha1_SourcePosition_set_column(google_api_expr_v1alpha1_SourcePosition *msg, int32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* GOOGLE_API_EXPR_V1ALPHA1_SYNTAX_PROTO_UPB_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/google/api/http.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/google/api/http.upb.h
index ab4d6daa628..9012b9f7482 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/google/api/http.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/google/api/http.upb.h
@@ -33,7 +33,7 @@ extern const upb_msglayout google_api_CustomHttpPattern_msginit;
/* google.api.Http */
UPB_INLINE google_api_Http *google_api_Http_new(upb_arena *arena) {
- return (google_api_Http *)_upb_msg_new(&google_api_Http_msginit, arena);
+ return (google_api_Http *)_upb_msg_new(&google_api_Http_msginit, arena);
}
UPB_INLINE google_api_Http *google_api_Http_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -44,31 +44,31 @@ UPB_INLINE char *google_api_Http_serialize(const google_api_Http *msg, upb_arena
return upb_encode(msg, &google_api_Http_msginit, arena, len);
}
-UPB_INLINE bool google_api_Http_has_rules(const google_api_Http *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
+UPB_INLINE bool google_api_Http_has_rules(const google_api_Http *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
UPB_INLINE const google_api_HttpRule* const* google_api_Http_rules(const google_api_Http *msg, size_t *len) { return (const google_api_HttpRule* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len); }
-UPB_INLINE bool google_api_Http_fully_decode_reserved_expansion(const google_api_Http *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); }
+UPB_INLINE bool google_api_Http_fully_decode_reserved_expansion(const google_api_Http *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); }
UPB_INLINE google_api_HttpRule** google_api_Http_mutable_rules(google_api_Http *msg, size_t *len) {
return (google_api_HttpRule**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len);
}
UPB_INLINE google_api_HttpRule** google_api_Http_resize_rules(google_api_Http *msg, size_t len, upb_arena *arena) {
- return (google_api_HttpRule**)_upb_array_resize_accessor(msg, UPB_SIZE(4, 8), len, UPB_TYPE_MESSAGE, arena);
+ return (google_api_HttpRule**)_upb_array_resize_accessor(msg, UPB_SIZE(4, 8), len, UPB_TYPE_MESSAGE, arena);
}
UPB_INLINE struct google_api_HttpRule* google_api_Http_add_rules(google_api_Http *msg, upb_arena *arena) {
- struct google_api_HttpRule* sub = (struct google_api_HttpRule*)_upb_msg_new(&google_api_HttpRule_msginit, arena);
+ struct google_api_HttpRule* sub = (struct google_api_HttpRule*)_upb_msg_new(&google_api_HttpRule_msginit, arena);
bool ok = _upb_array_append_accessor(
msg, UPB_SIZE(4, 8), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
if (!ok) return NULL;
return sub;
}
UPB_INLINE void google_api_Http_set_fully_decode_reserved_expansion(google_api_Http *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
}
/* google.api.HttpRule */
UPB_INLINE google_api_HttpRule *google_api_HttpRule_new(upb_arena *arena) {
- return (google_api_HttpRule *)_upb_msg_new(&google_api_HttpRule_msginit, arena);
+ return (google_api_HttpRule *)_upb_msg_new(&google_api_HttpRule_msginit, arena);
}
UPB_INLINE google_api_HttpRule *google_api_HttpRule_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -88,28 +88,28 @@ typedef enum {
google_api_HttpRule_pattern_custom = 8,
google_api_HttpRule_pattern_NOT_SET = 0
} google_api_HttpRule_pattern_oneofcases;
-UPB_INLINE google_api_HttpRule_pattern_oneofcases google_api_HttpRule_pattern_case(const google_api_HttpRule* msg) { return (google_api_HttpRule_pattern_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(36, 72), int32_t); }
+UPB_INLINE google_api_HttpRule_pattern_oneofcases google_api_HttpRule_pattern_case(const google_api_HttpRule* msg) { return (google_api_HttpRule_pattern_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(36, 72), int32_t); }
-UPB_INLINE upb_strview google_api_HttpRule_selector(const google_api_HttpRule *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE bool google_api_HttpRule_has_get(const google_api_HttpRule *msg) { return _upb_getoneofcase(msg, UPB_SIZE(36, 72)) == 2; }
+UPB_INLINE upb_strview google_api_HttpRule_selector(const google_api_HttpRule *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE bool google_api_HttpRule_has_get(const google_api_HttpRule *msg) { return _upb_getoneofcase(msg, UPB_SIZE(36, 72)) == 2; }
UPB_INLINE upb_strview google_api_HttpRule_get(const google_api_HttpRule *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(28, 56), UPB_SIZE(36, 72), 2, upb_strview_make("", strlen(""))); }
-UPB_INLINE bool google_api_HttpRule_has_put(const google_api_HttpRule *msg) { return _upb_getoneofcase(msg, UPB_SIZE(36, 72)) == 3; }
+UPB_INLINE bool google_api_HttpRule_has_put(const google_api_HttpRule *msg) { return _upb_getoneofcase(msg, UPB_SIZE(36, 72)) == 3; }
UPB_INLINE upb_strview google_api_HttpRule_put(const google_api_HttpRule *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(28, 56), UPB_SIZE(36, 72), 3, upb_strview_make("", strlen(""))); }
-UPB_INLINE bool google_api_HttpRule_has_post(const google_api_HttpRule *msg) { return _upb_getoneofcase(msg, UPB_SIZE(36, 72)) == 4; }
+UPB_INLINE bool google_api_HttpRule_has_post(const google_api_HttpRule *msg) { return _upb_getoneofcase(msg, UPB_SIZE(36, 72)) == 4; }
UPB_INLINE upb_strview google_api_HttpRule_post(const google_api_HttpRule *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(28, 56), UPB_SIZE(36, 72), 4, upb_strview_make("", strlen(""))); }
-UPB_INLINE bool google_api_HttpRule_has_delete(const google_api_HttpRule *msg) { return _upb_getoneofcase(msg, UPB_SIZE(36, 72)) == 5; }
+UPB_INLINE bool google_api_HttpRule_has_delete(const google_api_HttpRule *msg) { return _upb_getoneofcase(msg, UPB_SIZE(36, 72)) == 5; }
UPB_INLINE upb_strview google_api_HttpRule_delete(const google_api_HttpRule *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(28, 56), UPB_SIZE(36, 72), 5, upb_strview_make("", strlen(""))); }
-UPB_INLINE bool google_api_HttpRule_has_patch(const google_api_HttpRule *msg) { return _upb_getoneofcase(msg, UPB_SIZE(36, 72)) == 6; }
+UPB_INLINE bool google_api_HttpRule_has_patch(const google_api_HttpRule *msg) { return _upb_getoneofcase(msg, UPB_SIZE(36, 72)) == 6; }
UPB_INLINE upb_strview google_api_HttpRule_patch(const google_api_HttpRule *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(28, 56), UPB_SIZE(36, 72), 6, upb_strview_make("", strlen(""))); }
-UPB_INLINE upb_strview google_api_HttpRule_body(const google_api_HttpRule *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview); }
-UPB_INLINE bool google_api_HttpRule_has_custom(const google_api_HttpRule *msg) { return _upb_getoneofcase(msg, UPB_SIZE(36, 72)) == 8; }
+UPB_INLINE upb_strview google_api_HttpRule_body(const google_api_HttpRule *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview); }
+UPB_INLINE bool google_api_HttpRule_has_custom(const google_api_HttpRule *msg) { return _upb_getoneofcase(msg, UPB_SIZE(36, 72)) == 8; }
UPB_INLINE const google_api_CustomHttpPattern* google_api_HttpRule_custom(const google_api_HttpRule *msg) { return UPB_READ_ONEOF(msg, const google_api_CustomHttpPattern*, UPB_SIZE(28, 56), UPB_SIZE(36, 72), 8, NULL); }
-UPB_INLINE bool google_api_HttpRule_has_additional_bindings(const google_api_HttpRule *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 48)); }
+UPB_INLINE bool google_api_HttpRule_has_additional_bindings(const google_api_HttpRule *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 48)); }
UPB_INLINE const google_api_HttpRule* const* google_api_HttpRule_additional_bindings(const google_api_HttpRule *msg, size_t *len) { return (const google_api_HttpRule* const*)_upb_array_accessor(msg, UPB_SIZE(24, 48), len); }
-UPB_INLINE upb_strview google_api_HttpRule_response_body(const google_api_HttpRule *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_strview); }
+UPB_INLINE upb_strview google_api_HttpRule_response_body(const google_api_HttpRule *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_strview); }
UPB_INLINE void google_api_HttpRule_set_selector(google_api_HttpRule *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
}
UPB_INLINE void google_api_HttpRule_set_get(google_api_HttpRule *msg, upb_strview value) {
UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(28, 56), value, UPB_SIZE(36, 72), 2);
@@ -127,7 +127,7 @@ UPB_INLINE void google_api_HttpRule_set_patch(google_api_HttpRule *msg, upb_strv
UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(28, 56), value, UPB_SIZE(36, 72), 6);
}
UPB_INLINE void google_api_HttpRule_set_body(google_api_HttpRule *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview) = value;
}
UPB_INLINE void google_api_HttpRule_set_custom(google_api_HttpRule *msg, google_api_CustomHttpPattern* value) {
UPB_WRITE_ONEOF(msg, google_api_CustomHttpPattern*, UPB_SIZE(28, 56), value, UPB_SIZE(36, 72), 8);
@@ -135,7 +135,7 @@ UPB_INLINE void google_api_HttpRule_set_custom(google_api_HttpRule *msg, google_
UPB_INLINE struct google_api_CustomHttpPattern* google_api_HttpRule_mutable_custom(google_api_HttpRule *msg, upb_arena *arena) {
struct google_api_CustomHttpPattern* sub = (struct google_api_CustomHttpPattern*)google_api_HttpRule_custom(msg);
if (sub == NULL) {
- sub = (struct google_api_CustomHttpPattern*)_upb_msg_new(&google_api_CustomHttpPattern_msginit, arena);
+ sub = (struct google_api_CustomHttpPattern*)_upb_msg_new(&google_api_CustomHttpPattern_msginit, arena);
if (!sub) return NULL;
google_api_HttpRule_set_custom(msg, sub);
}
@@ -145,23 +145,23 @@ UPB_INLINE google_api_HttpRule** google_api_HttpRule_mutable_additional_bindings
return (google_api_HttpRule**)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 48), len);
}
UPB_INLINE google_api_HttpRule** google_api_HttpRule_resize_additional_bindings(google_api_HttpRule *msg, size_t len, upb_arena *arena) {
- return (google_api_HttpRule**)_upb_array_resize_accessor(msg, UPB_SIZE(24, 48), len, UPB_TYPE_MESSAGE, arena);
+ return (google_api_HttpRule**)_upb_array_resize_accessor(msg, UPB_SIZE(24, 48), len, UPB_TYPE_MESSAGE, arena);
}
UPB_INLINE struct google_api_HttpRule* google_api_HttpRule_add_additional_bindings(google_api_HttpRule *msg, upb_arena *arena) {
- struct google_api_HttpRule* sub = (struct google_api_HttpRule*)_upb_msg_new(&google_api_HttpRule_msginit, arena);
+ struct google_api_HttpRule* sub = (struct google_api_HttpRule*)_upb_msg_new(&google_api_HttpRule_msginit, arena);
bool ok = _upb_array_append_accessor(
msg, UPB_SIZE(24, 48), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
if (!ok) return NULL;
return sub;
}
UPB_INLINE void google_api_HttpRule_set_response_body(google_api_HttpRule *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_strview) = value;
}
/* google.api.CustomHttpPattern */
UPB_INLINE google_api_CustomHttpPattern *google_api_CustomHttpPattern_new(upb_arena *arena) {
- return (google_api_CustomHttpPattern *)_upb_msg_new(&google_api_CustomHttpPattern_msginit, arena);
+ return (google_api_CustomHttpPattern *)_upb_msg_new(&google_api_CustomHttpPattern_msginit, arena);
}
UPB_INLINE google_api_CustomHttpPattern *google_api_CustomHttpPattern_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -172,14 +172,14 @@ UPB_INLINE char *google_api_CustomHttpPattern_serialize(const google_api_CustomH
return upb_encode(msg, &google_api_CustomHttpPattern_msginit, arena, len);
}
-UPB_INLINE upb_strview google_api_CustomHttpPattern_kind(const google_api_CustomHttpPattern *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE upb_strview google_api_CustomHttpPattern_path(const google_api_CustomHttpPattern *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview); }
+UPB_INLINE upb_strview google_api_CustomHttpPattern_kind(const google_api_CustomHttpPattern *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE upb_strview google_api_CustomHttpPattern_path(const google_api_CustomHttpPattern *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview); }
UPB_INLINE void google_api_CustomHttpPattern_set_kind(google_api_CustomHttpPattern *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
}
UPB_INLINE void google_api_CustomHttpPattern_set_path(google_api_CustomHttpPattern *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview) = value;
}
#ifdef __cplusplus
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/any.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/any.upb.h
index 11886644587..bf8394e732c 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/any.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/any.upb.h
@@ -27,7 +27,7 @@ extern const upb_msglayout google_protobuf_Any_msginit;
/* google.protobuf.Any */
UPB_INLINE google_protobuf_Any *google_protobuf_Any_new(upb_arena *arena) {
- return (google_protobuf_Any *)_upb_msg_new(&google_protobuf_Any_msginit, arena);
+ return (google_protobuf_Any *)_upb_msg_new(&google_protobuf_Any_msginit, arena);
}
UPB_INLINE google_protobuf_Any *google_protobuf_Any_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -38,14 +38,14 @@ UPB_INLINE char *google_protobuf_Any_serialize(const google_protobuf_Any *msg, u
return upb_encode(msg, &google_protobuf_Any_msginit, arena, len);
}
-UPB_INLINE upb_strview google_protobuf_Any_type_url(const google_protobuf_Any *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE upb_strview google_protobuf_Any_value(const google_protobuf_Any *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview); }
+UPB_INLINE upb_strview google_protobuf_Any_type_url(const google_protobuf_Any *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE upb_strview google_protobuf_Any_value(const google_protobuf_Any *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview); }
UPB_INLINE void google_protobuf_Any_set_type_url(google_protobuf_Any *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
}
UPB_INLINE void google_protobuf_Any_set_value(google_protobuf_Any *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview) = value;
}
#ifdef __cplusplus
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/descriptor.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/descriptor.upb.c
index d5c7cd53d73..44cd3ae2cec 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/descriptor.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/descriptor.upb.c
@@ -36,9 +36,9 @@ static const upb_msglayout *const google_protobuf_FileDescriptorProto_submsgs[6]
};
static const upb_msglayout_field google_protobuf_FileDescriptorProto__fields[12] = {
- {1, UPB_SIZE(4, 8), 1, 0, 12, 1},
- {2, UPB_SIZE(12, 24), 2, 0, 12, 1},
- {3, UPB_SIZE(36, 72), 0, 0, 12, 3},
+ {1, UPB_SIZE(4, 8), 1, 0, 12, 1},
+ {2, UPB_SIZE(12, 24), 2, 0, 12, 1},
+ {3, UPB_SIZE(36, 72), 0, 0, 12, 3},
{4, UPB_SIZE(40, 80), 0, 0, 11, 3},
{5, UPB_SIZE(44, 88), 0, 1, 11, 3},
{6, UPB_SIZE(48, 96), 0, 4, 11, 3},
@@ -47,7 +47,7 @@ static const upb_msglayout_field google_protobuf_FileDescriptorProto__fields[12]
{9, UPB_SIZE(32, 64), 5, 5, 11, 1},
{10, UPB_SIZE(56, 112), 0, 0, 5, 3},
{11, UPB_SIZE(60, 120), 0, 0, 5, 3},
- {12, UPB_SIZE(20, 40), 3, 0, 12, 1},
+ {12, UPB_SIZE(20, 40), 3, 0, 12, 1},
};
const upb_msglayout google_protobuf_FileDescriptorProto_msginit = {
@@ -67,7 +67,7 @@ static const upb_msglayout *const google_protobuf_DescriptorProto_submsgs[8] = {
};
static const upb_msglayout_field google_protobuf_DescriptorProto__fields[10] = {
- {1, UPB_SIZE(4, 8), 1, 0, 12, 1},
+ {1, UPB_SIZE(4, 8), 1, 0, 12, 1},
{2, UPB_SIZE(16, 32), 0, 4, 11, 3},
{3, UPB_SIZE(20, 40), 0, 0, 11, 3},
{4, UPB_SIZE(24, 48), 0, 3, 11, 3},
@@ -76,7 +76,7 @@ static const upb_msglayout_field google_protobuf_DescriptorProto__fields[10] = {
{7, UPB_SIZE(12, 24), 2, 5, 11, 1},
{8, UPB_SIZE(36, 72), 0, 6, 11, 3},
{9, UPB_SIZE(40, 80), 0, 2, 11, 3},
- {10, UPB_SIZE(44, 88), 0, 0, 12, 3},
+ {10, UPB_SIZE(44, 88), 0, 0, 12, 3},
};
const upb_msglayout google_protobuf_DescriptorProto_msginit = {
@@ -130,24 +130,24 @@ static const upb_msglayout *const google_protobuf_FieldDescriptorProto_submsgs[1
&google_protobuf_FieldOptions_msginit,
};
-static const upb_msglayout_field google_protobuf_FieldDescriptorProto__fields[11] = {
- {1, UPB_SIZE(36, 40), 6, 0, 12, 1},
- {2, UPB_SIZE(44, 56), 7, 0, 12, 1},
+static const upb_msglayout_field google_protobuf_FieldDescriptorProto__fields[11] = {
+ {1, UPB_SIZE(36, 40), 6, 0, 12, 1},
+ {2, UPB_SIZE(44, 56), 7, 0, 12, 1},
{3, UPB_SIZE(24, 24), 3, 0, 5, 1},
{4, UPB_SIZE(8, 8), 1, 0, 14, 1},
{5, UPB_SIZE(16, 16), 2, 0, 14, 1},
- {6, UPB_SIZE(52, 72), 8, 0, 12, 1},
- {7, UPB_SIZE(60, 88), 9, 0, 12, 1},
- {8, UPB_SIZE(76, 120), 11, 0, 11, 1},
+ {6, UPB_SIZE(52, 72), 8, 0, 12, 1},
+ {7, UPB_SIZE(60, 88), 9, 0, 12, 1},
+ {8, UPB_SIZE(76, 120), 11, 0, 11, 1},
{9, UPB_SIZE(28, 28), 4, 0, 5, 1},
- {10, UPB_SIZE(68, 104), 10, 0, 12, 1},
- {17, UPB_SIZE(32, 32), 5, 0, 8, 1},
+ {10, UPB_SIZE(68, 104), 10, 0, 12, 1},
+ {17, UPB_SIZE(32, 32), 5, 0, 8, 1},
};
const upb_msglayout google_protobuf_FieldDescriptorProto_msginit = {
&google_protobuf_FieldDescriptorProto_submsgs[0],
&google_protobuf_FieldDescriptorProto__fields[0],
- UPB_SIZE(80, 128), 11, false,
+ UPB_SIZE(80, 128), 11, false,
};
static const upb_msglayout *const google_protobuf_OneofDescriptorProto_submsgs[1] = {
@@ -155,7 +155,7 @@ static const upb_msglayout *const google_protobuf_OneofDescriptorProto_submsgs[1
};
static const upb_msglayout_field google_protobuf_OneofDescriptorProto__fields[2] = {
- {1, UPB_SIZE(4, 8), 1, 0, 12, 1},
+ {1, UPB_SIZE(4, 8), 1, 0, 12, 1},
{2, UPB_SIZE(12, 24), 2, 0, 11, 1},
};
@@ -172,11 +172,11 @@ static const upb_msglayout *const google_protobuf_EnumDescriptorProto_submsgs[3]
};
static const upb_msglayout_field google_protobuf_EnumDescriptorProto__fields[5] = {
- {1, UPB_SIZE(4, 8), 1, 0, 12, 1},
+ {1, UPB_SIZE(4, 8), 1, 0, 12, 1},
{2, UPB_SIZE(16, 32), 0, 2, 11, 3},
{3, UPB_SIZE(12, 24), 2, 1, 11, 1},
{4, UPB_SIZE(20, 40), 0, 0, 11, 3},
- {5, UPB_SIZE(24, 48), 0, 0, 12, 3},
+ {5, UPB_SIZE(24, 48), 0, 0, 12, 3},
};
const upb_msglayout google_protobuf_EnumDescriptorProto_msginit = {
@@ -201,7 +201,7 @@ static const upb_msglayout *const google_protobuf_EnumValueDescriptorProto_subms
};
static const upb_msglayout_field google_protobuf_EnumValueDescriptorProto__fields[3] = {
- {1, UPB_SIZE(8, 8), 2, 0, 12, 1},
+ {1, UPB_SIZE(8, 8), 2, 0, 12, 1},
{2, UPB_SIZE(4, 4), 1, 0, 5, 1},
{3, UPB_SIZE(16, 24), 3, 0, 11, 1},
};
@@ -218,7 +218,7 @@ static const upb_msglayout *const google_protobuf_ServiceDescriptorProto_submsgs
};
static const upb_msglayout_field google_protobuf_ServiceDescriptorProto__fields[3] = {
- {1, UPB_SIZE(4, 8), 1, 0, 12, 1},
+ {1, UPB_SIZE(4, 8), 1, 0, 12, 1},
{2, UPB_SIZE(16, 32), 0, 0, 11, 3},
{3, UPB_SIZE(12, 24), 2, 1, 11, 1},
};
@@ -234,9 +234,9 @@ static const upb_msglayout *const google_protobuf_MethodDescriptorProto_submsgs[
};
static const upb_msglayout_field google_protobuf_MethodDescriptorProto__fields[6] = {
- {1, UPB_SIZE(4, 8), 3, 0, 12, 1},
- {2, UPB_SIZE(12, 24), 4, 0, 12, 1},
- {3, UPB_SIZE(20, 40), 5, 0, 12, 1},
+ {1, UPB_SIZE(4, 8), 3, 0, 12, 1},
+ {2, UPB_SIZE(12, 24), 4, 0, 12, 1},
+ {3, UPB_SIZE(20, 40), 5, 0, 12, 1},
{4, UPB_SIZE(28, 56), 6, 0, 11, 1},
{5, UPB_SIZE(1, 1), 1, 0, 8, 1},
{6, UPB_SIZE(2, 2), 2, 0, 8, 1},
@@ -253,11 +253,11 @@ static const upb_msglayout *const google_protobuf_FileOptions_submsgs[1] = {
};
static const upb_msglayout_field google_protobuf_FileOptions__fields[21] = {
- {1, UPB_SIZE(28, 32), 11, 0, 12, 1},
- {8, UPB_SIZE(36, 48), 12, 0, 12, 1},
+ {1, UPB_SIZE(28, 32), 11, 0, 12, 1},
+ {8, UPB_SIZE(36, 48), 12, 0, 12, 1},
{9, UPB_SIZE(8, 8), 1, 0, 14, 1},
{10, UPB_SIZE(16, 16), 2, 0, 8, 1},
- {11, UPB_SIZE(44, 64), 13, 0, 12, 1},
+ {11, UPB_SIZE(44, 64), 13, 0, 12, 1},
{16, UPB_SIZE(17, 17), 3, 0, 8, 1},
{17, UPB_SIZE(18, 18), 4, 0, 8, 1},
{18, UPB_SIZE(19, 19), 5, 0, 8, 1},
@@ -265,14 +265,14 @@ static const upb_msglayout_field google_protobuf_FileOptions__fields[21] = {
{23, UPB_SIZE(21, 21), 7, 0, 8, 1},
{27, UPB_SIZE(22, 22), 8, 0, 8, 1},
{31, UPB_SIZE(23, 23), 9, 0, 8, 1},
- {36, UPB_SIZE(52, 80), 14, 0, 12, 1},
- {37, UPB_SIZE(60, 96), 15, 0, 12, 1},
- {39, UPB_SIZE(68, 112), 16, 0, 12, 1},
- {40, UPB_SIZE(76, 128), 17, 0, 12, 1},
- {41, UPB_SIZE(84, 144), 18, 0, 12, 1},
+ {36, UPB_SIZE(52, 80), 14, 0, 12, 1},
+ {37, UPB_SIZE(60, 96), 15, 0, 12, 1},
+ {39, UPB_SIZE(68, 112), 16, 0, 12, 1},
+ {40, UPB_SIZE(76, 128), 17, 0, 12, 1},
+ {41, UPB_SIZE(84, 144), 18, 0, 12, 1},
{42, UPB_SIZE(24, 24), 10, 0, 8, 1},
- {44, UPB_SIZE(92, 160), 19, 0, 12, 1},
- {45, UPB_SIZE(100, 176), 20, 0, 12, 1},
+ {44, UPB_SIZE(92, 160), 19, 0, 12, 1},
+ {45, UPB_SIZE(100, 176), 20, 0, 12, 1},
{999, UPB_SIZE(108, 192), 0, 0, 11, 3},
};
@@ -402,12 +402,12 @@ static const upb_msglayout *const google_protobuf_UninterpretedOption_submsgs[1]
static const upb_msglayout_field google_protobuf_UninterpretedOption__fields[7] = {
{2, UPB_SIZE(56, 80), 0, 0, 11, 3},
- {3, UPB_SIZE(32, 32), 4, 0, 12, 1},
+ {3, UPB_SIZE(32, 32), 4, 0, 12, 1},
{4, UPB_SIZE(8, 8), 1, 0, 4, 1},
{5, UPB_SIZE(16, 16), 2, 0, 3, 1},
{6, UPB_SIZE(24, 24), 3, 0, 1, 1},
{7, UPB_SIZE(40, 48), 5, 0, 12, 1},
- {8, UPB_SIZE(48, 64), 6, 0, 12, 1},
+ {8, UPB_SIZE(48, 64), 6, 0, 12, 1},
};
const upb_msglayout google_protobuf_UninterpretedOption_msginit = {
@@ -417,7 +417,7 @@ const upb_msglayout google_protobuf_UninterpretedOption_msginit = {
};
static const upb_msglayout_field google_protobuf_UninterpretedOption_NamePart__fields[2] = {
- {1, UPB_SIZE(4, 8), 2, 0, 12, 2},
+ {1, UPB_SIZE(4, 8), 2, 0, 12, 2},
{2, UPB_SIZE(1, 1), 1, 0, 8, 2},
};
@@ -442,11 +442,11 @@ const upb_msglayout google_protobuf_SourceCodeInfo_msginit = {
};
static const upb_msglayout_field google_protobuf_SourceCodeInfo_Location__fields[5] = {
- {1, UPB_SIZE(20, 40), 0, 0, 5, _UPB_LABEL_PACKED},
- {2, UPB_SIZE(24, 48), 0, 0, 5, _UPB_LABEL_PACKED},
- {3, UPB_SIZE(4, 8), 1, 0, 12, 1},
- {4, UPB_SIZE(12, 24), 2, 0, 12, 1},
- {6, UPB_SIZE(28, 56), 0, 0, 12, 3},
+ {1, UPB_SIZE(20, 40), 0, 0, 5, _UPB_LABEL_PACKED},
+ {2, UPB_SIZE(24, 48), 0, 0, 5, _UPB_LABEL_PACKED},
+ {3, UPB_SIZE(4, 8), 1, 0, 12, 1},
+ {4, UPB_SIZE(12, 24), 2, 0, 12, 1},
+ {6, UPB_SIZE(28, 56), 0, 0, 12, 3},
};
const upb_msglayout google_protobuf_SourceCodeInfo_Location_msginit = {
@@ -470,8 +470,8 @@ const upb_msglayout google_protobuf_GeneratedCodeInfo_msginit = {
};
static const upb_msglayout_field google_protobuf_GeneratedCodeInfo_Annotation__fields[4] = {
- {1, UPB_SIZE(20, 32), 0, 0, 5, _UPB_LABEL_PACKED},
- {2, UPB_SIZE(12, 16), 3, 0, 12, 1},
+ {1, UPB_SIZE(20, 32), 0, 0, 5, _UPB_LABEL_PACKED},
+ {2, UPB_SIZE(12, 16), 3, 0, 12, 1},
{3, UPB_SIZE(4, 4), 1, 0, 5, 1},
{4, UPB_SIZE(8, 8), 2, 0, 5, 1},
};
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/descriptor.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/descriptor.upb.h
index 059c14c66b0..64701a0cf21 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/descriptor.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/descriptor.upb.h
@@ -156,7 +156,7 @@ typedef enum {
/* google.protobuf.FileDescriptorSet */
UPB_INLINE google_protobuf_FileDescriptorSet *google_protobuf_FileDescriptorSet_new(upb_arena *arena) {
- return (google_protobuf_FileDescriptorSet *)_upb_msg_new(&google_protobuf_FileDescriptorSet_msginit, arena);
+ return (google_protobuf_FileDescriptorSet *)_upb_msg_new(&google_protobuf_FileDescriptorSet_msginit, arena);
}
UPB_INLINE google_protobuf_FileDescriptorSet *google_protobuf_FileDescriptorSet_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -167,17 +167,17 @@ UPB_INLINE char *google_protobuf_FileDescriptorSet_serialize(const google_protob
return upb_encode(msg, &google_protobuf_FileDescriptorSet_msginit, arena, len);
}
-UPB_INLINE bool google_protobuf_FileDescriptorSet_has_file(const google_protobuf_FileDescriptorSet *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE bool google_protobuf_FileDescriptorSet_has_file(const google_protobuf_FileDescriptorSet *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
UPB_INLINE const google_protobuf_FileDescriptorProto* const* google_protobuf_FileDescriptorSet_file(const google_protobuf_FileDescriptorSet *msg, size_t *len) { return (const google_protobuf_FileDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
UPB_INLINE google_protobuf_FileDescriptorProto** google_protobuf_FileDescriptorSet_mutable_file(google_protobuf_FileDescriptorSet *msg, size_t *len) {
return (google_protobuf_FileDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
}
UPB_INLINE google_protobuf_FileDescriptorProto** google_protobuf_FileDescriptorSet_resize_file(google_protobuf_FileDescriptorSet *msg, size_t len, upb_arena *arena) {
- return (google_protobuf_FileDescriptorProto**)_upb_array_resize_accessor(msg, UPB_SIZE(0, 0), len, UPB_TYPE_MESSAGE, arena);
+ return (google_protobuf_FileDescriptorProto**)_upb_array_resize_accessor(msg, UPB_SIZE(0, 0), len, UPB_TYPE_MESSAGE, arena);
}
UPB_INLINE struct google_protobuf_FileDescriptorProto* google_protobuf_FileDescriptorSet_add_file(google_protobuf_FileDescriptorSet *msg, upb_arena *arena) {
- struct google_protobuf_FileDescriptorProto* sub = (struct google_protobuf_FileDescriptorProto*)_upb_msg_new(&google_protobuf_FileDescriptorProto_msginit, arena);
+ struct google_protobuf_FileDescriptorProto* sub = (struct google_protobuf_FileDescriptorProto*)_upb_msg_new(&google_protobuf_FileDescriptorProto_msginit, arena);
bool ok = _upb_array_append_accessor(
msg, UPB_SIZE(0, 0), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
if (!ok) return NULL;
@@ -187,7 +187,7 @@ UPB_INLINE struct google_protobuf_FileDescriptorProto* google_protobuf_FileDescr
/* google.protobuf.FileDescriptorProto */
UPB_INLINE google_protobuf_FileDescriptorProto *google_protobuf_FileDescriptorProto_new(upb_arena *arena) {
- return (google_protobuf_FileDescriptorProto *)_upb_msg_new(&google_protobuf_FileDescriptorProto_msginit, arena);
+ return (google_protobuf_FileDescriptorProto *)_upb_msg_new(&google_protobuf_FileDescriptorProto_msginit, arena);
}
UPB_INLINE google_protobuf_FileDescriptorProto *google_protobuf_FileDescriptorProto_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -198,54 +198,54 @@ UPB_INLINE char *google_protobuf_FileDescriptorProto_serialize(const google_prot
return upb_encode(msg, &google_protobuf_FileDescriptorProto_msginit, arena, len);
}
-UPB_INLINE bool google_protobuf_FileDescriptorProto_has_name(const google_protobuf_FileDescriptorProto *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE upb_strview google_protobuf_FileDescriptorProto_name(const google_protobuf_FileDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
-UPB_INLINE bool google_protobuf_FileDescriptorProto_has_package(const google_protobuf_FileDescriptorProto *msg) { return _upb_hasbit(msg, 2); }
-UPB_INLINE upb_strview google_protobuf_FileDescriptorProto_package(const google_protobuf_FileDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview); }
+UPB_INLINE bool google_protobuf_FileDescriptorProto_has_name(const google_protobuf_FileDescriptorProto *msg) { return _upb_hasbit(msg, 1); }
+UPB_INLINE upb_strview google_protobuf_FileDescriptorProto_name(const google_protobuf_FileDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
+UPB_INLINE bool google_protobuf_FileDescriptorProto_has_package(const google_protobuf_FileDescriptorProto *msg) { return _upb_hasbit(msg, 2); }
+UPB_INLINE upb_strview google_protobuf_FileDescriptorProto_package(const google_protobuf_FileDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview); }
UPB_INLINE upb_strview const* google_protobuf_FileDescriptorProto_dependency(const google_protobuf_FileDescriptorProto *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(36, 72), len); }
-UPB_INLINE bool google_protobuf_FileDescriptorProto_has_message_type(const google_protobuf_FileDescriptorProto *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(40, 80)); }
+UPB_INLINE bool google_protobuf_FileDescriptorProto_has_message_type(const google_protobuf_FileDescriptorProto *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(40, 80)); }
UPB_INLINE const google_protobuf_DescriptorProto* const* google_protobuf_FileDescriptorProto_message_type(const google_protobuf_FileDescriptorProto *msg, size_t *len) { return (const google_protobuf_DescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(40, 80), len); }
-UPB_INLINE bool google_protobuf_FileDescriptorProto_has_enum_type(const google_protobuf_FileDescriptorProto *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(44, 88)); }
+UPB_INLINE bool google_protobuf_FileDescriptorProto_has_enum_type(const google_protobuf_FileDescriptorProto *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(44, 88)); }
UPB_INLINE const google_protobuf_EnumDescriptorProto* const* google_protobuf_FileDescriptorProto_enum_type(const google_protobuf_FileDescriptorProto *msg, size_t *len) { return (const google_protobuf_EnumDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(44, 88), len); }
-UPB_INLINE bool google_protobuf_FileDescriptorProto_has_service(const google_protobuf_FileDescriptorProto *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(48, 96)); }
+UPB_INLINE bool google_protobuf_FileDescriptorProto_has_service(const google_protobuf_FileDescriptorProto *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(48, 96)); }
UPB_INLINE const google_protobuf_ServiceDescriptorProto* const* google_protobuf_FileDescriptorProto_service(const google_protobuf_FileDescriptorProto *msg, size_t *len) { return (const google_protobuf_ServiceDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(48, 96), len); }
-UPB_INLINE bool google_protobuf_FileDescriptorProto_has_extension(const google_protobuf_FileDescriptorProto *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(52, 104)); }
+UPB_INLINE bool google_protobuf_FileDescriptorProto_has_extension(const google_protobuf_FileDescriptorProto *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(52, 104)); }
UPB_INLINE const google_protobuf_FieldDescriptorProto* const* google_protobuf_FileDescriptorProto_extension(const google_protobuf_FileDescriptorProto *msg, size_t *len) { return (const google_protobuf_FieldDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(52, 104), len); }
-UPB_INLINE bool google_protobuf_FileDescriptorProto_has_options(const google_protobuf_FileDescriptorProto *msg) { return _upb_hasbit(msg, 4); }
-UPB_INLINE const google_protobuf_FileOptions* google_protobuf_FileDescriptorProto_options(const google_protobuf_FileDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 56), const google_protobuf_FileOptions*); }
-UPB_INLINE bool google_protobuf_FileDescriptorProto_has_source_code_info(const google_protobuf_FileDescriptorProto *msg) { return _upb_hasbit(msg, 5); }
-UPB_INLINE const google_protobuf_SourceCodeInfo* google_protobuf_FileDescriptorProto_source_code_info(const google_protobuf_FileDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 64), const google_protobuf_SourceCodeInfo*); }
+UPB_INLINE bool google_protobuf_FileDescriptorProto_has_options(const google_protobuf_FileDescriptorProto *msg) { return _upb_hasbit(msg, 4); }
+UPB_INLINE const google_protobuf_FileOptions* google_protobuf_FileDescriptorProto_options(const google_protobuf_FileDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 56), const google_protobuf_FileOptions*); }
+UPB_INLINE bool google_protobuf_FileDescriptorProto_has_source_code_info(const google_protobuf_FileDescriptorProto *msg) { return _upb_hasbit(msg, 5); }
+UPB_INLINE const google_protobuf_SourceCodeInfo* google_protobuf_FileDescriptorProto_source_code_info(const google_protobuf_FileDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 64), const google_protobuf_SourceCodeInfo*); }
UPB_INLINE int32_t const* google_protobuf_FileDescriptorProto_public_dependency(const google_protobuf_FileDescriptorProto *msg, size_t *len) { return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(56, 112), len); }
UPB_INLINE int32_t const* google_protobuf_FileDescriptorProto_weak_dependency(const google_protobuf_FileDescriptorProto *msg, size_t *len) { return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(60, 120), len); }
-UPB_INLINE bool google_protobuf_FileDescriptorProto_has_syntax(const google_protobuf_FileDescriptorProto *msg) { return _upb_hasbit(msg, 3); }
-UPB_INLINE upb_strview google_protobuf_FileDescriptorProto_syntax(const google_protobuf_FileDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_strview); }
+UPB_INLINE bool google_protobuf_FileDescriptorProto_has_syntax(const google_protobuf_FileDescriptorProto *msg) { return _upb_hasbit(msg, 3); }
+UPB_INLINE upb_strview google_protobuf_FileDescriptorProto_syntax(const google_protobuf_FileDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_strview); }
UPB_INLINE void google_protobuf_FileDescriptorProto_set_name(google_protobuf_FileDescriptorProto *msg, upb_strview value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
}
UPB_INLINE void google_protobuf_FileDescriptorProto_set_package(google_protobuf_FileDescriptorProto *msg, upb_strview value) {
_upb_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview) = value;
}
UPB_INLINE upb_strview* google_protobuf_FileDescriptorProto_mutable_dependency(google_protobuf_FileDescriptorProto *msg, size_t *len) {
return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(36, 72), len);
}
UPB_INLINE upb_strview* google_protobuf_FileDescriptorProto_resize_dependency(google_protobuf_FileDescriptorProto *msg, size_t len, upb_arena *arena) {
- return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(36, 72), len, UPB_TYPE_STRING, arena);
+ return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(36, 72), len, UPB_TYPE_STRING, arena);
}
UPB_INLINE bool google_protobuf_FileDescriptorProto_add_dependency(google_protobuf_FileDescriptorProto *msg, upb_strview val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(36, 72), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
- arena);
+ return _upb_array_append_accessor(msg, UPB_SIZE(36, 72), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
+ arena);
}
UPB_INLINE google_protobuf_DescriptorProto** google_protobuf_FileDescriptorProto_mutable_message_type(google_protobuf_FileDescriptorProto *msg, size_t *len) {
return (google_protobuf_DescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(40, 80), len);
}
UPB_INLINE google_protobuf_DescriptorProto** google_protobuf_FileDescriptorProto_resize_message_type(google_protobuf_FileDescriptorProto *msg, size_t len, upb_arena *arena) {
- return (google_protobuf_DescriptorProto**)_upb_array_resize_accessor(msg, UPB_SIZE(40, 80), len, UPB_TYPE_MESSAGE, arena);
+ return (google_protobuf_DescriptorProto**)_upb_array_resize_accessor(msg, UPB_SIZE(40, 80), len, UPB_TYPE_MESSAGE, arena);
}
UPB_INLINE struct google_protobuf_DescriptorProto* google_protobuf_FileDescriptorProto_add_message_type(google_protobuf_FileDescriptorProto *msg, upb_arena *arena) {
- struct google_protobuf_DescriptorProto* sub = (struct google_protobuf_DescriptorProto*)_upb_msg_new(&google_protobuf_DescriptorProto_msginit, arena);
+ struct google_protobuf_DescriptorProto* sub = (struct google_protobuf_DescriptorProto*)_upb_msg_new(&google_protobuf_DescriptorProto_msginit, arena);
bool ok = _upb_array_append_accessor(
msg, UPB_SIZE(40, 80), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
if (!ok) return NULL;
@@ -255,10 +255,10 @@ UPB_INLINE google_protobuf_EnumDescriptorProto** google_protobuf_FileDescriptorP
return (google_protobuf_EnumDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(44, 88), len);
}
UPB_INLINE google_protobuf_EnumDescriptorProto** google_protobuf_FileDescriptorProto_resize_enum_type(google_protobuf_FileDescriptorProto *msg, size_t len, upb_arena *arena) {
- return (google_protobuf_EnumDescriptorProto**)_upb_array_resize_accessor(msg, UPB_SIZE(44, 88), len, UPB_TYPE_MESSAGE, arena);
+ return (google_protobuf_EnumDescriptorProto**)_upb_array_resize_accessor(msg, UPB_SIZE(44, 88), len, UPB_TYPE_MESSAGE, arena);
}
UPB_INLINE struct google_protobuf_EnumDescriptorProto* google_protobuf_FileDescriptorProto_add_enum_type(google_protobuf_FileDescriptorProto *msg, upb_arena *arena) {
- struct google_protobuf_EnumDescriptorProto* sub = (struct google_protobuf_EnumDescriptorProto*)_upb_msg_new(&google_protobuf_EnumDescriptorProto_msginit, arena);
+ struct google_protobuf_EnumDescriptorProto* sub = (struct google_protobuf_EnumDescriptorProto*)_upb_msg_new(&google_protobuf_EnumDescriptorProto_msginit, arena);
bool ok = _upb_array_append_accessor(
msg, UPB_SIZE(44, 88), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
if (!ok) return NULL;
@@ -268,10 +268,10 @@ UPB_INLINE google_protobuf_ServiceDescriptorProto** google_protobuf_FileDescript
return (google_protobuf_ServiceDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(48, 96), len);
}
UPB_INLINE google_protobuf_ServiceDescriptorProto** google_protobuf_FileDescriptorProto_resize_service(google_protobuf_FileDescriptorProto *msg, size_t len, upb_arena *arena) {
- return (google_protobuf_ServiceDescriptorProto**)_upb_array_resize_accessor(msg, UPB_SIZE(48, 96), len, UPB_TYPE_MESSAGE, arena);
+ return (google_protobuf_ServiceDescriptorProto**)_upb_array_resize_accessor(msg, UPB_SIZE(48, 96), len, UPB_TYPE_MESSAGE, arena);
}
UPB_INLINE struct google_protobuf_ServiceDescriptorProto* google_protobuf_FileDescriptorProto_add_service(google_protobuf_FileDescriptorProto *msg, upb_arena *arena) {
- struct google_protobuf_ServiceDescriptorProto* sub = (struct google_protobuf_ServiceDescriptorProto*)_upb_msg_new(&google_protobuf_ServiceDescriptorProto_msginit, arena);
+ struct google_protobuf_ServiceDescriptorProto* sub = (struct google_protobuf_ServiceDescriptorProto*)_upb_msg_new(&google_protobuf_ServiceDescriptorProto_msginit, arena);
bool ok = _upb_array_append_accessor(
msg, UPB_SIZE(48, 96), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
if (!ok) return NULL;
@@ -281,10 +281,10 @@ UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_FileDescriptor
return (google_protobuf_FieldDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(52, 104), len);
}
UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_FileDescriptorProto_resize_extension(google_protobuf_FileDescriptorProto *msg, size_t len, upb_arena *arena) {
- return (google_protobuf_FieldDescriptorProto**)_upb_array_resize_accessor(msg, UPB_SIZE(52, 104), len, UPB_TYPE_MESSAGE, arena);
+ return (google_protobuf_FieldDescriptorProto**)_upb_array_resize_accessor(msg, UPB_SIZE(52, 104), len, UPB_TYPE_MESSAGE, arena);
}
UPB_INLINE struct google_protobuf_FieldDescriptorProto* google_protobuf_FileDescriptorProto_add_extension(google_protobuf_FileDescriptorProto *msg, upb_arena *arena) {
- struct google_protobuf_FieldDescriptorProto* sub = (struct google_protobuf_FieldDescriptorProto*)_upb_msg_new(&google_protobuf_FieldDescriptorProto_msginit, arena);
+ struct google_protobuf_FieldDescriptorProto* sub = (struct google_protobuf_FieldDescriptorProto*)_upb_msg_new(&google_protobuf_FieldDescriptorProto_msginit, arena);
bool ok = _upb_array_append_accessor(
msg, UPB_SIZE(52, 104), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
if (!ok) return NULL;
@@ -292,12 +292,12 @@ UPB_INLINE struct google_protobuf_FieldDescriptorProto* google_protobuf_FileDesc
}
UPB_INLINE void google_protobuf_FileDescriptorProto_set_options(google_protobuf_FileDescriptorProto *msg, google_protobuf_FileOptions* value) {
_upb_sethas(msg, 4);
- *UPB_PTR_AT(msg, UPB_SIZE(28, 56), google_protobuf_FileOptions*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 56), google_protobuf_FileOptions*) = value;
}
UPB_INLINE struct google_protobuf_FileOptions* google_protobuf_FileDescriptorProto_mutable_options(google_protobuf_FileDescriptorProto *msg, upb_arena *arena) {
struct google_protobuf_FileOptions* sub = (struct google_protobuf_FileOptions*)google_protobuf_FileDescriptorProto_options(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_FileOptions*)_upb_msg_new(&google_protobuf_FileOptions_msginit, arena);
+ sub = (struct google_protobuf_FileOptions*)_upb_msg_new(&google_protobuf_FileOptions_msginit, arena);
if (!sub) return NULL;
google_protobuf_FileDescriptorProto_set_options(msg, sub);
}
@@ -305,12 +305,12 @@ UPB_INLINE struct google_protobuf_FileOptions* google_protobuf_FileDescriptorPro
}
UPB_INLINE void google_protobuf_FileDescriptorProto_set_source_code_info(google_protobuf_FileDescriptorProto *msg, google_protobuf_SourceCodeInfo* value) {
_upb_sethas(msg, 5);
- *UPB_PTR_AT(msg, UPB_SIZE(32, 64), google_protobuf_SourceCodeInfo*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 64), google_protobuf_SourceCodeInfo*) = value;
}
UPB_INLINE struct google_protobuf_SourceCodeInfo* google_protobuf_FileDescriptorProto_mutable_source_code_info(google_protobuf_FileDescriptorProto *msg, upb_arena *arena) {
struct google_protobuf_SourceCodeInfo* sub = (struct google_protobuf_SourceCodeInfo*)google_protobuf_FileDescriptorProto_source_code_info(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_SourceCodeInfo*)_upb_msg_new(&google_protobuf_SourceCodeInfo_msginit, arena);
+ sub = (struct google_protobuf_SourceCodeInfo*)_upb_msg_new(&google_protobuf_SourceCodeInfo_msginit, arena);
if (!sub) return NULL;
google_protobuf_FileDescriptorProto_set_source_code_info(msg, sub);
}
@@ -320,31 +320,31 @@ UPB_INLINE int32_t* google_protobuf_FileDescriptorProto_mutable_public_dependenc
return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(56, 112), len);
}
UPB_INLINE int32_t* google_protobuf_FileDescriptorProto_resize_public_dependency(google_protobuf_FileDescriptorProto *msg, size_t len, upb_arena *arena) {
- return (int32_t*)_upb_array_resize_accessor(msg, UPB_SIZE(56, 112), len, UPB_TYPE_INT32, arena);
+ return (int32_t*)_upb_array_resize_accessor(msg, UPB_SIZE(56, 112), len, UPB_TYPE_INT32, arena);
}
UPB_INLINE bool google_protobuf_FileDescriptorProto_add_public_dependency(google_protobuf_FileDescriptorProto *msg, int32_t val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(56, 112), UPB_SIZE(4, 4), UPB_TYPE_INT32, &val,
- arena);
+ return _upb_array_append_accessor(msg, UPB_SIZE(56, 112), UPB_SIZE(4, 4), UPB_TYPE_INT32, &val,
+ arena);
}
UPB_INLINE int32_t* google_protobuf_FileDescriptorProto_mutable_weak_dependency(google_protobuf_FileDescriptorProto *msg, size_t *len) {
return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(60, 120), len);
}
UPB_INLINE int32_t* google_protobuf_FileDescriptorProto_resize_weak_dependency(google_protobuf_FileDescriptorProto *msg, size_t len, upb_arena *arena) {
- return (int32_t*)_upb_array_resize_accessor(msg, UPB_SIZE(60, 120), len, UPB_TYPE_INT32, arena);
+ return (int32_t*)_upb_array_resize_accessor(msg, UPB_SIZE(60, 120), len, UPB_TYPE_INT32, arena);
}
UPB_INLINE bool google_protobuf_FileDescriptorProto_add_weak_dependency(google_protobuf_FileDescriptorProto *msg, int32_t val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(60, 120), UPB_SIZE(4, 4), UPB_TYPE_INT32, &val,
- arena);
+ return _upb_array_append_accessor(msg, UPB_SIZE(60, 120), UPB_SIZE(4, 4), UPB_TYPE_INT32, &val,
+ arena);
}
UPB_INLINE void google_protobuf_FileDescriptorProto_set_syntax(google_protobuf_FileDescriptorProto *msg, upb_strview value) {
_upb_sethas(msg, 3);
- *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_strview) = value;
}
/* google.protobuf.DescriptorProto */
UPB_INLINE google_protobuf_DescriptorProto *google_protobuf_DescriptorProto_new(upb_arena *arena) {
- return (google_protobuf_DescriptorProto *)_upb_msg_new(&google_protobuf_DescriptorProto_msginit, arena);
+ return (google_protobuf_DescriptorProto *)_upb_msg_new(&google_protobuf_DescriptorProto_msginit, arena);
}
UPB_INLINE google_protobuf_DescriptorProto *google_protobuf_DescriptorProto_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -355,38 +355,38 @@ UPB_INLINE char *google_protobuf_DescriptorProto_serialize(const google_protobuf
return upb_encode(msg, &google_protobuf_DescriptorProto_msginit, arena, len);
}
-UPB_INLINE bool google_protobuf_DescriptorProto_has_name(const google_protobuf_DescriptorProto *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE upb_strview google_protobuf_DescriptorProto_name(const google_protobuf_DescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
-UPB_INLINE bool google_protobuf_DescriptorProto_has_field(const google_protobuf_DescriptorProto *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); }
+UPB_INLINE bool google_protobuf_DescriptorProto_has_name(const google_protobuf_DescriptorProto *msg) { return _upb_hasbit(msg, 1); }
+UPB_INLINE upb_strview google_protobuf_DescriptorProto_name(const google_protobuf_DescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
+UPB_INLINE bool google_protobuf_DescriptorProto_has_field(const google_protobuf_DescriptorProto *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); }
UPB_INLINE const google_protobuf_FieldDescriptorProto* const* google_protobuf_DescriptorProto_field(const google_protobuf_DescriptorProto *msg, size_t *len) { return (const google_protobuf_FieldDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(16, 32), len); }
-UPB_INLINE bool google_protobuf_DescriptorProto_has_nested_type(const google_protobuf_DescriptorProto *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 40)); }
+UPB_INLINE bool google_protobuf_DescriptorProto_has_nested_type(const google_protobuf_DescriptorProto *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 40)); }
UPB_INLINE const google_protobuf_DescriptorProto* const* google_protobuf_DescriptorProto_nested_type(const google_protobuf_DescriptorProto *msg, size_t *len) { return (const google_protobuf_DescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(20, 40), len); }
-UPB_INLINE bool google_protobuf_DescriptorProto_has_enum_type(const google_protobuf_DescriptorProto *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 48)); }
+UPB_INLINE bool google_protobuf_DescriptorProto_has_enum_type(const google_protobuf_DescriptorProto *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 48)); }
UPB_INLINE const google_protobuf_EnumDescriptorProto* const* google_protobuf_DescriptorProto_enum_type(const google_protobuf_DescriptorProto *msg, size_t *len) { return (const google_protobuf_EnumDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(24, 48), len); }
-UPB_INLINE bool google_protobuf_DescriptorProto_has_extension_range(const google_protobuf_DescriptorProto *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 56)); }
+UPB_INLINE bool google_protobuf_DescriptorProto_has_extension_range(const google_protobuf_DescriptorProto *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 56)); }
UPB_INLINE const google_protobuf_DescriptorProto_ExtensionRange* const* google_protobuf_DescriptorProto_extension_range(const google_protobuf_DescriptorProto *msg, size_t *len) { return (const google_protobuf_DescriptorProto_ExtensionRange* const*)_upb_array_accessor(msg, UPB_SIZE(28, 56), len); }
-UPB_INLINE bool google_protobuf_DescriptorProto_has_extension(const google_protobuf_DescriptorProto *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(32, 64)); }
+UPB_INLINE bool google_protobuf_DescriptorProto_has_extension(const google_protobuf_DescriptorProto *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(32, 64)); }
UPB_INLINE const google_protobuf_FieldDescriptorProto* const* google_protobuf_DescriptorProto_extension(const google_protobuf_DescriptorProto *msg, size_t *len) { return (const google_protobuf_FieldDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(32, 64), len); }
-UPB_INLINE bool google_protobuf_DescriptorProto_has_options(const google_protobuf_DescriptorProto *msg) { return _upb_hasbit(msg, 2); }
-UPB_INLINE const google_protobuf_MessageOptions* google_protobuf_DescriptorProto_options(const google_protobuf_DescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const google_protobuf_MessageOptions*); }
-UPB_INLINE bool google_protobuf_DescriptorProto_has_oneof_decl(const google_protobuf_DescriptorProto *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(36, 72)); }
+UPB_INLINE bool google_protobuf_DescriptorProto_has_options(const google_protobuf_DescriptorProto *msg) { return _upb_hasbit(msg, 2); }
+UPB_INLINE const google_protobuf_MessageOptions* google_protobuf_DescriptorProto_options(const google_protobuf_DescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const google_protobuf_MessageOptions*); }
+UPB_INLINE bool google_protobuf_DescriptorProto_has_oneof_decl(const google_protobuf_DescriptorProto *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(36, 72)); }
UPB_INLINE const google_protobuf_OneofDescriptorProto* const* google_protobuf_DescriptorProto_oneof_decl(const google_protobuf_DescriptorProto *msg, size_t *len) { return (const google_protobuf_OneofDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(36, 72), len); }
-UPB_INLINE bool google_protobuf_DescriptorProto_has_reserved_range(const google_protobuf_DescriptorProto *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(40, 80)); }
+UPB_INLINE bool google_protobuf_DescriptorProto_has_reserved_range(const google_protobuf_DescriptorProto *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(40, 80)); }
UPB_INLINE const google_protobuf_DescriptorProto_ReservedRange* const* google_protobuf_DescriptorProto_reserved_range(const google_protobuf_DescriptorProto *msg, size_t *len) { return (const google_protobuf_DescriptorProto_ReservedRange* const*)_upb_array_accessor(msg, UPB_SIZE(40, 80), len); }
UPB_INLINE upb_strview const* google_protobuf_DescriptorProto_reserved_name(const google_protobuf_DescriptorProto *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(44, 88), len); }
UPB_INLINE void google_protobuf_DescriptorProto_set_name(google_protobuf_DescriptorProto *msg, upb_strview value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
}
UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_DescriptorProto_mutable_field(google_protobuf_DescriptorProto *msg, size_t *len) {
return (google_protobuf_FieldDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 32), len);
}
UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_DescriptorProto_resize_field(google_protobuf_DescriptorProto *msg, size_t len, upb_arena *arena) {
- return (google_protobuf_FieldDescriptorProto**)_upb_array_resize_accessor(msg, UPB_SIZE(16, 32), len, UPB_TYPE_MESSAGE, arena);
+ return (google_protobuf_FieldDescriptorProto**)_upb_array_resize_accessor(msg, UPB_SIZE(16, 32), len, UPB_TYPE_MESSAGE, arena);
}
UPB_INLINE struct google_protobuf_FieldDescriptorProto* google_protobuf_DescriptorProto_add_field(google_protobuf_DescriptorProto *msg, upb_arena *arena) {
- struct google_protobuf_FieldDescriptorProto* sub = (struct google_protobuf_FieldDescriptorProto*)_upb_msg_new(&google_protobuf_FieldDescriptorProto_msginit, arena);
+ struct google_protobuf_FieldDescriptorProto* sub = (struct google_protobuf_FieldDescriptorProto*)_upb_msg_new(&google_protobuf_FieldDescriptorProto_msginit, arena);
bool ok = _upb_array_append_accessor(
msg, UPB_SIZE(16, 32), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
if (!ok) return NULL;
@@ -396,10 +396,10 @@ UPB_INLINE google_protobuf_DescriptorProto** google_protobuf_DescriptorProto_mut
return (google_protobuf_DescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 40), len);
}
UPB_INLINE google_protobuf_DescriptorProto** google_protobuf_DescriptorProto_resize_nested_type(google_protobuf_DescriptorProto *msg, size_t len, upb_arena *arena) {
- return (google_protobuf_DescriptorProto**)_upb_array_resize_accessor(msg, UPB_SIZE(20, 40), len, UPB_TYPE_MESSAGE, arena);
+ return (google_protobuf_DescriptorProto**)_upb_array_resize_accessor(msg, UPB_SIZE(20, 40), len, UPB_TYPE_MESSAGE, arena);
}
UPB_INLINE struct google_protobuf_DescriptorProto* google_protobuf_DescriptorProto_add_nested_type(google_protobuf_DescriptorProto *msg, upb_arena *arena) {
- struct google_protobuf_DescriptorProto* sub = (struct google_protobuf_DescriptorProto*)_upb_msg_new(&google_protobuf_DescriptorProto_msginit, arena);
+ struct google_protobuf_DescriptorProto* sub = (struct google_protobuf_DescriptorProto*)_upb_msg_new(&google_protobuf_DescriptorProto_msginit, arena);
bool ok = _upb_array_append_accessor(
msg, UPB_SIZE(20, 40), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
if (!ok) return NULL;
@@ -409,10 +409,10 @@ UPB_INLINE google_protobuf_EnumDescriptorProto** google_protobuf_DescriptorProto
return (google_protobuf_EnumDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 48), len);
}
UPB_INLINE google_protobuf_EnumDescriptorProto** google_protobuf_DescriptorProto_resize_enum_type(google_protobuf_DescriptorProto *msg, size_t len, upb_arena *arena) {
- return (google_protobuf_EnumDescriptorProto**)_upb_array_resize_accessor(msg, UPB_SIZE(24, 48), len, UPB_TYPE_MESSAGE, arena);
+ return (google_protobuf_EnumDescriptorProto**)_upb_array_resize_accessor(msg, UPB_SIZE(24, 48), len, UPB_TYPE_MESSAGE, arena);
}
UPB_INLINE struct google_protobuf_EnumDescriptorProto* google_protobuf_DescriptorProto_add_enum_type(google_protobuf_DescriptorProto *msg, upb_arena *arena) {
- struct google_protobuf_EnumDescriptorProto* sub = (struct google_protobuf_EnumDescriptorProto*)_upb_msg_new(&google_protobuf_EnumDescriptorProto_msginit, arena);
+ struct google_protobuf_EnumDescriptorProto* sub = (struct google_protobuf_EnumDescriptorProto*)_upb_msg_new(&google_protobuf_EnumDescriptorProto_msginit, arena);
bool ok = _upb_array_append_accessor(
msg, UPB_SIZE(24, 48), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
if (!ok) return NULL;
@@ -422,10 +422,10 @@ UPB_INLINE google_protobuf_DescriptorProto_ExtensionRange** google_protobuf_Desc
return (google_protobuf_DescriptorProto_ExtensionRange**)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 56), len);
}
UPB_INLINE google_protobuf_DescriptorProto_ExtensionRange** google_protobuf_DescriptorProto_resize_extension_range(google_protobuf_DescriptorProto *msg, size_t len, upb_arena *arena) {
- return (google_protobuf_DescriptorProto_ExtensionRange**)_upb_array_resize_accessor(msg, UPB_SIZE(28, 56), len, UPB_TYPE_MESSAGE, arena);
+ return (google_protobuf_DescriptorProto_ExtensionRange**)_upb_array_resize_accessor(msg, UPB_SIZE(28, 56), len, UPB_TYPE_MESSAGE, arena);
}
UPB_INLINE struct google_protobuf_DescriptorProto_ExtensionRange* google_protobuf_DescriptorProto_add_extension_range(google_protobuf_DescriptorProto *msg, upb_arena *arena) {
- struct google_protobuf_DescriptorProto_ExtensionRange* sub = (struct google_protobuf_DescriptorProto_ExtensionRange*)_upb_msg_new(&google_protobuf_DescriptorProto_ExtensionRange_msginit, arena);
+ struct google_protobuf_DescriptorProto_ExtensionRange* sub = (struct google_protobuf_DescriptorProto_ExtensionRange*)_upb_msg_new(&google_protobuf_DescriptorProto_ExtensionRange_msginit, arena);
bool ok = _upb_array_append_accessor(
msg, UPB_SIZE(28, 56), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
if (!ok) return NULL;
@@ -435,10 +435,10 @@ UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_DescriptorProt
return (google_protobuf_FieldDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(32, 64), len);
}
UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_DescriptorProto_resize_extension(google_protobuf_DescriptorProto *msg, size_t len, upb_arena *arena) {
- return (google_protobuf_FieldDescriptorProto**)_upb_array_resize_accessor(msg, UPB_SIZE(32, 64), len, UPB_TYPE_MESSAGE, arena);
+ return (google_protobuf_FieldDescriptorProto**)_upb_array_resize_accessor(msg, UPB_SIZE(32, 64), len, UPB_TYPE_MESSAGE, arena);
}
UPB_INLINE struct google_protobuf_FieldDescriptorProto* google_protobuf_DescriptorProto_add_extension(google_protobuf_DescriptorProto *msg, upb_arena *arena) {
- struct google_protobuf_FieldDescriptorProto* sub = (struct google_protobuf_FieldDescriptorProto*)_upb_msg_new(&google_protobuf_FieldDescriptorProto_msginit, arena);
+ struct google_protobuf_FieldDescriptorProto* sub = (struct google_protobuf_FieldDescriptorProto*)_upb_msg_new(&google_protobuf_FieldDescriptorProto_msginit, arena);
bool ok = _upb_array_append_accessor(
msg, UPB_SIZE(32, 64), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
if (!ok) return NULL;
@@ -446,12 +446,12 @@ UPB_INLINE struct google_protobuf_FieldDescriptorProto* google_protobuf_Descript
}
UPB_INLINE void google_protobuf_DescriptorProto_set_options(google_protobuf_DescriptorProto *msg, google_protobuf_MessageOptions* value) {
_upb_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), google_protobuf_MessageOptions*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), google_protobuf_MessageOptions*) = value;
}
UPB_INLINE struct google_protobuf_MessageOptions* google_protobuf_DescriptorProto_mutable_options(google_protobuf_DescriptorProto *msg, upb_arena *arena) {
struct google_protobuf_MessageOptions* sub = (struct google_protobuf_MessageOptions*)google_protobuf_DescriptorProto_options(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_MessageOptions*)_upb_msg_new(&google_protobuf_MessageOptions_msginit, arena);
+ sub = (struct google_protobuf_MessageOptions*)_upb_msg_new(&google_protobuf_MessageOptions_msginit, arena);
if (!sub) return NULL;
google_protobuf_DescriptorProto_set_options(msg, sub);
}
@@ -461,10 +461,10 @@ UPB_INLINE google_protobuf_OneofDescriptorProto** google_protobuf_DescriptorProt
return (google_protobuf_OneofDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(36, 72), len);
}
UPB_INLINE google_protobuf_OneofDescriptorProto** google_protobuf_DescriptorProto_resize_oneof_decl(google_protobuf_DescriptorProto *msg, size_t len, upb_arena *arena) {
- return (google_protobuf_OneofDescriptorProto**)_upb_array_resize_accessor(msg, UPB_SIZE(36, 72), len, UPB_TYPE_MESSAGE, arena);
+ return (google_protobuf_OneofDescriptorProto**)_upb_array_resize_accessor(msg, UPB_SIZE(36, 72), len, UPB_TYPE_MESSAGE, arena);
}
UPB_INLINE struct google_protobuf_OneofDescriptorProto* google_protobuf_DescriptorProto_add_oneof_decl(google_protobuf_DescriptorProto *msg, upb_arena *arena) {
- struct google_protobuf_OneofDescriptorProto* sub = (struct google_protobuf_OneofDescriptorProto*)_upb_msg_new(&google_protobuf_OneofDescriptorProto_msginit, arena);
+ struct google_protobuf_OneofDescriptorProto* sub = (struct google_protobuf_OneofDescriptorProto*)_upb_msg_new(&google_protobuf_OneofDescriptorProto_msginit, arena);
bool ok = _upb_array_append_accessor(
msg, UPB_SIZE(36, 72), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
if (!ok) return NULL;
@@ -474,10 +474,10 @@ UPB_INLINE google_protobuf_DescriptorProto_ReservedRange** google_protobuf_Descr
return (google_protobuf_DescriptorProto_ReservedRange**)_upb_array_mutable_accessor(msg, UPB_SIZE(40, 80), len);
}
UPB_INLINE google_protobuf_DescriptorProto_ReservedRange** google_protobuf_DescriptorProto_resize_reserved_range(google_protobuf_DescriptorProto *msg, size_t len, upb_arena *arena) {
- return (google_protobuf_DescriptorProto_ReservedRange**)_upb_array_resize_accessor(msg, UPB_SIZE(40, 80), len, UPB_TYPE_MESSAGE, arena);
+ return (google_protobuf_DescriptorProto_ReservedRange**)_upb_array_resize_accessor(msg, UPB_SIZE(40, 80), len, UPB_TYPE_MESSAGE, arena);
}
UPB_INLINE struct google_protobuf_DescriptorProto_ReservedRange* google_protobuf_DescriptorProto_add_reserved_range(google_protobuf_DescriptorProto *msg, upb_arena *arena) {
- struct google_protobuf_DescriptorProto_ReservedRange* sub = (struct google_protobuf_DescriptorProto_ReservedRange*)_upb_msg_new(&google_protobuf_DescriptorProto_ReservedRange_msginit, arena);
+ struct google_protobuf_DescriptorProto_ReservedRange* sub = (struct google_protobuf_DescriptorProto_ReservedRange*)_upb_msg_new(&google_protobuf_DescriptorProto_ReservedRange_msginit, arena);
bool ok = _upb_array_append_accessor(
msg, UPB_SIZE(40, 80), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
if (!ok) return NULL;
@@ -487,17 +487,17 @@ UPB_INLINE upb_strview* google_protobuf_DescriptorProto_mutable_reserved_name(go
return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(44, 88), len);
}
UPB_INLINE upb_strview* google_protobuf_DescriptorProto_resize_reserved_name(google_protobuf_DescriptorProto *msg, size_t len, upb_arena *arena) {
- return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(44, 88), len, UPB_TYPE_STRING, arena);
+ return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(44, 88), len, UPB_TYPE_STRING, arena);
}
UPB_INLINE bool google_protobuf_DescriptorProto_add_reserved_name(google_protobuf_DescriptorProto *msg, upb_strview val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(44, 88), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
- arena);
+ return _upb_array_append_accessor(msg, UPB_SIZE(44, 88), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
+ arena);
}
/* google.protobuf.DescriptorProto.ExtensionRange */
UPB_INLINE google_protobuf_DescriptorProto_ExtensionRange *google_protobuf_DescriptorProto_ExtensionRange_new(upb_arena *arena) {
- return (google_protobuf_DescriptorProto_ExtensionRange *)_upb_msg_new(&google_protobuf_DescriptorProto_ExtensionRange_msginit, arena);
+ return (google_protobuf_DescriptorProto_ExtensionRange *)_upb_msg_new(&google_protobuf_DescriptorProto_ExtensionRange_msginit, arena);
}
UPB_INLINE google_protobuf_DescriptorProto_ExtensionRange *google_protobuf_DescriptorProto_ExtensionRange_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -508,29 +508,29 @@ UPB_INLINE char *google_protobuf_DescriptorProto_ExtensionRange_serialize(const
return upb_encode(msg, &google_protobuf_DescriptorProto_ExtensionRange_msginit, arena, len);
}
-UPB_INLINE bool google_protobuf_DescriptorProto_ExtensionRange_has_start(const google_protobuf_DescriptorProto_ExtensionRange *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE int32_t google_protobuf_DescriptorProto_ExtensionRange_start(const google_protobuf_DescriptorProto_ExtensionRange *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); }
-UPB_INLINE bool google_protobuf_DescriptorProto_ExtensionRange_has_end(const google_protobuf_DescriptorProto_ExtensionRange *msg) { return _upb_hasbit(msg, 2); }
-UPB_INLINE int32_t google_protobuf_DescriptorProto_ExtensionRange_end(const google_protobuf_DescriptorProto_ExtensionRange *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); }
-UPB_INLINE bool google_protobuf_DescriptorProto_ExtensionRange_has_options(const google_protobuf_DescriptorProto_ExtensionRange *msg) { return _upb_hasbit(msg, 3); }
-UPB_INLINE const google_protobuf_ExtensionRangeOptions* google_protobuf_DescriptorProto_ExtensionRange_options(const google_protobuf_DescriptorProto_ExtensionRange *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const google_protobuf_ExtensionRangeOptions*); }
+UPB_INLINE bool google_protobuf_DescriptorProto_ExtensionRange_has_start(const google_protobuf_DescriptorProto_ExtensionRange *msg) { return _upb_hasbit(msg, 1); }
+UPB_INLINE int32_t google_protobuf_DescriptorProto_ExtensionRange_start(const google_protobuf_DescriptorProto_ExtensionRange *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); }
+UPB_INLINE bool google_protobuf_DescriptorProto_ExtensionRange_has_end(const google_protobuf_DescriptorProto_ExtensionRange *msg) { return _upb_hasbit(msg, 2); }
+UPB_INLINE int32_t google_protobuf_DescriptorProto_ExtensionRange_end(const google_protobuf_DescriptorProto_ExtensionRange *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); }
+UPB_INLINE bool google_protobuf_DescriptorProto_ExtensionRange_has_options(const google_protobuf_DescriptorProto_ExtensionRange *msg) { return _upb_hasbit(msg, 3); }
+UPB_INLINE const google_protobuf_ExtensionRangeOptions* google_protobuf_DescriptorProto_ExtensionRange_options(const google_protobuf_DescriptorProto_ExtensionRange *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const google_protobuf_ExtensionRangeOptions*); }
UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_set_start(google_protobuf_DescriptorProto_ExtensionRange *msg, int32_t value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value;
}
UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_set_end(google_protobuf_DescriptorProto_ExtensionRange *msg, int32_t value) {
_upb_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
}
UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_set_options(google_protobuf_DescriptorProto_ExtensionRange *msg, google_protobuf_ExtensionRangeOptions* value) {
_upb_sethas(msg, 3);
- *UPB_PTR_AT(msg, UPB_SIZE(12, 16), google_protobuf_ExtensionRangeOptions*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 16), google_protobuf_ExtensionRangeOptions*) = value;
}
UPB_INLINE struct google_protobuf_ExtensionRangeOptions* google_protobuf_DescriptorProto_ExtensionRange_mutable_options(google_protobuf_DescriptorProto_ExtensionRange *msg, upb_arena *arena) {
struct google_protobuf_ExtensionRangeOptions* sub = (struct google_protobuf_ExtensionRangeOptions*)google_protobuf_DescriptorProto_ExtensionRange_options(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_ExtensionRangeOptions*)_upb_msg_new(&google_protobuf_ExtensionRangeOptions_msginit, arena);
+ sub = (struct google_protobuf_ExtensionRangeOptions*)_upb_msg_new(&google_protobuf_ExtensionRangeOptions_msginit, arena);
if (!sub) return NULL;
google_protobuf_DescriptorProto_ExtensionRange_set_options(msg, sub);
}
@@ -540,7 +540,7 @@ UPB_INLINE struct google_protobuf_ExtensionRangeOptions* google_protobuf_Descrip
/* google.protobuf.DescriptorProto.ReservedRange */
UPB_INLINE google_protobuf_DescriptorProto_ReservedRange *google_protobuf_DescriptorProto_ReservedRange_new(upb_arena *arena) {
- return (google_protobuf_DescriptorProto_ReservedRange *)_upb_msg_new(&google_protobuf_DescriptorProto_ReservedRange_msginit, arena);
+ return (google_protobuf_DescriptorProto_ReservedRange *)_upb_msg_new(&google_protobuf_DescriptorProto_ReservedRange_msginit, arena);
}
UPB_INLINE google_protobuf_DescriptorProto_ReservedRange *google_protobuf_DescriptorProto_ReservedRange_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -551,24 +551,24 @@ UPB_INLINE char *google_protobuf_DescriptorProto_ReservedRange_serialize(const g
return upb_encode(msg, &google_protobuf_DescriptorProto_ReservedRange_msginit, arena, len);
}
-UPB_INLINE bool google_protobuf_DescriptorProto_ReservedRange_has_start(const google_protobuf_DescriptorProto_ReservedRange *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE int32_t google_protobuf_DescriptorProto_ReservedRange_start(const google_protobuf_DescriptorProto_ReservedRange *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); }
-UPB_INLINE bool google_protobuf_DescriptorProto_ReservedRange_has_end(const google_protobuf_DescriptorProto_ReservedRange *msg) { return _upb_hasbit(msg, 2); }
-UPB_INLINE int32_t google_protobuf_DescriptorProto_ReservedRange_end(const google_protobuf_DescriptorProto_ReservedRange *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); }
+UPB_INLINE bool google_protobuf_DescriptorProto_ReservedRange_has_start(const google_protobuf_DescriptorProto_ReservedRange *msg) { return _upb_hasbit(msg, 1); }
+UPB_INLINE int32_t google_protobuf_DescriptorProto_ReservedRange_start(const google_protobuf_DescriptorProto_ReservedRange *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); }
+UPB_INLINE bool google_protobuf_DescriptorProto_ReservedRange_has_end(const google_protobuf_DescriptorProto_ReservedRange *msg) { return _upb_hasbit(msg, 2); }
+UPB_INLINE int32_t google_protobuf_DescriptorProto_ReservedRange_end(const google_protobuf_DescriptorProto_ReservedRange *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); }
UPB_INLINE void google_protobuf_DescriptorProto_ReservedRange_set_start(google_protobuf_DescriptorProto_ReservedRange *msg, int32_t value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value;
}
UPB_INLINE void google_protobuf_DescriptorProto_ReservedRange_set_end(google_protobuf_DescriptorProto_ReservedRange *msg, int32_t value) {
_upb_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
}
/* google.protobuf.ExtensionRangeOptions */
UPB_INLINE google_protobuf_ExtensionRangeOptions *google_protobuf_ExtensionRangeOptions_new(upb_arena *arena) {
- return (google_protobuf_ExtensionRangeOptions *)_upb_msg_new(&google_protobuf_ExtensionRangeOptions_msginit, arena);
+ return (google_protobuf_ExtensionRangeOptions *)_upb_msg_new(&google_protobuf_ExtensionRangeOptions_msginit, arena);
}
UPB_INLINE google_protobuf_ExtensionRangeOptions *google_protobuf_ExtensionRangeOptions_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -579,17 +579,17 @@ UPB_INLINE char *google_protobuf_ExtensionRangeOptions_serialize(const google_pr
return upb_encode(msg, &google_protobuf_ExtensionRangeOptions_msginit, arena, len);
}
-UPB_INLINE bool google_protobuf_ExtensionRangeOptions_has_uninterpreted_option(const google_protobuf_ExtensionRangeOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE bool google_protobuf_ExtensionRangeOptions_has_uninterpreted_option(const google_protobuf_ExtensionRangeOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_ExtensionRangeOptions_uninterpreted_option(const google_protobuf_ExtensionRangeOptions *msg, size_t *len) { return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_ExtensionRangeOptions_mutable_uninterpreted_option(google_protobuf_ExtensionRangeOptions *msg, size_t *len) {
return (google_protobuf_UninterpretedOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
}
UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_ExtensionRangeOptions_resize_uninterpreted_option(google_protobuf_ExtensionRangeOptions *msg, size_t len, upb_arena *arena) {
- return (google_protobuf_UninterpretedOption**)_upb_array_resize_accessor(msg, UPB_SIZE(0, 0), len, UPB_TYPE_MESSAGE, arena);
+ return (google_protobuf_UninterpretedOption**)_upb_array_resize_accessor(msg, UPB_SIZE(0, 0), len, UPB_TYPE_MESSAGE, arena);
}
UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_ExtensionRangeOptions_add_uninterpreted_option(google_protobuf_ExtensionRangeOptions *msg, upb_arena *arena) {
- struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_msg_new(&google_protobuf_UninterpretedOption_msginit, arena);
+ struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_msg_new(&google_protobuf_UninterpretedOption_msginit, arena);
bool ok = _upb_array_append_accessor(
msg, UPB_SIZE(0, 0), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
if (!ok) return NULL;
@@ -599,7 +599,7 @@ UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_Extension
/* google.protobuf.FieldDescriptorProto */
UPB_INLINE google_protobuf_FieldDescriptorProto *google_protobuf_FieldDescriptorProto_new(upb_arena *arena) {
- return (google_protobuf_FieldDescriptorProto *)_upb_msg_new(&google_protobuf_FieldDescriptorProto_msginit, arena);
+ return (google_protobuf_FieldDescriptorProto *)_upb_msg_new(&google_protobuf_FieldDescriptorProto_msginit, arena);
}
UPB_INLINE google_protobuf_FieldDescriptorProto *google_protobuf_FieldDescriptorProto_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -610,65 +610,65 @@ UPB_INLINE char *google_protobuf_FieldDescriptorProto_serialize(const google_pro
return upb_encode(msg, &google_protobuf_FieldDescriptorProto_msginit, arena, len);
}
-UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_name(const google_protobuf_FieldDescriptorProto *msg) { return _upb_hasbit(msg, 6); }
-UPB_INLINE upb_strview google_protobuf_FieldDescriptorProto_name(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(36, 40), upb_strview); }
-UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_extendee(const google_protobuf_FieldDescriptorProto *msg) { return _upb_hasbit(msg, 7); }
-UPB_INLINE upb_strview google_protobuf_FieldDescriptorProto_extendee(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(44, 56), upb_strview); }
-UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_number(const google_protobuf_FieldDescriptorProto *msg) { return _upb_hasbit(msg, 3); }
-UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_number(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), int32_t); }
-UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_label(const google_protobuf_FieldDescriptorProto *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_label(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); }
-UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_type(const google_protobuf_FieldDescriptorProto *msg) { return _upb_hasbit(msg, 2); }
-UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_type(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t); }
-UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_type_name(const google_protobuf_FieldDescriptorProto *msg) { return _upb_hasbit(msg, 8); }
-UPB_INLINE upb_strview google_protobuf_FieldDescriptorProto_type_name(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(52, 72), upb_strview); }
-UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_default_value(const google_protobuf_FieldDescriptorProto *msg) { return _upb_hasbit(msg, 9); }
-UPB_INLINE upb_strview google_protobuf_FieldDescriptorProto_default_value(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(60, 88), upb_strview); }
-UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_options(const google_protobuf_FieldDescriptorProto *msg) { return _upb_hasbit(msg, 11); }
-UPB_INLINE const google_protobuf_FieldOptions* google_protobuf_FieldDescriptorProto_options(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(76, 120), const google_protobuf_FieldOptions*); }
-UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_oneof_index(const google_protobuf_FieldDescriptorProto *msg) { return _upb_hasbit(msg, 4); }
-UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_oneof_index(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 28), int32_t); }
-UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_json_name(const google_protobuf_FieldDescriptorProto *msg) { return _upb_hasbit(msg, 10); }
-UPB_INLINE upb_strview google_protobuf_FieldDescriptorProto_json_name(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(68, 104), upb_strview); }
-UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_proto3_optional(const google_protobuf_FieldDescriptorProto *msg) { return _upb_hasbit(msg, 5); }
-UPB_INLINE bool google_protobuf_FieldDescriptorProto_proto3_optional(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 32), bool); }
+UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_name(const google_protobuf_FieldDescriptorProto *msg) { return _upb_hasbit(msg, 6); }
+UPB_INLINE upb_strview google_protobuf_FieldDescriptorProto_name(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(36, 40), upb_strview); }
+UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_extendee(const google_protobuf_FieldDescriptorProto *msg) { return _upb_hasbit(msg, 7); }
+UPB_INLINE upb_strview google_protobuf_FieldDescriptorProto_extendee(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(44, 56), upb_strview); }
+UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_number(const google_protobuf_FieldDescriptorProto *msg) { return _upb_hasbit(msg, 3); }
+UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_number(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), int32_t); }
+UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_label(const google_protobuf_FieldDescriptorProto *msg) { return _upb_hasbit(msg, 1); }
+UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_label(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); }
+UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_type(const google_protobuf_FieldDescriptorProto *msg) { return _upb_hasbit(msg, 2); }
+UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_type(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t); }
+UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_type_name(const google_protobuf_FieldDescriptorProto *msg) { return _upb_hasbit(msg, 8); }
+UPB_INLINE upb_strview google_protobuf_FieldDescriptorProto_type_name(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(52, 72), upb_strview); }
+UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_default_value(const google_protobuf_FieldDescriptorProto *msg) { return _upb_hasbit(msg, 9); }
+UPB_INLINE upb_strview google_protobuf_FieldDescriptorProto_default_value(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(60, 88), upb_strview); }
+UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_options(const google_protobuf_FieldDescriptorProto *msg) { return _upb_hasbit(msg, 11); }
+UPB_INLINE const google_protobuf_FieldOptions* google_protobuf_FieldDescriptorProto_options(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(76, 120), const google_protobuf_FieldOptions*); }
+UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_oneof_index(const google_protobuf_FieldDescriptorProto *msg) { return _upb_hasbit(msg, 4); }
+UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_oneof_index(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 28), int32_t); }
+UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_json_name(const google_protobuf_FieldDescriptorProto *msg) { return _upb_hasbit(msg, 10); }
+UPB_INLINE upb_strview google_protobuf_FieldDescriptorProto_json_name(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(68, 104), upb_strview); }
+UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_proto3_optional(const google_protobuf_FieldDescriptorProto *msg) { return _upb_hasbit(msg, 5); }
+UPB_INLINE bool google_protobuf_FieldDescriptorProto_proto3_optional(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 32), bool); }
UPB_INLINE void google_protobuf_FieldDescriptorProto_set_name(google_protobuf_FieldDescriptorProto *msg, upb_strview value) {
- _upb_sethas(msg, 6);
- *UPB_PTR_AT(msg, UPB_SIZE(36, 40), upb_strview) = value;
+ _upb_sethas(msg, 6);
+ *UPB_PTR_AT(msg, UPB_SIZE(36, 40), upb_strview) = value;
}
UPB_INLINE void google_protobuf_FieldDescriptorProto_set_extendee(google_protobuf_FieldDescriptorProto *msg, upb_strview value) {
- _upb_sethas(msg, 7);
- *UPB_PTR_AT(msg, UPB_SIZE(44, 56), upb_strview) = value;
+ _upb_sethas(msg, 7);
+ *UPB_PTR_AT(msg, UPB_SIZE(44, 56), upb_strview) = value;
}
UPB_INLINE void google_protobuf_FieldDescriptorProto_set_number(google_protobuf_FieldDescriptorProto *msg, int32_t value) {
_upb_sethas(msg, 3);
- *UPB_PTR_AT(msg, UPB_SIZE(24, 24), int32_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 24), int32_t) = value;
}
UPB_INLINE void google_protobuf_FieldDescriptorProto_set_label(google_protobuf_FieldDescriptorProto *msg, int32_t value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
}
UPB_INLINE void google_protobuf_FieldDescriptorProto_set_type(google_protobuf_FieldDescriptorProto *msg, int32_t value) {
_upb_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t) = value;
}
UPB_INLINE void google_protobuf_FieldDescriptorProto_set_type_name(google_protobuf_FieldDescriptorProto *msg, upb_strview value) {
- _upb_sethas(msg, 8);
- *UPB_PTR_AT(msg, UPB_SIZE(52, 72), upb_strview) = value;
+ _upb_sethas(msg, 8);
+ *UPB_PTR_AT(msg, UPB_SIZE(52, 72), upb_strview) = value;
}
UPB_INLINE void google_protobuf_FieldDescriptorProto_set_default_value(google_protobuf_FieldDescriptorProto *msg, upb_strview value) {
- _upb_sethas(msg, 9);
- *UPB_PTR_AT(msg, UPB_SIZE(60, 88), upb_strview) = value;
+ _upb_sethas(msg, 9);
+ *UPB_PTR_AT(msg, UPB_SIZE(60, 88), upb_strview) = value;
}
UPB_INLINE void google_protobuf_FieldDescriptorProto_set_options(google_protobuf_FieldDescriptorProto *msg, google_protobuf_FieldOptions* value) {
- _upb_sethas(msg, 11);
- *UPB_PTR_AT(msg, UPB_SIZE(76, 120), google_protobuf_FieldOptions*) = value;
+ _upb_sethas(msg, 11);
+ *UPB_PTR_AT(msg, UPB_SIZE(76, 120), google_protobuf_FieldOptions*) = value;
}
UPB_INLINE struct google_protobuf_FieldOptions* google_protobuf_FieldDescriptorProto_mutable_options(google_protobuf_FieldDescriptorProto *msg, upb_arena *arena) {
struct google_protobuf_FieldOptions* sub = (struct google_protobuf_FieldOptions*)google_protobuf_FieldDescriptorProto_options(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_FieldOptions*)_upb_msg_new(&google_protobuf_FieldOptions_msginit, arena);
+ sub = (struct google_protobuf_FieldOptions*)_upb_msg_new(&google_protobuf_FieldOptions_msginit, arena);
if (!sub) return NULL;
google_protobuf_FieldDescriptorProto_set_options(msg, sub);
}
@@ -676,21 +676,21 @@ UPB_INLINE struct google_protobuf_FieldOptions* google_protobuf_FieldDescriptorP
}
UPB_INLINE void google_protobuf_FieldDescriptorProto_set_oneof_index(google_protobuf_FieldDescriptorProto *msg, int32_t value) {
_upb_sethas(msg, 4);
- *UPB_PTR_AT(msg, UPB_SIZE(28, 28), int32_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 28), int32_t) = value;
}
UPB_INLINE void google_protobuf_FieldDescriptorProto_set_json_name(google_protobuf_FieldDescriptorProto *msg, upb_strview value) {
- _upb_sethas(msg, 10);
- *UPB_PTR_AT(msg, UPB_SIZE(68, 104), upb_strview) = value;
+ _upb_sethas(msg, 10);
+ *UPB_PTR_AT(msg, UPB_SIZE(68, 104), upb_strview) = value;
+}
+UPB_INLINE void google_protobuf_FieldDescriptorProto_set_proto3_optional(google_protobuf_FieldDescriptorProto *msg, bool value) {
+ _upb_sethas(msg, 5);
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 32), bool) = value;
}
-UPB_INLINE void google_protobuf_FieldDescriptorProto_set_proto3_optional(google_protobuf_FieldDescriptorProto *msg, bool value) {
- _upb_sethas(msg, 5);
- *UPB_PTR_AT(msg, UPB_SIZE(32, 32), bool) = value;
-}
/* google.protobuf.OneofDescriptorProto */
UPB_INLINE google_protobuf_OneofDescriptorProto *google_protobuf_OneofDescriptorProto_new(upb_arena *arena) {
- return (google_protobuf_OneofDescriptorProto *)_upb_msg_new(&google_protobuf_OneofDescriptorProto_msginit, arena);
+ return (google_protobuf_OneofDescriptorProto *)_upb_msg_new(&google_protobuf_OneofDescriptorProto_msginit, arena);
}
UPB_INLINE google_protobuf_OneofDescriptorProto *google_protobuf_OneofDescriptorProto_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -701,23 +701,23 @@ UPB_INLINE char *google_protobuf_OneofDescriptorProto_serialize(const google_pro
return upb_encode(msg, &google_protobuf_OneofDescriptorProto_msginit, arena, len);
}
-UPB_INLINE bool google_protobuf_OneofDescriptorProto_has_name(const google_protobuf_OneofDescriptorProto *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE upb_strview google_protobuf_OneofDescriptorProto_name(const google_protobuf_OneofDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
-UPB_INLINE bool google_protobuf_OneofDescriptorProto_has_options(const google_protobuf_OneofDescriptorProto *msg) { return _upb_hasbit(msg, 2); }
-UPB_INLINE const google_protobuf_OneofOptions* google_protobuf_OneofDescriptorProto_options(const google_protobuf_OneofDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const google_protobuf_OneofOptions*); }
+UPB_INLINE bool google_protobuf_OneofDescriptorProto_has_name(const google_protobuf_OneofDescriptorProto *msg) { return _upb_hasbit(msg, 1); }
+UPB_INLINE upb_strview google_protobuf_OneofDescriptorProto_name(const google_protobuf_OneofDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
+UPB_INLINE bool google_protobuf_OneofDescriptorProto_has_options(const google_protobuf_OneofDescriptorProto *msg) { return _upb_hasbit(msg, 2); }
+UPB_INLINE const google_protobuf_OneofOptions* google_protobuf_OneofDescriptorProto_options(const google_protobuf_OneofDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const google_protobuf_OneofOptions*); }
UPB_INLINE void google_protobuf_OneofDescriptorProto_set_name(google_protobuf_OneofDescriptorProto *msg, upb_strview value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
}
UPB_INLINE void google_protobuf_OneofDescriptorProto_set_options(google_protobuf_OneofDescriptorProto *msg, google_protobuf_OneofOptions* value) {
_upb_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), google_protobuf_OneofOptions*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), google_protobuf_OneofOptions*) = value;
}
UPB_INLINE struct google_protobuf_OneofOptions* google_protobuf_OneofDescriptorProto_mutable_options(google_protobuf_OneofDescriptorProto *msg, upb_arena *arena) {
struct google_protobuf_OneofOptions* sub = (struct google_protobuf_OneofOptions*)google_protobuf_OneofDescriptorProto_options(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_OneofOptions*)_upb_msg_new(&google_protobuf_OneofOptions_msginit, arena);
+ sub = (struct google_protobuf_OneofOptions*)_upb_msg_new(&google_protobuf_OneofOptions_msginit, arena);
if (!sub) return NULL;
google_protobuf_OneofDescriptorProto_set_options(msg, sub);
}
@@ -727,7 +727,7 @@ UPB_INLINE struct google_protobuf_OneofOptions* google_protobuf_OneofDescriptorP
/* google.protobuf.EnumDescriptorProto */
UPB_INLINE google_protobuf_EnumDescriptorProto *google_protobuf_EnumDescriptorProto_new(upb_arena *arena) {
- return (google_protobuf_EnumDescriptorProto *)_upb_msg_new(&google_protobuf_EnumDescriptorProto_msginit, arena);
+ return (google_protobuf_EnumDescriptorProto *)_upb_msg_new(&google_protobuf_EnumDescriptorProto_msginit, arena);
}
UPB_INLINE google_protobuf_EnumDescriptorProto *google_protobuf_EnumDescriptorProto_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -738,28 +738,28 @@ UPB_INLINE char *google_protobuf_EnumDescriptorProto_serialize(const google_prot
return upb_encode(msg, &google_protobuf_EnumDescriptorProto_msginit, arena, len);
}
-UPB_INLINE bool google_protobuf_EnumDescriptorProto_has_name(const google_protobuf_EnumDescriptorProto *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE upb_strview google_protobuf_EnumDescriptorProto_name(const google_protobuf_EnumDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
-UPB_INLINE bool google_protobuf_EnumDescriptorProto_has_value(const google_protobuf_EnumDescriptorProto *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); }
+UPB_INLINE bool google_protobuf_EnumDescriptorProto_has_name(const google_protobuf_EnumDescriptorProto *msg) { return _upb_hasbit(msg, 1); }
+UPB_INLINE upb_strview google_protobuf_EnumDescriptorProto_name(const google_protobuf_EnumDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
+UPB_INLINE bool google_protobuf_EnumDescriptorProto_has_value(const google_protobuf_EnumDescriptorProto *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); }
UPB_INLINE const google_protobuf_EnumValueDescriptorProto* const* google_protobuf_EnumDescriptorProto_value(const google_protobuf_EnumDescriptorProto *msg, size_t *len) { return (const google_protobuf_EnumValueDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(16, 32), len); }
-UPB_INLINE bool google_protobuf_EnumDescriptorProto_has_options(const google_protobuf_EnumDescriptorProto *msg) { return _upb_hasbit(msg, 2); }
-UPB_INLINE const google_protobuf_EnumOptions* google_protobuf_EnumDescriptorProto_options(const google_protobuf_EnumDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const google_protobuf_EnumOptions*); }
-UPB_INLINE bool google_protobuf_EnumDescriptorProto_has_reserved_range(const google_protobuf_EnumDescriptorProto *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 40)); }
+UPB_INLINE bool google_protobuf_EnumDescriptorProto_has_options(const google_protobuf_EnumDescriptorProto *msg) { return _upb_hasbit(msg, 2); }
+UPB_INLINE const google_protobuf_EnumOptions* google_protobuf_EnumDescriptorProto_options(const google_protobuf_EnumDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const google_protobuf_EnumOptions*); }
+UPB_INLINE bool google_protobuf_EnumDescriptorProto_has_reserved_range(const google_protobuf_EnumDescriptorProto *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 40)); }
UPB_INLINE const google_protobuf_EnumDescriptorProto_EnumReservedRange* const* google_protobuf_EnumDescriptorProto_reserved_range(const google_protobuf_EnumDescriptorProto *msg, size_t *len) { return (const google_protobuf_EnumDescriptorProto_EnumReservedRange* const*)_upb_array_accessor(msg, UPB_SIZE(20, 40), len); }
UPB_INLINE upb_strview const* google_protobuf_EnumDescriptorProto_reserved_name(const google_protobuf_EnumDescriptorProto *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(24, 48), len); }
UPB_INLINE void google_protobuf_EnumDescriptorProto_set_name(google_protobuf_EnumDescriptorProto *msg, upb_strview value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
}
UPB_INLINE google_protobuf_EnumValueDescriptorProto** google_protobuf_EnumDescriptorProto_mutable_value(google_protobuf_EnumDescriptorProto *msg, size_t *len) {
return (google_protobuf_EnumValueDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 32), len);
}
UPB_INLINE google_protobuf_EnumValueDescriptorProto** google_protobuf_EnumDescriptorProto_resize_value(google_protobuf_EnumDescriptorProto *msg, size_t len, upb_arena *arena) {
- return (google_protobuf_EnumValueDescriptorProto**)_upb_array_resize_accessor(msg, UPB_SIZE(16, 32), len, UPB_TYPE_MESSAGE, arena);
+ return (google_protobuf_EnumValueDescriptorProto**)_upb_array_resize_accessor(msg, UPB_SIZE(16, 32), len, UPB_TYPE_MESSAGE, arena);
}
UPB_INLINE struct google_protobuf_EnumValueDescriptorProto* google_protobuf_EnumDescriptorProto_add_value(google_protobuf_EnumDescriptorProto *msg, upb_arena *arena) {
- struct google_protobuf_EnumValueDescriptorProto* sub = (struct google_protobuf_EnumValueDescriptorProto*)_upb_msg_new(&google_protobuf_EnumValueDescriptorProto_msginit, arena);
+ struct google_protobuf_EnumValueDescriptorProto* sub = (struct google_protobuf_EnumValueDescriptorProto*)_upb_msg_new(&google_protobuf_EnumValueDescriptorProto_msginit, arena);
bool ok = _upb_array_append_accessor(
msg, UPB_SIZE(16, 32), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
if (!ok) return NULL;
@@ -767,12 +767,12 @@ UPB_INLINE struct google_protobuf_EnumValueDescriptorProto* google_protobuf_Enum
}
UPB_INLINE void google_protobuf_EnumDescriptorProto_set_options(google_protobuf_EnumDescriptorProto *msg, google_protobuf_EnumOptions* value) {
_upb_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), google_protobuf_EnumOptions*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), google_protobuf_EnumOptions*) = value;
}
UPB_INLINE struct google_protobuf_EnumOptions* google_protobuf_EnumDescriptorProto_mutable_options(google_protobuf_EnumDescriptorProto *msg, upb_arena *arena) {
struct google_protobuf_EnumOptions* sub = (struct google_protobuf_EnumOptions*)google_protobuf_EnumDescriptorProto_options(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_EnumOptions*)_upb_msg_new(&google_protobuf_EnumOptions_msginit, arena);
+ sub = (struct google_protobuf_EnumOptions*)_upb_msg_new(&google_protobuf_EnumOptions_msginit, arena);
if (!sub) return NULL;
google_protobuf_EnumDescriptorProto_set_options(msg, sub);
}
@@ -782,10 +782,10 @@ UPB_INLINE google_protobuf_EnumDescriptorProto_EnumReservedRange** google_protob
return (google_protobuf_EnumDescriptorProto_EnumReservedRange**)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 40), len);
}
UPB_INLINE google_protobuf_EnumDescriptorProto_EnumReservedRange** google_protobuf_EnumDescriptorProto_resize_reserved_range(google_protobuf_EnumDescriptorProto *msg, size_t len, upb_arena *arena) {
- return (google_protobuf_EnumDescriptorProto_EnumReservedRange**)_upb_array_resize_accessor(msg, UPB_SIZE(20, 40), len, UPB_TYPE_MESSAGE, arena);
+ return (google_protobuf_EnumDescriptorProto_EnumReservedRange**)_upb_array_resize_accessor(msg, UPB_SIZE(20, 40), len, UPB_TYPE_MESSAGE, arena);
}
UPB_INLINE struct google_protobuf_EnumDescriptorProto_EnumReservedRange* google_protobuf_EnumDescriptorProto_add_reserved_range(google_protobuf_EnumDescriptorProto *msg, upb_arena *arena) {
- struct google_protobuf_EnumDescriptorProto_EnumReservedRange* sub = (struct google_protobuf_EnumDescriptorProto_EnumReservedRange*)_upb_msg_new(&google_protobuf_EnumDescriptorProto_EnumReservedRange_msginit, arena);
+ struct google_protobuf_EnumDescriptorProto_EnumReservedRange* sub = (struct google_protobuf_EnumDescriptorProto_EnumReservedRange*)_upb_msg_new(&google_protobuf_EnumDescriptorProto_EnumReservedRange_msginit, arena);
bool ok = _upb_array_append_accessor(
msg, UPB_SIZE(20, 40), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
if (!ok) return NULL;
@@ -795,17 +795,17 @@ UPB_INLINE upb_strview* google_protobuf_EnumDescriptorProto_mutable_reserved_nam
return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 48), len);
}
UPB_INLINE upb_strview* google_protobuf_EnumDescriptorProto_resize_reserved_name(google_protobuf_EnumDescriptorProto *msg, size_t len, upb_arena *arena) {
- return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(24, 48), len, UPB_TYPE_STRING, arena);
+ return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(24, 48), len, UPB_TYPE_STRING, arena);
}
UPB_INLINE bool google_protobuf_EnumDescriptorProto_add_reserved_name(google_protobuf_EnumDescriptorProto *msg, upb_strview val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(24, 48), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
- arena);
+ return _upb_array_append_accessor(msg, UPB_SIZE(24, 48), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
+ arena);
}
/* google.protobuf.EnumDescriptorProto.EnumReservedRange */
UPB_INLINE google_protobuf_EnumDescriptorProto_EnumReservedRange *google_protobuf_EnumDescriptorProto_EnumReservedRange_new(upb_arena *arena) {
- return (google_protobuf_EnumDescriptorProto_EnumReservedRange *)_upb_msg_new(&google_protobuf_EnumDescriptorProto_EnumReservedRange_msginit, arena);
+ return (google_protobuf_EnumDescriptorProto_EnumReservedRange *)_upb_msg_new(&google_protobuf_EnumDescriptorProto_EnumReservedRange_msginit, arena);
}
UPB_INLINE google_protobuf_EnumDescriptorProto_EnumReservedRange *google_protobuf_EnumDescriptorProto_EnumReservedRange_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -816,24 +816,24 @@ UPB_INLINE char *google_protobuf_EnumDescriptorProto_EnumReservedRange_serialize
return upb_encode(msg, &google_protobuf_EnumDescriptorProto_EnumReservedRange_msginit, arena, len);
}
-UPB_INLINE bool google_protobuf_EnumDescriptorProto_EnumReservedRange_has_start(const google_protobuf_EnumDescriptorProto_EnumReservedRange *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE int32_t google_protobuf_EnumDescriptorProto_EnumReservedRange_start(const google_protobuf_EnumDescriptorProto_EnumReservedRange *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); }
-UPB_INLINE bool google_protobuf_EnumDescriptorProto_EnumReservedRange_has_end(const google_protobuf_EnumDescriptorProto_EnumReservedRange *msg) { return _upb_hasbit(msg, 2); }
-UPB_INLINE int32_t google_protobuf_EnumDescriptorProto_EnumReservedRange_end(const google_protobuf_EnumDescriptorProto_EnumReservedRange *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); }
+UPB_INLINE bool google_protobuf_EnumDescriptorProto_EnumReservedRange_has_start(const google_protobuf_EnumDescriptorProto_EnumReservedRange *msg) { return _upb_hasbit(msg, 1); }
+UPB_INLINE int32_t google_protobuf_EnumDescriptorProto_EnumReservedRange_start(const google_protobuf_EnumDescriptorProto_EnumReservedRange *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); }
+UPB_INLINE bool google_protobuf_EnumDescriptorProto_EnumReservedRange_has_end(const google_protobuf_EnumDescriptorProto_EnumReservedRange *msg) { return _upb_hasbit(msg, 2); }
+UPB_INLINE int32_t google_protobuf_EnumDescriptorProto_EnumReservedRange_end(const google_protobuf_EnumDescriptorProto_EnumReservedRange *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); }
UPB_INLINE void google_protobuf_EnumDescriptorProto_EnumReservedRange_set_start(google_protobuf_EnumDescriptorProto_EnumReservedRange *msg, int32_t value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value;
}
UPB_INLINE void google_protobuf_EnumDescriptorProto_EnumReservedRange_set_end(google_protobuf_EnumDescriptorProto_EnumReservedRange *msg, int32_t value) {
_upb_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
}
/* google.protobuf.EnumValueDescriptorProto */
UPB_INLINE google_protobuf_EnumValueDescriptorProto *google_protobuf_EnumValueDescriptorProto_new(upb_arena *arena) {
- return (google_protobuf_EnumValueDescriptorProto *)_upb_msg_new(&google_protobuf_EnumValueDescriptorProto_msginit, arena);
+ return (google_protobuf_EnumValueDescriptorProto *)_upb_msg_new(&google_protobuf_EnumValueDescriptorProto_msginit, arena);
}
UPB_INLINE google_protobuf_EnumValueDescriptorProto *google_protobuf_EnumValueDescriptorProto_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -844,29 +844,29 @@ UPB_INLINE char *google_protobuf_EnumValueDescriptorProto_serialize(const google
return upb_encode(msg, &google_protobuf_EnumValueDescriptorProto_msginit, arena, len);
}
-UPB_INLINE bool google_protobuf_EnumValueDescriptorProto_has_name(const google_protobuf_EnumValueDescriptorProto *msg) { return _upb_hasbit(msg, 2); }
-UPB_INLINE upb_strview google_protobuf_EnumValueDescriptorProto_name(const google_protobuf_EnumValueDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview); }
-UPB_INLINE bool google_protobuf_EnumValueDescriptorProto_has_number(const google_protobuf_EnumValueDescriptorProto *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE int32_t google_protobuf_EnumValueDescriptorProto_number(const google_protobuf_EnumValueDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); }
-UPB_INLINE bool google_protobuf_EnumValueDescriptorProto_has_options(const google_protobuf_EnumValueDescriptorProto *msg) { return _upb_hasbit(msg, 3); }
-UPB_INLINE const google_protobuf_EnumValueOptions* google_protobuf_EnumValueDescriptorProto_options(const google_protobuf_EnumValueDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const google_protobuf_EnumValueOptions*); }
+UPB_INLINE bool google_protobuf_EnumValueDescriptorProto_has_name(const google_protobuf_EnumValueDescriptorProto *msg) { return _upb_hasbit(msg, 2); }
+UPB_INLINE upb_strview google_protobuf_EnumValueDescriptorProto_name(const google_protobuf_EnumValueDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview); }
+UPB_INLINE bool google_protobuf_EnumValueDescriptorProto_has_number(const google_protobuf_EnumValueDescriptorProto *msg) { return _upb_hasbit(msg, 1); }
+UPB_INLINE int32_t google_protobuf_EnumValueDescriptorProto_number(const google_protobuf_EnumValueDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); }
+UPB_INLINE bool google_protobuf_EnumValueDescriptorProto_has_options(const google_protobuf_EnumValueDescriptorProto *msg) { return _upb_hasbit(msg, 3); }
+UPB_INLINE const google_protobuf_EnumValueOptions* google_protobuf_EnumValueDescriptorProto_options(const google_protobuf_EnumValueDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const google_protobuf_EnumValueOptions*); }
UPB_INLINE void google_protobuf_EnumValueDescriptorProto_set_name(google_protobuf_EnumValueDescriptorProto *msg, upb_strview value) {
_upb_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview) = value;
}
UPB_INLINE void google_protobuf_EnumValueDescriptorProto_set_number(google_protobuf_EnumValueDescriptorProto *msg, int32_t value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value;
}
UPB_INLINE void google_protobuf_EnumValueDescriptorProto_set_options(google_protobuf_EnumValueDescriptorProto *msg, google_protobuf_EnumValueOptions* value) {
_upb_sethas(msg, 3);
- *UPB_PTR_AT(msg, UPB_SIZE(16, 24), google_protobuf_EnumValueOptions*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), google_protobuf_EnumValueOptions*) = value;
}
UPB_INLINE struct google_protobuf_EnumValueOptions* google_protobuf_EnumValueDescriptorProto_mutable_options(google_protobuf_EnumValueDescriptorProto *msg, upb_arena *arena) {
struct google_protobuf_EnumValueOptions* sub = (struct google_protobuf_EnumValueOptions*)google_protobuf_EnumValueDescriptorProto_options(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_EnumValueOptions*)_upb_msg_new(&google_protobuf_EnumValueOptions_msginit, arena);
+ sub = (struct google_protobuf_EnumValueOptions*)_upb_msg_new(&google_protobuf_EnumValueOptions_msginit, arena);
if (!sub) return NULL;
google_protobuf_EnumValueDescriptorProto_set_options(msg, sub);
}
@@ -876,7 +876,7 @@ UPB_INLINE struct google_protobuf_EnumValueOptions* google_protobuf_EnumValueDes
/* google.protobuf.ServiceDescriptorProto */
UPB_INLINE google_protobuf_ServiceDescriptorProto *google_protobuf_ServiceDescriptorProto_new(upb_arena *arena) {
- return (google_protobuf_ServiceDescriptorProto *)_upb_msg_new(&google_protobuf_ServiceDescriptorProto_msginit, arena);
+ return (google_protobuf_ServiceDescriptorProto *)_upb_msg_new(&google_protobuf_ServiceDescriptorProto_msginit, arena);
}
UPB_INLINE google_protobuf_ServiceDescriptorProto *google_protobuf_ServiceDescriptorProto_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -887,25 +887,25 @@ UPB_INLINE char *google_protobuf_ServiceDescriptorProto_serialize(const google_p
return upb_encode(msg, &google_protobuf_ServiceDescriptorProto_msginit, arena, len);
}
-UPB_INLINE bool google_protobuf_ServiceDescriptorProto_has_name(const google_protobuf_ServiceDescriptorProto *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE upb_strview google_protobuf_ServiceDescriptorProto_name(const google_protobuf_ServiceDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
-UPB_INLINE bool google_protobuf_ServiceDescriptorProto_has_method(const google_protobuf_ServiceDescriptorProto *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); }
+UPB_INLINE bool google_protobuf_ServiceDescriptorProto_has_name(const google_protobuf_ServiceDescriptorProto *msg) { return _upb_hasbit(msg, 1); }
+UPB_INLINE upb_strview google_protobuf_ServiceDescriptorProto_name(const google_protobuf_ServiceDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
+UPB_INLINE bool google_protobuf_ServiceDescriptorProto_has_method(const google_protobuf_ServiceDescriptorProto *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); }
UPB_INLINE const google_protobuf_MethodDescriptorProto* const* google_protobuf_ServiceDescriptorProto_method(const google_protobuf_ServiceDescriptorProto *msg, size_t *len) { return (const google_protobuf_MethodDescriptorProto* const*)_upb_array_accessor(msg, UPB_SIZE(16, 32), len); }
-UPB_INLINE bool google_protobuf_ServiceDescriptorProto_has_options(const google_protobuf_ServiceDescriptorProto *msg) { return _upb_hasbit(msg, 2); }
-UPB_INLINE const google_protobuf_ServiceOptions* google_protobuf_ServiceDescriptorProto_options(const google_protobuf_ServiceDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const google_protobuf_ServiceOptions*); }
+UPB_INLINE bool google_protobuf_ServiceDescriptorProto_has_options(const google_protobuf_ServiceDescriptorProto *msg) { return _upb_hasbit(msg, 2); }
+UPB_INLINE const google_protobuf_ServiceOptions* google_protobuf_ServiceDescriptorProto_options(const google_protobuf_ServiceDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const google_protobuf_ServiceOptions*); }
UPB_INLINE void google_protobuf_ServiceDescriptorProto_set_name(google_protobuf_ServiceDescriptorProto *msg, upb_strview value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
}
UPB_INLINE google_protobuf_MethodDescriptorProto** google_protobuf_ServiceDescriptorProto_mutable_method(google_protobuf_ServiceDescriptorProto *msg, size_t *len) {
return (google_protobuf_MethodDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 32), len);
}
UPB_INLINE google_protobuf_MethodDescriptorProto** google_protobuf_ServiceDescriptorProto_resize_method(google_protobuf_ServiceDescriptorProto *msg, size_t len, upb_arena *arena) {
- return (google_protobuf_MethodDescriptorProto**)_upb_array_resize_accessor(msg, UPB_SIZE(16, 32), len, UPB_TYPE_MESSAGE, arena);
+ return (google_protobuf_MethodDescriptorProto**)_upb_array_resize_accessor(msg, UPB_SIZE(16, 32), len, UPB_TYPE_MESSAGE, arena);
}
UPB_INLINE struct google_protobuf_MethodDescriptorProto* google_protobuf_ServiceDescriptorProto_add_method(google_protobuf_ServiceDescriptorProto *msg, upb_arena *arena) {
- struct google_protobuf_MethodDescriptorProto* sub = (struct google_protobuf_MethodDescriptorProto*)_upb_msg_new(&google_protobuf_MethodDescriptorProto_msginit, arena);
+ struct google_protobuf_MethodDescriptorProto* sub = (struct google_protobuf_MethodDescriptorProto*)_upb_msg_new(&google_protobuf_MethodDescriptorProto_msginit, arena);
bool ok = _upb_array_append_accessor(
msg, UPB_SIZE(16, 32), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
if (!ok) return NULL;
@@ -913,12 +913,12 @@ UPB_INLINE struct google_protobuf_MethodDescriptorProto* google_protobuf_Service
}
UPB_INLINE void google_protobuf_ServiceDescriptorProto_set_options(google_protobuf_ServiceDescriptorProto *msg, google_protobuf_ServiceOptions* value) {
_upb_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), google_protobuf_ServiceOptions*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), google_protobuf_ServiceOptions*) = value;
}
UPB_INLINE struct google_protobuf_ServiceOptions* google_protobuf_ServiceDescriptorProto_mutable_options(google_protobuf_ServiceDescriptorProto *msg, upb_arena *arena) {
struct google_protobuf_ServiceOptions* sub = (struct google_protobuf_ServiceOptions*)google_protobuf_ServiceDescriptorProto_options(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_ServiceOptions*)_upb_msg_new(&google_protobuf_ServiceOptions_msginit, arena);
+ sub = (struct google_protobuf_ServiceOptions*)_upb_msg_new(&google_protobuf_ServiceOptions_msginit, arena);
if (!sub) return NULL;
google_protobuf_ServiceDescriptorProto_set_options(msg, sub);
}
@@ -928,7 +928,7 @@ UPB_INLINE struct google_protobuf_ServiceOptions* google_protobuf_ServiceDescrip
/* google.protobuf.MethodDescriptorProto */
UPB_INLINE google_protobuf_MethodDescriptorProto *google_protobuf_MethodDescriptorProto_new(upb_arena *arena) {
- return (google_protobuf_MethodDescriptorProto *)_upb_msg_new(&google_protobuf_MethodDescriptorProto_msginit, arena);
+ return (google_protobuf_MethodDescriptorProto *)_upb_msg_new(&google_protobuf_MethodDescriptorProto_msginit, arena);
}
UPB_INLINE google_protobuf_MethodDescriptorProto *google_protobuf_MethodDescriptorProto_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -939,39 +939,39 @@ UPB_INLINE char *google_protobuf_MethodDescriptorProto_serialize(const google_pr
return upb_encode(msg, &google_protobuf_MethodDescriptorProto_msginit, arena, len);
}
-UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_name(const google_protobuf_MethodDescriptorProto *msg) { return _upb_hasbit(msg, 3); }
-UPB_INLINE upb_strview google_protobuf_MethodDescriptorProto_name(const google_protobuf_MethodDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
-UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_input_type(const google_protobuf_MethodDescriptorProto *msg) { return _upb_hasbit(msg, 4); }
-UPB_INLINE upb_strview google_protobuf_MethodDescriptorProto_input_type(const google_protobuf_MethodDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview); }
-UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_output_type(const google_protobuf_MethodDescriptorProto *msg) { return _upb_hasbit(msg, 5); }
-UPB_INLINE upb_strview google_protobuf_MethodDescriptorProto_output_type(const google_protobuf_MethodDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_strview); }
-UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_options(const google_protobuf_MethodDescriptorProto *msg) { return _upb_hasbit(msg, 6); }
-UPB_INLINE const google_protobuf_MethodOptions* google_protobuf_MethodDescriptorProto_options(const google_protobuf_MethodDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 56), const google_protobuf_MethodOptions*); }
-UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_client_streaming(const google_protobuf_MethodDescriptorProto *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE bool google_protobuf_MethodDescriptorProto_client_streaming(const google_protobuf_MethodDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); }
-UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_server_streaming(const google_protobuf_MethodDescriptorProto *msg) { return _upb_hasbit(msg, 2); }
-UPB_INLINE bool google_protobuf_MethodDescriptorProto_server_streaming(const google_protobuf_MethodDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool); }
+UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_name(const google_protobuf_MethodDescriptorProto *msg) { return _upb_hasbit(msg, 3); }
+UPB_INLINE upb_strview google_protobuf_MethodDescriptorProto_name(const google_protobuf_MethodDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
+UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_input_type(const google_protobuf_MethodDescriptorProto *msg) { return _upb_hasbit(msg, 4); }
+UPB_INLINE upb_strview google_protobuf_MethodDescriptorProto_input_type(const google_protobuf_MethodDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview); }
+UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_output_type(const google_protobuf_MethodDescriptorProto *msg) { return _upb_hasbit(msg, 5); }
+UPB_INLINE upb_strview google_protobuf_MethodDescriptorProto_output_type(const google_protobuf_MethodDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_strview); }
+UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_options(const google_protobuf_MethodDescriptorProto *msg) { return _upb_hasbit(msg, 6); }
+UPB_INLINE const google_protobuf_MethodOptions* google_protobuf_MethodDescriptorProto_options(const google_protobuf_MethodDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 56), const google_protobuf_MethodOptions*); }
+UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_client_streaming(const google_protobuf_MethodDescriptorProto *msg) { return _upb_hasbit(msg, 1); }
+UPB_INLINE bool google_protobuf_MethodDescriptorProto_client_streaming(const google_protobuf_MethodDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); }
+UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_server_streaming(const google_protobuf_MethodDescriptorProto *msg) { return _upb_hasbit(msg, 2); }
+UPB_INLINE bool google_protobuf_MethodDescriptorProto_server_streaming(const google_protobuf_MethodDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool); }
UPB_INLINE void google_protobuf_MethodDescriptorProto_set_name(google_protobuf_MethodDescriptorProto *msg, upb_strview value) {
_upb_sethas(msg, 3);
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
}
UPB_INLINE void google_protobuf_MethodDescriptorProto_set_input_type(google_protobuf_MethodDescriptorProto *msg, upb_strview value) {
_upb_sethas(msg, 4);
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview) = value;
}
UPB_INLINE void google_protobuf_MethodDescriptorProto_set_output_type(google_protobuf_MethodDescriptorProto *msg, upb_strview value) {
_upb_sethas(msg, 5);
- *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_strview) = value;
}
UPB_INLINE void google_protobuf_MethodDescriptorProto_set_options(google_protobuf_MethodDescriptorProto *msg, google_protobuf_MethodOptions* value) {
_upb_sethas(msg, 6);
- *UPB_PTR_AT(msg, UPB_SIZE(28, 56), google_protobuf_MethodOptions*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 56), google_protobuf_MethodOptions*) = value;
}
UPB_INLINE struct google_protobuf_MethodOptions* google_protobuf_MethodDescriptorProto_mutable_options(google_protobuf_MethodDescriptorProto *msg, upb_arena *arena) {
struct google_protobuf_MethodOptions* sub = (struct google_protobuf_MethodOptions*)google_protobuf_MethodDescriptorProto_options(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_MethodOptions*)_upb_msg_new(&google_protobuf_MethodOptions_msginit, arena);
+ sub = (struct google_protobuf_MethodOptions*)_upb_msg_new(&google_protobuf_MethodOptions_msginit, arena);
if (!sub) return NULL;
google_protobuf_MethodDescriptorProto_set_options(msg, sub);
}
@@ -979,17 +979,17 @@ UPB_INLINE struct google_protobuf_MethodOptions* google_protobuf_MethodDescripto
}
UPB_INLINE void google_protobuf_MethodDescriptorProto_set_client_streaming(google_protobuf_MethodDescriptorProto *msg, bool value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
}
UPB_INLINE void google_protobuf_MethodDescriptorProto_set_server_streaming(google_protobuf_MethodDescriptorProto *msg, bool value) {
_upb_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = value;
}
/* google.protobuf.FileOptions */
UPB_INLINE google_protobuf_FileOptions *google_protobuf_FileOptions_new(upb_arena *arena) {
- return (google_protobuf_FileOptions *)_upb_msg_new(&google_protobuf_FileOptions_msginit, arena);
+ return (google_protobuf_FileOptions *)_upb_msg_new(&google_protobuf_FileOptions_msginit, arena);
}
UPB_INLINE google_protobuf_FileOptions *google_protobuf_FileOptions_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -1000,137 +1000,137 @@ UPB_INLINE char *google_protobuf_FileOptions_serialize(const google_protobuf_Fil
return upb_encode(msg, &google_protobuf_FileOptions_msginit, arena, len);
}
-UPB_INLINE bool google_protobuf_FileOptions_has_java_package(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 11); }
-UPB_INLINE upb_strview google_protobuf_FileOptions_java_package(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 32), upb_strview); }
-UPB_INLINE bool google_protobuf_FileOptions_has_java_outer_classname(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 12); }
-UPB_INLINE upb_strview google_protobuf_FileOptions_java_outer_classname(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(36, 48), upb_strview); }
-UPB_INLINE bool google_protobuf_FileOptions_has_optimize_for(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE int32_t google_protobuf_FileOptions_optimize_for(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); }
-UPB_INLINE bool google_protobuf_FileOptions_has_java_multiple_files(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 2); }
-UPB_INLINE bool google_protobuf_FileOptions_java_multiple_files(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), bool); }
-UPB_INLINE bool google_protobuf_FileOptions_has_go_package(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 13); }
-UPB_INLINE upb_strview google_protobuf_FileOptions_go_package(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(44, 64), upb_strview); }
-UPB_INLINE bool google_protobuf_FileOptions_has_cc_generic_services(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 3); }
-UPB_INLINE bool google_protobuf_FileOptions_cc_generic_services(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(17, 17), bool); }
-UPB_INLINE bool google_protobuf_FileOptions_has_java_generic_services(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 4); }
-UPB_INLINE bool google_protobuf_FileOptions_java_generic_services(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(18, 18), bool); }
-UPB_INLINE bool google_protobuf_FileOptions_has_py_generic_services(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 5); }
-UPB_INLINE bool google_protobuf_FileOptions_py_generic_services(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(19, 19), bool); }
-UPB_INLINE bool google_protobuf_FileOptions_has_java_generate_equals_and_hash(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 6); }
-UPB_INLINE bool google_protobuf_FileOptions_java_generate_equals_and_hash(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 20), bool); }
-UPB_INLINE bool google_protobuf_FileOptions_has_deprecated(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 7); }
-UPB_INLINE bool google_protobuf_FileOptions_deprecated(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(21, 21), bool); }
-UPB_INLINE bool google_protobuf_FileOptions_has_java_string_check_utf8(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 8); }
-UPB_INLINE bool google_protobuf_FileOptions_java_string_check_utf8(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(22, 22), bool); }
-UPB_INLINE bool google_protobuf_FileOptions_has_cc_enable_arenas(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 9); }
-UPB_INLINE bool google_protobuf_FileOptions_cc_enable_arenas(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(23, 23), bool); }
-UPB_INLINE bool google_protobuf_FileOptions_has_objc_class_prefix(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 14); }
-UPB_INLINE upb_strview google_protobuf_FileOptions_objc_class_prefix(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(52, 80), upb_strview); }
-UPB_INLINE bool google_protobuf_FileOptions_has_csharp_namespace(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 15); }
-UPB_INLINE upb_strview google_protobuf_FileOptions_csharp_namespace(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(60, 96), upb_strview); }
-UPB_INLINE bool google_protobuf_FileOptions_has_swift_prefix(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 16); }
-UPB_INLINE upb_strview google_protobuf_FileOptions_swift_prefix(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(68, 112), upb_strview); }
-UPB_INLINE bool google_protobuf_FileOptions_has_php_class_prefix(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 17); }
-UPB_INLINE upb_strview google_protobuf_FileOptions_php_class_prefix(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(76, 128), upb_strview); }
-UPB_INLINE bool google_protobuf_FileOptions_has_php_namespace(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 18); }
-UPB_INLINE upb_strview google_protobuf_FileOptions_php_namespace(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(84, 144), upb_strview); }
-UPB_INLINE bool google_protobuf_FileOptions_has_php_generic_services(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 10); }
-UPB_INLINE bool google_protobuf_FileOptions_php_generic_services(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool); }
-UPB_INLINE bool google_protobuf_FileOptions_has_php_metadata_namespace(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 19); }
-UPB_INLINE upb_strview google_protobuf_FileOptions_php_metadata_namespace(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(92, 160), upb_strview); }
-UPB_INLINE bool google_protobuf_FileOptions_has_ruby_package(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 20); }
-UPB_INLINE upb_strview google_protobuf_FileOptions_ruby_package(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(100, 176), upb_strview); }
-UPB_INLINE bool google_protobuf_FileOptions_has_uninterpreted_option(const google_protobuf_FileOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(108, 192)); }
+UPB_INLINE bool google_protobuf_FileOptions_has_java_package(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 11); }
+UPB_INLINE upb_strview google_protobuf_FileOptions_java_package(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 32), upb_strview); }
+UPB_INLINE bool google_protobuf_FileOptions_has_java_outer_classname(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 12); }
+UPB_INLINE upb_strview google_protobuf_FileOptions_java_outer_classname(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(36, 48), upb_strview); }
+UPB_INLINE bool google_protobuf_FileOptions_has_optimize_for(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 1); }
+UPB_INLINE int32_t google_protobuf_FileOptions_optimize_for(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); }
+UPB_INLINE bool google_protobuf_FileOptions_has_java_multiple_files(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 2); }
+UPB_INLINE bool google_protobuf_FileOptions_java_multiple_files(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), bool); }
+UPB_INLINE bool google_protobuf_FileOptions_has_go_package(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 13); }
+UPB_INLINE upb_strview google_protobuf_FileOptions_go_package(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(44, 64), upb_strview); }
+UPB_INLINE bool google_protobuf_FileOptions_has_cc_generic_services(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 3); }
+UPB_INLINE bool google_protobuf_FileOptions_cc_generic_services(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(17, 17), bool); }
+UPB_INLINE bool google_protobuf_FileOptions_has_java_generic_services(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 4); }
+UPB_INLINE bool google_protobuf_FileOptions_java_generic_services(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(18, 18), bool); }
+UPB_INLINE bool google_protobuf_FileOptions_has_py_generic_services(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 5); }
+UPB_INLINE bool google_protobuf_FileOptions_py_generic_services(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(19, 19), bool); }
+UPB_INLINE bool google_protobuf_FileOptions_has_java_generate_equals_and_hash(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 6); }
+UPB_INLINE bool google_protobuf_FileOptions_java_generate_equals_and_hash(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 20), bool); }
+UPB_INLINE bool google_protobuf_FileOptions_has_deprecated(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 7); }
+UPB_INLINE bool google_protobuf_FileOptions_deprecated(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(21, 21), bool); }
+UPB_INLINE bool google_protobuf_FileOptions_has_java_string_check_utf8(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 8); }
+UPB_INLINE bool google_protobuf_FileOptions_java_string_check_utf8(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(22, 22), bool); }
+UPB_INLINE bool google_protobuf_FileOptions_has_cc_enable_arenas(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 9); }
+UPB_INLINE bool google_protobuf_FileOptions_cc_enable_arenas(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(23, 23), bool); }
+UPB_INLINE bool google_protobuf_FileOptions_has_objc_class_prefix(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 14); }
+UPB_INLINE upb_strview google_protobuf_FileOptions_objc_class_prefix(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(52, 80), upb_strview); }
+UPB_INLINE bool google_protobuf_FileOptions_has_csharp_namespace(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 15); }
+UPB_INLINE upb_strview google_protobuf_FileOptions_csharp_namespace(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(60, 96), upb_strview); }
+UPB_INLINE bool google_protobuf_FileOptions_has_swift_prefix(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 16); }
+UPB_INLINE upb_strview google_protobuf_FileOptions_swift_prefix(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(68, 112), upb_strview); }
+UPB_INLINE bool google_protobuf_FileOptions_has_php_class_prefix(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 17); }
+UPB_INLINE upb_strview google_protobuf_FileOptions_php_class_prefix(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(76, 128), upb_strview); }
+UPB_INLINE bool google_protobuf_FileOptions_has_php_namespace(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 18); }
+UPB_INLINE upb_strview google_protobuf_FileOptions_php_namespace(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(84, 144), upb_strview); }
+UPB_INLINE bool google_protobuf_FileOptions_has_php_generic_services(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 10); }
+UPB_INLINE bool google_protobuf_FileOptions_php_generic_services(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool); }
+UPB_INLINE bool google_protobuf_FileOptions_has_php_metadata_namespace(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 19); }
+UPB_INLINE upb_strview google_protobuf_FileOptions_php_metadata_namespace(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(92, 160), upb_strview); }
+UPB_INLINE bool google_protobuf_FileOptions_has_ruby_package(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 20); }
+UPB_INLINE upb_strview google_protobuf_FileOptions_ruby_package(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(100, 176), upb_strview); }
+UPB_INLINE bool google_protobuf_FileOptions_has_uninterpreted_option(const google_protobuf_FileOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(108, 192)); }
UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_FileOptions_uninterpreted_option(const google_protobuf_FileOptions *msg, size_t *len) { return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, UPB_SIZE(108, 192), len); }
UPB_INLINE void google_protobuf_FileOptions_set_java_package(google_protobuf_FileOptions *msg, upb_strview value) {
_upb_sethas(msg, 11);
- *UPB_PTR_AT(msg, UPB_SIZE(28, 32), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 32), upb_strview) = value;
}
UPB_INLINE void google_protobuf_FileOptions_set_java_outer_classname(google_protobuf_FileOptions *msg, upb_strview value) {
_upb_sethas(msg, 12);
- *UPB_PTR_AT(msg, UPB_SIZE(36, 48), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(36, 48), upb_strview) = value;
}
UPB_INLINE void google_protobuf_FileOptions_set_optimize_for(google_protobuf_FileOptions *msg, int32_t value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
}
UPB_INLINE void google_protobuf_FileOptions_set_java_multiple_files(google_protobuf_FileOptions *msg, bool value) {
_upb_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(16, 16), bool) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 16), bool) = value;
}
UPB_INLINE void google_protobuf_FileOptions_set_go_package(google_protobuf_FileOptions *msg, upb_strview value) {
_upb_sethas(msg, 13);
- *UPB_PTR_AT(msg, UPB_SIZE(44, 64), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(44, 64), upb_strview) = value;
}
UPB_INLINE void google_protobuf_FileOptions_set_cc_generic_services(google_protobuf_FileOptions *msg, bool value) {
_upb_sethas(msg, 3);
- *UPB_PTR_AT(msg, UPB_SIZE(17, 17), bool) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(17, 17), bool) = value;
}
UPB_INLINE void google_protobuf_FileOptions_set_java_generic_services(google_protobuf_FileOptions *msg, bool value) {
_upb_sethas(msg, 4);
- *UPB_PTR_AT(msg, UPB_SIZE(18, 18), bool) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(18, 18), bool) = value;
}
UPB_INLINE void google_protobuf_FileOptions_set_py_generic_services(google_protobuf_FileOptions *msg, bool value) {
_upb_sethas(msg, 5);
- *UPB_PTR_AT(msg, UPB_SIZE(19, 19), bool) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(19, 19), bool) = value;
}
UPB_INLINE void google_protobuf_FileOptions_set_java_generate_equals_and_hash(google_protobuf_FileOptions *msg, bool value) {
_upb_sethas(msg, 6);
- *UPB_PTR_AT(msg, UPB_SIZE(20, 20), bool) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 20), bool) = value;
}
UPB_INLINE void google_protobuf_FileOptions_set_deprecated(google_protobuf_FileOptions *msg, bool value) {
_upb_sethas(msg, 7);
- *UPB_PTR_AT(msg, UPB_SIZE(21, 21), bool) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(21, 21), bool) = value;
}
UPB_INLINE void google_protobuf_FileOptions_set_java_string_check_utf8(google_protobuf_FileOptions *msg, bool value) {
_upb_sethas(msg, 8);
- *UPB_PTR_AT(msg, UPB_SIZE(22, 22), bool) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(22, 22), bool) = value;
}
UPB_INLINE void google_protobuf_FileOptions_set_cc_enable_arenas(google_protobuf_FileOptions *msg, bool value) {
_upb_sethas(msg, 9);
- *UPB_PTR_AT(msg, UPB_SIZE(23, 23), bool) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(23, 23), bool) = value;
}
UPB_INLINE void google_protobuf_FileOptions_set_objc_class_prefix(google_protobuf_FileOptions *msg, upb_strview value) {
_upb_sethas(msg, 14);
- *UPB_PTR_AT(msg, UPB_SIZE(52, 80), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(52, 80), upb_strview) = value;
}
UPB_INLINE void google_protobuf_FileOptions_set_csharp_namespace(google_protobuf_FileOptions *msg, upb_strview value) {
_upb_sethas(msg, 15);
- *UPB_PTR_AT(msg, UPB_SIZE(60, 96), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(60, 96), upb_strview) = value;
}
UPB_INLINE void google_protobuf_FileOptions_set_swift_prefix(google_protobuf_FileOptions *msg, upb_strview value) {
_upb_sethas(msg, 16);
- *UPB_PTR_AT(msg, UPB_SIZE(68, 112), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(68, 112), upb_strview) = value;
}
UPB_INLINE void google_protobuf_FileOptions_set_php_class_prefix(google_protobuf_FileOptions *msg, upb_strview value) {
_upb_sethas(msg, 17);
- *UPB_PTR_AT(msg, UPB_SIZE(76, 128), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(76, 128), upb_strview) = value;
}
UPB_INLINE void google_protobuf_FileOptions_set_php_namespace(google_protobuf_FileOptions *msg, upb_strview value) {
_upb_sethas(msg, 18);
- *UPB_PTR_AT(msg, UPB_SIZE(84, 144), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(84, 144), upb_strview) = value;
}
UPB_INLINE void google_protobuf_FileOptions_set_php_generic_services(google_protobuf_FileOptions *msg, bool value) {
_upb_sethas(msg, 10);
- *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool) = value;
}
UPB_INLINE void google_protobuf_FileOptions_set_php_metadata_namespace(google_protobuf_FileOptions *msg, upb_strview value) {
_upb_sethas(msg, 19);
- *UPB_PTR_AT(msg, UPB_SIZE(92, 160), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(92, 160), upb_strview) = value;
}
UPB_INLINE void google_protobuf_FileOptions_set_ruby_package(google_protobuf_FileOptions *msg, upb_strview value) {
_upb_sethas(msg, 20);
- *UPB_PTR_AT(msg, UPB_SIZE(100, 176), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(100, 176), upb_strview) = value;
}
UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_FileOptions_mutable_uninterpreted_option(google_protobuf_FileOptions *msg, size_t *len) {
return (google_protobuf_UninterpretedOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(108, 192), len);
}
UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_FileOptions_resize_uninterpreted_option(google_protobuf_FileOptions *msg, size_t len, upb_arena *arena) {
- return (google_protobuf_UninterpretedOption**)_upb_array_resize_accessor(msg, UPB_SIZE(108, 192), len, UPB_TYPE_MESSAGE, arena);
+ return (google_protobuf_UninterpretedOption**)_upb_array_resize_accessor(msg, UPB_SIZE(108, 192), len, UPB_TYPE_MESSAGE, arena);
}
UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_FileOptions_add_uninterpreted_option(google_protobuf_FileOptions *msg, upb_arena *arena) {
- struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_msg_new(&google_protobuf_UninterpretedOption_msginit, arena);
+ struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_msg_new(&google_protobuf_UninterpretedOption_msginit, arena);
bool ok = _upb_array_append_accessor(
msg, UPB_SIZE(108, 192), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
if (!ok) return NULL;
@@ -1140,7 +1140,7 @@ UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_FileOptio
/* google.protobuf.MessageOptions */
UPB_INLINE google_protobuf_MessageOptions *google_protobuf_MessageOptions_new(upb_arena *arena) {
- return (google_protobuf_MessageOptions *)_upb_msg_new(&google_protobuf_MessageOptions_msginit, arena);
+ return (google_protobuf_MessageOptions *)_upb_msg_new(&google_protobuf_MessageOptions_msginit, arena);
}
UPB_INLINE google_protobuf_MessageOptions *google_protobuf_MessageOptions_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -1151,41 +1151,41 @@ UPB_INLINE char *google_protobuf_MessageOptions_serialize(const google_protobuf_
return upb_encode(msg, &google_protobuf_MessageOptions_msginit, arena, len);
}
-UPB_INLINE bool google_protobuf_MessageOptions_has_message_set_wire_format(const google_protobuf_MessageOptions *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE bool google_protobuf_MessageOptions_message_set_wire_format(const google_protobuf_MessageOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); }
-UPB_INLINE bool google_protobuf_MessageOptions_has_no_standard_descriptor_accessor(const google_protobuf_MessageOptions *msg) { return _upb_hasbit(msg, 2); }
-UPB_INLINE bool google_protobuf_MessageOptions_no_standard_descriptor_accessor(const google_protobuf_MessageOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool); }
-UPB_INLINE bool google_protobuf_MessageOptions_has_deprecated(const google_protobuf_MessageOptions *msg) { return _upb_hasbit(msg, 3); }
-UPB_INLINE bool google_protobuf_MessageOptions_deprecated(const google_protobuf_MessageOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(3, 3), bool); }
-UPB_INLINE bool google_protobuf_MessageOptions_has_map_entry(const google_protobuf_MessageOptions *msg) { return _upb_hasbit(msg, 4); }
-UPB_INLINE bool google_protobuf_MessageOptions_map_entry(const google_protobuf_MessageOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool); }
-UPB_INLINE bool google_protobuf_MessageOptions_has_uninterpreted_option(const google_protobuf_MessageOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 8)); }
+UPB_INLINE bool google_protobuf_MessageOptions_has_message_set_wire_format(const google_protobuf_MessageOptions *msg) { return _upb_hasbit(msg, 1); }
+UPB_INLINE bool google_protobuf_MessageOptions_message_set_wire_format(const google_protobuf_MessageOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); }
+UPB_INLINE bool google_protobuf_MessageOptions_has_no_standard_descriptor_accessor(const google_protobuf_MessageOptions *msg) { return _upb_hasbit(msg, 2); }
+UPB_INLINE bool google_protobuf_MessageOptions_no_standard_descriptor_accessor(const google_protobuf_MessageOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool); }
+UPB_INLINE bool google_protobuf_MessageOptions_has_deprecated(const google_protobuf_MessageOptions *msg) { return _upb_hasbit(msg, 3); }
+UPB_INLINE bool google_protobuf_MessageOptions_deprecated(const google_protobuf_MessageOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(3, 3), bool); }
+UPB_INLINE bool google_protobuf_MessageOptions_has_map_entry(const google_protobuf_MessageOptions *msg) { return _upb_hasbit(msg, 4); }
+UPB_INLINE bool google_protobuf_MessageOptions_map_entry(const google_protobuf_MessageOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool); }
+UPB_INLINE bool google_protobuf_MessageOptions_has_uninterpreted_option(const google_protobuf_MessageOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 8)); }
UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_MessageOptions_uninterpreted_option(const google_protobuf_MessageOptions *msg, size_t *len) { return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, UPB_SIZE(8, 8), len); }
UPB_INLINE void google_protobuf_MessageOptions_set_message_set_wire_format(google_protobuf_MessageOptions *msg, bool value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
}
UPB_INLINE void google_protobuf_MessageOptions_set_no_standard_descriptor_accessor(google_protobuf_MessageOptions *msg, bool value) {
_upb_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = value;
}
UPB_INLINE void google_protobuf_MessageOptions_set_deprecated(google_protobuf_MessageOptions *msg, bool value) {
_upb_sethas(msg, 3);
- *UPB_PTR_AT(msg, UPB_SIZE(3, 3), bool) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(3, 3), bool) = value;
}
UPB_INLINE void google_protobuf_MessageOptions_set_map_entry(google_protobuf_MessageOptions *msg, bool value) {
_upb_sethas(msg, 4);
- *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool) = value;
}
UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_MessageOptions_mutable_uninterpreted_option(google_protobuf_MessageOptions *msg, size_t *len) {
return (google_protobuf_UninterpretedOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 8), len);
}
UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_MessageOptions_resize_uninterpreted_option(google_protobuf_MessageOptions *msg, size_t len, upb_arena *arena) {
- return (google_protobuf_UninterpretedOption**)_upb_array_resize_accessor(msg, UPB_SIZE(8, 8), len, UPB_TYPE_MESSAGE, arena);
+ return (google_protobuf_UninterpretedOption**)_upb_array_resize_accessor(msg, UPB_SIZE(8, 8), len, UPB_TYPE_MESSAGE, arena);
}
UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_MessageOptions_add_uninterpreted_option(google_protobuf_MessageOptions *msg, upb_arena *arena) {
- struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_msg_new(&google_protobuf_UninterpretedOption_msginit, arena);
+ struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_msg_new(&google_protobuf_UninterpretedOption_msginit, arena);
bool ok = _upb_array_append_accessor(
msg, UPB_SIZE(8, 8), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
if (!ok) return NULL;
@@ -1195,7 +1195,7 @@ UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_MessageOp
/* google.protobuf.FieldOptions */
UPB_INLINE google_protobuf_FieldOptions *google_protobuf_FieldOptions_new(upb_arena *arena) {
- return (google_protobuf_FieldOptions *)_upb_msg_new(&google_protobuf_FieldOptions_msginit, arena);
+ return (google_protobuf_FieldOptions *)_upb_msg_new(&google_protobuf_FieldOptions_msginit, arena);
}
UPB_INLINE google_protobuf_FieldOptions *google_protobuf_FieldOptions_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -1206,53 +1206,53 @@ UPB_INLINE char *google_protobuf_FieldOptions_serialize(const google_protobuf_Fi
return upb_encode(msg, &google_protobuf_FieldOptions_msginit, arena, len);
}
-UPB_INLINE bool google_protobuf_FieldOptions_has_ctype(const google_protobuf_FieldOptions *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE int32_t google_protobuf_FieldOptions_ctype(const google_protobuf_FieldOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); }
-UPB_INLINE bool google_protobuf_FieldOptions_has_packed(const google_protobuf_FieldOptions *msg) { return _upb_hasbit(msg, 3); }
-UPB_INLINE bool google_protobuf_FieldOptions_packed(const google_protobuf_FieldOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool); }
-UPB_INLINE bool google_protobuf_FieldOptions_has_deprecated(const google_protobuf_FieldOptions *msg) { return _upb_hasbit(msg, 4); }
-UPB_INLINE bool google_protobuf_FieldOptions_deprecated(const google_protobuf_FieldOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(25, 25), bool); }
-UPB_INLINE bool google_protobuf_FieldOptions_has_lazy(const google_protobuf_FieldOptions *msg) { return _upb_hasbit(msg, 5); }
-UPB_INLINE bool google_protobuf_FieldOptions_lazy(const google_protobuf_FieldOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(26, 26), bool); }
-UPB_INLINE bool google_protobuf_FieldOptions_has_jstype(const google_protobuf_FieldOptions *msg) { return _upb_hasbit(msg, 2); }
-UPB_INLINE int32_t google_protobuf_FieldOptions_jstype(const google_protobuf_FieldOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t); }
-UPB_INLINE bool google_protobuf_FieldOptions_has_weak(const google_protobuf_FieldOptions *msg) { return _upb_hasbit(msg, 6); }
-UPB_INLINE bool google_protobuf_FieldOptions_weak(const google_protobuf_FieldOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(27, 27), bool); }
-UPB_INLINE bool google_protobuf_FieldOptions_has_uninterpreted_option(const google_protobuf_FieldOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 32)); }
+UPB_INLINE bool google_protobuf_FieldOptions_has_ctype(const google_protobuf_FieldOptions *msg) { return _upb_hasbit(msg, 1); }
+UPB_INLINE int32_t google_protobuf_FieldOptions_ctype(const google_protobuf_FieldOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); }
+UPB_INLINE bool google_protobuf_FieldOptions_has_packed(const google_protobuf_FieldOptions *msg) { return _upb_hasbit(msg, 3); }
+UPB_INLINE bool google_protobuf_FieldOptions_packed(const google_protobuf_FieldOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool); }
+UPB_INLINE bool google_protobuf_FieldOptions_has_deprecated(const google_protobuf_FieldOptions *msg) { return _upb_hasbit(msg, 4); }
+UPB_INLINE bool google_protobuf_FieldOptions_deprecated(const google_protobuf_FieldOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(25, 25), bool); }
+UPB_INLINE bool google_protobuf_FieldOptions_has_lazy(const google_protobuf_FieldOptions *msg) { return _upb_hasbit(msg, 5); }
+UPB_INLINE bool google_protobuf_FieldOptions_lazy(const google_protobuf_FieldOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(26, 26), bool); }
+UPB_INLINE bool google_protobuf_FieldOptions_has_jstype(const google_protobuf_FieldOptions *msg) { return _upb_hasbit(msg, 2); }
+UPB_INLINE int32_t google_protobuf_FieldOptions_jstype(const google_protobuf_FieldOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t); }
+UPB_INLINE bool google_protobuf_FieldOptions_has_weak(const google_protobuf_FieldOptions *msg) { return _upb_hasbit(msg, 6); }
+UPB_INLINE bool google_protobuf_FieldOptions_weak(const google_protobuf_FieldOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(27, 27), bool); }
+UPB_INLINE bool google_protobuf_FieldOptions_has_uninterpreted_option(const google_protobuf_FieldOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 32)); }
UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_FieldOptions_uninterpreted_option(const google_protobuf_FieldOptions *msg, size_t *len) { return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, UPB_SIZE(28, 32), len); }
UPB_INLINE void google_protobuf_FieldOptions_set_ctype(google_protobuf_FieldOptions *msg, int32_t value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
}
UPB_INLINE void google_protobuf_FieldOptions_set_packed(google_protobuf_FieldOptions *msg, bool value) {
_upb_sethas(msg, 3);
- *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool) = value;
}
UPB_INLINE void google_protobuf_FieldOptions_set_deprecated(google_protobuf_FieldOptions *msg, bool value) {
_upb_sethas(msg, 4);
- *UPB_PTR_AT(msg, UPB_SIZE(25, 25), bool) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(25, 25), bool) = value;
}
UPB_INLINE void google_protobuf_FieldOptions_set_lazy(google_protobuf_FieldOptions *msg, bool value) {
_upb_sethas(msg, 5);
- *UPB_PTR_AT(msg, UPB_SIZE(26, 26), bool) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(26, 26), bool) = value;
}
UPB_INLINE void google_protobuf_FieldOptions_set_jstype(google_protobuf_FieldOptions *msg, int32_t value) {
_upb_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t) = value;
}
UPB_INLINE void google_protobuf_FieldOptions_set_weak(google_protobuf_FieldOptions *msg, bool value) {
_upb_sethas(msg, 6);
- *UPB_PTR_AT(msg, UPB_SIZE(27, 27), bool) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(27, 27), bool) = value;
}
UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_FieldOptions_mutable_uninterpreted_option(google_protobuf_FieldOptions *msg, size_t *len) {
return (google_protobuf_UninterpretedOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 32), len);
}
UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_FieldOptions_resize_uninterpreted_option(google_protobuf_FieldOptions *msg, size_t len, upb_arena *arena) {
- return (google_protobuf_UninterpretedOption**)_upb_array_resize_accessor(msg, UPB_SIZE(28, 32), len, UPB_TYPE_MESSAGE, arena);
+ return (google_protobuf_UninterpretedOption**)_upb_array_resize_accessor(msg, UPB_SIZE(28, 32), len, UPB_TYPE_MESSAGE, arena);
}
UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_FieldOptions_add_uninterpreted_option(google_protobuf_FieldOptions *msg, upb_arena *arena) {
- struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_msg_new(&google_protobuf_UninterpretedOption_msginit, arena);
+ struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_msg_new(&google_protobuf_UninterpretedOption_msginit, arena);
bool ok = _upb_array_append_accessor(
msg, UPB_SIZE(28, 32), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
if (!ok) return NULL;
@@ -1262,7 +1262,7 @@ UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_FieldOpti
/* google.protobuf.OneofOptions */
UPB_INLINE google_protobuf_OneofOptions *google_protobuf_OneofOptions_new(upb_arena *arena) {
- return (google_protobuf_OneofOptions *)_upb_msg_new(&google_protobuf_OneofOptions_msginit, arena);
+ return (google_protobuf_OneofOptions *)_upb_msg_new(&google_protobuf_OneofOptions_msginit, arena);
}
UPB_INLINE google_protobuf_OneofOptions *google_protobuf_OneofOptions_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -1273,17 +1273,17 @@ UPB_INLINE char *google_protobuf_OneofOptions_serialize(const google_protobuf_On
return upb_encode(msg, &google_protobuf_OneofOptions_msginit, arena, len);
}
-UPB_INLINE bool google_protobuf_OneofOptions_has_uninterpreted_option(const google_protobuf_OneofOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE bool google_protobuf_OneofOptions_has_uninterpreted_option(const google_protobuf_OneofOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_OneofOptions_uninterpreted_option(const google_protobuf_OneofOptions *msg, size_t *len) { return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_OneofOptions_mutable_uninterpreted_option(google_protobuf_OneofOptions *msg, size_t *len) {
return (google_protobuf_UninterpretedOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
}
UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_OneofOptions_resize_uninterpreted_option(google_protobuf_OneofOptions *msg, size_t len, upb_arena *arena) {
- return (google_protobuf_UninterpretedOption**)_upb_array_resize_accessor(msg, UPB_SIZE(0, 0), len, UPB_TYPE_MESSAGE, arena);
+ return (google_protobuf_UninterpretedOption**)_upb_array_resize_accessor(msg, UPB_SIZE(0, 0), len, UPB_TYPE_MESSAGE, arena);
}
UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_OneofOptions_add_uninterpreted_option(google_protobuf_OneofOptions *msg, upb_arena *arena) {
- struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_msg_new(&google_protobuf_UninterpretedOption_msginit, arena);
+ struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_msg_new(&google_protobuf_UninterpretedOption_msginit, arena);
bool ok = _upb_array_append_accessor(
msg, UPB_SIZE(0, 0), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
if (!ok) return NULL;
@@ -1293,7 +1293,7 @@ UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_OneofOpti
/* google.protobuf.EnumOptions */
UPB_INLINE google_protobuf_EnumOptions *google_protobuf_EnumOptions_new(upb_arena *arena) {
- return (google_protobuf_EnumOptions *)_upb_msg_new(&google_protobuf_EnumOptions_msginit, arena);
+ return (google_protobuf_EnumOptions *)_upb_msg_new(&google_protobuf_EnumOptions_msginit, arena);
}
UPB_INLINE google_protobuf_EnumOptions *google_protobuf_EnumOptions_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -1304,29 +1304,29 @@ UPB_INLINE char *google_protobuf_EnumOptions_serialize(const google_protobuf_Enu
return upb_encode(msg, &google_protobuf_EnumOptions_msginit, arena, len);
}
-UPB_INLINE bool google_protobuf_EnumOptions_has_allow_alias(const google_protobuf_EnumOptions *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE bool google_protobuf_EnumOptions_allow_alias(const google_protobuf_EnumOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); }
-UPB_INLINE bool google_protobuf_EnumOptions_has_deprecated(const google_protobuf_EnumOptions *msg) { return _upb_hasbit(msg, 2); }
-UPB_INLINE bool google_protobuf_EnumOptions_deprecated(const google_protobuf_EnumOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool); }
-UPB_INLINE bool google_protobuf_EnumOptions_has_uninterpreted_option(const google_protobuf_EnumOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
+UPB_INLINE bool google_protobuf_EnumOptions_has_allow_alias(const google_protobuf_EnumOptions *msg) { return _upb_hasbit(msg, 1); }
+UPB_INLINE bool google_protobuf_EnumOptions_allow_alias(const google_protobuf_EnumOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); }
+UPB_INLINE bool google_protobuf_EnumOptions_has_deprecated(const google_protobuf_EnumOptions *msg) { return _upb_hasbit(msg, 2); }
+UPB_INLINE bool google_protobuf_EnumOptions_deprecated(const google_protobuf_EnumOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool); }
+UPB_INLINE bool google_protobuf_EnumOptions_has_uninterpreted_option(const google_protobuf_EnumOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_EnumOptions_uninterpreted_option(const google_protobuf_EnumOptions *msg, size_t *len) { return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len); }
UPB_INLINE void google_protobuf_EnumOptions_set_allow_alias(google_protobuf_EnumOptions *msg, bool value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
}
UPB_INLINE void google_protobuf_EnumOptions_set_deprecated(google_protobuf_EnumOptions *msg, bool value) {
_upb_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = value;
}
UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_EnumOptions_mutable_uninterpreted_option(google_protobuf_EnumOptions *msg, size_t *len) {
return (google_protobuf_UninterpretedOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len);
}
UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_EnumOptions_resize_uninterpreted_option(google_protobuf_EnumOptions *msg, size_t len, upb_arena *arena) {
- return (google_protobuf_UninterpretedOption**)_upb_array_resize_accessor(msg, UPB_SIZE(4, 8), len, UPB_TYPE_MESSAGE, arena);
+ return (google_protobuf_UninterpretedOption**)_upb_array_resize_accessor(msg, UPB_SIZE(4, 8), len, UPB_TYPE_MESSAGE, arena);
}
UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_EnumOptions_add_uninterpreted_option(google_protobuf_EnumOptions *msg, upb_arena *arena) {
- struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_msg_new(&google_protobuf_UninterpretedOption_msginit, arena);
+ struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_msg_new(&google_protobuf_UninterpretedOption_msginit, arena);
bool ok = _upb_array_append_accessor(
msg, UPB_SIZE(4, 8), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
if (!ok) return NULL;
@@ -1336,7 +1336,7 @@ UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_EnumOptio
/* google.protobuf.EnumValueOptions */
UPB_INLINE google_protobuf_EnumValueOptions *google_protobuf_EnumValueOptions_new(upb_arena *arena) {
- return (google_protobuf_EnumValueOptions *)_upb_msg_new(&google_protobuf_EnumValueOptions_msginit, arena);
+ return (google_protobuf_EnumValueOptions *)_upb_msg_new(&google_protobuf_EnumValueOptions_msginit, arena);
}
UPB_INLINE google_protobuf_EnumValueOptions *google_protobuf_EnumValueOptions_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -1347,23 +1347,23 @@ UPB_INLINE char *google_protobuf_EnumValueOptions_serialize(const google_protobu
return upb_encode(msg, &google_protobuf_EnumValueOptions_msginit, arena, len);
}
-UPB_INLINE bool google_protobuf_EnumValueOptions_has_deprecated(const google_protobuf_EnumValueOptions *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE bool google_protobuf_EnumValueOptions_deprecated(const google_protobuf_EnumValueOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); }
-UPB_INLINE bool google_protobuf_EnumValueOptions_has_uninterpreted_option(const google_protobuf_EnumValueOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
+UPB_INLINE bool google_protobuf_EnumValueOptions_has_deprecated(const google_protobuf_EnumValueOptions *msg) { return _upb_hasbit(msg, 1); }
+UPB_INLINE bool google_protobuf_EnumValueOptions_deprecated(const google_protobuf_EnumValueOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); }
+UPB_INLINE bool google_protobuf_EnumValueOptions_has_uninterpreted_option(const google_protobuf_EnumValueOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_EnumValueOptions_uninterpreted_option(const google_protobuf_EnumValueOptions *msg, size_t *len) { return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len); }
UPB_INLINE void google_protobuf_EnumValueOptions_set_deprecated(google_protobuf_EnumValueOptions *msg, bool value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
}
UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_EnumValueOptions_mutable_uninterpreted_option(google_protobuf_EnumValueOptions *msg, size_t *len) {
return (google_protobuf_UninterpretedOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len);
}
UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_EnumValueOptions_resize_uninterpreted_option(google_protobuf_EnumValueOptions *msg, size_t len, upb_arena *arena) {
- return (google_protobuf_UninterpretedOption**)_upb_array_resize_accessor(msg, UPB_SIZE(4, 8), len, UPB_TYPE_MESSAGE, arena);
+ return (google_protobuf_UninterpretedOption**)_upb_array_resize_accessor(msg, UPB_SIZE(4, 8), len, UPB_TYPE_MESSAGE, arena);
}
UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_EnumValueOptions_add_uninterpreted_option(google_protobuf_EnumValueOptions *msg, upb_arena *arena) {
- struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_msg_new(&google_protobuf_UninterpretedOption_msginit, arena);
+ struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_msg_new(&google_protobuf_UninterpretedOption_msginit, arena);
bool ok = _upb_array_append_accessor(
msg, UPB_SIZE(4, 8), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
if (!ok) return NULL;
@@ -1373,7 +1373,7 @@ UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_EnumValue
/* google.protobuf.ServiceOptions */
UPB_INLINE google_protobuf_ServiceOptions *google_protobuf_ServiceOptions_new(upb_arena *arena) {
- return (google_protobuf_ServiceOptions *)_upb_msg_new(&google_protobuf_ServiceOptions_msginit, arena);
+ return (google_protobuf_ServiceOptions *)_upb_msg_new(&google_protobuf_ServiceOptions_msginit, arena);
}
UPB_INLINE google_protobuf_ServiceOptions *google_protobuf_ServiceOptions_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -1384,23 +1384,23 @@ UPB_INLINE char *google_protobuf_ServiceOptions_serialize(const google_protobuf_
return upb_encode(msg, &google_protobuf_ServiceOptions_msginit, arena, len);
}
-UPB_INLINE bool google_protobuf_ServiceOptions_has_deprecated(const google_protobuf_ServiceOptions *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE bool google_protobuf_ServiceOptions_deprecated(const google_protobuf_ServiceOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); }
-UPB_INLINE bool google_protobuf_ServiceOptions_has_uninterpreted_option(const google_protobuf_ServiceOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
+UPB_INLINE bool google_protobuf_ServiceOptions_has_deprecated(const google_protobuf_ServiceOptions *msg) { return _upb_hasbit(msg, 1); }
+UPB_INLINE bool google_protobuf_ServiceOptions_deprecated(const google_protobuf_ServiceOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); }
+UPB_INLINE bool google_protobuf_ServiceOptions_has_uninterpreted_option(const google_protobuf_ServiceOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_ServiceOptions_uninterpreted_option(const google_protobuf_ServiceOptions *msg, size_t *len) { return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len); }
UPB_INLINE void google_protobuf_ServiceOptions_set_deprecated(google_protobuf_ServiceOptions *msg, bool value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
}
UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_ServiceOptions_mutable_uninterpreted_option(google_protobuf_ServiceOptions *msg, size_t *len) {
return (google_protobuf_UninterpretedOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len);
}
UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_ServiceOptions_resize_uninterpreted_option(google_protobuf_ServiceOptions *msg, size_t len, upb_arena *arena) {
- return (google_protobuf_UninterpretedOption**)_upb_array_resize_accessor(msg, UPB_SIZE(4, 8), len, UPB_TYPE_MESSAGE, arena);
+ return (google_protobuf_UninterpretedOption**)_upb_array_resize_accessor(msg, UPB_SIZE(4, 8), len, UPB_TYPE_MESSAGE, arena);
}
UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_ServiceOptions_add_uninterpreted_option(google_protobuf_ServiceOptions *msg, upb_arena *arena) {
- struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_msg_new(&google_protobuf_UninterpretedOption_msginit, arena);
+ struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_msg_new(&google_protobuf_UninterpretedOption_msginit, arena);
bool ok = _upb_array_append_accessor(
msg, UPB_SIZE(4, 8), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
if (!ok) return NULL;
@@ -1410,7 +1410,7 @@ UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_ServiceOp
/* google.protobuf.MethodOptions */
UPB_INLINE google_protobuf_MethodOptions *google_protobuf_MethodOptions_new(upb_arena *arena) {
- return (google_protobuf_MethodOptions *)_upb_msg_new(&google_protobuf_MethodOptions_msginit, arena);
+ return (google_protobuf_MethodOptions *)_upb_msg_new(&google_protobuf_MethodOptions_msginit, arena);
}
UPB_INLINE google_protobuf_MethodOptions *google_protobuf_MethodOptions_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -1421,29 +1421,29 @@ UPB_INLINE char *google_protobuf_MethodOptions_serialize(const google_protobuf_M
return upb_encode(msg, &google_protobuf_MethodOptions_msginit, arena, len);
}
-UPB_INLINE bool google_protobuf_MethodOptions_has_deprecated(const google_protobuf_MethodOptions *msg) { return _upb_hasbit(msg, 2); }
-UPB_INLINE bool google_protobuf_MethodOptions_deprecated(const google_protobuf_MethodOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), bool); }
-UPB_INLINE bool google_protobuf_MethodOptions_has_idempotency_level(const google_protobuf_MethodOptions *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE int32_t google_protobuf_MethodOptions_idempotency_level(const google_protobuf_MethodOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); }
-UPB_INLINE bool google_protobuf_MethodOptions_has_uninterpreted_option(const google_protobuf_MethodOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 24)); }
+UPB_INLINE bool google_protobuf_MethodOptions_has_deprecated(const google_protobuf_MethodOptions *msg) { return _upb_hasbit(msg, 2); }
+UPB_INLINE bool google_protobuf_MethodOptions_deprecated(const google_protobuf_MethodOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), bool); }
+UPB_INLINE bool google_protobuf_MethodOptions_has_idempotency_level(const google_protobuf_MethodOptions *msg) { return _upb_hasbit(msg, 1); }
+UPB_INLINE int32_t google_protobuf_MethodOptions_idempotency_level(const google_protobuf_MethodOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); }
+UPB_INLINE bool google_protobuf_MethodOptions_has_uninterpreted_option(const google_protobuf_MethodOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 24)); }
UPB_INLINE const google_protobuf_UninterpretedOption* const* google_protobuf_MethodOptions_uninterpreted_option(const google_protobuf_MethodOptions *msg, size_t *len) { return (const google_protobuf_UninterpretedOption* const*)_upb_array_accessor(msg, UPB_SIZE(20, 24), len); }
UPB_INLINE void google_protobuf_MethodOptions_set_deprecated(google_protobuf_MethodOptions *msg, bool value) {
_upb_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(16, 16), bool) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 16), bool) = value;
}
UPB_INLINE void google_protobuf_MethodOptions_set_idempotency_level(google_protobuf_MethodOptions *msg, int32_t value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
}
UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_MethodOptions_mutable_uninterpreted_option(google_protobuf_MethodOptions *msg, size_t *len) {
return (google_protobuf_UninterpretedOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 24), len);
}
UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_MethodOptions_resize_uninterpreted_option(google_protobuf_MethodOptions *msg, size_t len, upb_arena *arena) {
- return (google_protobuf_UninterpretedOption**)_upb_array_resize_accessor(msg, UPB_SIZE(20, 24), len, UPB_TYPE_MESSAGE, arena);
+ return (google_protobuf_UninterpretedOption**)_upb_array_resize_accessor(msg, UPB_SIZE(20, 24), len, UPB_TYPE_MESSAGE, arena);
}
UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_MethodOptions_add_uninterpreted_option(google_protobuf_MethodOptions *msg, upb_arena *arena) {
- struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_msg_new(&google_protobuf_UninterpretedOption_msginit, arena);
+ struct google_protobuf_UninterpretedOption* sub = (struct google_protobuf_UninterpretedOption*)_upb_msg_new(&google_protobuf_UninterpretedOption_msginit, arena);
bool ok = _upb_array_append_accessor(
msg, UPB_SIZE(20, 24), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
if (!ok) return NULL;
@@ -1453,7 +1453,7 @@ UPB_INLINE struct google_protobuf_UninterpretedOption* google_protobuf_MethodOpt
/* google.protobuf.UninterpretedOption */
UPB_INLINE google_protobuf_UninterpretedOption *google_protobuf_UninterpretedOption_new(upb_arena *arena) {
- return (google_protobuf_UninterpretedOption *)_upb_msg_new(&google_protobuf_UninterpretedOption_msginit, arena);
+ return (google_protobuf_UninterpretedOption *)_upb_msg_new(&google_protobuf_UninterpretedOption_msginit, arena);
}
UPB_INLINE google_protobuf_UninterpretedOption *google_protobuf_UninterpretedOption_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -1464,29 +1464,29 @@ UPB_INLINE char *google_protobuf_UninterpretedOption_serialize(const google_prot
return upb_encode(msg, &google_protobuf_UninterpretedOption_msginit, arena, len);
}
-UPB_INLINE bool google_protobuf_UninterpretedOption_has_name(const google_protobuf_UninterpretedOption *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(56, 80)); }
+UPB_INLINE bool google_protobuf_UninterpretedOption_has_name(const google_protobuf_UninterpretedOption *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(56, 80)); }
UPB_INLINE const google_protobuf_UninterpretedOption_NamePart* const* google_protobuf_UninterpretedOption_name(const google_protobuf_UninterpretedOption *msg, size_t *len) { return (const google_protobuf_UninterpretedOption_NamePart* const*)_upb_array_accessor(msg, UPB_SIZE(56, 80), len); }
-UPB_INLINE bool google_protobuf_UninterpretedOption_has_identifier_value(const google_protobuf_UninterpretedOption *msg) { return _upb_hasbit(msg, 4); }
-UPB_INLINE upb_strview google_protobuf_UninterpretedOption_identifier_value(const google_protobuf_UninterpretedOption *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 32), upb_strview); }
-UPB_INLINE bool google_protobuf_UninterpretedOption_has_positive_int_value(const google_protobuf_UninterpretedOption *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE uint64_t google_protobuf_UninterpretedOption_positive_int_value(const google_protobuf_UninterpretedOption *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint64_t); }
-UPB_INLINE bool google_protobuf_UninterpretedOption_has_negative_int_value(const google_protobuf_UninterpretedOption *msg) { return _upb_hasbit(msg, 2); }
-UPB_INLINE int64_t google_protobuf_UninterpretedOption_negative_int_value(const google_protobuf_UninterpretedOption *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int64_t); }
-UPB_INLINE bool google_protobuf_UninterpretedOption_has_double_value(const google_protobuf_UninterpretedOption *msg) { return _upb_hasbit(msg, 3); }
-UPB_INLINE double google_protobuf_UninterpretedOption_double_value(const google_protobuf_UninterpretedOption *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), double); }
-UPB_INLINE bool google_protobuf_UninterpretedOption_has_string_value(const google_protobuf_UninterpretedOption *msg) { return _upb_hasbit(msg, 5); }
-UPB_INLINE upb_strview google_protobuf_UninterpretedOption_string_value(const google_protobuf_UninterpretedOption *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(40, 48), upb_strview); }
-UPB_INLINE bool google_protobuf_UninterpretedOption_has_aggregate_value(const google_protobuf_UninterpretedOption *msg) { return _upb_hasbit(msg, 6); }
-UPB_INLINE upb_strview google_protobuf_UninterpretedOption_aggregate_value(const google_protobuf_UninterpretedOption *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(48, 64), upb_strview); }
+UPB_INLINE bool google_protobuf_UninterpretedOption_has_identifier_value(const google_protobuf_UninterpretedOption *msg) { return _upb_hasbit(msg, 4); }
+UPB_INLINE upb_strview google_protobuf_UninterpretedOption_identifier_value(const google_protobuf_UninterpretedOption *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 32), upb_strview); }
+UPB_INLINE bool google_protobuf_UninterpretedOption_has_positive_int_value(const google_protobuf_UninterpretedOption *msg) { return _upb_hasbit(msg, 1); }
+UPB_INLINE uint64_t google_protobuf_UninterpretedOption_positive_int_value(const google_protobuf_UninterpretedOption *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint64_t); }
+UPB_INLINE bool google_protobuf_UninterpretedOption_has_negative_int_value(const google_protobuf_UninterpretedOption *msg) { return _upb_hasbit(msg, 2); }
+UPB_INLINE int64_t google_protobuf_UninterpretedOption_negative_int_value(const google_protobuf_UninterpretedOption *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int64_t); }
+UPB_INLINE bool google_protobuf_UninterpretedOption_has_double_value(const google_protobuf_UninterpretedOption *msg) { return _upb_hasbit(msg, 3); }
+UPB_INLINE double google_protobuf_UninterpretedOption_double_value(const google_protobuf_UninterpretedOption *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), double); }
+UPB_INLINE bool google_protobuf_UninterpretedOption_has_string_value(const google_protobuf_UninterpretedOption *msg) { return _upb_hasbit(msg, 5); }
+UPB_INLINE upb_strview google_protobuf_UninterpretedOption_string_value(const google_protobuf_UninterpretedOption *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(40, 48), upb_strview); }
+UPB_INLINE bool google_protobuf_UninterpretedOption_has_aggregate_value(const google_protobuf_UninterpretedOption *msg) { return _upb_hasbit(msg, 6); }
+UPB_INLINE upb_strview google_protobuf_UninterpretedOption_aggregate_value(const google_protobuf_UninterpretedOption *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(48, 64), upb_strview); }
UPB_INLINE google_protobuf_UninterpretedOption_NamePart** google_protobuf_UninterpretedOption_mutable_name(google_protobuf_UninterpretedOption *msg, size_t *len) {
return (google_protobuf_UninterpretedOption_NamePart**)_upb_array_mutable_accessor(msg, UPB_SIZE(56, 80), len);
}
UPB_INLINE google_protobuf_UninterpretedOption_NamePart** google_protobuf_UninterpretedOption_resize_name(google_protobuf_UninterpretedOption *msg, size_t len, upb_arena *arena) {
- return (google_protobuf_UninterpretedOption_NamePart**)_upb_array_resize_accessor(msg, UPB_SIZE(56, 80), len, UPB_TYPE_MESSAGE, arena);
+ return (google_protobuf_UninterpretedOption_NamePart**)_upb_array_resize_accessor(msg, UPB_SIZE(56, 80), len, UPB_TYPE_MESSAGE, arena);
}
UPB_INLINE struct google_protobuf_UninterpretedOption_NamePart* google_protobuf_UninterpretedOption_add_name(google_protobuf_UninterpretedOption *msg, upb_arena *arena) {
- struct google_protobuf_UninterpretedOption_NamePart* sub = (struct google_protobuf_UninterpretedOption_NamePart*)_upb_msg_new(&google_protobuf_UninterpretedOption_NamePart_msginit, arena);
+ struct google_protobuf_UninterpretedOption_NamePart* sub = (struct google_protobuf_UninterpretedOption_NamePart*)_upb_msg_new(&google_protobuf_UninterpretedOption_NamePart_msginit, arena);
bool ok = _upb_array_append_accessor(
msg, UPB_SIZE(56, 80), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
if (!ok) return NULL;
@@ -1494,33 +1494,33 @@ UPB_INLINE struct google_protobuf_UninterpretedOption_NamePart* google_protobuf_
}
UPB_INLINE void google_protobuf_UninterpretedOption_set_identifier_value(google_protobuf_UninterpretedOption *msg, upb_strview value) {
_upb_sethas(msg, 4);
- *UPB_PTR_AT(msg, UPB_SIZE(32, 32), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 32), upb_strview) = value;
}
UPB_INLINE void google_protobuf_UninterpretedOption_set_positive_int_value(google_protobuf_UninterpretedOption *msg, uint64_t value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint64_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint64_t) = value;
}
UPB_INLINE void google_protobuf_UninterpretedOption_set_negative_int_value(google_protobuf_UninterpretedOption *msg, int64_t value) {
_upb_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int64_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int64_t) = value;
}
UPB_INLINE void google_protobuf_UninterpretedOption_set_double_value(google_protobuf_UninterpretedOption *msg, double value) {
_upb_sethas(msg, 3);
- *UPB_PTR_AT(msg, UPB_SIZE(24, 24), double) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 24), double) = value;
}
UPB_INLINE void google_protobuf_UninterpretedOption_set_string_value(google_protobuf_UninterpretedOption *msg, upb_strview value) {
_upb_sethas(msg, 5);
- *UPB_PTR_AT(msg, UPB_SIZE(40, 48), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 48), upb_strview) = value;
}
UPB_INLINE void google_protobuf_UninterpretedOption_set_aggregate_value(google_protobuf_UninterpretedOption *msg, upb_strview value) {
_upb_sethas(msg, 6);
- *UPB_PTR_AT(msg, UPB_SIZE(48, 64), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(48, 64), upb_strview) = value;
}
/* google.protobuf.UninterpretedOption.NamePart */
UPB_INLINE google_protobuf_UninterpretedOption_NamePart *google_protobuf_UninterpretedOption_NamePart_new(upb_arena *arena) {
- return (google_protobuf_UninterpretedOption_NamePart *)_upb_msg_new(&google_protobuf_UninterpretedOption_NamePart_msginit, arena);
+ return (google_protobuf_UninterpretedOption_NamePart *)_upb_msg_new(&google_protobuf_UninterpretedOption_NamePart_msginit, arena);
}
UPB_INLINE google_protobuf_UninterpretedOption_NamePart *google_protobuf_UninterpretedOption_NamePart_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -1531,24 +1531,24 @@ UPB_INLINE char *google_protobuf_UninterpretedOption_NamePart_serialize(const go
return upb_encode(msg, &google_protobuf_UninterpretedOption_NamePart_msginit, arena, len);
}
-UPB_INLINE bool google_protobuf_UninterpretedOption_NamePart_has_name_part(const google_protobuf_UninterpretedOption_NamePart *msg) { return _upb_hasbit(msg, 2); }
-UPB_INLINE upb_strview google_protobuf_UninterpretedOption_NamePart_name_part(const google_protobuf_UninterpretedOption_NamePart *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
-UPB_INLINE bool google_protobuf_UninterpretedOption_NamePart_has_is_extension(const google_protobuf_UninterpretedOption_NamePart *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE bool google_protobuf_UninterpretedOption_NamePart_is_extension(const google_protobuf_UninterpretedOption_NamePart *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); }
+UPB_INLINE bool google_protobuf_UninterpretedOption_NamePart_has_name_part(const google_protobuf_UninterpretedOption_NamePart *msg) { return _upb_hasbit(msg, 2); }
+UPB_INLINE upb_strview google_protobuf_UninterpretedOption_NamePart_name_part(const google_protobuf_UninterpretedOption_NamePart *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
+UPB_INLINE bool google_protobuf_UninterpretedOption_NamePart_has_is_extension(const google_protobuf_UninterpretedOption_NamePart *msg) { return _upb_hasbit(msg, 1); }
+UPB_INLINE bool google_protobuf_UninterpretedOption_NamePart_is_extension(const google_protobuf_UninterpretedOption_NamePart *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); }
UPB_INLINE void google_protobuf_UninterpretedOption_NamePart_set_name_part(google_protobuf_UninterpretedOption_NamePart *msg, upb_strview value) {
_upb_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
}
UPB_INLINE void google_protobuf_UninterpretedOption_NamePart_set_is_extension(google_protobuf_UninterpretedOption_NamePart *msg, bool value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
}
/* google.protobuf.SourceCodeInfo */
UPB_INLINE google_protobuf_SourceCodeInfo *google_protobuf_SourceCodeInfo_new(upb_arena *arena) {
- return (google_protobuf_SourceCodeInfo *)_upb_msg_new(&google_protobuf_SourceCodeInfo_msginit, arena);
+ return (google_protobuf_SourceCodeInfo *)_upb_msg_new(&google_protobuf_SourceCodeInfo_msginit, arena);
}
UPB_INLINE google_protobuf_SourceCodeInfo *google_protobuf_SourceCodeInfo_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -1559,17 +1559,17 @@ UPB_INLINE char *google_protobuf_SourceCodeInfo_serialize(const google_protobuf_
return upb_encode(msg, &google_protobuf_SourceCodeInfo_msginit, arena, len);
}
-UPB_INLINE bool google_protobuf_SourceCodeInfo_has_location(const google_protobuf_SourceCodeInfo *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE bool google_protobuf_SourceCodeInfo_has_location(const google_protobuf_SourceCodeInfo *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
UPB_INLINE const google_protobuf_SourceCodeInfo_Location* const* google_protobuf_SourceCodeInfo_location(const google_protobuf_SourceCodeInfo *msg, size_t *len) { return (const google_protobuf_SourceCodeInfo_Location* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
UPB_INLINE google_protobuf_SourceCodeInfo_Location** google_protobuf_SourceCodeInfo_mutable_location(google_protobuf_SourceCodeInfo *msg, size_t *len) {
return (google_protobuf_SourceCodeInfo_Location**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
}
UPB_INLINE google_protobuf_SourceCodeInfo_Location** google_protobuf_SourceCodeInfo_resize_location(google_protobuf_SourceCodeInfo *msg, size_t len, upb_arena *arena) {
- return (google_protobuf_SourceCodeInfo_Location**)_upb_array_resize_accessor(msg, UPB_SIZE(0, 0), len, UPB_TYPE_MESSAGE, arena);
+ return (google_protobuf_SourceCodeInfo_Location**)_upb_array_resize_accessor(msg, UPB_SIZE(0, 0), len, UPB_TYPE_MESSAGE, arena);
}
UPB_INLINE struct google_protobuf_SourceCodeInfo_Location* google_protobuf_SourceCodeInfo_add_location(google_protobuf_SourceCodeInfo *msg, upb_arena *arena) {
- struct google_protobuf_SourceCodeInfo_Location* sub = (struct google_protobuf_SourceCodeInfo_Location*)_upb_msg_new(&google_protobuf_SourceCodeInfo_Location_msginit, arena);
+ struct google_protobuf_SourceCodeInfo_Location* sub = (struct google_protobuf_SourceCodeInfo_Location*)_upb_msg_new(&google_protobuf_SourceCodeInfo_Location_msginit, arena);
bool ok = _upb_array_append_accessor(
msg, UPB_SIZE(0, 0), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
if (!ok) return NULL;
@@ -1579,7 +1579,7 @@ UPB_INLINE struct google_protobuf_SourceCodeInfo_Location* google_protobuf_Sourc
/* google.protobuf.SourceCodeInfo.Location */
UPB_INLINE google_protobuf_SourceCodeInfo_Location *google_protobuf_SourceCodeInfo_Location_new(upb_arena *arena) {
- return (google_protobuf_SourceCodeInfo_Location *)_upb_msg_new(&google_protobuf_SourceCodeInfo_Location_msginit, arena);
+ return (google_protobuf_SourceCodeInfo_Location *)_upb_msg_new(&google_protobuf_SourceCodeInfo_Location_msginit, arena);
}
UPB_INLINE google_protobuf_SourceCodeInfo_Location *google_protobuf_SourceCodeInfo_Location_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -1592,55 +1592,55 @@ UPB_INLINE char *google_protobuf_SourceCodeInfo_Location_serialize(const google_
UPB_INLINE int32_t const* google_protobuf_SourceCodeInfo_Location_path(const google_protobuf_SourceCodeInfo_Location *msg, size_t *len) { return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(20, 40), len); }
UPB_INLINE int32_t const* google_protobuf_SourceCodeInfo_Location_span(const google_protobuf_SourceCodeInfo_Location *msg, size_t *len) { return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(24, 48), len); }
-UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_has_leading_comments(const google_protobuf_SourceCodeInfo_Location *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE upb_strview google_protobuf_SourceCodeInfo_Location_leading_comments(const google_protobuf_SourceCodeInfo_Location *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
-UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_has_trailing_comments(const google_protobuf_SourceCodeInfo_Location *msg) { return _upb_hasbit(msg, 2); }
-UPB_INLINE upb_strview google_protobuf_SourceCodeInfo_Location_trailing_comments(const google_protobuf_SourceCodeInfo_Location *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview); }
+UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_has_leading_comments(const google_protobuf_SourceCodeInfo_Location *msg) { return _upb_hasbit(msg, 1); }
+UPB_INLINE upb_strview google_protobuf_SourceCodeInfo_Location_leading_comments(const google_protobuf_SourceCodeInfo_Location *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
+UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_has_trailing_comments(const google_protobuf_SourceCodeInfo_Location *msg) { return _upb_hasbit(msg, 2); }
+UPB_INLINE upb_strview google_protobuf_SourceCodeInfo_Location_trailing_comments(const google_protobuf_SourceCodeInfo_Location *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview); }
UPB_INLINE upb_strview const* google_protobuf_SourceCodeInfo_Location_leading_detached_comments(const google_protobuf_SourceCodeInfo_Location *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(28, 56), len); }
UPB_INLINE int32_t* google_protobuf_SourceCodeInfo_Location_mutable_path(google_protobuf_SourceCodeInfo_Location *msg, size_t *len) {
return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 40), len);
}
UPB_INLINE int32_t* google_protobuf_SourceCodeInfo_Location_resize_path(google_protobuf_SourceCodeInfo_Location *msg, size_t len, upb_arena *arena) {
- return (int32_t*)_upb_array_resize_accessor(msg, UPB_SIZE(20, 40), len, UPB_TYPE_INT32, arena);
+ return (int32_t*)_upb_array_resize_accessor(msg, UPB_SIZE(20, 40), len, UPB_TYPE_INT32, arena);
}
UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_add_path(google_protobuf_SourceCodeInfo_Location *msg, int32_t val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(20, 40), UPB_SIZE(4, 4), UPB_TYPE_INT32, &val,
- arena);
+ return _upb_array_append_accessor(msg, UPB_SIZE(20, 40), UPB_SIZE(4, 4), UPB_TYPE_INT32, &val,
+ arena);
}
UPB_INLINE int32_t* google_protobuf_SourceCodeInfo_Location_mutable_span(google_protobuf_SourceCodeInfo_Location *msg, size_t *len) {
return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 48), len);
}
UPB_INLINE int32_t* google_protobuf_SourceCodeInfo_Location_resize_span(google_protobuf_SourceCodeInfo_Location *msg, size_t len, upb_arena *arena) {
- return (int32_t*)_upb_array_resize_accessor(msg, UPB_SIZE(24, 48), len, UPB_TYPE_INT32, arena);
+ return (int32_t*)_upb_array_resize_accessor(msg, UPB_SIZE(24, 48), len, UPB_TYPE_INT32, arena);
}
UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_add_span(google_protobuf_SourceCodeInfo_Location *msg, int32_t val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(24, 48), UPB_SIZE(4, 4), UPB_TYPE_INT32, &val,
- arena);
+ return _upb_array_append_accessor(msg, UPB_SIZE(24, 48), UPB_SIZE(4, 4), UPB_TYPE_INT32, &val,
+ arena);
}
UPB_INLINE void google_protobuf_SourceCodeInfo_Location_set_leading_comments(google_protobuf_SourceCodeInfo_Location *msg, upb_strview value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
}
UPB_INLINE void google_protobuf_SourceCodeInfo_Location_set_trailing_comments(google_protobuf_SourceCodeInfo_Location *msg, upb_strview value) {
_upb_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview) = value;
}
UPB_INLINE upb_strview* google_protobuf_SourceCodeInfo_Location_mutable_leading_detached_comments(google_protobuf_SourceCodeInfo_Location *msg, size_t *len) {
return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 56), len);
}
UPB_INLINE upb_strview* google_protobuf_SourceCodeInfo_Location_resize_leading_detached_comments(google_protobuf_SourceCodeInfo_Location *msg, size_t len, upb_arena *arena) {
- return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(28, 56), len, UPB_TYPE_STRING, arena);
+ return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(28, 56), len, UPB_TYPE_STRING, arena);
}
UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_add_leading_detached_comments(google_protobuf_SourceCodeInfo_Location *msg, upb_strview val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(28, 56), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
- arena);
+ return _upb_array_append_accessor(msg, UPB_SIZE(28, 56), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
+ arena);
}
/* google.protobuf.GeneratedCodeInfo */
UPB_INLINE google_protobuf_GeneratedCodeInfo *google_protobuf_GeneratedCodeInfo_new(upb_arena *arena) {
- return (google_protobuf_GeneratedCodeInfo *)_upb_msg_new(&google_protobuf_GeneratedCodeInfo_msginit, arena);
+ return (google_protobuf_GeneratedCodeInfo *)_upb_msg_new(&google_protobuf_GeneratedCodeInfo_msginit, arena);
}
UPB_INLINE google_protobuf_GeneratedCodeInfo *google_protobuf_GeneratedCodeInfo_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -1651,17 +1651,17 @@ UPB_INLINE char *google_protobuf_GeneratedCodeInfo_serialize(const google_protob
return upb_encode(msg, &google_protobuf_GeneratedCodeInfo_msginit, arena, len);
}
-UPB_INLINE bool google_protobuf_GeneratedCodeInfo_has_annotation(const google_protobuf_GeneratedCodeInfo *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE bool google_protobuf_GeneratedCodeInfo_has_annotation(const google_protobuf_GeneratedCodeInfo *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
UPB_INLINE const google_protobuf_GeneratedCodeInfo_Annotation* const* google_protobuf_GeneratedCodeInfo_annotation(const google_protobuf_GeneratedCodeInfo *msg, size_t *len) { return (const google_protobuf_GeneratedCodeInfo_Annotation* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
UPB_INLINE google_protobuf_GeneratedCodeInfo_Annotation** google_protobuf_GeneratedCodeInfo_mutable_annotation(google_protobuf_GeneratedCodeInfo *msg, size_t *len) {
return (google_protobuf_GeneratedCodeInfo_Annotation**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
}
UPB_INLINE google_protobuf_GeneratedCodeInfo_Annotation** google_protobuf_GeneratedCodeInfo_resize_annotation(google_protobuf_GeneratedCodeInfo *msg, size_t len, upb_arena *arena) {
- return (google_protobuf_GeneratedCodeInfo_Annotation**)_upb_array_resize_accessor(msg, UPB_SIZE(0, 0), len, UPB_TYPE_MESSAGE, arena);
+ return (google_protobuf_GeneratedCodeInfo_Annotation**)_upb_array_resize_accessor(msg, UPB_SIZE(0, 0), len, UPB_TYPE_MESSAGE, arena);
}
UPB_INLINE struct google_protobuf_GeneratedCodeInfo_Annotation* google_protobuf_GeneratedCodeInfo_add_annotation(google_protobuf_GeneratedCodeInfo *msg, upb_arena *arena) {
- struct google_protobuf_GeneratedCodeInfo_Annotation* sub = (struct google_protobuf_GeneratedCodeInfo_Annotation*)_upb_msg_new(&google_protobuf_GeneratedCodeInfo_Annotation_msginit, arena);
+ struct google_protobuf_GeneratedCodeInfo_Annotation* sub = (struct google_protobuf_GeneratedCodeInfo_Annotation*)_upb_msg_new(&google_protobuf_GeneratedCodeInfo_Annotation_msginit, arena);
bool ok = _upb_array_append_accessor(
msg, UPB_SIZE(0, 0), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
if (!ok) return NULL;
@@ -1671,7 +1671,7 @@ UPB_INLINE struct google_protobuf_GeneratedCodeInfo_Annotation* google_protobuf_
/* google.protobuf.GeneratedCodeInfo.Annotation */
UPB_INLINE google_protobuf_GeneratedCodeInfo_Annotation *google_protobuf_GeneratedCodeInfo_Annotation_new(upb_arena *arena) {
- return (google_protobuf_GeneratedCodeInfo_Annotation *)_upb_msg_new(&google_protobuf_GeneratedCodeInfo_Annotation_msginit, arena);
+ return (google_protobuf_GeneratedCodeInfo_Annotation *)_upb_msg_new(&google_protobuf_GeneratedCodeInfo_Annotation_msginit, arena);
}
UPB_INLINE google_protobuf_GeneratedCodeInfo_Annotation *google_protobuf_GeneratedCodeInfo_Annotation_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -1683,34 +1683,34 @@ UPB_INLINE char *google_protobuf_GeneratedCodeInfo_Annotation_serialize(const go
}
UPB_INLINE int32_t const* google_protobuf_GeneratedCodeInfo_Annotation_path(const google_protobuf_GeneratedCodeInfo_Annotation *msg, size_t *len) { return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(20, 32), len); }
-UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_has_source_file(const google_protobuf_GeneratedCodeInfo_Annotation *msg) { return _upb_hasbit(msg, 3); }
-UPB_INLINE upb_strview google_protobuf_GeneratedCodeInfo_Annotation_source_file(const google_protobuf_GeneratedCodeInfo_Annotation *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 16), upb_strview); }
-UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_has_begin(const google_protobuf_GeneratedCodeInfo_Annotation *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE int32_t google_protobuf_GeneratedCodeInfo_Annotation_begin(const google_protobuf_GeneratedCodeInfo_Annotation *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); }
-UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_has_end(const google_protobuf_GeneratedCodeInfo_Annotation *msg) { return _upb_hasbit(msg, 2); }
-UPB_INLINE int32_t google_protobuf_GeneratedCodeInfo_Annotation_end(const google_protobuf_GeneratedCodeInfo_Annotation *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); }
+UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_has_source_file(const google_protobuf_GeneratedCodeInfo_Annotation *msg) { return _upb_hasbit(msg, 3); }
+UPB_INLINE upb_strview google_protobuf_GeneratedCodeInfo_Annotation_source_file(const google_protobuf_GeneratedCodeInfo_Annotation *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 16), upb_strview); }
+UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_has_begin(const google_protobuf_GeneratedCodeInfo_Annotation *msg) { return _upb_hasbit(msg, 1); }
+UPB_INLINE int32_t google_protobuf_GeneratedCodeInfo_Annotation_begin(const google_protobuf_GeneratedCodeInfo_Annotation *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); }
+UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_has_end(const google_protobuf_GeneratedCodeInfo_Annotation *msg) { return _upb_hasbit(msg, 2); }
+UPB_INLINE int32_t google_protobuf_GeneratedCodeInfo_Annotation_end(const google_protobuf_GeneratedCodeInfo_Annotation *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); }
UPB_INLINE int32_t* google_protobuf_GeneratedCodeInfo_Annotation_mutable_path(google_protobuf_GeneratedCodeInfo_Annotation *msg, size_t *len) {
return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 32), len);
}
UPB_INLINE int32_t* google_protobuf_GeneratedCodeInfo_Annotation_resize_path(google_protobuf_GeneratedCodeInfo_Annotation *msg, size_t len, upb_arena *arena) {
- return (int32_t*)_upb_array_resize_accessor(msg, UPB_SIZE(20, 32), len, UPB_TYPE_INT32, arena);
+ return (int32_t*)_upb_array_resize_accessor(msg, UPB_SIZE(20, 32), len, UPB_TYPE_INT32, arena);
}
UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_add_path(google_protobuf_GeneratedCodeInfo_Annotation *msg, int32_t val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(20, 32), UPB_SIZE(4, 4), UPB_TYPE_INT32, &val,
- arena);
+ return _upb_array_append_accessor(msg, UPB_SIZE(20, 32), UPB_SIZE(4, 4), UPB_TYPE_INT32, &val,
+ arena);
}
UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_set_source_file(google_protobuf_GeneratedCodeInfo_Annotation *msg, upb_strview value) {
_upb_sethas(msg, 3);
- *UPB_PTR_AT(msg, UPB_SIZE(12, 16), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 16), upb_strview) = value;
}
UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_set_begin(google_protobuf_GeneratedCodeInfo_Annotation *msg, int32_t value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value;
}
UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_set_end(google_protobuf_GeneratedCodeInfo_Annotation *msg, int32_t value) {
_upb_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
}
#ifdef __cplusplus
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/duration.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/duration.upb.h
index e26caa24be7..f3fa03591c4 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/duration.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/duration.upb.h
@@ -27,7 +27,7 @@ extern const upb_msglayout google_protobuf_Duration_msginit;
/* google.protobuf.Duration */
UPB_INLINE google_protobuf_Duration *google_protobuf_Duration_new(upb_arena *arena) {
- return (google_protobuf_Duration *)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
+ return (google_protobuf_Duration *)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
}
UPB_INLINE google_protobuf_Duration *google_protobuf_Duration_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -38,14 +38,14 @@ UPB_INLINE char *google_protobuf_Duration_serialize(const google_protobuf_Durati
return upb_encode(msg, &google_protobuf_Duration_msginit, arena, len);
}
-UPB_INLINE int64_t google_protobuf_Duration_seconds(const google_protobuf_Duration *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int64_t); }
-UPB_INLINE int32_t google_protobuf_Duration_nanos(const google_protobuf_Duration *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); }
+UPB_INLINE int64_t google_protobuf_Duration_seconds(const google_protobuf_Duration *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int64_t); }
+UPB_INLINE int32_t google_protobuf_Duration_nanos(const google_protobuf_Duration *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); }
UPB_INLINE void google_protobuf_Duration_set_seconds(google_protobuf_Duration *msg, int64_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int64_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int64_t) = value;
}
UPB_INLINE void google_protobuf_Duration_set_nanos(google_protobuf_Duration *msg, int32_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
}
#ifdef __cplusplus
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/empty.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/empty.upb.h
index 75d985e84ef..a7471dcd08d 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/empty.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/empty.upb.h
@@ -27,7 +27,7 @@ extern const upb_msglayout google_protobuf_Empty_msginit;
/* google.protobuf.Empty */
UPB_INLINE google_protobuf_Empty *google_protobuf_Empty_new(upb_arena *arena) {
- return (google_protobuf_Empty *)_upb_msg_new(&google_protobuf_Empty_msginit, arena);
+ return (google_protobuf_Empty *)_upb_msg_new(&google_protobuf_Empty_msginit, arena);
}
UPB_INLINE google_protobuf_Empty *google_protobuf_Empty_parse(const char *buf, size_t size,
upb_arena *arena) {
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/struct.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/struct.upb.c
index 105e051f26e..a0d20a4fae0 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/struct.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/struct.upb.c
@@ -17,7 +17,7 @@ static const upb_msglayout *const google_protobuf_Struct_submsgs[1] = {
};
static const upb_msglayout_field google_protobuf_Struct__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, _UPB_LABEL_MAP},
+ {1, UPB_SIZE(0, 0), 0, 0, 11, _UPB_LABEL_MAP},
};
const upb_msglayout google_protobuf_Struct_msginit = {
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/struct.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/struct.upb.h
index 673ca64ebce..b25201d3234 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/struct.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/struct.upb.h
@@ -40,7 +40,7 @@ typedef enum {
/* google.protobuf.Struct */
UPB_INLINE google_protobuf_Struct *google_protobuf_Struct_new(upb_arena *arena) {
- return (google_protobuf_Struct *)_upb_msg_new(&google_protobuf_Struct_msginit, arena);
+ return (google_protobuf_Struct *)_upb_msg_new(&google_protobuf_Struct_msginit, arena);
}
UPB_INLINE google_protobuf_Struct *google_protobuf_Struct_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -51,38 +51,38 @@ UPB_INLINE char *google_protobuf_Struct_serialize(const google_protobuf_Struct *
return upb_encode(msg, &google_protobuf_Struct_msginit, arena, len);
}
-UPB_INLINE bool google_protobuf_Struct_has_fields(const google_protobuf_Struct *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE size_t google_protobuf_Struct_fields_size(const google_protobuf_Struct *msg) {return _upb_msg_map_size(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE bool google_protobuf_Struct_fields_get(const google_protobuf_Struct *msg, upb_strview key, google_protobuf_Value* *val) { return _upb_msg_map_get(msg, UPB_SIZE(0, 0), &key, 0, val, sizeof(*val)); }
-UPB_INLINE const google_protobuf_Struct_FieldsEntry* google_protobuf_Struct_fields_next(const google_protobuf_Struct *msg, size_t* iter) { return (const google_protobuf_Struct_FieldsEntry*)_upb_msg_map_next(msg, UPB_SIZE(0, 0), iter); }
+UPB_INLINE bool google_protobuf_Struct_has_fields(const google_protobuf_Struct *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE size_t google_protobuf_Struct_fields_size(const google_protobuf_Struct *msg) {return _upb_msg_map_size(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE bool google_protobuf_Struct_fields_get(const google_protobuf_Struct *msg, upb_strview key, google_protobuf_Value* *val) { return _upb_msg_map_get(msg, UPB_SIZE(0, 0), &key, 0, val, sizeof(*val)); }
+UPB_INLINE const google_protobuf_Struct_FieldsEntry* google_protobuf_Struct_fields_next(const google_protobuf_Struct *msg, size_t* iter) { return (const google_protobuf_Struct_FieldsEntry*)_upb_msg_map_next(msg, UPB_SIZE(0, 0), iter); }
-UPB_INLINE void google_protobuf_Struct_fields_clear(google_protobuf_Struct *msg) { _upb_msg_map_clear(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE bool google_protobuf_Struct_fields_set(google_protobuf_Struct *msg, upb_strview key, google_protobuf_Value* val, upb_arena *a) { return _upb_msg_map_set(msg, UPB_SIZE(0, 0), &key, 0, &val, sizeof(val), a); }
-UPB_INLINE bool google_protobuf_Struct_fields_delete(google_protobuf_Struct *msg, upb_strview key) { return _upb_msg_map_delete(msg, UPB_SIZE(0, 0), &key, 0); }
-UPB_INLINE google_protobuf_Struct_FieldsEntry* google_protobuf_Struct_fields_nextmutable(google_protobuf_Struct *msg, size_t* iter) { return (google_protobuf_Struct_FieldsEntry*)_upb_msg_map_next(msg, UPB_SIZE(0, 0), iter); }
+UPB_INLINE void google_protobuf_Struct_fields_clear(google_protobuf_Struct *msg) { _upb_msg_map_clear(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE bool google_protobuf_Struct_fields_set(google_protobuf_Struct *msg, upb_strview key, google_protobuf_Value* val, upb_arena *a) { return _upb_msg_map_set(msg, UPB_SIZE(0, 0), &key, 0, &val, sizeof(val), a); }
+UPB_INLINE bool google_protobuf_Struct_fields_delete(google_protobuf_Struct *msg, upb_strview key) { return _upb_msg_map_delete(msg, UPB_SIZE(0, 0), &key, 0); }
+UPB_INLINE google_protobuf_Struct_FieldsEntry* google_protobuf_Struct_fields_nextmutable(google_protobuf_Struct *msg, size_t* iter) { return (google_protobuf_Struct_FieldsEntry*)_upb_msg_map_next(msg, UPB_SIZE(0, 0), iter); }
/* google.protobuf.Struct.FieldsEntry */
-UPB_INLINE upb_strview google_protobuf_Struct_FieldsEntry_key(const google_protobuf_Struct_FieldsEntry *msg) {
- upb_strview ret;
- _upb_msg_map_key(msg, &ret, 0);
- return ret;
+UPB_INLINE upb_strview google_protobuf_Struct_FieldsEntry_key(const google_protobuf_Struct_FieldsEntry *msg) {
+ upb_strview ret;
+ _upb_msg_map_key(msg, &ret, 0);
+ return ret;
}
-UPB_INLINE bool google_protobuf_Struct_FieldsEntry_has_value(const google_protobuf_Struct_FieldsEntry *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const google_protobuf_Value* google_protobuf_Struct_FieldsEntry_value(const google_protobuf_Struct_FieldsEntry *msg) {
- google_protobuf_Value* ret;
- _upb_msg_map_value(msg, &ret, sizeof(ret));
- return ret;
+UPB_INLINE bool google_protobuf_Struct_FieldsEntry_has_value(const google_protobuf_Struct_FieldsEntry *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
+UPB_INLINE const google_protobuf_Value* google_protobuf_Struct_FieldsEntry_value(const google_protobuf_Struct_FieldsEntry *msg) {
+ google_protobuf_Value* ret;
+ _upb_msg_map_value(msg, &ret, sizeof(ret));
+ return ret;
}
UPB_INLINE void google_protobuf_Struct_FieldsEntry_set_value(google_protobuf_Struct_FieldsEntry *msg, google_protobuf_Value* value) {
- _upb_msg_map_set_value(msg, &value, sizeof(google_protobuf_Value*));
+ _upb_msg_map_set_value(msg, &value, sizeof(google_protobuf_Value*));
}
/* google.protobuf.Value */
UPB_INLINE google_protobuf_Value *google_protobuf_Value_new(upb_arena *arena) {
- return (google_protobuf_Value *)_upb_msg_new(&google_protobuf_Value_msginit, arena);
+ return (google_protobuf_Value *)_upb_msg_new(&google_protobuf_Value_msginit, arena);
}
UPB_INLINE google_protobuf_Value *google_protobuf_Value_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -102,19 +102,19 @@ typedef enum {
google_protobuf_Value_kind_list_value = 6,
google_protobuf_Value_kind_NOT_SET = 0
} google_protobuf_Value_kind_oneofcases;
-UPB_INLINE google_protobuf_Value_kind_oneofcases google_protobuf_Value_kind_case(const google_protobuf_Value* msg) { return (google_protobuf_Value_kind_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(8, 16), int32_t); }
+UPB_INLINE google_protobuf_Value_kind_oneofcases google_protobuf_Value_kind_case(const google_protobuf_Value* msg) { return (google_protobuf_Value_kind_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(8, 16), int32_t); }
-UPB_INLINE bool google_protobuf_Value_has_null_value(const google_protobuf_Value *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 1; }
-UPB_INLINE int32_t google_protobuf_Value_null_value(const google_protobuf_Value *msg) { return UPB_READ_ONEOF(msg, int32_t, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 1, 0); }
-UPB_INLINE bool google_protobuf_Value_has_number_value(const google_protobuf_Value *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 2; }
+UPB_INLINE bool google_protobuf_Value_has_null_value(const google_protobuf_Value *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 1; }
+UPB_INLINE int32_t google_protobuf_Value_null_value(const google_protobuf_Value *msg) { return UPB_READ_ONEOF(msg, int32_t, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 1, 0); }
+UPB_INLINE bool google_protobuf_Value_has_number_value(const google_protobuf_Value *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 2; }
UPB_INLINE double google_protobuf_Value_number_value(const google_protobuf_Value *msg) { return UPB_READ_ONEOF(msg, double, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 2, 0); }
-UPB_INLINE bool google_protobuf_Value_has_string_value(const google_protobuf_Value *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 3; }
+UPB_INLINE bool google_protobuf_Value_has_string_value(const google_protobuf_Value *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 3; }
UPB_INLINE upb_strview google_protobuf_Value_string_value(const google_protobuf_Value *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 3, upb_strview_make("", strlen(""))); }
-UPB_INLINE bool google_protobuf_Value_has_bool_value(const google_protobuf_Value *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 4; }
+UPB_INLINE bool google_protobuf_Value_has_bool_value(const google_protobuf_Value *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 4; }
UPB_INLINE bool google_protobuf_Value_bool_value(const google_protobuf_Value *msg) { return UPB_READ_ONEOF(msg, bool, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 4, false); }
-UPB_INLINE bool google_protobuf_Value_has_struct_value(const google_protobuf_Value *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 5; }
+UPB_INLINE bool google_protobuf_Value_has_struct_value(const google_protobuf_Value *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 5; }
UPB_INLINE const google_protobuf_Struct* google_protobuf_Value_struct_value(const google_protobuf_Value *msg) { return UPB_READ_ONEOF(msg, const google_protobuf_Struct*, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 5, NULL); }
-UPB_INLINE bool google_protobuf_Value_has_list_value(const google_protobuf_Value *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 6; }
+UPB_INLINE bool google_protobuf_Value_has_list_value(const google_protobuf_Value *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 6; }
UPB_INLINE const google_protobuf_ListValue* google_protobuf_Value_list_value(const google_protobuf_Value *msg) { return UPB_READ_ONEOF(msg, const google_protobuf_ListValue*, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 6, NULL); }
UPB_INLINE void google_protobuf_Value_set_null_value(google_protobuf_Value *msg, int32_t value) {
@@ -135,7 +135,7 @@ UPB_INLINE void google_protobuf_Value_set_struct_value(google_protobuf_Value *ms
UPB_INLINE struct google_protobuf_Struct* google_protobuf_Value_mutable_struct_value(google_protobuf_Value *msg, upb_arena *arena) {
struct google_protobuf_Struct* sub = (struct google_protobuf_Struct*)google_protobuf_Value_struct_value(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_Struct*)_upb_msg_new(&google_protobuf_Struct_msginit, arena);
+ sub = (struct google_protobuf_Struct*)_upb_msg_new(&google_protobuf_Struct_msginit, arena);
if (!sub) return NULL;
google_protobuf_Value_set_struct_value(msg, sub);
}
@@ -147,7 +147,7 @@ UPB_INLINE void google_protobuf_Value_set_list_value(google_protobuf_Value *msg,
UPB_INLINE struct google_protobuf_ListValue* google_protobuf_Value_mutable_list_value(google_protobuf_Value *msg, upb_arena *arena) {
struct google_protobuf_ListValue* sub = (struct google_protobuf_ListValue*)google_protobuf_Value_list_value(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_ListValue*)_upb_msg_new(&google_protobuf_ListValue_msginit, arena);
+ sub = (struct google_protobuf_ListValue*)_upb_msg_new(&google_protobuf_ListValue_msginit, arena);
if (!sub) return NULL;
google_protobuf_Value_set_list_value(msg, sub);
}
@@ -157,7 +157,7 @@ UPB_INLINE struct google_protobuf_ListValue* google_protobuf_Value_mutable_list_
/* google.protobuf.ListValue */
UPB_INLINE google_protobuf_ListValue *google_protobuf_ListValue_new(upb_arena *arena) {
- return (google_protobuf_ListValue *)_upb_msg_new(&google_protobuf_ListValue_msginit, arena);
+ return (google_protobuf_ListValue *)_upb_msg_new(&google_protobuf_ListValue_msginit, arena);
}
UPB_INLINE google_protobuf_ListValue *google_protobuf_ListValue_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -168,17 +168,17 @@ UPB_INLINE char *google_protobuf_ListValue_serialize(const google_protobuf_ListV
return upb_encode(msg, &google_protobuf_ListValue_msginit, arena, len);
}
-UPB_INLINE bool google_protobuf_ListValue_has_values(const google_protobuf_ListValue *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE bool google_protobuf_ListValue_has_values(const google_protobuf_ListValue *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
UPB_INLINE const google_protobuf_Value* const* google_protobuf_ListValue_values(const google_protobuf_ListValue *msg, size_t *len) { return (const google_protobuf_Value* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
UPB_INLINE google_protobuf_Value** google_protobuf_ListValue_mutable_values(google_protobuf_ListValue *msg, size_t *len) {
return (google_protobuf_Value**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
}
UPB_INLINE google_protobuf_Value** google_protobuf_ListValue_resize_values(google_protobuf_ListValue *msg, size_t len, upb_arena *arena) {
- return (google_protobuf_Value**)_upb_array_resize_accessor(msg, UPB_SIZE(0, 0), len, UPB_TYPE_MESSAGE, arena);
+ return (google_protobuf_Value**)_upb_array_resize_accessor(msg, UPB_SIZE(0, 0), len, UPB_TYPE_MESSAGE, arena);
}
UPB_INLINE struct google_protobuf_Value* google_protobuf_ListValue_add_values(google_protobuf_ListValue *msg, upb_arena *arena) {
- struct google_protobuf_Value* sub = (struct google_protobuf_Value*)_upb_msg_new(&google_protobuf_Value_msginit, arena);
+ struct google_protobuf_Value* sub = (struct google_protobuf_Value*)_upb_msg_new(&google_protobuf_Value_msginit, arena);
bool ok = _upb_array_append_accessor(
msg, UPB_SIZE(0, 0), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
if (!ok) return NULL;
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/timestamp.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/timestamp.upb.h
index a464536a1fc..f5166de4d5d 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/timestamp.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/timestamp.upb.h
@@ -27,7 +27,7 @@ extern const upb_msglayout google_protobuf_Timestamp_msginit;
/* google.protobuf.Timestamp */
UPB_INLINE google_protobuf_Timestamp *google_protobuf_Timestamp_new(upb_arena *arena) {
- return (google_protobuf_Timestamp *)_upb_msg_new(&google_protobuf_Timestamp_msginit, arena);
+ return (google_protobuf_Timestamp *)_upb_msg_new(&google_protobuf_Timestamp_msginit, arena);
}
UPB_INLINE google_protobuf_Timestamp *google_protobuf_Timestamp_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -38,14 +38,14 @@ UPB_INLINE char *google_protobuf_Timestamp_serialize(const google_protobuf_Times
return upb_encode(msg, &google_protobuf_Timestamp_msginit, arena, len);
}
-UPB_INLINE int64_t google_protobuf_Timestamp_seconds(const google_protobuf_Timestamp *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int64_t); }
-UPB_INLINE int32_t google_protobuf_Timestamp_nanos(const google_protobuf_Timestamp *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); }
+UPB_INLINE int64_t google_protobuf_Timestamp_seconds(const google_protobuf_Timestamp *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int64_t); }
+UPB_INLINE int32_t google_protobuf_Timestamp_nanos(const google_protobuf_Timestamp *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); }
UPB_INLINE void google_protobuf_Timestamp_set_seconds(google_protobuf_Timestamp *msg, int64_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int64_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int64_t) = value;
}
UPB_INLINE void google_protobuf_Timestamp_set_nanos(google_protobuf_Timestamp *msg, int32_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
}
#ifdef __cplusplus
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/wrappers.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/wrappers.upb.h
index 6e060203f27..761eeebdd64 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/wrappers.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/wrappers.upb.h
@@ -51,7 +51,7 @@ extern const upb_msglayout google_protobuf_BytesValue_msginit;
/* google.protobuf.DoubleValue */
UPB_INLINE google_protobuf_DoubleValue *google_protobuf_DoubleValue_new(upb_arena *arena) {
- return (google_protobuf_DoubleValue *)_upb_msg_new(&google_protobuf_DoubleValue_msginit, arena);
+ return (google_protobuf_DoubleValue *)_upb_msg_new(&google_protobuf_DoubleValue_msginit, arena);
}
UPB_INLINE google_protobuf_DoubleValue *google_protobuf_DoubleValue_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -62,16 +62,16 @@ UPB_INLINE char *google_protobuf_DoubleValue_serialize(const google_protobuf_Dou
return upb_encode(msg, &google_protobuf_DoubleValue_msginit, arena, len);
}
-UPB_INLINE double google_protobuf_DoubleValue_value(const google_protobuf_DoubleValue *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), double); }
+UPB_INLINE double google_protobuf_DoubleValue_value(const google_protobuf_DoubleValue *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), double); }
UPB_INLINE void google_protobuf_DoubleValue_set_value(google_protobuf_DoubleValue *msg, double value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), double) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), double) = value;
}
/* google.protobuf.FloatValue */
UPB_INLINE google_protobuf_FloatValue *google_protobuf_FloatValue_new(upb_arena *arena) {
- return (google_protobuf_FloatValue *)_upb_msg_new(&google_protobuf_FloatValue_msginit, arena);
+ return (google_protobuf_FloatValue *)_upb_msg_new(&google_protobuf_FloatValue_msginit, arena);
}
UPB_INLINE google_protobuf_FloatValue *google_protobuf_FloatValue_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -82,16 +82,16 @@ UPB_INLINE char *google_protobuf_FloatValue_serialize(const google_protobuf_Floa
return upb_encode(msg, &google_protobuf_FloatValue_msginit, arena, len);
}
-UPB_INLINE float google_protobuf_FloatValue_value(const google_protobuf_FloatValue *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), float); }
+UPB_INLINE float google_protobuf_FloatValue_value(const google_protobuf_FloatValue *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), float); }
UPB_INLINE void google_protobuf_FloatValue_set_value(google_protobuf_FloatValue *msg, float value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), float) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), float) = value;
}
/* google.protobuf.Int64Value */
UPB_INLINE google_protobuf_Int64Value *google_protobuf_Int64Value_new(upb_arena *arena) {
- return (google_protobuf_Int64Value *)_upb_msg_new(&google_protobuf_Int64Value_msginit, arena);
+ return (google_protobuf_Int64Value *)_upb_msg_new(&google_protobuf_Int64Value_msginit, arena);
}
UPB_INLINE google_protobuf_Int64Value *google_protobuf_Int64Value_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -102,16 +102,16 @@ UPB_INLINE char *google_protobuf_Int64Value_serialize(const google_protobuf_Int6
return upb_encode(msg, &google_protobuf_Int64Value_msginit, arena, len);
}
-UPB_INLINE int64_t google_protobuf_Int64Value_value(const google_protobuf_Int64Value *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int64_t); }
+UPB_INLINE int64_t google_protobuf_Int64Value_value(const google_protobuf_Int64Value *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int64_t); }
UPB_INLINE void google_protobuf_Int64Value_set_value(google_protobuf_Int64Value *msg, int64_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int64_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int64_t) = value;
}
/* google.protobuf.UInt64Value */
UPB_INLINE google_protobuf_UInt64Value *google_protobuf_UInt64Value_new(upb_arena *arena) {
- return (google_protobuf_UInt64Value *)_upb_msg_new(&google_protobuf_UInt64Value_msginit, arena);
+ return (google_protobuf_UInt64Value *)_upb_msg_new(&google_protobuf_UInt64Value_msginit, arena);
}
UPB_INLINE google_protobuf_UInt64Value *google_protobuf_UInt64Value_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -122,16 +122,16 @@ UPB_INLINE char *google_protobuf_UInt64Value_serialize(const google_protobuf_UIn
return upb_encode(msg, &google_protobuf_UInt64Value_msginit, arena, len);
}
-UPB_INLINE uint64_t google_protobuf_UInt64Value_value(const google_protobuf_UInt64Value *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint64_t); }
+UPB_INLINE uint64_t google_protobuf_UInt64Value_value(const google_protobuf_UInt64Value *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint64_t); }
UPB_INLINE void google_protobuf_UInt64Value_set_value(google_protobuf_UInt64Value *msg, uint64_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint64_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint64_t) = value;
}
/* google.protobuf.Int32Value */
UPB_INLINE google_protobuf_Int32Value *google_protobuf_Int32Value_new(upb_arena *arena) {
- return (google_protobuf_Int32Value *)_upb_msg_new(&google_protobuf_Int32Value_msginit, arena);
+ return (google_protobuf_Int32Value *)_upb_msg_new(&google_protobuf_Int32Value_msginit, arena);
}
UPB_INLINE google_protobuf_Int32Value *google_protobuf_Int32Value_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -142,16 +142,16 @@ UPB_INLINE char *google_protobuf_Int32Value_serialize(const google_protobuf_Int3
return upb_encode(msg, &google_protobuf_Int32Value_msginit, arena, len);
}
-UPB_INLINE int32_t google_protobuf_Int32Value_value(const google_protobuf_Int32Value *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
+UPB_INLINE int32_t google_protobuf_Int32Value_value(const google_protobuf_Int32Value *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
UPB_INLINE void google_protobuf_Int32Value_set_value(google_protobuf_Int32Value *msg, int32_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
}
/* google.protobuf.UInt32Value */
UPB_INLINE google_protobuf_UInt32Value *google_protobuf_UInt32Value_new(upb_arena *arena) {
- return (google_protobuf_UInt32Value *)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
+ return (google_protobuf_UInt32Value *)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
}
UPB_INLINE google_protobuf_UInt32Value *google_protobuf_UInt32Value_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -162,16 +162,16 @@ UPB_INLINE char *google_protobuf_UInt32Value_serialize(const google_protobuf_UIn
return upb_encode(msg, &google_protobuf_UInt32Value_msginit, arena, len);
}
-UPB_INLINE uint32_t google_protobuf_UInt32Value_value(const google_protobuf_UInt32Value *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t); }
+UPB_INLINE uint32_t google_protobuf_UInt32Value_value(const google_protobuf_UInt32Value *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t); }
UPB_INLINE void google_protobuf_UInt32Value_set_value(google_protobuf_UInt32Value *msg, uint32_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t) = value;
}
/* google.protobuf.BoolValue */
UPB_INLINE google_protobuf_BoolValue *google_protobuf_BoolValue_new(upb_arena *arena) {
- return (google_protobuf_BoolValue *)_upb_msg_new(&google_protobuf_BoolValue_msginit, arena);
+ return (google_protobuf_BoolValue *)_upb_msg_new(&google_protobuf_BoolValue_msginit, arena);
}
UPB_INLINE google_protobuf_BoolValue *google_protobuf_BoolValue_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -182,16 +182,16 @@ UPB_INLINE char *google_protobuf_BoolValue_serialize(const google_protobuf_BoolV
return upb_encode(msg, &google_protobuf_BoolValue_msginit, arena, len);
}
-UPB_INLINE bool google_protobuf_BoolValue_value(const google_protobuf_BoolValue *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); }
+UPB_INLINE bool google_protobuf_BoolValue_value(const google_protobuf_BoolValue *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); }
UPB_INLINE void google_protobuf_BoolValue_set_value(google_protobuf_BoolValue *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
}
/* google.protobuf.StringValue */
UPB_INLINE google_protobuf_StringValue *google_protobuf_StringValue_new(upb_arena *arena) {
- return (google_protobuf_StringValue *)_upb_msg_new(&google_protobuf_StringValue_msginit, arena);
+ return (google_protobuf_StringValue *)_upb_msg_new(&google_protobuf_StringValue_msginit, arena);
}
UPB_INLINE google_protobuf_StringValue *google_protobuf_StringValue_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -202,16 +202,16 @@ UPB_INLINE char *google_protobuf_StringValue_serialize(const google_protobuf_Str
return upb_encode(msg, &google_protobuf_StringValue_msginit, arena, len);
}
-UPB_INLINE upb_strview google_protobuf_StringValue_value(const google_protobuf_StringValue *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE upb_strview google_protobuf_StringValue_value(const google_protobuf_StringValue *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
UPB_INLINE void google_protobuf_StringValue_set_value(google_protobuf_StringValue *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
}
/* google.protobuf.BytesValue */
UPB_INLINE google_protobuf_BytesValue *google_protobuf_BytesValue_new(upb_arena *arena) {
- return (google_protobuf_BytesValue *)_upb_msg_new(&google_protobuf_BytesValue_msginit, arena);
+ return (google_protobuf_BytesValue *)_upb_msg_new(&google_protobuf_BytesValue_msginit, arena);
}
UPB_INLINE google_protobuf_BytesValue *google_protobuf_BytesValue_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -222,10 +222,10 @@ UPB_INLINE char *google_protobuf_BytesValue_serialize(const google_protobuf_Byte
return upb_encode(msg, &google_protobuf_BytesValue_msginit, arena, len);
}
-UPB_INLINE upb_strview google_protobuf_BytesValue_value(const google_protobuf_BytesValue *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE upb_strview google_protobuf_BytesValue_value(const google_protobuf_BytesValue *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
UPB_INLINE void google_protobuf_BytesValue_set_value(google_protobuf_BytesValue *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
}
#ifdef __cplusplus
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/google/rpc/status.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/google/rpc/status.upb.h
index 3eb92910d5a..2c5fb02f7d9 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/google/rpc/status.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/google/rpc/status.upb.h
@@ -29,7 +29,7 @@ extern const upb_msglayout google_protobuf_Any_msginit;
/* google.rpc.Status */
UPB_INLINE google_rpc_Status *google_rpc_Status_new(upb_arena *arena) {
- return (google_rpc_Status *)_upb_msg_new(&google_rpc_Status_msginit, arena);
+ return (google_rpc_Status *)_upb_msg_new(&google_rpc_Status_msginit, arena);
}
UPB_INLINE google_rpc_Status *google_rpc_Status_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -40,25 +40,25 @@ UPB_INLINE char *google_rpc_Status_serialize(const google_rpc_Status *msg, upb_a
return upb_encode(msg, &google_rpc_Status_msginit, arena, len);
}
-UPB_INLINE int32_t google_rpc_Status_code(const google_rpc_Status *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
-UPB_INLINE upb_strview google_rpc_Status_message(const google_rpc_Status *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
-UPB_INLINE bool google_rpc_Status_has_details(const google_rpc_Status *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
+UPB_INLINE int32_t google_rpc_Status_code(const google_rpc_Status *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
+UPB_INLINE upb_strview google_rpc_Status_message(const google_rpc_Status *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
+UPB_INLINE bool google_rpc_Status_has_details(const google_rpc_Status *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
UPB_INLINE const struct google_protobuf_Any* const* google_rpc_Status_details(const google_rpc_Status *msg, size_t *len) { return (const struct google_protobuf_Any* const*)_upb_array_accessor(msg, UPB_SIZE(12, 24), len); }
UPB_INLINE void google_rpc_Status_set_code(google_rpc_Status *msg, int32_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
}
UPB_INLINE void google_rpc_Status_set_message(google_rpc_Status *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
}
UPB_INLINE struct google_protobuf_Any** google_rpc_Status_mutable_details(google_rpc_Status *msg, size_t *len) {
return (struct google_protobuf_Any**)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 24), len);
}
UPB_INLINE struct google_protobuf_Any** google_rpc_Status_resize_details(google_rpc_Status *msg, size_t len, upb_arena *arena) {
- return (struct google_protobuf_Any**)_upb_array_resize_accessor(msg, UPB_SIZE(12, 24), len, UPB_TYPE_MESSAGE, arena);
+ return (struct google_protobuf_Any**)_upb_array_resize_accessor(msg, UPB_SIZE(12, 24), len, UPB_TYPE_MESSAGE, arena);
}
UPB_INLINE struct google_protobuf_Any* google_rpc_Status_add_details(google_rpc_Status *msg, upb_arena *arena) {
- struct google_protobuf_Any* sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena);
+ struct google_protobuf_Any* sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena);
bool ok = _upb_array_append_accessor(
msg, UPB_SIZE(12, 24), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
if (!ok) return NULL;
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c
index 5757766423c..6c917ad9f20 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c
@@ -25,7 +25,7 @@ static const upb_msglayout_field grpc_gcp_AltsContext__fields[7] = {
{4, UPB_SIZE(24, 40), 0, 0, 9, 1},
{5, UPB_SIZE(32, 56), 0, 0, 9, 1},
{6, UPB_SIZE(40, 72), 0, 1, 11, 1},
- {7, UPB_SIZE(44, 80), 0, 0, 11, _UPB_LABEL_MAP},
+ {7, UPB_SIZE(44, 80), 0, 0, 11, _UPB_LABEL_MAP},
};
const upb_msglayout grpc_gcp_AltsContext_msginit = {
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.h
index 68d4be0f1c5..33c1b2f160a 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.h
@@ -32,7 +32,7 @@ extern const upb_msglayout grpc_gcp_RpcProtocolVersions_msginit;
/* grpc.gcp.AltsContext */
UPB_INLINE grpc_gcp_AltsContext *grpc_gcp_AltsContext_new(upb_arena *arena) {
- return (grpc_gcp_AltsContext *)_upb_msg_new(&grpc_gcp_AltsContext_msginit, arena);
+ return (grpc_gcp_AltsContext *)_upb_msg_new(&grpc_gcp_AltsContext_msginit, arena);
}
UPB_INLINE grpc_gcp_AltsContext *grpc_gcp_AltsContext_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -43,65 +43,65 @@ UPB_INLINE char *grpc_gcp_AltsContext_serialize(const grpc_gcp_AltsContext *msg,
return upb_encode(msg, &grpc_gcp_AltsContext_msginit, arena, len);
}
-UPB_INLINE upb_strview grpc_gcp_AltsContext_application_protocol(const grpc_gcp_AltsContext *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview); }
-UPB_INLINE upb_strview grpc_gcp_AltsContext_record_protocol(const grpc_gcp_AltsContext *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_strview); }
-UPB_INLINE int32_t grpc_gcp_AltsContext_security_level(const grpc_gcp_AltsContext *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
-UPB_INLINE upb_strview grpc_gcp_AltsContext_peer_service_account(const grpc_gcp_AltsContext *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), upb_strview); }
-UPB_INLINE upb_strview grpc_gcp_AltsContext_local_service_account(const grpc_gcp_AltsContext *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 56), upb_strview); }
-UPB_INLINE bool grpc_gcp_AltsContext_has_peer_rpc_versions(const grpc_gcp_AltsContext *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(40, 72)); }
-UPB_INLINE const struct grpc_gcp_RpcProtocolVersions* grpc_gcp_AltsContext_peer_rpc_versions(const grpc_gcp_AltsContext *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(40, 72), const struct grpc_gcp_RpcProtocolVersions*); }
-UPB_INLINE bool grpc_gcp_AltsContext_has_peer_attributes(const grpc_gcp_AltsContext *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(44, 80)); }
-UPB_INLINE size_t grpc_gcp_AltsContext_peer_attributes_size(const grpc_gcp_AltsContext *msg) {return _upb_msg_map_size(msg, UPB_SIZE(44, 80)); }
-UPB_INLINE bool grpc_gcp_AltsContext_peer_attributes_get(const grpc_gcp_AltsContext *msg, upb_strview key, upb_strview *val) { return _upb_msg_map_get(msg, UPB_SIZE(44, 80), &key, 0, val, 0); }
-UPB_INLINE const grpc_gcp_AltsContext_PeerAttributesEntry* grpc_gcp_AltsContext_peer_attributes_next(const grpc_gcp_AltsContext *msg, size_t* iter) { return (const grpc_gcp_AltsContext_PeerAttributesEntry*)_upb_msg_map_next(msg, UPB_SIZE(44, 80), iter); }
+UPB_INLINE upb_strview grpc_gcp_AltsContext_application_protocol(const grpc_gcp_AltsContext *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview); }
+UPB_INLINE upb_strview grpc_gcp_AltsContext_record_protocol(const grpc_gcp_AltsContext *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_strview); }
+UPB_INLINE int32_t grpc_gcp_AltsContext_security_level(const grpc_gcp_AltsContext *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
+UPB_INLINE upb_strview grpc_gcp_AltsContext_peer_service_account(const grpc_gcp_AltsContext *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), upb_strview); }
+UPB_INLINE upb_strview grpc_gcp_AltsContext_local_service_account(const grpc_gcp_AltsContext *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 56), upb_strview); }
+UPB_INLINE bool grpc_gcp_AltsContext_has_peer_rpc_versions(const grpc_gcp_AltsContext *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(40, 72)); }
+UPB_INLINE const struct grpc_gcp_RpcProtocolVersions* grpc_gcp_AltsContext_peer_rpc_versions(const grpc_gcp_AltsContext *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(40, 72), const struct grpc_gcp_RpcProtocolVersions*); }
+UPB_INLINE bool grpc_gcp_AltsContext_has_peer_attributes(const grpc_gcp_AltsContext *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(44, 80)); }
+UPB_INLINE size_t grpc_gcp_AltsContext_peer_attributes_size(const grpc_gcp_AltsContext *msg) {return _upb_msg_map_size(msg, UPB_SIZE(44, 80)); }
+UPB_INLINE bool grpc_gcp_AltsContext_peer_attributes_get(const grpc_gcp_AltsContext *msg, upb_strview key, upb_strview *val) { return _upb_msg_map_get(msg, UPB_SIZE(44, 80), &key, 0, val, 0); }
+UPB_INLINE const grpc_gcp_AltsContext_PeerAttributesEntry* grpc_gcp_AltsContext_peer_attributes_next(const grpc_gcp_AltsContext *msg, size_t* iter) { return (const grpc_gcp_AltsContext_PeerAttributesEntry*)_upb_msg_map_next(msg, UPB_SIZE(44, 80), iter); }
UPB_INLINE void grpc_gcp_AltsContext_set_application_protocol(grpc_gcp_AltsContext *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview) = value;
}
UPB_INLINE void grpc_gcp_AltsContext_set_record_protocol(grpc_gcp_AltsContext *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_strview) = value;
}
UPB_INLINE void grpc_gcp_AltsContext_set_security_level(grpc_gcp_AltsContext *msg, int32_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
}
UPB_INLINE void grpc_gcp_AltsContext_set_peer_service_account(grpc_gcp_AltsContext *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(24, 40), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 40), upb_strview) = value;
}
UPB_INLINE void grpc_gcp_AltsContext_set_local_service_account(grpc_gcp_AltsContext *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(32, 56), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 56), upb_strview) = value;
}
UPB_INLINE void grpc_gcp_AltsContext_set_peer_rpc_versions(grpc_gcp_AltsContext *msg, struct grpc_gcp_RpcProtocolVersions* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(40, 72), struct grpc_gcp_RpcProtocolVersions*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 72), struct grpc_gcp_RpcProtocolVersions*) = value;
}
UPB_INLINE struct grpc_gcp_RpcProtocolVersions* grpc_gcp_AltsContext_mutable_peer_rpc_versions(grpc_gcp_AltsContext *msg, upb_arena *arena) {
struct grpc_gcp_RpcProtocolVersions* sub = (struct grpc_gcp_RpcProtocolVersions*)grpc_gcp_AltsContext_peer_rpc_versions(msg);
if (sub == NULL) {
- sub = (struct grpc_gcp_RpcProtocolVersions*)_upb_msg_new(&grpc_gcp_RpcProtocolVersions_msginit, arena);
+ sub = (struct grpc_gcp_RpcProtocolVersions*)_upb_msg_new(&grpc_gcp_RpcProtocolVersions_msginit, arena);
if (!sub) return NULL;
grpc_gcp_AltsContext_set_peer_rpc_versions(msg, sub);
}
return sub;
}
-UPB_INLINE void grpc_gcp_AltsContext_peer_attributes_clear(grpc_gcp_AltsContext *msg) { _upb_msg_map_clear(msg, UPB_SIZE(44, 80)); }
-UPB_INLINE bool grpc_gcp_AltsContext_peer_attributes_set(grpc_gcp_AltsContext *msg, upb_strview key, upb_strview val, upb_arena *a) { return _upb_msg_map_set(msg, UPB_SIZE(44, 80), &key, 0, &val, 0, a); }
-UPB_INLINE bool grpc_gcp_AltsContext_peer_attributes_delete(grpc_gcp_AltsContext *msg, upb_strview key) { return _upb_msg_map_delete(msg, UPB_SIZE(44, 80), &key, 0); }
-UPB_INLINE grpc_gcp_AltsContext_PeerAttributesEntry* grpc_gcp_AltsContext_peer_attributes_nextmutable(grpc_gcp_AltsContext *msg, size_t* iter) { return (grpc_gcp_AltsContext_PeerAttributesEntry*)_upb_msg_map_next(msg, UPB_SIZE(44, 80), iter); }
+UPB_INLINE void grpc_gcp_AltsContext_peer_attributes_clear(grpc_gcp_AltsContext *msg) { _upb_msg_map_clear(msg, UPB_SIZE(44, 80)); }
+UPB_INLINE bool grpc_gcp_AltsContext_peer_attributes_set(grpc_gcp_AltsContext *msg, upb_strview key, upb_strview val, upb_arena *a) { return _upb_msg_map_set(msg, UPB_SIZE(44, 80), &key, 0, &val, 0, a); }
+UPB_INLINE bool grpc_gcp_AltsContext_peer_attributes_delete(grpc_gcp_AltsContext *msg, upb_strview key) { return _upb_msg_map_delete(msg, UPB_SIZE(44, 80), &key, 0); }
+UPB_INLINE grpc_gcp_AltsContext_PeerAttributesEntry* grpc_gcp_AltsContext_peer_attributes_nextmutable(grpc_gcp_AltsContext *msg, size_t* iter) { return (grpc_gcp_AltsContext_PeerAttributesEntry*)_upb_msg_map_next(msg, UPB_SIZE(44, 80), iter); }
/* grpc.gcp.AltsContext.PeerAttributesEntry */
-UPB_INLINE upb_strview grpc_gcp_AltsContext_PeerAttributesEntry_key(const grpc_gcp_AltsContext_PeerAttributesEntry *msg) {
- upb_strview ret;
- _upb_msg_map_key(msg, &ret, 0);
- return ret;
+UPB_INLINE upb_strview grpc_gcp_AltsContext_PeerAttributesEntry_key(const grpc_gcp_AltsContext_PeerAttributesEntry *msg) {
+ upb_strview ret;
+ _upb_msg_map_key(msg, &ret, 0);
+ return ret;
}
-UPB_INLINE upb_strview grpc_gcp_AltsContext_PeerAttributesEntry_value(const grpc_gcp_AltsContext_PeerAttributesEntry *msg) {
- upb_strview ret;
- _upb_msg_map_value(msg, &ret, 0);
- return ret;
+UPB_INLINE upb_strview grpc_gcp_AltsContext_PeerAttributesEntry_value(const grpc_gcp_AltsContext_PeerAttributesEntry *msg) {
+ upb_strview ret;
+ _upb_msg_map_value(msg, &ret, 0);
+ return ret;
}
UPB_INLINE void grpc_gcp_AltsContext_PeerAttributesEntry_set_value(grpc_gcp_AltsContext_PeerAttributesEntry *msg, upb_strview value) {
- _upb_msg_map_set_value(msg, &value, 0);
+ _upb_msg_map_set_value(msg, &value, 0);
}
#ifdef __cplusplus
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c
index 7d483b5345c..036b66fdcec 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c
@@ -32,7 +32,7 @@ static const upb_msglayout *const grpc_gcp_Identity_submsgs[1] = {
static const upb_msglayout_field grpc_gcp_Identity__fields[3] = {
{1, UPB_SIZE(4, 8), UPB_SIZE(-13, -25), 0, 9, 1},
{2, UPB_SIZE(4, 8), UPB_SIZE(-13, -25), 0, 9, 1},
- {3, UPB_SIZE(0, 0), 0, 0, 11, _UPB_LABEL_MAP},
+ {3, UPB_SIZE(0, 0), 0, 0, 11, _UPB_LABEL_MAP},
};
const upb_msglayout grpc_gcp_Identity_msginit = {
@@ -58,23 +58,23 @@ static const upb_msglayout *const grpc_gcp_StartClientHandshakeReq_submsgs[5] =
&grpc_gcp_RpcProtocolVersions_msginit,
};
-static const upb_msglayout_field grpc_gcp_StartClientHandshakeReq__fields[10] = {
+static const upb_msglayout_field grpc_gcp_StartClientHandshakeReq__fields[10] = {
{1, UPB_SIZE(0, 0), 0, 0, 14, 1},
- {2, UPB_SIZE(36, 64), 0, 0, 9, 3},
- {3, UPB_SIZE(40, 72), 0, 0, 9, 3},
- {4, UPB_SIZE(44, 80), 0, 1, 11, 3},
- {5, UPB_SIZE(20, 32), 0, 1, 11, 1},
- {6, UPB_SIZE(24, 40), 0, 0, 11, 1},
- {7, UPB_SIZE(28, 48), 0, 0, 11, 1},
- {8, UPB_SIZE(12, 16), 0, 0, 9, 1},
- {9, UPB_SIZE(32, 56), 0, 2, 11, 1},
- {10, UPB_SIZE(8, 8), 0, 0, 13, 1},
+ {2, UPB_SIZE(36, 64), 0, 0, 9, 3},
+ {3, UPB_SIZE(40, 72), 0, 0, 9, 3},
+ {4, UPB_SIZE(44, 80), 0, 1, 11, 3},
+ {5, UPB_SIZE(20, 32), 0, 1, 11, 1},
+ {6, UPB_SIZE(24, 40), 0, 0, 11, 1},
+ {7, UPB_SIZE(28, 48), 0, 0, 11, 1},
+ {8, UPB_SIZE(12, 16), 0, 0, 9, 1},
+ {9, UPB_SIZE(32, 56), 0, 2, 11, 1},
+ {10, UPB_SIZE(8, 8), 0, 0, 13, 1},
};
const upb_msglayout grpc_gcp_StartClientHandshakeReq_msginit = {
&grpc_gcp_StartClientHandshakeReq_submsgs[0],
&grpc_gcp_StartClientHandshakeReq__fields[0],
- UPB_SIZE(48, 96), 10, false,
+ UPB_SIZE(48, 96), 10, false,
};
static const upb_msglayout *const grpc_gcp_ServerHandshakeParameters_submsgs[1] = {
@@ -98,20 +98,20 @@ static const upb_msglayout *const grpc_gcp_StartServerHandshakeReq_submsgs[4] =
&grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry_msginit,
};
-static const upb_msglayout_field grpc_gcp_StartServerHandshakeReq__fields[7] = {
- {1, UPB_SIZE(24, 48), 0, 0, 9, 3},
- {2, UPB_SIZE(28, 56), 0, 2, 11, _UPB_LABEL_MAP},
- {3, UPB_SIZE(4, 8), 0, 0, 12, 1},
- {4, UPB_SIZE(12, 24), 0, 0, 11, 1},
- {5, UPB_SIZE(16, 32), 0, 0, 11, 1},
- {6, UPB_SIZE(20, 40), 0, 1, 11, 1},
- {7, UPB_SIZE(0, 0), 0, 0, 13, 1},
+static const upb_msglayout_field grpc_gcp_StartServerHandshakeReq__fields[7] = {
+ {1, UPB_SIZE(24, 48), 0, 0, 9, 3},
+ {2, UPB_SIZE(28, 56), 0, 2, 11, _UPB_LABEL_MAP},
+ {3, UPB_SIZE(4, 8), 0, 0, 12, 1},
+ {4, UPB_SIZE(12, 24), 0, 0, 11, 1},
+ {5, UPB_SIZE(16, 32), 0, 0, 11, 1},
+ {6, UPB_SIZE(20, 40), 0, 1, 11, 1},
+ {7, UPB_SIZE(0, 0), 0, 0, 13, 1},
};
const upb_msglayout grpc_gcp_StartServerHandshakeReq_msginit = {
&grpc_gcp_StartServerHandshakeReq_submsgs[0],
&grpc_gcp_StartServerHandshakeReq__fields[0],
- UPB_SIZE(32, 64), 7, false,
+ UPB_SIZE(32, 64), 7, false,
};
static const upb_msglayout *const grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry_submsgs[1] = {
@@ -120,13 +120,13 @@ static const upb_msglayout *const grpc_gcp_StartServerHandshakeReq_HandshakePara
static const upb_msglayout_field grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry__fields[2] = {
{1, UPB_SIZE(0, 0), 0, 0, 5, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 11, 1},
+ {2, UPB_SIZE(8, 16), 0, 0, 11, 1},
};
const upb_msglayout grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry_msginit = {
&grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry_submsgs[0],
&grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry__fields[0],
- UPB_SIZE(16, 32), 2, false,
+ UPB_SIZE(16, 32), 2, false,
};
static const upb_msglayout_field grpc_gcp_NextHandshakeMessageReq__fields[1] = {
@@ -162,21 +162,21 @@ static const upb_msglayout *const grpc_gcp_HandshakerResult_submsgs[3] = {
&grpc_gcp_RpcProtocolVersions_msginit,
};
-static const upb_msglayout_field grpc_gcp_HandshakerResult__fields[8] = {
- {1, UPB_SIZE(8, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(16, 24), 0, 0, 9, 1},
- {3, UPB_SIZE(24, 40), 0, 0, 12, 1},
- {4, UPB_SIZE(32, 56), 0, 0, 11, 1},
- {5, UPB_SIZE(36, 64), 0, 0, 11, 1},
- {6, UPB_SIZE(4, 4), 0, 0, 8, 1},
- {7, UPB_SIZE(40, 72), 0, 1, 11, 1},
- {8, UPB_SIZE(0, 0), 0, 0, 13, 1},
+static const upb_msglayout_field grpc_gcp_HandshakerResult__fields[8] = {
+ {1, UPB_SIZE(8, 8), 0, 0, 9, 1},
+ {2, UPB_SIZE(16, 24), 0, 0, 9, 1},
+ {3, UPB_SIZE(24, 40), 0, 0, 12, 1},
+ {4, UPB_SIZE(32, 56), 0, 0, 11, 1},
+ {5, UPB_SIZE(36, 64), 0, 0, 11, 1},
+ {6, UPB_SIZE(4, 4), 0, 0, 8, 1},
+ {7, UPB_SIZE(40, 72), 0, 1, 11, 1},
+ {8, UPB_SIZE(0, 0), 0, 0, 13, 1},
};
const upb_msglayout grpc_gcp_HandshakerResult_msginit = {
&grpc_gcp_HandshakerResult_submsgs[0],
&grpc_gcp_HandshakerResult__fields[0],
- UPB_SIZE(48, 80), 8, false,
+ UPB_SIZE(48, 80), 8, false,
};
static const upb_msglayout_field grpc_gcp_HandshakerStatus__fields[2] = {
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h
index 2ecb684815f..323f3cdbc6a 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h
@@ -74,7 +74,7 @@ typedef enum {
/* grpc.gcp.Endpoint */
UPB_INLINE grpc_gcp_Endpoint *grpc_gcp_Endpoint_new(upb_arena *arena) {
- return (grpc_gcp_Endpoint *)_upb_msg_new(&grpc_gcp_Endpoint_msginit, arena);
+ return (grpc_gcp_Endpoint *)_upb_msg_new(&grpc_gcp_Endpoint_msginit, arena);
}
UPB_INLINE grpc_gcp_Endpoint *grpc_gcp_Endpoint_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -85,24 +85,24 @@ UPB_INLINE char *grpc_gcp_Endpoint_serialize(const grpc_gcp_Endpoint *msg, upb_a
return upb_encode(msg, &grpc_gcp_Endpoint_msginit, arena, len);
}
-UPB_INLINE upb_strview grpc_gcp_Endpoint_ip_address(const grpc_gcp_Endpoint *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 16), upb_strview); }
-UPB_INLINE int32_t grpc_gcp_Endpoint_port(const grpc_gcp_Endpoint *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); }
-UPB_INLINE int32_t grpc_gcp_Endpoint_protocol(const grpc_gcp_Endpoint *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
+UPB_INLINE upb_strview grpc_gcp_Endpoint_ip_address(const grpc_gcp_Endpoint *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 16), upb_strview); }
+UPB_INLINE int32_t grpc_gcp_Endpoint_port(const grpc_gcp_Endpoint *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); }
+UPB_INLINE int32_t grpc_gcp_Endpoint_protocol(const grpc_gcp_Endpoint *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
UPB_INLINE void grpc_gcp_Endpoint_set_ip_address(grpc_gcp_Endpoint *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(12, 16), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 16), upb_strview) = value;
}
UPB_INLINE void grpc_gcp_Endpoint_set_port(grpc_gcp_Endpoint *msg, int32_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
}
UPB_INLINE void grpc_gcp_Endpoint_set_protocol(grpc_gcp_Endpoint *msg, int32_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
}
/* grpc.gcp.Identity */
UPB_INLINE grpc_gcp_Identity *grpc_gcp_Identity_new(upb_arena *arena) {
- return (grpc_gcp_Identity *)_upb_msg_new(&grpc_gcp_Identity_msginit, arena);
+ return (grpc_gcp_Identity *)_upb_msg_new(&grpc_gcp_Identity_msginit, arena);
}
UPB_INLINE grpc_gcp_Identity *grpc_gcp_Identity_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -118,16 +118,16 @@ typedef enum {
grpc_gcp_Identity_identity_oneof_hostname = 2,
grpc_gcp_Identity_identity_oneof_NOT_SET = 0
} grpc_gcp_Identity_identity_oneof_oneofcases;
-UPB_INLINE grpc_gcp_Identity_identity_oneof_oneofcases grpc_gcp_Identity_identity_oneof_case(const grpc_gcp_Identity* msg) { return (grpc_gcp_Identity_identity_oneof_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(12, 24), int32_t); }
+UPB_INLINE grpc_gcp_Identity_identity_oneof_oneofcases grpc_gcp_Identity_identity_oneof_case(const grpc_gcp_Identity* msg) { return (grpc_gcp_Identity_identity_oneof_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(12, 24), int32_t); }
-UPB_INLINE bool grpc_gcp_Identity_has_service_account(const grpc_gcp_Identity *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 1; }
+UPB_INLINE bool grpc_gcp_Identity_has_service_account(const grpc_gcp_Identity *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 1; }
UPB_INLINE upb_strview grpc_gcp_Identity_service_account(const grpc_gcp_Identity *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(4, 8), UPB_SIZE(12, 24), 1, upb_strview_make("", strlen(""))); }
-UPB_INLINE bool grpc_gcp_Identity_has_hostname(const grpc_gcp_Identity *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 2; }
+UPB_INLINE bool grpc_gcp_Identity_has_hostname(const grpc_gcp_Identity *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 2; }
UPB_INLINE upb_strview grpc_gcp_Identity_hostname(const grpc_gcp_Identity *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(4, 8), UPB_SIZE(12, 24), 2, upb_strview_make("", strlen(""))); }
-UPB_INLINE bool grpc_gcp_Identity_has_attributes(const grpc_gcp_Identity *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE size_t grpc_gcp_Identity_attributes_size(const grpc_gcp_Identity *msg) {return _upb_msg_map_size(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE bool grpc_gcp_Identity_attributes_get(const grpc_gcp_Identity *msg, upb_strview key, upb_strview *val) { return _upb_msg_map_get(msg, UPB_SIZE(0, 0), &key, 0, val, 0); }
-UPB_INLINE const grpc_gcp_Identity_AttributesEntry* grpc_gcp_Identity_attributes_next(const grpc_gcp_Identity *msg, size_t* iter) { return (const grpc_gcp_Identity_AttributesEntry*)_upb_msg_map_next(msg, UPB_SIZE(0, 0), iter); }
+UPB_INLINE bool grpc_gcp_Identity_has_attributes(const grpc_gcp_Identity *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE size_t grpc_gcp_Identity_attributes_size(const grpc_gcp_Identity *msg) {return _upb_msg_map_size(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE bool grpc_gcp_Identity_attributes_get(const grpc_gcp_Identity *msg, upb_strview key, upb_strview *val) { return _upb_msg_map_get(msg, UPB_SIZE(0, 0), &key, 0, val, 0); }
+UPB_INLINE const grpc_gcp_Identity_AttributesEntry* grpc_gcp_Identity_attributes_next(const grpc_gcp_Identity *msg, size_t* iter) { return (const grpc_gcp_Identity_AttributesEntry*)_upb_msg_map_next(msg, UPB_SIZE(0, 0), iter); }
UPB_INLINE void grpc_gcp_Identity_set_service_account(grpc_gcp_Identity *msg, upb_strview value) {
UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(4, 8), value, UPB_SIZE(12, 24), 1);
@@ -135,32 +135,32 @@ UPB_INLINE void grpc_gcp_Identity_set_service_account(grpc_gcp_Identity *msg, up
UPB_INLINE void grpc_gcp_Identity_set_hostname(grpc_gcp_Identity *msg, upb_strview value) {
UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(4, 8), value, UPB_SIZE(12, 24), 2);
}
-UPB_INLINE void grpc_gcp_Identity_attributes_clear(grpc_gcp_Identity *msg) { _upb_msg_map_clear(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE bool grpc_gcp_Identity_attributes_set(grpc_gcp_Identity *msg, upb_strview key, upb_strview val, upb_arena *a) { return _upb_msg_map_set(msg, UPB_SIZE(0, 0), &key, 0, &val, 0, a); }
-UPB_INLINE bool grpc_gcp_Identity_attributes_delete(grpc_gcp_Identity *msg, upb_strview key) { return _upb_msg_map_delete(msg, UPB_SIZE(0, 0), &key, 0); }
-UPB_INLINE grpc_gcp_Identity_AttributesEntry* grpc_gcp_Identity_attributes_nextmutable(grpc_gcp_Identity *msg, size_t* iter) { return (grpc_gcp_Identity_AttributesEntry*)_upb_msg_map_next(msg, UPB_SIZE(0, 0), iter); }
+UPB_INLINE void grpc_gcp_Identity_attributes_clear(grpc_gcp_Identity *msg) { _upb_msg_map_clear(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE bool grpc_gcp_Identity_attributes_set(grpc_gcp_Identity *msg, upb_strview key, upb_strview val, upb_arena *a) { return _upb_msg_map_set(msg, UPB_SIZE(0, 0), &key, 0, &val, 0, a); }
+UPB_INLINE bool grpc_gcp_Identity_attributes_delete(grpc_gcp_Identity *msg, upb_strview key) { return _upb_msg_map_delete(msg, UPB_SIZE(0, 0), &key, 0); }
+UPB_INLINE grpc_gcp_Identity_AttributesEntry* grpc_gcp_Identity_attributes_nextmutable(grpc_gcp_Identity *msg, size_t* iter) { return (grpc_gcp_Identity_AttributesEntry*)_upb_msg_map_next(msg, UPB_SIZE(0, 0), iter); }
/* grpc.gcp.Identity.AttributesEntry */
-UPB_INLINE upb_strview grpc_gcp_Identity_AttributesEntry_key(const grpc_gcp_Identity_AttributesEntry *msg) {
- upb_strview ret;
- _upb_msg_map_key(msg, &ret, 0);
- return ret;
+UPB_INLINE upb_strview grpc_gcp_Identity_AttributesEntry_key(const grpc_gcp_Identity_AttributesEntry *msg) {
+ upb_strview ret;
+ _upb_msg_map_key(msg, &ret, 0);
+ return ret;
}
-UPB_INLINE upb_strview grpc_gcp_Identity_AttributesEntry_value(const grpc_gcp_Identity_AttributesEntry *msg) {
- upb_strview ret;
- _upb_msg_map_value(msg, &ret, 0);
- return ret;
+UPB_INLINE upb_strview grpc_gcp_Identity_AttributesEntry_value(const grpc_gcp_Identity_AttributesEntry *msg) {
+ upb_strview ret;
+ _upb_msg_map_value(msg, &ret, 0);
+ return ret;
}
UPB_INLINE void grpc_gcp_Identity_AttributesEntry_set_value(grpc_gcp_Identity_AttributesEntry *msg, upb_strview value) {
- _upb_msg_map_set_value(msg, &value, 0);
+ _upb_msg_map_set_value(msg, &value, 0);
}
/* grpc.gcp.StartClientHandshakeReq */
UPB_INLINE grpc_gcp_StartClientHandshakeReq *grpc_gcp_StartClientHandshakeReq_new(upb_arena *arena) {
- return (grpc_gcp_StartClientHandshakeReq *)_upb_msg_new(&grpc_gcp_StartClientHandshakeReq_msginit, arena);
+ return (grpc_gcp_StartClientHandshakeReq *)_upb_msg_new(&grpc_gcp_StartClientHandshakeReq_msginit, arena);
}
UPB_INLINE grpc_gcp_StartClientHandshakeReq *grpc_gcp_StartClientHandshakeReq_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -171,117 +171,117 @@ UPB_INLINE char *grpc_gcp_StartClientHandshakeReq_serialize(const grpc_gcp_Start
return upb_encode(msg, &grpc_gcp_StartClientHandshakeReq_msginit, arena, len);
}
-UPB_INLINE int32_t grpc_gcp_StartClientHandshakeReq_handshake_security_protocol(const grpc_gcp_StartClientHandshakeReq *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
-UPB_INLINE upb_strview const* grpc_gcp_StartClientHandshakeReq_application_protocols(const grpc_gcp_StartClientHandshakeReq *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(36, 64), len); }
-UPB_INLINE upb_strview const* grpc_gcp_StartClientHandshakeReq_record_protocols(const grpc_gcp_StartClientHandshakeReq *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(40, 72), len); }
-UPB_INLINE bool grpc_gcp_StartClientHandshakeReq_has_target_identities(const grpc_gcp_StartClientHandshakeReq *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(44, 80)); }
-UPB_INLINE const grpc_gcp_Identity* const* grpc_gcp_StartClientHandshakeReq_target_identities(const grpc_gcp_StartClientHandshakeReq *msg, size_t *len) { return (const grpc_gcp_Identity* const*)_upb_array_accessor(msg, UPB_SIZE(44, 80), len); }
-UPB_INLINE bool grpc_gcp_StartClientHandshakeReq_has_local_identity(const grpc_gcp_StartClientHandshakeReq *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 32)); }
-UPB_INLINE const grpc_gcp_Identity* grpc_gcp_StartClientHandshakeReq_local_identity(const grpc_gcp_StartClientHandshakeReq *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const grpc_gcp_Identity*); }
-UPB_INLINE bool grpc_gcp_StartClientHandshakeReq_has_local_endpoint(const grpc_gcp_StartClientHandshakeReq *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 40)); }
-UPB_INLINE const grpc_gcp_Endpoint* grpc_gcp_StartClientHandshakeReq_local_endpoint(const grpc_gcp_StartClientHandshakeReq *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const grpc_gcp_Endpoint*); }
-UPB_INLINE bool grpc_gcp_StartClientHandshakeReq_has_remote_endpoint(const grpc_gcp_StartClientHandshakeReq *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 48)); }
-UPB_INLINE const grpc_gcp_Endpoint* grpc_gcp_StartClientHandshakeReq_remote_endpoint(const grpc_gcp_StartClientHandshakeReq *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 48), const grpc_gcp_Endpoint*); }
-UPB_INLINE upb_strview grpc_gcp_StartClientHandshakeReq_target_name(const grpc_gcp_StartClientHandshakeReq *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 16), upb_strview); }
-UPB_INLINE bool grpc_gcp_StartClientHandshakeReq_has_rpc_versions(const grpc_gcp_StartClientHandshakeReq *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(32, 56)); }
-UPB_INLINE const struct grpc_gcp_RpcProtocolVersions* grpc_gcp_StartClientHandshakeReq_rpc_versions(const grpc_gcp_StartClientHandshakeReq *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 56), const struct grpc_gcp_RpcProtocolVersions*); }
-UPB_INLINE uint32_t grpc_gcp_StartClientHandshakeReq_max_frame_size(const grpc_gcp_StartClientHandshakeReq *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint32_t); }
+UPB_INLINE int32_t grpc_gcp_StartClientHandshakeReq_handshake_security_protocol(const grpc_gcp_StartClientHandshakeReq *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
+UPB_INLINE upb_strview const* grpc_gcp_StartClientHandshakeReq_application_protocols(const grpc_gcp_StartClientHandshakeReq *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(36, 64), len); }
+UPB_INLINE upb_strview const* grpc_gcp_StartClientHandshakeReq_record_protocols(const grpc_gcp_StartClientHandshakeReq *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(40, 72), len); }
+UPB_INLINE bool grpc_gcp_StartClientHandshakeReq_has_target_identities(const grpc_gcp_StartClientHandshakeReq *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(44, 80)); }
+UPB_INLINE const grpc_gcp_Identity* const* grpc_gcp_StartClientHandshakeReq_target_identities(const grpc_gcp_StartClientHandshakeReq *msg, size_t *len) { return (const grpc_gcp_Identity* const*)_upb_array_accessor(msg, UPB_SIZE(44, 80), len); }
+UPB_INLINE bool grpc_gcp_StartClientHandshakeReq_has_local_identity(const grpc_gcp_StartClientHandshakeReq *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 32)); }
+UPB_INLINE const grpc_gcp_Identity* grpc_gcp_StartClientHandshakeReq_local_identity(const grpc_gcp_StartClientHandshakeReq *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const grpc_gcp_Identity*); }
+UPB_INLINE bool grpc_gcp_StartClientHandshakeReq_has_local_endpoint(const grpc_gcp_StartClientHandshakeReq *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 40)); }
+UPB_INLINE const grpc_gcp_Endpoint* grpc_gcp_StartClientHandshakeReq_local_endpoint(const grpc_gcp_StartClientHandshakeReq *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const grpc_gcp_Endpoint*); }
+UPB_INLINE bool grpc_gcp_StartClientHandshakeReq_has_remote_endpoint(const grpc_gcp_StartClientHandshakeReq *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 48)); }
+UPB_INLINE const grpc_gcp_Endpoint* grpc_gcp_StartClientHandshakeReq_remote_endpoint(const grpc_gcp_StartClientHandshakeReq *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 48), const grpc_gcp_Endpoint*); }
+UPB_INLINE upb_strview grpc_gcp_StartClientHandshakeReq_target_name(const grpc_gcp_StartClientHandshakeReq *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 16), upb_strview); }
+UPB_INLINE bool grpc_gcp_StartClientHandshakeReq_has_rpc_versions(const grpc_gcp_StartClientHandshakeReq *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(32, 56)); }
+UPB_INLINE const struct grpc_gcp_RpcProtocolVersions* grpc_gcp_StartClientHandshakeReq_rpc_versions(const grpc_gcp_StartClientHandshakeReq *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 56), const struct grpc_gcp_RpcProtocolVersions*); }
+UPB_INLINE uint32_t grpc_gcp_StartClientHandshakeReq_max_frame_size(const grpc_gcp_StartClientHandshakeReq *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint32_t); }
UPB_INLINE void grpc_gcp_StartClientHandshakeReq_set_handshake_security_protocol(grpc_gcp_StartClientHandshakeReq *msg, int32_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
}
UPB_INLINE upb_strview* grpc_gcp_StartClientHandshakeReq_mutable_application_protocols(grpc_gcp_StartClientHandshakeReq *msg, size_t *len) {
- return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(36, 64), len);
+ return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(36, 64), len);
}
UPB_INLINE upb_strview* grpc_gcp_StartClientHandshakeReq_resize_application_protocols(grpc_gcp_StartClientHandshakeReq *msg, size_t len, upb_arena *arena) {
- return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(36, 64), len, UPB_TYPE_STRING, arena);
+ return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(36, 64), len, UPB_TYPE_STRING, arena);
}
UPB_INLINE bool grpc_gcp_StartClientHandshakeReq_add_application_protocols(grpc_gcp_StartClientHandshakeReq *msg, upb_strview val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(36, 64), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
- arena);
+ return _upb_array_append_accessor(msg, UPB_SIZE(36, 64), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
+ arena);
}
UPB_INLINE upb_strview* grpc_gcp_StartClientHandshakeReq_mutable_record_protocols(grpc_gcp_StartClientHandshakeReq *msg, size_t *len) {
- return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(40, 72), len);
+ return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(40, 72), len);
}
UPB_INLINE upb_strview* grpc_gcp_StartClientHandshakeReq_resize_record_protocols(grpc_gcp_StartClientHandshakeReq *msg, size_t len, upb_arena *arena) {
- return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(40, 72), len, UPB_TYPE_STRING, arena);
+ return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(40, 72), len, UPB_TYPE_STRING, arena);
}
UPB_INLINE bool grpc_gcp_StartClientHandshakeReq_add_record_protocols(grpc_gcp_StartClientHandshakeReq *msg, upb_strview val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(40, 72), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
- arena);
+ return _upb_array_append_accessor(msg, UPB_SIZE(40, 72), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
+ arena);
}
UPB_INLINE grpc_gcp_Identity** grpc_gcp_StartClientHandshakeReq_mutable_target_identities(grpc_gcp_StartClientHandshakeReq *msg, size_t *len) {
- return (grpc_gcp_Identity**)_upb_array_mutable_accessor(msg, UPB_SIZE(44, 80), len);
+ return (grpc_gcp_Identity**)_upb_array_mutable_accessor(msg, UPB_SIZE(44, 80), len);
}
UPB_INLINE grpc_gcp_Identity** grpc_gcp_StartClientHandshakeReq_resize_target_identities(grpc_gcp_StartClientHandshakeReq *msg, size_t len, upb_arena *arena) {
- return (grpc_gcp_Identity**)_upb_array_resize_accessor(msg, UPB_SIZE(44, 80), len, UPB_TYPE_MESSAGE, arena);
+ return (grpc_gcp_Identity**)_upb_array_resize_accessor(msg, UPB_SIZE(44, 80), len, UPB_TYPE_MESSAGE, arena);
}
UPB_INLINE struct grpc_gcp_Identity* grpc_gcp_StartClientHandshakeReq_add_target_identities(grpc_gcp_StartClientHandshakeReq *msg, upb_arena *arena) {
- struct grpc_gcp_Identity* sub = (struct grpc_gcp_Identity*)_upb_msg_new(&grpc_gcp_Identity_msginit, arena);
+ struct grpc_gcp_Identity* sub = (struct grpc_gcp_Identity*)_upb_msg_new(&grpc_gcp_Identity_msginit, arena);
bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(44, 80), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ msg, UPB_SIZE(44, 80), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
if (!ok) return NULL;
return sub;
}
UPB_INLINE void grpc_gcp_StartClientHandshakeReq_set_local_identity(grpc_gcp_StartClientHandshakeReq *msg, grpc_gcp_Identity* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(20, 32), grpc_gcp_Identity*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 32), grpc_gcp_Identity*) = value;
}
UPB_INLINE struct grpc_gcp_Identity* grpc_gcp_StartClientHandshakeReq_mutable_local_identity(grpc_gcp_StartClientHandshakeReq *msg, upb_arena *arena) {
struct grpc_gcp_Identity* sub = (struct grpc_gcp_Identity*)grpc_gcp_StartClientHandshakeReq_local_identity(msg);
if (sub == NULL) {
- sub = (struct grpc_gcp_Identity*)_upb_msg_new(&grpc_gcp_Identity_msginit, arena);
+ sub = (struct grpc_gcp_Identity*)_upb_msg_new(&grpc_gcp_Identity_msginit, arena);
if (!sub) return NULL;
grpc_gcp_StartClientHandshakeReq_set_local_identity(msg, sub);
}
return sub;
}
UPB_INLINE void grpc_gcp_StartClientHandshakeReq_set_local_endpoint(grpc_gcp_StartClientHandshakeReq *msg, grpc_gcp_Endpoint* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(24, 40), grpc_gcp_Endpoint*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 40), grpc_gcp_Endpoint*) = value;
}
UPB_INLINE struct grpc_gcp_Endpoint* grpc_gcp_StartClientHandshakeReq_mutable_local_endpoint(grpc_gcp_StartClientHandshakeReq *msg, upb_arena *arena) {
struct grpc_gcp_Endpoint* sub = (struct grpc_gcp_Endpoint*)grpc_gcp_StartClientHandshakeReq_local_endpoint(msg);
if (sub == NULL) {
- sub = (struct grpc_gcp_Endpoint*)_upb_msg_new(&grpc_gcp_Endpoint_msginit, arena);
+ sub = (struct grpc_gcp_Endpoint*)_upb_msg_new(&grpc_gcp_Endpoint_msginit, arena);
if (!sub) return NULL;
grpc_gcp_StartClientHandshakeReq_set_local_endpoint(msg, sub);
}
return sub;
}
UPB_INLINE void grpc_gcp_StartClientHandshakeReq_set_remote_endpoint(grpc_gcp_StartClientHandshakeReq *msg, grpc_gcp_Endpoint* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(28, 48), grpc_gcp_Endpoint*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 48), grpc_gcp_Endpoint*) = value;
}
UPB_INLINE struct grpc_gcp_Endpoint* grpc_gcp_StartClientHandshakeReq_mutable_remote_endpoint(grpc_gcp_StartClientHandshakeReq *msg, upb_arena *arena) {
struct grpc_gcp_Endpoint* sub = (struct grpc_gcp_Endpoint*)grpc_gcp_StartClientHandshakeReq_remote_endpoint(msg);
if (sub == NULL) {
- sub = (struct grpc_gcp_Endpoint*)_upb_msg_new(&grpc_gcp_Endpoint_msginit, arena);
+ sub = (struct grpc_gcp_Endpoint*)_upb_msg_new(&grpc_gcp_Endpoint_msginit, arena);
if (!sub) return NULL;
grpc_gcp_StartClientHandshakeReq_set_remote_endpoint(msg, sub);
}
return sub;
}
UPB_INLINE void grpc_gcp_StartClientHandshakeReq_set_target_name(grpc_gcp_StartClientHandshakeReq *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(12, 16), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 16), upb_strview) = value;
}
UPB_INLINE void grpc_gcp_StartClientHandshakeReq_set_rpc_versions(grpc_gcp_StartClientHandshakeReq *msg, struct grpc_gcp_RpcProtocolVersions* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(32, 56), struct grpc_gcp_RpcProtocolVersions*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 56), struct grpc_gcp_RpcProtocolVersions*) = value;
}
UPB_INLINE struct grpc_gcp_RpcProtocolVersions* grpc_gcp_StartClientHandshakeReq_mutable_rpc_versions(grpc_gcp_StartClientHandshakeReq *msg, upb_arena *arena) {
struct grpc_gcp_RpcProtocolVersions* sub = (struct grpc_gcp_RpcProtocolVersions*)grpc_gcp_StartClientHandshakeReq_rpc_versions(msg);
if (sub == NULL) {
- sub = (struct grpc_gcp_RpcProtocolVersions*)_upb_msg_new(&grpc_gcp_RpcProtocolVersions_msginit, arena);
+ sub = (struct grpc_gcp_RpcProtocolVersions*)_upb_msg_new(&grpc_gcp_RpcProtocolVersions_msginit, arena);
if (!sub) return NULL;
grpc_gcp_StartClientHandshakeReq_set_rpc_versions(msg, sub);
}
return sub;
}
-UPB_INLINE void grpc_gcp_StartClientHandshakeReq_set_max_frame_size(grpc_gcp_StartClientHandshakeReq *msg, uint32_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint32_t) = value;
-}
+UPB_INLINE void grpc_gcp_StartClientHandshakeReq_set_max_frame_size(grpc_gcp_StartClientHandshakeReq *msg, uint32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint32_t) = value;
+}
/* grpc.gcp.ServerHandshakeParameters */
UPB_INLINE grpc_gcp_ServerHandshakeParameters *grpc_gcp_ServerHandshakeParameters_new(upb_arena *arena) {
- return (grpc_gcp_ServerHandshakeParameters *)_upb_msg_new(&grpc_gcp_ServerHandshakeParameters_msginit, arena);
+ return (grpc_gcp_ServerHandshakeParameters *)_upb_msg_new(&grpc_gcp_ServerHandshakeParameters_msginit, arena);
}
UPB_INLINE grpc_gcp_ServerHandshakeParameters *grpc_gcp_ServerHandshakeParameters_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -293,27 +293,27 @@ UPB_INLINE char *grpc_gcp_ServerHandshakeParameters_serialize(const grpc_gcp_Ser
}
UPB_INLINE upb_strview const* grpc_gcp_ServerHandshakeParameters_record_protocols(const grpc_gcp_ServerHandshakeParameters *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
-UPB_INLINE bool grpc_gcp_ServerHandshakeParameters_has_local_identities(const grpc_gcp_ServerHandshakeParameters *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
+UPB_INLINE bool grpc_gcp_ServerHandshakeParameters_has_local_identities(const grpc_gcp_ServerHandshakeParameters *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
UPB_INLINE const grpc_gcp_Identity* const* grpc_gcp_ServerHandshakeParameters_local_identities(const grpc_gcp_ServerHandshakeParameters *msg, size_t *len) { return (const grpc_gcp_Identity* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len); }
UPB_INLINE upb_strview* grpc_gcp_ServerHandshakeParameters_mutable_record_protocols(grpc_gcp_ServerHandshakeParameters *msg, size_t *len) {
return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
}
UPB_INLINE upb_strview* grpc_gcp_ServerHandshakeParameters_resize_record_protocols(grpc_gcp_ServerHandshakeParameters *msg, size_t len, upb_arena *arena) {
- return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(0, 0), len, UPB_TYPE_STRING, arena);
+ return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(0, 0), len, UPB_TYPE_STRING, arena);
}
UPB_INLINE bool grpc_gcp_ServerHandshakeParameters_add_record_protocols(grpc_gcp_ServerHandshakeParameters *msg, upb_strview val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(0, 0), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
- arena);
+ return _upb_array_append_accessor(msg, UPB_SIZE(0, 0), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
+ arena);
}
UPB_INLINE grpc_gcp_Identity** grpc_gcp_ServerHandshakeParameters_mutable_local_identities(grpc_gcp_ServerHandshakeParameters *msg, size_t *len) {
return (grpc_gcp_Identity**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len);
}
UPB_INLINE grpc_gcp_Identity** grpc_gcp_ServerHandshakeParameters_resize_local_identities(grpc_gcp_ServerHandshakeParameters *msg, size_t len, upb_arena *arena) {
- return (grpc_gcp_Identity**)_upb_array_resize_accessor(msg, UPB_SIZE(4, 8), len, UPB_TYPE_MESSAGE, arena);
+ return (grpc_gcp_Identity**)_upb_array_resize_accessor(msg, UPB_SIZE(4, 8), len, UPB_TYPE_MESSAGE, arena);
}
UPB_INLINE struct grpc_gcp_Identity* grpc_gcp_ServerHandshakeParameters_add_local_identities(grpc_gcp_ServerHandshakeParameters *msg, upb_arena *arena) {
- struct grpc_gcp_Identity* sub = (struct grpc_gcp_Identity*)_upb_msg_new(&grpc_gcp_Identity_msginit, arena);
+ struct grpc_gcp_Identity* sub = (struct grpc_gcp_Identity*)_upb_msg_new(&grpc_gcp_Identity_msginit, arena);
bool ok = _upb_array_append_accessor(
msg, UPB_SIZE(4, 8), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
if (!ok) return NULL;
@@ -323,7 +323,7 @@ UPB_INLINE struct grpc_gcp_Identity* grpc_gcp_ServerHandshakeParameters_add_loca
/* grpc.gcp.StartServerHandshakeReq */
UPB_INLINE grpc_gcp_StartServerHandshakeReq *grpc_gcp_StartServerHandshakeReq_new(upb_arena *arena) {
- return (grpc_gcp_StartServerHandshakeReq *)_upb_msg_new(&grpc_gcp_StartServerHandshakeReq_msginit, arena);
+ return (grpc_gcp_StartServerHandshakeReq *)_upb_msg_new(&grpc_gcp_StartServerHandshakeReq_msginit, arena);
}
UPB_INLINE grpc_gcp_StartServerHandshakeReq *grpc_gcp_StartServerHandshakeReq_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -334,99 +334,99 @@ UPB_INLINE char *grpc_gcp_StartServerHandshakeReq_serialize(const grpc_gcp_Start
return upb_encode(msg, &grpc_gcp_StartServerHandshakeReq_msginit, arena, len);
}
-UPB_INLINE upb_strview const* grpc_gcp_StartServerHandshakeReq_application_protocols(const grpc_gcp_StartServerHandshakeReq *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(24, 48), len); }
-UPB_INLINE bool grpc_gcp_StartServerHandshakeReq_has_handshake_parameters(const grpc_gcp_StartServerHandshakeReq *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 56)); }
-UPB_INLINE size_t grpc_gcp_StartServerHandshakeReq_handshake_parameters_size(const grpc_gcp_StartServerHandshakeReq *msg) {return _upb_msg_map_size(msg, UPB_SIZE(28, 56)); }
-UPB_INLINE bool grpc_gcp_StartServerHandshakeReq_handshake_parameters_get(const grpc_gcp_StartServerHandshakeReq *msg, int32_t key, grpc_gcp_ServerHandshakeParameters* *val) { return _upb_msg_map_get(msg, UPB_SIZE(28, 56), &key, sizeof(key), val, sizeof(*val)); }
-UPB_INLINE const grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry* grpc_gcp_StartServerHandshakeReq_handshake_parameters_next(const grpc_gcp_StartServerHandshakeReq *msg, size_t* iter) { return (const grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry*)_upb_msg_map_next(msg, UPB_SIZE(28, 56), iter); }
-UPB_INLINE upb_strview grpc_gcp_StartServerHandshakeReq_in_bytes(const grpc_gcp_StartServerHandshakeReq *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
-UPB_INLINE bool grpc_gcp_StartServerHandshakeReq_has_local_endpoint(const grpc_gcp_StartServerHandshakeReq *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
-UPB_INLINE const grpc_gcp_Endpoint* grpc_gcp_StartServerHandshakeReq_local_endpoint(const grpc_gcp_StartServerHandshakeReq *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const grpc_gcp_Endpoint*); }
-UPB_INLINE bool grpc_gcp_StartServerHandshakeReq_has_remote_endpoint(const grpc_gcp_StartServerHandshakeReq *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); }
-UPB_INLINE const grpc_gcp_Endpoint* grpc_gcp_StartServerHandshakeReq_remote_endpoint(const grpc_gcp_StartServerHandshakeReq *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const grpc_gcp_Endpoint*); }
-UPB_INLINE bool grpc_gcp_StartServerHandshakeReq_has_rpc_versions(const grpc_gcp_StartServerHandshakeReq *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 40)); }
-UPB_INLINE const struct grpc_gcp_RpcProtocolVersions* grpc_gcp_StartServerHandshakeReq_rpc_versions(const grpc_gcp_StartServerHandshakeReq *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const struct grpc_gcp_RpcProtocolVersions*); }
-UPB_INLINE uint32_t grpc_gcp_StartServerHandshakeReq_max_frame_size(const grpc_gcp_StartServerHandshakeReq *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t); }
+UPB_INLINE upb_strview const* grpc_gcp_StartServerHandshakeReq_application_protocols(const grpc_gcp_StartServerHandshakeReq *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(24, 48), len); }
+UPB_INLINE bool grpc_gcp_StartServerHandshakeReq_has_handshake_parameters(const grpc_gcp_StartServerHandshakeReq *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 56)); }
+UPB_INLINE size_t grpc_gcp_StartServerHandshakeReq_handshake_parameters_size(const grpc_gcp_StartServerHandshakeReq *msg) {return _upb_msg_map_size(msg, UPB_SIZE(28, 56)); }
+UPB_INLINE bool grpc_gcp_StartServerHandshakeReq_handshake_parameters_get(const grpc_gcp_StartServerHandshakeReq *msg, int32_t key, grpc_gcp_ServerHandshakeParameters* *val) { return _upb_msg_map_get(msg, UPB_SIZE(28, 56), &key, sizeof(key), val, sizeof(*val)); }
+UPB_INLINE const grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry* grpc_gcp_StartServerHandshakeReq_handshake_parameters_next(const grpc_gcp_StartServerHandshakeReq *msg, size_t* iter) { return (const grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry*)_upb_msg_map_next(msg, UPB_SIZE(28, 56), iter); }
+UPB_INLINE upb_strview grpc_gcp_StartServerHandshakeReq_in_bytes(const grpc_gcp_StartServerHandshakeReq *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
+UPB_INLINE bool grpc_gcp_StartServerHandshakeReq_has_local_endpoint(const grpc_gcp_StartServerHandshakeReq *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
+UPB_INLINE const grpc_gcp_Endpoint* grpc_gcp_StartServerHandshakeReq_local_endpoint(const grpc_gcp_StartServerHandshakeReq *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const grpc_gcp_Endpoint*); }
+UPB_INLINE bool grpc_gcp_StartServerHandshakeReq_has_remote_endpoint(const grpc_gcp_StartServerHandshakeReq *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); }
+UPB_INLINE const grpc_gcp_Endpoint* grpc_gcp_StartServerHandshakeReq_remote_endpoint(const grpc_gcp_StartServerHandshakeReq *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const grpc_gcp_Endpoint*); }
+UPB_INLINE bool grpc_gcp_StartServerHandshakeReq_has_rpc_versions(const grpc_gcp_StartServerHandshakeReq *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 40)); }
+UPB_INLINE const struct grpc_gcp_RpcProtocolVersions* grpc_gcp_StartServerHandshakeReq_rpc_versions(const grpc_gcp_StartServerHandshakeReq *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const struct grpc_gcp_RpcProtocolVersions*); }
+UPB_INLINE uint32_t grpc_gcp_StartServerHandshakeReq_max_frame_size(const grpc_gcp_StartServerHandshakeReq *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t); }
UPB_INLINE upb_strview* grpc_gcp_StartServerHandshakeReq_mutable_application_protocols(grpc_gcp_StartServerHandshakeReq *msg, size_t *len) {
- return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 48), len);
+ return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 48), len);
}
UPB_INLINE upb_strview* grpc_gcp_StartServerHandshakeReq_resize_application_protocols(grpc_gcp_StartServerHandshakeReq *msg, size_t len, upb_arena *arena) {
- return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(24, 48), len, UPB_TYPE_STRING, arena);
+ return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(24, 48), len, UPB_TYPE_STRING, arena);
}
UPB_INLINE bool grpc_gcp_StartServerHandshakeReq_add_application_protocols(grpc_gcp_StartServerHandshakeReq *msg, upb_strview val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(24, 48), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
- arena);
+ return _upb_array_append_accessor(msg, UPB_SIZE(24, 48), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
+ arena);
}
-UPB_INLINE void grpc_gcp_StartServerHandshakeReq_handshake_parameters_clear(grpc_gcp_StartServerHandshakeReq *msg) { _upb_msg_map_clear(msg, UPB_SIZE(28, 56)); }
-UPB_INLINE bool grpc_gcp_StartServerHandshakeReq_handshake_parameters_set(grpc_gcp_StartServerHandshakeReq *msg, int32_t key, grpc_gcp_ServerHandshakeParameters* val, upb_arena *a) { return _upb_msg_map_set(msg, UPB_SIZE(28, 56), &key, sizeof(key), &val, sizeof(val), a); }
-UPB_INLINE bool grpc_gcp_StartServerHandshakeReq_handshake_parameters_delete(grpc_gcp_StartServerHandshakeReq *msg, int32_t key) { return _upb_msg_map_delete(msg, UPB_SIZE(28, 56), &key, sizeof(key)); }
-UPB_INLINE grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry* grpc_gcp_StartServerHandshakeReq_handshake_parameters_nextmutable(grpc_gcp_StartServerHandshakeReq *msg, size_t* iter) { return (grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry*)_upb_msg_map_next(msg, UPB_SIZE(28, 56), iter); }
+UPB_INLINE void grpc_gcp_StartServerHandshakeReq_handshake_parameters_clear(grpc_gcp_StartServerHandshakeReq *msg) { _upb_msg_map_clear(msg, UPB_SIZE(28, 56)); }
+UPB_INLINE bool grpc_gcp_StartServerHandshakeReq_handshake_parameters_set(grpc_gcp_StartServerHandshakeReq *msg, int32_t key, grpc_gcp_ServerHandshakeParameters* val, upb_arena *a) { return _upb_msg_map_set(msg, UPB_SIZE(28, 56), &key, sizeof(key), &val, sizeof(val), a); }
+UPB_INLINE bool grpc_gcp_StartServerHandshakeReq_handshake_parameters_delete(grpc_gcp_StartServerHandshakeReq *msg, int32_t key) { return _upb_msg_map_delete(msg, UPB_SIZE(28, 56), &key, sizeof(key)); }
+UPB_INLINE grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry* grpc_gcp_StartServerHandshakeReq_handshake_parameters_nextmutable(grpc_gcp_StartServerHandshakeReq *msg, size_t* iter) { return (grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry*)_upb_msg_map_next(msg, UPB_SIZE(28, 56), iter); }
UPB_INLINE void grpc_gcp_StartServerHandshakeReq_set_in_bytes(grpc_gcp_StartServerHandshakeReq *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
}
UPB_INLINE void grpc_gcp_StartServerHandshakeReq_set_local_endpoint(grpc_gcp_StartServerHandshakeReq *msg, grpc_gcp_Endpoint* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), grpc_gcp_Endpoint*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), grpc_gcp_Endpoint*) = value;
}
UPB_INLINE struct grpc_gcp_Endpoint* grpc_gcp_StartServerHandshakeReq_mutable_local_endpoint(grpc_gcp_StartServerHandshakeReq *msg, upb_arena *arena) {
struct grpc_gcp_Endpoint* sub = (struct grpc_gcp_Endpoint*)grpc_gcp_StartServerHandshakeReq_local_endpoint(msg);
if (sub == NULL) {
- sub = (struct grpc_gcp_Endpoint*)_upb_msg_new(&grpc_gcp_Endpoint_msginit, arena);
+ sub = (struct grpc_gcp_Endpoint*)_upb_msg_new(&grpc_gcp_Endpoint_msginit, arena);
if (!sub) return NULL;
grpc_gcp_StartServerHandshakeReq_set_local_endpoint(msg, sub);
}
return sub;
}
UPB_INLINE void grpc_gcp_StartServerHandshakeReq_set_remote_endpoint(grpc_gcp_StartServerHandshakeReq *msg, grpc_gcp_Endpoint* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(16, 32), grpc_gcp_Endpoint*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), grpc_gcp_Endpoint*) = value;
}
UPB_INLINE struct grpc_gcp_Endpoint* grpc_gcp_StartServerHandshakeReq_mutable_remote_endpoint(grpc_gcp_StartServerHandshakeReq *msg, upb_arena *arena) {
struct grpc_gcp_Endpoint* sub = (struct grpc_gcp_Endpoint*)grpc_gcp_StartServerHandshakeReq_remote_endpoint(msg);
if (sub == NULL) {
- sub = (struct grpc_gcp_Endpoint*)_upb_msg_new(&grpc_gcp_Endpoint_msginit, arena);
+ sub = (struct grpc_gcp_Endpoint*)_upb_msg_new(&grpc_gcp_Endpoint_msginit, arena);
if (!sub) return NULL;
grpc_gcp_StartServerHandshakeReq_set_remote_endpoint(msg, sub);
}
return sub;
}
UPB_INLINE void grpc_gcp_StartServerHandshakeReq_set_rpc_versions(grpc_gcp_StartServerHandshakeReq *msg, struct grpc_gcp_RpcProtocolVersions* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(20, 40), struct grpc_gcp_RpcProtocolVersions*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 40), struct grpc_gcp_RpcProtocolVersions*) = value;
}
UPB_INLINE struct grpc_gcp_RpcProtocolVersions* grpc_gcp_StartServerHandshakeReq_mutable_rpc_versions(grpc_gcp_StartServerHandshakeReq *msg, upb_arena *arena) {
struct grpc_gcp_RpcProtocolVersions* sub = (struct grpc_gcp_RpcProtocolVersions*)grpc_gcp_StartServerHandshakeReq_rpc_versions(msg);
if (sub == NULL) {
- sub = (struct grpc_gcp_RpcProtocolVersions*)_upb_msg_new(&grpc_gcp_RpcProtocolVersions_msginit, arena);
+ sub = (struct grpc_gcp_RpcProtocolVersions*)_upb_msg_new(&grpc_gcp_RpcProtocolVersions_msginit, arena);
if (!sub) return NULL;
grpc_gcp_StartServerHandshakeReq_set_rpc_versions(msg, sub);
}
return sub;
}
-UPB_INLINE void grpc_gcp_StartServerHandshakeReq_set_max_frame_size(grpc_gcp_StartServerHandshakeReq *msg, uint32_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t) = value;
-}
+UPB_INLINE void grpc_gcp_StartServerHandshakeReq_set_max_frame_size(grpc_gcp_StartServerHandshakeReq *msg, uint32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t) = value;
+}
/* grpc.gcp.StartServerHandshakeReq.HandshakeParametersEntry */
-UPB_INLINE int32_t grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry_key(const grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry *msg) {
- int32_t ret;
- _upb_msg_map_key(msg, &ret, sizeof(ret));
- return ret;
+UPB_INLINE int32_t grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry_key(const grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry *msg) {
+ int32_t ret;
+ _upb_msg_map_key(msg, &ret, sizeof(ret));
+ return ret;
}
-UPB_INLINE bool grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry_has_value(const grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const grpc_gcp_ServerHandshakeParameters* grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry_value(const grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry *msg) {
- grpc_gcp_ServerHandshakeParameters* ret;
- _upb_msg_map_value(msg, &ret, sizeof(ret));
- return ret;
+UPB_INLINE bool grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry_has_value(const grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
+UPB_INLINE const grpc_gcp_ServerHandshakeParameters* grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry_value(const grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry *msg) {
+ grpc_gcp_ServerHandshakeParameters* ret;
+ _upb_msg_map_value(msg, &ret, sizeof(ret));
+ return ret;
}
UPB_INLINE void grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry_set_value(grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry *msg, grpc_gcp_ServerHandshakeParameters* value) {
- _upb_msg_map_set_value(msg, &value, sizeof(grpc_gcp_ServerHandshakeParameters*));
+ _upb_msg_map_set_value(msg, &value, sizeof(grpc_gcp_ServerHandshakeParameters*));
}
/* grpc.gcp.NextHandshakeMessageReq */
UPB_INLINE grpc_gcp_NextHandshakeMessageReq *grpc_gcp_NextHandshakeMessageReq_new(upb_arena *arena) {
- return (grpc_gcp_NextHandshakeMessageReq *)_upb_msg_new(&grpc_gcp_NextHandshakeMessageReq_msginit, arena);
+ return (grpc_gcp_NextHandshakeMessageReq *)_upb_msg_new(&grpc_gcp_NextHandshakeMessageReq_msginit, arena);
}
UPB_INLINE grpc_gcp_NextHandshakeMessageReq *grpc_gcp_NextHandshakeMessageReq_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -437,16 +437,16 @@ UPB_INLINE char *grpc_gcp_NextHandshakeMessageReq_serialize(const grpc_gcp_NextH
return upb_encode(msg, &grpc_gcp_NextHandshakeMessageReq_msginit, arena, len);
}
-UPB_INLINE upb_strview grpc_gcp_NextHandshakeMessageReq_in_bytes(const grpc_gcp_NextHandshakeMessageReq *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE upb_strview grpc_gcp_NextHandshakeMessageReq_in_bytes(const grpc_gcp_NextHandshakeMessageReq *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
UPB_INLINE void grpc_gcp_NextHandshakeMessageReq_set_in_bytes(grpc_gcp_NextHandshakeMessageReq *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
}
/* grpc.gcp.HandshakerReq */
UPB_INLINE grpc_gcp_HandshakerReq *grpc_gcp_HandshakerReq_new(upb_arena *arena) {
- return (grpc_gcp_HandshakerReq *)_upb_msg_new(&grpc_gcp_HandshakerReq_msginit, arena);
+ return (grpc_gcp_HandshakerReq *)_upb_msg_new(&grpc_gcp_HandshakerReq_msginit, arena);
}
UPB_INLINE grpc_gcp_HandshakerReq *grpc_gcp_HandshakerReq_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -463,13 +463,13 @@ typedef enum {
grpc_gcp_HandshakerReq_req_oneof_next = 3,
grpc_gcp_HandshakerReq_req_oneof_NOT_SET = 0
} grpc_gcp_HandshakerReq_req_oneof_oneofcases;
-UPB_INLINE grpc_gcp_HandshakerReq_req_oneof_oneofcases grpc_gcp_HandshakerReq_req_oneof_case(const grpc_gcp_HandshakerReq* msg) { return (grpc_gcp_HandshakerReq_req_oneof_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 8), int32_t); }
+UPB_INLINE grpc_gcp_HandshakerReq_req_oneof_oneofcases grpc_gcp_HandshakerReq_req_oneof_case(const grpc_gcp_HandshakerReq* msg) { return (grpc_gcp_HandshakerReq_req_oneof_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 8), int32_t); }
-UPB_INLINE bool grpc_gcp_HandshakerReq_has_client_start(const grpc_gcp_HandshakerReq *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 1; }
+UPB_INLINE bool grpc_gcp_HandshakerReq_has_client_start(const grpc_gcp_HandshakerReq *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 1; }
UPB_INLINE const grpc_gcp_StartClientHandshakeReq* grpc_gcp_HandshakerReq_client_start(const grpc_gcp_HandshakerReq *msg) { return UPB_READ_ONEOF(msg, const grpc_gcp_StartClientHandshakeReq*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 1, NULL); }
-UPB_INLINE bool grpc_gcp_HandshakerReq_has_server_start(const grpc_gcp_HandshakerReq *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 2; }
+UPB_INLINE bool grpc_gcp_HandshakerReq_has_server_start(const grpc_gcp_HandshakerReq *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 2; }
UPB_INLINE const grpc_gcp_StartServerHandshakeReq* grpc_gcp_HandshakerReq_server_start(const grpc_gcp_HandshakerReq *msg) { return UPB_READ_ONEOF(msg, const grpc_gcp_StartServerHandshakeReq*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 2, NULL); }
-UPB_INLINE bool grpc_gcp_HandshakerReq_has_next(const grpc_gcp_HandshakerReq *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 3; }
+UPB_INLINE bool grpc_gcp_HandshakerReq_has_next(const grpc_gcp_HandshakerReq *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 3; }
UPB_INLINE const grpc_gcp_NextHandshakeMessageReq* grpc_gcp_HandshakerReq_next(const grpc_gcp_HandshakerReq *msg) { return UPB_READ_ONEOF(msg, const grpc_gcp_NextHandshakeMessageReq*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 3, NULL); }
UPB_INLINE void grpc_gcp_HandshakerReq_set_client_start(grpc_gcp_HandshakerReq *msg, grpc_gcp_StartClientHandshakeReq* value) {
@@ -478,7 +478,7 @@ UPB_INLINE void grpc_gcp_HandshakerReq_set_client_start(grpc_gcp_HandshakerReq *
UPB_INLINE struct grpc_gcp_StartClientHandshakeReq* grpc_gcp_HandshakerReq_mutable_client_start(grpc_gcp_HandshakerReq *msg, upb_arena *arena) {
struct grpc_gcp_StartClientHandshakeReq* sub = (struct grpc_gcp_StartClientHandshakeReq*)grpc_gcp_HandshakerReq_client_start(msg);
if (sub == NULL) {
- sub = (struct grpc_gcp_StartClientHandshakeReq*)_upb_msg_new(&grpc_gcp_StartClientHandshakeReq_msginit, arena);
+ sub = (struct grpc_gcp_StartClientHandshakeReq*)_upb_msg_new(&grpc_gcp_StartClientHandshakeReq_msginit, arena);
if (!sub) return NULL;
grpc_gcp_HandshakerReq_set_client_start(msg, sub);
}
@@ -490,7 +490,7 @@ UPB_INLINE void grpc_gcp_HandshakerReq_set_server_start(grpc_gcp_HandshakerReq *
UPB_INLINE struct grpc_gcp_StartServerHandshakeReq* grpc_gcp_HandshakerReq_mutable_server_start(grpc_gcp_HandshakerReq *msg, upb_arena *arena) {
struct grpc_gcp_StartServerHandshakeReq* sub = (struct grpc_gcp_StartServerHandshakeReq*)grpc_gcp_HandshakerReq_server_start(msg);
if (sub == NULL) {
- sub = (struct grpc_gcp_StartServerHandshakeReq*)_upb_msg_new(&grpc_gcp_StartServerHandshakeReq_msginit, arena);
+ sub = (struct grpc_gcp_StartServerHandshakeReq*)_upb_msg_new(&grpc_gcp_StartServerHandshakeReq_msginit, arena);
if (!sub) return NULL;
grpc_gcp_HandshakerReq_set_server_start(msg, sub);
}
@@ -502,7 +502,7 @@ UPB_INLINE void grpc_gcp_HandshakerReq_set_next(grpc_gcp_HandshakerReq *msg, grp
UPB_INLINE struct grpc_gcp_NextHandshakeMessageReq* grpc_gcp_HandshakerReq_mutable_next(grpc_gcp_HandshakerReq *msg, upb_arena *arena) {
struct grpc_gcp_NextHandshakeMessageReq* sub = (struct grpc_gcp_NextHandshakeMessageReq*)grpc_gcp_HandshakerReq_next(msg);
if (sub == NULL) {
- sub = (struct grpc_gcp_NextHandshakeMessageReq*)_upb_msg_new(&grpc_gcp_NextHandshakeMessageReq_msginit, arena);
+ sub = (struct grpc_gcp_NextHandshakeMessageReq*)_upb_msg_new(&grpc_gcp_NextHandshakeMessageReq_msginit, arena);
if (!sub) return NULL;
grpc_gcp_HandshakerReq_set_next(msg, sub);
}
@@ -512,7 +512,7 @@ UPB_INLINE struct grpc_gcp_NextHandshakeMessageReq* grpc_gcp_HandshakerReq_mutab
/* grpc.gcp.HandshakerResult */
UPB_INLINE grpc_gcp_HandshakerResult *grpc_gcp_HandshakerResult_new(upb_arena *arena) {
- return (grpc_gcp_HandshakerResult *)_upb_msg_new(&grpc_gcp_HandshakerResult_msginit, arena);
+ return (grpc_gcp_HandshakerResult *)_upb_msg_new(&grpc_gcp_HandshakerResult_msginit, arena);
}
UPB_INLINE grpc_gcp_HandshakerResult *grpc_gcp_HandshakerResult_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -523,74 +523,74 @@ UPB_INLINE char *grpc_gcp_HandshakerResult_serialize(const grpc_gcp_HandshakerRe
return upb_encode(msg, &grpc_gcp_HandshakerResult_msginit, arena, len);
}
-UPB_INLINE upb_strview grpc_gcp_HandshakerResult_application_protocol(const grpc_gcp_HandshakerResult *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview); }
-UPB_INLINE upb_strview grpc_gcp_HandshakerResult_record_protocol(const grpc_gcp_HandshakerResult *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_strview); }
-UPB_INLINE upb_strview grpc_gcp_HandshakerResult_key_data(const grpc_gcp_HandshakerResult *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), upb_strview); }
-UPB_INLINE bool grpc_gcp_HandshakerResult_has_peer_identity(const grpc_gcp_HandshakerResult *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(32, 56)); }
-UPB_INLINE const grpc_gcp_Identity* grpc_gcp_HandshakerResult_peer_identity(const grpc_gcp_HandshakerResult *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 56), const grpc_gcp_Identity*); }
-UPB_INLINE bool grpc_gcp_HandshakerResult_has_local_identity(const grpc_gcp_HandshakerResult *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(36, 64)); }
-UPB_INLINE const grpc_gcp_Identity* grpc_gcp_HandshakerResult_local_identity(const grpc_gcp_HandshakerResult *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(36, 64), const grpc_gcp_Identity*); }
-UPB_INLINE bool grpc_gcp_HandshakerResult_keep_channel_open(const grpc_gcp_HandshakerResult *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool); }
-UPB_INLINE bool grpc_gcp_HandshakerResult_has_peer_rpc_versions(const grpc_gcp_HandshakerResult *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(40, 72)); }
-UPB_INLINE const struct grpc_gcp_RpcProtocolVersions* grpc_gcp_HandshakerResult_peer_rpc_versions(const grpc_gcp_HandshakerResult *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(40, 72), const struct grpc_gcp_RpcProtocolVersions*); }
-UPB_INLINE uint32_t grpc_gcp_HandshakerResult_max_frame_size(const grpc_gcp_HandshakerResult *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t); }
+UPB_INLINE upb_strview grpc_gcp_HandshakerResult_application_protocol(const grpc_gcp_HandshakerResult *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview); }
+UPB_INLINE upb_strview grpc_gcp_HandshakerResult_record_protocol(const grpc_gcp_HandshakerResult *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_strview); }
+UPB_INLINE upb_strview grpc_gcp_HandshakerResult_key_data(const grpc_gcp_HandshakerResult *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), upb_strview); }
+UPB_INLINE bool grpc_gcp_HandshakerResult_has_peer_identity(const grpc_gcp_HandshakerResult *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(32, 56)); }
+UPB_INLINE const grpc_gcp_Identity* grpc_gcp_HandshakerResult_peer_identity(const grpc_gcp_HandshakerResult *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 56), const grpc_gcp_Identity*); }
+UPB_INLINE bool grpc_gcp_HandshakerResult_has_local_identity(const grpc_gcp_HandshakerResult *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(36, 64)); }
+UPB_INLINE const grpc_gcp_Identity* grpc_gcp_HandshakerResult_local_identity(const grpc_gcp_HandshakerResult *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(36, 64), const grpc_gcp_Identity*); }
+UPB_INLINE bool grpc_gcp_HandshakerResult_keep_channel_open(const grpc_gcp_HandshakerResult *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool); }
+UPB_INLINE bool grpc_gcp_HandshakerResult_has_peer_rpc_versions(const grpc_gcp_HandshakerResult *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(40, 72)); }
+UPB_INLINE const struct grpc_gcp_RpcProtocolVersions* grpc_gcp_HandshakerResult_peer_rpc_versions(const grpc_gcp_HandshakerResult *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(40, 72), const struct grpc_gcp_RpcProtocolVersions*); }
+UPB_INLINE uint32_t grpc_gcp_HandshakerResult_max_frame_size(const grpc_gcp_HandshakerResult *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t); }
UPB_INLINE void grpc_gcp_HandshakerResult_set_application_protocol(grpc_gcp_HandshakerResult *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview) = value;
}
UPB_INLINE void grpc_gcp_HandshakerResult_set_record_protocol(grpc_gcp_HandshakerResult *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_strview) = value;
}
UPB_INLINE void grpc_gcp_HandshakerResult_set_key_data(grpc_gcp_HandshakerResult *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(24, 40), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 40), upb_strview) = value;
}
UPB_INLINE void grpc_gcp_HandshakerResult_set_peer_identity(grpc_gcp_HandshakerResult *msg, grpc_gcp_Identity* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(32, 56), grpc_gcp_Identity*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 56), grpc_gcp_Identity*) = value;
}
UPB_INLINE struct grpc_gcp_Identity* grpc_gcp_HandshakerResult_mutable_peer_identity(grpc_gcp_HandshakerResult *msg, upb_arena *arena) {
struct grpc_gcp_Identity* sub = (struct grpc_gcp_Identity*)grpc_gcp_HandshakerResult_peer_identity(msg);
if (sub == NULL) {
- sub = (struct grpc_gcp_Identity*)_upb_msg_new(&grpc_gcp_Identity_msginit, arena);
+ sub = (struct grpc_gcp_Identity*)_upb_msg_new(&grpc_gcp_Identity_msginit, arena);
if (!sub) return NULL;
grpc_gcp_HandshakerResult_set_peer_identity(msg, sub);
}
return sub;
}
UPB_INLINE void grpc_gcp_HandshakerResult_set_local_identity(grpc_gcp_HandshakerResult *msg, grpc_gcp_Identity* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(36, 64), grpc_gcp_Identity*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(36, 64), grpc_gcp_Identity*) = value;
}
UPB_INLINE struct grpc_gcp_Identity* grpc_gcp_HandshakerResult_mutable_local_identity(grpc_gcp_HandshakerResult *msg, upb_arena *arena) {
struct grpc_gcp_Identity* sub = (struct grpc_gcp_Identity*)grpc_gcp_HandshakerResult_local_identity(msg);
if (sub == NULL) {
- sub = (struct grpc_gcp_Identity*)_upb_msg_new(&grpc_gcp_Identity_msginit, arena);
+ sub = (struct grpc_gcp_Identity*)_upb_msg_new(&grpc_gcp_Identity_msginit, arena);
if (!sub) return NULL;
grpc_gcp_HandshakerResult_set_local_identity(msg, sub);
}
return sub;
}
UPB_INLINE void grpc_gcp_HandshakerResult_set_keep_channel_open(grpc_gcp_HandshakerResult *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool) = value;
}
UPB_INLINE void grpc_gcp_HandshakerResult_set_peer_rpc_versions(grpc_gcp_HandshakerResult *msg, struct grpc_gcp_RpcProtocolVersions* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(40, 72), struct grpc_gcp_RpcProtocolVersions*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 72), struct grpc_gcp_RpcProtocolVersions*) = value;
}
UPB_INLINE struct grpc_gcp_RpcProtocolVersions* grpc_gcp_HandshakerResult_mutable_peer_rpc_versions(grpc_gcp_HandshakerResult *msg, upb_arena *arena) {
struct grpc_gcp_RpcProtocolVersions* sub = (struct grpc_gcp_RpcProtocolVersions*)grpc_gcp_HandshakerResult_peer_rpc_versions(msg);
if (sub == NULL) {
- sub = (struct grpc_gcp_RpcProtocolVersions*)_upb_msg_new(&grpc_gcp_RpcProtocolVersions_msginit, arena);
+ sub = (struct grpc_gcp_RpcProtocolVersions*)_upb_msg_new(&grpc_gcp_RpcProtocolVersions_msginit, arena);
if (!sub) return NULL;
grpc_gcp_HandshakerResult_set_peer_rpc_versions(msg, sub);
}
return sub;
}
-UPB_INLINE void grpc_gcp_HandshakerResult_set_max_frame_size(grpc_gcp_HandshakerResult *msg, uint32_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t) = value;
-}
+UPB_INLINE void grpc_gcp_HandshakerResult_set_max_frame_size(grpc_gcp_HandshakerResult *msg, uint32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t) = value;
+}
/* grpc.gcp.HandshakerStatus */
UPB_INLINE grpc_gcp_HandshakerStatus *grpc_gcp_HandshakerStatus_new(upb_arena *arena) {
- return (grpc_gcp_HandshakerStatus *)_upb_msg_new(&grpc_gcp_HandshakerStatus_msginit, arena);
+ return (grpc_gcp_HandshakerStatus *)_upb_msg_new(&grpc_gcp_HandshakerStatus_msginit, arena);
}
UPB_INLINE grpc_gcp_HandshakerStatus *grpc_gcp_HandshakerStatus_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -601,20 +601,20 @@ UPB_INLINE char *grpc_gcp_HandshakerStatus_serialize(const grpc_gcp_HandshakerSt
return upb_encode(msg, &grpc_gcp_HandshakerStatus_msginit, arena, len);
}
-UPB_INLINE uint32_t grpc_gcp_HandshakerStatus_code(const grpc_gcp_HandshakerStatus *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t); }
-UPB_INLINE upb_strview grpc_gcp_HandshakerStatus_details(const grpc_gcp_HandshakerStatus *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
+UPB_INLINE uint32_t grpc_gcp_HandshakerStatus_code(const grpc_gcp_HandshakerStatus *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t); }
+UPB_INLINE upb_strview grpc_gcp_HandshakerStatus_details(const grpc_gcp_HandshakerStatus *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
UPB_INLINE void grpc_gcp_HandshakerStatus_set_code(grpc_gcp_HandshakerStatus *msg, uint32_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t) = value;
}
UPB_INLINE void grpc_gcp_HandshakerStatus_set_details(grpc_gcp_HandshakerStatus *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
}
/* grpc.gcp.HandshakerResp */
UPB_INLINE grpc_gcp_HandshakerResp *grpc_gcp_HandshakerResp_new(upb_arena *arena) {
- return (grpc_gcp_HandshakerResp *)_upb_msg_new(&grpc_gcp_HandshakerResp_msginit, arena);
+ return (grpc_gcp_HandshakerResp *)_upb_msg_new(&grpc_gcp_HandshakerResp_msginit, arena);
}
UPB_INLINE grpc_gcp_HandshakerResp *grpc_gcp_HandshakerResp_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -625,38 +625,38 @@ UPB_INLINE char *grpc_gcp_HandshakerResp_serialize(const grpc_gcp_HandshakerResp
return upb_encode(msg, &grpc_gcp_HandshakerResp_msginit, arena, len);
}
-UPB_INLINE upb_strview grpc_gcp_HandshakerResp_out_frames(const grpc_gcp_HandshakerResp *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
-UPB_INLINE uint32_t grpc_gcp_HandshakerResp_bytes_consumed(const grpc_gcp_HandshakerResp *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t); }
-UPB_INLINE bool grpc_gcp_HandshakerResp_has_result(const grpc_gcp_HandshakerResp *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
-UPB_INLINE const grpc_gcp_HandshakerResult* grpc_gcp_HandshakerResp_result(const grpc_gcp_HandshakerResp *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const grpc_gcp_HandshakerResult*); }
-UPB_INLINE bool grpc_gcp_HandshakerResp_has_status(const grpc_gcp_HandshakerResp *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); }
-UPB_INLINE const grpc_gcp_HandshakerStatus* grpc_gcp_HandshakerResp_status(const grpc_gcp_HandshakerResp *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const grpc_gcp_HandshakerStatus*); }
+UPB_INLINE upb_strview grpc_gcp_HandshakerResp_out_frames(const grpc_gcp_HandshakerResp *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
+UPB_INLINE uint32_t grpc_gcp_HandshakerResp_bytes_consumed(const grpc_gcp_HandshakerResp *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t); }
+UPB_INLINE bool grpc_gcp_HandshakerResp_has_result(const grpc_gcp_HandshakerResp *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
+UPB_INLINE const grpc_gcp_HandshakerResult* grpc_gcp_HandshakerResp_result(const grpc_gcp_HandshakerResp *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const grpc_gcp_HandshakerResult*); }
+UPB_INLINE bool grpc_gcp_HandshakerResp_has_status(const grpc_gcp_HandshakerResp *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); }
+UPB_INLINE const grpc_gcp_HandshakerStatus* grpc_gcp_HandshakerResp_status(const grpc_gcp_HandshakerResp *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const grpc_gcp_HandshakerStatus*); }
UPB_INLINE void grpc_gcp_HandshakerResp_set_out_frames(grpc_gcp_HandshakerResp *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
}
UPB_INLINE void grpc_gcp_HandshakerResp_set_bytes_consumed(grpc_gcp_HandshakerResp *msg, uint32_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t) = value;
}
UPB_INLINE void grpc_gcp_HandshakerResp_set_result(grpc_gcp_HandshakerResp *msg, grpc_gcp_HandshakerResult* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), grpc_gcp_HandshakerResult*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), grpc_gcp_HandshakerResult*) = value;
}
UPB_INLINE struct grpc_gcp_HandshakerResult* grpc_gcp_HandshakerResp_mutable_result(grpc_gcp_HandshakerResp *msg, upb_arena *arena) {
struct grpc_gcp_HandshakerResult* sub = (struct grpc_gcp_HandshakerResult*)grpc_gcp_HandshakerResp_result(msg);
if (sub == NULL) {
- sub = (struct grpc_gcp_HandshakerResult*)_upb_msg_new(&grpc_gcp_HandshakerResult_msginit, arena);
+ sub = (struct grpc_gcp_HandshakerResult*)_upb_msg_new(&grpc_gcp_HandshakerResult_msginit, arena);
if (!sub) return NULL;
grpc_gcp_HandshakerResp_set_result(msg, sub);
}
return sub;
}
UPB_INLINE void grpc_gcp_HandshakerResp_set_status(grpc_gcp_HandshakerResp *msg, grpc_gcp_HandshakerStatus* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(16, 32), grpc_gcp_HandshakerStatus*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), grpc_gcp_HandshakerStatus*) = value;
}
UPB_INLINE struct grpc_gcp_HandshakerStatus* grpc_gcp_HandshakerResp_mutable_status(grpc_gcp_HandshakerResp *msg, upb_arena *arena) {
struct grpc_gcp_HandshakerStatus* sub = (struct grpc_gcp_HandshakerStatus*)grpc_gcp_HandshakerResp_status(msg);
if (sub == NULL) {
- sub = (struct grpc_gcp_HandshakerStatus*)_upb_msg_new(&grpc_gcp_HandshakerStatus_msginit, arena);
+ sub = (struct grpc_gcp_HandshakerStatus*)_upb_msg_new(&grpc_gcp_HandshakerStatus_msginit, arena);
if (!sub) return NULL;
grpc_gcp_HandshakerResp_set_status(msg, sub);
}
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.h
index 586f22c8b2c..52963988131 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.h
@@ -36,7 +36,7 @@ typedef enum {
/* grpc.gcp.RpcProtocolVersions */
UPB_INLINE grpc_gcp_RpcProtocolVersions *grpc_gcp_RpcProtocolVersions_new(upb_arena *arena) {
- return (grpc_gcp_RpcProtocolVersions *)_upb_msg_new(&grpc_gcp_RpcProtocolVersions_msginit, arena);
+ return (grpc_gcp_RpcProtocolVersions *)_upb_msg_new(&grpc_gcp_RpcProtocolVersions_msginit, arena);
}
UPB_INLINE grpc_gcp_RpcProtocolVersions *grpc_gcp_RpcProtocolVersions_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -47,30 +47,30 @@ UPB_INLINE char *grpc_gcp_RpcProtocolVersions_serialize(const grpc_gcp_RpcProtoc
return upb_encode(msg, &grpc_gcp_RpcProtocolVersions_msginit, arena, len);
}
-UPB_INLINE bool grpc_gcp_RpcProtocolVersions_has_max_rpc_version(const grpc_gcp_RpcProtocolVersions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE const grpc_gcp_RpcProtocolVersions_Version* grpc_gcp_RpcProtocolVersions_max_rpc_version(const grpc_gcp_RpcProtocolVersions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const grpc_gcp_RpcProtocolVersions_Version*); }
-UPB_INLINE bool grpc_gcp_RpcProtocolVersions_has_min_rpc_version(const grpc_gcp_RpcProtocolVersions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
-UPB_INLINE const grpc_gcp_RpcProtocolVersions_Version* grpc_gcp_RpcProtocolVersions_min_rpc_version(const grpc_gcp_RpcProtocolVersions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const grpc_gcp_RpcProtocolVersions_Version*); }
+UPB_INLINE bool grpc_gcp_RpcProtocolVersions_has_max_rpc_version(const grpc_gcp_RpcProtocolVersions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE const grpc_gcp_RpcProtocolVersions_Version* grpc_gcp_RpcProtocolVersions_max_rpc_version(const grpc_gcp_RpcProtocolVersions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), const grpc_gcp_RpcProtocolVersions_Version*); }
+UPB_INLINE bool grpc_gcp_RpcProtocolVersions_has_min_rpc_version(const grpc_gcp_RpcProtocolVersions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
+UPB_INLINE const grpc_gcp_RpcProtocolVersions_Version* grpc_gcp_RpcProtocolVersions_min_rpc_version(const grpc_gcp_RpcProtocolVersions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const grpc_gcp_RpcProtocolVersions_Version*); }
UPB_INLINE void grpc_gcp_RpcProtocolVersions_set_max_rpc_version(grpc_gcp_RpcProtocolVersions *msg, grpc_gcp_RpcProtocolVersions_Version* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), grpc_gcp_RpcProtocolVersions_Version*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), grpc_gcp_RpcProtocolVersions_Version*) = value;
}
UPB_INLINE struct grpc_gcp_RpcProtocolVersions_Version* grpc_gcp_RpcProtocolVersions_mutable_max_rpc_version(grpc_gcp_RpcProtocolVersions *msg, upb_arena *arena) {
struct grpc_gcp_RpcProtocolVersions_Version* sub = (struct grpc_gcp_RpcProtocolVersions_Version*)grpc_gcp_RpcProtocolVersions_max_rpc_version(msg);
if (sub == NULL) {
- sub = (struct grpc_gcp_RpcProtocolVersions_Version*)_upb_msg_new(&grpc_gcp_RpcProtocolVersions_Version_msginit, arena);
+ sub = (struct grpc_gcp_RpcProtocolVersions_Version*)_upb_msg_new(&grpc_gcp_RpcProtocolVersions_Version_msginit, arena);
if (!sub) return NULL;
grpc_gcp_RpcProtocolVersions_set_max_rpc_version(msg, sub);
}
return sub;
}
UPB_INLINE void grpc_gcp_RpcProtocolVersions_set_min_rpc_version(grpc_gcp_RpcProtocolVersions *msg, grpc_gcp_RpcProtocolVersions_Version* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), grpc_gcp_RpcProtocolVersions_Version*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), grpc_gcp_RpcProtocolVersions_Version*) = value;
}
UPB_INLINE struct grpc_gcp_RpcProtocolVersions_Version* grpc_gcp_RpcProtocolVersions_mutable_min_rpc_version(grpc_gcp_RpcProtocolVersions *msg, upb_arena *arena) {
struct grpc_gcp_RpcProtocolVersions_Version* sub = (struct grpc_gcp_RpcProtocolVersions_Version*)grpc_gcp_RpcProtocolVersions_min_rpc_version(msg);
if (sub == NULL) {
- sub = (struct grpc_gcp_RpcProtocolVersions_Version*)_upb_msg_new(&grpc_gcp_RpcProtocolVersions_Version_msginit, arena);
+ sub = (struct grpc_gcp_RpcProtocolVersions_Version*)_upb_msg_new(&grpc_gcp_RpcProtocolVersions_Version_msginit, arena);
if (!sub) return NULL;
grpc_gcp_RpcProtocolVersions_set_min_rpc_version(msg, sub);
}
@@ -80,7 +80,7 @@ UPB_INLINE struct grpc_gcp_RpcProtocolVersions_Version* grpc_gcp_RpcProtocolVers
/* grpc.gcp.RpcProtocolVersions.Version */
UPB_INLINE grpc_gcp_RpcProtocolVersions_Version *grpc_gcp_RpcProtocolVersions_Version_new(upb_arena *arena) {
- return (grpc_gcp_RpcProtocolVersions_Version *)_upb_msg_new(&grpc_gcp_RpcProtocolVersions_Version_msginit, arena);
+ return (grpc_gcp_RpcProtocolVersions_Version *)_upb_msg_new(&grpc_gcp_RpcProtocolVersions_Version_msginit, arena);
}
UPB_INLINE grpc_gcp_RpcProtocolVersions_Version *grpc_gcp_RpcProtocolVersions_Version_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -91,14 +91,14 @@ UPB_INLINE char *grpc_gcp_RpcProtocolVersions_Version_serialize(const grpc_gcp_R
return upb_encode(msg, &grpc_gcp_RpcProtocolVersions_Version_msginit, arena, len);
}
-UPB_INLINE uint32_t grpc_gcp_RpcProtocolVersions_Version_major(const grpc_gcp_RpcProtocolVersions_Version *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t); }
-UPB_INLINE uint32_t grpc_gcp_RpcProtocolVersions_Version_minor(const grpc_gcp_RpcProtocolVersions_Version *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t); }
+UPB_INLINE uint32_t grpc_gcp_RpcProtocolVersions_Version_major(const grpc_gcp_RpcProtocolVersions_Version *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t); }
+UPB_INLINE uint32_t grpc_gcp_RpcProtocolVersions_Version_minor(const grpc_gcp_RpcProtocolVersions_Version *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t); }
UPB_INLINE void grpc_gcp_RpcProtocolVersions_Version_set_major(grpc_gcp_RpcProtocolVersions_Version *msg, uint32_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t) = value;
}
UPB_INLINE void grpc_gcp_RpcProtocolVersions_Version_set_minor(grpc_gcp_RpcProtocolVersions_Version *msg, uint32_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t) = value;
}
#ifdef __cplusplus
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h
index 921306f6e9d..d3f6471621f 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h
@@ -37,7 +37,7 @@ typedef enum {
/* grpc.health.v1.HealthCheckRequest */
UPB_INLINE grpc_health_v1_HealthCheckRequest *grpc_health_v1_HealthCheckRequest_new(upb_arena *arena) {
- return (grpc_health_v1_HealthCheckRequest *)_upb_msg_new(&grpc_health_v1_HealthCheckRequest_msginit, arena);
+ return (grpc_health_v1_HealthCheckRequest *)_upb_msg_new(&grpc_health_v1_HealthCheckRequest_msginit, arena);
}
UPB_INLINE grpc_health_v1_HealthCheckRequest *grpc_health_v1_HealthCheckRequest_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -48,16 +48,16 @@ UPB_INLINE char *grpc_health_v1_HealthCheckRequest_serialize(const grpc_health_v
return upb_encode(msg, &grpc_health_v1_HealthCheckRequest_msginit, arena, len);
}
-UPB_INLINE upb_strview grpc_health_v1_HealthCheckRequest_service(const grpc_health_v1_HealthCheckRequest *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE upb_strview grpc_health_v1_HealthCheckRequest_service(const grpc_health_v1_HealthCheckRequest *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
UPB_INLINE void grpc_health_v1_HealthCheckRequest_set_service(grpc_health_v1_HealthCheckRequest *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
}
/* grpc.health.v1.HealthCheckResponse */
UPB_INLINE grpc_health_v1_HealthCheckResponse *grpc_health_v1_HealthCheckResponse_new(upb_arena *arena) {
- return (grpc_health_v1_HealthCheckResponse *)_upb_msg_new(&grpc_health_v1_HealthCheckResponse_msginit, arena);
+ return (grpc_health_v1_HealthCheckResponse *)_upb_msg_new(&grpc_health_v1_HealthCheckResponse_msginit, arena);
}
UPB_INLINE grpc_health_v1_HealthCheckResponse *grpc_health_v1_HealthCheckResponse_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -68,10 +68,10 @@ UPB_INLINE char *grpc_health_v1_HealthCheckResponse_serialize(const grpc_health_
return upb_encode(msg, &grpc_health_v1_HealthCheckResponse_msginit, arena, len);
}
-UPB_INLINE int32_t grpc_health_v1_HealthCheckResponse_status(const grpc_health_v1_HealthCheckResponse *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
+UPB_INLINE int32_t grpc_health_v1_HealthCheckResponse_status(const grpc_health_v1_HealthCheckResponse *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
UPB_INLINE void grpc_health_v1_HealthCheckResponse_set_status(grpc_health_v1_HealthCheckResponse *msg, int32_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
}
#ifdef __cplusplus
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c
index cd1694a8425..90b7cb7f622 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c
@@ -71,22 +71,22 @@ const upb_msglayout grpc_lb_v1_ClientStats_msginit = {
UPB_SIZE(40, 48), 6, false,
};
-static const upb_msglayout *const grpc_lb_v1_LoadBalanceResponse_submsgs[3] = {
- &grpc_lb_v1_FallbackResponse_msginit,
+static const upb_msglayout *const grpc_lb_v1_LoadBalanceResponse_submsgs[3] = {
+ &grpc_lb_v1_FallbackResponse_msginit,
&grpc_lb_v1_InitialLoadBalanceResponse_msginit,
&grpc_lb_v1_ServerList_msginit,
};
-static const upb_msglayout_field grpc_lb_v1_LoadBalanceResponse__fields[3] = {
- {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 1, 11, 1},
- {2, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 2, 11, 1},
- {3, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, 1},
+static const upb_msglayout_field grpc_lb_v1_LoadBalanceResponse__fields[3] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 1, 11, 1},
+ {2, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 2, 11, 1},
+ {3, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, 1},
};
const upb_msglayout grpc_lb_v1_LoadBalanceResponse_msginit = {
&grpc_lb_v1_LoadBalanceResponse_submsgs[0],
&grpc_lb_v1_LoadBalanceResponse__fields[0],
- UPB_SIZE(8, 16), 3, false,
+ UPB_SIZE(8, 16), 3, false,
};
static const upb_msglayout *const grpc_lb_v1_InitialLoadBalanceResponse_submsgs[1] = {
@@ -131,11 +131,11 @@ const upb_msglayout grpc_lb_v1_Server_msginit = {
UPB_SIZE(24, 48), 4, false,
};
-const upb_msglayout grpc_lb_v1_FallbackResponse_msginit = {
- NULL,
- NULL,
- UPB_SIZE(0, 0), 0, false,
-};
-
+const upb_msglayout grpc_lb_v1_FallbackResponse_msginit = {
+ NULL,
+ NULL,
+ UPB_SIZE(0, 0), 0, false,
+};
+
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h
index d40246bca23..2ce5afca1c4 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h
@@ -27,7 +27,7 @@ struct grpc_lb_v1_LoadBalanceResponse;
struct grpc_lb_v1_InitialLoadBalanceResponse;
struct grpc_lb_v1_ServerList;
struct grpc_lb_v1_Server;
-struct grpc_lb_v1_FallbackResponse;
+struct grpc_lb_v1_FallbackResponse;
typedef struct grpc_lb_v1_LoadBalanceRequest grpc_lb_v1_LoadBalanceRequest;
typedef struct grpc_lb_v1_InitialLoadBalanceRequest grpc_lb_v1_InitialLoadBalanceRequest;
typedef struct grpc_lb_v1_ClientStatsPerToken grpc_lb_v1_ClientStatsPerToken;
@@ -36,7 +36,7 @@ typedef struct grpc_lb_v1_LoadBalanceResponse grpc_lb_v1_LoadBalanceResponse;
typedef struct grpc_lb_v1_InitialLoadBalanceResponse grpc_lb_v1_InitialLoadBalanceResponse;
typedef struct grpc_lb_v1_ServerList grpc_lb_v1_ServerList;
typedef struct grpc_lb_v1_Server grpc_lb_v1_Server;
-typedef struct grpc_lb_v1_FallbackResponse grpc_lb_v1_FallbackResponse;
+typedef struct grpc_lb_v1_FallbackResponse grpc_lb_v1_FallbackResponse;
extern const upb_msglayout grpc_lb_v1_LoadBalanceRequest_msginit;
extern const upb_msglayout grpc_lb_v1_InitialLoadBalanceRequest_msginit;
extern const upb_msglayout grpc_lb_v1_ClientStatsPerToken_msginit;
@@ -45,7 +45,7 @@ extern const upb_msglayout grpc_lb_v1_LoadBalanceResponse_msginit;
extern const upb_msglayout grpc_lb_v1_InitialLoadBalanceResponse_msginit;
extern const upb_msglayout grpc_lb_v1_ServerList_msginit;
extern const upb_msglayout grpc_lb_v1_Server_msginit;
-extern const upb_msglayout grpc_lb_v1_FallbackResponse_msginit;
+extern const upb_msglayout grpc_lb_v1_FallbackResponse_msginit;
struct google_protobuf_Duration;
struct google_protobuf_Timestamp;
extern const upb_msglayout google_protobuf_Duration_msginit;
@@ -55,7 +55,7 @@ extern const upb_msglayout google_protobuf_Timestamp_msginit;
/* grpc.lb.v1.LoadBalanceRequest */
UPB_INLINE grpc_lb_v1_LoadBalanceRequest *grpc_lb_v1_LoadBalanceRequest_new(upb_arena *arena) {
- return (grpc_lb_v1_LoadBalanceRequest *)_upb_msg_new(&grpc_lb_v1_LoadBalanceRequest_msginit, arena);
+ return (grpc_lb_v1_LoadBalanceRequest *)_upb_msg_new(&grpc_lb_v1_LoadBalanceRequest_msginit, arena);
}
UPB_INLINE grpc_lb_v1_LoadBalanceRequest *grpc_lb_v1_LoadBalanceRequest_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -71,11 +71,11 @@ typedef enum {
grpc_lb_v1_LoadBalanceRequest_load_balance_request_type_client_stats = 2,
grpc_lb_v1_LoadBalanceRequest_load_balance_request_type_NOT_SET = 0
} grpc_lb_v1_LoadBalanceRequest_load_balance_request_type_oneofcases;
-UPB_INLINE grpc_lb_v1_LoadBalanceRequest_load_balance_request_type_oneofcases grpc_lb_v1_LoadBalanceRequest_load_balance_request_type_case(const grpc_lb_v1_LoadBalanceRequest* msg) { return (grpc_lb_v1_LoadBalanceRequest_load_balance_request_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 8), int32_t); }
+UPB_INLINE grpc_lb_v1_LoadBalanceRequest_load_balance_request_type_oneofcases grpc_lb_v1_LoadBalanceRequest_load_balance_request_type_case(const grpc_lb_v1_LoadBalanceRequest* msg) { return (grpc_lb_v1_LoadBalanceRequest_load_balance_request_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 8), int32_t); }
-UPB_INLINE bool grpc_lb_v1_LoadBalanceRequest_has_initial_request(const grpc_lb_v1_LoadBalanceRequest *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 1; }
+UPB_INLINE bool grpc_lb_v1_LoadBalanceRequest_has_initial_request(const grpc_lb_v1_LoadBalanceRequest *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 1; }
UPB_INLINE const grpc_lb_v1_InitialLoadBalanceRequest* grpc_lb_v1_LoadBalanceRequest_initial_request(const grpc_lb_v1_LoadBalanceRequest *msg) { return UPB_READ_ONEOF(msg, const grpc_lb_v1_InitialLoadBalanceRequest*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 1, NULL); }
-UPB_INLINE bool grpc_lb_v1_LoadBalanceRequest_has_client_stats(const grpc_lb_v1_LoadBalanceRequest *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 2; }
+UPB_INLINE bool grpc_lb_v1_LoadBalanceRequest_has_client_stats(const grpc_lb_v1_LoadBalanceRequest *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 2; }
UPB_INLINE const grpc_lb_v1_ClientStats* grpc_lb_v1_LoadBalanceRequest_client_stats(const grpc_lb_v1_LoadBalanceRequest *msg) { return UPB_READ_ONEOF(msg, const grpc_lb_v1_ClientStats*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 2, NULL); }
UPB_INLINE void grpc_lb_v1_LoadBalanceRequest_set_initial_request(grpc_lb_v1_LoadBalanceRequest *msg, grpc_lb_v1_InitialLoadBalanceRequest* value) {
@@ -84,7 +84,7 @@ UPB_INLINE void grpc_lb_v1_LoadBalanceRequest_set_initial_request(grpc_lb_v1_Loa
UPB_INLINE struct grpc_lb_v1_InitialLoadBalanceRequest* grpc_lb_v1_LoadBalanceRequest_mutable_initial_request(grpc_lb_v1_LoadBalanceRequest *msg, upb_arena *arena) {
struct grpc_lb_v1_InitialLoadBalanceRequest* sub = (struct grpc_lb_v1_InitialLoadBalanceRequest*)grpc_lb_v1_LoadBalanceRequest_initial_request(msg);
if (sub == NULL) {
- sub = (struct grpc_lb_v1_InitialLoadBalanceRequest*)_upb_msg_new(&grpc_lb_v1_InitialLoadBalanceRequest_msginit, arena);
+ sub = (struct grpc_lb_v1_InitialLoadBalanceRequest*)_upb_msg_new(&grpc_lb_v1_InitialLoadBalanceRequest_msginit, arena);
if (!sub) return NULL;
grpc_lb_v1_LoadBalanceRequest_set_initial_request(msg, sub);
}
@@ -96,7 +96,7 @@ UPB_INLINE void grpc_lb_v1_LoadBalanceRequest_set_client_stats(grpc_lb_v1_LoadBa
UPB_INLINE struct grpc_lb_v1_ClientStats* grpc_lb_v1_LoadBalanceRequest_mutable_client_stats(grpc_lb_v1_LoadBalanceRequest *msg, upb_arena *arena) {
struct grpc_lb_v1_ClientStats* sub = (struct grpc_lb_v1_ClientStats*)grpc_lb_v1_LoadBalanceRequest_client_stats(msg);
if (sub == NULL) {
- sub = (struct grpc_lb_v1_ClientStats*)_upb_msg_new(&grpc_lb_v1_ClientStats_msginit, arena);
+ sub = (struct grpc_lb_v1_ClientStats*)_upb_msg_new(&grpc_lb_v1_ClientStats_msginit, arena);
if (!sub) return NULL;
grpc_lb_v1_LoadBalanceRequest_set_client_stats(msg, sub);
}
@@ -106,7 +106,7 @@ UPB_INLINE struct grpc_lb_v1_ClientStats* grpc_lb_v1_LoadBalanceRequest_mutable_
/* grpc.lb.v1.InitialLoadBalanceRequest */
UPB_INLINE grpc_lb_v1_InitialLoadBalanceRequest *grpc_lb_v1_InitialLoadBalanceRequest_new(upb_arena *arena) {
- return (grpc_lb_v1_InitialLoadBalanceRequest *)_upb_msg_new(&grpc_lb_v1_InitialLoadBalanceRequest_msginit, arena);
+ return (grpc_lb_v1_InitialLoadBalanceRequest *)_upb_msg_new(&grpc_lb_v1_InitialLoadBalanceRequest_msginit, arena);
}
UPB_INLINE grpc_lb_v1_InitialLoadBalanceRequest *grpc_lb_v1_InitialLoadBalanceRequest_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -117,16 +117,16 @@ UPB_INLINE char *grpc_lb_v1_InitialLoadBalanceRequest_serialize(const grpc_lb_v1
return upb_encode(msg, &grpc_lb_v1_InitialLoadBalanceRequest_msginit, arena, len);
}
-UPB_INLINE upb_strview grpc_lb_v1_InitialLoadBalanceRequest_name(const grpc_lb_v1_InitialLoadBalanceRequest *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE upb_strview grpc_lb_v1_InitialLoadBalanceRequest_name(const grpc_lb_v1_InitialLoadBalanceRequest *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
UPB_INLINE void grpc_lb_v1_InitialLoadBalanceRequest_set_name(grpc_lb_v1_InitialLoadBalanceRequest *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
}
/* grpc.lb.v1.ClientStatsPerToken */
UPB_INLINE grpc_lb_v1_ClientStatsPerToken *grpc_lb_v1_ClientStatsPerToken_new(upb_arena *arena) {
- return (grpc_lb_v1_ClientStatsPerToken *)_upb_msg_new(&grpc_lb_v1_ClientStatsPerToken_msginit, arena);
+ return (grpc_lb_v1_ClientStatsPerToken *)_upb_msg_new(&grpc_lb_v1_ClientStatsPerToken_msginit, arena);
}
UPB_INLINE grpc_lb_v1_ClientStatsPerToken *grpc_lb_v1_ClientStatsPerToken_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -137,20 +137,20 @@ UPB_INLINE char *grpc_lb_v1_ClientStatsPerToken_serialize(const grpc_lb_v1_Clien
return upb_encode(msg, &grpc_lb_v1_ClientStatsPerToken_msginit, arena, len);
}
-UPB_INLINE upb_strview grpc_lb_v1_ClientStatsPerToken_load_balance_token(const grpc_lb_v1_ClientStatsPerToken *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview); }
-UPB_INLINE int64_t grpc_lb_v1_ClientStatsPerToken_num_calls(const grpc_lb_v1_ClientStatsPerToken *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int64_t); }
+UPB_INLINE upb_strview grpc_lb_v1_ClientStatsPerToken_load_balance_token(const grpc_lb_v1_ClientStatsPerToken *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview); }
+UPB_INLINE int64_t grpc_lb_v1_ClientStatsPerToken_num_calls(const grpc_lb_v1_ClientStatsPerToken *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int64_t); }
UPB_INLINE void grpc_lb_v1_ClientStatsPerToken_set_load_balance_token(grpc_lb_v1_ClientStatsPerToken *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview) = value;
}
UPB_INLINE void grpc_lb_v1_ClientStatsPerToken_set_num_calls(grpc_lb_v1_ClientStatsPerToken *msg, int64_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int64_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int64_t) = value;
}
/* grpc.lb.v1.ClientStats */
UPB_INLINE grpc_lb_v1_ClientStats *grpc_lb_v1_ClientStats_new(upb_arena *arena) {
- return (grpc_lb_v1_ClientStats *)_upb_msg_new(&grpc_lb_v1_ClientStats_msginit, arena);
+ return (grpc_lb_v1_ClientStats *)_upb_msg_new(&grpc_lb_v1_ClientStats_msginit, arena);
}
UPB_INLINE grpc_lb_v1_ClientStats *grpc_lb_v1_ClientStats_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -161,47 +161,47 @@ UPB_INLINE char *grpc_lb_v1_ClientStats_serialize(const grpc_lb_v1_ClientStats *
return upb_encode(msg, &grpc_lb_v1_ClientStats_msginit, arena, len);
}
-UPB_INLINE bool grpc_lb_v1_ClientStats_has_timestamp(const grpc_lb_v1_ClientStats *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(32, 32)); }
-UPB_INLINE const struct google_protobuf_Timestamp* grpc_lb_v1_ClientStats_timestamp(const grpc_lb_v1_ClientStats *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 32), const struct google_protobuf_Timestamp*); }
-UPB_INLINE int64_t grpc_lb_v1_ClientStats_num_calls_started(const grpc_lb_v1_ClientStats *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int64_t); }
-UPB_INLINE int64_t grpc_lb_v1_ClientStats_num_calls_finished(const grpc_lb_v1_ClientStats *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int64_t); }
-UPB_INLINE int64_t grpc_lb_v1_ClientStats_num_calls_finished_with_client_failed_to_send(const grpc_lb_v1_ClientStats *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int64_t); }
-UPB_INLINE int64_t grpc_lb_v1_ClientStats_num_calls_finished_known_received(const grpc_lb_v1_ClientStats *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), int64_t); }
-UPB_INLINE bool grpc_lb_v1_ClientStats_has_calls_finished_with_drop(const grpc_lb_v1_ClientStats *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(36, 40)); }
+UPB_INLINE bool grpc_lb_v1_ClientStats_has_timestamp(const grpc_lb_v1_ClientStats *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(32, 32)); }
+UPB_INLINE const struct google_protobuf_Timestamp* grpc_lb_v1_ClientStats_timestamp(const grpc_lb_v1_ClientStats *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 32), const struct google_protobuf_Timestamp*); }
+UPB_INLINE int64_t grpc_lb_v1_ClientStats_num_calls_started(const grpc_lb_v1_ClientStats *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int64_t); }
+UPB_INLINE int64_t grpc_lb_v1_ClientStats_num_calls_finished(const grpc_lb_v1_ClientStats *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int64_t); }
+UPB_INLINE int64_t grpc_lb_v1_ClientStats_num_calls_finished_with_client_failed_to_send(const grpc_lb_v1_ClientStats *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int64_t); }
+UPB_INLINE int64_t grpc_lb_v1_ClientStats_num_calls_finished_known_received(const grpc_lb_v1_ClientStats *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), int64_t); }
+UPB_INLINE bool grpc_lb_v1_ClientStats_has_calls_finished_with_drop(const grpc_lb_v1_ClientStats *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(36, 40)); }
UPB_INLINE const grpc_lb_v1_ClientStatsPerToken* const* grpc_lb_v1_ClientStats_calls_finished_with_drop(const grpc_lb_v1_ClientStats *msg, size_t *len) { return (const grpc_lb_v1_ClientStatsPerToken* const*)_upb_array_accessor(msg, UPB_SIZE(36, 40), len); }
UPB_INLINE void grpc_lb_v1_ClientStats_set_timestamp(grpc_lb_v1_ClientStats *msg, struct google_protobuf_Timestamp* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(32, 32), struct google_protobuf_Timestamp*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 32), struct google_protobuf_Timestamp*) = value;
}
UPB_INLINE struct google_protobuf_Timestamp* grpc_lb_v1_ClientStats_mutable_timestamp(grpc_lb_v1_ClientStats *msg, upb_arena *arena) {
struct google_protobuf_Timestamp* sub = (struct google_protobuf_Timestamp*)grpc_lb_v1_ClientStats_timestamp(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_Timestamp*)_upb_msg_new(&google_protobuf_Timestamp_msginit, arena);
+ sub = (struct google_protobuf_Timestamp*)_upb_msg_new(&google_protobuf_Timestamp_msginit, arena);
if (!sub) return NULL;
grpc_lb_v1_ClientStats_set_timestamp(msg, sub);
}
return sub;
}
UPB_INLINE void grpc_lb_v1_ClientStats_set_num_calls_started(grpc_lb_v1_ClientStats *msg, int64_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int64_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int64_t) = value;
}
UPB_INLINE void grpc_lb_v1_ClientStats_set_num_calls_finished(grpc_lb_v1_ClientStats *msg, int64_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int64_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int64_t) = value;
}
UPB_INLINE void grpc_lb_v1_ClientStats_set_num_calls_finished_with_client_failed_to_send(grpc_lb_v1_ClientStats *msg, int64_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int64_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int64_t) = value;
}
UPB_INLINE void grpc_lb_v1_ClientStats_set_num_calls_finished_known_received(grpc_lb_v1_ClientStats *msg, int64_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(24, 24), int64_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 24), int64_t) = value;
}
UPB_INLINE grpc_lb_v1_ClientStatsPerToken** grpc_lb_v1_ClientStats_mutable_calls_finished_with_drop(grpc_lb_v1_ClientStats *msg, size_t *len) {
return (grpc_lb_v1_ClientStatsPerToken**)_upb_array_mutable_accessor(msg, UPB_SIZE(36, 40), len);
}
UPB_INLINE grpc_lb_v1_ClientStatsPerToken** grpc_lb_v1_ClientStats_resize_calls_finished_with_drop(grpc_lb_v1_ClientStats *msg, size_t len, upb_arena *arena) {
- return (grpc_lb_v1_ClientStatsPerToken**)_upb_array_resize_accessor(msg, UPB_SIZE(36, 40), len, UPB_TYPE_MESSAGE, arena);
+ return (grpc_lb_v1_ClientStatsPerToken**)_upb_array_resize_accessor(msg, UPB_SIZE(36, 40), len, UPB_TYPE_MESSAGE, arena);
}
UPB_INLINE struct grpc_lb_v1_ClientStatsPerToken* grpc_lb_v1_ClientStats_add_calls_finished_with_drop(grpc_lb_v1_ClientStats *msg, upb_arena *arena) {
- struct grpc_lb_v1_ClientStatsPerToken* sub = (struct grpc_lb_v1_ClientStatsPerToken*)_upb_msg_new(&grpc_lb_v1_ClientStatsPerToken_msginit, arena);
+ struct grpc_lb_v1_ClientStatsPerToken* sub = (struct grpc_lb_v1_ClientStatsPerToken*)_upb_msg_new(&grpc_lb_v1_ClientStatsPerToken_msginit, arena);
bool ok = _upb_array_append_accessor(
msg, UPB_SIZE(36, 40), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
if (!ok) return NULL;
@@ -211,7 +211,7 @@ UPB_INLINE struct grpc_lb_v1_ClientStatsPerToken* grpc_lb_v1_ClientStats_add_cal
/* grpc.lb.v1.LoadBalanceResponse */
UPB_INLINE grpc_lb_v1_LoadBalanceResponse *grpc_lb_v1_LoadBalanceResponse_new(upb_arena *arena) {
- return (grpc_lb_v1_LoadBalanceResponse *)_upb_msg_new(&grpc_lb_v1_LoadBalanceResponse_msginit, arena);
+ return (grpc_lb_v1_LoadBalanceResponse *)_upb_msg_new(&grpc_lb_v1_LoadBalanceResponse_msginit, arena);
}
UPB_INLINE grpc_lb_v1_LoadBalanceResponse *grpc_lb_v1_LoadBalanceResponse_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -225,17 +225,17 @@ UPB_INLINE char *grpc_lb_v1_LoadBalanceResponse_serialize(const grpc_lb_v1_LoadB
typedef enum {
grpc_lb_v1_LoadBalanceResponse_load_balance_response_type_initial_response = 1,
grpc_lb_v1_LoadBalanceResponse_load_balance_response_type_server_list = 2,
- grpc_lb_v1_LoadBalanceResponse_load_balance_response_type_fallback_response = 3,
+ grpc_lb_v1_LoadBalanceResponse_load_balance_response_type_fallback_response = 3,
grpc_lb_v1_LoadBalanceResponse_load_balance_response_type_NOT_SET = 0
} grpc_lb_v1_LoadBalanceResponse_load_balance_response_type_oneofcases;
-UPB_INLINE grpc_lb_v1_LoadBalanceResponse_load_balance_response_type_oneofcases grpc_lb_v1_LoadBalanceResponse_load_balance_response_type_case(const grpc_lb_v1_LoadBalanceResponse* msg) { return (grpc_lb_v1_LoadBalanceResponse_load_balance_response_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 8), int32_t); }
+UPB_INLINE grpc_lb_v1_LoadBalanceResponse_load_balance_response_type_oneofcases grpc_lb_v1_LoadBalanceResponse_load_balance_response_type_case(const grpc_lb_v1_LoadBalanceResponse* msg) { return (grpc_lb_v1_LoadBalanceResponse_load_balance_response_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 8), int32_t); }
-UPB_INLINE bool grpc_lb_v1_LoadBalanceResponse_has_initial_response(const grpc_lb_v1_LoadBalanceResponse *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 1; }
+UPB_INLINE bool grpc_lb_v1_LoadBalanceResponse_has_initial_response(const grpc_lb_v1_LoadBalanceResponse *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 1; }
UPB_INLINE const grpc_lb_v1_InitialLoadBalanceResponse* grpc_lb_v1_LoadBalanceResponse_initial_response(const grpc_lb_v1_LoadBalanceResponse *msg) { return UPB_READ_ONEOF(msg, const grpc_lb_v1_InitialLoadBalanceResponse*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 1, NULL); }
-UPB_INLINE bool grpc_lb_v1_LoadBalanceResponse_has_server_list(const grpc_lb_v1_LoadBalanceResponse *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 2; }
+UPB_INLINE bool grpc_lb_v1_LoadBalanceResponse_has_server_list(const grpc_lb_v1_LoadBalanceResponse *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 2; }
UPB_INLINE const grpc_lb_v1_ServerList* grpc_lb_v1_LoadBalanceResponse_server_list(const grpc_lb_v1_LoadBalanceResponse *msg) { return UPB_READ_ONEOF(msg, const grpc_lb_v1_ServerList*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 2, NULL); }
-UPB_INLINE bool grpc_lb_v1_LoadBalanceResponse_has_fallback_response(const grpc_lb_v1_LoadBalanceResponse *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 3; }
-UPB_INLINE const grpc_lb_v1_FallbackResponse* grpc_lb_v1_LoadBalanceResponse_fallback_response(const grpc_lb_v1_LoadBalanceResponse *msg) { return UPB_READ_ONEOF(msg, const grpc_lb_v1_FallbackResponse*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 3, NULL); }
+UPB_INLINE bool grpc_lb_v1_LoadBalanceResponse_has_fallback_response(const grpc_lb_v1_LoadBalanceResponse *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 3; }
+UPB_INLINE const grpc_lb_v1_FallbackResponse* grpc_lb_v1_LoadBalanceResponse_fallback_response(const grpc_lb_v1_LoadBalanceResponse *msg) { return UPB_READ_ONEOF(msg, const grpc_lb_v1_FallbackResponse*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 3, NULL); }
UPB_INLINE void grpc_lb_v1_LoadBalanceResponse_set_initial_response(grpc_lb_v1_LoadBalanceResponse *msg, grpc_lb_v1_InitialLoadBalanceResponse* value) {
UPB_WRITE_ONEOF(msg, grpc_lb_v1_InitialLoadBalanceResponse*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 1);
@@ -243,7 +243,7 @@ UPB_INLINE void grpc_lb_v1_LoadBalanceResponse_set_initial_response(grpc_lb_v1_L
UPB_INLINE struct grpc_lb_v1_InitialLoadBalanceResponse* grpc_lb_v1_LoadBalanceResponse_mutable_initial_response(grpc_lb_v1_LoadBalanceResponse *msg, upb_arena *arena) {
struct grpc_lb_v1_InitialLoadBalanceResponse* sub = (struct grpc_lb_v1_InitialLoadBalanceResponse*)grpc_lb_v1_LoadBalanceResponse_initial_response(msg);
if (sub == NULL) {
- sub = (struct grpc_lb_v1_InitialLoadBalanceResponse*)_upb_msg_new(&grpc_lb_v1_InitialLoadBalanceResponse_msginit, arena);
+ sub = (struct grpc_lb_v1_InitialLoadBalanceResponse*)_upb_msg_new(&grpc_lb_v1_InitialLoadBalanceResponse_msginit, arena);
if (!sub) return NULL;
grpc_lb_v1_LoadBalanceResponse_set_initial_response(msg, sub);
}
@@ -255,29 +255,29 @@ UPB_INLINE void grpc_lb_v1_LoadBalanceResponse_set_server_list(grpc_lb_v1_LoadBa
UPB_INLINE struct grpc_lb_v1_ServerList* grpc_lb_v1_LoadBalanceResponse_mutable_server_list(grpc_lb_v1_LoadBalanceResponse *msg, upb_arena *arena) {
struct grpc_lb_v1_ServerList* sub = (struct grpc_lb_v1_ServerList*)grpc_lb_v1_LoadBalanceResponse_server_list(msg);
if (sub == NULL) {
- sub = (struct grpc_lb_v1_ServerList*)_upb_msg_new(&grpc_lb_v1_ServerList_msginit, arena);
+ sub = (struct grpc_lb_v1_ServerList*)_upb_msg_new(&grpc_lb_v1_ServerList_msginit, arena);
if (!sub) return NULL;
grpc_lb_v1_LoadBalanceResponse_set_server_list(msg, sub);
}
return sub;
}
-UPB_INLINE void grpc_lb_v1_LoadBalanceResponse_set_fallback_response(grpc_lb_v1_LoadBalanceResponse *msg, grpc_lb_v1_FallbackResponse* value) {
- UPB_WRITE_ONEOF(msg, grpc_lb_v1_FallbackResponse*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 3);
-}
-UPB_INLINE struct grpc_lb_v1_FallbackResponse* grpc_lb_v1_LoadBalanceResponse_mutable_fallback_response(grpc_lb_v1_LoadBalanceResponse *msg, upb_arena *arena) {
- struct grpc_lb_v1_FallbackResponse* sub = (struct grpc_lb_v1_FallbackResponse*)grpc_lb_v1_LoadBalanceResponse_fallback_response(msg);
- if (sub == NULL) {
- sub = (struct grpc_lb_v1_FallbackResponse*)_upb_msg_new(&grpc_lb_v1_FallbackResponse_msginit, arena);
- if (!sub) return NULL;
- grpc_lb_v1_LoadBalanceResponse_set_fallback_response(msg, sub);
- }
- return sub;
-}
+UPB_INLINE void grpc_lb_v1_LoadBalanceResponse_set_fallback_response(grpc_lb_v1_LoadBalanceResponse *msg, grpc_lb_v1_FallbackResponse* value) {
+ UPB_WRITE_ONEOF(msg, grpc_lb_v1_FallbackResponse*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 3);
+}
+UPB_INLINE struct grpc_lb_v1_FallbackResponse* grpc_lb_v1_LoadBalanceResponse_mutable_fallback_response(grpc_lb_v1_LoadBalanceResponse *msg, upb_arena *arena) {
+ struct grpc_lb_v1_FallbackResponse* sub = (struct grpc_lb_v1_FallbackResponse*)grpc_lb_v1_LoadBalanceResponse_fallback_response(msg);
+ if (sub == NULL) {
+ sub = (struct grpc_lb_v1_FallbackResponse*)_upb_msg_new(&grpc_lb_v1_FallbackResponse_msginit, arena);
+ if (!sub) return NULL;
+ grpc_lb_v1_LoadBalanceResponse_set_fallback_response(msg, sub);
+ }
+ return sub;
+}
/* grpc.lb.v1.InitialLoadBalanceResponse */
UPB_INLINE grpc_lb_v1_InitialLoadBalanceResponse *grpc_lb_v1_InitialLoadBalanceResponse_new(upb_arena *arena) {
- return (grpc_lb_v1_InitialLoadBalanceResponse *)_upb_msg_new(&grpc_lb_v1_InitialLoadBalanceResponse_msginit, arena);
+ return (grpc_lb_v1_InitialLoadBalanceResponse *)_upb_msg_new(&grpc_lb_v1_InitialLoadBalanceResponse_msginit, arena);
}
UPB_INLINE grpc_lb_v1_InitialLoadBalanceResponse *grpc_lb_v1_InitialLoadBalanceResponse_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -288,20 +288,20 @@ UPB_INLINE char *grpc_lb_v1_InitialLoadBalanceResponse_serialize(const grpc_lb_v
return upb_encode(msg, &grpc_lb_v1_InitialLoadBalanceResponse_msginit, arena, len);
}
-UPB_INLINE upb_strview grpc_lb_v1_InitialLoadBalanceResponse_load_balancer_delegate(const grpc_lb_v1_InitialLoadBalanceResponse *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE bool grpc_lb_v1_InitialLoadBalanceResponse_has_client_stats_report_interval(const grpc_lb_v1_InitialLoadBalanceResponse *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const struct google_protobuf_Duration* grpc_lb_v1_InitialLoadBalanceResponse_client_stats_report_interval(const grpc_lb_v1_InitialLoadBalanceResponse *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_Duration*); }
+UPB_INLINE upb_strview grpc_lb_v1_InitialLoadBalanceResponse_load_balancer_delegate(const grpc_lb_v1_InitialLoadBalanceResponse *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE bool grpc_lb_v1_InitialLoadBalanceResponse_has_client_stats_report_interval(const grpc_lb_v1_InitialLoadBalanceResponse *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
+UPB_INLINE const struct google_protobuf_Duration* grpc_lb_v1_InitialLoadBalanceResponse_client_stats_report_interval(const grpc_lb_v1_InitialLoadBalanceResponse *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_Duration*); }
UPB_INLINE void grpc_lb_v1_InitialLoadBalanceResponse_set_load_balancer_delegate(grpc_lb_v1_InitialLoadBalanceResponse *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
}
UPB_INLINE void grpc_lb_v1_InitialLoadBalanceResponse_set_client_stats_report_interval(grpc_lb_v1_InitialLoadBalanceResponse *msg, struct google_protobuf_Duration* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_Duration*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_Duration*) = value;
}
UPB_INLINE struct google_protobuf_Duration* grpc_lb_v1_InitialLoadBalanceResponse_mutable_client_stats_report_interval(grpc_lb_v1_InitialLoadBalanceResponse *msg, upb_arena *arena) {
struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)grpc_lb_v1_InitialLoadBalanceResponse_client_stats_report_interval(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
+ sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
if (!sub) return NULL;
grpc_lb_v1_InitialLoadBalanceResponse_set_client_stats_report_interval(msg, sub);
}
@@ -311,7 +311,7 @@ UPB_INLINE struct google_protobuf_Duration* grpc_lb_v1_InitialLoadBalanceRespons
/* grpc.lb.v1.ServerList */
UPB_INLINE grpc_lb_v1_ServerList *grpc_lb_v1_ServerList_new(upb_arena *arena) {
- return (grpc_lb_v1_ServerList *)_upb_msg_new(&grpc_lb_v1_ServerList_msginit, arena);
+ return (grpc_lb_v1_ServerList *)_upb_msg_new(&grpc_lb_v1_ServerList_msginit, arena);
}
UPB_INLINE grpc_lb_v1_ServerList *grpc_lb_v1_ServerList_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -322,17 +322,17 @@ UPB_INLINE char *grpc_lb_v1_ServerList_serialize(const grpc_lb_v1_ServerList *ms
return upb_encode(msg, &grpc_lb_v1_ServerList_msginit, arena, len);
}
-UPB_INLINE bool grpc_lb_v1_ServerList_has_servers(const grpc_lb_v1_ServerList *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE bool grpc_lb_v1_ServerList_has_servers(const grpc_lb_v1_ServerList *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
UPB_INLINE const grpc_lb_v1_Server* const* grpc_lb_v1_ServerList_servers(const grpc_lb_v1_ServerList *msg, size_t *len) { return (const grpc_lb_v1_Server* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
UPB_INLINE grpc_lb_v1_Server** grpc_lb_v1_ServerList_mutable_servers(grpc_lb_v1_ServerList *msg, size_t *len) {
return (grpc_lb_v1_Server**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
}
UPB_INLINE grpc_lb_v1_Server** grpc_lb_v1_ServerList_resize_servers(grpc_lb_v1_ServerList *msg, size_t len, upb_arena *arena) {
- return (grpc_lb_v1_Server**)_upb_array_resize_accessor(msg, UPB_SIZE(0, 0), len, UPB_TYPE_MESSAGE, arena);
+ return (grpc_lb_v1_Server**)_upb_array_resize_accessor(msg, UPB_SIZE(0, 0), len, UPB_TYPE_MESSAGE, arena);
}
UPB_INLINE struct grpc_lb_v1_Server* grpc_lb_v1_ServerList_add_servers(grpc_lb_v1_ServerList *msg, upb_arena *arena) {
- struct grpc_lb_v1_Server* sub = (struct grpc_lb_v1_Server*)_upb_msg_new(&grpc_lb_v1_Server_msginit, arena);
+ struct grpc_lb_v1_Server* sub = (struct grpc_lb_v1_Server*)_upb_msg_new(&grpc_lb_v1_Server_msginit, arena);
bool ok = _upb_array_append_accessor(
msg, UPB_SIZE(0, 0), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
if (!ok) return NULL;
@@ -342,7 +342,7 @@ UPB_INLINE struct grpc_lb_v1_Server* grpc_lb_v1_ServerList_add_servers(grpc_lb_v
/* grpc.lb.v1.Server */
UPB_INLINE grpc_lb_v1_Server *grpc_lb_v1_Server_new(upb_arena *arena) {
- return (grpc_lb_v1_Server *)_upb_msg_new(&grpc_lb_v1_Server_msginit, arena);
+ return (grpc_lb_v1_Server *)_upb_msg_new(&grpc_lb_v1_Server_msginit, arena);
}
UPB_INLINE grpc_lb_v1_Server *grpc_lb_v1_Server_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -353,40 +353,40 @@ UPB_INLINE char *grpc_lb_v1_Server_serialize(const grpc_lb_v1_Server *msg, upb_a
return upb_encode(msg, &grpc_lb_v1_Server_msginit, arena, len);
}
-UPB_INLINE upb_strview grpc_lb_v1_Server_ip_address(const grpc_lb_v1_Server *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview); }
-UPB_INLINE int32_t grpc_lb_v1_Server_port(const grpc_lb_v1_Server *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
-UPB_INLINE upb_strview grpc_lb_v1_Server_load_balance_token(const grpc_lb_v1_Server *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_strview); }
-UPB_INLINE bool grpc_lb_v1_Server_drop(const grpc_lb_v1_Server *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool); }
+UPB_INLINE upb_strview grpc_lb_v1_Server_ip_address(const grpc_lb_v1_Server *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview); }
+UPB_INLINE int32_t grpc_lb_v1_Server_port(const grpc_lb_v1_Server *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
+UPB_INLINE upb_strview grpc_lb_v1_Server_load_balance_token(const grpc_lb_v1_Server *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_strview); }
+UPB_INLINE bool grpc_lb_v1_Server_drop(const grpc_lb_v1_Server *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool); }
UPB_INLINE void grpc_lb_v1_Server_set_ip_address(grpc_lb_v1_Server *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview) = value;
}
UPB_INLINE void grpc_lb_v1_Server_set_port(grpc_lb_v1_Server *msg, int32_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
}
UPB_INLINE void grpc_lb_v1_Server_set_load_balance_token(grpc_lb_v1_Server *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_strview) = value;
}
UPB_INLINE void grpc_lb_v1_Server_set_drop(grpc_lb_v1_Server *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool) = value;
-}
-
-/* grpc.lb.v1.FallbackResponse */
-
-UPB_INLINE grpc_lb_v1_FallbackResponse *grpc_lb_v1_FallbackResponse_new(upb_arena *arena) {
- return (grpc_lb_v1_FallbackResponse *)_upb_msg_new(&grpc_lb_v1_FallbackResponse_msginit, arena);
-}
-UPB_INLINE grpc_lb_v1_FallbackResponse *grpc_lb_v1_FallbackResponse_parse(const char *buf, size_t size,
- upb_arena *arena) {
- grpc_lb_v1_FallbackResponse *ret = grpc_lb_v1_FallbackResponse_new(arena);
- return (ret && upb_decode(buf, size, ret, &grpc_lb_v1_FallbackResponse_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *grpc_lb_v1_FallbackResponse_serialize(const grpc_lb_v1_FallbackResponse *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &grpc_lb_v1_FallbackResponse_msginit, arena, len);
-}
-
-
-
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool) = value;
+}
+
+/* grpc.lb.v1.FallbackResponse */
+
+UPB_INLINE grpc_lb_v1_FallbackResponse *grpc_lb_v1_FallbackResponse_new(upb_arena *arena) {
+ return (grpc_lb_v1_FallbackResponse *)_upb_msg_new(&grpc_lb_v1_FallbackResponse_msginit, arena);
+}
+UPB_INLINE grpc_lb_v1_FallbackResponse *grpc_lb_v1_FallbackResponse_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ grpc_lb_v1_FallbackResponse *ret = grpc_lb_v1_FallbackResponse_new(arena);
+ return (ret && upb_decode(buf, size, ret, &grpc_lb_v1_FallbackResponse_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *grpc_lb_v1_FallbackResponse_serialize(const grpc_lb_v1_FallbackResponse *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &grpc_lb_v1_FallbackResponse_msginit, arena, len);
+}
+
+
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/migrate.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/migrate.upb.c
index 5488dd814dc..fcf32a608bb 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/migrate.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/migrate.upb.c
@@ -1,48 +1,48 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * udpa/annotations/migrate.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include <stddef.h>
-#include "upb/msg.h"
-#include "udpa/annotations/migrate.upb.h"
-#include "google/protobuf/descriptor.upb.h"
-
-#include "upb/port_def.inc"
-
-static const upb_msglayout_field udpa_annotations_MigrateAnnotation__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
-};
-
-const upb_msglayout udpa_annotations_MigrateAnnotation_msginit = {
- NULL,
- &udpa_annotations_MigrateAnnotation__fields[0],
- UPB_SIZE(8, 16), 1, false,
-};
-
-static const upb_msglayout_field udpa_annotations_FieldMigrateAnnotation__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 9, 1},
-};
-
-const upb_msglayout udpa_annotations_FieldMigrateAnnotation_msginit = {
- NULL,
- &udpa_annotations_FieldMigrateAnnotation__fields[0],
- UPB_SIZE(16, 32), 2, false,
-};
-
-static const upb_msglayout_field udpa_annotations_FileMigrateAnnotation__fields[1] = {
- {2, UPB_SIZE(0, 0), 0, 0, 9, 1},
-};
-
-const upb_msglayout udpa_annotations_FileMigrateAnnotation_msginit = {
- NULL,
- &udpa_annotations_FileMigrateAnnotation__fields[0],
- UPB_SIZE(8, 16), 1, false,
-};
-
-#include "upb/port_undef.inc"
-
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * udpa/annotations/migrate.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg.h"
+#include "udpa/annotations/migrate.upb.h"
+#include "google/protobuf/descriptor.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_msglayout_field udpa_annotations_MigrateAnnotation__fields[1] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+};
+
+const upb_msglayout udpa_annotations_MigrateAnnotation_msginit = {
+ NULL,
+ &udpa_annotations_MigrateAnnotation__fields[0],
+ UPB_SIZE(8, 16), 1, false,
+};
+
+static const upb_msglayout_field udpa_annotations_FieldMigrateAnnotation__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {2, UPB_SIZE(8, 16), 0, 0, 9, 1},
+};
+
+const upb_msglayout udpa_annotations_FieldMigrateAnnotation_msginit = {
+ NULL,
+ &udpa_annotations_FieldMigrateAnnotation__fields[0],
+ UPB_SIZE(16, 32), 2, false,
+};
+
+static const upb_msglayout_field udpa_annotations_FileMigrateAnnotation__fields[1] = {
+ {2, UPB_SIZE(0, 0), 0, 0, 9, 1},
+};
+
+const upb_msglayout udpa_annotations_FileMigrateAnnotation_msginit = {
+ NULL,
+ &udpa_annotations_FileMigrateAnnotation__fields[0],
+ UPB_SIZE(8, 16), 1, false,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/migrate.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/migrate.upb.h
index 6ce90cf8e1c..d6a3d0cc5b1 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/migrate.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/migrate.upb.h
@@ -1,103 +1,103 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * udpa/annotations/migrate.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef UDPA_ANNOTATIONS_MIGRATE_PROTO_UPB_H_
-#define UDPA_ANNOTATIONS_MIGRATE_PROTO_UPB_H_
-
-#include "upb/msg.h"
-#include "upb/decode.h"
-#include "upb/encode.h"
-
-#include "upb/port_def.inc"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct udpa_annotations_MigrateAnnotation;
-struct udpa_annotations_FieldMigrateAnnotation;
-struct udpa_annotations_FileMigrateAnnotation;
-typedef struct udpa_annotations_MigrateAnnotation udpa_annotations_MigrateAnnotation;
-typedef struct udpa_annotations_FieldMigrateAnnotation udpa_annotations_FieldMigrateAnnotation;
-typedef struct udpa_annotations_FileMigrateAnnotation udpa_annotations_FileMigrateAnnotation;
-extern const upb_msglayout udpa_annotations_MigrateAnnotation_msginit;
-extern const upb_msglayout udpa_annotations_FieldMigrateAnnotation_msginit;
-extern const upb_msglayout udpa_annotations_FileMigrateAnnotation_msginit;
-
-
-/* udpa.annotations.MigrateAnnotation */
-
-UPB_INLINE udpa_annotations_MigrateAnnotation *udpa_annotations_MigrateAnnotation_new(upb_arena *arena) {
- return (udpa_annotations_MigrateAnnotation *)_upb_msg_new(&udpa_annotations_MigrateAnnotation_msginit, arena);
-}
-UPB_INLINE udpa_annotations_MigrateAnnotation *udpa_annotations_MigrateAnnotation_parse(const char *buf, size_t size,
- upb_arena *arena) {
- udpa_annotations_MigrateAnnotation *ret = udpa_annotations_MigrateAnnotation_new(arena);
- return (ret && upb_decode(buf, size, ret, &udpa_annotations_MigrateAnnotation_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *udpa_annotations_MigrateAnnotation_serialize(const udpa_annotations_MigrateAnnotation *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &udpa_annotations_MigrateAnnotation_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview udpa_annotations_MigrateAnnotation_rename(const udpa_annotations_MigrateAnnotation *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-
-UPB_INLINE void udpa_annotations_MigrateAnnotation_set_rename(udpa_annotations_MigrateAnnotation *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-
-/* udpa.annotations.FieldMigrateAnnotation */
-
-UPB_INLINE udpa_annotations_FieldMigrateAnnotation *udpa_annotations_FieldMigrateAnnotation_new(upb_arena *arena) {
- return (udpa_annotations_FieldMigrateAnnotation *)_upb_msg_new(&udpa_annotations_FieldMigrateAnnotation_msginit, arena);
-}
-UPB_INLINE udpa_annotations_FieldMigrateAnnotation *udpa_annotations_FieldMigrateAnnotation_parse(const char *buf, size_t size,
- upb_arena *arena) {
- udpa_annotations_FieldMigrateAnnotation *ret = udpa_annotations_FieldMigrateAnnotation_new(arena);
- return (ret && upb_decode(buf, size, ret, &udpa_annotations_FieldMigrateAnnotation_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *udpa_annotations_FieldMigrateAnnotation_serialize(const udpa_annotations_FieldMigrateAnnotation *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &udpa_annotations_FieldMigrateAnnotation_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview udpa_annotations_FieldMigrateAnnotation_rename(const udpa_annotations_FieldMigrateAnnotation *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE upb_strview udpa_annotations_FieldMigrateAnnotation_oneof_promotion(const udpa_annotations_FieldMigrateAnnotation *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview); }
-
-UPB_INLINE void udpa_annotations_FieldMigrateAnnotation_set_rename(udpa_annotations_FieldMigrateAnnotation *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-UPB_INLINE void udpa_annotations_FieldMigrateAnnotation_set_oneof_promotion(udpa_annotations_FieldMigrateAnnotation *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview) = value;
-}
-
-/* udpa.annotations.FileMigrateAnnotation */
-
-UPB_INLINE udpa_annotations_FileMigrateAnnotation *udpa_annotations_FileMigrateAnnotation_new(upb_arena *arena) {
- return (udpa_annotations_FileMigrateAnnotation *)_upb_msg_new(&udpa_annotations_FileMigrateAnnotation_msginit, arena);
-}
-UPB_INLINE udpa_annotations_FileMigrateAnnotation *udpa_annotations_FileMigrateAnnotation_parse(const char *buf, size_t size,
- upb_arena *arena) {
- udpa_annotations_FileMigrateAnnotation *ret = udpa_annotations_FileMigrateAnnotation_new(arena);
- return (ret && upb_decode(buf, size, ret, &udpa_annotations_FileMigrateAnnotation_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *udpa_annotations_FileMigrateAnnotation_serialize(const udpa_annotations_FileMigrateAnnotation *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &udpa_annotations_FileMigrateAnnotation_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview udpa_annotations_FileMigrateAnnotation_move_to_package(const udpa_annotations_FileMigrateAnnotation *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-
-UPB_INLINE void udpa_annotations_FileMigrateAnnotation_set_move_to_package(udpa_annotations_FileMigrateAnnotation *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* UDPA_ANNOTATIONS_MIGRATE_PROTO_UPB_H_ */
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * udpa/annotations/migrate.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef UDPA_ANNOTATIONS_MIGRATE_PROTO_UPB_H_
+#define UDPA_ANNOTATIONS_MIGRATE_PROTO_UPB_H_
+
+#include "upb/msg.h"
+#include "upb/decode.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct udpa_annotations_MigrateAnnotation;
+struct udpa_annotations_FieldMigrateAnnotation;
+struct udpa_annotations_FileMigrateAnnotation;
+typedef struct udpa_annotations_MigrateAnnotation udpa_annotations_MigrateAnnotation;
+typedef struct udpa_annotations_FieldMigrateAnnotation udpa_annotations_FieldMigrateAnnotation;
+typedef struct udpa_annotations_FileMigrateAnnotation udpa_annotations_FileMigrateAnnotation;
+extern const upb_msglayout udpa_annotations_MigrateAnnotation_msginit;
+extern const upb_msglayout udpa_annotations_FieldMigrateAnnotation_msginit;
+extern const upb_msglayout udpa_annotations_FileMigrateAnnotation_msginit;
+
+
+/* udpa.annotations.MigrateAnnotation */
+
+UPB_INLINE udpa_annotations_MigrateAnnotation *udpa_annotations_MigrateAnnotation_new(upb_arena *arena) {
+ return (udpa_annotations_MigrateAnnotation *)_upb_msg_new(&udpa_annotations_MigrateAnnotation_msginit, arena);
+}
+UPB_INLINE udpa_annotations_MigrateAnnotation *udpa_annotations_MigrateAnnotation_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ udpa_annotations_MigrateAnnotation *ret = udpa_annotations_MigrateAnnotation_new(arena);
+ return (ret && upb_decode(buf, size, ret, &udpa_annotations_MigrateAnnotation_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *udpa_annotations_MigrateAnnotation_serialize(const udpa_annotations_MigrateAnnotation *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &udpa_annotations_MigrateAnnotation_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview udpa_annotations_MigrateAnnotation_rename(const udpa_annotations_MigrateAnnotation *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+
+UPB_INLINE void udpa_annotations_MigrateAnnotation_set_rename(udpa_annotations_MigrateAnnotation *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+
+/* udpa.annotations.FieldMigrateAnnotation */
+
+UPB_INLINE udpa_annotations_FieldMigrateAnnotation *udpa_annotations_FieldMigrateAnnotation_new(upb_arena *arena) {
+ return (udpa_annotations_FieldMigrateAnnotation *)_upb_msg_new(&udpa_annotations_FieldMigrateAnnotation_msginit, arena);
+}
+UPB_INLINE udpa_annotations_FieldMigrateAnnotation *udpa_annotations_FieldMigrateAnnotation_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ udpa_annotations_FieldMigrateAnnotation *ret = udpa_annotations_FieldMigrateAnnotation_new(arena);
+ return (ret && upb_decode(buf, size, ret, &udpa_annotations_FieldMigrateAnnotation_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *udpa_annotations_FieldMigrateAnnotation_serialize(const udpa_annotations_FieldMigrateAnnotation *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &udpa_annotations_FieldMigrateAnnotation_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview udpa_annotations_FieldMigrateAnnotation_rename(const udpa_annotations_FieldMigrateAnnotation *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE upb_strview udpa_annotations_FieldMigrateAnnotation_oneof_promotion(const udpa_annotations_FieldMigrateAnnotation *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview); }
+
+UPB_INLINE void udpa_annotations_FieldMigrateAnnotation_set_rename(udpa_annotations_FieldMigrateAnnotation *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+UPB_INLINE void udpa_annotations_FieldMigrateAnnotation_set_oneof_promotion(udpa_annotations_FieldMigrateAnnotation *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview) = value;
+}
+
+/* udpa.annotations.FileMigrateAnnotation */
+
+UPB_INLINE udpa_annotations_FileMigrateAnnotation *udpa_annotations_FileMigrateAnnotation_new(upb_arena *arena) {
+ return (udpa_annotations_FileMigrateAnnotation *)_upb_msg_new(&udpa_annotations_FileMigrateAnnotation_msginit, arena);
+}
+UPB_INLINE udpa_annotations_FileMigrateAnnotation *udpa_annotations_FileMigrateAnnotation_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ udpa_annotations_FileMigrateAnnotation *ret = udpa_annotations_FileMigrateAnnotation_new(arena);
+ return (ret && upb_decode(buf, size, ret, &udpa_annotations_FileMigrateAnnotation_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *udpa_annotations_FileMigrateAnnotation_serialize(const udpa_annotations_FileMigrateAnnotation *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &udpa_annotations_FileMigrateAnnotation_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview udpa_annotations_FileMigrateAnnotation_move_to_package(const udpa_annotations_FileMigrateAnnotation *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+
+UPB_INLINE void udpa_annotations_FileMigrateAnnotation_set_move_to_package(udpa_annotations_FileMigrateAnnotation *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* UDPA_ANNOTATIONS_MIGRATE_PROTO_UPB_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/security.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/security.upb.c
index f0a23f48fa0..ebba91cd7d4 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/security.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/security.upb.c
@@ -1,31 +1,31 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * udpa/annotations/security.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include <stddef.h>
-#include "upb/msg.h"
-#include "udpa/annotations/security.upb.h"
-#include "udpa/annotations/status.upb.h"
-#include "google/protobuf/any.upb.h"
-#include "google/protobuf/descriptor.upb.h"
-#include "validate/validate.upb.h"
-
-#include "upb/port_def.inc"
-
-static const upb_msglayout_field udpa_annotations_FieldSecurityAnnotation__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 8, 1},
- {2, UPB_SIZE(1, 1), 0, 0, 8, 1},
-};
-
-const upb_msglayout udpa_annotations_FieldSecurityAnnotation_msginit = {
- NULL,
- &udpa_annotations_FieldSecurityAnnotation__fields[0],
- UPB_SIZE(2, 2), 2, false,
-};
-
-#include "upb/port_undef.inc"
-
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * udpa/annotations/security.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg.h"
+#include "udpa/annotations/security.upb.h"
+#include "udpa/annotations/status.upb.h"
+#include "google/protobuf/any.upb.h"
+#include "google/protobuf/descriptor.upb.h"
+#include "validate/validate.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_msglayout_field udpa_annotations_FieldSecurityAnnotation__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 8, 1},
+ {2, UPB_SIZE(1, 1), 0, 0, 8, 1},
+};
+
+const upb_msglayout udpa_annotations_FieldSecurityAnnotation_msginit = {
+ NULL,
+ &udpa_annotations_FieldSecurityAnnotation__fields[0],
+ UPB_SIZE(2, 2), 2, false,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/security.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/security.upb.h
index acb63308a17..89115fa1f9b 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/security.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/security.upb.h
@@ -1,57 +1,57 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * udpa/annotations/security.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef UDPA_ANNOTATIONS_SECURITY_PROTO_UPB_H_
-#define UDPA_ANNOTATIONS_SECURITY_PROTO_UPB_H_
-
-#include "upb/msg.h"
-#include "upb/decode.h"
-#include "upb/encode.h"
-
-#include "upb/port_def.inc"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct udpa_annotations_FieldSecurityAnnotation;
-typedef struct udpa_annotations_FieldSecurityAnnotation udpa_annotations_FieldSecurityAnnotation;
-extern const upb_msglayout udpa_annotations_FieldSecurityAnnotation_msginit;
-
-
-/* udpa.annotations.FieldSecurityAnnotation */
-
-UPB_INLINE udpa_annotations_FieldSecurityAnnotation *udpa_annotations_FieldSecurityAnnotation_new(upb_arena *arena) {
- return (udpa_annotations_FieldSecurityAnnotation *)_upb_msg_new(&udpa_annotations_FieldSecurityAnnotation_msginit, arena);
-}
-UPB_INLINE udpa_annotations_FieldSecurityAnnotation *udpa_annotations_FieldSecurityAnnotation_parse(const char *buf, size_t size,
- upb_arena *arena) {
- udpa_annotations_FieldSecurityAnnotation *ret = udpa_annotations_FieldSecurityAnnotation_new(arena);
- return (ret && upb_decode(buf, size, ret, &udpa_annotations_FieldSecurityAnnotation_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *udpa_annotations_FieldSecurityAnnotation_serialize(const udpa_annotations_FieldSecurityAnnotation *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &udpa_annotations_FieldSecurityAnnotation_msginit, arena, len);
-}
-
-UPB_INLINE bool udpa_annotations_FieldSecurityAnnotation_configure_for_untrusted_downstream(const udpa_annotations_FieldSecurityAnnotation *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); }
-UPB_INLINE bool udpa_annotations_FieldSecurityAnnotation_configure_for_untrusted_upstream(const udpa_annotations_FieldSecurityAnnotation *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); }
-
-UPB_INLINE void udpa_annotations_FieldSecurityAnnotation_set_configure_for_untrusted_downstream(udpa_annotations_FieldSecurityAnnotation *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
-}
-UPB_INLINE void udpa_annotations_FieldSecurityAnnotation_set_configure_for_untrusted_upstream(udpa_annotations_FieldSecurityAnnotation *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* UDPA_ANNOTATIONS_SECURITY_PROTO_UPB_H_ */
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * udpa/annotations/security.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef UDPA_ANNOTATIONS_SECURITY_PROTO_UPB_H_
+#define UDPA_ANNOTATIONS_SECURITY_PROTO_UPB_H_
+
+#include "upb/msg.h"
+#include "upb/decode.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct udpa_annotations_FieldSecurityAnnotation;
+typedef struct udpa_annotations_FieldSecurityAnnotation udpa_annotations_FieldSecurityAnnotation;
+extern const upb_msglayout udpa_annotations_FieldSecurityAnnotation_msginit;
+
+
+/* udpa.annotations.FieldSecurityAnnotation */
+
+UPB_INLINE udpa_annotations_FieldSecurityAnnotation *udpa_annotations_FieldSecurityAnnotation_new(upb_arena *arena) {
+ return (udpa_annotations_FieldSecurityAnnotation *)_upb_msg_new(&udpa_annotations_FieldSecurityAnnotation_msginit, arena);
+}
+UPB_INLINE udpa_annotations_FieldSecurityAnnotation *udpa_annotations_FieldSecurityAnnotation_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ udpa_annotations_FieldSecurityAnnotation *ret = udpa_annotations_FieldSecurityAnnotation_new(arena);
+ return (ret && upb_decode(buf, size, ret, &udpa_annotations_FieldSecurityAnnotation_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *udpa_annotations_FieldSecurityAnnotation_serialize(const udpa_annotations_FieldSecurityAnnotation *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &udpa_annotations_FieldSecurityAnnotation_msginit, arena, len);
+}
+
+UPB_INLINE bool udpa_annotations_FieldSecurityAnnotation_configure_for_untrusted_downstream(const udpa_annotations_FieldSecurityAnnotation *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); }
+UPB_INLINE bool udpa_annotations_FieldSecurityAnnotation_configure_for_untrusted_upstream(const udpa_annotations_FieldSecurityAnnotation *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); }
+
+UPB_INLINE void udpa_annotations_FieldSecurityAnnotation_set_configure_for_untrusted_downstream(udpa_annotations_FieldSecurityAnnotation *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
+}
+UPB_INLINE void udpa_annotations_FieldSecurityAnnotation_set_configure_for_untrusted_upstream(udpa_annotations_FieldSecurityAnnotation *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* UDPA_ANNOTATIONS_SECURITY_PROTO_UPB_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.c
index 7919a50806b..ca1fcb59aed 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.c
@@ -1,17 +1,17 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * udpa/annotations/sensitive.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include <stddef.h>
-#include "upb/msg.h"
-#include "udpa/annotations/sensitive.upb.h"
-#include "google/protobuf/descriptor.upb.h"
-
-#include "upb/port_def.inc"
-
-#include "upb/port_undef.inc"
-
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * udpa/annotations/sensitive.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg.h"
+#include "udpa/annotations/sensitive.upb.h"
+#include "google/protobuf/descriptor.upb.h"
+
+#include "upb/port_def.inc"
+
+#include "upb/port_undef.inc"
+
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.h
index 10c5019d8fa..e676115b85f 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.h
@@ -1,29 +1,29 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * udpa/annotations/sensitive.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef UDPA_ANNOTATIONS_SENSITIVE_PROTO_UPB_H_
-#define UDPA_ANNOTATIONS_SENSITIVE_PROTO_UPB_H_
-
-#include "upb/msg.h"
-#include "upb/decode.h"
-#include "upb/encode.h"
-
-#include "upb/port_def.inc"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* UDPA_ANNOTATIONS_SENSITIVE_PROTO_UPB_H_ */
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * udpa/annotations/sensitive.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef UDPA_ANNOTATIONS_SENSITIVE_PROTO_UPB_H_
+#define UDPA_ANNOTATIONS_SENSITIVE_PROTO_UPB_H_
+
+#include "upb/msg.h"
+#include "upb/decode.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* UDPA_ANNOTATIONS_SENSITIVE_PROTO_UPB_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/status.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/status.upb.c
index 377810d027e..05cb76c13a0 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/status.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/status.upb.c
@@ -1,28 +1,28 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * udpa/annotations/status.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include <stddef.h>
-#include "upb/msg.h"
-#include "udpa/annotations/status.upb.h"
-#include "google/protobuf/descriptor.upb.h"
-
-#include "upb/port_def.inc"
-
-static const upb_msglayout_field udpa_annotations_StatusAnnotation__fields[2] = {
- {1, UPB_SIZE(8, 8), 0, 0, 8, 1},
- {2, UPB_SIZE(0, 0), 0, 0, 14, 1},
-};
-
-const upb_msglayout udpa_annotations_StatusAnnotation_msginit = {
- NULL,
- &udpa_annotations_StatusAnnotation__fields[0],
- UPB_SIZE(16, 16), 2, false,
-};
-
-#include "upb/port_undef.inc"
-
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * udpa/annotations/status.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg.h"
+#include "udpa/annotations/status.upb.h"
+#include "google/protobuf/descriptor.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_msglayout_field udpa_annotations_StatusAnnotation__fields[2] = {
+ {1, UPB_SIZE(8, 8), 0, 0, 8, 1},
+ {2, UPB_SIZE(0, 0), 0, 0, 14, 1},
+};
+
+const upb_msglayout udpa_annotations_StatusAnnotation_msginit = {
+ NULL,
+ &udpa_annotations_StatusAnnotation__fields[0],
+ UPB_SIZE(16, 16), 2, false,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/status.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/status.upb.h
index ade8ec1917b..b6599e9b245 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/status.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/status.upb.h
@@ -1,64 +1,64 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * udpa/annotations/status.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef UDPA_ANNOTATIONS_STATUS_PROTO_UPB_H_
-#define UDPA_ANNOTATIONS_STATUS_PROTO_UPB_H_
-
-#include "upb/msg.h"
-#include "upb/decode.h"
-#include "upb/encode.h"
-
-#include "upb/port_def.inc"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct udpa_annotations_StatusAnnotation;
-typedef struct udpa_annotations_StatusAnnotation udpa_annotations_StatusAnnotation;
-extern const upb_msglayout udpa_annotations_StatusAnnotation_msginit;
-
-typedef enum {
- udpa_annotations_UNKNOWN = 0,
- udpa_annotations_FROZEN = 1,
- udpa_annotations_ACTIVE = 2,
- udpa_annotations_NEXT_MAJOR_VERSION_CANDIDATE = 3
-} udpa_annotations_PackageVersionStatus;
-
-
-/* udpa.annotations.StatusAnnotation */
-
-UPB_INLINE udpa_annotations_StatusAnnotation *udpa_annotations_StatusAnnotation_new(upb_arena *arena) {
- return (udpa_annotations_StatusAnnotation *)_upb_msg_new(&udpa_annotations_StatusAnnotation_msginit, arena);
-}
-UPB_INLINE udpa_annotations_StatusAnnotation *udpa_annotations_StatusAnnotation_parse(const char *buf, size_t size,
- upb_arena *arena) {
- udpa_annotations_StatusAnnotation *ret = udpa_annotations_StatusAnnotation_new(arena);
- return (ret && upb_decode(buf, size, ret, &udpa_annotations_StatusAnnotation_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *udpa_annotations_StatusAnnotation_serialize(const udpa_annotations_StatusAnnotation *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &udpa_annotations_StatusAnnotation_msginit, arena, len);
-}
-
-UPB_INLINE bool udpa_annotations_StatusAnnotation_work_in_progress(const udpa_annotations_StatusAnnotation *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool); }
-UPB_INLINE int32_t udpa_annotations_StatusAnnotation_package_version_status(const udpa_annotations_StatusAnnotation *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
-
-UPB_INLINE void udpa_annotations_StatusAnnotation_set_work_in_progress(udpa_annotations_StatusAnnotation *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = value;
-}
-UPB_INLINE void udpa_annotations_StatusAnnotation_set_package_version_status(udpa_annotations_StatusAnnotation *msg, int32_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* UDPA_ANNOTATIONS_STATUS_PROTO_UPB_H_ */
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * udpa/annotations/status.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef UDPA_ANNOTATIONS_STATUS_PROTO_UPB_H_
+#define UDPA_ANNOTATIONS_STATUS_PROTO_UPB_H_
+
+#include "upb/msg.h"
+#include "upb/decode.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct udpa_annotations_StatusAnnotation;
+typedef struct udpa_annotations_StatusAnnotation udpa_annotations_StatusAnnotation;
+extern const upb_msglayout udpa_annotations_StatusAnnotation_msginit;
+
+typedef enum {
+ udpa_annotations_UNKNOWN = 0,
+ udpa_annotations_FROZEN = 1,
+ udpa_annotations_ACTIVE = 2,
+ udpa_annotations_NEXT_MAJOR_VERSION_CANDIDATE = 3
+} udpa_annotations_PackageVersionStatus;
+
+
+/* udpa.annotations.StatusAnnotation */
+
+UPB_INLINE udpa_annotations_StatusAnnotation *udpa_annotations_StatusAnnotation_new(upb_arena *arena) {
+ return (udpa_annotations_StatusAnnotation *)_upb_msg_new(&udpa_annotations_StatusAnnotation_msginit, arena);
+}
+UPB_INLINE udpa_annotations_StatusAnnotation *udpa_annotations_StatusAnnotation_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ udpa_annotations_StatusAnnotation *ret = udpa_annotations_StatusAnnotation_new(arena);
+ return (ret && upb_decode(buf, size, ret, &udpa_annotations_StatusAnnotation_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *udpa_annotations_StatusAnnotation_serialize(const udpa_annotations_StatusAnnotation *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &udpa_annotations_StatusAnnotation_msginit, arena, len);
+}
+
+UPB_INLINE bool udpa_annotations_StatusAnnotation_work_in_progress(const udpa_annotations_StatusAnnotation *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool); }
+UPB_INLINE int32_t udpa_annotations_StatusAnnotation_package_version_status(const udpa_annotations_StatusAnnotation *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
+
+UPB_INLINE void udpa_annotations_StatusAnnotation_set_work_in_progress(udpa_annotations_StatusAnnotation *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = value;
+}
+UPB_INLINE void udpa_annotations_StatusAnnotation_set_package_version_status(udpa_annotations_StatusAnnotation *msg, int32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* UDPA_ANNOTATIONS_STATUS_PROTO_UPB_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/versioning.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/versioning.upb.c
index 62f14563c95..017d26e05a2 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/versioning.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/versioning.upb.c
@@ -1,27 +1,27 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * udpa/annotations/versioning.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include <stddef.h>
-#include "upb/msg.h"
-#include "udpa/annotations/versioning.upb.h"
-#include "google/protobuf/descriptor.upb.h"
-
-#include "upb/port_def.inc"
-
-static const upb_msglayout_field udpa_annotations_VersioningAnnotation__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
-};
-
-const upb_msglayout udpa_annotations_VersioningAnnotation_msginit = {
- NULL,
- &udpa_annotations_VersioningAnnotation__fields[0],
- UPB_SIZE(8, 16), 1, false,
-};
-
-#include "upb/port_undef.inc"
-
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * udpa/annotations/versioning.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg.h"
+#include "udpa/annotations/versioning.upb.h"
+#include "google/protobuf/descriptor.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_msglayout_field udpa_annotations_VersioningAnnotation__fields[1] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+};
+
+const upb_msglayout udpa_annotations_VersioningAnnotation_msginit = {
+ NULL,
+ &udpa_annotations_VersioningAnnotation__fields[0],
+ UPB_SIZE(8, 16), 1, false,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/versioning.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/versioning.upb.h
index 39c764c1248..5341663b1fb 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/versioning.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/versioning.upb.h
@@ -1,53 +1,53 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * udpa/annotations/versioning.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef UDPA_ANNOTATIONS_VERSIONING_PROTO_UPB_H_
-#define UDPA_ANNOTATIONS_VERSIONING_PROTO_UPB_H_
-
-#include "upb/msg.h"
-#include "upb/decode.h"
-#include "upb/encode.h"
-
-#include "upb/port_def.inc"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct udpa_annotations_VersioningAnnotation;
-typedef struct udpa_annotations_VersioningAnnotation udpa_annotations_VersioningAnnotation;
-extern const upb_msglayout udpa_annotations_VersioningAnnotation_msginit;
-
-
-/* udpa.annotations.VersioningAnnotation */
-
-UPB_INLINE udpa_annotations_VersioningAnnotation *udpa_annotations_VersioningAnnotation_new(upb_arena *arena) {
- return (udpa_annotations_VersioningAnnotation *)_upb_msg_new(&udpa_annotations_VersioningAnnotation_msginit, arena);
-}
-UPB_INLINE udpa_annotations_VersioningAnnotation *udpa_annotations_VersioningAnnotation_parse(const char *buf, size_t size,
- upb_arena *arena) {
- udpa_annotations_VersioningAnnotation *ret = udpa_annotations_VersioningAnnotation_new(arena);
- return (ret && upb_decode(buf, size, ret, &udpa_annotations_VersioningAnnotation_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *udpa_annotations_VersioningAnnotation_serialize(const udpa_annotations_VersioningAnnotation *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &udpa_annotations_VersioningAnnotation_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview udpa_annotations_VersioningAnnotation_previous_message_type(const udpa_annotations_VersioningAnnotation *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-
-UPB_INLINE void udpa_annotations_VersioningAnnotation_set_previous_message_type(udpa_annotations_VersioningAnnotation *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* UDPA_ANNOTATIONS_VERSIONING_PROTO_UPB_H_ */
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * udpa/annotations/versioning.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef UDPA_ANNOTATIONS_VERSIONING_PROTO_UPB_H_
+#define UDPA_ANNOTATIONS_VERSIONING_PROTO_UPB_H_
+
+#include "upb/msg.h"
+#include "upb/decode.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct udpa_annotations_VersioningAnnotation;
+typedef struct udpa_annotations_VersioningAnnotation udpa_annotations_VersioningAnnotation;
+extern const upb_msglayout udpa_annotations_VersioningAnnotation_msginit;
+
+
+/* udpa.annotations.VersioningAnnotation */
+
+UPB_INLINE udpa_annotations_VersioningAnnotation *udpa_annotations_VersioningAnnotation_new(upb_arena *arena) {
+ return (udpa_annotations_VersioningAnnotation *)_upb_msg_new(&udpa_annotations_VersioningAnnotation_msginit, arena);
+}
+UPB_INLINE udpa_annotations_VersioningAnnotation *udpa_annotations_VersioningAnnotation_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ udpa_annotations_VersioningAnnotation *ret = udpa_annotations_VersioningAnnotation_new(arena);
+ return (ret && upb_decode(buf, size, ret, &udpa_annotations_VersioningAnnotation_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *udpa_annotations_VersioningAnnotation_serialize(const udpa_annotations_VersioningAnnotation *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &udpa_annotations_VersioningAnnotation_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview udpa_annotations_VersioningAnnotation_previous_message_type(const udpa_annotations_VersioningAnnotation *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+
+UPB_INLINE void udpa_annotations_VersioningAnnotation_set_previous_message_type(udpa_annotations_VersioningAnnotation *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* UDPA_ANNOTATIONS_VERSIONING_PROTO_UPB_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/udpa/core/v1/authority.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/udpa/core/v1/authority.upb.c
index 243e9e304c6..d93320d88c3 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/udpa/core/v1/authority.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/udpa/core/v1/authority.upb.c
@@ -1,28 +1,28 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * udpa/core/v1/authority.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include <stddef.h>
-#include "upb/msg.h"
-#include "udpa/core/v1/authority.upb.h"
-#include "udpa/annotations/status.upb.h"
-#include "validate/validate.upb.h"
-
-#include "upb/port_def.inc"
-
-static const upb_msglayout_field udpa_core_v1_Authority__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
-};
-
-const upb_msglayout udpa_core_v1_Authority_msginit = {
- NULL,
- &udpa_core_v1_Authority__fields[0],
- UPB_SIZE(8, 16), 1, false,
-};
-
-#include "upb/port_undef.inc"
-
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * udpa/core/v1/authority.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg.h"
+#include "udpa/core/v1/authority.upb.h"
+#include "udpa/annotations/status.upb.h"
+#include "validate/validate.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_msglayout_field udpa_core_v1_Authority__fields[1] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+};
+
+const upb_msglayout udpa_core_v1_Authority_msginit = {
+ NULL,
+ &udpa_core_v1_Authority__fields[0],
+ UPB_SIZE(8, 16), 1, false,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/udpa/core/v1/authority.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/udpa/core/v1/authority.upb.h
index 310ebebb4a4..b464edd104f 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/udpa/core/v1/authority.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/udpa/core/v1/authority.upb.h
@@ -1,53 +1,53 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * udpa/core/v1/authority.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef UDPA_CORE_V1_AUTHORITY_PROTO_UPB_H_
-#define UDPA_CORE_V1_AUTHORITY_PROTO_UPB_H_
-
-#include "upb/msg.h"
-#include "upb/decode.h"
-#include "upb/encode.h"
-
-#include "upb/port_def.inc"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct udpa_core_v1_Authority;
-typedef struct udpa_core_v1_Authority udpa_core_v1_Authority;
-extern const upb_msglayout udpa_core_v1_Authority_msginit;
-
-
-/* udpa.core.v1.Authority */
-
-UPB_INLINE udpa_core_v1_Authority *udpa_core_v1_Authority_new(upb_arena *arena) {
- return (udpa_core_v1_Authority *)_upb_msg_new(&udpa_core_v1_Authority_msginit, arena);
-}
-UPB_INLINE udpa_core_v1_Authority *udpa_core_v1_Authority_parse(const char *buf, size_t size,
- upb_arena *arena) {
- udpa_core_v1_Authority *ret = udpa_core_v1_Authority_new(arena);
- return (ret && upb_decode(buf, size, ret, &udpa_core_v1_Authority_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *udpa_core_v1_Authority_serialize(const udpa_core_v1_Authority *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &udpa_core_v1_Authority_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview udpa_core_v1_Authority_name(const udpa_core_v1_Authority *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-
-UPB_INLINE void udpa_core_v1_Authority_set_name(udpa_core_v1_Authority *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* UDPA_CORE_V1_AUTHORITY_PROTO_UPB_H_ */
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * udpa/core/v1/authority.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef UDPA_CORE_V1_AUTHORITY_PROTO_UPB_H_
+#define UDPA_CORE_V1_AUTHORITY_PROTO_UPB_H_
+
+#include "upb/msg.h"
+#include "upb/decode.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct udpa_core_v1_Authority;
+typedef struct udpa_core_v1_Authority udpa_core_v1_Authority;
+extern const upb_msglayout udpa_core_v1_Authority_msginit;
+
+
+/* udpa.core.v1.Authority */
+
+UPB_INLINE udpa_core_v1_Authority *udpa_core_v1_Authority_new(upb_arena *arena) {
+ return (udpa_core_v1_Authority *)_upb_msg_new(&udpa_core_v1_Authority_msginit, arena);
+}
+UPB_INLINE udpa_core_v1_Authority *udpa_core_v1_Authority_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ udpa_core_v1_Authority *ret = udpa_core_v1_Authority_new(arena);
+ return (ret && upb_decode(buf, size, ret, &udpa_core_v1_Authority_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *udpa_core_v1_Authority_serialize(const udpa_core_v1_Authority *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &udpa_core_v1_Authority_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview udpa_core_v1_Authority_name(const udpa_core_v1_Authority *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+
+UPB_INLINE void udpa_core_v1_Authority_set_name(udpa_core_v1_Authority *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* UDPA_CORE_V1_AUTHORITY_PROTO_UPB_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/udpa/core/v1/collection_entry.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/udpa/core/v1/collection_entry.upb.c
index 4969d956451..f0e763e5a3d 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/udpa/core/v1/collection_entry.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/udpa/core/v1/collection_entry.upb.c
@@ -1,52 +1,52 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * udpa/core/v1/collection_entry.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include <stddef.h>
-#include "upb/msg.h"
-#include "udpa/core/v1/collection_entry.upb.h"
-#include "google/protobuf/any.upb.h"
-#include "udpa/annotations/status.upb.h"
-#include "udpa/core/v1/resource_locator.upb.h"
-#include "validate/validate.upb.h"
-
-#include "upb/port_def.inc"
-
-static const upb_msglayout *const udpa_core_v1_CollectionEntry_submsgs[2] = {
- &udpa_core_v1_CollectionEntry_InlineEntry_msginit,
- &udpa_core_v1_ResourceLocator_msginit,
-};
-
-static const upb_msglayout_field udpa_core_v1_CollectionEntry__fields[2] = {
- {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 1, 11, 1},
- {2, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, 1},
-};
-
-const upb_msglayout udpa_core_v1_CollectionEntry_msginit = {
- &udpa_core_v1_CollectionEntry_submsgs[0],
- &udpa_core_v1_CollectionEntry__fields[0],
- UPB_SIZE(8, 16), 2, false,
-};
-
-static const upb_msglayout *const udpa_core_v1_CollectionEntry_InlineEntry_submsgs[1] = {
- &google_protobuf_Any_msginit,
-};
-
-static const upb_msglayout_field udpa_core_v1_CollectionEntry_InlineEntry__fields[3] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 9, 1},
- {3, UPB_SIZE(16, 32), 0, 0, 11, 1},
-};
-
-const upb_msglayout udpa_core_v1_CollectionEntry_InlineEntry_msginit = {
- &udpa_core_v1_CollectionEntry_InlineEntry_submsgs[0],
- &udpa_core_v1_CollectionEntry_InlineEntry__fields[0],
- UPB_SIZE(24, 48), 3, false,
-};
-
-#include "upb/port_undef.inc"
-
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * udpa/core/v1/collection_entry.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg.h"
+#include "udpa/core/v1/collection_entry.upb.h"
+#include "google/protobuf/any.upb.h"
+#include "udpa/annotations/status.upb.h"
+#include "udpa/core/v1/resource_locator.upb.h"
+#include "validate/validate.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_msglayout *const udpa_core_v1_CollectionEntry_submsgs[2] = {
+ &udpa_core_v1_CollectionEntry_InlineEntry_msginit,
+ &udpa_core_v1_ResourceLocator_msginit,
+};
+
+static const upb_msglayout_field udpa_core_v1_CollectionEntry__fields[2] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 1, 11, 1},
+ {2, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, 1},
+};
+
+const upb_msglayout udpa_core_v1_CollectionEntry_msginit = {
+ &udpa_core_v1_CollectionEntry_submsgs[0],
+ &udpa_core_v1_CollectionEntry__fields[0],
+ UPB_SIZE(8, 16), 2, false,
+};
+
+static const upb_msglayout *const udpa_core_v1_CollectionEntry_InlineEntry_submsgs[1] = {
+ &google_protobuf_Any_msginit,
+};
+
+static const upb_msglayout_field udpa_core_v1_CollectionEntry_InlineEntry__fields[3] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {2, UPB_SIZE(8, 16), 0, 0, 9, 1},
+ {3, UPB_SIZE(16, 32), 0, 0, 11, 1},
+};
+
+const upb_msglayout udpa_core_v1_CollectionEntry_InlineEntry_msginit = {
+ &udpa_core_v1_CollectionEntry_InlineEntry_submsgs[0],
+ &udpa_core_v1_CollectionEntry_InlineEntry__fields[0],
+ UPB_SIZE(24, 48), 3, false,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/udpa/core/v1/collection_entry.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/udpa/core/v1/collection_entry.upb.h
index 11218f0948d..c4d4cda46dc 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/udpa/core/v1/collection_entry.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/udpa/core/v1/collection_entry.upb.h
@@ -1,129 +1,129 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * udpa/core/v1/collection_entry.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef UDPA_CORE_V1_COLLECTION_ENTRY_PROTO_UPB_H_
-#define UDPA_CORE_V1_COLLECTION_ENTRY_PROTO_UPB_H_
-
-#include "upb/msg.h"
-#include "upb/decode.h"
-#include "upb/encode.h"
-
-#include "upb/port_def.inc"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct udpa_core_v1_CollectionEntry;
-struct udpa_core_v1_CollectionEntry_InlineEntry;
-typedef struct udpa_core_v1_CollectionEntry udpa_core_v1_CollectionEntry;
-typedef struct udpa_core_v1_CollectionEntry_InlineEntry udpa_core_v1_CollectionEntry_InlineEntry;
-extern const upb_msglayout udpa_core_v1_CollectionEntry_msginit;
-extern const upb_msglayout udpa_core_v1_CollectionEntry_InlineEntry_msginit;
-struct google_protobuf_Any;
-struct udpa_core_v1_ResourceLocator;
-extern const upb_msglayout google_protobuf_Any_msginit;
-extern const upb_msglayout udpa_core_v1_ResourceLocator_msginit;
-
-
-/* udpa.core.v1.CollectionEntry */
-
-UPB_INLINE udpa_core_v1_CollectionEntry *udpa_core_v1_CollectionEntry_new(upb_arena *arena) {
- return (udpa_core_v1_CollectionEntry *)_upb_msg_new(&udpa_core_v1_CollectionEntry_msginit, arena);
-}
-UPB_INLINE udpa_core_v1_CollectionEntry *udpa_core_v1_CollectionEntry_parse(const char *buf, size_t size,
- upb_arena *arena) {
- udpa_core_v1_CollectionEntry *ret = udpa_core_v1_CollectionEntry_new(arena);
- return (ret && upb_decode(buf, size, ret, &udpa_core_v1_CollectionEntry_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *udpa_core_v1_CollectionEntry_serialize(const udpa_core_v1_CollectionEntry *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &udpa_core_v1_CollectionEntry_msginit, arena, len);
-}
-
-typedef enum {
- udpa_core_v1_CollectionEntry_resource_specifier_locator = 1,
- udpa_core_v1_CollectionEntry_resource_specifier_inline_entry = 2,
- udpa_core_v1_CollectionEntry_resource_specifier_NOT_SET = 0
-} udpa_core_v1_CollectionEntry_resource_specifier_oneofcases;
-UPB_INLINE udpa_core_v1_CollectionEntry_resource_specifier_oneofcases udpa_core_v1_CollectionEntry_resource_specifier_case(const udpa_core_v1_CollectionEntry* msg) { return (udpa_core_v1_CollectionEntry_resource_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 8), int32_t); }
-
-UPB_INLINE bool udpa_core_v1_CollectionEntry_has_locator(const udpa_core_v1_CollectionEntry *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 1; }
-UPB_INLINE const struct udpa_core_v1_ResourceLocator* udpa_core_v1_CollectionEntry_locator(const udpa_core_v1_CollectionEntry *msg) { return UPB_READ_ONEOF(msg, const struct udpa_core_v1_ResourceLocator*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 1, NULL); }
-UPB_INLINE bool udpa_core_v1_CollectionEntry_has_inline_entry(const udpa_core_v1_CollectionEntry *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 2; }
-UPB_INLINE const udpa_core_v1_CollectionEntry_InlineEntry* udpa_core_v1_CollectionEntry_inline_entry(const udpa_core_v1_CollectionEntry *msg) { return UPB_READ_ONEOF(msg, const udpa_core_v1_CollectionEntry_InlineEntry*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 2, NULL); }
-
-UPB_INLINE void udpa_core_v1_CollectionEntry_set_locator(udpa_core_v1_CollectionEntry *msg, struct udpa_core_v1_ResourceLocator* value) {
- UPB_WRITE_ONEOF(msg, struct udpa_core_v1_ResourceLocator*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 1);
-}
-UPB_INLINE struct udpa_core_v1_ResourceLocator* udpa_core_v1_CollectionEntry_mutable_locator(udpa_core_v1_CollectionEntry *msg, upb_arena *arena) {
- struct udpa_core_v1_ResourceLocator* sub = (struct udpa_core_v1_ResourceLocator*)udpa_core_v1_CollectionEntry_locator(msg);
- if (sub == NULL) {
- sub = (struct udpa_core_v1_ResourceLocator*)_upb_msg_new(&udpa_core_v1_ResourceLocator_msginit, arena);
- if (!sub) return NULL;
- udpa_core_v1_CollectionEntry_set_locator(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void udpa_core_v1_CollectionEntry_set_inline_entry(udpa_core_v1_CollectionEntry *msg, udpa_core_v1_CollectionEntry_InlineEntry* value) {
- UPB_WRITE_ONEOF(msg, udpa_core_v1_CollectionEntry_InlineEntry*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 2);
-}
-UPB_INLINE struct udpa_core_v1_CollectionEntry_InlineEntry* udpa_core_v1_CollectionEntry_mutable_inline_entry(udpa_core_v1_CollectionEntry *msg, upb_arena *arena) {
- struct udpa_core_v1_CollectionEntry_InlineEntry* sub = (struct udpa_core_v1_CollectionEntry_InlineEntry*)udpa_core_v1_CollectionEntry_inline_entry(msg);
- if (sub == NULL) {
- sub = (struct udpa_core_v1_CollectionEntry_InlineEntry*)_upb_msg_new(&udpa_core_v1_CollectionEntry_InlineEntry_msginit, arena);
- if (!sub) return NULL;
- udpa_core_v1_CollectionEntry_set_inline_entry(msg, sub);
- }
- return sub;
-}
-
-/* udpa.core.v1.CollectionEntry.InlineEntry */
-
-UPB_INLINE udpa_core_v1_CollectionEntry_InlineEntry *udpa_core_v1_CollectionEntry_InlineEntry_new(upb_arena *arena) {
- return (udpa_core_v1_CollectionEntry_InlineEntry *)_upb_msg_new(&udpa_core_v1_CollectionEntry_InlineEntry_msginit, arena);
-}
-UPB_INLINE udpa_core_v1_CollectionEntry_InlineEntry *udpa_core_v1_CollectionEntry_InlineEntry_parse(const char *buf, size_t size,
- upb_arena *arena) {
- udpa_core_v1_CollectionEntry_InlineEntry *ret = udpa_core_v1_CollectionEntry_InlineEntry_new(arena);
- return (ret && upb_decode(buf, size, ret, &udpa_core_v1_CollectionEntry_InlineEntry_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *udpa_core_v1_CollectionEntry_InlineEntry_serialize(const udpa_core_v1_CollectionEntry_InlineEntry *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &udpa_core_v1_CollectionEntry_InlineEntry_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview udpa_core_v1_CollectionEntry_InlineEntry_name(const udpa_core_v1_CollectionEntry_InlineEntry *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE upb_strview udpa_core_v1_CollectionEntry_InlineEntry_version(const udpa_core_v1_CollectionEntry_InlineEntry *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview); }
-UPB_INLINE bool udpa_core_v1_CollectionEntry_InlineEntry_has_resource(const udpa_core_v1_CollectionEntry_InlineEntry *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); }
-UPB_INLINE const struct google_protobuf_Any* udpa_core_v1_CollectionEntry_InlineEntry_resource(const udpa_core_v1_CollectionEntry_InlineEntry *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const struct google_protobuf_Any*); }
-
-UPB_INLINE void udpa_core_v1_CollectionEntry_InlineEntry_set_name(udpa_core_v1_CollectionEntry_InlineEntry *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-UPB_INLINE void udpa_core_v1_CollectionEntry_InlineEntry_set_version(udpa_core_v1_CollectionEntry_InlineEntry *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview) = value;
-}
-UPB_INLINE void udpa_core_v1_CollectionEntry_InlineEntry_set_resource(udpa_core_v1_CollectionEntry_InlineEntry *msg, struct google_protobuf_Any* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(16, 32), struct google_protobuf_Any*) = value;
-}
-UPB_INLINE struct google_protobuf_Any* udpa_core_v1_CollectionEntry_InlineEntry_mutable_resource(udpa_core_v1_CollectionEntry_InlineEntry *msg, upb_arena *arena) {
- struct google_protobuf_Any* sub = (struct google_protobuf_Any*)udpa_core_v1_CollectionEntry_InlineEntry_resource(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena);
- if (!sub) return NULL;
- udpa_core_v1_CollectionEntry_InlineEntry_set_resource(msg, sub);
- }
- return sub;
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* UDPA_CORE_V1_COLLECTION_ENTRY_PROTO_UPB_H_ */
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * udpa/core/v1/collection_entry.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef UDPA_CORE_V1_COLLECTION_ENTRY_PROTO_UPB_H_
+#define UDPA_CORE_V1_COLLECTION_ENTRY_PROTO_UPB_H_
+
+#include "upb/msg.h"
+#include "upb/decode.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct udpa_core_v1_CollectionEntry;
+struct udpa_core_v1_CollectionEntry_InlineEntry;
+typedef struct udpa_core_v1_CollectionEntry udpa_core_v1_CollectionEntry;
+typedef struct udpa_core_v1_CollectionEntry_InlineEntry udpa_core_v1_CollectionEntry_InlineEntry;
+extern const upb_msglayout udpa_core_v1_CollectionEntry_msginit;
+extern const upb_msglayout udpa_core_v1_CollectionEntry_InlineEntry_msginit;
+struct google_protobuf_Any;
+struct udpa_core_v1_ResourceLocator;
+extern const upb_msglayout google_protobuf_Any_msginit;
+extern const upb_msglayout udpa_core_v1_ResourceLocator_msginit;
+
+
+/* udpa.core.v1.CollectionEntry */
+
+UPB_INLINE udpa_core_v1_CollectionEntry *udpa_core_v1_CollectionEntry_new(upb_arena *arena) {
+ return (udpa_core_v1_CollectionEntry *)_upb_msg_new(&udpa_core_v1_CollectionEntry_msginit, arena);
+}
+UPB_INLINE udpa_core_v1_CollectionEntry *udpa_core_v1_CollectionEntry_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ udpa_core_v1_CollectionEntry *ret = udpa_core_v1_CollectionEntry_new(arena);
+ return (ret && upb_decode(buf, size, ret, &udpa_core_v1_CollectionEntry_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *udpa_core_v1_CollectionEntry_serialize(const udpa_core_v1_CollectionEntry *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &udpa_core_v1_CollectionEntry_msginit, arena, len);
+}
+
+typedef enum {
+ udpa_core_v1_CollectionEntry_resource_specifier_locator = 1,
+ udpa_core_v1_CollectionEntry_resource_specifier_inline_entry = 2,
+ udpa_core_v1_CollectionEntry_resource_specifier_NOT_SET = 0
+} udpa_core_v1_CollectionEntry_resource_specifier_oneofcases;
+UPB_INLINE udpa_core_v1_CollectionEntry_resource_specifier_oneofcases udpa_core_v1_CollectionEntry_resource_specifier_case(const udpa_core_v1_CollectionEntry* msg) { return (udpa_core_v1_CollectionEntry_resource_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 8), int32_t); }
+
+UPB_INLINE bool udpa_core_v1_CollectionEntry_has_locator(const udpa_core_v1_CollectionEntry *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 1; }
+UPB_INLINE const struct udpa_core_v1_ResourceLocator* udpa_core_v1_CollectionEntry_locator(const udpa_core_v1_CollectionEntry *msg) { return UPB_READ_ONEOF(msg, const struct udpa_core_v1_ResourceLocator*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 1, NULL); }
+UPB_INLINE bool udpa_core_v1_CollectionEntry_has_inline_entry(const udpa_core_v1_CollectionEntry *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 2; }
+UPB_INLINE const udpa_core_v1_CollectionEntry_InlineEntry* udpa_core_v1_CollectionEntry_inline_entry(const udpa_core_v1_CollectionEntry *msg) { return UPB_READ_ONEOF(msg, const udpa_core_v1_CollectionEntry_InlineEntry*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 2, NULL); }
+
+UPB_INLINE void udpa_core_v1_CollectionEntry_set_locator(udpa_core_v1_CollectionEntry *msg, struct udpa_core_v1_ResourceLocator* value) {
+ UPB_WRITE_ONEOF(msg, struct udpa_core_v1_ResourceLocator*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 1);
+}
+UPB_INLINE struct udpa_core_v1_ResourceLocator* udpa_core_v1_CollectionEntry_mutable_locator(udpa_core_v1_CollectionEntry *msg, upb_arena *arena) {
+ struct udpa_core_v1_ResourceLocator* sub = (struct udpa_core_v1_ResourceLocator*)udpa_core_v1_CollectionEntry_locator(msg);
+ if (sub == NULL) {
+ sub = (struct udpa_core_v1_ResourceLocator*)_upb_msg_new(&udpa_core_v1_ResourceLocator_msginit, arena);
+ if (!sub) return NULL;
+ udpa_core_v1_CollectionEntry_set_locator(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void udpa_core_v1_CollectionEntry_set_inline_entry(udpa_core_v1_CollectionEntry *msg, udpa_core_v1_CollectionEntry_InlineEntry* value) {
+ UPB_WRITE_ONEOF(msg, udpa_core_v1_CollectionEntry_InlineEntry*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 2);
+}
+UPB_INLINE struct udpa_core_v1_CollectionEntry_InlineEntry* udpa_core_v1_CollectionEntry_mutable_inline_entry(udpa_core_v1_CollectionEntry *msg, upb_arena *arena) {
+ struct udpa_core_v1_CollectionEntry_InlineEntry* sub = (struct udpa_core_v1_CollectionEntry_InlineEntry*)udpa_core_v1_CollectionEntry_inline_entry(msg);
+ if (sub == NULL) {
+ sub = (struct udpa_core_v1_CollectionEntry_InlineEntry*)_upb_msg_new(&udpa_core_v1_CollectionEntry_InlineEntry_msginit, arena);
+ if (!sub) return NULL;
+ udpa_core_v1_CollectionEntry_set_inline_entry(msg, sub);
+ }
+ return sub;
+}
+
+/* udpa.core.v1.CollectionEntry.InlineEntry */
+
+UPB_INLINE udpa_core_v1_CollectionEntry_InlineEntry *udpa_core_v1_CollectionEntry_InlineEntry_new(upb_arena *arena) {
+ return (udpa_core_v1_CollectionEntry_InlineEntry *)_upb_msg_new(&udpa_core_v1_CollectionEntry_InlineEntry_msginit, arena);
+}
+UPB_INLINE udpa_core_v1_CollectionEntry_InlineEntry *udpa_core_v1_CollectionEntry_InlineEntry_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ udpa_core_v1_CollectionEntry_InlineEntry *ret = udpa_core_v1_CollectionEntry_InlineEntry_new(arena);
+ return (ret && upb_decode(buf, size, ret, &udpa_core_v1_CollectionEntry_InlineEntry_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *udpa_core_v1_CollectionEntry_InlineEntry_serialize(const udpa_core_v1_CollectionEntry_InlineEntry *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &udpa_core_v1_CollectionEntry_InlineEntry_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview udpa_core_v1_CollectionEntry_InlineEntry_name(const udpa_core_v1_CollectionEntry_InlineEntry *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE upb_strview udpa_core_v1_CollectionEntry_InlineEntry_version(const udpa_core_v1_CollectionEntry_InlineEntry *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview); }
+UPB_INLINE bool udpa_core_v1_CollectionEntry_InlineEntry_has_resource(const udpa_core_v1_CollectionEntry_InlineEntry *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); }
+UPB_INLINE const struct google_protobuf_Any* udpa_core_v1_CollectionEntry_InlineEntry_resource(const udpa_core_v1_CollectionEntry_InlineEntry *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const struct google_protobuf_Any*); }
+
+UPB_INLINE void udpa_core_v1_CollectionEntry_InlineEntry_set_name(udpa_core_v1_CollectionEntry_InlineEntry *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+UPB_INLINE void udpa_core_v1_CollectionEntry_InlineEntry_set_version(udpa_core_v1_CollectionEntry_InlineEntry *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview) = value;
+}
+UPB_INLINE void udpa_core_v1_CollectionEntry_InlineEntry_set_resource(udpa_core_v1_CollectionEntry_InlineEntry *msg, struct google_protobuf_Any* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), struct google_protobuf_Any*) = value;
+}
+UPB_INLINE struct google_protobuf_Any* udpa_core_v1_CollectionEntry_InlineEntry_mutable_resource(udpa_core_v1_CollectionEntry_InlineEntry *msg, upb_arena *arena) {
+ struct google_protobuf_Any* sub = (struct google_protobuf_Any*)udpa_core_v1_CollectionEntry_InlineEntry_resource(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena);
+ if (!sub) return NULL;
+ udpa_core_v1_CollectionEntry_InlineEntry_set_resource(msg, sub);
+ }
+ return sub;
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* UDPA_CORE_V1_COLLECTION_ENTRY_PROTO_UPB_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/udpa/core/v1/context_params.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/udpa/core/v1/context_params.upb.c
index 83119c1ea89..8ec1e455f87 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/udpa/core/v1/context_params.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/udpa/core/v1/context_params.upb.c
@@ -1,42 +1,42 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * udpa/core/v1/context_params.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include <stddef.h>
-#include "upb/msg.h"
-#include "udpa/core/v1/context_params.upb.h"
-#include "udpa/annotations/status.upb.h"
-
-#include "upb/port_def.inc"
-
-static const upb_msglayout *const udpa_core_v1_ContextParams_submsgs[1] = {
- &udpa_core_v1_ContextParams_ParamsEntry_msginit,
-};
-
-static const upb_msglayout_field udpa_core_v1_ContextParams__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, _UPB_LABEL_MAP},
-};
-
-const upb_msglayout udpa_core_v1_ContextParams_msginit = {
- &udpa_core_v1_ContextParams_submsgs[0],
- &udpa_core_v1_ContextParams__fields[0],
- UPB_SIZE(4, 8), 1, false,
-};
-
-static const upb_msglayout_field udpa_core_v1_ContextParams_ParamsEntry__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 9, 1},
-};
-
-const upb_msglayout udpa_core_v1_ContextParams_ParamsEntry_msginit = {
- NULL,
- &udpa_core_v1_ContextParams_ParamsEntry__fields[0],
- UPB_SIZE(16, 32), 2, false,
-};
-
-#include "upb/port_undef.inc"
-
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * udpa/core/v1/context_params.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg.h"
+#include "udpa/core/v1/context_params.upb.h"
+#include "udpa/annotations/status.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_msglayout *const udpa_core_v1_ContextParams_submsgs[1] = {
+ &udpa_core_v1_ContextParams_ParamsEntry_msginit,
+};
+
+static const upb_msglayout_field udpa_core_v1_ContextParams__fields[1] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 11, _UPB_LABEL_MAP},
+};
+
+const upb_msglayout udpa_core_v1_ContextParams_msginit = {
+ &udpa_core_v1_ContextParams_submsgs[0],
+ &udpa_core_v1_ContextParams__fields[0],
+ UPB_SIZE(4, 8), 1, false,
+};
+
+static const upb_msglayout_field udpa_core_v1_ContextParams_ParamsEntry__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {2, UPB_SIZE(8, 16), 0, 0, 9, 1},
+};
+
+const upb_msglayout udpa_core_v1_ContextParams_ParamsEntry_msginit = {
+ NULL,
+ &udpa_core_v1_ContextParams_ParamsEntry__fields[0],
+ UPB_SIZE(16, 32), 2, false,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/udpa/core/v1/context_params.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/udpa/core/v1/context_params.upb.h
index 1aeb63ce82e..cc16b620d4f 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/udpa/core/v1/context_params.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/udpa/core/v1/context_params.upb.h
@@ -1,77 +1,77 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * udpa/core/v1/context_params.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef UDPA_CORE_V1_CONTEXT_PARAMS_PROTO_UPB_H_
-#define UDPA_CORE_V1_CONTEXT_PARAMS_PROTO_UPB_H_
-
-#include "upb/msg.h"
-#include "upb/decode.h"
-#include "upb/encode.h"
-
-#include "upb/port_def.inc"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct udpa_core_v1_ContextParams;
-struct udpa_core_v1_ContextParams_ParamsEntry;
-typedef struct udpa_core_v1_ContextParams udpa_core_v1_ContextParams;
-typedef struct udpa_core_v1_ContextParams_ParamsEntry udpa_core_v1_ContextParams_ParamsEntry;
-extern const upb_msglayout udpa_core_v1_ContextParams_msginit;
-extern const upb_msglayout udpa_core_v1_ContextParams_ParamsEntry_msginit;
-
-
-/* udpa.core.v1.ContextParams */
-
-UPB_INLINE udpa_core_v1_ContextParams *udpa_core_v1_ContextParams_new(upb_arena *arena) {
- return (udpa_core_v1_ContextParams *)_upb_msg_new(&udpa_core_v1_ContextParams_msginit, arena);
-}
-UPB_INLINE udpa_core_v1_ContextParams *udpa_core_v1_ContextParams_parse(const char *buf, size_t size,
- upb_arena *arena) {
- udpa_core_v1_ContextParams *ret = udpa_core_v1_ContextParams_new(arena);
- return (ret && upb_decode(buf, size, ret, &udpa_core_v1_ContextParams_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *udpa_core_v1_ContextParams_serialize(const udpa_core_v1_ContextParams *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &udpa_core_v1_ContextParams_msginit, arena, len);
-}
-
-UPB_INLINE bool udpa_core_v1_ContextParams_has_params(const udpa_core_v1_ContextParams *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE size_t udpa_core_v1_ContextParams_params_size(const udpa_core_v1_ContextParams *msg) {return _upb_msg_map_size(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE bool udpa_core_v1_ContextParams_params_get(const udpa_core_v1_ContextParams *msg, upb_strview key, upb_strview *val) { return _upb_msg_map_get(msg, UPB_SIZE(0, 0), &key, 0, val, 0); }
-UPB_INLINE const udpa_core_v1_ContextParams_ParamsEntry* udpa_core_v1_ContextParams_params_next(const udpa_core_v1_ContextParams *msg, size_t* iter) { return (const udpa_core_v1_ContextParams_ParamsEntry*)_upb_msg_map_next(msg, UPB_SIZE(0, 0), iter); }
-
-UPB_INLINE void udpa_core_v1_ContextParams_params_clear(udpa_core_v1_ContextParams *msg) { _upb_msg_map_clear(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE bool udpa_core_v1_ContextParams_params_set(udpa_core_v1_ContextParams *msg, upb_strview key, upb_strview val, upb_arena *a) { return _upb_msg_map_set(msg, UPB_SIZE(0, 0), &key, 0, &val, 0, a); }
-UPB_INLINE bool udpa_core_v1_ContextParams_params_delete(udpa_core_v1_ContextParams *msg, upb_strview key) { return _upb_msg_map_delete(msg, UPB_SIZE(0, 0), &key, 0); }
-UPB_INLINE udpa_core_v1_ContextParams_ParamsEntry* udpa_core_v1_ContextParams_params_nextmutable(udpa_core_v1_ContextParams *msg, size_t* iter) { return (udpa_core_v1_ContextParams_ParamsEntry*)_upb_msg_map_next(msg, UPB_SIZE(0, 0), iter); }
-
-/* udpa.core.v1.ContextParams.ParamsEntry */
-
-UPB_INLINE upb_strview udpa_core_v1_ContextParams_ParamsEntry_key(const udpa_core_v1_ContextParams_ParamsEntry *msg) {
- upb_strview ret;
- _upb_msg_map_key(msg, &ret, 0);
- return ret;
-}
-UPB_INLINE upb_strview udpa_core_v1_ContextParams_ParamsEntry_value(const udpa_core_v1_ContextParams_ParamsEntry *msg) {
- upb_strview ret;
- _upb_msg_map_value(msg, &ret, 0);
- return ret;
-}
-
-UPB_INLINE void udpa_core_v1_ContextParams_ParamsEntry_set_value(udpa_core_v1_ContextParams_ParamsEntry *msg, upb_strview value) {
- _upb_msg_map_set_value(msg, &value, 0);
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* UDPA_CORE_V1_CONTEXT_PARAMS_PROTO_UPB_H_ */
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * udpa/core/v1/context_params.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef UDPA_CORE_V1_CONTEXT_PARAMS_PROTO_UPB_H_
+#define UDPA_CORE_V1_CONTEXT_PARAMS_PROTO_UPB_H_
+
+#include "upb/msg.h"
+#include "upb/decode.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct udpa_core_v1_ContextParams;
+struct udpa_core_v1_ContextParams_ParamsEntry;
+typedef struct udpa_core_v1_ContextParams udpa_core_v1_ContextParams;
+typedef struct udpa_core_v1_ContextParams_ParamsEntry udpa_core_v1_ContextParams_ParamsEntry;
+extern const upb_msglayout udpa_core_v1_ContextParams_msginit;
+extern const upb_msglayout udpa_core_v1_ContextParams_ParamsEntry_msginit;
+
+
+/* udpa.core.v1.ContextParams */
+
+UPB_INLINE udpa_core_v1_ContextParams *udpa_core_v1_ContextParams_new(upb_arena *arena) {
+ return (udpa_core_v1_ContextParams *)_upb_msg_new(&udpa_core_v1_ContextParams_msginit, arena);
+}
+UPB_INLINE udpa_core_v1_ContextParams *udpa_core_v1_ContextParams_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ udpa_core_v1_ContextParams *ret = udpa_core_v1_ContextParams_new(arena);
+ return (ret && upb_decode(buf, size, ret, &udpa_core_v1_ContextParams_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *udpa_core_v1_ContextParams_serialize(const udpa_core_v1_ContextParams *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &udpa_core_v1_ContextParams_msginit, arena, len);
+}
+
+UPB_INLINE bool udpa_core_v1_ContextParams_has_params(const udpa_core_v1_ContextParams *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE size_t udpa_core_v1_ContextParams_params_size(const udpa_core_v1_ContextParams *msg) {return _upb_msg_map_size(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE bool udpa_core_v1_ContextParams_params_get(const udpa_core_v1_ContextParams *msg, upb_strview key, upb_strview *val) { return _upb_msg_map_get(msg, UPB_SIZE(0, 0), &key, 0, val, 0); }
+UPB_INLINE const udpa_core_v1_ContextParams_ParamsEntry* udpa_core_v1_ContextParams_params_next(const udpa_core_v1_ContextParams *msg, size_t* iter) { return (const udpa_core_v1_ContextParams_ParamsEntry*)_upb_msg_map_next(msg, UPB_SIZE(0, 0), iter); }
+
+UPB_INLINE void udpa_core_v1_ContextParams_params_clear(udpa_core_v1_ContextParams *msg) { _upb_msg_map_clear(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE bool udpa_core_v1_ContextParams_params_set(udpa_core_v1_ContextParams *msg, upb_strview key, upb_strview val, upb_arena *a) { return _upb_msg_map_set(msg, UPB_SIZE(0, 0), &key, 0, &val, 0, a); }
+UPB_INLINE bool udpa_core_v1_ContextParams_params_delete(udpa_core_v1_ContextParams *msg, upb_strview key) { return _upb_msg_map_delete(msg, UPB_SIZE(0, 0), &key, 0); }
+UPB_INLINE udpa_core_v1_ContextParams_ParamsEntry* udpa_core_v1_ContextParams_params_nextmutable(udpa_core_v1_ContextParams *msg, size_t* iter) { return (udpa_core_v1_ContextParams_ParamsEntry*)_upb_msg_map_next(msg, UPB_SIZE(0, 0), iter); }
+
+/* udpa.core.v1.ContextParams.ParamsEntry */
+
+UPB_INLINE upb_strview udpa_core_v1_ContextParams_ParamsEntry_key(const udpa_core_v1_ContextParams_ParamsEntry *msg) {
+ upb_strview ret;
+ _upb_msg_map_key(msg, &ret, 0);
+ return ret;
+}
+UPB_INLINE upb_strview udpa_core_v1_ContextParams_ParamsEntry_value(const udpa_core_v1_ContextParams_ParamsEntry *msg) {
+ upb_strview ret;
+ _upb_msg_map_value(msg, &ret, 0);
+ return ret;
+}
+
+UPB_INLINE void udpa_core_v1_ContextParams_ParamsEntry_set_value(udpa_core_v1_ContextParams_ParamsEntry *msg, upb_strview value) {
+ _upb_msg_map_set_value(msg, &value, 0);
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* UDPA_CORE_V1_CONTEXT_PARAMS_PROTO_UPB_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/udpa/core/v1/resource.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/udpa/core/v1/resource.upb.c
index 78ff6fcbdf6..f7d100e4d47 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/udpa/core/v1/resource.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/udpa/core/v1/resource.upb.c
@@ -1,36 +1,36 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * udpa/core/v1/resource.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include <stddef.h>
-#include "upb/msg.h"
-#include "udpa/core/v1/resource.upb.h"
-#include "google/protobuf/any.upb.h"
-#include "udpa/annotations/status.upb.h"
-#include "udpa/core/v1/resource_name.upb.h"
-
-#include "upb/port_def.inc"
-
-static const upb_msglayout *const udpa_core_v1_Resource_submsgs[2] = {
- &google_protobuf_Any_msginit,
- &udpa_core_v1_ResourceName_msginit,
-};
-
-static const upb_msglayout_field udpa_core_v1_Resource__fields[3] = {
- {1, UPB_SIZE(8, 16), 0, 1, 11, 1},
- {2, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {3, UPB_SIZE(12, 24), 0, 0, 11, 1},
-};
-
-const upb_msglayout udpa_core_v1_Resource_msginit = {
- &udpa_core_v1_Resource_submsgs[0],
- &udpa_core_v1_Resource__fields[0],
- UPB_SIZE(16, 32), 3, false,
-};
-
-#include "upb/port_undef.inc"
-
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * udpa/core/v1/resource.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg.h"
+#include "udpa/core/v1/resource.upb.h"
+#include "google/protobuf/any.upb.h"
+#include "udpa/annotations/status.upb.h"
+#include "udpa/core/v1/resource_name.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_msglayout *const udpa_core_v1_Resource_submsgs[2] = {
+ &google_protobuf_Any_msginit,
+ &udpa_core_v1_ResourceName_msginit,
+};
+
+static const upb_msglayout_field udpa_core_v1_Resource__fields[3] = {
+ {1, UPB_SIZE(8, 16), 0, 1, 11, 1},
+ {2, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {3, UPB_SIZE(12, 24), 0, 0, 11, 1},
+};
+
+const upb_msglayout udpa_core_v1_Resource_msginit = {
+ &udpa_core_v1_Resource_submsgs[0],
+ &udpa_core_v1_Resource__fields[0],
+ UPB_SIZE(16, 32), 3, false,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/udpa/core/v1/resource.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/udpa/core/v1/resource.upb.h
index a7241088faa..d7ff6fe7604 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/udpa/core/v1/resource.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/udpa/core/v1/resource.upb.h
@@ -1,85 +1,85 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * udpa/core/v1/resource.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef UDPA_CORE_V1_RESOURCE_PROTO_UPB_H_
-#define UDPA_CORE_V1_RESOURCE_PROTO_UPB_H_
-
-#include "upb/msg.h"
-#include "upb/decode.h"
-#include "upb/encode.h"
-
-#include "upb/port_def.inc"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct udpa_core_v1_Resource;
-typedef struct udpa_core_v1_Resource udpa_core_v1_Resource;
-extern const upb_msglayout udpa_core_v1_Resource_msginit;
-struct google_protobuf_Any;
-struct udpa_core_v1_ResourceName;
-extern const upb_msglayout google_protobuf_Any_msginit;
-extern const upb_msglayout udpa_core_v1_ResourceName_msginit;
-
-
-/* udpa.core.v1.Resource */
-
-UPB_INLINE udpa_core_v1_Resource *udpa_core_v1_Resource_new(upb_arena *arena) {
- return (udpa_core_v1_Resource *)_upb_msg_new(&udpa_core_v1_Resource_msginit, arena);
-}
-UPB_INLINE udpa_core_v1_Resource *udpa_core_v1_Resource_parse(const char *buf, size_t size,
- upb_arena *arena) {
- udpa_core_v1_Resource *ret = udpa_core_v1_Resource_new(arena);
- return (ret && upb_decode(buf, size, ret, &udpa_core_v1_Resource_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *udpa_core_v1_Resource_serialize(const udpa_core_v1_Resource *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &udpa_core_v1_Resource_msginit, arena, len);
-}
-
-UPB_INLINE bool udpa_core_v1_Resource_has_name(const udpa_core_v1_Resource *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const struct udpa_core_v1_ResourceName* udpa_core_v1_Resource_name(const udpa_core_v1_Resource *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct udpa_core_v1_ResourceName*); }
-UPB_INLINE upb_strview udpa_core_v1_Resource_version(const udpa_core_v1_Resource *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE bool udpa_core_v1_Resource_has_resource(const udpa_core_v1_Resource *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
-UPB_INLINE const struct google_protobuf_Any* udpa_core_v1_Resource_resource(const udpa_core_v1_Resource *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_protobuf_Any*); }
-
-UPB_INLINE void udpa_core_v1_Resource_set_name(udpa_core_v1_Resource *msg, struct udpa_core_v1_ResourceName* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct udpa_core_v1_ResourceName*) = value;
-}
-UPB_INLINE struct udpa_core_v1_ResourceName* udpa_core_v1_Resource_mutable_name(udpa_core_v1_Resource *msg, upb_arena *arena) {
- struct udpa_core_v1_ResourceName* sub = (struct udpa_core_v1_ResourceName*)udpa_core_v1_Resource_name(msg);
- if (sub == NULL) {
- sub = (struct udpa_core_v1_ResourceName*)_upb_msg_new(&udpa_core_v1_ResourceName_msginit, arena);
- if (!sub) return NULL;
- udpa_core_v1_Resource_set_name(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void udpa_core_v1_Resource_set_version(udpa_core_v1_Resource *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-UPB_INLINE void udpa_core_v1_Resource_set_resource(udpa_core_v1_Resource *msg, struct google_protobuf_Any* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_protobuf_Any*) = value;
-}
-UPB_INLINE struct google_protobuf_Any* udpa_core_v1_Resource_mutable_resource(udpa_core_v1_Resource *msg, upb_arena *arena) {
- struct google_protobuf_Any* sub = (struct google_protobuf_Any*)udpa_core_v1_Resource_resource(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena);
- if (!sub) return NULL;
- udpa_core_v1_Resource_set_resource(msg, sub);
- }
- return sub;
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* UDPA_CORE_V1_RESOURCE_PROTO_UPB_H_ */
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * udpa/core/v1/resource.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef UDPA_CORE_V1_RESOURCE_PROTO_UPB_H_
+#define UDPA_CORE_V1_RESOURCE_PROTO_UPB_H_
+
+#include "upb/msg.h"
+#include "upb/decode.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct udpa_core_v1_Resource;
+typedef struct udpa_core_v1_Resource udpa_core_v1_Resource;
+extern const upb_msglayout udpa_core_v1_Resource_msginit;
+struct google_protobuf_Any;
+struct udpa_core_v1_ResourceName;
+extern const upb_msglayout google_protobuf_Any_msginit;
+extern const upb_msglayout udpa_core_v1_ResourceName_msginit;
+
+
+/* udpa.core.v1.Resource */
+
+UPB_INLINE udpa_core_v1_Resource *udpa_core_v1_Resource_new(upb_arena *arena) {
+ return (udpa_core_v1_Resource *)_upb_msg_new(&udpa_core_v1_Resource_msginit, arena);
+}
+UPB_INLINE udpa_core_v1_Resource *udpa_core_v1_Resource_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ udpa_core_v1_Resource *ret = udpa_core_v1_Resource_new(arena);
+ return (ret && upb_decode(buf, size, ret, &udpa_core_v1_Resource_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *udpa_core_v1_Resource_serialize(const udpa_core_v1_Resource *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &udpa_core_v1_Resource_msginit, arena, len);
+}
+
+UPB_INLINE bool udpa_core_v1_Resource_has_name(const udpa_core_v1_Resource *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
+UPB_INLINE const struct udpa_core_v1_ResourceName* udpa_core_v1_Resource_name(const udpa_core_v1_Resource *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct udpa_core_v1_ResourceName*); }
+UPB_INLINE upb_strview udpa_core_v1_Resource_version(const udpa_core_v1_Resource *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE bool udpa_core_v1_Resource_has_resource(const udpa_core_v1_Resource *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
+UPB_INLINE const struct google_protobuf_Any* udpa_core_v1_Resource_resource(const udpa_core_v1_Resource *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_protobuf_Any*); }
+
+UPB_INLINE void udpa_core_v1_Resource_set_name(udpa_core_v1_Resource *msg, struct udpa_core_v1_ResourceName* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct udpa_core_v1_ResourceName*) = value;
+}
+UPB_INLINE struct udpa_core_v1_ResourceName* udpa_core_v1_Resource_mutable_name(udpa_core_v1_Resource *msg, upb_arena *arena) {
+ struct udpa_core_v1_ResourceName* sub = (struct udpa_core_v1_ResourceName*)udpa_core_v1_Resource_name(msg);
+ if (sub == NULL) {
+ sub = (struct udpa_core_v1_ResourceName*)_upb_msg_new(&udpa_core_v1_ResourceName_msginit, arena);
+ if (!sub) return NULL;
+ udpa_core_v1_Resource_set_name(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void udpa_core_v1_Resource_set_version(udpa_core_v1_Resource *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+UPB_INLINE void udpa_core_v1_Resource_set_resource(udpa_core_v1_Resource *msg, struct google_protobuf_Any* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_protobuf_Any*) = value;
+}
+UPB_INLINE struct google_protobuf_Any* udpa_core_v1_Resource_mutable_resource(udpa_core_v1_Resource *msg, upb_arena *arena) {
+ struct google_protobuf_Any* sub = (struct google_protobuf_Any*)udpa_core_v1_Resource_resource(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena);
+ if (!sub) return NULL;
+ udpa_core_v1_Resource_set_resource(msg, sub);
+ }
+ return sub;
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* UDPA_CORE_V1_RESOURCE_PROTO_UPB_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/udpa/core/v1/resource_locator.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/udpa/core/v1/resource_locator.upb.c
index 45c5160fc3b..e9532250894 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/udpa/core/v1/resource_locator.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/udpa/core/v1/resource_locator.upb.c
@@ -1,54 +1,54 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * udpa/core/v1/resource_locator.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include <stddef.h>
-#include "upb/msg.h"
-#include "udpa/core/v1/resource_locator.upb.h"
-#include "udpa/annotations/status.upb.h"
-#include "udpa/core/v1/context_params.upb.h"
-#include "validate/validate.upb.h"
-
-#include "upb/port_def.inc"
-
-static const upb_msglayout *const udpa_core_v1_ResourceLocator_submsgs[2] = {
- &udpa_core_v1_ContextParams_msginit,
- &udpa_core_v1_ResourceLocator_Directive_msginit,
-};
-
-static const upb_msglayout_field udpa_core_v1_ResourceLocator__fields[6] = {
- {1, UPB_SIZE(0, 0), 0, 0, 14, 1},
- {2, UPB_SIZE(24, 40), 0, 0, 9, 3},
- {3, UPB_SIZE(8, 8), 0, 0, 9, 1},
- {4, UPB_SIZE(16, 24), 0, 0, 9, 1},
- {5, UPB_SIZE(32, 56), UPB_SIZE(-37, -65), 0, 11, 1},
- {6, UPB_SIZE(28, 48), 0, 1, 11, 3},
-};
-
-const upb_msglayout udpa_core_v1_ResourceLocator_msginit = {
- &udpa_core_v1_ResourceLocator_submsgs[0],
- &udpa_core_v1_ResourceLocator__fields[0],
- UPB_SIZE(40, 80), 6, false,
-};
-
-static const upb_msglayout *const udpa_core_v1_ResourceLocator_Directive_submsgs[1] = {
- &udpa_core_v1_ResourceLocator_msginit,
-};
-
-static const upb_msglayout_field udpa_core_v1_ResourceLocator_Directive__fields[2] = {
- {1, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 11, 1},
- {2, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 9, 1},
-};
-
-const upb_msglayout udpa_core_v1_ResourceLocator_Directive_msginit = {
- &udpa_core_v1_ResourceLocator_Directive_submsgs[0],
- &udpa_core_v1_ResourceLocator_Directive__fields[0],
- UPB_SIZE(16, 32), 2, false,
-};
-
-#include "upb/port_undef.inc"
-
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * udpa/core/v1/resource_locator.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg.h"
+#include "udpa/core/v1/resource_locator.upb.h"
+#include "udpa/annotations/status.upb.h"
+#include "udpa/core/v1/context_params.upb.h"
+#include "validate/validate.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_msglayout *const udpa_core_v1_ResourceLocator_submsgs[2] = {
+ &udpa_core_v1_ContextParams_msginit,
+ &udpa_core_v1_ResourceLocator_Directive_msginit,
+};
+
+static const upb_msglayout_field udpa_core_v1_ResourceLocator__fields[6] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 14, 1},
+ {2, UPB_SIZE(24, 40), 0, 0, 9, 3},
+ {3, UPB_SIZE(8, 8), 0, 0, 9, 1},
+ {4, UPB_SIZE(16, 24), 0, 0, 9, 1},
+ {5, UPB_SIZE(32, 56), UPB_SIZE(-37, -65), 0, 11, 1},
+ {6, UPB_SIZE(28, 48), 0, 1, 11, 3},
+};
+
+const upb_msglayout udpa_core_v1_ResourceLocator_msginit = {
+ &udpa_core_v1_ResourceLocator_submsgs[0],
+ &udpa_core_v1_ResourceLocator__fields[0],
+ UPB_SIZE(40, 80), 6, false,
+};
+
+static const upb_msglayout *const udpa_core_v1_ResourceLocator_Directive_submsgs[1] = {
+ &udpa_core_v1_ResourceLocator_msginit,
+};
+
+static const upb_msglayout_field udpa_core_v1_ResourceLocator_Directive__fields[2] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 11, 1},
+ {2, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 9, 1},
+};
+
+const upb_msglayout udpa_core_v1_ResourceLocator_Directive_msginit = {
+ &udpa_core_v1_ResourceLocator_Directive_submsgs[0],
+ &udpa_core_v1_ResourceLocator_Directive__fields[0],
+ UPB_SIZE(16, 32), 2, false,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/udpa/core/v1/resource_locator.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/udpa/core/v1/resource_locator.upb.h
index 4185b45126c..f485f704089 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/udpa/core/v1/resource_locator.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/udpa/core/v1/resource_locator.upb.h
@@ -1,160 +1,160 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * udpa/core/v1/resource_locator.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef UDPA_CORE_V1_RESOURCE_LOCATOR_PROTO_UPB_H_
-#define UDPA_CORE_V1_RESOURCE_LOCATOR_PROTO_UPB_H_
-
-#include "upb/msg.h"
-#include "upb/decode.h"
-#include "upb/encode.h"
-
-#include "upb/port_def.inc"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct udpa_core_v1_ResourceLocator;
-struct udpa_core_v1_ResourceLocator_Directive;
-typedef struct udpa_core_v1_ResourceLocator udpa_core_v1_ResourceLocator;
-typedef struct udpa_core_v1_ResourceLocator_Directive udpa_core_v1_ResourceLocator_Directive;
-extern const upb_msglayout udpa_core_v1_ResourceLocator_msginit;
-extern const upb_msglayout udpa_core_v1_ResourceLocator_Directive_msginit;
-struct udpa_core_v1_ContextParams;
-extern const upb_msglayout udpa_core_v1_ContextParams_msginit;
-
-typedef enum {
- udpa_core_v1_ResourceLocator_UDPA = 0,
- udpa_core_v1_ResourceLocator_HTTP = 1,
- udpa_core_v1_ResourceLocator_FILE = 2
-} udpa_core_v1_ResourceLocator_Scheme;
-
-
-/* udpa.core.v1.ResourceLocator */
-
-UPB_INLINE udpa_core_v1_ResourceLocator *udpa_core_v1_ResourceLocator_new(upb_arena *arena) {
- return (udpa_core_v1_ResourceLocator *)_upb_msg_new(&udpa_core_v1_ResourceLocator_msginit, arena);
-}
-UPB_INLINE udpa_core_v1_ResourceLocator *udpa_core_v1_ResourceLocator_parse(const char *buf, size_t size,
- upb_arena *arena) {
- udpa_core_v1_ResourceLocator *ret = udpa_core_v1_ResourceLocator_new(arena);
- return (ret && upb_decode(buf, size, ret, &udpa_core_v1_ResourceLocator_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *udpa_core_v1_ResourceLocator_serialize(const udpa_core_v1_ResourceLocator *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &udpa_core_v1_ResourceLocator_msginit, arena, len);
-}
-
-typedef enum {
- udpa_core_v1_ResourceLocator_context_param_specifier_exact_context = 5,
- udpa_core_v1_ResourceLocator_context_param_specifier_NOT_SET = 0
-} udpa_core_v1_ResourceLocator_context_param_specifier_oneofcases;
-UPB_INLINE udpa_core_v1_ResourceLocator_context_param_specifier_oneofcases udpa_core_v1_ResourceLocator_context_param_specifier_case(const udpa_core_v1_ResourceLocator* msg) { return (udpa_core_v1_ResourceLocator_context_param_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(36, 64), int32_t); }
-
-UPB_INLINE int32_t udpa_core_v1_ResourceLocator_scheme(const udpa_core_v1_ResourceLocator *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
-UPB_INLINE upb_strview const* udpa_core_v1_ResourceLocator_id(const udpa_core_v1_ResourceLocator *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(24, 40), len); }
-UPB_INLINE upb_strview udpa_core_v1_ResourceLocator_authority(const udpa_core_v1_ResourceLocator *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview); }
-UPB_INLINE upb_strview udpa_core_v1_ResourceLocator_resource_type(const udpa_core_v1_ResourceLocator *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_strview); }
-UPB_INLINE bool udpa_core_v1_ResourceLocator_has_exact_context(const udpa_core_v1_ResourceLocator *msg) { return _upb_getoneofcase(msg, UPB_SIZE(36, 64)) == 5; }
-UPB_INLINE const struct udpa_core_v1_ContextParams* udpa_core_v1_ResourceLocator_exact_context(const udpa_core_v1_ResourceLocator *msg) { return UPB_READ_ONEOF(msg, const struct udpa_core_v1_ContextParams*, UPB_SIZE(32, 56), UPB_SIZE(36, 64), 5, NULL); }
-UPB_INLINE bool udpa_core_v1_ResourceLocator_has_directives(const udpa_core_v1_ResourceLocator *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 48)); }
-UPB_INLINE const udpa_core_v1_ResourceLocator_Directive* const* udpa_core_v1_ResourceLocator_directives(const udpa_core_v1_ResourceLocator *msg, size_t *len) { return (const udpa_core_v1_ResourceLocator_Directive* const*)_upb_array_accessor(msg, UPB_SIZE(28, 48), len); }
-
-UPB_INLINE void udpa_core_v1_ResourceLocator_set_scheme(udpa_core_v1_ResourceLocator *msg, int32_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
-}
-UPB_INLINE upb_strview* udpa_core_v1_ResourceLocator_mutable_id(udpa_core_v1_ResourceLocator *msg, size_t *len) {
- return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 40), len);
-}
-UPB_INLINE upb_strview* udpa_core_v1_ResourceLocator_resize_id(udpa_core_v1_ResourceLocator *msg, size_t len, upb_arena *arena) {
- return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(24, 40), len, UPB_TYPE_STRING, arena);
-}
-UPB_INLINE bool udpa_core_v1_ResourceLocator_add_id(udpa_core_v1_ResourceLocator *msg, upb_strview val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(24, 40), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
- arena);
-}
-UPB_INLINE void udpa_core_v1_ResourceLocator_set_authority(udpa_core_v1_ResourceLocator *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview) = value;
-}
-UPB_INLINE void udpa_core_v1_ResourceLocator_set_resource_type(udpa_core_v1_ResourceLocator *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_strview) = value;
-}
-UPB_INLINE void udpa_core_v1_ResourceLocator_set_exact_context(udpa_core_v1_ResourceLocator *msg, struct udpa_core_v1_ContextParams* value) {
- UPB_WRITE_ONEOF(msg, struct udpa_core_v1_ContextParams*, UPB_SIZE(32, 56), value, UPB_SIZE(36, 64), 5);
-}
-UPB_INLINE struct udpa_core_v1_ContextParams* udpa_core_v1_ResourceLocator_mutable_exact_context(udpa_core_v1_ResourceLocator *msg, upb_arena *arena) {
- struct udpa_core_v1_ContextParams* sub = (struct udpa_core_v1_ContextParams*)udpa_core_v1_ResourceLocator_exact_context(msg);
- if (sub == NULL) {
- sub = (struct udpa_core_v1_ContextParams*)_upb_msg_new(&udpa_core_v1_ContextParams_msginit, arena);
- if (!sub) return NULL;
- udpa_core_v1_ResourceLocator_set_exact_context(msg, sub);
- }
- return sub;
-}
-UPB_INLINE udpa_core_v1_ResourceLocator_Directive** udpa_core_v1_ResourceLocator_mutable_directives(udpa_core_v1_ResourceLocator *msg, size_t *len) {
- return (udpa_core_v1_ResourceLocator_Directive**)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 48), len);
-}
-UPB_INLINE udpa_core_v1_ResourceLocator_Directive** udpa_core_v1_ResourceLocator_resize_directives(udpa_core_v1_ResourceLocator *msg, size_t len, upb_arena *arena) {
- return (udpa_core_v1_ResourceLocator_Directive**)_upb_array_resize_accessor(msg, UPB_SIZE(28, 48), len, UPB_TYPE_MESSAGE, arena);
-}
-UPB_INLINE struct udpa_core_v1_ResourceLocator_Directive* udpa_core_v1_ResourceLocator_add_directives(udpa_core_v1_ResourceLocator *msg, upb_arena *arena) {
- struct udpa_core_v1_ResourceLocator_Directive* sub = (struct udpa_core_v1_ResourceLocator_Directive*)_upb_msg_new(&udpa_core_v1_ResourceLocator_Directive_msginit, arena);
- bool ok = _upb_array_append_accessor(
- msg, UPB_SIZE(28, 48), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-
-/* udpa.core.v1.ResourceLocator.Directive */
-
-UPB_INLINE udpa_core_v1_ResourceLocator_Directive *udpa_core_v1_ResourceLocator_Directive_new(upb_arena *arena) {
- return (udpa_core_v1_ResourceLocator_Directive *)_upb_msg_new(&udpa_core_v1_ResourceLocator_Directive_msginit, arena);
-}
-UPB_INLINE udpa_core_v1_ResourceLocator_Directive *udpa_core_v1_ResourceLocator_Directive_parse(const char *buf, size_t size,
- upb_arena *arena) {
- udpa_core_v1_ResourceLocator_Directive *ret = udpa_core_v1_ResourceLocator_Directive_new(arena);
- return (ret && upb_decode(buf, size, ret, &udpa_core_v1_ResourceLocator_Directive_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *udpa_core_v1_ResourceLocator_Directive_serialize(const udpa_core_v1_ResourceLocator_Directive *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &udpa_core_v1_ResourceLocator_Directive_msginit, arena, len);
-}
-
-typedef enum {
- udpa_core_v1_ResourceLocator_Directive_directive_alt = 1,
- udpa_core_v1_ResourceLocator_Directive_directive_entry = 2,
- udpa_core_v1_ResourceLocator_Directive_directive_NOT_SET = 0
-} udpa_core_v1_ResourceLocator_Directive_directive_oneofcases;
-UPB_INLINE udpa_core_v1_ResourceLocator_Directive_directive_oneofcases udpa_core_v1_ResourceLocator_Directive_directive_case(const udpa_core_v1_ResourceLocator_Directive* msg) { return (udpa_core_v1_ResourceLocator_Directive_directive_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(8, 16), int32_t); }
-
-UPB_INLINE bool udpa_core_v1_ResourceLocator_Directive_has_alt(const udpa_core_v1_ResourceLocator_Directive *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 1; }
-UPB_INLINE const udpa_core_v1_ResourceLocator* udpa_core_v1_ResourceLocator_Directive_alt(const udpa_core_v1_ResourceLocator_Directive *msg) { return UPB_READ_ONEOF(msg, const udpa_core_v1_ResourceLocator*, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 1, NULL); }
-UPB_INLINE bool udpa_core_v1_ResourceLocator_Directive_has_entry(const udpa_core_v1_ResourceLocator_Directive *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 2; }
-UPB_INLINE upb_strview udpa_core_v1_ResourceLocator_Directive_entry(const udpa_core_v1_ResourceLocator_Directive *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 2, upb_strview_make("", strlen(""))); }
-
-UPB_INLINE void udpa_core_v1_ResourceLocator_Directive_set_alt(udpa_core_v1_ResourceLocator_Directive *msg, udpa_core_v1_ResourceLocator* value) {
- UPB_WRITE_ONEOF(msg, udpa_core_v1_ResourceLocator*, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 1);
-}
-UPB_INLINE struct udpa_core_v1_ResourceLocator* udpa_core_v1_ResourceLocator_Directive_mutable_alt(udpa_core_v1_ResourceLocator_Directive *msg, upb_arena *arena) {
- struct udpa_core_v1_ResourceLocator* sub = (struct udpa_core_v1_ResourceLocator*)udpa_core_v1_ResourceLocator_Directive_alt(msg);
- if (sub == NULL) {
- sub = (struct udpa_core_v1_ResourceLocator*)_upb_msg_new(&udpa_core_v1_ResourceLocator_msginit, arena);
- if (!sub) return NULL;
- udpa_core_v1_ResourceLocator_Directive_set_alt(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void udpa_core_v1_ResourceLocator_Directive_set_entry(udpa_core_v1_ResourceLocator_Directive *msg, upb_strview value) {
- UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 2);
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* UDPA_CORE_V1_RESOURCE_LOCATOR_PROTO_UPB_H_ */
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * udpa/core/v1/resource_locator.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef UDPA_CORE_V1_RESOURCE_LOCATOR_PROTO_UPB_H_
+#define UDPA_CORE_V1_RESOURCE_LOCATOR_PROTO_UPB_H_
+
+#include "upb/msg.h"
+#include "upb/decode.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct udpa_core_v1_ResourceLocator;
+struct udpa_core_v1_ResourceLocator_Directive;
+typedef struct udpa_core_v1_ResourceLocator udpa_core_v1_ResourceLocator;
+typedef struct udpa_core_v1_ResourceLocator_Directive udpa_core_v1_ResourceLocator_Directive;
+extern const upb_msglayout udpa_core_v1_ResourceLocator_msginit;
+extern const upb_msglayout udpa_core_v1_ResourceLocator_Directive_msginit;
+struct udpa_core_v1_ContextParams;
+extern const upb_msglayout udpa_core_v1_ContextParams_msginit;
+
+typedef enum {
+ udpa_core_v1_ResourceLocator_UDPA = 0,
+ udpa_core_v1_ResourceLocator_HTTP = 1,
+ udpa_core_v1_ResourceLocator_FILE = 2
+} udpa_core_v1_ResourceLocator_Scheme;
+
+
+/* udpa.core.v1.ResourceLocator */
+
+UPB_INLINE udpa_core_v1_ResourceLocator *udpa_core_v1_ResourceLocator_new(upb_arena *arena) {
+ return (udpa_core_v1_ResourceLocator *)_upb_msg_new(&udpa_core_v1_ResourceLocator_msginit, arena);
+}
+UPB_INLINE udpa_core_v1_ResourceLocator *udpa_core_v1_ResourceLocator_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ udpa_core_v1_ResourceLocator *ret = udpa_core_v1_ResourceLocator_new(arena);
+ return (ret && upb_decode(buf, size, ret, &udpa_core_v1_ResourceLocator_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *udpa_core_v1_ResourceLocator_serialize(const udpa_core_v1_ResourceLocator *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &udpa_core_v1_ResourceLocator_msginit, arena, len);
+}
+
+typedef enum {
+ udpa_core_v1_ResourceLocator_context_param_specifier_exact_context = 5,
+ udpa_core_v1_ResourceLocator_context_param_specifier_NOT_SET = 0
+} udpa_core_v1_ResourceLocator_context_param_specifier_oneofcases;
+UPB_INLINE udpa_core_v1_ResourceLocator_context_param_specifier_oneofcases udpa_core_v1_ResourceLocator_context_param_specifier_case(const udpa_core_v1_ResourceLocator* msg) { return (udpa_core_v1_ResourceLocator_context_param_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(36, 64), int32_t); }
+
+UPB_INLINE int32_t udpa_core_v1_ResourceLocator_scheme(const udpa_core_v1_ResourceLocator *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
+UPB_INLINE upb_strview const* udpa_core_v1_ResourceLocator_id(const udpa_core_v1_ResourceLocator *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(24, 40), len); }
+UPB_INLINE upb_strview udpa_core_v1_ResourceLocator_authority(const udpa_core_v1_ResourceLocator *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview); }
+UPB_INLINE upb_strview udpa_core_v1_ResourceLocator_resource_type(const udpa_core_v1_ResourceLocator *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_strview); }
+UPB_INLINE bool udpa_core_v1_ResourceLocator_has_exact_context(const udpa_core_v1_ResourceLocator *msg) { return _upb_getoneofcase(msg, UPB_SIZE(36, 64)) == 5; }
+UPB_INLINE const struct udpa_core_v1_ContextParams* udpa_core_v1_ResourceLocator_exact_context(const udpa_core_v1_ResourceLocator *msg) { return UPB_READ_ONEOF(msg, const struct udpa_core_v1_ContextParams*, UPB_SIZE(32, 56), UPB_SIZE(36, 64), 5, NULL); }
+UPB_INLINE bool udpa_core_v1_ResourceLocator_has_directives(const udpa_core_v1_ResourceLocator *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 48)); }
+UPB_INLINE const udpa_core_v1_ResourceLocator_Directive* const* udpa_core_v1_ResourceLocator_directives(const udpa_core_v1_ResourceLocator *msg, size_t *len) { return (const udpa_core_v1_ResourceLocator_Directive* const*)_upb_array_accessor(msg, UPB_SIZE(28, 48), len); }
+
+UPB_INLINE void udpa_core_v1_ResourceLocator_set_scheme(udpa_core_v1_ResourceLocator *msg, int32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
+}
+UPB_INLINE upb_strview* udpa_core_v1_ResourceLocator_mutable_id(udpa_core_v1_ResourceLocator *msg, size_t *len) {
+ return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 40), len);
+}
+UPB_INLINE upb_strview* udpa_core_v1_ResourceLocator_resize_id(udpa_core_v1_ResourceLocator *msg, size_t len, upb_arena *arena) {
+ return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(24, 40), len, UPB_TYPE_STRING, arena);
+}
+UPB_INLINE bool udpa_core_v1_ResourceLocator_add_id(udpa_core_v1_ResourceLocator *msg, upb_strview val, upb_arena *arena) {
+ return _upb_array_append_accessor(msg, UPB_SIZE(24, 40), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
+ arena);
+}
+UPB_INLINE void udpa_core_v1_ResourceLocator_set_authority(udpa_core_v1_ResourceLocator *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview) = value;
+}
+UPB_INLINE void udpa_core_v1_ResourceLocator_set_resource_type(udpa_core_v1_ResourceLocator *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_strview) = value;
+}
+UPB_INLINE void udpa_core_v1_ResourceLocator_set_exact_context(udpa_core_v1_ResourceLocator *msg, struct udpa_core_v1_ContextParams* value) {
+ UPB_WRITE_ONEOF(msg, struct udpa_core_v1_ContextParams*, UPB_SIZE(32, 56), value, UPB_SIZE(36, 64), 5);
+}
+UPB_INLINE struct udpa_core_v1_ContextParams* udpa_core_v1_ResourceLocator_mutable_exact_context(udpa_core_v1_ResourceLocator *msg, upb_arena *arena) {
+ struct udpa_core_v1_ContextParams* sub = (struct udpa_core_v1_ContextParams*)udpa_core_v1_ResourceLocator_exact_context(msg);
+ if (sub == NULL) {
+ sub = (struct udpa_core_v1_ContextParams*)_upb_msg_new(&udpa_core_v1_ContextParams_msginit, arena);
+ if (!sub) return NULL;
+ udpa_core_v1_ResourceLocator_set_exact_context(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE udpa_core_v1_ResourceLocator_Directive** udpa_core_v1_ResourceLocator_mutable_directives(udpa_core_v1_ResourceLocator *msg, size_t *len) {
+ return (udpa_core_v1_ResourceLocator_Directive**)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 48), len);
+}
+UPB_INLINE udpa_core_v1_ResourceLocator_Directive** udpa_core_v1_ResourceLocator_resize_directives(udpa_core_v1_ResourceLocator *msg, size_t len, upb_arena *arena) {
+ return (udpa_core_v1_ResourceLocator_Directive**)_upb_array_resize_accessor(msg, UPB_SIZE(28, 48), len, UPB_TYPE_MESSAGE, arena);
+}
+UPB_INLINE struct udpa_core_v1_ResourceLocator_Directive* udpa_core_v1_ResourceLocator_add_directives(udpa_core_v1_ResourceLocator *msg, upb_arena *arena) {
+ struct udpa_core_v1_ResourceLocator_Directive* sub = (struct udpa_core_v1_ResourceLocator_Directive*)_upb_msg_new(&udpa_core_v1_ResourceLocator_Directive_msginit, arena);
+ bool ok = _upb_array_append_accessor(
+ msg, UPB_SIZE(28, 48), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+
+/* udpa.core.v1.ResourceLocator.Directive */
+
+UPB_INLINE udpa_core_v1_ResourceLocator_Directive *udpa_core_v1_ResourceLocator_Directive_new(upb_arena *arena) {
+ return (udpa_core_v1_ResourceLocator_Directive *)_upb_msg_new(&udpa_core_v1_ResourceLocator_Directive_msginit, arena);
+}
+UPB_INLINE udpa_core_v1_ResourceLocator_Directive *udpa_core_v1_ResourceLocator_Directive_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ udpa_core_v1_ResourceLocator_Directive *ret = udpa_core_v1_ResourceLocator_Directive_new(arena);
+ return (ret && upb_decode(buf, size, ret, &udpa_core_v1_ResourceLocator_Directive_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *udpa_core_v1_ResourceLocator_Directive_serialize(const udpa_core_v1_ResourceLocator_Directive *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &udpa_core_v1_ResourceLocator_Directive_msginit, arena, len);
+}
+
+typedef enum {
+ udpa_core_v1_ResourceLocator_Directive_directive_alt = 1,
+ udpa_core_v1_ResourceLocator_Directive_directive_entry = 2,
+ udpa_core_v1_ResourceLocator_Directive_directive_NOT_SET = 0
+} udpa_core_v1_ResourceLocator_Directive_directive_oneofcases;
+UPB_INLINE udpa_core_v1_ResourceLocator_Directive_directive_oneofcases udpa_core_v1_ResourceLocator_Directive_directive_case(const udpa_core_v1_ResourceLocator_Directive* msg) { return (udpa_core_v1_ResourceLocator_Directive_directive_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(8, 16), int32_t); }
+
+UPB_INLINE bool udpa_core_v1_ResourceLocator_Directive_has_alt(const udpa_core_v1_ResourceLocator_Directive *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 1; }
+UPB_INLINE const udpa_core_v1_ResourceLocator* udpa_core_v1_ResourceLocator_Directive_alt(const udpa_core_v1_ResourceLocator_Directive *msg) { return UPB_READ_ONEOF(msg, const udpa_core_v1_ResourceLocator*, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 1, NULL); }
+UPB_INLINE bool udpa_core_v1_ResourceLocator_Directive_has_entry(const udpa_core_v1_ResourceLocator_Directive *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 2; }
+UPB_INLINE upb_strview udpa_core_v1_ResourceLocator_Directive_entry(const udpa_core_v1_ResourceLocator_Directive *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 2, upb_strview_make("", strlen(""))); }
+
+UPB_INLINE void udpa_core_v1_ResourceLocator_Directive_set_alt(udpa_core_v1_ResourceLocator_Directive *msg, udpa_core_v1_ResourceLocator* value) {
+ UPB_WRITE_ONEOF(msg, udpa_core_v1_ResourceLocator*, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 1);
+}
+UPB_INLINE struct udpa_core_v1_ResourceLocator* udpa_core_v1_ResourceLocator_Directive_mutable_alt(udpa_core_v1_ResourceLocator_Directive *msg, upb_arena *arena) {
+ struct udpa_core_v1_ResourceLocator* sub = (struct udpa_core_v1_ResourceLocator*)udpa_core_v1_ResourceLocator_Directive_alt(msg);
+ if (sub == NULL) {
+ sub = (struct udpa_core_v1_ResourceLocator*)_upb_msg_new(&udpa_core_v1_ResourceLocator_msginit, arena);
+ if (!sub) return NULL;
+ udpa_core_v1_ResourceLocator_Directive_set_alt(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void udpa_core_v1_ResourceLocator_Directive_set_entry(udpa_core_v1_ResourceLocator_Directive *msg, upb_strview value) {
+ UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 2);
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* UDPA_CORE_V1_RESOURCE_LOCATOR_PROTO_UPB_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/udpa/core/v1/resource_name.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/udpa/core/v1/resource_name.upb.c
index 45e329a4be6..095399de4da 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/udpa/core/v1/resource_name.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/udpa/core/v1/resource_name.upb.c
@@ -1,36 +1,36 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * udpa/core/v1/resource_name.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include <stddef.h>
-#include "upb/msg.h"
-#include "udpa/core/v1/resource_name.upb.h"
-#include "udpa/annotations/status.upb.h"
-#include "udpa/core/v1/context_params.upb.h"
-#include "validate/validate.upb.h"
-
-#include "upb/port_def.inc"
-
-static const upb_msglayout *const udpa_core_v1_ResourceName_submsgs[1] = {
- &udpa_core_v1_ContextParams_msginit,
-};
-
-static const upb_msglayout_field udpa_core_v1_ResourceName__fields[4] = {
- {1, UPB_SIZE(20, 40), 0, 0, 9, 3},
- {2, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {3, UPB_SIZE(8, 16), 0, 0, 9, 1},
- {4, UPB_SIZE(16, 32), 0, 0, 11, 1},
-};
-
-const upb_msglayout udpa_core_v1_ResourceName_msginit = {
- &udpa_core_v1_ResourceName_submsgs[0],
- &udpa_core_v1_ResourceName__fields[0],
- UPB_SIZE(24, 48), 4, false,
-};
-
-#include "upb/port_undef.inc"
-
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * udpa/core/v1/resource_name.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg.h"
+#include "udpa/core/v1/resource_name.upb.h"
+#include "udpa/annotations/status.upb.h"
+#include "udpa/core/v1/context_params.upb.h"
+#include "validate/validate.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_msglayout *const udpa_core_v1_ResourceName_submsgs[1] = {
+ &udpa_core_v1_ContextParams_msginit,
+};
+
+static const upb_msglayout_field udpa_core_v1_ResourceName__fields[4] = {
+ {1, UPB_SIZE(20, 40), 0, 0, 9, 3},
+ {2, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {3, UPB_SIZE(8, 16), 0, 0, 9, 1},
+ {4, UPB_SIZE(16, 32), 0, 0, 11, 1},
+};
+
+const upb_msglayout udpa_core_v1_ResourceName_msginit = {
+ &udpa_core_v1_ResourceName_submsgs[0],
+ &udpa_core_v1_ResourceName__fields[0],
+ UPB_SIZE(24, 48), 4, false,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/udpa/core/v1/resource_name.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/udpa/core/v1/resource_name.upb.h
index 69b9bf5746d..40d807393c9 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/udpa/core/v1/resource_name.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/udpa/core/v1/resource_name.upb.h
@@ -1,84 +1,84 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * udpa/core/v1/resource_name.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef UDPA_CORE_V1_RESOURCE_NAME_PROTO_UPB_H_
-#define UDPA_CORE_V1_RESOURCE_NAME_PROTO_UPB_H_
-
-#include "upb/msg.h"
-#include "upb/decode.h"
-#include "upb/encode.h"
-
-#include "upb/port_def.inc"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct udpa_core_v1_ResourceName;
-typedef struct udpa_core_v1_ResourceName udpa_core_v1_ResourceName;
-extern const upb_msglayout udpa_core_v1_ResourceName_msginit;
-struct udpa_core_v1_ContextParams;
-extern const upb_msglayout udpa_core_v1_ContextParams_msginit;
-
-
-/* udpa.core.v1.ResourceName */
-
-UPB_INLINE udpa_core_v1_ResourceName *udpa_core_v1_ResourceName_new(upb_arena *arena) {
- return (udpa_core_v1_ResourceName *)_upb_msg_new(&udpa_core_v1_ResourceName_msginit, arena);
-}
-UPB_INLINE udpa_core_v1_ResourceName *udpa_core_v1_ResourceName_parse(const char *buf, size_t size,
- upb_arena *arena) {
- udpa_core_v1_ResourceName *ret = udpa_core_v1_ResourceName_new(arena);
- return (ret && upb_decode(buf, size, ret, &udpa_core_v1_ResourceName_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE char *udpa_core_v1_ResourceName_serialize(const udpa_core_v1_ResourceName *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &udpa_core_v1_ResourceName_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview const* udpa_core_v1_ResourceName_id(const udpa_core_v1_ResourceName *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(20, 40), len); }
-UPB_INLINE upb_strview udpa_core_v1_ResourceName_authority(const udpa_core_v1_ResourceName *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE upb_strview udpa_core_v1_ResourceName_resource_type(const udpa_core_v1_ResourceName *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview); }
-UPB_INLINE bool udpa_core_v1_ResourceName_has_context(const udpa_core_v1_ResourceName *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); }
-UPB_INLINE const struct udpa_core_v1_ContextParams* udpa_core_v1_ResourceName_context(const udpa_core_v1_ResourceName *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const struct udpa_core_v1_ContextParams*); }
-
-UPB_INLINE upb_strview* udpa_core_v1_ResourceName_mutable_id(udpa_core_v1_ResourceName *msg, size_t *len) {
- return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 40), len);
-}
-UPB_INLINE upb_strview* udpa_core_v1_ResourceName_resize_id(udpa_core_v1_ResourceName *msg, size_t len, upb_arena *arena) {
- return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(20, 40), len, UPB_TYPE_STRING, arena);
-}
-UPB_INLINE bool udpa_core_v1_ResourceName_add_id(udpa_core_v1_ResourceName *msg, upb_strview val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(20, 40), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
- arena);
-}
-UPB_INLINE void udpa_core_v1_ResourceName_set_authority(udpa_core_v1_ResourceName *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-UPB_INLINE void udpa_core_v1_ResourceName_set_resource_type(udpa_core_v1_ResourceName *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview) = value;
-}
-UPB_INLINE void udpa_core_v1_ResourceName_set_context(udpa_core_v1_ResourceName *msg, struct udpa_core_v1_ContextParams* value) {
- *UPB_PTR_AT(msg, UPB_SIZE(16, 32), struct udpa_core_v1_ContextParams*) = value;
-}
-UPB_INLINE struct udpa_core_v1_ContextParams* udpa_core_v1_ResourceName_mutable_context(udpa_core_v1_ResourceName *msg, upb_arena *arena) {
- struct udpa_core_v1_ContextParams* sub = (struct udpa_core_v1_ContextParams*)udpa_core_v1_ResourceName_context(msg);
- if (sub == NULL) {
- sub = (struct udpa_core_v1_ContextParams*)_upb_msg_new(&udpa_core_v1_ContextParams_msginit, arena);
- if (!sub) return NULL;
- udpa_core_v1_ResourceName_set_context(msg, sub);
- }
- return sub;
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* UDPA_CORE_V1_RESOURCE_NAME_PROTO_UPB_H_ */
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * udpa/core/v1/resource_name.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef UDPA_CORE_V1_RESOURCE_NAME_PROTO_UPB_H_
+#define UDPA_CORE_V1_RESOURCE_NAME_PROTO_UPB_H_
+
+#include "upb/msg.h"
+#include "upb/decode.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct udpa_core_v1_ResourceName;
+typedef struct udpa_core_v1_ResourceName udpa_core_v1_ResourceName;
+extern const upb_msglayout udpa_core_v1_ResourceName_msginit;
+struct udpa_core_v1_ContextParams;
+extern const upb_msglayout udpa_core_v1_ContextParams_msginit;
+
+
+/* udpa.core.v1.ResourceName */
+
+UPB_INLINE udpa_core_v1_ResourceName *udpa_core_v1_ResourceName_new(upb_arena *arena) {
+ return (udpa_core_v1_ResourceName *)_upb_msg_new(&udpa_core_v1_ResourceName_msginit, arena);
+}
+UPB_INLINE udpa_core_v1_ResourceName *udpa_core_v1_ResourceName_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ udpa_core_v1_ResourceName *ret = udpa_core_v1_ResourceName_new(arena);
+ return (ret && upb_decode(buf, size, ret, &udpa_core_v1_ResourceName_msginit, arena)) ? ret : NULL;
+}
+UPB_INLINE char *udpa_core_v1_ResourceName_serialize(const udpa_core_v1_ResourceName *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &udpa_core_v1_ResourceName_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview const* udpa_core_v1_ResourceName_id(const udpa_core_v1_ResourceName *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(20, 40), len); }
+UPB_INLINE upb_strview udpa_core_v1_ResourceName_authority(const udpa_core_v1_ResourceName *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE upb_strview udpa_core_v1_ResourceName_resource_type(const udpa_core_v1_ResourceName *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview); }
+UPB_INLINE bool udpa_core_v1_ResourceName_has_context(const udpa_core_v1_ResourceName *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); }
+UPB_INLINE const struct udpa_core_v1_ContextParams* udpa_core_v1_ResourceName_context(const udpa_core_v1_ResourceName *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const struct udpa_core_v1_ContextParams*); }
+
+UPB_INLINE upb_strview* udpa_core_v1_ResourceName_mutable_id(udpa_core_v1_ResourceName *msg, size_t *len) {
+ return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 40), len);
+}
+UPB_INLINE upb_strview* udpa_core_v1_ResourceName_resize_id(udpa_core_v1_ResourceName *msg, size_t len, upb_arena *arena) {
+ return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(20, 40), len, UPB_TYPE_STRING, arena);
+}
+UPB_INLINE bool udpa_core_v1_ResourceName_add_id(udpa_core_v1_ResourceName *msg, upb_strview val, upb_arena *arena) {
+ return _upb_array_append_accessor(msg, UPB_SIZE(20, 40), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
+ arena);
+}
+UPB_INLINE void udpa_core_v1_ResourceName_set_authority(udpa_core_v1_ResourceName *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+UPB_INLINE void udpa_core_v1_ResourceName_set_resource_type(udpa_core_v1_ResourceName *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview) = value;
+}
+UPB_INLINE void udpa_core_v1_ResourceName_set_context(udpa_core_v1_ResourceName *msg, struct udpa_core_v1_ContextParams* value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), struct udpa_core_v1_ContextParams*) = value;
+}
+UPB_INLINE struct udpa_core_v1_ContextParams* udpa_core_v1_ResourceName_mutable_context(udpa_core_v1_ResourceName *msg, upb_arena *arena) {
+ struct udpa_core_v1_ContextParams* sub = (struct udpa_core_v1_ContextParams*)udpa_core_v1_ResourceName_context(msg);
+ if (sub == NULL) {
+ sub = (struct udpa_core_v1_ContextParams*)_upb_msg_new(&udpa_core_v1_ContextParams_msginit, arena);
+ if (!sub) return NULL;
+ udpa_core_v1_ResourceName_set_context(msg, sub);
+ }
+ return sub;
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* UDPA_CORE_V1_RESOURCE_NAME_PROTO_UPB_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c
index 976cdeaf510..aa9918f024a 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c
@@ -22,8 +22,8 @@ static const upb_msglayout_field udpa_data_orca_v1_OrcaLoadReport__fields[5] = {
{1, UPB_SIZE(0, 0), 0, 0, 1, 1},
{2, UPB_SIZE(8, 8), 0, 0, 1, 1},
{3, UPB_SIZE(16, 16), 0, 0, 4, 1},
- {4, UPB_SIZE(24, 24), 0, 0, 11, _UPB_LABEL_MAP},
- {5, UPB_SIZE(28, 32), 0, 1, 11, _UPB_LABEL_MAP},
+ {4, UPB_SIZE(24, 24), 0, 0, 11, _UPB_LABEL_MAP},
+ {5, UPB_SIZE(28, 32), 0, 1, 11, _UPB_LABEL_MAP},
};
const upb_msglayout udpa_data_orca_v1_OrcaLoadReport_msginit = {
@@ -33,8 +33,8 @@ const upb_msglayout udpa_data_orca_v1_OrcaLoadReport_msginit = {
};
static const upb_msglayout_field udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 1, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {2, UPB_SIZE(8, 16), 0, 0, 1, 1},
};
const upb_msglayout udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry_msginit = {
@@ -44,8 +44,8 @@ const upb_msglayout udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry_msginit =
};
static const upb_msglayout_field udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 1, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {2, UPB_SIZE(8, 16), 0, 0, 1, 1},
};
const upb_msglayout udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry_msginit = {
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.h
index 7be7f396238..5c63aef12ed 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.h
@@ -33,7 +33,7 @@ extern const upb_msglayout udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry_msg
/* udpa.data.orca.v1.OrcaLoadReport */
UPB_INLINE udpa_data_orca_v1_OrcaLoadReport *udpa_data_orca_v1_OrcaLoadReport_new(upb_arena *arena) {
- return (udpa_data_orca_v1_OrcaLoadReport *)_upb_msg_new(&udpa_data_orca_v1_OrcaLoadReport_msginit, arena);
+ return (udpa_data_orca_v1_OrcaLoadReport *)_upb_msg_new(&udpa_data_orca_v1_OrcaLoadReport_msginit, arena);
}
UPB_INLINE udpa_data_orca_v1_OrcaLoadReport *udpa_data_orca_v1_OrcaLoadReport_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -44,68 +44,68 @@ UPB_INLINE char *udpa_data_orca_v1_OrcaLoadReport_serialize(const udpa_data_orca
return upb_encode(msg, &udpa_data_orca_v1_OrcaLoadReport_msginit, arena, len);
}
-UPB_INLINE double udpa_data_orca_v1_OrcaLoadReport_cpu_utilization(const udpa_data_orca_v1_OrcaLoadReport *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), double); }
-UPB_INLINE double udpa_data_orca_v1_OrcaLoadReport_mem_utilization(const udpa_data_orca_v1_OrcaLoadReport *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), double); }
-UPB_INLINE uint64_t udpa_data_orca_v1_OrcaLoadReport_rps(const udpa_data_orca_v1_OrcaLoadReport *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), uint64_t); }
-UPB_INLINE bool udpa_data_orca_v1_OrcaLoadReport_has_request_cost(const udpa_data_orca_v1_OrcaLoadReport *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 24)); }
-UPB_INLINE size_t udpa_data_orca_v1_OrcaLoadReport_request_cost_size(const udpa_data_orca_v1_OrcaLoadReport *msg) {return _upb_msg_map_size(msg, UPB_SIZE(24, 24)); }
-UPB_INLINE bool udpa_data_orca_v1_OrcaLoadReport_request_cost_get(const udpa_data_orca_v1_OrcaLoadReport *msg, upb_strview key, double *val) { return _upb_msg_map_get(msg, UPB_SIZE(24, 24), &key, 0, val, sizeof(*val)); }
-UPB_INLINE const udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry* udpa_data_orca_v1_OrcaLoadReport_request_cost_next(const udpa_data_orca_v1_OrcaLoadReport *msg, size_t* iter) { return (const udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry*)_upb_msg_map_next(msg, UPB_SIZE(24, 24), iter); }
-UPB_INLINE bool udpa_data_orca_v1_OrcaLoadReport_has_utilization(const udpa_data_orca_v1_OrcaLoadReport *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 32)); }
-UPB_INLINE size_t udpa_data_orca_v1_OrcaLoadReport_utilization_size(const udpa_data_orca_v1_OrcaLoadReport *msg) {return _upb_msg_map_size(msg, UPB_SIZE(28, 32)); }
-UPB_INLINE bool udpa_data_orca_v1_OrcaLoadReport_utilization_get(const udpa_data_orca_v1_OrcaLoadReport *msg, upb_strview key, double *val) { return _upb_msg_map_get(msg, UPB_SIZE(28, 32), &key, 0, val, sizeof(*val)); }
-UPB_INLINE const udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry* udpa_data_orca_v1_OrcaLoadReport_utilization_next(const udpa_data_orca_v1_OrcaLoadReport *msg, size_t* iter) { return (const udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry*)_upb_msg_map_next(msg, UPB_SIZE(28, 32), iter); }
+UPB_INLINE double udpa_data_orca_v1_OrcaLoadReport_cpu_utilization(const udpa_data_orca_v1_OrcaLoadReport *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), double); }
+UPB_INLINE double udpa_data_orca_v1_OrcaLoadReport_mem_utilization(const udpa_data_orca_v1_OrcaLoadReport *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), double); }
+UPB_INLINE uint64_t udpa_data_orca_v1_OrcaLoadReport_rps(const udpa_data_orca_v1_OrcaLoadReport *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), uint64_t); }
+UPB_INLINE bool udpa_data_orca_v1_OrcaLoadReport_has_request_cost(const udpa_data_orca_v1_OrcaLoadReport *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 24)); }
+UPB_INLINE size_t udpa_data_orca_v1_OrcaLoadReport_request_cost_size(const udpa_data_orca_v1_OrcaLoadReport *msg) {return _upb_msg_map_size(msg, UPB_SIZE(24, 24)); }
+UPB_INLINE bool udpa_data_orca_v1_OrcaLoadReport_request_cost_get(const udpa_data_orca_v1_OrcaLoadReport *msg, upb_strview key, double *val) { return _upb_msg_map_get(msg, UPB_SIZE(24, 24), &key, 0, val, sizeof(*val)); }
+UPB_INLINE const udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry* udpa_data_orca_v1_OrcaLoadReport_request_cost_next(const udpa_data_orca_v1_OrcaLoadReport *msg, size_t* iter) { return (const udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry*)_upb_msg_map_next(msg, UPB_SIZE(24, 24), iter); }
+UPB_INLINE bool udpa_data_orca_v1_OrcaLoadReport_has_utilization(const udpa_data_orca_v1_OrcaLoadReport *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 32)); }
+UPB_INLINE size_t udpa_data_orca_v1_OrcaLoadReport_utilization_size(const udpa_data_orca_v1_OrcaLoadReport *msg) {return _upb_msg_map_size(msg, UPB_SIZE(28, 32)); }
+UPB_INLINE bool udpa_data_orca_v1_OrcaLoadReport_utilization_get(const udpa_data_orca_v1_OrcaLoadReport *msg, upb_strview key, double *val) { return _upb_msg_map_get(msg, UPB_SIZE(28, 32), &key, 0, val, sizeof(*val)); }
+UPB_INLINE const udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry* udpa_data_orca_v1_OrcaLoadReport_utilization_next(const udpa_data_orca_v1_OrcaLoadReport *msg, size_t* iter) { return (const udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry*)_upb_msg_map_next(msg, UPB_SIZE(28, 32), iter); }
UPB_INLINE void udpa_data_orca_v1_OrcaLoadReport_set_cpu_utilization(udpa_data_orca_v1_OrcaLoadReport *msg, double value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), double) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), double) = value;
}
UPB_INLINE void udpa_data_orca_v1_OrcaLoadReport_set_mem_utilization(udpa_data_orca_v1_OrcaLoadReport *msg, double value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), double) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), double) = value;
}
UPB_INLINE void udpa_data_orca_v1_OrcaLoadReport_set_rps(udpa_data_orca_v1_OrcaLoadReport *msg, uint64_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(16, 16), uint64_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 16), uint64_t) = value;
}
-UPB_INLINE void udpa_data_orca_v1_OrcaLoadReport_request_cost_clear(udpa_data_orca_v1_OrcaLoadReport *msg) { _upb_msg_map_clear(msg, UPB_SIZE(24, 24)); }
-UPB_INLINE bool udpa_data_orca_v1_OrcaLoadReport_request_cost_set(udpa_data_orca_v1_OrcaLoadReport *msg, upb_strview key, double val, upb_arena *a) { return _upb_msg_map_set(msg, UPB_SIZE(24, 24), &key, 0, &val, sizeof(val), a); }
-UPB_INLINE bool udpa_data_orca_v1_OrcaLoadReport_request_cost_delete(udpa_data_orca_v1_OrcaLoadReport *msg, upb_strview key) { return _upb_msg_map_delete(msg, UPB_SIZE(24, 24), &key, 0); }
-UPB_INLINE udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry* udpa_data_orca_v1_OrcaLoadReport_request_cost_nextmutable(udpa_data_orca_v1_OrcaLoadReport *msg, size_t* iter) { return (udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry*)_upb_msg_map_next(msg, UPB_SIZE(24, 24), iter); }
-UPB_INLINE void udpa_data_orca_v1_OrcaLoadReport_utilization_clear(udpa_data_orca_v1_OrcaLoadReport *msg) { _upb_msg_map_clear(msg, UPB_SIZE(28, 32)); }
-UPB_INLINE bool udpa_data_orca_v1_OrcaLoadReport_utilization_set(udpa_data_orca_v1_OrcaLoadReport *msg, upb_strview key, double val, upb_arena *a) { return _upb_msg_map_set(msg, UPB_SIZE(28, 32), &key, 0, &val, sizeof(val), a); }
-UPB_INLINE bool udpa_data_orca_v1_OrcaLoadReport_utilization_delete(udpa_data_orca_v1_OrcaLoadReport *msg, upb_strview key) { return _upb_msg_map_delete(msg, UPB_SIZE(28, 32), &key, 0); }
-UPB_INLINE udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry* udpa_data_orca_v1_OrcaLoadReport_utilization_nextmutable(udpa_data_orca_v1_OrcaLoadReport *msg, size_t* iter) { return (udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry*)_upb_msg_map_next(msg, UPB_SIZE(28, 32), iter); }
+UPB_INLINE void udpa_data_orca_v1_OrcaLoadReport_request_cost_clear(udpa_data_orca_v1_OrcaLoadReport *msg) { _upb_msg_map_clear(msg, UPB_SIZE(24, 24)); }
+UPB_INLINE bool udpa_data_orca_v1_OrcaLoadReport_request_cost_set(udpa_data_orca_v1_OrcaLoadReport *msg, upb_strview key, double val, upb_arena *a) { return _upb_msg_map_set(msg, UPB_SIZE(24, 24), &key, 0, &val, sizeof(val), a); }
+UPB_INLINE bool udpa_data_orca_v1_OrcaLoadReport_request_cost_delete(udpa_data_orca_v1_OrcaLoadReport *msg, upb_strview key) { return _upb_msg_map_delete(msg, UPB_SIZE(24, 24), &key, 0); }
+UPB_INLINE udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry* udpa_data_orca_v1_OrcaLoadReport_request_cost_nextmutable(udpa_data_orca_v1_OrcaLoadReport *msg, size_t* iter) { return (udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry*)_upb_msg_map_next(msg, UPB_SIZE(24, 24), iter); }
+UPB_INLINE void udpa_data_orca_v1_OrcaLoadReport_utilization_clear(udpa_data_orca_v1_OrcaLoadReport *msg) { _upb_msg_map_clear(msg, UPB_SIZE(28, 32)); }
+UPB_INLINE bool udpa_data_orca_v1_OrcaLoadReport_utilization_set(udpa_data_orca_v1_OrcaLoadReport *msg, upb_strview key, double val, upb_arena *a) { return _upb_msg_map_set(msg, UPB_SIZE(28, 32), &key, 0, &val, sizeof(val), a); }
+UPB_INLINE bool udpa_data_orca_v1_OrcaLoadReport_utilization_delete(udpa_data_orca_v1_OrcaLoadReport *msg, upb_strview key) { return _upb_msg_map_delete(msg, UPB_SIZE(28, 32), &key, 0); }
+UPB_INLINE udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry* udpa_data_orca_v1_OrcaLoadReport_utilization_nextmutable(udpa_data_orca_v1_OrcaLoadReport *msg, size_t* iter) { return (udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry*)_upb_msg_map_next(msg, UPB_SIZE(28, 32), iter); }
/* udpa.data.orca.v1.OrcaLoadReport.RequestCostEntry */
-UPB_INLINE upb_strview udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry_key(const udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry *msg) {
- upb_strview ret;
- _upb_msg_map_key(msg, &ret, 0);
- return ret;
+UPB_INLINE upb_strview udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry_key(const udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry *msg) {
+ upb_strview ret;
+ _upb_msg_map_key(msg, &ret, 0);
+ return ret;
}
-UPB_INLINE double udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry_value(const udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry *msg) {
- double ret;
- _upb_msg_map_value(msg, &ret, sizeof(ret));
- return ret;
+UPB_INLINE double udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry_value(const udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry *msg) {
+ double ret;
+ _upb_msg_map_value(msg, &ret, sizeof(ret));
+ return ret;
}
UPB_INLINE void udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry_set_value(udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry *msg, double value) {
- _upb_msg_map_set_value(msg, &value, sizeof(double));
+ _upb_msg_map_set_value(msg, &value, sizeof(double));
}
/* udpa.data.orca.v1.OrcaLoadReport.UtilizationEntry */
-UPB_INLINE upb_strview udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry_key(const udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry *msg) {
- upb_strview ret;
- _upb_msg_map_key(msg, &ret, 0);
- return ret;
+UPB_INLINE upb_strview udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry_key(const udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry *msg) {
+ upb_strview ret;
+ _upb_msg_map_key(msg, &ret, 0);
+ return ret;
}
-UPB_INLINE double udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry_value(const udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry *msg) {
- double ret;
- _upb_msg_map_value(msg, &ret, sizeof(ret));
- return ret;
+UPB_INLINE double udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry_value(const udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry *msg) {
+ double ret;
+ _upb_msg_map_value(msg, &ret, sizeof(ret));
+ return ret;
}
UPB_INLINE void udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry_set_value(udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry *msg, double value) {
- _upb_msg_map_set_value(msg, &value, sizeof(double));
+ _upb_msg_map_set_value(msg, &value, sizeof(double));
}
#ifdef __cplusplus
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/validate/validate.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/validate/validate.upb.c
index 6d033b62345..63c324368d7 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/validate/validate.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/validate/validate.upb.c
@@ -41,34 +41,34 @@ static const upb_msglayout *const validate_FieldRules_submsgs[22] = {
};
static const upb_msglayout_field validate_FieldRules__fields[22] = {
- {1, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 8, 11, 1},
- {2, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 3, 11, 1},
- {3, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 9, 11, 1},
- {4, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 10, 11, 1},
- {5, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 20, 11, 1},
- {6, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 21, 11, 1},
- {7, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 16, 11, 1},
- {8, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 17, 11, 1},
- {9, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 6, 11, 1},
- {10, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 7, 11, 1},
- {11, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 14, 11, 1},
- {12, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 15, 11, 1},
- {13, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 1, 11, 1},
- {14, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 18, 11, 1},
- {15, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 2, 11, 1},
- {16, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 5, 11, 1},
- {17, UPB_SIZE(4, 8), 1, 12, 11, 1},
- {18, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 13, 11, 1},
- {19, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 11, 11, 1},
- {20, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, 1},
- {21, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 4, 11, 1},
- {22, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 19, 11, 1},
+ {1, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 8, 11, 1},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 3, 11, 1},
+ {3, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 9, 11, 1},
+ {4, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 10, 11, 1},
+ {5, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 20, 11, 1},
+ {6, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 21, 11, 1},
+ {7, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 16, 11, 1},
+ {8, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 17, 11, 1},
+ {9, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 6, 11, 1},
+ {10, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 7, 11, 1},
+ {11, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 14, 11, 1},
+ {12, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 15, 11, 1},
+ {13, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 1, 11, 1},
+ {14, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 18, 11, 1},
+ {15, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 2, 11, 1},
+ {16, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 5, 11, 1},
+ {17, UPB_SIZE(4, 8), 1, 12, 11, 1},
+ {18, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 13, 11, 1},
+ {19, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 11, 11, 1},
+ {20, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, 1},
+ {21, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 4, 11, 1},
+ {22, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 19, 11, 1},
};
const upb_msglayout validate_FieldRules_msginit = {
&validate_FieldRules_submsgs[0],
&validate_FieldRules__fields[0],
- UPB_SIZE(16, 32), 22, false,
+ UPB_SIZE(16, 32), 22, false,
};
static const upb_msglayout_field validate_FloatRules__fields[7] = {
@@ -273,45 +273,45 @@ const upb_msglayout validate_BoolRules_msginit = {
UPB_SIZE(2, 2), 1, false,
};
-static const upb_msglayout_field validate_StringRules__fields[25] = {
- {1, UPB_SIZE(60, 64), 8, 0, 12, 1},
+static const upb_msglayout_field validate_StringRules__fields[25] = {
+ {1, UPB_SIZE(60, 64), 8, 0, 12, 1},
{2, UPB_SIZE(8, 8), 1, 0, 4, 1},
{3, UPB_SIZE(16, 16), 2, 0, 4, 1},
{4, UPB_SIZE(24, 24), 3, 0, 4, 1},
{5, UPB_SIZE(32, 32), 4, 0, 4, 1},
- {6, UPB_SIZE(68, 80), 9, 0, 12, 1},
- {7, UPB_SIZE(76, 96), 10, 0, 12, 1},
- {8, UPB_SIZE(84, 112), 11, 0, 12, 1},
- {9, UPB_SIZE(92, 128), 12, 0, 12, 1},
- {10, UPB_SIZE(108, 160), 0, 0, 12, 3},
- {11, UPB_SIZE(112, 168), 0, 0, 12, 3},
- {12, UPB_SIZE(120, 176), UPB_SIZE(-129, -185), 0, 8, 1},
- {13, UPB_SIZE(120, 176), UPB_SIZE(-129, -185), 0, 8, 1},
- {14, UPB_SIZE(120, 176), UPB_SIZE(-129, -185), 0, 8, 1},
- {15, UPB_SIZE(120, 176), UPB_SIZE(-129, -185), 0, 8, 1},
- {16, UPB_SIZE(120, 176), UPB_SIZE(-129, -185), 0, 8, 1},
- {17, UPB_SIZE(120, 176), UPB_SIZE(-129, -185), 0, 8, 1},
- {18, UPB_SIZE(120, 176), UPB_SIZE(-129, -185), 0, 8, 1},
+ {6, UPB_SIZE(68, 80), 9, 0, 12, 1},
+ {7, UPB_SIZE(76, 96), 10, 0, 12, 1},
+ {8, UPB_SIZE(84, 112), 11, 0, 12, 1},
+ {9, UPB_SIZE(92, 128), 12, 0, 12, 1},
+ {10, UPB_SIZE(108, 160), 0, 0, 12, 3},
+ {11, UPB_SIZE(112, 168), 0, 0, 12, 3},
+ {12, UPB_SIZE(120, 176), UPB_SIZE(-129, -185), 0, 8, 1},
+ {13, UPB_SIZE(120, 176), UPB_SIZE(-129, -185), 0, 8, 1},
+ {14, UPB_SIZE(120, 176), UPB_SIZE(-129, -185), 0, 8, 1},
+ {15, UPB_SIZE(120, 176), UPB_SIZE(-129, -185), 0, 8, 1},
+ {16, UPB_SIZE(120, 176), UPB_SIZE(-129, -185), 0, 8, 1},
+ {17, UPB_SIZE(120, 176), UPB_SIZE(-129, -185), 0, 8, 1},
+ {18, UPB_SIZE(120, 176), UPB_SIZE(-129, -185), 0, 8, 1},
{19, UPB_SIZE(40, 40), 5, 0, 4, 1},
{20, UPB_SIZE(48, 48), 6, 0, 4, 1},
- {21, UPB_SIZE(120, 176), UPB_SIZE(-129, -185), 0, 8, 1},
- {22, UPB_SIZE(120, 176), UPB_SIZE(-129, -185), 0, 8, 1},
- {23, UPB_SIZE(100, 144), 13, 0, 12, 1},
- {24, UPB_SIZE(120, 176), UPB_SIZE(-129, -185), 0, 14, 1},
- {25, UPB_SIZE(56, 56), 7, 0, 8, 1},
+ {21, UPB_SIZE(120, 176), UPB_SIZE(-129, -185), 0, 8, 1},
+ {22, UPB_SIZE(120, 176), UPB_SIZE(-129, -185), 0, 8, 1},
+ {23, UPB_SIZE(100, 144), 13, 0, 12, 1},
+ {24, UPB_SIZE(120, 176), UPB_SIZE(-129, -185), 0, 14, 1},
+ {25, UPB_SIZE(56, 56), 7, 0, 8, 1},
};
const upb_msglayout validate_StringRules_msginit = {
NULL,
&validate_StringRules__fields[0],
- UPB_SIZE(136, 192), 25, false,
+ UPB_SIZE(136, 192), 25, false,
};
static const upb_msglayout_field validate_BytesRules__fields[13] = {
{1, UPB_SIZE(32, 32), 4, 0, 12, 1},
{2, UPB_SIZE(8, 8), 1, 0, 4, 1},
{3, UPB_SIZE(16, 16), 2, 0, 4, 1},
- {4, UPB_SIZE(40, 48), 5, 0, 12, 1},
+ {4, UPB_SIZE(40, 48), 5, 0, 12, 1},
{5, UPB_SIZE(48, 64), 6, 0, 12, 1},
{6, UPB_SIZE(56, 80), 7, 0, 12, 1},
{7, UPB_SIZE(64, 96), 8, 0, 12, 1},
@@ -390,8 +390,8 @@ const upb_msglayout validate_MapRules_msginit = {
static const upb_msglayout_field validate_AnyRules__fields[3] = {
{1, UPB_SIZE(1, 1), 1, 0, 8, 1},
- {2, UPB_SIZE(4, 8), 0, 0, 12, 3},
- {3, UPB_SIZE(8, 16), 0, 0, 12, 3},
+ {2, UPB_SIZE(4, 8), 0, 0, 12, 3},
+ {3, UPB_SIZE(8, 16), 0, 0, 12, 3},
};
const upb_msglayout validate_AnyRules_msginit = {
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/validate/validate.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/validate/validate.upb.h
index 6e1a7e3f0d7..c29b4ec589b 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/validate/validate.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/validate/validate.upb.h
@@ -93,17 +93,17 @@ struct google_protobuf_Timestamp;
extern const upb_msglayout google_protobuf_Duration_msginit;
extern const upb_msglayout google_protobuf_Timestamp_msginit;
-typedef enum {
- validate_UNKNOWN = 0,
- validate_HTTP_HEADER_NAME = 1,
- validate_HTTP_HEADER_VALUE = 2
-} validate_KnownRegex;
+typedef enum {
+ validate_UNKNOWN = 0,
+ validate_HTTP_HEADER_NAME = 1,
+ validate_HTTP_HEADER_VALUE = 2
+} validate_KnownRegex;
+
-
/* validate.FieldRules */
UPB_INLINE validate_FieldRules *validate_FieldRules_new(upb_arena *arena) {
- return (validate_FieldRules *)_upb_msg_new(&validate_FieldRules_msginit, arena);
+ return (validate_FieldRules *)_upb_msg_new(&validate_FieldRules_msginit, arena);
}
UPB_INLINE validate_FieldRules *validate_FieldRules_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -138,313 +138,313 @@ typedef enum {
validate_FieldRules_type_timestamp = 22,
validate_FieldRules_type_NOT_SET = 0
} validate_FieldRules_type_oneofcases;
-UPB_INLINE validate_FieldRules_type_oneofcases validate_FieldRules_type_case(const validate_FieldRules* msg) { return (validate_FieldRules_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(12, 24), int32_t); }
-
-UPB_INLINE bool validate_FieldRules_has_float(const validate_FieldRules *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 1; }
-UPB_INLINE const validate_FloatRules* validate_FieldRules_float(const validate_FieldRules *msg) { return UPB_READ_ONEOF(msg, const validate_FloatRules*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 1, NULL); }
-UPB_INLINE bool validate_FieldRules_has_double(const validate_FieldRules *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 2; }
-UPB_INLINE const validate_DoubleRules* validate_FieldRules_double(const validate_FieldRules *msg) { return UPB_READ_ONEOF(msg, const validate_DoubleRules*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 2, NULL); }
-UPB_INLINE bool validate_FieldRules_has_int32(const validate_FieldRules *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 3; }
-UPB_INLINE const validate_Int32Rules* validate_FieldRules_int32(const validate_FieldRules *msg) { return UPB_READ_ONEOF(msg, const validate_Int32Rules*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 3, NULL); }
-UPB_INLINE bool validate_FieldRules_has_int64(const validate_FieldRules *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 4; }
-UPB_INLINE const validate_Int64Rules* validate_FieldRules_int64(const validate_FieldRules *msg) { return UPB_READ_ONEOF(msg, const validate_Int64Rules*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 4, NULL); }
-UPB_INLINE bool validate_FieldRules_has_uint32(const validate_FieldRules *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 5; }
-UPB_INLINE const validate_UInt32Rules* validate_FieldRules_uint32(const validate_FieldRules *msg) { return UPB_READ_ONEOF(msg, const validate_UInt32Rules*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 5, NULL); }
-UPB_INLINE bool validate_FieldRules_has_uint64(const validate_FieldRules *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 6; }
-UPB_INLINE const validate_UInt64Rules* validate_FieldRules_uint64(const validate_FieldRules *msg) { return UPB_READ_ONEOF(msg, const validate_UInt64Rules*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 6, NULL); }
-UPB_INLINE bool validate_FieldRules_has_sint32(const validate_FieldRules *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 7; }
-UPB_INLINE const validate_SInt32Rules* validate_FieldRules_sint32(const validate_FieldRules *msg) { return UPB_READ_ONEOF(msg, const validate_SInt32Rules*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 7, NULL); }
-UPB_INLINE bool validate_FieldRules_has_sint64(const validate_FieldRules *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 8; }
-UPB_INLINE const validate_SInt64Rules* validate_FieldRules_sint64(const validate_FieldRules *msg) { return UPB_READ_ONEOF(msg, const validate_SInt64Rules*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 8, NULL); }
-UPB_INLINE bool validate_FieldRules_has_fixed32(const validate_FieldRules *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 9; }
-UPB_INLINE const validate_Fixed32Rules* validate_FieldRules_fixed32(const validate_FieldRules *msg) { return UPB_READ_ONEOF(msg, const validate_Fixed32Rules*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 9, NULL); }
-UPB_INLINE bool validate_FieldRules_has_fixed64(const validate_FieldRules *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 10; }
-UPB_INLINE const validate_Fixed64Rules* validate_FieldRules_fixed64(const validate_FieldRules *msg) { return UPB_READ_ONEOF(msg, const validate_Fixed64Rules*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 10, NULL); }
-UPB_INLINE bool validate_FieldRules_has_sfixed32(const validate_FieldRules *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 11; }
-UPB_INLINE const validate_SFixed32Rules* validate_FieldRules_sfixed32(const validate_FieldRules *msg) { return UPB_READ_ONEOF(msg, const validate_SFixed32Rules*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 11, NULL); }
-UPB_INLINE bool validate_FieldRules_has_sfixed64(const validate_FieldRules *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 12; }
-UPB_INLINE const validate_SFixed64Rules* validate_FieldRules_sfixed64(const validate_FieldRules *msg) { return UPB_READ_ONEOF(msg, const validate_SFixed64Rules*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 12, NULL); }
-UPB_INLINE bool validate_FieldRules_has_bool(const validate_FieldRules *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 13; }
-UPB_INLINE const validate_BoolRules* validate_FieldRules_bool(const validate_FieldRules *msg) { return UPB_READ_ONEOF(msg, const validate_BoolRules*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 13, NULL); }
-UPB_INLINE bool validate_FieldRules_has_string(const validate_FieldRules *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 14; }
-UPB_INLINE const validate_StringRules* validate_FieldRules_string(const validate_FieldRules *msg) { return UPB_READ_ONEOF(msg, const validate_StringRules*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 14, NULL); }
-UPB_INLINE bool validate_FieldRules_has_bytes(const validate_FieldRules *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 15; }
-UPB_INLINE const validate_BytesRules* validate_FieldRules_bytes(const validate_FieldRules *msg) { return UPB_READ_ONEOF(msg, const validate_BytesRules*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 15, NULL); }
-UPB_INLINE bool validate_FieldRules_has_enum(const validate_FieldRules *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 16; }
-UPB_INLINE const validate_EnumRules* validate_FieldRules_enum(const validate_FieldRules *msg) { return UPB_READ_ONEOF(msg, const validate_EnumRules*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 16, NULL); }
-UPB_INLINE bool validate_FieldRules_has_message(const validate_FieldRules *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE const validate_MessageRules* validate_FieldRules_message(const validate_FieldRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const validate_MessageRules*); }
-UPB_INLINE bool validate_FieldRules_has_repeated(const validate_FieldRules *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 18; }
-UPB_INLINE const validate_RepeatedRules* validate_FieldRules_repeated(const validate_FieldRules *msg) { return UPB_READ_ONEOF(msg, const validate_RepeatedRules*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 18, NULL); }
-UPB_INLINE bool validate_FieldRules_has_map(const validate_FieldRules *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 19; }
-UPB_INLINE const validate_MapRules* validate_FieldRules_map(const validate_FieldRules *msg) { return UPB_READ_ONEOF(msg, const validate_MapRules*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 19, NULL); }
-UPB_INLINE bool validate_FieldRules_has_any(const validate_FieldRules *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 20; }
-UPB_INLINE const validate_AnyRules* validate_FieldRules_any(const validate_FieldRules *msg) { return UPB_READ_ONEOF(msg, const validate_AnyRules*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 20, NULL); }
-UPB_INLINE bool validate_FieldRules_has_duration(const validate_FieldRules *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 21; }
-UPB_INLINE const validate_DurationRules* validate_FieldRules_duration(const validate_FieldRules *msg) { return UPB_READ_ONEOF(msg, const validate_DurationRules*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 21, NULL); }
-UPB_INLINE bool validate_FieldRules_has_timestamp(const validate_FieldRules *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 22; }
-UPB_INLINE const validate_TimestampRules* validate_FieldRules_timestamp(const validate_FieldRules *msg) { return UPB_READ_ONEOF(msg, const validate_TimestampRules*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 22, NULL); }
+UPB_INLINE validate_FieldRules_type_oneofcases validate_FieldRules_type_case(const validate_FieldRules* msg) { return (validate_FieldRules_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(12, 24), int32_t); }
+
+UPB_INLINE bool validate_FieldRules_has_float(const validate_FieldRules *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 1; }
+UPB_INLINE const validate_FloatRules* validate_FieldRules_float(const validate_FieldRules *msg) { return UPB_READ_ONEOF(msg, const validate_FloatRules*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 1, NULL); }
+UPB_INLINE bool validate_FieldRules_has_double(const validate_FieldRules *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 2; }
+UPB_INLINE const validate_DoubleRules* validate_FieldRules_double(const validate_FieldRules *msg) { return UPB_READ_ONEOF(msg, const validate_DoubleRules*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 2, NULL); }
+UPB_INLINE bool validate_FieldRules_has_int32(const validate_FieldRules *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 3; }
+UPB_INLINE const validate_Int32Rules* validate_FieldRules_int32(const validate_FieldRules *msg) { return UPB_READ_ONEOF(msg, const validate_Int32Rules*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 3, NULL); }
+UPB_INLINE bool validate_FieldRules_has_int64(const validate_FieldRules *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 4; }
+UPB_INLINE const validate_Int64Rules* validate_FieldRules_int64(const validate_FieldRules *msg) { return UPB_READ_ONEOF(msg, const validate_Int64Rules*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 4, NULL); }
+UPB_INLINE bool validate_FieldRules_has_uint32(const validate_FieldRules *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 5; }
+UPB_INLINE const validate_UInt32Rules* validate_FieldRules_uint32(const validate_FieldRules *msg) { return UPB_READ_ONEOF(msg, const validate_UInt32Rules*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 5, NULL); }
+UPB_INLINE bool validate_FieldRules_has_uint64(const validate_FieldRules *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 6; }
+UPB_INLINE const validate_UInt64Rules* validate_FieldRules_uint64(const validate_FieldRules *msg) { return UPB_READ_ONEOF(msg, const validate_UInt64Rules*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 6, NULL); }
+UPB_INLINE bool validate_FieldRules_has_sint32(const validate_FieldRules *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 7; }
+UPB_INLINE const validate_SInt32Rules* validate_FieldRules_sint32(const validate_FieldRules *msg) { return UPB_READ_ONEOF(msg, const validate_SInt32Rules*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 7, NULL); }
+UPB_INLINE bool validate_FieldRules_has_sint64(const validate_FieldRules *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 8; }
+UPB_INLINE const validate_SInt64Rules* validate_FieldRules_sint64(const validate_FieldRules *msg) { return UPB_READ_ONEOF(msg, const validate_SInt64Rules*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 8, NULL); }
+UPB_INLINE bool validate_FieldRules_has_fixed32(const validate_FieldRules *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 9; }
+UPB_INLINE const validate_Fixed32Rules* validate_FieldRules_fixed32(const validate_FieldRules *msg) { return UPB_READ_ONEOF(msg, const validate_Fixed32Rules*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 9, NULL); }
+UPB_INLINE bool validate_FieldRules_has_fixed64(const validate_FieldRules *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 10; }
+UPB_INLINE const validate_Fixed64Rules* validate_FieldRules_fixed64(const validate_FieldRules *msg) { return UPB_READ_ONEOF(msg, const validate_Fixed64Rules*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 10, NULL); }
+UPB_INLINE bool validate_FieldRules_has_sfixed32(const validate_FieldRules *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 11; }
+UPB_INLINE const validate_SFixed32Rules* validate_FieldRules_sfixed32(const validate_FieldRules *msg) { return UPB_READ_ONEOF(msg, const validate_SFixed32Rules*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 11, NULL); }
+UPB_INLINE bool validate_FieldRules_has_sfixed64(const validate_FieldRules *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 12; }
+UPB_INLINE const validate_SFixed64Rules* validate_FieldRules_sfixed64(const validate_FieldRules *msg) { return UPB_READ_ONEOF(msg, const validate_SFixed64Rules*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 12, NULL); }
+UPB_INLINE bool validate_FieldRules_has_bool(const validate_FieldRules *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 13; }
+UPB_INLINE const validate_BoolRules* validate_FieldRules_bool(const validate_FieldRules *msg) { return UPB_READ_ONEOF(msg, const validate_BoolRules*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 13, NULL); }
+UPB_INLINE bool validate_FieldRules_has_string(const validate_FieldRules *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 14; }
+UPB_INLINE const validate_StringRules* validate_FieldRules_string(const validate_FieldRules *msg) { return UPB_READ_ONEOF(msg, const validate_StringRules*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 14, NULL); }
+UPB_INLINE bool validate_FieldRules_has_bytes(const validate_FieldRules *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 15; }
+UPB_INLINE const validate_BytesRules* validate_FieldRules_bytes(const validate_FieldRules *msg) { return UPB_READ_ONEOF(msg, const validate_BytesRules*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 15, NULL); }
+UPB_INLINE bool validate_FieldRules_has_enum(const validate_FieldRules *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 16; }
+UPB_INLINE const validate_EnumRules* validate_FieldRules_enum(const validate_FieldRules *msg) { return UPB_READ_ONEOF(msg, const validate_EnumRules*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 16, NULL); }
+UPB_INLINE bool validate_FieldRules_has_message(const validate_FieldRules *msg) { return _upb_hasbit(msg, 1); }
+UPB_INLINE const validate_MessageRules* validate_FieldRules_message(const validate_FieldRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const validate_MessageRules*); }
+UPB_INLINE bool validate_FieldRules_has_repeated(const validate_FieldRules *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 18; }
+UPB_INLINE const validate_RepeatedRules* validate_FieldRules_repeated(const validate_FieldRules *msg) { return UPB_READ_ONEOF(msg, const validate_RepeatedRules*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 18, NULL); }
+UPB_INLINE bool validate_FieldRules_has_map(const validate_FieldRules *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 19; }
+UPB_INLINE const validate_MapRules* validate_FieldRules_map(const validate_FieldRules *msg) { return UPB_READ_ONEOF(msg, const validate_MapRules*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 19, NULL); }
+UPB_INLINE bool validate_FieldRules_has_any(const validate_FieldRules *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 20; }
+UPB_INLINE const validate_AnyRules* validate_FieldRules_any(const validate_FieldRules *msg) { return UPB_READ_ONEOF(msg, const validate_AnyRules*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 20, NULL); }
+UPB_INLINE bool validate_FieldRules_has_duration(const validate_FieldRules *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 21; }
+UPB_INLINE const validate_DurationRules* validate_FieldRules_duration(const validate_FieldRules *msg) { return UPB_READ_ONEOF(msg, const validate_DurationRules*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 21, NULL); }
+UPB_INLINE bool validate_FieldRules_has_timestamp(const validate_FieldRules *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 22; }
+UPB_INLINE const validate_TimestampRules* validate_FieldRules_timestamp(const validate_FieldRules *msg) { return UPB_READ_ONEOF(msg, const validate_TimestampRules*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 22, NULL); }
UPB_INLINE void validate_FieldRules_set_float(validate_FieldRules *msg, validate_FloatRules* value) {
- UPB_WRITE_ONEOF(msg, validate_FloatRules*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 1);
+ UPB_WRITE_ONEOF(msg, validate_FloatRules*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 1);
}
UPB_INLINE struct validate_FloatRules* validate_FieldRules_mutable_float(validate_FieldRules *msg, upb_arena *arena) {
struct validate_FloatRules* sub = (struct validate_FloatRules*)validate_FieldRules_float(msg);
if (sub == NULL) {
- sub = (struct validate_FloatRules*)_upb_msg_new(&validate_FloatRules_msginit, arena);
+ sub = (struct validate_FloatRules*)_upb_msg_new(&validate_FloatRules_msginit, arena);
if (!sub) return NULL;
validate_FieldRules_set_float(msg, sub);
}
return sub;
}
UPB_INLINE void validate_FieldRules_set_double(validate_FieldRules *msg, validate_DoubleRules* value) {
- UPB_WRITE_ONEOF(msg, validate_DoubleRules*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 2);
+ UPB_WRITE_ONEOF(msg, validate_DoubleRules*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 2);
}
UPB_INLINE struct validate_DoubleRules* validate_FieldRules_mutable_double(validate_FieldRules *msg, upb_arena *arena) {
struct validate_DoubleRules* sub = (struct validate_DoubleRules*)validate_FieldRules_double(msg);
if (sub == NULL) {
- sub = (struct validate_DoubleRules*)_upb_msg_new(&validate_DoubleRules_msginit, arena);
+ sub = (struct validate_DoubleRules*)_upb_msg_new(&validate_DoubleRules_msginit, arena);
if (!sub) return NULL;
validate_FieldRules_set_double(msg, sub);
}
return sub;
}
UPB_INLINE void validate_FieldRules_set_int32(validate_FieldRules *msg, validate_Int32Rules* value) {
- UPB_WRITE_ONEOF(msg, validate_Int32Rules*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 3);
+ UPB_WRITE_ONEOF(msg, validate_Int32Rules*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 3);
}
UPB_INLINE struct validate_Int32Rules* validate_FieldRules_mutable_int32(validate_FieldRules *msg, upb_arena *arena) {
struct validate_Int32Rules* sub = (struct validate_Int32Rules*)validate_FieldRules_int32(msg);
if (sub == NULL) {
- sub = (struct validate_Int32Rules*)_upb_msg_new(&validate_Int32Rules_msginit, arena);
+ sub = (struct validate_Int32Rules*)_upb_msg_new(&validate_Int32Rules_msginit, arena);
if (!sub) return NULL;
validate_FieldRules_set_int32(msg, sub);
}
return sub;
}
UPB_INLINE void validate_FieldRules_set_int64(validate_FieldRules *msg, validate_Int64Rules* value) {
- UPB_WRITE_ONEOF(msg, validate_Int64Rules*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 4);
+ UPB_WRITE_ONEOF(msg, validate_Int64Rules*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 4);
}
UPB_INLINE struct validate_Int64Rules* validate_FieldRules_mutable_int64(validate_FieldRules *msg, upb_arena *arena) {
struct validate_Int64Rules* sub = (struct validate_Int64Rules*)validate_FieldRules_int64(msg);
if (sub == NULL) {
- sub = (struct validate_Int64Rules*)_upb_msg_new(&validate_Int64Rules_msginit, arena);
+ sub = (struct validate_Int64Rules*)_upb_msg_new(&validate_Int64Rules_msginit, arena);
if (!sub) return NULL;
validate_FieldRules_set_int64(msg, sub);
}
return sub;
}
UPB_INLINE void validate_FieldRules_set_uint32(validate_FieldRules *msg, validate_UInt32Rules* value) {
- UPB_WRITE_ONEOF(msg, validate_UInt32Rules*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 5);
+ UPB_WRITE_ONEOF(msg, validate_UInt32Rules*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 5);
}
UPB_INLINE struct validate_UInt32Rules* validate_FieldRules_mutable_uint32(validate_FieldRules *msg, upb_arena *arena) {
struct validate_UInt32Rules* sub = (struct validate_UInt32Rules*)validate_FieldRules_uint32(msg);
if (sub == NULL) {
- sub = (struct validate_UInt32Rules*)_upb_msg_new(&validate_UInt32Rules_msginit, arena);
+ sub = (struct validate_UInt32Rules*)_upb_msg_new(&validate_UInt32Rules_msginit, arena);
if (!sub) return NULL;
validate_FieldRules_set_uint32(msg, sub);
}
return sub;
}
UPB_INLINE void validate_FieldRules_set_uint64(validate_FieldRules *msg, validate_UInt64Rules* value) {
- UPB_WRITE_ONEOF(msg, validate_UInt64Rules*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 6);
+ UPB_WRITE_ONEOF(msg, validate_UInt64Rules*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 6);
}
UPB_INLINE struct validate_UInt64Rules* validate_FieldRules_mutable_uint64(validate_FieldRules *msg, upb_arena *arena) {
struct validate_UInt64Rules* sub = (struct validate_UInt64Rules*)validate_FieldRules_uint64(msg);
if (sub == NULL) {
- sub = (struct validate_UInt64Rules*)_upb_msg_new(&validate_UInt64Rules_msginit, arena);
+ sub = (struct validate_UInt64Rules*)_upb_msg_new(&validate_UInt64Rules_msginit, arena);
if (!sub) return NULL;
validate_FieldRules_set_uint64(msg, sub);
}
return sub;
}
UPB_INLINE void validate_FieldRules_set_sint32(validate_FieldRules *msg, validate_SInt32Rules* value) {
- UPB_WRITE_ONEOF(msg, validate_SInt32Rules*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 7);
+ UPB_WRITE_ONEOF(msg, validate_SInt32Rules*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 7);
}
UPB_INLINE struct validate_SInt32Rules* validate_FieldRules_mutable_sint32(validate_FieldRules *msg, upb_arena *arena) {
struct validate_SInt32Rules* sub = (struct validate_SInt32Rules*)validate_FieldRules_sint32(msg);
if (sub == NULL) {
- sub = (struct validate_SInt32Rules*)_upb_msg_new(&validate_SInt32Rules_msginit, arena);
+ sub = (struct validate_SInt32Rules*)_upb_msg_new(&validate_SInt32Rules_msginit, arena);
if (!sub) return NULL;
validate_FieldRules_set_sint32(msg, sub);
}
return sub;
}
UPB_INLINE void validate_FieldRules_set_sint64(validate_FieldRules *msg, validate_SInt64Rules* value) {
- UPB_WRITE_ONEOF(msg, validate_SInt64Rules*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 8);
+ UPB_WRITE_ONEOF(msg, validate_SInt64Rules*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 8);
}
UPB_INLINE struct validate_SInt64Rules* validate_FieldRules_mutable_sint64(validate_FieldRules *msg, upb_arena *arena) {
struct validate_SInt64Rules* sub = (struct validate_SInt64Rules*)validate_FieldRules_sint64(msg);
if (sub == NULL) {
- sub = (struct validate_SInt64Rules*)_upb_msg_new(&validate_SInt64Rules_msginit, arena);
+ sub = (struct validate_SInt64Rules*)_upb_msg_new(&validate_SInt64Rules_msginit, arena);
if (!sub) return NULL;
validate_FieldRules_set_sint64(msg, sub);
}
return sub;
}
UPB_INLINE void validate_FieldRules_set_fixed32(validate_FieldRules *msg, validate_Fixed32Rules* value) {
- UPB_WRITE_ONEOF(msg, validate_Fixed32Rules*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 9);
+ UPB_WRITE_ONEOF(msg, validate_Fixed32Rules*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 9);
}
UPB_INLINE struct validate_Fixed32Rules* validate_FieldRules_mutable_fixed32(validate_FieldRules *msg, upb_arena *arena) {
struct validate_Fixed32Rules* sub = (struct validate_Fixed32Rules*)validate_FieldRules_fixed32(msg);
if (sub == NULL) {
- sub = (struct validate_Fixed32Rules*)_upb_msg_new(&validate_Fixed32Rules_msginit, arena);
+ sub = (struct validate_Fixed32Rules*)_upb_msg_new(&validate_Fixed32Rules_msginit, arena);
if (!sub) return NULL;
validate_FieldRules_set_fixed32(msg, sub);
}
return sub;
}
UPB_INLINE void validate_FieldRules_set_fixed64(validate_FieldRules *msg, validate_Fixed64Rules* value) {
- UPB_WRITE_ONEOF(msg, validate_Fixed64Rules*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 10);
+ UPB_WRITE_ONEOF(msg, validate_Fixed64Rules*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 10);
}
UPB_INLINE struct validate_Fixed64Rules* validate_FieldRules_mutable_fixed64(validate_FieldRules *msg, upb_arena *arena) {
struct validate_Fixed64Rules* sub = (struct validate_Fixed64Rules*)validate_FieldRules_fixed64(msg);
if (sub == NULL) {
- sub = (struct validate_Fixed64Rules*)_upb_msg_new(&validate_Fixed64Rules_msginit, arena);
+ sub = (struct validate_Fixed64Rules*)_upb_msg_new(&validate_Fixed64Rules_msginit, arena);
if (!sub) return NULL;
validate_FieldRules_set_fixed64(msg, sub);
}
return sub;
}
UPB_INLINE void validate_FieldRules_set_sfixed32(validate_FieldRules *msg, validate_SFixed32Rules* value) {
- UPB_WRITE_ONEOF(msg, validate_SFixed32Rules*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 11);
+ UPB_WRITE_ONEOF(msg, validate_SFixed32Rules*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 11);
}
UPB_INLINE struct validate_SFixed32Rules* validate_FieldRules_mutable_sfixed32(validate_FieldRules *msg, upb_arena *arena) {
struct validate_SFixed32Rules* sub = (struct validate_SFixed32Rules*)validate_FieldRules_sfixed32(msg);
if (sub == NULL) {
- sub = (struct validate_SFixed32Rules*)_upb_msg_new(&validate_SFixed32Rules_msginit, arena);
+ sub = (struct validate_SFixed32Rules*)_upb_msg_new(&validate_SFixed32Rules_msginit, arena);
if (!sub) return NULL;
validate_FieldRules_set_sfixed32(msg, sub);
}
return sub;
}
UPB_INLINE void validate_FieldRules_set_sfixed64(validate_FieldRules *msg, validate_SFixed64Rules* value) {
- UPB_WRITE_ONEOF(msg, validate_SFixed64Rules*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 12);
+ UPB_WRITE_ONEOF(msg, validate_SFixed64Rules*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 12);
}
UPB_INLINE struct validate_SFixed64Rules* validate_FieldRules_mutable_sfixed64(validate_FieldRules *msg, upb_arena *arena) {
struct validate_SFixed64Rules* sub = (struct validate_SFixed64Rules*)validate_FieldRules_sfixed64(msg);
if (sub == NULL) {
- sub = (struct validate_SFixed64Rules*)_upb_msg_new(&validate_SFixed64Rules_msginit, arena);
+ sub = (struct validate_SFixed64Rules*)_upb_msg_new(&validate_SFixed64Rules_msginit, arena);
if (!sub) return NULL;
validate_FieldRules_set_sfixed64(msg, sub);
}
return sub;
}
UPB_INLINE void validate_FieldRules_set_bool(validate_FieldRules *msg, validate_BoolRules* value) {
- UPB_WRITE_ONEOF(msg, validate_BoolRules*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 13);
+ UPB_WRITE_ONEOF(msg, validate_BoolRules*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 13);
}
UPB_INLINE struct validate_BoolRules* validate_FieldRules_mutable_bool(validate_FieldRules *msg, upb_arena *arena) {
struct validate_BoolRules* sub = (struct validate_BoolRules*)validate_FieldRules_bool(msg);
if (sub == NULL) {
- sub = (struct validate_BoolRules*)_upb_msg_new(&validate_BoolRules_msginit, arena);
+ sub = (struct validate_BoolRules*)_upb_msg_new(&validate_BoolRules_msginit, arena);
if (!sub) return NULL;
validate_FieldRules_set_bool(msg, sub);
}
return sub;
}
UPB_INLINE void validate_FieldRules_set_string(validate_FieldRules *msg, validate_StringRules* value) {
- UPB_WRITE_ONEOF(msg, validate_StringRules*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 14);
+ UPB_WRITE_ONEOF(msg, validate_StringRules*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 14);
}
UPB_INLINE struct validate_StringRules* validate_FieldRules_mutable_string(validate_FieldRules *msg, upb_arena *arena) {
struct validate_StringRules* sub = (struct validate_StringRules*)validate_FieldRules_string(msg);
if (sub == NULL) {
- sub = (struct validate_StringRules*)_upb_msg_new(&validate_StringRules_msginit, arena);
+ sub = (struct validate_StringRules*)_upb_msg_new(&validate_StringRules_msginit, arena);
if (!sub) return NULL;
validate_FieldRules_set_string(msg, sub);
}
return sub;
}
UPB_INLINE void validate_FieldRules_set_bytes(validate_FieldRules *msg, validate_BytesRules* value) {
- UPB_WRITE_ONEOF(msg, validate_BytesRules*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 15);
+ UPB_WRITE_ONEOF(msg, validate_BytesRules*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 15);
}
UPB_INLINE struct validate_BytesRules* validate_FieldRules_mutable_bytes(validate_FieldRules *msg, upb_arena *arena) {
struct validate_BytesRules* sub = (struct validate_BytesRules*)validate_FieldRules_bytes(msg);
if (sub == NULL) {
- sub = (struct validate_BytesRules*)_upb_msg_new(&validate_BytesRules_msginit, arena);
+ sub = (struct validate_BytesRules*)_upb_msg_new(&validate_BytesRules_msginit, arena);
if (!sub) return NULL;
validate_FieldRules_set_bytes(msg, sub);
}
return sub;
}
UPB_INLINE void validate_FieldRules_set_enum(validate_FieldRules *msg, validate_EnumRules* value) {
- UPB_WRITE_ONEOF(msg, validate_EnumRules*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 16);
+ UPB_WRITE_ONEOF(msg, validate_EnumRules*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 16);
}
UPB_INLINE struct validate_EnumRules* validate_FieldRules_mutable_enum(validate_FieldRules *msg, upb_arena *arena) {
struct validate_EnumRules* sub = (struct validate_EnumRules*)validate_FieldRules_enum(msg);
if (sub == NULL) {
- sub = (struct validate_EnumRules*)_upb_msg_new(&validate_EnumRules_msginit, arena);
+ sub = (struct validate_EnumRules*)_upb_msg_new(&validate_EnumRules_msginit, arena);
if (!sub) return NULL;
validate_FieldRules_set_enum(msg, sub);
}
return sub;
}
UPB_INLINE void validate_FieldRules_set_message(validate_FieldRules *msg, validate_MessageRules* value) {
- _upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), validate_MessageRules*) = value;
+ _upb_sethas(msg, 1);
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), validate_MessageRules*) = value;
}
UPB_INLINE struct validate_MessageRules* validate_FieldRules_mutable_message(validate_FieldRules *msg, upb_arena *arena) {
struct validate_MessageRules* sub = (struct validate_MessageRules*)validate_FieldRules_message(msg);
if (sub == NULL) {
- sub = (struct validate_MessageRules*)_upb_msg_new(&validate_MessageRules_msginit, arena);
+ sub = (struct validate_MessageRules*)_upb_msg_new(&validate_MessageRules_msginit, arena);
if (!sub) return NULL;
validate_FieldRules_set_message(msg, sub);
}
return sub;
}
UPB_INLINE void validate_FieldRules_set_repeated(validate_FieldRules *msg, validate_RepeatedRules* value) {
- UPB_WRITE_ONEOF(msg, validate_RepeatedRules*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 18);
+ UPB_WRITE_ONEOF(msg, validate_RepeatedRules*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 18);
}
UPB_INLINE struct validate_RepeatedRules* validate_FieldRules_mutable_repeated(validate_FieldRules *msg, upb_arena *arena) {
struct validate_RepeatedRules* sub = (struct validate_RepeatedRules*)validate_FieldRules_repeated(msg);
if (sub == NULL) {
- sub = (struct validate_RepeatedRules*)_upb_msg_new(&validate_RepeatedRules_msginit, arena);
+ sub = (struct validate_RepeatedRules*)_upb_msg_new(&validate_RepeatedRules_msginit, arena);
if (!sub) return NULL;
validate_FieldRules_set_repeated(msg, sub);
}
return sub;
}
UPB_INLINE void validate_FieldRules_set_map(validate_FieldRules *msg, validate_MapRules* value) {
- UPB_WRITE_ONEOF(msg, validate_MapRules*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 19);
+ UPB_WRITE_ONEOF(msg, validate_MapRules*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 19);
}
UPB_INLINE struct validate_MapRules* validate_FieldRules_mutable_map(validate_FieldRules *msg, upb_arena *arena) {
struct validate_MapRules* sub = (struct validate_MapRules*)validate_FieldRules_map(msg);
if (sub == NULL) {
- sub = (struct validate_MapRules*)_upb_msg_new(&validate_MapRules_msginit, arena);
+ sub = (struct validate_MapRules*)_upb_msg_new(&validate_MapRules_msginit, arena);
if (!sub) return NULL;
validate_FieldRules_set_map(msg, sub);
}
return sub;
}
UPB_INLINE void validate_FieldRules_set_any(validate_FieldRules *msg, validate_AnyRules* value) {
- UPB_WRITE_ONEOF(msg, validate_AnyRules*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 20);
+ UPB_WRITE_ONEOF(msg, validate_AnyRules*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 20);
}
UPB_INLINE struct validate_AnyRules* validate_FieldRules_mutable_any(validate_FieldRules *msg, upb_arena *arena) {
struct validate_AnyRules* sub = (struct validate_AnyRules*)validate_FieldRules_any(msg);
if (sub == NULL) {
- sub = (struct validate_AnyRules*)_upb_msg_new(&validate_AnyRules_msginit, arena);
+ sub = (struct validate_AnyRules*)_upb_msg_new(&validate_AnyRules_msginit, arena);
if (!sub) return NULL;
validate_FieldRules_set_any(msg, sub);
}
return sub;
}
UPB_INLINE void validate_FieldRules_set_duration(validate_FieldRules *msg, validate_DurationRules* value) {
- UPB_WRITE_ONEOF(msg, validate_DurationRules*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 21);
+ UPB_WRITE_ONEOF(msg, validate_DurationRules*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 21);
}
UPB_INLINE struct validate_DurationRules* validate_FieldRules_mutable_duration(validate_FieldRules *msg, upb_arena *arena) {
struct validate_DurationRules* sub = (struct validate_DurationRules*)validate_FieldRules_duration(msg);
if (sub == NULL) {
- sub = (struct validate_DurationRules*)_upb_msg_new(&validate_DurationRules_msginit, arena);
+ sub = (struct validate_DurationRules*)_upb_msg_new(&validate_DurationRules_msginit, arena);
if (!sub) return NULL;
validate_FieldRules_set_duration(msg, sub);
}
return sub;
}
UPB_INLINE void validate_FieldRules_set_timestamp(validate_FieldRules *msg, validate_TimestampRules* value) {
- UPB_WRITE_ONEOF(msg, validate_TimestampRules*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 22);
+ UPB_WRITE_ONEOF(msg, validate_TimestampRules*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 22);
}
UPB_INLINE struct validate_TimestampRules* validate_FieldRules_mutable_timestamp(validate_FieldRules *msg, upb_arena *arena) {
struct validate_TimestampRules* sub = (struct validate_TimestampRules*)validate_FieldRules_timestamp(msg);
if (sub == NULL) {
- sub = (struct validate_TimestampRules*)_upb_msg_new(&validate_TimestampRules_msginit, arena);
+ sub = (struct validate_TimestampRules*)_upb_msg_new(&validate_TimestampRules_msginit, arena);
if (!sub) return NULL;
validate_FieldRules_set_timestamp(msg, sub);
}
@@ -454,7 +454,7 @@ UPB_INLINE struct validate_TimestampRules* validate_FieldRules_mutable_timestamp
/* validate.FloatRules */
UPB_INLINE validate_FloatRules *validate_FloatRules_new(upb_arena *arena) {
- return (validate_FloatRules *)_upb_msg_new(&validate_FloatRules_msginit, arena);
+ return (validate_FloatRules *)_upb_msg_new(&validate_FloatRules_msginit, arena);
}
UPB_INLINE validate_FloatRules *validate_FloatRules_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -465,64 +465,64 @@ UPB_INLINE char *validate_FloatRules_serialize(const validate_FloatRules *msg, u
return upb_encode(msg, &validate_FloatRules_msginit, arena, len);
}
-UPB_INLINE bool validate_FloatRules_has_const(const validate_FloatRules *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE float validate_FloatRules_const(const validate_FloatRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), float); }
-UPB_INLINE bool validate_FloatRules_has_lt(const validate_FloatRules *msg) { return _upb_hasbit(msg, 2); }
-UPB_INLINE float validate_FloatRules_lt(const validate_FloatRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), float); }
-UPB_INLINE bool validate_FloatRules_has_lte(const validate_FloatRules *msg) { return _upb_hasbit(msg, 3); }
-UPB_INLINE float validate_FloatRules_lte(const validate_FloatRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 12), float); }
-UPB_INLINE bool validate_FloatRules_has_gt(const validate_FloatRules *msg) { return _upb_hasbit(msg, 4); }
-UPB_INLINE float validate_FloatRules_gt(const validate_FloatRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), float); }
-UPB_INLINE bool validate_FloatRules_has_gte(const validate_FloatRules *msg) { return _upb_hasbit(msg, 5); }
-UPB_INLINE float validate_FloatRules_gte(const validate_FloatRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 20), float); }
+UPB_INLINE bool validate_FloatRules_has_const(const validate_FloatRules *msg) { return _upb_hasbit(msg, 1); }
+UPB_INLINE float validate_FloatRules_const(const validate_FloatRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), float); }
+UPB_INLINE bool validate_FloatRules_has_lt(const validate_FloatRules *msg) { return _upb_hasbit(msg, 2); }
+UPB_INLINE float validate_FloatRules_lt(const validate_FloatRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), float); }
+UPB_INLINE bool validate_FloatRules_has_lte(const validate_FloatRules *msg) { return _upb_hasbit(msg, 3); }
+UPB_INLINE float validate_FloatRules_lte(const validate_FloatRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 12), float); }
+UPB_INLINE bool validate_FloatRules_has_gt(const validate_FloatRules *msg) { return _upb_hasbit(msg, 4); }
+UPB_INLINE float validate_FloatRules_gt(const validate_FloatRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), float); }
+UPB_INLINE bool validate_FloatRules_has_gte(const validate_FloatRules *msg) { return _upb_hasbit(msg, 5); }
+UPB_INLINE float validate_FloatRules_gte(const validate_FloatRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 20), float); }
UPB_INLINE float const* validate_FloatRules_in(const validate_FloatRules *msg, size_t *len) { return (float const*)_upb_array_accessor(msg, UPB_SIZE(24, 24), len); }
UPB_INLINE float const* validate_FloatRules_not_in(const validate_FloatRules *msg, size_t *len) { return (float const*)_upb_array_accessor(msg, UPB_SIZE(28, 32), len); }
UPB_INLINE void validate_FloatRules_set_const(validate_FloatRules *msg, float value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(4, 4), float) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), float) = value;
}
UPB_INLINE void validate_FloatRules_set_lt(validate_FloatRules *msg, float value) {
_upb_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), float) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), float) = value;
}
UPB_INLINE void validate_FloatRules_set_lte(validate_FloatRules *msg, float value) {
_upb_sethas(msg, 3);
- *UPB_PTR_AT(msg, UPB_SIZE(12, 12), float) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 12), float) = value;
}
UPB_INLINE void validate_FloatRules_set_gt(validate_FloatRules *msg, float value) {
_upb_sethas(msg, 4);
- *UPB_PTR_AT(msg, UPB_SIZE(16, 16), float) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 16), float) = value;
}
UPB_INLINE void validate_FloatRules_set_gte(validate_FloatRules *msg, float value) {
_upb_sethas(msg, 5);
- *UPB_PTR_AT(msg, UPB_SIZE(20, 20), float) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 20), float) = value;
}
UPB_INLINE float* validate_FloatRules_mutable_in(validate_FloatRules *msg, size_t *len) {
return (float*)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 24), len);
}
UPB_INLINE float* validate_FloatRules_resize_in(validate_FloatRules *msg, size_t len, upb_arena *arena) {
- return (float*)_upb_array_resize_accessor(msg, UPB_SIZE(24, 24), len, UPB_TYPE_FLOAT, arena);
+ return (float*)_upb_array_resize_accessor(msg, UPB_SIZE(24, 24), len, UPB_TYPE_FLOAT, arena);
}
UPB_INLINE bool validate_FloatRules_add_in(validate_FloatRules *msg, float val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(24, 24), UPB_SIZE(4, 4), UPB_TYPE_FLOAT, &val,
- arena);
+ return _upb_array_append_accessor(msg, UPB_SIZE(24, 24), UPB_SIZE(4, 4), UPB_TYPE_FLOAT, &val,
+ arena);
}
UPB_INLINE float* validate_FloatRules_mutable_not_in(validate_FloatRules *msg, size_t *len) {
return (float*)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 32), len);
}
UPB_INLINE float* validate_FloatRules_resize_not_in(validate_FloatRules *msg, size_t len, upb_arena *arena) {
- return (float*)_upb_array_resize_accessor(msg, UPB_SIZE(28, 32), len, UPB_TYPE_FLOAT, arena);
+ return (float*)_upb_array_resize_accessor(msg, UPB_SIZE(28, 32), len, UPB_TYPE_FLOAT, arena);
}
UPB_INLINE bool validate_FloatRules_add_not_in(validate_FloatRules *msg, float val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(28, 32), UPB_SIZE(4, 4), UPB_TYPE_FLOAT, &val,
- arena);
+ return _upb_array_append_accessor(msg, UPB_SIZE(28, 32), UPB_SIZE(4, 4), UPB_TYPE_FLOAT, &val,
+ arena);
}
/* validate.DoubleRules */
UPB_INLINE validate_DoubleRules *validate_DoubleRules_new(upb_arena *arena) {
- return (validate_DoubleRules *)_upb_msg_new(&validate_DoubleRules_msginit, arena);
+ return (validate_DoubleRules *)_upb_msg_new(&validate_DoubleRules_msginit, arena);
}
UPB_INLINE validate_DoubleRules *validate_DoubleRules_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -533,64 +533,64 @@ UPB_INLINE char *validate_DoubleRules_serialize(const validate_DoubleRules *msg,
return upb_encode(msg, &validate_DoubleRules_msginit, arena, len);
}
-UPB_INLINE bool validate_DoubleRules_has_const(const validate_DoubleRules *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE double validate_DoubleRules_const(const validate_DoubleRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), double); }
-UPB_INLINE bool validate_DoubleRules_has_lt(const validate_DoubleRules *msg) { return _upb_hasbit(msg, 2); }
-UPB_INLINE double validate_DoubleRules_lt(const validate_DoubleRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), double); }
-UPB_INLINE bool validate_DoubleRules_has_lte(const validate_DoubleRules *msg) { return _upb_hasbit(msg, 3); }
-UPB_INLINE double validate_DoubleRules_lte(const validate_DoubleRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), double); }
-UPB_INLINE bool validate_DoubleRules_has_gt(const validate_DoubleRules *msg) { return _upb_hasbit(msg, 4); }
-UPB_INLINE double validate_DoubleRules_gt(const validate_DoubleRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 32), double); }
-UPB_INLINE bool validate_DoubleRules_has_gte(const validate_DoubleRules *msg) { return _upb_hasbit(msg, 5); }
-UPB_INLINE double validate_DoubleRules_gte(const validate_DoubleRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(40, 40), double); }
+UPB_INLINE bool validate_DoubleRules_has_const(const validate_DoubleRules *msg) { return _upb_hasbit(msg, 1); }
+UPB_INLINE double validate_DoubleRules_const(const validate_DoubleRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), double); }
+UPB_INLINE bool validate_DoubleRules_has_lt(const validate_DoubleRules *msg) { return _upb_hasbit(msg, 2); }
+UPB_INLINE double validate_DoubleRules_lt(const validate_DoubleRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), double); }
+UPB_INLINE bool validate_DoubleRules_has_lte(const validate_DoubleRules *msg) { return _upb_hasbit(msg, 3); }
+UPB_INLINE double validate_DoubleRules_lte(const validate_DoubleRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), double); }
+UPB_INLINE bool validate_DoubleRules_has_gt(const validate_DoubleRules *msg) { return _upb_hasbit(msg, 4); }
+UPB_INLINE double validate_DoubleRules_gt(const validate_DoubleRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 32), double); }
+UPB_INLINE bool validate_DoubleRules_has_gte(const validate_DoubleRules *msg) { return _upb_hasbit(msg, 5); }
+UPB_INLINE double validate_DoubleRules_gte(const validate_DoubleRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(40, 40), double); }
UPB_INLINE double const* validate_DoubleRules_in(const validate_DoubleRules *msg, size_t *len) { return (double const*)_upb_array_accessor(msg, UPB_SIZE(48, 48), len); }
UPB_INLINE double const* validate_DoubleRules_not_in(const validate_DoubleRules *msg, size_t *len) { return (double const*)_upb_array_accessor(msg, UPB_SIZE(52, 56), len); }
UPB_INLINE void validate_DoubleRules_set_const(validate_DoubleRules *msg, double value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), double) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), double) = value;
}
UPB_INLINE void validate_DoubleRules_set_lt(validate_DoubleRules *msg, double value) {
_upb_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(16, 16), double) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 16), double) = value;
}
UPB_INLINE void validate_DoubleRules_set_lte(validate_DoubleRules *msg, double value) {
_upb_sethas(msg, 3);
- *UPB_PTR_AT(msg, UPB_SIZE(24, 24), double) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 24), double) = value;
}
UPB_INLINE void validate_DoubleRules_set_gt(validate_DoubleRules *msg, double value) {
_upb_sethas(msg, 4);
- *UPB_PTR_AT(msg, UPB_SIZE(32, 32), double) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 32), double) = value;
}
UPB_INLINE void validate_DoubleRules_set_gte(validate_DoubleRules *msg, double value) {
_upb_sethas(msg, 5);
- *UPB_PTR_AT(msg, UPB_SIZE(40, 40), double) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 40), double) = value;
}
UPB_INLINE double* validate_DoubleRules_mutable_in(validate_DoubleRules *msg, size_t *len) {
return (double*)_upb_array_mutable_accessor(msg, UPB_SIZE(48, 48), len);
}
UPB_INLINE double* validate_DoubleRules_resize_in(validate_DoubleRules *msg, size_t len, upb_arena *arena) {
- return (double*)_upb_array_resize_accessor(msg, UPB_SIZE(48, 48), len, UPB_TYPE_DOUBLE, arena);
+ return (double*)_upb_array_resize_accessor(msg, UPB_SIZE(48, 48), len, UPB_TYPE_DOUBLE, arena);
}
UPB_INLINE bool validate_DoubleRules_add_in(validate_DoubleRules *msg, double val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(48, 48), UPB_SIZE(8, 8), UPB_TYPE_DOUBLE, &val,
- arena);
+ return _upb_array_append_accessor(msg, UPB_SIZE(48, 48), UPB_SIZE(8, 8), UPB_TYPE_DOUBLE, &val,
+ arena);
}
UPB_INLINE double* validate_DoubleRules_mutable_not_in(validate_DoubleRules *msg, size_t *len) {
return (double*)_upb_array_mutable_accessor(msg, UPB_SIZE(52, 56), len);
}
UPB_INLINE double* validate_DoubleRules_resize_not_in(validate_DoubleRules *msg, size_t len, upb_arena *arena) {
- return (double*)_upb_array_resize_accessor(msg, UPB_SIZE(52, 56), len, UPB_TYPE_DOUBLE, arena);
+ return (double*)_upb_array_resize_accessor(msg, UPB_SIZE(52, 56), len, UPB_TYPE_DOUBLE, arena);
}
UPB_INLINE bool validate_DoubleRules_add_not_in(validate_DoubleRules *msg, double val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(52, 56), UPB_SIZE(8, 8), UPB_TYPE_DOUBLE, &val,
- arena);
+ return _upb_array_append_accessor(msg, UPB_SIZE(52, 56), UPB_SIZE(8, 8), UPB_TYPE_DOUBLE, &val,
+ arena);
}
/* validate.Int32Rules */
UPB_INLINE validate_Int32Rules *validate_Int32Rules_new(upb_arena *arena) {
- return (validate_Int32Rules *)_upb_msg_new(&validate_Int32Rules_msginit, arena);
+ return (validate_Int32Rules *)_upb_msg_new(&validate_Int32Rules_msginit, arena);
}
UPB_INLINE validate_Int32Rules *validate_Int32Rules_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -601,64 +601,64 @@ UPB_INLINE char *validate_Int32Rules_serialize(const validate_Int32Rules *msg, u
return upb_encode(msg, &validate_Int32Rules_msginit, arena, len);
}
-UPB_INLINE bool validate_Int32Rules_has_const(const validate_Int32Rules *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE int32_t validate_Int32Rules_const(const validate_Int32Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); }
-UPB_INLINE bool validate_Int32Rules_has_lt(const validate_Int32Rules *msg) { return _upb_hasbit(msg, 2); }
-UPB_INLINE int32_t validate_Int32Rules_lt(const validate_Int32Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); }
-UPB_INLINE bool validate_Int32Rules_has_lte(const validate_Int32Rules *msg) { return _upb_hasbit(msg, 3); }
-UPB_INLINE int32_t validate_Int32Rules_lte(const validate_Int32Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 12), int32_t); }
-UPB_INLINE bool validate_Int32Rules_has_gt(const validate_Int32Rules *msg) { return _upb_hasbit(msg, 4); }
-UPB_INLINE int32_t validate_Int32Rules_gt(const validate_Int32Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t); }
-UPB_INLINE bool validate_Int32Rules_has_gte(const validate_Int32Rules *msg) { return _upb_hasbit(msg, 5); }
-UPB_INLINE int32_t validate_Int32Rules_gte(const validate_Int32Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 20), int32_t); }
+UPB_INLINE bool validate_Int32Rules_has_const(const validate_Int32Rules *msg) { return _upb_hasbit(msg, 1); }
+UPB_INLINE int32_t validate_Int32Rules_const(const validate_Int32Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); }
+UPB_INLINE bool validate_Int32Rules_has_lt(const validate_Int32Rules *msg) { return _upb_hasbit(msg, 2); }
+UPB_INLINE int32_t validate_Int32Rules_lt(const validate_Int32Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); }
+UPB_INLINE bool validate_Int32Rules_has_lte(const validate_Int32Rules *msg) { return _upb_hasbit(msg, 3); }
+UPB_INLINE int32_t validate_Int32Rules_lte(const validate_Int32Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 12), int32_t); }
+UPB_INLINE bool validate_Int32Rules_has_gt(const validate_Int32Rules *msg) { return _upb_hasbit(msg, 4); }
+UPB_INLINE int32_t validate_Int32Rules_gt(const validate_Int32Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t); }
+UPB_INLINE bool validate_Int32Rules_has_gte(const validate_Int32Rules *msg) { return _upb_hasbit(msg, 5); }
+UPB_INLINE int32_t validate_Int32Rules_gte(const validate_Int32Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 20), int32_t); }
UPB_INLINE int32_t const* validate_Int32Rules_in(const validate_Int32Rules *msg, size_t *len) { return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(24, 24), len); }
UPB_INLINE int32_t const* validate_Int32Rules_not_in(const validate_Int32Rules *msg, size_t *len) { return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(28, 32), len); }
UPB_INLINE void validate_Int32Rules_set_const(validate_Int32Rules *msg, int32_t value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value;
}
UPB_INLINE void validate_Int32Rules_set_lt(validate_Int32Rules *msg, int32_t value) {
_upb_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
}
UPB_INLINE void validate_Int32Rules_set_lte(validate_Int32Rules *msg, int32_t value) {
_upb_sethas(msg, 3);
- *UPB_PTR_AT(msg, UPB_SIZE(12, 12), int32_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 12), int32_t) = value;
}
UPB_INLINE void validate_Int32Rules_set_gt(validate_Int32Rules *msg, int32_t value) {
_upb_sethas(msg, 4);
- *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t) = value;
}
UPB_INLINE void validate_Int32Rules_set_gte(validate_Int32Rules *msg, int32_t value) {
_upb_sethas(msg, 5);
- *UPB_PTR_AT(msg, UPB_SIZE(20, 20), int32_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 20), int32_t) = value;
}
UPB_INLINE int32_t* validate_Int32Rules_mutable_in(validate_Int32Rules *msg, size_t *len) {
return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 24), len);
}
UPB_INLINE int32_t* validate_Int32Rules_resize_in(validate_Int32Rules *msg, size_t len, upb_arena *arena) {
- return (int32_t*)_upb_array_resize_accessor(msg, UPB_SIZE(24, 24), len, UPB_TYPE_INT32, arena);
+ return (int32_t*)_upb_array_resize_accessor(msg, UPB_SIZE(24, 24), len, UPB_TYPE_INT32, arena);
}
UPB_INLINE bool validate_Int32Rules_add_in(validate_Int32Rules *msg, int32_t val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(24, 24), UPB_SIZE(4, 4), UPB_TYPE_INT32, &val,
- arena);
+ return _upb_array_append_accessor(msg, UPB_SIZE(24, 24), UPB_SIZE(4, 4), UPB_TYPE_INT32, &val,
+ arena);
}
UPB_INLINE int32_t* validate_Int32Rules_mutable_not_in(validate_Int32Rules *msg, size_t *len) {
return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 32), len);
}
UPB_INLINE int32_t* validate_Int32Rules_resize_not_in(validate_Int32Rules *msg, size_t len, upb_arena *arena) {
- return (int32_t*)_upb_array_resize_accessor(msg, UPB_SIZE(28, 32), len, UPB_TYPE_INT32, arena);
+ return (int32_t*)_upb_array_resize_accessor(msg, UPB_SIZE(28, 32), len, UPB_TYPE_INT32, arena);
}
UPB_INLINE bool validate_Int32Rules_add_not_in(validate_Int32Rules *msg, int32_t val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(28, 32), UPB_SIZE(4, 4), UPB_TYPE_INT32, &val,
- arena);
+ return _upb_array_append_accessor(msg, UPB_SIZE(28, 32), UPB_SIZE(4, 4), UPB_TYPE_INT32, &val,
+ arena);
}
/* validate.Int64Rules */
UPB_INLINE validate_Int64Rules *validate_Int64Rules_new(upb_arena *arena) {
- return (validate_Int64Rules *)_upb_msg_new(&validate_Int64Rules_msginit, arena);
+ return (validate_Int64Rules *)_upb_msg_new(&validate_Int64Rules_msginit, arena);
}
UPB_INLINE validate_Int64Rules *validate_Int64Rules_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -669,64 +669,64 @@ UPB_INLINE char *validate_Int64Rules_serialize(const validate_Int64Rules *msg, u
return upb_encode(msg, &validate_Int64Rules_msginit, arena, len);
}
-UPB_INLINE bool validate_Int64Rules_has_const(const validate_Int64Rules *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE int64_t validate_Int64Rules_const(const validate_Int64Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int64_t); }
-UPB_INLINE bool validate_Int64Rules_has_lt(const validate_Int64Rules *msg) { return _upb_hasbit(msg, 2); }
-UPB_INLINE int64_t validate_Int64Rules_lt(const validate_Int64Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int64_t); }
-UPB_INLINE bool validate_Int64Rules_has_lte(const validate_Int64Rules *msg) { return _upb_hasbit(msg, 3); }
-UPB_INLINE int64_t validate_Int64Rules_lte(const validate_Int64Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), int64_t); }
-UPB_INLINE bool validate_Int64Rules_has_gt(const validate_Int64Rules *msg) { return _upb_hasbit(msg, 4); }
-UPB_INLINE int64_t validate_Int64Rules_gt(const validate_Int64Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 32), int64_t); }
-UPB_INLINE bool validate_Int64Rules_has_gte(const validate_Int64Rules *msg) { return _upb_hasbit(msg, 5); }
-UPB_INLINE int64_t validate_Int64Rules_gte(const validate_Int64Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(40, 40), int64_t); }
+UPB_INLINE bool validate_Int64Rules_has_const(const validate_Int64Rules *msg) { return _upb_hasbit(msg, 1); }
+UPB_INLINE int64_t validate_Int64Rules_const(const validate_Int64Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int64_t); }
+UPB_INLINE bool validate_Int64Rules_has_lt(const validate_Int64Rules *msg) { return _upb_hasbit(msg, 2); }
+UPB_INLINE int64_t validate_Int64Rules_lt(const validate_Int64Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int64_t); }
+UPB_INLINE bool validate_Int64Rules_has_lte(const validate_Int64Rules *msg) { return _upb_hasbit(msg, 3); }
+UPB_INLINE int64_t validate_Int64Rules_lte(const validate_Int64Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), int64_t); }
+UPB_INLINE bool validate_Int64Rules_has_gt(const validate_Int64Rules *msg) { return _upb_hasbit(msg, 4); }
+UPB_INLINE int64_t validate_Int64Rules_gt(const validate_Int64Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 32), int64_t); }
+UPB_INLINE bool validate_Int64Rules_has_gte(const validate_Int64Rules *msg) { return _upb_hasbit(msg, 5); }
+UPB_INLINE int64_t validate_Int64Rules_gte(const validate_Int64Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(40, 40), int64_t); }
UPB_INLINE int64_t const* validate_Int64Rules_in(const validate_Int64Rules *msg, size_t *len) { return (int64_t const*)_upb_array_accessor(msg, UPB_SIZE(48, 48), len); }
UPB_INLINE int64_t const* validate_Int64Rules_not_in(const validate_Int64Rules *msg, size_t *len) { return (int64_t const*)_upb_array_accessor(msg, UPB_SIZE(52, 56), len); }
UPB_INLINE void validate_Int64Rules_set_const(validate_Int64Rules *msg, int64_t value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int64_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int64_t) = value;
}
UPB_INLINE void validate_Int64Rules_set_lt(validate_Int64Rules *msg, int64_t value) {
_upb_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int64_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int64_t) = value;
}
UPB_INLINE void validate_Int64Rules_set_lte(validate_Int64Rules *msg, int64_t value) {
_upb_sethas(msg, 3);
- *UPB_PTR_AT(msg, UPB_SIZE(24, 24), int64_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 24), int64_t) = value;
}
UPB_INLINE void validate_Int64Rules_set_gt(validate_Int64Rules *msg, int64_t value) {
_upb_sethas(msg, 4);
- *UPB_PTR_AT(msg, UPB_SIZE(32, 32), int64_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 32), int64_t) = value;
}
UPB_INLINE void validate_Int64Rules_set_gte(validate_Int64Rules *msg, int64_t value) {
_upb_sethas(msg, 5);
- *UPB_PTR_AT(msg, UPB_SIZE(40, 40), int64_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 40), int64_t) = value;
}
UPB_INLINE int64_t* validate_Int64Rules_mutable_in(validate_Int64Rules *msg, size_t *len) {
return (int64_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(48, 48), len);
}
UPB_INLINE int64_t* validate_Int64Rules_resize_in(validate_Int64Rules *msg, size_t len, upb_arena *arena) {
- return (int64_t*)_upb_array_resize_accessor(msg, UPB_SIZE(48, 48), len, UPB_TYPE_INT64, arena);
+ return (int64_t*)_upb_array_resize_accessor(msg, UPB_SIZE(48, 48), len, UPB_TYPE_INT64, arena);
}
UPB_INLINE bool validate_Int64Rules_add_in(validate_Int64Rules *msg, int64_t val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(48, 48), UPB_SIZE(8, 8), UPB_TYPE_INT64, &val,
- arena);
+ return _upb_array_append_accessor(msg, UPB_SIZE(48, 48), UPB_SIZE(8, 8), UPB_TYPE_INT64, &val,
+ arena);
}
UPB_INLINE int64_t* validate_Int64Rules_mutable_not_in(validate_Int64Rules *msg, size_t *len) {
return (int64_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(52, 56), len);
}
UPB_INLINE int64_t* validate_Int64Rules_resize_not_in(validate_Int64Rules *msg, size_t len, upb_arena *arena) {
- return (int64_t*)_upb_array_resize_accessor(msg, UPB_SIZE(52, 56), len, UPB_TYPE_INT64, arena);
+ return (int64_t*)_upb_array_resize_accessor(msg, UPB_SIZE(52, 56), len, UPB_TYPE_INT64, arena);
}
UPB_INLINE bool validate_Int64Rules_add_not_in(validate_Int64Rules *msg, int64_t val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(52, 56), UPB_SIZE(8, 8), UPB_TYPE_INT64, &val,
- arena);
+ return _upb_array_append_accessor(msg, UPB_SIZE(52, 56), UPB_SIZE(8, 8), UPB_TYPE_INT64, &val,
+ arena);
}
/* validate.UInt32Rules */
UPB_INLINE validate_UInt32Rules *validate_UInt32Rules_new(upb_arena *arena) {
- return (validate_UInt32Rules *)_upb_msg_new(&validate_UInt32Rules_msginit, arena);
+ return (validate_UInt32Rules *)_upb_msg_new(&validate_UInt32Rules_msginit, arena);
}
UPB_INLINE validate_UInt32Rules *validate_UInt32Rules_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -737,64 +737,64 @@ UPB_INLINE char *validate_UInt32Rules_serialize(const validate_UInt32Rules *msg,
return upb_encode(msg, &validate_UInt32Rules_msginit, arena, len);
}
-UPB_INLINE bool validate_UInt32Rules_has_const(const validate_UInt32Rules *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE uint32_t validate_UInt32Rules_const(const validate_UInt32Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t); }
-UPB_INLINE bool validate_UInt32Rules_has_lt(const validate_UInt32Rules *msg) { return _upb_hasbit(msg, 2); }
-UPB_INLINE uint32_t validate_UInt32Rules_lt(const validate_UInt32Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint32_t); }
-UPB_INLINE bool validate_UInt32Rules_has_lte(const validate_UInt32Rules *msg) { return _upb_hasbit(msg, 3); }
-UPB_INLINE uint32_t validate_UInt32Rules_lte(const validate_UInt32Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 12), uint32_t); }
-UPB_INLINE bool validate_UInt32Rules_has_gt(const validate_UInt32Rules *msg) { return _upb_hasbit(msg, 4); }
-UPB_INLINE uint32_t validate_UInt32Rules_gt(const validate_UInt32Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), uint32_t); }
-UPB_INLINE bool validate_UInt32Rules_has_gte(const validate_UInt32Rules *msg) { return _upb_hasbit(msg, 5); }
-UPB_INLINE uint32_t validate_UInt32Rules_gte(const validate_UInt32Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 20), uint32_t); }
+UPB_INLINE bool validate_UInt32Rules_has_const(const validate_UInt32Rules *msg) { return _upb_hasbit(msg, 1); }
+UPB_INLINE uint32_t validate_UInt32Rules_const(const validate_UInt32Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t); }
+UPB_INLINE bool validate_UInt32Rules_has_lt(const validate_UInt32Rules *msg) { return _upb_hasbit(msg, 2); }
+UPB_INLINE uint32_t validate_UInt32Rules_lt(const validate_UInt32Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint32_t); }
+UPB_INLINE bool validate_UInt32Rules_has_lte(const validate_UInt32Rules *msg) { return _upb_hasbit(msg, 3); }
+UPB_INLINE uint32_t validate_UInt32Rules_lte(const validate_UInt32Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 12), uint32_t); }
+UPB_INLINE bool validate_UInt32Rules_has_gt(const validate_UInt32Rules *msg) { return _upb_hasbit(msg, 4); }
+UPB_INLINE uint32_t validate_UInt32Rules_gt(const validate_UInt32Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), uint32_t); }
+UPB_INLINE bool validate_UInt32Rules_has_gte(const validate_UInt32Rules *msg) { return _upb_hasbit(msg, 5); }
+UPB_INLINE uint32_t validate_UInt32Rules_gte(const validate_UInt32Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 20), uint32_t); }
UPB_INLINE uint32_t const* validate_UInt32Rules_in(const validate_UInt32Rules *msg, size_t *len) { return (uint32_t const*)_upb_array_accessor(msg, UPB_SIZE(24, 24), len); }
UPB_INLINE uint32_t const* validate_UInt32Rules_not_in(const validate_UInt32Rules *msg, size_t *len) { return (uint32_t const*)_upb_array_accessor(msg, UPB_SIZE(28, 32), len); }
UPB_INLINE void validate_UInt32Rules_set_const(validate_UInt32Rules *msg, uint32_t value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t) = value;
}
UPB_INLINE void validate_UInt32Rules_set_lt(validate_UInt32Rules *msg, uint32_t value) {
_upb_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint32_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint32_t) = value;
}
UPB_INLINE void validate_UInt32Rules_set_lte(validate_UInt32Rules *msg, uint32_t value) {
_upb_sethas(msg, 3);
- *UPB_PTR_AT(msg, UPB_SIZE(12, 12), uint32_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 12), uint32_t) = value;
}
UPB_INLINE void validate_UInt32Rules_set_gt(validate_UInt32Rules *msg, uint32_t value) {
_upb_sethas(msg, 4);
- *UPB_PTR_AT(msg, UPB_SIZE(16, 16), uint32_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 16), uint32_t) = value;
}
UPB_INLINE void validate_UInt32Rules_set_gte(validate_UInt32Rules *msg, uint32_t value) {
_upb_sethas(msg, 5);
- *UPB_PTR_AT(msg, UPB_SIZE(20, 20), uint32_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 20), uint32_t) = value;
}
UPB_INLINE uint32_t* validate_UInt32Rules_mutable_in(validate_UInt32Rules *msg, size_t *len) {
return (uint32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 24), len);
}
UPB_INLINE uint32_t* validate_UInt32Rules_resize_in(validate_UInt32Rules *msg, size_t len, upb_arena *arena) {
- return (uint32_t*)_upb_array_resize_accessor(msg, UPB_SIZE(24, 24), len, UPB_TYPE_UINT32, arena);
+ return (uint32_t*)_upb_array_resize_accessor(msg, UPB_SIZE(24, 24), len, UPB_TYPE_UINT32, arena);
}
UPB_INLINE bool validate_UInt32Rules_add_in(validate_UInt32Rules *msg, uint32_t val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(24, 24), UPB_SIZE(4, 4), UPB_TYPE_UINT32, &val,
- arena);
+ return _upb_array_append_accessor(msg, UPB_SIZE(24, 24), UPB_SIZE(4, 4), UPB_TYPE_UINT32, &val,
+ arena);
}
UPB_INLINE uint32_t* validate_UInt32Rules_mutable_not_in(validate_UInt32Rules *msg, size_t *len) {
return (uint32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 32), len);
}
UPB_INLINE uint32_t* validate_UInt32Rules_resize_not_in(validate_UInt32Rules *msg, size_t len, upb_arena *arena) {
- return (uint32_t*)_upb_array_resize_accessor(msg, UPB_SIZE(28, 32), len, UPB_TYPE_UINT32, arena);
+ return (uint32_t*)_upb_array_resize_accessor(msg, UPB_SIZE(28, 32), len, UPB_TYPE_UINT32, arena);
}
UPB_INLINE bool validate_UInt32Rules_add_not_in(validate_UInt32Rules *msg, uint32_t val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(28, 32), UPB_SIZE(4, 4), UPB_TYPE_UINT32, &val,
- arena);
+ return _upb_array_append_accessor(msg, UPB_SIZE(28, 32), UPB_SIZE(4, 4), UPB_TYPE_UINT32, &val,
+ arena);
}
/* validate.UInt64Rules */
UPB_INLINE validate_UInt64Rules *validate_UInt64Rules_new(upb_arena *arena) {
- return (validate_UInt64Rules *)_upb_msg_new(&validate_UInt64Rules_msginit, arena);
+ return (validate_UInt64Rules *)_upb_msg_new(&validate_UInt64Rules_msginit, arena);
}
UPB_INLINE validate_UInt64Rules *validate_UInt64Rules_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -805,64 +805,64 @@ UPB_INLINE char *validate_UInt64Rules_serialize(const validate_UInt64Rules *msg,
return upb_encode(msg, &validate_UInt64Rules_msginit, arena, len);
}
-UPB_INLINE bool validate_UInt64Rules_has_const(const validate_UInt64Rules *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE uint64_t validate_UInt64Rules_const(const validate_UInt64Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint64_t); }
-UPB_INLINE bool validate_UInt64Rules_has_lt(const validate_UInt64Rules *msg) { return _upb_hasbit(msg, 2); }
-UPB_INLINE uint64_t validate_UInt64Rules_lt(const validate_UInt64Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), uint64_t); }
-UPB_INLINE bool validate_UInt64Rules_has_lte(const validate_UInt64Rules *msg) { return _upb_hasbit(msg, 3); }
-UPB_INLINE uint64_t validate_UInt64Rules_lte(const validate_UInt64Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), uint64_t); }
-UPB_INLINE bool validate_UInt64Rules_has_gt(const validate_UInt64Rules *msg) { return _upb_hasbit(msg, 4); }
-UPB_INLINE uint64_t validate_UInt64Rules_gt(const validate_UInt64Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 32), uint64_t); }
-UPB_INLINE bool validate_UInt64Rules_has_gte(const validate_UInt64Rules *msg) { return _upb_hasbit(msg, 5); }
-UPB_INLINE uint64_t validate_UInt64Rules_gte(const validate_UInt64Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(40, 40), uint64_t); }
+UPB_INLINE bool validate_UInt64Rules_has_const(const validate_UInt64Rules *msg) { return _upb_hasbit(msg, 1); }
+UPB_INLINE uint64_t validate_UInt64Rules_const(const validate_UInt64Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint64_t); }
+UPB_INLINE bool validate_UInt64Rules_has_lt(const validate_UInt64Rules *msg) { return _upb_hasbit(msg, 2); }
+UPB_INLINE uint64_t validate_UInt64Rules_lt(const validate_UInt64Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), uint64_t); }
+UPB_INLINE bool validate_UInt64Rules_has_lte(const validate_UInt64Rules *msg) { return _upb_hasbit(msg, 3); }
+UPB_INLINE uint64_t validate_UInt64Rules_lte(const validate_UInt64Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), uint64_t); }
+UPB_INLINE bool validate_UInt64Rules_has_gt(const validate_UInt64Rules *msg) { return _upb_hasbit(msg, 4); }
+UPB_INLINE uint64_t validate_UInt64Rules_gt(const validate_UInt64Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 32), uint64_t); }
+UPB_INLINE bool validate_UInt64Rules_has_gte(const validate_UInt64Rules *msg) { return _upb_hasbit(msg, 5); }
+UPB_INLINE uint64_t validate_UInt64Rules_gte(const validate_UInt64Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(40, 40), uint64_t); }
UPB_INLINE uint64_t const* validate_UInt64Rules_in(const validate_UInt64Rules *msg, size_t *len) { return (uint64_t const*)_upb_array_accessor(msg, UPB_SIZE(48, 48), len); }
UPB_INLINE uint64_t const* validate_UInt64Rules_not_in(const validate_UInt64Rules *msg, size_t *len) { return (uint64_t const*)_upb_array_accessor(msg, UPB_SIZE(52, 56), len); }
UPB_INLINE void validate_UInt64Rules_set_const(validate_UInt64Rules *msg, uint64_t value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint64_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint64_t) = value;
}
UPB_INLINE void validate_UInt64Rules_set_lt(validate_UInt64Rules *msg, uint64_t value) {
_upb_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(16, 16), uint64_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 16), uint64_t) = value;
}
UPB_INLINE void validate_UInt64Rules_set_lte(validate_UInt64Rules *msg, uint64_t value) {
_upb_sethas(msg, 3);
- *UPB_PTR_AT(msg, UPB_SIZE(24, 24), uint64_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 24), uint64_t) = value;
}
UPB_INLINE void validate_UInt64Rules_set_gt(validate_UInt64Rules *msg, uint64_t value) {
_upb_sethas(msg, 4);
- *UPB_PTR_AT(msg, UPB_SIZE(32, 32), uint64_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 32), uint64_t) = value;
}
UPB_INLINE void validate_UInt64Rules_set_gte(validate_UInt64Rules *msg, uint64_t value) {
_upb_sethas(msg, 5);
- *UPB_PTR_AT(msg, UPB_SIZE(40, 40), uint64_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 40), uint64_t) = value;
}
UPB_INLINE uint64_t* validate_UInt64Rules_mutable_in(validate_UInt64Rules *msg, size_t *len) {
return (uint64_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(48, 48), len);
}
UPB_INLINE uint64_t* validate_UInt64Rules_resize_in(validate_UInt64Rules *msg, size_t len, upb_arena *arena) {
- return (uint64_t*)_upb_array_resize_accessor(msg, UPB_SIZE(48, 48), len, UPB_TYPE_UINT64, arena);
+ return (uint64_t*)_upb_array_resize_accessor(msg, UPB_SIZE(48, 48), len, UPB_TYPE_UINT64, arena);
}
UPB_INLINE bool validate_UInt64Rules_add_in(validate_UInt64Rules *msg, uint64_t val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(48, 48), UPB_SIZE(8, 8), UPB_TYPE_UINT64, &val,
- arena);
+ return _upb_array_append_accessor(msg, UPB_SIZE(48, 48), UPB_SIZE(8, 8), UPB_TYPE_UINT64, &val,
+ arena);
}
UPB_INLINE uint64_t* validate_UInt64Rules_mutable_not_in(validate_UInt64Rules *msg, size_t *len) {
return (uint64_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(52, 56), len);
}
UPB_INLINE uint64_t* validate_UInt64Rules_resize_not_in(validate_UInt64Rules *msg, size_t len, upb_arena *arena) {
- return (uint64_t*)_upb_array_resize_accessor(msg, UPB_SIZE(52, 56), len, UPB_TYPE_UINT64, arena);
+ return (uint64_t*)_upb_array_resize_accessor(msg, UPB_SIZE(52, 56), len, UPB_TYPE_UINT64, arena);
}
UPB_INLINE bool validate_UInt64Rules_add_not_in(validate_UInt64Rules *msg, uint64_t val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(52, 56), UPB_SIZE(8, 8), UPB_TYPE_UINT64, &val,
- arena);
+ return _upb_array_append_accessor(msg, UPB_SIZE(52, 56), UPB_SIZE(8, 8), UPB_TYPE_UINT64, &val,
+ arena);
}
/* validate.SInt32Rules */
UPB_INLINE validate_SInt32Rules *validate_SInt32Rules_new(upb_arena *arena) {
- return (validate_SInt32Rules *)_upb_msg_new(&validate_SInt32Rules_msginit, arena);
+ return (validate_SInt32Rules *)_upb_msg_new(&validate_SInt32Rules_msginit, arena);
}
UPB_INLINE validate_SInt32Rules *validate_SInt32Rules_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -873,64 +873,64 @@ UPB_INLINE char *validate_SInt32Rules_serialize(const validate_SInt32Rules *msg,
return upb_encode(msg, &validate_SInt32Rules_msginit, arena, len);
}
-UPB_INLINE bool validate_SInt32Rules_has_const(const validate_SInt32Rules *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE int32_t validate_SInt32Rules_const(const validate_SInt32Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); }
-UPB_INLINE bool validate_SInt32Rules_has_lt(const validate_SInt32Rules *msg) { return _upb_hasbit(msg, 2); }
-UPB_INLINE int32_t validate_SInt32Rules_lt(const validate_SInt32Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); }
-UPB_INLINE bool validate_SInt32Rules_has_lte(const validate_SInt32Rules *msg) { return _upb_hasbit(msg, 3); }
-UPB_INLINE int32_t validate_SInt32Rules_lte(const validate_SInt32Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 12), int32_t); }
-UPB_INLINE bool validate_SInt32Rules_has_gt(const validate_SInt32Rules *msg) { return _upb_hasbit(msg, 4); }
-UPB_INLINE int32_t validate_SInt32Rules_gt(const validate_SInt32Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t); }
-UPB_INLINE bool validate_SInt32Rules_has_gte(const validate_SInt32Rules *msg) { return _upb_hasbit(msg, 5); }
-UPB_INLINE int32_t validate_SInt32Rules_gte(const validate_SInt32Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 20), int32_t); }
+UPB_INLINE bool validate_SInt32Rules_has_const(const validate_SInt32Rules *msg) { return _upb_hasbit(msg, 1); }
+UPB_INLINE int32_t validate_SInt32Rules_const(const validate_SInt32Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); }
+UPB_INLINE bool validate_SInt32Rules_has_lt(const validate_SInt32Rules *msg) { return _upb_hasbit(msg, 2); }
+UPB_INLINE int32_t validate_SInt32Rules_lt(const validate_SInt32Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); }
+UPB_INLINE bool validate_SInt32Rules_has_lte(const validate_SInt32Rules *msg) { return _upb_hasbit(msg, 3); }
+UPB_INLINE int32_t validate_SInt32Rules_lte(const validate_SInt32Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 12), int32_t); }
+UPB_INLINE bool validate_SInt32Rules_has_gt(const validate_SInt32Rules *msg) { return _upb_hasbit(msg, 4); }
+UPB_INLINE int32_t validate_SInt32Rules_gt(const validate_SInt32Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t); }
+UPB_INLINE bool validate_SInt32Rules_has_gte(const validate_SInt32Rules *msg) { return _upb_hasbit(msg, 5); }
+UPB_INLINE int32_t validate_SInt32Rules_gte(const validate_SInt32Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 20), int32_t); }
UPB_INLINE int32_t const* validate_SInt32Rules_in(const validate_SInt32Rules *msg, size_t *len) { return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(24, 24), len); }
UPB_INLINE int32_t const* validate_SInt32Rules_not_in(const validate_SInt32Rules *msg, size_t *len) { return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(28, 32), len); }
UPB_INLINE void validate_SInt32Rules_set_const(validate_SInt32Rules *msg, int32_t value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value;
}
UPB_INLINE void validate_SInt32Rules_set_lt(validate_SInt32Rules *msg, int32_t value) {
_upb_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
}
UPB_INLINE void validate_SInt32Rules_set_lte(validate_SInt32Rules *msg, int32_t value) {
_upb_sethas(msg, 3);
- *UPB_PTR_AT(msg, UPB_SIZE(12, 12), int32_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 12), int32_t) = value;
}
UPB_INLINE void validate_SInt32Rules_set_gt(validate_SInt32Rules *msg, int32_t value) {
_upb_sethas(msg, 4);
- *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t) = value;
}
UPB_INLINE void validate_SInt32Rules_set_gte(validate_SInt32Rules *msg, int32_t value) {
_upb_sethas(msg, 5);
- *UPB_PTR_AT(msg, UPB_SIZE(20, 20), int32_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 20), int32_t) = value;
}
UPB_INLINE int32_t* validate_SInt32Rules_mutable_in(validate_SInt32Rules *msg, size_t *len) {
return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 24), len);
}
UPB_INLINE int32_t* validate_SInt32Rules_resize_in(validate_SInt32Rules *msg, size_t len, upb_arena *arena) {
- return (int32_t*)_upb_array_resize_accessor(msg, UPB_SIZE(24, 24), len, UPB_TYPE_INT32, arena);
+ return (int32_t*)_upb_array_resize_accessor(msg, UPB_SIZE(24, 24), len, UPB_TYPE_INT32, arena);
}
UPB_INLINE bool validate_SInt32Rules_add_in(validate_SInt32Rules *msg, int32_t val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(24, 24), UPB_SIZE(4, 4), UPB_TYPE_INT32, &val,
- arena);
+ return _upb_array_append_accessor(msg, UPB_SIZE(24, 24), UPB_SIZE(4, 4), UPB_TYPE_INT32, &val,
+ arena);
}
UPB_INLINE int32_t* validate_SInt32Rules_mutable_not_in(validate_SInt32Rules *msg, size_t *len) {
return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 32), len);
}
UPB_INLINE int32_t* validate_SInt32Rules_resize_not_in(validate_SInt32Rules *msg, size_t len, upb_arena *arena) {
- return (int32_t*)_upb_array_resize_accessor(msg, UPB_SIZE(28, 32), len, UPB_TYPE_INT32, arena);
+ return (int32_t*)_upb_array_resize_accessor(msg, UPB_SIZE(28, 32), len, UPB_TYPE_INT32, arena);
}
UPB_INLINE bool validate_SInt32Rules_add_not_in(validate_SInt32Rules *msg, int32_t val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(28, 32), UPB_SIZE(4, 4), UPB_TYPE_INT32, &val,
- arena);
+ return _upb_array_append_accessor(msg, UPB_SIZE(28, 32), UPB_SIZE(4, 4), UPB_TYPE_INT32, &val,
+ arena);
}
/* validate.SInt64Rules */
UPB_INLINE validate_SInt64Rules *validate_SInt64Rules_new(upb_arena *arena) {
- return (validate_SInt64Rules *)_upb_msg_new(&validate_SInt64Rules_msginit, arena);
+ return (validate_SInt64Rules *)_upb_msg_new(&validate_SInt64Rules_msginit, arena);
}
UPB_INLINE validate_SInt64Rules *validate_SInt64Rules_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -941,64 +941,64 @@ UPB_INLINE char *validate_SInt64Rules_serialize(const validate_SInt64Rules *msg,
return upb_encode(msg, &validate_SInt64Rules_msginit, arena, len);
}
-UPB_INLINE bool validate_SInt64Rules_has_const(const validate_SInt64Rules *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE int64_t validate_SInt64Rules_const(const validate_SInt64Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int64_t); }
-UPB_INLINE bool validate_SInt64Rules_has_lt(const validate_SInt64Rules *msg) { return _upb_hasbit(msg, 2); }
-UPB_INLINE int64_t validate_SInt64Rules_lt(const validate_SInt64Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int64_t); }
-UPB_INLINE bool validate_SInt64Rules_has_lte(const validate_SInt64Rules *msg) { return _upb_hasbit(msg, 3); }
-UPB_INLINE int64_t validate_SInt64Rules_lte(const validate_SInt64Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), int64_t); }
-UPB_INLINE bool validate_SInt64Rules_has_gt(const validate_SInt64Rules *msg) { return _upb_hasbit(msg, 4); }
-UPB_INLINE int64_t validate_SInt64Rules_gt(const validate_SInt64Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 32), int64_t); }
-UPB_INLINE bool validate_SInt64Rules_has_gte(const validate_SInt64Rules *msg) { return _upb_hasbit(msg, 5); }
-UPB_INLINE int64_t validate_SInt64Rules_gte(const validate_SInt64Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(40, 40), int64_t); }
+UPB_INLINE bool validate_SInt64Rules_has_const(const validate_SInt64Rules *msg) { return _upb_hasbit(msg, 1); }
+UPB_INLINE int64_t validate_SInt64Rules_const(const validate_SInt64Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int64_t); }
+UPB_INLINE bool validate_SInt64Rules_has_lt(const validate_SInt64Rules *msg) { return _upb_hasbit(msg, 2); }
+UPB_INLINE int64_t validate_SInt64Rules_lt(const validate_SInt64Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int64_t); }
+UPB_INLINE bool validate_SInt64Rules_has_lte(const validate_SInt64Rules *msg) { return _upb_hasbit(msg, 3); }
+UPB_INLINE int64_t validate_SInt64Rules_lte(const validate_SInt64Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), int64_t); }
+UPB_INLINE bool validate_SInt64Rules_has_gt(const validate_SInt64Rules *msg) { return _upb_hasbit(msg, 4); }
+UPB_INLINE int64_t validate_SInt64Rules_gt(const validate_SInt64Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 32), int64_t); }
+UPB_INLINE bool validate_SInt64Rules_has_gte(const validate_SInt64Rules *msg) { return _upb_hasbit(msg, 5); }
+UPB_INLINE int64_t validate_SInt64Rules_gte(const validate_SInt64Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(40, 40), int64_t); }
UPB_INLINE int64_t const* validate_SInt64Rules_in(const validate_SInt64Rules *msg, size_t *len) { return (int64_t const*)_upb_array_accessor(msg, UPB_SIZE(48, 48), len); }
UPB_INLINE int64_t const* validate_SInt64Rules_not_in(const validate_SInt64Rules *msg, size_t *len) { return (int64_t const*)_upb_array_accessor(msg, UPB_SIZE(52, 56), len); }
UPB_INLINE void validate_SInt64Rules_set_const(validate_SInt64Rules *msg, int64_t value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int64_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int64_t) = value;
}
UPB_INLINE void validate_SInt64Rules_set_lt(validate_SInt64Rules *msg, int64_t value) {
_upb_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int64_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int64_t) = value;
}
UPB_INLINE void validate_SInt64Rules_set_lte(validate_SInt64Rules *msg, int64_t value) {
_upb_sethas(msg, 3);
- *UPB_PTR_AT(msg, UPB_SIZE(24, 24), int64_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 24), int64_t) = value;
}
UPB_INLINE void validate_SInt64Rules_set_gt(validate_SInt64Rules *msg, int64_t value) {
_upb_sethas(msg, 4);
- *UPB_PTR_AT(msg, UPB_SIZE(32, 32), int64_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 32), int64_t) = value;
}
UPB_INLINE void validate_SInt64Rules_set_gte(validate_SInt64Rules *msg, int64_t value) {
_upb_sethas(msg, 5);
- *UPB_PTR_AT(msg, UPB_SIZE(40, 40), int64_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 40), int64_t) = value;
}
UPB_INLINE int64_t* validate_SInt64Rules_mutable_in(validate_SInt64Rules *msg, size_t *len) {
return (int64_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(48, 48), len);
}
UPB_INLINE int64_t* validate_SInt64Rules_resize_in(validate_SInt64Rules *msg, size_t len, upb_arena *arena) {
- return (int64_t*)_upb_array_resize_accessor(msg, UPB_SIZE(48, 48), len, UPB_TYPE_INT64, arena);
+ return (int64_t*)_upb_array_resize_accessor(msg, UPB_SIZE(48, 48), len, UPB_TYPE_INT64, arena);
}
UPB_INLINE bool validate_SInt64Rules_add_in(validate_SInt64Rules *msg, int64_t val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(48, 48), UPB_SIZE(8, 8), UPB_TYPE_INT64, &val,
- arena);
+ return _upb_array_append_accessor(msg, UPB_SIZE(48, 48), UPB_SIZE(8, 8), UPB_TYPE_INT64, &val,
+ arena);
}
UPB_INLINE int64_t* validate_SInt64Rules_mutable_not_in(validate_SInt64Rules *msg, size_t *len) {
return (int64_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(52, 56), len);
}
UPB_INLINE int64_t* validate_SInt64Rules_resize_not_in(validate_SInt64Rules *msg, size_t len, upb_arena *arena) {
- return (int64_t*)_upb_array_resize_accessor(msg, UPB_SIZE(52, 56), len, UPB_TYPE_INT64, arena);
+ return (int64_t*)_upb_array_resize_accessor(msg, UPB_SIZE(52, 56), len, UPB_TYPE_INT64, arena);
}
UPB_INLINE bool validate_SInt64Rules_add_not_in(validate_SInt64Rules *msg, int64_t val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(52, 56), UPB_SIZE(8, 8), UPB_TYPE_INT64, &val,
- arena);
+ return _upb_array_append_accessor(msg, UPB_SIZE(52, 56), UPB_SIZE(8, 8), UPB_TYPE_INT64, &val,
+ arena);
}
/* validate.Fixed32Rules */
UPB_INLINE validate_Fixed32Rules *validate_Fixed32Rules_new(upb_arena *arena) {
- return (validate_Fixed32Rules *)_upb_msg_new(&validate_Fixed32Rules_msginit, arena);
+ return (validate_Fixed32Rules *)_upb_msg_new(&validate_Fixed32Rules_msginit, arena);
}
UPB_INLINE validate_Fixed32Rules *validate_Fixed32Rules_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -1009,64 +1009,64 @@ UPB_INLINE char *validate_Fixed32Rules_serialize(const validate_Fixed32Rules *ms
return upb_encode(msg, &validate_Fixed32Rules_msginit, arena, len);
}
-UPB_INLINE bool validate_Fixed32Rules_has_const(const validate_Fixed32Rules *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE uint32_t validate_Fixed32Rules_const(const validate_Fixed32Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t); }
-UPB_INLINE bool validate_Fixed32Rules_has_lt(const validate_Fixed32Rules *msg) { return _upb_hasbit(msg, 2); }
-UPB_INLINE uint32_t validate_Fixed32Rules_lt(const validate_Fixed32Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint32_t); }
-UPB_INLINE bool validate_Fixed32Rules_has_lte(const validate_Fixed32Rules *msg) { return _upb_hasbit(msg, 3); }
-UPB_INLINE uint32_t validate_Fixed32Rules_lte(const validate_Fixed32Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 12), uint32_t); }
-UPB_INLINE bool validate_Fixed32Rules_has_gt(const validate_Fixed32Rules *msg) { return _upb_hasbit(msg, 4); }
-UPB_INLINE uint32_t validate_Fixed32Rules_gt(const validate_Fixed32Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), uint32_t); }
-UPB_INLINE bool validate_Fixed32Rules_has_gte(const validate_Fixed32Rules *msg) { return _upb_hasbit(msg, 5); }
-UPB_INLINE uint32_t validate_Fixed32Rules_gte(const validate_Fixed32Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 20), uint32_t); }
+UPB_INLINE bool validate_Fixed32Rules_has_const(const validate_Fixed32Rules *msg) { return _upb_hasbit(msg, 1); }
+UPB_INLINE uint32_t validate_Fixed32Rules_const(const validate_Fixed32Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t); }
+UPB_INLINE bool validate_Fixed32Rules_has_lt(const validate_Fixed32Rules *msg) { return _upb_hasbit(msg, 2); }
+UPB_INLINE uint32_t validate_Fixed32Rules_lt(const validate_Fixed32Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint32_t); }
+UPB_INLINE bool validate_Fixed32Rules_has_lte(const validate_Fixed32Rules *msg) { return _upb_hasbit(msg, 3); }
+UPB_INLINE uint32_t validate_Fixed32Rules_lte(const validate_Fixed32Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 12), uint32_t); }
+UPB_INLINE bool validate_Fixed32Rules_has_gt(const validate_Fixed32Rules *msg) { return _upb_hasbit(msg, 4); }
+UPB_INLINE uint32_t validate_Fixed32Rules_gt(const validate_Fixed32Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), uint32_t); }
+UPB_INLINE bool validate_Fixed32Rules_has_gte(const validate_Fixed32Rules *msg) { return _upb_hasbit(msg, 5); }
+UPB_INLINE uint32_t validate_Fixed32Rules_gte(const validate_Fixed32Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 20), uint32_t); }
UPB_INLINE uint32_t const* validate_Fixed32Rules_in(const validate_Fixed32Rules *msg, size_t *len) { return (uint32_t const*)_upb_array_accessor(msg, UPB_SIZE(24, 24), len); }
UPB_INLINE uint32_t const* validate_Fixed32Rules_not_in(const validate_Fixed32Rules *msg, size_t *len) { return (uint32_t const*)_upb_array_accessor(msg, UPB_SIZE(28, 32), len); }
UPB_INLINE void validate_Fixed32Rules_set_const(validate_Fixed32Rules *msg, uint32_t value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t) = value;
}
UPB_INLINE void validate_Fixed32Rules_set_lt(validate_Fixed32Rules *msg, uint32_t value) {
_upb_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint32_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint32_t) = value;
}
UPB_INLINE void validate_Fixed32Rules_set_lte(validate_Fixed32Rules *msg, uint32_t value) {
_upb_sethas(msg, 3);
- *UPB_PTR_AT(msg, UPB_SIZE(12, 12), uint32_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 12), uint32_t) = value;
}
UPB_INLINE void validate_Fixed32Rules_set_gt(validate_Fixed32Rules *msg, uint32_t value) {
_upb_sethas(msg, 4);
- *UPB_PTR_AT(msg, UPB_SIZE(16, 16), uint32_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 16), uint32_t) = value;
}
UPB_INLINE void validate_Fixed32Rules_set_gte(validate_Fixed32Rules *msg, uint32_t value) {
_upb_sethas(msg, 5);
- *UPB_PTR_AT(msg, UPB_SIZE(20, 20), uint32_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 20), uint32_t) = value;
}
UPB_INLINE uint32_t* validate_Fixed32Rules_mutable_in(validate_Fixed32Rules *msg, size_t *len) {
return (uint32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 24), len);
}
UPB_INLINE uint32_t* validate_Fixed32Rules_resize_in(validate_Fixed32Rules *msg, size_t len, upb_arena *arena) {
- return (uint32_t*)_upb_array_resize_accessor(msg, UPB_SIZE(24, 24), len, UPB_TYPE_UINT32, arena);
+ return (uint32_t*)_upb_array_resize_accessor(msg, UPB_SIZE(24, 24), len, UPB_TYPE_UINT32, arena);
}
UPB_INLINE bool validate_Fixed32Rules_add_in(validate_Fixed32Rules *msg, uint32_t val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(24, 24), UPB_SIZE(4, 4), UPB_TYPE_UINT32, &val,
- arena);
+ return _upb_array_append_accessor(msg, UPB_SIZE(24, 24), UPB_SIZE(4, 4), UPB_TYPE_UINT32, &val,
+ arena);
}
UPB_INLINE uint32_t* validate_Fixed32Rules_mutable_not_in(validate_Fixed32Rules *msg, size_t *len) {
return (uint32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 32), len);
}
UPB_INLINE uint32_t* validate_Fixed32Rules_resize_not_in(validate_Fixed32Rules *msg, size_t len, upb_arena *arena) {
- return (uint32_t*)_upb_array_resize_accessor(msg, UPB_SIZE(28, 32), len, UPB_TYPE_UINT32, arena);
+ return (uint32_t*)_upb_array_resize_accessor(msg, UPB_SIZE(28, 32), len, UPB_TYPE_UINT32, arena);
}
UPB_INLINE bool validate_Fixed32Rules_add_not_in(validate_Fixed32Rules *msg, uint32_t val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(28, 32), UPB_SIZE(4, 4), UPB_TYPE_UINT32, &val,
- arena);
+ return _upb_array_append_accessor(msg, UPB_SIZE(28, 32), UPB_SIZE(4, 4), UPB_TYPE_UINT32, &val,
+ arena);
}
/* validate.Fixed64Rules */
UPB_INLINE validate_Fixed64Rules *validate_Fixed64Rules_new(upb_arena *arena) {
- return (validate_Fixed64Rules *)_upb_msg_new(&validate_Fixed64Rules_msginit, arena);
+ return (validate_Fixed64Rules *)_upb_msg_new(&validate_Fixed64Rules_msginit, arena);
}
UPB_INLINE validate_Fixed64Rules *validate_Fixed64Rules_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -1077,64 +1077,64 @@ UPB_INLINE char *validate_Fixed64Rules_serialize(const validate_Fixed64Rules *ms
return upb_encode(msg, &validate_Fixed64Rules_msginit, arena, len);
}
-UPB_INLINE bool validate_Fixed64Rules_has_const(const validate_Fixed64Rules *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE uint64_t validate_Fixed64Rules_const(const validate_Fixed64Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint64_t); }
-UPB_INLINE bool validate_Fixed64Rules_has_lt(const validate_Fixed64Rules *msg) { return _upb_hasbit(msg, 2); }
-UPB_INLINE uint64_t validate_Fixed64Rules_lt(const validate_Fixed64Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), uint64_t); }
-UPB_INLINE bool validate_Fixed64Rules_has_lte(const validate_Fixed64Rules *msg) { return _upb_hasbit(msg, 3); }
-UPB_INLINE uint64_t validate_Fixed64Rules_lte(const validate_Fixed64Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), uint64_t); }
-UPB_INLINE bool validate_Fixed64Rules_has_gt(const validate_Fixed64Rules *msg) { return _upb_hasbit(msg, 4); }
-UPB_INLINE uint64_t validate_Fixed64Rules_gt(const validate_Fixed64Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 32), uint64_t); }
-UPB_INLINE bool validate_Fixed64Rules_has_gte(const validate_Fixed64Rules *msg) { return _upb_hasbit(msg, 5); }
-UPB_INLINE uint64_t validate_Fixed64Rules_gte(const validate_Fixed64Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(40, 40), uint64_t); }
+UPB_INLINE bool validate_Fixed64Rules_has_const(const validate_Fixed64Rules *msg) { return _upb_hasbit(msg, 1); }
+UPB_INLINE uint64_t validate_Fixed64Rules_const(const validate_Fixed64Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint64_t); }
+UPB_INLINE bool validate_Fixed64Rules_has_lt(const validate_Fixed64Rules *msg) { return _upb_hasbit(msg, 2); }
+UPB_INLINE uint64_t validate_Fixed64Rules_lt(const validate_Fixed64Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), uint64_t); }
+UPB_INLINE bool validate_Fixed64Rules_has_lte(const validate_Fixed64Rules *msg) { return _upb_hasbit(msg, 3); }
+UPB_INLINE uint64_t validate_Fixed64Rules_lte(const validate_Fixed64Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), uint64_t); }
+UPB_INLINE bool validate_Fixed64Rules_has_gt(const validate_Fixed64Rules *msg) { return _upb_hasbit(msg, 4); }
+UPB_INLINE uint64_t validate_Fixed64Rules_gt(const validate_Fixed64Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 32), uint64_t); }
+UPB_INLINE bool validate_Fixed64Rules_has_gte(const validate_Fixed64Rules *msg) { return _upb_hasbit(msg, 5); }
+UPB_INLINE uint64_t validate_Fixed64Rules_gte(const validate_Fixed64Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(40, 40), uint64_t); }
UPB_INLINE uint64_t const* validate_Fixed64Rules_in(const validate_Fixed64Rules *msg, size_t *len) { return (uint64_t const*)_upb_array_accessor(msg, UPB_SIZE(48, 48), len); }
UPB_INLINE uint64_t const* validate_Fixed64Rules_not_in(const validate_Fixed64Rules *msg, size_t *len) { return (uint64_t const*)_upb_array_accessor(msg, UPB_SIZE(52, 56), len); }
UPB_INLINE void validate_Fixed64Rules_set_const(validate_Fixed64Rules *msg, uint64_t value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint64_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint64_t) = value;
}
UPB_INLINE void validate_Fixed64Rules_set_lt(validate_Fixed64Rules *msg, uint64_t value) {
_upb_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(16, 16), uint64_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 16), uint64_t) = value;
}
UPB_INLINE void validate_Fixed64Rules_set_lte(validate_Fixed64Rules *msg, uint64_t value) {
_upb_sethas(msg, 3);
- *UPB_PTR_AT(msg, UPB_SIZE(24, 24), uint64_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 24), uint64_t) = value;
}
UPB_INLINE void validate_Fixed64Rules_set_gt(validate_Fixed64Rules *msg, uint64_t value) {
_upb_sethas(msg, 4);
- *UPB_PTR_AT(msg, UPB_SIZE(32, 32), uint64_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 32), uint64_t) = value;
}
UPB_INLINE void validate_Fixed64Rules_set_gte(validate_Fixed64Rules *msg, uint64_t value) {
_upb_sethas(msg, 5);
- *UPB_PTR_AT(msg, UPB_SIZE(40, 40), uint64_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 40), uint64_t) = value;
}
UPB_INLINE uint64_t* validate_Fixed64Rules_mutable_in(validate_Fixed64Rules *msg, size_t *len) {
return (uint64_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(48, 48), len);
}
UPB_INLINE uint64_t* validate_Fixed64Rules_resize_in(validate_Fixed64Rules *msg, size_t len, upb_arena *arena) {
- return (uint64_t*)_upb_array_resize_accessor(msg, UPB_SIZE(48, 48), len, UPB_TYPE_UINT64, arena);
+ return (uint64_t*)_upb_array_resize_accessor(msg, UPB_SIZE(48, 48), len, UPB_TYPE_UINT64, arena);
}
UPB_INLINE bool validate_Fixed64Rules_add_in(validate_Fixed64Rules *msg, uint64_t val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(48, 48), UPB_SIZE(8, 8), UPB_TYPE_UINT64, &val,
- arena);
+ return _upb_array_append_accessor(msg, UPB_SIZE(48, 48), UPB_SIZE(8, 8), UPB_TYPE_UINT64, &val,
+ arena);
}
UPB_INLINE uint64_t* validate_Fixed64Rules_mutable_not_in(validate_Fixed64Rules *msg, size_t *len) {
return (uint64_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(52, 56), len);
}
UPB_INLINE uint64_t* validate_Fixed64Rules_resize_not_in(validate_Fixed64Rules *msg, size_t len, upb_arena *arena) {
- return (uint64_t*)_upb_array_resize_accessor(msg, UPB_SIZE(52, 56), len, UPB_TYPE_UINT64, arena);
+ return (uint64_t*)_upb_array_resize_accessor(msg, UPB_SIZE(52, 56), len, UPB_TYPE_UINT64, arena);
}
UPB_INLINE bool validate_Fixed64Rules_add_not_in(validate_Fixed64Rules *msg, uint64_t val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(52, 56), UPB_SIZE(8, 8), UPB_TYPE_UINT64, &val,
- arena);
+ return _upb_array_append_accessor(msg, UPB_SIZE(52, 56), UPB_SIZE(8, 8), UPB_TYPE_UINT64, &val,
+ arena);
}
/* validate.SFixed32Rules */
UPB_INLINE validate_SFixed32Rules *validate_SFixed32Rules_new(upb_arena *arena) {
- return (validate_SFixed32Rules *)_upb_msg_new(&validate_SFixed32Rules_msginit, arena);
+ return (validate_SFixed32Rules *)_upb_msg_new(&validate_SFixed32Rules_msginit, arena);
}
UPB_INLINE validate_SFixed32Rules *validate_SFixed32Rules_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -1145,64 +1145,64 @@ UPB_INLINE char *validate_SFixed32Rules_serialize(const validate_SFixed32Rules *
return upb_encode(msg, &validate_SFixed32Rules_msginit, arena, len);
}
-UPB_INLINE bool validate_SFixed32Rules_has_const(const validate_SFixed32Rules *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE int32_t validate_SFixed32Rules_const(const validate_SFixed32Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); }
-UPB_INLINE bool validate_SFixed32Rules_has_lt(const validate_SFixed32Rules *msg) { return _upb_hasbit(msg, 2); }
-UPB_INLINE int32_t validate_SFixed32Rules_lt(const validate_SFixed32Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); }
-UPB_INLINE bool validate_SFixed32Rules_has_lte(const validate_SFixed32Rules *msg) { return _upb_hasbit(msg, 3); }
-UPB_INLINE int32_t validate_SFixed32Rules_lte(const validate_SFixed32Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 12), int32_t); }
-UPB_INLINE bool validate_SFixed32Rules_has_gt(const validate_SFixed32Rules *msg) { return _upb_hasbit(msg, 4); }
-UPB_INLINE int32_t validate_SFixed32Rules_gt(const validate_SFixed32Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t); }
-UPB_INLINE bool validate_SFixed32Rules_has_gte(const validate_SFixed32Rules *msg) { return _upb_hasbit(msg, 5); }
-UPB_INLINE int32_t validate_SFixed32Rules_gte(const validate_SFixed32Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 20), int32_t); }
+UPB_INLINE bool validate_SFixed32Rules_has_const(const validate_SFixed32Rules *msg) { return _upb_hasbit(msg, 1); }
+UPB_INLINE int32_t validate_SFixed32Rules_const(const validate_SFixed32Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); }
+UPB_INLINE bool validate_SFixed32Rules_has_lt(const validate_SFixed32Rules *msg) { return _upb_hasbit(msg, 2); }
+UPB_INLINE int32_t validate_SFixed32Rules_lt(const validate_SFixed32Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); }
+UPB_INLINE bool validate_SFixed32Rules_has_lte(const validate_SFixed32Rules *msg) { return _upb_hasbit(msg, 3); }
+UPB_INLINE int32_t validate_SFixed32Rules_lte(const validate_SFixed32Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 12), int32_t); }
+UPB_INLINE bool validate_SFixed32Rules_has_gt(const validate_SFixed32Rules *msg) { return _upb_hasbit(msg, 4); }
+UPB_INLINE int32_t validate_SFixed32Rules_gt(const validate_SFixed32Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t); }
+UPB_INLINE bool validate_SFixed32Rules_has_gte(const validate_SFixed32Rules *msg) { return _upb_hasbit(msg, 5); }
+UPB_INLINE int32_t validate_SFixed32Rules_gte(const validate_SFixed32Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 20), int32_t); }
UPB_INLINE int32_t const* validate_SFixed32Rules_in(const validate_SFixed32Rules *msg, size_t *len) { return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(24, 24), len); }
UPB_INLINE int32_t const* validate_SFixed32Rules_not_in(const validate_SFixed32Rules *msg, size_t *len) { return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(28, 32), len); }
UPB_INLINE void validate_SFixed32Rules_set_const(validate_SFixed32Rules *msg, int32_t value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value;
}
UPB_INLINE void validate_SFixed32Rules_set_lt(validate_SFixed32Rules *msg, int32_t value) {
_upb_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
}
UPB_INLINE void validate_SFixed32Rules_set_lte(validate_SFixed32Rules *msg, int32_t value) {
_upb_sethas(msg, 3);
- *UPB_PTR_AT(msg, UPB_SIZE(12, 12), int32_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 12), int32_t) = value;
}
UPB_INLINE void validate_SFixed32Rules_set_gt(validate_SFixed32Rules *msg, int32_t value) {
_upb_sethas(msg, 4);
- *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t) = value;
}
UPB_INLINE void validate_SFixed32Rules_set_gte(validate_SFixed32Rules *msg, int32_t value) {
_upb_sethas(msg, 5);
- *UPB_PTR_AT(msg, UPB_SIZE(20, 20), int32_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 20), int32_t) = value;
}
UPB_INLINE int32_t* validate_SFixed32Rules_mutable_in(validate_SFixed32Rules *msg, size_t *len) {
return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 24), len);
}
UPB_INLINE int32_t* validate_SFixed32Rules_resize_in(validate_SFixed32Rules *msg, size_t len, upb_arena *arena) {
- return (int32_t*)_upb_array_resize_accessor(msg, UPB_SIZE(24, 24), len, UPB_TYPE_INT32, arena);
+ return (int32_t*)_upb_array_resize_accessor(msg, UPB_SIZE(24, 24), len, UPB_TYPE_INT32, arena);
}
UPB_INLINE bool validate_SFixed32Rules_add_in(validate_SFixed32Rules *msg, int32_t val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(24, 24), UPB_SIZE(4, 4), UPB_TYPE_INT32, &val,
- arena);
+ return _upb_array_append_accessor(msg, UPB_SIZE(24, 24), UPB_SIZE(4, 4), UPB_TYPE_INT32, &val,
+ arena);
}
UPB_INLINE int32_t* validate_SFixed32Rules_mutable_not_in(validate_SFixed32Rules *msg, size_t *len) {
return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 32), len);
}
UPB_INLINE int32_t* validate_SFixed32Rules_resize_not_in(validate_SFixed32Rules *msg, size_t len, upb_arena *arena) {
- return (int32_t*)_upb_array_resize_accessor(msg, UPB_SIZE(28, 32), len, UPB_TYPE_INT32, arena);
+ return (int32_t*)_upb_array_resize_accessor(msg, UPB_SIZE(28, 32), len, UPB_TYPE_INT32, arena);
}
UPB_INLINE bool validate_SFixed32Rules_add_not_in(validate_SFixed32Rules *msg, int32_t val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(28, 32), UPB_SIZE(4, 4), UPB_TYPE_INT32, &val,
- arena);
+ return _upb_array_append_accessor(msg, UPB_SIZE(28, 32), UPB_SIZE(4, 4), UPB_TYPE_INT32, &val,
+ arena);
}
/* validate.SFixed64Rules */
UPB_INLINE validate_SFixed64Rules *validate_SFixed64Rules_new(upb_arena *arena) {
- return (validate_SFixed64Rules *)_upb_msg_new(&validate_SFixed64Rules_msginit, arena);
+ return (validate_SFixed64Rules *)_upb_msg_new(&validate_SFixed64Rules_msginit, arena);
}
UPB_INLINE validate_SFixed64Rules *validate_SFixed64Rules_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -1213,64 +1213,64 @@ UPB_INLINE char *validate_SFixed64Rules_serialize(const validate_SFixed64Rules *
return upb_encode(msg, &validate_SFixed64Rules_msginit, arena, len);
}
-UPB_INLINE bool validate_SFixed64Rules_has_const(const validate_SFixed64Rules *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE int64_t validate_SFixed64Rules_const(const validate_SFixed64Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int64_t); }
-UPB_INLINE bool validate_SFixed64Rules_has_lt(const validate_SFixed64Rules *msg) { return _upb_hasbit(msg, 2); }
-UPB_INLINE int64_t validate_SFixed64Rules_lt(const validate_SFixed64Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int64_t); }
-UPB_INLINE bool validate_SFixed64Rules_has_lte(const validate_SFixed64Rules *msg) { return _upb_hasbit(msg, 3); }
-UPB_INLINE int64_t validate_SFixed64Rules_lte(const validate_SFixed64Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), int64_t); }
-UPB_INLINE bool validate_SFixed64Rules_has_gt(const validate_SFixed64Rules *msg) { return _upb_hasbit(msg, 4); }
-UPB_INLINE int64_t validate_SFixed64Rules_gt(const validate_SFixed64Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 32), int64_t); }
-UPB_INLINE bool validate_SFixed64Rules_has_gte(const validate_SFixed64Rules *msg) { return _upb_hasbit(msg, 5); }
-UPB_INLINE int64_t validate_SFixed64Rules_gte(const validate_SFixed64Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(40, 40), int64_t); }
+UPB_INLINE bool validate_SFixed64Rules_has_const(const validate_SFixed64Rules *msg) { return _upb_hasbit(msg, 1); }
+UPB_INLINE int64_t validate_SFixed64Rules_const(const validate_SFixed64Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int64_t); }
+UPB_INLINE bool validate_SFixed64Rules_has_lt(const validate_SFixed64Rules *msg) { return _upb_hasbit(msg, 2); }
+UPB_INLINE int64_t validate_SFixed64Rules_lt(const validate_SFixed64Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int64_t); }
+UPB_INLINE bool validate_SFixed64Rules_has_lte(const validate_SFixed64Rules *msg) { return _upb_hasbit(msg, 3); }
+UPB_INLINE int64_t validate_SFixed64Rules_lte(const validate_SFixed64Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), int64_t); }
+UPB_INLINE bool validate_SFixed64Rules_has_gt(const validate_SFixed64Rules *msg) { return _upb_hasbit(msg, 4); }
+UPB_INLINE int64_t validate_SFixed64Rules_gt(const validate_SFixed64Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 32), int64_t); }
+UPB_INLINE bool validate_SFixed64Rules_has_gte(const validate_SFixed64Rules *msg) { return _upb_hasbit(msg, 5); }
+UPB_INLINE int64_t validate_SFixed64Rules_gte(const validate_SFixed64Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(40, 40), int64_t); }
UPB_INLINE int64_t const* validate_SFixed64Rules_in(const validate_SFixed64Rules *msg, size_t *len) { return (int64_t const*)_upb_array_accessor(msg, UPB_SIZE(48, 48), len); }
UPB_INLINE int64_t const* validate_SFixed64Rules_not_in(const validate_SFixed64Rules *msg, size_t *len) { return (int64_t const*)_upb_array_accessor(msg, UPB_SIZE(52, 56), len); }
UPB_INLINE void validate_SFixed64Rules_set_const(validate_SFixed64Rules *msg, int64_t value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int64_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int64_t) = value;
}
UPB_INLINE void validate_SFixed64Rules_set_lt(validate_SFixed64Rules *msg, int64_t value) {
_upb_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int64_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int64_t) = value;
}
UPB_INLINE void validate_SFixed64Rules_set_lte(validate_SFixed64Rules *msg, int64_t value) {
_upb_sethas(msg, 3);
- *UPB_PTR_AT(msg, UPB_SIZE(24, 24), int64_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 24), int64_t) = value;
}
UPB_INLINE void validate_SFixed64Rules_set_gt(validate_SFixed64Rules *msg, int64_t value) {
_upb_sethas(msg, 4);
- *UPB_PTR_AT(msg, UPB_SIZE(32, 32), int64_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 32), int64_t) = value;
}
UPB_INLINE void validate_SFixed64Rules_set_gte(validate_SFixed64Rules *msg, int64_t value) {
_upb_sethas(msg, 5);
- *UPB_PTR_AT(msg, UPB_SIZE(40, 40), int64_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 40), int64_t) = value;
}
UPB_INLINE int64_t* validate_SFixed64Rules_mutable_in(validate_SFixed64Rules *msg, size_t *len) {
return (int64_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(48, 48), len);
}
UPB_INLINE int64_t* validate_SFixed64Rules_resize_in(validate_SFixed64Rules *msg, size_t len, upb_arena *arena) {
- return (int64_t*)_upb_array_resize_accessor(msg, UPB_SIZE(48, 48), len, UPB_TYPE_INT64, arena);
+ return (int64_t*)_upb_array_resize_accessor(msg, UPB_SIZE(48, 48), len, UPB_TYPE_INT64, arena);
}
UPB_INLINE bool validate_SFixed64Rules_add_in(validate_SFixed64Rules *msg, int64_t val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(48, 48), UPB_SIZE(8, 8), UPB_TYPE_INT64, &val,
- arena);
+ return _upb_array_append_accessor(msg, UPB_SIZE(48, 48), UPB_SIZE(8, 8), UPB_TYPE_INT64, &val,
+ arena);
}
UPB_INLINE int64_t* validate_SFixed64Rules_mutable_not_in(validate_SFixed64Rules *msg, size_t *len) {
return (int64_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(52, 56), len);
}
UPB_INLINE int64_t* validate_SFixed64Rules_resize_not_in(validate_SFixed64Rules *msg, size_t len, upb_arena *arena) {
- return (int64_t*)_upb_array_resize_accessor(msg, UPB_SIZE(52, 56), len, UPB_TYPE_INT64, arena);
+ return (int64_t*)_upb_array_resize_accessor(msg, UPB_SIZE(52, 56), len, UPB_TYPE_INT64, arena);
}
UPB_INLINE bool validate_SFixed64Rules_add_not_in(validate_SFixed64Rules *msg, int64_t val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(52, 56), UPB_SIZE(8, 8), UPB_TYPE_INT64, &val,
- arena);
+ return _upb_array_append_accessor(msg, UPB_SIZE(52, 56), UPB_SIZE(8, 8), UPB_TYPE_INT64, &val,
+ arena);
}
/* validate.BoolRules */
UPB_INLINE validate_BoolRules *validate_BoolRules_new(upb_arena *arena) {
- return (validate_BoolRules *)_upb_msg_new(&validate_BoolRules_msginit, arena);
+ return (validate_BoolRules *)_upb_msg_new(&validate_BoolRules_msginit, arena);
}
UPB_INLINE validate_BoolRules *validate_BoolRules_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -1281,18 +1281,18 @@ UPB_INLINE char *validate_BoolRules_serialize(const validate_BoolRules *msg, upb
return upb_encode(msg, &validate_BoolRules_msginit, arena, len);
}
-UPB_INLINE bool validate_BoolRules_has_const(const validate_BoolRules *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE bool validate_BoolRules_const(const validate_BoolRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); }
+UPB_INLINE bool validate_BoolRules_has_const(const validate_BoolRules *msg) { return _upb_hasbit(msg, 1); }
+UPB_INLINE bool validate_BoolRules_const(const validate_BoolRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); }
UPB_INLINE void validate_BoolRules_set_const(validate_BoolRules *msg, bool value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
}
/* validate.StringRules */
UPB_INLINE validate_StringRules *validate_StringRules_new(upb_arena *arena) {
- return (validate_StringRules *)_upb_msg_new(&validate_StringRules_msginit, arena);
+ return (validate_StringRules *)_upb_msg_new(&validate_StringRules_msginit, arena);
}
UPB_INLINE validate_StringRules *validate_StringRules_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -1311,169 +1311,169 @@ typedef enum {
validate_StringRules_well_known_ipv6 = 16,
validate_StringRules_well_known_uri = 17,
validate_StringRules_well_known_uri_ref = 18,
- validate_StringRules_well_known_address = 21,
- validate_StringRules_well_known_uuid = 22,
- validate_StringRules_well_known_well_known_regex = 24,
+ validate_StringRules_well_known_address = 21,
+ validate_StringRules_well_known_uuid = 22,
+ validate_StringRules_well_known_well_known_regex = 24,
validate_StringRules_well_known_NOT_SET = 0
} validate_StringRules_well_known_oneofcases;
-UPB_INLINE validate_StringRules_well_known_oneofcases validate_StringRules_well_known_case(const validate_StringRules* msg) { return (validate_StringRules_well_known_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(128, 184), int32_t); }
-
-UPB_INLINE bool validate_StringRules_has_const(const validate_StringRules *msg) { return _upb_hasbit(msg, 8); }
-UPB_INLINE upb_strview validate_StringRules_const(const validate_StringRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(60, 64), upb_strview); }
-UPB_INLINE bool validate_StringRules_has_min_len(const validate_StringRules *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE uint64_t validate_StringRules_min_len(const validate_StringRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint64_t); }
-UPB_INLINE bool validate_StringRules_has_max_len(const validate_StringRules *msg) { return _upb_hasbit(msg, 2); }
-UPB_INLINE uint64_t validate_StringRules_max_len(const validate_StringRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), uint64_t); }
-UPB_INLINE bool validate_StringRules_has_min_bytes(const validate_StringRules *msg) { return _upb_hasbit(msg, 3); }
-UPB_INLINE uint64_t validate_StringRules_min_bytes(const validate_StringRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), uint64_t); }
-UPB_INLINE bool validate_StringRules_has_max_bytes(const validate_StringRules *msg) { return _upb_hasbit(msg, 4); }
-UPB_INLINE uint64_t validate_StringRules_max_bytes(const validate_StringRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 32), uint64_t); }
-UPB_INLINE bool validate_StringRules_has_pattern(const validate_StringRules *msg) { return _upb_hasbit(msg, 9); }
-UPB_INLINE upb_strview validate_StringRules_pattern(const validate_StringRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(68, 80), upb_strview); }
-UPB_INLINE bool validate_StringRules_has_prefix(const validate_StringRules *msg) { return _upb_hasbit(msg, 10); }
-UPB_INLINE upb_strview validate_StringRules_prefix(const validate_StringRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(76, 96), upb_strview); }
-UPB_INLINE bool validate_StringRules_has_suffix(const validate_StringRules *msg) { return _upb_hasbit(msg, 11); }
-UPB_INLINE upb_strview validate_StringRules_suffix(const validate_StringRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(84, 112), upb_strview); }
-UPB_INLINE bool validate_StringRules_has_contains(const validate_StringRules *msg) { return _upb_hasbit(msg, 12); }
-UPB_INLINE upb_strview validate_StringRules_contains(const validate_StringRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(92, 128), upb_strview); }
-UPB_INLINE upb_strview const* validate_StringRules_in(const validate_StringRules *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(108, 160), len); }
-UPB_INLINE upb_strview const* validate_StringRules_not_in(const validate_StringRules *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(112, 168), len); }
-UPB_INLINE bool validate_StringRules_has_email(const validate_StringRules *msg) { return _upb_getoneofcase(msg, UPB_SIZE(128, 184)) == 12; }
-UPB_INLINE bool validate_StringRules_email(const validate_StringRules *msg) { return UPB_READ_ONEOF(msg, bool, UPB_SIZE(120, 176), UPB_SIZE(128, 184), 12, false); }
-UPB_INLINE bool validate_StringRules_has_hostname(const validate_StringRules *msg) { return _upb_getoneofcase(msg, UPB_SIZE(128, 184)) == 13; }
-UPB_INLINE bool validate_StringRules_hostname(const validate_StringRules *msg) { return UPB_READ_ONEOF(msg, bool, UPB_SIZE(120, 176), UPB_SIZE(128, 184), 13, false); }
-UPB_INLINE bool validate_StringRules_has_ip(const validate_StringRules *msg) { return _upb_getoneofcase(msg, UPB_SIZE(128, 184)) == 14; }
-UPB_INLINE bool validate_StringRules_ip(const validate_StringRules *msg) { return UPB_READ_ONEOF(msg, bool, UPB_SIZE(120, 176), UPB_SIZE(128, 184), 14, false); }
-UPB_INLINE bool validate_StringRules_has_ipv4(const validate_StringRules *msg) { return _upb_getoneofcase(msg, UPB_SIZE(128, 184)) == 15; }
-UPB_INLINE bool validate_StringRules_ipv4(const validate_StringRules *msg) { return UPB_READ_ONEOF(msg, bool, UPB_SIZE(120, 176), UPB_SIZE(128, 184), 15, false); }
-UPB_INLINE bool validate_StringRules_has_ipv6(const validate_StringRules *msg) { return _upb_getoneofcase(msg, UPB_SIZE(128, 184)) == 16; }
-UPB_INLINE bool validate_StringRules_ipv6(const validate_StringRules *msg) { return UPB_READ_ONEOF(msg, bool, UPB_SIZE(120, 176), UPB_SIZE(128, 184), 16, false); }
-UPB_INLINE bool validate_StringRules_has_uri(const validate_StringRules *msg) { return _upb_getoneofcase(msg, UPB_SIZE(128, 184)) == 17; }
-UPB_INLINE bool validate_StringRules_uri(const validate_StringRules *msg) { return UPB_READ_ONEOF(msg, bool, UPB_SIZE(120, 176), UPB_SIZE(128, 184), 17, false); }
-UPB_INLINE bool validate_StringRules_has_uri_ref(const validate_StringRules *msg) { return _upb_getoneofcase(msg, UPB_SIZE(128, 184)) == 18; }
-UPB_INLINE bool validate_StringRules_uri_ref(const validate_StringRules *msg) { return UPB_READ_ONEOF(msg, bool, UPB_SIZE(120, 176), UPB_SIZE(128, 184), 18, false); }
-UPB_INLINE bool validate_StringRules_has_len(const validate_StringRules *msg) { return _upb_hasbit(msg, 5); }
-UPB_INLINE uint64_t validate_StringRules_len(const validate_StringRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(40, 40), uint64_t); }
-UPB_INLINE bool validate_StringRules_has_len_bytes(const validate_StringRules *msg) { return _upb_hasbit(msg, 6); }
-UPB_INLINE uint64_t validate_StringRules_len_bytes(const validate_StringRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(48, 48), uint64_t); }
-UPB_INLINE bool validate_StringRules_has_address(const validate_StringRules *msg) { return _upb_getoneofcase(msg, UPB_SIZE(128, 184)) == 21; }
-UPB_INLINE bool validate_StringRules_address(const validate_StringRules *msg) { return UPB_READ_ONEOF(msg, bool, UPB_SIZE(120, 176), UPB_SIZE(128, 184), 21, false); }
-UPB_INLINE bool validate_StringRules_has_uuid(const validate_StringRules *msg) { return _upb_getoneofcase(msg, UPB_SIZE(128, 184)) == 22; }
-UPB_INLINE bool validate_StringRules_uuid(const validate_StringRules *msg) { return UPB_READ_ONEOF(msg, bool, UPB_SIZE(120, 176), UPB_SIZE(128, 184), 22, false); }
-UPB_INLINE bool validate_StringRules_has_not_contains(const validate_StringRules *msg) { return _upb_hasbit(msg, 13); }
-UPB_INLINE upb_strview validate_StringRules_not_contains(const validate_StringRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(100, 144), upb_strview); }
-UPB_INLINE bool validate_StringRules_has_well_known_regex(const validate_StringRules *msg) { return _upb_getoneofcase(msg, UPB_SIZE(128, 184)) == 24; }
-UPB_INLINE int32_t validate_StringRules_well_known_regex(const validate_StringRules *msg) { return UPB_READ_ONEOF(msg, int32_t, UPB_SIZE(120, 176), UPB_SIZE(128, 184), 24, 0); }
-UPB_INLINE bool validate_StringRules_has_strict(const validate_StringRules *msg) { return _upb_hasbit(msg, 7); }
-UPB_INLINE bool validate_StringRules_strict(const validate_StringRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(56, 56), bool); }
+UPB_INLINE validate_StringRules_well_known_oneofcases validate_StringRules_well_known_case(const validate_StringRules* msg) { return (validate_StringRules_well_known_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(128, 184), int32_t); }
+
+UPB_INLINE bool validate_StringRules_has_const(const validate_StringRules *msg) { return _upb_hasbit(msg, 8); }
+UPB_INLINE upb_strview validate_StringRules_const(const validate_StringRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(60, 64), upb_strview); }
+UPB_INLINE bool validate_StringRules_has_min_len(const validate_StringRules *msg) { return _upb_hasbit(msg, 1); }
+UPB_INLINE uint64_t validate_StringRules_min_len(const validate_StringRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint64_t); }
+UPB_INLINE bool validate_StringRules_has_max_len(const validate_StringRules *msg) { return _upb_hasbit(msg, 2); }
+UPB_INLINE uint64_t validate_StringRules_max_len(const validate_StringRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), uint64_t); }
+UPB_INLINE bool validate_StringRules_has_min_bytes(const validate_StringRules *msg) { return _upb_hasbit(msg, 3); }
+UPB_INLINE uint64_t validate_StringRules_min_bytes(const validate_StringRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), uint64_t); }
+UPB_INLINE bool validate_StringRules_has_max_bytes(const validate_StringRules *msg) { return _upb_hasbit(msg, 4); }
+UPB_INLINE uint64_t validate_StringRules_max_bytes(const validate_StringRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 32), uint64_t); }
+UPB_INLINE bool validate_StringRules_has_pattern(const validate_StringRules *msg) { return _upb_hasbit(msg, 9); }
+UPB_INLINE upb_strview validate_StringRules_pattern(const validate_StringRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(68, 80), upb_strview); }
+UPB_INLINE bool validate_StringRules_has_prefix(const validate_StringRules *msg) { return _upb_hasbit(msg, 10); }
+UPB_INLINE upb_strview validate_StringRules_prefix(const validate_StringRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(76, 96), upb_strview); }
+UPB_INLINE bool validate_StringRules_has_suffix(const validate_StringRules *msg) { return _upb_hasbit(msg, 11); }
+UPB_INLINE upb_strview validate_StringRules_suffix(const validate_StringRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(84, 112), upb_strview); }
+UPB_INLINE bool validate_StringRules_has_contains(const validate_StringRules *msg) { return _upb_hasbit(msg, 12); }
+UPB_INLINE upb_strview validate_StringRules_contains(const validate_StringRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(92, 128), upb_strview); }
+UPB_INLINE upb_strview const* validate_StringRules_in(const validate_StringRules *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(108, 160), len); }
+UPB_INLINE upb_strview const* validate_StringRules_not_in(const validate_StringRules *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(112, 168), len); }
+UPB_INLINE bool validate_StringRules_has_email(const validate_StringRules *msg) { return _upb_getoneofcase(msg, UPB_SIZE(128, 184)) == 12; }
+UPB_INLINE bool validate_StringRules_email(const validate_StringRules *msg) { return UPB_READ_ONEOF(msg, bool, UPB_SIZE(120, 176), UPB_SIZE(128, 184), 12, false); }
+UPB_INLINE bool validate_StringRules_has_hostname(const validate_StringRules *msg) { return _upb_getoneofcase(msg, UPB_SIZE(128, 184)) == 13; }
+UPB_INLINE bool validate_StringRules_hostname(const validate_StringRules *msg) { return UPB_READ_ONEOF(msg, bool, UPB_SIZE(120, 176), UPB_SIZE(128, 184), 13, false); }
+UPB_INLINE bool validate_StringRules_has_ip(const validate_StringRules *msg) { return _upb_getoneofcase(msg, UPB_SIZE(128, 184)) == 14; }
+UPB_INLINE bool validate_StringRules_ip(const validate_StringRules *msg) { return UPB_READ_ONEOF(msg, bool, UPB_SIZE(120, 176), UPB_SIZE(128, 184), 14, false); }
+UPB_INLINE bool validate_StringRules_has_ipv4(const validate_StringRules *msg) { return _upb_getoneofcase(msg, UPB_SIZE(128, 184)) == 15; }
+UPB_INLINE bool validate_StringRules_ipv4(const validate_StringRules *msg) { return UPB_READ_ONEOF(msg, bool, UPB_SIZE(120, 176), UPB_SIZE(128, 184), 15, false); }
+UPB_INLINE bool validate_StringRules_has_ipv6(const validate_StringRules *msg) { return _upb_getoneofcase(msg, UPB_SIZE(128, 184)) == 16; }
+UPB_INLINE bool validate_StringRules_ipv6(const validate_StringRules *msg) { return UPB_READ_ONEOF(msg, bool, UPB_SIZE(120, 176), UPB_SIZE(128, 184), 16, false); }
+UPB_INLINE bool validate_StringRules_has_uri(const validate_StringRules *msg) { return _upb_getoneofcase(msg, UPB_SIZE(128, 184)) == 17; }
+UPB_INLINE bool validate_StringRules_uri(const validate_StringRules *msg) { return UPB_READ_ONEOF(msg, bool, UPB_SIZE(120, 176), UPB_SIZE(128, 184), 17, false); }
+UPB_INLINE bool validate_StringRules_has_uri_ref(const validate_StringRules *msg) { return _upb_getoneofcase(msg, UPB_SIZE(128, 184)) == 18; }
+UPB_INLINE bool validate_StringRules_uri_ref(const validate_StringRules *msg) { return UPB_READ_ONEOF(msg, bool, UPB_SIZE(120, 176), UPB_SIZE(128, 184), 18, false); }
+UPB_INLINE bool validate_StringRules_has_len(const validate_StringRules *msg) { return _upb_hasbit(msg, 5); }
+UPB_INLINE uint64_t validate_StringRules_len(const validate_StringRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(40, 40), uint64_t); }
+UPB_INLINE bool validate_StringRules_has_len_bytes(const validate_StringRules *msg) { return _upb_hasbit(msg, 6); }
+UPB_INLINE uint64_t validate_StringRules_len_bytes(const validate_StringRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(48, 48), uint64_t); }
+UPB_INLINE bool validate_StringRules_has_address(const validate_StringRules *msg) { return _upb_getoneofcase(msg, UPB_SIZE(128, 184)) == 21; }
+UPB_INLINE bool validate_StringRules_address(const validate_StringRules *msg) { return UPB_READ_ONEOF(msg, bool, UPB_SIZE(120, 176), UPB_SIZE(128, 184), 21, false); }
+UPB_INLINE bool validate_StringRules_has_uuid(const validate_StringRules *msg) { return _upb_getoneofcase(msg, UPB_SIZE(128, 184)) == 22; }
+UPB_INLINE bool validate_StringRules_uuid(const validate_StringRules *msg) { return UPB_READ_ONEOF(msg, bool, UPB_SIZE(120, 176), UPB_SIZE(128, 184), 22, false); }
+UPB_INLINE bool validate_StringRules_has_not_contains(const validate_StringRules *msg) { return _upb_hasbit(msg, 13); }
+UPB_INLINE upb_strview validate_StringRules_not_contains(const validate_StringRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(100, 144), upb_strview); }
+UPB_INLINE bool validate_StringRules_has_well_known_regex(const validate_StringRules *msg) { return _upb_getoneofcase(msg, UPB_SIZE(128, 184)) == 24; }
+UPB_INLINE int32_t validate_StringRules_well_known_regex(const validate_StringRules *msg) { return UPB_READ_ONEOF(msg, int32_t, UPB_SIZE(120, 176), UPB_SIZE(128, 184), 24, 0); }
+UPB_INLINE bool validate_StringRules_has_strict(const validate_StringRules *msg) { return _upb_hasbit(msg, 7); }
+UPB_INLINE bool validate_StringRules_strict(const validate_StringRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(56, 56), bool); }
UPB_INLINE void validate_StringRules_set_const(validate_StringRules *msg, upb_strview value) {
- _upb_sethas(msg, 8);
- *UPB_PTR_AT(msg, UPB_SIZE(60, 64), upb_strview) = value;
+ _upb_sethas(msg, 8);
+ *UPB_PTR_AT(msg, UPB_SIZE(60, 64), upb_strview) = value;
}
UPB_INLINE void validate_StringRules_set_min_len(validate_StringRules *msg, uint64_t value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint64_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint64_t) = value;
}
UPB_INLINE void validate_StringRules_set_max_len(validate_StringRules *msg, uint64_t value) {
_upb_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(16, 16), uint64_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 16), uint64_t) = value;
}
UPB_INLINE void validate_StringRules_set_min_bytes(validate_StringRules *msg, uint64_t value) {
_upb_sethas(msg, 3);
- *UPB_PTR_AT(msg, UPB_SIZE(24, 24), uint64_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 24), uint64_t) = value;
}
UPB_INLINE void validate_StringRules_set_max_bytes(validate_StringRules *msg, uint64_t value) {
_upb_sethas(msg, 4);
- *UPB_PTR_AT(msg, UPB_SIZE(32, 32), uint64_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 32), uint64_t) = value;
}
UPB_INLINE void validate_StringRules_set_pattern(validate_StringRules *msg, upb_strview value) {
- _upb_sethas(msg, 9);
- *UPB_PTR_AT(msg, UPB_SIZE(68, 80), upb_strview) = value;
+ _upb_sethas(msg, 9);
+ *UPB_PTR_AT(msg, UPB_SIZE(68, 80), upb_strview) = value;
}
UPB_INLINE void validate_StringRules_set_prefix(validate_StringRules *msg, upb_strview value) {
- _upb_sethas(msg, 10);
- *UPB_PTR_AT(msg, UPB_SIZE(76, 96), upb_strview) = value;
+ _upb_sethas(msg, 10);
+ *UPB_PTR_AT(msg, UPB_SIZE(76, 96), upb_strview) = value;
}
UPB_INLINE void validate_StringRules_set_suffix(validate_StringRules *msg, upb_strview value) {
- _upb_sethas(msg, 11);
- *UPB_PTR_AT(msg, UPB_SIZE(84, 112), upb_strview) = value;
+ _upb_sethas(msg, 11);
+ *UPB_PTR_AT(msg, UPB_SIZE(84, 112), upb_strview) = value;
}
UPB_INLINE void validate_StringRules_set_contains(validate_StringRules *msg, upb_strview value) {
- _upb_sethas(msg, 12);
- *UPB_PTR_AT(msg, UPB_SIZE(92, 128), upb_strview) = value;
+ _upb_sethas(msg, 12);
+ *UPB_PTR_AT(msg, UPB_SIZE(92, 128), upb_strview) = value;
}
UPB_INLINE upb_strview* validate_StringRules_mutable_in(validate_StringRules *msg, size_t *len) {
- return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(108, 160), len);
+ return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(108, 160), len);
}
UPB_INLINE upb_strview* validate_StringRules_resize_in(validate_StringRules *msg, size_t len, upb_arena *arena) {
- return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(108, 160), len, UPB_TYPE_STRING, arena);
+ return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(108, 160), len, UPB_TYPE_STRING, arena);
}
UPB_INLINE bool validate_StringRules_add_in(validate_StringRules *msg, upb_strview val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(108, 160), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
- arena);
+ return _upb_array_append_accessor(msg, UPB_SIZE(108, 160), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
+ arena);
}
UPB_INLINE upb_strview* validate_StringRules_mutable_not_in(validate_StringRules *msg, size_t *len) {
- return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(112, 168), len);
+ return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(112, 168), len);
}
UPB_INLINE upb_strview* validate_StringRules_resize_not_in(validate_StringRules *msg, size_t len, upb_arena *arena) {
- return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(112, 168), len, UPB_TYPE_STRING, arena);
+ return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(112, 168), len, UPB_TYPE_STRING, arena);
}
UPB_INLINE bool validate_StringRules_add_not_in(validate_StringRules *msg, upb_strview val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(112, 168), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
- arena);
+ return _upb_array_append_accessor(msg, UPB_SIZE(112, 168), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
+ arena);
}
UPB_INLINE void validate_StringRules_set_email(validate_StringRules *msg, bool value) {
- UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(120, 176), value, UPB_SIZE(128, 184), 12);
+ UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(120, 176), value, UPB_SIZE(128, 184), 12);
}
UPB_INLINE void validate_StringRules_set_hostname(validate_StringRules *msg, bool value) {
- UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(120, 176), value, UPB_SIZE(128, 184), 13);
+ UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(120, 176), value, UPB_SIZE(128, 184), 13);
}
UPB_INLINE void validate_StringRules_set_ip(validate_StringRules *msg, bool value) {
- UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(120, 176), value, UPB_SIZE(128, 184), 14);
+ UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(120, 176), value, UPB_SIZE(128, 184), 14);
}
UPB_INLINE void validate_StringRules_set_ipv4(validate_StringRules *msg, bool value) {
- UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(120, 176), value, UPB_SIZE(128, 184), 15);
+ UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(120, 176), value, UPB_SIZE(128, 184), 15);
}
UPB_INLINE void validate_StringRules_set_ipv6(validate_StringRules *msg, bool value) {
- UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(120, 176), value, UPB_SIZE(128, 184), 16);
+ UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(120, 176), value, UPB_SIZE(128, 184), 16);
}
UPB_INLINE void validate_StringRules_set_uri(validate_StringRules *msg, bool value) {
- UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(120, 176), value, UPB_SIZE(128, 184), 17);
+ UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(120, 176), value, UPB_SIZE(128, 184), 17);
}
UPB_INLINE void validate_StringRules_set_uri_ref(validate_StringRules *msg, bool value) {
- UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(120, 176), value, UPB_SIZE(128, 184), 18);
+ UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(120, 176), value, UPB_SIZE(128, 184), 18);
}
UPB_INLINE void validate_StringRules_set_len(validate_StringRules *msg, uint64_t value) {
_upb_sethas(msg, 5);
- *UPB_PTR_AT(msg, UPB_SIZE(40, 40), uint64_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 40), uint64_t) = value;
}
UPB_INLINE void validate_StringRules_set_len_bytes(validate_StringRules *msg, uint64_t value) {
_upb_sethas(msg, 6);
- *UPB_PTR_AT(msg, UPB_SIZE(48, 48), uint64_t) = value;
-}
-UPB_INLINE void validate_StringRules_set_address(validate_StringRules *msg, bool value) {
- UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(120, 176), value, UPB_SIZE(128, 184), 21);
-}
-UPB_INLINE void validate_StringRules_set_uuid(validate_StringRules *msg, bool value) {
- UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(120, 176), value, UPB_SIZE(128, 184), 22);
-}
-UPB_INLINE void validate_StringRules_set_not_contains(validate_StringRules *msg, upb_strview value) {
- _upb_sethas(msg, 13);
- *UPB_PTR_AT(msg, UPB_SIZE(100, 144), upb_strview) = value;
-}
-UPB_INLINE void validate_StringRules_set_well_known_regex(validate_StringRules *msg, int32_t value) {
- UPB_WRITE_ONEOF(msg, int32_t, UPB_SIZE(120, 176), value, UPB_SIZE(128, 184), 24);
-}
-UPB_INLINE void validate_StringRules_set_strict(validate_StringRules *msg, bool value) {
- _upb_sethas(msg, 7);
- *UPB_PTR_AT(msg, UPB_SIZE(56, 56), bool) = value;
-}
+ *UPB_PTR_AT(msg, UPB_SIZE(48, 48), uint64_t) = value;
+}
+UPB_INLINE void validate_StringRules_set_address(validate_StringRules *msg, bool value) {
+ UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(120, 176), value, UPB_SIZE(128, 184), 21);
+}
+UPB_INLINE void validate_StringRules_set_uuid(validate_StringRules *msg, bool value) {
+ UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(120, 176), value, UPB_SIZE(128, 184), 22);
+}
+UPB_INLINE void validate_StringRules_set_not_contains(validate_StringRules *msg, upb_strview value) {
+ _upb_sethas(msg, 13);
+ *UPB_PTR_AT(msg, UPB_SIZE(100, 144), upb_strview) = value;
+}
+UPB_INLINE void validate_StringRules_set_well_known_regex(validate_StringRules *msg, int32_t value) {
+ UPB_WRITE_ONEOF(msg, int32_t, UPB_SIZE(120, 176), value, UPB_SIZE(128, 184), 24);
+}
+UPB_INLINE void validate_StringRules_set_strict(validate_StringRules *msg, bool value) {
+ _upb_sethas(msg, 7);
+ *UPB_PTR_AT(msg, UPB_SIZE(56, 56), bool) = value;
+}
/* validate.BytesRules */
UPB_INLINE validate_BytesRules *validate_BytesRules_new(upb_arena *arena) {
- return (validate_BytesRules *)_upb_msg_new(&validate_BytesRules_msginit, arena);
+ return (validate_BytesRules *)_upb_msg_new(&validate_BytesRules_msginit, arena);
}
UPB_INLINE validate_BytesRules *validate_BytesRules_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -1490,80 +1490,80 @@ typedef enum {
validate_BytesRules_well_known_ipv6 = 12,
validate_BytesRules_well_known_NOT_SET = 0
} validate_BytesRules_well_known_oneofcases;
-UPB_INLINE validate_BytesRules_well_known_oneofcases validate_BytesRules_well_known_case(const validate_BytesRules* msg) { return (validate_BytesRules_well_known_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(84, 132), int32_t); }
-
-UPB_INLINE bool validate_BytesRules_has_const(const validate_BytesRules *msg) { return _upb_hasbit(msg, 4); }
-UPB_INLINE upb_strview validate_BytesRules_const(const validate_BytesRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 32), upb_strview); }
-UPB_INLINE bool validate_BytesRules_has_min_len(const validate_BytesRules *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE uint64_t validate_BytesRules_min_len(const validate_BytesRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint64_t); }
-UPB_INLINE bool validate_BytesRules_has_max_len(const validate_BytesRules *msg) { return _upb_hasbit(msg, 2); }
-UPB_INLINE uint64_t validate_BytesRules_max_len(const validate_BytesRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), uint64_t); }
-UPB_INLINE bool validate_BytesRules_has_pattern(const validate_BytesRules *msg) { return _upb_hasbit(msg, 5); }
-UPB_INLINE upb_strview validate_BytesRules_pattern(const validate_BytesRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(40, 48), upb_strview); }
-UPB_INLINE bool validate_BytesRules_has_prefix(const validate_BytesRules *msg) { return _upb_hasbit(msg, 6); }
-UPB_INLINE upb_strview validate_BytesRules_prefix(const validate_BytesRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(48, 64), upb_strview); }
-UPB_INLINE bool validate_BytesRules_has_suffix(const validate_BytesRules *msg) { return _upb_hasbit(msg, 7); }
-UPB_INLINE upb_strview validate_BytesRules_suffix(const validate_BytesRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(56, 80), upb_strview); }
-UPB_INLINE bool validate_BytesRules_has_contains(const validate_BytesRules *msg) { return _upb_hasbit(msg, 8); }
-UPB_INLINE upb_strview validate_BytesRules_contains(const validate_BytesRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(64, 96), upb_strview); }
+UPB_INLINE validate_BytesRules_well_known_oneofcases validate_BytesRules_well_known_case(const validate_BytesRules* msg) { return (validate_BytesRules_well_known_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(84, 132), int32_t); }
+
+UPB_INLINE bool validate_BytesRules_has_const(const validate_BytesRules *msg) { return _upb_hasbit(msg, 4); }
+UPB_INLINE upb_strview validate_BytesRules_const(const validate_BytesRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 32), upb_strview); }
+UPB_INLINE bool validate_BytesRules_has_min_len(const validate_BytesRules *msg) { return _upb_hasbit(msg, 1); }
+UPB_INLINE uint64_t validate_BytesRules_min_len(const validate_BytesRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint64_t); }
+UPB_INLINE bool validate_BytesRules_has_max_len(const validate_BytesRules *msg) { return _upb_hasbit(msg, 2); }
+UPB_INLINE uint64_t validate_BytesRules_max_len(const validate_BytesRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), uint64_t); }
+UPB_INLINE bool validate_BytesRules_has_pattern(const validate_BytesRules *msg) { return _upb_hasbit(msg, 5); }
+UPB_INLINE upb_strview validate_BytesRules_pattern(const validate_BytesRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(40, 48), upb_strview); }
+UPB_INLINE bool validate_BytesRules_has_prefix(const validate_BytesRules *msg) { return _upb_hasbit(msg, 6); }
+UPB_INLINE upb_strview validate_BytesRules_prefix(const validate_BytesRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(48, 64), upb_strview); }
+UPB_INLINE bool validate_BytesRules_has_suffix(const validate_BytesRules *msg) { return _upb_hasbit(msg, 7); }
+UPB_INLINE upb_strview validate_BytesRules_suffix(const validate_BytesRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(56, 80), upb_strview); }
+UPB_INLINE bool validate_BytesRules_has_contains(const validate_BytesRules *msg) { return _upb_hasbit(msg, 8); }
+UPB_INLINE upb_strview validate_BytesRules_contains(const validate_BytesRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(64, 96), upb_strview); }
UPB_INLINE upb_strview const* validate_BytesRules_in(const validate_BytesRules *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(72, 112), len); }
UPB_INLINE upb_strview const* validate_BytesRules_not_in(const validate_BytesRules *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(76, 120), len); }
-UPB_INLINE bool validate_BytesRules_has_ip(const validate_BytesRules *msg) { return _upb_getoneofcase(msg, UPB_SIZE(84, 132)) == 10; }
+UPB_INLINE bool validate_BytesRules_has_ip(const validate_BytesRules *msg) { return _upb_getoneofcase(msg, UPB_SIZE(84, 132)) == 10; }
UPB_INLINE bool validate_BytesRules_ip(const validate_BytesRules *msg) { return UPB_READ_ONEOF(msg, bool, UPB_SIZE(80, 128), UPB_SIZE(84, 132), 10, false); }
-UPB_INLINE bool validate_BytesRules_has_ipv4(const validate_BytesRules *msg) { return _upb_getoneofcase(msg, UPB_SIZE(84, 132)) == 11; }
+UPB_INLINE bool validate_BytesRules_has_ipv4(const validate_BytesRules *msg) { return _upb_getoneofcase(msg, UPB_SIZE(84, 132)) == 11; }
UPB_INLINE bool validate_BytesRules_ipv4(const validate_BytesRules *msg) { return UPB_READ_ONEOF(msg, bool, UPB_SIZE(80, 128), UPB_SIZE(84, 132), 11, false); }
-UPB_INLINE bool validate_BytesRules_has_ipv6(const validate_BytesRules *msg) { return _upb_getoneofcase(msg, UPB_SIZE(84, 132)) == 12; }
+UPB_INLINE bool validate_BytesRules_has_ipv6(const validate_BytesRules *msg) { return _upb_getoneofcase(msg, UPB_SIZE(84, 132)) == 12; }
UPB_INLINE bool validate_BytesRules_ipv6(const validate_BytesRules *msg) { return UPB_READ_ONEOF(msg, bool, UPB_SIZE(80, 128), UPB_SIZE(84, 132), 12, false); }
-UPB_INLINE bool validate_BytesRules_has_len(const validate_BytesRules *msg) { return _upb_hasbit(msg, 3); }
-UPB_INLINE uint64_t validate_BytesRules_len(const validate_BytesRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), uint64_t); }
+UPB_INLINE bool validate_BytesRules_has_len(const validate_BytesRules *msg) { return _upb_hasbit(msg, 3); }
+UPB_INLINE uint64_t validate_BytesRules_len(const validate_BytesRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), uint64_t); }
UPB_INLINE void validate_BytesRules_set_const(validate_BytesRules *msg, upb_strview value) {
_upb_sethas(msg, 4);
- *UPB_PTR_AT(msg, UPB_SIZE(32, 32), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 32), upb_strview) = value;
}
UPB_INLINE void validate_BytesRules_set_min_len(validate_BytesRules *msg, uint64_t value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint64_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint64_t) = value;
}
UPB_INLINE void validate_BytesRules_set_max_len(validate_BytesRules *msg, uint64_t value) {
_upb_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(16, 16), uint64_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 16), uint64_t) = value;
}
UPB_INLINE void validate_BytesRules_set_pattern(validate_BytesRules *msg, upb_strview value) {
_upb_sethas(msg, 5);
- *UPB_PTR_AT(msg, UPB_SIZE(40, 48), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 48), upb_strview) = value;
}
UPB_INLINE void validate_BytesRules_set_prefix(validate_BytesRules *msg, upb_strview value) {
_upb_sethas(msg, 6);
- *UPB_PTR_AT(msg, UPB_SIZE(48, 64), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(48, 64), upb_strview) = value;
}
UPB_INLINE void validate_BytesRules_set_suffix(validate_BytesRules *msg, upb_strview value) {
_upb_sethas(msg, 7);
- *UPB_PTR_AT(msg, UPB_SIZE(56, 80), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(56, 80), upb_strview) = value;
}
UPB_INLINE void validate_BytesRules_set_contains(validate_BytesRules *msg, upb_strview value) {
_upb_sethas(msg, 8);
- *UPB_PTR_AT(msg, UPB_SIZE(64, 96), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(64, 96), upb_strview) = value;
}
UPB_INLINE upb_strview* validate_BytesRules_mutable_in(validate_BytesRules *msg, size_t *len) {
return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(72, 112), len);
}
UPB_INLINE upb_strview* validate_BytesRules_resize_in(validate_BytesRules *msg, size_t len, upb_arena *arena) {
- return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(72, 112), len, UPB_TYPE_STRING, arena);
+ return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(72, 112), len, UPB_TYPE_STRING, arena);
}
UPB_INLINE bool validate_BytesRules_add_in(validate_BytesRules *msg, upb_strview val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(72, 112), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
- arena);
+ return _upb_array_append_accessor(msg, UPB_SIZE(72, 112), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
+ arena);
}
UPB_INLINE upb_strview* validate_BytesRules_mutable_not_in(validate_BytesRules *msg, size_t *len) {
return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(76, 120), len);
}
UPB_INLINE upb_strview* validate_BytesRules_resize_not_in(validate_BytesRules *msg, size_t len, upb_arena *arena) {
- return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(76, 120), len, UPB_TYPE_STRING, arena);
+ return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(76, 120), len, UPB_TYPE_STRING, arena);
}
UPB_INLINE bool validate_BytesRules_add_not_in(validate_BytesRules *msg, upb_strview val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(76, 120), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
- arena);
+ return _upb_array_append_accessor(msg, UPB_SIZE(76, 120), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
+ arena);
}
UPB_INLINE void validate_BytesRules_set_ip(validate_BytesRules *msg, bool value) {
UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(80, 128), value, UPB_SIZE(84, 132), 10);
@@ -1576,13 +1576,13 @@ UPB_INLINE void validate_BytesRules_set_ipv6(validate_BytesRules *msg, bool valu
}
UPB_INLINE void validate_BytesRules_set_len(validate_BytesRules *msg, uint64_t value) {
_upb_sethas(msg, 3);
- *UPB_PTR_AT(msg, UPB_SIZE(24, 24), uint64_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 24), uint64_t) = value;
}
/* validate.EnumRules */
UPB_INLINE validate_EnumRules *validate_EnumRules_new(upb_arena *arena) {
- return (validate_EnumRules *)_upb_msg_new(&validate_EnumRules_msginit, arena);
+ return (validate_EnumRules *)_upb_msg_new(&validate_EnumRules_msginit, arena);
}
UPB_INLINE validate_EnumRules *validate_EnumRules_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -1593,46 +1593,46 @@ UPB_INLINE char *validate_EnumRules_serialize(const validate_EnumRules *msg, upb
return upb_encode(msg, &validate_EnumRules_msginit, arena, len);
}
-UPB_INLINE bool validate_EnumRules_has_const(const validate_EnumRules *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE int32_t validate_EnumRules_const(const validate_EnumRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); }
-UPB_INLINE bool validate_EnumRules_has_defined_only(const validate_EnumRules *msg) { return _upb_hasbit(msg, 2); }
-UPB_INLINE bool validate_EnumRules_defined_only(const validate_EnumRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool); }
+UPB_INLINE bool validate_EnumRules_has_const(const validate_EnumRules *msg) { return _upb_hasbit(msg, 1); }
+UPB_INLINE int32_t validate_EnumRules_const(const validate_EnumRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); }
+UPB_INLINE bool validate_EnumRules_has_defined_only(const validate_EnumRules *msg) { return _upb_hasbit(msg, 2); }
+UPB_INLINE bool validate_EnumRules_defined_only(const validate_EnumRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool); }
UPB_INLINE int32_t const* validate_EnumRules_in(const validate_EnumRules *msg, size_t *len) { return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(12, 16), len); }
UPB_INLINE int32_t const* validate_EnumRules_not_in(const validate_EnumRules *msg, size_t *len) { return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(16, 24), len); }
UPB_INLINE void validate_EnumRules_set_const(validate_EnumRules *msg, int32_t value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value;
}
UPB_INLINE void validate_EnumRules_set_defined_only(validate_EnumRules *msg, bool value) {
_upb_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = value;
}
UPB_INLINE int32_t* validate_EnumRules_mutable_in(validate_EnumRules *msg, size_t *len) {
return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 16), len);
}
UPB_INLINE int32_t* validate_EnumRules_resize_in(validate_EnumRules *msg, size_t len, upb_arena *arena) {
- return (int32_t*)_upb_array_resize_accessor(msg, UPB_SIZE(12, 16), len, UPB_TYPE_INT32, arena);
+ return (int32_t*)_upb_array_resize_accessor(msg, UPB_SIZE(12, 16), len, UPB_TYPE_INT32, arena);
}
UPB_INLINE bool validate_EnumRules_add_in(validate_EnumRules *msg, int32_t val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(12, 16), UPB_SIZE(4, 4), UPB_TYPE_INT32, &val,
- arena);
+ return _upb_array_append_accessor(msg, UPB_SIZE(12, 16), UPB_SIZE(4, 4), UPB_TYPE_INT32, &val,
+ arena);
}
UPB_INLINE int32_t* validate_EnumRules_mutable_not_in(validate_EnumRules *msg, size_t *len) {
return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 24), len);
}
UPB_INLINE int32_t* validate_EnumRules_resize_not_in(validate_EnumRules *msg, size_t len, upb_arena *arena) {
- return (int32_t*)_upb_array_resize_accessor(msg, UPB_SIZE(16, 24), len, UPB_TYPE_INT32, arena);
+ return (int32_t*)_upb_array_resize_accessor(msg, UPB_SIZE(16, 24), len, UPB_TYPE_INT32, arena);
}
UPB_INLINE bool validate_EnumRules_add_not_in(validate_EnumRules *msg, int32_t val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(16, 24), UPB_SIZE(4, 4), UPB_TYPE_INT32, &val,
- arena);
+ return _upb_array_append_accessor(msg, UPB_SIZE(16, 24), UPB_SIZE(4, 4), UPB_TYPE_INT32, &val,
+ arena);
}
/* validate.MessageRules */
UPB_INLINE validate_MessageRules *validate_MessageRules_new(upb_arena *arena) {
- return (validate_MessageRules *)_upb_msg_new(&validate_MessageRules_msginit, arena);
+ return (validate_MessageRules *)_upb_msg_new(&validate_MessageRules_msginit, arena);
}
UPB_INLINE validate_MessageRules *validate_MessageRules_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -1643,24 +1643,24 @@ UPB_INLINE char *validate_MessageRules_serialize(const validate_MessageRules *ms
return upb_encode(msg, &validate_MessageRules_msginit, arena, len);
}
-UPB_INLINE bool validate_MessageRules_has_skip(const validate_MessageRules *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE bool validate_MessageRules_skip(const validate_MessageRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); }
-UPB_INLINE bool validate_MessageRules_has_required(const validate_MessageRules *msg) { return _upb_hasbit(msg, 2); }
-UPB_INLINE bool validate_MessageRules_required(const validate_MessageRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool); }
+UPB_INLINE bool validate_MessageRules_has_skip(const validate_MessageRules *msg) { return _upb_hasbit(msg, 1); }
+UPB_INLINE bool validate_MessageRules_skip(const validate_MessageRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); }
+UPB_INLINE bool validate_MessageRules_has_required(const validate_MessageRules *msg) { return _upb_hasbit(msg, 2); }
+UPB_INLINE bool validate_MessageRules_required(const validate_MessageRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool); }
UPB_INLINE void validate_MessageRules_set_skip(validate_MessageRules *msg, bool value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
}
UPB_INLINE void validate_MessageRules_set_required(validate_MessageRules *msg, bool value) {
_upb_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = value;
}
/* validate.RepeatedRules */
UPB_INLINE validate_RepeatedRules *validate_RepeatedRules_new(upb_arena *arena) {
- return (validate_RepeatedRules *)_upb_msg_new(&validate_RepeatedRules_msginit, arena);
+ return (validate_RepeatedRules *)_upb_msg_new(&validate_RepeatedRules_msginit, arena);
}
UPB_INLINE validate_RepeatedRules *validate_RepeatedRules_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -1671,35 +1671,35 @@ UPB_INLINE char *validate_RepeatedRules_serialize(const validate_RepeatedRules *
return upb_encode(msg, &validate_RepeatedRules_msginit, arena, len);
}
-UPB_INLINE bool validate_RepeatedRules_has_min_items(const validate_RepeatedRules *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE uint64_t validate_RepeatedRules_min_items(const validate_RepeatedRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint64_t); }
-UPB_INLINE bool validate_RepeatedRules_has_max_items(const validate_RepeatedRules *msg) { return _upb_hasbit(msg, 2); }
-UPB_INLINE uint64_t validate_RepeatedRules_max_items(const validate_RepeatedRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), uint64_t); }
-UPB_INLINE bool validate_RepeatedRules_has_unique(const validate_RepeatedRules *msg) { return _upb_hasbit(msg, 3); }
-UPB_INLINE bool validate_RepeatedRules_unique(const validate_RepeatedRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool); }
-UPB_INLINE bool validate_RepeatedRules_has_items(const validate_RepeatedRules *msg) { return _upb_hasbit(msg, 4); }
-UPB_INLINE const validate_FieldRules* validate_RepeatedRules_items(const validate_RepeatedRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 32), const validate_FieldRules*); }
+UPB_INLINE bool validate_RepeatedRules_has_min_items(const validate_RepeatedRules *msg) { return _upb_hasbit(msg, 1); }
+UPB_INLINE uint64_t validate_RepeatedRules_min_items(const validate_RepeatedRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint64_t); }
+UPB_INLINE bool validate_RepeatedRules_has_max_items(const validate_RepeatedRules *msg) { return _upb_hasbit(msg, 2); }
+UPB_INLINE uint64_t validate_RepeatedRules_max_items(const validate_RepeatedRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), uint64_t); }
+UPB_INLINE bool validate_RepeatedRules_has_unique(const validate_RepeatedRules *msg) { return _upb_hasbit(msg, 3); }
+UPB_INLINE bool validate_RepeatedRules_unique(const validate_RepeatedRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool); }
+UPB_INLINE bool validate_RepeatedRules_has_items(const validate_RepeatedRules *msg) { return _upb_hasbit(msg, 4); }
+UPB_INLINE const validate_FieldRules* validate_RepeatedRules_items(const validate_RepeatedRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 32), const validate_FieldRules*); }
UPB_INLINE void validate_RepeatedRules_set_min_items(validate_RepeatedRules *msg, uint64_t value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint64_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint64_t) = value;
}
UPB_INLINE void validate_RepeatedRules_set_max_items(validate_RepeatedRules *msg, uint64_t value) {
_upb_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(16, 16), uint64_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 16), uint64_t) = value;
}
UPB_INLINE void validate_RepeatedRules_set_unique(validate_RepeatedRules *msg, bool value) {
_upb_sethas(msg, 3);
- *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool) = value;
}
UPB_INLINE void validate_RepeatedRules_set_items(validate_RepeatedRules *msg, validate_FieldRules* value) {
_upb_sethas(msg, 4);
- *UPB_PTR_AT(msg, UPB_SIZE(28, 32), validate_FieldRules*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 32), validate_FieldRules*) = value;
}
UPB_INLINE struct validate_FieldRules* validate_RepeatedRules_mutable_items(validate_RepeatedRules *msg, upb_arena *arena) {
struct validate_FieldRules* sub = (struct validate_FieldRules*)validate_RepeatedRules_items(msg);
if (sub == NULL) {
- sub = (struct validate_FieldRules*)_upb_msg_new(&validate_FieldRules_msginit, arena);
+ sub = (struct validate_FieldRules*)_upb_msg_new(&validate_FieldRules_msginit, arena);
if (!sub) return NULL;
validate_RepeatedRules_set_items(msg, sub);
}
@@ -1709,7 +1709,7 @@ UPB_INLINE struct validate_FieldRules* validate_RepeatedRules_mutable_items(vali
/* validate.MapRules */
UPB_INLINE validate_MapRules *validate_MapRules_new(upb_arena *arena) {
- return (validate_MapRules *)_upb_msg_new(&validate_MapRules_msginit, arena);
+ return (validate_MapRules *)_upb_msg_new(&validate_MapRules_msginit, arena);
}
UPB_INLINE validate_MapRules *validate_MapRules_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -1720,37 +1720,37 @@ UPB_INLINE char *validate_MapRules_serialize(const validate_MapRules *msg, upb_a
return upb_encode(msg, &validate_MapRules_msginit, arena, len);
}
-UPB_INLINE bool validate_MapRules_has_min_pairs(const validate_MapRules *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE uint64_t validate_MapRules_min_pairs(const validate_MapRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint64_t); }
-UPB_INLINE bool validate_MapRules_has_max_pairs(const validate_MapRules *msg) { return _upb_hasbit(msg, 2); }
-UPB_INLINE uint64_t validate_MapRules_max_pairs(const validate_MapRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), uint64_t); }
-UPB_INLINE bool validate_MapRules_has_no_sparse(const validate_MapRules *msg) { return _upb_hasbit(msg, 3); }
-UPB_INLINE bool validate_MapRules_no_sparse(const validate_MapRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool); }
-UPB_INLINE bool validate_MapRules_has_keys(const validate_MapRules *msg) { return _upb_hasbit(msg, 4); }
-UPB_INLINE const validate_FieldRules* validate_MapRules_keys(const validate_MapRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 32), const validate_FieldRules*); }
-UPB_INLINE bool validate_MapRules_has_values(const validate_MapRules *msg) { return _upb_hasbit(msg, 5); }
-UPB_INLINE const validate_FieldRules* validate_MapRules_values(const validate_MapRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 40), const validate_FieldRules*); }
+UPB_INLINE bool validate_MapRules_has_min_pairs(const validate_MapRules *msg) { return _upb_hasbit(msg, 1); }
+UPB_INLINE uint64_t validate_MapRules_min_pairs(const validate_MapRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint64_t); }
+UPB_INLINE bool validate_MapRules_has_max_pairs(const validate_MapRules *msg) { return _upb_hasbit(msg, 2); }
+UPB_INLINE uint64_t validate_MapRules_max_pairs(const validate_MapRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), uint64_t); }
+UPB_INLINE bool validate_MapRules_has_no_sparse(const validate_MapRules *msg) { return _upb_hasbit(msg, 3); }
+UPB_INLINE bool validate_MapRules_no_sparse(const validate_MapRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool); }
+UPB_INLINE bool validate_MapRules_has_keys(const validate_MapRules *msg) { return _upb_hasbit(msg, 4); }
+UPB_INLINE const validate_FieldRules* validate_MapRules_keys(const validate_MapRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 32), const validate_FieldRules*); }
+UPB_INLINE bool validate_MapRules_has_values(const validate_MapRules *msg) { return _upb_hasbit(msg, 5); }
+UPB_INLINE const validate_FieldRules* validate_MapRules_values(const validate_MapRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 40), const validate_FieldRules*); }
UPB_INLINE void validate_MapRules_set_min_pairs(validate_MapRules *msg, uint64_t value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint64_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint64_t) = value;
}
UPB_INLINE void validate_MapRules_set_max_pairs(validate_MapRules *msg, uint64_t value) {
_upb_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(16, 16), uint64_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 16), uint64_t) = value;
}
UPB_INLINE void validate_MapRules_set_no_sparse(validate_MapRules *msg, bool value) {
_upb_sethas(msg, 3);
- *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool) = value;
}
UPB_INLINE void validate_MapRules_set_keys(validate_MapRules *msg, validate_FieldRules* value) {
_upb_sethas(msg, 4);
- *UPB_PTR_AT(msg, UPB_SIZE(28, 32), validate_FieldRules*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 32), validate_FieldRules*) = value;
}
UPB_INLINE struct validate_FieldRules* validate_MapRules_mutable_keys(validate_MapRules *msg, upb_arena *arena) {
struct validate_FieldRules* sub = (struct validate_FieldRules*)validate_MapRules_keys(msg);
if (sub == NULL) {
- sub = (struct validate_FieldRules*)_upb_msg_new(&validate_FieldRules_msginit, arena);
+ sub = (struct validate_FieldRules*)_upb_msg_new(&validate_FieldRules_msginit, arena);
if (!sub) return NULL;
validate_MapRules_set_keys(msg, sub);
}
@@ -1758,12 +1758,12 @@ UPB_INLINE struct validate_FieldRules* validate_MapRules_mutable_keys(validate_M
}
UPB_INLINE void validate_MapRules_set_values(validate_MapRules *msg, validate_FieldRules* value) {
_upb_sethas(msg, 5);
- *UPB_PTR_AT(msg, UPB_SIZE(32, 40), validate_FieldRules*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 40), validate_FieldRules*) = value;
}
UPB_INLINE struct validate_FieldRules* validate_MapRules_mutable_values(validate_MapRules *msg, upb_arena *arena) {
struct validate_FieldRules* sub = (struct validate_FieldRules*)validate_MapRules_values(msg);
if (sub == NULL) {
- sub = (struct validate_FieldRules*)_upb_msg_new(&validate_FieldRules_msginit, arena);
+ sub = (struct validate_FieldRules*)_upb_msg_new(&validate_FieldRules_msginit, arena);
if (!sub) return NULL;
validate_MapRules_set_values(msg, sub);
}
@@ -1773,7 +1773,7 @@ UPB_INLINE struct validate_FieldRules* validate_MapRules_mutable_values(validate
/* validate.AnyRules */
UPB_INLINE validate_AnyRules *validate_AnyRules_new(upb_arena *arena) {
- return (validate_AnyRules *)_upb_msg_new(&validate_AnyRules_msginit, arena);
+ return (validate_AnyRules *)_upb_msg_new(&validate_AnyRules_msginit, arena);
}
UPB_INLINE validate_AnyRules *validate_AnyRules_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -1784,40 +1784,40 @@ UPB_INLINE char *validate_AnyRules_serialize(const validate_AnyRules *msg, upb_a
return upb_encode(msg, &validate_AnyRules_msginit, arena, len);
}
-UPB_INLINE bool validate_AnyRules_has_required(const validate_AnyRules *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE bool validate_AnyRules_required(const validate_AnyRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); }
+UPB_INLINE bool validate_AnyRules_has_required(const validate_AnyRules *msg) { return _upb_hasbit(msg, 1); }
+UPB_INLINE bool validate_AnyRules_required(const validate_AnyRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); }
UPB_INLINE upb_strview const* validate_AnyRules_in(const validate_AnyRules *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len); }
UPB_INLINE upb_strview const* validate_AnyRules_not_in(const validate_AnyRules *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len); }
UPB_INLINE void validate_AnyRules_set_required(validate_AnyRules *msg, bool value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
}
UPB_INLINE upb_strview* validate_AnyRules_mutable_in(validate_AnyRules *msg, size_t *len) {
return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len);
}
UPB_INLINE upb_strview* validate_AnyRules_resize_in(validate_AnyRules *msg, size_t len, upb_arena *arena) {
- return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(4, 8), len, UPB_TYPE_STRING, arena);
+ return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(4, 8), len, UPB_TYPE_STRING, arena);
}
UPB_INLINE bool validate_AnyRules_add_in(validate_AnyRules *msg, upb_strview val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(4, 8), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
- arena);
+ return _upb_array_append_accessor(msg, UPB_SIZE(4, 8), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
+ arena);
}
UPB_INLINE upb_strview* validate_AnyRules_mutable_not_in(validate_AnyRules *msg, size_t *len) {
return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len);
}
UPB_INLINE upb_strview* validate_AnyRules_resize_not_in(validate_AnyRules *msg, size_t len, upb_arena *arena) {
- return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(8, 16), len, UPB_TYPE_STRING, arena);
+ return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(8, 16), len, UPB_TYPE_STRING, arena);
}
UPB_INLINE bool validate_AnyRules_add_not_in(validate_AnyRules *msg, upb_strview val, upb_arena *arena) {
- return _upb_array_append_accessor(msg, UPB_SIZE(8, 16), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
- arena);
+ return _upb_array_append_accessor(msg, UPB_SIZE(8, 16), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val,
+ arena);
}
/* validate.DurationRules */
UPB_INLINE validate_DurationRules *validate_DurationRules_new(upb_arena *arena) {
- return (validate_DurationRules *)_upb_msg_new(&validate_DurationRules_msginit, arena);
+ return (validate_DurationRules *)_upb_msg_new(&validate_DurationRules_msginit, arena);
}
UPB_INLINE validate_DurationRules *validate_DurationRules_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -1828,35 +1828,35 @@ UPB_INLINE char *validate_DurationRules_serialize(const validate_DurationRules *
return upb_encode(msg, &validate_DurationRules_msginit, arena, len);
}
-UPB_INLINE bool validate_DurationRules_has_required(const validate_DurationRules *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE bool validate_DurationRules_required(const validate_DurationRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); }
-UPB_INLINE bool validate_DurationRules_has_const(const validate_DurationRules *msg) { return _upb_hasbit(msg, 2); }
-UPB_INLINE const struct google_protobuf_Duration* validate_DurationRules_const(const validate_DurationRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_Duration*); }
-UPB_INLINE bool validate_DurationRules_has_lt(const validate_DurationRules *msg) { return _upb_hasbit(msg, 3); }
-UPB_INLINE const struct google_protobuf_Duration* validate_DurationRules_lt(const validate_DurationRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_Duration*); }
-UPB_INLINE bool validate_DurationRules_has_lte(const validate_DurationRules *msg) { return _upb_hasbit(msg, 4); }
-UPB_INLINE const struct google_protobuf_Duration* validate_DurationRules_lte(const validate_DurationRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_protobuf_Duration*); }
-UPB_INLINE bool validate_DurationRules_has_gt(const validate_DurationRules *msg) { return _upb_hasbit(msg, 5); }
-UPB_INLINE const struct google_protobuf_Duration* validate_DurationRules_gt(const validate_DurationRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const struct google_protobuf_Duration*); }
-UPB_INLINE bool validate_DurationRules_has_gte(const validate_DurationRules *msg) { return _upb_hasbit(msg, 6); }
-UPB_INLINE const struct google_protobuf_Duration* validate_DurationRules_gte(const validate_DurationRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const struct google_protobuf_Duration*); }
-UPB_INLINE bool validate_DurationRules_has_in(const validate_DurationRules *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 48)); }
+UPB_INLINE bool validate_DurationRules_has_required(const validate_DurationRules *msg) { return _upb_hasbit(msg, 1); }
+UPB_INLINE bool validate_DurationRules_required(const validate_DurationRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); }
+UPB_INLINE bool validate_DurationRules_has_const(const validate_DurationRules *msg) { return _upb_hasbit(msg, 2); }
+UPB_INLINE const struct google_protobuf_Duration* validate_DurationRules_const(const validate_DurationRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_Duration*); }
+UPB_INLINE bool validate_DurationRules_has_lt(const validate_DurationRules *msg) { return _upb_hasbit(msg, 3); }
+UPB_INLINE const struct google_protobuf_Duration* validate_DurationRules_lt(const validate_DurationRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_Duration*); }
+UPB_INLINE bool validate_DurationRules_has_lte(const validate_DurationRules *msg) { return _upb_hasbit(msg, 4); }
+UPB_INLINE const struct google_protobuf_Duration* validate_DurationRules_lte(const validate_DurationRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_protobuf_Duration*); }
+UPB_INLINE bool validate_DurationRules_has_gt(const validate_DurationRules *msg) { return _upb_hasbit(msg, 5); }
+UPB_INLINE const struct google_protobuf_Duration* validate_DurationRules_gt(const validate_DurationRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const struct google_protobuf_Duration*); }
+UPB_INLINE bool validate_DurationRules_has_gte(const validate_DurationRules *msg) { return _upb_hasbit(msg, 6); }
+UPB_INLINE const struct google_protobuf_Duration* validate_DurationRules_gte(const validate_DurationRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const struct google_protobuf_Duration*); }
+UPB_INLINE bool validate_DurationRules_has_in(const validate_DurationRules *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 48)); }
UPB_INLINE const struct google_protobuf_Duration* const* validate_DurationRules_in(const validate_DurationRules *msg, size_t *len) { return (const struct google_protobuf_Duration* const*)_upb_array_accessor(msg, UPB_SIZE(24, 48), len); }
-UPB_INLINE bool validate_DurationRules_has_not_in(const validate_DurationRules *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 56)); }
+UPB_INLINE bool validate_DurationRules_has_not_in(const validate_DurationRules *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 56)); }
UPB_INLINE const struct google_protobuf_Duration* const* validate_DurationRules_not_in(const validate_DurationRules *msg, size_t *len) { return (const struct google_protobuf_Duration* const*)_upb_array_accessor(msg, UPB_SIZE(28, 56), len); }
UPB_INLINE void validate_DurationRules_set_required(validate_DurationRules *msg, bool value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
}
UPB_INLINE void validate_DurationRules_set_const(validate_DurationRules *msg, struct google_protobuf_Duration* value) {
_upb_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_Duration*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_Duration*) = value;
}
UPB_INLINE struct google_protobuf_Duration* validate_DurationRules_mutable_const(validate_DurationRules *msg, upb_arena *arena) {
struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)validate_DurationRules_const(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
+ sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
if (!sub) return NULL;
validate_DurationRules_set_const(msg, sub);
}
@@ -1864,12 +1864,12 @@ UPB_INLINE struct google_protobuf_Duration* validate_DurationRules_mutable_const
}
UPB_INLINE void validate_DurationRules_set_lt(validate_DurationRules *msg, struct google_protobuf_Duration* value) {
_upb_sethas(msg, 3);
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_Duration*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_Duration*) = value;
}
UPB_INLINE struct google_protobuf_Duration* validate_DurationRules_mutable_lt(validate_DurationRules *msg, upb_arena *arena) {
struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)validate_DurationRules_lt(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
+ sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
if (!sub) return NULL;
validate_DurationRules_set_lt(msg, sub);
}
@@ -1877,12 +1877,12 @@ UPB_INLINE struct google_protobuf_Duration* validate_DurationRules_mutable_lt(va
}
UPB_INLINE void validate_DurationRules_set_lte(validate_DurationRules *msg, struct google_protobuf_Duration* value) {
_upb_sethas(msg, 4);
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_protobuf_Duration*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_protobuf_Duration*) = value;
}
UPB_INLINE struct google_protobuf_Duration* validate_DurationRules_mutable_lte(validate_DurationRules *msg, upb_arena *arena) {
struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)validate_DurationRules_lte(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
+ sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
if (!sub) return NULL;
validate_DurationRules_set_lte(msg, sub);
}
@@ -1890,12 +1890,12 @@ UPB_INLINE struct google_protobuf_Duration* validate_DurationRules_mutable_lte(v
}
UPB_INLINE void validate_DurationRules_set_gt(validate_DurationRules *msg, struct google_protobuf_Duration* value) {
_upb_sethas(msg, 5);
- *UPB_PTR_AT(msg, UPB_SIZE(16, 32), struct google_protobuf_Duration*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), struct google_protobuf_Duration*) = value;
}
UPB_INLINE struct google_protobuf_Duration* validate_DurationRules_mutable_gt(validate_DurationRules *msg, upb_arena *arena) {
struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)validate_DurationRules_gt(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
+ sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
if (!sub) return NULL;
validate_DurationRules_set_gt(msg, sub);
}
@@ -1903,12 +1903,12 @@ UPB_INLINE struct google_protobuf_Duration* validate_DurationRules_mutable_gt(va
}
UPB_INLINE void validate_DurationRules_set_gte(validate_DurationRules *msg, struct google_protobuf_Duration* value) {
_upb_sethas(msg, 6);
- *UPB_PTR_AT(msg, UPB_SIZE(20, 40), struct google_protobuf_Duration*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 40), struct google_protobuf_Duration*) = value;
}
UPB_INLINE struct google_protobuf_Duration* validate_DurationRules_mutable_gte(validate_DurationRules *msg, upb_arena *arena) {
struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)validate_DurationRules_gte(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
+ sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
if (!sub) return NULL;
validate_DurationRules_set_gte(msg, sub);
}
@@ -1918,10 +1918,10 @@ UPB_INLINE struct google_protobuf_Duration** validate_DurationRules_mutable_in(v
return (struct google_protobuf_Duration**)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 48), len);
}
UPB_INLINE struct google_protobuf_Duration** validate_DurationRules_resize_in(validate_DurationRules *msg, size_t len, upb_arena *arena) {
- return (struct google_protobuf_Duration**)_upb_array_resize_accessor(msg, UPB_SIZE(24, 48), len, UPB_TYPE_MESSAGE, arena);
+ return (struct google_protobuf_Duration**)_upb_array_resize_accessor(msg, UPB_SIZE(24, 48), len, UPB_TYPE_MESSAGE, arena);
}
UPB_INLINE struct google_protobuf_Duration* validate_DurationRules_add_in(validate_DurationRules *msg, upb_arena *arena) {
- struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
+ struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
bool ok = _upb_array_append_accessor(
msg, UPB_SIZE(24, 48), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
if (!ok) return NULL;
@@ -1931,10 +1931,10 @@ UPB_INLINE struct google_protobuf_Duration** validate_DurationRules_mutable_not_
return (struct google_protobuf_Duration**)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 56), len);
}
UPB_INLINE struct google_protobuf_Duration** validate_DurationRules_resize_not_in(validate_DurationRules *msg, size_t len, upb_arena *arena) {
- return (struct google_protobuf_Duration**)_upb_array_resize_accessor(msg, UPB_SIZE(28, 56), len, UPB_TYPE_MESSAGE, arena);
+ return (struct google_protobuf_Duration**)_upb_array_resize_accessor(msg, UPB_SIZE(28, 56), len, UPB_TYPE_MESSAGE, arena);
}
UPB_INLINE struct google_protobuf_Duration* validate_DurationRules_add_not_in(validate_DurationRules *msg, upb_arena *arena) {
- struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
+ struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
bool ok = _upb_array_append_accessor(
msg, UPB_SIZE(28, 56), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
if (!ok) return NULL;
@@ -1944,7 +1944,7 @@ UPB_INLINE struct google_protobuf_Duration* validate_DurationRules_add_not_in(va
/* validate.TimestampRules */
UPB_INLINE validate_TimestampRules *validate_TimestampRules_new(upb_arena *arena) {
- return (validate_TimestampRules *)_upb_msg_new(&validate_TimestampRules_msginit, arena);
+ return (validate_TimestampRules *)_upb_msg_new(&validate_TimestampRules_msginit, arena);
}
UPB_INLINE validate_TimestampRules *validate_TimestampRules_parse(const char *buf, size_t size,
upb_arena *arena) {
@@ -1955,37 +1955,37 @@ UPB_INLINE char *validate_TimestampRules_serialize(const validate_TimestampRules
return upb_encode(msg, &validate_TimestampRules_msginit, arena, len);
}
-UPB_INLINE bool validate_TimestampRules_has_required(const validate_TimestampRules *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE bool validate_TimestampRules_required(const validate_TimestampRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool); }
-UPB_INLINE bool validate_TimestampRules_has_const(const validate_TimestampRules *msg) { return _upb_hasbit(msg, 4); }
-UPB_INLINE const struct google_protobuf_Timestamp* validate_TimestampRules_const(const validate_TimestampRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const struct google_protobuf_Timestamp*); }
-UPB_INLINE bool validate_TimestampRules_has_lt(const validate_TimestampRules *msg) { return _upb_hasbit(msg, 5); }
-UPB_INLINE const struct google_protobuf_Timestamp* validate_TimestampRules_lt(const validate_TimestampRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const struct google_protobuf_Timestamp*); }
-UPB_INLINE bool validate_TimestampRules_has_lte(const validate_TimestampRules *msg) { return _upb_hasbit(msg, 6); }
-UPB_INLINE const struct google_protobuf_Timestamp* validate_TimestampRules_lte(const validate_TimestampRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const struct google_protobuf_Timestamp*); }
-UPB_INLINE bool validate_TimestampRules_has_gt(const validate_TimestampRules *msg) { return _upb_hasbit(msg, 7); }
-UPB_INLINE const struct google_protobuf_Timestamp* validate_TimestampRules_gt(const validate_TimestampRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const struct google_protobuf_Timestamp*); }
-UPB_INLINE bool validate_TimestampRules_has_gte(const validate_TimestampRules *msg) { return _upb_hasbit(msg, 8); }
-UPB_INLINE const struct google_protobuf_Timestamp* validate_TimestampRules_gte(const validate_TimestampRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const struct google_protobuf_Timestamp*); }
-UPB_INLINE bool validate_TimestampRules_has_lt_now(const validate_TimestampRules *msg) { return _upb_hasbit(msg, 2); }
-UPB_INLINE bool validate_TimestampRules_lt_now(const validate_TimestampRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(3, 3), bool); }
-UPB_INLINE bool validate_TimestampRules_has_gt_now(const validate_TimestampRules *msg) { return _upb_hasbit(msg, 3); }
-UPB_INLINE bool validate_TimestampRules_gt_now(const validate_TimestampRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool); }
-UPB_INLINE bool validate_TimestampRules_has_within(const validate_TimestampRules *msg) { return _upb_hasbit(msg, 9); }
-UPB_INLINE const struct google_protobuf_Duration* validate_TimestampRules_within(const validate_TimestampRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 48), const struct google_protobuf_Duration*); }
+UPB_INLINE bool validate_TimestampRules_has_required(const validate_TimestampRules *msg) { return _upb_hasbit(msg, 1); }
+UPB_INLINE bool validate_TimestampRules_required(const validate_TimestampRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool); }
+UPB_INLINE bool validate_TimestampRules_has_const(const validate_TimestampRules *msg) { return _upb_hasbit(msg, 4); }
+UPB_INLINE const struct google_protobuf_Timestamp* validate_TimestampRules_const(const validate_TimestampRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const struct google_protobuf_Timestamp*); }
+UPB_INLINE bool validate_TimestampRules_has_lt(const validate_TimestampRules *msg) { return _upb_hasbit(msg, 5); }
+UPB_INLINE const struct google_protobuf_Timestamp* validate_TimestampRules_lt(const validate_TimestampRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const struct google_protobuf_Timestamp*); }
+UPB_INLINE bool validate_TimestampRules_has_lte(const validate_TimestampRules *msg) { return _upb_hasbit(msg, 6); }
+UPB_INLINE const struct google_protobuf_Timestamp* validate_TimestampRules_lte(const validate_TimestampRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const struct google_protobuf_Timestamp*); }
+UPB_INLINE bool validate_TimestampRules_has_gt(const validate_TimestampRules *msg) { return _upb_hasbit(msg, 7); }
+UPB_INLINE const struct google_protobuf_Timestamp* validate_TimestampRules_gt(const validate_TimestampRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const struct google_protobuf_Timestamp*); }
+UPB_INLINE bool validate_TimestampRules_has_gte(const validate_TimestampRules *msg) { return _upb_hasbit(msg, 8); }
+UPB_INLINE const struct google_protobuf_Timestamp* validate_TimestampRules_gte(const validate_TimestampRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const struct google_protobuf_Timestamp*); }
+UPB_INLINE bool validate_TimestampRules_has_lt_now(const validate_TimestampRules *msg) { return _upb_hasbit(msg, 2); }
+UPB_INLINE bool validate_TimestampRules_lt_now(const validate_TimestampRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(3, 3), bool); }
+UPB_INLINE bool validate_TimestampRules_has_gt_now(const validate_TimestampRules *msg) { return _upb_hasbit(msg, 3); }
+UPB_INLINE bool validate_TimestampRules_gt_now(const validate_TimestampRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool); }
+UPB_INLINE bool validate_TimestampRules_has_within(const validate_TimestampRules *msg) { return _upb_hasbit(msg, 9); }
+UPB_INLINE const struct google_protobuf_Duration* validate_TimestampRules_within(const validate_TimestampRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 48), const struct google_protobuf_Duration*); }
UPB_INLINE void validate_TimestampRules_set_required(validate_TimestampRules *msg, bool value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = value;
}
UPB_INLINE void validate_TimestampRules_set_const(validate_TimestampRules *msg, struct google_protobuf_Timestamp* value) {
_upb_sethas(msg, 4);
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), struct google_protobuf_Timestamp*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), struct google_protobuf_Timestamp*) = value;
}
UPB_INLINE struct google_protobuf_Timestamp* validate_TimestampRules_mutable_const(validate_TimestampRules *msg, upb_arena *arena) {
struct google_protobuf_Timestamp* sub = (struct google_protobuf_Timestamp*)validate_TimestampRules_const(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_Timestamp*)_upb_msg_new(&google_protobuf_Timestamp_msginit, arena);
+ sub = (struct google_protobuf_Timestamp*)_upb_msg_new(&google_protobuf_Timestamp_msginit, arena);
if (!sub) return NULL;
validate_TimestampRules_set_const(msg, sub);
}
@@ -1993,12 +1993,12 @@ UPB_INLINE struct google_protobuf_Timestamp* validate_TimestampRules_mutable_con
}
UPB_INLINE void validate_TimestampRules_set_lt(validate_TimestampRules *msg, struct google_protobuf_Timestamp* value) {
_upb_sethas(msg, 5);
- *UPB_PTR_AT(msg, UPB_SIZE(12, 16), struct google_protobuf_Timestamp*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 16), struct google_protobuf_Timestamp*) = value;
}
UPB_INLINE struct google_protobuf_Timestamp* validate_TimestampRules_mutable_lt(validate_TimestampRules *msg, upb_arena *arena) {
struct google_protobuf_Timestamp* sub = (struct google_protobuf_Timestamp*)validate_TimestampRules_lt(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_Timestamp*)_upb_msg_new(&google_protobuf_Timestamp_msginit, arena);
+ sub = (struct google_protobuf_Timestamp*)_upb_msg_new(&google_protobuf_Timestamp_msginit, arena);
if (!sub) return NULL;
validate_TimestampRules_set_lt(msg, sub);
}
@@ -2006,12 +2006,12 @@ UPB_INLINE struct google_protobuf_Timestamp* validate_TimestampRules_mutable_lt(
}
UPB_INLINE void validate_TimestampRules_set_lte(validate_TimestampRules *msg, struct google_protobuf_Timestamp* value) {
_upb_sethas(msg, 6);
- *UPB_PTR_AT(msg, UPB_SIZE(16, 24), struct google_protobuf_Timestamp*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), struct google_protobuf_Timestamp*) = value;
}
UPB_INLINE struct google_protobuf_Timestamp* validate_TimestampRules_mutable_lte(validate_TimestampRules *msg, upb_arena *arena) {
struct google_protobuf_Timestamp* sub = (struct google_protobuf_Timestamp*)validate_TimestampRules_lte(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_Timestamp*)_upb_msg_new(&google_protobuf_Timestamp_msginit, arena);
+ sub = (struct google_protobuf_Timestamp*)_upb_msg_new(&google_protobuf_Timestamp_msginit, arena);
if (!sub) return NULL;
validate_TimestampRules_set_lte(msg, sub);
}
@@ -2019,12 +2019,12 @@ UPB_INLINE struct google_protobuf_Timestamp* validate_TimestampRules_mutable_lte
}
UPB_INLINE void validate_TimestampRules_set_gt(validate_TimestampRules *msg, struct google_protobuf_Timestamp* value) {
_upb_sethas(msg, 7);
- *UPB_PTR_AT(msg, UPB_SIZE(20, 32), struct google_protobuf_Timestamp*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 32), struct google_protobuf_Timestamp*) = value;
}
UPB_INLINE struct google_protobuf_Timestamp* validate_TimestampRules_mutable_gt(validate_TimestampRules *msg, upb_arena *arena) {
struct google_protobuf_Timestamp* sub = (struct google_protobuf_Timestamp*)validate_TimestampRules_gt(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_Timestamp*)_upb_msg_new(&google_protobuf_Timestamp_msginit, arena);
+ sub = (struct google_protobuf_Timestamp*)_upb_msg_new(&google_protobuf_Timestamp_msginit, arena);
if (!sub) return NULL;
validate_TimestampRules_set_gt(msg, sub);
}
@@ -2032,12 +2032,12 @@ UPB_INLINE struct google_protobuf_Timestamp* validate_TimestampRules_mutable_gt(
}
UPB_INLINE void validate_TimestampRules_set_gte(validate_TimestampRules *msg, struct google_protobuf_Timestamp* value) {
_upb_sethas(msg, 8);
- *UPB_PTR_AT(msg, UPB_SIZE(24, 40), struct google_protobuf_Timestamp*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 40), struct google_protobuf_Timestamp*) = value;
}
UPB_INLINE struct google_protobuf_Timestamp* validate_TimestampRules_mutable_gte(validate_TimestampRules *msg, upb_arena *arena) {
struct google_protobuf_Timestamp* sub = (struct google_protobuf_Timestamp*)validate_TimestampRules_gte(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_Timestamp*)_upb_msg_new(&google_protobuf_Timestamp_msginit, arena);
+ sub = (struct google_protobuf_Timestamp*)_upb_msg_new(&google_protobuf_Timestamp_msginit, arena);
if (!sub) return NULL;
validate_TimestampRules_set_gte(msg, sub);
}
@@ -2045,20 +2045,20 @@ UPB_INLINE struct google_protobuf_Timestamp* validate_TimestampRules_mutable_gte
}
UPB_INLINE void validate_TimestampRules_set_lt_now(validate_TimestampRules *msg, bool value) {
_upb_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(3, 3), bool) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(3, 3), bool) = value;
}
UPB_INLINE void validate_TimestampRules_set_gt_now(validate_TimestampRules *msg, bool value) {
_upb_sethas(msg, 3);
- *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool) = value;
}
UPB_INLINE void validate_TimestampRules_set_within(validate_TimestampRules *msg, struct google_protobuf_Duration* value) {
_upb_sethas(msg, 9);
- *UPB_PTR_AT(msg, UPB_SIZE(28, 48), struct google_protobuf_Duration*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 48), struct google_protobuf_Duration*) = value;
}
UPB_INLINE struct google_protobuf_Duration* validate_TimestampRules_mutable_within(validate_TimestampRules *msg, upb_arena *arena) {
struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)validate_TimestampRules_within(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
+ sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
if (!sub) return NULL;
validate_TimestampRules_set_within(msg, sub);
}
diff --git a/contrib/libs/grpc/src/core/ext/xds/certificate_provider_factory.h b/contrib/libs/grpc/src/core/ext/xds/certificate_provider_factory.h
index 534da59b640..244fdd9ff9d 100644
--- a/contrib/libs/grpc/src/core/ext/xds/certificate_provider_factory.h
+++ b/contrib/libs/grpc/src/core/ext/xds/certificate_provider_factory.h
@@ -1,59 +1,59 @@
-//
-//
-// Copyright 2020 gRPC authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//
-
-#ifndef GRPC_CORE_EXT_XDS_CERTIFICATE_PROVIDER_FACTORY_H
-#define GRPC_CORE_EXT_XDS_CERTIFICATE_PROVIDER_FACTORY_H
-
-#include <grpc/support/port_platform.h>
-
-#include "src/core/lib/iomgr/error.h"
-#include "src/core/lib/json/json.h"
-#include "src/core/lib/security/certificate_provider.h"
-
-namespace grpc_core {
-
-// Factories for plugins. Each plugin implementation should create its own
-// factory implementation and register an instance with the registry.
-class CertificateProviderFactory {
- public:
- // Interface for configs for CertificateProviders.
- class Config {
- public:
- virtual ~Config() = default;
-
- // Name of the type of the CertificateProvider. Unique to each type of
- // config.
- virtual const char* name() const = 0;
- };
-
- virtual ~CertificateProviderFactory() = default;
-
- // Name of the plugin.
- virtual const char* name() const = 0;
-
- virtual std::unique_ptr<Config> CreateCertificateProviderConfig(
- const Json& config_json, grpc_error** error) = 0;
-
- // Create a CertificateProvider instance from config.
- virtual RefCountedPtr<grpc_tls_certificate_provider>
- CreateCertificateProvider(std::unique_ptr<Config> config) = 0;
-};
-
-} // namespace grpc_core
-
-#endif // GRPC_CORE_EXT_XDS_CERTIFICATE_PROVIDER_FACTORY_H
+//
+//
+// Copyright 2020 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+//
+
+#ifndef GRPC_CORE_EXT_XDS_CERTIFICATE_PROVIDER_FACTORY_H
+#define GRPC_CORE_EXT_XDS_CERTIFICATE_PROVIDER_FACTORY_H
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/lib/iomgr/error.h"
+#include "src/core/lib/json/json.h"
+#include "src/core/lib/security/certificate_provider.h"
+
+namespace grpc_core {
+
+// Factories for plugins. Each plugin implementation should create its own
+// factory implementation and register an instance with the registry.
+class CertificateProviderFactory {
+ public:
+ // Interface for configs for CertificateProviders.
+ class Config {
+ public:
+ virtual ~Config() = default;
+
+ // Name of the type of the CertificateProvider. Unique to each type of
+ // config.
+ virtual const char* name() const = 0;
+ };
+
+ virtual ~CertificateProviderFactory() = default;
+
+ // Name of the plugin.
+ virtual const char* name() const = 0;
+
+ virtual std::unique_ptr<Config> CreateCertificateProviderConfig(
+ const Json& config_json, grpc_error** error) = 0;
+
+ // Create a CertificateProvider instance from config.
+ virtual RefCountedPtr<grpc_tls_certificate_provider>
+ CreateCertificateProvider(std::unique_ptr<Config> config) = 0;
+};
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_EXT_XDS_CERTIFICATE_PROVIDER_FACTORY_H
diff --git a/contrib/libs/grpc/src/core/ext/xds/certificate_provider_registry.cc b/contrib/libs/grpc/src/core/ext/xds/certificate_provider_registry.cc
index 0160595fac5..ae972ba644a 100644
--- a/contrib/libs/grpc/src/core/ext/xds/certificate_provider_registry.cc
+++ b/contrib/libs/grpc/src/core/ext/xds/certificate_provider_registry.cc
@@ -1,103 +1,103 @@
-//
-//
-// Copyright 2020 gRPC authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//
-
-#include <grpc/support/port_platform.h>
-
-#include "y_absl/container/inlined_vector.h"
-
-#include "src/core/ext/xds/certificate_provider_registry.h"
-
-namespace grpc_core {
-
-namespace {
-
-class RegistryState {
- public:
- void RegisterCertificateProviderFactory(
- std::unique_ptr<CertificateProviderFactory> factory) {
- gpr_log(GPR_DEBUG, "registering certificate provider factory for \"%s\"",
- factory->name());
- for (size_t i = 0; i < factories_.size(); ++i) {
- GPR_ASSERT(strcmp(factories_[i]->name(), factory->name()) != 0);
- }
- factories_.push_back(std::move(factory));
- }
-
- CertificateProviderFactory* LookupCertificateProviderFactory(
- y_absl::string_view name) const {
- for (size_t i = 0; i < factories_.size(); ++i) {
- if (name == factories_[i]->name()) {
- return factories_[i].get();
- }
- }
- return nullptr;
- }
-
- private:
- // We currently support 3 factories without doing additional
- // allocation. This number could be raised if there is a case where
- // more factories are needed and the additional allocations are
- // hurting performance (which is unlikely, since these allocations
- // only occur at gRPC initialization time).
- y_absl::InlinedVector<std::unique_ptr<CertificateProviderFactory>, 3>
- factories_;
-};
-
-static RegistryState* g_state = nullptr;
-
-} // namespace
-
-//
-// CertificateProviderRegistry
-//
-
-CertificateProviderFactory*
-CertificateProviderRegistry::LookupCertificateProviderFactory(
- y_absl::string_view name) {
- GPR_ASSERT(g_state != nullptr);
- return g_state->LookupCertificateProviderFactory(name);
-}
-
-void CertificateProviderRegistry::InitRegistry() {
- if (g_state == nullptr) g_state = new RegistryState();
-}
-
-void CertificateProviderRegistry::ShutdownRegistry() {
- delete g_state;
- g_state = nullptr;
-}
-
-void CertificateProviderRegistry::RegisterCertificateProviderFactory(
- std::unique_ptr<CertificateProviderFactory> factory) {
- InitRegistry();
- g_state->RegisterCertificateProviderFactory(std::move(factory));
-}
-
-} // namespace grpc_core
-
-//
-// Plugin registration
-//
-
-void grpc_certificate_provider_registry_init() {
- grpc_core::CertificateProviderRegistry::InitRegistry();
-}
-
-void grpc_certificate_provider_registry_shutdown() {
- grpc_core::CertificateProviderRegistry::ShutdownRegistry();
-}
+//
+//
+// Copyright 2020 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+//
+
+#include <grpc/support/port_platform.h>
+
+#include "y_absl/container/inlined_vector.h"
+
+#include "src/core/ext/xds/certificate_provider_registry.h"
+
+namespace grpc_core {
+
+namespace {
+
+class RegistryState {
+ public:
+ void RegisterCertificateProviderFactory(
+ std::unique_ptr<CertificateProviderFactory> factory) {
+ gpr_log(GPR_DEBUG, "registering certificate provider factory for \"%s\"",
+ factory->name());
+ for (size_t i = 0; i < factories_.size(); ++i) {
+ GPR_ASSERT(strcmp(factories_[i]->name(), factory->name()) != 0);
+ }
+ factories_.push_back(std::move(factory));
+ }
+
+ CertificateProviderFactory* LookupCertificateProviderFactory(
+ y_absl::string_view name) const {
+ for (size_t i = 0; i < factories_.size(); ++i) {
+ if (name == factories_[i]->name()) {
+ return factories_[i].get();
+ }
+ }
+ return nullptr;
+ }
+
+ private:
+ // We currently support 3 factories without doing additional
+ // allocation. This number could be raised if there is a case where
+ // more factories are needed and the additional allocations are
+ // hurting performance (which is unlikely, since these allocations
+ // only occur at gRPC initialization time).
+ y_absl::InlinedVector<std::unique_ptr<CertificateProviderFactory>, 3>
+ factories_;
+};
+
+static RegistryState* g_state = nullptr;
+
+} // namespace
+
+//
+// CertificateProviderRegistry
+//
+
+CertificateProviderFactory*
+CertificateProviderRegistry::LookupCertificateProviderFactory(
+ y_absl::string_view name) {
+ GPR_ASSERT(g_state != nullptr);
+ return g_state->LookupCertificateProviderFactory(name);
+}
+
+void CertificateProviderRegistry::InitRegistry() {
+ if (g_state == nullptr) g_state = new RegistryState();
+}
+
+void CertificateProviderRegistry::ShutdownRegistry() {
+ delete g_state;
+ g_state = nullptr;
+}
+
+void CertificateProviderRegistry::RegisterCertificateProviderFactory(
+ std::unique_ptr<CertificateProviderFactory> factory) {
+ InitRegistry();
+ g_state->RegisterCertificateProviderFactory(std::move(factory));
+}
+
+} // namespace grpc_core
+
+//
+// Plugin registration
+//
+
+void grpc_certificate_provider_registry_init() {
+ grpc_core::CertificateProviderRegistry::InitRegistry();
+}
+
+void grpc_certificate_provider_registry_shutdown() {
+ grpc_core::CertificateProviderRegistry::ShutdownRegistry();
+}
diff --git a/contrib/libs/grpc/src/core/ext/xds/certificate_provider_registry.h b/contrib/libs/grpc/src/core/ext/xds/certificate_provider_registry.h
index a45e2b94c77..036c8c58231 100644
--- a/contrib/libs/grpc/src/core/ext/xds/certificate_provider_registry.h
+++ b/contrib/libs/grpc/src/core/ext/xds/certificate_provider_registry.h
@@ -1,57 +1,57 @@
-//
-//
-// Copyright 2020 gRPC authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//
-
-#ifndef GRPC_CORE_EXT_XDS_CERTIFICATE_PROVIDER_REGISTRY_H
-#define GRPC_CORE_EXT_XDS_CERTIFICATE_PROVIDER_REGISTRY_H
-
-#include <grpc/support/port_platform.h>
-
-#include <util/generic/string.h>
-
-#include "src/core/ext/xds/certificate_provider_factory.h"
-
-namespace grpc_core {
-
-// Global registry for all the certificate provider plugins.
-class CertificateProviderRegistry {
- public:
- // Returns the factory for the plugin keyed by name.
- static CertificateProviderFactory* LookupCertificateProviderFactory(
- y_absl::string_view name);
-
- // The following methods are used to create and populate the
- // CertificateProviderRegistry. NOT THREAD SAFE -- to be used only during
- // global gRPC initialization and shutdown.
-
- // Global initialization of the registry.
- static void InitRegistry();
-
- // Global shutdown of the registry.
- static void ShutdownRegistry();
-
- // Register a provider with the registry. Can only be called after calling
- // InitRegistry(). The key of the factory is extracted from factory
- // parameter with method CertificateProviderFactory::name. If the same key
- // is registered twice, an exception is raised.
- static void RegisterCertificateProviderFactory(
- std::unique_ptr<CertificateProviderFactory> factory);
-};
-
-} // namespace grpc_core
-
-#endif // GRPC_CORE_EXT_XDS_CERTIFICATE_PROVIDER_REGISTRY_H
+//
+//
+// Copyright 2020 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+//
+
+#ifndef GRPC_CORE_EXT_XDS_CERTIFICATE_PROVIDER_REGISTRY_H
+#define GRPC_CORE_EXT_XDS_CERTIFICATE_PROVIDER_REGISTRY_H
+
+#include <grpc/support/port_platform.h>
+
+#include <util/generic/string.h>
+
+#include "src/core/ext/xds/certificate_provider_factory.h"
+
+namespace grpc_core {
+
+// Global registry for all the certificate provider plugins.
+class CertificateProviderRegistry {
+ public:
+ // Returns the factory for the plugin keyed by name.
+ static CertificateProviderFactory* LookupCertificateProviderFactory(
+ y_absl::string_view name);
+
+ // The following methods are used to create and populate the
+ // CertificateProviderRegistry. NOT THREAD SAFE -- to be used only during
+ // global gRPC initialization and shutdown.
+
+ // Global initialization of the registry.
+ static void InitRegistry();
+
+ // Global shutdown of the registry.
+ static void ShutdownRegistry();
+
+ // Register a provider with the registry. Can only be called after calling
+ // InitRegistry(). The key of the factory is extracted from factory
+ // parameter with method CertificateProviderFactory::name. If the same key
+ // is registered twice, an exception is raised.
+ static void RegisterCertificateProviderFactory(
+ std::unique_ptr<CertificateProviderFactory> factory);
+};
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_EXT_XDS_CERTIFICATE_PROVIDER_REGISTRY_H
diff --git a/contrib/libs/grpc/src/core/ext/xds/google_mesh_ca_certificate_provider_factory.cc b/contrib/libs/grpc/src/core/ext/xds/google_mesh_ca_certificate_provider_factory.cc
index aa99604a80b..ba927697b37 100644
--- a/contrib/libs/grpc/src/core/ext/xds/google_mesh_ca_certificate_provider_factory.cc
+++ b/contrib/libs/grpc/src/core/ext/xds/google_mesh_ca_certificate_provider_factory.cc
@@ -1,377 +1,377 @@
-//
-//
-// Copyright 2020 gRPC authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//
-
-#include <grpc/support/port_platform.h>
-
-#include "src/core/ext/xds/google_mesh_ca_certificate_provider_factory.h"
-
-#include <sstream>
-#include <type_traits>
-
-#include "y_absl/strings/str_cat.h"
-
-#include <grpc/support/string_util.h>
-
-#include "src/core/lib/gpr/string.h"
-#include "src/core/lib/iomgr/error.h"
-#include "src/core/lib/json/json_util.h"
-
-namespace grpc_core {
-
-namespace {
-
-const char* kMeshCaPlugin = "meshCA";
-
-//
-// Helper functions for extracting types from JSON
-//
-template <typename NumericType, typename ErrorVectorType>
-bool ExtractJsonType(const Json& json, const TString& field_name,
- NumericType* output, ErrorVectorType* error_list) {
- static_assert(std::is_integral<NumericType>::value, "Integral required");
- if (json.type() != Json::Type::NUMBER) {
- error_list->push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("field:", field_name, " error:type should be NUMBER")
- .c_str()));
- return false;
- }
- std::istringstream ss(json.string_value());
- ss >> *output;
- // The JSON parsing API should have dealt with parsing errors, but check
- // anyway
- if (GPR_UNLIKELY(ss.bad())) {
- error_list->push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("field:", field_name, " error:failed to parse.").c_str()));
- return false;
- }
- return true;
-}
-
-template <typename ErrorVectorType>
-bool ExtractJsonType(const Json& json, const TString& field_name,
- bool* output, ErrorVectorType* error_list) {
- switch (json.type()) {
- case Json::Type::JSON_TRUE:
- *output = true;
- return true;
- case Json::Type::JSON_FALSE:
- *output = false;
- return true;
- default:
- error_list->push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("field:", field_name, " error:type should be BOOLEAN")
- .c_str()));
- return false;
- }
-}
-
-template <typename ErrorVectorType>
-bool ExtractJsonType(const Json& json, const TString& field_name,
- TString* output, ErrorVectorType* error_list) {
- if (json.type() != Json::Type::STRING) {
- *output = "";
- error_list->push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("field:", field_name, " error:type should be STRING")
- .c_str()));
- return false;
- }
- *output = json.string_value();
- return true;
-}
-
-template <typename ErrorVectorType>
-bool ExtractJsonType(const Json& json, const TString& field_name,
- const Json::Array** output, ErrorVectorType* error_list) {
- if (json.type() != Json::Type::ARRAY) {
- *output = nullptr;
- error_list->push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("field:", field_name, " error:type should be ARRAY")
- .c_str()));
- return false;
- }
- *output = &json.array_value();
- return true;
-}
-
-template <typename ErrorVectorType>
-bool ExtractJsonType(const Json& json, const TString& field_name,
- const Json::Object** output, ErrorVectorType* error_list) {
- if (json.type() != Json::Type::OBJECT) {
- *output = nullptr;
- error_list->push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("field:", field_name, " error:type should be OBJECT")
- .c_str()));
- return false;
- }
- *output = &json.object_value();
- return true;
-}
-
-template <typename ErrorVectorType>
-bool ExtractJsonType(const Json& json, const TString& field_name,
- grpc_millis* output, ErrorVectorType* error_list) {
- if (!ParseDurationFromJson(json, output)) {
- *output = GRPC_MILLIS_INF_PAST;
- error_list->push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("field:", field_name,
- " error:type should be STRING of the form given by "
- "google.proto.Duration.")
- .c_str()));
- return false;
- }
- return true;
-}
-
-template <typename T, typename ErrorVectorType>
-bool ParseJsonObjectField(const Json::Object& object,
- const TString& field_name, T* output,
- ErrorVectorType* error_list, bool optional = false) {
- auto it = object.find(field_name);
- if (it == object.end()) {
- if (!optional) {
- error_list->push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("field:", field_name, " error:does not exist.")
- .c_str()));
- }
- return false;
- }
- auto& child_object_json = it->second;
- return ExtractJsonType(child_object_json, field_name, output, error_list);
-}
-
-} // namespace
-
-//
-// GoogleMeshCaCertificateProviderFactory::Config
-//
-
-const char* GoogleMeshCaCertificateProviderFactory::Config::name() const {
- return kMeshCaPlugin;
-}
-
-std::vector<grpc_error*>
-GoogleMeshCaCertificateProviderFactory::Config::ParseJsonObjectStsService(
- const Json::Object& sts_service) {
- std::vector<grpc_error*> error_list_sts_service;
- if (!ParseJsonObjectField(sts_service, "token_exchange_service_uri",
- &sts_config_.token_exchange_service_uri,
- &error_list_sts_service, true)) {
- sts_config_.token_exchange_service_uri =
- "securetoken.googleapis.com"; // default
- }
- ParseJsonObjectField(sts_service, "resource", &sts_config_.resource,
- &error_list_sts_service, true);
- ParseJsonObjectField(sts_service, "audience", &sts_config_.audience,
- &error_list_sts_service, true);
- if (!ParseJsonObjectField(sts_service, "scope", &sts_config_.scope,
- &error_list_sts_service, true)) {
- sts_config_.scope =
- "https://www.googleapis.com/auth/cloud-platform"; // default
- }
- ParseJsonObjectField(sts_service, "requested_token_type",
- &sts_config_.requested_token_type,
- &error_list_sts_service, true);
- ParseJsonObjectField(sts_service, "subject_token_path",
- &sts_config_.subject_token_path,
- &error_list_sts_service);
- ParseJsonObjectField(sts_service, "subject_token_type",
- &sts_config_.subject_token_type,
- &error_list_sts_service);
- ParseJsonObjectField(sts_service, "actor_token_path",
- &sts_config_.actor_token_path, &error_list_sts_service,
- true);
- ParseJsonObjectField(sts_service, "actor_token_type",
- &sts_config_.actor_token_type, &error_list_sts_service,
- true);
- return error_list_sts_service;
-}
-
-std::vector<grpc_error*>
-GoogleMeshCaCertificateProviderFactory::Config::ParseJsonObjectCallCredentials(
- const Json::Object& call_credentials) {
- std::vector<grpc_error*> error_list_call_credentials;
- const Json::Object* sts_service = nullptr;
- if (ParseJsonObjectField(call_credentials, "sts_service", &sts_service,
- &error_list_call_credentials)) {
- std::vector<grpc_error*> error_list_sts_service =
- ParseJsonObjectStsService(*sts_service);
- if (!error_list_sts_service.empty()) {
- error_list_call_credentials.push_back(GRPC_ERROR_CREATE_FROM_VECTOR(
- "field:sts_service", &error_list_sts_service));
- }
- }
- return error_list_call_credentials;
-}
-
-std::vector<grpc_error*>
-GoogleMeshCaCertificateProviderFactory::Config::ParseJsonObjectGoogleGrpc(
- const Json::Object& google_grpc) {
- std::vector<grpc_error*> error_list_google_grpc;
- if (!ParseJsonObjectField(google_grpc, "target_uri", &endpoint_,
- &error_list_google_grpc, true)) {
- endpoint_ = "meshca.googleapis.com"; // Default target
- }
- const Json::Array* call_credentials_array = nullptr;
- if (ParseJsonObjectField(google_grpc, "call_credentials",
- &call_credentials_array, &error_list_google_grpc)) {
- if (call_credentials_array->size() != 1) {
- error_list_google_grpc.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:call_credentials error:Need exactly one entry."));
- } else {
- const Json::Object* call_credentials = nullptr;
- if (ExtractJsonType((*call_credentials_array)[0], "call_credentials[0]",
- &call_credentials, &error_list_google_grpc)) {
- std::vector<grpc_error*> error_list_call_credentials =
- ParseJsonObjectCallCredentials(*call_credentials);
- if (!error_list_call_credentials.empty()) {
- error_list_google_grpc.push_back(GRPC_ERROR_CREATE_FROM_VECTOR(
- "field:call_credentials", &error_list_call_credentials));
- }
- }
- }
- }
-
- return error_list_google_grpc;
-}
-
-std::vector<grpc_error*>
-GoogleMeshCaCertificateProviderFactory::Config::ParseJsonObjectGrpcServices(
- const Json::Object& grpc_service) {
- std::vector<grpc_error*> error_list_grpc_services;
- const Json::Object* google_grpc = nullptr;
- if (ParseJsonObjectField(grpc_service, "google_grpc", &google_grpc,
- &error_list_grpc_services)) {
- std::vector<grpc_error*> error_list_google_grpc =
- ParseJsonObjectGoogleGrpc(*google_grpc);
- if (!error_list_google_grpc.empty()) {
- error_list_grpc_services.push_back(GRPC_ERROR_CREATE_FROM_VECTOR(
- "field:google_grpc", &error_list_google_grpc));
- }
- }
- if (!ParseJsonObjectField(grpc_service, "timeout", &timeout_,
- &error_list_grpc_services, true)) {
- timeout_ = 10 * 1000; // 10sec default
- }
- return error_list_grpc_services;
-}
-
-std::vector<grpc_error*>
-GoogleMeshCaCertificateProviderFactory::Config::ParseJsonObjectServer(
- const Json::Object& server) {
- std::vector<grpc_error*> error_list_server;
- TString api_type;
- if (ParseJsonObjectField(server, "api_type", &api_type, &error_list_server,
- true)) {
- if (api_type != "GRPC") {
- error_list_server.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:api_type error:Only GRPC is supported"));
- }
- }
- const Json::Array* grpc_services = nullptr;
- if (ParseJsonObjectField(server, "grpc_services", &grpc_services,
- &error_list_server)) {
- if (grpc_services->size() != 1) {
- error_list_server.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:grpc_services error:Need exactly one entry"));
- } else {
- const Json::Object* grpc_service = nullptr;
- if (ExtractJsonType((*grpc_services)[0], "grpc_services[0]",
- &grpc_service, &error_list_server)) {
- std::vector<grpc_error*> error_list_grpc_services =
- ParseJsonObjectGrpcServices(*grpc_service);
- if (!error_list_grpc_services.empty()) {
- error_list_server.push_back(GRPC_ERROR_CREATE_FROM_VECTOR(
- "field:grpc_services", &error_list_grpc_services));
- }
- }
- }
- }
- return error_list_server;
-}
-
-std::unique_ptr<GoogleMeshCaCertificateProviderFactory::Config>
-GoogleMeshCaCertificateProviderFactory::Config::Parse(const Json& config_json,
- grpc_error** error) {
- auto config =
- y_absl::make_unique<GoogleMeshCaCertificateProviderFactory::Config>();
- if (config_json.type() != Json::Type::OBJECT) {
- *error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "error:config type should be OBJECT.");
- return nullptr;
- }
- std::vector<grpc_error*> error_list;
- const Json::Object* server = nullptr;
- if (ParseJsonObjectField(config_json.object_value(), "server", &server,
- &error_list)) {
- std::vector<grpc_error*> error_list_server =
- config->ParseJsonObjectServer(*server);
- if (!error_list_server.empty()) {
- error_list.push_back(
- GRPC_ERROR_CREATE_FROM_VECTOR("field:server", &error_list_server));
- }
- }
- if (!ParseJsonObjectField(config_json.object_value(), "certificate_lifetime",
- &config->certificate_lifetime_, &error_list,
- true)) {
- config->certificate_lifetime_ = 24 * 60 * 60 * 1000; // 24hrs default
- }
- if (!ParseJsonObjectField(config_json.object_value(), "renewal_grace_period",
- &config->renewal_grace_period_, &error_list,
- true)) {
- config->renewal_grace_period_ = 12 * 60 * 60 * 1000; // 12hrs default
- }
- TString key_type;
- if (ParseJsonObjectField(config_json.object_value(), "key_type", &key_type,
- &error_list, true)) {
- if (key_type != "RSA") {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:key_type error:Only RSA is supported."));
- }
- }
- if (!ParseJsonObjectField(config_json.object_value(), "key_size",
- &config->key_size_, &error_list, true)) {
- config->key_size_ = 2048; // default 2048 bit key size
- }
- if (!ParseJsonObjectField(config_json.object_value(), "location",
- &config->location_, &error_list, true)) {
- // GCE/GKE Metadata server needs to be contacted to get the value.
- }
- if (!error_list.empty()) {
- *error = GRPC_ERROR_CREATE_FROM_VECTOR(
- "Error parsing google Mesh CA config", &error_list);
- return nullptr;
- }
- return config;
-}
-
-//
-// GoogleMeshCaCertificateProviderFactory
-//
-
-const char* GoogleMeshCaCertificateProviderFactory::name() const {
- return kMeshCaPlugin;
-}
-
-std::unique_ptr<CertificateProviderFactory::Config>
-GoogleMeshCaCertificateProviderFactory::CreateCertificateProviderConfig(
- const Json& config_json, grpc_error** error) {
- return GoogleMeshCaCertificateProviderFactory::Config::Parse(config_json,
- error);
-}
-
-} // namespace grpc_core
+//
+//
+// Copyright 2020 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+//
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/ext/xds/google_mesh_ca_certificate_provider_factory.h"
+
+#include <sstream>
+#include <type_traits>
+
+#include "y_absl/strings/str_cat.h"
+
+#include <grpc/support/string_util.h>
+
+#include "src/core/lib/gpr/string.h"
+#include "src/core/lib/iomgr/error.h"
+#include "src/core/lib/json/json_util.h"
+
+namespace grpc_core {
+
+namespace {
+
+const char* kMeshCaPlugin = "meshCA";
+
+//
+// Helper functions for extracting types from JSON
+//
+template <typename NumericType, typename ErrorVectorType>
+bool ExtractJsonType(const Json& json, const TString& field_name,
+ NumericType* output, ErrorVectorType* error_list) {
+ static_assert(std::is_integral<NumericType>::value, "Integral required");
+ if (json.type() != Json::Type::NUMBER) {
+ error_list->push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrCat("field:", field_name, " error:type should be NUMBER")
+ .c_str()));
+ return false;
+ }
+ std::istringstream ss(json.string_value());
+ ss >> *output;
+ // The JSON parsing API should have dealt with parsing errors, but check
+ // anyway
+ if (GPR_UNLIKELY(ss.bad())) {
+ error_list->push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrCat("field:", field_name, " error:failed to parse.").c_str()));
+ return false;
+ }
+ return true;
+}
+
+template <typename ErrorVectorType>
+bool ExtractJsonType(const Json& json, const TString& field_name,
+ bool* output, ErrorVectorType* error_list) {
+ switch (json.type()) {
+ case Json::Type::JSON_TRUE:
+ *output = true;
+ return true;
+ case Json::Type::JSON_FALSE:
+ *output = false;
+ return true;
+ default:
+ error_list->push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrCat("field:", field_name, " error:type should be BOOLEAN")
+ .c_str()));
+ return false;
+ }
+}
+
+template <typename ErrorVectorType>
+bool ExtractJsonType(const Json& json, const TString& field_name,
+ TString* output, ErrorVectorType* error_list) {
+ if (json.type() != Json::Type::STRING) {
+ *output = "";
+ error_list->push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrCat("field:", field_name, " error:type should be STRING")
+ .c_str()));
+ return false;
+ }
+ *output = json.string_value();
+ return true;
+}
+
+template <typename ErrorVectorType>
+bool ExtractJsonType(const Json& json, const TString& field_name,
+ const Json::Array** output, ErrorVectorType* error_list) {
+ if (json.type() != Json::Type::ARRAY) {
+ *output = nullptr;
+ error_list->push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrCat("field:", field_name, " error:type should be ARRAY")
+ .c_str()));
+ return false;
+ }
+ *output = &json.array_value();
+ return true;
+}
+
+template <typename ErrorVectorType>
+bool ExtractJsonType(const Json& json, const TString& field_name,
+ const Json::Object** output, ErrorVectorType* error_list) {
+ if (json.type() != Json::Type::OBJECT) {
+ *output = nullptr;
+ error_list->push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrCat("field:", field_name, " error:type should be OBJECT")
+ .c_str()));
+ return false;
+ }
+ *output = &json.object_value();
+ return true;
+}
+
+template <typename ErrorVectorType>
+bool ExtractJsonType(const Json& json, const TString& field_name,
+ grpc_millis* output, ErrorVectorType* error_list) {
+ if (!ParseDurationFromJson(json, output)) {
+ *output = GRPC_MILLIS_INF_PAST;
+ error_list->push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrCat("field:", field_name,
+ " error:type should be STRING of the form given by "
+ "google.proto.Duration.")
+ .c_str()));
+ return false;
+ }
+ return true;
+}
+
+template <typename T, typename ErrorVectorType>
+bool ParseJsonObjectField(const Json::Object& object,
+ const TString& field_name, T* output,
+ ErrorVectorType* error_list, bool optional = false) {
+ auto it = object.find(field_name);
+ if (it == object.end()) {
+ if (!optional) {
+ error_list->push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrCat("field:", field_name, " error:does not exist.")
+ .c_str()));
+ }
+ return false;
+ }
+ auto& child_object_json = it->second;
+ return ExtractJsonType(child_object_json, field_name, output, error_list);
+}
+
+} // namespace
+
+//
+// GoogleMeshCaCertificateProviderFactory::Config
+//
+
+const char* GoogleMeshCaCertificateProviderFactory::Config::name() const {
+ return kMeshCaPlugin;
+}
+
+std::vector<grpc_error*>
+GoogleMeshCaCertificateProviderFactory::Config::ParseJsonObjectStsService(
+ const Json::Object& sts_service) {
+ std::vector<grpc_error*> error_list_sts_service;
+ if (!ParseJsonObjectField(sts_service, "token_exchange_service_uri",
+ &sts_config_.token_exchange_service_uri,
+ &error_list_sts_service, true)) {
+ sts_config_.token_exchange_service_uri =
+ "securetoken.googleapis.com"; // default
+ }
+ ParseJsonObjectField(sts_service, "resource", &sts_config_.resource,
+ &error_list_sts_service, true);
+ ParseJsonObjectField(sts_service, "audience", &sts_config_.audience,
+ &error_list_sts_service, true);
+ if (!ParseJsonObjectField(sts_service, "scope", &sts_config_.scope,
+ &error_list_sts_service, true)) {
+ sts_config_.scope =
+ "https://www.googleapis.com/auth/cloud-platform"; // default
+ }
+ ParseJsonObjectField(sts_service, "requested_token_type",
+ &sts_config_.requested_token_type,
+ &error_list_sts_service, true);
+ ParseJsonObjectField(sts_service, "subject_token_path",
+ &sts_config_.subject_token_path,
+ &error_list_sts_service);
+ ParseJsonObjectField(sts_service, "subject_token_type",
+ &sts_config_.subject_token_type,
+ &error_list_sts_service);
+ ParseJsonObjectField(sts_service, "actor_token_path",
+ &sts_config_.actor_token_path, &error_list_sts_service,
+ true);
+ ParseJsonObjectField(sts_service, "actor_token_type",
+ &sts_config_.actor_token_type, &error_list_sts_service,
+ true);
+ return error_list_sts_service;
+}
+
+std::vector<grpc_error*>
+GoogleMeshCaCertificateProviderFactory::Config::ParseJsonObjectCallCredentials(
+ const Json::Object& call_credentials) {
+ std::vector<grpc_error*> error_list_call_credentials;
+ const Json::Object* sts_service = nullptr;
+ if (ParseJsonObjectField(call_credentials, "sts_service", &sts_service,
+ &error_list_call_credentials)) {
+ std::vector<grpc_error*> error_list_sts_service =
+ ParseJsonObjectStsService(*sts_service);
+ if (!error_list_sts_service.empty()) {
+ error_list_call_credentials.push_back(GRPC_ERROR_CREATE_FROM_VECTOR(
+ "field:sts_service", &error_list_sts_service));
+ }
+ }
+ return error_list_call_credentials;
+}
+
+std::vector<grpc_error*>
+GoogleMeshCaCertificateProviderFactory::Config::ParseJsonObjectGoogleGrpc(
+ const Json::Object& google_grpc) {
+ std::vector<grpc_error*> error_list_google_grpc;
+ if (!ParseJsonObjectField(google_grpc, "target_uri", &endpoint_,
+ &error_list_google_grpc, true)) {
+ endpoint_ = "meshca.googleapis.com"; // Default target
+ }
+ const Json::Array* call_credentials_array = nullptr;
+ if (ParseJsonObjectField(google_grpc, "call_credentials",
+ &call_credentials_array, &error_list_google_grpc)) {
+ if (call_credentials_array->size() != 1) {
+ error_list_google_grpc.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:call_credentials error:Need exactly one entry."));
+ } else {
+ const Json::Object* call_credentials = nullptr;
+ if (ExtractJsonType((*call_credentials_array)[0], "call_credentials[0]",
+ &call_credentials, &error_list_google_grpc)) {
+ std::vector<grpc_error*> error_list_call_credentials =
+ ParseJsonObjectCallCredentials(*call_credentials);
+ if (!error_list_call_credentials.empty()) {
+ error_list_google_grpc.push_back(GRPC_ERROR_CREATE_FROM_VECTOR(
+ "field:call_credentials", &error_list_call_credentials));
+ }
+ }
+ }
+ }
+
+ return error_list_google_grpc;
+}
+
+std::vector<grpc_error*>
+GoogleMeshCaCertificateProviderFactory::Config::ParseJsonObjectGrpcServices(
+ const Json::Object& grpc_service) {
+ std::vector<grpc_error*> error_list_grpc_services;
+ const Json::Object* google_grpc = nullptr;
+ if (ParseJsonObjectField(grpc_service, "google_grpc", &google_grpc,
+ &error_list_grpc_services)) {
+ std::vector<grpc_error*> error_list_google_grpc =
+ ParseJsonObjectGoogleGrpc(*google_grpc);
+ if (!error_list_google_grpc.empty()) {
+ error_list_grpc_services.push_back(GRPC_ERROR_CREATE_FROM_VECTOR(
+ "field:google_grpc", &error_list_google_grpc));
+ }
+ }
+ if (!ParseJsonObjectField(grpc_service, "timeout", &timeout_,
+ &error_list_grpc_services, true)) {
+ timeout_ = 10 * 1000; // 10sec default
+ }
+ return error_list_grpc_services;
+}
+
+std::vector<grpc_error*>
+GoogleMeshCaCertificateProviderFactory::Config::ParseJsonObjectServer(
+ const Json::Object& server) {
+ std::vector<grpc_error*> error_list_server;
+ TString api_type;
+ if (ParseJsonObjectField(server, "api_type", &api_type, &error_list_server,
+ true)) {
+ if (api_type != "GRPC") {
+ error_list_server.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:api_type error:Only GRPC is supported"));
+ }
+ }
+ const Json::Array* grpc_services = nullptr;
+ if (ParseJsonObjectField(server, "grpc_services", &grpc_services,
+ &error_list_server)) {
+ if (grpc_services->size() != 1) {
+ error_list_server.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:grpc_services error:Need exactly one entry"));
+ } else {
+ const Json::Object* grpc_service = nullptr;
+ if (ExtractJsonType((*grpc_services)[0], "grpc_services[0]",
+ &grpc_service, &error_list_server)) {
+ std::vector<grpc_error*> error_list_grpc_services =
+ ParseJsonObjectGrpcServices(*grpc_service);
+ if (!error_list_grpc_services.empty()) {
+ error_list_server.push_back(GRPC_ERROR_CREATE_FROM_VECTOR(
+ "field:grpc_services", &error_list_grpc_services));
+ }
+ }
+ }
+ }
+ return error_list_server;
+}
+
+std::unique_ptr<GoogleMeshCaCertificateProviderFactory::Config>
+GoogleMeshCaCertificateProviderFactory::Config::Parse(const Json& config_json,
+ grpc_error** error) {
+ auto config =
+ y_absl::make_unique<GoogleMeshCaCertificateProviderFactory::Config>();
+ if (config_json.type() != Json::Type::OBJECT) {
+ *error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "error:config type should be OBJECT.");
+ return nullptr;
+ }
+ std::vector<grpc_error*> error_list;
+ const Json::Object* server = nullptr;
+ if (ParseJsonObjectField(config_json.object_value(), "server", &server,
+ &error_list)) {
+ std::vector<grpc_error*> error_list_server =
+ config->ParseJsonObjectServer(*server);
+ if (!error_list_server.empty()) {
+ error_list.push_back(
+ GRPC_ERROR_CREATE_FROM_VECTOR("field:server", &error_list_server));
+ }
+ }
+ if (!ParseJsonObjectField(config_json.object_value(), "certificate_lifetime",
+ &config->certificate_lifetime_, &error_list,
+ true)) {
+ config->certificate_lifetime_ = 24 * 60 * 60 * 1000; // 24hrs default
+ }
+ if (!ParseJsonObjectField(config_json.object_value(), "renewal_grace_period",
+ &config->renewal_grace_period_, &error_list,
+ true)) {
+ config->renewal_grace_period_ = 12 * 60 * 60 * 1000; // 12hrs default
+ }
+ TString key_type;
+ if (ParseJsonObjectField(config_json.object_value(), "key_type", &key_type,
+ &error_list, true)) {
+ if (key_type != "RSA") {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:key_type error:Only RSA is supported."));
+ }
+ }
+ if (!ParseJsonObjectField(config_json.object_value(), "key_size",
+ &config->key_size_, &error_list, true)) {
+ config->key_size_ = 2048; // default 2048 bit key size
+ }
+ if (!ParseJsonObjectField(config_json.object_value(), "location",
+ &config->location_, &error_list, true)) {
+ // GCE/GKE Metadata server needs to be contacted to get the value.
+ }
+ if (!error_list.empty()) {
+ *error = GRPC_ERROR_CREATE_FROM_VECTOR(
+ "Error parsing google Mesh CA config", &error_list);
+ return nullptr;
+ }
+ return config;
+}
+
+//
+// GoogleMeshCaCertificateProviderFactory
+//
+
+const char* GoogleMeshCaCertificateProviderFactory::name() const {
+ return kMeshCaPlugin;
+}
+
+std::unique_ptr<CertificateProviderFactory::Config>
+GoogleMeshCaCertificateProviderFactory::CreateCertificateProviderConfig(
+ const Json& config_json, grpc_error** error) {
+ return GoogleMeshCaCertificateProviderFactory::Config::Parse(config_json,
+ error);
+}
+
+} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/ext/xds/google_mesh_ca_certificate_provider_factory.h b/contrib/libs/grpc/src/core/ext/xds/google_mesh_ca_certificate_provider_factory.h
index 840db549aae..fe256747367 100644
--- a/contrib/libs/grpc/src/core/ext/xds/google_mesh_ca_certificate_provider_factory.h
+++ b/contrib/libs/grpc/src/core/ext/xds/google_mesh_ca_certificate_provider_factory.h
@@ -1,102 +1,102 @@
-//
-//
-// Copyright 2020 gRPC authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//
-
-#ifndef GRPC_CORE_EXT_XDS_GOOGLE_MESH_CA_CERTIFICATE_PROVIDER_FACTORY_H
-#define GRPC_CORE_EXT_XDS_GOOGLE_MESH_CA_CERTIFICATE_PROVIDER_FACTORY_H
-
-#include <grpc/support/port_platform.h>
-
-#include "src/core/ext/xds/certificate_provider_factory.h"
-#include "src/core/lib/backoff/backoff.h"
-#include "src/core/lib/gprpp/ref_counted.h"
-
-namespace grpc_core {
-
-class GoogleMeshCaCertificateProviderFactory
- : public CertificateProviderFactory {
- public:
- class Config : public CertificateProviderFactory::Config {
- public:
- struct StsConfig {
- TString token_exchange_service_uri;
- TString resource;
- TString audience;
- TString scope;
- TString requested_token_type;
- TString subject_token_path;
- TString subject_token_type;
- TString actor_token_path;
- TString actor_token_type;
- };
-
- const char* name() const override;
-
- const TString& endpoint() const { return endpoint_; }
-
- const StsConfig& sts_config() const { return sts_config_; }
-
- grpc_millis timeout() const { return timeout_; }
-
- grpc_millis certificate_lifetime() const { return certificate_lifetime_; }
-
- grpc_millis renewal_grace_period() const { return renewal_grace_period_; }
-
- uint32_t key_size() const { return key_size_; }
-
- const TString& location() const { return location_; }
-
- static std::unique_ptr<Config> Parse(const Json& config_json,
- grpc_error** error);
-
- private:
- // Helpers for parsing the config
- std::vector<grpc_error*> ParseJsonObjectStsService(
- const Json::Object& sts_service);
- std::vector<grpc_error*> ParseJsonObjectCallCredentials(
- const Json::Object& call_credentials);
- std::vector<grpc_error*> ParseJsonObjectGoogleGrpc(
- const Json::Object& google_grpc);
- std::vector<grpc_error*> ParseJsonObjectGrpcServices(
- const Json::Object& grpc_service);
- std::vector<grpc_error*> ParseJsonObjectServer(const Json::Object& server);
-
- TString endpoint_;
- StsConfig sts_config_;
- grpc_millis timeout_;
- grpc_millis certificate_lifetime_;
- grpc_millis renewal_grace_period_;
- uint32_t key_size_;
- TString location_;
- };
-
- const char* name() const override;
-
- std::unique_ptr<CertificateProviderFactory::Config>
- CreateCertificateProviderConfig(const Json& config_json,
- grpc_error** error) override;
-
- RefCountedPtr<grpc_tls_certificate_provider> CreateCertificateProvider(
- std::unique_ptr<CertificateProviderFactory::Config> config) override {
- // TODO(yashykt) : To be implemented
- return nullptr;
- }
-};
-
-} // namespace grpc_core
-
-#endif // GRPC_CORE_EXT_XDS_GOOGLE_MESH_CA_CERTIFICATE_PROVIDER_FACTORY_H
+//
+//
+// Copyright 2020 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+//
+
+#ifndef GRPC_CORE_EXT_XDS_GOOGLE_MESH_CA_CERTIFICATE_PROVIDER_FACTORY_H
+#define GRPC_CORE_EXT_XDS_GOOGLE_MESH_CA_CERTIFICATE_PROVIDER_FACTORY_H
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/ext/xds/certificate_provider_factory.h"
+#include "src/core/lib/backoff/backoff.h"
+#include "src/core/lib/gprpp/ref_counted.h"
+
+namespace grpc_core {
+
+class GoogleMeshCaCertificateProviderFactory
+ : public CertificateProviderFactory {
+ public:
+ class Config : public CertificateProviderFactory::Config {
+ public:
+ struct StsConfig {
+ TString token_exchange_service_uri;
+ TString resource;
+ TString audience;
+ TString scope;
+ TString requested_token_type;
+ TString subject_token_path;
+ TString subject_token_type;
+ TString actor_token_path;
+ TString actor_token_type;
+ };
+
+ const char* name() const override;
+
+ const TString& endpoint() const { return endpoint_; }
+
+ const StsConfig& sts_config() const { return sts_config_; }
+
+ grpc_millis timeout() const { return timeout_; }
+
+ grpc_millis certificate_lifetime() const { return certificate_lifetime_; }
+
+ grpc_millis renewal_grace_period() const { return renewal_grace_period_; }
+
+ uint32_t key_size() const { return key_size_; }
+
+ const TString& location() const { return location_; }
+
+ static std::unique_ptr<Config> Parse(const Json& config_json,
+ grpc_error** error);
+
+ private:
+ // Helpers for parsing the config
+ std::vector<grpc_error*> ParseJsonObjectStsService(
+ const Json::Object& sts_service);
+ std::vector<grpc_error*> ParseJsonObjectCallCredentials(
+ const Json::Object& call_credentials);
+ std::vector<grpc_error*> ParseJsonObjectGoogleGrpc(
+ const Json::Object& google_grpc);
+ std::vector<grpc_error*> ParseJsonObjectGrpcServices(
+ const Json::Object& grpc_service);
+ std::vector<grpc_error*> ParseJsonObjectServer(const Json::Object& server);
+
+ TString endpoint_;
+ StsConfig sts_config_;
+ grpc_millis timeout_;
+ grpc_millis certificate_lifetime_;
+ grpc_millis renewal_grace_period_;
+ uint32_t key_size_;
+ TString location_;
+ };
+
+ const char* name() const override;
+
+ std::unique_ptr<CertificateProviderFactory::Config>
+ CreateCertificateProviderConfig(const Json& config_json,
+ grpc_error** error) override;
+
+ RefCountedPtr<grpc_tls_certificate_provider> CreateCertificateProvider(
+ std::unique_ptr<CertificateProviderFactory::Config> config) override {
+ // TODO(yashykt) : To be implemented
+ return nullptr;
+ }
+};
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_EXT_XDS_GOOGLE_MESH_CA_CERTIFICATE_PROVIDER_FACTORY_H
diff --git a/contrib/libs/grpc/src/core/ext/xds/xds_api.cc b/contrib/libs/grpc/src/core/ext/xds/xds_api.cc
index 4f666b36b38..1abaf15f01f 100644
--- a/contrib/libs/grpc/src/core/ext/xds/xds_api.cc
+++ b/contrib/libs/grpc/src/core/ext/xds/xds_api.cc
@@ -1,2596 +1,2596 @@
-/*
- *
- * Copyright 2018 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <grpc/support/port_platform.h>
-
-#include <algorithm>
-#include <cctype>
-#include <cstdint>
-#include <cstdlib>
-#include <util/generic/string.h>
-
-#include "y_absl/strings/str_cat.h"
-#include "y_absl/strings/str_format.h"
-#include "y_absl/strings/str_join.h"
-#include "y_absl/strings/str_split.h"
-
-#include "upb/upb.hpp"
-
-#include <grpc/impl/codegen/log.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/string_util.h>
-
-#include "src/core/ext/xds/xds_api.h"
-#include "src/core/lib/gpr/env.h"
-#include "src/core/lib/gpr/string.h"
-#include "src/core/lib/gpr/useful.h"
-#include "src/core/lib/iomgr/error.h"
-#include "src/core/lib/iomgr/sockaddr_utils.h"
-
-#include "envoy/config/cluster/v3/circuit_breaker.upb.h"
-#include "envoy/config/cluster/v3/cluster.upb.h"
-#include "envoy/config/core/v3/address.upb.h"
-#include "envoy/config/core/v3/base.upb.h"
-#include "envoy/config/core/v3/config_source.upb.h"
-#include "envoy/config/core/v3/health_check.upb.h"
-#include "envoy/config/endpoint/v3/endpoint.upb.h"
-#include "envoy/config/endpoint/v3/endpoint_components.upb.h"
-#include "envoy/config/endpoint/v3/load_report.upb.h"
-#include "envoy/config/listener/v3/api_listener.upb.h"
-#include "envoy/config/listener/v3/listener.upb.h"
-#include "envoy/config/route/v3/route.upb.h"
-#include "envoy/config/route/v3/route_components.upb.h"
-#include "envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h"
-#include "envoy/extensions/transport_sockets/tls/v3/common.upb.h"
-#include "envoy/extensions/transport_sockets/tls/v3/tls.upb.h"
-#include "envoy/service/cluster/v3/cds.upb.h"
-#include "envoy/service/discovery/v3/discovery.upb.h"
-#include "envoy/service/endpoint/v3/eds.upb.h"
-#include "envoy/service/listener/v3/lds.upb.h"
-#include "envoy/service/load_stats/v3/lrs.upb.h"
-#include "envoy/service/route/v3/rds.upb.h"
-#include "envoy/type/matcher/v3/regex.upb.h"
-#include "envoy/type/matcher/v3/string.upb.h"
-#include "envoy/type/v3/percent.upb.h"
-#include "envoy/type/v3/range.upb.h"
-#include "google/protobuf/any.upb.h"
-#include "google/protobuf/duration.upb.h"
-#include "google/protobuf/struct.upb.h"
-#include "google/protobuf/wrappers.upb.h"
-#include "google/rpc/status.upb.h"
-#include "upb/upb.h"
-
-namespace grpc_core {
-
-//
-// XdsApi::Route::Matchers::PathMatcher
-//
-
-XdsApi::Route::Matchers::PathMatcher::PathMatcher(const PathMatcher& other)
- : type(other.type) {
- if (type == PathMatcherType::REGEX) {
- regex_matcher = y_absl::make_unique<RE2>(other.regex_matcher->pattern());
- } else {
- string_matcher = other.string_matcher;
- }
-}
-
-XdsApi::Route::Matchers::PathMatcher& XdsApi::Route::Matchers::PathMatcher::
-operator=(const PathMatcher& other) {
- type = other.type;
- if (type == PathMatcherType::REGEX) {
- regex_matcher = y_absl::make_unique<RE2>(other.regex_matcher->pattern());
- } else {
- string_matcher = other.string_matcher;
- }
- return *this;
-}
-
-bool XdsApi::Route::Matchers::PathMatcher::operator==(
- const PathMatcher& other) const {
- if (type != other.type) return false;
- if (type == PathMatcherType::REGEX) {
- // Should never be null.
- if (regex_matcher == nullptr || other.regex_matcher == nullptr) {
- return false;
- }
- return regex_matcher->pattern() == other.regex_matcher->pattern();
- }
- return string_matcher == other.string_matcher;
-}
-
-TString XdsApi::Route::Matchers::PathMatcher::ToString() const {
- TString path_type_string;
- switch (type) {
- case PathMatcherType::PATH:
- path_type_string = "path match";
- break;
- case PathMatcherType::PREFIX:
- path_type_string = "prefix match";
- break;
- case PathMatcherType::REGEX:
- path_type_string = "regex match";
- break;
- default:
- break;
- }
- return y_absl::StrFormat("Path %s:%s", path_type_string,
- type == PathMatcherType::REGEX
- ? regex_matcher->pattern()
- : string_matcher);
-}
-
-//
-// XdsApi::Route::Matchers::HeaderMatcher
-//
-
-XdsApi::Route::Matchers::HeaderMatcher::HeaderMatcher(
- const HeaderMatcher& other)
- : name(other.name), type(other.type), invert_match(other.invert_match) {
- switch (type) {
- case HeaderMatcherType::REGEX:
- regex_match = y_absl::make_unique<RE2>(other.regex_match->pattern());
- break;
- case HeaderMatcherType::RANGE:
- range_start = other.range_start;
- range_end = other.range_end;
- break;
- case HeaderMatcherType::PRESENT:
- present_match = other.present_match;
- break;
- default:
- string_matcher = other.string_matcher;
- }
-}
-
-XdsApi::Route::Matchers::HeaderMatcher& XdsApi::Route::Matchers::HeaderMatcher::
-operator=(const HeaderMatcher& other) {
- name = other.name;
- type = other.type;
- invert_match = other.invert_match;
- switch (type) {
- case HeaderMatcherType::REGEX:
- regex_match = y_absl::make_unique<RE2>(other.regex_match->pattern());
- break;
- case HeaderMatcherType::RANGE:
- range_start = other.range_start;
- range_end = other.range_end;
- break;
- case HeaderMatcherType::PRESENT:
- present_match = other.present_match;
- break;
- default:
- string_matcher = other.string_matcher;
- }
- return *this;
-}
-
-bool XdsApi::Route::Matchers::HeaderMatcher::operator==(
- const HeaderMatcher& other) const {
- if (name != other.name) return false;
- if (type != other.type) return false;
- if (invert_match != other.invert_match) return false;
- switch (type) {
- case HeaderMatcherType::REGEX:
- return regex_match->pattern() != other.regex_match->pattern();
- case HeaderMatcherType::RANGE:
- return range_start != other.range_start && range_end != other.range_end;
- case HeaderMatcherType::PRESENT:
- return present_match != other.present_match;
- default:
- return string_matcher != other.string_matcher;
- }
-}
-
-TString XdsApi::Route::Matchers::HeaderMatcher::ToString() const {
- switch (type) {
- case HeaderMatcherType::EXACT:
- return y_absl::StrFormat("Header exact match:%s %s:%s",
- invert_match ? " not" : "", name, string_matcher);
- case HeaderMatcherType::REGEX:
- return y_absl::StrFormat("Header regex match:%s %s:%s",
- invert_match ? " not" : "", name,
- regex_match->pattern());
- case HeaderMatcherType::RANGE:
- return y_absl::StrFormat("Header range match:%s %s:[%d, %d)",
- invert_match ? " not" : "", name, range_start,
- range_end);
- case HeaderMatcherType::PRESENT:
- return y_absl::StrFormat("Header present match:%s %s:%s",
- invert_match ? " not" : "", name,
- present_match ? "true" : "false");
- case HeaderMatcherType::PREFIX:
- return y_absl::StrFormat("Header prefix match:%s %s:%s",
- invert_match ? " not" : "", name, string_matcher);
- case HeaderMatcherType::SUFFIX:
- return y_absl::StrFormat("Header suffix match:%s %s:%s",
- invert_match ? " not" : "", name, string_matcher);
- default:
- return "";
- }
-}
-
-//
-// XdsApi::Route
-//
-
-TString XdsApi::Route::Matchers::ToString() const {
- std::vector<TString> contents;
- contents.push_back(path_matcher.ToString());
- for (const HeaderMatcher& header_matcher : header_matchers) {
- contents.push_back(header_matcher.ToString());
- }
- if (fraction_per_million.has_value()) {
- contents.push_back(y_absl::StrFormat("Fraction Per Million %d",
- fraction_per_million.value()));
- }
- return y_absl::StrJoin(contents, "\n");
-}
-
-TString XdsApi::Route::ClusterWeight::ToString() const {
- return y_absl::StrFormat("{cluster=%s, weight=%d}", name, weight);
-}
-
-TString XdsApi::Route::ToString() const {
- std::vector<TString> contents;
- contents.push_back(matchers.ToString());
- if (!cluster_name.empty()) {
- contents.push_back(y_absl::StrFormat("Cluster name: %s", cluster_name));
- }
- for (const ClusterWeight& cluster_weight : weighted_clusters) {
- contents.push_back(cluster_weight.ToString());
- }
- return y_absl::StrJoin(contents, "\n");
-}
-
-//
-// XdsApi::RdsUpdate
-//
-
-TString XdsApi::RdsUpdate::ToString() const {
- std::vector<TString> vhosts;
- for (const VirtualHost& vhost : virtual_hosts) {
- vhosts.push_back(
- y_absl::StrCat("vhost={\n"
- " domains=[",
- y_absl::StrJoin(vhost.domains, ", "),
- "]\n"
- " routes=[\n"));
- for (const XdsApi::Route& route : vhost.routes) {
- vhosts.push_back(" {\n");
- vhosts.push_back(route.ToString());
- vhosts.push_back("\n }\n");
- }
- vhosts.push_back(" ]\n");
- vhosts.push_back("]\n");
- }
- return y_absl::StrJoin(vhosts, "");
-}
-
-namespace {
-
-// Better match type has smaller value.
-enum MatchType {
- EXACT_MATCH,
- SUFFIX_MATCH,
- PREFIX_MATCH,
- UNIVERSE_MATCH,
- INVALID_MATCH,
-};
-
-// Returns true if match succeeds.
-bool DomainMatch(MatchType match_type, TString domain_pattern,
- TString expected_host_name) {
- // Normalize the args to lower-case. Domain matching is case-insensitive.
- std::transform(domain_pattern.cbegin(), domain_pattern.cend(),
- domain_pattern.begin(),
- [](unsigned char c) { return std::tolower(c); });
- std::transform(expected_host_name.cbegin(), expected_host_name.cend(),
- expected_host_name.begin(),
- [](unsigned char c) { return std::tolower(c); });
- if (match_type == EXACT_MATCH) {
- return domain_pattern == expected_host_name;
- } else if (match_type == SUFFIX_MATCH) {
- // Asterisk must match at least one char.
- if (expected_host_name.size() < domain_pattern.size()) return false;
- y_absl::string_view pattern_suffix(domain_pattern.c_str() + 1);
- y_absl::string_view host_suffix(expected_host_name.c_str() +
- expected_host_name.size() -
- pattern_suffix.size());
- return pattern_suffix == host_suffix;
- } else if (match_type == PREFIX_MATCH) {
- // Asterisk must match at least one char.
- if (expected_host_name.size() < domain_pattern.size()) return false;
- y_absl::string_view pattern_prefix(domain_pattern.c_str(),
- domain_pattern.size() - 1);
- y_absl::string_view host_prefix(expected_host_name.c_str(),
- pattern_prefix.size());
- return pattern_prefix == host_prefix;
- } else {
- return match_type == UNIVERSE_MATCH;
- }
-}
-
-MatchType DomainPatternMatchType(const TString& domain_pattern) {
- if (domain_pattern.empty()) return INVALID_MATCH;
- if (domain_pattern.find('*') == TString::npos) return EXACT_MATCH;
- if (domain_pattern == "*") return UNIVERSE_MATCH;
- if (domain_pattern[0] == '*') return SUFFIX_MATCH;
- if (domain_pattern[domain_pattern.size() - 1] == '*') return PREFIX_MATCH;
- return INVALID_MATCH;
-}
-
-} // namespace
-
-XdsApi::RdsUpdate::VirtualHost* XdsApi::RdsUpdate::FindVirtualHostForDomain(
- const TString& domain) {
- // Find the best matched virtual host.
- // The search order for 4 groups of domain patterns:
- // 1. Exact match.
- // 2. Suffix match (e.g., "*ABC").
- // 3. Prefix match (e.g., "ABC*").
- // 4. Universe match (i.e., "*").
- // Within each group, longest match wins.
- // If the same best matched domain pattern appears in multiple virtual hosts,
- // the first matched virtual host wins.
- VirtualHost* target_vhost = nullptr;
- MatchType best_match_type = INVALID_MATCH;
- size_t longest_match = 0;
- // Check each domain pattern in each virtual host to determine the best
- // matched virtual host.
- for (VirtualHost& vhost : virtual_hosts) {
- for (const TString& domain_pattern : vhost.domains) {
- // Check the match type first. Skip the pattern if it's not better than
- // current match.
- const MatchType match_type = DomainPatternMatchType(domain_pattern);
- // This should be caught by RouteConfigParse().
- GPR_ASSERT(match_type != INVALID_MATCH);
- if (match_type > best_match_type) continue;
- if (match_type == best_match_type &&
- domain_pattern.size() <= longest_match) {
- continue;
- }
- // Skip if match fails.
- if (!DomainMatch(match_type, domain_pattern, domain)) continue;
- // Choose this match.
- target_vhost = &vhost;
- best_match_type = match_type;
- longest_match = domain_pattern.size();
- if (best_match_type == EXACT_MATCH) break;
- }
- if (best_match_type == EXACT_MATCH) break;
- }
- return target_vhost;
-}
-
-//
-// XdsApi::StringMatcher
-//
-
-XdsApi::StringMatcher::StringMatcher(const StringMatcher& other)
- : type(other.type) {
- switch (type) {
- case StringMatcherType::SAFE_REGEX:
- regex_match = y_absl::make_unique<RE2>(other.regex_match->pattern());
- break;
- default:
- string_matcher = other.string_matcher;
- }
-}
-
-XdsApi::StringMatcher& XdsApi::StringMatcher::operator=(
- const StringMatcher& other) {
- type = other.type;
- switch (type) {
- case StringMatcherType::SAFE_REGEX:
- regex_match = y_absl::make_unique<RE2>(other.regex_match->pattern());
- break;
- default:
- string_matcher = other.string_matcher;
- }
- return *this;
-}
-
-bool XdsApi::StringMatcher::operator==(const StringMatcher& other) const {
- if (type != other.type) return false;
- switch (type) {
- case StringMatcherType::SAFE_REGEX:
- return regex_match->pattern() != other.regex_match->pattern();
- default:
- return string_matcher != other.string_matcher;
- }
-}
-
-//
-// XdsApi::EdsUpdate
-//
-
-TString XdsApi::EdsUpdate::Priority::Locality::ToString() const {
- std::vector<TString> endpoint_strings;
- for (const ServerAddress& endpoint : endpoints) {
- endpoint_strings.emplace_back(endpoint.ToString());
- }
- return y_absl::StrCat("{name=", name->AsHumanReadableString(),
- ", lb_weight=", lb_weight, ", endpoints=[",
- y_absl::StrJoin(endpoint_strings, ", "), "]}");
-}
-
-bool XdsApi::EdsUpdate::Priority::operator==(const Priority& other) const {
- if (localities.size() != other.localities.size()) return false;
- auto it1 = localities.begin();
- auto it2 = other.localities.begin();
- while (it1 != localities.end()) {
- if (*it1->first != *it2->first) return false;
- if (it1->second != it2->second) return false;
- ++it1;
- ++it2;
- }
- return true;
-}
-
-TString XdsApi::EdsUpdate::Priority::ToString() const {
- std::vector<TString> locality_strings;
- for (const auto& p : localities) {
- locality_strings.emplace_back(p.second.ToString());
- }
- return y_absl::StrCat("[", y_absl::StrJoin(locality_strings, ", "), "]");
-}
-
-bool XdsApi::EdsUpdate::DropConfig::ShouldDrop(
- const TString** category_name) const {
- for (size_t i = 0; i < drop_category_list_.size(); ++i) {
- const auto& drop_category = drop_category_list_[i];
- // Generate a random number in [0, 1000000).
- const uint32_t random = static_cast<uint32_t>(rand()) % 1000000;
- if (random < drop_category.parts_per_million) {
- *category_name = &drop_category.name;
- return true;
- }
- }
- return false;
-}
-
-TString XdsApi::EdsUpdate::DropConfig::ToString() const {
- std::vector<TString> category_strings;
- for (const DropCategory& category : drop_category_list_) {
- category_strings.emplace_back(
- y_absl::StrCat(category.name, "=", category.parts_per_million));
- }
- return y_absl::StrCat("{[", y_absl::StrJoin(category_strings, ", "),
- "], drop_all=", drop_all_, "}");
-}
-
-TString XdsApi::EdsUpdate::ToString() const {
- std::vector<TString> priority_strings;
- for (size_t i = 0; i < priorities.size(); ++i) {
- const Priority& priority = priorities[i];
- priority_strings.emplace_back(
- y_absl::StrCat("priority ", i, ": ", priority.ToString()));
- }
- return y_absl::StrCat("priorities=[", y_absl::StrJoin(priority_strings, ", "),
- "], drop_config=", drop_config->ToString());
-}
-
-//
-// XdsApi
-//
-
-const char* XdsApi::kLdsTypeUrl =
- "type.googleapis.com/envoy.config.listener.v3.Listener";
-const char* XdsApi::kRdsTypeUrl =
- "type.googleapis.com/envoy.config.route.v3.RouteConfiguration";
-const char* XdsApi::kCdsTypeUrl =
- "type.googleapis.com/envoy.config.cluster.v3.Cluster";
-const char* XdsApi::kEdsTypeUrl =
- "type.googleapis.com/envoy.config.endpoint.v3.ClusterLoadAssignment";
-
-namespace {
-
-const char* kLdsV2TypeUrl = "type.googleapis.com/envoy.api.v2.Listener";
-const char* kRdsV2TypeUrl =
- "type.googleapis.com/envoy.api.v2.RouteConfiguration";
-const char* kCdsV2TypeUrl = "type.googleapis.com/envoy.api.v2.Cluster";
-const char* kEdsV2TypeUrl =
- "type.googleapis.com/envoy.api.v2.ClusterLoadAssignment";
-
-bool IsLds(y_absl::string_view type_url) {
- return type_url == XdsApi::kLdsTypeUrl || type_url == kLdsV2TypeUrl;
-}
-
-bool IsRds(y_absl::string_view type_url) {
- return type_url == XdsApi::kRdsTypeUrl || type_url == kRdsV2TypeUrl;
-}
-
-bool IsCds(y_absl::string_view type_url) {
- return type_url == XdsApi::kCdsTypeUrl || type_url == kCdsV2TypeUrl;
-}
-
-bool IsEds(y_absl::string_view type_url) {
- return type_url == XdsApi::kEdsTypeUrl || type_url == kEdsV2TypeUrl;
-}
-
-} // namespace
-
-XdsApi::XdsApi(XdsClient* client, TraceFlag* tracer,
- const XdsBootstrap* bootstrap)
- : client_(client),
- tracer_(tracer),
- use_v3_(bootstrap != nullptr && bootstrap->server().ShouldUseV3()),
- bootstrap_(bootstrap),
- build_version_(y_absl::StrCat("gRPC C-core ", GPR_PLATFORM_STRING, " ",
- grpc_version_string())),
- user_agent_name_(y_absl::StrCat("gRPC C-core ", GPR_PLATFORM_STRING)) {}
-
-namespace {
-
-// Works for both TString and y_absl::string_view.
-template <typename T>
-inline upb_strview StdStringToUpbString(const T& str) {
- return upb_strview_make(str.data(), str.size());
-}
-
-void PopulateMetadataValue(upb_arena* arena, google_protobuf_Value* value_pb,
- const Json& value);
-
-void PopulateListValue(upb_arena* arena, google_protobuf_ListValue* list_value,
- const Json::Array& values) {
- for (const auto& value : values) {
- auto* value_pb = google_protobuf_ListValue_add_values(list_value, arena);
- PopulateMetadataValue(arena, value_pb, value);
- }
-}
-
-void PopulateMetadata(upb_arena* arena, google_protobuf_Struct* metadata_pb,
- const Json::Object& metadata) {
- for (const auto& p : metadata) {
- google_protobuf_Value* value = google_protobuf_Value_new(arena);
- PopulateMetadataValue(arena, value, p.second);
- google_protobuf_Struct_fields_set(
- metadata_pb, StdStringToUpbString(p.first), value, arena);
- }
-}
-
-void PopulateMetadataValue(upb_arena* arena, google_protobuf_Value* value_pb,
- const Json& value) {
- switch (value.type()) {
- case Json::Type::JSON_NULL:
- google_protobuf_Value_set_null_value(value_pb, 0);
- break;
- case Json::Type::NUMBER:
- google_protobuf_Value_set_number_value(
- value_pb, strtod(value.string_value().c_str(), nullptr));
- break;
- case Json::Type::STRING:
- google_protobuf_Value_set_string_value(
- value_pb, StdStringToUpbString(value.string_value()));
- break;
- case Json::Type::JSON_TRUE:
- google_protobuf_Value_set_bool_value(value_pb, true);
- break;
- case Json::Type::JSON_FALSE:
- google_protobuf_Value_set_bool_value(value_pb, false);
- break;
- case Json::Type::OBJECT: {
- google_protobuf_Struct* struct_value =
- google_protobuf_Value_mutable_struct_value(value_pb, arena);
- PopulateMetadata(arena, struct_value, value.object_value());
- break;
- }
- case Json::Type::ARRAY: {
- google_protobuf_ListValue* list_value =
- google_protobuf_Value_mutable_list_value(value_pb, arena);
- PopulateListValue(arena, list_value, value.array_value());
- break;
- }
- }
-}
-
-// Helper functions to manually do protobuf string encoding, so that we
-// can populate the node build_version field that was removed in v3.
-TString EncodeVarint(uint64_t val) {
- TString data;
- do {
- uint8_t byte = val & 0x7fU;
- val >>= 7;
- if (val) byte |= 0x80U;
- data += byte;
- } while (val);
- return data;
-}
-TString EncodeTag(uint32_t field_number, uint8_t wire_type) {
- return EncodeVarint((field_number << 3) | wire_type);
-}
-TString EncodeStringField(uint32_t field_number, const TString& str) {
- static const uint8_t kDelimitedWireType = 2;
- return EncodeTag(field_number, kDelimitedWireType) +
- EncodeVarint(str.size()) + str;
-}
-
-void PopulateBuildVersion(upb_arena* arena, envoy_config_core_v3_Node* node_msg,
- const TString& build_version) {
- TString encoded_build_version = EncodeStringField(5, build_version);
- // TODO(roth): This should use upb_msg_addunknown(), but that API is
- // broken in the current version of upb, so we're using the internal
- // API for now. Change this once we upgrade to a version of upb that
- // fixes this bug.
- _upb_msg_addunknown(node_msg, encoded_build_version.data(),
- encoded_build_version.size(), arena);
-}
-
-void PopulateNode(upb_arena* arena, const XdsBootstrap* bootstrap,
- const TString& build_version,
- const TString& user_agent_name,
- envoy_config_core_v3_Node* node_msg) {
- const XdsBootstrap::Node* node = bootstrap->node();
- if (node != nullptr) {
- if (!node->id.empty()) {
- envoy_config_core_v3_Node_set_id(node_msg,
- StdStringToUpbString(node->id));
- }
- if (!node->cluster.empty()) {
- envoy_config_core_v3_Node_set_cluster(
- node_msg, StdStringToUpbString(node->cluster));
- }
- if (!node->metadata.object_value().empty()) {
- google_protobuf_Struct* metadata =
- envoy_config_core_v3_Node_mutable_metadata(node_msg, arena);
- PopulateMetadata(arena, metadata, node->metadata.object_value());
- }
- if (!node->locality_region.empty() || !node->locality_zone.empty() ||
- !node->locality_subzone.empty()) {
- envoy_config_core_v3_Locality* locality =
- envoy_config_core_v3_Node_mutable_locality(node_msg, arena);
- if (!node->locality_region.empty()) {
- envoy_config_core_v3_Locality_set_region(
- locality, StdStringToUpbString(node->locality_region));
- }
- if (!node->locality_zone.empty()) {
- envoy_config_core_v3_Locality_set_zone(
- locality, StdStringToUpbString(node->locality_zone));
- }
- if (!node->locality_subzone.empty()) {
- envoy_config_core_v3_Locality_set_sub_zone(
- locality, StdStringToUpbString(node->locality_subzone));
- }
- }
- }
- if (!bootstrap->server().ShouldUseV3()) {
- PopulateBuildVersion(arena, node_msg, build_version);
- }
- envoy_config_core_v3_Node_set_user_agent_name(
- node_msg, StdStringToUpbString(user_agent_name));
- envoy_config_core_v3_Node_set_user_agent_version(
- node_msg, upb_strview_makez(grpc_version_string()));
- envoy_config_core_v3_Node_add_client_features(
- node_msg, upb_strview_makez("envoy.lb.does_not_support_overprovisioning"),
- arena);
-}
-
-inline y_absl::string_view UpbStringToAbsl(const upb_strview& str) {
- return y_absl::string_view(str.data, str.size);
-}
-
-inline TString UpbStringToStdString(const upb_strview& str) {
- return TString(str.data, str.size);
-}
-
-inline void AddStringField(const char* name, const upb_strview& value,
- std::vector<TString>* fields,
- bool add_if_empty = false) {
- if (value.size > 0 || add_if_empty) {
- fields->emplace_back(
- y_absl::StrCat(name, ": \"", UpbStringToAbsl(value), "\""));
- }
-}
-
-inline void AddUInt32ValueField(const char* name,
- const google_protobuf_UInt32Value* value,
- std::vector<TString>* fields) {
- if (value != nullptr) {
- fields->emplace_back(y_absl::StrCat(
- name, " { value: ", google_protobuf_UInt32Value_value(value), " }"));
- }
-}
-
-inline void AddLocalityField(int indent_level,
- const envoy_config_core_v3_Locality* locality,
- std::vector<TString>* fields) {
- TString indent =
- y_absl::StrJoin(std::vector<TString>(indent_level, " "), "");
- // region
- TString field = y_absl::StrCat(indent, "region");
- AddStringField(field.c_str(), envoy_config_core_v3_Locality_region(locality),
- fields);
- // zone
- field = y_absl::StrCat(indent, "zone");
- AddStringField(field.c_str(), envoy_config_core_v3_Locality_zone(locality),
- fields);
- // sub_zone
- field = y_absl::StrCat(indent, "sub_zone");
- AddStringField(field.c_str(),
- envoy_config_core_v3_Locality_sub_zone(locality), fields);
-}
-
-void AddNodeLogFields(const envoy_config_core_v3_Node* node,
- const TString& build_version,
- std::vector<TString>* fields) {
- fields->emplace_back("node {");
- // id
- AddStringField(" id", envoy_config_core_v3_Node_id(node), fields);
- // metadata
- const google_protobuf_Struct* metadata =
- envoy_config_core_v3_Node_metadata(node);
- if (metadata != nullptr) {
- fields->emplace_back(" metadata {");
- size_t entry_idx = UPB_MAP_BEGIN;
- while (true) {
- const google_protobuf_Struct_FieldsEntry* entry =
- google_protobuf_Struct_fields_next(metadata, &entry_idx);
- if (entry == nullptr) break;
- fields->emplace_back(" field {");
- // key
- AddStringField(" key", google_protobuf_Struct_FieldsEntry_key(entry),
- fields);
- // value
- const google_protobuf_Value* value =
- google_protobuf_Struct_FieldsEntry_value(entry);
- if (value != nullptr) {
- TString value_str;
- if (google_protobuf_Value_has_string_value(value)) {
- value_str = y_absl::StrCat(
- "string_value: \"",
- UpbStringToAbsl(google_protobuf_Value_string_value(value)), "\"");
- } else if (google_protobuf_Value_has_null_value(value)) {
- value_str = "null_value: NULL_VALUE";
- } else if (google_protobuf_Value_has_number_value(value)) {
- value_str = y_absl::StrCat("double_value: ",
- google_protobuf_Value_number_value(value));
- } else if (google_protobuf_Value_has_bool_value(value)) {
- value_str = y_absl::StrCat("bool_value: ",
- google_protobuf_Value_bool_value(value));
- } else if (google_protobuf_Value_has_struct_value(value)) {
- value_str = "struct_value: <not printed>";
- } else if (google_protobuf_Value_has_list_value(value)) {
- value_str = "list_value: <not printed>";
- } else {
- value_str = "<unknown>";
- }
- fields->emplace_back(y_absl::StrCat(" value { ", value_str, " }"));
- }
- fields->emplace_back(" }");
- }
- fields->emplace_back(" }");
- }
- // locality
- const envoy_config_core_v3_Locality* locality =
- envoy_config_core_v3_Node_locality(node);
- if (locality != nullptr) {
- fields->emplace_back(" locality {");
- AddLocalityField(2, locality, fields);
- fields->emplace_back(" }");
- }
- // build_version (doesn't exist in v3 proto; this is a horrible hack)
- if (!build_version.empty()) {
- fields->emplace_back(
- y_absl::StrCat(" build_version: \"", build_version, "\""));
- }
- // user_agent_name
- AddStringField(" user_agent_name",
- envoy_config_core_v3_Node_user_agent_name(node), fields);
- // user_agent_version
- AddStringField(" user_agent_version",
- envoy_config_core_v3_Node_user_agent_version(node), fields);
- // client_features
- size_t num_client_features;
- const upb_strview* client_features =
- envoy_config_core_v3_Node_client_features(node, &num_client_features);
- for (size_t i = 0; i < num_client_features; ++i) {
- AddStringField(" client_features", client_features[i], fields);
- }
- fields->emplace_back("}");
-}
-
-void MaybeLogDiscoveryRequest(
- XdsClient* client, TraceFlag* tracer,
- const envoy_service_discovery_v3_DiscoveryRequest* request,
- const TString& build_version) {
- if (GRPC_TRACE_FLAG_ENABLED(*tracer) &&
- gpr_should_log(GPR_LOG_SEVERITY_DEBUG)) {
- // TODO(roth): When we can upgrade upb, use upb textformat code to dump
- // the raw proto instead of doing this manually.
- std::vector<TString> fields;
- // version_info
- AddStringField(
- "version_info",
- envoy_service_discovery_v3_DiscoveryRequest_version_info(request),
- &fields);
- // node
- const envoy_config_core_v3_Node* node =
- envoy_service_discovery_v3_DiscoveryRequest_node(request);
- if (node != nullptr) AddNodeLogFields(node, build_version, &fields);
- // resource_names
- size_t num_resource_names;
- const upb_strview* resource_names =
- envoy_service_discovery_v3_DiscoveryRequest_resource_names(
- request, &num_resource_names);
- for (size_t i = 0; i < num_resource_names; ++i) {
- AddStringField("resource_names", resource_names[i], &fields);
- }
- // type_url
- AddStringField(
- "type_url",
- envoy_service_discovery_v3_DiscoveryRequest_type_url(request), &fields);
- // response_nonce
- AddStringField(
- "response_nonce",
- envoy_service_discovery_v3_DiscoveryRequest_response_nonce(request),
- &fields);
- // error_detail
- const struct google_rpc_Status* error_detail =
- envoy_service_discovery_v3_DiscoveryRequest_error_detail(request);
- if (error_detail != nullptr) {
- fields.emplace_back("error_detail {");
- // code
- int32_t code = google_rpc_Status_code(error_detail);
- if (code != 0) fields.emplace_back(y_absl::StrCat(" code: ", code));
- // message
- AddStringField(" message", google_rpc_Status_message(error_detail),
- &fields);
- fields.emplace_back("}");
- }
- gpr_log(GPR_DEBUG, "[xds_client %p] constructed ADS request: %s", client,
- y_absl::StrJoin(fields, "\n").c_str());
- }
-}
-
-grpc_slice SerializeDiscoveryRequest(
- upb_arena* arena, envoy_service_discovery_v3_DiscoveryRequest* request) {
- size_t output_length;
- char* output = envoy_service_discovery_v3_DiscoveryRequest_serialize(
- request, arena, &output_length);
- return grpc_slice_from_copied_buffer(output, output_length);
-}
-
-y_absl::string_view TypeUrlExternalToInternal(bool use_v3,
- const TString& type_url) {
- if (!use_v3) {
- if (type_url == XdsApi::kLdsTypeUrl) {
- return kLdsV2TypeUrl;
- }
- if (type_url == XdsApi::kRdsTypeUrl) {
- return kRdsV2TypeUrl;
- }
- if (type_url == XdsApi::kCdsTypeUrl) {
- return kCdsV2TypeUrl;
- }
- if (type_url == XdsApi::kEdsTypeUrl) {
- return kEdsV2TypeUrl;
- }
- }
- return type_url;
-}
-
-} // namespace
-
-grpc_slice XdsApi::CreateAdsRequest(
- const TString& type_url,
- const std::set<y_absl::string_view>& resource_names,
- const TString& version, const TString& nonce, grpc_error* error,
- bool populate_node) {
- upb::Arena arena;
- // Create a request.
- envoy_service_discovery_v3_DiscoveryRequest* request =
- envoy_service_discovery_v3_DiscoveryRequest_new(arena.ptr());
- // Set type_url.
- y_absl::string_view real_type_url =
- TypeUrlExternalToInternal(use_v3_, type_url);
- envoy_service_discovery_v3_DiscoveryRequest_set_type_url(
- request, StdStringToUpbString(real_type_url));
- // Set version_info.
- if (!version.empty()) {
- envoy_service_discovery_v3_DiscoveryRequest_set_version_info(
- request, StdStringToUpbString(version));
- }
- // Set nonce.
- if (!nonce.empty()) {
- envoy_service_discovery_v3_DiscoveryRequest_set_response_nonce(
- request, StdStringToUpbString(nonce));
- }
- // Set error_detail if it's a NACK.
- if (error != GRPC_ERROR_NONE) {
- grpc_slice error_description_slice;
- GPR_ASSERT(grpc_error_get_str(error, GRPC_ERROR_STR_DESCRIPTION,
- &error_description_slice));
- upb_strview error_description_strview =
- upb_strview_make(reinterpret_cast<const char*>(
- GPR_SLICE_START_PTR(error_description_slice)),
- GPR_SLICE_LENGTH(error_description_slice));
- google_rpc_Status* error_detail =
- envoy_service_discovery_v3_DiscoveryRequest_mutable_error_detail(
- request, arena.ptr());
- google_rpc_Status_set_message(error_detail, error_description_strview);
- GRPC_ERROR_UNREF(error);
- }
- // Populate node.
- if (populate_node) {
- envoy_config_core_v3_Node* node_msg =
- envoy_service_discovery_v3_DiscoveryRequest_mutable_node(request,
- arena.ptr());
- PopulateNode(arena.ptr(), bootstrap_, build_version_, user_agent_name_,
- node_msg);
- }
- // Add resource_names.
- for (const auto& resource_name : resource_names) {
- envoy_service_discovery_v3_DiscoveryRequest_add_resource_names(
- request, StdStringToUpbString(resource_name), arena.ptr());
- }
- MaybeLogDiscoveryRequest(client_, tracer_, request, build_version_);
- return SerializeDiscoveryRequest(arena.ptr(), request);
-}
-
-namespace {
-
-void MaybeLogDiscoveryResponse(
- XdsClient* client, TraceFlag* tracer,
- const envoy_service_discovery_v3_DiscoveryResponse* response) {
- if (GRPC_TRACE_FLAG_ENABLED(*tracer) &&
- gpr_should_log(GPR_LOG_SEVERITY_DEBUG)) {
- // TODO(roth): When we can upgrade upb, use upb textformat code to dump
- // the raw proto instead of doing this manually.
- std::vector<TString> fields;
- // version_info
- AddStringField(
- "version_info",
- envoy_service_discovery_v3_DiscoveryResponse_version_info(response),
- &fields);
- // resources
- size_t num_resources;
- envoy_service_discovery_v3_DiscoveryResponse_resources(response,
- &num_resources);
- fields.emplace_back(
- y_absl::StrCat("resources: <", num_resources, " element(s)>"));
- // type_url
- AddStringField(
- "type_url",
- envoy_service_discovery_v3_DiscoveryResponse_type_url(response),
- &fields);
- // nonce
- AddStringField("nonce",
- envoy_service_discovery_v3_DiscoveryResponse_nonce(response),
- &fields);
- gpr_log(GPR_DEBUG, "[xds_client %p] received response: %s", client,
- y_absl::StrJoin(fields, "\n").c_str());
- }
-}
-
-void MaybeLogRouteConfiguration(
- XdsClient* client, TraceFlag* tracer,
- const envoy_config_route_v3_RouteConfiguration* route_config) {
- if (GRPC_TRACE_FLAG_ENABLED(*tracer) &&
- gpr_should_log(GPR_LOG_SEVERITY_DEBUG)) {
- // TODO(roth): When we can upgrade upb, use upb textformat code to dump
- // the raw proto instead of doing this manually.
- std::vector<TString> fields;
- // name
- AddStringField("name",
- envoy_config_route_v3_RouteConfiguration_name(route_config),
- &fields);
- // virtual_hosts
- size_t num_virtual_hosts;
- const envoy_config_route_v3_VirtualHost* const* virtual_hosts =
- envoy_config_route_v3_RouteConfiguration_virtual_hosts(
- route_config, &num_virtual_hosts);
- for (size_t i = 0; i < num_virtual_hosts; ++i) {
- const auto* virtual_host = virtual_hosts[i];
- fields.push_back("virtual_hosts {");
- // name
- AddStringField(" name",
- envoy_config_route_v3_VirtualHost_name(virtual_host),
- &fields);
- // domains
- size_t num_domains;
- const upb_strview* const domains =
- envoy_config_route_v3_VirtualHost_domains(virtual_host, &num_domains);
- for (size_t j = 0; j < num_domains; ++j) {
- AddStringField(" domains", domains[j], &fields);
- }
- // routes
- size_t num_routes;
- const envoy_config_route_v3_Route* const* routes =
- envoy_config_route_v3_VirtualHost_routes(virtual_host, &num_routes);
- for (size_t j = 0; j < num_routes; ++j) {
- const auto* route = routes[j];
- fields.push_back(" route {");
- // name
- AddStringField(" name", envoy_config_route_v3_Route_name(route),
- &fields);
- // match
- const envoy_config_route_v3_RouteMatch* match =
- envoy_config_route_v3_Route_match(route);
- if (match != nullptr) {
- fields.emplace_back(" match {");
- // path matching
- if (envoy_config_route_v3_RouteMatch_has_prefix(match)) {
- AddStringField(" prefix",
- envoy_config_route_v3_RouteMatch_prefix(match),
- &fields,
- /*add_if_empty=*/true);
- } else if (envoy_config_route_v3_RouteMatch_has_path(match)) {
- AddStringField(" path",
- envoy_config_route_v3_RouteMatch_path(match),
- &fields,
- /*add_if_empty=*/true);
- } else if (envoy_config_route_v3_RouteMatch_has_safe_regex(match)) {
- fields.emplace_back(" safe_regex: <not printed>");
- } else {
- fields.emplace_back(" <unknown path matching type>");
- }
- // header matching
- size_t num_headers;
- envoy_config_route_v3_RouteMatch_headers(match, &num_headers);
- if (num_headers > 0) {
- fields.emplace_back(
- y_absl::StrCat(" headers: <", num_headers, " element(s)>"));
- }
- fields.emplace_back(" }");
- }
- // action
- if (envoy_config_route_v3_Route_has_route(route)) {
- const envoy_config_route_v3_RouteAction* action =
- envoy_config_route_v3_Route_route(route);
- fields.emplace_back(" route {");
- if (envoy_config_route_v3_RouteAction_has_cluster(action)) {
- AddStringField(" cluster",
- envoy_config_route_v3_RouteAction_cluster(action),
- &fields);
- } else if (envoy_config_route_v3_RouteAction_has_cluster_header(
- action)) {
- AddStringField(
- " cluster_header",
- envoy_config_route_v3_RouteAction_cluster_header(action),
- &fields);
- } else if (envoy_config_route_v3_RouteAction_has_weighted_clusters(
- action)) {
- const envoy_config_route_v3_WeightedCluster* weighted_clusters =
- envoy_config_route_v3_RouteAction_weighted_clusters(action);
- fields.emplace_back(" weighted_clusters {");
- size_t num_cluster_weights;
- const envoy_config_route_v3_WeightedCluster_ClusterWeight* const*
- cluster_weights =
- envoy_config_route_v3_WeightedCluster_clusters(
- weighted_clusters, &num_cluster_weights);
- for (size_t i = 0; i < num_cluster_weights; ++i) {
- const envoy_config_route_v3_WeightedCluster_ClusterWeight*
- cluster_weight = cluster_weights[i];
- fields.emplace_back(" clusters {");
- AddStringField(
- " name",
- envoy_config_route_v3_WeightedCluster_ClusterWeight_name(
- cluster_weight),
- &fields);
- AddUInt32ValueField(
- " weight",
- envoy_config_route_v3_WeightedCluster_ClusterWeight_weight(
- cluster_weight),
- &fields);
- fields.emplace_back(" }");
- }
- AddUInt32ValueField(
- " total_weight",
- envoy_config_route_v3_WeightedCluster_total_weight(
- weighted_clusters),
- &fields);
- fields.emplace_back(" }");
- }
- fields.emplace_back(" }");
- } else if (envoy_config_route_v3_Route_has_redirect(route)) {
- fields.emplace_back(" redirect: <not printed>");
- } else if (envoy_config_route_v3_Route_has_direct_response(route)) {
- fields.emplace_back(" direct_response: <not printed>");
- } else if (envoy_config_route_v3_Route_has_filter_action(route)) {
- fields.emplace_back(" filter_action: <not printed>");
- }
- fields.push_back(" }");
- }
- fields.push_back("}");
- }
- gpr_log(GPR_DEBUG, "[xds_client %p] RouteConfiguration: %s", client,
- y_absl::StrJoin(fields, "\n").c_str());
- }
-}
-
-void MaybeLogCluster(XdsClient* client, TraceFlag* tracer,
- const envoy_config_cluster_v3_Cluster* cluster) {
- if (GRPC_TRACE_FLAG_ENABLED(*tracer) &&
- gpr_should_log(GPR_LOG_SEVERITY_DEBUG)) {
- // TODO(roth): When we can upgrade upb, use upb textformat code to dump
- // the raw proto instead of doing this manually.
- std::vector<TString> fields;
- // name
- AddStringField("name", envoy_config_cluster_v3_Cluster_name(cluster),
- &fields);
- // type
- if (envoy_config_cluster_v3_Cluster_has_type(cluster)) {
- fields.emplace_back(y_absl::StrCat(
- "type: ", envoy_config_cluster_v3_Cluster_type(cluster)));
- } else if (envoy_config_cluster_v3_Cluster_has_cluster_type(cluster)) {
- fields.emplace_back("cluster_type: <not printed>");
- } else {
- fields.emplace_back("<unknown type>");
- }
- // eds_cluster_config
- const envoy_config_cluster_v3_Cluster_EdsClusterConfig* eds_cluster_config =
- envoy_config_cluster_v3_Cluster_eds_cluster_config(cluster);
- if (eds_cluster_config != nullptr) {
- fields.emplace_back("eds_cluster_config {");
- // eds_config
- const struct envoy_config_core_v3_ConfigSource* eds_config =
- envoy_config_cluster_v3_Cluster_EdsClusterConfig_eds_config(
- eds_cluster_config);
- if (eds_config != nullptr) {
- if (envoy_config_core_v3_ConfigSource_has_ads(eds_config)) {
- fields.emplace_back(" eds_config { ads {} }");
- } else {
- fields.emplace_back(" eds_config: <non-ADS type>");
- }
- }
- // service_name
- AddStringField(
- " service_name",
- envoy_config_cluster_v3_Cluster_EdsClusterConfig_service_name(
- eds_cluster_config),
- &fields);
- fields.emplace_back("}");
- }
- // lb_policy
- fields.emplace_back(y_absl::StrCat(
- "lb_policy: ", envoy_config_cluster_v3_Cluster_lb_policy(cluster)));
- // lrs_server
- const envoy_config_core_v3_ConfigSource* lrs_server =
- envoy_config_cluster_v3_Cluster_lrs_server(cluster);
- if (lrs_server != nullptr) {
- if (envoy_config_core_v3_ConfigSource_has_self(lrs_server)) {
- fields.emplace_back("lrs_server { self {} }");
- } else {
- fields.emplace_back("lrs_server: <non-self type>");
- }
- }
- gpr_log(GPR_DEBUG, "[xds_client %p] Cluster: %s", client,
- y_absl::StrJoin(fields, "\n").c_str());
- }
-}
-
-void MaybeLogClusterLoadAssignment(
- XdsClient* client, TraceFlag* tracer,
- const envoy_config_endpoint_v3_ClusterLoadAssignment* cla) {
- if (GRPC_TRACE_FLAG_ENABLED(*tracer) &&
- gpr_should_log(GPR_LOG_SEVERITY_DEBUG)) {
- // TODO(roth): When we can upgrade upb, use upb textformat code to dump
- // the raw proto instead of doing this manually.
- std::vector<TString> fields;
- // cluster_name
- AddStringField(
- "cluster_name",
- envoy_config_endpoint_v3_ClusterLoadAssignment_cluster_name(cla),
- &fields);
- // endpoints
- size_t num_localities;
- const struct envoy_config_endpoint_v3_LocalityLbEndpoints* const*
- locality_endpoints =
- envoy_config_endpoint_v3_ClusterLoadAssignment_endpoints(
- cla, &num_localities);
- for (size_t i = 0; i < num_localities; ++i) {
- const auto* locality_endpoint = locality_endpoints[i];
- fields.emplace_back("endpoints {");
- // locality
- const auto* locality =
- envoy_config_endpoint_v3_LocalityLbEndpoints_locality(
- locality_endpoint);
- if (locality != nullptr) {
- fields.emplace_back(" locality {");
- AddLocalityField(2, locality, &fields);
- fields.emplace_back(" }");
- }
- // lb_endpoints
- size_t num_lb_endpoints;
- const envoy_config_endpoint_v3_LbEndpoint* const* lb_endpoints =
- envoy_config_endpoint_v3_LocalityLbEndpoints_lb_endpoints(
- locality_endpoint, &num_lb_endpoints);
- for (size_t j = 0; j < num_lb_endpoints; ++j) {
- const auto* lb_endpoint = lb_endpoints[j];
- fields.emplace_back(" lb_endpoints {");
- // health_status
- uint32_t health_status =
- envoy_config_endpoint_v3_LbEndpoint_health_status(lb_endpoint);
- if (health_status > 0) {
- fields.emplace_back(
- y_absl::StrCat(" health_status: ", health_status));
- }
- // endpoint
- const envoy_config_endpoint_v3_Endpoint* endpoint =
- envoy_config_endpoint_v3_LbEndpoint_endpoint(lb_endpoint);
- if (endpoint != nullptr) {
- fields.emplace_back(" endpoint {");
- // address
- const auto* address =
- envoy_config_endpoint_v3_Endpoint_address(endpoint);
- if (address != nullptr) {
- fields.emplace_back(" address {");
- // socket_address
- const auto* socket_address =
- envoy_config_core_v3_Address_socket_address(address);
- if (socket_address != nullptr) {
- fields.emplace_back(" socket_address {");
- // address
- AddStringField(
- " address",
- envoy_config_core_v3_SocketAddress_address(socket_address),
- &fields);
- // port_value
- if (envoy_config_core_v3_SocketAddress_has_port_value(
- socket_address)) {
- fields.emplace_back(
- y_absl::StrCat(" port_value: ",
- envoy_config_core_v3_SocketAddress_port_value(
- socket_address)));
- } else {
- fields.emplace_back(" <non-numeric port>");
- }
- fields.emplace_back(" }");
- } else {
- fields.emplace_back(" <non-socket address>");
- }
- fields.emplace_back(" }");
- }
- fields.emplace_back(" }");
- }
- fields.emplace_back(" }");
- }
- // load_balancing_weight
- AddUInt32ValueField(
- " load_balancing_weight",
- envoy_config_endpoint_v3_LocalityLbEndpoints_load_balancing_weight(
- locality_endpoint),
- &fields);
- // priority
- uint32_t priority = envoy_config_endpoint_v3_LocalityLbEndpoints_priority(
- locality_endpoint);
- if (priority > 0) {
- fields.emplace_back(y_absl::StrCat(" priority: ", priority));
- }
- fields.emplace_back("}");
- }
- // policy
- const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy* policy =
- envoy_config_endpoint_v3_ClusterLoadAssignment_policy(cla);
- if (policy != nullptr) {
- fields.emplace_back("policy {");
- // drop_overloads
- size_t num_drop_overloads;
- const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload* const*
- drop_overloads =
- envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_drop_overloads(
- policy, &num_drop_overloads);
- for (size_t i = 0; i < num_drop_overloads; ++i) {
- auto* drop_overload = drop_overloads[i];
- fields.emplace_back(" drop_overloads {");
- // category
- AddStringField(
- " category",
- envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_category(
- drop_overload),
- &fields);
- // drop_percentage
- const auto* drop_percentage =
- envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_drop_percentage(
- drop_overload);
- if (drop_percentage != nullptr) {
- fields.emplace_back(" drop_percentage {");
- fields.emplace_back(y_absl::StrCat(
- " numerator: ",
- envoy_type_v3_FractionalPercent_numerator(drop_percentage)));
- fields.emplace_back(y_absl::StrCat(
- " denominator: ",
- envoy_type_v3_FractionalPercent_denominator(drop_percentage)));
- fields.emplace_back(" }");
- }
- fields.emplace_back(" }");
- }
- // overprovisioning_factor
- fields.emplace_back("}");
- }
- gpr_log(GPR_DEBUG, "[xds_client %p] ClusterLoadAssignment: %s", client,
- y_absl::StrJoin(fields, "\n").c_str());
- }
-}
-
-grpc_error* RoutePathMatchParse(const envoy_config_route_v3_RouteMatch* match,
- XdsApi::Route* route, bool* ignore_route) {
- if (envoy_config_route_v3_RouteMatch_has_prefix(match)) {
- y_absl::string_view prefix =
- UpbStringToAbsl(envoy_config_route_v3_RouteMatch_prefix(match));
- // Empty prefix "" is accepted.
- if (prefix.size() > 0) {
- // Prefix "/" is accepted.
- if (prefix[0] != '/') {
- // Prefix which does not start with a / will never match anything, so
- // ignore this route.
- *ignore_route = true;
- return GRPC_ERROR_NONE;
- }
- std::vector<y_absl::string_view> prefix_elements =
- y_absl::StrSplit(prefix.substr(1), y_absl::MaxSplits('/', 2));
- if (prefix_elements.size() > 2) {
- // Prefix cannot have more than 2 slashes.
- *ignore_route = true;
- return GRPC_ERROR_NONE;
- } else if (prefix_elements.size() == 2 && prefix_elements[0].empty()) {
- // Prefix contains empty string between the 2 slashes
- *ignore_route = true;
- return GRPC_ERROR_NONE;
- }
- }
- route->matchers.path_matcher.type =
- XdsApi::Route::Matchers::PathMatcher::PathMatcherType::PREFIX;
- route->matchers.path_matcher.string_matcher = TString(prefix);
- } else if (envoy_config_route_v3_RouteMatch_has_path(match)) {
- y_absl::string_view path =
- UpbStringToAbsl(envoy_config_route_v3_RouteMatch_path(match));
- if (path.size() == 0) {
- // Path that is empty will never match anything, so ignore this route.
- *ignore_route = true;
- return GRPC_ERROR_NONE;
- }
- if (path[0] != '/') {
- // Path which does not start with a / will never match anything, so
- // ignore this route.
- *ignore_route = true;
- return GRPC_ERROR_NONE;
- }
- std::vector<y_absl::string_view> path_elements =
- y_absl::StrSplit(path.substr(1), y_absl::MaxSplits('/', 2));
- if (path_elements.size() != 2) {
- // Path not in the required format of /service/method will never match
- // anything, so ignore this route.
- *ignore_route = true;
- return GRPC_ERROR_NONE;
- } else if (path_elements[0].empty()) {
- // Path contains empty service name will never match anything, so ignore
- // this route.
- *ignore_route = true;
- return GRPC_ERROR_NONE;
- } else if (path_elements[1].empty()) {
- // Path contains empty method name will never match anything, so ignore
- // this route.
- *ignore_route = true;
- return GRPC_ERROR_NONE;
- }
- route->matchers.path_matcher.type =
- XdsApi::Route::Matchers::PathMatcher::PathMatcherType::PATH;
- route->matchers.path_matcher.string_matcher = TString(path);
- } else if (envoy_config_route_v3_RouteMatch_has_safe_regex(match)) {
- const envoy_type_matcher_v3_RegexMatcher* regex_matcher =
- envoy_config_route_v3_RouteMatch_safe_regex(match);
- GPR_ASSERT(regex_matcher != nullptr);
- TString matcher = UpbStringToStdString(
- envoy_type_matcher_v3_RegexMatcher_regex(regex_matcher));
- std::unique_ptr<RE2> regex = y_absl::make_unique<RE2>(std::move(matcher));
- if (!regex->ok()) {
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "Invalid regex string specified in path matcher.");
- }
- route->matchers.path_matcher.type =
- XdsApi::Route::Matchers::PathMatcher::PathMatcherType::REGEX;
- route->matchers.path_matcher.regex_matcher = std::move(regex);
- } else {
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "Invalid route path specifier specified.");
- }
- return GRPC_ERROR_NONE;
-}
-
-grpc_error* RouteHeaderMatchersParse(
- const envoy_config_route_v3_RouteMatch* match, XdsApi::Route* route) {
- size_t size;
- const envoy_config_route_v3_HeaderMatcher* const* headers =
- envoy_config_route_v3_RouteMatch_headers(match, &size);
- for (size_t i = 0; i < size; ++i) {
- const envoy_config_route_v3_HeaderMatcher* header = headers[i];
- XdsApi::Route::Matchers::HeaderMatcher header_matcher;
- header_matcher.name =
- UpbStringToStdString(envoy_config_route_v3_HeaderMatcher_name(header));
- if (envoy_config_route_v3_HeaderMatcher_has_exact_match(header)) {
- header_matcher.type =
- XdsApi::Route::Matchers::HeaderMatcher::HeaderMatcherType::EXACT;
- header_matcher.string_matcher = UpbStringToStdString(
- envoy_config_route_v3_HeaderMatcher_exact_match(header));
- } else if (envoy_config_route_v3_HeaderMatcher_has_safe_regex_match(
- header)) {
- const envoy_type_matcher_v3_RegexMatcher* regex_matcher =
- envoy_config_route_v3_HeaderMatcher_safe_regex_match(header);
- GPR_ASSERT(regex_matcher != nullptr);
- const TString matcher = UpbStringToStdString(
- envoy_type_matcher_v3_RegexMatcher_regex(regex_matcher));
- std::unique_ptr<RE2> regex = y_absl::make_unique<RE2>(matcher);
- if (!regex->ok()) {
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "Invalid regex string specified in header matcher.");
- }
- header_matcher.type =
- XdsApi::Route::Matchers::HeaderMatcher::HeaderMatcherType::REGEX;
- header_matcher.regex_match = std::move(regex);
- } else if (envoy_config_route_v3_HeaderMatcher_has_range_match(header)) {
- header_matcher.type =
- XdsApi::Route::Matchers::HeaderMatcher::HeaderMatcherType::RANGE;
- const envoy_type_v3_Int64Range* range_matcher =
- envoy_config_route_v3_HeaderMatcher_range_match(header);
- header_matcher.range_start =
- envoy_type_v3_Int64Range_start(range_matcher);
- header_matcher.range_end = envoy_type_v3_Int64Range_end(range_matcher);
- if (header_matcher.range_end < header_matcher.range_start) {
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "Invalid range header matcher specifier specified: end "
- "cannot be smaller than start.");
- }
- } else if (envoy_config_route_v3_HeaderMatcher_has_present_match(header)) {
- header_matcher.type =
- XdsApi::Route::Matchers::HeaderMatcher::HeaderMatcherType::PRESENT;
- header_matcher.present_match =
- envoy_config_route_v3_HeaderMatcher_present_match(header);
- } else if (envoy_config_route_v3_HeaderMatcher_has_prefix_match(header)) {
- header_matcher.type =
- XdsApi::Route::Matchers::HeaderMatcher::HeaderMatcherType::PREFIX;
- header_matcher.string_matcher = UpbStringToStdString(
- envoy_config_route_v3_HeaderMatcher_prefix_match(header));
- } else if (envoy_config_route_v3_HeaderMatcher_has_suffix_match(header)) {
- header_matcher.type =
- XdsApi::Route::Matchers::HeaderMatcher::HeaderMatcherType::SUFFIX;
- header_matcher.string_matcher = UpbStringToStdString(
- envoy_config_route_v3_HeaderMatcher_suffix_match(header));
- } else {
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "Invalid route header matcher specified.");
- }
- header_matcher.invert_match =
- envoy_config_route_v3_HeaderMatcher_invert_match(header);
- route->matchers.header_matchers.emplace_back(std::move(header_matcher));
- }
- return GRPC_ERROR_NONE;
-}
-
-grpc_error* RouteRuntimeFractionParse(
- const envoy_config_route_v3_RouteMatch* match, XdsApi::Route* route) {
- const envoy_config_core_v3_RuntimeFractionalPercent* runtime_fraction =
- envoy_config_route_v3_RouteMatch_runtime_fraction(match);
- if (runtime_fraction != nullptr) {
- const envoy_type_v3_FractionalPercent* fraction =
- envoy_config_core_v3_RuntimeFractionalPercent_default_value(
- runtime_fraction);
- if (fraction != nullptr) {
- uint32_t numerator = envoy_type_v3_FractionalPercent_numerator(fraction);
- const auto denominator =
- static_cast<envoy_type_v3_FractionalPercent_DenominatorType>(
- envoy_type_v3_FractionalPercent_denominator(fraction));
- // Normalize to million.
- switch (denominator) {
- case envoy_type_v3_FractionalPercent_HUNDRED:
- numerator *= 10000;
- break;
- case envoy_type_v3_FractionalPercent_TEN_THOUSAND:
- numerator *= 100;
- break;
- case envoy_type_v3_FractionalPercent_MILLION:
- break;
- default:
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "Unknown denominator type");
- }
- route->matchers.fraction_per_million = numerator;
- }
- }
- return GRPC_ERROR_NONE;
-}
-
-grpc_error* RouteActionParse(const envoy_config_route_v3_Route* route_msg,
- XdsApi::Route* route, bool* ignore_route) {
- if (!envoy_config_route_v3_Route_has_route(route_msg)) {
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "No RouteAction found in route.");
- }
- const envoy_config_route_v3_RouteAction* route_action =
- envoy_config_route_v3_Route_route(route_msg);
- // Get the cluster or weighted_clusters in the RouteAction.
- if (envoy_config_route_v3_RouteAction_has_cluster(route_action)) {
- route->cluster_name = UpbStringToStdString(
- envoy_config_route_v3_RouteAction_cluster(route_action));
- if (route->cluster_name.size() == 0) {
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "RouteAction cluster contains empty cluster name.");
- }
- } else if (envoy_config_route_v3_RouteAction_has_weighted_clusters(
- route_action)) {
- const envoy_config_route_v3_WeightedCluster* weighted_cluster =
- envoy_config_route_v3_RouteAction_weighted_clusters(route_action);
- uint32_t total_weight = 100;
- const google_protobuf_UInt32Value* weight =
- envoy_config_route_v3_WeightedCluster_total_weight(weighted_cluster);
- if (weight != nullptr) {
- total_weight = google_protobuf_UInt32Value_value(weight);
- }
- size_t clusters_size;
- const envoy_config_route_v3_WeightedCluster_ClusterWeight* const* clusters =
- envoy_config_route_v3_WeightedCluster_clusters(weighted_cluster,
- &clusters_size);
- uint32_t sum_of_weights = 0;
- for (size_t j = 0; j < clusters_size; ++j) {
- const envoy_config_route_v3_WeightedCluster_ClusterWeight*
- cluster_weight = clusters[j];
- XdsApi::Route::ClusterWeight cluster;
- cluster.name = UpbStringToStdString(
- envoy_config_route_v3_WeightedCluster_ClusterWeight_name(
- cluster_weight));
- if (cluster.name.empty()) {
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "RouteAction weighted_cluster cluster contains empty cluster "
- "name.");
- }
- const google_protobuf_UInt32Value* weight =
- envoy_config_route_v3_WeightedCluster_ClusterWeight_weight(
- cluster_weight);
- if (weight == nullptr) {
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "RouteAction weighted_cluster cluster missing weight");
- }
- cluster.weight = google_protobuf_UInt32Value_value(weight);
- sum_of_weights += cluster.weight;
- route->weighted_clusters.emplace_back(std::move(cluster));
- }
- if (total_weight != sum_of_weights) {
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "RouteAction weighted_cluster has incorrect total weight");
- }
- if (route->weighted_clusters.empty()) {
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "RouteAction weighted_cluster has no valid clusters specified.");
- }
- } else {
- // No cluster or weighted_clusters found in RouteAction, ignore this route.
- *ignore_route = true;
- return GRPC_ERROR_NONE;
- }
- return GRPC_ERROR_NONE;
-}
-
-grpc_error* RouteConfigParse(
- XdsClient* client, TraceFlag* tracer,
- const envoy_config_route_v3_RouteConfiguration* route_config,
- XdsApi::RdsUpdate* rds_update) {
- MaybeLogRouteConfiguration(client, tracer, route_config);
- // Get the virtual hosts.
- size_t size;
- const envoy_config_route_v3_VirtualHost* const* virtual_hosts =
- envoy_config_route_v3_RouteConfiguration_virtual_hosts(route_config,
- &size);
- for (size_t i = 0; i < size; ++i) {
- rds_update->virtual_hosts.emplace_back();
- XdsApi::RdsUpdate::VirtualHost& vhost = rds_update->virtual_hosts.back();
- // Parse domains.
- size_t domain_size;
- upb_strview const* domains = envoy_config_route_v3_VirtualHost_domains(
- virtual_hosts[i], &domain_size);
- for (size_t j = 0; j < domain_size; ++j) {
- TString domain_pattern = UpbStringToStdString(domains[j]);
- const MatchType match_type = DomainPatternMatchType(domain_pattern);
- if (match_type == INVALID_MATCH) {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("Invalid domain pattern \"", domain_pattern, "\".")
- .c_str());
- }
- vhost.domains.emplace_back(std::move(domain_pattern));
- }
- if (vhost.domains.empty()) {
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING("VirtualHost has no domains");
- }
- // Parse routes.
- size_t num_routes;
- const envoy_config_route_v3_Route* const* routes =
- envoy_config_route_v3_VirtualHost_routes(virtual_hosts[i], &num_routes);
- if (num_routes < 1) {
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "No route found in the virtual host.");
- }
- // Loop over the whole list of routes
- for (size_t j = 0; j < num_routes; ++j) {
- const envoy_config_route_v3_RouteMatch* match =
- envoy_config_route_v3_Route_match(routes[j]);
- size_t query_parameters_size;
- static_cast<void>(envoy_config_route_v3_RouteMatch_query_parameters(
- match, &query_parameters_size));
- if (query_parameters_size > 0) {
- continue;
- }
- XdsApi::Route route;
- bool ignore_route = false;
- grpc_error* error = RoutePathMatchParse(match, &route, &ignore_route);
- if (error != GRPC_ERROR_NONE) return error;
- if (ignore_route) continue;
- error = RouteHeaderMatchersParse(match, &route);
- if (error != GRPC_ERROR_NONE) return error;
- error = RouteRuntimeFractionParse(match, &route);
- if (error != GRPC_ERROR_NONE) return error;
- error = RouteActionParse(routes[j], &route, &ignore_route);
- if (error != GRPC_ERROR_NONE) return error;
- if (ignore_route) continue;
- const google_protobuf_BoolValue* case_sensitive =
- envoy_config_route_v3_RouteMatch_case_sensitive(match);
- if (case_sensitive != nullptr &&
- !google_protobuf_BoolValue_value(case_sensitive)) {
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "case_sensitive if set must be set to true.");
- }
- vhost.routes.emplace_back(std::move(route));
- }
- if (vhost.routes.empty()) {
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING("No valid routes specified.");
- }
- }
- return GRPC_ERROR_NONE;
-}
-
-grpc_error* LdsResponseParse(
- XdsClient* client, TraceFlag* tracer,
- const envoy_service_discovery_v3_DiscoveryResponse* response,
- const std::set<y_absl::string_view>& expected_listener_names,
- XdsApi::LdsUpdateMap* lds_update_map, upb_arena* arena) {
- // Get the resources from the response.
- size_t size;
- const google_protobuf_Any* const* resources =
- envoy_service_discovery_v3_DiscoveryResponse_resources(response, &size);
- for (size_t i = 0; i < size; ++i) {
- // Check the type_url of the resource.
- y_absl::string_view type_url =
- UpbStringToAbsl(google_protobuf_Any_type_url(resources[i]));
- if (!IsLds(type_url)) {
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING("Resource is not LDS.");
- }
- // Decode the listener.
- const upb_strview encoded_listener =
- google_protobuf_Any_value(resources[i]);
- const envoy_config_listener_v3_Listener* listener =
- envoy_config_listener_v3_Listener_parse(encoded_listener.data,
- encoded_listener.size, arena);
- if (listener == nullptr) {
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING("Can't decode listener.");
- }
- // Check listener name. Ignore unexpected listeners.
- TString listener_name =
- UpbStringToStdString(envoy_config_listener_v3_Listener_name(listener));
- if (expected_listener_names.find(listener_name) ==
- expected_listener_names.end()) {
- continue;
- }
- // Fail if listener name is duplicated.
- if (lds_update_map->find(listener_name) != lds_update_map->end()) {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("duplicate listener name \"", listener_name, "\"")
- .c_str());
- }
- XdsApi::LdsUpdate& lds_update = (*lds_update_map)[listener_name];
- // Get api_listener and decode it to http_connection_manager.
- const envoy_config_listener_v3_ApiListener* api_listener =
- envoy_config_listener_v3_Listener_api_listener(listener);
- if (api_listener == nullptr) {
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "Listener has no ApiListener.");
- }
- const upb_strview encoded_api_listener = google_protobuf_Any_value(
- envoy_config_listener_v3_ApiListener_api_listener(api_listener));
- const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager*
- http_connection_manager =
- envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_parse(
- encoded_api_listener.data, encoded_api_listener.size, arena);
- if (http_connection_manager == nullptr) {
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "Could not parse HttpConnectionManager config from ApiListener");
- }
- // Found inlined route_config. Parse it to find the cluster_name.
- if (envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_route_config(
- http_connection_manager)) {
- const envoy_config_route_v3_RouteConfiguration* route_config =
- envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_route_config(
- http_connection_manager);
- XdsApi::RdsUpdate rds_update;
- grpc_error* error =
- RouteConfigParse(client, tracer, route_config, &rds_update);
- if (error != GRPC_ERROR_NONE) return error;
- lds_update.rds_update = std::move(rds_update);
- continue;
- }
- // Validate that RDS must be used to get the route_config dynamically.
- if (!envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_rds(
- http_connection_manager)) {
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "HttpConnectionManager neither has inlined route_config nor RDS.");
- }
- const envoy_extensions_filters_network_http_connection_manager_v3_Rds* rds =
- envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_rds(
- http_connection_manager);
- // Check that the ConfigSource specifies ADS.
- const envoy_config_core_v3_ConfigSource* config_source =
- envoy_extensions_filters_network_http_connection_manager_v3_Rds_config_source(
- rds);
- if (config_source == nullptr) {
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "HttpConnectionManager missing config_source for RDS.");
- }
- if (!envoy_config_core_v3_ConfigSource_has_ads(config_source)) {
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "HttpConnectionManager ConfigSource for RDS does not specify ADS.");
- }
- // Get the route_config_name.
- lds_update.route_config_name = UpbStringToStdString(
- envoy_extensions_filters_network_http_connection_manager_v3_Rds_route_config_name(
- rds));
- }
- return GRPC_ERROR_NONE;
-}
-
-grpc_error* RdsResponseParse(
- XdsClient* client, TraceFlag* tracer,
- const envoy_service_discovery_v3_DiscoveryResponse* response,
- const std::set<y_absl::string_view>& expected_route_configuration_names,
- XdsApi::RdsUpdateMap* rds_update_map, upb_arena* arena) {
- // Get the resources from the response.
- size_t size;
- const google_protobuf_Any* const* resources =
- envoy_service_discovery_v3_DiscoveryResponse_resources(response, &size);
- for (size_t i = 0; i < size; ++i) {
- // Check the type_url of the resource.
- y_absl::string_view type_url =
- UpbStringToAbsl(google_protobuf_Any_type_url(resources[i]));
- if (!IsRds(type_url)) {
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING("Resource is not RDS.");
- }
- // Decode the route_config.
- const upb_strview encoded_route_config =
- google_protobuf_Any_value(resources[i]);
- const envoy_config_route_v3_RouteConfiguration* route_config =
- envoy_config_route_v3_RouteConfiguration_parse(
- encoded_route_config.data, encoded_route_config.size, arena);
- if (route_config == nullptr) {
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING("Can't decode route_config.");
- }
- // Check route_config_name. Ignore unexpected route_config.
- TString route_config_name = UpbStringToStdString(
- envoy_config_route_v3_RouteConfiguration_name(route_config));
- if (expected_route_configuration_names.find(route_config_name) ==
- expected_route_configuration_names.end()) {
- continue;
- }
- // Fail if route config name is duplicated.
- if (rds_update_map->find(route_config_name) != rds_update_map->end()) {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("duplicate route config name \"", route_config_name,
- "\"")
- .c_str());
- }
- // Parse the route_config.
- XdsApi::RdsUpdate& rds_update =
- (*rds_update_map)[std::move(route_config_name)];
- grpc_error* error =
- RouteConfigParse(client, tracer, route_config, &rds_update);
- if (error != GRPC_ERROR_NONE) return error;
- }
- return GRPC_ERROR_NONE;
-}
-
-grpc_error* CommonTlsContextParse(
- const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext*
- common_tls_context_proto,
- XdsApi::CommonTlsContext* common_tls_context) GRPC_MUST_USE_RESULT;
-grpc_error* CommonTlsContextParse(
- const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext*
- common_tls_context_proto,
- XdsApi::CommonTlsContext* common_tls_context) {
- auto* combined_validation_context =
- envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_combined_validation_context(
- common_tls_context_proto);
- if (combined_validation_context != nullptr) {
- auto* default_validation_context =
- envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_default_validation_context(
- combined_validation_context);
- if (default_validation_context != nullptr) {
- size_t len = 0;
- auto* subject_alt_names_matchers =
- envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_match_subject_alt_names(
- default_validation_context, &len);
- for (size_t i = 0; i < len; ++i) {
- XdsApi::StringMatcher matcher;
- if (envoy_type_matcher_v3_StringMatcher_has_exact(
- subject_alt_names_matchers[i])) {
- matcher.type = XdsApi::StringMatcher::StringMatcherType::EXACT;
- matcher.string_matcher =
- UpbStringToStdString(envoy_type_matcher_v3_StringMatcher_exact(
- subject_alt_names_matchers[i]));
- } else if (envoy_type_matcher_v3_StringMatcher_has_prefix(
- subject_alt_names_matchers[i])) {
- matcher.type = XdsApi::StringMatcher::StringMatcherType::PREFIX;
- matcher.string_matcher =
- UpbStringToStdString(envoy_type_matcher_v3_StringMatcher_prefix(
- subject_alt_names_matchers[i]));
- } else if (envoy_type_matcher_v3_StringMatcher_has_suffix(
- subject_alt_names_matchers[i])) {
- matcher.type = XdsApi::StringMatcher::StringMatcherType::SUFFIX;
- matcher.string_matcher =
- UpbStringToStdString(envoy_type_matcher_v3_StringMatcher_suffix(
- subject_alt_names_matchers[i]));
- } else if (envoy_type_matcher_v3_StringMatcher_has_safe_regex(
- subject_alt_names_matchers[i])) {
- matcher.type = XdsApi::StringMatcher::StringMatcherType::SAFE_REGEX;
- auto* regex_matcher = envoy_type_matcher_v3_StringMatcher_safe_regex(
- subject_alt_names_matchers[i]);
- std::unique_ptr<RE2> regex =
- y_absl::make_unique<RE2>(UpbStringToStdString(
- envoy_type_matcher_v3_RegexMatcher_regex(regex_matcher)));
- if (!regex->ok()) {
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "Invalid regex string specified in string matcher.");
- }
- matcher.regex_match = std::move(regex);
- } else {
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "Invalid StringMatcher specified");
- }
- matcher.ignore_case = envoy_type_matcher_v3_StringMatcher_ignore_case(
- subject_alt_names_matchers[i]);
- common_tls_context->combined_validation_context
- .default_validation_context.match_subject_alt_names.emplace_back(
- matcher);
- }
- }
- auto* validation_context_certificate_provider_instance =
- envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_validation_context_certificate_provider_instance(
- combined_validation_context);
- if (validation_context_certificate_provider_instance != nullptr) {
- common_tls_context->combined_validation_context
- .validation_context_certificate_provider_instance = UpbStringToStdString(
- envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_instance_name(
- validation_context_certificate_provider_instance));
- }
- }
- auto* tls_certificate_certificate_provider_instance =
- envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_tls_certificate_certificate_provider_instance(
- common_tls_context_proto);
- if (tls_certificate_certificate_provider_instance != nullptr) {
- common_tls_context
- ->tls_certificate_certificate_provider_instance = UpbStringToStdString(
- envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_instance_name(
- tls_certificate_certificate_provider_instance));
- }
- return GRPC_ERROR_NONE;
-}
-
-grpc_error* CdsResponseParse(
- XdsClient* client, TraceFlag* tracer,
- const envoy_service_discovery_v3_DiscoveryResponse* response,
- const std::set<y_absl::string_view>& expected_cluster_names,
- XdsApi::CdsUpdateMap* cds_update_map, upb_arena* arena) {
- // Get the resources from the response.
- size_t size;
- const google_protobuf_Any* const* resources =
- envoy_service_discovery_v3_DiscoveryResponse_resources(response, &size);
- // Parse all the resources in the CDS response.
- for (size_t i = 0; i < size; ++i) {
- // Check the type_url of the resource.
- y_absl::string_view type_url =
- UpbStringToAbsl(google_protobuf_Any_type_url(resources[i]));
- if (!IsCds(type_url)) {
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING("Resource is not CDS.");
- }
- // Decode the cluster.
- const upb_strview encoded_cluster = google_protobuf_Any_value(resources[i]);
- const envoy_config_cluster_v3_Cluster* cluster =
- envoy_config_cluster_v3_Cluster_parse(encoded_cluster.data,
- encoded_cluster.size, arena);
- if (cluster == nullptr) {
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING("Can't decode cluster.");
- }
- MaybeLogCluster(client, tracer, cluster);
- // Ignore unexpected cluster names.
- TString cluster_name =
- UpbStringToStdString(envoy_config_cluster_v3_Cluster_name(cluster));
- if (expected_cluster_names.find(cluster_name) ==
- expected_cluster_names.end()) {
- continue;
- }
- // Fail on duplicate resources.
- if (cds_update_map->find(cluster_name) != cds_update_map->end()) {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("duplicate resource name \"", cluster_name, "\"")
- .c_str());
- }
- XdsApi::CdsUpdate& cds_update = (*cds_update_map)[std::move(cluster_name)];
- // Check the cluster_discovery_type.
- if (!envoy_config_cluster_v3_Cluster_has_type(cluster)) {
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING("DiscoveryType not found.");
- }
- if (envoy_config_cluster_v3_Cluster_type(cluster) !=
- envoy_config_cluster_v3_Cluster_EDS) {
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING("DiscoveryType is not EDS.");
- }
- // Check the EDS config source.
- const envoy_config_cluster_v3_Cluster_EdsClusterConfig* eds_cluster_config =
- envoy_config_cluster_v3_Cluster_eds_cluster_config(cluster);
- const envoy_config_core_v3_ConfigSource* eds_config =
- envoy_config_cluster_v3_Cluster_EdsClusterConfig_eds_config(
- eds_cluster_config);
- if (!envoy_config_core_v3_ConfigSource_has_ads(eds_config)) {
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "EDS ConfigSource is not ADS.");
- }
- // Record EDS service_name (if any).
- upb_strview service_name =
- envoy_config_cluster_v3_Cluster_EdsClusterConfig_service_name(
- eds_cluster_config);
- if (service_name.size != 0) {
- cds_update.eds_service_name = UpbStringToStdString(service_name);
- }
- // Check the LB policy.
- if (envoy_config_cluster_v3_Cluster_lb_policy(cluster) !=
- envoy_config_cluster_v3_Cluster_ROUND_ROBIN) {
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "LB policy is not ROUND_ROBIN.");
- }
- // Record Upstream tls context
- auto* transport_socket =
- envoy_config_cluster_v3_Cluster_transport_socket(cluster);
- if (transport_socket != nullptr) {
- y_absl::string_view name = UpbStringToAbsl(
- envoy_config_core_v3_TransportSocket_name(transport_socket));
- if (name == "tls") {
- auto* typed_config =
- envoy_config_core_v3_TransportSocket_typed_config(transport_socket);
- if (typed_config != nullptr) {
- const upb_strview encoded_upstream_tls_context =
- google_protobuf_Any_value(typed_config);
- auto* upstream_tls_context =
- envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_parse(
- encoded_upstream_tls_context.data,
- encoded_upstream_tls_context.size, arena);
- if (upstream_tls_context == nullptr) {
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "Can't decode upstream tls context.");
- }
- auto* common_tls_context =
- envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_common_tls_context(
- upstream_tls_context);
- if (common_tls_context != nullptr) {
- grpc_error* error = CommonTlsContextParse(
- common_tls_context, &cds_update.common_tls_context);
- if (error != GRPC_ERROR_NONE) return error;
- }
- }
- }
- }
- // Record LRS server name (if any).
- const envoy_config_core_v3_ConfigSource* lrs_server =
- envoy_config_cluster_v3_Cluster_lrs_server(cluster);
- if (lrs_server != nullptr) {
- if (!envoy_config_core_v3_ConfigSource_has_self(lrs_server)) {
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "LRS ConfigSource is not self.");
- }
- cds_update.lrs_load_reporting_server_name.emplace("");
- }
- // The Cluster resource encodes the circuit breaking parameters in a list of
- // Thresholds messages, where each message specifies the parameters for a
- // particular RoutingPriority. we will look only at the first entry in the
- // list for priority DEFAULT and default to 1024 if not found.
- if (envoy_config_cluster_v3_Cluster_has_circuit_breakers(cluster)) {
- const envoy_config_cluster_v3_CircuitBreakers* circuit_breakers =
- envoy_config_cluster_v3_Cluster_circuit_breakers(cluster);
- size_t num_thresholds;
- const envoy_config_cluster_v3_CircuitBreakers_Thresholds* const*
- thresholds = envoy_config_cluster_v3_CircuitBreakers_thresholds(
- circuit_breakers, &num_thresholds);
- for (size_t i = 0; i < num_thresholds; ++i) {
- const auto* threshold = thresholds[i];
- if (envoy_config_cluster_v3_CircuitBreakers_Thresholds_priority(
- threshold) == envoy_config_core_v3_DEFAULT) {
- const google_protobuf_UInt32Value* max_requests =
- envoy_config_cluster_v3_CircuitBreakers_Thresholds_max_requests(
- threshold);
- if (max_requests != nullptr) {
- cds_update.max_concurrent_requests =
- google_protobuf_UInt32Value_value(max_requests);
- }
- break;
- }
- }
- }
- }
- return GRPC_ERROR_NONE;
-}
-
-grpc_error* ServerAddressParseAndAppend(
- const envoy_config_endpoint_v3_LbEndpoint* lb_endpoint,
- ServerAddressList* list) {
- // If health_status is not HEALTHY or UNKNOWN, skip this endpoint.
- const int32_t health_status =
- envoy_config_endpoint_v3_LbEndpoint_health_status(lb_endpoint);
- if (health_status != envoy_config_core_v3_UNKNOWN &&
- health_status != envoy_config_core_v3_HEALTHY) {
- return GRPC_ERROR_NONE;
- }
- // Find the ip:port.
- const envoy_config_endpoint_v3_Endpoint* endpoint =
- envoy_config_endpoint_v3_LbEndpoint_endpoint(lb_endpoint);
- const envoy_config_core_v3_Address* address =
- envoy_config_endpoint_v3_Endpoint_address(endpoint);
- const envoy_config_core_v3_SocketAddress* socket_address =
- envoy_config_core_v3_Address_socket_address(address);
- TString address_str = UpbStringToStdString(
- envoy_config_core_v3_SocketAddress_address(socket_address));
- uint32_t port = envoy_config_core_v3_SocketAddress_port_value(socket_address);
- if (GPR_UNLIKELY(port >> 16) != 0) {
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING("Invalid port.");
- }
- // Populate grpc_resolved_address.
- grpc_resolved_address addr;
- grpc_string_to_sockaddr(&addr, address_str.c_str(), port);
- // Append the address to the list.
- list->emplace_back(addr, nullptr);
- return GRPC_ERROR_NONE;
-}
-
-grpc_error* LocalityParse(
- const envoy_config_endpoint_v3_LocalityLbEndpoints* locality_lb_endpoints,
- XdsApi::EdsUpdate::Priority::Locality* output_locality, size_t* priority) {
- // Parse LB weight.
- const google_protobuf_UInt32Value* lb_weight =
- envoy_config_endpoint_v3_LocalityLbEndpoints_load_balancing_weight(
- locality_lb_endpoints);
- // If LB weight is not specified, it means this locality is assigned no load.
- // TODO(juanlishen): When we support CDS to configure the inter-locality
- // policy, we should change the LB weight handling.
- output_locality->lb_weight =
- lb_weight != nullptr ? google_protobuf_UInt32Value_value(lb_weight) : 0;
- if (output_locality->lb_weight == 0) return GRPC_ERROR_NONE;
- // Parse locality name.
- const envoy_config_core_v3_Locality* locality =
- envoy_config_endpoint_v3_LocalityLbEndpoints_locality(
- locality_lb_endpoints);
- TString region =
- UpbStringToStdString(envoy_config_core_v3_Locality_region(locality));
- TString zone =
- UpbStringToStdString(envoy_config_core_v3_Locality_region(locality));
- TString sub_zone =
- UpbStringToStdString(envoy_config_core_v3_Locality_sub_zone(locality));
- output_locality->name = MakeRefCounted<XdsLocalityName>(
- std::move(region), std::move(zone), std::move(sub_zone));
- // Parse the addresses.
- size_t size;
- const envoy_config_endpoint_v3_LbEndpoint* const* lb_endpoints =
- envoy_config_endpoint_v3_LocalityLbEndpoints_lb_endpoints(
- locality_lb_endpoints, &size);
- for (size_t i = 0; i < size; ++i) {
- grpc_error* error = ServerAddressParseAndAppend(
- lb_endpoints[i], &output_locality->endpoints);
- if (error != GRPC_ERROR_NONE) return error;
- }
- // Parse the priority.
- *priority = envoy_config_endpoint_v3_LocalityLbEndpoints_priority(
- locality_lb_endpoints);
- return GRPC_ERROR_NONE;
-}
-
-grpc_error* DropParseAndAppend(
- const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload*
- drop_overload,
- XdsApi::EdsUpdate::DropConfig* drop_config) {
- // Get the category.
- TString category = UpbStringToStdString(
- envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_category(
- drop_overload));
- if (category.size() == 0) {
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING("Empty drop category name");
- }
- // Get the drop rate (per million).
- const envoy_type_v3_FractionalPercent* drop_percentage =
- envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_drop_percentage(
- drop_overload);
- uint32_t numerator =
- envoy_type_v3_FractionalPercent_numerator(drop_percentage);
- const auto denominator =
- static_cast<envoy_type_v3_FractionalPercent_DenominatorType>(
- envoy_type_v3_FractionalPercent_denominator(drop_percentage));
- // Normalize to million.
- switch (denominator) {
- case envoy_type_v3_FractionalPercent_HUNDRED:
- numerator *= 10000;
- break;
- case envoy_type_v3_FractionalPercent_TEN_THOUSAND:
- numerator *= 100;
- break;
- case envoy_type_v3_FractionalPercent_MILLION:
- break;
- default:
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING("Unknown denominator type");
- }
- // Cap numerator to 1000000.
- numerator = GPR_MIN(numerator, 1000000);
- drop_config->AddCategory(std::move(category), numerator);
- return GRPC_ERROR_NONE;
-}
-
-grpc_error* EdsResponseParse(
- XdsClient* client, TraceFlag* tracer,
- const envoy_service_discovery_v3_DiscoveryResponse* response,
- const std::set<y_absl::string_view>& expected_eds_service_names,
- XdsApi::EdsUpdateMap* eds_update_map, upb_arena* arena) {
- // Get the resources from the response.
- size_t size;
- const google_protobuf_Any* const* resources =
- envoy_service_discovery_v3_DiscoveryResponse_resources(response, &size);
- for (size_t i = 0; i < size; ++i) {
- // Check the type_url of the resource.
- y_absl::string_view type_url =
- UpbStringToAbsl(google_protobuf_Any_type_url(resources[i]));
- if (!IsEds(type_url)) {
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING("Resource is not EDS.");
- }
- // Get the cluster_load_assignment.
- upb_strview encoded_cluster_load_assignment =
- google_protobuf_Any_value(resources[i]);
- envoy_config_endpoint_v3_ClusterLoadAssignment* cluster_load_assignment =
- envoy_config_endpoint_v3_ClusterLoadAssignment_parse(
- encoded_cluster_load_assignment.data,
- encoded_cluster_load_assignment.size, arena);
- if (cluster_load_assignment == nullptr) {
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "Can't parse cluster_load_assignment.");
- }
- MaybeLogClusterLoadAssignment(client, tracer, cluster_load_assignment);
- // Check the EDS service name. Ignore unexpected names.
- TString eds_service_name = UpbStringToStdString(
- envoy_config_endpoint_v3_ClusterLoadAssignment_cluster_name(
- cluster_load_assignment));
- if (expected_eds_service_names.find(eds_service_name) ==
- expected_eds_service_names.end()) {
- continue;
- }
- // Fail on duplicate resources.
- if (eds_update_map->find(eds_service_name) != eds_update_map->end()) {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("duplicate resource name \"", eds_service_name, "\"")
- .c_str());
- }
- XdsApi::EdsUpdate& eds_update =
- (*eds_update_map)[std::move(eds_service_name)];
- // Get the endpoints.
- size_t locality_size;
- const envoy_config_endpoint_v3_LocalityLbEndpoints* const* endpoints =
- envoy_config_endpoint_v3_ClusterLoadAssignment_endpoints(
- cluster_load_assignment, &locality_size);
- for (size_t j = 0; j < locality_size; ++j) {
- size_t priority;
- XdsApi::EdsUpdate::Priority::Locality locality;
- grpc_error* error = LocalityParse(endpoints[j], &locality, &priority);
- if (error != GRPC_ERROR_NONE) return error;
- // Filter out locality with weight 0.
- if (locality.lb_weight == 0) continue;
- // Make sure prorities is big enough. Note that they might not
- // arrive in priority order.
- while (eds_update.priorities.size() < priority + 1) {
- eds_update.priorities.emplace_back();
- }
- eds_update.priorities[priority].localities.emplace(locality.name.get(),
- std::move(locality));
- }
- for (const auto& priority : eds_update.priorities) {
- if (priority.localities.empty()) {
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "EDS update includes sparse priority list");
- }
- }
- // Get the drop config.
- eds_update.drop_config = MakeRefCounted<XdsApi::EdsUpdate::DropConfig>();
- const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy* policy =
- envoy_config_endpoint_v3_ClusterLoadAssignment_policy(
- cluster_load_assignment);
- if (policy != nullptr) {
- size_t drop_size;
- const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload* const*
- drop_overload =
- envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_drop_overloads(
- policy, &drop_size);
- for (size_t j = 0; j < drop_size; ++j) {
- grpc_error* error =
- DropParseAndAppend(drop_overload[j], eds_update.drop_config.get());
- if (error != GRPC_ERROR_NONE) return error;
- }
- }
- }
- return GRPC_ERROR_NONE;
-}
-
-TString TypeUrlInternalToExternal(y_absl::string_view type_url) {
- if (type_url == kLdsV2TypeUrl) {
- return XdsApi::kLdsTypeUrl;
- } else if (type_url == kRdsV2TypeUrl) {
- return XdsApi::kRdsTypeUrl;
- } else if (type_url == kCdsV2TypeUrl) {
- return XdsApi::kCdsTypeUrl;
- } else if (type_url == kEdsV2TypeUrl) {
- return XdsApi::kEdsTypeUrl;
- }
- return TString(type_url);
-}
-
-} // namespace
-
-XdsApi::AdsParseResult XdsApi::ParseAdsResponse(
- const grpc_slice& encoded_response,
- const std::set<y_absl::string_view>& expected_listener_names,
- const std::set<y_absl::string_view>& expected_route_configuration_names,
- const std::set<y_absl::string_view>& expected_cluster_names,
- const std::set<y_absl::string_view>& expected_eds_service_names) {
- AdsParseResult result;
- upb::Arena arena;
- // Decode the response.
- const envoy_service_discovery_v3_DiscoveryResponse* response =
- envoy_service_discovery_v3_DiscoveryResponse_parse(
- reinterpret_cast<const char*>(GRPC_SLICE_START_PTR(encoded_response)),
- GRPC_SLICE_LENGTH(encoded_response), arena.ptr());
- // If decoding fails, output an empty type_url and return.
- if (response == nullptr) {
- result.parse_error =
- GRPC_ERROR_CREATE_FROM_STATIC_STRING("Can't decode DiscoveryResponse.");
- return result;
- }
- MaybeLogDiscoveryResponse(client_, tracer_, response);
- // Record the type_url, the version_info, and the nonce of the response.
- result.type_url = TypeUrlInternalToExternal(UpbStringToAbsl(
- envoy_service_discovery_v3_DiscoveryResponse_type_url(response)));
- result.version = UpbStringToStdString(
- envoy_service_discovery_v3_DiscoveryResponse_version_info(response));
- result.nonce = UpbStringToStdString(
- envoy_service_discovery_v3_DiscoveryResponse_nonce(response));
- // Parse the response according to the resource type.
- if (IsLds(result.type_url)) {
- result.parse_error =
- LdsResponseParse(client_, tracer_, response, expected_listener_names,
- &result.lds_update_map, arena.ptr());
- } else if (IsRds(result.type_url)) {
- result.parse_error = RdsResponseParse(client_, tracer_, response,
- expected_route_configuration_names,
- &result.rds_update_map, arena.ptr());
- } else if (IsCds(result.type_url)) {
- result.parse_error =
- CdsResponseParse(client_, tracer_, response, expected_cluster_names,
- &result.cds_update_map, arena.ptr());
- } else if (IsEds(result.type_url)) {
- result.parse_error =
- EdsResponseParse(client_, tracer_, response, expected_eds_service_names,
- &result.eds_update_map, arena.ptr());
- }
- return result;
-}
-
-namespace {
-
-void MaybeLogLrsRequest(
- XdsClient* client, TraceFlag* tracer,
- const envoy_service_load_stats_v3_LoadStatsRequest* request,
- const TString& build_version) {
- if (GRPC_TRACE_FLAG_ENABLED(*tracer) &&
- gpr_should_log(GPR_LOG_SEVERITY_DEBUG)) {
- // TODO(roth): When we can upgrade upb, use upb textformat code to dump
- // the raw proto instead of doing this manually.
- std::vector<TString> fields;
- // node
- const auto* node =
- envoy_service_load_stats_v3_LoadStatsRequest_node(request);
- if (node != nullptr) {
- AddNodeLogFields(node, build_version, &fields);
- }
- // cluster_stats
- size_t num_cluster_stats;
- const struct envoy_config_endpoint_v3_ClusterStats* const* cluster_stats =
- envoy_service_load_stats_v3_LoadStatsRequest_cluster_stats(
- request, &num_cluster_stats);
- for (size_t i = 0; i < num_cluster_stats; ++i) {
- const auto* cluster_stat = cluster_stats[i];
- fields.emplace_back("cluster_stats {");
- // cluster_name
- AddStringField(
- " cluster_name",
- envoy_config_endpoint_v3_ClusterStats_cluster_name(cluster_stat),
- &fields);
- // cluster_service_name
- AddStringField(" cluster_service_name",
- envoy_config_endpoint_v3_ClusterStats_cluster_service_name(
- cluster_stat),
- &fields);
- // upstream_locality_stats
- size_t num_stats;
- const envoy_config_endpoint_v3_UpstreamLocalityStats* const* stats =
- envoy_config_endpoint_v3_ClusterStats_upstream_locality_stats(
- cluster_stat, &num_stats);
- for (size_t j = 0; j < num_stats; ++j) {
- const auto* stat = stats[j];
- fields.emplace_back(" upstream_locality_stats {");
- // locality
- const auto* locality =
- envoy_config_endpoint_v3_UpstreamLocalityStats_locality(stat);
- if (locality != nullptr) {
- fields.emplace_back(" locality {");
- AddLocalityField(3, locality, &fields);
- fields.emplace_back(" }");
- }
- // total_successful_requests
- fields.emplace_back(y_absl::StrCat(
- " total_successful_requests: ",
- envoy_config_endpoint_v3_UpstreamLocalityStats_total_successful_requests(
- stat)));
- // total_requests_in_progress
- fields.emplace_back(y_absl::StrCat(
- " total_requests_in_progress: ",
- envoy_config_endpoint_v3_UpstreamLocalityStats_total_requests_in_progress(
- stat)));
- // total_error_requests
- fields.emplace_back(y_absl::StrCat(
- " total_error_requests: ",
- envoy_config_endpoint_v3_UpstreamLocalityStats_total_error_requests(
- stat)));
- // total_issued_requests
- fields.emplace_back(y_absl::StrCat(
- " total_issued_requests: ",
- envoy_config_endpoint_v3_UpstreamLocalityStats_total_issued_requests(
- stat)));
- fields.emplace_back(" }");
- }
- // total_dropped_requests
- fields.emplace_back(y_absl::StrCat(
- " total_dropped_requests: ",
- envoy_config_endpoint_v3_ClusterStats_total_dropped_requests(
- cluster_stat)));
- // dropped_requests
- size_t num_drops;
- const envoy_config_endpoint_v3_ClusterStats_DroppedRequests* const*
- drops = envoy_config_endpoint_v3_ClusterStats_dropped_requests(
- cluster_stat, &num_drops);
- for (size_t j = 0; j < num_drops; ++j) {
- const auto* drop = drops[j];
- fields.emplace_back(" dropped_requests {");
- // category
- AddStringField(
- " category",
- envoy_config_endpoint_v3_ClusterStats_DroppedRequests_category(
- drop),
- &fields);
- // dropped_count
- fields.emplace_back(y_absl::StrCat(
- " dropped_count: ",
- envoy_config_endpoint_v3_ClusterStats_DroppedRequests_dropped_count(
- drop)));
- fields.emplace_back(" }");
- }
- // load_report_interval
- const auto* load_report_interval =
- envoy_config_endpoint_v3_ClusterStats_load_report_interval(
- cluster_stat);
- if (load_report_interval != nullptr) {
- fields.emplace_back(" load_report_interval {");
- fields.emplace_back(y_absl::StrCat(
- " seconds: ",
- google_protobuf_Duration_seconds(load_report_interval)));
- fields.emplace_back(
- y_absl::StrCat(" nanos: ",
- google_protobuf_Duration_nanos(load_report_interval)));
- fields.emplace_back(" }");
- }
- fields.emplace_back("}");
- }
- gpr_log(GPR_DEBUG, "[xds_client %p] constructed LRS request: %s", client,
- y_absl::StrJoin(fields, "\n").c_str());
- }
-}
-
-grpc_slice SerializeLrsRequest(
- const envoy_service_load_stats_v3_LoadStatsRequest* request,
- upb_arena* arena) {
- size_t output_length;
- char* output = envoy_service_load_stats_v3_LoadStatsRequest_serialize(
- request, arena, &output_length);
- return grpc_slice_from_copied_buffer(output, output_length);
-}
-
-} // namespace
-
-grpc_slice XdsApi::CreateLrsInitialRequest() {
- upb::Arena arena;
- // Create a request.
- envoy_service_load_stats_v3_LoadStatsRequest* request =
- envoy_service_load_stats_v3_LoadStatsRequest_new(arena.ptr());
- // Populate node.
- envoy_config_core_v3_Node* node_msg =
- envoy_service_load_stats_v3_LoadStatsRequest_mutable_node(request,
- arena.ptr());
- PopulateNode(arena.ptr(), bootstrap_, build_version_, user_agent_name_,
- node_msg);
- envoy_config_core_v3_Node_add_client_features(
- node_msg, upb_strview_makez("envoy.lrs.supports_send_all_clusters"),
- arena.ptr());
- MaybeLogLrsRequest(client_, tracer_, request, build_version_);
- return SerializeLrsRequest(request, arena.ptr());
-}
-
-namespace {
-
-void LocalityStatsPopulate(
- envoy_config_endpoint_v3_UpstreamLocalityStats* output,
- const XdsLocalityName& locality_name,
- const XdsClusterLocalityStats::Snapshot& snapshot, upb_arena* arena) {
- // Set locality.
- envoy_config_core_v3_Locality* locality =
- envoy_config_endpoint_v3_UpstreamLocalityStats_mutable_locality(output,
- arena);
- if (!locality_name.region().empty()) {
- envoy_config_core_v3_Locality_set_region(
- locality, StdStringToUpbString(locality_name.region()));
- }
- if (!locality_name.zone().empty()) {
- envoy_config_core_v3_Locality_set_zone(
- locality, StdStringToUpbString(locality_name.zone()));
- }
- if (!locality_name.sub_zone().empty()) {
- envoy_config_core_v3_Locality_set_sub_zone(
- locality, StdStringToUpbString(locality_name.sub_zone()));
- }
- // Set total counts.
- envoy_config_endpoint_v3_UpstreamLocalityStats_set_total_successful_requests(
- output, snapshot.total_successful_requests);
- envoy_config_endpoint_v3_UpstreamLocalityStats_set_total_requests_in_progress(
- output, snapshot.total_requests_in_progress);
- envoy_config_endpoint_v3_UpstreamLocalityStats_set_total_error_requests(
- output, snapshot.total_error_requests);
- envoy_config_endpoint_v3_UpstreamLocalityStats_set_total_issued_requests(
- output, snapshot.total_issued_requests);
- // Add backend metrics.
- for (const auto& p : snapshot.backend_metrics) {
- const TString& metric_name = p.first;
- const XdsClusterLocalityStats::BackendMetric& metric_value = p.second;
- envoy_config_endpoint_v3_EndpointLoadMetricStats* load_metric =
- envoy_config_endpoint_v3_UpstreamLocalityStats_add_load_metric_stats(
- output, arena);
- envoy_config_endpoint_v3_EndpointLoadMetricStats_set_metric_name(
- load_metric, StdStringToUpbString(metric_name));
- envoy_config_endpoint_v3_EndpointLoadMetricStats_set_num_requests_finished_with_metric(
- load_metric, metric_value.num_requests_finished_with_metric);
- envoy_config_endpoint_v3_EndpointLoadMetricStats_set_total_metric_value(
- load_metric, metric_value.total_metric_value);
- }
-}
-
-} // namespace
-
-grpc_slice XdsApi::CreateLrsRequest(
- ClusterLoadReportMap cluster_load_report_map) {
- upb::Arena arena;
- // Create a request.
- envoy_service_load_stats_v3_LoadStatsRequest* request =
- envoy_service_load_stats_v3_LoadStatsRequest_new(arena.ptr());
- for (auto& p : cluster_load_report_map) {
- const TString& cluster_name = p.first.first;
- const TString& eds_service_name = p.first.second;
- const ClusterLoadReport& load_report = p.second;
- // Add cluster stats.
- envoy_config_endpoint_v3_ClusterStats* cluster_stats =
- envoy_service_load_stats_v3_LoadStatsRequest_add_cluster_stats(
- request, arena.ptr());
- // Set the cluster name.
- envoy_config_endpoint_v3_ClusterStats_set_cluster_name(
- cluster_stats, StdStringToUpbString(cluster_name));
- // Set EDS service name, if non-empty.
- if (!eds_service_name.empty()) {
- envoy_config_endpoint_v3_ClusterStats_set_cluster_service_name(
- cluster_stats, StdStringToUpbString(eds_service_name));
- }
- // Add locality stats.
- for (const auto& p : load_report.locality_stats) {
- const XdsLocalityName& locality_name = *p.first;
- const auto& snapshot = p.second;
- envoy_config_endpoint_v3_UpstreamLocalityStats* locality_stats =
- envoy_config_endpoint_v3_ClusterStats_add_upstream_locality_stats(
- cluster_stats, arena.ptr());
- LocalityStatsPopulate(locality_stats, locality_name, snapshot,
- arena.ptr());
- }
- // Add dropped requests.
- uint64_t total_dropped_requests = 0;
- for (const auto& p : load_report.dropped_requests.categorized_drops) {
- const TString& category = p.first;
- const uint64_t count = p.second;
- envoy_config_endpoint_v3_ClusterStats_DroppedRequests* dropped_requests =
- envoy_config_endpoint_v3_ClusterStats_add_dropped_requests(
- cluster_stats, arena.ptr());
- envoy_config_endpoint_v3_ClusterStats_DroppedRequests_set_category(
- dropped_requests, StdStringToUpbString(category));
- envoy_config_endpoint_v3_ClusterStats_DroppedRequests_set_dropped_count(
- dropped_requests, count);
- total_dropped_requests += count;
- }
- total_dropped_requests += load_report.dropped_requests.uncategorized_drops;
- // Set total dropped requests.
- envoy_config_endpoint_v3_ClusterStats_set_total_dropped_requests(
- cluster_stats, total_dropped_requests);
- // Set real load report interval.
- gpr_timespec timespec =
- grpc_millis_to_timespec(load_report.load_report_interval, GPR_TIMESPAN);
- google_protobuf_Duration* load_report_interval =
- envoy_config_endpoint_v3_ClusterStats_mutable_load_report_interval(
- cluster_stats, arena.ptr());
- google_protobuf_Duration_set_seconds(load_report_interval, timespec.tv_sec);
- google_protobuf_Duration_set_nanos(load_report_interval, timespec.tv_nsec);
- }
- MaybeLogLrsRequest(client_, tracer_, request, build_version_);
- return SerializeLrsRequest(request, arena.ptr());
-}
-
-grpc_error* XdsApi::ParseLrsResponse(const grpc_slice& encoded_response,
- bool* send_all_clusters,
- std::set<TString>* cluster_names,
- grpc_millis* load_reporting_interval) {
- upb::Arena arena;
- // Decode the response.
- const envoy_service_load_stats_v3_LoadStatsResponse* decoded_response =
- envoy_service_load_stats_v3_LoadStatsResponse_parse(
- reinterpret_cast<const char*>(GRPC_SLICE_START_PTR(encoded_response)),
- GRPC_SLICE_LENGTH(encoded_response), arena.ptr());
- // Parse the response.
- if (decoded_response == nullptr) {
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING("Can't decode response.");
- }
- // Check send_all_clusters.
- if (envoy_service_load_stats_v3_LoadStatsResponse_send_all_clusters(
- decoded_response)) {
- *send_all_clusters = true;
- } else {
- // Store the cluster names.
- size_t size;
- const upb_strview* clusters =
- envoy_service_load_stats_v3_LoadStatsResponse_clusters(decoded_response,
- &size);
- for (size_t i = 0; i < size; ++i) {
- cluster_names->emplace(UpbStringToStdString(clusters[i]));
- }
- }
- // Get the load report interval.
- const google_protobuf_Duration* load_reporting_interval_duration =
- envoy_service_load_stats_v3_LoadStatsResponse_load_reporting_interval(
- decoded_response);
- gpr_timespec timespec{
- google_protobuf_Duration_seconds(load_reporting_interval_duration),
- google_protobuf_Duration_nanos(load_reporting_interval_duration),
- GPR_TIMESPAN};
- *load_reporting_interval = gpr_time_to_millis(timespec);
- return GRPC_ERROR_NONE;
-}
-
-} // namespace grpc_core
+/*
+ *
+ * Copyright 2018 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <grpc/support/port_platform.h>
+
+#include <algorithm>
+#include <cctype>
+#include <cstdint>
+#include <cstdlib>
+#include <util/generic/string.h>
+
+#include "y_absl/strings/str_cat.h"
+#include "y_absl/strings/str_format.h"
+#include "y_absl/strings/str_join.h"
+#include "y_absl/strings/str_split.h"
+
+#include "upb/upb.hpp"
+
+#include <grpc/impl/codegen/log.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/string_util.h>
+
+#include "src/core/ext/xds/xds_api.h"
+#include "src/core/lib/gpr/env.h"
+#include "src/core/lib/gpr/string.h"
+#include "src/core/lib/gpr/useful.h"
+#include "src/core/lib/iomgr/error.h"
+#include "src/core/lib/iomgr/sockaddr_utils.h"
+
+#include "envoy/config/cluster/v3/circuit_breaker.upb.h"
+#include "envoy/config/cluster/v3/cluster.upb.h"
+#include "envoy/config/core/v3/address.upb.h"
+#include "envoy/config/core/v3/base.upb.h"
+#include "envoy/config/core/v3/config_source.upb.h"
+#include "envoy/config/core/v3/health_check.upb.h"
+#include "envoy/config/endpoint/v3/endpoint.upb.h"
+#include "envoy/config/endpoint/v3/endpoint_components.upb.h"
+#include "envoy/config/endpoint/v3/load_report.upb.h"
+#include "envoy/config/listener/v3/api_listener.upb.h"
+#include "envoy/config/listener/v3/listener.upb.h"
+#include "envoy/config/route/v3/route.upb.h"
+#include "envoy/config/route/v3/route_components.upb.h"
+#include "envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h"
+#include "envoy/extensions/transport_sockets/tls/v3/common.upb.h"
+#include "envoy/extensions/transport_sockets/tls/v3/tls.upb.h"
+#include "envoy/service/cluster/v3/cds.upb.h"
+#include "envoy/service/discovery/v3/discovery.upb.h"
+#include "envoy/service/endpoint/v3/eds.upb.h"
+#include "envoy/service/listener/v3/lds.upb.h"
+#include "envoy/service/load_stats/v3/lrs.upb.h"
+#include "envoy/service/route/v3/rds.upb.h"
+#include "envoy/type/matcher/v3/regex.upb.h"
+#include "envoy/type/matcher/v3/string.upb.h"
+#include "envoy/type/v3/percent.upb.h"
+#include "envoy/type/v3/range.upb.h"
+#include "google/protobuf/any.upb.h"
+#include "google/protobuf/duration.upb.h"
+#include "google/protobuf/struct.upb.h"
+#include "google/protobuf/wrappers.upb.h"
+#include "google/rpc/status.upb.h"
+#include "upb/upb.h"
+
+namespace grpc_core {
+
+//
+// XdsApi::Route::Matchers::PathMatcher
+//
+
+XdsApi::Route::Matchers::PathMatcher::PathMatcher(const PathMatcher& other)
+ : type(other.type) {
+ if (type == PathMatcherType::REGEX) {
+ regex_matcher = y_absl::make_unique<RE2>(other.regex_matcher->pattern());
+ } else {
+ string_matcher = other.string_matcher;
+ }
+}
+
+XdsApi::Route::Matchers::PathMatcher& XdsApi::Route::Matchers::PathMatcher::
+operator=(const PathMatcher& other) {
+ type = other.type;
+ if (type == PathMatcherType::REGEX) {
+ regex_matcher = y_absl::make_unique<RE2>(other.regex_matcher->pattern());
+ } else {
+ string_matcher = other.string_matcher;
+ }
+ return *this;
+}
+
+bool XdsApi::Route::Matchers::PathMatcher::operator==(
+ const PathMatcher& other) const {
+ if (type != other.type) return false;
+ if (type == PathMatcherType::REGEX) {
+ // Should never be null.
+ if (regex_matcher == nullptr || other.regex_matcher == nullptr) {
+ return false;
+ }
+ return regex_matcher->pattern() == other.regex_matcher->pattern();
+ }
+ return string_matcher == other.string_matcher;
+}
+
+TString XdsApi::Route::Matchers::PathMatcher::ToString() const {
+ TString path_type_string;
+ switch (type) {
+ case PathMatcherType::PATH:
+ path_type_string = "path match";
+ break;
+ case PathMatcherType::PREFIX:
+ path_type_string = "prefix match";
+ break;
+ case PathMatcherType::REGEX:
+ path_type_string = "regex match";
+ break;
+ default:
+ break;
+ }
+ return y_absl::StrFormat("Path %s:%s", path_type_string,
+ type == PathMatcherType::REGEX
+ ? regex_matcher->pattern()
+ : string_matcher);
+}
+
+//
+// XdsApi::Route::Matchers::HeaderMatcher
+//
+
+XdsApi::Route::Matchers::HeaderMatcher::HeaderMatcher(
+ const HeaderMatcher& other)
+ : name(other.name), type(other.type), invert_match(other.invert_match) {
+ switch (type) {
+ case HeaderMatcherType::REGEX:
+ regex_match = y_absl::make_unique<RE2>(other.regex_match->pattern());
+ break;
+ case HeaderMatcherType::RANGE:
+ range_start = other.range_start;
+ range_end = other.range_end;
+ break;
+ case HeaderMatcherType::PRESENT:
+ present_match = other.present_match;
+ break;
+ default:
+ string_matcher = other.string_matcher;
+ }
+}
+
+XdsApi::Route::Matchers::HeaderMatcher& XdsApi::Route::Matchers::HeaderMatcher::
+operator=(const HeaderMatcher& other) {
+ name = other.name;
+ type = other.type;
+ invert_match = other.invert_match;
+ switch (type) {
+ case HeaderMatcherType::REGEX:
+ regex_match = y_absl::make_unique<RE2>(other.regex_match->pattern());
+ break;
+ case HeaderMatcherType::RANGE:
+ range_start = other.range_start;
+ range_end = other.range_end;
+ break;
+ case HeaderMatcherType::PRESENT:
+ present_match = other.present_match;
+ break;
+ default:
+ string_matcher = other.string_matcher;
+ }
+ return *this;
+}
+
+bool XdsApi::Route::Matchers::HeaderMatcher::operator==(
+ const HeaderMatcher& other) const {
+ if (name != other.name) return false;
+ if (type != other.type) return false;
+ if (invert_match != other.invert_match) return false;
+ switch (type) {
+ case HeaderMatcherType::REGEX:
+ return regex_match->pattern() != other.regex_match->pattern();
+ case HeaderMatcherType::RANGE:
+ return range_start != other.range_start && range_end != other.range_end;
+ case HeaderMatcherType::PRESENT:
+ return present_match != other.present_match;
+ default:
+ return string_matcher != other.string_matcher;
+ }
+}
+
+TString XdsApi::Route::Matchers::HeaderMatcher::ToString() const {
+ switch (type) {
+ case HeaderMatcherType::EXACT:
+ return y_absl::StrFormat("Header exact match:%s %s:%s",
+ invert_match ? " not" : "", name, string_matcher);
+ case HeaderMatcherType::REGEX:
+ return y_absl::StrFormat("Header regex match:%s %s:%s",
+ invert_match ? " not" : "", name,
+ regex_match->pattern());
+ case HeaderMatcherType::RANGE:
+ return y_absl::StrFormat("Header range match:%s %s:[%d, %d)",
+ invert_match ? " not" : "", name, range_start,
+ range_end);
+ case HeaderMatcherType::PRESENT:
+ return y_absl::StrFormat("Header present match:%s %s:%s",
+ invert_match ? " not" : "", name,
+ present_match ? "true" : "false");
+ case HeaderMatcherType::PREFIX:
+ return y_absl::StrFormat("Header prefix match:%s %s:%s",
+ invert_match ? " not" : "", name, string_matcher);
+ case HeaderMatcherType::SUFFIX:
+ return y_absl::StrFormat("Header suffix match:%s %s:%s",
+ invert_match ? " not" : "", name, string_matcher);
+ default:
+ return "";
+ }
+}
+
+//
+// XdsApi::Route
+//
+
+TString XdsApi::Route::Matchers::ToString() const {
+ std::vector<TString> contents;
+ contents.push_back(path_matcher.ToString());
+ for (const HeaderMatcher& header_matcher : header_matchers) {
+ contents.push_back(header_matcher.ToString());
+ }
+ if (fraction_per_million.has_value()) {
+ contents.push_back(y_absl::StrFormat("Fraction Per Million %d",
+ fraction_per_million.value()));
+ }
+ return y_absl::StrJoin(contents, "\n");
+}
+
+TString XdsApi::Route::ClusterWeight::ToString() const {
+ return y_absl::StrFormat("{cluster=%s, weight=%d}", name, weight);
+}
+
+TString XdsApi::Route::ToString() const {
+ std::vector<TString> contents;
+ contents.push_back(matchers.ToString());
+ if (!cluster_name.empty()) {
+ contents.push_back(y_absl::StrFormat("Cluster name: %s", cluster_name));
+ }
+ for (const ClusterWeight& cluster_weight : weighted_clusters) {
+ contents.push_back(cluster_weight.ToString());
+ }
+ return y_absl::StrJoin(contents, "\n");
+}
+
+//
+// XdsApi::RdsUpdate
+//
+
+TString XdsApi::RdsUpdate::ToString() const {
+ std::vector<TString> vhosts;
+ for (const VirtualHost& vhost : virtual_hosts) {
+ vhosts.push_back(
+ y_absl::StrCat("vhost={\n"
+ " domains=[",
+ y_absl::StrJoin(vhost.domains, ", "),
+ "]\n"
+ " routes=[\n"));
+ for (const XdsApi::Route& route : vhost.routes) {
+ vhosts.push_back(" {\n");
+ vhosts.push_back(route.ToString());
+ vhosts.push_back("\n }\n");
+ }
+ vhosts.push_back(" ]\n");
+ vhosts.push_back("]\n");
+ }
+ return y_absl::StrJoin(vhosts, "");
+}
+
+namespace {
+
+// Better match type has smaller value.
+enum MatchType {
+ EXACT_MATCH,
+ SUFFIX_MATCH,
+ PREFIX_MATCH,
+ UNIVERSE_MATCH,
+ INVALID_MATCH,
+};
+
+// Returns true if match succeeds.
+bool DomainMatch(MatchType match_type, TString domain_pattern,
+ TString expected_host_name) {
+ // Normalize the args to lower-case. Domain matching is case-insensitive.
+ std::transform(domain_pattern.cbegin(), domain_pattern.cend(),
+ domain_pattern.begin(),
+ [](unsigned char c) { return std::tolower(c); });
+ std::transform(expected_host_name.cbegin(), expected_host_name.cend(),
+ expected_host_name.begin(),
+ [](unsigned char c) { return std::tolower(c); });
+ if (match_type == EXACT_MATCH) {
+ return domain_pattern == expected_host_name;
+ } else if (match_type == SUFFIX_MATCH) {
+ // Asterisk must match at least one char.
+ if (expected_host_name.size() < domain_pattern.size()) return false;
+ y_absl::string_view pattern_suffix(domain_pattern.c_str() + 1);
+ y_absl::string_view host_suffix(expected_host_name.c_str() +
+ expected_host_name.size() -
+ pattern_suffix.size());
+ return pattern_suffix == host_suffix;
+ } else if (match_type == PREFIX_MATCH) {
+ // Asterisk must match at least one char.
+ if (expected_host_name.size() < domain_pattern.size()) return false;
+ y_absl::string_view pattern_prefix(domain_pattern.c_str(),
+ domain_pattern.size() - 1);
+ y_absl::string_view host_prefix(expected_host_name.c_str(),
+ pattern_prefix.size());
+ return pattern_prefix == host_prefix;
+ } else {
+ return match_type == UNIVERSE_MATCH;
+ }
+}
+
+MatchType DomainPatternMatchType(const TString& domain_pattern) {
+ if (domain_pattern.empty()) return INVALID_MATCH;
+ if (domain_pattern.find('*') == TString::npos) return EXACT_MATCH;
+ if (domain_pattern == "*") return UNIVERSE_MATCH;
+ if (domain_pattern[0] == '*') return SUFFIX_MATCH;
+ if (domain_pattern[domain_pattern.size() - 1] == '*') return PREFIX_MATCH;
+ return INVALID_MATCH;
+}
+
+} // namespace
+
+XdsApi::RdsUpdate::VirtualHost* XdsApi::RdsUpdate::FindVirtualHostForDomain(
+ const TString& domain) {
+ // Find the best matched virtual host.
+ // The search order for 4 groups of domain patterns:
+ // 1. Exact match.
+ // 2. Suffix match (e.g., "*ABC").
+ // 3. Prefix match (e.g., "ABC*").
+ // 4. Universe match (i.e., "*").
+ // Within each group, longest match wins.
+ // If the same best matched domain pattern appears in multiple virtual hosts,
+ // the first matched virtual host wins.
+ VirtualHost* target_vhost = nullptr;
+ MatchType best_match_type = INVALID_MATCH;
+ size_t longest_match = 0;
+ // Check each domain pattern in each virtual host to determine the best
+ // matched virtual host.
+ for (VirtualHost& vhost : virtual_hosts) {
+ for (const TString& domain_pattern : vhost.domains) {
+ // Check the match type first. Skip the pattern if it's not better than
+ // current match.
+ const MatchType match_type = DomainPatternMatchType(domain_pattern);
+ // This should be caught by RouteConfigParse().
+ GPR_ASSERT(match_type != INVALID_MATCH);
+ if (match_type > best_match_type) continue;
+ if (match_type == best_match_type &&
+ domain_pattern.size() <= longest_match) {
+ continue;
+ }
+ // Skip if match fails.
+ if (!DomainMatch(match_type, domain_pattern, domain)) continue;
+ // Choose this match.
+ target_vhost = &vhost;
+ best_match_type = match_type;
+ longest_match = domain_pattern.size();
+ if (best_match_type == EXACT_MATCH) break;
+ }
+ if (best_match_type == EXACT_MATCH) break;
+ }
+ return target_vhost;
+}
+
+//
+// XdsApi::StringMatcher
+//
+
+XdsApi::StringMatcher::StringMatcher(const StringMatcher& other)
+ : type(other.type) {
+ switch (type) {
+ case StringMatcherType::SAFE_REGEX:
+ regex_match = y_absl::make_unique<RE2>(other.regex_match->pattern());
+ break;
+ default:
+ string_matcher = other.string_matcher;
+ }
+}
+
+XdsApi::StringMatcher& XdsApi::StringMatcher::operator=(
+ const StringMatcher& other) {
+ type = other.type;
+ switch (type) {
+ case StringMatcherType::SAFE_REGEX:
+ regex_match = y_absl::make_unique<RE2>(other.regex_match->pattern());
+ break;
+ default:
+ string_matcher = other.string_matcher;
+ }
+ return *this;
+}
+
+bool XdsApi::StringMatcher::operator==(const StringMatcher& other) const {
+ if (type != other.type) return false;
+ switch (type) {
+ case StringMatcherType::SAFE_REGEX:
+ return regex_match->pattern() != other.regex_match->pattern();
+ default:
+ return string_matcher != other.string_matcher;
+ }
+}
+
+//
+// XdsApi::EdsUpdate
+//
+
+TString XdsApi::EdsUpdate::Priority::Locality::ToString() const {
+ std::vector<TString> endpoint_strings;
+ for (const ServerAddress& endpoint : endpoints) {
+ endpoint_strings.emplace_back(endpoint.ToString());
+ }
+ return y_absl::StrCat("{name=", name->AsHumanReadableString(),
+ ", lb_weight=", lb_weight, ", endpoints=[",
+ y_absl::StrJoin(endpoint_strings, ", "), "]}");
+}
+
+bool XdsApi::EdsUpdate::Priority::operator==(const Priority& other) const {
+ if (localities.size() != other.localities.size()) return false;
+ auto it1 = localities.begin();
+ auto it2 = other.localities.begin();
+ while (it1 != localities.end()) {
+ if (*it1->first != *it2->first) return false;
+ if (it1->second != it2->second) return false;
+ ++it1;
+ ++it2;
+ }
+ return true;
+}
+
+TString XdsApi::EdsUpdate::Priority::ToString() const {
+ std::vector<TString> locality_strings;
+ for (const auto& p : localities) {
+ locality_strings.emplace_back(p.second.ToString());
+ }
+ return y_absl::StrCat("[", y_absl::StrJoin(locality_strings, ", "), "]");
+}
+
+bool XdsApi::EdsUpdate::DropConfig::ShouldDrop(
+ const TString** category_name) const {
+ for (size_t i = 0; i < drop_category_list_.size(); ++i) {
+ const auto& drop_category = drop_category_list_[i];
+ // Generate a random number in [0, 1000000).
+ const uint32_t random = static_cast<uint32_t>(rand()) % 1000000;
+ if (random < drop_category.parts_per_million) {
+ *category_name = &drop_category.name;
+ return true;
+ }
+ }
+ return false;
+}
+
+TString XdsApi::EdsUpdate::DropConfig::ToString() const {
+ std::vector<TString> category_strings;
+ for (const DropCategory& category : drop_category_list_) {
+ category_strings.emplace_back(
+ y_absl::StrCat(category.name, "=", category.parts_per_million));
+ }
+ return y_absl::StrCat("{[", y_absl::StrJoin(category_strings, ", "),
+ "], drop_all=", drop_all_, "}");
+}
+
+TString XdsApi::EdsUpdate::ToString() const {
+ std::vector<TString> priority_strings;
+ for (size_t i = 0; i < priorities.size(); ++i) {
+ const Priority& priority = priorities[i];
+ priority_strings.emplace_back(
+ y_absl::StrCat("priority ", i, ": ", priority.ToString()));
+ }
+ return y_absl::StrCat("priorities=[", y_absl::StrJoin(priority_strings, ", "),
+ "], drop_config=", drop_config->ToString());
+}
+
+//
+// XdsApi
+//
+
+const char* XdsApi::kLdsTypeUrl =
+ "type.googleapis.com/envoy.config.listener.v3.Listener";
+const char* XdsApi::kRdsTypeUrl =
+ "type.googleapis.com/envoy.config.route.v3.RouteConfiguration";
+const char* XdsApi::kCdsTypeUrl =
+ "type.googleapis.com/envoy.config.cluster.v3.Cluster";
+const char* XdsApi::kEdsTypeUrl =
+ "type.googleapis.com/envoy.config.endpoint.v3.ClusterLoadAssignment";
+
+namespace {
+
+const char* kLdsV2TypeUrl = "type.googleapis.com/envoy.api.v2.Listener";
+const char* kRdsV2TypeUrl =
+ "type.googleapis.com/envoy.api.v2.RouteConfiguration";
+const char* kCdsV2TypeUrl = "type.googleapis.com/envoy.api.v2.Cluster";
+const char* kEdsV2TypeUrl =
+ "type.googleapis.com/envoy.api.v2.ClusterLoadAssignment";
+
+bool IsLds(y_absl::string_view type_url) {
+ return type_url == XdsApi::kLdsTypeUrl || type_url == kLdsV2TypeUrl;
+}
+
+bool IsRds(y_absl::string_view type_url) {
+ return type_url == XdsApi::kRdsTypeUrl || type_url == kRdsV2TypeUrl;
+}
+
+bool IsCds(y_absl::string_view type_url) {
+ return type_url == XdsApi::kCdsTypeUrl || type_url == kCdsV2TypeUrl;
+}
+
+bool IsEds(y_absl::string_view type_url) {
+ return type_url == XdsApi::kEdsTypeUrl || type_url == kEdsV2TypeUrl;
+}
+
+} // namespace
+
+XdsApi::XdsApi(XdsClient* client, TraceFlag* tracer,
+ const XdsBootstrap* bootstrap)
+ : client_(client),
+ tracer_(tracer),
+ use_v3_(bootstrap != nullptr && bootstrap->server().ShouldUseV3()),
+ bootstrap_(bootstrap),
+ build_version_(y_absl::StrCat("gRPC C-core ", GPR_PLATFORM_STRING, " ",
+ grpc_version_string())),
+ user_agent_name_(y_absl::StrCat("gRPC C-core ", GPR_PLATFORM_STRING)) {}
+
+namespace {
+
+// Works for both TString and y_absl::string_view.
+template <typename T>
+inline upb_strview StdStringToUpbString(const T& str) {
+ return upb_strview_make(str.data(), str.size());
+}
+
+void PopulateMetadataValue(upb_arena* arena, google_protobuf_Value* value_pb,
+ const Json& value);
+
+void PopulateListValue(upb_arena* arena, google_protobuf_ListValue* list_value,
+ const Json::Array& values) {
+ for (const auto& value : values) {
+ auto* value_pb = google_protobuf_ListValue_add_values(list_value, arena);
+ PopulateMetadataValue(arena, value_pb, value);
+ }
+}
+
+void PopulateMetadata(upb_arena* arena, google_protobuf_Struct* metadata_pb,
+ const Json::Object& metadata) {
+ for (const auto& p : metadata) {
+ google_protobuf_Value* value = google_protobuf_Value_new(arena);
+ PopulateMetadataValue(arena, value, p.second);
+ google_protobuf_Struct_fields_set(
+ metadata_pb, StdStringToUpbString(p.first), value, arena);
+ }
+}
+
+void PopulateMetadataValue(upb_arena* arena, google_protobuf_Value* value_pb,
+ const Json& value) {
+ switch (value.type()) {
+ case Json::Type::JSON_NULL:
+ google_protobuf_Value_set_null_value(value_pb, 0);
+ break;
+ case Json::Type::NUMBER:
+ google_protobuf_Value_set_number_value(
+ value_pb, strtod(value.string_value().c_str(), nullptr));
+ break;
+ case Json::Type::STRING:
+ google_protobuf_Value_set_string_value(
+ value_pb, StdStringToUpbString(value.string_value()));
+ break;
+ case Json::Type::JSON_TRUE:
+ google_protobuf_Value_set_bool_value(value_pb, true);
+ break;
+ case Json::Type::JSON_FALSE:
+ google_protobuf_Value_set_bool_value(value_pb, false);
+ break;
+ case Json::Type::OBJECT: {
+ google_protobuf_Struct* struct_value =
+ google_protobuf_Value_mutable_struct_value(value_pb, arena);
+ PopulateMetadata(arena, struct_value, value.object_value());
+ break;
+ }
+ case Json::Type::ARRAY: {
+ google_protobuf_ListValue* list_value =
+ google_protobuf_Value_mutable_list_value(value_pb, arena);
+ PopulateListValue(arena, list_value, value.array_value());
+ break;
+ }
+ }
+}
+
+// Helper functions to manually do protobuf string encoding, so that we
+// can populate the node build_version field that was removed in v3.
+TString EncodeVarint(uint64_t val) {
+ TString data;
+ do {
+ uint8_t byte = val & 0x7fU;
+ val >>= 7;
+ if (val) byte |= 0x80U;
+ data += byte;
+ } while (val);
+ return data;
+}
+TString EncodeTag(uint32_t field_number, uint8_t wire_type) {
+ return EncodeVarint((field_number << 3) | wire_type);
+}
+TString EncodeStringField(uint32_t field_number, const TString& str) {
+ static const uint8_t kDelimitedWireType = 2;
+ return EncodeTag(field_number, kDelimitedWireType) +
+ EncodeVarint(str.size()) + str;
+}
+
+void PopulateBuildVersion(upb_arena* arena, envoy_config_core_v3_Node* node_msg,
+ const TString& build_version) {
+ TString encoded_build_version = EncodeStringField(5, build_version);
+ // TODO(roth): This should use upb_msg_addunknown(), but that API is
+ // broken in the current version of upb, so we're using the internal
+ // API for now. Change this once we upgrade to a version of upb that
+ // fixes this bug.
+ _upb_msg_addunknown(node_msg, encoded_build_version.data(),
+ encoded_build_version.size(), arena);
+}
+
+void PopulateNode(upb_arena* arena, const XdsBootstrap* bootstrap,
+ const TString& build_version,
+ const TString& user_agent_name,
+ envoy_config_core_v3_Node* node_msg) {
+ const XdsBootstrap::Node* node = bootstrap->node();
+ if (node != nullptr) {
+ if (!node->id.empty()) {
+ envoy_config_core_v3_Node_set_id(node_msg,
+ StdStringToUpbString(node->id));
+ }
+ if (!node->cluster.empty()) {
+ envoy_config_core_v3_Node_set_cluster(
+ node_msg, StdStringToUpbString(node->cluster));
+ }
+ if (!node->metadata.object_value().empty()) {
+ google_protobuf_Struct* metadata =
+ envoy_config_core_v3_Node_mutable_metadata(node_msg, arena);
+ PopulateMetadata(arena, metadata, node->metadata.object_value());
+ }
+ if (!node->locality_region.empty() || !node->locality_zone.empty() ||
+ !node->locality_subzone.empty()) {
+ envoy_config_core_v3_Locality* locality =
+ envoy_config_core_v3_Node_mutable_locality(node_msg, arena);
+ if (!node->locality_region.empty()) {
+ envoy_config_core_v3_Locality_set_region(
+ locality, StdStringToUpbString(node->locality_region));
+ }
+ if (!node->locality_zone.empty()) {
+ envoy_config_core_v3_Locality_set_zone(
+ locality, StdStringToUpbString(node->locality_zone));
+ }
+ if (!node->locality_subzone.empty()) {
+ envoy_config_core_v3_Locality_set_sub_zone(
+ locality, StdStringToUpbString(node->locality_subzone));
+ }
+ }
+ }
+ if (!bootstrap->server().ShouldUseV3()) {
+ PopulateBuildVersion(arena, node_msg, build_version);
+ }
+ envoy_config_core_v3_Node_set_user_agent_name(
+ node_msg, StdStringToUpbString(user_agent_name));
+ envoy_config_core_v3_Node_set_user_agent_version(
+ node_msg, upb_strview_makez(grpc_version_string()));
+ envoy_config_core_v3_Node_add_client_features(
+ node_msg, upb_strview_makez("envoy.lb.does_not_support_overprovisioning"),
+ arena);
+}
+
+inline y_absl::string_view UpbStringToAbsl(const upb_strview& str) {
+ return y_absl::string_view(str.data, str.size);
+}
+
+inline TString UpbStringToStdString(const upb_strview& str) {
+ return TString(str.data, str.size);
+}
+
+inline void AddStringField(const char* name, const upb_strview& value,
+ std::vector<TString>* fields,
+ bool add_if_empty = false) {
+ if (value.size > 0 || add_if_empty) {
+ fields->emplace_back(
+ y_absl::StrCat(name, ": \"", UpbStringToAbsl(value), "\""));
+ }
+}
+
+inline void AddUInt32ValueField(const char* name,
+ const google_protobuf_UInt32Value* value,
+ std::vector<TString>* fields) {
+ if (value != nullptr) {
+ fields->emplace_back(y_absl::StrCat(
+ name, " { value: ", google_protobuf_UInt32Value_value(value), " }"));
+ }
+}
+
+inline void AddLocalityField(int indent_level,
+ const envoy_config_core_v3_Locality* locality,
+ std::vector<TString>* fields) {
+ TString indent =
+ y_absl::StrJoin(std::vector<TString>(indent_level, " "), "");
+ // region
+ TString field = y_absl::StrCat(indent, "region");
+ AddStringField(field.c_str(), envoy_config_core_v3_Locality_region(locality),
+ fields);
+ // zone
+ field = y_absl::StrCat(indent, "zone");
+ AddStringField(field.c_str(), envoy_config_core_v3_Locality_zone(locality),
+ fields);
+ // sub_zone
+ field = y_absl::StrCat(indent, "sub_zone");
+ AddStringField(field.c_str(),
+ envoy_config_core_v3_Locality_sub_zone(locality), fields);
+}
+
+void AddNodeLogFields(const envoy_config_core_v3_Node* node,
+ const TString& build_version,
+ std::vector<TString>* fields) {
+ fields->emplace_back("node {");
+ // id
+ AddStringField(" id", envoy_config_core_v3_Node_id(node), fields);
+ // metadata
+ const google_protobuf_Struct* metadata =
+ envoy_config_core_v3_Node_metadata(node);
+ if (metadata != nullptr) {
+ fields->emplace_back(" metadata {");
+ size_t entry_idx = UPB_MAP_BEGIN;
+ while (true) {
+ const google_protobuf_Struct_FieldsEntry* entry =
+ google_protobuf_Struct_fields_next(metadata, &entry_idx);
+ if (entry == nullptr) break;
+ fields->emplace_back(" field {");
+ // key
+ AddStringField(" key", google_protobuf_Struct_FieldsEntry_key(entry),
+ fields);
+ // value
+ const google_protobuf_Value* value =
+ google_protobuf_Struct_FieldsEntry_value(entry);
+ if (value != nullptr) {
+ TString value_str;
+ if (google_protobuf_Value_has_string_value(value)) {
+ value_str = y_absl::StrCat(
+ "string_value: \"",
+ UpbStringToAbsl(google_protobuf_Value_string_value(value)), "\"");
+ } else if (google_protobuf_Value_has_null_value(value)) {
+ value_str = "null_value: NULL_VALUE";
+ } else if (google_protobuf_Value_has_number_value(value)) {
+ value_str = y_absl::StrCat("double_value: ",
+ google_protobuf_Value_number_value(value));
+ } else if (google_protobuf_Value_has_bool_value(value)) {
+ value_str = y_absl::StrCat("bool_value: ",
+ google_protobuf_Value_bool_value(value));
+ } else if (google_protobuf_Value_has_struct_value(value)) {
+ value_str = "struct_value: <not printed>";
+ } else if (google_protobuf_Value_has_list_value(value)) {
+ value_str = "list_value: <not printed>";
+ } else {
+ value_str = "<unknown>";
+ }
+ fields->emplace_back(y_absl::StrCat(" value { ", value_str, " }"));
+ }
+ fields->emplace_back(" }");
+ }
+ fields->emplace_back(" }");
+ }
+ // locality
+ const envoy_config_core_v3_Locality* locality =
+ envoy_config_core_v3_Node_locality(node);
+ if (locality != nullptr) {
+ fields->emplace_back(" locality {");
+ AddLocalityField(2, locality, fields);
+ fields->emplace_back(" }");
+ }
+ // build_version (doesn't exist in v3 proto; this is a horrible hack)
+ if (!build_version.empty()) {
+ fields->emplace_back(
+ y_absl::StrCat(" build_version: \"", build_version, "\""));
+ }
+ // user_agent_name
+ AddStringField(" user_agent_name",
+ envoy_config_core_v3_Node_user_agent_name(node), fields);
+ // user_agent_version
+ AddStringField(" user_agent_version",
+ envoy_config_core_v3_Node_user_agent_version(node), fields);
+ // client_features
+ size_t num_client_features;
+ const upb_strview* client_features =
+ envoy_config_core_v3_Node_client_features(node, &num_client_features);
+ for (size_t i = 0; i < num_client_features; ++i) {
+ AddStringField(" client_features", client_features[i], fields);
+ }
+ fields->emplace_back("}");
+}
+
+void MaybeLogDiscoveryRequest(
+ XdsClient* client, TraceFlag* tracer,
+ const envoy_service_discovery_v3_DiscoveryRequest* request,
+ const TString& build_version) {
+ if (GRPC_TRACE_FLAG_ENABLED(*tracer) &&
+ gpr_should_log(GPR_LOG_SEVERITY_DEBUG)) {
+ // TODO(roth): When we can upgrade upb, use upb textformat code to dump
+ // the raw proto instead of doing this manually.
+ std::vector<TString> fields;
+ // version_info
+ AddStringField(
+ "version_info",
+ envoy_service_discovery_v3_DiscoveryRequest_version_info(request),
+ &fields);
+ // node
+ const envoy_config_core_v3_Node* node =
+ envoy_service_discovery_v3_DiscoveryRequest_node(request);
+ if (node != nullptr) AddNodeLogFields(node, build_version, &fields);
+ // resource_names
+ size_t num_resource_names;
+ const upb_strview* resource_names =
+ envoy_service_discovery_v3_DiscoveryRequest_resource_names(
+ request, &num_resource_names);
+ for (size_t i = 0; i < num_resource_names; ++i) {
+ AddStringField("resource_names", resource_names[i], &fields);
+ }
+ // type_url
+ AddStringField(
+ "type_url",
+ envoy_service_discovery_v3_DiscoveryRequest_type_url(request), &fields);
+ // response_nonce
+ AddStringField(
+ "response_nonce",
+ envoy_service_discovery_v3_DiscoveryRequest_response_nonce(request),
+ &fields);
+ // error_detail
+ const struct google_rpc_Status* error_detail =
+ envoy_service_discovery_v3_DiscoveryRequest_error_detail(request);
+ if (error_detail != nullptr) {
+ fields.emplace_back("error_detail {");
+ // code
+ int32_t code = google_rpc_Status_code(error_detail);
+ if (code != 0) fields.emplace_back(y_absl::StrCat(" code: ", code));
+ // message
+ AddStringField(" message", google_rpc_Status_message(error_detail),
+ &fields);
+ fields.emplace_back("}");
+ }
+ gpr_log(GPR_DEBUG, "[xds_client %p] constructed ADS request: %s", client,
+ y_absl::StrJoin(fields, "\n").c_str());
+ }
+}
+
+grpc_slice SerializeDiscoveryRequest(
+ upb_arena* arena, envoy_service_discovery_v3_DiscoveryRequest* request) {
+ size_t output_length;
+ char* output = envoy_service_discovery_v3_DiscoveryRequest_serialize(
+ request, arena, &output_length);
+ return grpc_slice_from_copied_buffer(output, output_length);
+}
+
+y_absl::string_view TypeUrlExternalToInternal(bool use_v3,
+ const TString& type_url) {
+ if (!use_v3) {
+ if (type_url == XdsApi::kLdsTypeUrl) {
+ return kLdsV2TypeUrl;
+ }
+ if (type_url == XdsApi::kRdsTypeUrl) {
+ return kRdsV2TypeUrl;
+ }
+ if (type_url == XdsApi::kCdsTypeUrl) {
+ return kCdsV2TypeUrl;
+ }
+ if (type_url == XdsApi::kEdsTypeUrl) {
+ return kEdsV2TypeUrl;
+ }
+ }
+ return type_url;
+}
+
+} // namespace
+
+grpc_slice XdsApi::CreateAdsRequest(
+ const TString& type_url,
+ const std::set<y_absl::string_view>& resource_names,
+ const TString& version, const TString& nonce, grpc_error* error,
+ bool populate_node) {
+ upb::Arena arena;
+ // Create a request.
+ envoy_service_discovery_v3_DiscoveryRequest* request =
+ envoy_service_discovery_v3_DiscoveryRequest_new(arena.ptr());
+ // Set type_url.
+ y_absl::string_view real_type_url =
+ TypeUrlExternalToInternal(use_v3_, type_url);
+ envoy_service_discovery_v3_DiscoveryRequest_set_type_url(
+ request, StdStringToUpbString(real_type_url));
+ // Set version_info.
+ if (!version.empty()) {
+ envoy_service_discovery_v3_DiscoveryRequest_set_version_info(
+ request, StdStringToUpbString(version));
+ }
+ // Set nonce.
+ if (!nonce.empty()) {
+ envoy_service_discovery_v3_DiscoveryRequest_set_response_nonce(
+ request, StdStringToUpbString(nonce));
+ }
+ // Set error_detail if it's a NACK.
+ if (error != GRPC_ERROR_NONE) {
+ grpc_slice error_description_slice;
+ GPR_ASSERT(grpc_error_get_str(error, GRPC_ERROR_STR_DESCRIPTION,
+ &error_description_slice));
+ upb_strview error_description_strview =
+ upb_strview_make(reinterpret_cast<const char*>(
+ GPR_SLICE_START_PTR(error_description_slice)),
+ GPR_SLICE_LENGTH(error_description_slice));
+ google_rpc_Status* error_detail =
+ envoy_service_discovery_v3_DiscoveryRequest_mutable_error_detail(
+ request, arena.ptr());
+ google_rpc_Status_set_message(error_detail, error_description_strview);
+ GRPC_ERROR_UNREF(error);
+ }
+ // Populate node.
+ if (populate_node) {
+ envoy_config_core_v3_Node* node_msg =
+ envoy_service_discovery_v3_DiscoveryRequest_mutable_node(request,
+ arena.ptr());
+ PopulateNode(arena.ptr(), bootstrap_, build_version_, user_agent_name_,
+ node_msg);
+ }
+ // Add resource_names.
+ for (const auto& resource_name : resource_names) {
+ envoy_service_discovery_v3_DiscoveryRequest_add_resource_names(
+ request, StdStringToUpbString(resource_name), arena.ptr());
+ }
+ MaybeLogDiscoveryRequest(client_, tracer_, request, build_version_);
+ return SerializeDiscoveryRequest(arena.ptr(), request);
+}
+
+namespace {
+
+void MaybeLogDiscoveryResponse(
+ XdsClient* client, TraceFlag* tracer,
+ const envoy_service_discovery_v3_DiscoveryResponse* response) {
+ if (GRPC_TRACE_FLAG_ENABLED(*tracer) &&
+ gpr_should_log(GPR_LOG_SEVERITY_DEBUG)) {
+ // TODO(roth): When we can upgrade upb, use upb textformat code to dump
+ // the raw proto instead of doing this manually.
+ std::vector<TString> fields;
+ // version_info
+ AddStringField(
+ "version_info",
+ envoy_service_discovery_v3_DiscoveryResponse_version_info(response),
+ &fields);
+ // resources
+ size_t num_resources;
+ envoy_service_discovery_v3_DiscoveryResponse_resources(response,
+ &num_resources);
+ fields.emplace_back(
+ y_absl::StrCat("resources: <", num_resources, " element(s)>"));
+ // type_url
+ AddStringField(
+ "type_url",
+ envoy_service_discovery_v3_DiscoveryResponse_type_url(response),
+ &fields);
+ // nonce
+ AddStringField("nonce",
+ envoy_service_discovery_v3_DiscoveryResponse_nonce(response),
+ &fields);
+ gpr_log(GPR_DEBUG, "[xds_client %p] received response: %s", client,
+ y_absl::StrJoin(fields, "\n").c_str());
+ }
+}
+
+void MaybeLogRouteConfiguration(
+ XdsClient* client, TraceFlag* tracer,
+ const envoy_config_route_v3_RouteConfiguration* route_config) {
+ if (GRPC_TRACE_FLAG_ENABLED(*tracer) &&
+ gpr_should_log(GPR_LOG_SEVERITY_DEBUG)) {
+ // TODO(roth): When we can upgrade upb, use upb textformat code to dump
+ // the raw proto instead of doing this manually.
+ std::vector<TString> fields;
+ // name
+ AddStringField("name",
+ envoy_config_route_v3_RouteConfiguration_name(route_config),
+ &fields);
+ // virtual_hosts
+ size_t num_virtual_hosts;
+ const envoy_config_route_v3_VirtualHost* const* virtual_hosts =
+ envoy_config_route_v3_RouteConfiguration_virtual_hosts(
+ route_config, &num_virtual_hosts);
+ for (size_t i = 0; i < num_virtual_hosts; ++i) {
+ const auto* virtual_host = virtual_hosts[i];
+ fields.push_back("virtual_hosts {");
+ // name
+ AddStringField(" name",
+ envoy_config_route_v3_VirtualHost_name(virtual_host),
+ &fields);
+ // domains
+ size_t num_domains;
+ const upb_strview* const domains =
+ envoy_config_route_v3_VirtualHost_domains(virtual_host, &num_domains);
+ for (size_t j = 0; j < num_domains; ++j) {
+ AddStringField(" domains", domains[j], &fields);
+ }
+ // routes
+ size_t num_routes;
+ const envoy_config_route_v3_Route* const* routes =
+ envoy_config_route_v3_VirtualHost_routes(virtual_host, &num_routes);
+ for (size_t j = 0; j < num_routes; ++j) {
+ const auto* route = routes[j];
+ fields.push_back(" route {");
+ // name
+ AddStringField(" name", envoy_config_route_v3_Route_name(route),
+ &fields);
+ // match
+ const envoy_config_route_v3_RouteMatch* match =
+ envoy_config_route_v3_Route_match(route);
+ if (match != nullptr) {
+ fields.emplace_back(" match {");
+ // path matching
+ if (envoy_config_route_v3_RouteMatch_has_prefix(match)) {
+ AddStringField(" prefix",
+ envoy_config_route_v3_RouteMatch_prefix(match),
+ &fields,
+ /*add_if_empty=*/true);
+ } else if (envoy_config_route_v3_RouteMatch_has_path(match)) {
+ AddStringField(" path",
+ envoy_config_route_v3_RouteMatch_path(match),
+ &fields,
+ /*add_if_empty=*/true);
+ } else if (envoy_config_route_v3_RouteMatch_has_safe_regex(match)) {
+ fields.emplace_back(" safe_regex: <not printed>");
+ } else {
+ fields.emplace_back(" <unknown path matching type>");
+ }
+ // header matching
+ size_t num_headers;
+ envoy_config_route_v3_RouteMatch_headers(match, &num_headers);
+ if (num_headers > 0) {
+ fields.emplace_back(
+ y_absl::StrCat(" headers: <", num_headers, " element(s)>"));
+ }
+ fields.emplace_back(" }");
+ }
+ // action
+ if (envoy_config_route_v3_Route_has_route(route)) {
+ const envoy_config_route_v3_RouteAction* action =
+ envoy_config_route_v3_Route_route(route);
+ fields.emplace_back(" route {");
+ if (envoy_config_route_v3_RouteAction_has_cluster(action)) {
+ AddStringField(" cluster",
+ envoy_config_route_v3_RouteAction_cluster(action),
+ &fields);
+ } else if (envoy_config_route_v3_RouteAction_has_cluster_header(
+ action)) {
+ AddStringField(
+ " cluster_header",
+ envoy_config_route_v3_RouteAction_cluster_header(action),
+ &fields);
+ } else if (envoy_config_route_v3_RouteAction_has_weighted_clusters(
+ action)) {
+ const envoy_config_route_v3_WeightedCluster* weighted_clusters =
+ envoy_config_route_v3_RouteAction_weighted_clusters(action);
+ fields.emplace_back(" weighted_clusters {");
+ size_t num_cluster_weights;
+ const envoy_config_route_v3_WeightedCluster_ClusterWeight* const*
+ cluster_weights =
+ envoy_config_route_v3_WeightedCluster_clusters(
+ weighted_clusters, &num_cluster_weights);
+ for (size_t i = 0; i < num_cluster_weights; ++i) {
+ const envoy_config_route_v3_WeightedCluster_ClusterWeight*
+ cluster_weight = cluster_weights[i];
+ fields.emplace_back(" clusters {");
+ AddStringField(
+ " name",
+ envoy_config_route_v3_WeightedCluster_ClusterWeight_name(
+ cluster_weight),
+ &fields);
+ AddUInt32ValueField(
+ " weight",
+ envoy_config_route_v3_WeightedCluster_ClusterWeight_weight(
+ cluster_weight),
+ &fields);
+ fields.emplace_back(" }");
+ }
+ AddUInt32ValueField(
+ " total_weight",
+ envoy_config_route_v3_WeightedCluster_total_weight(
+ weighted_clusters),
+ &fields);
+ fields.emplace_back(" }");
+ }
+ fields.emplace_back(" }");
+ } else if (envoy_config_route_v3_Route_has_redirect(route)) {
+ fields.emplace_back(" redirect: <not printed>");
+ } else if (envoy_config_route_v3_Route_has_direct_response(route)) {
+ fields.emplace_back(" direct_response: <not printed>");
+ } else if (envoy_config_route_v3_Route_has_filter_action(route)) {
+ fields.emplace_back(" filter_action: <not printed>");
+ }
+ fields.push_back(" }");
+ }
+ fields.push_back("}");
+ }
+ gpr_log(GPR_DEBUG, "[xds_client %p] RouteConfiguration: %s", client,
+ y_absl::StrJoin(fields, "\n").c_str());
+ }
+}
+
+void MaybeLogCluster(XdsClient* client, TraceFlag* tracer,
+ const envoy_config_cluster_v3_Cluster* cluster) {
+ if (GRPC_TRACE_FLAG_ENABLED(*tracer) &&
+ gpr_should_log(GPR_LOG_SEVERITY_DEBUG)) {
+ // TODO(roth): When we can upgrade upb, use upb textformat code to dump
+ // the raw proto instead of doing this manually.
+ std::vector<TString> fields;
+ // name
+ AddStringField("name", envoy_config_cluster_v3_Cluster_name(cluster),
+ &fields);
+ // type
+ if (envoy_config_cluster_v3_Cluster_has_type(cluster)) {
+ fields.emplace_back(y_absl::StrCat(
+ "type: ", envoy_config_cluster_v3_Cluster_type(cluster)));
+ } else if (envoy_config_cluster_v3_Cluster_has_cluster_type(cluster)) {
+ fields.emplace_back("cluster_type: <not printed>");
+ } else {
+ fields.emplace_back("<unknown type>");
+ }
+ // eds_cluster_config
+ const envoy_config_cluster_v3_Cluster_EdsClusterConfig* eds_cluster_config =
+ envoy_config_cluster_v3_Cluster_eds_cluster_config(cluster);
+ if (eds_cluster_config != nullptr) {
+ fields.emplace_back("eds_cluster_config {");
+ // eds_config
+ const struct envoy_config_core_v3_ConfigSource* eds_config =
+ envoy_config_cluster_v3_Cluster_EdsClusterConfig_eds_config(
+ eds_cluster_config);
+ if (eds_config != nullptr) {
+ if (envoy_config_core_v3_ConfigSource_has_ads(eds_config)) {
+ fields.emplace_back(" eds_config { ads {} }");
+ } else {
+ fields.emplace_back(" eds_config: <non-ADS type>");
+ }
+ }
+ // service_name
+ AddStringField(
+ " service_name",
+ envoy_config_cluster_v3_Cluster_EdsClusterConfig_service_name(
+ eds_cluster_config),
+ &fields);
+ fields.emplace_back("}");
+ }
+ // lb_policy
+ fields.emplace_back(y_absl::StrCat(
+ "lb_policy: ", envoy_config_cluster_v3_Cluster_lb_policy(cluster)));
+ // lrs_server
+ const envoy_config_core_v3_ConfigSource* lrs_server =
+ envoy_config_cluster_v3_Cluster_lrs_server(cluster);
+ if (lrs_server != nullptr) {
+ if (envoy_config_core_v3_ConfigSource_has_self(lrs_server)) {
+ fields.emplace_back("lrs_server { self {} }");
+ } else {
+ fields.emplace_back("lrs_server: <non-self type>");
+ }
+ }
+ gpr_log(GPR_DEBUG, "[xds_client %p] Cluster: %s", client,
+ y_absl::StrJoin(fields, "\n").c_str());
+ }
+}
+
+void MaybeLogClusterLoadAssignment(
+ XdsClient* client, TraceFlag* tracer,
+ const envoy_config_endpoint_v3_ClusterLoadAssignment* cla) {
+ if (GRPC_TRACE_FLAG_ENABLED(*tracer) &&
+ gpr_should_log(GPR_LOG_SEVERITY_DEBUG)) {
+ // TODO(roth): When we can upgrade upb, use upb textformat code to dump
+ // the raw proto instead of doing this manually.
+ std::vector<TString> fields;
+ // cluster_name
+ AddStringField(
+ "cluster_name",
+ envoy_config_endpoint_v3_ClusterLoadAssignment_cluster_name(cla),
+ &fields);
+ // endpoints
+ size_t num_localities;
+ const struct envoy_config_endpoint_v3_LocalityLbEndpoints* const*
+ locality_endpoints =
+ envoy_config_endpoint_v3_ClusterLoadAssignment_endpoints(
+ cla, &num_localities);
+ for (size_t i = 0; i < num_localities; ++i) {
+ const auto* locality_endpoint = locality_endpoints[i];
+ fields.emplace_back("endpoints {");
+ // locality
+ const auto* locality =
+ envoy_config_endpoint_v3_LocalityLbEndpoints_locality(
+ locality_endpoint);
+ if (locality != nullptr) {
+ fields.emplace_back(" locality {");
+ AddLocalityField(2, locality, &fields);
+ fields.emplace_back(" }");
+ }
+ // lb_endpoints
+ size_t num_lb_endpoints;
+ const envoy_config_endpoint_v3_LbEndpoint* const* lb_endpoints =
+ envoy_config_endpoint_v3_LocalityLbEndpoints_lb_endpoints(
+ locality_endpoint, &num_lb_endpoints);
+ for (size_t j = 0; j < num_lb_endpoints; ++j) {
+ const auto* lb_endpoint = lb_endpoints[j];
+ fields.emplace_back(" lb_endpoints {");
+ // health_status
+ uint32_t health_status =
+ envoy_config_endpoint_v3_LbEndpoint_health_status(lb_endpoint);
+ if (health_status > 0) {
+ fields.emplace_back(
+ y_absl::StrCat(" health_status: ", health_status));
+ }
+ // endpoint
+ const envoy_config_endpoint_v3_Endpoint* endpoint =
+ envoy_config_endpoint_v3_LbEndpoint_endpoint(lb_endpoint);
+ if (endpoint != nullptr) {
+ fields.emplace_back(" endpoint {");
+ // address
+ const auto* address =
+ envoy_config_endpoint_v3_Endpoint_address(endpoint);
+ if (address != nullptr) {
+ fields.emplace_back(" address {");
+ // socket_address
+ const auto* socket_address =
+ envoy_config_core_v3_Address_socket_address(address);
+ if (socket_address != nullptr) {
+ fields.emplace_back(" socket_address {");
+ // address
+ AddStringField(
+ " address",
+ envoy_config_core_v3_SocketAddress_address(socket_address),
+ &fields);
+ // port_value
+ if (envoy_config_core_v3_SocketAddress_has_port_value(
+ socket_address)) {
+ fields.emplace_back(
+ y_absl::StrCat(" port_value: ",
+ envoy_config_core_v3_SocketAddress_port_value(
+ socket_address)));
+ } else {
+ fields.emplace_back(" <non-numeric port>");
+ }
+ fields.emplace_back(" }");
+ } else {
+ fields.emplace_back(" <non-socket address>");
+ }
+ fields.emplace_back(" }");
+ }
+ fields.emplace_back(" }");
+ }
+ fields.emplace_back(" }");
+ }
+ // load_balancing_weight
+ AddUInt32ValueField(
+ " load_balancing_weight",
+ envoy_config_endpoint_v3_LocalityLbEndpoints_load_balancing_weight(
+ locality_endpoint),
+ &fields);
+ // priority
+ uint32_t priority = envoy_config_endpoint_v3_LocalityLbEndpoints_priority(
+ locality_endpoint);
+ if (priority > 0) {
+ fields.emplace_back(y_absl::StrCat(" priority: ", priority));
+ }
+ fields.emplace_back("}");
+ }
+ // policy
+ const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy* policy =
+ envoy_config_endpoint_v3_ClusterLoadAssignment_policy(cla);
+ if (policy != nullptr) {
+ fields.emplace_back("policy {");
+ // drop_overloads
+ size_t num_drop_overloads;
+ const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload* const*
+ drop_overloads =
+ envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_drop_overloads(
+ policy, &num_drop_overloads);
+ for (size_t i = 0; i < num_drop_overloads; ++i) {
+ auto* drop_overload = drop_overloads[i];
+ fields.emplace_back(" drop_overloads {");
+ // category
+ AddStringField(
+ " category",
+ envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_category(
+ drop_overload),
+ &fields);
+ // drop_percentage
+ const auto* drop_percentage =
+ envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_drop_percentage(
+ drop_overload);
+ if (drop_percentage != nullptr) {
+ fields.emplace_back(" drop_percentage {");
+ fields.emplace_back(y_absl::StrCat(
+ " numerator: ",
+ envoy_type_v3_FractionalPercent_numerator(drop_percentage)));
+ fields.emplace_back(y_absl::StrCat(
+ " denominator: ",
+ envoy_type_v3_FractionalPercent_denominator(drop_percentage)));
+ fields.emplace_back(" }");
+ }
+ fields.emplace_back(" }");
+ }
+ // overprovisioning_factor
+ fields.emplace_back("}");
+ }
+ gpr_log(GPR_DEBUG, "[xds_client %p] ClusterLoadAssignment: %s", client,
+ y_absl::StrJoin(fields, "\n").c_str());
+ }
+}
+
+grpc_error* RoutePathMatchParse(const envoy_config_route_v3_RouteMatch* match,
+ XdsApi::Route* route, bool* ignore_route) {
+ if (envoy_config_route_v3_RouteMatch_has_prefix(match)) {
+ y_absl::string_view prefix =
+ UpbStringToAbsl(envoy_config_route_v3_RouteMatch_prefix(match));
+ // Empty prefix "" is accepted.
+ if (prefix.size() > 0) {
+ // Prefix "/" is accepted.
+ if (prefix[0] != '/') {
+ // Prefix which does not start with a / will never match anything, so
+ // ignore this route.
+ *ignore_route = true;
+ return GRPC_ERROR_NONE;
+ }
+ std::vector<y_absl::string_view> prefix_elements =
+ y_absl::StrSplit(prefix.substr(1), y_absl::MaxSplits('/', 2));
+ if (prefix_elements.size() > 2) {
+ // Prefix cannot have more than 2 slashes.
+ *ignore_route = true;
+ return GRPC_ERROR_NONE;
+ } else if (prefix_elements.size() == 2 && prefix_elements[0].empty()) {
+ // Prefix contains empty string between the 2 slashes
+ *ignore_route = true;
+ return GRPC_ERROR_NONE;
+ }
+ }
+ route->matchers.path_matcher.type =
+ XdsApi::Route::Matchers::PathMatcher::PathMatcherType::PREFIX;
+ route->matchers.path_matcher.string_matcher = TString(prefix);
+ } else if (envoy_config_route_v3_RouteMatch_has_path(match)) {
+ y_absl::string_view path =
+ UpbStringToAbsl(envoy_config_route_v3_RouteMatch_path(match));
+ if (path.size() == 0) {
+ // Path that is empty will never match anything, so ignore this route.
+ *ignore_route = true;
+ return GRPC_ERROR_NONE;
+ }
+ if (path[0] != '/') {
+ // Path which does not start with a / will never match anything, so
+ // ignore this route.
+ *ignore_route = true;
+ return GRPC_ERROR_NONE;
+ }
+ std::vector<y_absl::string_view> path_elements =
+ y_absl::StrSplit(path.substr(1), y_absl::MaxSplits('/', 2));
+ if (path_elements.size() != 2) {
+ // Path not in the required format of /service/method will never match
+ // anything, so ignore this route.
+ *ignore_route = true;
+ return GRPC_ERROR_NONE;
+ } else if (path_elements[0].empty()) {
+ // Path contains empty service name will never match anything, so ignore
+ // this route.
+ *ignore_route = true;
+ return GRPC_ERROR_NONE;
+ } else if (path_elements[1].empty()) {
+ // Path contains empty method name will never match anything, so ignore
+ // this route.
+ *ignore_route = true;
+ return GRPC_ERROR_NONE;
+ }
+ route->matchers.path_matcher.type =
+ XdsApi::Route::Matchers::PathMatcher::PathMatcherType::PATH;
+ route->matchers.path_matcher.string_matcher = TString(path);
+ } else if (envoy_config_route_v3_RouteMatch_has_safe_regex(match)) {
+ const envoy_type_matcher_v3_RegexMatcher* regex_matcher =
+ envoy_config_route_v3_RouteMatch_safe_regex(match);
+ GPR_ASSERT(regex_matcher != nullptr);
+ TString matcher = UpbStringToStdString(
+ envoy_type_matcher_v3_RegexMatcher_regex(regex_matcher));
+ std::unique_ptr<RE2> regex = y_absl::make_unique<RE2>(std::move(matcher));
+ if (!regex->ok()) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Invalid regex string specified in path matcher.");
+ }
+ route->matchers.path_matcher.type =
+ XdsApi::Route::Matchers::PathMatcher::PathMatcherType::REGEX;
+ route->matchers.path_matcher.regex_matcher = std::move(regex);
+ } else {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Invalid route path specifier specified.");
+ }
+ return GRPC_ERROR_NONE;
+}
+
+grpc_error* RouteHeaderMatchersParse(
+ const envoy_config_route_v3_RouteMatch* match, XdsApi::Route* route) {
+ size_t size;
+ const envoy_config_route_v3_HeaderMatcher* const* headers =
+ envoy_config_route_v3_RouteMatch_headers(match, &size);
+ for (size_t i = 0; i < size; ++i) {
+ const envoy_config_route_v3_HeaderMatcher* header = headers[i];
+ XdsApi::Route::Matchers::HeaderMatcher header_matcher;
+ header_matcher.name =
+ UpbStringToStdString(envoy_config_route_v3_HeaderMatcher_name(header));
+ if (envoy_config_route_v3_HeaderMatcher_has_exact_match(header)) {
+ header_matcher.type =
+ XdsApi::Route::Matchers::HeaderMatcher::HeaderMatcherType::EXACT;
+ header_matcher.string_matcher = UpbStringToStdString(
+ envoy_config_route_v3_HeaderMatcher_exact_match(header));
+ } else if (envoy_config_route_v3_HeaderMatcher_has_safe_regex_match(
+ header)) {
+ const envoy_type_matcher_v3_RegexMatcher* regex_matcher =
+ envoy_config_route_v3_HeaderMatcher_safe_regex_match(header);
+ GPR_ASSERT(regex_matcher != nullptr);
+ const TString matcher = UpbStringToStdString(
+ envoy_type_matcher_v3_RegexMatcher_regex(regex_matcher));
+ std::unique_ptr<RE2> regex = y_absl::make_unique<RE2>(matcher);
+ if (!regex->ok()) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Invalid regex string specified in header matcher.");
+ }
+ header_matcher.type =
+ XdsApi::Route::Matchers::HeaderMatcher::HeaderMatcherType::REGEX;
+ header_matcher.regex_match = std::move(regex);
+ } else if (envoy_config_route_v3_HeaderMatcher_has_range_match(header)) {
+ header_matcher.type =
+ XdsApi::Route::Matchers::HeaderMatcher::HeaderMatcherType::RANGE;
+ const envoy_type_v3_Int64Range* range_matcher =
+ envoy_config_route_v3_HeaderMatcher_range_match(header);
+ header_matcher.range_start =
+ envoy_type_v3_Int64Range_start(range_matcher);
+ header_matcher.range_end = envoy_type_v3_Int64Range_end(range_matcher);
+ if (header_matcher.range_end < header_matcher.range_start) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Invalid range header matcher specifier specified: end "
+ "cannot be smaller than start.");
+ }
+ } else if (envoy_config_route_v3_HeaderMatcher_has_present_match(header)) {
+ header_matcher.type =
+ XdsApi::Route::Matchers::HeaderMatcher::HeaderMatcherType::PRESENT;
+ header_matcher.present_match =
+ envoy_config_route_v3_HeaderMatcher_present_match(header);
+ } else if (envoy_config_route_v3_HeaderMatcher_has_prefix_match(header)) {
+ header_matcher.type =
+ XdsApi::Route::Matchers::HeaderMatcher::HeaderMatcherType::PREFIX;
+ header_matcher.string_matcher = UpbStringToStdString(
+ envoy_config_route_v3_HeaderMatcher_prefix_match(header));
+ } else if (envoy_config_route_v3_HeaderMatcher_has_suffix_match(header)) {
+ header_matcher.type =
+ XdsApi::Route::Matchers::HeaderMatcher::HeaderMatcherType::SUFFIX;
+ header_matcher.string_matcher = UpbStringToStdString(
+ envoy_config_route_v3_HeaderMatcher_suffix_match(header));
+ } else {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Invalid route header matcher specified.");
+ }
+ header_matcher.invert_match =
+ envoy_config_route_v3_HeaderMatcher_invert_match(header);
+ route->matchers.header_matchers.emplace_back(std::move(header_matcher));
+ }
+ return GRPC_ERROR_NONE;
+}
+
+grpc_error* RouteRuntimeFractionParse(
+ const envoy_config_route_v3_RouteMatch* match, XdsApi::Route* route) {
+ const envoy_config_core_v3_RuntimeFractionalPercent* runtime_fraction =
+ envoy_config_route_v3_RouteMatch_runtime_fraction(match);
+ if (runtime_fraction != nullptr) {
+ const envoy_type_v3_FractionalPercent* fraction =
+ envoy_config_core_v3_RuntimeFractionalPercent_default_value(
+ runtime_fraction);
+ if (fraction != nullptr) {
+ uint32_t numerator = envoy_type_v3_FractionalPercent_numerator(fraction);
+ const auto denominator =
+ static_cast<envoy_type_v3_FractionalPercent_DenominatorType>(
+ envoy_type_v3_FractionalPercent_denominator(fraction));
+ // Normalize to million.
+ switch (denominator) {
+ case envoy_type_v3_FractionalPercent_HUNDRED:
+ numerator *= 10000;
+ break;
+ case envoy_type_v3_FractionalPercent_TEN_THOUSAND:
+ numerator *= 100;
+ break;
+ case envoy_type_v3_FractionalPercent_MILLION:
+ break;
+ default:
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Unknown denominator type");
+ }
+ route->matchers.fraction_per_million = numerator;
+ }
+ }
+ return GRPC_ERROR_NONE;
+}
+
+grpc_error* RouteActionParse(const envoy_config_route_v3_Route* route_msg,
+ XdsApi::Route* route, bool* ignore_route) {
+ if (!envoy_config_route_v3_Route_has_route(route_msg)) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "No RouteAction found in route.");
+ }
+ const envoy_config_route_v3_RouteAction* route_action =
+ envoy_config_route_v3_Route_route(route_msg);
+ // Get the cluster or weighted_clusters in the RouteAction.
+ if (envoy_config_route_v3_RouteAction_has_cluster(route_action)) {
+ route->cluster_name = UpbStringToStdString(
+ envoy_config_route_v3_RouteAction_cluster(route_action));
+ if (route->cluster_name.size() == 0) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "RouteAction cluster contains empty cluster name.");
+ }
+ } else if (envoy_config_route_v3_RouteAction_has_weighted_clusters(
+ route_action)) {
+ const envoy_config_route_v3_WeightedCluster* weighted_cluster =
+ envoy_config_route_v3_RouteAction_weighted_clusters(route_action);
+ uint32_t total_weight = 100;
+ const google_protobuf_UInt32Value* weight =
+ envoy_config_route_v3_WeightedCluster_total_weight(weighted_cluster);
+ if (weight != nullptr) {
+ total_weight = google_protobuf_UInt32Value_value(weight);
+ }
+ size_t clusters_size;
+ const envoy_config_route_v3_WeightedCluster_ClusterWeight* const* clusters =
+ envoy_config_route_v3_WeightedCluster_clusters(weighted_cluster,
+ &clusters_size);
+ uint32_t sum_of_weights = 0;
+ for (size_t j = 0; j < clusters_size; ++j) {
+ const envoy_config_route_v3_WeightedCluster_ClusterWeight*
+ cluster_weight = clusters[j];
+ XdsApi::Route::ClusterWeight cluster;
+ cluster.name = UpbStringToStdString(
+ envoy_config_route_v3_WeightedCluster_ClusterWeight_name(
+ cluster_weight));
+ if (cluster.name.empty()) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "RouteAction weighted_cluster cluster contains empty cluster "
+ "name.");
+ }
+ const google_protobuf_UInt32Value* weight =
+ envoy_config_route_v3_WeightedCluster_ClusterWeight_weight(
+ cluster_weight);
+ if (weight == nullptr) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "RouteAction weighted_cluster cluster missing weight");
+ }
+ cluster.weight = google_protobuf_UInt32Value_value(weight);
+ sum_of_weights += cluster.weight;
+ route->weighted_clusters.emplace_back(std::move(cluster));
+ }
+ if (total_weight != sum_of_weights) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "RouteAction weighted_cluster has incorrect total weight");
+ }
+ if (route->weighted_clusters.empty()) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "RouteAction weighted_cluster has no valid clusters specified.");
+ }
+ } else {
+ // No cluster or weighted_clusters found in RouteAction, ignore this route.
+ *ignore_route = true;
+ return GRPC_ERROR_NONE;
+ }
+ return GRPC_ERROR_NONE;
+}
+
+grpc_error* RouteConfigParse(
+ XdsClient* client, TraceFlag* tracer,
+ const envoy_config_route_v3_RouteConfiguration* route_config,
+ XdsApi::RdsUpdate* rds_update) {
+ MaybeLogRouteConfiguration(client, tracer, route_config);
+ // Get the virtual hosts.
+ size_t size;
+ const envoy_config_route_v3_VirtualHost* const* virtual_hosts =
+ envoy_config_route_v3_RouteConfiguration_virtual_hosts(route_config,
+ &size);
+ for (size_t i = 0; i < size; ++i) {
+ rds_update->virtual_hosts.emplace_back();
+ XdsApi::RdsUpdate::VirtualHost& vhost = rds_update->virtual_hosts.back();
+ // Parse domains.
+ size_t domain_size;
+ upb_strview const* domains = envoy_config_route_v3_VirtualHost_domains(
+ virtual_hosts[i], &domain_size);
+ for (size_t j = 0; j < domain_size; ++j) {
+ TString domain_pattern = UpbStringToStdString(domains[j]);
+ const MatchType match_type = DomainPatternMatchType(domain_pattern);
+ if (match_type == INVALID_MATCH) {
+ return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrCat("Invalid domain pattern \"", domain_pattern, "\".")
+ .c_str());
+ }
+ vhost.domains.emplace_back(std::move(domain_pattern));
+ }
+ if (vhost.domains.empty()) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING("VirtualHost has no domains");
+ }
+ // Parse routes.
+ size_t num_routes;
+ const envoy_config_route_v3_Route* const* routes =
+ envoy_config_route_v3_VirtualHost_routes(virtual_hosts[i], &num_routes);
+ if (num_routes < 1) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "No route found in the virtual host.");
+ }
+ // Loop over the whole list of routes
+ for (size_t j = 0; j < num_routes; ++j) {
+ const envoy_config_route_v3_RouteMatch* match =
+ envoy_config_route_v3_Route_match(routes[j]);
+ size_t query_parameters_size;
+ static_cast<void>(envoy_config_route_v3_RouteMatch_query_parameters(
+ match, &query_parameters_size));
+ if (query_parameters_size > 0) {
+ continue;
+ }
+ XdsApi::Route route;
+ bool ignore_route = false;
+ grpc_error* error = RoutePathMatchParse(match, &route, &ignore_route);
+ if (error != GRPC_ERROR_NONE) return error;
+ if (ignore_route) continue;
+ error = RouteHeaderMatchersParse(match, &route);
+ if (error != GRPC_ERROR_NONE) return error;
+ error = RouteRuntimeFractionParse(match, &route);
+ if (error != GRPC_ERROR_NONE) return error;
+ error = RouteActionParse(routes[j], &route, &ignore_route);
+ if (error != GRPC_ERROR_NONE) return error;
+ if (ignore_route) continue;
+ const google_protobuf_BoolValue* case_sensitive =
+ envoy_config_route_v3_RouteMatch_case_sensitive(match);
+ if (case_sensitive != nullptr &&
+ !google_protobuf_BoolValue_value(case_sensitive)) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "case_sensitive if set must be set to true.");
+ }
+ vhost.routes.emplace_back(std::move(route));
+ }
+ if (vhost.routes.empty()) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING("No valid routes specified.");
+ }
+ }
+ return GRPC_ERROR_NONE;
+}
+
+grpc_error* LdsResponseParse(
+ XdsClient* client, TraceFlag* tracer,
+ const envoy_service_discovery_v3_DiscoveryResponse* response,
+ const std::set<y_absl::string_view>& expected_listener_names,
+ XdsApi::LdsUpdateMap* lds_update_map, upb_arena* arena) {
+ // Get the resources from the response.
+ size_t size;
+ const google_protobuf_Any* const* resources =
+ envoy_service_discovery_v3_DiscoveryResponse_resources(response, &size);
+ for (size_t i = 0; i < size; ++i) {
+ // Check the type_url of the resource.
+ y_absl::string_view type_url =
+ UpbStringToAbsl(google_protobuf_Any_type_url(resources[i]));
+ if (!IsLds(type_url)) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING("Resource is not LDS.");
+ }
+ // Decode the listener.
+ const upb_strview encoded_listener =
+ google_protobuf_Any_value(resources[i]);
+ const envoy_config_listener_v3_Listener* listener =
+ envoy_config_listener_v3_Listener_parse(encoded_listener.data,
+ encoded_listener.size, arena);
+ if (listener == nullptr) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING("Can't decode listener.");
+ }
+ // Check listener name. Ignore unexpected listeners.
+ TString listener_name =
+ UpbStringToStdString(envoy_config_listener_v3_Listener_name(listener));
+ if (expected_listener_names.find(listener_name) ==
+ expected_listener_names.end()) {
+ continue;
+ }
+ // Fail if listener name is duplicated.
+ if (lds_update_map->find(listener_name) != lds_update_map->end()) {
+ return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrCat("duplicate listener name \"", listener_name, "\"")
+ .c_str());
+ }
+ XdsApi::LdsUpdate& lds_update = (*lds_update_map)[listener_name];
+ // Get api_listener and decode it to http_connection_manager.
+ const envoy_config_listener_v3_ApiListener* api_listener =
+ envoy_config_listener_v3_Listener_api_listener(listener);
+ if (api_listener == nullptr) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Listener has no ApiListener.");
+ }
+ const upb_strview encoded_api_listener = google_protobuf_Any_value(
+ envoy_config_listener_v3_ApiListener_api_listener(api_listener));
+ const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager*
+ http_connection_manager =
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_parse(
+ encoded_api_listener.data, encoded_api_listener.size, arena);
+ if (http_connection_manager == nullptr) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Could not parse HttpConnectionManager config from ApiListener");
+ }
+ // Found inlined route_config. Parse it to find the cluster_name.
+ if (envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_route_config(
+ http_connection_manager)) {
+ const envoy_config_route_v3_RouteConfiguration* route_config =
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_route_config(
+ http_connection_manager);
+ XdsApi::RdsUpdate rds_update;
+ grpc_error* error =
+ RouteConfigParse(client, tracer, route_config, &rds_update);
+ if (error != GRPC_ERROR_NONE) return error;
+ lds_update.rds_update = std::move(rds_update);
+ continue;
+ }
+ // Validate that RDS must be used to get the route_config dynamically.
+ if (!envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_rds(
+ http_connection_manager)) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "HttpConnectionManager neither has inlined route_config nor RDS.");
+ }
+ const envoy_extensions_filters_network_http_connection_manager_v3_Rds* rds =
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_rds(
+ http_connection_manager);
+ // Check that the ConfigSource specifies ADS.
+ const envoy_config_core_v3_ConfigSource* config_source =
+ envoy_extensions_filters_network_http_connection_manager_v3_Rds_config_source(
+ rds);
+ if (config_source == nullptr) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "HttpConnectionManager missing config_source for RDS.");
+ }
+ if (!envoy_config_core_v3_ConfigSource_has_ads(config_source)) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "HttpConnectionManager ConfigSource for RDS does not specify ADS.");
+ }
+ // Get the route_config_name.
+ lds_update.route_config_name = UpbStringToStdString(
+ envoy_extensions_filters_network_http_connection_manager_v3_Rds_route_config_name(
+ rds));
+ }
+ return GRPC_ERROR_NONE;
+}
+
+grpc_error* RdsResponseParse(
+ XdsClient* client, TraceFlag* tracer,
+ const envoy_service_discovery_v3_DiscoveryResponse* response,
+ const std::set<y_absl::string_view>& expected_route_configuration_names,
+ XdsApi::RdsUpdateMap* rds_update_map, upb_arena* arena) {
+ // Get the resources from the response.
+ size_t size;
+ const google_protobuf_Any* const* resources =
+ envoy_service_discovery_v3_DiscoveryResponse_resources(response, &size);
+ for (size_t i = 0; i < size; ++i) {
+ // Check the type_url of the resource.
+ y_absl::string_view type_url =
+ UpbStringToAbsl(google_protobuf_Any_type_url(resources[i]));
+ if (!IsRds(type_url)) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING("Resource is not RDS.");
+ }
+ // Decode the route_config.
+ const upb_strview encoded_route_config =
+ google_protobuf_Any_value(resources[i]);
+ const envoy_config_route_v3_RouteConfiguration* route_config =
+ envoy_config_route_v3_RouteConfiguration_parse(
+ encoded_route_config.data, encoded_route_config.size, arena);
+ if (route_config == nullptr) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING("Can't decode route_config.");
+ }
+ // Check route_config_name. Ignore unexpected route_config.
+ TString route_config_name = UpbStringToStdString(
+ envoy_config_route_v3_RouteConfiguration_name(route_config));
+ if (expected_route_configuration_names.find(route_config_name) ==
+ expected_route_configuration_names.end()) {
+ continue;
+ }
+ // Fail if route config name is duplicated.
+ if (rds_update_map->find(route_config_name) != rds_update_map->end()) {
+ return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrCat("duplicate route config name \"", route_config_name,
+ "\"")
+ .c_str());
+ }
+ // Parse the route_config.
+ XdsApi::RdsUpdate& rds_update =
+ (*rds_update_map)[std::move(route_config_name)];
+ grpc_error* error =
+ RouteConfigParse(client, tracer, route_config, &rds_update);
+ if (error != GRPC_ERROR_NONE) return error;
+ }
+ return GRPC_ERROR_NONE;
+}
+
+grpc_error* CommonTlsContextParse(
+ const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext*
+ common_tls_context_proto,
+ XdsApi::CommonTlsContext* common_tls_context) GRPC_MUST_USE_RESULT;
+grpc_error* CommonTlsContextParse(
+ const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext*
+ common_tls_context_proto,
+ XdsApi::CommonTlsContext* common_tls_context) {
+ auto* combined_validation_context =
+ envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_combined_validation_context(
+ common_tls_context_proto);
+ if (combined_validation_context != nullptr) {
+ auto* default_validation_context =
+ envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_default_validation_context(
+ combined_validation_context);
+ if (default_validation_context != nullptr) {
+ size_t len = 0;
+ auto* subject_alt_names_matchers =
+ envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_match_subject_alt_names(
+ default_validation_context, &len);
+ for (size_t i = 0; i < len; ++i) {
+ XdsApi::StringMatcher matcher;
+ if (envoy_type_matcher_v3_StringMatcher_has_exact(
+ subject_alt_names_matchers[i])) {
+ matcher.type = XdsApi::StringMatcher::StringMatcherType::EXACT;
+ matcher.string_matcher =
+ UpbStringToStdString(envoy_type_matcher_v3_StringMatcher_exact(
+ subject_alt_names_matchers[i]));
+ } else if (envoy_type_matcher_v3_StringMatcher_has_prefix(
+ subject_alt_names_matchers[i])) {
+ matcher.type = XdsApi::StringMatcher::StringMatcherType::PREFIX;
+ matcher.string_matcher =
+ UpbStringToStdString(envoy_type_matcher_v3_StringMatcher_prefix(
+ subject_alt_names_matchers[i]));
+ } else if (envoy_type_matcher_v3_StringMatcher_has_suffix(
+ subject_alt_names_matchers[i])) {
+ matcher.type = XdsApi::StringMatcher::StringMatcherType::SUFFIX;
+ matcher.string_matcher =
+ UpbStringToStdString(envoy_type_matcher_v3_StringMatcher_suffix(
+ subject_alt_names_matchers[i]));
+ } else if (envoy_type_matcher_v3_StringMatcher_has_safe_regex(
+ subject_alt_names_matchers[i])) {
+ matcher.type = XdsApi::StringMatcher::StringMatcherType::SAFE_REGEX;
+ auto* regex_matcher = envoy_type_matcher_v3_StringMatcher_safe_regex(
+ subject_alt_names_matchers[i]);
+ std::unique_ptr<RE2> regex =
+ y_absl::make_unique<RE2>(UpbStringToStdString(
+ envoy_type_matcher_v3_RegexMatcher_regex(regex_matcher)));
+ if (!regex->ok()) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Invalid regex string specified in string matcher.");
+ }
+ matcher.regex_match = std::move(regex);
+ } else {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Invalid StringMatcher specified");
+ }
+ matcher.ignore_case = envoy_type_matcher_v3_StringMatcher_ignore_case(
+ subject_alt_names_matchers[i]);
+ common_tls_context->combined_validation_context
+ .default_validation_context.match_subject_alt_names.emplace_back(
+ matcher);
+ }
+ }
+ auto* validation_context_certificate_provider_instance =
+ envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_validation_context_certificate_provider_instance(
+ combined_validation_context);
+ if (validation_context_certificate_provider_instance != nullptr) {
+ common_tls_context->combined_validation_context
+ .validation_context_certificate_provider_instance = UpbStringToStdString(
+ envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_instance_name(
+ validation_context_certificate_provider_instance));
+ }
+ }
+ auto* tls_certificate_certificate_provider_instance =
+ envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_tls_certificate_certificate_provider_instance(
+ common_tls_context_proto);
+ if (tls_certificate_certificate_provider_instance != nullptr) {
+ common_tls_context
+ ->tls_certificate_certificate_provider_instance = UpbStringToStdString(
+ envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_instance_name(
+ tls_certificate_certificate_provider_instance));
+ }
+ return GRPC_ERROR_NONE;
+}
+
+grpc_error* CdsResponseParse(
+ XdsClient* client, TraceFlag* tracer,
+ const envoy_service_discovery_v3_DiscoveryResponse* response,
+ const std::set<y_absl::string_view>& expected_cluster_names,
+ XdsApi::CdsUpdateMap* cds_update_map, upb_arena* arena) {
+ // Get the resources from the response.
+ size_t size;
+ const google_protobuf_Any* const* resources =
+ envoy_service_discovery_v3_DiscoveryResponse_resources(response, &size);
+ // Parse all the resources in the CDS response.
+ for (size_t i = 0; i < size; ++i) {
+ // Check the type_url of the resource.
+ y_absl::string_view type_url =
+ UpbStringToAbsl(google_protobuf_Any_type_url(resources[i]));
+ if (!IsCds(type_url)) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING("Resource is not CDS.");
+ }
+ // Decode the cluster.
+ const upb_strview encoded_cluster = google_protobuf_Any_value(resources[i]);
+ const envoy_config_cluster_v3_Cluster* cluster =
+ envoy_config_cluster_v3_Cluster_parse(encoded_cluster.data,
+ encoded_cluster.size, arena);
+ if (cluster == nullptr) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING("Can't decode cluster.");
+ }
+ MaybeLogCluster(client, tracer, cluster);
+ // Ignore unexpected cluster names.
+ TString cluster_name =
+ UpbStringToStdString(envoy_config_cluster_v3_Cluster_name(cluster));
+ if (expected_cluster_names.find(cluster_name) ==
+ expected_cluster_names.end()) {
+ continue;
+ }
+ // Fail on duplicate resources.
+ if (cds_update_map->find(cluster_name) != cds_update_map->end()) {
+ return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrCat("duplicate resource name \"", cluster_name, "\"")
+ .c_str());
+ }
+ XdsApi::CdsUpdate& cds_update = (*cds_update_map)[std::move(cluster_name)];
+ // Check the cluster_discovery_type.
+ if (!envoy_config_cluster_v3_Cluster_has_type(cluster)) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING("DiscoveryType not found.");
+ }
+ if (envoy_config_cluster_v3_Cluster_type(cluster) !=
+ envoy_config_cluster_v3_Cluster_EDS) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING("DiscoveryType is not EDS.");
+ }
+ // Check the EDS config source.
+ const envoy_config_cluster_v3_Cluster_EdsClusterConfig* eds_cluster_config =
+ envoy_config_cluster_v3_Cluster_eds_cluster_config(cluster);
+ const envoy_config_core_v3_ConfigSource* eds_config =
+ envoy_config_cluster_v3_Cluster_EdsClusterConfig_eds_config(
+ eds_cluster_config);
+ if (!envoy_config_core_v3_ConfigSource_has_ads(eds_config)) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "EDS ConfigSource is not ADS.");
+ }
+ // Record EDS service_name (if any).
+ upb_strview service_name =
+ envoy_config_cluster_v3_Cluster_EdsClusterConfig_service_name(
+ eds_cluster_config);
+ if (service_name.size != 0) {
+ cds_update.eds_service_name = UpbStringToStdString(service_name);
+ }
+ // Check the LB policy.
+ if (envoy_config_cluster_v3_Cluster_lb_policy(cluster) !=
+ envoy_config_cluster_v3_Cluster_ROUND_ROBIN) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "LB policy is not ROUND_ROBIN.");
+ }
+ // Record Upstream tls context
+ auto* transport_socket =
+ envoy_config_cluster_v3_Cluster_transport_socket(cluster);
+ if (transport_socket != nullptr) {
+ y_absl::string_view name = UpbStringToAbsl(
+ envoy_config_core_v3_TransportSocket_name(transport_socket));
+ if (name == "tls") {
+ auto* typed_config =
+ envoy_config_core_v3_TransportSocket_typed_config(transport_socket);
+ if (typed_config != nullptr) {
+ const upb_strview encoded_upstream_tls_context =
+ google_protobuf_Any_value(typed_config);
+ auto* upstream_tls_context =
+ envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_parse(
+ encoded_upstream_tls_context.data,
+ encoded_upstream_tls_context.size, arena);
+ if (upstream_tls_context == nullptr) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Can't decode upstream tls context.");
+ }
+ auto* common_tls_context =
+ envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_common_tls_context(
+ upstream_tls_context);
+ if (common_tls_context != nullptr) {
+ grpc_error* error = CommonTlsContextParse(
+ common_tls_context, &cds_update.common_tls_context);
+ if (error != GRPC_ERROR_NONE) return error;
+ }
+ }
+ }
+ }
+ // Record LRS server name (if any).
+ const envoy_config_core_v3_ConfigSource* lrs_server =
+ envoy_config_cluster_v3_Cluster_lrs_server(cluster);
+ if (lrs_server != nullptr) {
+ if (!envoy_config_core_v3_ConfigSource_has_self(lrs_server)) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "LRS ConfigSource is not self.");
+ }
+ cds_update.lrs_load_reporting_server_name.emplace("");
+ }
+ // The Cluster resource encodes the circuit breaking parameters in a list of
+ // Thresholds messages, where each message specifies the parameters for a
+ // particular RoutingPriority. we will look only at the first entry in the
+ // list for priority DEFAULT and default to 1024 if not found.
+ if (envoy_config_cluster_v3_Cluster_has_circuit_breakers(cluster)) {
+ const envoy_config_cluster_v3_CircuitBreakers* circuit_breakers =
+ envoy_config_cluster_v3_Cluster_circuit_breakers(cluster);
+ size_t num_thresholds;
+ const envoy_config_cluster_v3_CircuitBreakers_Thresholds* const*
+ thresholds = envoy_config_cluster_v3_CircuitBreakers_thresholds(
+ circuit_breakers, &num_thresholds);
+ for (size_t i = 0; i < num_thresholds; ++i) {
+ const auto* threshold = thresholds[i];
+ if (envoy_config_cluster_v3_CircuitBreakers_Thresholds_priority(
+ threshold) == envoy_config_core_v3_DEFAULT) {
+ const google_protobuf_UInt32Value* max_requests =
+ envoy_config_cluster_v3_CircuitBreakers_Thresholds_max_requests(
+ threshold);
+ if (max_requests != nullptr) {
+ cds_update.max_concurrent_requests =
+ google_protobuf_UInt32Value_value(max_requests);
+ }
+ break;
+ }
+ }
+ }
+ }
+ return GRPC_ERROR_NONE;
+}
+
+grpc_error* ServerAddressParseAndAppend(
+ const envoy_config_endpoint_v3_LbEndpoint* lb_endpoint,
+ ServerAddressList* list) {
+ // If health_status is not HEALTHY or UNKNOWN, skip this endpoint.
+ const int32_t health_status =
+ envoy_config_endpoint_v3_LbEndpoint_health_status(lb_endpoint);
+ if (health_status != envoy_config_core_v3_UNKNOWN &&
+ health_status != envoy_config_core_v3_HEALTHY) {
+ return GRPC_ERROR_NONE;
+ }
+ // Find the ip:port.
+ const envoy_config_endpoint_v3_Endpoint* endpoint =
+ envoy_config_endpoint_v3_LbEndpoint_endpoint(lb_endpoint);
+ const envoy_config_core_v3_Address* address =
+ envoy_config_endpoint_v3_Endpoint_address(endpoint);
+ const envoy_config_core_v3_SocketAddress* socket_address =
+ envoy_config_core_v3_Address_socket_address(address);
+ TString address_str = UpbStringToStdString(
+ envoy_config_core_v3_SocketAddress_address(socket_address));
+ uint32_t port = envoy_config_core_v3_SocketAddress_port_value(socket_address);
+ if (GPR_UNLIKELY(port >> 16) != 0) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING("Invalid port.");
+ }
+ // Populate grpc_resolved_address.
+ grpc_resolved_address addr;
+ grpc_string_to_sockaddr(&addr, address_str.c_str(), port);
+ // Append the address to the list.
+ list->emplace_back(addr, nullptr);
+ return GRPC_ERROR_NONE;
+}
+
+grpc_error* LocalityParse(
+ const envoy_config_endpoint_v3_LocalityLbEndpoints* locality_lb_endpoints,
+ XdsApi::EdsUpdate::Priority::Locality* output_locality, size_t* priority) {
+ // Parse LB weight.
+ const google_protobuf_UInt32Value* lb_weight =
+ envoy_config_endpoint_v3_LocalityLbEndpoints_load_balancing_weight(
+ locality_lb_endpoints);
+ // If LB weight is not specified, it means this locality is assigned no load.
+ // TODO(juanlishen): When we support CDS to configure the inter-locality
+ // policy, we should change the LB weight handling.
+ output_locality->lb_weight =
+ lb_weight != nullptr ? google_protobuf_UInt32Value_value(lb_weight) : 0;
+ if (output_locality->lb_weight == 0) return GRPC_ERROR_NONE;
+ // Parse locality name.
+ const envoy_config_core_v3_Locality* locality =
+ envoy_config_endpoint_v3_LocalityLbEndpoints_locality(
+ locality_lb_endpoints);
+ TString region =
+ UpbStringToStdString(envoy_config_core_v3_Locality_region(locality));
+ TString zone =
+ UpbStringToStdString(envoy_config_core_v3_Locality_region(locality));
+ TString sub_zone =
+ UpbStringToStdString(envoy_config_core_v3_Locality_sub_zone(locality));
+ output_locality->name = MakeRefCounted<XdsLocalityName>(
+ std::move(region), std::move(zone), std::move(sub_zone));
+ // Parse the addresses.
+ size_t size;
+ const envoy_config_endpoint_v3_LbEndpoint* const* lb_endpoints =
+ envoy_config_endpoint_v3_LocalityLbEndpoints_lb_endpoints(
+ locality_lb_endpoints, &size);
+ for (size_t i = 0; i < size; ++i) {
+ grpc_error* error = ServerAddressParseAndAppend(
+ lb_endpoints[i], &output_locality->endpoints);
+ if (error != GRPC_ERROR_NONE) return error;
+ }
+ // Parse the priority.
+ *priority = envoy_config_endpoint_v3_LocalityLbEndpoints_priority(
+ locality_lb_endpoints);
+ return GRPC_ERROR_NONE;
+}
+
+grpc_error* DropParseAndAppend(
+ const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload*
+ drop_overload,
+ XdsApi::EdsUpdate::DropConfig* drop_config) {
+ // Get the category.
+ TString category = UpbStringToStdString(
+ envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_category(
+ drop_overload));
+ if (category.size() == 0) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING("Empty drop category name");
+ }
+ // Get the drop rate (per million).
+ const envoy_type_v3_FractionalPercent* drop_percentage =
+ envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_drop_percentage(
+ drop_overload);
+ uint32_t numerator =
+ envoy_type_v3_FractionalPercent_numerator(drop_percentage);
+ const auto denominator =
+ static_cast<envoy_type_v3_FractionalPercent_DenominatorType>(
+ envoy_type_v3_FractionalPercent_denominator(drop_percentage));
+ // Normalize to million.
+ switch (denominator) {
+ case envoy_type_v3_FractionalPercent_HUNDRED:
+ numerator *= 10000;
+ break;
+ case envoy_type_v3_FractionalPercent_TEN_THOUSAND:
+ numerator *= 100;
+ break;
+ case envoy_type_v3_FractionalPercent_MILLION:
+ break;
+ default:
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING("Unknown denominator type");
+ }
+ // Cap numerator to 1000000.
+ numerator = GPR_MIN(numerator, 1000000);
+ drop_config->AddCategory(std::move(category), numerator);
+ return GRPC_ERROR_NONE;
+}
+
+grpc_error* EdsResponseParse(
+ XdsClient* client, TraceFlag* tracer,
+ const envoy_service_discovery_v3_DiscoveryResponse* response,
+ const std::set<y_absl::string_view>& expected_eds_service_names,
+ XdsApi::EdsUpdateMap* eds_update_map, upb_arena* arena) {
+ // Get the resources from the response.
+ size_t size;
+ const google_protobuf_Any* const* resources =
+ envoy_service_discovery_v3_DiscoveryResponse_resources(response, &size);
+ for (size_t i = 0; i < size; ++i) {
+ // Check the type_url of the resource.
+ y_absl::string_view type_url =
+ UpbStringToAbsl(google_protobuf_Any_type_url(resources[i]));
+ if (!IsEds(type_url)) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING("Resource is not EDS.");
+ }
+ // Get the cluster_load_assignment.
+ upb_strview encoded_cluster_load_assignment =
+ google_protobuf_Any_value(resources[i]);
+ envoy_config_endpoint_v3_ClusterLoadAssignment* cluster_load_assignment =
+ envoy_config_endpoint_v3_ClusterLoadAssignment_parse(
+ encoded_cluster_load_assignment.data,
+ encoded_cluster_load_assignment.size, arena);
+ if (cluster_load_assignment == nullptr) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Can't parse cluster_load_assignment.");
+ }
+ MaybeLogClusterLoadAssignment(client, tracer, cluster_load_assignment);
+ // Check the EDS service name. Ignore unexpected names.
+ TString eds_service_name = UpbStringToStdString(
+ envoy_config_endpoint_v3_ClusterLoadAssignment_cluster_name(
+ cluster_load_assignment));
+ if (expected_eds_service_names.find(eds_service_name) ==
+ expected_eds_service_names.end()) {
+ continue;
+ }
+ // Fail on duplicate resources.
+ if (eds_update_map->find(eds_service_name) != eds_update_map->end()) {
+ return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrCat("duplicate resource name \"", eds_service_name, "\"")
+ .c_str());
+ }
+ XdsApi::EdsUpdate& eds_update =
+ (*eds_update_map)[std::move(eds_service_name)];
+ // Get the endpoints.
+ size_t locality_size;
+ const envoy_config_endpoint_v3_LocalityLbEndpoints* const* endpoints =
+ envoy_config_endpoint_v3_ClusterLoadAssignment_endpoints(
+ cluster_load_assignment, &locality_size);
+ for (size_t j = 0; j < locality_size; ++j) {
+ size_t priority;
+ XdsApi::EdsUpdate::Priority::Locality locality;
+ grpc_error* error = LocalityParse(endpoints[j], &locality, &priority);
+ if (error != GRPC_ERROR_NONE) return error;
+ // Filter out locality with weight 0.
+ if (locality.lb_weight == 0) continue;
+ // Make sure prorities is big enough. Note that they might not
+ // arrive in priority order.
+ while (eds_update.priorities.size() < priority + 1) {
+ eds_update.priorities.emplace_back();
+ }
+ eds_update.priorities[priority].localities.emplace(locality.name.get(),
+ std::move(locality));
+ }
+ for (const auto& priority : eds_update.priorities) {
+ if (priority.localities.empty()) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "EDS update includes sparse priority list");
+ }
+ }
+ // Get the drop config.
+ eds_update.drop_config = MakeRefCounted<XdsApi::EdsUpdate::DropConfig>();
+ const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy* policy =
+ envoy_config_endpoint_v3_ClusterLoadAssignment_policy(
+ cluster_load_assignment);
+ if (policy != nullptr) {
+ size_t drop_size;
+ const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload* const*
+ drop_overload =
+ envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_drop_overloads(
+ policy, &drop_size);
+ for (size_t j = 0; j < drop_size; ++j) {
+ grpc_error* error =
+ DropParseAndAppend(drop_overload[j], eds_update.drop_config.get());
+ if (error != GRPC_ERROR_NONE) return error;
+ }
+ }
+ }
+ return GRPC_ERROR_NONE;
+}
+
+TString TypeUrlInternalToExternal(y_absl::string_view type_url) {
+ if (type_url == kLdsV2TypeUrl) {
+ return XdsApi::kLdsTypeUrl;
+ } else if (type_url == kRdsV2TypeUrl) {
+ return XdsApi::kRdsTypeUrl;
+ } else if (type_url == kCdsV2TypeUrl) {
+ return XdsApi::kCdsTypeUrl;
+ } else if (type_url == kEdsV2TypeUrl) {
+ return XdsApi::kEdsTypeUrl;
+ }
+ return TString(type_url);
+}
+
+} // namespace
+
+XdsApi::AdsParseResult XdsApi::ParseAdsResponse(
+ const grpc_slice& encoded_response,
+ const std::set<y_absl::string_view>& expected_listener_names,
+ const std::set<y_absl::string_view>& expected_route_configuration_names,
+ const std::set<y_absl::string_view>& expected_cluster_names,
+ const std::set<y_absl::string_view>& expected_eds_service_names) {
+ AdsParseResult result;
+ upb::Arena arena;
+ // Decode the response.
+ const envoy_service_discovery_v3_DiscoveryResponse* response =
+ envoy_service_discovery_v3_DiscoveryResponse_parse(
+ reinterpret_cast<const char*>(GRPC_SLICE_START_PTR(encoded_response)),
+ GRPC_SLICE_LENGTH(encoded_response), arena.ptr());
+ // If decoding fails, output an empty type_url and return.
+ if (response == nullptr) {
+ result.parse_error =
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("Can't decode DiscoveryResponse.");
+ return result;
+ }
+ MaybeLogDiscoveryResponse(client_, tracer_, response);
+ // Record the type_url, the version_info, and the nonce of the response.
+ result.type_url = TypeUrlInternalToExternal(UpbStringToAbsl(
+ envoy_service_discovery_v3_DiscoveryResponse_type_url(response)));
+ result.version = UpbStringToStdString(
+ envoy_service_discovery_v3_DiscoveryResponse_version_info(response));
+ result.nonce = UpbStringToStdString(
+ envoy_service_discovery_v3_DiscoveryResponse_nonce(response));
+ // Parse the response according to the resource type.
+ if (IsLds(result.type_url)) {
+ result.parse_error =
+ LdsResponseParse(client_, tracer_, response, expected_listener_names,
+ &result.lds_update_map, arena.ptr());
+ } else if (IsRds(result.type_url)) {
+ result.parse_error = RdsResponseParse(client_, tracer_, response,
+ expected_route_configuration_names,
+ &result.rds_update_map, arena.ptr());
+ } else if (IsCds(result.type_url)) {
+ result.parse_error =
+ CdsResponseParse(client_, tracer_, response, expected_cluster_names,
+ &result.cds_update_map, arena.ptr());
+ } else if (IsEds(result.type_url)) {
+ result.parse_error =
+ EdsResponseParse(client_, tracer_, response, expected_eds_service_names,
+ &result.eds_update_map, arena.ptr());
+ }
+ return result;
+}
+
+namespace {
+
+void MaybeLogLrsRequest(
+ XdsClient* client, TraceFlag* tracer,
+ const envoy_service_load_stats_v3_LoadStatsRequest* request,
+ const TString& build_version) {
+ if (GRPC_TRACE_FLAG_ENABLED(*tracer) &&
+ gpr_should_log(GPR_LOG_SEVERITY_DEBUG)) {
+ // TODO(roth): When we can upgrade upb, use upb textformat code to dump
+ // the raw proto instead of doing this manually.
+ std::vector<TString> fields;
+ // node
+ const auto* node =
+ envoy_service_load_stats_v3_LoadStatsRequest_node(request);
+ if (node != nullptr) {
+ AddNodeLogFields(node, build_version, &fields);
+ }
+ // cluster_stats
+ size_t num_cluster_stats;
+ const struct envoy_config_endpoint_v3_ClusterStats* const* cluster_stats =
+ envoy_service_load_stats_v3_LoadStatsRequest_cluster_stats(
+ request, &num_cluster_stats);
+ for (size_t i = 0; i < num_cluster_stats; ++i) {
+ const auto* cluster_stat = cluster_stats[i];
+ fields.emplace_back("cluster_stats {");
+ // cluster_name
+ AddStringField(
+ " cluster_name",
+ envoy_config_endpoint_v3_ClusterStats_cluster_name(cluster_stat),
+ &fields);
+ // cluster_service_name
+ AddStringField(" cluster_service_name",
+ envoy_config_endpoint_v3_ClusterStats_cluster_service_name(
+ cluster_stat),
+ &fields);
+ // upstream_locality_stats
+ size_t num_stats;
+ const envoy_config_endpoint_v3_UpstreamLocalityStats* const* stats =
+ envoy_config_endpoint_v3_ClusterStats_upstream_locality_stats(
+ cluster_stat, &num_stats);
+ for (size_t j = 0; j < num_stats; ++j) {
+ const auto* stat = stats[j];
+ fields.emplace_back(" upstream_locality_stats {");
+ // locality
+ const auto* locality =
+ envoy_config_endpoint_v3_UpstreamLocalityStats_locality(stat);
+ if (locality != nullptr) {
+ fields.emplace_back(" locality {");
+ AddLocalityField(3, locality, &fields);
+ fields.emplace_back(" }");
+ }
+ // total_successful_requests
+ fields.emplace_back(y_absl::StrCat(
+ " total_successful_requests: ",
+ envoy_config_endpoint_v3_UpstreamLocalityStats_total_successful_requests(
+ stat)));
+ // total_requests_in_progress
+ fields.emplace_back(y_absl::StrCat(
+ " total_requests_in_progress: ",
+ envoy_config_endpoint_v3_UpstreamLocalityStats_total_requests_in_progress(
+ stat)));
+ // total_error_requests
+ fields.emplace_back(y_absl::StrCat(
+ " total_error_requests: ",
+ envoy_config_endpoint_v3_UpstreamLocalityStats_total_error_requests(
+ stat)));
+ // total_issued_requests
+ fields.emplace_back(y_absl::StrCat(
+ " total_issued_requests: ",
+ envoy_config_endpoint_v3_UpstreamLocalityStats_total_issued_requests(
+ stat)));
+ fields.emplace_back(" }");
+ }
+ // total_dropped_requests
+ fields.emplace_back(y_absl::StrCat(
+ " total_dropped_requests: ",
+ envoy_config_endpoint_v3_ClusterStats_total_dropped_requests(
+ cluster_stat)));
+ // dropped_requests
+ size_t num_drops;
+ const envoy_config_endpoint_v3_ClusterStats_DroppedRequests* const*
+ drops = envoy_config_endpoint_v3_ClusterStats_dropped_requests(
+ cluster_stat, &num_drops);
+ for (size_t j = 0; j < num_drops; ++j) {
+ const auto* drop = drops[j];
+ fields.emplace_back(" dropped_requests {");
+ // category
+ AddStringField(
+ " category",
+ envoy_config_endpoint_v3_ClusterStats_DroppedRequests_category(
+ drop),
+ &fields);
+ // dropped_count
+ fields.emplace_back(y_absl::StrCat(
+ " dropped_count: ",
+ envoy_config_endpoint_v3_ClusterStats_DroppedRequests_dropped_count(
+ drop)));
+ fields.emplace_back(" }");
+ }
+ // load_report_interval
+ const auto* load_report_interval =
+ envoy_config_endpoint_v3_ClusterStats_load_report_interval(
+ cluster_stat);
+ if (load_report_interval != nullptr) {
+ fields.emplace_back(" load_report_interval {");
+ fields.emplace_back(y_absl::StrCat(
+ " seconds: ",
+ google_protobuf_Duration_seconds(load_report_interval)));
+ fields.emplace_back(
+ y_absl::StrCat(" nanos: ",
+ google_protobuf_Duration_nanos(load_report_interval)));
+ fields.emplace_back(" }");
+ }
+ fields.emplace_back("}");
+ }
+ gpr_log(GPR_DEBUG, "[xds_client %p] constructed LRS request: %s", client,
+ y_absl::StrJoin(fields, "\n").c_str());
+ }
+}
+
+grpc_slice SerializeLrsRequest(
+ const envoy_service_load_stats_v3_LoadStatsRequest* request,
+ upb_arena* arena) {
+ size_t output_length;
+ char* output = envoy_service_load_stats_v3_LoadStatsRequest_serialize(
+ request, arena, &output_length);
+ return grpc_slice_from_copied_buffer(output, output_length);
+}
+
+} // namespace
+
+grpc_slice XdsApi::CreateLrsInitialRequest() {
+ upb::Arena arena;
+ // Create a request.
+ envoy_service_load_stats_v3_LoadStatsRequest* request =
+ envoy_service_load_stats_v3_LoadStatsRequest_new(arena.ptr());
+ // Populate node.
+ envoy_config_core_v3_Node* node_msg =
+ envoy_service_load_stats_v3_LoadStatsRequest_mutable_node(request,
+ arena.ptr());
+ PopulateNode(arena.ptr(), bootstrap_, build_version_, user_agent_name_,
+ node_msg);
+ envoy_config_core_v3_Node_add_client_features(
+ node_msg, upb_strview_makez("envoy.lrs.supports_send_all_clusters"),
+ arena.ptr());
+ MaybeLogLrsRequest(client_, tracer_, request, build_version_);
+ return SerializeLrsRequest(request, arena.ptr());
+}
+
+namespace {
+
+void LocalityStatsPopulate(
+ envoy_config_endpoint_v3_UpstreamLocalityStats* output,
+ const XdsLocalityName& locality_name,
+ const XdsClusterLocalityStats::Snapshot& snapshot, upb_arena* arena) {
+ // Set locality.
+ envoy_config_core_v3_Locality* locality =
+ envoy_config_endpoint_v3_UpstreamLocalityStats_mutable_locality(output,
+ arena);
+ if (!locality_name.region().empty()) {
+ envoy_config_core_v3_Locality_set_region(
+ locality, StdStringToUpbString(locality_name.region()));
+ }
+ if (!locality_name.zone().empty()) {
+ envoy_config_core_v3_Locality_set_zone(
+ locality, StdStringToUpbString(locality_name.zone()));
+ }
+ if (!locality_name.sub_zone().empty()) {
+ envoy_config_core_v3_Locality_set_sub_zone(
+ locality, StdStringToUpbString(locality_name.sub_zone()));
+ }
+ // Set total counts.
+ envoy_config_endpoint_v3_UpstreamLocalityStats_set_total_successful_requests(
+ output, snapshot.total_successful_requests);
+ envoy_config_endpoint_v3_UpstreamLocalityStats_set_total_requests_in_progress(
+ output, snapshot.total_requests_in_progress);
+ envoy_config_endpoint_v3_UpstreamLocalityStats_set_total_error_requests(
+ output, snapshot.total_error_requests);
+ envoy_config_endpoint_v3_UpstreamLocalityStats_set_total_issued_requests(
+ output, snapshot.total_issued_requests);
+ // Add backend metrics.
+ for (const auto& p : snapshot.backend_metrics) {
+ const TString& metric_name = p.first;
+ const XdsClusterLocalityStats::BackendMetric& metric_value = p.second;
+ envoy_config_endpoint_v3_EndpointLoadMetricStats* load_metric =
+ envoy_config_endpoint_v3_UpstreamLocalityStats_add_load_metric_stats(
+ output, arena);
+ envoy_config_endpoint_v3_EndpointLoadMetricStats_set_metric_name(
+ load_metric, StdStringToUpbString(metric_name));
+ envoy_config_endpoint_v3_EndpointLoadMetricStats_set_num_requests_finished_with_metric(
+ load_metric, metric_value.num_requests_finished_with_metric);
+ envoy_config_endpoint_v3_EndpointLoadMetricStats_set_total_metric_value(
+ load_metric, metric_value.total_metric_value);
+ }
+}
+
+} // namespace
+
+grpc_slice XdsApi::CreateLrsRequest(
+ ClusterLoadReportMap cluster_load_report_map) {
+ upb::Arena arena;
+ // Create a request.
+ envoy_service_load_stats_v3_LoadStatsRequest* request =
+ envoy_service_load_stats_v3_LoadStatsRequest_new(arena.ptr());
+ for (auto& p : cluster_load_report_map) {
+ const TString& cluster_name = p.first.first;
+ const TString& eds_service_name = p.first.second;
+ const ClusterLoadReport& load_report = p.second;
+ // Add cluster stats.
+ envoy_config_endpoint_v3_ClusterStats* cluster_stats =
+ envoy_service_load_stats_v3_LoadStatsRequest_add_cluster_stats(
+ request, arena.ptr());
+ // Set the cluster name.
+ envoy_config_endpoint_v3_ClusterStats_set_cluster_name(
+ cluster_stats, StdStringToUpbString(cluster_name));
+ // Set EDS service name, if non-empty.
+ if (!eds_service_name.empty()) {
+ envoy_config_endpoint_v3_ClusterStats_set_cluster_service_name(
+ cluster_stats, StdStringToUpbString(eds_service_name));
+ }
+ // Add locality stats.
+ for (const auto& p : load_report.locality_stats) {
+ const XdsLocalityName& locality_name = *p.first;
+ const auto& snapshot = p.second;
+ envoy_config_endpoint_v3_UpstreamLocalityStats* locality_stats =
+ envoy_config_endpoint_v3_ClusterStats_add_upstream_locality_stats(
+ cluster_stats, arena.ptr());
+ LocalityStatsPopulate(locality_stats, locality_name, snapshot,
+ arena.ptr());
+ }
+ // Add dropped requests.
+ uint64_t total_dropped_requests = 0;
+ for (const auto& p : load_report.dropped_requests.categorized_drops) {
+ const TString& category = p.first;
+ const uint64_t count = p.second;
+ envoy_config_endpoint_v3_ClusterStats_DroppedRequests* dropped_requests =
+ envoy_config_endpoint_v3_ClusterStats_add_dropped_requests(
+ cluster_stats, arena.ptr());
+ envoy_config_endpoint_v3_ClusterStats_DroppedRequests_set_category(
+ dropped_requests, StdStringToUpbString(category));
+ envoy_config_endpoint_v3_ClusterStats_DroppedRequests_set_dropped_count(
+ dropped_requests, count);
+ total_dropped_requests += count;
+ }
+ total_dropped_requests += load_report.dropped_requests.uncategorized_drops;
+ // Set total dropped requests.
+ envoy_config_endpoint_v3_ClusterStats_set_total_dropped_requests(
+ cluster_stats, total_dropped_requests);
+ // Set real load report interval.
+ gpr_timespec timespec =
+ grpc_millis_to_timespec(load_report.load_report_interval, GPR_TIMESPAN);
+ google_protobuf_Duration* load_report_interval =
+ envoy_config_endpoint_v3_ClusterStats_mutable_load_report_interval(
+ cluster_stats, arena.ptr());
+ google_protobuf_Duration_set_seconds(load_report_interval, timespec.tv_sec);
+ google_protobuf_Duration_set_nanos(load_report_interval, timespec.tv_nsec);
+ }
+ MaybeLogLrsRequest(client_, tracer_, request, build_version_);
+ return SerializeLrsRequest(request, arena.ptr());
+}
+
+grpc_error* XdsApi::ParseLrsResponse(const grpc_slice& encoded_response,
+ bool* send_all_clusters,
+ std::set<TString>* cluster_names,
+ grpc_millis* load_reporting_interval) {
+ upb::Arena arena;
+ // Decode the response.
+ const envoy_service_load_stats_v3_LoadStatsResponse* decoded_response =
+ envoy_service_load_stats_v3_LoadStatsResponse_parse(
+ reinterpret_cast<const char*>(GRPC_SLICE_START_PTR(encoded_response)),
+ GRPC_SLICE_LENGTH(encoded_response), arena.ptr());
+ // Parse the response.
+ if (decoded_response == nullptr) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING("Can't decode response.");
+ }
+ // Check send_all_clusters.
+ if (envoy_service_load_stats_v3_LoadStatsResponse_send_all_clusters(
+ decoded_response)) {
+ *send_all_clusters = true;
+ } else {
+ // Store the cluster names.
+ size_t size;
+ const upb_strview* clusters =
+ envoy_service_load_stats_v3_LoadStatsResponse_clusters(decoded_response,
+ &size);
+ for (size_t i = 0; i < size; ++i) {
+ cluster_names->emplace(UpbStringToStdString(clusters[i]));
+ }
+ }
+ // Get the load report interval.
+ const google_protobuf_Duration* load_reporting_interval_duration =
+ envoy_service_load_stats_v3_LoadStatsResponse_load_reporting_interval(
+ decoded_response);
+ gpr_timespec timespec{
+ google_protobuf_Duration_seconds(load_reporting_interval_duration),
+ google_protobuf_Duration_nanos(load_reporting_interval_duration),
+ GPR_TIMESPAN};
+ *load_reporting_interval = gpr_time_to_millis(timespec);
+ return GRPC_ERROR_NONE;
+}
+
+} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/ext/xds/xds_api.h b/contrib/libs/grpc/src/core/ext/xds/xds_api.h
index 1ede972d520..e421f883939 100644
--- a/contrib/libs/grpc/src/core/ext/xds/xds_api.h
+++ b/contrib/libs/grpc/src/core/ext/xds/xds_api.h
@@ -1,397 +1,397 @@
-/*
- *
- * Copyright 2018 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#ifndef GRPC_CORE_EXT_XDS_XDS_API_H
-#define GRPC_CORE_EXT_XDS_XDS_API_H
-
-#include <grpc/support/port_platform.h>
-
-#include <stdint.h>
-
-#include <set>
-
-#include "y_absl/container/inlined_vector.h"
-#include "y_absl/types/optional.h"
-#include "re2/re2.h"
-
-#include <grpc/slice_buffer.h>
-
-#include "src/core/ext/filters/client_channel/server_address.h"
-#include "src/core/ext/xds/xds_bootstrap.h"
-#include "src/core/ext/xds/xds_client_stats.h"
-
-namespace grpc_core {
-
-class XdsClient;
-
-class XdsApi {
- public:
- static const char* kLdsTypeUrl;
- static const char* kRdsTypeUrl;
- static const char* kCdsTypeUrl;
- static const char* kEdsTypeUrl;
-
- // TODO(donnadionne): When we can use y_absl::variant<>, consider using that
- // for: PathMatcher, HeaderMatcher, cluster_name and weighted_clusters
- struct Route {
- // Matchers for this route.
- struct Matchers {
- struct PathMatcher {
- enum class PathMatcherType {
- PATH, // path stored in string_matcher field
- PREFIX, // prefix stored in string_matcher field
- REGEX, // regex stored in regex_matcher field
- };
- PathMatcherType type;
- TString string_matcher;
- std::unique_ptr<RE2> regex_matcher;
-
- PathMatcher() = default;
- PathMatcher(const PathMatcher& other);
- PathMatcher& operator=(const PathMatcher& other);
- bool operator==(const PathMatcher& other) const;
- TString ToString() const;
- };
-
- struct HeaderMatcher {
- enum class HeaderMatcherType {
- EXACT, // value stored in string_matcher field
- REGEX, // uses regex_match field
- RANGE, // uses range_start and range_end fields
- PRESENT, // uses present_match field
- PREFIX, // prefix stored in string_matcher field
- SUFFIX, // suffix stored in string_matcher field
- };
- TString name;
- HeaderMatcherType type;
- int64_t range_start;
- int64_t range_end;
- TString string_matcher;
- std::unique_ptr<RE2> regex_match;
- bool present_match;
- // invert_match field may or may not exisit, so initialize it to
- // false.
- bool invert_match = false;
-
- HeaderMatcher() = default;
- HeaderMatcher(const HeaderMatcher& other);
- HeaderMatcher& operator=(const HeaderMatcher& other);
- bool operator==(const HeaderMatcher& other) const;
- TString ToString() const;
- };
-
- PathMatcher path_matcher;
- std::vector<HeaderMatcher> header_matchers;
- y_absl::optional<uint32_t> fraction_per_million;
-
- bool operator==(const Matchers& other) const {
- return (path_matcher == other.path_matcher &&
- header_matchers == other.header_matchers &&
- fraction_per_million == other.fraction_per_million);
- }
- TString ToString() const;
- };
-
- Matchers matchers;
-
- // Action for this route.
- // TODO(roth): When we can use y_absl::variant<>, consider using that
- // here, to enforce the fact that only one of the two fields can be set.
- TString cluster_name;
- struct ClusterWeight {
- TString name;
- uint32_t weight;
- bool operator==(const ClusterWeight& other) const {
- return (name == other.name && weight == other.weight);
- }
- TString ToString() const;
- };
- std::vector<ClusterWeight> weighted_clusters;
-
- bool operator==(const Route& other) const {
- return (matchers == other.matchers &&
- cluster_name == other.cluster_name &&
- weighted_clusters == other.weighted_clusters);
- }
- TString ToString() const;
- };
-
- struct RdsUpdate {
- struct VirtualHost {
- std::vector<TString> domains;
- std::vector<Route> routes;
-
- bool operator==(const VirtualHost& other) const {
- return domains == other.domains && routes == other.routes;
- }
- };
-
- std::vector<VirtualHost> virtual_hosts;
-
- bool operator==(const RdsUpdate& other) const {
- return virtual_hosts == other.virtual_hosts;
- }
- TString ToString() const;
- VirtualHost* FindVirtualHostForDomain(const TString& domain);
- };
-
- struct StringMatcher {
- enum class StringMatcherType {
- EXACT, // value stored in string_matcher_field
- PREFIX, // value stored in string_matcher_field
- SUFFIX, // value stored in string_matcher_field
- SAFE_REGEX, // use regex_match field
- CONTAINS, // value stored in string_matcher_field
- };
- StringMatcherType type;
- TString string_matcher;
- std::unique_ptr<RE2> regex_match;
- bool ignore_case;
-
- StringMatcher() = default;
- StringMatcher(const StringMatcher& other);
- StringMatcher& operator=(const StringMatcher& other);
- bool operator==(const StringMatcher& other) const;
- };
-
- struct CommonTlsContext {
- struct CertificateValidationContext {
- std::vector<StringMatcher> match_subject_alt_names;
-
- bool operator==(const CertificateValidationContext& other) const {
- return match_subject_alt_names == other.match_subject_alt_names;
- }
- };
-
- struct CombinedCertificateValidationContext {
- CertificateValidationContext default_validation_context;
- TString validation_context_certificate_provider_instance;
-
- bool operator==(const CombinedCertificateValidationContext& other) const {
- return default_validation_context == other.default_validation_context &&
- validation_context_certificate_provider_instance ==
- other.validation_context_certificate_provider_instance;
- }
- };
-
- TString tls_certificate_certificate_provider_instance;
- CombinedCertificateValidationContext combined_validation_context;
-
- bool operator==(const CommonTlsContext& other) const {
- return tls_certificate_certificate_provider_instance ==
- other.tls_certificate_certificate_provider_instance &&
- combined_validation_context == other.combined_validation_context;
- }
- };
-
- // TODO(roth): When we can use y_absl::variant<>, consider using that
- // here, to enforce the fact that only one of the two fields can be set.
- struct LdsUpdate {
- // The name to use in the RDS request.
- TString route_config_name;
- // The RouteConfiguration to use for this listener.
- // Present only if it is inlined in the LDS response.
- y_absl::optional<RdsUpdate> rds_update;
-
- bool operator==(const LdsUpdate& other) const {
- return route_config_name == other.route_config_name &&
- rds_update == other.rds_update;
- }
- };
-
- using LdsUpdateMap = std::map<TString /*server_name*/, LdsUpdate>;
-
- using RdsUpdateMap = std::map<TString /*route_config_name*/, RdsUpdate>;
-
- struct CdsUpdate {
- // The name to use in the EDS request.
- // If empty, the cluster name will be used.
- TString eds_service_name;
- // Tls Context used by clients
- CommonTlsContext common_tls_context;
- // The LRS server to use for load reporting.
- // If not set, load reporting will be disabled.
- // If set to the empty string, will use the same server we obtained the CDS
- // data from.
- y_absl::optional<TString> lrs_load_reporting_server_name;
- // Maximum number of outstanding requests can be made to the upstream
- // cluster.
- uint32_t max_concurrent_requests = 1024;
-
- bool operator==(const CdsUpdate& other) const {
- return eds_service_name == other.eds_service_name &&
- common_tls_context == other.common_tls_context &&
- lrs_load_reporting_server_name ==
- other.lrs_load_reporting_server_name &&
- max_concurrent_requests == other.max_concurrent_requests;
- }
- };
-
- using CdsUpdateMap = std::map<TString /*cluster_name*/, CdsUpdate>;
-
- struct EdsUpdate {
- struct Priority {
- struct Locality {
- RefCountedPtr<XdsLocalityName> name;
- uint32_t lb_weight;
- ServerAddressList endpoints;
-
- bool operator==(const Locality& other) const {
- return *name == *other.name && lb_weight == other.lb_weight &&
- endpoints == other.endpoints;
- }
- bool operator!=(const Locality& other) const {
- return !(*this == other);
- }
- TString ToString() const;
- };
-
- std::map<XdsLocalityName*, Locality, XdsLocalityName::Less> localities;
-
- bool operator==(const Priority& other) const;
- TString ToString() const;
- };
- using PriorityList = y_absl::InlinedVector<Priority, 2>;
-
- // There are two phases of accessing this class's content:
- // 1. to initialize in the control plane combiner;
- // 2. to use in the data plane combiner.
- // So no additional synchronization is needed.
- class DropConfig : public RefCounted<DropConfig> {
- public:
- struct DropCategory {
- bool operator==(const DropCategory& other) const {
- return name == other.name &&
- parts_per_million == other.parts_per_million;
- }
-
- TString name;
- const uint32_t parts_per_million;
- };
-
- using DropCategoryList = y_absl::InlinedVector<DropCategory, 2>;
-
- void AddCategory(TString name, uint32_t parts_per_million) {
- drop_category_list_.emplace_back(
- DropCategory{std::move(name), parts_per_million});
- if (parts_per_million == 1000000) drop_all_ = true;
- }
-
- // The only method invoked from outside the WorkSerializer (used in
- // the data plane).
- bool ShouldDrop(const TString** category_name) const;
-
- const DropCategoryList& drop_category_list() const {
- return drop_category_list_;
- }
-
- bool drop_all() const { return drop_all_; }
-
- bool operator==(const DropConfig& other) const {
- return drop_category_list_ == other.drop_category_list_;
- }
- bool operator!=(const DropConfig& other) const {
- return !(*this == other);
- }
-
- TString ToString() const;
-
- private:
- DropCategoryList drop_category_list_;
- bool drop_all_ = false;
- };
-
- PriorityList priorities;
- RefCountedPtr<DropConfig> drop_config;
-
- bool operator==(const EdsUpdate& other) const {
- return priorities == other.priorities &&
- *drop_config == *other.drop_config;
- }
- TString ToString() const;
- };
-
- using EdsUpdateMap = std::map<TString /*eds_service_name*/, EdsUpdate>;
-
- struct ClusterLoadReport {
- XdsClusterDropStats::Snapshot dropped_requests;
- std::map<RefCountedPtr<XdsLocalityName>, XdsClusterLocalityStats::Snapshot,
- XdsLocalityName::Less>
- locality_stats;
- grpc_millis load_report_interval;
- };
- using ClusterLoadReportMap = std::map<
- std::pair<TString /*cluster_name*/, TString /*eds_service_name*/>,
- ClusterLoadReport>;
-
- XdsApi(XdsClient* client, TraceFlag* tracer, const XdsBootstrap* bootstrap);
-
- // Creates an ADS request.
- // Takes ownership of \a error.
- grpc_slice CreateAdsRequest(const TString& type_url,
- const std::set<y_absl::string_view>& resource_names,
- const TString& version,
- const TString& nonce, grpc_error* error,
- bool populate_node);
-
- // Parses an ADS response.
- // If the response can't be parsed at the top level, the resulting
- // type_url will be empty.
- struct AdsParseResult {
- grpc_error* parse_error = GRPC_ERROR_NONE;
- TString version;
- TString nonce;
- TString type_url;
- LdsUpdateMap lds_update_map;
- RdsUpdateMap rds_update_map;
- CdsUpdateMap cds_update_map;
- EdsUpdateMap eds_update_map;
- };
- AdsParseResult ParseAdsResponse(
- const grpc_slice& encoded_response,
- const std::set<y_absl::string_view>& expected_listener_names,
- const std::set<y_absl::string_view>& expected_route_configuration_names,
- const std::set<y_absl::string_view>& expected_cluster_names,
- const std::set<y_absl::string_view>& expected_eds_service_names);
-
- // Creates an initial LRS request.
- grpc_slice CreateLrsInitialRequest();
-
- // Creates an LRS request sending a client-side load report.
- grpc_slice CreateLrsRequest(ClusterLoadReportMap cluster_load_report_map);
-
- // Parses the LRS response and returns \a
- // load_reporting_interval for client-side load reporting. If there is any
- // error, the output config is invalid.
- grpc_error* ParseLrsResponse(const grpc_slice& encoded_response,
- bool* send_all_clusters,
- std::set<TString>* cluster_names,
- grpc_millis* load_reporting_interval);
-
- private:
- XdsClient* client_;
- TraceFlag* tracer_;
- const bool use_v3_;
- const XdsBootstrap* bootstrap_; // Do not own.
- const TString build_version_;
- const TString user_agent_name_;
-};
-
-} // namespace grpc_core
-
-#endif /* GRPC_CORE_EXT_XDS_XDS_API_H */
+/*
+ *
+ * Copyright 2018 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef GRPC_CORE_EXT_XDS_XDS_API_H
+#define GRPC_CORE_EXT_XDS_XDS_API_H
+
+#include <grpc/support/port_platform.h>
+
+#include <stdint.h>
+
+#include <set>
+
+#include "y_absl/container/inlined_vector.h"
+#include "y_absl/types/optional.h"
+#include "re2/re2.h"
+
+#include <grpc/slice_buffer.h>
+
+#include "src/core/ext/filters/client_channel/server_address.h"
+#include "src/core/ext/xds/xds_bootstrap.h"
+#include "src/core/ext/xds/xds_client_stats.h"
+
+namespace grpc_core {
+
+class XdsClient;
+
+class XdsApi {
+ public:
+ static const char* kLdsTypeUrl;
+ static const char* kRdsTypeUrl;
+ static const char* kCdsTypeUrl;
+ static const char* kEdsTypeUrl;
+
+ // TODO(donnadionne): When we can use y_absl::variant<>, consider using that
+ // for: PathMatcher, HeaderMatcher, cluster_name and weighted_clusters
+ struct Route {
+ // Matchers for this route.
+ struct Matchers {
+ struct PathMatcher {
+ enum class PathMatcherType {
+ PATH, // path stored in string_matcher field
+ PREFIX, // prefix stored in string_matcher field
+ REGEX, // regex stored in regex_matcher field
+ };
+ PathMatcherType type;
+ TString string_matcher;
+ std::unique_ptr<RE2> regex_matcher;
+
+ PathMatcher() = default;
+ PathMatcher(const PathMatcher& other);
+ PathMatcher& operator=(const PathMatcher& other);
+ bool operator==(const PathMatcher& other) const;
+ TString ToString() const;
+ };
+
+ struct HeaderMatcher {
+ enum class HeaderMatcherType {
+ EXACT, // value stored in string_matcher field
+ REGEX, // uses regex_match field
+ RANGE, // uses range_start and range_end fields
+ PRESENT, // uses present_match field
+ PREFIX, // prefix stored in string_matcher field
+ SUFFIX, // suffix stored in string_matcher field
+ };
+ TString name;
+ HeaderMatcherType type;
+ int64_t range_start;
+ int64_t range_end;
+ TString string_matcher;
+ std::unique_ptr<RE2> regex_match;
+ bool present_match;
+ // invert_match field may or may not exisit, so initialize it to
+ // false.
+ bool invert_match = false;
+
+ HeaderMatcher() = default;
+ HeaderMatcher(const HeaderMatcher& other);
+ HeaderMatcher& operator=(const HeaderMatcher& other);
+ bool operator==(const HeaderMatcher& other) const;
+ TString ToString() const;
+ };
+
+ PathMatcher path_matcher;
+ std::vector<HeaderMatcher> header_matchers;
+ y_absl::optional<uint32_t> fraction_per_million;
+
+ bool operator==(const Matchers& other) const {
+ return (path_matcher == other.path_matcher &&
+ header_matchers == other.header_matchers &&
+ fraction_per_million == other.fraction_per_million);
+ }
+ TString ToString() const;
+ };
+
+ Matchers matchers;
+
+ // Action for this route.
+ // TODO(roth): When we can use y_absl::variant<>, consider using that
+ // here, to enforce the fact that only one of the two fields can be set.
+ TString cluster_name;
+ struct ClusterWeight {
+ TString name;
+ uint32_t weight;
+ bool operator==(const ClusterWeight& other) const {
+ return (name == other.name && weight == other.weight);
+ }
+ TString ToString() const;
+ };
+ std::vector<ClusterWeight> weighted_clusters;
+
+ bool operator==(const Route& other) const {
+ return (matchers == other.matchers &&
+ cluster_name == other.cluster_name &&
+ weighted_clusters == other.weighted_clusters);
+ }
+ TString ToString() const;
+ };
+
+ struct RdsUpdate {
+ struct VirtualHost {
+ std::vector<TString> domains;
+ std::vector<Route> routes;
+
+ bool operator==(const VirtualHost& other) const {
+ return domains == other.domains && routes == other.routes;
+ }
+ };
+
+ std::vector<VirtualHost> virtual_hosts;
+
+ bool operator==(const RdsUpdate& other) const {
+ return virtual_hosts == other.virtual_hosts;
+ }
+ TString ToString() const;
+ VirtualHost* FindVirtualHostForDomain(const TString& domain);
+ };
+
+ struct StringMatcher {
+ enum class StringMatcherType {
+ EXACT, // value stored in string_matcher_field
+ PREFIX, // value stored in string_matcher_field
+ SUFFIX, // value stored in string_matcher_field
+ SAFE_REGEX, // use regex_match field
+ CONTAINS, // value stored in string_matcher_field
+ };
+ StringMatcherType type;
+ TString string_matcher;
+ std::unique_ptr<RE2> regex_match;
+ bool ignore_case;
+
+ StringMatcher() = default;
+ StringMatcher(const StringMatcher& other);
+ StringMatcher& operator=(const StringMatcher& other);
+ bool operator==(const StringMatcher& other) const;
+ };
+
+ struct CommonTlsContext {
+ struct CertificateValidationContext {
+ std::vector<StringMatcher> match_subject_alt_names;
+
+ bool operator==(const CertificateValidationContext& other) const {
+ return match_subject_alt_names == other.match_subject_alt_names;
+ }
+ };
+
+ struct CombinedCertificateValidationContext {
+ CertificateValidationContext default_validation_context;
+ TString validation_context_certificate_provider_instance;
+
+ bool operator==(const CombinedCertificateValidationContext& other) const {
+ return default_validation_context == other.default_validation_context &&
+ validation_context_certificate_provider_instance ==
+ other.validation_context_certificate_provider_instance;
+ }
+ };
+
+ TString tls_certificate_certificate_provider_instance;
+ CombinedCertificateValidationContext combined_validation_context;
+
+ bool operator==(const CommonTlsContext& other) const {
+ return tls_certificate_certificate_provider_instance ==
+ other.tls_certificate_certificate_provider_instance &&
+ combined_validation_context == other.combined_validation_context;
+ }
+ };
+
+ // TODO(roth): When we can use y_absl::variant<>, consider using that
+ // here, to enforce the fact that only one of the two fields can be set.
+ struct LdsUpdate {
+ // The name to use in the RDS request.
+ TString route_config_name;
+ // The RouteConfiguration to use for this listener.
+ // Present only if it is inlined in the LDS response.
+ y_absl::optional<RdsUpdate> rds_update;
+
+ bool operator==(const LdsUpdate& other) const {
+ return route_config_name == other.route_config_name &&
+ rds_update == other.rds_update;
+ }
+ };
+
+ using LdsUpdateMap = std::map<TString /*server_name*/, LdsUpdate>;
+
+ using RdsUpdateMap = std::map<TString /*route_config_name*/, RdsUpdate>;
+
+ struct CdsUpdate {
+ // The name to use in the EDS request.
+ // If empty, the cluster name will be used.
+ TString eds_service_name;
+ // Tls Context used by clients
+ CommonTlsContext common_tls_context;
+ // The LRS server to use for load reporting.
+ // If not set, load reporting will be disabled.
+ // If set to the empty string, will use the same server we obtained the CDS
+ // data from.
+ y_absl::optional<TString> lrs_load_reporting_server_name;
+ // Maximum number of outstanding requests can be made to the upstream
+ // cluster.
+ uint32_t max_concurrent_requests = 1024;
+
+ bool operator==(const CdsUpdate& other) const {
+ return eds_service_name == other.eds_service_name &&
+ common_tls_context == other.common_tls_context &&
+ lrs_load_reporting_server_name ==
+ other.lrs_load_reporting_server_name &&
+ max_concurrent_requests == other.max_concurrent_requests;
+ }
+ };
+
+ using CdsUpdateMap = std::map<TString /*cluster_name*/, CdsUpdate>;
+
+ struct EdsUpdate {
+ struct Priority {
+ struct Locality {
+ RefCountedPtr<XdsLocalityName> name;
+ uint32_t lb_weight;
+ ServerAddressList endpoints;
+
+ bool operator==(const Locality& other) const {
+ return *name == *other.name && lb_weight == other.lb_weight &&
+ endpoints == other.endpoints;
+ }
+ bool operator!=(const Locality& other) const {
+ return !(*this == other);
+ }
+ TString ToString() const;
+ };
+
+ std::map<XdsLocalityName*, Locality, XdsLocalityName::Less> localities;
+
+ bool operator==(const Priority& other) const;
+ TString ToString() const;
+ };
+ using PriorityList = y_absl::InlinedVector<Priority, 2>;
+
+ // There are two phases of accessing this class's content:
+ // 1. to initialize in the control plane combiner;
+ // 2. to use in the data plane combiner.
+ // So no additional synchronization is needed.
+ class DropConfig : public RefCounted<DropConfig> {
+ public:
+ struct DropCategory {
+ bool operator==(const DropCategory& other) const {
+ return name == other.name &&
+ parts_per_million == other.parts_per_million;
+ }
+
+ TString name;
+ const uint32_t parts_per_million;
+ };
+
+ using DropCategoryList = y_absl::InlinedVector<DropCategory, 2>;
+
+ void AddCategory(TString name, uint32_t parts_per_million) {
+ drop_category_list_.emplace_back(
+ DropCategory{std::move(name), parts_per_million});
+ if (parts_per_million == 1000000) drop_all_ = true;
+ }
+
+ // The only method invoked from outside the WorkSerializer (used in
+ // the data plane).
+ bool ShouldDrop(const TString** category_name) const;
+
+ const DropCategoryList& drop_category_list() const {
+ return drop_category_list_;
+ }
+
+ bool drop_all() const { return drop_all_; }
+
+ bool operator==(const DropConfig& other) const {
+ return drop_category_list_ == other.drop_category_list_;
+ }
+ bool operator!=(const DropConfig& other) const {
+ return !(*this == other);
+ }
+
+ TString ToString() const;
+
+ private:
+ DropCategoryList drop_category_list_;
+ bool drop_all_ = false;
+ };
+
+ PriorityList priorities;
+ RefCountedPtr<DropConfig> drop_config;
+
+ bool operator==(const EdsUpdate& other) const {
+ return priorities == other.priorities &&
+ *drop_config == *other.drop_config;
+ }
+ TString ToString() const;
+ };
+
+ using EdsUpdateMap = std::map<TString /*eds_service_name*/, EdsUpdate>;
+
+ struct ClusterLoadReport {
+ XdsClusterDropStats::Snapshot dropped_requests;
+ std::map<RefCountedPtr<XdsLocalityName>, XdsClusterLocalityStats::Snapshot,
+ XdsLocalityName::Less>
+ locality_stats;
+ grpc_millis load_report_interval;
+ };
+ using ClusterLoadReportMap = std::map<
+ std::pair<TString /*cluster_name*/, TString /*eds_service_name*/>,
+ ClusterLoadReport>;
+
+ XdsApi(XdsClient* client, TraceFlag* tracer, const XdsBootstrap* bootstrap);
+
+ // Creates an ADS request.
+ // Takes ownership of \a error.
+ grpc_slice CreateAdsRequest(const TString& type_url,
+ const std::set<y_absl::string_view>& resource_names,
+ const TString& version,
+ const TString& nonce, grpc_error* error,
+ bool populate_node);
+
+ // Parses an ADS response.
+ // If the response can't be parsed at the top level, the resulting
+ // type_url will be empty.
+ struct AdsParseResult {
+ grpc_error* parse_error = GRPC_ERROR_NONE;
+ TString version;
+ TString nonce;
+ TString type_url;
+ LdsUpdateMap lds_update_map;
+ RdsUpdateMap rds_update_map;
+ CdsUpdateMap cds_update_map;
+ EdsUpdateMap eds_update_map;
+ };
+ AdsParseResult ParseAdsResponse(
+ const grpc_slice& encoded_response,
+ const std::set<y_absl::string_view>& expected_listener_names,
+ const std::set<y_absl::string_view>& expected_route_configuration_names,
+ const std::set<y_absl::string_view>& expected_cluster_names,
+ const std::set<y_absl::string_view>& expected_eds_service_names);
+
+ // Creates an initial LRS request.
+ grpc_slice CreateLrsInitialRequest();
+
+ // Creates an LRS request sending a client-side load report.
+ grpc_slice CreateLrsRequest(ClusterLoadReportMap cluster_load_report_map);
+
+ // Parses the LRS response and returns \a
+ // load_reporting_interval for client-side load reporting. If there is any
+ // error, the output config is invalid.
+ grpc_error* ParseLrsResponse(const grpc_slice& encoded_response,
+ bool* send_all_clusters,
+ std::set<TString>* cluster_names,
+ grpc_millis* load_reporting_interval);
+
+ private:
+ XdsClient* client_;
+ TraceFlag* tracer_;
+ const bool use_v3_;
+ const XdsBootstrap* bootstrap_; // Do not own.
+ const TString build_version_;
+ const TString user_agent_name_;
+};
+
+} // namespace grpc_core
+
+#endif /* GRPC_CORE_EXT_XDS_XDS_API_H */
diff --git a/contrib/libs/grpc/src/core/ext/xds/xds_bootstrap.cc b/contrib/libs/grpc/src/core/ext/xds/xds_bootstrap.cc
index dec280ea5e4..e47fb78b0c6 100644
--- a/contrib/libs/grpc/src/core/ext/xds/xds_bootstrap.cc
+++ b/contrib/libs/grpc/src/core/ext/xds/xds_bootstrap.cc
@@ -1,373 +1,373 @@
-//
-// Copyright 2019 gRPC authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-#include <grpc/support/port_platform.h>
-
-#include "src/core/ext/xds/xds_bootstrap.h"
-
-#include <vector>
-
-#include <errno.h>
-#include <stdlib.h>
-
-#include "y_absl/strings/str_cat.h"
-#include "y_absl/strings/str_format.h"
-#include "y_absl/strings/str_join.h"
-#include "y_absl/strings/string_view.h"
-
-#include "src/core/lib/gpr/env.h"
-#include "src/core/lib/gpr/string.h"
-#include "src/core/lib/iomgr/load_file.h"
-#include "src/core/lib/slice/slice_internal.h"
-
-namespace grpc_core {
-
-bool XdsBootstrap::XdsServer::ShouldUseV3() const {
- return server_features.find("xds_v3") != server_features.end();
-}
-
-namespace {
-
-TString BootstrapString(const XdsBootstrap& bootstrap) {
- std::vector<TString> parts;
- if (bootstrap.node() != nullptr) {
- parts.push_back(y_absl::StrFormat(
- "node={\n"
- " id=\"%s\",\n"
- " cluster=\"%s\",\n"
- " locality={\n"
- " region=\"%s\",\n"
- " zone=\"%s\",\n"
- " subzone=\"%s\"\n"
- " },\n"
- " metadata=%s,\n"
- "},\n",
- bootstrap.node()->id, bootstrap.node()->cluster,
- bootstrap.node()->locality_region, bootstrap.node()->locality_zone,
- bootstrap.node()->locality_subzone, bootstrap.node()->metadata.Dump()));
- }
- parts.push_back(
- y_absl::StrFormat("servers=[\n"
- " {\n"
- " uri=\"%s\",\n"
- " creds=[\n",
- bootstrap.server().server_uri));
- for (const auto& creds : bootstrap.server().channel_creds) {
- parts.push_back(y_absl::StrFormat(" {type=\"%s\", config=%s},\n",
- creds.type, creds.config.Dump()));
- }
- parts.push_back(" ],\n");
- if (!bootstrap.server().server_features.empty()) {
- parts.push_back(y_absl::StrCat(
- " server_features=[",
- y_absl::StrJoin(bootstrap.server().server_features, ", "), "],\n"));
- }
- parts.push_back(" }\n]");
- return y_absl::StrJoin(parts, "");
-}
-
-} // namespace
-
-std::unique_ptr<XdsBootstrap> XdsBootstrap::ReadFromFile(XdsClient* client,
- TraceFlag* tracer,
- grpc_error** error) {
- grpc_core::UniquePtr<char> path(gpr_getenv("GRPC_XDS_BOOTSTRAP"));
- if (path == nullptr) {
- *error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "Environment variable GRPC_XDS_BOOTSTRAP not defined");
- return nullptr;
- }
- if (GRPC_TRACE_FLAG_ENABLED(*tracer)) {
- gpr_log(GPR_INFO,
- "[xds_client %p] Got bootstrap file location from "
- "GRPC_XDS_BOOTSTRAP environment variable: %s",
- client, path.get());
- }
- grpc_slice contents;
- *error = grpc_load_file(path.get(), /*add_null_terminator=*/true, &contents);
- if (*error != GRPC_ERROR_NONE) return nullptr;
- y_absl::string_view contents_str_view = StringViewFromSlice(contents);
- if (GRPC_TRACE_FLAG_ENABLED(*tracer)) {
- gpr_log(GPR_DEBUG, "[xds_client %p] Bootstrap file contents: %s", client,
- TString(contents_str_view).c_str());
- }
- Json json = Json::Parse(contents_str_view, error);
- grpc_slice_unref_internal(contents);
- if (*error != GRPC_ERROR_NONE) {
- grpc_error* error_out = GRPC_ERROR_CREATE_REFERENCING_FROM_COPIED_STRING(
- y_absl::StrCat("Failed to parse bootstrap file ", path.get()).c_str(),
- error, 1);
- GRPC_ERROR_UNREF(*error);
- *error = error_out;
- return nullptr;
- }
- std::unique_ptr<XdsBootstrap> result =
- y_absl::make_unique<XdsBootstrap>(std::move(json), error);
- if (*error == GRPC_ERROR_NONE && GRPC_TRACE_FLAG_ENABLED(*tracer)) {
- gpr_log(GPR_INFO,
- "[xds_client %p] Bootstrap config for creating xds client:\n%s",
- client, BootstrapString(*result).c_str());
- }
- return result;
-}
-
-XdsBootstrap::XdsBootstrap(Json json, grpc_error** error) {
- if (json.type() != Json::Type::OBJECT) {
- *error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "malformed JSON in bootstrap file");
- return;
- }
- std::vector<grpc_error*> error_list;
- auto it = json.mutable_object()->find("xds_servers");
- if (it == json.mutable_object()->end()) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "\"xds_servers\" field not present"));
- } else if (it->second.type() != Json::Type::ARRAY) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "\"xds_servers\" field is not an array"));
- } else {
- grpc_error* parse_error = ParseXdsServerList(&it->second);
- if (parse_error != GRPC_ERROR_NONE) error_list.push_back(parse_error);
- }
- it = json.mutable_object()->find("node");
- if (it != json.mutable_object()->end()) {
- if (it->second.type() != Json::Type::OBJECT) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "\"node\" field is not an object"));
- } else {
- grpc_error* parse_error = ParseNode(&it->second);
- if (parse_error != GRPC_ERROR_NONE) error_list.push_back(parse_error);
- }
- }
- *error = GRPC_ERROR_CREATE_FROM_VECTOR("errors parsing xds bootstrap file",
- &error_list);
-}
-
-grpc_error* XdsBootstrap::ParseXdsServerList(Json* json) {
- std::vector<grpc_error*> error_list;
- for (size_t i = 0; i < json->mutable_array()->size(); ++i) {
- Json& child = json->mutable_array()->at(i);
- if (child.type() != Json::Type::OBJECT) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("array element ", i, " is not an object").c_str()));
- } else {
- grpc_error* parse_error = ParseXdsServer(&child, i);
- if (parse_error != GRPC_ERROR_NONE) error_list.push_back(parse_error);
- }
- }
- return GRPC_ERROR_CREATE_FROM_VECTOR("errors parsing \"xds_servers\" array",
- &error_list);
-}
-
-grpc_error* XdsBootstrap::ParseXdsServer(Json* json, size_t idx) {
- std::vector<grpc_error*> error_list;
- servers_.emplace_back();
- XdsServer& server = servers_[servers_.size() - 1];
- auto it = json->mutable_object()->find("server_uri");
- if (it == json->mutable_object()->end()) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "\"server_uri\" field not present"));
- } else if (it->second.type() != Json::Type::STRING) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "\"server_uri\" field is not a string"));
- } else {
- server.server_uri = std::move(*it->second.mutable_string_value());
- }
- it = json->mutable_object()->find("channel_creds");
- if (it != json->mutable_object()->end()) {
- if (it->second.type() != Json::Type::ARRAY) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "\"channel_creds\" field is not an array"));
- } else {
- grpc_error* parse_error = ParseChannelCredsArray(&it->second, &server);
- if (parse_error != GRPC_ERROR_NONE) error_list.push_back(parse_error);
- }
- }
- it = json->mutable_object()->find("server_features");
- if (it != json->mutable_object()->end()) {
- if (it->second.type() != Json::Type::ARRAY) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "\"server_features\" field is not an array"));
- } else {
- grpc_error* parse_error = ParseServerFeaturesArray(&it->second, &server);
- if (parse_error != GRPC_ERROR_NONE) error_list.push_back(parse_error);
- }
- }
- // Can't use GRPC_ERROR_CREATE_FROM_VECTOR() here, because the error
- // string is not static in this case.
- if (error_list.empty()) return GRPC_ERROR_NONE;
- grpc_error* error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("errors parsing index ", idx).c_str());
- for (size_t i = 0; i < error_list.size(); ++i) {
- error = grpc_error_add_child(error, error_list[i]);
- }
- return error;
-}
-
-grpc_error* XdsBootstrap::ParseChannelCredsArray(Json* json,
- XdsServer* server) {
- std::vector<grpc_error*> error_list;
- for (size_t i = 0; i < json->mutable_array()->size(); ++i) {
- Json& child = json->mutable_array()->at(i);
- if (child.type() != Json::Type::OBJECT) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("array element ", i, " is not an object").c_str()));
- } else {
- grpc_error* parse_error = ParseChannelCreds(&child, i, server);
- if (parse_error != GRPC_ERROR_NONE) error_list.push_back(parse_error);
- }
- }
- return GRPC_ERROR_CREATE_FROM_VECTOR("errors parsing \"channel_creds\" array",
- &error_list);
-}
-
-grpc_error* XdsBootstrap::ParseChannelCreds(Json* json, size_t idx,
- XdsServer* server) {
- std::vector<grpc_error*> error_list;
- ChannelCreds channel_creds;
- auto it = json->mutable_object()->find("type");
- if (it == json->mutable_object()->end()) {
- error_list.push_back(
- GRPC_ERROR_CREATE_FROM_STATIC_STRING("\"type\" field not present"));
- } else if (it->second.type() != Json::Type::STRING) {
- error_list.push_back(
- GRPC_ERROR_CREATE_FROM_STATIC_STRING("\"type\" field is not a string"));
- } else {
- channel_creds.type = std::move(*it->second.mutable_string_value());
- }
- it = json->mutable_object()->find("config");
- if (it != json->mutable_object()->end()) {
- if (it->second.type() != Json::Type::OBJECT) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "\"config\" field is not an object"));
- } else {
- channel_creds.config = std::move(it->second);
- }
- }
- if (!channel_creds.type.empty()) {
- server->channel_creds.emplace_back(std::move(channel_creds));
- }
- // Can't use GRPC_ERROR_CREATE_FROM_VECTOR() here, because the error
- // string is not static in this case.
- if (error_list.empty()) return GRPC_ERROR_NONE;
- grpc_error* error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("errors parsing index ", idx).c_str());
- for (size_t i = 0; i < error_list.size(); ++i) {
- error = grpc_error_add_child(error, error_list[i]);
- }
- return error;
-}
-
-grpc_error* XdsBootstrap::ParseServerFeaturesArray(Json* json,
- XdsServer* server) {
- std::vector<grpc_error*> error_list;
- for (size_t i = 0; i < json->mutable_array()->size(); ++i) {
- Json& child = json->mutable_array()->at(i);
- if (child.type() == Json::Type::STRING &&
- child.string_value() == "xds_v3") {
- // TODO(roth): Remove env var check once we do interop testing and
- // are sure that the v3 code actually works.
- grpc_core::UniquePtr<char> enable_str(
- gpr_getenv("GRPC_XDS_EXPERIMENTAL_V3_SUPPORT"));
- bool enabled = false;
- if (gpr_parse_bool_value(enable_str.get(), &enabled) && enabled) {
- server->server_features.insert(
- std::move(*child.mutable_string_value()));
- }
- }
- }
- return GRPC_ERROR_CREATE_FROM_VECTOR(
- "errors parsing \"server_features\" array", &error_list);
-}
-
-grpc_error* XdsBootstrap::ParseNode(Json* json) {
- std::vector<grpc_error*> error_list;
- node_ = y_absl::make_unique<Node>();
- auto it = json->mutable_object()->find("id");
- if (it != json->mutable_object()->end()) {
- if (it->second.type() != Json::Type::STRING) {
- error_list.push_back(
- GRPC_ERROR_CREATE_FROM_STATIC_STRING("\"id\" field is not a string"));
- } else {
- node_->id = std::move(*it->second.mutable_string_value());
- }
- }
- it = json->mutable_object()->find("cluster");
- if (it != json->mutable_object()->end()) {
- if (it->second.type() != Json::Type::STRING) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "\"cluster\" field is not a string"));
- } else {
- node_->cluster = std::move(*it->second.mutable_string_value());
- }
- }
- it = json->mutable_object()->find("locality");
- if (it != json->mutable_object()->end()) {
- if (it->second.type() != Json::Type::OBJECT) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "\"locality\" field is not an object"));
- } else {
- grpc_error* parse_error = ParseLocality(&it->second);
- if (parse_error != GRPC_ERROR_NONE) error_list.push_back(parse_error);
- }
- }
- it = json->mutable_object()->find("metadata");
- if (it != json->mutable_object()->end()) {
- if (it->second.type() != Json::Type::OBJECT) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "\"metadata\" field is not an object"));
- } else {
- node_->metadata = std::move(it->second);
- }
- }
- return GRPC_ERROR_CREATE_FROM_VECTOR("errors parsing \"node\" object",
- &error_list);
-}
-
-grpc_error* XdsBootstrap::ParseLocality(Json* json) {
- std::vector<grpc_error*> error_list;
- auto it = json->mutable_object()->find("region");
- if (it != json->mutable_object()->end()) {
- if (it->second.type() != Json::Type::STRING) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "\"region\" field is not a string"));
- } else {
- node_->locality_region = std::move(*it->second.mutable_string_value());
- }
- }
- it = json->mutable_object()->find("zone");
- if (it != json->mutable_object()->end()) {
- if (it->second.type() != Json::Type::STRING) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "\"zone\" field is not a string"));
- } else {
- node_->locality_zone = std::move(*it->second.mutable_string_value());
- }
- }
- it = json->mutable_object()->find("subzone");
- if (it != json->mutable_object()->end()) {
- if (it->second.type() != Json::Type::STRING) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "\"subzone\" field is not a string"));
- } else {
- node_->locality_subzone = std::move(*it->second.mutable_string_value());
- }
- }
- return GRPC_ERROR_CREATE_FROM_VECTOR("errors parsing \"locality\" object",
- &error_list);
-}
-
-} // namespace grpc_core
+//
+// Copyright 2019 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/ext/xds/xds_bootstrap.h"
+
+#include <vector>
+
+#include <errno.h>
+#include <stdlib.h>
+
+#include "y_absl/strings/str_cat.h"
+#include "y_absl/strings/str_format.h"
+#include "y_absl/strings/str_join.h"
+#include "y_absl/strings/string_view.h"
+
+#include "src/core/lib/gpr/env.h"
+#include "src/core/lib/gpr/string.h"
+#include "src/core/lib/iomgr/load_file.h"
+#include "src/core/lib/slice/slice_internal.h"
+
+namespace grpc_core {
+
+bool XdsBootstrap::XdsServer::ShouldUseV3() const {
+ return server_features.find("xds_v3") != server_features.end();
+}
+
+namespace {
+
+TString BootstrapString(const XdsBootstrap& bootstrap) {
+ std::vector<TString> parts;
+ if (bootstrap.node() != nullptr) {
+ parts.push_back(y_absl::StrFormat(
+ "node={\n"
+ " id=\"%s\",\n"
+ " cluster=\"%s\",\n"
+ " locality={\n"
+ " region=\"%s\",\n"
+ " zone=\"%s\",\n"
+ " subzone=\"%s\"\n"
+ " },\n"
+ " metadata=%s,\n"
+ "},\n",
+ bootstrap.node()->id, bootstrap.node()->cluster,
+ bootstrap.node()->locality_region, bootstrap.node()->locality_zone,
+ bootstrap.node()->locality_subzone, bootstrap.node()->metadata.Dump()));
+ }
+ parts.push_back(
+ y_absl::StrFormat("servers=[\n"
+ " {\n"
+ " uri=\"%s\",\n"
+ " creds=[\n",
+ bootstrap.server().server_uri));
+ for (const auto& creds : bootstrap.server().channel_creds) {
+ parts.push_back(y_absl::StrFormat(" {type=\"%s\", config=%s},\n",
+ creds.type, creds.config.Dump()));
+ }
+ parts.push_back(" ],\n");
+ if (!bootstrap.server().server_features.empty()) {
+ parts.push_back(y_absl::StrCat(
+ " server_features=[",
+ y_absl::StrJoin(bootstrap.server().server_features, ", "), "],\n"));
+ }
+ parts.push_back(" }\n]");
+ return y_absl::StrJoin(parts, "");
+}
+
+} // namespace
+
+std::unique_ptr<XdsBootstrap> XdsBootstrap::ReadFromFile(XdsClient* client,
+ TraceFlag* tracer,
+ grpc_error** error) {
+ grpc_core::UniquePtr<char> path(gpr_getenv("GRPC_XDS_BOOTSTRAP"));
+ if (path == nullptr) {
+ *error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Environment variable GRPC_XDS_BOOTSTRAP not defined");
+ return nullptr;
+ }
+ if (GRPC_TRACE_FLAG_ENABLED(*tracer)) {
+ gpr_log(GPR_INFO,
+ "[xds_client %p] Got bootstrap file location from "
+ "GRPC_XDS_BOOTSTRAP environment variable: %s",
+ client, path.get());
+ }
+ grpc_slice contents;
+ *error = grpc_load_file(path.get(), /*add_null_terminator=*/true, &contents);
+ if (*error != GRPC_ERROR_NONE) return nullptr;
+ y_absl::string_view contents_str_view = StringViewFromSlice(contents);
+ if (GRPC_TRACE_FLAG_ENABLED(*tracer)) {
+ gpr_log(GPR_DEBUG, "[xds_client %p] Bootstrap file contents: %s", client,
+ TString(contents_str_view).c_str());
+ }
+ Json json = Json::Parse(contents_str_view, error);
+ grpc_slice_unref_internal(contents);
+ if (*error != GRPC_ERROR_NONE) {
+ grpc_error* error_out = GRPC_ERROR_CREATE_REFERENCING_FROM_COPIED_STRING(
+ y_absl::StrCat("Failed to parse bootstrap file ", path.get()).c_str(),
+ error, 1);
+ GRPC_ERROR_UNREF(*error);
+ *error = error_out;
+ return nullptr;
+ }
+ std::unique_ptr<XdsBootstrap> result =
+ y_absl::make_unique<XdsBootstrap>(std::move(json), error);
+ if (*error == GRPC_ERROR_NONE && GRPC_TRACE_FLAG_ENABLED(*tracer)) {
+ gpr_log(GPR_INFO,
+ "[xds_client %p] Bootstrap config for creating xds client:\n%s",
+ client, BootstrapString(*result).c_str());
+ }
+ return result;
+}
+
+XdsBootstrap::XdsBootstrap(Json json, grpc_error** error) {
+ if (json.type() != Json::Type::OBJECT) {
+ *error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "malformed JSON in bootstrap file");
+ return;
+ }
+ std::vector<grpc_error*> error_list;
+ auto it = json.mutable_object()->find("xds_servers");
+ if (it == json.mutable_object()->end()) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "\"xds_servers\" field not present"));
+ } else if (it->second.type() != Json::Type::ARRAY) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "\"xds_servers\" field is not an array"));
+ } else {
+ grpc_error* parse_error = ParseXdsServerList(&it->second);
+ if (parse_error != GRPC_ERROR_NONE) error_list.push_back(parse_error);
+ }
+ it = json.mutable_object()->find("node");
+ if (it != json.mutable_object()->end()) {
+ if (it->second.type() != Json::Type::OBJECT) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "\"node\" field is not an object"));
+ } else {
+ grpc_error* parse_error = ParseNode(&it->second);
+ if (parse_error != GRPC_ERROR_NONE) error_list.push_back(parse_error);
+ }
+ }
+ *error = GRPC_ERROR_CREATE_FROM_VECTOR("errors parsing xds bootstrap file",
+ &error_list);
+}
+
+grpc_error* XdsBootstrap::ParseXdsServerList(Json* json) {
+ std::vector<grpc_error*> error_list;
+ for (size_t i = 0; i < json->mutable_array()->size(); ++i) {
+ Json& child = json->mutable_array()->at(i);
+ if (child.type() != Json::Type::OBJECT) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrCat("array element ", i, " is not an object").c_str()));
+ } else {
+ grpc_error* parse_error = ParseXdsServer(&child, i);
+ if (parse_error != GRPC_ERROR_NONE) error_list.push_back(parse_error);
+ }
+ }
+ return GRPC_ERROR_CREATE_FROM_VECTOR("errors parsing \"xds_servers\" array",
+ &error_list);
+}
+
+grpc_error* XdsBootstrap::ParseXdsServer(Json* json, size_t idx) {
+ std::vector<grpc_error*> error_list;
+ servers_.emplace_back();
+ XdsServer& server = servers_[servers_.size() - 1];
+ auto it = json->mutable_object()->find("server_uri");
+ if (it == json->mutable_object()->end()) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "\"server_uri\" field not present"));
+ } else if (it->second.type() != Json::Type::STRING) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "\"server_uri\" field is not a string"));
+ } else {
+ server.server_uri = std::move(*it->second.mutable_string_value());
+ }
+ it = json->mutable_object()->find("channel_creds");
+ if (it != json->mutable_object()->end()) {
+ if (it->second.type() != Json::Type::ARRAY) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "\"channel_creds\" field is not an array"));
+ } else {
+ grpc_error* parse_error = ParseChannelCredsArray(&it->second, &server);
+ if (parse_error != GRPC_ERROR_NONE) error_list.push_back(parse_error);
+ }
+ }
+ it = json->mutable_object()->find("server_features");
+ if (it != json->mutable_object()->end()) {
+ if (it->second.type() != Json::Type::ARRAY) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "\"server_features\" field is not an array"));
+ } else {
+ grpc_error* parse_error = ParseServerFeaturesArray(&it->second, &server);
+ if (parse_error != GRPC_ERROR_NONE) error_list.push_back(parse_error);
+ }
+ }
+ // Can't use GRPC_ERROR_CREATE_FROM_VECTOR() here, because the error
+ // string is not static in this case.
+ if (error_list.empty()) return GRPC_ERROR_NONE;
+ grpc_error* error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrCat("errors parsing index ", idx).c_str());
+ for (size_t i = 0; i < error_list.size(); ++i) {
+ error = grpc_error_add_child(error, error_list[i]);
+ }
+ return error;
+}
+
+grpc_error* XdsBootstrap::ParseChannelCredsArray(Json* json,
+ XdsServer* server) {
+ std::vector<grpc_error*> error_list;
+ for (size_t i = 0; i < json->mutable_array()->size(); ++i) {
+ Json& child = json->mutable_array()->at(i);
+ if (child.type() != Json::Type::OBJECT) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrCat("array element ", i, " is not an object").c_str()));
+ } else {
+ grpc_error* parse_error = ParseChannelCreds(&child, i, server);
+ if (parse_error != GRPC_ERROR_NONE) error_list.push_back(parse_error);
+ }
+ }
+ return GRPC_ERROR_CREATE_FROM_VECTOR("errors parsing \"channel_creds\" array",
+ &error_list);
+}
+
+grpc_error* XdsBootstrap::ParseChannelCreds(Json* json, size_t idx,
+ XdsServer* server) {
+ std::vector<grpc_error*> error_list;
+ ChannelCreds channel_creds;
+ auto it = json->mutable_object()->find("type");
+ if (it == json->mutable_object()->end()) {
+ error_list.push_back(
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("\"type\" field not present"));
+ } else if (it->second.type() != Json::Type::STRING) {
+ error_list.push_back(
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("\"type\" field is not a string"));
+ } else {
+ channel_creds.type = std::move(*it->second.mutable_string_value());
+ }
+ it = json->mutable_object()->find("config");
+ if (it != json->mutable_object()->end()) {
+ if (it->second.type() != Json::Type::OBJECT) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "\"config\" field is not an object"));
+ } else {
+ channel_creds.config = std::move(it->second);
+ }
+ }
+ if (!channel_creds.type.empty()) {
+ server->channel_creds.emplace_back(std::move(channel_creds));
+ }
+ // Can't use GRPC_ERROR_CREATE_FROM_VECTOR() here, because the error
+ // string is not static in this case.
+ if (error_list.empty()) return GRPC_ERROR_NONE;
+ grpc_error* error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrCat("errors parsing index ", idx).c_str());
+ for (size_t i = 0; i < error_list.size(); ++i) {
+ error = grpc_error_add_child(error, error_list[i]);
+ }
+ return error;
+}
+
+grpc_error* XdsBootstrap::ParseServerFeaturesArray(Json* json,
+ XdsServer* server) {
+ std::vector<grpc_error*> error_list;
+ for (size_t i = 0; i < json->mutable_array()->size(); ++i) {
+ Json& child = json->mutable_array()->at(i);
+ if (child.type() == Json::Type::STRING &&
+ child.string_value() == "xds_v3") {
+ // TODO(roth): Remove env var check once we do interop testing and
+ // are sure that the v3 code actually works.
+ grpc_core::UniquePtr<char> enable_str(
+ gpr_getenv("GRPC_XDS_EXPERIMENTAL_V3_SUPPORT"));
+ bool enabled = false;
+ if (gpr_parse_bool_value(enable_str.get(), &enabled) && enabled) {
+ server->server_features.insert(
+ std::move(*child.mutable_string_value()));
+ }
+ }
+ }
+ return GRPC_ERROR_CREATE_FROM_VECTOR(
+ "errors parsing \"server_features\" array", &error_list);
+}
+
+grpc_error* XdsBootstrap::ParseNode(Json* json) {
+ std::vector<grpc_error*> error_list;
+ node_ = y_absl::make_unique<Node>();
+ auto it = json->mutable_object()->find("id");
+ if (it != json->mutable_object()->end()) {
+ if (it->second.type() != Json::Type::STRING) {
+ error_list.push_back(
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("\"id\" field is not a string"));
+ } else {
+ node_->id = std::move(*it->second.mutable_string_value());
+ }
+ }
+ it = json->mutable_object()->find("cluster");
+ if (it != json->mutable_object()->end()) {
+ if (it->second.type() != Json::Type::STRING) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "\"cluster\" field is not a string"));
+ } else {
+ node_->cluster = std::move(*it->second.mutable_string_value());
+ }
+ }
+ it = json->mutable_object()->find("locality");
+ if (it != json->mutable_object()->end()) {
+ if (it->second.type() != Json::Type::OBJECT) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "\"locality\" field is not an object"));
+ } else {
+ grpc_error* parse_error = ParseLocality(&it->second);
+ if (parse_error != GRPC_ERROR_NONE) error_list.push_back(parse_error);
+ }
+ }
+ it = json->mutable_object()->find("metadata");
+ if (it != json->mutable_object()->end()) {
+ if (it->second.type() != Json::Type::OBJECT) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "\"metadata\" field is not an object"));
+ } else {
+ node_->metadata = std::move(it->second);
+ }
+ }
+ return GRPC_ERROR_CREATE_FROM_VECTOR("errors parsing \"node\" object",
+ &error_list);
+}
+
+grpc_error* XdsBootstrap::ParseLocality(Json* json) {
+ std::vector<grpc_error*> error_list;
+ auto it = json->mutable_object()->find("region");
+ if (it != json->mutable_object()->end()) {
+ if (it->second.type() != Json::Type::STRING) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "\"region\" field is not a string"));
+ } else {
+ node_->locality_region = std::move(*it->second.mutable_string_value());
+ }
+ }
+ it = json->mutable_object()->find("zone");
+ if (it != json->mutable_object()->end()) {
+ if (it->second.type() != Json::Type::STRING) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "\"zone\" field is not a string"));
+ } else {
+ node_->locality_zone = std::move(*it->second.mutable_string_value());
+ }
+ }
+ it = json->mutable_object()->find("subzone");
+ if (it != json->mutable_object()->end()) {
+ if (it->second.type() != Json::Type::STRING) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "\"subzone\" field is not a string"));
+ } else {
+ node_->locality_subzone = std::move(*it->second.mutable_string_value());
+ }
+ }
+ return GRPC_ERROR_CREATE_FROM_VECTOR("errors parsing \"locality\" object",
+ &error_list);
+}
+
+} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/ext/xds/xds_bootstrap.h b/contrib/libs/grpc/src/core/ext/xds/xds_bootstrap.h
index 9d77f933856..e5d55dfc94e 100644
--- a/contrib/libs/grpc/src/core/ext/xds/xds_bootstrap.h
+++ b/contrib/libs/grpc/src/core/ext/xds/xds_bootstrap.h
@@ -1,93 +1,93 @@
-//
-// Copyright 2019 gRPC authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-#ifndef GRPC_CORE_EXT_XDS_XDS_BOOTSTRAP_H
-#define GRPC_CORE_EXT_XDS_XDS_BOOTSTRAP_H
-
-#include <grpc/support/port_platform.h>
-
-#include <memory>
-#include <set>
-#include <util/generic/string.h>
-#include <vector>
-
-#include "y_absl/container/inlined_vector.h"
-
-#include <grpc/impl/codegen/slice.h>
-
-#include "src/core/lib/gprpp/map.h"
-#include "src/core/lib/gprpp/memory.h"
-#include "src/core/lib/iomgr/error.h"
-#include "src/core/lib/json/json.h"
-
-namespace grpc_core {
-
-class XdsClient;
-
-class XdsBootstrap {
- public:
- struct Node {
- TString id;
- TString cluster;
- TString locality_region;
- TString locality_zone;
- TString locality_subzone;
- Json metadata;
- };
-
- struct ChannelCreds {
- TString type;
- Json config;
- };
-
- struct XdsServer {
- TString server_uri;
- y_absl::InlinedVector<ChannelCreds, 1> channel_creds;
- std::set<TString> server_features;
-
- bool ShouldUseV3() const;
- };
-
- // If *error is not GRPC_ERROR_NONE after returning, then there was an
- // error reading the file.
- static std::unique_ptr<XdsBootstrap> ReadFromFile(XdsClient* client,
- TraceFlag* tracer,
- grpc_error** error);
-
- // Do not instantiate directly -- use ReadFromFile() above instead.
- XdsBootstrap(Json json, grpc_error** error);
-
- // TODO(roth): We currently support only one server. Fix this when we
- // add support for fallback for the xds channel.
- const XdsServer& server() const { return servers_[0]; }
- const Node* node() const { return node_.get(); }
-
- private:
- grpc_error* ParseXdsServerList(Json* json);
- grpc_error* ParseXdsServer(Json* json, size_t idx);
- grpc_error* ParseChannelCredsArray(Json* json, XdsServer* server);
- grpc_error* ParseChannelCreds(Json* json, size_t idx, XdsServer* server);
- grpc_error* ParseServerFeaturesArray(Json* json, XdsServer* server);
- grpc_error* ParseNode(Json* json);
- grpc_error* ParseLocality(Json* json);
-
- y_absl::InlinedVector<XdsServer, 1> servers_;
- std::unique_ptr<Node> node_;
-};
-
-} // namespace grpc_core
-
-#endif /* GRPC_CORE_EXT_XDS_XDS_BOOTSTRAP_H */
+//
+// Copyright 2019 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+#ifndef GRPC_CORE_EXT_XDS_XDS_BOOTSTRAP_H
+#define GRPC_CORE_EXT_XDS_XDS_BOOTSTRAP_H
+
+#include <grpc/support/port_platform.h>
+
+#include <memory>
+#include <set>
+#include <util/generic/string.h>
+#include <vector>
+
+#include "y_absl/container/inlined_vector.h"
+
+#include <grpc/impl/codegen/slice.h>
+
+#include "src/core/lib/gprpp/map.h"
+#include "src/core/lib/gprpp/memory.h"
+#include "src/core/lib/iomgr/error.h"
+#include "src/core/lib/json/json.h"
+
+namespace grpc_core {
+
+class XdsClient;
+
+class XdsBootstrap {
+ public:
+ struct Node {
+ TString id;
+ TString cluster;
+ TString locality_region;
+ TString locality_zone;
+ TString locality_subzone;
+ Json metadata;
+ };
+
+ struct ChannelCreds {
+ TString type;
+ Json config;
+ };
+
+ struct XdsServer {
+ TString server_uri;
+ y_absl::InlinedVector<ChannelCreds, 1> channel_creds;
+ std::set<TString> server_features;
+
+ bool ShouldUseV3() const;
+ };
+
+ // If *error is not GRPC_ERROR_NONE after returning, then there was an
+ // error reading the file.
+ static std::unique_ptr<XdsBootstrap> ReadFromFile(XdsClient* client,
+ TraceFlag* tracer,
+ grpc_error** error);
+
+ // Do not instantiate directly -- use ReadFromFile() above instead.
+ XdsBootstrap(Json json, grpc_error** error);
+
+ // TODO(roth): We currently support only one server. Fix this when we
+ // add support for fallback for the xds channel.
+ const XdsServer& server() const { return servers_[0]; }
+ const Node* node() const { return node_.get(); }
+
+ private:
+ grpc_error* ParseXdsServerList(Json* json);
+ grpc_error* ParseXdsServer(Json* json, size_t idx);
+ grpc_error* ParseChannelCredsArray(Json* json, XdsServer* server);
+ grpc_error* ParseChannelCreds(Json* json, size_t idx, XdsServer* server);
+ grpc_error* ParseServerFeaturesArray(Json* json, XdsServer* server);
+ grpc_error* ParseNode(Json* json);
+ grpc_error* ParseLocality(Json* json);
+
+ y_absl::InlinedVector<XdsServer, 1> servers_;
+ std::unique_ptr<Node> node_;
+};
+
+} // namespace grpc_core
+
+#endif /* GRPC_CORE_EXT_XDS_XDS_BOOTSTRAP_H */
diff --git a/contrib/libs/grpc/src/core/ext/xds/xds_channel_args.h b/contrib/libs/grpc/src/core/ext/xds/xds_channel_args.h
index 5b2e20892ce..a258940361d 100644
--- a/contrib/libs/grpc/src/core/ext/xds/xds_channel_args.h
+++ b/contrib/libs/grpc/src/core/ext/xds/xds_channel_args.h
@@ -1,29 +1,29 @@
-//
-// Copyright 2019 gRPC authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-#ifndef GRPC_CORE_EXT_XDS_XDS_CHANNEL_ARGS_H
-#define GRPC_CORE_EXT_XDS_XDS_CHANNEL_ARGS_H
-
-// Pointer channel arg containing a ref to the XdsClient object.
-#define GRPC_ARG_XDS_CLIENT "grpc.xds_client"
-
-// Timeout in milliseconds to wait for a resource to be returned from
-// the xds server before assuming that it does not exist.
-// The default is 15 seconds.
-#define GRPC_ARG_XDS_RESOURCE_DOES_NOT_EXIST_TIMEOUT_MS \
- "grpc.xds_resource_does_not_exist_timeout_ms"
-
-#endif /* GRPC_CORE_EXT_XDS_XDS_CHANNEL_ARGS_H */
+//
+// Copyright 2019 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+#ifndef GRPC_CORE_EXT_XDS_XDS_CHANNEL_ARGS_H
+#define GRPC_CORE_EXT_XDS_XDS_CHANNEL_ARGS_H
+
+// Pointer channel arg containing a ref to the XdsClient object.
+#define GRPC_ARG_XDS_CLIENT "grpc.xds_client"
+
+// Timeout in milliseconds to wait for a resource to be returned from
+// the xds server before assuming that it does not exist.
+// The default is 15 seconds.
+#define GRPC_ARG_XDS_RESOURCE_DOES_NOT_EXIST_TIMEOUT_MS \
+ "grpc.xds_resource_does_not_exist_timeout_ms"
+
+#endif /* GRPC_CORE_EXT_XDS_XDS_CHANNEL_ARGS_H */
diff --git a/contrib/libs/grpc/src/core/ext/xds/xds_client.cc b/contrib/libs/grpc/src/core/ext/xds/xds_client.cc
index 11bec45bfe5..76eb4d7f009 100644
--- a/contrib/libs/grpc/src/core/ext/xds/xds_client.cc
+++ b/contrib/libs/grpc/src/core/ext/xds/xds_client.cc
@@ -1,2202 +1,2202 @@
-/*
- *
- * Copyright 2018 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <grpc/support/port_platform.h>
-
-#include <inttypes.h>
-#include <limits.h>
-#include <string.h>
-
-#include "y_absl/container/inlined_vector.h"
-#include "y_absl/strings/str_format.h"
-#include "y_absl/strings/str_join.h"
-#include "y_absl/strings/string_view.h"
-
-#include <grpc/byte_buffer_reader.h>
-#include <grpc/grpc.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/time.h>
-
-#include "src/core/ext/filters/client_channel/client_channel.h"
-#include "src/core/ext/filters/client_channel/service_config.h"
-#include "src/core/ext/xds/xds_api.h"
-#include "src/core/ext/xds/xds_channel_args.h"
-#include "src/core/ext/xds/xds_client.h"
-#include "src/core/ext/xds/xds_client_stats.h"
-#include "src/core/lib/backoff/backoff.h"
-#include "src/core/lib/channel/channel_args.h"
-#include "src/core/lib/channel/channel_stack.h"
-#include "src/core/lib/gpr/string.h"
-#include "src/core/lib/gprpp/map.h"
-#include "src/core/lib/gprpp/memory.h"
-#include "src/core/lib/gprpp/orphanable.h"
-#include "src/core/lib/gprpp/ref_counted_ptr.h"
-#include "src/core/lib/gprpp/sync.h"
-#include "src/core/lib/iomgr/sockaddr.h"
-#include "src/core/lib/iomgr/sockaddr_utils.h"
-#include "src/core/lib/iomgr/timer.h"
-#include "src/core/lib/security/credentials/credentials.h"
-#include "src/core/lib/security/credentials/fake/fake_credentials.h"
-#include "src/core/lib/slice/slice_internal.h"
-#include "src/core/lib/slice/slice_string_helpers.h"
-#include "src/core/lib/surface/call.h"
-#include "src/core/lib/surface/channel.h"
-#include "src/core/lib/surface/channel_init.h"
-#include "src/core/lib/transport/static_metadata.h"
-
-#define GRPC_XDS_INITIAL_CONNECT_BACKOFF_SECONDS 1
-#define GRPC_XDS_RECONNECT_BACKOFF_MULTIPLIER 1.6
-#define GRPC_XDS_RECONNECT_MAX_BACKOFF_SECONDS 120
-#define GRPC_XDS_RECONNECT_JITTER 0.2
-#define GRPC_XDS_MIN_CLIENT_LOAD_REPORTING_INTERVAL_MS 1000
-
-namespace grpc_core {
-
-TraceFlag grpc_xds_client_trace(false, "xds_client");
-
-namespace {
-
-Mutex* g_mu = nullptr;
-const grpc_channel_args* g_channel_args = nullptr;
-XdsClient* g_xds_client = nullptr;
-
-} // namespace
-
-//
-// Internal class declarations
-//
-
-// An xds call wrapper that can restart a call upon failure. Holds a ref to
-// the xds channel. The template parameter is the kind of wrapped xds call.
-template <typename T>
-class XdsClient::ChannelState::RetryableCall
- : public InternallyRefCounted<RetryableCall<T>> {
- public:
- explicit RetryableCall(RefCountedPtr<ChannelState> chand);
-
- void Orphan() override;
-
- void OnCallFinishedLocked();
-
- T* calld() const { return calld_.get(); }
- ChannelState* chand() const { return chand_.get(); }
-
- bool IsCurrentCallOnChannel() const;
-
- private:
- void StartNewCallLocked();
- void StartRetryTimerLocked();
- static void OnRetryTimer(void* arg, grpc_error* error);
- void OnRetryTimerLocked(grpc_error* error);
-
- // The wrapped xds call that talks to the xds server. It's instantiated
- // every time we start a new call. It's null during call retry backoff.
- OrphanablePtr<T> calld_;
- // The owning xds channel.
- RefCountedPtr<ChannelState> chand_;
-
- // Retry state.
- BackOff backoff_;
- grpc_timer retry_timer_;
- grpc_closure on_retry_timer_;
- bool retry_timer_callback_pending_ = false;
-
- bool shutting_down_ = false;
-};
-
-// Contains an ADS call to the xds server.
-class XdsClient::ChannelState::AdsCallState
- : public InternallyRefCounted<AdsCallState> {
- public:
- // The ctor and dtor should not be used directly.
- explicit AdsCallState(RefCountedPtr<RetryableCall<AdsCallState>> parent);
- ~AdsCallState() override;
-
- void Orphan() override;
-
- RetryableCall<AdsCallState>* parent() const { return parent_.get(); }
- ChannelState* chand() const { return parent_->chand(); }
- XdsClient* xds_client() const { return chand()->xds_client(); }
- bool seen_response() const { return seen_response_; }
-
- void Subscribe(const TString& type_url, const TString& name);
- void Unsubscribe(const TString& type_url, const TString& name,
- bool delay_unsubscription);
-
- bool HasSubscribedResources() const;
-
- private:
- class ResourceState : public InternallyRefCounted<ResourceState> {
- public:
- ResourceState(const TString& type_url, const TString& name)
- : type_url_(type_url), name_(name) {
- GRPC_CLOSURE_INIT(&timer_callback_, OnTimer, this,
- grpc_schedule_on_exec_ctx);
- }
-
- void Orphan() override {
- Finish();
- Unref(DEBUG_LOCATION, "Orphan");
- }
-
- void Start(RefCountedPtr<AdsCallState> ads_calld) {
- if (sent_) return;
- sent_ = true;
- ads_calld_ = std::move(ads_calld);
- Ref(DEBUG_LOCATION, "timer").release();
- timer_pending_ = true;
- grpc_timer_init(
- &timer_,
- ExecCtx::Get()->Now() + ads_calld_->xds_client()->request_timeout_,
- &timer_callback_);
- }
-
- void Finish() {
- if (timer_pending_) {
- grpc_timer_cancel(&timer_);
- timer_pending_ = false;
- }
- }
-
- private:
- static void OnTimer(void* arg, grpc_error* error) {
- ResourceState* self = static_cast<ResourceState*>(arg);
- {
- MutexLock lock(&self->ads_calld_->xds_client()->mu_);
- self->OnTimerLocked(GRPC_ERROR_REF(error));
- }
- self->ads_calld_.reset();
- self->Unref(DEBUG_LOCATION, "timer");
- }
-
- void OnTimerLocked(grpc_error* error) {
- if (error == GRPC_ERROR_NONE && timer_pending_) {
- timer_pending_ = false;
- grpc_error* watcher_error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrFormat(
- "timeout obtaining resource {type=%s name=%s} from xds server",
- type_url_, name_)
- .c_str());
- if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
- gpr_log(GPR_INFO, "[xds_client %p] %s", ads_calld_->xds_client(),
- grpc_error_string(watcher_error));
- }
- if (type_url_ == XdsApi::kLdsTypeUrl) {
- ListenerState& state = ads_calld_->xds_client()->listener_map_[name_];
- for (const auto& p : state.watchers) {
- p.first->OnError(GRPC_ERROR_REF(watcher_error));
- }
- } else if (type_url_ == XdsApi::kRdsTypeUrl) {
- RouteConfigState& state =
- ads_calld_->xds_client()->route_config_map_[name_];
- for (const auto& p : state.watchers) {
- p.first->OnError(GRPC_ERROR_REF(watcher_error));
- }
- } else if (type_url_ == XdsApi::kCdsTypeUrl) {
- ClusterState& state = ads_calld_->xds_client()->cluster_map_[name_];
- for (const auto& p : state.watchers) {
- p.first->OnError(GRPC_ERROR_REF(watcher_error));
- }
- } else if (type_url_ == XdsApi::kEdsTypeUrl) {
- EndpointState& state = ads_calld_->xds_client()->endpoint_map_[name_];
- for (const auto& p : state.watchers) {
- p.first->OnError(GRPC_ERROR_REF(watcher_error));
- }
- } else {
- GPR_UNREACHABLE_CODE(return );
- }
- GRPC_ERROR_UNREF(watcher_error);
- }
- GRPC_ERROR_UNREF(error);
- }
-
- const TString type_url_;
- const TString name_;
-
- RefCountedPtr<AdsCallState> ads_calld_;
- bool sent_ = false;
- bool timer_pending_ = false;
- grpc_timer timer_;
- grpc_closure timer_callback_;
- };
-
- struct ResourceTypeState {
- ~ResourceTypeState() { GRPC_ERROR_UNREF(error); }
-
- // Version, nonce, and error for this resource type.
- TString version;
- TString nonce;
- grpc_error* error = GRPC_ERROR_NONE;
-
- // Subscribed resources of this type.
- std::map<TString /* name */, OrphanablePtr<ResourceState>>
- subscribed_resources;
- };
-
- void SendMessageLocked(const TString& type_url);
-
- void AcceptLdsUpdate(XdsApi::LdsUpdateMap lds_update_map);
- void AcceptRdsUpdate(XdsApi::RdsUpdateMap rds_update_map);
- void AcceptCdsUpdate(XdsApi::CdsUpdateMap cds_update_map);
- void AcceptEdsUpdate(XdsApi::EdsUpdateMap eds_update_map);
-
- static void OnRequestSent(void* arg, grpc_error* error);
- void OnRequestSentLocked(grpc_error* error);
- static void OnResponseReceived(void* arg, grpc_error* error);
- bool OnResponseReceivedLocked();
- static void OnStatusReceived(void* arg, grpc_error* error);
- void OnStatusReceivedLocked(grpc_error* error);
-
- bool IsCurrentCallOnChannel() const;
-
- std::set<y_absl::string_view> ResourceNamesForRequest(
- const TString& type_url);
-
- // The owning RetryableCall<>.
- RefCountedPtr<RetryableCall<AdsCallState>> parent_;
-
- bool sent_initial_message_ = false;
- bool seen_response_ = false;
-
- // Always non-NULL.
- grpc_call* call_;
-
- // recv_initial_metadata
- grpc_metadata_array initial_metadata_recv_;
-
- // send_message
- grpc_byte_buffer* send_message_payload_ = nullptr;
- grpc_closure on_request_sent_;
-
- // recv_message
- grpc_byte_buffer* recv_message_payload_ = nullptr;
- grpc_closure on_response_received_;
-
- // recv_trailing_metadata
- grpc_metadata_array trailing_metadata_recv_;
- grpc_status_code status_code_;
- grpc_slice status_details_;
- grpc_closure on_status_received_;
-
- // Resource types for which requests need to be sent.
- std::set<TString /*type_url*/> buffered_requests_;
-
- // State for each resource type.
- std::map<TString /*type_url*/, ResourceTypeState> state_map_;
-};
-
-// Contains an LRS call to the xds server.
-class XdsClient::ChannelState::LrsCallState
- : public InternallyRefCounted<LrsCallState> {
- public:
- // The ctor and dtor should not be used directly.
- explicit LrsCallState(RefCountedPtr<RetryableCall<LrsCallState>> parent);
- ~LrsCallState() override;
-
- void Orphan() override;
-
- void MaybeStartReportingLocked();
-
- RetryableCall<LrsCallState>* parent() { return parent_.get(); }
- ChannelState* chand() const { return parent_->chand(); }
- XdsClient* xds_client() const { return chand()->xds_client(); }
- bool seen_response() const { return seen_response_; }
-
- private:
- // Reports client-side load stats according to a fixed interval.
- class Reporter : public InternallyRefCounted<Reporter> {
- public:
- Reporter(RefCountedPtr<LrsCallState> parent, grpc_millis report_interval)
- : parent_(std::move(parent)), report_interval_(report_interval) {
- GRPC_CLOSURE_INIT(&on_next_report_timer_, OnNextReportTimer, this,
- grpc_schedule_on_exec_ctx);
- GRPC_CLOSURE_INIT(&on_report_done_, OnReportDone, this,
- grpc_schedule_on_exec_ctx);
- ScheduleNextReportLocked();
- }
-
- void Orphan() override;
-
- private:
- void ScheduleNextReportLocked();
- static void OnNextReportTimer(void* arg, grpc_error* error);
- bool OnNextReportTimerLocked(grpc_error* error);
- void SendReportLocked();
- static void OnReportDone(void* arg, grpc_error* error);
- bool OnReportDoneLocked(grpc_error* error);
-
- bool IsCurrentReporterOnCall() const {
- return this == parent_->reporter_.get();
- }
- XdsClient* xds_client() const { return parent_->xds_client(); }
-
- // The owning LRS call.
- RefCountedPtr<LrsCallState> parent_;
-
- // The load reporting state.
- const grpc_millis report_interval_;
- bool last_report_counters_were_zero_ = false;
- bool next_report_timer_callback_pending_ = false;
- grpc_timer next_report_timer_;
- grpc_closure on_next_report_timer_;
- grpc_closure on_report_done_;
- };
-
- static void OnInitialRequestSent(void* arg, grpc_error* error);
- void OnInitialRequestSentLocked();
- static void OnResponseReceived(void* arg, grpc_error* error);
- bool OnResponseReceivedLocked();
- static void OnStatusReceived(void* arg, grpc_error* error);
- void OnStatusReceivedLocked(grpc_error* error);
-
- bool IsCurrentCallOnChannel() const;
-
- // The owning RetryableCall<>.
- RefCountedPtr<RetryableCall<LrsCallState>> parent_;
- bool seen_response_ = false;
-
- // Always non-NULL.
- grpc_call* call_;
-
- // recv_initial_metadata
- grpc_metadata_array initial_metadata_recv_;
-
- // send_message
- grpc_byte_buffer* send_message_payload_ = nullptr;
- grpc_closure on_initial_request_sent_;
-
- // recv_message
- grpc_byte_buffer* recv_message_payload_ = nullptr;
- grpc_closure on_response_received_;
-
- // recv_trailing_metadata
- grpc_metadata_array trailing_metadata_recv_;
- grpc_status_code status_code_;
- grpc_slice status_details_;
- grpc_closure on_status_received_;
-
- // Load reporting state.
- bool send_all_clusters_ = false;
- std::set<TString> cluster_names_; // Asked for by the LRS server.
- grpc_millis load_reporting_interval_ = 0;
- OrphanablePtr<Reporter> reporter_;
-};
-
-//
-// XdsClient::ChannelState::StateWatcher
-//
-
-class XdsClient::ChannelState::StateWatcher
- : public AsyncConnectivityStateWatcherInterface {
- public:
- explicit StateWatcher(RefCountedPtr<ChannelState> parent)
- : parent_(std::move(parent)) {}
-
- private:
- void OnConnectivityStateChange(grpc_connectivity_state new_state,
- const y_absl::Status& status) override {
- MutexLock lock(&parent_->xds_client_->mu_);
- if (!parent_->shutting_down_ &&
- new_state == GRPC_CHANNEL_TRANSIENT_FAILURE) {
- // In TRANSIENT_FAILURE. Notify all watchers of error.
- gpr_log(GPR_INFO,
- "[xds_client %p] xds channel in state:TRANSIENT_FAILURE "
- "status_message:(%s)",
- parent_->xds_client(), status.ToString().c_str());
- parent_->xds_client()->NotifyOnErrorLocked(
- GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "xds channel in TRANSIENT_FAILURE"));
- }
- }
-
- RefCountedPtr<ChannelState> parent_;
-};
-
-//
-// XdsClient::ChannelState
-//
-
-XdsClient::ChannelState::ChannelState(WeakRefCountedPtr<XdsClient> xds_client,
- grpc_channel* channel)
- : InternallyRefCounted<ChannelState>(&grpc_xds_client_trace),
- xds_client_(std::move(xds_client)),
- channel_(channel) {
- GPR_ASSERT(channel_ != nullptr);
- StartConnectivityWatchLocked();
-}
-
-XdsClient::ChannelState::~ChannelState() {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
- gpr_log(GPR_INFO, "[xds_client %p] Destroying xds channel %p", xds_client(),
- this);
- }
- grpc_channel_destroy(channel_);
- xds_client_.reset(DEBUG_LOCATION, "ChannelState");
-}
-
-void XdsClient::ChannelState::Orphan() {
- shutting_down_ = true;
- CancelConnectivityWatchLocked();
- ads_calld_.reset();
- lrs_calld_.reset();
- Unref(DEBUG_LOCATION, "ChannelState+orphaned");
-}
-
-XdsClient::ChannelState::AdsCallState* XdsClient::ChannelState::ads_calld()
- const {
- return ads_calld_->calld();
-}
-
-XdsClient::ChannelState::LrsCallState* XdsClient::ChannelState::lrs_calld()
- const {
- return lrs_calld_->calld();
-}
-
-bool XdsClient::ChannelState::HasActiveAdsCall() const {
- return ads_calld_->calld() != nullptr;
-}
-
-void XdsClient::ChannelState::MaybeStartLrsCall() {
- if (lrs_calld_ != nullptr) return;
- lrs_calld_.reset(
- new RetryableCall<LrsCallState>(Ref(DEBUG_LOCATION, "ChannelState+lrs")));
-}
-
-void XdsClient::ChannelState::StopLrsCall() { lrs_calld_.reset(); }
-
-void XdsClient::ChannelState::StartConnectivityWatchLocked() {
- grpc_channel_element* client_channel_elem =
- grpc_channel_stack_last_element(grpc_channel_get_channel_stack(channel_));
- GPR_ASSERT(client_channel_elem->filter == &grpc_client_channel_filter);
- watcher_ = new StateWatcher(Ref(DEBUG_LOCATION, "ChannelState+watch"));
- grpc_client_channel_start_connectivity_watch(
- client_channel_elem, GRPC_CHANNEL_IDLE,
- OrphanablePtr<AsyncConnectivityStateWatcherInterface>(watcher_));
-}
-
-void XdsClient::ChannelState::CancelConnectivityWatchLocked() {
- grpc_channel_element* client_channel_elem =
- grpc_channel_stack_last_element(grpc_channel_get_channel_stack(channel_));
- GPR_ASSERT(client_channel_elem->filter == &grpc_client_channel_filter);
- grpc_client_channel_stop_connectivity_watch(client_channel_elem, watcher_);
-}
-
-void XdsClient::ChannelState::Subscribe(const TString& type_url,
- const TString& name) {
- if (ads_calld_ == nullptr) {
- // Start the ADS call if this is the first request.
- ads_calld_.reset(new RetryableCall<AdsCallState>(
- Ref(DEBUG_LOCATION, "ChannelState+ads")));
- // Note: AdsCallState's ctor will automatically subscribe to all
- // resources that the XdsClient already has watchers for, so we can
- // return here.
- return;
- }
- // If the ADS call is in backoff state, we don't need to do anything now
- // because when the call is restarted it will resend all necessary requests.
- if (ads_calld() == nullptr) return;
- // Subscribe to this resource if the ADS call is active.
- ads_calld()->Subscribe(type_url, name);
-}
-
-void XdsClient::ChannelState::Unsubscribe(const TString& type_url,
- const TString& name,
- bool delay_unsubscription) {
- if (ads_calld_ != nullptr) {
- auto* calld = ads_calld_->calld();
- if (calld != nullptr) {
- calld->Unsubscribe(type_url, name, delay_unsubscription);
- if (!calld->HasSubscribedResources()) ads_calld_.reset();
- }
- }
-}
-
-//
-// XdsClient::ChannelState::RetryableCall<>
-//
-
-template <typename T>
-XdsClient::ChannelState::RetryableCall<T>::RetryableCall(
- RefCountedPtr<ChannelState> chand)
- : chand_(std::move(chand)),
- backoff_(
- BackOff::Options()
- .set_initial_backoff(GRPC_XDS_INITIAL_CONNECT_BACKOFF_SECONDS *
- 1000)
- .set_multiplier(GRPC_XDS_RECONNECT_BACKOFF_MULTIPLIER)
- .set_jitter(GRPC_XDS_RECONNECT_JITTER)
- .set_max_backoff(GRPC_XDS_RECONNECT_MAX_BACKOFF_SECONDS * 1000)) {
- // Closure Initialization
- GRPC_CLOSURE_INIT(&on_retry_timer_, OnRetryTimer, this,
- grpc_schedule_on_exec_ctx);
- StartNewCallLocked();
-}
-
-template <typename T>
-void XdsClient::ChannelState::RetryableCall<T>::Orphan() {
- shutting_down_ = true;
- calld_.reset();
- if (retry_timer_callback_pending_) grpc_timer_cancel(&retry_timer_);
- this->Unref(DEBUG_LOCATION, "RetryableCall+orphaned");
-}
-
-template <typename T>
-void XdsClient::ChannelState::RetryableCall<T>::OnCallFinishedLocked() {
- const bool seen_response = calld_->seen_response();
- calld_.reset();
- if (seen_response) {
- // If we lost connection to the xds server, reset backoff and restart the
- // call immediately.
- backoff_.Reset();
- StartNewCallLocked();
- } else {
- // If we failed to connect to the xds server, retry later.
- StartRetryTimerLocked();
- }
-}
-
-template <typename T>
-void XdsClient::ChannelState::RetryableCall<T>::StartNewCallLocked() {
- if (shutting_down_) return;
- GPR_ASSERT(chand_->channel_ != nullptr);
- GPR_ASSERT(calld_ == nullptr);
- if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
- gpr_log(GPR_INFO,
- "[xds_client %p] Start new call from retryable call (chand: %p, "
- "retryable call: %p)",
- chand()->xds_client(), chand(), this);
- }
- calld_ = MakeOrphanable<T>(
- this->Ref(DEBUG_LOCATION, "RetryableCall+start_new_call"));
-}
-
-template <typename T>
-void XdsClient::ChannelState::RetryableCall<T>::StartRetryTimerLocked() {
- if (shutting_down_) return;
- const grpc_millis next_attempt_time = backoff_.NextAttemptTime();
- if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
- grpc_millis timeout = GPR_MAX(next_attempt_time - ExecCtx::Get()->Now(), 0);
- gpr_log(GPR_INFO,
- "[xds_client %p] Failed to connect to xds server (chand: %p) "
- "retry timer will fire in %" PRId64 "ms.",
- chand()->xds_client(), chand(), timeout);
- }
- this->Ref(DEBUG_LOCATION, "RetryableCall+retry_timer_start").release();
- grpc_timer_init(&retry_timer_, next_attempt_time, &on_retry_timer_);
- retry_timer_callback_pending_ = true;
-}
-
-template <typename T>
-void XdsClient::ChannelState::RetryableCall<T>::OnRetryTimer(
- void* arg, grpc_error* error) {
- RetryableCall* calld = static_cast<RetryableCall*>(arg);
- {
- MutexLock lock(&calld->chand_->xds_client()->mu_);
- calld->OnRetryTimerLocked(GRPC_ERROR_REF(error));
- }
- calld->Unref(DEBUG_LOCATION, "RetryableCall+retry_timer_done");
-}
-
-template <typename T>
-void XdsClient::ChannelState::RetryableCall<T>::OnRetryTimerLocked(
- grpc_error* error) {
- retry_timer_callback_pending_ = false;
- if (!shutting_down_ && error == GRPC_ERROR_NONE) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
- gpr_log(
- GPR_INFO,
- "[xds_client %p] Retry timer fires (chand: %p, retryable call: %p)",
- chand()->xds_client(), chand(), this);
- }
- StartNewCallLocked();
- }
- GRPC_ERROR_UNREF(error);
-}
-
-//
-// XdsClient::ChannelState::AdsCallState
-//
-
-XdsClient::ChannelState::AdsCallState::AdsCallState(
- RefCountedPtr<RetryableCall<AdsCallState>> parent)
- : InternallyRefCounted<AdsCallState>(&grpc_xds_client_trace),
- parent_(std::move(parent)) {
- // Init the ADS call. Note that the call will progress every time there's
- // activity in xds_client()->interested_parties_, which is comprised of
- // the polling entities from client_channel.
- GPR_ASSERT(xds_client() != nullptr);
- // Create a call with the specified method name.
- const auto& method =
- xds_client()->bootstrap_->server().ShouldUseV3()
- ? GRPC_MDSTR_SLASH_ENVOY_DOT_SERVICE_DOT_DISCOVERY_DOT_V3_DOT_AGGREGATEDDISCOVERYSERVICE_SLASH_STREAMAGGREGATEDRESOURCES
- : GRPC_MDSTR_SLASH_ENVOY_DOT_SERVICE_DOT_DISCOVERY_DOT_V2_DOT_AGGREGATEDDISCOVERYSERVICE_SLASH_STREAMAGGREGATEDRESOURCES;
- call_ = grpc_channel_create_pollset_set_call(
- chand()->channel_, nullptr, GRPC_PROPAGATE_DEFAULTS,
- xds_client()->interested_parties_, method, nullptr,
- GRPC_MILLIS_INF_FUTURE, nullptr);
- GPR_ASSERT(call_ != nullptr);
- // Init data associated with the call.
- grpc_metadata_array_init(&initial_metadata_recv_);
- grpc_metadata_array_init(&trailing_metadata_recv_);
- // Start the call.
- if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
- gpr_log(GPR_INFO,
- "[xds_client %p] Starting ADS call (chand: %p, calld: %p, "
- "call: %p)",
- xds_client(), chand(), this, call_);
- }
- // Create the ops.
- grpc_call_error call_error;
- grpc_op ops[3];
- memset(ops, 0, sizeof(ops));
- // Op: send initial metadata.
- grpc_op* op = ops;
- op->op = GRPC_OP_SEND_INITIAL_METADATA;
- op->data.send_initial_metadata.count = 0;
- op->flags = GRPC_INITIAL_METADATA_WAIT_FOR_READY |
- GRPC_INITIAL_METADATA_WAIT_FOR_READY_EXPLICITLY_SET;
- op->reserved = nullptr;
- op++;
- call_error = grpc_call_start_batch_and_execute(call_, ops, (size_t)(op - ops),
- nullptr);
- GPR_ASSERT(GRPC_CALL_OK == call_error);
- // Op: send request message.
- GRPC_CLOSURE_INIT(&on_request_sent_, OnRequestSent, this,
- grpc_schedule_on_exec_ctx);
- for (const auto& p : xds_client()->listener_map_) {
- Subscribe(XdsApi::kLdsTypeUrl, TString(p.first));
- }
- for (const auto& p : xds_client()->route_config_map_) {
- Subscribe(XdsApi::kRdsTypeUrl, TString(p.first));
- }
- for (const auto& p : xds_client()->cluster_map_) {
- Subscribe(XdsApi::kCdsTypeUrl, TString(p.first));
- }
- for (const auto& p : xds_client()->endpoint_map_) {
- Subscribe(XdsApi::kEdsTypeUrl, TString(p.first));
- }
- // Op: recv initial metadata.
- op = ops;
- op->op = GRPC_OP_RECV_INITIAL_METADATA;
- op->data.recv_initial_metadata.recv_initial_metadata =
- &initial_metadata_recv_;
- op->flags = 0;
- op->reserved = nullptr;
- op++;
- // Op: recv response.
- op->op = GRPC_OP_RECV_MESSAGE;
- op->data.recv_message.recv_message = &recv_message_payload_;
- op->flags = 0;
- op->reserved = nullptr;
- op++;
- Ref(DEBUG_LOCATION, "ADS+OnResponseReceivedLocked").release();
- GRPC_CLOSURE_INIT(&on_response_received_, OnResponseReceived, this,
- grpc_schedule_on_exec_ctx);
- call_error = grpc_call_start_batch_and_execute(call_, ops, (size_t)(op - ops),
- &on_response_received_);
- GPR_ASSERT(GRPC_CALL_OK == call_error);
- // Op: recv server status.
- op = ops;
- op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
- op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv_;
- op->data.recv_status_on_client.status = &status_code_;
- op->data.recv_status_on_client.status_details = &status_details_;
- op->flags = 0;
- op->reserved = nullptr;
- op++;
- // This callback signals the end of the call, so it relies on the initial
- // ref instead of a new ref. When it's invoked, it's the initial ref that is
- // unreffed.
- GRPC_CLOSURE_INIT(&on_status_received_, OnStatusReceived, this,
- grpc_schedule_on_exec_ctx);
- call_error = grpc_call_start_batch_and_execute(call_, ops, (size_t)(op - ops),
- &on_status_received_);
- GPR_ASSERT(GRPC_CALL_OK == call_error);
-}
-
-XdsClient::ChannelState::AdsCallState::~AdsCallState() {
- grpc_metadata_array_destroy(&initial_metadata_recv_);
- grpc_metadata_array_destroy(&trailing_metadata_recv_);
- grpc_byte_buffer_destroy(send_message_payload_);
- grpc_byte_buffer_destroy(recv_message_payload_);
- grpc_slice_unref_internal(status_details_);
- GPR_ASSERT(call_ != nullptr);
- grpc_call_unref(call_);
-}
-
-void XdsClient::ChannelState::AdsCallState::Orphan() {
- GPR_ASSERT(call_ != nullptr);
- // If we are here because xds_client wants to cancel the call,
- // on_status_received_ will complete the cancellation and clean up. Otherwise,
- // we are here because xds_client has to orphan a failed call, then the
- // following cancellation will be a no-op.
- grpc_call_cancel_internal(call_);
- state_map_.clear();
- // Note that the initial ref is hold by on_status_received_. So the
- // corresponding unref happens in on_status_received_ instead of here.
-}
-
-void XdsClient::ChannelState::AdsCallState::SendMessageLocked(
- const TString& type_url) {
- // Buffer message sending if an existing message is in flight.
- if (send_message_payload_ != nullptr) {
- buffered_requests_.insert(type_url);
- return;
- }
- auto& state = state_map_[type_url];
- grpc_slice request_payload_slice;
- std::set<y_absl::string_view> resource_names =
- ResourceNamesForRequest(type_url);
- request_payload_slice = xds_client()->api_.CreateAdsRequest(
- type_url, resource_names, state.version, state.nonce,
- GRPC_ERROR_REF(state.error), !sent_initial_message_);
- if (type_url != XdsApi::kLdsTypeUrl && type_url != XdsApi::kRdsTypeUrl &&
- type_url != XdsApi::kCdsTypeUrl && type_url != XdsApi::kEdsTypeUrl) {
- state_map_.erase(type_url);
- }
- sent_initial_message_ = true;
- if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
- gpr_log(GPR_INFO,
- "[xds_client %p] sending ADS request: type=%s version=%s nonce=%s "
- "error=%s resources=%s",
- xds_client(), type_url.c_str(), state.version.c_str(),
- state.nonce.c_str(), grpc_error_string(state.error),
- y_absl::StrJoin(resource_names, " ").c_str());
- }
- GRPC_ERROR_UNREF(state.error);
- state.error = GRPC_ERROR_NONE;
- // Create message payload.
- send_message_payload_ =
- grpc_raw_byte_buffer_create(&request_payload_slice, 1);
- grpc_slice_unref_internal(request_payload_slice);
- // Send the message.
- grpc_op op;
- memset(&op, 0, sizeof(op));
- op.op = GRPC_OP_SEND_MESSAGE;
- op.data.send_message.send_message = send_message_payload_;
- Ref(DEBUG_LOCATION, "ADS+OnRequestSentLocked").release();
- GRPC_CLOSURE_INIT(&on_request_sent_, OnRequestSent, this,
- grpc_schedule_on_exec_ctx);
- grpc_call_error call_error =
- grpc_call_start_batch_and_execute(call_, &op, 1, &on_request_sent_);
- if (GPR_UNLIKELY(call_error != GRPC_CALL_OK)) {
- gpr_log(GPR_ERROR,
- "[xds_client %p] calld=%p call_error=%d sending ADS message",
- xds_client(), this, call_error);
- GPR_ASSERT(GRPC_CALL_OK == call_error);
- }
-}
-
-void XdsClient::ChannelState::AdsCallState::Subscribe(
- const TString& type_url, const TString& name) {
- auto& state = state_map_[type_url].subscribed_resources[name];
- if (state == nullptr) {
- state = MakeOrphanable<ResourceState>(type_url, name);
- SendMessageLocked(type_url);
- }
-}
-
-void XdsClient::ChannelState::AdsCallState::Unsubscribe(
- const TString& type_url, const TString& name,
- bool delay_unsubscription) {
- state_map_[type_url].subscribed_resources.erase(name);
- if (!delay_unsubscription) SendMessageLocked(type_url);
-}
-
-bool XdsClient::ChannelState::AdsCallState::HasSubscribedResources() const {
- for (const auto& p : state_map_) {
- if (!p.second.subscribed_resources.empty()) return true;
- }
- return false;
-}
-
-void XdsClient::ChannelState::AdsCallState::AcceptLdsUpdate(
- XdsApi::LdsUpdateMap lds_update_map) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
- gpr_log(GPR_INFO,
- "[xds_client %p] LDS update received containing %" PRIuPTR
- " resources",
- xds_client(), lds_update_map.size());
- }
- auto& lds_state = state_map_[XdsApi::kLdsTypeUrl];
- std::set<TString> rds_resource_names_seen;
- for (auto& p : lds_update_map) {
- const TString& listener_name = p.first;
- XdsApi::LdsUpdate& lds_update = p.second;
- auto& state = lds_state.subscribed_resources[listener_name];
- if (state != nullptr) state->Finish();
- if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
- gpr_log(GPR_INFO, "[xds_client %p] LDS resource %s: route_config_name=%s",
- xds_client(), listener_name.c_str(),
- (!lds_update.route_config_name.empty()
- ? lds_update.route_config_name.c_str()
- : "<inlined>"));
- if (lds_update.rds_update.has_value()) {
- gpr_log(GPR_INFO, "RouteConfiguration: %s",
- lds_update.rds_update->ToString().c_str());
- }
- }
- // Record the RDS resource names seen.
- if (!lds_update.route_config_name.empty()) {
- rds_resource_names_seen.insert(lds_update.route_config_name);
- }
- // Ignore identical update.
- ListenerState& listener_state = xds_client()->listener_map_[listener_name];
- if (listener_state.update.has_value() &&
- *listener_state.update == lds_update) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
- gpr_log(GPR_INFO,
- "[xds_client %p] LDS update for %s identical to current, "
- "ignoring.",
- xds_client(), listener_name.c_str());
- }
- continue;
- }
- // Update the listener state.
- listener_state.update = std::move(lds_update);
- // Notify watchers.
- for (const auto& p : listener_state.watchers) {
- p.first->OnListenerChanged(*listener_state.update);
- }
- }
- // For any subscribed resource that is not present in the update,
- // remove it from the cache and notify watchers that it does not exist.
- for (const auto& p : lds_state.subscribed_resources) {
- const TString& listener_name = p.first;
- if (lds_update_map.find(listener_name) == lds_update_map.end()) {
- ListenerState& listener_state =
- xds_client()->listener_map_[listener_name];
- // If the resource was newly requested but has not yet been received,
- // we don't want to generate an error for the watchers, because this LDS
- // response may be in reaction to an earlier request that did not yet
- // request the new resource, so its absence from the response does not
- // necessarily indicate that the resource does not exist.
- // For that case, we rely on the request timeout instead.
- if (!listener_state.update.has_value()) continue;
- listener_state.update.reset();
- for (const auto& p : listener_state.watchers) {
- p.first->OnResourceDoesNotExist();
- }
- }
- }
- // For any RDS resource that is no longer referred to by any LDS
- // resources, remove it from the cache and notify watchers that it
- // does not exist.
- auto& rds_state = state_map_[XdsApi::kRdsTypeUrl];
- for (const auto& p : rds_state.subscribed_resources) {
- const TString& rds_resource_name = p.first;
- if (rds_resource_names_seen.find(rds_resource_name) ==
- rds_resource_names_seen.end()) {
- RouteConfigState& route_config_state =
- xds_client()->route_config_map_[rds_resource_name];
- route_config_state.update.reset();
- for (const auto& p : route_config_state.watchers) {
- p.first->OnResourceDoesNotExist();
- }
- }
- }
-}
-
-void XdsClient::ChannelState::AdsCallState::AcceptRdsUpdate(
- XdsApi::RdsUpdateMap rds_update_map) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
- gpr_log(GPR_INFO,
- "[xds_client %p] RDS update received containing %" PRIuPTR
- " resources",
- xds_client(), rds_update_map.size());
- }
- auto& rds_state = state_map_[XdsApi::kRdsTypeUrl];
- for (auto& p : rds_update_map) {
- const TString& route_config_name = p.first;
- XdsApi::RdsUpdate& rds_update = p.second;
- auto& state = rds_state.subscribed_resources[route_config_name];
- if (state != nullptr) state->Finish();
- if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
- gpr_log(GPR_INFO, "[xds_client %p] RDS resource:\n%s", xds_client(),
- rds_update.ToString().c_str());
- }
- RouteConfigState& route_config_state =
- xds_client()->route_config_map_[route_config_name];
- // Ignore identical update.
- if (route_config_state.update.has_value() &&
- *route_config_state.update == rds_update) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
- gpr_log(GPR_INFO,
- "[xds_client %p] RDS resource identical to current, ignoring",
- xds_client());
- }
- continue;
- }
- // Update the cache.
- route_config_state.update = std::move(rds_update);
- // Notify all watchers.
- for (const auto& p : route_config_state.watchers) {
- p.first->OnRouteConfigChanged(*route_config_state.update);
- }
- }
-}
-
-void XdsClient::ChannelState::AdsCallState::AcceptCdsUpdate(
- XdsApi::CdsUpdateMap cds_update_map) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
- gpr_log(GPR_INFO,
- "[xds_client %p] CDS update received containing %" PRIuPTR
- " resources",
- xds_client(), cds_update_map.size());
- }
- auto& cds_state = state_map_[XdsApi::kCdsTypeUrl];
- std::set<TString> eds_resource_names_seen;
- for (auto& p : cds_update_map) {
- const char* cluster_name = p.first.c_str();
- XdsApi::CdsUpdate& cds_update = p.second;
- auto& state = cds_state.subscribed_resources[cluster_name];
- if (state != nullptr) state->Finish();
- if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
- gpr_log(GPR_INFO,
- "[xds_client %p] cluster=%s: eds_service_name=%s, "
- "lrs_load_reporting_server_name=%s",
- xds_client(), cluster_name, cds_update.eds_service_name.c_str(),
- cds_update.lrs_load_reporting_server_name.has_value()
- ? cds_update.lrs_load_reporting_server_name.value().c_str()
- : "(N/A)");
- }
- // Record the EDS resource names seen.
- eds_resource_names_seen.insert(cds_update.eds_service_name.empty()
- ? cluster_name
- : cds_update.eds_service_name);
- // Ignore identical update.
- ClusterState& cluster_state = xds_client()->cluster_map_[cluster_name];
- if (cluster_state.update.has_value() &&
- *cluster_state.update == cds_update) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
- gpr_log(GPR_INFO,
- "[xds_client %p] CDS update identical to current, ignoring.",
- xds_client());
- }
- continue;
- }
- // Update the cluster state.
- cluster_state.update = std::move(cds_update);
- // Notify all watchers.
- for (const auto& p : cluster_state.watchers) {
- p.first->OnClusterChanged(cluster_state.update.value());
- }
- }
- // For any subscribed resource that is not present in the update,
- // remove it from the cache and notify watchers that it does not exist.
- for (const auto& p : cds_state.subscribed_resources) {
- const TString& cluster_name = p.first;
- if (cds_update_map.find(cluster_name) == cds_update_map.end()) {
- ClusterState& cluster_state = xds_client()->cluster_map_[cluster_name];
- // If the resource was newly requested but has not yet been received,
- // we don't want to generate an error for the watchers, because this CDS
- // response may be in reaction to an earlier request that did not yet
- // request the new resource, so its absence from the response does not
- // necessarily indicate that the resource does not exist.
- // For that case, we rely on the request timeout instead.
- if (!cluster_state.update.has_value()) continue;
- cluster_state.update.reset();
- for (const auto& p : cluster_state.watchers) {
- p.first->OnResourceDoesNotExist();
- }
- }
- }
- // For any EDS resource that is no longer referred to by any CDS
- // resources, remove it from the cache and notify watchers that it
- // does not exist.
- auto& eds_state = state_map_[XdsApi::kEdsTypeUrl];
- for (const auto& p : eds_state.subscribed_resources) {
- const TString& eds_resource_name = p.first;
- if (eds_resource_names_seen.find(eds_resource_name) ==
- eds_resource_names_seen.end()) {
- EndpointState& endpoint_state =
- xds_client()->endpoint_map_[eds_resource_name];
- endpoint_state.update.reset();
- for (const auto& p : endpoint_state.watchers) {
- p.first->OnResourceDoesNotExist();
- }
- }
- }
-}
-
-void XdsClient::ChannelState::AdsCallState::AcceptEdsUpdate(
- XdsApi::EdsUpdateMap eds_update_map) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
- gpr_log(GPR_INFO,
- "[xds_client %p] EDS update received containing %" PRIuPTR
- " resources",
- xds_client(), eds_update_map.size());
- }
- auto& eds_state = state_map_[XdsApi::kEdsTypeUrl];
- for (auto& p : eds_update_map) {
- const char* eds_service_name = p.first.c_str();
- XdsApi::EdsUpdate& eds_update = p.second;
- auto& state = eds_state.subscribed_resources[eds_service_name];
- if (state != nullptr) state->Finish();
- if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
- gpr_log(GPR_INFO, "[xds_client %p] EDS resource %s: %s", xds_client(),
- eds_service_name, eds_update.ToString().c_str());
- }
- EndpointState& endpoint_state =
- xds_client()->endpoint_map_[eds_service_name];
- // Ignore identical update.
- if (endpoint_state.update.has_value() &&
- *endpoint_state.update == eds_update) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
- gpr_log(GPR_INFO,
- "[xds_client %p] EDS update identical to current, ignoring.",
- xds_client());
- }
- continue;
- }
- // Update the cluster state.
- endpoint_state.update = std::move(eds_update);
- // Notify all watchers.
- for (const auto& p : endpoint_state.watchers) {
- p.first->OnEndpointChanged(endpoint_state.update.value());
- }
- }
-}
-
-void XdsClient::ChannelState::AdsCallState::OnRequestSent(void* arg,
- grpc_error* error) {
- AdsCallState* ads_calld = static_cast<AdsCallState*>(arg);
- {
- MutexLock lock(&ads_calld->xds_client()->mu_);
- ads_calld->OnRequestSentLocked(GRPC_ERROR_REF(error));
- }
- ads_calld->Unref(DEBUG_LOCATION, "ADS+OnRequestSentLocked");
-}
-
-void XdsClient::ChannelState::AdsCallState::OnRequestSentLocked(
- grpc_error* error) {
- if (IsCurrentCallOnChannel() && error == GRPC_ERROR_NONE) {
- // Clean up the sent message.
- grpc_byte_buffer_destroy(send_message_payload_);
- send_message_payload_ = nullptr;
- // Continue to send another pending message if any.
- // TODO(roth): The current code to handle buffered messages has the
- // advantage of sending only the most recent list of resource names for
- // each resource type (no matter how many times that resource type has
- // been requested to send while the current message sending is still
- // pending). But its disadvantage is that we send the requests in fixed
- // order of resource types. We need to fix this if we are seeing some
- // resource type(s) starved due to frequent requests of other resource
- // type(s).
- auto it = buffered_requests_.begin();
- if (it != buffered_requests_.end()) {
- SendMessageLocked(*it);
- buffered_requests_.erase(it);
- }
- }
- GRPC_ERROR_UNREF(error);
-}
-
-void XdsClient::ChannelState::AdsCallState::OnResponseReceived(
- void* arg, grpc_error* /* error */) {
- AdsCallState* ads_calld = static_cast<AdsCallState*>(arg);
- bool done;
- {
- MutexLock lock(&ads_calld->xds_client()->mu_);
- done = ads_calld->OnResponseReceivedLocked();
- }
- if (done) ads_calld->Unref(DEBUG_LOCATION, "ADS+OnResponseReceivedLocked");
-}
-
-bool XdsClient::ChannelState::AdsCallState::OnResponseReceivedLocked() {
- // Empty payload means the call was cancelled.
- if (!IsCurrentCallOnChannel() || recv_message_payload_ == nullptr) {
- return true;
- }
- // Read the response.
- grpc_byte_buffer_reader bbr;
- grpc_byte_buffer_reader_init(&bbr, recv_message_payload_);
- grpc_slice response_slice = grpc_byte_buffer_reader_readall(&bbr);
- grpc_byte_buffer_reader_destroy(&bbr);
- grpc_byte_buffer_destroy(recv_message_payload_);
- recv_message_payload_ = nullptr;
- // Parse and validate the response.
- XdsApi::AdsParseResult result = xds_client()->api_.ParseAdsResponse(
- response_slice, ResourceNamesForRequest(XdsApi::kLdsTypeUrl),
- ResourceNamesForRequest(XdsApi::kRdsTypeUrl),
- ResourceNamesForRequest(XdsApi::kCdsTypeUrl),
- ResourceNamesForRequest(XdsApi::kEdsTypeUrl));
- grpc_slice_unref_internal(response_slice);
- if (result.type_url.empty()) {
- // Ignore unparsable response.
- gpr_log(GPR_ERROR,
- "[xds_client %p] Error parsing ADS response (%s) -- ignoring",
- xds_client(), grpc_error_string(result.parse_error));
- GRPC_ERROR_UNREF(result.parse_error);
- } else {
- // Update nonce.
- auto& state = state_map_[result.type_url];
- state.nonce = std::move(result.nonce);
- // NACK or ACK the response.
- if (result.parse_error != GRPC_ERROR_NONE) {
- GRPC_ERROR_UNREF(state.error);
- state.error = result.parse_error;
- // NACK unacceptable update.
- gpr_log(GPR_ERROR,
- "[xds_client %p] ADS response invalid for resource type %s "
- "version %s, will NACK: nonce=%s error=%s",
- xds_client(), result.type_url.c_str(), result.version.c_str(),
- state.nonce.c_str(), grpc_error_string(result.parse_error));
- SendMessageLocked(result.type_url);
- } else {
- seen_response_ = true;
- // Accept the ADS response according to the type_url.
- if (result.type_url == XdsApi::kLdsTypeUrl) {
- AcceptLdsUpdate(std::move(result.lds_update_map));
- } else if (result.type_url == XdsApi::kRdsTypeUrl) {
- AcceptRdsUpdate(std::move(result.rds_update_map));
- } else if (result.type_url == XdsApi::kCdsTypeUrl) {
- AcceptCdsUpdate(std::move(result.cds_update_map));
- } else if (result.type_url == XdsApi::kEdsTypeUrl) {
- AcceptEdsUpdate(std::move(result.eds_update_map));
- }
- state.version = std::move(result.version);
- // ACK the update.
- SendMessageLocked(result.type_url);
- // Start load reporting if needed.
- auto& lrs_call = chand()->lrs_calld_;
- if (lrs_call != nullptr) {
- LrsCallState* lrs_calld = lrs_call->calld();
- if (lrs_calld != nullptr) lrs_calld->MaybeStartReportingLocked();
- }
- }
- }
- if (xds_client()->shutting_down_) return true;
- // Keep listening for updates.
- grpc_op op;
- memset(&op, 0, sizeof(op));
- op.op = GRPC_OP_RECV_MESSAGE;
- op.data.recv_message.recv_message = &recv_message_payload_;
- op.flags = 0;
- op.reserved = nullptr;
- GPR_ASSERT(call_ != nullptr);
- // Reuse the "ADS+OnResponseReceivedLocked" ref taken in ctor.
- const grpc_call_error call_error =
- grpc_call_start_batch_and_execute(call_, &op, 1, &on_response_received_);
- GPR_ASSERT(GRPC_CALL_OK == call_error);
- return false;
-}
-
-void XdsClient::ChannelState::AdsCallState::OnStatusReceived(
- void* arg, grpc_error* error) {
- AdsCallState* ads_calld = static_cast<AdsCallState*>(arg);
- {
- MutexLock lock(&ads_calld->xds_client()->mu_);
- ads_calld->OnStatusReceivedLocked(GRPC_ERROR_REF(error));
- }
- ads_calld->Unref(DEBUG_LOCATION, "ADS+OnStatusReceivedLocked");
-}
-
-void XdsClient::ChannelState::AdsCallState::OnStatusReceivedLocked(
- grpc_error* error) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
- char* status_details = grpc_slice_to_c_string(status_details_);
- gpr_log(GPR_INFO,
- "[xds_client %p] ADS call status received. Status = %d, details "
- "= '%s', (chand: %p, ads_calld: %p, call: %p), error '%s'",
- xds_client(), status_code_, status_details, chand(), this, call_,
- grpc_error_string(error));
- gpr_free(status_details);
- }
- // Ignore status from a stale call.
- if (IsCurrentCallOnChannel()) {
- // Try to restart the call.
- parent_->OnCallFinishedLocked();
- // Send error to all watchers.
- xds_client()->NotifyOnErrorLocked(
- GRPC_ERROR_CREATE_FROM_STATIC_STRING("xds call failed"));
- }
- GRPC_ERROR_UNREF(error);
-}
-
-bool XdsClient::ChannelState::AdsCallState::IsCurrentCallOnChannel() const {
- // If the retryable ADS call is null (which only happens when the xds channel
- // is shutting down), all the ADS calls are stale.
- if (chand()->ads_calld_ == nullptr) return false;
- return this == chand()->ads_calld_->calld();
-}
-
-std::set<y_absl::string_view>
-XdsClient::ChannelState::AdsCallState::ResourceNamesForRequest(
- const TString& type_url) {
- std::set<y_absl::string_view> resource_names;
- auto it = state_map_.find(type_url);
- if (it != state_map_.end()) {
- for (auto& p : it->second.subscribed_resources) {
- resource_names.insert(p.first);
- OrphanablePtr<ResourceState>& state = p.second;
- state->Start(Ref(DEBUG_LOCATION, "ResourceState"));
- }
- }
- return resource_names;
-}
-
-//
-// XdsClient::ChannelState::LrsCallState::Reporter
-//
-
-void XdsClient::ChannelState::LrsCallState::Reporter::Orphan() {
- if (next_report_timer_callback_pending_) {
- grpc_timer_cancel(&next_report_timer_);
- }
-}
-
-void XdsClient::ChannelState::LrsCallState::Reporter::
- ScheduleNextReportLocked() {
- const grpc_millis next_report_time = ExecCtx::Get()->Now() + report_interval_;
- grpc_timer_init(&next_report_timer_, next_report_time,
- &on_next_report_timer_);
- next_report_timer_callback_pending_ = true;
-}
-
-void XdsClient::ChannelState::LrsCallState::Reporter::OnNextReportTimer(
- void* arg, grpc_error* error) {
- Reporter* self = static_cast<Reporter*>(arg);
- bool done;
- {
- MutexLock lock(&self->xds_client()->mu_);
- done = self->OnNextReportTimerLocked(GRPC_ERROR_REF(error));
- }
- if (done) self->Unref(DEBUG_LOCATION, "Reporter+timer");
-}
-
-bool XdsClient::ChannelState::LrsCallState::Reporter::OnNextReportTimerLocked(
- grpc_error* error) {
- next_report_timer_callback_pending_ = false;
- if (error != GRPC_ERROR_NONE || !IsCurrentReporterOnCall()) {
- GRPC_ERROR_UNREF(error);
- return true;
- }
- SendReportLocked();
- return false;
-}
-
-namespace {
-
-bool LoadReportCountersAreZero(const XdsApi::ClusterLoadReportMap& snapshot) {
- for (const auto& p : snapshot) {
- const XdsApi::ClusterLoadReport& cluster_snapshot = p.second;
- if (!cluster_snapshot.dropped_requests.IsZero()) return false;
- for (const auto& q : cluster_snapshot.locality_stats) {
- const XdsClusterLocalityStats::Snapshot& locality_snapshot = q.second;
- if (!locality_snapshot.IsZero()) return false;
- }
- }
- return true;
-}
-
-} // namespace
-
-void XdsClient::ChannelState::LrsCallState::Reporter::SendReportLocked() {
- // Construct snapshot from all reported stats.
- XdsApi::ClusterLoadReportMap snapshot =
- xds_client()->BuildLoadReportSnapshotLocked(parent_->send_all_clusters_,
- parent_->cluster_names_);
- // Skip client load report if the counters were all zero in the last
- // report and they are still zero in this one.
- const bool old_val = last_report_counters_were_zero_;
- last_report_counters_were_zero_ = LoadReportCountersAreZero(snapshot);
- if (old_val && last_report_counters_were_zero_) {
- ScheduleNextReportLocked();
- return;
- }
- // Create a request that contains the snapshot.
- grpc_slice request_payload_slice =
- xds_client()->api_.CreateLrsRequest(std::move(snapshot));
- parent_->send_message_payload_ =
- grpc_raw_byte_buffer_create(&request_payload_slice, 1);
- grpc_slice_unref_internal(request_payload_slice);
- // Send the report.
- grpc_op op;
- memset(&op, 0, sizeof(op));
- op.op = GRPC_OP_SEND_MESSAGE;
- op.data.send_message.send_message = parent_->send_message_payload_;
- grpc_call_error call_error = grpc_call_start_batch_and_execute(
- parent_->call_, &op, 1, &on_report_done_);
- if (GPR_UNLIKELY(call_error != GRPC_CALL_OK)) {
- gpr_log(GPR_ERROR,
- "[xds_client %p] calld=%p call_error=%d sending client load report",
- xds_client(), this, call_error);
- GPR_ASSERT(GRPC_CALL_OK == call_error);
- }
-}
-
-void XdsClient::ChannelState::LrsCallState::Reporter::OnReportDone(
- void* arg, grpc_error* error) {
- Reporter* self = static_cast<Reporter*>(arg);
- bool done;
- {
- MutexLock lock(&self->xds_client()->mu_);
- done = self->OnReportDoneLocked(GRPC_ERROR_REF(error));
- }
- if (done) self->Unref(DEBUG_LOCATION, "Reporter+report_done");
-}
-
-bool XdsClient::ChannelState::LrsCallState::Reporter::OnReportDoneLocked(
- grpc_error* error) {
- grpc_byte_buffer_destroy(parent_->send_message_payload_);
- parent_->send_message_payload_ = nullptr;
- // If there are no more registered stats to report, cancel the call.
- if (xds_client()->load_report_map_.empty()) {
- parent_->chand()->StopLrsCall();
- GRPC_ERROR_UNREF(error);
- return true;
- }
- if (error != GRPC_ERROR_NONE || !IsCurrentReporterOnCall()) {
- GRPC_ERROR_UNREF(error);
- // If this reporter is no longer the current one on the call, the reason
- // might be that it was orphaned for a new one due to config update.
- if (!IsCurrentReporterOnCall()) {
- parent_->MaybeStartReportingLocked();
- }
- return true;
- }
- ScheduleNextReportLocked();
- return false;
-}
-
-//
-// XdsClient::ChannelState::LrsCallState
-//
-
-XdsClient::ChannelState::LrsCallState::LrsCallState(
- RefCountedPtr<RetryableCall<LrsCallState>> parent)
- : InternallyRefCounted<LrsCallState>(&grpc_xds_client_trace),
- parent_(std::move(parent)) {
- // Init the LRS call. Note that the call will progress every time there's
- // activity in xds_client()->interested_parties_, which is comprised of
- // the polling entities from client_channel.
- GPR_ASSERT(xds_client() != nullptr);
- const auto& method =
- xds_client()->bootstrap_->server().ShouldUseV3()
- ? GRPC_MDSTR_SLASH_ENVOY_DOT_SERVICE_DOT_LOAD_STATS_DOT_V3_DOT_LOADREPORTINGSERVICE_SLASH_STREAMLOADSTATS
- : GRPC_MDSTR_SLASH_ENVOY_DOT_SERVICE_DOT_LOAD_STATS_DOT_V2_DOT_LOADREPORTINGSERVICE_SLASH_STREAMLOADSTATS;
- call_ = grpc_channel_create_pollset_set_call(
- chand()->channel_, nullptr, GRPC_PROPAGATE_DEFAULTS,
- xds_client()->interested_parties_, method, nullptr,
- GRPC_MILLIS_INF_FUTURE, nullptr);
- GPR_ASSERT(call_ != nullptr);
- // Init the request payload.
- grpc_slice request_payload_slice =
- xds_client()->api_.CreateLrsInitialRequest();
- send_message_payload_ =
- grpc_raw_byte_buffer_create(&request_payload_slice, 1);
- grpc_slice_unref_internal(request_payload_slice);
- // Init other data associated with the LRS call.
- grpc_metadata_array_init(&initial_metadata_recv_);
- grpc_metadata_array_init(&trailing_metadata_recv_);
- // Start the call.
- if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
- gpr_log(GPR_INFO,
- "[xds_client %p] Starting LRS call (chand: %p, calld: %p, "
- "call: %p)",
- xds_client(), chand(), this, call_);
- }
- // Create the ops.
- grpc_call_error call_error;
- grpc_op ops[3];
- memset(ops, 0, sizeof(ops));
- // Op: send initial metadata.
- grpc_op* op = ops;
- op->op = GRPC_OP_SEND_INITIAL_METADATA;
- op->data.send_initial_metadata.count = 0;
- op->flags = GRPC_INITIAL_METADATA_WAIT_FOR_READY |
- GRPC_INITIAL_METADATA_WAIT_FOR_READY_EXPLICITLY_SET;
- op->reserved = nullptr;
- op++;
- // Op: send request message.
- GPR_ASSERT(send_message_payload_ != nullptr);
- op->op = GRPC_OP_SEND_MESSAGE;
- op->data.send_message.send_message = send_message_payload_;
- op->flags = 0;
- op->reserved = nullptr;
- op++;
- Ref(DEBUG_LOCATION, "LRS+OnInitialRequestSentLocked").release();
- GRPC_CLOSURE_INIT(&on_initial_request_sent_, OnInitialRequestSent, this,
- grpc_schedule_on_exec_ctx);
- call_error = grpc_call_start_batch_and_execute(call_, ops, (size_t)(op - ops),
- &on_initial_request_sent_);
- GPR_ASSERT(GRPC_CALL_OK == call_error);
- // Op: recv initial metadata.
- op = ops;
- op->op = GRPC_OP_RECV_INITIAL_METADATA;
- op->data.recv_initial_metadata.recv_initial_metadata =
- &initial_metadata_recv_;
- op->flags = 0;
- op->reserved = nullptr;
- op++;
- // Op: recv response.
- op->op = GRPC_OP_RECV_MESSAGE;
- op->data.recv_message.recv_message = &recv_message_payload_;
- op->flags = 0;
- op->reserved = nullptr;
- op++;
- Ref(DEBUG_LOCATION, "LRS+OnResponseReceivedLocked").release();
- GRPC_CLOSURE_INIT(&on_response_received_, OnResponseReceived, this,
- grpc_schedule_on_exec_ctx);
- call_error = grpc_call_start_batch_and_execute(call_, ops, (size_t)(op - ops),
- &on_response_received_);
- GPR_ASSERT(GRPC_CALL_OK == call_error);
- // Op: recv server status.
- op = ops;
- op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
- op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv_;
- op->data.recv_status_on_client.status = &status_code_;
- op->data.recv_status_on_client.status_details = &status_details_;
- op->flags = 0;
- op->reserved = nullptr;
- op++;
- // This callback signals the end of the call, so it relies on the initial
- // ref instead of a new ref. When it's invoked, it's the initial ref that is
- // unreffed.
- GRPC_CLOSURE_INIT(&on_status_received_, OnStatusReceived, this,
- grpc_schedule_on_exec_ctx);
- call_error = grpc_call_start_batch_and_execute(call_, ops, (size_t)(op - ops),
- &on_status_received_);
- GPR_ASSERT(GRPC_CALL_OK == call_error);
-}
-
-XdsClient::ChannelState::LrsCallState::~LrsCallState() {
- grpc_metadata_array_destroy(&initial_metadata_recv_);
- grpc_metadata_array_destroy(&trailing_metadata_recv_);
- grpc_byte_buffer_destroy(send_message_payload_);
- grpc_byte_buffer_destroy(recv_message_payload_);
- grpc_slice_unref_internal(status_details_);
- GPR_ASSERT(call_ != nullptr);
- grpc_call_unref(call_);
-}
-
-void XdsClient::ChannelState::LrsCallState::Orphan() {
- reporter_.reset();
- GPR_ASSERT(call_ != nullptr);
- // If we are here because xds_client wants to cancel the call,
- // on_status_received_ will complete the cancellation and clean up. Otherwise,
- // we are here because xds_client has to orphan a failed call, then the
- // following cancellation will be a no-op.
- grpc_call_cancel_internal(call_);
- // Note that the initial ref is hold by on_status_received_. So the
- // corresponding unref happens in on_status_received_ instead of here.
-}
-
-void XdsClient::ChannelState::LrsCallState::MaybeStartReportingLocked() {
- // Don't start again if already started.
- if (reporter_ != nullptr) return;
- // Don't start if the previous send_message op (of the initial request or the
- // last report of the previous reporter) hasn't completed.
- if (send_message_payload_ != nullptr) return;
- // Don't start if no LRS response has arrived.
- if (!seen_response()) return;
- // Don't start if the ADS call hasn't received any valid response. Note that
- // this must be the first channel because it is the current channel but its
- // ADS call hasn't seen any response.
- if (chand()->ads_calld_ == nullptr ||
- chand()->ads_calld_->calld() == nullptr ||
- !chand()->ads_calld_->calld()->seen_response()) {
- return;
- }
- // Start reporting.
- reporter_ = MakeOrphanable<Reporter>(
- Ref(DEBUG_LOCATION, "LRS+load_report+start"), load_reporting_interval_);
-}
-
-void XdsClient::ChannelState::LrsCallState::OnInitialRequestSent(
- void* arg, grpc_error* /*error*/) {
- LrsCallState* lrs_calld = static_cast<LrsCallState*>(arg);
- {
- MutexLock lock(&lrs_calld->xds_client()->mu_);
- lrs_calld->OnInitialRequestSentLocked();
- }
- lrs_calld->Unref(DEBUG_LOCATION, "LRS+OnInitialRequestSentLocked");
-}
-
-void XdsClient::ChannelState::LrsCallState::OnInitialRequestSentLocked() {
- // Clear the send_message_payload_.
- grpc_byte_buffer_destroy(send_message_payload_);
- send_message_payload_ = nullptr;
- MaybeStartReportingLocked();
-}
-
-void XdsClient::ChannelState::LrsCallState::OnResponseReceived(
- void* arg, grpc_error* /*error*/) {
- LrsCallState* lrs_calld = static_cast<LrsCallState*>(arg);
- bool done;
- {
- MutexLock lock(&lrs_calld->xds_client()->mu_);
- done = lrs_calld->OnResponseReceivedLocked();
- }
- if (done) lrs_calld->Unref(DEBUG_LOCATION, "LRS+OnResponseReceivedLocked");
-}
-
-bool XdsClient::ChannelState::LrsCallState::OnResponseReceivedLocked() {
- // Empty payload means the call was cancelled.
- if (!IsCurrentCallOnChannel() || recv_message_payload_ == nullptr) {
- return true;
- }
- // Read the response.
- grpc_byte_buffer_reader bbr;
- grpc_byte_buffer_reader_init(&bbr, recv_message_payload_);
- grpc_slice response_slice = grpc_byte_buffer_reader_readall(&bbr);
- grpc_byte_buffer_reader_destroy(&bbr);
- grpc_byte_buffer_destroy(recv_message_payload_);
- recv_message_payload_ = nullptr;
- // This anonymous lambda is a hack to avoid the usage of goto.
- [&]() {
- // Parse the response.
- bool send_all_clusters = false;
- std::set<TString> new_cluster_names;
- grpc_millis new_load_reporting_interval;
- grpc_error* parse_error = xds_client()->api_.ParseLrsResponse(
- response_slice, &send_all_clusters, &new_cluster_names,
- &new_load_reporting_interval);
- if (parse_error != GRPC_ERROR_NONE) {
- gpr_log(GPR_ERROR,
- "[xds_client %p] LRS response parsing failed. error=%s",
- xds_client(), grpc_error_string(parse_error));
- GRPC_ERROR_UNREF(parse_error);
- return;
- }
- seen_response_ = true;
- if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
- gpr_log(
- GPR_INFO,
- "[xds_client %p] LRS response received, %" PRIuPTR
- " cluster names, send_all_clusters=%d, load_report_interval=%" PRId64
- "ms",
- xds_client(), new_cluster_names.size(), send_all_clusters,
- new_load_reporting_interval);
- size_t i = 0;
- for (const auto& name : new_cluster_names) {
- gpr_log(GPR_INFO, "[xds_client %p] cluster_name %" PRIuPTR ": %s",
- xds_client(), i++, name.c_str());
- }
- }
- if (new_load_reporting_interval <
- GRPC_XDS_MIN_CLIENT_LOAD_REPORTING_INTERVAL_MS) {
- new_load_reporting_interval =
- GRPC_XDS_MIN_CLIENT_LOAD_REPORTING_INTERVAL_MS;
- if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
- gpr_log(GPR_INFO,
- "[xds_client %p] Increased load_report_interval to minimum "
- "value %dms",
- xds_client(), GRPC_XDS_MIN_CLIENT_LOAD_REPORTING_INTERVAL_MS);
- }
- }
- // Ignore identical update.
- if (send_all_clusters == send_all_clusters_ &&
- cluster_names_ == new_cluster_names &&
- load_reporting_interval_ == new_load_reporting_interval) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
- gpr_log(GPR_INFO,
- "[xds_client %p] Incoming LRS response identical to current, "
- "ignoring.",
- xds_client());
- }
- return;
- }
- // Stop current load reporting (if any) to adopt the new config.
- reporter_.reset();
- // Record the new config.
- send_all_clusters_ = send_all_clusters;
- cluster_names_ = std::move(new_cluster_names);
- load_reporting_interval_ = new_load_reporting_interval;
- // Try starting sending load report.
- MaybeStartReportingLocked();
- }();
- grpc_slice_unref_internal(response_slice);
- if (xds_client()->shutting_down_) return true;
- // Keep listening for LRS config updates.
- grpc_op op;
- memset(&op, 0, sizeof(op));
- op.op = GRPC_OP_RECV_MESSAGE;
- op.data.recv_message.recv_message = &recv_message_payload_;
- op.flags = 0;
- op.reserved = nullptr;
- GPR_ASSERT(call_ != nullptr);
- // Reuse the "OnResponseReceivedLocked" ref taken in ctor.
- const grpc_call_error call_error =
- grpc_call_start_batch_and_execute(call_, &op, 1, &on_response_received_);
- GPR_ASSERT(GRPC_CALL_OK == call_error);
- return false;
-}
-
-void XdsClient::ChannelState::LrsCallState::OnStatusReceived(
- void* arg, grpc_error* error) {
- LrsCallState* lrs_calld = static_cast<LrsCallState*>(arg);
- {
- MutexLock lock(&lrs_calld->xds_client()->mu_);
- lrs_calld->OnStatusReceivedLocked(GRPC_ERROR_REF(error));
- }
- lrs_calld->Unref(DEBUG_LOCATION, "LRS+OnStatusReceivedLocked");
-}
-
-void XdsClient::ChannelState::LrsCallState::OnStatusReceivedLocked(
- grpc_error* error) {
- GPR_ASSERT(call_ != nullptr);
- if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
- char* status_details = grpc_slice_to_c_string(status_details_);
- gpr_log(GPR_INFO,
- "[xds_client %p] LRS call status received. Status = %d, details "
- "= '%s', (chand: %p, calld: %p, call: %p), error '%s'",
- xds_client(), status_code_, status_details, chand(), this, call_,
- grpc_error_string(error));
- gpr_free(status_details);
- }
- // Ignore status from a stale call.
- if (IsCurrentCallOnChannel()) {
- GPR_ASSERT(!xds_client()->shutting_down_);
- // Try to restart the call.
- parent_->OnCallFinishedLocked();
- }
- GRPC_ERROR_UNREF(error);
-}
-
-bool XdsClient::ChannelState::LrsCallState::IsCurrentCallOnChannel() const {
- // If the retryable LRS call is null (which only happens when the xds channel
- // is shutting down), all the LRS calls are stale.
- if (chand()->lrs_calld_ == nullptr) return false;
- return this == chand()->lrs_calld_->calld();
-}
-
-//
-// XdsClient
-//
-
-namespace {
-
-grpc_millis GetRequestTimeout() {
- return grpc_channel_args_find_integer(
- g_channel_args, GRPC_ARG_XDS_RESOURCE_DOES_NOT_EXIST_TIMEOUT_MS,
- {15000, 0, INT_MAX});
-}
-
-grpc_channel* CreateXdsChannel(const XdsBootstrap& bootstrap,
- grpc_error** error) {
- // Build channel args.
- y_absl::InlinedVector<grpc_arg, 2> args_to_add = {
- grpc_channel_arg_integer_create(
- const_cast<char*>(GRPC_ARG_KEEPALIVE_TIME_MS),
- 5 * 60 * GPR_MS_PER_SEC),
- grpc_channel_arg_integer_create(
- const_cast<char*>(GRPC_ARG_CHANNELZ_IS_INTERNAL_CHANNEL), 1),
- };
- grpc_channel_args* new_args = grpc_channel_args_copy_and_add(
- g_channel_args, args_to_add.data(), args_to_add.size());
- // Find credentials and create channel.
- RefCountedPtr<grpc_channel_credentials> creds;
- for (const auto& channel_creds : bootstrap.server().channel_creds) {
- if (channel_creds.type == "google_default") {
- creds.reset(grpc_google_default_credentials_create(nullptr));
- break;
- }
- if (channel_creds.type == "insecure") {
- grpc_channel* channel = grpc_insecure_channel_create(
- bootstrap.server().server_uri.c_str(), new_args, nullptr);
- grpc_channel_args_destroy(new_args);
- return channel;
- }
- if (channel_creds.type == "fake") {
- creds.reset(grpc_fake_transport_security_credentials_create());
- break;
- }
- }
- if (creds == nullptr) {
- *error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "no supported credential types found");
- return nullptr;
- }
- grpc_channel* channel = grpc_secure_channel_create(
- creds.get(), bootstrap.server().server_uri.c_str(), new_args, nullptr);
- grpc_channel_args_destroy(new_args);
- return channel;
-}
-
-} // namespace
-
-XdsClient::XdsClient(grpc_error** error)
- : DualRefCounted<XdsClient>(&grpc_xds_client_trace),
- request_timeout_(GetRequestTimeout()),
- interested_parties_(grpc_pollset_set_create()),
- bootstrap_(
- XdsBootstrap::ReadFromFile(this, &grpc_xds_client_trace, error)),
- api_(this, &grpc_xds_client_trace, bootstrap_.get()) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
- gpr_log(GPR_INFO, "[xds_client %p] creating xds client", this);
- }
- if (*error != GRPC_ERROR_NONE) {
- gpr_log(GPR_ERROR, "[xds_client %p] failed to read bootstrap file: %s",
- this, grpc_error_string(*error));
- return;
- }
- if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
- gpr_log(GPR_INFO, "[xds_client %p] creating channel to %s", this,
- bootstrap_->server().server_uri.c_str());
- }
- grpc_channel* channel = CreateXdsChannel(*bootstrap_, error);
- if (*error != GRPC_ERROR_NONE) {
- gpr_log(GPR_ERROR, "[xds_client %p] failed to create xds channel: %s", this,
- grpc_error_string(*error));
- return;
- }
- // Create ChannelState object.
- chand_ = MakeOrphanable<ChannelState>(
- WeakRef(DEBUG_LOCATION, "XdsClient+ChannelState"), channel);
-}
-
-XdsClient::~XdsClient() {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
- gpr_log(GPR_INFO, "[xds_client %p] destroying xds client", this);
- }
- grpc_pollset_set_destroy(interested_parties_);
-}
-
-void XdsClient::AddChannelzLinkage(
- channelz::ChannelNode* parent_channelz_node) {
- channelz::ChannelNode* xds_channelz_node =
- grpc_channel_get_channelz_node(chand_->channel());
- if (xds_channelz_node != nullptr) {
- parent_channelz_node->AddChildChannel(xds_channelz_node->uuid());
- }
-}
-
-void XdsClient::RemoveChannelzLinkage(
- channelz::ChannelNode* parent_channelz_node) {
- channelz::ChannelNode* xds_channelz_node =
- grpc_channel_get_channelz_node(chand_->channel());
- if (xds_channelz_node != nullptr) {
- parent_channelz_node->RemoveChildChannel(xds_channelz_node->uuid());
- }
-}
-
-void XdsClient::Orphan() {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
- gpr_log(GPR_INFO, "[xds_client %p] shutting down xds client", this);
- }
- {
- MutexLock lock(g_mu);
- if (g_xds_client == this) g_xds_client = nullptr;
- }
- {
- MutexLock lock(&mu_);
- shutting_down_ = true;
- // Orphan ChannelState object.
- chand_.reset();
- // We do not clear cluster_map_ and endpoint_map_ if the xds client was
- // created by the XdsResolver because the maps contain refs for watchers
- // which in turn hold refs to the loadbalancing policies. At this point, it
- // is possible for ADS calls to be in progress. Unreffing the loadbalancing
- // policies before those calls are done would lead to issues such as
- // https://github.com/grpc/grpc/issues/20928.
- if (!listener_map_.empty()) {
- cluster_map_.clear();
- endpoint_map_.clear();
- }
- }
-}
-
-void XdsClient::WatchListenerData(
- y_absl::string_view listener_name,
- std::unique_ptr<ListenerWatcherInterface> watcher) {
- TString listener_name_str = TString(listener_name);
- MutexLock lock(&mu_);
- ListenerState& listener_state = listener_map_[listener_name_str];
- ListenerWatcherInterface* w = watcher.get();
- listener_state.watchers[w] = std::move(watcher);
- // If we've already received an LDS update, notify the new watcher
- // immediately.
- if (listener_state.update.has_value()) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
- gpr_log(GPR_INFO, "[xds_client %p] returning cached listener data for %s",
- this, listener_name_str.c_str());
- }
- w->OnListenerChanged(*listener_state.update);
- }
- chand_->Subscribe(XdsApi::kLdsTypeUrl, listener_name_str);
-}
-
-void XdsClient::CancelListenerDataWatch(y_absl::string_view listener_name,
- ListenerWatcherInterface* watcher,
- bool delay_unsubscription) {
- MutexLock lock(&mu_);
- if (shutting_down_) return;
- TString listener_name_str = TString(listener_name);
- ListenerState& listener_state = listener_map_[listener_name_str];
- auto it = listener_state.watchers.find(watcher);
- if (it != listener_state.watchers.end()) {
- listener_state.watchers.erase(it);
- if (listener_state.watchers.empty()) {
- listener_map_.erase(listener_name_str);
- chand_->Unsubscribe(XdsApi::kLdsTypeUrl, listener_name_str,
- delay_unsubscription);
- }
- }
-}
-
-void XdsClient::WatchRouteConfigData(
- y_absl::string_view route_config_name,
- std::unique_ptr<RouteConfigWatcherInterface> watcher) {
- TString route_config_name_str = TString(route_config_name);
- MutexLock lock(&mu_);
- RouteConfigState& route_config_state =
- route_config_map_[route_config_name_str];
- RouteConfigWatcherInterface* w = watcher.get();
- route_config_state.watchers[w] = std::move(watcher);
- // If we've already received an RDS update, notify the new watcher
- // immediately.
- if (route_config_state.update.has_value()) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
- gpr_log(GPR_INFO,
- "[xds_client %p] returning cached route config data for %s", this,
- route_config_name_str.c_str());
- }
- w->OnRouteConfigChanged(*route_config_state.update);
- }
- chand_->Subscribe(XdsApi::kRdsTypeUrl, route_config_name_str);
-}
-
-void XdsClient::CancelRouteConfigDataWatch(y_absl::string_view route_config_name,
- RouteConfigWatcherInterface* watcher,
- bool delay_unsubscription) {
- MutexLock lock(&mu_);
- if (shutting_down_) return;
- TString route_config_name_str = TString(route_config_name);
- RouteConfigState& route_config_state =
- route_config_map_[route_config_name_str];
- auto it = route_config_state.watchers.find(watcher);
- if (it != route_config_state.watchers.end()) {
- route_config_state.watchers.erase(it);
- if (route_config_state.watchers.empty()) {
- route_config_map_.erase(route_config_name_str);
- chand_->Unsubscribe(XdsApi::kRdsTypeUrl, route_config_name_str,
- delay_unsubscription);
- }
- }
-}
-
-void XdsClient::WatchClusterData(
- y_absl::string_view cluster_name,
- std::unique_ptr<ClusterWatcherInterface> watcher) {
- TString cluster_name_str = TString(cluster_name);
- MutexLock lock(&mu_);
- ClusterState& cluster_state = cluster_map_[cluster_name_str];
- ClusterWatcherInterface* w = watcher.get();
- cluster_state.watchers[w] = std::move(watcher);
- // If we've already received a CDS update, notify the new watcher
- // immediately.
- if (cluster_state.update.has_value()) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
- gpr_log(GPR_INFO, "[xds_client %p] returning cached cluster data for %s",
- this, cluster_name_str.c_str());
- }
- w->OnClusterChanged(cluster_state.update.value());
- }
- chand_->Subscribe(XdsApi::kCdsTypeUrl, cluster_name_str);
-}
-
-void XdsClient::CancelClusterDataWatch(y_absl::string_view cluster_name,
- ClusterWatcherInterface* watcher,
- bool delay_unsubscription) {
- MutexLock lock(&mu_);
- if (shutting_down_) return;
- TString cluster_name_str = TString(cluster_name);
- ClusterState& cluster_state = cluster_map_[cluster_name_str];
- auto it = cluster_state.watchers.find(watcher);
- if (it != cluster_state.watchers.end()) {
- cluster_state.watchers.erase(it);
- if (cluster_state.watchers.empty()) {
- cluster_map_.erase(cluster_name_str);
- chand_->Unsubscribe(XdsApi::kCdsTypeUrl, cluster_name_str,
- delay_unsubscription);
- }
- }
-}
-
-void XdsClient::WatchEndpointData(
- y_absl::string_view eds_service_name,
- std::unique_ptr<EndpointWatcherInterface> watcher) {
- TString eds_service_name_str = TString(eds_service_name);
- MutexLock lock(&mu_);
- EndpointState& endpoint_state = endpoint_map_[eds_service_name_str];
- EndpointWatcherInterface* w = watcher.get();
- endpoint_state.watchers[w] = std::move(watcher);
- // If we've already received an EDS update, notify the new watcher
- // immediately.
- if (endpoint_state.update.has_value()) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
- gpr_log(GPR_INFO, "[xds_client %p] returning cached endpoint data for %s",
- this, eds_service_name_str.c_str());
- }
- w->OnEndpointChanged(endpoint_state.update.value());
- }
- chand_->Subscribe(XdsApi::kEdsTypeUrl, eds_service_name_str);
-}
-
-void XdsClient::CancelEndpointDataWatch(y_absl::string_view eds_service_name,
- EndpointWatcherInterface* watcher,
- bool delay_unsubscription) {
- MutexLock lock(&mu_);
- if (shutting_down_) return;
- TString eds_service_name_str = TString(eds_service_name);
- EndpointState& endpoint_state = endpoint_map_[eds_service_name_str];
- auto it = endpoint_state.watchers.find(watcher);
- if (it != endpoint_state.watchers.end()) {
- endpoint_state.watchers.erase(it);
- if (endpoint_state.watchers.empty()) {
- endpoint_map_.erase(eds_service_name_str);
- chand_->Unsubscribe(XdsApi::kEdsTypeUrl, eds_service_name_str,
- delay_unsubscription);
- }
- }
-}
-
-RefCountedPtr<XdsClusterDropStats> XdsClient::AddClusterDropStats(
- y_absl::string_view lrs_server, y_absl::string_view cluster_name,
- y_absl::string_view eds_service_name) {
- // TODO(roth): When we add support for direct federation, use the
- // server name specified in lrs_server.
- auto key =
- std::make_pair(TString(cluster_name), TString(eds_service_name));
- MutexLock lock(&mu_);
- // We jump through some hoops here to make sure that the y_absl::string_views
- // stored in the XdsClusterDropStats object point to the strings
- // in the load_report_map_ key, so that they have the same lifetime.
- auto it = load_report_map_
- .emplace(std::make_pair(std::move(key), LoadReportState()))
- .first;
- auto cluster_drop_stats = MakeRefCounted<XdsClusterDropStats>(
- Ref(DEBUG_LOCATION, "DropStats"), lrs_server,
- it->first.first /*cluster_name*/, it->first.second /*eds_service_name*/);
- it->second.drop_stats.insert(cluster_drop_stats.get());
- chand_->MaybeStartLrsCall();
- return cluster_drop_stats;
-}
-
-void XdsClient::RemoveClusterDropStats(
- y_absl::string_view /*lrs_server*/, y_absl::string_view cluster_name,
- y_absl::string_view eds_service_name,
- XdsClusterDropStats* cluster_drop_stats) {
- MutexLock lock(&mu_);
- auto load_report_it = load_report_map_.find(
- std::make_pair(TString(cluster_name), TString(eds_service_name)));
- if (load_report_it == load_report_map_.end()) return;
- LoadReportState& load_report_state = load_report_it->second;
- // TODO(roth): When we add support for direct federation, use the
- // server name specified in lrs_server.
- auto it = load_report_state.drop_stats.find(cluster_drop_stats);
- if (it != load_report_state.drop_stats.end()) {
- // Record final drop stats in deleted_drop_stats, which will be
- // added to the next load report.
- auto dropped_requests = cluster_drop_stats->GetSnapshotAndReset();
- load_report_state.deleted_drop_stats += dropped_requests;
- load_report_state.drop_stats.erase(it);
- }
-}
-
-RefCountedPtr<XdsClusterLocalityStats> XdsClient::AddClusterLocalityStats(
- y_absl::string_view lrs_server, y_absl::string_view cluster_name,
- y_absl::string_view eds_service_name,
- RefCountedPtr<XdsLocalityName> locality) {
- // TODO(roth): When we add support for direct federation, use the
- // server name specified in lrs_server.
- auto key =
- std::make_pair(TString(cluster_name), TString(eds_service_name));
- MutexLock lock(&mu_);
- // We jump through some hoops here to make sure that the y_absl::string_views
- // stored in the XdsClusterLocalityStats object point to the strings
- // in the load_report_map_ key, so that they have the same lifetime.
- auto it = load_report_map_
- .emplace(std::make_pair(std::move(key), LoadReportState()))
- .first;
- auto cluster_locality_stats = MakeRefCounted<XdsClusterLocalityStats>(
- Ref(DEBUG_LOCATION, "LocalityStats"), lrs_server,
- it->first.first /*cluster_name*/, it->first.second /*eds_service_name*/,
- locality);
- it->second.locality_stats[std::move(locality)].locality_stats.insert(
- cluster_locality_stats.get());
- chand_->MaybeStartLrsCall();
- return cluster_locality_stats;
-}
-
-void XdsClient::RemoveClusterLocalityStats(
- y_absl::string_view /*lrs_server*/, y_absl::string_view cluster_name,
- y_absl::string_view eds_service_name,
- const RefCountedPtr<XdsLocalityName>& locality,
- XdsClusterLocalityStats* cluster_locality_stats) {
- MutexLock lock(&mu_);
- auto load_report_it = load_report_map_.find(
- std::make_pair(TString(cluster_name), TString(eds_service_name)));
- if (load_report_it == load_report_map_.end()) return;
- LoadReportState& load_report_state = load_report_it->second;
- // TODO(roth): When we add support for direct federation, use the
- // server name specified in lrs_server.
- auto locality_it = load_report_state.locality_stats.find(locality);
- if (locality_it == load_report_state.locality_stats.end()) return;
- auto& locality_set = locality_it->second.locality_stats;
- auto it = locality_set.find(cluster_locality_stats);
- if (it != locality_set.end()) {
- // Record final snapshot in deleted_locality_stats, which will be
- // added to the next load report.
- locality_it->second.deleted_locality_stats.emplace_back(
- cluster_locality_stats->GetSnapshotAndReset());
- locality_set.erase(it);
- }
-}
-
-void XdsClient::ResetBackoff() {
- MutexLock lock(&mu_);
- if (chand_ != nullptr) {
- grpc_channel_reset_connect_backoff(chand_->channel());
- }
-}
-
-void XdsClient::NotifyOnErrorLocked(grpc_error* error) {
- for (const auto& p : listener_map_) {
- const ListenerState& listener_state = p.second;
- for (const auto& p : listener_state.watchers) {
- p.first->OnError(GRPC_ERROR_REF(error));
- }
- }
- for (const auto& p : route_config_map_) {
- const RouteConfigState& route_config_state = p.second;
- for (const auto& p : route_config_state.watchers) {
- p.first->OnError(GRPC_ERROR_REF(error));
- }
- }
- for (const auto& p : cluster_map_) {
- const ClusterState& cluster_state = p.second;
- for (const auto& p : cluster_state.watchers) {
- p.first->OnError(GRPC_ERROR_REF(error));
- }
- }
- for (const auto& p : endpoint_map_) {
- const EndpointState& endpoint_state = p.second;
- for (const auto& p : endpoint_state.watchers) {
- p.first->OnError(GRPC_ERROR_REF(error));
- }
- }
- GRPC_ERROR_UNREF(error);
-}
-
-XdsApi::ClusterLoadReportMap XdsClient::BuildLoadReportSnapshotLocked(
- bool send_all_clusters, const std::set<TString>& clusters) {
- XdsApi::ClusterLoadReportMap snapshot_map;
- for (auto load_report_it = load_report_map_.begin();
- load_report_it != load_report_map_.end();) {
- // Cluster key is cluster and EDS service name.
- const auto& cluster_key = load_report_it->first;
- LoadReportState& load_report = load_report_it->second;
- // If the CDS response for a cluster indicates to use LRS but the
- // LRS server does not say that it wants reports for this cluster,
- // then we'll have stats objects here whose data we're not going to
- // include in the load report. However, we still need to clear out
- // the data from the stats objects, so that if the LRS server starts
- // asking for the data in the future, we don't incorrectly include
- // data from previous reporting intervals in that future report.
- const bool record_stats =
- send_all_clusters || clusters.find(cluster_key.first) != clusters.end();
- XdsApi::ClusterLoadReport snapshot;
- // Aggregate drop stats.
- snapshot.dropped_requests = std::move(load_report.deleted_drop_stats);
- for (auto& drop_stats : load_report.drop_stats) {
- auto dropped_requests = drop_stats->GetSnapshotAndReset();
- snapshot.dropped_requests += dropped_requests;
- }
- // Aggregate locality stats.
- for (auto it = load_report.locality_stats.begin();
- it != load_report.locality_stats.end();) {
- const RefCountedPtr<XdsLocalityName>& locality_name = it->first;
- auto& locality_state = it->second;
- XdsClusterLocalityStats::Snapshot& locality_snapshot =
- snapshot.locality_stats[locality_name];
- for (auto& locality_stats : locality_state.locality_stats) {
- locality_snapshot += locality_stats->GetSnapshotAndReset();
- }
- // Add final snapshots from recently deleted locality stats objects.
- for (auto& deleted_locality_stats :
- locality_state.deleted_locality_stats) {
- locality_snapshot += deleted_locality_stats;
- }
- locality_state.deleted_locality_stats.clear();
- // If the only thing left in this entry was final snapshots from
- // deleted locality stats objects, remove the entry.
- if (locality_state.locality_stats.empty()) {
- it = load_report.locality_stats.erase(it);
- } else {
- ++it;
- }
- }
- if (record_stats) {
- // Compute load report interval.
- const grpc_millis now = ExecCtx::Get()->Now();
- snapshot.load_report_interval = now - load_report.last_report_time;
- load_report.last_report_time = now;
- // Record snapshot.
- snapshot_map[cluster_key] = std::move(snapshot);
- }
- // If the only thing left in this entry was final snapshots from
- // deleted stats objects, remove the entry.
- if (load_report.locality_stats.empty() && load_report.drop_stats.empty()) {
- load_report_it = load_report_map_.erase(load_report_it);
- } else {
- ++load_report_it;
- }
- }
- return snapshot_map;
-}
-
-//
-// accessors for global state
-//
-
-void XdsClientGlobalInit() { g_mu = new Mutex; }
-
-void XdsClientGlobalShutdown() {
- delete g_mu;
- g_mu = nullptr;
-}
-
-RefCountedPtr<XdsClient> XdsClient::GetOrCreate(grpc_error** error) {
- MutexLock lock(g_mu);
- if (g_xds_client != nullptr) {
- auto xds_client = g_xds_client->RefIfNonZero();
- if (xds_client != nullptr) return xds_client;
- }
- auto xds_client = MakeRefCounted<XdsClient>(error);
- g_xds_client = xds_client.get();
- return xds_client;
-}
-
-namespace internal {
-
-void SetXdsChannelArgsForTest(grpc_channel_args* args) {
- MutexLock lock(g_mu);
- g_channel_args = args;
-}
-
-void UnsetGlobalXdsClientForTest() {
- MutexLock lock(g_mu);
- g_xds_client = nullptr;
-}
-
-} // namespace internal
-
-} // namespace grpc_core
+/*
+ *
+ * Copyright 2018 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <grpc/support/port_platform.h>
+
+#include <inttypes.h>
+#include <limits.h>
+#include <string.h>
+
+#include "y_absl/container/inlined_vector.h"
+#include "y_absl/strings/str_format.h"
+#include "y_absl/strings/str_join.h"
+#include "y_absl/strings/string_view.h"
+
+#include <grpc/byte_buffer_reader.h>
+#include <grpc/grpc.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/time.h>
+
+#include "src/core/ext/filters/client_channel/client_channel.h"
+#include "src/core/ext/filters/client_channel/service_config.h"
+#include "src/core/ext/xds/xds_api.h"
+#include "src/core/ext/xds/xds_channel_args.h"
+#include "src/core/ext/xds/xds_client.h"
+#include "src/core/ext/xds/xds_client_stats.h"
+#include "src/core/lib/backoff/backoff.h"
+#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/channel/channel_stack.h"
+#include "src/core/lib/gpr/string.h"
+#include "src/core/lib/gprpp/map.h"
+#include "src/core/lib/gprpp/memory.h"
+#include "src/core/lib/gprpp/orphanable.h"
+#include "src/core/lib/gprpp/ref_counted_ptr.h"
+#include "src/core/lib/gprpp/sync.h"
+#include "src/core/lib/iomgr/sockaddr.h"
+#include "src/core/lib/iomgr/sockaddr_utils.h"
+#include "src/core/lib/iomgr/timer.h"
+#include "src/core/lib/security/credentials/credentials.h"
+#include "src/core/lib/security/credentials/fake/fake_credentials.h"
+#include "src/core/lib/slice/slice_internal.h"
+#include "src/core/lib/slice/slice_string_helpers.h"
+#include "src/core/lib/surface/call.h"
+#include "src/core/lib/surface/channel.h"
+#include "src/core/lib/surface/channel_init.h"
+#include "src/core/lib/transport/static_metadata.h"
+
+#define GRPC_XDS_INITIAL_CONNECT_BACKOFF_SECONDS 1
+#define GRPC_XDS_RECONNECT_BACKOFF_MULTIPLIER 1.6
+#define GRPC_XDS_RECONNECT_MAX_BACKOFF_SECONDS 120
+#define GRPC_XDS_RECONNECT_JITTER 0.2
+#define GRPC_XDS_MIN_CLIENT_LOAD_REPORTING_INTERVAL_MS 1000
+
+namespace grpc_core {
+
+TraceFlag grpc_xds_client_trace(false, "xds_client");
+
+namespace {
+
+Mutex* g_mu = nullptr;
+const grpc_channel_args* g_channel_args = nullptr;
+XdsClient* g_xds_client = nullptr;
+
+} // namespace
+
+//
+// Internal class declarations
+//
+
+// An xds call wrapper that can restart a call upon failure. Holds a ref to
+// the xds channel. The template parameter is the kind of wrapped xds call.
+template <typename T>
+class XdsClient::ChannelState::RetryableCall
+ : public InternallyRefCounted<RetryableCall<T>> {
+ public:
+ explicit RetryableCall(RefCountedPtr<ChannelState> chand);
+
+ void Orphan() override;
+
+ void OnCallFinishedLocked();
+
+ T* calld() const { return calld_.get(); }
+ ChannelState* chand() const { return chand_.get(); }
+
+ bool IsCurrentCallOnChannel() const;
+
+ private:
+ void StartNewCallLocked();
+ void StartRetryTimerLocked();
+ static void OnRetryTimer(void* arg, grpc_error* error);
+ void OnRetryTimerLocked(grpc_error* error);
+
+ // The wrapped xds call that talks to the xds server. It's instantiated
+ // every time we start a new call. It's null during call retry backoff.
+ OrphanablePtr<T> calld_;
+ // The owning xds channel.
+ RefCountedPtr<ChannelState> chand_;
+
+ // Retry state.
+ BackOff backoff_;
+ grpc_timer retry_timer_;
+ grpc_closure on_retry_timer_;
+ bool retry_timer_callback_pending_ = false;
+
+ bool shutting_down_ = false;
+};
+
+// Contains an ADS call to the xds server.
+class XdsClient::ChannelState::AdsCallState
+ : public InternallyRefCounted<AdsCallState> {
+ public:
+ // The ctor and dtor should not be used directly.
+ explicit AdsCallState(RefCountedPtr<RetryableCall<AdsCallState>> parent);
+ ~AdsCallState() override;
+
+ void Orphan() override;
+
+ RetryableCall<AdsCallState>* parent() const { return parent_.get(); }
+ ChannelState* chand() const { return parent_->chand(); }
+ XdsClient* xds_client() const { return chand()->xds_client(); }
+ bool seen_response() const { return seen_response_; }
+
+ void Subscribe(const TString& type_url, const TString& name);
+ void Unsubscribe(const TString& type_url, const TString& name,
+ bool delay_unsubscription);
+
+ bool HasSubscribedResources() const;
+
+ private:
+ class ResourceState : public InternallyRefCounted<ResourceState> {
+ public:
+ ResourceState(const TString& type_url, const TString& name)
+ : type_url_(type_url), name_(name) {
+ GRPC_CLOSURE_INIT(&timer_callback_, OnTimer, this,
+ grpc_schedule_on_exec_ctx);
+ }
+
+ void Orphan() override {
+ Finish();
+ Unref(DEBUG_LOCATION, "Orphan");
+ }
+
+ void Start(RefCountedPtr<AdsCallState> ads_calld) {
+ if (sent_) return;
+ sent_ = true;
+ ads_calld_ = std::move(ads_calld);
+ Ref(DEBUG_LOCATION, "timer").release();
+ timer_pending_ = true;
+ grpc_timer_init(
+ &timer_,
+ ExecCtx::Get()->Now() + ads_calld_->xds_client()->request_timeout_,
+ &timer_callback_);
+ }
+
+ void Finish() {
+ if (timer_pending_) {
+ grpc_timer_cancel(&timer_);
+ timer_pending_ = false;
+ }
+ }
+
+ private:
+ static void OnTimer(void* arg, grpc_error* error) {
+ ResourceState* self = static_cast<ResourceState*>(arg);
+ {
+ MutexLock lock(&self->ads_calld_->xds_client()->mu_);
+ self->OnTimerLocked(GRPC_ERROR_REF(error));
+ }
+ self->ads_calld_.reset();
+ self->Unref(DEBUG_LOCATION, "timer");
+ }
+
+ void OnTimerLocked(grpc_error* error) {
+ if (error == GRPC_ERROR_NONE && timer_pending_) {
+ timer_pending_ = false;
+ grpc_error* watcher_error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrFormat(
+ "timeout obtaining resource {type=%s name=%s} from xds server",
+ type_url_, name_)
+ .c_str());
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
+ gpr_log(GPR_INFO, "[xds_client %p] %s", ads_calld_->xds_client(),
+ grpc_error_string(watcher_error));
+ }
+ if (type_url_ == XdsApi::kLdsTypeUrl) {
+ ListenerState& state = ads_calld_->xds_client()->listener_map_[name_];
+ for (const auto& p : state.watchers) {
+ p.first->OnError(GRPC_ERROR_REF(watcher_error));
+ }
+ } else if (type_url_ == XdsApi::kRdsTypeUrl) {
+ RouteConfigState& state =
+ ads_calld_->xds_client()->route_config_map_[name_];
+ for (const auto& p : state.watchers) {
+ p.first->OnError(GRPC_ERROR_REF(watcher_error));
+ }
+ } else if (type_url_ == XdsApi::kCdsTypeUrl) {
+ ClusterState& state = ads_calld_->xds_client()->cluster_map_[name_];
+ for (const auto& p : state.watchers) {
+ p.first->OnError(GRPC_ERROR_REF(watcher_error));
+ }
+ } else if (type_url_ == XdsApi::kEdsTypeUrl) {
+ EndpointState& state = ads_calld_->xds_client()->endpoint_map_[name_];
+ for (const auto& p : state.watchers) {
+ p.first->OnError(GRPC_ERROR_REF(watcher_error));
+ }
+ } else {
+ GPR_UNREACHABLE_CODE(return );
+ }
+ GRPC_ERROR_UNREF(watcher_error);
+ }
+ GRPC_ERROR_UNREF(error);
+ }
+
+ const TString type_url_;
+ const TString name_;
+
+ RefCountedPtr<AdsCallState> ads_calld_;
+ bool sent_ = false;
+ bool timer_pending_ = false;
+ grpc_timer timer_;
+ grpc_closure timer_callback_;
+ };
+
+ struct ResourceTypeState {
+ ~ResourceTypeState() { GRPC_ERROR_UNREF(error); }
+
+ // Version, nonce, and error for this resource type.
+ TString version;
+ TString nonce;
+ grpc_error* error = GRPC_ERROR_NONE;
+
+ // Subscribed resources of this type.
+ std::map<TString /* name */, OrphanablePtr<ResourceState>>
+ subscribed_resources;
+ };
+
+ void SendMessageLocked(const TString& type_url);
+
+ void AcceptLdsUpdate(XdsApi::LdsUpdateMap lds_update_map);
+ void AcceptRdsUpdate(XdsApi::RdsUpdateMap rds_update_map);
+ void AcceptCdsUpdate(XdsApi::CdsUpdateMap cds_update_map);
+ void AcceptEdsUpdate(XdsApi::EdsUpdateMap eds_update_map);
+
+ static void OnRequestSent(void* arg, grpc_error* error);
+ void OnRequestSentLocked(grpc_error* error);
+ static void OnResponseReceived(void* arg, grpc_error* error);
+ bool OnResponseReceivedLocked();
+ static void OnStatusReceived(void* arg, grpc_error* error);
+ void OnStatusReceivedLocked(grpc_error* error);
+
+ bool IsCurrentCallOnChannel() const;
+
+ std::set<y_absl::string_view> ResourceNamesForRequest(
+ const TString& type_url);
+
+ // The owning RetryableCall<>.
+ RefCountedPtr<RetryableCall<AdsCallState>> parent_;
+
+ bool sent_initial_message_ = false;
+ bool seen_response_ = false;
+
+ // Always non-NULL.
+ grpc_call* call_;
+
+ // recv_initial_metadata
+ grpc_metadata_array initial_metadata_recv_;
+
+ // send_message
+ grpc_byte_buffer* send_message_payload_ = nullptr;
+ grpc_closure on_request_sent_;
+
+ // recv_message
+ grpc_byte_buffer* recv_message_payload_ = nullptr;
+ grpc_closure on_response_received_;
+
+ // recv_trailing_metadata
+ grpc_metadata_array trailing_metadata_recv_;
+ grpc_status_code status_code_;
+ grpc_slice status_details_;
+ grpc_closure on_status_received_;
+
+ // Resource types for which requests need to be sent.
+ std::set<TString /*type_url*/> buffered_requests_;
+
+ // State for each resource type.
+ std::map<TString /*type_url*/, ResourceTypeState> state_map_;
+};
+
+// Contains an LRS call to the xds server.
+class XdsClient::ChannelState::LrsCallState
+ : public InternallyRefCounted<LrsCallState> {
+ public:
+ // The ctor and dtor should not be used directly.
+ explicit LrsCallState(RefCountedPtr<RetryableCall<LrsCallState>> parent);
+ ~LrsCallState() override;
+
+ void Orphan() override;
+
+ void MaybeStartReportingLocked();
+
+ RetryableCall<LrsCallState>* parent() { return parent_.get(); }
+ ChannelState* chand() const { return parent_->chand(); }
+ XdsClient* xds_client() const { return chand()->xds_client(); }
+ bool seen_response() const { return seen_response_; }
+
+ private:
+ // Reports client-side load stats according to a fixed interval.
+ class Reporter : public InternallyRefCounted<Reporter> {
+ public:
+ Reporter(RefCountedPtr<LrsCallState> parent, grpc_millis report_interval)
+ : parent_(std::move(parent)), report_interval_(report_interval) {
+ GRPC_CLOSURE_INIT(&on_next_report_timer_, OnNextReportTimer, this,
+ grpc_schedule_on_exec_ctx);
+ GRPC_CLOSURE_INIT(&on_report_done_, OnReportDone, this,
+ grpc_schedule_on_exec_ctx);
+ ScheduleNextReportLocked();
+ }
+
+ void Orphan() override;
+
+ private:
+ void ScheduleNextReportLocked();
+ static void OnNextReportTimer(void* arg, grpc_error* error);
+ bool OnNextReportTimerLocked(grpc_error* error);
+ void SendReportLocked();
+ static void OnReportDone(void* arg, grpc_error* error);
+ bool OnReportDoneLocked(grpc_error* error);
+
+ bool IsCurrentReporterOnCall() const {
+ return this == parent_->reporter_.get();
+ }
+ XdsClient* xds_client() const { return parent_->xds_client(); }
+
+ // The owning LRS call.
+ RefCountedPtr<LrsCallState> parent_;
+
+ // The load reporting state.
+ const grpc_millis report_interval_;
+ bool last_report_counters_were_zero_ = false;
+ bool next_report_timer_callback_pending_ = false;
+ grpc_timer next_report_timer_;
+ grpc_closure on_next_report_timer_;
+ grpc_closure on_report_done_;
+ };
+
+ static void OnInitialRequestSent(void* arg, grpc_error* error);
+ void OnInitialRequestSentLocked();
+ static void OnResponseReceived(void* arg, grpc_error* error);
+ bool OnResponseReceivedLocked();
+ static void OnStatusReceived(void* arg, grpc_error* error);
+ void OnStatusReceivedLocked(grpc_error* error);
+
+ bool IsCurrentCallOnChannel() const;
+
+ // The owning RetryableCall<>.
+ RefCountedPtr<RetryableCall<LrsCallState>> parent_;
+ bool seen_response_ = false;
+
+ // Always non-NULL.
+ grpc_call* call_;
+
+ // recv_initial_metadata
+ grpc_metadata_array initial_metadata_recv_;
+
+ // send_message
+ grpc_byte_buffer* send_message_payload_ = nullptr;
+ grpc_closure on_initial_request_sent_;
+
+ // recv_message
+ grpc_byte_buffer* recv_message_payload_ = nullptr;
+ grpc_closure on_response_received_;
+
+ // recv_trailing_metadata
+ grpc_metadata_array trailing_metadata_recv_;
+ grpc_status_code status_code_;
+ grpc_slice status_details_;
+ grpc_closure on_status_received_;
+
+ // Load reporting state.
+ bool send_all_clusters_ = false;
+ std::set<TString> cluster_names_; // Asked for by the LRS server.
+ grpc_millis load_reporting_interval_ = 0;
+ OrphanablePtr<Reporter> reporter_;
+};
+
+//
+// XdsClient::ChannelState::StateWatcher
+//
+
+class XdsClient::ChannelState::StateWatcher
+ : public AsyncConnectivityStateWatcherInterface {
+ public:
+ explicit StateWatcher(RefCountedPtr<ChannelState> parent)
+ : parent_(std::move(parent)) {}
+
+ private:
+ void OnConnectivityStateChange(grpc_connectivity_state new_state,
+ const y_absl::Status& status) override {
+ MutexLock lock(&parent_->xds_client_->mu_);
+ if (!parent_->shutting_down_ &&
+ new_state == GRPC_CHANNEL_TRANSIENT_FAILURE) {
+ // In TRANSIENT_FAILURE. Notify all watchers of error.
+ gpr_log(GPR_INFO,
+ "[xds_client %p] xds channel in state:TRANSIENT_FAILURE "
+ "status_message:(%s)",
+ parent_->xds_client(), status.ToString().c_str());
+ parent_->xds_client()->NotifyOnErrorLocked(
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "xds channel in TRANSIENT_FAILURE"));
+ }
+ }
+
+ RefCountedPtr<ChannelState> parent_;
+};
+
+//
+// XdsClient::ChannelState
+//
+
+XdsClient::ChannelState::ChannelState(WeakRefCountedPtr<XdsClient> xds_client,
+ grpc_channel* channel)
+ : InternallyRefCounted<ChannelState>(&grpc_xds_client_trace),
+ xds_client_(std::move(xds_client)),
+ channel_(channel) {
+ GPR_ASSERT(channel_ != nullptr);
+ StartConnectivityWatchLocked();
+}
+
+XdsClient::ChannelState::~ChannelState() {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
+ gpr_log(GPR_INFO, "[xds_client %p] Destroying xds channel %p", xds_client(),
+ this);
+ }
+ grpc_channel_destroy(channel_);
+ xds_client_.reset(DEBUG_LOCATION, "ChannelState");
+}
+
+void XdsClient::ChannelState::Orphan() {
+ shutting_down_ = true;
+ CancelConnectivityWatchLocked();
+ ads_calld_.reset();
+ lrs_calld_.reset();
+ Unref(DEBUG_LOCATION, "ChannelState+orphaned");
+}
+
+XdsClient::ChannelState::AdsCallState* XdsClient::ChannelState::ads_calld()
+ const {
+ return ads_calld_->calld();
+}
+
+XdsClient::ChannelState::LrsCallState* XdsClient::ChannelState::lrs_calld()
+ const {
+ return lrs_calld_->calld();
+}
+
+bool XdsClient::ChannelState::HasActiveAdsCall() const {
+ return ads_calld_->calld() != nullptr;
+}
+
+void XdsClient::ChannelState::MaybeStartLrsCall() {
+ if (lrs_calld_ != nullptr) return;
+ lrs_calld_.reset(
+ new RetryableCall<LrsCallState>(Ref(DEBUG_LOCATION, "ChannelState+lrs")));
+}
+
+void XdsClient::ChannelState::StopLrsCall() { lrs_calld_.reset(); }
+
+void XdsClient::ChannelState::StartConnectivityWatchLocked() {
+ grpc_channel_element* client_channel_elem =
+ grpc_channel_stack_last_element(grpc_channel_get_channel_stack(channel_));
+ GPR_ASSERT(client_channel_elem->filter == &grpc_client_channel_filter);
+ watcher_ = new StateWatcher(Ref(DEBUG_LOCATION, "ChannelState+watch"));
+ grpc_client_channel_start_connectivity_watch(
+ client_channel_elem, GRPC_CHANNEL_IDLE,
+ OrphanablePtr<AsyncConnectivityStateWatcherInterface>(watcher_));
+}
+
+void XdsClient::ChannelState::CancelConnectivityWatchLocked() {
+ grpc_channel_element* client_channel_elem =
+ grpc_channel_stack_last_element(grpc_channel_get_channel_stack(channel_));
+ GPR_ASSERT(client_channel_elem->filter == &grpc_client_channel_filter);
+ grpc_client_channel_stop_connectivity_watch(client_channel_elem, watcher_);
+}
+
+void XdsClient::ChannelState::Subscribe(const TString& type_url,
+ const TString& name) {
+ if (ads_calld_ == nullptr) {
+ // Start the ADS call if this is the first request.
+ ads_calld_.reset(new RetryableCall<AdsCallState>(
+ Ref(DEBUG_LOCATION, "ChannelState+ads")));
+ // Note: AdsCallState's ctor will automatically subscribe to all
+ // resources that the XdsClient already has watchers for, so we can
+ // return here.
+ return;
+ }
+ // If the ADS call is in backoff state, we don't need to do anything now
+ // because when the call is restarted it will resend all necessary requests.
+ if (ads_calld() == nullptr) return;
+ // Subscribe to this resource if the ADS call is active.
+ ads_calld()->Subscribe(type_url, name);
+}
+
+void XdsClient::ChannelState::Unsubscribe(const TString& type_url,
+ const TString& name,
+ bool delay_unsubscription) {
+ if (ads_calld_ != nullptr) {
+ auto* calld = ads_calld_->calld();
+ if (calld != nullptr) {
+ calld->Unsubscribe(type_url, name, delay_unsubscription);
+ if (!calld->HasSubscribedResources()) ads_calld_.reset();
+ }
+ }
+}
+
+//
+// XdsClient::ChannelState::RetryableCall<>
+//
+
+template <typename T>
+XdsClient::ChannelState::RetryableCall<T>::RetryableCall(
+ RefCountedPtr<ChannelState> chand)
+ : chand_(std::move(chand)),
+ backoff_(
+ BackOff::Options()
+ .set_initial_backoff(GRPC_XDS_INITIAL_CONNECT_BACKOFF_SECONDS *
+ 1000)
+ .set_multiplier(GRPC_XDS_RECONNECT_BACKOFF_MULTIPLIER)
+ .set_jitter(GRPC_XDS_RECONNECT_JITTER)
+ .set_max_backoff(GRPC_XDS_RECONNECT_MAX_BACKOFF_SECONDS * 1000)) {
+ // Closure Initialization
+ GRPC_CLOSURE_INIT(&on_retry_timer_, OnRetryTimer, this,
+ grpc_schedule_on_exec_ctx);
+ StartNewCallLocked();
+}
+
+template <typename T>
+void XdsClient::ChannelState::RetryableCall<T>::Orphan() {
+ shutting_down_ = true;
+ calld_.reset();
+ if (retry_timer_callback_pending_) grpc_timer_cancel(&retry_timer_);
+ this->Unref(DEBUG_LOCATION, "RetryableCall+orphaned");
+}
+
+template <typename T>
+void XdsClient::ChannelState::RetryableCall<T>::OnCallFinishedLocked() {
+ const bool seen_response = calld_->seen_response();
+ calld_.reset();
+ if (seen_response) {
+ // If we lost connection to the xds server, reset backoff and restart the
+ // call immediately.
+ backoff_.Reset();
+ StartNewCallLocked();
+ } else {
+ // If we failed to connect to the xds server, retry later.
+ StartRetryTimerLocked();
+ }
+}
+
+template <typename T>
+void XdsClient::ChannelState::RetryableCall<T>::StartNewCallLocked() {
+ if (shutting_down_) return;
+ GPR_ASSERT(chand_->channel_ != nullptr);
+ GPR_ASSERT(calld_ == nullptr);
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
+ gpr_log(GPR_INFO,
+ "[xds_client %p] Start new call from retryable call (chand: %p, "
+ "retryable call: %p)",
+ chand()->xds_client(), chand(), this);
+ }
+ calld_ = MakeOrphanable<T>(
+ this->Ref(DEBUG_LOCATION, "RetryableCall+start_new_call"));
+}
+
+template <typename T>
+void XdsClient::ChannelState::RetryableCall<T>::StartRetryTimerLocked() {
+ if (shutting_down_) return;
+ const grpc_millis next_attempt_time = backoff_.NextAttemptTime();
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
+ grpc_millis timeout = GPR_MAX(next_attempt_time - ExecCtx::Get()->Now(), 0);
+ gpr_log(GPR_INFO,
+ "[xds_client %p] Failed to connect to xds server (chand: %p) "
+ "retry timer will fire in %" PRId64 "ms.",
+ chand()->xds_client(), chand(), timeout);
+ }
+ this->Ref(DEBUG_LOCATION, "RetryableCall+retry_timer_start").release();
+ grpc_timer_init(&retry_timer_, next_attempt_time, &on_retry_timer_);
+ retry_timer_callback_pending_ = true;
+}
+
+template <typename T>
+void XdsClient::ChannelState::RetryableCall<T>::OnRetryTimer(
+ void* arg, grpc_error* error) {
+ RetryableCall* calld = static_cast<RetryableCall*>(arg);
+ {
+ MutexLock lock(&calld->chand_->xds_client()->mu_);
+ calld->OnRetryTimerLocked(GRPC_ERROR_REF(error));
+ }
+ calld->Unref(DEBUG_LOCATION, "RetryableCall+retry_timer_done");
+}
+
+template <typename T>
+void XdsClient::ChannelState::RetryableCall<T>::OnRetryTimerLocked(
+ grpc_error* error) {
+ retry_timer_callback_pending_ = false;
+ if (!shutting_down_ && error == GRPC_ERROR_NONE) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
+ gpr_log(
+ GPR_INFO,
+ "[xds_client %p] Retry timer fires (chand: %p, retryable call: %p)",
+ chand()->xds_client(), chand(), this);
+ }
+ StartNewCallLocked();
+ }
+ GRPC_ERROR_UNREF(error);
+}
+
+//
+// XdsClient::ChannelState::AdsCallState
+//
+
+XdsClient::ChannelState::AdsCallState::AdsCallState(
+ RefCountedPtr<RetryableCall<AdsCallState>> parent)
+ : InternallyRefCounted<AdsCallState>(&grpc_xds_client_trace),
+ parent_(std::move(parent)) {
+ // Init the ADS call. Note that the call will progress every time there's
+ // activity in xds_client()->interested_parties_, which is comprised of
+ // the polling entities from client_channel.
+ GPR_ASSERT(xds_client() != nullptr);
+ // Create a call with the specified method name.
+ const auto& method =
+ xds_client()->bootstrap_->server().ShouldUseV3()
+ ? GRPC_MDSTR_SLASH_ENVOY_DOT_SERVICE_DOT_DISCOVERY_DOT_V3_DOT_AGGREGATEDDISCOVERYSERVICE_SLASH_STREAMAGGREGATEDRESOURCES
+ : GRPC_MDSTR_SLASH_ENVOY_DOT_SERVICE_DOT_DISCOVERY_DOT_V2_DOT_AGGREGATEDDISCOVERYSERVICE_SLASH_STREAMAGGREGATEDRESOURCES;
+ call_ = grpc_channel_create_pollset_set_call(
+ chand()->channel_, nullptr, GRPC_PROPAGATE_DEFAULTS,
+ xds_client()->interested_parties_, method, nullptr,
+ GRPC_MILLIS_INF_FUTURE, nullptr);
+ GPR_ASSERT(call_ != nullptr);
+ // Init data associated with the call.
+ grpc_metadata_array_init(&initial_metadata_recv_);
+ grpc_metadata_array_init(&trailing_metadata_recv_);
+ // Start the call.
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
+ gpr_log(GPR_INFO,
+ "[xds_client %p] Starting ADS call (chand: %p, calld: %p, "
+ "call: %p)",
+ xds_client(), chand(), this, call_);
+ }
+ // Create the ops.
+ grpc_call_error call_error;
+ grpc_op ops[3];
+ memset(ops, 0, sizeof(ops));
+ // Op: send initial metadata.
+ grpc_op* op = ops;
+ op->op = GRPC_OP_SEND_INITIAL_METADATA;
+ op->data.send_initial_metadata.count = 0;
+ op->flags = GRPC_INITIAL_METADATA_WAIT_FOR_READY |
+ GRPC_INITIAL_METADATA_WAIT_FOR_READY_EXPLICITLY_SET;
+ op->reserved = nullptr;
+ op++;
+ call_error = grpc_call_start_batch_and_execute(call_, ops, (size_t)(op - ops),
+ nullptr);
+ GPR_ASSERT(GRPC_CALL_OK == call_error);
+ // Op: send request message.
+ GRPC_CLOSURE_INIT(&on_request_sent_, OnRequestSent, this,
+ grpc_schedule_on_exec_ctx);
+ for (const auto& p : xds_client()->listener_map_) {
+ Subscribe(XdsApi::kLdsTypeUrl, TString(p.first));
+ }
+ for (const auto& p : xds_client()->route_config_map_) {
+ Subscribe(XdsApi::kRdsTypeUrl, TString(p.first));
+ }
+ for (const auto& p : xds_client()->cluster_map_) {
+ Subscribe(XdsApi::kCdsTypeUrl, TString(p.first));
+ }
+ for (const auto& p : xds_client()->endpoint_map_) {
+ Subscribe(XdsApi::kEdsTypeUrl, TString(p.first));
+ }
+ // Op: recv initial metadata.
+ op = ops;
+ op->op = GRPC_OP_RECV_INITIAL_METADATA;
+ op->data.recv_initial_metadata.recv_initial_metadata =
+ &initial_metadata_recv_;
+ op->flags = 0;
+ op->reserved = nullptr;
+ op++;
+ // Op: recv response.
+ op->op = GRPC_OP_RECV_MESSAGE;
+ op->data.recv_message.recv_message = &recv_message_payload_;
+ op->flags = 0;
+ op->reserved = nullptr;
+ op++;
+ Ref(DEBUG_LOCATION, "ADS+OnResponseReceivedLocked").release();
+ GRPC_CLOSURE_INIT(&on_response_received_, OnResponseReceived, this,
+ grpc_schedule_on_exec_ctx);
+ call_error = grpc_call_start_batch_and_execute(call_, ops, (size_t)(op - ops),
+ &on_response_received_);
+ GPR_ASSERT(GRPC_CALL_OK == call_error);
+ // Op: recv server status.
+ op = ops;
+ op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+ op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv_;
+ op->data.recv_status_on_client.status = &status_code_;
+ op->data.recv_status_on_client.status_details = &status_details_;
+ op->flags = 0;
+ op->reserved = nullptr;
+ op++;
+ // This callback signals the end of the call, so it relies on the initial
+ // ref instead of a new ref. When it's invoked, it's the initial ref that is
+ // unreffed.
+ GRPC_CLOSURE_INIT(&on_status_received_, OnStatusReceived, this,
+ grpc_schedule_on_exec_ctx);
+ call_error = grpc_call_start_batch_and_execute(call_, ops, (size_t)(op - ops),
+ &on_status_received_);
+ GPR_ASSERT(GRPC_CALL_OK == call_error);
+}
+
+XdsClient::ChannelState::AdsCallState::~AdsCallState() {
+ grpc_metadata_array_destroy(&initial_metadata_recv_);
+ grpc_metadata_array_destroy(&trailing_metadata_recv_);
+ grpc_byte_buffer_destroy(send_message_payload_);
+ grpc_byte_buffer_destroy(recv_message_payload_);
+ grpc_slice_unref_internal(status_details_);
+ GPR_ASSERT(call_ != nullptr);
+ grpc_call_unref(call_);
+}
+
+void XdsClient::ChannelState::AdsCallState::Orphan() {
+ GPR_ASSERT(call_ != nullptr);
+ // If we are here because xds_client wants to cancel the call,
+ // on_status_received_ will complete the cancellation and clean up. Otherwise,
+ // we are here because xds_client has to orphan a failed call, then the
+ // following cancellation will be a no-op.
+ grpc_call_cancel_internal(call_);
+ state_map_.clear();
+ // Note that the initial ref is hold by on_status_received_. So the
+ // corresponding unref happens in on_status_received_ instead of here.
+}
+
+void XdsClient::ChannelState::AdsCallState::SendMessageLocked(
+ const TString& type_url) {
+ // Buffer message sending if an existing message is in flight.
+ if (send_message_payload_ != nullptr) {
+ buffered_requests_.insert(type_url);
+ return;
+ }
+ auto& state = state_map_[type_url];
+ grpc_slice request_payload_slice;
+ std::set<y_absl::string_view> resource_names =
+ ResourceNamesForRequest(type_url);
+ request_payload_slice = xds_client()->api_.CreateAdsRequest(
+ type_url, resource_names, state.version, state.nonce,
+ GRPC_ERROR_REF(state.error), !sent_initial_message_);
+ if (type_url != XdsApi::kLdsTypeUrl && type_url != XdsApi::kRdsTypeUrl &&
+ type_url != XdsApi::kCdsTypeUrl && type_url != XdsApi::kEdsTypeUrl) {
+ state_map_.erase(type_url);
+ }
+ sent_initial_message_ = true;
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
+ gpr_log(GPR_INFO,
+ "[xds_client %p] sending ADS request: type=%s version=%s nonce=%s "
+ "error=%s resources=%s",
+ xds_client(), type_url.c_str(), state.version.c_str(),
+ state.nonce.c_str(), grpc_error_string(state.error),
+ y_absl::StrJoin(resource_names, " ").c_str());
+ }
+ GRPC_ERROR_UNREF(state.error);
+ state.error = GRPC_ERROR_NONE;
+ // Create message payload.
+ send_message_payload_ =
+ grpc_raw_byte_buffer_create(&request_payload_slice, 1);
+ grpc_slice_unref_internal(request_payload_slice);
+ // Send the message.
+ grpc_op op;
+ memset(&op, 0, sizeof(op));
+ op.op = GRPC_OP_SEND_MESSAGE;
+ op.data.send_message.send_message = send_message_payload_;
+ Ref(DEBUG_LOCATION, "ADS+OnRequestSentLocked").release();
+ GRPC_CLOSURE_INIT(&on_request_sent_, OnRequestSent, this,
+ grpc_schedule_on_exec_ctx);
+ grpc_call_error call_error =
+ grpc_call_start_batch_and_execute(call_, &op, 1, &on_request_sent_);
+ if (GPR_UNLIKELY(call_error != GRPC_CALL_OK)) {
+ gpr_log(GPR_ERROR,
+ "[xds_client %p] calld=%p call_error=%d sending ADS message",
+ xds_client(), this, call_error);
+ GPR_ASSERT(GRPC_CALL_OK == call_error);
+ }
+}
+
+void XdsClient::ChannelState::AdsCallState::Subscribe(
+ const TString& type_url, const TString& name) {
+ auto& state = state_map_[type_url].subscribed_resources[name];
+ if (state == nullptr) {
+ state = MakeOrphanable<ResourceState>(type_url, name);
+ SendMessageLocked(type_url);
+ }
+}
+
+void XdsClient::ChannelState::AdsCallState::Unsubscribe(
+ const TString& type_url, const TString& name,
+ bool delay_unsubscription) {
+ state_map_[type_url].subscribed_resources.erase(name);
+ if (!delay_unsubscription) SendMessageLocked(type_url);
+}
+
+bool XdsClient::ChannelState::AdsCallState::HasSubscribedResources() const {
+ for (const auto& p : state_map_) {
+ if (!p.second.subscribed_resources.empty()) return true;
+ }
+ return false;
+}
+
+void XdsClient::ChannelState::AdsCallState::AcceptLdsUpdate(
+ XdsApi::LdsUpdateMap lds_update_map) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
+ gpr_log(GPR_INFO,
+ "[xds_client %p] LDS update received containing %" PRIuPTR
+ " resources",
+ xds_client(), lds_update_map.size());
+ }
+ auto& lds_state = state_map_[XdsApi::kLdsTypeUrl];
+ std::set<TString> rds_resource_names_seen;
+ for (auto& p : lds_update_map) {
+ const TString& listener_name = p.first;
+ XdsApi::LdsUpdate& lds_update = p.second;
+ auto& state = lds_state.subscribed_resources[listener_name];
+ if (state != nullptr) state->Finish();
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
+ gpr_log(GPR_INFO, "[xds_client %p] LDS resource %s: route_config_name=%s",
+ xds_client(), listener_name.c_str(),
+ (!lds_update.route_config_name.empty()
+ ? lds_update.route_config_name.c_str()
+ : "<inlined>"));
+ if (lds_update.rds_update.has_value()) {
+ gpr_log(GPR_INFO, "RouteConfiguration: %s",
+ lds_update.rds_update->ToString().c_str());
+ }
+ }
+ // Record the RDS resource names seen.
+ if (!lds_update.route_config_name.empty()) {
+ rds_resource_names_seen.insert(lds_update.route_config_name);
+ }
+ // Ignore identical update.
+ ListenerState& listener_state = xds_client()->listener_map_[listener_name];
+ if (listener_state.update.has_value() &&
+ *listener_state.update == lds_update) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
+ gpr_log(GPR_INFO,
+ "[xds_client %p] LDS update for %s identical to current, "
+ "ignoring.",
+ xds_client(), listener_name.c_str());
+ }
+ continue;
+ }
+ // Update the listener state.
+ listener_state.update = std::move(lds_update);
+ // Notify watchers.
+ for (const auto& p : listener_state.watchers) {
+ p.first->OnListenerChanged(*listener_state.update);
+ }
+ }
+ // For any subscribed resource that is not present in the update,
+ // remove it from the cache and notify watchers that it does not exist.
+ for (const auto& p : lds_state.subscribed_resources) {
+ const TString& listener_name = p.first;
+ if (lds_update_map.find(listener_name) == lds_update_map.end()) {
+ ListenerState& listener_state =
+ xds_client()->listener_map_[listener_name];
+ // If the resource was newly requested but has not yet been received,
+ // we don't want to generate an error for the watchers, because this LDS
+ // response may be in reaction to an earlier request that did not yet
+ // request the new resource, so its absence from the response does not
+ // necessarily indicate that the resource does not exist.
+ // For that case, we rely on the request timeout instead.
+ if (!listener_state.update.has_value()) continue;
+ listener_state.update.reset();
+ for (const auto& p : listener_state.watchers) {
+ p.first->OnResourceDoesNotExist();
+ }
+ }
+ }
+ // For any RDS resource that is no longer referred to by any LDS
+ // resources, remove it from the cache and notify watchers that it
+ // does not exist.
+ auto& rds_state = state_map_[XdsApi::kRdsTypeUrl];
+ for (const auto& p : rds_state.subscribed_resources) {
+ const TString& rds_resource_name = p.first;
+ if (rds_resource_names_seen.find(rds_resource_name) ==
+ rds_resource_names_seen.end()) {
+ RouteConfigState& route_config_state =
+ xds_client()->route_config_map_[rds_resource_name];
+ route_config_state.update.reset();
+ for (const auto& p : route_config_state.watchers) {
+ p.first->OnResourceDoesNotExist();
+ }
+ }
+ }
+}
+
+void XdsClient::ChannelState::AdsCallState::AcceptRdsUpdate(
+ XdsApi::RdsUpdateMap rds_update_map) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
+ gpr_log(GPR_INFO,
+ "[xds_client %p] RDS update received containing %" PRIuPTR
+ " resources",
+ xds_client(), rds_update_map.size());
+ }
+ auto& rds_state = state_map_[XdsApi::kRdsTypeUrl];
+ for (auto& p : rds_update_map) {
+ const TString& route_config_name = p.first;
+ XdsApi::RdsUpdate& rds_update = p.second;
+ auto& state = rds_state.subscribed_resources[route_config_name];
+ if (state != nullptr) state->Finish();
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
+ gpr_log(GPR_INFO, "[xds_client %p] RDS resource:\n%s", xds_client(),
+ rds_update.ToString().c_str());
+ }
+ RouteConfigState& route_config_state =
+ xds_client()->route_config_map_[route_config_name];
+ // Ignore identical update.
+ if (route_config_state.update.has_value() &&
+ *route_config_state.update == rds_update) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
+ gpr_log(GPR_INFO,
+ "[xds_client %p] RDS resource identical to current, ignoring",
+ xds_client());
+ }
+ continue;
+ }
+ // Update the cache.
+ route_config_state.update = std::move(rds_update);
+ // Notify all watchers.
+ for (const auto& p : route_config_state.watchers) {
+ p.first->OnRouteConfigChanged(*route_config_state.update);
+ }
+ }
+}
+
+void XdsClient::ChannelState::AdsCallState::AcceptCdsUpdate(
+ XdsApi::CdsUpdateMap cds_update_map) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
+ gpr_log(GPR_INFO,
+ "[xds_client %p] CDS update received containing %" PRIuPTR
+ " resources",
+ xds_client(), cds_update_map.size());
+ }
+ auto& cds_state = state_map_[XdsApi::kCdsTypeUrl];
+ std::set<TString> eds_resource_names_seen;
+ for (auto& p : cds_update_map) {
+ const char* cluster_name = p.first.c_str();
+ XdsApi::CdsUpdate& cds_update = p.second;
+ auto& state = cds_state.subscribed_resources[cluster_name];
+ if (state != nullptr) state->Finish();
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
+ gpr_log(GPR_INFO,
+ "[xds_client %p] cluster=%s: eds_service_name=%s, "
+ "lrs_load_reporting_server_name=%s",
+ xds_client(), cluster_name, cds_update.eds_service_name.c_str(),
+ cds_update.lrs_load_reporting_server_name.has_value()
+ ? cds_update.lrs_load_reporting_server_name.value().c_str()
+ : "(N/A)");
+ }
+ // Record the EDS resource names seen.
+ eds_resource_names_seen.insert(cds_update.eds_service_name.empty()
+ ? cluster_name
+ : cds_update.eds_service_name);
+ // Ignore identical update.
+ ClusterState& cluster_state = xds_client()->cluster_map_[cluster_name];
+ if (cluster_state.update.has_value() &&
+ *cluster_state.update == cds_update) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
+ gpr_log(GPR_INFO,
+ "[xds_client %p] CDS update identical to current, ignoring.",
+ xds_client());
+ }
+ continue;
+ }
+ // Update the cluster state.
+ cluster_state.update = std::move(cds_update);
+ // Notify all watchers.
+ for (const auto& p : cluster_state.watchers) {
+ p.first->OnClusterChanged(cluster_state.update.value());
+ }
+ }
+ // For any subscribed resource that is not present in the update,
+ // remove it from the cache and notify watchers that it does not exist.
+ for (const auto& p : cds_state.subscribed_resources) {
+ const TString& cluster_name = p.first;
+ if (cds_update_map.find(cluster_name) == cds_update_map.end()) {
+ ClusterState& cluster_state = xds_client()->cluster_map_[cluster_name];
+ // If the resource was newly requested but has not yet been received,
+ // we don't want to generate an error for the watchers, because this CDS
+ // response may be in reaction to an earlier request that did not yet
+ // request the new resource, so its absence from the response does not
+ // necessarily indicate that the resource does not exist.
+ // For that case, we rely on the request timeout instead.
+ if (!cluster_state.update.has_value()) continue;
+ cluster_state.update.reset();
+ for (const auto& p : cluster_state.watchers) {
+ p.first->OnResourceDoesNotExist();
+ }
+ }
+ }
+ // For any EDS resource that is no longer referred to by any CDS
+ // resources, remove it from the cache and notify watchers that it
+ // does not exist.
+ auto& eds_state = state_map_[XdsApi::kEdsTypeUrl];
+ for (const auto& p : eds_state.subscribed_resources) {
+ const TString& eds_resource_name = p.first;
+ if (eds_resource_names_seen.find(eds_resource_name) ==
+ eds_resource_names_seen.end()) {
+ EndpointState& endpoint_state =
+ xds_client()->endpoint_map_[eds_resource_name];
+ endpoint_state.update.reset();
+ for (const auto& p : endpoint_state.watchers) {
+ p.first->OnResourceDoesNotExist();
+ }
+ }
+ }
+}
+
+void XdsClient::ChannelState::AdsCallState::AcceptEdsUpdate(
+ XdsApi::EdsUpdateMap eds_update_map) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
+ gpr_log(GPR_INFO,
+ "[xds_client %p] EDS update received containing %" PRIuPTR
+ " resources",
+ xds_client(), eds_update_map.size());
+ }
+ auto& eds_state = state_map_[XdsApi::kEdsTypeUrl];
+ for (auto& p : eds_update_map) {
+ const char* eds_service_name = p.first.c_str();
+ XdsApi::EdsUpdate& eds_update = p.second;
+ auto& state = eds_state.subscribed_resources[eds_service_name];
+ if (state != nullptr) state->Finish();
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
+ gpr_log(GPR_INFO, "[xds_client %p] EDS resource %s: %s", xds_client(),
+ eds_service_name, eds_update.ToString().c_str());
+ }
+ EndpointState& endpoint_state =
+ xds_client()->endpoint_map_[eds_service_name];
+ // Ignore identical update.
+ if (endpoint_state.update.has_value() &&
+ *endpoint_state.update == eds_update) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
+ gpr_log(GPR_INFO,
+ "[xds_client %p] EDS update identical to current, ignoring.",
+ xds_client());
+ }
+ continue;
+ }
+ // Update the cluster state.
+ endpoint_state.update = std::move(eds_update);
+ // Notify all watchers.
+ for (const auto& p : endpoint_state.watchers) {
+ p.first->OnEndpointChanged(endpoint_state.update.value());
+ }
+ }
+}
+
+void XdsClient::ChannelState::AdsCallState::OnRequestSent(void* arg,
+ grpc_error* error) {
+ AdsCallState* ads_calld = static_cast<AdsCallState*>(arg);
+ {
+ MutexLock lock(&ads_calld->xds_client()->mu_);
+ ads_calld->OnRequestSentLocked(GRPC_ERROR_REF(error));
+ }
+ ads_calld->Unref(DEBUG_LOCATION, "ADS+OnRequestSentLocked");
+}
+
+void XdsClient::ChannelState::AdsCallState::OnRequestSentLocked(
+ grpc_error* error) {
+ if (IsCurrentCallOnChannel() && error == GRPC_ERROR_NONE) {
+ // Clean up the sent message.
+ grpc_byte_buffer_destroy(send_message_payload_);
+ send_message_payload_ = nullptr;
+ // Continue to send another pending message if any.
+ // TODO(roth): The current code to handle buffered messages has the
+ // advantage of sending only the most recent list of resource names for
+ // each resource type (no matter how many times that resource type has
+ // been requested to send while the current message sending is still
+ // pending). But its disadvantage is that we send the requests in fixed
+ // order of resource types. We need to fix this if we are seeing some
+ // resource type(s) starved due to frequent requests of other resource
+ // type(s).
+ auto it = buffered_requests_.begin();
+ if (it != buffered_requests_.end()) {
+ SendMessageLocked(*it);
+ buffered_requests_.erase(it);
+ }
+ }
+ GRPC_ERROR_UNREF(error);
+}
+
+void XdsClient::ChannelState::AdsCallState::OnResponseReceived(
+ void* arg, grpc_error* /* error */) {
+ AdsCallState* ads_calld = static_cast<AdsCallState*>(arg);
+ bool done;
+ {
+ MutexLock lock(&ads_calld->xds_client()->mu_);
+ done = ads_calld->OnResponseReceivedLocked();
+ }
+ if (done) ads_calld->Unref(DEBUG_LOCATION, "ADS+OnResponseReceivedLocked");
+}
+
+bool XdsClient::ChannelState::AdsCallState::OnResponseReceivedLocked() {
+ // Empty payload means the call was cancelled.
+ if (!IsCurrentCallOnChannel() || recv_message_payload_ == nullptr) {
+ return true;
+ }
+ // Read the response.
+ grpc_byte_buffer_reader bbr;
+ grpc_byte_buffer_reader_init(&bbr, recv_message_payload_);
+ grpc_slice response_slice = grpc_byte_buffer_reader_readall(&bbr);
+ grpc_byte_buffer_reader_destroy(&bbr);
+ grpc_byte_buffer_destroy(recv_message_payload_);
+ recv_message_payload_ = nullptr;
+ // Parse and validate the response.
+ XdsApi::AdsParseResult result = xds_client()->api_.ParseAdsResponse(
+ response_slice, ResourceNamesForRequest(XdsApi::kLdsTypeUrl),
+ ResourceNamesForRequest(XdsApi::kRdsTypeUrl),
+ ResourceNamesForRequest(XdsApi::kCdsTypeUrl),
+ ResourceNamesForRequest(XdsApi::kEdsTypeUrl));
+ grpc_slice_unref_internal(response_slice);
+ if (result.type_url.empty()) {
+ // Ignore unparsable response.
+ gpr_log(GPR_ERROR,
+ "[xds_client %p] Error parsing ADS response (%s) -- ignoring",
+ xds_client(), grpc_error_string(result.parse_error));
+ GRPC_ERROR_UNREF(result.parse_error);
+ } else {
+ // Update nonce.
+ auto& state = state_map_[result.type_url];
+ state.nonce = std::move(result.nonce);
+ // NACK or ACK the response.
+ if (result.parse_error != GRPC_ERROR_NONE) {
+ GRPC_ERROR_UNREF(state.error);
+ state.error = result.parse_error;
+ // NACK unacceptable update.
+ gpr_log(GPR_ERROR,
+ "[xds_client %p] ADS response invalid for resource type %s "
+ "version %s, will NACK: nonce=%s error=%s",
+ xds_client(), result.type_url.c_str(), result.version.c_str(),
+ state.nonce.c_str(), grpc_error_string(result.parse_error));
+ SendMessageLocked(result.type_url);
+ } else {
+ seen_response_ = true;
+ // Accept the ADS response according to the type_url.
+ if (result.type_url == XdsApi::kLdsTypeUrl) {
+ AcceptLdsUpdate(std::move(result.lds_update_map));
+ } else if (result.type_url == XdsApi::kRdsTypeUrl) {
+ AcceptRdsUpdate(std::move(result.rds_update_map));
+ } else if (result.type_url == XdsApi::kCdsTypeUrl) {
+ AcceptCdsUpdate(std::move(result.cds_update_map));
+ } else if (result.type_url == XdsApi::kEdsTypeUrl) {
+ AcceptEdsUpdate(std::move(result.eds_update_map));
+ }
+ state.version = std::move(result.version);
+ // ACK the update.
+ SendMessageLocked(result.type_url);
+ // Start load reporting if needed.
+ auto& lrs_call = chand()->lrs_calld_;
+ if (lrs_call != nullptr) {
+ LrsCallState* lrs_calld = lrs_call->calld();
+ if (lrs_calld != nullptr) lrs_calld->MaybeStartReportingLocked();
+ }
+ }
+ }
+ if (xds_client()->shutting_down_) return true;
+ // Keep listening for updates.
+ grpc_op op;
+ memset(&op, 0, sizeof(op));
+ op.op = GRPC_OP_RECV_MESSAGE;
+ op.data.recv_message.recv_message = &recv_message_payload_;
+ op.flags = 0;
+ op.reserved = nullptr;
+ GPR_ASSERT(call_ != nullptr);
+ // Reuse the "ADS+OnResponseReceivedLocked" ref taken in ctor.
+ const grpc_call_error call_error =
+ grpc_call_start_batch_and_execute(call_, &op, 1, &on_response_received_);
+ GPR_ASSERT(GRPC_CALL_OK == call_error);
+ return false;
+}
+
+void XdsClient::ChannelState::AdsCallState::OnStatusReceived(
+ void* arg, grpc_error* error) {
+ AdsCallState* ads_calld = static_cast<AdsCallState*>(arg);
+ {
+ MutexLock lock(&ads_calld->xds_client()->mu_);
+ ads_calld->OnStatusReceivedLocked(GRPC_ERROR_REF(error));
+ }
+ ads_calld->Unref(DEBUG_LOCATION, "ADS+OnStatusReceivedLocked");
+}
+
+void XdsClient::ChannelState::AdsCallState::OnStatusReceivedLocked(
+ grpc_error* error) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
+ char* status_details = grpc_slice_to_c_string(status_details_);
+ gpr_log(GPR_INFO,
+ "[xds_client %p] ADS call status received. Status = %d, details "
+ "= '%s', (chand: %p, ads_calld: %p, call: %p), error '%s'",
+ xds_client(), status_code_, status_details, chand(), this, call_,
+ grpc_error_string(error));
+ gpr_free(status_details);
+ }
+ // Ignore status from a stale call.
+ if (IsCurrentCallOnChannel()) {
+ // Try to restart the call.
+ parent_->OnCallFinishedLocked();
+ // Send error to all watchers.
+ xds_client()->NotifyOnErrorLocked(
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("xds call failed"));
+ }
+ GRPC_ERROR_UNREF(error);
+}
+
+bool XdsClient::ChannelState::AdsCallState::IsCurrentCallOnChannel() const {
+ // If the retryable ADS call is null (which only happens when the xds channel
+ // is shutting down), all the ADS calls are stale.
+ if (chand()->ads_calld_ == nullptr) return false;
+ return this == chand()->ads_calld_->calld();
+}
+
+std::set<y_absl::string_view>
+XdsClient::ChannelState::AdsCallState::ResourceNamesForRequest(
+ const TString& type_url) {
+ std::set<y_absl::string_view> resource_names;
+ auto it = state_map_.find(type_url);
+ if (it != state_map_.end()) {
+ for (auto& p : it->second.subscribed_resources) {
+ resource_names.insert(p.first);
+ OrphanablePtr<ResourceState>& state = p.second;
+ state->Start(Ref(DEBUG_LOCATION, "ResourceState"));
+ }
+ }
+ return resource_names;
+}
+
+//
+// XdsClient::ChannelState::LrsCallState::Reporter
+//
+
+void XdsClient::ChannelState::LrsCallState::Reporter::Orphan() {
+ if (next_report_timer_callback_pending_) {
+ grpc_timer_cancel(&next_report_timer_);
+ }
+}
+
+void XdsClient::ChannelState::LrsCallState::Reporter::
+ ScheduleNextReportLocked() {
+ const grpc_millis next_report_time = ExecCtx::Get()->Now() + report_interval_;
+ grpc_timer_init(&next_report_timer_, next_report_time,
+ &on_next_report_timer_);
+ next_report_timer_callback_pending_ = true;
+}
+
+void XdsClient::ChannelState::LrsCallState::Reporter::OnNextReportTimer(
+ void* arg, grpc_error* error) {
+ Reporter* self = static_cast<Reporter*>(arg);
+ bool done;
+ {
+ MutexLock lock(&self->xds_client()->mu_);
+ done = self->OnNextReportTimerLocked(GRPC_ERROR_REF(error));
+ }
+ if (done) self->Unref(DEBUG_LOCATION, "Reporter+timer");
+}
+
+bool XdsClient::ChannelState::LrsCallState::Reporter::OnNextReportTimerLocked(
+ grpc_error* error) {
+ next_report_timer_callback_pending_ = false;
+ if (error != GRPC_ERROR_NONE || !IsCurrentReporterOnCall()) {
+ GRPC_ERROR_UNREF(error);
+ return true;
+ }
+ SendReportLocked();
+ return false;
+}
+
+namespace {
+
+bool LoadReportCountersAreZero(const XdsApi::ClusterLoadReportMap& snapshot) {
+ for (const auto& p : snapshot) {
+ const XdsApi::ClusterLoadReport& cluster_snapshot = p.second;
+ if (!cluster_snapshot.dropped_requests.IsZero()) return false;
+ for (const auto& q : cluster_snapshot.locality_stats) {
+ const XdsClusterLocalityStats::Snapshot& locality_snapshot = q.second;
+ if (!locality_snapshot.IsZero()) return false;
+ }
+ }
+ return true;
+}
+
+} // namespace
+
+void XdsClient::ChannelState::LrsCallState::Reporter::SendReportLocked() {
+ // Construct snapshot from all reported stats.
+ XdsApi::ClusterLoadReportMap snapshot =
+ xds_client()->BuildLoadReportSnapshotLocked(parent_->send_all_clusters_,
+ parent_->cluster_names_);
+ // Skip client load report if the counters were all zero in the last
+ // report and they are still zero in this one.
+ const bool old_val = last_report_counters_were_zero_;
+ last_report_counters_were_zero_ = LoadReportCountersAreZero(snapshot);
+ if (old_val && last_report_counters_were_zero_) {
+ ScheduleNextReportLocked();
+ return;
+ }
+ // Create a request that contains the snapshot.
+ grpc_slice request_payload_slice =
+ xds_client()->api_.CreateLrsRequest(std::move(snapshot));
+ parent_->send_message_payload_ =
+ grpc_raw_byte_buffer_create(&request_payload_slice, 1);
+ grpc_slice_unref_internal(request_payload_slice);
+ // Send the report.
+ grpc_op op;
+ memset(&op, 0, sizeof(op));
+ op.op = GRPC_OP_SEND_MESSAGE;
+ op.data.send_message.send_message = parent_->send_message_payload_;
+ grpc_call_error call_error = grpc_call_start_batch_and_execute(
+ parent_->call_, &op, 1, &on_report_done_);
+ if (GPR_UNLIKELY(call_error != GRPC_CALL_OK)) {
+ gpr_log(GPR_ERROR,
+ "[xds_client %p] calld=%p call_error=%d sending client load report",
+ xds_client(), this, call_error);
+ GPR_ASSERT(GRPC_CALL_OK == call_error);
+ }
+}
+
+void XdsClient::ChannelState::LrsCallState::Reporter::OnReportDone(
+ void* arg, grpc_error* error) {
+ Reporter* self = static_cast<Reporter*>(arg);
+ bool done;
+ {
+ MutexLock lock(&self->xds_client()->mu_);
+ done = self->OnReportDoneLocked(GRPC_ERROR_REF(error));
+ }
+ if (done) self->Unref(DEBUG_LOCATION, "Reporter+report_done");
+}
+
+bool XdsClient::ChannelState::LrsCallState::Reporter::OnReportDoneLocked(
+ grpc_error* error) {
+ grpc_byte_buffer_destroy(parent_->send_message_payload_);
+ parent_->send_message_payload_ = nullptr;
+ // If there are no more registered stats to report, cancel the call.
+ if (xds_client()->load_report_map_.empty()) {
+ parent_->chand()->StopLrsCall();
+ GRPC_ERROR_UNREF(error);
+ return true;
+ }
+ if (error != GRPC_ERROR_NONE || !IsCurrentReporterOnCall()) {
+ GRPC_ERROR_UNREF(error);
+ // If this reporter is no longer the current one on the call, the reason
+ // might be that it was orphaned for a new one due to config update.
+ if (!IsCurrentReporterOnCall()) {
+ parent_->MaybeStartReportingLocked();
+ }
+ return true;
+ }
+ ScheduleNextReportLocked();
+ return false;
+}
+
+//
+// XdsClient::ChannelState::LrsCallState
+//
+
+XdsClient::ChannelState::LrsCallState::LrsCallState(
+ RefCountedPtr<RetryableCall<LrsCallState>> parent)
+ : InternallyRefCounted<LrsCallState>(&grpc_xds_client_trace),
+ parent_(std::move(parent)) {
+ // Init the LRS call. Note that the call will progress every time there's
+ // activity in xds_client()->interested_parties_, which is comprised of
+ // the polling entities from client_channel.
+ GPR_ASSERT(xds_client() != nullptr);
+ const auto& method =
+ xds_client()->bootstrap_->server().ShouldUseV3()
+ ? GRPC_MDSTR_SLASH_ENVOY_DOT_SERVICE_DOT_LOAD_STATS_DOT_V3_DOT_LOADREPORTINGSERVICE_SLASH_STREAMLOADSTATS
+ : GRPC_MDSTR_SLASH_ENVOY_DOT_SERVICE_DOT_LOAD_STATS_DOT_V2_DOT_LOADREPORTINGSERVICE_SLASH_STREAMLOADSTATS;
+ call_ = grpc_channel_create_pollset_set_call(
+ chand()->channel_, nullptr, GRPC_PROPAGATE_DEFAULTS,
+ xds_client()->interested_parties_, method, nullptr,
+ GRPC_MILLIS_INF_FUTURE, nullptr);
+ GPR_ASSERT(call_ != nullptr);
+ // Init the request payload.
+ grpc_slice request_payload_slice =
+ xds_client()->api_.CreateLrsInitialRequest();
+ send_message_payload_ =
+ grpc_raw_byte_buffer_create(&request_payload_slice, 1);
+ grpc_slice_unref_internal(request_payload_slice);
+ // Init other data associated with the LRS call.
+ grpc_metadata_array_init(&initial_metadata_recv_);
+ grpc_metadata_array_init(&trailing_metadata_recv_);
+ // Start the call.
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
+ gpr_log(GPR_INFO,
+ "[xds_client %p] Starting LRS call (chand: %p, calld: %p, "
+ "call: %p)",
+ xds_client(), chand(), this, call_);
+ }
+ // Create the ops.
+ grpc_call_error call_error;
+ grpc_op ops[3];
+ memset(ops, 0, sizeof(ops));
+ // Op: send initial metadata.
+ grpc_op* op = ops;
+ op->op = GRPC_OP_SEND_INITIAL_METADATA;
+ op->data.send_initial_metadata.count = 0;
+ op->flags = GRPC_INITIAL_METADATA_WAIT_FOR_READY |
+ GRPC_INITIAL_METADATA_WAIT_FOR_READY_EXPLICITLY_SET;
+ op->reserved = nullptr;
+ op++;
+ // Op: send request message.
+ GPR_ASSERT(send_message_payload_ != nullptr);
+ op->op = GRPC_OP_SEND_MESSAGE;
+ op->data.send_message.send_message = send_message_payload_;
+ op->flags = 0;
+ op->reserved = nullptr;
+ op++;
+ Ref(DEBUG_LOCATION, "LRS+OnInitialRequestSentLocked").release();
+ GRPC_CLOSURE_INIT(&on_initial_request_sent_, OnInitialRequestSent, this,
+ grpc_schedule_on_exec_ctx);
+ call_error = grpc_call_start_batch_and_execute(call_, ops, (size_t)(op - ops),
+ &on_initial_request_sent_);
+ GPR_ASSERT(GRPC_CALL_OK == call_error);
+ // Op: recv initial metadata.
+ op = ops;
+ op->op = GRPC_OP_RECV_INITIAL_METADATA;
+ op->data.recv_initial_metadata.recv_initial_metadata =
+ &initial_metadata_recv_;
+ op->flags = 0;
+ op->reserved = nullptr;
+ op++;
+ // Op: recv response.
+ op->op = GRPC_OP_RECV_MESSAGE;
+ op->data.recv_message.recv_message = &recv_message_payload_;
+ op->flags = 0;
+ op->reserved = nullptr;
+ op++;
+ Ref(DEBUG_LOCATION, "LRS+OnResponseReceivedLocked").release();
+ GRPC_CLOSURE_INIT(&on_response_received_, OnResponseReceived, this,
+ grpc_schedule_on_exec_ctx);
+ call_error = grpc_call_start_batch_and_execute(call_, ops, (size_t)(op - ops),
+ &on_response_received_);
+ GPR_ASSERT(GRPC_CALL_OK == call_error);
+ // Op: recv server status.
+ op = ops;
+ op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+ op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv_;
+ op->data.recv_status_on_client.status = &status_code_;
+ op->data.recv_status_on_client.status_details = &status_details_;
+ op->flags = 0;
+ op->reserved = nullptr;
+ op++;
+ // This callback signals the end of the call, so it relies on the initial
+ // ref instead of a new ref. When it's invoked, it's the initial ref that is
+ // unreffed.
+ GRPC_CLOSURE_INIT(&on_status_received_, OnStatusReceived, this,
+ grpc_schedule_on_exec_ctx);
+ call_error = grpc_call_start_batch_and_execute(call_, ops, (size_t)(op - ops),
+ &on_status_received_);
+ GPR_ASSERT(GRPC_CALL_OK == call_error);
+}
+
+XdsClient::ChannelState::LrsCallState::~LrsCallState() {
+ grpc_metadata_array_destroy(&initial_metadata_recv_);
+ grpc_metadata_array_destroy(&trailing_metadata_recv_);
+ grpc_byte_buffer_destroy(send_message_payload_);
+ grpc_byte_buffer_destroy(recv_message_payload_);
+ grpc_slice_unref_internal(status_details_);
+ GPR_ASSERT(call_ != nullptr);
+ grpc_call_unref(call_);
+}
+
+void XdsClient::ChannelState::LrsCallState::Orphan() {
+ reporter_.reset();
+ GPR_ASSERT(call_ != nullptr);
+ // If we are here because xds_client wants to cancel the call,
+ // on_status_received_ will complete the cancellation and clean up. Otherwise,
+ // we are here because xds_client has to orphan a failed call, then the
+ // following cancellation will be a no-op.
+ grpc_call_cancel_internal(call_);
+ // Note that the initial ref is hold by on_status_received_. So the
+ // corresponding unref happens in on_status_received_ instead of here.
+}
+
+void XdsClient::ChannelState::LrsCallState::MaybeStartReportingLocked() {
+ // Don't start again if already started.
+ if (reporter_ != nullptr) return;
+ // Don't start if the previous send_message op (of the initial request or the
+ // last report of the previous reporter) hasn't completed.
+ if (send_message_payload_ != nullptr) return;
+ // Don't start if no LRS response has arrived.
+ if (!seen_response()) return;
+ // Don't start if the ADS call hasn't received any valid response. Note that
+ // this must be the first channel because it is the current channel but its
+ // ADS call hasn't seen any response.
+ if (chand()->ads_calld_ == nullptr ||
+ chand()->ads_calld_->calld() == nullptr ||
+ !chand()->ads_calld_->calld()->seen_response()) {
+ return;
+ }
+ // Start reporting.
+ reporter_ = MakeOrphanable<Reporter>(
+ Ref(DEBUG_LOCATION, "LRS+load_report+start"), load_reporting_interval_);
+}
+
+void XdsClient::ChannelState::LrsCallState::OnInitialRequestSent(
+ void* arg, grpc_error* /*error*/) {
+ LrsCallState* lrs_calld = static_cast<LrsCallState*>(arg);
+ {
+ MutexLock lock(&lrs_calld->xds_client()->mu_);
+ lrs_calld->OnInitialRequestSentLocked();
+ }
+ lrs_calld->Unref(DEBUG_LOCATION, "LRS+OnInitialRequestSentLocked");
+}
+
+void XdsClient::ChannelState::LrsCallState::OnInitialRequestSentLocked() {
+ // Clear the send_message_payload_.
+ grpc_byte_buffer_destroy(send_message_payload_);
+ send_message_payload_ = nullptr;
+ MaybeStartReportingLocked();
+}
+
+void XdsClient::ChannelState::LrsCallState::OnResponseReceived(
+ void* arg, grpc_error* /*error*/) {
+ LrsCallState* lrs_calld = static_cast<LrsCallState*>(arg);
+ bool done;
+ {
+ MutexLock lock(&lrs_calld->xds_client()->mu_);
+ done = lrs_calld->OnResponseReceivedLocked();
+ }
+ if (done) lrs_calld->Unref(DEBUG_LOCATION, "LRS+OnResponseReceivedLocked");
+}
+
+bool XdsClient::ChannelState::LrsCallState::OnResponseReceivedLocked() {
+ // Empty payload means the call was cancelled.
+ if (!IsCurrentCallOnChannel() || recv_message_payload_ == nullptr) {
+ return true;
+ }
+ // Read the response.
+ grpc_byte_buffer_reader bbr;
+ grpc_byte_buffer_reader_init(&bbr, recv_message_payload_);
+ grpc_slice response_slice = grpc_byte_buffer_reader_readall(&bbr);
+ grpc_byte_buffer_reader_destroy(&bbr);
+ grpc_byte_buffer_destroy(recv_message_payload_);
+ recv_message_payload_ = nullptr;
+ // This anonymous lambda is a hack to avoid the usage of goto.
+ [&]() {
+ // Parse the response.
+ bool send_all_clusters = false;
+ std::set<TString> new_cluster_names;
+ grpc_millis new_load_reporting_interval;
+ grpc_error* parse_error = xds_client()->api_.ParseLrsResponse(
+ response_slice, &send_all_clusters, &new_cluster_names,
+ &new_load_reporting_interval);
+ if (parse_error != GRPC_ERROR_NONE) {
+ gpr_log(GPR_ERROR,
+ "[xds_client %p] LRS response parsing failed. error=%s",
+ xds_client(), grpc_error_string(parse_error));
+ GRPC_ERROR_UNREF(parse_error);
+ return;
+ }
+ seen_response_ = true;
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
+ gpr_log(
+ GPR_INFO,
+ "[xds_client %p] LRS response received, %" PRIuPTR
+ " cluster names, send_all_clusters=%d, load_report_interval=%" PRId64
+ "ms",
+ xds_client(), new_cluster_names.size(), send_all_clusters,
+ new_load_reporting_interval);
+ size_t i = 0;
+ for (const auto& name : new_cluster_names) {
+ gpr_log(GPR_INFO, "[xds_client %p] cluster_name %" PRIuPTR ": %s",
+ xds_client(), i++, name.c_str());
+ }
+ }
+ if (new_load_reporting_interval <
+ GRPC_XDS_MIN_CLIENT_LOAD_REPORTING_INTERVAL_MS) {
+ new_load_reporting_interval =
+ GRPC_XDS_MIN_CLIENT_LOAD_REPORTING_INTERVAL_MS;
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
+ gpr_log(GPR_INFO,
+ "[xds_client %p] Increased load_report_interval to minimum "
+ "value %dms",
+ xds_client(), GRPC_XDS_MIN_CLIENT_LOAD_REPORTING_INTERVAL_MS);
+ }
+ }
+ // Ignore identical update.
+ if (send_all_clusters == send_all_clusters_ &&
+ cluster_names_ == new_cluster_names &&
+ load_reporting_interval_ == new_load_reporting_interval) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
+ gpr_log(GPR_INFO,
+ "[xds_client %p] Incoming LRS response identical to current, "
+ "ignoring.",
+ xds_client());
+ }
+ return;
+ }
+ // Stop current load reporting (if any) to adopt the new config.
+ reporter_.reset();
+ // Record the new config.
+ send_all_clusters_ = send_all_clusters;
+ cluster_names_ = std::move(new_cluster_names);
+ load_reporting_interval_ = new_load_reporting_interval;
+ // Try starting sending load report.
+ MaybeStartReportingLocked();
+ }();
+ grpc_slice_unref_internal(response_slice);
+ if (xds_client()->shutting_down_) return true;
+ // Keep listening for LRS config updates.
+ grpc_op op;
+ memset(&op, 0, sizeof(op));
+ op.op = GRPC_OP_RECV_MESSAGE;
+ op.data.recv_message.recv_message = &recv_message_payload_;
+ op.flags = 0;
+ op.reserved = nullptr;
+ GPR_ASSERT(call_ != nullptr);
+ // Reuse the "OnResponseReceivedLocked" ref taken in ctor.
+ const grpc_call_error call_error =
+ grpc_call_start_batch_and_execute(call_, &op, 1, &on_response_received_);
+ GPR_ASSERT(GRPC_CALL_OK == call_error);
+ return false;
+}
+
+void XdsClient::ChannelState::LrsCallState::OnStatusReceived(
+ void* arg, grpc_error* error) {
+ LrsCallState* lrs_calld = static_cast<LrsCallState*>(arg);
+ {
+ MutexLock lock(&lrs_calld->xds_client()->mu_);
+ lrs_calld->OnStatusReceivedLocked(GRPC_ERROR_REF(error));
+ }
+ lrs_calld->Unref(DEBUG_LOCATION, "LRS+OnStatusReceivedLocked");
+}
+
+void XdsClient::ChannelState::LrsCallState::OnStatusReceivedLocked(
+ grpc_error* error) {
+ GPR_ASSERT(call_ != nullptr);
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
+ char* status_details = grpc_slice_to_c_string(status_details_);
+ gpr_log(GPR_INFO,
+ "[xds_client %p] LRS call status received. Status = %d, details "
+ "= '%s', (chand: %p, calld: %p, call: %p), error '%s'",
+ xds_client(), status_code_, status_details, chand(), this, call_,
+ grpc_error_string(error));
+ gpr_free(status_details);
+ }
+ // Ignore status from a stale call.
+ if (IsCurrentCallOnChannel()) {
+ GPR_ASSERT(!xds_client()->shutting_down_);
+ // Try to restart the call.
+ parent_->OnCallFinishedLocked();
+ }
+ GRPC_ERROR_UNREF(error);
+}
+
+bool XdsClient::ChannelState::LrsCallState::IsCurrentCallOnChannel() const {
+ // If the retryable LRS call is null (which only happens when the xds channel
+ // is shutting down), all the LRS calls are stale.
+ if (chand()->lrs_calld_ == nullptr) return false;
+ return this == chand()->lrs_calld_->calld();
+}
+
+//
+// XdsClient
+//
+
+namespace {
+
+grpc_millis GetRequestTimeout() {
+ return grpc_channel_args_find_integer(
+ g_channel_args, GRPC_ARG_XDS_RESOURCE_DOES_NOT_EXIST_TIMEOUT_MS,
+ {15000, 0, INT_MAX});
+}
+
+grpc_channel* CreateXdsChannel(const XdsBootstrap& bootstrap,
+ grpc_error** error) {
+ // Build channel args.
+ y_absl::InlinedVector<grpc_arg, 2> args_to_add = {
+ grpc_channel_arg_integer_create(
+ const_cast<char*>(GRPC_ARG_KEEPALIVE_TIME_MS),
+ 5 * 60 * GPR_MS_PER_SEC),
+ grpc_channel_arg_integer_create(
+ const_cast<char*>(GRPC_ARG_CHANNELZ_IS_INTERNAL_CHANNEL), 1),
+ };
+ grpc_channel_args* new_args = grpc_channel_args_copy_and_add(
+ g_channel_args, args_to_add.data(), args_to_add.size());
+ // Find credentials and create channel.
+ RefCountedPtr<grpc_channel_credentials> creds;
+ for (const auto& channel_creds : bootstrap.server().channel_creds) {
+ if (channel_creds.type == "google_default") {
+ creds.reset(grpc_google_default_credentials_create(nullptr));
+ break;
+ }
+ if (channel_creds.type == "insecure") {
+ grpc_channel* channel = grpc_insecure_channel_create(
+ bootstrap.server().server_uri.c_str(), new_args, nullptr);
+ grpc_channel_args_destroy(new_args);
+ return channel;
+ }
+ if (channel_creds.type == "fake") {
+ creds.reset(grpc_fake_transport_security_credentials_create());
+ break;
+ }
+ }
+ if (creds == nullptr) {
+ *error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "no supported credential types found");
+ return nullptr;
+ }
+ grpc_channel* channel = grpc_secure_channel_create(
+ creds.get(), bootstrap.server().server_uri.c_str(), new_args, nullptr);
+ grpc_channel_args_destroy(new_args);
+ return channel;
+}
+
+} // namespace
+
+XdsClient::XdsClient(grpc_error** error)
+ : DualRefCounted<XdsClient>(&grpc_xds_client_trace),
+ request_timeout_(GetRequestTimeout()),
+ interested_parties_(grpc_pollset_set_create()),
+ bootstrap_(
+ XdsBootstrap::ReadFromFile(this, &grpc_xds_client_trace, error)),
+ api_(this, &grpc_xds_client_trace, bootstrap_.get()) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
+ gpr_log(GPR_INFO, "[xds_client %p] creating xds client", this);
+ }
+ if (*error != GRPC_ERROR_NONE) {
+ gpr_log(GPR_ERROR, "[xds_client %p] failed to read bootstrap file: %s",
+ this, grpc_error_string(*error));
+ return;
+ }
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
+ gpr_log(GPR_INFO, "[xds_client %p] creating channel to %s", this,
+ bootstrap_->server().server_uri.c_str());
+ }
+ grpc_channel* channel = CreateXdsChannel(*bootstrap_, error);
+ if (*error != GRPC_ERROR_NONE) {
+ gpr_log(GPR_ERROR, "[xds_client %p] failed to create xds channel: %s", this,
+ grpc_error_string(*error));
+ return;
+ }
+ // Create ChannelState object.
+ chand_ = MakeOrphanable<ChannelState>(
+ WeakRef(DEBUG_LOCATION, "XdsClient+ChannelState"), channel);
+}
+
+XdsClient::~XdsClient() {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
+ gpr_log(GPR_INFO, "[xds_client %p] destroying xds client", this);
+ }
+ grpc_pollset_set_destroy(interested_parties_);
+}
+
+void XdsClient::AddChannelzLinkage(
+ channelz::ChannelNode* parent_channelz_node) {
+ channelz::ChannelNode* xds_channelz_node =
+ grpc_channel_get_channelz_node(chand_->channel());
+ if (xds_channelz_node != nullptr) {
+ parent_channelz_node->AddChildChannel(xds_channelz_node->uuid());
+ }
+}
+
+void XdsClient::RemoveChannelzLinkage(
+ channelz::ChannelNode* parent_channelz_node) {
+ channelz::ChannelNode* xds_channelz_node =
+ grpc_channel_get_channelz_node(chand_->channel());
+ if (xds_channelz_node != nullptr) {
+ parent_channelz_node->RemoveChildChannel(xds_channelz_node->uuid());
+ }
+}
+
+void XdsClient::Orphan() {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
+ gpr_log(GPR_INFO, "[xds_client %p] shutting down xds client", this);
+ }
+ {
+ MutexLock lock(g_mu);
+ if (g_xds_client == this) g_xds_client = nullptr;
+ }
+ {
+ MutexLock lock(&mu_);
+ shutting_down_ = true;
+ // Orphan ChannelState object.
+ chand_.reset();
+ // We do not clear cluster_map_ and endpoint_map_ if the xds client was
+ // created by the XdsResolver because the maps contain refs for watchers
+ // which in turn hold refs to the loadbalancing policies. At this point, it
+ // is possible for ADS calls to be in progress. Unreffing the loadbalancing
+ // policies before those calls are done would lead to issues such as
+ // https://github.com/grpc/grpc/issues/20928.
+ if (!listener_map_.empty()) {
+ cluster_map_.clear();
+ endpoint_map_.clear();
+ }
+ }
+}
+
+void XdsClient::WatchListenerData(
+ y_absl::string_view listener_name,
+ std::unique_ptr<ListenerWatcherInterface> watcher) {
+ TString listener_name_str = TString(listener_name);
+ MutexLock lock(&mu_);
+ ListenerState& listener_state = listener_map_[listener_name_str];
+ ListenerWatcherInterface* w = watcher.get();
+ listener_state.watchers[w] = std::move(watcher);
+ // If we've already received an LDS update, notify the new watcher
+ // immediately.
+ if (listener_state.update.has_value()) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
+ gpr_log(GPR_INFO, "[xds_client %p] returning cached listener data for %s",
+ this, listener_name_str.c_str());
+ }
+ w->OnListenerChanged(*listener_state.update);
+ }
+ chand_->Subscribe(XdsApi::kLdsTypeUrl, listener_name_str);
+}
+
+void XdsClient::CancelListenerDataWatch(y_absl::string_view listener_name,
+ ListenerWatcherInterface* watcher,
+ bool delay_unsubscription) {
+ MutexLock lock(&mu_);
+ if (shutting_down_) return;
+ TString listener_name_str = TString(listener_name);
+ ListenerState& listener_state = listener_map_[listener_name_str];
+ auto it = listener_state.watchers.find(watcher);
+ if (it != listener_state.watchers.end()) {
+ listener_state.watchers.erase(it);
+ if (listener_state.watchers.empty()) {
+ listener_map_.erase(listener_name_str);
+ chand_->Unsubscribe(XdsApi::kLdsTypeUrl, listener_name_str,
+ delay_unsubscription);
+ }
+ }
+}
+
+void XdsClient::WatchRouteConfigData(
+ y_absl::string_view route_config_name,
+ std::unique_ptr<RouteConfigWatcherInterface> watcher) {
+ TString route_config_name_str = TString(route_config_name);
+ MutexLock lock(&mu_);
+ RouteConfigState& route_config_state =
+ route_config_map_[route_config_name_str];
+ RouteConfigWatcherInterface* w = watcher.get();
+ route_config_state.watchers[w] = std::move(watcher);
+ // If we've already received an RDS update, notify the new watcher
+ // immediately.
+ if (route_config_state.update.has_value()) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
+ gpr_log(GPR_INFO,
+ "[xds_client %p] returning cached route config data for %s", this,
+ route_config_name_str.c_str());
+ }
+ w->OnRouteConfigChanged(*route_config_state.update);
+ }
+ chand_->Subscribe(XdsApi::kRdsTypeUrl, route_config_name_str);
+}
+
+void XdsClient::CancelRouteConfigDataWatch(y_absl::string_view route_config_name,
+ RouteConfigWatcherInterface* watcher,
+ bool delay_unsubscription) {
+ MutexLock lock(&mu_);
+ if (shutting_down_) return;
+ TString route_config_name_str = TString(route_config_name);
+ RouteConfigState& route_config_state =
+ route_config_map_[route_config_name_str];
+ auto it = route_config_state.watchers.find(watcher);
+ if (it != route_config_state.watchers.end()) {
+ route_config_state.watchers.erase(it);
+ if (route_config_state.watchers.empty()) {
+ route_config_map_.erase(route_config_name_str);
+ chand_->Unsubscribe(XdsApi::kRdsTypeUrl, route_config_name_str,
+ delay_unsubscription);
+ }
+ }
+}
+
+void XdsClient::WatchClusterData(
+ y_absl::string_view cluster_name,
+ std::unique_ptr<ClusterWatcherInterface> watcher) {
+ TString cluster_name_str = TString(cluster_name);
+ MutexLock lock(&mu_);
+ ClusterState& cluster_state = cluster_map_[cluster_name_str];
+ ClusterWatcherInterface* w = watcher.get();
+ cluster_state.watchers[w] = std::move(watcher);
+ // If we've already received a CDS update, notify the new watcher
+ // immediately.
+ if (cluster_state.update.has_value()) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
+ gpr_log(GPR_INFO, "[xds_client %p] returning cached cluster data for %s",
+ this, cluster_name_str.c_str());
+ }
+ w->OnClusterChanged(cluster_state.update.value());
+ }
+ chand_->Subscribe(XdsApi::kCdsTypeUrl, cluster_name_str);
+}
+
+void XdsClient::CancelClusterDataWatch(y_absl::string_view cluster_name,
+ ClusterWatcherInterface* watcher,
+ bool delay_unsubscription) {
+ MutexLock lock(&mu_);
+ if (shutting_down_) return;
+ TString cluster_name_str = TString(cluster_name);
+ ClusterState& cluster_state = cluster_map_[cluster_name_str];
+ auto it = cluster_state.watchers.find(watcher);
+ if (it != cluster_state.watchers.end()) {
+ cluster_state.watchers.erase(it);
+ if (cluster_state.watchers.empty()) {
+ cluster_map_.erase(cluster_name_str);
+ chand_->Unsubscribe(XdsApi::kCdsTypeUrl, cluster_name_str,
+ delay_unsubscription);
+ }
+ }
+}
+
+void XdsClient::WatchEndpointData(
+ y_absl::string_view eds_service_name,
+ std::unique_ptr<EndpointWatcherInterface> watcher) {
+ TString eds_service_name_str = TString(eds_service_name);
+ MutexLock lock(&mu_);
+ EndpointState& endpoint_state = endpoint_map_[eds_service_name_str];
+ EndpointWatcherInterface* w = watcher.get();
+ endpoint_state.watchers[w] = std::move(watcher);
+ // If we've already received an EDS update, notify the new watcher
+ // immediately.
+ if (endpoint_state.update.has_value()) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
+ gpr_log(GPR_INFO, "[xds_client %p] returning cached endpoint data for %s",
+ this, eds_service_name_str.c_str());
+ }
+ w->OnEndpointChanged(endpoint_state.update.value());
+ }
+ chand_->Subscribe(XdsApi::kEdsTypeUrl, eds_service_name_str);
+}
+
+void XdsClient::CancelEndpointDataWatch(y_absl::string_view eds_service_name,
+ EndpointWatcherInterface* watcher,
+ bool delay_unsubscription) {
+ MutexLock lock(&mu_);
+ if (shutting_down_) return;
+ TString eds_service_name_str = TString(eds_service_name);
+ EndpointState& endpoint_state = endpoint_map_[eds_service_name_str];
+ auto it = endpoint_state.watchers.find(watcher);
+ if (it != endpoint_state.watchers.end()) {
+ endpoint_state.watchers.erase(it);
+ if (endpoint_state.watchers.empty()) {
+ endpoint_map_.erase(eds_service_name_str);
+ chand_->Unsubscribe(XdsApi::kEdsTypeUrl, eds_service_name_str,
+ delay_unsubscription);
+ }
+ }
+}
+
+RefCountedPtr<XdsClusterDropStats> XdsClient::AddClusterDropStats(
+ y_absl::string_view lrs_server, y_absl::string_view cluster_name,
+ y_absl::string_view eds_service_name) {
+ // TODO(roth): When we add support for direct federation, use the
+ // server name specified in lrs_server.
+ auto key =
+ std::make_pair(TString(cluster_name), TString(eds_service_name));
+ MutexLock lock(&mu_);
+ // We jump through some hoops here to make sure that the y_absl::string_views
+ // stored in the XdsClusterDropStats object point to the strings
+ // in the load_report_map_ key, so that they have the same lifetime.
+ auto it = load_report_map_
+ .emplace(std::make_pair(std::move(key), LoadReportState()))
+ .first;
+ auto cluster_drop_stats = MakeRefCounted<XdsClusterDropStats>(
+ Ref(DEBUG_LOCATION, "DropStats"), lrs_server,
+ it->first.first /*cluster_name*/, it->first.second /*eds_service_name*/);
+ it->second.drop_stats.insert(cluster_drop_stats.get());
+ chand_->MaybeStartLrsCall();
+ return cluster_drop_stats;
+}
+
+void XdsClient::RemoveClusterDropStats(
+ y_absl::string_view /*lrs_server*/, y_absl::string_view cluster_name,
+ y_absl::string_view eds_service_name,
+ XdsClusterDropStats* cluster_drop_stats) {
+ MutexLock lock(&mu_);
+ auto load_report_it = load_report_map_.find(
+ std::make_pair(TString(cluster_name), TString(eds_service_name)));
+ if (load_report_it == load_report_map_.end()) return;
+ LoadReportState& load_report_state = load_report_it->second;
+ // TODO(roth): When we add support for direct federation, use the
+ // server name specified in lrs_server.
+ auto it = load_report_state.drop_stats.find(cluster_drop_stats);
+ if (it != load_report_state.drop_stats.end()) {
+ // Record final drop stats in deleted_drop_stats, which will be
+ // added to the next load report.
+ auto dropped_requests = cluster_drop_stats->GetSnapshotAndReset();
+ load_report_state.deleted_drop_stats += dropped_requests;
+ load_report_state.drop_stats.erase(it);
+ }
+}
+
+RefCountedPtr<XdsClusterLocalityStats> XdsClient::AddClusterLocalityStats(
+ y_absl::string_view lrs_server, y_absl::string_view cluster_name,
+ y_absl::string_view eds_service_name,
+ RefCountedPtr<XdsLocalityName> locality) {
+ // TODO(roth): When we add support for direct federation, use the
+ // server name specified in lrs_server.
+ auto key =
+ std::make_pair(TString(cluster_name), TString(eds_service_name));
+ MutexLock lock(&mu_);
+ // We jump through some hoops here to make sure that the y_absl::string_views
+ // stored in the XdsClusterLocalityStats object point to the strings
+ // in the load_report_map_ key, so that they have the same lifetime.
+ auto it = load_report_map_
+ .emplace(std::make_pair(std::move(key), LoadReportState()))
+ .first;
+ auto cluster_locality_stats = MakeRefCounted<XdsClusterLocalityStats>(
+ Ref(DEBUG_LOCATION, "LocalityStats"), lrs_server,
+ it->first.first /*cluster_name*/, it->first.second /*eds_service_name*/,
+ locality);
+ it->second.locality_stats[std::move(locality)].locality_stats.insert(
+ cluster_locality_stats.get());
+ chand_->MaybeStartLrsCall();
+ return cluster_locality_stats;
+}
+
+void XdsClient::RemoveClusterLocalityStats(
+ y_absl::string_view /*lrs_server*/, y_absl::string_view cluster_name,
+ y_absl::string_view eds_service_name,
+ const RefCountedPtr<XdsLocalityName>& locality,
+ XdsClusterLocalityStats* cluster_locality_stats) {
+ MutexLock lock(&mu_);
+ auto load_report_it = load_report_map_.find(
+ std::make_pair(TString(cluster_name), TString(eds_service_name)));
+ if (load_report_it == load_report_map_.end()) return;
+ LoadReportState& load_report_state = load_report_it->second;
+ // TODO(roth): When we add support for direct federation, use the
+ // server name specified in lrs_server.
+ auto locality_it = load_report_state.locality_stats.find(locality);
+ if (locality_it == load_report_state.locality_stats.end()) return;
+ auto& locality_set = locality_it->second.locality_stats;
+ auto it = locality_set.find(cluster_locality_stats);
+ if (it != locality_set.end()) {
+ // Record final snapshot in deleted_locality_stats, which will be
+ // added to the next load report.
+ locality_it->second.deleted_locality_stats.emplace_back(
+ cluster_locality_stats->GetSnapshotAndReset());
+ locality_set.erase(it);
+ }
+}
+
+void XdsClient::ResetBackoff() {
+ MutexLock lock(&mu_);
+ if (chand_ != nullptr) {
+ grpc_channel_reset_connect_backoff(chand_->channel());
+ }
+}
+
+void XdsClient::NotifyOnErrorLocked(grpc_error* error) {
+ for (const auto& p : listener_map_) {
+ const ListenerState& listener_state = p.second;
+ for (const auto& p : listener_state.watchers) {
+ p.first->OnError(GRPC_ERROR_REF(error));
+ }
+ }
+ for (const auto& p : route_config_map_) {
+ const RouteConfigState& route_config_state = p.second;
+ for (const auto& p : route_config_state.watchers) {
+ p.first->OnError(GRPC_ERROR_REF(error));
+ }
+ }
+ for (const auto& p : cluster_map_) {
+ const ClusterState& cluster_state = p.second;
+ for (const auto& p : cluster_state.watchers) {
+ p.first->OnError(GRPC_ERROR_REF(error));
+ }
+ }
+ for (const auto& p : endpoint_map_) {
+ const EndpointState& endpoint_state = p.second;
+ for (const auto& p : endpoint_state.watchers) {
+ p.first->OnError(GRPC_ERROR_REF(error));
+ }
+ }
+ GRPC_ERROR_UNREF(error);
+}
+
+XdsApi::ClusterLoadReportMap XdsClient::BuildLoadReportSnapshotLocked(
+ bool send_all_clusters, const std::set<TString>& clusters) {
+ XdsApi::ClusterLoadReportMap snapshot_map;
+ for (auto load_report_it = load_report_map_.begin();
+ load_report_it != load_report_map_.end();) {
+ // Cluster key is cluster and EDS service name.
+ const auto& cluster_key = load_report_it->first;
+ LoadReportState& load_report = load_report_it->second;
+ // If the CDS response for a cluster indicates to use LRS but the
+ // LRS server does not say that it wants reports for this cluster,
+ // then we'll have stats objects here whose data we're not going to
+ // include in the load report. However, we still need to clear out
+ // the data from the stats objects, so that if the LRS server starts
+ // asking for the data in the future, we don't incorrectly include
+ // data from previous reporting intervals in that future report.
+ const bool record_stats =
+ send_all_clusters || clusters.find(cluster_key.first) != clusters.end();
+ XdsApi::ClusterLoadReport snapshot;
+ // Aggregate drop stats.
+ snapshot.dropped_requests = std::move(load_report.deleted_drop_stats);
+ for (auto& drop_stats : load_report.drop_stats) {
+ auto dropped_requests = drop_stats->GetSnapshotAndReset();
+ snapshot.dropped_requests += dropped_requests;
+ }
+ // Aggregate locality stats.
+ for (auto it = load_report.locality_stats.begin();
+ it != load_report.locality_stats.end();) {
+ const RefCountedPtr<XdsLocalityName>& locality_name = it->first;
+ auto& locality_state = it->second;
+ XdsClusterLocalityStats::Snapshot& locality_snapshot =
+ snapshot.locality_stats[locality_name];
+ for (auto& locality_stats : locality_state.locality_stats) {
+ locality_snapshot += locality_stats->GetSnapshotAndReset();
+ }
+ // Add final snapshots from recently deleted locality stats objects.
+ for (auto& deleted_locality_stats :
+ locality_state.deleted_locality_stats) {
+ locality_snapshot += deleted_locality_stats;
+ }
+ locality_state.deleted_locality_stats.clear();
+ // If the only thing left in this entry was final snapshots from
+ // deleted locality stats objects, remove the entry.
+ if (locality_state.locality_stats.empty()) {
+ it = load_report.locality_stats.erase(it);
+ } else {
+ ++it;
+ }
+ }
+ if (record_stats) {
+ // Compute load report interval.
+ const grpc_millis now = ExecCtx::Get()->Now();
+ snapshot.load_report_interval = now - load_report.last_report_time;
+ load_report.last_report_time = now;
+ // Record snapshot.
+ snapshot_map[cluster_key] = std::move(snapshot);
+ }
+ // If the only thing left in this entry was final snapshots from
+ // deleted stats objects, remove the entry.
+ if (load_report.locality_stats.empty() && load_report.drop_stats.empty()) {
+ load_report_it = load_report_map_.erase(load_report_it);
+ } else {
+ ++load_report_it;
+ }
+ }
+ return snapshot_map;
+}
+
+//
+// accessors for global state
+//
+
+void XdsClientGlobalInit() { g_mu = new Mutex; }
+
+void XdsClientGlobalShutdown() {
+ delete g_mu;
+ g_mu = nullptr;
+}
+
+RefCountedPtr<XdsClient> XdsClient::GetOrCreate(grpc_error** error) {
+ MutexLock lock(g_mu);
+ if (g_xds_client != nullptr) {
+ auto xds_client = g_xds_client->RefIfNonZero();
+ if (xds_client != nullptr) return xds_client;
+ }
+ auto xds_client = MakeRefCounted<XdsClient>(error);
+ g_xds_client = xds_client.get();
+ return xds_client;
+}
+
+namespace internal {
+
+void SetXdsChannelArgsForTest(grpc_channel_args* args) {
+ MutexLock lock(g_mu);
+ g_channel_args = args;
+}
+
+void UnsetGlobalXdsClientForTest() {
+ MutexLock lock(g_mu);
+ g_xds_client = nullptr;
+}
+
+} // namespace internal
+
+} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/ext/xds/xds_client.h b/contrib/libs/grpc/src/core/ext/xds/xds_client.h
index 3cb8a80860a..88b2cdbc2d0 100644
--- a/contrib/libs/grpc/src/core/ext/xds/xds_client.h
+++ b/contrib/libs/grpc/src/core/ext/xds/xds_client.h
@@ -1,330 +1,330 @@
-//
-// Copyright 2019 gRPC authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-#ifndef GRPC_CORE_EXT_XDS_XDS_CLIENT_H
-#define GRPC_CORE_EXT_XDS_XDS_CLIENT_H
-
-#include <grpc/support/port_platform.h>
-
-#include <set>
-#include <vector>
-
-#include "y_absl/strings/string_view.h"
-#include "y_absl/types/optional.h"
-
-#include "src/core/ext/xds/xds_api.h"
-#include "src/core/ext/xds/xds_bootstrap.h"
-#include "src/core/ext/xds/xds_client_stats.h"
-#include "src/core/lib/channel/channelz.h"
-#include "src/core/lib/gprpp/dual_ref_counted.h"
-#include "src/core/lib/gprpp/map.h"
-#include "src/core/lib/gprpp/memory.h"
-#include "src/core/lib/gprpp/orphanable.h"
-#include "src/core/lib/gprpp/ref_counted.h"
-#include "src/core/lib/gprpp/ref_counted_ptr.h"
-#include "src/core/lib/gprpp/sync.h"
-
-namespace grpc_core {
-
-extern TraceFlag xds_client_trace;
-
-class XdsClient : public DualRefCounted<XdsClient> {
- public:
- // Listener data watcher interface. Implemented by callers.
- class ListenerWatcherInterface {
- public:
- virtual ~ListenerWatcherInterface() = default;
- virtual void OnListenerChanged(XdsApi::LdsUpdate listener) = 0;
- virtual void OnError(grpc_error* error) = 0;
- virtual void OnResourceDoesNotExist() = 0;
- };
-
- // RouteConfiguration data watcher interface. Implemented by callers.
- class RouteConfigWatcherInterface {
- public:
- virtual ~RouteConfigWatcherInterface() = default;
- virtual void OnRouteConfigChanged(XdsApi::RdsUpdate route_config) = 0;
- virtual void OnError(grpc_error* error) = 0;
- virtual void OnResourceDoesNotExist() = 0;
- };
-
- // Cluster data watcher interface. Implemented by callers.
- class ClusterWatcherInterface {
- public:
- virtual ~ClusterWatcherInterface() = default;
- virtual void OnClusterChanged(XdsApi::CdsUpdate cluster_data) = 0;
- virtual void OnError(grpc_error* error) = 0;
- virtual void OnResourceDoesNotExist() = 0;
- };
-
- // Endpoint data watcher interface. Implemented by callers.
- class EndpointWatcherInterface {
- public:
- virtual ~EndpointWatcherInterface() = default;
- virtual void OnEndpointChanged(XdsApi::EdsUpdate update) = 0;
- virtual void OnError(grpc_error* error) = 0;
- virtual void OnResourceDoesNotExist() = 0;
- };
-
- // Factory function to get or create the global XdsClient instance.
- // If *error is not GRPC_ERROR_NONE upon return, then there was
- // an error initializing the client.
- static RefCountedPtr<XdsClient> GetOrCreate(grpc_error** error);
-
- // Callers should not instantiate directly. Use GetOrCreate() instead.
- explicit XdsClient(grpc_error** error);
- ~XdsClient();
-
- grpc_pollset_set* interested_parties() const { return interested_parties_; }
-
- // TODO(roth): When we add federation, there will be multiple channels
- // inside the XdsClient, and the set of channels may change over time,
- // but not every channel may use every one of the child channels, so
- // this API will need to change. At minumum, we will need to hold a
- // ref to the parent channelz node so that we can update its list of
- // children as the set of xDS channels changes. However, we may also
- // want to make this a bit more selective such that only those
- // channels on which a given parent channel is actually requesting
- // resources will actually be marked as its children.
- void AddChannelzLinkage(channelz::ChannelNode* parent_channelz_node);
- void RemoveChannelzLinkage(channelz::ChannelNode* parent_channelz_node);
-
- void Orphan() override;
-
- // Start and cancel listener data watch for a listener.
- // The XdsClient takes ownership of the watcher, but the caller may
- // keep a raw pointer to the watcher, which may be used only for
- // cancellation. (Because the caller does not own the watcher, the
- // pointer must not be used for any other purpose.)
- // If the caller is going to start a new watch after cancelling the
- // old one, it should set delay_unsubscription to true.
- void WatchListenerData(y_absl::string_view listener_name,
- std::unique_ptr<ListenerWatcherInterface> watcher);
- void CancelListenerDataWatch(y_absl::string_view listener_name,
- ListenerWatcherInterface* watcher,
- bool delay_unsubscription = false);
-
- // Start and cancel route config data watch for a listener.
- // The XdsClient takes ownership of the watcher, but the caller may
- // keep a raw pointer to the watcher, which may be used only for
- // cancellation. (Because the caller does not own the watcher, the
- // pointer must not be used for any other purpose.)
- // If the caller is going to start a new watch after cancelling the
- // old one, it should set delay_unsubscription to true.
- void WatchRouteConfigData(
- y_absl::string_view route_config_name,
- std::unique_ptr<RouteConfigWatcherInterface> watcher);
- void CancelRouteConfigDataWatch(y_absl::string_view route_config_name,
- RouteConfigWatcherInterface* watcher,
- bool delay_unsubscription = false);
-
- // Start and cancel cluster data watch for a cluster.
- // The XdsClient takes ownership of the watcher, but the caller may
- // keep a raw pointer to the watcher, which may be used only for
- // cancellation. (Because the caller does not own the watcher, the
- // pointer must not be used for any other purpose.)
- // If the caller is going to start a new watch after cancelling the
- // old one, it should set delay_unsubscription to true.
- void WatchClusterData(y_absl::string_view cluster_name,
- std::unique_ptr<ClusterWatcherInterface> watcher);
- void CancelClusterDataWatch(y_absl::string_view cluster_name,
- ClusterWatcherInterface* watcher,
- bool delay_unsubscription = false);
-
- // Start and cancel endpoint data watch for a cluster.
- // The XdsClient takes ownership of the watcher, but the caller may
- // keep a raw pointer to the watcher, which may be used only for
- // cancellation. (Because the caller does not own the watcher, the
- // pointer must not be used for any other purpose.)
- // If the caller is going to start a new watch after cancelling the
- // old one, it should set delay_unsubscription to true.
- void WatchEndpointData(y_absl::string_view eds_service_name,
- std::unique_ptr<EndpointWatcherInterface> watcher);
- void CancelEndpointDataWatch(y_absl::string_view eds_service_name,
- EndpointWatcherInterface* watcher,
- bool delay_unsubscription = false);
-
- // Adds and removes drop stats for cluster_name and eds_service_name.
- RefCountedPtr<XdsClusterDropStats> AddClusterDropStats(
- y_absl::string_view lrs_server, y_absl::string_view cluster_name,
- y_absl::string_view eds_service_name);
- void RemoveClusterDropStats(y_absl::string_view /*lrs_server*/,
- y_absl::string_view cluster_name,
- y_absl::string_view eds_service_name,
- XdsClusterDropStats* cluster_drop_stats);
-
- // Adds and removes locality stats for cluster_name and eds_service_name
- // for the specified locality.
- RefCountedPtr<XdsClusterLocalityStats> AddClusterLocalityStats(
- y_absl::string_view lrs_server, y_absl::string_view cluster_name,
- y_absl::string_view eds_service_name,
- RefCountedPtr<XdsLocalityName> locality);
- void RemoveClusterLocalityStats(
- y_absl::string_view /*lrs_server*/, y_absl::string_view cluster_name,
- y_absl::string_view eds_service_name,
- const RefCountedPtr<XdsLocalityName>& locality,
- XdsClusterLocalityStats* cluster_locality_stats);
-
- // Resets connection backoff state.
- void ResetBackoff();
-
- private:
- // Contains a channel to the xds server and all the data related to the
- // channel. Holds a ref to the xds client object.
- //
- // Currently, there is only one ChannelState object per XdsClient
- // object, and it has essentially the same lifetime. But in the
- // future, when we add federation support, a single XdsClient may have
- // multiple underlying channels to talk to different xDS servers.
- class ChannelState : public InternallyRefCounted<ChannelState> {
- public:
- template <typename T>
- class RetryableCall;
-
- class AdsCallState;
- class LrsCallState;
-
- ChannelState(WeakRefCountedPtr<XdsClient> xds_client,
- grpc_channel* channel);
- ~ChannelState();
-
- void Orphan() override;
-
- grpc_channel* channel() const { return channel_; }
- XdsClient* xds_client() const { return xds_client_.get(); }
- AdsCallState* ads_calld() const;
- LrsCallState* lrs_calld() const;
-
- void MaybeStartLrsCall();
- void StopLrsCall();
-
- bool HasActiveAdsCall() const;
-
- void StartConnectivityWatchLocked();
- void CancelConnectivityWatchLocked();
-
- void Subscribe(const TString& type_url, const TString& name);
- void Unsubscribe(const TString& type_url, const TString& name,
- bool delay_unsubscription);
-
- private:
- class StateWatcher;
-
- // The owning xds client.
- WeakRefCountedPtr<XdsClient> xds_client_;
-
- // The channel and its status.
- grpc_channel* channel_;
- bool shutting_down_ = false;
- StateWatcher* watcher_ = nullptr;
-
- // The retryable XDS calls.
- OrphanablePtr<RetryableCall<AdsCallState>> ads_calld_;
- OrphanablePtr<RetryableCall<LrsCallState>> lrs_calld_;
- };
-
- struct ListenerState {
- std::map<ListenerWatcherInterface*,
- std::unique_ptr<ListenerWatcherInterface>>
- watchers;
- // The latest data seen from LDS.
- y_absl::optional<XdsApi::LdsUpdate> update;
- };
-
- struct RouteConfigState {
- std::map<RouteConfigWatcherInterface*,
- std::unique_ptr<RouteConfigWatcherInterface>>
- watchers;
- // The latest data seen from RDS.
- y_absl::optional<XdsApi::RdsUpdate> update;
- };
-
- struct ClusterState {
- std::map<ClusterWatcherInterface*, std::unique_ptr<ClusterWatcherInterface>>
- watchers;
- // The latest data seen from CDS.
- y_absl::optional<XdsApi::CdsUpdate> update;
- };
-
- struct EndpointState {
- std::map<EndpointWatcherInterface*,
- std::unique_ptr<EndpointWatcherInterface>>
- watchers;
- // The latest data seen from EDS.
- y_absl::optional<XdsApi::EdsUpdate> update;
- };
-
- // TODO(roth): Change this to store exactly one instance of
- // XdsClusterDropStats and exactly one instance of
- // XdsClusterLocalityStats per locality. We can return multiple refs
- // to the same object instead of registering multiple objects.
- struct LoadReportState {
- struct LocalityState {
- std::set<XdsClusterLocalityStats*> locality_stats;
- std::vector<XdsClusterLocalityStats::Snapshot> deleted_locality_stats;
- };
-
- std::set<XdsClusterDropStats*> drop_stats;
- XdsClusterDropStats::Snapshot deleted_drop_stats;
- std::map<RefCountedPtr<XdsLocalityName>, LocalityState,
- XdsLocalityName::Less>
- locality_stats;
- grpc_millis last_report_time = ExecCtx::Get()->Now();
- };
-
- // Sends an error notification to all watchers.
- void NotifyOnErrorLocked(grpc_error* error);
-
- XdsApi::ClusterLoadReportMap BuildLoadReportSnapshotLocked(
- bool send_all_clusters, const std::set<TString>& clusters);
-
- const grpc_millis request_timeout_;
- grpc_pollset_set* interested_parties_;
- std::unique_ptr<XdsBootstrap> bootstrap_;
- XdsApi api_;
-
- Mutex mu_;
-
- // The channel for communicating with the xds server.
- OrphanablePtr<ChannelState> chand_;
-
- // One entry for each watched LDS resource.
- std::map<TString /*listener_name*/, ListenerState> listener_map_;
- // One entry for each watched RDS resource.
- std::map<TString /*route_config_name*/, RouteConfigState>
- route_config_map_;
- // One entry for each watched CDS resource.
- std::map<TString /*cluster_name*/, ClusterState> cluster_map_;
- // One entry for each watched EDS resource.
- std::map<TString /*eds_service_name*/, EndpointState> endpoint_map_;
-
- // Load report data.
- std::map<
- std::pair<TString /*cluster_name*/, TString /*eds_service_name*/>,
- LoadReportState>
- load_report_map_;
-
- bool shutting_down_ = false;
-};
-
-namespace internal {
-void SetXdsChannelArgsForTest(grpc_channel_args* args);
-void UnsetGlobalXdsClientForTest();
-} // namespace internal
-
-} // namespace grpc_core
-
-#endif /* GRPC_CORE_EXT_XDS_XDS_CLIENT_H */
+//
+// Copyright 2019 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+#ifndef GRPC_CORE_EXT_XDS_XDS_CLIENT_H
+#define GRPC_CORE_EXT_XDS_XDS_CLIENT_H
+
+#include <grpc/support/port_platform.h>
+
+#include <set>
+#include <vector>
+
+#include "y_absl/strings/string_view.h"
+#include "y_absl/types/optional.h"
+
+#include "src/core/ext/xds/xds_api.h"
+#include "src/core/ext/xds/xds_bootstrap.h"
+#include "src/core/ext/xds/xds_client_stats.h"
+#include "src/core/lib/channel/channelz.h"
+#include "src/core/lib/gprpp/dual_ref_counted.h"
+#include "src/core/lib/gprpp/map.h"
+#include "src/core/lib/gprpp/memory.h"
+#include "src/core/lib/gprpp/orphanable.h"
+#include "src/core/lib/gprpp/ref_counted.h"
+#include "src/core/lib/gprpp/ref_counted_ptr.h"
+#include "src/core/lib/gprpp/sync.h"
+
+namespace grpc_core {
+
+extern TraceFlag xds_client_trace;
+
+class XdsClient : public DualRefCounted<XdsClient> {
+ public:
+ // Listener data watcher interface. Implemented by callers.
+ class ListenerWatcherInterface {
+ public:
+ virtual ~ListenerWatcherInterface() = default;
+ virtual void OnListenerChanged(XdsApi::LdsUpdate listener) = 0;
+ virtual void OnError(grpc_error* error) = 0;
+ virtual void OnResourceDoesNotExist() = 0;
+ };
+
+ // RouteConfiguration data watcher interface. Implemented by callers.
+ class RouteConfigWatcherInterface {
+ public:
+ virtual ~RouteConfigWatcherInterface() = default;
+ virtual void OnRouteConfigChanged(XdsApi::RdsUpdate route_config) = 0;
+ virtual void OnError(grpc_error* error) = 0;
+ virtual void OnResourceDoesNotExist() = 0;
+ };
+
+ // Cluster data watcher interface. Implemented by callers.
+ class ClusterWatcherInterface {
+ public:
+ virtual ~ClusterWatcherInterface() = default;
+ virtual void OnClusterChanged(XdsApi::CdsUpdate cluster_data) = 0;
+ virtual void OnError(grpc_error* error) = 0;
+ virtual void OnResourceDoesNotExist() = 0;
+ };
+
+ // Endpoint data watcher interface. Implemented by callers.
+ class EndpointWatcherInterface {
+ public:
+ virtual ~EndpointWatcherInterface() = default;
+ virtual void OnEndpointChanged(XdsApi::EdsUpdate update) = 0;
+ virtual void OnError(grpc_error* error) = 0;
+ virtual void OnResourceDoesNotExist() = 0;
+ };
+
+ // Factory function to get or create the global XdsClient instance.
+ // If *error is not GRPC_ERROR_NONE upon return, then there was
+ // an error initializing the client.
+ static RefCountedPtr<XdsClient> GetOrCreate(grpc_error** error);
+
+ // Callers should not instantiate directly. Use GetOrCreate() instead.
+ explicit XdsClient(grpc_error** error);
+ ~XdsClient();
+
+ grpc_pollset_set* interested_parties() const { return interested_parties_; }
+
+ // TODO(roth): When we add federation, there will be multiple channels
+ // inside the XdsClient, and the set of channels may change over time,
+ // but not every channel may use every one of the child channels, so
+ // this API will need to change. At minumum, we will need to hold a
+ // ref to the parent channelz node so that we can update its list of
+ // children as the set of xDS channels changes. However, we may also
+ // want to make this a bit more selective such that only those
+ // channels on which a given parent channel is actually requesting
+ // resources will actually be marked as its children.
+ void AddChannelzLinkage(channelz::ChannelNode* parent_channelz_node);
+ void RemoveChannelzLinkage(channelz::ChannelNode* parent_channelz_node);
+
+ void Orphan() override;
+
+ // Start and cancel listener data watch for a listener.
+ // The XdsClient takes ownership of the watcher, but the caller may
+ // keep a raw pointer to the watcher, which may be used only for
+ // cancellation. (Because the caller does not own the watcher, the
+ // pointer must not be used for any other purpose.)
+ // If the caller is going to start a new watch after cancelling the
+ // old one, it should set delay_unsubscription to true.
+ void WatchListenerData(y_absl::string_view listener_name,
+ std::unique_ptr<ListenerWatcherInterface> watcher);
+ void CancelListenerDataWatch(y_absl::string_view listener_name,
+ ListenerWatcherInterface* watcher,
+ bool delay_unsubscription = false);
+
+ // Start and cancel route config data watch for a listener.
+ // The XdsClient takes ownership of the watcher, but the caller may
+ // keep a raw pointer to the watcher, which may be used only for
+ // cancellation. (Because the caller does not own the watcher, the
+ // pointer must not be used for any other purpose.)
+ // If the caller is going to start a new watch after cancelling the
+ // old one, it should set delay_unsubscription to true.
+ void WatchRouteConfigData(
+ y_absl::string_view route_config_name,
+ std::unique_ptr<RouteConfigWatcherInterface> watcher);
+ void CancelRouteConfigDataWatch(y_absl::string_view route_config_name,
+ RouteConfigWatcherInterface* watcher,
+ bool delay_unsubscription = false);
+
+ // Start and cancel cluster data watch for a cluster.
+ // The XdsClient takes ownership of the watcher, but the caller may
+ // keep a raw pointer to the watcher, which may be used only for
+ // cancellation. (Because the caller does not own the watcher, the
+ // pointer must not be used for any other purpose.)
+ // If the caller is going to start a new watch after cancelling the
+ // old one, it should set delay_unsubscription to true.
+ void WatchClusterData(y_absl::string_view cluster_name,
+ std::unique_ptr<ClusterWatcherInterface> watcher);
+ void CancelClusterDataWatch(y_absl::string_view cluster_name,
+ ClusterWatcherInterface* watcher,
+ bool delay_unsubscription = false);
+
+ // Start and cancel endpoint data watch for a cluster.
+ // The XdsClient takes ownership of the watcher, but the caller may
+ // keep a raw pointer to the watcher, which may be used only for
+ // cancellation. (Because the caller does not own the watcher, the
+ // pointer must not be used for any other purpose.)
+ // If the caller is going to start a new watch after cancelling the
+ // old one, it should set delay_unsubscription to true.
+ void WatchEndpointData(y_absl::string_view eds_service_name,
+ std::unique_ptr<EndpointWatcherInterface> watcher);
+ void CancelEndpointDataWatch(y_absl::string_view eds_service_name,
+ EndpointWatcherInterface* watcher,
+ bool delay_unsubscription = false);
+
+ // Adds and removes drop stats for cluster_name and eds_service_name.
+ RefCountedPtr<XdsClusterDropStats> AddClusterDropStats(
+ y_absl::string_view lrs_server, y_absl::string_view cluster_name,
+ y_absl::string_view eds_service_name);
+ void RemoveClusterDropStats(y_absl::string_view /*lrs_server*/,
+ y_absl::string_view cluster_name,
+ y_absl::string_view eds_service_name,
+ XdsClusterDropStats* cluster_drop_stats);
+
+ // Adds and removes locality stats for cluster_name and eds_service_name
+ // for the specified locality.
+ RefCountedPtr<XdsClusterLocalityStats> AddClusterLocalityStats(
+ y_absl::string_view lrs_server, y_absl::string_view cluster_name,
+ y_absl::string_view eds_service_name,
+ RefCountedPtr<XdsLocalityName> locality);
+ void RemoveClusterLocalityStats(
+ y_absl::string_view /*lrs_server*/, y_absl::string_view cluster_name,
+ y_absl::string_view eds_service_name,
+ const RefCountedPtr<XdsLocalityName>& locality,
+ XdsClusterLocalityStats* cluster_locality_stats);
+
+ // Resets connection backoff state.
+ void ResetBackoff();
+
+ private:
+ // Contains a channel to the xds server and all the data related to the
+ // channel. Holds a ref to the xds client object.
+ //
+ // Currently, there is only one ChannelState object per XdsClient
+ // object, and it has essentially the same lifetime. But in the
+ // future, when we add federation support, a single XdsClient may have
+ // multiple underlying channels to talk to different xDS servers.
+ class ChannelState : public InternallyRefCounted<ChannelState> {
+ public:
+ template <typename T>
+ class RetryableCall;
+
+ class AdsCallState;
+ class LrsCallState;
+
+ ChannelState(WeakRefCountedPtr<XdsClient> xds_client,
+ grpc_channel* channel);
+ ~ChannelState();
+
+ void Orphan() override;
+
+ grpc_channel* channel() const { return channel_; }
+ XdsClient* xds_client() const { return xds_client_.get(); }
+ AdsCallState* ads_calld() const;
+ LrsCallState* lrs_calld() const;
+
+ void MaybeStartLrsCall();
+ void StopLrsCall();
+
+ bool HasActiveAdsCall() const;
+
+ void StartConnectivityWatchLocked();
+ void CancelConnectivityWatchLocked();
+
+ void Subscribe(const TString& type_url, const TString& name);
+ void Unsubscribe(const TString& type_url, const TString& name,
+ bool delay_unsubscription);
+
+ private:
+ class StateWatcher;
+
+ // The owning xds client.
+ WeakRefCountedPtr<XdsClient> xds_client_;
+
+ // The channel and its status.
+ grpc_channel* channel_;
+ bool shutting_down_ = false;
+ StateWatcher* watcher_ = nullptr;
+
+ // The retryable XDS calls.
+ OrphanablePtr<RetryableCall<AdsCallState>> ads_calld_;
+ OrphanablePtr<RetryableCall<LrsCallState>> lrs_calld_;
+ };
+
+ struct ListenerState {
+ std::map<ListenerWatcherInterface*,
+ std::unique_ptr<ListenerWatcherInterface>>
+ watchers;
+ // The latest data seen from LDS.
+ y_absl::optional<XdsApi::LdsUpdate> update;
+ };
+
+ struct RouteConfigState {
+ std::map<RouteConfigWatcherInterface*,
+ std::unique_ptr<RouteConfigWatcherInterface>>
+ watchers;
+ // The latest data seen from RDS.
+ y_absl::optional<XdsApi::RdsUpdate> update;
+ };
+
+ struct ClusterState {
+ std::map<ClusterWatcherInterface*, std::unique_ptr<ClusterWatcherInterface>>
+ watchers;
+ // The latest data seen from CDS.
+ y_absl::optional<XdsApi::CdsUpdate> update;
+ };
+
+ struct EndpointState {
+ std::map<EndpointWatcherInterface*,
+ std::unique_ptr<EndpointWatcherInterface>>
+ watchers;
+ // The latest data seen from EDS.
+ y_absl::optional<XdsApi::EdsUpdate> update;
+ };
+
+ // TODO(roth): Change this to store exactly one instance of
+ // XdsClusterDropStats and exactly one instance of
+ // XdsClusterLocalityStats per locality. We can return multiple refs
+ // to the same object instead of registering multiple objects.
+ struct LoadReportState {
+ struct LocalityState {
+ std::set<XdsClusterLocalityStats*> locality_stats;
+ std::vector<XdsClusterLocalityStats::Snapshot> deleted_locality_stats;
+ };
+
+ std::set<XdsClusterDropStats*> drop_stats;
+ XdsClusterDropStats::Snapshot deleted_drop_stats;
+ std::map<RefCountedPtr<XdsLocalityName>, LocalityState,
+ XdsLocalityName::Less>
+ locality_stats;
+ grpc_millis last_report_time = ExecCtx::Get()->Now();
+ };
+
+ // Sends an error notification to all watchers.
+ void NotifyOnErrorLocked(grpc_error* error);
+
+ XdsApi::ClusterLoadReportMap BuildLoadReportSnapshotLocked(
+ bool send_all_clusters, const std::set<TString>& clusters);
+
+ const grpc_millis request_timeout_;
+ grpc_pollset_set* interested_parties_;
+ std::unique_ptr<XdsBootstrap> bootstrap_;
+ XdsApi api_;
+
+ Mutex mu_;
+
+ // The channel for communicating with the xds server.
+ OrphanablePtr<ChannelState> chand_;
+
+ // One entry for each watched LDS resource.
+ std::map<TString /*listener_name*/, ListenerState> listener_map_;
+ // One entry for each watched RDS resource.
+ std::map<TString /*route_config_name*/, RouteConfigState>
+ route_config_map_;
+ // One entry for each watched CDS resource.
+ std::map<TString /*cluster_name*/, ClusterState> cluster_map_;
+ // One entry for each watched EDS resource.
+ std::map<TString /*eds_service_name*/, EndpointState> endpoint_map_;
+
+ // Load report data.
+ std::map<
+ std::pair<TString /*cluster_name*/, TString /*eds_service_name*/>,
+ LoadReportState>
+ load_report_map_;
+
+ bool shutting_down_ = false;
+};
+
+namespace internal {
+void SetXdsChannelArgsForTest(grpc_channel_args* args);
+void UnsetGlobalXdsClientForTest();
+} // namespace internal
+
+} // namespace grpc_core
+
+#endif /* GRPC_CORE_EXT_XDS_XDS_CLIENT_H */
diff --git a/contrib/libs/grpc/src/core/ext/xds/xds_client_stats.cc b/contrib/libs/grpc/src/core/ext/xds/xds_client_stats.cc
index d69a1f00ee7..7a9abd236ad 100644
--- a/contrib/libs/grpc/src/core/ext/xds/xds_client_stats.cc
+++ b/contrib/libs/grpc/src/core/ext/xds/xds_client_stats.cc
@@ -1,121 +1,121 @@
-/*
- *
- * Copyright 2018 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <grpc/support/port_platform.h>
-
-#include "src/core/ext/xds/xds_client_stats.h"
-
-#include <string.h>
-
-#include <grpc/support/atm.h>
-#include <grpc/support/string_util.h>
-
-#include "src/core/ext/xds/xds_client.h"
-
-namespace grpc_core {
-
-namespace {
-
-uint64_t GetAndResetCounter(Atomic<uint64_t>* from) {
- return from->Exchange(0, MemoryOrder::RELAXED);
-}
-
-} // namespace
-
-//
-// XdsClusterDropStats
-//
-
-XdsClusterDropStats::XdsClusterDropStats(RefCountedPtr<XdsClient> xds_client,
- y_absl::string_view lrs_server_name,
- y_absl::string_view cluster_name,
- y_absl::string_view eds_service_name)
- : xds_client_(std::move(xds_client)),
- lrs_server_name_(lrs_server_name),
- cluster_name_(cluster_name),
- eds_service_name_(eds_service_name) {}
-
-XdsClusterDropStats::~XdsClusterDropStats() {
- xds_client_->RemoveClusterDropStats(lrs_server_name_, cluster_name_,
- eds_service_name_, this);
- xds_client_.reset(DEBUG_LOCATION, "DropStats");
-}
-
-XdsClusterDropStats::Snapshot XdsClusterDropStats::GetSnapshotAndReset() {
- Snapshot snapshot;
- snapshot.uncategorized_drops = GetAndResetCounter(&uncategorized_drops_);
- MutexLock lock(&mu_);
- snapshot.categorized_drops = std::move(categorized_drops_);
- return snapshot;
-}
-
-void XdsClusterDropStats::AddUncategorizedDrops() {
- uncategorized_drops_.FetchAdd(1);
-}
-
-void XdsClusterDropStats::AddCallDropped(const TString& category) {
- MutexLock lock(&mu_);
- ++categorized_drops_[category];
-}
-
-//
-// XdsClusterLocalityStats
-//
-
-XdsClusterLocalityStats::XdsClusterLocalityStats(
- RefCountedPtr<XdsClient> xds_client, y_absl::string_view lrs_server_name,
- y_absl::string_view cluster_name, y_absl::string_view eds_service_name,
- RefCountedPtr<XdsLocalityName> name)
- : xds_client_(std::move(xds_client)),
- lrs_server_name_(lrs_server_name),
- cluster_name_(cluster_name),
- eds_service_name_(eds_service_name),
- name_(std::move(name)) {}
-
-XdsClusterLocalityStats::~XdsClusterLocalityStats() {
- xds_client_->RemoveClusterLocalityStats(lrs_server_name_, cluster_name_,
- eds_service_name_, name_, this);
- xds_client_.reset(DEBUG_LOCATION, "LocalityStats");
-}
-
-XdsClusterLocalityStats::Snapshot
-XdsClusterLocalityStats::GetSnapshotAndReset() {
- Snapshot snapshot = {GetAndResetCounter(&total_successful_requests_),
- // Don't reset total_requests_in_progress because it's
- // not related to a single reporting interval.
- total_requests_in_progress_.Load(MemoryOrder::RELAXED),
- GetAndResetCounter(&total_error_requests_),
- GetAndResetCounter(&total_issued_requests_)};
- MutexLock lock(&backend_metrics_mu_);
- snapshot.backend_metrics = std::move(backend_metrics_);
- return snapshot;
-}
-
-void XdsClusterLocalityStats::AddCallStarted() {
- total_issued_requests_.FetchAdd(1, MemoryOrder::RELAXED);
- total_requests_in_progress_.FetchAdd(1, MemoryOrder::RELAXED);
-}
-
-void XdsClusterLocalityStats::AddCallFinished(bool fail) {
- Atomic<uint64_t>& to_increment =
- fail ? total_error_requests_ : total_successful_requests_;
- to_increment.FetchAdd(1, MemoryOrder::RELAXED);
- total_requests_in_progress_.FetchAdd(-1, MemoryOrder::ACQ_REL);
-}
-
-} // namespace grpc_core
+/*
+ *
+ * Copyright 2018 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/ext/xds/xds_client_stats.h"
+
+#include <string.h>
+
+#include <grpc/support/atm.h>
+#include <grpc/support/string_util.h>
+
+#include "src/core/ext/xds/xds_client.h"
+
+namespace grpc_core {
+
+namespace {
+
+uint64_t GetAndResetCounter(Atomic<uint64_t>* from) {
+ return from->Exchange(0, MemoryOrder::RELAXED);
+}
+
+} // namespace
+
+//
+// XdsClusterDropStats
+//
+
+XdsClusterDropStats::XdsClusterDropStats(RefCountedPtr<XdsClient> xds_client,
+ y_absl::string_view lrs_server_name,
+ y_absl::string_view cluster_name,
+ y_absl::string_view eds_service_name)
+ : xds_client_(std::move(xds_client)),
+ lrs_server_name_(lrs_server_name),
+ cluster_name_(cluster_name),
+ eds_service_name_(eds_service_name) {}
+
+XdsClusterDropStats::~XdsClusterDropStats() {
+ xds_client_->RemoveClusterDropStats(lrs_server_name_, cluster_name_,
+ eds_service_name_, this);
+ xds_client_.reset(DEBUG_LOCATION, "DropStats");
+}
+
+XdsClusterDropStats::Snapshot XdsClusterDropStats::GetSnapshotAndReset() {
+ Snapshot snapshot;
+ snapshot.uncategorized_drops = GetAndResetCounter(&uncategorized_drops_);
+ MutexLock lock(&mu_);
+ snapshot.categorized_drops = std::move(categorized_drops_);
+ return snapshot;
+}
+
+void XdsClusterDropStats::AddUncategorizedDrops() {
+ uncategorized_drops_.FetchAdd(1);
+}
+
+void XdsClusterDropStats::AddCallDropped(const TString& category) {
+ MutexLock lock(&mu_);
+ ++categorized_drops_[category];
+}
+
+//
+// XdsClusterLocalityStats
+//
+
+XdsClusterLocalityStats::XdsClusterLocalityStats(
+ RefCountedPtr<XdsClient> xds_client, y_absl::string_view lrs_server_name,
+ y_absl::string_view cluster_name, y_absl::string_view eds_service_name,
+ RefCountedPtr<XdsLocalityName> name)
+ : xds_client_(std::move(xds_client)),
+ lrs_server_name_(lrs_server_name),
+ cluster_name_(cluster_name),
+ eds_service_name_(eds_service_name),
+ name_(std::move(name)) {}
+
+XdsClusterLocalityStats::~XdsClusterLocalityStats() {
+ xds_client_->RemoveClusterLocalityStats(lrs_server_name_, cluster_name_,
+ eds_service_name_, name_, this);
+ xds_client_.reset(DEBUG_LOCATION, "LocalityStats");
+}
+
+XdsClusterLocalityStats::Snapshot
+XdsClusterLocalityStats::GetSnapshotAndReset() {
+ Snapshot snapshot = {GetAndResetCounter(&total_successful_requests_),
+ // Don't reset total_requests_in_progress because it's
+ // not related to a single reporting interval.
+ total_requests_in_progress_.Load(MemoryOrder::RELAXED),
+ GetAndResetCounter(&total_error_requests_),
+ GetAndResetCounter(&total_issued_requests_)};
+ MutexLock lock(&backend_metrics_mu_);
+ snapshot.backend_metrics = std::move(backend_metrics_);
+ return snapshot;
+}
+
+void XdsClusterLocalityStats::AddCallStarted() {
+ total_issued_requests_.FetchAdd(1, MemoryOrder::RELAXED);
+ total_requests_in_progress_.FetchAdd(1, MemoryOrder::RELAXED);
+}
+
+void XdsClusterLocalityStats::AddCallFinished(bool fail) {
+ Atomic<uint64_t>& to_increment =
+ fail ? total_error_requests_ : total_successful_requests_;
+ to_increment.FetchAdd(1, MemoryOrder::RELAXED);
+ total_requests_in_progress_.FetchAdd(-1, MemoryOrder::ACQ_REL);
+}
+
+} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/ext/xds/xds_client_stats.h b/contrib/libs/grpc/src/core/ext/xds/xds_client_stats.h
index d49df8302b5..b3e3b316d1a 100644
--- a/contrib/libs/grpc/src/core/ext/xds/xds_client_stats.h
+++ b/contrib/libs/grpc/src/core/ext/xds/xds_client_stats.h
@@ -1,239 +1,239 @@
-/*
- *
- * Copyright 2018 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#ifndef GRPC_CORE_EXT_XDS_XDS_CLIENT_STATS_H
-#define GRPC_CORE_EXT_XDS_XDS_CLIENT_STATS_H
-
-#include <grpc/support/port_platform.h>
-
-#include <map>
-#include <util/generic/string.h>
-
-#include "y_absl/strings/str_cat.h"
-#include "y_absl/strings/str_format.h"
-#include "y_absl/strings/string_view.h"
-
-#include "src/core/lib/gpr/useful.h"
-#include "src/core/lib/gprpp/atomic.h"
-#include "src/core/lib/gprpp/memory.h"
-#include "src/core/lib/gprpp/ref_counted.h"
-#include "src/core/lib/gprpp/sync.h"
-#include "src/core/lib/iomgr/exec_ctx.h"
-
-namespace grpc_core {
-
-// Forward declaration to avoid circular dependency.
-class XdsClient;
-
-// Locality name.
-class XdsLocalityName : public RefCounted<XdsLocalityName> {
- public:
- struct Less {
- bool operator()(const XdsLocalityName* lhs,
- const XdsLocalityName* rhs) const {
- if (lhs == nullptr || rhs == nullptr) return GPR_ICMP(lhs, rhs);
- return lhs->Compare(*rhs) < 0;
- }
-
- bool operator()(const RefCountedPtr<XdsLocalityName>& lhs,
- const RefCountedPtr<XdsLocalityName>& rhs) const {
- return (*this)(lhs.get(), rhs.get());
- }
- };
-
- XdsLocalityName(TString region, TString zone, TString subzone)
- : region_(std::move(region)),
- zone_(std::move(zone)),
- sub_zone_(std::move(subzone)) {}
-
- bool operator==(const XdsLocalityName& other) const {
- return region_ == other.region_ && zone_ == other.zone_ &&
- sub_zone_ == other.sub_zone_;
- }
-
- bool operator!=(const XdsLocalityName& other) const {
- return !(*this == other);
- }
-
- int Compare(const XdsLocalityName& other) const {
- int cmp_result = region_.compare(other.region_);
- if (cmp_result != 0) return cmp_result;
- cmp_result = zone_.compare(other.zone_);
- if (cmp_result != 0) return cmp_result;
- return sub_zone_.compare(other.sub_zone_);
- }
-
- const TString& region() const { return region_; }
- const TString& zone() const { return zone_; }
- const TString& sub_zone() const { return sub_zone_; }
-
- const TString& AsHumanReadableString() {
- if (human_readable_string_.empty()) {
- human_readable_string_ =
- y_absl::StrFormat("{region=\"%s\", zone=\"%s\", sub_zone=\"%s\"}",
- region_, zone_, sub_zone_);
- }
- return human_readable_string_;
- }
-
- private:
- TString region_;
- TString zone_;
- TString sub_zone_;
- TString human_readable_string_;
-};
-
-// Drop stats for an xds cluster.
-class XdsClusterDropStats : public RefCounted<XdsClusterDropStats> {
- public:
- // The total number of requests dropped for any reason is the sum of
- // uncategorized_drops, and dropped_requests map.
- using CategorizedDropsMap = std::map<TString /* category */, uint64_t>;
- struct Snapshot {
- uint64_t uncategorized_drops = 0;
- // The number of requests dropped for the specific drop categories
- // outlined in the drop_overloads field in the EDS response.
- CategorizedDropsMap categorized_drops;
-
- Snapshot& operator+=(const Snapshot& other) {
- uncategorized_drops += other.uncategorized_drops;
- for (const auto& p : other.categorized_drops) {
- categorized_drops[p.first] += p.second;
- }
- return *this;
- }
-
- bool IsZero() const {
- if (uncategorized_drops != 0) return false;
- for (const auto& p : categorized_drops) {
- if (p.second != 0) return false;
- }
- return true;
- }
- };
-
- XdsClusterDropStats(RefCountedPtr<XdsClient> xds_client,
- y_absl::string_view lrs_server_name,
- y_absl::string_view cluster_name,
- y_absl::string_view eds_service_name);
- ~XdsClusterDropStats();
-
- // Returns a snapshot of this instance and resets all the counters.
- Snapshot GetSnapshotAndReset();
-
- void AddUncategorizedDrops();
- void AddCallDropped(const TString& category);
-
- private:
- RefCountedPtr<XdsClient> xds_client_;
- y_absl::string_view lrs_server_name_;
- y_absl::string_view cluster_name_;
- y_absl::string_view eds_service_name_;
- Atomic<uint64_t> uncategorized_drops_{0};
- // Protects categorized_drops_. A mutex is necessary because the length of
- // dropped_requests can be accessed by both the picker (from data plane
- // mutex) and the load reporting thread (from the control plane combiner).
- Mutex mu_;
- CategorizedDropsMap categorized_drops_;
-};
-
-// Locality stats for an xds cluster.
-class XdsClusterLocalityStats : public RefCounted<XdsClusterLocalityStats> {
- public:
- struct BackendMetric {
- uint64_t num_requests_finished_with_metric;
- double total_metric_value;
-
- BackendMetric& operator+=(const BackendMetric& other) {
- num_requests_finished_with_metric +=
- other.num_requests_finished_with_metric;
- total_metric_value += other.total_metric_value;
- return *this;
- }
-
- bool IsZero() const {
- return num_requests_finished_with_metric == 0 && total_metric_value == 0;
- }
- };
-
- struct Snapshot {
- uint64_t total_successful_requests;
- uint64_t total_requests_in_progress;
- uint64_t total_error_requests;
- uint64_t total_issued_requests;
- std::map<TString, BackendMetric> backend_metrics;
-
- Snapshot& operator+=(const Snapshot& other) {
- total_successful_requests += other.total_successful_requests;
- total_requests_in_progress += other.total_requests_in_progress;
- total_error_requests += other.total_error_requests;
- total_issued_requests += other.total_issued_requests;
- for (const auto& p : other.backend_metrics) {
- backend_metrics[p.first] += p.second;
- }
- return *this;
- }
-
- bool IsZero() const {
- if (total_successful_requests != 0 || total_requests_in_progress != 0 ||
- total_error_requests != 0 || total_issued_requests != 0) {
- return false;
- }
- for (const auto& p : backend_metrics) {
- if (!p.second.IsZero()) return false;
- }
- return true;
- }
- };
-
- XdsClusterLocalityStats(RefCountedPtr<XdsClient> xds_client,
- y_absl::string_view lrs_server_name,
- y_absl::string_view cluster_name,
- y_absl::string_view eds_service_name,
- RefCountedPtr<XdsLocalityName> name);
- ~XdsClusterLocalityStats();
-
- // Returns a snapshot of this instance and resets all the counters.
- Snapshot GetSnapshotAndReset();
-
- void AddCallStarted();
- void AddCallFinished(bool fail = false);
-
- private:
- RefCountedPtr<XdsClient> xds_client_;
- y_absl::string_view lrs_server_name_;
- y_absl::string_view cluster_name_;
- y_absl::string_view eds_service_name_;
- RefCountedPtr<XdsLocalityName> name_;
-
- Atomic<uint64_t> total_successful_requests_{0};
- Atomic<uint64_t> total_requests_in_progress_{0};
- Atomic<uint64_t> total_error_requests_{0};
- Atomic<uint64_t> total_issued_requests_{0};
-
- // Protects backend_metrics_. A mutex is necessary because the length of
- // backend_metrics_ can be accessed by both the callback intercepting the
- // call's recv_trailing_metadata (not from the control plane work serializer)
- // and the load reporting thread (from the control plane work serializer).
- Mutex backend_metrics_mu_;
- std::map<TString, BackendMetric> backend_metrics_;
-};
-
-} // namespace grpc_core
-
-#endif /* GRPC_CORE_EXT_XDS_XDS_CLIENT_STATS_H */
+/*
+ *
+ * Copyright 2018 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef GRPC_CORE_EXT_XDS_XDS_CLIENT_STATS_H
+#define GRPC_CORE_EXT_XDS_XDS_CLIENT_STATS_H
+
+#include <grpc/support/port_platform.h>
+
+#include <map>
+#include <util/generic/string.h>
+
+#include "y_absl/strings/str_cat.h"
+#include "y_absl/strings/str_format.h"
+#include "y_absl/strings/string_view.h"
+
+#include "src/core/lib/gpr/useful.h"
+#include "src/core/lib/gprpp/atomic.h"
+#include "src/core/lib/gprpp/memory.h"
+#include "src/core/lib/gprpp/ref_counted.h"
+#include "src/core/lib/gprpp/sync.h"
+#include "src/core/lib/iomgr/exec_ctx.h"
+
+namespace grpc_core {
+
+// Forward declaration to avoid circular dependency.
+class XdsClient;
+
+// Locality name.
+class XdsLocalityName : public RefCounted<XdsLocalityName> {
+ public:
+ struct Less {
+ bool operator()(const XdsLocalityName* lhs,
+ const XdsLocalityName* rhs) const {
+ if (lhs == nullptr || rhs == nullptr) return GPR_ICMP(lhs, rhs);
+ return lhs->Compare(*rhs) < 0;
+ }
+
+ bool operator()(const RefCountedPtr<XdsLocalityName>& lhs,
+ const RefCountedPtr<XdsLocalityName>& rhs) const {
+ return (*this)(lhs.get(), rhs.get());
+ }
+ };
+
+ XdsLocalityName(TString region, TString zone, TString subzone)
+ : region_(std::move(region)),
+ zone_(std::move(zone)),
+ sub_zone_(std::move(subzone)) {}
+
+ bool operator==(const XdsLocalityName& other) const {
+ return region_ == other.region_ && zone_ == other.zone_ &&
+ sub_zone_ == other.sub_zone_;
+ }
+
+ bool operator!=(const XdsLocalityName& other) const {
+ return !(*this == other);
+ }
+
+ int Compare(const XdsLocalityName& other) const {
+ int cmp_result = region_.compare(other.region_);
+ if (cmp_result != 0) return cmp_result;
+ cmp_result = zone_.compare(other.zone_);
+ if (cmp_result != 0) return cmp_result;
+ return sub_zone_.compare(other.sub_zone_);
+ }
+
+ const TString& region() const { return region_; }
+ const TString& zone() const { return zone_; }
+ const TString& sub_zone() const { return sub_zone_; }
+
+ const TString& AsHumanReadableString() {
+ if (human_readable_string_.empty()) {
+ human_readable_string_ =
+ y_absl::StrFormat("{region=\"%s\", zone=\"%s\", sub_zone=\"%s\"}",
+ region_, zone_, sub_zone_);
+ }
+ return human_readable_string_;
+ }
+
+ private:
+ TString region_;
+ TString zone_;
+ TString sub_zone_;
+ TString human_readable_string_;
+};
+
+// Drop stats for an xds cluster.
+class XdsClusterDropStats : public RefCounted<XdsClusterDropStats> {
+ public:
+ // The total number of requests dropped for any reason is the sum of
+ // uncategorized_drops, and dropped_requests map.
+ using CategorizedDropsMap = std::map<TString /* category */, uint64_t>;
+ struct Snapshot {
+ uint64_t uncategorized_drops = 0;
+ // The number of requests dropped for the specific drop categories
+ // outlined in the drop_overloads field in the EDS response.
+ CategorizedDropsMap categorized_drops;
+
+ Snapshot& operator+=(const Snapshot& other) {
+ uncategorized_drops += other.uncategorized_drops;
+ for (const auto& p : other.categorized_drops) {
+ categorized_drops[p.first] += p.second;
+ }
+ return *this;
+ }
+
+ bool IsZero() const {
+ if (uncategorized_drops != 0) return false;
+ for (const auto& p : categorized_drops) {
+ if (p.second != 0) return false;
+ }
+ return true;
+ }
+ };
+
+ XdsClusterDropStats(RefCountedPtr<XdsClient> xds_client,
+ y_absl::string_view lrs_server_name,
+ y_absl::string_view cluster_name,
+ y_absl::string_view eds_service_name);
+ ~XdsClusterDropStats();
+
+ // Returns a snapshot of this instance and resets all the counters.
+ Snapshot GetSnapshotAndReset();
+
+ void AddUncategorizedDrops();
+ void AddCallDropped(const TString& category);
+
+ private:
+ RefCountedPtr<XdsClient> xds_client_;
+ y_absl::string_view lrs_server_name_;
+ y_absl::string_view cluster_name_;
+ y_absl::string_view eds_service_name_;
+ Atomic<uint64_t> uncategorized_drops_{0};
+ // Protects categorized_drops_. A mutex is necessary because the length of
+ // dropped_requests can be accessed by both the picker (from data plane
+ // mutex) and the load reporting thread (from the control plane combiner).
+ Mutex mu_;
+ CategorizedDropsMap categorized_drops_;
+};
+
+// Locality stats for an xds cluster.
+class XdsClusterLocalityStats : public RefCounted<XdsClusterLocalityStats> {
+ public:
+ struct BackendMetric {
+ uint64_t num_requests_finished_with_metric;
+ double total_metric_value;
+
+ BackendMetric& operator+=(const BackendMetric& other) {
+ num_requests_finished_with_metric +=
+ other.num_requests_finished_with_metric;
+ total_metric_value += other.total_metric_value;
+ return *this;
+ }
+
+ bool IsZero() const {
+ return num_requests_finished_with_metric == 0 && total_metric_value == 0;
+ }
+ };
+
+ struct Snapshot {
+ uint64_t total_successful_requests;
+ uint64_t total_requests_in_progress;
+ uint64_t total_error_requests;
+ uint64_t total_issued_requests;
+ std::map<TString, BackendMetric> backend_metrics;
+
+ Snapshot& operator+=(const Snapshot& other) {
+ total_successful_requests += other.total_successful_requests;
+ total_requests_in_progress += other.total_requests_in_progress;
+ total_error_requests += other.total_error_requests;
+ total_issued_requests += other.total_issued_requests;
+ for (const auto& p : other.backend_metrics) {
+ backend_metrics[p.first] += p.second;
+ }
+ return *this;
+ }
+
+ bool IsZero() const {
+ if (total_successful_requests != 0 || total_requests_in_progress != 0 ||
+ total_error_requests != 0 || total_issued_requests != 0) {
+ return false;
+ }
+ for (const auto& p : backend_metrics) {
+ if (!p.second.IsZero()) return false;
+ }
+ return true;
+ }
+ };
+
+ XdsClusterLocalityStats(RefCountedPtr<XdsClient> xds_client,
+ y_absl::string_view lrs_server_name,
+ y_absl::string_view cluster_name,
+ y_absl::string_view eds_service_name,
+ RefCountedPtr<XdsLocalityName> name);
+ ~XdsClusterLocalityStats();
+
+ // Returns a snapshot of this instance and resets all the counters.
+ Snapshot GetSnapshotAndReset();
+
+ void AddCallStarted();
+ void AddCallFinished(bool fail = false);
+
+ private:
+ RefCountedPtr<XdsClient> xds_client_;
+ y_absl::string_view lrs_server_name_;
+ y_absl::string_view cluster_name_;
+ y_absl::string_view eds_service_name_;
+ RefCountedPtr<XdsLocalityName> name_;
+
+ Atomic<uint64_t> total_successful_requests_{0};
+ Atomic<uint64_t> total_requests_in_progress_{0};
+ Atomic<uint64_t> total_error_requests_{0};
+ Atomic<uint64_t> total_issued_requests_{0};
+
+ // Protects backend_metrics_. A mutex is necessary because the length of
+ // backend_metrics_ can be accessed by both the callback intercepting the
+ // call's recv_trailing_metadata (not from the control plane work serializer)
+ // and the load reporting thread (from the control plane work serializer).
+ Mutex backend_metrics_mu_;
+ std::map<TString, BackendMetric> backend_metrics_;
+};
+
+} // namespace grpc_core
+
+#endif /* GRPC_CORE_EXT_XDS_XDS_CLIENT_STATS_H */
diff --git a/contrib/libs/grpc/src/core/lib/.yandex_meta/licenses.list.txt b/contrib/libs/grpc/src/core/lib/.yandex_meta/licenses.list.txt
index 0aab52b4382..e5eda936759 100644
--- a/contrib/libs/grpc/src/core/lib/.yandex_meta/licenses.list.txt
+++ b/contrib/libs/grpc/src/core/lib/.yandex_meta/licenses.list.txt
@@ -1,54 +1,54 @@
-====================Apache-2.0====================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
-
-
-====================Apache-2.0====================
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-
-====================COPYRIGHT====================
- * Copyright 2015 gRPC authors.
-
-
-====================COPYRIGHT====================
- * Copyright 2015-2016 gRPC authors.
-
-
-====================COPYRIGHT====================
- * Copyright 2016 gRPC authors.
-
-
-====================COPYRIGHT====================
- * Copyright 2017 gRPC authors.
-
-
-====================COPYRIGHT====================
- * Copyright 2018 gRPC authors.
-
-
-====================COPYRIGHT====================
- * Copyright 2020 gRPC authors.
-
-
-====================COPYRIGHT====================
-# Copyright 2019 gRPC authors.
+====================Apache-2.0====================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+
+
+====================Apache-2.0====================
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+
+====================COPYRIGHT====================
+ * Copyright 2015 gRPC authors.
+
+
+====================COPYRIGHT====================
+ * Copyright 2015-2016 gRPC authors.
+
+
+====================COPYRIGHT====================
+ * Copyright 2016 gRPC authors.
+
+
+====================COPYRIGHT====================
+ * Copyright 2017 gRPC authors.
+
+
+====================COPYRIGHT====================
+ * Copyright 2018 gRPC authors.
+
+
+====================COPYRIGHT====================
+ * Copyright 2020 gRPC authors.
+
+
+====================COPYRIGHT====================
+# Copyright 2019 gRPC authors.
diff --git a/contrib/libs/grpc/src/core/lib/channel/channel_args.cc b/contrib/libs/grpc/src/core/lib/channel/channel_args.cc
index 720345a745b..cb3d61fc4dc 100644
--- a/contrib/libs/grpc/src/core/lib/channel/channel_args.cc
+++ b/contrib/libs/grpc/src/core/lib/channel/channel_args.cc
@@ -21,11 +21,11 @@
#include <limits.h>
#include <string.h>
-#include <vector>
-
-#include "y_absl/strings/str_format.h"
-#include "y_absl/strings/str_join.h"
-
+#include <vector>
+
+#include "y_absl/strings/str_format.h"
+#include "y_absl/strings/str_join.h"
+
#include <grpc/grpc.h>
#include <grpc/impl/codegen/grpc_types.h>
#include <grpc/impl/codegen/log.h>
@@ -341,28 +341,28 @@ grpc_arg grpc_channel_arg_pointer_create(
return arg;
}
-TString grpc_channel_args_string(const grpc_channel_args* args) {
- if (args == nullptr) return "";
- std::vector<TString> arg_strings;
+TString grpc_channel_args_string(const grpc_channel_args* args) {
+ if (args == nullptr) return "";
+ std::vector<TString> arg_strings;
for (size_t i = 0; i < args->num_args; ++i) {
const grpc_arg& arg = args->args[i];
- TString arg_string;
+ TString arg_string;
switch (arg.type) {
case GRPC_ARG_INTEGER:
- arg_string = y_absl::StrFormat("%s=%d", arg.key, arg.value.integer);
+ arg_string = y_absl::StrFormat("%s=%d", arg.key, arg.value.integer);
break;
case GRPC_ARG_STRING:
- arg_string = y_absl::StrFormat("%s=%s", arg.key, arg.value.string);
+ arg_string = y_absl::StrFormat("%s=%s", arg.key, arg.value.string);
break;
case GRPC_ARG_POINTER:
- arg_string = y_absl::StrFormat("%s=%p", arg.key, arg.value.pointer.p);
+ arg_string = y_absl::StrFormat("%s=%p", arg.key, arg.value.pointer.p);
break;
default:
- arg_string = "arg with unknown type";
+ arg_string = "arg with unknown type";
}
- arg_strings.push_back(arg_string);
+ arg_strings.push_back(arg_string);
}
- return y_absl::StrJoin(arg_strings, ", ");
+ return y_absl::StrJoin(arg_strings, ", ");
}
namespace {
diff --git a/contrib/libs/grpc/src/core/lib/channel/channel_args.h b/contrib/libs/grpc/src/core/lib/channel/channel_args.h
index 19a14415a59..6b973aa94d3 100644
--- a/contrib/libs/grpc/src/core/lib/channel/channel_args.h
+++ b/contrib/libs/grpc/src/core/lib/channel/channel_args.h
@@ -21,8 +21,8 @@
#include <grpc/support/port_platform.h>
-#include <util/generic/string.h>
-
+#include <util/generic/string.h>
+
#include <grpc/grpc.h>
#include "src/core/lib/surface/channel_stack_type.h"
@@ -117,7 +117,7 @@ grpc_arg grpc_channel_arg_pointer_create(char* name, void* value,
const grpc_arg_pointer_vtable* vtable);
// Returns a string representing channel args in human-readable form.
-TString grpc_channel_args_string(const grpc_channel_args* args);
+TString grpc_channel_args_string(const grpc_channel_args* args);
// Takes ownership of the old_args
typedef grpc_channel_args* (*grpc_channel_args_client_channel_creation_mutator)(
diff --git a/contrib/libs/grpc/src/core/lib/channel/channel_stack.h b/contrib/libs/grpc/src/core/lib/channel/channel_stack.h
index 0cd0a3b98b2..e297df9488d 100644
--- a/contrib/libs/grpc/src/core/lib/channel/channel_stack.h
+++ b/contrib/libs/grpc/src/core/lib/channel/channel_stack.h
@@ -31,19 +31,19 @@
chains are linear, then channel stacks provide a mechanism to minimize
allocations for that chain.
Call stacks are created by channel stacks and represent the per-call data
- for that stack.
+ for that stack.
+
+ Implementations should take care of the following details for a batch -
+ 1. Synchronization is achieved with a CallCombiner. View
+ src/core/lib/iomgr/call_combiner.h for more details.
+ 2. If the filter wants to inject an error on the way down, it needs to call
+ grpc_transport_stream_op_batch_finish_with_failure from within the call
+ combiner. This will cause any batch callbacks to be called with that error.
+ 3. If the filter wants to inject an error on the way up (from a callback), it
+ should also inject that error in the recv_trailing_metadata callback so that
+ it can have an effect on the call status.
+*/
- Implementations should take care of the following details for a batch -
- 1. Synchronization is achieved with a CallCombiner. View
- src/core/lib/iomgr/call_combiner.h for more details.
- 2. If the filter wants to inject an error on the way down, it needs to call
- grpc_transport_stream_op_batch_finish_with_failure from within the call
- combiner. This will cause any batch callbacks to be called with that error.
- 3. If the filter wants to inject an error on the way up (from a callback), it
- should also inject that error in the recv_trailing_metadata callback so that
- it can have an effect on the call status.
-*/
-
#include <grpc/support/port_platform.h>
#include <stddef.h>
diff --git a/contrib/libs/grpc/src/core/lib/channel/channel_trace.cc b/contrib/libs/grpc/src/core/lib/channel/channel_trace.cc
index c0b833e4108..dbc33af2d4f 100644
--- a/contrib/libs/grpc/src/core/lib/channel/channel_trace.cc
+++ b/contrib/libs/grpc/src/core/lib/channel/channel_trace.cc
@@ -144,46 +144,46 @@ const char* severity_string(ChannelTrace::Severity severity) {
} // anonymous namespace
-Json ChannelTrace::TraceEvent::RenderTraceEvent() const {
- char* description = grpc_slice_to_c_string(data_);
- Json::Object object = {
- {"description", description},
- {"severity", severity_string(severity_)},
- {"timestamp", gpr_format_timespec(timestamp_)},
- };
- gpr_free(description);
+Json ChannelTrace::TraceEvent::RenderTraceEvent() const {
+ char* description = grpc_slice_to_c_string(data_);
+ Json::Object object = {
+ {"description", description},
+ {"severity", severity_string(severity_)},
+ {"timestamp", gpr_format_timespec(timestamp_)},
+ };
+ gpr_free(description);
if (referenced_entity_ != nullptr) {
const bool is_channel =
(referenced_entity_->type() == BaseNode::EntityType::kTopLevelChannel ||
referenced_entity_->type() == BaseNode::EntityType::kInternalChannel);
- object[is_channel ? "channelRef" : "subchannelRef"] = Json::Object{
- {(is_channel ? "channelId" : "subchannelId"),
- ToString(referenced_entity_->uuid())},
- };
+ object[is_channel ? "channelRef" : "subchannelRef"] = Json::Object{
+ {(is_channel ? "channelId" : "subchannelId"),
+ ToString(referenced_entity_->uuid())},
+ };
}
- return object;
+ return object;
}
-Json ChannelTrace::RenderJson() const {
- // Tracing is disabled if max_event_memory_ == 0.
- if (max_event_memory_ == 0) {
- return Json(); // JSON null
- }
- Json::Object object = {
- {"creationTimestamp", gpr_format_timespec(time_created_)},
- };
+Json ChannelTrace::RenderJson() const {
+ // Tracing is disabled if max_event_memory_ == 0.
+ if (max_event_memory_ == 0) {
+ return Json(); // JSON null
+ }
+ Json::Object object = {
+ {"creationTimestamp", gpr_format_timespec(time_created_)},
+ };
if (num_events_logged_ > 0) {
- object["numEventsLogged"] = ToString(num_events_logged_);
+ object["numEventsLogged"] = ToString(num_events_logged_);
}
- // Only add in the event list if it is non-empty.
+ // Only add in the event list if it is non-empty.
if (head_trace_ != nullptr) {
- Json::Array array;
- for (TraceEvent* it = head_trace_; it != nullptr; it = it->next()) {
- array.emplace_back(it->RenderTraceEvent());
+ Json::Array array;
+ for (TraceEvent* it = head_trace_; it != nullptr; it = it->next()) {
+ array.emplace_back(it->RenderTraceEvent());
}
- object["events"] = std::move(array);
+ object["events"] = std::move(array);
}
- return object;
+ return object;
}
} // namespace channelz
diff --git a/contrib/libs/grpc/src/core/lib/channel/channel_trace.h b/contrib/libs/grpc/src/core/lib/channel/channel_trace.h
index 429aec254a5..c26e3016da7 100644
--- a/contrib/libs/grpc/src/core/lib/channel/channel_trace.h
+++ b/contrib/libs/grpc/src/core/lib/channel/channel_trace.h
@@ -75,9 +75,9 @@ class ChannelTrace {
void AddTraceEventWithReference(Severity severity, const grpc_slice& data,
RefCountedPtr<BaseNode> referenced_entity);
- // Creates and returns the raw Json object, so a parent channelz
+ // Creates and returns the raw Json object, so a parent channelz
// object may incorporate the json before rendering.
- Json RenderJson() const;
+ Json RenderJson() const;
private:
friend size_t testing::GetSizeofTraceEvent(void);
@@ -98,7 +98,7 @@ class ChannelTrace {
// Renders the data inside of this TraceEvent into a json object. This is
// used by the ChannelTrace, when it is rendering itself.
- Json RenderTraceEvent() const;
+ Json RenderTraceEvent() const;
// set and get for the next_ pointer.
TraceEvent* next() const { return next_; }
diff --git a/contrib/libs/grpc/src/core/lib/channel/channelz.cc b/contrib/libs/grpc/src/core/lib/channel/channelz.cc
index 1c2850f0d96..16f505c053e 100644
--- a/contrib/libs/grpc/src/core/lib/channel/channelz.cc
+++ b/contrib/libs/grpc/src/core/lib/channel/channelz.cc
@@ -45,8 +45,8 @@
#include "src/core/lib/transport/error_utils.h"
#include "src/core/lib/uri/uri_parser.h"
-#include <util/string/cast.h>
-
+#include <util/string/cast.h>
+
namespace grpc_core {
namespace channelz {
@@ -54,7 +54,7 @@ namespace channelz {
// BaseNode
//
-BaseNode::BaseNode(EntityType type, TString name)
+BaseNode::BaseNode(EntityType type, TString name)
: type_(type), uuid_(-1), name_(std::move(name)) {
// The registry will set uuid_ under its lock.
ChannelzRegistry::Register(this);
@@ -62,9 +62,9 @@ BaseNode::BaseNode(EntityType type, TString name)
BaseNode::~BaseNode() { ChannelzRegistry::Unregister(uuid_); }
-TString BaseNode::RenderJsonString() {
- Json json = RenderJson();
- return json.Dump();
+TString BaseNode::RenderJsonString() {
+ Json json = RenderJson();
+ return json.Dump();
}
//
@@ -116,21 +116,21 @@ void CallCountingHelper::CollectData(CounterData* out) {
}
}
-void CallCountingHelper::PopulateCallCounts(Json::Object* object) {
+void CallCountingHelper::PopulateCallCounts(Json::Object* object) {
CounterData data;
CollectData(&data);
if (data.calls_started != 0) {
- (*object)["callsStarted"] = ToString(data.calls_started);
- gpr_timespec ts = gpr_convert_clock_type(
- gpr_cycle_counter_to_time(data.last_call_started_cycle),
- GPR_CLOCK_REALTIME);
- (*object)["lastCallStartedTimestamp"] = gpr_format_timespec(ts);
+ (*object)["callsStarted"] = ToString(data.calls_started);
+ gpr_timespec ts = gpr_convert_clock_type(
+ gpr_cycle_counter_to_time(data.last_call_started_cycle),
+ GPR_CLOCK_REALTIME);
+ (*object)["lastCallStartedTimestamp"] = gpr_format_timespec(ts);
}
if (data.calls_succeeded != 0) {
- (*object)["callsSucceeded"] = ToString(data.calls_succeeded);
+ (*object)["callsSucceeded"] = ToString(data.calls_succeeded);
}
if (data.calls_failed) {
- (*object)["callsFailed"] = ToString(data.calls_failed);
+ (*object)["callsFailed"] = ToString(data.calls_failed);
}
}
@@ -138,13 +138,13 @@ void CallCountingHelper::PopulateCallCounts(Json::Object* object) {
// ChannelNode
//
-ChannelNode::ChannelNode(TString target, size_t channel_tracer_max_nodes,
- bool is_internal_channel)
- : BaseNode(is_internal_channel ? EntityType::kInternalChannel
- : EntityType::kTopLevelChannel,
+ChannelNode::ChannelNode(TString target, size_t channel_tracer_max_nodes,
+ bool is_internal_channel)
+ : BaseNode(is_internal_channel ? EntityType::kInternalChannel
+ : EntityType::kTopLevelChannel,
target),
target_(std::move(target)),
- trace_(channel_tracer_max_nodes) {}
+ trace_(channel_tracer_max_nodes) {}
const char* ChannelNode::GetChannelConnectivityStateChangeString(
grpc_connectivity_state state) {
@@ -163,60 +163,60 @@ const char* ChannelNode::GetChannelConnectivityStateChangeString(
GPR_UNREACHABLE_CODE(return "UNKNOWN");
}
-Json ChannelNode::RenderJson() {
- Json::Object data = {
- {"target", target_},
- };
- // Connectivity state.
+Json ChannelNode::RenderJson() {
+ Json::Object data = {
+ {"target", target_},
+ };
+ // Connectivity state.
// If low-order bit is on, then the field is set.
int state_field = connectivity_state_.Load(MemoryOrder::RELAXED);
if ((state_field & 1) != 0) {
grpc_connectivity_state state =
static_cast<grpc_connectivity_state>(state_field >> 1);
- data["state"] = Json::Object{
- {"state", ConnectivityStateName(state)},
- };
+ data["state"] = Json::Object{
+ {"state", ConnectivityStateName(state)},
+ };
}
- // Fill in the channel trace if applicable.
- Json trace_json = trace_.RenderJson();
- if (trace_json.type() != Json::Type::JSON_NULL) {
- data["trace"] = std::move(trace_json);
+ // Fill in the channel trace if applicable.
+ Json trace_json = trace_.RenderJson();
+ if (trace_json.type() != Json::Type::JSON_NULL) {
+ data["trace"] = std::move(trace_json);
}
- // Ask CallCountingHelper to populate call count data.
- call_counter_.PopulateCallCounts(&data);
- // Construct outer object.
- Json::Object json = {
- {"ref",
- Json::Object{
- {"channelId", ToString(uuid())},
- }},
- {"data", std::move(data)},
- };
- // Template method. Child classes may override this to add their specific
+ // Ask CallCountingHelper to populate call count data.
+ call_counter_.PopulateCallCounts(&data);
+ // Construct outer object.
+ Json::Object json = {
+ {"ref",
+ Json::Object{
+ {"channelId", ToString(uuid())},
+ }},
+ {"data", std::move(data)},
+ };
+ // Template method. Child classes may override this to add their specific
// functionality.
- PopulateChildRefs(&json);
- return json;
+ PopulateChildRefs(&json);
+ return json;
}
-void ChannelNode::PopulateChildRefs(Json::Object* json) {
+void ChannelNode::PopulateChildRefs(Json::Object* json) {
MutexLock lock(&child_mu_);
if (!child_subchannels_.empty()) {
- Json::Array array;
- for (intptr_t subchannel_uuid : child_subchannels_) {
- array.emplace_back(Json::Object{
- {"subchannelId", ToString(subchannel_uuid)},
- });
+ Json::Array array;
+ for (intptr_t subchannel_uuid : child_subchannels_) {
+ array.emplace_back(Json::Object{
+ {"subchannelId", ToString(subchannel_uuid)},
+ });
}
- (*json)["subchannelRef"] = std::move(array);
+ (*json)["subchannelRef"] = std::move(array);
}
if (!child_channels_.empty()) {
- Json::Array array;
- for (intptr_t channel_uuid : child_channels_) {
- array.emplace_back(Json::Object{
- {"channelId", ToString(channel_uuid)},
- });
+ Json::Array array;
+ for (intptr_t channel_uuid : child_channels_) {
+ array.emplace_back(Json::Object{
+ {"channelId", ToString(channel_uuid)},
+ });
}
- (*json)["channelRef"] = std::move(array);
+ (*json)["channelRef"] = std::move(array);
}
}
@@ -228,7 +228,7 @@ void ChannelNode::SetConnectivityState(grpc_connectivity_state state) {
void ChannelNode::AddChildChannel(intptr_t child_uuid) {
MutexLock lock(&child_mu_);
- child_channels_.insert(child_uuid);
+ child_channels_.insert(child_uuid);
}
void ChannelNode::RemoveChildChannel(intptr_t child_uuid) {
@@ -238,7 +238,7 @@ void ChannelNode::RemoveChildChannel(intptr_t child_uuid) {
void ChannelNode::AddChildSubchannel(intptr_t child_uuid) {
MutexLock lock(&child_mu_);
- child_subchannels_.insert(child_uuid);
+ child_subchannels_.insert(child_uuid);
}
void ChannelNode::RemoveChildSubchannel(intptr_t child_uuid) {
@@ -250,7 +250,7 @@ void ChannelNode::RemoveChildSubchannel(intptr_t child_uuid) {
// ServerNode
//
-ServerNode::ServerNode(size_t channel_tracer_max_nodes)
+ServerNode::ServerNode(size_t channel_tracer_max_nodes)
: BaseNode(EntityType::kServer, ""), trace_(channel_tracer_max_nodes) {}
ServerNode::~ServerNode() {}
@@ -275,65 +275,65 @@ void ServerNode::RemoveChildListenSocket(intptr_t child_uuid) {
child_listen_sockets_.erase(child_uuid);
}
-TString ServerNode::RenderServerSockets(intptr_t start_socket_id,
- intptr_t max_results) {
- GPR_ASSERT(start_socket_id >= 0);
- GPR_ASSERT(max_results >= 0);
+TString ServerNode::RenderServerSockets(intptr_t start_socket_id,
+ intptr_t max_results) {
+ GPR_ASSERT(start_socket_id >= 0);
+ GPR_ASSERT(max_results >= 0);
// If user does not set max_results, we choose 500.
size_t pagination_limit = max_results == 0 ? 500 : max_results;
- Json::Object object;
- {
- MutexLock lock(&child_mu_);
- size_t sockets_rendered = 0;
- // Create list of socket refs.
- Json::Array array;
- auto it = child_sockets_.lower_bound(start_socket_id);
- for (; it != child_sockets_.end() && sockets_rendered < pagination_limit;
- ++it, ++sockets_rendered) {
- array.emplace_back(Json::Object{
- {"socketId", ToString(it->first)},
- {"name", it->second->name()},
- });
+ Json::Object object;
+ {
+ MutexLock lock(&child_mu_);
+ size_t sockets_rendered = 0;
+ // Create list of socket refs.
+ Json::Array array;
+ auto it = child_sockets_.lower_bound(start_socket_id);
+ for (; it != child_sockets_.end() && sockets_rendered < pagination_limit;
+ ++it, ++sockets_rendered) {
+ array.emplace_back(Json::Object{
+ {"socketId", ToString(it->first)},
+ {"name", it->second->name()},
+ });
}
- object["socketRef"] = std::move(array);
- if (it == child_sockets_.end()) object["end"] = true;
+ object["socketRef"] = std::move(array);
+ if (it == child_sockets_.end()) object["end"] = true;
}
- Json json = std::move(object);
- return json.Dump();
+ Json json = std::move(object);
+ return json.Dump();
}
-Json ServerNode::RenderJson() {
- Json::Object data;
- // Fill in the channel trace if applicable.
- Json trace_json = trace_.RenderJson();
- if (trace_json.type() != Json::Type::JSON_NULL) {
- data["trace"] = std::move(trace_json);
+Json ServerNode::RenderJson() {
+ Json::Object data;
+ // Fill in the channel trace if applicable.
+ Json trace_json = trace_.RenderJson();
+ if (trace_json.type() != Json::Type::JSON_NULL) {
+ data["trace"] = std::move(trace_json);
}
- // Ask CallCountingHelper to populate call count data.
- call_counter_.PopulateCallCounts(&data);
- // Construct top-level object.
- Json::Object object = {
- {"ref",
- Json::Object{
- {"serverId", ToString(uuid())},
- }},
- {"data", std::move(data)},
- };
- // Render listen sockets.
- {
- MutexLock lock(&child_mu_);
- if (!child_listen_sockets_.empty()) {
- Json::Array array;
- for (const auto& it : child_listen_sockets_) {
- array.emplace_back(Json::Object{
- {"socketId", ToString(it.first)},
- {"name", it.second->name()},
- });
- }
- object["listenSocket"] = std::move(array);
+ // Ask CallCountingHelper to populate call count data.
+ call_counter_.PopulateCallCounts(&data);
+ // Construct top-level object.
+ Json::Object object = {
+ {"ref",
+ Json::Object{
+ {"serverId", ToString(uuid())},
+ }},
+ {"data", std::move(data)},
+ };
+ // Render listen sockets.
+ {
+ MutexLock lock(&child_mu_);
+ if (!child_listen_sockets_.empty()) {
+ Json::Array array;
+ for (const auto& it : child_listen_sockets_) {
+ array.emplace_back(Json::Object{
+ {"socketId", ToString(it.first)},
+ {"name", it.second->name()},
+ });
+ }
+ object["listenSocket"] = std::move(array);
}
}
- return object;
+ return object;
}
//
@@ -342,44 +342,44 @@ Json ServerNode::RenderJson() {
namespace {
-void PopulateSocketAddressJson(Json::Object* json, const char* name,
+void PopulateSocketAddressJson(Json::Object* json, const char* name,
const char* addr_str) {
if (addr_str == nullptr) return;
- Json::Object data;
+ Json::Object data;
grpc_uri* uri = grpc_uri_parse(addr_str, true);
if ((uri != nullptr) && ((strcmp(uri->scheme, "ipv4") == 0) ||
(strcmp(uri->scheme, "ipv6") == 0))) {
const char* host_port = uri->path;
if (*host_port == '/') ++host_port;
- TString host;
- TString port;
+ TString host;
+ TString port;
GPR_ASSERT(SplitHostPort(host_port, &host, &port));
int port_num = -1;
- if (!port.empty()) {
- port_num = atoi(port.data());
+ if (!port.empty()) {
+ port_num = atoi(port.data());
}
- char* b64_host = grpc_base64_encode(host.data(), host.size(), false, false);
- data["tcpip_address"] = Json::Object{
- {"port", port_num},
- {"ip_address", b64_host},
- };
- gpr_free(b64_host);
+ char* b64_host = grpc_base64_encode(host.data(), host.size(), false, false);
+ data["tcpip_address"] = Json::Object{
+ {"port", port_num},
+ {"ip_address", b64_host},
+ };
+ gpr_free(b64_host);
} else if (uri != nullptr && strcmp(uri->scheme, "unix") == 0) {
- data["uds_address"] = Json::Object{
- {"filename", uri->path},
- };
+ data["uds_address"] = Json::Object{
+ {"filename", uri->path},
+ };
} else {
- data["other_address"] = Json::Object{
- {"name", addr_str},
- };
+ data["other_address"] = Json::Object{
+ {"name", addr_str},
+ };
}
grpc_uri_destroy(uri);
- (*json)[name] = std::move(data);
+ (*json)[name] = std::move(data);
}
} // namespace
-SocketNode::SocketNode(TString local, TString remote, TString name)
+SocketNode::SocketNode(TString local, TString remote, TString name)
: BaseNode(EntityType::kSocket, std::move(name)),
local_(std::move(local)),
remote_(std::move(remote)) {}
@@ -407,20 +407,20 @@ void SocketNode::RecordMessageReceived() {
MemoryOrder::RELAXED);
}
-Json SocketNode::RenderJson() {
- // Create and fill the data child.
- Json::Object data;
+Json SocketNode::RenderJson() {
+ // Create and fill the data child.
+ Json::Object data;
gpr_timespec ts;
int64_t streams_started = streams_started_.Load(MemoryOrder::RELAXED);
if (streams_started != 0) {
- data["streamsStarted"] = ToString(streams_started);
+ data["streamsStarted"] = ToString(streams_started);
gpr_cycle_counter last_local_stream_created_cycle =
last_local_stream_created_cycle_.Load(MemoryOrder::RELAXED);
if (last_local_stream_created_cycle != 0) {
ts = gpr_convert_clock_type(
gpr_cycle_counter_to_time(last_local_stream_created_cycle),
GPR_CLOCK_REALTIME);
- data["lastLocalStreamCreatedTimestamp"] = gpr_format_timespec(ts);
+ data["lastLocalStreamCreatedTimestamp"] = gpr_format_timespec(ts);
}
gpr_cycle_counter last_remote_stream_created_cycle =
last_remote_stream_created_cycle_.Load(MemoryOrder::RELAXED);
@@ -428,71 +428,71 @@ Json SocketNode::RenderJson() {
ts = gpr_convert_clock_type(
gpr_cycle_counter_to_time(last_remote_stream_created_cycle),
GPR_CLOCK_REALTIME);
- data["lastRemoteStreamCreatedTimestamp"] = gpr_format_timespec(ts);
+ data["lastRemoteStreamCreatedTimestamp"] = gpr_format_timespec(ts);
}
}
int64_t streams_succeeded = streams_succeeded_.Load(MemoryOrder::RELAXED);
if (streams_succeeded != 0) {
- data["streamsSucceeded"] = ToString(streams_succeeded);
+ data["streamsSucceeded"] = ToString(streams_succeeded);
}
int64_t streams_failed = streams_failed_.Load(MemoryOrder::RELAXED);
- if (streams_failed != 0) {
- data["streamsFailed"] = ToString(streams_failed);
+ if (streams_failed != 0) {
+ data["streamsFailed"] = ToString(streams_failed);
}
int64_t messages_sent = messages_sent_.Load(MemoryOrder::RELAXED);
if (messages_sent != 0) {
- data["messagesSent"] = ToString(messages_sent);
+ data["messagesSent"] = ToString(messages_sent);
ts = gpr_convert_clock_type(
gpr_cycle_counter_to_time(
last_message_sent_cycle_.Load(MemoryOrder::RELAXED)),
GPR_CLOCK_REALTIME);
- data["lastMessageSentTimestamp"] = gpr_format_timespec(ts);
+ data["lastMessageSentTimestamp"] = gpr_format_timespec(ts);
}
int64_t messages_received = messages_received_.Load(MemoryOrder::RELAXED);
if (messages_received != 0) {
- data["messagesReceived"] = ToString(messages_received);
+ data["messagesReceived"] = ToString(messages_received);
ts = gpr_convert_clock_type(
gpr_cycle_counter_to_time(
last_message_received_cycle_.Load(MemoryOrder::RELAXED)),
GPR_CLOCK_REALTIME);
- data["lastMessageReceivedTimestamp"] = gpr_format_timespec(ts);
+ data["lastMessageReceivedTimestamp"] = gpr_format_timespec(ts);
}
int64_t keepalives_sent = keepalives_sent_.Load(MemoryOrder::RELAXED);
if (keepalives_sent != 0) {
- data["keepAlivesSent"] = ToString(keepalives_sent);
+ data["keepAlivesSent"] = ToString(keepalives_sent);
}
- // Create and fill the parent object.
- Json::Object object = {
- {"ref",
- Json::Object{
- {"socketId", ToString(uuid())},
- {"name", name()},
- }},
- {"data", std::move(data)},
- };
- PopulateSocketAddressJson(&object, "remote", remote_.c_str());
- PopulateSocketAddressJson(&object, "local", local_.c_str());
- return object;
+ // Create and fill the parent object.
+ Json::Object object = {
+ {"ref",
+ Json::Object{
+ {"socketId", ToString(uuid())},
+ {"name", name()},
+ }},
+ {"data", std::move(data)},
+ };
+ PopulateSocketAddressJson(&object, "remote", remote_.c_str());
+ PopulateSocketAddressJson(&object, "local", local_.c_str());
+ return object;
}
//
// ListenSocketNode
//
-ListenSocketNode::ListenSocketNode(TString local_addr, TString name)
+ListenSocketNode::ListenSocketNode(TString local_addr, TString name)
: BaseNode(EntityType::kSocket, std::move(name)),
local_addr_(std::move(local_addr)) {}
-Json ListenSocketNode::RenderJson() {
- Json::Object object = {
- {"ref",
- Json::Object{
- {"socketId", ToString(uuid())},
- {"name", name()},
- }},
- };
- PopulateSocketAddressJson(&object, "local", local_addr_.c_str());
- return object;
+Json ListenSocketNode::RenderJson() {
+ Json::Object object = {
+ {"ref",
+ Json::Object{
+ {"socketId", ToString(uuid())},
+ {"name", name()},
+ }},
+ };
+ PopulateSocketAddressJson(&object, "local", local_addr_.c_str());
+ return object;
}
} // namespace channelz
diff --git a/contrib/libs/grpc/src/core/lib/channel/channelz.h b/contrib/libs/grpc/src/core/lib/channel/channelz.h
index 0356a6cdb15..596770ccdc5 100644
--- a/contrib/libs/grpc/src/core/lib/channel/channelz.h
+++ b/contrib/libs/grpc/src/core/lib/channel/channelz.h
@@ -23,11 +23,11 @@
#include <grpc/grpc.h>
-#include <set>
-#include <util/generic/string.h>
+#include <set>
+#include <util/generic/string.h>
+
+#include "y_absl/container/inlined_vector.h"
-#include "y_absl/container/inlined_vector.h"
-
#include "src/core/lib/channel/channel_trace.h"
#include "src/core/lib/gpr/time_precise.h"
#include "src/core/lib/gprpp/atomic.h"
@@ -43,9 +43,9 @@
// Channel arg key for channelz node.
#define GRPC_ARG_CHANNELZ_CHANNEL_NODE "grpc.channelz_channel_node"
-// Channel arg key for indicating an internal channel.
-#define GRPC_ARG_CHANNELZ_IS_INTERNAL_CHANNEL \
- "grpc.channelz_is_internal_channel"
+// Channel arg key for indicating an internal channel.
+#define GRPC_ARG_CHANNELZ_IS_INTERNAL_CHANNEL \
+ "grpc.channelz_is_internal_channel"
/** This is the default value for whether or not to enable channelz. If
* GRPC_ARG_ENABLE_CHANNELZ is set, it will override this default value. */
@@ -84,28 +84,28 @@ class BaseNode : public RefCounted<BaseNode> {
};
protected:
- BaseNode(EntityType type, TString name);
+ BaseNode(EntityType type, TString name);
public:
virtual ~BaseNode();
// All children must implement this function.
- virtual Json RenderJson() = 0;
+ virtual Json RenderJson() = 0;
// Renders the json and returns allocated string that must be freed by the
// caller.
- TString RenderJsonString();
+ TString RenderJsonString();
EntityType type() const { return type_; }
intptr_t uuid() const { return uuid_; }
- const TString& name() const { return name_; }
+ const TString& name() const { return name_; }
private:
// to allow the ChannelzRegistry to set uuid_ under its lock.
friend class ChannelzRegistry;
const EntityType type_;
intptr_t uuid_;
- TString name_;
+ TString name_;
};
// This class is a helper class for channelz entities that deal with Channels,
@@ -123,7 +123,7 @@ class CallCountingHelper {
void RecordCallSucceeded();
// Common rendering of the call count data and last_call_started_timestamp.
- void PopulateCallCounts(Json::Object* json);
+ void PopulateCallCounts(Json::Object* json);
private:
// testing peer friend.
@@ -147,13 +147,13 @@ class CallCountingHelper {
// Make sure the size is exactly one cache line.
uint8_t padding[GPR_CACHELINE_SIZE - 3 * sizeof(Atomic<intptr_t>) -
sizeof(Atomic<gpr_cycle_counter>)];
- };
- // TODO(soheilhy,veblush): Revist this after abseil integration.
- // This has a problem when using abseil inlined_vector because it
- // carries an alignment attribute properly but our allocator doesn't
- // respect this. To avoid UBSAN errors, this should be removed with
- // abseil inlined_vector.
- // GPR_ALIGN_STRUCT(GPR_CACHELINE_SIZE);
+ };
+ // TODO(soheilhy,veblush): Revist this after abseil integration.
+ // This has a problem when using abseil inlined_vector because it
+ // carries an alignment attribute properly but our allocator doesn't
+ // respect this. To avoid UBSAN errors, this should be removed with
+ // abseil inlined_vector.
+ // GPR_ALIGN_STRUCT(GPR_CACHELINE_SIZE);
struct CounterData {
int64_t calls_started = 0;
@@ -166,21 +166,21 @@ class CallCountingHelper {
void CollectData(CounterData* out);
// Really zero-sized, but 0-sized arrays are illegal on MSVC.
- y_absl::InlinedVector<AtomicCounterData, 1> per_cpu_counter_data_storage_;
+ y_absl::InlinedVector<AtomicCounterData, 1> per_cpu_counter_data_storage_;
size_t num_cores_ = 0;
};
// Handles channelz bookkeeping for channels
class ChannelNode : public BaseNode {
public:
- ChannelNode(TString target, size_t channel_tracer_max_nodes,
- bool is_internal_channel);
+ ChannelNode(TString target, size_t channel_tracer_max_nodes,
+ bool is_internal_channel);
// Returns the string description of the given connectivity state.
static const char* GetChannelConnectivityStateChangeString(
grpc_connectivity_state state);
- Json RenderJson() override;
+ Json RenderJson() override;
// proxy methods to composed classes.
void AddTraceEvent(ChannelTrace::Severity severity, const grpc_slice& data) {
@@ -209,12 +209,12 @@ class ChannelNode : public BaseNode {
void RemoveChildSubchannel(intptr_t child_uuid);
private:
- // Allows the channel trace test to access trace_.
- friend class testing::ChannelNodePeer;
-
- void PopulateChildRefs(Json::Object* json);
+ // Allows the channel trace test to access trace_.
+ friend class testing::ChannelNodePeer;
+
+ void PopulateChildRefs(Json::Object* json);
- TString target_;
+ TString target_;
CallCountingHelper call_counter_;
ChannelTrace trace_;
@@ -222,22 +222,22 @@ class ChannelNode : public BaseNode {
// bits are a grpc_connectivity_state value.
Atomic<int> connectivity_state_{0};
- Mutex child_mu_; // Guards sets below.
- std::set<intptr_t> child_channels_;
- std::set<intptr_t> child_subchannels_;
+ Mutex child_mu_; // Guards sets below.
+ std::set<intptr_t> child_channels_;
+ std::set<intptr_t> child_subchannels_;
};
// Handles channelz bookkeeping for servers
class ServerNode : public BaseNode {
public:
- explicit ServerNode(size_t channel_tracer_max_nodes);
+ explicit ServerNode(size_t channel_tracer_max_nodes);
~ServerNode() override;
- Json RenderJson() override;
+ Json RenderJson() override;
- TString RenderServerSockets(intptr_t start_socket_id,
- intptr_t max_results);
+ TString RenderServerSockets(intptr_t start_socket_id,
+ intptr_t max_results);
void AddChildSocket(RefCountedPtr<SocketNode> node);
@@ -272,10 +272,10 @@ class ServerNode : public BaseNode {
// Handles channelz bookkeeping for sockets
class SocketNode : public BaseNode {
public:
- SocketNode(TString local, TString remote, TString name);
+ SocketNode(TString local, TString remote, TString name);
~SocketNode() override {}
- Json RenderJson() override;
+ Json RenderJson() override;
void RecordStreamStartedFromLocal();
void RecordStreamStartedFromRemote();
@@ -291,7 +291,7 @@ class SocketNode : public BaseNode {
keepalives_sent_.FetchAdd(1, MemoryOrder::RELAXED);
}
- const TString& remote() { return remote_; }
+ const TString& remote() { return remote_; }
private:
Atomic<int64_t> streams_started_{0};
@@ -304,20 +304,20 @@ class SocketNode : public BaseNode {
Atomic<gpr_cycle_counter> last_remote_stream_created_cycle_{0};
Atomic<gpr_cycle_counter> last_message_sent_cycle_{0};
Atomic<gpr_cycle_counter> last_message_received_cycle_{0};
- TString local_;
- TString remote_;
+ TString local_;
+ TString remote_;
};
// Handles channelz bookkeeping for listen sockets
class ListenSocketNode : public BaseNode {
public:
- ListenSocketNode(TString local_addr, TString name);
+ ListenSocketNode(TString local_addr, TString name);
~ListenSocketNode() override {}
- Json RenderJson() override;
+ Json RenderJson() override;
private:
- TString local_addr_;
+ TString local_addr_;
};
} // namespace channelz
diff --git a/contrib/libs/grpc/src/core/lib/channel/channelz_registry.cc b/contrib/libs/grpc/src/core/lib/channel/channelz_registry.cc
index 89a7d5ad147..5a6e28ad789 100644
--- a/contrib/libs/grpc/src/core/lib/channel/channelz_registry.cc
+++ b/contrib/libs/grpc/src/core/lib/channel/channelz_registry.cc
@@ -21,8 +21,8 @@
#include <algorithm>
#include <cstring>
-#include "y_absl/container/inlined_vector.h"
-
+#include "y_absl/container/inlined_vector.h"
+
#include "src/core/lib/channel/channel_trace.h"
#include "src/core/lib/channel/channelz.h"
#include "src/core/lib/channel/channelz_registry.h"
@@ -32,7 +32,7 @@
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
-#include <grpc/support/string_util.h>
+#include <grpc/support/string_util.h>
#include <grpc/support/sync.h>
namespace grpc_core {
@@ -78,21 +78,21 @@ RefCountedPtr<BaseNode> ChannelzRegistry::InternalGet(intptr_t uuid) {
// Found node. Return only if its refcount is not zero (i.e., when we
// know that there is no other thread about to destroy it).
BaseNode* node = it->second;
- return node->RefIfNonZero();
+ return node->RefIfNonZero();
}
-TString ChannelzRegistry::InternalGetTopChannels(
- intptr_t start_channel_id) {
- y_absl::InlinedVector<RefCountedPtr<BaseNode>, 10> top_level_channels;
+TString ChannelzRegistry::InternalGetTopChannels(
+ intptr_t start_channel_id) {
+ y_absl::InlinedVector<RefCountedPtr<BaseNode>, 10> top_level_channels;
RefCountedPtr<BaseNode> node_after_pagination_limit;
{
MutexLock lock(&mu_);
for (auto it = node_map_.lower_bound(start_channel_id);
it != node_map_.end(); ++it) {
BaseNode* node = it->second;
- RefCountedPtr<BaseNode> node_ref;
+ RefCountedPtr<BaseNode> node_ref;
if (node->type() == BaseNode::EntityType::kTopLevelChannel &&
- (node_ref = node->RefIfNonZero()) != nullptr) {
+ (node_ref = node->RefIfNonZero()) != nullptr) {
// Check if we are over pagination limit to determine if we need to set
// the "end" element. If we don't go through this block, we know that
// when the loop terminates, we have <= to kPaginationLimit.
@@ -100,38 +100,38 @@ TString ChannelzRegistry::InternalGetTopChannels(
// refcount, we need to decrease it, but we can't unref while
// holding the lock, because this may lead to a deadlock.
if (top_level_channels.size() == kPaginationLimit) {
- node_after_pagination_limit = std::move(node_ref);
+ node_after_pagination_limit = std::move(node_ref);
break;
}
- top_level_channels.emplace_back(std::move(node_ref));
+ top_level_channels.emplace_back(std::move(node_ref));
}
}
}
- Json::Object object;
+ Json::Object object;
if (!top_level_channels.empty()) {
- // Create list of channels.
- Json::Array array;
+ // Create list of channels.
+ Json::Array array;
for (size_t i = 0; i < top_level_channels.size(); ++i) {
- array.emplace_back(top_level_channels[i]->RenderJson());
+ array.emplace_back(top_level_channels[i]->RenderJson());
}
- object["channel"] = std::move(array);
+ object["channel"] = std::move(array);
}
- if (node_after_pagination_limit == nullptr) object["end"] = true;
- Json json(std::move(object));
- return json.Dump();
+ if (node_after_pagination_limit == nullptr) object["end"] = true;
+ Json json(std::move(object));
+ return json.Dump();
}
-TString ChannelzRegistry::InternalGetServers(intptr_t start_server_id) {
- y_absl::InlinedVector<RefCountedPtr<BaseNode>, 10> servers;
+TString ChannelzRegistry::InternalGetServers(intptr_t start_server_id) {
+ y_absl::InlinedVector<RefCountedPtr<BaseNode>, 10> servers;
RefCountedPtr<BaseNode> node_after_pagination_limit;
{
MutexLock lock(&mu_);
for (auto it = node_map_.lower_bound(start_server_id);
it != node_map_.end(); ++it) {
BaseNode* node = it->second;
- RefCountedPtr<BaseNode> node_ref;
+ RefCountedPtr<BaseNode> node_ref;
if (node->type() == BaseNode::EntityType::kServer &&
- (node_ref = node->RefIfNonZero()) != nullptr) {
+ (node_ref = node->RefIfNonZero()) != nullptr) {
// Check if we are over pagination limit to determine if we need to set
// the "end" element. If we don't go through this block, we know that
// when the loop terminates, we have <= to kPaginationLimit.
@@ -139,41 +139,41 @@ TString ChannelzRegistry::InternalGetServers(intptr_t start_server_id) {
// refcount, we need to decrease it, but we can't unref while
// holding the lock, because this may lead to a deadlock.
if (servers.size() == kPaginationLimit) {
- node_after_pagination_limit = std::move(node_ref);
+ node_after_pagination_limit = std::move(node_ref);
break;
}
- servers.emplace_back(std::move(node_ref));
+ servers.emplace_back(std::move(node_ref));
}
}
}
- Json::Object object;
+ Json::Object object;
if (!servers.empty()) {
- // Create list of servers.
- Json::Array array;
+ // Create list of servers.
+ Json::Array array;
for (size_t i = 0; i < servers.size(); ++i) {
- array.emplace_back(servers[i]->RenderJson());
+ array.emplace_back(servers[i]->RenderJson());
}
- object["server"] = std::move(array);
+ object["server"] = std::move(array);
}
- if (node_after_pagination_limit == nullptr) object["end"] = true;
- Json json(std::move(object));
- return json.Dump();
+ if (node_after_pagination_limit == nullptr) object["end"] = true;
+ Json json(std::move(object));
+ return json.Dump();
}
void ChannelzRegistry::InternalLogAllEntities() {
- y_absl::InlinedVector<RefCountedPtr<BaseNode>, 10> nodes;
+ y_absl::InlinedVector<RefCountedPtr<BaseNode>, 10> nodes;
{
MutexLock lock(&mu_);
for (auto& p : node_map_) {
- RefCountedPtr<BaseNode> node = p.second->RefIfNonZero();
- if (node != nullptr) {
- nodes.emplace_back(std::move(node));
+ RefCountedPtr<BaseNode> node = p.second->RefIfNonZero();
+ if (node != nullptr) {
+ nodes.emplace_back(std::move(node));
}
}
}
for (size_t i = 0; i < nodes.size(); ++i) {
- TString json = nodes[i]->RenderJsonString();
- gpr_log(GPR_INFO, "%s", json.c_str());
+ TString json = nodes[i]->RenderJsonString();
+ gpr_log(GPR_INFO, "%s", json.c_str());
}
}
@@ -181,15 +181,15 @@ void ChannelzRegistry::InternalLogAllEntities() {
} // namespace grpc_core
char* grpc_channelz_get_top_channels(intptr_t start_channel_id) {
- return gpr_strdup(
- grpc_core::channelz::ChannelzRegistry::GetTopChannels(start_channel_id)
- .c_str());
+ return gpr_strdup(
+ grpc_core::channelz::ChannelzRegistry::GetTopChannels(start_channel_id)
+ .c_str());
}
char* grpc_channelz_get_servers(intptr_t start_server_id) {
- return gpr_strdup(
- grpc_core::channelz::ChannelzRegistry::GetServers(start_server_id)
- .c_str());
+ return gpr_strdup(
+ grpc_core::channelz::ChannelzRegistry::GetServers(start_server_id)
+ .c_str());
}
char* grpc_channelz_get_server(intptr_t server_id) {
@@ -200,29 +200,29 @@ char* grpc_channelz_get_server(intptr_t server_id) {
grpc_core::channelz::BaseNode::EntityType::kServer) {
return nullptr;
}
- grpc_core::Json json = grpc_core::Json::Object{
- {"server", server_node->RenderJson()},
- };
- return gpr_strdup(json.Dump().c_str());
+ grpc_core::Json json = grpc_core::Json::Object{
+ {"server", server_node->RenderJson()},
+ };
+ return gpr_strdup(json.Dump().c_str());
}
char* grpc_channelz_get_server_sockets(intptr_t server_id,
intptr_t start_socket_id,
intptr_t max_results) {
- // Validate inputs before handing them of to the renderer.
+ // Validate inputs before handing them of to the renderer.
grpc_core::RefCountedPtr<grpc_core::channelz::BaseNode> base_node =
grpc_core::channelz::ChannelzRegistry::Get(server_id);
if (base_node == nullptr ||
- base_node->type() != grpc_core::channelz::BaseNode::EntityType::kServer ||
- start_socket_id < 0 || max_results < 0) {
+ base_node->type() != grpc_core::channelz::BaseNode::EntityType::kServer ||
+ start_socket_id < 0 || max_results < 0) {
return nullptr;
}
// This cast is ok since we have just checked to make sure base_node is
- // actually a server node.
+ // actually a server node.
grpc_core::channelz::ServerNode* server_node =
static_cast<grpc_core::channelz::ServerNode*>(base_node.get());
- return gpr_strdup(
- server_node->RenderServerSockets(start_socket_id, max_results).c_str());
+ return gpr_strdup(
+ server_node->RenderServerSockets(start_socket_id, max_results).c_str());
}
char* grpc_channelz_get_channel(intptr_t channel_id) {
@@ -235,10 +235,10 @@ char* grpc_channelz_get_channel(intptr_t channel_id) {
grpc_core::channelz::BaseNode::EntityType::kInternalChannel)) {
return nullptr;
}
- grpc_core::Json json = grpc_core::Json::Object{
- {"channel", channel_node->RenderJson()},
- };
- return gpr_strdup(json.Dump().c_str());
+ grpc_core::Json json = grpc_core::Json::Object{
+ {"channel", channel_node->RenderJson()},
+ };
+ return gpr_strdup(json.Dump().c_str());
}
char* grpc_channelz_get_subchannel(intptr_t subchannel_id) {
@@ -249,10 +249,10 @@ char* grpc_channelz_get_subchannel(intptr_t subchannel_id) {
grpc_core::channelz::BaseNode::EntityType::kSubchannel) {
return nullptr;
}
- grpc_core::Json json = grpc_core::Json::Object{
- {"subchannel", subchannel_node->RenderJson()},
- };
- return gpr_strdup(json.Dump().c_str());
+ grpc_core::Json json = grpc_core::Json::Object{
+ {"subchannel", subchannel_node->RenderJson()},
+ };
+ return gpr_strdup(json.Dump().c_str());
}
char* grpc_channelz_get_socket(intptr_t socket_id) {
@@ -263,8 +263,8 @@ char* grpc_channelz_get_socket(intptr_t socket_id) {
grpc_core::channelz::BaseNode::EntityType::kSocket) {
return nullptr;
}
- grpc_core::Json json = grpc_core::Json::Object{
- {"socket", socket_node->RenderJson()},
- };
- return gpr_strdup(json.Dump().c_str());
+ grpc_core::Json json = grpc_core::Json::Object{
+ {"socket", socket_node->RenderJson()},
+ };
+ return gpr_strdup(json.Dump().c_str());
}
diff --git a/contrib/libs/grpc/src/core/lib/channel/channelz_registry.h b/contrib/libs/grpc/src/core/lib/channel/channelz_registry.h
index 54526e83bf3..73a5e20fbda 100644
--- a/contrib/libs/grpc/src/core/lib/channel/channelz_registry.h
+++ b/contrib/libs/grpc/src/core/lib/channel/channelz_registry.h
@@ -23,9 +23,9 @@
#include <stdint.h>
-#include <map>
-#include <util/generic/string.h>
-
+#include <map>
+#include <util/generic/string.h>
+
#include "src/core/lib/channel/channel_trace.h"
#include "src/core/lib/channel/channelz.h"
#include "src/core/lib/gprpp/map.h"
@@ -54,13 +54,13 @@ class ChannelzRegistry {
// Returns the allocated JSON string that represents the proto
// GetTopChannelsResponse as per channelz.proto.
- static TString GetTopChannels(intptr_t start_channel_id) {
+ static TString GetTopChannels(intptr_t start_channel_id) {
return Default()->InternalGetTopChannels(start_channel_id);
}
// Returns the allocated JSON string that represents the proto
// GetServersResponse as per channelz.proto.
- static TString GetServers(intptr_t start_server_id) {
+ static TString GetServers(intptr_t start_server_id) {
return Default()->InternalGetServers(start_server_id);
}
@@ -83,8 +83,8 @@ class ChannelzRegistry {
// returns the void* associated with that uuid. Else returns nullptr.
RefCountedPtr<BaseNode> InternalGet(intptr_t uuid);
- TString InternalGetTopChannels(intptr_t start_channel_id);
- TString InternalGetServers(intptr_t start_server_id);
+ TString InternalGetTopChannels(intptr_t start_channel_id);
+ TString InternalGetServers(intptr_t start_server_id);
void InternalLogAllEntities();
diff --git a/contrib/libs/grpc/src/core/lib/channel/connected_channel.cc b/contrib/libs/grpc/src/core/lib/channel/connected_channel.cc
index 22a1e9501e0..be74d9e88bb 100644
--- a/contrib/libs/grpc/src/core/lib/channel/connected_channel.cc
+++ b/contrib/libs/grpc/src/core/lib/channel/connected_channel.cc
@@ -90,12 +90,12 @@ static callback_state* get_state_for_batch(
/* We perform a small hack to locate transport data alongside the connected
channel data in call allocations, to allow everything to be pulled in minimal
cache line requests */
-#define TRANSPORT_STREAM_FROM_CALL_DATA(calld) \
- ((grpc_stream*)(((char*)(calld)) + \
- GPR_ROUND_UP_TO_ALIGNMENT_SIZE(sizeof(call_data))))
+#define TRANSPORT_STREAM_FROM_CALL_DATA(calld) \
+ ((grpc_stream*)(((char*)(calld)) + \
+ GPR_ROUND_UP_TO_ALIGNMENT_SIZE(sizeof(call_data))))
#define CALL_DATA_FROM_TRANSPORT_STREAM(transport_stream) \
- ((call_data*)(((char*)(transport_stream)) - \
- GPR_ROUND_UP_TO_ALIGNMENT_SIZE(sizeof(call_data))))
+ ((call_data*)(((char*)(transport_stream)) - \
+ GPR_ROUND_UP_TO_ALIGNMENT_SIZE(sizeof(call_data))))
/* Intercept a call operation and either push it directly up or translate it
into transport stream operations */
diff --git a/contrib/libs/grpc/src/core/lib/channel/context.h b/contrib/libs/grpc/src/core/lib/channel/context.h
index 7699609ef6e..bd7fd495e4a 100644
--- a/contrib/libs/grpc/src/core/lib/channel/context.h
+++ b/contrib/libs/grpc/src/core/lib/channel/context.h
@@ -35,7 +35,7 @@ typedef enum {
/// Reserved for traffic_class_context.
GRPC_CONTEXT_TRAFFIC,
- /// Holds a pointer to ServiceConfigCallData associated with this call.
+ /// Holds a pointer to ServiceConfigCallData associated with this call.
GRPC_CONTEXT_SERVICE_CONFIG_CALL_DATA,
GRPC_CONTEXT_COUNT
diff --git a/contrib/libs/grpc/src/core/lib/channel/handshaker.cc b/contrib/libs/grpc/src/core/lib/channel/handshaker.cc
index cc36c266602..826be41cbb0 100644
--- a/contrib/libs/grpc/src/core/lib/channel/handshaker.cc
+++ b/contrib/libs/grpc/src/core/lib/channel/handshaker.cc
@@ -20,8 +20,8 @@
#include <string.h>
-#include "y_absl/strings/str_format.h"
-
+#include "y_absl/strings/str_format.h"
+
#include <grpc/impl/codegen/slice.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
@@ -39,16 +39,16 @@ TraceFlag grpc_handshaker_trace(false, "handshaker");
namespace {
-TString HandshakerArgsString(HandshakerArgs* args) {
+TString HandshakerArgsString(HandshakerArgs* args) {
size_t num_args = args->args != nullptr ? args->args->num_args : 0;
size_t read_buffer_length =
args->read_buffer != nullptr ? args->read_buffer->length : 0;
- return y_absl::StrFormat(
- "{endpoint=%p, args=%p {size=%" PRIuPTR
- ": %s}, read_buffer=%p (length=%" PRIuPTR "), exit_early=%d}",
- args->endpoint, args->args, num_args,
- grpc_channel_args_string(args->args), args->read_buffer,
- read_buffer_length, args->exit_early);
+ return y_absl::StrFormat(
+ "{endpoint=%p, args=%p {size=%" PRIuPTR
+ ": %s}, read_buffer=%p (length=%" PRIuPTR "), exit_early=%d}",
+ args->endpoint, args->args, num_args,
+ grpc_channel_args_string(args->args), args->read_buffer,
+ read_buffer_length, args->exit_early);
}
} // namespace
@@ -129,8 +129,8 @@ bool HandshakeManager::CallNextHandshakerLocked(grpc_error* error) {
gpr_log(GPR_INFO,
"handshake_manager %p: error=%s shutdown=%d index=%" PRIuPTR
", args=%s",
- this, grpc_error_string(error), is_shutdown_, index_,
- HandshakerArgsString(&args_).c_str());
+ this, grpc_error_string(error), is_shutdown_, index_,
+ HandshakerArgsString(&args_).c_str());
}
GPR_ASSERT(index_ <= handshakers_.size());
// If we got an error or we've been shut down or we're exiting early or
diff --git a/contrib/libs/grpc/src/core/lib/channel/handshaker.h b/contrib/libs/grpc/src/core/lib/channel/handshaker.h
index 91e9d393fa5..cc8e9b2578d 100644
--- a/contrib/libs/grpc/src/core/lib/channel/handshaker.h
+++ b/contrib/libs/grpc/src/core/lib/channel/handshaker.h
@@ -21,8 +21,8 @@
#include <grpc/support/port_platform.h>
-#include "y_absl/container/inlined_vector.h"
-
+#include "y_absl/container/inlined_vector.h"
+
#include <grpc/support/string_util.h>
#include <grpc/impl/codegen/grpc_types.h>
@@ -147,8 +147,8 @@ class HandshakeManager : public RefCounted<HandshakeManager> {
gpr_mu mu_;
bool is_shutdown_ = false;
// An array of handshakers added via grpc_handshake_manager_add().
- y_absl::InlinedVector<RefCountedPtr<Handshaker>, HANDSHAKERS_INIT_SIZE>
- handshakers_;
+ y_absl::InlinedVector<RefCountedPtr<Handshaker>, HANDSHAKERS_INIT_SIZE>
+ handshakers_;
// The index of the handshaker to invoke next and closure to invoke it.
size_t index_ = 0;
grpc_closure call_next_handshaker_;
diff --git a/contrib/libs/grpc/src/core/lib/channel/handshaker_registry.cc b/contrib/libs/grpc/src/core/lib/channel/handshaker_registry.cc
index be0a5edfb2b..614531832dd 100644
--- a/contrib/libs/grpc/src/core/lib/channel/handshaker_registry.cc
+++ b/contrib/libs/grpc/src/core/lib/channel/handshaker_registry.cc
@@ -18,8 +18,8 @@
#include <grpc/support/port_platform.h>
-#include "y_absl/container/inlined_vector.h"
-
+#include "y_absl/container/inlined_vector.h"
+
#include "src/core/lib/channel/handshaker_registry.h"
#include "src/core/lib/gpr/alloc.h"
#include "src/core/lib/gprpp/memory.h"
@@ -45,7 +45,7 @@ class HandshakerFactoryList {
HandshakeManager* handshake_mgr);
private:
- y_absl::InlinedVector<std::unique_ptr<HandshakerFactory>, 2> factories_;
+ y_absl::InlinedVector<std::unique_ptr<HandshakerFactory>, 2> factories_;
};
HandshakerFactoryList* g_handshaker_factory_lists = nullptr;
@@ -76,12 +76,12 @@ void HandshakerFactoryList::AddHandshakers(const grpc_channel_args* args,
void HandshakerRegistry::Init() {
GPR_ASSERT(g_handshaker_factory_lists == nullptr);
- g_handshaker_factory_lists = new HandshakerFactoryList[NUM_HANDSHAKER_TYPES];
+ g_handshaker_factory_lists = new HandshakerFactoryList[NUM_HANDSHAKER_TYPES];
}
void HandshakerRegistry::Shutdown() {
GPR_ASSERT(g_handshaker_factory_lists != nullptr);
- delete[] g_handshaker_factory_lists;
+ delete[] g_handshaker_factory_lists;
g_handshaker_factory_lists = nullptr;
}
diff --git a/contrib/libs/grpc/src/core/lib/compression/message_compress.cc b/contrib/libs/grpc/src/core/lib/compression/message_compress.cc
index 26136828d67..7c2a70bad4e 100644
--- a/contrib/libs/grpc/src/core/lib/compression/message_compress.cc
+++ b/contrib/libs/grpc/src/core/lib/compression/message_compress.cc
@@ -34,7 +34,7 @@
static int zlib_body(z_stream* zs, grpc_slice_buffer* input,
grpc_slice_buffer* output,
int (*flate)(z_stream* zs, int flush)) {
- int r = Z_STREAM_END; /* Do not fail on an empty input. */
+ int r = Z_STREAM_END; /* Do not fail on an empty input. */
int flush;
size_t i;
grpc_slice outbuf = GRPC_SLICE_MALLOC(OUTPUT_BLOCK_SIZE);
@@ -68,10 +68,10 @@ static int zlib_body(z_stream* zs, grpc_slice_buffer* input,
goto error;
}
}
- if (r != Z_STREAM_END) {
- gpr_log(GPR_INFO, "zlib: Data error");
- goto error;
- }
+ if (r != Z_STREAM_END) {
+ gpr_log(GPR_INFO, "zlib: Data error");
+ goto error;
+ }
GPR_ASSERT(outbuf.refcount);
outbuf.data.refcounted.length -= zs->avail_out;
diff --git a/contrib/libs/grpc/src/core/lib/debug/stats.cc b/contrib/libs/grpc/src/core/lib/debug/stats.cc
index a0e70e21e01..1bcd1af25a2 100644
--- a/contrib/libs/grpc/src/core/lib/debug/stats.cc
+++ b/contrib/libs/grpc/src/core/lib/debug/stats.cc
@@ -23,11 +23,11 @@
#include <inttypes.h>
#include <string.h>
-#include <vector>
-
-#include "y_absl/strings/str_format.h"
-#include "y_absl/strings/str_join.h"
-
+#include <vector>
+
+#include "y_absl/strings/str_format.h"
+#include "y_absl/strings/str_join.h"
+
#include <grpc/support/alloc.h>
#include <grpc/support/string_util.h>
@@ -145,28 +145,28 @@ double grpc_stats_histo_percentile(const grpc_stats_data* stats,
static_cast<double>(count) * percentile / 100.0);
}
-TString grpc_stats_data_as_json(const grpc_stats_data* data) {
- std::vector<TString> parts;
- parts.push_back("{");
+TString grpc_stats_data_as_json(const grpc_stats_data* data) {
+ std::vector<TString> parts;
+ parts.push_back("{");
for (size_t i = 0; i < GRPC_STATS_COUNTER_COUNT; i++) {
- parts.push_back(y_absl::StrFormat(
- "\"%s\": %" PRIdPTR, grpc_stats_counter_name[i], data->counters[i]));
+ parts.push_back(y_absl::StrFormat(
+ "\"%s\": %" PRIdPTR, grpc_stats_counter_name[i], data->counters[i]));
}
for (size_t i = 0; i < GRPC_STATS_HISTOGRAM_COUNT; i++) {
- parts.push_back(y_absl::StrFormat("\"%s\": [", grpc_stats_histogram_name[i]));
+ parts.push_back(y_absl::StrFormat("\"%s\": [", grpc_stats_histogram_name[i]));
for (int j = 0; j < grpc_stats_histo_buckets[i]; j++) {
- parts.push_back(
- y_absl::StrFormat("%s%" PRIdPTR, j == 0 ? "" : ",",
- data->histograms[grpc_stats_histo_start[i] + j]));
+ parts.push_back(
+ y_absl::StrFormat("%s%" PRIdPTR, j == 0 ? "" : ",",
+ data->histograms[grpc_stats_histo_start[i] + j]));
}
- parts.push_back(
- y_absl::StrFormat("], \"%s_bkt\": [", grpc_stats_histogram_name[i]));
+ parts.push_back(
+ y_absl::StrFormat("], \"%s_bkt\": [", grpc_stats_histogram_name[i]));
for (int j = 0; j < grpc_stats_histo_buckets[i]; j++) {
- parts.push_back(y_absl::StrFormat(
- "%s%d", j == 0 ? "" : ",", grpc_stats_histo_bucket_boundaries[i][j]));
+ parts.push_back(y_absl::StrFormat(
+ "%s%d", j == 0 ? "" : ",", grpc_stats_histo_bucket_boundaries[i][j]));
}
- parts.push_back("]");
+ parts.push_back("]");
}
- parts.push_back("}");
- return y_absl::StrJoin(parts, "");
+ parts.push_back("}");
+ return y_absl::StrJoin(parts, "");
}
diff --git a/contrib/libs/grpc/src/core/lib/debug/stats.h b/contrib/libs/grpc/src/core/lib/debug/stats.h
index 9498bf1fbfe..c184fa7fc70 100644
--- a/contrib/libs/grpc/src/core/lib/debug/stats.h
+++ b/contrib/libs/grpc/src/core/lib/debug/stats.h
@@ -21,8 +21,8 @@
#include <grpc/support/port_platform.h>
-#include <util/generic/string.h>
-
+#include <util/generic/string.h>
+
#include <grpc/support/atm.h>
#include "src/core/lib/debug/stats_data.h"
#include "src/core/lib/iomgr/exec_ctx.h"
@@ -58,7 +58,7 @@ void grpc_stats_collect(grpc_stats_data* output);
// c = b-a
void grpc_stats_diff(const grpc_stats_data* b, const grpc_stats_data* a,
grpc_stats_data* c);
-TString grpc_stats_data_as_json(const grpc_stats_data* data);
+TString grpc_stats_data_as_json(const grpc_stats_data* data);
int grpc_stats_histo_find_bucket_slow(int value, const int* table,
int table_size);
double grpc_stats_histo_percentile(const grpc_stats_data* data,
diff --git a/contrib/libs/grpc/src/core/lib/gpr/log_linux.cc b/contrib/libs/grpc/src/core/lib/gpr/log_linux.cc
index 2e9891d95a8..7b098d4711e 100644
--- a/contrib/libs/grpc/src/core/lib/gpr/log_linux.cc
+++ b/contrib/libs/grpc/src/core/lib/gpr/log_linux.cc
@@ -38,8 +38,8 @@
#include <sys/syscall.h>
#include <time.h>
#include <unistd.h>
-#include <util/generic/string.h>
-#include "y_absl/strings/str_format.h"
+#include <util/generic/string.h>
+#include "y_absl/strings/str_format.h"
static long sys_gettid(void) { return syscall(__NR_gettid); }
@@ -86,10 +86,10 @@ void gpr_default_log(gpr_log_func_args* args) {
strcpy(time_buffer, "error:strftime");
}
- TString prefix = y_absl::StrFormat(
- "%s%s.%09" PRId32 " %7ld %s:%d]", gpr_log_severity_string(args->severity),
- time_buffer, now.tv_nsec, tid, display_file, args->line);
- fprintf(stderr, "%-60s %s\n", prefix.c_str(), args->message);
+ TString prefix = y_absl::StrFormat(
+ "%s%s.%09" PRId32 " %7ld %s:%d]", gpr_log_severity_string(args->severity),
+ time_buffer, now.tv_nsec, tid, display_file, args->line);
+ fprintf(stderr, "%-60s %s\n", prefix.c_str(), args->message);
}
#endif /* GPR_LINUX_LOG */
diff --git a/contrib/libs/grpc/src/core/lib/gpr/log_posix.cc b/contrib/libs/grpc/src/core/lib/gpr/log_posix.cc
index 5dd441f4e18..bc02118d948 100644
--- a/contrib/libs/grpc/src/core/lib/gpr/log_posix.cc
+++ b/contrib/libs/grpc/src/core/lib/gpr/log_posix.cc
@@ -29,8 +29,8 @@
#include <stdio.h>
#include <string.h>
#include <time.h>
-#include <util/generic/string.h>
-#include "y_absl/strings/str_format.h"
+#include <util/generic/string.h>
+#include "y_absl/strings/str_format.h"
static intptr_t sys_gettid(void) { return (intptr_t)pthread_self(); }
@@ -84,10 +84,10 @@ void gpr_default_log(gpr_log_func_args* args) {
strcpy(time_buffer, "error:strftime");
}
- TString prefix = y_absl::StrFormat(
- "%s%s.%09d %7" PRIdPTR " %s:%d]", gpr_log_severity_string(args->severity),
- time_buffer, (int)(now.tv_nsec), sys_gettid(), display_file, args->line);
- fprintf(stderr, "%-70s %s\n", prefix.c_str(), args->message);
+ TString prefix = y_absl::StrFormat(
+ "%s%s.%09d %7" PRIdPTR " %s:%d]", gpr_log_severity_string(args->severity),
+ time_buffer, (int)(now.tv_nsec), sys_gettid(), display_file, args->line);
+ fprintf(stderr, "%-70s %s\n", prefix.c_str(), args->message);
}
#endif /* defined(GPR_POSIX_LOG) */
diff --git a/contrib/libs/grpc/src/core/lib/gpr/string.cc b/contrib/libs/grpc/src/core/lib/gpr/string.cc
index 2785fa4afde..28f1ae437d0 100644
--- a/contrib/libs/grpc/src/core/lib/gpr/string.cc
+++ b/contrib/libs/grpc/src/core/lib/gpr/string.cc
@@ -28,8 +28,8 @@
#include <string.h>
#include <time.h>
-#include "y_absl/strings/str_cat.h"
-
+#include "y_absl/strings/str_cat.h"
+
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
@@ -52,7 +52,7 @@ char* gpr_strdup(const char* src) {
return dst;
}
-TString gpr_format_timespec(gpr_timespec tm) {
+TString gpr_format_timespec(gpr_timespec tm) {
char time_buffer[35];
char ns_buffer[11]; // '.' + 9 digits of precision
struct tm* tm_info = localtime((const time_t*)&tm.tv_sec);
@@ -73,15 +73,15 @@ TString gpr_format_timespec(gpr_timespec tm) {
break;
}
}
- return y_absl::StrCat(time_buffer, ns_buffer, "Z");
+ return y_absl::StrCat(time_buffer, ns_buffer, "Z");
}
-struct dump_out {
- size_t capacity;
- size_t length;
- char* data;
-};
-
+struct dump_out {
+ size_t capacity;
+ size_t length;
+ char* data;
+};
+
static dump_out dump_out_create(void) {
dump_out r = {0, 0, nullptr};
return r;
diff --git a/contrib/libs/grpc/src/core/lib/gpr/string.h b/contrib/libs/grpc/src/core/lib/gpr/string.h
index d44f79d7fb8..4b348198b82 100644
--- a/contrib/libs/grpc/src/core/lib/gpr/string.h
+++ b/contrib/libs/grpc/src/core/lib/gpr/string.h
@@ -26,8 +26,8 @@
#include <stdbool.h>
#include <stddef.h>
-#include <util/generic/string.h>
-
+#include <util/generic/string.h>
+
/* String utility functions */
/* Flags for gpr_dump function. */
@@ -90,13 +90,13 @@ char* gpr_strjoin_sep(const char** strs, size_t nstrs, const char* sep,
void gpr_string_split(const char* input, const char* sep, char*** strs,
size_t* nstrs);
-/* Returns a string that represents tm according to RFC-3339, and,
+/* Returns a string that represents tm according to RFC-3339, and,
more specifically, follows:
https://developers.google.com/protocol-buffers/docs/proto3#json
Uses RFC 3339, where generated output will always be Z-normalized and uses
0, 3, 6 or 9 fractional digits. */
-TString gpr_format_timespec(gpr_timespec);
+TString gpr_format_timespec(gpr_timespec);
/** Case insensitive string comparison... return <0 if lower(a)<lower(b), ==0 if
lower(a)==lower(b), >0 if lower(a)>lower(b) */
diff --git a/contrib/libs/grpc/src/core/lib/gpr/sync_abseil.cc b/contrib/libs/grpc/src/core/lib/gpr/sync_abseil.cc
index 09f8f592b61..c224be2eeea 100644
--- a/contrib/libs/grpc/src/core/lib/gpr/sync_abseil.cc
+++ b/contrib/libs/grpc/src/core/lib/gpr/sync_abseil.cc
@@ -1,116 +1,116 @@
-/*
- *
- * Copyright 2020 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <grpc/support/port_platform.h>
-
-#if defined(GPR_ABSEIL_SYNC) && !defined(GPR_CUSTOM_SYNC)
-
-#include <grpc/support/alloc.h>
-
-#include <errno.h>
-#include <grpc/support/log.h>
-#include <grpc/support/sync.h>
-#include <grpc/support/time.h>
-#include <time.h>
-#include "src/core/lib/profiling/timers.h"
-
-#include "y_absl/base/call_once.h"
-#include "y_absl/synchronization/mutex.h"
-#include "y_absl/time/clock.h"
-#include "y_absl/time/time.h"
-
-#ifdef GPR_LOW_LEVEL_COUNTERS
-gpr_atm gpr_mu_locks = 0;
-gpr_atm gpr_counter_atm_cas = 0;
-gpr_atm gpr_counter_atm_add = 0;
-#endif
-
-void gpr_mu_init(gpr_mu* mu) {
- static_assert(sizeof(gpr_mu) == sizeof(y_absl::Mutex),
- "gpr_mu and Mutex must be the same size");
- new (mu) y_absl::Mutex;
-}
-
-void gpr_mu_destroy(gpr_mu* mu) {
- reinterpret_cast<y_absl::Mutex*>(mu)->~Mutex();
-}
-
-void gpr_mu_lock(gpr_mu* mu) ABSL_NO_THREAD_SAFETY_ANALYSIS {
- GPR_TIMER_SCOPE("gpr_mu_lock", 0);
- reinterpret_cast<y_absl::Mutex*>(mu)->Lock();
-}
-
-void gpr_mu_unlock(gpr_mu* mu) ABSL_NO_THREAD_SAFETY_ANALYSIS {
- GPR_TIMER_SCOPE("gpr_mu_unlock", 0);
- reinterpret_cast<y_absl::Mutex*>(mu)->Unlock();
-}
-
-int gpr_mu_trylock(gpr_mu* mu) {
- GPR_TIMER_SCOPE("gpr_mu_trylock", 0);
- int ret = reinterpret_cast<y_absl::Mutex*>(mu)->TryLock() == true;
- return ret;
-}
-
-/*----------------------------------------*/
-
-void gpr_cv_init(gpr_cv* cv) {
- static_assert(sizeof(gpr_cv) == sizeof(y_absl::CondVar),
- "gpr_cv and CondVar must be the same size");
- new (cv) y_absl::CondVar;
-}
-
-void gpr_cv_destroy(gpr_cv* cv) {
- reinterpret_cast<y_absl::CondVar*>(cv)->~CondVar();
-}
-
-int gpr_cv_wait(gpr_cv* cv, gpr_mu* mu, gpr_timespec abs_deadline) {
- GPR_TIMER_SCOPE("gpr_cv_wait", 0);
- if (gpr_time_cmp(abs_deadline, gpr_inf_future(abs_deadline.clock_type)) ==
- 0) {
- reinterpret_cast<y_absl::CondVar*>(cv)->Wait(
- reinterpret_cast<y_absl::Mutex*>(mu));
- return 0;
- }
- abs_deadline = gpr_convert_clock_type(abs_deadline, GPR_CLOCK_REALTIME);
- timespec ts = {static_cast<decltype(ts.tv_sec)>(abs_deadline.tv_sec),
- static_cast<decltype(ts.tv_nsec)>(abs_deadline.tv_nsec)};
- int ret = reinterpret_cast<y_absl::CondVar*>(cv)->WaitWithDeadline(
- reinterpret_cast<y_absl::Mutex*>(mu),
- y_absl::TimeFromTimespec(ts)) == true;
- return ret;
-}
-
-void gpr_cv_signal(gpr_cv* cv) {
- GPR_TIMER_MARK("gpr_cv_signal", 0);
- reinterpret_cast<y_absl::CondVar*>(cv)->Signal();
-}
-
-void gpr_cv_broadcast(gpr_cv* cv) {
- GPR_TIMER_MARK("gpr_cv_broadcast", 0);
- reinterpret_cast<y_absl::CondVar*>(cv)->SignalAll();
-}
-
-/*----------------------------------------*/
-
-void gpr_once_init(gpr_once* once, void (*init_function)(void)) {
- static_assert(sizeof(gpr_once) == sizeof(y_absl::once_flag),
- "gpr_once and y_absl::once_flag must be the same size");
- y_absl::call_once(*reinterpret_cast<y_absl::once_flag*>(once), init_function);
-}
-
-#endif /* defined(GPR_ABSEIL_SYNC) && !defined(GPR_CUSTOM_SYNC) */
+/*
+ *
+ * Copyright 2020 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <grpc/support/port_platform.h>
+
+#if defined(GPR_ABSEIL_SYNC) && !defined(GPR_CUSTOM_SYNC)
+
+#include <grpc/support/alloc.h>
+
+#include <errno.h>
+#include <grpc/support/log.h>
+#include <grpc/support/sync.h>
+#include <grpc/support/time.h>
+#include <time.h>
+#include "src/core/lib/profiling/timers.h"
+
+#include "y_absl/base/call_once.h"
+#include "y_absl/synchronization/mutex.h"
+#include "y_absl/time/clock.h"
+#include "y_absl/time/time.h"
+
+#ifdef GPR_LOW_LEVEL_COUNTERS
+gpr_atm gpr_mu_locks = 0;
+gpr_atm gpr_counter_atm_cas = 0;
+gpr_atm gpr_counter_atm_add = 0;
+#endif
+
+void gpr_mu_init(gpr_mu* mu) {
+ static_assert(sizeof(gpr_mu) == sizeof(y_absl::Mutex),
+ "gpr_mu and Mutex must be the same size");
+ new (mu) y_absl::Mutex;
+}
+
+void gpr_mu_destroy(gpr_mu* mu) {
+ reinterpret_cast<y_absl::Mutex*>(mu)->~Mutex();
+}
+
+void gpr_mu_lock(gpr_mu* mu) ABSL_NO_THREAD_SAFETY_ANALYSIS {
+ GPR_TIMER_SCOPE("gpr_mu_lock", 0);
+ reinterpret_cast<y_absl::Mutex*>(mu)->Lock();
+}
+
+void gpr_mu_unlock(gpr_mu* mu) ABSL_NO_THREAD_SAFETY_ANALYSIS {
+ GPR_TIMER_SCOPE("gpr_mu_unlock", 0);
+ reinterpret_cast<y_absl::Mutex*>(mu)->Unlock();
+}
+
+int gpr_mu_trylock(gpr_mu* mu) {
+ GPR_TIMER_SCOPE("gpr_mu_trylock", 0);
+ int ret = reinterpret_cast<y_absl::Mutex*>(mu)->TryLock() == true;
+ return ret;
+}
+
+/*----------------------------------------*/
+
+void gpr_cv_init(gpr_cv* cv) {
+ static_assert(sizeof(gpr_cv) == sizeof(y_absl::CondVar),
+ "gpr_cv and CondVar must be the same size");
+ new (cv) y_absl::CondVar;
+}
+
+void gpr_cv_destroy(gpr_cv* cv) {
+ reinterpret_cast<y_absl::CondVar*>(cv)->~CondVar();
+}
+
+int gpr_cv_wait(gpr_cv* cv, gpr_mu* mu, gpr_timespec abs_deadline) {
+ GPR_TIMER_SCOPE("gpr_cv_wait", 0);
+ if (gpr_time_cmp(abs_deadline, gpr_inf_future(abs_deadline.clock_type)) ==
+ 0) {
+ reinterpret_cast<y_absl::CondVar*>(cv)->Wait(
+ reinterpret_cast<y_absl::Mutex*>(mu));
+ return 0;
+ }
+ abs_deadline = gpr_convert_clock_type(abs_deadline, GPR_CLOCK_REALTIME);
+ timespec ts = {static_cast<decltype(ts.tv_sec)>(abs_deadline.tv_sec),
+ static_cast<decltype(ts.tv_nsec)>(abs_deadline.tv_nsec)};
+ int ret = reinterpret_cast<y_absl::CondVar*>(cv)->WaitWithDeadline(
+ reinterpret_cast<y_absl::Mutex*>(mu),
+ y_absl::TimeFromTimespec(ts)) == true;
+ return ret;
+}
+
+void gpr_cv_signal(gpr_cv* cv) {
+ GPR_TIMER_MARK("gpr_cv_signal", 0);
+ reinterpret_cast<y_absl::CondVar*>(cv)->Signal();
+}
+
+void gpr_cv_broadcast(gpr_cv* cv) {
+ GPR_TIMER_MARK("gpr_cv_broadcast", 0);
+ reinterpret_cast<y_absl::CondVar*>(cv)->SignalAll();
+}
+
+/*----------------------------------------*/
+
+void gpr_once_init(gpr_once* once, void (*init_function)(void)) {
+ static_assert(sizeof(gpr_once) == sizeof(y_absl::once_flag),
+ "gpr_once and y_absl::once_flag must be the same size");
+ y_absl::call_once(*reinterpret_cast<y_absl::once_flag*>(once), init_function);
+}
+
+#endif /* defined(GPR_ABSEIL_SYNC) && !defined(GPR_CUSTOM_SYNC) */
diff --git a/contrib/libs/grpc/src/core/lib/gpr/sync_posix.cc b/contrib/libs/grpc/src/core/lib/gpr/sync_posix.cc
index faa0925d5e0..fdd278be233 100644
--- a/contrib/libs/grpc/src/core/lib/gpr/sync_posix.cc
+++ b/contrib/libs/grpc/src/core/lib/gpr/sync_posix.cc
@@ -18,17 +18,17 @@
#include <grpc/support/port_platform.h>
-#if defined(GPR_POSIX_SYNC) && !defined(GPR_ABSEIL_SYNC) && \
- !defined(GPR_CUSTOM_SYNC)
-
+#if defined(GPR_POSIX_SYNC) && !defined(GPR_ABSEIL_SYNC) && \
+ !defined(GPR_CUSTOM_SYNC)
+
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/sync.h>
#include <grpc/support/time.h>
-
-#include <errno.h>
+
+#include <errno.h>
#include <time.h>
-
+
#include "src/core/lib/profiling/timers.h"
#ifdef GPR_LOW_LEVEL_COUNTERS
@@ -128,9 +128,9 @@ int gpr_cv_wait(gpr_cv* cv, gpr_mu* mu, gpr_timespec abs_deadline) {
} else {
struct timespec abs_deadline_ts;
#if GPR_LINUX
- abs_deadline = gpr_convert_clock_type(abs_deadline, GPR_CLOCK_MONOTONIC);
+ abs_deadline = gpr_convert_clock_type(abs_deadline, GPR_CLOCK_MONOTONIC);
#else
- abs_deadline = gpr_convert_clock_type(abs_deadline, GPR_CLOCK_REALTIME);
+ abs_deadline = gpr_convert_clock_type(abs_deadline, GPR_CLOCK_REALTIME);
#endif // GPR_LINUX
abs_deadline_ts.tv_sec = static_cast<time_t>(abs_deadline.tv_sec);
abs_deadline_ts.tv_nsec = abs_deadline.tv_nsec;
@@ -166,5 +166,5 @@ void gpr_once_init(gpr_once* once, void (*init_function)(void)) {
GPR_ASSERT(pthread_once(once, init_function) == 0);
}
-#endif /* defined(GPR_POSIX_SYNC) && !defined(GPR_ABSEIL_SYNC) && \
- !defined(GPR_CUSTOM_SYNC) */
+#endif /* defined(GPR_POSIX_SYNC) && !defined(GPR_ABSEIL_SYNC) && \
+ !defined(GPR_CUSTOM_SYNC) */
diff --git a/contrib/libs/grpc/src/core/lib/gpr/sync_windows.cc b/contrib/libs/grpc/src/core/lib/gpr/sync_windows.cc
index 1ffe06b0955..64eec7c2e11 100644
--- a/contrib/libs/grpc/src/core/lib/gpr/sync_windows.cc
+++ b/contrib/libs/grpc/src/core/lib/gpr/sync_windows.cc
@@ -20,8 +20,8 @@
#include <grpc/support/port_platform.h>
-#if defined(GPR_WINDOWS) && !defined(GPR_ABSEIL_SYNC) && \
- !defined(GPR_CUSTOM_SYNC)
+#if defined(GPR_WINDOWS) && !defined(GPR_ABSEIL_SYNC) && \
+ !defined(GPR_CUSTOM_SYNC)
#include <grpc/support/log.h>
#include <grpc/support/sync.h>
@@ -116,5 +116,5 @@ void gpr_once_init(gpr_once* once, void (*init_function)(void)) {
InitOnceExecuteOnce(once, run_once_func, &arg, &dummy);
}
-#endif /* defined(GPR_WINDOWS) && !defined(GPR_ABSEIL_SYNC) && \
- !defined(GPR_CUSTOM_SYNC) */
+#endif /* defined(GPR_WINDOWS) && !defined(GPR_ABSEIL_SYNC) && \
+ !defined(GPR_CUSTOM_SYNC) */
diff --git a/contrib/libs/grpc/src/core/lib/gpr/time.cc b/contrib/libs/grpc/src/core/lib/gpr/time.cc
index 2c96c5b2baf..db5a7f64f70 100644
--- a/contrib/libs/grpc/src/core/lib/gpr/time.cc
+++ b/contrib/libs/grpc/src/core/lib/gpr/time.cc
@@ -254,10 +254,10 @@ gpr_timespec gpr_convert_clock_type(gpr_timespec t, gpr_clock_type clock_type) {
return gpr_time_add(gpr_now(clock_type), t);
}
- // If the given input hits this code, the same result is not guaranteed for
- // the same input because it relies on `gpr_now` to calculate the difference
- // between two different clocks. Please be careful when you want to use this
- // function in unit tests. (e.g. https://github.com/grpc/grpc/pull/22655)
+ // If the given input hits this code, the same result is not guaranteed for
+ // the same input because it relies on `gpr_now` to calculate the difference
+ // between two different clocks. Please be careful when you want to use this
+ // function in unit tests. (e.g. https://github.com/grpc/grpc/pull/22655)
return gpr_time_add(gpr_now(clock_type),
gpr_time_sub(t, gpr_now(t.clock_type)));
}
diff --git a/contrib/libs/grpc/src/core/lib/gpr/time_posix.cc b/contrib/libs/grpc/src/core/lib/gpr/time_posix.cc
index 61f5e0f14de..0a9e1158b32 100644
--- a/contrib/libs/grpc/src/core/lib/gpr/time_posix.cc
+++ b/contrib/libs/grpc/src/core/lib/gpr/time_posix.cc
@@ -82,7 +82,7 @@ static gpr_timespec now_impl(gpr_clock_type clock_type) {
}
}
#else
-/* For some reason Apple's OSes haven't implemented clock_gettime. */
+/* For some reason Apple's OSes haven't implemented clock_gettime. */
#include <mach/mach.h>
#include <mach/mach_time.h>
diff --git a/contrib/libs/grpc/src/core/lib/gpr/time_precise.cc b/contrib/libs/grpc/src/core/lib/gpr/time_precise.cc
index 20f27d84ec6..4d1b64b8b26 100644
--- a/contrib/libs/grpc/src/core/lib/gpr/time_precise.cc
+++ b/contrib/libs/grpc/src/core/lib/gpr/time_precise.cc
@@ -31,8 +31,8 @@
#include "src/core/lib/gpr/time_precise.h"
-#ifndef GPR_CYCLE_COUNTER_CUSTOM
-#if GPR_CYCLE_COUNTER_RDTSC_32 || GPR_CYCLE_COUNTER_RDTSC_64
+#ifndef GPR_CYCLE_COUNTER_CUSTOM
+#if GPR_CYCLE_COUNTER_RDTSC_32 || GPR_CYCLE_COUNTER_RDTSC_64
#if GPR_LINUX
static bool read_freq_from_kernel(double* freq) {
// Google production kernel export the frequency for us in kHz.
@@ -164,4 +164,4 @@ gpr_timespec gpr_cycle_counter_sub(gpr_cycle_counter a, gpr_cycle_counter b) {
gpr_cycle_counter_to_time(b));
}
#endif /* GPR_CYCLE_COUNTER_FALLBACK */
-#endif /* !GPR_CYCLE_COUNTER_CUSTOM */
+#endif /* !GPR_CYCLE_COUNTER_CUSTOM */
diff --git a/contrib/libs/grpc/src/core/lib/gpr/time_precise.h b/contrib/libs/grpc/src/core/lib/gpr/time_precise.h
index a68ce284771..1dcfa3b57e6 100644
--- a/contrib/libs/grpc/src/core/lib/gpr/time_precise.h
+++ b/contrib/libs/grpc/src/core/lib/gpr/time_precise.h
@@ -31,11 +31,11 @@
// Using gpr_get_cycle_counter() is preferred to using ExecCtx::Get()->Now()
// whenever possible.
-#if GPR_CYCLE_COUNTER_CUSTOM
+#if GPR_CYCLE_COUNTER_CUSTOM
+typedef int64_t gpr_cycle_counter;
+gpr_cycle_counter gpr_get_cycle_counter();
+#elif GPR_CYCLE_COUNTER_RDTSC_32
typedef int64_t gpr_cycle_counter;
-gpr_cycle_counter gpr_get_cycle_counter();
-#elif GPR_CYCLE_COUNTER_RDTSC_32
-typedef int64_t gpr_cycle_counter;
inline gpr_cycle_counter gpr_get_cycle_counter() {
int64_t ret;
__asm__ volatile("rdtsc" : "=A"(ret));
@@ -57,8 +57,8 @@ gpr_cycle_counter gpr_get_cycle_counter();
#else
#error Must define exactly one of \
GPR_CYCLE_COUNTER_RDTSC_32, \
- GPR_CYCLE_COUNTER_RDTSC_64, \
- GPR_CYCLE_COUNTER_CUSTOM, or \
+ GPR_CYCLE_COUNTER_RDTSC_64, \
+ GPR_CYCLE_COUNTER_CUSTOM, or \
GPR_CYCLE_COUNTER_FALLBACK
#endif
diff --git a/contrib/libs/grpc/src/core/lib/gprpp/debug_location.h b/contrib/libs/grpc/src/core/lib/gprpp/debug_location.h
index 6b92b4e89a1..a96e06e2350 100644
--- a/contrib/libs/grpc/src/core/lib/gprpp/debug_location.h
+++ b/contrib/libs/grpc/src/core/lib/gprpp/debug_location.h
@@ -26,7 +26,7 @@ namespace grpc_core {
// Callers can use the DEBUG_LOCATION macro in either case.
#ifndef NDEBUG
// TODO(roth): See if there's a way to automatically populate this,
-// similarly to how y_absl::SourceLocation::current() works, so that
+// similarly to how y_absl::SourceLocation::current() works, so that
// callers don't need to explicitly pass DEBUG_LOCATION anywhere.
class DebugLocation {
public:
diff --git a/contrib/libs/grpc/src/core/lib/gprpp/dual_ref_counted.h b/contrib/libs/grpc/src/core/lib/gprpp/dual_ref_counted.h
index fef7da530d7..66935bbdea1 100644
--- a/contrib/libs/grpc/src/core/lib/gprpp/dual_ref_counted.h
+++ b/contrib/libs/grpc/src/core/lib/gprpp/dual_ref_counted.h
@@ -1,336 +1,336 @@
-//
-// Copyright 2020 gRPC authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-#ifndef GRPC_CORE_LIB_GPRPP_DUAL_REF_COUNTED_H
-#define GRPC_CORE_LIB_GPRPP_DUAL_REF_COUNTED_H
-
-#include <grpc/support/port_platform.h>
-
-#include <grpc/support/atm.h>
-#include <grpc/support/log.h>
-#include <grpc/support/sync.h>
-
-#include <atomic>
-#include <cassert>
-#include <cinttypes>
-
-#include "src/core/lib/debug/trace.h"
-#include "src/core/lib/gprpp/atomic.h"
-#include "src/core/lib/gprpp/debug_location.h"
-#include "src/core/lib/gprpp/orphanable.h"
-#include "src/core/lib/gprpp/ref_counted_ptr.h"
-
-namespace grpc_core {
-
-// DualRefCounted is an interface for reference-counted objects with two
-// classes of refs: strong refs (usually just called "refs") and weak refs.
-// This supports cases where an object needs to start shutting down when
-// all external callers are done with it (represented by strong refs) but
-// cannot be destroyed until all internal callbacks are complete
-// (represented by weak refs).
-//
-// Each class of refs can be incremented and decremented independently.
-// Objects start with 1 strong ref and 0 weak refs at instantiation.
-// When the strong refcount reaches 0, the object's Orphan() method is called.
-// When the weak refcount reaches 0, the object is destroyed.
-//
-// This will be used by CRTP (curiously-recurring template pattern), e.g.:
-// class MyClass : public RefCounted<MyClass> { ... };
-template <typename Child>
-class DualRefCounted : public Orphanable {
- public:
- virtual ~DualRefCounted() = default;
-
- RefCountedPtr<Child> Ref() GRPC_MUST_USE_RESULT {
- IncrementRefCount();
- return RefCountedPtr<Child>(static_cast<Child*>(this));
- }
-
- RefCountedPtr<Child> Ref(const DebugLocation& location,
- const char* reason) GRPC_MUST_USE_RESULT {
- IncrementRefCount(location, reason);
- return RefCountedPtr<Child>(static_cast<Child*>(this));
- }
-
- void Unref() {
- // Convert strong ref to weak ref.
- const uint64_t prev_ref_pair =
- refs_.FetchAdd(MakeRefPair(-1, 1), MemoryOrder::ACQ_REL);
- const uint32_t strong_refs = GetStrongRefs(prev_ref_pair);
-#ifndef NDEBUG
- const uint32_t weak_refs = GetWeakRefs(prev_ref_pair);
- if (trace_flag_ != nullptr && trace_flag_->enabled()) {
- gpr_log(GPR_INFO, "%s:%p unref %d -> %d, weak_ref %d -> %d",
- trace_flag_->name(), this, strong_refs, strong_refs - 1,
- weak_refs, weak_refs + 1);
- }
- GPR_ASSERT(strong_refs > 0);
-#endif
- if (GPR_UNLIKELY(strong_refs == 1)) {
- Orphan();
- }
- // Now drop the weak ref.
- WeakUnref();
- }
- void Unref(const DebugLocation& location, const char* reason) {
- const uint64_t prev_ref_pair =
- refs_.FetchAdd(MakeRefPair(-1, 1), MemoryOrder::ACQ_REL);
- const uint32_t strong_refs = GetStrongRefs(prev_ref_pair);
-#ifndef NDEBUG
- const uint32_t weak_refs = GetWeakRefs(prev_ref_pair);
- if (trace_flag_ != nullptr && trace_flag_->enabled()) {
- gpr_log(GPR_INFO, "%s:%p %s:%d unref %d -> %d, weak_ref %d -> %d) %s",
- trace_flag_->name(), this, location.file(), location.line(),
- strong_refs, strong_refs - 1, weak_refs, weak_refs + 1, reason);
- }
- GPR_ASSERT(strong_refs > 0);
-#else
- // Avoid unused-parameter warnings for debug-only parameters
- (void)location;
- (void)reason;
-#endif
- if (GPR_UNLIKELY(strong_refs == 1)) {
- Orphan();
- }
- // Now drop the weak ref.
- WeakUnref(location, reason);
- }
-
- RefCountedPtr<Child> RefIfNonZero() GRPC_MUST_USE_RESULT {
- uint64_t prev_ref_pair = refs_.Load(MemoryOrder::ACQUIRE);
- do {
- const uint32_t strong_refs = GetStrongRefs(prev_ref_pair);
-#ifndef NDEBUG
- const uint32_t weak_refs = GetWeakRefs(prev_ref_pair);
- if (trace_flag_ != nullptr && trace_flag_->enabled()) {
- gpr_log(GPR_INFO, "%s:%p ref_if_non_zero %d -> %d (weak_refs=%d)",
- trace_flag_->name(), this, strong_refs, strong_refs + 1,
- weak_refs);
- }
-#endif
- if (strong_refs == 0) return nullptr;
- } while (!refs_.CompareExchangeWeak(
- &prev_ref_pair, prev_ref_pair + MakeRefPair(1, 0), MemoryOrder::ACQ_REL,
- MemoryOrder::ACQUIRE));
- return RefCountedPtr<Child>(static_cast<Child*>(this));
- }
-
- RefCountedPtr<Child> RefIfNonZero(const DebugLocation& location,
- const char* reason) GRPC_MUST_USE_RESULT {
- uint64_t prev_ref_pair = refs_.Load(MemoryOrder::ACQUIRE);
- do {
- const uint32_t strong_refs = GetStrongRefs(prev_ref_pair);
-#ifndef NDEBUG
- const uint32_t weak_refs = GetWeakRefs(prev_ref_pair);
- if (trace_flag_ != nullptr && trace_flag_->enabled()) {
- gpr_log(GPR_INFO,
- "%s:%p %s:%d ref_if_non_zero %d -> %d (weak_refs=%d) %s",
- trace_flag_->name(), this, location.file(), location.line(),
- strong_refs, strong_refs + 1, weak_refs, reason);
- }
-#else
- // Avoid unused-parameter warnings for debug-only parameters
- (void)location;
- (void)reason;
-#endif
- if (strong_refs == 0) return nullptr;
- } while (!refs_.CompareExchangeWeak(
- &prev_ref_pair, prev_ref_pair + MakeRefPair(1, 0), MemoryOrder::ACQ_REL,
- MemoryOrder::ACQUIRE));
- return RefCountedPtr<Child>(static_cast<Child*>(this));
- }
-
- WeakRefCountedPtr<Child> WeakRef() GRPC_MUST_USE_RESULT {
- IncrementWeakRefCount();
- return WeakRefCountedPtr<Child>(static_cast<Child*>(this));
- }
-
- WeakRefCountedPtr<Child> WeakRef(const DebugLocation& location,
- const char* reason) GRPC_MUST_USE_RESULT {
- IncrementWeakRefCount(location, reason);
- return WeakRefCountedPtr<Child>(static_cast<Child*>(this));
- }
-
- void WeakUnref() {
-#ifndef NDEBUG
- // Grab a copy of the trace flag before the atomic change, since we
- // can't safely access it afterwards if we're going to be freed.
- auto* trace_flag = trace_flag_;
-#endif
- const uint64_t prev_ref_pair =
- refs_.FetchSub(MakeRefPair(0, 1), MemoryOrder::ACQ_REL);
- const uint32_t weak_refs = GetWeakRefs(prev_ref_pair);
-#ifndef NDEBUG
- const uint32_t strong_refs = GetStrongRefs(prev_ref_pair);
- if (trace_flag != nullptr && trace_flag->enabled()) {
- gpr_log(GPR_INFO, "%s:%p weak_unref %d -> %d (refs=%d)",
- trace_flag->name(), this, weak_refs, weak_refs - 1, strong_refs);
- }
- GPR_ASSERT(weak_refs > 0);
-#endif
- if (GPR_UNLIKELY(prev_ref_pair == MakeRefPair(0, 1))) {
- delete static_cast<Child*>(this);
- }
- }
- void WeakUnref(const DebugLocation& location, const char* reason) {
-#ifndef NDEBUG
- // Grab a copy of the trace flag before the atomic change, since we
- // can't safely access it afterwards if we're going to be freed.
- auto* trace_flag = trace_flag_;
-#endif
- const uint64_t prev_ref_pair =
- refs_.FetchSub(MakeRefPair(0, 1), MemoryOrder::ACQ_REL);
- const uint32_t weak_refs = GetWeakRefs(prev_ref_pair);
-#ifndef NDEBUG
- const uint32_t strong_refs = GetStrongRefs(prev_ref_pair);
- if (trace_flag != nullptr && trace_flag->enabled()) {
- gpr_log(GPR_INFO, "%s:%p %s:%d weak_unref %d -> %d (refs=%d) %s",
- trace_flag->name(), this, location.file(), location.line(),
- weak_refs, weak_refs - 1, strong_refs, reason);
- }
- GPR_ASSERT(weak_refs > 0);
-#else
- // Avoid unused-parameter warnings for debug-only parameters
- (void)location;
- (void)reason;
-#endif
- if (GPR_UNLIKELY(prev_ref_pair == MakeRefPair(0, 1))) {
- delete static_cast<Child*>(this);
- }
- }
-
- // Not copyable nor movable.
- DualRefCounted(const DualRefCounted&) = delete;
- DualRefCounted& operator=(const DualRefCounted&) = delete;
-
- protected:
- // TraceFlagT is defined to accept both DebugOnlyTraceFlag and TraceFlag.
- // Note: RefCount tracing is only enabled on debug builds, even when a
- // TraceFlag is used.
- template <typename TraceFlagT = TraceFlag>
- explicit DualRefCounted(
- TraceFlagT*
-#ifndef NDEBUG
- // Leave unnamed if NDEBUG to avoid unused parameter warning
- trace_flag
-#endif
- = nullptr,
- int32_t initial_refcount = 1)
- :
-#ifndef NDEBUG
- trace_flag_(trace_flag),
-#endif
- refs_(MakeRefPair(initial_refcount, 0)) {
- }
-
- private:
- // Allow RefCountedPtr<> to access IncrementRefCount().
- template <typename T>
- friend class RefCountedPtr;
- // Allow WeakRefCountedPtr<> to access IncrementWeakRefCount().
- template <typename T>
- friend class WeakRefCountedPtr;
-
- // First 32 bits are strong refs, next 32 bits are weak refs.
- static uint64_t MakeRefPair(uint32_t strong, uint32_t weak) {
- return (static_cast<uint64_t>(strong) << 32) + static_cast<int64_t>(weak);
- }
- static uint32_t GetStrongRefs(uint64_t ref_pair) {
- return static_cast<uint32_t>(ref_pair >> 32);
- }
- static uint32_t GetWeakRefs(uint64_t ref_pair) {
- return static_cast<uint32_t>(ref_pair & 0xffffffffu);
- }
-
- void IncrementRefCount() {
-#ifndef NDEBUG
- const uint64_t prev_ref_pair =
- refs_.FetchAdd(MakeRefPair(1, 0), MemoryOrder::RELAXED);
- const uint32_t strong_refs = GetStrongRefs(prev_ref_pair);
- const uint32_t weak_refs = GetWeakRefs(prev_ref_pair);
- GPR_ASSERT(strong_refs != 0);
- if (trace_flag_ != nullptr && trace_flag_->enabled()) {
- gpr_log(GPR_INFO, "%s:%p ref %d -> %d; (weak_refs=%d)",
- trace_flag_->name(), this, strong_refs, strong_refs + 1,
- weak_refs);
- }
-#else
- refs_.FetchAdd(MakeRefPair(1, 0), MemoryOrder::RELAXED);
-#endif
- }
- void IncrementRefCount(const DebugLocation& location, const char* reason) {
-#ifndef NDEBUG
- const uint64_t prev_ref_pair =
- refs_.FetchAdd(MakeRefPair(1, 0), MemoryOrder::RELAXED);
- const uint32_t strong_refs = GetStrongRefs(prev_ref_pair);
- const uint32_t weak_refs = GetWeakRefs(prev_ref_pair);
- GPR_ASSERT(strong_refs != 0);
- if (trace_flag_ != nullptr && trace_flag_->enabled()) {
- gpr_log(GPR_INFO, "%s:%p %s:%d ref %d -> %d (weak_refs=%d) %s",
- trace_flag_->name(), this, location.file(), location.line(),
- strong_refs, strong_refs + 1, weak_refs, reason);
- }
-#else
- // Use conditionally-important parameters
- (void)location;
- (void)reason;
- refs_.FetchAdd(MakeRefPair(1, 0), MemoryOrder::RELAXED);
-#endif
- }
-
- void IncrementWeakRefCount() {
-#ifndef NDEBUG
- const uint64_t prev_ref_pair =
- refs_.FetchAdd(MakeRefPair(0, 1), MemoryOrder::RELAXED);
- const uint32_t strong_refs = GetStrongRefs(prev_ref_pair);
- const uint32_t weak_refs = GetWeakRefs(prev_ref_pair);
- if (trace_flag_ != nullptr && trace_flag_->enabled()) {
- gpr_log(GPR_INFO, "%s:%p weak_ref %d -> %d; (refs=%d)",
- trace_flag_->name(), this, weak_refs, weak_refs + 1, strong_refs);
- }
-#else
- refs_.FetchAdd(MakeRefPair(0, 1), MemoryOrder::RELAXED);
-#endif
- }
- void IncrementWeakRefCount(const DebugLocation& location,
- const char* reason) {
-#ifndef NDEBUG
- const uint64_t prev_ref_pair =
- refs_.FetchAdd(MakeRefPair(0, 1), MemoryOrder::RELAXED);
- const uint32_t strong_refs = GetStrongRefs(prev_ref_pair);
- const uint32_t weak_refs = GetWeakRefs(prev_ref_pair);
- if (trace_flag_ != nullptr && trace_flag_->enabled()) {
- gpr_log(GPR_INFO, "%s:%p %s:%d weak_ref %d -> %d (refs=%d) %s",
- trace_flag_->name(), this, location.file(), location.line(),
- weak_refs, weak_refs + 1, strong_refs, reason);
- }
-#else
- // Use conditionally-important parameters
- (void)location;
- (void)reason;
- refs_.FetchAdd(MakeRefPair(0, 1), MemoryOrder::RELAXED);
-#endif
- }
-
-#ifndef NDEBUG
- TraceFlag* trace_flag_;
-#endif
- Atomic<uint64_t> refs_;
-};
-
-} // namespace grpc_core
-
-#endif /* GRPC_CORE_LIB_GPRPP_DUAL_REF_COUNTED_H */
+//
+// Copyright 2020 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+#ifndef GRPC_CORE_LIB_GPRPP_DUAL_REF_COUNTED_H
+#define GRPC_CORE_LIB_GPRPP_DUAL_REF_COUNTED_H
+
+#include <grpc/support/port_platform.h>
+
+#include <grpc/support/atm.h>
+#include <grpc/support/log.h>
+#include <grpc/support/sync.h>
+
+#include <atomic>
+#include <cassert>
+#include <cinttypes>
+
+#include "src/core/lib/debug/trace.h"
+#include "src/core/lib/gprpp/atomic.h"
+#include "src/core/lib/gprpp/debug_location.h"
+#include "src/core/lib/gprpp/orphanable.h"
+#include "src/core/lib/gprpp/ref_counted_ptr.h"
+
+namespace grpc_core {
+
+// DualRefCounted is an interface for reference-counted objects with two
+// classes of refs: strong refs (usually just called "refs") and weak refs.
+// This supports cases where an object needs to start shutting down when
+// all external callers are done with it (represented by strong refs) but
+// cannot be destroyed until all internal callbacks are complete
+// (represented by weak refs).
+//
+// Each class of refs can be incremented and decremented independently.
+// Objects start with 1 strong ref and 0 weak refs at instantiation.
+// When the strong refcount reaches 0, the object's Orphan() method is called.
+// When the weak refcount reaches 0, the object is destroyed.
+//
+// This will be used by CRTP (curiously-recurring template pattern), e.g.:
+// class MyClass : public RefCounted<MyClass> { ... };
+template <typename Child>
+class DualRefCounted : public Orphanable {
+ public:
+ virtual ~DualRefCounted() = default;
+
+ RefCountedPtr<Child> Ref() GRPC_MUST_USE_RESULT {
+ IncrementRefCount();
+ return RefCountedPtr<Child>(static_cast<Child*>(this));
+ }
+
+ RefCountedPtr<Child> Ref(const DebugLocation& location,
+ const char* reason) GRPC_MUST_USE_RESULT {
+ IncrementRefCount(location, reason);
+ return RefCountedPtr<Child>(static_cast<Child*>(this));
+ }
+
+ void Unref() {
+ // Convert strong ref to weak ref.
+ const uint64_t prev_ref_pair =
+ refs_.FetchAdd(MakeRefPair(-1, 1), MemoryOrder::ACQ_REL);
+ const uint32_t strong_refs = GetStrongRefs(prev_ref_pair);
+#ifndef NDEBUG
+ const uint32_t weak_refs = GetWeakRefs(prev_ref_pair);
+ if (trace_flag_ != nullptr && trace_flag_->enabled()) {
+ gpr_log(GPR_INFO, "%s:%p unref %d -> %d, weak_ref %d -> %d",
+ trace_flag_->name(), this, strong_refs, strong_refs - 1,
+ weak_refs, weak_refs + 1);
+ }
+ GPR_ASSERT(strong_refs > 0);
+#endif
+ if (GPR_UNLIKELY(strong_refs == 1)) {
+ Orphan();
+ }
+ // Now drop the weak ref.
+ WeakUnref();
+ }
+ void Unref(const DebugLocation& location, const char* reason) {
+ const uint64_t prev_ref_pair =
+ refs_.FetchAdd(MakeRefPair(-1, 1), MemoryOrder::ACQ_REL);
+ const uint32_t strong_refs = GetStrongRefs(prev_ref_pair);
+#ifndef NDEBUG
+ const uint32_t weak_refs = GetWeakRefs(prev_ref_pair);
+ if (trace_flag_ != nullptr && trace_flag_->enabled()) {
+ gpr_log(GPR_INFO, "%s:%p %s:%d unref %d -> %d, weak_ref %d -> %d) %s",
+ trace_flag_->name(), this, location.file(), location.line(),
+ strong_refs, strong_refs - 1, weak_refs, weak_refs + 1, reason);
+ }
+ GPR_ASSERT(strong_refs > 0);
+#else
+ // Avoid unused-parameter warnings for debug-only parameters
+ (void)location;
+ (void)reason;
+#endif
+ if (GPR_UNLIKELY(strong_refs == 1)) {
+ Orphan();
+ }
+ // Now drop the weak ref.
+ WeakUnref(location, reason);
+ }
+
+ RefCountedPtr<Child> RefIfNonZero() GRPC_MUST_USE_RESULT {
+ uint64_t prev_ref_pair = refs_.Load(MemoryOrder::ACQUIRE);
+ do {
+ const uint32_t strong_refs = GetStrongRefs(prev_ref_pair);
+#ifndef NDEBUG
+ const uint32_t weak_refs = GetWeakRefs(prev_ref_pair);
+ if (trace_flag_ != nullptr && trace_flag_->enabled()) {
+ gpr_log(GPR_INFO, "%s:%p ref_if_non_zero %d -> %d (weak_refs=%d)",
+ trace_flag_->name(), this, strong_refs, strong_refs + 1,
+ weak_refs);
+ }
+#endif
+ if (strong_refs == 0) return nullptr;
+ } while (!refs_.CompareExchangeWeak(
+ &prev_ref_pair, prev_ref_pair + MakeRefPair(1, 0), MemoryOrder::ACQ_REL,
+ MemoryOrder::ACQUIRE));
+ return RefCountedPtr<Child>(static_cast<Child*>(this));
+ }
+
+ RefCountedPtr<Child> RefIfNonZero(const DebugLocation& location,
+ const char* reason) GRPC_MUST_USE_RESULT {
+ uint64_t prev_ref_pair = refs_.Load(MemoryOrder::ACQUIRE);
+ do {
+ const uint32_t strong_refs = GetStrongRefs(prev_ref_pair);
+#ifndef NDEBUG
+ const uint32_t weak_refs = GetWeakRefs(prev_ref_pair);
+ if (trace_flag_ != nullptr && trace_flag_->enabled()) {
+ gpr_log(GPR_INFO,
+ "%s:%p %s:%d ref_if_non_zero %d -> %d (weak_refs=%d) %s",
+ trace_flag_->name(), this, location.file(), location.line(),
+ strong_refs, strong_refs + 1, weak_refs, reason);
+ }
+#else
+ // Avoid unused-parameter warnings for debug-only parameters
+ (void)location;
+ (void)reason;
+#endif
+ if (strong_refs == 0) return nullptr;
+ } while (!refs_.CompareExchangeWeak(
+ &prev_ref_pair, prev_ref_pair + MakeRefPair(1, 0), MemoryOrder::ACQ_REL,
+ MemoryOrder::ACQUIRE));
+ return RefCountedPtr<Child>(static_cast<Child*>(this));
+ }
+
+ WeakRefCountedPtr<Child> WeakRef() GRPC_MUST_USE_RESULT {
+ IncrementWeakRefCount();
+ return WeakRefCountedPtr<Child>(static_cast<Child*>(this));
+ }
+
+ WeakRefCountedPtr<Child> WeakRef(const DebugLocation& location,
+ const char* reason) GRPC_MUST_USE_RESULT {
+ IncrementWeakRefCount(location, reason);
+ return WeakRefCountedPtr<Child>(static_cast<Child*>(this));
+ }
+
+ void WeakUnref() {
+#ifndef NDEBUG
+ // Grab a copy of the trace flag before the atomic change, since we
+ // can't safely access it afterwards if we're going to be freed.
+ auto* trace_flag = trace_flag_;
+#endif
+ const uint64_t prev_ref_pair =
+ refs_.FetchSub(MakeRefPair(0, 1), MemoryOrder::ACQ_REL);
+ const uint32_t weak_refs = GetWeakRefs(prev_ref_pair);
+#ifndef NDEBUG
+ const uint32_t strong_refs = GetStrongRefs(prev_ref_pair);
+ if (trace_flag != nullptr && trace_flag->enabled()) {
+ gpr_log(GPR_INFO, "%s:%p weak_unref %d -> %d (refs=%d)",
+ trace_flag->name(), this, weak_refs, weak_refs - 1, strong_refs);
+ }
+ GPR_ASSERT(weak_refs > 0);
+#endif
+ if (GPR_UNLIKELY(prev_ref_pair == MakeRefPair(0, 1))) {
+ delete static_cast<Child*>(this);
+ }
+ }
+ void WeakUnref(const DebugLocation& location, const char* reason) {
+#ifndef NDEBUG
+ // Grab a copy of the trace flag before the atomic change, since we
+ // can't safely access it afterwards if we're going to be freed.
+ auto* trace_flag = trace_flag_;
+#endif
+ const uint64_t prev_ref_pair =
+ refs_.FetchSub(MakeRefPair(0, 1), MemoryOrder::ACQ_REL);
+ const uint32_t weak_refs = GetWeakRefs(prev_ref_pair);
+#ifndef NDEBUG
+ const uint32_t strong_refs = GetStrongRefs(prev_ref_pair);
+ if (trace_flag != nullptr && trace_flag->enabled()) {
+ gpr_log(GPR_INFO, "%s:%p %s:%d weak_unref %d -> %d (refs=%d) %s",
+ trace_flag->name(), this, location.file(), location.line(),
+ weak_refs, weak_refs - 1, strong_refs, reason);
+ }
+ GPR_ASSERT(weak_refs > 0);
+#else
+ // Avoid unused-parameter warnings for debug-only parameters
+ (void)location;
+ (void)reason;
+#endif
+ if (GPR_UNLIKELY(prev_ref_pair == MakeRefPair(0, 1))) {
+ delete static_cast<Child*>(this);
+ }
+ }
+
+ // Not copyable nor movable.
+ DualRefCounted(const DualRefCounted&) = delete;
+ DualRefCounted& operator=(const DualRefCounted&) = delete;
+
+ protected:
+ // TraceFlagT is defined to accept both DebugOnlyTraceFlag and TraceFlag.
+ // Note: RefCount tracing is only enabled on debug builds, even when a
+ // TraceFlag is used.
+ template <typename TraceFlagT = TraceFlag>
+ explicit DualRefCounted(
+ TraceFlagT*
+#ifndef NDEBUG
+ // Leave unnamed if NDEBUG to avoid unused parameter warning
+ trace_flag
+#endif
+ = nullptr,
+ int32_t initial_refcount = 1)
+ :
+#ifndef NDEBUG
+ trace_flag_(trace_flag),
+#endif
+ refs_(MakeRefPair(initial_refcount, 0)) {
+ }
+
+ private:
+ // Allow RefCountedPtr<> to access IncrementRefCount().
+ template <typename T>
+ friend class RefCountedPtr;
+ // Allow WeakRefCountedPtr<> to access IncrementWeakRefCount().
+ template <typename T>
+ friend class WeakRefCountedPtr;
+
+ // First 32 bits are strong refs, next 32 bits are weak refs.
+ static uint64_t MakeRefPair(uint32_t strong, uint32_t weak) {
+ return (static_cast<uint64_t>(strong) << 32) + static_cast<int64_t>(weak);
+ }
+ static uint32_t GetStrongRefs(uint64_t ref_pair) {
+ return static_cast<uint32_t>(ref_pair >> 32);
+ }
+ static uint32_t GetWeakRefs(uint64_t ref_pair) {
+ return static_cast<uint32_t>(ref_pair & 0xffffffffu);
+ }
+
+ void IncrementRefCount() {
+#ifndef NDEBUG
+ const uint64_t prev_ref_pair =
+ refs_.FetchAdd(MakeRefPair(1, 0), MemoryOrder::RELAXED);
+ const uint32_t strong_refs = GetStrongRefs(prev_ref_pair);
+ const uint32_t weak_refs = GetWeakRefs(prev_ref_pair);
+ GPR_ASSERT(strong_refs != 0);
+ if (trace_flag_ != nullptr && trace_flag_->enabled()) {
+ gpr_log(GPR_INFO, "%s:%p ref %d -> %d; (weak_refs=%d)",
+ trace_flag_->name(), this, strong_refs, strong_refs + 1,
+ weak_refs);
+ }
+#else
+ refs_.FetchAdd(MakeRefPair(1, 0), MemoryOrder::RELAXED);
+#endif
+ }
+ void IncrementRefCount(const DebugLocation& location, const char* reason) {
+#ifndef NDEBUG
+ const uint64_t prev_ref_pair =
+ refs_.FetchAdd(MakeRefPair(1, 0), MemoryOrder::RELAXED);
+ const uint32_t strong_refs = GetStrongRefs(prev_ref_pair);
+ const uint32_t weak_refs = GetWeakRefs(prev_ref_pair);
+ GPR_ASSERT(strong_refs != 0);
+ if (trace_flag_ != nullptr && trace_flag_->enabled()) {
+ gpr_log(GPR_INFO, "%s:%p %s:%d ref %d -> %d (weak_refs=%d) %s",
+ trace_flag_->name(), this, location.file(), location.line(),
+ strong_refs, strong_refs + 1, weak_refs, reason);
+ }
+#else
+ // Use conditionally-important parameters
+ (void)location;
+ (void)reason;
+ refs_.FetchAdd(MakeRefPair(1, 0), MemoryOrder::RELAXED);
+#endif
+ }
+
+ void IncrementWeakRefCount() {
+#ifndef NDEBUG
+ const uint64_t prev_ref_pair =
+ refs_.FetchAdd(MakeRefPair(0, 1), MemoryOrder::RELAXED);
+ const uint32_t strong_refs = GetStrongRefs(prev_ref_pair);
+ const uint32_t weak_refs = GetWeakRefs(prev_ref_pair);
+ if (trace_flag_ != nullptr && trace_flag_->enabled()) {
+ gpr_log(GPR_INFO, "%s:%p weak_ref %d -> %d; (refs=%d)",
+ trace_flag_->name(), this, weak_refs, weak_refs + 1, strong_refs);
+ }
+#else
+ refs_.FetchAdd(MakeRefPair(0, 1), MemoryOrder::RELAXED);
+#endif
+ }
+ void IncrementWeakRefCount(const DebugLocation& location,
+ const char* reason) {
+#ifndef NDEBUG
+ const uint64_t prev_ref_pair =
+ refs_.FetchAdd(MakeRefPair(0, 1), MemoryOrder::RELAXED);
+ const uint32_t strong_refs = GetStrongRefs(prev_ref_pair);
+ const uint32_t weak_refs = GetWeakRefs(prev_ref_pair);
+ if (trace_flag_ != nullptr && trace_flag_->enabled()) {
+ gpr_log(GPR_INFO, "%s:%p %s:%d weak_ref %d -> %d (refs=%d) %s",
+ trace_flag_->name(), this, location.file(), location.line(),
+ weak_refs, weak_refs + 1, strong_refs, reason);
+ }
+#else
+ // Use conditionally-important parameters
+ (void)location;
+ (void)reason;
+ refs_.FetchAdd(MakeRefPair(0, 1), MemoryOrder::RELAXED);
+#endif
+ }
+
+#ifndef NDEBUG
+ TraceFlag* trace_flag_;
+#endif
+ Atomic<uint64_t> refs_;
+};
+
+} // namespace grpc_core
+
+#endif /* GRPC_CORE_LIB_GPRPP_DUAL_REF_COUNTED_H */
diff --git a/contrib/libs/grpc/src/core/lib/gprpp/fork.cc b/contrib/libs/grpc/src/core/lib/gprpp/fork.cc
index cbee8298067..51d1c80e674 100644
--- a/contrib/libs/grpc/src/core/lib/gprpp/fork.cc
+++ b/contrib/libs/grpc/src/core/lib/gprpp/fork.cc
@@ -164,7 +164,7 @@ class ThreadState {
int count_;
};
-} // namespace internal
+} // namespace internal
void Fork::GlobalInit() {
if (!override_enabled_) {
diff --git a/contrib/libs/grpc/src/core/lib/gprpp/global_config_env.cc b/contrib/libs/grpc/src/core/lib/gprpp/global_config_env.cc
index f8f27b7bd02..72e3760661f 100644
--- a/contrib/libs/grpc/src/core/lib/gprpp/global_config_env.cc
+++ b/contrib/libs/grpc/src/core/lib/gprpp/global_config_env.cc
@@ -30,10 +30,10 @@
#include <ctype.h>
#include <string.h>
-#include <util/generic/string.h>
-
-#include "y_absl/strings/str_format.h"
-
+#include <util/generic/string.h>
+
+#include "y_absl/strings/str_format.h"
+
namespace grpc_core {
namespace {
@@ -46,10 +46,10 @@ GlobalConfigEnvErrorFunctionType g_global_config_env_error_func =
DefaultGlobalConfigEnvErrorFunction;
void LogParsingError(const char* name, const char* value) {
- TString error_message = y_absl::StrFormat(
- "Illegal value '%s' specified for environment variable '%s'", value,
- name);
- (*g_global_config_env_error_func)(error_message.c_str());
+ TString error_message = y_absl::StrFormat(
+ "Illegal value '%s' specified for environment variable '%s'", value,
+ name);
+ (*g_global_config_env_error_func)(error_message.c_str());
}
} // namespace
diff --git a/contrib/libs/grpc/src/core/lib/gprpp/host_port.cc b/contrib/libs/grpc/src/core/lib/gprpp/host_port.cc
index 9355a71abf2..e9db87f9384 100644
--- a/contrib/libs/grpc/src/core/lib/gprpp/host_port.cc
+++ b/contrib/libs/grpc/src/core/lib/gprpp/host_port.cc
@@ -20,36 +20,36 @@
#include "src/core/lib/gprpp/host_port.h"
-#include "y_absl/strings/str_format.h"
-#include "y_absl/strings/string_view.h"
+#include "y_absl/strings/str_format.h"
+#include "y_absl/strings/string_view.h"
#include <grpc/support/log.h>
-namespace grpc_core {
+namespace grpc_core {
-TString JoinHostPort(y_absl::string_view host, int port) {
- if (!host.empty() && host[0] != '[' && host.rfind(':') != host.npos) {
- // IPv6 literals must be enclosed in brackets.
- return y_absl::StrFormat("[%s]:%d", host, port);
+TString JoinHostPort(y_absl::string_view host, int port) {
+ if (!host.empty() && host[0] != '[' && host.rfind(':') != host.npos) {
+ // IPv6 literals must be enclosed in brackets.
+ return y_absl::StrFormat("[%s]:%d", host, port);
}
- // Ordinary non-bracketed host:port.
- return y_absl::StrFormat("%s:%d", host, port);
+ // Ordinary non-bracketed host:port.
+ return y_absl::StrFormat("%s:%d", host, port);
}
namespace {
-bool DoSplitHostPort(y_absl::string_view name, y_absl::string_view* host,
- y_absl::string_view* port, bool* has_port) {
+bool DoSplitHostPort(y_absl::string_view name, y_absl::string_view* host,
+ y_absl::string_view* port, bool* has_port) {
*has_port = false;
- if (!name.empty() && name[0] == '[') {
+ if (!name.empty() && name[0] == '[') {
/* Parse a bracketed host, typically an IPv6 literal. */
const size_t rbracket = name.find(']', 1);
- if (rbracket == y_absl::string_view::npos) {
+ if (rbracket == y_absl::string_view::npos) {
/* Unmatched [ */
return false;
}
if (rbracket == name.size() - 1) {
/* ]<end> */
- *port = y_absl::string_view();
+ *port = y_absl::string_view();
} else if (name[rbracket + 1] == ':') {
/* ]:<port?> */
*port = name.substr(rbracket + 2, name.size() - rbracket - 2);
@@ -59,16 +59,16 @@ bool DoSplitHostPort(y_absl::string_view name, y_absl::string_view* host,
return false;
}
*host = name.substr(1, rbracket - 1);
- if (host->find(':') == y_absl::string_view::npos) {
+ if (host->find(':') == y_absl::string_view::npos) {
/* Require all bracketed hosts to contain a colon, because a hostname or
IPv4 address should never use brackets. */
- *host = y_absl::string_view();
+ *host = y_absl::string_view();
return false;
}
} else {
size_t colon = name.find(':');
- if (colon != y_absl::string_view::npos &&
- name.find(':', colon + 1) == y_absl::string_view::npos) {
+ if (colon != y_absl::string_view::npos &&
+ name.find(':', colon + 1) == y_absl::string_view::npos) {
/* Exactly 1 colon. Split into host:port. */
*host = name.substr(0, colon);
*port = name.substr(colon + 1, name.size() - colon - 1);
@@ -76,37 +76,37 @@ bool DoSplitHostPort(y_absl::string_view name, y_absl::string_view* host,
} else {
/* 0 or 2+ colons. Bare hostname or IPv6 litearal. */
*host = name;
- *port = y_absl::string_view();
+ *port = y_absl::string_view();
}
}
return true;
}
} // namespace
-bool SplitHostPort(y_absl::string_view name, y_absl::string_view* host,
- y_absl::string_view* port) {
+bool SplitHostPort(y_absl::string_view name, y_absl::string_view* host,
+ y_absl::string_view* port) {
bool unused;
return DoSplitHostPort(name, host, port, &unused);
}
-bool SplitHostPort(y_absl::string_view name, TString* host,
- TString* port) {
- GPR_DEBUG_ASSERT(host != nullptr && host->empty());
- GPR_DEBUG_ASSERT(port != nullptr && port->empty());
- y_absl::string_view host_view;
- y_absl::string_view port_view;
+bool SplitHostPort(y_absl::string_view name, TString* host,
+ TString* port) {
+ GPR_DEBUG_ASSERT(host != nullptr && host->empty());
+ GPR_DEBUG_ASSERT(port != nullptr && port->empty());
+ y_absl::string_view host_view;
+ y_absl::string_view port_view;
bool has_port;
const bool ret = DoSplitHostPort(name, &host_view, &port_view, &has_port);
if (ret) {
// We always set the host, but port is set only when DoSplitHostPort find a
// port in the string, to remain backward compatible with the old
// gpr_split_host_port API.
- *host = TString(host_view);
+ *host = TString(host_view);
if (has_port) {
- *port = TString(port_view);
+ *port = TString(port_view);
}
}
return ret;
}
-
+
} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/lib/gprpp/host_port.h b/contrib/libs/grpc/src/core/lib/gprpp/host_port.h
index 3f42cc74824..4591b85817c 100644
--- a/contrib/libs/grpc/src/core/lib/gprpp/host_port.h
+++ b/contrib/libs/grpc/src/core/lib/gprpp/host_port.h
@@ -21,24 +21,24 @@
#include <grpc/support/port_platform.h>
-#include <util/generic/string.h>
+#include <util/generic/string.h>
+
+#include "y_absl/strings/string_view.h"
-#include "y_absl/strings/string_view.h"
-
namespace grpc_core {
-// Given a host and port, creates a newly-allocated string of the form
-// "host:port" or "[ho:st]:port", depending on whether the host contains colons
-// like an IPv6 literal. If the host is already bracketed, then additional
-// brackets will not be added.
-TString JoinHostPort(y_absl::string_view host, int port);
+// Given a host and port, creates a newly-allocated string of the form
+// "host:port" or "[ho:st]:port", depending on whether the host contains colons
+// like an IPv6 literal. If the host is already bracketed, then additional
+// brackets will not be added.
+TString JoinHostPort(y_absl::string_view host, int port);
/** Given a name in the form "host:port" or "[ho:st]:port", split into hostname
and port number.
There are two variants of this method:
- 1) y_absl::string_view output: port and host are returned as views on name.
- 2) TString output: port and host are copied into newly allocated strings.
+ 1) y_absl::string_view output: port and host are returned as views on name.
+ 2) TString output: port and host are copied into newly allocated strings.
Prefer variant (1) over (2), because no allocation or copy is performed in
variant (1). Use (2) only when interacting with C API that mandate
@@ -46,10 +46,10 @@ TString JoinHostPort(y_absl::string_view host, int port);
Return true on success, false on failure. Guarantees *host and *port are
cleared on failure. */
-bool SplitHostPort(y_absl::string_view name, y_absl::string_view* host,
- y_absl::string_view* port);
-bool SplitHostPort(y_absl::string_view name, TString* host,
- TString* port);
+bool SplitHostPort(y_absl::string_view name, y_absl::string_view* host,
+ y_absl::string_view* port);
+bool SplitHostPort(y_absl::string_view name, TString* host,
+ TString* port);
} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/lib/gprpp/map.h b/contrib/libs/grpc/src/core/lib/gprpp/map.h
index 08124843a3d..741b0b1ed52 100644
--- a/contrib/libs/grpc/src/core/lib/gprpp/map.h
+++ b/contrib/libs/grpc/src/core/lib/gprpp/map.h
@@ -25,10 +25,10 @@
#include <map>
-#include "y_absl/strings/string_view.h"
+#include "y_absl/strings/string_view.h"
+
+#include "src/core/lib/gprpp/memory.h"
-#include "src/core/lib/gprpp/memory.h"
-
namespace grpc_core {
struct StringLess {
@@ -39,8 +39,8 @@ struct StringLess {
const grpc_core::UniquePtr<char>& b) const {
return strcmp(a.get(), b.get()) < 0;
}
- bool operator()(const y_absl::string_view& a,
- const y_absl::string_view& b) const {
+ bool operator()(const y_absl::string_view& a,
+ const y_absl::string_view& b) const {
const size_t min_size = std::min(a.size(), b.size());
int c = strncmp(a.data(), b.data(), min_size);
if (c != 0) return c < 0;
diff --git a/contrib/libs/grpc/src/core/lib/gprpp/memory.h b/contrib/libs/grpc/src/core/lib/gprpp/memory.h
index d16cbb95884..becf273510f 100644
--- a/contrib/libs/grpc/src/core/lib/gprpp/memory.h
+++ b/contrib/libs/grpc/src/core/lib/gprpp/memory.h
@@ -28,8 +28,8 @@
#include <memory>
#include <utility>
-#include "y_absl/memory/memory.h"
-
+#include "y_absl/memory/memory.h"
+
namespace grpc_core {
class DefaultDeleteChar {
@@ -41,7 +41,7 @@ class DefaultDeleteChar {
};
// UniquePtr<T> is only allowed for char and UniquePtr<char> is deprecated
-// in favor of TString. UniquePtr<char> is equivalent std::unique_ptr
+// in favor of TString. UniquePtr<char> is equivalent std::unique_ptr
// except that it uses gpr_free for deleter.
template <typename T>
using UniquePtr = std::unique_ptr<T, DefaultDeleteChar>;
diff --git a/contrib/libs/grpc/src/core/lib/gprpp/ref_counted.h b/contrib/libs/grpc/src/core/lib/gprpp/ref_counted.h
index 10306648db6..d05ff6e44c4 100644
--- a/contrib/libs/grpc/src/core/lib/gprpp/ref_counted.h
+++ b/contrib/libs/grpc/src/core/lib/gprpp/ref_counted.h
@@ -204,46 +204,46 @@ class RefCount {
Atomic<Value> value_;
};
-// PolymorphicRefCount enforces polymorphic destruction of RefCounted.
-class PolymorphicRefCount {
- public:
- virtual ~PolymorphicRefCount() = default;
-};
-
-// NonPolymorphicRefCount does not enforce polymorphic destruction of
-// RefCounted. Please refer to grpc_core::RefCounted for more details, and
-// when in doubt use PolymorphicRefCount.
-class NonPolymorphicRefCount {
- public:
- ~NonPolymorphicRefCount() = default;
-};
-
-namespace internal {
-template <typename T, bool DoDelete>
-class Delete;
-template <typename T>
-class Delete<T, true> {
- public:
- Delete(T* t) { delete t; }
-};
-template <typename T>
-class Delete<T, false> {
- public:
- Delete(T* /*t*/) {}
-};
-} // namespace internal
-
+// PolymorphicRefCount enforces polymorphic destruction of RefCounted.
+class PolymorphicRefCount {
+ public:
+ virtual ~PolymorphicRefCount() = default;
+};
+
+// NonPolymorphicRefCount does not enforce polymorphic destruction of
+// RefCounted. Please refer to grpc_core::RefCounted for more details, and
+// when in doubt use PolymorphicRefCount.
+class NonPolymorphicRefCount {
+ public:
+ ~NonPolymorphicRefCount() = default;
+};
+
+namespace internal {
+template <typename T, bool DoDelete>
+class Delete;
+template <typename T>
+class Delete<T, true> {
+ public:
+ Delete(T* t) { delete t; }
+};
+template <typename T>
+class Delete<T, false> {
+ public:
+ Delete(T* /*t*/) {}
+};
+} // namespace internal
+
// A base class for reference-counted objects.
-// New objects should be created via new and start with a refcount of 1.
-// When the refcount reaches 0, the object will be deleted via delete.
+// New objects should be created via new and start with a refcount of 1.
+// When the refcount reaches 0, the object will be deleted via delete.
+//
+// If DeleteUponUnref is false, deletion will not occur when the ref
+// count reaches 0. This is useful in cases where all existing objects
+// must be tracked in a registry but the object's entry in the registry
+// cannot be removed from the object's dtor due to synchronization issues.
+// In this case, the registry can be cleaned up later by identifying
+// entries for which RefIfNonZero() returns null.
//
-// If DeleteUponUnref is false, deletion will not occur when the ref
-// count reaches 0. This is useful in cases where all existing objects
-// must be tracked in a registry but the object's entry in the registry
-// cannot be removed from the object's dtor due to synchronization issues.
-// In this case, the registry can be cleaned up later by identifying
-// entries for which RefIfNonZero() returns null.
-//
// This will commonly be used by CRTP (curiously-recurring template pattern)
// e.g., class MyClass : public RefCounted<MyClass>
//
@@ -266,8 +266,8 @@ class Delete<T, false> {
// Child* ch;
// ch->Unref();
//
-template <typename Child, typename Impl = PolymorphicRefCount,
- bool DeleteUponUnref = true>
+template <typename Child, typename Impl = PolymorphicRefCount,
+ bool DeleteUponUnref = true>
class RefCounted : public Impl {
public:
// Note: Depending on the Impl used, this dtor can be implicitly virtual.
@@ -290,25 +290,25 @@ class RefCounted : public Impl {
// friend of this class.
void Unref() {
if (GPR_UNLIKELY(refs_.Unref())) {
- internal::Delete<Child, DeleteUponUnref>(static_cast<Child*>(this));
+ internal::Delete<Child, DeleteUponUnref>(static_cast<Child*>(this));
}
}
void Unref(const DebugLocation& location, const char* reason) {
if (GPR_UNLIKELY(refs_.Unref(location, reason))) {
- internal::Delete<Child, DeleteUponUnref>(static_cast<Child*>(this));
+ internal::Delete<Child, DeleteUponUnref>(static_cast<Child*>(this));
}
}
- RefCountedPtr<Child> RefIfNonZero() GRPC_MUST_USE_RESULT {
- return RefCountedPtr<Child>(refs_.RefIfNonZero() ? static_cast<Child*>(this)
- : nullptr);
+ RefCountedPtr<Child> RefIfNonZero() GRPC_MUST_USE_RESULT {
+ return RefCountedPtr<Child>(refs_.RefIfNonZero() ? static_cast<Child*>(this)
+ : nullptr);
+ }
+ RefCountedPtr<Child> RefIfNonZero(const DebugLocation& location,
+ const char* reason) GRPC_MUST_USE_RESULT {
+ return RefCountedPtr<Child>(refs_.RefIfNonZero(location, reason)
+ ? static_cast<Child*>(this)
+ : nullptr);
}
- RefCountedPtr<Child> RefIfNonZero(const DebugLocation& location,
- const char* reason) GRPC_MUST_USE_RESULT {
- return RefCountedPtr<Child>(refs_.RefIfNonZero(location, reason)
- ? static_cast<Child*>(this)
- : nullptr);
- }
// Not copyable nor movable.
RefCounted(const RefCounted&) = delete;
diff --git a/contrib/libs/grpc/src/core/lib/gprpp/ref_counted_ptr.h b/contrib/libs/grpc/src/core/lib/gprpp/ref_counted_ptr.h
index f178d393b19..c28e7625323 100644
--- a/contrib/libs/grpc/src/core/lib/gprpp/ref_counted_ptr.h
+++ b/contrib/libs/grpc/src/core/lib/gprpp/ref_counted_ptr.h
@@ -177,169 +177,169 @@ class RefCountedPtr {
T* value_ = nullptr;
};
-// A smart pointer class for objects that provide IncrementWeakRefCount() and
-// WeakUnref() methods, such as those provided by the DualRefCounted base class.
-template <typename T>
-class WeakRefCountedPtr {
- public:
- WeakRefCountedPtr() {}
- WeakRefCountedPtr(std::nullptr_t) {}
-
- // If value is non-null, we take ownership of a ref to it.
- template <typename Y>
- explicit WeakRefCountedPtr(Y* value) {
- value_ = value;
- }
-
- // Move ctors.
- WeakRefCountedPtr(WeakRefCountedPtr&& other) {
- value_ = other.value_;
- other.value_ = nullptr;
- }
- template <typename Y>
- WeakRefCountedPtr(WeakRefCountedPtr<Y>&& other) {
- value_ = static_cast<T*>(other.value_);
- other.value_ = nullptr;
- }
-
- // Move assignment.
- WeakRefCountedPtr& operator=(WeakRefCountedPtr&& other) {
- reset(other.value_);
- other.value_ = nullptr;
- return *this;
- }
- template <typename Y>
- WeakRefCountedPtr& operator=(WeakRefCountedPtr<Y>&& other) {
- reset(other.value_);
- other.value_ = nullptr;
- return *this;
- }
-
- // Copy ctors.
- WeakRefCountedPtr(const WeakRefCountedPtr& other) {
- if (other.value_ != nullptr) other.value_->IncrementWeakRefCount();
- value_ = other.value_;
- }
- template <typename Y>
- WeakRefCountedPtr(const WeakRefCountedPtr<Y>& other) {
- static_assert(std::has_virtual_destructor<T>::value,
- "T does not have a virtual dtor");
- if (other.value_ != nullptr) other.value_->IncrementWeakRefCount();
- value_ = static_cast<T*>(other.value_);
- }
-
- // Copy assignment.
- WeakRefCountedPtr& operator=(const WeakRefCountedPtr& other) {
- // Note: Order of reffing and unreffing is important here in case value_
- // and other.value_ are the same object.
- if (other.value_ != nullptr) other.value_->IncrementWeakRefCount();
- reset(other.value_);
- return *this;
- }
- template <typename Y>
- WeakRefCountedPtr& operator=(const WeakRefCountedPtr<Y>& other) {
- static_assert(std::has_virtual_destructor<T>::value,
- "T does not have a virtual dtor");
- // Note: Order of reffing and unreffing is important here in case value_
- // and other.value_ are the same object.
- if (other.value_ != nullptr) other.value_->IncrementWeakRefCount();
- reset(other.value_);
- return *this;
- }
-
- ~WeakRefCountedPtr() {
- if (value_ != nullptr) value_->WeakUnref();
- }
-
- void swap(WeakRefCountedPtr& other) { std::swap(value_, other.value_); }
-
- // If value is non-null, we take ownership of a ref to it.
- void reset(T* value = nullptr) {
- if (value_ != nullptr) value_->WeakUnref();
- value_ = value;
- }
- void reset(const DebugLocation& location, const char* reason,
- T* value = nullptr) {
- if (value_ != nullptr) value_->WeakUnref(location, reason);
- value_ = value;
- }
- template <typename Y>
- void reset(Y* value = nullptr) {
- static_assert(std::has_virtual_destructor<T>::value,
- "T does not have a virtual dtor");
- if (value_ != nullptr) value_->WeakUnref();
- value_ = static_cast<T*>(value);
- }
- template <typename Y>
- void reset(const DebugLocation& location, const char* reason,
- Y* value = nullptr) {
- static_assert(std::has_virtual_destructor<T>::value,
- "T does not have a virtual dtor");
- if (value_ != nullptr) value_->WeakUnref(location, reason);
- value_ = static_cast<T*>(value);
- }
-
- // TODO(roth): This method exists solely as a transition mechanism to allow
- // us to pass a ref to idiomatic C code that does not use WeakRefCountedPtr<>.
- // Once all of our code has been converted to idiomatic C++, this
- // method should go away.
- T* release() {
- T* value = value_;
- value_ = nullptr;
- return value;
- }
-
- T* get() const { return value_; }
-
- T& operator*() const { return *value_; }
- T* operator->() const { return value_; }
-
- template <typename Y>
- bool operator==(const WeakRefCountedPtr<Y>& other) const {
- return value_ == other.value_;
- }
-
- template <typename Y>
- bool operator==(const Y* other) const {
- return value_ == other;
- }
-
- bool operator==(std::nullptr_t) const { return value_ == nullptr; }
-
- template <typename Y>
- bool operator!=(const WeakRefCountedPtr<Y>& other) const {
- return value_ != other.value_;
- }
-
- template <typename Y>
- bool operator!=(const Y* other) const {
- return value_ != other;
- }
-
- bool operator!=(std::nullptr_t) const { return value_ != nullptr; }
-
- private:
- template <typename Y>
- friend class WeakRefCountedPtr;
-
- T* value_ = nullptr;
-};
-
+// A smart pointer class for objects that provide IncrementWeakRefCount() and
+// WeakUnref() methods, such as those provided by the DualRefCounted base class.
+template <typename T>
+class WeakRefCountedPtr {
+ public:
+ WeakRefCountedPtr() {}
+ WeakRefCountedPtr(std::nullptr_t) {}
+
+ // If value is non-null, we take ownership of a ref to it.
+ template <typename Y>
+ explicit WeakRefCountedPtr(Y* value) {
+ value_ = value;
+ }
+
+ // Move ctors.
+ WeakRefCountedPtr(WeakRefCountedPtr&& other) {
+ value_ = other.value_;
+ other.value_ = nullptr;
+ }
+ template <typename Y>
+ WeakRefCountedPtr(WeakRefCountedPtr<Y>&& other) {
+ value_ = static_cast<T*>(other.value_);
+ other.value_ = nullptr;
+ }
+
+ // Move assignment.
+ WeakRefCountedPtr& operator=(WeakRefCountedPtr&& other) {
+ reset(other.value_);
+ other.value_ = nullptr;
+ return *this;
+ }
+ template <typename Y>
+ WeakRefCountedPtr& operator=(WeakRefCountedPtr<Y>&& other) {
+ reset(other.value_);
+ other.value_ = nullptr;
+ return *this;
+ }
+
+ // Copy ctors.
+ WeakRefCountedPtr(const WeakRefCountedPtr& other) {
+ if (other.value_ != nullptr) other.value_->IncrementWeakRefCount();
+ value_ = other.value_;
+ }
+ template <typename Y>
+ WeakRefCountedPtr(const WeakRefCountedPtr<Y>& other) {
+ static_assert(std::has_virtual_destructor<T>::value,
+ "T does not have a virtual dtor");
+ if (other.value_ != nullptr) other.value_->IncrementWeakRefCount();
+ value_ = static_cast<T*>(other.value_);
+ }
+
+ // Copy assignment.
+ WeakRefCountedPtr& operator=(const WeakRefCountedPtr& other) {
+ // Note: Order of reffing and unreffing is important here in case value_
+ // and other.value_ are the same object.
+ if (other.value_ != nullptr) other.value_->IncrementWeakRefCount();
+ reset(other.value_);
+ return *this;
+ }
+ template <typename Y>
+ WeakRefCountedPtr& operator=(const WeakRefCountedPtr<Y>& other) {
+ static_assert(std::has_virtual_destructor<T>::value,
+ "T does not have a virtual dtor");
+ // Note: Order of reffing and unreffing is important here in case value_
+ // and other.value_ are the same object.
+ if (other.value_ != nullptr) other.value_->IncrementWeakRefCount();
+ reset(other.value_);
+ return *this;
+ }
+
+ ~WeakRefCountedPtr() {
+ if (value_ != nullptr) value_->WeakUnref();
+ }
+
+ void swap(WeakRefCountedPtr& other) { std::swap(value_, other.value_); }
+
+ // If value is non-null, we take ownership of a ref to it.
+ void reset(T* value = nullptr) {
+ if (value_ != nullptr) value_->WeakUnref();
+ value_ = value;
+ }
+ void reset(const DebugLocation& location, const char* reason,
+ T* value = nullptr) {
+ if (value_ != nullptr) value_->WeakUnref(location, reason);
+ value_ = value;
+ }
+ template <typename Y>
+ void reset(Y* value = nullptr) {
+ static_assert(std::has_virtual_destructor<T>::value,
+ "T does not have a virtual dtor");
+ if (value_ != nullptr) value_->WeakUnref();
+ value_ = static_cast<T*>(value);
+ }
+ template <typename Y>
+ void reset(const DebugLocation& location, const char* reason,
+ Y* value = nullptr) {
+ static_assert(std::has_virtual_destructor<T>::value,
+ "T does not have a virtual dtor");
+ if (value_ != nullptr) value_->WeakUnref(location, reason);
+ value_ = static_cast<T*>(value);
+ }
+
+ // TODO(roth): This method exists solely as a transition mechanism to allow
+ // us to pass a ref to idiomatic C code that does not use WeakRefCountedPtr<>.
+ // Once all of our code has been converted to idiomatic C++, this
+ // method should go away.
+ T* release() {
+ T* value = value_;
+ value_ = nullptr;
+ return value;
+ }
+
+ T* get() const { return value_; }
+
+ T& operator*() const { return *value_; }
+ T* operator->() const { return value_; }
+
+ template <typename Y>
+ bool operator==(const WeakRefCountedPtr<Y>& other) const {
+ return value_ == other.value_;
+ }
+
+ template <typename Y>
+ bool operator==(const Y* other) const {
+ return value_ == other;
+ }
+
+ bool operator==(std::nullptr_t) const { return value_ == nullptr; }
+
+ template <typename Y>
+ bool operator!=(const WeakRefCountedPtr<Y>& other) const {
+ return value_ != other.value_;
+ }
+
+ template <typename Y>
+ bool operator!=(const Y* other) const {
+ return value_ != other;
+ }
+
+ bool operator!=(std::nullptr_t) const { return value_ != nullptr; }
+
+ private:
+ template <typename Y>
+ friend class WeakRefCountedPtr;
+
+ T* value_ = nullptr;
+};
+
template <typename T, typename... Args>
inline RefCountedPtr<T> MakeRefCounted(Args&&... args) {
return RefCountedPtr<T>(new T(std::forward<Args>(args)...));
}
-template <typename T>
-bool operator<(const RefCountedPtr<T>& p1, const RefCountedPtr<T>& p2) {
- return p1.get() < p2.get();
-}
-
-template <typename T>
-bool operator<(const WeakRefCountedPtr<T>& p1, const WeakRefCountedPtr<T>& p2) {
- return p1.get() < p2.get();
-}
-
+template <typename T>
+bool operator<(const RefCountedPtr<T>& p1, const RefCountedPtr<T>& p2) {
+ return p1.get() < p2.get();
+}
+
+template <typename T>
+bool operator<(const WeakRefCountedPtr<T>& p1, const WeakRefCountedPtr<T>& p2) {
+ return p1.get() < p2.get();
+}
+
} // namespace grpc_core
#endif /* GRPC_CORE_LIB_GPRPP_REF_COUNTED_PTR_H */
diff --git a/contrib/libs/grpc/src/core/lib/gprpp/sync.h b/contrib/libs/grpc/src/core/lib/gprpp/sync.h
index bca408a582d..0a911b1cd26 100644
--- a/contrib/libs/grpc/src/core/lib/gprpp/sync.h
+++ b/contrib/libs/grpc/src/core/lib/gprpp/sync.h
@@ -117,15 +117,15 @@ class CondVar {
}
}
- // Returns true iff we timed-out
- template <typename Predicate>
- bool WaitUntil(Mutex* mu, Predicate pred, const gpr_timespec& deadline) {
- while (!pred()) {
- if (Wait(mu, deadline)) return true;
- }
- return false;
- }
-
+ // Returns true iff we timed-out
+ template <typename Predicate>
+ bool WaitUntil(Mutex* mu, Predicate pred, const gpr_timespec& deadline) {
+ while (!pred()) {
+ if (Wait(mu, deadline)) return true;
+ }
+ return false;
+ }
+
private:
gpr_cv cv_;
};
diff --git a/contrib/libs/grpc/src/core/lib/http/format_request.cc b/contrib/libs/grpc/src/core/lib/http/format_request.cc
index 3dface847e1..d9294324bd0 100644
--- a/contrib/libs/grpc/src/core/lib/http/format_request.cc
+++ b/contrib/libs/grpc/src/core/lib/http/format_request.cc
@@ -24,80 +24,80 @@
#include <stdio.h>
#include <string.h>
-#include <vector>
-
-#include "y_absl/strings/str_format.h"
-#include "y_absl/strings/str_join.h"
-
+#include <vector>
+
+#include "y_absl/strings/str_format.h"
+#include "y_absl/strings/str_join.h"
+
#include <grpc/slice.h>
#include <grpc/support/alloc.h>
#include <grpc/support/string_util.h>
#include "src/core/lib/gpr/string.h"
static void fill_common_header(const grpc_httpcli_request* request,
- bool connection_close,
- std::vector<TString>* buf) {
- buf->push_back(request->http.path);
- buf->push_back(" HTTP/1.0\r\n");
+ bool connection_close,
+ std::vector<TString>* buf) {
+ buf->push_back(request->http.path);
+ buf->push_back(" HTTP/1.0\r\n");
/* just in case some crazy server really expects HTTP/1.1 */
- buf->push_back("Host: ");
- buf->push_back(request->host);
- buf->push_back("\r\n");
- if (connection_close) buf->push_back("Connection: close\r\n");
- buf->push_back("User-Agent: " GRPC_HTTPCLI_USER_AGENT "\r\n");
+ buf->push_back("Host: ");
+ buf->push_back(request->host);
+ buf->push_back("\r\n");
+ if (connection_close) buf->push_back("Connection: close\r\n");
+ buf->push_back("User-Agent: " GRPC_HTTPCLI_USER_AGENT "\r\n");
/* user supplied headers */
- for (size_t i = 0; i < request->http.hdr_count; i++) {
- buf->push_back(request->http.hdrs[i].key);
- buf->push_back(": ");
- buf->push_back(request->http.hdrs[i].value);
- buf->push_back("\r\n");
+ for (size_t i = 0; i < request->http.hdr_count; i++) {
+ buf->push_back(request->http.hdrs[i].key);
+ buf->push_back(": ");
+ buf->push_back(request->http.hdrs[i].value);
+ buf->push_back("\r\n");
}
}
grpc_slice grpc_httpcli_format_get_request(
const grpc_httpcli_request* request) {
- std::vector<TString> out;
- out.push_back("GET ");
- fill_common_header(request, true, &out);
- out.push_back("\r\n");
- TString req = y_absl::StrJoin(out, "");
- return grpc_slice_from_copied_buffer(req.data(), req.size());
+ std::vector<TString> out;
+ out.push_back("GET ");
+ fill_common_header(request, true, &out);
+ out.push_back("\r\n");
+ TString req = y_absl::StrJoin(out, "");
+ return grpc_slice_from_copied_buffer(req.data(), req.size());
}
grpc_slice grpc_httpcli_format_post_request(const grpc_httpcli_request* request,
const char* body_bytes,
size_t body_size) {
- std::vector<TString> out;
- out.push_back("POST ");
- fill_common_header(request, true, &out);
- if (body_bytes != nullptr) {
- bool has_content_type = false;
- for (size_t i = 0; i < request->http.hdr_count; i++) {
+ std::vector<TString> out;
+ out.push_back("POST ");
+ fill_common_header(request, true, &out);
+ if (body_bytes != nullptr) {
+ bool has_content_type = false;
+ for (size_t i = 0; i < request->http.hdr_count; i++) {
if (strcmp(request->http.hdrs[i].key, "Content-Type") == 0) {
- has_content_type = true;
+ has_content_type = true;
break;
}
}
if (!has_content_type) {
- out.push_back("Content-Type: text/plain\r\n");
+ out.push_back("Content-Type: text/plain\r\n");
}
- out.push_back(y_absl::StrFormat("Content-Length: %lu\r\n",
- static_cast<unsigned long>(body_size)));
+ out.push_back(y_absl::StrFormat("Content-Length: %lu\r\n",
+ static_cast<unsigned long>(body_size)));
}
- out.push_back("\r\n");
- TString req = y_absl::StrJoin(out, "");
- if (body_bytes != nullptr) {
- y_absl::StrAppend(&req, y_absl::string_view(body_bytes, body_size));
+ out.push_back("\r\n");
+ TString req = y_absl::StrJoin(out, "");
+ if (body_bytes != nullptr) {
+ y_absl::StrAppend(&req, y_absl::string_view(body_bytes, body_size));
}
- return grpc_slice_from_copied_buffer(req.data(), req.size());
+ return grpc_slice_from_copied_buffer(req.data(), req.size());
}
grpc_slice grpc_httpcli_format_connect_request(
const grpc_httpcli_request* request) {
- std::vector<TString> out;
- out.push_back("CONNECT ");
- fill_common_header(request, false, &out);
- out.push_back("\r\n");
- TString req = y_absl::StrJoin(out, "");
- return grpc_slice_from_copied_buffer(req.data(), req.size());
+ std::vector<TString> out;
+ out.push_back("CONNECT ");
+ fill_common_header(request, false, &out);
+ out.push_back("\r\n");
+ TString req = y_absl::StrJoin(out, "");
+ return grpc_slice_from_copied_buffer(req.data(), req.size());
}
diff --git a/contrib/libs/grpc/src/core/lib/http/httpcli.cc b/contrib/libs/grpc/src/core/lib/http/httpcli.cc
index f6741d52640..c196a8faac7 100644
--- a/contrib/libs/grpc/src/core/lib/http/httpcli.cc
+++ b/contrib/libs/grpc/src/core/lib/http/httpcli.cc
@@ -22,10 +22,10 @@
#include <string.h>
-#include <util/generic/string.h>
-
-#include "y_absl/strings/str_format.h"
-
+#include <util/generic/string.h>
+
+#include "y_absl/strings/str_format.h"
+
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
@@ -116,11 +116,11 @@ static void append_error(internal_request* req, grpc_error* error) {
GRPC_ERROR_CREATE_FROM_STATIC_STRING("Failed HTTP/1 client request");
}
grpc_resolved_address* addr = &req->addresses->addrs[req->next_address - 1];
- TString addr_text = grpc_sockaddr_to_uri(addr);
+ TString addr_text = grpc_sockaddr_to_uri(addr);
req->overall_error = grpc_error_add_child(
req->overall_error,
grpc_error_set_str(error, GRPC_ERROR_STR_TARGET_ADDRESS,
- grpc_slice_from_cpp_string(std::move(addr_text))));
+ grpc_slice_from_cpp_string(std::move(addr_text))));
}
static void do_read(internal_request* req) {
@@ -273,10 +273,10 @@ void grpc_httpcli_get(grpc_httpcli_context* context,
if (g_get_override && g_get_override(request, deadline, on_done, response)) {
return;
}
- TString name =
- y_absl::StrFormat("HTTP:GET:%s:%s", request->host, request->http.path);
+ TString name =
+ y_absl::StrFormat("HTTP:GET:%s:%s", request->host, request->http.path);
internal_request_begin(context, pollent, resource_quota, request, deadline,
- on_done, response, name.c_str(),
+ on_done, response, name.c_str(),
grpc_httpcli_format_get_request(request));
}
@@ -291,12 +291,12 @@ void grpc_httpcli_post(grpc_httpcli_context* context,
deadline, on_done, response)) {
return;
}
- TString name =
- y_absl::StrFormat("HTTP:POST:%s:%s", request->host, request->http.path);
+ TString name =
+ y_absl::StrFormat("HTTP:POST:%s:%s", request->host, request->http.path);
internal_request_begin(
context, pollent, resource_quota, request, deadline, on_done, response,
- name.c_str(),
- grpc_httpcli_format_post_request(request, body_bytes, body_size));
+ name.c_str(),
+ grpc_httpcli_format_post_request(request, body_bytes, body_size));
}
void grpc_httpcli_set_override(grpc_httpcli_get_override get,
diff --git a/contrib/libs/grpc/src/core/lib/http/httpcli_security_connector.cc b/contrib/libs/grpc/src/core/lib/http/httpcli_security_connector.cc
index c495619bc75..62643186ad0 100644
--- a/contrib/libs/grpc/src/core/lib/http/httpcli_security_connector.cc
+++ b/contrib/libs/grpc/src/core/lib/http/httpcli_security_connector.cc
@@ -22,9 +22,9 @@
#include <string.h>
-#include "y_absl/strings/str_cat.h"
-#include "y_absl/strings/string_view.h"
-
+#include "y_absl/strings/str_cat.h"
+#include "y_absl/strings/string_view.h"
+
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
@@ -96,10 +96,10 @@ class grpc_httpcli_ssl_channel_security_connector final
/* Check the peer name. */
if (secure_peer_name_ != nullptr &&
!tsi_ssl_peer_matches_name(&peer, secure_peer_name_)) {
- error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("Peer name ", secure_peer_name_,
- " is not in peer certificate")
- .c_str());
+ error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrCat("Peer name ", secure_peer_name_,
+ " is not in peer certificate")
+ .c_str());
}
grpc_core::ExecCtx::Run(DEBUG_LOCATION, on_peer_checked, error);
tsi_peer_destruct(&peer);
@@ -112,7 +112,7 @@ class grpc_httpcli_ssl_channel_security_connector final
return strcmp(secure_peer_name_, other->secure_peer_name_);
}
- bool check_call_host(y_absl::string_view /*host*/,
+ bool check_call_host(y_absl::string_view /*host*/,
grpc_auth_context* /*auth_context*/,
grpc_closure* /*on_call_host_checked*/,
grpc_error** error) override {
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/buffer_list.cc b/contrib/libs/grpc/src/core/lib/iomgr/buffer_list.cc
index a525815e17b..e1b87da4d0c 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/buffer_list.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/buffer_list.cc
@@ -66,27 +66,27 @@ void extract_opt_stats_from_tcp_info(ConnectionMetrics* metrics,
return;
}
if (info->length > offsetof(grpc_core::tcp_info, tcpi_sndbuf_limited)) {
- metrics->recurring_retrans.emplace(info->tcpi_retransmits);
- metrics->is_delivery_rate_app_limited.emplace(
+ metrics->recurring_retrans.emplace(info->tcpi_retransmits);
+ metrics->is_delivery_rate_app_limited.emplace(
info->tcpi_delivery_rate_app_limited);
- metrics->congestion_window.emplace(info->tcpi_snd_cwnd);
- metrics->reordering.emplace(info->tcpi_reordering);
- metrics->packet_retx.emplace(info->tcpi_total_retrans);
- metrics->pacing_rate.emplace(info->tcpi_pacing_rate);
- metrics->data_notsent.emplace(info->tcpi_notsent_bytes);
+ metrics->congestion_window.emplace(info->tcpi_snd_cwnd);
+ metrics->reordering.emplace(info->tcpi_reordering);
+ metrics->packet_retx.emplace(info->tcpi_total_retrans);
+ metrics->pacing_rate.emplace(info->tcpi_pacing_rate);
+ metrics->data_notsent.emplace(info->tcpi_notsent_bytes);
if (info->tcpi_min_rtt != UINT32_MAX) {
- metrics->min_rtt.emplace(info->tcpi_min_rtt);
+ metrics->min_rtt.emplace(info->tcpi_min_rtt);
}
- metrics->packet_sent.emplace(info->tcpi_data_segs_out);
- metrics->delivery_rate.emplace(info->tcpi_delivery_rate);
- metrics->busy_usec.emplace(info->tcpi_busy_time);
- metrics->rwnd_limited_usec.emplace(info->tcpi_rwnd_limited);
- metrics->sndbuf_limited_usec.emplace(info->tcpi_sndbuf_limited);
+ metrics->packet_sent.emplace(info->tcpi_data_segs_out);
+ metrics->delivery_rate.emplace(info->tcpi_delivery_rate);
+ metrics->busy_usec.emplace(info->tcpi_busy_time);
+ metrics->rwnd_limited_usec.emplace(info->tcpi_rwnd_limited);
+ metrics->sndbuf_limited_usec.emplace(info->tcpi_sndbuf_limited);
}
if (info->length > offsetof(grpc_core::tcp_info, tcpi_dsack_dups)) {
- metrics->data_sent.emplace(info->tcpi_bytes_sent);
- metrics->data_retx.emplace(info->tcpi_bytes_retrans);
- metrics->packet_spurious_retx.emplace(info->tcpi_dsack_dups);
+ metrics->data_sent.emplace(info->tcpi_bytes_sent);
+ metrics->data_retx.emplace(info->tcpi_bytes_retrans);
+ metrics->packet_spurious_retx.emplace(info->tcpi_dsack_dups);
}
}
@@ -107,80 +107,80 @@ void extract_opt_stats_from_cmsg(ConnectionMetrics* metrics,
const void* val = data + offset + NLA_HDRLEN;
switch (attr->nla_type) {
case TCP_NLA_BUSY: {
- metrics->busy_usec.emplace(read_unaligned<uint64_t>(val));
+ metrics->busy_usec.emplace(read_unaligned<uint64_t>(val));
break;
}
case TCP_NLA_RWND_LIMITED: {
- metrics->rwnd_limited_usec.emplace(read_unaligned<uint64_t>(val));
+ metrics->rwnd_limited_usec.emplace(read_unaligned<uint64_t>(val));
break;
}
case TCP_NLA_SNDBUF_LIMITED: {
- metrics->sndbuf_limited_usec.emplace(read_unaligned<uint64_t>(val));
+ metrics->sndbuf_limited_usec.emplace(read_unaligned<uint64_t>(val));
break;
}
case TCP_NLA_PACING_RATE: {
- metrics->pacing_rate.emplace(read_unaligned<uint64_t>(val));
+ metrics->pacing_rate.emplace(read_unaligned<uint64_t>(val));
break;
}
case TCP_NLA_DELIVERY_RATE: {
- metrics->delivery_rate.emplace(read_unaligned<uint64_t>(val));
+ metrics->delivery_rate.emplace(read_unaligned<uint64_t>(val));
break;
}
case TCP_NLA_DELIVERY_RATE_APP_LMT: {
- metrics->is_delivery_rate_app_limited.emplace(
- read_unaligned<uint8_t>(val));
+ metrics->is_delivery_rate_app_limited.emplace(
+ read_unaligned<uint8_t>(val));
break;
}
case TCP_NLA_SND_CWND: {
- metrics->congestion_window.emplace(read_unaligned<uint32_t>(val));
+ metrics->congestion_window.emplace(read_unaligned<uint32_t>(val));
break;
}
case TCP_NLA_MIN_RTT: {
- metrics->min_rtt.emplace(read_unaligned<uint32_t>(val));
+ metrics->min_rtt.emplace(read_unaligned<uint32_t>(val));
break;
}
case TCP_NLA_SRTT: {
- metrics->srtt.emplace(read_unaligned<uint32_t>(val));
+ metrics->srtt.emplace(read_unaligned<uint32_t>(val));
break;
}
case TCP_NLA_RECUR_RETRANS: {
- metrics->recurring_retrans.emplace(read_unaligned<uint8_t>(val));
+ metrics->recurring_retrans.emplace(read_unaligned<uint8_t>(val));
break;
}
case TCP_NLA_BYTES_SENT: {
- metrics->data_sent.emplace(read_unaligned<uint64_t>(val));
+ metrics->data_sent.emplace(read_unaligned<uint64_t>(val));
break;
}
case TCP_NLA_DATA_SEGS_OUT: {
- metrics->packet_sent.emplace(read_unaligned<uint64_t>(val));
+ metrics->packet_sent.emplace(read_unaligned<uint64_t>(val));
break;
}
case TCP_NLA_TOTAL_RETRANS: {
- metrics->packet_retx.emplace(read_unaligned<uint64_t>(val));
+ metrics->packet_retx.emplace(read_unaligned<uint64_t>(val));
break;
}
case TCP_NLA_DELIVERED: {
- metrics->packet_delivered.emplace(read_unaligned<uint32_t>(val));
+ metrics->packet_delivered.emplace(read_unaligned<uint32_t>(val));
break;
}
case TCP_NLA_DELIVERED_CE: {
- metrics->packet_delivered_ce.emplace(read_unaligned<uint32_t>(val));
+ metrics->packet_delivered_ce.emplace(read_unaligned<uint32_t>(val));
break;
}
case TCP_NLA_BYTES_RETRANS: {
- metrics->data_retx.emplace(read_unaligned<uint64_t>(val));
+ metrics->data_retx.emplace(read_unaligned<uint64_t>(val));
break;
}
case TCP_NLA_DSACK_DUPS: {
- metrics->packet_spurious_retx.emplace(read_unaligned<uint32_t>(val));
+ metrics->packet_spurious_retx.emplace(read_unaligned<uint32_t>(val));
break;
}
case TCP_NLA_REORDERING: {
- metrics->reordering.emplace(read_unaligned<uint32_t>(val));
+ metrics->reordering.emplace(read_unaligned<uint32_t>(val));
break;
}
case TCP_NLA_SND_SSTHRESH: {
- metrics->snd_ssthresh.emplace(read_unaligned<uint32_t>(val));
+ metrics->snd_ssthresh.emplace(read_unaligned<uint32_t>(val));
break;
}
}
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/buffer_list.h b/contrib/libs/grpc/src/core/lib/iomgr/buffer_list.h
index e38bd1dcdeb..54a2dc748fb 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/buffer_list.h
+++ b/contrib/libs/grpc/src/core/lib/iomgr/buffer_list.h
@@ -21,8 +21,8 @@
#include <grpc/support/port_platform.h>
-#include "y_absl/types/optional.h"
-
+#include "y_absl/types/optional.h"
+
#include "src/core/lib/iomgr/port.h"
#include <grpc/support/time.h>
@@ -35,52 +35,52 @@ namespace grpc_core {
struct ConnectionMetrics {
/* Delivery rate in Bytes/s. */
- y_absl::optional<uint64_t> delivery_rate;
+ y_absl::optional<uint64_t> delivery_rate;
/* If the delivery rate is limited by the application, this is set to true. */
- y_absl::optional<bool> is_delivery_rate_app_limited;
+ y_absl::optional<bool> is_delivery_rate_app_limited;
/* Total packets retransmitted. */
- y_absl::optional<uint32_t> packet_retx;
+ y_absl::optional<uint32_t> packet_retx;
/* Total packets retransmitted spuriously. This metric is smaller than or
equal to packet_retx. */
- y_absl::optional<uint32_t> packet_spurious_retx;
+ y_absl::optional<uint32_t> packet_spurious_retx;
/* Total packets sent. */
- y_absl::optional<uint32_t> packet_sent;
+ y_absl::optional<uint32_t> packet_sent;
/* Total packets delivered. */
- y_absl::optional<uint32_t> packet_delivered;
+ y_absl::optional<uint32_t> packet_delivered;
/* Total packets delivered with ECE marked. This metric is smaller than or
equal to packet_delivered. */
- y_absl::optional<uint32_t> packet_delivered_ce;
+ y_absl::optional<uint32_t> packet_delivered_ce;
/* Total bytes lost so far. */
- y_absl::optional<uint64_t> data_retx;
+ y_absl::optional<uint64_t> data_retx;
/* Total bytes sent so far. */
- y_absl::optional<uint64_t> data_sent;
+ y_absl::optional<uint64_t> data_sent;
/* Total bytes in write queue but not sent. */
- y_absl::optional<uint64_t> data_notsent;
+ y_absl::optional<uint64_t> data_notsent;
/* Pacing rate of the connection in Bps */
- y_absl::optional<uint64_t> pacing_rate;
+ y_absl::optional<uint64_t> pacing_rate;
/* Minimum RTT observed in usec. */
- y_absl::optional<uint32_t> min_rtt;
+ y_absl::optional<uint32_t> min_rtt;
/* Smoothed RTT in usec */
- y_absl::optional<uint32_t> srtt;
+ y_absl::optional<uint32_t> srtt;
/* Send congestion window. */
- y_absl::optional<uint32_t> congestion_window;
+ y_absl::optional<uint32_t> congestion_window;
/* Slow start threshold in packets. */
- y_absl::optional<uint32_t> snd_ssthresh;
+ y_absl::optional<uint32_t> snd_ssthresh;
/* Maximum degree of reordering (i.e., maximum number of packets reodered)
on the connection. */
- y_absl::optional<uint32_t> reordering;
+ y_absl::optional<uint32_t> reordering;
/* Represents the number of recurring retransmissions of the first sequence
that is not acknowledged yet. */
- y_absl::optional<uint8_t> recurring_retrans;
+ y_absl::optional<uint8_t> recurring_retrans;
/* The cumulative time (in usec) that the transport protocol was busy
sending data. */
- y_absl::optional<uint64_t> busy_usec;
+ y_absl::optional<uint64_t> busy_usec;
/* The cumulative time (in usec) that the transport protocol was limited by
the receive window size. */
- y_absl::optional<uint64_t> rwnd_limited_usec;
+ y_absl::optional<uint64_t> rwnd_limited_usec;
/* The cumulative time (in usec) that the transport protocol was limited by
the send buffer size. */
- y_absl::optional<uint64_t> sndbuf_limited_usec;
+ y_absl::optional<uint64_t> sndbuf_limited_usec;
};
struct Timestamp {
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/call_combiner.h b/contrib/libs/grpc/src/core/lib/iomgr/call_combiner.h
index ffe79b3534f..aed847c9728 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/call_combiner.h
+++ b/contrib/libs/grpc/src/core/lib/iomgr/call_combiner.h
@@ -23,8 +23,8 @@
#include <stddef.h>
-#include "y_absl/container/inlined_vector.h"
-
+#include "y_absl/container/inlined_vector.h"
+
#include <grpc/support/atm.h>
#include "src/core/lib/gprpp/mpscq.h"
@@ -209,7 +209,7 @@ class CallCombinerClosureList {
// There are generally a maximum of 6 closures to run in the call
// combiner, one for each pending op.
- y_absl::InlinedVector<CallCombinerClosure, 6> closures_;
+ y_absl::InlinedVector<CallCombinerClosure, 6> closures_;
};
} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/cfstream_handle.cc b/contrib/libs/grpc/src/core/lib/iomgr/cfstream_handle.cc
index e8ff3a54d05..46914e5175a 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/cfstream_handle.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/cfstream_handle.cc
@@ -32,7 +32,7 @@
#include "src/core/lib/debug/trace.h"
#include "src/core/lib/iomgr/closure.h"
#include "src/core/lib/iomgr/error_cfstream.h"
-#include "src/core/lib/iomgr/ev_apple.h"
+#include "src/core/lib/iomgr/ev_apple.h"
#include "src/core/lib/iomgr/exec_ctx.h"
extern grpc_core::TraceFlag grpc_tcp_trace;
@@ -148,15 +148,15 @@ CFStreamHandle::CFStreamHandle(CFReadStreamRef read_stream,
kCFStreamEventOpenCompleted | kCFStreamEventCanAcceptBytes |
kCFStreamEventErrorOccurred | kCFStreamEventEndEncountered,
CFStreamHandle::WriteCallback, &ctx);
- grpc_apple_register_read_stream(read_stream, dispatch_queue_);
- grpc_apple_register_write_stream(write_stream, dispatch_queue_);
+ grpc_apple_register_read_stream(read_stream, dispatch_queue_);
+ grpc_apple_register_write_stream(write_stream, dispatch_queue_);
}
CFStreamHandle::~CFStreamHandle() {
open_event_.DestroyEvent();
read_event_.DestroyEvent();
write_event_.DestroyEvent();
- dispatch_release(dispatch_queue_);
+ dispatch_release(dispatch_queue_);
}
void CFStreamHandle::NotifyOnOpen(grpc_closure* closure) {
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/dualstack_socket_posix.cc b/contrib/libs/grpc/src/core/lib/iomgr/dualstack_socket_posix.cc
index 2d58d97799a..dc0eafebf98 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/dualstack_socket_posix.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/dualstack_socket_posix.cc
@@ -1,47 +1,47 @@
-/*
- *
- * Copyright 2020 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <grpc/support/port_platform.h>
-
-#include "src/core/lib/iomgr/port.h"
-
-#ifdef GRPC_POSIX_SOCKET_UTILS_COMMON
-
-#include <netinet/in.h>
-#include "src/core/lib/iomgr/socket_utils_posix.h"
-
-#ifndef GRPC_SET_SOCKET_DUALSTACK_CUSTOM
-
-/* This should be 0 in production, but it may be enabled for testing or
- debugging purposes, to simulate an environment where IPv6 sockets can't
- also speak IPv4. */
-int grpc_forbid_dualstack_sockets_for_testing = 0;
-
-int grpc_set_socket_dualstack(int fd) {
- if (!grpc_forbid_dualstack_sockets_for_testing) {
- const int off = 0;
- return 0 == setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, &off, sizeof(off));
- } else {
- /* Force an IPv6-only socket, for testing purposes. */
- const int on = 1;
- setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, &on, sizeof(on));
- return 0;
- }
-}
-#endif // GRPC_SET_SOCKET_DUALSTACK_CUSTOM
-#endif // GRPC_POSIX_SOCKET_UTILS_COMMON
+/*
+ *
+ * Copyright 2020 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/lib/iomgr/port.h"
+
+#ifdef GRPC_POSIX_SOCKET_UTILS_COMMON
+
+#include <netinet/in.h>
+#include "src/core/lib/iomgr/socket_utils_posix.h"
+
+#ifndef GRPC_SET_SOCKET_DUALSTACK_CUSTOM
+
+/* This should be 0 in production, but it may be enabled for testing or
+ debugging purposes, to simulate an environment where IPv6 sockets can't
+ also speak IPv4. */
+int grpc_forbid_dualstack_sockets_for_testing = 0;
+
+int grpc_set_socket_dualstack(int fd) {
+ if (!grpc_forbid_dualstack_sockets_for_testing) {
+ const int off = 0;
+ return 0 == setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, &off, sizeof(off));
+ } else {
+ /* Force an IPv6-only socket, for testing purposes. */
+ const int on = 1;
+ setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, &on, sizeof(on));
+ return 0;
+ }
+}
+#endif // GRPC_SET_SOCKET_DUALSTACK_CUSTOM
+#endif // GRPC_POSIX_SOCKET_UTILS_COMMON
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/endpoint.cc b/contrib/libs/grpc/src/core/lib/iomgr/endpoint.cc
index 5a5d2620ad4..37e04001022 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/endpoint.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/endpoint.cc
@@ -52,14 +52,14 @@ void grpc_endpoint_shutdown(grpc_endpoint* ep, grpc_error* why) {
void grpc_endpoint_destroy(grpc_endpoint* ep) { ep->vtable->destroy(ep); }
-y_absl::string_view grpc_endpoint_get_peer(grpc_endpoint* ep) {
+y_absl::string_view grpc_endpoint_get_peer(grpc_endpoint* ep) {
return ep->vtable->get_peer(ep);
}
-y_absl::string_view grpc_endpoint_get_local_address(grpc_endpoint* ep) {
- return ep->vtable->get_local_address(ep);
-}
-
+y_absl::string_view grpc_endpoint_get_local_address(grpc_endpoint* ep) {
+ return ep->vtable->get_local_address(ep);
+}
+
int grpc_endpoint_get_fd(grpc_endpoint* ep) { return ep->vtable->get_fd(ep); }
grpc_resource_user* grpc_endpoint_get_resource_user(grpc_endpoint* ep) {
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/endpoint.h b/contrib/libs/grpc/src/core/lib/iomgr/endpoint.h
index 15b2107fa9f..e704c3be49d 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/endpoint.h
+++ b/contrib/libs/grpc/src/core/lib/iomgr/endpoint.h
@@ -21,8 +21,8 @@
#include <grpc/support/port_platform.h>
-#include "y_absl/strings/string_view.h"
-
+#include "y_absl/strings/string_view.h"
+
#include <grpc/slice.h>
#include <grpc/slice_buffer.h>
#include <grpc/support/time.h>
@@ -47,8 +47,8 @@ struct grpc_endpoint_vtable {
void (*shutdown)(grpc_endpoint* ep, grpc_error* why);
void (*destroy)(grpc_endpoint* ep);
grpc_resource_user* (*get_resource_user)(grpc_endpoint* ep);
- y_absl::string_view (*get_peer)(grpc_endpoint* ep);
- y_absl::string_view (*get_local_address)(grpc_endpoint* ep);
+ y_absl::string_view (*get_peer)(grpc_endpoint* ep);
+ y_absl::string_view (*get_local_address)(grpc_endpoint* ep);
int (*get_fd)(grpc_endpoint* ep);
bool (*can_track_err)(grpc_endpoint* ep);
};
@@ -61,10 +61,10 @@ struct grpc_endpoint_vtable {
void grpc_endpoint_read(grpc_endpoint* ep, grpc_slice_buffer* slices,
grpc_closure* cb, bool urgent);
-y_absl::string_view grpc_endpoint_get_peer(grpc_endpoint* ep);
+y_absl::string_view grpc_endpoint_get_peer(grpc_endpoint* ep);
+
+y_absl::string_view grpc_endpoint_get_local_address(grpc_endpoint* ep);
-y_absl::string_view grpc_endpoint_get_local_address(grpc_endpoint* ep);
-
/* Get the file descriptor used by \a ep. Return -1 if \a ep is not using an fd.
*/
int grpc_endpoint_get_fd(grpc_endpoint* ep);
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/endpoint_cfstream.cc b/contrib/libs/grpc/src/core/lib/iomgr/endpoint_cfstream.cc
index aac574c60aa..d3a9c9b2002 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/endpoint_cfstream.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/endpoint_cfstream.cc
@@ -34,8 +34,8 @@
#include "src/core/lib/iomgr/closure.h"
#include "src/core/lib/iomgr/endpoint.h"
#include "src/core/lib/iomgr/error_cfstream.h"
-#include "src/core/lib/iomgr/sockaddr.h"
-#include "src/core/lib/iomgr/sockaddr_utils.h"
+#include "src/core/lib/iomgr/sockaddr.h"
+#include "src/core/lib/iomgr/sockaddr_utils.h"
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/slice/slice_string_helpers.h"
@@ -57,8 +57,8 @@ struct CFStreamEndpoint {
grpc_closure read_action;
grpc_closure write_action;
- TString peer_string;
- TString local_address;
+ TString peer_string;
+ TString local_address;
grpc_resource_user* resource_user;
grpc_resource_user_slice_allocator slice_allocator;
};
@@ -67,7 +67,7 @@ static void CFStreamFree(CFStreamEndpoint* ep) {
CFRelease(ep->read_stream);
CFRelease(ep->write_stream);
CFSTREAM_HANDLE_UNREF(ep->stream_sync, "free");
- delete ep;
+ delete ep;
}
#ifndef NDEBUG
@@ -112,7 +112,7 @@ static grpc_error* CFStreamAnnotateError(grpc_error* src_error,
grpc_error_set_int(src_error, GRPC_ERROR_INT_GRPC_STATUS,
GRPC_STATUS_UNAVAILABLE),
GRPC_ERROR_STR_TARGET_ADDRESS,
- grpc_slice_from_copied_string(ep->peer_string.c_str()));
+ grpc_slice_from_copied_string(ep->peer_string.c_str()));
}
static void CallReadCb(CFStreamEndpoint* ep, grpc_error* error) {
@@ -126,8 +126,8 @@ static void CallReadCb(CFStreamEndpoint* ep, grpc_error* error) {
for (i = 0; i < ep->read_slices->count; i++) {
char* dump = grpc_dump_slice(ep->read_slices->slices[i],
GPR_DUMP_HEX | GPR_DUMP_ASCII);
- gpr_log(GPR_DEBUG, "READ %p (peer=%s): %s", ep, ep->peer_string.c_str(),
- dump);
+ gpr_log(GPR_DEBUG, "READ %p (peer=%s): %s", ep, ep->peer_string.c_str(),
+ dump);
gpr_free(dump);
}
}
@@ -233,8 +233,8 @@ static void WriteAction(void* arg, grpc_error* error) {
if (grpc_tcp_trace.enabled()) {
grpc_slice trace_slice = grpc_slice_sub(slice, 0, write_size);
char* dump = grpc_dump_slice(trace_slice, GPR_DUMP_HEX | GPR_DUMP_ASCII);
- gpr_log(GPR_DEBUG, "WRITE %p (peer=%s): %s", ep, ep->peer_string.c_str(),
- dump);
+ gpr_log(GPR_DEBUG, "WRITE %p (peer=%s): %s", ep, ep->peer_string.c_str(),
+ dump);
gpr_free(dump);
grpc_slice_unref_internal(trace_slice);
}
@@ -313,16 +313,16 @@ grpc_resource_user* CFStreamGetResourceUser(grpc_endpoint* ep) {
return ep_impl->resource_user;
}
-y_absl::string_view CFStreamGetPeer(grpc_endpoint* ep) {
+y_absl::string_view CFStreamGetPeer(grpc_endpoint* ep) {
CFStreamEndpoint* ep_impl = reinterpret_cast<CFStreamEndpoint*>(ep);
- return ep_impl->peer_string;
+ return ep_impl->peer_string;
+}
+
+y_absl::string_view CFStreamGetLocalAddress(grpc_endpoint* ep) {
+ CFStreamEndpoint* ep_impl = reinterpret_cast<CFStreamEndpoint*>(ep);
+ return ep_impl->local_address;
}
-y_absl::string_view CFStreamGetLocalAddress(grpc_endpoint* ep) {
- CFStreamEndpoint* ep_impl = reinterpret_cast<CFStreamEndpoint*>(ep);
- return ep_impl->local_address;
-}
-
int CFStreamGetFD(grpc_endpoint* ep) { return 0; }
bool CFStreamCanTrackErr(grpc_endpoint* ep) { return false; }
@@ -341,7 +341,7 @@ static const grpc_endpoint_vtable vtable = {CFStreamRead,
CFStreamDestroy,
CFStreamGetResourceUser,
CFStreamGetPeer,
- CFStreamGetLocalAddress,
+ CFStreamGetLocalAddress,
CFStreamGetFD,
CFStreamCanTrackErr};
@@ -349,7 +349,7 @@ grpc_endpoint* grpc_cfstream_endpoint_create(
CFReadStreamRef read_stream, CFWriteStreamRef write_stream,
const char* peer_string, grpc_resource_quota* resource_quota,
CFStreamHandle* stream_sync) {
- CFStreamEndpoint* ep_impl = new CFStreamEndpoint;
+ CFStreamEndpoint* ep_impl = new CFStreamEndpoint;
if (grpc_tcp_trace.enabled()) {
gpr_log(GPR_DEBUG,
"CFStream endpoint:%p create readStream:%p writeStream: %p",
@@ -364,23 +364,23 @@ grpc_endpoint* grpc_cfstream_endpoint_create(
ep_impl->stream_sync = stream_sync;
CFSTREAM_HANDLE_REF(ep_impl->stream_sync, "endpoint create");
- ep_impl->peer_string = peer_string;
- grpc_resolved_address resolved_local_addr;
- resolved_local_addr.len = sizeof(resolved_local_addr.addr);
- CFDataRef native_handle = static_cast<CFDataRef>(CFReadStreamCopyProperty(
- ep_impl->read_stream, kCFStreamPropertySocketNativeHandle));
- CFSocketNativeHandle sockfd;
- CFDataGetBytes(native_handle, CFRangeMake(0, sizeof(CFSocketNativeHandle)),
- (UInt8*)&sockfd);
- if (native_handle) {
- CFRelease(native_handle);
- }
- if (getsockname(sockfd, reinterpret_cast<sockaddr*>(resolved_local_addr.addr),
- &resolved_local_addr.len) < 0) {
- ep_impl->local_address = "";
- } else {
- ep_impl->local_address = grpc_sockaddr_to_uri(&resolved_local_addr);
- }
+ ep_impl->peer_string = peer_string;
+ grpc_resolved_address resolved_local_addr;
+ resolved_local_addr.len = sizeof(resolved_local_addr.addr);
+ CFDataRef native_handle = static_cast<CFDataRef>(CFReadStreamCopyProperty(
+ ep_impl->read_stream, kCFStreamPropertySocketNativeHandle));
+ CFSocketNativeHandle sockfd;
+ CFDataGetBytes(native_handle, CFRangeMake(0, sizeof(CFSocketNativeHandle)),
+ (UInt8*)&sockfd);
+ if (native_handle) {
+ CFRelease(native_handle);
+ }
+ if (getsockname(sockfd, reinterpret_cast<sockaddr*>(resolved_local_addr.addr),
+ &resolved_local_addr.len) < 0) {
+ ep_impl->local_address = "";
+ } else {
+ ep_impl->local_address = grpc_sockaddr_to_uri(&resolved_local_addr);
+ }
ep_impl->read_cb = nil;
ep_impl->write_cb = nil;
ep_impl->read_slices = nil;
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/endpoint_pair_posix.cc b/contrib/libs/grpc/src/core/lib/iomgr/endpoint_pair_posix.cc
index ad4d0fda1ca..7f95da7365f 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/endpoint_pair_posix.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/endpoint_pair_posix.cc
@@ -32,10 +32,10 @@
#include <sys/socket.h>
#include <sys/types.h>
-#include <util/generic/string.h>
-
-#include "y_absl/strings/str_cat.h"
-
+#include <util/generic/string.h>
+
+#include "y_absl/strings/str_cat.h"
+
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include "src/core/lib/gpr/string.h"
@@ -60,12 +60,12 @@ grpc_endpoint_pair grpc_iomgr_create_endpoint_pair(const char* name,
grpc_core::ExecCtx exec_ctx;
- TString final_name = y_absl::StrCat(name, ":client");
- p.client = grpc_tcp_create(grpc_fd_create(sv[1], final_name.c_str(), false),
- args, "socketpair-server");
- final_name = y_absl::StrCat(name, ":server");
- p.server = grpc_tcp_create(grpc_fd_create(sv[0], final_name.c_str(), false),
- args, "socketpair-client");
+ TString final_name = y_absl::StrCat(name, ":client");
+ p.client = grpc_tcp_create(grpc_fd_create(sv[1], final_name.c_str(), false),
+ args, "socketpair-server");
+ final_name = y_absl::StrCat(name, ":server");
+ p.server = grpc_tcp_create(grpc_fd_create(sv[0], final_name.c_str(), false),
+ args, "socketpair-client");
return p;
}
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/error.h b/contrib/libs/grpc/src/core/lib/iomgr/error.h
index a1075d36a1c..ac3ff876289 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/error.h
+++ b/contrib/libs/grpc/src/core/lib/iomgr/error.h
@@ -200,10 +200,10 @@ inline void grpc_error_unref(grpc_error* err) {
// Consumes all the errors in the vector and forms a referencing error from
// them. If the vector is empty, return GRPC_ERROR_NONE.
-template <typename VectorType>
-static grpc_error* grpc_error_create_from_vector(const char* file, int line,
- const char* desc,
- VectorType* error_list) {
+template <typename VectorType>
+static grpc_error* grpc_error_create_from_vector(const char* file, int line,
+ const char* desc,
+ VectorType* error_list) {
grpc_error* error = GRPC_ERROR_NONE;
if (error_list->size() != 0) {
error = grpc_error_create(file, line, grpc_slice_from_static_string(desc),
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/error_cfstream.cc b/contrib/libs/grpc/src/core/lib/iomgr/error_cfstream.cc
index 6c6e89fc9e6..62f6bc1d407 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/error_cfstream.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/error_cfstream.cc
@@ -19,10 +19,10 @@
#include <grpc/support/port_platform.h>
#ifdef GRPC_CFSTREAM
-#include <util/generic/string.h>
-
-#include "y_absl/strings/str_format.h"
-
+#include <util/generic/string.h>
+
+#include "y_absl/strings/str_format.h"
+
#include <CoreFoundation/CoreFoundation.h>
#include <grpc/support/alloc.h>
@@ -43,11 +43,11 @@ grpc_error* grpc_error_create_from_cferror(const char* file, int line,
kCFStringEncodingUTF8);
CFStringGetCString(desc, buf_desc, MAX_ERROR_DESCRIPTION,
kCFStringEncodingUTF8);
- TString error_msg =
- y_absl::StrFormat("%s (error domain:%s, code:%ld, description:%s)",
- custom_desc, buf_domain, code, buf_desc);
+ TString error_msg =
+ y_absl::StrFormat("%s (error domain:%s, code:%ld, description:%s)",
+ custom_desc, buf_domain, code, buf_desc);
CFRelease(desc);
- return grpc_error_create(
- file, line, grpc_slice_from_copied_string(error_msg.c_str()), NULL, 0);
+ return grpc_error_create(
+ file, line, grpc_slice_from_copied_string(error_msg.c_str()), NULL, 0);
}
#endif /* GRPC_CFSTREAM */
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/ev_apple.cc b/contrib/libs/grpc/src/core/lib/iomgr/ev_apple.cc
index b0a352524b1..d1525828865 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/ev_apple.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/ev_apple.cc
@@ -1,356 +1,356 @@
-/*
- *
- * Copyright 2020 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-/// Event engine based on Apple's CFRunLoop API family. If the CFRunLoop engine
-/// is enabled (see iomgr_posix_cfstream.cc), a global thread is started to
-/// handle and trigger all the CFStream events. The CFStream streams register
-/// themselves with the run loop with functions grpc_apple_register_read_stream
-/// and grpc_apple_register_read_stream. Pollsets are dummy and block on a
-/// condition variable in pollset_work().
-
-#include <grpc/support/port_platform.h>
-
-#include "src/core/lib/iomgr/port.h"
-
-#ifdef GRPC_APPLE_EV
-
-#include <CoreFoundation/CoreFoundation.h>
-
-#include <list>
-
-#include "src/core/lib/gprpp/thd.h"
-#include "src/core/lib/iomgr/ev_apple.h"
-
-grpc_core::DebugOnlyTraceFlag grpc_apple_polling_trace(false, "apple_polling");
-
-#ifndef NDEBUG
-#define GRPC_POLLING_TRACE(format, ...) \
- if (GRPC_TRACE_FLAG_ENABLED(grpc_apple_polling_trace)) { \
- gpr_log(GPR_DEBUG, "(polling) " format, __VA_ARGS__); \
- }
-#else
-#define GRPC_POLLING_TRACE(...)
-#endif // NDEBUG
-
-#define GRPC_POLLSET_KICK_BROADCAST ((grpc_pollset_worker*)1)
-
-struct GlobalRunLoopContext {
- grpc_core::CondVar init_cv;
- grpc_core::CondVar input_source_cv;
-
- grpc_core::Mutex mu;
-
- // Whether an input source registration is pending. Protected by mu.
- bool input_source_registered = false;
-
- // The reference to the global run loop object. Protected by mu.
- CFRunLoopRef run_loop;
-
- // Whether the pollset has been globally shut down. Protected by mu.
- bool is_shutdown = false;
-};
-
-struct GrpcAppleWorker {
- // The condition varible to kick the worker. Works with the pollset's lock
- // (GrpcApplePollset.mu).
- grpc_core::CondVar cv;
-
- // Whether the worker is kicked. Protected by the pollset's lock
- // (GrpcApplePollset.mu).
- bool kicked = false;
-};
-
-struct GrpcApplePollset {
- grpc_core::Mutex mu;
-
- // Tracks the current workers in the pollset. Protected by mu.
- std::list<GrpcAppleWorker*> workers;
-
- // Whether the pollset is shut down. Protected by mu.
- bool is_shutdown = false;
-
- // Closure to call when shutdown is done. Protected by mu.
- grpc_closure* shutdown_closure;
-
- // Whether there's an outstanding kick that was not processed. Protected by
- // mu.
- bool kicked_without_poller = false;
-};
-
-static GlobalRunLoopContext* gGlobalRunLoopContext = nullptr;
-static grpc_core::Thread* gGlobalRunLoopThread = nullptr;
-
-/// Register the stream with the dispatch queue. Callbacks of the stream will be
-/// issued to the dispatch queue when a network event happens and will be
-/// managed by Grand Central Dispatch.
-static void grpc_apple_register_read_stream_queue(
- CFReadStreamRef read_stream, dispatch_queue_t dispatch_queue) {
- CFReadStreamSetDispatchQueue(read_stream, dispatch_queue);
-}
-
-/// Register the stream with the dispatch queue. Callbacks of the stream will be
-/// issued to the dispatch queue when a network event happens and will be
-/// managed by Grand Central Dispatch.
-static void grpc_apple_register_write_stream_queue(
- CFWriteStreamRef write_stream, dispatch_queue_t dispatch_queue) {
- CFWriteStreamSetDispatchQueue(write_stream, dispatch_queue);
-}
-
-/// Register the stream with the global run loop. Callbacks of the stream will
-/// be issued to the run loop when a network event happens and will be driven by
-/// the global run loop thread gGlobalRunLoopThread.
-static void grpc_apple_register_read_stream_run_loop(
- CFReadStreamRef read_stream, dispatch_queue_t dispatch_queue) {
- GRPC_POLLING_TRACE("Register read stream: %p", read_stream);
- grpc_core::MutexLock lock(&gGlobalRunLoopContext->mu);
- CFReadStreamScheduleWithRunLoop(read_stream, gGlobalRunLoopContext->run_loop,
- kCFRunLoopDefaultMode);
- gGlobalRunLoopContext->input_source_registered = true;
- gGlobalRunLoopContext->input_source_cv.Signal();
-}
-
-/// Register the stream with the global run loop. Callbacks of the stream will
-/// be issued to the run loop when a network event happens, and will be driven
-/// by the global run loop thread gGlobalRunLoopThread.
-static void grpc_apple_register_write_stream_run_loop(
- CFWriteStreamRef write_stream, dispatch_queue_t dispatch_queue) {
- GRPC_POLLING_TRACE("Register write stream: %p", write_stream);
- grpc_core::MutexLock lock(&gGlobalRunLoopContext->mu);
- CFWriteStreamScheduleWithRunLoop(
- write_stream, gGlobalRunLoopContext->run_loop, kCFRunLoopDefaultMode);
- gGlobalRunLoopContext->input_source_registered = true;
- gGlobalRunLoopContext->input_source_cv.Signal();
-}
-
-/// The default implementation of stream registration is to register the stream
-/// to a dispatch queue. However, if the CFRunLoop based pollset is enabled (by
-/// macro and environment variable, see docs in iomgr_posix_cfstream.cc), the
-/// CFStream streams are registered with the global run loop instead (see
-/// pollset_global_init below).
-static void (*grpc_apple_register_read_stream_impl)(
- CFReadStreamRef, dispatch_queue_t) = grpc_apple_register_read_stream_queue;
-static void (*grpc_apple_register_write_stream_impl)(CFWriteStreamRef,
- dispatch_queue_t) =
- grpc_apple_register_write_stream_queue;
-
-void grpc_apple_register_read_stream(CFReadStreamRef read_stream,
- dispatch_queue_t dispatch_queue) {
- grpc_apple_register_read_stream_impl(read_stream, dispatch_queue);
-}
-
-void grpc_apple_register_write_stream(CFWriteStreamRef write_stream,
- dispatch_queue_t dispatch_queue) {
- grpc_apple_register_write_stream_impl(write_stream, dispatch_queue);
-}
-
-/// Drive the run loop in a global singleton thread until the global run loop is
-/// shutdown.
-static void GlobalRunLoopFunc(void* arg) {
- grpc_core::ReleasableMutexLock lock(&gGlobalRunLoopContext->mu);
- gGlobalRunLoopContext->run_loop = CFRunLoopGetCurrent();
- gGlobalRunLoopContext->init_cv.Signal();
-
- while (!gGlobalRunLoopContext->is_shutdown) {
- // CFRunLoopRun() will return immediately if no stream is registered on it.
- // So we wait on a conditional variable until a stream is registered;
- // otherwise we'll be running a spinning loop.
- while (!gGlobalRunLoopContext->input_source_registered) {
- gGlobalRunLoopContext->input_source_cv.Wait(&gGlobalRunLoopContext->mu);
- }
- gGlobalRunLoopContext->input_source_registered = false;
- lock.Unlock();
- CFRunLoopRun();
- lock.Lock();
- }
- lock.Unlock();
-}
-
-// pollset implementation
-
-static void pollset_global_init(void) {
- gGlobalRunLoopContext = new GlobalRunLoopContext;
-
- grpc_apple_register_read_stream_impl =
- grpc_apple_register_read_stream_run_loop;
- grpc_apple_register_write_stream_impl =
- grpc_apple_register_write_stream_run_loop;
-
- grpc_core::MutexLock lock(&gGlobalRunLoopContext->mu);
- gGlobalRunLoopThread =
- new grpc_core::Thread("apple_ev", GlobalRunLoopFunc, nullptr);
- gGlobalRunLoopThread->Start();
- while (gGlobalRunLoopContext->run_loop == NULL)
- gGlobalRunLoopContext->init_cv.Wait(&gGlobalRunLoopContext->mu);
-}
-
-static void pollset_global_shutdown(void) {
- {
- grpc_core::MutexLock lock(&gGlobalRunLoopContext->mu);
- gGlobalRunLoopContext->is_shutdown = true;
- CFRunLoopStop(gGlobalRunLoopContext->run_loop);
- }
- gGlobalRunLoopThread->Join();
- delete gGlobalRunLoopThread;
- delete gGlobalRunLoopContext;
-}
-
-/// The caller must acquire the lock GrpcApplePollset.mu before calling this
-/// function. The lock may be temporarily released when waiting on the condition
-/// variable but will be re-acquired before the function returns.
-///
-/// The Apple pollset simply waits on a condition variable until it is kicked.
-/// The network events are handled in the global run loop thread. Processing of
-/// these events will eventually trigger the kick.
-static grpc_error* pollset_work(grpc_pollset* pollset,
- grpc_pollset_worker** worker,
- grpc_millis deadline) {
- GRPC_POLLING_TRACE("pollset work: %p, worker: %p, deadline: %" PRIu64,
- pollset, worker, deadline);
- GrpcApplePollset* apple_pollset =
- reinterpret_cast<GrpcApplePollset*>(pollset);
- GrpcAppleWorker actual_worker;
- if (worker) {
- *worker = reinterpret_cast<grpc_pollset_worker*>(&actual_worker);
- }
-
- if (apple_pollset->kicked_without_poller) {
- // Process the outstanding kick and reset the flag. Do not block.
- apple_pollset->kicked_without_poller = false;
- } else {
- // Block until kicked, timed out, or the pollset shuts down.
- apple_pollset->workers.push_front(&actual_worker);
- auto it = apple_pollset->workers.begin();
-
- while (!actual_worker.kicked && !apple_pollset->is_shutdown) {
- if (actual_worker.cv.Wait(
- &apple_pollset->mu,
- grpc_millis_to_timespec(deadline, GPR_CLOCK_REALTIME))) {
- // timed out
- break;
- }
- }
-
- apple_pollset->workers.erase(it);
-
- // If the pollset is shut down asynchronously and this is the last pending
- // worker, the shutdown process is complete at this moment and the shutdown
- // callback will be called.
- if (apple_pollset->is_shutdown && apple_pollset->workers.empty()) {
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, apple_pollset->shutdown_closure,
- GRPC_ERROR_NONE);
- }
- }
-
- return GRPC_ERROR_NONE;
-}
-
-/// Kick a specific worker. The caller must acquire the lock GrpcApplePollset.mu
-/// before calling this function.
-static void kick_worker(GrpcAppleWorker* worker) {
- worker->kicked = true;
- worker->cv.Signal();
-}
-
-/// The caller must acquire the lock GrpcApplePollset.mu before calling this
-/// function. The kick action simply signals the condition variable of the
-/// worker.
-static grpc_error* pollset_kick(grpc_pollset* pollset,
- grpc_pollset_worker* specific_worker) {
- GrpcApplePollset* apple_pollset =
- reinterpret_cast<GrpcApplePollset*>(pollset);
-
- GRPC_POLLING_TRACE("pollset kick: %p, worker:%p", pollset, specific_worker);
-
- if (specific_worker == nullptr) {
- if (apple_pollset->workers.empty()) {
- apple_pollset->kicked_without_poller = true;
- } else {
- GrpcAppleWorker* actual_worker = apple_pollset->workers.front();
- kick_worker(actual_worker);
- }
- } else if (specific_worker == GRPC_POLLSET_KICK_BROADCAST) {
- for (auto& actual_worker : apple_pollset->workers) {
- kick_worker(actual_worker);
- }
- } else {
- GrpcAppleWorker* actual_worker =
- reinterpret_cast<GrpcAppleWorker*>(specific_worker);
- kick_worker(actual_worker);
- }
-
- return GRPC_ERROR_NONE;
-}
-
-static void pollset_init(grpc_pollset* pollset, gpr_mu** mu) {
- GRPC_POLLING_TRACE("pollset init: %p", pollset);
- GrpcApplePollset* apple_pollset = new (pollset) GrpcApplePollset();
- *mu = apple_pollset->mu.get();
-}
-
-/// The caller must acquire the lock GrpcApplePollset.mu before calling this
-/// function.
-static void pollset_shutdown(grpc_pollset* pollset, grpc_closure* closure) {
- GRPC_POLLING_TRACE("pollset shutdown: %p", pollset);
-
- GrpcApplePollset* apple_pollset =
- reinterpret_cast<GrpcApplePollset*>(pollset);
- apple_pollset->is_shutdown = true;
- pollset_kick(pollset, GRPC_POLLSET_KICK_BROADCAST);
-
- // If there is any worker blocked, shutdown will be done asynchronously.
- if (apple_pollset->workers.empty()) {
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, closure, GRPC_ERROR_NONE);
- } else {
- apple_pollset->shutdown_closure = closure;
- }
-}
-
-static void pollset_destroy(grpc_pollset* pollset) {
- GRPC_POLLING_TRACE("pollset destroy: %p", pollset);
- GrpcApplePollset* apple_pollset =
- reinterpret_cast<GrpcApplePollset*>(pollset);
- apple_pollset->~GrpcApplePollset();
-}
-
-size_t pollset_size(void) { return sizeof(GrpcApplePollset); }
-
-grpc_pollset_vtable grpc_apple_pollset_vtable = {
- pollset_global_init, pollset_global_shutdown,
- pollset_init, pollset_shutdown,
- pollset_destroy, pollset_work,
- pollset_kick, pollset_size};
-
-// pollset_set implementation
-
-grpc_pollset_set* pollset_set_create(void) { return nullptr; }
-void pollset_set_destroy(grpc_pollset_set* pollset_set) {}
-void pollset_set_add_pollset(grpc_pollset_set* pollset_set,
- grpc_pollset* pollset) {}
-void pollset_set_del_pollset(grpc_pollset_set* pollset_set,
- grpc_pollset* pollset) {}
-void pollset_set_add_pollset_set(grpc_pollset_set* bag,
- grpc_pollset_set* item) {}
-void pollset_set_del_pollset_set(grpc_pollset_set* bag,
- grpc_pollset_set* item) {}
-
-grpc_pollset_set_vtable grpc_apple_pollset_set_vtable = {
- pollset_set_create, pollset_set_destroy,
- pollset_set_add_pollset, pollset_set_del_pollset,
- pollset_set_add_pollset_set, pollset_set_del_pollset_set};
-
-#endif
+/*
+ *
+ * Copyright 2020 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+/// Event engine based on Apple's CFRunLoop API family. If the CFRunLoop engine
+/// is enabled (see iomgr_posix_cfstream.cc), a global thread is started to
+/// handle and trigger all the CFStream events. The CFStream streams register
+/// themselves with the run loop with functions grpc_apple_register_read_stream
+/// and grpc_apple_register_read_stream. Pollsets are dummy and block on a
+/// condition variable in pollset_work().
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/lib/iomgr/port.h"
+
+#ifdef GRPC_APPLE_EV
+
+#include <CoreFoundation/CoreFoundation.h>
+
+#include <list>
+
+#include "src/core/lib/gprpp/thd.h"
+#include "src/core/lib/iomgr/ev_apple.h"
+
+grpc_core::DebugOnlyTraceFlag grpc_apple_polling_trace(false, "apple_polling");
+
+#ifndef NDEBUG
+#define GRPC_POLLING_TRACE(format, ...) \
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_apple_polling_trace)) { \
+ gpr_log(GPR_DEBUG, "(polling) " format, __VA_ARGS__); \
+ }
+#else
+#define GRPC_POLLING_TRACE(...)
+#endif // NDEBUG
+
+#define GRPC_POLLSET_KICK_BROADCAST ((grpc_pollset_worker*)1)
+
+struct GlobalRunLoopContext {
+ grpc_core::CondVar init_cv;
+ grpc_core::CondVar input_source_cv;
+
+ grpc_core::Mutex mu;
+
+ // Whether an input source registration is pending. Protected by mu.
+ bool input_source_registered = false;
+
+ // The reference to the global run loop object. Protected by mu.
+ CFRunLoopRef run_loop;
+
+ // Whether the pollset has been globally shut down. Protected by mu.
+ bool is_shutdown = false;
+};
+
+struct GrpcAppleWorker {
+ // The condition varible to kick the worker. Works with the pollset's lock
+ // (GrpcApplePollset.mu).
+ grpc_core::CondVar cv;
+
+ // Whether the worker is kicked. Protected by the pollset's lock
+ // (GrpcApplePollset.mu).
+ bool kicked = false;
+};
+
+struct GrpcApplePollset {
+ grpc_core::Mutex mu;
+
+ // Tracks the current workers in the pollset. Protected by mu.
+ std::list<GrpcAppleWorker*> workers;
+
+ // Whether the pollset is shut down. Protected by mu.
+ bool is_shutdown = false;
+
+ // Closure to call when shutdown is done. Protected by mu.
+ grpc_closure* shutdown_closure;
+
+ // Whether there's an outstanding kick that was not processed. Protected by
+ // mu.
+ bool kicked_without_poller = false;
+};
+
+static GlobalRunLoopContext* gGlobalRunLoopContext = nullptr;
+static grpc_core::Thread* gGlobalRunLoopThread = nullptr;
+
+/// Register the stream with the dispatch queue. Callbacks of the stream will be
+/// issued to the dispatch queue when a network event happens and will be
+/// managed by Grand Central Dispatch.
+static void grpc_apple_register_read_stream_queue(
+ CFReadStreamRef read_stream, dispatch_queue_t dispatch_queue) {
+ CFReadStreamSetDispatchQueue(read_stream, dispatch_queue);
+}
+
+/// Register the stream with the dispatch queue. Callbacks of the stream will be
+/// issued to the dispatch queue when a network event happens and will be
+/// managed by Grand Central Dispatch.
+static void grpc_apple_register_write_stream_queue(
+ CFWriteStreamRef write_stream, dispatch_queue_t dispatch_queue) {
+ CFWriteStreamSetDispatchQueue(write_stream, dispatch_queue);
+}
+
+/// Register the stream with the global run loop. Callbacks of the stream will
+/// be issued to the run loop when a network event happens and will be driven by
+/// the global run loop thread gGlobalRunLoopThread.
+static void grpc_apple_register_read_stream_run_loop(
+ CFReadStreamRef read_stream, dispatch_queue_t dispatch_queue) {
+ GRPC_POLLING_TRACE("Register read stream: %p", read_stream);
+ grpc_core::MutexLock lock(&gGlobalRunLoopContext->mu);
+ CFReadStreamScheduleWithRunLoop(read_stream, gGlobalRunLoopContext->run_loop,
+ kCFRunLoopDefaultMode);
+ gGlobalRunLoopContext->input_source_registered = true;
+ gGlobalRunLoopContext->input_source_cv.Signal();
+}
+
+/// Register the stream with the global run loop. Callbacks of the stream will
+/// be issued to the run loop when a network event happens, and will be driven
+/// by the global run loop thread gGlobalRunLoopThread.
+static void grpc_apple_register_write_stream_run_loop(
+ CFWriteStreamRef write_stream, dispatch_queue_t dispatch_queue) {
+ GRPC_POLLING_TRACE("Register write stream: %p", write_stream);
+ grpc_core::MutexLock lock(&gGlobalRunLoopContext->mu);
+ CFWriteStreamScheduleWithRunLoop(
+ write_stream, gGlobalRunLoopContext->run_loop, kCFRunLoopDefaultMode);
+ gGlobalRunLoopContext->input_source_registered = true;
+ gGlobalRunLoopContext->input_source_cv.Signal();
+}
+
+/// The default implementation of stream registration is to register the stream
+/// to a dispatch queue. However, if the CFRunLoop based pollset is enabled (by
+/// macro and environment variable, see docs in iomgr_posix_cfstream.cc), the
+/// CFStream streams are registered with the global run loop instead (see
+/// pollset_global_init below).
+static void (*grpc_apple_register_read_stream_impl)(
+ CFReadStreamRef, dispatch_queue_t) = grpc_apple_register_read_stream_queue;
+static void (*grpc_apple_register_write_stream_impl)(CFWriteStreamRef,
+ dispatch_queue_t) =
+ grpc_apple_register_write_stream_queue;
+
+void grpc_apple_register_read_stream(CFReadStreamRef read_stream,
+ dispatch_queue_t dispatch_queue) {
+ grpc_apple_register_read_stream_impl(read_stream, dispatch_queue);
+}
+
+void grpc_apple_register_write_stream(CFWriteStreamRef write_stream,
+ dispatch_queue_t dispatch_queue) {
+ grpc_apple_register_write_stream_impl(write_stream, dispatch_queue);
+}
+
+/// Drive the run loop in a global singleton thread until the global run loop is
+/// shutdown.
+static void GlobalRunLoopFunc(void* arg) {
+ grpc_core::ReleasableMutexLock lock(&gGlobalRunLoopContext->mu);
+ gGlobalRunLoopContext->run_loop = CFRunLoopGetCurrent();
+ gGlobalRunLoopContext->init_cv.Signal();
+
+ while (!gGlobalRunLoopContext->is_shutdown) {
+ // CFRunLoopRun() will return immediately if no stream is registered on it.
+ // So we wait on a conditional variable until a stream is registered;
+ // otherwise we'll be running a spinning loop.
+ while (!gGlobalRunLoopContext->input_source_registered) {
+ gGlobalRunLoopContext->input_source_cv.Wait(&gGlobalRunLoopContext->mu);
+ }
+ gGlobalRunLoopContext->input_source_registered = false;
+ lock.Unlock();
+ CFRunLoopRun();
+ lock.Lock();
+ }
+ lock.Unlock();
+}
+
+// pollset implementation
+
+static void pollset_global_init(void) {
+ gGlobalRunLoopContext = new GlobalRunLoopContext;
+
+ grpc_apple_register_read_stream_impl =
+ grpc_apple_register_read_stream_run_loop;
+ grpc_apple_register_write_stream_impl =
+ grpc_apple_register_write_stream_run_loop;
+
+ grpc_core::MutexLock lock(&gGlobalRunLoopContext->mu);
+ gGlobalRunLoopThread =
+ new grpc_core::Thread("apple_ev", GlobalRunLoopFunc, nullptr);
+ gGlobalRunLoopThread->Start();
+ while (gGlobalRunLoopContext->run_loop == NULL)
+ gGlobalRunLoopContext->init_cv.Wait(&gGlobalRunLoopContext->mu);
+}
+
+static void pollset_global_shutdown(void) {
+ {
+ grpc_core::MutexLock lock(&gGlobalRunLoopContext->mu);
+ gGlobalRunLoopContext->is_shutdown = true;
+ CFRunLoopStop(gGlobalRunLoopContext->run_loop);
+ }
+ gGlobalRunLoopThread->Join();
+ delete gGlobalRunLoopThread;
+ delete gGlobalRunLoopContext;
+}
+
+/// The caller must acquire the lock GrpcApplePollset.mu before calling this
+/// function. The lock may be temporarily released when waiting on the condition
+/// variable but will be re-acquired before the function returns.
+///
+/// The Apple pollset simply waits on a condition variable until it is kicked.
+/// The network events are handled in the global run loop thread. Processing of
+/// these events will eventually trigger the kick.
+static grpc_error* pollset_work(grpc_pollset* pollset,
+ grpc_pollset_worker** worker,
+ grpc_millis deadline) {
+ GRPC_POLLING_TRACE("pollset work: %p, worker: %p, deadline: %" PRIu64,
+ pollset, worker, deadline);
+ GrpcApplePollset* apple_pollset =
+ reinterpret_cast<GrpcApplePollset*>(pollset);
+ GrpcAppleWorker actual_worker;
+ if (worker) {
+ *worker = reinterpret_cast<grpc_pollset_worker*>(&actual_worker);
+ }
+
+ if (apple_pollset->kicked_without_poller) {
+ // Process the outstanding kick and reset the flag. Do not block.
+ apple_pollset->kicked_without_poller = false;
+ } else {
+ // Block until kicked, timed out, or the pollset shuts down.
+ apple_pollset->workers.push_front(&actual_worker);
+ auto it = apple_pollset->workers.begin();
+
+ while (!actual_worker.kicked && !apple_pollset->is_shutdown) {
+ if (actual_worker.cv.Wait(
+ &apple_pollset->mu,
+ grpc_millis_to_timespec(deadline, GPR_CLOCK_REALTIME))) {
+ // timed out
+ break;
+ }
+ }
+
+ apple_pollset->workers.erase(it);
+
+ // If the pollset is shut down asynchronously and this is the last pending
+ // worker, the shutdown process is complete at this moment and the shutdown
+ // callback will be called.
+ if (apple_pollset->is_shutdown && apple_pollset->workers.empty()) {
+ grpc_core::ExecCtx::Run(DEBUG_LOCATION, apple_pollset->shutdown_closure,
+ GRPC_ERROR_NONE);
+ }
+ }
+
+ return GRPC_ERROR_NONE;
+}
+
+/// Kick a specific worker. The caller must acquire the lock GrpcApplePollset.mu
+/// before calling this function.
+static void kick_worker(GrpcAppleWorker* worker) {
+ worker->kicked = true;
+ worker->cv.Signal();
+}
+
+/// The caller must acquire the lock GrpcApplePollset.mu before calling this
+/// function. The kick action simply signals the condition variable of the
+/// worker.
+static grpc_error* pollset_kick(grpc_pollset* pollset,
+ grpc_pollset_worker* specific_worker) {
+ GrpcApplePollset* apple_pollset =
+ reinterpret_cast<GrpcApplePollset*>(pollset);
+
+ GRPC_POLLING_TRACE("pollset kick: %p, worker:%p", pollset, specific_worker);
+
+ if (specific_worker == nullptr) {
+ if (apple_pollset->workers.empty()) {
+ apple_pollset->kicked_without_poller = true;
+ } else {
+ GrpcAppleWorker* actual_worker = apple_pollset->workers.front();
+ kick_worker(actual_worker);
+ }
+ } else if (specific_worker == GRPC_POLLSET_KICK_BROADCAST) {
+ for (auto& actual_worker : apple_pollset->workers) {
+ kick_worker(actual_worker);
+ }
+ } else {
+ GrpcAppleWorker* actual_worker =
+ reinterpret_cast<GrpcAppleWorker*>(specific_worker);
+ kick_worker(actual_worker);
+ }
+
+ return GRPC_ERROR_NONE;
+}
+
+static void pollset_init(grpc_pollset* pollset, gpr_mu** mu) {
+ GRPC_POLLING_TRACE("pollset init: %p", pollset);
+ GrpcApplePollset* apple_pollset = new (pollset) GrpcApplePollset();
+ *mu = apple_pollset->mu.get();
+}
+
+/// The caller must acquire the lock GrpcApplePollset.mu before calling this
+/// function.
+static void pollset_shutdown(grpc_pollset* pollset, grpc_closure* closure) {
+ GRPC_POLLING_TRACE("pollset shutdown: %p", pollset);
+
+ GrpcApplePollset* apple_pollset =
+ reinterpret_cast<GrpcApplePollset*>(pollset);
+ apple_pollset->is_shutdown = true;
+ pollset_kick(pollset, GRPC_POLLSET_KICK_BROADCAST);
+
+ // If there is any worker blocked, shutdown will be done asynchronously.
+ if (apple_pollset->workers.empty()) {
+ grpc_core::ExecCtx::Run(DEBUG_LOCATION, closure, GRPC_ERROR_NONE);
+ } else {
+ apple_pollset->shutdown_closure = closure;
+ }
+}
+
+static void pollset_destroy(grpc_pollset* pollset) {
+ GRPC_POLLING_TRACE("pollset destroy: %p", pollset);
+ GrpcApplePollset* apple_pollset =
+ reinterpret_cast<GrpcApplePollset*>(pollset);
+ apple_pollset->~GrpcApplePollset();
+}
+
+size_t pollset_size(void) { return sizeof(GrpcApplePollset); }
+
+grpc_pollset_vtable grpc_apple_pollset_vtable = {
+ pollset_global_init, pollset_global_shutdown,
+ pollset_init, pollset_shutdown,
+ pollset_destroy, pollset_work,
+ pollset_kick, pollset_size};
+
+// pollset_set implementation
+
+grpc_pollset_set* pollset_set_create(void) { return nullptr; }
+void pollset_set_destroy(grpc_pollset_set* pollset_set) {}
+void pollset_set_add_pollset(grpc_pollset_set* pollset_set,
+ grpc_pollset* pollset) {}
+void pollset_set_del_pollset(grpc_pollset_set* pollset_set,
+ grpc_pollset* pollset) {}
+void pollset_set_add_pollset_set(grpc_pollset_set* bag,
+ grpc_pollset_set* item) {}
+void pollset_set_del_pollset_set(grpc_pollset_set* bag,
+ grpc_pollset_set* item) {}
+
+grpc_pollset_set_vtable grpc_apple_pollset_set_vtable = {
+ pollset_set_create, pollset_set_destroy,
+ pollset_set_add_pollset, pollset_set_del_pollset,
+ pollset_set_add_pollset_set, pollset_set_del_pollset_set};
+
+#endif
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/ev_apple.h b/contrib/libs/grpc/src/core/lib/iomgr/ev_apple.h
index 74692077fb6..a05f91ce15f 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/ev_apple.h
+++ b/contrib/libs/grpc/src/core/lib/iomgr/ev_apple.h
@@ -1,43 +1,43 @@
-/*
- *
- * Copyright 2020 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#ifndef GRPC_CORE_LIB_IOMGR_EV_APPLE_H
-#define GRPC_CORE_LIB_IOMGR_EV_APPLE_H
-
-#include <grpc/support/port_platform.h>
-
-#ifdef GRPC_APPLE_EV
-
-#include <CoreFoundation/CoreFoundation.h>
-
-#include "src/core/lib/iomgr/pollset.h"
-#include "src/core/lib/iomgr/pollset_set.h"
-
-void grpc_apple_register_read_stream(CFReadStreamRef read_stream,
- dispatch_queue_t dispatch_queue);
-
-void grpc_apple_register_write_stream(CFWriteStreamRef write_stream,
- dispatch_queue_t dispatch_queue);
-
-extern grpc_pollset_vtable grpc_apple_pollset_vtable;
-
-extern grpc_pollset_set_vtable grpc_apple_pollset_set_vtable;
-
-#endif
-
-#endif
+/*
+ *
+ * Copyright 2020 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef GRPC_CORE_LIB_IOMGR_EV_APPLE_H
+#define GRPC_CORE_LIB_IOMGR_EV_APPLE_H
+
+#include <grpc/support/port_platform.h>
+
+#ifdef GRPC_APPLE_EV
+
+#include <CoreFoundation/CoreFoundation.h>
+
+#include "src/core/lib/iomgr/pollset.h"
+#include "src/core/lib/iomgr/pollset_set.h"
+
+void grpc_apple_register_read_stream(CFReadStreamRef read_stream,
+ dispatch_queue_t dispatch_queue);
+
+void grpc_apple_register_write_stream(CFWriteStreamRef write_stream,
+ dispatch_queue_t dispatch_queue);
+
+extern grpc_pollset_vtable grpc_apple_pollset_vtable;
+
+extern grpc_pollset_set_vtable grpc_apple_pollset_set_vtable;
+
+#endif
+
+#endif
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/ev_epoll1_linux.cc b/contrib/libs/grpc/src/core/lib/iomgr/ev_epoll1_linux.cc
index bebd39665bf..f09dcee0c06 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/ev_epoll1_linux.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/ev_epoll1_linux.cc
@@ -38,13 +38,13 @@
#include <sys/socket.h>
#include <unistd.h>
-#include <util/generic/string.h>
-#include <vector>
-
-#include "y_absl/strings/str_cat.h"
-#include "y_absl/strings/str_format.h"
-#include "y_absl/strings/str_join.h"
-
+#include <util/generic/string.h>
+#include <vector>
+
+#include "y_absl/strings/str_cat.h"
+#include "y_absl/strings/str_format.h"
+#include "y_absl/strings/str_join.h"
+
#include <grpc/support/alloc.h>
#include <grpc/support/cpu.h>
@@ -352,12 +352,12 @@ static grpc_fd* fd_create(int fd, const char* name, bool track_err) {
new_fd->freelist_next = nullptr;
- TString fd_name = y_absl::StrCat(name, " fd=", fd);
- grpc_iomgr_register_object(&new_fd->iomgr_object, fd_name.c_str());
+ TString fd_name = y_absl::StrCat(name, " fd=", fd);
+ grpc_iomgr_register_object(&new_fd->iomgr_object, fd_name.c_str());
fork_fd_list_add_grpc_fd(new_fd);
#ifndef NDEBUG
if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_fd_refcount)) {
- gpr_log(GPR_DEBUG, "FD %d %p create %s", fd, new_fd, fd_name.c_str());
+ gpr_log(GPR_DEBUG, "FD %d %p create %s", fd, new_fd, fd_name.c_str());
}
#endif
@@ -1068,23 +1068,23 @@ static grpc_error* pollset_kick(grpc_pollset* pollset,
GRPC_STATS_INC_POLLSET_KICK();
grpc_error* ret_err = GRPC_ERROR_NONE;
if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) {
- std::vector<TString> log;
- log.push_back(y_absl::StrFormat(
- "PS:%p KICK:%p curps=%p curworker=%p root=%p", pollset, specific_worker,
- (void*)gpr_tls_get(&g_current_thread_pollset),
- (void*)gpr_tls_get(&g_current_thread_worker), pollset->root_worker));
+ std::vector<TString> log;
+ log.push_back(y_absl::StrFormat(
+ "PS:%p KICK:%p curps=%p curworker=%p root=%p", pollset, specific_worker,
+ (void*)gpr_tls_get(&g_current_thread_pollset),
+ (void*)gpr_tls_get(&g_current_thread_worker), pollset->root_worker));
if (pollset->root_worker != nullptr) {
- log.push_back(y_absl::StrFormat(
- " {kick_state=%s next=%p {kick_state=%s}}",
- kick_state_string(pollset->root_worker->state),
- pollset->root_worker->next,
- kick_state_string(pollset->root_worker->next->state)));
+ log.push_back(y_absl::StrFormat(
+ " {kick_state=%s next=%p {kick_state=%s}}",
+ kick_state_string(pollset->root_worker->state),
+ pollset->root_worker->next,
+ kick_state_string(pollset->root_worker->next->state)));
}
if (specific_worker != nullptr) {
- log.push_back(y_absl::StrFormat(" worker_kick_state=%s",
- kick_state_string(specific_worker->state)));
+ log.push_back(y_absl::StrFormat(" worker_kick_state=%s",
+ kick_state_string(specific_worker->state)));
}
- gpr_log(GPR_DEBUG, "%s", y_absl::StrJoin(log, "").c_str());
+ gpr_log(GPR_DEBUG, "%s", y_absl::StrJoin(log, "").c_str());
}
if (specific_worker == nullptr) {
@@ -1113,8 +1113,8 @@ static grpc_error* pollset_kick(grpc_pollset* pollset,
}
SET_KICK_STATE(next_worker, KICKED);
goto done;
- } else if (root_worker == next_worker && // only try and wake up a poller
- // if there is no next worker
+ } else if (root_worker == next_worker && // only try and wake up a poller
+ // if there is no next worker
root_worker == (grpc_pollset_worker*)gpr_atm_no_barrier_load(
&g_active_poller)) {
GRPC_STATS_INC_POLLSET_KICK_WAKEUP_FD();
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/ev_epollex_linux.cc b/contrib/libs/grpc/src/core/lib/iomgr/ev_epollex_linux.cc
index 94033e7ca71..2dd9bbdffd8 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/ev_epollex_linux.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/ev_epollex_linux.cc
@@ -38,12 +38,12 @@
#include <sys/syscall.h>
#include <unistd.h>
-#include <util/generic/string.h>
-
-#include "y_absl/container/inlined_vector.h"
-#include "y_absl/strings/str_cat.h"
-#include "y_absl/strings/str_format.h"
-
+#include <util/generic/string.h>
+
+#include "y_absl/container/inlined_vector.h"
+#include "y_absl/strings/str_cat.h"
+#include "y_absl/strings/str_format.h"
+
#include <grpc/support/alloc.h>
#include "src/core/lib/debug/stats.h"
@@ -124,10 +124,10 @@ static const char* pollable_type_string(pollable_type t) {
return "<invalid>";
}
-static TString pollable_desc(pollable* p) {
- return y_absl::StrFormat("type=%s epfd=%d wakeup=%d",
- pollable_type_string(p->type), p->epfd,
- p->wakeup.read_fd);
+static TString pollable_desc(pollable* p) {
+ return y_absl::StrFormat("type=%s epfd=%d wakeup=%d",
+ pollable_type_string(p->type), p->epfd,
+ p->wakeup.read_fd);
}
/// Shared empty pollable - used by pollset to poll on until the first fd is
@@ -169,11 +169,11 @@ struct grpc_fd {
write_closure.InitEvent();
error_closure.InitEvent();
- TString fd_name = y_absl::StrCat(name, " fd=", fd);
- grpc_iomgr_register_object(&iomgr_object, fd_name.c_str());
+ TString fd_name = y_absl::StrCat(name, " fd=", fd);
+ grpc_iomgr_register_object(&iomgr_object, fd_name.c_str());
#ifndef NDEBUG
if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_fd_refcount)) {
- gpr_log(GPR_DEBUG, "FD %d %p create %s", fd, this, fd_name.c_str());
+ gpr_log(GPR_DEBUG, "FD %d %p create %s", fd, this, fd_name.c_str());
}
#endif
}
@@ -187,15 +187,15 @@ struct grpc_fd {
grpc_iomgr_unregister_object(&iomgr_object);
POLLABLE_UNREF(pollable_obj, "fd_pollable");
-
- // To clear out the allocations of pollset_fds, we need to swap its
- // contents with a newly-constructed (and soon to be destructed) local
- // variable of its same type. This is because InlinedVector::clear is _not_
- // guaranteed to actually free up allocations and this is important since
- // this object doesn't have a conventional destructor.
- y_absl::InlinedVector<int, 1> pollset_fds_tmp;
- pollset_fds_tmp.swap(pollset_fds);
-
+
+ // To clear out the allocations of pollset_fds, we need to swap its
+ // contents with a newly-constructed (and soon to be destructed) local
+ // variable of its same type. This is because InlinedVector::clear is _not_
+ // guaranteed to actually free up allocations and this is important since
+ // this object doesn't have a conventional destructor.
+ y_absl::InlinedVector<int, 1> pollset_fds_tmp;
+ pollset_fds_tmp.swap(pollset_fds);
+
gpr_mu_destroy(&pollable_mu);
gpr_mu_destroy(&orphan_mu);
@@ -237,8 +237,8 @@ struct grpc_fd {
// Protects pollable_obj and pollset_fds.
gpr_mu pollable_mu;
- y_absl::InlinedVector<int, 1> pollset_fds; // Used in PO_MULTI.
- pollable* pollable_obj = nullptr; // Used in PO_FD.
+ y_absl::InlinedVector<int, 1> pollset_fds; // Used in PO_MULTI.
+ pollable* pollable_obj = nullptr; // Used in PO_FD.
grpc_core::LockfreeEvent read_closure;
grpc_core::LockfreeEvent write_closure;
@@ -929,8 +929,8 @@ static grpc_error* pollable_epoll(pollable* p, grpc_millis deadline) {
int timeout = poll_deadline_to_millis_timeout(deadline);
if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) {
- gpr_log(GPR_INFO, "POLLABLE:%p[%s] poll for %dms", p,
- pollable_desc(p).c_str(), timeout);
+ gpr_log(GPR_INFO, "POLLABLE:%p[%s] poll for %dms", p,
+ pollable_desc(p).c_str(), timeout);
}
if (timeout != 0) {
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/ev_poll_posix.cc b/contrib/libs/grpc/src/core/lib/iomgr/ev_poll_posix.cc
index 3c296e2418c..a46ab7ea0dd 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/ev_poll_posix.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/ev_poll_posix.cc
@@ -32,10 +32,10 @@
#include <sys/socket.h>
#include <unistd.h>
-#include <util/generic/string.h>
-
-#include "y_absl/strings/str_cat.h"
-
+#include <util/generic/string.h>
+
+#include "y_absl/strings/str_cat.h"
+
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
@@ -310,9 +310,9 @@ static void fork_fd_list_add_wakeup_fd(grpc_cached_wakeup_fd* fd) {
}
}
-/*******************************************************************************
- * fd_posix.c
- */
+/*******************************************************************************
+ * fd_posix.c
+ */
#ifndef NDEBUG
#define REF_BY(fd, n, reason) ref_by(fd, n, reason, __FILE__, __LINE__)
@@ -384,8 +384,8 @@ static grpc_fd* fd_create(int fd, const char* name, bool track_err) {
r->released = 0;
gpr_atm_no_barrier_store(&r->pollhup, 0);
- TString name2 = y_absl::StrCat(name, " fd=", fd);
- grpc_iomgr_register_object(&r->iomgr_object, name2.c_str());
+ TString name2 = y_absl::StrCat(name, " fd=", fd);
+ grpc_iomgr_register_object(&r->iomgr_object, name2.c_str());
fork_fd_list_add_grpc_fd(r);
return r;
}
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/exec_ctx.h b/contrib/libs/grpc/src/core/lib/iomgr/exec_ctx.h
index f66910c4f16..6b4e184cad3 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/exec_ctx.h
+++ b/contrib/libs/grpc/src/core/lib/iomgr/exec_ctx.h
@@ -21,8 +21,8 @@
#include <grpc/support/port_platform.h>
-#include <limits>
-
+#include <limits>
+
#include <grpc/impl/codegen/grpc_types.h>
#include <grpc/support/atm.h>
#include <grpc/support/cpu.h>
@@ -134,12 +134,12 @@ class ExecCtx {
ExecCtx(const ExecCtx&) = delete;
ExecCtx& operator=(const ExecCtx&) = delete;
- unsigned starting_cpu() {
- if (starting_cpu_ == std::numeric_limits<unsigned>::max()) {
- starting_cpu_ = gpr_cpu_current_cpu();
- }
- return starting_cpu_;
- }
+ unsigned starting_cpu() {
+ if (starting_cpu_ == std::numeric_limits<unsigned>::max()) {
+ starting_cpu_ = gpr_cpu_current_cpu();
+ }
+ return starting_cpu_;
+ }
struct CombinerData {
/* currently active combiner: updated only via combiner.c */
@@ -246,7 +246,7 @@ class ExecCtx {
CombinerData combiner_data_ = {nullptr, nullptr};
uintptr_t flags_;
- unsigned starting_cpu_ = std::numeric_limits<unsigned>::max();
+ unsigned starting_cpu_ = std::numeric_limits<unsigned>::max();
bool now_is_valid_ = false;
grpc_millis now_ = 0;
@@ -331,15 +331,15 @@ class ApplicationCallbackExecCtx {
}
}
- uintptr_t Flags() { return flags_; }
-
- static ApplicationCallbackExecCtx* Get() {
- return reinterpret_cast<ApplicationCallbackExecCtx*>(
- gpr_tls_get(&callback_exec_ctx_));
- }
-
+ uintptr_t Flags() { return flags_; }
+
+ static ApplicationCallbackExecCtx* Get() {
+ return reinterpret_cast<ApplicationCallbackExecCtx*>(
+ gpr_tls_get(&callback_exec_ctx_));
+ }
+
static void Set(ApplicationCallbackExecCtx* exec_ctx, uintptr_t flags) {
- if (Get() == nullptr) {
+ if (Get() == nullptr) {
if (!(GRPC_APP_CALLBACK_EXEC_CTX_FLAG_IS_INTERNAL_THREAD & flags)) {
grpc_core::Fork::IncExecCtxCount();
}
@@ -352,7 +352,7 @@ class ApplicationCallbackExecCtx {
functor->internal_success = is_success;
functor->internal_next = nullptr;
- ApplicationCallbackExecCtx* ctx = Get();
+ ApplicationCallbackExecCtx* ctx = Get();
if (ctx->head_ == nullptr) {
ctx->head_ = functor;
@@ -369,8 +369,8 @@ class ApplicationCallbackExecCtx {
/** Global shutdown for ApplicationCallbackExecCtx. Called by init. */
static void GlobalShutdown(void) { gpr_tls_destroy(&callback_exec_ctx_); }
- static bool Available() { return Get() != nullptr; }
-
+ static bool Available() { return Get() != nullptr; }
+
private:
uintptr_t flags_{0u};
grpc_experimental_completion_queue_functor* head_{nullptr};
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/executor.cc b/contrib/libs/grpc/src/core/lib/iomgr/executor.cc
index e0b85819920..10b2f948ec7 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/executor.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/executor.cc
@@ -154,7 +154,7 @@ void Executor::SetThreading(bool threading) {
if (threading) {
if (curr_num_threads > 0) {
- EXECUTOR_TRACE("(%s) SetThreading(true). curr_num_threads > 0", name_);
+ EXECUTOR_TRACE("(%s) SetThreading(true). curr_num_threads > 0", name_);
return;
}
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/fork_posix.cc b/contrib/libs/grpc/src/core/lib/iomgr/fork_posix.cc
index fec48ccb3f8..82654b5a885 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/fork_posix.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/fork_posix.cc
@@ -22,10 +22,10 @@
#ifdef GRPC_POSIX_FORK
-#ifdef GRPC_POSIX_FORK_ALLOW_PTHREAD_ATFORK
-#include <pthread.h>
-#endif
-
+#ifdef GRPC_POSIX_FORK_ALLOW_PTHREAD_ATFORK
+#include <pthread.h>
+#endif
+
#include <string.h>
#include <grpc/fork.h>
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/iomgr_posix_cfstream.cc b/contrib/libs/grpc/src/core/lib/iomgr/iomgr_posix_cfstream.cc
index feae0996ba4..30c44edb5d6 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/iomgr_posix_cfstream.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/iomgr_posix_cfstream.cc
@@ -16,20 +16,20 @@
*
*/
-/// CFStream is build-enabled on iOS by default and disabled by default on other
-/// platforms (see port_platform.h). To enable CFStream build on another
-/// platform, the users need to define macro "GRPC_CFSTREAM=1" when building
-/// gRPC.
-///
-/// When CFStream is to be built (either by default on iOS or by macro on other
-/// platforms), the users can disable CFStream with environment variable
-/// "grpc_cfstream=0". This will let gRPC to fallback to use POSIX sockets. In
-/// addition, the users may choose to use an alternative CFRunLoop based pollset
-/// "ev_apple" by setting environment variable "GRPC_CFSTREAM_RUN_LOOP=1". This
-/// pollset resolves a bug from Apple when CFStream streams dispatch events to
-/// dispatch queues. The caveat of this pollset is that users may not be able to
-/// run a gRPC server in the same process.
-
+/// CFStream is build-enabled on iOS by default and disabled by default on other
+/// platforms (see port_platform.h). To enable CFStream build on another
+/// platform, the users need to define macro "GRPC_CFSTREAM=1" when building
+/// gRPC.
+///
+/// When CFStream is to be built (either by default on iOS or by macro on other
+/// platforms), the users can disable CFStream with environment variable
+/// "grpc_cfstream=0". This will let gRPC to fallback to use POSIX sockets. In
+/// addition, the users may choose to use an alternative CFRunLoop based pollset
+/// "ev_apple" by setting environment variable "GRPC_CFSTREAM_RUN_LOOP=1". This
+/// pollset resolves a bug from Apple when CFStream streams dispatch events to
+/// dispatch queues. The caveat of this pollset is that users may not be able to
+/// run a gRPC server in the same process.
+
#include <grpc/support/port_platform.h>
#include "src/core/lib/iomgr/port.h"
@@ -37,7 +37,7 @@
#ifdef GRPC_CFSTREAM_IOMGR
#include "src/core/lib/debug/trace.h"
-#include "src/core/lib/iomgr/ev_apple.h"
+#include "src/core/lib/iomgr/ev_apple.h"
#include "src/core/lib/iomgr/ev_posix.h"
#include "src/core/lib/iomgr/iomgr_internal.h"
#include "src/core/lib/iomgr/iomgr_posix.h"
@@ -48,7 +48,7 @@
#include "src/core/lib/iomgr/timer.h"
static const char* grpc_cfstream_env_var = "grpc_cfstream";
-static const char* grpc_cfstream_run_loop_env_var = "GRPC_CFSTREAM_RUN_LOOP";
+static const char* grpc_cfstream_run_loop_env_var = "GRPC_CFSTREAM_RUN_LOOP";
extern grpc_tcp_server_vtable grpc_posix_tcp_server_vtable;
extern grpc_tcp_client_vtable grpc_posix_tcp_client_vtable;
@@ -58,33 +58,33 @@ extern grpc_pollset_vtable grpc_posix_pollset_vtable;
extern grpc_pollset_set_vtable grpc_posix_pollset_set_vtable;
extern grpc_address_resolver_vtable grpc_posix_resolver_vtable;
-static void apple_iomgr_platform_init(void) { grpc_pollset_global_init(); }
-
-static void apple_iomgr_platform_flush(void) {}
-
-static void apple_iomgr_platform_shutdown(void) {
- grpc_pollset_global_shutdown();
-}
-
-static void apple_iomgr_platform_shutdown_background_closure(void) {}
-
-static bool apple_iomgr_platform_is_any_background_poller_thread(void) {
- return false;
-}
-
-static bool apple_iomgr_platform_add_closure_to_background_poller(
- grpc_closure* closure, grpc_error* error) {
- return false;
-}
-
-static grpc_iomgr_platform_vtable apple_vtable = {
- apple_iomgr_platform_init,
- apple_iomgr_platform_flush,
- apple_iomgr_platform_shutdown,
- apple_iomgr_platform_shutdown_background_closure,
- apple_iomgr_platform_is_any_background_poller_thread,
- apple_iomgr_platform_add_closure_to_background_poller};
-
+static void apple_iomgr_platform_init(void) { grpc_pollset_global_init(); }
+
+static void apple_iomgr_platform_flush(void) {}
+
+static void apple_iomgr_platform_shutdown(void) {
+ grpc_pollset_global_shutdown();
+}
+
+static void apple_iomgr_platform_shutdown_background_closure(void) {}
+
+static bool apple_iomgr_platform_is_any_background_poller_thread(void) {
+ return false;
+}
+
+static bool apple_iomgr_platform_add_closure_to_background_poller(
+ grpc_closure* closure, grpc_error* error) {
+ return false;
+}
+
+static grpc_iomgr_platform_vtable apple_vtable = {
+ apple_iomgr_platform_init,
+ apple_iomgr_platform_flush,
+ apple_iomgr_platform_shutdown,
+ apple_iomgr_platform_shutdown_background_closure,
+ apple_iomgr_platform_is_any_background_poller_thread,
+ apple_iomgr_platform_add_closure_to_background_poller};
+
static void iomgr_platform_init(void) {
grpc_wakeup_fd_global_init();
grpc_event_engine_init();
@@ -119,53 +119,53 @@ static grpc_iomgr_platform_vtable vtable = {
iomgr_platform_add_closure_to_background_poller};
void grpc_set_default_iomgr_platform() {
- char* enable_cfstream_str = getenv(grpc_cfstream_env_var);
- bool enable_cfstream =
- enable_cfstream_str == nullptr || enable_cfstream_str[0] != '0';
- char* enable_cfstream_run_loop_str = getenv(grpc_cfstream_run_loop_env_var);
- // CFStream run-loop is disabled by default. The user has to enable it
- // explicitly with environment variable.
- bool enable_cfstream_run_loop = enable_cfstream_run_loop_str != nullptr &&
- enable_cfstream_run_loop_str[0] == '1';
- if (!enable_cfstream) {
- // Use POSIX sockets for both client and server
- grpc_set_tcp_client_impl(&grpc_posix_tcp_client_vtable);
- grpc_set_tcp_server_impl(&grpc_posix_tcp_server_vtable);
- grpc_set_pollset_vtable(&grpc_posix_pollset_vtable);
- grpc_set_pollset_set_vtable(&grpc_posix_pollset_set_vtable);
- grpc_set_iomgr_platform_vtable(&vtable);
- } else if (enable_cfstream && !enable_cfstream_run_loop) {
- // Use CFStream with dispatch queue for client; use POSIX sockets for server
- grpc_set_tcp_client_impl(&grpc_cfstream_client_vtable);
- grpc_set_tcp_server_impl(&grpc_posix_tcp_server_vtable);
- grpc_set_pollset_vtable(&grpc_posix_pollset_vtable);
- grpc_set_pollset_set_vtable(&grpc_posix_pollset_set_vtable);
- grpc_set_iomgr_platform_vtable(&vtable);
- } else {
- // Use CFStream with CFRunLoop for client; server not supported
- grpc_set_tcp_client_impl(&grpc_cfstream_client_vtable);
- grpc_set_pollset_vtable(&grpc_apple_pollset_vtable);
- grpc_set_pollset_set_vtable(&grpc_apple_pollset_set_vtable);
- grpc_set_iomgr_platform_vtable(&apple_vtable);
+ char* enable_cfstream_str = getenv(grpc_cfstream_env_var);
+ bool enable_cfstream =
+ enable_cfstream_str == nullptr || enable_cfstream_str[0] != '0';
+ char* enable_cfstream_run_loop_str = getenv(grpc_cfstream_run_loop_env_var);
+ // CFStream run-loop is disabled by default. The user has to enable it
+ // explicitly with environment variable.
+ bool enable_cfstream_run_loop = enable_cfstream_run_loop_str != nullptr &&
+ enable_cfstream_run_loop_str[0] == '1';
+ if (!enable_cfstream) {
+ // Use POSIX sockets for both client and server
+ grpc_set_tcp_client_impl(&grpc_posix_tcp_client_vtable);
+ grpc_set_tcp_server_impl(&grpc_posix_tcp_server_vtable);
+ grpc_set_pollset_vtable(&grpc_posix_pollset_vtable);
+ grpc_set_pollset_set_vtable(&grpc_posix_pollset_set_vtable);
+ grpc_set_iomgr_platform_vtable(&vtable);
+ } else if (enable_cfstream && !enable_cfstream_run_loop) {
+ // Use CFStream with dispatch queue for client; use POSIX sockets for server
+ grpc_set_tcp_client_impl(&grpc_cfstream_client_vtable);
+ grpc_set_tcp_server_impl(&grpc_posix_tcp_server_vtable);
+ grpc_set_pollset_vtable(&grpc_posix_pollset_vtable);
+ grpc_set_pollset_set_vtable(&grpc_posix_pollset_set_vtable);
+ grpc_set_iomgr_platform_vtable(&vtable);
+ } else {
+ // Use CFStream with CFRunLoop for client; server not supported
+ grpc_set_tcp_client_impl(&grpc_cfstream_client_vtable);
+ grpc_set_pollset_vtable(&grpc_apple_pollset_vtable);
+ grpc_set_pollset_set_vtable(&grpc_apple_pollset_set_vtable);
+ grpc_set_iomgr_platform_vtable(&apple_vtable);
}
grpc_set_timer_impl(&grpc_generic_timer_vtable);
grpc_set_resolver_impl(&grpc_posix_resolver_vtable);
}
bool grpc_iomgr_run_in_background() {
- char* enable_cfstream_str = getenv(grpc_cfstream_env_var);
- bool enable_cfstream =
- enable_cfstream_str == nullptr || enable_cfstream_str[0] != '0';
- char* enable_cfstream_run_loop_str = getenv(grpc_cfstream_run_loop_env_var);
- // CFStream run-loop is disabled by default. The user has to enable it
- // explicitly with environment variable.
- bool enable_cfstream_run_loop = enable_cfstream_run_loop_str != nullptr &&
- enable_cfstream_run_loop_str[0] == '1';
- if (enable_cfstream && enable_cfstream_run_loop) {
- return false;
- } else {
- return grpc_event_engine_run_in_background();
- }
+ char* enable_cfstream_str = getenv(grpc_cfstream_env_var);
+ bool enable_cfstream =
+ enable_cfstream_str == nullptr || enable_cfstream_str[0] != '0';
+ char* enable_cfstream_run_loop_str = getenv(grpc_cfstream_run_loop_env_var);
+ // CFStream run-loop is disabled by default. The user has to enable it
+ // explicitly with environment variable.
+ bool enable_cfstream_run_loop = enable_cfstream_run_loop_str != nullptr &&
+ enable_cfstream_run_loop_str[0] == '1';
+ if (enable_cfstream && enable_cfstream_run_loop) {
+ return false;
+ } else {
+ return grpc_event_engine_run_in_background();
+ }
}
#endif /* GRPC_CFSTREAM_IOMGR */
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/is_epollexclusive_available.cc b/contrib/libs/grpc/src/core/lib/iomgr/is_epollexclusive_available.cc
index b9daf1f79ce..abc901efbe0 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/is_epollexclusive_available.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/is_epollexclusive_available.cc
@@ -93,20 +93,20 @@ bool grpc_is_epollexclusive_available(void) {
close(evfd);
return false;
}
- // Check that EPOLLEXCLUSIVE is supported at all.
- ev.events = static_cast<uint32_t>(EPOLLET | EPOLLIN | EPOLLEXCLUSIVE);
- if (epoll_ctl(fd, EPOLL_CTL_ADD, evfd, &ev) != 0) {
- if (!logged_why_not) {
- gpr_log(GPR_DEBUG,
- "epoll_ctl with EPOLLEXCLUSIVE failed with error: "
- "%d. Not using epollex polling engine.",
- errno);
- logged_why_not = true;
- }
- close(fd);
- close(evfd);
- return false;
- }
+ // Check that EPOLLEXCLUSIVE is supported at all.
+ ev.events = static_cast<uint32_t>(EPOLLET | EPOLLIN | EPOLLEXCLUSIVE);
+ if (epoll_ctl(fd, EPOLL_CTL_ADD, evfd, &ev) != 0) {
+ if (!logged_why_not) {
+ gpr_log(GPR_DEBUG,
+ "epoll_ctl with EPOLLEXCLUSIVE failed with error: "
+ "%d. Not using epollex polling engine.",
+ errno);
+ logged_why_not = true;
+ }
+ close(fd);
+ close(evfd);
+ return false;
+ }
close(evfd);
close(fd);
return true;
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/load_file.cc b/contrib/libs/grpc/src/core/lib/iomgr/load_file.cc
index ed193b56cb4..4bed6275dca 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/load_file.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/load_file.cc
@@ -53,7 +53,7 @@ grpc_error* grpc_load_file(const char* filename, int add_null_terminator,
gpr_malloc(contents_size + (add_null_terminator ? 1 : 0)));
bytes_read = fread(contents, 1, contents_size, file);
if (bytes_read < contents_size) {
- gpr_free(contents);
+ gpr_free(contents);
error = GRPC_OS_ERROR(errno, "fread");
GPR_ASSERT(ferror(file));
goto end;
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/parse_address.cc b/contrib/libs/grpc/src/core/lib/iomgr/parse_address.cc
index a1bbacd8f53..af514c81cd8 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/parse_address.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/parse_address.cc
@@ -1,238 +1,238 @@
-/*
- *
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <grpc/support/port_platform.h>
-
-#include "src/core/lib/iomgr/grpc_if_nametoindex.h"
-#include "src/core/lib/iomgr/parse_address.h"
-#include "src/core/lib/iomgr/sockaddr.h"
-#include "src/core/lib/iomgr/socket_utils.h"
-
-#include <stdio.h>
-#include <string.h>
-#ifdef GRPC_HAVE_UNIX_SOCKET
-#include <sys/un.h>
-#endif
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/string_util.h>
-
-#include "src/core/lib/gpr/string.h"
-#include "src/core/lib/gprpp/host_port.h"
-
-#ifdef GRPC_POSIX_SOCKET
-#include <errno.h>
-#include <net/if.h>
-#endif
-
-#ifdef GRPC_HAVE_UNIX_SOCKET
-
-bool grpc_parse_unix(const grpc_uri* uri,
- grpc_resolved_address* resolved_addr) {
- if (strcmp("unix", uri->scheme) != 0) {
- gpr_log(GPR_ERROR, "Expected 'unix' scheme, got '%s'", uri->scheme);
- return false;
- }
- struct sockaddr_un* un =
- reinterpret_cast<struct sockaddr_un*>(resolved_addr->addr);
- const size_t maxlen = sizeof(un->sun_path);
- const size_t path_len = strnlen(uri->path, maxlen);
- if (path_len == maxlen) return false;
- un->sun_family = AF_UNIX;
- strcpy(un->sun_path, uri->path);
- resolved_addr->len = static_cast<socklen_t>(sizeof(*un));
- return true;
-}
-
-#else /* GRPC_HAVE_UNIX_SOCKET */
-
-bool grpc_parse_unix(const grpc_uri* uri,
- grpc_resolved_address* resolved_addr) {
- abort();
-}
-
-#endif /* GRPC_HAVE_UNIX_SOCKET */
-
-bool grpc_parse_ipv4_hostport(const char* hostport, grpc_resolved_address* addr,
- bool log_errors) {
- bool success = false;
- // Split host and port.
- TString host;
- TString port;
- if (!grpc_core::SplitHostPort(hostport, &host, &port)) {
- if (log_errors) {
- gpr_log(GPR_ERROR, "Failed gpr_split_host_port(%s, ...)", hostport);
- }
- return false;
- }
- // Parse IP address.
- memset(addr, 0, sizeof(*addr));
- addr->len = static_cast<socklen_t>(sizeof(grpc_sockaddr_in));
- grpc_sockaddr_in* in = reinterpret_cast<grpc_sockaddr_in*>(addr->addr);
- in->sin_family = GRPC_AF_INET;
- if (grpc_inet_pton(GRPC_AF_INET, host.c_str(), &in->sin_addr) == 0) {
- if (log_errors) {
- gpr_log(GPR_ERROR, "invalid ipv4 address: '%s'", host.c_str());
- }
- goto done;
- }
- // Parse port.
- if (port.empty()) {
- if (log_errors) gpr_log(GPR_ERROR, "no port given for ipv4 scheme");
- goto done;
- }
- int port_num;
- if (sscanf(port.c_str(), "%d", &port_num) != 1 || port_num < 0 ||
- port_num > 65535) {
- if (log_errors) gpr_log(GPR_ERROR, "invalid ipv4 port: '%s'", port.c_str());
- goto done;
- }
- in->sin_port = grpc_htons(static_cast<uint16_t>(port_num));
- success = true;
-done:
- return success;
-}
-
-bool grpc_parse_ipv4(const grpc_uri* uri,
- grpc_resolved_address* resolved_addr) {
- if (strcmp("ipv4", uri->scheme) != 0) {
- gpr_log(GPR_ERROR, "Expected 'ipv4' scheme, got '%s'", uri->scheme);
- return false;
- }
- const char* host_port = uri->path;
- if (*host_port == '/') ++host_port;
- return grpc_parse_ipv4_hostport(host_port, resolved_addr,
- true /* log_errors */);
-}
-
-bool grpc_parse_ipv6_hostport(const char* hostport, grpc_resolved_address* addr,
- bool log_errors) {
- bool success = false;
- // Split host and port.
- TString host;
- TString port;
- if (!grpc_core::SplitHostPort(hostport, &host, &port)) {
- if (log_errors) {
- gpr_log(GPR_ERROR, "Failed gpr_split_host_port(%s, ...)", hostport);
- }
- return false;
- }
- // Parse IP address.
- memset(addr, 0, sizeof(*addr));
- addr->len = static_cast<socklen_t>(sizeof(grpc_sockaddr_in6));
- grpc_sockaddr_in6* in6 = reinterpret_cast<grpc_sockaddr_in6*>(addr->addr);
- in6->sin6_family = GRPC_AF_INET6;
- // Handle the RFC6874 syntax for IPv6 zone identifiers.
- char* host_end =
- static_cast<char*>(gpr_memrchr(host.c_str(), '%', host.size()));
- if (host_end != nullptr) {
- GPR_ASSERT(host_end >= host.c_str());
- char host_without_scope[GRPC_INET6_ADDRSTRLEN + 1];
- size_t host_without_scope_len =
- static_cast<size_t>(host_end - host.c_str());
- uint32_t sin6_scope_id = 0;
- if (host_without_scope_len > GRPC_INET6_ADDRSTRLEN) {
- if (log_errors) {
- gpr_log(
- GPR_ERROR,
- "invalid ipv6 address length %zu. Length cannot be greater than "
- "GRPC_INET6_ADDRSTRLEN i.e %d)",
- host_without_scope_len, GRPC_INET6_ADDRSTRLEN);
- }
- goto done;
- }
- strncpy(host_without_scope, host.c_str(), host_without_scope_len);
- host_without_scope[host_without_scope_len] = '\0';
- if (grpc_inet_pton(GRPC_AF_INET6, host_without_scope, &in6->sin6_addr) ==
- 0) {
- if (log_errors) {
- gpr_log(GPR_ERROR, "invalid ipv6 address: '%s'", host_without_scope);
- }
- goto done;
- }
- if (gpr_parse_bytes_to_uint32(host_end + 1,
- host.size() - host_without_scope_len - 1,
- &sin6_scope_id) == 0) {
- if ((sin6_scope_id = grpc_if_nametoindex(host_end + 1)) == 0) {
- gpr_log(GPR_ERROR,
- "Invalid interface name: '%s'. "
- "Non-numeric and failed if_nametoindex.",
- host_end + 1);
- goto done;
- }
- }
- // Handle "sin6_scope_id" being type "u_long". See grpc issue #10027.
- in6->sin6_scope_id = sin6_scope_id;
- } else {
- if (grpc_inet_pton(GRPC_AF_INET6, host.c_str(), &in6->sin6_addr) == 0) {
- if (log_errors) {
- gpr_log(GPR_ERROR, "invalid ipv6 address: '%s'", host.c_str());
- }
- goto done;
- }
- }
- // Parse port.
- if (port.empty()) {
- if (log_errors) gpr_log(GPR_ERROR, "no port given for ipv6 scheme");
- goto done;
- }
- int port_num;
- if (sscanf(port.c_str(), "%d", &port_num) != 1 || port_num < 0 ||
- port_num > 65535) {
- if (log_errors) gpr_log(GPR_ERROR, "invalid ipv6 port: '%s'", port.c_str());
- goto done;
- }
- in6->sin6_port = grpc_htons(static_cast<uint16_t>(port_num));
- success = true;
-done:
- return success;
-}
-
-bool grpc_parse_ipv6(const grpc_uri* uri,
- grpc_resolved_address* resolved_addr) {
- if (strcmp("ipv6", uri->scheme) != 0) {
- gpr_log(GPR_ERROR, "Expected 'ipv6' scheme, got '%s'", uri->scheme);
- return false;
- }
- const char* host_port = uri->path;
- if (*host_port == '/') ++host_port;
- return grpc_parse_ipv6_hostport(host_port, resolved_addr,
- true /* log_errors */);
-}
-
-bool grpc_parse_uri(const grpc_uri* uri, grpc_resolved_address* resolved_addr) {
- if (strcmp("unix", uri->scheme) == 0) {
- return grpc_parse_unix(uri, resolved_addr);
- } else if (strcmp("ipv4", uri->scheme) == 0) {
- return grpc_parse_ipv4(uri, resolved_addr);
- } else if (strcmp("ipv6", uri->scheme) == 0) {
- return grpc_parse_ipv6(uri, resolved_addr);
- }
- gpr_log(GPR_ERROR, "Can't parse scheme '%s'", uri->scheme);
- return false;
-}
-
-uint16_t grpc_strhtons(const char* port) {
- if (strcmp(port, "http") == 0) {
- return htons(80);
- } else if (strcmp(port, "https") == 0) {
- return htons(443);
- }
- return htons(static_cast<unsigned short>(atoi(port)));
-}
+/*
+ *
+ * Copyright 2016 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/lib/iomgr/grpc_if_nametoindex.h"
+#include "src/core/lib/iomgr/parse_address.h"
+#include "src/core/lib/iomgr/sockaddr.h"
+#include "src/core/lib/iomgr/socket_utils.h"
+
+#include <stdio.h>
+#include <string.h>
+#ifdef GRPC_HAVE_UNIX_SOCKET
+#include <sys/un.h>
+#endif
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
+
+#include "src/core/lib/gpr/string.h"
+#include "src/core/lib/gprpp/host_port.h"
+
+#ifdef GRPC_POSIX_SOCKET
+#include <errno.h>
+#include <net/if.h>
+#endif
+
+#ifdef GRPC_HAVE_UNIX_SOCKET
+
+bool grpc_parse_unix(const grpc_uri* uri,
+ grpc_resolved_address* resolved_addr) {
+ if (strcmp("unix", uri->scheme) != 0) {
+ gpr_log(GPR_ERROR, "Expected 'unix' scheme, got '%s'", uri->scheme);
+ return false;
+ }
+ struct sockaddr_un* un =
+ reinterpret_cast<struct sockaddr_un*>(resolved_addr->addr);
+ const size_t maxlen = sizeof(un->sun_path);
+ const size_t path_len = strnlen(uri->path, maxlen);
+ if (path_len == maxlen) return false;
+ un->sun_family = AF_UNIX;
+ strcpy(un->sun_path, uri->path);
+ resolved_addr->len = static_cast<socklen_t>(sizeof(*un));
+ return true;
+}
+
+#else /* GRPC_HAVE_UNIX_SOCKET */
+
+bool grpc_parse_unix(const grpc_uri* uri,
+ grpc_resolved_address* resolved_addr) {
+ abort();
+}
+
+#endif /* GRPC_HAVE_UNIX_SOCKET */
+
+bool grpc_parse_ipv4_hostport(const char* hostport, grpc_resolved_address* addr,
+ bool log_errors) {
+ bool success = false;
+ // Split host and port.
+ TString host;
+ TString port;
+ if (!grpc_core::SplitHostPort(hostport, &host, &port)) {
+ if (log_errors) {
+ gpr_log(GPR_ERROR, "Failed gpr_split_host_port(%s, ...)", hostport);
+ }
+ return false;
+ }
+ // Parse IP address.
+ memset(addr, 0, sizeof(*addr));
+ addr->len = static_cast<socklen_t>(sizeof(grpc_sockaddr_in));
+ grpc_sockaddr_in* in = reinterpret_cast<grpc_sockaddr_in*>(addr->addr);
+ in->sin_family = GRPC_AF_INET;
+ if (grpc_inet_pton(GRPC_AF_INET, host.c_str(), &in->sin_addr) == 0) {
+ if (log_errors) {
+ gpr_log(GPR_ERROR, "invalid ipv4 address: '%s'", host.c_str());
+ }
+ goto done;
+ }
+ // Parse port.
+ if (port.empty()) {
+ if (log_errors) gpr_log(GPR_ERROR, "no port given for ipv4 scheme");
+ goto done;
+ }
+ int port_num;
+ if (sscanf(port.c_str(), "%d", &port_num) != 1 || port_num < 0 ||
+ port_num > 65535) {
+ if (log_errors) gpr_log(GPR_ERROR, "invalid ipv4 port: '%s'", port.c_str());
+ goto done;
+ }
+ in->sin_port = grpc_htons(static_cast<uint16_t>(port_num));
+ success = true;
+done:
+ return success;
+}
+
+bool grpc_parse_ipv4(const grpc_uri* uri,
+ grpc_resolved_address* resolved_addr) {
+ if (strcmp("ipv4", uri->scheme) != 0) {
+ gpr_log(GPR_ERROR, "Expected 'ipv4' scheme, got '%s'", uri->scheme);
+ return false;
+ }
+ const char* host_port = uri->path;
+ if (*host_port == '/') ++host_port;
+ return grpc_parse_ipv4_hostport(host_port, resolved_addr,
+ true /* log_errors */);
+}
+
+bool grpc_parse_ipv6_hostport(const char* hostport, grpc_resolved_address* addr,
+ bool log_errors) {
+ bool success = false;
+ // Split host and port.
+ TString host;
+ TString port;
+ if (!grpc_core::SplitHostPort(hostport, &host, &port)) {
+ if (log_errors) {
+ gpr_log(GPR_ERROR, "Failed gpr_split_host_port(%s, ...)", hostport);
+ }
+ return false;
+ }
+ // Parse IP address.
+ memset(addr, 0, sizeof(*addr));
+ addr->len = static_cast<socklen_t>(sizeof(grpc_sockaddr_in6));
+ grpc_sockaddr_in6* in6 = reinterpret_cast<grpc_sockaddr_in6*>(addr->addr);
+ in6->sin6_family = GRPC_AF_INET6;
+ // Handle the RFC6874 syntax for IPv6 zone identifiers.
+ char* host_end =
+ static_cast<char*>(gpr_memrchr(host.c_str(), '%', host.size()));
+ if (host_end != nullptr) {
+ GPR_ASSERT(host_end >= host.c_str());
+ char host_without_scope[GRPC_INET6_ADDRSTRLEN + 1];
+ size_t host_without_scope_len =
+ static_cast<size_t>(host_end - host.c_str());
+ uint32_t sin6_scope_id = 0;
+ if (host_without_scope_len > GRPC_INET6_ADDRSTRLEN) {
+ if (log_errors) {
+ gpr_log(
+ GPR_ERROR,
+ "invalid ipv6 address length %zu. Length cannot be greater than "
+ "GRPC_INET6_ADDRSTRLEN i.e %d)",
+ host_without_scope_len, GRPC_INET6_ADDRSTRLEN);
+ }
+ goto done;
+ }
+ strncpy(host_without_scope, host.c_str(), host_without_scope_len);
+ host_without_scope[host_without_scope_len] = '\0';
+ if (grpc_inet_pton(GRPC_AF_INET6, host_without_scope, &in6->sin6_addr) ==
+ 0) {
+ if (log_errors) {
+ gpr_log(GPR_ERROR, "invalid ipv6 address: '%s'", host_without_scope);
+ }
+ goto done;
+ }
+ if (gpr_parse_bytes_to_uint32(host_end + 1,
+ host.size() - host_without_scope_len - 1,
+ &sin6_scope_id) == 0) {
+ if ((sin6_scope_id = grpc_if_nametoindex(host_end + 1)) == 0) {
+ gpr_log(GPR_ERROR,
+ "Invalid interface name: '%s'. "
+ "Non-numeric and failed if_nametoindex.",
+ host_end + 1);
+ goto done;
+ }
+ }
+ // Handle "sin6_scope_id" being type "u_long". See grpc issue #10027.
+ in6->sin6_scope_id = sin6_scope_id;
+ } else {
+ if (grpc_inet_pton(GRPC_AF_INET6, host.c_str(), &in6->sin6_addr) == 0) {
+ if (log_errors) {
+ gpr_log(GPR_ERROR, "invalid ipv6 address: '%s'", host.c_str());
+ }
+ goto done;
+ }
+ }
+ // Parse port.
+ if (port.empty()) {
+ if (log_errors) gpr_log(GPR_ERROR, "no port given for ipv6 scheme");
+ goto done;
+ }
+ int port_num;
+ if (sscanf(port.c_str(), "%d", &port_num) != 1 || port_num < 0 ||
+ port_num > 65535) {
+ if (log_errors) gpr_log(GPR_ERROR, "invalid ipv6 port: '%s'", port.c_str());
+ goto done;
+ }
+ in6->sin6_port = grpc_htons(static_cast<uint16_t>(port_num));
+ success = true;
+done:
+ return success;
+}
+
+bool grpc_parse_ipv6(const grpc_uri* uri,
+ grpc_resolved_address* resolved_addr) {
+ if (strcmp("ipv6", uri->scheme) != 0) {
+ gpr_log(GPR_ERROR, "Expected 'ipv6' scheme, got '%s'", uri->scheme);
+ return false;
+ }
+ const char* host_port = uri->path;
+ if (*host_port == '/') ++host_port;
+ return grpc_parse_ipv6_hostport(host_port, resolved_addr,
+ true /* log_errors */);
+}
+
+bool grpc_parse_uri(const grpc_uri* uri, grpc_resolved_address* resolved_addr) {
+ if (strcmp("unix", uri->scheme) == 0) {
+ return grpc_parse_unix(uri, resolved_addr);
+ } else if (strcmp("ipv4", uri->scheme) == 0) {
+ return grpc_parse_ipv4(uri, resolved_addr);
+ } else if (strcmp("ipv6", uri->scheme) == 0) {
+ return grpc_parse_ipv6(uri, resolved_addr);
+ }
+ gpr_log(GPR_ERROR, "Can't parse scheme '%s'", uri->scheme);
+ return false;
+}
+
+uint16_t grpc_strhtons(const char* port) {
+ if (strcmp(port, "http") == 0) {
+ return htons(80);
+ } else if (strcmp(port, "https") == 0) {
+ return htons(443);
+ }
+ return htons(static_cast<unsigned short>(atoi(port)));
+}
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/parse_address.h b/contrib/libs/grpc/src/core/lib/iomgr/parse_address.h
index 5795fd7889f..d42daac46ae 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/parse_address.h
+++ b/contrib/libs/grpc/src/core/lib/iomgr/parse_address.h
@@ -1,53 +1,53 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#ifndef GRPC_CORE_LIB_IOMGR_PARSE_ADDRESS_H
-#define GRPC_CORE_LIB_IOMGR_PARSE_ADDRESS_H
-
-#include <grpc/support/port_platform.h>
-
-#include <stddef.h>
-
-#include "src/core/lib/iomgr/resolve_address.h"
-#include "src/core/lib/uri/uri_parser.h"
-
-/** Populate \a resolved_addr from \a uri, whose path is expected to contain a
- * unix socket path. Returns true upon success. */
-bool grpc_parse_unix(const grpc_uri* uri, grpc_resolved_address* resolved_addr);
-
-/** Populate \a resolved_addr from \a uri, whose path is expected to contain an
- * IPv4 host:port pair. Returns true upon success. */
-bool grpc_parse_ipv4(const grpc_uri* uri, grpc_resolved_address* resolved_addr);
-
-/** Populate \a resolved_addr from \a uri, whose path is expected to contain an
- * IPv6 host:port pair. Returns true upon success. */
-bool grpc_parse_ipv6(const grpc_uri* uri, grpc_resolved_address* resolved_addr);
-
-/** Populate \a resolved_addr from \a uri. Returns true upon success. */
-bool grpc_parse_uri(const grpc_uri* uri, grpc_resolved_address* resolved_addr);
-
-/** Parse bare IPv4 or IPv6 "IP:port" strings. */
-bool grpc_parse_ipv4_hostport(const char* hostport, grpc_resolved_address* addr,
- bool log_errors);
-bool grpc_parse_ipv6_hostport(const char* hostport, grpc_resolved_address* addr,
- bool log_errors);
-
-/* Converts named or numeric port to a uint16 suitable for use in a sockaddr. */
-uint16_t grpc_strhtons(const char* port);
-
-#endif /* GRPC_CORE_LIB_IOMGR_PARSE_ADDRESS_H */
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef GRPC_CORE_LIB_IOMGR_PARSE_ADDRESS_H
+#define GRPC_CORE_LIB_IOMGR_PARSE_ADDRESS_H
+
+#include <grpc/support/port_platform.h>
+
+#include <stddef.h>
+
+#include "src/core/lib/iomgr/resolve_address.h"
+#include "src/core/lib/uri/uri_parser.h"
+
+/** Populate \a resolved_addr from \a uri, whose path is expected to contain a
+ * unix socket path. Returns true upon success. */
+bool grpc_parse_unix(const grpc_uri* uri, grpc_resolved_address* resolved_addr);
+
+/** Populate \a resolved_addr from \a uri, whose path is expected to contain an
+ * IPv4 host:port pair. Returns true upon success. */
+bool grpc_parse_ipv4(const grpc_uri* uri, grpc_resolved_address* resolved_addr);
+
+/** Populate \a resolved_addr from \a uri, whose path is expected to contain an
+ * IPv6 host:port pair. Returns true upon success. */
+bool grpc_parse_ipv6(const grpc_uri* uri, grpc_resolved_address* resolved_addr);
+
+/** Populate \a resolved_addr from \a uri. Returns true upon success. */
+bool grpc_parse_uri(const grpc_uri* uri, grpc_resolved_address* resolved_addr);
+
+/** Parse bare IPv4 or IPv6 "IP:port" strings. */
+bool grpc_parse_ipv4_hostport(const char* hostport, grpc_resolved_address* addr,
+ bool log_errors);
+bool grpc_parse_ipv6_hostport(const char* hostport, grpc_resolved_address* addr,
+ bool log_errors);
+
+/* Converts named or numeric port to a uint16 suitable for use in a sockaddr. */
+uint16_t grpc_strhtons(const char* port);
+
+#endif /* GRPC_CORE_LIB_IOMGR_PARSE_ADDRESS_H */
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/poller/eventmanager_libuv.cc b/contrib/libs/grpc/src/core/lib/iomgr/poller/eventmanager_libuv.cc
index 992d532ab72..e7045df5855 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/poller/eventmanager_libuv.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/poller/eventmanager_libuv.cc
@@ -1,87 +1,87 @@
-/*
- *
- * Copyright 2019 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <grpc/support/port_platform.h>
-
-#include "src/core/lib/iomgr/poller/eventmanager_libuv.h"
-
-#include <grpc/support/time.h>
-
-grpc::experimental::LibuvEventManager::Options::Options() : num_workers_(-1) {}
-grpc::experimental::LibuvEventManager::Options::Options(int num_workers)
- : num_workers_(num_workers) {}
-
-grpc::experimental::LibuvEventManager::LibuvEventManager(const Options& options)
- : options_(options) {
- int num_workers = options_.num_workers();
- // Number of workers can't be 0 if we do not accept thread donation.
- // TODO(guantaol): replaces the hard-coded number with a flag.
- if (num_workers <= 0) num_workers = 32;
-
- for (int i = 0; i < num_workers; i++) {
- workers_.emplace_back(
- options_.thread_name_prefix().c_str(),
- [](void* em) { static_cast<LibuvEventManager*>(em)->RunWorkerLoop(); },
- this);
- workers_.back().Start();
- }
-}
-
-grpc::experimental::LibuvEventManager::~LibuvEventManager() {
- Shutdown();
- for (auto& th : workers_) {
- th.Join();
- }
-}
-
-void grpc::experimental::LibuvEventManager::RunWorkerLoop() {
- while (true) {
- // TODO(guantaol): extend the worker loop with real work.
- if (ShouldStop()) return;
- gpr_sleep_until(gpr_time_add(gpr_now(GPR_CLOCK_MONOTONIC),
- gpr_time_from_micros(10, GPR_TIMESPAN)));
- }
-}
-
-bool grpc::experimental::LibuvEventManager::ShouldStop() {
- return should_stop_.Load(grpc_core::MemoryOrder::ACQUIRE) != 0;
-}
-
-void grpc::experimental::LibuvEventManager::Shutdown() {
- if (should_stop_.Load(grpc_core::MemoryOrder::ACQUIRE))
- return; // Already shut down.
-
- {
- grpc_core::MutexLock lock(&shutdown_mu_);
- while (shutdown_refcount_.Load(grpc_core::MemoryOrder::ACQUIRE) > 0) {
- shutdown_cv_.Wait(&shutdown_mu_);
- }
- }
- should_stop_.Store(true, grpc_core::MemoryOrder::RELEASE);
-}
-
-void grpc::experimental::LibuvEventManager::ShutdownRef() {
- shutdown_refcount_.FetchAdd(1, grpc_core::MemoryOrder::RELAXED);
-}
-
-void grpc::experimental::LibuvEventManager::ShutdownUnref() {
- if (shutdown_refcount_.FetchSub(1, grpc_core::MemoryOrder::ACQ_REL) == 1) {
- grpc_core::MutexLock lock(&shutdown_mu_);
- shutdown_cv_.Signal();
- }
-}
+/*
+ *
+ * Copyright 2019 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/lib/iomgr/poller/eventmanager_libuv.h"
+
+#include <grpc/support/time.h>
+
+grpc::experimental::LibuvEventManager::Options::Options() : num_workers_(-1) {}
+grpc::experimental::LibuvEventManager::Options::Options(int num_workers)
+ : num_workers_(num_workers) {}
+
+grpc::experimental::LibuvEventManager::LibuvEventManager(const Options& options)
+ : options_(options) {
+ int num_workers = options_.num_workers();
+ // Number of workers can't be 0 if we do not accept thread donation.
+ // TODO(guantaol): replaces the hard-coded number with a flag.
+ if (num_workers <= 0) num_workers = 32;
+
+ for (int i = 0; i < num_workers; i++) {
+ workers_.emplace_back(
+ options_.thread_name_prefix().c_str(),
+ [](void* em) { static_cast<LibuvEventManager*>(em)->RunWorkerLoop(); },
+ this);
+ workers_.back().Start();
+ }
+}
+
+grpc::experimental::LibuvEventManager::~LibuvEventManager() {
+ Shutdown();
+ for (auto& th : workers_) {
+ th.Join();
+ }
+}
+
+void grpc::experimental::LibuvEventManager::RunWorkerLoop() {
+ while (true) {
+ // TODO(guantaol): extend the worker loop with real work.
+ if (ShouldStop()) return;
+ gpr_sleep_until(gpr_time_add(gpr_now(GPR_CLOCK_MONOTONIC),
+ gpr_time_from_micros(10, GPR_TIMESPAN)));
+ }
+}
+
+bool grpc::experimental::LibuvEventManager::ShouldStop() {
+ return should_stop_.Load(grpc_core::MemoryOrder::ACQUIRE) != 0;
+}
+
+void grpc::experimental::LibuvEventManager::Shutdown() {
+ if (should_stop_.Load(grpc_core::MemoryOrder::ACQUIRE))
+ return; // Already shut down.
+
+ {
+ grpc_core::MutexLock lock(&shutdown_mu_);
+ while (shutdown_refcount_.Load(grpc_core::MemoryOrder::ACQUIRE) > 0) {
+ shutdown_cv_.Wait(&shutdown_mu_);
+ }
+ }
+ should_stop_.Store(true, grpc_core::MemoryOrder::RELEASE);
+}
+
+void grpc::experimental::LibuvEventManager::ShutdownRef() {
+ shutdown_refcount_.FetchAdd(1, grpc_core::MemoryOrder::RELAXED);
+}
+
+void grpc::experimental::LibuvEventManager::ShutdownUnref() {
+ if (shutdown_refcount_.FetchSub(1, grpc_core::MemoryOrder::ACQ_REL) == 1) {
+ grpc_core::MutexLock lock(&shutdown_mu_);
+ shutdown_cv_.Signal();
+ }
+}
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/poller/eventmanager_libuv.h b/contrib/libs/grpc/src/core/lib/iomgr/poller/eventmanager_libuv.h
index ee6f8037d87..88988a1890f 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/poller/eventmanager_libuv.h
+++ b/contrib/libs/grpc/src/core/lib/iomgr/poller/eventmanager_libuv.h
@@ -1,88 +1,88 @@
-/*
- *
- * Copyright 2019 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#ifndef GRPC_CORE_LIB_IOMGR_POLLER_EVENTMANAGER_LIBUV_H
-#define GRPC_CORE_LIB_IOMGR_POLLER_EVENTMANAGER_LIBUV_H
-
-#include <grpc/support/port_platform.h>
-
-#include <util/generic/string.h>
-#include <vector>
-
-#include "src/core/lib/gprpp/atomic.h"
-#include "src/core/lib/gprpp/sync.h"
-#include "src/core/lib/gprpp/thd.h"
-
-namespace grpc {
-namespace experimental {
-
-class LibuvEventManager {
- public:
- class Options {
- public:
- Options();
- Options(int num_workers);
-
- int num_workers() const { return num_workers_; }
- void set_num_workers(int num) { num_workers_ = num; }
-
- const TString& thread_name_prefix() const {
- return thread_name_prefix_;
- }
- void set_thread_name_prefix(const TString& name) {
- thread_name_prefix_ = name;
- }
-
- private:
- // Number of worker threads to create at startup. If less than 0, uses the
- // default value of 32.
- int num_workers_;
- // Name prefix used for worker.
- TString thread_name_prefix_;
- };
-
- explicit LibuvEventManager(const Options& options);
- virtual ~LibuvEventManager();
-
- void Shutdown();
- void ShutdownRef();
- void ShutdownUnref();
-
- private:
- // Function run by the worker threads.
- void RunWorkerLoop();
-
- // Whether the EventManager has been shut down.
- bool ShouldStop();
-
- const Options options_;
- // Whether the EventManager workers should be stopped.
- grpc_core::Atomic<bool> should_stop_{false};
- // A refcount preventing the EventManager from shutdown.
- grpc_core::Atomic<int> shutdown_refcount_{0};
- // Worker threads of the EventManager.
- std::vector<grpc_core::Thread> workers_;
- // Mutex and condition variable used for shutdown.
- grpc_core::Mutex shutdown_mu_;
- grpc_core::CondVar shutdown_cv_;
-};
-
-} // namespace experimental
-} // namespace grpc
-
-#endif /* GRPC_CORE_LIB_IOMGR_POLLER_EVENTMANAGER_LIBUV_H */
+/*
+ *
+ * Copyright 2019 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef GRPC_CORE_LIB_IOMGR_POLLER_EVENTMANAGER_LIBUV_H
+#define GRPC_CORE_LIB_IOMGR_POLLER_EVENTMANAGER_LIBUV_H
+
+#include <grpc/support/port_platform.h>
+
+#include <util/generic/string.h>
+#include <vector>
+
+#include "src/core/lib/gprpp/atomic.h"
+#include "src/core/lib/gprpp/sync.h"
+#include "src/core/lib/gprpp/thd.h"
+
+namespace grpc {
+namespace experimental {
+
+class LibuvEventManager {
+ public:
+ class Options {
+ public:
+ Options();
+ Options(int num_workers);
+
+ int num_workers() const { return num_workers_; }
+ void set_num_workers(int num) { num_workers_ = num; }
+
+ const TString& thread_name_prefix() const {
+ return thread_name_prefix_;
+ }
+ void set_thread_name_prefix(const TString& name) {
+ thread_name_prefix_ = name;
+ }
+
+ private:
+ // Number of worker threads to create at startup. If less than 0, uses the
+ // default value of 32.
+ int num_workers_;
+ // Name prefix used for worker.
+ TString thread_name_prefix_;
+ };
+
+ explicit LibuvEventManager(const Options& options);
+ virtual ~LibuvEventManager();
+
+ void Shutdown();
+ void ShutdownRef();
+ void ShutdownUnref();
+
+ private:
+ // Function run by the worker threads.
+ void RunWorkerLoop();
+
+ // Whether the EventManager has been shut down.
+ bool ShouldStop();
+
+ const Options options_;
+ // Whether the EventManager workers should be stopped.
+ grpc_core::Atomic<bool> should_stop_{false};
+ // A refcount preventing the EventManager from shutdown.
+ grpc_core::Atomic<int> shutdown_refcount_{0};
+ // Worker threads of the EventManager.
+ std::vector<grpc_core::Thread> workers_;
+ // Mutex and condition variable used for shutdown.
+ grpc_core::Mutex shutdown_mu_;
+ grpc_core::CondVar shutdown_cv_;
+};
+
+} // namespace experimental
+} // namespace grpc
+
+#endif /* GRPC_CORE_LIB_IOMGR_POLLER_EVENTMANAGER_LIBUV_H */
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/pollset_set_custom.cc b/contrib/libs/grpc/src/core/lib/iomgr/pollset_set_custom.cc
index 6ef086b1a96..2c1df608197 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/pollset_set_custom.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/pollset_set_custom.cc
@@ -22,23 +22,23 @@
#include "src/core/lib/iomgr/pollset_set.h"
-static grpc_pollset_set* pollset_set_create(void) {
+static grpc_pollset_set* pollset_set_create(void) {
return (grpc_pollset_set*)((intptr_t)0xdeafbeef);
}
-static void pollset_set_destroy(grpc_pollset_set* /*pollset_set*/) {}
+static void pollset_set_destroy(grpc_pollset_set* /*pollset_set*/) {}
-static void pollset_set_add_pollset(grpc_pollset_set* /*pollset_set*/,
- grpc_pollset* /*pollset*/) {}
+static void pollset_set_add_pollset(grpc_pollset_set* /*pollset_set*/,
+ grpc_pollset* /*pollset*/) {}
-static void pollset_set_del_pollset(grpc_pollset_set* /*pollset_set*/,
- grpc_pollset* /*pollset*/) {}
+static void pollset_set_del_pollset(grpc_pollset_set* /*pollset_set*/,
+ grpc_pollset* /*pollset*/) {}
-static void pollset_set_add_pollset_set(grpc_pollset_set* /*bag*/,
- grpc_pollset_set* /*item*/) {}
+static void pollset_set_add_pollset_set(grpc_pollset_set* /*bag*/,
+ grpc_pollset_set* /*item*/) {}
-static void pollset_set_del_pollset_set(grpc_pollset_set* /*bag*/,
- grpc_pollset_set* /*item*/) {}
+static void pollset_set_del_pollset_set(grpc_pollset_set* /*bag*/,
+ grpc_pollset_set* /*item*/) {}
static grpc_pollset_set_vtable vtable = {
pollset_set_create, pollset_set_destroy,
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/port.h b/contrib/libs/grpc/src/core/lib/iomgr/port.h
index ea7d92b1ed4..2a8d67b261c 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/port.h
+++ b/contrib/libs/grpc/src/core/lib/iomgr/port.h
@@ -84,7 +84,7 @@
*/
#define GRPC_LINUX_TCP_H 1
#endif /* __GLIBC_PREREQ(2, 17) */
-#endif
+#endif
#ifndef __GLIBC__
#define GRPC_LINUX_EPOLL 1
#define GRPC_LINUX_EPOLL_CREATE1 1
@@ -109,7 +109,7 @@
#define GRPC_CFSTREAM_IOMGR 1
#define GRPC_CFSTREAM_CLIENT 1
#define GRPC_CFSTREAM_ENDPOINT 1
-#define GRPC_APPLE_EV 1
+#define GRPC_APPLE_EV 1
#define GRPC_POSIX_SOCKET_ARES_EV_DRIVER 1
#define GRPC_POSIX_SOCKET_EV 1
#define GRPC_POSIX_SOCKET_EV_EPOLL1 1
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/resolve_address_custom.cc b/contrib/libs/grpc/src/core/lib/iomgr/resolve_address_custom.cc
index 06d00f005f9..69b4382b2be 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/resolve_address_custom.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/resolve_address_custom.cc
@@ -18,30 +18,30 @@
#include <grpc/support/port_platform.h>
-#include "src/core/lib/iomgr/resolve_address_custom.h"
-
-#include <string.h>
-
-#include <util/generic/string.h>
-
-#include "y_absl/strings/str_format.h"
-
+#include "src/core/lib/iomgr/resolve_address_custom.h"
+
+#include <string.h>
+
+#include <util/generic/string.h>
+
+#include "y_absl/strings/str_format.h"
+
#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
+#include <grpc/support/log.h>
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/gprpp/host_port.h"
#include "src/core/lib/iomgr/iomgr_custom.h"
-#include "src/core/lib/iomgr/port.h"
+#include "src/core/lib/iomgr/port.h"
#include "src/core/lib/iomgr/sockaddr_utils.h"
-struct grpc_custom_resolver {
- grpc_closure* on_done = nullptr;
- grpc_resolved_addresses** addresses = nullptr;
- TString host;
- TString port;
-};
+struct grpc_custom_resolver {
+ grpc_closure* on_done = nullptr;
+ grpc_resolved_addresses** addresses = nullptr;
+ TString host;
+ TString port;
+};
static grpc_custom_resolver_vtable* resolve_address_vtable = nullptr;
@@ -50,18 +50,18 @@ static int retry_named_port_failure(grpc_custom_resolver* r,
// This loop is copied from resolve_address_posix.c
const char* svc[][2] = {{"http", "80"}, {"https", "443"}};
for (size_t i = 0; i < GPR_ARRAY_SIZE(svc); i++) {
- if (r->port == svc[i][0]) {
- r->port = svc[i][1];
+ if (r->port == svc[i][0]) {
+ r->port = svc[i][1];
if (res) {
- grpc_error* error = resolve_address_vtable->resolve(
- r->host.c_str(), r->port.c_str(), res);
+ grpc_error* error = resolve_address_vtable->resolve(
+ r->host.c_str(), r->port.c_str(), res);
if (error != GRPC_ERROR_NONE) {
GRPC_ERROR_UNREF(error);
return 0;
}
} else {
- resolve_address_vtable->resolve_async(r, r->host.c_str(),
- r->port.c_str());
+ resolve_address_vtable->resolve_async(r, r->host.c_str(),
+ r->port.c_str());
}
return 1;
}
@@ -83,25 +83,25 @@ void grpc_custom_resolve_callback(grpc_custom_resolver* r,
if (r->on_done) {
grpc_core::ExecCtx::Run(DEBUG_LOCATION, r->on_done, error);
}
- delete r;
+ delete r;
}
static grpc_error* try_split_host_port(const char* name,
const char* default_port,
- TString* host, TString* port) {
+ TString* host, TString* port) {
/* parse name, splitting it into host and port parts */
grpc_core::SplitHostPort(name, host, port);
- if (host->empty()) {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrFormat("unparseable host:port: '%s'", name).c_str());
+ if (host->empty()) {
+ return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrFormat("unparseable host:port: '%s'", name).c_str());
}
- if (port->empty()) {
+ if (port->empty()) {
// TODO(murgatroid99): add tests for this case
if (default_port == nullptr) {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrFormat("no port in name '%s'", name).c_str());
+ return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrFormat("no port in name '%s'", name).c_str());
}
- *port = default_port;
+ *port = default_port;
}
return GRPC_ERROR_NONE;
}
@@ -111,9 +111,9 @@ static grpc_error* blocking_resolve_address_impl(
grpc_resolved_addresses** addresses) {
GRPC_CUSTOM_IOMGR_ASSERT_SAME_THREAD();
- grpc_custom_resolver resolver;
- grpc_error* err =
- try_split_host_port(name, default_port, &resolver.host, &resolver.port);
+ grpc_custom_resolver resolver;
+ grpc_error* err =
+ try_split_host_port(name, default_port, &resolver.host, &resolver.port);
if (err != GRPC_ERROR_NONE) {
return err;
}
@@ -122,8 +122,8 @@ static grpc_error* blocking_resolve_address_impl(
grpc_resolved_addresses* addrs;
grpc_core::ExecCtx* curr = grpc_core::ExecCtx::Get();
grpc_core::ExecCtx::Set(nullptr);
- err = resolve_address_vtable->resolve(resolver.host.c_str(),
- resolver.port.c_str(), &addrs);
+ err = resolve_address_vtable->resolve(resolver.host.c_str(),
+ resolver.port.c_str(), &addrs);
if (err != GRPC_ERROR_NONE) {
if (retry_named_port_failure(&resolver, &addrs)) {
GRPC_ERROR_UNREF(err);
@@ -142,21 +142,21 @@ static void resolve_address_impl(const char* name, const char* default_port,
grpc_closure* on_done,
grpc_resolved_addresses** addrs) {
GRPC_CUSTOM_IOMGR_ASSERT_SAME_THREAD();
- TString host;
- TString port;
- grpc_error* err = try_split_host_port(name, default_port, &host, &port);
+ TString host;
+ TString port;
+ grpc_error* err = try_split_host_port(name, default_port, &host, &port);
if (err != GRPC_ERROR_NONE) {
grpc_core::ExecCtx::Run(DEBUG_LOCATION, on_done, err);
return;
}
- grpc_custom_resolver* r = new grpc_custom_resolver();
+ grpc_custom_resolver* r = new grpc_custom_resolver();
r->on_done = on_done;
r->addresses = addrs;
- r->host = std::move(host);
- r->port = std::move(port);
+ r->host = std::move(host);
+ r->port = std::move(port);
/* Call getaddrinfo */
- resolve_address_vtable->resolve_async(r, r->host.c_str(), r->port.c_str());
+ resolve_address_vtable->resolve_async(r, r->host.c_str(), r->port.c_str());
}
static grpc_address_resolver_vtable custom_resolver_vtable = {
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/resolve_address_custom.h b/contrib/libs/grpc/src/core/lib/iomgr/resolve_address_custom.h
index 48a7bb76047..f5f68ca32dd 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/resolve_address_custom.h
+++ b/contrib/libs/grpc/src/core/lib/iomgr/resolve_address_custom.h
@@ -29,10 +29,10 @@
typedef struct grpc_custom_resolver grpc_custom_resolver;
typedef struct grpc_custom_resolver_vtable {
- grpc_error* (*resolve)(const char* host, const char* port,
- grpc_resolved_addresses** res);
- void (*resolve_async)(grpc_custom_resolver* resolver, const char* host,
- const char* port);
+ grpc_error* (*resolve)(const char* host, const char* port,
+ grpc_resolved_addresses** res);
+ void (*resolve_async)(grpc_custom_resolver* resolver, const char* host,
+ const char* port);
} grpc_custom_resolver_vtable;
void grpc_custom_resolve_callback(grpc_custom_resolver* resolver,
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/resolve_address_posix.cc b/contrib/libs/grpc/src/core/lib/iomgr/resolve_address_posix.cc
index 0bfba602d21..4f290873919 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/resolve_address_posix.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/resolve_address_posix.cc
@@ -57,24 +57,24 @@ static grpc_error* posix_blocking_resolve_address(
return grpc_resolve_unix_domain_address(name + 5, addresses);
}
- TString host;
- TString port;
+ TString host;
+ TString port;
/* parse name, splitting it into host and port parts */
grpc_core::SplitHostPort(name, &host, &port);
- if (host.empty()) {
+ if (host.empty()) {
err = grpc_error_set_str(
GRPC_ERROR_CREATE_FROM_STATIC_STRING("unparseable host:port"),
GRPC_ERROR_STR_TARGET_ADDRESS, grpc_slice_from_copied_string(name));
goto done;
}
- if (port.empty()) {
+ if (port.empty()) {
if (default_port == nullptr) {
err = grpc_error_set_str(
GRPC_ERROR_CREATE_FROM_STATIC_STRING("no port in name"),
GRPC_ERROR_STR_TARGET_ADDRESS, grpc_slice_from_copied_string(name));
goto done;
}
- port = default_port;
+ port = default_port;
}
/* Call getaddrinfo */
@@ -84,16 +84,16 @@ static grpc_error* posix_blocking_resolve_address(
hints.ai_flags = AI_PASSIVE; /* for wildcard IP address */
GRPC_SCHEDULING_START_BLOCKING_REGION;
- s = getaddrinfo(host.c_str(), port.c_str(), &hints, &result);
+ s = getaddrinfo(host.c_str(), port.c_str(), &hints, &result);
GRPC_SCHEDULING_END_BLOCKING_REGION;
if (s != 0) {
/* Retry if well-known service name is recognized */
const char* svc[][2] = {{"http", "80"}, {"https", "443"}};
for (i = 0; i < GPR_ARRAY_SIZE(svc); i++) {
- if (port == svc[i][0]) {
+ if (port == svc[i][0]) {
GRPC_SCHEDULING_START_BLOCKING_REGION;
- s = getaddrinfo(host.c_str(), svc[i][1], &hints, &result);
+ s = getaddrinfo(host.c_str(), svc[i][1], &hints, &result);
GRPC_SCHEDULING_END_BLOCKING_REGION;
break;
}
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/resolve_address_windows.cc b/contrib/libs/grpc/src/core/lib/iomgr/resolve_address_windows.cc
index 6d7bbf1b968..9922b88065b 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/resolve_address_windows.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/resolve_address_windows.cc
@@ -29,10 +29,10 @@
#include <string.h>
#include <sys/types.h>
-#include <util/generic/string.h>
-
-#include "y_absl/strings/str_format.h"
-
+#include <util/generic/string.h>
+
+#include "y_absl/strings/str_format.h"
+
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/log_windows.h>
@@ -65,21 +65,21 @@ static grpc_error* windows_blocking_resolve_address(
grpc_error* error = GRPC_ERROR_NONE;
/* parse name, splitting it into host and port parts */
- TString host;
- TString port;
+ TString host;
+ TString port;
grpc_core::SplitHostPort(name, &host, &port);
- if (host.empty()) {
- error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrFormat("unparseable host:port: '%s'", name).c_str());
+ if (host.empty()) {
+ error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrFormat("unparseable host:port: '%s'", name).c_str());
goto done;
}
- if (port.empty()) {
+ if (port.empty()) {
if (default_port == NULL) {
- error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrFormat("no port in name '%s'", name).c_str());
+ error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrFormat("no port in name '%s'", name).c_str());
goto done;
}
- port = default_port;
+ port = default_port;
}
/* Call getaddrinfo */
@@ -89,7 +89,7 @@ static grpc_error* windows_blocking_resolve_address(
hints.ai_flags = AI_PASSIVE; /* for wildcard IP address */
GRPC_SCHEDULING_START_BLOCKING_REGION;
- s = getaddrinfo(host.c_str(), port.c_str(), &hints, &result);
+ s = getaddrinfo(host.c_str(), port.c_str(), &hints, &result);
GRPC_SCHEDULING_END_BLOCKING_REGION;
if (s != 0) {
error = GRPC_WSA_ERROR(WSAGetLastError(), "getaddrinfo");
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/resource_quota.cc b/contrib/libs/grpc/src/core/lib/iomgr/resource_quota.cc
index 724357ee159..f416e096f46 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/resource_quota.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/resource_quota.cc
@@ -25,10 +25,10 @@
#include <stdint.h>
#include <string.h>
-#include <util/generic/string.h>
-
-#include "y_absl/strings/str_cat.h"
-
+#include <util/generic/string.h>
+
+#include "y_absl/strings/str_cat.h"
+
#include <grpc/slice_buffer.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
@@ -121,7 +121,7 @@ struct grpc_resource_user {
grpc_resource_user_link links[GRPC_RULIST_COUNT];
/* The name of this resource user, for debugging/tracing */
- TString name;
+ TString name;
};
struct grpc_resource_quota {
@@ -184,7 +184,7 @@ struct grpc_resource_quota {
/* Roots of all resource user lists */
grpc_resource_user* roots[GRPC_RULIST_COUNT];
- TString name;
+ TString name;
};
static void ru_unref_by(grpc_resource_user* resource_user, gpr_atm amount);
@@ -323,9 +323,9 @@ static bool rq_alloc(grpc_resource_quota* resource_quota) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_resource_quota_trace)) {
gpr_log(GPR_INFO,
"RQ: check allocation for user %p shutdown=%" PRIdPTR
- " free_pool=%" PRId64 " outstanding_allocations=%" PRId64,
+ " free_pool=%" PRId64 " outstanding_allocations=%" PRId64,
resource_user, gpr_atm_no_barrier_load(&resource_user->shutdown),
- resource_user->free_pool, resource_user->outstanding_allocations);
+ resource_user->free_pool, resource_user->outstanding_allocations);
}
if (gpr_atm_no_barrier_load(&resource_user->shutdown)) {
resource_user->allocating = false;
@@ -337,9 +337,9 @@ static bool rq_alloc(grpc_resource_quota* resource_quota) {
resource_user->free_pool += aborted_allocations;
grpc_core::ExecCtx::RunList(DEBUG_LOCATION, &resource_user->on_allocated);
gpr_mu_unlock(&resource_user->mu);
- if (aborted_allocations > 0) {
- ru_unref_by(resource_user, static_cast<gpr_atm>(aborted_allocations));
- }
+ if (aborted_allocations > 0) {
+ ru_unref_by(resource_user, static_cast<gpr_atm>(aborted_allocations));
+ }
continue;
}
if (resource_user->free_pool < 0 &&
@@ -352,13 +352,13 @@ static bool rq_alloc(grpc_resource_quota* resource_quota) {
gpr_log(GPR_INFO,
"RQ %s %s: grant alloc %" PRId64
" bytes; rq_free_pool -> %" PRId64,
- resource_quota->name.c_str(), resource_user->name.c_str(), amt,
+ resource_quota->name.c_str(), resource_user->name.c_str(), amt,
resource_quota->free_pool);
}
} else if (GRPC_TRACE_FLAG_ENABLED(grpc_resource_quota_trace) &&
resource_user->free_pool >= 0) {
gpr_log(GPR_INFO, "RQ %s %s: discard already satisfied alloc request",
- resource_quota->name.c_str(), resource_user->name.c_str());
+ resource_quota->name.c_str(), resource_user->name.c_str());
}
if (resource_user->free_pool >= 0) {
resource_user->allocating = false;
@@ -391,7 +391,7 @@ static bool rq_reclaim_from_per_user_free_pool(
gpr_log(GPR_INFO,
"RQ %s %s: reclaim_from_per_user_free_pool %" PRId64
" bytes; rq_free_pool -> %" PRId64,
- resource_quota->name.c_str(), resource_user->name.c_str(), amt,
+ resource_quota->name.c_str(), resource_user->name.c_str(), amt,
resource_quota->free_pool);
}
gpr_mu_unlock(&resource_user->mu);
@@ -401,7 +401,7 @@ static bool rq_reclaim_from_per_user_free_pool(
gpr_log(GPR_INFO,
"RQ %s %s: failed to reclaim_from_per_user_free_pool; "
"free_pool = %" PRId64 "; rq_free_pool = %" PRId64,
- resource_quota->name.c_str(), resource_user->name.c_str(),
+ resource_quota->name.c_str(), resource_user->name.c_str(),
resource_user->free_pool, resource_quota->free_pool);
}
gpr_mu_unlock(&resource_user->mu);
@@ -418,9 +418,9 @@ static bool rq_reclaim(grpc_resource_quota* resource_quota, bool destructive) {
grpc_resource_user* resource_user = rulist_pop_head(resource_quota, list);
if (resource_user == nullptr) return false;
if (GRPC_TRACE_FLAG_ENABLED(grpc_resource_quota_trace)) {
- gpr_log(GPR_INFO, "RQ %s %s: initiate %s reclamation",
- resource_quota->name.c_str(), resource_user->name.c_str(),
- destructive ? "destructive" : "benign");
+ gpr_log(GPR_INFO, "RQ %s %s: initiate %s reclamation",
+ resource_quota->name.c_str(), resource_user->name.c_str(),
+ destructive ? "destructive" : "benign");
}
resource_quota->reclaiming = true;
grpc_resource_quota_ref_internal(resource_quota);
@@ -589,7 +589,7 @@ static void ru_destroy(void* ru, grpc_error* /*error*/) {
}
grpc_resource_quota_unref_internal(resource_user->resource_quota);
gpr_mu_destroy(&resource_user->mu);
- delete resource_user;
+ delete resource_user;
}
static void ru_alloc_slices(
@@ -643,7 +643,7 @@ static void rq_reclamation_done(void* rq, grpc_error* /*error*/) {
/* Public API */
grpc_resource_quota* grpc_resource_quota_create(const char* name) {
- grpc_resource_quota* resource_quota = new grpc_resource_quota;
+ grpc_resource_quota* resource_quota = new grpc_resource_quota;
gpr_ref_init(&resource_quota->refs, 1);
resource_quota->combiner = grpc_combiner_create();
resource_quota->free_pool = INT64_MAX;
@@ -657,10 +657,10 @@ grpc_resource_quota* grpc_resource_quota_create(const char* name) {
resource_quota->reclaiming = false;
gpr_atm_no_barrier_store(&resource_quota->memory_usage_estimation, 0);
if (name != nullptr) {
- resource_quota->name = name;
+ resource_quota->name = name;
} else {
- resource_quota->name =
- y_absl::StrCat("anonymous_pool_", (intptr_t)resource_quota);
+ resource_quota->name =
+ y_absl::StrCat("anonymous_pool_", (intptr_t)resource_quota);
}
GRPC_CLOSURE_INIT(&resource_quota->rq_step_closure, rq_step, resource_quota,
nullptr);
@@ -678,7 +678,7 @@ void grpc_resource_quota_unref_internal(grpc_resource_quota* resource_quota) {
GPR_ASSERT(resource_quota->num_threads_allocated == 0);
GRPC_COMBINER_UNREF(resource_quota->combiner, "resource_quota");
gpr_mu_destroy(&resource_quota->thread_count_mu);
- delete resource_quota;
+ delete resource_quota;
}
}
@@ -775,7 +775,7 @@ const grpc_arg_pointer_vtable* grpc_resource_quota_arg_vtable(void) {
grpc_resource_user* grpc_resource_user_create(
grpc_resource_quota* resource_quota, const char* name) {
- grpc_resource_user* resource_user = new grpc_resource_user;
+ grpc_resource_user* resource_user = new grpc_resource_user;
resource_user->resource_quota =
grpc_resource_quota_ref_internal(resource_quota);
GRPC_CLOSURE_INIT(&resource_user->allocate_closure, &ru_allocate,
@@ -805,10 +805,10 @@ grpc_resource_user* grpc_resource_user_create(
resource_user->links[i].next = resource_user->links[i].prev = nullptr;
}
if (name != nullptr) {
- resource_user->name = name;
+ resource_user->name = name;
} else {
- resource_user->name =
- y_absl::StrCat("anonymous_resource_user_", (intptr_t)resource_user);
+ resource_user->name =
+ y_absl::StrCat("anonymous_resource_user_", (intptr_t)resource_user);
}
return resource_user;
}
@@ -890,8 +890,8 @@ static bool resource_user_alloc_locked(grpc_resource_user* resource_user,
resource_user->free_pool -= static_cast<int64_t>(size);
if (GRPC_TRACE_FLAG_ENABLED(grpc_resource_quota_trace)) {
gpr_log(GPR_INFO, "RQ %s %s: alloc %" PRIdPTR "; free_pool -> %" PRId64,
- resource_user->resource_quota->name.c_str(),
- resource_user->name.c_str(), size, resource_user->free_pool);
+ resource_user->resource_quota->name.c_str(),
+ resource_user->name.c_str(), size, resource_user->free_pool);
}
if (GPR_LIKELY(resource_user->free_pool >= 0)) return true;
// Slow path: We need to wait for the free pool to refill.
@@ -951,8 +951,8 @@ void grpc_resource_user_free(grpc_resource_user* resource_user, size_t size) {
resource_user->free_pool += static_cast<int64_t>(size);
if (GRPC_TRACE_FLAG_ENABLED(grpc_resource_quota_trace)) {
gpr_log(GPR_INFO, "RQ %s %s: free %" PRIdPTR "; free_pool -> %" PRId64,
- resource_user->resource_quota->name.c_str(),
- resource_user->name.c_str(), size, resource_user->free_pool);
+ resource_user->resource_quota->name.c_str(),
+ resource_user->name.c_str(), size, resource_user->free_pool);
}
bool is_bigger_than_zero = resource_user->free_pool > 0;
if (is_bigger_than_zero && was_zero_or_negative &&
@@ -977,8 +977,8 @@ void grpc_resource_user_post_reclaimer(grpc_resource_user* resource_user,
void grpc_resource_user_finish_reclamation(grpc_resource_user* resource_user) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_resource_quota_trace)) {
gpr_log(GPR_INFO, "RQ %s %s: reclamation complete",
- resource_user->resource_quota->name.c_str(),
- resource_user->name.c_str());
+ resource_user->resource_quota->name.c_str(),
+ resource_user->name.c_str());
}
resource_user->resource_quota->combiner->Run(
&resource_user->resource_quota->rq_reclamation_done_closure,
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/sockaddr_utils.cc b/contrib/libs/grpc/src/core/lib/iomgr/sockaddr_utils.cc
index 8b3c2dc965c..b43dbc99235 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/sockaddr_utils.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/sockaddr_utils.cc
@@ -24,11 +24,11 @@
#include <inttypes.h>
#include <string.h>
-#include <util/generic/string.h>
-
-#include "y_absl/strings/str_cat.h"
-#include "y_absl/strings/str_format.h"
-
+#include <util/generic/string.h>
+
+#include "y_absl/strings/str_cat.h"
+#include "y_absl/strings/str_format.h"
+
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
@@ -154,15 +154,15 @@ void grpc_sockaddr_make_wildcard6(int port,
resolved_wild_out->len = static_cast<socklen_t>(sizeof(grpc_sockaddr_in6));
}
-TString grpc_sockaddr_to_string(const grpc_resolved_address* resolved_addr,
- bool normalize) {
+TString grpc_sockaddr_to_string(const grpc_resolved_address* resolved_addr,
+ bool normalize) {
const int save_errno = errno;
grpc_resolved_address addr_normalized;
- if (normalize && grpc_sockaddr_is_v4mapped(resolved_addr, &addr_normalized)) {
- resolved_addr = &addr_normalized;
- }
- const grpc_sockaddr* addr =
- reinterpret_cast<const grpc_sockaddr*>(resolved_addr->addr);
+ if (normalize && grpc_sockaddr_is_v4mapped(resolved_addr, &addr_normalized)) {
+ resolved_addr = &addr_normalized;
+ }
+ const grpc_sockaddr* addr =
+ reinterpret_cast<const grpc_sockaddr*>(resolved_addr->addr);
const void* ip = nullptr;
int port = 0;
uint32_t sin6_scope_id = 0;
@@ -178,28 +178,28 @@ TString grpc_sockaddr_to_string(const grpc_resolved_address* resolved_addr,
port = grpc_ntohs(addr6->sin6_port);
sin6_scope_id = addr6->sin6_scope_id;
}
- char ntop_buf[GRPC_INET6_ADDRSTRLEN];
- TString out;
+ char ntop_buf[GRPC_INET6_ADDRSTRLEN];
+ TString out;
if (ip != nullptr && grpc_inet_ntop(addr->sa_family, ip, ntop_buf,
sizeof(ntop_buf)) != nullptr) {
if (sin6_scope_id != 0) {
- // Enclose sin6_scope_id with the format defined in RFC 6784 section 2.
- TString host_with_scope =
- y_absl::StrFormat("%s%%25%" PRIu32, ntop_buf, sin6_scope_id);
- out = grpc_core::JoinHostPort(host_with_scope, port);
+ // Enclose sin6_scope_id with the format defined in RFC 6784 section 2.
+ TString host_with_scope =
+ y_absl::StrFormat("%s%%25%" PRIu32, ntop_buf, sin6_scope_id);
+ out = grpc_core::JoinHostPort(host_with_scope, port);
} else {
- out = grpc_core::JoinHostPort(ntop_buf, port);
+ out = grpc_core::JoinHostPort(ntop_buf, port);
}
} else {
- out = y_absl::StrFormat("(sockaddr family=%d)", addr->sa_family);
+ out = y_absl::StrFormat("(sockaddr family=%d)", addr->sa_family);
}
/* This is probably redundant, but we wouldn't want to log the wrong error. */
errno = save_errno;
- return out;
+ return out;
}
-void grpc_string_to_sockaddr(grpc_resolved_address* out, const char* addr,
- int port) {
+void grpc_string_to_sockaddr(grpc_resolved_address* out, const char* addr,
+ int port) {
memset(out, 0, sizeof(grpc_resolved_address));
grpc_sockaddr_in6* addr6 = (grpc_sockaddr_in6*)out->addr;
grpc_sockaddr_in* addr4 = (grpc_sockaddr_in*)out->addr;
@@ -215,8 +215,8 @@ void grpc_string_to_sockaddr(grpc_resolved_address* out, const char* addr,
grpc_sockaddr_set_port(out, port);
}
-TString grpc_sockaddr_to_uri(const grpc_resolved_address* resolved_addr) {
- if (resolved_addr->len == 0) return "";
+TString grpc_sockaddr_to_uri(const grpc_resolved_address* resolved_addr) {
+ if (resolved_addr->len == 0) return "";
grpc_resolved_address addr_normalized;
if (grpc_sockaddr_is_v4mapped(resolved_addr, &addr_normalized)) {
resolved_addr = &addr_normalized;
@@ -225,13 +225,13 @@ TString grpc_sockaddr_to_uri(const grpc_resolved_address* resolved_addr) {
if (scheme == nullptr || strcmp("unix", scheme) == 0) {
return grpc_sockaddr_to_uri_unix_if_possible(resolved_addr);
}
- TString path =
- grpc_sockaddr_to_string(resolved_addr, false /* normalize */);
- TString uri_str;
- if (scheme != nullptr) {
- uri_str = y_absl::StrCat(scheme, ":", path);
+ TString path =
+ grpc_sockaddr_to_string(resolved_addr, false /* normalize */);
+ TString uri_str;
+ if (scheme != nullptr) {
+ uri_str = y_absl::StrCat(scheme, ":", path);
}
- return uri_str;
+ return uri_str;
}
const char* grpc_sockaddr_get_uri_scheme(
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/sockaddr_utils.h b/contrib/libs/grpc/src/core/lib/iomgr/sockaddr_utils.h
index 7d9fe64239b..eeedeeb90c6 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/sockaddr_utils.h
+++ b/contrib/libs/grpc/src/core/lib/iomgr/sockaddr_utils.h
@@ -21,8 +21,8 @@
#include <grpc/support/port_platform.h>
-#include <util/generic/string.h>
-
+#include <util/generic/string.h>
+
#include "src/core/lib/iomgr/resolve_address.h"
/* Returns true if addr is an IPv4-mapped IPv6 address within the
@@ -58,19 +58,19 @@ int grpc_sockaddr_get_port(const grpc_resolved_address* addr);
/* Set IP port number of a sockaddr */
int grpc_sockaddr_set_port(const grpc_resolved_address* addr, int port);
-// Converts a sockaddr into a newly-allocated human-readable string.
-//
-// Currently, only the AF_INET and AF_INET6 families are recognized.
-// If the normalize flag is enabled, ::ffff:0.0.0.0/96 IPv6 addresses are
-// displayed as plain IPv4.
-TString grpc_sockaddr_to_string(const grpc_resolved_address* addr,
- bool normalize);
+// Converts a sockaddr into a newly-allocated human-readable string.
+//
+// Currently, only the AF_INET and AF_INET6 families are recognized.
+// If the normalize flag is enabled, ::ffff:0.0.0.0/96 IPv6 addresses are
+// displayed as plain IPv4.
+TString grpc_sockaddr_to_string(const grpc_resolved_address* addr,
+ bool normalize);
-void grpc_string_to_sockaddr(grpc_resolved_address* out, const char* addr,
- int port);
+void grpc_string_to_sockaddr(grpc_resolved_address* out, const char* addr,
+ int port);
/* Returns the URI string corresponding to \a addr */
-TString grpc_sockaddr_to_uri(const grpc_resolved_address* addr);
+TString grpc_sockaddr_to_uri(const grpc_resolved_address* addr);
/* Returns the URI scheme corresponding to \a addr */
const char* grpc_sockaddr_get_uri_scheme(const grpc_resolved_address* addr);
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/socket_utils_common_posix.cc b/contrib/libs/grpc/src/core/lib/iomgr/socket_utils_common_posix.cc
index 2d099db85d0..8a8d4d3a22f 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/socket_utils_common_posix.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/socket_utils_common_posix.cc
@@ -41,8 +41,8 @@
#include <sys/types.h>
#include <unistd.h>
-#include <util/generic/string.h>
-
+#include <util/generic/string.h>
+
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/sync.h>
@@ -63,19 +63,19 @@ extern "C" bool IsReusePortAvailable();
#define TCP_USER_TIMEOUT 18 /* How long for loss retry before timeout */
#endif
-/* set a socket to use zerocopy */
-grpc_error* grpc_set_socket_zerocopy(int fd) {
-#ifdef GRPC_LINUX_ERRQUEUE
- const int enable = 1;
- auto err = setsockopt(fd, SOL_SOCKET, SO_ZEROCOPY, &enable, sizeof(enable));
- if (err != 0) {
- return GRPC_OS_ERROR(errno, "setsockopt(SO_ZEROCOPY)");
- }
- return GRPC_ERROR_NONE;
-#else
- return GRPC_OS_ERROR(ENOSYS, "setsockopt(SO_ZEROCOPY)");
-#endif
-}
+/* set a socket to use zerocopy */
+grpc_error* grpc_set_socket_zerocopy(int fd) {
+#ifdef GRPC_LINUX_ERRQUEUE
+ const int enable = 1;
+ auto err = setsockopt(fd, SOL_SOCKET, SO_ZEROCOPY, &enable, sizeof(enable));
+ if (err != 0) {
+ return GRPC_OS_ERROR(errno, "setsockopt(SO_ZEROCOPY)");
+ }
+ return GRPC_ERROR_NONE;
+#else
+ return GRPC_OS_ERROR(ENOSYS, "setsockopt(SO_ZEROCOPY)");
+#endif
+}
/* set a socket to non blocking mode */
grpc_error* grpc_set_socket_nonblocking(int fd, int non_blocking) {
@@ -270,27 +270,27 @@ static int g_default_server_tcp_user_timeout_ms =
static bool g_default_client_tcp_user_timeout_enabled = false;
static bool g_default_server_tcp_user_timeout_enabled = true;
-#if GPR_LINUX == 1
-// For Linux, it will be detected to support TCP_USER_TIMEOUT
-#ifndef TCP_USER_TIMEOUT
-#define TCP_USER_TIMEOUT 18
-#endif
-#define SOCKET_SUPPORTS_TCP_USER_TIMEOUT_DEFAULT 0
-#else
-// For non-Linux, TCP_USER_TIMEOUT will be used if TCP_USER_TIMEOUT is defined.
-#ifdef TCP_USER_TIMEOUT
-#define SOCKET_SUPPORTS_TCP_USER_TIMEOUT_DEFAULT 0
-#else
-#define TCP_USER_TIMEOUT 0
-#define SOCKET_SUPPORTS_TCP_USER_TIMEOUT_DEFAULT -1
-#endif // TCP_USER_TIMEOUT
-#endif // GPR_LINUX == 1
-
-// Whether the socket supports TCP_USER_TIMEOUT option.
-// (0: don't know, 1: support, -1: not support)
-static std::atomic<int> g_socket_supports_tcp_user_timeout(
- SOCKET_SUPPORTS_TCP_USER_TIMEOUT_DEFAULT);
-
+#if GPR_LINUX == 1
+// For Linux, it will be detected to support TCP_USER_TIMEOUT
+#ifndef TCP_USER_TIMEOUT
+#define TCP_USER_TIMEOUT 18
+#endif
+#define SOCKET_SUPPORTS_TCP_USER_TIMEOUT_DEFAULT 0
+#else
+// For non-Linux, TCP_USER_TIMEOUT will be used if TCP_USER_TIMEOUT is defined.
+#ifdef TCP_USER_TIMEOUT
+#define SOCKET_SUPPORTS_TCP_USER_TIMEOUT_DEFAULT 0
+#else
+#define TCP_USER_TIMEOUT 0
+#define SOCKET_SUPPORTS_TCP_USER_TIMEOUT_DEFAULT -1
+#endif // TCP_USER_TIMEOUT
+#endif // GPR_LINUX == 1
+
+// Whether the socket supports TCP_USER_TIMEOUT option.
+// (0: don't know, 1: support, -1: not support)
+static std::atomic<int> g_socket_supports_tcp_user_timeout(
+ SOCKET_SUPPORTS_TCP_USER_TIMEOUT_DEFAULT);
+
void config_default_tcp_user_timeout(bool enable, int timeout, bool is_client) {
if (is_client) {
g_default_client_tcp_user_timeout_enabled = enable;
@@ -312,85 +312,85 @@ grpc_error* grpc_set_socket_tcp_user_timeout(
(void)fd;
(void)channel_args;
(void)is_client;
- extern grpc_core::TraceFlag grpc_tcp_trace;
- if (g_socket_supports_tcp_user_timeout.load() >= 0) {
- bool enable;
- int timeout;
- if (is_client) {
- enable = g_default_client_tcp_user_timeout_enabled;
- timeout = g_default_client_tcp_user_timeout_ms;
- } else {
- enable = g_default_server_tcp_user_timeout_enabled;
- timeout = g_default_server_tcp_user_timeout_ms;
- }
- if (channel_args) {
- for (unsigned int i = 0; i < channel_args->num_args; i++) {
- if (0 ==
- strcmp(channel_args->args[i].key, GRPC_ARG_KEEPALIVE_TIME_MS)) {
- const int value = grpc_channel_arg_get_integer(
- &channel_args->args[i], grpc_integer_options{0, 1, INT_MAX});
- /* Continue using default if value is 0 */
- if (value == 0) {
- continue;
- }
- /* Disable if value is INT_MAX */
- enable = value != INT_MAX;
- } else if (0 == strcmp(channel_args->args[i].key,
- GRPC_ARG_KEEPALIVE_TIMEOUT_MS)) {
- const int value = grpc_channel_arg_get_integer(
- &channel_args->args[i], grpc_integer_options{0, 1, INT_MAX});
- /* Continue using default if value is 0 */
- if (value == 0) {
- continue;
- }
- timeout = value;
+ extern grpc_core::TraceFlag grpc_tcp_trace;
+ if (g_socket_supports_tcp_user_timeout.load() >= 0) {
+ bool enable;
+ int timeout;
+ if (is_client) {
+ enable = g_default_client_tcp_user_timeout_enabled;
+ timeout = g_default_client_tcp_user_timeout_ms;
+ } else {
+ enable = g_default_server_tcp_user_timeout_enabled;
+ timeout = g_default_server_tcp_user_timeout_ms;
+ }
+ if (channel_args) {
+ for (unsigned int i = 0; i < channel_args->num_args; i++) {
+ if (0 ==
+ strcmp(channel_args->args[i].key, GRPC_ARG_KEEPALIVE_TIME_MS)) {
+ const int value = grpc_channel_arg_get_integer(
+ &channel_args->args[i], grpc_integer_options{0, 1, INT_MAX});
+ /* Continue using default if value is 0 */
+ if (value == 0) {
+ continue;
+ }
+ /* Disable if value is INT_MAX */
+ enable = value != INT_MAX;
+ } else if (0 == strcmp(channel_args->args[i].key,
+ GRPC_ARG_KEEPALIVE_TIMEOUT_MS)) {
+ const int value = grpc_channel_arg_get_integer(
+ &channel_args->args[i], grpc_integer_options{0, 1, INT_MAX});
+ /* Continue using default if value is 0 */
+ if (value == 0) {
+ continue;
+ }
+ timeout = value;
}
- }
- }
- if (enable) {
- int newval;
- socklen_t len = sizeof(newval);
- // If this is the first time to use TCP_USER_TIMEOUT, try to check
- // if it is available.
- if (g_socket_supports_tcp_user_timeout.load() == 0) {
- if (0 != getsockopt(fd, IPPROTO_TCP, TCP_USER_TIMEOUT, &newval, &len)) {
- gpr_log(GPR_INFO,
- "TCP_USER_TIMEOUT is not available. TCP_USER_TIMEOUT won't "
- "be used thereafter");
- g_socket_supports_tcp_user_timeout.store(-1);
- } else {
- gpr_log(GPR_INFO,
- "TCP_USER_TIMEOUT is available. TCP_USER_TIMEOUT will be "
- "used thereafter");
- g_socket_supports_tcp_user_timeout.store(1);
+ }
+ }
+ if (enable) {
+ int newval;
+ socklen_t len = sizeof(newval);
+ // If this is the first time to use TCP_USER_TIMEOUT, try to check
+ // if it is available.
+ if (g_socket_supports_tcp_user_timeout.load() == 0) {
+ if (0 != getsockopt(fd, IPPROTO_TCP, TCP_USER_TIMEOUT, &newval, &len)) {
+ gpr_log(GPR_INFO,
+ "TCP_USER_TIMEOUT is not available. TCP_USER_TIMEOUT won't "
+ "be used thereafter");
+ g_socket_supports_tcp_user_timeout.store(-1);
+ } else {
+ gpr_log(GPR_INFO,
+ "TCP_USER_TIMEOUT is available. TCP_USER_TIMEOUT will be "
+ "used thereafter");
+ g_socket_supports_tcp_user_timeout.store(1);
+ }
+ }
+ if (g_socket_supports_tcp_user_timeout.load() > 0) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) {
+ gpr_log(GPR_INFO, "Enabling TCP_USER_TIMEOUT with a timeout of %d ms",
+ timeout);
+ }
+ if (0 != setsockopt(fd, IPPROTO_TCP, TCP_USER_TIMEOUT, &timeout,
+ sizeof(timeout))) {
+ gpr_log(GPR_ERROR, "setsockopt(TCP_USER_TIMEOUT) %s",
+ strerror(errno));
+ return GRPC_ERROR_NONE;
+ }
+ if (0 != getsockopt(fd, IPPROTO_TCP, TCP_USER_TIMEOUT, &newval, &len)) {
+ gpr_log(GPR_ERROR, "getsockopt(TCP_USER_TIMEOUT) %s",
+ strerror(errno));
+ return GRPC_ERROR_NONE;
+ }
+ if (newval != timeout) {
+ /* Do not fail on failing to set TCP_USER_TIMEOUT for now. */
+ gpr_log(GPR_ERROR, "Failed to set TCP_USER_TIMEOUT");
+ return GRPC_ERROR_NONE;
}
}
- if (g_socket_supports_tcp_user_timeout.load() > 0) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) {
- gpr_log(GPR_INFO, "Enabling TCP_USER_TIMEOUT with a timeout of %d ms",
- timeout);
- }
- if (0 != setsockopt(fd, IPPROTO_TCP, TCP_USER_TIMEOUT, &timeout,
- sizeof(timeout))) {
- gpr_log(GPR_ERROR, "setsockopt(TCP_USER_TIMEOUT) %s",
- strerror(errno));
- return GRPC_ERROR_NONE;
- }
- if (0 != getsockopt(fd, IPPROTO_TCP, TCP_USER_TIMEOUT, &newval, &len)) {
- gpr_log(GPR_ERROR, "getsockopt(TCP_USER_TIMEOUT) %s",
- strerror(errno));
- return GRPC_ERROR_NONE;
- }
- if (newval != timeout) {
- /* Do not fail on failing to set TCP_USER_TIMEOUT for now. */
- gpr_log(GPR_ERROR, "Failed to set TCP_USER_TIMEOUT");
- return GRPC_ERROR_NONE;
- }
- }
}
- } else {
+ } else {
if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) {
- gpr_log(GPR_INFO, "TCP_USER_TIMEOUT not supported for this platform");
+ gpr_log(GPR_INFO, "TCP_USER_TIMEOUT not supported for this platform");
}
}
return GRPC_ERROR_NONE;
@@ -448,10 +448,10 @@ int grpc_ipv6_loopback_available(void) {
static grpc_error* error_for_fd(int fd, const grpc_resolved_address* addr) {
if (fd >= 0) return GRPC_ERROR_NONE;
- TString addr_str = grpc_sockaddr_to_string(addr, false);
- grpc_error* err = grpc_error_set_str(
- GRPC_OS_ERROR(errno, "socket"), GRPC_ERROR_STR_TARGET_ADDRESS,
- grpc_slice_from_copied_string(addr_str.c_str()));
+ TString addr_str = grpc_sockaddr_to_string(addr, false);
+ grpc_error* err = grpc_error_set_str(
+ GRPC_OS_ERROR(errno, "socket"), GRPC_ERROR_STR_TARGET_ADDRESS,
+ grpc_slice_from_copied_string(addr_str.c_str()));
return err;
}
@@ -483,7 +483,7 @@ grpc_error* grpc_create_dualstack_socket_using_factory(
errno = EAFNOSUPPORT;
}
/* Check if we've got a valid dualstack socket. */
- if (*newfd >= 0 && grpc_set_socket_dualstack(*newfd)) {
+ if (*newfd >= 0 && grpc_set_socket_dualstack(*newfd)) {
*dsmode = GRPC_DSMODE_DUALSTACK;
return GRPC_ERROR_NONE;
}
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/socket_utils_posix.h b/contrib/libs/grpc/src/core/lib/iomgr/socket_utils_posix.h
index 59cde06ac6e..b4dc909d1e0 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/socket_utils_posix.h
+++ b/contrib/libs/grpc/src/core/lib/iomgr/socket_utils_posix.h
@@ -31,22 +31,22 @@
#include "src/core/lib/iomgr/socket_factory_posix.h"
#include "src/core/lib/iomgr/socket_mutator.h"
-#ifdef GRPC_LINUX_ERRQUEUE
-#ifndef SO_ZEROCOPY
-#define SO_ZEROCOPY 60
-#endif
-#ifndef SO_EE_ORIGIN_ZEROCOPY
-#define SO_EE_ORIGIN_ZEROCOPY 5
-#endif
-#endif /* ifdef GRPC_LINUX_ERRQUEUE */
-
+#ifdef GRPC_LINUX_ERRQUEUE
+#ifndef SO_ZEROCOPY
+#define SO_ZEROCOPY 60
+#endif
+#ifndef SO_EE_ORIGIN_ZEROCOPY
+#define SO_EE_ORIGIN_ZEROCOPY 5
+#endif
+#endif /* ifdef GRPC_LINUX_ERRQUEUE */
+
/* a wrapper for accept or accept4 */
int grpc_accept4(int sockfd, grpc_resolved_address* resolved_addr, int nonblock,
int cloexec);
-/* set a socket to use zerocopy */
-grpc_error* grpc_set_socket_zerocopy(int fd);
-
+/* set a socket to use zerocopy */
+grpc_error* grpc_set_socket_zerocopy(int fd);
+
/* set a socket to non blocking mode */
grpc_error* grpc_set_socket_nonblocking(int fd, int non_blocking);
@@ -126,9 +126,9 @@ typedef enum grpc_dualstack_mode {
/* Only tests should use this flag. */
extern int grpc_forbid_dualstack_sockets_for_testing;
-/* Tries to set the socket to dualstack. Returns 1 on success. */
-int grpc_set_socket_dualstack(int fd);
-
+/* Tries to set the socket to dualstack. Returns 1 on success. */
+int grpc_set_socket_dualstack(int fd);
+
/* Creates a new socket for connecting to (or listening on) an address.
If addr is AF_INET6, this creates an IPv6 socket first. If that fails,
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/socket_windows.cc b/contrib/libs/grpc/src/core/lib/iomgr/socket_windows.cc
index 04d266d7250..f117653c490 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/socket_windows.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/socket_windows.cc
@@ -31,8 +31,8 @@
#undef OPTIONAL
-#include "y_absl/strings/str_format.h"
-
+#include "y_absl/strings/str_format.h"
+
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/log_windows.h>
@@ -51,8 +51,8 @@ grpc_winsocket* grpc_winsocket_create(SOCKET socket, const char* name) {
memset(r, 0, sizeof(grpc_winsocket));
r->socket = socket;
gpr_mu_init(&r->state_mu);
- grpc_iomgr_register_object(
- &r->iomgr_object, y_absl::StrFormat("%s:socket=0x%p", name, r).c_str());
+ grpc_iomgr_register_object(
+ &r->iomgr_object, y_absl::StrFormat("%s:socket=0x%p", name, r).c_str());
grpc_iocp_add_socket(r);
return r;
}
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/tcp_client_cfstream.cc b/contrib/libs/grpc/src/core/lib/iomgr/tcp_client_cfstream.cc
index 7ba74ba535a..eafa885e2c9 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/tcp_client_cfstream.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/tcp_client_cfstream.cc
@@ -46,7 +46,7 @@
extern grpc_core::TraceFlag grpc_tcp_trace;
-struct CFStreamConnect {
+struct CFStreamConnect {
gpr_mu mu;
gpr_refcount refcount;
@@ -65,9 +65,9 @@ struct CFStreamConnect {
grpc_closure* closure;
grpc_endpoint** endpoint;
int refs;
- TString addr_name;
+ TString addr_name;
grpc_resource_quota* resource_quota;
-};
+};
static void CFStreamConnectCleanup(CFStreamConnect* connect) {
grpc_resource_quota_unref_internal(connect->resource_quota);
@@ -75,7 +75,7 @@ static void CFStreamConnectCleanup(CFStreamConnect* connect) {
CFRelease(connect->read_stream);
CFRelease(connect->write_stream);
gpr_mu_destroy(&connect->mu);
- delete connect;
+ delete connect;
}
static void OnAlarm(void* arg, grpc_error* error) {
@@ -129,9 +129,9 @@ static void OnOpen(void* arg, grpc_error* error) {
}
if (error == GRPC_ERROR_NONE) {
*endpoint = grpc_cfstream_endpoint_create(
- connect->read_stream, connect->write_stream,
- connect->addr_name.c_str(), connect->resource_quota,
- connect->stream_handle);
+ connect->read_stream, connect->write_stream,
+ connect->addr_name.c_str(), connect->resource_quota,
+ connect->stream_handle);
}
} else {
GRPC_ERROR_REF(error);
@@ -143,12 +143,12 @@ static void OnOpen(void* arg, grpc_error* error) {
static void ParseResolvedAddress(const grpc_resolved_address* addr,
CFStringRef* host, int* port) {
- TString host_port = grpc_sockaddr_to_string(addr, true);
- TString host_string;
- TString port_string;
+ TString host_port = grpc_sockaddr_to_string(addr, true);
+ TString host_string;
+ TString port_string;
grpc_core::SplitHostPort(host_port, &host_string, &port_string);
- *host = CFStringCreateWithCString(NULL, host_string.c_str(),
- kCFStringEncodingUTF8);
+ *host = CFStringCreateWithCString(NULL, host_string.c_str(),
+ kCFStringEncodingUTF8);
*port = grpc_sockaddr_get_port(addr);
}
@@ -157,7 +157,7 @@ static void CFStreamClientConnect(grpc_closure* closure, grpc_endpoint** ep,
const grpc_channel_args* channel_args,
const grpc_resolved_address* resolved_addr,
grpc_millis deadline) {
- CFStreamConnect* connect = new CFStreamConnect();
+ CFStreamConnect* connect = new CFStreamConnect();
connect->closure = closure;
connect->endpoint = ep;
connect->addr_name = grpc_sockaddr_to_uri(resolved_addr);
@@ -168,7 +168,7 @@ static void CFStreamClientConnect(grpc_closure* closure, grpc_endpoint** ep,
if (grpc_tcp_trace.enabled()) {
gpr_log(GPR_DEBUG, "CLIENT_CONNECT: %p, %s: asynchronously connecting",
- connect, connect->addr_name.c_str());
+ connect, connect->addr_name.c_str());
}
grpc_resource_quota* resource_quota = grpc_resource_quota_create(NULL);
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/tcp_client_custom.cc b/contrib/libs/grpc/src/core/lib/iomgr/tcp_client_custom.cc
index 1b63a5c23b9..dbcf62c94f5 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/tcp_client_custom.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/tcp_client_custom.cc
@@ -42,14 +42,14 @@ struct grpc_custom_tcp_connect {
grpc_closure* closure;
grpc_endpoint** endpoint;
int refs;
- TString addr_name;
+ TString addr_name;
grpc_resource_quota* resource_quota;
};
static void custom_tcp_connect_cleanup(grpc_custom_tcp_connect* connect) {
grpc_custom_socket* socket = connect->socket;
grpc_resource_quota_unref_internal(connect->resource_quota);
- delete connect;
+ delete connect;
socket->refs--;
if (socket->refs == 0) {
grpc_custom_socket_vtable->destroy(socket);
@@ -66,7 +66,7 @@ static void on_alarm(void* acp, grpc_error* error) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) {
const char* str = grpc_error_string(error);
gpr_log(GPR_INFO, "CLIENT_CONNECT: %s: on_alarm: error=%s",
- connect->addr_name.c_str(), str);
+ connect->addr_name.c_str(), str);
}
if (error == GRPC_ERROR_NONE) {
/* error == NONE implies that the timer ran out, and wasn't cancelled. If
@@ -88,7 +88,7 @@ static void custom_connect_callback_internal(grpc_custom_socket* socket,
grpc_timer_cancel(&connect->alarm);
if (error == GRPC_ERROR_NONE) {
*connect->endpoint = custom_tcp_endpoint_create(
- socket, connect->resource_quota, connect->addr_name.c_str());
+ socket, connect->resource_quota, connect->addr_name.c_str());
}
done = (--connect->refs == 0);
if (done) {
@@ -133,7 +133,7 @@ static void tcp_connect(grpc_closure* closure, grpc_endpoint** ep,
(grpc_custom_socket*)gpr_malloc(sizeof(grpc_custom_socket));
socket->refs = 2;
grpc_custom_socket_vtable->init(socket, GRPC_AF_UNSPEC);
- grpc_custom_tcp_connect* connect = new grpc_custom_tcp_connect();
+ grpc_custom_tcp_connect* connect = new grpc_custom_tcp_connect();
connect->closure = closure;
connect->endpoint = ep;
connect->addr_name = grpc_sockaddr_to_uri(resolved_addr);
@@ -146,7 +146,7 @@ static void tcp_connect(grpc_closure* closure, grpc_endpoint** ep,
if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) {
gpr_log(GPR_INFO, "CLIENT_CONNECT: %p %s: asynchronously connecting",
- socket, connect->addr_name.c_str());
+ socket, connect->addr_name.c_str());
}
GRPC_CLOSURE_INIT(&connect->on_alarm, on_alarm, socket,
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/tcp_client_posix.cc b/contrib/libs/grpc/src/core/lib/iomgr/tcp_client_posix.cc
index 0d4aa827941..401ddd2f683 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/tcp_client_posix.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/tcp_client_posix.cc
@@ -29,8 +29,8 @@
#include <string.h>
#include <unistd.h>
-#include "y_absl/strings/str_cat.h"
-
+#include "y_absl/strings/str_cat.h"
+
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/time.h>
@@ -58,12 +58,12 @@ struct async_connect {
int refs;
grpc_closure write_closure;
grpc_pollset_set* interested_parties;
- TString addr_str;
+ TString addr_str;
grpc_endpoint** ep;
grpc_closure* closure;
grpc_channel_args* channel_args;
};
-
+
static grpc_error* prepare_socket(const grpc_resolved_address* addr, int fd,
const grpc_channel_args* channel_args) {
grpc_error* err = GRPC_ERROR_NONE;
@@ -104,8 +104,8 @@ static void tc_on_alarm(void* acp, grpc_error* error) {
async_connect* ac = static_cast<async_connect*>(acp);
if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) {
const char* str = grpc_error_string(error);
- gpr_log(GPR_INFO, "CLIENT_CONNECT: %s: on_alarm: error=%s",
- ac->addr_str.c_str(), str);
+ gpr_log(GPR_INFO, "CLIENT_CONNECT: %s: on_alarm: error=%s",
+ ac->addr_str.c_str(), str);
}
gpr_mu_lock(&ac->mu);
if (ac->fd != nullptr) {
@@ -117,7 +117,7 @@ static void tc_on_alarm(void* acp, grpc_error* error) {
if (done) {
gpr_mu_destroy(&ac->mu);
grpc_channel_args_destroy(ac->channel_args);
- delete ac;
+ delete ac;
}
}
@@ -140,8 +140,8 @@ static void on_writable(void* acp, grpc_error* error) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) {
const char* str = grpc_error_string(error);
- gpr_log(GPR_INFO, "CLIENT_CONNECT: %s: on_writable: error=%s",
- ac->addr_str.c_str(), str);
+ gpr_log(GPR_INFO, "CLIENT_CONNECT: %s: on_writable: error=%s",
+ ac->addr_str.c_str(), str);
}
gpr_mu_lock(&ac->mu);
@@ -173,8 +173,8 @@ static void on_writable(void* acp, grpc_error* error) {
switch (so_error) {
case 0:
grpc_pollset_set_del_fd(ac->interested_parties, fd);
- *ep = grpc_tcp_client_create_from_fd(fd, ac->channel_args,
- ac->addr_str.c_str());
+ *ep = grpc_tcp_client_create_from_fd(fd, ac->channel_args,
+ ac->addr_str.c_str());
fd = nullptr;
break;
case ENOBUFS:
@@ -216,17 +216,17 @@ finish:
done = (--ac->refs == 0);
// Create a copy of the data from "ac" to be accessed after the unlock, as
// "ac" and its contents may be deallocated by the time they are read.
- const grpc_slice addr_str_slice = grpc_slice_from_cpp_string(ac->addr_str);
+ const grpc_slice addr_str_slice = grpc_slice_from_cpp_string(ac->addr_str);
gpr_mu_unlock(&ac->mu);
if (error != GRPC_ERROR_NONE) {
grpc_slice str;
bool ret = grpc_error_get_str(error, GRPC_ERROR_STR_DESCRIPTION, &str);
GPR_ASSERT(ret);
- TString description = y_absl::StrCat("Failed to connect to remote host: ",
- grpc_core::StringViewFromSlice(str));
- error =
- grpc_error_set_str(error, GRPC_ERROR_STR_DESCRIPTION,
- grpc_slice_from_cpp_string(std::move(description)));
+ TString description = y_absl::StrCat("Failed to connect to remote host: ",
+ grpc_core::StringViewFromSlice(str));
+ error =
+ grpc_error_set_str(error, GRPC_ERROR_STR_DESCRIPTION,
+ grpc_slice_from_cpp_string(std::move(description)));
error = grpc_error_set_str(error, GRPC_ERROR_STR_TARGET_ADDRESS,
addr_str_slice /* takes ownership */);
} else {
@@ -237,7 +237,7 @@ finish:
// populated *inside* the lock.
gpr_mu_destroy(&ac->mu);
grpc_channel_args_destroy(ac->channel_args);
- delete ac;
+ delete ac;
}
grpc_core::ExecCtx::Run(DEBUG_LOCATION, closure, error);
}
@@ -245,10 +245,10 @@ finish:
grpc_error* grpc_tcp_client_prepare_fd(const grpc_channel_args* channel_args,
const grpc_resolved_address* addr,
grpc_resolved_address* mapped_addr,
- int* fd) {
+ int* fd) {
grpc_dualstack_mode dsmode;
grpc_error* error;
- *fd = -1;
+ *fd = -1;
/* Use dualstack sockets where available. Set mapped to v6 or v4 mapped to
v6. */
if (!grpc_sockaddr_to_v4mapped(addr, mapped_addr)) {
@@ -256,7 +256,7 @@ grpc_error* grpc_tcp_client_prepare_fd(const grpc_channel_args* channel_args,
memcpy(mapped_addr, addr, sizeof(*mapped_addr));
}
error =
- grpc_create_dualstack_socket(mapped_addr, SOCK_STREAM, 0, &dsmode, fd);
+ grpc_create_dualstack_socket(mapped_addr, SOCK_STREAM, 0, &dsmode, fd);
if (error != GRPC_ERROR_NONE) {
return error;
}
@@ -266,7 +266,7 @@ grpc_error* grpc_tcp_client_prepare_fd(const grpc_channel_args* channel_args,
memcpy(mapped_addr, addr, sizeof(*mapped_addr));
}
}
- if ((error = prepare_socket(mapped_addr, *fd, channel_args)) !=
+ if ((error = prepare_socket(mapped_addr, *fd, channel_args)) !=
GRPC_ERROR_NONE) {
return error;
}
@@ -274,7 +274,7 @@ grpc_error* grpc_tcp_client_prepare_fd(const grpc_channel_args* channel_args,
}
void grpc_tcp_client_create_from_prepared_fd(
- grpc_pollset_set* interested_parties, grpc_closure* closure, const int fd,
+ grpc_pollset_set* interested_parties, grpc_closure* closure, const int fd,
const grpc_channel_args* channel_args, const grpc_resolved_address* addr,
grpc_millis deadline, grpc_endpoint** ep) {
int err;
@@ -282,29 +282,29 @@ void grpc_tcp_client_create_from_prepared_fd(
err = connect(fd, reinterpret_cast<const grpc_sockaddr*>(addr->addr),
addr->len);
} while (err < 0 && errno == EINTR);
-
- TString name = y_absl::StrCat("tcp-client:", grpc_sockaddr_to_uri(addr));
- grpc_fd* fdobj = grpc_fd_create(fd, name.c_str(), true);
-
+
+ TString name = y_absl::StrCat("tcp-client:", grpc_sockaddr_to_uri(addr));
+ grpc_fd* fdobj = grpc_fd_create(fd, name.c_str(), true);
+
if (err >= 0) {
- *ep = grpc_tcp_client_create_from_fd(fdobj, channel_args,
- grpc_sockaddr_to_uri(addr).c_str());
+ *ep = grpc_tcp_client_create_from_fd(fdobj, channel_args,
+ grpc_sockaddr_to_uri(addr).c_str());
grpc_core::ExecCtx::Run(DEBUG_LOCATION, closure, GRPC_ERROR_NONE);
return;
}
if (errno != EWOULDBLOCK && errno != EINPROGRESS) {
- grpc_error* error = GRPC_OS_ERROR(errno, "connect");
- error = grpc_error_set_str(
- error, GRPC_ERROR_STR_TARGET_ADDRESS,
- grpc_slice_from_cpp_string(grpc_sockaddr_to_uri(addr)));
+ grpc_error* error = GRPC_OS_ERROR(errno, "connect");
+ error = grpc_error_set_str(
+ error, GRPC_ERROR_STR_TARGET_ADDRESS,
+ grpc_slice_from_cpp_string(grpc_sockaddr_to_uri(addr)));
grpc_fd_orphan(fdobj, nullptr, nullptr, "tcp_client_connect_error");
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, closure, error);
+ grpc_core::ExecCtx::Run(DEBUG_LOCATION, closure, error);
return;
}
grpc_pollset_set_add_fd(interested_parties, fdobj);
- async_connect* ac = new async_connect();
+ async_connect* ac = new async_connect();
ac->closure = closure;
ac->ep = ep;
ac->fd = fdobj;
@@ -318,7 +318,7 @@ void grpc_tcp_client_create_from_prepared_fd(
if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) {
gpr_log(GPR_INFO, "CLIENT_CONNECT: %s: asynchronously connecting fd %p",
- ac->addr_str.c_str(), fdobj);
+ ac->addr_str.c_str(), fdobj);
}
gpr_mu_lock(&ac->mu);
@@ -334,15 +334,15 @@ static void tcp_connect(grpc_closure* closure, grpc_endpoint** ep,
const grpc_resolved_address* addr,
grpc_millis deadline) {
grpc_resolved_address mapped_addr;
- int fd = -1;
+ int fd = -1;
grpc_error* error;
*ep = nullptr;
if ((error = grpc_tcp_client_prepare_fd(channel_args, addr, &mapped_addr,
- &fd)) != GRPC_ERROR_NONE) {
+ &fd)) != GRPC_ERROR_NONE) {
grpc_core::ExecCtx::Run(DEBUG_LOCATION, closure, error);
return;
}
- grpc_tcp_client_create_from_prepared_fd(interested_parties, closure, fd,
+ grpc_tcp_client_create_from_prepared_fd(interested_parties, closure, fd,
channel_args, &mapped_addr, deadline,
ep);
}
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/tcp_client_posix.h b/contrib/libs/grpc/src/core/lib/iomgr/tcp_client_posix.h
index e27d8225e8a..6f61866fc4f 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/tcp_client_posix.h
+++ b/contrib/libs/grpc/src/core/lib/iomgr/tcp_client_posix.h
@@ -35,33 +35,33 @@
grpc_endpoint* grpc_tcp_client_create_from_fd(
grpc_fd* fd, const grpc_channel_args* channel_args, const char* addr_str);
-/* Return a configured, unbound, unconnected TCP client fd.
+/* Return a configured, unbound, unconnected TCP client fd.
channel_args: may contain custom settings for the fd
addr: the destination address
mapped_addr: out parameter. addr mapped to an address appropriate to the
type of socket FD created. For example, if addr is IPv4 and dual stack
sockets are available, mapped_addr will be an IPv4-mapped IPv6 address
- fd: out parameter. The new FD
+ fd: out parameter. The new FD
Returns: error, if any. Out parameters are not set on error
*/
grpc_error* grpc_tcp_client_prepare_fd(const grpc_channel_args* channel_args,
const grpc_resolved_address* addr,
grpc_resolved_address* mapped_addr,
- int* fd);
+ int* fd);
-/* Connect a configured TCP client fd.
+/* Connect a configured TCP client fd.
interested_parties: a set of pollsets that would be interested in this
connection being established (in order to continue their work
closure: called when complete. On success, *ep will be set.
- fd: an FD returned from grpc_tcp_client_prepare_fd().
+ fd: an FD returned from grpc_tcp_client_prepare_fd().
channel_args: may contain custom settings for the endpoint
deadline: connection deadline
ep: out parameter. Set before closure is called if successful
*/
void grpc_tcp_client_create_from_prepared_fd(
- grpc_pollset_set* interested_parties, grpc_closure* closure, const int fd,
+ grpc_pollset_set* interested_parties, grpc_closure* closure, const int fd,
const grpc_channel_args* channel_args, const grpc_resolved_address* addr,
grpc_millis deadline, grpc_endpoint** ep);
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/tcp_client_windows.cc b/contrib/libs/grpc/src/core/lib/iomgr/tcp_client_windows.cc
index 18c6e427b2d..a57e7539f2a 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/tcp_client_windows.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/tcp_client_windows.cc
@@ -39,7 +39,7 @@
#include "src/core/lib/iomgr/tcp_client.h"
#include "src/core/lib/iomgr/tcp_windows.h"
#include "src/core/lib/iomgr/timer.h"
-#include "src/core/lib/slice/slice_internal.h"
+#include "src/core/lib/slice/slice_internal.h"
struct async_connect {
grpc_closure* on_done;
@@ -47,13 +47,13 @@ struct async_connect {
grpc_winsocket* socket;
grpc_timer alarm;
grpc_closure on_alarm;
- TString addr_name;
+ TString addr_name;
int refs;
grpc_closure on_connect;
grpc_endpoint** endpoint;
grpc_channel_args* channel_args;
};
-
+
static void async_connect_unlock_and_cleanup(async_connect* ac,
grpc_winsocket* socket) {
int done = (--ac->refs == 0);
@@ -61,7 +61,7 @@ static void async_connect_unlock_and_cleanup(async_connect* ac,
if (done) {
grpc_channel_args_destroy(ac->channel_args);
gpr_mu_destroy(&ac->mu);
- delete ac;
+ delete ac;
}
if (socket != NULL) grpc_winsocket_destroy(socket);
}
@@ -106,7 +106,7 @@ static void on_connect(void* acp, grpc_error* error) {
error = GRPC_WSA_ERROR(WSAGetLastError(), "ConnectEx");
closesocket(socket->socket);
} else {
- *ep = grpc_tcp_create(socket, ac->channel_args, ac->addr_name.c_str());
+ *ep = grpc_tcp_create(socket, ac->channel_args, ac->addr_name.c_str());
socket = NULL;
}
} else {
@@ -138,7 +138,7 @@ static void tcp_connect(grpc_closure* on_done, grpc_endpoint** endpoint,
DWORD ioctl_num_bytes;
grpc_winsocket_callback_info* info;
grpc_error* error = GRPC_ERROR_NONE;
- async_connect* ac = NULL;
+ async_connect* ac = NULL;
*endpoint = NULL;
@@ -195,7 +195,7 @@ static void tcp_connect(grpc_closure* on_done, grpc_endpoint** endpoint,
}
}
- ac = new async_connect();
+ ac = new async_connect();
ac->on_done = on_done;
ac->socket = socket;
gpr_mu_init(&ac->mu);
@@ -212,12 +212,12 @@ static void tcp_connect(grpc_closure* on_done, grpc_endpoint** endpoint,
failure:
GPR_ASSERT(error != GRPC_ERROR_NONE);
- TString target_uri = grpc_sockaddr_to_uri(addr);
+ TString target_uri = grpc_sockaddr_to_uri(addr);
grpc_error* final_error =
grpc_error_set_str(GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
"Failed to connect", &error, 1),
GRPC_ERROR_STR_TARGET_ADDRESS,
- grpc_slice_from_cpp_string(std::move(target_uri)));
+ grpc_slice_from_cpp_string(std::move(target_uri)));
GRPC_ERROR_UNREF(error);
if (socket != NULL) {
grpc_winsocket_destroy(socket);
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/tcp_custom.cc b/contrib/libs/grpc/src/core/lib/iomgr/tcp_custom.cc
index d2de7bc7179..3e562da508d 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/tcp_custom.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/tcp_custom.cc
@@ -32,7 +32,7 @@
#include "src/core/lib/iomgr/error.h"
#include "src/core/lib/iomgr/iomgr_custom.h"
#include "src/core/lib/iomgr/resource_quota.h"
-#include "src/core/lib/iomgr/sockaddr_utils.h"
+#include "src/core/lib/iomgr/sockaddr_utils.h"
#include "src/core/lib/iomgr/tcp_client.h"
#include "src/core/lib/iomgr/tcp_custom.h"
#include "src/core/lib/iomgr/tcp_server.h"
@@ -58,24 +58,24 @@ struct custom_tcp_endpoint {
gpr_refcount refcount;
grpc_custom_socket* socket;
- grpc_closure* read_cb = nullptr;
- grpc_closure* write_cb = nullptr;
+ grpc_closure* read_cb = nullptr;
+ grpc_closure* write_cb = nullptr;
- grpc_slice_buffer* read_slices = nullptr;
- grpc_slice_buffer* write_slices = nullptr;
+ grpc_slice_buffer* read_slices = nullptr;
+ grpc_slice_buffer* write_slices = nullptr;
grpc_resource_user* resource_user;
grpc_resource_user_slice_allocator slice_allocator;
bool shutting_down;
- TString peer_string;
- TString local_address;
+ TString peer_string;
+ TString local_address;
};
static void tcp_free(grpc_custom_socket* s) {
custom_tcp_endpoint* tcp = (custom_tcp_endpoint*)s->endpoint;
grpc_resource_user_unref(tcp->resource_user);
- delete tcp;
+ delete tcp;
s->refs--;
if (s->refs == 0) {
grpc_custom_socket_vtable->destroy(s);
@@ -133,8 +133,8 @@ static void call_read_cb(custom_tcp_endpoint* tcp, grpc_error* error) {
for (i = 0; i < tcp->read_slices->count; i++) {
char* dump = grpc_dump_slice(tcp->read_slices->slices[i],
GPR_DUMP_HEX | GPR_DUMP_ASCII);
- gpr_log(GPR_INFO, "READ %p (peer=%s): %s", tcp, tcp->peer_string.c_str(),
- dump);
+ gpr_log(GPR_INFO, "READ %p (peer=%s): %s", tcp, tcp->peer_string.c_str(),
+ dump);
gpr_free(dump);
}
}
@@ -235,8 +235,8 @@ static void endpoint_write(grpc_endpoint* ep, grpc_slice_buffer* write_slices,
for (j = 0; j < write_slices->count; j++) {
char* data = grpc_dump_slice(write_slices->slices[j],
GPR_DUMP_HEX | GPR_DUMP_ASCII);
- gpr_log(GPR_INFO, "WRITE %p (peer=%s): %s", tcp->socket,
- tcp->peer_string.c_str(), data);
+ gpr_log(GPR_INFO, "WRITE %p (peer=%s): %s", tcp->socket,
+ tcp->peer_string.c_str(), data);
gpr_free(data);
}
}
@@ -319,16 +319,16 @@ static void endpoint_destroy(grpc_endpoint* ep) {
grpc_custom_socket_vtable->close(tcp->socket, custom_close_callback);
}
-static y_absl::string_view endpoint_get_peer(grpc_endpoint* ep) {
+static y_absl::string_view endpoint_get_peer(grpc_endpoint* ep) {
custom_tcp_endpoint* tcp = (custom_tcp_endpoint*)ep;
- return tcp->peer_string;
+ return tcp->peer_string;
+}
+
+static y_absl::string_view endpoint_get_local_address(grpc_endpoint* ep) {
+ custom_tcp_endpoint* tcp = (custom_tcp_endpoint*)ep;
+ return tcp->local_address;
}
-static y_absl::string_view endpoint_get_local_address(grpc_endpoint* ep) {
- custom_tcp_endpoint* tcp = (custom_tcp_endpoint*)ep;
- return tcp->local_address;
-}
-
static grpc_resource_user* endpoint_get_resource_user(grpc_endpoint* ep) {
custom_tcp_endpoint* tcp = (custom_tcp_endpoint*)ep;
return tcp->resource_user;
@@ -347,14 +347,14 @@ static grpc_endpoint_vtable vtable = {endpoint_read,
endpoint_destroy,
endpoint_get_resource_user,
endpoint_get_peer,
- endpoint_get_local_address,
+ endpoint_get_local_address,
endpoint_get_fd,
endpoint_can_track_err};
grpc_endpoint* custom_tcp_endpoint_create(grpc_custom_socket* socket,
grpc_resource_quota* resource_quota,
- const char* peer_string) {
- custom_tcp_endpoint* tcp = new custom_tcp_endpoint;
+ const char* peer_string) {
+ custom_tcp_endpoint* tcp = new custom_tcp_endpoint;
grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
grpc_core::ExecCtx exec_ctx;
@@ -366,17 +366,17 @@ grpc_endpoint* custom_tcp_endpoint_create(grpc_custom_socket* socket,
tcp->socket = socket;
tcp->base.vtable = &vtable;
gpr_ref_init(&tcp->refcount, 1);
- tcp->peer_string = peer_string;
- grpc_resolved_address resolved_local_addr;
- resolved_local_addr.len = sizeof(resolved_local_addr.addr);
- if (grpc_custom_socket_vtable->getsockname(
- socket, reinterpret_cast<sockaddr*>(resolved_local_addr.addr),
- reinterpret_cast<int*>(&resolved_local_addr.len)) !=
- GRPC_ERROR_NONE) {
- tcp->local_address = "";
- } else {
- tcp->local_address = grpc_sockaddr_to_uri(&resolved_local_addr);
- }
+ tcp->peer_string = peer_string;
+ grpc_resolved_address resolved_local_addr;
+ resolved_local_addr.len = sizeof(resolved_local_addr.addr);
+ if (grpc_custom_socket_vtable->getsockname(
+ socket, reinterpret_cast<sockaddr*>(resolved_local_addr.addr),
+ reinterpret_cast<int*>(&resolved_local_addr.len)) !=
+ GRPC_ERROR_NONE) {
+ tcp->local_address = "";
+ } else {
+ tcp->local_address = grpc_sockaddr_to_uri(&resolved_local_addr);
+ }
tcp->shutting_down = false;
tcp->resource_user = grpc_resource_user_create(resource_quota, peer_string);
grpc_resource_user_slice_allocator_init(
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/tcp_custom.h b/contrib/libs/grpc/src/core/lib/iomgr/tcp_custom.h
index c7b08adee12..d32ed2b4b61 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/tcp_custom.h
+++ b/contrib/libs/grpc/src/core/lib/iomgr/tcp_custom.h
@@ -24,9 +24,9 @@
#include "src/core/lib/iomgr/endpoint.h"
#include "src/core/lib/iomgr/sockaddr.h"
-// Same number as the micro of SO_REUSEPORT in kernel
-#define GRPC_CUSTOM_SOCKET_OPT_SO_REUSEPORT (0x00000200u)
-
+// Same number as the micro of SO_REUSEPORT in kernel
+#define GRPC_CUSTOM_SOCKET_OPT_SO_REUSEPORT (0x00000200u)
+
typedef struct grpc_tcp_listener grpc_tcp_listener;
typedef struct grpc_custom_tcp_connect grpc_custom_tcp_connect;
@@ -79,6 +79,6 @@ void grpc_custom_close_server_callback(grpc_tcp_listener* listener);
grpc_endpoint* custom_tcp_endpoint_create(grpc_custom_socket* socket,
grpc_resource_quota* resource_quota,
- const char* peer_string);
+ const char* peer_string);
#endif /* GRPC_CORE_LIB_IOMGR_TCP_CUSTOM_H */
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/tcp_posix.cc b/contrib/libs/grpc/src/core/lib/iomgr/tcp_posix.cc
index b6b45017029..b1cd892964d 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/tcp_posix.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/tcp_posix.cc
@@ -36,7 +36,7 @@
#include <sys/types.h>
#include <unistd.h>
#include <algorithm>
-#include <unordered_map>
+#include <unordered_map>
#include <grpc/slice.h>
#include <grpc/support/alloc.h>
@@ -50,12 +50,12 @@
#include "src/core/lib/debug/trace.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gpr/useful.h"
-#include "src/core/lib/gprpp/sync.h"
+#include "src/core/lib/gprpp/sync.h"
#include "src/core/lib/iomgr/buffer_list.h"
#include "src/core/lib/iomgr/ev_posix.h"
#include "src/core/lib/iomgr/executor.h"
-#include "src/core/lib/iomgr/sockaddr_utils.h"
-#include "src/core/lib/iomgr/socket_utils_posix.h"
+#include "src/core/lib/iomgr/sockaddr_utils.h"
+#include "src/core/lib/iomgr/socket_utils_posix.h"
#include "src/core/lib/profiling/timers.h"
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/slice/slice_string_helpers.h"
@@ -75,15 +75,15 @@
#define SENDMSG_FLAGS 0
#endif
-// TCP zero copy sendmsg flag.
-// NB: We define this here as a fallback in case we're using an older set of
-// library headers that has not defined MSG_ZEROCOPY. Since this constant is
-// part of the kernel, we are guaranteed it will never change/disagree so
-// defining it here is safe.
-#ifndef MSG_ZEROCOPY
-#define MSG_ZEROCOPY 0x4000000
-#endif
-
+// TCP zero copy sendmsg flag.
+// NB: We define this here as a fallback in case we're using an older set of
+// library headers that has not defined MSG_ZEROCOPY. Since this constant is
+// part of the kernel, we are guaranteed it will never change/disagree so
+// defining it here is safe.
+#ifndef MSG_ZEROCOPY
+#define MSG_ZEROCOPY 0x4000000
+#endif
+
#ifdef GRPC_MSG_IOVLEN_TYPE
typedef GRPC_MSG_IOVLEN_TYPE msg_iovlen_type;
#else
@@ -92,268 +92,268 @@ typedef size_t msg_iovlen_type;
extern grpc_core::TraceFlag grpc_tcp_trace;
-namespace grpc_core {
-
-class TcpZerocopySendRecord {
- public:
- TcpZerocopySendRecord() { grpc_slice_buffer_init(&buf_); }
-
- ~TcpZerocopySendRecord() {
- AssertEmpty();
- grpc_slice_buffer_destroy_internal(&buf_);
- }
-
- // Given the slices that we wish to send, and the current offset into the
- // slice buffer (indicating which have already been sent), populate an iovec
- // array that will be used for a zerocopy enabled sendmsg().
- msg_iovlen_type PopulateIovs(size_t* unwind_slice_idx,
- size_t* unwind_byte_idx, size_t* sending_length,
- iovec* iov);
-
- // A sendmsg() may not be able to send the bytes that we requested at this
- // time, returning EAGAIN (possibly due to backpressure). In this case,
- // unwind the offset into the slice buffer so we retry sending these bytes.
- void UnwindIfThrottled(size_t unwind_slice_idx, size_t unwind_byte_idx) {
- out_offset_.byte_idx = unwind_byte_idx;
- out_offset_.slice_idx = unwind_slice_idx;
- }
-
- // Update the offset into the slice buffer based on how much we wanted to sent
- // vs. what sendmsg() actually sent (which may be lower, possibly due to
- // backpressure).
- void UpdateOffsetForBytesSent(size_t sending_length, size_t actually_sent);
-
- // Indicates whether all underlying data has been sent or not.
- bool AllSlicesSent() { return out_offset_.slice_idx == buf_.count; }
-
- // Reset this structure for a new tcp_write() with zerocopy.
- void PrepareForSends(grpc_slice_buffer* slices_to_send) {
- AssertEmpty();
- out_offset_.slice_idx = 0;
- out_offset_.byte_idx = 0;
- grpc_slice_buffer_swap(slices_to_send, &buf_);
- Ref();
- }
-
- // References: 1 reference per sendmsg(), and 1 for the tcp_write().
- void Ref() { ref_.FetchAdd(1, MemoryOrder::RELAXED); }
-
- // Unref: called when we get an error queue notification for a sendmsg(), if a
- // sendmsg() failed or when tcp_write() is done.
- bool Unref() {
- const intptr_t prior = ref_.FetchSub(1, MemoryOrder::ACQ_REL);
- GPR_DEBUG_ASSERT(prior > 0);
- if (prior == 1) {
- AllSendsComplete();
- return true;
- }
- return false;
- }
-
- private:
- struct OutgoingOffset {
- size_t slice_idx = 0;
- size_t byte_idx = 0;
- };
-
- void AssertEmpty() {
- GPR_DEBUG_ASSERT(buf_.count == 0);
- GPR_DEBUG_ASSERT(buf_.length == 0);
- GPR_DEBUG_ASSERT(ref_.Load(MemoryOrder::RELAXED) == 0);
- }
-
- // When all sendmsg() calls associated with this tcp_write() have been
- // completed (ie. we have received the notifications for each sequence number
- // for each sendmsg()) and all reference counts have been dropped, drop our
- // reference to the underlying data since we no longer need it.
- void AllSendsComplete() {
- GPR_DEBUG_ASSERT(ref_.Load(MemoryOrder::RELAXED) == 0);
- grpc_slice_buffer_reset_and_unref_internal(&buf_);
- }
-
- grpc_slice_buffer buf_;
- Atomic<intptr_t> ref_;
- OutgoingOffset out_offset_;
-};
-
-class TcpZerocopySendCtx {
- public:
- static constexpr int kDefaultMaxSends = 4;
- static constexpr size_t kDefaultSendBytesThreshold = 16 * 1024; // 16KB
-
- TcpZerocopySendCtx(int max_sends = kDefaultMaxSends,
- size_t send_bytes_threshold = kDefaultSendBytesThreshold)
- : max_sends_(max_sends),
- free_send_records_size_(max_sends),
- threshold_bytes_(send_bytes_threshold) {
- send_records_ = static_cast<TcpZerocopySendRecord*>(
- gpr_malloc(max_sends * sizeof(*send_records_)));
- free_send_records_ = static_cast<TcpZerocopySendRecord**>(
- gpr_malloc(max_sends * sizeof(*free_send_records_)));
- if (send_records_ == nullptr || free_send_records_ == nullptr) {
- gpr_free(send_records_);
- gpr_free(free_send_records_);
- gpr_log(GPR_INFO, "Disabling TCP TX zerocopy due to memory pressure.\n");
- memory_limited_ = true;
- } else {
- for (int idx = 0; idx < max_sends_; ++idx) {
- new (send_records_ + idx) TcpZerocopySendRecord();
- free_send_records_[idx] = send_records_ + idx;
- }
- }
- }
-
- ~TcpZerocopySendCtx() {
- if (send_records_ != nullptr) {
- for (int idx = 0; idx < max_sends_; ++idx) {
- send_records_[idx].~TcpZerocopySendRecord();
- }
- }
- gpr_free(send_records_);
- gpr_free(free_send_records_);
- }
-
- // True if we were unable to allocate the various bookkeeping structures at
- // transport initialization time. If memory limited, we do not zerocopy.
- bool memory_limited() const { return memory_limited_; }
-
- // TCP send zerocopy maintains an implicit sequence number for every
- // successful sendmsg() with zerocopy enabled; the kernel later gives us an
- // error queue notification with this sequence number indicating that the
- // underlying data buffers that we sent can now be released. Once that
- // notification is received, we can release the buffers associated with this
- // zerocopy send record. Here, we associate the sequence number with the data
- // buffers that were sent with the corresponding call to sendmsg().
- void NoteSend(TcpZerocopySendRecord* record) {
- record->Ref();
- AssociateSeqWithSendRecord(last_send_, record);
- ++last_send_;
- }
-
- // If sendmsg() actually failed, though, we need to revert the sequence number
- // that we speculatively bumped before calling sendmsg(). Note that we bump
- // this sequence number and perform relevant bookkeeping (see: NoteSend())
- // *before* calling sendmsg() since, if we called it *after* sendmsg(), then
- // there is a possible race with the release notification which could occur on
- // another thread before we do the necessary bookkeeping. Hence, calling
- // NoteSend() *before* sendmsg() and implementing an undo function is needed.
- void UndoSend() {
- --last_send_;
- if (ReleaseSendRecord(last_send_)->Unref()) {
- // We should still be holding the ref taken by tcp_write().
- GPR_DEBUG_ASSERT(0);
- }
- }
-
- // Simply associate this send record (and the underlying sent data buffers)
- // with the implicit sequence number for this zerocopy sendmsg().
- void AssociateSeqWithSendRecord(uint32_t seq, TcpZerocopySendRecord* record) {
- MutexLock guard(&lock_);
- ctx_lookup_.emplace(seq, record);
- }
-
- // Get a send record for a send that we wish to do with zerocopy.
- TcpZerocopySendRecord* GetSendRecord() {
- MutexLock guard(&lock_);
- return TryGetSendRecordLocked();
- }
-
- // A given send record corresponds to a single tcp_write() with zerocopy
- // enabled. This can result in several sendmsg() calls to flush all of the
- // data to wire. Each sendmsg() takes a reference on the
- // TcpZerocopySendRecord, and corresponds to a single sequence number.
- // ReleaseSendRecord releases a reference on TcpZerocopySendRecord for a
- // single sequence number. This is called either when we receive the relevant
- // error queue notification (saying that we can discard the underlying
- // buffers for this sendmsg()) is received from the kernel - or, in case
- // sendmsg() was unsuccessful to begin with.
- TcpZerocopySendRecord* ReleaseSendRecord(uint32_t seq) {
- MutexLock guard(&lock_);
- return ReleaseSendRecordLocked(seq);
- }
-
- // After all the references to a TcpZerocopySendRecord are released, we can
- // add it back to the pool (of size max_sends_). Note that we can only have
- // max_sends_ tcp_write() instances with zerocopy enabled in flight at the
- // same time.
- void PutSendRecord(TcpZerocopySendRecord* record) {
- GPR_DEBUG_ASSERT(record >= send_records_ &&
- record < send_records_ + max_sends_);
- MutexLock guard(&lock_);
- PutSendRecordLocked(record);
- }
-
- // Indicate that we are disposing of this zerocopy context. This indicator
- // will prevent new zerocopy writes from being issued.
- void Shutdown() { shutdown_.Store(true, MemoryOrder::RELEASE); }
-
- // Indicates that there are no inflight tcp_write() instances with zerocopy
- // enabled.
- bool AllSendRecordsEmpty() {
- MutexLock guard(&lock_);
- return free_send_records_size_ == max_sends_;
- }
-
- bool enabled() const { return enabled_; }
-
- void set_enabled(bool enabled) {
- GPR_DEBUG_ASSERT(!enabled || !memory_limited());
- enabled_ = enabled;
- }
-
- // Only use zerocopy if we are sending at least this many bytes. The
- // additional overhead of reading the error queue for notifications means that
- // zerocopy is not useful for small transfers.
- size_t threshold_bytes() const { return threshold_bytes_; }
-
- private:
- TcpZerocopySendRecord* ReleaseSendRecordLocked(uint32_t seq) {
- auto iter = ctx_lookup_.find(seq);
- GPR_DEBUG_ASSERT(iter != ctx_lookup_.end());
- TcpZerocopySendRecord* record = iter->second;
- ctx_lookup_.erase(iter);
- return record;
- }
-
- TcpZerocopySendRecord* TryGetSendRecordLocked() {
- if (shutdown_.Load(MemoryOrder::ACQUIRE)) {
- return nullptr;
- }
- if (free_send_records_size_ == 0) {
- return nullptr;
- }
- free_send_records_size_--;
- return free_send_records_[free_send_records_size_];
- }
-
- void PutSendRecordLocked(TcpZerocopySendRecord* record) {
- GPR_DEBUG_ASSERT(free_send_records_size_ < max_sends_);
- free_send_records_[free_send_records_size_] = record;
- free_send_records_size_++;
- }
-
- TcpZerocopySendRecord* send_records_;
- TcpZerocopySendRecord** free_send_records_;
- int max_sends_;
- int free_send_records_size_;
- Mutex lock_;
- uint32_t last_send_ = 0;
- Atomic<bool> shutdown_;
- bool enabled_ = false;
- size_t threshold_bytes_ = kDefaultSendBytesThreshold;
- std::unordered_map<uint32_t, TcpZerocopySendRecord*> ctx_lookup_;
- bool memory_limited_ = false;
-};
-
-} // namespace grpc_core
-
-using grpc_core::TcpZerocopySendCtx;
-using grpc_core::TcpZerocopySendRecord;
-
+namespace grpc_core {
+
+class TcpZerocopySendRecord {
+ public:
+ TcpZerocopySendRecord() { grpc_slice_buffer_init(&buf_); }
+
+ ~TcpZerocopySendRecord() {
+ AssertEmpty();
+ grpc_slice_buffer_destroy_internal(&buf_);
+ }
+
+ // Given the slices that we wish to send, and the current offset into the
+ // slice buffer (indicating which have already been sent), populate an iovec
+ // array that will be used for a zerocopy enabled sendmsg().
+ msg_iovlen_type PopulateIovs(size_t* unwind_slice_idx,
+ size_t* unwind_byte_idx, size_t* sending_length,
+ iovec* iov);
+
+ // A sendmsg() may not be able to send the bytes that we requested at this
+ // time, returning EAGAIN (possibly due to backpressure). In this case,
+ // unwind the offset into the slice buffer so we retry sending these bytes.
+ void UnwindIfThrottled(size_t unwind_slice_idx, size_t unwind_byte_idx) {
+ out_offset_.byte_idx = unwind_byte_idx;
+ out_offset_.slice_idx = unwind_slice_idx;
+ }
+
+ // Update the offset into the slice buffer based on how much we wanted to sent
+ // vs. what sendmsg() actually sent (which may be lower, possibly due to
+ // backpressure).
+ void UpdateOffsetForBytesSent(size_t sending_length, size_t actually_sent);
+
+ // Indicates whether all underlying data has been sent or not.
+ bool AllSlicesSent() { return out_offset_.slice_idx == buf_.count; }
+
+ // Reset this structure for a new tcp_write() with zerocopy.
+ void PrepareForSends(grpc_slice_buffer* slices_to_send) {
+ AssertEmpty();
+ out_offset_.slice_idx = 0;
+ out_offset_.byte_idx = 0;
+ grpc_slice_buffer_swap(slices_to_send, &buf_);
+ Ref();
+ }
+
+ // References: 1 reference per sendmsg(), and 1 for the tcp_write().
+ void Ref() { ref_.FetchAdd(1, MemoryOrder::RELAXED); }
+
+ // Unref: called when we get an error queue notification for a sendmsg(), if a
+ // sendmsg() failed or when tcp_write() is done.
+ bool Unref() {
+ const intptr_t prior = ref_.FetchSub(1, MemoryOrder::ACQ_REL);
+ GPR_DEBUG_ASSERT(prior > 0);
+ if (prior == 1) {
+ AllSendsComplete();
+ return true;
+ }
+ return false;
+ }
+
+ private:
+ struct OutgoingOffset {
+ size_t slice_idx = 0;
+ size_t byte_idx = 0;
+ };
+
+ void AssertEmpty() {
+ GPR_DEBUG_ASSERT(buf_.count == 0);
+ GPR_DEBUG_ASSERT(buf_.length == 0);
+ GPR_DEBUG_ASSERT(ref_.Load(MemoryOrder::RELAXED) == 0);
+ }
+
+ // When all sendmsg() calls associated with this tcp_write() have been
+ // completed (ie. we have received the notifications for each sequence number
+ // for each sendmsg()) and all reference counts have been dropped, drop our
+ // reference to the underlying data since we no longer need it.
+ void AllSendsComplete() {
+ GPR_DEBUG_ASSERT(ref_.Load(MemoryOrder::RELAXED) == 0);
+ grpc_slice_buffer_reset_and_unref_internal(&buf_);
+ }
+
+ grpc_slice_buffer buf_;
+ Atomic<intptr_t> ref_;
+ OutgoingOffset out_offset_;
+};
+
+class TcpZerocopySendCtx {
+ public:
+ static constexpr int kDefaultMaxSends = 4;
+ static constexpr size_t kDefaultSendBytesThreshold = 16 * 1024; // 16KB
+
+ TcpZerocopySendCtx(int max_sends = kDefaultMaxSends,
+ size_t send_bytes_threshold = kDefaultSendBytesThreshold)
+ : max_sends_(max_sends),
+ free_send_records_size_(max_sends),
+ threshold_bytes_(send_bytes_threshold) {
+ send_records_ = static_cast<TcpZerocopySendRecord*>(
+ gpr_malloc(max_sends * sizeof(*send_records_)));
+ free_send_records_ = static_cast<TcpZerocopySendRecord**>(
+ gpr_malloc(max_sends * sizeof(*free_send_records_)));
+ if (send_records_ == nullptr || free_send_records_ == nullptr) {
+ gpr_free(send_records_);
+ gpr_free(free_send_records_);
+ gpr_log(GPR_INFO, "Disabling TCP TX zerocopy due to memory pressure.\n");
+ memory_limited_ = true;
+ } else {
+ for (int idx = 0; idx < max_sends_; ++idx) {
+ new (send_records_ + idx) TcpZerocopySendRecord();
+ free_send_records_[idx] = send_records_ + idx;
+ }
+ }
+ }
+
+ ~TcpZerocopySendCtx() {
+ if (send_records_ != nullptr) {
+ for (int idx = 0; idx < max_sends_; ++idx) {
+ send_records_[idx].~TcpZerocopySendRecord();
+ }
+ }
+ gpr_free(send_records_);
+ gpr_free(free_send_records_);
+ }
+
+ // True if we were unable to allocate the various bookkeeping structures at
+ // transport initialization time. If memory limited, we do not zerocopy.
+ bool memory_limited() const { return memory_limited_; }
+
+ // TCP send zerocopy maintains an implicit sequence number for every
+ // successful sendmsg() with zerocopy enabled; the kernel later gives us an
+ // error queue notification with this sequence number indicating that the
+ // underlying data buffers that we sent can now be released. Once that
+ // notification is received, we can release the buffers associated with this
+ // zerocopy send record. Here, we associate the sequence number with the data
+ // buffers that were sent with the corresponding call to sendmsg().
+ void NoteSend(TcpZerocopySendRecord* record) {
+ record->Ref();
+ AssociateSeqWithSendRecord(last_send_, record);
+ ++last_send_;
+ }
+
+ // If sendmsg() actually failed, though, we need to revert the sequence number
+ // that we speculatively bumped before calling sendmsg(). Note that we bump
+ // this sequence number and perform relevant bookkeeping (see: NoteSend())
+ // *before* calling sendmsg() since, if we called it *after* sendmsg(), then
+ // there is a possible race with the release notification which could occur on
+ // another thread before we do the necessary bookkeeping. Hence, calling
+ // NoteSend() *before* sendmsg() and implementing an undo function is needed.
+ void UndoSend() {
+ --last_send_;
+ if (ReleaseSendRecord(last_send_)->Unref()) {
+ // We should still be holding the ref taken by tcp_write().
+ GPR_DEBUG_ASSERT(0);
+ }
+ }
+
+ // Simply associate this send record (and the underlying sent data buffers)
+ // with the implicit sequence number for this zerocopy sendmsg().
+ void AssociateSeqWithSendRecord(uint32_t seq, TcpZerocopySendRecord* record) {
+ MutexLock guard(&lock_);
+ ctx_lookup_.emplace(seq, record);
+ }
+
+ // Get a send record for a send that we wish to do with zerocopy.
+ TcpZerocopySendRecord* GetSendRecord() {
+ MutexLock guard(&lock_);
+ return TryGetSendRecordLocked();
+ }
+
+ // A given send record corresponds to a single tcp_write() with zerocopy
+ // enabled. This can result in several sendmsg() calls to flush all of the
+ // data to wire. Each sendmsg() takes a reference on the
+ // TcpZerocopySendRecord, and corresponds to a single sequence number.
+ // ReleaseSendRecord releases a reference on TcpZerocopySendRecord for a
+ // single sequence number. This is called either when we receive the relevant
+ // error queue notification (saying that we can discard the underlying
+ // buffers for this sendmsg()) is received from the kernel - or, in case
+ // sendmsg() was unsuccessful to begin with.
+ TcpZerocopySendRecord* ReleaseSendRecord(uint32_t seq) {
+ MutexLock guard(&lock_);
+ return ReleaseSendRecordLocked(seq);
+ }
+
+ // After all the references to a TcpZerocopySendRecord are released, we can
+ // add it back to the pool (of size max_sends_). Note that we can only have
+ // max_sends_ tcp_write() instances with zerocopy enabled in flight at the
+ // same time.
+ void PutSendRecord(TcpZerocopySendRecord* record) {
+ GPR_DEBUG_ASSERT(record >= send_records_ &&
+ record < send_records_ + max_sends_);
+ MutexLock guard(&lock_);
+ PutSendRecordLocked(record);
+ }
+
+ // Indicate that we are disposing of this zerocopy context. This indicator
+ // will prevent new zerocopy writes from being issued.
+ void Shutdown() { shutdown_.Store(true, MemoryOrder::RELEASE); }
+
+ // Indicates that there are no inflight tcp_write() instances with zerocopy
+ // enabled.
+ bool AllSendRecordsEmpty() {
+ MutexLock guard(&lock_);
+ return free_send_records_size_ == max_sends_;
+ }
+
+ bool enabled() const { return enabled_; }
+
+ void set_enabled(bool enabled) {
+ GPR_DEBUG_ASSERT(!enabled || !memory_limited());
+ enabled_ = enabled;
+ }
+
+ // Only use zerocopy if we are sending at least this many bytes. The
+ // additional overhead of reading the error queue for notifications means that
+ // zerocopy is not useful for small transfers.
+ size_t threshold_bytes() const { return threshold_bytes_; }
+
+ private:
+ TcpZerocopySendRecord* ReleaseSendRecordLocked(uint32_t seq) {
+ auto iter = ctx_lookup_.find(seq);
+ GPR_DEBUG_ASSERT(iter != ctx_lookup_.end());
+ TcpZerocopySendRecord* record = iter->second;
+ ctx_lookup_.erase(iter);
+ return record;
+ }
+
+ TcpZerocopySendRecord* TryGetSendRecordLocked() {
+ if (shutdown_.Load(MemoryOrder::ACQUIRE)) {
+ return nullptr;
+ }
+ if (free_send_records_size_ == 0) {
+ return nullptr;
+ }
+ free_send_records_size_--;
+ return free_send_records_[free_send_records_size_];
+ }
+
+ void PutSendRecordLocked(TcpZerocopySendRecord* record) {
+ GPR_DEBUG_ASSERT(free_send_records_size_ < max_sends_);
+ free_send_records_[free_send_records_size_] = record;
+ free_send_records_size_++;
+ }
+
+ TcpZerocopySendRecord* send_records_;
+ TcpZerocopySendRecord** free_send_records_;
+ int max_sends_;
+ int free_send_records_size_;
+ Mutex lock_;
+ uint32_t last_send_ = 0;
+ Atomic<bool> shutdown_;
+ bool enabled_ = false;
+ size_t threshold_bytes_ = kDefaultSendBytesThreshold;
+ std::unordered_map<uint32_t, TcpZerocopySendRecord*> ctx_lookup_;
+ bool memory_limited_ = false;
+};
+
+} // namespace grpc_core
+
+using grpc_core::TcpZerocopySendCtx;
+using grpc_core::TcpZerocopySendRecord;
+
namespace {
struct grpc_tcp {
- grpc_tcp(int max_sends, size_t send_bytes_threshold)
- : tcp_zerocopy_send_ctx(max_sends, send_bytes_threshold) {}
+ grpc_tcp(int max_sends, size_t send_bytes_threshold)
+ : tcp_zerocopy_send_ctx(max_sends, send_bytes_threshold) {}
grpc_endpoint base;
grpc_fd* em_fd;
int fd;
@@ -388,8 +388,8 @@ struct grpc_tcp {
grpc_closure write_done_closure;
grpc_closure error_closure;
- TString peer_string;
- TString local_address;
+ TString peer_string;
+ TString local_address;
grpc_resource_user* resource_user;
grpc_resource_user_slice_allocator slice_allocator;
@@ -416,8 +416,8 @@ struct grpc_tcp {
bool ts_capable; /* Cache whether we can set timestamping options */
gpr_atm stop_error_notification; /* Set to 1 if we do not want to be notified
on errors anymore */
- TcpZerocopySendCtx tcp_zerocopy_send_ctx;
- TcpZerocopySendRecord* current_zerocopy_send = nullptr;
+ TcpZerocopySendCtx tcp_zerocopy_send_ctx;
+ TcpZerocopySendRecord* current_zerocopy_send = nullptr;
};
struct backup_poller {
@@ -427,8 +427,8 @@ struct backup_poller {
} // namespace
-static void ZerocopyDisableAndWaitForRemaining(grpc_tcp* tcp);
-
+static void ZerocopyDisableAndWaitForRemaining(grpc_tcp* tcp);
+
#define BACKUP_POLLER_POLLSET(b) ((grpc_pollset*)((b) + 1))
static gpr_atm g_uncovered_notifications_pending;
@@ -609,7 +609,7 @@ static grpc_error* tcp_annotate_error(grpc_error* src_error, grpc_tcp* tcp) {
* choose to retry. */
GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE),
GRPC_ERROR_STR_TARGET_ADDRESS,
- grpc_slice_from_copied_string(tcp->peer_string.c_str()));
+ grpc_slice_from_copied_string(tcp->peer_string.c_str()));
}
static void tcp_handle_read(void* arg /* grpc_tcp */, grpc_error* error);
@@ -617,7 +617,7 @@ static void tcp_handle_write(void* arg /* grpc_tcp */, grpc_error* error);
static void tcp_shutdown(grpc_endpoint* ep, grpc_error* why) {
grpc_tcp* tcp = reinterpret_cast<grpc_tcp*>(ep);
- ZerocopyDisableAndWaitForRemaining(tcp);
+ ZerocopyDisableAndWaitForRemaining(tcp);
grpc_fd_shutdown(tcp->em_fd, why);
grpc_resource_user_shutdown(tcp->resource_user);
}
@@ -635,7 +635,7 @@ static void tcp_free(grpc_tcp* tcp) {
gpr_mu_unlock(&tcp->tb_mu);
tcp->outgoing_buffer_arg = nullptr;
gpr_mu_destroy(&tcp->tb_mu);
- delete tcp;
+ delete tcp;
}
#ifndef NDEBUG
@@ -668,7 +668,7 @@ static void tcp_destroy(grpc_endpoint* ep) {
grpc_tcp* tcp = reinterpret_cast<grpc_tcp*>(ep);
grpc_slice_buffer_reset_and_unref_internal(&tcp->last_read_buffer);
if (grpc_event_engine_can_track_errors()) {
- ZerocopyDisableAndWaitForRemaining(tcp);
+ ZerocopyDisableAndWaitForRemaining(tcp);
gpr_atm_no_barrier_store(&tcp->stop_error_notification, true);
grpc_fd_set_error(tcp->em_fd);
}
@@ -682,8 +682,8 @@ static void call_read_cb(grpc_tcp* tcp, grpc_error* error) {
gpr_log(GPR_INFO, "TCP:%p call_cb %p %p:%p", tcp, cb, cb->cb, cb->cb_arg);
size_t i;
const char* str = grpc_error_string(error);
- gpr_log(GPR_INFO, "READ %p (peer=%s) error=%s", tcp,
- tcp->peer_string.c_str(), str);
+ gpr_log(GPR_INFO, "READ %p (peer=%s) error=%s", tcp,
+ tcp->peer_string.c_str(), str);
if (gpr_should_log(GPR_LOG_SEVERITY_DEBUG)) {
for (i = 0; i < tcp->incoming_buffer->count; i++) {
@@ -932,13 +932,13 @@ static void tcp_read(grpc_endpoint* ep, grpc_slice_buffer* incoming_buffer,
/* A wrapper around sendmsg. It sends \a msg over \a fd and returns the number
* of bytes sent. */
-ssize_t tcp_send(int fd, const struct msghdr* msg, int additional_flags = 0) {
+ssize_t tcp_send(int fd, const struct msghdr* msg, int additional_flags = 0) {
GPR_TIMER_SCOPE("sendmsg", 1);
ssize_t sent_length;
do {
/* TODO(klempner): Cork if this is a partial write */
GRPC_STATS_INC_SYSCALL_WRITE();
- sent_length = sendmsg(fd, msg, SENDMSG_FLAGS | additional_flags);
+ sent_length = sendmsg(fd, msg, SENDMSG_FLAGS | additional_flags);
} while (sent_length < 0 && errno == EINTR);
return sent_length;
}
@@ -951,52 +951,52 @@ ssize_t tcp_send(int fd, const struct msghdr* msg, int additional_flags = 0) {
*/
static bool tcp_write_with_timestamps(grpc_tcp* tcp, struct msghdr* msg,
size_t sending_length,
- ssize_t* sent_length,
- int additional_flags = 0);
+ ssize_t* sent_length,
+ int additional_flags = 0);
/** The callback function to be invoked when we get an error on the socket. */
static void tcp_handle_error(void* arg /* grpc_tcp */, grpc_error* error);
-static TcpZerocopySendRecord* tcp_get_send_zerocopy_record(
- grpc_tcp* tcp, grpc_slice_buffer* buf);
-
+static TcpZerocopySendRecord* tcp_get_send_zerocopy_record(
+ grpc_tcp* tcp, grpc_slice_buffer* buf);
+
#ifdef GRPC_LINUX_ERRQUEUE
-static bool process_errors(grpc_tcp* tcp);
-
-static TcpZerocopySendRecord* tcp_get_send_zerocopy_record(
- grpc_tcp* tcp, grpc_slice_buffer* buf) {
- TcpZerocopySendRecord* zerocopy_send_record = nullptr;
- const bool use_zerocopy =
- tcp->tcp_zerocopy_send_ctx.enabled() &&
- tcp->tcp_zerocopy_send_ctx.threshold_bytes() < buf->length;
- if (use_zerocopy) {
- zerocopy_send_record = tcp->tcp_zerocopy_send_ctx.GetSendRecord();
- if (zerocopy_send_record == nullptr) {
- process_errors(tcp);
- zerocopy_send_record = tcp->tcp_zerocopy_send_ctx.GetSendRecord();
- }
- if (zerocopy_send_record != nullptr) {
- zerocopy_send_record->PrepareForSends(buf);
- GPR_DEBUG_ASSERT(buf->count == 0);
- GPR_DEBUG_ASSERT(buf->length == 0);
- tcp->outgoing_byte_idx = 0;
- tcp->outgoing_buffer = nullptr;
- }
- }
- return zerocopy_send_record;
-}
-
-static void ZerocopyDisableAndWaitForRemaining(grpc_tcp* tcp) {
- tcp->tcp_zerocopy_send_ctx.Shutdown();
- while (!tcp->tcp_zerocopy_send_ctx.AllSendRecordsEmpty()) {
- process_errors(tcp);
- }
-}
-
+static bool process_errors(grpc_tcp* tcp);
+
+static TcpZerocopySendRecord* tcp_get_send_zerocopy_record(
+ grpc_tcp* tcp, grpc_slice_buffer* buf) {
+ TcpZerocopySendRecord* zerocopy_send_record = nullptr;
+ const bool use_zerocopy =
+ tcp->tcp_zerocopy_send_ctx.enabled() &&
+ tcp->tcp_zerocopy_send_ctx.threshold_bytes() < buf->length;
+ if (use_zerocopy) {
+ zerocopy_send_record = tcp->tcp_zerocopy_send_ctx.GetSendRecord();
+ if (zerocopy_send_record == nullptr) {
+ process_errors(tcp);
+ zerocopy_send_record = tcp->tcp_zerocopy_send_ctx.GetSendRecord();
+ }
+ if (zerocopy_send_record != nullptr) {
+ zerocopy_send_record->PrepareForSends(buf);
+ GPR_DEBUG_ASSERT(buf->count == 0);
+ GPR_DEBUG_ASSERT(buf->length == 0);
+ tcp->outgoing_byte_idx = 0;
+ tcp->outgoing_buffer = nullptr;
+ }
+ }
+ return zerocopy_send_record;
+}
+
+static void ZerocopyDisableAndWaitForRemaining(grpc_tcp* tcp) {
+ tcp->tcp_zerocopy_send_ctx.Shutdown();
+ while (!tcp->tcp_zerocopy_send_ctx.AllSendRecordsEmpty()) {
+ process_errors(tcp);
+ }
+}
+
static bool tcp_write_with_timestamps(grpc_tcp* tcp, struct msghdr* msg,
size_t sending_length,
- ssize_t* sent_length,
- int additional_flags) {
+ ssize_t* sent_length,
+ int additional_flags) {
if (!tcp->socket_ts_enabled) {
uint32_t opt = grpc_core::kTimestampingSocketOptions;
if (setsockopt(tcp->fd, SOL_SOCKET, SO_TIMESTAMPING,
@@ -1024,7 +1024,7 @@ static bool tcp_write_with_timestamps(grpc_tcp* tcp, struct msghdr* msg,
msg->msg_controllen = CMSG_SPACE(sizeof(uint32_t));
/* If there was an error on sendmsg the logic in tcp_flush will handle it. */
- ssize_t length = tcp_send(tcp->fd, msg, additional_flags);
+ ssize_t length = tcp_send(tcp->fd, msg, additional_flags);
*sent_length = length;
/* Only save timestamps if all the bytes were taken by sendmsg. */
if (sending_length == static_cast<size_t>(length)) {
@@ -1038,43 +1038,43 @@ static bool tcp_write_with_timestamps(grpc_tcp* tcp, struct msghdr* msg,
return true;
}
-static void UnrefMaybePutZerocopySendRecord(grpc_tcp* tcp,
- TcpZerocopySendRecord* record,
- uint32_t seq, const char* tag);
-// Reads \a cmsg to process zerocopy control messages.
-static void process_zerocopy(grpc_tcp* tcp, struct cmsghdr* cmsg) {
- GPR_DEBUG_ASSERT(cmsg);
- auto serr = reinterpret_cast<struct sock_extended_err*>(CMSG_DATA(cmsg));
- GPR_DEBUG_ASSERT(serr->ee_errno == 0);
- GPR_DEBUG_ASSERT(serr->ee_origin == SO_EE_ORIGIN_ZEROCOPY);
- const uint32_t lo = serr->ee_info;
- const uint32_t hi = serr->ee_data;
- for (uint32_t seq = lo; seq <= hi; ++seq) {
- // TODO(arjunroy): It's likely that lo and hi refer to zerocopy sequence
- // numbers that are generated by a single call to grpc_endpoint_write; ie.
- // we can batch the unref operation. So, check if record is the same for
- // both; if so, batch the unref/put.
- TcpZerocopySendRecord* record =
- tcp->tcp_zerocopy_send_ctx.ReleaseSendRecord(seq);
- GPR_DEBUG_ASSERT(record);
- UnrefMaybePutZerocopySendRecord(tcp, record, seq, "CALLBACK RCVD");
- }
-}
-
-// Whether the cmsg received from error queue is of the IPv4 or IPv6 levels.
-static bool CmsgIsIpLevel(const cmsghdr& cmsg) {
- return (cmsg.cmsg_level == SOL_IPV6 && cmsg.cmsg_type == IPV6_RECVERR) ||
- (cmsg.cmsg_level == SOL_IP && cmsg.cmsg_type == IP_RECVERR);
-}
-
-static bool CmsgIsZeroCopy(const cmsghdr& cmsg) {
- if (!CmsgIsIpLevel(cmsg)) {
- return false;
- }
- auto serr = reinterpret_cast<const sock_extended_err*> CMSG_DATA(&cmsg);
- return serr->ee_errno == 0 && serr->ee_origin == SO_EE_ORIGIN_ZEROCOPY;
-}
-
+static void UnrefMaybePutZerocopySendRecord(grpc_tcp* tcp,
+ TcpZerocopySendRecord* record,
+ uint32_t seq, const char* tag);
+// Reads \a cmsg to process zerocopy control messages.
+static void process_zerocopy(grpc_tcp* tcp, struct cmsghdr* cmsg) {
+ GPR_DEBUG_ASSERT(cmsg);
+ auto serr = reinterpret_cast<struct sock_extended_err*>(CMSG_DATA(cmsg));
+ GPR_DEBUG_ASSERT(serr->ee_errno == 0);
+ GPR_DEBUG_ASSERT(serr->ee_origin == SO_EE_ORIGIN_ZEROCOPY);
+ const uint32_t lo = serr->ee_info;
+ const uint32_t hi = serr->ee_data;
+ for (uint32_t seq = lo; seq <= hi; ++seq) {
+ // TODO(arjunroy): It's likely that lo and hi refer to zerocopy sequence
+ // numbers that are generated by a single call to grpc_endpoint_write; ie.
+ // we can batch the unref operation. So, check if record is the same for
+ // both; if so, batch the unref/put.
+ TcpZerocopySendRecord* record =
+ tcp->tcp_zerocopy_send_ctx.ReleaseSendRecord(seq);
+ GPR_DEBUG_ASSERT(record);
+ UnrefMaybePutZerocopySendRecord(tcp, record, seq, "CALLBACK RCVD");
+ }
+}
+
+// Whether the cmsg received from error queue is of the IPv4 or IPv6 levels.
+static bool CmsgIsIpLevel(const cmsghdr& cmsg) {
+ return (cmsg.cmsg_level == SOL_IPV6 && cmsg.cmsg_type == IPV6_RECVERR) ||
+ (cmsg.cmsg_level == SOL_IP && cmsg.cmsg_type == IP_RECVERR);
+}
+
+static bool CmsgIsZeroCopy(const cmsghdr& cmsg) {
+ if (!CmsgIsIpLevel(cmsg)) {
+ return false;
+ }
+ auto serr = reinterpret_cast<const sock_extended_err*> CMSG_DATA(&cmsg);
+ return serr->ee_errno == 0 && serr->ee_origin == SO_EE_ORIGIN_ZEROCOPY;
+}
+
/** Reads \a cmsg to derive timestamps from the control messages. If a valid
* timestamp is found, the traced buffer list is updated with this timestamp.
* The caller of this function should be looping on the control messages found
@@ -1136,31 +1136,31 @@ struct cmsghdr* process_timestamp(grpc_tcp* tcp, msghdr* msg,
/** For linux platforms, reads the socket's error queue and processes error
* messages from the queue.
*/
-static bool process_errors(grpc_tcp* tcp) {
- bool processed_err = false;
- struct iovec iov;
- iov.iov_base = nullptr;
- iov.iov_len = 0;
- struct msghdr msg;
- msg.msg_name = nullptr;
- msg.msg_namelen = 0;
- msg.msg_iov = &iov;
- msg.msg_iovlen = 0;
- msg.msg_flags = 0;
- /* Allocate enough space so we don't need to keep increasing this as size
- * of OPT_STATS increase */
- constexpr size_t cmsg_alloc_space =
- CMSG_SPACE(sizeof(grpc_core::scm_timestamping)) +
- CMSG_SPACE(sizeof(sock_extended_err) + sizeof(sockaddr_in)) +
- CMSG_SPACE(32 * NLA_ALIGN(NLA_HDRLEN + sizeof(uint64_t)));
- /* Allocate aligned space for cmsgs received along with timestamps */
- union {
- char rbuf[cmsg_alloc_space];
- struct cmsghdr align;
- } aligned_buf;
- msg.msg_control = aligned_buf.rbuf;
- msg.msg_controllen = sizeof(aligned_buf.rbuf);
- int r, saved_errno;
+static bool process_errors(grpc_tcp* tcp) {
+ bool processed_err = false;
+ struct iovec iov;
+ iov.iov_base = nullptr;
+ iov.iov_len = 0;
+ struct msghdr msg;
+ msg.msg_name = nullptr;
+ msg.msg_namelen = 0;
+ msg.msg_iov = &iov;
+ msg.msg_iovlen = 0;
+ msg.msg_flags = 0;
+ /* Allocate enough space so we don't need to keep increasing this as size
+ * of OPT_STATS increase */
+ constexpr size_t cmsg_alloc_space =
+ CMSG_SPACE(sizeof(grpc_core::scm_timestamping)) +
+ CMSG_SPACE(sizeof(sock_extended_err) + sizeof(sockaddr_in)) +
+ CMSG_SPACE(32 * NLA_ALIGN(NLA_HDRLEN + sizeof(uint64_t)));
+ /* Allocate aligned space for cmsgs received along with timestamps */
+ union {
+ char rbuf[cmsg_alloc_space];
+ struct cmsghdr align;
+ } aligned_buf;
+ msg.msg_control = aligned_buf.rbuf;
+ msg.msg_controllen = sizeof(aligned_buf.rbuf);
+ int r, saved_errno;
while (true) {
do {
r = recvmsg(tcp->fd, &msg, MSG_ERRQUEUE);
@@ -1168,44 +1168,44 @@ static bool process_errors(grpc_tcp* tcp) {
} while (r < 0 && saved_errno == EINTR);
if (r == -1 && saved_errno == EAGAIN) {
- return processed_err; /* No more errors to process */
+ return processed_err; /* No more errors to process */
}
if (r == -1) {
- return processed_err;
+ return processed_err;
}
- if (GPR_UNLIKELY((msg.msg_flags & MSG_CTRUNC) != 0)) {
+ if (GPR_UNLIKELY((msg.msg_flags & MSG_CTRUNC) != 0)) {
gpr_log(GPR_ERROR, "Error message was truncated.");
}
if (msg.msg_controllen == 0) {
/* There was no control message found. It was probably spurious. */
- return processed_err;
+ return processed_err;
}
bool seen = false;
for (auto cmsg = CMSG_FIRSTHDR(&msg); cmsg && cmsg->cmsg_len;
cmsg = CMSG_NXTHDR(&msg, cmsg)) {
- if (CmsgIsZeroCopy(*cmsg)) {
- process_zerocopy(tcp, cmsg);
- seen = true;
- processed_err = true;
- } else if (cmsg->cmsg_level == SOL_SOCKET &&
- cmsg->cmsg_type == SCM_TIMESTAMPING) {
- cmsg = process_timestamp(tcp, &msg, cmsg);
- seen = true;
- processed_err = true;
- } else {
- /* Got a control message that is not a timestamp or zerocopy. Don't know
- * how to handle this. */
+ if (CmsgIsZeroCopy(*cmsg)) {
+ process_zerocopy(tcp, cmsg);
+ seen = true;
+ processed_err = true;
+ } else if (cmsg->cmsg_level == SOL_SOCKET &&
+ cmsg->cmsg_type == SCM_TIMESTAMPING) {
+ cmsg = process_timestamp(tcp, &msg, cmsg);
+ seen = true;
+ processed_err = true;
+ } else {
+ /* Got a control message that is not a timestamp or zerocopy. Don't know
+ * how to handle this. */
if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) {
gpr_log(GPR_INFO,
"unknown control message cmsg_level:%d cmsg_type:%d",
cmsg->cmsg_level, cmsg->cmsg_type);
}
- return processed_err;
+ return processed_err;
}
}
if (!seen) {
- return processed_err;
+ return processed_err;
}
}
}
@@ -1226,28 +1226,28 @@ static void tcp_handle_error(void* arg /* grpc_tcp */, grpc_error* error) {
/* We are still interested in collecting timestamps, so let's try reading
* them. */
- bool processed = process_errors(tcp);
+ bool processed = process_errors(tcp);
/* This might not a timestamps error. Set the read and write closures to be
* ready. */
- if (!processed) {
- grpc_fd_set_readable(tcp->em_fd);
- grpc_fd_set_writable(tcp->em_fd);
- }
+ if (!processed) {
+ grpc_fd_set_readable(tcp->em_fd);
+ grpc_fd_set_writable(tcp->em_fd);
+ }
grpc_fd_notify_on_error(tcp->em_fd, &tcp->error_closure);
}
#else /* GRPC_LINUX_ERRQUEUE */
-static TcpZerocopySendRecord* tcp_get_send_zerocopy_record(
- grpc_tcp* tcp, grpc_slice_buffer* buf) {
- return nullptr;
-}
-
-static void ZerocopyDisableAndWaitForRemaining(grpc_tcp* tcp) {}
-
+static TcpZerocopySendRecord* tcp_get_send_zerocopy_record(
+ grpc_tcp* tcp, grpc_slice_buffer* buf) {
+ return nullptr;
+}
+
+static void ZerocopyDisableAndWaitForRemaining(grpc_tcp* tcp) {}
+
static bool tcp_write_with_timestamps(grpc_tcp* /*tcp*/, struct msghdr* /*msg*/,
size_t /*sending_length*/,
- ssize_t* /*sent_length*/,
- int /*additional_flags*/) {
+ ssize_t* /*sent_length*/,
+ int /*additional_flags*/) {
gpr_log(GPR_ERROR, "Write with timestamps not supported for this platform");
GPR_ASSERT(0);
return false;
@@ -1278,134 +1278,134 @@ void tcp_shutdown_buffer_list(grpc_tcp* tcp) {
#else
#define MAX_WRITE_IOVEC 1000
#endif
-msg_iovlen_type TcpZerocopySendRecord::PopulateIovs(size_t* unwind_slice_idx,
- size_t* unwind_byte_idx,
- size_t* sending_length,
- iovec* iov) {
- msg_iovlen_type iov_size;
- *unwind_slice_idx = out_offset_.slice_idx;
- *unwind_byte_idx = out_offset_.byte_idx;
- for (iov_size = 0;
- out_offset_.slice_idx != buf_.count && iov_size != MAX_WRITE_IOVEC;
- iov_size++) {
- iov[iov_size].iov_base =
- GRPC_SLICE_START_PTR(buf_.slices[out_offset_.slice_idx]) +
- out_offset_.byte_idx;
- iov[iov_size].iov_len =
- GRPC_SLICE_LENGTH(buf_.slices[out_offset_.slice_idx]) -
- out_offset_.byte_idx;
- *sending_length += iov[iov_size].iov_len;
- ++(out_offset_.slice_idx);
- out_offset_.byte_idx = 0;
- }
- GPR_DEBUG_ASSERT(iov_size > 0);
- return iov_size;
-}
-
-void TcpZerocopySendRecord::UpdateOffsetForBytesSent(size_t sending_length,
- size_t actually_sent) {
- size_t trailing = sending_length - actually_sent;
- while (trailing > 0) {
- size_t slice_length;
- out_offset_.slice_idx--;
- slice_length = GRPC_SLICE_LENGTH(buf_.slices[out_offset_.slice_idx]);
- if (slice_length > trailing) {
- out_offset_.byte_idx = slice_length - trailing;
- break;
- } else {
- trailing -= slice_length;
- }
- }
-}
-
-// returns true if done, false if pending; if returning true, *error is set
-static bool do_tcp_flush_zerocopy(grpc_tcp* tcp, TcpZerocopySendRecord* record,
- grpc_error** error) {
- struct msghdr msg;
- struct iovec iov[MAX_WRITE_IOVEC];
- msg_iovlen_type iov_size;
- ssize_t sent_length = 0;
- size_t sending_length;
- size_t unwind_slice_idx;
- size_t unwind_byte_idx;
- while (true) {
- sending_length = 0;
- iov_size = record->PopulateIovs(&unwind_slice_idx, &unwind_byte_idx,
- &sending_length, iov);
- msg.msg_name = nullptr;
- msg.msg_namelen = 0;
- msg.msg_iov = iov;
- msg.msg_iovlen = iov_size;
- msg.msg_flags = 0;
- bool tried_sending_message = false;
- // Before calling sendmsg (with or without timestamps): we
- // take a single ref on the zerocopy send record.
- tcp->tcp_zerocopy_send_ctx.NoteSend(record);
- if (tcp->outgoing_buffer_arg != nullptr) {
- if (!tcp->ts_capable ||
- !tcp_write_with_timestamps(tcp, &msg, sending_length, &sent_length,
- MSG_ZEROCOPY)) {
- /* We could not set socket options to collect Fathom timestamps.
- * Fallback on writing without timestamps. */
- tcp->ts_capable = false;
- tcp_shutdown_buffer_list(tcp);
- } else {
- tried_sending_message = true;
- }
- }
- if (!tried_sending_message) {
- msg.msg_control = nullptr;
- msg.msg_controllen = 0;
- GRPC_STATS_INC_TCP_WRITE_SIZE(sending_length);
- GRPC_STATS_INC_TCP_WRITE_IOV_SIZE(iov_size);
- sent_length = tcp_send(tcp->fd, &msg, MSG_ZEROCOPY);
- }
- if (sent_length < 0) {
- // If this particular send failed, drop ref taken earlier in this method.
- tcp->tcp_zerocopy_send_ctx.UndoSend();
- if (errno == EAGAIN) {
- record->UnwindIfThrottled(unwind_slice_idx, unwind_byte_idx);
- return false;
- } else if (errno == EPIPE) {
- *error = tcp_annotate_error(GRPC_OS_ERROR(errno, "sendmsg"), tcp);
- tcp_shutdown_buffer_list(tcp);
- return true;
- } else {
- *error = tcp_annotate_error(GRPC_OS_ERROR(errno, "sendmsg"), tcp);
- tcp_shutdown_buffer_list(tcp);
- return true;
- }
- }
- tcp->bytes_counter += sent_length;
- record->UpdateOffsetForBytesSent(sending_length,
- static_cast<size_t>(sent_length));
- if (record->AllSlicesSent()) {
- *error = GRPC_ERROR_NONE;
- return true;
- }
- }
-}
-
-static void UnrefMaybePutZerocopySendRecord(grpc_tcp* tcp,
- TcpZerocopySendRecord* record,
- uint32_t seq,
- const char* /* tag */) {
- if (record->Unref()) {
- tcp->tcp_zerocopy_send_ctx.PutSendRecord(record);
- }
-}
-
-static bool tcp_flush_zerocopy(grpc_tcp* tcp, TcpZerocopySendRecord* record,
- grpc_error** error) {
- bool done = do_tcp_flush_zerocopy(tcp, record, error);
- if (done) {
- // Either we encountered an error, or we successfully sent all the bytes.
- // In either case, we're done with this record.
- UnrefMaybePutZerocopySendRecord(tcp, record, 0, "flush_done");
- }
- return done;
-}
-
+msg_iovlen_type TcpZerocopySendRecord::PopulateIovs(size_t* unwind_slice_idx,
+ size_t* unwind_byte_idx,
+ size_t* sending_length,
+ iovec* iov) {
+ msg_iovlen_type iov_size;
+ *unwind_slice_idx = out_offset_.slice_idx;
+ *unwind_byte_idx = out_offset_.byte_idx;
+ for (iov_size = 0;
+ out_offset_.slice_idx != buf_.count && iov_size != MAX_WRITE_IOVEC;
+ iov_size++) {
+ iov[iov_size].iov_base =
+ GRPC_SLICE_START_PTR(buf_.slices[out_offset_.slice_idx]) +
+ out_offset_.byte_idx;
+ iov[iov_size].iov_len =
+ GRPC_SLICE_LENGTH(buf_.slices[out_offset_.slice_idx]) -
+ out_offset_.byte_idx;
+ *sending_length += iov[iov_size].iov_len;
+ ++(out_offset_.slice_idx);
+ out_offset_.byte_idx = 0;
+ }
+ GPR_DEBUG_ASSERT(iov_size > 0);
+ return iov_size;
+}
+
+void TcpZerocopySendRecord::UpdateOffsetForBytesSent(size_t sending_length,
+ size_t actually_sent) {
+ size_t trailing = sending_length - actually_sent;
+ while (trailing > 0) {
+ size_t slice_length;
+ out_offset_.slice_idx--;
+ slice_length = GRPC_SLICE_LENGTH(buf_.slices[out_offset_.slice_idx]);
+ if (slice_length > trailing) {
+ out_offset_.byte_idx = slice_length - trailing;
+ break;
+ } else {
+ trailing -= slice_length;
+ }
+ }
+}
+
+// returns true if done, false if pending; if returning true, *error is set
+static bool do_tcp_flush_zerocopy(grpc_tcp* tcp, TcpZerocopySendRecord* record,
+ grpc_error** error) {
+ struct msghdr msg;
+ struct iovec iov[MAX_WRITE_IOVEC];
+ msg_iovlen_type iov_size;
+ ssize_t sent_length = 0;
+ size_t sending_length;
+ size_t unwind_slice_idx;
+ size_t unwind_byte_idx;
+ while (true) {
+ sending_length = 0;
+ iov_size = record->PopulateIovs(&unwind_slice_idx, &unwind_byte_idx,
+ &sending_length, iov);
+ msg.msg_name = nullptr;
+ msg.msg_namelen = 0;
+ msg.msg_iov = iov;
+ msg.msg_iovlen = iov_size;
+ msg.msg_flags = 0;
+ bool tried_sending_message = false;
+ // Before calling sendmsg (with or without timestamps): we
+ // take a single ref on the zerocopy send record.
+ tcp->tcp_zerocopy_send_ctx.NoteSend(record);
+ if (tcp->outgoing_buffer_arg != nullptr) {
+ if (!tcp->ts_capable ||
+ !tcp_write_with_timestamps(tcp, &msg, sending_length, &sent_length,
+ MSG_ZEROCOPY)) {
+ /* We could not set socket options to collect Fathom timestamps.
+ * Fallback on writing without timestamps. */
+ tcp->ts_capable = false;
+ tcp_shutdown_buffer_list(tcp);
+ } else {
+ tried_sending_message = true;
+ }
+ }
+ if (!tried_sending_message) {
+ msg.msg_control = nullptr;
+ msg.msg_controllen = 0;
+ GRPC_STATS_INC_TCP_WRITE_SIZE(sending_length);
+ GRPC_STATS_INC_TCP_WRITE_IOV_SIZE(iov_size);
+ sent_length = tcp_send(tcp->fd, &msg, MSG_ZEROCOPY);
+ }
+ if (sent_length < 0) {
+ // If this particular send failed, drop ref taken earlier in this method.
+ tcp->tcp_zerocopy_send_ctx.UndoSend();
+ if (errno == EAGAIN) {
+ record->UnwindIfThrottled(unwind_slice_idx, unwind_byte_idx);
+ return false;
+ } else if (errno == EPIPE) {
+ *error = tcp_annotate_error(GRPC_OS_ERROR(errno, "sendmsg"), tcp);
+ tcp_shutdown_buffer_list(tcp);
+ return true;
+ } else {
+ *error = tcp_annotate_error(GRPC_OS_ERROR(errno, "sendmsg"), tcp);
+ tcp_shutdown_buffer_list(tcp);
+ return true;
+ }
+ }
+ tcp->bytes_counter += sent_length;
+ record->UpdateOffsetForBytesSent(sending_length,
+ static_cast<size_t>(sent_length));
+ if (record->AllSlicesSent()) {
+ *error = GRPC_ERROR_NONE;
+ return true;
+ }
+ }
+}
+
+static void UnrefMaybePutZerocopySendRecord(grpc_tcp* tcp,
+ TcpZerocopySendRecord* record,
+ uint32_t seq,
+ const char* /* tag */) {
+ if (record->Unref()) {
+ tcp->tcp_zerocopy_send_ctx.PutSendRecord(record);
+ }
+}
+
+static bool tcp_flush_zerocopy(grpc_tcp* tcp, TcpZerocopySendRecord* record,
+ grpc_error** error) {
+ bool done = do_tcp_flush_zerocopy(tcp, record, error);
+ if (done) {
+ // Either we encountered an error, or we successfully sent all the bytes.
+ // In either case, we're done with this record.
+ UnrefMaybePutZerocopySendRecord(tcp, record, 0, "flush_done");
+ }
+ return done;
+}
+
static bool tcp_flush(grpc_tcp* tcp, grpc_error** error) {
struct msghdr msg;
struct iovec iov[MAX_WRITE_IOVEC];
@@ -1420,7 +1420,7 @@ static bool tcp_flush(grpc_tcp* tcp, grpc_error** error) {
// buffer as we write
size_t outgoing_slice_idx = 0;
- while (true) {
+ while (true) {
sending_length = 0;
unwind_slice_idx = outgoing_slice_idx;
unwind_byte_idx = tcp->outgoing_byte_idx;
@@ -1520,21 +1520,21 @@ static void tcp_handle_write(void* arg /* grpc_tcp */, grpc_error* error) {
if (error != GRPC_ERROR_NONE) {
cb = tcp->write_cb;
tcp->write_cb = nullptr;
- if (tcp->current_zerocopy_send != nullptr) {
- UnrefMaybePutZerocopySendRecord(tcp, tcp->current_zerocopy_send, 0,
- "handle_write_err");
- tcp->current_zerocopy_send = nullptr;
- }
+ if (tcp->current_zerocopy_send != nullptr) {
+ UnrefMaybePutZerocopySendRecord(tcp, tcp->current_zerocopy_send, 0,
+ "handle_write_err");
+ tcp->current_zerocopy_send = nullptr;
+ }
grpc_core::Closure::Run(DEBUG_LOCATION, cb, GRPC_ERROR_REF(error));
TCP_UNREF(tcp, "write");
return;
}
- bool flush_result =
- tcp->current_zerocopy_send != nullptr
- ? tcp_flush_zerocopy(tcp, tcp->current_zerocopy_send, &error)
- : tcp_flush(tcp, &error);
- if (!flush_result) {
+ bool flush_result =
+ tcp->current_zerocopy_send != nullptr
+ ? tcp_flush_zerocopy(tcp, tcp->current_zerocopy_send, &error)
+ : tcp_flush(tcp, &error);
+ if (!flush_result) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) {
gpr_log(GPR_INFO, "write: delayed");
}
@@ -1544,7 +1544,7 @@ static void tcp_handle_write(void* arg /* grpc_tcp */, grpc_error* error) {
} else {
cb = tcp->write_cb;
tcp->write_cb = nullptr;
- tcp->current_zerocopy_send = nullptr;
+ tcp->current_zerocopy_send = nullptr;
if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) {
const char* str = grpc_error_string(error);
gpr_log(GPR_INFO, "write: %s", str);
@@ -1560,13 +1560,13 @@ static void tcp_write(grpc_endpoint* ep, grpc_slice_buffer* buf,
GPR_TIMER_SCOPE("tcp_write", 0);
grpc_tcp* tcp = reinterpret_cast<grpc_tcp*>(ep);
grpc_error* error = GRPC_ERROR_NONE;
- TcpZerocopySendRecord* zerocopy_send_record = nullptr;
+ TcpZerocopySendRecord* zerocopy_send_record = nullptr;
if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) {
size_t i;
for (i = 0; i < buf->count; i++) {
- gpr_log(GPR_INFO, "WRITE %p (peer=%s)", tcp, tcp->peer_string.c_str());
+ gpr_log(GPR_INFO, "WRITE %p (peer=%s)", tcp, tcp->peer_string.c_str());
if (gpr_should_log(GPR_LOG_SEVERITY_DEBUG)) {
char* data =
grpc_dump_slice(buf->slices[i], GPR_DUMP_HEX | GPR_DUMP_ASCII);
@@ -1577,7 +1577,7 @@ static void tcp_write(grpc_endpoint* ep, grpc_slice_buffer* buf,
}
GPR_ASSERT(tcp->write_cb == nullptr);
- GPR_DEBUG_ASSERT(tcp->current_zerocopy_send == nullptr);
+ GPR_DEBUG_ASSERT(tcp->current_zerocopy_send == nullptr);
if (buf->length == 0) {
grpc_core::Closure::Run(
@@ -1589,26 +1589,26 @@ static void tcp_write(grpc_endpoint* ep, grpc_slice_buffer* buf,
tcp_shutdown_buffer_list(tcp);
return;
}
-
- zerocopy_send_record = tcp_get_send_zerocopy_record(tcp, buf);
- if (zerocopy_send_record == nullptr) {
- // Either not enough bytes, or couldn't allocate a zerocopy context.
- tcp->outgoing_buffer = buf;
- tcp->outgoing_byte_idx = 0;
- }
- tcp->outgoing_buffer_arg = arg;
+
+ zerocopy_send_record = tcp_get_send_zerocopy_record(tcp, buf);
+ if (zerocopy_send_record == nullptr) {
+ // Either not enough bytes, or couldn't allocate a zerocopy context.
+ tcp->outgoing_buffer = buf;
+ tcp->outgoing_byte_idx = 0;
+ }
+ tcp->outgoing_buffer_arg = arg;
if (arg) {
GPR_ASSERT(grpc_event_engine_can_track_errors());
}
- bool flush_result =
- zerocopy_send_record != nullptr
- ? tcp_flush_zerocopy(tcp, zerocopy_send_record, &error)
- : tcp_flush(tcp, &error);
- if (!flush_result) {
+ bool flush_result =
+ zerocopy_send_record != nullptr
+ ? tcp_flush_zerocopy(tcp, zerocopy_send_record, &error)
+ : tcp_flush(tcp, &error);
+ if (!flush_result) {
TCP_REF(tcp, "write");
tcp->write_cb = cb;
- tcp->current_zerocopy_send = zerocopy_send_record;
+ tcp->current_zerocopy_send = zerocopy_send_record;
if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) {
gpr_log(GPR_INFO, "write: delayed");
}
@@ -1636,20 +1636,20 @@ static void tcp_add_to_pollset_set(grpc_endpoint* ep,
static void tcp_delete_from_pollset_set(grpc_endpoint* ep,
grpc_pollset_set* pollset_set) {
grpc_tcp* tcp = reinterpret_cast<grpc_tcp*>(ep);
- ZerocopyDisableAndWaitForRemaining(tcp);
+ ZerocopyDisableAndWaitForRemaining(tcp);
grpc_pollset_set_del_fd(pollset_set, tcp->em_fd);
}
-static y_absl::string_view tcp_get_peer(grpc_endpoint* ep) {
+static y_absl::string_view tcp_get_peer(grpc_endpoint* ep) {
grpc_tcp* tcp = reinterpret_cast<grpc_tcp*>(ep);
- return tcp->peer_string;
+ return tcp->peer_string;
+}
+
+static y_absl::string_view tcp_get_local_address(grpc_endpoint* ep) {
+ grpc_tcp* tcp = reinterpret_cast<grpc_tcp*>(ep);
+ return tcp->local_address;
}
-static y_absl::string_view tcp_get_local_address(grpc_endpoint* ep) {
- grpc_tcp* tcp = reinterpret_cast<grpc_tcp*>(ep);
- return tcp->local_address;
-}
-
static int tcp_get_fd(grpc_endpoint* ep) {
grpc_tcp* tcp = reinterpret_cast<grpc_tcp*>(ep);
return tcp->fd;
@@ -1685,7 +1685,7 @@ static const grpc_endpoint_vtable vtable = {tcp_read,
tcp_destroy,
tcp_get_resource_user,
tcp_get_peer,
- tcp_get_local_address,
+ tcp_get_local_address,
tcp_get_fd,
tcp_can_track_err};
@@ -1694,15 +1694,15 @@ static const grpc_endpoint_vtable vtable = {tcp_read,
grpc_endpoint* grpc_tcp_create(grpc_fd* em_fd,
const grpc_channel_args* channel_args,
const char* peer_string) {
- static constexpr bool kZerocpTxEnabledDefault = false;
+ static constexpr bool kZerocpTxEnabledDefault = false;
int tcp_read_chunk_size = GRPC_TCP_DEFAULT_READ_SLICE_SIZE;
int tcp_max_read_chunk_size = 4 * 1024 * 1024;
int tcp_min_read_chunk_size = 256;
- bool tcp_tx_zerocopy_enabled = kZerocpTxEnabledDefault;
- int tcp_tx_zerocopy_send_bytes_thresh =
- grpc_core::TcpZerocopySendCtx::kDefaultSendBytesThreshold;
- int tcp_tx_zerocopy_max_simult_sends =
- grpc_core::TcpZerocopySendCtx::kDefaultMaxSends;
+ bool tcp_tx_zerocopy_enabled = kZerocpTxEnabledDefault;
+ int tcp_tx_zerocopy_send_bytes_thresh =
+ grpc_core::TcpZerocopySendCtx::kDefaultSendBytesThreshold;
+ int tcp_tx_zerocopy_max_simult_sends =
+ grpc_core::TcpZerocopySendCtx::kDefaultMaxSends;
grpc_resource_quota* resource_quota = grpc_resource_quota_create(nullptr);
if (channel_args != nullptr) {
for (size_t i = 0; i < channel_args->num_args; i++) {
@@ -1727,23 +1727,23 @@ grpc_endpoint* grpc_tcp_create(grpc_fd* em_fd,
resource_quota =
grpc_resource_quota_ref_internal(static_cast<grpc_resource_quota*>(
channel_args->args[i].value.pointer.p));
- } else if (0 == strcmp(channel_args->args[i].key,
- GRPC_ARG_TCP_TX_ZEROCOPY_ENABLED)) {
- tcp_tx_zerocopy_enabled = grpc_channel_arg_get_bool(
- &channel_args->args[i], kZerocpTxEnabledDefault);
- } else if (0 == strcmp(channel_args->args[i].key,
- GRPC_ARG_TCP_TX_ZEROCOPY_SEND_BYTES_THRESHOLD)) {
- grpc_integer_options options = {
- grpc_core::TcpZerocopySendCtx::kDefaultSendBytesThreshold, 0,
- INT_MAX};
- tcp_tx_zerocopy_send_bytes_thresh =
- grpc_channel_arg_get_integer(&channel_args->args[i], options);
- } else if (0 == strcmp(channel_args->args[i].key,
- GRPC_ARG_TCP_TX_ZEROCOPY_MAX_SIMULT_SENDS)) {
- grpc_integer_options options = {
- grpc_core::TcpZerocopySendCtx::kDefaultMaxSends, 0, INT_MAX};
- tcp_tx_zerocopy_max_simult_sends =
- grpc_channel_arg_get_integer(&channel_args->args[i], options);
+ } else if (0 == strcmp(channel_args->args[i].key,
+ GRPC_ARG_TCP_TX_ZEROCOPY_ENABLED)) {
+ tcp_tx_zerocopy_enabled = grpc_channel_arg_get_bool(
+ &channel_args->args[i], kZerocpTxEnabledDefault);
+ } else if (0 == strcmp(channel_args->args[i].key,
+ GRPC_ARG_TCP_TX_ZEROCOPY_SEND_BYTES_THRESHOLD)) {
+ grpc_integer_options options = {
+ grpc_core::TcpZerocopySendCtx::kDefaultSendBytesThreshold, 0,
+ INT_MAX};
+ tcp_tx_zerocopy_send_bytes_thresh =
+ grpc_channel_arg_get_integer(&channel_args->args[i], options);
+ } else if (0 == strcmp(channel_args->args[i].key,
+ GRPC_ARG_TCP_TX_ZEROCOPY_MAX_SIMULT_SENDS)) {
+ grpc_integer_options options = {
+ grpc_core::TcpZerocopySendCtx::kDefaultMaxSends, 0, INT_MAX};
+ tcp_tx_zerocopy_max_simult_sends =
+ grpc_channel_arg_get_integer(&channel_args->args[i], options);
}
}
}
@@ -1754,24 +1754,24 @@ grpc_endpoint* grpc_tcp_create(grpc_fd* em_fd,
tcp_read_chunk_size = GPR_CLAMP(tcp_read_chunk_size, tcp_min_read_chunk_size,
tcp_max_read_chunk_size);
- grpc_tcp* tcp = new grpc_tcp(tcp_tx_zerocopy_max_simult_sends,
- tcp_tx_zerocopy_send_bytes_thresh);
+ grpc_tcp* tcp = new grpc_tcp(tcp_tx_zerocopy_max_simult_sends,
+ tcp_tx_zerocopy_send_bytes_thresh);
tcp->base.vtable = &vtable;
- tcp->peer_string = peer_string;
+ tcp->peer_string = peer_string;
tcp->fd = grpc_fd_wrapped_fd(em_fd);
- grpc_resolved_address resolved_local_addr;
- memset(&resolved_local_addr, 0, sizeof(resolved_local_addr));
- resolved_local_addr.len = sizeof(resolved_local_addr.addr);
- if (getsockname(tcp->fd,
- reinterpret_cast<sockaddr*>(resolved_local_addr.addr),
- &resolved_local_addr.len) < 0) {
- tcp->local_address = "";
- } else {
- tcp->local_address = grpc_sockaddr_to_uri(&resolved_local_addr);
- }
+ grpc_resolved_address resolved_local_addr;
+ memset(&resolved_local_addr, 0, sizeof(resolved_local_addr));
+ resolved_local_addr.len = sizeof(resolved_local_addr.addr);
+ if (getsockname(tcp->fd,
+ reinterpret_cast<sockaddr*>(resolved_local_addr.addr),
+ &resolved_local_addr.len) < 0) {
+ tcp->local_address = "";
+ } else {
+ tcp->local_address = grpc_sockaddr_to_uri(&resolved_local_addr);
+ }
tcp->read_cb = nullptr;
tcp->write_cb = nullptr;
- tcp->current_zerocopy_send = nullptr;
+ tcp->current_zerocopy_send = nullptr;
tcp->release_fd_cb = nullptr;
tcp->release_fd = nullptr;
tcp->incoming_buffer = nullptr;
@@ -1785,18 +1785,18 @@ grpc_endpoint* grpc_tcp_create(grpc_fd* em_fd,
tcp->socket_ts_enabled = false;
tcp->ts_capable = true;
tcp->outgoing_buffer_arg = nullptr;
- if (tcp_tx_zerocopy_enabled && !tcp->tcp_zerocopy_send_ctx.memory_limited()) {
-#ifdef GRPC_LINUX_ERRQUEUE
- const int enable = 1;
- auto err =
- setsockopt(tcp->fd, SOL_SOCKET, SO_ZEROCOPY, &enable, sizeof(enable));
- if (err == 0) {
- tcp->tcp_zerocopy_send_ctx.set_enabled(true);
- } else {
- gpr_log(GPR_ERROR, "Failed to set zerocopy options on the socket.");
- }
-#endif
- }
+ if (tcp_tx_zerocopy_enabled && !tcp->tcp_zerocopy_send_ctx.memory_limited()) {
+#ifdef GRPC_LINUX_ERRQUEUE
+ const int enable = 1;
+ auto err =
+ setsockopt(tcp->fd, SOL_SOCKET, SO_ZEROCOPY, &enable, sizeof(enable));
+ if (err == 0) {
+ tcp->tcp_zerocopy_send_ctx.set_enabled(true);
+ } else {
+ gpr_log(GPR_ERROR, "Failed to set zerocopy options on the socket.");
+ }
+#endif
+ }
/* paired with unref in grpc_tcp_destroy */
new (&tcp->refcount) grpc_core::RefCount(1, &grpc_tcp_trace);
gpr_atm_no_barrier_store(&tcp->shutdown_count, 0);
@@ -1863,7 +1863,7 @@ void grpc_tcp_destroy_and_release_fd(grpc_endpoint* ep, int* fd,
grpc_slice_buffer_reset_and_unref_internal(&tcp->last_read_buffer);
if (grpc_event_engine_can_track_errors()) {
/* Stop errors notification. */
- ZerocopyDisableAndWaitForRemaining(tcp);
+ ZerocopyDisableAndWaitForRemaining(tcp);
gpr_atm_no_barrier_store(&tcp->stop_error_notification, true);
grpc_fd_set_error(tcp->em_fd);
}
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/tcp_server.cc b/contrib/libs/grpc/src/core/lib/iomgr/tcp_server.cc
index c48216e5dfe..046fd4979bd 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/tcp_server.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/tcp_server.cc
@@ -28,10 +28,10 @@ grpc_error* grpc_tcp_server_create(grpc_closure* shutdown_complete,
return grpc_tcp_server_impl->create(shutdown_complete, args, server);
}
-void grpc_tcp_server_start(grpc_tcp_server* server,
- const std::vector<grpc_pollset*>* pollsets,
+void grpc_tcp_server_start(grpc_tcp_server* server,
+ const std::vector<grpc_pollset*>* pollsets,
grpc_tcp_server_cb on_accept_cb, void* cb_arg) {
- grpc_tcp_server_impl->start(server, pollsets, on_accept_cb, cb_arg);
+ grpc_tcp_server_impl->start(server, pollsets, on_accept_cb, cb_arg);
}
grpc_error* grpc_tcp_server_add_port(grpc_tcp_server* s,
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/tcp_server.h b/contrib/libs/grpc/src/core/lib/iomgr/tcp_server.h
index 10de37d9999..6ba3513da5b 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/tcp_server.h
+++ b/contrib/libs/grpc/src/core/lib/iomgr/tcp_server.h
@@ -24,8 +24,8 @@
#include <grpc/grpc.h>
#include <grpc/impl/codegen/grpc_types.h>
-#include <vector>
-
+#include <vector>
+
#include "src/core/lib/iomgr/closure.h"
#include "src/core/lib/iomgr/endpoint.h"
#include "src/core/lib/iomgr/resolve_address.h"
@@ -66,9 +66,9 @@ typedef struct grpc_tcp_server_vtable {
grpc_error* (*create)(grpc_closure* shutdown_complete,
const grpc_channel_args* args,
grpc_tcp_server** server);
- void (*start)(grpc_tcp_server* server,
- const std::vector<grpc_pollset*>* pollsets,
- grpc_tcp_server_cb on_accept_cb, void* cb_arg);
+ void (*start)(grpc_tcp_server* server,
+ const std::vector<grpc_pollset*>* pollsets,
+ grpc_tcp_server_cb on_accept_cb, void* cb_arg);
grpc_error* (*add_port)(grpc_tcp_server* s, const grpc_resolved_address* addr,
int* out_port);
grpc_core::TcpServerFdHandler* (*create_fd_handler)(grpc_tcp_server* s);
@@ -89,8 +89,8 @@ grpc_error* grpc_tcp_server_create(grpc_closure* shutdown_complete,
grpc_tcp_server** server);
/* Start listening to bound ports */
-void grpc_tcp_server_start(grpc_tcp_server* server,
- const std::vector<grpc_pollset*>* pollsets,
+void grpc_tcp_server_start(grpc_tcp_server* server,
+ const std::vector<grpc_pollset*>* pollsets,
grpc_tcp_server_cb on_accept_cb, void* cb_arg);
/* Add a port to the server, returning the newly allocated port on success, or
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/tcp_server_custom.cc b/contrib/libs/grpc/src/core/lib/iomgr/tcp_server_custom.cc
index bab706d6835..0cffa1f5719 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/tcp_server_custom.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/tcp_server_custom.cc
@@ -23,12 +23,12 @@
#include <assert.h>
#include <string.h>
-#include <util/generic/string.h>
-
+#include <util/generic/string.h>
+
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
-#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/iomgr/error.h"
#include "src/core/lib/iomgr/exec_ctx.h"
#include "src/core/lib/iomgr/iomgr_custom.h"
@@ -75,7 +75,7 @@ struct grpc_tcp_server {
grpc_closure* shutdown_complete;
bool shutdown;
- bool so_reuseport;
+ bool so_reuseport;
grpc_resource_quota* resource_quota;
};
@@ -84,13 +84,13 @@ static grpc_error* tcp_server_create(grpc_closure* shutdown_complete,
const grpc_channel_args* args,
grpc_tcp_server** server) {
grpc_tcp_server* s = (grpc_tcp_server*)gpr_malloc(sizeof(grpc_tcp_server));
- // Let the implementation decide if so_reuseport can be enabled or not.
- s->so_reuseport = true;
+ // Let the implementation decide if so_reuseport can be enabled or not.
+ s->so_reuseport = true;
s->resource_quota = grpc_resource_quota_create(nullptr);
for (size_t i = 0; i < (args == nullptr ? 0 : args->num_args); i++) {
- if (!grpc_channel_args_find_bool(args, GRPC_ARG_ALLOW_REUSEPORT, true)) {
- s->so_reuseport = false;
- }
+ if (!grpc_channel_args_find_bool(args, GRPC_ARG_ALLOW_REUSEPORT, true)) {
+ s->so_reuseport = false;
+ }
if (0 == strcmp(GRPC_ARG_RESOURCE_QUOTA, args->args[i].key)) {
if (args->args[i].type == GRPC_ARG_POINTER) {
grpc_resource_quota_unref_internal(s->resource_quota);
@@ -216,7 +216,7 @@ static void finish_accept(grpc_tcp_listener* sp, grpc_custom_socket* socket) {
(grpc_tcp_server_acceptor*)gpr_malloc(sizeof(*acceptor));
grpc_endpoint* ep = nullptr;
grpc_resolved_address peer_name;
- TString peer_name_string;
+ TString peer_name_string;
grpc_error* err;
memset(&peer_name, 0, sizeof(grpc_resolved_address));
@@ -230,11 +230,11 @@ static void finish_accept(grpc_tcp_listener* sp, grpc_custom_socket* socket) {
GRPC_ERROR_UNREF(err);
}
if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) {
- gpr_log(GPR_INFO, "SERVER_CONNECT: %p accepted connection: %s", sp->server,
- peer_name_string.c_str());
+ gpr_log(GPR_INFO, "SERVER_CONNECT: %p accepted connection: %s", sp->server,
+ peer_name_string.c_str());
}
ep = custom_tcp_endpoint_create(socket, sp->server->resource_quota,
- peer_name_string.c_str());
+ peer_name_string.c_str());
acceptor->from_server = sp->server;
acceptor->port_index = sp->port_index;
acceptor->fd_index = 0;
@@ -283,15 +283,15 @@ static grpc_error* add_socket_to_server(grpc_tcp_server* s,
grpc_error* error;
grpc_resolved_address sockname_temp;
- // NOTE(lidiz) The last argument is "flags" which is unused by other
- // implementations. Python IO managers uses it to specify SO_REUSEPORT.
- int flags = 0;
- if (s->so_reuseport) {
- flags |= GRPC_CUSTOM_SOCKET_OPT_SO_REUSEPORT;
- }
-
+ // NOTE(lidiz) The last argument is "flags" which is unused by other
+ // implementations. Python IO managers uses it to specify SO_REUSEPORT.
+ int flags = 0;
+ if (s->so_reuseport) {
+ flags |= GRPC_CUSTOM_SOCKET_OPT_SO_REUSEPORT;
+ }
+
error = grpc_custom_socket_vtable->bind(socket, (grpc_sockaddr*)addr->addr,
- addr->len, flags);
+ addr->len, flags);
if (error != GRPC_ERROR_NONE) {
return error;
}
@@ -385,9 +385,9 @@ static grpc_error* tcp_server_add_port(grpc_tcp_server* s,
}
if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) {
- gpr_log(GPR_INFO, "SERVER %p add_port %s error=%s", s,
- grpc_sockaddr_to_string(addr, false).c_str(),
- grpc_error_string(error));
+ gpr_log(GPR_INFO, "SERVER %p add_port %s error=%s", s,
+ grpc_sockaddr_to_string(addr, false).c_str(),
+ grpc_error_string(error));
}
family = grpc_sockaddr_get_family(addr);
@@ -417,8 +417,8 @@ static grpc_error* tcp_server_add_port(grpc_tcp_server* s,
return error;
}
-static void tcp_server_start(grpc_tcp_server* server,
- const std::vector<grpc_pollset*>* /*pollsets*/,
+static void tcp_server_start(grpc_tcp_server* server,
+ const std::vector<grpc_pollset*>* /*pollsets*/,
grpc_tcp_server_cb on_accept_cb, void* cb_arg) {
grpc_tcp_listener* sp;
GRPC_CUSTOM_IOMGR_ASSERT_SAME_THREAD();
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/tcp_server_posix.cc b/contrib/libs/grpc/src/core/lib/iomgr/tcp_server_posix.cc
index 552ce67ab8f..b3f3febe635 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/tcp_server_posix.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/tcp_server_posix.cc
@@ -37,11 +37,11 @@
#include <sys/types.h>
#include <unistd.h>
-#include <util/generic/string.h>
-
-#include "y_absl/strings/str_cat.h"
-#include "y_absl/strings/str_format.h"
-
+#include <util/generic/string.h>
+
+#include "y_absl/strings/str_cat.h"
+#include "y_absl/strings/str_format.h"
+
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/sync.h>
@@ -238,19 +238,19 @@ static void on_read(void* arg, grpc_error* err) {
grpc_set_socket_no_sigpipe_if_possible(fd);
- TString addr_str = grpc_sockaddr_to_uri(&addr);
+ TString addr_str = grpc_sockaddr_to_uri(&addr);
if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) {
- gpr_log(GPR_INFO, "SERVER_CONNECT: incoming connection: %s",
- addr_str.c_str());
+ gpr_log(GPR_INFO, "SERVER_CONNECT: incoming connection: %s",
+ addr_str.c_str());
}
- TString name = y_absl::StrCat("tcp-server-connection:", addr_str);
- grpc_fd* fdobj = grpc_fd_create(fd, name.c_str(), true);
+ TString name = y_absl::StrCat("tcp-server-connection:", addr_str);
+ grpc_fd* fdobj = grpc_fd_create(fd, name.c_str(), true);
- read_notifier_pollset = (*(sp->server->pollsets))
- [static_cast<size_t>(gpr_atm_no_barrier_fetch_add(
- &sp->server->next_pollset_to_assign, 1)) %
- sp->server->pollsets->size()];
+ read_notifier_pollset = (*(sp->server->pollsets))
+ [static_cast<size_t>(gpr_atm_no_barrier_fetch_add(
+ &sp->server->next_pollset_to_assign, 1)) %
+ sp->server->pollsets->size()];
grpc_pollset_add_fd(read_notifier_pollset, fdobj);
@@ -264,7 +264,7 @@ static void on_read(void* arg, grpc_error* err) {
sp->server->on_accept_cb(
sp->server->on_accept_cb_arg,
- grpc_tcp_create(fdobj, sp->server->channel_args, addr_str.c_str()),
+ grpc_tcp_create(fdobj, sp->server->channel_args, addr_str.c_str()),
read_notifier_pollset, acceptor);
}
@@ -348,7 +348,7 @@ static grpc_error* add_wildcard_addrs_to_server(grpc_tcp_server* s,
static grpc_error* clone_port(grpc_tcp_listener* listener, unsigned count) {
grpc_tcp_listener* sp = nullptr;
- TString addr_str;
+ TString addr_str;
grpc_error* err;
for (grpc_tcp_listener* l = listener->next; l && l->is_sibling; l = l->next) {
@@ -366,7 +366,7 @@ static grpc_error* clone_port(grpc_tcp_listener* listener, unsigned count) {
true, &port);
if (err != GRPC_ERROR_NONE) return err;
listener->server->nports++;
- addr_str = grpc_sockaddr_to_string(&listener->addr, true);
+ addr_str = grpc_sockaddr_to_string(&listener->addr, true);
sp = static_cast<grpc_tcp_listener*>(gpr_malloc(sizeof(grpc_tcp_listener)));
sp->next = listener->next;
listener->next = sp;
@@ -377,11 +377,11 @@ static grpc_error* clone_port(grpc_tcp_listener* listener, unsigned count) {
listener->sibling = sp;
sp->server = listener->server;
sp->fd = fd;
- sp->emfd = grpc_fd_create(
- fd,
- y_absl::StrFormat("tcp-server-listener:%s/clone-%d", addr_str.c_str(), i)
- .c_str(),
- true);
+ sp->emfd = grpc_fd_create(
+ fd,
+ y_absl::StrFormat("tcp-server-listener:%s/clone-%d", addr_str.c_str(), i)
+ .c_str(),
+ true);
memcpy(&sp->addr, &listener->addr, sizeof(grpc_resolved_address));
sp->port = port;
sp->port_index = listener->port_index;
@@ -487,8 +487,8 @@ static int tcp_server_port_fd(grpc_tcp_server* s, unsigned port_index,
return -1;
}
-static void tcp_server_start(grpc_tcp_server* s,
- const std::vector<grpc_pollset*>* pollsets,
+static void tcp_server_start(grpc_tcp_server* s,
+ const std::vector<grpc_pollset*>* pollsets,
grpc_tcp_server_cb on_accept_cb,
void* on_accept_cb_arg) {
size_t i;
@@ -503,11 +503,11 @@ static void tcp_server_start(grpc_tcp_server* s,
sp = s->head;
while (sp != nullptr) {
if (s->so_reuseport && !grpc_is_unix_socket(&sp->addr) &&
- pollsets->size() > 1) {
+ pollsets->size() > 1) {
GPR_ASSERT(GRPC_LOG_IF_ERROR(
- "clone_port", clone_port(sp, (unsigned)(pollsets->size() - 1))));
- for (i = 0; i < pollsets->size(); i++) {
- grpc_pollset_add_fd((*pollsets)[i], sp->emfd);
+ "clone_port", clone_port(sp, (unsigned)(pollsets->size() - 1))));
+ for (i = 0; i < pollsets->size(); i++) {
+ grpc_pollset_add_fd((*pollsets)[i], sp->emfd);
GRPC_CLOSURE_INIT(&sp->read_closure, on_read, sp,
grpc_schedule_on_exec_ctx);
grpc_fd_notify_on_read(sp->emfd, &sp->read_closure);
@@ -515,8 +515,8 @@ static void tcp_server_start(grpc_tcp_server* s,
sp = sp->next;
}
} else {
- for (i = 0; i < pollsets->size(); i++) {
- grpc_pollset_add_fd((*pollsets)[i], sp->emfd);
+ for (i = 0; i < pollsets->size(); i++) {
+ grpc_pollset_add_fd((*pollsets)[i], sp->emfd);
}
GRPC_CLOSURE_INIT(&sp->read_closure, on_read, sp,
grpc_schedule_on_exec_ctx);
@@ -585,17 +585,17 @@ class ExternalConnectionHandler : public grpc_core::TcpServerFdHandler {
return;
}
grpc_set_socket_no_sigpipe_if_possible(fd);
- TString addr_str = grpc_sockaddr_to_uri(&addr);
+ TString addr_str = grpc_sockaddr_to_uri(&addr);
if (grpc_tcp_trace.enabled()) {
gpr_log(GPR_INFO, "SERVER_CONNECT: incoming external connection: %s",
- addr_str.c_str());
+ addr_str.c_str());
}
- TString name = y_absl::StrCat("tcp-server-connection:", addr_str);
- grpc_fd* fdobj = grpc_fd_create(fd, name.c_str(), true);
+ TString name = y_absl::StrCat("tcp-server-connection:", addr_str);
+ grpc_fd* fdobj = grpc_fd_create(fd, name.c_str(), true);
read_notifier_pollset =
- (*(s_->pollsets))[static_cast<size_t>(gpr_atm_no_barrier_fetch_add(
- &s_->next_pollset_to_assign, 1)) %
- s_->pollsets->size()];
+ (*(s_->pollsets))[static_cast<size_t>(gpr_atm_no_barrier_fetch_add(
+ &s_->next_pollset_to_assign, 1)) %
+ s_->pollsets->size()];
grpc_pollset_add_fd(read_notifier_pollset, fdobj);
grpc_tcp_server_acceptor* acceptor =
static_cast<grpc_tcp_server_acceptor*>(gpr_malloc(sizeof(*acceptor)));
@@ -606,7 +606,7 @@ class ExternalConnectionHandler : public grpc_core::TcpServerFdHandler {
acceptor->listener_fd = listener_fd;
acceptor->pending_data = buf;
s_->on_accept_cb(s_->on_accept_cb_arg,
- grpc_tcp_create(fdobj, s_->channel_args, addr_str.c_str()),
+ grpc_tcp_create(fdobj, s_->channel_args, addr_str.c_str()),
read_notifier_pollset, acceptor);
}
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/tcp_server_utils_posix.h b/contrib/libs/grpc/src/core/lib/iomgr/tcp_server_utils_posix.h
index 46c74c71271..6b8a5f9f207 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/tcp_server_utils_posix.h
+++ b/contrib/libs/grpc/src/core/lib/iomgr/tcp_server_utils_posix.h
@@ -82,9 +82,9 @@ struct grpc_tcp_server {
/* shutdown callback */
grpc_closure* shutdown_complete;
- /* all pollsets interested in new connections. The object pointed at is not
- * owned by this struct */
- const std::vector<grpc_pollset*>* pollsets;
+ /* all pollsets interested in new connections. The object pointed at is not
+ * owned by this struct */
+ const std::vector<grpc_pollset*>* pollsets;
/* next pollset to assign a channel to */
gpr_atm next_pollset_to_assign;
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/tcp_server_utils_posix_common.cc b/contrib/libs/grpc/src/core/lib/iomgr/tcp_server_utils_posix_common.cc
index 15cb4e5917a..46bc18e5a09 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/tcp_server_utils_posix_common.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/tcp_server_utils_posix_common.cc
@@ -29,10 +29,10 @@
#include <stdio.h>
#include <string.h>
-#include <util/generic/string.h>
-
-#include "y_absl/strings/str_cat.h"
-
+#include <util/generic/string.h>
+
+#include "y_absl/strings/str_cat.h"
+
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/sync.h>
@@ -91,8 +91,8 @@ static grpc_error* add_socket_to_server(grpc_tcp_server* s, int fd,
grpc_tcp_server_prepare_socket(s, fd, addr, s->so_reuseport, &port);
if (err == GRPC_ERROR_NONE) {
GPR_ASSERT(port > 0);
- TString addr_str = grpc_sockaddr_to_string(addr, true);
- TString name = y_absl::StrCat("tcp-server-listener:", addr_str);
+ TString addr_str = grpc_sockaddr_to_string(addr, true);
+ TString name = y_absl::StrCat("tcp-server-listener:", addr_str);
gpr_mu_lock(&s->mu);
s->nports++;
GPR_ASSERT(!s->on_accept_cb && "must add ports before starting server");
@@ -106,7 +106,7 @@ static grpc_error* add_socket_to_server(grpc_tcp_server* s, int fd,
s->tail = sp;
sp->server = s;
sp->fd = fd;
- sp->emfd = grpc_fd_create(fd, name.c_str(), true);
+ sp->emfd = grpc_fd_create(fd, name.c_str(), true);
memcpy(&sp->addr, addr, sizeof(grpc_resolved_address));
sp->port = port;
sp->port_index = port_index;
@@ -156,14 +156,14 @@ grpc_error* grpc_tcp_server_prepare_socket(grpc_tcp_server* s, int fd,
if (err != GRPC_ERROR_NONE) goto error;
}
-#ifdef GRPC_LINUX_ERRQUEUE
- err = grpc_set_socket_zerocopy(fd);
- if (err != GRPC_ERROR_NONE) {
- /* it's not fatal, so just log it. */
- gpr_log(GPR_DEBUG, "Node does not support SO_ZEROCOPY, continuing.");
- GRPC_ERROR_UNREF(err);
- }
-#endif
+#ifdef GRPC_LINUX_ERRQUEUE
+ err = grpc_set_socket_zerocopy(fd);
+ if (err != GRPC_ERROR_NONE) {
+ /* it's not fatal, so just log it. */
+ gpr_log(GPR_DEBUG, "Node does not support SO_ZEROCOPY, continuing.");
+ GRPC_ERROR_UNREF(err);
+ }
+#endif
err = grpc_set_socket_nonblocking(fd, 1);
if (err != GRPC_ERROR_NONE) goto error;
err = grpc_set_socket_cloexec(fd, 1);
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.cc b/contrib/libs/grpc/src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.cc
index 6c0fc41e26e..1c7cd5cc10b 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.cc
@@ -29,10 +29,10 @@
#include <stddef.h>
#include <string.h>
-#include <util/generic/string.h>
-
-#include "y_absl/strings/str_cat.h"
-
+#include <util/generic/string.h>
+
+#include "y_absl/strings/str_cat.h"
+
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
@@ -133,21 +133,21 @@ grpc_error* grpc_tcp_server_add_all_local_addrs(grpc_tcp_server* s,
err = GRPC_ERROR_CREATE_FROM_STATIC_STRING("Failed to set port");
break;
}
- TString addr_str = grpc_sockaddr_to_string(&addr, false);
+ TString addr_str = grpc_sockaddr_to_string(&addr, false);
gpr_log(GPR_DEBUG,
"Adding local addr from interface %s flags 0x%x to server: %s",
- ifa_name, ifa_it->ifa_flags, addr_str.c_str());
+ ifa_name, ifa_it->ifa_flags, addr_str.c_str());
/* We could have multiple interfaces with the same address (e.g., bonding),
so look for duplicates. */
if (find_listener_with_addr(s, &addr) != nullptr) {
- gpr_log(GPR_DEBUG, "Skipping duplicate addr %s on interface %s",
- addr_str.c_str(), ifa_name);
+ gpr_log(GPR_DEBUG, "Skipping duplicate addr %s on interface %s",
+ addr_str.c_str(), ifa_name);
continue;
}
if ((err = grpc_tcp_server_add_addr(s, &addr, port_index, fd_index, &dsmode,
&new_sp)) != GRPC_ERROR_NONE) {
- grpc_error* root_err = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("Failed to add listener: ", addr_str).c_str());
+ grpc_error* root_err = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrCat("Failed to add listener: ", addr_str).c_str());
err = grpc_error_add_child(root_err, err);
break;
} else {
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/tcp_server_windows.cc b/contrib/libs/grpc/src/core/lib/iomgr/tcp_server_windows.cc
index 4a3fef4eb13..13c17260dc2 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/tcp_server_windows.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/tcp_server_windows.cc
@@ -27,10 +27,10 @@
#include <inttypes.h>
#include <io.h>
-#include <vector>
-
-#include "y_absl/strings/str_cat.h"
-
+#include <vector>
+
+#include "y_absl/strings/str_cat.h"
+
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/log_windows.h>
@@ -46,7 +46,7 @@
#include "src/core/lib/iomgr/socket_windows.h"
#include "src/core/lib/iomgr/tcp_server.h"
#include "src/core/lib/iomgr/tcp_windows.h"
-#include "src/core/lib/slice/slice_internal.h"
+#include "src/core/lib/slice/slice_internal.h"
#define MIN_SAFE_ACCEPT_QUEUE_SIZE 100
@@ -228,11 +228,11 @@ static grpc_error* prepare_socket(SOCKET sock,
failure:
GPR_ASSERT(error != GRPC_ERROR_NONE);
grpc_error_set_int(
- grpc_error_set_str(
- GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
- "Failed to prepare server socket", &error, 1),
- GRPC_ERROR_STR_TARGET_ADDRESS,
- grpc_slice_from_cpp_string(grpc_sockaddr_to_uri(addr))),
+ grpc_error_set_str(
+ GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
+ "Failed to prepare server socket", &error, 1),
+ GRPC_ERROR_STR_TARGET_ADDRESS,
+ grpc_slice_from_cpp_string(grpc_sockaddr_to_uri(addr))),
GRPC_ERROR_INT_FD, (intptr_t)sock);
GRPC_ERROR_UNREF(error);
if (sock != INVALID_SOCKET) closesocket(sock);
@@ -349,7 +349,7 @@ static void on_accept(void* arg, grpc_error* error) {
int peer_name_len = (int)peer_name.len;
err = getpeername(sock, (grpc_sockaddr*)peer_name.addr, &peer_name_len);
peer_name.len = (size_t)peer_name_len;
- TString peer_name_string;
+ TString peer_name_string;
if (!err) {
peer_name_string = grpc_sockaddr_to_uri(&peer_name);
} else {
@@ -357,9 +357,9 @@ static void on_accept(void* arg, grpc_error* error) {
gpr_log(GPR_ERROR, "getpeername error: %s", utf8_message);
gpr_free(utf8_message);
}
- TString fd_name = y_absl::StrCat("tcp_server:", peer_name_string);
- ep = grpc_tcp_create(grpc_winsocket_create(sock, fd_name.c_str()),
- sp->server->channel_args, peer_name_string.c_str());
+ TString fd_name = y_absl::StrCat("tcp_server:", peer_name_string);
+ ep = grpc_tcp_create(grpc_winsocket_create(sock, fd_name.c_str()),
+ sp->server->channel_args, peer_name_string.c_str());
} else {
closesocket(sock);
}
@@ -520,8 +520,8 @@ done:
return error;
}
-static void tcp_server_start(grpc_tcp_server* s,
- const std::vector<grpc_pollset*>* /*pollsets*/,
+static void tcp_server_start(grpc_tcp_server* s,
+ const std::vector<grpc_pollset*>* /*pollsets*/,
grpc_tcp_server_cb on_accept_cb,
void* on_accept_cb_arg) {
grpc_tcp_listener* sp;
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/tcp_uv.cc b/contrib/libs/grpc/src/core/lib/iomgr/tcp_uv.cc
index 9b484fadb88..371b38c9914 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/tcp_uv.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/tcp_uv.cc
@@ -370,7 +370,7 @@ static void uv_resolve_callback(uv_getaddrinfo_t* req, int status,
tcp_error_create("getaddrinfo failed", status));
}
-static grpc_error* uv_resolve(const char* host, const char* port,
+static grpc_error* uv_resolve(const char* host, const char* port,
grpc_resolved_addresses** result) {
int status;
uv_getaddrinfo_t req;
@@ -388,8 +388,8 @@ static grpc_error* uv_resolve(const char* host, const char* port,
return tcp_error_create("getaddrinfo failed", status);
}
-static void uv_resolve_async(grpc_custom_resolver* r, const char* host,
- const char* port) {
+static void uv_resolve_async(grpc_custom_resolver* r, const char* host,
+ const char* port) {
int status;
uv_getaddrinfo_t* req =
(uv_getaddrinfo_t*)gpr_malloc(sizeof(uv_getaddrinfo_t));
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/tcp_windows.cc b/contrib/libs/grpc/src/core/lib/iomgr/tcp_windows.cc
index e219538c364..3d410a2d3fc 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/tcp_windows.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/tcp_windows.cc
@@ -125,8 +125,8 @@ typedef struct grpc_tcp {
int shutting_down;
grpc_error* shutdown_error;
- TString peer_string;
- TString local_address;
+ TString peer_string;
+ TString local_address;
} grpc_tcp;
static void tcp_free(grpc_tcp* tcp) {
@@ -135,7 +135,7 @@ static void tcp_free(grpc_tcp* tcp) {
grpc_slice_buffer_destroy_internal(&tcp->last_read_buffer);
grpc_resource_user_unref(tcp->resource_user);
if (tcp->shutting_down) GRPC_ERROR_UNREF(tcp->shutdown_error);
- delete tcp;
+ delete tcp;
}
#ifndef NDEBUG
@@ -213,8 +213,8 @@ static void on_read(void* tcpp, grpc_error* error) {
for (i = 0; i < tcp->read_slices->count; i++) {
char* dump = grpc_dump_slice(tcp->read_slices->slices[i],
GPR_DUMP_HEX | GPR_DUMP_ASCII);
- gpr_log(GPR_INFO, "READ %p (peer=%s): %s", tcp,
- tcp->peer_string.c_str(), dump);
+ gpr_log(GPR_INFO, "READ %p (peer=%s): %s", tcp,
+ tcp->peer_string.c_str(), dump);
gpr_free(dump);
}
}
@@ -361,8 +361,8 @@ static void win_write(grpc_endpoint* ep, grpc_slice_buffer* slices,
for (i = 0; i < slices->count; i++) {
char* data =
grpc_dump_slice(slices->slices[i], GPR_DUMP_HEX | GPR_DUMP_ASCII);
- gpr_log(GPR_INFO, "WRITE %p (peer=%s): %s", tcp, tcp->peer_string.c_str(),
- data);
+ gpr_log(GPR_INFO, "WRITE %p (peer=%s): %s", tcp, tcp->peer_string.c_str(),
+ data);
gpr_free(data);
}
}
@@ -476,16 +476,16 @@ static void win_destroy(grpc_endpoint* ep) {
TCP_UNREF(tcp, "destroy");
}
-static y_absl::string_view win_get_peer(grpc_endpoint* ep) {
+static y_absl::string_view win_get_peer(grpc_endpoint* ep) {
grpc_tcp* tcp = (grpc_tcp*)ep;
- return tcp->peer_string;
+ return tcp->peer_string;
+}
+
+static y_absl::string_view win_get_local_address(grpc_endpoint* ep) {
+ grpc_tcp* tcp = (grpc_tcp*)ep;
+ return tcp->local_address;
}
-static y_absl::string_view win_get_local_address(grpc_endpoint* ep) {
- grpc_tcp* tcp = (grpc_tcp*)ep;
- return tcp->local_address;
-}
-
static grpc_resource_user* win_get_resource_user(grpc_endpoint* ep) {
grpc_tcp* tcp = (grpc_tcp*)ep;
return tcp->resource_user;
@@ -504,7 +504,7 @@ static grpc_endpoint_vtable vtable = {win_read,
win_destroy,
win_get_resource_user,
win_get_peer,
- win_get_local_address,
+ win_get_local_address,
win_get_fd,
win_can_track_err};
@@ -521,7 +521,7 @@ grpc_endpoint* grpc_tcp_create(grpc_winsocket* socket,
}
}
}
- grpc_tcp* tcp = new grpc_tcp;
+ grpc_tcp* tcp = new grpc_tcp;
memset(tcp, 0, sizeof(grpc_tcp));
tcp->base.vtable = &vtable;
tcp->socket = socket;
@@ -529,16 +529,16 @@ grpc_endpoint* grpc_tcp_create(grpc_winsocket* socket,
gpr_ref_init(&tcp->refcount, 1);
GRPC_CLOSURE_INIT(&tcp->on_read, on_read, tcp, grpc_schedule_on_exec_ctx);
GRPC_CLOSURE_INIT(&tcp->on_write, on_write, tcp, grpc_schedule_on_exec_ctx);
- grpc_resolved_address resolved_local_addr;
- resolved_local_addr.len = sizeof(resolved_local_addr.addr);
- if (getsockname(tcp->socket->socket,
- reinterpret_cast<sockaddr*>(resolved_local_addr.addr),
- &resolved_local_addr.len) < 0) {
- tcp->local_address = "";
- } else {
- tcp->local_address = grpc_sockaddr_to_uri(&resolved_local_addr);
- }
- tcp->peer_string = peer_string;
+ grpc_resolved_address resolved_local_addr;
+ resolved_local_addr.len = sizeof(resolved_local_addr.addr);
+ if (getsockname(tcp->socket->socket,
+ reinterpret_cast<sockaddr*>(resolved_local_addr.addr),
+ &resolved_local_addr.len) < 0) {
+ tcp->local_address = "";
+ } else {
+ tcp->local_address = grpc_sockaddr_to_uri(&resolved_local_addr);
+ }
+ tcp->peer_string = peer_string;
grpc_slice_buffer_init(&tcp->last_read_buffer);
tcp->resource_user = grpc_resource_user_create(resource_quota, peer_string);
grpc_resource_quota_unref_internal(resource_quota);
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/timer_generic.cc b/contrib/libs/grpc/src/core/lib/iomgr/timer_generic.cc
index 38ec91f56da..fb0e50c53c9 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/timer_generic.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/timer_generic.cc
@@ -22,10 +22,10 @@
#include <inttypes.h>
-#include <util/generic/string.h>
-
-#include "y_absl/strings/str_cat.h"
-
+#include <util/generic/string.h>
+
+#include "y_absl/strings/str_cat.h"
+
#include "src/core/lib/iomgr/timer.h"
#include <grpc/support/alloc.h>
@@ -709,22 +709,22 @@ static grpc_timer_check_result timer_check(grpc_millis* next) {
// tracing
if (GRPC_TRACE_FLAG_ENABLED(grpc_timer_check_trace)) {
- TString next_str;
+ TString next_str;
if (next == nullptr) {
- next_str = "NULL";
+ next_str = "NULL";
} else {
- next_str = y_absl::StrCat(*next);
+ next_str = y_absl::StrCat(*next);
}
#if GPR_ARCH_64
gpr_log(GPR_INFO,
"TIMER CHECK BEGIN: now=%" PRId64 " next=%s tls_min=%" PRId64
" glob_min=%" PRId64,
- now, next_str.c_str(), min_timer,
+ now, next_str.c_str(), min_timer,
static_cast<grpc_millis>(gpr_atm_no_barrier_load(
(gpr_atm*)(&g_shared_mutables.min_timer))));
#else
gpr_log(GPR_INFO, "TIMER CHECK BEGIN: now=%" PRId64 " next=%s min=%" PRId64,
- now, next_str.c_str(), min_timer);
+ now, next_str.c_str(), min_timer);
#endif
}
// actual code
@@ -732,13 +732,13 @@ static grpc_timer_check_result timer_check(grpc_millis* next) {
run_some_expired_timers(now, next, shutdown_error);
// tracing
if (GRPC_TRACE_FLAG_ENABLED(grpc_timer_check_trace)) {
- TString next_str;
+ TString next_str;
if (next == nullptr) {
- next_str = "NULL";
+ next_str = "NULL";
} else {
- next_str = y_absl::StrCat(*next);
+ next_str = y_absl::StrCat(*next);
}
- gpr_log(GPR_INFO, "TIMER CHECK END: r=%d; next=%s", r, next_str.c_str());
+ gpr_log(GPR_INFO, "TIMER CHECK END: r=%d; next=%s", r, next_str.c_str());
}
return r;
}
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/udp_server.cc b/contrib/libs/grpc/src/core/lib/iomgr/udp_server.cc
index 0f32f004cde..1e7734d6818 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/udp_server.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/udp_server.cc
@@ -44,12 +44,12 @@
#include <sys/types.h>
#include <unistd.h>
-#include <util/generic/string.h>
-#include <vector>
-
-#include "y_absl/container/inlined_vector.h"
-#include "y_absl/strings/str_cat.h"
-
+#include <util/generic/string.h>
+#include <vector>
+
+#include "y_absl/container/inlined_vector.h"
+#include "y_absl/strings/str_cat.h"
+
#include <grpc/grpc.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
@@ -78,7 +78,7 @@ class GrpcUdpListener {
~GrpcUdpListener();
/* Called when grpc server starts to listening on the grpc_fd. */
- void StartListening(const std::vector<grpc_pollset*>* pollsets,
+ void StartListening(const std::vector<grpc_pollset*>* pollsets,
GrpcUdpHandlerFactory* handler_factory);
/* Called when data is available to read from the socket.
@@ -152,9 +152,9 @@ GrpcUdpListener::GrpcUdpListener(grpc_udp_server* server, int fd,
server_(server),
orphan_notified_(false),
already_shutdown_(false) {
- TString addr_str = grpc_sockaddr_to_string(addr, true);
- TString name = y_absl::StrCat("udp-server-listener:", addr_str);
- emfd_ = grpc_fd_create(fd, name.c_str(), true);
+ TString addr_str = grpc_sockaddr_to_string(addr, true);
+ TString name = y_absl::StrCat("udp-server-listener:", addr_str);
+ emfd_ = grpc_fd_create(fd, name.c_str(), true);
memcpy(&addr_, addr, sizeof(grpc_resolved_address));
GPR_ASSERT(emfd_);
gpr_mu_init(&mutex_);
@@ -178,7 +178,7 @@ struct grpc_udp_server {
int shutdown;
/* An array of listeners */
- y_absl::InlinedVector<GrpcUdpListener, 16> listeners;
+ y_absl::InlinedVector<GrpcUdpListener, 16> listeners;
/* factory for use to create udp listeners */
GrpcUdpHandlerFactory* handler_factory;
@@ -186,9 +186,9 @@ struct grpc_udp_server {
/* shutdown callback */
grpc_closure* shutdown_complete;
- /* all pollsets interested in new connections. The object pointed at is not
- * owned by this struct. */
- const std::vector<grpc_pollset*>* pollsets;
+ /* all pollsets interested in new connections. The object pointed at is not
+ * owned by this struct. */
+ const std::vector<grpc_pollset*>* pollsets;
/* opaque object to pass to callbacks */
void* user_data;
@@ -282,7 +282,7 @@ static void deactivated_all_ports(grpc_udp_server* s) {
GPR_ASSERT(s->shutdown);
- if (s->listeners.empty()) {
+ if (s->listeners.empty()) {
gpr_mu_unlock(&s->mu);
finish_shutdown(s);
return;
@@ -412,8 +412,8 @@ static int prepare_socket(grpc_socket_factory* socket_factory, int fd,
}
if (bind_socket(socket_factory, fd, addr) < 0) {
- TString addr_str = grpc_sockaddr_to_string(addr, false);
- gpr_log(GPR_ERROR, "bind addr=%s: %s", addr_str.c_str(), strerror(errno));
+ TString addr_str = grpc_sockaddr_to_string(addr, false);
+ gpr_log(GPR_ERROR, "bind addr=%s: %s", addr_str.c_str(), strerror(errno));
goto error;
}
@@ -580,8 +580,8 @@ int grpc_udp_server_add_port(grpc_udp_server* s,
"Try to have multiple listeners on same port, but SO_REUSEPORT is "
"not supported. Only create 1 listener.");
}
- TString addr_str = grpc_sockaddr_to_string(addr, true);
- gpr_log(GPR_DEBUG, "add address: %s to server", addr_str.c_str());
+ TString addr_str = grpc_sockaddr_to_string(addr, true);
+ gpr_log(GPR_DEBUG, "add address: %s to server", addr_str.c_str());
int allocated_port1 = -1;
int allocated_port2 = -1;
@@ -701,29 +701,29 @@ int grpc_udp_server_get_fd(grpc_udp_server* s, unsigned port_index) {
return s->listeners[port_index].fd();
}
-void grpc_udp_server_start(grpc_udp_server* udp_server,
- const std::vector<grpc_pollset*>* pollsets,
- void* user_data) {
+void grpc_udp_server_start(grpc_udp_server* udp_server,
+ const std::vector<grpc_pollset*>* pollsets,
+ void* user_data) {
gpr_log(GPR_DEBUG, "grpc_udp_server_start");
- gpr_mu_lock(&udp_server->mu);
- GPR_ASSERT(udp_server->active_ports == 0);
- udp_server->pollsets = pollsets;
- udp_server->user_data = user_data;
+ gpr_mu_lock(&udp_server->mu);
+ GPR_ASSERT(udp_server->active_ports == 0);
+ udp_server->pollsets = pollsets;
+ udp_server->user_data = user_data;
- for (auto& listener : udp_server->listeners) {
- listener.StartListening(pollsets, udp_server->handler_factory);
+ for (auto& listener : udp_server->listeners) {
+ listener.StartListening(pollsets, udp_server->handler_factory);
}
- gpr_mu_unlock(&udp_server->mu);
+ gpr_mu_unlock(&udp_server->mu);
}
-void GrpcUdpListener::StartListening(const std::vector<grpc_pollset*>* pollsets,
+void GrpcUdpListener::StartListening(const std::vector<grpc_pollset*>* pollsets,
GrpcUdpHandlerFactory* handler_factory) {
gpr_mu_lock(&mutex_);
handler_factory_ = handler_factory;
udp_handler_ = handler_factory->CreateUdpHandler(emfd_, server_->user_data);
- for (grpc_pollset* pollset : *pollsets) {
- grpc_pollset_add_fd(pollset, emfd_);
+ for (grpc_pollset* pollset : *pollsets) {
+ grpc_pollset_add_fd(pollset, emfd_);
}
GRPC_CLOSURE_INIT(&read_closure_, on_read, this, grpc_schedule_on_exec_ctx);
grpc_fd_notify_on_read(emfd_, &read_closure_);
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/udp_server.h b/contrib/libs/grpc/src/core/lib/iomgr/udp_server.h
index aaca6c53c8e..6cda332a5bb 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/udp_server.h
+++ b/contrib/libs/grpc/src/core/lib/iomgr/udp_server.h
@@ -21,8 +21,8 @@
#include <grpc/support/port_platform.h>
-#include <vector>
-
+#include <vector>
+
#include "src/core/lib/iomgr/endpoint.h"
#include "src/core/lib/iomgr/ev_posix.h"
#include "src/core/lib/iomgr/resolve_address.h"
@@ -74,9 +74,9 @@ class GrpcUdpHandlerFactory {
grpc_udp_server* grpc_udp_server_create(const grpc_channel_args* args);
/* Start listening to bound ports. user_data is passed to callbacks. */
-void grpc_udp_server_start(grpc_udp_server* udp_server,
- const std::vector<grpc_pollset*>* pollsets,
- void* user_data);
+void grpc_udp_server_start(grpc_udp_server* udp_server,
+ const std::vector<grpc_pollset*>* pollsets,
+ void* user_data);
int grpc_udp_server_get_fd(grpc_udp_server* s, unsigned port_index);
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/unix_sockets_posix.cc b/contrib/libs/grpc/src/core/lib/iomgr/unix_sockets_posix.cc
index 8f02f7bd25c..fd26673b38f 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/unix_sockets_posix.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/unix_sockets_posix.cc
@@ -28,8 +28,8 @@
#include <sys/types.h>
#include <sys/un.h>
-#include "y_absl/strings/str_cat.h"
-
+#include "y_absl/strings/str_cat.h"
+
#include "src/core/lib/iomgr/unix_sockets_posix.h"
#include <grpc/support/alloc.h>
@@ -46,10 +46,10 @@ grpc_error* grpc_resolve_unix_domain_address(const char* name,
struct sockaddr_un* un;
if (strlen(name) >
GPR_ARRAY_SIZE(((struct sockaddr_un*)nullptr)->sun_path) - 1) {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("Path name should not have more than ",
- GPR_ARRAY_SIZE(un->sun_path) - 1, " characters")
- .c_str());
+ return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrCat("Path name should not have more than ",
+ GPR_ARRAY_SIZE(un->sun_path) - 1, " characters")
+ .c_str());
}
*addrs = static_cast<grpc_resolved_addresses*>(
gpr_malloc(sizeof(grpc_resolved_addresses)));
@@ -86,14 +86,14 @@ void grpc_unlink_if_unix_domain_socket(
}
}
-TString grpc_sockaddr_to_uri_unix_if_possible(
+TString grpc_sockaddr_to_uri_unix_if_possible(
const grpc_resolved_address* resolved_addr) {
const grpc_sockaddr* addr =
reinterpret_cast<const grpc_sockaddr*>(resolved_addr->addr);
if (addr->sa_family != AF_UNIX) {
- return "";
+ return "";
}
- return y_absl::StrCat("unix:", ((struct sockaddr_un*)addr)->sun_path);
+ return y_absl::StrCat("unix:", ((struct sockaddr_un*)addr)->sun_path);
}
#endif
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/unix_sockets_posix.h b/contrib/libs/grpc/src/core/lib/iomgr/unix_sockets_posix.h
index f5cbae30b64..962adde71cd 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/unix_sockets_posix.h
+++ b/contrib/libs/grpc/src/core/lib/iomgr/unix_sockets_posix.h
@@ -21,8 +21,8 @@
#include <grpc/support/port_platform.h>
-#include <util/generic/string.h>
-
+#include <util/generic/string.h>
+
#include "src/core/lib/iomgr/port.h"
#include <grpc/support/string_util.h>
@@ -39,7 +39,7 @@ int grpc_is_unix_socket(const grpc_resolved_address* resolved_addr);
void grpc_unlink_if_unix_domain_socket(
const grpc_resolved_address* resolved_addr);
-TString grpc_sockaddr_to_uri_unix_if_possible(
+TString grpc_sockaddr_to_uri_unix_if_possible(
const grpc_resolved_address* resolved_addr);
#endif /* GRPC_CORE_LIB_IOMGR_UNIX_SOCKETS_POSIX_H */
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/unix_sockets_posix_noop.cc b/contrib/libs/grpc/src/core/lib/iomgr/unix_sockets_posix_noop.cc
index 2548c1349b4..e391914ab5c 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/unix_sockets_posix_noop.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/unix_sockets_posix_noop.cc
@@ -22,8 +22,8 @@
#ifndef GRPC_HAVE_UNIX_SOCKET
-#include <util/generic/string.h>
-
+#include <util/generic/string.h>
+
#include <grpc/support/log.h>
void grpc_create_socketpair_if_unix(int sv[2]) {
@@ -44,9 +44,9 @@ int grpc_is_unix_socket(const grpc_resolved_address* addr) { return false; }
void grpc_unlink_if_unix_domain_socket(const grpc_resolved_address* addr) {}
-TString grpc_sockaddr_to_uri_unix_if_possible(
- const grpc_resolved_address* addr) {
- return "";
+TString grpc_sockaddr_to_uri_unix_if_possible(
+ const grpc_resolved_address* addr) {
+ return "";
}
#endif
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/work_serializer.cc b/contrib/libs/grpc/src/core/lib/iomgr/work_serializer.cc
index f2d2e64bcf2..db573e3b6f3 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/work_serializer.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/work_serializer.cc
@@ -1,155 +1,155 @@
-/*
- *
- * Copyright 2019 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <grpc/support/port_platform.h>
-
-#include "src/core/lib/iomgr/work_serializer.h"
-
-namespace grpc_core {
-
-DebugOnlyTraceFlag grpc_work_serializer_trace(false, "work_serializer");
-
-struct CallbackWrapper {
- CallbackWrapper(std::function<void()> cb, const grpc_core::DebugLocation& loc)
- : callback(std::move(cb)), location(loc) {}
-
- MultiProducerSingleConsumerQueue::Node mpscq_node;
- const std::function<void()> callback;
- const DebugLocation location;
-};
-
-class WorkSerializer::WorkSerializerImpl : public Orphanable {
- public:
- void Run(std::function<void()> callback,
- const grpc_core::DebugLocation& location);
-
- void Orphan() override;
-
- private:
- void DrainQueue();
-
- // An initial size of 1 keeps track of whether the work serializer has been
- // orphaned.
- Atomic<size_t> size_{1};
- MultiProducerSingleConsumerQueue queue_;
-};
-
-void WorkSerializer::WorkSerializerImpl::Run(
- std::function<void()> callback, const grpc_core::DebugLocation& location) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_work_serializer_trace)) {
- gpr_log(GPR_INFO, "WorkSerializer::Run() %p Scheduling callback [%s:%d]",
- this, location.file(), location.line());
- }
- const size_t prev_size = size_.FetchAdd(1);
- // The work serializer should not have been orphaned.
- GPR_DEBUG_ASSERT(prev_size > 0);
- if (prev_size == 1) {
- // There is no other closure executing right now on this work serializer.
- // Execute this closure immediately.
- if (GRPC_TRACE_FLAG_ENABLED(grpc_work_serializer_trace)) {
- gpr_log(GPR_INFO, " Executing immediately");
- }
- callback();
- // Loan this thread to the work serializer thread and drain the queue.
- DrainQueue();
- } else {
- CallbackWrapper* cb_wrapper =
- new CallbackWrapper(std::move(callback), location);
- // There already are closures executing on this work serializer. Simply add
- // this closure to the queue.
- if (GRPC_TRACE_FLAG_ENABLED(grpc_work_serializer_trace)) {
- gpr_log(GPR_INFO, " Scheduling on queue : item %p", cb_wrapper);
- }
- queue_.Push(&cb_wrapper->mpscq_node);
- }
-}
-
-void WorkSerializer::WorkSerializerImpl::Orphan() {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_work_serializer_trace)) {
- gpr_log(GPR_INFO, "WorkSerializer::Orphan() %p", this);
- }
- size_t prev_size = size_.FetchSub(1);
- if (prev_size == 1) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_work_serializer_trace)) {
- gpr_log(GPR_INFO, " Destroying");
- }
- delete this;
- }
-}
-
-// The thread that calls this loans itself to the work serializer so as to
-// execute all the scheduled callback. This is called from within
-// WorkSerializer::Run() after executing a callback immediately, and hence size_
-// is at least 1.
-void WorkSerializer::WorkSerializerImpl::DrainQueue() {
- while (true) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_work_serializer_trace)) {
- gpr_log(GPR_INFO, "WorkSerializer::DrainQueue() %p", this);
- }
- size_t prev_size = size_.FetchSub(1);
- GPR_DEBUG_ASSERT(prev_size >= 1);
- // It is possible that while draining the queue, one of the callbacks ended
- // up orphaning the work serializer. In that case, delete the object.
- if (prev_size == 1) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_work_serializer_trace)) {
- gpr_log(GPR_INFO, " Queue Drained. Destroying");
- }
- delete this;
- return;
- }
- if (prev_size == 2) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_work_serializer_trace)) {
- gpr_log(GPR_INFO, " Queue Drained");
- }
- return;
- }
- // There is at least one callback on the queue. Pop the callback from the
- // queue and execute it.
- CallbackWrapper* cb_wrapper = nullptr;
- bool empty_unused;
- while ((cb_wrapper = reinterpret_cast<CallbackWrapper*>(
- queue_.PopAndCheckEnd(&empty_unused))) == nullptr) {
- // This can happen either due to a race condition within the mpscq
- // implementation or because of a race with Run()
- if (GRPC_TRACE_FLAG_ENABLED(grpc_work_serializer_trace)) {
- gpr_log(GPR_INFO, " Queue returned nullptr, trying again");
- }
- }
- if (GRPC_TRACE_FLAG_ENABLED(grpc_work_serializer_trace)) {
- gpr_log(GPR_INFO, " Running item %p : callback scheduled at [%s:%d]",
- cb_wrapper, cb_wrapper->location.file(),
- cb_wrapper->location.line());
- }
- cb_wrapper->callback();
- delete cb_wrapper;
- }
-}
-
-// WorkSerializer
-
-WorkSerializer::WorkSerializer()
- : impl_(MakeOrphanable<WorkSerializerImpl>()) {}
-
-WorkSerializer::~WorkSerializer() {}
-
-void WorkSerializer::Run(std::function<void()> callback,
- const grpc_core::DebugLocation& location) {
- impl_->Run(std::move(callback), location);
-}
-
-} // namespace grpc_core
+/*
+ *
+ * Copyright 2019 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/lib/iomgr/work_serializer.h"
+
+namespace grpc_core {
+
+DebugOnlyTraceFlag grpc_work_serializer_trace(false, "work_serializer");
+
+struct CallbackWrapper {
+ CallbackWrapper(std::function<void()> cb, const grpc_core::DebugLocation& loc)
+ : callback(std::move(cb)), location(loc) {}
+
+ MultiProducerSingleConsumerQueue::Node mpscq_node;
+ const std::function<void()> callback;
+ const DebugLocation location;
+};
+
+class WorkSerializer::WorkSerializerImpl : public Orphanable {
+ public:
+ void Run(std::function<void()> callback,
+ const grpc_core::DebugLocation& location);
+
+ void Orphan() override;
+
+ private:
+ void DrainQueue();
+
+ // An initial size of 1 keeps track of whether the work serializer has been
+ // orphaned.
+ Atomic<size_t> size_{1};
+ MultiProducerSingleConsumerQueue queue_;
+};
+
+void WorkSerializer::WorkSerializerImpl::Run(
+ std::function<void()> callback, const grpc_core::DebugLocation& location) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_work_serializer_trace)) {
+ gpr_log(GPR_INFO, "WorkSerializer::Run() %p Scheduling callback [%s:%d]",
+ this, location.file(), location.line());
+ }
+ const size_t prev_size = size_.FetchAdd(1);
+ // The work serializer should not have been orphaned.
+ GPR_DEBUG_ASSERT(prev_size > 0);
+ if (prev_size == 1) {
+ // There is no other closure executing right now on this work serializer.
+ // Execute this closure immediately.
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_work_serializer_trace)) {
+ gpr_log(GPR_INFO, " Executing immediately");
+ }
+ callback();
+ // Loan this thread to the work serializer thread and drain the queue.
+ DrainQueue();
+ } else {
+ CallbackWrapper* cb_wrapper =
+ new CallbackWrapper(std::move(callback), location);
+ // There already are closures executing on this work serializer. Simply add
+ // this closure to the queue.
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_work_serializer_trace)) {
+ gpr_log(GPR_INFO, " Scheduling on queue : item %p", cb_wrapper);
+ }
+ queue_.Push(&cb_wrapper->mpscq_node);
+ }
+}
+
+void WorkSerializer::WorkSerializerImpl::Orphan() {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_work_serializer_trace)) {
+ gpr_log(GPR_INFO, "WorkSerializer::Orphan() %p", this);
+ }
+ size_t prev_size = size_.FetchSub(1);
+ if (prev_size == 1) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_work_serializer_trace)) {
+ gpr_log(GPR_INFO, " Destroying");
+ }
+ delete this;
+ }
+}
+
+// The thread that calls this loans itself to the work serializer so as to
+// execute all the scheduled callback. This is called from within
+// WorkSerializer::Run() after executing a callback immediately, and hence size_
+// is at least 1.
+void WorkSerializer::WorkSerializerImpl::DrainQueue() {
+ while (true) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_work_serializer_trace)) {
+ gpr_log(GPR_INFO, "WorkSerializer::DrainQueue() %p", this);
+ }
+ size_t prev_size = size_.FetchSub(1);
+ GPR_DEBUG_ASSERT(prev_size >= 1);
+ // It is possible that while draining the queue, one of the callbacks ended
+ // up orphaning the work serializer. In that case, delete the object.
+ if (prev_size == 1) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_work_serializer_trace)) {
+ gpr_log(GPR_INFO, " Queue Drained. Destroying");
+ }
+ delete this;
+ return;
+ }
+ if (prev_size == 2) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_work_serializer_trace)) {
+ gpr_log(GPR_INFO, " Queue Drained");
+ }
+ return;
+ }
+ // There is at least one callback on the queue. Pop the callback from the
+ // queue and execute it.
+ CallbackWrapper* cb_wrapper = nullptr;
+ bool empty_unused;
+ while ((cb_wrapper = reinterpret_cast<CallbackWrapper*>(
+ queue_.PopAndCheckEnd(&empty_unused))) == nullptr) {
+ // This can happen either due to a race condition within the mpscq
+ // implementation or because of a race with Run()
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_work_serializer_trace)) {
+ gpr_log(GPR_INFO, " Queue returned nullptr, trying again");
+ }
+ }
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_work_serializer_trace)) {
+ gpr_log(GPR_INFO, " Running item %p : callback scheduled at [%s:%d]",
+ cb_wrapper, cb_wrapper->location.file(),
+ cb_wrapper->location.line());
+ }
+ cb_wrapper->callback();
+ delete cb_wrapper;
+ }
+}
+
+// WorkSerializer
+
+WorkSerializer::WorkSerializer()
+ : impl_(MakeOrphanable<WorkSerializerImpl>()) {}
+
+WorkSerializer::~WorkSerializer() {}
+
+void WorkSerializer::Run(std::function<void()> callback,
+ const grpc_core::DebugLocation& location) {
+ impl_->Run(std::move(callback), location);
+}
+
+} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/work_serializer.h b/contrib/libs/grpc/src/core/lib/iomgr/work_serializer.h
index 77a1a383ccb..53c80701a11 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/work_serializer.h
+++ b/contrib/libs/grpc/src/core/lib/iomgr/work_serializer.h
@@ -1,65 +1,65 @@
-/*
- *
- * Copyright 2019 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <grpc/support/port_platform.h>
-
-#include <functional>
-
-#include "src/core/lib/debug/trace.h"
-#include "src/core/lib/gprpp/atomic.h"
-#include "src/core/lib/gprpp/debug_location.h"
-#include "src/core/lib/gprpp/mpscq.h"
-#include "src/core/lib/gprpp/orphanable.h"
-#include "src/core/lib/gprpp/ref_counted.h"
-#include "src/core/lib/iomgr/exec_ctx.h"
-
-#ifndef GRPC_CORE_LIB_IOMGR_WORK_SERIALIZER_H
-#define GRPC_CORE_LIB_IOMGR_WORK_SERIALIZER_H
-
-namespace grpc_core {
-
-// WorkSerializer is a mechanism to schedule callbacks in a synchronized manner.
-// All callbacks scheduled on a WorkSerializer instance will be executed
-// serially in a borrowed thread. The API provides a FIFO guarantee to the
-// execution of callbacks scheduled on the thread.
-// When a thread calls Run() with a callback, the thread is considered borrowed.
-// The callback might run inline, or it might run asynchronously in a different
-// thread that is already inside of Run(). If the callback runs directly inline,
-// other callbacks from other threads might also be executed before Run()
-// returns. Since an arbitrary set of callbacks might be executed when Run() is
-// called, generally no locks should be held while calling Run().
-class WorkSerializer {
- public:
- WorkSerializer();
-
- ~WorkSerializer();
-
- // TODO(yashkt): Replace grpc_core::DebugLocation with y_absl::SourceLocation
- // once we can start using it directly.
- void Run(std::function<void()> callback,
- const grpc_core::DebugLocation& location);
-
- private:
- class WorkSerializerImpl;
-
- OrphanablePtr<WorkSerializerImpl> impl_;
-};
-
-} /* namespace grpc_core */
-
-#endif /* GRPC_CORE_LIB_IOMGR_WORK_SERIALIZER_H */
+/*
+ *
+ * Copyright 2019 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <grpc/support/port_platform.h>
+
+#include <functional>
+
+#include "src/core/lib/debug/trace.h"
+#include "src/core/lib/gprpp/atomic.h"
+#include "src/core/lib/gprpp/debug_location.h"
+#include "src/core/lib/gprpp/mpscq.h"
+#include "src/core/lib/gprpp/orphanable.h"
+#include "src/core/lib/gprpp/ref_counted.h"
+#include "src/core/lib/iomgr/exec_ctx.h"
+
+#ifndef GRPC_CORE_LIB_IOMGR_WORK_SERIALIZER_H
+#define GRPC_CORE_LIB_IOMGR_WORK_SERIALIZER_H
+
+namespace grpc_core {
+
+// WorkSerializer is a mechanism to schedule callbacks in a synchronized manner.
+// All callbacks scheduled on a WorkSerializer instance will be executed
+// serially in a borrowed thread. The API provides a FIFO guarantee to the
+// execution of callbacks scheduled on the thread.
+// When a thread calls Run() with a callback, the thread is considered borrowed.
+// The callback might run inline, or it might run asynchronously in a different
+// thread that is already inside of Run(). If the callback runs directly inline,
+// other callbacks from other threads might also be executed before Run()
+// returns. Since an arbitrary set of callbacks might be executed when Run() is
+// called, generally no locks should be held while calling Run().
+class WorkSerializer {
+ public:
+ WorkSerializer();
+
+ ~WorkSerializer();
+
+ // TODO(yashkt): Replace grpc_core::DebugLocation with y_absl::SourceLocation
+ // once we can start using it directly.
+ void Run(std::function<void()> callback,
+ const grpc_core::DebugLocation& location);
+
+ private:
+ class WorkSerializerImpl;
+
+ OrphanablePtr<WorkSerializerImpl> impl_;
+};
+
+} /* namespace grpc_core */
+
+#endif /* GRPC_CORE_LIB_IOMGR_WORK_SERIALIZER_H */
diff --git a/contrib/libs/grpc/src/core/lib/json/json.h b/contrib/libs/grpc/src/core/lib/json/json.h
index 82a3b0aa07b..f426fbf1dde 100644
--- a/contrib/libs/grpc/src/core/lib/json/json.h
+++ b/contrib/libs/grpc/src/core/lib/json/json.h
@@ -23,219 +23,219 @@
#include <stdlib.h>
-#include <map>
-#include <util/generic/string.h>
-#include <util/string/cast.h>
-#include <vector>
-
-#include "y_absl/strings/string_view.h"
-
-#include "src/core/lib/iomgr/error.h"
-
-namespace grpc_core {
-
-// A JSON value, which can be any one of object, array, string,
-// number, true, false, or null.
-class Json {
- public:
- // TODO(roth): Currently, numbers are stored internally as strings,
- // which makes the API a bit cumbersome to use. When we have time,
- // consider whether there's a better alternative (e.g., maybe storing
- // each numeric type as the native C++ type and automatically converting
- // to string as needed).
- enum class Type {
- JSON_NULL,
- JSON_TRUE,
- JSON_FALSE,
- NUMBER,
- STRING,
- OBJECT,
- ARRAY
- };
-
- using Object = std::map<TString, Json>;
- using Array = std::vector<Json>;
-
- // Parses JSON string from json_str. On error, sets *error.
- static Json Parse(y_absl::string_view json_str, grpc_error** error);
-
- Json() = default;
-
- // Copyable.
- Json(const Json& other) { CopyFrom(other); }
- Json& operator=(const Json& other) {
- CopyFrom(other);
- return *this;
- }
-
- // Moveable.
- Json(Json&& other) { MoveFrom(std::move(other)); }
- Json& operator=(Json&& other) {
- MoveFrom(std::move(other));
- return *this;
- }
-
- // Construct from copying a string.
- // If is_number is true, the type will be NUMBER instead of STRING.
- Json(const TString& string, bool is_number = false)
- : type_(is_number ? Type::NUMBER : Type::STRING), string_value_(string) {}
- Json& operator=(const TString& string) {
- type_ = Type::STRING;
- string_value_ = string;
- return *this;
- }
-
- // Same thing for C-style strings, both const and mutable.
- Json(const char* string, bool is_number = false)
- : Json(TString(string), is_number) {}
- Json& operator=(const char* string) {
- *this = TString(string);
- return *this;
- }
- Json(char* string, bool is_number = false)
- : Json(TString(string), is_number) {}
- Json& operator=(char* string) {
- *this = TString(string);
- return *this;
- }
-
- // Construct by moving a string.
- Json(TString&& string)
- : type_(Type::STRING), string_value_(std::move(string)) {}
- Json& operator=(TString&& string) {
- type_ = Type::STRING;
- string_value_ = std::move(string);
- return *this;
- }
-
- // Construct from bool.
- Json(bool b) : type_(b ? Type::JSON_TRUE : Type::JSON_FALSE) {}
- Json& operator=(bool b) {
- type_ = b ? Type::JSON_TRUE : Type::JSON_FALSE;
- return *this;
- }
-
- // Construct from any numeric type.
- template <typename NumericType>
- Json(NumericType number)
- : type_(Type::NUMBER), string_value_(ToString(number)) {}
- template <typename NumericType>
- Json& operator=(NumericType number) {
- type_ = Type::NUMBER;
- string_value_ = ToString(number);
- return *this;
- }
-
- // Construct by copying object.
- Json(const Object& object) : type_(Type::OBJECT), object_value_(object) {}
- Json& operator=(const Object& object) {
- type_ = Type::OBJECT;
- object_value_ = object;
- return *this;
- }
-
- // Construct by moving object.
- Json(Object&& object)
- : type_(Type::OBJECT), object_value_(std::move(object)) {}
- Json& operator=(Object&& object) {
- type_ = Type::OBJECT;
- object_value_ = std::move(object);
- return *this;
- }
-
- // Construct by copying array.
- Json(const Array& array) : type_(Type::ARRAY), array_value_(array) {}
- Json& operator=(const Array& array) {
- type_ = Type::ARRAY;
- array_value_ = array;
- return *this;
- }
-
- // Construct by moving array.
- Json(Array&& array) : type_(Type::ARRAY), array_value_(std::move(array)) {}
- Json& operator=(Array&& array) {
- type_ = Type::ARRAY;
- array_value_ = std::move(array);
- return *this;
- }
-
- // Dumps JSON from value to string form.
- TString Dump(int indent = 0) const;
-
- // Accessor methods.
- Type type() const { return type_; }
- const TString& string_value() const { return string_value_; }
- TString* mutable_string_value() { return &string_value_; }
- const Object& object_value() const { return object_value_; }
- Object* mutable_object() { return &object_value_; }
- const Array& array_value() const { return array_value_; }
- Array* mutable_array() { return &array_value_; }
-
- bool operator==(const Json& other) const {
- if (type_ != other.type_) return false;
- switch (type_) {
- case Type::NUMBER:
- case Type::STRING:
- if (string_value_ != other.string_value_) return false;
- break;
- case Type::OBJECT:
- if (object_value_ != other.object_value_) return false;
- break;
- case Type::ARRAY:
- if (array_value_ != other.array_value_) return false;
- break;
- default:
- break;
- }
- return true;
- }
-
- bool operator!=(const Json& other) const { return !(*this == other); }
-
- private:
- void CopyFrom(const Json& other) {
- type_ = other.type_;
- switch (type_) {
- case Type::NUMBER:
- case Type::STRING:
- string_value_ = other.string_value_;
- break;
- case Type::OBJECT:
- object_value_ = other.object_value_;
- break;
- case Type::ARRAY:
- array_value_ = other.array_value_;
- break;
- default:
- break;
- }
- }
-
- void MoveFrom(Json&& other) {
- type_ = other.type_;
- other.type_ = Type::JSON_NULL;
- switch (type_) {
- case Type::NUMBER:
- case Type::STRING:
- string_value_ = std::move(other.string_value_);
- break;
- case Type::OBJECT:
- object_value_ = std::move(other.object_value_);
- break;
- case Type::ARRAY:
- array_value_ = std::move(other.array_value_);
- break;
- default:
- break;
- }
- }
-
- Type type_ = Type::JSON_NULL;
- TString string_value_;
- Object object_value_;
- Array array_value_;
-};
-
-} // namespace grpc_core
-
+#include <map>
+#include <util/generic/string.h>
+#include <util/string/cast.h>
+#include <vector>
+
+#include "y_absl/strings/string_view.h"
+
+#include "src/core/lib/iomgr/error.h"
+
+namespace grpc_core {
+
+// A JSON value, which can be any one of object, array, string,
+// number, true, false, or null.
+class Json {
+ public:
+ // TODO(roth): Currently, numbers are stored internally as strings,
+ // which makes the API a bit cumbersome to use. When we have time,
+ // consider whether there's a better alternative (e.g., maybe storing
+ // each numeric type as the native C++ type and automatically converting
+ // to string as needed).
+ enum class Type {
+ JSON_NULL,
+ JSON_TRUE,
+ JSON_FALSE,
+ NUMBER,
+ STRING,
+ OBJECT,
+ ARRAY
+ };
+
+ using Object = std::map<TString, Json>;
+ using Array = std::vector<Json>;
+
+ // Parses JSON string from json_str. On error, sets *error.
+ static Json Parse(y_absl::string_view json_str, grpc_error** error);
+
+ Json() = default;
+
+ // Copyable.
+ Json(const Json& other) { CopyFrom(other); }
+ Json& operator=(const Json& other) {
+ CopyFrom(other);
+ return *this;
+ }
+
+ // Moveable.
+ Json(Json&& other) { MoveFrom(std::move(other)); }
+ Json& operator=(Json&& other) {
+ MoveFrom(std::move(other));
+ return *this;
+ }
+
+ // Construct from copying a string.
+ // If is_number is true, the type will be NUMBER instead of STRING.
+ Json(const TString& string, bool is_number = false)
+ : type_(is_number ? Type::NUMBER : Type::STRING), string_value_(string) {}
+ Json& operator=(const TString& string) {
+ type_ = Type::STRING;
+ string_value_ = string;
+ return *this;
+ }
+
+ // Same thing for C-style strings, both const and mutable.
+ Json(const char* string, bool is_number = false)
+ : Json(TString(string), is_number) {}
+ Json& operator=(const char* string) {
+ *this = TString(string);
+ return *this;
+ }
+ Json(char* string, bool is_number = false)
+ : Json(TString(string), is_number) {}
+ Json& operator=(char* string) {
+ *this = TString(string);
+ return *this;
+ }
+
+ // Construct by moving a string.
+ Json(TString&& string)
+ : type_(Type::STRING), string_value_(std::move(string)) {}
+ Json& operator=(TString&& string) {
+ type_ = Type::STRING;
+ string_value_ = std::move(string);
+ return *this;
+ }
+
+ // Construct from bool.
+ Json(bool b) : type_(b ? Type::JSON_TRUE : Type::JSON_FALSE) {}
+ Json& operator=(bool b) {
+ type_ = b ? Type::JSON_TRUE : Type::JSON_FALSE;
+ return *this;
+ }
+
+ // Construct from any numeric type.
+ template <typename NumericType>
+ Json(NumericType number)
+ : type_(Type::NUMBER), string_value_(ToString(number)) {}
+ template <typename NumericType>
+ Json& operator=(NumericType number) {
+ type_ = Type::NUMBER;
+ string_value_ = ToString(number);
+ return *this;
+ }
+
+ // Construct by copying object.
+ Json(const Object& object) : type_(Type::OBJECT), object_value_(object) {}
+ Json& operator=(const Object& object) {
+ type_ = Type::OBJECT;
+ object_value_ = object;
+ return *this;
+ }
+
+ // Construct by moving object.
+ Json(Object&& object)
+ : type_(Type::OBJECT), object_value_(std::move(object)) {}
+ Json& operator=(Object&& object) {
+ type_ = Type::OBJECT;
+ object_value_ = std::move(object);
+ return *this;
+ }
+
+ // Construct by copying array.
+ Json(const Array& array) : type_(Type::ARRAY), array_value_(array) {}
+ Json& operator=(const Array& array) {
+ type_ = Type::ARRAY;
+ array_value_ = array;
+ return *this;
+ }
+
+ // Construct by moving array.
+ Json(Array&& array) : type_(Type::ARRAY), array_value_(std::move(array)) {}
+ Json& operator=(Array&& array) {
+ type_ = Type::ARRAY;
+ array_value_ = std::move(array);
+ return *this;
+ }
+
+ // Dumps JSON from value to string form.
+ TString Dump(int indent = 0) const;
+
+ // Accessor methods.
+ Type type() const { return type_; }
+ const TString& string_value() const { return string_value_; }
+ TString* mutable_string_value() { return &string_value_; }
+ const Object& object_value() const { return object_value_; }
+ Object* mutable_object() { return &object_value_; }
+ const Array& array_value() const { return array_value_; }
+ Array* mutable_array() { return &array_value_; }
+
+ bool operator==(const Json& other) const {
+ if (type_ != other.type_) return false;
+ switch (type_) {
+ case Type::NUMBER:
+ case Type::STRING:
+ if (string_value_ != other.string_value_) return false;
+ break;
+ case Type::OBJECT:
+ if (object_value_ != other.object_value_) return false;
+ break;
+ case Type::ARRAY:
+ if (array_value_ != other.array_value_) return false;
+ break;
+ default:
+ break;
+ }
+ return true;
+ }
+
+ bool operator!=(const Json& other) const { return !(*this == other); }
+
+ private:
+ void CopyFrom(const Json& other) {
+ type_ = other.type_;
+ switch (type_) {
+ case Type::NUMBER:
+ case Type::STRING:
+ string_value_ = other.string_value_;
+ break;
+ case Type::OBJECT:
+ object_value_ = other.object_value_;
+ break;
+ case Type::ARRAY:
+ array_value_ = other.array_value_;
+ break;
+ default:
+ break;
+ }
+ }
+
+ void MoveFrom(Json&& other) {
+ type_ = other.type_;
+ other.type_ = Type::JSON_NULL;
+ switch (type_) {
+ case Type::NUMBER:
+ case Type::STRING:
+ string_value_ = std::move(other.string_value_);
+ break;
+ case Type::OBJECT:
+ object_value_ = std::move(other.object_value_);
+ break;
+ case Type::ARRAY:
+ array_value_ = std::move(other.array_value_);
+ break;
+ default:
+ break;
+ }
+ }
+
+ Type type_ = Type::JSON_NULL;
+ TString string_value_;
+ Object object_value_;
+ Array array_value_;
+};
+
+} // namespace grpc_core
+
#endif /* GRPC_CORE_LIB_JSON_JSON_H */
diff --git a/contrib/libs/grpc/src/core/lib/json/json_reader.cc b/contrib/libs/grpc/src/core/lib/json/json_reader.cc
index f2dbe5844df..e251cb78824 100644
--- a/contrib/libs/grpc/src/core/lib/json/json_reader.cc
+++ b/contrib/libs/grpc/src/core/lib/json/json_reader.cc
@@ -20,267 +20,267 @@
#include <string.h>
-#include <util/generic/string.h>
-
-#include "y_absl/strings/str_cat.h"
-#include "y_absl/strings/str_format.h"
-
+#include <util/generic/string.h>
+
+#include "y_absl/strings/str_cat.h"
+#include "y_absl/strings/str_format.h"
+
#include <grpc/support/log.h>
-#include "src/core/lib/json/json.h"
-
-#define GRPC_JSON_MAX_DEPTH 255
-#define GRPC_JSON_MAX_ERRORS 16
-
-namespace grpc_core {
-
-namespace {
-
-class JsonReader {
- public:
- static grpc_error* Parse(y_absl::string_view input, Json* output);
-
- private:
- enum class Status {
- GRPC_JSON_DONE, /* The parser finished successfully. */
- GRPC_JSON_PARSE_ERROR, /* The parser found an error in the json stream. */
- GRPC_JSON_INTERNAL_ERROR /* The parser got an internal error. */
- };
-
- enum class State {
- GRPC_JSON_STATE_OBJECT_KEY_BEGIN,
- GRPC_JSON_STATE_OBJECT_KEY_STRING,
- GRPC_JSON_STATE_OBJECT_KEY_END,
- GRPC_JSON_STATE_VALUE_BEGIN,
- GRPC_JSON_STATE_VALUE_STRING,
- GRPC_JSON_STATE_STRING_ESCAPE,
- GRPC_JSON_STATE_STRING_ESCAPE_U1,
- GRPC_JSON_STATE_STRING_ESCAPE_U2,
- GRPC_JSON_STATE_STRING_ESCAPE_U3,
- GRPC_JSON_STATE_STRING_ESCAPE_U4,
- GRPC_JSON_STATE_VALUE_NUMBER,
- GRPC_JSON_STATE_VALUE_NUMBER_WITH_DECIMAL,
- GRPC_JSON_STATE_VALUE_NUMBER_ZERO,
- GRPC_JSON_STATE_VALUE_NUMBER_DOT,
- GRPC_JSON_STATE_VALUE_NUMBER_E,
- GRPC_JSON_STATE_VALUE_NUMBER_EPM,
- GRPC_JSON_STATE_VALUE_TRUE_R,
- GRPC_JSON_STATE_VALUE_TRUE_U,
- GRPC_JSON_STATE_VALUE_TRUE_E,
- GRPC_JSON_STATE_VALUE_FALSE_A,
- GRPC_JSON_STATE_VALUE_FALSE_L,
- GRPC_JSON_STATE_VALUE_FALSE_S,
- GRPC_JSON_STATE_VALUE_FALSE_E,
- GRPC_JSON_STATE_VALUE_NULL_U,
- GRPC_JSON_STATE_VALUE_NULL_L1,
- GRPC_JSON_STATE_VALUE_NULL_L2,
- GRPC_JSON_STATE_VALUE_END,
- GRPC_JSON_STATE_END
- };
-
- /* The first non-unicode value is 0x110000. But let's pick
- * a value high enough to start our error codes from. These
- * values are safe to return from the read_char function.
- */
- static constexpr uint32_t GRPC_JSON_READ_CHAR_EOF = 0x7ffffff0;
-
- explicit JsonReader(y_absl::string_view input)
- : original_input_(reinterpret_cast<const uint8_t*>(input.data())),
- input_(original_input_),
- remaining_input_(input.size()) {}
-
- Status Run();
- uint32_t ReadChar();
- bool IsComplete();
-
- size_t CurrentIndex() const { return input_ - original_input_ - 1; }
-
- void StringAddChar(uint32_t c);
- void StringAddUtf32(uint32_t c);
-
- Json* CreateAndLinkValue();
- bool StartContainer(Json::Type type);
- void EndContainer();
- void SetKey();
- void SetString();
- bool SetNumber();
- void SetTrue();
- void SetFalse();
- void SetNull();
-
- const uint8_t* original_input_;
- const uint8_t* input_;
- size_t remaining_input_;
-
- State state_ = State::GRPC_JSON_STATE_VALUE_BEGIN;
- bool escaped_string_was_key_ = false;
- bool container_just_begun_ = false;
- uint16_t unicode_char_ = 0;
- uint16_t unicode_high_surrogate_ = 0;
- std::vector<grpc_error*> errors_;
- bool truncated_errors_ = false;
-
- Json root_value_;
- std::vector<Json*> stack_;
-
- TString key_;
- TString string_;
-};
-
-void JsonReader::StringAddChar(uint32_t c) {
- string_.push_back(static_cast<uint8_t>(c));
+#include "src/core/lib/json/json.h"
+
+#define GRPC_JSON_MAX_DEPTH 255
+#define GRPC_JSON_MAX_ERRORS 16
+
+namespace grpc_core {
+
+namespace {
+
+class JsonReader {
+ public:
+ static grpc_error* Parse(y_absl::string_view input, Json* output);
+
+ private:
+ enum class Status {
+ GRPC_JSON_DONE, /* The parser finished successfully. */
+ GRPC_JSON_PARSE_ERROR, /* The parser found an error in the json stream. */
+ GRPC_JSON_INTERNAL_ERROR /* The parser got an internal error. */
+ };
+
+ enum class State {
+ GRPC_JSON_STATE_OBJECT_KEY_BEGIN,
+ GRPC_JSON_STATE_OBJECT_KEY_STRING,
+ GRPC_JSON_STATE_OBJECT_KEY_END,
+ GRPC_JSON_STATE_VALUE_BEGIN,
+ GRPC_JSON_STATE_VALUE_STRING,
+ GRPC_JSON_STATE_STRING_ESCAPE,
+ GRPC_JSON_STATE_STRING_ESCAPE_U1,
+ GRPC_JSON_STATE_STRING_ESCAPE_U2,
+ GRPC_JSON_STATE_STRING_ESCAPE_U3,
+ GRPC_JSON_STATE_STRING_ESCAPE_U4,
+ GRPC_JSON_STATE_VALUE_NUMBER,
+ GRPC_JSON_STATE_VALUE_NUMBER_WITH_DECIMAL,
+ GRPC_JSON_STATE_VALUE_NUMBER_ZERO,
+ GRPC_JSON_STATE_VALUE_NUMBER_DOT,
+ GRPC_JSON_STATE_VALUE_NUMBER_E,
+ GRPC_JSON_STATE_VALUE_NUMBER_EPM,
+ GRPC_JSON_STATE_VALUE_TRUE_R,
+ GRPC_JSON_STATE_VALUE_TRUE_U,
+ GRPC_JSON_STATE_VALUE_TRUE_E,
+ GRPC_JSON_STATE_VALUE_FALSE_A,
+ GRPC_JSON_STATE_VALUE_FALSE_L,
+ GRPC_JSON_STATE_VALUE_FALSE_S,
+ GRPC_JSON_STATE_VALUE_FALSE_E,
+ GRPC_JSON_STATE_VALUE_NULL_U,
+ GRPC_JSON_STATE_VALUE_NULL_L1,
+ GRPC_JSON_STATE_VALUE_NULL_L2,
+ GRPC_JSON_STATE_VALUE_END,
+ GRPC_JSON_STATE_END
+ };
+
+ /* The first non-unicode value is 0x110000. But let's pick
+ * a value high enough to start our error codes from. These
+ * values are safe to return from the read_char function.
+ */
+ static constexpr uint32_t GRPC_JSON_READ_CHAR_EOF = 0x7ffffff0;
+
+ explicit JsonReader(y_absl::string_view input)
+ : original_input_(reinterpret_cast<const uint8_t*>(input.data())),
+ input_(original_input_),
+ remaining_input_(input.size()) {}
+
+ Status Run();
+ uint32_t ReadChar();
+ bool IsComplete();
+
+ size_t CurrentIndex() const { return input_ - original_input_ - 1; }
+
+ void StringAddChar(uint32_t c);
+ void StringAddUtf32(uint32_t c);
+
+ Json* CreateAndLinkValue();
+ bool StartContainer(Json::Type type);
+ void EndContainer();
+ void SetKey();
+ void SetString();
+ bool SetNumber();
+ void SetTrue();
+ void SetFalse();
+ void SetNull();
+
+ const uint8_t* original_input_;
+ const uint8_t* input_;
+ size_t remaining_input_;
+
+ State state_ = State::GRPC_JSON_STATE_VALUE_BEGIN;
+ bool escaped_string_was_key_ = false;
+ bool container_just_begun_ = false;
+ uint16_t unicode_char_ = 0;
+ uint16_t unicode_high_surrogate_ = 0;
+ std::vector<grpc_error*> errors_;
+ bool truncated_errors_ = false;
+
+ Json root_value_;
+ std::vector<Json*> stack_;
+
+ TString key_;
+ TString string_;
+};
+
+void JsonReader::StringAddChar(uint32_t c) {
+ string_.push_back(static_cast<uint8_t>(c));
+}
+
+void JsonReader::StringAddUtf32(uint32_t c) {
+ if (c <= 0x7f) {
+ StringAddChar(c);
+ } else if (c <= 0x7ff) {
+ uint32_t b1 = 0xc0 | ((c >> 6) & 0x1f);
+ uint32_t b2 = 0x80 | (c & 0x3f);
+ StringAddChar(b1);
+ StringAddChar(b2);
+ } else if (c <= 0xffff) {
+ uint32_t b1 = 0xe0 | ((c >> 12) & 0x0f);
+ uint32_t b2 = 0x80 | ((c >> 6) & 0x3f);
+ uint32_t b3 = 0x80 | (c & 0x3f);
+ StringAddChar(b1);
+ StringAddChar(b2);
+ StringAddChar(b3);
+ } else if (c <= 0x1fffff) {
+ uint32_t b1 = 0xf0 | ((c >> 18) & 0x07);
+ uint32_t b2 = 0x80 | ((c >> 12) & 0x3f);
+ uint32_t b3 = 0x80 | ((c >> 6) & 0x3f);
+ uint32_t b4 = 0x80 | (c & 0x3f);
+ StringAddChar(b1);
+ StringAddChar(b2);
+ StringAddChar(b3);
+ StringAddChar(b4);
+ }
+}
+
+uint32_t JsonReader::ReadChar() {
+ if (remaining_input_ == 0) return GRPC_JSON_READ_CHAR_EOF;
+ const uint32_t r = *input_++;
+ --remaining_input_;
+ if (r == 0) {
+ remaining_input_ = 0;
+ return GRPC_JSON_READ_CHAR_EOF;
+ }
+ return r;
}
-void JsonReader::StringAddUtf32(uint32_t c) {
- if (c <= 0x7f) {
- StringAddChar(c);
- } else if (c <= 0x7ff) {
- uint32_t b1 = 0xc0 | ((c >> 6) & 0x1f);
- uint32_t b2 = 0x80 | (c & 0x3f);
- StringAddChar(b1);
- StringAddChar(b2);
- } else if (c <= 0xffff) {
- uint32_t b1 = 0xe0 | ((c >> 12) & 0x0f);
- uint32_t b2 = 0x80 | ((c >> 6) & 0x3f);
- uint32_t b3 = 0x80 | (c & 0x3f);
- StringAddChar(b1);
- StringAddChar(b2);
- StringAddChar(b3);
- } else if (c <= 0x1fffff) {
- uint32_t b1 = 0xf0 | ((c >> 18) & 0x07);
- uint32_t b2 = 0x80 | ((c >> 12) & 0x3f);
- uint32_t b3 = 0x80 | ((c >> 6) & 0x3f);
- uint32_t b4 = 0x80 | (c & 0x3f);
- StringAddChar(b1);
- StringAddChar(b2);
- StringAddChar(b3);
- StringAddChar(b4);
- }
+Json* JsonReader::CreateAndLinkValue() {
+ Json* value;
+ if (stack_.empty()) {
+ value = &root_value_;
+ } else {
+ Json* parent = stack_.back();
+ if (parent->type() == Json::Type::OBJECT) {
+ if (parent->object_value().find(key_) != parent->object_value().end()) {
+ if (errors_.size() == GRPC_JSON_MAX_ERRORS) {
+ truncated_errors_ = true;
+ } else {
+ errors_.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrFormat("duplicate key \"%s\" at index %" PRIuPTR, key_,
+ CurrentIndex())
+ .c_str()));
+ }
+ }
+ value = &(*parent->mutable_object())[std::move(key_)];
+ } else {
+ GPR_ASSERT(parent->type() == Json::Type::ARRAY);
+ parent->mutable_array()->emplace_back();
+ value = &parent->mutable_array()->back();
+ }
+ }
+ return value;
}
-uint32_t JsonReader::ReadChar() {
- if (remaining_input_ == 0) return GRPC_JSON_READ_CHAR_EOF;
- const uint32_t r = *input_++;
- --remaining_input_;
- if (r == 0) {
- remaining_input_ = 0;
- return GRPC_JSON_READ_CHAR_EOF;
- }
- return r;
+bool JsonReader::StartContainer(Json::Type type) {
+ if (stack_.size() == GRPC_JSON_MAX_DEPTH) {
+ if (errors_.size() == GRPC_JSON_MAX_ERRORS) {
+ truncated_errors_ = true;
+ } else {
+ errors_.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrFormat("exceeded max stack depth (%d) at index %" PRIuPTR,
+ GRPC_JSON_MAX_DEPTH, CurrentIndex())
+ .c_str()));
+ }
+ return false;
+ }
+ Json* value = CreateAndLinkValue();
+ if (type == Json::Type::OBJECT) {
+ *value = Json::Object();
+ } else {
+ GPR_ASSERT(type == Json::Type::ARRAY);
+ *value = Json::Array();
+ }
+ stack_.push_back(value);
+ return true;
}
-Json* JsonReader::CreateAndLinkValue() {
- Json* value;
- if (stack_.empty()) {
- value = &root_value_;
- } else {
- Json* parent = stack_.back();
- if (parent->type() == Json::Type::OBJECT) {
- if (parent->object_value().find(key_) != parent->object_value().end()) {
- if (errors_.size() == GRPC_JSON_MAX_ERRORS) {
- truncated_errors_ = true;
- } else {
- errors_.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrFormat("duplicate key \"%s\" at index %" PRIuPTR, key_,
- CurrentIndex())
- .c_str()));
- }
- }
- value = &(*parent->mutable_object())[std::move(key_)];
- } else {
- GPR_ASSERT(parent->type() == Json::Type::ARRAY);
- parent->mutable_array()->emplace_back();
- value = &parent->mutable_array()->back();
- }
- }
- return value;
-}
-
-bool JsonReader::StartContainer(Json::Type type) {
- if (stack_.size() == GRPC_JSON_MAX_DEPTH) {
- if (errors_.size() == GRPC_JSON_MAX_ERRORS) {
- truncated_errors_ = true;
- } else {
- errors_.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrFormat("exceeded max stack depth (%d) at index %" PRIuPTR,
- GRPC_JSON_MAX_DEPTH, CurrentIndex())
- .c_str()));
- }
- return false;
- }
- Json* value = CreateAndLinkValue();
- if (type == Json::Type::OBJECT) {
- *value = Json::Object();
- } else {
- GPR_ASSERT(type == Json::Type::ARRAY);
- *value = Json::Array();
- }
- stack_.push_back(value);
- return true;
-}
-
-void JsonReader::EndContainer() {
- GPR_ASSERT(!stack_.empty());
- stack_.pop_back();
+void JsonReader::EndContainer() {
+ GPR_ASSERT(!stack_.empty());
+ stack_.pop_back();
}
-void JsonReader::SetKey() {
- key_ = std::move(string_);
- string_.clear();
+void JsonReader::SetKey() {
+ key_ = std::move(string_);
+ string_.clear();
}
-void JsonReader::SetString() {
- Json* value = CreateAndLinkValue();
- *value = std::move(string_);
- string_.clear();
+void JsonReader::SetString() {
+ Json* value = CreateAndLinkValue();
+ *value = std::move(string_);
+ string_.clear();
}
-bool JsonReader::SetNumber() {
- Json* value = CreateAndLinkValue();
- *value = Json(string_, /*is_number=*/true);
- string_.clear();
- return true;
+bool JsonReader::SetNumber() {
+ Json* value = CreateAndLinkValue();
+ *value = Json(string_, /*is_number=*/true);
+ string_.clear();
+ return true;
}
-void JsonReader::SetTrue() {
- Json* value = CreateAndLinkValue();
- *value = true;
- string_.clear();
+void JsonReader::SetTrue() {
+ Json* value = CreateAndLinkValue();
+ *value = true;
+ string_.clear();
}
-void JsonReader::SetFalse() {
- Json* value = CreateAndLinkValue();
- *value = false;
- string_.clear();
+void JsonReader::SetFalse() {
+ Json* value = CreateAndLinkValue();
+ *value = false;
+ string_.clear();
}
-void JsonReader::SetNull() { CreateAndLinkValue(); }
+void JsonReader::SetNull() { CreateAndLinkValue(); }
-bool JsonReader::IsComplete() {
- return (stack_.empty() && (state_ == State::GRPC_JSON_STATE_END ||
- state_ == State::GRPC_JSON_STATE_VALUE_END));
+bool JsonReader::IsComplete() {
+ return (stack_.empty() && (state_ == State::GRPC_JSON_STATE_END ||
+ state_ == State::GRPC_JSON_STATE_VALUE_END));
}
-/* Call this function to start parsing the input. It will return the following:
- * . GRPC_JSON_DONE if the input got eof, and the parsing finished
- * successfully.
- * . GRPC_JSON_PARSE_ERROR if the input was somehow invalid.
- * . GRPC_JSON_INTERNAL_ERROR if the parser somehow ended into an invalid
- * internal state.
- */
-JsonReader::Status JsonReader::Run() {
- uint32_t c;
+/* Call this function to start parsing the input. It will return the following:
+ * . GRPC_JSON_DONE if the input got eof, and the parsing finished
+ * successfully.
+ * . GRPC_JSON_PARSE_ERROR if the input was somehow invalid.
+ * . GRPC_JSON_INTERNAL_ERROR if the parser somehow ended into an invalid
+ * internal state.
+ */
+JsonReader::Status JsonReader::Run() {
+ uint32_t c;
/* This state-machine is a strict implementation of ECMA-404 */
- while (true) {
- c = ReadChar();
+ while (true) {
+ c = ReadChar();
switch (c) {
- /* Let's process the error case first. */
+ /* Let's process the error case first. */
case GRPC_JSON_READ_CHAR_EOF:
- if (IsComplete()) {
- return Status::GRPC_JSON_DONE;
+ if (IsComplete()) {
+ return Status::GRPC_JSON_DONE;
} else {
- return Status::GRPC_JSON_PARSE_ERROR;
+ return Status::GRPC_JSON_PARSE_ERROR;
}
break;
@@ -289,33 +289,33 @@ JsonReader::Status JsonReader::Run() {
case '\t':
case '\n':
case '\r':
- switch (state_) {
- case State::GRPC_JSON_STATE_OBJECT_KEY_BEGIN:
- case State::GRPC_JSON_STATE_OBJECT_KEY_END:
- case State::GRPC_JSON_STATE_VALUE_BEGIN:
- case State::GRPC_JSON_STATE_VALUE_END:
- case State::GRPC_JSON_STATE_END:
- break;
-
- case State::GRPC_JSON_STATE_OBJECT_KEY_STRING:
- case State::GRPC_JSON_STATE_VALUE_STRING:
- if (c != ' ') return Status::GRPC_JSON_PARSE_ERROR;
- if (unicode_high_surrogate_ != 0) {
- return Status::GRPC_JSON_PARSE_ERROR;
- }
- StringAddChar(c);
+ switch (state_) {
+ case State::GRPC_JSON_STATE_OBJECT_KEY_BEGIN:
+ case State::GRPC_JSON_STATE_OBJECT_KEY_END:
+ case State::GRPC_JSON_STATE_VALUE_BEGIN:
+ case State::GRPC_JSON_STATE_VALUE_END:
+ case State::GRPC_JSON_STATE_END:
+ break;
+
+ case State::GRPC_JSON_STATE_OBJECT_KEY_STRING:
+ case State::GRPC_JSON_STATE_VALUE_STRING:
+ if (c != ' ') return Status::GRPC_JSON_PARSE_ERROR;
+ if (unicode_high_surrogate_ != 0) {
+ return Status::GRPC_JSON_PARSE_ERROR;
+ }
+ StringAddChar(c);
break;
- case State::GRPC_JSON_STATE_VALUE_NUMBER:
- case State::GRPC_JSON_STATE_VALUE_NUMBER_WITH_DECIMAL:
- case State::GRPC_JSON_STATE_VALUE_NUMBER_ZERO:
- case State::GRPC_JSON_STATE_VALUE_NUMBER_EPM:
- if (!SetNumber()) return Status::GRPC_JSON_PARSE_ERROR;
- state_ = State::GRPC_JSON_STATE_VALUE_END;
+ case State::GRPC_JSON_STATE_VALUE_NUMBER:
+ case State::GRPC_JSON_STATE_VALUE_NUMBER_WITH_DECIMAL:
+ case State::GRPC_JSON_STATE_VALUE_NUMBER_ZERO:
+ case State::GRPC_JSON_STATE_VALUE_NUMBER_EPM:
+ if (!SetNumber()) return Status::GRPC_JSON_PARSE_ERROR;
+ state_ = State::GRPC_JSON_STATE_VALUE_END;
break;
default:
- return Status::GRPC_JSON_PARSE_ERROR;
+ return Status::GRPC_JSON_PARSE_ERROR;
}
break;
@@ -323,171 +323,171 @@ JsonReader::Status JsonReader::Run() {
case ',':
case '}':
case ']':
- switch (state_) {
- case State::GRPC_JSON_STATE_OBJECT_KEY_STRING:
- case State::GRPC_JSON_STATE_VALUE_STRING:
- if (unicode_high_surrogate_ != 0) {
- return Status::GRPC_JSON_PARSE_ERROR;
+ switch (state_) {
+ case State::GRPC_JSON_STATE_OBJECT_KEY_STRING:
+ case State::GRPC_JSON_STATE_VALUE_STRING:
+ if (unicode_high_surrogate_ != 0) {
+ return Status::GRPC_JSON_PARSE_ERROR;
}
- StringAddChar(c);
- break;
-
- case State::GRPC_JSON_STATE_VALUE_NUMBER:
- case State::GRPC_JSON_STATE_VALUE_NUMBER_WITH_DECIMAL:
- case State::GRPC_JSON_STATE_VALUE_NUMBER_ZERO:
- case State::GRPC_JSON_STATE_VALUE_NUMBER_EPM:
- if (stack_.empty()) {
- return Status::GRPC_JSON_PARSE_ERROR;
- } else if (c == '}' &&
- stack_.back()->type() != Json::Type::OBJECT) {
- return Status::GRPC_JSON_PARSE_ERROR;
- return Status::GRPC_JSON_PARSE_ERROR;
- } else if (c == ']' && stack_.back()->type() != Json::Type::ARRAY) {
- return Status::GRPC_JSON_PARSE_ERROR;
+ StringAddChar(c);
+ break;
+
+ case State::GRPC_JSON_STATE_VALUE_NUMBER:
+ case State::GRPC_JSON_STATE_VALUE_NUMBER_WITH_DECIMAL:
+ case State::GRPC_JSON_STATE_VALUE_NUMBER_ZERO:
+ case State::GRPC_JSON_STATE_VALUE_NUMBER_EPM:
+ if (stack_.empty()) {
+ return Status::GRPC_JSON_PARSE_ERROR;
+ } else if (c == '}' &&
+ stack_.back()->type() != Json::Type::OBJECT) {
+ return Status::GRPC_JSON_PARSE_ERROR;
+ return Status::GRPC_JSON_PARSE_ERROR;
+ } else if (c == ']' && stack_.back()->type() != Json::Type::ARRAY) {
+ return Status::GRPC_JSON_PARSE_ERROR;
}
- if (!SetNumber()) return Status::GRPC_JSON_PARSE_ERROR;
- state_ = State::GRPC_JSON_STATE_VALUE_END;
+ if (!SetNumber()) return Status::GRPC_JSON_PARSE_ERROR;
+ state_ = State::GRPC_JSON_STATE_VALUE_END;
/* The missing break here is intentional. */
/* fallthrough */
- case State::GRPC_JSON_STATE_VALUE_END:
- case State::GRPC_JSON_STATE_OBJECT_KEY_BEGIN:
- case State::GRPC_JSON_STATE_VALUE_BEGIN:
+ case State::GRPC_JSON_STATE_VALUE_END:
+ case State::GRPC_JSON_STATE_OBJECT_KEY_BEGIN:
+ case State::GRPC_JSON_STATE_VALUE_BEGIN:
if (c == ',') {
- if (state_ != State::GRPC_JSON_STATE_VALUE_END) {
- return Status::GRPC_JSON_PARSE_ERROR;
+ if (state_ != State::GRPC_JSON_STATE_VALUE_END) {
+ return Status::GRPC_JSON_PARSE_ERROR;
}
- if (!stack_.empty() &&
- stack_.back()->type() == Json::Type::OBJECT) {
- state_ = State::GRPC_JSON_STATE_OBJECT_KEY_BEGIN;
- } else if (!stack_.empty() &&
- stack_.back()->type() == Json::Type::ARRAY) {
- state_ = State::GRPC_JSON_STATE_VALUE_BEGIN;
+ if (!stack_.empty() &&
+ stack_.back()->type() == Json::Type::OBJECT) {
+ state_ = State::GRPC_JSON_STATE_OBJECT_KEY_BEGIN;
+ } else if (!stack_.empty() &&
+ stack_.back()->type() == Json::Type::ARRAY) {
+ state_ = State::GRPC_JSON_STATE_VALUE_BEGIN;
} else {
- return Status::GRPC_JSON_PARSE_ERROR;
+ return Status::GRPC_JSON_PARSE_ERROR;
}
} else {
- if (stack_.empty()) {
- return Status::GRPC_JSON_PARSE_ERROR;
+ if (stack_.empty()) {
+ return Status::GRPC_JSON_PARSE_ERROR;
+ }
+ if (c == '}' && stack_.back()->type() != Json::Type::OBJECT) {
+ return Status::GRPC_JSON_PARSE_ERROR;
}
- if (c == '}' && stack_.back()->type() != Json::Type::OBJECT) {
- return Status::GRPC_JSON_PARSE_ERROR;
+ if (c == '}' &&
+ state_ == State::GRPC_JSON_STATE_OBJECT_KEY_BEGIN &&
+ !container_just_begun_) {
+ return Status::GRPC_JSON_PARSE_ERROR;
}
- if (c == '}' &&
- state_ == State::GRPC_JSON_STATE_OBJECT_KEY_BEGIN &&
- !container_just_begun_) {
- return Status::GRPC_JSON_PARSE_ERROR;
+ if (c == ']' && stack_.back()->type() != Json::Type::ARRAY) {
+ return Status::GRPC_JSON_PARSE_ERROR;
}
- if (c == ']' && stack_.back()->type() != Json::Type::ARRAY) {
- return Status::GRPC_JSON_PARSE_ERROR;
+ if (c == ']' && state_ == State::GRPC_JSON_STATE_VALUE_BEGIN &&
+ !container_just_begun_) {
+ return Status::GRPC_JSON_PARSE_ERROR;
+ }
+ state_ = State::GRPC_JSON_STATE_VALUE_END;
+ EndContainer();
+ if (stack_.empty()) {
+ state_ = State::GRPC_JSON_STATE_END;
}
- if (c == ']' && state_ == State::GRPC_JSON_STATE_VALUE_BEGIN &&
- !container_just_begun_) {
- return Status::GRPC_JSON_PARSE_ERROR;
- }
- state_ = State::GRPC_JSON_STATE_VALUE_END;
- EndContainer();
- if (stack_.empty()) {
- state_ = State::GRPC_JSON_STATE_END;
- }
}
break;
default:
- return Status::GRPC_JSON_PARSE_ERROR;
+ return Status::GRPC_JSON_PARSE_ERROR;
}
break;
/* In-string escaping. */
case '\\':
- switch (state_) {
- case State::GRPC_JSON_STATE_OBJECT_KEY_STRING:
- escaped_string_was_key_ = true;
- state_ = State::GRPC_JSON_STATE_STRING_ESCAPE;
+ switch (state_) {
+ case State::GRPC_JSON_STATE_OBJECT_KEY_STRING:
+ escaped_string_was_key_ = true;
+ state_ = State::GRPC_JSON_STATE_STRING_ESCAPE;
break;
- case State::GRPC_JSON_STATE_VALUE_STRING:
- escaped_string_was_key_ = false;
- state_ = State::GRPC_JSON_STATE_STRING_ESCAPE;
+ case State::GRPC_JSON_STATE_VALUE_STRING:
+ escaped_string_was_key_ = false;
+ state_ = State::GRPC_JSON_STATE_STRING_ESCAPE;
break;
/* This is the \\ case. */
- case State::GRPC_JSON_STATE_STRING_ESCAPE:
- if (unicode_high_surrogate_ != 0)
- return Status::GRPC_JSON_PARSE_ERROR;
- StringAddChar('\\');
- if (escaped_string_was_key_) {
- state_ = State::GRPC_JSON_STATE_OBJECT_KEY_STRING;
+ case State::GRPC_JSON_STATE_STRING_ESCAPE:
+ if (unicode_high_surrogate_ != 0)
+ return Status::GRPC_JSON_PARSE_ERROR;
+ StringAddChar('\\');
+ if (escaped_string_was_key_) {
+ state_ = State::GRPC_JSON_STATE_OBJECT_KEY_STRING;
} else {
- state_ = State::GRPC_JSON_STATE_VALUE_STRING;
+ state_ = State::GRPC_JSON_STATE_VALUE_STRING;
}
break;
default:
- return Status::GRPC_JSON_PARSE_ERROR;
+ return Status::GRPC_JSON_PARSE_ERROR;
}
break;
default:
- container_just_begun_ = false;
- switch (state_) {
- case State::GRPC_JSON_STATE_OBJECT_KEY_BEGIN:
- if (c != '"') return Status::GRPC_JSON_PARSE_ERROR;
- state_ = State::GRPC_JSON_STATE_OBJECT_KEY_STRING;
+ container_just_begun_ = false;
+ switch (state_) {
+ case State::GRPC_JSON_STATE_OBJECT_KEY_BEGIN:
+ if (c != '"') return Status::GRPC_JSON_PARSE_ERROR;
+ state_ = State::GRPC_JSON_STATE_OBJECT_KEY_STRING;
break;
- case State::GRPC_JSON_STATE_OBJECT_KEY_STRING:
- if (unicode_high_surrogate_ != 0) {
- return Status::GRPC_JSON_PARSE_ERROR;
+ case State::GRPC_JSON_STATE_OBJECT_KEY_STRING:
+ if (unicode_high_surrogate_ != 0) {
+ return Status::GRPC_JSON_PARSE_ERROR;
}
if (c == '"') {
- state_ = State::GRPC_JSON_STATE_OBJECT_KEY_END;
- SetKey();
+ state_ = State::GRPC_JSON_STATE_OBJECT_KEY_END;
+ SetKey();
} else {
- if (c < 32) return Status::GRPC_JSON_PARSE_ERROR;
- StringAddChar(c);
+ if (c < 32) return Status::GRPC_JSON_PARSE_ERROR;
+ StringAddChar(c);
}
break;
- case State::GRPC_JSON_STATE_VALUE_STRING:
- if (unicode_high_surrogate_ != 0) {
- return Status::GRPC_JSON_PARSE_ERROR;
+ case State::GRPC_JSON_STATE_VALUE_STRING:
+ if (unicode_high_surrogate_ != 0) {
+ return Status::GRPC_JSON_PARSE_ERROR;
}
if (c == '"') {
- state_ = State::GRPC_JSON_STATE_VALUE_END;
- SetString();
+ state_ = State::GRPC_JSON_STATE_VALUE_END;
+ SetString();
} else {
- if (c < 32) return Status::GRPC_JSON_PARSE_ERROR;
- StringAddChar(c);
+ if (c < 32) return Status::GRPC_JSON_PARSE_ERROR;
+ StringAddChar(c);
}
break;
- case State::GRPC_JSON_STATE_OBJECT_KEY_END:
- if (c != ':') return Status::GRPC_JSON_PARSE_ERROR;
- state_ = State::GRPC_JSON_STATE_VALUE_BEGIN;
+ case State::GRPC_JSON_STATE_OBJECT_KEY_END:
+ if (c != ':') return Status::GRPC_JSON_PARSE_ERROR;
+ state_ = State::GRPC_JSON_STATE_VALUE_BEGIN;
break;
- case State::GRPC_JSON_STATE_VALUE_BEGIN:
+ case State::GRPC_JSON_STATE_VALUE_BEGIN:
switch (c) {
case 't':
- state_ = State::GRPC_JSON_STATE_VALUE_TRUE_R;
+ state_ = State::GRPC_JSON_STATE_VALUE_TRUE_R;
break;
case 'f':
- state_ = State::GRPC_JSON_STATE_VALUE_FALSE_A;
+ state_ = State::GRPC_JSON_STATE_VALUE_FALSE_A;
break;
case 'n':
- state_ = State::GRPC_JSON_STATE_VALUE_NULL_U;
+ state_ = State::GRPC_JSON_STATE_VALUE_NULL_U;
break;
case '"':
- state_ = State::GRPC_JSON_STATE_VALUE_STRING;
+ state_ = State::GRPC_JSON_STATE_VALUE_STRING;
break;
case '0':
- StringAddChar(c);
- state_ = State::GRPC_JSON_STATE_VALUE_NUMBER_ZERO;
+ StringAddChar(c);
+ state_ = State::GRPC_JSON_STATE_VALUE_NUMBER_ZERO;
break;
case '1':
@@ -500,71 +500,71 @@ JsonReader::Status JsonReader::Run() {
case '8':
case '9':
case '-':
- StringAddChar(c);
- state_ = State::GRPC_JSON_STATE_VALUE_NUMBER;
+ StringAddChar(c);
+ state_ = State::GRPC_JSON_STATE_VALUE_NUMBER;
break;
case '{':
- container_just_begun_ = true;
- if (!StartContainer(Json::Type::OBJECT)) {
- return Status::GRPC_JSON_PARSE_ERROR;
- }
- state_ = State::GRPC_JSON_STATE_OBJECT_KEY_BEGIN;
+ container_just_begun_ = true;
+ if (!StartContainer(Json::Type::OBJECT)) {
+ return Status::GRPC_JSON_PARSE_ERROR;
+ }
+ state_ = State::GRPC_JSON_STATE_OBJECT_KEY_BEGIN;
break;
case '[':
- container_just_begun_ = true;
- if (!StartContainer(Json::Type::ARRAY)) {
- return Status::GRPC_JSON_PARSE_ERROR;
- }
+ container_just_begun_ = true;
+ if (!StartContainer(Json::Type::ARRAY)) {
+ return Status::GRPC_JSON_PARSE_ERROR;
+ }
break;
default:
- return Status::GRPC_JSON_PARSE_ERROR;
+ return Status::GRPC_JSON_PARSE_ERROR;
}
break;
- case State::GRPC_JSON_STATE_STRING_ESCAPE:
- if (escaped_string_was_key_) {
- state_ = State::GRPC_JSON_STATE_OBJECT_KEY_STRING;
+ case State::GRPC_JSON_STATE_STRING_ESCAPE:
+ if (escaped_string_was_key_) {
+ state_ = State::GRPC_JSON_STATE_OBJECT_KEY_STRING;
} else {
- state_ = State::GRPC_JSON_STATE_VALUE_STRING;
+ state_ = State::GRPC_JSON_STATE_VALUE_STRING;
}
- if (unicode_high_surrogate_ && c != 'u') {
- return Status::GRPC_JSON_PARSE_ERROR;
+ if (unicode_high_surrogate_ && c != 'u') {
+ return Status::GRPC_JSON_PARSE_ERROR;
}
switch (c) {
case '"':
case '/':
- StringAddChar(c);
+ StringAddChar(c);
break;
case 'b':
- StringAddChar('\b');
+ StringAddChar('\b');
break;
case 'f':
- StringAddChar('\f');
+ StringAddChar('\f');
break;
case 'n':
- StringAddChar('\n');
+ StringAddChar('\n');
break;
case 'r':
- StringAddChar('\r');
+ StringAddChar('\r');
break;
case 't':
- StringAddChar('\t');
+ StringAddChar('\t');
break;
case 'u':
- state_ = State::GRPC_JSON_STATE_STRING_ESCAPE_U1;
- unicode_char_ = 0;
+ state_ = State::GRPC_JSON_STATE_STRING_ESCAPE_U1;
+ unicode_char_ = 0;
break;
default:
- return Status::GRPC_JSON_PARSE_ERROR;
+ return Status::GRPC_JSON_PARSE_ERROR;
}
break;
- case State::GRPC_JSON_STATE_STRING_ESCAPE_U1:
- case State::GRPC_JSON_STATE_STRING_ESCAPE_U2:
- case State::GRPC_JSON_STATE_STRING_ESCAPE_U3:
- case State::GRPC_JSON_STATE_STRING_ESCAPE_U4:
+ case State::GRPC_JSON_STATE_STRING_ESCAPE_U1:
+ case State::GRPC_JSON_STATE_STRING_ESCAPE_U2:
+ case State::GRPC_JSON_STATE_STRING_ESCAPE_U3:
+ case State::GRPC_JSON_STATE_STRING_ESCAPE_U4:
if ((c >= '0') && (c <= '9')) {
c -= '0';
} else if ((c >= 'A') && (c <= 'F')) {
@@ -572,60 +572,60 @@ JsonReader::Status JsonReader::Run() {
} else if ((c >= 'a') && (c <= 'f')) {
c -= 'a' - 10;
} else {
- return Status::GRPC_JSON_PARSE_ERROR;
+ return Status::GRPC_JSON_PARSE_ERROR;
}
- unicode_char_ = static_cast<uint16_t>(unicode_char_ << 4);
- unicode_char_ = static_cast<uint16_t>(unicode_char_ | c);
+ unicode_char_ = static_cast<uint16_t>(unicode_char_ << 4);
+ unicode_char_ = static_cast<uint16_t>(unicode_char_ | c);
- switch (state_) {
- case State::GRPC_JSON_STATE_STRING_ESCAPE_U1:
- state_ = State::GRPC_JSON_STATE_STRING_ESCAPE_U2;
+ switch (state_) {
+ case State::GRPC_JSON_STATE_STRING_ESCAPE_U1:
+ state_ = State::GRPC_JSON_STATE_STRING_ESCAPE_U2;
break;
- case State::GRPC_JSON_STATE_STRING_ESCAPE_U2:
- state_ = State::GRPC_JSON_STATE_STRING_ESCAPE_U3;
+ case State::GRPC_JSON_STATE_STRING_ESCAPE_U2:
+ state_ = State::GRPC_JSON_STATE_STRING_ESCAPE_U3;
break;
- case State::GRPC_JSON_STATE_STRING_ESCAPE_U3:
- state_ = State::GRPC_JSON_STATE_STRING_ESCAPE_U4;
+ case State::GRPC_JSON_STATE_STRING_ESCAPE_U3:
+ state_ = State::GRPC_JSON_STATE_STRING_ESCAPE_U4;
break;
- case State::GRPC_JSON_STATE_STRING_ESCAPE_U4:
+ case State::GRPC_JSON_STATE_STRING_ESCAPE_U4:
/* See grpc_json_writer_escape_string to have a description
* of what's going on here.
*/
- if ((unicode_char_ & 0xfc00) == 0xd800) {
+ if ((unicode_char_ & 0xfc00) == 0xd800) {
/* high surrogate utf-16 */
- if (unicode_high_surrogate_ != 0)
- return Status::GRPC_JSON_PARSE_ERROR;
- unicode_high_surrogate_ = unicode_char_;
- } else if ((unicode_char_ & 0xfc00) == 0xdc00) {
+ if (unicode_high_surrogate_ != 0)
+ return Status::GRPC_JSON_PARSE_ERROR;
+ unicode_high_surrogate_ = unicode_char_;
+ } else if ((unicode_char_ & 0xfc00) == 0xdc00) {
/* low surrogate utf-16 */
uint32_t utf32;
- if (unicode_high_surrogate_ == 0)
- return Status::GRPC_JSON_PARSE_ERROR;
+ if (unicode_high_surrogate_ == 0)
+ return Status::GRPC_JSON_PARSE_ERROR;
utf32 = 0x10000;
utf32 += static_cast<uint32_t>(
- (unicode_high_surrogate_ - 0xd800) * 0x400);
- utf32 += static_cast<uint32_t>(unicode_char_ - 0xdc00);
- StringAddUtf32(utf32);
- unicode_high_surrogate_ = 0;
+ (unicode_high_surrogate_ - 0xd800) * 0x400);
+ utf32 += static_cast<uint32_t>(unicode_char_ - 0xdc00);
+ StringAddUtf32(utf32);
+ unicode_high_surrogate_ = 0;
} else {
/* anything else */
- if (unicode_high_surrogate_ != 0)
- return Status::GRPC_JSON_PARSE_ERROR;
- StringAddUtf32(unicode_char_);
+ if (unicode_high_surrogate_ != 0)
+ return Status::GRPC_JSON_PARSE_ERROR;
+ StringAddUtf32(unicode_char_);
}
- if (escaped_string_was_key_) {
- state_ = State::GRPC_JSON_STATE_OBJECT_KEY_STRING;
+ if (escaped_string_was_key_) {
+ state_ = State::GRPC_JSON_STATE_OBJECT_KEY_STRING;
} else {
- state_ = State::GRPC_JSON_STATE_VALUE_STRING;
+ state_ = State::GRPC_JSON_STATE_VALUE_STRING;
}
break;
default:
- GPR_UNREACHABLE_CODE(return Status::GRPC_JSON_INTERNAL_ERROR);
+ GPR_UNREACHABLE_CODE(return Status::GRPC_JSON_INTERNAL_ERROR);
}
break;
- case State::GRPC_JSON_STATE_VALUE_NUMBER:
- StringAddChar(c);
+ case State::GRPC_JSON_STATE_VALUE_NUMBER:
+ StringAddChar(c);
switch (c) {
case '0':
case '1':
@@ -640,18 +640,18 @@ JsonReader::Status JsonReader::Run() {
break;
case 'e':
case 'E':
- state_ = State::GRPC_JSON_STATE_VALUE_NUMBER_E;
+ state_ = State::GRPC_JSON_STATE_VALUE_NUMBER_E;
break;
case '.':
- state_ = State::GRPC_JSON_STATE_VALUE_NUMBER_DOT;
+ state_ = State::GRPC_JSON_STATE_VALUE_NUMBER_DOT;
break;
default:
- return Status::GRPC_JSON_PARSE_ERROR;
+ return Status::GRPC_JSON_PARSE_ERROR;
}
break;
- case State::GRPC_JSON_STATE_VALUE_NUMBER_WITH_DECIMAL:
- StringAddChar(c);
+ case State::GRPC_JSON_STATE_VALUE_NUMBER_WITH_DECIMAL:
+ StringAddChar(c);
switch (c) {
case '0':
case '1':
@@ -666,21 +666,21 @@ JsonReader::Status JsonReader::Run() {
break;
case 'e':
case 'E':
- state_ = State::GRPC_JSON_STATE_VALUE_NUMBER_E;
+ state_ = State::GRPC_JSON_STATE_VALUE_NUMBER_E;
break;
default:
- return Status::GRPC_JSON_PARSE_ERROR;
+ return Status::GRPC_JSON_PARSE_ERROR;
}
break;
- case State::GRPC_JSON_STATE_VALUE_NUMBER_ZERO:
- if (c != '.') return Status::GRPC_JSON_PARSE_ERROR;
- StringAddChar(c);
- state_ = State::GRPC_JSON_STATE_VALUE_NUMBER_DOT;
+ case State::GRPC_JSON_STATE_VALUE_NUMBER_ZERO:
+ if (c != '.') return Status::GRPC_JSON_PARSE_ERROR;
+ StringAddChar(c);
+ state_ = State::GRPC_JSON_STATE_VALUE_NUMBER_DOT;
break;
- case State::GRPC_JSON_STATE_VALUE_NUMBER_DOT:
- StringAddChar(c);
+ case State::GRPC_JSON_STATE_VALUE_NUMBER_DOT:
+ StringAddChar(c);
switch (c) {
case '0':
case '1':
@@ -692,15 +692,15 @@ JsonReader::Status JsonReader::Run() {
case '7':
case '8':
case '9':
- state_ = State::GRPC_JSON_STATE_VALUE_NUMBER_WITH_DECIMAL;
+ state_ = State::GRPC_JSON_STATE_VALUE_NUMBER_WITH_DECIMAL;
break;
default:
- return Status::GRPC_JSON_PARSE_ERROR;
+ return Status::GRPC_JSON_PARSE_ERROR;
}
break;
- case State::GRPC_JSON_STATE_VALUE_NUMBER_E:
- StringAddChar(c);
+ case State::GRPC_JSON_STATE_VALUE_NUMBER_E:
+ StringAddChar(c);
switch (c) {
case '0':
case '1':
@@ -714,15 +714,15 @@ JsonReader::Status JsonReader::Run() {
case '9':
case '+':
case '-':
- state_ = State::GRPC_JSON_STATE_VALUE_NUMBER_EPM;
+ state_ = State::GRPC_JSON_STATE_VALUE_NUMBER_EPM;
break;
default:
- return Status::GRPC_JSON_PARSE_ERROR;
+ return Status::GRPC_JSON_PARSE_ERROR;
}
break;
- case State::GRPC_JSON_STATE_VALUE_NUMBER_EPM:
- StringAddChar(c);
+ case State::GRPC_JSON_STATE_VALUE_NUMBER_EPM:
+ StringAddChar(c);
switch (c) {
case '0':
case '1':
@@ -736,119 +736,119 @@ JsonReader::Status JsonReader::Run() {
case '9':
break;
default:
- return Status::GRPC_JSON_PARSE_ERROR;
+ return Status::GRPC_JSON_PARSE_ERROR;
}
break;
- case State::GRPC_JSON_STATE_VALUE_TRUE_R:
- if (c != 'r') return Status::GRPC_JSON_PARSE_ERROR;
- state_ = State::GRPC_JSON_STATE_VALUE_TRUE_U;
+ case State::GRPC_JSON_STATE_VALUE_TRUE_R:
+ if (c != 'r') return Status::GRPC_JSON_PARSE_ERROR;
+ state_ = State::GRPC_JSON_STATE_VALUE_TRUE_U;
break;
- case State::GRPC_JSON_STATE_VALUE_TRUE_U:
- if (c != 'u') return Status::GRPC_JSON_PARSE_ERROR;
- state_ = State::GRPC_JSON_STATE_VALUE_TRUE_E;
+ case State::GRPC_JSON_STATE_VALUE_TRUE_U:
+ if (c != 'u') return Status::GRPC_JSON_PARSE_ERROR;
+ state_ = State::GRPC_JSON_STATE_VALUE_TRUE_E;
break;
- case State::GRPC_JSON_STATE_VALUE_TRUE_E:
- if (c != 'e') return Status::GRPC_JSON_PARSE_ERROR;
- SetTrue();
- state_ = State::GRPC_JSON_STATE_VALUE_END;
+ case State::GRPC_JSON_STATE_VALUE_TRUE_E:
+ if (c != 'e') return Status::GRPC_JSON_PARSE_ERROR;
+ SetTrue();
+ state_ = State::GRPC_JSON_STATE_VALUE_END;
break;
- case State::GRPC_JSON_STATE_VALUE_FALSE_A:
- if (c != 'a') return Status::GRPC_JSON_PARSE_ERROR;
- state_ = State::GRPC_JSON_STATE_VALUE_FALSE_L;
+ case State::GRPC_JSON_STATE_VALUE_FALSE_A:
+ if (c != 'a') return Status::GRPC_JSON_PARSE_ERROR;
+ state_ = State::GRPC_JSON_STATE_VALUE_FALSE_L;
break;
- case State::GRPC_JSON_STATE_VALUE_FALSE_L:
- if (c != 'l') return Status::GRPC_JSON_PARSE_ERROR;
- state_ = State::GRPC_JSON_STATE_VALUE_FALSE_S;
+ case State::GRPC_JSON_STATE_VALUE_FALSE_L:
+ if (c != 'l') return Status::GRPC_JSON_PARSE_ERROR;
+ state_ = State::GRPC_JSON_STATE_VALUE_FALSE_S;
break;
- case State::GRPC_JSON_STATE_VALUE_FALSE_S:
- if (c != 's') return Status::GRPC_JSON_PARSE_ERROR;
- state_ = State::GRPC_JSON_STATE_VALUE_FALSE_E;
+ case State::GRPC_JSON_STATE_VALUE_FALSE_S:
+ if (c != 's') return Status::GRPC_JSON_PARSE_ERROR;
+ state_ = State::GRPC_JSON_STATE_VALUE_FALSE_E;
break;
- case State::GRPC_JSON_STATE_VALUE_FALSE_E:
- if (c != 'e') return Status::GRPC_JSON_PARSE_ERROR;
- SetFalse();
- state_ = State::GRPC_JSON_STATE_VALUE_END;
+ case State::GRPC_JSON_STATE_VALUE_FALSE_E:
+ if (c != 'e') return Status::GRPC_JSON_PARSE_ERROR;
+ SetFalse();
+ state_ = State::GRPC_JSON_STATE_VALUE_END;
break;
- case State::GRPC_JSON_STATE_VALUE_NULL_U:
- if (c != 'u') return Status::GRPC_JSON_PARSE_ERROR;
- state_ = State::GRPC_JSON_STATE_VALUE_NULL_L1;
+ case State::GRPC_JSON_STATE_VALUE_NULL_U:
+ if (c != 'u') return Status::GRPC_JSON_PARSE_ERROR;
+ state_ = State::GRPC_JSON_STATE_VALUE_NULL_L1;
break;
- case State::GRPC_JSON_STATE_VALUE_NULL_L1:
- if (c != 'l') return Status::GRPC_JSON_PARSE_ERROR;
- state_ = State::GRPC_JSON_STATE_VALUE_NULL_L2;
+ case State::GRPC_JSON_STATE_VALUE_NULL_L1:
+ if (c != 'l') return Status::GRPC_JSON_PARSE_ERROR;
+ state_ = State::GRPC_JSON_STATE_VALUE_NULL_L2;
break;
- case State::GRPC_JSON_STATE_VALUE_NULL_L2:
- if (c != 'l') return Status::GRPC_JSON_PARSE_ERROR;
- SetNull();
- state_ = State::GRPC_JSON_STATE_VALUE_END;
+ case State::GRPC_JSON_STATE_VALUE_NULL_L2:
+ if (c != 'l') return Status::GRPC_JSON_PARSE_ERROR;
+ SetNull();
+ state_ = State::GRPC_JSON_STATE_VALUE_END;
break;
/* All of the VALUE_END cases are handled in the specialized case
* above. */
- case State::GRPC_JSON_STATE_VALUE_END:
+ case State::GRPC_JSON_STATE_VALUE_END:
switch (c) {
case ',':
case '}':
case ']':
- GPR_UNREACHABLE_CODE(return Status::GRPC_JSON_INTERNAL_ERROR);
+ GPR_UNREACHABLE_CODE(return Status::GRPC_JSON_INTERNAL_ERROR);
break;
default:
- return Status::GRPC_JSON_PARSE_ERROR;
+ return Status::GRPC_JSON_PARSE_ERROR;
}
break;
- case State::GRPC_JSON_STATE_END:
- return Status::GRPC_JSON_PARSE_ERROR;
+ case State::GRPC_JSON_STATE_END:
+ return Status::GRPC_JSON_PARSE_ERROR;
}
}
}
- GPR_UNREACHABLE_CODE(return Status::GRPC_JSON_INTERNAL_ERROR);
+ GPR_UNREACHABLE_CODE(return Status::GRPC_JSON_INTERNAL_ERROR);
+}
+
+grpc_error* JsonReader::Parse(y_absl::string_view input, Json* output) {
+ JsonReader reader(input);
+ Status status = reader.Run();
+ if (reader.truncated_errors_) {
+ reader.errors_.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "too many errors encountered during JSON parsing -- fix reported "
+ "errors and try again to see additional errors"));
+ }
+ if (status == Status::GRPC_JSON_INTERNAL_ERROR) {
+ reader.errors_.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrCat("internal error in JSON parser at index ",
+ reader.CurrentIndex())
+ .c_str()));
+ } else if (status == Status::GRPC_JSON_PARSE_ERROR) {
+ reader.errors_.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrCat("JSON parse error at index ", reader.CurrentIndex())
+ .c_str()));
+ }
+ if (!reader.errors_.empty()) {
+ return GRPC_ERROR_CREATE_FROM_VECTOR("JSON parsing failed",
+ &reader.errors_);
+ }
+ *output = std::move(reader.root_value_);
+ return GRPC_ERROR_NONE;
+}
+
+} // namespace
+
+Json Json::Parse(y_absl::string_view json_str, grpc_error** error) {
+ Json value;
+ *error = JsonReader::Parse(json_str, &value);
+ return value;
}
-
-grpc_error* JsonReader::Parse(y_absl::string_view input, Json* output) {
- JsonReader reader(input);
- Status status = reader.Run();
- if (reader.truncated_errors_) {
- reader.errors_.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "too many errors encountered during JSON parsing -- fix reported "
- "errors and try again to see additional errors"));
- }
- if (status == Status::GRPC_JSON_INTERNAL_ERROR) {
- reader.errors_.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("internal error in JSON parser at index ",
- reader.CurrentIndex())
- .c_str()));
- } else if (status == Status::GRPC_JSON_PARSE_ERROR) {
- reader.errors_.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("JSON parse error at index ", reader.CurrentIndex())
- .c_str()));
- }
- if (!reader.errors_.empty()) {
- return GRPC_ERROR_CREATE_FROM_VECTOR("JSON parsing failed",
- &reader.errors_);
- }
- *output = std::move(reader.root_value_);
- return GRPC_ERROR_NONE;
-}
-
-} // namespace
-
-Json Json::Parse(y_absl::string_view json_str, grpc_error** error) {
- Json value;
- *error = JsonReader::Parse(json_str, &value);
- return value;
-}
-
-} // namespace grpc_core
+
+} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/lib/json/json_util.cc b/contrib/libs/grpc/src/core/lib/json/json_util.cc
index 44e0f4bd4eb..1c90aeb5b47 100644
--- a/contrib/libs/grpc/src/core/lib/json/json_util.cc
+++ b/contrib/libs/grpc/src/core/lib/json/json_util.cc
@@ -1,58 +1,58 @@
-//
-//
-// Copyright 2020 gRPC authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//
-
-#include <grpc/support/port_platform.h>
-
-#include "src/core/lib/json/json_util.h"
-
-#include <grpc/support/string_util.h>
-
-#include "src/core/lib/gpr/string.h"
-
-namespace grpc_core {
-
-bool ParseDurationFromJson(const Json& field, grpc_millis* duration) {
- if (field.type() != Json::Type::STRING) return false;
- size_t len = field.string_value().size();
- if (field.string_value()[len - 1] != 's') return false;
- grpc_core::UniquePtr<char> buf(gpr_strdup(field.string_value().c_str()));
- *(buf.get() + len - 1) = '\0'; // Remove trailing 's'.
- char* decimal_point = strchr(buf.get(), '.');
- int nanos = 0;
- if (decimal_point != nullptr) {
- *decimal_point = '\0';
- nanos = gpr_parse_nonnegative_int(decimal_point + 1);
- if (nanos == -1) {
- return false;
- }
- int num_digits = static_cast<int>(strlen(decimal_point + 1));
- if (num_digits > 9) { // We don't accept greater precision than nanos.
- return false;
- }
- for (int i = 0; i < (9 - num_digits); ++i) {
- nanos *= 10;
- }
- }
- int seconds =
- decimal_point == buf.get() ? 0 : gpr_parse_nonnegative_int(buf.get());
- if (seconds == -1) return false;
- *duration = seconds * GPR_MS_PER_SEC + nanos / GPR_NS_PER_MS;
- return true;
-}
-
-} // namespace grpc_core
+//
+//
+// Copyright 2020 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+//
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/lib/json/json_util.h"
+
+#include <grpc/support/string_util.h>
+
+#include "src/core/lib/gpr/string.h"
+
+namespace grpc_core {
+
+bool ParseDurationFromJson(const Json& field, grpc_millis* duration) {
+ if (field.type() != Json::Type::STRING) return false;
+ size_t len = field.string_value().size();
+ if (field.string_value()[len - 1] != 's') return false;
+ grpc_core::UniquePtr<char> buf(gpr_strdup(field.string_value().c_str()));
+ *(buf.get() + len - 1) = '\0'; // Remove trailing 's'.
+ char* decimal_point = strchr(buf.get(), '.');
+ int nanos = 0;
+ if (decimal_point != nullptr) {
+ *decimal_point = '\0';
+ nanos = gpr_parse_nonnegative_int(decimal_point + 1);
+ if (nanos == -1) {
+ return false;
+ }
+ int num_digits = static_cast<int>(strlen(decimal_point + 1));
+ if (num_digits > 9) { // We don't accept greater precision than nanos.
+ return false;
+ }
+ for (int i = 0; i < (9 - num_digits); ++i) {
+ nanos *= 10;
+ }
+ }
+ int seconds =
+ decimal_point == buf.get() ? 0 : gpr_parse_nonnegative_int(buf.get());
+ if (seconds == -1) return false;
+ *duration = seconds * GPR_MS_PER_SEC + nanos / GPR_NS_PER_MS;
+ return true;
+}
+
+} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/lib/json/json_util.h b/contrib/libs/grpc/src/core/lib/json/json_util.h
index cec3eb8ff57..071087f7658 100644
--- a/contrib/libs/grpc/src/core/lib/json/json_util.h
+++ b/contrib/libs/grpc/src/core/lib/json/json_util.h
@@ -1,37 +1,37 @@
-//
-//
-// Copyright 2020 gRPC authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//
-
-#ifndef GRPC_CORE_LIB_JSON_JSON_UTIL_H
-#define GRPC_CORE_LIB_JSON_JSON_UTIL_H
-
-#include <grpc/support/port_platform.h>
-
-#include "src/core/lib/iomgr/exec_ctx.h"
-#include "src/core/lib/json/json.h"
-
-namespace grpc_core {
-
-// Parses a JSON field of the form generated for a google.proto.Duration
-// proto message, as per:
-// https://developers.google.com/protocol-buffers/docs/proto3#json
-// Returns true on success, false otherwise.
-bool ParseDurationFromJson(const Json& field, grpc_millis* duration);
-
-} // namespace grpc_core
-
-#endif // GRPC_CORE_LIB_JSON_JSON_UTIL_H
+//
+//
+// Copyright 2020 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+//
+
+#ifndef GRPC_CORE_LIB_JSON_JSON_UTIL_H
+#define GRPC_CORE_LIB_JSON_JSON_UTIL_H
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/lib/iomgr/exec_ctx.h"
+#include "src/core/lib/json/json.h"
+
+namespace grpc_core {
+
+// Parses a JSON field of the form generated for a google.proto.Duration
+// proto message, as per:
+// https://developers.google.com/protocol-buffers/docs/proto3#json
+// Returns true on success, false otherwise.
+bool ParseDurationFromJson(const Json& field, grpc_millis* duration);
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_JSON_JSON_UTIL_H
diff --git a/contrib/libs/grpc/src/core/lib/json/json_writer.cc b/contrib/libs/grpc/src/core/lib/json/json_writer.cc
index a6e02a5f941..f2043d55a05 100644
--- a/contrib/libs/grpc/src/core/lib/json/json_writer.cc
+++ b/contrib/libs/grpc/src/core/lib/json/json_writer.cc
@@ -18,155 +18,155 @@
#include <grpc/support/port_platform.h>
-#include <stdlib.h>
+#include <stdlib.h>
#include <string.h>
-#include "y_absl/strings/string_view.h"
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
+#include "y_absl/strings/string_view.h"
-#include "src/core/lib/json/json.h"
-
-namespace grpc_core {
-
-namespace {
-
-/* The idea of the writer is basically symmetrical of the reader. While the
- * reader emits various calls to your code, the writer takes basically the
- * same calls and emit json out of it. It doesn't try to make any check on
- * the order of the calls you do on it. Meaning you can theorically force
- * it to generate invalid json.
- *
- * Also, unlike the reader, the writer expects UTF-8 encoded input strings.
- * These strings will be UTF-8 validated, and any invalid character will
- * cut the conversion short, before any invalid UTF-8 sequence, thus forming
- * a valid UTF-8 string overall.
- */
-class JsonWriter {
- public:
- static TString Dump(const Json& value, int indent);
-
- private:
- explicit JsonWriter(int indent) : indent_(indent) {}
-
- void OutputCheck(size_t needed);
- void OutputChar(char c);
- void OutputString(const y_absl::string_view str);
- void OutputIndent();
- void ValueEnd();
- void EscapeUtf16(uint16_t utf16);
- void EscapeString(const TString& string);
- void ContainerBegins(Json::Type type);
- void ContainerEnds(Json::Type type);
- void ObjectKey(const TString& string);
- void ValueRaw(const TString& string);
- void ValueString(const TString& string);
-
- void DumpObject(const Json::Object& object);
- void DumpArray(const Json::Array& array);
- void DumpValue(const Json& value);
-
- int indent_;
- int depth_ = 0;
- bool container_empty_ = true;
- bool got_key_ = false;
- TString output_;
-};
-
-/* This function checks if there's enough space left in the output buffer,
- * and will enlarge it if necessary. We're only allocating chunks of 256
- * bytes at a time (or multiples thereof).
- */
-void JsonWriter::OutputCheck(size_t needed) {
- size_t free_space = output_.capacity() - output_.size();
- if (free_space >= needed) return;
- needed -= free_space;
- /* Round up by 256 bytes. */
- needed = (needed + 0xff) & ~0xffU;
- output_.reserve(output_.capacity() + needed);
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+
+#include "src/core/lib/json/json.h"
+
+namespace grpc_core {
+
+namespace {
+
+/* The idea of the writer is basically symmetrical of the reader. While the
+ * reader emits various calls to your code, the writer takes basically the
+ * same calls and emit json out of it. It doesn't try to make any check on
+ * the order of the calls you do on it. Meaning you can theorically force
+ * it to generate invalid json.
+ *
+ * Also, unlike the reader, the writer expects UTF-8 encoded input strings.
+ * These strings will be UTF-8 validated, and any invalid character will
+ * cut the conversion short, before any invalid UTF-8 sequence, thus forming
+ * a valid UTF-8 string overall.
+ */
+class JsonWriter {
+ public:
+ static TString Dump(const Json& value, int indent);
+
+ private:
+ explicit JsonWriter(int indent) : indent_(indent) {}
+
+ void OutputCheck(size_t needed);
+ void OutputChar(char c);
+ void OutputString(const y_absl::string_view str);
+ void OutputIndent();
+ void ValueEnd();
+ void EscapeUtf16(uint16_t utf16);
+ void EscapeString(const TString& string);
+ void ContainerBegins(Json::Type type);
+ void ContainerEnds(Json::Type type);
+ void ObjectKey(const TString& string);
+ void ValueRaw(const TString& string);
+ void ValueString(const TString& string);
+
+ void DumpObject(const Json::Object& object);
+ void DumpArray(const Json::Array& array);
+ void DumpValue(const Json& value);
+
+ int indent_;
+ int depth_ = 0;
+ bool container_empty_ = true;
+ bool got_key_ = false;
+ TString output_;
+};
+
+/* This function checks if there's enough space left in the output buffer,
+ * and will enlarge it if necessary. We're only allocating chunks of 256
+ * bytes at a time (or multiples thereof).
+ */
+void JsonWriter::OutputCheck(size_t needed) {
+ size_t free_space = output_.capacity() - output_.size();
+ if (free_space >= needed) return;
+ needed -= free_space;
+ /* Round up by 256 bytes. */
+ needed = (needed + 0xff) & ~0xffU;
+ output_.reserve(output_.capacity() + needed);
}
-void JsonWriter::OutputChar(char c) {
- OutputCheck(1);
- output_.push_back(c);
+void JsonWriter::OutputChar(char c) {
+ OutputCheck(1);
+ output_.push_back(c);
}
-void JsonWriter::OutputString(const y_absl::string_view str) {
- OutputCheck(str.size());
- output_.append(str.data(), str.size());
+void JsonWriter::OutputString(const y_absl::string_view str) {
+ OutputCheck(str.size());
+ output_.append(str.data(), str.size());
}
-void JsonWriter::OutputIndent() {
+void JsonWriter::OutputIndent() {
static const char spacesstr[] =
" "
" "
" "
" ";
- unsigned spaces = static_cast<unsigned>(depth_ * indent_);
- if (indent_ == 0) return;
- if (got_key_) {
- OutputChar(' ');
+ unsigned spaces = static_cast<unsigned>(depth_ * indent_);
+ if (indent_ == 0) return;
+ if (got_key_) {
+ OutputChar(' ');
return;
}
while (spaces >= (sizeof(spacesstr) - 1)) {
- OutputString(y_absl::string_view(spacesstr, sizeof(spacesstr) - 1));
+ OutputString(y_absl::string_view(spacesstr, sizeof(spacesstr) - 1));
spaces -= static_cast<unsigned>(sizeof(spacesstr) - 1);
}
if (spaces == 0) return;
- OutputString(
- y_absl::string_view(spacesstr + sizeof(spacesstr) - 1 - spaces, spaces));
+ OutputString(
+ y_absl::string_view(spacesstr + sizeof(spacesstr) - 1 - spaces, spaces));
}
-void JsonWriter::ValueEnd() {
- if (container_empty_) {
- container_empty_ = false;
- if (indent_ == 0 || depth_ == 0) return;
- OutputChar('\n');
+void JsonWriter::ValueEnd() {
+ if (container_empty_) {
+ container_empty_ = false;
+ if (indent_ == 0 || depth_ == 0) return;
+ OutputChar('\n');
} else {
- OutputChar(',');
- if (indent_ == 0) return;
- OutputChar('\n');
+ OutputChar(',');
+ if (indent_ == 0) return;
+ OutputChar('\n');
}
}
-void JsonWriter::EscapeUtf16(uint16_t utf16) {
+void JsonWriter::EscapeUtf16(uint16_t utf16) {
static const char hex[] = "0123456789abcdef";
- OutputString(y_absl::string_view("\\u", 2));
- OutputChar(hex[(utf16 >> 12) & 0x0f]);
- OutputChar(hex[(utf16 >> 8) & 0x0f]);
- OutputChar(hex[(utf16 >> 4) & 0x0f]);
- OutputChar(hex[(utf16)&0x0f]);
+ OutputString(y_absl::string_view("\\u", 2));
+ OutputChar(hex[(utf16 >> 12) & 0x0f]);
+ OutputChar(hex[(utf16 >> 8) & 0x0f]);
+ OutputChar(hex[(utf16 >> 4) & 0x0f]);
+ OutputChar(hex[(utf16)&0x0f]);
}
-void JsonWriter::EscapeString(const TString& string) {
- OutputChar('"');
- for (size_t idx = 0; idx < string.size(); ++idx) {
- uint8_t c = static_cast<uint8_t>(string[idx]);
+void JsonWriter::EscapeString(const TString& string) {
+ OutputChar('"');
+ for (size_t idx = 0; idx < string.size(); ++idx) {
+ uint8_t c = static_cast<uint8_t>(string[idx]);
if (c == 0) {
break;
- } else if (c >= 32 && c <= 126) {
- if (c == '\\' || c == '"') OutputChar('\\');
- OutputChar(static_cast<char>(c));
- } else if (c < 32 || c == 127) {
+ } else if (c >= 32 && c <= 126) {
+ if (c == '\\' || c == '"') OutputChar('\\');
+ OutputChar(static_cast<char>(c));
+ } else if (c < 32 || c == 127) {
switch (c) {
case '\b':
- OutputString(y_absl::string_view("\\b", 2));
+ OutputString(y_absl::string_view("\\b", 2));
break;
case '\f':
- OutputString(y_absl::string_view("\\f", 2));
+ OutputString(y_absl::string_view("\\f", 2));
break;
case '\n':
- OutputString(y_absl::string_view("\\n", 2));
+ OutputString(y_absl::string_view("\\n", 2));
break;
case '\r':
- OutputString(y_absl::string_view("\\r", 2));
+ OutputString(y_absl::string_view("\\r", 2));
break;
case '\t':
- OutputString(y_absl::string_view("\\t", 2));
+ OutputString(y_absl::string_view("\\t", 2));
break;
default:
- EscapeUtf16(c);
+ EscapeUtf16(c);
break;
}
} else {
@@ -188,13 +188,13 @@ void JsonWriter::EscapeString(const TString& string) {
}
for (i = 0; i < extra; i++) {
utf32 <<= 6;
- ++idx;
- /* Breaks out and bail if we hit the end of the string. */
- if (idx == string.size()) {
- valid = 0;
- break;
- }
- c = static_cast<uint8_t>(string[idx]);
+ ++idx;
+ /* Breaks out and bail if we hit the end of the string. */
+ if (idx == string.size()) {
+ valid = 0;
+ break;
+ }
+ c = static_cast<uint8_t>(string[idx]);
/* Breaks out and bail on any invalid UTF-8 sequence, including \0. */
if ((c & 0xc0) != 0x80) {
valid = 0;
@@ -227,111 +227,111 @@ void JsonWriter::EscapeString(const TString& string) {
* That range is exactly 20 bits.
*/
utf32 -= 0x10000;
- EscapeUtf16(static_cast<uint16_t>(0xd800 | (utf32 >> 10)));
- EscapeUtf16(static_cast<uint16_t>(0xdc00 | (utf32 & 0x3ff)));
+ EscapeUtf16(static_cast<uint16_t>(0xd800 | (utf32 >> 10)));
+ EscapeUtf16(static_cast<uint16_t>(0xdc00 | (utf32 & 0x3ff)));
} else {
- EscapeUtf16(static_cast<uint16_t>(utf32));
+ EscapeUtf16(static_cast<uint16_t>(utf32));
}
}
}
- OutputChar('"');
-}
+ OutputChar('"');
+}
+
+void JsonWriter::ContainerBegins(Json::Type type) {
+ if (!got_key_) ValueEnd();
+ OutputIndent();
+ OutputChar(type == Json::Type::OBJECT ? '{' : '[');
+ container_empty_ = true;
+ got_key_ = false;
+ depth_++;
+}
-void JsonWriter::ContainerBegins(Json::Type type) {
- if (!got_key_) ValueEnd();
- OutputIndent();
- OutputChar(type == Json::Type::OBJECT ? '{' : '[');
- container_empty_ = true;
- got_key_ = false;
- depth_++;
+void JsonWriter::ContainerEnds(Json::Type type) {
+ if (indent_ && !container_empty_) OutputChar('\n');
+ depth_--;
+ if (!container_empty_) OutputIndent();
+ OutputChar(type == Json::Type::OBJECT ? '}' : ']');
+ container_empty_ = false;
+ got_key_ = false;
}
-void JsonWriter::ContainerEnds(Json::Type type) {
- if (indent_ && !container_empty_) OutputChar('\n');
- depth_--;
- if (!container_empty_) OutputIndent();
- OutputChar(type == Json::Type::OBJECT ? '}' : ']');
- container_empty_ = false;
- got_key_ = false;
+void JsonWriter::ObjectKey(const TString& string) {
+ ValueEnd();
+ OutputIndent();
+ EscapeString(string);
+ OutputChar(':');
+ got_key_ = true;
}
-void JsonWriter::ObjectKey(const TString& string) {
- ValueEnd();
- OutputIndent();
- EscapeString(string);
- OutputChar(':');
- got_key_ = true;
+void JsonWriter::ValueRaw(const TString& string) {
+ if (!got_key_) ValueEnd();
+ OutputIndent();
+ OutputString(string);
+ got_key_ = false;
}
-void JsonWriter::ValueRaw(const TString& string) {
- if (!got_key_) ValueEnd();
- OutputIndent();
- OutputString(string);
- got_key_ = false;
+void JsonWriter::ValueString(const TString& string) {
+ if (!got_key_) ValueEnd();
+ OutputIndent();
+ EscapeString(string);
+ got_key_ = false;
}
-void JsonWriter::ValueString(const TString& string) {
- if (!got_key_) ValueEnd();
- OutputIndent();
- EscapeString(string);
- got_key_ = false;
+void JsonWriter::DumpObject(const Json::Object& object) {
+ ContainerBegins(Json::Type::OBJECT);
+ for (const auto& p : object) {
+ ObjectKey(p.first.data());
+ DumpValue(p.second);
+ }
+ ContainerEnds(Json::Type::OBJECT);
}
-void JsonWriter::DumpObject(const Json::Object& object) {
- ContainerBegins(Json::Type::OBJECT);
- for (const auto& p : object) {
- ObjectKey(p.first.data());
- DumpValue(p.second);
- }
- ContainerEnds(Json::Type::OBJECT);
+void JsonWriter::DumpArray(const Json::Array& array) {
+ ContainerBegins(Json::Type::ARRAY);
+ for (const auto& v : array) {
+ DumpValue(v);
+ }
+ ContainerEnds(Json::Type::ARRAY);
}
-void JsonWriter::DumpArray(const Json::Array& array) {
- ContainerBegins(Json::Type::ARRAY);
- for (const auto& v : array) {
- DumpValue(v);
- }
- ContainerEnds(Json::Type::ARRAY);
+void JsonWriter::DumpValue(const Json& value) {
+ switch (value.type()) {
+ case Json::Type::OBJECT:
+ DumpObject(value.object_value());
+ break;
+ case Json::Type::ARRAY:
+ DumpArray(value.array_value());
+ break;
+ case Json::Type::STRING:
+ ValueString(value.string_value());
+ break;
+ case Json::Type::NUMBER:
+ ValueRaw(value.string_value());
+ break;
+ case Json::Type::JSON_TRUE:
+ ValueRaw(TString("true", 4));
+ break;
+ case Json::Type::JSON_FALSE:
+ ValueRaw(TString("false", 5));
+ break;
+ case Json::Type::JSON_NULL:
+ ValueRaw(TString("null", 4));
+ break;
+ default:
+ GPR_UNREACHABLE_CODE(abort());
+ }
+}
+
+TString JsonWriter::Dump(const Json& value, int indent) {
+ JsonWriter writer(indent);
+ writer.DumpValue(value);
+ return std::move(writer.output_);
}
-
-void JsonWriter::DumpValue(const Json& value) {
- switch (value.type()) {
- case Json::Type::OBJECT:
- DumpObject(value.object_value());
- break;
- case Json::Type::ARRAY:
- DumpArray(value.array_value());
- break;
- case Json::Type::STRING:
- ValueString(value.string_value());
- break;
- case Json::Type::NUMBER:
- ValueRaw(value.string_value());
- break;
- case Json::Type::JSON_TRUE:
- ValueRaw(TString("true", 4));
- break;
- case Json::Type::JSON_FALSE:
- ValueRaw(TString("false", 5));
- break;
- case Json::Type::JSON_NULL:
- ValueRaw(TString("null", 4));
- break;
- default:
- GPR_UNREACHABLE_CODE(abort());
- }
-}
-
-TString JsonWriter::Dump(const Json& value, int indent) {
- JsonWriter writer(indent);
- writer.DumpValue(value);
- return std::move(writer.output_);
-}
-
-} // namespace
-
-TString Json::Dump(int indent) const {
- return JsonWriter::Dump(*this, indent);
-}
-
-} // namespace grpc_core
+
+} // namespace
+
+TString Json::Dump(int indent) const {
+ return JsonWriter::Dump(*this, indent);
+}
+
+} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/lib/security/authorization/authorization_engine.cc b/contrib/libs/grpc/src/core/lib/security/authorization/authorization_engine.cc
index 776f0c89128..4a9386633b8 100644
--- a/contrib/libs/grpc/src/core/lib/security/authorization/authorization_engine.cc
+++ b/contrib/libs/grpc/src/core/lib/security/authorization/authorization_engine.cc
@@ -1,177 +1,177 @@
-// Copyright 2020 gRPC authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include <grpc/support/port_platform.h>
-
-#include "y_absl/memory/memory.h"
-
-#include "src/core/lib/security/authorization/authorization_engine.h"
-
-namespace grpc_core {
-
-namespace {
-
-// Symbols for traversing Envoy Attributes
-constexpr char kUrlPath[] = "url_path";
-constexpr char kHost[] = "host";
-constexpr char kMethod[] = "method";
-constexpr char kHeaders[] = "headers";
-constexpr char kSourceAddress[] = "source_address";
-constexpr char kSourcePort[] = "source_port";
-constexpr char kDestinationAddress[] = "destination_address";
-constexpr char kDestinationPort[] = "destination_port";
-constexpr char kSpiffeId[] = "spiffe_id";
-constexpr char kCertServerName[] = "cert_server_name";
-
-} // namespace
-
-std::unique_ptr<AuthorizationEngine>
-AuthorizationEngine::CreateAuthorizationEngine(
- const std::vector<envoy_config_rbac_v3_RBAC*>& rbac_policies) {
- if (rbac_policies.empty() || rbac_policies.size() > 2) {
- gpr_log(GPR_ERROR,
- "Invalid rbac policies vector. Must contain either one or two rbac "
- "policies.");
- return nullptr;
- } else if (rbac_policies.size() == 2 &&
- (envoy_config_rbac_v3_RBAC_action(rbac_policies[0]) != kDeny ||
- envoy_config_rbac_v3_RBAC_action(rbac_policies[1]) != kAllow)) {
- gpr_log(GPR_ERROR,
- "Invalid rbac policies vector. Must contain one deny \
- policy and one allow policy, in that order.");
- return nullptr;
- } else {
- return y_absl::make_unique<AuthorizationEngine>(rbac_policies);
- }
-}
-
-AuthorizationEngine::AuthorizationEngine(
- const std::vector<envoy_config_rbac_v3_RBAC*>& rbac_policies) {
- for (const auto& rbac_policy : rbac_policies) {
- // Extract array of policies and store their condition fields in either
- // allow_if_matched_ or deny_if_matched_, depending on the policy action.
- upb::Arena temp_arena;
- size_t policy_num = UPB_MAP_BEGIN;
- const envoy_config_rbac_v3_RBAC_PoliciesEntry* policy_entry;
- while ((policy_entry = envoy_config_rbac_v3_RBAC_policies_next(
- rbac_policy, &policy_num)) != nullptr) {
- const upb_strview policy_name_strview =
- envoy_config_rbac_v3_RBAC_PoliciesEntry_key(policy_entry);
- const TString policy_name(policy_name_strview.data,
- policy_name_strview.size);
- const envoy_config_rbac_v3_Policy* policy =
- envoy_config_rbac_v3_RBAC_PoliciesEntry_value(policy_entry);
- const google_api_expr_v1alpha1_Expr* condition =
- envoy_config_rbac_v3_Policy_condition(policy);
- // Parse condition to make a pointer tied to the lifetime of arena_.
- size_t serial_len;
- const char* serialized = google_api_expr_v1alpha1_Expr_serialize(
- condition, temp_arena.ptr(), &serial_len);
- const google_api_expr_v1alpha1_Expr* parsed_condition =
- google_api_expr_v1alpha1_Expr_parse(serialized, serial_len,
- arena_.ptr());
- if (envoy_config_rbac_v3_RBAC_action(rbac_policy) == kAllow) {
- allow_if_matched_.insert(std::make_pair(policy_name, parsed_condition));
- } else {
- deny_if_matched_.insert(std::make_pair(policy_name, parsed_condition));
- }
- }
- }
-}
-
-std::unique_ptr<mock_cel::Activation> AuthorizationEngine::CreateActivation(
- const EvaluateArgs& args) {
- std::unique_ptr<mock_cel::Activation> activation;
- for (const auto& elem : envoy_attributes_) {
- if (elem == kUrlPath) {
- y_absl::string_view url_path(args.GetPath());
- if (!url_path.empty()) {
- activation->InsertValue(kUrlPath,
- mock_cel::CelValue::CreateStringView(url_path));
- }
- } else if (elem == kHost) {
- y_absl::string_view host(args.GetHost());
- if (!host.empty()) {
- activation->InsertValue(kHost,
- mock_cel::CelValue::CreateStringView(host));
- }
- } else if (elem == kMethod) {
- y_absl::string_view method(args.GetMethod());
- if (!method.empty()) {
- activation->InsertValue(kMethod,
- mock_cel::CelValue::CreateStringView(method));
- }
- } else if (elem == kHeaders) {
- std::multimap<y_absl::string_view, y_absl::string_view> headers =
- args.GetHeaders();
- std::vector<std::pair<mock_cel::CelValue, mock_cel::CelValue>>
- header_items;
- for (const auto& header_key : header_keys_) {
- auto header_item = headers.find(header_key);
- if (header_item != headers.end()) {
- header_items.push_back(
- std::pair<mock_cel::CelValue, mock_cel::CelValue>(
- mock_cel::CelValue::CreateStringView(header_key),
- mock_cel::CelValue::CreateStringView(header_item->second)));
- }
- }
- headers_ = mock_cel::ContainerBackedMapImpl::Create(
- y_absl::Span<std::pair<mock_cel::CelValue, mock_cel::CelValue>>(
- header_items));
- activation->InsertValue(kHeaders,
- mock_cel::CelValue::CreateMap(headers_.get()));
- } else if (elem == kSourceAddress) {
- y_absl::string_view source_address(args.GetPeerAddress());
- if (!source_address.empty()) {
- activation->InsertValue(
- kSourceAddress,
- mock_cel::CelValue::CreateStringView(source_address));
- }
- } else if (elem == kSourcePort) {
- activation->InsertValue(
- kSourcePort, mock_cel::CelValue::CreateInt64(args.GetPeerPort()));
- } else if (elem == kDestinationAddress) {
- y_absl::string_view destination_address(args.GetLocalAddress());
- if (!destination_address.empty()) {
- activation->InsertValue(
- kDestinationAddress,
- mock_cel::CelValue::CreateStringView(destination_address));
- }
- } else if (elem == kDestinationPort) {
- activation->InsertValue(kDestinationPort, mock_cel::CelValue::CreateInt64(
- args.GetLocalPort()));
- } else if (elem == kSpiffeId) {
- y_absl::string_view spiffe_id(args.GetSpiffeId());
- if (!spiffe_id.empty()) {
- activation->InsertValue(
- kSpiffeId, mock_cel::CelValue::CreateStringView(spiffe_id));
- }
- } else if (elem == kCertServerName) {
- y_absl::string_view cert_server_name(args.GetCertServerName());
- if (!cert_server_name.empty()) {
- activation->InsertValue(
- kCertServerName,
- mock_cel::CelValue::CreateStringView(cert_server_name));
- }
- } else {
- gpr_log(GPR_ERROR,
- "Error: Authorization engine does not support evaluating "
- "attribute %s.",
- elem.c_str());
- }
- }
- return activation;
-}
-
-} // namespace grpc_core
+// Copyright 2020 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include <grpc/support/port_platform.h>
+
+#include "y_absl/memory/memory.h"
+
+#include "src/core/lib/security/authorization/authorization_engine.h"
+
+namespace grpc_core {
+
+namespace {
+
+// Symbols for traversing Envoy Attributes
+constexpr char kUrlPath[] = "url_path";
+constexpr char kHost[] = "host";
+constexpr char kMethod[] = "method";
+constexpr char kHeaders[] = "headers";
+constexpr char kSourceAddress[] = "source_address";
+constexpr char kSourcePort[] = "source_port";
+constexpr char kDestinationAddress[] = "destination_address";
+constexpr char kDestinationPort[] = "destination_port";
+constexpr char kSpiffeId[] = "spiffe_id";
+constexpr char kCertServerName[] = "cert_server_name";
+
+} // namespace
+
+std::unique_ptr<AuthorizationEngine>
+AuthorizationEngine::CreateAuthorizationEngine(
+ const std::vector<envoy_config_rbac_v3_RBAC*>& rbac_policies) {
+ if (rbac_policies.empty() || rbac_policies.size() > 2) {
+ gpr_log(GPR_ERROR,
+ "Invalid rbac policies vector. Must contain either one or two rbac "
+ "policies.");
+ return nullptr;
+ } else if (rbac_policies.size() == 2 &&
+ (envoy_config_rbac_v3_RBAC_action(rbac_policies[0]) != kDeny ||
+ envoy_config_rbac_v3_RBAC_action(rbac_policies[1]) != kAllow)) {
+ gpr_log(GPR_ERROR,
+ "Invalid rbac policies vector. Must contain one deny \
+ policy and one allow policy, in that order.");
+ return nullptr;
+ } else {
+ return y_absl::make_unique<AuthorizationEngine>(rbac_policies);
+ }
+}
+
+AuthorizationEngine::AuthorizationEngine(
+ const std::vector<envoy_config_rbac_v3_RBAC*>& rbac_policies) {
+ for (const auto& rbac_policy : rbac_policies) {
+ // Extract array of policies and store their condition fields in either
+ // allow_if_matched_ or deny_if_matched_, depending on the policy action.
+ upb::Arena temp_arena;
+ size_t policy_num = UPB_MAP_BEGIN;
+ const envoy_config_rbac_v3_RBAC_PoliciesEntry* policy_entry;
+ while ((policy_entry = envoy_config_rbac_v3_RBAC_policies_next(
+ rbac_policy, &policy_num)) != nullptr) {
+ const upb_strview policy_name_strview =
+ envoy_config_rbac_v3_RBAC_PoliciesEntry_key(policy_entry);
+ const TString policy_name(policy_name_strview.data,
+ policy_name_strview.size);
+ const envoy_config_rbac_v3_Policy* policy =
+ envoy_config_rbac_v3_RBAC_PoliciesEntry_value(policy_entry);
+ const google_api_expr_v1alpha1_Expr* condition =
+ envoy_config_rbac_v3_Policy_condition(policy);
+ // Parse condition to make a pointer tied to the lifetime of arena_.
+ size_t serial_len;
+ const char* serialized = google_api_expr_v1alpha1_Expr_serialize(
+ condition, temp_arena.ptr(), &serial_len);
+ const google_api_expr_v1alpha1_Expr* parsed_condition =
+ google_api_expr_v1alpha1_Expr_parse(serialized, serial_len,
+ arena_.ptr());
+ if (envoy_config_rbac_v3_RBAC_action(rbac_policy) == kAllow) {
+ allow_if_matched_.insert(std::make_pair(policy_name, parsed_condition));
+ } else {
+ deny_if_matched_.insert(std::make_pair(policy_name, parsed_condition));
+ }
+ }
+ }
+}
+
+std::unique_ptr<mock_cel::Activation> AuthorizationEngine::CreateActivation(
+ const EvaluateArgs& args) {
+ std::unique_ptr<mock_cel::Activation> activation;
+ for (const auto& elem : envoy_attributes_) {
+ if (elem == kUrlPath) {
+ y_absl::string_view url_path(args.GetPath());
+ if (!url_path.empty()) {
+ activation->InsertValue(kUrlPath,
+ mock_cel::CelValue::CreateStringView(url_path));
+ }
+ } else if (elem == kHost) {
+ y_absl::string_view host(args.GetHost());
+ if (!host.empty()) {
+ activation->InsertValue(kHost,
+ mock_cel::CelValue::CreateStringView(host));
+ }
+ } else if (elem == kMethod) {
+ y_absl::string_view method(args.GetMethod());
+ if (!method.empty()) {
+ activation->InsertValue(kMethod,
+ mock_cel::CelValue::CreateStringView(method));
+ }
+ } else if (elem == kHeaders) {
+ std::multimap<y_absl::string_view, y_absl::string_view> headers =
+ args.GetHeaders();
+ std::vector<std::pair<mock_cel::CelValue, mock_cel::CelValue>>
+ header_items;
+ for (const auto& header_key : header_keys_) {
+ auto header_item = headers.find(header_key);
+ if (header_item != headers.end()) {
+ header_items.push_back(
+ std::pair<mock_cel::CelValue, mock_cel::CelValue>(
+ mock_cel::CelValue::CreateStringView(header_key),
+ mock_cel::CelValue::CreateStringView(header_item->second)));
+ }
+ }
+ headers_ = mock_cel::ContainerBackedMapImpl::Create(
+ y_absl::Span<std::pair<mock_cel::CelValue, mock_cel::CelValue>>(
+ header_items));
+ activation->InsertValue(kHeaders,
+ mock_cel::CelValue::CreateMap(headers_.get()));
+ } else if (elem == kSourceAddress) {
+ y_absl::string_view source_address(args.GetPeerAddress());
+ if (!source_address.empty()) {
+ activation->InsertValue(
+ kSourceAddress,
+ mock_cel::CelValue::CreateStringView(source_address));
+ }
+ } else if (elem == kSourcePort) {
+ activation->InsertValue(
+ kSourcePort, mock_cel::CelValue::CreateInt64(args.GetPeerPort()));
+ } else if (elem == kDestinationAddress) {
+ y_absl::string_view destination_address(args.GetLocalAddress());
+ if (!destination_address.empty()) {
+ activation->InsertValue(
+ kDestinationAddress,
+ mock_cel::CelValue::CreateStringView(destination_address));
+ }
+ } else if (elem == kDestinationPort) {
+ activation->InsertValue(kDestinationPort, mock_cel::CelValue::CreateInt64(
+ args.GetLocalPort()));
+ } else if (elem == kSpiffeId) {
+ y_absl::string_view spiffe_id(args.GetSpiffeId());
+ if (!spiffe_id.empty()) {
+ activation->InsertValue(
+ kSpiffeId, mock_cel::CelValue::CreateStringView(spiffe_id));
+ }
+ } else if (elem == kCertServerName) {
+ y_absl::string_view cert_server_name(args.GetCertServerName());
+ if (!cert_server_name.empty()) {
+ activation->InsertValue(
+ kCertServerName,
+ mock_cel::CelValue::CreateStringView(cert_server_name));
+ }
+ } else {
+ gpr_log(GPR_ERROR,
+ "Error: Authorization engine does not support evaluating "
+ "attribute %s.",
+ elem.c_str());
+ }
+ }
+ return activation;
+}
+
+} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/lib/security/authorization/authorization_engine.h b/contrib/libs/grpc/src/core/lib/security/authorization/authorization_engine.h
index 38e3fb42e23..24cded28a36 100644
--- a/contrib/libs/grpc/src/core/lib/security/authorization/authorization_engine.h
+++ b/contrib/libs/grpc/src/core/lib/security/authorization/authorization_engine.h
@@ -1,84 +1,84 @@
-
-// Copyright 2020 gRPC authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#ifndef GRPC_CORE_LIB_SECURITY_AUTHORIZATION_AUTHORIZATION_ENGINE_H
-#define GRPC_CORE_LIB_SECURITY_AUTHORIZATION_AUTHORIZATION_ENGINE_H
-
-#include <grpc/support/port_platform.h>
-
-#include <grpc/support/log.h>
-#include <map>
-#include <memory>
-#include <util/generic/string.h>
-#include <vector>
-
-#include "y_absl/container/flat_hash_set.h"
-#include "envoy/config/rbac/v3/rbac.upb.h"
-#include "google/api/expr/v1alpha1/syntax.upb.h"
-#include "upb/upb.hpp"
-
-#include "src/core/lib/security/authorization/evaluate_args.h"
-#include "src/core/lib/security/authorization/mock_cel/activation.h"
-
-namespace grpc_core {
-
-// AuthorizationEngine makes an AuthorizationDecision to ALLOW or DENY the
-// current action based on the condition fields in provided RBAC policies.
-// The engine may be constructed with one or two policies. If two polcies,
-// the first policy is deny-if-matched and the second is allow-if-matched.
-// The engine returns UNDECIDED decision if it fails to find a match in any
-// policy. This engine ignores the principal and permission fields in RBAC
-// policies. It is the caller's responsibility to provide RBAC policies that
-// are compatible with this engine.
-//
-// Example:
-// AuthorizationEngine*
-// auth_engine = AuthorizationEngine::CreateAuthorizationEngine(rbac_policies);
-// auth_engine->Evaluate(evaluate_args); // returns authorization decision.
-class AuthorizationEngine {
- public:
- // rbac_policies must be a vector containing either a single policy of any
- // kind, or one deny policy and one allow policy, in that order.
- static std::unique_ptr<AuthorizationEngine> CreateAuthorizationEngine(
- const std::vector<envoy_config_rbac_v3_RBAC*>& rbac_policies);
-
- // Users should use the CreateAuthorizationEngine factory function
- // instead of calling the AuthorizationEngine constructor directly.
- explicit AuthorizationEngine(
- const std::vector<envoy_config_rbac_v3_RBAC*>& rbac_policies);
- // TODO([email protected]): add an Evaluate member function.
-
- private:
- enum Action {
- kAllow,
- kDeny,
- };
-
- std::unique_ptr<mock_cel::Activation> CreateActivation(
- const EvaluateArgs& args);
-
- std::map<const TString, const google_api_expr_v1alpha1_Expr*>
- deny_if_matched_;
- std::map<const TString, const google_api_expr_v1alpha1_Expr*>
- allow_if_matched_;
- upb::Arena arena_;
- y_absl::flat_hash_set<TString> envoy_attributes_;
- y_absl::flat_hash_set<TString> header_keys_;
- std::unique_ptr<mock_cel::CelMap> headers_;
-};
-
-} // namespace grpc_core
-
-#endif /* GRPC_CORE_LIB_SECURITY_AUTHORIZATION_AUTHORIZATION_ENGINE_H */
+
+// Copyright 2020 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_CORE_LIB_SECURITY_AUTHORIZATION_AUTHORIZATION_ENGINE_H
+#define GRPC_CORE_LIB_SECURITY_AUTHORIZATION_AUTHORIZATION_ENGINE_H
+
+#include <grpc/support/port_platform.h>
+
+#include <grpc/support/log.h>
+#include <map>
+#include <memory>
+#include <util/generic/string.h>
+#include <vector>
+
+#include "y_absl/container/flat_hash_set.h"
+#include "envoy/config/rbac/v3/rbac.upb.h"
+#include "google/api/expr/v1alpha1/syntax.upb.h"
+#include "upb/upb.hpp"
+
+#include "src/core/lib/security/authorization/evaluate_args.h"
+#include "src/core/lib/security/authorization/mock_cel/activation.h"
+
+namespace grpc_core {
+
+// AuthorizationEngine makes an AuthorizationDecision to ALLOW or DENY the
+// current action based on the condition fields in provided RBAC policies.
+// The engine may be constructed with one or two policies. If two polcies,
+// the first policy is deny-if-matched and the second is allow-if-matched.
+// The engine returns UNDECIDED decision if it fails to find a match in any
+// policy. This engine ignores the principal and permission fields in RBAC
+// policies. It is the caller's responsibility to provide RBAC policies that
+// are compatible with this engine.
+//
+// Example:
+// AuthorizationEngine*
+// auth_engine = AuthorizationEngine::CreateAuthorizationEngine(rbac_policies);
+// auth_engine->Evaluate(evaluate_args); // returns authorization decision.
+class AuthorizationEngine {
+ public:
+ // rbac_policies must be a vector containing either a single policy of any
+ // kind, or one deny policy and one allow policy, in that order.
+ static std::unique_ptr<AuthorizationEngine> CreateAuthorizationEngine(
+ const std::vector<envoy_config_rbac_v3_RBAC*>& rbac_policies);
+
+ // Users should use the CreateAuthorizationEngine factory function
+ // instead of calling the AuthorizationEngine constructor directly.
+ explicit AuthorizationEngine(
+ const std::vector<envoy_config_rbac_v3_RBAC*>& rbac_policies);
+ // TODO([email protected]): add an Evaluate member function.
+
+ private:
+ enum Action {
+ kAllow,
+ kDeny,
+ };
+
+ std::unique_ptr<mock_cel::Activation> CreateActivation(
+ const EvaluateArgs& args);
+
+ std::map<const TString, const google_api_expr_v1alpha1_Expr*>
+ deny_if_matched_;
+ std::map<const TString, const google_api_expr_v1alpha1_Expr*>
+ allow_if_matched_;
+ upb::Arena arena_;
+ y_absl::flat_hash_set<TString> envoy_attributes_;
+ y_absl::flat_hash_set<TString> header_keys_;
+ std::unique_ptr<mock_cel::CelMap> headers_;
+};
+
+} // namespace grpc_core
+
+#endif /* GRPC_CORE_LIB_SECURITY_AUTHORIZATION_AUTHORIZATION_ENGINE_H */
diff --git a/contrib/libs/grpc/src/core/lib/security/authorization/evaluate_args.cc b/contrib/libs/grpc/src/core/lib/security/authorization/evaluate_args.cc
index 8f3e1ea6b3d..48af382f122 100644
--- a/contrib/libs/grpc/src/core/lib/security/authorization/evaluate_args.cc
+++ b/contrib/libs/grpc/src/core/lib/security/authorization/evaluate_args.cc
@@ -1,153 +1,153 @@
-//
-//
-// Copyright 2020 gRPC authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//
-
-#include <grpc/support/port_platform.h>
-
-#include "src/core/lib/security/authorization/evaluate_args.h"
-
-#include "src/core/lib/iomgr/parse_address.h"
-#include "src/core/lib/iomgr/resolve_address.h"
-#include "src/core/lib/iomgr/sockaddr_utils.h"
-#include "src/core/lib/slice/slice_utils.h"
-
-namespace grpc_core {
-
-y_absl::string_view EvaluateArgs::GetPath() const {
- y_absl::string_view path;
- if (metadata_ != nullptr && metadata_->idx.named.path != nullptr) {
- grpc_linked_mdelem* elem = metadata_->idx.named.path;
- const grpc_slice& val = GRPC_MDVALUE(elem->md);
- path = StringViewFromSlice(val);
- }
- return path;
-}
-
-y_absl::string_view EvaluateArgs::GetHost() const {
- y_absl::string_view host;
- if (metadata_ != nullptr && metadata_->idx.named.host != nullptr) {
- grpc_linked_mdelem* elem = metadata_->idx.named.host;
- const grpc_slice& val = GRPC_MDVALUE(elem->md);
- host = StringViewFromSlice(val);
- }
- return host;
-}
-
-y_absl::string_view EvaluateArgs::GetMethod() const {
- y_absl::string_view method;
- if (metadata_ != nullptr && metadata_->idx.named.method != nullptr) {
- grpc_linked_mdelem* elem = metadata_->idx.named.method;
- const grpc_slice& val = GRPC_MDVALUE(elem->md);
- method = StringViewFromSlice(val);
- }
- return method;
-}
-
-std::multimap<y_absl::string_view, y_absl::string_view> EvaluateArgs::GetHeaders()
- const {
- std::multimap<y_absl::string_view, y_absl::string_view> headers;
- if (metadata_ == nullptr) {
- return headers;
- }
- for (grpc_linked_mdelem* elem = metadata_->list.head; elem != nullptr;
- elem = elem->next) {
- const grpc_slice& key = GRPC_MDKEY(elem->md);
- const grpc_slice& val = GRPC_MDVALUE(elem->md);
- headers.emplace(StringViewFromSlice(key), StringViewFromSlice(val));
- }
- return headers;
-}
-
-y_absl::string_view EvaluateArgs::GetLocalAddress() const {
- y_absl::string_view addr = grpc_endpoint_get_local_address(endpoint_);
- size_t first_colon = addr.find(":");
- size_t last_colon = addr.rfind(":");
- if (first_colon == TString::npos || last_colon == TString::npos) {
- return "";
- } else {
- return addr.substr(first_colon + 1, last_colon - first_colon - 1);
- }
-}
-
-int EvaluateArgs::GetLocalPort() const {
- if (endpoint_ == nullptr) {
- return 0;
- }
- grpc_uri* uri = grpc_uri_parse(
- TString(grpc_endpoint_get_local_address(endpoint_)).c_str(), true);
- grpc_resolved_address resolved_addr;
- if (uri == nullptr || !grpc_parse_uri(uri, &resolved_addr)) {
- grpc_uri_destroy(uri);
- return 0;
- }
- grpc_uri_destroy(uri);
- return grpc_sockaddr_get_port(&resolved_addr);
-}
-
-y_absl::string_view EvaluateArgs::GetPeerAddress() const {
- y_absl::string_view addr = grpc_endpoint_get_peer(endpoint_);
- size_t first_colon = addr.find(":");
- size_t last_colon = addr.rfind(":");
- if (first_colon == TString::npos || last_colon == TString::npos) {
- return "";
- } else {
- return addr.substr(first_colon + 1, last_colon - first_colon - 1);
- }
-}
-
-int EvaluateArgs::GetPeerPort() const {
- if (endpoint_ == nullptr) {
- return 0;
- }
- grpc_uri* uri = grpc_uri_parse(
- TString(grpc_endpoint_get_peer(endpoint_)).c_str(), true);
- grpc_resolved_address resolved_addr;
- if (uri == nullptr || !grpc_parse_uri(uri, &resolved_addr)) {
- grpc_uri_destroy(uri);
- return 0;
- }
- grpc_uri_destroy(uri);
- return grpc_sockaddr_get_port(&resolved_addr);
-}
-
-y_absl::string_view EvaluateArgs::GetSpiffeId() const {
- if (auth_context_ == nullptr) {
- return "";
- }
- grpc_auth_property_iterator it = grpc_auth_context_find_properties_by_name(
- auth_context_, GRPC_PEER_SPIFFE_ID_PROPERTY_NAME);
- const grpc_auth_property* prop = grpc_auth_property_iterator_next(&it);
- if (prop == nullptr || grpc_auth_property_iterator_next(&it) != nullptr) {
- return "";
- }
- return y_absl::string_view(prop->value, prop->value_length);
-}
-
-y_absl::string_view EvaluateArgs::GetCertServerName() const {
- if (auth_context_ == nullptr) {
- return "";
- }
- grpc_auth_property_iterator it = grpc_auth_context_find_properties_by_name(
- auth_context_, GRPC_X509_CN_PROPERTY_NAME);
- const grpc_auth_property* prop = grpc_auth_property_iterator_next(&it);
- if (prop == nullptr || grpc_auth_property_iterator_next(&it) != nullptr) {
- return "";
- }
- return y_absl::string_view(prop->value, prop->value_length);
-}
-
-} // namespace grpc_core
+//
+//
+// Copyright 2020 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+//
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/lib/security/authorization/evaluate_args.h"
+
+#include "src/core/lib/iomgr/parse_address.h"
+#include "src/core/lib/iomgr/resolve_address.h"
+#include "src/core/lib/iomgr/sockaddr_utils.h"
+#include "src/core/lib/slice/slice_utils.h"
+
+namespace grpc_core {
+
+y_absl::string_view EvaluateArgs::GetPath() const {
+ y_absl::string_view path;
+ if (metadata_ != nullptr && metadata_->idx.named.path != nullptr) {
+ grpc_linked_mdelem* elem = metadata_->idx.named.path;
+ const grpc_slice& val = GRPC_MDVALUE(elem->md);
+ path = StringViewFromSlice(val);
+ }
+ return path;
+}
+
+y_absl::string_view EvaluateArgs::GetHost() const {
+ y_absl::string_view host;
+ if (metadata_ != nullptr && metadata_->idx.named.host != nullptr) {
+ grpc_linked_mdelem* elem = metadata_->idx.named.host;
+ const grpc_slice& val = GRPC_MDVALUE(elem->md);
+ host = StringViewFromSlice(val);
+ }
+ return host;
+}
+
+y_absl::string_view EvaluateArgs::GetMethod() const {
+ y_absl::string_view method;
+ if (metadata_ != nullptr && metadata_->idx.named.method != nullptr) {
+ grpc_linked_mdelem* elem = metadata_->idx.named.method;
+ const grpc_slice& val = GRPC_MDVALUE(elem->md);
+ method = StringViewFromSlice(val);
+ }
+ return method;
+}
+
+std::multimap<y_absl::string_view, y_absl::string_view> EvaluateArgs::GetHeaders()
+ const {
+ std::multimap<y_absl::string_view, y_absl::string_view> headers;
+ if (metadata_ == nullptr) {
+ return headers;
+ }
+ for (grpc_linked_mdelem* elem = metadata_->list.head; elem != nullptr;
+ elem = elem->next) {
+ const grpc_slice& key = GRPC_MDKEY(elem->md);
+ const grpc_slice& val = GRPC_MDVALUE(elem->md);
+ headers.emplace(StringViewFromSlice(key), StringViewFromSlice(val));
+ }
+ return headers;
+}
+
+y_absl::string_view EvaluateArgs::GetLocalAddress() const {
+ y_absl::string_view addr = grpc_endpoint_get_local_address(endpoint_);
+ size_t first_colon = addr.find(":");
+ size_t last_colon = addr.rfind(":");
+ if (first_colon == TString::npos || last_colon == TString::npos) {
+ return "";
+ } else {
+ return addr.substr(first_colon + 1, last_colon - first_colon - 1);
+ }
+}
+
+int EvaluateArgs::GetLocalPort() const {
+ if (endpoint_ == nullptr) {
+ return 0;
+ }
+ grpc_uri* uri = grpc_uri_parse(
+ TString(grpc_endpoint_get_local_address(endpoint_)).c_str(), true);
+ grpc_resolved_address resolved_addr;
+ if (uri == nullptr || !grpc_parse_uri(uri, &resolved_addr)) {
+ grpc_uri_destroy(uri);
+ return 0;
+ }
+ grpc_uri_destroy(uri);
+ return grpc_sockaddr_get_port(&resolved_addr);
+}
+
+y_absl::string_view EvaluateArgs::GetPeerAddress() const {
+ y_absl::string_view addr = grpc_endpoint_get_peer(endpoint_);
+ size_t first_colon = addr.find(":");
+ size_t last_colon = addr.rfind(":");
+ if (first_colon == TString::npos || last_colon == TString::npos) {
+ return "";
+ } else {
+ return addr.substr(first_colon + 1, last_colon - first_colon - 1);
+ }
+}
+
+int EvaluateArgs::GetPeerPort() const {
+ if (endpoint_ == nullptr) {
+ return 0;
+ }
+ grpc_uri* uri = grpc_uri_parse(
+ TString(grpc_endpoint_get_peer(endpoint_)).c_str(), true);
+ grpc_resolved_address resolved_addr;
+ if (uri == nullptr || !grpc_parse_uri(uri, &resolved_addr)) {
+ grpc_uri_destroy(uri);
+ return 0;
+ }
+ grpc_uri_destroy(uri);
+ return grpc_sockaddr_get_port(&resolved_addr);
+}
+
+y_absl::string_view EvaluateArgs::GetSpiffeId() const {
+ if (auth_context_ == nullptr) {
+ return "";
+ }
+ grpc_auth_property_iterator it = grpc_auth_context_find_properties_by_name(
+ auth_context_, GRPC_PEER_SPIFFE_ID_PROPERTY_NAME);
+ const grpc_auth_property* prop = grpc_auth_property_iterator_next(&it);
+ if (prop == nullptr || grpc_auth_property_iterator_next(&it) != nullptr) {
+ return "";
+ }
+ return y_absl::string_view(prop->value, prop->value_length);
+}
+
+y_absl::string_view EvaluateArgs::GetCertServerName() const {
+ if (auth_context_ == nullptr) {
+ return "";
+ }
+ grpc_auth_property_iterator it = grpc_auth_context_find_properties_by_name(
+ auth_context_, GRPC_X509_CN_PROPERTY_NAME);
+ const grpc_auth_property* prop = grpc_auth_property_iterator_next(&it);
+ if (prop == nullptr || grpc_auth_property_iterator_next(&it) != nullptr) {
+ return "";
+ }
+ return y_absl::string_view(prop->value, prop->value_length);
+}
+
+} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/lib/security/authorization/evaluate_args.h b/contrib/libs/grpc/src/core/lib/security/authorization/evaluate_args.h
index 9f72af4862c..1409cdc6c3c 100644
--- a/contrib/libs/grpc/src/core/lib/security/authorization/evaluate_args.h
+++ b/contrib/libs/grpc/src/core/lib/security/authorization/evaluate_args.h
@@ -1,59 +1,59 @@
-//
-//
-// Copyright 2020 gRPC authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//
-
-#ifndef GRPC_CORE_LIB_SECURITY_AUTHORIZATION_EVALUATE_ARGS_H
-#define GRPC_CORE_LIB_SECURITY_AUTHORIZATION_EVALUATE_ARGS_H
-
-#include <grpc/support/port_platform.h>
-
-#include <map>
-
-#include "src/core/lib/iomgr/endpoint.h"
-#include "src/core/lib/security/context/security_context.h"
-#include "src/core/lib/transport/metadata_batch.h"
-
-namespace grpc_core {
-
-class EvaluateArgs {
- public:
- EvaluateArgs(grpc_metadata_batch* metadata, grpc_auth_context* auth_context,
- grpc_endpoint* endpoint)
- : metadata_(metadata), auth_context_(auth_context), endpoint_(endpoint) {}
-
- y_absl::string_view GetPath() const;
- y_absl::string_view GetHost() const;
- y_absl::string_view GetMethod() const;
- std::multimap<y_absl::string_view, y_absl::string_view> GetHeaders() const;
- y_absl::string_view GetLocalAddress() const;
- int GetLocalPort() const;
- y_absl::string_view GetPeerAddress() const;
- int GetPeerPort() const;
- y_absl::string_view GetSpiffeId() const;
- y_absl::string_view GetCertServerName() const;
-
- // TODO: Add a getter function for source.principal
-
- private:
- grpc_metadata_batch* metadata_;
- grpc_auth_context* auth_context_;
- grpc_endpoint* endpoint_;
-};
-
-} // namespace grpc_core
-
-#endif // GRPC_CORE_LIB_SECURITY_AUTHORIZATION_EVALUATE_ARGS_H
+//
+//
+// Copyright 2020 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+//
+
+#ifndef GRPC_CORE_LIB_SECURITY_AUTHORIZATION_EVALUATE_ARGS_H
+#define GRPC_CORE_LIB_SECURITY_AUTHORIZATION_EVALUATE_ARGS_H
+
+#include <grpc/support/port_platform.h>
+
+#include <map>
+
+#include "src/core/lib/iomgr/endpoint.h"
+#include "src/core/lib/security/context/security_context.h"
+#include "src/core/lib/transport/metadata_batch.h"
+
+namespace grpc_core {
+
+class EvaluateArgs {
+ public:
+ EvaluateArgs(grpc_metadata_batch* metadata, grpc_auth_context* auth_context,
+ grpc_endpoint* endpoint)
+ : metadata_(metadata), auth_context_(auth_context), endpoint_(endpoint) {}
+
+ y_absl::string_view GetPath() const;
+ y_absl::string_view GetHost() const;
+ y_absl::string_view GetMethod() const;
+ std::multimap<y_absl::string_view, y_absl::string_view> GetHeaders() const;
+ y_absl::string_view GetLocalAddress() const;
+ int GetLocalPort() const;
+ y_absl::string_view GetPeerAddress() const;
+ int GetPeerPort() const;
+ y_absl::string_view GetSpiffeId() const;
+ y_absl::string_view GetCertServerName() const;
+
+ // TODO: Add a getter function for source.principal
+
+ private:
+ grpc_metadata_batch* metadata_;
+ grpc_auth_context* auth_context_;
+ grpc_endpoint* endpoint_;
+};
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_SECURITY_AUTHORIZATION_EVALUATE_ARGS_H
diff --git a/contrib/libs/grpc/src/core/lib/security/authorization/mock_cel/activation.h b/contrib/libs/grpc/src/core/lib/security/authorization/mock_cel/activation.h
index 8beccfd0144..34520c761db 100644
--- a/contrib/libs/grpc/src/core/lib/security/authorization/mock_cel/activation.h
+++ b/contrib/libs/grpc/src/core/lib/security/authorization/mock_cel/activation.h
@@ -1,57 +1,57 @@
-// Copyright 2020 gRPC authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#ifndef GRPC_CORE_LIB_SECURITY_AUTHORIZATION_MOCK_CEL_ACTIVATION_H
-#define GRPC_CORE_LIB_SECURITY_AUTHORIZATION_MOCK_CEL_ACTIVATION_H
-
-#include <grpc/support/port_platform.h>
-
-#include "y_absl/strings/string_view.h"
-
-#include "src/core/lib/security/authorization/mock_cel/cel_value.h"
-
-namespace grpc_core {
-namespace mock_cel {
-
-// Base class for an activation. This is a temporary stub implementation of CEL
-// APIs. Once gRPC imports the CEL library, this class will be removed.
-class BaseActivation {
- public:
- BaseActivation() = default;
-
- // Non-copyable/non-assignable
- BaseActivation(const BaseActivation&) = delete;
- BaseActivation& operator=(const BaseActivation&) = delete;
-};
-
-// Instance of Activation class is used by evaluator.
-// It provides binding between references used in expressions
-// and actual values. This is a temporary stub implementation of CEL APIs.
-// Once gRPC imports the CEL library, this class will be removed.
-class Activation : public BaseActivation {
- public:
- Activation() = default;
-
- // Non-copyable/non-assignable
- Activation(const Activation&) = delete;
- Activation& operator=(const Activation&) = delete;
-
- // Insert value into Activation.
- void InsertValue(y_absl::string_view name, const CelValue& value) {}
-};
-
-} // namespace mock_cel
-} // namespace grpc_core
-
-#endif // GRPC_CORE_LIB_SECURITY_AUTHORIZATION_MOCK_CEL_ACTIVATION_H
+// Copyright 2020 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_CORE_LIB_SECURITY_AUTHORIZATION_MOCK_CEL_ACTIVATION_H
+#define GRPC_CORE_LIB_SECURITY_AUTHORIZATION_MOCK_CEL_ACTIVATION_H
+
+#include <grpc/support/port_platform.h>
+
+#include "y_absl/strings/string_view.h"
+
+#include "src/core/lib/security/authorization/mock_cel/cel_value.h"
+
+namespace grpc_core {
+namespace mock_cel {
+
+// Base class for an activation. This is a temporary stub implementation of CEL
+// APIs. Once gRPC imports the CEL library, this class will be removed.
+class BaseActivation {
+ public:
+ BaseActivation() = default;
+
+ // Non-copyable/non-assignable
+ BaseActivation(const BaseActivation&) = delete;
+ BaseActivation& operator=(const BaseActivation&) = delete;
+};
+
+// Instance of Activation class is used by evaluator.
+// It provides binding between references used in expressions
+// and actual values. This is a temporary stub implementation of CEL APIs.
+// Once gRPC imports the CEL library, this class will be removed.
+class Activation : public BaseActivation {
+ public:
+ Activation() = default;
+
+ // Non-copyable/non-assignable
+ Activation(const Activation&) = delete;
+ Activation& operator=(const Activation&) = delete;
+
+ // Insert value into Activation.
+ void InsertValue(y_absl::string_view name, const CelValue& value) {}
+};
+
+} // namespace mock_cel
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_SECURITY_AUTHORIZATION_MOCK_CEL_ACTIVATION_H
diff --git a/contrib/libs/grpc/src/core/lib/security/authorization/mock_cel/cel_expr_builder_factory.h b/contrib/libs/grpc/src/core/lib/security/authorization/mock_cel/cel_expr_builder_factory.h
index d97e2aaca79..9bacaeede7f 100644
--- a/contrib/libs/grpc/src/core/lib/security/authorization/mock_cel/cel_expr_builder_factory.h
+++ b/contrib/libs/grpc/src/core/lib/security/authorization/mock_cel/cel_expr_builder_factory.h
@@ -1,42 +1,42 @@
-// Copyright 2020 gRPC authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#ifndef GRPC_CORE_LIB_SECURITY_AUTHORIZATION_MOCK_CEL_CEL_EXPR_BUILDER_FACTORY_H
-#define GRPC_CORE_LIB_SECURITY_AUTHORIZATION_MOCK_CEL_CEL_EXPR_BUILDER_FACTORY_H
-
-#include <grpc/support/port_platform.h>
-
-#include <memory>
-
-#include "src/core/lib/security/authorization/mock_cel/flat_expr_builder.h"
-
-namespace grpc_core {
-namespace mock_cel {
-
-// This is a temporary stub implementation of CEL APIs.
-// Once gRPC imports the CEL library, this file will be removed.
-
-struct InterpreterOptions {
- bool short_circuiting = true;
-};
-
-std::unique_ptr<CelExpressionBuilder> CreateCelExpressionBuilder(
- const InterpreterOptions& options) {
- return y_absl::make_unique<FlatExprBuilder>();
-}
-
-} // namespace mock_cel
-} // namespace grpc_core
-
-#endif // GRPC_CORE_LIB_SECURITY_AUTHORIZATION_MOCK_CEL_CEL_EXPR_BUILDER_FACTORY_H \ No newline at end of file
+// Copyright 2020 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_CORE_LIB_SECURITY_AUTHORIZATION_MOCK_CEL_CEL_EXPR_BUILDER_FACTORY_H
+#define GRPC_CORE_LIB_SECURITY_AUTHORIZATION_MOCK_CEL_CEL_EXPR_BUILDER_FACTORY_H
+
+#include <grpc/support/port_platform.h>
+
+#include <memory>
+
+#include "src/core/lib/security/authorization/mock_cel/flat_expr_builder.h"
+
+namespace grpc_core {
+namespace mock_cel {
+
+// This is a temporary stub implementation of CEL APIs.
+// Once gRPC imports the CEL library, this file will be removed.
+
+struct InterpreterOptions {
+ bool short_circuiting = true;
+};
+
+std::unique_ptr<CelExpressionBuilder> CreateCelExpressionBuilder(
+ const InterpreterOptions& options) {
+ return y_absl::make_unique<FlatExprBuilder>();
+}
+
+} // namespace mock_cel
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_SECURITY_AUTHORIZATION_MOCK_CEL_CEL_EXPR_BUILDER_FACTORY_H \ No newline at end of file
diff --git a/contrib/libs/grpc/src/core/lib/security/authorization/mock_cel/cel_expression.h b/contrib/libs/grpc/src/core/lib/security/authorization/mock_cel/cel_expression.h
index 7ed9d9e38bc..4ee422e942b 100644
--- a/contrib/libs/grpc/src/core/lib/security/authorization/mock_cel/cel_expression.h
+++ b/contrib/libs/grpc/src/core/lib/security/authorization/mock_cel/cel_expression.h
@@ -1,68 +1,68 @@
-// Copyright 2020 gRPC authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#ifndef GRPC_CORE_LIB_SECURITY_AUTHORIZATION_MOCK_CEL_CEL_EXPRESSION_H
-#define GRPC_CORE_LIB_SECURITY_AUTHORIZATION_MOCK_CEL_CEL_EXPRESSION_H
-
-#include <grpc/support/port_platform.h>
-
-#include <memory>
-#include <vector>
-
-#include "google/api/expr/v1alpha1/syntax.upb.h"
-#include "src/core/lib/security/authorization/mock_cel/activation.h"
-#include "src/core/lib/security/authorization/mock_cel/cel_value.h"
-#include "src/core/lib/security/authorization/mock_cel/statusor.h"
-
-namespace grpc_core {
-namespace mock_cel {
-
-// This is a temporary stub implementation of CEL APIs.
-// Once gRPC imports the CEL library, this file will be removed.
-
-// Base interface for expression evaluating objects.
-class CelExpression {
- public:
- virtual ~CelExpression() = default;
-
- // Evaluates expression and returns value.
- // activation contains bindings from parameter names to values
- virtual StatusOr<CelValue> Evaluate(
- const BaseActivation& activation) const = 0;
-};
-
-// Base class for Expression Builder implementations
-// Provides user with factory to register extension functions.
-// ExpressionBuilder MUST NOT be destroyed before CelExpression objects
-// it built.
-class CelExpressionBuilder {
- public:
- virtual ~CelExpressionBuilder() = default;
-
- // Creates CelExpression object from AST tree.
- // expr specifies root of AST tree
- virtual StatusOr<std::unique_ptr<CelExpression>> CreateExpression(
- const google_api_expr_v1alpha1_Expr* expr,
- const google_api_expr_v1alpha1_SourceInfo* source_info) const = 0;
-
- virtual StatusOr<std::unique_ptr<CelExpression>> CreateExpression(
- const google_api_expr_v1alpha1_Expr* expr,
- const google_api_expr_v1alpha1_SourceInfo* source_info,
- std::vector<y_absl::Status>* warnings) const = 0;
-};
-
-} // namespace mock_cel
-} // namespace grpc_core
-
-#endif // GRPC_CORE_LIB_SECURITY_AUTHORIZATION_MOCK_CEL_CEL_EXPRESSION_H \ No newline at end of file
+// Copyright 2020 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_CORE_LIB_SECURITY_AUTHORIZATION_MOCK_CEL_CEL_EXPRESSION_H
+#define GRPC_CORE_LIB_SECURITY_AUTHORIZATION_MOCK_CEL_CEL_EXPRESSION_H
+
+#include <grpc/support/port_platform.h>
+
+#include <memory>
+#include <vector>
+
+#include "google/api/expr/v1alpha1/syntax.upb.h"
+#include "src/core/lib/security/authorization/mock_cel/activation.h"
+#include "src/core/lib/security/authorization/mock_cel/cel_value.h"
+#include "src/core/lib/security/authorization/mock_cel/statusor.h"
+
+namespace grpc_core {
+namespace mock_cel {
+
+// This is a temporary stub implementation of CEL APIs.
+// Once gRPC imports the CEL library, this file will be removed.
+
+// Base interface for expression evaluating objects.
+class CelExpression {
+ public:
+ virtual ~CelExpression() = default;
+
+ // Evaluates expression and returns value.
+ // activation contains bindings from parameter names to values
+ virtual StatusOr<CelValue> Evaluate(
+ const BaseActivation& activation) const = 0;
+};
+
+// Base class for Expression Builder implementations
+// Provides user with factory to register extension functions.
+// ExpressionBuilder MUST NOT be destroyed before CelExpression objects
+// it built.
+class CelExpressionBuilder {
+ public:
+ virtual ~CelExpressionBuilder() = default;
+
+ // Creates CelExpression object from AST tree.
+ // expr specifies root of AST tree
+ virtual StatusOr<std::unique_ptr<CelExpression>> CreateExpression(
+ const google_api_expr_v1alpha1_Expr* expr,
+ const google_api_expr_v1alpha1_SourceInfo* source_info) const = 0;
+
+ virtual StatusOr<std::unique_ptr<CelExpression>> CreateExpression(
+ const google_api_expr_v1alpha1_Expr* expr,
+ const google_api_expr_v1alpha1_SourceInfo* source_info,
+ std::vector<y_absl::Status>* warnings) const = 0;
+};
+
+} // namespace mock_cel
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_SECURITY_AUTHORIZATION_MOCK_CEL_CEL_EXPRESSION_H \ No newline at end of file
diff --git a/contrib/libs/grpc/src/core/lib/security/authorization/mock_cel/cel_value.h b/contrib/libs/grpc/src/core/lib/security/authorization/mock_cel/cel_value.h
index 6aad178ade7..d06b1fcec4a 100644
--- a/contrib/libs/grpc/src/core/lib/security/authorization/mock_cel/cel_value.h
+++ b/contrib/libs/grpc/src/core/lib/security/authorization/mock_cel/cel_value.h
@@ -1,93 +1,93 @@
-// Copyright 2020 gRPC authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#ifndef GRPC_CORE_LIB_SECURITY_AUTHORIZATION_MOCK_CEL_CEL_VALUE_H
-#define GRPC_CORE_LIB_SECURITY_AUTHORIZATION_MOCK_CEL_CEL_VALUE_H
-
-// CelValue is a holder, capable of storing all kinds of data
-// supported by CEL.
-// CelValue defines explicitly typed/named getters/setters.
-// When storing pointers to objects, CelValue does not accept ownership
-// to them and does not control their lifecycle. Instead objects are expected
-// to be either external to expression evaluation, and controlled beyond the
-// scope or to be allocated and associated with some allocation/ownership
-// controller (Arena).
-// Usage examples:
-// (a) For primitive types:
-// CelValue value = CelValue::CreateInt64(1);
-// (b) For string:
-// TString* msg("test");
-// CelValue value = CelValue::CreateString(msg);
-
-#include <grpc/support/port_platform.h>
-
-#include "y_absl/strings/string_view.h"
-
-namespace grpc_core {
-namespace mock_cel {
-
-// Break cyclic depdendencies for container types.
-class CelMap {
- public:
- CelMap() = default;
-};
-
-// This is a temporary stub implementation of CEL APIs.
-// Once gRPC imports the CEL library, this class will be removed.
-class CelValue {
- public:
- // Default constructor.
- // Creates CelValue with null data type.
- CelValue() : CelValue(nullptr) {}
-
- // We will use factory methods instead of public constructors
- // The reason for this is the high risk of implicit type conversions
- // between bool/int/pointer types.
- // We rely on copy elision to avoid extra copying.
- static CelValue CreateNull() { return CelValue(nullptr); }
-
- static CelValue CreateInt64(int64_t value) { return CreateNull(); }
-
- static CelValue CreateUint64(uint64_t value) { return CreateNull(); }
-
- static CelValue CreateStringView(y_absl::string_view value) {
- return CreateNull();
- }
-
- static CelValue CreateString(const TString* str) { return CreateNull(); }
-
- static CelValue CreateMap(const CelMap* value) { return CreateNull(); }
-
- private:
- // Constructs CelValue wrapping value supplied as argument.
- // Value type T should be supported by specification of ValueHolder.
- template <class T>
- explicit CelValue(T value) {}
-};
-
-// CelMap implementation that uses STL map container as backing storage.
-class ContainerBackedMapImpl : public CelMap {
- public:
- ContainerBackedMapImpl() = default;
-
- static std::unique_ptr<CelMap> Create(
- y_absl::Span<std::pair<CelValue, CelValue>> key_values) {
- return y_absl::make_unique<ContainerBackedMapImpl>();
- }
-};
-
-} // namespace mock_cel
-} // namespace grpc_core
-
-#endif // GRPC_CORE_LIB_SECURITY_AUTHORIZATION_MOCK_CEL_CEL_VALUE_H
+// Copyright 2020 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_CORE_LIB_SECURITY_AUTHORIZATION_MOCK_CEL_CEL_VALUE_H
+#define GRPC_CORE_LIB_SECURITY_AUTHORIZATION_MOCK_CEL_CEL_VALUE_H
+
+// CelValue is a holder, capable of storing all kinds of data
+// supported by CEL.
+// CelValue defines explicitly typed/named getters/setters.
+// When storing pointers to objects, CelValue does not accept ownership
+// to them and does not control their lifecycle. Instead objects are expected
+// to be either external to expression evaluation, and controlled beyond the
+// scope or to be allocated and associated with some allocation/ownership
+// controller (Arena).
+// Usage examples:
+// (a) For primitive types:
+// CelValue value = CelValue::CreateInt64(1);
+// (b) For string:
+// TString* msg("test");
+// CelValue value = CelValue::CreateString(msg);
+
+#include <grpc/support/port_platform.h>
+
+#include "y_absl/strings/string_view.h"
+
+namespace grpc_core {
+namespace mock_cel {
+
+// Break cyclic depdendencies for container types.
+class CelMap {
+ public:
+ CelMap() = default;
+};
+
+// This is a temporary stub implementation of CEL APIs.
+// Once gRPC imports the CEL library, this class will be removed.
+class CelValue {
+ public:
+ // Default constructor.
+ // Creates CelValue with null data type.
+ CelValue() : CelValue(nullptr) {}
+
+ // We will use factory methods instead of public constructors
+ // The reason for this is the high risk of implicit type conversions
+ // between bool/int/pointer types.
+ // We rely on copy elision to avoid extra copying.
+ static CelValue CreateNull() { return CelValue(nullptr); }
+
+ static CelValue CreateInt64(int64_t value) { return CreateNull(); }
+
+ static CelValue CreateUint64(uint64_t value) { return CreateNull(); }
+
+ static CelValue CreateStringView(y_absl::string_view value) {
+ return CreateNull();
+ }
+
+ static CelValue CreateString(const TString* str) { return CreateNull(); }
+
+ static CelValue CreateMap(const CelMap* value) { return CreateNull(); }
+
+ private:
+ // Constructs CelValue wrapping value supplied as argument.
+ // Value type T should be supported by specification of ValueHolder.
+ template <class T>
+ explicit CelValue(T value) {}
+};
+
+// CelMap implementation that uses STL map container as backing storage.
+class ContainerBackedMapImpl : public CelMap {
+ public:
+ ContainerBackedMapImpl() = default;
+
+ static std::unique_ptr<CelMap> Create(
+ y_absl::Span<std::pair<CelValue, CelValue>> key_values) {
+ return y_absl::make_unique<ContainerBackedMapImpl>();
+ }
+};
+
+} // namespace mock_cel
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_SECURITY_AUTHORIZATION_MOCK_CEL_CEL_VALUE_H
diff --git a/contrib/libs/grpc/src/core/lib/security/authorization/mock_cel/evaluator_core.h b/contrib/libs/grpc/src/core/lib/security/authorization/mock_cel/evaluator_core.h
index d254747a6cc..8362e101751 100644
--- a/contrib/libs/grpc/src/core/lib/security/authorization/mock_cel/evaluator_core.h
+++ b/contrib/libs/grpc/src/core/lib/security/authorization/mock_cel/evaluator_core.h
@@ -1,67 +1,67 @@
-// Copyright 2020 gRPC authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#ifndef GRPC_CORE_LIB_SECURITY_AUTHORIZATION_MOCK_CEL_EVALUATOR_CORE_H
-#define GRPC_CORE_LIB_SECURITY_AUTHORIZATION_MOCK_CEL_EVALUATOR_CORE_H
-
-#include <grpc/support/port_platform.h>
-
-#include <memory>
-#include <set>
-#include <vector>
-
-#include "google/api/expr/v1alpha1/syntax.upb.h"
-#include "src/core/lib/security/authorization/mock_cel/activation.h"
-#include "src/core/lib/security/authorization/mock_cel/cel_expression.h"
-#include "src/core/lib/security/authorization/mock_cel/cel_value.h"
-#include "src/core/lib/security/authorization/mock_cel/statusor.h"
-
-namespace grpc_core {
-namespace mock_cel {
-
-// This is a temporary stub implementation of CEL APIs.
-// Once gRPC imports the CEL library, this file will be removed.
-
-class ExpressionStep {
- public:
- virtual ~ExpressionStep() = default;
-};
-
-using ExecutionPath = std::vector<std::unique_ptr<const ExpressionStep>>;
-
-// Implementation of the CelExpression that utilizes flattening
-// of the expression tree.
-class CelExpressionFlatImpl : public CelExpression {
- // Constructs CelExpressionFlatImpl instance.
- // path is flat execution path that is based upon
- // flattened AST tree. Max iterations dictates the maximum number of
- // iterations in the comprehension expressions (use 0 to disable the upper
- // bound).
- public:
- CelExpressionFlatImpl(const google_api_expr_v1alpha1_Expr* root_expr,
- ExecutionPath path, int max_iterations,
- std::set<TString> iter_variable_names,
- bool enable_unknowns = false,
- bool enable_unknown_function_results = false) {}
-
- // Implementation of CelExpression evaluate method.
- StatusOr<CelValue> Evaluate(const BaseActivation& activation) const override {
- return CelValue::CreateNull();
- }
-};
-
-} // namespace mock_cel
-} // namespace grpc_core
-
-#endif // GRPC_CORE_LIB_SECURITY_AUTHORIZATION_MOCK_CEL_EVALUATOR_CORE_H \ No newline at end of file
+// Copyright 2020 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_CORE_LIB_SECURITY_AUTHORIZATION_MOCK_CEL_EVALUATOR_CORE_H
+#define GRPC_CORE_LIB_SECURITY_AUTHORIZATION_MOCK_CEL_EVALUATOR_CORE_H
+
+#include <grpc/support/port_platform.h>
+
+#include <memory>
+#include <set>
+#include <vector>
+
+#include "google/api/expr/v1alpha1/syntax.upb.h"
+#include "src/core/lib/security/authorization/mock_cel/activation.h"
+#include "src/core/lib/security/authorization/mock_cel/cel_expression.h"
+#include "src/core/lib/security/authorization/mock_cel/cel_value.h"
+#include "src/core/lib/security/authorization/mock_cel/statusor.h"
+
+namespace grpc_core {
+namespace mock_cel {
+
+// This is a temporary stub implementation of CEL APIs.
+// Once gRPC imports the CEL library, this file will be removed.
+
+class ExpressionStep {
+ public:
+ virtual ~ExpressionStep() = default;
+};
+
+using ExecutionPath = std::vector<std::unique_ptr<const ExpressionStep>>;
+
+// Implementation of the CelExpression that utilizes flattening
+// of the expression tree.
+class CelExpressionFlatImpl : public CelExpression {
+ // Constructs CelExpressionFlatImpl instance.
+ // path is flat execution path that is based upon
+ // flattened AST tree. Max iterations dictates the maximum number of
+ // iterations in the comprehension expressions (use 0 to disable the upper
+ // bound).
+ public:
+ CelExpressionFlatImpl(const google_api_expr_v1alpha1_Expr* root_expr,
+ ExecutionPath path, int max_iterations,
+ std::set<TString> iter_variable_names,
+ bool enable_unknowns = false,
+ bool enable_unknown_function_results = false) {}
+
+ // Implementation of CelExpression evaluate method.
+ StatusOr<CelValue> Evaluate(const BaseActivation& activation) const override {
+ return CelValue::CreateNull();
+ }
+};
+
+} // namespace mock_cel
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_SECURITY_AUTHORIZATION_MOCK_CEL_EVALUATOR_CORE_H \ No newline at end of file
diff --git a/contrib/libs/grpc/src/core/lib/security/authorization/mock_cel/flat_expr_builder.h b/contrib/libs/grpc/src/core/lib/security/authorization/mock_cel/flat_expr_builder.h
index 682ee7a07d0..c7347041867 100644
--- a/contrib/libs/grpc/src/core/lib/security/authorization/mock_cel/flat_expr_builder.h
+++ b/contrib/libs/grpc/src/core/lib/security/authorization/mock_cel/flat_expr_builder.h
@@ -1,56 +1,56 @@
-// Copyright 2020 gRPC authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#ifndef GRPC_CORE_LIB_SECURITY_AUTHORIZATION_MOCK_CEL_FLAT_EXPR_BUILDER_H
-#define GRPC_CORE_LIB_SECURITY_AUTHORIZATION_MOCK_CEL_FLAT_EXPR_BUILDER_H
-
-#include <grpc/support/port_platform.h>
-
-#include <memory>
-
-#include "src/core/lib/security/authorization/mock_cel/evaluator_core.h"
-
-namespace grpc_core {
-namespace mock_cel {
-
-// This is a temporary stub implementation of CEL APIs.
-// Once gRPC imports the CEL library, this file will be removed.
-
-// CelExpressionBuilder implementation.
-// Builds instances of CelExpressionFlatImpl.
-class FlatExprBuilder : public CelExpressionBuilder {
- public:
- FlatExprBuilder() = default;
-
- cel_base::StatusOr<std::unique_ptr<CelExpression>> CreateExpression(
- const google::api::expr::v1alpha1::Expr* expr,
- const google::api::expr::v1alpha1::SourceInfo* source_info)
- const override {
- ExecutionPath path;
- return y_absl::make_unique<CelExpressionFlatImpl>(nullptr, path, 0);
- }
-
- cel_base::StatusOr<std::unique_ptr<CelExpression>> CreateExpression(
- const google::api::expr::v1alpha1::Expr* expr,
- const google::api::expr::v1alpha1::SourceInfo* source_info,
- std::vector<y_absl::Status>* warnings) const override {
- ExecutionPath path;
- return y_absl::make_unique<CelExpressionFlatImpl>(nullptr, path, 0);
- }
-};
-
-} // namespace mock_cel
-} // namespace grpc_core
-
-#endif // GRPC_CORE_LIB_SECURITY_AUTHORIZATION_MOCK_CEL_FLAT_EXPR_BUILDER_H
+// Copyright 2020 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_CORE_LIB_SECURITY_AUTHORIZATION_MOCK_CEL_FLAT_EXPR_BUILDER_H
+#define GRPC_CORE_LIB_SECURITY_AUTHORIZATION_MOCK_CEL_FLAT_EXPR_BUILDER_H
+
+#include <grpc/support/port_platform.h>
+
+#include <memory>
+
+#include "src/core/lib/security/authorization/mock_cel/evaluator_core.h"
+
+namespace grpc_core {
+namespace mock_cel {
+
+// This is a temporary stub implementation of CEL APIs.
+// Once gRPC imports the CEL library, this file will be removed.
+
+// CelExpressionBuilder implementation.
+// Builds instances of CelExpressionFlatImpl.
+class FlatExprBuilder : public CelExpressionBuilder {
+ public:
+ FlatExprBuilder() = default;
+
+ cel_base::StatusOr<std::unique_ptr<CelExpression>> CreateExpression(
+ const google::api::expr::v1alpha1::Expr* expr,
+ const google::api::expr::v1alpha1::SourceInfo* source_info)
+ const override {
+ ExecutionPath path;
+ return y_absl::make_unique<CelExpressionFlatImpl>(nullptr, path, 0);
+ }
+
+ cel_base::StatusOr<std::unique_ptr<CelExpression>> CreateExpression(
+ const google::api::expr::v1alpha1::Expr* expr,
+ const google::api::expr::v1alpha1::SourceInfo* source_info,
+ std::vector<y_absl::Status>* warnings) const override {
+ ExecutionPath path;
+ return y_absl::make_unique<CelExpressionFlatImpl>(nullptr, path, 0);
+ }
+};
+
+} // namespace mock_cel
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_SECURITY_AUTHORIZATION_MOCK_CEL_FLAT_EXPR_BUILDER_H
diff --git a/contrib/libs/grpc/src/core/lib/security/authorization/mock_cel/statusor.h b/contrib/libs/grpc/src/core/lib/security/authorization/mock_cel/statusor.h
index 37931d0893f..2002d814c9d 100644
--- a/contrib/libs/grpc/src/core/lib/security/authorization/mock_cel/statusor.h
+++ b/contrib/libs/grpc/src/core/lib/security/authorization/mock_cel/statusor.h
@@ -1,50 +1,50 @@
-// Copyright 2020 gRPC authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#ifndef GRPC_CORE_LIB_SECURITY_AUTHORIZATION_MOCK_CEL_STATUSOR_H
-#define GRPC_CORE_LIB_SECURITY_AUTHORIZATION_MOCK_CEL_STATUSOR_H
-
-#include <grpc/support/port_platform.h>
-
-#include <memory>
-
-#include "y_absl/status/status.h"
-
-namespace grpc_core {
-namespace mock_cel {
-
-// This is a temporary stub implementation of CEL APIs.
-// Once gRPC imports the CEL library, this file will be removed.
-
-template <typename T>
-class ABSL_MUST_USE_RESULT StatusOr;
-
-template <typename T>
-class StatusOr {
- public:
- StatusOr() = default;
-
- StatusOr(const T& value) {}
-
- StatusOr(const y_absl::Status& status) {}
-
- StatusOr(y_absl::Status&& status) {}
-
- bool ok() const { return true; }
-};
-
-} // namespace mock_cel
-} // namespace grpc_core
-
-#endif // GRPC_CORE_LIB_SECURITY_AUTHORIZATION_MOCK_CEL_STATUSOR_H \ No newline at end of file
+// Copyright 2020 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_CORE_LIB_SECURITY_AUTHORIZATION_MOCK_CEL_STATUSOR_H
+#define GRPC_CORE_LIB_SECURITY_AUTHORIZATION_MOCK_CEL_STATUSOR_H
+
+#include <grpc/support/port_platform.h>
+
+#include <memory>
+
+#include "y_absl/status/status.h"
+
+namespace grpc_core {
+namespace mock_cel {
+
+// This is a temporary stub implementation of CEL APIs.
+// Once gRPC imports the CEL library, this file will be removed.
+
+template <typename T>
+class ABSL_MUST_USE_RESULT StatusOr;
+
+template <typename T>
+class StatusOr {
+ public:
+ StatusOr() = default;
+
+ StatusOr(const T& value) {}
+
+ StatusOr(const y_absl::Status& status) {}
+
+ StatusOr(y_absl::Status&& status) {}
+
+ bool ok() const { return true; }
+};
+
+} // namespace mock_cel
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_SECURITY_AUTHORIZATION_MOCK_CEL_STATUSOR_H \ No newline at end of file
diff --git a/contrib/libs/grpc/src/core/lib/security/certificate_provider.h b/contrib/libs/grpc/src/core/lib/security/certificate_provider.h
index edf50e023bd..5a9cfee0b94 100644
--- a/contrib/libs/grpc/src/core/lib/security/certificate_provider.h
+++ b/contrib/libs/grpc/src/core/lib/security/certificate_provider.h
@@ -1,60 +1,60 @@
-//
-//
-// Copyright 2020 gRPC authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//
-
-#ifndef GRPC_CORE_LIB_SECURITY_CERTIFICATE_PROVIDER_H
-#define GRPC_CORE_LIB_SECURITY_CERTIFICATE_PROVIDER_H
-
-#include <grpc/support/port_platform.h>
-
-#include "src/core/lib/gprpp/ref_counted.h"
-#include "src/core/lib/gprpp/ref_counted_ptr.h"
-#include "src/core/lib/iomgr/pollset_set.h"
-
-// TODO(yashkt): After https://github.com/grpc/grpc/pull/23572, remove this
-// forward declaration and include the header for the distributor instead.
-struct grpc_tls_certificate_distributor;
-
-// Interface for a grpc_tls_certificate_provider that handles the process to
-// fetch credentials and validation contexts. Implementations are free to rely
-// on local or remote sources to fetch the latest secrets, and free to share any
-// state among different instances as they deem fit.
-//
-// On creation, grpc_tls_certificate_provider creates a
-// grpc_tls_certificate_distributor object. When the credentials and validation
-// contexts become valid or changed, a grpc_tls_certificate_provider should
-// notify its distributor so as to propagate the update to the watchers.
-struct grpc_tls_certificate_provider
- : public grpc_core::RefCounted<grpc_tls_certificate_provider> {
- public:
- grpc_tls_certificate_provider()
- : interested_parties_(grpc_pollset_set_create()) {}
-
- virtual ~grpc_tls_certificate_provider() {
- grpc_pollset_set_destroy(interested_parties_);
- }
-
- grpc_pollset_set* interested_parties() const { return interested_parties_; }
-
- virtual grpc_core::RefCountedPtr<grpc_tls_certificate_distributor>
- distributor() const = 0;
-
- private:
- grpc_pollset_set* interested_parties_;
-};
-
-#endif // GRPC_CORE_LIB_SECURITY_CERTIFICATE_PROVIDER_H
+//
+//
+// Copyright 2020 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+//
+
+#ifndef GRPC_CORE_LIB_SECURITY_CERTIFICATE_PROVIDER_H
+#define GRPC_CORE_LIB_SECURITY_CERTIFICATE_PROVIDER_H
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/lib/gprpp/ref_counted.h"
+#include "src/core/lib/gprpp/ref_counted_ptr.h"
+#include "src/core/lib/iomgr/pollset_set.h"
+
+// TODO(yashkt): After https://github.com/grpc/grpc/pull/23572, remove this
+// forward declaration and include the header for the distributor instead.
+struct grpc_tls_certificate_distributor;
+
+// Interface for a grpc_tls_certificate_provider that handles the process to
+// fetch credentials and validation contexts. Implementations are free to rely
+// on local or remote sources to fetch the latest secrets, and free to share any
+// state among different instances as they deem fit.
+//
+// On creation, grpc_tls_certificate_provider creates a
+// grpc_tls_certificate_distributor object. When the credentials and validation
+// contexts become valid or changed, a grpc_tls_certificate_provider should
+// notify its distributor so as to propagate the update to the watchers.
+struct grpc_tls_certificate_provider
+ : public grpc_core::RefCounted<grpc_tls_certificate_provider> {
+ public:
+ grpc_tls_certificate_provider()
+ : interested_parties_(grpc_pollset_set_create()) {}
+
+ virtual ~grpc_tls_certificate_provider() {
+ grpc_pollset_set_destroy(interested_parties_);
+ }
+
+ grpc_pollset_set* interested_parties() const { return interested_parties_; }
+
+ virtual grpc_core::RefCountedPtr<grpc_tls_certificate_distributor>
+ distributor() const = 0;
+
+ private:
+ grpc_pollset_set* interested_parties_;
+};
+
+#endif // GRPC_CORE_LIB_SECURITY_CERTIFICATE_PROVIDER_H
diff --git a/contrib/libs/grpc/src/core/lib/security/credentials/alts/check_gcp_environment.cc b/contrib/libs/grpc/src/core/lib/security/credentials/alts/check_gcp_environment.cc
index 9962bf4469f..9c98d7a5f4f 100644
--- a/contrib/libs/grpc/src/core/lib/security/credentials/alts/check_gcp_environment.cc
+++ b/contrib/libs/grpc/src/core/lib/security/credentials/alts/check_gcp_environment.cc
@@ -30,7 +30,7 @@
const size_t kBiosDataBufferSize = 256;
static char* trim(const char* src) {
- if (src == nullptr || *src == '\0') {
+ if (src == nullptr || *src == '\0') {
return nullptr;
}
char* des = nullptr;
diff --git a/contrib/libs/grpc/src/core/lib/security/credentials/composite/composite_credentials.cc b/contrib/libs/grpc/src/core/lib/security/credentials/composite/composite_credentials.cc
index a39a910e95d..a6c82d47741 100644
--- a/contrib/libs/grpc/src/core/lib/security/credentials/composite/composite_credentials.cc
+++ b/contrib/libs/grpc/src/core/lib/security/credentials/composite/composite_credentials.cc
@@ -22,10 +22,10 @@
#include <cstring>
#include <new>
-#include <vector>
+#include <vector>
-#include "y_absl/strings/str_cat.h"
-#include "y_absl/strings/str_join.h"
+#include "y_absl/strings/str_cat.h"
+#include "y_absl/strings/str_join.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/iomgr/polling_entity.h"
#include "src/core/lib/surface/api_trace.h"
@@ -119,15 +119,15 @@ void grpc_composite_call_credentials::cancel_get_request_metadata(
GRPC_ERROR_UNREF(error);
}
-TString grpc_composite_call_credentials::debug_string() {
- std::vector<TString> outputs;
- for (auto& inner_cred : inner_) {
- outputs.emplace_back(inner_cred->debug_string());
- }
- return y_absl::StrCat("CompositeCallCredentials{", y_absl::StrJoin(outputs, ","),
- "}");
-}
-
+TString grpc_composite_call_credentials::debug_string() {
+ std::vector<TString> outputs;
+ for (auto& inner_cred : inner_) {
+ outputs.emplace_back(inner_cred->debug_string());
+ }
+ return y_absl::StrCat("CompositeCallCredentials{", y_absl::StrJoin(outputs, ","),
+ "}");
+}
+
static size_t get_creds_array_size(const grpc_call_credentials* creds,
bool is_composite) {
return is_composite
@@ -163,13 +163,13 @@ grpc_composite_call_credentials::grpc_composite_call_credentials(
inner_.reserve(size);
push_to_inner(std::move(creds1), creds1_is_composite);
push_to_inner(std::move(creds2), creds2_is_composite);
- min_security_level_ = GRPC_SECURITY_NONE;
- for (size_t i = 0; i < inner_.size(); ++i) {
- if (static_cast<int>(min_security_level_) <
- static_cast<int>(inner_[i]->min_security_level())) {
- min_security_level_ = inner_[i]->min_security_level();
- }
- }
+ min_security_level_ = GRPC_SECURITY_NONE;
+ for (size_t i = 0; i < inner_.size(); ++i) {
+ if (static_cast<int>(min_security_level_) <
+ static_cast<int>(inner_[i]->min_security_level())) {
+ min_security_level_ = inner_[i]->min_security_level();
+ }
+ }
}
static grpc_core::RefCountedPtr<grpc_call_credentials>
diff --git a/contrib/libs/grpc/src/core/lib/security/credentials/composite/composite_credentials.h b/contrib/libs/grpc/src/core/lib/security/credentials/composite/composite_credentials.h
index 7e7a99bd7c2..5bebb9bd5ae 100644
--- a/contrib/libs/grpc/src/core/lib/security/credentials/composite/composite_credentials.h
+++ b/contrib/libs/grpc/src/core/lib/security/credentials/composite/composite_credentials.h
@@ -21,10 +21,10 @@
#include <grpc/support/port_platform.h>
-#include <util/generic/string.h>
-
-#include "y_absl/container/inlined_vector.h"
-
+#include <util/generic/string.h>
+
+#include "y_absl/container/inlined_vector.h"
+
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/security/credentials/credentials.h"
@@ -72,7 +72,7 @@ class grpc_composite_channel_credentials : public grpc_channel_credentials {
class grpc_composite_call_credentials : public grpc_call_credentials {
public:
using CallCredentialsList =
- y_absl::InlinedVector<grpc_core::RefCountedPtr<grpc_call_credentials>, 2>;
+ y_absl::InlinedVector<grpc_core::RefCountedPtr<grpc_call_credentials>, 2>;
grpc_composite_call_credentials(
grpc_core::RefCountedPtr<grpc_call_credentials> creds1,
@@ -88,17 +88,17 @@ class grpc_composite_call_credentials : public grpc_call_credentials {
void cancel_get_request_metadata(grpc_credentials_mdelem_array* md_array,
grpc_error* error) override;
- grpc_security_level min_security_level() const override {
- return min_security_level_;
- }
-
+ grpc_security_level min_security_level() const override {
+ return min_security_level_;
+ }
+
const CallCredentialsList& inner() const { return inner_; }
- TString debug_string() override;
+ TString debug_string() override;
private:
void push_to_inner(grpc_core::RefCountedPtr<grpc_call_credentials> creds,
bool is_composite);
- grpc_security_level min_security_level_;
+ grpc_security_level min_security_level_;
CallCredentialsList inner_;
};
diff --git a/contrib/libs/grpc/src/core/lib/security/credentials/credentials.h b/contrib/libs/grpc/src/core/lib/security/credentials/credentials.h
index d22d435adde..15a85cbd0be 100644
--- a/contrib/libs/grpc/src/core/lib/security/credentials/credentials.h
+++ b/contrib/libs/grpc/src/core/lib/security/credentials/credentials.h
@@ -21,10 +21,10 @@
#include <grpc/support/port_platform.h>
-#include <string.h>
-
-#include <util/generic/string.h>
-
+#include <string.h>
+
+#include <util/generic/string.h>
+
#include <grpc/grpc.h>
#include <grpc/grpc_security.h>
#include <grpc/support/sync.h>
@@ -81,13 +81,13 @@ typedef enum {
/* --- Google utils --- */
/* It is the caller's responsibility to gpr_free the result if not NULL. */
-TString grpc_get_well_known_google_credentials_file_path(void);
+TString grpc_get_well_known_google_credentials_file_path(void);
/* Implementation function for the different platforms. */
-TString grpc_get_well_known_google_credentials_file_path_impl(void);
+TString grpc_get_well_known_google_credentials_file_path_impl(void);
/* Override for testing only. Not thread-safe */
-typedef TString (*grpc_well_known_credentials_path_getter)(void);
+typedef TString (*grpc_well_known_credentials_path_getter)(void);
void grpc_override_well_known_credentials_path_getter(
grpc_well_known_credentials_path_getter getter);
@@ -172,11 +172,11 @@ void grpc_credentials_mdelem_array_destroy(grpc_credentials_mdelem_array* list);
struct grpc_call_credentials
: public grpc_core::RefCounted<grpc_call_credentials> {
public:
- explicit grpc_call_credentials(
- const char* type,
- grpc_security_level min_security_level = GRPC_PRIVACY_AND_INTEGRITY)
- : type_(type), min_security_level_(min_security_level) {}
-
+ explicit grpc_call_credentials(
+ const char* type,
+ grpc_security_level min_security_level = GRPC_PRIVACY_AND_INTEGRITY)
+ : type_(type), min_security_level_(min_security_level) {}
+
virtual ~grpc_call_credentials() = default;
// Returns true if completed synchronously, in which case \a error will
@@ -195,19 +195,19 @@ struct grpc_call_credentials
virtual void cancel_get_request_metadata(
grpc_credentials_mdelem_array* md_array, grpc_error* error) = 0;
- virtual grpc_security_level min_security_level() const {
- return min_security_level_;
- }
-
- virtual TString debug_string() {
- return "grpc_call_credentials did not provide debug string";
- }
-
+ virtual grpc_security_level min_security_level() const {
+ return min_security_level_;
+ }
+
+ virtual TString debug_string() {
+ return "grpc_call_credentials did not provide debug string";
+ }
+
const char* type() const { return type_; }
private:
const char* type_;
- const grpc_security_level min_security_level_;
+ const grpc_security_level min_security_level_;
};
/* Metadata-only credentials with the specified key and value where
diff --git a/contrib/libs/grpc/src/core/lib/security/credentials/fake/fake_credentials.h b/contrib/libs/grpc/src/core/lib/security/credentials/fake/fake_credentials.h
index f3331121b0b..27f3a284515 100644
--- a/contrib/libs/grpc/src/core/lib/security/credentials/fake/fake_credentials.h
+++ b/contrib/libs/grpc/src/core/lib/security/credentials/fake/fake_credentials.h
@@ -21,8 +21,8 @@
#include <grpc/support/port_platform.h>
-#include <string.h>
-
+#include <string.h>
+
#include "src/core/lib/security/credentials/credentials.h"
#define GRPC_ARG_FAKE_SECURITY_EXPECTED_TARGETS \
@@ -61,8 +61,8 @@ class grpc_md_only_test_credentials : public grpc_call_credentials {
public:
grpc_md_only_test_credentials(const char* md_key, const char* md_value,
bool is_async)
- : grpc_call_credentials(GRPC_CALL_CREDENTIALS_TYPE_OAUTH2,
- GRPC_SECURITY_NONE),
+ : grpc_call_credentials(GRPC_CALL_CREDENTIALS_TYPE_OAUTH2,
+ GRPC_SECURITY_NONE),
md_(grpc_mdelem_from_slices(grpc_slice_from_copied_string(md_key),
grpc_slice_from_copied_string(md_value))),
is_async_(is_async) {}
@@ -77,8 +77,8 @@ class grpc_md_only_test_credentials : public grpc_call_credentials {
void cancel_get_request_metadata(grpc_credentials_mdelem_array* md_array,
grpc_error* error) override;
- TString debug_string() override { return "MD only Test Credentials"; };
-
+ TString debug_string() override { return "MD only Test Credentials"; };
+
private:
grpc_mdelem md_;
bool is_async_;
diff --git a/contrib/libs/grpc/src/core/lib/security/credentials/google_default/credentials_generic.cc b/contrib/libs/grpc/src/core/lib/security/credentials/google_default/credentials_generic.cc
index 7dd1a935418..e8b9bbdadc7 100644
--- a/contrib/libs/grpc/src/core/lib/security/credentials/google_default/credentials_generic.cc
+++ b/contrib/libs/grpc/src/core/lib/security/credentials/google_default/credentials_generic.cc
@@ -20,24 +20,24 @@
#include "src/core/lib/security/credentials/google_default/google_default_credentials.h"
-#include <util/generic/string.h>
-
-#include "y_absl/strings/str_cat.h"
-
+#include <util/generic/string.h>
+
+#include "y_absl/strings/str_cat.h"
+
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include "src/core/lib/gpr/env.h"
-TString grpc_get_well_known_google_credentials_file_path_impl(void) {
+TString grpc_get_well_known_google_credentials_file_path_impl(void) {
char* base = gpr_getenv(GRPC_GOOGLE_CREDENTIALS_PATH_ENV_VAR);
if (base == nullptr) {
gpr_log(GPR_ERROR, "Could not get " GRPC_GOOGLE_CREDENTIALS_PATH_ENV_VAR
" environment variable.");
- return "";
+ return "";
}
- TString result =
- y_absl::StrCat(base, "/", GRPC_GOOGLE_CREDENTIALS_PATH_SUFFIX);
+ TString result =
+ y_absl::StrCat(base, "/", GRPC_GOOGLE_CREDENTIALS_PATH_SUFFIX);
gpr_free(base);
return result;
}
diff --git a/contrib/libs/grpc/src/core/lib/security/credentials/google_default/google_default_credentials.cc b/contrib/libs/grpc/src/core/lib/security/credentials/google_default/google_default_credentials.cc
index 11949d1cdef..8f3ca009a59 100644
--- a/contrib/libs/grpc/src/core/lib/security/credentials/google_default/google_default_credentials.cc
+++ b/contrib/libs/grpc/src/core/lib/security/credentials/google_default/google_default_credentials.cc
@@ -44,13 +44,13 @@
#include "src/core/lib/slice/slice_string_helpers.h"
#include "src/core/lib/surface/api_trace.h"
-using grpc_core::Json;
-
+using grpc_core::Json;
+
/* -- Constants. -- */
#define GRPC_COMPUTE_ENGINE_DETECTION_HOST "metadata.google.internal."
-#define GRPC_GOOGLE_CREDENTIAL_CREATION_ERROR \
- "Failed to create Google credentials"
+#define GRPC_GOOGLE_CREDENTIAL_CREATION_ERROR \
+ "Failed to create Google credentials"
/* -- Default credentials. -- */
@@ -90,7 +90,7 @@ grpc_google_default_channel_credentials::create_security_connector(
bool use_alts =
is_grpclb_load_balancer || is_backend_from_grpclb_load_balancer;
/* Return failure if ALTS is selected but not running on GCE. */
- if (use_alts && alts_creds_ == nullptr) {
+ if (use_alts && alts_creds_ == nullptr) {
gpr_log(GPR_ERROR, "ALTS is selected, but not running on GCE.");
return nullptr;
}
@@ -217,23 +217,23 @@ static int is_metadata_server_reachable() {
/* Takes ownership of creds_path if not NULL. */
static grpc_error* create_default_creds_from_path(
- const TString& creds_path,
- grpc_core::RefCountedPtr<grpc_call_credentials>* creds) {
+ const TString& creds_path,
+ grpc_core::RefCountedPtr<grpc_call_credentials>* creds) {
grpc_auth_json_key key;
grpc_auth_refresh_token token;
grpc_core::RefCountedPtr<grpc_call_credentials> result;
grpc_slice creds_data = grpc_empty_slice();
grpc_error* error = GRPC_ERROR_NONE;
- Json json;
- if (creds_path.empty()) {
+ Json json;
+ if (creds_path.empty()) {
error = GRPC_ERROR_CREATE_FROM_STATIC_STRING("creds_path unset");
goto end;
}
- error = grpc_load_file(creds_path.c_str(), 0, &creds_data);
- if (error != GRPC_ERROR_NONE) goto end;
- json = Json::Parse(grpc_core::StringViewFromSlice(creds_data), &error);
- if (error != GRPC_ERROR_NONE) goto end;
- if (json.type() != Json::Type::OBJECT) {
+ error = grpc_load_file(creds_path.c_str(), 0, &creds_data);
+ if (error != GRPC_ERROR_NONE) goto end;
+ json = Json::Parse(grpc_core::StringViewFromSlice(creds_data), &error);
+ if (error != GRPC_ERROR_NONE) goto end;
+ if (json.type() != Json::Type::OBJECT) {
error = grpc_error_set_str(
GRPC_ERROR_CREATE_FROM_STATIC_STRING("Failed to parse JSON"),
GRPC_ERROR_STR_RAW_BYTES, grpc_slice_ref_internal(creds_data));
@@ -274,13 +274,13 @@ end:
return error;
}
-static void update_tenancy() {
+static void update_tenancy() {
gpr_once_init(&g_once, init_default_credentials);
- grpc_core::MutexLock lock(&g_state_mu);
+ grpc_core::MutexLock lock(&g_state_mu);
/* Try a platform-provided hint for GCE. */
if (!g_metadata_server_available) {
- g_metadata_server_available = g_gce_tenancy_checker();
+ g_metadata_server_available = g_gce_tenancy_checker();
}
/* TODO: Add a platform-provided hint for GAE. */
@@ -288,64 +288,64 @@ static void update_tenancy() {
if (!g_metadata_server_available) {
g_metadata_server_available = is_metadata_server_reachable();
}
-}
-
-static bool metadata_server_available() {
- grpc_core::MutexLock lock(&g_state_mu);
- return static_cast<bool>(g_metadata_server_available);
-}
-
-static grpc_core::RefCountedPtr<grpc_call_credentials> make_default_call_creds(
- grpc_error** error) {
- grpc_core::RefCountedPtr<grpc_call_credentials> call_creds;
- grpc_error* err;
-
- /* First, try the environment variable. */
- char* path_from_env = gpr_getenv(GRPC_GOOGLE_CREDENTIALS_ENV_VAR);
- if (path_from_env != nullptr) {
- err = create_default_creds_from_path(path_from_env, &call_creds);
- gpr_free(path_from_env);
- if (err == GRPC_ERROR_NONE) return call_creds;
- *error = grpc_error_add_child(*error, err);
- }
-
- /* Then the well-known file. */
- err = create_default_creds_from_path(
- grpc_get_well_known_google_credentials_file_path(), &call_creds);
- if (err == GRPC_ERROR_NONE) return call_creds;
- *error = grpc_error_add_child(*error, err);
-
- update_tenancy();
-
- if (metadata_server_available()) {
+}
+
+static bool metadata_server_available() {
+ grpc_core::MutexLock lock(&g_state_mu);
+ return static_cast<bool>(g_metadata_server_available);
+}
+
+static grpc_core::RefCountedPtr<grpc_call_credentials> make_default_call_creds(
+ grpc_error** error) {
+ grpc_core::RefCountedPtr<grpc_call_credentials> call_creds;
+ grpc_error* err;
+
+ /* First, try the environment variable. */
+ char* path_from_env = gpr_getenv(GRPC_GOOGLE_CREDENTIALS_ENV_VAR);
+ if (path_from_env != nullptr) {
+ err = create_default_creds_from_path(path_from_env, &call_creds);
+ gpr_free(path_from_env);
+ if (err == GRPC_ERROR_NONE) return call_creds;
+ *error = grpc_error_add_child(*error, err);
+ }
+
+ /* Then the well-known file. */
+ err = create_default_creds_from_path(
+ grpc_get_well_known_google_credentials_file_path(), &call_creds);
+ if (err == GRPC_ERROR_NONE) return call_creds;
+ *error = grpc_error_add_child(*error, err);
+
+ update_tenancy();
+
+ if (metadata_server_available()) {
call_creds = grpc_core::RefCountedPtr<grpc_call_credentials>(
grpc_google_compute_engine_credentials_create(nullptr));
if (call_creds == nullptr) {
- *error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- GRPC_GOOGLE_CREDENTIAL_CREATION_ERROR);
- *error = grpc_error_add_child(
- *error, GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "Failed to get credentials from network"));
+ *error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ GRPC_GOOGLE_CREDENTIAL_CREATION_ERROR);
+ *error = grpc_error_add_child(
+ *error, GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Failed to get credentials from network"));
}
}
- return call_creds;
-}
-
-grpc_channel_credentials* grpc_google_default_credentials_create(
- grpc_call_credentials* call_credentials) {
- grpc_channel_credentials* result = nullptr;
- grpc_core::RefCountedPtr<grpc_call_credentials> call_creds(call_credentials);
- grpc_error* error = nullptr;
- grpc_core::ExecCtx exec_ctx;
-
- GRPC_API_TRACE("grpc_google_default_credentials_create(%p)", 1,
- (call_credentials));
-
- if (call_creds == nullptr) {
- call_creds = make_default_call_creds(&error);
- }
-
+ return call_creds;
+}
+
+grpc_channel_credentials* grpc_google_default_credentials_create(
+ grpc_call_credentials* call_credentials) {
+ grpc_channel_credentials* result = nullptr;
+ grpc_core::RefCountedPtr<grpc_call_credentials> call_creds(call_credentials);
+ grpc_error* error = nullptr;
+ grpc_core::ExecCtx exec_ctx;
+
+ GRPC_API_TRACE("grpc_google_default_credentials_create(%p)", 1,
+ (call_credentials));
+
+ if (call_creds == nullptr) {
+ call_creds = make_default_call_creds(&error);
+ }
+
if (call_creds != nullptr) {
/* Create google default credentials. */
grpc_channel_credentials* ssl_creds =
@@ -358,8 +358,8 @@ grpc_channel_credentials* grpc_google_default_credentials_create(
grpc_alts_credentials_options_destroy(options);
auto creds =
grpc_core::MakeRefCounted<grpc_google_default_channel_credentials>(
- grpc_core::RefCountedPtr<grpc_channel_credentials>(alts_creds),
- grpc_core::RefCountedPtr<grpc_channel_credentials>(ssl_creds));
+ grpc_core::RefCountedPtr<grpc_channel_credentials>(alts_creds),
+ grpc_core::RefCountedPtr<grpc_channel_credentials>(ssl_creds));
result = grpc_composite_channel_credentials_create(
creds.get(), call_creds.get(), nullptr);
GPR_ASSERT(result != nullptr);
@@ -393,7 +393,7 @@ void grpc_flush_cached_google_default_credentials(void) {
static grpc_well_known_credentials_path_getter creds_path_getter = nullptr;
-TString grpc_get_well_known_google_credentials_file_path(void) {
+TString grpc_get_well_known_google_credentials_file_path(void) {
if (creds_path_getter != nullptr) return creds_path_getter();
return grpc_get_well_known_google_credentials_file_path_impl();
}
diff --git a/contrib/libs/grpc/src/core/lib/security/credentials/iam/iam_credentials.cc b/contrib/libs/grpc/src/core/lib/security/credentials/iam/iam_credentials.cc
index 086409028c6..a03e4970b8e 100644
--- a/contrib/libs/grpc/src/core/lib/security/credentials/iam/iam_credentials.cc
+++ b/contrib/libs/grpc/src/core/lib/security/credentials/iam/iam_credentials.cc
@@ -25,10 +25,10 @@
#include <grpc/support/string_util.h>
#include <grpc/support/sync.h>
-#include "y_absl/strings/str_format.h"
-#include "src/core/lib/gprpp/ref_counted_ptr.h"
-#include "src/core/lib/surface/api_trace.h"
-
+#include "y_absl/strings/str_format.h"
+#include "src/core/lib/gprpp/ref_counted_ptr.h"
+#include "src/core/lib/surface/api_trace.h"
+
grpc_google_iam_credentials::~grpc_google_iam_credentials() {
grpc_credentials_mdelem_array_destroy(&md_array_);
}
@@ -48,10 +48,10 @@ void grpc_google_iam_credentials::cancel_get_request_metadata(
grpc_google_iam_credentials::grpc_google_iam_credentials(
const char* token, const char* authority_selector)
- : grpc_call_credentials(GRPC_CALL_CREDENTIALS_TYPE_IAM),
- debug_string_(y_absl::StrFormat(
- "GoogleIAMCredentials{Token:%s,AuthoritySelector:%s}",
- token != nullptr ? "present" : "absent", authority_selector)) {
+ : grpc_call_credentials(GRPC_CALL_CREDENTIALS_TYPE_IAM),
+ debug_string_(y_absl::StrFormat(
+ "GoogleIAMCredentials{Token:%s,AuthoritySelector:%s}",
+ token != nullptr ? "present" : "absent", authority_selector)) {
grpc_mdelem md = grpc_mdelem_from_slices(
grpc_slice_from_static_string(GRPC_IAM_AUTHORIZATION_TOKEN_METADATA_KEY),
grpc_slice_from_copied_string(token));
diff --git a/contrib/libs/grpc/src/core/lib/security/credentials/iam/iam_credentials.h b/contrib/libs/grpc/src/core/lib/security/credentials/iam/iam_credentials.h
index d0d0ee8a550..76b6acfa281 100644
--- a/contrib/libs/grpc/src/core/lib/security/credentials/iam/iam_credentials.h
+++ b/contrib/libs/grpc/src/core/lib/security/credentials/iam/iam_credentials.h
@@ -21,8 +21,8 @@
#include <grpc/support/port_platform.h>
-#include <util/generic/string.h>
-
+#include <util/generic/string.h>
+
#include "src/core/lib/security/credentials/credentials.h"
class grpc_google_iam_credentials : public grpc_call_credentials {
@@ -39,11 +39,11 @@ class grpc_google_iam_credentials : public grpc_call_credentials {
void cancel_get_request_metadata(grpc_credentials_mdelem_array* md_array,
grpc_error* error) override;
- TString debug_string() override { return debug_string_; }
+ TString debug_string() override { return debug_string_; }
private:
grpc_credentials_mdelem_array md_array_;
- const TString debug_string_;
+ const TString debug_string_;
};
#endif /* GRPC_CORE_LIB_SECURITY_CREDENTIALS_IAM_IAM_CREDENTIALS_H */
diff --git a/contrib/libs/grpc/src/core/lib/security/credentials/jwt/json_token.cc b/contrib/libs/grpc/src/core/lib/security/credentials/jwt/json_token.cc
index e09338c4b62..c0c5b52782b 100644
--- a/contrib/libs/grpc/src/core/lib/security/credentials/jwt/json_token.cc
+++ b/contrib/libs/grpc/src/core/lib/security/credentials/jwt/json_token.cc
@@ -39,8 +39,8 @@ extern "C" {
#include <openssl/pem.h>
}
-using grpc_core::Json;
-
+using grpc_core::Json;
+
/* --- Constants. --- */
/* 1 hour max. */
@@ -67,7 +67,7 @@ int grpc_auth_json_key_is_valid(const grpc_auth_json_key* json_key) {
strcmp(json_key->type, GRPC_AUTH_JSON_TYPE_INVALID);
}
-grpc_auth_json_key grpc_auth_json_key_create_from_json(const Json& json) {
+grpc_auth_json_key grpc_auth_json_key_create_from_json(const Json& json) {
grpc_auth_json_key result;
BIO* bio = nullptr;
const char* prop_value;
@@ -76,7 +76,7 @@ grpc_auth_json_key grpc_auth_json_key_create_from_json(const Json& json) {
memset(&result, 0, sizeof(grpc_auth_json_key));
result.type = GRPC_AUTH_JSON_TYPE_INVALID;
- if (json.type() == Json::Type::JSON_NULL) {
+ if (json.type() == Json::Type::JSON_NULL) {
gpr_log(GPR_ERROR, "Invalid json.");
goto end;
}
@@ -124,10 +124,10 @@ end:
grpc_auth_json_key grpc_auth_json_key_create_from_string(
const char* json_string) {
- grpc_error* error = GRPC_ERROR_NONE;
- Json json = Json::Parse(json_string, &error);
- GRPC_LOG_IF_ERROR("JSON key parsing", error);
- return grpc_auth_json_key_create_from_json(json);
+ grpc_error* error = GRPC_ERROR_NONE;
+ Json json = Json::Parse(json_string, &error);
+ GRPC_LOG_IF_ERROR("JSON key parsing", error);
+ return grpc_auth_json_key_create_from_json(json);
}
void grpc_auth_json_key_destruct(grpc_auth_json_key* json_key) {
@@ -154,13 +154,13 @@ void grpc_auth_json_key_destruct(grpc_auth_json_key* json_key) {
/* --- jwt encoding and signature. --- */
static char* encoded_jwt_header(const char* key_id, const char* algorithm) {
- Json json = Json::Object{
- {"alg", algorithm},
- {"typ", GRPC_JWT_TYPE},
- {"kid", key_id},
- };
- TString json_str = json.Dump();
- return grpc_base64_encode(json_str.c_str(), json_str.size(), 1, 0);
+ Json json = Json::Object{
+ {"alg", algorithm},
+ {"typ", GRPC_JWT_TYPE},
+ {"kid", key_id},
+ };
+ TString json_str = json.Dump();
+ return grpc_base64_encode(json_str.c_str(), json_str.size(), 1, 0);
}
static char* encoded_jwt_claim(const grpc_auth_json_key* json_key,
@@ -173,22 +173,22 @@ static char* encoded_jwt_claim(const grpc_auth_json_key* json_key,
expiration = gpr_time_add(now, grpc_max_auth_token_lifetime());
}
- Json::Object object = {
- {"iss", json_key->client_email},
- {"aud", audience},
- {"iat", now.tv_sec},
- {"exp", expiration.tv_sec},
- };
+ Json::Object object = {
+ {"iss", json_key->client_email},
+ {"aud", audience},
+ {"iat", now.tv_sec},
+ {"exp", expiration.tv_sec},
+ };
if (scope != nullptr) {
- object["scope"] = scope;
+ object["scope"] = scope;
} else {
/* Unscoped JWTs need a sub field. */
- object["sub"] = json_key->client_email;
+ object["sub"] = json_key->client_email;
}
- Json json(object);
- TString json_str = json.Dump();
- return grpc_base64_encode(json_str.c_str(), json_str.size(), 1, 0);
+ Json json(object);
+ TString json_str = json.Dump();
+ return grpc_base64_encode(json_str.c_str(), json_str.size(), 1, 0);
}
static char* dot_concat_and_free_strings(char* str1, char* str2) {
diff --git a/contrib/libs/grpc/src/core/lib/security/credentials/jwt/json_token.h b/contrib/libs/grpc/src/core/lib/security/credentials/jwt/json_token.h
index ac393473a71..b9a41c6b2b6 100644
--- a/contrib/libs/grpc/src/core/lib/security/credentials/jwt/json_token.h
+++ b/contrib/libs/grpc/src/core/lib/security/credentials/jwt/json_token.h
@@ -49,8 +49,8 @@ grpc_auth_json_key grpc_auth_json_key_create_from_string(
/* Creates a json_key object from parsed json. Returns an invalid object if a
parsing error has been encountered. */
-grpc_auth_json_key grpc_auth_json_key_create_from_json(
- const grpc_core::Json& json);
+grpc_auth_json_key grpc_auth_json_key_create_from_json(
+ const grpc_core::Json& json);
/* Destructs the object. */
void grpc_auth_json_key_destruct(grpc_auth_json_key* json_key);
diff --git a/contrib/libs/grpc/src/core/lib/security/credentials/jwt/jwt_credentials.cc b/contrib/libs/grpc/src/core/lib/security/credentials/jwt/jwt_credentials.cc
index aec34cf109c..d5555c3aa16 100644
--- a/contrib/libs/grpc/src/core/lib/security/credentials/jwt/jwt_credentials.cc
+++ b/contrib/libs/grpc/src/core/lib/security/credentials/jwt/jwt_credentials.cc
@@ -23,13 +23,13 @@
#include <inttypes.h>
#include <string.h>
-#include <util/generic/string.h>
-
-#include "y_absl/strings/str_cat.h"
-
+#include <util/generic/string.h>
+
+#include "y_absl/strings/str_cat.h"
+
#include "src/core/lib/gprpp/ref_counted.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
-#include "src/core/lib/slice/slice_internal.h"
+#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/surface/api_trace.h"
#include <grpc/support/alloc.h>
@@ -37,8 +37,8 @@
#include <grpc/support/string_util.h>
#include <grpc/support/sync.h>
-using grpc_core::Json;
-
+using grpc_core::Json;
+
void grpc_service_account_jwt_access_credentials::reset_cache() {
GRPC_MDELEM_UNREF(cached_.jwt_md);
cached_.jwt_md = GRPC_MDNULL;
@@ -86,14 +86,14 @@ bool grpc_service_account_jwt_access_credentials::get_request_metadata(
jwt = grpc_jwt_encode_and_sign(&key_, context.service_url, jwt_lifetime_,
nullptr);
if (jwt != nullptr) {
- TString md_value = y_absl::StrCat("Bearer ", jwt);
+ TString md_value = y_absl::StrCat("Bearer ", jwt);
gpr_free(jwt);
cached_.jwt_expiration =
gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), jwt_lifetime_);
cached_.service_url = gpr_strdup(context.service_url);
cached_.jwt_md = grpc_mdelem_from_slices(
grpc_slice_from_static_string(GRPC_AUTHORIZATION_METADATA_KEY),
- grpc_slice_from_cpp_string(std::move(md_value)));
+ grpc_slice_from_cpp_string(std::move(md_value)));
jwt_md = GRPC_MDELEM_REF(cached_.jwt_md);
}
gpr_mu_unlock(&cache_mu_);
@@ -141,14 +141,14 @@ grpc_service_account_jwt_access_credentials_create_from_auth_json_key(
}
static char* redact_private_key(const char* json_key) {
- grpc_error* error = GRPC_ERROR_NONE;
- Json json = Json::Parse(json_key, &error);
- if (error != GRPC_ERROR_NONE || json.type() != Json::Type::OBJECT) {
- GRPC_ERROR_UNREF(error);
+ grpc_error* error = GRPC_ERROR_NONE;
+ Json json = Json::Parse(json_key, &error);
+ if (error != GRPC_ERROR_NONE || json.type() != Json::Type::OBJECT) {
+ GRPC_ERROR_UNREF(error);
return gpr_strdup("<Json failed to parse.>");
}
- (*json.mutable_object())["private_key"] = "<redacted>";
- return gpr_strdup(json.Dump(/*indent=*/2).c_str());
+ (*json.mutable_object())["private_key"] = "<redacted>";
+ return gpr_strdup(json.Dump(/*indent=*/2).c_str());
}
grpc_call_credentials* grpc_service_account_jwt_access_credentials_create(
diff --git a/contrib/libs/grpc/src/core/lib/security/credentials/jwt/jwt_credentials.h b/contrib/libs/grpc/src/core/lib/security/credentials/jwt/jwt_credentials.h
index 949b1905c0b..9b60deacb5b 100644
--- a/contrib/libs/grpc/src/core/lib/security/credentials/jwt/jwt_credentials.h
+++ b/contrib/libs/grpc/src/core/lib/security/credentials/jwt/jwt_credentials.h
@@ -21,12 +21,12 @@
#include <grpc/support/port_platform.h>
-#include <util/generic/string.h>
-
-#include <grpc/support/time.h>
-
-#include "y_absl/strings/str_format.h"
-#include "y_absl/time/time.h"
+#include <util/generic/string.h>
+
+#include <grpc/support/time.h>
+
+#include "y_absl/strings/str_format.h"
+#include "y_absl/time/time.h"
#include "src/core/lib/security/credentials/credentials.h"
#include "src/core/lib/security/credentials/jwt/json_token.h"
@@ -49,12 +49,12 @@ class grpc_service_account_jwt_access_credentials
const gpr_timespec& jwt_lifetime() const { return jwt_lifetime_; }
const grpc_auth_json_key& key() const { return key_; }
- TString debug_string() override {
- return y_absl::StrFormat("JWTAccessCredentials{ExpirationTime:%s}",
- y_absl::FormatTime(y_absl::FromUnixMicros(
- gpr_timespec_to_micros(jwt_lifetime_))));
- };
-
+ TString debug_string() override {
+ return y_absl::StrFormat("JWTAccessCredentials{ExpirationTime:%s}",
+ y_absl::FormatTime(y_absl::FromUnixMicros(
+ gpr_timespec_to_micros(jwt_lifetime_))));
+ };
+
private:
void reset_cache();
diff --git a/contrib/libs/grpc/src/core/lib/security/credentials/jwt/jwt_verifier.cc b/contrib/libs/grpc/src/core/lib/security/credentials/jwt/jwt_verifier.cc
index 32573ab98db..0c9e118826f 100644
--- a/contrib/libs/grpc/src/core/lib/security/credentials/jwt/jwt_verifier.cc
+++ b/contrib/libs/grpc/src/core/lib/security/credentials/jwt/jwt_verifier.cc
@@ -35,15 +35,15 @@ extern "C" {
}
#include "src/core/lib/gpr/string.h"
-#include "src/core/lib/gprpp/manual_constructor.h"
+#include "src/core/lib/gprpp/manual_constructor.h"
#include "src/core/lib/http/httpcli.h"
#include "src/core/lib/iomgr/polling_entity.h"
#include "src/core/lib/slice/b64.h"
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/tsi/ssl_types.h"
-using grpc_core::Json;
-
+using grpc_core::Json;
+
/* --- Utils. --- */
const char* grpc_jwt_verifier_status_to_string(
@@ -80,39 +80,39 @@ static const EVP_MD* evp_md_from_alg(const char* alg) {
}
}
-static Json parse_json_part_from_jwt(const char* str, size_t len) {
- grpc_slice slice = grpc_base64_decode_with_len(str, len, 1);
- if (GRPC_SLICE_IS_EMPTY(slice)) {
+static Json parse_json_part_from_jwt(const char* str, size_t len) {
+ grpc_slice slice = grpc_base64_decode_with_len(str, len, 1);
+ if (GRPC_SLICE_IS_EMPTY(slice)) {
gpr_log(GPR_ERROR, "Invalid base64.");
- return Json(); // JSON null
+ return Json(); // JSON null
}
- y_absl::string_view string = grpc_core::StringViewFromSlice(slice);
- grpc_error* error = GRPC_ERROR_NONE;
- Json json = Json::Parse(string, &error);
- if (error != GRPC_ERROR_NONE) {
- gpr_log(GPR_ERROR, "JSON parse error: %s", grpc_error_string(error));
- GRPC_ERROR_UNREF(error);
- json = Json(); // JSON null
+ y_absl::string_view string = grpc_core::StringViewFromSlice(slice);
+ grpc_error* error = GRPC_ERROR_NONE;
+ Json json = Json::Parse(string, &error);
+ if (error != GRPC_ERROR_NONE) {
+ gpr_log(GPR_ERROR, "JSON parse error: %s", grpc_error_string(error));
+ GRPC_ERROR_UNREF(error);
+ json = Json(); // JSON null
}
- grpc_slice_unref_internal(slice);
+ grpc_slice_unref_internal(slice);
return json;
}
-static const char* validate_string_field(const Json& json, const char* key) {
- if (json.type() != Json::Type::STRING) {
- gpr_log(GPR_ERROR, "Invalid %s field", key);
+static const char* validate_string_field(const Json& json, const char* key) {
+ if (json.type() != Json::Type::STRING) {
+ gpr_log(GPR_ERROR, "Invalid %s field", key);
return nullptr;
}
- return json.string_value().c_str();
+ return json.string_value().c_str();
}
-static gpr_timespec validate_time_field(const Json& json, const char* key) {
+static gpr_timespec validate_time_field(const Json& json, const char* key) {
gpr_timespec result = gpr_time_0(GPR_CLOCK_REALTIME);
- if (json.type() != Json::Type::NUMBER) {
- gpr_log(GPR_ERROR, "Invalid %s field", key);
+ if (json.type() != Json::Type::NUMBER) {
+ gpr_log(GPR_ERROR, "Invalid %s field", key);
return result;
}
- result.tv_sec = strtol(json.string_value().c_str(), nullptr, 10);
+ result.tv_sec = strtol(json.string_value().c_str(), nullptr, 10);
return result;
}
@@ -123,51 +123,51 @@ struct jose_header {
const char* kid;
const char* typ;
/* TODO(jboeuf): Add others as needed (jku, jwk, x5u, x5c and so on...). */
- grpc_core::ManualConstructor<Json> json;
+ grpc_core::ManualConstructor<Json> json;
};
static void jose_header_destroy(jose_header* h) {
- h->json.Destroy();
+ h->json.Destroy();
gpr_free(h);
}
-static jose_header* jose_header_from_json(Json json) {
- const char* alg_value;
- Json::Object::const_iterator it;
+static jose_header* jose_header_from_json(Json json) {
+ const char* alg_value;
+ Json::Object::const_iterator it;
jose_header* h = static_cast<jose_header*>(gpr_zalloc(sizeof(jose_header)));
- if (json.type() != Json::Type::OBJECT) {
- gpr_log(GPR_ERROR, "JSON value is not an object");
- goto error;
+ if (json.type() != Json::Type::OBJECT) {
+ gpr_log(GPR_ERROR, "JSON value is not an object");
+ goto error;
}
- // Check alg field.
- it = json.object_value().find("alg");
- if (it == json.object_value().end()) {
+ // Check alg field.
+ it = json.object_value().find("alg");
+ if (it == json.object_value().end()) {
gpr_log(GPR_ERROR, "Missing alg field.");
goto error;
}
- /* We only support RSA-1.5 signatures for now.
- Beware of this if we add HMAC support:
- https://auth0.com/blog/2015/03/31/critical-vulnerabilities-in-json-web-token-libraries/
- */
- alg_value = it->second.string_value().c_str();
- if (it->second.type() != Json::Type::STRING || strncmp(alg_value, "RS", 2) ||
- evp_md_from_alg(alg_value) == nullptr) {
- gpr_log(GPR_ERROR, "Invalid alg field");
- goto error;
- }
- h->alg = alg_value;
- // Check typ field.
- it = json.object_value().find("typ");
- if (it != json.object_value().end()) {
- h->typ = validate_string_field(it->second, "typ");
- if (h->typ == nullptr) goto error;
- }
- // Check kid field.
- it = json.object_value().find("kid");
- if (it != json.object_value().end()) {
- h->kid = validate_string_field(it->second, "kid");
- if (h->kid == nullptr) goto error;
- }
- h->json.Init(std::move(json));
+ /* We only support RSA-1.5 signatures for now.
+ Beware of this if we add HMAC support:
+ https://auth0.com/blog/2015/03/31/critical-vulnerabilities-in-json-web-token-libraries/
+ */
+ alg_value = it->second.string_value().c_str();
+ if (it->second.type() != Json::Type::STRING || strncmp(alg_value, "RS", 2) ||
+ evp_md_from_alg(alg_value) == nullptr) {
+ gpr_log(GPR_ERROR, "Invalid alg field");
+ goto error;
+ }
+ h->alg = alg_value;
+ // Check typ field.
+ it = json.object_value().find("typ");
+ if (it != json.object_value().end()) {
+ h->typ = validate_string_field(it->second, "typ");
+ if (h->typ == nullptr) goto error;
+ }
+ // Check kid field.
+ it = json.object_value().find("kid");
+ if (it != json.object_value().end()) {
+ h->kid = validate_string_field(it->second, "kid");
+ if (h->kid == nullptr) goto error;
+ }
+ h->json.Init(std::move(json));
return h;
error:
@@ -187,17 +187,17 @@ struct grpc_jwt_claims {
gpr_timespec exp;
gpr_timespec nbf;
- grpc_core::ManualConstructor<Json> json;
+ grpc_core::ManualConstructor<Json> json;
};
void grpc_jwt_claims_destroy(grpc_jwt_claims* claims) {
- claims->json.Destroy();
+ claims->json.Destroy();
gpr_free(claims);
}
-const Json* grpc_jwt_claims_json(const grpc_jwt_claims* claims) {
+const Json* grpc_jwt_claims_json(const grpc_jwt_claims* claims) {
if (claims == nullptr) return nullptr;
- return claims->json.get();
+ return claims->json.get();
}
const char* grpc_jwt_claims_subject(const grpc_jwt_claims* claims) {
@@ -235,43 +235,43 @@ gpr_timespec grpc_jwt_claims_not_before(const grpc_jwt_claims* claims) {
return claims->nbf;
}
-grpc_jwt_claims* grpc_jwt_claims_from_json(Json json) {
+grpc_jwt_claims* grpc_jwt_claims_from_json(Json json) {
grpc_jwt_claims* claims =
- static_cast<grpc_jwt_claims*>(gpr_zalloc(sizeof(grpc_jwt_claims)));
- claims->json.Init(std::move(json));
+ static_cast<grpc_jwt_claims*>(gpr_zalloc(sizeof(grpc_jwt_claims)));
+ claims->json.Init(std::move(json));
claims->iat = gpr_inf_past(GPR_CLOCK_REALTIME);
claims->nbf = gpr_inf_past(GPR_CLOCK_REALTIME);
claims->exp = gpr_inf_future(GPR_CLOCK_REALTIME);
/* Per the spec, all fields are optional. */
- for (const auto& p : claims->json->object_value()) {
- if (p.first == "sub") {
- claims->sub = validate_string_field(p.second, "sub");
+ for (const auto& p : claims->json->object_value()) {
+ if (p.first == "sub") {
+ claims->sub = validate_string_field(p.second, "sub");
if (claims->sub == nullptr) goto error;
- } else if (p.first == "iss") {
- claims->iss = validate_string_field(p.second, "iss");
+ } else if (p.first == "iss") {
+ claims->iss = validate_string_field(p.second, "iss");
if (claims->iss == nullptr) goto error;
- } else if (p.first == "aud") {
- claims->aud = validate_string_field(p.second, "aud");
+ } else if (p.first == "aud") {
+ claims->aud = validate_string_field(p.second, "aud");
if (claims->aud == nullptr) goto error;
- } else if (p.first == "jti") {
- claims->jti = validate_string_field(p.second, "jti");
+ } else if (p.first == "jti") {
+ claims->jti = validate_string_field(p.second, "jti");
if (claims->jti == nullptr) goto error;
- } else if (p.first == "iat") {
- claims->iat = validate_time_field(p.second, "iat");
- if (gpr_time_cmp(claims->iat, gpr_time_0(GPR_CLOCK_REALTIME)) == 0) {
+ } else if (p.first == "iat") {
+ claims->iat = validate_time_field(p.second, "iat");
+ if (gpr_time_cmp(claims->iat, gpr_time_0(GPR_CLOCK_REALTIME)) == 0) {
goto error;
- }
- } else if (p.first == "exp") {
- claims->exp = validate_time_field(p.second, "exp");
- if (gpr_time_cmp(claims->exp, gpr_time_0(GPR_CLOCK_REALTIME)) == 0) {
+ }
+ } else if (p.first == "exp") {
+ claims->exp = validate_time_field(p.second, "exp");
+ if (gpr_time_cmp(claims->exp, gpr_time_0(GPR_CLOCK_REALTIME)) == 0) {
goto error;
- }
- } else if (p.first == "nbf") {
- claims->nbf = validate_time_field(p.second, "nbf");
- if (gpr_time_cmp(claims->nbf, gpr_time_0(GPR_CLOCK_REALTIME)) == 0) {
+ }
+ } else if (p.first == "nbf") {
+ claims->nbf = validate_time_field(p.second, "nbf");
+ if (gpr_time_cmp(claims->nbf, gpr_time_0(GPR_CLOCK_REALTIME)) == 0) {
goto error;
- }
+ }
}
}
return claims;
@@ -334,7 +334,7 @@ typedef enum {
HTTP_RESPONSE_COUNT /* must be last */
} http_response_index;
-struct verifier_cb_ctx {
+struct verifier_cb_ctx {
grpc_jwt_verifier* verifier;
grpc_polling_entity pollent;
jose_header* header;
@@ -345,7 +345,7 @@ struct verifier_cb_ctx {
void* user_data;
grpc_jwt_verification_done_cb user_cb;
grpc_http_response responses[HTTP_RESPONSE_COUNT];
-};
+};
/* Takes ownership of the header, claims and signature. */
static verifier_cb_ctx* verifier_cb_ctx_create(
grpc_jwt_verifier* verifier, grpc_pollset* pollset, jose_header* header,
@@ -390,10 +390,10 @@ gpr_timespec grpc_jwt_verifier_clock_skew = {60, 0, GPR_TIMESPAN};
/* Max delay defaults to one minute. */
grpc_millis grpc_jwt_verifier_max_delay = 60 * GPR_MS_PER_SEC;
-struct email_key_mapping {
+struct email_key_mapping {
char* email_domain;
char* key_url_prefix;
-};
+};
struct grpc_jwt_verifier {
email_key_mapping* mappings;
size_t num_mappings; /* Should be very few, linear search ok. */
@@ -401,32 +401,32 @@ struct grpc_jwt_verifier {
grpc_httpcli_context http_ctx;
};
-static Json json_from_http(const grpc_httpcli_response* response) {
+static Json json_from_http(const grpc_httpcli_response* response) {
if (response == nullptr) {
gpr_log(GPR_ERROR, "HTTP response is NULL.");
- return Json(); // JSON null
+ return Json(); // JSON null
}
if (response->status != 200) {
gpr_log(GPR_ERROR, "Call to http server failed with error %d.",
response->status);
- return Json(); // JSON null
+ return Json(); // JSON null
}
- grpc_error* error = GRPC_ERROR_NONE;
- Json json = Json::Parse(
- y_absl::string_view(response->body, response->body_length), &error);
- if (error != GRPC_ERROR_NONE) {
+ grpc_error* error = GRPC_ERROR_NONE;
+ Json json = Json::Parse(
+ y_absl::string_view(response->body, response->body_length), &error);
+ if (error != GRPC_ERROR_NONE) {
gpr_log(GPR_ERROR, "Invalid JSON found in response.");
- return Json(); // JSON null
+ return Json(); // JSON null
}
return json;
}
-static const Json* find_property_by_name(const Json& json, const char* name) {
- auto it = json.object_value().find(name);
- if (it == json.object_value().end()) {
- return nullptr;
+static const Json* find_property_by_name(const Json& json, const char* name) {
+ auto it = json.object_value().find(name);
+ if (it == json.object_value().end()) {
+ return nullptr;
}
- return &it->second;
+ return &it->second;
}
static EVP_PKEY* extract_pkey_from_x509(const char* x509_str) {
@@ -497,15 +497,15 @@ static int RSA_set0_key(RSA* r, BIGNUM* n, BIGNUM* e, BIGNUM* d) {
}
#endif // OPENSSL_VERSION_NUMBER < 0x10100000L
-static EVP_PKEY* pkey_from_jwk(const Json& json, const char* kty) {
+static EVP_PKEY* pkey_from_jwk(const Json& json, const char* kty) {
RSA* rsa = nullptr;
EVP_PKEY* result = nullptr;
BIGNUM* tmp_n = nullptr;
BIGNUM* tmp_e = nullptr;
- Json::Object::const_iterator it;
+ Json::Object::const_iterator it;
- GPR_ASSERT(json.type() == Json::Type::OBJECT);
- GPR_ASSERT(kty != nullptr);
+ GPR_ASSERT(json.type() == Json::Type::OBJECT);
+ GPR_ASSERT(kty != nullptr);
if (strcmp(kty, "RSA") != 0) {
gpr_log(GPR_ERROR, "Unsupported key type %s.", kty);
goto end;
@@ -515,20 +515,20 @@ static EVP_PKEY* pkey_from_jwk(const Json& json, const char* kty) {
gpr_log(GPR_ERROR, "Could not create rsa key.");
goto end;
}
- it = json.object_value().find("n");
- if (it == json.object_value().end()) {
- gpr_log(GPR_ERROR, "Missing RSA public key field.");
- goto end;
+ it = json.object_value().find("n");
+ if (it == json.object_value().end()) {
+ gpr_log(GPR_ERROR, "Missing RSA public key field.");
+ goto end;
}
- tmp_n = bignum_from_base64(validate_string_field(it->second, "n"));
- if (tmp_n == nullptr) goto end;
- it = json.object_value().find("e");
- if (it == json.object_value().end()) {
+ tmp_n = bignum_from_base64(validate_string_field(it->second, "n"));
+ if (tmp_n == nullptr) goto end;
+ it = json.object_value().find("e");
+ if (it == json.object_value().end()) {
gpr_log(GPR_ERROR, "Missing RSA public key field.");
goto end;
}
- tmp_e = bignum_from_base64(validate_string_field(it->second, "e"));
- if (tmp_e == nullptr) goto end;
+ tmp_e = bignum_from_base64(validate_string_field(it->second, "e"));
+ if (tmp_e == nullptr) goto end;
if (!RSA_set0_key(rsa, tmp_n, tmp_e, nullptr)) {
gpr_log(GPR_ERROR, "Cannot set RSA key from inputs.");
goto end;
@@ -546,41 +546,41 @@ end:
return result;
}
-static EVP_PKEY* find_verification_key(const Json& json, const char* header_alg,
+static EVP_PKEY* find_verification_key(const Json& json, const char* header_alg,
const char* header_kid) {
/* Try to parse the json as a JWK set:
https://tools.ietf.org/html/rfc7517#section-5. */
- const Json* jwt_keys = find_property_by_name(json, "keys");
- if (jwt_keys == nullptr) {
+ const Json* jwt_keys = find_property_by_name(json, "keys");
+ if (jwt_keys == nullptr) {
/* Use the google proprietary format which is:
{ <kid1>: <x5091>, <kid2>: <x5092>, ... } */
- const Json* cur = find_property_by_name(json, header_kid);
+ const Json* cur = find_property_by_name(json, header_kid);
if (cur == nullptr) return nullptr;
- return extract_pkey_from_x509(cur->string_value().c_str());
+ return extract_pkey_from_x509(cur->string_value().c_str());
}
- if (jwt_keys->type() != Json::Type::ARRAY) {
+ if (jwt_keys->type() != Json::Type::ARRAY) {
gpr_log(GPR_ERROR,
"Unexpected value type of keys property in jwks key set.");
return nullptr;
}
/* Key format is specified in:
https://tools.ietf.org/html/rfc7518#section-6. */
- for (const Json& jkey : jwt_keys->array_value()) {
- if (jkey.type() != Json::Type::OBJECT) continue;
+ for (const Json& jkey : jwt_keys->array_value()) {
+ if (jkey.type() != Json::Type::OBJECT) continue;
const char* alg = nullptr;
- auto it = jkey.object_value().find("alg");
- if (it != jkey.object_value().end()) {
- alg = validate_string_field(it->second, "alg");
- }
+ auto it = jkey.object_value().find("alg");
+ if (it != jkey.object_value().end()) {
+ alg = validate_string_field(it->second, "alg");
+ }
const char* kid = nullptr;
- it = jkey.object_value().find("kid");
- if (it != jkey.object_value().end()) {
- kid = validate_string_field(it->second, "kid");
- }
+ it = jkey.object_value().find("kid");
+ if (it != jkey.object_value().end()) {
+ kid = validate_string_field(it->second, "kid");
+ }
const char* kty = nullptr;
- it = jkey.object_value().find("kty");
- if (it != jkey.object_value().end()) {
- kty = validate_string_field(it->second, "kty");
+ it = jkey.object_value().find("kty");
+ if (it != jkey.object_value().end()) {
+ kty = validate_string_field(it->second, "kty");
}
if (alg != nullptr && kid != nullptr && kty != nullptr &&
strcmp(kid, header_kid) == 0 && strcmp(alg, header_alg) == 0) {
@@ -628,12 +628,12 @@ end:
static void on_keys_retrieved(void* user_data, grpc_error* /*error*/) {
verifier_cb_ctx* ctx = static_cast<verifier_cb_ctx*>(user_data);
- Json json = json_from_http(&ctx->responses[HTTP_RESPONSE_KEYS]);
+ Json json = json_from_http(&ctx->responses[HTTP_RESPONSE_KEYS]);
EVP_PKEY* verification_key = nullptr;
grpc_jwt_verifier_status status = GRPC_JWT_VERIFIER_GENERIC_ERROR;
grpc_jwt_claims* claims = nullptr;
- if (json.type() == Json::Type::JSON_NULL) {
+ if (json.type() == Json::Type::JSON_NULL) {
status = GRPC_JWT_VERIFIER_KEY_RETRIEVAL_ERROR;
goto end;
}
@@ -668,20 +668,20 @@ end:
static void on_openid_config_retrieved(void* user_data, grpc_error* /*error*/) {
verifier_cb_ctx* ctx = static_cast<verifier_cb_ctx*>(user_data);
const grpc_http_response* response = &ctx->responses[HTTP_RESPONSE_OPENID];
- Json json = json_from_http(response);
+ Json json = json_from_http(response);
grpc_httpcli_request req;
const char* jwks_uri;
grpc_resource_quota* resource_quota = nullptr;
- const Json* cur;
+ const Json* cur;
/* TODO(jboeuf): Cache the jwks_uri in order to avoid this hop next time. */
- if (json.type() == Json::Type::JSON_NULL) goto error;
+ if (json.type() == Json::Type::JSON_NULL) goto error;
cur = find_property_by_name(json, "jwks_uri");
if (cur == nullptr) {
gpr_log(GPR_ERROR, "Could not find jwks_uri in openid config.");
goto error;
}
- jwks_uri = validate_string_field(*cur, "jwks_uri");
+ jwks_uri = validate_string_field(*cur, "jwks_uri");
if (jwks_uri == nullptr) goto error;
if (strstr(jwks_uri, "https://") != jwks_uri) {
gpr_log(GPR_ERROR, "Invalid non https jwks_uri: %s.", jwks_uri);
@@ -852,23 +852,23 @@ void grpc_jwt_verifier_verify(grpc_jwt_verifier* verifier,
grpc_slice signature;
size_t signed_jwt_len;
const char* cur = jwt;
- Json json;
+ Json json;
GPR_ASSERT(verifier != nullptr && jwt != nullptr && audience != nullptr &&
cb != nullptr);
dot = strchr(cur, '.');
if (dot == nullptr) goto error;
- json = parse_json_part_from_jwt(cur, static_cast<size_t>(dot - cur));
- if (json.type() == Json::Type::JSON_NULL) goto error;
- header = jose_header_from_json(std::move(json));
+ json = parse_json_part_from_jwt(cur, static_cast<size_t>(dot - cur));
+ if (json.type() == Json::Type::JSON_NULL) goto error;
+ header = jose_header_from_json(std::move(json));
if (header == nullptr) goto error;
cur = dot + 1;
dot = strchr(cur, '.');
if (dot == nullptr) goto error;
- json = parse_json_part_from_jwt(cur, static_cast<size_t>(dot - cur));
- if (json.type() == Json::Type::JSON_NULL) goto error;
- claims = grpc_jwt_claims_from_json(std::move(json));
+ json = parse_json_part_from_jwt(cur, static_cast<size_t>(dot - cur));
+ if (json.type() == Json::Type::JSON_NULL) goto error;
+ claims = grpc_jwt_claims_from_json(std::move(json));
if (claims == nullptr) goto error;
signed_jwt_len = static_cast<size_t>(dot - jwt);
diff --git a/contrib/libs/grpc/src/core/lib/security/credentials/jwt/jwt_verifier.h b/contrib/libs/grpc/src/core/lib/security/credentials/jwt/jwt_verifier.h
index 4a799b16018..66ddbf2206b 100644
--- a/contrib/libs/grpc/src/core/lib/security/credentials/jwt/jwt_verifier.h
+++ b/contrib/libs/grpc/src/core/lib/security/credentials/jwt/jwt_verifier.h
@@ -56,7 +56,7 @@ typedef struct grpc_jwt_claims grpc_jwt_claims;
void grpc_jwt_claims_destroy(grpc_jwt_claims* claims);
/* Returns the whole JSON tree of the claims. */
-const grpc_core::Json* grpc_jwt_claims_json(const grpc_jwt_claims* claims);
+const grpc_core::Json* grpc_jwt_claims_json(const grpc_jwt_claims* claims);
/* Access to registered claims in https://tools.ietf.org/html/rfc7519#page-9 */
const char* grpc_jwt_claims_subject(const grpc_jwt_claims* claims);
@@ -114,7 +114,7 @@ void grpc_jwt_verifier_verify(grpc_jwt_verifier* verifier,
/* --- TESTING ONLY exposed functions. --- */
-grpc_jwt_claims* grpc_jwt_claims_from_json(grpc_core::Json json);
+grpc_jwt_claims* grpc_jwt_claims_from_json(grpc_core::Json json);
grpc_jwt_verifier_status grpc_jwt_claims_check(const grpc_jwt_claims* claims,
const char* audience);
const char* grpc_jwt_issuer_email_domain(const char* issuer);
diff --git a/contrib/libs/grpc/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc b/contrib/libs/grpc/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc
index bd1204e5c6a..552ee37cfcf 100644
--- a/contrib/libs/grpc/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc
+++ b/contrib/libs/grpc/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc
@@ -23,11 +23,11 @@
#include <string.h>
-#include "y_absl/container/inlined_vector.h"
-#include "y_absl/strings/str_cat.h"
-#include "y_absl/strings/str_format.h"
-#include "y_absl/strings/str_join.h"
-
+#include "y_absl/container/inlined_vector.h"
+#include "y_absl/strings/str_cat.h"
+#include "y_absl/strings/str_format.h"
+#include "y_absl/strings/str_join.h"
+
#include <grpc/grpc_security.h>
#include <grpc/impl/codegen/slice.h>
#include <grpc/slice.h>
@@ -44,8 +44,8 @@
#include "src/core/lib/surface/api_trace.h"
#include "src/core/lib/uri/uri_parser.h"
-using grpc_core::Json;
-
+using grpc_core::Json;
+
//
// Auth Refresh Token.
//
@@ -57,7 +57,7 @@ int grpc_auth_refresh_token_is_valid(
}
grpc_auth_refresh_token grpc_auth_refresh_token_create_from_json(
- const Json& json) {
+ const Json& json) {
grpc_auth_refresh_token result;
const char* prop_value;
int success = 0;
@@ -65,7 +65,7 @@ grpc_auth_refresh_token grpc_auth_refresh_token_create_from_json(
memset(&result, 0, sizeof(grpc_auth_refresh_token));
result.type = GRPC_AUTH_JSON_TYPE_INVALID;
- if (json.type() != Json::Type::OBJECT) {
+ if (json.type() != Json::Type::OBJECT) {
gpr_log(GPR_ERROR, "Invalid json.");
goto end;
}
@@ -94,13 +94,13 @@ end:
grpc_auth_refresh_token grpc_auth_refresh_token_create_from_string(
const char* json_string) {
- grpc_error* error = GRPC_ERROR_NONE;
- Json json = Json::Parse(json_string, &error);
- if (error != GRPC_ERROR_NONE) {
- gpr_log(GPR_ERROR, "JSON parsing failed: %s", grpc_error_string(error));
- GRPC_ERROR_UNREF(error);
- }
- return grpc_auth_refresh_token_create_from_json(json);
+ grpc_error* error = GRPC_ERROR_NONE;
+ Json json = Json::Parse(json_string, &error);
+ if (error != GRPC_ERROR_NONE) {
+ gpr_log(GPR_ERROR, "JSON parsing failed: %s", grpc_error_string(error));
+ GRPC_ERROR_UNREF(error);
+ }
+ return grpc_auth_refresh_token_create_from_json(json);
}
void grpc_auth_refresh_token_destruct(grpc_auth_refresh_token* refresh_token) {
@@ -138,7 +138,7 @@ grpc_oauth2_token_fetcher_credentials_parse_server_response(
grpc_millis* token_lifetime) {
char* null_terminated_body = nullptr;
grpc_credentials_status status = GRPC_CREDENTIALS_OK;
- Json json;
+ Json json;
if (response == nullptr) {
gpr_log(GPR_ERROR, "Received NULL response.");
@@ -160,54 +160,54 @@ grpc_oauth2_token_fetcher_credentials_parse_server_response(
status = GRPC_CREDENTIALS_ERROR;
goto end;
} else {
- const char* access_token = nullptr;
- const char* token_type = nullptr;
- const char* expires_in = nullptr;
- Json::Object::const_iterator it;
- grpc_error* error = GRPC_ERROR_NONE;
- json = Json::Parse(null_terminated_body, &error);
- if (error != GRPC_ERROR_NONE) {
- gpr_log(GPR_ERROR, "Could not parse JSON from %s: %s",
- null_terminated_body, grpc_error_string(error));
- GRPC_ERROR_UNREF(error);
+ const char* access_token = nullptr;
+ const char* token_type = nullptr;
+ const char* expires_in = nullptr;
+ Json::Object::const_iterator it;
+ grpc_error* error = GRPC_ERROR_NONE;
+ json = Json::Parse(null_terminated_body, &error);
+ if (error != GRPC_ERROR_NONE) {
+ gpr_log(GPR_ERROR, "Could not parse JSON from %s: %s",
+ null_terminated_body, grpc_error_string(error));
+ GRPC_ERROR_UNREF(error);
status = GRPC_CREDENTIALS_ERROR;
goto end;
}
- if (json.type() != Json::Type::OBJECT) {
+ if (json.type() != Json::Type::OBJECT) {
gpr_log(GPR_ERROR, "Response should be a JSON object");
status = GRPC_CREDENTIALS_ERROR;
goto end;
}
- it = json.object_value().find("access_token");
- if (it == json.object_value().end() ||
- it->second.type() != Json::Type::STRING) {
+ it = json.object_value().find("access_token");
+ if (it == json.object_value().end() ||
+ it->second.type() != Json::Type::STRING) {
gpr_log(GPR_ERROR, "Missing or invalid access_token in JSON.");
status = GRPC_CREDENTIALS_ERROR;
goto end;
}
- access_token = it->second.string_value().c_str();
- it = json.object_value().find("token_type");
- if (it == json.object_value().end() ||
- it->second.type() != Json::Type::STRING) {
+ access_token = it->second.string_value().c_str();
+ it = json.object_value().find("token_type");
+ if (it == json.object_value().end() ||
+ it->second.type() != Json::Type::STRING) {
gpr_log(GPR_ERROR, "Missing or invalid token_type in JSON.");
status = GRPC_CREDENTIALS_ERROR;
goto end;
}
- token_type = it->second.string_value().c_str();
- it = json.object_value().find("expires_in");
- if (it == json.object_value().end() ||
- it->second.type() != Json::Type::NUMBER) {
+ token_type = it->second.string_value().c_str();
+ it = json.object_value().find("expires_in");
+ if (it == json.object_value().end() ||
+ it->second.type() != Json::Type::NUMBER) {
gpr_log(GPR_ERROR, "Missing or invalid expires_in in JSON.");
status = GRPC_CREDENTIALS_ERROR;
goto end;
}
- expires_in = it->second.string_value().c_str();
- *token_lifetime = strtol(expires_in, nullptr, 10) * GPR_MS_PER_SEC;
+ expires_in = it->second.string_value().c_str();
+ *token_lifetime = strtol(expires_in, nullptr, 10) * GPR_MS_PER_SEC;
if (!GRPC_MDISNULL(*token_md)) GRPC_MDELEM_UNREF(*token_md);
*token_md = grpc_mdelem_from_slices(
grpc_core::ExternallyManagedSlice(GRPC_AUTHORIZATION_METADATA_KEY),
- grpc_slice_from_cpp_string(
- y_absl::StrCat(token_type, " ", access_token)));
+ grpc_slice_from_cpp_string(
+ y_absl::StrCat(token_type, " ", access_token)));
status = GRPC_CREDENTIALS_OK;
}
@@ -216,7 +216,7 @@ end:
GRPC_MDELEM_UNREF(*token_md);
*token_md = GRPC_MDNULL;
}
- gpr_free(null_terminated_body);
+ gpr_free(null_terminated_body);
return status;
}
@@ -360,10 +360,10 @@ grpc_oauth2_token_fetcher_credentials::grpc_oauth2_token_fetcher_credentials()
grpc_httpcli_context_init(&httpcli_context_);
}
-TString grpc_oauth2_token_fetcher_credentials::debug_string() {
- return "OAuth2TokenFetcherCredentials";
-}
-
+TString grpc_oauth2_token_fetcher_credentials::debug_string() {
+ return "OAuth2TokenFetcherCredentials";
+}
+
//
// Google Compute Engine credentials.
//
@@ -402,12 +402,12 @@ class grpc_compute_engine_token_fetcher_credentials
grpc_resource_quota_unref_internal(resource_quota);
}
- TString debug_string() override {
- return y_absl::StrFormat(
- "GoogleComputeEngineTokenFetcherCredentials{%s}",
- grpc_oauth2_token_fetcher_credentials::debug_string());
- }
-
+ TString debug_string() override {
+ return y_absl::StrFormat(
+ "GoogleComputeEngineTokenFetcherCredentials{%s}",
+ grpc_oauth2_token_fetcher_credentials::debug_string());
+ }
+
private:
grpc_closure http_get_cb_closure_;
};
@@ -441,9 +441,9 @@ void grpc_google_refresh_token_credentials::fetch_oauth2(
const_cast<char*>("Content-Type"),
const_cast<char*>("application/x-www-form-urlencoded")};
grpc_httpcli_request request;
- TString body = y_absl::StrFormat(
- GRPC_REFRESH_TOKEN_POST_BODY_FORMAT_STRING, refresh_token_.client_id,
- refresh_token_.client_secret, refresh_token_.refresh_token);
+ TString body = y_absl::StrFormat(
+ GRPC_REFRESH_TOKEN_POST_BODY_FORMAT_STRING, refresh_token_.client_id,
+ refresh_token_.client_secret, refresh_token_.refresh_token);
memset(&request, 0, sizeof(grpc_httpcli_request));
request.host = (char*)GRPC_GOOGLE_OAUTH2_SERVICE_HOST;
request.http.path = (char*)GRPC_GOOGLE_OAUTH2_SERVICE_TOKEN_PATH;
@@ -455,8 +455,8 @@ void grpc_google_refresh_token_credentials::fetch_oauth2(
extreme memory pressure. */
grpc_resource_quota* resource_quota =
grpc_resource_quota_create("oauth2_credentials_refresh");
- grpc_httpcli_post(httpcli_context, pollent, resource_quota, &request,
- body.c_str(), body.size(), deadline,
+ grpc_httpcli_post(httpcli_context, pollent, resource_quota, &request,
+ body.c_str(), body.size(), deadline,
GRPC_CLOSURE_INIT(&http_post_cb_closure_, response_cb,
metadata_req, grpc_schedule_on_exec_ctx),
&metadata_req->response);
@@ -478,21 +478,21 @@ grpc_refresh_token_credentials_create_from_auth_refresh_token(
refresh_token);
}
-TString grpc_google_refresh_token_credentials::debug_string() {
- return y_absl::StrFormat("GoogleRefreshToken{ClientID:%s,%s}",
- refresh_token_.client_id,
- grpc_oauth2_token_fetcher_credentials::debug_string());
-}
-
-static TString create_loggable_refresh_token(
- grpc_auth_refresh_token* token) {
+TString grpc_google_refresh_token_credentials::debug_string() {
+ return y_absl::StrFormat("GoogleRefreshToken{ClientID:%s,%s}",
+ refresh_token_.client_id,
+ grpc_oauth2_token_fetcher_credentials::debug_string());
+}
+
+static TString create_loggable_refresh_token(
+ grpc_auth_refresh_token* token) {
if (strcmp(token->type, GRPC_AUTH_JSON_TYPE_INVALID) == 0) {
- return "<Invalid json token>";
+ return "<Invalid json token>";
}
- return y_absl::StrFormat(
- "{\n type: %s\n client_id: %s\n client_secret: "
- "<redacted>\n refresh_token: <redacted>\n}",
- token->type, token->client_id);
+ return y_absl::StrFormat(
+ "{\n type: %s\n client_id: %s\n client_secret: "
+ "<redacted>\n refresh_token: <redacted>\n}",
+ token->type, token->client_id);
}
grpc_call_credentials* grpc_google_refresh_token_credentials_create(
@@ -503,7 +503,7 @@ grpc_call_credentials* grpc_google_refresh_token_credentials_create(
gpr_log(GPR_INFO,
"grpc_refresh_token_credentials_create(json_refresh_token=%s, "
"reserved=%p)",
- create_loggable_refresh_token(&token).c_str(), reserved);
+ create_loggable_refresh_token(&token).c_str(), reserved);
}
GPR_ASSERT(reserved == nullptr);
return grpc_refresh_token_credentials_create_from_auth_refresh_token(token)
@@ -518,10 +518,10 @@ namespace grpc_core {
namespace {
-void MaybeAddToBody(const char* field_name, const char* field,
- std::vector<TString>* body) {
+void MaybeAddToBody(const char* field_name, const char* field,
+ std::vector<TString>* body) {
if (field == nullptr || strlen(field) == 0) return;
- body->push_back(y_absl::StrFormat("&%s=%s", field_name, field));
+ body->push_back(y_absl::StrFormat("&%s=%s", field_name, field));
}
grpc_error* LoadTokenFile(const char* path, gpr_slice* token) {
@@ -551,13 +551,13 @@ class StsTokenFetcherCredentials
~StsTokenFetcherCredentials() override { grpc_uri_destroy(sts_url_); }
- TString debug_string() override {
- return y_absl::StrFormat(
- "StsTokenFetcherCredentials{Path:%s,Authority:%s,%s}", sts_url_->path,
- sts_url_->authority,
- grpc_oauth2_token_fetcher_credentials::debug_string());
- }
-
+ TString debug_string() override {
+ return y_absl::StrFormat(
+ "StsTokenFetcherCredentials{Path:%s,Authority:%s,%s}", sts_url_->path,
+ sts_url_->authority,
+ grpc_oauth2_token_fetcher_credentials::debug_string());
+ }
+
private:
void fetch_oauth2(grpc_credentials_metadata_request* metadata_req,
grpc_httpcli_context* http_context,
@@ -601,17 +601,17 @@ class StsTokenFetcherCredentials
grpc_error* FillBody(char** body, size_t* body_length) {
*body = nullptr;
- std::vector<TString> body_parts;
+ std::vector<TString> body_parts;
grpc_slice subject_token = grpc_empty_slice();
grpc_slice actor_token = grpc_empty_slice();
grpc_error* err = GRPC_ERROR_NONE;
- auto cleanup = [&body, &body_length, &body_parts, &subject_token,
+ auto cleanup = [&body, &body_length, &body_parts, &subject_token,
&actor_token, &err]() {
if (err == GRPC_ERROR_NONE) {
- TString body_str = y_absl::StrJoin(body_parts, "");
- *body = gpr_strdup(body_str.c_str());
- *body_length = body_str.size();
+ TString body_str = y_absl::StrJoin(body_parts, "");
+ *body = gpr_strdup(body_str.c_str());
+ *body_length = body_str.size();
}
grpc_slice_unref_internal(subject_token);
grpc_slice_unref_internal(actor_token);
@@ -620,23 +620,23 @@ class StsTokenFetcherCredentials
err = LoadTokenFile(subject_token_path_.get(), &subject_token);
if (err != GRPC_ERROR_NONE) return cleanup();
- body_parts.push_back(y_absl::StrFormat(
- GRPC_STS_POST_MINIMAL_BODY_FORMAT_STRING,
+ body_parts.push_back(y_absl::StrFormat(
+ GRPC_STS_POST_MINIMAL_BODY_FORMAT_STRING,
reinterpret_cast<const char*>(GRPC_SLICE_START_PTR(subject_token)),
- subject_token_type_.get()));
- MaybeAddToBody("resource", resource_.get(), &body_parts);
- MaybeAddToBody("audience", audience_.get(), &body_parts);
- MaybeAddToBody("scope", scope_.get(), &body_parts);
- MaybeAddToBody("requested_token_type", requested_token_type_.get(),
- &body_parts);
- if ((actor_token_path_ != nullptr) && *actor_token_path_ != '\0') {
+ subject_token_type_.get()));
+ MaybeAddToBody("resource", resource_.get(), &body_parts);
+ MaybeAddToBody("audience", audience_.get(), &body_parts);
+ MaybeAddToBody("scope", scope_.get(), &body_parts);
+ MaybeAddToBody("requested_token_type", requested_token_type_.get(),
+ &body_parts);
+ if ((actor_token_path_ != nullptr) && *actor_token_path_ != '\0') {
err = LoadTokenFile(actor_token_path_.get(), &actor_token);
if (err != GRPC_ERROR_NONE) return cleanup();
MaybeAddToBody(
- "actor_token",
- reinterpret_cast<const char*>(GRPC_SLICE_START_PTR(actor_token)),
- &body_parts);
- MaybeAddToBody("actor_token_type", actor_token_type_.get(), &body_parts);
+ "actor_token",
+ reinterpret_cast<const char*>(GRPC_SLICE_START_PTR(actor_token)),
+ &body_parts);
+ MaybeAddToBody("actor_token_type", actor_token_type_.get(), &body_parts);
}
return cleanup();
}
@@ -661,7 +661,7 @@ grpc_error* ValidateStsCredentialsOptions(
void operator()(grpc_uri* uri) { grpc_uri_destroy(uri); }
};
*sts_url_out = nullptr;
- y_absl::InlinedVector<grpc_error*, 3> error_list;
+ y_absl::InlinedVector<grpc_error*, 3> error_list;
std::unique_ptr<grpc_uri, GrpcUriDeleter> sts_url(
options->token_exchange_service_uri != nullptr
? grpc_uri_parse(options->token_exchange_service_uri, false)
@@ -741,15 +741,15 @@ grpc_access_token_credentials::grpc_access_token_credentials(
grpc_core::ExecCtx exec_ctx;
access_token_md_ = grpc_mdelem_from_slices(
grpc_core::ExternallyManagedSlice(GRPC_AUTHORIZATION_METADATA_KEY),
- grpc_slice_from_cpp_string(y_absl::StrCat("Bearer ", access_token)));
+ grpc_slice_from_cpp_string(y_absl::StrCat("Bearer ", access_token)));
+}
+
+TString grpc_access_token_credentials::debug_string() {
+ bool access_token_present = !GRPC_MDISNULL(access_token_md_);
+ return y_absl::StrFormat("AccessTokenCredentials{Token:%s}",
+ access_token_present ? "present" : "absent");
}
-TString grpc_access_token_credentials::debug_string() {
- bool access_token_present = !GRPC_MDISNULL(access_token_md_);
- return y_absl::StrFormat("AccessTokenCredentials{Token:%s}",
- access_token_present ? "present" : "absent");
-}
-
grpc_call_credentials* grpc_access_token_credentials_create(
const char* access_token, void* reserved) {
GRPC_API_TRACE(
diff --git a/contrib/libs/grpc/src/core/lib/security/credentials/oauth2/oauth2_credentials.h b/contrib/libs/grpc/src/core/lib/security/credentials/oauth2/oauth2_credentials.h
index 96f7479c5ea..fd886405cff 100644
--- a/contrib/libs/grpc/src/core/lib/security/credentials/oauth2/oauth2_credentials.h
+++ b/contrib/libs/grpc/src/core/lib/security/credentials/oauth2/oauth2_credentials.h
@@ -21,8 +21,8 @@
#include <grpc/support/port_platform.h>
-#include <util/generic/string.h>
-
+#include <util/generic/string.h>
+
#include <grpc/grpc_security.h>
#include "src/core/lib/json/json.h"
#include "src/core/lib/security/credentials/credentials.h"
@@ -52,7 +52,7 @@ grpc_auth_refresh_token grpc_auth_refresh_token_create_from_string(
/// Creates a refresh token object from parsed json. Returns an invalid object
/// if a parsing error has been encountered.
grpc_auth_refresh_token grpc_auth_refresh_token_create_from_json(
- const grpc_core::Json& json);
+ const grpc_core::Json& json);
/// Destructs the object.
void grpc_auth_refresh_token_destruct(grpc_auth_refresh_token* refresh_token);
@@ -85,7 +85,7 @@ class grpc_oauth2_token_fetcher_credentials : public grpc_call_credentials {
void on_http_response(grpc_credentials_metadata_request* r,
grpc_error* error);
- TString debug_string() override;
+ TString debug_string() override;
protected:
virtual void fetch_oauth2(grpc_credentials_metadata_request* req,
@@ -114,8 +114,8 @@ class grpc_google_refresh_token_credentials final
return refresh_token_;
}
- TString debug_string() override;
-
+ TString debug_string() override;
+
protected:
void fetch_oauth2(grpc_credentials_metadata_request* req,
grpc_httpcli_context* httpcli_context,
@@ -142,8 +142,8 @@ class grpc_access_token_credentials final : public grpc_call_credentials {
void cancel_get_request_metadata(grpc_credentials_mdelem_array* md_array,
grpc_error* error) override;
- TString debug_string() override;
-
+ TString debug_string() override;
+
private:
grpc_mdelem access_token_md_;
};
diff --git a/contrib/libs/grpc/src/core/lib/security/credentials/plugin/plugin_credentials.cc b/contrib/libs/grpc/src/core/lib/security/credentials/plugin/plugin_credentials.cc
index 3c172053a2d..40d8fec6e4b 100644
--- a/contrib/libs/grpc/src/core/lib/security/credentials/plugin/plugin_credentials.cc
+++ b/contrib/libs/grpc/src/core/lib/security/credentials/plugin/plugin_credentials.cc
@@ -22,8 +22,8 @@
#include <string.h>
-#include "y_absl/strings/str_cat.h"
-
+#include "y_absl/strings/str_cat.h"
+
#include <grpc/grpc.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
@@ -43,19 +43,19 @@ grpc_plugin_credentials::~grpc_plugin_credentials() {
}
}
-TString grpc_plugin_credentials::debug_string() {
- char* debug_c_str = nullptr;
- if (plugin_.debug_string != nullptr) {
- debug_c_str = plugin_.debug_string(plugin_.state);
- }
- TString debug_str(
- debug_c_str != nullptr
- ? debug_c_str
- : "grpc_plugin_credentials did not provide a debug string");
- gpr_free(debug_c_str);
- return debug_str;
-}
-
+TString grpc_plugin_credentials::debug_string() {
+ char* debug_c_str = nullptr;
+ if (plugin_.debug_string != nullptr) {
+ debug_c_str = plugin_.debug_string(plugin_.state);
+ }
+ TString debug_str(
+ debug_c_str != nullptr
+ ? debug_c_str
+ : "grpc_plugin_credentials did not provide a debug string");
+ gpr_free(debug_c_str);
+ return debug_str;
+}
+
void grpc_plugin_credentials::pending_request_remove_locked(
pending_request* pending_request) {
if (pending_request->prev == nullptr) {
@@ -87,10 +87,10 @@ static grpc_error* process_plugin_result(
size_t num_md, grpc_status_code status, const char* error_details) {
grpc_error* error = GRPC_ERROR_NONE;
if (status != GRPC_STATUS_OK) {
- error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("Getting metadata from plugin failed with error: ",
- error_details)
- .c_str());
+ error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrCat("Getting metadata from plugin failed with error: ",
+ error_details)
+ .c_str());
} else {
bool seen_illegal_header = false;
for (size_t i = 0; i < num_md; ++i) {
@@ -253,17 +253,17 @@ void grpc_plugin_credentials::cancel_get_request_metadata(
}
grpc_plugin_credentials::grpc_plugin_credentials(
- grpc_metadata_credentials_plugin plugin,
- grpc_security_level min_security_level)
- : grpc_call_credentials(plugin.type, min_security_level), plugin_(plugin) {
+ grpc_metadata_credentials_plugin plugin,
+ grpc_security_level min_security_level)
+ : grpc_call_credentials(plugin.type, min_security_level), plugin_(plugin) {
gpr_mu_init(&mu_);
}
grpc_call_credentials* grpc_metadata_credentials_create_from_plugin(
- grpc_metadata_credentials_plugin plugin,
- grpc_security_level min_security_level, void* reserved) {
+ grpc_metadata_credentials_plugin plugin,
+ grpc_security_level min_security_level, void* reserved) {
GRPC_API_TRACE("grpc_metadata_credentials_create_from_plugin(reserved=%p)", 1,
(reserved));
GPR_ASSERT(reserved == nullptr);
- return new grpc_plugin_credentials(plugin, min_security_level);
+ return new grpc_plugin_credentials(plugin, min_security_level);
}
diff --git a/contrib/libs/grpc/src/core/lib/security/credentials/plugin/plugin_credentials.h b/contrib/libs/grpc/src/core/lib/security/credentials/plugin/plugin_credentials.h
index aaac8165f37..78bca05fb90 100644
--- a/contrib/libs/grpc/src/core/lib/security/credentials/plugin/plugin_credentials.h
+++ b/contrib/libs/grpc/src/core/lib/security/credentials/plugin/plugin_credentials.h
@@ -39,8 +39,8 @@ struct grpc_plugin_credentials final : public grpc_call_credentials {
struct pending_request* next;
};
- explicit grpc_plugin_credentials(grpc_metadata_credentials_plugin plugin,
- grpc_security_level min_security_level);
+ explicit grpc_plugin_credentials(grpc_metadata_credentials_plugin plugin,
+ grpc_security_level min_security_level);
~grpc_plugin_credentials() override;
bool get_request_metadata(grpc_polling_entity* pollent,
@@ -59,8 +59,8 @@ struct grpc_plugin_credentials final : public grpc_call_credentials {
// cancelled before completion.
void pending_request_complete(pending_request* r);
- TString debug_string() override;
-
+ TString debug_string() override;
+
private:
void pending_request_remove_locked(pending_request* pending_request);
diff --git a/contrib/libs/grpc/src/core/lib/security/credentials/ssl/ssl_credentials.cc b/contrib/libs/grpc/src/core/lib/security/credentials/ssl/ssl_credentials.cc
index 76edf780f43..3bb7790f5c9 100644
--- a/contrib/libs/grpc/src/core/lib/security/credentials/ssl/ssl_credentials.cc
+++ b/contrib/libs/grpc/src/core/lib/security/credentials/ssl/ssl_credentials.cc
@@ -117,16 +117,16 @@ void grpc_ssl_credentials::build_config(
}
}
-void grpc_ssl_credentials::set_min_tls_version(
- grpc_tls_version min_tls_version) {
- config_.min_tls_version = min_tls_version;
-}
-
-void grpc_ssl_credentials::set_max_tls_version(
- grpc_tls_version max_tls_version) {
- config_.max_tls_version = max_tls_version;
-}
-
+void grpc_ssl_credentials::set_min_tls_version(
+ grpc_tls_version min_tls_version) {
+ config_.min_tls_version = min_tls_version;
+}
+
+void grpc_ssl_credentials::set_max_tls_version(
+ grpc_tls_version max_tls_version) {
+ config_.max_tls_version = max_tls_version;
+}
+
/* Deprecated in favor of grpc_ssl_credentials_create_ex. Will be removed
* once all of its call sites are migrated to grpc_ssl_credentials_create_ex. */
grpc_channel_credentials* grpc_ssl_credentials_create(
@@ -223,16 +223,16 @@ void grpc_ssl_server_credentials::build_config(
config_.num_key_cert_pairs = num_key_cert_pairs;
}
-void grpc_ssl_server_credentials::set_min_tls_version(
- grpc_tls_version min_tls_version) {
- config_.min_tls_version = min_tls_version;
-}
-
-void grpc_ssl_server_credentials::set_max_tls_version(
- grpc_tls_version max_tls_version) {
- config_.max_tls_version = max_tls_version;
-}
-
+void grpc_ssl_server_credentials::set_min_tls_version(
+ grpc_tls_version min_tls_version) {
+ config_.min_tls_version = min_tls_version;
+}
+
+void grpc_ssl_server_credentials::set_max_tls_version(
+ grpc_tls_version max_tls_version) {
+ config_.max_tls_version = max_tls_version;
+}
+
grpc_ssl_server_certificate_config* grpc_ssl_server_certificate_config_create(
const char* pem_root_certs,
const grpc_ssl_pem_key_cert_pair* pem_key_cert_pairs,
diff --git a/contrib/libs/grpc/src/core/lib/security/credentials/ssl/ssl_credentials.h b/contrib/libs/grpc/src/core/lib/security/credentials/ssl/ssl_credentials.h
index f06aa0c5756..4c90813f8d2 100644
--- a/contrib/libs/grpc/src/core/lib/security/credentials/ssl/ssl_credentials.h
+++ b/contrib/libs/grpc/src/core/lib/security/credentials/ssl/ssl_credentials.h
@@ -38,11 +38,11 @@ class grpc_ssl_credentials : public grpc_channel_credentials {
const char* target, const grpc_channel_args* args,
grpc_channel_args** new_args) override;
- // TODO(mattstev): Plumb to wrapped languages. Until then, setting the TLS
- // version should be done for testing purposes only.
- void set_min_tls_version(grpc_tls_version min_tls_version);
- void set_max_tls_version(grpc_tls_version max_tls_version);
-
+ // TODO(mattstev): Plumb to wrapped languages. Until then, setting the TLS
+ // version should be done for testing purposes only.
+ void set_min_tls_version(grpc_tls_version min_tls_version);
+ void set_max_tls_version(grpc_tls_version max_tls_version);
+
private:
void build_config(const char* pem_root_certs,
grpc_ssl_pem_key_cert_pair* pem_key_cert_pair,
@@ -82,11 +82,11 @@ class grpc_ssl_server_credentials final : public grpc_server_credentials {
config);
}
- // TODO(mattstev): Plumb to wrapped languages. Until then, setting the TLS
- // version should be done for testing purposes only.
- void set_min_tls_version(grpc_tls_version min_tls_version);
- void set_max_tls_version(grpc_tls_version max_tls_version);
-
+ // TODO(mattstev): Plumb to wrapped languages. Until then, setting the TLS
+ // version should be done for testing purposes only.
+ void set_min_tls_version(grpc_tls_version min_tls_version);
+ void set_max_tls_version(grpc_tls_version max_tls_version);
+
const grpc_ssl_server_config& config() const { return config_; }
private:
diff --git a/contrib/libs/grpc/src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.cc b/contrib/libs/grpc/src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.cc
index a03d040ebb9..a925cf613e4 100644
--- a/contrib/libs/grpc/src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.cc
+++ b/contrib/libs/grpc/src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.cc
@@ -1,321 +1,321 @@
-//
-// Copyright 2020 gRPC authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-#include <grpc/support/port_platform.h>
-
-#include "src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.h"
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/string_util.h>
-#include <stdlib.h>
-#include <string.h>
-
-void grpc_tls_certificate_distributor::SetKeyMaterials(
- const TString& cert_name, y_absl::optional<TString> pem_root_certs,
- y_absl::optional<PemKeyCertPairList> pem_key_cert_pairs) {
- GPR_ASSERT(pem_root_certs.has_value() || pem_key_cert_pairs.has_value());
- grpc_core::MutexLock lock(&mu_);
- auto& cert_info = certificate_info_map_[cert_name];
- if (pem_root_certs.has_value()) {
- // Successful credential updates will clear any pre-existing error.
- cert_info.SetRootError(GRPC_ERROR_NONE);
- for (auto* watcher_ptr : cert_info.root_cert_watchers) {
- GPR_ASSERT(watcher_ptr != nullptr);
- const auto watcher_it = watchers_.find(watcher_ptr);
- GPR_ASSERT(watcher_it != watchers_.end());
- GPR_ASSERT(watcher_it->second.root_cert_name.has_value());
- y_absl::optional<PemKeyCertPairList> pem_key_cert_pairs_to_report;
- if (pem_key_cert_pairs.has_value() &&
- watcher_it->second.identity_cert_name == cert_name) {
- pem_key_cert_pairs_to_report = pem_key_cert_pairs;
- } else if (watcher_it->second.identity_cert_name.has_value()) {
- auto& identity_cert_info =
- certificate_info_map_[*watcher_it->second.identity_cert_name];
- pem_key_cert_pairs_to_report = identity_cert_info.pem_key_cert_pairs;
- }
- watcher_ptr->OnCertificatesChanged(
- pem_root_certs, std::move(pem_key_cert_pairs_to_report));
- }
- cert_info.pem_root_certs = std::move(*pem_root_certs);
- }
- if (pem_key_cert_pairs.has_value()) {
- // Successful credential updates will clear any pre-existing error.
- cert_info.SetIdentityError(GRPC_ERROR_NONE);
- for (const auto watcher_ptr : cert_info.identity_cert_watchers) {
- GPR_ASSERT(watcher_ptr != nullptr);
- const auto watcher_it = watchers_.find(watcher_ptr);
- GPR_ASSERT(watcher_it != watchers_.end());
- GPR_ASSERT(watcher_it->second.identity_cert_name.has_value());
- y_absl::optional<y_absl::string_view> pem_root_certs_to_report;
- if (pem_root_certs.has_value() &&
- watcher_it->second.root_cert_name == cert_name) {
- // In this case, We've already sent the credential updates at the time
- // when checking pem_root_certs, so we will skip here.
- continue;
- } else if (watcher_it->second.root_cert_name.has_value()) {
- auto& root_cert_info =
- certificate_info_map_[*watcher_it->second.root_cert_name];
- pem_root_certs_to_report = root_cert_info.pem_root_certs;
- }
- watcher_ptr->OnCertificatesChanged(pem_root_certs_to_report,
- pem_key_cert_pairs);
- }
- cert_info.pem_key_cert_pairs = std::move(*pem_key_cert_pairs);
- }
-}
-
-bool grpc_tls_certificate_distributor::HasRootCerts(
- const TString& root_cert_name) {
- grpc_core::MutexLock lock(&mu_);
- const auto it = certificate_info_map_.find(root_cert_name);
- return it != certificate_info_map_.end() &&
- !it->second.pem_root_certs.empty();
-};
-
-bool grpc_tls_certificate_distributor::HasKeyCertPairs(
- const TString& identity_cert_name) {
- grpc_core::MutexLock lock(&mu_);
- const auto it = certificate_info_map_.find(identity_cert_name);
- return it != certificate_info_map_.end() &&
- !it->second.pem_key_cert_pairs.empty();
-};
-
-void grpc_tls_certificate_distributor::SetErrorForCert(
- const TString& cert_name, y_absl::optional<grpc_error*> root_cert_error,
- y_absl::optional<grpc_error*> identity_cert_error) {
- GPR_ASSERT(root_cert_error.has_value() || identity_cert_error.has_value());
- grpc_core::MutexLock lock(&mu_);
- CertificateInfo& cert_info = certificate_info_map_[cert_name];
- if (root_cert_error.has_value()) {
- for (auto* watcher_ptr : cert_info.root_cert_watchers) {
- GPR_ASSERT(watcher_ptr != nullptr);
- const auto watcher_it = watchers_.find(watcher_ptr);
- GPR_ASSERT(watcher_it != watchers_.end());
- // identity_cert_error_to_report is the error of the identity cert this
- // watcher is watching, if there is any.
- grpc_error* identity_cert_error_to_report = GRPC_ERROR_NONE;
- if (identity_cert_error.has_value() &&
- watcher_it->second.identity_cert_name == cert_name) {
- identity_cert_error_to_report = *identity_cert_error;
- } else if (watcher_it->second.identity_cert_name.has_value()) {
- auto& identity_cert_info =
- certificate_info_map_[*watcher_it->second.identity_cert_name];
- identity_cert_error_to_report = identity_cert_info.identity_cert_error;
- }
- watcher_ptr->OnError(GRPC_ERROR_REF(*root_cert_error),
- GRPC_ERROR_REF(identity_cert_error_to_report));
- }
- cert_info.SetRootError(*root_cert_error);
- }
- if (identity_cert_error.has_value()) {
- for (auto* watcher_ptr : cert_info.identity_cert_watchers) {
- GPR_ASSERT(watcher_ptr != nullptr);
- const auto watcher_it = watchers_.find(watcher_ptr);
- GPR_ASSERT(watcher_it != watchers_.end());
- // root_cert_error_to_report is the error of the root cert this watcher is
- // watching, if there is any.
- grpc_error* root_cert_error_to_report = GRPC_ERROR_NONE;
- if (root_cert_error.has_value() &&
- watcher_it->second.root_cert_name == cert_name) {
- // In this case, We've already sent the error updates at the time when
- // checking root_cert_error, so we will skip here.
- continue;
- } else if (watcher_it->second.root_cert_name.has_value()) {
- auto& root_cert_info =
- certificate_info_map_[*watcher_it->second.root_cert_name];
- root_cert_error_to_report = root_cert_info.root_cert_error;
- }
- watcher_ptr->OnError(GRPC_ERROR_REF(root_cert_error_to_report),
- GRPC_ERROR_REF(*identity_cert_error));
- }
- cert_info.SetIdentityError(*identity_cert_error);
- }
-};
-
-void grpc_tls_certificate_distributor::SetError(grpc_error* error) {
- GPR_ASSERT(error != GRPC_ERROR_NONE);
- grpc_core::MutexLock lock(&mu_);
- for (const auto& watcher : watchers_) {
- const auto watcher_ptr = watcher.first;
- GPR_ASSERT(watcher_ptr != nullptr);
- const auto& watcher_info = watcher.second;
- watcher_ptr->OnError(
- watcher_info.root_cert_name.has_value() ? GRPC_ERROR_REF(error)
- : GRPC_ERROR_NONE,
- watcher_info.identity_cert_name.has_value() ? GRPC_ERROR_REF(error)
- : GRPC_ERROR_NONE);
- }
- for (auto& cert_info_entry : certificate_info_map_) {
- auto& cert_info = cert_info_entry.second;
- cert_info.SetRootError(GRPC_ERROR_REF(error));
- cert_info.SetIdentityError(GRPC_ERROR_REF(error));
- }
- GRPC_ERROR_UNREF(error);
-};
-
-void grpc_tls_certificate_distributor::WatchTlsCertificates(
- std::unique_ptr<TlsCertificatesWatcherInterface> watcher,
- y_absl::optional<TString> root_cert_name,
- y_absl::optional<TString> identity_cert_name) {
- bool start_watching_root_cert = false;
- bool already_watching_identity_for_root_cert = false;
- bool start_watching_identity_cert = false;
- bool already_watching_root_for_identity_cert = false;
- GPR_ASSERT(root_cert_name.has_value() || identity_cert_name.has_value());
- TlsCertificatesWatcherInterface* watcher_ptr = watcher.get();
- GPR_ASSERT(watcher_ptr != nullptr);
- // Update watchers_ and certificate_info_map_.
- {
- grpc_core::MutexLock lock(&mu_);
- const auto watcher_it = watchers_.find(watcher_ptr);
- // The caller needs to cancel the watcher first if it wants to re-register
- // the watcher.
- GPR_ASSERT(watcher_it == watchers_.end());
- watchers_[watcher_ptr] = {std::move(watcher), root_cert_name,
- identity_cert_name};
- y_absl::optional<y_absl::string_view> updated_root_certs;
- y_absl::optional<PemKeyCertPairList> updated_identity_pairs;
- grpc_error* root_error = GRPC_ERROR_NONE;
- grpc_error* identity_error = GRPC_ERROR_NONE;
- if (root_cert_name.has_value()) {
- CertificateInfo& cert_info = certificate_info_map_[*root_cert_name];
- start_watching_root_cert = cert_info.root_cert_watchers.empty();
- already_watching_identity_for_root_cert =
- !cert_info.identity_cert_watchers.empty();
- cert_info.root_cert_watchers.insert(watcher_ptr);
- root_error = GRPC_ERROR_REF(cert_info.root_cert_error);
- // Empty credentials will be treated as no updates.
- if (!cert_info.pem_root_certs.empty()) {
- updated_root_certs = cert_info.pem_root_certs;
- }
- }
- if (identity_cert_name.has_value()) {
- CertificateInfo& cert_info = certificate_info_map_[*identity_cert_name];
- start_watching_identity_cert = cert_info.identity_cert_watchers.empty();
- already_watching_root_for_identity_cert =
- !cert_info.root_cert_watchers.empty();
- cert_info.identity_cert_watchers.insert(watcher_ptr);
- identity_error = GRPC_ERROR_REF(cert_info.identity_cert_error);
- // Empty credentials will be treated as no updates.
- if (!cert_info.pem_key_cert_pairs.empty()) {
- updated_identity_pairs = cert_info.pem_key_cert_pairs;
- }
- }
- // Notify this watcher if the certs it is watching already had some
- // contents. Note that an *_cert_error in cert_info only indicates error
- // occurred while trying to fetch the latest cert, but the updated_*_certs
- // should always be valid. So we will send the updates regardless of
- // *_cert_error.
- if (updated_root_certs.has_value() || updated_identity_pairs.has_value()) {
- watcher_ptr->OnCertificatesChanged(updated_root_certs,
- std::move(updated_identity_pairs));
- }
- // Notify this watcher if the certs it is watching already had some errors.
- if (root_error != GRPC_ERROR_NONE || identity_error != GRPC_ERROR_NONE) {
- watcher_ptr->OnError(GRPC_ERROR_REF(root_error),
- GRPC_ERROR_REF(identity_error));
- }
- GRPC_ERROR_UNREF(root_error);
- GRPC_ERROR_UNREF(identity_error);
- }
- // Invoke watch status callback if needed.
- {
- grpc_core::MutexLock lock(&callback_mu_);
- if (watch_status_callback_ != nullptr) {
- if (root_cert_name == identity_cert_name &&
- (start_watching_root_cert || start_watching_identity_cert)) {
- watch_status_callback_(*root_cert_name, start_watching_root_cert,
- start_watching_identity_cert);
- } else {
- if (start_watching_root_cert) {
- watch_status_callback_(*root_cert_name, true,
- already_watching_identity_for_root_cert);
- }
- if (start_watching_identity_cert) {
- watch_status_callback_(*identity_cert_name,
- already_watching_root_for_identity_cert, true);
- }
- }
- }
- }
-};
-
-void grpc_tls_certificate_distributor::CancelTlsCertificatesWatch(
- TlsCertificatesWatcherInterface* watcher) {
- y_absl::optional<TString> root_cert_name;
- y_absl::optional<TString> identity_cert_name;
- bool stop_watching_root_cert = false;
- bool already_watching_identity_for_root_cert = false;
- bool stop_watching_identity_cert = false;
- bool already_watching_root_for_identity_cert = false;
- // Update watchers_ and certificate_info_map_.
- {
- grpc_core::MutexLock lock(&mu_);
- auto it = watchers_.find(watcher);
- if (it == watchers_.end()) return;
- WatcherInfo& watcher_info = it->second;
- root_cert_name = std::move(watcher_info.root_cert_name);
- identity_cert_name = std::move(watcher_info.identity_cert_name);
- watchers_.erase(it);
- if (root_cert_name.has_value()) {
- auto it = certificate_info_map_.find(*root_cert_name);
- GPR_ASSERT(it != certificate_info_map_.end());
- CertificateInfo& cert_info = it->second;
- cert_info.root_cert_watchers.erase(watcher);
- stop_watching_root_cert = cert_info.root_cert_watchers.empty();
- already_watching_identity_for_root_cert =
- !cert_info.identity_cert_watchers.empty();
- if (stop_watching_root_cert && !already_watching_identity_for_root_cert) {
- certificate_info_map_.erase(it);
- }
- }
- if (identity_cert_name.has_value()) {
- auto it = certificate_info_map_.find(*identity_cert_name);
- GPR_ASSERT(it != certificate_info_map_.end());
- CertificateInfo& cert_info = it->second;
- cert_info.identity_cert_watchers.erase(watcher);
- stop_watching_identity_cert = cert_info.identity_cert_watchers.empty();
- already_watching_root_for_identity_cert =
- !cert_info.root_cert_watchers.empty();
- if (stop_watching_identity_cert &&
- !already_watching_root_for_identity_cert) {
- certificate_info_map_.erase(it);
- }
- }
- }
- // Invoke watch status callback if needed.
- {
- grpc_core::MutexLock lock(&callback_mu_);
- if (watch_status_callback_ != nullptr) {
- if (root_cert_name == identity_cert_name &&
- (stop_watching_root_cert || stop_watching_identity_cert)) {
- watch_status_callback_(*root_cert_name, !stop_watching_root_cert,
- !stop_watching_identity_cert);
- } else {
- if (stop_watching_root_cert) {
- watch_status_callback_(*root_cert_name, false,
- already_watching_identity_for_root_cert);
- }
- if (stop_watching_identity_cert) {
- watch_status_callback_(*identity_cert_name,
- already_watching_root_for_identity_cert,
- false);
- }
- }
- }
- }
-};
+//
+// Copyright 2020 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.h"
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
+#include <stdlib.h>
+#include <string.h>
+
+void grpc_tls_certificate_distributor::SetKeyMaterials(
+ const TString& cert_name, y_absl::optional<TString> pem_root_certs,
+ y_absl::optional<PemKeyCertPairList> pem_key_cert_pairs) {
+ GPR_ASSERT(pem_root_certs.has_value() || pem_key_cert_pairs.has_value());
+ grpc_core::MutexLock lock(&mu_);
+ auto& cert_info = certificate_info_map_[cert_name];
+ if (pem_root_certs.has_value()) {
+ // Successful credential updates will clear any pre-existing error.
+ cert_info.SetRootError(GRPC_ERROR_NONE);
+ for (auto* watcher_ptr : cert_info.root_cert_watchers) {
+ GPR_ASSERT(watcher_ptr != nullptr);
+ const auto watcher_it = watchers_.find(watcher_ptr);
+ GPR_ASSERT(watcher_it != watchers_.end());
+ GPR_ASSERT(watcher_it->second.root_cert_name.has_value());
+ y_absl::optional<PemKeyCertPairList> pem_key_cert_pairs_to_report;
+ if (pem_key_cert_pairs.has_value() &&
+ watcher_it->second.identity_cert_name == cert_name) {
+ pem_key_cert_pairs_to_report = pem_key_cert_pairs;
+ } else if (watcher_it->second.identity_cert_name.has_value()) {
+ auto& identity_cert_info =
+ certificate_info_map_[*watcher_it->second.identity_cert_name];
+ pem_key_cert_pairs_to_report = identity_cert_info.pem_key_cert_pairs;
+ }
+ watcher_ptr->OnCertificatesChanged(
+ pem_root_certs, std::move(pem_key_cert_pairs_to_report));
+ }
+ cert_info.pem_root_certs = std::move(*pem_root_certs);
+ }
+ if (pem_key_cert_pairs.has_value()) {
+ // Successful credential updates will clear any pre-existing error.
+ cert_info.SetIdentityError(GRPC_ERROR_NONE);
+ for (const auto watcher_ptr : cert_info.identity_cert_watchers) {
+ GPR_ASSERT(watcher_ptr != nullptr);
+ const auto watcher_it = watchers_.find(watcher_ptr);
+ GPR_ASSERT(watcher_it != watchers_.end());
+ GPR_ASSERT(watcher_it->second.identity_cert_name.has_value());
+ y_absl::optional<y_absl::string_view> pem_root_certs_to_report;
+ if (pem_root_certs.has_value() &&
+ watcher_it->second.root_cert_name == cert_name) {
+ // In this case, We've already sent the credential updates at the time
+ // when checking pem_root_certs, so we will skip here.
+ continue;
+ } else if (watcher_it->second.root_cert_name.has_value()) {
+ auto& root_cert_info =
+ certificate_info_map_[*watcher_it->second.root_cert_name];
+ pem_root_certs_to_report = root_cert_info.pem_root_certs;
+ }
+ watcher_ptr->OnCertificatesChanged(pem_root_certs_to_report,
+ pem_key_cert_pairs);
+ }
+ cert_info.pem_key_cert_pairs = std::move(*pem_key_cert_pairs);
+ }
+}
+
+bool grpc_tls_certificate_distributor::HasRootCerts(
+ const TString& root_cert_name) {
+ grpc_core::MutexLock lock(&mu_);
+ const auto it = certificate_info_map_.find(root_cert_name);
+ return it != certificate_info_map_.end() &&
+ !it->second.pem_root_certs.empty();
+};
+
+bool grpc_tls_certificate_distributor::HasKeyCertPairs(
+ const TString& identity_cert_name) {
+ grpc_core::MutexLock lock(&mu_);
+ const auto it = certificate_info_map_.find(identity_cert_name);
+ return it != certificate_info_map_.end() &&
+ !it->second.pem_key_cert_pairs.empty();
+};
+
+void grpc_tls_certificate_distributor::SetErrorForCert(
+ const TString& cert_name, y_absl::optional<grpc_error*> root_cert_error,
+ y_absl::optional<grpc_error*> identity_cert_error) {
+ GPR_ASSERT(root_cert_error.has_value() || identity_cert_error.has_value());
+ grpc_core::MutexLock lock(&mu_);
+ CertificateInfo& cert_info = certificate_info_map_[cert_name];
+ if (root_cert_error.has_value()) {
+ for (auto* watcher_ptr : cert_info.root_cert_watchers) {
+ GPR_ASSERT(watcher_ptr != nullptr);
+ const auto watcher_it = watchers_.find(watcher_ptr);
+ GPR_ASSERT(watcher_it != watchers_.end());
+ // identity_cert_error_to_report is the error of the identity cert this
+ // watcher is watching, if there is any.
+ grpc_error* identity_cert_error_to_report = GRPC_ERROR_NONE;
+ if (identity_cert_error.has_value() &&
+ watcher_it->second.identity_cert_name == cert_name) {
+ identity_cert_error_to_report = *identity_cert_error;
+ } else if (watcher_it->second.identity_cert_name.has_value()) {
+ auto& identity_cert_info =
+ certificate_info_map_[*watcher_it->second.identity_cert_name];
+ identity_cert_error_to_report = identity_cert_info.identity_cert_error;
+ }
+ watcher_ptr->OnError(GRPC_ERROR_REF(*root_cert_error),
+ GRPC_ERROR_REF(identity_cert_error_to_report));
+ }
+ cert_info.SetRootError(*root_cert_error);
+ }
+ if (identity_cert_error.has_value()) {
+ for (auto* watcher_ptr : cert_info.identity_cert_watchers) {
+ GPR_ASSERT(watcher_ptr != nullptr);
+ const auto watcher_it = watchers_.find(watcher_ptr);
+ GPR_ASSERT(watcher_it != watchers_.end());
+ // root_cert_error_to_report is the error of the root cert this watcher is
+ // watching, if there is any.
+ grpc_error* root_cert_error_to_report = GRPC_ERROR_NONE;
+ if (root_cert_error.has_value() &&
+ watcher_it->second.root_cert_name == cert_name) {
+ // In this case, We've already sent the error updates at the time when
+ // checking root_cert_error, so we will skip here.
+ continue;
+ } else if (watcher_it->second.root_cert_name.has_value()) {
+ auto& root_cert_info =
+ certificate_info_map_[*watcher_it->second.root_cert_name];
+ root_cert_error_to_report = root_cert_info.root_cert_error;
+ }
+ watcher_ptr->OnError(GRPC_ERROR_REF(root_cert_error_to_report),
+ GRPC_ERROR_REF(*identity_cert_error));
+ }
+ cert_info.SetIdentityError(*identity_cert_error);
+ }
+};
+
+void grpc_tls_certificate_distributor::SetError(grpc_error* error) {
+ GPR_ASSERT(error != GRPC_ERROR_NONE);
+ grpc_core::MutexLock lock(&mu_);
+ for (const auto& watcher : watchers_) {
+ const auto watcher_ptr = watcher.first;
+ GPR_ASSERT(watcher_ptr != nullptr);
+ const auto& watcher_info = watcher.second;
+ watcher_ptr->OnError(
+ watcher_info.root_cert_name.has_value() ? GRPC_ERROR_REF(error)
+ : GRPC_ERROR_NONE,
+ watcher_info.identity_cert_name.has_value() ? GRPC_ERROR_REF(error)
+ : GRPC_ERROR_NONE);
+ }
+ for (auto& cert_info_entry : certificate_info_map_) {
+ auto& cert_info = cert_info_entry.second;
+ cert_info.SetRootError(GRPC_ERROR_REF(error));
+ cert_info.SetIdentityError(GRPC_ERROR_REF(error));
+ }
+ GRPC_ERROR_UNREF(error);
+};
+
+void grpc_tls_certificate_distributor::WatchTlsCertificates(
+ std::unique_ptr<TlsCertificatesWatcherInterface> watcher,
+ y_absl::optional<TString> root_cert_name,
+ y_absl::optional<TString> identity_cert_name) {
+ bool start_watching_root_cert = false;
+ bool already_watching_identity_for_root_cert = false;
+ bool start_watching_identity_cert = false;
+ bool already_watching_root_for_identity_cert = false;
+ GPR_ASSERT(root_cert_name.has_value() || identity_cert_name.has_value());
+ TlsCertificatesWatcherInterface* watcher_ptr = watcher.get();
+ GPR_ASSERT(watcher_ptr != nullptr);
+ // Update watchers_ and certificate_info_map_.
+ {
+ grpc_core::MutexLock lock(&mu_);
+ const auto watcher_it = watchers_.find(watcher_ptr);
+ // The caller needs to cancel the watcher first if it wants to re-register
+ // the watcher.
+ GPR_ASSERT(watcher_it == watchers_.end());
+ watchers_[watcher_ptr] = {std::move(watcher), root_cert_name,
+ identity_cert_name};
+ y_absl::optional<y_absl::string_view> updated_root_certs;
+ y_absl::optional<PemKeyCertPairList> updated_identity_pairs;
+ grpc_error* root_error = GRPC_ERROR_NONE;
+ grpc_error* identity_error = GRPC_ERROR_NONE;
+ if (root_cert_name.has_value()) {
+ CertificateInfo& cert_info = certificate_info_map_[*root_cert_name];
+ start_watching_root_cert = cert_info.root_cert_watchers.empty();
+ already_watching_identity_for_root_cert =
+ !cert_info.identity_cert_watchers.empty();
+ cert_info.root_cert_watchers.insert(watcher_ptr);
+ root_error = GRPC_ERROR_REF(cert_info.root_cert_error);
+ // Empty credentials will be treated as no updates.
+ if (!cert_info.pem_root_certs.empty()) {
+ updated_root_certs = cert_info.pem_root_certs;
+ }
+ }
+ if (identity_cert_name.has_value()) {
+ CertificateInfo& cert_info = certificate_info_map_[*identity_cert_name];
+ start_watching_identity_cert = cert_info.identity_cert_watchers.empty();
+ already_watching_root_for_identity_cert =
+ !cert_info.root_cert_watchers.empty();
+ cert_info.identity_cert_watchers.insert(watcher_ptr);
+ identity_error = GRPC_ERROR_REF(cert_info.identity_cert_error);
+ // Empty credentials will be treated as no updates.
+ if (!cert_info.pem_key_cert_pairs.empty()) {
+ updated_identity_pairs = cert_info.pem_key_cert_pairs;
+ }
+ }
+ // Notify this watcher if the certs it is watching already had some
+ // contents. Note that an *_cert_error in cert_info only indicates error
+ // occurred while trying to fetch the latest cert, but the updated_*_certs
+ // should always be valid. So we will send the updates regardless of
+ // *_cert_error.
+ if (updated_root_certs.has_value() || updated_identity_pairs.has_value()) {
+ watcher_ptr->OnCertificatesChanged(updated_root_certs,
+ std::move(updated_identity_pairs));
+ }
+ // Notify this watcher if the certs it is watching already had some errors.
+ if (root_error != GRPC_ERROR_NONE || identity_error != GRPC_ERROR_NONE) {
+ watcher_ptr->OnError(GRPC_ERROR_REF(root_error),
+ GRPC_ERROR_REF(identity_error));
+ }
+ GRPC_ERROR_UNREF(root_error);
+ GRPC_ERROR_UNREF(identity_error);
+ }
+ // Invoke watch status callback if needed.
+ {
+ grpc_core::MutexLock lock(&callback_mu_);
+ if (watch_status_callback_ != nullptr) {
+ if (root_cert_name == identity_cert_name &&
+ (start_watching_root_cert || start_watching_identity_cert)) {
+ watch_status_callback_(*root_cert_name, start_watching_root_cert,
+ start_watching_identity_cert);
+ } else {
+ if (start_watching_root_cert) {
+ watch_status_callback_(*root_cert_name, true,
+ already_watching_identity_for_root_cert);
+ }
+ if (start_watching_identity_cert) {
+ watch_status_callback_(*identity_cert_name,
+ already_watching_root_for_identity_cert, true);
+ }
+ }
+ }
+ }
+};
+
+void grpc_tls_certificate_distributor::CancelTlsCertificatesWatch(
+ TlsCertificatesWatcherInterface* watcher) {
+ y_absl::optional<TString> root_cert_name;
+ y_absl::optional<TString> identity_cert_name;
+ bool stop_watching_root_cert = false;
+ bool already_watching_identity_for_root_cert = false;
+ bool stop_watching_identity_cert = false;
+ bool already_watching_root_for_identity_cert = false;
+ // Update watchers_ and certificate_info_map_.
+ {
+ grpc_core::MutexLock lock(&mu_);
+ auto it = watchers_.find(watcher);
+ if (it == watchers_.end()) return;
+ WatcherInfo& watcher_info = it->second;
+ root_cert_name = std::move(watcher_info.root_cert_name);
+ identity_cert_name = std::move(watcher_info.identity_cert_name);
+ watchers_.erase(it);
+ if (root_cert_name.has_value()) {
+ auto it = certificate_info_map_.find(*root_cert_name);
+ GPR_ASSERT(it != certificate_info_map_.end());
+ CertificateInfo& cert_info = it->second;
+ cert_info.root_cert_watchers.erase(watcher);
+ stop_watching_root_cert = cert_info.root_cert_watchers.empty();
+ already_watching_identity_for_root_cert =
+ !cert_info.identity_cert_watchers.empty();
+ if (stop_watching_root_cert && !already_watching_identity_for_root_cert) {
+ certificate_info_map_.erase(it);
+ }
+ }
+ if (identity_cert_name.has_value()) {
+ auto it = certificate_info_map_.find(*identity_cert_name);
+ GPR_ASSERT(it != certificate_info_map_.end());
+ CertificateInfo& cert_info = it->second;
+ cert_info.identity_cert_watchers.erase(watcher);
+ stop_watching_identity_cert = cert_info.identity_cert_watchers.empty();
+ already_watching_root_for_identity_cert =
+ !cert_info.root_cert_watchers.empty();
+ if (stop_watching_identity_cert &&
+ !already_watching_root_for_identity_cert) {
+ certificate_info_map_.erase(it);
+ }
+ }
+ }
+ // Invoke watch status callback if needed.
+ {
+ grpc_core::MutexLock lock(&callback_mu_);
+ if (watch_status_callback_ != nullptr) {
+ if (root_cert_name == identity_cert_name &&
+ (stop_watching_root_cert || stop_watching_identity_cert)) {
+ watch_status_callback_(*root_cert_name, !stop_watching_root_cert,
+ !stop_watching_identity_cert);
+ } else {
+ if (stop_watching_root_cert) {
+ watch_status_callback_(*root_cert_name, false,
+ already_watching_identity_for_root_cert);
+ }
+ if (stop_watching_identity_cert) {
+ watch_status_callback_(*identity_cert_name,
+ already_watching_root_for_identity_cert,
+ false);
+ }
+ }
+ }
+ }
+};
diff --git a/contrib/libs/grpc/src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.h b/contrib/libs/grpc/src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.h
index 628db708152..15d76da420e 100644
--- a/contrib/libs/grpc/src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.h
+++ b/contrib/libs/grpc/src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.h
@@ -1,214 +1,214 @@
-//
-// Copyright 2020 gRPC authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-#ifndef GRPC_CORE_LIB_SECURITY_CREDENTIALS_TLS_GRPC_TLS_CERTIFICATE_DISTRIBUTOR_H
-#define GRPC_CORE_LIB_SECURITY_CREDENTIALS_TLS_GRPC_TLS_CERTIFICATE_DISTRIBUTOR_H
-
-#include <grpc/support/port_platform.h>
-
-#include <grpc/grpc_security.h>
-
-#include "y_absl/container/inlined_vector.h"
-#include "y_absl/types/optional.h"
-#include "src/core/lib/gprpp/ref_counted.h"
-#include "src/core/lib/security/security_connector/ssl_utils.h"
-
-// TLS certificate distributor.
-struct grpc_tls_certificate_distributor
- : public grpc_core::RefCounted<grpc_tls_certificate_distributor> {
- public:
- typedef y_absl::InlinedVector<grpc_core::PemKeyCertPair, 1> PemKeyCertPairList;
-
- // Interface for watching TLS certificates update.
- class TlsCertificatesWatcherInterface {
- public:
- virtual ~TlsCertificatesWatcherInterface() = default;
-
- // Handles the delivery of the updated root and identity certificates.
- // An y_absl::nullopt value indicates no corresponding contents for
- // root_certs or key_cert_pairs. Note that we will send updates of the
- // latest contents for both root and identity certificates, even when only
- // one side of it got updated.
- //
- // @param root_certs the contents of the reloaded root certs.
- // @param key_cert_pairs the contents of the reloaded identity key-cert
- // pairs.
- virtual void OnCertificatesChanged(
- y_absl::optional<y_absl::string_view> root_certs,
- y_absl::optional<PemKeyCertPairList> key_cert_pairs) = 0;
-
- // Handles an error that occurs while attempting to fetch certificate data.
- // Note that if a watcher sees an error, it simply means the Provider is
- // having problems renewing new data. If the watcher has previously received
- // several OnCertificatesChanged, all the data received from that function
- // is valid.
- // In that case, watcher might simply log the error. If the watcher hasn't
- // received any OnCertificatesChanged before the error occurs, no valid
- // data is available yet, and the watcher should either fail or "waiting"
- // for the valid data in a non-blocking way.
- //
- // @param root_cert_error the error occurred while reloading root
- // certificates.
- // @param identity_cert_error the error occurred while reloading identity
- // certificates.
- virtual void OnError(grpc_error* root_cert_error,
- grpc_error* identity_cert_error) = 0;
- };
-
- // Sets the key materials based on their certificate name. Note that we are
- // not doing any copies for pem_root_certs and pem_key_cert_pairs. For
- // pem_root_certs, the original string contents need to outlive the
- // distributor; for pem_key_cert_pairs, internally it is taking two
- // unique_ptr(s) to the credential string, so the ownership is actually
- // transferred.
- //
- // @param cert_name The name of the certificates being updated.
- // @param pem_root_certs The content of root certificates.
- // @param pem_key_cert_pairs The content of identity key-cert pairs.
- void SetKeyMaterials(const TString& cert_name,
- y_absl::optional<TString> pem_root_certs,
- y_absl::optional<PemKeyCertPairList> pem_key_cert_pairs);
-
- bool HasRootCerts(const TString& root_cert_name);
-
- bool HasKeyCertPairs(const TString& identity_cert_name);
-
- // Propagates the error that the caller (e.g. Producer) encounters to all the
- // watchers watching a particular certificate name.
- //
- // @param cert_name The watching cert name of the watchers that the caller
- // wants to notify when encountering error.
- // @param root_cert_error The error that the caller encounters when reloading
- // root certs.
- // @param identity_cert_error The error that the caller encounters when
- // reloading identity certs.
- void SetErrorForCert(const TString& cert_name,
- y_absl::optional<grpc_error*> root_cert_error,
- y_absl::optional<grpc_error*> identity_cert_error);
-
- // Propagates the error that the caller (e.g. Producer) encounters to all
- // watchers.
- //
- // @param error The error that the caller encounters.
- void SetError(grpc_error* error);
-
- // Sets the TLS certificate watch status callback function. The
- // grpc_tls_certificate_distributor will invoke this callback when a new
- // certificate name is watched by a newly registered watcher, or when a
- // certificate name is no longer watched by any watchers.
- // Note that when the callback shows a cert is no longer being watched, the
- // distributor will delete the corresponding certificate data from its cache,
- // and clear the corresponding error, if there is any. This means that if the
- // callback subsequently says the same cert is now being watched again, the
- // provider must re-provide the credentials or re-invoke the errors to the
- // distributor, to indicate a successful or failed reloading.
- // @param callback The callback function being set by the caller, e.g the
- // Producer. Note that this callback will be invoked for each certificate
- // name.
- //
- // For the parameters in the callback function:
- // string_value The name of the certificates being watched.
- // bool_value_1 If the root certificates with the specific name are being
- // watched. bool_value_2 If the identity certificates with the specific name
- // are being watched.
- void SetWatchStatusCallback(
- std::function<void(TString, bool, bool)> callback) {
- grpc_core::MutexLock lock(&mu_);
- watch_status_callback_ = callback;
- };
-
- // Registers a watcher. The caller may keep a raw pointer to the watcher,
- // which may be used only for cancellation. (Because the caller does not own
- // the watcher, the pointer must not be used for any other purpose.) At least
- // one of root_cert_name and identity_cert_name must be specified.
- //
- // @param watcher The watcher being registered.
- // @param root_cert_name The name of the root certificates that will be
- // watched. If set to y_absl::nullopt, the root certificates won't be watched.
- // @param identity_cert_name The name of the identity certificates that will
- // be watched. If set to y_absl::nullopt, the identity certificates won't be
- // watched.
- void WatchTlsCertificates(
- std::unique_ptr<TlsCertificatesWatcherInterface> watcher,
- y_absl::optional<TString> root_cert_name,
- y_absl::optional<TString> identity_cert_name);
-
- // Cancels a watcher.
- //
- // @param watcher The watcher being cancelled.
- void CancelTlsCertificatesWatch(TlsCertificatesWatcherInterface* watcher);
-
- private:
- // Contains the information about each watcher.
- struct WatcherInfo {
- std::unique_ptr<TlsCertificatesWatcherInterface> watcher;
- y_absl::optional<TString> root_cert_name;
- y_absl::optional<TString> identity_cert_name;
- };
- // CertificateInfo contains the credential contents and some additional
- // watcher information.
- // Note that having errors doesn't indicate the corresponding credentials are
- // invalid. For example, if root_cert_error != nullptr but pem_root_certs has
- // value, it simply means an error occurs while trying to fetch the latest
- // root certs, while pem_root_certs still contains the valid old data.
- struct CertificateInfo {
- // The contents of the root certificates.
- TString pem_root_certs;
- // The contents of the identity key-certificate pairs.
- PemKeyCertPairList pem_key_cert_pairs;
- // The root cert reloading error propagated by the caller.
- grpc_error* root_cert_error = GRPC_ERROR_NONE;
- // The identity cert reloading error propagated by the caller.
- grpc_error* identity_cert_error = GRPC_ERROR_NONE;
- // The set of watchers watching root certificates.
- // This is mainly used for quickly looking up the affected watchers while
- // performing a credential reloading.
- std::set<TlsCertificatesWatcherInterface*> root_cert_watchers;
- // The set of watchers watching identity certificates. This is mainly used
- // for quickly looking up the affected watchers while performing a
- // credential reloading.
- std::set<TlsCertificatesWatcherInterface*> identity_cert_watchers;
-
- ~CertificateInfo() {
- GRPC_ERROR_UNREF(root_cert_error);
- GRPC_ERROR_UNREF(identity_cert_error);
- }
- void SetRootError(grpc_error* error) {
- GRPC_ERROR_UNREF(root_cert_error);
- root_cert_error = error;
- }
- void SetIdentityError(grpc_error* error) {
- GRPC_ERROR_UNREF(identity_cert_error);
- identity_cert_error = error;
- }
- };
-
- grpc_core::Mutex mu_;
- // We need a dedicated mutex for watch_status_callback_ for allowing
- // callers(e.g. Producer) to directly set key materials in the callback
- // functions.
- grpc_core::Mutex callback_mu_;
- // Stores information about each watcher.
- std::map<TlsCertificatesWatcherInterface*, WatcherInfo> watchers_;
- // The callback to notify the caller, e.g. the Producer, that the watch status
- // is changed.
- std::function<void(TString, bool, bool)> watch_status_callback_;
- // Stores the names of each certificate, and their corresponding credential
- // contents as well as some additional watcher information.
- std::map<TString, CertificateInfo> certificate_info_map_;
-};
-
-#endif // GRPC_CORE_LIB_SECURITY_CREDENTIALS_TLS_GRPC_TLS_CERTIFICATE_DISTRIBUTOR_H
+//
+// Copyright 2020 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+#ifndef GRPC_CORE_LIB_SECURITY_CREDENTIALS_TLS_GRPC_TLS_CERTIFICATE_DISTRIBUTOR_H
+#define GRPC_CORE_LIB_SECURITY_CREDENTIALS_TLS_GRPC_TLS_CERTIFICATE_DISTRIBUTOR_H
+
+#include <grpc/support/port_platform.h>
+
+#include <grpc/grpc_security.h>
+
+#include "y_absl/container/inlined_vector.h"
+#include "y_absl/types/optional.h"
+#include "src/core/lib/gprpp/ref_counted.h"
+#include "src/core/lib/security/security_connector/ssl_utils.h"
+
+// TLS certificate distributor.
+struct grpc_tls_certificate_distributor
+ : public grpc_core::RefCounted<grpc_tls_certificate_distributor> {
+ public:
+ typedef y_absl::InlinedVector<grpc_core::PemKeyCertPair, 1> PemKeyCertPairList;
+
+ // Interface for watching TLS certificates update.
+ class TlsCertificatesWatcherInterface {
+ public:
+ virtual ~TlsCertificatesWatcherInterface() = default;
+
+ // Handles the delivery of the updated root and identity certificates.
+ // An y_absl::nullopt value indicates no corresponding contents for
+ // root_certs or key_cert_pairs. Note that we will send updates of the
+ // latest contents for both root and identity certificates, even when only
+ // one side of it got updated.
+ //
+ // @param root_certs the contents of the reloaded root certs.
+ // @param key_cert_pairs the contents of the reloaded identity key-cert
+ // pairs.
+ virtual void OnCertificatesChanged(
+ y_absl::optional<y_absl::string_view> root_certs,
+ y_absl::optional<PemKeyCertPairList> key_cert_pairs) = 0;
+
+ // Handles an error that occurs while attempting to fetch certificate data.
+ // Note that if a watcher sees an error, it simply means the Provider is
+ // having problems renewing new data. If the watcher has previously received
+ // several OnCertificatesChanged, all the data received from that function
+ // is valid.
+ // In that case, watcher might simply log the error. If the watcher hasn't
+ // received any OnCertificatesChanged before the error occurs, no valid
+ // data is available yet, and the watcher should either fail or "waiting"
+ // for the valid data in a non-blocking way.
+ //
+ // @param root_cert_error the error occurred while reloading root
+ // certificates.
+ // @param identity_cert_error the error occurred while reloading identity
+ // certificates.
+ virtual void OnError(grpc_error* root_cert_error,
+ grpc_error* identity_cert_error) = 0;
+ };
+
+ // Sets the key materials based on their certificate name. Note that we are
+ // not doing any copies for pem_root_certs and pem_key_cert_pairs. For
+ // pem_root_certs, the original string contents need to outlive the
+ // distributor; for pem_key_cert_pairs, internally it is taking two
+ // unique_ptr(s) to the credential string, so the ownership is actually
+ // transferred.
+ //
+ // @param cert_name The name of the certificates being updated.
+ // @param pem_root_certs The content of root certificates.
+ // @param pem_key_cert_pairs The content of identity key-cert pairs.
+ void SetKeyMaterials(const TString& cert_name,
+ y_absl::optional<TString> pem_root_certs,
+ y_absl::optional<PemKeyCertPairList> pem_key_cert_pairs);
+
+ bool HasRootCerts(const TString& root_cert_name);
+
+ bool HasKeyCertPairs(const TString& identity_cert_name);
+
+ // Propagates the error that the caller (e.g. Producer) encounters to all the
+ // watchers watching a particular certificate name.
+ //
+ // @param cert_name The watching cert name of the watchers that the caller
+ // wants to notify when encountering error.
+ // @param root_cert_error The error that the caller encounters when reloading
+ // root certs.
+ // @param identity_cert_error The error that the caller encounters when
+ // reloading identity certs.
+ void SetErrorForCert(const TString& cert_name,
+ y_absl::optional<grpc_error*> root_cert_error,
+ y_absl::optional<grpc_error*> identity_cert_error);
+
+ // Propagates the error that the caller (e.g. Producer) encounters to all
+ // watchers.
+ //
+ // @param error The error that the caller encounters.
+ void SetError(grpc_error* error);
+
+ // Sets the TLS certificate watch status callback function. The
+ // grpc_tls_certificate_distributor will invoke this callback when a new
+ // certificate name is watched by a newly registered watcher, or when a
+ // certificate name is no longer watched by any watchers.
+ // Note that when the callback shows a cert is no longer being watched, the
+ // distributor will delete the corresponding certificate data from its cache,
+ // and clear the corresponding error, if there is any. This means that if the
+ // callback subsequently says the same cert is now being watched again, the
+ // provider must re-provide the credentials or re-invoke the errors to the
+ // distributor, to indicate a successful or failed reloading.
+ // @param callback The callback function being set by the caller, e.g the
+ // Producer. Note that this callback will be invoked for each certificate
+ // name.
+ //
+ // For the parameters in the callback function:
+ // string_value The name of the certificates being watched.
+ // bool_value_1 If the root certificates with the specific name are being
+ // watched. bool_value_2 If the identity certificates with the specific name
+ // are being watched.
+ void SetWatchStatusCallback(
+ std::function<void(TString, bool, bool)> callback) {
+ grpc_core::MutexLock lock(&mu_);
+ watch_status_callback_ = callback;
+ };
+
+ // Registers a watcher. The caller may keep a raw pointer to the watcher,
+ // which may be used only for cancellation. (Because the caller does not own
+ // the watcher, the pointer must not be used for any other purpose.) At least
+ // one of root_cert_name and identity_cert_name must be specified.
+ //
+ // @param watcher The watcher being registered.
+ // @param root_cert_name The name of the root certificates that will be
+ // watched. If set to y_absl::nullopt, the root certificates won't be watched.
+ // @param identity_cert_name The name of the identity certificates that will
+ // be watched. If set to y_absl::nullopt, the identity certificates won't be
+ // watched.
+ void WatchTlsCertificates(
+ std::unique_ptr<TlsCertificatesWatcherInterface> watcher,
+ y_absl::optional<TString> root_cert_name,
+ y_absl::optional<TString> identity_cert_name);
+
+ // Cancels a watcher.
+ //
+ // @param watcher The watcher being cancelled.
+ void CancelTlsCertificatesWatch(TlsCertificatesWatcherInterface* watcher);
+
+ private:
+ // Contains the information about each watcher.
+ struct WatcherInfo {
+ std::unique_ptr<TlsCertificatesWatcherInterface> watcher;
+ y_absl::optional<TString> root_cert_name;
+ y_absl::optional<TString> identity_cert_name;
+ };
+ // CertificateInfo contains the credential contents and some additional
+ // watcher information.
+ // Note that having errors doesn't indicate the corresponding credentials are
+ // invalid. For example, if root_cert_error != nullptr but pem_root_certs has
+ // value, it simply means an error occurs while trying to fetch the latest
+ // root certs, while pem_root_certs still contains the valid old data.
+ struct CertificateInfo {
+ // The contents of the root certificates.
+ TString pem_root_certs;
+ // The contents of the identity key-certificate pairs.
+ PemKeyCertPairList pem_key_cert_pairs;
+ // The root cert reloading error propagated by the caller.
+ grpc_error* root_cert_error = GRPC_ERROR_NONE;
+ // The identity cert reloading error propagated by the caller.
+ grpc_error* identity_cert_error = GRPC_ERROR_NONE;
+ // The set of watchers watching root certificates.
+ // This is mainly used for quickly looking up the affected watchers while
+ // performing a credential reloading.
+ std::set<TlsCertificatesWatcherInterface*> root_cert_watchers;
+ // The set of watchers watching identity certificates. This is mainly used
+ // for quickly looking up the affected watchers while performing a
+ // credential reloading.
+ std::set<TlsCertificatesWatcherInterface*> identity_cert_watchers;
+
+ ~CertificateInfo() {
+ GRPC_ERROR_UNREF(root_cert_error);
+ GRPC_ERROR_UNREF(identity_cert_error);
+ }
+ void SetRootError(grpc_error* error) {
+ GRPC_ERROR_UNREF(root_cert_error);
+ root_cert_error = error;
+ }
+ void SetIdentityError(grpc_error* error) {
+ GRPC_ERROR_UNREF(identity_cert_error);
+ identity_cert_error = error;
+ }
+ };
+
+ grpc_core::Mutex mu_;
+ // We need a dedicated mutex for watch_status_callback_ for allowing
+ // callers(e.g. Producer) to directly set key materials in the callback
+ // functions.
+ grpc_core::Mutex callback_mu_;
+ // Stores information about each watcher.
+ std::map<TlsCertificatesWatcherInterface*, WatcherInfo> watchers_;
+ // The callback to notify the caller, e.g. the Producer, that the watch status
+ // is changed.
+ std::function<void(TString, bool, bool)> watch_status_callback_;
+ // Stores the names of each certificate, and their corresponding credential
+ // contents as well as some additional watcher information.
+ std::map<TString, CertificateInfo> certificate_info_map_;
+};
+
+#endif // GRPC_CORE_LIB_SECURITY_CREDENTIALS_TLS_GRPC_TLS_CERTIFICATE_DISTRIBUTOR_H
diff --git a/contrib/libs/grpc/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.cc b/contrib/libs/grpc/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.cc
index 48581cf967d..906a2f02099 100644
--- a/contrib/libs/grpc/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.cc
+++ b/contrib/libs/grpc/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.cc
@@ -29,30 +29,30 @@
/** -- gRPC TLS key materials config API implementation. -- **/
void grpc_tls_key_materials_config::set_key_materials(
- const char* pem_root_certs,
- const grpc_ssl_pem_key_cert_pair** pem_key_cert_pairs,
- size_t num_key_cert_pairs) {
- this->set_pem_root_certs(pem_root_certs);
- grpc_tls_key_materials_config::PemKeyCertPairList cert_pair_list;
- for (size_t i = 0; i < num_key_cert_pairs; i++) {
- auto current_pair = static_cast<grpc_ssl_pem_key_cert_pair*>(
- gpr_zalloc(sizeof(grpc_ssl_pem_key_cert_pair)));
- current_pair->cert_chain = gpr_strdup(pem_key_cert_pairs[i]->cert_chain);
- current_pair->private_key = gpr_strdup(pem_key_cert_pairs[i]->private_key);
- cert_pair_list.emplace_back(grpc_core::PemKeyCertPair(current_pair));
- }
- pem_key_cert_pair_list_ = std::move(cert_pair_list);
-}
-
-void grpc_tls_key_materials_config::set_key_materials(
- const char* pem_root_certs,
- const PemKeyCertPairList& pem_key_cert_pair_list) {
- this->set_pem_root_certs(pem_root_certs);
- grpc_tls_key_materials_config::PemKeyCertPairList dup_list(
- pem_key_cert_pair_list);
- pem_key_cert_pair_list_ = std::move(dup_list);
-}
-
+ const char* pem_root_certs,
+ const grpc_ssl_pem_key_cert_pair** pem_key_cert_pairs,
+ size_t num_key_cert_pairs) {
+ this->set_pem_root_certs(pem_root_certs);
+ grpc_tls_key_materials_config::PemKeyCertPairList cert_pair_list;
+ for (size_t i = 0; i < num_key_cert_pairs; i++) {
+ auto current_pair = static_cast<grpc_ssl_pem_key_cert_pair*>(
+ gpr_zalloc(sizeof(grpc_ssl_pem_key_cert_pair)));
+ current_pair->cert_chain = gpr_strdup(pem_key_cert_pairs[i]->cert_chain);
+ current_pair->private_key = gpr_strdup(pem_key_cert_pairs[i]->private_key);
+ cert_pair_list.emplace_back(grpc_core::PemKeyCertPair(current_pair));
+ }
+ pem_key_cert_pair_list_ = std::move(cert_pair_list);
+}
+
+void grpc_tls_key_materials_config::set_key_materials(
+ const char* pem_root_certs,
+ const PemKeyCertPairList& pem_key_cert_pair_list) {
+ this->set_pem_root_certs(pem_root_certs);
+ grpc_tls_key_materials_config::PemKeyCertPairList dup_list(
+ pem_key_cert_pair_list);
+ pem_key_cert_pair_list_ = std::move(dup_list);
+}
+
/** -- gRPC TLS credential reload config API implementation. -- **/
grpc_tls_credential_reload_config::grpc_tls_credential_reload_config(
const void* config_user_data,
@@ -110,26 +110,26 @@ int grpc_tls_credentials_options_set_cert_request_type(
return 1;
}
-int grpc_tls_credentials_options_set_server_verification_option(
- grpc_tls_credentials_options* options,
- grpc_tls_server_verification_option server_verification_option) {
- if (options == nullptr) {
- gpr_log(GPR_ERROR,
- "Invalid nullptr arguments to "
- "grpc_tls_credentials_options_set_server_verification_option()");
- return 0;
- }
- if (server_verification_option != GRPC_TLS_SERVER_VERIFICATION &&
- options->server_authorization_check_config() == nullptr) {
- gpr_log(GPR_ERROR,
- "server_authorization_check_config needs to be specified when"
- "server_verification_option is not GRPC_TLS_SERVER_VERIFICATION");
- return 0;
- }
- options->set_server_verification_option(server_verification_option);
- return 1;
-}
-
+int grpc_tls_credentials_options_set_server_verification_option(
+ grpc_tls_credentials_options* options,
+ grpc_tls_server_verification_option server_verification_option) {
+ if (options == nullptr) {
+ gpr_log(GPR_ERROR,
+ "Invalid nullptr arguments to "
+ "grpc_tls_credentials_options_set_server_verification_option()");
+ return 0;
+ }
+ if (server_verification_option != GRPC_TLS_SERVER_VERIFICATION &&
+ options->server_authorization_check_config() == nullptr) {
+ gpr_log(GPR_ERROR,
+ "server_authorization_check_config needs to be specified when"
+ "server_verification_option is not GRPC_TLS_SERVER_VERIFICATION");
+ return 0;
+ }
+ options->set_server_verification_option(server_verification_option);
+ return 1;
+}
+
int grpc_tls_credentials_options_set_key_materials_config(
grpc_tls_credentials_options* options,
grpc_tls_key_materials_config* config) {
@@ -183,7 +183,7 @@ int grpc_tls_key_materials_config_set_key_materials(
"grpc_tls_key_materials_config_set_key_materials()");
return 0;
}
- config->set_key_materials(root_certs, key_cert_pairs, num);
+ config->set_key_materials(root_certs, key_cert_pairs, num);
return 1;
}
diff --git a/contrib/libs/grpc/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h b/contrib/libs/grpc/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h
index 864f659e616..59411d41692 100644
--- a/contrib/libs/grpc/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h
+++ b/contrib/libs/grpc/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h
@@ -23,29 +23,29 @@
#include <grpc/grpc_security.h>
-#include "y_absl/container/inlined_vector.h"
-
+#include "y_absl/container/inlined_vector.h"
+
#include "src/core/lib/gprpp/ref_counted.h"
#include "src/core/lib/security/security_connector/ssl_utils.h"
-struct grpc_tls_error_details
- : public grpc_core::RefCounted<grpc_tls_error_details> {
- public:
- grpc_tls_error_details() : error_details_("") {}
- void set_error_details(const char* err_details) {
- error_details_ = err_details;
- }
- const TString& error_details() { return error_details_; }
-
- private:
- TString error_details_;
-};
-
+struct grpc_tls_error_details
+ : public grpc_core::RefCounted<grpc_tls_error_details> {
+ public:
+ grpc_tls_error_details() : error_details_("") {}
+ void set_error_details(const char* err_details) {
+ error_details_ = err_details;
+ }
+ const TString& error_details() { return error_details_; }
+
+ private:
+ TString error_details_;
+};
+
/** TLS key materials config. **/
struct grpc_tls_key_materials_config
: public grpc_core::RefCounted<grpc_tls_key_materials_config> {
public:
- typedef y_absl::InlinedVector<grpc_core::PemKeyCertPair, 1> PemKeyCertPairList;
+ typedef y_absl::InlinedVector<grpc_core::PemKeyCertPair, 1> PemKeyCertPairList;
/** Getters for member fields. **/
const char* pem_root_certs() const { return pem_root_certs_.get(); }
@@ -55,28 +55,28 @@ struct grpc_tls_key_materials_config
int version() const { return version_; }
/** Setters for member fields. **/
- // TODO(ZhenLian): Remove this function
+ // TODO(ZhenLian): Remove this function
void set_pem_root_certs(grpc_core::UniquePtr<char> pem_root_certs) {
pem_root_certs_ = std::move(pem_root_certs);
}
- // The ownerships of |pem_root_certs| remain with the caller.
- void set_pem_root_certs(const char* pem_root_certs) {
- // make a copy of pem_root_certs.
- grpc_core::UniquePtr<char> pem_root_ptr(gpr_strdup(pem_root_certs));
- pem_root_certs_ = std::move(pem_root_ptr);
- }
+ // The ownerships of |pem_root_certs| remain with the caller.
+ void set_pem_root_certs(const char* pem_root_certs) {
+ // make a copy of pem_root_certs.
+ grpc_core::UniquePtr<char> pem_root_ptr(gpr_strdup(pem_root_certs));
+ pem_root_certs_ = std::move(pem_root_ptr);
+ }
void add_pem_key_cert_pair(grpc_core::PemKeyCertPair pem_key_cert_pair) {
pem_key_cert_pair_list_.push_back(pem_key_cert_pair);
}
- // The ownerships of |pem_root_certs| and |pem_key_cert_pairs| remain with the
- // caller.
- void set_key_materials(const char* pem_root_certs,
- const grpc_ssl_pem_key_cert_pair** pem_key_cert_pairs,
- size_t num_key_cert_pairs);
- // The ownerships of |pem_root_certs| and |pem_key_cert_pair_list| remain with
- // the caller.
- void set_key_materials(const char* pem_root_certs,
- const PemKeyCertPairList& pem_key_cert_pair_list);
+ // The ownerships of |pem_root_certs| and |pem_key_cert_pairs| remain with the
+ // caller.
+ void set_key_materials(const char* pem_root_certs,
+ const grpc_ssl_pem_key_cert_pair** pem_key_cert_pairs,
+ size_t num_key_cert_pairs);
+ // The ownerships of |pem_root_certs| and |pem_key_cert_pair_list| remain with
+ // the caller.
+ void set_key_materials(const char* pem_root_certs,
+ const PemKeyCertPairList& pem_key_cert_pair_list);
void set_version(int version) { version_ = version; }
private:
@@ -106,8 +106,8 @@ struct grpc_tls_credential_reload_config
gpr_log(GPR_ERROR, "schedule API is nullptr");
if (arg != nullptr) {
arg->status = GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_FAIL;
- arg->error_details->set_error_details(
- "schedule API in credential reload config is nullptr");
+ arg->error_details->set_error_details(
+ "schedule API in credential reload config is nullptr");
}
return 1;
}
@@ -121,8 +121,8 @@ struct grpc_tls_credential_reload_config
gpr_log(GPR_ERROR, "cancel API is nullptr.");
if (arg != nullptr) {
arg->status = GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_FAIL;
- arg->error_details->set_error_details(
- "cancel API in credential reload config is nullptr");
+ arg->error_details->set_error_details(
+ "cancel API in credential reload config is nullptr");
}
return;
}
@@ -182,7 +182,7 @@ struct grpc_tls_server_authorization_check_config
gpr_log(GPR_ERROR, "schedule API is nullptr");
if (arg != nullptr) {
arg->status = GRPC_STATUS_NOT_FOUND;
- arg->error_details->set_error_details(
+ arg->error_details->set_error_details(
"schedule API in server authorization check config is nullptr");
}
return 1;
@@ -198,7 +198,7 @@ struct grpc_tls_server_authorization_check_config
gpr_log(GPR_ERROR, "cancel API is nullptr.");
if (arg != nullptr) {
arg->status = GRPC_STATUS_NOT_FOUND;
- arg->error_details->set_error_details(
+ arg->error_details->set_error_details(
"schedule API in server authorization check config is nullptr");
}
return;
@@ -261,11 +261,11 @@ struct grpc_tls_credentials_options
grpc_ssl_client_certificate_request_type cert_request_type() const {
return cert_request_type_;
}
- grpc_tls_server_verification_option server_verification_option() const {
- return server_verification_option_;
- }
- grpc_tls_version min_tls_version() const { return min_tls_version_; }
- grpc_tls_version max_tls_version() const { return max_tls_version_; }
+ grpc_tls_server_verification_option server_verification_option() const {
+ return server_verification_option_;
+ }
+ grpc_tls_version min_tls_version() const { return min_tls_version_; }
+ grpc_tls_version max_tls_version() const { return max_tls_version_; }
grpc_tls_key_materials_config* key_materials_config() const {
return key_materials_config_.get();
}
@@ -282,16 +282,16 @@ struct grpc_tls_credentials_options
const grpc_ssl_client_certificate_request_type type) {
cert_request_type_ = type;
}
- void set_server_verification_option(
- const grpc_tls_server_verification_option server_verification_option) {
- server_verification_option_ = server_verification_option;
- }
- void set_min_tls_version(grpc_tls_version min_tls_version) {
- min_tls_version_ = min_tls_version;
- }
- void set_max_tls_version(grpc_tls_version max_tls_version) {
- max_tls_version_ = max_tls_version;
- }
+ void set_server_verification_option(
+ const grpc_tls_server_verification_option server_verification_option) {
+ server_verification_option_ = server_verification_option;
+ }
+ void set_min_tls_version(grpc_tls_version min_tls_version) {
+ min_tls_version_ = min_tls_version;
+ }
+ void set_max_tls_version(grpc_tls_version max_tls_version) {
+ max_tls_version_ = max_tls_version;
+ }
void set_key_materials_config(
grpc_core::RefCountedPtr<grpc_tls_key_materials_config> config) {
key_materials_config_ = std::move(config);
@@ -308,10 +308,10 @@ struct grpc_tls_credentials_options
private:
grpc_ssl_client_certificate_request_type cert_request_type_;
- grpc_tls_server_verification_option server_verification_option_ =
- GRPC_TLS_SERVER_VERIFICATION;
- grpc_tls_version min_tls_version_ = grpc_tls_version::TLS1_2;
- grpc_tls_version max_tls_version_ = grpc_tls_version::TLS1_3;
+ grpc_tls_server_verification_option server_verification_option_ =
+ GRPC_TLS_SERVER_VERIFICATION;
+ grpc_tls_version min_tls_version_ = grpc_tls_version::TLS1_2;
+ grpc_tls_version max_tls_version_ = grpc_tls_version::TLS1_3;
grpc_core::RefCountedPtr<grpc_tls_key_materials_config> key_materials_config_;
grpc_core::RefCountedPtr<grpc_tls_credential_reload_config>
credential_reload_config_;
diff --git a/contrib/libs/grpc/src/core/lib/security/credentials/tls/tls_credentials.cc b/contrib/libs/grpc/src/core/lib/security/credentials/tls/tls_credentials.cc
index 830c9b29854..701fd3b1502 100644
--- a/contrib/libs/grpc/src/core/lib/security/credentials/tls/tls_credentials.cc
+++ b/contrib/libs/grpc/src/core/lib/security/credentials/tls/tls_credentials.cc
@@ -1,128 +1,128 @@
-/*
- *
- * Copyright 2018 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <grpc/support/port_platform.h>
-
-#include "src/core/lib/security/credentials/tls/tls_credentials.h"
-
-#include <cstring>
-
-#include <grpc/grpc.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/string_util.h>
-
-#include "src/core/lib/channel/channel_args.h"
-#include "src/core/lib/security/security_connector/tls/tls_security_connector.h"
-
-#define GRPC_CREDENTIALS_TYPE_TLS "Tls"
-
-namespace {
-
-bool CredentialOptionSanityCheck(const grpc_tls_credentials_options* options,
- bool is_client) {
- if (options == nullptr) {
- gpr_log(GPR_ERROR, "TLS credentials options is nullptr.");
- return false;
- }
- if (options->key_materials_config() == nullptr &&
- options->credential_reload_config() == nullptr) {
- gpr_log(GPR_ERROR,
- "TLS credentials options must specify either key materials or "
- "credential reload config.");
- return false;
- }
- if (!is_client && options->server_authorization_check_config() != nullptr) {
- gpr_log(GPR_INFO,
- "Server's credentials options should not contain server "
- "authorization check config.");
- }
- return true;
-}
-
-} // namespace
-
-TlsCredentials::TlsCredentials(
- grpc_core::RefCountedPtr<grpc_tls_credentials_options> options)
- : grpc_channel_credentials(GRPC_CREDENTIALS_TYPE_TLS),
- options_(std::move(options)) {}
-
-TlsCredentials::~TlsCredentials() {}
-
-grpc_core::RefCountedPtr<grpc_channel_security_connector>
-TlsCredentials::create_security_connector(
- grpc_core::RefCountedPtr<grpc_call_credentials> call_creds,
- const char* target_name, const grpc_channel_args* args,
- grpc_channel_args** new_args) {
- const char* overridden_target_name = nullptr;
- tsi_ssl_session_cache* ssl_session_cache = nullptr;
- for (size_t i = 0; args != nullptr && i < args->num_args; i++) {
- grpc_arg* arg = &args->args[i];
- if (strcmp(arg->key, GRPC_SSL_TARGET_NAME_OVERRIDE_ARG) == 0 &&
- arg->type == GRPC_ARG_STRING) {
- overridden_target_name = arg->value.string;
- }
- if (strcmp(arg->key, GRPC_SSL_SESSION_CACHE_ARG) == 0 &&
- arg->type == GRPC_ARG_POINTER) {
- ssl_session_cache =
- static_cast<tsi_ssl_session_cache*>(arg->value.pointer.p);
- }
- }
- grpc_core::RefCountedPtr<grpc_channel_security_connector> sc =
- grpc_core::TlsChannelSecurityConnector::CreateTlsChannelSecurityConnector(
- this->Ref(), std::move(call_creds), target_name,
- overridden_target_name, ssl_session_cache);
- if (sc == nullptr) {
- return nullptr;
- }
- grpc_arg new_arg = grpc_channel_arg_string_create(
- (char*)GRPC_ARG_HTTP2_SCHEME, (char*)"https");
- *new_args = grpc_channel_args_copy_and_add(args, &new_arg, 1);
- return sc;
-}
-
-TlsServerCredentials::TlsServerCredentials(
- grpc_core::RefCountedPtr<grpc_tls_credentials_options> options)
- : grpc_server_credentials(GRPC_CREDENTIALS_TYPE_TLS),
- options_(std::move(options)) {}
-
-TlsServerCredentials::~TlsServerCredentials() {}
-
-grpc_core::RefCountedPtr<grpc_server_security_connector>
-TlsServerCredentials::create_security_connector() {
- return grpc_core::TlsServerSecurityConnector::
- CreateTlsServerSecurityConnector(this->Ref());
-}
-
-grpc_channel_credentials* grpc_tls_credentials_create(
- grpc_tls_credentials_options* options) {
- if (!CredentialOptionSanityCheck(options, true /* is_client */)) {
- return nullptr;
- }
- return new TlsCredentials(
- grpc_core::RefCountedPtr<grpc_tls_credentials_options>(options));
-}
-
-grpc_server_credentials* grpc_tls_server_credentials_create(
- grpc_tls_credentials_options* options) {
- if (!CredentialOptionSanityCheck(options, false /* is_client */)) {
- return nullptr;
- }
- return new TlsServerCredentials(
- grpc_core::RefCountedPtr<grpc_tls_credentials_options>(options));
-}
+/*
+ *
+ * Copyright 2018 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/lib/security/credentials/tls/tls_credentials.h"
+
+#include <cstring>
+
+#include <grpc/grpc.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
+
+#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/security/security_connector/tls/tls_security_connector.h"
+
+#define GRPC_CREDENTIALS_TYPE_TLS "Tls"
+
+namespace {
+
+bool CredentialOptionSanityCheck(const grpc_tls_credentials_options* options,
+ bool is_client) {
+ if (options == nullptr) {
+ gpr_log(GPR_ERROR, "TLS credentials options is nullptr.");
+ return false;
+ }
+ if (options->key_materials_config() == nullptr &&
+ options->credential_reload_config() == nullptr) {
+ gpr_log(GPR_ERROR,
+ "TLS credentials options must specify either key materials or "
+ "credential reload config.");
+ return false;
+ }
+ if (!is_client && options->server_authorization_check_config() != nullptr) {
+ gpr_log(GPR_INFO,
+ "Server's credentials options should not contain server "
+ "authorization check config.");
+ }
+ return true;
+}
+
+} // namespace
+
+TlsCredentials::TlsCredentials(
+ grpc_core::RefCountedPtr<grpc_tls_credentials_options> options)
+ : grpc_channel_credentials(GRPC_CREDENTIALS_TYPE_TLS),
+ options_(std::move(options)) {}
+
+TlsCredentials::~TlsCredentials() {}
+
+grpc_core::RefCountedPtr<grpc_channel_security_connector>
+TlsCredentials::create_security_connector(
+ grpc_core::RefCountedPtr<grpc_call_credentials> call_creds,
+ const char* target_name, const grpc_channel_args* args,
+ grpc_channel_args** new_args) {
+ const char* overridden_target_name = nullptr;
+ tsi_ssl_session_cache* ssl_session_cache = nullptr;
+ for (size_t i = 0; args != nullptr && i < args->num_args; i++) {
+ grpc_arg* arg = &args->args[i];
+ if (strcmp(arg->key, GRPC_SSL_TARGET_NAME_OVERRIDE_ARG) == 0 &&
+ arg->type == GRPC_ARG_STRING) {
+ overridden_target_name = arg->value.string;
+ }
+ if (strcmp(arg->key, GRPC_SSL_SESSION_CACHE_ARG) == 0 &&
+ arg->type == GRPC_ARG_POINTER) {
+ ssl_session_cache =
+ static_cast<tsi_ssl_session_cache*>(arg->value.pointer.p);
+ }
+ }
+ grpc_core::RefCountedPtr<grpc_channel_security_connector> sc =
+ grpc_core::TlsChannelSecurityConnector::CreateTlsChannelSecurityConnector(
+ this->Ref(), std::move(call_creds), target_name,
+ overridden_target_name, ssl_session_cache);
+ if (sc == nullptr) {
+ return nullptr;
+ }
+ grpc_arg new_arg = grpc_channel_arg_string_create(
+ (char*)GRPC_ARG_HTTP2_SCHEME, (char*)"https");
+ *new_args = grpc_channel_args_copy_and_add(args, &new_arg, 1);
+ return sc;
+}
+
+TlsServerCredentials::TlsServerCredentials(
+ grpc_core::RefCountedPtr<grpc_tls_credentials_options> options)
+ : grpc_server_credentials(GRPC_CREDENTIALS_TYPE_TLS),
+ options_(std::move(options)) {}
+
+TlsServerCredentials::~TlsServerCredentials() {}
+
+grpc_core::RefCountedPtr<grpc_server_security_connector>
+TlsServerCredentials::create_security_connector() {
+ return grpc_core::TlsServerSecurityConnector::
+ CreateTlsServerSecurityConnector(this->Ref());
+}
+
+grpc_channel_credentials* grpc_tls_credentials_create(
+ grpc_tls_credentials_options* options) {
+ if (!CredentialOptionSanityCheck(options, true /* is_client */)) {
+ return nullptr;
+ }
+ return new TlsCredentials(
+ grpc_core::RefCountedPtr<grpc_tls_credentials_options>(options));
+}
+
+grpc_server_credentials* grpc_tls_server_credentials_create(
+ grpc_tls_credentials_options* options) {
+ if (!CredentialOptionSanityCheck(options, false /* is_client */)) {
+ return nullptr;
+ }
+ return new TlsServerCredentials(
+ grpc_core::RefCountedPtr<grpc_tls_credentials_options>(options));
+}
diff --git a/contrib/libs/grpc/src/core/lib/security/credentials/tls/tls_credentials.h b/contrib/libs/grpc/src/core/lib/security/credentials/tls/tls_credentials.h
index 27608a054bd..388c71f6b73 100644
--- a/contrib/libs/grpc/src/core/lib/security/credentials/tls/tls_credentials.h
+++ b/contrib/libs/grpc/src/core/lib/security/credentials/tls/tls_credentials.h
@@ -1,62 +1,62 @@
-/*
- *
- * Copyright 2018 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#ifndef GRPC_CORE_LIB_SECURITY_CREDENTIALS_TLS_TLS_CREDENTIALS_H
-#define GRPC_CORE_LIB_SECURITY_CREDENTIALS_TLS_TLS_CREDENTIALS_H
-
-#include <grpc/support/port_platform.h>
-
-#include <grpc/grpc_security.h>
-
-#include "src/core/lib/security/credentials/credentials.h"
-#include "src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h"
-
-class TlsCredentials final : public grpc_channel_credentials {
- public:
- explicit TlsCredentials(
- grpc_core::RefCountedPtr<grpc_tls_credentials_options> options);
- ~TlsCredentials() override;
-
- grpc_core::RefCountedPtr<grpc_channel_security_connector>
- create_security_connector(
- grpc_core::RefCountedPtr<grpc_call_credentials> call_creds,
- const char* target_name, const grpc_channel_args* args,
- grpc_channel_args** new_args) override;
-
- const grpc_tls_credentials_options& options() const { return *options_; }
-
- private:
- grpc_core::RefCountedPtr<grpc_tls_credentials_options> options_;
-};
-
-class TlsServerCredentials final : public grpc_server_credentials {
- public:
- explicit TlsServerCredentials(
- grpc_core::RefCountedPtr<grpc_tls_credentials_options> options);
- ~TlsServerCredentials() override;
-
- grpc_core::RefCountedPtr<grpc_server_security_connector>
- create_security_connector() override;
-
- const grpc_tls_credentials_options& options() const { return *options_; }
-
- private:
- grpc_core::RefCountedPtr<grpc_tls_credentials_options> options_;
-};
-
-#endif /* GRPC_CORE_LIB_SECURITY_CREDENTIALS_TLS_TLS_CREDENTIALS_H */
+/*
+ *
+ * Copyright 2018 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef GRPC_CORE_LIB_SECURITY_CREDENTIALS_TLS_TLS_CREDENTIALS_H
+#define GRPC_CORE_LIB_SECURITY_CREDENTIALS_TLS_TLS_CREDENTIALS_H
+
+#include <grpc/support/port_platform.h>
+
+#include <grpc/grpc_security.h>
+
+#include "src/core/lib/security/credentials/credentials.h"
+#include "src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h"
+
+class TlsCredentials final : public grpc_channel_credentials {
+ public:
+ explicit TlsCredentials(
+ grpc_core::RefCountedPtr<grpc_tls_credentials_options> options);
+ ~TlsCredentials() override;
+
+ grpc_core::RefCountedPtr<grpc_channel_security_connector>
+ create_security_connector(
+ grpc_core::RefCountedPtr<grpc_call_credentials> call_creds,
+ const char* target_name, const grpc_channel_args* args,
+ grpc_channel_args** new_args) override;
+
+ const grpc_tls_credentials_options& options() const { return *options_; }
+
+ private:
+ grpc_core::RefCountedPtr<grpc_tls_credentials_options> options_;
+};
+
+class TlsServerCredentials final : public grpc_server_credentials {
+ public:
+ explicit TlsServerCredentials(
+ grpc_core::RefCountedPtr<grpc_tls_credentials_options> options);
+ ~TlsServerCredentials() override;
+
+ grpc_core::RefCountedPtr<grpc_server_security_connector>
+ create_security_connector() override;
+
+ const grpc_tls_credentials_options& options() const { return *options_; }
+
+ private:
+ grpc_core::RefCountedPtr<grpc_tls_credentials_options> options_;
+};
+
+#endif /* GRPC_CORE_LIB_SECURITY_CREDENTIALS_TLS_TLS_CREDENTIALS_H */
diff --git a/contrib/libs/grpc/src/core/lib/security/credentials/xds/xds_credentials.cc b/contrib/libs/grpc/src/core/lib/security/credentials/xds/xds_credentials.cc
index a34a584f4c2..682d49badb0 100644
--- a/contrib/libs/grpc/src/core/lib/security/credentials/xds/xds_credentials.cc
+++ b/contrib/libs/grpc/src/core/lib/security/credentials/xds/xds_credentials.cc
@@ -1,45 +1,45 @@
-//
-//
-// Copyright 2020 gRPC authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//
-
-#include <grpc/support/port_platform.h>
-
-#include "src/core/lib/security/credentials/xds/xds_credentials.h"
-
-namespace grpc_core {
-
-constexpr const char XdsCredentials::kCredentialsTypeXds[];
-
-grpc_core::RefCountedPtr<grpc_channel_security_connector>
-XdsCredentials::create_security_connector(
- grpc_core::RefCountedPtr<grpc_call_credentials> call_creds,
- const char* target_name, const grpc_channel_args* args,
- grpc_channel_args** new_args) {
- /* TODO(yashkt) : To be filled */
- if (fallback_credentials_ != nullptr) {
- return fallback_credentials_->create_security_connector(
- std::move(call_creds), target_name, args, new_args);
- }
- return nullptr;
-}
-
-} // namespace grpc_core
-
-grpc_channel_credentials* grpc_xds_credentials_create(
- grpc_channel_credentials* fallback_credentials) {
- return new grpc_core::XdsCredentials(fallback_credentials->Ref());
-}
+//
+//
+// Copyright 2020 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+//
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/lib/security/credentials/xds/xds_credentials.h"
+
+namespace grpc_core {
+
+constexpr const char XdsCredentials::kCredentialsTypeXds[];
+
+grpc_core::RefCountedPtr<grpc_channel_security_connector>
+XdsCredentials::create_security_connector(
+ grpc_core::RefCountedPtr<grpc_call_credentials> call_creds,
+ const char* target_name, const grpc_channel_args* args,
+ grpc_channel_args** new_args) {
+ /* TODO(yashkt) : To be filled */
+ if (fallback_credentials_ != nullptr) {
+ return fallback_credentials_->create_security_connector(
+ std::move(call_creds), target_name, args, new_args);
+ }
+ return nullptr;
+}
+
+} // namespace grpc_core
+
+grpc_channel_credentials* grpc_xds_credentials_create(
+ grpc_channel_credentials* fallback_credentials) {
+ return new grpc_core::XdsCredentials(fallback_credentials->Ref());
+}
diff --git a/contrib/libs/grpc/src/core/lib/security/credentials/xds/xds_credentials.h b/contrib/libs/grpc/src/core/lib/security/credentials/xds/xds_credentials.h
index fc84d48afac..51576deebd8 100644
--- a/contrib/libs/grpc/src/core/lib/security/credentials/xds/xds_credentials.h
+++ b/contrib/libs/grpc/src/core/lib/security/credentials/xds/xds_credentials.h
@@ -1,51 +1,51 @@
-//
-//
-// Copyright 2020 gRPC authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//
-
-#ifndef GRPC_CORE_LIB_SECURITY_CREDENTIALS_XDS_XDS_CREDENTIALS_H
-#define GRPC_CORE_LIB_SECURITY_CREDENTIALS_XDS_XDS_CREDENTIALS_H
-
-#include <grpc/support/port_platform.h>
-
-#include <grpc/grpc_security.h>
-
-#include "src/core/lib/security/credentials/credentials.h"
-
-namespace grpc_core {
-
-class XdsCredentials final : public grpc_channel_credentials {
- public:
- static constexpr const char kCredentialsTypeXds[] = "Xds";
-
- explicit XdsCredentials(
- grpc_core::RefCountedPtr<grpc_channel_credentials> fallback_credentials)
- : grpc_channel_credentials(kCredentialsTypeXds),
- fallback_credentials_(std::move(fallback_credentials)) {}
-
- grpc_core::RefCountedPtr<grpc_channel_security_connector>
- create_security_connector(
- grpc_core::RefCountedPtr<grpc_call_credentials> call_creds,
- const char* target_name, const grpc_channel_args* args,
- grpc_channel_args** new_args) override;
-
- private:
- grpc_core::RefCountedPtr<grpc_channel_credentials> fallback_credentials_;
-};
-
-} // namespace grpc_core
-
-#endif /* GRPC_CORE_LIB_SECURITY_CREDENTIALS_XDS_XDS_CREDENTIALS_H */
+//
+//
+// Copyright 2020 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+//
+
+#ifndef GRPC_CORE_LIB_SECURITY_CREDENTIALS_XDS_XDS_CREDENTIALS_H
+#define GRPC_CORE_LIB_SECURITY_CREDENTIALS_XDS_XDS_CREDENTIALS_H
+
+#include <grpc/support/port_platform.h>
+
+#include <grpc/grpc_security.h>
+
+#include "src/core/lib/security/credentials/credentials.h"
+
+namespace grpc_core {
+
+class XdsCredentials final : public grpc_channel_credentials {
+ public:
+ static constexpr const char kCredentialsTypeXds[] = "Xds";
+
+ explicit XdsCredentials(
+ grpc_core::RefCountedPtr<grpc_channel_credentials> fallback_credentials)
+ : grpc_channel_credentials(kCredentialsTypeXds),
+ fallback_credentials_(std::move(fallback_credentials)) {}
+
+ grpc_core::RefCountedPtr<grpc_channel_security_connector>
+ create_security_connector(
+ grpc_core::RefCountedPtr<grpc_call_credentials> call_creds,
+ const char* target_name, const grpc_channel_args* args,
+ grpc_channel_args** new_args) override;
+
+ private:
+ grpc_core::RefCountedPtr<grpc_channel_credentials> fallback_credentials_;
+};
+
+} // namespace grpc_core
+
+#endif /* GRPC_CORE_LIB_SECURITY_CREDENTIALS_XDS_XDS_CREDENTIALS_H */
diff --git a/contrib/libs/grpc/src/core/lib/security/security_connector/alts/alts_security_connector.cc b/contrib/libs/grpc/src/core/lib/security/security_connector/alts/alts_security_connector.cc
index 1902528bc6a..d0b532ae182 100644
--- a/contrib/libs/grpc/src/core/lib/security/security_connector/alts/alts_security_connector.cc
+++ b/contrib/libs/grpc/src/core/lib/security/security_connector/alts/alts_security_connector.cc
@@ -82,17 +82,17 @@ class grpc_alts_channel_security_connector final
tsi_handshaker* handshaker = nullptr;
const grpc_alts_credentials* creds =
static_cast<const grpc_alts_credentials*>(channel_creds());
- size_t user_specified_max_frame_size = 0;
- const grpc_arg* arg =
- grpc_channel_args_find(args, GRPC_ARG_TSI_MAX_FRAME_SIZE);
- if (arg != nullptr && arg->type == GRPC_ARG_INTEGER) {
- user_specified_max_frame_size = grpc_channel_arg_get_integer(
- arg, {0, 0, std::numeric_limits<int>::max()});
- }
- GPR_ASSERT(alts_tsi_handshaker_create(
- creds->options(), target_name_,
- creds->handshaker_service_url(), true, interested_parties,
- &handshaker, user_specified_max_frame_size) == TSI_OK);
+ size_t user_specified_max_frame_size = 0;
+ const grpc_arg* arg =
+ grpc_channel_args_find(args, GRPC_ARG_TSI_MAX_FRAME_SIZE);
+ if (arg != nullptr && arg->type == GRPC_ARG_INTEGER) {
+ user_specified_max_frame_size = grpc_channel_arg_get_integer(
+ arg, {0, 0, std::numeric_limits<int>::max()});
+ }
+ GPR_ASSERT(alts_tsi_handshaker_create(
+ creds->options(), target_name_,
+ creds->handshaker_service_url(), true, interested_parties,
+ &handshaker, user_specified_max_frame_size) == TSI_OK);
handshake_manager->Add(
grpc_core::SecurityHandshakerCreate(handshaker, this, args));
}
@@ -111,7 +111,7 @@ class grpc_alts_channel_security_connector final
return strcmp(target_name_, other->target_name_);
}
- bool check_call_host(y_absl::string_view host,
+ bool check_call_host(y_absl::string_view host,
grpc_auth_context* /*auth_context*/,
grpc_closure* /*on_call_host_checked*/,
grpc_error** error) override {
@@ -147,17 +147,17 @@ class grpc_alts_server_security_connector final
tsi_handshaker* handshaker = nullptr;
const grpc_alts_server_credentials* creds =
static_cast<const grpc_alts_server_credentials*>(server_creds());
- size_t user_specified_max_frame_size = 0;
- const grpc_arg* arg =
- grpc_channel_args_find(args, GRPC_ARG_TSI_MAX_FRAME_SIZE);
- if (arg != nullptr && arg->type == GRPC_ARG_INTEGER) {
- user_specified_max_frame_size = grpc_channel_arg_get_integer(
- arg, {0, 0, std::numeric_limits<int>::max()});
- }
+ size_t user_specified_max_frame_size = 0;
+ const grpc_arg* arg =
+ grpc_channel_args_find(args, GRPC_ARG_TSI_MAX_FRAME_SIZE);
+ if (arg != nullptr && arg->type == GRPC_ARG_INTEGER) {
+ user_specified_max_frame_size = grpc_channel_arg_get_integer(
+ arg, {0, 0, std::numeric_limits<int>::max()});
+ }
GPR_ASSERT(alts_tsi_handshaker_create(
creds->options(), nullptr, creds->handshaker_service_url(),
- false, interested_parties, &handshaker,
- user_specified_max_frame_size) == TSI_OK);
+ false, interested_parties, &handshaker,
+ user_specified_max_frame_size) == TSI_OK);
handshake_manager->Add(
grpc_core::SecurityHandshakerCreate(handshaker, this, args));
}
@@ -193,13 +193,13 @@ grpc_alts_auth_context_from_tsi_peer(const tsi_peer* peer) {
gpr_log(GPR_ERROR, "Invalid or missing certificate type property.");
return nullptr;
}
- /* Check if security level exists. */
- const tsi_peer_property* security_level_prop =
- tsi_peer_get_property_by_name(peer, TSI_SECURITY_LEVEL_PEER_PROPERTY);
- if (security_level_prop == nullptr) {
- gpr_log(GPR_ERROR, "Missing security level property.");
- return nullptr;
- }
+ /* Check if security level exists. */
+ const tsi_peer_property* security_level_prop =
+ tsi_peer_get_property_by_name(peer, TSI_SECURITY_LEVEL_PEER_PROPERTY);
+ if (security_level_prop == nullptr) {
+ gpr_log(GPR_ERROR, "Missing security level property.");
+ return nullptr;
+ }
/* Validate RPC protocol versions. */
const tsi_peer_property* rpc_versions_prop =
tsi_peer_get_property_by_name(peer, TSI_ALTS_RPC_VERSIONS);
@@ -254,12 +254,12 @@ grpc_alts_auth_context_from_tsi_peer(const tsi_peer* peer) {
tsi_prop->value.data,
tsi_prop->value.length);
}
- /* Add security level to auth context. */
- if (strcmp(tsi_prop->name, TSI_SECURITY_LEVEL_PEER_PROPERTY) == 0) {
- grpc_auth_context_add_property(
- ctx.get(), GRPC_TRANSPORT_SECURITY_LEVEL_PROPERTY_NAME,
- tsi_prop->value.data, tsi_prop->value.length);
- }
+ /* Add security level to auth context. */
+ if (strcmp(tsi_prop->name, TSI_SECURITY_LEVEL_PEER_PROPERTY) == 0) {
+ grpc_auth_context_add_property(
+ ctx.get(), GRPC_TRANSPORT_SECURITY_LEVEL_PROPERTY_NAME,
+ tsi_prop->value.data, tsi_prop->value.length);
+ }
}
if (!grpc_auth_context_peer_is_authenticated(ctx.get())) {
gpr_log(GPR_ERROR, "Invalid unauthenticated peer.");
diff --git a/contrib/libs/grpc/src/core/lib/security/security_connector/fake/fake_security_connector.cc b/contrib/libs/grpc/src/core/lib/security/security_connector/fake/fake_security_connector.cc
index 6101c2d8e7b..efbf6d231c7 100644
--- a/contrib/libs/grpc/src/core/lib/security/security_connector/fake/fake_security_connector.cc
+++ b/contrib/libs/grpc/src/core/lib/security/security_connector/fake/fake_security_connector.cc
@@ -22,15 +22,15 @@
#include <stdbool.h>
-#include "y_absl/strings/str_cat.h"
-
+#include "y_absl/strings/str_cat.h"
+
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
#include "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h"
#include "src/core/ext/transport/chttp2/alpn/alpn.h"
-#include "src/core/ext/xds/xds_channel_args.h"
+#include "src/core/ext/xds/xds_channel_args.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/channel/handshaker.h"
#include "src/core/lib/gpr/string.h"
@@ -56,9 +56,9 @@ class grpc_fake_channel_security_connector final
target_(gpr_strdup(target)),
expected_targets_(
gpr_strdup(grpc_fake_transport_get_expected_targets(args))),
- is_lb_channel_(grpc_channel_args_find(
- args, GRPC_ARG_ADDRESS_IS_GRPCLB_LOAD_BALANCER) !=
- nullptr) {
+ is_lb_channel_(grpc_channel_args_find(
+ args, GRPC_ARG_ADDRESS_IS_GRPCLB_LOAD_BALANCER) !=
+ nullptr) {
const grpc_arg* target_name_override_arg =
grpc_channel_args_find(args, GRPC_SSL_TARGET_NAME_OVERRIDE_ARG);
if (target_name_override_arg != nullptr) {
@@ -102,20 +102,20 @@ class grpc_fake_channel_security_connector final
tsi_create_fake_handshaker(/*is_client=*/true), this, args));
}
- bool check_call_host(y_absl::string_view host,
+ bool check_call_host(y_absl::string_view host,
grpc_auth_context* /*auth_context*/,
grpc_closure* /*on_call_host_checked*/,
grpc_error** /*error*/) override {
- y_absl::string_view authority_hostname;
- y_absl::string_view authority_ignored_port;
- y_absl::string_view target_hostname;
- y_absl::string_view target_ignored_port;
+ y_absl::string_view authority_hostname;
+ y_absl::string_view authority_ignored_port;
+ y_absl::string_view target_hostname;
+ y_absl::string_view target_ignored_port;
grpc_core::SplitHostPort(host, &authority_hostname,
&authority_ignored_port);
grpc_core::SplitHostPort(target_, &target_hostname, &target_ignored_port);
if (target_name_override_ != nullptr) {
- y_absl::string_view fake_security_target_name_override_hostname;
- y_absl::string_view fake_security_target_name_override_ignored_port;
+ y_absl::string_view fake_security_target_name_override_hostname;
+ y_absl::string_view fake_security_target_name_override_ignored_port;
grpc_core::SplitHostPort(
target_name_override_, &fake_security_target_name_override_hostname,
&fake_security_target_name_override_ignored_port);
@@ -145,7 +145,7 @@ class grpc_fake_channel_security_connector final
char* target_name_override() const { return target_name_override_; }
private:
- bool fake_check_target(const char* target, const char* set_str) const {
+ bool fake_check_target(const char* target, const char* set_str) const {
GPR_ASSERT(target != nullptr);
char** set = nullptr;
size_t set_size = 0;
@@ -181,14 +181,14 @@ class grpc_fake_channel_security_connector final
expected_targets_);
goto done;
}
- if (!fake_check_target(target_, lbs_and_backends[1])) {
+ if (!fake_check_target(target_, lbs_and_backends[1])) {
gpr_log(GPR_ERROR, "LB target '%s' not found in expected set '%s'",
target_, lbs_and_backends[1]);
goto done;
}
success = true;
} else {
- if (!fake_check_target(target_, lbs_and_backends[0])) {
+ if (!fake_check_target(target_, lbs_and_backends[0])) {
gpr_log(GPR_ERROR, "Backend target '%s' not found in expected set '%s'",
target_, lbs_and_backends[0]);
goto done;
@@ -216,18 +216,18 @@ static void fake_check_peer(
const char* prop_name;
grpc_error* error = GRPC_ERROR_NONE;
*auth_context = nullptr;
- if (peer.property_count != 2) {
+ if (peer.property_count != 2) {
error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "Fake peers should only have 2 properties.");
+ "Fake peers should only have 2 properties.");
goto end;
}
prop_name = peer.properties[0].name;
if (prop_name == nullptr ||
strcmp(prop_name, TSI_CERTIFICATE_TYPE_PEER_PROPERTY)) {
- error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("Unexpected property in fake peer: ",
- prop_name == nullptr ? "<EMPTY>" : prop_name)
- .c_str());
+ error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrCat("Unexpected property in fake peer: ",
+ prop_name == nullptr ? "<EMPTY>" : prop_name)
+ .c_str());
goto end;
}
if (strncmp(peer.properties[0].value.data, TSI_FAKE_CERTIFICATE_TYPE,
@@ -236,29 +236,29 @@ static void fake_check_peer(
"Invalid value for cert type property.");
goto end;
}
- prop_name = peer.properties[1].name;
- if (prop_name == nullptr ||
- strcmp(prop_name, TSI_SECURITY_LEVEL_PEER_PROPERTY) != 0) {
- error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("Unexpected property in fake peer: ",
- prop_name == nullptr ? "<EMPTY>" : prop_name)
- .c_str());
- goto end;
- }
- if (strncmp(peer.properties[1].value.data, TSI_FAKE_SECURITY_LEVEL,
- peer.properties[1].value.length) != 0) {
- error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "Invalid value for security level property.");
- goto end;
- }
-
+ prop_name = peer.properties[1].name;
+ if (prop_name == nullptr ||
+ strcmp(prop_name, TSI_SECURITY_LEVEL_PEER_PROPERTY) != 0) {
+ error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrCat("Unexpected property in fake peer: ",
+ prop_name == nullptr ? "<EMPTY>" : prop_name)
+ .c_str());
+ goto end;
+ }
+ if (strncmp(peer.properties[1].value.data, TSI_FAKE_SECURITY_LEVEL,
+ peer.properties[1].value.length) != 0) {
+ error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Invalid value for security level property.");
+ goto end;
+ }
+
*auth_context = grpc_core::MakeRefCounted<grpc_auth_context>(nullptr);
grpc_auth_context_add_cstring_property(
auth_context->get(), GRPC_TRANSPORT_SECURITY_TYPE_PROPERTY_NAME,
GRPC_FAKE_TRANSPORT_SECURITY_TYPE);
- grpc_auth_context_add_cstring_property(
- auth_context->get(), GRPC_TRANSPORT_SECURITY_LEVEL_PROPERTY_NAME,
- TSI_FAKE_SECURITY_LEVEL);
+ grpc_auth_context_add_cstring_property(
+ auth_context->get(), GRPC_TRANSPORT_SECURITY_LEVEL_PROPERTY_NAME,
+ TSI_FAKE_SECURITY_LEVEL);
end:
grpc_core::ExecCtx::Run(DEBUG_LOCATION, on_peer_checked, error);
tsi_peer_destruct(&peer);
diff --git a/contrib/libs/grpc/src/core/lib/security/security_connector/load_system_roots_fallback.cc b/contrib/libs/grpc/src/core/lib/security/security_connector/load_system_roots_fallback.cc
index c7e31c136d7..f04d0ed225b 100644
--- a/contrib/libs/grpc/src/core/lib/security/security_connector/load_system_roots_fallback.cc
+++ b/contrib/libs/grpc/src/core/lib/security/security_connector/load_system_roots_fallback.cc
@@ -21,7 +21,7 @@
#include <grpc/slice_buffer.h>
#include "src/core/lib/security/security_connector/load_system_roots.h"
-#if !defined(GPR_LINUX) && !defined(GPR_ANDROID)
+#if !defined(GPR_LINUX) && !defined(GPR_ANDROID)
namespace grpc_core {
@@ -29,4 +29,4 @@ grpc_slice LoadSystemRootCerts() { return grpc_empty_slice(); }
} // namespace grpc_core
-#endif /* !(GPR_LINUX || GPR_ANDROID) */
+#endif /* !(GPR_LINUX || GPR_ANDROID) */
diff --git a/contrib/libs/grpc/src/core/lib/security/security_connector/load_system_roots_linux.cc b/contrib/libs/grpc/src/core/lib/security/security_connector/load_system_roots_linux.cc
index 374ad04620a..c0b6d5d727d 100644
--- a/contrib/libs/grpc/src/core/lib/security/security_connector/load_system_roots_linux.cc
+++ b/contrib/libs/grpc/src/core/lib/security/security_connector/load_system_roots_linux.cc
@@ -21,7 +21,7 @@
#include <grpc/slice_buffer.h>
#include "src/core/lib/security/security_connector/load_system_roots_linux.h"
-#if defined(GPR_LINUX) || defined(GPR_ANDROID)
+#if defined(GPR_LINUX) || defined(GPR_ANDROID)
#include "src/core/lib/security/security_connector/load_system_roots.h"
@@ -34,8 +34,8 @@
#include <sys/types.h>
#include <unistd.h>
-#include "y_absl/container/inlined_vector.h"
-
+#include "y_absl/container/inlined_vector.h"
+
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
@@ -101,7 +101,7 @@ grpc_slice CreateRootCertsBundle(const char* certs_directory) {
char path[MAXPATHLEN];
off_t size;
};
- y_absl::InlinedVector<FileData, 2> roots_filenames;
+ y_absl::InlinedVector<FileData, 2> roots_filenames;
size_t total_bundle_size = 0;
struct dirent* directory_entry;
while ((directory_entry = readdir(ca_directory)) != nullptr) {
@@ -168,4 +168,4 @@ grpc_slice LoadSystemRootCerts() {
} // namespace grpc_core
-#endif /* GPR_LINUX || GPR_ANDROID */
+#endif /* GPR_LINUX || GPR_ANDROID */
diff --git a/contrib/libs/grpc/src/core/lib/security/security_connector/local/local_security_connector.cc b/contrib/libs/grpc/src/core/lib/security/security_connector/local/local_security_connector.cc
index 7df71b2d4d6..8f622d4c226 100644
--- a/contrib/libs/grpc/src/core/lib/security/security_connector/local/local_security_connector.cc
+++ b/contrib/libs/grpc/src/core/lib/security/security_connector/local/local_security_connector.cc
@@ -46,8 +46,8 @@
namespace {
-grpc_core::RefCountedPtr<grpc_auth_context> local_auth_context_create(
- const tsi_peer* peer) {
+grpc_core::RefCountedPtr<grpc_auth_context> local_auth_context_create(
+ const tsi_peer* peer) {
/* Create auth context. */
grpc_core::RefCountedPtr<grpc_auth_context> ctx =
grpc_core::MakeRefCounted<grpc_auth_context>(nullptr);
@@ -56,17 +56,17 @@ grpc_core::RefCountedPtr<grpc_auth_context> local_auth_context_create(
GRPC_LOCAL_TRANSPORT_SECURITY_TYPE);
GPR_ASSERT(grpc_auth_context_set_peer_identity_property_name(
ctx.get(), GRPC_TRANSPORT_SECURITY_TYPE_PROPERTY_NAME) == 1);
- GPR_ASSERT(peer->property_count == 1);
- const tsi_peer_property* prop = &peer->properties[0];
- GPR_ASSERT(prop != nullptr);
- GPR_ASSERT(strcmp(prop->name, TSI_SECURITY_LEVEL_PEER_PROPERTY) == 0);
- grpc_auth_context_add_property(ctx.get(),
- GRPC_TRANSPORT_SECURITY_LEVEL_PROPERTY_NAME,
- prop->value.data, prop->value.length);
+ GPR_ASSERT(peer->property_count == 1);
+ const tsi_peer_property* prop = &peer->properties[0];
+ GPR_ASSERT(prop != nullptr);
+ GPR_ASSERT(strcmp(prop->name, TSI_SECURITY_LEVEL_PEER_PROPERTY) == 0);
+ grpc_auth_context_add_property(ctx.get(),
+ GRPC_TRANSPORT_SECURITY_LEVEL_PROPERTY_NAME,
+ prop->value.data, prop->value.length);
return ctx;
}
-void local_check_peer(tsi_peer peer, grpc_endpoint* ep,
+void local_check_peer(tsi_peer peer, grpc_endpoint* ep,
grpc_core::RefCountedPtr<grpc_auth_context>* auth_context,
grpc_closure* on_peer_checked,
grpc_local_connect_type type) {
@@ -110,30 +110,30 @@ void local_check_peer(tsi_peer peer, grpc_endpoint* ep,
grpc_core::ExecCtx::Run(DEBUG_LOCATION, on_peer_checked, error);
return;
}
- // Add TSI_SECURITY_LEVEL_PEER_PROPERTY type peer property.
- size_t new_property_count = peer.property_count + 1;
- tsi_peer_property* new_properties = static_cast<tsi_peer_property*>(
- gpr_zalloc(sizeof(*new_properties) * new_property_count));
- for (size_t i = 0; i < peer.property_count; i++) {
- new_properties[i] = peer.properties[i];
- }
- if (peer.properties != nullptr) gpr_free(peer.properties);
- peer.properties = new_properties;
- // TODO(yihuazhang): Set security level of local TCP to TSI_SECURITY_NONE.
- const char* security_level =
- tsi_security_level_to_string(TSI_PRIVACY_AND_INTEGRITY);
- tsi_result result = tsi_construct_string_peer_property_from_cstring(
- TSI_SECURITY_LEVEL_PEER_PROPERTY, security_level,
- &peer.properties[peer.property_count]);
- if (result != TSI_OK) return;
- peer.property_count++;
+ // Add TSI_SECURITY_LEVEL_PEER_PROPERTY type peer property.
+ size_t new_property_count = peer.property_count + 1;
+ tsi_peer_property* new_properties = static_cast<tsi_peer_property*>(
+ gpr_zalloc(sizeof(*new_properties) * new_property_count));
+ for (size_t i = 0; i < peer.property_count; i++) {
+ new_properties[i] = peer.properties[i];
+ }
+ if (peer.properties != nullptr) gpr_free(peer.properties);
+ peer.properties = new_properties;
+ // TODO(yihuazhang): Set security level of local TCP to TSI_SECURITY_NONE.
+ const char* security_level =
+ tsi_security_level_to_string(TSI_PRIVACY_AND_INTEGRITY);
+ tsi_result result = tsi_construct_string_peer_property_from_cstring(
+ TSI_SECURITY_LEVEL_PEER_PROPERTY, security_level,
+ &peer.properties[peer.property_count]);
+ if (result != TSI_OK) return;
+ peer.property_count++;
/* Create an auth context which is necessary to pass the santiy check in
* {client, server}_auth_filter that verifies if the peer's auth context is
* obtained during handshakes. The auth context is only checked for its
* existence and not actually used.
*/
- *auth_context = local_auth_context_create(&peer);
- tsi_peer_destruct(&peer);
+ *auth_context = local_auth_context_create(&peer);
+ tsi_peer_destruct(&peer);
error = *auth_context != nullptr ? GRPC_ERROR_NONE
: GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"Could not create local auth context");
@@ -177,11 +177,11 @@ class grpc_local_channel_security_connector final
grpc_closure* on_peer_checked) override {
grpc_local_credentials* creds =
reinterpret_cast<grpc_local_credentials*>(mutable_channel_creds());
- local_check_peer(peer, ep, auth_context, on_peer_checked,
+ local_check_peer(peer, ep, auth_context, on_peer_checked,
creds->connect_type());
}
- bool check_call_host(y_absl::string_view host,
+ bool check_call_host(y_absl::string_view host,
grpc_auth_context* /*auth_context*/,
grpc_closure* /*on_call_host_checked*/,
grpc_error** error) override {
@@ -226,7 +226,7 @@ class grpc_local_server_security_connector final
grpc_closure* on_peer_checked) override {
grpc_local_server_credentials* creds =
static_cast<grpc_local_server_credentials*>(mutable_server_creds());
- local_check_peer(peer, ep, auth_context, on_peer_checked,
+ local_check_peer(peer, ep, auth_context, on_peer_checked,
creds->connect_type());
}
diff --git a/contrib/libs/grpc/src/core/lib/security/security_connector/security_connector.cc b/contrib/libs/grpc/src/core/lib/security/security_connector/security_connector.cc
index 83e033f52f1..0400ad6fb8d 100644
--- a/contrib/libs/grpc/src/core/lib/security/security_connector/security_connector.cc
+++ b/contrib/libs/grpc/src/core/lib/security/security_connector/security_connector.cc
@@ -46,8 +46,8 @@ grpc_server_security_connector::grpc_server_security_connector(
: grpc_security_connector(url_scheme),
server_creds_(std::move(server_creds)) {}
-grpc_server_security_connector::~grpc_server_security_connector() = default;
-
+grpc_server_security_connector::~grpc_server_security_connector() = default;
+
grpc_channel_security_connector::grpc_channel_security_connector(
const char* url_scheme,
grpc_core::RefCountedPtr<grpc_channel_credentials> channel_creds,
diff --git a/contrib/libs/grpc/src/core/lib/security/security_connector/security_connector.h b/contrib/libs/grpc/src/core/lib/security/security_connector/security_connector.h
index b457b9f5a49..74d04600b24 100644
--- a/contrib/libs/grpc/src/core/lib/security/security_connector/security_connector.h
+++ b/contrib/libs/grpc/src/core/lib/security/security_connector/security_connector.h
@@ -98,7 +98,7 @@ class grpc_channel_security_connector : public grpc_security_connector {
/// Returns true if completed synchronously, in which case \a error will
/// be set to indicate the result. Otherwise, \a on_call_host_checked
/// will be invoked when complete.
- virtual bool check_call_host(y_absl::string_view host,
+ virtual bool check_call_host(y_absl::string_view host,
grpc_auth_context* auth_context,
grpc_closure* on_call_host_checked,
grpc_error** error) = 0;
@@ -151,7 +151,7 @@ class grpc_server_security_connector : public grpc_security_connector {
grpc_server_security_connector(
const char* url_scheme,
grpc_core::RefCountedPtr<grpc_server_credentials> server_creds);
- ~grpc_server_security_connector() override;
+ ~grpc_server_security_connector() override;
virtual void add_handshakers(const grpc_channel_args* args,
grpc_pollset_set* interested_parties,
diff --git a/contrib/libs/grpc/src/core/lib/security/security_connector/ssl/ssl_security_connector.cc b/contrib/libs/grpc/src/core/lib/security/security_connector/ssl/ssl_security_connector.cc
index 8b334b12dd7..b5e78ddbbbb 100644
--- a/contrib/libs/grpc/src/core/lib/security/security_connector/ssl/ssl_security_connector.cc
+++ b/contrib/libs/grpc/src/core/lib/security/security_connector/ssl/ssl_security_connector.cc
@@ -22,10 +22,10 @@
#include <stdbool.h>
-#include "y_absl/strings/str_cat.h"
-#include "y_absl/strings/str_format.h"
-#include "y_absl/strings/string_view.h"
-
+#include "y_absl/strings/str_cat.h"
+#include "y_absl/strings/str_format.h"
+#include "y_absl/strings/string_view.h"
+
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
@@ -34,7 +34,7 @@
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gprpp/host_port.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
-#include "src/core/lib/gprpp/sync.h"
+#include "src/core/lib/gprpp/sync.h"
#include "src/core/lib/security/context/security_context.h"
#include "src/core/lib/security/credentials/credentials.h"
#include "src/core/lib/security/credentials/ssl/ssl_credentials.h"
@@ -54,9 +54,9 @@ grpc_error* ssl_check_peer(
}
/* Check the peer name if specified. */
if (peer_name != nullptr && !grpc_ssl_host_matches_name(peer, peer_name)) {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("Peer name ", peer_name, " is not in peer certificate")
- .c_str());
+ return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrCat("Peer name ", peer_name, " is not in peer certificate")
+ .c_str());
}
*auth_context =
grpc_ssl_peer_to_auth_context(peer, GRPC_SSL_TRANSPORT_SECURITY_TYPE);
@@ -74,13 +74,13 @@ class grpc_ssl_channel_security_connector final
: grpc_channel_security_connector(GRPC_SSL_URL_SCHEME,
std::move(channel_creds),
std::move(request_metadata_creds)),
- overridden_target_name_(
- overridden_target_name == nullptr ? "" : overridden_target_name),
+ overridden_target_name_(
+ overridden_target_name == nullptr ? "" : overridden_target_name),
verify_options_(&config->verify_options) {
- y_absl::string_view host;
- y_absl::string_view port;
+ y_absl::string_view host;
+ y_absl::string_view port;
grpc_core::SplitHostPort(target_name, &host, &port);
- target_name_ = TString(host);
+ target_name_ = TString(host);
}
~grpc_ssl_channel_security_connector() override {
@@ -106,8 +106,8 @@ class grpc_ssl_channel_security_connector final
}
options.cipher_suites = grpc_get_ssl_cipher_suites();
options.session_cache = ssl_session_cache;
- options.min_tls_version = grpc_get_tsi_tls_version(config->min_tls_version);
- options.max_tls_version = grpc_get_tsi_tls_version(config->max_tls_version);
+ options.min_tls_version = grpc_get_tsi_tls_version(config->min_tls_version);
+ options.max_tls_version = grpc_get_tsi_tls_version(config->max_tls_version);
const tsi_result result =
tsi_create_ssl_client_handshaker_factory_with_options(
&options, &client_handshaker_factory_);
@@ -127,8 +127,8 @@ class grpc_ssl_channel_security_connector final
tsi_handshaker* tsi_hs = nullptr;
tsi_result result = tsi_ssl_client_handshaker_factory_create_handshaker(
client_handshaker_factory_,
- overridden_target_name_.empty() ? target_name_.c_str()
- : overridden_target_name_.c_str(),
+ overridden_target_name_.empty() ? target_name_.c_str()
+ : overridden_target_name_.c_str(),
&tsi_hs);
if (result != TSI_OK) {
gpr_log(GPR_ERROR, "Handshaker creation failed with error %s.",
@@ -142,9 +142,9 @@ class grpc_ssl_channel_security_connector final
void check_peer(tsi_peer peer, grpc_endpoint* /*ep*/,
grpc_core::RefCountedPtr<grpc_auth_context>* auth_context,
grpc_closure* on_peer_checked) override {
- const char* target_name = overridden_target_name_.empty()
- ? target_name_.c_str()
- : overridden_target_name_.c_str();
+ const char* target_name = overridden_target_name_.empty()
+ ? target_name_.c_str()
+ : overridden_target_name_.c_str();
grpc_error* error = ssl_check_peer(target_name, &peer, auth_context);
if (error == GRPC_ERROR_NONE &&
verify_options_->verify_peer_callback != nullptr) {
@@ -162,10 +162,10 @@ class grpc_ssl_channel_security_connector final
verify_options_->verify_peer_callback_userdata);
gpr_free(peer_pem);
if (callback_status) {
- error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrFormat("Verify peer callback returned a failure (%d)",
- callback_status)
- .c_str());
+ error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrFormat("Verify peer callback returned a failure (%d)",
+ callback_status)
+ .c_str());
}
}
}
@@ -178,17 +178,17 @@ class grpc_ssl_channel_security_connector final
reinterpret_cast<const grpc_ssl_channel_security_connector*>(other_sc);
int c = channel_security_connector_cmp(other);
if (c != 0) return c;
- c = target_name_.compare(other->target_name_);
+ c = target_name_.compare(other->target_name_);
if (c != 0) return c;
- return overridden_target_name_.compare(other->overridden_target_name_);
+ return overridden_target_name_.compare(other->overridden_target_name_);
}
- bool check_call_host(y_absl::string_view host, grpc_auth_context* auth_context,
+ bool check_call_host(y_absl::string_view host, grpc_auth_context* auth_context,
grpc_closure* /*on_call_host_checked*/,
grpc_error** error) override {
- return grpc_ssl_check_call_host(host, target_name_.c_str(),
- overridden_target_name_.c_str(),
- auth_context, error);
+ return grpc_ssl_check_call_host(host, target_name_.c_str(),
+ overridden_target_name_.c_str(),
+ auth_context, error);
}
void cancel_check_call_host(grpc_closure* /*on_call_host_checked*/,
@@ -198,8 +198,8 @@ class grpc_ssl_channel_security_connector final
private:
tsi_ssl_client_handshaker_factory* client_handshaker_factory_;
- TString target_name_;
- TString overridden_target_name_;
+ TString target_name_;
+ TString overridden_target_name_;
const verify_peer_options* verify_options_;
};
@@ -251,10 +251,10 @@ class grpc_ssl_server_security_connector
options.cipher_suites = grpc_get_ssl_cipher_suites();
options.alpn_protocols = alpn_protocol_strings;
options.num_alpn_protocols = static_cast<uint16_t>(num_alpn_protocols);
- options.min_tls_version = grpc_get_tsi_tls_version(
- server_credentials->config().min_tls_version);
- options.max_tls_version = grpc_get_tsi_tls_version(
- server_credentials->config().max_tls_version);
+ options.min_tls_version = grpc_get_tsi_tls_version(
+ server_credentials->config().min_tls_version);
+ options.max_tls_version = grpc_get_tsi_tls_version(
+ server_credentials->config().max_tls_version);
const tsi_result result =
tsi_create_ssl_server_handshaker_factory_with_options(
&options, &server_handshaker_factory_);
@@ -307,7 +307,7 @@ class grpc_ssl_server_security_connector
bool status;
if (!has_cert_config_fetcher()) return false;
- grpc_core::MutexLock lock(&mu_);
+ grpc_core::MutexLock lock(&mu_);
grpc_ssl_server_credentials* server_creds =
static_cast<grpc_ssl_server_credentials*>(this->mutable_server_creds());
grpc_ssl_certificate_config_reload_status cb_result =
@@ -387,7 +387,7 @@ class grpc_ssl_server_security_connector
server_handshaker_factory_ = new_factory;
}
- grpc_core::Mutex mu_;
+ grpc_core::Mutex mu_;
tsi_ssl_server_handshaker_factory* server_handshaker_factory_ = nullptr;
};
} // namespace
diff --git a/contrib/libs/grpc/src/core/lib/security/security_connector/ssl/ssl_security_connector.h b/contrib/libs/grpc/src/core/lib/security/security_connector/ssl/ssl_security_connector.h
index e8369afbea5..04c32bb2a8c 100644
--- a/contrib/libs/grpc/src/core/lib/security/security_connector/ssl/ssl_security_connector.h
+++ b/contrib/libs/grpc/src/core/lib/security/security_connector/ssl/ssl_security_connector.h
@@ -33,10 +33,10 @@ struct grpc_ssl_config {
tsi_ssl_pem_key_cert_pair* pem_key_cert_pair;
char* pem_root_certs;
verify_peer_options verify_options;
- grpc_tls_version min_tls_version = grpc_tls_version::TLS1_2;
- grpc_tls_version max_tls_version = grpc_tls_version::TLS1_3;
+ grpc_tls_version min_tls_version = grpc_tls_version::TLS1_2;
+ grpc_tls_version max_tls_version = grpc_tls_version::TLS1_3;
};
-
+
/* Creates an SSL channel_security_connector.
- request_metadata_creds is the credentials object which metadata
will be sent with each request. This parameter can be NULL.
@@ -65,8 +65,8 @@ struct grpc_ssl_server_config {
char* pem_root_certs = nullptr;
grpc_ssl_client_certificate_request_type client_certificate_request =
GRPC_SSL_DONT_REQUEST_CLIENT_CERTIFICATE;
- grpc_tls_version min_tls_version = grpc_tls_version::TLS1_2;
- grpc_tls_version max_tls_version = grpc_tls_version::TLS1_3;
+ grpc_tls_version min_tls_version = grpc_tls_version::TLS1_2;
+ grpc_tls_version max_tls_version = grpc_tls_version::TLS1_3;
};
/* Creates an SSL server_security_connector.
- config is the SSL config to be used for the SSL channel establishment.
diff --git a/contrib/libs/grpc/src/core/lib/security/security_connector/ssl_utils.cc b/contrib/libs/grpc/src/core/lib/security/security_connector/ssl_utils.cc
index 89caff5dd84..6c83968f8e7 100644
--- a/contrib/libs/grpc/src/core/lib/security/security_connector/ssl_utils.cc
+++ b/contrib/libs/grpc/src/core/lib/security/security_connector/ssl_utils.cc
@@ -20,10 +20,10 @@
#include "src/core/lib/security/security_connector/ssl_utils.h"
-#include <vector>
-
-#include "y_absl/strings/str_cat.h"
-
+#include <vector>
+
+#include "y_absl/strings/str_cat.h"
+
#include <grpc/slice_buffer.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
@@ -70,9 +70,9 @@ static const char* cipher_suites = nullptr;
// All cipher suites for default are compliant with HTTP2.
GPR_GLOBAL_CONFIG_DEFINE_STRING(
grpc_ssl_cipher_suites,
- "TLS_AES_128_GCM_SHA256:"
- "TLS_AES_256_GCM_SHA384:"
- "TLS_CHACHA20_POLY1305_SHA256:"
+ "TLS_AES_128_GCM_SHA256:"
+ "TLS_AES_256_GCM_SHA384:"
+ "TLS_CHACHA20_POLY1305_SHA256:"
"ECDHE-ECDSA-AES128-GCM-SHA256:"
"ECDHE-ECDSA-AES256-GCM-SHA384:"
"ECDHE-RSA-AES128-GCM-SHA256:"
@@ -92,30 +92,30 @@ const char* grpc_get_ssl_cipher_suites(void) {
return cipher_suites;
}
-grpc_security_level grpc_tsi_security_level_string_to_enum(
- const char* security_level) {
- if (strcmp(security_level, "TSI_INTEGRITY_ONLY") == 0) {
- return GRPC_INTEGRITY_ONLY;
- } else if (strcmp(security_level, "TSI_PRIVACY_AND_INTEGRITY") == 0) {
- return GRPC_PRIVACY_AND_INTEGRITY;
- }
- return GRPC_SECURITY_NONE;
-}
-
-const char* grpc_security_level_to_string(grpc_security_level security_level) {
- if (security_level == GRPC_PRIVACY_AND_INTEGRITY) {
- return "GRPC_PRIVACY_AND_INTEGRITY";
- } else if (security_level == GRPC_INTEGRITY_ONLY) {
- return "GRPC_INTEGRITY_ONLY";
- }
- return "GRPC_SECURITY_NONE";
-}
-
-bool grpc_check_security_level(grpc_security_level channel_level,
- grpc_security_level call_cred_level) {
- return static_cast<int>(channel_level) >= static_cast<int>(call_cred_level);
-}
-
+grpc_security_level grpc_tsi_security_level_string_to_enum(
+ const char* security_level) {
+ if (strcmp(security_level, "TSI_INTEGRITY_ONLY") == 0) {
+ return GRPC_INTEGRITY_ONLY;
+ } else if (strcmp(security_level, "TSI_PRIVACY_AND_INTEGRITY") == 0) {
+ return GRPC_PRIVACY_AND_INTEGRITY;
+ }
+ return GRPC_SECURITY_NONE;
+}
+
+const char* grpc_security_level_to_string(grpc_security_level security_level) {
+ if (security_level == GRPC_PRIVACY_AND_INTEGRITY) {
+ return "GRPC_PRIVACY_AND_INTEGRITY";
+ } else if (security_level == GRPC_INTEGRITY_ONLY) {
+ return "GRPC_INTEGRITY_ONLY";
+ }
+ return "GRPC_SECURITY_NONE";
+}
+
+bool grpc_check_security_level(grpc_security_level channel_level,
+ grpc_security_level call_cred_level) {
+ return static_cast<int>(channel_level) >= static_cast<int>(call_cred_level);
+}
+
tsi_client_certificate_request_type
grpc_get_tsi_client_certificate_request_type(
grpc_ssl_client_certificate_request_type grpc_request_type) {
@@ -140,18 +140,18 @@ grpc_get_tsi_client_certificate_request_type(
}
}
-tsi_tls_version grpc_get_tsi_tls_version(grpc_tls_version tls_version) {
- switch (tls_version) {
- case grpc_tls_version::TLS1_2:
- return tsi_tls_version::TSI_TLS1_2;
- case grpc_tls_version::TLS1_3:
- return tsi_tls_version::TSI_TLS1_3;
- default:
- gpr_log(GPR_INFO, "Falling back to TLS 1.2.");
- return tsi_tls_version::TSI_TLS1_2;
- }
-}
-
+tsi_tls_version grpc_get_tsi_tls_version(grpc_tls_version tls_version) {
+ switch (tls_version) {
+ case grpc_tls_version::TLS1_2:
+ return tsi_tls_version::TSI_TLS1_2;
+ case grpc_tls_version::TLS1_3:
+ return tsi_tls_version::TSI_TLS1_3;
+ default:
+ gpr_log(GPR_INFO, "Falling back to TLS 1.2.");
+ return tsi_tls_version::TSI_TLS1_2;
+ }
+}
+
grpc_error* grpc_ssl_check_alpn(const tsi_peer* peer) {
#if TSI_OPENSSL_ALPN_SUPPORT
/* Check the ALPN if ALPN is supported. */
@@ -169,28 +169,28 @@ grpc_error* grpc_ssl_check_alpn(const tsi_peer* peer) {
return GRPC_ERROR_NONE;
}
-grpc_error* grpc_ssl_check_peer_name(y_absl::string_view peer_name,
+grpc_error* grpc_ssl_check_peer_name(y_absl::string_view peer_name,
const tsi_peer* peer) {
/* Check the peer name if specified. */
if (!peer_name.empty() && !grpc_ssl_host_matches_name(peer, peer_name)) {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("Peer name ", peer_name, " is not in peer certificate")
- .c_str());
+ return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrCat("Peer name ", peer_name, " is not in peer certificate")
+ .c_str());
}
return GRPC_ERROR_NONE;
}
-bool grpc_ssl_check_call_host(y_absl::string_view host,
- y_absl::string_view target_name,
- y_absl::string_view overridden_target_name,
+bool grpc_ssl_check_call_host(y_absl::string_view host,
+ y_absl::string_view target_name,
+ y_absl::string_view overridden_target_name,
grpc_auth_context* auth_context,
grpc_error** error) {
grpc_security_status status = GRPC_SECURITY_ERROR;
tsi_peer peer = grpc_shallow_peer_from_ssl_auth_context(auth_context);
if (grpc_ssl_host_matches_name(&peer, host)) status = GRPC_SECURITY_OK;
- /* If the target name was overridden, then the original target_name was
- 'checked' transitively during the previous peer check at the end of the
- handshake. */
+ /* If the target name was overridden, then the original target_name was
+ 'checked' transitively during the previous peer check at the end of the
+ handshake. */
if (!overridden_target_name.empty() && host == target_name) {
status = GRPC_SECURITY_OK;
}
@@ -214,50 +214,50 @@ const char** grpc_fill_alpn_protocol_strings(size_t* num_alpn_protocols) {
}
int grpc_ssl_host_matches_name(const tsi_peer* peer,
- y_absl::string_view peer_name) {
- y_absl::string_view allocated_name;
- y_absl::string_view ignored_port;
+ y_absl::string_view peer_name) {
+ y_absl::string_view allocated_name;
+ y_absl::string_view ignored_port;
grpc_core::SplitHostPort(peer_name, &allocated_name, &ignored_port);
if (allocated_name.empty()) return 0;
// IPv6 zone-id should not be included in comparisons.
const size_t zone_id = allocated_name.find('%');
- if (zone_id != y_absl::string_view::npos) {
+ if (zone_id != y_absl::string_view::npos) {
allocated_name.remove_suffix(allocated_name.size() - zone_id);
}
return tsi_ssl_peer_matches_name(peer, allocated_name);
}
-int grpc_ssl_cmp_target_name(y_absl::string_view target_name,
- y_absl::string_view other_target_name,
- y_absl::string_view overridden_target_name,
- y_absl::string_view other_overridden_target_name) {
- int c = target_name.compare(other_target_name);
+int grpc_ssl_cmp_target_name(y_absl::string_view target_name,
+ y_absl::string_view other_target_name,
+ y_absl::string_view overridden_target_name,
+ y_absl::string_view other_overridden_target_name) {
+ int c = target_name.compare(other_target_name);
if (c != 0) return c;
- return overridden_target_name.compare(other_overridden_target_name);
-}
-
-static bool IsSpiffeId(y_absl::string_view uri) {
- // Return false without logging for a non-spiffe uri scheme.
- if (!y_absl::StartsWith(uri, "spiffe://")) {
- return false;
- };
- if (uri.size() > 2048) {
- gpr_log(GPR_INFO, "Invalid SPIFFE ID: ID longer than 2048 bytes.");
- return false;
- }
- std::vector<y_absl::string_view> splits = y_absl::StrSplit(uri, '/');
- if (splits.size() < 4 || splits[3] == "") {
- gpr_log(GPR_INFO, "Invalid SPIFFE ID: workload id is empty.");
- return false;
- }
- if (splits[2].size() > 255) {
- gpr_log(GPR_INFO, "Invalid SPIFFE ID: domain longer than 255 characters.");
- return false;
- }
- return true;
-}
-
+ return overridden_target_name.compare(other_overridden_target_name);
+}
+
+static bool IsSpiffeId(y_absl::string_view uri) {
+ // Return false without logging for a non-spiffe uri scheme.
+ if (!y_absl::StartsWith(uri, "spiffe://")) {
+ return false;
+ };
+ if (uri.size() > 2048) {
+ gpr_log(GPR_INFO, "Invalid SPIFFE ID: ID longer than 2048 bytes.");
+ return false;
+ }
+ std::vector<y_absl::string_view> splits = y_absl::StrSplit(uri, '/');
+ if (splits.size() < 4 || splits[3] == "") {
+ gpr_log(GPR_INFO, "Invalid SPIFFE ID: workload id is empty.");
+ return false;
+ }
+ if (splits[2].size() > 255) {
+ gpr_log(GPR_INFO, "Invalid SPIFFE ID: domain longer than 255 characters.");
+ return false;
+ }
+ return true;
+}
+
grpc_core::RefCountedPtr<grpc_auth_context> grpc_ssl_peer_to_auth_context(
const tsi_peer* peer, const char* transport_security_type) {
size_t i;
@@ -270,10 +270,10 @@ grpc_core::RefCountedPtr<grpc_auth_context> grpc_ssl_peer_to_auth_context(
grpc_auth_context_add_cstring_property(
ctx.get(), GRPC_TRANSPORT_SECURITY_TYPE_PROPERTY_NAME,
transport_security_type);
- const char* spiffe_data = nullptr;
- size_t spiffe_length = 0;
- int uri_count = 0;
- bool has_spiffe_id = false;
+ const char* spiffe_data = nullptr;
+ size_t spiffe_length = 0;
+ int uri_count = 0;
+ bool has_spiffe_id = false;
for (i = 0; i < peer->property_count; i++) {
const tsi_peer_property* prop = &peer->properties[i];
if (prop->name == nullptr) continue;
@@ -293,44 +293,44 @@ grpc_core::RefCountedPtr<grpc_auth_context> grpc_ssl_peer_to_auth_context(
grpc_auth_context_add_property(ctx.get(),
GRPC_X509_PEM_CERT_PROPERTY_NAME,
prop->value.data, prop->value.length);
- } else if (strcmp(prop->name, TSI_X509_PEM_CERT_CHAIN_PROPERTY) == 0) {
- grpc_auth_context_add_property(ctx.get(),
- GRPC_X509_PEM_CERT_CHAIN_PROPERTY_NAME,
- prop->value.data, prop->value.length);
+ } else if (strcmp(prop->name, TSI_X509_PEM_CERT_CHAIN_PROPERTY) == 0) {
+ grpc_auth_context_add_property(ctx.get(),
+ GRPC_X509_PEM_CERT_CHAIN_PROPERTY_NAME,
+ prop->value.data, prop->value.length);
} else if (strcmp(prop->name, TSI_SSL_SESSION_REUSED_PEER_PROPERTY) == 0) {
grpc_auth_context_add_property(ctx.get(),
GRPC_SSL_SESSION_REUSED_PROPERTY,
prop->value.data, prop->value.length);
- } else if (strcmp(prop->name, TSI_SECURITY_LEVEL_PEER_PROPERTY) == 0) {
- grpc_auth_context_add_property(
- ctx.get(), GRPC_TRANSPORT_SECURITY_LEVEL_PROPERTY_NAME,
- prop->value.data, prop->value.length);
- } else if (strcmp(prop->name, TSI_X509_URI_PEER_PROPERTY) == 0) {
- uri_count++;
- y_absl::string_view spiffe_id(prop->value.data, prop->value.length);
- if (IsSpiffeId(spiffe_id)) {
- spiffe_data = prop->value.data;
- spiffe_length = prop->value.length;
- has_spiffe_id = true;
- }
+ } else if (strcmp(prop->name, TSI_SECURITY_LEVEL_PEER_PROPERTY) == 0) {
+ grpc_auth_context_add_property(
+ ctx.get(), GRPC_TRANSPORT_SECURITY_LEVEL_PROPERTY_NAME,
+ prop->value.data, prop->value.length);
+ } else if (strcmp(prop->name, TSI_X509_URI_PEER_PROPERTY) == 0) {
+ uri_count++;
+ y_absl::string_view spiffe_id(prop->value.data, prop->value.length);
+ if (IsSpiffeId(spiffe_id)) {
+ spiffe_data = prop->value.data;
+ spiffe_length = prop->value.length;
+ has_spiffe_id = true;
+ }
}
}
if (peer_identity_property_name != nullptr) {
GPR_ASSERT(grpc_auth_context_set_peer_identity_property_name(
ctx.get(), peer_identity_property_name) == 1);
}
- // A valid SPIFFE certificate can only have exact one URI SAN field.
- if (has_spiffe_id) {
- if (uri_count == 1) {
- GPR_ASSERT(spiffe_length > 0);
- GPR_ASSERT(spiffe_data != nullptr);
- grpc_auth_context_add_property(ctx.get(),
- GRPC_PEER_SPIFFE_ID_PROPERTY_NAME,
- spiffe_data, spiffe_length);
- } else {
- gpr_log(GPR_INFO, "Invalid SPIFFE ID: multiple URI SANs.");
- }
- }
+ // A valid SPIFFE certificate can only have exact one URI SAN field.
+ if (has_spiffe_id) {
+ if (uri_count == 1) {
+ GPR_ASSERT(spiffe_length > 0);
+ GPR_ASSERT(spiffe_data != nullptr);
+ grpc_auth_context_add_property(ctx.get(),
+ GRPC_PEER_SPIFFE_ID_PROPERTY_NAME,
+ spiffe_data, spiffe_length);
+ } else {
+ gpr_log(GPR_INFO, "Invalid SPIFFE ID: multiple URI SANs.");
+ }
+ }
return ctx;
}
@@ -368,17 +368,17 @@ tsi_peer grpc_shallow_peer_from_ssl_auth_context(
} else if (strcmp(prop->name, GRPC_X509_PEM_CERT_PROPERTY_NAME) == 0) {
add_shallow_auth_property_to_peer(&peer, prop,
TSI_X509_PEM_CERT_PROPERTY);
- } else if (strcmp(prop->name,
- GRPC_TRANSPORT_SECURITY_LEVEL_PROPERTY_NAME) == 0) {
- add_shallow_auth_property_to_peer(&peer, prop,
- TSI_SECURITY_LEVEL_PEER_PROPERTY);
- } else if (strcmp(prop->name, GRPC_X509_PEM_CERT_CHAIN_PROPERTY_NAME) ==
- 0) {
- add_shallow_auth_property_to_peer(&peer, prop,
- TSI_X509_PEM_CERT_CHAIN_PROPERTY);
- } else if (strcmp(prop->name, GRPC_PEER_SPIFFE_ID_PROPERTY_NAME) == 0) {
- add_shallow_auth_property_to_peer(&peer, prop,
- TSI_X509_URI_PEER_PROPERTY);
+ } else if (strcmp(prop->name,
+ GRPC_TRANSPORT_SECURITY_LEVEL_PROPERTY_NAME) == 0) {
+ add_shallow_auth_property_to_peer(&peer, prop,
+ TSI_SECURITY_LEVEL_PEER_PROPERTY);
+ } else if (strcmp(prop->name, GRPC_X509_PEM_CERT_CHAIN_PROPERTY_NAME) ==
+ 0) {
+ add_shallow_auth_property_to_peer(&peer, prop,
+ TSI_X509_PEM_CERT_CHAIN_PROPERTY);
+ } else if (strcmp(prop->name, GRPC_PEER_SPIFFE_ID_PROPERTY_NAME) == 0) {
+ add_shallow_auth_property_to_peer(&peer, prop,
+ TSI_X509_URI_PEER_PROPERTY);
}
}
}
@@ -391,8 +391,8 @@ void grpc_shallow_peer_destruct(tsi_peer* peer) {
grpc_security_status grpc_ssl_tsi_client_handshaker_factory_init(
tsi_ssl_pem_key_cert_pair* pem_key_cert_pair, const char* pem_root_certs,
- bool skip_server_certificate_verification, tsi_tls_version min_tls_version,
- tsi_tls_version max_tls_version, tsi_ssl_session_cache* ssl_session_cache,
+ bool skip_server_certificate_verification, tsi_tls_version min_tls_version,
+ tsi_tls_version max_tls_version, tsi_ssl_session_cache* ssl_session_cache,
tsi_ssl_client_handshaker_factory** handshaker_factory) {
const char* root_certs;
const tsi_ssl_root_certs_store* root_store;
@@ -422,10 +422,10 @@ grpc_security_status grpc_ssl_tsi_client_handshaker_factory_init(
}
options.cipher_suites = grpc_get_ssl_cipher_suites();
options.session_cache = ssl_session_cache;
- options.skip_server_certificate_verification =
- skip_server_certificate_verification;
- options.min_tls_version = min_tls_version;
- options.max_tls_version = max_tls_version;
+ options.skip_server_certificate_verification =
+ skip_server_certificate_verification;
+ options.min_tls_version = min_tls_version;
+ options.max_tls_version = max_tls_version;
const tsi_result result =
tsi_create_ssl_client_handshaker_factory_with_options(&options,
handshaker_factory);
@@ -442,7 +442,7 @@ grpc_security_status grpc_ssl_tsi_server_handshaker_factory_init(
tsi_ssl_pem_key_cert_pair* pem_key_cert_pairs, size_t num_key_cert_pairs,
const char* pem_root_certs,
grpc_ssl_client_certificate_request_type client_certificate_request,
- tsi_tls_version min_tls_version, tsi_tls_version max_tls_version,
+ tsi_tls_version min_tls_version, tsi_tls_version max_tls_version,
tsi_ssl_server_handshaker_factory** handshaker_factory) {
size_t num_alpn_protocols = 0;
const char** alpn_protocol_strings =
@@ -456,8 +456,8 @@ grpc_security_status grpc_ssl_tsi_server_handshaker_factory_init(
options.cipher_suites = grpc_get_ssl_cipher_suites();
options.alpn_protocols = alpn_protocol_strings;
options.num_alpn_protocols = static_cast<uint16_t>(num_alpn_protocols);
- options.min_tls_version = min_tls_version;
- options.max_tls_version = max_tls_version;
+ options.min_tls_version = min_tls_version;
+ options.max_tls_version = max_tls_version;
const tsi_result result =
tsi_create_ssl_server_handshaker_factory_with_options(&options,
handshaker_factory);
diff --git a/contrib/libs/grpc/src/core/lib/security/security_connector/ssl_utils.h b/contrib/libs/grpc/src/core/lib/security/security_connector/ssl_utils.h
index 769276c3fd5..6141f8d9cbc 100644
--- a/contrib/libs/grpc/src/core/lib/security/security_connector/ssl_utils.h
+++ b/contrib/libs/grpc/src/core/lib/security/security_connector/ssl_utils.h
@@ -23,9 +23,9 @@
#include <stdbool.h>
-#include "y_absl/strings/str_split.h"
-#include "y_absl/strings/string_view.h"
-
+#include "y_absl/strings/str_split.h"
+#include "y_absl/strings/string_view.h"
+
#include <grpc/grpc_security.h>
#include <grpc/slice_buffer.h>
@@ -47,17 +47,17 @@
grpc_error* grpc_ssl_check_alpn(const tsi_peer* peer);
/* Check peer name information returned from SSL handshakes. */
-grpc_error* grpc_ssl_check_peer_name(y_absl::string_view peer_name,
+grpc_error* grpc_ssl_check_peer_name(y_absl::string_view peer_name,
const tsi_peer* peer);
/* Compare targer_name information extracted from SSL security connectors. */
-int grpc_ssl_cmp_target_name(y_absl::string_view target_name,
- y_absl::string_view other_target_name,
- y_absl::string_view overridden_target_name,
- y_absl::string_view other_overridden_target_name);
+int grpc_ssl_cmp_target_name(y_absl::string_view target_name,
+ y_absl::string_view other_target_name,
+ y_absl::string_view overridden_target_name,
+ y_absl::string_view other_overridden_target_name);
/* Check the host that will be set for a call is acceptable.*/
-bool grpc_ssl_check_call_host(y_absl::string_view host,
- y_absl::string_view target_name,
- y_absl::string_view overridden_target_name,
+bool grpc_ssl_check_call_host(y_absl::string_view host,
+ y_absl::string_view target_name,
+ y_absl::string_view overridden_target_name,
grpc_auth_context* auth_context,
grpc_error** error);
/* Return HTTP2-compliant cipher suites that gRPC accepts by default. */
@@ -69,35 +69,35 @@ tsi_client_certificate_request_type
grpc_get_tsi_client_certificate_request_type(
grpc_ssl_client_certificate_request_type grpc_request_type);
-/* Map tsi_security_level string to grpc_security_level enum. */
-grpc_security_level grpc_tsi_security_level_string_to_enum(
- const char* security_level);
-
-/* Map grpc_tls_version to tsi_tls_version. */
-tsi_tls_version grpc_get_tsi_tls_version(grpc_tls_version tls_version);
-
-/* Map grpc_security_level enum to a string. */
-const char* grpc_security_level_to_string(grpc_security_level security_level);
-
-/* Check security level of channel and call credential.*/
-bool grpc_check_security_level(grpc_security_level channel_level,
- grpc_security_level call_cred_level);
-
+/* Map tsi_security_level string to grpc_security_level enum. */
+grpc_security_level grpc_tsi_security_level_string_to_enum(
+ const char* security_level);
+
+/* Map grpc_tls_version to tsi_tls_version. */
+tsi_tls_version grpc_get_tsi_tls_version(grpc_tls_version tls_version);
+
+/* Map grpc_security_level enum to a string. */
+const char* grpc_security_level_to_string(grpc_security_level security_level);
+
+/* Check security level of channel and call credential.*/
+bool grpc_check_security_level(grpc_security_level channel_level,
+ grpc_security_level call_cred_level);
+
/* Return an array of strings containing alpn protocols. */
const char** grpc_fill_alpn_protocol_strings(size_t* num_alpn_protocols);
/* Initialize TSI SSL server/client handshaker factory. */
grpc_security_status grpc_ssl_tsi_client_handshaker_factory_init(
tsi_ssl_pem_key_cert_pair* key_cert_pair, const char* pem_root_certs,
- bool skip_server_certificate_verification, tsi_tls_version min_tls_version,
- tsi_tls_version max_tls_version, tsi_ssl_session_cache* ssl_session_cache,
+ bool skip_server_certificate_verification, tsi_tls_version min_tls_version,
+ tsi_tls_version max_tls_version, tsi_ssl_session_cache* ssl_session_cache,
tsi_ssl_client_handshaker_factory** handshaker_factory);
grpc_security_status grpc_ssl_tsi_server_handshaker_factory_init(
tsi_ssl_pem_key_cert_pair* key_cert_pairs, size_t num_key_cert_pairs,
const char* pem_root_certs,
grpc_ssl_client_certificate_request_type client_certificate_request,
- tsi_tls_version min_tls_version, tsi_tls_version max_tls_version,
+ tsi_tls_version min_tls_version, tsi_tls_version max_tls_version,
tsi_ssl_server_handshaker_factory** handshaker_factory);
/* Exposed for testing only. */
@@ -107,7 +107,7 @@ tsi_peer grpc_shallow_peer_from_ssl_auth_context(
const grpc_auth_context* auth_context);
void grpc_shallow_peer_destruct(tsi_peer* peer);
int grpc_ssl_host_matches_name(const tsi_peer* peer,
- y_absl::string_view peer_name);
+ y_absl::string_view peer_name);
/* --- Default SSL Root Store. --- */
namespace grpc_core {
@@ -174,11 +174,11 @@ class PemKeyCertPair {
return *this;
}
- bool operator==(const PemKeyCertPair& other) const {
- return std::strcmp(this->private_key(), other.private_key()) == 0 &&
- std::strcmp(this->cert_chain(), other.cert_chain()) == 0;
- }
-
+ bool operator==(const PemKeyCertPair& other) const {
+ return std::strcmp(this->private_key(), other.private_key()) == 0 &&
+ std::strcmp(this->cert_chain(), other.cert_chain()) == 0;
+ }
+
char* private_key() const { return private_key_.get(); }
char* cert_chain() const { return cert_chain_.get(); }
diff --git a/contrib/libs/grpc/src/core/lib/security/security_connector/tls/tls_security_connector.cc b/contrib/libs/grpc/src/core/lib/security/security_connector/tls/tls_security_connector.cc
index e81c5d5fc02..4abcb75a085 100644
--- a/contrib/libs/grpc/src/core/lib/security/security_connector/tls/tls_security_connector.cc
+++ b/contrib/libs/grpc/src/core/lib/security/security_connector/tls/tls_security_connector.cc
@@ -1,606 +1,606 @@
-/*
- *
- * Copyright 2018 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <grpc/support/port_platform.h>
-
-#include "src/core/lib/security/security_connector/tls/tls_security_connector.h"
-
-#include <stdbool.h>
-#include <string.h>
-
-#include "y_absl/strings/str_cat.h"
-#include "y_absl/strings/string_view.h"
-
-#include <grpc/grpc.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/string_util.h>
-
-#include "src/core/lib/gprpp/host_port.h"
-#include "src/core/lib/security/credentials/ssl/ssl_credentials.h"
-#include "src/core/lib/security/credentials/tls/tls_credentials.h"
-#include "src/core/lib/security/security_connector/ssl_utils.h"
-#include "src/core/lib/security/transport/security_handshaker.h"
-#include "src/core/lib/slice/slice_internal.h"
-#include "src/core/lib/transport/transport.h"
-#include "src/core/tsi/ssl_transport_security.h"
-#include "src/core/tsi/transport_security.h"
-
-namespace grpc_core {
-
-namespace {
-
-tsi_ssl_pem_key_cert_pair* ConvertToTsiPemKeyCertPair(
- const grpc_tls_key_materials_config::PemKeyCertPairList& cert_pair_list) {
- tsi_ssl_pem_key_cert_pair* tsi_pairs = nullptr;
- size_t num_key_cert_pairs = cert_pair_list.size();
- if (num_key_cert_pairs > 0) {
- GPR_ASSERT(cert_pair_list.data() != nullptr);
- tsi_pairs = static_cast<tsi_ssl_pem_key_cert_pair*>(
- gpr_zalloc(num_key_cert_pairs * sizeof(tsi_ssl_pem_key_cert_pair)));
- }
- for (size_t i = 0; i < num_key_cert_pairs; i++) {
- GPR_ASSERT(cert_pair_list[i].private_key() != nullptr);
- GPR_ASSERT(cert_pair_list[i].cert_chain() != nullptr);
- tsi_pairs[i].cert_chain = gpr_strdup(cert_pair_list[i].cert_chain());
- tsi_pairs[i].private_key = gpr_strdup(cert_pair_list[i].private_key());
- }
- return tsi_pairs;
-}
-
-} // namespace
-
-grpc_status_code TlsFetchKeyMaterials(
- const grpc_core::RefCountedPtr<grpc_tls_key_materials_config>&
- key_materials_config,
- const grpc_tls_credentials_options& options, bool is_server,
- grpc_ssl_certificate_config_reload_status* status) {
- GPR_ASSERT(key_materials_config != nullptr);
- GPR_ASSERT(status != nullptr);
- bool is_key_materials_empty =
- key_materials_config->pem_key_cert_pair_list().empty();
- grpc_tls_credential_reload_config* credential_reload_config =
- options.credential_reload_config();
- /** If there are no key materials and no credential reload config and the
- * caller is a server, then return an error. We do not require that a client
- * always provision certificates. **/
- if (credential_reload_config == nullptr && is_key_materials_empty &&
- is_server) {
- gpr_log(GPR_ERROR,
- "Either credential reload config or key materials should be "
- "provisioned.");
- return GRPC_STATUS_FAILED_PRECONDITION;
- }
- grpc_status_code reload_status = GRPC_STATUS_OK;
- /** Use |credential_reload_config| to update |key_materials_config|. **/
- if (credential_reload_config != nullptr) {
- grpc_tls_credential_reload_arg* arg = new grpc_tls_credential_reload_arg();
- arg->key_materials_config = key_materials_config.get();
- arg->error_details = new grpc_tls_error_details();
- int result = credential_reload_config->Schedule(arg);
- if (result) {
- /** Credential reloading is performed async. This is not yet supported.
- * **/
- gpr_log(GPR_ERROR, "Async credential reload is unsupported now.");
- *status = GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_UNCHANGED;
- reload_status =
- is_key_materials_empty ? GRPC_STATUS_UNIMPLEMENTED : GRPC_STATUS_OK;
- } else {
- /** Credential reloading is performed sync. **/
- *status = arg->status;
- if (arg->status == GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_UNCHANGED) {
- /* Key materials is not empty. */
- gpr_log(GPR_DEBUG, "Credential does not change after reload.");
- } else if (arg->status == GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_FAIL) {
- gpr_log(GPR_ERROR, "Credential reload failed with an error:");
- if (arg->error_details != nullptr) {
- gpr_log(GPR_ERROR, "%s", arg->error_details->error_details().c_str());
- }
- reload_status =
- is_key_materials_empty ? GRPC_STATUS_INTERNAL : GRPC_STATUS_OK;
- }
- }
- delete arg->error_details;
- /** If the credential reload config was constructed via a wrapped language,
- * then |arg->context| and |arg->destroy_context| will not be nullptr. In
- * this case, we must destroy |arg->context|, which stores the wrapped
- * language-version of the credential reload arg. **/
- if (arg->destroy_context != nullptr) {
- arg->destroy_context(arg->context);
- }
- delete arg;
- }
- return reload_status;
-}
-
-grpc_error* TlsCheckHostName(const char* peer_name, const tsi_peer* peer) {
- /* Check the peer name if specified. */
- if (peer_name != nullptr && !grpc_ssl_host_matches_name(peer, peer_name)) {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("Peer name ", peer_name, " is not in peer certificate")
- .c_str());
- }
- return GRPC_ERROR_NONE;
-}
-
-TlsChannelSecurityConnector::TlsChannelSecurityConnector(
- grpc_core::RefCountedPtr<grpc_channel_credentials> channel_creds,
- grpc_core::RefCountedPtr<grpc_call_credentials> request_metadata_creds,
- const char* target_name, const char* overridden_target_name)
- : grpc_channel_security_connector(GRPC_SSL_URL_SCHEME,
- std::move(channel_creds),
- std::move(request_metadata_creds)),
- overridden_target_name_(
- overridden_target_name == nullptr ? "" : overridden_target_name) {
- key_materials_config_ = grpc_tls_key_materials_config_create()->Ref();
- check_arg_ = ServerAuthorizationCheckArgCreate(this);
- y_absl::string_view host;
- y_absl::string_view port;
- grpc_core::SplitHostPort(target_name, &host, &port);
- target_name_ = TString(host);
-}
-
-TlsChannelSecurityConnector::~TlsChannelSecurityConnector() {
- if (client_handshaker_factory_ != nullptr) {
- tsi_ssl_client_handshaker_factory_unref(client_handshaker_factory_);
- }
- if (key_materials_config_.get() != nullptr) {
- key_materials_config_.get()->Unref();
- }
- ServerAuthorizationCheckArgDestroy(check_arg_);
-}
-
-void TlsChannelSecurityConnector::add_handshakers(
- const grpc_channel_args* args, grpc_pollset_set* /*interested_parties*/,
- grpc_core::HandshakeManager* handshake_mgr) {
- if (RefreshHandshakerFactory() != GRPC_SECURITY_OK) {
- gpr_log(GPR_ERROR, "Handshaker factory refresh failed.");
- return;
- }
- // Instantiate TSI handshaker.
- tsi_handshaker* tsi_hs = nullptr;
- tsi_result result = tsi_ssl_client_handshaker_factory_create_handshaker(
- client_handshaker_factory_,
- overridden_target_name_.empty() ? target_name_.c_str()
- : overridden_target_name_.c_str(),
- &tsi_hs);
- if (result != TSI_OK) {
- gpr_log(GPR_ERROR, "Handshaker creation failed with error %s.",
- tsi_result_to_string(result));
- return;
- }
- // Create handshakers.
- handshake_mgr->Add(grpc_core::SecurityHandshakerCreate(tsi_hs, this, args));
-}
-
-void TlsChannelSecurityConnector::check_peer(
- tsi_peer peer, grpc_endpoint* /*ep*/,
- grpc_core::RefCountedPtr<grpc_auth_context>* auth_context,
- grpc_closure* on_peer_checked) {
- const char* target_name = overridden_target_name_.empty()
- ? target_name_.c_str()
- : overridden_target_name_.c_str();
- grpc_error* error = grpc_ssl_check_alpn(&peer);
- if (error != GRPC_ERROR_NONE) {
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, on_peer_checked, error);
- tsi_peer_destruct(&peer);
- return;
- }
- *auth_context =
- grpc_ssl_peer_to_auth_context(&peer, GRPC_TLS_TRANSPORT_SECURITY_TYPE);
- const TlsCredentials* creds =
- static_cast<const TlsCredentials*>(channel_creds());
- if (creds->options().server_verification_option() ==
- GRPC_TLS_SERVER_VERIFICATION) {
- /* Do the default host name check if specifying the target name. */
- error = TlsCheckHostName(target_name, &peer);
- if (error != GRPC_ERROR_NONE) {
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, on_peer_checked, error);
- tsi_peer_destruct(&peer);
- return;
- }
- }
- /* Do the custom server authorization check, if specified by the user. */
- const grpc_tls_server_authorization_check_config* config =
- creds->options().server_authorization_check_config();
- /* If server authorization config is not null, use it to perform
- * server authorization check. */
- if (config != nullptr) {
- const tsi_peer_property* p =
- tsi_peer_get_property_by_name(&peer, TSI_X509_PEM_CERT_PROPERTY);
- if (p == nullptr) {
- error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "Cannot check peer: missing pem cert property.");
- } else {
- char* peer_pem = static_cast<char*>(gpr_zalloc(p->value.length + 1));
- memcpy(peer_pem, p->value.data, p->value.length);
- GPR_ASSERT(check_arg_ != nullptr);
- check_arg_->peer_cert = check_arg_->peer_cert == nullptr
- ? gpr_strdup(peer_pem)
- : check_arg_->peer_cert;
- check_arg_->target_name = check_arg_->target_name == nullptr
- ? gpr_strdup(target_name)
- : check_arg_->target_name;
- on_peer_checked_ = on_peer_checked;
- gpr_free(peer_pem);
- const tsi_peer_property* chain = tsi_peer_get_property_by_name(
- &peer, TSI_X509_PEM_CERT_CHAIN_PROPERTY);
- if (chain != nullptr) {
- char* peer_pem_chain =
- static_cast<char*>(gpr_zalloc(chain->value.length + 1));
- memcpy(peer_pem_chain, chain->value.data, chain->value.length);
- check_arg_->peer_cert_full_chain =
- check_arg_->peer_cert_full_chain == nullptr
- ? gpr_strdup(peer_pem_chain)
- : check_arg_->peer_cert_full_chain;
- gpr_free(peer_pem_chain);
- }
- int callback_status = config->Schedule(check_arg_);
- /* Server authorization check is handled asynchronously. */
- if (callback_status) {
- tsi_peer_destruct(&peer);
- return;
- }
- /* Server authorization check is handled synchronously. */
- error = ProcessServerAuthorizationCheckResult(check_arg_);
- }
- }
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, on_peer_checked, error);
- tsi_peer_destruct(&peer);
-}
-
-int TlsChannelSecurityConnector::cmp(
- const grpc_security_connector* other_sc) const {
- auto* other = reinterpret_cast<const TlsChannelSecurityConnector*>(other_sc);
- int c = channel_security_connector_cmp(other);
- if (c != 0) {
- return c;
- }
- return grpc_ssl_cmp_target_name(
- target_name_.c_str(), other->target_name_.c_str(),
- overridden_target_name_.c_str(), other->overridden_target_name_.c_str());
-}
-
-bool TlsChannelSecurityConnector::check_call_host(
- y_absl::string_view host, grpc_auth_context* auth_context,
- grpc_closure* /*on_call_host_checked*/, grpc_error** error) {
- return grpc_ssl_check_call_host(host, target_name_.c_str(),
- overridden_target_name_.c_str(), auth_context,
- error);
-}
-
-void TlsChannelSecurityConnector::cancel_check_call_host(
- grpc_closure* /*on_call_host_checked*/, grpc_error* error) {
- GRPC_ERROR_UNREF(error);
-}
-
-grpc_core::RefCountedPtr<grpc_channel_security_connector>
-TlsChannelSecurityConnector::CreateTlsChannelSecurityConnector(
- grpc_core::RefCountedPtr<grpc_channel_credentials> channel_creds,
- grpc_core::RefCountedPtr<grpc_call_credentials> request_metadata_creds,
- const char* target_name, const char* overridden_target_name,
- tsi_ssl_session_cache* ssl_session_cache) {
- if (channel_creds == nullptr) {
- gpr_log(GPR_ERROR,
- "channel_creds is nullptr in "
- "TlsChannelSecurityConnectorCreate()");
- return nullptr;
- }
- if (target_name == nullptr) {
- gpr_log(GPR_ERROR,
- "target_name is nullptr in "
- "TlsChannelSecurityConnectorCreate()");
- return nullptr;
- }
- grpc_core::RefCountedPtr<TlsChannelSecurityConnector> c =
- grpc_core::MakeRefCounted<TlsChannelSecurityConnector>(
- std::move(channel_creds), std::move(request_metadata_creds),
- target_name, overridden_target_name);
- if (c->InitializeHandshakerFactory(ssl_session_cache) != GRPC_SECURITY_OK) {
- gpr_log(GPR_ERROR, "Could not initialize client handshaker factory.");
- return nullptr;
- }
- return c;
-}
-
-grpc_security_status TlsChannelSecurityConnector::ReplaceHandshakerFactory(
- tsi_ssl_session_cache* ssl_session_cache) {
- const TlsCredentials* creds =
- static_cast<const TlsCredentials*>(channel_creds());
- bool skip_server_certificate_verification =
- creds->options().server_verification_option() ==
- GRPC_TLS_SKIP_ALL_SERVER_VERIFICATION;
- /* Free the client handshaker factory if exists. */
- if (client_handshaker_factory_) {
- tsi_ssl_client_handshaker_factory_unref(client_handshaker_factory_);
- }
- tsi_ssl_pem_key_cert_pair* pem_key_cert_pair = ConvertToTsiPemKeyCertPair(
- key_materials_config_->pem_key_cert_pair_list());
- grpc_security_status status = grpc_ssl_tsi_client_handshaker_factory_init(
- pem_key_cert_pair, key_materials_config_->pem_root_certs(),
- skip_server_certificate_verification,
- grpc_get_tsi_tls_version(creds->options().min_tls_version()),
- grpc_get_tsi_tls_version(creds->options().max_tls_version()),
- ssl_session_cache, &client_handshaker_factory_);
- /* Free memory. */
- grpc_tsi_ssl_pem_key_cert_pairs_destroy(pem_key_cert_pair, 1);
- return status;
-}
-
-grpc_security_status TlsChannelSecurityConnector::InitializeHandshakerFactory(
- tsi_ssl_session_cache* ssl_session_cache) {
- grpc_core::MutexLock lock(&mu_);
- const TlsCredentials* creds =
- static_cast<const TlsCredentials*>(channel_creds());
- grpc_tls_key_materials_config* key_materials_config =
- creds->options().key_materials_config();
- // key_materials_config_->set_key_materials will handle the copying of the key
- // materials users provided
- if (key_materials_config != nullptr) {
- key_materials_config_->set_key_materials(
- key_materials_config->pem_root_certs(),
- key_materials_config->pem_key_cert_pair_list());
- }
- grpc_ssl_certificate_config_reload_status reload_status =
- GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_UNCHANGED;
- /** If |creds->options()| has a credential reload config, then the call to
- * |TlsFetchKeyMaterials| will use it to update the root cert and
- * pem-key-cert-pair list stored in |key_materials_config_|. **/
- if (TlsFetchKeyMaterials(key_materials_config_, creds->options(), false,
- &reload_status) != GRPC_STATUS_OK) {
- /* Raise an error if key materials are not populated. */
- return GRPC_SECURITY_ERROR;
- }
- return ReplaceHandshakerFactory(ssl_session_cache);
-}
-
-grpc_security_status TlsChannelSecurityConnector::RefreshHandshakerFactory() {
- grpc_core::MutexLock lock(&mu_);
- const TlsCredentials* creds =
- static_cast<const TlsCredentials*>(channel_creds());
- grpc_ssl_certificate_config_reload_status reload_status =
- GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_UNCHANGED;
- /** If |creds->options()| has a credential reload config, then the call to
- * |TlsFetchKeyMaterials| will use it to update the root cert and
- * pem-key-cert-pair list stored in |key_materials_config_|. **/
- if (TlsFetchKeyMaterials(key_materials_config_, creds->options(), false,
- &reload_status) != GRPC_STATUS_OK) {
- return GRPC_SECURITY_ERROR;
- }
- if (reload_status != GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_NEW) {
- // Re-use existing handshaker factory.
- return GRPC_SECURITY_OK;
- } else {
- return ReplaceHandshakerFactory(nullptr);
- }
-}
-
-void TlsChannelSecurityConnector::ServerAuthorizationCheckDone(
- grpc_tls_server_authorization_check_arg* arg) {
- GPR_ASSERT(arg != nullptr);
- grpc_core::ExecCtx exec_ctx;
- grpc_error* error = ProcessServerAuthorizationCheckResult(arg);
- TlsChannelSecurityConnector* connector =
- static_cast<TlsChannelSecurityConnector*>(arg->cb_user_data);
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, connector->on_peer_checked_, error);
-}
-
-grpc_error* TlsChannelSecurityConnector::ProcessServerAuthorizationCheckResult(
- grpc_tls_server_authorization_check_arg* arg) {
- grpc_error* error = GRPC_ERROR_NONE;
- /* Server authorization check is cancelled by caller. */
- if (arg->status == GRPC_STATUS_CANCELLED) {
- error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("Server authorization check is cancelled by the caller "
- "with error: ",
- arg->error_details->error_details())
- .c_str());
- } else if (arg->status == GRPC_STATUS_OK) {
- /* Server authorization check completed successfully but returned check
- * failure. */
- if (!arg->success) {
- error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("Server authorization check failed with error: ",
- arg->error_details->error_details())
- .c_str());
- }
- /* Server authorization check did not complete correctly. */
- } else {
- error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat(
- "Server authorization check did not finish correctly with error: ",
- arg->error_details->error_details())
- .c_str());
- }
- return error;
-}
-
-grpc_tls_server_authorization_check_arg*
-TlsChannelSecurityConnector::ServerAuthorizationCheckArgCreate(
- void* user_data) {
- grpc_tls_server_authorization_check_arg* arg =
- new grpc_tls_server_authorization_check_arg();
- arg->error_details = new grpc_tls_error_details();
- arg->cb = ServerAuthorizationCheckDone;
- arg->cb_user_data = user_data;
- arg->status = GRPC_STATUS_OK;
- return arg;
-}
-
-void TlsChannelSecurityConnector::ServerAuthorizationCheckArgDestroy(
- grpc_tls_server_authorization_check_arg* arg) {
- if (arg == nullptr) {
- return;
- }
- gpr_free((void*)arg->target_name);
- gpr_free((void*)arg->peer_cert);
- if (arg->peer_cert_full_chain) gpr_free((void*)arg->peer_cert_full_chain);
- delete arg->error_details;
- if (arg->destroy_context != nullptr) {
- arg->destroy_context(arg->context);
- }
- delete arg;
-}
-
-TlsServerSecurityConnector::TlsServerSecurityConnector(
- grpc_core::RefCountedPtr<grpc_server_credentials> server_creds)
- : grpc_server_security_connector(GRPC_SSL_URL_SCHEME,
- std::move(server_creds)) {
- key_materials_config_ = grpc_tls_key_materials_config_create()->Ref();
-}
-
-TlsServerSecurityConnector::~TlsServerSecurityConnector() {
- if (server_handshaker_factory_ != nullptr) {
- tsi_ssl_server_handshaker_factory_unref(server_handshaker_factory_);
- }
- if (key_materials_config_.get() != nullptr) {
- key_materials_config_.get()->Unref();
- }
-}
-
-void TlsServerSecurityConnector::add_handshakers(
- const grpc_channel_args* args, grpc_pollset_set* /*interested_parties*/,
- grpc_core::HandshakeManager* handshake_mgr) {
- /* Refresh handshaker factory if needed. */
- if (RefreshHandshakerFactory() != GRPC_SECURITY_OK) {
- gpr_log(GPR_ERROR, "Handshaker factory refresh failed.");
- return;
- }
- /* Create a TLS TSI handshaker for server. */
- tsi_handshaker* tsi_hs = nullptr;
- tsi_result result = tsi_ssl_server_handshaker_factory_create_handshaker(
- server_handshaker_factory_, &tsi_hs);
- if (result != TSI_OK) {
- gpr_log(GPR_ERROR, "Handshaker creation failed with error %s.",
- tsi_result_to_string(result));
- return;
- }
- handshake_mgr->Add(grpc_core::SecurityHandshakerCreate(tsi_hs, this, args));
-}
-
-void TlsServerSecurityConnector::check_peer(
- tsi_peer peer, grpc_endpoint* /*ep*/,
- grpc_core::RefCountedPtr<grpc_auth_context>* auth_context,
- grpc_closure* on_peer_checked) {
- grpc_error* error = grpc_ssl_check_alpn(&peer);
- *auth_context =
- grpc_ssl_peer_to_auth_context(&peer, GRPC_TLS_TRANSPORT_SECURITY_TYPE);
- tsi_peer_destruct(&peer);
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, on_peer_checked, error);
-}
-
-int TlsServerSecurityConnector::cmp(
- const grpc_security_connector* other) const {
- return server_security_connector_cmp(
- static_cast<const grpc_server_security_connector*>(other));
-}
-
-grpc_core::RefCountedPtr<grpc_server_security_connector>
-TlsServerSecurityConnector::CreateTlsServerSecurityConnector(
- grpc_core::RefCountedPtr<grpc_server_credentials> server_creds) {
- if (server_creds == nullptr) {
- gpr_log(GPR_ERROR,
- "server_creds is nullptr in "
- "TlsServerSecurityConnectorCreate()");
- return nullptr;
- }
- grpc_core::RefCountedPtr<TlsServerSecurityConnector> c =
- grpc_core::MakeRefCounted<TlsServerSecurityConnector>(
- std::move(server_creds));
- if (c->InitializeHandshakerFactory() != GRPC_SECURITY_OK) {
- gpr_log(GPR_ERROR, "Could not initialize server handshaker factory.");
- return nullptr;
- }
- return c;
-}
-
-grpc_security_status TlsServerSecurityConnector::ReplaceHandshakerFactory() {
- const TlsServerCredentials* creds =
- static_cast<const TlsServerCredentials*>(server_creds());
- /* Free the server handshaker factory if exists. */
- if (server_handshaker_factory_) {
- tsi_ssl_server_handshaker_factory_unref(server_handshaker_factory_);
- }
- GPR_ASSERT(!key_materials_config_->pem_key_cert_pair_list().empty());
- tsi_ssl_pem_key_cert_pair* pem_key_cert_pairs = ConvertToTsiPemKeyCertPair(
- key_materials_config_->pem_key_cert_pair_list());
- size_t num_key_cert_pairs =
- key_materials_config_->pem_key_cert_pair_list().size();
- grpc_security_status status = grpc_ssl_tsi_server_handshaker_factory_init(
- pem_key_cert_pairs, num_key_cert_pairs,
- key_materials_config_->pem_root_certs(),
- creds->options().cert_request_type(),
- grpc_get_tsi_tls_version(creds->options().min_tls_version()),
- grpc_get_tsi_tls_version(creds->options().max_tls_version()),
- &server_handshaker_factory_);
- /* Free memory. */
- grpc_tsi_ssl_pem_key_cert_pairs_destroy(pem_key_cert_pairs,
- num_key_cert_pairs);
- return status;
-}
-
-grpc_security_status TlsServerSecurityConnector::InitializeHandshakerFactory() {
- grpc_core::MutexLock lock(&mu_);
- const TlsServerCredentials* creds =
- static_cast<const TlsServerCredentials*>(server_creds());
- grpc_tls_key_materials_config* key_materials_config =
- creds->options().key_materials_config();
- if (key_materials_config != nullptr) {
- key_materials_config_->set_key_materials(
- key_materials_config->pem_root_certs(),
- key_materials_config->pem_key_cert_pair_list());
- }
- grpc_ssl_certificate_config_reload_status reload_status =
- GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_UNCHANGED;
- /** If |creds->options()| has a credential reload config, then the call to
- * |TlsFetchKeyMaterials| will use it to update the root cert and
- * pem-key-cert-pair list stored in |key_materials_config_|. Otherwise, it
- * will return |GRPC_STATUS_OK| if |key_materials_config_| already has
- * credentials, and an error code if not. **/
- if (TlsFetchKeyMaterials(key_materials_config_, creds->options(), true,
- &reload_status) != GRPC_STATUS_OK) {
- /* Raise an error if key materials are not populated. */
- return GRPC_SECURITY_ERROR;
- }
- return ReplaceHandshakerFactory();
-}
-
-grpc_security_status TlsServerSecurityConnector::RefreshHandshakerFactory() {
- grpc_core::MutexLock lock(&mu_);
- const TlsServerCredentials* creds =
- static_cast<const TlsServerCredentials*>(server_creds());
- grpc_ssl_certificate_config_reload_status reload_status =
- GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_UNCHANGED;
- /** If |creds->options()| has a credential reload config, then the call to
- * |TlsFetchKeyMaterials| will use it to update the root cert and
- * pem-key-cert-pair list stored in |key_materials_config_|. Otherwise, it
- * will return |GRPC_STATUS_OK| if |key_materials_config_| already has
- * credentials, and an error code if not. **/
- if (TlsFetchKeyMaterials(key_materials_config_, creds->options(), true,
- &reload_status) != GRPC_STATUS_OK) {
- return GRPC_SECURITY_ERROR;
- }
- if (reload_status != GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_NEW) {
- /* At this point, we should have key materials populated. */
- return GRPC_SECURITY_OK;
- } else {
- return ReplaceHandshakerFactory();
- }
-}
-
-} // namespace grpc_core
+/*
+ *
+ * Copyright 2018 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/lib/security/security_connector/tls/tls_security_connector.h"
+
+#include <stdbool.h>
+#include <string.h>
+
+#include "y_absl/strings/str_cat.h"
+#include "y_absl/strings/string_view.h"
+
+#include <grpc/grpc.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
+
+#include "src/core/lib/gprpp/host_port.h"
+#include "src/core/lib/security/credentials/ssl/ssl_credentials.h"
+#include "src/core/lib/security/credentials/tls/tls_credentials.h"
+#include "src/core/lib/security/security_connector/ssl_utils.h"
+#include "src/core/lib/security/transport/security_handshaker.h"
+#include "src/core/lib/slice/slice_internal.h"
+#include "src/core/lib/transport/transport.h"
+#include "src/core/tsi/ssl_transport_security.h"
+#include "src/core/tsi/transport_security.h"
+
+namespace grpc_core {
+
+namespace {
+
+tsi_ssl_pem_key_cert_pair* ConvertToTsiPemKeyCertPair(
+ const grpc_tls_key_materials_config::PemKeyCertPairList& cert_pair_list) {
+ tsi_ssl_pem_key_cert_pair* tsi_pairs = nullptr;
+ size_t num_key_cert_pairs = cert_pair_list.size();
+ if (num_key_cert_pairs > 0) {
+ GPR_ASSERT(cert_pair_list.data() != nullptr);
+ tsi_pairs = static_cast<tsi_ssl_pem_key_cert_pair*>(
+ gpr_zalloc(num_key_cert_pairs * sizeof(tsi_ssl_pem_key_cert_pair)));
+ }
+ for (size_t i = 0; i < num_key_cert_pairs; i++) {
+ GPR_ASSERT(cert_pair_list[i].private_key() != nullptr);
+ GPR_ASSERT(cert_pair_list[i].cert_chain() != nullptr);
+ tsi_pairs[i].cert_chain = gpr_strdup(cert_pair_list[i].cert_chain());
+ tsi_pairs[i].private_key = gpr_strdup(cert_pair_list[i].private_key());
+ }
+ return tsi_pairs;
+}
+
+} // namespace
+
+grpc_status_code TlsFetchKeyMaterials(
+ const grpc_core::RefCountedPtr<grpc_tls_key_materials_config>&
+ key_materials_config,
+ const grpc_tls_credentials_options& options, bool is_server,
+ grpc_ssl_certificate_config_reload_status* status) {
+ GPR_ASSERT(key_materials_config != nullptr);
+ GPR_ASSERT(status != nullptr);
+ bool is_key_materials_empty =
+ key_materials_config->pem_key_cert_pair_list().empty();
+ grpc_tls_credential_reload_config* credential_reload_config =
+ options.credential_reload_config();
+ /** If there are no key materials and no credential reload config and the
+ * caller is a server, then return an error. We do not require that a client
+ * always provision certificates. **/
+ if (credential_reload_config == nullptr && is_key_materials_empty &&
+ is_server) {
+ gpr_log(GPR_ERROR,
+ "Either credential reload config or key materials should be "
+ "provisioned.");
+ return GRPC_STATUS_FAILED_PRECONDITION;
+ }
+ grpc_status_code reload_status = GRPC_STATUS_OK;
+ /** Use |credential_reload_config| to update |key_materials_config|. **/
+ if (credential_reload_config != nullptr) {
+ grpc_tls_credential_reload_arg* arg = new grpc_tls_credential_reload_arg();
+ arg->key_materials_config = key_materials_config.get();
+ arg->error_details = new grpc_tls_error_details();
+ int result = credential_reload_config->Schedule(arg);
+ if (result) {
+ /** Credential reloading is performed async. This is not yet supported.
+ * **/
+ gpr_log(GPR_ERROR, "Async credential reload is unsupported now.");
+ *status = GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_UNCHANGED;
+ reload_status =
+ is_key_materials_empty ? GRPC_STATUS_UNIMPLEMENTED : GRPC_STATUS_OK;
+ } else {
+ /** Credential reloading is performed sync. **/
+ *status = arg->status;
+ if (arg->status == GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_UNCHANGED) {
+ /* Key materials is not empty. */
+ gpr_log(GPR_DEBUG, "Credential does not change after reload.");
+ } else if (arg->status == GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_FAIL) {
+ gpr_log(GPR_ERROR, "Credential reload failed with an error:");
+ if (arg->error_details != nullptr) {
+ gpr_log(GPR_ERROR, "%s", arg->error_details->error_details().c_str());
+ }
+ reload_status =
+ is_key_materials_empty ? GRPC_STATUS_INTERNAL : GRPC_STATUS_OK;
+ }
+ }
+ delete arg->error_details;
+ /** If the credential reload config was constructed via a wrapped language,
+ * then |arg->context| and |arg->destroy_context| will not be nullptr. In
+ * this case, we must destroy |arg->context|, which stores the wrapped
+ * language-version of the credential reload arg. **/
+ if (arg->destroy_context != nullptr) {
+ arg->destroy_context(arg->context);
+ }
+ delete arg;
+ }
+ return reload_status;
+}
+
+grpc_error* TlsCheckHostName(const char* peer_name, const tsi_peer* peer) {
+ /* Check the peer name if specified. */
+ if (peer_name != nullptr && !grpc_ssl_host_matches_name(peer, peer_name)) {
+ return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrCat("Peer name ", peer_name, " is not in peer certificate")
+ .c_str());
+ }
+ return GRPC_ERROR_NONE;
+}
+
+TlsChannelSecurityConnector::TlsChannelSecurityConnector(
+ grpc_core::RefCountedPtr<grpc_channel_credentials> channel_creds,
+ grpc_core::RefCountedPtr<grpc_call_credentials> request_metadata_creds,
+ const char* target_name, const char* overridden_target_name)
+ : grpc_channel_security_connector(GRPC_SSL_URL_SCHEME,
+ std::move(channel_creds),
+ std::move(request_metadata_creds)),
+ overridden_target_name_(
+ overridden_target_name == nullptr ? "" : overridden_target_name) {
+ key_materials_config_ = grpc_tls_key_materials_config_create()->Ref();
+ check_arg_ = ServerAuthorizationCheckArgCreate(this);
+ y_absl::string_view host;
+ y_absl::string_view port;
+ grpc_core::SplitHostPort(target_name, &host, &port);
+ target_name_ = TString(host);
+}
+
+TlsChannelSecurityConnector::~TlsChannelSecurityConnector() {
+ if (client_handshaker_factory_ != nullptr) {
+ tsi_ssl_client_handshaker_factory_unref(client_handshaker_factory_);
+ }
+ if (key_materials_config_.get() != nullptr) {
+ key_materials_config_.get()->Unref();
+ }
+ ServerAuthorizationCheckArgDestroy(check_arg_);
+}
+
+void TlsChannelSecurityConnector::add_handshakers(
+ const grpc_channel_args* args, grpc_pollset_set* /*interested_parties*/,
+ grpc_core::HandshakeManager* handshake_mgr) {
+ if (RefreshHandshakerFactory() != GRPC_SECURITY_OK) {
+ gpr_log(GPR_ERROR, "Handshaker factory refresh failed.");
+ return;
+ }
+ // Instantiate TSI handshaker.
+ tsi_handshaker* tsi_hs = nullptr;
+ tsi_result result = tsi_ssl_client_handshaker_factory_create_handshaker(
+ client_handshaker_factory_,
+ overridden_target_name_.empty() ? target_name_.c_str()
+ : overridden_target_name_.c_str(),
+ &tsi_hs);
+ if (result != TSI_OK) {
+ gpr_log(GPR_ERROR, "Handshaker creation failed with error %s.",
+ tsi_result_to_string(result));
+ return;
+ }
+ // Create handshakers.
+ handshake_mgr->Add(grpc_core::SecurityHandshakerCreate(tsi_hs, this, args));
+}
+
+void TlsChannelSecurityConnector::check_peer(
+ tsi_peer peer, grpc_endpoint* /*ep*/,
+ grpc_core::RefCountedPtr<grpc_auth_context>* auth_context,
+ grpc_closure* on_peer_checked) {
+ const char* target_name = overridden_target_name_.empty()
+ ? target_name_.c_str()
+ : overridden_target_name_.c_str();
+ grpc_error* error = grpc_ssl_check_alpn(&peer);
+ if (error != GRPC_ERROR_NONE) {
+ grpc_core::ExecCtx::Run(DEBUG_LOCATION, on_peer_checked, error);
+ tsi_peer_destruct(&peer);
+ return;
+ }
+ *auth_context =
+ grpc_ssl_peer_to_auth_context(&peer, GRPC_TLS_TRANSPORT_SECURITY_TYPE);
+ const TlsCredentials* creds =
+ static_cast<const TlsCredentials*>(channel_creds());
+ if (creds->options().server_verification_option() ==
+ GRPC_TLS_SERVER_VERIFICATION) {
+ /* Do the default host name check if specifying the target name. */
+ error = TlsCheckHostName(target_name, &peer);
+ if (error != GRPC_ERROR_NONE) {
+ grpc_core::ExecCtx::Run(DEBUG_LOCATION, on_peer_checked, error);
+ tsi_peer_destruct(&peer);
+ return;
+ }
+ }
+ /* Do the custom server authorization check, if specified by the user. */
+ const grpc_tls_server_authorization_check_config* config =
+ creds->options().server_authorization_check_config();
+ /* If server authorization config is not null, use it to perform
+ * server authorization check. */
+ if (config != nullptr) {
+ const tsi_peer_property* p =
+ tsi_peer_get_property_by_name(&peer, TSI_X509_PEM_CERT_PROPERTY);
+ if (p == nullptr) {
+ error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Cannot check peer: missing pem cert property.");
+ } else {
+ char* peer_pem = static_cast<char*>(gpr_zalloc(p->value.length + 1));
+ memcpy(peer_pem, p->value.data, p->value.length);
+ GPR_ASSERT(check_arg_ != nullptr);
+ check_arg_->peer_cert = check_arg_->peer_cert == nullptr
+ ? gpr_strdup(peer_pem)
+ : check_arg_->peer_cert;
+ check_arg_->target_name = check_arg_->target_name == nullptr
+ ? gpr_strdup(target_name)
+ : check_arg_->target_name;
+ on_peer_checked_ = on_peer_checked;
+ gpr_free(peer_pem);
+ const tsi_peer_property* chain = tsi_peer_get_property_by_name(
+ &peer, TSI_X509_PEM_CERT_CHAIN_PROPERTY);
+ if (chain != nullptr) {
+ char* peer_pem_chain =
+ static_cast<char*>(gpr_zalloc(chain->value.length + 1));
+ memcpy(peer_pem_chain, chain->value.data, chain->value.length);
+ check_arg_->peer_cert_full_chain =
+ check_arg_->peer_cert_full_chain == nullptr
+ ? gpr_strdup(peer_pem_chain)
+ : check_arg_->peer_cert_full_chain;
+ gpr_free(peer_pem_chain);
+ }
+ int callback_status = config->Schedule(check_arg_);
+ /* Server authorization check is handled asynchronously. */
+ if (callback_status) {
+ tsi_peer_destruct(&peer);
+ return;
+ }
+ /* Server authorization check is handled synchronously. */
+ error = ProcessServerAuthorizationCheckResult(check_arg_);
+ }
+ }
+ grpc_core::ExecCtx::Run(DEBUG_LOCATION, on_peer_checked, error);
+ tsi_peer_destruct(&peer);
+}
+
+int TlsChannelSecurityConnector::cmp(
+ const grpc_security_connector* other_sc) const {
+ auto* other = reinterpret_cast<const TlsChannelSecurityConnector*>(other_sc);
+ int c = channel_security_connector_cmp(other);
+ if (c != 0) {
+ return c;
+ }
+ return grpc_ssl_cmp_target_name(
+ target_name_.c_str(), other->target_name_.c_str(),
+ overridden_target_name_.c_str(), other->overridden_target_name_.c_str());
+}
+
+bool TlsChannelSecurityConnector::check_call_host(
+ y_absl::string_view host, grpc_auth_context* auth_context,
+ grpc_closure* /*on_call_host_checked*/, grpc_error** error) {
+ return grpc_ssl_check_call_host(host, target_name_.c_str(),
+ overridden_target_name_.c_str(), auth_context,
+ error);
+}
+
+void TlsChannelSecurityConnector::cancel_check_call_host(
+ grpc_closure* /*on_call_host_checked*/, grpc_error* error) {
+ GRPC_ERROR_UNREF(error);
+}
+
+grpc_core::RefCountedPtr<grpc_channel_security_connector>
+TlsChannelSecurityConnector::CreateTlsChannelSecurityConnector(
+ grpc_core::RefCountedPtr<grpc_channel_credentials> channel_creds,
+ grpc_core::RefCountedPtr<grpc_call_credentials> request_metadata_creds,
+ const char* target_name, const char* overridden_target_name,
+ tsi_ssl_session_cache* ssl_session_cache) {
+ if (channel_creds == nullptr) {
+ gpr_log(GPR_ERROR,
+ "channel_creds is nullptr in "
+ "TlsChannelSecurityConnectorCreate()");
+ return nullptr;
+ }
+ if (target_name == nullptr) {
+ gpr_log(GPR_ERROR,
+ "target_name is nullptr in "
+ "TlsChannelSecurityConnectorCreate()");
+ return nullptr;
+ }
+ grpc_core::RefCountedPtr<TlsChannelSecurityConnector> c =
+ grpc_core::MakeRefCounted<TlsChannelSecurityConnector>(
+ std::move(channel_creds), std::move(request_metadata_creds),
+ target_name, overridden_target_name);
+ if (c->InitializeHandshakerFactory(ssl_session_cache) != GRPC_SECURITY_OK) {
+ gpr_log(GPR_ERROR, "Could not initialize client handshaker factory.");
+ return nullptr;
+ }
+ return c;
+}
+
+grpc_security_status TlsChannelSecurityConnector::ReplaceHandshakerFactory(
+ tsi_ssl_session_cache* ssl_session_cache) {
+ const TlsCredentials* creds =
+ static_cast<const TlsCredentials*>(channel_creds());
+ bool skip_server_certificate_verification =
+ creds->options().server_verification_option() ==
+ GRPC_TLS_SKIP_ALL_SERVER_VERIFICATION;
+ /* Free the client handshaker factory if exists. */
+ if (client_handshaker_factory_) {
+ tsi_ssl_client_handshaker_factory_unref(client_handshaker_factory_);
+ }
+ tsi_ssl_pem_key_cert_pair* pem_key_cert_pair = ConvertToTsiPemKeyCertPair(
+ key_materials_config_->pem_key_cert_pair_list());
+ grpc_security_status status = grpc_ssl_tsi_client_handshaker_factory_init(
+ pem_key_cert_pair, key_materials_config_->pem_root_certs(),
+ skip_server_certificate_verification,
+ grpc_get_tsi_tls_version(creds->options().min_tls_version()),
+ grpc_get_tsi_tls_version(creds->options().max_tls_version()),
+ ssl_session_cache, &client_handshaker_factory_);
+ /* Free memory. */
+ grpc_tsi_ssl_pem_key_cert_pairs_destroy(pem_key_cert_pair, 1);
+ return status;
+}
+
+grpc_security_status TlsChannelSecurityConnector::InitializeHandshakerFactory(
+ tsi_ssl_session_cache* ssl_session_cache) {
+ grpc_core::MutexLock lock(&mu_);
+ const TlsCredentials* creds =
+ static_cast<const TlsCredentials*>(channel_creds());
+ grpc_tls_key_materials_config* key_materials_config =
+ creds->options().key_materials_config();
+ // key_materials_config_->set_key_materials will handle the copying of the key
+ // materials users provided
+ if (key_materials_config != nullptr) {
+ key_materials_config_->set_key_materials(
+ key_materials_config->pem_root_certs(),
+ key_materials_config->pem_key_cert_pair_list());
+ }
+ grpc_ssl_certificate_config_reload_status reload_status =
+ GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_UNCHANGED;
+ /** If |creds->options()| has a credential reload config, then the call to
+ * |TlsFetchKeyMaterials| will use it to update the root cert and
+ * pem-key-cert-pair list stored in |key_materials_config_|. **/
+ if (TlsFetchKeyMaterials(key_materials_config_, creds->options(), false,
+ &reload_status) != GRPC_STATUS_OK) {
+ /* Raise an error if key materials are not populated. */
+ return GRPC_SECURITY_ERROR;
+ }
+ return ReplaceHandshakerFactory(ssl_session_cache);
+}
+
+grpc_security_status TlsChannelSecurityConnector::RefreshHandshakerFactory() {
+ grpc_core::MutexLock lock(&mu_);
+ const TlsCredentials* creds =
+ static_cast<const TlsCredentials*>(channel_creds());
+ grpc_ssl_certificate_config_reload_status reload_status =
+ GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_UNCHANGED;
+ /** If |creds->options()| has a credential reload config, then the call to
+ * |TlsFetchKeyMaterials| will use it to update the root cert and
+ * pem-key-cert-pair list stored in |key_materials_config_|. **/
+ if (TlsFetchKeyMaterials(key_materials_config_, creds->options(), false,
+ &reload_status) != GRPC_STATUS_OK) {
+ return GRPC_SECURITY_ERROR;
+ }
+ if (reload_status != GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_NEW) {
+ // Re-use existing handshaker factory.
+ return GRPC_SECURITY_OK;
+ } else {
+ return ReplaceHandshakerFactory(nullptr);
+ }
+}
+
+void TlsChannelSecurityConnector::ServerAuthorizationCheckDone(
+ grpc_tls_server_authorization_check_arg* arg) {
+ GPR_ASSERT(arg != nullptr);
+ grpc_core::ExecCtx exec_ctx;
+ grpc_error* error = ProcessServerAuthorizationCheckResult(arg);
+ TlsChannelSecurityConnector* connector =
+ static_cast<TlsChannelSecurityConnector*>(arg->cb_user_data);
+ grpc_core::ExecCtx::Run(DEBUG_LOCATION, connector->on_peer_checked_, error);
+}
+
+grpc_error* TlsChannelSecurityConnector::ProcessServerAuthorizationCheckResult(
+ grpc_tls_server_authorization_check_arg* arg) {
+ grpc_error* error = GRPC_ERROR_NONE;
+ /* Server authorization check is cancelled by caller. */
+ if (arg->status == GRPC_STATUS_CANCELLED) {
+ error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrCat("Server authorization check is cancelled by the caller "
+ "with error: ",
+ arg->error_details->error_details())
+ .c_str());
+ } else if (arg->status == GRPC_STATUS_OK) {
+ /* Server authorization check completed successfully but returned check
+ * failure. */
+ if (!arg->success) {
+ error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrCat("Server authorization check failed with error: ",
+ arg->error_details->error_details())
+ .c_str());
+ }
+ /* Server authorization check did not complete correctly. */
+ } else {
+ error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrCat(
+ "Server authorization check did not finish correctly with error: ",
+ arg->error_details->error_details())
+ .c_str());
+ }
+ return error;
+}
+
+grpc_tls_server_authorization_check_arg*
+TlsChannelSecurityConnector::ServerAuthorizationCheckArgCreate(
+ void* user_data) {
+ grpc_tls_server_authorization_check_arg* arg =
+ new grpc_tls_server_authorization_check_arg();
+ arg->error_details = new grpc_tls_error_details();
+ arg->cb = ServerAuthorizationCheckDone;
+ arg->cb_user_data = user_data;
+ arg->status = GRPC_STATUS_OK;
+ return arg;
+}
+
+void TlsChannelSecurityConnector::ServerAuthorizationCheckArgDestroy(
+ grpc_tls_server_authorization_check_arg* arg) {
+ if (arg == nullptr) {
+ return;
+ }
+ gpr_free((void*)arg->target_name);
+ gpr_free((void*)arg->peer_cert);
+ if (arg->peer_cert_full_chain) gpr_free((void*)arg->peer_cert_full_chain);
+ delete arg->error_details;
+ if (arg->destroy_context != nullptr) {
+ arg->destroy_context(arg->context);
+ }
+ delete arg;
+}
+
+TlsServerSecurityConnector::TlsServerSecurityConnector(
+ grpc_core::RefCountedPtr<grpc_server_credentials> server_creds)
+ : grpc_server_security_connector(GRPC_SSL_URL_SCHEME,
+ std::move(server_creds)) {
+ key_materials_config_ = grpc_tls_key_materials_config_create()->Ref();
+}
+
+TlsServerSecurityConnector::~TlsServerSecurityConnector() {
+ if (server_handshaker_factory_ != nullptr) {
+ tsi_ssl_server_handshaker_factory_unref(server_handshaker_factory_);
+ }
+ if (key_materials_config_.get() != nullptr) {
+ key_materials_config_.get()->Unref();
+ }
+}
+
+void TlsServerSecurityConnector::add_handshakers(
+ const grpc_channel_args* args, grpc_pollset_set* /*interested_parties*/,
+ grpc_core::HandshakeManager* handshake_mgr) {
+ /* Refresh handshaker factory if needed. */
+ if (RefreshHandshakerFactory() != GRPC_SECURITY_OK) {
+ gpr_log(GPR_ERROR, "Handshaker factory refresh failed.");
+ return;
+ }
+ /* Create a TLS TSI handshaker for server. */
+ tsi_handshaker* tsi_hs = nullptr;
+ tsi_result result = tsi_ssl_server_handshaker_factory_create_handshaker(
+ server_handshaker_factory_, &tsi_hs);
+ if (result != TSI_OK) {
+ gpr_log(GPR_ERROR, "Handshaker creation failed with error %s.",
+ tsi_result_to_string(result));
+ return;
+ }
+ handshake_mgr->Add(grpc_core::SecurityHandshakerCreate(tsi_hs, this, args));
+}
+
+void TlsServerSecurityConnector::check_peer(
+ tsi_peer peer, grpc_endpoint* /*ep*/,
+ grpc_core::RefCountedPtr<grpc_auth_context>* auth_context,
+ grpc_closure* on_peer_checked) {
+ grpc_error* error = grpc_ssl_check_alpn(&peer);
+ *auth_context =
+ grpc_ssl_peer_to_auth_context(&peer, GRPC_TLS_TRANSPORT_SECURITY_TYPE);
+ tsi_peer_destruct(&peer);
+ grpc_core::ExecCtx::Run(DEBUG_LOCATION, on_peer_checked, error);
+}
+
+int TlsServerSecurityConnector::cmp(
+ const grpc_security_connector* other) const {
+ return server_security_connector_cmp(
+ static_cast<const grpc_server_security_connector*>(other));
+}
+
+grpc_core::RefCountedPtr<grpc_server_security_connector>
+TlsServerSecurityConnector::CreateTlsServerSecurityConnector(
+ grpc_core::RefCountedPtr<grpc_server_credentials> server_creds) {
+ if (server_creds == nullptr) {
+ gpr_log(GPR_ERROR,
+ "server_creds is nullptr in "
+ "TlsServerSecurityConnectorCreate()");
+ return nullptr;
+ }
+ grpc_core::RefCountedPtr<TlsServerSecurityConnector> c =
+ grpc_core::MakeRefCounted<TlsServerSecurityConnector>(
+ std::move(server_creds));
+ if (c->InitializeHandshakerFactory() != GRPC_SECURITY_OK) {
+ gpr_log(GPR_ERROR, "Could not initialize server handshaker factory.");
+ return nullptr;
+ }
+ return c;
+}
+
+grpc_security_status TlsServerSecurityConnector::ReplaceHandshakerFactory() {
+ const TlsServerCredentials* creds =
+ static_cast<const TlsServerCredentials*>(server_creds());
+ /* Free the server handshaker factory if exists. */
+ if (server_handshaker_factory_) {
+ tsi_ssl_server_handshaker_factory_unref(server_handshaker_factory_);
+ }
+ GPR_ASSERT(!key_materials_config_->pem_key_cert_pair_list().empty());
+ tsi_ssl_pem_key_cert_pair* pem_key_cert_pairs = ConvertToTsiPemKeyCertPair(
+ key_materials_config_->pem_key_cert_pair_list());
+ size_t num_key_cert_pairs =
+ key_materials_config_->pem_key_cert_pair_list().size();
+ grpc_security_status status = grpc_ssl_tsi_server_handshaker_factory_init(
+ pem_key_cert_pairs, num_key_cert_pairs,
+ key_materials_config_->pem_root_certs(),
+ creds->options().cert_request_type(),
+ grpc_get_tsi_tls_version(creds->options().min_tls_version()),
+ grpc_get_tsi_tls_version(creds->options().max_tls_version()),
+ &server_handshaker_factory_);
+ /* Free memory. */
+ grpc_tsi_ssl_pem_key_cert_pairs_destroy(pem_key_cert_pairs,
+ num_key_cert_pairs);
+ return status;
+}
+
+grpc_security_status TlsServerSecurityConnector::InitializeHandshakerFactory() {
+ grpc_core::MutexLock lock(&mu_);
+ const TlsServerCredentials* creds =
+ static_cast<const TlsServerCredentials*>(server_creds());
+ grpc_tls_key_materials_config* key_materials_config =
+ creds->options().key_materials_config();
+ if (key_materials_config != nullptr) {
+ key_materials_config_->set_key_materials(
+ key_materials_config->pem_root_certs(),
+ key_materials_config->pem_key_cert_pair_list());
+ }
+ grpc_ssl_certificate_config_reload_status reload_status =
+ GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_UNCHANGED;
+ /** If |creds->options()| has a credential reload config, then the call to
+ * |TlsFetchKeyMaterials| will use it to update the root cert and
+ * pem-key-cert-pair list stored in |key_materials_config_|. Otherwise, it
+ * will return |GRPC_STATUS_OK| if |key_materials_config_| already has
+ * credentials, and an error code if not. **/
+ if (TlsFetchKeyMaterials(key_materials_config_, creds->options(), true,
+ &reload_status) != GRPC_STATUS_OK) {
+ /* Raise an error if key materials are not populated. */
+ return GRPC_SECURITY_ERROR;
+ }
+ return ReplaceHandshakerFactory();
+}
+
+grpc_security_status TlsServerSecurityConnector::RefreshHandshakerFactory() {
+ grpc_core::MutexLock lock(&mu_);
+ const TlsServerCredentials* creds =
+ static_cast<const TlsServerCredentials*>(server_creds());
+ grpc_ssl_certificate_config_reload_status reload_status =
+ GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_UNCHANGED;
+ /** If |creds->options()| has a credential reload config, then the call to
+ * |TlsFetchKeyMaterials| will use it to update the root cert and
+ * pem-key-cert-pair list stored in |key_materials_config_|. Otherwise, it
+ * will return |GRPC_STATUS_OK| if |key_materials_config_| already has
+ * credentials, and an error code if not. **/
+ if (TlsFetchKeyMaterials(key_materials_config_, creds->options(), true,
+ &reload_status) != GRPC_STATUS_OK) {
+ return GRPC_SECURITY_ERROR;
+ }
+ if (reload_status != GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_NEW) {
+ /* At this point, we should have key materials populated. */
+ return GRPC_SECURITY_OK;
+ } else {
+ return ReplaceHandshakerFactory();
+ }
+}
+
+} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/lib/security/security_connector/tls/tls_security_connector.h b/contrib/libs/grpc/src/core/lib/security/security_connector/tls/tls_security_connector.h
index c7b438c84e3..f50d916589f 100644
--- a/contrib/libs/grpc/src/core/lib/security/security_connector/tls/tls_security_connector.h
+++ b/contrib/libs/grpc/src/core/lib/security/security_connector/tls/tls_security_connector.h
@@ -1,183 +1,183 @@
-/*
- *
- * Copyright 2018 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#ifndef GRPC_CORE_LIB_SECURITY_SECURITY_CONNECTOR_TLS_TLS_SECURITY_CONNECTOR_H
-#define GRPC_CORE_LIB_SECURITY_SECURITY_CONNECTOR_TLS_TLS_SECURITY_CONNECTOR_H
-
-#include <grpc/support/port_platform.h>
-
-#include "src/core/lib/gprpp/sync.h"
-#include "src/core/lib/security/context/security_context.h"
-#include "src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h"
-
-#define GRPC_TLS_TRANSPORT_SECURITY_TYPE "tls"
-
-namespace grpc_core {
-
-// TLS channel security connector.
-class TlsChannelSecurityConnector final
- : public grpc_channel_security_connector {
- public:
- // static factory method to create a TLS channel security connector.
- static grpc_core::RefCountedPtr<grpc_channel_security_connector>
- CreateTlsChannelSecurityConnector(
- grpc_core::RefCountedPtr<grpc_channel_credentials> channel_creds,
- grpc_core::RefCountedPtr<grpc_call_credentials> request_metadata_creds,
- const char* target_name, const char* overridden_target_name,
- tsi_ssl_session_cache* ssl_session_cache);
-
- TlsChannelSecurityConnector(
- grpc_core::RefCountedPtr<grpc_channel_credentials> channel_creds,
- grpc_core::RefCountedPtr<grpc_call_credentials> request_metadata_creds,
- const char* target_name, const char* overridden_target_name);
- ~TlsChannelSecurityConnector() override;
-
- void add_handshakers(const grpc_channel_args* args,
- grpc_pollset_set* interested_parties,
- grpc_core::HandshakeManager* handshake_mgr) override;
-
- void check_peer(tsi_peer peer, grpc_endpoint* ep,
- grpc_core::RefCountedPtr<grpc_auth_context>* auth_context,
- grpc_closure* on_peer_checked) override;
-
- int cmp(const grpc_security_connector* other_sc) const override;
-
- bool check_call_host(y_absl::string_view host, grpc_auth_context* auth_context,
- grpc_closure* on_call_host_checked,
- grpc_error** error) override;
-
- void cancel_check_call_host(grpc_closure* on_call_host_checked,
- grpc_error* error) override;
-
- private:
- // Initialize SSL TSI client handshaker factory.
- grpc_security_status InitializeHandshakerFactory(
- tsi_ssl_session_cache* ssl_session_cache);
-
- // A util function to create a new client handshaker factory to replace
- // the existing one if exists.
- grpc_security_status ReplaceHandshakerFactory(
- tsi_ssl_session_cache* ssl_session_cache);
-
- // gRPC-provided callback executed by application, which servers to bring the
- // control back to gRPC core.
- static void ServerAuthorizationCheckDone(
- grpc_tls_server_authorization_check_arg* arg);
-
- // A util function to process server authorization check result.
- static grpc_error* ProcessServerAuthorizationCheckResult(
- grpc_tls_server_authorization_check_arg* arg);
-
- // A util function to create a server authorization check arg instance.
- static grpc_tls_server_authorization_check_arg*
- ServerAuthorizationCheckArgCreate(void* user_data);
-
- // A util function to destroy a server authorization check arg instance.
- static void ServerAuthorizationCheckArgDestroy(
- grpc_tls_server_authorization_check_arg* arg);
-
- // A util function to refresh SSL TSI client handshaker factory with a valid
- // credential.
- grpc_security_status RefreshHandshakerFactory();
-
- grpc_core::Mutex mu_;
- grpc_closure* on_peer_checked_;
- TString target_name_;
- TString overridden_target_name_;
- tsi_ssl_client_handshaker_factory* client_handshaker_factory_ = nullptr;
- grpc_tls_server_authorization_check_arg* check_arg_;
- grpc_core::RefCountedPtr<grpc_tls_key_materials_config> key_materials_config_;
-};
-
-// TLS server security connector.
-class TlsServerSecurityConnector final : public grpc_server_security_connector {
- public:
- // static factory method to create a TLS server security connector.
- static grpc_core::RefCountedPtr<grpc_server_security_connector>
- CreateTlsServerSecurityConnector(
- grpc_core::RefCountedPtr<grpc_server_credentials> server_creds);
-
- explicit TlsServerSecurityConnector(
- grpc_core::RefCountedPtr<grpc_server_credentials> server_creds);
- ~TlsServerSecurityConnector() override;
-
- void add_handshakers(const grpc_channel_args* args,
- grpc_pollset_set* interested_parties,
- grpc_core::HandshakeManager* handshake_mgr) override;
-
- void check_peer(tsi_peer peer, grpc_endpoint* ep,
- grpc_core::RefCountedPtr<grpc_auth_context>* auth_context,
- grpc_closure* on_peer_checked) override;
-
- int cmp(const grpc_security_connector* other) const override;
-
- private:
- // Initialize SSL TSI server handshaker factory.
- grpc_security_status InitializeHandshakerFactory();
-
- // A util function to create a new server handshaker factory to replace the
- // existing once if exists.
- grpc_security_status ReplaceHandshakerFactory();
-
- // A util function to refresh SSL TSI server handshaker factory with a valid
- // credential.
- grpc_security_status RefreshHandshakerFactory();
-
- grpc_core::Mutex mu_;
- tsi_ssl_server_handshaker_factory* server_handshaker_factory_ = nullptr;
- grpc_core::RefCountedPtr<grpc_tls_key_materials_config> key_materials_config_;
-};
-
-// ---- Functions below are exposed for testing only -----------------------
-
-/** The |TlsFetchKeyMaterials| API ensures that |key_materials_config| has a
- * non-empty pem-key-cert pair list. This is done as follows:
- * - if |options| is equipped with a credential reload config, then this
- * methods uses credential reloading to populate |key_materials_config|, and
- * afterwards it populates |reload_status| with the status of this operation.
- * In particular, any data stored in |key_materials_config| is overwritten.
- * - if |options| has no credential reload config, then:
- * - if |key_materials_config| already has a non-empty pem-key-cert pair
- * list or is called by a client, then the method returns |GRPC_STATUS_OK|.
- * - if |key_materials_config| has an empty pem-key-cert pair list and is
- * called by a server, then the method return an error code.
- *
- * The arguments are detailed below:
- * - key_materials_config: a key materials config that will be populated by the
- * method on success; the caller should not pass in nullptr. Any data held by
- * the config will be overwritten.
- * - options: the TLS credentials options whose credential reloading config
- * will be used to populate |key_materials_config|.
- * - is_server: true denotes that this method is called by a server, and
- * false denotes that this method is called by a client.
- * - status: the status of the credential reloading after the method
- * returns; the caller should not pass in nullptr. **/
-grpc_status_code TlsFetchKeyMaterials(
- const grpc_core::RefCountedPtr<grpc_tls_key_materials_config>&
- key_materials_config,
- const grpc_tls_credentials_options& options, bool is_server,
- grpc_ssl_certificate_config_reload_status* status);
-
-// TlsCheckHostName checks if |peer_name| matches the identity information
-// contained in |peer|. This is AKA hostname check.
-grpc_error* TlsCheckHostName(const char* peer_name, const tsi_peer* peer);
-
-} // namespace grpc_core
-
-#endif /* GRPC_CORE_LIB_SECURITY_SECURITY_CONNECTOR_TLS_TLS_SECURITY_CONNECTOR_H \
- */
+/*
+ *
+ * Copyright 2018 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef GRPC_CORE_LIB_SECURITY_SECURITY_CONNECTOR_TLS_TLS_SECURITY_CONNECTOR_H
+#define GRPC_CORE_LIB_SECURITY_SECURITY_CONNECTOR_TLS_TLS_SECURITY_CONNECTOR_H
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/lib/gprpp/sync.h"
+#include "src/core/lib/security/context/security_context.h"
+#include "src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h"
+
+#define GRPC_TLS_TRANSPORT_SECURITY_TYPE "tls"
+
+namespace grpc_core {
+
+// TLS channel security connector.
+class TlsChannelSecurityConnector final
+ : public grpc_channel_security_connector {
+ public:
+ // static factory method to create a TLS channel security connector.
+ static grpc_core::RefCountedPtr<grpc_channel_security_connector>
+ CreateTlsChannelSecurityConnector(
+ grpc_core::RefCountedPtr<grpc_channel_credentials> channel_creds,
+ grpc_core::RefCountedPtr<grpc_call_credentials> request_metadata_creds,
+ const char* target_name, const char* overridden_target_name,
+ tsi_ssl_session_cache* ssl_session_cache);
+
+ TlsChannelSecurityConnector(
+ grpc_core::RefCountedPtr<grpc_channel_credentials> channel_creds,
+ grpc_core::RefCountedPtr<grpc_call_credentials> request_metadata_creds,
+ const char* target_name, const char* overridden_target_name);
+ ~TlsChannelSecurityConnector() override;
+
+ void add_handshakers(const grpc_channel_args* args,
+ grpc_pollset_set* interested_parties,
+ grpc_core::HandshakeManager* handshake_mgr) override;
+
+ void check_peer(tsi_peer peer, grpc_endpoint* ep,
+ grpc_core::RefCountedPtr<grpc_auth_context>* auth_context,
+ grpc_closure* on_peer_checked) override;
+
+ int cmp(const grpc_security_connector* other_sc) const override;
+
+ bool check_call_host(y_absl::string_view host, grpc_auth_context* auth_context,
+ grpc_closure* on_call_host_checked,
+ grpc_error** error) override;
+
+ void cancel_check_call_host(grpc_closure* on_call_host_checked,
+ grpc_error* error) override;
+
+ private:
+ // Initialize SSL TSI client handshaker factory.
+ grpc_security_status InitializeHandshakerFactory(
+ tsi_ssl_session_cache* ssl_session_cache);
+
+ // A util function to create a new client handshaker factory to replace
+ // the existing one if exists.
+ grpc_security_status ReplaceHandshakerFactory(
+ tsi_ssl_session_cache* ssl_session_cache);
+
+ // gRPC-provided callback executed by application, which servers to bring the
+ // control back to gRPC core.
+ static void ServerAuthorizationCheckDone(
+ grpc_tls_server_authorization_check_arg* arg);
+
+ // A util function to process server authorization check result.
+ static grpc_error* ProcessServerAuthorizationCheckResult(
+ grpc_tls_server_authorization_check_arg* arg);
+
+ // A util function to create a server authorization check arg instance.
+ static grpc_tls_server_authorization_check_arg*
+ ServerAuthorizationCheckArgCreate(void* user_data);
+
+ // A util function to destroy a server authorization check arg instance.
+ static void ServerAuthorizationCheckArgDestroy(
+ grpc_tls_server_authorization_check_arg* arg);
+
+ // A util function to refresh SSL TSI client handshaker factory with a valid
+ // credential.
+ grpc_security_status RefreshHandshakerFactory();
+
+ grpc_core::Mutex mu_;
+ grpc_closure* on_peer_checked_;
+ TString target_name_;
+ TString overridden_target_name_;
+ tsi_ssl_client_handshaker_factory* client_handshaker_factory_ = nullptr;
+ grpc_tls_server_authorization_check_arg* check_arg_;
+ grpc_core::RefCountedPtr<grpc_tls_key_materials_config> key_materials_config_;
+};
+
+// TLS server security connector.
+class TlsServerSecurityConnector final : public grpc_server_security_connector {
+ public:
+ // static factory method to create a TLS server security connector.
+ static grpc_core::RefCountedPtr<grpc_server_security_connector>
+ CreateTlsServerSecurityConnector(
+ grpc_core::RefCountedPtr<grpc_server_credentials> server_creds);
+
+ explicit TlsServerSecurityConnector(
+ grpc_core::RefCountedPtr<grpc_server_credentials> server_creds);
+ ~TlsServerSecurityConnector() override;
+
+ void add_handshakers(const grpc_channel_args* args,
+ grpc_pollset_set* interested_parties,
+ grpc_core::HandshakeManager* handshake_mgr) override;
+
+ void check_peer(tsi_peer peer, grpc_endpoint* ep,
+ grpc_core::RefCountedPtr<grpc_auth_context>* auth_context,
+ grpc_closure* on_peer_checked) override;
+
+ int cmp(const grpc_security_connector* other) const override;
+
+ private:
+ // Initialize SSL TSI server handshaker factory.
+ grpc_security_status InitializeHandshakerFactory();
+
+ // A util function to create a new server handshaker factory to replace the
+ // existing once if exists.
+ grpc_security_status ReplaceHandshakerFactory();
+
+ // A util function to refresh SSL TSI server handshaker factory with a valid
+ // credential.
+ grpc_security_status RefreshHandshakerFactory();
+
+ grpc_core::Mutex mu_;
+ tsi_ssl_server_handshaker_factory* server_handshaker_factory_ = nullptr;
+ grpc_core::RefCountedPtr<grpc_tls_key_materials_config> key_materials_config_;
+};
+
+// ---- Functions below are exposed for testing only -----------------------
+
+/** The |TlsFetchKeyMaterials| API ensures that |key_materials_config| has a
+ * non-empty pem-key-cert pair list. This is done as follows:
+ * - if |options| is equipped with a credential reload config, then this
+ * methods uses credential reloading to populate |key_materials_config|, and
+ * afterwards it populates |reload_status| with the status of this operation.
+ * In particular, any data stored in |key_materials_config| is overwritten.
+ * - if |options| has no credential reload config, then:
+ * - if |key_materials_config| already has a non-empty pem-key-cert pair
+ * list or is called by a client, then the method returns |GRPC_STATUS_OK|.
+ * - if |key_materials_config| has an empty pem-key-cert pair list and is
+ * called by a server, then the method return an error code.
+ *
+ * The arguments are detailed below:
+ * - key_materials_config: a key materials config that will be populated by the
+ * method on success; the caller should not pass in nullptr. Any data held by
+ * the config will be overwritten.
+ * - options: the TLS credentials options whose credential reloading config
+ * will be used to populate |key_materials_config|.
+ * - is_server: true denotes that this method is called by a server, and
+ * false denotes that this method is called by a client.
+ * - status: the status of the credential reloading after the method
+ * returns; the caller should not pass in nullptr. **/
+grpc_status_code TlsFetchKeyMaterials(
+ const grpc_core::RefCountedPtr<grpc_tls_key_materials_config>&
+ key_materials_config,
+ const grpc_tls_credentials_options& options, bool is_server,
+ grpc_ssl_certificate_config_reload_status* status);
+
+// TlsCheckHostName checks if |peer_name| matches the identity information
+// contained in |peer|. This is AKA hostname check.
+grpc_error* TlsCheckHostName(const char* peer_name, const tsi_peer* peer);
+
+} // namespace grpc_core
+
+#endif /* GRPC_CORE_LIB_SECURITY_SECURITY_CONNECTOR_TLS_TLS_SECURITY_CONNECTOR_H \
+ */
diff --git a/contrib/libs/grpc/src/core/lib/security/transport/client_auth_filter.cc b/contrib/libs/grpc/src/core/lib/security/transport/client_auth_filter.cc
index bf059cb2035..b1a9d3f9386 100644
--- a/contrib/libs/grpc/src/core/lib/security/transport/client_auth_filter.cc
+++ b/contrib/libs/grpc/src/core/lib/security/transport/client_auth_filter.cc
@@ -22,10 +22,10 @@
#include <string.h>
-#include <util/generic/string.h>
-
-#include "y_absl/strings/str_cat.h"
-
+#include <util/generic/string.h>
+
+#include "y_absl/strings/str_cat.h"
+
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
@@ -270,39 +270,39 @@ static void send_security_metadata(grpc_call_element* elem,
call_creds_has_md ? ctx->creds->Ref() : channel_call_creds->Ref();
}
- /* Check security level of call credential and channel, and do not send
- * metadata if the check fails. */
- grpc_auth_property_iterator it = grpc_auth_context_find_properties_by_name(
- chand->auth_context.get(), GRPC_TRANSPORT_SECURITY_LEVEL_PROPERTY_NAME);
- const grpc_auth_property* prop = grpc_auth_property_iterator_next(&it);
- if (prop == nullptr) {
- grpc_transport_stream_op_batch_finish_with_failure(
- batch,
- grpc_error_set_int(
- GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "Established channel does not have an auth property "
- "representing a security level."),
- GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAUTHENTICATED),
- calld->call_combiner);
- return;
- }
- grpc_security_level call_cred_security_level =
- calld->creds->min_security_level();
- int is_security_level_ok = grpc_check_security_level(
- grpc_tsi_security_level_string_to_enum(prop->value),
- call_cred_security_level);
- if (!is_security_level_ok) {
- grpc_transport_stream_op_batch_finish_with_failure(
- batch,
- grpc_error_set_int(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "Established channel does not have a sufficient "
- "security level to transfer call credential."),
- GRPC_ERROR_INT_GRPC_STATUS,
- GRPC_STATUS_UNAUTHENTICATED),
- calld->call_combiner);
- return;
- }
-
+ /* Check security level of call credential and channel, and do not send
+ * metadata if the check fails. */
+ grpc_auth_property_iterator it = grpc_auth_context_find_properties_by_name(
+ chand->auth_context.get(), GRPC_TRANSPORT_SECURITY_LEVEL_PROPERTY_NAME);
+ const grpc_auth_property* prop = grpc_auth_property_iterator_next(&it);
+ if (prop == nullptr) {
+ grpc_transport_stream_op_batch_finish_with_failure(
+ batch,
+ grpc_error_set_int(
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Established channel does not have an auth property "
+ "representing a security level."),
+ GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAUTHENTICATED),
+ calld->call_combiner);
+ return;
+ }
+ grpc_security_level call_cred_security_level =
+ calld->creds->min_security_level();
+ int is_security_level_ok = grpc_check_security_level(
+ grpc_tsi_security_level_string_to_enum(prop->value),
+ call_cred_security_level);
+ if (!is_security_level_ok) {
+ grpc_transport_stream_op_batch_finish_with_failure(
+ batch,
+ grpc_error_set_int(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Established channel does not have a sufficient "
+ "security level to transfer call credential."),
+ GRPC_ERROR_INT_GRPC_STATUS,
+ GRPC_STATUS_UNAUTHENTICATED),
+ calld->call_combiner);
+ return;
+ }
+
grpc_auth_metadata_context_build(
chand->security_connector->url_scheme(), calld->host, calld->method,
chand->auth_context.get(), &calld->auth_md_context);
@@ -335,14 +335,14 @@ static void on_host_checked(void* arg, grpc_error* error) {
if (error == GRPC_ERROR_NONE) {
send_security_metadata(elem, batch);
} else {
- TString error_msg = y_absl::StrCat(
- "Invalid host ", grpc_core::StringViewFromSlice(calld->host),
- " set in :authority metadata.");
+ TString error_msg = y_absl::StrCat(
+ "Invalid host ", grpc_core::StringViewFromSlice(calld->host),
+ " set in :authority metadata.");
grpc_transport_stream_op_batch_finish_with_failure(
batch,
- grpc_error_set_int(
- GRPC_ERROR_CREATE_FROM_COPIED_STRING(error_msg.c_str()),
- GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAUTHENTICATED),
+ grpc_error_set_int(
+ GRPC_ERROR_CREATE_FROM_COPIED_STRING(error_msg.c_str()),
+ GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAUTHENTICATED),
calld->call_combiner);
}
GRPC_CALL_STACK_UNREF(calld->owning_call, "check_call_host");
@@ -380,7 +380,7 @@ static void client_auth_start_transport_stream_op_batch(
GRPC_CALL_STACK_REF(calld->owning_call, "check_call_host");
GRPC_CLOSURE_INIT(&calld->async_result_closure, on_host_checked, batch,
grpc_schedule_on_exec_ctx);
- y_absl::string_view call_host(grpc_core::StringViewFromSlice(calld->host));
+ y_absl::string_view call_host(grpc_core::StringViewFromSlice(calld->host));
grpc_error* error = GRPC_ERROR_NONE;
if (chand->security_connector->check_call_host(
call_host, chand->auth_context.get(),
diff --git a/contrib/libs/grpc/src/core/lib/security/transport/secure_endpoint.cc b/contrib/libs/grpc/src/core/lib/security/transport/secure_endpoint.cc
index 2a192185ce4..e79184fac13 100644
--- a/contrib/libs/grpc/src/core/lib/security/transport/secure_endpoint.cc
+++ b/contrib/libs/grpc/src/core/lib/security/transport/secure_endpoint.cc
@@ -401,16 +401,16 @@ static void endpoint_delete_from_pollset_set(grpc_endpoint* secure_ep,
grpc_endpoint_delete_from_pollset_set(ep->wrapped_ep, pollset_set);
}
-static y_absl::string_view endpoint_get_peer(grpc_endpoint* secure_ep) {
+static y_absl::string_view endpoint_get_peer(grpc_endpoint* secure_ep) {
secure_endpoint* ep = reinterpret_cast<secure_endpoint*>(secure_ep);
return grpc_endpoint_get_peer(ep->wrapped_ep);
}
-static y_absl::string_view endpoint_get_local_address(grpc_endpoint* secure_ep) {
- secure_endpoint* ep = reinterpret_cast<secure_endpoint*>(secure_ep);
- return grpc_endpoint_get_local_address(ep->wrapped_ep);
-}
-
+static y_absl::string_view endpoint_get_local_address(grpc_endpoint* secure_ep) {
+ secure_endpoint* ep = reinterpret_cast<secure_endpoint*>(secure_ep);
+ return grpc_endpoint_get_local_address(ep->wrapped_ep);
+}
+
static int endpoint_get_fd(grpc_endpoint* secure_ep) {
secure_endpoint* ep = reinterpret_cast<secure_endpoint*>(secure_ep);
return grpc_endpoint_get_fd(ep->wrapped_ep);
@@ -436,7 +436,7 @@ static const grpc_endpoint_vtable vtable = {endpoint_read,
endpoint_destroy,
endpoint_get_resource_user,
endpoint_get_peer,
- endpoint_get_local_address,
+ endpoint_get_local_address,
endpoint_get_fd,
endpoint_can_track_err};
diff --git a/contrib/libs/grpc/src/core/lib/security/transport/security_handshaker.cc b/contrib/libs/grpc/src/core/lib/security/transport/security_handshaker.cc
index 9b3a3202522..079b49c95a6 100644
--- a/contrib/libs/grpc/src/core/lib/security/transport/security_handshaker.cc
+++ b/contrib/libs/grpc/src/core/lib/security/transport/security_handshaker.cc
@@ -559,10 +559,10 @@ RefCountedPtr<Handshaker> SecurityHandshakerCreate(
void SecurityRegisterHandshakerFactories() {
HandshakerRegistry::RegisterHandshakerFactory(
false /* at_start */, HANDSHAKER_CLIENT,
- y_absl::make_unique<ClientSecurityHandshakerFactory>());
+ y_absl::make_unique<ClientSecurityHandshakerFactory>());
HandshakerRegistry::RegisterHandshakerFactory(
false /* at_start */, HANDSHAKER_SERVER,
- y_absl::make_unique<ServerSecurityHandshakerFactory>());
+ y_absl::make_unique<ServerSecurityHandshakerFactory>());
}
} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/lib/security/util/json_util.cc b/contrib/libs/grpc/src/core/lib/security/util/json_util.cc
index b4427b67695..70ed064841a 100644
--- a/contrib/libs/grpc/src/core/lib/security/util/json_util.cc
+++ b/contrib/libs/grpc/src/core/lib/security/util/json_util.cc
@@ -20,46 +20,46 @@
#include <string.h>
-#include "y_absl/strings/str_cat.h"
-
+#include "y_absl/strings/str_cat.h"
+
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
-#include "src/core/lib/iomgr/error.h"
-#include "src/core/lib/security/util/json_util.h"
-
-const char* grpc_json_get_string_property(const grpc_core::Json& json,
+#include "src/core/lib/iomgr/error.h"
+#include "src/core/lib/security/util/json_util.h"
+
+const char* grpc_json_get_string_property(const grpc_core::Json& json,
const char* prop_name,
grpc_error** error) {
- if (json.type() != grpc_core::Json::Type::OBJECT) {
- if (error != nullptr) {
- *error =
- GRPC_ERROR_CREATE_FROM_STATIC_STRING("JSON value is not an object");
+ if (json.type() != grpc_core::Json::Type::OBJECT) {
+ if (error != nullptr) {
+ *error =
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("JSON value is not an object");
+ }
+ return nullptr;
+ }
+ auto it = json.object_value().find(prop_name);
+ if (it == json.object_value().end()) {
+ if (error != nullptr) {
+ *error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrCat("Property ", prop_name, " not found in JSON object.")
+ .c_str());
}
- return nullptr;
+ return nullptr;
}
- auto it = json.object_value().find(prop_name);
- if (it == json.object_value().end()) {
+ if (it->second.type() != grpc_core::Json::Type::STRING) {
if (error != nullptr) {
- *error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("Property ", prop_name, " not found in JSON object.")
- .c_str());
+ *error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrCat("Property ", prop_name,
+ " n JSON object is not a string.")
+ .c_str());
}
return nullptr;
}
- if (it->second.type() != grpc_core::Json::Type::STRING) {
- if (error != nullptr) {
- *error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("Property ", prop_name,
- " n JSON object is not a string.")
- .c_str());
- }
- return nullptr;
- }
- return it->second.string_value().c_str();
+ return it->second.string_value().c_str();
}
-bool grpc_copy_json_string_property(const grpc_core::Json& json,
+bool grpc_copy_json_string_property(const grpc_core::Json& json,
const char* prop_name,
char** copied_value) {
grpc_error* error = GRPC_ERROR_NONE;
diff --git a/contrib/libs/grpc/src/core/lib/security/util/json_util.h b/contrib/libs/grpc/src/core/lib/security/util/json_util.h
index 95129b12bde..42f7005e00e 100644
--- a/contrib/libs/grpc/src/core/lib/security/util/json_util.h
+++ b/contrib/libs/grpc/src/core/lib/security/util/json_util.h
@@ -32,13 +32,13 @@
#define GRPC_AUTH_JSON_TYPE_AUTHORIZED_USER "authorized_user"
// Gets a child property from a json node.
-const char* grpc_json_get_string_property(const grpc_core::Json& json,
+const char* grpc_json_get_string_property(const grpc_core::Json& json,
const char* prop_name,
grpc_error** error);
// Copies the value of the json child property specified by prop_name.
// Returns false if the property was not found.
-bool grpc_copy_json_string_property(const grpc_core::Json& json,
+bool grpc_copy_json_string_property(const grpc_core::Json& json,
const char* prop_name, char** copied_value);
#endif /* GRPC_CORE_LIB_SECURITY_UTIL_JSON_UTIL_H */
diff --git a/contrib/libs/grpc/src/core/lib/slice/slice.cc b/contrib/libs/grpc/src/core/lib/slice/slice.cc
index 2fbe1f86733..838cf4ba498 100644
--- a/contrib/libs/grpc/src/core/lib/slice/slice.cc
+++ b/contrib/libs/grpc/src/core/lib/slice/slice.cc
@@ -156,7 +156,7 @@ class NewWithLenSliceRefcount {
/** grpc_slice_from_moved_(string|buffer) ref count .*/
class MovedStringSliceRefCount {
public:
- explicit MovedStringSliceRefCount(grpc_core::UniquePtr<char>&& str)
+ explicit MovedStringSliceRefCount(grpc_core::UniquePtr<char>&& str)
: base_(grpc_slice_refcount::Type::REGULAR, &refs_, Destroy, this,
&base_),
str_(std::move(str)) {}
@@ -173,26 +173,26 @@ class MovedStringSliceRefCount {
grpc_core::UniquePtr<char> str_;
};
-// grpc_slice_from_cpp_string() ref count.
-class MovedCppStringSliceRefCount {
- public:
- explicit MovedCppStringSliceRefCount(TString&& str)
- : base_(grpc_slice_refcount::Type::REGULAR, &refs_, Destroy, this,
- &base_),
- str_(std::move(str)) {}
-
- grpc_slice_refcount* base_refcount() { return &base_; }
-
- private:
- static void Destroy(void* arg) {
- delete static_cast<MovedCppStringSliceRefCount*>(arg);
- }
-
- grpc_slice_refcount base_;
- grpc_core::RefCount refs_;
- TString str_;
-};
-
+// grpc_slice_from_cpp_string() ref count.
+class MovedCppStringSliceRefCount {
+ public:
+ explicit MovedCppStringSliceRefCount(TString&& str)
+ : base_(grpc_slice_refcount::Type::REGULAR, &refs_, Destroy, this,
+ &base_),
+ str_(std::move(str)) {}
+
+ grpc_slice_refcount* base_refcount() { return &base_; }
+
+ private:
+ static void Destroy(void* arg) {
+ delete static_cast<MovedCppStringSliceRefCount*>(arg);
+ }
+
+ grpc_slice_refcount base_;
+ grpc_core::RefCount refs_;
+ TString str_;
+};
+
} // namespace grpc_core
grpc_slice grpc_slice_new_with_len(void* p, size_t len,
@@ -252,23 +252,23 @@ grpc_slice grpc_slice_from_moved_string(grpc_core::UniquePtr<char> p) {
return grpc_slice_from_moved_buffer(std::move(p), len);
}
-grpc_slice grpc_slice_from_cpp_string(TString str) {
- grpc_slice slice;
- if (str.size() <= sizeof(slice.data.inlined.bytes)) {
- slice.refcount = nullptr;
- slice.data.inlined.length = str.size();
- memcpy(GRPC_SLICE_START_PTR(slice), str.data(), str.size());
- } else {
- slice.data.refcounted.bytes =
- reinterpret_cast<uint8_t*>(const_cast<char*>(str.data()));
- slice.data.refcounted.length = str.size();
- slice.refcount =
- (new grpc_core::MovedCppStringSliceRefCount(std::move(str)))
- ->base_refcount();
- }
- return slice;
-}
-
+grpc_slice grpc_slice_from_cpp_string(TString str) {
+ grpc_slice slice;
+ if (str.size() <= sizeof(slice.data.inlined.bytes)) {
+ slice.refcount = nullptr;
+ slice.data.inlined.length = str.size();
+ memcpy(GRPC_SLICE_START_PTR(slice), str.data(), str.size());
+ } else {
+ slice.data.refcounted.bytes =
+ reinterpret_cast<uint8_t*>(const_cast<char*>(str.data()));
+ slice.data.refcounted.length = str.size();
+ slice.refcount =
+ (new grpc_core::MovedCppStringSliceRefCount(std::move(str)))
+ ->base_refcount();
+ }
+ return slice;
+}
+
namespace {
class MallocRefCount {
diff --git a/contrib/libs/grpc/src/core/lib/slice/slice_internal.h b/contrib/libs/grpc/src/core/lib/slice/slice_internal.h
index 9738a712c1f..8a17b6e72ee 100644
--- a/contrib/libs/grpc/src/core/lib/slice/slice_internal.h
+++ b/contrib/libs/grpc/src/core/lib/slice/slice_internal.h
@@ -338,7 +338,7 @@ inline uint32_t grpc_slice_hash_internal(const grpc_slice& s) {
grpc_slice grpc_slice_from_moved_buffer(grpc_core::UniquePtr<char> p,
size_t len);
grpc_slice grpc_slice_from_moved_string(grpc_core::UniquePtr<char> p);
-grpc_slice grpc_slice_from_cpp_string(TString str);
+grpc_slice grpc_slice_from_cpp_string(TString str);
// Returns the memory used by this slice, not counting the slice structure
// itself. This means that inlined and slices from static strings will return
@@ -348,18 +348,18 @@ size_t grpc_slice_memory_usage(grpc_slice s);
grpc_core::UnmanagedMemorySlice grpc_slice_sub_no_ref(
const grpc_core::UnmanagedMemorySlice& source, size_t begin, size_t end);
-namespace grpc_core {
-
-struct SliceHash {
- std::size_t operator()(const grpc_slice& slice) const {
- return grpc_slice_hash_internal(slice);
- }
-};
-
-} // namespace grpc_core
-
-inline bool operator==(const grpc_slice& s1, const grpc_slice& s2) {
- return grpc_slice_eq(s1, s2);
-}
-
+namespace grpc_core {
+
+struct SliceHash {
+ std::size_t operator()(const grpc_slice& slice) const {
+ return grpc_slice_hash_internal(slice);
+ }
+};
+
+} // namespace grpc_core
+
+inline bool operator==(const grpc_slice& s1, const grpc_slice& s2) {
+ return grpc_slice_eq(s1, s2);
+}
+
#endif /* GRPC_CORE_LIB_SLICE_SLICE_INTERNAL_H */
diff --git a/contrib/libs/grpc/src/core/lib/slice/slice_utils.h b/contrib/libs/grpc/src/core/lib/slice/slice_utils.h
index 3636e38ccf6..95cef73a4fb 100644
--- a/contrib/libs/grpc/src/core/lib/slice/slice_utils.h
+++ b/contrib/libs/grpc/src/core/lib/slice/slice_utils.h
@@ -23,8 +23,8 @@
#include <cstring>
-#include "y_absl/strings/string_view.h"
-
+#include "y_absl/strings/string_view.h"
+
#include <grpc/slice.h>
#include "src/core/lib/gpr/murmur_hash.h"
@@ -188,13 +188,13 @@ struct InternedSlice : public ManagedMemorySlice {
explicit InternedSlice(InternedSliceRefcount* s);
};
-// Converts grpc_slice to y_absl::string_view.
-inline y_absl::string_view StringViewFromSlice(const grpc_slice& slice) {
- return y_absl::string_view(
- reinterpret_cast<const char*>(GRPC_SLICE_START_PTR(slice)),
- GRPC_SLICE_LENGTH(slice));
-}
-
+// Converts grpc_slice to y_absl::string_view.
+inline y_absl::string_view StringViewFromSlice(const grpc_slice& slice) {
+ return y_absl::string_view(
+ reinterpret_cast<const char*>(GRPC_SLICE_START_PTR(slice)),
+ GRPC_SLICE_LENGTH(slice));
+}
+
} // namespace grpc_core
#endif /* GRPC_CORE_LIB_SLICE_SLICE_UTILS_H */
diff --git a/contrib/libs/grpc/src/core/lib/surface/byte_buffer_reader.cc b/contrib/libs/grpc/src/core/lib/surface/byte_buffer_reader.cc
index 2f398be47ea..3689c79455e 100644
--- a/contrib/libs/grpc/src/core/lib/surface/byte_buffer_reader.cc
+++ b/contrib/libs/grpc/src/core/lib/surface/byte_buffer_reader.cc
@@ -35,7 +35,7 @@ int grpc_byte_buffer_reader_init(grpc_byte_buffer_reader* reader,
reader->buffer_in = buffer;
switch (reader->buffer_in->type) {
case GRPC_BB_RAW:
- reader->buffer_out = reader->buffer_in;
+ reader->buffer_out = reader->buffer_in;
reader->current.index = 0;
break;
}
@@ -43,7 +43,7 @@ int grpc_byte_buffer_reader_init(grpc_byte_buffer_reader* reader,
}
void grpc_byte_buffer_reader_destroy(grpc_byte_buffer_reader* reader) {
- reader->buffer_out = nullptr;
+ reader->buffer_out = nullptr;
}
int grpc_byte_buffer_reader_peek(grpc_byte_buffer_reader* reader,
diff --git a/contrib/libs/grpc/src/core/lib/surface/call.cc b/contrib/libs/grpc/src/core/lib/surface/call.cc
index a2ef755ddf9..fe4c774c526 100644
--- a/contrib/libs/grpc/src/core/lib/surface/call.cc
+++ b/contrib/libs/grpc/src/core/lib/surface/call.cc
@@ -24,11 +24,11 @@
#include <stdlib.h>
#include <string.h>
-#include <util/generic/string.h>
-
-#include "y_absl/strings/str_cat.h"
-#include "y_absl/strings/str_format.h"
-
+#include <util/generic/string.h>
+
+#include "y_absl/strings/str_cat.h"
+#include "y_absl/strings/str_format.h"
+
#include <grpc/compression.h>
#include <grpc/grpc.h>
#include <grpc/slice.h>
@@ -232,9 +232,9 @@ struct grpc_call {
grpc_closure receiving_initial_metadata_ready;
grpc_closure receiving_trailing_metadata_ready;
uint32_t test_only_last_message_flags = 0;
- // Status about operation of call
- bool sent_server_trailing_metadata = false;
- gpr_atm cancelled_with_error = 0;
+ // Status about operation of call
+ bool sent_server_trailing_metadata = false;
+ gpr_atm cancelled_with_error = 0;
grpc_closure release_call;
@@ -247,7 +247,7 @@ struct grpc_call {
struct {
int* cancelled;
// backpointer to owning server if this is a server side call.
- grpc_core::Server* core_server;
+ grpc_core::Server* core_server;
} server;
} final_op;
gpr_atm status_error = 0;
@@ -376,7 +376,7 @@ grpc_error* grpc_call_create(const grpc_call_create_args* args,
} else {
GRPC_STATS_INC_SERVER_CALLS_CREATED();
call->final_op.server.cancelled = nullptr;
- call->final_op.server.core_server = args->server;
+ call->final_op.server.core_server = args->server;
GPR_ASSERT(args->add_initial_metadata_count == 0);
call->send_extra_metadata_count = 0;
}
@@ -478,11 +478,11 @@ grpc_error* grpc_call_create(const grpc_call_create_args* args,
if (channelz_channel != nullptr) {
channelz_channel->RecordCallStarted();
}
- } else if (call->final_op.server.core_server != nullptr) {
- grpc_core::channelz::ServerNode* channelz_node =
- call->final_op.server.core_server->channelz_node();
- if (channelz_node != nullptr) {
- channelz_node->RecordCallStarted();
+ } else if (call->final_op.server.core_server != nullptr) {
+ grpc_core::channelz::ServerNode* channelz_node =
+ call->final_op.server.core_server->channelz_node();
+ if (channelz_node != nullptr) {
+ channelz_node->RecordCallStarted();
}
}
@@ -695,7 +695,7 @@ static void done_termination(void* arg, grpc_error* /*error*/) {
}
static void cancel_with_error(grpc_call* c, grpc_error* error) {
- if (!gpr_atm_rel_cas(&c->cancelled_with_error, 0, 1)) {
+ if (!gpr_atm_rel_cas(&c->cancelled_with_error, 0, 1)) {
GRPC_ERROR_UNREF(error);
return;
}
@@ -760,16 +760,16 @@ static void set_final_status(grpc_call* call, grpc_error* error) {
}
} else {
*call->final_op.server.cancelled =
- error != GRPC_ERROR_NONE || !call->sent_server_trailing_metadata;
- grpc_core::channelz::ServerNode* channelz_node =
- call->final_op.server.core_server->channelz_node();
- if (channelz_node != nullptr) {
- if (*call->final_op.server.cancelled ||
- reinterpret_cast<grpc_error*>(
- gpr_atm_acq_load(&call->status_error)) != GRPC_ERROR_NONE) {
- channelz_node->RecordCallFailed();
+ error != GRPC_ERROR_NONE || !call->sent_server_trailing_metadata;
+ grpc_core::channelz::ServerNode* channelz_node =
+ call->final_op.server.core_server->channelz_node();
+ if (channelz_node != nullptr) {
+ if (*call->final_op.server.cancelled ||
+ reinterpret_cast<grpc_error*>(
+ gpr_atm_acq_load(&call->status_error)) != GRPC_ERROR_NONE) {
+ channelz_node->RecordCallFailed();
} else {
- channelz_node->RecordCallSucceeded();
+ channelz_node->RecordCallSucceeded();
}
}
GRPC_ERROR_UNREF(error);
@@ -1059,10 +1059,10 @@ static void recv_trailing_filter(void* args, grpc_metadata_batch* b,
grpc_error* error = GRPC_ERROR_NONE;
if (status_code != GRPC_STATUS_OK) {
char* peer = grpc_call_get_peer(call);
- error = grpc_error_set_int(
- GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("Error received from peer ", peer).c_str()),
- GRPC_ERROR_INT_GRPC_STATUS, static_cast<intptr_t>(status_code));
+ error = grpc_error_set_int(
+ GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrCat("Error received from peer ", peer).c_str()),
+ GRPC_ERROR_INT_GRPC_STATUS, static_cast<intptr_t>(status_code));
gpr_free(peer);
}
if (b->idx.named.grpc_message != nullptr) {
@@ -1374,41 +1374,41 @@ static void receiving_stream_ready_in_call_combiner(void* bctlp,
static void GPR_ATTRIBUTE_NOINLINE
handle_both_stream_and_msg_compression_set(grpc_call* call) {
- TString error_msg = y_absl::StrFormat(
- "Incoming stream has both stream compression (%d) and message "
- "compression (%d).",
- call->incoming_stream_compression_algorithm,
- call->incoming_message_compression_algorithm);
- gpr_log(GPR_ERROR, "%s", error_msg.c_str());
- cancel_with_status(call, GRPC_STATUS_INTERNAL, error_msg.c_str());
+ TString error_msg = y_absl::StrFormat(
+ "Incoming stream has both stream compression (%d) and message "
+ "compression (%d).",
+ call->incoming_stream_compression_algorithm,
+ call->incoming_message_compression_algorithm);
+ gpr_log(GPR_ERROR, "%s", error_msg.c_str());
+ cancel_with_status(call, GRPC_STATUS_INTERNAL, error_msg.c_str());
}
static void GPR_ATTRIBUTE_NOINLINE
handle_error_parsing_compression_algorithm(grpc_call* call) {
- TString error_msg = y_absl::StrFormat(
- "Error in incoming message compression (%d) or stream "
- "compression (%d).",
- call->incoming_stream_compression_algorithm,
- call->incoming_message_compression_algorithm);
- cancel_with_status(call, GRPC_STATUS_INTERNAL, error_msg.c_str());
+ TString error_msg = y_absl::StrFormat(
+ "Error in incoming message compression (%d) or stream "
+ "compression (%d).",
+ call->incoming_stream_compression_algorithm,
+ call->incoming_message_compression_algorithm);
+ cancel_with_status(call, GRPC_STATUS_INTERNAL, error_msg.c_str());
}
static void GPR_ATTRIBUTE_NOINLINE handle_invalid_compression(
grpc_call* call, grpc_compression_algorithm compression_algorithm) {
- TString error_msg = y_absl::StrFormat(
- "Invalid compression algorithm value '%d'.", compression_algorithm);
- gpr_log(GPR_ERROR, "%s", error_msg.c_str());
- cancel_with_status(call, GRPC_STATUS_UNIMPLEMENTED, error_msg.c_str());
+ TString error_msg = y_absl::StrFormat(
+ "Invalid compression algorithm value '%d'.", compression_algorithm);
+ gpr_log(GPR_ERROR, "%s", error_msg.c_str());
+ cancel_with_status(call, GRPC_STATUS_UNIMPLEMENTED, error_msg.c_str());
}
static void GPR_ATTRIBUTE_NOINLINE handle_compression_algorithm_disabled(
grpc_call* call, grpc_compression_algorithm compression_algorithm) {
const char* algo_name = nullptr;
grpc_compression_algorithm_name(compression_algorithm, &algo_name);
- TString error_msg =
- y_absl::StrFormat("Compression algorithm '%s' is disabled.", algo_name);
- gpr_log(GPR_ERROR, "%s", error_msg.c_str());
- cancel_with_status(call, GRPC_STATUS_UNIMPLEMENTED, error_msg.c_str());
+ TString error_msg =
+ y_absl::StrFormat("Compression algorithm '%s' is disabled.", algo_name);
+ gpr_log(GPR_ERROR, "%s", error_msg.c_str());
+ cancel_with_status(call, GRPC_STATUS_UNIMPLEMENTED, error_msg.c_str());
}
static void GPR_ATTRIBUTE_NOINLINE handle_compression_algorithm_not_accepted(
@@ -1790,8 +1790,8 @@ static grpc_call_error call_start_batch(grpc_call* call, const grpc_op* ops,
}
stream_op_payload->send_trailing_metadata.send_trailing_metadata =
&call->metadata_batch[0 /* is_receiving */][1 /* is_trailing */];
- stream_op_payload->send_trailing_metadata.sent =
- &call->sent_server_trailing_metadata;
+ stream_op_payload->send_trailing_metadata.sent =
+ &call->sent_server_trailing_metadata;
has_send_ops = true;
break;
}
diff --git a/contrib/libs/grpc/src/core/lib/surface/call.h b/contrib/libs/grpc/src/core/lib/surface/call.h
index b6ebd08e187..34d01db9029 100644
--- a/contrib/libs/grpc/src/core/lib/surface/call.h
+++ b/contrib/libs/grpc/src/core/lib/surface/call.h
@@ -25,7 +25,7 @@
#include "src/core/lib/channel/context.h"
#include "src/core/lib/gprpp/arena.h"
#include "src/core/lib/surface/api_trace.h"
-#include "src/core/lib/surface/server.h"
+#include "src/core/lib/surface/server.h"
#include <grpc/grpc.h>
#include <grpc/impl/codegen/compression_types.h>
@@ -35,7 +35,7 @@ typedef void (*grpc_ioreq_completion_func)(grpc_call* call, int success,
typedef struct grpc_call_create_args {
grpc_channel* channel;
- grpc_core::Server* server;
+ grpc_core::Server* server;
grpc_call* parent;
uint32_t propagation_mask;
diff --git a/contrib/libs/grpc/src/core/lib/surface/call_log_batch.cc b/contrib/libs/grpc/src/core/lib/surface/call_log_batch.cc
index 5371ef4ad7d..c4f78821ab0 100644
--- a/contrib/libs/grpc/src/core/lib/surface/call_log_batch.cc
+++ b/contrib/libs/grpc/src/core/lib/surface/call_log_batch.cc
@@ -22,90 +22,90 @@
#include <inttypes.h>
-#include <vector>
-
-#include "y_absl/strings/str_format.h"
-#include "y_absl/strings/str_join.h"
-
+#include <vector>
+
+#include "y_absl/strings/str_format.h"
+#include "y_absl/strings/str_join.h"
+
#include <grpc/support/alloc.h>
#include <grpc/support/string_util.h>
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/slice/slice_string_helpers.h"
-static void add_metadata(const grpc_metadata* md, size_t count,
- std::vector<TString>* b) {
+static void add_metadata(const grpc_metadata* md, size_t count,
+ std::vector<TString>* b) {
if (md == nullptr) {
- b->push_back("(nil)");
+ b->push_back("(nil)");
return;
}
- for (size_t i = 0; i < count; i++) {
- b->push_back("\nkey=");
- b->push_back(TString(grpc_core::StringViewFromSlice(md[i].key)));
- b->push_back(" value=");
- char* dump = grpc_dump_slice(md[i].value, GPR_DUMP_HEX | GPR_DUMP_ASCII);
- b->push_back(dump);
- gpr_free(dump);
+ for (size_t i = 0; i < count; i++) {
+ b->push_back("\nkey=");
+ b->push_back(TString(grpc_core::StringViewFromSlice(md[i].key)));
+ b->push_back(" value=");
+ char* dump = grpc_dump_slice(md[i].value, GPR_DUMP_HEX | GPR_DUMP_ASCII);
+ b->push_back(dump);
+ gpr_free(dump);
}
}
-static TString grpc_op_string(const grpc_op* op) {
- std::vector<TString> parts;
+static TString grpc_op_string(const grpc_op* op) {
+ std::vector<TString> parts;
switch (op->op) {
case GRPC_OP_SEND_INITIAL_METADATA:
- parts.push_back("SEND_INITIAL_METADATA");
- add_metadata(op->data.send_initial_metadata.metadata,
- op->data.send_initial_metadata.count, &parts);
+ parts.push_back("SEND_INITIAL_METADATA");
+ add_metadata(op->data.send_initial_metadata.metadata,
+ op->data.send_initial_metadata.count, &parts);
break;
case GRPC_OP_SEND_MESSAGE:
- parts.push_back(y_absl::StrFormat("SEND_MESSAGE ptr=%p",
- op->data.send_message.send_message));
+ parts.push_back(y_absl::StrFormat("SEND_MESSAGE ptr=%p",
+ op->data.send_message.send_message));
break;
case GRPC_OP_SEND_CLOSE_FROM_CLIENT:
- parts.push_back("SEND_CLOSE_FROM_CLIENT");
+ parts.push_back("SEND_CLOSE_FROM_CLIENT");
break;
case GRPC_OP_SEND_STATUS_FROM_SERVER:
- parts.push_back(
- y_absl::StrFormat("SEND_STATUS_FROM_SERVER status=%d details=",
- op->data.send_status_from_server.status));
+ parts.push_back(
+ y_absl::StrFormat("SEND_STATUS_FROM_SERVER status=%d details=",
+ op->data.send_status_from_server.status));
if (op->data.send_status_from_server.status_details != nullptr) {
- char* dump = grpc_dump_slice(
- *op->data.send_status_from_server.status_details, GPR_DUMP_ASCII);
- parts.push_back(dump);
- gpr_free(dump);
+ char* dump = grpc_dump_slice(
+ *op->data.send_status_from_server.status_details, GPR_DUMP_ASCII);
+ parts.push_back(dump);
+ gpr_free(dump);
} else {
- parts.push_back("(null)");
+ parts.push_back("(null)");
}
- add_metadata(op->data.send_status_from_server.trailing_metadata,
- op->data.send_status_from_server.trailing_metadata_count,
- &parts);
+ add_metadata(op->data.send_status_from_server.trailing_metadata,
+ op->data.send_status_from_server.trailing_metadata_count,
+ &parts);
break;
case GRPC_OP_RECV_INITIAL_METADATA:
- parts.push_back(y_absl::StrFormat(
- "RECV_INITIAL_METADATA ptr=%p",
- op->data.recv_initial_metadata.recv_initial_metadata));
+ parts.push_back(y_absl::StrFormat(
+ "RECV_INITIAL_METADATA ptr=%p",
+ op->data.recv_initial_metadata.recv_initial_metadata));
break;
case GRPC_OP_RECV_MESSAGE:
- parts.push_back(y_absl::StrFormat("RECV_MESSAGE ptr=%p",
- op->data.recv_message.recv_message));
+ parts.push_back(y_absl::StrFormat("RECV_MESSAGE ptr=%p",
+ op->data.recv_message.recv_message));
break;
case GRPC_OP_RECV_STATUS_ON_CLIENT:
- parts.push_back(y_absl::StrFormat(
- "RECV_STATUS_ON_CLIENT metadata=%p status=%p details=%p",
- op->data.recv_status_on_client.trailing_metadata,
- op->data.recv_status_on_client.status,
- op->data.recv_status_on_client.status_details));
+ parts.push_back(y_absl::StrFormat(
+ "RECV_STATUS_ON_CLIENT metadata=%p status=%p details=%p",
+ op->data.recv_status_on_client.trailing_metadata,
+ op->data.recv_status_on_client.status,
+ op->data.recv_status_on_client.status_details));
break;
case GRPC_OP_RECV_CLOSE_ON_SERVER:
- parts.push_back(y_absl::StrFormat("RECV_CLOSE_ON_SERVER cancelled=%p",
- op->data.recv_close_on_server.cancelled));
+ parts.push_back(y_absl::StrFormat("RECV_CLOSE_ON_SERVER cancelled=%p",
+ op->data.recv_close_on_server.cancelled));
}
- return y_absl::StrJoin(parts, "");
+ return y_absl::StrJoin(parts, "");
}
void grpc_call_log_batch(const char* file, int line, gpr_log_severity severity,
const grpc_op* ops, size_t nops) {
- for (size_t i = 0; i < nops; i++) {
- gpr_log(file, line, severity, "ops[%" PRIuPTR "]: %s", i,
- grpc_op_string(&ops[i]).c_str());
+ for (size_t i = 0; i < nops; i++) {
+ gpr_log(file, line, severity, "ops[%" PRIuPTR "]: %s", i,
+ grpc_op_string(&ops[i]).c_str());
}
}
diff --git a/contrib/libs/grpc/src/core/lib/surface/channel.cc b/contrib/libs/grpc/src/core/lib/surface/channel.cc
index 4d892b3e492..28df8e61ee6 100644
--- a/contrib/libs/grpc/src/core/lib/surface/channel.cc
+++ b/contrib/libs/grpc/src/core/lib/surface/channel.cc
@@ -84,7 +84,7 @@ grpc_channel* grpc_channel_create_with_builder(
channel->target = target;
channel->resource_user = resource_user;
channel->is_client = grpc_channel_stack_type_is_client(channel_stack_type);
- channel->registration_table.Init();
+ channel->registration_table.Init();
gpr_atm_no_barrier_store(
&channel->call_size_estimate,
@@ -183,30 +183,30 @@ void CreateChannelzNode(grpc_channel_stack_builder* builder) {
const grpc_channel_args* args =
grpc_channel_stack_builder_get_channel_arguments(builder);
// Check whether channelz is enabled.
- const bool channelz_enabled = grpc_channel_args_find_bool(
- args, GRPC_ARG_ENABLE_CHANNELZ, GRPC_ENABLE_CHANNELZ_DEFAULT);
+ const bool channelz_enabled = grpc_channel_args_find_bool(
+ args, GRPC_ARG_ENABLE_CHANNELZ, GRPC_ENABLE_CHANNELZ_DEFAULT);
if (!channelz_enabled) return;
// Get parameters needed to create the channelz node.
- const size_t channel_tracer_max_memory = grpc_channel_args_find_integer(
- args, GRPC_ARG_MAX_CHANNEL_TRACE_EVENT_MEMORY_PER_NODE,
+ const size_t channel_tracer_max_memory = grpc_channel_args_find_integer(
+ args, GRPC_ARG_MAX_CHANNEL_TRACE_EVENT_MEMORY_PER_NODE,
{GRPC_MAX_CHANNEL_TRACE_EVENT_MEMORY_PER_NODE_DEFAULT, 0, INT_MAX});
- const bool is_internal_channel = grpc_channel_args_find_bool(
- args, GRPC_ARG_CHANNELZ_IS_INTERNAL_CHANNEL, false);
+ const bool is_internal_channel = grpc_channel_args_find_bool(
+ args, GRPC_ARG_CHANNELZ_IS_INTERNAL_CHANNEL, false);
// Create the channelz node.
const char* target = grpc_channel_stack_builder_get_target(builder);
grpc_core::RefCountedPtr<grpc_core::channelz::ChannelNode> channelz_node =
grpc_core::MakeRefCounted<grpc_core::channelz::ChannelNode>(
target != nullptr ? target : "", channel_tracer_max_memory,
- is_internal_channel);
+ is_internal_channel);
channelz_node->AddTraceEvent(
grpc_core::channelz::ChannelTrace::Severity::Info,
grpc_slice_from_static_string("Channel created"));
// Add channelz node to channel args.
- // We remove the is_internal_channel arg, since we no longer need it.
+ // We remove the is_internal_channel arg, since we no longer need it.
grpc_arg new_arg = grpc_channel_arg_pointer_create(
const_cast<char*>(GRPC_ARG_CHANNELZ_CHANNEL_NODE), channelz_node.get(),
&channelz_node_arg_vtable);
- const char* args_to_remove[] = {GRPC_ARG_CHANNELZ_IS_INTERNAL_CHANNEL};
+ const char* args_to_remove[] = {GRPC_ARG_CHANNELZ_IS_INTERNAL_CHANNEL};
grpc_channel_args* new_args = grpc_channel_args_copy_and_add_and_remove(
args, args_to_remove, GPR_ARRAY_SIZE(args_to_remove), &new_arg, 1);
grpc_channel_stack_builder_set_channel_arguments(builder, new_args);
@@ -317,7 +317,7 @@ char* grpc_channel_get_target(grpc_channel* channel) {
void grpc_channel_get_info(grpc_channel* channel,
const grpc_channel_info* channel_info) {
- grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
+ grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
grpc_core::ExecCtx exec_ctx;
grpc_channel_element* elem =
grpc_channel_stack_element(CHANNEL_STACK_FROM_CHANNEL(channel), 0);
@@ -325,7 +325,7 @@ void grpc_channel_get_info(grpc_channel* channel,
}
void grpc_channel_reset_connect_backoff(grpc_channel* channel) {
- grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
+ grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
grpc_core::ExecCtx exec_ctx;
GRPC_API_TRACE("grpc_channel_reset_connect_backoff(channel=%p)", 1,
(channel));
@@ -376,7 +376,7 @@ grpc_call* grpc_channel_create_call(grpc_channel* channel,
grpc_slice method, const grpc_slice* host,
gpr_timespec deadline, void* reserved) {
GPR_ASSERT(!reserved);
- grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
+ grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
grpc_core::ExecCtx exec_ctx;
grpc_call* call = grpc_channel_create_call_internal(
channel, parent_call, propagation_mask, cq, nullptr,
@@ -401,74 +401,74 @@ grpc_call* grpc_channel_create_pollset_set_call(
deadline);
}
-namespace grpc_core {
-
-RegisteredCall::RegisteredCall(const char* method_arg, const char* host_arg)
- : method(method_arg != nullptr ? method_arg : ""),
- host(host_arg != nullptr ? host_arg : ""),
- path(grpc_mdelem_from_slices(
- GRPC_MDSTR_PATH, grpc_core::ExternallyManagedSlice(method.c_str()))),
- authority(!host.empty()
- ? grpc_mdelem_from_slices(
- GRPC_MDSTR_AUTHORITY,
- grpc_core::ExternallyManagedSlice(host.c_str()))
- : GRPC_MDNULL) {}
-
-// TODO(vjpai): Delete copy-constructor when allowed by all supported compilers.
-RegisteredCall::RegisteredCall(const RegisteredCall& other)
- : RegisteredCall(other.method.c_str(), other.host.c_str()) {}
-
-RegisteredCall::RegisteredCall(RegisteredCall&& other) noexcept
- : method(std::move(other.method)),
- host(std::move(other.host)),
- path(grpc_mdelem_from_slices(
- GRPC_MDSTR_PATH, grpc_core::ExternallyManagedSlice(method.c_str()))),
- authority(!host.empty()
- ? grpc_mdelem_from_slices(
- GRPC_MDSTR_AUTHORITY,
- grpc_core::ExternallyManagedSlice(host.c_str()))
- : GRPC_MDNULL) {
- GRPC_MDELEM_UNREF(other.path);
- GRPC_MDELEM_UNREF(other.authority);
- other.path = GRPC_MDNULL;
- other.authority = GRPC_MDNULL;
-}
-
-RegisteredCall::~RegisteredCall() {
- GRPC_MDELEM_UNREF(path);
- GRPC_MDELEM_UNREF(authority);
-}
-
-} // namespace grpc_core
-
+namespace grpc_core {
+
+RegisteredCall::RegisteredCall(const char* method_arg, const char* host_arg)
+ : method(method_arg != nullptr ? method_arg : ""),
+ host(host_arg != nullptr ? host_arg : ""),
+ path(grpc_mdelem_from_slices(
+ GRPC_MDSTR_PATH, grpc_core::ExternallyManagedSlice(method.c_str()))),
+ authority(!host.empty()
+ ? grpc_mdelem_from_slices(
+ GRPC_MDSTR_AUTHORITY,
+ grpc_core::ExternallyManagedSlice(host.c_str()))
+ : GRPC_MDNULL) {}
+
+// TODO(vjpai): Delete copy-constructor when allowed by all supported compilers.
+RegisteredCall::RegisteredCall(const RegisteredCall& other)
+ : RegisteredCall(other.method.c_str(), other.host.c_str()) {}
+
+RegisteredCall::RegisteredCall(RegisteredCall&& other) noexcept
+ : method(std::move(other.method)),
+ host(std::move(other.host)),
+ path(grpc_mdelem_from_slices(
+ GRPC_MDSTR_PATH, grpc_core::ExternallyManagedSlice(method.c_str()))),
+ authority(!host.empty()
+ ? grpc_mdelem_from_slices(
+ GRPC_MDSTR_AUTHORITY,
+ grpc_core::ExternallyManagedSlice(host.c_str()))
+ : GRPC_MDNULL) {
+ GRPC_MDELEM_UNREF(other.path);
+ GRPC_MDELEM_UNREF(other.authority);
+ other.path = GRPC_MDNULL;
+ other.authority = GRPC_MDNULL;
+}
+
+RegisteredCall::~RegisteredCall() {
+ GRPC_MDELEM_UNREF(path);
+ GRPC_MDELEM_UNREF(authority);
+}
+
+} // namespace grpc_core
+
void* grpc_channel_register_call(grpc_channel* channel, const char* method,
const char* host, void* reserved) {
GRPC_API_TRACE(
"grpc_channel_register_call(channel=%p, method=%s, host=%s, reserved=%p)",
4, (channel, method, host, reserved));
GPR_ASSERT(!reserved);
- grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
+ grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
grpc_core::ExecCtx exec_ctx;
- grpc_core::MutexLock lock(&channel->registration_table->mu);
- channel->registration_table->method_registration_attempts++;
- auto key = std::make_pair(TString(host != nullptr ? host : ""),
- TString(method != nullptr ? method : ""));
- auto rc_posn = channel->registration_table->map.find(key);
- if (rc_posn != channel->registration_table->map.end()) {
- return &rc_posn->second;
- }
- auto insertion_result = channel->registration_table->map.insert(
- {std::move(key), grpc_core::RegisteredCall(method, host)});
- return &insertion_result.first->second;
+ grpc_core::MutexLock lock(&channel->registration_table->mu);
+ channel->registration_table->method_registration_attempts++;
+ auto key = std::make_pair(TString(host != nullptr ? host : ""),
+ TString(method != nullptr ? method : ""));
+ auto rc_posn = channel->registration_table->map.find(key);
+ if (rc_posn != channel->registration_table->map.end()) {
+ return &rc_posn->second;
+ }
+ auto insertion_result = channel->registration_table->map.insert(
+ {std::move(key), grpc_core::RegisteredCall(method, host)});
+ return &insertion_result.first->second;
}
grpc_call* grpc_channel_create_registered_call(
grpc_channel* channel, grpc_call* parent_call, uint32_t propagation_mask,
grpc_completion_queue* completion_queue, void* registered_call_handle,
gpr_timespec deadline, void* reserved) {
- grpc_core::RegisteredCall* rc =
- static_cast<grpc_core::RegisteredCall*>(registered_call_handle);
+ grpc_core::RegisteredCall* rc =
+ static_cast<grpc_core::RegisteredCall*>(registered_call_handle);
GRPC_API_TRACE(
"grpc_channel_create_registered_call("
"channel=%p, parent_call=%p, propagation_mask=%x, completion_queue=%p, "
@@ -481,7 +481,7 @@ grpc_call* grpc_channel_create_registered_call(
registered_call_handle, deadline.tv_sec, deadline.tv_nsec,
(int)deadline.clock_type, reserved));
GPR_ASSERT(!reserved);
- grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
+ grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
grpc_core::ExecCtx exec_ctx;
grpc_call* call = grpc_channel_create_call_internal(
channel, parent_call, propagation_mask, completion_queue, nullptr,
@@ -500,7 +500,7 @@ static void destroy_channel(void* arg, grpc_error* /*error*/) {
channel->channelz_node.reset();
}
grpc_channel_stack_destroy(CHANNEL_STACK_FROM_CHANNEL(channel));
- channel->registration_table.Destroy();
+ channel->registration_table.Destroy();
if (channel->resource_user != nullptr) {
grpc_resource_user_free(channel->resource_user,
GRPC_RESOURCE_QUOTA_CHANNEL_SIZE);
@@ -523,7 +523,7 @@ void grpc_channel_destroy_internal(grpc_channel* channel) {
}
void grpc_channel_destroy(grpc_channel* channel) {
- grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
+ grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
grpc_core::ExecCtx exec_ctx;
grpc_channel_destroy_internal(channel);
}
diff --git a/contrib/libs/grpc/src/core/lib/surface/channel.h b/contrib/libs/grpc/src/core/lib/surface/channel.h
index b9ead2c1ebc..e49b9261f71 100644
--- a/contrib/libs/grpc/src/core/lib/surface/channel.h
+++ b/contrib/libs/grpc/src/core/lib/surface/channel.h
@@ -21,14 +21,14 @@
#include <grpc/support/port_platform.h>
-#include <map>
-
+#include <map>
+
#include "src/core/lib/channel/channel_stack.h"
#include "src/core/lib/channel/channel_stack_builder.h"
#include "src/core/lib/channel/channelz.h"
-#include "src/core/lib/gprpp/manual_constructor.h"
+#include "src/core/lib/gprpp/manual_constructor.h"
#include "src/core/lib/surface/channel_stack_type.h"
-#include "src/core/lib/transport/metadata.h"
+#include "src/core/lib/transport/metadata.h"
grpc_channel* grpc_channel_create(const char* target,
const grpc_channel_args* args,
@@ -66,40 +66,40 @@ grpc_core::channelz::ChannelNode* grpc_channel_get_channelz_node(
size_t grpc_channel_get_call_size_estimate(grpc_channel* channel);
void grpc_channel_update_call_size_estimate(grpc_channel* channel, size_t size);
-namespace grpc_core {
-
-struct RegisteredCall {
- // The method and host are kept as part of this struct just to manage their
- // lifetime since they must outlive the mdelem contents.
- TString method;
- TString host;
-
- grpc_mdelem path;
- grpc_mdelem authority;
-
- explicit RegisteredCall(const char* method_arg, const char* host_arg);
- // TODO(vjpai): delete copy constructor once all supported compilers allow
- // std::map value_type to be MoveConstructible.
- RegisteredCall(const RegisteredCall& other);
- RegisteredCall(RegisteredCall&& other) noexcept;
- RegisteredCall& operator=(const RegisteredCall&) = delete;
- RegisteredCall& operator=(RegisteredCall&&) = delete;
-
- ~RegisteredCall();
-};
-
-struct CallRegistrationTable {
- grpc_core::Mutex mu;
- // The map key should be owned strings rather than unowned char*'s to
- // guarantee that it outlives calls on the core channel (which may outlast the
- // C++ or other wrapped language Channel that registered these calls).
- std::map<std::pair<TString, TString>, RegisteredCall>
- map /* GUARDED_BY(mu) */;
- int method_registration_attempts /* GUARDED_BY(mu) */ = 0;
-};
-
-} // namespace grpc_core
-
+namespace grpc_core {
+
+struct RegisteredCall {
+ // The method and host are kept as part of this struct just to manage their
+ // lifetime since they must outlive the mdelem contents.
+ TString method;
+ TString host;
+
+ grpc_mdelem path;
+ grpc_mdelem authority;
+
+ explicit RegisteredCall(const char* method_arg, const char* host_arg);
+ // TODO(vjpai): delete copy constructor once all supported compilers allow
+ // std::map value_type to be MoveConstructible.
+ RegisteredCall(const RegisteredCall& other);
+ RegisteredCall(RegisteredCall&& other) noexcept;
+ RegisteredCall& operator=(const RegisteredCall&) = delete;
+ RegisteredCall& operator=(RegisteredCall&&) = delete;
+
+ ~RegisteredCall();
+};
+
+struct CallRegistrationTable {
+ grpc_core::Mutex mu;
+ // The map key should be owned strings rather than unowned char*'s to
+ // guarantee that it outlives calls on the core channel (which may outlast the
+ // C++ or other wrapped language Channel that registered these calls).
+ std::map<std::pair<TString, TString>, RegisteredCall>
+ map /* GUARDED_BY(mu) */;
+ int method_registration_attempts /* GUARDED_BY(mu) */ = 0;
+};
+
+} // namespace grpc_core
+
struct grpc_channel {
int is_client;
grpc_compression_options compression_options;
@@ -107,13 +107,13 @@ struct grpc_channel {
gpr_atm call_size_estimate;
grpc_resource_user* resource_user;
- // TODO(vjpai): Once the grpc_channel is allocated via new rather than malloc,
- // expand the members of the CallRegistrationTable directly into
- // the grpc_channel. For now it is kept separate so that all the
- // manual constructing can be done with a single call rather than
- // a separate manual construction for each field.
- grpc_core::ManualConstructor<grpc_core::CallRegistrationTable>
- registration_table;
+ // TODO(vjpai): Once the grpc_channel is allocated via new rather than malloc,
+ // expand the members of the CallRegistrationTable directly into
+ // the grpc_channel. For now it is kept separate so that all the
+ // manual constructing can be done with a single call rather than
+ // a separate manual construction for each field.
+ grpc_core::ManualConstructor<grpc_core::CallRegistrationTable>
+ registration_table;
grpc_core::RefCountedPtr<grpc_core::channelz::ChannelNode> channelz_node;
char* target;
@@ -161,13 +161,13 @@ inline void grpc_channel_internal_unref(grpc_channel* channel) {
grpc_channel_internal_unref(channel)
#endif
-// Return the channel's compression options.
+// Return the channel's compression options.
grpc_compression_options grpc_channel_compression_options(
const grpc_channel* channel);
-// Ping the channels peer (load balanced channels will select one sub-channel to
-// ping); if the channel is not connected, posts a failed.
-void grpc_channel_ping(grpc_channel* channel, grpc_completion_queue* cq,
- void* tag, void* reserved);
-
+// Ping the channels peer (load balanced channels will select one sub-channel to
+// ping); if the channel is not connected, posts a failed.
+void grpc_channel_ping(grpc_channel* channel, grpc_completion_queue* cq,
+ void* tag, void* reserved);
+
#endif /* GRPC_CORE_LIB_SURFACE_CHANNEL_H */
diff --git a/contrib/libs/grpc/src/core/lib/surface/completion_queue.cc b/contrib/libs/grpc/src/core/lib/surface/completion_queue.cc
index 49d2ff99bcb..0f50906734b 100644
--- a/contrib/libs/grpc/src/core/lib/surface/completion_queue.cc
+++ b/contrib/libs/grpc/src/core/lib/surface/completion_queue.cc
@@ -23,11 +23,11 @@
#include <stdio.h>
#include <string.h>
-#include <vector>
-
-#include "y_absl/strings/str_format.h"
-#include "y_absl/strings/str_join.h"
-
+#include <vector>
+
+#include "y_absl/strings/str_format.h"
+#include "y_absl/strings/str_join.h"
+
#include <grpc/support/alloc.h>
#include <grpc/support/atm.h>
#include <grpc/support/log.h>
@@ -243,14 +243,14 @@ class CqEventQueue {
};
struct cq_next_data {
- ~cq_next_data() {
- GPR_ASSERT(queue.num_items() == 0);
-#ifndef NDEBUG
- if (pending_events.Load(grpc_core::MemoryOrder::ACQUIRE) != 0) {
- gpr_log(GPR_ERROR, "Destroying CQ without draining it fully.");
- }
-#endif
- }
+ ~cq_next_data() {
+ GPR_ASSERT(queue.num_items() == 0);
+#ifndef NDEBUG
+ if (pending_events.Load(grpc_core::MemoryOrder::ACQUIRE) != 0) {
+ gpr_log(GPR_ERROR, "Destroying CQ without draining it fully.");
+ }
+#endif
+ }
/** Completed events for completion-queues of type GRPC_CQ_NEXT */
CqEventQueue queue;
@@ -276,11 +276,11 @@ struct cq_pluck_data {
~cq_pluck_data() {
GPR_ASSERT(completed_head.next ==
reinterpret_cast<uintptr_t>(&completed_head));
-#ifndef NDEBUG
- if (pending_events.Load(grpc_core::MemoryOrder::ACQUIRE) != 0) {
- gpr_log(GPR_ERROR, "Destroying CQ without draining it fully.");
- }
-#endif
+#ifndef NDEBUG
+ if (pending_events.Load(grpc_core::MemoryOrder::ACQUIRE) != 0) {
+ gpr_log(GPR_ERROR, "Destroying CQ without draining it fully.");
+ }
+#endif
}
/** Completed events for completion-queues of type GRPC_CQ_PLUCK */
@@ -312,15 +312,15 @@ struct cq_callback_data {
cq_callback_data(
grpc_experimental_completion_queue_functor* shutdown_callback)
: shutdown_callback(shutdown_callback) {}
-
- ~cq_callback_data() {
-#ifndef NDEBUG
- if (pending_events.Load(grpc_core::MemoryOrder::ACQUIRE) != 0) {
- gpr_log(GPR_ERROR, "Destroying CQ without draining it fully.");
- }
-#endif
- }
-
+
+ ~cq_callback_data() {
+#ifndef NDEBUG
+ if (pending_events.Load(grpc_core::MemoryOrder::ACQUIRE) != 0) {
+ gpr_log(GPR_ERROR, "Destroying CQ without draining it fully.");
+ }
+#endif
+ }
+
/** No actual completed events queue, unlike other types */
/** Number of pending events (+1 if we're not shutdown).
@@ -428,14 +428,14 @@ static const cq_vtable g_cq_vtable[] = {
grpc_core::TraceFlag grpc_cq_pluck_trace(false, "queue_pluck");
-#define GRPC_SURFACE_TRACE_RETURNED_EVENT(cq, event) \
- do { \
- if (GRPC_TRACE_FLAG_ENABLED(grpc_api_trace) && \
- (GRPC_TRACE_FLAG_ENABLED(grpc_cq_pluck_trace) || \
- (event)->type != GRPC_QUEUE_TIMEOUT)) { \
- gpr_log(GPR_INFO, "RETURN_EVENT[%p]: %s", cq, \
- grpc_event_string(event).c_str()); \
- } \
+#define GRPC_SURFACE_TRACE_RETURNED_EVENT(cq, event) \
+ do { \
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_api_trace) && \
+ (GRPC_TRACE_FLAG_ENABLED(grpc_cq_pluck_trace) || \
+ (event)->type != GRPC_QUEUE_TIMEOUT)) { \
+ gpr_log(GPR_INFO, "RETURN_EVENT[%p]: %s", cq, \
+ grpc_event_string(event).c_str()); \
+ } \
} while (0)
static void on_pollset_shutdown_done(void* cq, grpc_error* error);
@@ -870,15 +870,15 @@ static void cq_end_op_for_callback(
cq_finish_shutdown_callback(cq);
}
- // If possible, schedule the callback onto an existing thread-local
- // ApplicationCallbackExecCtx, which is a work queue. This is possible for:
- // 1. The callback is internally-generated and there is an ACEC available
- // 2. The callback is marked inlineable and there is an ACEC available
- // 3. We are already running in a background poller thread (which always has
- // an ACEC available at the base of the stack).
+ // If possible, schedule the callback onto an existing thread-local
+ // ApplicationCallbackExecCtx, which is a work queue. This is possible for:
+ // 1. The callback is internally-generated and there is an ACEC available
+ // 2. The callback is marked inlineable and there is an ACEC available
+ // 3. We are already running in a background poller thread (which always has
+ // an ACEC available at the base of the stack).
auto* functor = static_cast<grpc_experimental_completion_queue_functor*>(tag);
- if (((internal || functor->inlineable) &&
- grpc_core::ApplicationCallbackExecCtx::Available()) ||
+ if (((internal || functor->inlineable) &&
+ grpc_core::ApplicationCallbackExecCtx::Available()) ||
grpc_iomgr_is_any_background_poller_thread()) {
grpc_core::ApplicationCallbackExecCtx::Enqueue(functor,
(error == GRPC_ERROR_NONE));
@@ -946,14 +946,14 @@ class ExecCtxNext : public grpc_core::ExecCtx {
#ifndef NDEBUG
static void dump_pending_tags(grpc_completion_queue* cq) {
if (!GRPC_TRACE_FLAG_ENABLED(grpc_trace_pending_tags)) return;
- std::vector<TString> parts;
- parts.push_back("PENDING TAGS:");
+ std::vector<TString> parts;
+ parts.push_back("PENDING TAGS:");
gpr_mu_lock(cq->mu);
for (size_t i = 0; i < cq->outstanding_tag_count; i++) {
- parts.push_back(y_absl::StrFormat(" %p", cq->outstanding_tags[i]));
+ parts.push_back(y_absl::StrFormat(" %p", cq->outstanding_tags[i]));
}
gpr_mu_unlock(cq->mu);
- gpr_log(GPR_DEBUG, "%s", y_absl::StrJoin(parts, "").c_str());
+ gpr_log(GPR_DEBUG, "%s", y_absl::StrJoin(parts, "").c_str());
}
#else
static void dump_pending_tags(grpc_completion_queue* /*cq*/) {}
diff --git a/contrib/libs/grpc/src/core/lib/surface/event_string.cc b/contrib/libs/grpc/src/core/lib/surface/event_string.cc
index 4af497bad2f..d69aac6deec 100644
--- a/contrib/libs/grpc/src/core/lib/surface/event_string.cc
+++ b/contrib/libs/grpc/src/core/lib/surface/event_string.cc
@@ -22,40 +22,40 @@
#include <stdio.h>
-#include <vector>
-
-#include "y_absl/strings/str_format.h"
-#include "y_absl/strings/str_join.h"
-
+#include <vector>
+
+#include "y_absl/strings/str_format.h"
+#include "y_absl/strings/str_join.h"
+
#include <grpc/byte_buffer.h>
#include <grpc/support/string_util.h>
#include "src/core/lib/gpr/string.h"
-static void addhdr(grpc_event* ev, std::vector<TString>* buf) {
- buf->push_back(y_absl::StrFormat("tag:%p", ev->tag));
+static void addhdr(grpc_event* ev, std::vector<TString>* buf) {
+ buf->push_back(y_absl::StrFormat("tag:%p", ev->tag));
}
static const char* errstr(int success) { return success ? "OK" : "ERROR"; }
-static void adderr(int success, std::vector<TString>* buf) {
- buf->push_back(y_absl::StrFormat(" %s", errstr(success)));
+static void adderr(int success, std::vector<TString>* buf) {
+ buf->push_back(y_absl::StrFormat(" %s", errstr(success)));
}
-TString grpc_event_string(grpc_event* ev) {
- if (ev == nullptr) return "null";
- std::vector<TString> out;
+TString grpc_event_string(grpc_event* ev) {
+ if (ev == nullptr) return "null";
+ std::vector<TString> out;
switch (ev->type) {
case GRPC_QUEUE_TIMEOUT:
- out.push_back("QUEUE_TIMEOUT");
+ out.push_back("QUEUE_TIMEOUT");
break;
case GRPC_QUEUE_SHUTDOWN:
- out.push_back("QUEUE_SHUTDOWN");
+ out.push_back("QUEUE_SHUTDOWN");
break;
case GRPC_OP_COMPLETE:
- out.push_back("OP_COMPLETE: ");
- addhdr(ev, &out);
- adderr(ev->success, &out);
+ out.push_back("OP_COMPLETE: ");
+ addhdr(ev, &out);
+ adderr(ev->success, &out);
break;
}
- return y_absl::StrJoin(out, "");
+ return y_absl::StrJoin(out, "");
}
diff --git a/contrib/libs/grpc/src/core/lib/surface/event_string.h b/contrib/libs/grpc/src/core/lib/surface/event_string.h
index 76a0f5152de..f4ad847b3cd 100644
--- a/contrib/libs/grpc/src/core/lib/surface/event_string.h
+++ b/contrib/libs/grpc/src/core/lib/surface/event_string.h
@@ -21,11 +21,11 @@
#include <grpc/support/port_platform.h>
-#include <util/generic/string.h>
-
+#include <util/generic/string.h>
+
#include <grpc/grpc.h>
/* Returns a string describing an event. Must be later freed with gpr_free() */
-TString grpc_event_string(grpc_event* ev);
+TString grpc_event_string(grpc_event* ev);
#endif /* GRPC_CORE_LIB_SURFACE_EVENT_STRING_H */
diff --git a/contrib/libs/grpc/src/core/lib/surface/init.cc b/contrib/libs/grpc/src/core/lib/surface/init.cc
index 41342e84d07..7b79ba426bc 100644
--- a/contrib/libs/grpc/src/core/lib/surface/init.cc
+++ b/contrib/libs/grpc/src/core/lib/surface/init.cc
@@ -18,8 +18,8 @@
#include <grpc/support/port_platform.h>
-#include "src/core/lib/surface/init.h"
-
+#include "src/core/lib/surface/init.h"
+
#include <limits.h>
#include <memory.h>
@@ -28,7 +28,7 @@
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/time.h>
-
+
#include "src/core/lib/channel/channel_stack.h"
#include "src/core/lib/channel/channelz_registry.h"
#include "src/core/lib/channel/connected_channel.h"
@@ -40,7 +40,7 @@
#include "src/core/lib/http/parser.h"
#include "src/core/lib/iomgr/call_combiner.h"
#include "src/core/lib/iomgr/combiner.h"
-#include "src/core/lib/iomgr/exec_ctx.h"
+#include "src/core/lib/iomgr/exec_ctx.h"
#include "src/core/lib/iomgr/executor.h"
#include "src/core/lib/iomgr/iomgr.h"
#include "src/core/lib/iomgr/resource_quota.h"
@@ -105,7 +105,7 @@ static void register_builtin_channel_init() {
GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
append_filter, (void*)&grpc_lame_filter);
grpc_channel_init_register_stage(GRPC_SERVER_CHANNEL, INT_MAX, prepend_filter,
- (void*)&grpc_core::Server::kServerTopFilter);
+ (void*)&grpc_core::Server::kServerTopFilter);
}
typedef struct grpc_plugin {
@@ -214,29 +214,29 @@ void grpc_shutdown_internal(void* /*ignored*/) {
void grpc_shutdown(void) {
GRPC_API_TRACE("grpc_shutdown(void)", 0, ());
grpc_core::MutexLock lock(&g_init_mu);
-
+
if (--g_initializations == 0) {
- grpc_core::ApplicationCallbackExecCtx* acec =
- grpc_core::ApplicationCallbackExecCtx::Get();
- if (!grpc_iomgr_is_any_background_poller_thread() &&
- (acec == nullptr ||
- (acec->Flags() & GRPC_APP_CALLBACK_EXEC_CTX_FLAG_IS_INTERNAL_THREAD) ==
- 0)) {
- // just run clean-up when this is called on non-executor thread.
- gpr_log(GPR_DEBUG, "grpc_shutdown starts clean-up now");
- g_shutting_down = true;
- grpc_shutdown_internal_locked();
- } else {
- // spawn a detached thread to do the actual clean up in case we are
- // currently in an executor thread.
- gpr_log(GPR_DEBUG, "grpc_shutdown spawns clean-up thread");
- g_initializations++;
- g_shutting_down = true;
- grpc_core::Thread cleanup_thread(
- "grpc_shutdown", grpc_shutdown_internal, nullptr, nullptr,
- grpc_core::Thread::Options().set_joinable(false).set_tracked(false));
- cleanup_thread.Start();
- }
+ grpc_core::ApplicationCallbackExecCtx* acec =
+ grpc_core::ApplicationCallbackExecCtx::Get();
+ if (!grpc_iomgr_is_any_background_poller_thread() &&
+ (acec == nullptr ||
+ (acec->Flags() & GRPC_APP_CALLBACK_EXEC_CTX_FLAG_IS_INTERNAL_THREAD) ==
+ 0)) {
+ // just run clean-up when this is called on non-executor thread.
+ gpr_log(GPR_DEBUG, "grpc_shutdown starts clean-up now");
+ g_shutting_down = true;
+ grpc_shutdown_internal_locked();
+ } else {
+ // spawn a detached thread to do the actual clean up in case we are
+ // currently in an executor thread.
+ gpr_log(GPR_DEBUG, "grpc_shutdown spawns clean-up thread");
+ g_initializations++;
+ g_shutting_down = true;
+ grpc_core::Thread cleanup_thread(
+ "grpc_shutdown", grpc_shutdown_internal, nullptr, nullptr,
+ grpc_core::Thread::Options().set_joinable(false).set_tracked(false));
+ cleanup_thread.Start();
+ }
}
}
diff --git a/contrib/libs/grpc/src/core/lib/surface/init_secure.cc b/contrib/libs/grpc/src/core/lib/surface/init_secure.cc
index 4826f121322..428c5815c98 100644
--- a/contrib/libs/grpc/src/core/lib/surface/init_secure.cc
+++ b/contrib/libs/grpc/src/core/lib/surface/init_secure.cc
@@ -78,4 +78,4 @@ void grpc_register_security_filters(void) {
maybe_prepend_server_auth_filter, nullptr);
}
-void grpc_security_init() { grpc_core::SecurityRegisterHandshakerFactories(); }
+void grpc_security_init() { grpc_core::SecurityRegisterHandshakerFactories(); }
diff --git a/contrib/libs/grpc/src/core/lib/surface/server.cc b/contrib/libs/grpc/src/core/lib/surface/server.cc
index 4d5f1a56d5a..0775c6ee4c4 100644
--- a/contrib/libs/grpc/src/core/lib/surface/server.cc
+++ b/contrib/libs/grpc/src/core/lib/surface/server.cc
@@ -1,18 +1,18 @@
-//
-// Copyright 2015-2016 gRPC authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
+//
+// Copyright 2015-2016 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
#include <grpc/support/port_platform.h>
@@ -22,16 +22,16 @@
#include <stdlib.h>
#include <string.h>
-#include <algorithm>
-#include <atomic>
-#include <iterator>
-#include <list>
-#include <queue>
-#include <utility>
-#include <vector>
-
-#include "y_absl/types/optional.h"
-
+#include <algorithm>
+#include <atomic>
+#include <iterator>
+#include <list>
+#include <queue>
+#include <utility>
+#include <vector>
+
+#include "y_absl/types/optional.h"
+
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
@@ -54,1044 +54,1044 @@
#include "src/core/lib/transport/metadata.h"
#include "src/core/lib/transport/static_metadata.h"
-namespace grpc_core {
-
-TraceFlag grpc_server_channel_trace(false, "server_channel");
-
-//
-// Server::RequestedCall
-//
-
-struct Server::RequestedCall {
- enum class Type { BATCH_CALL, REGISTERED_CALL };
-
- RequestedCall(void* tag_arg, grpc_completion_queue* call_cq,
- grpc_call** call_arg, grpc_metadata_array* initial_md,
- grpc_call_details* details)
- : type(Type::BATCH_CALL),
- tag(tag_arg),
- cq_bound_to_call(call_cq),
- call(call_arg),
- initial_metadata(initial_md) {
- details->reserved = nullptr;
- data.batch.details = details;
- }
-
- RequestedCall(void* tag_arg, grpc_completion_queue* call_cq,
- grpc_call** call_arg, grpc_metadata_array* initial_md,
- RegisteredMethod* rm, gpr_timespec* deadline,
- grpc_byte_buffer** optional_payload)
- : type(Type::REGISTERED_CALL),
- tag(tag_arg),
- cq_bound_to_call(call_cq),
- call(call_arg),
- initial_metadata(initial_md) {
- data.registered.method = rm;
- data.registered.deadline = deadline;
- data.registered.optional_payload = optional_payload;
- }
-
- MultiProducerSingleConsumerQueue::Node mpscq_node;
- const Type type;
- void* const tag;
- grpc_completion_queue* const cq_bound_to_call;
- grpc_call** const call;
+namespace grpc_core {
+
+TraceFlag grpc_server_channel_trace(false, "server_channel");
+
+//
+// Server::RequestedCall
+//
+
+struct Server::RequestedCall {
+ enum class Type { BATCH_CALL, REGISTERED_CALL };
+
+ RequestedCall(void* tag_arg, grpc_completion_queue* call_cq,
+ grpc_call** call_arg, grpc_metadata_array* initial_md,
+ grpc_call_details* details)
+ : type(Type::BATCH_CALL),
+ tag(tag_arg),
+ cq_bound_to_call(call_cq),
+ call(call_arg),
+ initial_metadata(initial_md) {
+ details->reserved = nullptr;
+ data.batch.details = details;
+ }
+
+ RequestedCall(void* tag_arg, grpc_completion_queue* call_cq,
+ grpc_call** call_arg, grpc_metadata_array* initial_md,
+ RegisteredMethod* rm, gpr_timespec* deadline,
+ grpc_byte_buffer** optional_payload)
+ : type(Type::REGISTERED_CALL),
+ tag(tag_arg),
+ cq_bound_to_call(call_cq),
+ call(call_arg),
+ initial_metadata(initial_md) {
+ data.registered.method = rm;
+ data.registered.deadline = deadline;
+ data.registered.optional_payload = optional_payload;
+ }
+
+ MultiProducerSingleConsumerQueue::Node mpscq_node;
+ const Type type;
+ void* const tag;
+ grpc_completion_queue* const cq_bound_to_call;
+ grpc_call** const call;
grpc_cq_completion completion;
- grpc_metadata_array* const initial_metadata;
+ grpc_metadata_array* const initial_metadata;
union {
struct {
grpc_call_details* details;
} batch;
struct {
- RegisteredMethod* method;
+ RegisteredMethod* method;
gpr_timespec* deadline;
grpc_byte_buffer** optional_payload;
} registered;
} data;
};
-//
-// Server::RegisteredMethod
-//
-
-struct Server::RegisteredMethod {
- RegisteredMethod(
- const char* method_arg, const char* host_arg,
- grpc_server_register_method_payload_handling payload_handling_arg,
- uint32_t flags_arg)
- : method(method_arg == nullptr ? "" : method_arg),
- host(host_arg == nullptr ? "" : host_arg),
- payload_handling(payload_handling_arg),
- flags(flags_arg) {}
-
- ~RegisteredMethod() = default;
-
- const TString method;
- const TString host;
- const grpc_server_register_method_payload_handling payload_handling;
- const uint32_t flags;
- // One request matcher per method.
- std::unique_ptr<RequestMatcherInterface> matcher;
-};
-
-//
-// Server::RequestMatcherInterface
-//
-
-// RPCs that come in from the transport must be matched against RPC requests
-// from the application. An incoming request from the application can be matched
-// to an RPC that has already arrived or can be queued up for later use.
-// Likewise, an RPC coming in from the transport can either be matched to a
-// request that already arrived from the application or can be queued up for
-// later use (marked pending). If there is a match, the request's tag is posted
-// on the request's notification CQ.
-//
-// RequestMatcherInterface is the base class to provide this functionality.
-class Server::RequestMatcherInterface {
- public:
- virtual ~RequestMatcherInterface() {}
-
- // Unref the calls associated with any incoming RPCs in the pending queue (not
- // yet matched to an application-requested RPC).
- virtual void ZombifyPending() = 0;
-
- // Mark all application-requested RPCs failed if they have not been matched to
- // an incoming RPC. The error parameter indicates why the RPCs are being
- // failed (always server shutdown in all current implementations).
- virtual void KillRequests(grpc_error* error) = 0;
-
- // How many request queues are supported by this matcher. This is an abstract
- // concept that essentially maps to gRPC completion queues.
- virtual size_t request_queue_count() const = 0;
-
- // This function is invoked when the application requests a new RPC whose
- // information is in the call parameter. The request_queue_index marks the
- // queue onto which to place this RPC, and is typically associated with a gRPC
- // CQ. If there are pending RPCs waiting to be matched, publish one (match it
- // and notify the CQ).
- virtual void RequestCallWithPossiblePublish(size_t request_queue_index,
- RequestedCall* call) = 0;
-
- // This function is invoked on an incoming RPC, represented by the calld
- // object. The RequestMatcher will try to match it against an
- // application-requested RPC if possible or will place it in the pending queue
- // otherwise. To enable some measure of fairness between server CQs, the match
- // is done starting at the start_request_queue_index parameter in a cyclic
- // order rather than always starting at 0.
- virtual void MatchOrQueue(size_t start_request_queue_index,
- CallData* calld) = 0;
-
- // Returns the server associated with this request matcher
- virtual Server* server() const = 0;
-};
-
-// The RealRequestMatcher is an implementation of RequestMatcherInterface that
-// actually uses all the features of RequestMatcherInterface: expecting the
-// application to explicitly request RPCs and then matching those to incoming
-// RPCs, along with a slow path by which incoming RPCs are put on a locked
-// pending list if they aren't able to be matched to an application request.
-class Server::RealRequestMatcher : public RequestMatcherInterface {
- public:
- explicit RealRequestMatcher(Server* server)
- : server_(server), requests_per_cq_(server->cqs_.size()) {}
-
- ~RealRequestMatcher() override {
- for (LockedMultiProducerSingleConsumerQueue& queue : requests_per_cq_) {
- GPR_ASSERT(queue.Pop() == nullptr);
- }
- }
-
- void ZombifyPending() override {
- while (!pending_.empty()) {
- CallData* calld = pending_.front();
- calld->SetState(CallData::CallState::ZOMBIED);
- calld->KillZombie();
- pending_.pop();
- }
- }
-
- void KillRequests(grpc_error* error) override {
- for (size_t i = 0; i < requests_per_cq_.size(); i++) {
- RequestedCall* rc;
- while ((rc = reinterpret_cast<RequestedCall*>(
- requests_per_cq_[i].Pop())) != nullptr) {
- server_->FailCall(i, rc, GRPC_ERROR_REF(error));
- }
- }
- GRPC_ERROR_UNREF(error);
- }
-
- size_t request_queue_count() const override {
- return requests_per_cq_.size();
- }
-
- void RequestCallWithPossiblePublish(size_t request_queue_index,
- RequestedCall* call) override {
- if (requests_per_cq_[request_queue_index].Push(&call->mpscq_node)) {
- /* this was the first queued request: we need to lock and start
- matching calls */
- struct PendingCall {
- RequestedCall* rc = nullptr;
- CallData* calld;
- };
- auto pop_next_pending = [this, request_queue_index] {
- PendingCall pending_call;
- {
- MutexLock lock(&server_->mu_call_);
- if (!pending_.empty()) {
- pending_call.rc = reinterpret_cast<RequestedCall*>(
- requests_per_cq_[request_queue_index].Pop());
- if (pending_call.rc != nullptr) {
- pending_call.calld = pending_.front();
- pending_.pop();
- }
- }
- }
- return pending_call;
- };
- while (true) {
- PendingCall next_pending = pop_next_pending();
- if (next_pending.rc == nullptr) break;
- if (!next_pending.calld->MaybeActivate()) {
- // Zombied Call
- next_pending.calld->KillZombie();
- } else {
- next_pending.calld->Publish(request_queue_index, next_pending.rc);
- }
- }
+//
+// Server::RegisteredMethod
+//
+
+struct Server::RegisteredMethod {
+ RegisteredMethod(
+ const char* method_arg, const char* host_arg,
+ grpc_server_register_method_payload_handling payload_handling_arg,
+ uint32_t flags_arg)
+ : method(method_arg == nullptr ? "" : method_arg),
+ host(host_arg == nullptr ? "" : host_arg),
+ payload_handling(payload_handling_arg),
+ flags(flags_arg) {}
+
+ ~RegisteredMethod() = default;
+
+ const TString method;
+ const TString host;
+ const grpc_server_register_method_payload_handling payload_handling;
+ const uint32_t flags;
+ // One request matcher per method.
+ std::unique_ptr<RequestMatcherInterface> matcher;
+};
+
+//
+// Server::RequestMatcherInterface
+//
+
+// RPCs that come in from the transport must be matched against RPC requests
+// from the application. An incoming request from the application can be matched
+// to an RPC that has already arrived or can be queued up for later use.
+// Likewise, an RPC coming in from the transport can either be matched to a
+// request that already arrived from the application or can be queued up for
+// later use (marked pending). If there is a match, the request's tag is posted
+// on the request's notification CQ.
+//
+// RequestMatcherInterface is the base class to provide this functionality.
+class Server::RequestMatcherInterface {
+ public:
+ virtual ~RequestMatcherInterface() {}
+
+ // Unref the calls associated with any incoming RPCs in the pending queue (not
+ // yet matched to an application-requested RPC).
+ virtual void ZombifyPending() = 0;
+
+ // Mark all application-requested RPCs failed if they have not been matched to
+ // an incoming RPC. The error parameter indicates why the RPCs are being
+ // failed (always server shutdown in all current implementations).
+ virtual void KillRequests(grpc_error* error) = 0;
+
+ // How many request queues are supported by this matcher. This is an abstract
+ // concept that essentially maps to gRPC completion queues.
+ virtual size_t request_queue_count() const = 0;
+
+ // This function is invoked when the application requests a new RPC whose
+ // information is in the call parameter. The request_queue_index marks the
+ // queue onto which to place this RPC, and is typically associated with a gRPC
+ // CQ. If there are pending RPCs waiting to be matched, publish one (match it
+ // and notify the CQ).
+ virtual void RequestCallWithPossiblePublish(size_t request_queue_index,
+ RequestedCall* call) = 0;
+
+ // This function is invoked on an incoming RPC, represented by the calld
+ // object. The RequestMatcher will try to match it against an
+ // application-requested RPC if possible or will place it in the pending queue
+ // otherwise. To enable some measure of fairness between server CQs, the match
+ // is done starting at the start_request_queue_index parameter in a cyclic
+ // order rather than always starting at 0.
+ virtual void MatchOrQueue(size_t start_request_queue_index,
+ CallData* calld) = 0;
+
+ // Returns the server associated with this request matcher
+ virtual Server* server() const = 0;
+};
+
+// The RealRequestMatcher is an implementation of RequestMatcherInterface that
+// actually uses all the features of RequestMatcherInterface: expecting the
+// application to explicitly request RPCs and then matching those to incoming
+// RPCs, along with a slow path by which incoming RPCs are put on a locked
+// pending list if they aren't able to be matched to an application request.
+class Server::RealRequestMatcher : public RequestMatcherInterface {
+ public:
+ explicit RealRequestMatcher(Server* server)
+ : server_(server), requests_per_cq_(server->cqs_.size()) {}
+
+ ~RealRequestMatcher() override {
+ for (LockedMultiProducerSingleConsumerQueue& queue : requests_per_cq_) {
+ GPR_ASSERT(queue.Pop() == nullptr);
+ }
+ }
+
+ void ZombifyPending() override {
+ while (!pending_.empty()) {
+ CallData* calld = pending_.front();
+ calld->SetState(CallData::CallState::ZOMBIED);
+ calld->KillZombie();
+ pending_.pop();
+ }
+ }
+
+ void KillRequests(grpc_error* error) override {
+ for (size_t i = 0; i < requests_per_cq_.size(); i++) {
+ RequestedCall* rc;
+ while ((rc = reinterpret_cast<RequestedCall*>(
+ requests_per_cq_[i].Pop())) != nullptr) {
+ server_->FailCall(i, rc, GRPC_ERROR_REF(error));
+ }
+ }
+ GRPC_ERROR_UNREF(error);
+ }
+
+ size_t request_queue_count() const override {
+ return requests_per_cq_.size();
+ }
+
+ void RequestCallWithPossiblePublish(size_t request_queue_index,
+ RequestedCall* call) override {
+ if (requests_per_cq_[request_queue_index].Push(&call->mpscq_node)) {
+ /* this was the first queued request: we need to lock and start
+ matching calls */
+ struct PendingCall {
+ RequestedCall* rc = nullptr;
+ CallData* calld;
+ };
+ auto pop_next_pending = [this, request_queue_index] {
+ PendingCall pending_call;
+ {
+ MutexLock lock(&server_->mu_call_);
+ if (!pending_.empty()) {
+ pending_call.rc = reinterpret_cast<RequestedCall*>(
+ requests_per_cq_[request_queue_index].Pop());
+ if (pending_call.rc != nullptr) {
+ pending_call.calld = pending_.front();
+ pending_.pop();
+ }
+ }
+ }
+ return pending_call;
+ };
+ while (true) {
+ PendingCall next_pending = pop_next_pending();
+ if (next_pending.rc == nullptr) break;
+ if (!next_pending.calld->MaybeActivate()) {
+ // Zombied Call
+ next_pending.calld->KillZombie();
+ } else {
+ next_pending.calld->Publish(request_queue_index, next_pending.rc);
+ }
+ }
+ }
+ }
+
+ void MatchOrQueue(size_t start_request_queue_index,
+ CallData* calld) override {
+ for (size_t i = 0; i < requests_per_cq_.size(); i++) {
+ size_t cq_idx = (start_request_queue_index + i) % requests_per_cq_.size();
+ RequestedCall* rc =
+ reinterpret_cast<RequestedCall*>(requests_per_cq_[cq_idx].TryPop());
+ if (rc != nullptr) {
+ GRPC_STATS_INC_SERVER_CQS_CHECKED(i);
+ calld->SetState(CallData::CallState::ACTIVATED);
+ calld->Publish(cq_idx, rc);
+ return;
+ }
+ }
+ // No cq to take the request found; queue it on the slow list.
+ GRPC_STATS_INC_SERVER_SLOWPATH_REQUESTS_QUEUED();
+ // We need to ensure that all the queues are empty. We do this under
+ // the server mu_call_ lock to ensure that if something is added to
+ // an empty request queue, it will block until the call is actually
+ // added to the pending list.
+ RequestedCall* rc = nullptr;
+ size_t cq_idx = 0;
+ size_t loop_count;
+ {
+ MutexLock lock(&server_->mu_call_);
+ for (loop_count = 0; loop_count < requests_per_cq_.size(); loop_count++) {
+ cq_idx =
+ (start_request_queue_index + loop_count) % requests_per_cq_.size();
+ rc = reinterpret_cast<RequestedCall*>(requests_per_cq_[cq_idx].Pop());
+ if (rc != nullptr) {
+ break;
+ }
+ }
+ if (rc == nullptr) {
+ calld->SetState(CallData::CallState::PENDING);
+ pending_.push(calld);
+ return;
+ }
+ }
+ GRPC_STATS_INC_SERVER_CQS_CHECKED(loop_count + requests_per_cq_.size());
+ calld->SetState(CallData::CallState::ACTIVATED);
+ calld->Publish(cq_idx, rc);
+ }
+
+ Server* server() const override { return server_; }
+
+ private:
+ Server* const server_;
+ std::queue<CallData*> pending_;
+ std::vector<LockedMultiProducerSingleConsumerQueue> requests_per_cq_;
+};
+
+// AllocatingRequestMatchers don't allow the application to request an RPC in
+// advance or queue up any incoming RPC for later match. Instead, MatchOrQueue
+// will call out to an allocation function passed in at the construction of the
+// object. These request matchers are designed for the C++ callback API, so they
+// only support 1 completion queue (passed in at the constructor).
+class Server::AllocatingRequestMatcherBase : public RequestMatcherInterface {
+ public:
+ AllocatingRequestMatcherBase(Server* server, grpc_completion_queue* cq)
+ : server_(server), cq_(cq) {
+ size_t idx;
+ for (idx = 0; idx < server->cqs_.size(); idx++) {
+ if (server->cqs_[idx] == cq) {
+ break;
+ }
+ }
+ GPR_ASSERT(idx < server->cqs_.size());
+ cq_idx_ = idx;
+ }
+
+ void ZombifyPending() override {}
+
+ void KillRequests(grpc_error* error) override { GRPC_ERROR_UNREF(error); }
+
+ size_t request_queue_count() const override { return 0; }
+
+ void RequestCallWithPossiblePublish(size_t /*request_queue_index*/,
+ RequestedCall* /*call*/) final {
+ GPR_ASSERT(false);
+ }
+
+ Server* server() const override { return server_; }
+
+ // Supply the completion queue related to this request matcher
+ grpc_completion_queue* cq() const { return cq_; }
+
+ // Supply the completion queue's index relative to the server.
+ size_t cq_idx() const { return cq_idx_; }
+
+ private:
+ Server* const server_;
+ grpc_completion_queue* const cq_;
+ size_t cq_idx_;
+};
+
+// An allocating request matcher for non-registered methods (used for generic
+// API and unimplemented RPCs).
+class Server::AllocatingRequestMatcherBatch
+ : public AllocatingRequestMatcherBase {
+ public:
+ AllocatingRequestMatcherBatch(Server* server, grpc_completion_queue* cq,
+ std::function<BatchCallAllocation()> allocator)
+ : AllocatingRequestMatcherBase(server, cq),
+ allocator_(std::move(allocator)) {}
+
+ void MatchOrQueue(size_t /*start_request_queue_index*/,
+ CallData* calld) override {
+ BatchCallAllocation call_info = allocator_();
+ GPR_ASSERT(server()->ValidateServerRequest(
+ cq(), static_cast<void*>(call_info.tag), nullptr, nullptr) ==
+ GRPC_CALL_OK);
+ RequestedCall* rc = new RequestedCall(
+ static_cast<void*>(call_info.tag), cq(), call_info.call,
+ call_info.initial_metadata, call_info.details);
+ calld->SetState(CallData::CallState::ACTIVATED);
+ calld->Publish(cq_idx(), rc);
+ }
+
+ private:
+ std::function<BatchCallAllocation()> allocator_;
+};
+
+// An allocating request matcher for registered methods.
+class Server::AllocatingRequestMatcherRegistered
+ : public AllocatingRequestMatcherBase {
+ public:
+ AllocatingRequestMatcherRegistered(
+ Server* server, grpc_completion_queue* cq, RegisteredMethod* rm,
+ std::function<RegisteredCallAllocation()> allocator)
+ : AllocatingRequestMatcherBase(server, cq),
+ registered_method_(rm),
+ allocator_(std::move(allocator)) {}
+
+ void MatchOrQueue(size_t /*start_request_queue_index*/,
+ CallData* calld) override {
+ RegisteredCallAllocation call_info = allocator_();
+ GPR_ASSERT(
+ server()->ValidateServerRequest(cq(), static_cast<void*>(call_info.tag),
+ call_info.optional_payload,
+ registered_method_) == GRPC_CALL_OK);
+ RequestedCall* rc = new RequestedCall(
+ static_cast<void*>(call_info.tag), cq(), call_info.call,
+ call_info.initial_metadata, registered_method_, call_info.deadline,
+ call_info.optional_payload);
+ calld->SetState(CallData::CallState::ACTIVATED);
+ calld->Publish(cq_idx(), rc);
+ }
+
+ private:
+ RegisteredMethod* const registered_method_;
+ std::function<RegisteredCallAllocation()> allocator_;
+};
+
+//
+// ChannelBroadcaster
+//
+
+namespace {
+
+class ChannelBroadcaster {
+ public:
+ // This can have an empty constructor and destructor since we want to control
+ // when the actual setup and shutdown broadcast take place.
+
+ // Copies over the channels from the locked server.
+ void FillChannelsLocked(std::vector<grpc_channel*> channels) {
+ GPR_DEBUG_ASSERT(channels_.empty());
+ channels_ = std::move(channels);
+ }
+
+ // Broadcasts a shutdown on each channel.
+ void BroadcastShutdown(bool send_goaway, grpc_error* force_disconnect) {
+ for (grpc_channel* channel : channels_) {
+ SendShutdown(channel, send_goaway, GRPC_ERROR_REF(force_disconnect));
+ GRPC_CHANNEL_INTERNAL_UNREF(channel, "broadcast");
+ }
+ channels_.clear(); // just for safety against double broadcast
+ GRPC_ERROR_UNREF(force_disconnect);
+ }
+
+ private:
+ struct ShutdownCleanupArgs {
+ grpc_closure closure;
+ grpc_slice slice;
+ };
+
+ static void ShutdownCleanup(void* arg, grpc_error* /*error*/) {
+ ShutdownCleanupArgs* a = static_cast<ShutdownCleanupArgs*>(arg);
+ grpc_slice_unref_internal(a->slice);
+ delete a;
+ }
+
+ static void SendShutdown(grpc_channel* channel, bool send_goaway,
+ grpc_error* send_disconnect) {
+ ShutdownCleanupArgs* sc = new ShutdownCleanupArgs;
+ GRPC_CLOSURE_INIT(&sc->closure, ShutdownCleanup, sc,
+ grpc_schedule_on_exec_ctx);
+ grpc_transport_op* op = grpc_make_transport_op(&sc->closure);
+ grpc_channel_element* elem;
+ op->goaway_error =
+ send_goaway
+ ? grpc_error_set_int(
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("Server shutdown"),
+ GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_OK)
+ : GRPC_ERROR_NONE;
+ op->set_accept_stream = true;
+ sc->slice = grpc_slice_from_copied_string("Server shutdown");
+ op->disconnect_with_error = send_disconnect;
+ elem =
+ grpc_channel_stack_element(grpc_channel_get_channel_stack(channel), 0);
+ elem->filter->start_transport_op(elem, op);
+ }
+
+ std::vector<grpc_channel*> channels_;
+};
+
+} // namespace
+
+//
+// Server
+//
+
+const grpc_channel_filter Server::kServerTopFilter = {
+ Server::CallData::StartTransportStreamOpBatch,
+ grpc_channel_next_op,
+ sizeof(Server::CallData),
+ Server::CallData::InitCallElement,
+ grpc_call_stack_ignore_set_pollset_or_pollset_set,
+ Server::CallData::DestroyCallElement,
+ sizeof(Server::ChannelData),
+ Server::ChannelData::InitChannelElement,
+ Server::ChannelData::DestroyChannelElement,
+ grpc_channel_next_get_info,
+ "server",
+};
+
+namespace {
+
+grpc_resource_user* CreateDefaultResourceUser(const grpc_channel_args* args) {
+ if (args != nullptr) {
+ grpc_resource_quota* resource_quota =
+ grpc_resource_quota_from_channel_args(args, false /* create */);
+ if (resource_quota != nullptr) {
+ return grpc_resource_user_create(resource_quota, "default");
+ }
+ }
+ return nullptr;
+}
+
+RefCountedPtr<channelz::ServerNode> CreateChannelzNode(
+ Server* server, const grpc_channel_args* args) {
+ RefCountedPtr<channelz::ServerNode> channelz_node;
+ if (grpc_channel_args_find_bool(args, GRPC_ARG_ENABLE_CHANNELZ,
+ GRPC_ENABLE_CHANNELZ_DEFAULT)) {
+ size_t channel_tracer_max_memory = grpc_channel_args_find_integer(
+ args, GRPC_ARG_MAX_CHANNEL_TRACE_EVENT_MEMORY_PER_NODE,
+ {GRPC_MAX_CHANNEL_TRACE_EVENT_MEMORY_PER_NODE_DEFAULT, 0, INT_MAX});
+ channelz_node =
+ MakeRefCounted<channelz::ServerNode>(channel_tracer_max_memory);
+ channelz_node->AddTraceEvent(
+ channelz::ChannelTrace::Severity::Info,
+ grpc_slice_from_static_string("Server created"));
+ }
+ return channelz_node;
+}
+
+} // namespace
+
+Server::Server(const grpc_channel_args* args)
+ : channel_args_(grpc_channel_args_copy(args)),
+ default_resource_user_(CreateDefaultResourceUser(args)),
+ channelz_node_(CreateChannelzNode(this, args)) {}
+
+Server::~Server() {
+ grpc_channel_args_destroy(channel_args_);
+ for (size_t i = 0; i < cqs_.size(); i++) {
+ GRPC_CQ_INTERNAL_UNREF(cqs_[i], "server");
+ }
+}
+
+void Server::AddListener(OrphanablePtr<ListenerInterface> listener) {
+ channelz::ListenSocketNode* listen_socket_node =
+ listener->channelz_listen_socket_node();
+ if (listen_socket_node != nullptr && channelz_node_ != nullptr) {
+ channelz_node_->AddChildListenSocket(listen_socket_node->Ref());
+ }
+ listeners_.emplace_back(std::move(listener));
+}
+
+void Server::Start() {
+ started_ = true;
+ for (grpc_completion_queue* cq : cqs_) {
+ if (grpc_cq_can_listen(cq)) {
+ pollsets_.push_back(grpc_cq_pollset(cq));
+ }
+ }
+ if (unregistered_request_matcher_ == nullptr) {
+ unregistered_request_matcher_ = y_absl::make_unique<RealRequestMatcher>(this);
+ }
+ for (std::unique_ptr<RegisteredMethod>& rm : registered_methods_) {
+ if (rm->matcher == nullptr) {
+ rm->matcher = y_absl::make_unique<RealRequestMatcher>(this);
}
}
+ {
+ MutexLock lock(&mu_global_);
+ starting_ = true;
+ }
+ for (auto& listener : listeners_) {
+ listener.listener->Start(this, &pollsets_);
+ }
+ MutexLock lock(&mu_global_);
+ starting_ = false;
+ starting_cv_.Signal();
+}
- void MatchOrQueue(size_t start_request_queue_index,
- CallData* calld) override {
- for (size_t i = 0; i < requests_per_cq_.size(); i++) {
- size_t cq_idx = (start_request_queue_index + i) % requests_per_cq_.size();
- RequestedCall* rc =
- reinterpret_cast<RequestedCall*>(requests_per_cq_[cq_idx].TryPop());
- if (rc != nullptr) {
- GRPC_STATS_INC_SERVER_CQS_CHECKED(i);
- calld->SetState(CallData::CallState::ACTIVATED);
- calld->Publish(cq_idx, rc);
- return;
- }
- }
- // No cq to take the request found; queue it on the slow list.
- GRPC_STATS_INC_SERVER_SLOWPATH_REQUESTS_QUEUED();
- // We need to ensure that all the queues are empty. We do this under
- // the server mu_call_ lock to ensure that if something is added to
- // an empty request queue, it will block until the call is actually
- // added to the pending list.
- RequestedCall* rc = nullptr;
- size_t cq_idx = 0;
- size_t loop_count;
- {
- MutexLock lock(&server_->mu_call_);
- for (loop_count = 0; loop_count < requests_per_cq_.size(); loop_count++) {
- cq_idx =
- (start_request_queue_index + loop_count) % requests_per_cq_.size();
- rc = reinterpret_cast<RequestedCall*>(requests_per_cq_[cq_idx].Pop());
- if (rc != nullptr) {
- break;
- }
- }
- if (rc == nullptr) {
- calld->SetState(CallData::CallState::PENDING);
- pending_.push(calld);
- return;
- }
- }
- GRPC_STATS_INC_SERVER_CQS_CHECKED(loop_count + requests_per_cq_.size());
- calld->SetState(CallData::CallState::ACTIVATED);
- calld->Publish(cq_idx, rc);
- }
-
- Server* server() const override { return server_; }
-
- private:
- Server* const server_;
- std::queue<CallData*> pending_;
- std::vector<LockedMultiProducerSingleConsumerQueue> requests_per_cq_;
-};
-
-// AllocatingRequestMatchers don't allow the application to request an RPC in
-// advance or queue up any incoming RPC for later match. Instead, MatchOrQueue
-// will call out to an allocation function passed in at the construction of the
-// object. These request matchers are designed for the C++ callback API, so they
-// only support 1 completion queue (passed in at the constructor).
-class Server::AllocatingRequestMatcherBase : public RequestMatcherInterface {
- public:
- AllocatingRequestMatcherBase(Server* server, grpc_completion_queue* cq)
- : server_(server), cq_(cq) {
- size_t idx;
- for (idx = 0; idx < server->cqs_.size(); idx++) {
- if (server->cqs_[idx] == cq) {
- break;
- }
- }
- GPR_ASSERT(idx < server->cqs_.size());
- cq_idx_ = idx;
- }
-
- void ZombifyPending() override {}
-
- void KillRequests(grpc_error* error) override { GRPC_ERROR_UNREF(error); }
-
- size_t request_queue_count() const override { return 0; }
-
- void RequestCallWithPossiblePublish(size_t /*request_queue_index*/,
- RequestedCall* /*call*/) final {
- GPR_ASSERT(false);
- }
-
- Server* server() const override { return server_; }
-
- // Supply the completion queue related to this request matcher
- grpc_completion_queue* cq() const { return cq_; }
-
- // Supply the completion queue's index relative to the server.
- size_t cq_idx() const { return cq_idx_; }
-
- private:
- Server* const server_;
- grpc_completion_queue* const cq_;
- size_t cq_idx_;
-};
-
-// An allocating request matcher for non-registered methods (used for generic
-// API and unimplemented RPCs).
-class Server::AllocatingRequestMatcherBatch
- : public AllocatingRequestMatcherBase {
- public:
- AllocatingRequestMatcherBatch(Server* server, grpc_completion_queue* cq,
- std::function<BatchCallAllocation()> allocator)
- : AllocatingRequestMatcherBase(server, cq),
- allocator_(std::move(allocator)) {}
-
- void MatchOrQueue(size_t /*start_request_queue_index*/,
- CallData* calld) override {
- BatchCallAllocation call_info = allocator_();
- GPR_ASSERT(server()->ValidateServerRequest(
- cq(), static_cast<void*>(call_info.tag), nullptr, nullptr) ==
- GRPC_CALL_OK);
- RequestedCall* rc = new RequestedCall(
- static_cast<void*>(call_info.tag), cq(), call_info.call,
- call_info.initial_metadata, call_info.details);
- calld->SetState(CallData::CallState::ACTIVATED);
- calld->Publish(cq_idx(), rc);
- }
-
- private:
- std::function<BatchCallAllocation()> allocator_;
-};
-
-// An allocating request matcher for registered methods.
-class Server::AllocatingRequestMatcherRegistered
- : public AllocatingRequestMatcherBase {
- public:
- AllocatingRequestMatcherRegistered(
- Server* server, grpc_completion_queue* cq, RegisteredMethod* rm,
- std::function<RegisteredCallAllocation()> allocator)
- : AllocatingRequestMatcherBase(server, cq),
- registered_method_(rm),
- allocator_(std::move(allocator)) {}
-
- void MatchOrQueue(size_t /*start_request_queue_index*/,
- CallData* calld) override {
- RegisteredCallAllocation call_info = allocator_();
- GPR_ASSERT(
- server()->ValidateServerRequest(cq(), static_cast<void*>(call_info.tag),
- call_info.optional_payload,
- registered_method_) == GRPC_CALL_OK);
- RequestedCall* rc = new RequestedCall(
- static_cast<void*>(call_info.tag), cq(), call_info.call,
- call_info.initial_metadata, registered_method_, call_info.deadline,
- call_info.optional_payload);
- calld->SetState(CallData::CallState::ACTIVATED);
- calld->Publish(cq_idx(), rc);
- }
-
- private:
- RegisteredMethod* const registered_method_;
- std::function<RegisteredCallAllocation()> allocator_;
-};
-
-//
-// ChannelBroadcaster
-//
-
-namespace {
-
-class ChannelBroadcaster {
- public:
- // This can have an empty constructor and destructor since we want to control
- // when the actual setup and shutdown broadcast take place.
-
- // Copies over the channels from the locked server.
- void FillChannelsLocked(std::vector<grpc_channel*> channels) {
- GPR_DEBUG_ASSERT(channels_.empty());
- channels_ = std::move(channels);
- }
-
- // Broadcasts a shutdown on each channel.
- void BroadcastShutdown(bool send_goaway, grpc_error* force_disconnect) {
- for (grpc_channel* channel : channels_) {
- SendShutdown(channel, send_goaway, GRPC_ERROR_REF(force_disconnect));
- GRPC_CHANNEL_INTERNAL_UNREF(channel, "broadcast");
- }
- channels_.clear(); // just for safety against double broadcast
- GRPC_ERROR_UNREF(force_disconnect);
- }
-
- private:
- struct ShutdownCleanupArgs {
- grpc_closure closure;
- grpc_slice slice;
- };
-
- static void ShutdownCleanup(void* arg, grpc_error* /*error*/) {
- ShutdownCleanupArgs* a = static_cast<ShutdownCleanupArgs*>(arg);
- grpc_slice_unref_internal(a->slice);
- delete a;
- }
-
- static void SendShutdown(grpc_channel* channel, bool send_goaway,
- grpc_error* send_disconnect) {
- ShutdownCleanupArgs* sc = new ShutdownCleanupArgs;
- GRPC_CLOSURE_INIT(&sc->closure, ShutdownCleanup, sc,
- grpc_schedule_on_exec_ctx);
- grpc_transport_op* op = grpc_make_transport_op(&sc->closure);
- grpc_channel_element* elem;
- op->goaway_error =
- send_goaway
- ? grpc_error_set_int(
- GRPC_ERROR_CREATE_FROM_STATIC_STRING("Server shutdown"),
- GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_OK)
- : GRPC_ERROR_NONE;
- op->set_accept_stream = true;
- sc->slice = grpc_slice_from_copied_string("Server shutdown");
- op->disconnect_with_error = send_disconnect;
- elem =
- grpc_channel_stack_element(grpc_channel_get_channel_stack(channel), 0);
- elem->filter->start_transport_op(elem, op);
- }
-
- std::vector<grpc_channel*> channels_;
-};
-
-} // namespace
-
-//
-// Server
-//
-
-const grpc_channel_filter Server::kServerTopFilter = {
- Server::CallData::StartTransportStreamOpBatch,
- grpc_channel_next_op,
- sizeof(Server::CallData),
- Server::CallData::InitCallElement,
- grpc_call_stack_ignore_set_pollset_or_pollset_set,
- Server::CallData::DestroyCallElement,
- sizeof(Server::ChannelData),
- Server::ChannelData::InitChannelElement,
- Server::ChannelData::DestroyChannelElement,
- grpc_channel_next_get_info,
- "server",
-};
-
-namespace {
-
-grpc_resource_user* CreateDefaultResourceUser(const grpc_channel_args* args) {
- if (args != nullptr) {
- grpc_resource_quota* resource_quota =
- grpc_resource_quota_from_channel_args(args, false /* create */);
- if (resource_quota != nullptr) {
- return grpc_resource_user_create(resource_quota, "default");
- }
- }
- return nullptr;
+void Server::SetupTransport(
+ grpc_transport* transport, grpc_pollset* accepting_pollset,
+ const grpc_channel_args* args,
+ const RefCountedPtr<grpc_core::channelz::SocketNode>& socket_node,
+ grpc_resource_user* resource_user) {
+ // Create channel.
+ grpc_channel* channel = grpc_channel_create(
+ nullptr, args, GRPC_SERVER_CHANNEL, transport, resource_user);
+ ChannelData* chand = static_cast<ChannelData*>(
+ grpc_channel_stack_element(grpc_channel_get_channel_stack(channel), 0)
+ ->channel_data);
+ // Set up CQs.
+ size_t cq_idx;
+ for (cq_idx = 0; cq_idx < cqs_.size(); cq_idx++) {
+ if (grpc_cq_pollset(cqs_[cq_idx]) == accepting_pollset) break;
+ }
+ if (cq_idx == cqs_.size()) {
+ // Completion queue not found. Pick a random one to publish new calls to.
+ cq_idx = static_cast<size_t>(rand()) % cqs_.size();
+ }
+ // Set up channelz node.
+ intptr_t channelz_socket_uuid = 0;
+ if (socket_node != nullptr) {
+ channelz_socket_uuid = socket_node->uuid();
+ channelz_node_->AddChildSocket(socket_node);
+ }
+ // Initialize chand.
+ chand->InitTransport(Ref(), channel, cq_idx, transport, channelz_socket_uuid);
}
-RefCountedPtr<channelz::ServerNode> CreateChannelzNode(
- Server* server, const grpc_channel_args* args) {
- RefCountedPtr<channelz::ServerNode> channelz_node;
- if (grpc_channel_args_find_bool(args, GRPC_ARG_ENABLE_CHANNELZ,
- GRPC_ENABLE_CHANNELZ_DEFAULT)) {
- size_t channel_tracer_max_memory = grpc_channel_args_find_integer(
- args, GRPC_ARG_MAX_CHANNEL_TRACE_EVENT_MEMORY_PER_NODE,
- {GRPC_MAX_CHANNEL_TRACE_EVENT_MEMORY_PER_NODE_DEFAULT, 0, INT_MAX});
- channelz_node =
- MakeRefCounted<channelz::ServerNode>(channel_tracer_max_memory);
- channelz_node->AddTraceEvent(
- channelz::ChannelTrace::Severity::Info,
- grpc_slice_from_static_string("Server created"));
- }
- return channelz_node;
+bool Server::HasOpenConnections() {
+ MutexLock lock(&mu_global_);
+ return !channels_.empty();
}
-} // namespace
-
-Server::Server(const grpc_channel_args* args)
- : channel_args_(grpc_channel_args_copy(args)),
- default_resource_user_(CreateDefaultResourceUser(args)),
- channelz_node_(CreateChannelzNode(this, args)) {}
-
-Server::~Server() {
- grpc_channel_args_destroy(channel_args_);
- for (size_t i = 0; i < cqs_.size(); i++) {
- GRPC_CQ_INTERNAL_UNREF(cqs_[i], "server");
- }
+void Server::SetRegisteredMethodAllocator(
+ grpc_completion_queue* cq, void* method_tag,
+ std::function<RegisteredCallAllocation()> allocator) {
+ RegisteredMethod* rm = static_cast<RegisteredMethod*>(method_tag);
+ rm->matcher = y_absl::make_unique<AllocatingRequestMatcherRegistered>(
+ this, cq, rm, std::move(allocator));
}
-void Server::AddListener(OrphanablePtr<ListenerInterface> listener) {
- channelz::ListenSocketNode* listen_socket_node =
- listener->channelz_listen_socket_node();
- if (listen_socket_node != nullptr && channelz_node_ != nullptr) {
- channelz_node_->AddChildListenSocket(listen_socket_node->Ref());
- }
- listeners_.emplace_back(std::move(listener));
+void Server::SetBatchMethodAllocator(
+ grpc_completion_queue* cq, std::function<BatchCallAllocation()> allocator) {
+ GPR_DEBUG_ASSERT(unregistered_request_matcher_ == nullptr);
+ unregistered_request_matcher_ =
+ y_absl::make_unique<AllocatingRequestMatcherBatch>(this, cq,
+ std::move(allocator));
}
-void Server::Start() {
- started_ = true;
- for (grpc_completion_queue* cq : cqs_) {
- if (grpc_cq_can_listen(cq)) {
- pollsets_.push_back(grpc_cq_pollset(cq));
- }
- }
- if (unregistered_request_matcher_ == nullptr) {
- unregistered_request_matcher_ = y_absl::make_unique<RealRequestMatcher>(this);
- }
- for (std::unique_ptr<RegisteredMethod>& rm : registered_methods_) {
- if (rm->matcher == nullptr) {
- rm->matcher = y_absl::make_unique<RealRequestMatcher>(this);
- }
- }
- {
- MutexLock lock(&mu_global_);
- starting_ = true;
- }
- for (auto& listener : listeners_) {
- listener.listener->Start(this, &pollsets_);
- }
- MutexLock lock(&mu_global_);
- starting_ = false;
- starting_cv_.Signal();
-}
-
-void Server::SetupTransport(
- grpc_transport* transport, grpc_pollset* accepting_pollset,
- const grpc_channel_args* args,
- const RefCountedPtr<grpc_core::channelz::SocketNode>& socket_node,
- grpc_resource_user* resource_user) {
- // Create channel.
- grpc_channel* channel = grpc_channel_create(
- nullptr, args, GRPC_SERVER_CHANNEL, transport, resource_user);
- ChannelData* chand = static_cast<ChannelData*>(
- grpc_channel_stack_element(grpc_channel_get_channel_stack(channel), 0)
- ->channel_data);
- // Set up CQs.
- size_t cq_idx;
- for (cq_idx = 0; cq_idx < cqs_.size(); cq_idx++) {
- if (grpc_cq_pollset(cqs_[cq_idx]) == accepting_pollset) break;
- }
- if (cq_idx == cqs_.size()) {
- // Completion queue not found. Pick a random one to publish new calls to.
- cq_idx = static_cast<size_t>(rand()) % cqs_.size();
- }
- // Set up channelz node.
- intptr_t channelz_socket_uuid = 0;
- if (socket_node != nullptr) {
- channelz_socket_uuid = socket_node->uuid();
- channelz_node_->AddChildSocket(socket_node);
- }
- // Initialize chand.
- chand->InitTransport(Ref(), channel, cq_idx, transport, channelz_socket_uuid);
-}
-
-bool Server::HasOpenConnections() {
- MutexLock lock(&mu_global_);
- return !channels_.empty();
+void Server::RegisterCompletionQueue(grpc_completion_queue* cq) {
+ for (grpc_completion_queue* queue : cqs_) {
+ if (queue == cq) return;
+ }
+ GRPC_CQ_INTERNAL_REF(cq, "server");
+ cqs_.push_back(cq);
}
-void Server::SetRegisteredMethodAllocator(
- grpc_completion_queue* cq, void* method_tag,
- std::function<RegisteredCallAllocation()> allocator) {
- RegisteredMethod* rm = static_cast<RegisteredMethod*>(method_tag);
- rm->matcher = y_absl::make_unique<AllocatingRequestMatcherRegistered>(
- this, cq, rm, std::move(allocator));
+namespace {
+
+bool streq(const TString& a, const char* b) {
+ return (a.empty() && b == nullptr) ||
+ ((b != nullptr) && !strcmp(a.c_str(), b));
}
-void Server::SetBatchMethodAllocator(
- grpc_completion_queue* cq, std::function<BatchCallAllocation()> allocator) {
- GPR_DEBUG_ASSERT(unregistered_request_matcher_ == nullptr);
- unregistered_request_matcher_ =
- y_absl::make_unique<AllocatingRequestMatcherBatch>(this, cq,
- std::move(allocator));
-}
-
-void Server::RegisterCompletionQueue(grpc_completion_queue* cq) {
- for (grpc_completion_queue* queue : cqs_) {
- if (queue == cq) return;
- }
- GRPC_CQ_INTERNAL_REF(cq, "server");
- cqs_.push_back(cq);
-}
-
-namespace {
-
-bool streq(const TString& a, const char* b) {
- return (a.empty() && b == nullptr) ||
- ((b != nullptr) && !strcmp(a.c_str(), b));
+} // namespace
+
+Server::RegisteredMethod* Server::RegisterMethod(
+ const char* method, const char* host,
+ grpc_server_register_method_payload_handling payload_handling,
+ uint32_t flags) {
+ if (!method) {
+ gpr_log(GPR_ERROR,
+ "grpc_server_register_method method string cannot be NULL");
+ return nullptr;
+ }
+ for (std::unique_ptr<RegisteredMethod>& m : registered_methods_) {
+ if (streq(m->method, method) && streq(m->host, host)) {
+ gpr_log(GPR_ERROR, "duplicate registration for %s@%s", method,
+ host ? host : "*");
+ return nullptr;
+ }
+ }
+ if ((flags & ~GRPC_INITIAL_METADATA_USED_MASK) != 0) {
+ gpr_log(GPR_ERROR, "grpc_server_register_method invalid flags 0x%08x",
+ flags);
+ return nullptr;
+ }
+ registered_methods_.emplace_back(y_absl::make_unique<RegisteredMethod>(
+ method, host, payload_handling, flags));
+ return registered_methods_.back().get();
+}
+
+void Server::DoneRequestEvent(void* req, grpc_cq_completion* /*c*/) {
+ delete static_cast<RequestedCall*>(req);
}
-} // namespace
-
-Server::RegisteredMethod* Server::RegisterMethod(
- const char* method, const char* host,
- grpc_server_register_method_payload_handling payload_handling,
- uint32_t flags) {
- if (!method) {
- gpr_log(GPR_ERROR,
- "grpc_server_register_method method string cannot be NULL");
- return nullptr;
- }
- for (std::unique_ptr<RegisteredMethod>& m : registered_methods_) {
- if (streq(m->method, method) && streq(m->host, host)) {
- gpr_log(GPR_ERROR, "duplicate registration for %s@%s", method,
- host ? host : "*");
- return nullptr;
- }
- }
- if ((flags & ~GRPC_INITIAL_METADATA_USED_MASK) != 0) {
- gpr_log(GPR_ERROR, "grpc_server_register_method invalid flags 0x%08x",
- flags);
- return nullptr;
- }
- registered_methods_.emplace_back(y_absl::make_unique<RegisteredMethod>(
- method, host, payload_handling, flags));
- return registered_methods_.back().get();
-}
-
-void Server::DoneRequestEvent(void* req, grpc_cq_completion* /*c*/) {
- delete static_cast<RequestedCall*>(req);
+void Server::FailCall(size_t cq_idx, RequestedCall* rc, grpc_error* error) {
+ *rc->call = nullptr;
+ rc->initial_metadata->count = 0;
+ GPR_ASSERT(error != GRPC_ERROR_NONE);
+ grpc_cq_end_op(cqs_[cq_idx], rc->tag, error, DoneRequestEvent, rc,
+ &rc->completion);
}
-void Server::FailCall(size_t cq_idx, RequestedCall* rc, grpc_error* error) {
- *rc->call = nullptr;
- rc->initial_metadata->count = 0;
- GPR_ASSERT(error != GRPC_ERROR_NONE);
- grpc_cq_end_op(cqs_[cq_idx], rc->tag, error, DoneRequestEvent, rc,
- &rc->completion);
-}
-
-// Before calling MaybeFinishShutdown(), we must hold mu_global_ and not
-// hold mu_call_.
-void Server::MaybeFinishShutdown() {
- if (!shutdown_flag_.load(std::memory_order_acquire) || shutdown_published_) {
+// Before calling MaybeFinishShutdown(), we must hold mu_global_ and not
+// hold mu_call_.
+void Server::MaybeFinishShutdown() {
+ if (!shutdown_flag_.load(std::memory_order_acquire) || shutdown_published_) {
return;
}
- {
- MutexLock lock(&mu_call_);
- KillPendingWorkLocked(
- GRPC_ERROR_CREATE_FROM_STATIC_STRING("Server Shutdown"));
- }
- if (!channels_.empty() || listeners_destroyed_ < listeners_.size()) {
- if (gpr_time_cmp(gpr_time_sub(gpr_now(GPR_CLOCK_REALTIME),
- last_shutdown_message_time_),
- gpr_time_from_seconds(1, GPR_TIMESPAN)) >= 0) {
- last_shutdown_message_time_ = gpr_now(GPR_CLOCK_REALTIME);
- gpr_log(GPR_DEBUG,
- "Waiting for %" PRIuPTR " channels and %" PRIuPTR "/%" PRIuPTR
- " listeners to be destroyed before shutting down server",
- channels_.size(), listeners_.size() - listeners_destroyed_,
- listeners_.size());
- }
- return;
- }
- shutdown_published_ = true;
- for (auto& shutdown_tag : shutdown_tags_) {
- Ref().release();
- grpc_cq_end_op(shutdown_tag.cq, shutdown_tag.tag, GRPC_ERROR_NONE,
- DoneShutdownEvent, this, &shutdown_tag.completion);
- }
-}
-
-void Server::KillPendingWorkLocked(grpc_error* error) {
- if (started_) {
- unregistered_request_matcher_->KillRequests(GRPC_ERROR_REF(error));
- unregistered_request_matcher_->ZombifyPending();
- for (std::unique_ptr<RegisteredMethod>& rm : registered_methods_) {
- rm->matcher->KillRequests(GRPC_ERROR_REF(error));
- rm->matcher->ZombifyPending();
+ {
+ MutexLock lock(&mu_call_);
+ KillPendingWorkLocked(
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("Server Shutdown"));
+ }
+ if (!channels_.empty() || listeners_destroyed_ < listeners_.size()) {
+ if (gpr_time_cmp(gpr_time_sub(gpr_now(GPR_CLOCK_REALTIME),
+ last_shutdown_message_time_),
+ gpr_time_from_seconds(1, GPR_TIMESPAN)) >= 0) {
+ last_shutdown_message_time_ = gpr_now(GPR_CLOCK_REALTIME);
+ gpr_log(GPR_DEBUG,
+ "Waiting for %" PRIuPTR " channels and %" PRIuPTR "/%" PRIuPTR
+ " listeners to be destroyed before shutting down server",
+ channels_.size(), listeners_.size() - listeners_destroyed_,
+ listeners_.size());
+ }
+ return;
+ }
+ shutdown_published_ = true;
+ for (auto& shutdown_tag : shutdown_tags_) {
+ Ref().release();
+ grpc_cq_end_op(shutdown_tag.cq, shutdown_tag.tag, GRPC_ERROR_NONE,
+ DoneShutdownEvent, this, &shutdown_tag.completion);
+ }
+}
+
+void Server::KillPendingWorkLocked(grpc_error* error) {
+ if (started_) {
+ unregistered_request_matcher_->KillRequests(GRPC_ERROR_REF(error));
+ unregistered_request_matcher_->ZombifyPending();
+ for (std::unique_ptr<RegisteredMethod>& rm : registered_methods_) {
+ rm->matcher->KillRequests(GRPC_ERROR_REF(error));
+ rm->matcher->ZombifyPending();
}
}
- GRPC_ERROR_UNREF(error);
+ GRPC_ERROR_UNREF(error);
+}
+
+std::vector<grpc_channel*> Server::GetChannelsLocked() const {
+ std::vector<grpc_channel*> channels;
+ channels.reserve(channels_.size());
+ for (const ChannelData* chand : channels_) {
+ channels.push_back(chand->channel());
+ GRPC_CHANNEL_INTERNAL_REF(chand->channel(), "broadcast");
+ }
+ return channels;
}
-std::vector<grpc_channel*> Server::GetChannelsLocked() const {
- std::vector<grpc_channel*> channels;
- channels.reserve(channels_.size());
- for (const ChannelData* chand : channels_) {
- channels.push_back(chand->channel());
- GRPC_CHANNEL_INTERNAL_REF(chand->channel(), "broadcast");
- }
- return channels;
-}
-
-void Server::ListenerDestroyDone(void* arg, grpc_error* /*error*/) {
- Server* server = static_cast<Server*>(arg);
- MutexLock lock(&server->mu_global_);
- server->listeners_destroyed_++;
- server->MaybeFinishShutdown();
-}
-
-namespace {
-
-void DonePublishedShutdown(void* /*done_arg*/, grpc_cq_completion* storage) {
- delete storage;
-}
-
-} // namespace
-
-// - Kills all pending requests-for-incoming-RPC-calls (i.e., the requests made
-// via grpc_server_request_call() and grpc_server_request_registered_call()
-// will now be cancelled). See KillPendingWorkLocked().
-//
-// - Shuts down the listeners (i.e., the server will no longer listen on the
-// port for new incoming channels).
-//
-// - Iterates through all channels on the server and sends shutdown msg (see
-// ChannelBroadcaster::BroadcastShutdown() for details) to the clients via
-// the transport layer. The transport layer then guarantees the following:
-// -- Sends shutdown to the client (e.g., HTTP2 transport sends GOAWAY).
-// -- If the server has outstanding calls that are in the process, the
-// connection is NOT closed until the server is done with all those calls.
-// -- Once there are no more calls in progress, the channel is closed.
-void Server::ShutdownAndNotify(grpc_completion_queue* cq, void* tag) {
- ChannelBroadcaster broadcaster;
- {
- // Wait for startup to be finished. Locks mu_global.
- MutexLock lock(&mu_global_);
- starting_cv_.WaitUntil(&mu_global_, [this] { return !starting_; });
- // Stay locked, and gather up some stuff to do.
- GPR_ASSERT(grpc_cq_begin_op(cq, tag));
- if (shutdown_published_) {
- grpc_cq_end_op(cq, tag, GRPC_ERROR_NONE, DonePublishedShutdown, nullptr,
- new grpc_cq_completion);
+void Server::ListenerDestroyDone(void* arg, grpc_error* /*error*/) {
+ Server* server = static_cast<Server*>(arg);
+ MutexLock lock(&server->mu_global_);
+ server->listeners_destroyed_++;
+ server->MaybeFinishShutdown();
+}
+
+namespace {
+
+void DonePublishedShutdown(void* /*done_arg*/, grpc_cq_completion* storage) {
+ delete storage;
+}
+
+} // namespace
+
+// - Kills all pending requests-for-incoming-RPC-calls (i.e., the requests made
+// via grpc_server_request_call() and grpc_server_request_registered_call()
+// will now be cancelled). See KillPendingWorkLocked().
+//
+// - Shuts down the listeners (i.e., the server will no longer listen on the
+// port for new incoming channels).
+//
+// - Iterates through all channels on the server and sends shutdown msg (see
+// ChannelBroadcaster::BroadcastShutdown() for details) to the clients via
+// the transport layer. The transport layer then guarantees the following:
+// -- Sends shutdown to the client (e.g., HTTP2 transport sends GOAWAY).
+// -- If the server has outstanding calls that are in the process, the
+// connection is NOT closed until the server is done with all those calls.
+// -- Once there are no more calls in progress, the channel is closed.
+void Server::ShutdownAndNotify(grpc_completion_queue* cq, void* tag) {
+ ChannelBroadcaster broadcaster;
+ {
+ // Wait for startup to be finished. Locks mu_global.
+ MutexLock lock(&mu_global_);
+ starting_cv_.WaitUntil(&mu_global_, [this] { return !starting_; });
+ // Stay locked, and gather up some stuff to do.
+ GPR_ASSERT(grpc_cq_begin_op(cq, tag));
+ if (shutdown_published_) {
+ grpc_cq_end_op(cq, tag, GRPC_ERROR_NONE, DonePublishedShutdown, nullptr,
+ new grpc_cq_completion);
return;
}
- shutdown_tags_.emplace_back(tag, cq);
- if (shutdown_flag_.load(std::memory_order_acquire)) {
+ shutdown_tags_.emplace_back(tag, cq);
+ if (shutdown_flag_.load(std::memory_order_acquire)) {
return;
}
- last_shutdown_message_time_ = gpr_now(GPR_CLOCK_REALTIME);
- broadcaster.FillChannelsLocked(GetChannelsLocked());
- shutdown_flag_.store(true, std::memory_order_release);
- // Collect all unregistered then registered calls.
- {
- MutexLock lock(&mu_call_);
- KillPendingWorkLocked(
- GRPC_ERROR_CREATE_FROM_STATIC_STRING("Server Shutdown"));
- }
- MaybeFinishShutdown();
- }
- // Shutdown listeners.
- for (auto& listener : listeners_) {
- channelz::ListenSocketNode* channelz_listen_socket_node =
- listener.listener->channelz_listen_socket_node();
- if (channelz_node_ != nullptr && channelz_listen_socket_node != nullptr) {
- channelz_node_->RemoveChildListenSocket(
- channelz_listen_socket_node->uuid());
- }
- GRPC_CLOSURE_INIT(&listener.destroy_done, ListenerDestroyDone, this,
- grpc_schedule_on_exec_ctx);
- listener.listener->SetOnDestroyDone(&listener.destroy_done);
- listener.listener.reset();
- }
- broadcaster.BroadcastShutdown(/*send_goaway=*/true, GRPC_ERROR_NONE);
+ last_shutdown_message_time_ = gpr_now(GPR_CLOCK_REALTIME);
+ broadcaster.FillChannelsLocked(GetChannelsLocked());
+ shutdown_flag_.store(true, std::memory_order_release);
+ // Collect all unregistered then registered calls.
+ {
+ MutexLock lock(&mu_call_);
+ KillPendingWorkLocked(
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("Server Shutdown"));
+ }
+ MaybeFinishShutdown();
+ }
+ // Shutdown listeners.
+ for (auto& listener : listeners_) {
+ channelz::ListenSocketNode* channelz_listen_socket_node =
+ listener.listener->channelz_listen_socket_node();
+ if (channelz_node_ != nullptr && channelz_listen_socket_node != nullptr) {
+ channelz_node_->RemoveChildListenSocket(
+ channelz_listen_socket_node->uuid());
+ }
+ GRPC_CLOSURE_INIT(&listener.destroy_done, ListenerDestroyDone, this,
+ grpc_schedule_on_exec_ctx);
+ listener.listener->SetOnDestroyDone(&listener.destroy_done);
+ listener.listener.reset();
+ }
+ broadcaster.BroadcastShutdown(/*send_goaway=*/true, GRPC_ERROR_NONE);
}
-void Server::CancelAllCalls() {
- ChannelBroadcaster broadcaster;
- {
- MutexLock lock(&mu_global_);
- broadcaster.FillChannelsLocked(GetChannelsLocked());
+void Server::CancelAllCalls() {
+ ChannelBroadcaster broadcaster;
+ {
+ MutexLock lock(&mu_global_);
+ broadcaster.FillChannelsLocked(GetChannelsLocked());
}
- broadcaster.BroadcastShutdown(
- /*send_goaway=*/false,
- GRPC_ERROR_CREATE_FROM_STATIC_STRING("Cancelling all calls"));
+ broadcaster.BroadcastShutdown(
+ /*send_goaway=*/false,
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("Cancelling all calls"));
}
-void Server::Orphan() {
- {
- MutexLock lock(&mu_global_);
- GPR_ASSERT(shutdown_flag_.load(std::memory_order_acquire) ||
- listeners_.empty());
- GPR_ASSERT(listeners_destroyed_ == listeners_.size());
- }
- if (default_resource_user_ != nullptr) {
- grpc_resource_quota_unref(grpc_resource_user_quota(default_resource_user_));
- grpc_resource_user_shutdown(default_resource_user_);
- grpc_resource_user_unref(default_resource_user_);
- }
- Unref();
+void Server::Orphan() {
+ {
+ MutexLock lock(&mu_global_);
+ GPR_ASSERT(shutdown_flag_.load(std::memory_order_acquire) ||
+ listeners_.empty());
+ GPR_ASSERT(listeners_destroyed_ == listeners_.size());
+ }
+ if (default_resource_user_ != nullptr) {
+ grpc_resource_quota_unref(grpc_resource_user_quota(default_resource_user_));
+ grpc_resource_user_shutdown(default_resource_user_);
+ grpc_resource_user_unref(default_resource_user_);
+ }
+ Unref();
}
-grpc_call_error Server::ValidateServerRequest(
- grpc_completion_queue* cq_for_notification, void* tag,
- grpc_byte_buffer** optional_payload, RegisteredMethod* rm) {
- if ((rm == nullptr && optional_payload != nullptr) ||
- ((rm != nullptr) && ((optional_payload == nullptr) !=
- (rm->payload_handling == GRPC_SRM_PAYLOAD_NONE)))) {
- return GRPC_CALL_ERROR_PAYLOAD_TYPE_MISMATCH;
- }
- if (grpc_cq_begin_op(cq_for_notification, tag) == false) {
- return GRPC_CALL_ERROR_COMPLETION_QUEUE_SHUTDOWN;
- }
- return GRPC_CALL_OK;
+grpc_call_error Server::ValidateServerRequest(
+ grpc_completion_queue* cq_for_notification, void* tag,
+ grpc_byte_buffer** optional_payload, RegisteredMethod* rm) {
+ if ((rm == nullptr && optional_payload != nullptr) ||
+ ((rm != nullptr) && ((optional_payload == nullptr) !=
+ (rm->payload_handling == GRPC_SRM_PAYLOAD_NONE)))) {
+ return GRPC_CALL_ERROR_PAYLOAD_TYPE_MISMATCH;
+ }
+ if (grpc_cq_begin_op(cq_for_notification, tag) == false) {
+ return GRPC_CALL_ERROR_COMPLETION_QUEUE_SHUTDOWN;
+ }
+ return GRPC_CALL_OK;
}
-grpc_call_error Server::ValidateServerRequestAndCq(
- size_t* cq_idx, grpc_completion_queue* cq_for_notification, void* tag,
- grpc_byte_buffer** optional_payload, RegisteredMethod* rm) {
- size_t idx;
- for (idx = 0; idx < cqs_.size(); idx++) {
- if (cqs_[idx] == cq_for_notification) {
- break;
+grpc_call_error Server::ValidateServerRequestAndCq(
+ size_t* cq_idx, grpc_completion_queue* cq_for_notification, void* tag,
+ grpc_byte_buffer** optional_payload, RegisteredMethod* rm) {
+ size_t idx;
+ for (idx = 0; idx < cqs_.size(); idx++) {
+ if (cqs_[idx] == cq_for_notification) {
+ break;
}
}
- if (idx == cqs_.size()) {
- return GRPC_CALL_ERROR_NOT_SERVER_COMPLETION_QUEUE;
- }
- grpc_call_error error =
- ValidateServerRequest(cq_for_notification, tag, optional_payload, rm);
- if (error != GRPC_CALL_OK) {
- return error;
- }
- *cq_idx = idx;
- return GRPC_CALL_OK;
+ if (idx == cqs_.size()) {
+ return GRPC_CALL_ERROR_NOT_SERVER_COMPLETION_QUEUE;
+ }
+ grpc_call_error error =
+ ValidateServerRequest(cq_for_notification, tag, optional_payload, rm);
+ if (error != GRPC_CALL_OK) {
+ return error;
+ }
+ *cq_idx = idx;
+ return GRPC_CALL_OK;
+}
+
+grpc_call_error Server::QueueRequestedCall(size_t cq_idx, RequestedCall* rc) {
+ if (shutdown_flag_.load(std::memory_order_acquire)) {
+ FailCall(cq_idx, rc,
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("Server Shutdown"));
+ return GRPC_CALL_OK;
+ }
+ RequestMatcherInterface* rm;
+ switch (rc->type) {
+ case RequestedCall::Type::BATCH_CALL:
+ rm = unregistered_request_matcher_.get();
+ break;
+ case RequestedCall::Type::REGISTERED_CALL:
+ rm = rc->data.registered.method->matcher.get();
+ break;
+ }
+ rm->RequestCallWithPossiblePublish(cq_idx, rc);
+ return GRPC_CALL_OK;
}
-grpc_call_error Server::QueueRequestedCall(size_t cq_idx, RequestedCall* rc) {
- if (shutdown_flag_.load(std::memory_order_acquire)) {
- FailCall(cq_idx, rc,
- GRPC_ERROR_CREATE_FROM_STATIC_STRING("Server Shutdown"));
- return GRPC_CALL_OK;
- }
- RequestMatcherInterface* rm;
- switch (rc->type) {
- case RequestedCall::Type::BATCH_CALL:
- rm = unregistered_request_matcher_.get();
- break;
- case RequestedCall::Type::REGISTERED_CALL:
- rm = rc->data.registered.method->matcher.get();
- break;
- }
- rm->RequestCallWithPossiblePublish(cq_idx, rc);
- return GRPC_CALL_OK;
-}
-
-grpc_call_error Server::RequestCall(grpc_call** call,
- grpc_call_details* details,
- grpc_metadata_array* request_metadata,
- grpc_completion_queue* cq_bound_to_call,
- grpc_completion_queue* cq_for_notification,
- void* tag) {
- size_t cq_idx;
- grpc_call_error error = ValidateServerRequestAndCq(
- &cq_idx, cq_for_notification, tag, nullptr, nullptr);
- if (error != GRPC_CALL_OK) {
- return error;
- }
- RequestedCall* rc =
- new RequestedCall(tag, cq_bound_to_call, call, request_metadata, details);
- return QueueRequestedCall(cq_idx, rc);
-}
-
-grpc_call_error Server::RequestRegisteredCall(
- RegisteredMethod* rm, grpc_call** call, gpr_timespec* deadline,
- grpc_metadata_array* request_metadata, grpc_byte_buffer** optional_payload,
- grpc_completion_queue* cq_bound_to_call,
- grpc_completion_queue* cq_for_notification, void* tag_new) {
- size_t cq_idx;
- grpc_call_error error = ValidateServerRequestAndCq(
- &cq_idx, cq_for_notification, tag_new, optional_payload, rm);
- if (error != GRPC_CALL_OK) {
- return error;
- }
- RequestedCall* rc =
- new RequestedCall(tag_new, cq_bound_to_call, call, request_metadata, rm,
- deadline, optional_payload);
- return QueueRequestedCall(cq_idx, rc);
+grpc_call_error Server::RequestCall(grpc_call** call,
+ grpc_call_details* details,
+ grpc_metadata_array* request_metadata,
+ grpc_completion_queue* cq_bound_to_call,
+ grpc_completion_queue* cq_for_notification,
+ void* tag) {
+ size_t cq_idx;
+ grpc_call_error error = ValidateServerRequestAndCq(
+ &cq_idx, cq_for_notification, tag, nullptr, nullptr);
+ if (error != GRPC_CALL_OK) {
+ return error;
+ }
+ RequestedCall* rc =
+ new RequestedCall(tag, cq_bound_to_call, call, request_metadata, details);
+ return QueueRequestedCall(cq_idx, rc);
}
-//
-// Server::ChannelData::ConnectivityWatcher
-//
-
-class Server::ChannelData::ConnectivityWatcher
- : public AsyncConnectivityStateWatcherInterface {
- public:
- explicit ConnectivityWatcher(ChannelData* chand) : chand_(chand) {
- GRPC_CHANNEL_INTERNAL_REF(chand_->channel_, "connectivity");
- }
-
- ~ConnectivityWatcher() {
- GRPC_CHANNEL_INTERNAL_UNREF(chand_->channel_, "connectivity");
- }
-
- private:
- void OnConnectivityStateChange(grpc_connectivity_state new_state,
- const y_absl::Status& /*status*/) override {
- // Don't do anything until we are being shut down.
- if (new_state != GRPC_CHANNEL_SHUTDOWN) return;
- // Shut down channel.
- MutexLock lock(&chand_->server_->mu_global_);
- chand_->Destroy();
- }
-
- ChannelData* chand_;
-};
-
-//
-// Server::ChannelData
-//
-
-Server::ChannelData::~ChannelData() {
- if (registered_methods_ != nullptr) {
- for (const ChannelRegisteredMethod& crm : *registered_methods_) {
- grpc_slice_unref_internal(crm.method);
- GPR_DEBUG_ASSERT(crm.method.refcount == &kNoopRefcount ||
- crm.method.refcount == nullptr);
- if (crm.has_host) {
- grpc_slice_unref_internal(crm.host);
- GPR_DEBUG_ASSERT(crm.host.refcount == &kNoopRefcount ||
- crm.host.refcount == nullptr);
- }
- }
- registered_methods_.reset();
- }
- if (server_ != nullptr) {
- if (server_->channelz_node_ != nullptr && channelz_socket_uuid_ != 0) {
- server_->channelz_node_->RemoveChildSocket(channelz_socket_uuid_);
- }
- {
- MutexLock lock(&server_->mu_global_);
- if (list_position_.has_value()) {
- server_->channels_.erase(*list_position_);
- list_position_.reset();
- }
- server_->MaybeFinishShutdown();
- }
+grpc_call_error Server::RequestRegisteredCall(
+ RegisteredMethod* rm, grpc_call** call, gpr_timespec* deadline,
+ grpc_metadata_array* request_metadata, grpc_byte_buffer** optional_payload,
+ grpc_completion_queue* cq_bound_to_call,
+ grpc_completion_queue* cq_for_notification, void* tag_new) {
+ size_t cq_idx;
+ grpc_call_error error = ValidateServerRequestAndCq(
+ &cq_idx, cq_for_notification, tag_new, optional_payload, rm);
+ if (error != GRPC_CALL_OK) {
+ return error;
+ }
+ RequestedCall* rc =
+ new RequestedCall(tag_new, cq_bound_to_call, call, request_metadata, rm,
+ deadline, optional_payload);
+ return QueueRequestedCall(cq_idx, rc);
+}
+
+//
+// Server::ChannelData::ConnectivityWatcher
+//
+
+class Server::ChannelData::ConnectivityWatcher
+ : public AsyncConnectivityStateWatcherInterface {
+ public:
+ explicit ConnectivityWatcher(ChannelData* chand) : chand_(chand) {
+ GRPC_CHANNEL_INTERNAL_REF(chand_->channel_, "connectivity");
+ }
+
+ ~ConnectivityWatcher() {
+ GRPC_CHANNEL_INTERNAL_UNREF(chand_->channel_, "connectivity");
+ }
+
+ private:
+ void OnConnectivityStateChange(grpc_connectivity_state new_state,
+ const y_absl::Status& /*status*/) override {
+ // Don't do anything until we are being shut down.
+ if (new_state != GRPC_CHANNEL_SHUTDOWN) return;
+ // Shut down channel.
+ MutexLock lock(&chand_->server_->mu_global_);
+ chand_->Destroy();
+ }
+
+ ChannelData* chand_;
+};
+
+//
+// Server::ChannelData
+//
+
+Server::ChannelData::~ChannelData() {
+ if (registered_methods_ != nullptr) {
+ for (const ChannelRegisteredMethod& crm : *registered_methods_) {
+ grpc_slice_unref_internal(crm.method);
+ GPR_DEBUG_ASSERT(crm.method.refcount == &kNoopRefcount ||
+ crm.method.refcount == nullptr);
+ if (crm.has_host) {
+ grpc_slice_unref_internal(crm.host);
+ GPR_DEBUG_ASSERT(crm.host.refcount == &kNoopRefcount ||
+ crm.host.refcount == nullptr);
+ }
+ }
+ registered_methods_.reset();
+ }
+ if (server_ != nullptr) {
+ if (server_->channelz_node_ != nullptr && channelz_socket_uuid_ != 0) {
+ server_->channelz_node_->RemoveChildSocket(channelz_socket_uuid_);
+ }
+ {
+ MutexLock lock(&server_->mu_global_);
+ if (list_position_.has_value()) {
+ server_->channels_.erase(*list_position_);
+ list_position_.reset();
+ }
+ server_->MaybeFinishShutdown();
+ }
}
}
-void Server::ChannelData::InitTransport(RefCountedPtr<Server> server,
- grpc_channel* channel, size_t cq_idx,
- grpc_transport* transport,
- intptr_t channelz_socket_uuid) {
- server_ = std::move(server);
- channel_ = channel;
- cq_idx_ = cq_idx;
- channelz_socket_uuid_ = channelz_socket_uuid;
- // Build a lookup table phrased in terms of mdstr's in this channels context
- // to quickly find registered methods.
- size_t num_registered_methods = server_->registered_methods_.size();
- if (num_registered_methods > 0) {
- uint32_t max_probes = 0;
- size_t slots = 2 * num_registered_methods;
- registered_methods_.reset(new std::vector<ChannelRegisteredMethod>(slots));
- for (std::unique_ptr<RegisteredMethod>& rm : server_->registered_methods_) {
- ExternallyManagedSlice host;
- ExternallyManagedSlice method(rm->method.c_str());
- const bool has_host = !rm->host.empty();
- if (has_host) {
- host = ExternallyManagedSlice(rm->host.c_str());
- }
- uint32_t hash =
- GRPC_MDSTR_KV_HASH(has_host ? host.Hash() : 0, method.Hash());
- uint32_t probes = 0;
- for (probes = 0; (*registered_methods_)[(hash + probes) % slots]
- .server_registered_method != nullptr;
- probes++) {
- }
- if (probes > max_probes) max_probes = probes;
- ChannelRegisteredMethod* crm =
- &(*registered_methods_)[(hash + probes) % slots];
- crm->server_registered_method = rm.get();
- crm->flags = rm->flags;
- crm->has_host = has_host;
- if (has_host) {
- crm->host = host;
- }
- crm->method = method;
- }
- GPR_ASSERT(slots <= UINT32_MAX);
- registered_method_max_probes_ = max_probes;
- }
- // Publish channel.
- {
- MutexLock lock(&server_->mu_global_);
- server_->channels_.push_front(this);
- list_position_ = server_->channels_.begin();
- }
- // Start accept_stream transport op.
- grpc_transport_op* op = grpc_make_transport_op(nullptr);
- op->set_accept_stream = true;
- op->set_accept_stream_fn = AcceptStream;
- op->set_accept_stream_user_data = this;
- op->start_connectivity_watch = MakeOrphanable<ConnectivityWatcher>(this);
- if (server_->shutdown_flag_.load(std::memory_order_acquire)) {
- op->disconnect_with_error =
- GRPC_ERROR_CREATE_FROM_STATIC_STRING("Server shutdown");
- }
- grpc_transport_perform_op(transport, op);
+void Server::ChannelData::InitTransport(RefCountedPtr<Server> server,
+ grpc_channel* channel, size_t cq_idx,
+ grpc_transport* transport,
+ intptr_t channelz_socket_uuid) {
+ server_ = std::move(server);
+ channel_ = channel;
+ cq_idx_ = cq_idx;
+ channelz_socket_uuid_ = channelz_socket_uuid;
+ // Build a lookup table phrased in terms of mdstr's in this channels context
+ // to quickly find registered methods.
+ size_t num_registered_methods = server_->registered_methods_.size();
+ if (num_registered_methods > 0) {
+ uint32_t max_probes = 0;
+ size_t slots = 2 * num_registered_methods;
+ registered_methods_.reset(new std::vector<ChannelRegisteredMethod>(slots));
+ for (std::unique_ptr<RegisteredMethod>& rm : server_->registered_methods_) {
+ ExternallyManagedSlice host;
+ ExternallyManagedSlice method(rm->method.c_str());
+ const bool has_host = !rm->host.empty();
+ if (has_host) {
+ host = ExternallyManagedSlice(rm->host.c_str());
+ }
+ uint32_t hash =
+ GRPC_MDSTR_KV_HASH(has_host ? host.Hash() : 0, method.Hash());
+ uint32_t probes = 0;
+ for (probes = 0; (*registered_methods_)[(hash + probes) % slots]
+ .server_registered_method != nullptr;
+ probes++) {
+ }
+ if (probes > max_probes) max_probes = probes;
+ ChannelRegisteredMethod* crm =
+ &(*registered_methods_)[(hash + probes) % slots];
+ crm->server_registered_method = rm.get();
+ crm->flags = rm->flags;
+ crm->has_host = has_host;
+ if (has_host) {
+ crm->host = host;
+ }
+ crm->method = method;
+ }
+ GPR_ASSERT(slots <= UINT32_MAX);
+ registered_method_max_probes_ = max_probes;
+ }
+ // Publish channel.
+ {
+ MutexLock lock(&server_->mu_global_);
+ server_->channels_.push_front(this);
+ list_position_ = server_->channels_.begin();
+ }
+ // Start accept_stream transport op.
+ grpc_transport_op* op = grpc_make_transport_op(nullptr);
+ op->set_accept_stream = true;
+ op->set_accept_stream_fn = AcceptStream;
+ op->set_accept_stream_user_data = this;
+ op->start_connectivity_watch = MakeOrphanable<ConnectivityWatcher>(this);
+ if (server_->shutdown_flag_.load(std::memory_order_acquire)) {
+ op->disconnect_with_error =
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("Server shutdown");
+ }
+ grpc_transport_perform_op(transport, op);
}
-Server::ChannelRegisteredMethod* Server::ChannelData::GetRegisteredMethod(
- const grpc_slice& host, const grpc_slice& path, bool is_idempotent) {
- if (registered_methods_ == nullptr) return nullptr;
- /* TODO(ctiller): unify these two searches */
- /* check for an exact match with host */
- uint32_t hash = GRPC_MDSTR_KV_HASH(grpc_slice_hash_internal(host),
- grpc_slice_hash_internal(path));
- for (size_t i = 0; i <= registered_method_max_probes_; i++) {
- ChannelRegisteredMethod* rm =
- &(*registered_methods_)[(hash + i) % registered_methods_->size()];
- if (rm->server_registered_method == nullptr) break;
- if (!rm->has_host) continue;
- if (rm->host != host) continue;
- if (rm->method != path) continue;
- if ((rm->flags & GRPC_INITIAL_METADATA_IDEMPOTENT_REQUEST) &&
- !is_idempotent) {
- continue;
+Server::ChannelRegisteredMethod* Server::ChannelData::GetRegisteredMethod(
+ const grpc_slice& host, const grpc_slice& path, bool is_idempotent) {
+ if (registered_methods_ == nullptr) return nullptr;
+ /* TODO(ctiller): unify these two searches */
+ /* check for an exact match with host */
+ uint32_t hash = GRPC_MDSTR_KV_HASH(grpc_slice_hash_internal(host),
+ grpc_slice_hash_internal(path));
+ for (size_t i = 0; i <= registered_method_max_probes_; i++) {
+ ChannelRegisteredMethod* rm =
+ &(*registered_methods_)[(hash + i) % registered_methods_->size()];
+ if (rm->server_registered_method == nullptr) break;
+ if (!rm->has_host) continue;
+ if (rm->host != host) continue;
+ if (rm->method != path) continue;
+ if ((rm->flags & GRPC_INITIAL_METADATA_IDEMPOTENT_REQUEST) &&
+ !is_idempotent) {
+ continue;
+ }
+ return rm;
+ }
+ /* check for a wildcard method definition (no host set) */
+ hash = GRPC_MDSTR_KV_HASH(0, grpc_slice_hash_internal(path));
+ for (size_t i = 0; i <= registered_method_max_probes_; i++) {
+ ChannelRegisteredMethod* rm =
+ &(*registered_methods_)[(hash + i) % registered_methods_->size()];
+ if (rm->server_registered_method == nullptr) break;
+ if (rm->has_host) continue;
+ if (rm->method != path) continue;
+ if ((rm->flags & GRPC_INITIAL_METADATA_IDEMPOTENT_REQUEST) &&
+ !is_idempotent) {
+ continue;
}
- return rm;
- }
- /* check for a wildcard method definition (no host set) */
- hash = GRPC_MDSTR_KV_HASH(0, grpc_slice_hash_internal(path));
- for (size_t i = 0; i <= registered_method_max_probes_; i++) {
- ChannelRegisteredMethod* rm =
- &(*registered_methods_)[(hash + i) % registered_methods_->size()];
- if (rm->server_registered_method == nullptr) break;
- if (rm->has_host) continue;
- if (rm->method != path) continue;
- if ((rm->flags & GRPC_INITIAL_METADATA_IDEMPOTENT_REQUEST) &&
- !is_idempotent) {
- continue;
- }
- return rm;
- }
- return nullptr;
+ return rm;
+ }
+ return nullptr;
}
-void Server::ChannelData::AcceptStream(void* arg, grpc_transport* /*transport*/,
- const void* transport_server_data) {
- auto* chand = static_cast<Server::ChannelData*>(arg);
+void Server::ChannelData::AcceptStream(void* arg, grpc_transport* /*transport*/,
+ const void* transport_server_data) {
+ auto* chand = static_cast<Server::ChannelData*>(arg);
/* create a call */
grpc_call_create_args args;
- args.channel = chand->channel_;
- args.server = chand->server_.get();
+ args.channel = chand->channel_;
+ args.server = chand->server_.get();
args.parent = nullptr;
args.propagation_mask = 0;
args.cq = nullptr;
@@ -1104,361 +1104,361 @@ void Server::ChannelData::AcceptStream(void* arg, grpc_transport* /*transport*/,
grpc_error* error = grpc_call_create(&args, &call);
grpc_call_element* elem =
grpc_call_stack_element(grpc_call_get_call_stack(call), 0);
- auto* calld = static_cast<Server::CallData*>(elem->call_data);
+ auto* calld = static_cast<Server::CallData*>(elem->call_data);
if (error != GRPC_ERROR_NONE) {
GRPC_ERROR_UNREF(error);
- calld->FailCallCreation();
+ calld->FailCallCreation();
return;
}
- calld->Start(elem);
+ calld->Start(elem);
}
-void Server::ChannelData::FinishDestroy(void* cd, grpc_error* /*error*/) {
- auto* chand = static_cast<Server::ChannelData*>(cd);
- Server* server = chand->server_.get();
- GRPC_CHANNEL_INTERNAL_UNREF(chand->channel_, "server");
- server->Unref();
+void Server::ChannelData::FinishDestroy(void* cd, grpc_error* /*error*/) {
+ auto* chand = static_cast<Server::ChannelData*>(cd);
+ Server* server = chand->server_.get();
+ GRPC_CHANNEL_INTERNAL_UNREF(chand->channel_, "server");
+ server->Unref();
}
-void Server::ChannelData::Destroy() {
- if (!list_position_.has_value()) return;
- GPR_ASSERT(server_ != nullptr);
- server_->channels_.erase(*list_position_);
- list_position_.reset();
- server_->Ref().release();
- server_->MaybeFinishShutdown();
- GRPC_CLOSURE_INIT(&finish_destroy_channel_closure_, FinishDestroy, this,
- grpc_schedule_on_exec_ctx);
- if (GRPC_TRACE_FLAG_ENABLED(grpc_server_channel_trace)) {
- gpr_log(GPR_INFO, "Disconnected client");
- }
- grpc_transport_op* op =
- grpc_make_transport_op(&finish_destroy_channel_closure_);
- op->set_accept_stream = true;
- grpc_channel_next_op(
- grpc_channel_stack_element(grpc_channel_get_channel_stack(channel_), 0),
- op);
+void Server::ChannelData::Destroy() {
+ if (!list_position_.has_value()) return;
+ GPR_ASSERT(server_ != nullptr);
+ server_->channels_.erase(*list_position_);
+ list_position_.reset();
+ server_->Ref().release();
+ server_->MaybeFinishShutdown();
+ GRPC_CLOSURE_INIT(&finish_destroy_channel_closure_, FinishDestroy, this,
+ grpc_schedule_on_exec_ctx);
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_server_channel_trace)) {
+ gpr_log(GPR_INFO, "Disconnected client");
+ }
+ grpc_transport_op* op =
+ grpc_make_transport_op(&finish_destroy_channel_closure_);
+ op->set_accept_stream = true;
+ grpc_channel_next_op(
+ grpc_channel_stack_element(grpc_channel_get_channel_stack(channel_), 0),
+ op);
}
-grpc_error* Server::ChannelData::InitChannelElement(
- grpc_channel_element* elem, grpc_channel_element_args* args) {
+grpc_error* Server::ChannelData::InitChannelElement(
+ grpc_channel_element* elem, grpc_channel_element_args* args) {
GPR_ASSERT(args->is_first);
GPR_ASSERT(!args->is_last);
- new (elem->channel_data) ChannelData();
+ new (elem->channel_data) ChannelData();
+ return GRPC_ERROR_NONE;
+}
+
+void Server::ChannelData::DestroyChannelElement(grpc_channel_element* elem) {
+ auto* chand = static_cast<ChannelData*>(elem->channel_data);
+ chand->~ChannelData();
+}
+
+//
+// Server::CallData
+//
+
+Server::CallData::CallData(grpc_call_element* elem,
+ const grpc_call_element_args& args,
+ RefCountedPtr<Server> server)
+ : server_(std::move(server)),
+ call_(grpc_call_from_top_element(elem)),
+ call_combiner_(args.call_combiner) {
+ GRPC_CLOSURE_INIT(&recv_initial_metadata_ready_, RecvInitialMetadataReady,
+ elem, grpc_schedule_on_exec_ctx);
+ GRPC_CLOSURE_INIT(&recv_trailing_metadata_ready_, RecvTrailingMetadataReady,
+ elem, grpc_schedule_on_exec_ctx);
+}
+
+Server::CallData::~CallData() {
+ GPR_ASSERT(state_.Load(MemoryOrder::RELAXED) != CallState::PENDING);
+ GRPC_ERROR_UNREF(recv_initial_metadata_error_);
+ if (host_.has_value()) {
+ grpc_slice_unref_internal(*host_);
+ }
+ if (path_.has_value()) {
+ grpc_slice_unref_internal(*path_);
+ }
+ grpc_metadata_array_destroy(&initial_metadata_);
+ grpc_byte_buffer_destroy(payload_);
+}
+
+void Server::CallData::SetState(CallState state) {
+ state_.Store(state, MemoryOrder::RELAXED);
+}
+
+bool Server::CallData::MaybeActivate() {
+ CallState expected = CallState::PENDING;
+ return state_.CompareExchangeStrong(&expected, CallState::ACTIVATED,
+ MemoryOrder::ACQ_REL,
+ MemoryOrder::RELAXED);
+}
+
+void Server::CallData::FailCallCreation() {
+ CallState expected_not_started = CallState::NOT_STARTED;
+ CallState expected_pending = CallState::PENDING;
+ if (state_.CompareExchangeStrong(&expected_not_started, CallState::ZOMBIED,
+ MemoryOrder::ACQ_REL,
+ MemoryOrder::ACQUIRE)) {
+ KillZombie();
+ } else if (state_.CompareExchangeStrong(&expected_pending, CallState::ZOMBIED,
+ MemoryOrder::ACQ_REL,
+ MemoryOrder::RELAXED)) {
+ // Zombied call will be destroyed when it's removed from the pending
+ // queue... later.
+ }
+}
+
+void Server::CallData::Start(grpc_call_element* elem) {
+ grpc_op op;
+ op.op = GRPC_OP_RECV_INITIAL_METADATA;
+ op.flags = 0;
+ op.reserved = nullptr;
+ op.data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_;
+ GRPC_CLOSURE_INIT(&recv_initial_metadata_batch_complete_,
+ RecvInitialMetadataBatchComplete, elem,
+ grpc_schedule_on_exec_ctx);
+ grpc_call_start_batch_and_execute(call_, &op, 1,
+ &recv_initial_metadata_batch_complete_);
+}
+
+void Server::CallData::Publish(size_t cq_idx, RequestedCall* rc) {
+ grpc_call_set_completion_queue(call_, rc->cq_bound_to_call);
+ *rc->call = call_;
+ cq_new_ = server_->cqs_[cq_idx];
+ GPR_SWAP(grpc_metadata_array, *rc->initial_metadata, initial_metadata_);
+ switch (rc->type) {
+ case RequestedCall::Type::BATCH_CALL:
+ GPR_ASSERT(host_.has_value());
+ GPR_ASSERT(path_.has_value());
+ rc->data.batch.details->host = grpc_slice_ref_internal(*host_);
+ rc->data.batch.details->method = grpc_slice_ref_internal(*path_);
+ rc->data.batch.details->deadline =
+ grpc_millis_to_timespec(deadline_, GPR_CLOCK_MONOTONIC);
+ rc->data.batch.details->flags = recv_initial_metadata_flags_;
+ break;
+ case RequestedCall::Type::REGISTERED_CALL:
+ *rc->data.registered.deadline =
+ grpc_millis_to_timespec(deadline_, GPR_CLOCK_MONOTONIC);
+ if (rc->data.registered.optional_payload != nullptr) {
+ *rc->data.registered.optional_payload = payload_;
+ payload_ = nullptr;
+ }
+ break;
+ default:
+ GPR_UNREACHABLE_CODE(return );
+ }
+ grpc_cq_end_op(cq_new_, rc->tag, GRPC_ERROR_NONE, Server::DoneRequestEvent,
+ rc, &rc->completion, true);
+}
+
+void Server::CallData::PublishNewRpc(void* arg, grpc_error* error) {
+ grpc_call_element* call_elem = static_cast<grpc_call_element*>(arg);
+ auto* calld = static_cast<Server::CallData*>(call_elem->call_data);
+ auto* chand = static_cast<Server::ChannelData*>(call_elem->channel_data);
+ RequestMatcherInterface* rm = calld->matcher_;
+ Server* server = rm->server();
+ if (error != GRPC_ERROR_NONE ||
+ server->shutdown_flag_.load(std::memory_order_acquire)) {
+ calld->state_.Store(CallState::ZOMBIED, MemoryOrder::RELAXED);
+ calld->KillZombie();
+ return;
+ }
+ rm->MatchOrQueue(chand->cq_idx(), calld);
+}
+
+namespace {
+
+void KillZombieClosure(void* call, grpc_error* /*error*/) {
+ grpc_call_unref(static_cast<grpc_call*>(call));
+}
+
+} // namespace
+
+void Server::CallData::KillZombie() {
+ GRPC_CLOSURE_INIT(&kill_zombie_closure_, KillZombieClosure, call_,
+ grpc_schedule_on_exec_ctx);
+ ExecCtx::Run(DEBUG_LOCATION, &kill_zombie_closure_, GRPC_ERROR_NONE);
+}
+
+void Server::CallData::StartNewRpc(grpc_call_element* elem) {
+ auto* chand = static_cast<ChannelData*>(elem->channel_data);
+ if (server_->shutdown_flag_.load(std::memory_order_acquire)) {
+ state_.Store(CallState::ZOMBIED, MemoryOrder::RELAXED);
+ KillZombie();
+ return;
+ }
+ // Find request matcher.
+ matcher_ = server_->unregistered_request_matcher_.get();
+ grpc_server_register_method_payload_handling payload_handling =
+ GRPC_SRM_PAYLOAD_NONE;
+ if (path_.has_value() && host_.has_value()) {
+ ChannelRegisteredMethod* rm =
+ chand->GetRegisteredMethod(*host_, *path_,
+ (recv_initial_metadata_flags_ &
+ GRPC_INITIAL_METADATA_IDEMPOTENT_REQUEST));
+ if (rm != nullptr) {
+ matcher_ = rm->server_registered_method->matcher.get();
+ payload_handling = rm->server_registered_method->payload_handling;
+ }
+ }
+ // Start recv_message op if needed.
+ switch (payload_handling) {
+ case GRPC_SRM_PAYLOAD_NONE:
+ PublishNewRpc(elem, GRPC_ERROR_NONE);
+ break;
+ case GRPC_SRM_PAYLOAD_READ_INITIAL_BYTE_BUFFER: {
+ grpc_op op;
+ op.op = GRPC_OP_RECV_MESSAGE;
+ op.flags = 0;
+ op.reserved = nullptr;
+ op.data.recv_message.recv_message = &payload_;
+ GRPC_CLOSURE_INIT(&publish_, PublishNewRpc, elem,
+ grpc_schedule_on_exec_ctx);
+ grpc_call_start_batch_and_execute(call_, &op, 1, &publish_);
+ break;
+ }
+ }
+}
+
+void Server::CallData::RecvInitialMetadataBatchComplete(void* arg,
+ grpc_error* error) {
+ grpc_call_element* elem = static_cast<grpc_call_element*>(arg);
+ auto* calld = static_cast<Server::CallData*>(elem->call_data);
+ if (error != GRPC_ERROR_NONE) {
+ calld->FailCallCreation();
+ return;
+ }
+ calld->StartNewRpc(elem);
+}
+
+void Server::CallData::StartTransportStreamOpBatchImpl(
+ grpc_call_element* elem, grpc_transport_stream_op_batch* batch) {
+ if (batch->recv_initial_metadata) {
+ GPR_ASSERT(batch->payload->recv_initial_metadata.recv_flags == nullptr);
+ recv_initial_metadata_ =
+ batch->payload->recv_initial_metadata.recv_initial_metadata;
+ original_recv_initial_metadata_ready_ =
+ batch->payload->recv_initial_metadata.recv_initial_metadata_ready;
+ batch->payload->recv_initial_metadata.recv_initial_metadata_ready =
+ &recv_initial_metadata_ready_;
+ batch->payload->recv_initial_metadata.recv_flags =
+ &recv_initial_metadata_flags_;
+ }
+ if (batch->recv_trailing_metadata) {
+ original_recv_trailing_metadata_ready_ =
+ batch->payload->recv_trailing_metadata.recv_trailing_metadata_ready;
+ batch->payload->recv_trailing_metadata.recv_trailing_metadata_ready =
+ &recv_trailing_metadata_ready_;
+ }
+ grpc_call_next_op(elem, batch);
+}
+
+void Server::CallData::RecvInitialMetadataReady(void* ptr, grpc_error* error) {
+ grpc_call_element* elem = static_cast<grpc_call_element*>(ptr);
+ CallData* calld = static_cast<CallData*>(elem->call_data);
+ grpc_millis op_deadline;
+ if (error == GRPC_ERROR_NONE) {
+ GPR_DEBUG_ASSERT(calld->recv_initial_metadata_->idx.named.path != nullptr);
+ GPR_DEBUG_ASSERT(calld->recv_initial_metadata_->idx.named.authority !=
+ nullptr);
+ calld->path_.emplace(grpc_slice_ref_internal(
+ GRPC_MDVALUE(calld->recv_initial_metadata_->idx.named.path->md)));
+ calld->host_.emplace(grpc_slice_ref_internal(
+ GRPC_MDVALUE(calld->recv_initial_metadata_->idx.named.authority->md)));
+ grpc_metadata_batch_remove(calld->recv_initial_metadata_, GRPC_BATCH_PATH);
+ grpc_metadata_batch_remove(calld->recv_initial_metadata_,
+ GRPC_BATCH_AUTHORITY);
+ } else {
+ GRPC_ERROR_REF(error);
+ }
+ op_deadline = calld->recv_initial_metadata_->deadline;
+ if (op_deadline != GRPC_MILLIS_INF_FUTURE) {
+ calld->deadline_ = op_deadline;
+ }
+ if (calld->host_.has_value() && calld->path_.has_value()) {
+ /* do nothing */
+ } else {
+ /* Pass the error reference to calld->recv_initial_metadata_error */
+ grpc_error* src_error = error;
+ error = GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
+ "Missing :authority or :path", &src_error, 1);
+ GRPC_ERROR_UNREF(src_error);
+ calld->recv_initial_metadata_error_ = GRPC_ERROR_REF(error);
+ }
+ grpc_closure* closure = calld->original_recv_initial_metadata_ready_;
+ calld->original_recv_initial_metadata_ready_ = nullptr;
+ if (calld->seen_recv_trailing_metadata_ready_) {
+ GRPC_CALL_COMBINER_START(calld->call_combiner_,
+ &calld->recv_trailing_metadata_ready_,
+ calld->recv_trailing_metadata_error_,
+ "continue server recv_trailing_metadata_ready");
+ }
+ Closure::Run(DEBUG_LOCATION, closure, error);
+}
+
+void Server::CallData::RecvTrailingMetadataReady(void* user_data,
+ grpc_error* error) {
+ grpc_call_element* elem = static_cast<grpc_call_element*>(user_data);
+ CallData* calld = static_cast<CallData*>(elem->call_data);
+ if (calld->original_recv_initial_metadata_ready_ != nullptr) {
+ calld->recv_trailing_metadata_error_ = GRPC_ERROR_REF(error);
+ calld->seen_recv_trailing_metadata_ready_ = true;
+ GRPC_CLOSURE_INIT(&calld->recv_trailing_metadata_ready_,
+ RecvTrailingMetadataReady, elem,
+ grpc_schedule_on_exec_ctx);
+ GRPC_CALL_COMBINER_STOP(calld->call_combiner_,
+ "deferring server recv_trailing_metadata_ready "
+ "until after recv_initial_metadata_ready");
+ return;
+ }
+ error =
+ grpc_error_add_child(GRPC_ERROR_REF(error),
+ GRPC_ERROR_REF(calld->recv_initial_metadata_error_));
+ Closure::Run(DEBUG_LOCATION, calld->original_recv_trailing_metadata_ready_,
+ error);
+}
+
+grpc_error* Server::CallData::InitCallElement(
+ grpc_call_element* elem, const grpc_call_element_args* args) {
+ auto* chand = static_cast<ChannelData*>(elem->channel_data);
+ new (elem->call_data) Server::CallData(elem, *args, chand->server());
return GRPC_ERROR_NONE;
}
-void Server::ChannelData::DestroyChannelElement(grpc_channel_element* elem) {
- auto* chand = static_cast<ChannelData*>(elem->channel_data);
- chand->~ChannelData();
-}
-
-//
-// Server::CallData
-//
-
-Server::CallData::CallData(grpc_call_element* elem,
- const grpc_call_element_args& args,
- RefCountedPtr<Server> server)
- : server_(std::move(server)),
- call_(grpc_call_from_top_element(elem)),
- call_combiner_(args.call_combiner) {
- GRPC_CLOSURE_INIT(&recv_initial_metadata_ready_, RecvInitialMetadataReady,
- elem, grpc_schedule_on_exec_ctx);
- GRPC_CLOSURE_INIT(&recv_trailing_metadata_ready_, RecvTrailingMetadataReady,
- elem, grpc_schedule_on_exec_ctx);
-}
-
-Server::CallData::~CallData() {
- GPR_ASSERT(state_.Load(MemoryOrder::RELAXED) != CallState::PENDING);
- GRPC_ERROR_UNREF(recv_initial_metadata_error_);
- if (host_.has_value()) {
- grpc_slice_unref_internal(*host_);
- }
- if (path_.has_value()) {
- grpc_slice_unref_internal(*path_);
- }
- grpc_metadata_array_destroy(&initial_metadata_);
- grpc_byte_buffer_destroy(payload_);
+void Server::CallData::DestroyCallElement(
+ grpc_call_element* elem, const grpc_call_final_info* /*final_info*/,
+ grpc_closure* /*ignored*/) {
+ auto* calld = static_cast<CallData*>(elem->call_data);
+ calld->~CallData();
+}
+
+void Server::CallData::StartTransportStreamOpBatch(
+ grpc_call_element* elem, grpc_transport_stream_op_batch* batch) {
+ auto* calld = static_cast<CallData*>(elem->call_data);
+ calld->StartTransportStreamOpBatchImpl(elem, batch);
+}
+
+} // namespace grpc_core
+
+//
+// C-core API
+//
+
+grpc_server* grpc_server_create(const grpc_channel_args* args, void* reserved) {
+ grpc_core::ExecCtx exec_ctx;
+ GRPC_API_TRACE("grpc_server_create(%p, %p)", 2, (args, reserved));
+ grpc_server* c_server = new grpc_server;
+ c_server->core_server = grpc_core::MakeOrphanable<grpc_core::Server>(args);
+ return c_server;
}
-void Server::CallData::SetState(CallState state) {
- state_.Store(state, MemoryOrder::RELAXED);
-}
-
-bool Server::CallData::MaybeActivate() {
- CallState expected = CallState::PENDING;
- return state_.CompareExchangeStrong(&expected, CallState::ACTIVATED,
- MemoryOrder::ACQ_REL,
- MemoryOrder::RELAXED);
-}
-
-void Server::CallData::FailCallCreation() {
- CallState expected_not_started = CallState::NOT_STARTED;
- CallState expected_pending = CallState::PENDING;
- if (state_.CompareExchangeStrong(&expected_not_started, CallState::ZOMBIED,
- MemoryOrder::ACQ_REL,
- MemoryOrder::ACQUIRE)) {
- KillZombie();
- } else if (state_.CompareExchangeStrong(&expected_pending, CallState::ZOMBIED,
- MemoryOrder::ACQ_REL,
- MemoryOrder::RELAXED)) {
- // Zombied call will be destroyed when it's removed from the pending
- // queue... later.
- }
-}
-
-void Server::CallData::Start(grpc_call_element* elem) {
- grpc_op op;
- op.op = GRPC_OP_RECV_INITIAL_METADATA;
- op.flags = 0;
- op.reserved = nullptr;
- op.data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_;
- GRPC_CLOSURE_INIT(&recv_initial_metadata_batch_complete_,
- RecvInitialMetadataBatchComplete, elem,
- grpc_schedule_on_exec_ctx);
- grpc_call_start_batch_and_execute(call_, &op, 1,
- &recv_initial_metadata_batch_complete_);
-}
-
-void Server::CallData::Publish(size_t cq_idx, RequestedCall* rc) {
- grpc_call_set_completion_queue(call_, rc->cq_bound_to_call);
- *rc->call = call_;
- cq_new_ = server_->cqs_[cq_idx];
- GPR_SWAP(grpc_metadata_array, *rc->initial_metadata, initial_metadata_);
- switch (rc->type) {
- case RequestedCall::Type::BATCH_CALL:
- GPR_ASSERT(host_.has_value());
- GPR_ASSERT(path_.has_value());
- rc->data.batch.details->host = grpc_slice_ref_internal(*host_);
- rc->data.batch.details->method = grpc_slice_ref_internal(*path_);
- rc->data.batch.details->deadline =
- grpc_millis_to_timespec(deadline_, GPR_CLOCK_MONOTONIC);
- rc->data.batch.details->flags = recv_initial_metadata_flags_;
- break;
- case RequestedCall::Type::REGISTERED_CALL:
- *rc->data.registered.deadline =
- grpc_millis_to_timespec(deadline_, GPR_CLOCK_MONOTONIC);
- if (rc->data.registered.optional_payload != nullptr) {
- *rc->data.registered.optional_payload = payload_;
- payload_ = nullptr;
- }
- break;
- default:
- GPR_UNREACHABLE_CODE(return );
- }
- grpc_cq_end_op(cq_new_, rc->tag, GRPC_ERROR_NONE, Server::DoneRequestEvent,
- rc, &rc->completion, true);
-}
-
-void Server::CallData::PublishNewRpc(void* arg, grpc_error* error) {
- grpc_call_element* call_elem = static_cast<grpc_call_element*>(arg);
- auto* calld = static_cast<Server::CallData*>(call_elem->call_data);
- auto* chand = static_cast<Server::ChannelData*>(call_elem->channel_data);
- RequestMatcherInterface* rm = calld->matcher_;
- Server* server = rm->server();
- if (error != GRPC_ERROR_NONE ||
- server->shutdown_flag_.load(std::memory_order_acquire)) {
- calld->state_.Store(CallState::ZOMBIED, MemoryOrder::RELAXED);
- calld->KillZombie();
- return;
- }
- rm->MatchOrQueue(chand->cq_idx(), calld);
-}
-
-namespace {
-
-void KillZombieClosure(void* call, grpc_error* /*error*/) {
- grpc_call_unref(static_cast<grpc_call*>(call));
-}
-
-} // namespace
-
-void Server::CallData::KillZombie() {
- GRPC_CLOSURE_INIT(&kill_zombie_closure_, KillZombieClosure, call_,
- grpc_schedule_on_exec_ctx);
- ExecCtx::Run(DEBUG_LOCATION, &kill_zombie_closure_, GRPC_ERROR_NONE);
-}
-
-void Server::CallData::StartNewRpc(grpc_call_element* elem) {
- auto* chand = static_cast<ChannelData*>(elem->channel_data);
- if (server_->shutdown_flag_.load(std::memory_order_acquire)) {
- state_.Store(CallState::ZOMBIED, MemoryOrder::RELAXED);
- KillZombie();
- return;
- }
- // Find request matcher.
- matcher_ = server_->unregistered_request_matcher_.get();
- grpc_server_register_method_payload_handling payload_handling =
- GRPC_SRM_PAYLOAD_NONE;
- if (path_.has_value() && host_.has_value()) {
- ChannelRegisteredMethod* rm =
- chand->GetRegisteredMethod(*host_, *path_,
- (recv_initial_metadata_flags_ &
- GRPC_INITIAL_METADATA_IDEMPOTENT_REQUEST));
- if (rm != nullptr) {
- matcher_ = rm->server_registered_method->matcher.get();
- payload_handling = rm->server_registered_method->payload_handling;
- }
- }
- // Start recv_message op if needed.
- switch (payload_handling) {
- case GRPC_SRM_PAYLOAD_NONE:
- PublishNewRpc(elem, GRPC_ERROR_NONE);
- break;
- case GRPC_SRM_PAYLOAD_READ_INITIAL_BYTE_BUFFER: {
- grpc_op op;
- op.op = GRPC_OP_RECV_MESSAGE;
- op.flags = 0;
- op.reserved = nullptr;
- op.data.recv_message.recv_message = &payload_;
- GRPC_CLOSURE_INIT(&publish_, PublishNewRpc, elem,
- grpc_schedule_on_exec_ctx);
- grpc_call_start_batch_and_execute(call_, &op, 1, &publish_);
- break;
- }
- }
-}
-
-void Server::CallData::RecvInitialMetadataBatchComplete(void* arg,
- grpc_error* error) {
- grpc_call_element* elem = static_cast<grpc_call_element*>(arg);
- auto* calld = static_cast<Server::CallData*>(elem->call_data);
- if (error != GRPC_ERROR_NONE) {
- calld->FailCallCreation();
- return;
- }
- calld->StartNewRpc(elem);
-}
-
-void Server::CallData::StartTransportStreamOpBatchImpl(
- grpc_call_element* elem, grpc_transport_stream_op_batch* batch) {
- if (batch->recv_initial_metadata) {
- GPR_ASSERT(batch->payload->recv_initial_metadata.recv_flags == nullptr);
- recv_initial_metadata_ =
- batch->payload->recv_initial_metadata.recv_initial_metadata;
- original_recv_initial_metadata_ready_ =
- batch->payload->recv_initial_metadata.recv_initial_metadata_ready;
- batch->payload->recv_initial_metadata.recv_initial_metadata_ready =
- &recv_initial_metadata_ready_;
- batch->payload->recv_initial_metadata.recv_flags =
- &recv_initial_metadata_flags_;
- }
- if (batch->recv_trailing_metadata) {
- original_recv_trailing_metadata_ready_ =
- batch->payload->recv_trailing_metadata.recv_trailing_metadata_ready;
- batch->payload->recv_trailing_metadata.recv_trailing_metadata_ready =
- &recv_trailing_metadata_ready_;
- }
- grpc_call_next_op(elem, batch);
-}
-
-void Server::CallData::RecvInitialMetadataReady(void* ptr, grpc_error* error) {
- grpc_call_element* elem = static_cast<grpc_call_element*>(ptr);
- CallData* calld = static_cast<CallData*>(elem->call_data);
- grpc_millis op_deadline;
- if (error == GRPC_ERROR_NONE) {
- GPR_DEBUG_ASSERT(calld->recv_initial_metadata_->idx.named.path != nullptr);
- GPR_DEBUG_ASSERT(calld->recv_initial_metadata_->idx.named.authority !=
- nullptr);
- calld->path_.emplace(grpc_slice_ref_internal(
- GRPC_MDVALUE(calld->recv_initial_metadata_->idx.named.path->md)));
- calld->host_.emplace(grpc_slice_ref_internal(
- GRPC_MDVALUE(calld->recv_initial_metadata_->idx.named.authority->md)));
- grpc_metadata_batch_remove(calld->recv_initial_metadata_, GRPC_BATCH_PATH);
- grpc_metadata_batch_remove(calld->recv_initial_metadata_,
- GRPC_BATCH_AUTHORITY);
- } else {
- GRPC_ERROR_REF(error);
- }
- op_deadline = calld->recv_initial_metadata_->deadline;
- if (op_deadline != GRPC_MILLIS_INF_FUTURE) {
- calld->deadline_ = op_deadline;
- }
- if (calld->host_.has_value() && calld->path_.has_value()) {
- /* do nothing */
- } else {
- /* Pass the error reference to calld->recv_initial_metadata_error */
- grpc_error* src_error = error;
- error = GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
- "Missing :authority or :path", &src_error, 1);
- GRPC_ERROR_UNREF(src_error);
- calld->recv_initial_metadata_error_ = GRPC_ERROR_REF(error);
- }
- grpc_closure* closure = calld->original_recv_initial_metadata_ready_;
- calld->original_recv_initial_metadata_ready_ = nullptr;
- if (calld->seen_recv_trailing_metadata_ready_) {
- GRPC_CALL_COMBINER_START(calld->call_combiner_,
- &calld->recv_trailing_metadata_ready_,
- calld->recv_trailing_metadata_error_,
- "continue server recv_trailing_metadata_ready");
- }
- Closure::Run(DEBUG_LOCATION, closure, error);
-}
-
-void Server::CallData::RecvTrailingMetadataReady(void* user_data,
- grpc_error* error) {
- grpc_call_element* elem = static_cast<grpc_call_element*>(user_data);
- CallData* calld = static_cast<CallData*>(elem->call_data);
- if (calld->original_recv_initial_metadata_ready_ != nullptr) {
- calld->recv_trailing_metadata_error_ = GRPC_ERROR_REF(error);
- calld->seen_recv_trailing_metadata_ready_ = true;
- GRPC_CLOSURE_INIT(&calld->recv_trailing_metadata_ready_,
- RecvTrailingMetadataReady, elem,
- grpc_schedule_on_exec_ctx);
- GRPC_CALL_COMBINER_STOP(calld->call_combiner_,
- "deferring server recv_trailing_metadata_ready "
- "until after recv_initial_metadata_ready");
- return;
- }
- error =
- grpc_error_add_child(GRPC_ERROR_REF(error),
- GRPC_ERROR_REF(calld->recv_initial_metadata_error_));
- Closure::Run(DEBUG_LOCATION, calld->original_recv_trailing_metadata_ready_,
- error);
-}
-
-grpc_error* Server::CallData::InitCallElement(
- grpc_call_element* elem, const grpc_call_element_args* args) {
- auto* chand = static_cast<ChannelData*>(elem->channel_data);
- new (elem->call_data) Server::CallData(elem, *args, chand->server());
- return GRPC_ERROR_NONE;
-}
-
-void Server::CallData::DestroyCallElement(
- grpc_call_element* elem, const grpc_call_final_info* /*final_info*/,
- grpc_closure* /*ignored*/) {
- auto* calld = static_cast<CallData*>(elem->call_data);
- calld->~CallData();
-}
-
-void Server::CallData::StartTransportStreamOpBatch(
- grpc_call_element* elem, grpc_transport_stream_op_batch* batch) {
- auto* calld = static_cast<CallData*>(elem->call_data);
- calld->StartTransportStreamOpBatchImpl(elem, batch);
-}
-
-} // namespace grpc_core
-
-//
-// C-core API
-//
-
-grpc_server* grpc_server_create(const grpc_channel_args* args, void* reserved) {
- grpc_core::ExecCtx exec_ctx;
- GRPC_API_TRACE("grpc_server_create(%p, %p)", 2, (args, reserved));
- grpc_server* c_server = new grpc_server;
- c_server->core_server = grpc_core::MakeOrphanable<grpc_core::Server>(args);
- return c_server;
-}
-
void grpc_server_register_completion_queue(grpc_server* server,
grpc_completion_queue* cq,
void* reserved) {
GRPC_API_TRACE(
"grpc_server_register_completion_queue(server=%p, cq=%p, reserved=%p)", 3,
(server, cq, reserved));
- GPR_ASSERT(!reserved);
+ GPR_ASSERT(!reserved);
auto cq_type = grpc_get_cq_completion_type(cq);
if (cq_type != GRPC_CQ_NEXT && cq_type != GRPC_CQ_CALLBACK) {
gpr_log(GPR_INFO,
@@ -1468,7 +1468,7 @@ void grpc_server_register_completion_queue(grpc_server* server,
/* Ideally we should log an error and abort but ruby-wrapped-language API
calls grpc_completion_queue_pluck() on server completion queues */
}
- server->core_server->RegisterCompletionQueue(cq);
+ server->core_server->RegisterCompletionQueue(cq);
}
void* grpc_server_register_method(
@@ -1479,14 +1479,14 @@ void* grpc_server_register_method(
"grpc_server_register_method(server=%p, method=%s, host=%s, "
"flags=0x%08x)",
4, (server, method, host, flags));
- return server->core_server->RegisterMethod(method, host, payload_handling,
- flags);
+ return server->core_server->RegisterMethod(method, host, payload_handling,
+ flags);
}
void grpc_server_start(grpc_server* server) {
grpc_core::ExecCtx exec_ctx;
GRPC_API_TRACE("grpc_server_start(server=%p)", 1, (server));
- server->core_server->Start();
+ server->core_server->Start();
}
void grpc_server_shutdown_and_notify(grpc_server* server,
@@ -1495,26 +1495,26 @@ void grpc_server_shutdown_and_notify(grpc_server* server,
grpc_core::ExecCtx exec_ctx;
GRPC_API_TRACE("grpc_server_shutdown_and_notify(server=%p, cq=%p, tag=%p)", 3,
(server, cq, tag));
- server->core_server->ShutdownAndNotify(cq, tag);
+ server->core_server->ShutdownAndNotify(cq, tag);
}
void grpc_server_cancel_all_calls(grpc_server* server) {
grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
grpc_core::ExecCtx exec_ctx;
GRPC_API_TRACE("grpc_server_cancel_all_calls(server=%p)", 1, (server));
- server->core_server->CancelAllCalls();
+ server->core_server->CancelAllCalls();
}
void grpc_server_destroy(grpc_server* server) {
grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
grpc_core::ExecCtx exec_ctx;
GRPC_API_TRACE("grpc_server_destroy(server=%p)", 1, (server));
- delete server;
+ delete server;
}
grpc_call_error grpc_server_request_call(
grpc_server* server, grpc_call** call, grpc_call_details* details,
- grpc_metadata_array* request_metadata,
+ grpc_metadata_array* request_metadata,
grpc_completion_queue* cq_bound_to_call,
grpc_completion_queue* cq_for_notification, void* tag) {
grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
@@ -1525,31 +1525,31 @@ grpc_call_error grpc_server_request_call(
"server=%p, call=%p, details=%p, initial_metadata=%p, "
"cq_bound_to_call=%p, cq_for_notification=%p, tag=%p)",
7,
- (server, call, details, request_metadata, cq_bound_to_call,
+ (server, call, details, request_metadata, cq_bound_to_call,
cq_for_notification, tag));
- return server->core_server->RequestCall(call, details, request_metadata,
- cq_bound_to_call, cq_for_notification,
- tag);
+ return server->core_server->RequestCall(call, details, request_metadata,
+ cq_bound_to_call, cq_for_notification,
+ tag);
}
grpc_call_error grpc_server_request_registered_call(
grpc_server* server, void* rmp, grpc_call** call, gpr_timespec* deadline,
- grpc_metadata_array* request_metadata, grpc_byte_buffer** optional_payload,
+ grpc_metadata_array* request_metadata, grpc_byte_buffer** optional_payload,
grpc_completion_queue* cq_bound_to_call,
- grpc_completion_queue* cq_for_notification, void* tag_new) {
+ grpc_completion_queue* cq_for_notification, void* tag_new) {
grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
grpc_core::ExecCtx exec_ctx;
GRPC_STATS_INC_SERVER_REQUESTED_CALLS();
- auto* rm = static_cast<grpc_core::Server::RegisteredMethod*>(rmp);
+ auto* rm = static_cast<grpc_core::Server::RegisteredMethod*>(rmp);
GRPC_API_TRACE(
"grpc_server_request_registered_call("
- "server=%p, rmp=%p, call=%p, deadline=%p, request_metadata=%p, "
+ "server=%p, rmp=%p, call=%p, deadline=%p, request_metadata=%p, "
"optional_payload=%p, cq_bound_to_call=%p, cq_for_notification=%p, "
"tag=%p)",
9,
- (server, rmp, call, deadline, request_metadata, optional_payload,
- cq_bound_to_call, cq_for_notification, tag_new));
- return server->core_server->RequestRegisteredCall(
- rm, call, deadline, request_metadata, optional_payload, cq_bound_to_call,
- cq_for_notification, tag_new);
+ (server, rmp, call, deadline, request_metadata, optional_payload,
+ cq_bound_to_call, cq_for_notification, tag_new));
+ return server->core_server->RequestRegisteredCall(
+ rm, call, deadline, request_metadata, optional_payload, cq_bound_to_call,
+ cq_for_notification, tag_new);
}
diff --git a/contrib/libs/grpc/src/core/lib/surface/server.h b/contrib/libs/grpc/src/core/lib/surface/server.h
index 9eeca08dc4e..f4f4ff6449a 100644
--- a/contrib/libs/grpc/src/core/lib/surface/server.h
+++ b/contrib/libs/grpc/src/core/lib/surface/server.h
@@ -1,397 +1,397 @@
-//
-// Copyright 2015 gRPC authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
+//
+// Copyright 2015 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
#ifndef GRPC_CORE_LIB_SURFACE_SERVER_H
#define GRPC_CORE_LIB_SURFACE_SERVER_H
#include <grpc/support/port_platform.h>
-#include <list>
-#include <vector>
-
-#include "y_absl/types/optional.h"
-
+#include <list>
+#include <vector>
+
+#include "y_absl/types/optional.h"
+
#include <grpc/grpc.h>
-
-#include "src/core/lib/channel/channel_args.h"
+
+#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/channel/channel_stack.h"
#include "src/core/lib/channel/channelz.h"
#include "src/core/lib/debug/trace.h"
-#include "src/core/lib/gprpp/atomic.h"
-#include "src/core/lib/surface/completion_queue.h"
+#include "src/core/lib/gprpp/atomic.h"
+#include "src/core/lib/surface/completion_queue.h"
#include "src/core/lib/transport/transport.h"
-namespace grpc_core {
-
-extern TraceFlag grpc_server_channel_trace;
-
-class Server : public InternallyRefCounted<Server> {
- public:
- // Filter vtable.
- static const grpc_channel_filter kServerTopFilter;
-
- // Opaque type used for registered methods.
- struct RegisteredMethod;
-
- // An object to represent the most relevant characteristics of a
- // newly-allocated call object when using an AllocatingRequestMatcherBatch.
- struct BatchCallAllocation {
- grpc_experimental_completion_queue_functor* tag;
- grpc_call** call;
- grpc_metadata_array* initial_metadata;
- grpc_call_details* details;
- };
-
- // An object to represent the most relevant characteristics of a
- // newly-allocated call object when using an
- // AllocatingRequestMatcherRegistered.
- struct RegisteredCallAllocation {
- grpc_experimental_completion_queue_functor* tag;
- grpc_call** call;
- grpc_metadata_array* initial_metadata;
- gpr_timespec* deadline;
- grpc_byte_buffer** optional_payload;
- };
-
- /// Interface for listeners.
- /// Implementations must override the Orphan() method, which should stop
- /// listening and initiate destruction of the listener.
- class ListenerInterface : public Orphanable {
- public:
- virtual ~ListenerInterface() = default;
-
- /// Starts listening. This listener may refer to the pollset object beyond
- /// this call, so it is a pointer rather than a reference.
- virtual void Start(Server* server,
- const std::vector<grpc_pollset*>* pollsets) = 0;
-
- /// Returns the channelz node for the listen socket, or null if not
- /// supported.
- virtual channelz::ListenSocketNode* channelz_listen_socket_node() const = 0;
-
- /// Sets a closure to be invoked by the listener when its destruction
- /// is complete.
- virtual void SetOnDestroyDone(grpc_closure* on_destroy_done) = 0;
- };
-
- explicit Server(const grpc_channel_args* args);
- ~Server();
-
- void Orphan() override;
-
- const grpc_channel_args* channel_args() const { return channel_args_; }
- grpc_resource_user* default_resource_user() const {
- return default_resource_user_;
- }
- channelz::ServerNode* channelz_node() const { return channelz_node_.get(); }
-
- // Do not call this before Start(). Returns the pollsets. The
- // vector itself is immutable, but the pollsets inside are mutable. The
- // result is valid for the lifetime of the server.
- const std::vector<grpc_pollset*>& pollsets() const { return pollsets_; }
-
- bool HasOpenConnections();
-
- // Adds a listener to the server. When the server starts, it will call
- // the listener's Start() method, and when it shuts down, it will orphan
- // the listener.
- void AddListener(OrphanablePtr<ListenerInterface> listener);
-
- // Starts listening for connections.
- void Start();
-
- // Sets up a transport. Creates a channel stack and binds the transport to
- // the server. Called from the listener when a new connection is accepted.
- void SetupTransport(grpc_transport* transport,
- grpc_pollset* accepting_pollset,
- const grpc_channel_args* args,
- const RefCountedPtr<channelz::SocketNode>& socket_node,
- grpc_resource_user* resource_user = nullptr);
-
- void RegisterCompletionQueue(grpc_completion_queue* cq);
-
- // Functions to specify that a specific registered method or the unregistered
- // collection should use a specific allocator for request matching.
- void SetRegisteredMethodAllocator(
- grpc_completion_queue* cq, void* method_tag,
- std::function<RegisteredCallAllocation()> allocator);
- void SetBatchMethodAllocator(grpc_completion_queue* cq,
- std::function<BatchCallAllocation()> allocator);
-
- RegisteredMethod* RegisterMethod(
- const char* method, const char* host,
- grpc_server_register_method_payload_handling payload_handling,
- uint32_t flags);
-
- grpc_call_error RequestCall(grpc_call** call, grpc_call_details* details,
- grpc_metadata_array* request_metadata,
- grpc_completion_queue* cq_bound_to_call,
- grpc_completion_queue* cq_for_notification,
- void* tag);
-
- grpc_call_error RequestRegisteredCall(
- RegisteredMethod* rm, grpc_call** call, gpr_timespec* deadline,
- grpc_metadata_array* request_metadata,
- grpc_byte_buffer** optional_payload,
- grpc_completion_queue* cq_bound_to_call,
- grpc_completion_queue* cq_for_notification, void* tag_new);
-
- void ShutdownAndNotify(grpc_completion_queue* cq, void* tag);
-
- void CancelAllCalls();
-
- private:
- struct RequestedCall;
-
- struct ChannelRegisteredMethod {
- RegisteredMethod* server_registered_method = nullptr;
- uint32_t flags;
- bool has_host;
- ExternallyManagedSlice method;
- ExternallyManagedSlice host;
- };
-
- class RequestMatcherInterface;
- class RealRequestMatcher;
- class AllocatingRequestMatcherBase;
- class AllocatingRequestMatcherBatch;
- class AllocatingRequestMatcherRegistered;
-
- class ChannelData {
- public:
- ChannelData() = default;
- ~ChannelData();
-
- void InitTransport(RefCountedPtr<Server> server, grpc_channel* channel,
- size_t cq_idx, grpc_transport* transport,
- intptr_t channelz_socket_uuid);
-
- RefCountedPtr<Server> server() const { return server_; }
- grpc_channel* channel() const { return channel_; }
- size_t cq_idx() const { return cq_idx_; }
-
- ChannelRegisteredMethod* GetRegisteredMethod(const grpc_slice& host,
- const grpc_slice& path,
- bool is_idempotent);
-
- // Filter vtable functions.
- static grpc_error* InitChannelElement(grpc_channel_element* elem,
- grpc_channel_element_args* args);
- static void DestroyChannelElement(grpc_channel_element* elem);
-
- private:
- class ConnectivityWatcher;
-
- static void AcceptStream(void* arg, grpc_transport* /*transport*/,
- const void* transport_server_data);
-
- void Destroy();
-
- static void FinishDestroy(void* arg, grpc_error* error);
-
- RefCountedPtr<Server> server_;
- grpc_channel* channel_;
- // The index into Server::cqs_ of the CQ used as a starting point for
- // where to publish new incoming calls.
- size_t cq_idx_;
- y_absl::optional<std::list<ChannelData*>::iterator> list_position_;
- // A hash-table of the methods and hosts of the registered methods.
- // TODO(vjpai): Convert this to an STL map type as opposed to a direct
- // bucket implementation. (Consider performance impact, hash function to
- // use, etc.)
- std::unique_ptr<std::vector<ChannelRegisteredMethod>> registered_methods_;
- uint32_t registered_method_max_probes_;
- grpc_closure finish_destroy_channel_closure_;
- intptr_t channelz_socket_uuid_;
- };
-
- class CallData {
- public:
- enum class CallState {
- NOT_STARTED, // Waiting for metadata.
- PENDING, // Initial metadata read, not flow controlled in yet.
- ACTIVATED, // Flow controlled in, on completion queue.
- ZOMBIED, // Cancelled before being queued.
- };
-
- CallData(grpc_call_element* elem, const grpc_call_element_args& args,
- RefCountedPtr<Server> server);
- ~CallData();
-
- // Starts the recv_initial_metadata batch on the call.
- // Invoked from ChannelData::AcceptStream().
- void Start(grpc_call_element* elem);
-
- void SetState(CallState state);
-
- // Attempts to move from PENDING to ACTIVATED state. Returns true
- // on success.
- bool MaybeActivate();
-
- // Publishes an incoming call to the application after it has been
- // matched.
- void Publish(size_t cq_idx, RequestedCall* rc);
-
- void KillZombie();
-
- void FailCallCreation();
-
- // Filter vtable functions.
- static grpc_error* InitCallElement(grpc_call_element* elem,
- const grpc_call_element_args* args);
- static void DestroyCallElement(grpc_call_element* elem,
- const grpc_call_final_info* /*final_info*/,
- grpc_closure* /*ignored*/);
- static void StartTransportStreamOpBatch(
- grpc_call_element* elem, grpc_transport_stream_op_batch* batch);
-
- private:
- // Helper functions for handling calls at the top of the call stack.
- static void RecvInitialMetadataBatchComplete(void* arg, grpc_error* error);
- void StartNewRpc(grpc_call_element* elem);
- static void PublishNewRpc(void* arg, grpc_error* error);
-
- // Functions used inside the call stack.
- void StartTransportStreamOpBatchImpl(grpc_call_element* elem,
- grpc_transport_stream_op_batch* batch);
- static void RecvInitialMetadataReady(void* arg, grpc_error* error);
- static void RecvTrailingMetadataReady(void* arg, grpc_error* error);
-
- RefCountedPtr<Server> server_;
-
- grpc_call* call_;
-
- Atomic<CallState> state_{CallState::NOT_STARTED};
-
- y_absl::optional<grpc_slice> path_;
- y_absl::optional<grpc_slice> host_;
- grpc_millis deadline_ = GRPC_MILLIS_INF_FUTURE;
-
- grpc_completion_queue* cq_new_ = nullptr;
-
- RequestMatcherInterface* matcher_ = nullptr;
- grpc_byte_buffer* payload_ = nullptr;
-
- grpc_closure kill_zombie_closure_;
-
- grpc_metadata_array initial_metadata_ =
- grpc_metadata_array(); // Zero-initialize the C struct.
- grpc_closure recv_initial_metadata_batch_complete_;
-
- grpc_metadata_batch* recv_initial_metadata_ = nullptr;
- uint32_t recv_initial_metadata_flags_ = 0;
- grpc_closure recv_initial_metadata_ready_;
- grpc_closure* original_recv_initial_metadata_ready_;
- grpc_error* recv_initial_metadata_error_ = GRPC_ERROR_NONE;
-
- bool seen_recv_trailing_metadata_ready_ = false;
- grpc_closure recv_trailing_metadata_ready_;
- grpc_closure* original_recv_trailing_metadata_ready_;
- grpc_error* recv_trailing_metadata_error_ = GRPC_ERROR_NONE;
-
- grpc_closure publish_;
-
- CallCombiner* call_combiner_;
- };
-
- struct Listener {
- explicit Listener(OrphanablePtr<ListenerInterface> l)
- : listener(std::move(l)) {}
- OrphanablePtr<ListenerInterface> listener;
- grpc_closure destroy_done;
- };
-
- struct ShutdownTag {
- ShutdownTag(void* tag_arg, grpc_completion_queue* cq_arg)
- : tag(tag_arg), cq(cq_arg) {}
- void* const tag;
- grpc_completion_queue* const cq;
- grpc_cq_completion completion;
- };
-
- static void ListenerDestroyDone(void* arg, grpc_error* error);
-
- static void DoneShutdownEvent(void* server,
- grpc_cq_completion* /*completion*/) {
- static_cast<Server*>(server)->Unref();
- }
-
- static void DoneRequestEvent(void* req, grpc_cq_completion* completion);
-
- void FailCall(size_t cq_idx, RequestedCall* rc, grpc_error* error);
- grpc_call_error QueueRequestedCall(size_t cq_idx, RequestedCall* rc);
-
- void MaybeFinishShutdown();
-
- void KillPendingWorkLocked(grpc_error* error);
-
- static grpc_call_error ValidateServerRequest(
- grpc_completion_queue* cq_for_notification, void* tag,
- grpc_byte_buffer** optional_payload, RegisteredMethod* rm);
- grpc_call_error ValidateServerRequestAndCq(
- size_t* cq_idx, grpc_completion_queue* cq_for_notification, void* tag,
- grpc_byte_buffer** optional_payload, RegisteredMethod* rm);
-
- std::vector<grpc_channel*> GetChannelsLocked() const;
-
- grpc_channel_args* const channel_args_;
- grpc_resource_user* default_resource_user_ = nullptr;
- RefCountedPtr<channelz::ServerNode> channelz_node_;
-
- std::vector<grpc_completion_queue*> cqs_;
- std::vector<grpc_pollset*> pollsets_;
- bool started_ = false;
-
- // The two following mutexes control access to server-state.
- // mu_global_ controls access to non-call-related state (e.g., channel state).
- // mu_call_ controls access to call-related state (e.g., the call lists).
- //
- // If they are ever required to be nested, you must lock mu_global_
- // before mu_call_. This is currently used in shutdown processing
- // (ShutdownAndNotify() and MaybeFinishShutdown()).
- Mutex mu_global_; // mutex for server and channel state
- Mutex mu_call_; // mutex for call-specific state
-
- // startup synchronization: flag is protected by mu_global_, signals whether
- // we are doing the listener start routine or not.
- bool starting_ = false;
- CondVar starting_cv_;
-
- std::vector<std::unique_ptr<RegisteredMethod>> registered_methods_;
-
- // Request matcher for unregistered methods.
- std::unique_ptr<RequestMatcherInterface> unregistered_request_matcher_;
-
- std::atomic_bool shutdown_flag_{false};
- bool shutdown_published_ = false;
- std::vector<ShutdownTag> shutdown_tags_;
-
- std::list<ChannelData*> channels_;
-
- std::list<Listener> listeners_;
- size_t listeners_destroyed_ = 0;
-
- // The last time we printed a shutdown progress message.
- gpr_timespec last_shutdown_message_time_;
-};
-
-} // namespace grpc_core
-
-struct grpc_server {
- grpc_core::OrphanablePtr<grpc_core::Server> core_server;
-};
-
+namespace grpc_core {
+
+extern TraceFlag grpc_server_channel_trace;
+
+class Server : public InternallyRefCounted<Server> {
+ public:
+ // Filter vtable.
+ static const grpc_channel_filter kServerTopFilter;
+
+ // Opaque type used for registered methods.
+ struct RegisteredMethod;
+
+ // An object to represent the most relevant characteristics of a
+ // newly-allocated call object when using an AllocatingRequestMatcherBatch.
+ struct BatchCallAllocation {
+ grpc_experimental_completion_queue_functor* tag;
+ grpc_call** call;
+ grpc_metadata_array* initial_metadata;
+ grpc_call_details* details;
+ };
+
+ // An object to represent the most relevant characteristics of a
+ // newly-allocated call object when using an
+ // AllocatingRequestMatcherRegistered.
+ struct RegisteredCallAllocation {
+ grpc_experimental_completion_queue_functor* tag;
+ grpc_call** call;
+ grpc_metadata_array* initial_metadata;
+ gpr_timespec* deadline;
+ grpc_byte_buffer** optional_payload;
+ };
+
+ /// Interface for listeners.
+ /// Implementations must override the Orphan() method, which should stop
+ /// listening and initiate destruction of the listener.
+ class ListenerInterface : public Orphanable {
+ public:
+ virtual ~ListenerInterface() = default;
+
+ /// Starts listening. This listener may refer to the pollset object beyond
+ /// this call, so it is a pointer rather than a reference.
+ virtual void Start(Server* server,
+ const std::vector<grpc_pollset*>* pollsets) = 0;
+
+ /// Returns the channelz node for the listen socket, or null if not
+ /// supported.
+ virtual channelz::ListenSocketNode* channelz_listen_socket_node() const = 0;
+
+ /// Sets a closure to be invoked by the listener when its destruction
+ /// is complete.
+ virtual void SetOnDestroyDone(grpc_closure* on_destroy_done) = 0;
+ };
+
+ explicit Server(const grpc_channel_args* args);
+ ~Server();
+
+ void Orphan() override;
+
+ const grpc_channel_args* channel_args() const { return channel_args_; }
+ grpc_resource_user* default_resource_user() const {
+ return default_resource_user_;
+ }
+ channelz::ServerNode* channelz_node() const { return channelz_node_.get(); }
+
+ // Do not call this before Start(). Returns the pollsets. The
+ // vector itself is immutable, but the pollsets inside are mutable. The
+ // result is valid for the lifetime of the server.
+ const std::vector<grpc_pollset*>& pollsets() const { return pollsets_; }
+
+ bool HasOpenConnections();
+
+ // Adds a listener to the server. When the server starts, it will call
+ // the listener's Start() method, and when it shuts down, it will orphan
+ // the listener.
+ void AddListener(OrphanablePtr<ListenerInterface> listener);
+
+ // Starts listening for connections.
+ void Start();
+
+ // Sets up a transport. Creates a channel stack and binds the transport to
+ // the server. Called from the listener when a new connection is accepted.
+ void SetupTransport(grpc_transport* transport,
+ grpc_pollset* accepting_pollset,
+ const grpc_channel_args* args,
+ const RefCountedPtr<channelz::SocketNode>& socket_node,
+ grpc_resource_user* resource_user = nullptr);
+
+ void RegisterCompletionQueue(grpc_completion_queue* cq);
+
+ // Functions to specify that a specific registered method or the unregistered
+ // collection should use a specific allocator for request matching.
+ void SetRegisteredMethodAllocator(
+ grpc_completion_queue* cq, void* method_tag,
+ std::function<RegisteredCallAllocation()> allocator);
+ void SetBatchMethodAllocator(grpc_completion_queue* cq,
+ std::function<BatchCallAllocation()> allocator);
+
+ RegisteredMethod* RegisterMethod(
+ const char* method, const char* host,
+ grpc_server_register_method_payload_handling payload_handling,
+ uint32_t flags);
+
+ grpc_call_error RequestCall(grpc_call** call, grpc_call_details* details,
+ grpc_metadata_array* request_metadata,
+ grpc_completion_queue* cq_bound_to_call,
+ grpc_completion_queue* cq_for_notification,
+ void* tag);
+
+ grpc_call_error RequestRegisteredCall(
+ RegisteredMethod* rm, grpc_call** call, gpr_timespec* deadline,
+ grpc_metadata_array* request_metadata,
+ grpc_byte_buffer** optional_payload,
+ grpc_completion_queue* cq_bound_to_call,
+ grpc_completion_queue* cq_for_notification, void* tag_new);
+
+ void ShutdownAndNotify(grpc_completion_queue* cq, void* tag);
+
+ void CancelAllCalls();
+
+ private:
+ struct RequestedCall;
+
+ struct ChannelRegisteredMethod {
+ RegisteredMethod* server_registered_method = nullptr;
+ uint32_t flags;
+ bool has_host;
+ ExternallyManagedSlice method;
+ ExternallyManagedSlice host;
+ };
+
+ class RequestMatcherInterface;
+ class RealRequestMatcher;
+ class AllocatingRequestMatcherBase;
+ class AllocatingRequestMatcherBatch;
+ class AllocatingRequestMatcherRegistered;
+
+ class ChannelData {
+ public:
+ ChannelData() = default;
+ ~ChannelData();
+
+ void InitTransport(RefCountedPtr<Server> server, grpc_channel* channel,
+ size_t cq_idx, grpc_transport* transport,
+ intptr_t channelz_socket_uuid);
+
+ RefCountedPtr<Server> server() const { return server_; }
+ grpc_channel* channel() const { return channel_; }
+ size_t cq_idx() const { return cq_idx_; }
+
+ ChannelRegisteredMethod* GetRegisteredMethod(const grpc_slice& host,
+ const grpc_slice& path,
+ bool is_idempotent);
+
+ // Filter vtable functions.
+ static grpc_error* InitChannelElement(grpc_channel_element* elem,
+ grpc_channel_element_args* args);
+ static void DestroyChannelElement(grpc_channel_element* elem);
+
+ private:
+ class ConnectivityWatcher;
+
+ static void AcceptStream(void* arg, grpc_transport* /*transport*/,
+ const void* transport_server_data);
+
+ void Destroy();
+
+ static void FinishDestroy(void* arg, grpc_error* error);
+
+ RefCountedPtr<Server> server_;
+ grpc_channel* channel_;
+ // The index into Server::cqs_ of the CQ used as a starting point for
+ // where to publish new incoming calls.
+ size_t cq_idx_;
+ y_absl::optional<std::list<ChannelData*>::iterator> list_position_;
+ // A hash-table of the methods and hosts of the registered methods.
+ // TODO(vjpai): Convert this to an STL map type as opposed to a direct
+ // bucket implementation. (Consider performance impact, hash function to
+ // use, etc.)
+ std::unique_ptr<std::vector<ChannelRegisteredMethod>> registered_methods_;
+ uint32_t registered_method_max_probes_;
+ grpc_closure finish_destroy_channel_closure_;
+ intptr_t channelz_socket_uuid_;
+ };
+
+ class CallData {
+ public:
+ enum class CallState {
+ NOT_STARTED, // Waiting for metadata.
+ PENDING, // Initial metadata read, not flow controlled in yet.
+ ACTIVATED, // Flow controlled in, on completion queue.
+ ZOMBIED, // Cancelled before being queued.
+ };
+
+ CallData(grpc_call_element* elem, const grpc_call_element_args& args,
+ RefCountedPtr<Server> server);
+ ~CallData();
+
+ // Starts the recv_initial_metadata batch on the call.
+ // Invoked from ChannelData::AcceptStream().
+ void Start(grpc_call_element* elem);
+
+ void SetState(CallState state);
+
+ // Attempts to move from PENDING to ACTIVATED state. Returns true
+ // on success.
+ bool MaybeActivate();
+
+ // Publishes an incoming call to the application after it has been
+ // matched.
+ void Publish(size_t cq_idx, RequestedCall* rc);
+
+ void KillZombie();
+
+ void FailCallCreation();
+
+ // Filter vtable functions.
+ static grpc_error* InitCallElement(grpc_call_element* elem,
+ const grpc_call_element_args* args);
+ static void DestroyCallElement(grpc_call_element* elem,
+ const grpc_call_final_info* /*final_info*/,
+ grpc_closure* /*ignored*/);
+ static void StartTransportStreamOpBatch(
+ grpc_call_element* elem, grpc_transport_stream_op_batch* batch);
+
+ private:
+ // Helper functions for handling calls at the top of the call stack.
+ static void RecvInitialMetadataBatchComplete(void* arg, grpc_error* error);
+ void StartNewRpc(grpc_call_element* elem);
+ static void PublishNewRpc(void* arg, grpc_error* error);
+
+ // Functions used inside the call stack.
+ void StartTransportStreamOpBatchImpl(grpc_call_element* elem,
+ grpc_transport_stream_op_batch* batch);
+ static void RecvInitialMetadataReady(void* arg, grpc_error* error);
+ static void RecvTrailingMetadataReady(void* arg, grpc_error* error);
+
+ RefCountedPtr<Server> server_;
+
+ grpc_call* call_;
+
+ Atomic<CallState> state_{CallState::NOT_STARTED};
+
+ y_absl::optional<grpc_slice> path_;
+ y_absl::optional<grpc_slice> host_;
+ grpc_millis deadline_ = GRPC_MILLIS_INF_FUTURE;
+
+ grpc_completion_queue* cq_new_ = nullptr;
+
+ RequestMatcherInterface* matcher_ = nullptr;
+ grpc_byte_buffer* payload_ = nullptr;
+
+ grpc_closure kill_zombie_closure_;
+
+ grpc_metadata_array initial_metadata_ =
+ grpc_metadata_array(); // Zero-initialize the C struct.
+ grpc_closure recv_initial_metadata_batch_complete_;
+
+ grpc_metadata_batch* recv_initial_metadata_ = nullptr;
+ uint32_t recv_initial_metadata_flags_ = 0;
+ grpc_closure recv_initial_metadata_ready_;
+ grpc_closure* original_recv_initial_metadata_ready_;
+ grpc_error* recv_initial_metadata_error_ = GRPC_ERROR_NONE;
+
+ bool seen_recv_trailing_metadata_ready_ = false;
+ grpc_closure recv_trailing_metadata_ready_;
+ grpc_closure* original_recv_trailing_metadata_ready_;
+ grpc_error* recv_trailing_metadata_error_ = GRPC_ERROR_NONE;
+
+ grpc_closure publish_;
+
+ CallCombiner* call_combiner_;
+ };
+
+ struct Listener {
+ explicit Listener(OrphanablePtr<ListenerInterface> l)
+ : listener(std::move(l)) {}
+ OrphanablePtr<ListenerInterface> listener;
+ grpc_closure destroy_done;
+ };
+
+ struct ShutdownTag {
+ ShutdownTag(void* tag_arg, grpc_completion_queue* cq_arg)
+ : tag(tag_arg), cq(cq_arg) {}
+ void* const tag;
+ grpc_completion_queue* const cq;
+ grpc_cq_completion completion;
+ };
+
+ static void ListenerDestroyDone(void* arg, grpc_error* error);
+
+ static void DoneShutdownEvent(void* server,
+ grpc_cq_completion* /*completion*/) {
+ static_cast<Server*>(server)->Unref();
+ }
+
+ static void DoneRequestEvent(void* req, grpc_cq_completion* completion);
+
+ void FailCall(size_t cq_idx, RequestedCall* rc, grpc_error* error);
+ grpc_call_error QueueRequestedCall(size_t cq_idx, RequestedCall* rc);
+
+ void MaybeFinishShutdown();
+
+ void KillPendingWorkLocked(grpc_error* error);
+
+ static grpc_call_error ValidateServerRequest(
+ grpc_completion_queue* cq_for_notification, void* tag,
+ grpc_byte_buffer** optional_payload, RegisteredMethod* rm);
+ grpc_call_error ValidateServerRequestAndCq(
+ size_t* cq_idx, grpc_completion_queue* cq_for_notification, void* tag,
+ grpc_byte_buffer** optional_payload, RegisteredMethod* rm);
+
+ std::vector<grpc_channel*> GetChannelsLocked() const;
+
+ grpc_channel_args* const channel_args_;
+ grpc_resource_user* default_resource_user_ = nullptr;
+ RefCountedPtr<channelz::ServerNode> channelz_node_;
+
+ std::vector<grpc_completion_queue*> cqs_;
+ std::vector<grpc_pollset*> pollsets_;
+ bool started_ = false;
+
+ // The two following mutexes control access to server-state.
+ // mu_global_ controls access to non-call-related state (e.g., channel state).
+ // mu_call_ controls access to call-related state (e.g., the call lists).
+ //
+ // If they are ever required to be nested, you must lock mu_global_
+ // before mu_call_. This is currently used in shutdown processing
+ // (ShutdownAndNotify() and MaybeFinishShutdown()).
+ Mutex mu_global_; // mutex for server and channel state
+ Mutex mu_call_; // mutex for call-specific state
+
+ // startup synchronization: flag is protected by mu_global_, signals whether
+ // we are doing the listener start routine or not.
+ bool starting_ = false;
+ CondVar starting_cv_;
+
+ std::vector<std::unique_ptr<RegisteredMethod>> registered_methods_;
+
+ // Request matcher for unregistered methods.
+ std::unique_ptr<RequestMatcherInterface> unregistered_request_matcher_;
+
+ std::atomic_bool shutdown_flag_{false};
+ bool shutdown_published_ = false;
+ std::vector<ShutdownTag> shutdown_tags_;
+
+ std::list<ChannelData*> channels_;
+
+ std::list<Listener> listeners_;
+ size_t listeners_destroyed_ = 0;
+
+ // The last time we printed a shutdown progress message.
+ gpr_timespec last_shutdown_message_time_;
+};
+
+} // namespace grpc_core
+
+struct grpc_server {
+ grpc_core::OrphanablePtr<grpc_core::Server> core_server;
+};
+
#endif /* GRPC_CORE_LIB_SURFACE_SERVER_H */
diff --git a/contrib/libs/grpc/src/core/lib/surface/version.cc b/contrib/libs/grpc/src/core/lib/surface/version.cc
index 1cf5eafd0bb..bed4f427e99 100644
--- a/contrib/libs/grpc/src/core/lib/surface/version.cc
+++ b/contrib/libs/grpc/src/core/lib/surface/version.cc
@@ -23,6 +23,6 @@
#include <grpc/grpc.h>
-const char* grpc_version_string(void) { return "13.0.0"; }
+const char* grpc_version_string(void) { return "13.0.0"; }
-const char* grpc_g_stands_for(void) { return "geeky"; }
+const char* grpc_g_stands_for(void) { return "geeky"; }
diff --git a/contrib/libs/grpc/src/core/lib/transport/authority_override.cc b/contrib/libs/grpc/src/core/lib/transport/authority_override.cc
index 5abb13386e7..8c13320b73b 100644
--- a/contrib/libs/grpc/src/core/lib/transport/authority_override.cc
+++ b/contrib/libs/grpc/src/core/lib/transport/authority_override.cc
@@ -1,38 +1,38 @@
-//
-// Copyright 2020 gRPC authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-#include <grpc/support/port_platform.h>
-
-#include "src/core/lib/channel/channel_args.h"
-
-// Channel arg key for the authority override.
-#define GRPC_ARG_AUTHORITY_OVERRIDE "grpc.authority_override"
-
-namespace grpc_core {
-
-/// Returns a channel argument containing \a authority.
-grpc_arg CreateAuthorityOverrideChannelArg(const char* authority) {
- return grpc_channel_arg_string_create(
- const_cast<char*>(GRPC_ARG_AUTHORITY_OVERRIDE),
- const_cast<char*>(authority));
-}
-
-/// Returns the authority override from \a args or nullptr.
-const char* FindAuthorityOverrideInArgs(const grpc_channel_args* args) {
- return grpc_channel_args_find_string(args, GRPC_ARG_AUTHORITY_OVERRIDE);
-}
-
-} // namespace grpc_core
+//
+// Copyright 2020 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/lib/channel/channel_args.h"
+
+// Channel arg key for the authority override.
+#define GRPC_ARG_AUTHORITY_OVERRIDE "grpc.authority_override"
+
+namespace grpc_core {
+
+/// Returns a channel argument containing \a authority.
+grpc_arg CreateAuthorityOverrideChannelArg(const char* authority) {
+ return grpc_channel_arg_string_create(
+ const_cast<char*>(GRPC_ARG_AUTHORITY_OVERRIDE),
+ const_cast<char*>(authority));
+}
+
+/// Returns the authority override from \a args or nullptr.
+const char* FindAuthorityOverrideInArgs(const grpc_channel_args* args) {
+ return grpc_channel_args_find_string(args, GRPC_ARG_AUTHORITY_OVERRIDE);
+}
+
+} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/lib/transport/authority_override.h b/contrib/libs/grpc/src/core/lib/transport/authority_override.h
index 667b33aaf44..9e584b56cb7 100644
--- a/contrib/libs/grpc/src/core/lib/transport/authority_override.h
+++ b/contrib/libs/grpc/src/core/lib/transport/authority_override.h
@@ -1,32 +1,32 @@
-//
-// Copyright 2020 gRPC authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-#ifndef GRPC_CORE_LIB_TRANSPORT_AUTHORITY_OVERRIDE_H
-#define GRPC_CORE_LIB_TRANSPORT_AUTHORITY_OVERRIDE_H
-
-#include <grpc/support/port_platform.h>
-
-namespace grpc_core {
-
-/// Returns a channel argument containing \a authority.
-grpc_arg CreateAuthorityOverrideChannelArg(const char* authority);
-
-/// Returns the authority override from \a args or nullptr.
-const char* FindAuthorityOverrideInArgs(const grpc_channel_args* args);
-
-} // namespace grpc_core
-
-#endif /* GRPC_CORE_LIB_TRANSPORT_AUTHORITY_OVERRIDE_H */
+//
+// Copyright 2020 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+#ifndef GRPC_CORE_LIB_TRANSPORT_AUTHORITY_OVERRIDE_H
+#define GRPC_CORE_LIB_TRANSPORT_AUTHORITY_OVERRIDE_H
+
+#include <grpc/support/port_platform.h>
+
+namespace grpc_core {
+
+/// Returns a channel argument containing \a authority.
+grpc_arg CreateAuthorityOverrideChannelArg(const char* authority);
+
+/// Returns the authority override from \a args or nullptr.
+const char* FindAuthorityOverrideInArgs(const grpc_channel_args* args);
+
+} // namespace grpc_core
+
+#endif /* GRPC_CORE_LIB_TRANSPORT_AUTHORITY_OVERRIDE_H */
diff --git a/contrib/libs/grpc/src/core/lib/transport/bdp_estimator.h b/contrib/libs/grpc/src/core/lib/transport/bdp_estimator.h
index babbdab93f9..7eb336d8bb4 100644
--- a/contrib/libs/grpc/src/core/lib/transport/bdp_estimator.h
+++ b/contrib/libs/grpc/src/core/lib/transport/bdp_estimator.h
@@ -74,8 +74,8 @@ class BdpEstimator {
// Completes a previously started ping, returns when to schedule the next one
grpc_millis CompletePing();
- int64_t accumulator() { return accumulator_; }
-
+ int64_t accumulator() { return accumulator_; }
+
private:
enum class PingState { UNSCHEDULED, SCHEDULED, STARTED };
diff --git a/contrib/libs/grpc/src/core/lib/transport/byte_stream.h b/contrib/libs/grpc/src/core/lib/transport/byte_stream.h
index f56eeeb5ae8..ecb605ad9bb 100644
--- a/contrib/libs/grpc/src/core/lib/transport/byte_stream.h
+++ b/contrib/libs/grpc/src/core/lib/transport/byte_stream.h
@@ -26,15 +26,15 @@
#include "src/core/lib/iomgr/closure.h"
/** Internal bit flag for grpc_begin_message's \a flags signaling the use of
- * compression for the message. (Does not apply for stream compression.) */
+ * compression for the message. (Does not apply for stream compression.) */
#define GRPC_WRITE_INTERNAL_COMPRESS (0x80000000u)
-/** Internal bit flag for determining whether the message was compressed and had
- * to be decompressed by the message_decompress filter. (Does not apply for
- * stream compression.) */
-#define GRPC_WRITE_INTERNAL_TEST_ONLY_WAS_COMPRESSED (0x40000000u)
+/** Internal bit flag for determining whether the message was compressed and had
+ * to be decompressed by the message_decompress filter. (Does not apply for
+ * stream compression.) */
+#define GRPC_WRITE_INTERNAL_TEST_ONLY_WAS_COMPRESSED (0x40000000u)
/** Mask of all valid internal flags. */
-#define GRPC_WRITE_INTERNAL_USED_MASK \
- (GRPC_WRITE_INTERNAL_COMPRESS | GRPC_WRITE_INTERNAL_TEST_ONLY_WAS_COMPRESSED)
+#define GRPC_WRITE_INTERNAL_USED_MASK \
+ (GRPC_WRITE_INTERNAL_COMPRESS | GRPC_WRITE_INTERNAL_TEST_ONLY_WAS_COMPRESSED)
namespace grpc_core {
diff --git a/contrib/libs/grpc/src/core/lib/transport/connectivity_state.cc b/contrib/libs/grpc/src/core/lib/transport/connectivity_state.cc
index 016faa39c16..7b130490177 100644
--- a/contrib/libs/grpc/src/core/lib/transport/connectivity_state.cc
+++ b/contrib/libs/grpc/src/core/lib/transport/connectivity_state.cc
@@ -58,13 +58,13 @@ const char* ConnectivityStateName(grpc_connectivity_state state) {
class AsyncConnectivityStateWatcherInterface::Notifier {
public:
Notifier(RefCountedPtr<AsyncConnectivityStateWatcherInterface> watcher,
- grpc_connectivity_state state, const y_absl::Status& status,
- const std::shared_ptr<WorkSerializer>& work_serializer)
- : watcher_(std::move(watcher)), state_(state), status_(status) {
- if (work_serializer != nullptr) {
- work_serializer->Run(
- [this]() { SendNotification(this, GRPC_ERROR_NONE); },
- DEBUG_LOCATION);
+ grpc_connectivity_state state, const y_absl::Status& status,
+ const std::shared_ptr<WorkSerializer>& work_serializer)
+ : watcher_(std::move(watcher)), state_(state), status_(status) {
+ if (work_serializer != nullptr) {
+ work_serializer->Run(
+ [this]() { SendNotification(this, GRPC_ERROR_NONE); },
+ DEBUG_LOCATION);
} else {
GRPC_CLOSURE_INIT(&closure_, SendNotification, this,
grpc_schedule_on_exec_ctx);
@@ -76,24 +76,24 @@ class AsyncConnectivityStateWatcherInterface::Notifier {
static void SendNotification(void* arg, grpc_error* /*ignored*/) {
Notifier* self = static_cast<Notifier*>(arg);
if (GRPC_TRACE_FLAG_ENABLED(grpc_connectivity_state_trace)) {
- gpr_log(GPR_INFO, "watcher %p: delivering async notification for %s (%s)",
- self->watcher_.get(), ConnectivityStateName(self->state_),
- self->status_.ToString().c_str());
+ gpr_log(GPR_INFO, "watcher %p: delivering async notification for %s (%s)",
+ self->watcher_.get(), ConnectivityStateName(self->state_),
+ self->status_.ToString().c_str());
}
- self->watcher_->OnConnectivityStateChange(self->state_, self->status_);
+ self->watcher_->OnConnectivityStateChange(self->state_, self->status_);
delete self;
}
RefCountedPtr<AsyncConnectivityStateWatcherInterface> watcher_;
const grpc_connectivity_state state_;
- const y_absl::Status status_;
+ const y_absl::Status status_;
grpc_closure closure_;
};
void AsyncConnectivityStateWatcherInterface::Notify(
- grpc_connectivity_state state, const y_absl::Status& status) {
- new Notifier(Ref(), state, status,
- work_serializer_); // Deletes itself when done.
+ grpc_connectivity_state state, const y_absl::Status& status) {
+ new Notifier(Ref(), state, status,
+ work_serializer_); // Deletes itself when done.
}
//
@@ -110,7 +110,7 @@ ConnectivityStateTracker::~ConnectivityStateTracker() {
name_, this, p.first, ConnectivityStateName(current_state),
ConnectivityStateName(GRPC_CHANNEL_SHUTDOWN));
}
- p.second->Notify(GRPC_CHANNEL_SHUTDOWN, y_absl::Status());
+ p.second->Notify(GRPC_CHANNEL_SHUTDOWN, y_absl::Status());
}
}
@@ -129,7 +129,7 @@ void ConnectivityStateTracker::AddWatcher(
name_, this, watcher.get(), ConnectivityStateName(initial_state),
ConnectivityStateName(current_state));
}
- watcher->Notify(current_state, status_);
+ watcher->Notify(current_state, status_);
}
// If we're in state SHUTDOWN, don't add the watcher, so that it will
// be orphaned immediately.
@@ -148,17 +148,17 @@ void ConnectivityStateTracker::RemoveWatcher(
}
void ConnectivityStateTracker::SetState(grpc_connectivity_state state,
- const y_absl::Status& status,
+ const y_absl::Status& status,
const char* reason) {
grpc_connectivity_state current_state = state_.Load(MemoryOrder::RELAXED);
if (state == current_state) return;
if (GRPC_TRACE_FLAG_ENABLED(grpc_connectivity_state_trace)) {
- gpr_log(GPR_INFO, "ConnectivityStateTracker %s[%p]: %s -> %s (%s, %s)",
- name_, this, ConnectivityStateName(current_state),
- ConnectivityStateName(state), reason, status.ToString().c_str());
+ gpr_log(GPR_INFO, "ConnectivityStateTracker %s[%p]: %s -> %s (%s, %s)",
+ name_, this, ConnectivityStateName(current_state),
+ ConnectivityStateName(state), reason, status.ToString().c_str());
}
state_.Store(state, MemoryOrder::RELAXED);
- status_ = status;
+ status_ = status;
for (const auto& p : watchers_) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_connectivity_state_trace)) {
gpr_log(GPR_INFO,
@@ -166,7 +166,7 @@ void ConnectivityStateTracker::SetState(grpc_connectivity_state state,
name_, this, p.first, ConnectivityStateName(current_state),
ConnectivityStateName(state));
}
- p.second->Notify(state, status);
+ p.second->Notify(state, status);
}
// If the new state is SHUTDOWN, orphan all of the watchers. This
// avoids the need for the callers to explicitly cancel them.
diff --git a/contrib/libs/grpc/src/core/lib/transport/connectivity_state.h b/contrib/libs/grpc/src/core/lib/transport/connectivity_state.h
index 21408bab6b6..9e34c646c76 100644
--- a/contrib/libs/grpc/src/core/lib/transport/connectivity_state.h
+++ b/contrib/libs/grpc/src/core/lib/transport/connectivity_state.h
@@ -21,8 +21,8 @@
#include <grpc/support/port_platform.h>
-#include "y_absl/status/status.h"
-
+#include "y_absl/status/status.h"
+
#include <grpc/grpc.h>
#include "src/core/lib/debug/trace.h"
@@ -31,7 +31,7 @@
#include "src/core/lib/gprpp/orphanable.h"
#include "src/core/lib/iomgr/closure.h"
#include "src/core/lib/iomgr/exec_ctx.h"
-#include "src/core/lib/iomgr/work_serializer.h"
+#include "src/core/lib/iomgr/work_serializer.h"
namespace grpc_core {
@@ -51,8 +51,8 @@ class ConnectivityStateWatcherInterface
virtual ~ConnectivityStateWatcherInterface() = default;
// Notifies the watcher that the state has changed to new_state.
- virtual void Notify(grpc_connectivity_state new_state,
- const y_absl::Status& status) = 0;
+ virtual void Notify(grpc_connectivity_state new_state,
+ const y_absl::Status& status) = 0;
void Orphan() override { Unref(); }
};
@@ -67,24 +67,24 @@ class AsyncConnectivityStateWatcherInterface
// Schedules a closure on the ExecCtx to invoke
// OnConnectivityStateChange() asynchronously.
- void Notify(grpc_connectivity_state new_state,
- const y_absl::Status& status) override final;
+ void Notify(grpc_connectivity_state new_state,
+ const y_absl::Status& status) override final;
protected:
class Notifier;
- // If \a work_serializer is nullptr, then the notification will be scheduled
- // on the ExecCtx.
- explicit AsyncConnectivityStateWatcherInterface(
- std::shared_ptr<WorkSerializer> work_serializer = nullptr)
- : work_serializer_(std::move(work_serializer)) {}
+ // If \a work_serializer is nullptr, then the notification will be scheduled
+ // on the ExecCtx.
+ explicit AsyncConnectivityStateWatcherInterface(
+ std::shared_ptr<WorkSerializer> work_serializer = nullptr)
+ : work_serializer_(std::move(work_serializer)) {}
// Invoked asynchronously when Notify() is called.
- virtual void OnConnectivityStateChange(grpc_connectivity_state new_state,
- const y_absl::Status& status) = 0;
+ virtual void OnConnectivityStateChange(grpc_connectivity_state new_state,
+ const y_absl::Status& status) = 0;
private:
- std::shared_ptr<WorkSerializer> work_serializer_;
+ std::shared_ptr<WorkSerializer> work_serializer_;
};
// Tracks connectivity state. Maintains a list of watchers that are
@@ -96,9 +96,9 @@ class AsyncConnectivityStateWatcherInterface
class ConnectivityStateTracker {
public:
ConnectivityStateTracker(const char* name,
- grpc_connectivity_state state = GRPC_CHANNEL_IDLE,
- const y_absl::Status& status = y_absl::Status())
- : name_(name), state_(state), status_(status) {}
+ grpc_connectivity_state state = GRPC_CHANNEL_IDLE,
+ const y_absl::Status& status = y_absl::Status())
+ : name_(name), state_(state), status_(status) {}
~ConnectivityStateTracker();
@@ -116,21 +116,21 @@ class ConnectivityStateTracker {
// Sets connectivity state.
// Not thread safe; access must be serialized with an external lock.
- void SetState(grpc_connectivity_state state, const y_absl::Status& status,
- const char* reason);
+ void SetState(grpc_connectivity_state state, const y_absl::Status& status,
+ const char* reason);
// Gets the current state.
// Thread safe; no need to use an external lock.
grpc_connectivity_state state() const;
- // Get the current status.
- // Not thread safe; access must be serialized with an external lock.
- y_absl::Status status() const { return status_; }
-
+ // Get the current status.
+ // Not thread safe; access must be serialized with an external lock.
+ y_absl::Status status() const { return status_; }
+
private:
const char* name_;
Atomic<grpc_connectivity_state> state_;
- y_absl::Status status_;
+ y_absl::Status status_;
// TODO(roth): Once we can use C++-14 heterogeneous lookups, this can
// be a set instead of a map.
std::map<ConnectivityStateWatcherInterface*,
diff --git a/contrib/libs/grpc/src/core/lib/transport/error_utils.cc b/contrib/libs/grpc/src/core/lib/transport/error_utils.cc
index a17e630f949..9634f09ad1e 100644
--- a/contrib/libs/grpc/src/core/lib/transport/error_utils.cc
+++ b/contrib/libs/grpc/src/core/lib/transport/error_utils.cc
@@ -123,19 +123,19 @@ void grpc_error_get_status(grpc_error* error, grpc_millis deadline,
}
}
-y_absl::Status grpc_error_to_absl_status(grpc_error* error) {
- grpc_status_code status;
- // TODO(yashykt): This should be updated once we decide on how to use the
- // y_absl::Status payload to capture all the contents of grpc_error.
- grpc_slice message;
- grpc_error_get_status(error, GRPC_MILLIS_INF_FUTURE, &status, &message,
- nullptr /* http_error */, nullptr /* error_string */);
- return y_absl::Status(static_cast<y_absl::StatusCode>(status),
- y_absl::string_view(reinterpret_cast<const char*>(
- GRPC_SLICE_START_PTR(message)),
- GRPC_SLICE_LENGTH(message)));
-}
-
+y_absl::Status grpc_error_to_absl_status(grpc_error* error) {
+ grpc_status_code status;
+ // TODO(yashykt): This should be updated once we decide on how to use the
+ // y_absl::Status payload to capture all the contents of grpc_error.
+ grpc_slice message;
+ grpc_error_get_status(error, GRPC_MILLIS_INF_FUTURE, &status, &message,
+ nullptr /* http_error */, nullptr /* error_string */);
+ return y_absl::Status(static_cast<y_absl::StatusCode>(status),
+ y_absl::string_view(reinterpret_cast<const char*>(
+ GRPC_SLICE_START_PTR(message)),
+ GRPC_SLICE_LENGTH(message)));
+}
+
bool grpc_error_has_clear_grpc_status(grpc_error* error) {
intptr_t unused;
if (grpc_error_get_int(error, GRPC_ERROR_INT_GRPC_STATUS, &unused)) {
diff --git a/contrib/libs/grpc/src/core/lib/transport/error_utils.h b/contrib/libs/grpc/src/core/lib/transport/error_utils.h
index 8d34d99341a..fb967202f32 100644
--- a/contrib/libs/grpc/src/core/lib/transport/error_utils.h
+++ b/contrib/libs/grpc/src/core/lib/transport/error_utils.h
@@ -21,8 +21,8 @@
#include <grpc/support/port_platform.h>
-#include "y_absl/status/status.h"
-
+#include "y_absl/status/status.h"
+
#include "src/core/lib/iomgr/error.h"
#include "src/core/lib/iomgr/exec_ctx.h"
#include "src/core/lib/transport/http2_errors.h"
@@ -39,10 +39,10 @@ void grpc_error_get_status(grpc_error* error, grpc_millis deadline,
grpc_http2_error_code* http_status,
const char** error_string);
-/// Utility Function to convert a grpc_error * \a error to an y_absl::Status.
-/// Does NOT consume a ref to grpc_error.
-y_absl::Status grpc_error_to_absl_status(grpc_error* error);
-
+/// Utility Function to convert a grpc_error * \a error to an y_absl::Status.
+/// Does NOT consume a ref to grpc_error.
+y_absl::Status grpc_error_to_absl_status(grpc_error* error);
+
/// A utility function to check whether there is a clear status code that
/// doesn't need to be guessed in \a error. This means that \a error or some
/// child has GRPC_ERROR_INT_GRPC_STATUS set, or that it is GRPC_ERROR_NONE or
diff --git a/contrib/libs/grpc/src/core/lib/transport/metadata.cc b/contrib/libs/grpc/src/core/lib/transport/metadata.cc
index 51a86f7596f..33d4d5ac705 100644
--- a/contrib/libs/grpc/src/core/lib/transport/metadata.cc
+++ b/contrib/libs/grpc/src/core/lib/transport/metadata.cc
@@ -250,25 +250,25 @@ void grpc_mdctx_global_shutdown() {
gpr_mu_destroy(&shard->mu);
gc_mdtab(shard);
if (shard->count != 0) {
- gpr_log(GPR_ERROR, "WARNING: %" PRIuPTR " metadata elements were leaked",
+ gpr_log(GPR_ERROR, "WARNING: %" PRIuPTR " metadata elements were leaked",
shard->count);
- for (int i = 0; i < shard->capacity; i++) {
- for (InternedMetadata* md = shard->elems[i].next; md;
- md = md->bucket_next()) {
- char* key_str = grpc_slice_to_c_string(md->key());
- char* value_str = grpc_slice_to_c_string(md->value());
- gpr_log(GPR_ERROR, "mdelem '%s' = '%s'", key_str, value_str);
- gpr_free(key_str);
- gpr_free(value_str);
- }
- }
+ for (int i = 0; i < shard->capacity; i++) {
+ for (InternedMetadata* md = shard->elems[i].next; md;
+ md = md->bucket_next()) {
+ char* key_str = grpc_slice_to_c_string(md->key());
+ char* value_str = grpc_slice_to_c_string(md->value());
+ gpr_log(GPR_ERROR, "mdelem '%s' = '%s'", key_str, value_str);
+ gpr_free(key_str);
+ gpr_free(value_str);
+ }
+ }
if (grpc_iomgr_abort_on_leaks()) {
abort();
}
}
- // For ASAN builds, we don't want to crash here, because that will
- // prevent ASAN from providing leak detection information, which is
- // far more useful than this simple assertion.
+ // For ASAN builds, we don't want to crash here, because that will
+ // prevent ASAN from providing leak detection information, which is
+ // far more useful than this simple assertion.
#ifndef GRPC_ASAN_ENABLED
GPR_DEBUG_ASSERT(shard->count == 0);
#endif
diff --git a/contrib/libs/grpc/src/core/lib/transport/static_metadata.cc b/contrib/libs/grpc/src/core/lib/transport/static_metadata.cc
index 6ee96657000..e027c00d390 100644
--- a/contrib/libs/grpc/src/core/lib/transport/static_metadata.cc
+++ b/contrib/libs/grpc/src/core/lib/transport/static_metadata.cc
@@ -68,68 +68,68 @@ static constexpr uint8_t g_bytes[] = {
114, 118, 105, 99, 101, 46, 108, 111, 97, 100, 95, 115, 116, 97, 116,
115, 46, 118, 50, 46, 76, 111, 97, 100, 82, 101, 112, 111, 114, 116,
105, 110, 103, 83, 101, 114, 118, 105, 99, 101, 47, 83, 116, 114, 101,
- 97, 109, 76, 111, 97, 100, 83, 116, 97, 116, 115, 47, 101, 110, 118,
- 111, 121, 46, 115, 101, 114, 118, 105, 99, 101, 46, 108, 111, 97, 100,
- 95, 115, 116, 97, 116, 115, 46, 118, 51, 46, 76, 111, 97, 100, 82,
- 101, 112, 111, 114, 116, 105, 110, 103, 83, 101, 114, 118, 105, 99, 101,
- 47, 83, 116, 114, 101, 97, 109, 76, 111, 97, 100, 83, 116, 97, 116,
- 115, 47, 103, 114, 112, 99, 46, 104, 101, 97, 108, 116, 104, 46, 118,
- 49, 46, 72, 101, 97, 108, 116, 104, 47, 87, 97, 116, 99, 104, 47,
- 101, 110, 118, 111, 121, 46, 115, 101, 114, 118, 105, 99, 101, 46, 100,
- 105, 115, 99, 111, 118, 101, 114, 121, 46, 118, 50, 46, 65, 103, 103,
- 114, 101, 103, 97, 116, 101, 100, 68, 105, 115, 99, 111, 118, 101, 114,
- 121, 83, 101, 114, 118, 105, 99, 101, 47, 83, 116, 114, 101, 97, 109,
- 65, 103, 103, 114, 101, 103, 97, 116, 101, 100, 82, 101, 115, 111, 117,
- 114, 99, 101, 115, 47, 101, 110, 118, 111, 121, 46, 115, 101, 114, 118,
- 105, 99, 101, 46, 100, 105, 115, 99, 111, 118, 101, 114, 121, 46, 118,
- 51, 46, 65, 103, 103, 114, 101, 103, 97, 116, 101, 100, 68, 105, 115,
- 99, 111, 118, 101, 114, 121, 83, 101, 114, 118, 105, 99, 101, 47, 83,
- 116, 114, 101, 97, 109, 65, 103, 103, 114, 101, 103, 97, 116, 101, 100,
- 82, 101, 115, 111, 117, 114, 99, 101, 115, 100, 101, 102, 108, 97, 116,
- 101, 103, 122, 105, 112, 115, 116, 114, 101, 97, 109, 47, 103, 122, 105,
- 112, 71, 69, 84, 80, 79, 83, 84, 47, 47, 105, 110, 100, 101, 120,
- 46, 104, 116, 109, 108, 104, 116, 116, 112, 104, 116, 116, 112, 115, 50,
- 48, 48, 50, 48, 52, 50, 48, 54, 51, 48, 52, 52, 48, 48, 52,
- 48, 52, 53, 48, 48, 97, 99, 99, 101, 112, 116, 45, 99, 104, 97,
- 114, 115, 101, 116, 103, 122, 105, 112, 44, 32, 100, 101, 102, 108, 97,
- 116, 101, 97, 99, 99, 101, 112, 116, 45, 108, 97, 110, 103, 117, 97,
- 103, 101, 97, 99, 99, 101, 112, 116, 45, 114, 97, 110, 103, 101, 115,
- 97, 99, 99, 101, 112, 116, 97, 99, 99, 101, 115, 115, 45, 99, 111,
- 110, 116, 114, 111, 108, 45, 97, 108, 108, 111, 119, 45, 111, 114, 105,
- 103, 105, 110, 97, 103, 101, 97, 108, 108, 111, 119, 97, 117, 116, 104,
- 111, 114, 105, 122, 97, 116, 105, 111, 110, 99, 97, 99, 104, 101, 45,
- 99, 111, 110, 116, 114, 111, 108, 99, 111, 110, 116, 101, 110, 116, 45,
- 100, 105, 115, 112, 111, 115, 105, 116, 105, 111, 110, 99, 111, 110, 116,
- 101, 110, 116, 45, 108, 97, 110, 103, 117, 97, 103, 101, 99, 111, 110,
- 116, 101, 110, 116, 45, 108, 101, 110, 103, 116, 104, 99, 111, 110, 116,
- 101, 110, 116, 45, 108, 111, 99, 97, 116, 105, 111, 110, 99, 111, 110,
- 116, 101, 110, 116, 45, 114, 97, 110, 103, 101, 99, 111, 111, 107, 105,
- 101, 100, 97, 116, 101, 101, 116, 97, 103, 101, 120, 112, 101, 99, 116,
- 101, 120, 112, 105, 114, 101, 115, 102, 114, 111, 109, 105, 102, 45, 109,
- 97, 116, 99, 104, 105, 102, 45, 109, 111, 100, 105, 102, 105, 101, 100,
- 45, 115, 105, 110, 99, 101, 105, 102, 45, 110, 111, 110, 101, 45, 109,
- 97, 116, 99, 104, 105, 102, 45, 114, 97, 110, 103, 101, 105, 102, 45,
- 117, 110, 109, 111, 100, 105, 102, 105, 101, 100, 45, 115, 105, 110, 99,
- 101, 108, 97, 115, 116, 45, 109, 111, 100, 105, 102, 105, 101, 100, 108,
- 105, 110, 107, 108, 111, 99, 97, 116, 105, 111, 110, 109, 97, 120, 45,
- 102, 111, 114, 119, 97, 114, 100, 115, 112, 114, 111, 120, 121, 45, 97,
- 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 101, 112, 114, 111, 120,
- 121, 45, 97, 117, 116, 104, 111, 114, 105, 122, 97, 116, 105, 111, 110,
- 114, 97, 110, 103, 101, 114, 101, 102, 101, 114, 101, 114, 114, 101, 102,
- 114, 101, 115, 104, 114, 101, 116, 114, 121, 45, 97, 102, 116, 101, 114,
- 115, 101, 114, 118, 101, 114, 115, 101, 116, 45, 99, 111, 111, 107, 105,
- 101, 115, 116, 114, 105, 99, 116, 45, 116, 114, 97, 110, 115, 112, 111,
- 114, 116, 45, 115, 101, 99, 117, 114, 105, 116, 121, 116, 114, 97, 110,
- 115, 102, 101, 114, 45, 101, 110, 99, 111, 100, 105, 110, 103, 118, 97,
- 114, 121, 118, 105, 97, 119, 119, 119, 45, 97, 117, 116, 104, 101, 110,
- 116, 105, 99, 97, 116, 101, 48, 105, 100, 101, 110, 116, 105, 116, 121,
- 116, 114, 97, 105, 108, 101, 114, 115, 97, 112, 112, 108, 105, 99, 97,
- 116, 105, 111, 110, 47, 103, 114, 112, 99, 103, 114, 112, 99, 80, 85,
- 84, 108, 98, 45, 99, 111, 115, 116, 45, 98, 105, 110, 105, 100, 101,
- 110, 116, 105, 116, 121, 44, 100, 101, 102, 108, 97, 116, 101, 105, 100,
- 101, 110, 116, 105, 116, 121, 44, 103, 122, 105, 112, 100, 101, 102, 108,
- 97, 116, 101, 44, 103, 122, 105, 112, 105, 100, 101, 110, 116, 105, 116,
- 121, 44, 100, 101, 102, 108, 97, 116, 101, 44, 103, 122, 105, 112};
+ 97, 109, 76, 111, 97, 100, 83, 116, 97, 116, 115, 47, 101, 110, 118,
+ 111, 121, 46, 115, 101, 114, 118, 105, 99, 101, 46, 108, 111, 97, 100,
+ 95, 115, 116, 97, 116, 115, 46, 118, 51, 46, 76, 111, 97, 100, 82,
+ 101, 112, 111, 114, 116, 105, 110, 103, 83, 101, 114, 118, 105, 99, 101,
+ 47, 83, 116, 114, 101, 97, 109, 76, 111, 97, 100, 83, 116, 97, 116,
+ 115, 47, 103, 114, 112, 99, 46, 104, 101, 97, 108, 116, 104, 46, 118,
+ 49, 46, 72, 101, 97, 108, 116, 104, 47, 87, 97, 116, 99, 104, 47,
+ 101, 110, 118, 111, 121, 46, 115, 101, 114, 118, 105, 99, 101, 46, 100,
+ 105, 115, 99, 111, 118, 101, 114, 121, 46, 118, 50, 46, 65, 103, 103,
+ 114, 101, 103, 97, 116, 101, 100, 68, 105, 115, 99, 111, 118, 101, 114,
+ 121, 83, 101, 114, 118, 105, 99, 101, 47, 83, 116, 114, 101, 97, 109,
+ 65, 103, 103, 114, 101, 103, 97, 116, 101, 100, 82, 101, 115, 111, 117,
+ 114, 99, 101, 115, 47, 101, 110, 118, 111, 121, 46, 115, 101, 114, 118,
+ 105, 99, 101, 46, 100, 105, 115, 99, 111, 118, 101, 114, 121, 46, 118,
+ 51, 46, 65, 103, 103, 114, 101, 103, 97, 116, 101, 100, 68, 105, 115,
+ 99, 111, 118, 101, 114, 121, 83, 101, 114, 118, 105, 99, 101, 47, 83,
+ 116, 114, 101, 97, 109, 65, 103, 103, 114, 101, 103, 97, 116, 101, 100,
+ 82, 101, 115, 111, 117, 114, 99, 101, 115, 100, 101, 102, 108, 97, 116,
+ 101, 103, 122, 105, 112, 115, 116, 114, 101, 97, 109, 47, 103, 122, 105,
+ 112, 71, 69, 84, 80, 79, 83, 84, 47, 47, 105, 110, 100, 101, 120,
+ 46, 104, 116, 109, 108, 104, 116, 116, 112, 104, 116, 116, 112, 115, 50,
+ 48, 48, 50, 48, 52, 50, 48, 54, 51, 48, 52, 52, 48, 48, 52,
+ 48, 52, 53, 48, 48, 97, 99, 99, 101, 112, 116, 45, 99, 104, 97,
+ 114, 115, 101, 116, 103, 122, 105, 112, 44, 32, 100, 101, 102, 108, 97,
+ 116, 101, 97, 99, 99, 101, 112, 116, 45, 108, 97, 110, 103, 117, 97,
+ 103, 101, 97, 99, 99, 101, 112, 116, 45, 114, 97, 110, 103, 101, 115,
+ 97, 99, 99, 101, 112, 116, 97, 99, 99, 101, 115, 115, 45, 99, 111,
+ 110, 116, 114, 111, 108, 45, 97, 108, 108, 111, 119, 45, 111, 114, 105,
+ 103, 105, 110, 97, 103, 101, 97, 108, 108, 111, 119, 97, 117, 116, 104,
+ 111, 114, 105, 122, 97, 116, 105, 111, 110, 99, 97, 99, 104, 101, 45,
+ 99, 111, 110, 116, 114, 111, 108, 99, 111, 110, 116, 101, 110, 116, 45,
+ 100, 105, 115, 112, 111, 115, 105, 116, 105, 111, 110, 99, 111, 110, 116,
+ 101, 110, 116, 45, 108, 97, 110, 103, 117, 97, 103, 101, 99, 111, 110,
+ 116, 101, 110, 116, 45, 108, 101, 110, 103, 116, 104, 99, 111, 110, 116,
+ 101, 110, 116, 45, 108, 111, 99, 97, 116, 105, 111, 110, 99, 111, 110,
+ 116, 101, 110, 116, 45, 114, 97, 110, 103, 101, 99, 111, 111, 107, 105,
+ 101, 100, 97, 116, 101, 101, 116, 97, 103, 101, 120, 112, 101, 99, 116,
+ 101, 120, 112, 105, 114, 101, 115, 102, 114, 111, 109, 105, 102, 45, 109,
+ 97, 116, 99, 104, 105, 102, 45, 109, 111, 100, 105, 102, 105, 101, 100,
+ 45, 115, 105, 110, 99, 101, 105, 102, 45, 110, 111, 110, 101, 45, 109,
+ 97, 116, 99, 104, 105, 102, 45, 114, 97, 110, 103, 101, 105, 102, 45,
+ 117, 110, 109, 111, 100, 105, 102, 105, 101, 100, 45, 115, 105, 110, 99,
+ 101, 108, 97, 115, 116, 45, 109, 111, 100, 105, 102, 105, 101, 100, 108,
+ 105, 110, 107, 108, 111, 99, 97, 116, 105, 111, 110, 109, 97, 120, 45,
+ 102, 111, 114, 119, 97, 114, 100, 115, 112, 114, 111, 120, 121, 45, 97,
+ 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 101, 112, 114, 111, 120,
+ 121, 45, 97, 117, 116, 104, 111, 114, 105, 122, 97, 116, 105, 111, 110,
+ 114, 97, 110, 103, 101, 114, 101, 102, 101, 114, 101, 114, 114, 101, 102,
+ 114, 101, 115, 104, 114, 101, 116, 114, 121, 45, 97, 102, 116, 101, 114,
+ 115, 101, 114, 118, 101, 114, 115, 101, 116, 45, 99, 111, 111, 107, 105,
+ 101, 115, 116, 114, 105, 99, 116, 45, 116, 114, 97, 110, 115, 112, 111,
+ 114, 116, 45, 115, 101, 99, 117, 114, 105, 116, 121, 116, 114, 97, 110,
+ 115, 102, 101, 114, 45, 101, 110, 99, 111, 100, 105, 110, 103, 118, 97,
+ 114, 121, 118, 105, 97, 119, 119, 119, 45, 97, 117, 116, 104, 101, 110,
+ 116, 105, 99, 97, 116, 101, 48, 105, 100, 101, 110, 116, 105, 116, 121,
+ 116, 114, 97, 105, 108, 101, 114, 115, 97, 112, 112, 108, 105, 99, 97,
+ 116, 105, 111, 110, 47, 103, 114, 112, 99, 103, 114, 112, 99, 80, 85,
+ 84, 108, 98, 45, 99, 111, 115, 116, 45, 98, 105, 110, 105, 100, 101,
+ 110, 116, 105, 116, 121, 44, 100, 101, 102, 108, 97, 116, 101, 105, 100,
+ 101, 110, 116, 105, 116, 121, 44, 103, 122, 105, 112, 100, 101, 102, 108,
+ 97, 116, 101, 44, 103, 122, 105, 112, 105, 100, 101, 110, 116, 105, 116,
+ 121, 44, 100, 101, 102, 108, 97, 116, 101, 44, 103, 122, 105, 112};
grpc_slice_refcount grpc_core::StaticSliceRefcount::kStaticSubRefcount;
@@ -194,7 +194,7 @@ struct StaticMetadataCtx {
StaticSliceRefcount(102), StaticSliceRefcount(103),
StaticSliceRefcount(104), StaticSliceRefcount(105),
StaticSliceRefcount(106), StaticSliceRefcount(107),
- StaticSliceRefcount(108), StaticSliceRefcount(109),
+ StaticSliceRefcount(108), StaticSliceRefcount(109),
};
const StaticMetadataSlice slices[GRPC_STATIC_MDSTR_COUNT] = {
@@ -235,80 +235,80 @@ struct StaticMetadataCtx {
grpc_core::StaticMetadataSlice(&refcounts[33].base, 31, g_bytes + 434),
grpc_core::StaticMetadataSlice(&refcounts[34].base, 36, g_bytes + 465),
grpc_core::StaticMetadataSlice(&refcounts[35].base, 65, g_bytes + 501),
- grpc_core::StaticMetadataSlice(&refcounts[36].base, 65, g_bytes + 566),
- grpc_core::StaticMetadataSlice(&refcounts[37].base, 28, g_bytes + 631),
- grpc_core::StaticMetadataSlice(&refcounts[38].base, 80, g_bytes + 659),
- grpc_core::StaticMetadataSlice(&refcounts[39].base, 80, g_bytes + 739),
- grpc_core::StaticMetadataSlice(&refcounts[40].base, 7, g_bytes + 819),
- grpc_core::StaticMetadataSlice(&refcounts[41].base, 4, g_bytes + 826),
- grpc_core::StaticMetadataSlice(&refcounts[42].base, 11, g_bytes + 830),
- grpc_core::StaticMetadataSlice(&refcounts[43].base, 3, g_bytes + 841),
- grpc_core::StaticMetadataSlice(&refcounts[44].base, 4, g_bytes + 844),
- grpc_core::StaticMetadataSlice(&refcounts[45].base, 1, g_bytes + 848),
- grpc_core::StaticMetadataSlice(&refcounts[46].base, 11, g_bytes + 849),
- grpc_core::StaticMetadataSlice(&refcounts[47].base, 4, g_bytes + 860),
- grpc_core::StaticMetadataSlice(&refcounts[48].base, 5, g_bytes + 864),
- grpc_core::StaticMetadataSlice(&refcounts[49].base, 3, g_bytes + 869),
- grpc_core::StaticMetadataSlice(&refcounts[50].base, 3, g_bytes + 872),
- grpc_core::StaticMetadataSlice(&refcounts[51].base, 3, g_bytes + 875),
- grpc_core::StaticMetadataSlice(&refcounts[52].base, 3, g_bytes + 878),
- grpc_core::StaticMetadataSlice(&refcounts[53].base, 3, g_bytes + 881),
- grpc_core::StaticMetadataSlice(&refcounts[54].base, 3, g_bytes + 884),
- grpc_core::StaticMetadataSlice(&refcounts[55].base, 3, g_bytes + 887),
- grpc_core::StaticMetadataSlice(&refcounts[56].base, 14, g_bytes + 890),
- grpc_core::StaticMetadataSlice(&refcounts[57].base, 13, g_bytes + 904),
- grpc_core::StaticMetadataSlice(&refcounts[58].base, 15, g_bytes + 917),
- grpc_core::StaticMetadataSlice(&refcounts[59].base, 13, g_bytes + 932),
- grpc_core::StaticMetadataSlice(&refcounts[60].base, 6, g_bytes + 945),
- grpc_core::StaticMetadataSlice(&refcounts[61].base, 27, g_bytes + 951),
- grpc_core::StaticMetadataSlice(&refcounts[62].base, 3, g_bytes + 978),
- grpc_core::StaticMetadataSlice(&refcounts[63].base, 5, g_bytes + 981),
- grpc_core::StaticMetadataSlice(&refcounts[64].base, 13, g_bytes + 986),
- grpc_core::StaticMetadataSlice(&refcounts[65].base, 13, g_bytes + 999),
- grpc_core::StaticMetadataSlice(&refcounts[66].base, 19, g_bytes + 1012),
- grpc_core::StaticMetadataSlice(&refcounts[67].base, 16, g_bytes + 1031),
- grpc_core::StaticMetadataSlice(&refcounts[68].base, 14, g_bytes + 1047),
- grpc_core::StaticMetadataSlice(&refcounts[69].base, 16, g_bytes + 1061),
- grpc_core::StaticMetadataSlice(&refcounts[70].base, 13, g_bytes + 1077),
- grpc_core::StaticMetadataSlice(&refcounts[71].base, 6, g_bytes + 1090),
- grpc_core::StaticMetadataSlice(&refcounts[72].base, 4, g_bytes + 1096),
- grpc_core::StaticMetadataSlice(&refcounts[73].base, 4, g_bytes + 1100),
- grpc_core::StaticMetadataSlice(&refcounts[74].base, 6, g_bytes + 1104),
- grpc_core::StaticMetadataSlice(&refcounts[75].base, 7, g_bytes + 1110),
- grpc_core::StaticMetadataSlice(&refcounts[76].base, 4, g_bytes + 1117),
- grpc_core::StaticMetadataSlice(&refcounts[77].base, 8, g_bytes + 1121),
- grpc_core::StaticMetadataSlice(&refcounts[78].base, 17, g_bytes + 1129),
- grpc_core::StaticMetadataSlice(&refcounts[79].base, 13, g_bytes + 1146),
- grpc_core::StaticMetadataSlice(&refcounts[80].base, 8, g_bytes + 1159),
- grpc_core::StaticMetadataSlice(&refcounts[81].base, 19, g_bytes + 1167),
- grpc_core::StaticMetadataSlice(&refcounts[82].base, 13, g_bytes + 1186),
- grpc_core::StaticMetadataSlice(&refcounts[83].base, 4, g_bytes + 1199),
- grpc_core::StaticMetadataSlice(&refcounts[84].base, 8, g_bytes + 1203),
- grpc_core::StaticMetadataSlice(&refcounts[85].base, 12, g_bytes + 1211),
- grpc_core::StaticMetadataSlice(&refcounts[86].base, 18, g_bytes + 1223),
- grpc_core::StaticMetadataSlice(&refcounts[87].base, 19, g_bytes + 1241),
- grpc_core::StaticMetadataSlice(&refcounts[88].base, 5, g_bytes + 1260),
- grpc_core::StaticMetadataSlice(&refcounts[89].base, 7, g_bytes + 1265),
- grpc_core::StaticMetadataSlice(&refcounts[90].base, 7, g_bytes + 1272),
- grpc_core::StaticMetadataSlice(&refcounts[91].base, 11, g_bytes + 1279),
- grpc_core::StaticMetadataSlice(&refcounts[92].base, 6, g_bytes + 1290),
- grpc_core::StaticMetadataSlice(&refcounts[93].base, 10, g_bytes + 1296),
- grpc_core::StaticMetadataSlice(&refcounts[94].base, 25, g_bytes + 1306),
- grpc_core::StaticMetadataSlice(&refcounts[95].base, 17, g_bytes + 1331),
- grpc_core::StaticMetadataSlice(&refcounts[96].base, 4, g_bytes + 1348),
- grpc_core::StaticMetadataSlice(&refcounts[97].base, 3, g_bytes + 1352),
- grpc_core::StaticMetadataSlice(&refcounts[98].base, 16, g_bytes + 1355),
- grpc_core::StaticMetadataSlice(&refcounts[99].base, 1, g_bytes + 1371),
- grpc_core::StaticMetadataSlice(&refcounts[100].base, 8, g_bytes + 1372),
- grpc_core::StaticMetadataSlice(&refcounts[101].base, 8, g_bytes + 1380),
- grpc_core::StaticMetadataSlice(&refcounts[102].base, 16, g_bytes + 1388),
- grpc_core::StaticMetadataSlice(&refcounts[103].base, 4, g_bytes + 1404),
- grpc_core::StaticMetadataSlice(&refcounts[104].base, 3, g_bytes + 1408),
- grpc_core::StaticMetadataSlice(&refcounts[105].base, 11, g_bytes + 1411),
- grpc_core::StaticMetadataSlice(&refcounts[106].base, 16, g_bytes + 1422),
- grpc_core::StaticMetadataSlice(&refcounts[107].base, 13, g_bytes + 1438),
- grpc_core::StaticMetadataSlice(&refcounts[108].base, 12, g_bytes + 1451),
- grpc_core::StaticMetadataSlice(&refcounts[109].base, 21, g_bytes + 1463),
+ grpc_core::StaticMetadataSlice(&refcounts[36].base, 65, g_bytes + 566),
+ grpc_core::StaticMetadataSlice(&refcounts[37].base, 28, g_bytes + 631),
+ grpc_core::StaticMetadataSlice(&refcounts[38].base, 80, g_bytes + 659),
+ grpc_core::StaticMetadataSlice(&refcounts[39].base, 80, g_bytes + 739),
+ grpc_core::StaticMetadataSlice(&refcounts[40].base, 7, g_bytes + 819),
+ grpc_core::StaticMetadataSlice(&refcounts[41].base, 4, g_bytes + 826),
+ grpc_core::StaticMetadataSlice(&refcounts[42].base, 11, g_bytes + 830),
+ grpc_core::StaticMetadataSlice(&refcounts[43].base, 3, g_bytes + 841),
+ grpc_core::StaticMetadataSlice(&refcounts[44].base, 4, g_bytes + 844),
+ grpc_core::StaticMetadataSlice(&refcounts[45].base, 1, g_bytes + 848),
+ grpc_core::StaticMetadataSlice(&refcounts[46].base, 11, g_bytes + 849),
+ grpc_core::StaticMetadataSlice(&refcounts[47].base, 4, g_bytes + 860),
+ grpc_core::StaticMetadataSlice(&refcounts[48].base, 5, g_bytes + 864),
+ grpc_core::StaticMetadataSlice(&refcounts[49].base, 3, g_bytes + 869),
+ grpc_core::StaticMetadataSlice(&refcounts[50].base, 3, g_bytes + 872),
+ grpc_core::StaticMetadataSlice(&refcounts[51].base, 3, g_bytes + 875),
+ grpc_core::StaticMetadataSlice(&refcounts[52].base, 3, g_bytes + 878),
+ grpc_core::StaticMetadataSlice(&refcounts[53].base, 3, g_bytes + 881),
+ grpc_core::StaticMetadataSlice(&refcounts[54].base, 3, g_bytes + 884),
+ grpc_core::StaticMetadataSlice(&refcounts[55].base, 3, g_bytes + 887),
+ grpc_core::StaticMetadataSlice(&refcounts[56].base, 14, g_bytes + 890),
+ grpc_core::StaticMetadataSlice(&refcounts[57].base, 13, g_bytes + 904),
+ grpc_core::StaticMetadataSlice(&refcounts[58].base, 15, g_bytes + 917),
+ grpc_core::StaticMetadataSlice(&refcounts[59].base, 13, g_bytes + 932),
+ grpc_core::StaticMetadataSlice(&refcounts[60].base, 6, g_bytes + 945),
+ grpc_core::StaticMetadataSlice(&refcounts[61].base, 27, g_bytes + 951),
+ grpc_core::StaticMetadataSlice(&refcounts[62].base, 3, g_bytes + 978),
+ grpc_core::StaticMetadataSlice(&refcounts[63].base, 5, g_bytes + 981),
+ grpc_core::StaticMetadataSlice(&refcounts[64].base, 13, g_bytes + 986),
+ grpc_core::StaticMetadataSlice(&refcounts[65].base, 13, g_bytes + 999),
+ grpc_core::StaticMetadataSlice(&refcounts[66].base, 19, g_bytes + 1012),
+ grpc_core::StaticMetadataSlice(&refcounts[67].base, 16, g_bytes + 1031),
+ grpc_core::StaticMetadataSlice(&refcounts[68].base, 14, g_bytes + 1047),
+ grpc_core::StaticMetadataSlice(&refcounts[69].base, 16, g_bytes + 1061),
+ grpc_core::StaticMetadataSlice(&refcounts[70].base, 13, g_bytes + 1077),
+ grpc_core::StaticMetadataSlice(&refcounts[71].base, 6, g_bytes + 1090),
+ grpc_core::StaticMetadataSlice(&refcounts[72].base, 4, g_bytes + 1096),
+ grpc_core::StaticMetadataSlice(&refcounts[73].base, 4, g_bytes + 1100),
+ grpc_core::StaticMetadataSlice(&refcounts[74].base, 6, g_bytes + 1104),
+ grpc_core::StaticMetadataSlice(&refcounts[75].base, 7, g_bytes + 1110),
+ grpc_core::StaticMetadataSlice(&refcounts[76].base, 4, g_bytes + 1117),
+ grpc_core::StaticMetadataSlice(&refcounts[77].base, 8, g_bytes + 1121),
+ grpc_core::StaticMetadataSlice(&refcounts[78].base, 17, g_bytes + 1129),
+ grpc_core::StaticMetadataSlice(&refcounts[79].base, 13, g_bytes + 1146),
+ grpc_core::StaticMetadataSlice(&refcounts[80].base, 8, g_bytes + 1159),
+ grpc_core::StaticMetadataSlice(&refcounts[81].base, 19, g_bytes + 1167),
+ grpc_core::StaticMetadataSlice(&refcounts[82].base, 13, g_bytes + 1186),
+ grpc_core::StaticMetadataSlice(&refcounts[83].base, 4, g_bytes + 1199),
+ grpc_core::StaticMetadataSlice(&refcounts[84].base, 8, g_bytes + 1203),
+ grpc_core::StaticMetadataSlice(&refcounts[85].base, 12, g_bytes + 1211),
+ grpc_core::StaticMetadataSlice(&refcounts[86].base, 18, g_bytes + 1223),
+ grpc_core::StaticMetadataSlice(&refcounts[87].base, 19, g_bytes + 1241),
+ grpc_core::StaticMetadataSlice(&refcounts[88].base, 5, g_bytes + 1260),
+ grpc_core::StaticMetadataSlice(&refcounts[89].base, 7, g_bytes + 1265),
+ grpc_core::StaticMetadataSlice(&refcounts[90].base, 7, g_bytes + 1272),
+ grpc_core::StaticMetadataSlice(&refcounts[91].base, 11, g_bytes + 1279),
+ grpc_core::StaticMetadataSlice(&refcounts[92].base, 6, g_bytes + 1290),
+ grpc_core::StaticMetadataSlice(&refcounts[93].base, 10, g_bytes + 1296),
+ grpc_core::StaticMetadataSlice(&refcounts[94].base, 25, g_bytes + 1306),
+ grpc_core::StaticMetadataSlice(&refcounts[95].base, 17, g_bytes + 1331),
+ grpc_core::StaticMetadataSlice(&refcounts[96].base, 4, g_bytes + 1348),
+ grpc_core::StaticMetadataSlice(&refcounts[97].base, 3, g_bytes + 1352),
+ grpc_core::StaticMetadataSlice(&refcounts[98].base, 16, g_bytes + 1355),
+ grpc_core::StaticMetadataSlice(&refcounts[99].base, 1, g_bytes + 1371),
+ grpc_core::StaticMetadataSlice(&refcounts[100].base, 8, g_bytes + 1372),
+ grpc_core::StaticMetadataSlice(&refcounts[101].base, 8, g_bytes + 1380),
+ grpc_core::StaticMetadataSlice(&refcounts[102].base, 16, g_bytes + 1388),
+ grpc_core::StaticMetadataSlice(&refcounts[103].base, 4, g_bytes + 1404),
+ grpc_core::StaticMetadataSlice(&refcounts[104].base, 3, g_bytes + 1408),
+ grpc_core::StaticMetadataSlice(&refcounts[105].base, 11, g_bytes + 1411),
+ grpc_core::StaticMetadataSlice(&refcounts[106].base, 16, g_bytes + 1422),
+ grpc_core::StaticMetadataSlice(&refcounts[107].base, 13, g_bytes + 1438),
+ grpc_core::StaticMetadataSlice(&refcounts[108].base, 12, g_bytes + 1451),
+ grpc_core::StaticMetadataSlice(&refcounts[109].base, 21, g_bytes + 1463),
};
StaticMetadata static_mdelem_table[GRPC_STATIC_MDELEM_COUNT] = {
StaticMetadata(
@@ -317,107 +317,107 @@ struct StaticMetadataCtx {
0),
StaticMetadata(
grpc_core::StaticMetadataSlice(&refcounts[1].base, 7, g_bytes + 5),
- grpc_core::StaticMetadataSlice(&refcounts[43].base, 3, g_bytes + 841),
+ grpc_core::StaticMetadataSlice(&refcounts[43].base, 3, g_bytes + 841),
1),
StaticMetadata(
grpc_core::StaticMetadataSlice(&refcounts[1].base, 7, g_bytes + 5),
- grpc_core::StaticMetadataSlice(&refcounts[44].base, 4, g_bytes + 844),
+ grpc_core::StaticMetadataSlice(&refcounts[44].base, 4, g_bytes + 844),
2),
StaticMetadata(
grpc_core::StaticMetadataSlice(&refcounts[0].base, 5, g_bytes + 0),
- grpc_core::StaticMetadataSlice(&refcounts[45].base, 1, g_bytes + 848),
+ grpc_core::StaticMetadataSlice(&refcounts[45].base, 1, g_bytes + 848),
3),
StaticMetadata(
grpc_core::StaticMetadataSlice(&refcounts[0].base, 5, g_bytes + 0),
- grpc_core::StaticMetadataSlice(&refcounts[46].base, 11,
- g_bytes + 849),
+ grpc_core::StaticMetadataSlice(&refcounts[46].base, 11,
+ g_bytes + 849),
4),
StaticMetadata(
grpc_core::StaticMetadataSlice(&refcounts[4].base, 7, g_bytes + 29),
- grpc_core::StaticMetadataSlice(&refcounts[47].base, 4, g_bytes + 860),
+ grpc_core::StaticMetadataSlice(&refcounts[47].base, 4, g_bytes + 860),
5),
StaticMetadata(
grpc_core::StaticMetadataSlice(&refcounts[4].base, 7, g_bytes + 29),
- grpc_core::StaticMetadataSlice(&refcounts[48].base, 5, g_bytes + 864),
+ grpc_core::StaticMetadataSlice(&refcounts[48].base, 5, g_bytes + 864),
6),
StaticMetadata(
grpc_core::StaticMetadataSlice(&refcounts[2].base, 7, g_bytes + 12),
- grpc_core::StaticMetadataSlice(&refcounts[49].base, 3, g_bytes + 869),
+ grpc_core::StaticMetadataSlice(&refcounts[49].base, 3, g_bytes + 869),
7),
StaticMetadata(
grpc_core::StaticMetadataSlice(&refcounts[2].base, 7, g_bytes + 12),
- grpc_core::StaticMetadataSlice(&refcounts[50].base, 3, g_bytes + 872),
+ grpc_core::StaticMetadataSlice(&refcounts[50].base, 3, g_bytes + 872),
8),
StaticMetadata(
grpc_core::StaticMetadataSlice(&refcounts[2].base, 7, g_bytes + 12),
- grpc_core::StaticMetadataSlice(&refcounts[51].base, 3, g_bytes + 875),
+ grpc_core::StaticMetadataSlice(&refcounts[51].base, 3, g_bytes + 875),
9),
StaticMetadata(
grpc_core::StaticMetadataSlice(&refcounts[2].base, 7, g_bytes + 12),
- grpc_core::StaticMetadataSlice(&refcounts[52].base, 3, g_bytes + 878),
+ grpc_core::StaticMetadataSlice(&refcounts[52].base, 3, g_bytes + 878),
10),
StaticMetadata(
grpc_core::StaticMetadataSlice(&refcounts[2].base, 7, g_bytes + 12),
- grpc_core::StaticMetadataSlice(&refcounts[53].base, 3, g_bytes + 881),
+ grpc_core::StaticMetadataSlice(&refcounts[53].base, 3, g_bytes + 881),
11),
StaticMetadata(
grpc_core::StaticMetadataSlice(&refcounts[2].base, 7, g_bytes + 12),
- grpc_core::StaticMetadataSlice(&refcounts[54].base, 3, g_bytes + 884),
+ grpc_core::StaticMetadataSlice(&refcounts[54].base, 3, g_bytes + 884),
12),
StaticMetadata(
grpc_core::StaticMetadataSlice(&refcounts[2].base, 7, g_bytes + 12),
- grpc_core::StaticMetadataSlice(&refcounts[55].base, 3, g_bytes + 887),
+ grpc_core::StaticMetadataSlice(&refcounts[55].base, 3, g_bytes + 887),
13),
StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[56].base, 14,
- g_bytes + 890),
+ grpc_core::StaticMetadataSlice(&refcounts[56].base, 14,
+ g_bytes + 890),
grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
14),
StaticMetadata(grpc_core::StaticMetadataSlice(&refcounts[16].base, 15,
g_bytes + 186),
- grpc_core::StaticMetadataSlice(&refcounts[57].base, 13,
- g_bytes + 904),
+ grpc_core::StaticMetadataSlice(&refcounts[57].base, 13,
+ g_bytes + 904),
15),
StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[58].base, 15,
- g_bytes + 917),
+ grpc_core::StaticMetadataSlice(&refcounts[58].base, 15,
+ g_bytes + 917),
grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
16),
StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[59].base, 13,
- g_bytes + 932),
+ grpc_core::StaticMetadataSlice(&refcounts[59].base, 13,
+ g_bytes + 932),
grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
17),
StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[60].base, 6, g_bytes + 945),
+ grpc_core::StaticMetadataSlice(&refcounts[60].base, 6, g_bytes + 945),
grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
18),
StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[61].base, 27,
- g_bytes + 951),
+ grpc_core::StaticMetadataSlice(&refcounts[61].base, 27,
+ g_bytes + 951),
grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
19),
StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[62].base, 3, g_bytes + 978),
+ grpc_core::StaticMetadataSlice(&refcounts[62].base, 3, g_bytes + 978),
grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
20),
StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[63].base, 5, g_bytes + 981),
+ grpc_core::StaticMetadataSlice(&refcounts[63].base, 5, g_bytes + 981),
grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
21),
StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[64].base, 13,
- g_bytes + 986),
+ grpc_core::StaticMetadataSlice(&refcounts[64].base, 13,
+ g_bytes + 986),
grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
22),
StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[65].base, 13,
- g_bytes + 999),
+ grpc_core::StaticMetadataSlice(&refcounts[65].base, 13,
+ g_bytes + 999),
grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
23),
StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[66].base, 19,
- g_bytes + 1012),
+ grpc_core::StaticMetadataSlice(&refcounts[66].base, 19,
+ g_bytes + 1012),
grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
24),
StaticMetadata(
@@ -426,23 +426,23 @@ struct StaticMetadataCtx {
grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
25),
StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[67].base, 16,
- g_bytes + 1031),
+ grpc_core::StaticMetadataSlice(&refcounts[67].base, 16,
+ g_bytes + 1031),
grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
26),
StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[68].base, 14,
- g_bytes + 1047),
+ grpc_core::StaticMetadataSlice(&refcounts[68].base, 14,
+ g_bytes + 1047),
grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
27),
StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[69].base, 16,
- g_bytes + 1061),
+ grpc_core::StaticMetadataSlice(&refcounts[69].base, 16,
+ g_bytes + 1061),
grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
28),
StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[70].base, 13,
- g_bytes + 1077),
+ grpc_core::StaticMetadataSlice(&refcounts[70].base, 13,
+ g_bytes + 1077),
grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
29),
StaticMetadata(
@@ -451,33 +451,33 @@ struct StaticMetadataCtx {
grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
30),
StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[71].base, 6,
- g_bytes + 1090),
+ grpc_core::StaticMetadataSlice(&refcounts[71].base, 6,
+ g_bytes + 1090),
grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
31),
StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[72].base, 4,
- g_bytes + 1096),
+ grpc_core::StaticMetadataSlice(&refcounts[72].base, 4,
+ g_bytes + 1096),
grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
32),
StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[73].base, 4,
- g_bytes + 1100),
+ grpc_core::StaticMetadataSlice(&refcounts[73].base, 4,
+ g_bytes + 1100),
grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
33),
StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[74].base, 6,
- g_bytes + 1104),
+ grpc_core::StaticMetadataSlice(&refcounts[74].base, 6,
+ g_bytes + 1104),
grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
34),
StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[75].base, 7,
- g_bytes + 1110),
+ grpc_core::StaticMetadataSlice(&refcounts[75].base, 7,
+ g_bytes + 1110),
grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
35),
StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[76].base, 4,
- g_bytes + 1117),
+ grpc_core::StaticMetadataSlice(&refcounts[76].base, 4,
+ g_bytes + 1117),
grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
36),
StaticMetadata(
@@ -485,98 +485,98 @@ struct StaticMetadataCtx {
grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
37),
StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[77].base, 8,
- g_bytes + 1121),
+ grpc_core::StaticMetadataSlice(&refcounts[77].base, 8,
+ g_bytes + 1121),
grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
38),
StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[78].base, 17,
- g_bytes + 1129),
+ grpc_core::StaticMetadataSlice(&refcounts[78].base, 17,
+ g_bytes + 1129),
grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
39),
StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[79].base, 13,
- g_bytes + 1146),
+ grpc_core::StaticMetadataSlice(&refcounts[79].base, 13,
+ g_bytes + 1146),
grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
40),
StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[80].base, 8,
- g_bytes + 1159),
+ grpc_core::StaticMetadataSlice(&refcounts[80].base, 8,
+ g_bytes + 1159),
grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
41),
StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[81].base, 19,
- g_bytes + 1167),
+ grpc_core::StaticMetadataSlice(&refcounts[81].base, 19,
+ g_bytes + 1167),
grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
42),
StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[82].base, 13,
- g_bytes + 1186),
+ grpc_core::StaticMetadataSlice(&refcounts[82].base, 13,
+ g_bytes + 1186),
grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
43),
StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[83].base, 4,
- g_bytes + 1199),
+ grpc_core::StaticMetadataSlice(&refcounts[83].base, 4,
+ g_bytes + 1199),
grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
44),
StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[84].base, 8,
- g_bytes + 1203),
+ grpc_core::StaticMetadataSlice(&refcounts[84].base, 8,
+ g_bytes + 1203),
grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
45),
StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[85].base, 12,
- g_bytes + 1211),
+ grpc_core::StaticMetadataSlice(&refcounts[85].base, 12,
+ g_bytes + 1211),
grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
46),
StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[86].base, 18,
- g_bytes + 1223),
+ grpc_core::StaticMetadataSlice(&refcounts[86].base, 18,
+ g_bytes + 1223),
grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
47),
StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[87].base, 19,
- g_bytes + 1241),
+ grpc_core::StaticMetadataSlice(&refcounts[87].base, 19,
+ g_bytes + 1241),
grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
48),
StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[88].base, 5,
- g_bytes + 1260),
+ grpc_core::StaticMetadataSlice(&refcounts[88].base, 5,
+ g_bytes + 1260),
grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
49),
StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[89].base, 7,
- g_bytes + 1265),
+ grpc_core::StaticMetadataSlice(&refcounts[89].base, 7,
+ g_bytes + 1265),
grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
50),
StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[90].base, 7,
- g_bytes + 1272),
+ grpc_core::StaticMetadataSlice(&refcounts[90].base, 7,
+ g_bytes + 1272),
grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
51),
StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[91].base, 11,
- g_bytes + 1279),
+ grpc_core::StaticMetadataSlice(&refcounts[91].base, 11,
+ g_bytes + 1279),
grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
52),
StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[92].base, 6,
- g_bytes + 1290),
+ grpc_core::StaticMetadataSlice(&refcounts[92].base, 6,
+ g_bytes + 1290),
grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
53),
StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[93].base, 10,
- g_bytes + 1296),
+ grpc_core::StaticMetadataSlice(&refcounts[93].base, 10,
+ g_bytes + 1296),
grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
54),
StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[94].base, 25,
- g_bytes + 1306),
+ grpc_core::StaticMetadataSlice(&refcounts[94].base, 25,
+ g_bytes + 1306),
grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
55),
StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[95].base, 17,
- g_bytes + 1331),
+ grpc_core::StaticMetadataSlice(&refcounts[95].base, 17,
+ g_bytes + 1331),
grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
56),
StaticMetadata(
@@ -585,24 +585,24 @@ struct StaticMetadataCtx {
grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
57),
StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[96].base, 4,
- g_bytes + 1348),
+ grpc_core::StaticMetadataSlice(&refcounts[96].base, 4,
+ g_bytes + 1348),
grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
58),
StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[97].base, 3,
- g_bytes + 1352),
+ grpc_core::StaticMetadataSlice(&refcounts[97].base, 3,
+ g_bytes + 1352),
grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
59),
StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[98].base, 16,
- g_bytes + 1355),
+ grpc_core::StaticMetadataSlice(&refcounts[98].base, 16,
+ g_bytes + 1355),
grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
60),
StaticMetadata(
grpc_core::StaticMetadataSlice(&refcounts[7].base, 11, g_bytes + 50),
- grpc_core::StaticMetadataSlice(&refcounts[99].base, 1,
- g_bytes + 1371),
+ grpc_core::StaticMetadataSlice(&refcounts[99].base, 1,
+ g_bytes + 1371),
61),
StaticMetadata(
grpc_core::StaticMetadataSlice(&refcounts[7].base, 11, g_bytes + 50),
@@ -614,36 +614,36 @@ struct StaticMetadataCtx {
63),
StaticMetadata(
grpc_core::StaticMetadataSlice(&refcounts[9].base, 13, g_bytes + 77),
- grpc_core::StaticMetadataSlice(&refcounts[100].base, 8,
- g_bytes + 1372),
+ grpc_core::StaticMetadataSlice(&refcounts[100].base, 8,
+ g_bytes + 1372),
64),
StaticMetadata(
grpc_core::StaticMetadataSlice(&refcounts[9].base, 13, g_bytes + 77),
- grpc_core::StaticMetadataSlice(&refcounts[41].base, 4, g_bytes + 826),
+ grpc_core::StaticMetadataSlice(&refcounts[41].base, 4, g_bytes + 826),
65),
StaticMetadata(
grpc_core::StaticMetadataSlice(&refcounts[9].base, 13, g_bytes + 77),
- grpc_core::StaticMetadataSlice(&refcounts[40].base, 7, g_bytes + 819),
+ grpc_core::StaticMetadataSlice(&refcounts[40].base, 7, g_bytes + 819),
66),
StaticMetadata(
grpc_core::StaticMetadataSlice(&refcounts[5].base, 2, g_bytes + 36),
- grpc_core::StaticMetadataSlice(&refcounts[101].base, 8,
- g_bytes + 1380),
+ grpc_core::StaticMetadataSlice(&refcounts[101].base, 8,
+ g_bytes + 1380),
67),
StaticMetadata(grpc_core::StaticMetadataSlice(&refcounts[14].base, 12,
g_bytes + 158),
- grpc_core::StaticMetadataSlice(&refcounts[102].base, 16,
- g_bytes + 1388),
+ grpc_core::StaticMetadataSlice(&refcounts[102].base, 16,
+ g_bytes + 1388),
68),
StaticMetadata(
grpc_core::StaticMetadataSlice(&refcounts[4].base, 7, g_bytes + 29),
- grpc_core::StaticMetadataSlice(&refcounts[103].base, 4,
- g_bytes + 1404),
+ grpc_core::StaticMetadataSlice(&refcounts[103].base, 4,
+ g_bytes + 1404),
69),
StaticMetadata(
grpc_core::StaticMetadataSlice(&refcounts[1].base, 7, g_bytes + 5),
- grpc_core::StaticMetadataSlice(&refcounts[104].base, 3,
- g_bytes + 1408),
+ grpc_core::StaticMetadataSlice(&refcounts[104].base, 3,
+ g_bytes + 1408),
70),
StaticMetadata(
grpc_core::StaticMetadataSlice(&refcounts[16].base, 15,
@@ -652,66 +652,66 @@ struct StaticMetadataCtx {
71),
StaticMetadata(grpc_core::StaticMetadataSlice(&refcounts[15].base, 16,
g_bytes + 170),
- grpc_core::StaticMetadataSlice(&refcounts[100].base, 8,
- g_bytes + 1372),
+ grpc_core::StaticMetadataSlice(&refcounts[100].base, 8,
+ g_bytes + 1372),
72),
StaticMetadata(
grpc_core::StaticMetadataSlice(&refcounts[15].base, 16,
g_bytes + 170),
- grpc_core::StaticMetadataSlice(&refcounts[41].base, 4, g_bytes + 826),
+ grpc_core::StaticMetadataSlice(&refcounts[41].base, 4, g_bytes + 826),
73),
StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[105].base, 11,
- g_bytes + 1411),
+ grpc_core::StaticMetadataSlice(&refcounts[105].base, 11,
+ g_bytes + 1411),
grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
74),
StaticMetadata(
grpc_core::StaticMetadataSlice(&refcounts[10].base, 20, g_bytes + 90),
- grpc_core::StaticMetadataSlice(&refcounts[100].base, 8,
- g_bytes + 1372),
+ grpc_core::StaticMetadataSlice(&refcounts[100].base, 8,
+ g_bytes + 1372),
75),
StaticMetadata(
grpc_core::StaticMetadataSlice(&refcounts[10].base, 20, g_bytes + 90),
- grpc_core::StaticMetadataSlice(&refcounts[40].base, 7, g_bytes + 819),
+ grpc_core::StaticMetadataSlice(&refcounts[40].base, 7, g_bytes + 819),
76),
StaticMetadata(
grpc_core::StaticMetadataSlice(&refcounts[10].base, 20, g_bytes + 90),
- grpc_core::StaticMetadataSlice(&refcounts[106].base, 16,
- g_bytes + 1422),
+ grpc_core::StaticMetadataSlice(&refcounts[106].base, 16,
+ g_bytes + 1422),
77),
StaticMetadata(
grpc_core::StaticMetadataSlice(&refcounts[10].base, 20, g_bytes + 90),
- grpc_core::StaticMetadataSlice(&refcounts[41].base, 4, g_bytes + 826),
+ grpc_core::StaticMetadataSlice(&refcounts[41].base, 4, g_bytes + 826),
78),
StaticMetadata(
grpc_core::StaticMetadataSlice(&refcounts[10].base, 20, g_bytes + 90),
- grpc_core::StaticMetadataSlice(&refcounts[107].base, 13,
- g_bytes + 1438),
+ grpc_core::StaticMetadataSlice(&refcounts[107].base, 13,
+ g_bytes + 1438),
79),
StaticMetadata(
grpc_core::StaticMetadataSlice(&refcounts[10].base, 20, g_bytes + 90),
- grpc_core::StaticMetadataSlice(&refcounts[108].base, 12,
- g_bytes + 1451),
+ grpc_core::StaticMetadataSlice(&refcounts[108].base, 12,
+ g_bytes + 1451),
80),
StaticMetadata(
grpc_core::StaticMetadataSlice(&refcounts[10].base, 20, g_bytes + 90),
- grpc_core::StaticMetadataSlice(&refcounts[109].base, 21,
- g_bytes + 1463),
+ grpc_core::StaticMetadataSlice(&refcounts[109].base, 21,
+ g_bytes + 1463),
81),
StaticMetadata(grpc_core::StaticMetadataSlice(&refcounts[16].base, 15,
g_bytes + 186),
- grpc_core::StaticMetadataSlice(&refcounts[100].base, 8,
- g_bytes + 1372),
+ grpc_core::StaticMetadataSlice(&refcounts[100].base, 8,
+ g_bytes + 1372),
82),
StaticMetadata(
grpc_core::StaticMetadataSlice(&refcounts[16].base, 15,
g_bytes + 186),
- grpc_core::StaticMetadataSlice(&refcounts[41].base, 4, g_bytes + 826),
+ grpc_core::StaticMetadataSlice(&refcounts[41].base, 4, g_bytes + 826),
83),
StaticMetadata(grpc_core::StaticMetadataSlice(&refcounts[16].base, 15,
g_bytes + 186),
- grpc_core::StaticMetadataSlice(&refcounts[107].base, 13,
- g_bytes + 1438),
+ grpc_core::StaticMetadataSlice(&refcounts[107].base, 13,
+ g_bytes + 1438),
84),
};
@@ -1195,16 +1195,16 @@ uintptr_t grpc_static_mdelem_user_data[GRPC_STATIC_MDELEM_COUNT] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 4, 4, 6, 6, 8, 8, 2, 4, 4};
static const int8_t elems_r[] = {
- 15, 10, -8, 0, 2, -43, -83, -44, 0, 4, -8, 0, 0, 0, 10, 0, -7, 0,
- 0, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, -68, 0, -53, -56, -53, -77, 0, 30, 29, 28, 27, 26, 25, 24, 35, 22,
- 21, 20, 19, 18, 17, 16, 15, 16, 16, 16, 15, 14, 13, 12, 11, 10, 9, 8,
- 7, 6, 5, 4, 3, 2, 3, 2, 2, 6, 0, 0, 0, 0, 0, 0, -7, 0};
+ 15, 10, -8, 0, 2, -43, -83, -44, 0, 4, -8, 0, 0, 0, 10, 0, -7, 0,
+ 0, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, -68, 0, -53, -56, -53, -77, 0, 30, 29, 28, 27, 26, 25, 24, 35, 22,
+ 21, 20, 19, 18, 17, 16, 15, 16, 16, 16, 15, 14, 13, 12, 11, 10, 9, 8,
+ 7, 6, 5, 4, 3, 2, 3, 2, 2, 6, 0, 0, 0, 0, 0, 0, -7, 0};
static uint32_t elems_phash(uint32_t i) {
- i -= 45;
- uint32_t x = i % 108;
- uint32_t y = i / 108;
+ i -= 45;
+ uint32_t x = i % 108;
+ uint32_t y = i / 108;
uint32_t h = x;
if (y < GPR_ARRAY_SIZE(elems_r)) {
uint32_t delta = (uint32_t)elems_r[y];
@@ -1214,26 +1214,26 @@ static uint32_t elems_phash(uint32_t i) {
}
static const uint16_t elem_keys[] = {
- 269, 270, 271, 272, 273, 274, 275, 1140, 1141, 1789, 153,
- 154, 487, 488, 1679, 45, 46, 1030, 1031, 795, 796, 1801,
- 1569, 651, 869, 2119, 1691, 2229, 6189, 6739, 6849, 6959, 7069,
- 7179, 7289, 7399, 7509, 1817, 7729, 7839, 7949, 8059, 8169, 8279,
- 8389, 8499, 6519, 6409, 8609, 7619, 8719, 6629, 8829, 8939, 9049,
- 9159, 9269, 9379, 9489, 9599, 9709, 9819, 9929, 10039, 10149, 10259,
- 10369, 1200, 543, 10479, 10589, 214, 10699, 1206, 1207, 1208, 1209,
- 1090, 10809, 11579, 1860, 0, 0, 0, 0, 1750, 0, 1867,
- 0, 0, 359, 0, 0, 0, 0, 1642};
+ 269, 270, 271, 272, 273, 274, 275, 1140, 1141, 1789, 153,
+ 154, 487, 488, 1679, 45, 46, 1030, 1031, 795, 796, 1801,
+ 1569, 651, 869, 2119, 1691, 2229, 6189, 6739, 6849, 6959, 7069,
+ 7179, 7289, 7399, 7509, 1817, 7729, 7839, 7949, 8059, 8169, 8279,
+ 8389, 8499, 6519, 6409, 8609, 7619, 8719, 6629, 8829, 8939, 9049,
+ 9159, 9269, 9379, 9489, 9599, 9709, 9819, 9929, 10039, 10149, 10259,
+ 10369, 1200, 543, 10479, 10589, 214, 10699, 1206, 1207, 1208, 1209,
+ 1090, 10809, 11579, 1860, 0, 0, 0, 0, 1750, 0, 1867,
+ 0, 0, 359, 0, 0, 0, 0, 1642};
static const uint8_t elem_idxs[] = {
- 7, 8, 9, 10, 11, 12, 13, 76, 78, 71, 1, 2, 5, 6, 25, 3,
- 4, 66, 65, 62, 63, 83, 30, 67, 61, 57, 73, 37, 14, 19, 20, 21,
- 22, 23, 24, 26, 27, 15, 29, 31, 32, 33, 34, 35, 36, 38, 17, 16,
- 39, 28, 40, 18, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
- 53, 54, 55, 75, 69, 56, 58, 70, 59, 77, 79, 80, 81, 64, 60, 74,
- 82, 255, 255, 255, 255, 72, 255, 84, 255, 255, 0, 255, 255, 255, 255, 68};
+ 7, 8, 9, 10, 11, 12, 13, 76, 78, 71, 1, 2, 5, 6, 25, 3,
+ 4, 66, 65, 62, 63, 83, 30, 67, 61, 57, 73, 37, 14, 19, 20, 21,
+ 22, 23, 24, 26, 27, 15, 29, 31, 32, 33, 34, 35, 36, 38, 17, 16,
+ 39, 28, 40, 18, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
+ 53, 54, 55, 75, 69, 56, 58, 70, 59, 77, 79, 80, 81, 64, 60, 74,
+ 82, 255, 255, 255, 255, 72, 255, 84, 255, 255, 0, 255, 255, 255, 255, 68};
grpc_mdelem grpc_static_mdelem_for_static_strings(intptr_t a, intptr_t b) {
if (a == -1 || b == -1) return GRPC_MDNULL;
- uint32_t k = static_cast<uint32_t>(a * 110 + b);
+ uint32_t k = static_cast<uint32_t>(a * 110 + b);
uint32_t h = elems_phash(k);
return h < GPR_ARRAY_SIZE(elem_keys) && elem_keys[h] == k &&
elem_idxs[h] != 255
diff --git a/contrib/libs/grpc/src/core/lib/transport/static_metadata.h b/contrib/libs/grpc/src/core/lib/transport/static_metadata.h
index 5c5624617a9..5d844af558c 100644
--- a/contrib/libs/grpc/src/core/lib/transport/static_metadata.h
+++ b/contrib/libs/grpc/src/core/lib/transport/static_metadata.h
@@ -36,7 +36,7 @@
static_assert(
std::is_trivially_destructible<grpc_core::StaticMetadataSlice>::value,
"grpc_core::StaticMetadataSlice must be trivially destructible.");
-#define GRPC_STATIC_MDSTR_COUNT 110
+#define GRPC_STATIC_MDSTR_COUNT 110
void grpc_init_static_metadata_ctx(void);
void grpc_destroy_static_metadata_ctx(void);
@@ -46,7 +46,7 @@ constexpr uint64_t kGrpcStaticMetadataInitCanary = 0xCAFEF00DC0FFEE11L;
uint64_t StaticMetadataInitCanary();
#endif
extern const StaticMetadataSlice* g_static_metadata_slice_table;
-} // namespace grpc_core
+} // namespace grpc_core
inline const grpc_core::StaticMetadataSlice* grpc_static_slice_table() {
GPR_DEBUG_ASSERT(grpc_core::StaticMetadataInitCanary() ==
grpc_core::kGrpcStaticMetadataInitCanary);
@@ -132,161 +132,161 @@ inline const grpc_core::StaticMetadataSlice* grpc_static_slice_table() {
/* "/envoy.service.load_stats.v2.LoadReportingService/StreamLoadStats" */
#define GRPC_MDSTR_SLASH_ENVOY_DOT_SERVICE_DOT_LOAD_STATS_DOT_V2_DOT_LOADREPORTINGSERVICE_SLASH_STREAMLOADSTATS \
(grpc_static_slice_table()[35])
-/* "/envoy.service.load_stats.v3.LoadReportingService/StreamLoadStats" */
-#define GRPC_MDSTR_SLASH_ENVOY_DOT_SERVICE_DOT_LOAD_STATS_DOT_V3_DOT_LOADREPORTINGSERVICE_SLASH_STREAMLOADSTATS \
- (grpc_static_slice_table()[36])
+/* "/envoy.service.load_stats.v3.LoadReportingService/StreamLoadStats" */
+#define GRPC_MDSTR_SLASH_ENVOY_DOT_SERVICE_DOT_LOAD_STATS_DOT_V3_DOT_LOADREPORTINGSERVICE_SLASH_STREAMLOADSTATS \
+ (grpc_static_slice_table()[36])
/* "/grpc.health.v1.Health/Watch" */
#define GRPC_MDSTR_SLASH_GRPC_DOT_HEALTH_DOT_V1_DOT_HEALTH_SLASH_WATCH \
- (grpc_static_slice_table()[37])
+ (grpc_static_slice_table()[37])
/* "/envoy.service.discovery.v2.AggregatedDiscoveryService/StreamAggregatedResources"
*/
#define GRPC_MDSTR_SLASH_ENVOY_DOT_SERVICE_DOT_DISCOVERY_DOT_V2_DOT_AGGREGATEDDISCOVERYSERVICE_SLASH_STREAMAGGREGATEDRESOURCES \
- (grpc_static_slice_table()[38])
-/* "/envoy.service.discovery.v3.AggregatedDiscoveryService/StreamAggregatedResources"
- */
-#define GRPC_MDSTR_SLASH_ENVOY_DOT_SERVICE_DOT_DISCOVERY_DOT_V3_DOT_AGGREGATEDDISCOVERYSERVICE_SLASH_STREAMAGGREGATEDRESOURCES \
- (grpc_static_slice_table()[39])
+ (grpc_static_slice_table()[38])
+/* "/envoy.service.discovery.v3.AggregatedDiscoveryService/StreamAggregatedResources"
+ */
+#define GRPC_MDSTR_SLASH_ENVOY_DOT_SERVICE_DOT_DISCOVERY_DOT_V3_DOT_AGGREGATEDDISCOVERYSERVICE_SLASH_STREAMAGGREGATEDRESOURCES \
+ (grpc_static_slice_table()[39])
/* "deflate" */
-#define GRPC_MDSTR_DEFLATE (grpc_static_slice_table()[40])
+#define GRPC_MDSTR_DEFLATE (grpc_static_slice_table()[40])
/* "gzip" */
-#define GRPC_MDSTR_GZIP (grpc_static_slice_table()[41])
+#define GRPC_MDSTR_GZIP (grpc_static_slice_table()[41])
/* "stream/gzip" */
-#define GRPC_MDSTR_STREAM_SLASH_GZIP (grpc_static_slice_table()[42])
+#define GRPC_MDSTR_STREAM_SLASH_GZIP (grpc_static_slice_table()[42])
/* "GET" */
-#define GRPC_MDSTR_GET (grpc_static_slice_table()[43])
+#define GRPC_MDSTR_GET (grpc_static_slice_table()[43])
/* "POST" */
-#define GRPC_MDSTR_POST (grpc_static_slice_table()[44])
+#define GRPC_MDSTR_POST (grpc_static_slice_table()[44])
/* "/" */
-#define GRPC_MDSTR_SLASH (grpc_static_slice_table()[45])
+#define GRPC_MDSTR_SLASH (grpc_static_slice_table()[45])
/* "/index.html" */
-#define GRPC_MDSTR_SLASH_INDEX_DOT_HTML (grpc_static_slice_table()[46])
+#define GRPC_MDSTR_SLASH_INDEX_DOT_HTML (grpc_static_slice_table()[46])
/* "http" */
-#define GRPC_MDSTR_HTTP (grpc_static_slice_table()[47])
+#define GRPC_MDSTR_HTTP (grpc_static_slice_table()[47])
/* "https" */
-#define GRPC_MDSTR_HTTPS (grpc_static_slice_table()[48])
+#define GRPC_MDSTR_HTTPS (grpc_static_slice_table()[48])
/* "200" */
-#define GRPC_MDSTR_200 (grpc_static_slice_table()[49])
+#define GRPC_MDSTR_200 (grpc_static_slice_table()[49])
/* "204" */
-#define GRPC_MDSTR_204 (grpc_static_slice_table()[50])
+#define GRPC_MDSTR_204 (grpc_static_slice_table()[50])
/* "206" */
-#define GRPC_MDSTR_206 (grpc_static_slice_table()[51])
+#define GRPC_MDSTR_206 (grpc_static_slice_table()[51])
/* "304" */
-#define GRPC_MDSTR_304 (grpc_static_slice_table()[52])
+#define GRPC_MDSTR_304 (grpc_static_slice_table()[52])
/* "400" */
-#define GRPC_MDSTR_400 (grpc_static_slice_table()[53])
+#define GRPC_MDSTR_400 (grpc_static_slice_table()[53])
/* "404" */
-#define GRPC_MDSTR_404 (grpc_static_slice_table()[54])
+#define GRPC_MDSTR_404 (grpc_static_slice_table()[54])
/* "500" */
-#define GRPC_MDSTR_500 (grpc_static_slice_table()[55])
+#define GRPC_MDSTR_500 (grpc_static_slice_table()[55])
/* "accept-charset" */
-#define GRPC_MDSTR_ACCEPT_CHARSET (grpc_static_slice_table()[56])
+#define GRPC_MDSTR_ACCEPT_CHARSET (grpc_static_slice_table()[56])
/* "gzip, deflate" */
-#define GRPC_MDSTR_GZIP_COMMA_DEFLATE (grpc_static_slice_table()[57])
+#define GRPC_MDSTR_GZIP_COMMA_DEFLATE (grpc_static_slice_table()[57])
/* "accept-language" */
-#define GRPC_MDSTR_ACCEPT_LANGUAGE (grpc_static_slice_table()[58])
+#define GRPC_MDSTR_ACCEPT_LANGUAGE (grpc_static_slice_table()[58])
/* "accept-ranges" */
-#define GRPC_MDSTR_ACCEPT_RANGES (grpc_static_slice_table()[59])
+#define GRPC_MDSTR_ACCEPT_RANGES (grpc_static_slice_table()[59])
/* "accept" */
-#define GRPC_MDSTR_ACCEPT (grpc_static_slice_table()[60])
+#define GRPC_MDSTR_ACCEPT (grpc_static_slice_table()[60])
/* "access-control-allow-origin" */
-#define GRPC_MDSTR_ACCESS_CONTROL_ALLOW_ORIGIN (grpc_static_slice_table()[61])
+#define GRPC_MDSTR_ACCESS_CONTROL_ALLOW_ORIGIN (grpc_static_slice_table()[61])
/* "age" */
-#define GRPC_MDSTR_AGE (grpc_static_slice_table()[62])
+#define GRPC_MDSTR_AGE (grpc_static_slice_table()[62])
/* "allow" */
-#define GRPC_MDSTR_ALLOW (grpc_static_slice_table()[63])
+#define GRPC_MDSTR_ALLOW (grpc_static_slice_table()[63])
/* "authorization" */
-#define GRPC_MDSTR_AUTHORIZATION (grpc_static_slice_table()[64])
+#define GRPC_MDSTR_AUTHORIZATION (grpc_static_slice_table()[64])
/* "cache-control" */
-#define GRPC_MDSTR_CACHE_CONTROL (grpc_static_slice_table()[65])
+#define GRPC_MDSTR_CACHE_CONTROL (grpc_static_slice_table()[65])
/* "content-disposition" */
-#define GRPC_MDSTR_CONTENT_DISPOSITION (grpc_static_slice_table()[66])
+#define GRPC_MDSTR_CONTENT_DISPOSITION (grpc_static_slice_table()[66])
/* "content-language" */
-#define GRPC_MDSTR_CONTENT_LANGUAGE (grpc_static_slice_table()[67])
+#define GRPC_MDSTR_CONTENT_LANGUAGE (grpc_static_slice_table()[67])
/* "content-length" */
-#define GRPC_MDSTR_CONTENT_LENGTH (grpc_static_slice_table()[68])
+#define GRPC_MDSTR_CONTENT_LENGTH (grpc_static_slice_table()[68])
/* "content-location" */
-#define GRPC_MDSTR_CONTENT_LOCATION (grpc_static_slice_table()[69])
+#define GRPC_MDSTR_CONTENT_LOCATION (grpc_static_slice_table()[69])
/* "content-range" */
-#define GRPC_MDSTR_CONTENT_RANGE (grpc_static_slice_table()[70])
+#define GRPC_MDSTR_CONTENT_RANGE (grpc_static_slice_table()[70])
/* "cookie" */
-#define GRPC_MDSTR_COOKIE (grpc_static_slice_table()[71])
+#define GRPC_MDSTR_COOKIE (grpc_static_slice_table()[71])
/* "date" */
-#define GRPC_MDSTR_DATE (grpc_static_slice_table()[72])
+#define GRPC_MDSTR_DATE (grpc_static_slice_table()[72])
/* "etag" */
-#define GRPC_MDSTR_ETAG (grpc_static_slice_table()[73])
+#define GRPC_MDSTR_ETAG (grpc_static_slice_table()[73])
/* "expect" */
-#define GRPC_MDSTR_EXPECT (grpc_static_slice_table()[74])
+#define GRPC_MDSTR_EXPECT (grpc_static_slice_table()[74])
/* "expires" */
-#define GRPC_MDSTR_EXPIRES (grpc_static_slice_table()[75])
+#define GRPC_MDSTR_EXPIRES (grpc_static_slice_table()[75])
/* "from" */
-#define GRPC_MDSTR_FROM (grpc_static_slice_table()[76])
+#define GRPC_MDSTR_FROM (grpc_static_slice_table()[76])
/* "if-match" */
-#define GRPC_MDSTR_IF_MATCH (grpc_static_slice_table()[77])
+#define GRPC_MDSTR_IF_MATCH (grpc_static_slice_table()[77])
/* "if-modified-since" */
-#define GRPC_MDSTR_IF_MODIFIED_SINCE (grpc_static_slice_table()[78])
+#define GRPC_MDSTR_IF_MODIFIED_SINCE (grpc_static_slice_table()[78])
/* "if-none-match" */
-#define GRPC_MDSTR_IF_NONE_MATCH (grpc_static_slice_table()[79])
+#define GRPC_MDSTR_IF_NONE_MATCH (grpc_static_slice_table()[79])
/* "if-range" */
-#define GRPC_MDSTR_IF_RANGE (grpc_static_slice_table()[80])
+#define GRPC_MDSTR_IF_RANGE (grpc_static_slice_table()[80])
/* "if-unmodified-since" */
-#define GRPC_MDSTR_IF_UNMODIFIED_SINCE (grpc_static_slice_table()[81])
+#define GRPC_MDSTR_IF_UNMODIFIED_SINCE (grpc_static_slice_table()[81])
/* "last-modified" */
-#define GRPC_MDSTR_LAST_MODIFIED (grpc_static_slice_table()[82])
+#define GRPC_MDSTR_LAST_MODIFIED (grpc_static_slice_table()[82])
/* "link" */
-#define GRPC_MDSTR_LINK (grpc_static_slice_table()[83])
+#define GRPC_MDSTR_LINK (grpc_static_slice_table()[83])
/* "location" */
-#define GRPC_MDSTR_LOCATION (grpc_static_slice_table()[84])
+#define GRPC_MDSTR_LOCATION (grpc_static_slice_table()[84])
/* "max-forwards" */
-#define GRPC_MDSTR_MAX_FORWARDS (grpc_static_slice_table()[85])
+#define GRPC_MDSTR_MAX_FORWARDS (grpc_static_slice_table()[85])
/* "proxy-authenticate" */
-#define GRPC_MDSTR_PROXY_AUTHENTICATE (grpc_static_slice_table()[86])
+#define GRPC_MDSTR_PROXY_AUTHENTICATE (grpc_static_slice_table()[86])
/* "proxy-authorization" */
-#define GRPC_MDSTR_PROXY_AUTHORIZATION (grpc_static_slice_table()[87])
+#define GRPC_MDSTR_PROXY_AUTHORIZATION (grpc_static_slice_table()[87])
/* "range" */
-#define GRPC_MDSTR_RANGE (grpc_static_slice_table()[88])
+#define GRPC_MDSTR_RANGE (grpc_static_slice_table()[88])
/* "referer" */
-#define GRPC_MDSTR_REFERER (grpc_static_slice_table()[89])
+#define GRPC_MDSTR_REFERER (grpc_static_slice_table()[89])
/* "refresh" */
-#define GRPC_MDSTR_REFRESH (grpc_static_slice_table()[90])
+#define GRPC_MDSTR_REFRESH (grpc_static_slice_table()[90])
/* "retry-after" */
-#define GRPC_MDSTR_RETRY_AFTER (grpc_static_slice_table()[91])
+#define GRPC_MDSTR_RETRY_AFTER (grpc_static_slice_table()[91])
/* "server" */
-#define GRPC_MDSTR_SERVER (grpc_static_slice_table()[92])
+#define GRPC_MDSTR_SERVER (grpc_static_slice_table()[92])
/* "set-cookie" */
-#define GRPC_MDSTR_SET_COOKIE (grpc_static_slice_table()[93])
+#define GRPC_MDSTR_SET_COOKIE (grpc_static_slice_table()[93])
/* "strict-transport-security" */
-#define GRPC_MDSTR_STRICT_TRANSPORT_SECURITY (grpc_static_slice_table()[94])
+#define GRPC_MDSTR_STRICT_TRANSPORT_SECURITY (grpc_static_slice_table()[94])
/* "transfer-encoding" */
-#define GRPC_MDSTR_TRANSFER_ENCODING (grpc_static_slice_table()[95])
+#define GRPC_MDSTR_TRANSFER_ENCODING (grpc_static_slice_table()[95])
/* "vary" */
-#define GRPC_MDSTR_VARY (grpc_static_slice_table()[96])
+#define GRPC_MDSTR_VARY (grpc_static_slice_table()[96])
/* "via" */
-#define GRPC_MDSTR_VIA (grpc_static_slice_table()[97])
+#define GRPC_MDSTR_VIA (grpc_static_slice_table()[97])
/* "www-authenticate" */
-#define GRPC_MDSTR_WWW_AUTHENTICATE (grpc_static_slice_table()[98])
+#define GRPC_MDSTR_WWW_AUTHENTICATE (grpc_static_slice_table()[98])
/* "0" */
-#define GRPC_MDSTR_0 (grpc_static_slice_table()[99])
+#define GRPC_MDSTR_0 (grpc_static_slice_table()[99])
/* "identity" */
-#define GRPC_MDSTR_IDENTITY (grpc_static_slice_table()[100])
+#define GRPC_MDSTR_IDENTITY (grpc_static_slice_table()[100])
/* "trailers" */
-#define GRPC_MDSTR_TRAILERS (grpc_static_slice_table()[101])
+#define GRPC_MDSTR_TRAILERS (grpc_static_slice_table()[101])
/* "application/grpc" */
-#define GRPC_MDSTR_APPLICATION_SLASH_GRPC (grpc_static_slice_table()[102])
+#define GRPC_MDSTR_APPLICATION_SLASH_GRPC (grpc_static_slice_table()[102])
/* "grpc" */
-#define GRPC_MDSTR_GRPC (grpc_static_slice_table()[103])
+#define GRPC_MDSTR_GRPC (grpc_static_slice_table()[103])
/* "PUT" */
-#define GRPC_MDSTR_PUT (grpc_static_slice_table()[104])
+#define GRPC_MDSTR_PUT (grpc_static_slice_table()[104])
/* "lb-cost-bin" */
-#define GRPC_MDSTR_LB_COST_BIN (grpc_static_slice_table()[105])
+#define GRPC_MDSTR_LB_COST_BIN (grpc_static_slice_table()[105])
/* "identity,deflate" */
-#define GRPC_MDSTR_IDENTITY_COMMA_DEFLATE (grpc_static_slice_table()[106])
+#define GRPC_MDSTR_IDENTITY_COMMA_DEFLATE (grpc_static_slice_table()[106])
/* "identity,gzip" */
-#define GRPC_MDSTR_IDENTITY_COMMA_GZIP (grpc_static_slice_table()[107])
+#define GRPC_MDSTR_IDENTITY_COMMA_GZIP (grpc_static_slice_table()[107])
/* "deflate,gzip" */
-#define GRPC_MDSTR_DEFLATE_COMMA_GZIP (grpc_static_slice_table()[108])
+#define GRPC_MDSTR_DEFLATE_COMMA_GZIP (grpc_static_slice_table()[108])
/* "identity,deflate,gzip" */
#define GRPC_MDSTR_IDENTITY_COMMA_DEFLATE_COMMA_GZIP \
- (grpc_static_slice_table()[109])
+ (grpc_static_slice_table()[109])
namespace grpc_core {
struct StaticSliceRefcount;
diff --git a/contrib/libs/grpc/src/core/lib/transport/transport.h b/contrib/libs/grpc/src/core/lib/transport/transport.h
index 817faf357fc..2404455f9f6 100644
--- a/contrib/libs/grpc/src/core/lib/transport/transport.h
+++ b/contrib/libs/grpc/src/core/lib/transport/transport.h
@@ -242,12 +242,12 @@ struct grpc_transport_stream_op_batch_payload {
struct {
grpc_metadata_batch* send_trailing_metadata = nullptr;
- // Set by the transport to true if the stream successfully wrote the
- // trailing metadata. If this is not set but there was a send trailing
- // metadata op present, this can indicate that a server call can be marked
- // as a cancellation (since the stream was write-closed before status could
- // be delivered).
- bool* sent = nullptr;
+ // Set by the transport to true if the stream successfully wrote the
+ // trailing metadata. If this is not set but there was a send trailing
+ // metadata op present, this can indicate that a server call can be marked
+ // as a cancellation (since the stream was write-closed before status could
+ // be delivered).
+ bool* sent = nullptr;
} send_trailing_metadata;
struct {
@@ -414,9 +414,9 @@ void grpc_transport_stream_op_batch_finish_with_failure(
grpc_transport_stream_op_batch* op, grpc_error* error,
grpc_core::CallCombiner* call_combiner);
-TString grpc_transport_stream_op_batch_string(
- grpc_transport_stream_op_batch* op);
-TString grpc_transport_op_string(grpc_transport_op* op);
+TString grpc_transport_stream_op_batch_string(
+ grpc_transport_stream_op_batch* op);
+TString grpc_transport_op_string(grpc_transport_op* op);
/* Send a batch of operations on a transport
@@ -459,11 +459,11 @@ grpc_transport_op* grpc_make_transport_op(grpc_closure* on_consumed);
grpc_transport_stream_op_batch* grpc_make_transport_stream_op(
grpc_closure* on_consumed);
-namespace grpc_core {
-// This is the key to be used for loading/storing keepalive_throttling in the
-// y_absl::Status object.
-constexpr const char* kKeepaliveThrottlingKey =
- "grpc.internal.keepalive_throttling";
-} // namespace grpc_core
-
+namespace grpc_core {
+// This is the key to be used for loading/storing keepalive_throttling in the
+// y_absl::Status object.
+constexpr const char* kKeepaliveThrottlingKey =
+ "grpc.internal.keepalive_throttling";
+} // namespace grpc_core
+
#endif /* GRPC_CORE_LIB_TRANSPORT_TRANSPORT_H */
diff --git a/contrib/libs/grpc/src/core/lib/transport/transport_op_string.cc b/contrib/libs/grpc/src/core/lib/transport/transport_op_string.cc
index e4d79fae427..b26ee0a4fde 100644
--- a/contrib/libs/grpc/src/core/lib/transport/transport_op_string.cc
+++ b/contrib/libs/grpc/src/core/lib/transport/transport_op_string.cc
@@ -25,12 +25,12 @@
#include <stdio.h>
#include <string.h>
-#include <vector>
-
-#include "y_absl/strings/str_cat.h"
-#include "y_absl/strings/str_format.h"
-#include "y_absl/strings/str_join.h"
-
+#include <vector>
+
+#include "y_absl/strings/str_cat.h"
+#include "y_absl/strings/str_format.h"
+#include "y_absl/strings/str_join.h"
+
#include <grpc/support/alloc.h>
#include <grpc/support/string_util.h>
#include "src/core/lib/gpr/string.h"
@@ -40,130 +40,130 @@
/* These routines are here to facilitate debugging - they produce string
representations of various transport data structures */
-static void put_metadata(grpc_mdelem md, std::vector<TString>* out) {
- out->push_back("key=");
- char* dump = grpc_dump_slice(GRPC_MDKEY(md), GPR_DUMP_HEX | GPR_DUMP_ASCII);
- out->push_back(dump);
- gpr_free(dump);
- out->push_back(" value=");
- dump = grpc_dump_slice(GRPC_MDVALUE(md), GPR_DUMP_HEX | GPR_DUMP_ASCII);
- out->push_back(dump);
- gpr_free(dump);
+static void put_metadata(grpc_mdelem md, std::vector<TString>* out) {
+ out->push_back("key=");
+ char* dump = grpc_dump_slice(GRPC_MDKEY(md), GPR_DUMP_HEX | GPR_DUMP_ASCII);
+ out->push_back(dump);
+ gpr_free(dump);
+ out->push_back(" value=");
+ dump = grpc_dump_slice(GRPC_MDVALUE(md), GPR_DUMP_HEX | GPR_DUMP_ASCII);
+ out->push_back(dump);
+ gpr_free(dump);
}
-static void put_metadata_list(grpc_metadata_batch md,
- std::vector<TString>* out) {
+static void put_metadata_list(grpc_metadata_batch md,
+ std::vector<TString>* out) {
grpc_linked_mdelem* m;
for (m = md.list.head; m != nullptr; m = m->next) {
- if (m != md.list.head) out->push_back(", ");
- put_metadata(m->md, out);
+ if (m != md.list.head) out->push_back(", ");
+ put_metadata(m->md, out);
}
if (md.deadline != GRPC_MILLIS_INF_FUTURE) {
- out->push_back(y_absl::StrFormat(" deadline=%" PRId64, md.deadline));
+ out->push_back(y_absl::StrFormat(" deadline=%" PRId64, md.deadline));
}
}
-TString grpc_transport_stream_op_batch_string(
+TString grpc_transport_stream_op_batch_string(
grpc_transport_stream_op_batch* op) {
- std::vector<TString> out;
+ std::vector<TString> out;
if (op->send_initial_metadata) {
- out.push_back(" SEND_INITIAL_METADATA{");
- put_metadata_list(*op->payload->send_initial_metadata.send_initial_metadata,
- &out);
- out.push_back("}");
+ out.push_back(" SEND_INITIAL_METADATA{");
+ put_metadata_list(*op->payload->send_initial_metadata.send_initial_metadata,
+ &out);
+ out.push_back("}");
}
if (op->send_message) {
if (op->payload->send_message.send_message != nullptr) {
- out.push_back(
- y_absl::StrFormat(" SEND_MESSAGE:flags=0x%08x:len=%d",
- op->payload->send_message.send_message->flags(),
- op->payload->send_message.send_message->length()));
+ out.push_back(
+ y_absl::StrFormat(" SEND_MESSAGE:flags=0x%08x:len=%d",
+ op->payload->send_message.send_message->flags(),
+ op->payload->send_message.send_message->length()));
} else {
// This can happen when we check a batch after the transport has
// processed and cleared the send_message op.
- out.push_back(" SEND_MESSAGE(flag and length unknown, already orphaned)");
+ out.push_back(" SEND_MESSAGE(flag and length unknown, already orphaned)");
}
}
if (op->send_trailing_metadata) {
- out.push_back(" SEND_TRAILING_METADATA{");
+ out.push_back(" SEND_TRAILING_METADATA{");
put_metadata_list(
- *op->payload->send_trailing_metadata.send_trailing_metadata, &out);
- out.push_back("}");
+ *op->payload->send_trailing_metadata.send_trailing_metadata, &out);
+ out.push_back("}");
}
if (op->recv_initial_metadata) {
- out.push_back(" RECV_INITIAL_METADATA");
+ out.push_back(" RECV_INITIAL_METADATA");
}
if (op->recv_message) {
- out.push_back(" RECV_MESSAGE");
+ out.push_back(" RECV_MESSAGE");
}
if (op->recv_trailing_metadata) {
- out.push_back(" RECV_TRAILING_METADATA");
+ out.push_back(" RECV_TRAILING_METADATA");
}
if (op->cancel_stream) {
- out.push_back(y_absl::StrCat(
- " CANCEL:",
- grpc_error_string(op->payload->cancel_stream.cancel_error)));
+ out.push_back(y_absl::StrCat(
+ " CANCEL:",
+ grpc_error_string(op->payload->cancel_stream.cancel_error)));
}
- return y_absl::StrJoin(out, "");
+ return y_absl::StrJoin(out, "");
}
-TString grpc_transport_op_string(grpc_transport_op* op) {
- std::vector<TString> out;
+TString grpc_transport_op_string(grpc_transport_op* op) {
+ std::vector<TString> out;
if (op->start_connectivity_watch != nullptr) {
- out.push_back(y_absl::StrFormat(
- " START_CONNECTIVITY_WATCH:watcher=%p:from=%s",
+ out.push_back(y_absl::StrFormat(
+ " START_CONNECTIVITY_WATCH:watcher=%p:from=%s",
op->start_connectivity_watch.get(),
- grpc_core::ConnectivityStateName(op->start_connectivity_watch_state)));
+ grpc_core::ConnectivityStateName(op->start_connectivity_watch_state)));
}
if (op->stop_connectivity_watch != nullptr) {
- out.push_back(y_absl::StrFormat(" STOP_CONNECTIVITY_WATCH:watcher=%p",
- op->stop_connectivity_watch));
+ out.push_back(y_absl::StrFormat(" STOP_CONNECTIVITY_WATCH:watcher=%p",
+ op->stop_connectivity_watch));
}
if (op->disconnect_with_error != GRPC_ERROR_NONE) {
- out.push_back(y_absl::StrCat(" DISCONNECT:",
- grpc_error_string(op->disconnect_with_error)));
+ out.push_back(y_absl::StrCat(" DISCONNECT:",
+ grpc_error_string(op->disconnect_with_error)));
}
if (op->goaway_error) {
- out.push_back(
- y_absl::StrCat(" SEND_GOAWAY:%s", grpc_error_string(op->goaway_error)));
+ out.push_back(
+ y_absl::StrCat(" SEND_GOAWAY:%s", grpc_error_string(op->goaway_error)));
}
if (op->set_accept_stream) {
- out.push_back(y_absl::StrFormat(" SET_ACCEPT_STREAM:%p(%p,...)",
- op->set_accept_stream_fn,
- op->set_accept_stream_user_data));
+ out.push_back(y_absl::StrFormat(" SET_ACCEPT_STREAM:%p(%p,...)",
+ op->set_accept_stream_fn,
+ op->set_accept_stream_user_data));
}
if (op->bind_pollset != nullptr) {
- out.push_back(" BIND_POLLSET");
+ out.push_back(" BIND_POLLSET");
}
if (op->bind_pollset_set != nullptr) {
- out.push_back(" BIND_POLLSET_SET");
+ out.push_back(" BIND_POLLSET_SET");
}
if (op->send_ping.on_initiate != nullptr || op->send_ping.on_ack != nullptr) {
- out.push_back(" SEND_PING");
+ out.push_back(" SEND_PING");
}
- return y_absl::StrJoin(out, "");
+ return y_absl::StrJoin(out, "");
}
void grpc_call_log_op(const char* file, int line, gpr_log_severity severity,
grpc_call_element* elem,
grpc_transport_stream_op_batch* op) {
- gpr_log(file, line, severity, "OP[%s:%p]: %s", elem->filter->name, elem,
- grpc_transport_stream_op_batch_string(op).c_str());
+ gpr_log(file, line, severity, "OP[%s:%p]: %s", elem->filter->name, elem,
+ grpc_transport_stream_op_batch_string(op).c_str());
}
diff --git a/contrib/libs/grpc/src/core/lib/uri/uri_parser.cc b/contrib/libs/grpc/src/core/lib/uri/uri_parser.cc
index 88143d09b80..1215e0d206d 100644
--- a/contrib/libs/grpc/src/core/lib/uri/uri_parser.cc
+++ b/contrib/libs/grpc/src/core/lib/uri/uri_parser.cc
@@ -22,10 +22,10 @@
#include <string.h>
-#include <util/generic/string.h>
-
-#include "y_absl/strings/str_format.h"
-
+#include <util/generic/string.h>
+
+#include "y_absl/strings/str_format.h"
+
#include <grpc/slice_buffer.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
@@ -38,25 +38,25 @@
/** a size_t default value... maps to all 1's */
#define NOT_SET (~(size_t)0)
-static grpc_uri* bad_uri(y_absl::string_view uri_text, size_t pos,
- const char* section, bool suppress_errors) {
+static grpc_uri* bad_uri(y_absl::string_view uri_text, size_t pos,
+ const char* section, bool suppress_errors) {
if (!suppress_errors) {
- TString line_prefix = y_absl::StrFormat("bad uri.%s: '", section);
- gpr_log(GPR_ERROR, "%s%s'", line_prefix.c_str(),
- TString(uri_text).c_str());
- size_t pfx_len = line_prefix.size() + pos;
- gpr_log(GPR_ERROR, "%s^ here", TString(pfx_len, ' ').c_str());
+ TString line_prefix = y_absl::StrFormat("bad uri.%s: '", section);
+ gpr_log(GPR_ERROR, "%s%s'", line_prefix.c_str(),
+ TString(uri_text).c_str());
+ size_t pfx_len = line_prefix.size() + pos;
+ gpr_log(GPR_ERROR, "%s^ here", TString(pfx_len, ' ').c_str());
}
return nullptr;
}
/** Returns a copy of percent decoded \a src[begin, end) */
-static char* decode_and_copy_component(y_absl::string_view src, size_t begin,
+static char* decode_and_copy_component(y_absl::string_view src, size_t begin,
size_t end) {
grpc_slice component =
(begin == NOT_SET || end == NOT_SET)
? grpc_empty_slice()
- : grpc_slice_from_copied_buffer(src.data() + begin, end - begin);
+ : grpc_slice_from_copied_buffer(src.data() + begin, end - begin);
grpc_slice decoded_component =
grpc_permissive_percent_decode_slice(component);
char* out = grpc_dump_slice(decoded_component, GPR_DUMP_ASCII);
@@ -73,7 +73,7 @@ static bool valid_hex(char c) {
/** Returns how many chars to advance if \a uri_text[i] begins a valid \a pchar
* production. If \a uri_text[i] introduces an invalid \a pchar (such as percent
* sign not followed by two hex digits), NOT_SET is returned. */
-static size_t parse_pchar(y_absl::string_view uri_text, size_t i) {
+static size_t parse_pchar(y_absl::string_view uri_text, size_t i) {
/* pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
* unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
* pct-encoded = "%" HEXDIG HEXDIG
@@ -106,8 +106,8 @@ static size_t parse_pchar(y_absl::string_view uri_text, size_t i) {
case '=':
return 1;
case '%': /* pct-encoded */
- if (uri_text.size() > i + 2 && valid_hex(uri_text[i + 1]) &&
- valid_hex(uri_text[i + 2])) {
+ if (uri_text.size() > i + 2 && valid_hex(uri_text[i + 1]) &&
+ valid_hex(uri_text[i + 2])) {
return 2;
}
return NOT_SET;
@@ -116,8 +116,8 @@ static size_t parse_pchar(y_absl::string_view uri_text, size_t i) {
}
/* *( pchar / "?" / "/" ) */
-static int parse_fragment_or_query(y_absl::string_view uri_text, size_t* i) {
- while (uri_text.size() > *i) {
+static int parse_fragment_or_query(y_absl::string_view uri_text, size_t* i) {
+ while (uri_text.size() > *i) {
const size_t advance = parse_pchar(uri_text, *i); /* pchar */
switch (advance) {
case 0: /* uri_text[i] isn't in pchar */
@@ -179,7 +179,7 @@ static void parse_query_parts(grpc_uri* uri) {
}
}
-grpc_uri* grpc_uri_parse(y_absl::string_view uri_text, bool suppress_errors) {
+grpc_uri* grpc_uri_parse(y_absl::string_view uri_text, bool suppress_errors) {
grpc_uri* uri;
size_t scheme_begin = 0;
size_t scheme_end = NOT_SET;
@@ -193,7 +193,7 @@ grpc_uri* grpc_uri_parse(y_absl::string_view uri_text, bool suppress_errors) {
size_t fragment_end = NOT_SET;
size_t i;
- for (i = scheme_begin; i < uri_text.size(); ++i) {
+ for (i = scheme_begin; i < uri_text.size(); ++i) {
if (uri_text[i] == ':') {
scheme_end = i;
break;
@@ -212,16 +212,16 @@ grpc_uri* grpc_uri_parse(y_absl::string_view uri_text, bool suppress_errors) {
return bad_uri(uri_text, i, "scheme", suppress_errors);
}
- if (uri_text.size() > scheme_end + 2 && uri_text[scheme_end + 1] == '/' &&
- uri_text[scheme_end + 2] == '/') {
+ if (uri_text.size() > scheme_end + 2 && uri_text[scheme_end + 1] == '/' &&
+ uri_text[scheme_end + 2] == '/') {
authority_begin = scheme_end + 3;
- for (i = authority_begin; uri_text.size() > i && authority_end == NOT_SET;
+ for (i = authority_begin; uri_text.size() > i && authority_end == NOT_SET;
i++) {
if (uri_text[i] == '/' || uri_text[i] == '?' || uri_text[i] == '#') {
authority_end = i;
}
}
- if (authority_end == NOT_SET && uri_text.size() == i) {
+ if (authority_end == NOT_SET && uri_text.size() == i) {
authority_end = i;
}
if (authority_end == NOT_SET) {
@@ -233,34 +233,34 @@ grpc_uri* grpc_uri_parse(y_absl::string_view uri_text, bool suppress_errors) {
path_begin = scheme_end + 1;
}
- for (i = path_begin; i < uri_text.size(); ++i) {
+ for (i = path_begin; i < uri_text.size(); ++i) {
if (uri_text[i] == '?' || uri_text[i] == '#') {
path_end = i;
break;
}
}
- if (path_end == NOT_SET && uri_text.size() == i) {
+ if (path_end == NOT_SET && uri_text.size() == i) {
path_end = i;
}
if (path_end == NOT_SET) {
return bad_uri(uri_text, i, "path", suppress_errors);
}
- if (uri_text.size() > i && uri_text[i] == '?') {
+ if (uri_text.size() > i && uri_text[i] == '?') {
query_begin = ++i;
if (!parse_fragment_or_query(uri_text, &i)) {
return bad_uri(uri_text, i, "query", suppress_errors);
- } else if (uri_text.size() > i && uri_text[i] != '#') {
+ } else if (uri_text.size() > i && uri_text[i] != '#') {
/* We must be at the end or at the beginning of a fragment */
return bad_uri(uri_text, i, "query", suppress_errors);
}
query_end = i;
}
- if (uri_text.size() > i && uri_text[i] == '#') {
+ if (uri_text.size() > i && uri_text[i] == '#') {
fragment_begin = ++i;
if (!parse_fragment_or_query(uri_text, &i)) {
return bad_uri(uri_text, i - fragment_end, "fragment", suppress_errors);
- } else if (uri_text.size() > i) {
+ } else if (uri_text.size() > i) {
/* We must be at the end */
return bad_uri(uri_text, i, "fragment", suppress_errors);
}
diff --git a/contrib/libs/grpc/src/core/lib/uri/uri_parser.h b/contrib/libs/grpc/src/core/lib/uri/uri_parser.h
index 9f0e6f4a1b9..ccb9a4f29eb 100644
--- a/contrib/libs/grpc/src/core/lib/uri/uri_parser.h
+++ b/contrib/libs/grpc/src/core/lib/uri/uri_parser.h
@@ -21,8 +21,8 @@
#include <grpc/support/port_platform.h>
-#include "y_absl/strings/string_view.h"
-
+#include "y_absl/strings/string_view.h"
+
#include <stddef.h>
struct grpc_uri {
@@ -39,7 +39,7 @@ struct grpc_uri {
char* fragment;
};
/** parse a uri, return NULL on failure */
-grpc_uri* grpc_uri_parse(y_absl::string_view uri_text, bool suppress_errors);
+grpc_uri* grpc_uri_parse(y_absl::string_view uri_text, bool suppress_errors);
/** return the part of a query string after the '=' in "?key=xxx&...", or NULL
* if key is not present */
diff --git a/contrib/libs/grpc/src/core/lib/ya.make b/contrib/libs/grpc/src/core/lib/ya.make
index 0baf847eecd..93f59abe37c 100644
--- a/contrib/libs/grpc/src/core/lib/ya.make
+++ b/contrib/libs/grpc/src/core/lib/ya.make
@@ -6,30 +6,30 @@ OWNER(g:cpp-contrib)
LICENSE(Apache-2.0)
-LICENSE_TEXTS(.yandex_meta/licenses.list.txt)
-
+LICENSE_TEXTS(.yandex_meta/licenses.list.txt)
+
PEERDIR(
- contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/spinlock_wait
- contrib/restricted/abseil-cpp-tstring/y_absl/container
- contrib/restricted/abseil-cpp-tstring/y_absl/memory
- contrib/restricted/abseil-cpp-tstring/y_absl/strings
- contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/str_format
- contrib/restricted/abseil-cpp-tstring/y_absl/synchronization
- contrib/restricted/abseil-cpp-tstring/y_absl/time
+ contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/spinlock_wait
+ contrib/restricted/abseil-cpp-tstring/y_absl/container
+ contrib/restricted/abseil-cpp-tstring/y_absl/memory
+ contrib/restricted/abseil-cpp-tstring/y_absl/strings
+ contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/str_format
+ contrib/restricted/abseil-cpp-tstring/y_absl/synchronization
+ contrib/restricted/abseil-cpp-tstring/y_absl/time
)
ADDINCL(
GLOBAL contrib/libs/grpc/include
- ${ARCADIA_BUILD_ROOT}/contrib/libs/grpc
+ ${ARCADIA_BUILD_ROOT}/contrib/libs/grpc
contrib/libs/grpc
)
NO_COMPILER_WARNINGS()
IF (OS_LINUX OR OS_DARWIN)
- CFLAGS(
- -DGRPC_POSIX_FORK_ALLOW_PTHREAD_ATFORK=1
- )
+ CFLAGS(
+ -DGRPC_POSIX_FORK_ALLOW_PTHREAD_ATFORK=1
+ )
ENDIF()
SRCS(
@@ -53,7 +53,7 @@ SRCS(
gpr/string_util_windows.cc
gpr/string_windows.cc
gpr/sync.cc
- gpr/sync_abseil.cc
+ gpr/sync_abseil.cc
gpr/sync_posix.cc
gpr/sync_windows.cc
gpr/time.cc
diff --git a/contrib/libs/grpc/src/core/plugin_registry/grpc_plugin_registry.cc b/contrib/libs/grpc/src/core/plugin_registry/grpc_plugin_registry.cc
index c9791980563..e048760c7f1 100644
--- a/contrib/libs/grpc/src/core/plugin_registry/grpc_plugin_registry.cc
+++ b/contrib/libs/grpc/src/core/plugin_registry/grpc_plugin_registry.cc
@@ -34,10 +34,10 @@ void grpc_resolver_fake_init(void);
void grpc_resolver_fake_shutdown(void);
void grpc_lb_policy_grpclb_init(void);
void grpc_lb_policy_grpclb_shutdown(void);
-void grpc_lb_policy_priority_init(void);
-void grpc_lb_policy_priority_shutdown(void);
-void grpc_lb_policy_weighted_target_init(void);
-void grpc_lb_policy_weighted_target_shutdown(void);
+void grpc_lb_policy_priority_init(void);
+void grpc_lb_policy_priority_shutdown(void);
+void grpc_lb_policy_weighted_target_init(void);
+void grpc_lb_policy_weighted_target_shutdown(void);
void grpc_lb_policy_pick_first_init(void);
void grpc_lb_policy_pick_first_shutdown(void);
void grpc_lb_policy_round_robin_init(void);
@@ -54,32 +54,32 @@ void grpc_max_age_filter_init(void);
void grpc_max_age_filter_shutdown(void);
void grpc_message_size_filter_init(void);
void grpc_message_size_filter_shutdown(void);
-void grpc_service_config_channel_arg_filter_init(void);
-void grpc_service_config_channel_arg_filter_shutdown(void);
+void grpc_service_config_channel_arg_filter_init(void);
+void grpc_service_config_channel_arg_filter_shutdown(void);
void grpc_client_authority_filter_init(void);
void grpc_client_authority_filter_shutdown(void);
void grpc_workaround_cronet_compression_filter_init(void);
void grpc_workaround_cronet_compression_filter_shutdown(void);
-#ifndef GRPC_NO_XDS
-namespace grpc_core {
-void XdsClientGlobalInit();
-void XdsClientGlobalShutdown();
-} // namespace grpc_core
-void grpc_certificate_provider_registry_init(void);
-void grpc_certificate_provider_registry_shutdown(void);
-void grpc_lb_policy_cds_init(void);
-void grpc_lb_policy_cds_shutdown(void);
-void grpc_lb_policy_eds_init(void);
-void grpc_lb_policy_eds_shutdown(void);
-void grpc_lb_policy_eds_drop_init(void);
-void grpc_lb_policy_eds_drop_shutdown(void);
-void grpc_lb_policy_xds_cluster_manager_init(void);
-void grpc_lb_policy_xds_cluster_manager_shutdown(void);
-void grpc_resolver_xds_init(void);
-void grpc_resolver_xds_shutdown(void);
-#endif
-
+#ifndef GRPC_NO_XDS
+namespace grpc_core {
+void XdsClientGlobalInit();
+void XdsClientGlobalShutdown();
+} // namespace grpc_core
+void grpc_certificate_provider_registry_init(void);
+void grpc_certificate_provider_registry_shutdown(void);
+void grpc_lb_policy_cds_init(void);
+void grpc_lb_policy_cds_shutdown(void);
+void grpc_lb_policy_eds_init(void);
+void grpc_lb_policy_eds_shutdown(void);
+void grpc_lb_policy_eds_drop_init(void);
+void grpc_lb_policy_eds_drop_shutdown(void);
+void grpc_lb_policy_xds_cluster_manager_init(void);
+void grpc_lb_policy_xds_cluster_manager_shutdown(void);
+void grpc_resolver_xds_init(void);
+void grpc_resolver_xds_shutdown(void);
+#endif
+
void grpc_register_built_in_plugins(void) {
grpc_register_plugin(grpc_http_filters_init,
grpc_http_filters_shutdown);
@@ -95,10 +95,10 @@ void grpc_register_built_in_plugins(void) {
grpc_resolver_fake_shutdown);
grpc_register_plugin(grpc_lb_policy_grpclb_init,
grpc_lb_policy_grpclb_shutdown);
- grpc_register_plugin(grpc_lb_policy_priority_init,
- grpc_lb_policy_priority_shutdown);
- grpc_register_plugin(grpc_lb_policy_weighted_target_init,
- grpc_lb_policy_weighted_target_shutdown);
+ grpc_register_plugin(grpc_lb_policy_priority_init,
+ grpc_lb_policy_priority_shutdown);
+ grpc_register_plugin(grpc_lb_policy_weighted_target_init,
+ grpc_lb_policy_weighted_target_shutdown);
grpc_register_plugin(grpc_lb_policy_pick_first_init,
grpc_lb_policy_pick_first_shutdown);
grpc_register_plugin(grpc_lb_policy_round_robin_init,
@@ -115,26 +115,26 @@ void grpc_register_built_in_plugins(void) {
grpc_max_age_filter_shutdown);
grpc_register_plugin(grpc_message_size_filter_init,
grpc_message_size_filter_shutdown);
- grpc_register_plugin(grpc_service_config_channel_arg_filter_init,
- grpc_service_config_channel_arg_filter_shutdown);
+ grpc_register_plugin(grpc_service_config_channel_arg_filter_init,
+ grpc_service_config_channel_arg_filter_shutdown);
grpc_register_plugin(grpc_client_authority_filter_init,
grpc_client_authority_filter_shutdown);
grpc_register_plugin(grpc_workaround_cronet_compression_filter_init,
grpc_workaround_cronet_compression_filter_shutdown);
-#ifndef GRPC_NO_XDS
- grpc_register_plugin(grpc_core::XdsClientGlobalInit,
- grpc_core::XdsClientGlobalShutdown);
- grpc_register_plugin(grpc_certificate_provider_registry_init,
- grpc_certificate_provider_registry_shutdown);
- grpc_register_plugin(grpc_lb_policy_cds_init,
- grpc_lb_policy_cds_shutdown);
- grpc_register_plugin(grpc_lb_policy_eds_init,
- grpc_lb_policy_eds_shutdown);
- grpc_register_plugin(grpc_lb_policy_eds_drop_init,
- grpc_lb_policy_eds_drop_shutdown);
- grpc_register_plugin(grpc_lb_policy_xds_cluster_manager_init,
- grpc_lb_policy_xds_cluster_manager_shutdown);
- grpc_register_plugin(grpc_resolver_xds_init,
- grpc_resolver_xds_shutdown);
-#endif
+#ifndef GRPC_NO_XDS
+ grpc_register_plugin(grpc_core::XdsClientGlobalInit,
+ grpc_core::XdsClientGlobalShutdown);
+ grpc_register_plugin(grpc_certificate_provider_registry_init,
+ grpc_certificate_provider_registry_shutdown);
+ grpc_register_plugin(grpc_lb_policy_cds_init,
+ grpc_lb_policy_cds_shutdown);
+ grpc_register_plugin(grpc_lb_policy_eds_init,
+ grpc_lb_policy_eds_shutdown);
+ grpc_register_plugin(grpc_lb_policy_eds_drop_init,
+ grpc_lb_policy_eds_drop_shutdown);
+ grpc_register_plugin(grpc_lb_policy_xds_cluster_manager_init,
+ grpc_lb_policy_xds_cluster_manager_shutdown);
+ grpc_register_plugin(grpc_resolver_xds_init,
+ grpc_resolver_xds_shutdown);
+#endif
}
diff --git a/contrib/libs/grpc/src/core/plugin_registry/grpc_unsecure_plugin_registry.cc b/contrib/libs/grpc/src/core/plugin_registry/grpc_unsecure_plugin_registry.cc
index 256234003cf..fd9bf9c14d5 100644
--- a/contrib/libs/grpc/src/core/plugin_registry/grpc_unsecure_plugin_registry.cc
+++ b/contrib/libs/grpc/src/core/plugin_registry/grpc_unsecure_plugin_registry.cc
@@ -40,10 +40,10 @@ void grpc_resolver_fake_init(void);
void grpc_resolver_fake_shutdown(void);
void grpc_lb_policy_grpclb_init(void);
void grpc_lb_policy_grpclb_shutdown(void);
-void grpc_lb_policy_priority_init(void);
-void grpc_lb_policy_priority_shutdown(void);
-void grpc_lb_policy_weighted_target_init(void);
-void grpc_lb_policy_weighted_target_shutdown(void);
+void grpc_lb_policy_priority_init(void);
+void grpc_lb_policy_priority_shutdown(void);
+void grpc_lb_policy_weighted_target_init(void);
+void grpc_lb_policy_weighted_target_shutdown(void);
void grpc_lb_policy_pick_first_init(void);
void grpc_lb_policy_pick_first_shutdown(void);
void grpc_lb_policy_round_robin_init(void);
@@ -54,8 +54,8 @@ void grpc_max_age_filter_init(void);
void grpc_max_age_filter_shutdown(void);
void grpc_message_size_filter_init(void);
void grpc_message_size_filter_shutdown(void);
-void grpc_service_config_channel_arg_filter_init(void);
-void grpc_service_config_channel_arg_filter_shutdown(void);
+void grpc_service_config_channel_arg_filter_init(void);
+void grpc_service_config_channel_arg_filter_shutdown(void);
void grpc_client_authority_filter_init(void);
void grpc_client_authority_filter_shutdown(void);
void grpc_workaround_cronet_compression_filter_init(void);
@@ -82,10 +82,10 @@ void grpc_register_built_in_plugins(void) {
grpc_resolver_fake_shutdown);
grpc_register_plugin(grpc_lb_policy_grpclb_init,
grpc_lb_policy_grpclb_shutdown);
- grpc_register_plugin(grpc_lb_policy_priority_init,
- grpc_lb_policy_priority_shutdown);
- grpc_register_plugin(grpc_lb_policy_weighted_target_init,
- grpc_lb_policy_weighted_target_shutdown);
+ grpc_register_plugin(grpc_lb_policy_priority_init,
+ grpc_lb_policy_priority_shutdown);
+ grpc_register_plugin(grpc_lb_policy_weighted_target_init,
+ grpc_lb_policy_weighted_target_shutdown);
grpc_register_plugin(grpc_lb_policy_pick_first_init,
grpc_lb_policy_pick_first_shutdown);
grpc_register_plugin(grpc_lb_policy_round_robin_init,
@@ -96,8 +96,8 @@ void grpc_register_built_in_plugins(void) {
grpc_max_age_filter_shutdown);
grpc_register_plugin(grpc_message_size_filter_init,
grpc_message_size_filter_shutdown);
- grpc_register_plugin(grpc_service_config_channel_arg_filter_init,
- grpc_service_config_channel_arg_filter_shutdown);
+ grpc_register_plugin(grpc_service_config_channel_arg_filter_init,
+ grpc_service_config_channel_arg_filter_shutdown);
grpc_register_plugin(grpc_client_authority_filter_init,
grpc_client_authority_filter_shutdown);
grpc_register_plugin(grpc_workaround_cronet_compression_filter_init,
diff --git a/contrib/libs/grpc/src/core/tsi/alts/handshaker/alts_handshaker_client.cc b/contrib/libs/grpc/src/core/tsi/alts/handshaker/alts_handshaker_client.cc
index 3e73146c123..e2f04f7310d 100644
--- a/contrib/libs/grpc/src/core/tsi/alts/handshaker/alts_handshaker_client.cc
+++ b/contrib/libs/grpc/src/core/tsi/alts/handshaker/alts_handshaker_client.cc
@@ -22,8 +22,8 @@
#include "src/core/tsi/alts/handshaker/alts_handshaker_client.h"
-#include "upb/upb.hpp"
-
+#include "upb/upb.hpp"
+
#include <grpc/byte_buffer.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
@@ -104,8 +104,8 @@ typedef struct alts_grpc_handshaker_client {
bool receive_status_finished;
/* if non-null, contains arguments to complete a TSI next callback. */
recv_message_result* pending_recv_message_result;
- /* Maximum frame size used by frame protector. */
- size_t max_frame_size;
+ /* Maximum frame size used by frame protector. */
+ size_t max_frame_size;
} alts_grpc_handshaker_client;
static void handshaker_client_send_buffer_destroy(
@@ -263,13 +263,13 @@ void alts_handshaker_client_handle_response(alts_handshaker_client* c,
}
tsi_handshaker_result* result = nullptr;
if (is_handshake_finished_properly(resp)) {
- tsi_result status =
- alts_tsi_handshaker_result_create(resp, client->is_client, &result);
- if (status != TSI_OK) {
- gpr_log(GPR_ERROR, "alts_tsi_handshaker_result_create() failed");
- handle_response_done(client, status, nullptr, 0, nullptr);
- return;
- }
+ tsi_result status =
+ alts_tsi_handshaker_result_create(resp, client->is_client, &result);
+ if (status != TSI_OK) {
+ gpr_log(GPR_ERROR, "alts_tsi_handshaker_result_create() failed");
+ handle_response_done(client, status, nullptr, 0, nullptr);
+ return;
+ }
alts_tsi_handshaker_result_set_unused_bytes(
result, &client->recv_bytes,
grpc_gcp_HandshakerResp_bytes_consumed(resp));
@@ -516,8 +516,8 @@ static grpc_byte_buffer* get_serialized_start_client(
upb_strview_makez(ptr->data));
ptr = ptr->next;
}
- grpc_gcp_StartClientHandshakeReq_set_max_frame_size(
- start_client, static_cast<uint32_t>(client->max_frame_size));
+ grpc_gcp_StartClientHandshakeReq_set_max_frame_size(
+ start_client, static_cast<uint32_t>(client->max_frame_size));
return get_serialized_handshaker_req(req, arena.ptr());
}
@@ -561,8 +561,8 @@ static grpc_byte_buffer* get_serialized_start_server(
grpc_gcp_ServerHandshakeParameters_new(arena.ptr());
grpc_gcp_ServerHandshakeParameters_add_record_protocols(
value, upb_strview_makez(ALTS_RECORD_PROTOCOL), arena.ptr());
- grpc_gcp_StartServerHandshakeReq_handshake_parameters_set(
- start_server, grpc_gcp_ALTS, value, arena.ptr());
+ grpc_gcp_StartServerHandshakeReq_handshake_parameters_set(
+ start_server, grpc_gcp_ALTS, value, arena.ptr());
grpc_gcp_StartServerHandshakeReq_set_in_bytes(
start_server, upb_strview_make(reinterpret_cast<const char*>(
GRPC_SLICE_START_PTR(*bytes_received)),
@@ -572,8 +572,8 @@ static grpc_byte_buffer* get_serialized_start_server(
arena.ptr());
grpc_gcp_RpcProtocolVersions_assign_from_struct(
server_version, arena.ptr(), &client->options->rpc_versions);
- grpc_gcp_StartServerHandshakeReq_set_max_frame_size(
- start_server, static_cast<uint32_t>(client->max_frame_size));
+ grpc_gcp_StartServerHandshakeReq_set_max_frame_size(
+ start_server, static_cast<uint32_t>(client->max_frame_size));
return get_serialized_handshaker_req(req, arena.ptr());
}
@@ -646,7 +646,7 @@ static void handshaker_client_shutdown(alts_handshaker_client* c) {
}
}
-static void handshaker_call_unref(void* arg, grpc_error* /* error */) {
+static void handshaker_call_unref(void* arg, grpc_error* /* error */) {
grpc_call* call = static_cast<grpc_call*>(arg);
grpc_call_unref(call);
}
@@ -664,18 +664,18 @@ static void handshaker_client_destruct(alts_handshaker_client* c) {
// TODO(apolcyn): we could remove this indirection and call
// grpc_call_unref inline if there was an internal variant of
// grpc_call_unref that didn't need to flush an ExecCtx.
- if (grpc_core::ExecCtx::Get() == nullptr) {
- // Unref handshaker call if there is no exec_ctx, e.g., in the case of
- // Envoy ALTS transport socket.
- grpc_call_unref(client->call);
- } else {
- // Using existing exec_ctx to unref handshaker call.
- grpc_core::ExecCtx::Run(
- DEBUG_LOCATION,
- GRPC_CLOSURE_CREATE(handshaker_call_unref, client->call,
- grpc_schedule_on_exec_ctx),
- GRPC_ERROR_NONE);
- }
+ if (grpc_core::ExecCtx::Get() == nullptr) {
+ // Unref handshaker call if there is no exec_ctx, e.g., in the case of
+ // Envoy ALTS transport socket.
+ grpc_call_unref(client->call);
+ } else {
+ // Using existing exec_ctx to unref handshaker call.
+ grpc_core::ExecCtx::Run(
+ DEBUG_LOCATION,
+ GRPC_CLOSURE_CREATE(handshaker_call_unref, client->call,
+ grpc_schedule_on_exec_ctx),
+ GRPC_ERROR_NONE);
+ }
}
}
@@ -690,7 +690,7 @@ alts_handshaker_client* alts_grpc_handshaker_client_create(
grpc_alts_credentials_options* options, const grpc_slice& target_name,
grpc_iomgr_cb_func grpc_cb, tsi_handshaker_on_next_done_cb cb,
void* user_data, alts_handshaker_client_vtable* vtable_for_testing,
- bool is_client, size_t max_frame_size) {
+ bool is_client, size_t max_frame_size) {
if (channel == nullptr || handshaker_service_url == nullptr) {
gpr_log(GPR_ERROR, "Invalid arguments to alts_handshaker_client_create()");
return nullptr;
@@ -710,7 +710,7 @@ alts_handshaker_client* alts_grpc_handshaker_client_create(
client->recv_bytes = grpc_empty_slice();
grpc_metadata_array_init(&client->recv_initial_metadata);
client->is_client = is_client;
- client->max_frame_size = max_frame_size;
+ client->max_frame_size = max_frame_size;
client->buffer_size = TSI_ALTS_INITIAL_BUFFER_SIZE;
client->buffer = static_cast<unsigned char*>(gpr_zalloc(client->buffer_size));
grpc_slice slice = grpc_slice_from_copied_string(handshaker_service_url);
diff --git a/contrib/libs/grpc/src/core/tsi/alts/handshaker/alts_handshaker_client.h b/contrib/libs/grpc/src/core/tsi/alts/handshaker/alts_handshaker_client.h
index e9901c64329..d8669da01cb 100644
--- a/contrib/libs/grpc/src/core/tsi/alts/handshaker/alts_handshaker_client.h
+++ b/contrib/libs/grpc/src/core/tsi/alts/handshaker/alts_handshaker_client.h
@@ -117,7 +117,7 @@ void alts_handshaker_client_destroy(alts_handshaker_client* client);
* This method creates an ALTS handshaker client.
*
* - handshaker: ALTS TSI handshaker to which the created handshaker client
- * belongs to.
+ * belongs to.
* - channel: grpc channel to ALTS handshaker service.
* - handshaker_service_url: address of ALTS handshaker service in the format of
* "host:port".
@@ -132,12 +132,12 @@ void alts_handshaker_client_destroy(alts_handshaker_client* client);
* - vtable_for_testing: ALTS handshaker client vtable instance used for
* testing purpose.
* - is_client: a boolean value indicating if the created handshaker client is
- * used at the client (is_client = true) or server (is_client = false) side.
- * - max_frame_size: Maximum frame size used by frame protector (User specified
- * maximum frame size if present or default max frame size).
- *
- * It returns the created ALTS handshaker client on success, and NULL
- * on failure.
+ * used at the client (is_client = true) or server (is_client = false) side.
+ * - max_frame_size: Maximum frame size used by frame protector (User specified
+ * maximum frame size if present or default max frame size).
+ *
+ * It returns the created ALTS handshaker client on success, and NULL
+ * on failure.
*/
alts_handshaker_client* alts_grpc_handshaker_client_create(
alts_tsi_handshaker* handshaker, grpc_channel* channel,
@@ -145,7 +145,7 @@ alts_handshaker_client* alts_grpc_handshaker_client_create(
grpc_alts_credentials_options* options, const grpc_slice& target_name,
grpc_iomgr_cb_func grpc_cb, tsi_handshaker_on_next_done_cb cb,
void* user_data, alts_handshaker_client_vtable* vtable_for_testing,
- bool is_client, size_t max_frame_size);
+ bool is_client, size_t max_frame_size);
/**
* This method handles handshaker response returned from ALTS handshaker
diff --git a/contrib/libs/grpc/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc b/contrib/libs/grpc/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc
index b026dda2122..01ef56157a5 100644
--- a/contrib/libs/grpc/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc
+++ b/contrib/libs/grpc/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc
@@ -24,8 +24,8 @@
#include <stdlib.h>
#include <string.h>
-#include "upb/upb.hpp"
-
+#include "upb/upb.hpp"
+
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
@@ -65,8 +65,8 @@ struct alts_tsi_handshaker {
// shutdown effectively follows base.handshake_shutdown,
// but is synchronized by the mutex of this object.
bool shutdown;
- // Maximum frame size used by frame protector.
- size_t max_frame_size;
+ // Maximum frame size used by frame protector.
+ size_t max_frame_size;
};
/* Main struct for ALTS TSI handshaker result. */
@@ -79,8 +79,8 @@ typedef struct alts_tsi_handshaker_result {
grpc_slice rpc_versions;
bool is_client;
grpc_slice serialized_context;
- // Peer's maximum frame size.
- size_t max_frame_size;
+ // Peer's maximum frame size.
+ size_t max_frame_size;
} alts_tsi_handshaker_result;
static tsi_result handshaker_result_extract_peer(
@@ -92,7 +92,7 @@ static tsi_result handshaker_result_extract_peer(
alts_tsi_handshaker_result* result =
reinterpret_cast<alts_tsi_handshaker_result*>(
const_cast<tsi_handshaker_result*>(self));
- GPR_ASSERT(kTsiAltsNumOfPeerProperties == 5);
+ GPR_ASSERT(kTsiAltsNumOfPeerProperties == 5);
tsi_result ok = tsi_construct_peer(kTsiAltsNumOfPeerProperties, peer);
int index = 0;
if (ok != TSI_OK) {
@@ -137,16 +137,16 @@ static tsi_result handshaker_result_extract_peer(
tsi_peer_destruct(peer);
gpr_log(GPR_ERROR, "Failed to set tsi peer property");
}
- index++;
- GPR_ASSERT(&peer->properties[index] != nullptr);
- ok = tsi_construct_string_peer_property_from_cstring(
- TSI_SECURITY_LEVEL_PEER_PROPERTY,
- tsi_security_level_to_string(TSI_PRIVACY_AND_INTEGRITY),
- &peer->properties[index]);
- if (ok != TSI_OK) {
- tsi_peer_destruct(peer);
- gpr_log(GPR_ERROR, "Failed to set tsi peer property");
- }
+ index++;
+ GPR_ASSERT(&peer->properties[index] != nullptr);
+ ok = tsi_construct_string_peer_property_from_cstring(
+ TSI_SECURITY_LEVEL_PEER_PROPERTY,
+ tsi_security_level_to_string(TSI_PRIVACY_AND_INTEGRITY),
+ &peer->properties[index]);
+ if (ok != TSI_OK) {
+ tsi_peer_destruct(peer);
+ gpr_log(GPR_ERROR, "Failed to set tsi peer property");
+ }
GPR_ASSERT(++index == kTsiAltsNumOfPeerProperties);
return ok;
}
@@ -162,26 +162,26 @@ static tsi_result handshaker_result_create_zero_copy_grpc_protector(
alts_tsi_handshaker_result* result =
reinterpret_cast<alts_tsi_handshaker_result*>(
const_cast<tsi_handshaker_result*>(self));
-
- // In case the peer does not send max frame size (e.g. peer is gRPC Go or
- // peer uses an old binary), the negotiated frame size is set to
- // kTsiAltsMinFrameSize (ignoring max_output_protected_frame_size value if
- // present). Otherwise, it is based on peer and user specified max frame
- // size (if present).
- size_t max_frame_size = kTsiAltsMinFrameSize;
- if (result->max_frame_size) {
- size_t peer_max_frame_size = result->max_frame_size;
- max_frame_size = std::min<size_t>(peer_max_frame_size,
- max_output_protected_frame_size == nullptr
- ? kTsiAltsMaxFrameSize
- : *max_output_protected_frame_size);
- max_frame_size = std::max<size_t>(max_frame_size, kTsiAltsMinFrameSize);
- }
- max_output_protected_frame_size = &max_frame_size;
- gpr_log(GPR_DEBUG,
- "After Frame Size Negotiation, maximum frame size used by frame "
- "protector equals %zu",
- *max_output_protected_frame_size);
+
+ // In case the peer does not send max frame size (e.g. peer is gRPC Go or
+ // peer uses an old binary), the negotiated frame size is set to
+ // kTsiAltsMinFrameSize (ignoring max_output_protected_frame_size value if
+ // present). Otherwise, it is based on peer and user specified max frame
+ // size (if present).
+ size_t max_frame_size = kTsiAltsMinFrameSize;
+ if (result->max_frame_size) {
+ size_t peer_max_frame_size = result->max_frame_size;
+ max_frame_size = std::min<size_t>(peer_max_frame_size,
+ max_output_protected_frame_size == nullptr
+ ? kTsiAltsMaxFrameSize
+ : *max_output_protected_frame_size);
+ max_frame_size = std::max<size_t>(max_frame_size, kTsiAltsMinFrameSize);
+ }
+ max_output_protected_frame_size = &max_frame_size;
+ gpr_log(GPR_DEBUG,
+ "After Frame Size Negotiation, maximum frame size used by frame "
+ "protector equals %zu",
+ *max_output_protected_frame_size);
tsi_result ok = alts_zero_copy_grpc_protector_create(
reinterpret_cast<const uint8_t*>(result->key_data),
kAltsAes128GcmRekeyKeyLength, /*is_rekey=*/true, result->is_client,
@@ -314,7 +314,7 @@ tsi_result alts_tsi_handshaker_result_create(grpc_gcp_HandshakerResp* resp,
static_cast<char*>(gpr_zalloc(peer_service_account.size + 1));
memcpy(result->peer_identity, peer_service_account.data,
peer_service_account.size);
- result->max_frame_size = grpc_gcp_HandshakerResult_max_frame_size(hresult);
+ result->max_frame_size = grpc_gcp_HandshakerResult_max_frame_size(hresult);
upb::Arena rpc_versions_arena;
bool serialized = grpc_gcp_rpc_protocol_versions_encode(
peer_rpc_version, rpc_versions_arena.ptr(), &result->rpc_versions);
@@ -334,28 +334,28 @@ tsi_result alts_tsi_handshaker_result_create(grpc_gcp_HandshakerResp* resp,
local_service_account);
grpc_gcp_AltsContext_set_peer_rpc_versions(
context, const_cast<grpc_gcp_RpcProtocolVersions*>(peer_rpc_version));
- grpc_gcp_Identity* peer_identity = const_cast<grpc_gcp_Identity*>(identity);
- if (peer_identity == nullptr) {
- gpr_log(GPR_ERROR, "Null peer identity in ALTS context.");
- return TSI_FAILED_PRECONDITION;
- }
- if (grpc_gcp_Identity_has_attributes(identity)) {
- size_t iter = UPB_MAP_BEGIN;
- grpc_gcp_Identity_AttributesEntry* peer_attributes_entry =
- grpc_gcp_Identity_attributes_nextmutable(peer_identity, &iter);
- while (peer_attributes_entry != nullptr) {
- upb_strview key = grpc_gcp_Identity_AttributesEntry_key(
- const_cast<grpc_gcp_Identity_AttributesEntry*>(
- peer_attributes_entry));
- upb_strview val = grpc_gcp_Identity_AttributesEntry_value(
- const_cast<grpc_gcp_Identity_AttributesEntry*>(
- peer_attributes_entry));
- grpc_gcp_AltsContext_peer_attributes_set(context, key, val,
- context_arena.ptr());
- peer_attributes_entry =
- grpc_gcp_Identity_attributes_nextmutable(peer_identity, &iter);
- }
- }
+ grpc_gcp_Identity* peer_identity = const_cast<grpc_gcp_Identity*>(identity);
+ if (peer_identity == nullptr) {
+ gpr_log(GPR_ERROR, "Null peer identity in ALTS context.");
+ return TSI_FAILED_PRECONDITION;
+ }
+ if (grpc_gcp_Identity_has_attributes(identity)) {
+ size_t iter = UPB_MAP_BEGIN;
+ grpc_gcp_Identity_AttributesEntry* peer_attributes_entry =
+ grpc_gcp_Identity_attributes_nextmutable(peer_identity, &iter);
+ while (peer_attributes_entry != nullptr) {
+ upb_strview key = grpc_gcp_Identity_AttributesEntry_key(
+ const_cast<grpc_gcp_Identity_AttributesEntry*>(
+ peer_attributes_entry));
+ upb_strview val = grpc_gcp_Identity_AttributesEntry_value(
+ const_cast<grpc_gcp_Identity_AttributesEntry*>(
+ peer_attributes_entry));
+ grpc_gcp_AltsContext_peer_attributes_set(context, key, val,
+ context_arena.ptr());
+ peer_attributes_entry =
+ grpc_gcp_Identity_attributes_nextmutable(peer_identity, &iter);
+ }
+ }
size_t serialized_ctx_length;
char* serialized_ctx = grpc_gcp_AltsContext_serialize(
context, context_arena.ptr(), &serialized_ctx_length);
@@ -423,8 +423,8 @@ static tsi_result alts_tsi_handshaker_continue_handshaker_next(
handshaker, channel, handshaker->handshaker_service_url,
handshaker->interested_parties, handshaker->options,
handshaker->target_name, grpc_cb, cb, user_data,
- handshaker->client_vtable_for_testing, handshaker->is_client,
- handshaker->max_frame_size);
+ handshaker->client_vtable_for_testing, handshaker->is_client,
+ handshaker->max_frame_size);
if (client == nullptr) {
gpr_log(GPR_ERROR, "Failed to create ALTS handshaker client");
return TSI_FAILED_PRECONDITION;
@@ -480,7 +480,7 @@ struct alts_tsi_handshaker_continue_handshaker_next_args {
};
static void alts_tsi_handshaker_create_channel(void* arg,
- grpc_error* /* unused_error */) {
+ grpc_error* /* unused_error */) {
alts_tsi_handshaker_continue_handshaker_next_args* next_args =
static_cast<alts_tsi_handshaker_continue_handshaker_next_args*>(arg);
alts_tsi_handshaker* handshaker = next_args->handshaker;
@@ -620,8 +620,8 @@ bool alts_tsi_handshaker_has_shutdown(alts_tsi_handshaker* handshaker) {
tsi_result alts_tsi_handshaker_create(
const grpc_alts_credentials_options* options, const char* target_name,
const char* handshaker_service_url, bool is_client,
- grpc_pollset_set* interested_parties, tsi_handshaker** self,
- size_t user_specified_max_frame_size) {
+ grpc_pollset_set* interested_parties, tsi_handshaker** self,
+ size_t user_specified_max_frame_size) {
if (handshaker_service_url == nullptr || self == nullptr ||
options == nullptr || (is_client && target_name == nullptr)) {
gpr_log(GPR_ERROR, "Invalid arguments to alts_tsi_handshaker_create()");
@@ -641,9 +641,9 @@ tsi_result alts_tsi_handshaker_create(
handshaker->has_created_handshaker_client = false;
handshaker->handshaker_service_url = gpr_strdup(handshaker_service_url);
handshaker->options = grpc_alts_credentials_options_copy(options);
- handshaker->max_frame_size = user_specified_max_frame_size != 0
- ? user_specified_max_frame_size
- : kTsiAltsMaxFrameSize;
+ handshaker->max_frame_size = user_specified_max_frame_size != 0
+ ? user_specified_max_frame_size
+ : kTsiAltsMaxFrameSize;
handshaker->base.vtable = handshaker->use_dedicated_cq
? &handshaker_vtable_dedicated
: &handshaker_vtable;
diff --git a/contrib/libs/grpc/src/core/tsi/alts/handshaker/alts_tsi_handshaker.h b/contrib/libs/grpc/src/core/tsi/alts/handshaker/alts_tsi_handshaker.h
index 91036960cb7..e1ae985a84d 100644
--- a/contrib/libs/grpc/src/core/tsi/alts/handshaker/alts_tsi_handshaker.h
+++ b/contrib/libs/grpc/src/core/tsi/alts/handshaker/alts_tsi_handshaker.h
@@ -36,13 +36,13 @@
#define TSI_ALTS_RPC_VERSIONS "rpc_versions"
#define TSI_ALTS_CONTEXT "alts_context"
-const size_t kTsiAltsNumOfPeerProperties = 5;
+const size_t kTsiAltsNumOfPeerProperties = 5;
+
+// Frame size negotiation extends send frame size range to
+// [kTsiAltsMinFrameSize, kTsiAltsMaxFrameSize].
+const size_t kTsiAltsMinFrameSize = 16 * 1024;
+const size_t kTsiAltsMaxFrameSize = 128 * 1024;
-// Frame size negotiation extends send frame size range to
-// [kTsiAltsMinFrameSize, kTsiAltsMaxFrameSize].
-const size_t kTsiAltsMinFrameSize = 16 * 1024;
-const size_t kTsiAltsMaxFrameSize = 128 * 1024;
-
typedef struct alts_tsi_handshaker alts_tsi_handshaker;
/**
@@ -59,8 +59,8 @@ typedef struct alts_tsi_handshaker alts_tsi_handshaker;
* - interested_parties: set of pollsets interested in this connection.
* - self: address of ALTS TSI handshaker instance to be returned from the
* method.
- * - user_specified_max_frame_size: Determines the maximum frame size used by
- * frame protector that is specified via user. If unspecified, the value is 0.
+ * - user_specified_max_frame_size: Determines the maximum frame size used by
+ * frame protector that is specified via user. If unspecified, the value is 0.
*
* It returns TSI_OK on success and an error status code on failure. Note that
* if interested_parties is nullptr, a dedicated TSI thread will be created and
@@ -69,8 +69,8 @@ typedef struct alts_tsi_handshaker alts_tsi_handshaker;
tsi_result alts_tsi_handshaker_create(
const grpc_alts_credentials_options* options, const char* target_name,
const char* handshaker_service_url, bool is_client,
- grpc_pollset_set* interested_parties, tsi_handshaker** self,
- size_t user_specified_max_frame_size);
+ grpc_pollset_set* interested_parties, tsi_handshaker** self,
+ size_t user_specified_max_frame_size);
/**
* This method creates an ALTS TSI handshaker result instance.
diff --git a/contrib/libs/grpc/src/core/tsi/alts/handshaker/transport_security_common_api.cc b/contrib/libs/grpc/src/core/tsi/alts/handshaker/transport_security_common_api.cc
index 47d8b6ce9b8..a0462b2d76c 100644
--- a/contrib/libs/grpc/src/core/tsi/alts/handshaker/transport_security_common_api.cc
+++ b/contrib/libs/grpc/src/core/tsi/alts/handshaker/transport_security_common_api.cc
@@ -20,8 +20,8 @@
#include "src/core/tsi/alts/handshaker/transport_security_common_api.h"
-#include "upb/upb.hpp"
-
+#include "upb/upb.hpp"
+
bool grpc_gcp_rpc_protocol_versions_set_max(
grpc_gcp_rpc_protocol_versions* versions, uint32_t max_major,
uint32_t max_minor) {
diff --git a/contrib/libs/grpc/src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.cc b/contrib/libs/grpc/src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.cc
index 9a63abd739f..0cdf97465d0 100644
--- a/contrib/libs/grpc/src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.cc
+++ b/contrib/libs/grpc/src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.cc
@@ -234,11 +234,11 @@ static void alts_zero_copy_grpc_protector_destroy(
}
static tsi_result alts_zero_copy_grpc_protector_max_frame_size(
- tsi_zero_copy_grpc_protector* self, size_t* max_frame_size) {
- if (self == nullptr || max_frame_size == nullptr) return TSI_INVALID_ARGUMENT;
+ tsi_zero_copy_grpc_protector* self, size_t* max_frame_size) {
+ if (self == nullptr || max_frame_size == nullptr) return TSI_INVALID_ARGUMENT;
alts_zero_copy_grpc_protector* protector =
reinterpret_cast<alts_zero_copy_grpc_protector*>(self);
- *max_frame_size = protector->max_protected_frame_size;
+ *max_frame_size = protector->max_protected_frame_size;
return TSI_OK;
}
diff --git a/contrib/libs/grpc/src/core/tsi/fake_transport_security.cc b/contrib/libs/grpc/src/core/tsi/fake_transport_security.cc
index 858ecc4d2b7..1b6b8ca07b4 100644
--- a/contrib/libs/grpc/src/core/tsi/fake_transport_security.cc
+++ b/contrib/libs/grpc/src/core/tsi/fake_transport_security.cc
@@ -490,18 +490,18 @@ struct fake_handshaker_result {
size_t unused_bytes_size;
};
static tsi_result fake_handshaker_result_extract_peer(
- const tsi_handshaker_result* self, tsi_peer* peer) {
- /* Construct a tsi_peer with 1 property: certificate type, security_level. */
- tsi_result result = tsi_construct_peer(2, peer);
+ const tsi_handshaker_result* self, tsi_peer* peer) {
+ /* Construct a tsi_peer with 1 property: certificate type, security_level. */
+ tsi_result result = tsi_construct_peer(2, peer);
if (result != TSI_OK) return result;
result = tsi_construct_string_peer_property_from_cstring(
TSI_CERTIFICATE_TYPE_PEER_PROPERTY, TSI_FAKE_CERTIFICATE_TYPE,
&peer->properties[0]);
if (result != TSI_OK) tsi_peer_destruct(peer);
- result = tsi_construct_string_peer_property_from_cstring(
- TSI_SECURITY_LEVEL_PEER_PROPERTY,
- tsi_security_level_to_string(TSI_SECURITY_NONE), &peer->properties[1]);
- if (result != TSI_OK) tsi_peer_destruct(peer);
+ result = tsi_construct_string_peer_property_from_cstring(
+ TSI_SECURITY_LEVEL_PEER_PROPERTY,
+ tsi_security_level_to_string(TSI_SECURITY_NONE), &peer->properties[1]);
+ if (result != TSI_OK) tsi_peer_destruct(peer);
return result;
}
diff --git a/contrib/libs/grpc/src/core/tsi/fake_transport_security.h b/contrib/libs/grpc/src/core/tsi/fake_transport_security.h
index fc98710b052..704d9fb1a12 100644
--- a/contrib/libs/grpc/src/core/tsi/fake_transport_security.h
+++ b/contrib/libs/grpc/src/core/tsi/fake_transport_security.h
@@ -25,8 +25,8 @@
/* Value for the TSI_CERTIFICATE_TYPE_PEER_PROPERTY property for FAKE certs. */
#define TSI_FAKE_CERTIFICATE_TYPE "FAKE"
-/* Value of the TSI_SECURITY_LEVEL_PEER_PROPERTY property for FAKE certs. */
-#define TSI_FAKE_SECURITY_LEVEL "TSI_SECURITY_NONE"
+/* Value of the TSI_SECURITY_LEVEL_PEER_PROPERTY property for FAKE certs. */
+#define TSI_FAKE_SECURITY_LEVEL "TSI_SECURITY_NONE"
/* Creates a fake handshaker that will create a fake frame protector.
diff --git a/contrib/libs/grpc/src/core/tsi/ssl/session_cache/ssl_session_boringssl.cc b/contrib/libs/grpc/src/core/tsi/ssl/session_cache/ssl_session_boringssl.cc
index af15b6f9382..a77b17c5dd5 100644
--- a/contrib/libs/grpc/src/core/tsi/ssl/session_cache/ssl_session_boringssl.cc
+++ b/contrib/libs/grpc/src/core/tsi/ssl/session_cache/ssl_session_boringssl.cc
@@ -49,7 +49,7 @@ class BoringSslCachedSession : public SslCachedSession {
std::unique_ptr<SslCachedSession> SslCachedSession::Create(
SslSessionPtr session) {
- return y_absl::make_unique<BoringSslCachedSession>(std::move(session));
+ return y_absl::make_unique<BoringSslCachedSession>(std::move(session));
}
} // namespace tsi
diff --git a/contrib/libs/grpc/src/core/tsi/ssl/session_cache/ssl_session_openssl.cc b/contrib/libs/grpc/src/core/tsi/ssl/session_cache/ssl_session_openssl.cc
index 0688068990a..1df81396816 100644
--- a/contrib/libs/grpc/src/core/tsi/ssl/session_cache/ssl_session_openssl.cc
+++ b/contrib/libs/grpc/src/core/tsi/ssl/session_cache/ssl_session_openssl.cc
@@ -67,7 +67,7 @@ class OpenSslCachedSession : public SslCachedSession {
std::unique_ptr<SslCachedSession> SslCachedSession::Create(
SslSessionPtr session) {
- return y_absl::make_unique<OpenSslCachedSession>(std::move(session));
+ return y_absl::make_unique<OpenSslCachedSession>(std::move(session));
}
} // namespace tsi
diff --git a/contrib/libs/grpc/src/core/tsi/ssl_transport_security.cc b/contrib/libs/grpc/src/core/tsi/ssl_transport_security.cc
index 8f830b1e52b..374f8e583ff 100644
--- a/contrib/libs/grpc/src/core/tsi/ssl_transport_security.cc
+++ b/contrib/libs/grpc/src/core/tsi/ssl_transport_security.cc
@@ -33,25 +33,25 @@
#include <sys/socket.h>
#endif
-#include <util/generic/string.h>
-
-#include <grpc/grpc_security.h>
+#include <util/generic/string.h>
+
+#include <grpc/grpc_security.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
#include <grpc/support/sync.h>
#include <grpc/support/thd_id.h>
-#include "y_absl/strings/match.h"
-#include "y_absl/strings/string_view.h"
-
+#include "y_absl/strings/match.h"
+#include "y_absl/strings/string_view.h"
+
extern "C" {
#include <openssl/bio.h>
#include <openssl/crypto.h> /* For OPENSSL_free */
-#include <openssl/engine.h>
+#include <openssl/engine.h>
#include <openssl/err.h>
#include <openssl/ssl.h>
-#include <openssl/tls1.h>
+#include <openssl/tls1.h>
#include <openssl/x509.h>
#include <openssl/x509v3.h>
}
@@ -138,9 +138,9 @@ struct tsi_ssl_frame_protector {
static gpr_once g_init_openssl_once = GPR_ONCE_INIT;
static int g_ssl_ctx_ex_factory_index = -1;
static const unsigned char kSslSessionIdContext[] = {'g', 'r', 'p', 'c'};
-#ifndef OPENSSL_IS_BORINGSSL
-static const char kSslEnginePrefix[] = "engine:";
-#endif
+#ifndef OPENSSL_IS_BORINGSSL
+static const char kSslEnginePrefix[] = "engine:";
+#endif
#if OPENSSL_VERSION_NUMBER < 0x10100000
static gpr_mu* g_openssl_mutexes = nullptr;
@@ -162,8 +162,8 @@ static unsigned long openssl_thread_id_cb(void) {
#endif
static void init_openssl(void) {
-#if OPENSSL_VERSION_NUMBER >= 0x10100000
- OPENSSL_init_ssl(0, nullptr);
+#if OPENSSL_VERSION_NUMBER >= 0x10100000
+ OPENSSL_init_ssl(0, nullptr);
#else
SSL_library_init();
SSL_load_error_strings();
@@ -249,7 +249,7 @@ static void ssl_info_callback(const SSL* ssl, int where, int ret) {
/* Returns 1 if name looks like an IP address, 0 otherwise.
This is a very rough heuristic, and only handles IPv6 in hexadecimal form. */
-static int looks_like_ip_address(y_absl::string_view name) {
+static int looks_like_ip_address(y_absl::string_view name) {
size_t dot_count = 0;
size_t num_size = 0;
for (size_t i = 0; i < name.size(); ++i) {
@@ -356,7 +356,7 @@ static tsi_result add_pem_certificate(X509* cert, tsi_peer_property* property) {
/* Gets the subject SANs from an X509 cert as a tsi_peer_property. */
static tsi_result add_subject_alt_names_properties_to_peer(
tsi_peer* peer, GENERAL_NAMES* subject_alt_names,
- size_t subject_alt_name_count, int* current_insert_index) {
+ size_t subject_alt_name_count, int* current_insert_index) {
size_t i;
tsi_result result = TSI_OK;
@@ -384,17 +384,17 @@ static tsi_result add_subject_alt_names_properties_to_peer(
result = tsi_construct_string_peer_property(
TSI_X509_SUBJECT_ALTERNATIVE_NAME_PEER_PROPERTY,
reinterpret_cast<const char*>(name), static_cast<size_t>(name_size),
- &peer->properties[(*current_insert_index)++]);
- if (result != TSI_OK) {
- OPENSSL_free(name);
- break;
- }
- if (subject_alt_name->type == GEN_URI) {
- result = tsi_construct_string_peer_property(
- TSI_X509_URI_PEER_PROPERTY, reinterpret_cast<const char*>(name),
- static_cast<size_t>(name_size),
- &peer->properties[(*current_insert_index)++]);
- }
+ &peer->properties[(*current_insert_index)++]);
+ if (result != TSI_OK) {
+ OPENSSL_free(name);
+ break;
+ }
+ if (subject_alt_name->type == GEN_URI) {
+ result = tsi_construct_string_peer_property(
+ TSI_X509_URI_PEER_PROPERTY, reinterpret_cast<const char*>(name),
+ static_cast<size_t>(name_size),
+ &peer->properties[(*current_insert_index)++]);
+ }
OPENSSL_free(name);
} else if (subject_alt_name->type == GEN_IPADD) {
char ntop_buf[INET6_ADDRSTRLEN];
@@ -419,7 +419,7 @@ static tsi_result add_subject_alt_names_properties_to_peer(
result = tsi_construct_string_peer_property_from_cstring(
TSI_X509_SUBJECT_ALTERNATIVE_NAME_PEER_PROPERTY, name,
- &peer->properties[(*current_insert_index)++]);
+ &peer->properties[(*current_insert_index)++]);
}
if (result != TSI_OK) break;
}
@@ -442,35 +442,35 @@ static tsi_result peer_from_x509(X509* cert, int include_certificate_type,
property_count = (include_certificate_type ? static_cast<size_t>(1) : 0) +
2 /* common name, certificate */ +
static_cast<size_t>(subject_alt_name_count);
- for (int i = 0; i < subject_alt_name_count; i++) {
- GENERAL_NAME* subject_alt_name =
- sk_GENERAL_NAME_value(subject_alt_names, TSI_SIZE_AS_SIZE(i));
- if (subject_alt_name->type == GEN_URI) {
- property_count += 1;
- }
- }
+ for (int i = 0; i < subject_alt_name_count; i++) {
+ GENERAL_NAME* subject_alt_name =
+ sk_GENERAL_NAME_value(subject_alt_names, TSI_SIZE_AS_SIZE(i));
+ if (subject_alt_name->type == GEN_URI) {
+ property_count += 1;
+ }
+ }
result = tsi_construct_peer(property_count, peer);
if (result != TSI_OK) return result;
- int current_insert_index = 0;
+ int current_insert_index = 0;
do {
if (include_certificate_type) {
result = tsi_construct_string_peer_property_from_cstring(
TSI_CERTIFICATE_TYPE_PEER_PROPERTY, TSI_X509_CERTIFICATE_TYPE,
- &peer->properties[current_insert_index++]);
+ &peer->properties[current_insert_index++]);
if (result != TSI_OK) break;
}
result = peer_property_from_x509_common_name(
- cert, &peer->properties[current_insert_index++]);
+ cert, &peer->properties[current_insert_index++]);
if (result != TSI_OK) break;
- result =
- add_pem_certificate(cert, &peer->properties[current_insert_index++]);
+ result =
+ add_pem_certificate(cert, &peer->properties[current_insert_index++]);
if (result != TSI_OK) break;
if (subject_alt_name_count != 0) {
result = add_subject_alt_names_properties_to_peer(
- peer, subject_alt_names, static_cast<size_t>(subject_alt_name_count),
- &current_insert_index);
+ peer, subject_alt_names, static_cast<size_t>(subject_alt_name_count),
+ &current_insert_index);
if (result != TSI_OK) break;
}
} while (0);
@@ -479,8 +479,8 @@ static tsi_result peer_from_x509(X509* cert, int include_certificate_type,
sk_GENERAL_NAME_pop_free(subject_alt_names, GENERAL_NAME_free);
}
if (result != TSI_OK) tsi_peer_destruct(peer);
-
- GPR_ASSERT((int)peer->property_count == current_insert_index);
+
+ GPR_ASSERT((int)peer->property_count == current_insert_index);
return result;
}
@@ -595,86 +595,86 @@ static tsi_result ssl_ctx_use_certificate_chain(SSL_CTX* context,
return result;
}
-#ifndef OPENSSL_IS_BORINGSSL
-static tsi_result ssl_ctx_use_engine_private_key(SSL_CTX* context,
- const char* pem_key,
- size_t pem_key_size) {
+#ifndef OPENSSL_IS_BORINGSSL
+static tsi_result ssl_ctx_use_engine_private_key(SSL_CTX* context,
+ const char* pem_key,
+ size_t pem_key_size) {
+ tsi_result result = TSI_OK;
+ EVP_PKEY* private_key = nullptr;
+ ENGINE* engine = nullptr;
+ char* engine_name = nullptr;
+ // Parse key which is in following format engine:<engine_id>:<key_id>
+ do {
+ char* engine_start = (char*)pem_key + strlen(kSslEnginePrefix);
+ char* engine_end = (char*)strchr(engine_start, ':');
+ if (engine_end == nullptr) {
+ result = TSI_INVALID_ARGUMENT;
+ break;
+ }
+ char* key_id = engine_end + 1;
+ int engine_name_length = engine_end - engine_start;
+ if (engine_name_length == 0) {
+ result = TSI_INVALID_ARGUMENT;
+ break;
+ }
+ engine_name = static_cast<char*>(gpr_zalloc(engine_name_length + 1));
+ memcpy(engine_name, engine_start, engine_name_length);
+ gpr_log(GPR_DEBUG, "ENGINE key: %s", engine_name);
+ ENGINE_load_dynamic();
+ engine = ENGINE_by_id(engine_name);
+ if (engine == nullptr) {
+ // If not available at ENGINE_DIR, use dynamic to load from
+ // current working directory.
+ engine = ENGINE_by_id("dynamic");
+ if (engine == nullptr) {
+ gpr_log(GPR_ERROR, "Cannot load dynamic engine");
+ result = TSI_INVALID_ARGUMENT;
+ break;
+ }
+ if (!ENGINE_ctrl_cmd_string(engine, "ID", engine_name, 0) ||
+ !ENGINE_ctrl_cmd_string(engine, "DIR_LOAD", "2", 0) ||
+ !ENGINE_ctrl_cmd_string(engine, "DIR_ADD", ".", 0) ||
+ !ENGINE_ctrl_cmd_string(engine, "LIST_ADD", "1", 0) ||
+ !ENGINE_ctrl_cmd_string(engine, "LOAD", NULL, 0)) {
+ gpr_log(GPR_ERROR, "Cannot find engine");
+ result = TSI_INVALID_ARGUMENT;
+ break;
+ }
+ }
+ if (!ENGINE_set_default(engine, ENGINE_METHOD_ALL)) {
+ gpr_log(GPR_ERROR, "ENGINE_set_default with ENGINE_METHOD_ALL failed");
+ result = TSI_INVALID_ARGUMENT;
+ break;
+ }
+ if (!ENGINE_init(engine)) {
+ gpr_log(GPR_ERROR, "ENGINE_init failed");
+ result = TSI_INVALID_ARGUMENT;
+ break;
+ }
+ private_key = ENGINE_load_private_key(engine, key_id, 0, 0);
+ if (private_key == nullptr) {
+ gpr_log(GPR_ERROR, "ENGINE_load_private_key failed");
+ result = TSI_INVALID_ARGUMENT;
+ break;
+ }
+ if (!SSL_CTX_use_PrivateKey(context, private_key)) {
+ gpr_log(GPR_ERROR, "SSL_CTX_use_PrivateKey failed");
+ result = TSI_INVALID_ARGUMENT;
+ break;
+ }
+ } while (0);
+ if (engine != nullptr) ENGINE_free(engine);
+ if (private_key != nullptr) EVP_PKEY_free(private_key);
+ if (engine_name != nullptr) gpr_free(engine_name);
+ return result;
+}
+#endif /* OPENSSL_IS_BORINGSSL */
+
+static tsi_result ssl_ctx_use_pem_private_key(SSL_CTX* context,
+ const char* pem_key,
+ size_t pem_key_size) {
tsi_result result = TSI_OK;
EVP_PKEY* private_key = nullptr;
- ENGINE* engine = nullptr;
- char* engine_name = nullptr;
- // Parse key which is in following format engine:<engine_id>:<key_id>
- do {
- char* engine_start = (char*)pem_key + strlen(kSslEnginePrefix);
- char* engine_end = (char*)strchr(engine_start, ':');
- if (engine_end == nullptr) {
- result = TSI_INVALID_ARGUMENT;
- break;
- }
- char* key_id = engine_end + 1;
- int engine_name_length = engine_end - engine_start;
- if (engine_name_length == 0) {
- result = TSI_INVALID_ARGUMENT;
- break;
- }
- engine_name = static_cast<char*>(gpr_zalloc(engine_name_length + 1));
- memcpy(engine_name, engine_start, engine_name_length);
- gpr_log(GPR_DEBUG, "ENGINE key: %s", engine_name);
- ENGINE_load_dynamic();
- engine = ENGINE_by_id(engine_name);
- if (engine == nullptr) {
- // If not available at ENGINE_DIR, use dynamic to load from
- // current working directory.
- engine = ENGINE_by_id("dynamic");
- if (engine == nullptr) {
- gpr_log(GPR_ERROR, "Cannot load dynamic engine");
- result = TSI_INVALID_ARGUMENT;
- break;
- }
- if (!ENGINE_ctrl_cmd_string(engine, "ID", engine_name, 0) ||
- !ENGINE_ctrl_cmd_string(engine, "DIR_LOAD", "2", 0) ||
- !ENGINE_ctrl_cmd_string(engine, "DIR_ADD", ".", 0) ||
- !ENGINE_ctrl_cmd_string(engine, "LIST_ADD", "1", 0) ||
- !ENGINE_ctrl_cmd_string(engine, "LOAD", NULL, 0)) {
- gpr_log(GPR_ERROR, "Cannot find engine");
- result = TSI_INVALID_ARGUMENT;
- break;
- }
- }
- if (!ENGINE_set_default(engine, ENGINE_METHOD_ALL)) {
- gpr_log(GPR_ERROR, "ENGINE_set_default with ENGINE_METHOD_ALL failed");
- result = TSI_INVALID_ARGUMENT;
- break;
- }
- if (!ENGINE_init(engine)) {
- gpr_log(GPR_ERROR, "ENGINE_init failed");
- result = TSI_INVALID_ARGUMENT;
- break;
- }
- private_key = ENGINE_load_private_key(engine, key_id, 0, 0);
- if (private_key == nullptr) {
- gpr_log(GPR_ERROR, "ENGINE_load_private_key failed");
- result = TSI_INVALID_ARGUMENT;
- break;
- }
- if (!SSL_CTX_use_PrivateKey(context, private_key)) {
- gpr_log(GPR_ERROR, "SSL_CTX_use_PrivateKey failed");
- result = TSI_INVALID_ARGUMENT;
- break;
- }
- } while (0);
- if (engine != nullptr) ENGINE_free(engine);
- if (private_key != nullptr) EVP_PKEY_free(private_key);
- if (engine_name != nullptr) gpr_free(engine_name);
- return result;
-}
-#endif /* OPENSSL_IS_BORINGSSL */
-
-static tsi_result ssl_ctx_use_pem_private_key(SSL_CTX* context,
- const char* pem_key,
- size_t pem_key_size) {
- tsi_result result = TSI_OK;
- EVP_PKEY* private_key = nullptr;
BIO* pem;
GPR_ASSERT(pem_key_size <= INT_MAX);
pem = BIO_new_mem_buf((void*)pem_key, static_cast<int>(pem_key_size));
@@ -695,20 +695,20 @@ static tsi_result ssl_ctx_use_pem_private_key(SSL_CTX* context,
return result;
}
-/* Loads an in-memory PEM private key into the SSL context. */
-static tsi_result ssl_ctx_use_private_key(SSL_CTX* context, const char* pem_key,
- size_t pem_key_size) {
-// BoringSSL does not have ENGINE support
-#ifndef OPENSSL_IS_BORINGSSL
- if (strncmp(pem_key, kSslEnginePrefix, strlen(kSslEnginePrefix)) == 0) {
- return ssl_ctx_use_engine_private_key(context, pem_key, pem_key_size);
- } else
-#endif /* OPENSSL_IS_BORINGSSL */
- {
- return ssl_ctx_use_pem_private_key(context, pem_key, pem_key_size);
- }
-}
-
+/* Loads an in-memory PEM private key into the SSL context. */
+static tsi_result ssl_ctx_use_private_key(SSL_CTX* context, const char* pem_key,
+ size_t pem_key_size) {
+// BoringSSL does not have ENGINE support
+#ifndef OPENSSL_IS_BORINGSSL
+ if (strncmp(pem_key, kSslEnginePrefix, strlen(kSslEnginePrefix)) == 0) {
+ return ssl_ctx_use_engine_private_key(context, pem_key, pem_key_size);
+ } else
+#endif /* OPENSSL_IS_BORINGSSL */
+ {
+ return ssl_ctx_use_pem_private_key(context, pem_key, pem_key_size);
+ }
+}
+
/* Loads in-memory PEM verification certs into the SSL context and optionally
returns the verification cert names (root_names can be NULL). */
static tsi_result x509_store_load_certs(X509_STORE* cert_store,
@@ -901,50 +901,50 @@ static int NullVerifyCallback(int /*preverify_ok*/, X509_STORE_CTX* /*ctx*/) {
return 1;
}
-// Sets the min and max TLS version of |ssl_context| to |min_tls_version| and
-// |max_tls_version|, respectively. Calling this method is a no-op when using
-// OpenSSL versions < 1.1.
-static tsi_result tsi_set_min_and_max_tls_versions(
- SSL_CTX* ssl_context, tsi_tls_version min_tls_version,
- tsi_tls_version max_tls_version) {
- if (ssl_context == nullptr) {
- gpr_log(GPR_INFO,
- "Invalid nullptr argument to |tsi_set_min_and_max_tls_versions|.");
- return TSI_INVALID_ARGUMENT;
- }
-#if OPENSSL_VERSION_NUMBER >= 0x10100000
- // Set the min TLS version of the SSL context.
- switch (min_tls_version) {
- case tsi_tls_version::TSI_TLS1_2:
- SSL_CTX_set_min_proto_version(ssl_context, TLS1_2_VERSION);
- break;
-#if defined(TLS1_3_VERSION)
- case tsi_tls_version::TSI_TLS1_3:
- SSL_CTX_set_min_proto_version(ssl_context, TLS1_3_VERSION);
- break;
-#endif
- default:
- gpr_log(GPR_INFO, "TLS version is not supported.");
- return TSI_FAILED_PRECONDITION;
- }
- // Set the max TLS version of the SSL context.
- switch (max_tls_version) {
- case tsi_tls_version::TSI_TLS1_2:
- SSL_CTX_set_max_proto_version(ssl_context, TLS1_2_VERSION);
- break;
-#if defined(TLS1_3_VERSION)
- case tsi_tls_version::TSI_TLS1_3:
- SSL_CTX_set_max_proto_version(ssl_context, TLS1_3_VERSION);
- break;
-#endif
- default:
- gpr_log(GPR_INFO, "TLS version is not supported.");
- return TSI_FAILED_PRECONDITION;
- }
-#endif
- return TSI_OK;
-}
-
+// Sets the min and max TLS version of |ssl_context| to |min_tls_version| and
+// |max_tls_version|, respectively. Calling this method is a no-op when using
+// OpenSSL versions < 1.1.
+static tsi_result tsi_set_min_and_max_tls_versions(
+ SSL_CTX* ssl_context, tsi_tls_version min_tls_version,
+ tsi_tls_version max_tls_version) {
+ if (ssl_context == nullptr) {
+ gpr_log(GPR_INFO,
+ "Invalid nullptr argument to |tsi_set_min_and_max_tls_versions|.");
+ return TSI_INVALID_ARGUMENT;
+ }
+#if OPENSSL_VERSION_NUMBER >= 0x10100000
+ // Set the min TLS version of the SSL context.
+ switch (min_tls_version) {
+ case tsi_tls_version::TSI_TLS1_2:
+ SSL_CTX_set_min_proto_version(ssl_context, TLS1_2_VERSION);
+ break;
+#if defined(TLS1_3_VERSION)
+ case tsi_tls_version::TSI_TLS1_3:
+ SSL_CTX_set_min_proto_version(ssl_context, TLS1_3_VERSION);
+ break;
+#endif
+ default:
+ gpr_log(GPR_INFO, "TLS version is not supported.");
+ return TSI_FAILED_PRECONDITION;
+ }
+ // Set the max TLS version of the SSL context.
+ switch (max_tls_version) {
+ case tsi_tls_version::TSI_TLS1_2:
+ SSL_CTX_set_max_proto_version(ssl_context, TLS1_2_VERSION);
+ break;
+#if defined(TLS1_3_VERSION)
+ case tsi_tls_version::TSI_TLS1_3:
+ SSL_CTX_set_max_proto_version(ssl_context, TLS1_3_VERSION);
+ break;
+#endif
+ default:
+ gpr_log(GPR_INFO, "TLS version is not supported.");
+ return TSI_FAILED_PRECONDITION;
+ }
+#endif
+ return TSI_OK;
+}
+
/* --- tsi_ssl_root_certs_store methods implementation. ---*/
tsi_ssl_root_certs_store* tsi_ssl_root_certs_store_create(
@@ -1191,30 +1191,30 @@ static void tsi_ssl_handshaker_factory_init(
gpr_ref_init(&factory->refcount, 1);
}
-/* Gets the X509 cert chain in PEM format as a tsi_peer_property. */
-tsi_result tsi_ssl_get_cert_chain_contents(STACK_OF(X509) * peer_chain,
- tsi_peer_property* property) {
- BIO* bio = BIO_new(BIO_s_mem());
- const auto peer_chain_len = sk_X509_num(peer_chain);
- for (auto i = decltype(peer_chain_len){0}; i < peer_chain_len; i++) {
- if (!PEM_write_bio_X509(bio, sk_X509_value(peer_chain, i))) {
- BIO_free(bio);
- return TSI_INTERNAL_ERROR;
- }
- }
- char* contents;
- long len = BIO_get_mem_data(bio, &contents);
- if (len <= 0) {
- BIO_free(bio);
- return TSI_INTERNAL_ERROR;
- }
- tsi_result result = tsi_construct_string_peer_property(
- TSI_X509_PEM_CERT_CHAIN_PROPERTY, (const char*)contents,
- static_cast<size_t>(len), property);
- BIO_free(bio);
- return result;
-}
-
+/* Gets the X509 cert chain in PEM format as a tsi_peer_property. */
+tsi_result tsi_ssl_get_cert_chain_contents(STACK_OF(X509) * peer_chain,
+ tsi_peer_property* property) {
+ BIO* bio = BIO_new(BIO_s_mem());
+ const auto peer_chain_len = sk_X509_num(peer_chain);
+ for (auto i = decltype(peer_chain_len){0}; i < peer_chain_len; i++) {
+ if (!PEM_write_bio_X509(bio, sk_X509_value(peer_chain, i))) {
+ BIO_free(bio);
+ return TSI_INTERNAL_ERROR;
+ }
+ }
+ char* contents;
+ long len = BIO_get_mem_data(bio, &contents);
+ if (len <= 0) {
+ BIO_free(bio);
+ return TSI_INTERNAL_ERROR;
+ }
+ tsi_result result = tsi_construct_string_peer_property(
+ TSI_X509_PEM_CERT_CHAIN_PROPERTY, (const char*)contents,
+ static_cast<size_t>(len), property);
+ BIO_free(bio);
+ return result;
+}
+
/* --- tsi_handshaker_result methods implementation. ---*/
static tsi_result ssl_handshaker_result_extract_peer(
const tsi_handshaker_result* self, tsi_peer* peer) {
@@ -1237,14 +1237,14 @@ static tsi_result ssl_handshaker_result_extract_peer(
SSL_get0_next_proto_negotiated(impl->ssl, &alpn_selected,
&alpn_selected_len);
}
- // When called on the client side, the stack also contains the
- // peer's certificate; When called on the server side,
- // the peer's certificate is not present in the stack
- STACK_OF(X509)* peer_chain = SSL_get_peer_cert_chain(impl->ssl);
+ // When called on the client side, the stack also contains the
+ // peer's certificate; When called on the server side,
+ // the peer's certificate is not present in the stack
+ STACK_OF(X509)* peer_chain = SSL_get_peer_cert_chain(impl->ssl);
// 1 is for session reused property.
- size_t new_property_count = peer->property_count + 3;
+ size_t new_property_count = peer->property_count + 3;
if (alpn_selected != nullptr) new_property_count++;
- if (peer_chain != nullptr) new_property_count++;
+ if (peer_chain != nullptr) new_property_count++;
tsi_peer_property* new_properties = static_cast<tsi_peer_property*>(
gpr_zalloc(sizeof(*new_properties) * new_property_count));
for (size_t i = 0; i < peer->property_count; i++) {
@@ -1252,12 +1252,12 @@ static tsi_result ssl_handshaker_result_extract_peer(
}
if (peer->properties != nullptr) gpr_free(peer->properties);
peer->properties = new_properties;
- // Add peer chain if available
- if (peer_chain != nullptr) {
- result = tsi_ssl_get_cert_chain_contents(
- peer_chain, &peer->properties[peer->property_count]);
- if (result == TSI_OK) peer->property_count++;
- }
+ // Add peer chain if available
+ if (peer_chain != nullptr) {
+ result = tsi_ssl_get_cert_chain_contents(
+ peer_chain, &peer->properties[peer->property_count]);
+ if (result == TSI_OK) peer->property_count++;
+ }
if (alpn_selected != nullptr) {
result = tsi_construct_string_peer_property(
TSI_SSL_ALPN_SELECTED_PROTOCOL,
@@ -1266,13 +1266,13 @@ static tsi_result ssl_handshaker_result_extract_peer(
if (result != TSI_OK) return result;
peer->property_count++;
}
- // Add security_level peer property.
- result = tsi_construct_string_peer_property_from_cstring(
- TSI_SECURITY_LEVEL_PEER_PROPERTY,
- tsi_security_level_to_string(TSI_PRIVACY_AND_INTEGRITY),
- &peer->properties[peer->property_count]);
- if (result != TSI_OK) return result;
- peer->property_count++;
+ // Add security_level peer property.
+ result = tsi_construct_string_peer_property_from_cstring(
+ TSI_SECURITY_LEVEL_PEER_PROPERTY,
+ tsi_security_level_to_string(TSI_PRIVACY_AND_INTEGRITY),
+ &peer->properties[peer->property_count]);
+ if (result != TSI_OK) return result;
+ peer->property_count++;
const char* session_reused = SSL_session_reused(impl->ssl) ? "true" : "false";
result = tsi_construct_string_peer_property_from_cstring(
@@ -1356,7 +1356,7 @@ static const tsi_handshaker_result_vtable handshaker_result_vtable = {
};
static tsi_result ssl_handshaker_result_create(
- tsi_ssl_handshaker* handshaker, unsigned char* unused_bytes,
+ tsi_ssl_handshaker* handshaker, unsigned char* unused_bytes,
size_t unused_bytes_size, tsi_handshaker_result** handshaker_result) {
if (handshaker == nullptr || handshaker_result == nullptr ||
(unused_bytes_size > 0 && unused_bytes == nullptr)) {
@@ -1370,8 +1370,8 @@ static tsi_result ssl_handshaker_result_create(
handshaker->ssl = nullptr;
result->network_io = handshaker->network_io;
handshaker->network_io = nullptr;
- /* Transfer ownership of |unused_bytes| to the handshaker result. */
- result->unused_bytes = unused_bytes;
+ /* Transfer ownership of |unused_bytes| to the handshaker result. */
+ result->unused_bytes = unused_bytes;
result->unused_bytes_size = unused_bytes_size;
*handshaker_result = &result->base;
return TSI_OK;
@@ -1464,36 +1464,36 @@ static void ssl_handshaker_destroy(tsi_handshaker* self) {
gpr_free(impl);
}
-// Removes the bytes remaining in |impl->SSL|'s read BIO and writes them to
-// |bytes_remaining|.
-static tsi_result ssl_bytes_remaining(tsi_ssl_handshaker* impl,
- unsigned char** bytes_remaining,
- size_t* bytes_remaining_size) {
- if (impl == nullptr || bytes_remaining == nullptr ||
- bytes_remaining_size == nullptr) {
- return TSI_INVALID_ARGUMENT;
- }
- // Atempt to read all of the bytes in SSL's read BIO. These bytes should
- // contain application data records that were appended to a handshake record
- // containing the ClientFinished or ServerFinished message.
- size_t bytes_in_ssl = BIO_pending(SSL_get_rbio(impl->ssl));
- if (bytes_in_ssl == 0) return TSI_OK;
- *bytes_remaining = static_cast<uint8_t*>(gpr_malloc(bytes_in_ssl));
- int bytes_read = BIO_read(SSL_get_rbio(impl->ssl), *bytes_remaining,
- static_cast<int>(bytes_in_ssl));
- // If an unexpected number of bytes were read, return an error status and free
- // all of the bytes that were read.
- if (bytes_read < 0 || static_cast<size_t>(bytes_read) != bytes_in_ssl) {
- gpr_log(GPR_ERROR,
- "Failed to read the expected number of bytes from SSL object.");
- gpr_free(*bytes_remaining);
- *bytes_remaining = nullptr;
- return TSI_INTERNAL_ERROR;
- }
- *bytes_remaining_size = static_cast<size_t>(bytes_read);
- return TSI_OK;
-}
-
+// Removes the bytes remaining in |impl->SSL|'s read BIO and writes them to
+// |bytes_remaining|.
+static tsi_result ssl_bytes_remaining(tsi_ssl_handshaker* impl,
+ unsigned char** bytes_remaining,
+ size_t* bytes_remaining_size) {
+ if (impl == nullptr || bytes_remaining == nullptr ||
+ bytes_remaining_size == nullptr) {
+ return TSI_INVALID_ARGUMENT;
+ }
+ // Atempt to read all of the bytes in SSL's read BIO. These bytes should
+ // contain application data records that were appended to a handshake record
+ // containing the ClientFinished or ServerFinished message.
+ size_t bytes_in_ssl = BIO_pending(SSL_get_rbio(impl->ssl));
+ if (bytes_in_ssl == 0) return TSI_OK;
+ *bytes_remaining = static_cast<uint8_t*>(gpr_malloc(bytes_in_ssl));
+ int bytes_read = BIO_read(SSL_get_rbio(impl->ssl), *bytes_remaining,
+ static_cast<int>(bytes_in_ssl));
+ // If an unexpected number of bytes were read, return an error status and free
+ // all of the bytes that were read.
+ if (bytes_read < 0 || static_cast<size_t>(bytes_read) != bytes_in_ssl) {
+ gpr_log(GPR_ERROR,
+ "Failed to read the expected number of bytes from SSL object.");
+ gpr_free(*bytes_remaining);
+ *bytes_remaining = nullptr;
+ return TSI_INTERNAL_ERROR;
+ }
+ *bytes_remaining_size = static_cast<size_t>(bytes_read);
+ return TSI_OK;
+}
+
static tsi_result ssl_handshaker_next(
tsi_handshaker* self, const unsigned char* received_bytes,
size_t received_bytes_size, const unsigned char** bytes_to_send,
@@ -1534,19 +1534,19 @@ static tsi_result ssl_handshaker_next(
if (ssl_handshaker_get_result(impl) == TSI_HANDSHAKE_IN_PROGRESS) {
*handshaker_result = nullptr;
} else {
- // Any bytes that remain in |impl->ssl|'s read BIO after the handshake is
- // complete must be extracted and set to the unused bytes of the handshaker
- // result. This indicates to the gRPC stack that there are bytes from the
- // peer that must be processed.
- unsigned char* unused_bytes = nullptr;
- size_t unused_bytes_size = 0;
- status = ssl_bytes_remaining(impl, &unused_bytes, &unused_bytes_size);
- if (status != TSI_OK) return status;
- if (unused_bytes_size > received_bytes_size) {
- gpr_log(GPR_ERROR, "More unused bytes than received bytes.");
- gpr_free(unused_bytes);
- return TSI_INTERNAL_ERROR;
- }
+ // Any bytes that remain in |impl->ssl|'s read BIO after the handshake is
+ // complete must be extracted and set to the unused bytes of the handshaker
+ // result. This indicates to the gRPC stack that there are bytes from the
+ // peer that must be processed.
+ unsigned char* unused_bytes = nullptr;
+ size_t unused_bytes_size = 0;
+ status = ssl_bytes_remaining(impl, &unused_bytes, &unused_bytes_size);
+ if (status != TSI_OK) return status;
+ if (unused_bytes_size > received_bytes_size) {
+ gpr_log(GPR_ERROR, "More unused bytes than received bytes.");
+ gpr_free(unused_bytes);
+ return TSI_INTERNAL_ERROR;
+ }
status = ssl_handshaker_result_create(impl, unused_bytes, unused_bytes_size,
handshaker_result);
if (status == TSI_OK) {
@@ -1755,8 +1755,8 @@ static void tsi_ssl_server_handshaker_factory_destroy(
gpr_free(self);
}
-static int does_entry_match_name(y_absl::string_view entry,
- y_absl::string_view name) {
+static int does_entry_match_name(y_absl::string_view entry,
+ y_absl::string_view name) {
if (entry.empty()) return 0;
/* Take care of '.' terminations. */
@@ -1768,7 +1768,7 @@ static int does_entry_match_name(y_absl::string_view entry,
if (entry.empty()) return 0;
}
- if (y_absl::EqualsIgnoreCase(name, entry)) {
+ if (y_absl::EqualsIgnoreCase(name, entry)) {
return 1; /* Perfect match. */
}
if (entry.front() != '*') return 0;
@@ -1779,21 +1779,21 @@ static int does_entry_match_name(y_absl::string_view entry,
return 0;
}
size_t name_subdomain_pos = name.find('.');
- if (name_subdomain_pos == y_absl::string_view::npos) return 0;
+ if (name_subdomain_pos == y_absl::string_view::npos) return 0;
if (name_subdomain_pos >= name.size() - 2) return 0;
- y_absl::string_view name_subdomain =
+ y_absl::string_view name_subdomain =
name.substr(name_subdomain_pos + 1); /* Starts after the dot. */
entry.remove_prefix(2); /* Remove *. */
size_t dot = name_subdomain.find('.');
- if (dot == y_absl::string_view::npos || dot == name_subdomain.size() - 1) {
+ if (dot == y_absl::string_view::npos || dot == name_subdomain.size() - 1) {
gpr_log(GPR_ERROR, "Invalid toplevel subdomain: %s",
- TString(name_subdomain).c_str());
+ TString(name_subdomain).c_str());
return 0;
}
if (name_subdomain.back() == '.') {
name_subdomain.remove_suffix(1);
}
- return !entry.empty() && y_absl::EqualsIgnoreCase(name_subdomain, entry);
+ return !entry.empty() && y_absl::EqualsIgnoreCase(name_subdomain, entry);
}
static int ssl_server_handshaker_factory_servername_callback(SSL* ssl,
@@ -1815,7 +1815,7 @@ static int ssl_server_handshaker_factory_servername_callback(SSL* ssl,
}
}
gpr_log(GPR_ERROR, "No match found for server name: %s.", servername);
- return SSL_TLSEXT_ERR_NOACK;
+ return SSL_TLSEXT_ERR_NOACK;
}
#if TSI_OPENSSL_ALPN_SUPPORT
@@ -1899,14 +1899,14 @@ tsi_result tsi_create_ssl_client_handshaker_factory_with_options(
return TSI_INVALID_ARGUMENT;
}
-#if OPENSSL_VERSION_NUMBER >= 0x10100000
+#if OPENSSL_VERSION_NUMBER >= 0x10100000
ssl_context = SSL_CTX_new(TLS_method());
#else
ssl_context = SSL_CTX_new(TLSv1_2_method());
#endif
- result = tsi_set_min_and_max_tls_versions(
- ssl_context, options->min_tls_version, options->max_tls_version);
- if (result != TSI_OK) return result;
+ result = tsi_set_min_and_max_tls_versions(
+ ssl_context, options->min_tls_version, options->max_tls_version);
+ if (result != TSI_OK) return result;
if (ssl_context == nullptr) {
gpr_log(GPR_ERROR, "Could not create ssl context.");
return TSI_INVALID_ARGUMENT;
@@ -1977,11 +1977,11 @@ tsi_result tsi_create_ssl_client_handshaker_factory_with_options(
tsi_ssl_handshaker_factory_unref(&impl->base);
return result;
}
- if (options->skip_server_certificate_verification) {
- SSL_CTX_set_verify(ssl_context, SSL_VERIFY_PEER, NullVerifyCallback);
- } else {
- SSL_CTX_set_verify(ssl_context, SSL_VERIFY_PEER, nullptr);
- }
+ if (options->skip_server_certificate_verification) {
+ SSL_CTX_set_verify(ssl_context, SSL_VERIFY_PEER, NullVerifyCallback);
+ } else {
+ SSL_CTX_set_verify(ssl_context, SSL_VERIFY_PEER, nullptr);
+ }
/* TODO(jboeuf): Add revocation verification. */
*factory = impl;
@@ -2066,15 +2066,15 @@ tsi_result tsi_create_ssl_server_handshaker_factory_with_options(
for (i = 0; i < options->num_key_cert_pairs; i++) {
do {
-#if OPENSSL_VERSION_NUMBER >= 0x10100000
+#if OPENSSL_VERSION_NUMBER >= 0x10100000
impl->ssl_contexts[i] = SSL_CTX_new(TLS_method());
#else
impl->ssl_contexts[i] = SSL_CTX_new(TLSv1_2_method());
#endif
- result = tsi_set_min_and_max_tls_versions(impl->ssl_contexts[i],
- options->min_tls_version,
- options->max_tls_version);
- if (result != TSI_OK) return result;
+ result = tsi_set_min_and_max_tls_versions(impl->ssl_contexts[i],
+ options->min_tls_version,
+ options->max_tls_version);
+ if (result != TSI_OK) return result;
if (impl->ssl_contexts[i] == nullptr) {
gpr_log(GPR_ERROR, "Could not create ssl context.");
result = TSI_OUT_OF_RESOURCES;
@@ -2173,7 +2173,7 @@ tsi_result tsi_create_ssl_server_handshaker_factory_with_options(
/* --- tsi_ssl utils. --- */
-int tsi_ssl_peer_matches_name(const tsi_peer* peer, y_absl::string_view name) {
+int tsi_ssl_peer_matches_name(const tsi_peer* peer, y_absl::string_view name) {
size_t i = 0;
size_t san_count = 0;
const tsi_peer_property* cn_property = nullptr;
@@ -2187,7 +2187,7 @@ int tsi_ssl_peer_matches_name(const tsi_peer* peer, y_absl::string_view name) {
TSI_X509_SUBJECT_ALTERNATIVE_NAME_PEER_PROPERTY) == 0) {
san_count++;
- y_absl::string_view entry(property->value.data, property->value.length);
+ y_absl::string_view entry(property->value.data, property->value.length);
if (!like_ip && does_entry_match_name(entry, name)) {
return 1;
} else if (like_ip && name == entry) {
@@ -2202,8 +2202,8 @@ int tsi_ssl_peer_matches_name(const tsi_peer* peer, y_absl::string_view name) {
/* If there's no SAN, try the CN, but only if its not like an IP Address */
if (san_count == 0 && cn_property != nullptr && !like_ip) {
- if (does_entry_match_name(y_absl::string_view(cn_property->value.data,
- cn_property->value.length),
+ if (does_entry_match_name(y_absl::string_view(cn_property->value.data,
+ cn_property->value.length),
name)) {
return 1;
}
diff --git a/contrib/libs/grpc/src/core/tsi/ssl_transport_security.h b/contrib/libs/grpc/src/core/tsi/ssl_transport_security.h
index 3eef264bfdf..2f2dc08c053 100644
--- a/contrib/libs/grpc/src/core/tsi/ssl_transport_security.h
+++ b/contrib/libs/grpc/src/core/tsi/ssl_transport_security.h
@@ -21,14 +21,14 @@
#include <grpc/support/port_platform.h>
-#include <grpc/grpc_security_constants.h>
-#include "y_absl/strings/string_view.h"
+#include <grpc/grpc_security_constants.h>
+#include "y_absl/strings/string_view.h"
#include "src/core/tsi/transport_security_interface.h"
-extern "C" {
-#include <openssl/x509.h>
-}
-
+extern "C" {
+#include <openssl/x509.h>
+}
+
/* Value for the TSI_CERTIFICATE_TYPE_PEER_PROPERTY property for X509 certs. */
#define TSI_X509_CERTIFICATE_TYPE "X509"
@@ -40,12 +40,12 @@ extern "C" {
#define TSI_X509_PEM_CERT_PROPERTY "x509_pem_cert"
-#define TSI_X509_PEM_CERT_CHAIN_PROPERTY "x509_pem_cert_chain"
-
+#define TSI_X509_PEM_CERT_CHAIN_PROPERTY "x509_pem_cert_chain"
+
#define TSI_SSL_ALPN_SELECTED_PROTOCOL "ssl_alpn_selected_protocol"
-#define TSI_X509_URI_PEER_PROPERTY "x509_uri"
-
+#define TSI_X509_URI_PEER_PROPERTY "x509_uri"
+
/* --- tsi_ssl_root_certs_store object ---
This object stores SSL root certificates. It can be shared by multiple SSL
@@ -150,13 +150,13 @@ struct tsi_ssl_client_handshaker_options {
/* ssl_session_cache is a cache for reusable client-side sessions. */
tsi_ssl_session_cache* session_cache;
- /* skip server certificate verification. */
- bool skip_server_certificate_verification;
-
- /* The min and max TLS versions that will be negotiated by the handshaker. */
- tsi_tls_version min_tls_version;
- tsi_tls_version max_tls_version;
-
+ /* skip server certificate verification. */
+ bool skip_server_certificate_verification;
+
+ /* The min and max TLS versions that will be negotiated by the handshaker. */
+ tsi_tls_version min_tls_version;
+ tsi_tls_version max_tls_version;
+
tsi_ssl_client_handshaker_options()
: pem_key_cert_pair(nullptr),
pem_root_certs(nullptr),
@@ -164,10 +164,10 @@ struct tsi_ssl_client_handshaker_options {
cipher_suites(nullptr),
alpn_protocols(nullptr),
num_alpn_protocols(0),
- session_cache(nullptr),
- skip_server_certificate_verification(false),
- min_tls_version(tsi_tls_version::TSI_TLS1_2),
- max_tls_version(tsi_tls_version::TSI_TLS1_3) {}
+ session_cache(nullptr),
+ skip_server_certificate_verification(false),
+ min_tls_version(tsi_tls_version::TSI_TLS1_2),
+ max_tls_version(tsi_tls_version::TSI_TLS1_3) {}
};
/* Creates a client handshaker factory.
@@ -283,9 +283,9 @@ struct tsi_ssl_server_handshaker_options {
const char* session_ticket_key;
/* session_ticket_key_size is a size of session ticket encryption key. */
size_t session_ticket_key_size;
- /* The min and max TLS versions that will be negotiated by the handshaker. */
- tsi_tls_version min_tls_version;
- tsi_tls_version max_tls_version;
+ /* The min and max TLS versions that will be negotiated by the handshaker. */
+ tsi_tls_version min_tls_version;
+ tsi_tls_version max_tls_version;
tsi_ssl_server_handshaker_options()
: pem_key_cert_pairs(nullptr),
@@ -296,9 +296,9 @@ struct tsi_ssl_server_handshaker_options {
alpn_protocols(nullptr),
num_alpn_protocols(0),
session_ticket_key(nullptr),
- session_ticket_key_size(0),
- min_tls_version(tsi_tls_version::TSI_TLS1_2),
- max_tls_version(tsi_tls_version::TSI_TLS1_3) {}
+ session_ticket_key_size(0),
+ min_tls_version(tsi_tls_version::TSI_TLS1_2),
+ max_tls_version(tsi_tls_version::TSI_TLS1_3) {}
};
/* Creates a server handshaker factory.
@@ -330,7 +330,7 @@ void tsi_ssl_server_handshaker_factory_unref(
- handle mixed case.
- handle %encoded chars.
- handle public suffix wildchar more strictly (e.g. *.co.uk) */
-int tsi_ssl_peer_matches_name(const tsi_peer* peer, y_absl::string_view name);
+int tsi_ssl_peer_matches_name(const tsi_peer* peer, y_absl::string_view name);
/* --- Testing support. ---
@@ -358,8 +358,8 @@ const tsi_ssl_handshaker_factory_vtable* tsi_ssl_handshaker_factory_swap_vtable(
tsi_result tsi_ssl_extract_x509_subject_names_from_pem_cert(
const char* pem_cert, tsi_peer* peer);
-/* Exposed for testing only. */
-tsi_result tsi_ssl_get_cert_chain_contents(STACK_OF(X509) * peer_chain,
- tsi_peer_property* property);
-
+/* Exposed for testing only. */
+tsi_result tsi_ssl_get_cert_chain_contents(STACK_OF(X509) * peer_chain,
+ tsi_peer_property* property);
+
#endif /* GRPC_CORE_TSI_SSL_TRANSPORT_SECURITY_H */
diff --git a/contrib/libs/grpc/src/core/tsi/test_creds/README b/contrib/libs/grpc/src/core/tsi/test_creds/README
index 878bfb2b6c5..ee9b60ec590 100644
--- a/contrib/libs/grpc/src/core/tsi/test_creds/README
+++ b/contrib/libs/grpc/src/core/tsi/test_creds/README
@@ -6,7 +6,7 @@ Bad credentials (badclient.* / badserver.*):
These are self-signed certificates:
-$ openssl req -x509 -newkey rsa:2048 -keyout badserver.key -out badserver.pem \
+$ openssl req -x509 -newkey rsa:2048 -keyout badserver.key -out badserver.pem \
-days 3650 -nodes
When prompted for certificate information, everything is default except the
@@ -19,81 +19,81 @@ Valid test credentials:
The ca is self-signed:
----------------------
-$ openssl req -x509 -new -newkey rsa:2048 -nodes -keyout ca.key -out ca.pem \
- -config ca-openssl.cnf -days 3650 -extensions v3_req
+$ openssl req -x509 -new -newkey rsa:2048 -nodes -keyout ca.key -out ca.pem \
+ -config ca-openssl.cnf -days 3650 -extensions v3_req
When prompted for certificate information, everything is default.
client is issued by CA:
-----------------------
-$ openssl genrsa -out client.key.rsa 2048
+$ openssl genrsa -out client.key.rsa 2048
$ openssl pkcs8 -topk8 -in client.key.rsa -out client.key -nocrypt
$ openssl req -new -key client.key -out client.csr
When prompted for certificate information, everything is default except the
common name which is set to testclient.
-$ openssl x509 -req -CA ca.pem -CAkey ca.key -CAcreateserial -in client.csr \
- -out client.pem -days 3650
+$ openssl x509 -req -CA ca.pem -CAkey ca.key -CAcreateserial -in client.csr \
+ -out client.pem -days 3650
server0 is issued by CA:
------------------------
-$ openssl genrsa -out server0.key.rsa 2048
+$ openssl genrsa -out server0.key.rsa 2048
$ openssl pkcs8 -topk8 -in server0.key.rsa -out server0.key -nocrypt
$ openssl req -new -key server0.key -out server0.csr
When prompted for certificate information, everything is default except the
common name which is set to *.test.google.com.au.
-$ openssl x509 -req -CA ca.pem -CAkey ca.key -CAcreateserial -in server0.csr \
- -out server0.pem -days 3650
+$ openssl x509 -req -CA ca.pem -CAkey ca.key -CAcreateserial -in server0.csr \
+ -out server0.pem -days 3650
server1 is issued by CA with a special config for subject alternative names:
----------------------------------------------------------------------------
-$ openssl genrsa -out server1.key.rsa 2048
+$ openssl genrsa -out server1.key.rsa 2048
$ openssl pkcs8 -topk8 -in server1.key.rsa -out server1.key -nocrypt
$ openssl req -new -key server1.key -out server1.csr -config server1-openssl.cnf
When prompted for certificate information, everything is default except the
common name which is set to *.test.google.com.
-$ openssl x509 -req -CA ca.pem -CAkey ca.key -CAcreateserial -in server1.csr \
- -out server1.pem -extensions req_ext -extfile server1-openssl.cnf -days 3650
-
-multi-domain is a self-signed certificate having multiple subject alternative names:
-----------------------------------------------------------------------------
-
-$ openssl genrsa -out multi-domain.key.rsa 2048
-$ openssl pkcs8 -topk8 -in multi-domain.key.rsa -out multi-domain.key -nocrypt
-$ openssl req -new -key multi-domain.key -out multi-domain.csr -config
-multi-domain-openssl.cnf
-$ openssl req -x509 -new -extensions v3_req -key multi-domain.key -out
-multi-domain.pem -days 3650 -config multi-domain-openssl.cnf
-
-Clean up:
----------
-$ rm *.rsa
-$ rm *.csr
-$ rm ca.srl
-
-Sync up with other repositories
-===============================
-
-Copies of these keys (except for multi-domain) exist in multiple locations across all the grpc repos
-(e.g., see the following partial list). You need to be careful when updating
-the keys.
-
-grpc-dart/interop/
-grpc-dotnet/testassets/Certs/InteropTests/
-grpc-go/testdata/
-grpc-java/testing/src/main/resources/certs/
-grpc-node/test/data/
-src/csharp/Grpc.IntegrationTesting/data/
-src/objective-c/tests/TestCertificates.bundle/
-src/php/tests/data/
-src/python/grpcio_tests/tests/interop/credentials/
-src/python/grpcio_tests/tests/unit/credentials/
-src/ruby/spec/testdata/
-test/core/end2end/data/
+$ openssl x509 -req -CA ca.pem -CAkey ca.key -CAcreateserial -in server1.csr \
+ -out server1.pem -extensions req_ext -extfile server1-openssl.cnf -days 3650
+
+multi-domain is a self-signed certificate having multiple subject alternative names:
+----------------------------------------------------------------------------
+
+$ openssl genrsa -out multi-domain.key.rsa 2048
+$ openssl pkcs8 -topk8 -in multi-domain.key.rsa -out multi-domain.key -nocrypt
+$ openssl req -new -key multi-domain.key -out multi-domain.csr -config
+multi-domain-openssl.cnf
+$ openssl req -x509 -new -extensions v3_req -key multi-domain.key -out
+multi-domain.pem -days 3650 -config multi-domain-openssl.cnf
+
+Clean up:
+---------
+$ rm *.rsa
+$ rm *.csr
+$ rm ca.srl
+
+Sync up with other repositories
+===============================
+
+Copies of these keys (except for multi-domain) exist in multiple locations across all the grpc repos
+(e.g., see the following partial list). You need to be careful when updating
+the keys.
+
+grpc-dart/interop/
+grpc-dotnet/testassets/Certs/InteropTests/
+grpc-go/testdata/
+grpc-java/testing/src/main/resources/certs/
+grpc-node/test/data/
+src/csharp/Grpc.IntegrationTesting/data/
+src/objective-c/tests/TestCertificates.bundle/
+src/php/tests/data/
+src/python/grpcio_tests/tests/interop/credentials/
+src/python/grpcio_tests/tests/unit/credentials/
+src/ruby/spec/testdata/
+test/core/end2end/data/
diff --git a/contrib/libs/grpc/src/core/tsi/test_creds/badclient.key b/contrib/libs/grpc/src/core/tsi/test_creds/badclient.key
index 08d2a3396de..6cd102b8308 100644
--- a/contrib/libs/grpc/src/core/tsi/test_creds/badclient.key
+++ b/contrib/libs/grpc/src/core/tsi/test_creds/badclient.key
@@ -1,28 +1,28 @@
-----BEGIN PRIVATE KEY-----
-MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDvdzKDTYvRgjBO
-UOrzDwkAZGwNFHHlMYyMGI5tItj3tCzXkbpM0uz3ZjHVahu+eYc+KvYApM64F2dB
-b16hs713FCk8mihYABjnSndrQsl/U2v8YFT7DipfLReqqaOGu2o9HdvWfiUlaiC/
-UGGfR+YblpK7CG+7/hvTXtUsMw+OppoeH9z87rhOJMxtiC7XwU5rhEmab/1f1XM/
-nLoZrfDAcTbDywoeu826SJ3mifajq7oK3LDdNLjWZwfEsCO1qp2C4gLvBlOOKsWO
-LNby6ByxCOPlCTa0UCaVuoNclYol71jyi17KW+Nk0nNe9yaVcyr6H0z3bImfJhbS
-u4rzI93nAgMBAAECggEBAOIPOJRTpGaH7GpCYUpLK0g/hPFkF5EyEWg/1lSYzRIp
-+RsX6zOS+zkiNHEv1jkeKNo7XDiHXM7U6RkQtdkZAQdk9PjM3sEUdm4CEnIjfmzA
-p/R8TD0kxkNLIkhuFH2gd05y3ZHDS/XiFkAE9eOT0FrC7om6ESD7ZfFIWR18pncW
-ZGq7tFAZZRmpkum2D+MJy1gWxIXBxt5madTEpRxQd56toEnfx372F0y4zkcX3pnE
-4H6FaJUBjdvKl2QzF5c0jBqgxMRvWP5YfNu8+dmaQORPkpzSptOPmZM9VKV+tJVS
-1xnOI6DtrnNZRojegR/E6KhNyiPTYy97UgYzdKS+SSECgYEA+wgSIqrfkeqqotJx
-cGxF4x9v/ldKr5hlhJNoKXLkepkcrvhhxfHKgjWz1nZY/+Rpg42GFMvxWRrGTMIJ
-ddiOr24p0HCkusWRMKQL7XxvuHDq0ro8SGqXzqWGuH31R+YNP8dy2pqd3OlwzTgg
-8v0wwzx8AuyP5Ys4M20Ewv7Xuy0CgYEA9DSGMU8jmjxJ/uPDCXWOEAqtE78wTtIw
-uMBv+ge0inc37xf+fN6D/ziTrJvgw/XyT15pmQdOlXx3Sg1h9XBZeIlaeCdFWrFB
-oYrVsiuoXRswfkFwA0yOkCsHyGiI4TE0W1rGbqP158IjwXPczBswWI7i/D6LpINL
-BD7YYpfHmeMCgYB08AiKr7Cf54H/gSqo5TcVGzLvdzhqXgKEZKp0DHpUhfivpTLe
-o8jjKSMSN2U0JvHj/0xDadGO4YMYhJcll3C4VggSejaybpA46WJJCdt9PtSUv36P
-eWAoOkFstfhJuufXGxDstnPtUa1jW881gi5x9D4MmqhZlKXkhtdeApr6LQKBgQDd
-ItsJt9JTjpirGfC5lhwI5sIICa9jEO9RveEoluWkJYUfG6k1xgHdkYwYWCdXDFZa
-DPKuwnEk6MrU4f181joO7sJf35/sGmuGL0SHzQTvGvn0uqkGM8M9RdoMXqzkzzvM
-Jg1ej1bUgXcDbTnaEhzbdLiTFsg5NzMtKwOjdDIpZQKBgEIHeJIqiGjYgf7mUlX2
-vNWgFNlzApkFSCQ8TkzkDOjtCdSHfdRDJ6+q8cS2TSQ7QPoAlI1woS0G48TNbVSo
-wD0jNVRTdpA6R5FPsg09ohB/caSn0zlGVha2GS08ceYrn7nn4PSZ/UIYTm3pjUlV
-H5tvHv0gG2C5vy3tIYQtSQCk
+MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDvdzKDTYvRgjBO
+UOrzDwkAZGwNFHHlMYyMGI5tItj3tCzXkbpM0uz3ZjHVahu+eYc+KvYApM64F2dB
+b16hs713FCk8mihYABjnSndrQsl/U2v8YFT7DipfLReqqaOGu2o9HdvWfiUlaiC/
+UGGfR+YblpK7CG+7/hvTXtUsMw+OppoeH9z87rhOJMxtiC7XwU5rhEmab/1f1XM/
+nLoZrfDAcTbDywoeu826SJ3mifajq7oK3LDdNLjWZwfEsCO1qp2C4gLvBlOOKsWO
+LNby6ByxCOPlCTa0UCaVuoNclYol71jyi17KW+Nk0nNe9yaVcyr6H0z3bImfJhbS
+u4rzI93nAgMBAAECggEBAOIPOJRTpGaH7GpCYUpLK0g/hPFkF5EyEWg/1lSYzRIp
++RsX6zOS+zkiNHEv1jkeKNo7XDiHXM7U6RkQtdkZAQdk9PjM3sEUdm4CEnIjfmzA
+p/R8TD0kxkNLIkhuFH2gd05y3ZHDS/XiFkAE9eOT0FrC7om6ESD7ZfFIWR18pncW
+ZGq7tFAZZRmpkum2D+MJy1gWxIXBxt5madTEpRxQd56toEnfx372F0y4zkcX3pnE
+4H6FaJUBjdvKl2QzF5c0jBqgxMRvWP5YfNu8+dmaQORPkpzSptOPmZM9VKV+tJVS
+1xnOI6DtrnNZRojegR/E6KhNyiPTYy97UgYzdKS+SSECgYEA+wgSIqrfkeqqotJx
+cGxF4x9v/ldKr5hlhJNoKXLkepkcrvhhxfHKgjWz1nZY/+Rpg42GFMvxWRrGTMIJ
+ddiOr24p0HCkusWRMKQL7XxvuHDq0ro8SGqXzqWGuH31R+YNP8dy2pqd3OlwzTgg
+8v0wwzx8AuyP5Ys4M20Ewv7Xuy0CgYEA9DSGMU8jmjxJ/uPDCXWOEAqtE78wTtIw
+uMBv+ge0inc37xf+fN6D/ziTrJvgw/XyT15pmQdOlXx3Sg1h9XBZeIlaeCdFWrFB
+oYrVsiuoXRswfkFwA0yOkCsHyGiI4TE0W1rGbqP158IjwXPczBswWI7i/D6LpINL
+BD7YYpfHmeMCgYB08AiKr7Cf54H/gSqo5TcVGzLvdzhqXgKEZKp0DHpUhfivpTLe
+o8jjKSMSN2U0JvHj/0xDadGO4YMYhJcll3C4VggSejaybpA46WJJCdt9PtSUv36P
+eWAoOkFstfhJuufXGxDstnPtUa1jW881gi5x9D4MmqhZlKXkhtdeApr6LQKBgQDd
+ItsJt9JTjpirGfC5lhwI5sIICa9jEO9RveEoluWkJYUfG6k1xgHdkYwYWCdXDFZa
+DPKuwnEk6MrU4f181joO7sJf35/sGmuGL0SHzQTvGvn0uqkGM8M9RdoMXqzkzzvM
+Jg1ej1bUgXcDbTnaEhzbdLiTFsg5NzMtKwOjdDIpZQKBgEIHeJIqiGjYgf7mUlX2
+vNWgFNlzApkFSCQ8TkzkDOjtCdSHfdRDJ6+q8cS2TSQ7QPoAlI1woS0G48TNbVSo
+wD0jNVRTdpA6R5FPsg09ohB/caSn0zlGVha2GS08ceYrn7nn4PSZ/UIYTm3pjUlV
+H5tvHv0gG2C5vy3tIYQtSQCk
-----END PRIVATE KEY-----
diff --git a/contrib/libs/grpc/src/core/tsi/test_creds/badclient.pem b/contrib/libs/grpc/src/core/tsi/test_creds/badclient.pem
index 60b21b861c7..345da3932d9 100644
--- a/contrib/libs/grpc/src/core/tsi/test_creds/badclient.pem
+++ b/contrib/libs/grpc/src/core/tsi/test_creds/badclient.pem
@@ -1,22 +1,22 @@
-----BEGIN CERTIFICATE-----
-MIIDszCCApugAwIBAgIUONWbkUn1obHCw9L7lMNEE5REvb8wDQYJKoZIhvcNAQEL
-BQAwaTELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoM
-GEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDEiMCAGA1UEAwwZYmFkY2xpZW50LnRl
-c3QuZ29vZ2xlLmNvbTAeFw0yMDAzMTcxNzQzMjNaFw0zMDAzMTUxNzQzMjNaMGkx
-CzAJBgNVBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRl
-cm5ldCBXaWRnaXRzIFB0eSBMdGQxIjAgBgNVBAMMGWJhZGNsaWVudC50ZXN0Lmdv
-b2dsZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDvdzKDTYvR
-gjBOUOrzDwkAZGwNFHHlMYyMGI5tItj3tCzXkbpM0uz3ZjHVahu+eYc+KvYApM64
-F2dBb16hs713FCk8mihYABjnSndrQsl/U2v8YFT7DipfLReqqaOGu2o9HdvWfiUl
-aiC/UGGfR+YblpK7CG+7/hvTXtUsMw+OppoeH9z87rhOJMxtiC7XwU5rhEmab/1f
-1XM/nLoZrfDAcTbDywoeu826SJ3mifajq7oK3LDdNLjWZwfEsCO1qp2C4gLvBlOO
-KsWOLNby6ByxCOPlCTa0UCaVuoNclYol71jyi17KW+Nk0nNe9yaVcyr6H0z3bImf
-JhbSu4rzI93nAgMBAAGjUzBRMB0GA1UdDgQWBBTKJskEYd2ndrwihPTg2PzYF/kP
-gzAfBgNVHSMEGDAWgBTKJskEYd2ndrwihPTg2PzYF/kPgzAPBgNVHRMBAf8EBTAD
-AQH/MA0GCSqGSIb3DQEBCwUAA4IBAQBoGwWR0pLM1icX4bIJ6yduFU/A4jSiqET6
-gvJhwgErilqTKfH6Y89rqtzW8k4UurAOCsE4FA6wbkHWwrUMnClY4lkHJh+MuNaJ
-nCGrK8wRKGb/mqW9d5pP72Et1Q6OW6DAKqGfjDWh2MzSPHBxcCLeyigO1wqd4W1T
-nvvql6l4L+B5IT/c+/EHO3PwbI9v6MGTtLjsZgkRKItaPh+YeJdmBYhRD1BvWb6s
-VwEb7aQ1oSF+esUvMmjGVuHXuQvWJahnjYdYT2DikyqR+AwaKzre4GJMHsX3/Cf8
-qdxyI+B1jUwNr7sLA2EYDjnUR0jEHcrOBSpIQyRMGWduj0P16yb9
+MIIDszCCApugAwIBAgIUONWbkUn1obHCw9L7lMNEE5REvb8wDQYJKoZIhvcNAQEL
+BQAwaTELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoM
+GEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDEiMCAGA1UEAwwZYmFkY2xpZW50LnRl
+c3QuZ29vZ2xlLmNvbTAeFw0yMDAzMTcxNzQzMjNaFw0zMDAzMTUxNzQzMjNaMGkx
+CzAJBgNVBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRl
+cm5ldCBXaWRnaXRzIFB0eSBMdGQxIjAgBgNVBAMMGWJhZGNsaWVudC50ZXN0Lmdv
+b2dsZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDvdzKDTYvR
+gjBOUOrzDwkAZGwNFHHlMYyMGI5tItj3tCzXkbpM0uz3ZjHVahu+eYc+KvYApM64
+F2dBb16hs713FCk8mihYABjnSndrQsl/U2v8YFT7DipfLReqqaOGu2o9HdvWfiUl
+aiC/UGGfR+YblpK7CG+7/hvTXtUsMw+OppoeH9z87rhOJMxtiC7XwU5rhEmab/1f
+1XM/nLoZrfDAcTbDywoeu826SJ3mifajq7oK3LDdNLjWZwfEsCO1qp2C4gLvBlOO
+KsWOLNby6ByxCOPlCTa0UCaVuoNclYol71jyi17KW+Nk0nNe9yaVcyr6H0z3bImf
+JhbSu4rzI93nAgMBAAGjUzBRMB0GA1UdDgQWBBTKJskEYd2ndrwihPTg2PzYF/kP
+gzAfBgNVHSMEGDAWgBTKJskEYd2ndrwihPTg2PzYF/kPgzAPBgNVHRMBAf8EBTAD
+AQH/MA0GCSqGSIb3DQEBCwUAA4IBAQBoGwWR0pLM1icX4bIJ6yduFU/A4jSiqET6
+gvJhwgErilqTKfH6Y89rqtzW8k4UurAOCsE4FA6wbkHWwrUMnClY4lkHJh+MuNaJ
+nCGrK8wRKGb/mqW9d5pP72Et1Q6OW6DAKqGfjDWh2MzSPHBxcCLeyigO1wqd4W1T
+nvvql6l4L+B5IT/c+/EHO3PwbI9v6MGTtLjsZgkRKItaPh+YeJdmBYhRD1BvWb6s
+VwEb7aQ1oSF+esUvMmjGVuHXuQvWJahnjYdYT2DikyqR+AwaKzre4GJMHsX3/Cf8
+qdxyI+B1jUwNr7sLA2EYDjnUR0jEHcrOBSpIQyRMGWduj0P16yb9
-----END CERTIFICATE-----
diff --git a/contrib/libs/grpc/src/core/tsi/test_creds/badserver.key b/contrib/libs/grpc/src/core/tsi/test_creds/badserver.key
index 91d67ea14cc..1f5a31666cb 100644
--- a/contrib/libs/grpc/src/core/tsi/test_creds/badserver.key
+++ b/contrib/libs/grpc/src/core/tsi/test_creds/badserver.key
@@ -1,28 +1,28 @@
-----BEGIN PRIVATE KEY-----
-MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDRY2Z886nT6KF4
-tjgJTX0l1M4j8bQp+jKfXz+hwUZbn/PnCXJlu/5denpyu4XrLxr6Ix4Il97SrKfQ
-iGaSZQ8hcq6WQdEDfuo/U7R/dk6lYG7q+yg7+xHm02DzVdPLp09kLhU+fWH3Wek0
-9GCk9iC1/sVTIomBYpar61Ris04iA1QveR+LZKNkQ8rL2i191Djs8cdrn9yhWdfJ
-Ai89lLl6S6d8cXru1LwtEe0ejctnKf6ANqMnmyWTbHV8h0Cc3fbAnx92HsWDMJKe
-8mI0CClauxrlagMHyw10NuFb9/MBEkFPJfxcUyW6F45LmqGHVfcxx6/BU7XRbWx8
-aQM/pt2LAgMBAAECggEBAKWpei3D7op9FDvYF0+s4iXrT0j682r+y8xx5HtK2iql
-y6fwPnUlHqPAwl5B5TtkonhjDmEIH0AZYBBJyrVqhWUWQfEZk4+rexOtWzI5XRHU
-0QzSt0t1Yf15IcyEDDSlY9fD6gTt2HOFzE+cRVZecRTsxBv5SEd4w/KzFqmcaWXY
-Q7mLvCs6eQ55LBQ6EMweZ3XE57qPf71oV8Ckxv/jstLlkE+3JICgEAaiOEzi7oCm
-hYbkoU2VNewx5EA5ka52DQzbVYYYuDbjqtVPXCmlVdejBBmUCAlhdjAIDBYq/RMf
-sVMagAo19Wt5lYuNGD9qzMUmzZPaVmkg4yUmU8EYFVkCgYEA8Tyup/0yx+/tp8KQ
-cLyGc4RDUTfabL8mlvxcbEge9fQ12aHE3cA/hkHCI7AZxwrHYwb1hxzLaOmKYfFC
-oLxfzx81p5BO0lQWcKiFZ6ISiku4TPdmBaauKKxd62kFUPO4Q6Zk1MFHMXrvZUxZ
-BsK058HZ5JALDdQ5wBfJE5P58rcCgYEA3jPDMiXsH1s5gM/bh0s+cC1AFSst6YM3
-rRPmHrqJJhKgU6gSB0d0LCUdj4/NkQT/Bw8DrfxLIqytsfRLKCx85K6lk8GfCk6T
-1OhPKRp8bgg6WDQiJfJMokJN5zrnC02ns1cVdQSPY8bFxB++tv3du6DKLYx0e46D
-Q9ojYqWHh80CgYEA0Shh7nkTrFKUZZ3GClkK4eFNVH/uu9bIKKTJpYCqh2mjvvwJ
-apKjAU7GepbW4sKvuWZxPyJyIpZKSz0ZHa/2CejvZkcycB5EDo2ujPnyxUF9nA3s
-wP2RhuZb0B4QY+3MV6tPRUAG8Bm8ssGNdtUecMqclxVk4Cqfn7N/vZ/RWOUCgYAL
-i2rv1xKOioHRVHtWay1iTKeQsf6frEafQnJpVE294afc0NWm9SpvBLqlc9Y9W6IY
-bspFJt+MfKZFoaip/K28f+pwY9XshiqeHDfIreybFuhZHtRLXmxm3cUIZ4ILj0xQ
-QA0IWGVOzMwHpZKWFViI4BDBDxQaO0xMoS/Hd0w0XQKBgF5uZXXrNLmCeU6oco1R
-gjGJE4gRwaSVcVJbs/VLbBmHT1VhBGsiluBuTpbmzDfyHWHJprnthlSTgqHXSax1
-6GvHZ2NHBqmD2uxEGuwBffzhwWVxHpgSrRgvnnaeIph2Iv92/ATN5LCc5vF+SNGx
-2kKWYTDSRu9q1xHpXcax+nmJ
+MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDRY2Z886nT6KF4
+tjgJTX0l1M4j8bQp+jKfXz+hwUZbn/PnCXJlu/5denpyu4XrLxr6Ix4Il97SrKfQ
+iGaSZQ8hcq6WQdEDfuo/U7R/dk6lYG7q+yg7+xHm02DzVdPLp09kLhU+fWH3Wek0
+9GCk9iC1/sVTIomBYpar61Ris04iA1QveR+LZKNkQ8rL2i191Djs8cdrn9yhWdfJ
+Ai89lLl6S6d8cXru1LwtEe0ejctnKf6ANqMnmyWTbHV8h0Cc3fbAnx92HsWDMJKe
+8mI0CClauxrlagMHyw10NuFb9/MBEkFPJfxcUyW6F45LmqGHVfcxx6/BU7XRbWx8
+aQM/pt2LAgMBAAECggEBAKWpei3D7op9FDvYF0+s4iXrT0j682r+y8xx5HtK2iql
+y6fwPnUlHqPAwl5B5TtkonhjDmEIH0AZYBBJyrVqhWUWQfEZk4+rexOtWzI5XRHU
+0QzSt0t1Yf15IcyEDDSlY9fD6gTt2HOFzE+cRVZecRTsxBv5SEd4w/KzFqmcaWXY
+Q7mLvCs6eQ55LBQ6EMweZ3XE57qPf71oV8Ckxv/jstLlkE+3JICgEAaiOEzi7oCm
+hYbkoU2VNewx5EA5ka52DQzbVYYYuDbjqtVPXCmlVdejBBmUCAlhdjAIDBYq/RMf
+sVMagAo19Wt5lYuNGD9qzMUmzZPaVmkg4yUmU8EYFVkCgYEA8Tyup/0yx+/tp8KQ
+cLyGc4RDUTfabL8mlvxcbEge9fQ12aHE3cA/hkHCI7AZxwrHYwb1hxzLaOmKYfFC
+oLxfzx81p5BO0lQWcKiFZ6ISiku4TPdmBaauKKxd62kFUPO4Q6Zk1MFHMXrvZUxZ
+BsK058HZ5JALDdQ5wBfJE5P58rcCgYEA3jPDMiXsH1s5gM/bh0s+cC1AFSst6YM3
+rRPmHrqJJhKgU6gSB0d0LCUdj4/NkQT/Bw8DrfxLIqytsfRLKCx85K6lk8GfCk6T
+1OhPKRp8bgg6WDQiJfJMokJN5zrnC02ns1cVdQSPY8bFxB++tv3du6DKLYx0e46D
+Q9ojYqWHh80CgYEA0Shh7nkTrFKUZZ3GClkK4eFNVH/uu9bIKKTJpYCqh2mjvvwJ
+apKjAU7GepbW4sKvuWZxPyJyIpZKSz0ZHa/2CejvZkcycB5EDo2ujPnyxUF9nA3s
+wP2RhuZb0B4QY+3MV6tPRUAG8Bm8ssGNdtUecMqclxVk4Cqfn7N/vZ/RWOUCgYAL
+i2rv1xKOioHRVHtWay1iTKeQsf6frEafQnJpVE294afc0NWm9SpvBLqlc9Y9W6IY
+bspFJt+MfKZFoaip/K28f+pwY9XshiqeHDfIreybFuhZHtRLXmxm3cUIZ4ILj0xQ
+QA0IWGVOzMwHpZKWFViI4BDBDxQaO0xMoS/Hd0w0XQKBgF5uZXXrNLmCeU6oco1R
+gjGJE4gRwaSVcVJbs/VLbBmHT1VhBGsiluBuTpbmzDfyHWHJprnthlSTgqHXSax1
+6GvHZ2NHBqmD2uxEGuwBffzhwWVxHpgSrRgvnnaeIph2Iv92/ATN5LCc5vF+SNGx
+2kKWYTDSRu9q1xHpXcax+nmJ
-----END PRIVATE KEY-----
diff --git a/contrib/libs/grpc/src/core/tsi/test_creds/badserver.pem b/contrib/libs/grpc/src/core/tsi/test_creds/badserver.pem
index c84478fc758..217dd640eba 100644
--- a/contrib/libs/grpc/src/core/tsi/test_creds/badserver.pem
+++ b/contrib/libs/grpc/src/core/tsi/test_creds/badserver.pem
@@ -1,22 +1,22 @@
-----BEGIN CERTIFICATE-----
-MIIDszCCApugAwIBAgIULEum14ranwlUZjuZchSWaHtj8Z4wDQYJKoZIhvcNAQEL
-BQAwaTELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoM
-GEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDEiMCAGA1UEAwwZYmFkc2VydmVyLnRl
-c3QuZ29vZ2xlLmNvbTAeFw0yMDAzMTcxNzE5NTRaFw0zMDAzMTUxNzE5NTRaMGkx
-CzAJBgNVBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRl
-cm5ldCBXaWRnaXRzIFB0eSBMdGQxIjAgBgNVBAMMGWJhZHNlcnZlci50ZXN0Lmdv
-b2dsZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDRY2Z886nT
-6KF4tjgJTX0l1M4j8bQp+jKfXz+hwUZbn/PnCXJlu/5denpyu4XrLxr6Ix4Il97S
-rKfQiGaSZQ8hcq6WQdEDfuo/U7R/dk6lYG7q+yg7+xHm02DzVdPLp09kLhU+fWH3
-Wek09GCk9iC1/sVTIomBYpar61Ris04iA1QveR+LZKNkQ8rL2i191Djs8cdrn9yh
-WdfJAi89lLl6S6d8cXru1LwtEe0ejctnKf6ANqMnmyWTbHV8h0Cc3fbAnx92HsWD
-MJKe8mI0CClauxrlagMHyw10NuFb9/MBEkFPJfxcUyW6F45LmqGHVfcxx6/BU7XR
-bWx8aQM/pt2LAgMBAAGjUzBRMB0GA1UdDgQWBBTYP9Av5QoPxsDRE33wQedENOke
-wDAfBgNVHSMEGDAWgBTYP9Av5QoPxsDRE33wQedENOkewDAPBgNVHRMBAf8EBTAD
-AQH/MA0GCSqGSIb3DQEBCwUAA4IBAQCXA/Ewb5laDDxJi4YJxnmqQsb4WSsm65Hj
-MX21Ii2vzf4XZ+i8c9xBezCae85Bkhtb/oMC/V15DshjVkkJNmdQfAlYD1NASSrN
-hTaiQ4AfXWjO7H8o2B/rneZtA21NDCwvFxTXeJzAVnBkpIePR//KmuHjtCMjsrtP
-ovckcTRGmhWJJ9sRx4HCsJXygBvnCIIIYC585aU4+nE53UDNT2T+Bd4b1vPmwf9R
-9XgbyN6AhQ+0F11zlnftwsJ23nbnXqX/fpG/YZuhnPwaUILRodc6HZQtf/8xpRcA
-0dKMdnL2YtBjuL5QFJMLT0mdsmnXj3h/oK8894nYBZYSmlb3bzZK
+MIIDszCCApugAwIBAgIULEum14ranwlUZjuZchSWaHtj8Z4wDQYJKoZIhvcNAQEL
+BQAwaTELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoM
+GEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDEiMCAGA1UEAwwZYmFkc2VydmVyLnRl
+c3QuZ29vZ2xlLmNvbTAeFw0yMDAzMTcxNzE5NTRaFw0zMDAzMTUxNzE5NTRaMGkx
+CzAJBgNVBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRl
+cm5ldCBXaWRnaXRzIFB0eSBMdGQxIjAgBgNVBAMMGWJhZHNlcnZlci50ZXN0Lmdv
+b2dsZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDRY2Z886nT
+6KF4tjgJTX0l1M4j8bQp+jKfXz+hwUZbn/PnCXJlu/5denpyu4XrLxr6Ix4Il97S
+rKfQiGaSZQ8hcq6WQdEDfuo/U7R/dk6lYG7q+yg7+xHm02DzVdPLp09kLhU+fWH3
+Wek09GCk9iC1/sVTIomBYpar61Ris04iA1QveR+LZKNkQ8rL2i191Djs8cdrn9yh
+WdfJAi89lLl6S6d8cXru1LwtEe0ejctnKf6ANqMnmyWTbHV8h0Cc3fbAnx92HsWD
+MJKe8mI0CClauxrlagMHyw10NuFb9/MBEkFPJfxcUyW6F45LmqGHVfcxx6/BU7XR
+bWx8aQM/pt2LAgMBAAGjUzBRMB0GA1UdDgQWBBTYP9Av5QoPxsDRE33wQedENOke
+wDAfBgNVHSMEGDAWgBTYP9Av5QoPxsDRE33wQedENOkewDAPBgNVHRMBAf8EBTAD
+AQH/MA0GCSqGSIb3DQEBCwUAA4IBAQCXA/Ewb5laDDxJi4YJxnmqQsb4WSsm65Hj
+MX21Ii2vzf4XZ+i8c9xBezCae85Bkhtb/oMC/V15DshjVkkJNmdQfAlYD1NASSrN
+hTaiQ4AfXWjO7H8o2B/rneZtA21NDCwvFxTXeJzAVnBkpIePR//KmuHjtCMjsrtP
+ovckcTRGmhWJJ9sRx4HCsJXygBvnCIIIYC585aU4+nE53UDNT2T+Bd4b1vPmwf9R
+9XgbyN6AhQ+0F11zlnftwsJ23nbnXqX/fpG/YZuhnPwaUILRodc6HZQtf/8xpRcA
+0dKMdnL2YtBjuL5QFJMLT0mdsmnXj3h/oK8894nYBZYSmlb3bzZK
-----END CERTIFICATE-----
diff --git a/contrib/libs/grpc/src/core/tsi/test_creds/ca.key b/contrib/libs/grpc/src/core/tsi/test_creds/ca.key
index 8329d0ea097..03be0bfa6ee 100644
--- a/contrib/libs/grpc/src/core/tsi/test_creds/ca.key
+++ b/contrib/libs/grpc/src/core/tsi/test_creds/ca.key
@@ -1,28 +1,28 @@
-----BEGIN PRIVATE KEY-----
-MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCwYvShd+UXQvOg
-z4GH6pRT3KGrPDbDw45fma7+I0LJQ4GupoeLuYYfHvcYPTV2I3MLO+VxCp00gfo1
-BIvsNOkGNxrrqNhP27ve9l7YwOuvWdVu4u9+73znRx3GJQ4ie/nF/z6xMcbQL5r5
-UC8yGwuJGOyr6VcpEnKTnORtuwRPJuqnGgn4rsKhLLfJz+RAhjdOKnAS3CQo/iHP
-KjoqIZ38M97GJ7icFQic3dtLUFR41nnN5ogLZ6DduR55btypPnlv5h6foLFjRMST
-MEroAq39ZSJqUoyBPTBtPFFk7uRQIfdKrp7/Bd4V0n4e91Us+UCDlOcxo2lF1CKH
-/ydEWmx3AgMBAAECggEAKrDosKQKKKUlvkg6+6CFIf8GiiFax+ru7KiPuCbkpT3X
-h2P67pCKq8Gc4Jr/84YE9DUdBU0iW3ESE/7ztsnflIeF1n/ZSwrN39sVfbTD1n8R
-r3LxsHFac8e8pxaU4zfKbmemztBTZFQBWFJV+fSdyCLmNX2WgPRcEuooR366PkWv
-xZLAxeDGqpnsa62o1GdGmalxx8aljLN/QcbQi73mR9Osim1OtSd1cyDlZ/8x6OoV
-Ae5GDN3Bj0hO9ZKzNWTbQpRw9SHKU6sWXtHlcDx4xi5kN/n9aptn7kixbY9y8uOM
-5zjErVGWvxdP94IvlSkrkenwnIjlHBtdlAjVuCFioQKBgQDoJLyfHNWPBnjPGVnK
-xcbIIwmf4C9UnZBbHRD3YxU/GBpsPgPh9EwhQTAXlGQGHeuslxCIh4cEfbOIrJ9b
-/s3OqeL9CSUaz/N+1av1ZuwOI9CEvNPi51IK+rXNRmVJG8pG6RaKNx57pXaFtmqq
-FUtC7twbPECvjspapn61nZYSiQKBgQDCg1tpGwZJJOCIkhYH4wFc4j4p0LxIcBJ2
-E3L9VnQ+APT/x8uitkZsuRY9tmWcHK8/zWTc1GpFdwGUJ9+Yzvprtej+P/buxM9J
-Y6ZJZdCIHWDuh3eq+sXS4lwr5fi7ir5m97npG1bXPlOoYIJ7p172EyoNmurRIgiP
-LWnzK0jG/wKBgQCRQtOouNFFcyZLaTCPutxdRddy7ESRrRq0eOax9pVH6tw12URy
-snyk3naqepdwYG6li82zsSKig8nA/0uktDeyVwoLjhpiwbc7KZc1sxaI7o4/US1B
-McBb0G/MqH0elz4myxnomP8BHhOhLflmvnZexrqCbFyJvk8PFFn7aUWMCQKBgDvX
-9BCzOszYJqh94X9NrQapqJxu1u6mZFelhjRBHARTgQ0MqC8IS0R58UjNTBeqj5Re
-mdCDHar/gSHW3qkBzPPEhMlsXol5TZjzqp5cT7sA5uicDwowmxpVgCwVVeBFQG0n
-fDAmtCIGz/A2uQ5YIRQuMzr6VZJAGUgLndQtlfd7AoGBAMq1imggFKd1rt49XCnO
-t97lpWOT+TlWYblHr01tOw+esawG5MFucqVI6tGpBSccTRQw6orWf4GK3KmkgQ6J
-UgHKjwYsA0sf4U5vppkdkbAbM/WwUPOTQpGFRERyJqMqFGIc4wMtZOJBxXwf+9iD
-l8tvan8w/6HugqnI7qqkTgLq
+MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCwYvShd+UXQvOg
+z4GH6pRT3KGrPDbDw45fma7+I0LJQ4GupoeLuYYfHvcYPTV2I3MLO+VxCp00gfo1
+BIvsNOkGNxrrqNhP27ve9l7YwOuvWdVu4u9+73znRx3GJQ4ie/nF/z6xMcbQL5r5
+UC8yGwuJGOyr6VcpEnKTnORtuwRPJuqnGgn4rsKhLLfJz+RAhjdOKnAS3CQo/iHP
+KjoqIZ38M97GJ7icFQic3dtLUFR41nnN5ogLZ6DduR55btypPnlv5h6foLFjRMST
+MEroAq39ZSJqUoyBPTBtPFFk7uRQIfdKrp7/Bd4V0n4e91Us+UCDlOcxo2lF1CKH
+/ydEWmx3AgMBAAECggEAKrDosKQKKKUlvkg6+6CFIf8GiiFax+ru7KiPuCbkpT3X
+h2P67pCKq8Gc4Jr/84YE9DUdBU0iW3ESE/7ztsnflIeF1n/ZSwrN39sVfbTD1n8R
+r3LxsHFac8e8pxaU4zfKbmemztBTZFQBWFJV+fSdyCLmNX2WgPRcEuooR366PkWv
+xZLAxeDGqpnsa62o1GdGmalxx8aljLN/QcbQi73mR9Osim1OtSd1cyDlZ/8x6OoV
+Ae5GDN3Bj0hO9ZKzNWTbQpRw9SHKU6sWXtHlcDx4xi5kN/n9aptn7kixbY9y8uOM
+5zjErVGWvxdP94IvlSkrkenwnIjlHBtdlAjVuCFioQKBgQDoJLyfHNWPBnjPGVnK
+xcbIIwmf4C9UnZBbHRD3YxU/GBpsPgPh9EwhQTAXlGQGHeuslxCIh4cEfbOIrJ9b
+/s3OqeL9CSUaz/N+1av1ZuwOI9CEvNPi51IK+rXNRmVJG8pG6RaKNx57pXaFtmqq
+FUtC7twbPECvjspapn61nZYSiQKBgQDCg1tpGwZJJOCIkhYH4wFc4j4p0LxIcBJ2
+E3L9VnQ+APT/x8uitkZsuRY9tmWcHK8/zWTc1GpFdwGUJ9+Yzvprtej+P/buxM9J
+Y6ZJZdCIHWDuh3eq+sXS4lwr5fi7ir5m97npG1bXPlOoYIJ7p172EyoNmurRIgiP
+LWnzK0jG/wKBgQCRQtOouNFFcyZLaTCPutxdRddy7ESRrRq0eOax9pVH6tw12URy
+snyk3naqepdwYG6li82zsSKig8nA/0uktDeyVwoLjhpiwbc7KZc1sxaI7o4/US1B
+McBb0G/MqH0elz4myxnomP8BHhOhLflmvnZexrqCbFyJvk8PFFn7aUWMCQKBgDvX
+9BCzOszYJqh94X9NrQapqJxu1u6mZFelhjRBHARTgQ0MqC8IS0R58UjNTBeqj5Re
+mdCDHar/gSHW3qkBzPPEhMlsXol5TZjzqp5cT7sA5uicDwowmxpVgCwVVeBFQG0n
+fDAmtCIGz/A2uQ5YIRQuMzr6VZJAGUgLndQtlfd7AoGBAMq1imggFKd1rt49XCnO
+t97lpWOT+TlWYblHr01tOw+esawG5MFucqVI6tGpBSccTRQw6orWf4GK3KmkgQ6J
+UgHKjwYsA0sf4U5vppkdkbAbM/WwUPOTQpGFRERyJqMqFGIc4wMtZOJBxXwf+9iD
+l8tvan8w/6HugqnI7qqkTgLq
-----END PRIVATE KEY-----
diff --git a/contrib/libs/grpc/src/core/tsi/test_creds/ca.pem b/contrib/libs/grpc/src/core/tsi/test_creds/ca.pem
index ac1808a56d1..49d39cd8ed5 100644
--- a/contrib/libs/grpc/src/core/tsi/test_creds/ca.pem
+++ b/contrib/libs/grpc/src/core/tsi/test_creds/ca.pem
@@ -1,20 +1,20 @@
-----BEGIN CERTIFICATE-----
-MIIDWjCCAkKgAwIBAgIUWrP0VvHcy+LP6UuYNtiL9gBhD5owDQYJKoZIhvcNAQEL
-BQAwVjELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoM
-GEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDEPMA0GA1UEAwwGdGVzdGNhMB4XDTIw
-MDMxNzE4NTk1MVoXDTMwMDMxNTE4NTk1MVowVjELMAkGA1UEBhMCQVUxEzARBgNV
-BAgMClNvbWUtU3RhdGUxITAfBgNVBAoMGEludGVybmV0IFdpZGdpdHMgUHR5IEx0
-ZDEPMA0GA1UEAwwGdGVzdGNhMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC
-AQEAsGL0oXflF0LzoM+Bh+qUU9yhqzw2w8OOX5mu/iNCyUOBrqaHi7mGHx73GD01
-diNzCzvlcQqdNIH6NQSL7DTpBjca66jYT9u73vZe2MDrr1nVbuLvfu9850cdxiUO
-Inv5xf8+sTHG0C+a+VAvMhsLiRjsq+lXKRJyk5zkbbsETybqpxoJ+K7CoSy3yc/k
-QIY3TipwEtwkKP4hzyo6KiGd/DPexie4nBUInN3bS1BUeNZ5zeaIC2eg3bkeeW7c
-qT55b+Yen6CxY0TEkzBK6AKt/WUialKMgT0wbTxRZO7kUCH3Sq6e/wXeFdJ+HvdV
-LPlAg5TnMaNpRdQih/8nRFpsdwIDAQABoyAwHjAMBgNVHRMEBTADAQH/MA4GA1Ud
-DwEB/wQEAwICBDANBgkqhkiG9w0BAQsFAAOCAQEAkTrKZjBrJXHps/HrjNCFPb5a
-THuGPCSsepe1wkKdSp1h4HGRpLoCgcLysCJ5hZhRpHkRihhef+rFHEe60UePQO3S
-CVTtdJB4CYWpcNyXOdqefrbJW5QNljxgi6Fhvs7JJkBqdXIkWXtFk2eRgOIP2Eo9
-/OHQHlYnwZFrk6sp4wPyR+A95S0toZBcyDVz7u+hOW0pGK3wviOe9lvRgj/H3Pwt
-bewb0l+MhRig0/DVHamyVxrDRbqInU1/GTNCwcZkXKYFWSf92U+kIcTth24Q1gcw
-eZiLl5FfrWokUNytFElXob0V0a5/kbhiLc3yWmvWqHTpqCALbVyF+rKJo2f5Kw==
+MIIDWjCCAkKgAwIBAgIUWrP0VvHcy+LP6UuYNtiL9gBhD5owDQYJKoZIhvcNAQEL
+BQAwVjELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoM
+GEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDEPMA0GA1UEAwwGdGVzdGNhMB4XDTIw
+MDMxNzE4NTk1MVoXDTMwMDMxNTE4NTk1MVowVjELMAkGA1UEBhMCQVUxEzARBgNV
+BAgMClNvbWUtU3RhdGUxITAfBgNVBAoMGEludGVybmV0IFdpZGdpdHMgUHR5IEx0
+ZDEPMA0GA1UEAwwGdGVzdGNhMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC
+AQEAsGL0oXflF0LzoM+Bh+qUU9yhqzw2w8OOX5mu/iNCyUOBrqaHi7mGHx73GD01
+diNzCzvlcQqdNIH6NQSL7DTpBjca66jYT9u73vZe2MDrr1nVbuLvfu9850cdxiUO
+Inv5xf8+sTHG0C+a+VAvMhsLiRjsq+lXKRJyk5zkbbsETybqpxoJ+K7CoSy3yc/k
+QIY3TipwEtwkKP4hzyo6KiGd/DPexie4nBUInN3bS1BUeNZ5zeaIC2eg3bkeeW7c
+qT55b+Yen6CxY0TEkzBK6AKt/WUialKMgT0wbTxRZO7kUCH3Sq6e/wXeFdJ+HvdV
+LPlAg5TnMaNpRdQih/8nRFpsdwIDAQABoyAwHjAMBgNVHRMEBTADAQH/MA4GA1Ud
+DwEB/wQEAwICBDANBgkqhkiG9w0BAQsFAAOCAQEAkTrKZjBrJXHps/HrjNCFPb5a
+THuGPCSsepe1wkKdSp1h4HGRpLoCgcLysCJ5hZhRpHkRihhef+rFHEe60UePQO3S
+CVTtdJB4CYWpcNyXOdqefrbJW5QNljxgi6Fhvs7JJkBqdXIkWXtFk2eRgOIP2Eo9
+/OHQHlYnwZFrk6sp4wPyR+A95S0toZBcyDVz7u+hOW0pGK3wviOe9lvRgj/H3Pwt
+bewb0l+MhRig0/DVHamyVxrDRbqInU1/GTNCwcZkXKYFWSf92U+kIcTth24Q1gcw
+eZiLl5FfrWokUNytFElXob0V0a5/kbhiLc3yWmvWqHTpqCALbVyF+rKJo2f5Kw==
-----END CERTIFICATE-----
diff --git a/contrib/libs/grpc/src/core/tsi/test_creds/client.key b/contrib/libs/grpc/src/core/tsi/test_creds/client.key
index 44600a1641e..349b40033dd 100644
--- a/contrib/libs/grpc/src/core/tsi/test_creds/client.key
+++ b/contrib/libs/grpc/src/core/tsi/test_creds/client.key
@@ -1,28 +1,28 @@
-----BEGIN PRIVATE KEY-----
-MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCyqYRp+DXVp72N
-FbQH8hdhTZLycZXOlJhmMsrJmrjn2p7pI/8mTZ/0FC+SGWBGZV+ELiHrmCX5zfaI
-Lr9Iuw7Ghr3Vzoefi8r62rLupVPNi/qdqyjWk2dECHC9Z3+Ag3KzKTyerXWjKcvy
-KVmM0ZxE0RXhDW/RoQbqZsU2GKg1B2rhUU8KN0gVmKn0rJHOxzRVSYeYLYp5Yn7K
-rtPJcKyo9aVuEr7dGANzpyF6lg/nYBWc+9SGwkoLdFvKvABYJMyrbNhHUQfv0fza
-Z0P86dfTENrDxzALrzGnqcx3KTrwJjkZ/aSr1tyD0/tXvukRFiPxWBJhjHQ70GqT
-FQY19RbhAgMBAAECggEAIL8JUhL4awyvpWhQ8xPgTSlWwbEn8BE0TacJnCILuhNM
-BRdf8LlRk/8PKQwVpVF3TFbYSMI+U6b4hMVssfv3HVQc/083dHq+3XOwUCVlUstR
-SAzTE2E5EDMr1stdh0SQhV4Nilfos9s5Uk1Z6IGSztoz1GgOErIc/mGPy/aA/hbr
-fRWHvTp35+MbCJSvZuOeevX2iLs0dNzqdk6DiOWIH/BVGirVPtO6ykrkuTj1FWiN
-hyZ3MBChShlNH2poNX46ntOc7nEus0qteOgxBK8lummFEtlehCA7hd/8xuvYlP0k
-7aN684LCRDajmAGpoZO57NSDYQhAFGZeUZ93SMFucQKBgQDe7GGkzZFEiv91u1q9
-lgMy1h5dZjIZKgQaOarPC6wCQMUdqCf6cSLsAPr4T8EDoWsnY7dSnrTZ6YCIFL1T
-idg8M3BQXipICCJkFORS76pKKZ0wMn3/NgkSepsmNct91WHr6okvx4tOaoRCtdzU
-g7jt4Mr3sfLCiZtqTQyySdMUEwKBgQDNK+ZFKL0XhkWZP+PGKjWG8LWpPiK3d78/
-wYBFXzSTGlkr6FvRmYtZeNwXWRYLB4UxZ9At4hbJVEdi/2dITOz/sehVDyCAjjs3
-gycsc3UJqiZbcw5XKhI5TWBuWxkKENdbMSayogVbp2aSYoRblH764//t0ACmbfTW
-KUQRQPB/uwKBgQC5QjjjfPL8w4cJkGoYpFKELO2PMR7xSrmeEc6hwlFwjeNCgjy3
-JM6g0y++rIj7O2qRkY0IXFxvvF3UuWedxTCu1xC/uYHp2ti506LsScB7YZoAM/YB
-4iYn9Tx6xLoYGP0H0iGwU2SyBlNkHT8oXU+SYP5MWtYkVbeS3/VtNWz1gQKBgQCA
-6Nk4kN0mH7YxEKRzSOfyzeDF4oV7kuB2FYUbkTL+TirC3K58JiYY5Egc31trOKFm
-Jlz1xz0b6DkmKWTiV3r9OPHKJ8P7IeJxAZWmZzCdDuwkv0i+WW+z0zsIe3JjEavN
-3zb6O7R0HtziksWoqMeTqZeO+wa9iw6vVKQw1wWEqwKBgFHfahFs0DZ5cUTpGpBt
-F/AQG7ukgipB6N6AkB9kDbgCs1FLgd199MQrEncug5hfpq8QerbyMatmA+GXoGMb
-7vztKEH85yzp4n02FNL6H7xL4VVILvyZHdolmiORJ4qT2hZnl8pEQ2TYuF4RlHUd
-nSwXX+2o0J/nF85fm4AwWKAc
+MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCyqYRp+DXVp72N
+FbQH8hdhTZLycZXOlJhmMsrJmrjn2p7pI/8mTZ/0FC+SGWBGZV+ELiHrmCX5zfaI
+Lr9Iuw7Ghr3Vzoefi8r62rLupVPNi/qdqyjWk2dECHC9Z3+Ag3KzKTyerXWjKcvy
+KVmM0ZxE0RXhDW/RoQbqZsU2GKg1B2rhUU8KN0gVmKn0rJHOxzRVSYeYLYp5Yn7K
+rtPJcKyo9aVuEr7dGANzpyF6lg/nYBWc+9SGwkoLdFvKvABYJMyrbNhHUQfv0fza
+Z0P86dfTENrDxzALrzGnqcx3KTrwJjkZ/aSr1tyD0/tXvukRFiPxWBJhjHQ70GqT
+FQY19RbhAgMBAAECggEAIL8JUhL4awyvpWhQ8xPgTSlWwbEn8BE0TacJnCILuhNM
+BRdf8LlRk/8PKQwVpVF3TFbYSMI+U6b4hMVssfv3HVQc/083dHq+3XOwUCVlUstR
+SAzTE2E5EDMr1stdh0SQhV4Nilfos9s5Uk1Z6IGSztoz1GgOErIc/mGPy/aA/hbr
+fRWHvTp35+MbCJSvZuOeevX2iLs0dNzqdk6DiOWIH/BVGirVPtO6ykrkuTj1FWiN
+hyZ3MBChShlNH2poNX46ntOc7nEus0qteOgxBK8lummFEtlehCA7hd/8xuvYlP0k
+7aN684LCRDajmAGpoZO57NSDYQhAFGZeUZ93SMFucQKBgQDe7GGkzZFEiv91u1q9
+lgMy1h5dZjIZKgQaOarPC6wCQMUdqCf6cSLsAPr4T8EDoWsnY7dSnrTZ6YCIFL1T
+idg8M3BQXipICCJkFORS76pKKZ0wMn3/NgkSepsmNct91WHr6okvx4tOaoRCtdzU
+g7jt4Mr3sfLCiZtqTQyySdMUEwKBgQDNK+ZFKL0XhkWZP+PGKjWG8LWpPiK3d78/
+wYBFXzSTGlkr6FvRmYtZeNwXWRYLB4UxZ9At4hbJVEdi/2dITOz/sehVDyCAjjs3
+gycsc3UJqiZbcw5XKhI5TWBuWxkKENdbMSayogVbp2aSYoRblH764//t0ACmbfTW
+KUQRQPB/uwKBgQC5QjjjfPL8w4cJkGoYpFKELO2PMR7xSrmeEc6hwlFwjeNCgjy3
+JM6g0y++rIj7O2qRkY0IXFxvvF3UuWedxTCu1xC/uYHp2ti506LsScB7YZoAM/YB
+4iYn9Tx6xLoYGP0H0iGwU2SyBlNkHT8oXU+SYP5MWtYkVbeS3/VtNWz1gQKBgQCA
+6Nk4kN0mH7YxEKRzSOfyzeDF4oV7kuB2FYUbkTL+TirC3K58JiYY5Egc31trOKFm
+Jlz1xz0b6DkmKWTiV3r9OPHKJ8P7IeJxAZWmZzCdDuwkv0i+WW+z0zsIe3JjEavN
+3zb6O7R0HtziksWoqMeTqZeO+wa9iw6vVKQw1wWEqwKBgFHfahFs0DZ5cUTpGpBt
+F/AQG7ukgipB6N6AkB9kDbgCs1FLgd199MQrEncug5hfpq8QerbyMatmA+GXoGMb
+7vztKEH85yzp4n02FNL6H7xL4VVILvyZHdolmiORJ4qT2hZnl8pEQ2TYuF4RlHUd
+nSwXX+2o0J/nF85fm4AwWKAc
-----END PRIVATE KEY-----
diff --git a/contrib/libs/grpc/src/core/tsi/test_creds/client.pem b/contrib/libs/grpc/src/core/tsi/test_creds/client.pem
index 1c5c8b9d191..8815875f327 100644
--- a/contrib/libs/grpc/src/core/tsi/test_creds/client.pem
+++ b/contrib/libs/grpc/src/core/tsi/test_creds/client.pem
@@ -1,20 +1,20 @@
-----BEGIN CERTIFICATE-----
-MIIDNzCCAh8CFGyX00RCepOv/qCJ1oVdTtY92U83MA0GCSqGSIb3DQEBCwUAMFYx
-CzAJBgNVBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRl
-cm5ldCBXaWRnaXRzIFB0eSBMdGQxDzANBgNVBAMMBnRlc3RjYTAeFw0yMDAzMTgw
-MTA2MTBaFw0zMDAzMTYwMTA2MTBaMFoxCzAJBgNVBAYTAkFVMRMwEQYDVQQIDApT
-b21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQxEzAR
-BgNVBAMMCnRlc3RjbGllbnQwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB
-AQCyqYRp+DXVp72NFbQH8hdhTZLycZXOlJhmMsrJmrjn2p7pI/8mTZ/0FC+SGWBG
-ZV+ELiHrmCX5zfaILr9Iuw7Ghr3Vzoefi8r62rLupVPNi/qdqyjWk2dECHC9Z3+A
-g3KzKTyerXWjKcvyKVmM0ZxE0RXhDW/RoQbqZsU2GKg1B2rhUU8KN0gVmKn0rJHO
-xzRVSYeYLYp5Yn7KrtPJcKyo9aVuEr7dGANzpyF6lg/nYBWc+9SGwkoLdFvKvABY
-JMyrbNhHUQfv0fzaZ0P86dfTENrDxzALrzGnqcx3KTrwJjkZ/aSr1tyD0/tXvukR
-FiPxWBJhjHQ70GqTFQY19RbhAgMBAAEwDQYJKoZIhvcNAQELBQADggEBAFXCewK8
-cWT+zWxXyGFnouFSBzTi0BMBJRrhsiNoiQxkqityJHWFExiQZie+7CA+EabXCQUB
-+JwMSWM29j3mSw10DTfmC3rhheQqGxy304BZyUpdpvI2dt3p/mcsE7O+p4sQrSep
-gijiDssKAfxTAmUM93N6+Q8yJK5immxlbeYfijoBvmkzyB/B+qNRPsx0n7aFGnfv
-oWfkW296iPhWLiwknpC3xB6oK3vRbK4Zj1OaGb0grK7VN8EyhBix2xVF61i4dzCK
-kMIpl7CUpw1Mb2z8q3F2bHBS7iF7g1Ccn5VGcO+aJ+6PWydaeqJ6VEBF0Nwv9woe
-mL5AluNRLaqjZvE=
+MIIDNzCCAh8CFGyX00RCepOv/qCJ1oVdTtY92U83MA0GCSqGSIb3DQEBCwUAMFYx
+CzAJBgNVBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRl
+cm5ldCBXaWRnaXRzIFB0eSBMdGQxDzANBgNVBAMMBnRlc3RjYTAeFw0yMDAzMTgw
+MTA2MTBaFw0zMDAzMTYwMTA2MTBaMFoxCzAJBgNVBAYTAkFVMRMwEQYDVQQIDApT
+b21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQxEzAR
+BgNVBAMMCnRlc3RjbGllbnQwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB
+AQCyqYRp+DXVp72NFbQH8hdhTZLycZXOlJhmMsrJmrjn2p7pI/8mTZ/0FC+SGWBG
+ZV+ELiHrmCX5zfaILr9Iuw7Ghr3Vzoefi8r62rLupVPNi/qdqyjWk2dECHC9Z3+A
+g3KzKTyerXWjKcvyKVmM0ZxE0RXhDW/RoQbqZsU2GKg1B2rhUU8KN0gVmKn0rJHO
+xzRVSYeYLYp5Yn7KrtPJcKyo9aVuEr7dGANzpyF6lg/nYBWc+9SGwkoLdFvKvABY
+JMyrbNhHUQfv0fzaZ0P86dfTENrDxzALrzGnqcx3KTrwJjkZ/aSr1tyD0/tXvukR
+FiPxWBJhjHQ70GqTFQY19RbhAgMBAAEwDQYJKoZIhvcNAQELBQADggEBAFXCewK8
+cWT+zWxXyGFnouFSBzTi0BMBJRrhsiNoiQxkqityJHWFExiQZie+7CA+EabXCQUB
++JwMSWM29j3mSw10DTfmC3rhheQqGxy304BZyUpdpvI2dt3p/mcsE7O+p4sQrSep
+gijiDssKAfxTAmUM93N6+Q8yJK5immxlbeYfijoBvmkzyB/B+qNRPsx0n7aFGnfv
+oWfkW296iPhWLiwknpC3xB6oK3vRbK4Zj1OaGb0grK7VN8EyhBix2xVF61i4dzCK
+kMIpl7CUpw1Mb2z8q3F2bHBS7iF7g1Ccn5VGcO+aJ+6PWydaeqJ6VEBF0Nwv9woe
+mL5AluNRLaqjZvE=
-----END CERTIFICATE-----
diff --git a/contrib/libs/grpc/src/core/tsi/test_creds/multi-domain-openssl.cnf b/contrib/libs/grpc/src/core/tsi/test_creds/multi-domain-openssl.cnf
index 227354f4581..265950f56d6 100644
--- a/contrib/libs/grpc/src/core/tsi/test_creds/multi-domain-openssl.cnf
+++ b/contrib/libs/grpc/src/core/tsi/test_creds/multi-domain-openssl.cnf
@@ -1,30 +1,30 @@
-[req]
-distinguished_name = req_distinguished_name
-req_extensions = v3_req
-
-[req_distinguished_name]
-countryName = Country Name (2 letter code)
-countryName_default = US
-stateOrProvinceName = State or Province Name (full name)
-stateOrProvinceName_default = CA
-localityName = Locality Name (eg, city)
-localityName_default = SF
-organizationalUnitName = Organizational Unit Name (eg, section)
-organizationalUnitName_default = Google
-commonName = Common Name (CN)
-commonName_default =xpigors
-commonName_max = 64
-
-[ v3_req ]
-basicConstraints = CA:FALSE
-keyUsage = nonRepudiation, digitalSignature, keyEncipherment
-subjectAltName = @alt_names
-
-[alt_names]
-DNS.1 = foo.test.domain.com
-DNS.2 = bar.test.domain.com
-URI.1 = https://foo.test.domain.com/test
-URI.2 = https://bar.test.domain.com/test
-URI.3 = spiffe://foo.com/bar/baz
-email.1 = [email protected]
-email.2 = [email protected]
+[req]
+distinguished_name = req_distinguished_name
+req_extensions = v3_req
+
+[req_distinguished_name]
+countryName = Country Name (2 letter code)
+countryName_default = US
+stateOrProvinceName = State or Province Name (full name)
+stateOrProvinceName_default = CA
+localityName = Locality Name (eg, city)
+localityName_default = SF
+organizationalUnitName = Organizational Unit Name (eg, section)
+organizationalUnitName_default = Google
+commonName = Common Name (CN)
+commonName_default =xpigors
+commonName_max = 64
+
+[ v3_req ]
+basicConstraints = CA:FALSE
+keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+subjectAltName = @alt_names
+
+[alt_names]
+DNS.1 = foo.test.domain.com
+DNS.2 = bar.test.domain.com
+URI.1 = https://foo.test.domain.com/test
+URI.2 = https://bar.test.domain.com/test
+URI.3 = spiffe://foo.com/bar/baz
diff --git a/contrib/libs/grpc/src/core/tsi/test_creds/multi-domain.key b/contrib/libs/grpc/src/core/tsi/test_creds/multi-domain.key
index 548aa9eb74d..b5789e92f94 100644
--- a/contrib/libs/grpc/src/core/tsi/test_creds/multi-domain.key
+++ b/contrib/libs/grpc/src/core/tsi/test_creds/multi-domain.key
@@ -1,28 +1,28 @@
------BEGIN PRIVATE KEY-----
-MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCuGVBYD3P/D2eT
-nhBhZ0izP+nuozNCEO/iQu/kyy6ZCzIEFvykt0aPzJVLcsCHCaWcNJVFPSqVDVRm
-9S5ZHUyLlnSl53mKUltZI4tDDVMcEdr7KpfXeBc86lm/93DqFDgAYDkvebekRr/8
-B1OJhVJRGowXjAU9sYABzuUqjkra522BleIik3m+7DborGHS4Io5X/8D8VjlXjeB
-Vht6QA8ij5JVfHvO6DsZr99EITPpha6i182O6S6lO2t1V+bdWP+EPjiOQJktrmvM
-QYTFjmjYkRKLCZI1xxSfCK8t7ia5sLPFOF6uDH91ck8mXmuHs96nSOyB1i/LdBy9
-XdInSRGXAgMBAAECggEAWoqZqSJoPfah9DhY5n8TZP1RSKUhTDOIvc/3+LHeSwNy
-gIP/4h3amYBZCELmc5QFx8Xk93xG//tNsLnD396H53RYt8s4/0GzdhkxHK76UPfM
-PaE6FHnFBA4QnPAvjdzz/uYL92/CnLGauJSK0lM+qyU2RCyysRH1s3sI3Wfg8BRd
-C9Xik+YzYirhCEGlYKju2D2As/tB2L0b/PRpM9FWeqd/YGCj8pUpceNrbvU8udc7
-4xQS6ssgMI2H1xGc50kJVDjoZix5OLiTaHDO4oRBZT+QdPTtfkam0/y2yZ9oX6UN
-Byl+ybtUpxsmsvl+I7bb/fZsILrXE3GHXtcsCMi5iQKBgQDmKi1HfmQo6KeDSnjp
-R+yIMc77QpZpLuzjPlKWGxY915KlL77GOUYR2cm0rPP9CPGN2Nj5IyuR32u6uHtI
-WKewR7cn69prxZI3VSNFQmsatWKBoR7dwyJ4j93cN54naEuBLA1BJQ0uXgYJtgwT
-x5KP97LcudpoDNVsh+FUopon8wKBgQDBpBMeDoc+7YVLnlx4FRJudzVfWWb4bPCL
-2cusycOVAlN2E0VsrD2vbVWoinpVPIeOfGgD0RZZLtVQL5Ui8mZcANmuoRXtEqaS
-sQ6VxkdC62uDXgrsi+i/0nsxvACmfde4sxALu3DZ7rjNlWUW7amJt34CsDBMlVeL
-eDAmD0WczQKBgQCHzSLiKATYzkzn/izRF4rL4PeK8ILmlLVYbxEzV9ALtQHlTQJ2
-2pwpNCL644EiLwC2/NcoSEQQ0Y4yoV68FPL745SBjXtWU0AuPaGN395p59OzQGmB
-1vyjvd7dbEN4ZOUH1gIMCdx5Gyjc2fjOQtaK808pRM9EzS2v14xv73CdWQKBgC/8
-qiQrs4Z7tCm+L+ouRqgLcLWVYTg1PxNZQOksAwT9U5OSSQUaVhsQPEcNMi3HV0yP
-NfOkMCafvYsmj43ehlFMgKWPE/DxS0hVCmlBfs1tq/IdLxXZwi8vSQpVLdAUpY4H
-CfXuWJQZXcDMwgWBlh8j0t11rjJ8W/qbKUt1Q2oNAoGBALdy/RpspFttVvthzFbg
-FLHUAwUhEsK1VSi26AYy4L0ZHw/KLnbIGEzKCEFWqn6nfWOlb9Rw5C7QlGx/1UCC
-Tnn9KnZoziK4JDQw6SEl/3hNQ5+FYI8y7QGsqAm1W9dobbgl0a1IfmbtBeEOZt+e
-7oFnqaxVruVmNr56M9IMCwA1
------END PRIVATE KEY-----
+-----BEGIN PRIVATE KEY-----
+MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCuGVBYD3P/D2eT
+nhBhZ0izP+nuozNCEO/iQu/kyy6ZCzIEFvykt0aPzJVLcsCHCaWcNJVFPSqVDVRm
+9S5ZHUyLlnSl53mKUltZI4tDDVMcEdr7KpfXeBc86lm/93DqFDgAYDkvebekRr/8
+B1OJhVJRGowXjAU9sYABzuUqjkra522BleIik3m+7DborGHS4Io5X/8D8VjlXjeB
+Vht6QA8ij5JVfHvO6DsZr99EITPpha6i182O6S6lO2t1V+bdWP+EPjiOQJktrmvM
+QYTFjmjYkRKLCZI1xxSfCK8t7ia5sLPFOF6uDH91ck8mXmuHs96nSOyB1i/LdBy9
+XdInSRGXAgMBAAECggEAWoqZqSJoPfah9DhY5n8TZP1RSKUhTDOIvc/3+LHeSwNy
+gIP/4h3amYBZCELmc5QFx8Xk93xG//tNsLnD396H53RYt8s4/0GzdhkxHK76UPfM
+PaE6FHnFBA4QnPAvjdzz/uYL92/CnLGauJSK0lM+qyU2RCyysRH1s3sI3Wfg8BRd
+C9Xik+YzYirhCEGlYKju2D2As/tB2L0b/PRpM9FWeqd/YGCj8pUpceNrbvU8udc7
+4xQS6ssgMI2H1xGc50kJVDjoZix5OLiTaHDO4oRBZT+QdPTtfkam0/y2yZ9oX6UN
+Byl+ybtUpxsmsvl+I7bb/fZsILrXE3GHXtcsCMi5iQKBgQDmKi1HfmQo6KeDSnjp
+R+yIMc77QpZpLuzjPlKWGxY915KlL77GOUYR2cm0rPP9CPGN2Nj5IyuR32u6uHtI
+WKewR7cn69prxZI3VSNFQmsatWKBoR7dwyJ4j93cN54naEuBLA1BJQ0uXgYJtgwT
+x5KP97LcudpoDNVsh+FUopon8wKBgQDBpBMeDoc+7YVLnlx4FRJudzVfWWb4bPCL
+2cusycOVAlN2E0VsrD2vbVWoinpVPIeOfGgD0RZZLtVQL5Ui8mZcANmuoRXtEqaS
+sQ6VxkdC62uDXgrsi+i/0nsxvACmfde4sxALu3DZ7rjNlWUW7amJt34CsDBMlVeL
+eDAmD0WczQKBgQCHzSLiKATYzkzn/izRF4rL4PeK8ILmlLVYbxEzV9ALtQHlTQJ2
+2pwpNCL644EiLwC2/NcoSEQQ0Y4yoV68FPL745SBjXtWU0AuPaGN395p59OzQGmB
+1vyjvd7dbEN4ZOUH1gIMCdx5Gyjc2fjOQtaK808pRM9EzS2v14xv73CdWQKBgC/8
+qiQrs4Z7tCm+L+ouRqgLcLWVYTg1PxNZQOksAwT9U5OSSQUaVhsQPEcNMi3HV0yP
+NfOkMCafvYsmj43ehlFMgKWPE/DxS0hVCmlBfs1tq/IdLxXZwi8vSQpVLdAUpY4H
+CfXuWJQZXcDMwgWBlh8j0t11rjJ8W/qbKUt1Q2oNAoGBALdy/RpspFttVvthzFbg
+FLHUAwUhEsK1VSi26AYy4L0ZHw/KLnbIGEzKCEFWqn6nfWOlb9Rw5C7QlGx/1UCC
+Tnn9KnZoziK4JDQw6SEl/3hNQ5+FYI8y7QGsqAm1W9dobbgl0a1IfmbtBeEOZt+e
+7oFnqaxVruVmNr56M9IMCwA1
+-----END PRIVATE KEY-----
diff --git a/contrib/libs/grpc/src/core/tsi/test_creds/multi-domain.pem b/contrib/libs/grpc/src/core/tsi/test_creds/multi-domain.pem
index 80bdc826bbc..d4ff936fde3 100644
--- a/contrib/libs/grpc/src/core/tsi/test_creds/multi-domain.pem
+++ b/contrib/libs/grpc/src/core/tsi/test_creds/multi-domain.pem
@@ -1,24 +1,24 @@
-----BEGIN CERTIFICATE-----
-MIID/jCCAuagAwIBAgIUV2eOzlQQj1U+++TDdNyRHjRNamQwDQYJKoZIhvcNAQEL
+MIID/jCCAuagAwIBAgIUV2eOzlQQj1U+++TDdNyRHjRNamQwDQYJKoZIhvcNAQEL
BQAwSjELMAkGA1UEBhMCVVMxCzAJBgNVBAgMAkNBMQswCQYDVQQHDAJTRjEPMA0G
-A1UECwwGR29vZ2xlMRAwDgYDVQQDDAd4cGlnb3JzMB4XDTIwMDYwNzIyNTk1MFoX
-DTMwMDYwNTIyNTk1MFowSjELMAkGA1UEBhMCVVMxCzAJBgNVBAgMAkNBMQswCQYD
+A1UECwwGR29vZ2xlMRAwDgYDVQQDDAd4cGlnb3JzMB4XDTIwMDYwNzIyNTk1MFoX
+DTMwMDYwNTIyNTk1MFowSjELMAkGA1UEBhMCVVMxCzAJBgNVBAgMAkNBMQswCQYD
VQQHDAJTRjEPMA0GA1UECwwGR29vZ2xlMRAwDgYDVQQDDAd4cGlnb3JzMIIBIjAN
-BgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArhlQWA9z/w9nk54QYWdIsz/p7qMz
-QhDv4kLv5MsumQsyBBb8pLdGj8yVS3LAhwmlnDSVRT0qlQ1UZvUuWR1Mi5Z0ped5
-ilJbWSOLQw1THBHa+yqX13gXPOpZv/dw6hQ4AGA5L3m3pEa//AdTiYVSURqMF4wF
-PbGAAc7lKo5K2udtgZXiIpN5vuw26Kxh0uCKOV//A/FY5V43gVYbekAPIo+SVXx7
-zug7Ga/fRCEz6YWuotfNjukupTtrdVfm3Vj/hD44jkCZLa5rzEGExY5o2JESiwmS
-NccUnwivLe4mubCzxThergx/dXJPJl5rh7Pep0jsgdYvy3QcvV3SJ0kRlwIDAQAB
-o4HbMIHYMAkGA1UdEwQCMAAwCwYDVR0PBAQDAgXgMIG9BgNVHREEgbUwgbKCE2Zv
-by50ZXN0LmRvbWFpbi5jb22CE2Jhci50ZXN0LmRvbWFpbi5jb22GIGh0dHBzOi8v
-Zm9vLnRlc3QuZG9tYWluLmNvbS90ZXN0hiBodHRwczovL2Jhci50ZXN0LmRvbWFp
-bi5jb20vdGVzdIYYc3BpZmZlOi8vZm9vLmNvbS9iYXIvYmF6gRNmb29AdGVzdC5k
-b21haW4uY29tgRNiYXJAdGVzdC5kb21haW4uY29tMA0GCSqGSIb3DQEBCwUAA4IB
-AQBlLNl/uXN01VARQFd5CNFMhwez879uB5N3s/pGBjzE8Z+NA9YjsBFkBSQlebFM
-5UP304rsvG2opHwcSkblG9a3TbpQVNaYjcHgudip3FqLTJ3NhYtx1A3uCBp4ABeP
-+AVlCcsNVysGwGvMzXlN++Y++U0A9BbfrP85VBslLaKn4rYpfB5pAdzu277ICdEy
-nyFZ+jo2OS1lbv7kE7IW6slCXbCFaxPIKvjPbpGFngsLt44sZ9VvSJCeKhDglMfn
-HKkhd4/UMnRn+8tZZ6eH/C5tpeKAChMUF+bkuwk3dBwnHq484KbBAKd2cwzZhTB7
-8unku1S1GumvoEYAgbG1P4gC
+BgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArhlQWA9z/w9nk54QYWdIsz/p7qMz
+QhDv4kLv5MsumQsyBBb8pLdGj8yVS3LAhwmlnDSVRT0qlQ1UZvUuWR1Mi5Z0ped5
+ilJbWSOLQw1THBHa+yqX13gXPOpZv/dw6hQ4AGA5L3m3pEa//AdTiYVSURqMF4wF
+PbGAAc7lKo5K2udtgZXiIpN5vuw26Kxh0uCKOV//A/FY5V43gVYbekAPIo+SVXx7
+zug7Ga/fRCEz6YWuotfNjukupTtrdVfm3Vj/hD44jkCZLa5rzEGExY5o2JESiwmS
+NccUnwivLe4mubCzxThergx/dXJPJl5rh7Pep0jsgdYvy3QcvV3SJ0kRlwIDAQAB
+o4HbMIHYMAkGA1UdEwQCMAAwCwYDVR0PBAQDAgXgMIG9BgNVHREEgbUwgbKCE2Zv
+by50ZXN0LmRvbWFpbi5jb22CE2Jhci50ZXN0LmRvbWFpbi5jb22GIGh0dHBzOi8v
+Zm9vLnRlc3QuZG9tYWluLmNvbS90ZXN0hiBodHRwczovL2Jhci50ZXN0LmRvbWFp
+bi5jb20vdGVzdIYYc3BpZmZlOi8vZm9vLmNvbS9iYXIvYmF6gRNmb29AdGVzdC5k
+b21haW4uY29tgRNiYXJAdGVzdC5kb21haW4uY29tMA0GCSqGSIb3DQEBCwUAA4IB
+AQBlLNl/uXN01VARQFd5CNFMhwez879uB5N3s/pGBjzE8Z+NA9YjsBFkBSQlebFM
+5UP304rsvG2opHwcSkblG9a3TbpQVNaYjcHgudip3FqLTJ3NhYtx1A3uCBp4ABeP
++AVlCcsNVysGwGvMzXlN++Y++U0A9BbfrP85VBslLaKn4rYpfB5pAdzu277ICdEy
+nyFZ+jo2OS1lbv7kE7IW6slCXbCFaxPIKvjPbpGFngsLt44sZ9VvSJCeKhDglMfn
+HKkhd4/UMnRn+8tZZ6eH/C5tpeKAChMUF+bkuwk3dBwnHq484KbBAKd2cwzZhTB7
+8unku1S1GumvoEYAgbG1P4gC
-----END CERTIFICATE-----
diff --git a/contrib/libs/grpc/src/core/tsi/test_creds/server0.key b/contrib/libs/grpc/src/core/tsi/test_creds/server0.key
index 0af636bdef4..261097a87e3 100644
--- a/contrib/libs/grpc/src/core/tsi/test_creds/server0.key
+++ b/contrib/libs/grpc/src/core/tsi/test_creds/server0.key
@@ -1,28 +1,28 @@
-----BEGIN PRIVATE KEY-----
-MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCei9aKutDNg2mr
-COICW4hT6+LVJfI5J6DZ3yqb6MBzbc//VeUj1OCX/vt5vvPm1Qb5XNk1MOIFPEW6
-t2/0Mhj2VbQfjDe/PhZRhwu4PBtuoJBDeBsKkdnxD0I+4G0XRbeTtUsGMGBgWSAd
-qHMD2HnEhgydRw0krYjZp4a/HMCnZZ1WFamw1PCvQK6AuWSSk4iHGaYklXUaKd3r
-Rlkujr7//ihcvqweJ+OdaTwXD8z4P0YfFe/bkWWpuqIZz1Or/nxiNBtvWKlI8pR2
-K3wkoWsW+6bnFN8u81nstHDardR6zy3B7QXke02q4sddUERcwNFyPqpscetMpnhg
-lhjrmnAXAgMBAAECggEAA6pB5GUbLJUMHUsQRnOtPBto2/qLleynmEHDb2U7BbAV
-LdbjfCeQpZLcZ10VsFFeXudZkhQ2NV7GUeGpseBymUcz6cLJCx+5Tlsr1y90huMp
-UpX1MhJbEmqC4oc3nmEbNEvtlxAJOlD1IBpjxkP71KIwqnYZBK8KSdXIlKRqg7QZ
-VUgjA08TmWlZSxnOt1hpt2ZVjTOn7973YoTb4D7SZydMuVjTkwv9YjPFZOZ/wIP4
-JTZczY/bJjEF7QBYL/wtir/vNJlxxi+FunJdoO3blhf8li5QU0iPd/YsyBFBBWfF
-vD7QslaB7wQ8zyWxWpPLiWeD83XGE+7CY2+8EpG3AQKBgQDMK6N7jDQCq9F7n+5B
-R8YPDMdINpcVsN8bIeEVKSxYE86oADQg/0jPUct+4liUS1dv0DUmUP1U0zbvupX7
-NxE+gI8KFwCyq8nqZ1guW9oO00ZAGo4Rn0TIeoHWVgsE2tDqBFeC2wWYle1AaZLx
-ZtFH6Ya4Q3a4xvjkXXabhbBDlwKBgQDGyzuNCGT1Xa1DXKLzyKspahdm9r7QXifo
-jjZkcmzwItC535MBbQMq5+THD+WUbWrZ/rJ8KaSsoGmnjaWguSG0WLFpH3UiGn1W
-FOSG2UGc0mWyz2p/j97EuhK12fabzn8rkuiohiFXjJDYrAIulcM++0ar3q2LyqXr
-gleBEHLHgQKBgEAt44j9rIe+bO44etOIdUjb0nTvvBR0cd18i910AN169HY5Ainx
-NXj+FELBcejDuiuKvnpZ8RhOALHg7C54w/HqxYv9aRnBCIqni7+e3e/VF/sknc4K
-S7vdTp0KlRIkmpFFZiDbKmopjte1mBxMHrNFRDT99/7jhO98NcFzh9HnAoGAMf62
-sVdlHJg8lO5dRPY4pae6zvhLMNgdLU1mvIhSgWogGD70F6202DuNu8pxsIx8DOsT
-NEq80XVeXPcwqmUk5thPdeKlcLg8wUNr3cYRzEDVtsyXOhGSsuMhBX8VmEWskebW
-gFuLUxtU6kkIG3MqsVI8icjs2HVUmRAktZ7PXwECgYA9V/zZe2DpP36gp63wRk6S
-FI7bDbLPQCKah23mwp3WeP5T+/HmFFRrl0OCaDLwudTolqgPa47CV7JYa9LmJAPj
-QBxcnL4CxjlaaS3V9kxVWOXabMEtwSUurELJwFKTEC/AFN9dR/nv4AzXInZznotG
-7qDX8EhfjbFVJw4riAmlEw==
+MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCei9aKutDNg2mr
+COICW4hT6+LVJfI5J6DZ3yqb6MBzbc//VeUj1OCX/vt5vvPm1Qb5XNk1MOIFPEW6
+t2/0Mhj2VbQfjDe/PhZRhwu4PBtuoJBDeBsKkdnxD0I+4G0XRbeTtUsGMGBgWSAd
+qHMD2HnEhgydRw0krYjZp4a/HMCnZZ1WFamw1PCvQK6AuWSSk4iHGaYklXUaKd3r
+Rlkujr7//ihcvqweJ+OdaTwXD8z4P0YfFe/bkWWpuqIZz1Or/nxiNBtvWKlI8pR2
+K3wkoWsW+6bnFN8u81nstHDardR6zy3B7QXke02q4sddUERcwNFyPqpscetMpnhg
+lhjrmnAXAgMBAAECggEAA6pB5GUbLJUMHUsQRnOtPBto2/qLleynmEHDb2U7BbAV
+LdbjfCeQpZLcZ10VsFFeXudZkhQ2NV7GUeGpseBymUcz6cLJCx+5Tlsr1y90huMp
+UpX1MhJbEmqC4oc3nmEbNEvtlxAJOlD1IBpjxkP71KIwqnYZBK8KSdXIlKRqg7QZ
+VUgjA08TmWlZSxnOt1hpt2ZVjTOn7973YoTb4D7SZydMuVjTkwv9YjPFZOZ/wIP4
+JTZczY/bJjEF7QBYL/wtir/vNJlxxi+FunJdoO3blhf8li5QU0iPd/YsyBFBBWfF
+vD7QslaB7wQ8zyWxWpPLiWeD83XGE+7CY2+8EpG3AQKBgQDMK6N7jDQCq9F7n+5B
+R8YPDMdINpcVsN8bIeEVKSxYE86oADQg/0jPUct+4liUS1dv0DUmUP1U0zbvupX7
+NxE+gI8KFwCyq8nqZ1guW9oO00ZAGo4Rn0TIeoHWVgsE2tDqBFeC2wWYle1AaZLx
+ZtFH6Ya4Q3a4xvjkXXabhbBDlwKBgQDGyzuNCGT1Xa1DXKLzyKspahdm9r7QXifo
+jjZkcmzwItC535MBbQMq5+THD+WUbWrZ/rJ8KaSsoGmnjaWguSG0WLFpH3UiGn1W
+FOSG2UGc0mWyz2p/j97EuhK12fabzn8rkuiohiFXjJDYrAIulcM++0ar3q2LyqXr
+gleBEHLHgQKBgEAt44j9rIe+bO44etOIdUjb0nTvvBR0cd18i910AN169HY5Ainx
+NXj+FELBcejDuiuKvnpZ8RhOALHg7C54w/HqxYv9aRnBCIqni7+e3e/VF/sknc4K
+S7vdTp0KlRIkmpFFZiDbKmopjte1mBxMHrNFRDT99/7jhO98NcFzh9HnAoGAMf62
+sVdlHJg8lO5dRPY4pae6zvhLMNgdLU1mvIhSgWogGD70F6202DuNu8pxsIx8DOsT
+NEq80XVeXPcwqmUk5thPdeKlcLg8wUNr3cYRzEDVtsyXOhGSsuMhBX8VmEWskebW
+gFuLUxtU6kkIG3MqsVI8icjs2HVUmRAktZ7PXwECgYA9V/zZe2DpP36gp63wRk6S
+FI7bDbLPQCKah23mwp3WeP5T+/HmFFRrl0OCaDLwudTolqgPa47CV7JYa9LmJAPj
+QBxcnL4CxjlaaS3V9kxVWOXabMEtwSUurELJwFKTEC/AFN9dR/nv4AzXInZznotG
+7qDX8EhfjbFVJw4riAmlEw==
-----END PRIVATE KEY-----
diff --git a/contrib/libs/grpc/src/core/tsi/test_creds/server0.pem b/contrib/libs/grpc/src/core/tsi/test_creds/server0.pem
index 0c4f3798f94..ab20787fa5b 100644
--- a/contrib/libs/grpc/src/core/tsi/test_creds/server0.pem
+++ b/contrib/libs/grpc/src/core/tsi/test_creds/server0.pem
@@ -1,20 +1,20 @@
-----BEGIN CERTIFICATE-----
-MIIDQTCCAikCFGyX00RCepOv/qCJ1oVdTtY92U84MA0GCSqGSIb3DQEBCwUAMFYx
-CzAJBgNVBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRl
-cm5ldCBXaWRnaXRzIFB0eSBMdGQxDzANBgNVBAMMBnRlc3RjYTAeFw0yMDAzMTgw
-MTA3MzhaFw0zMDAzMTYwMTA3MzhaMGQxCzAJBgNVBAYTAkFVMRMwEQYDVQQIDApT
-b21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQxHTAb
-BgNVBAMMFCoudGVzdC5nb29nbGUuY29tLmF1MIIBIjANBgkqhkiG9w0BAQEFAAOC
-AQ8AMIIBCgKCAQEAnovWirrQzYNpqwjiAluIU+vi1SXyOSeg2d8qm+jAc23P/1Xl
-I9Tgl/77eb7z5tUG+VzZNTDiBTxFurdv9DIY9lW0H4w3vz4WUYcLuDwbbqCQQ3gb
-CpHZ8Q9CPuBtF0W3k7VLBjBgYFkgHahzA9h5xIYMnUcNJK2I2aeGvxzAp2WdVhWp
-sNTwr0CugLlkkpOIhxmmJJV1Gind60ZZLo6+//4oXL6sHifjnWk8Fw/M+D9GHxXv
-25FlqbqiGc9Tq/58YjQbb1ipSPKUdit8JKFrFvum5xTfLvNZ7LRw2q3Ues8twe0F
-5HtNquLHXVBEXMDRcj6qbHHrTKZ4YJYY65pwFwIDAQABMA0GCSqGSIb3DQEBCwUA
-A4IBAQCCGvZpM+t83xWPCsz5FyuCqA6LI+j0NMMmKpe1wJ8JcK2o9Qw4d0wPxWdy
-0O7Ti2YlJS3gups00zsaFhQymIKUBi5Gc+1VC7qHUUrVtkoIRe6QSpcVlxPVczlD
-If1egkjBCUZKVSWqYRKB6AMqjpp7/dF06j6zAaAH54jaLv9VmiBtsFyd017AsC9W
-+OG2ke2dNtXySfVX4VusCcji86qb5sr6hNIQWMXk6dZoLDsZvwvVi7KnrqQOza8J
-klcJXV8Hsnq/faHr/ZmsIA65N0+H8KuYfbO+s5nKPG9th6ZZAu4aY2VDei++TH+H
-EAQhivPNUC1DgCmx0P7vKLhgka7S
+MIIDQTCCAikCFGyX00RCepOv/qCJ1oVdTtY92U84MA0GCSqGSIb3DQEBCwUAMFYx
+CzAJBgNVBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRl
+cm5ldCBXaWRnaXRzIFB0eSBMdGQxDzANBgNVBAMMBnRlc3RjYTAeFw0yMDAzMTgw
+MTA3MzhaFw0zMDAzMTYwMTA3MzhaMGQxCzAJBgNVBAYTAkFVMRMwEQYDVQQIDApT
+b21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQxHTAb
+BgNVBAMMFCoudGVzdC5nb29nbGUuY29tLmF1MIIBIjANBgkqhkiG9w0BAQEFAAOC
+AQ8AMIIBCgKCAQEAnovWirrQzYNpqwjiAluIU+vi1SXyOSeg2d8qm+jAc23P/1Xl
+I9Tgl/77eb7z5tUG+VzZNTDiBTxFurdv9DIY9lW0H4w3vz4WUYcLuDwbbqCQQ3gb
+CpHZ8Q9CPuBtF0W3k7VLBjBgYFkgHahzA9h5xIYMnUcNJK2I2aeGvxzAp2WdVhWp
+sNTwr0CugLlkkpOIhxmmJJV1Gind60ZZLo6+//4oXL6sHifjnWk8Fw/M+D9GHxXv
+25FlqbqiGc9Tq/58YjQbb1ipSPKUdit8JKFrFvum5xTfLvNZ7LRw2q3Ues8twe0F
+5HtNquLHXVBEXMDRcj6qbHHrTKZ4YJYY65pwFwIDAQABMA0GCSqGSIb3DQEBCwUA
+A4IBAQCCGvZpM+t83xWPCsz5FyuCqA6LI+j0NMMmKpe1wJ8JcK2o9Qw4d0wPxWdy
+0O7Ti2YlJS3gups00zsaFhQymIKUBi5Gc+1VC7qHUUrVtkoIRe6QSpcVlxPVczlD
+If1egkjBCUZKVSWqYRKB6AMqjpp7/dF06j6zAaAH54jaLv9VmiBtsFyd017AsC9W
++OG2ke2dNtXySfVX4VusCcji86qb5sr6hNIQWMXk6dZoLDsZvwvVi7KnrqQOza8J
+klcJXV8Hsnq/faHr/ZmsIA65N0+H8KuYfbO+s5nKPG9th6ZZAu4aY2VDei++TH+H
+EAQhivPNUC1DgCmx0P7vKLhgka7S
-----END CERTIFICATE-----
diff --git a/contrib/libs/grpc/src/core/tsi/test_creds/server1.key b/contrib/libs/grpc/src/core/tsi/test_creds/server1.key
index 23884118447..086462992cf 100644
--- a/contrib/libs/grpc/src/core/tsi/test_creds/server1.key
+++ b/contrib/libs/grpc/src/core/tsi/test_creds/server1.key
@@ -1,28 +1,28 @@
-----BEGIN PRIVATE KEY-----
-MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDnE443EknxvxBq
-6+hvn/t09hl8hx366EBYvZmVM/NC+7igXRAjiJiA/mIaCvL3MS0Iz5hBLxSGICU+
-WproA3GCIFITIwcf/ETyWj/5xpgZ4AKrLrjQmmX8mhwUajfF3UvwMJrCOVqPp67t
-PtP+2kBXaqrXdvnvXR41FsIB8V7zIAuIZB6bHQhiGVlc1sgZYsE2EGG9WMmHtS86
-qkAOTjG2XyjmPTGAwhGDpYkYrpzp99IiDh4/Veai81hn0ssQkbry0XRD/Ig3jcHh
-23WiriPNJ0JsbgXUSLKRPZObA9VgOLy2aXoN84IMaeK3yy+cwSYG/99w93fUZJte
-MXwz4oYZAgMBAAECggEBAIVn2Ncai+4xbH0OLWckabwgyJ4IM9rDc0LIU368O1kU
-koais8qP9dujAWgfoh3sGh/YGgKn96VnsZjKHlyMgF+r4TaDJn3k2rlAOWcurGlj
-1qaVlsV4HiEzp7pxiDmHhWvp4672Bb6iBG+bsjCUOEk/n9o9KhZzIBluRhtxCmw5
-nw4Do7z00PTvN81260uPWSc04IrytvZUiAIx/5qxD72bij2xJ8t/I9GI8g4FtoVB
-8pB6S/hJX1PZhh9VlU6Yk+TOfOVnbebG4W5138LkB835eqk3Zz0qsbc2euoi8Hxi
-y1VGwQEmMQ63jXz4c6g+X55ifvUK9Jpn5E8pq+pMd7ECgYEA93lYq+Cr54K4ey5t
-sWMa+ye5RqxjzgXj2Kqr55jb54VWG7wp2iGbg8FMlkQwzTJwebzDyCSatguEZLuB
-gRGroRnsUOy9vBvhKPOch9bfKIl6qOgzMJB267fBVWx5ybnRbWN/I7RvMQf3k+9y
-biCIVnxDLEEYyx7z85/5qxsXg/MCgYEA7wmWKtCTn032Hy9P8OL49T0X6Z8FlkDC
-Rk42ygrc/MUbugq9RGUxcCxoImOG9JXUpEtUe31YDm2j+/nbvrjl6/bP2qWs0V7l
-dTJl6dABP51pCw8+l4cWgBBX08Lkeen812AAFNrjmDCjX6rHjWHLJcpS18fnRRkP
-V1d/AHWX7MMCgYEA6Gsw2guhp0Zf2GCcaNK5DlQab8OL4Hwrpttzo4kuTlwtqNKp
-Q9H4al9qfF4Cr1TFya98+EVYf8yFRM3NLNjZpe3gwYf2EerlJj7VLcahw0KKzoN1
-QBENfwgPLRk5sDkx9VhSmcfl/diLroZdpAwtv3vo4nEoxeuGFbKTGx3Qkf0CgYEA
-xyR+dcb05Ygm3w4klHQTowQ10s1H80iaUcZBgQuR1ghEtDbUPZHsoR5t1xCB02ys
-DgAwLv1bChIvxvH/L6KM8ovZ2LekBX4AviWxoBxJnfz/EVau98B0b1auRN6eSC83
-FRuGldlSOW1z/nSh8ViizSYE5H5HX1qkXEippvFRE88CgYB3Bfu3YQY60ITWIShv
-nNkdcbTT9eoP9suaRJjw92Ln+7ZpALYlQMKUZmJ/5uBmLs4RFwUTQruLOPL4yLTH
-awADWUzs3IRr1fwn9E+zM8JVyKCnUEM3w4N5UZskGO2klashAd30hWO+knRv/y0r
-uGIYs9Ek7YXlXIRVrzMwcsrt1w==
+MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDnE443EknxvxBq
+6+hvn/t09hl8hx366EBYvZmVM/NC+7igXRAjiJiA/mIaCvL3MS0Iz5hBLxSGICU+
+WproA3GCIFITIwcf/ETyWj/5xpgZ4AKrLrjQmmX8mhwUajfF3UvwMJrCOVqPp67t
+PtP+2kBXaqrXdvnvXR41FsIB8V7zIAuIZB6bHQhiGVlc1sgZYsE2EGG9WMmHtS86
+qkAOTjG2XyjmPTGAwhGDpYkYrpzp99IiDh4/Veai81hn0ssQkbry0XRD/Ig3jcHh
+23WiriPNJ0JsbgXUSLKRPZObA9VgOLy2aXoN84IMaeK3yy+cwSYG/99w93fUZJte
+MXwz4oYZAgMBAAECggEBAIVn2Ncai+4xbH0OLWckabwgyJ4IM9rDc0LIU368O1kU
+koais8qP9dujAWgfoh3sGh/YGgKn96VnsZjKHlyMgF+r4TaDJn3k2rlAOWcurGlj
+1qaVlsV4HiEzp7pxiDmHhWvp4672Bb6iBG+bsjCUOEk/n9o9KhZzIBluRhtxCmw5
+nw4Do7z00PTvN81260uPWSc04IrytvZUiAIx/5qxD72bij2xJ8t/I9GI8g4FtoVB
+8pB6S/hJX1PZhh9VlU6Yk+TOfOVnbebG4W5138LkB835eqk3Zz0qsbc2euoi8Hxi
+y1VGwQEmMQ63jXz4c6g+X55ifvUK9Jpn5E8pq+pMd7ECgYEA93lYq+Cr54K4ey5t
+sWMa+ye5RqxjzgXj2Kqr55jb54VWG7wp2iGbg8FMlkQwzTJwebzDyCSatguEZLuB
+gRGroRnsUOy9vBvhKPOch9bfKIl6qOgzMJB267fBVWx5ybnRbWN/I7RvMQf3k+9y
+biCIVnxDLEEYyx7z85/5qxsXg/MCgYEA7wmWKtCTn032Hy9P8OL49T0X6Z8FlkDC
+Rk42ygrc/MUbugq9RGUxcCxoImOG9JXUpEtUe31YDm2j+/nbvrjl6/bP2qWs0V7l
+dTJl6dABP51pCw8+l4cWgBBX08Lkeen812AAFNrjmDCjX6rHjWHLJcpS18fnRRkP
+V1d/AHWX7MMCgYEA6Gsw2guhp0Zf2GCcaNK5DlQab8OL4Hwrpttzo4kuTlwtqNKp
+Q9H4al9qfF4Cr1TFya98+EVYf8yFRM3NLNjZpe3gwYf2EerlJj7VLcahw0KKzoN1
+QBENfwgPLRk5sDkx9VhSmcfl/diLroZdpAwtv3vo4nEoxeuGFbKTGx3Qkf0CgYEA
+xyR+dcb05Ygm3w4klHQTowQ10s1H80iaUcZBgQuR1ghEtDbUPZHsoR5t1xCB02ys
+DgAwLv1bChIvxvH/L6KM8ovZ2LekBX4AviWxoBxJnfz/EVau98B0b1auRN6eSC83
+FRuGldlSOW1z/nSh8ViizSYE5H5HX1qkXEippvFRE88CgYB3Bfu3YQY60ITWIShv
+nNkdcbTT9eoP9suaRJjw92Ln+7ZpALYlQMKUZmJ/5uBmLs4RFwUTQruLOPL4yLTH
+awADWUzs3IRr1fwn9E+zM8JVyKCnUEM3w4N5UZskGO2klashAd30hWO+knRv/y0r
+uGIYs9Ek7YXlXIRVrzMwcsrt1w==
-----END PRIVATE KEY-----
diff --git a/contrib/libs/grpc/src/core/tsi/test_creds/server1.pem b/contrib/libs/grpc/src/core/tsi/test_creds/server1.pem
index 3025c1320ec..88244f856c6 100644
--- a/contrib/libs/grpc/src/core/tsi/test_creds/server1.pem
+++ b/contrib/libs/grpc/src/core/tsi/test_creds/server1.pem
@@ -1,22 +1,22 @@
-----BEGIN CERTIFICATE-----
-MIIDtDCCApygAwIBAgIUbJfTREJ6k6/+oInWhV1O1j3ZT0IwDQYJKoZIhvcNAQEL
-BQAwVjELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoM
-GEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDEPMA0GA1UEAwwGdGVzdGNhMB4XDTIw
-MDMxODAzMTA0MloXDTMwMDMxNjAzMTA0MlowZTELMAkGA1UEBhMCVVMxETAPBgNV
-BAgMCElsbGlub2lzMRAwDgYDVQQHDAdDaGljYWdvMRUwEwYDVQQKDAxFeGFtcGxl
-LCBDby4xGjAYBgNVBAMMESoudGVzdC5nb29nbGUuY29tMIIBIjANBgkqhkiG9w0B
-AQEFAAOCAQ8AMIIBCgKCAQEA5xOONxJJ8b8Qauvob5/7dPYZfIcd+uhAWL2ZlTPz
-Qvu4oF0QI4iYgP5iGgry9zEtCM+YQS8UhiAlPlqa6ANxgiBSEyMHH/xE8lo/+caY
-GeACqy640Jpl/JocFGo3xd1L8DCawjlaj6eu7T7T/tpAV2qq13b5710eNRbCAfFe
-8yALiGQemx0IYhlZXNbIGWLBNhBhvVjJh7UvOqpADk4xtl8o5j0xgMIRg6WJGK6c
-6ffSIg4eP1XmovNYZ9LLEJG68tF0Q/yIN43B4dt1oq4jzSdCbG4F1EiykT2TmwPV
-YDi8tml6DfOCDGnit8svnMEmBv/fcPd31GSbXjF8M+KGGQIDAQABo2swaTAJBgNV
-HRMEAjAAMAsGA1UdDwQEAwIF4DBPBgNVHREESDBGghAqLnRlc3QuZ29vZ2xlLmZy
-ghh3YXRlcnpvb2kudGVzdC5nb29nbGUuYmWCEioudGVzdC55b3V0dWJlLmNvbYcE
-wKgBAzANBgkqhkiG9w0BAQsFAAOCAQEAS8hDQA8PSgipgAml7Q3/djwQ644ghWQv
-C2Kb+r30RCY1EyKNhnQnIIh/OUbBZvh0M0iYsy6xqXgfDhCB93AA6j0i5cS8fkhH
-Jl4RK0tSkGQ3YNY4NzXwQP/vmUgfkw8VBAZ4Y4GKxppdATjffIW+srbAmdDruIRM
-wPeikgOoRrXf0LA1fi4TqxARzeRwenQpayNfGHTvVF9aJkl8HoaMunTAdG5pIVcr
-9GKi/gEMpXUJbbVv3U5frX1Wo4CFo+rZWJ/LyCMeb0jciNLxSdMwj/E/ZuExlyeZ
-gc9ctPjSMvgSyXEKv6Vwobleeg88V2ZgzenziORoWj4KszG/lbQZvg==
+MIIDtDCCApygAwIBAgIUbJfTREJ6k6/+oInWhV1O1j3ZT0IwDQYJKoZIhvcNAQEL
+BQAwVjELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoM
+GEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDEPMA0GA1UEAwwGdGVzdGNhMB4XDTIw
+MDMxODAzMTA0MloXDTMwMDMxNjAzMTA0MlowZTELMAkGA1UEBhMCVVMxETAPBgNV
+BAgMCElsbGlub2lzMRAwDgYDVQQHDAdDaGljYWdvMRUwEwYDVQQKDAxFeGFtcGxl
+LCBDby4xGjAYBgNVBAMMESoudGVzdC5nb29nbGUuY29tMIIBIjANBgkqhkiG9w0B
+AQEFAAOCAQ8AMIIBCgKCAQEA5xOONxJJ8b8Qauvob5/7dPYZfIcd+uhAWL2ZlTPz
+Qvu4oF0QI4iYgP5iGgry9zEtCM+YQS8UhiAlPlqa6ANxgiBSEyMHH/xE8lo/+caY
+GeACqy640Jpl/JocFGo3xd1L8DCawjlaj6eu7T7T/tpAV2qq13b5710eNRbCAfFe
+8yALiGQemx0IYhlZXNbIGWLBNhBhvVjJh7UvOqpADk4xtl8o5j0xgMIRg6WJGK6c
+6ffSIg4eP1XmovNYZ9LLEJG68tF0Q/yIN43B4dt1oq4jzSdCbG4F1EiykT2TmwPV
+YDi8tml6DfOCDGnit8svnMEmBv/fcPd31GSbXjF8M+KGGQIDAQABo2swaTAJBgNV
+HRMEAjAAMAsGA1UdDwQEAwIF4DBPBgNVHREESDBGghAqLnRlc3QuZ29vZ2xlLmZy
+ghh3YXRlcnpvb2kudGVzdC5nb29nbGUuYmWCEioudGVzdC55b3V0dWJlLmNvbYcE
+wKgBAzANBgkqhkiG9w0BAQsFAAOCAQEAS8hDQA8PSgipgAml7Q3/djwQ644ghWQv
+C2Kb+r30RCY1EyKNhnQnIIh/OUbBZvh0M0iYsy6xqXgfDhCB93AA6j0i5cS8fkhH
+Jl4RK0tSkGQ3YNY4NzXwQP/vmUgfkw8VBAZ4Y4GKxppdATjffIW+srbAmdDruIRM
+wPeikgOoRrXf0LA1fi4TqxARzeRwenQpayNfGHTvVF9aJkl8HoaMunTAdG5pIVcr
+9GKi/gEMpXUJbbVv3U5frX1Wo4CFo+rZWJ/LyCMeb0jciNLxSdMwj/E/ZuExlyeZ
+gc9ctPjSMvgSyXEKv6Vwobleeg88V2ZgzenziORoWj4KszG/lbQZvg==
-----END CERTIFICATE-----
diff --git a/contrib/libs/grpc/src/core/tsi/transport_security.cc b/contrib/libs/grpc/src/core/tsi/transport_security.cc
index 495d09856be..035e7cc5454 100644
--- a/contrib/libs/grpc/src/core/tsi/transport_security.cc
+++ b/contrib/libs/grpc/src/core/tsi/transport_security.cc
@@ -67,19 +67,19 @@ const char* tsi_result_to_string(tsi_result result) {
}
}
-const char* tsi_security_level_to_string(tsi_security_level security_level) {
- switch (security_level) {
- case TSI_SECURITY_NONE:
- return "TSI_SECURITY_NONE";
- case TSI_INTEGRITY_ONLY:
- return "TSI_INTEGRITY_ONLY";
- case TSI_PRIVACY_AND_INTEGRITY:
- return "TSI_PRIVACY_AND_INTEGRITY";
- default:
- return "UNKNOWN";
- }
-}
-
+const char* tsi_security_level_to_string(tsi_security_level security_level) {
+ switch (security_level) {
+ case TSI_SECURITY_NONE:
+ return "TSI_SECURITY_NONE";
+ case TSI_INTEGRITY_ONLY:
+ return "TSI_INTEGRITY_ONLY";
+ case TSI_PRIVACY_AND_INTEGRITY:
+ return "TSI_PRIVACY_AND_INTEGRITY";
+ default:
+ return "UNKNOWN";
+ }
+}
+
/* --- tsi_frame_protector common implementation. ---
Calls specific implementation after state/input validation. */
diff --git a/contrib/libs/grpc/src/core/tsi/transport_security_grpc.cc b/contrib/libs/grpc/src/core/tsi/transport_security_grpc.cc
index 9610b847433..cec872690de 100644
--- a/contrib/libs/grpc/src/core/tsi/transport_security_grpc.cc
+++ b/contrib/libs/grpc/src/core/tsi/transport_security_grpc.cc
@@ -66,8 +66,8 @@ void tsi_zero_copy_grpc_protector_destroy(tsi_zero_copy_grpc_protector* self) {
}
tsi_result tsi_zero_copy_grpc_protector_max_frame_size(
- tsi_zero_copy_grpc_protector* self, size_t* max_frame_size) {
- if (self == nullptr || max_frame_size == nullptr) return TSI_INVALID_ARGUMENT;
+ tsi_zero_copy_grpc_protector* self, size_t* max_frame_size) {
+ if (self == nullptr || max_frame_size == nullptr) return TSI_INVALID_ARGUMENT;
if (self->vtable->max_frame_size == nullptr) return TSI_UNIMPLEMENTED;
return self->vtable->max_frame_size(self, max_frame_size);
}
diff --git a/contrib/libs/grpc/src/core/tsi/transport_security_grpc.h b/contrib/libs/grpc/src/core/tsi/transport_security_grpc.h
index 59bb445bf2d..4779b686c66 100644
--- a/contrib/libs/grpc/src/core/tsi/transport_security_grpc.h
+++ b/contrib/libs/grpc/src/core/tsi/transport_security_grpc.h
@@ -58,7 +58,7 @@ void tsi_zero_copy_grpc_protector_destroy(tsi_zero_copy_grpc_protector* self);
/* Returns value of max protected frame size. Useful for testing. */
tsi_result tsi_zero_copy_grpc_protector_max_frame_size(
- tsi_zero_copy_grpc_protector* self, size_t* max_frame_size);
+ tsi_zero_copy_grpc_protector* self, size_t* max_frame_size);
/* Base for tsi_zero_copy_grpc_protector implementations. */
struct tsi_zero_copy_grpc_protector_vtable {
@@ -70,7 +70,7 @@ struct tsi_zero_copy_grpc_protector_vtable {
grpc_slice_buffer* unprotected_slices);
void (*destroy)(tsi_zero_copy_grpc_protector* self);
tsi_result (*max_frame_size)(tsi_zero_copy_grpc_protector* self,
- size_t* max_frame_size);
+ size_t* max_frame_size);
};
struct tsi_zero_copy_grpc_protector {
const tsi_zero_copy_grpc_protector_vtable* vtable;
diff --git a/contrib/libs/grpc/src/core/tsi/transport_security_interface.h b/contrib/libs/grpc/src/core/tsi/transport_security_interface.h
index 266cc31034a..4608f400914 100644
--- a/contrib/libs/grpc/src/core/tsi/transport_security_interface.h
+++ b/contrib/libs/grpc/src/core/tsi/transport_security_interface.h
@@ -44,18 +44,18 @@ typedef enum {
TSI_OUT_OF_RESOURCES = 12,
TSI_ASYNC = 13,
TSI_HANDSHAKE_SHUTDOWN = 14,
- TSI_CLOSE_NOTIFY = 15, // Indicates that the connection should be closed.
+ TSI_CLOSE_NOTIFY = 15, // Indicates that the connection should be closed.
} tsi_result;
typedef enum {
- TSI_SECURITY_MIN,
- TSI_SECURITY_NONE = TSI_SECURITY_MIN,
- TSI_INTEGRITY_ONLY,
- TSI_PRIVACY_AND_INTEGRITY,
- TSI_SECURITY_MAX = TSI_PRIVACY_AND_INTEGRITY,
-} tsi_security_level;
-
-typedef enum {
+ TSI_SECURITY_MIN,
+ TSI_SECURITY_NONE = TSI_SECURITY_MIN,
+ TSI_INTEGRITY_ONLY,
+ TSI_PRIVACY_AND_INTEGRITY,
+ TSI_SECURITY_MAX = TSI_PRIVACY_AND_INTEGRITY,
+} tsi_security_level;
+
+typedef enum {
// Default option
TSI_DONT_REQUEST_CLIENT_CERTIFICATE,
TSI_REQUEST_CLIENT_CERTIFICATE_BUT_DONT_VERIFY,
@@ -64,13 +64,13 @@ typedef enum {
TSI_REQUEST_AND_REQUIRE_CLIENT_CERTIFICATE_AND_VERIFY,
} tsi_client_certificate_request_type;
-typedef enum {
- TSI_TLS1_2,
- TSI_TLS1_3,
-} tsi_tls_version;
-
+typedef enum {
+ TSI_TLS1_2,
+ TSI_TLS1_3,
+} tsi_tls_version;
+
const char* tsi_result_to_string(tsi_result result);
-const char* tsi_security_level_to_string(tsi_security_level security_level);
+const char* tsi_security_level_to_string(tsi_security_level security_level);
/* --- tsi tracing --- */
@@ -200,9 +200,9 @@ void tsi_frame_protector_destroy(tsi_frame_protector* self);
/* This property is of type TSI_PEER_PROPERTY_STRING. */
#define TSI_CERTIFICATE_TYPE_PEER_PROPERTY "certificate_type"
-/* This property represents security level of a channel. */
-#define TSI_SECURITY_LEVEL_PEER_PROPERTY "security_level"
-
+/* This property represents security level of a channel. */
+#define TSI_SECURITY_LEVEL_PEER_PROPERTY "security_level"
+
/* Property values may contain NULL characters just like C++ strings.
The length field gives the length of the string. */
typedef struct tsi_peer_property {
diff --git a/contrib/libs/grpc/src/cpp/README.md b/contrib/libs/grpc/src/cpp/README.md
index 8fccf8c1ecd..967a0a43b7f 100755
--- a/contrib/libs/grpc/src/cpp/README.md
+++ b/contrib/libs/grpc/src/cpp/README.md
@@ -1,22 +1,22 @@
-# gRPC C++
+# gRPC C++
-This directory contains the C++ implementation of gRPC.
+This directory contains the C++ implementation of gRPC.
# To start using gRPC C++
-This section describes how to add gRPC as a dependency to your C++ project.
-
+This section describes how to add gRPC as a dependency to your C++ project.
+
In the C++ world, there's no universally accepted standard for managing project dependencies.
Therefore, gRPC supports several major build systems, which should satisfy most users.
-## Bazel
+## Bazel
-Bazel is the primary build system used by the core gRPC development team. Bazel
-provides fast builds and it easily handles dependencies that support bazel.
+Bazel is the primary build system used by the core gRPC development team. Bazel
+provides fast builds and it easily handles dependencies that support bazel.
To add gRPC as a dependency in bazel:
1. determine commit SHA for the grpc release you want to use
-2. Use the [http_archive](https://docs.bazel.build/versions/master/repo/http.html#http_archive) bazel rule to include gRPC source
+2. Use the [http_archive](https://docs.bazel.build/versions/master/repo/http.html#http_archive) bazel rule to include gRPC source
```
http_archive(
name = "com_github_grpc_grpc",
@@ -31,102 +31,102 @@ To add gRPC as a dependency in bazel:
grpc_deps()
```
-## CMake
-
-`cmake` is your best option if you cannot use bazel. It supports building on Linux,
-MacOS and Windows (official support) but also has a good chance of working on
-other platforms (no promises!). `cmake` has good support for crosscompiling and
-can be used for targeting the Android platform.
-
-To build gRPC C++ from source, follow the [BUILDING guide](../../BUILDING.md).
-
-### find_package
-
-The canonical way to discover dependencies in CMake is the
-[`find_package` command](https://cmake.org/cmake/help/latest/command/find_package.html).
-
-```cmake
-find_package(gRPC CONFIG REQUIRED)
-add_executable(my_exe my_exe.cc)
-target_link_libraries(my_exe gRPC::grpc++)
-```
-[Full example](../../examples/cpp/helloworld/CMakeLists.txt)
-
-`find_package` can only find software that has already been installed on your
-system. In practice that means you'll need to install gRPC using cmake first.
-gRPC's cmake support provides the option to install gRPC either system-wide
-(not recommended) or under a directory prefix in a way that you can later
-easily use it with the `find_package(gRPC CONFIG REQUIRED)` command.
-
-The following sections describe strategies to automatically build gRPC
-as part of your project.
-
-### FetchContent
-If you are using CMake v3.11 or newer you should use CMake's
-[FetchContent module](https://cmake.org/cmake/help/latest/module/FetchContent.html).
-The first time you run CMake in a given build directory, FetchContent will
-clone the gRPC repository and its submodules. `FetchContent_MakeAvailable()`
-also sets up an `add_subdirectory()` rule for you. This causes gRPC to be
-built as part of your project.
-
-```cmake
-cmake_minimum_required(VERSION 3.15)
-project(my_project)
-
-include(FetchContent)
-FetchContent_Declare(
- gRPC
- GIT_REPOSITORY https://github.com/grpc/grpc
- GIT_TAG RELEASE_TAG_HERE # e.g v1.28.0
-)
-set(FETCHCONTENT_QUIET OFF)
-FetchContent_MakeAvailable(gRPC)
-
-add_executable(my_exe my_exe.cc)
-target_link_libraries(my_exe grpc++)
-```
-
-Note that you need to
-[install the prerequisites](../../BUILDING.md#pre-requisites)
-before building gRPC.
-
-### git submodule
-If you cannot use FetchContent, another approach is to add the gRPC source tree
-to your project as a
-[git submodule](https://git-scm.com/book/en/v2/Git-Tools-Submodules).
-You can then add it to your CMake project with `add_subdirectory()`.
-[Example](../../examples/cpp/helloworld/CMakeLists.txt)
-
-### Support system-installed gRPC
-
-If your project builds gRPC you should still consider the case where a user
-wants to build your software using a previously installed gRPC. Here's a
-code snippet showing how this is typically done.
-
-```cmake
-option(USE_SYSTEM_GRPC "Use system installed gRPC" OFF)
-if(USE_SYSTEM_GRPC)
- # Find system-installed gRPC
- find_package(gRPC CONFIG REQUIRED)
-else()
- # Build gRPC using FetchContent or add_subdirectory
-endif()
-```
-
-[Full example](../../examples/cpp/helloworld/CMakeLists.txt)
-
-## pkg-config
-
-If your project does not use CMake (e.g. you're using `make` directly), you can
-first install gRPC C++ using CMake, and have your non-CMake project rely on the
-`pkgconfig` files which are provided by gRPC installation.
-[Example](../../test/distrib/cpp/run_distrib_test_cmake_pkgconfig.sh)
-
-## make (deprecated)
-
-The default choice for building on UNIX based systems used to be `make`, but we are no longer recommending it.
-You should use `bazel` or `cmake` instead.
-
+## CMake
+
+`cmake` is your best option if you cannot use bazel. It supports building on Linux,
+MacOS and Windows (official support) but also has a good chance of working on
+other platforms (no promises!). `cmake` has good support for crosscompiling and
+can be used for targeting the Android platform.
+
+To build gRPC C++ from source, follow the [BUILDING guide](../../BUILDING.md).
+
+### find_package
+
+The canonical way to discover dependencies in CMake is the
+[`find_package` command](https://cmake.org/cmake/help/latest/command/find_package.html).
+
+```cmake
+find_package(gRPC CONFIG REQUIRED)
+add_executable(my_exe my_exe.cc)
+target_link_libraries(my_exe gRPC::grpc++)
+```
+[Full example](../../examples/cpp/helloworld/CMakeLists.txt)
+
+`find_package` can only find software that has already been installed on your
+system. In practice that means you'll need to install gRPC using cmake first.
+gRPC's cmake support provides the option to install gRPC either system-wide
+(not recommended) or under a directory prefix in a way that you can later
+easily use it with the `find_package(gRPC CONFIG REQUIRED)` command.
+
+The following sections describe strategies to automatically build gRPC
+as part of your project.
+
+### FetchContent
+If you are using CMake v3.11 or newer you should use CMake's
+[FetchContent module](https://cmake.org/cmake/help/latest/module/FetchContent.html).
+The first time you run CMake in a given build directory, FetchContent will
+clone the gRPC repository and its submodules. `FetchContent_MakeAvailable()`
+also sets up an `add_subdirectory()` rule for you. This causes gRPC to be
+built as part of your project.
+
+```cmake
+cmake_minimum_required(VERSION 3.15)
+project(my_project)
+
+include(FetchContent)
+FetchContent_Declare(
+ gRPC
+ GIT_REPOSITORY https://github.com/grpc/grpc
+ GIT_TAG RELEASE_TAG_HERE # e.g v1.28.0
+)
+set(FETCHCONTENT_QUIET OFF)
+FetchContent_MakeAvailable(gRPC)
+
+add_executable(my_exe my_exe.cc)
+target_link_libraries(my_exe grpc++)
+```
+
+Note that you need to
+[install the prerequisites](../../BUILDING.md#pre-requisites)
+before building gRPC.
+
+### git submodule
+If you cannot use FetchContent, another approach is to add the gRPC source tree
+to your project as a
+[git submodule](https://git-scm.com/book/en/v2/Git-Tools-Submodules).
+You can then add it to your CMake project with `add_subdirectory()`.
+[Example](../../examples/cpp/helloworld/CMakeLists.txt)
+
+### Support system-installed gRPC
+
+If your project builds gRPC you should still consider the case where a user
+wants to build your software using a previously installed gRPC. Here's a
+code snippet showing how this is typically done.
+
+```cmake
+option(USE_SYSTEM_GRPC "Use system installed gRPC" OFF)
+if(USE_SYSTEM_GRPC)
+ # Find system-installed gRPC
+ find_package(gRPC CONFIG REQUIRED)
+else()
+ # Build gRPC using FetchContent or add_subdirectory
+endif()
+```
+
+[Full example](../../examples/cpp/helloworld/CMakeLists.txt)
+
+## pkg-config
+
+If your project does not use CMake (e.g. you're using `make` directly), you can
+first install gRPC C++ using CMake, and have your non-CMake project rely on the
+`pkgconfig` files which are provided by gRPC installation.
+[Example](../../test/distrib/cpp/run_distrib_test_cmake_pkgconfig.sh)
+
+## make (deprecated)
+
+The default choice for building on UNIX based systems used to be `make`, but we are no longer recommending it.
+You should use `bazel` or `cmake` instead.
+
To install gRPC for C++ on your system using `make`, follow the [Building gRPC C++](../../BUILDING.md)
instructions to build from source and then install locally using `make install`.
This also installs the protocol buffer compiler `protoc` (if you don't have it already),
@@ -165,12 +165,12 @@ You can find out how to build and run our simplest gRPC C++ example in our
For more detailed documentation on using gRPC in C++ , see our main
documentation site at [grpc.io](https://grpc.io), specifically:
-* [Overview](https://grpc.io/docs): An introduction to gRPC with a simple
+* [Overview](https://grpc.io/docs): An introduction to gRPC with a simple
Hello World example in all our supported languages, including C++.
-* [gRPC Basics - C++](https://grpc.io/docs/languages/cpp/basics):
+* [gRPC Basics - C++](https://grpc.io/docs/languages/cpp/basics):
A tutorial that steps you through creating a simple gRPC C++ example
application.
-* [Asynchronous Basics - C++](https://grpc.io/docs/languages/cpp/async):
+* [Asynchronous Basics - C++](https://grpc.io/docs/languages/cpp/async):
A tutorial that shows you how to use gRPC C++'s asynchronous/non-blocking
APIs.
diff --git a/contrib/libs/grpc/src/cpp/client/channel_cc.cc b/contrib/libs/grpc/src/cpp/client/channel_cc.cc
index 9e4a12edc71..ac95c29efcd 100644
--- a/contrib/libs/grpc/src/cpp/client/channel_cc.cc
+++ b/contrib/libs/grpc/src/cpp/client/channel_cc.cc
@@ -41,10 +41,10 @@
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/surface/completion_queue.h"
-namespace grpc {
+namespace grpc {
static ::grpc::internal::GrpcLibraryInitializer g_gli_initializer;
-Channel::Channel(const TString& host, grpc_channel* channel,
+Channel::Channel(const TString& host, grpc_channel* channel,
std::vector<std::unique_ptr<
::grpc::experimental::ClientInterceptorFactoryInterface>>
interceptor_creators)
@@ -63,31 +63,31 @@ Channel::~Channel() {
namespace {
inline grpc_slice SliceFromArray(const char* arr, size_t len) {
- return g_core_codegen_interface->grpc_slice_from_copied_buffer(arr, len);
+ return g_core_codegen_interface->grpc_slice_from_copied_buffer(arr, len);
}
-TString GetChannelInfoField(grpc_channel* channel,
- grpc_channel_info* channel_info,
- char*** channel_info_field) {
+TString GetChannelInfoField(grpc_channel* channel,
+ grpc_channel_info* channel_info,
+ char*** channel_info_field) {
char* value = nullptr;
memset(channel_info, 0, sizeof(*channel_info));
*channel_info_field = &value;
grpc_channel_get_info(channel, channel_info);
if (value == nullptr) return "";
- TString result = value;
+ TString result = value;
gpr_free(value);
return result;
}
} // namespace
-TString Channel::GetLoadBalancingPolicyName() const {
+TString Channel::GetLoadBalancingPolicyName() const {
grpc_channel_info channel_info;
return GetChannelInfoField(c_channel_, &channel_info,
&channel_info.lb_policy_name);
}
-TString Channel::GetServiceConfigJSON() const {
+TString Channel::GetServiceConfigJSON() const {
grpc_channel_info channel_info;
return GetChannelInfoField(c_channel_, &channel_info,
&channel_info.service_config_json);
@@ -112,7 +112,7 @@ void ChannelResetConnectionBackoff(Channel* channel) {
context->propagation_options_.c_bitmask(), cq->cq(),
method.channel_tag(), context->raw_deadline(), nullptr);
} else {
- const ::TString* host_str = nullptr;
+ const ::TString* host_str = nullptr;
if (!context->authority_.empty()) {
host_str = &context->authority_;
} else if (!host_.empty()) {
@@ -249,4 +249,4 @@ class ShutdownCallback : public grpc_experimental_completion_queue_functor {
return callback_cq_;
}
-} // namespace grpc
+} // namespace grpc
diff --git a/contrib/libs/grpc/src/cpp/client/client_callback.cc b/contrib/libs/grpc/src/cpp/client/client_callback.cc
index 286a57b589f..f4cbc97d34b 100644
--- a/contrib/libs/grpc/src/cpp/client/client_callback.cc
+++ b/contrib/libs/grpc/src/cpp/client/client_callback.cc
@@ -1,52 +1,52 @@
-/*
- * Copyright 2019 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <grpcpp/impl/codegen/client_callback.h>
-
-#include "src/core/lib/iomgr/closure.h"
-#include "src/core/lib/iomgr/exec_ctx.h"
-#include "src/core/lib/iomgr/executor.h"
-
-namespace grpc {
-namespace internal {
-
-void ClientReactor::InternalScheduleOnDone(grpc::Status s) {
- // Unlike other uses of closure, do not Ref or Unref here since the reactor
- // object's lifetime is controlled by user code.
- grpc_core::ExecCtx exec_ctx;
- struct ClosureWithArg {
- grpc_closure closure;
- ClientReactor* const reactor;
- const grpc::Status status;
- ClosureWithArg(ClientReactor* reactor_arg, grpc::Status s)
- : reactor(reactor_arg), status(std::move(s)) {
- GRPC_CLOSURE_INIT(&closure,
- [](void* void_arg, grpc_error*) {
- ClosureWithArg* arg =
- static_cast<ClosureWithArg*>(void_arg);
- arg->reactor->OnDone(arg->status);
- delete arg;
- },
- this, grpc_schedule_on_exec_ctx);
- }
- };
- ClosureWithArg* arg = new ClosureWithArg(this, std::move(s));
- grpc_core::Executor::Run(&arg->closure, GRPC_ERROR_NONE);
-}
-
-} // namespace internal
-} // namespace grpc
+/*
+ * Copyright 2019 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <grpcpp/impl/codegen/client_callback.h>
+
+#include "src/core/lib/iomgr/closure.h"
+#include "src/core/lib/iomgr/exec_ctx.h"
+#include "src/core/lib/iomgr/executor.h"
+
+namespace grpc {
+namespace internal {
+
+void ClientReactor::InternalScheduleOnDone(grpc::Status s) {
+ // Unlike other uses of closure, do not Ref or Unref here since the reactor
+ // object's lifetime is controlled by user code.
+ grpc_core::ExecCtx exec_ctx;
+ struct ClosureWithArg {
+ grpc_closure closure;
+ ClientReactor* const reactor;
+ const grpc::Status status;
+ ClosureWithArg(ClientReactor* reactor_arg, grpc::Status s)
+ : reactor(reactor_arg), status(std::move(s)) {
+ GRPC_CLOSURE_INIT(&closure,
+ [](void* void_arg, grpc_error*) {
+ ClosureWithArg* arg =
+ static_cast<ClosureWithArg*>(void_arg);
+ arg->reactor->OnDone(arg->status);
+ delete arg;
+ },
+ this, grpc_schedule_on_exec_ctx);
+ }
+ };
+ ClosureWithArg* arg = new ClosureWithArg(this, std::move(s));
+ grpc_core::Executor::Run(&arg->closure, GRPC_ERROR_NONE);
+}
+
+} // namespace internal
+} // namespace grpc
diff --git a/contrib/libs/grpc/src/cpp/client/client_context.cc b/contrib/libs/grpc/src/cpp/client/client_context.cc
index dacfa1e1ae6..b75343d0895 100644
--- a/contrib/libs/grpc/src/cpp/client/client_context.cc
+++ b/contrib/libs/grpc/src/cpp/client/client_context.cc
@@ -31,7 +31,7 @@
#include <grpcpp/server_context.h>
#include <grpcpp/support/time.h>
-namespace grpc {
+namespace grpc {
class Channel;
@@ -43,7 +43,7 @@ class DefaultGlobalClientCallbacks final
void Destructor(ClientContext* /*context*/) override {}
};
-static internal::GrpcLibraryInitializer g_gli_initializer;
+static internal::GrpcLibraryInitializer g_gli_initializer;
static DefaultGlobalClientCallbacks* g_default_client_callbacks =
new DefaultGlobalClientCallbacks();
static ClientContext::GlobalCallbacks* g_client_callbacks =
@@ -73,7 +73,7 @@ ClientContext::~ClientContext() {
}
void ClientContext::set_credentials(
- const std::shared_ptr<CallCredentials>& creds) {
+ const std::shared_ptr<CallCredentials>& creds) {
creds_ = creds;
// If call_ is set, we have already created the call, and set the call
// credentials. This should only be done before we have started the batch
@@ -89,32 +89,32 @@ void ClientContext::set_credentials(
}
std::unique_ptr<ClientContext> ClientContext::FromInternalServerContext(
- const grpc::ServerContextBase& context, PropagationOptions options) {
+ const grpc::ServerContextBase& context, PropagationOptions options) {
std::unique_ptr<ClientContext> ctx(new ClientContext);
- ctx->propagate_from_call_ = context.call_.call;
+ ctx->propagate_from_call_ = context.call_.call;
ctx->propagation_options_ = options;
return ctx;
}
std::unique_ptr<ClientContext> ClientContext::FromServerContext(
- const grpc::ServerContext& server_context, PropagationOptions options) {
+ const grpc::ServerContext& server_context, PropagationOptions options) {
return FromInternalServerContext(server_context, options);
}
std::unique_ptr<ClientContext> ClientContext::FromCallbackServerContext(
- const grpc::CallbackServerContext& server_context,
+ const grpc::CallbackServerContext& server_context,
PropagationOptions options) {
return FromInternalServerContext(server_context, options);
}
-void ClientContext::AddMetadata(const TString& meta_key,
- const TString& meta_value) {
+void ClientContext::AddMetadata(const TString& meta_key,
+ const TString& meta_value) {
send_initial_metadata_.insert(std::make_pair(meta_key, meta_value));
}
-void ClientContext::set_call(grpc_call* call,
- const std::shared_ptr<Channel>& channel) {
- internal::MutexLock lock(&mu_);
+void ClientContext::set_call(grpc_call* call,
+ const std::shared_ptr<Channel>& channel) {
+ internal::MutexLock lock(&mu_);
GPR_ASSERT(call_ == nullptr);
call_ = call;
channel_ = channel;
@@ -144,7 +144,7 @@ void ClientContext::set_compression_algorithm(
}
void ClientContext::TryCancel() {
- internal::MutexLock lock(&mu_);
+ internal::MutexLock lock(&mu_);
if (call_) {
SendCancelToInterceptors();
grpc_call_cancel(call_, nullptr);
@@ -154,14 +154,14 @@ void ClientContext::TryCancel() {
}
void ClientContext::SendCancelToInterceptors() {
- internal::CancelInterceptorBatchMethods cancel_methods;
+ internal::CancelInterceptorBatchMethods cancel_methods;
for (size_t i = 0; i < rpc_info_.interceptors_.size(); i++) {
rpc_info_.RunInterceptor(&cancel_methods, i);
}
}
-TString ClientContext::peer() const {
- TString peer;
+TString ClientContext::peer() const {
+ TString peer;
if (call_) {
char* c_peer = grpc_call_get_peer(call_);
peer = c_peer;
@@ -177,4 +177,4 @@ void ClientContext::SetGlobalCallbacks(GlobalCallbacks* client_callbacks) {
g_client_callbacks = client_callbacks;
}
-} // namespace grpc
+} // namespace grpc
diff --git a/contrib/libs/grpc/src/cpp/client/create_channel.cc b/contrib/libs/grpc/src/cpp/client/create_channel.cc
index 85ee6eeb44f..97327490ed2 100644
--- a/contrib/libs/grpc/src/cpp/client/create_channel.cc
+++ b/contrib/libs/grpc/src/cpp/client/create_channel.cc
@@ -26,14 +26,14 @@
#include "src/cpp/client/create_channel_internal.h"
-namespace grpc {
-std::shared_ptr<grpc::Channel> CreateChannel(
+namespace grpc {
+std::shared_ptr<grpc::Channel> CreateChannel(
const grpc::string& target,
const std::shared_ptr<grpc::ChannelCredentials>& creds) {
- return CreateCustomChannel(target, creds, grpc::ChannelArguments());
+ return CreateCustomChannel(target, creds, grpc::ChannelArguments());
}
-std::shared_ptr<grpc::Channel> CreateCustomChannel(
+std::shared_ptr<grpc::Channel> CreateCustomChannel(
const grpc::string& target,
const std::shared_ptr<grpc::ChannelCredentials>& creds,
const grpc::ChannelArguments& args) {
@@ -63,7 +63,7 @@ namespace experimental {
/// fail) is returned.
/// \param args Options for channel creation.
std::shared_ptr<grpc::Channel> CreateCustomChannelWithInterceptors(
- const TString& target,
+ const TString& target,
const std::shared_ptr<grpc::ChannelCredentials>& creds,
const grpc::ChannelArguments& args,
std::vector<
@@ -82,4 +82,4 @@ std::shared_ptr<grpc::Channel> CreateCustomChannelWithInterceptors(
}
} // namespace experimental
-} // namespace grpc
+} // namespace grpc
diff --git a/contrib/libs/grpc/src/cpp/client/create_channel_internal.cc b/contrib/libs/grpc/src/cpp/client/create_channel_internal.cc
index 325fde94218..da2a878a227 100644
--- a/contrib/libs/grpc/src/cpp/client/create_channel_internal.cc
+++ b/contrib/libs/grpc/src/cpp/client/create_channel_internal.cc
@@ -25,7 +25,7 @@ struct grpc_channel;
namespace grpc {
std::shared_ptr<Channel> CreateChannelInternal(
- const TString& host, grpc_channel* c_channel,
+ const TString& host, grpc_channel* c_channel,
std::vector<std::unique_ptr<
::grpc::experimental::ClientInterceptorFactoryInterface>>
interceptor_creators) {
diff --git a/contrib/libs/grpc/src/cpp/client/create_channel_internal.h b/contrib/libs/grpc/src/cpp/client/create_channel_internal.h
index cf94e169305..09d4e56b023 100644
--- a/contrib/libs/grpc/src/cpp/client/create_channel_internal.h
+++ b/contrib/libs/grpc/src/cpp/client/create_channel_internal.h
@@ -30,7 +30,7 @@ struct grpc_channel;
namespace grpc {
std::shared_ptr<Channel> CreateChannelInternal(
- const TString& host, grpc_channel* c_channel,
+ const TString& host, grpc_channel* c_channel,
std::vector<std::unique_ptr<
::grpc::experimental::ClientInterceptorFactoryInterface>>
interceptor_creators);
diff --git a/contrib/libs/grpc/src/cpp/client/create_channel_posix.cc b/contrib/libs/grpc/src/cpp/client/create_channel_posix.cc
index 55ec2b8f70c..db09eda8a66 100644
--- a/contrib/libs/grpc/src/cpp/client/create_channel_posix.cc
+++ b/contrib/libs/grpc/src/cpp/client/create_channel_posix.cc
@@ -24,39 +24,39 @@
#include "src/cpp/client/create_channel_internal.h"
-namespace grpc {
+namespace grpc {
class ChannelArguments;
#ifdef GPR_SUPPORT_CHANNELS_FROM_FD
-std::shared_ptr<Channel> CreateInsecureChannelFromFd(const TString& target,
- int fd) {
+std::shared_ptr<Channel> CreateInsecureChannelFromFd(const TString& target,
+ int fd) {
grpc::internal::GrpcLibrary init_lib;
init_lib.init();
- return CreateChannelInternal(
+ return CreateChannelInternal(
"", grpc_insecure_channel_create_from_fd(target.c_str(), fd, nullptr),
- std::vector<
- std::unique_ptr<experimental::ClientInterceptorFactoryInterface>>());
+ std::vector<
+ std::unique_ptr<experimental::ClientInterceptorFactoryInterface>>());
}
-std::shared_ptr<Channel> CreateCustomInsecureChannelFromFd(
- const TString& target, int fd, const grpc::ChannelArguments& args) {
- internal::GrpcLibrary init_lib;
+std::shared_ptr<Channel> CreateCustomInsecureChannelFromFd(
+ const TString& target, int fd, const grpc::ChannelArguments& args) {
+ internal::GrpcLibrary init_lib;
init_lib.init();
grpc_channel_args channel_args;
args.SetChannelArgs(&channel_args);
- return CreateChannelInternal(
+ return CreateChannelInternal(
"",
grpc_insecure_channel_create_from_fd(target.c_str(), fd, &channel_args),
- std::vector<
- std::unique_ptr<experimental::ClientInterceptorFactoryInterface>>());
+ std::vector<
+ std::unique_ptr<experimental::ClientInterceptorFactoryInterface>>());
}
namespace experimental {
-std::shared_ptr<Channel> CreateCustomInsecureChannelWithInterceptorsFromFd(
- const TString& target, int fd, const ChannelArguments& args,
+std::shared_ptr<Channel> CreateCustomInsecureChannelWithInterceptorsFromFd(
+ const TString& target, int fd, const ChannelArguments& args,
std::vector<
std::unique_ptr<grpc::experimental::ClientInterceptorFactoryInterface>>
interceptor_creators) {
@@ -64,7 +64,7 @@ std::shared_ptr<Channel> CreateCustomInsecureChannelWithInterceptorsFromFd(
init_lib.init();
grpc_channel_args channel_args;
args.SetChannelArgs(&channel_args);
- return CreateChannelInternal(
+ return CreateChannelInternal(
"",
grpc_insecure_channel_create_from_fd(target.c_str(), fd, &channel_args),
std::move(interceptor_creators));
@@ -74,4 +74,4 @@ std::shared_ptr<Channel> CreateCustomInsecureChannelWithInterceptorsFromFd(
#endif // GPR_SUPPORT_CHANNELS_FROM_FD
-} // namespace grpc
+} // namespace grpc
diff --git a/contrib/libs/grpc/src/cpp/client/credentials_cc.cc b/contrib/libs/grpc/src/cpp/client/credentials_cc.cc
index 07f0f598d6e..9dfb2f491ca 100644
--- a/contrib/libs/grpc/src/cpp/client/credentials_cc.cc
+++ b/contrib/libs/grpc/src/cpp/client/credentials_cc.cc
@@ -19,7 +19,7 @@
#include <grpcpp/impl/grpc_library.h>
#include <grpcpp/security/credentials.h>
-namespace grpc {
+namespace grpc {
static grpc::internal::GrpcLibraryInitializer g_gli_initializer;
ChannelCredentials::ChannelCredentials() { g_gli_initializer.summon(); }
@@ -30,4 +30,4 @@ CallCredentials::CallCredentials() { g_gli_initializer.summon(); }
CallCredentials::~CallCredentials() {}
-} // namespace grpc
+} // namespace grpc
diff --git a/contrib/libs/grpc/src/cpp/client/insecure_credentials.cc b/contrib/libs/grpc/src/cpp/client/insecure_credentials.cc
index f8fa5b39c2f..e5bafff70af 100644
--- a/contrib/libs/grpc/src/cpp/client/insecure_credentials.cc
+++ b/contrib/libs/grpc/src/cpp/client/insecure_credentials.cc
@@ -24,13 +24,13 @@
#include <grpcpp/support/config.h>
#include "src/cpp/client/create_channel_internal.h"
-namespace grpc {
+namespace grpc {
namespace {
class InsecureChannelCredentialsImpl final : public ChannelCredentials {
public:
std::shared_ptr<Channel> CreateChannelImpl(
- const TString& target, const ChannelArguments& args) override {
+ const TString& target, const ChannelArguments& args) override {
return CreateChannelWithInterceptors(
target, args,
std::vector<std::unique_ptr<
@@ -38,7 +38,7 @@ class InsecureChannelCredentialsImpl final : public ChannelCredentials {
}
std::shared_ptr<Channel> CreateChannelWithInterceptors(
- const TString& target, const ChannelArguments& args,
+ const TString& target, const ChannelArguments& args,
std::vector<std::unique_ptr<
grpc::experimental::ClientInterceptorFactoryInterface>>
interceptor_creators) override {
@@ -59,4 +59,4 @@ std::shared_ptr<ChannelCredentials> InsecureChannelCredentials() {
new InsecureChannelCredentialsImpl());
}
-} // namespace grpc
+} // namespace grpc
diff --git a/contrib/libs/grpc/src/cpp/client/secure_credentials.cc b/contrib/libs/grpc/src/cpp/client/secure_credentials.cc
index dc613907b47..0f6db3caa53 100644
--- a/contrib/libs/grpc/src/cpp/client/secure_credentials.cc
+++ b/contrib/libs/grpc/src/cpp/client/secure_credentials.cc
@@ -20,7 +20,7 @@
#include <grpc/impl/codegen/slice.h>
#include <grpc/slice.h>
-#include <grpc/support/alloc.h>
+#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
#include <grpcpp/channel.h>
@@ -38,7 +38,7 @@
#include "src/cpp/client/create_channel_internal.h"
#include "src/cpp/common/secure_auth_context.h"
-namespace grpc {
+namespace grpc {
static grpc::internal::GrpcLibraryInitializer g_gli_initializer;
SecureChannelCredentials::SecureChannelCredentials(
@@ -48,7 +48,7 @@ SecureChannelCredentials::SecureChannelCredentials(
}
std::shared_ptr<Channel> SecureChannelCredentials::CreateChannelImpl(
- const TString& target, const ChannelArguments& args) {
+ const TString& target, const ChannelArguments& args) {
return CreateChannelWithInterceptors(
target, args,
std::vector<std::unique_ptr<
@@ -57,7 +57,7 @@ std::shared_ptr<Channel> SecureChannelCredentials::CreateChannelImpl(
std::shared_ptr<Channel>
SecureChannelCredentials::CreateChannelWithInterceptors(
- const TString& target, const ChannelArguments& args,
+ const TString& target, const ChannelArguments& args,
std::vector<
std::unique_ptr<grpc::experimental::ClientInterceptorFactoryInterface>>
interceptor_creators) {
@@ -97,8 +97,8 @@ std::shared_ptr<CallCredentials> WrapCallCredentials(
std::shared_ptr<ChannelCredentials> GoogleDefaultCredentials() {
grpc::GrpcLibraryCodegen init; // To call grpc_init().
- return WrapChannelCredentials(
- grpc_google_default_credentials_create(nullptr));
+ return WrapChannelCredentials(
+ grpc_google_default_credentials_create(nullptr));
}
// Builds SSL Credentials given SSL specific options
@@ -135,38 +135,38 @@ void ClearStsCredentialsOptions(StsCredentialsOptions* options) {
} // namespace
// Builds STS credentials options from JSON.
-grpc::Status StsCredentialsOptionsFromJson(const TString& json_string,
+grpc::Status StsCredentialsOptionsFromJson(const TString& json_string,
StsCredentialsOptions* options) {
if (options == nullptr) {
return grpc::Status(grpc::StatusCode::INVALID_ARGUMENT,
"options cannot be nullptr.");
}
ClearStsCredentialsOptions(options);
- grpc_error* error = GRPC_ERROR_NONE;
- grpc_core::Json json = grpc_core::Json::Parse(json_string.c_str(), &error);
- if (error != GRPC_ERROR_NONE ||
- json.type() != grpc_core::Json::Type::OBJECT) {
- GRPC_ERROR_UNREF(error);
+ grpc_error* error = GRPC_ERROR_NONE;
+ grpc_core::Json json = grpc_core::Json::Parse(json_string.c_str(), &error);
+ if (error != GRPC_ERROR_NONE ||
+ json.type() != grpc_core::Json::Type::OBJECT) {
+ GRPC_ERROR_UNREF(error);
return grpc::Status(grpc::StatusCode::INVALID_ARGUMENT, "Invalid json.");
}
// Required fields.
const char* value = grpc_json_get_string_property(
- json, "token_exchange_service_uri", nullptr);
+ json, "token_exchange_service_uri", nullptr);
if (value == nullptr) {
ClearStsCredentialsOptions(options);
return grpc::Status(grpc::StatusCode::INVALID_ARGUMENT,
"token_exchange_service_uri must be specified.");
}
options->token_exchange_service_uri.assign(value);
- value = grpc_json_get_string_property(json, "subject_token_path", nullptr);
+ value = grpc_json_get_string_property(json, "subject_token_path", nullptr);
if (value == nullptr) {
ClearStsCredentialsOptions(options);
return grpc::Status(grpc::StatusCode::INVALID_ARGUMENT,
"subject_token_path must be specified.");
}
options->subject_token_path.assign(value);
- value = grpc_json_get_string_property(json, "subject_token_type", nullptr);
+ value = grpc_json_get_string_property(json, "subject_token_type", nullptr);
if (value == nullptr) {
ClearStsCredentialsOptions(options);
return grpc::Status(grpc::StatusCode::INVALID_ARGUMENT,
@@ -175,17 +175,17 @@ grpc::Status StsCredentialsOptionsFromJson(const TString& json_string,
options->subject_token_type.assign(value);
// Optional fields.
- value = grpc_json_get_string_property(json, "resource", nullptr);
+ value = grpc_json_get_string_property(json, "resource", nullptr);
if (value != nullptr) options->resource.assign(value);
- value = grpc_json_get_string_property(json, "audience", nullptr);
+ value = grpc_json_get_string_property(json, "audience", nullptr);
if (value != nullptr) options->audience.assign(value);
- value = grpc_json_get_string_property(json, "scope", nullptr);
+ value = grpc_json_get_string_property(json, "scope", nullptr);
if (value != nullptr) options->scope.assign(value);
- value = grpc_json_get_string_property(json, "requested_token_type", nullptr);
+ value = grpc_json_get_string_property(json, "requested_token_type", nullptr);
if (value != nullptr) options->requested_token_type.assign(value);
- value = grpc_json_get_string_property(json, "actor_token_path", nullptr);
+ value = grpc_json_get_string_property(json, "actor_token_path", nullptr);
if (value != nullptr) options->actor_token_path.assign(value);
- value = grpc_json_get_string_property(json, "actor_token_type", nullptr);
+ value = grpc_json_get_string_property(json, "actor_token_type", nullptr);
if (value != nullptr) options->actor_token_type.assign(value);
return grpc::Status();
@@ -250,21 +250,21 @@ std::shared_ptr<CallCredentials> StsCredentials(
return WrapCallCredentials(grpc_sts_credentials_create(&opts, nullptr));
}
-std::shared_ptr<CallCredentials> MetadataCredentialsFromPlugin(
- std::unique_ptr<MetadataCredentialsPlugin> plugin,
- grpc_security_level min_security_level) {
- grpc::GrpcLibraryCodegen init; // To call grpc_init().
- const char* type = plugin->GetType();
- grpc::MetadataCredentialsPluginWrapper* wrapper =
- new grpc::MetadataCredentialsPluginWrapper(std::move(plugin));
- grpc_metadata_credentials_plugin c_plugin = {
- grpc::MetadataCredentialsPluginWrapper::GetMetadata,
- grpc::MetadataCredentialsPluginWrapper::DebugString,
- grpc::MetadataCredentialsPluginWrapper::Destroy, wrapper, type};
- return WrapCallCredentials(grpc_metadata_credentials_create_from_plugin(
- c_plugin, min_security_level, nullptr));
-}
-
+std::shared_ptr<CallCredentials> MetadataCredentialsFromPlugin(
+ std::unique_ptr<MetadataCredentialsPlugin> plugin,
+ grpc_security_level min_security_level) {
+ grpc::GrpcLibraryCodegen init; // To call grpc_init().
+ const char* type = plugin->GetType();
+ grpc::MetadataCredentialsPluginWrapper* wrapper =
+ new grpc::MetadataCredentialsPluginWrapper(std::move(plugin));
+ grpc_metadata_credentials_plugin c_plugin = {
+ grpc::MetadataCredentialsPluginWrapper::GetMetadata,
+ grpc::MetadataCredentialsPluginWrapper::DebugString,
+ grpc::MetadataCredentialsPluginWrapper::Destroy, wrapper, type};
+ return WrapCallCredentials(grpc_metadata_credentials_create_from_plugin(
+ c_plugin, min_security_level, nullptr));
+}
+
// Builds ALTS Credentials given ALTS specific options
std::shared_ptr<ChannelCredentials> AltsCredentials(
const AltsCredentialsOptions& options) {
@@ -291,7 +291,7 @@ std::shared_ptr<ChannelCredentials> LocalCredentials(
std::shared_ptr<ChannelCredentials> TlsCredentials(
const TlsCredentialsOptions& options) {
return WrapChannelCredentials(
- grpc_tls_credentials_create(options.c_credentials_options()));
+ grpc_tls_credentials_create(options.c_credentials_options()));
}
} // namespace experimental
@@ -305,7 +305,7 @@ std::shared_ptr<CallCredentials> GoogleComputeEngineCredentials() {
// Builds JWT credentials.
std::shared_ptr<CallCredentials> ServiceAccountJWTAccessCredentials(
- const TString& json_key, long token_lifetime_seconds) {
+ const TString& json_key, long token_lifetime_seconds) {
grpc::GrpcLibraryCodegen init; // To call grpc_init().
if (token_lifetime_seconds <= 0) {
gpr_log(GPR_ERROR,
@@ -320,7 +320,7 @@ std::shared_ptr<CallCredentials> ServiceAccountJWTAccessCredentials(
// Builds refresh token credentials.
std::shared_ptr<CallCredentials> GoogleRefreshTokenCredentials(
- const TString& json_refresh_token) {
+ const TString& json_refresh_token) {
grpc::GrpcLibraryCodegen init; // To call grpc_init().
return WrapCallCredentials(grpc_google_refresh_token_credentials_create(
json_refresh_token.c_str(), nullptr));
@@ -328,7 +328,7 @@ std::shared_ptr<CallCredentials> GoogleRefreshTokenCredentials(
// Builds access token credentials.
std::shared_ptr<CallCredentials> AccessTokenCredentials(
- const TString& access_token) {
+ const TString& access_token) {
grpc::GrpcLibraryCodegen init; // To call grpc_init().
return WrapCallCredentials(
grpc_access_token_credentials_create(access_token.c_str(), nullptr));
@@ -336,8 +336,8 @@ std::shared_ptr<CallCredentials> AccessTokenCredentials(
// Builds IAM credentials.
std::shared_ptr<CallCredentials> GoogleIAMCredentials(
- const TString& authorization_token,
- const TString& authority_selector) {
+ const TString& authorization_token,
+ const TString& authority_selector) {
grpc::GrpcLibraryCodegen init; // To call grpc_init().
return WrapCallCredentials(grpc_google_iam_credentials_create(
authorization_token.c_str(), authority_selector.c_str(), nullptr));
@@ -382,10 +382,10 @@ std::shared_ptr<CallCredentials> MetadataCredentialsFromPlugin(
new grpc::MetadataCredentialsPluginWrapper(std::move(plugin));
grpc_metadata_credentials_plugin c_plugin = {
grpc::MetadataCredentialsPluginWrapper::GetMetadata,
- grpc::MetadataCredentialsPluginWrapper::DebugString,
+ grpc::MetadataCredentialsPluginWrapper::DebugString,
grpc::MetadataCredentialsPluginWrapper::Destroy, wrapper, type};
- return WrapCallCredentials(grpc_metadata_credentials_create_from_plugin(
- c_plugin, GRPC_PRIVACY_AND_INTEGRITY, nullptr));
+ return WrapCallCredentials(grpc_metadata_credentials_create_from_plugin(
+ c_plugin, GRPC_PRIVACY_AND_INTEGRITY, nullptr));
}
namespace {
@@ -396,13 +396,13 @@ void DeleteWrapper(void* wrapper, grpc_error* /*ignored*/) {
}
} // namespace
-char* MetadataCredentialsPluginWrapper::DebugString(void* wrapper) {
- GPR_ASSERT(wrapper);
- MetadataCredentialsPluginWrapper* w =
- static_cast<MetadataCredentialsPluginWrapper*>(wrapper);
- return gpr_strdup(w->plugin_->DebugString().c_str());
-}
-
+char* MetadataCredentialsPluginWrapper::DebugString(void* wrapper) {
+ GPR_ASSERT(wrapper);
+ MetadataCredentialsPluginWrapper* w =
+ static_cast<MetadataCredentialsPluginWrapper*>(wrapper);
+ return gpr_strdup(w->plugin_->DebugString().c_str());
+}
+
void MetadataCredentialsPluginWrapper::Destroy(void* wrapper) {
if (wrapper == nullptr) return;
grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
@@ -461,7 +461,7 @@ void MetadataCredentialsPluginWrapper::InvokePlugin(
grpc_auth_metadata_context context, grpc_credentials_plugin_metadata_cb cb,
void* user_data, grpc_metadata creds_md[4], size_t* num_creds_md,
grpc_status_code* status_code, const char** error_details) {
- std::multimap<TString, TString> metadata;
+ std::multimap<TString, TString> metadata;
// const_cast is safe since the SecureAuthContext only inc/dec the refcount
// and the object is passed as a const ref to plugin_->GetMetadata.
diff --git a/contrib/libs/grpc/src/cpp/client/secure_credentials.h b/contrib/libs/grpc/src/cpp/client/secure_credentials.h
index 7c02e22852b..4fc79346bf4 100644
--- a/contrib/libs/grpc/src/cpp/client/secure_credentials.h
+++ b/contrib/libs/grpc/src/cpp/client/secure_credentials.h
@@ -25,11 +25,11 @@
#include <grpcpp/security/tls_credentials_options.h>
#include <grpcpp/support/config.h>
-#include "y_absl/strings/str_cat.h"
+#include "y_absl/strings/str_cat.h"
#include "src/core/lib/security/credentials/credentials.h"
#include "src/cpp/server/thread_pool_interface.h"
-namespace grpc {
+namespace grpc {
class Channel;
@@ -42,13 +42,13 @@ class SecureChannelCredentials final : public ChannelCredentials {
grpc_channel_credentials* GetRawCreds() { return c_creds_; }
std::shared_ptr<Channel> CreateChannelImpl(
- const TString& target, const ChannelArguments& args) override;
+ const TString& target, const ChannelArguments& args) override;
SecureChannelCredentials* AsSecureCredentials() override { return this; }
private:
std::shared_ptr<Channel> CreateChannelWithInterceptors(
- const TString& target, const ChannelArguments& args,
+ const TString& target, const ChannelArguments& args,
std::vector<std::unique_ptr<
::grpc::experimental::ClientInterceptorFactoryInterface>>
interceptor_creators) override;
@@ -65,10 +65,10 @@ class SecureCallCredentials final : public CallCredentials {
bool ApplyToCall(grpc_call* call) override;
SecureCallCredentials* AsSecureCredentials() override { return this; }
- TString DebugString() override {
- return y_absl::StrCat("SecureCallCredentials{",
- TString(c_creds_->debug_string()), "}");
- }
+ TString DebugString() override {
+ return y_absl::StrCat("SecureCallCredentials{",
+ TString(c_creds_->debug_string()), "}");
+ }
private:
grpc_call_credentials* const c_creds_;
@@ -93,7 +93,7 @@ class MetadataCredentialsPluginWrapper final : private GrpcLibraryCodegen {
grpc_metadata creds_md[GRPC_METADATA_CREDENTIALS_PLUGIN_SYNC_MAX],
size_t* num_creds_md, grpc_status_code* status,
const char** error_details);
- static char* DebugString(void* wrapper);
+ static char* DebugString(void* wrapper);
explicit MetadataCredentialsPluginWrapper(
std::unique_ptr<MetadataCredentialsPlugin> plugin);
diff --git a/contrib/libs/grpc/src/cpp/common/.yandex_meta/licenses.list.txt b/contrib/libs/grpc/src/cpp/common/.yandex_meta/licenses.list.txt
index 3649cb84cdf..a5d42d5b53e 100644
--- a/contrib/libs/grpc/src/cpp/common/.yandex_meta/licenses.list.txt
+++ b/contrib/libs/grpc/src/cpp/common/.yandex_meta/licenses.list.txt
@@ -1,28 +1,28 @@
-====================Apache-2.0====================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
-
-
-====================COPYRIGHT====================
- * Copyright 2015 gRPC authors.
-
-
-====================COPYRIGHT====================
- * Copyright 2016 gRPC authors.
-
-
-====================COPYRIGHT====================
- * Copyright 2018 gRPC authors.
-
-
-====================COPYRIGHT====================
-# Copyright 2019 gRPC authors.
+====================Apache-2.0====================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+
+
+====================COPYRIGHT====================
+ * Copyright 2015 gRPC authors.
+
+
+====================COPYRIGHT====================
+ * Copyright 2016 gRPC authors.
+
+
+====================COPYRIGHT====================
+ * Copyright 2018 gRPC authors.
+
+
+====================COPYRIGHT====================
+# Copyright 2019 gRPC authors.
diff --git a/contrib/libs/grpc/src/cpp/common/alarm.cc b/contrib/libs/grpc/src/cpp/common/alarm.cc
index 62c83f1bb23..a2612874b20 100644
--- a/contrib/libs/grpc/src/cpp/common/alarm.cc
+++ b/contrib/libs/grpc/src/cpp/common/alarm.cc
@@ -25,14 +25,14 @@
#include <grpcpp/impl/grpc_library.h>
#include <grpcpp/support/time.h>
#include "src/core/lib/iomgr/exec_ctx.h"
-#include "src/core/lib/iomgr/executor.h"
+#include "src/core/lib/iomgr/executor.h"
#include "src/core/lib/iomgr/timer.h"
#include "src/core/lib/surface/completion_queue.h"
#include <grpc/support/log.h>
#include "src/core/lib/debug/trace.h"
-namespace grpc {
+namespace grpc {
namespace internal {
class AlarmImpl : public ::grpc::internal::CompletionQueueTag {
@@ -82,16 +82,16 @@ class AlarmImpl : public ::grpc::internal::CompletionQueueTag {
Ref();
GRPC_CLOSURE_INIT(&on_alarm_,
[](void* arg, grpc_error* error) {
- grpc_core::Executor::Run(
- GRPC_CLOSURE_CREATE(
- [](void* arg, grpc_error* error) {
- AlarmImpl* alarm =
- static_cast<AlarmImpl*>(arg);
- alarm->callback_(error == GRPC_ERROR_NONE);
- alarm->Unref();
- },
- arg, nullptr),
- error);
+ grpc_core::Executor::Run(
+ GRPC_CLOSURE_CREATE(
+ [](void* arg, grpc_error* error) {
+ AlarmImpl* alarm =
+ static_cast<AlarmImpl*>(arg);
+ alarm->callback_(error == GRPC_ERROR_NONE);
+ alarm->Unref();
+ },
+ arg, nullptr),
+ error);
},
this, grpc_schedule_on_exec_ctx);
grpc_timer_init(&timer_, grpc_timespec_to_millis_round_up(deadline),
@@ -158,4 +158,4 @@ Alarm::~Alarm() {
}
void Alarm::Cancel() { static_cast<internal::AlarmImpl*>(alarm_)->Cancel(); }
-} // namespace grpc
+} // namespace grpc
diff --git a/contrib/libs/grpc/src/cpp/common/alts_context.cc b/contrib/libs/grpc/src/cpp/common/alts_context.cc
index eea14fbc803..31f0f083ef0 100644
--- a/contrib/libs/grpc/src/cpp/common/alts_context.cc
+++ b/contrib/libs/grpc/src/cpp/common/alts_context.cc
@@ -1,127 +1,127 @@
-/*
- *
- * Copyright 2019 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <grpc/grpc_security.h>
-#include <grpcpp/security/alts_context.h>
-
-#include "src/core/tsi/alts/handshaker/alts_tsi_handshaker.h"
-#include "src/proto/grpc/gcp/altscontext.upb.h"
-
-namespace grpc {
-namespace experimental {
-
-// A upb-generated grpc_gcp_AltsContext is passed in to construct an
-// AltsContext. Normal users should use GetAltsContextFromAuthContext to get
-// AltsContext, instead of constructing their own.
-AltsContext::AltsContext(const grpc_gcp_AltsContext* ctx) {
- upb_strview application_protocol =
- grpc_gcp_AltsContext_application_protocol(ctx);
- if (application_protocol.data != nullptr && application_protocol.size > 0) {
- application_protocol_ =
- TString(application_protocol.data, application_protocol.size);
- }
- upb_strview record_protocol = grpc_gcp_AltsContext_record_protocol(ctx);
- if (record_protocol.data != nullptr && record_protocol.size > 0) {
- record_protocol_ = TString(record_protocol.data, record_protocol.size);
- }
- upb_strview peer_service_account =
- grpc_gcp_AltsContext_peer_service_account(ctx);
- if (peer_service_account.data != nullptr && peer_service_account.size > 0) {
- peer_service_account_ =
- TString(peer_service_account.data, peer_service_account.size);
- }
- upb_strview local_service_account =
- grpc_gcp_AltsContext_local_service_account(ctx);
- if (local_service_account.data != nullptr && local_service_account.size > 0) {
- local_service_account_ =
- TString(local_service_account.data, local_service_account.size);
- }
- const grpc_gcp_RpcProtocolVersions* versions =
- grpc_gcp_AltsContext_peer_rpc_versions(ctx);
- if (versions != nullptr) {
- const grpc_gcp_RpcProtocolVersions_Version* max_version =
- grpc_gcp_RpcProtocolVersions_max_rpc_version(versions);
- if (max_version != nullptr) {
- int max_version_major =
- grpc_gcp_RpcProtocolVersions_Version_major(max_version);
- int max_version_minor =
- grpc_gcp_RpcProtocolVersions_Version_minor(max_version);
- peer_rpc_versions_.max_rpc_version.major_version = max_version_major;
- peer_rpc_versions_.max_rpc_version.minor_version = max_version_minor;
- }
- const grpc_gcp_RpcProtocolVersions_Version* min_version =
- grpc_gcp_RpcProtocolVersions_min_rpc_version(versions);
- if (min_version != nullptr) {
- int min_version_major =
- grpc_gcp_RpcProtocolVersions_Version_major(min_version);
- int min_version_minor =
- grpc_gcp_RpcProtocolVersions_Version_minor(min_version);
- peer_rpc_versions_.min_rpc_version.major_version = min_version_major;
- peer_rpc_versions_.min_rpc_version.minor_version = min_version_minor;
- }
- }
- if (grpc_gcp_AltsContext_security_level(ctx) >= GRPC_SECURITY_MIN ||
- grpc_gcp_AltsContext_security_level(ctx) <= GRPC_SECURITY_MAX) {
- security_level_ = static_cast<grpc_security_level>(
- grpc_gcp_AltsContext_security_level(ctx));
- }
- if (grpc_gcp_AltsContext_has_peer_attributes(ctx)) {
- size_t iter = UPB_MAP_BEGIN;
- const grpc_gcp_AltsContext_PeerAttributesEntry* peer_attributes_entry =
- grpc_gcp_AltsContext_peer_attributes_next(ctx, &iter);
- while (peer_attributes_entry != nullptr) {
- upb_strview key =
- grpc_gcp_AltsContext_PeerAttributesEntry_key(peer_attributes_entry);
- upb_strview val =
- grpc_gcp_AltsContext_PeerAttributesEntry_value(peer_attributes_entry);
- peer_attributes_map_[TString(key.data, key.size)] =
- TString(val.data, val.size);
- peer_attributes_entry =
- grpc_gcp_AltsContext_peer_attributes_next(ctx, &iter);
- }
- }
-}
-
-TString AltsContext::application_protocol() const {
- return application_protocol_;
-}
-
-TString AltsContext::record_protocol() const { return record_protocol_; }
-
-TString AltsContext::peer_service_account() const {
- return peer_service_account_;
-}
-
-TString AltsContext::local_service_account() const {
- return local_service_account_;
-}
-
-grpc_security_level AltsContext::security_level() const {
- return security_level_;
-}
-
-AltsContext::RpcProtocolVersions AltsContext::peer_rpc_versions() const {
- return peer_rpc_versions_;
-}
-
-const std::map<TString, TString>& AltsContext::peer_attributes() const {
- return peer_attributes_map_;
-}
-
-} // namespace experimental
-} // namespace grpc
+/*
+ *
+ * Copyright 2019 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <grpc/grpc_security.h>
+#include <grpcpp/security/alts_context.h>
+
+#include "src/core/tsi/alts/handshaker/alts_tsi_handshaker.h"
+#include "src/proto/grpc/gcp/altscontext.upb.h"
+
+namespace grpc {
+namespace experimental {
+
+// A upb-generated grpc_gcp_AltsContext is passed in to construct an
+// AltsContext. Normal users should use GetAltsContextFromAuthContext to get
+// AltsContext, instead of constructing their own.
+AltsContext::AltsContext(const grpc_gcp_AltsContext* ctx) {
+ upb_strview application_protocol =
+ grpc_gcp_AltsContext_application_protocol(ctx);
+ if (application_protocol.data != nullptr && application_protocol.size > 0) {
+ application_protocol_ =
+ TString(application_protocol.data, application_protocol.size);
+ }
+ upb_strview record_protocol = grpc_gcp_AltsContext_record_protocol(ctx);
+ if (record_protocol.data != nullptr && record_protocol.size > 0) {
+ record_protocol_ = TString(record_protocol.data, record_protocol.size);
+ }
+ upb_strview peer_service_account =
+ grpc_gcp_AltsContext_peer_service_account(ctx);
+ if (peer_service_account.data != nullptr && peer_service_account.size > 0) {
+ peer_service_account_ =
+ TString(peer_service_account.data, peer_service_account.size);
+ }
+ upb_strview local_service_account =
+ grpc_gcp_AltsContext_local_service_account(ctx);
+ if (local_service_account.data != nullptr && local_service_account.size > 0) {
+ local_service_account_ =
+ TString(local_service_account.data, local_service_account.size);
+ }
+ const grpc_gcp_RpcProtocolVersions* versions =
+ grpc_gcp_AltsContext_peer_rpc_versions(ctx);
+ if (versions != nullptr) {
+ const grpc_gcp_RpcProtocolVersions_Version* max_version =
+ grpc_gcp_RpcProtocolVersions_max_rpc_version(versions);
+ if (max_version != nullptr) {
+ int max_version_major =
+ grpc_gcp_RpcProtocolVersions_Version_major(max_version);
+ int max_version_minor =
+ grpc_gcp_RpcProtocolVersions_Version_minor(max_version);
+ peer_rpc_versions_.max_rpc_version.major_version = max_version_major;
+ peer_rpc_versions_.max_rpc_version.minor_version = max_version_minor;
+ }
+ const grpc_gcp_RpcProtocolVersions_Version* min_version =
+ grpc_gcp_RpcProtocolVersions_min_rpc_version(versions);
+ if (min_version != nullptr) {
+ int min_version_major =
+ grpc_gcp_RpcProtocolVersions_Version_major(min_version);
+ int min_version_minor =
+ grpc_gcp_RpcProtocolVersions_Version_minor(min_version);
+ peer_rpc_versions_.min_rpc_version.major_version = min_version_major;
+ peer_rpc_versions_.min_rpc_version.minor_version = min_version_minor;
+ }
+ }
+ if (grpc_gcp_AltsContext_security_level(ctx) >= GRPC_SECURITY_MIN ||
+ grpc_gcp_AltsContext_security_level(ctx) <= GRPC_SECURITY_MAX) {
+ security_level_ = static_cast<grpc_security_level>(
+ grpc_gcp_AltsContext_security_level(ctx));
+ }
+ if (grpc_gcp_AltsContext_has_peer_attributes(ctx)) {
+ size_t iter = UPB_MAP_BEGIN;
+ const grpc_gcp_AltsContext_PeerAttributesEntry* peer_attributes_entry =
+ grpc_gcp_AltsContext_peer_attributes_next(ctx, &iter);
+ while (peer_attributes_entry != nullptr) {
+ upb_strview key =
+ grpc_gcp_AltsContext_PeerAttributesEntry_key(peer_attributes_entry);
+ upb_strview val =
+ grpc_gcp_AltsContext_PeerAttributesEntry_value(peer_attributes_entry);
+ peer_attributes_map_[TString(key.data, key.size)] =
+ TString(val.data, val.size);
+ peer_attributes_entry =
+ grpc_gcp_AltsContext_peer_attributes_next(ctx, &iter);
+ }
+ }
+}
+
+TString AltsContext::application_protocol() const {
+ return application_protocol_;
+}
+
+TString AltsContext::record_protocol() const { return record_protocol_; }
+
+TString AltsContext::peer_service_account() const {
+ return peer_service_account_;
+}
+
+TString AltsContext::local_service_account() const {
+ return local_service_account_;
+}
+
+grpc_security_level AltsContext::security_level() const {
+ return security_level_;
+}
+
+AltsContext::RpcProtocolVersions AltsContext::peer_rpc_versions() const {
+ return peer_rpc_versions_;
+}
+
+const std::map<TString, TString>& AltsContext::peer_attributes() const {
+ return peer_attributes_map_;
+}
+
+} // namespace experimental
+} // namespace grpc
diff --git a/contrib/libs/grpc/src/cpp/common/alts_util.cc b/contrib/libs/grpc/src/cpp/common/alts_util.cc
index 4bd7e339c02..4b955c621c9 100644
--- a/contrib/libs/grpc/src/cpp/common/alts_util.cc
+++ b/contrib/libs/grpc/src/cpp/common/alts_util.cc
@@ -1,82 +1,82 @@
-/*
- *
- * Copyright 2019 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "upb/upb.hpp"
-
-#include <grpc/grpc_security.h>
-#include <grpc/support/log.h>
-#include <grpcpp/security/alts_context.h>
-#include <grpcpp/security/alts_util.h>
-
-#include "src/core/lib/gprpp/memory.h"
-#include "src/core/tsi/alts/handshaker/alts_tsi_handshaker.h"
-#include "src/cpp/common/secure_auth_context.h"
-#include "src/proto/grpc/gcp/altscontext.upb.h"
-
-namespace grpc {
-namespace experimental {
-
-std::unique_ptr<AltsContext> GetAltsContextFromAuthContext(
- const std::shared_ptr<const AuthContext>& auth_context) {
- if (auth_context == nullptr) {
- gpr_log(GPR_ERROR, "auth_context is nullptr.");
- return nullptr;
- }
- std::vector<string_ref> ctx_vector =
- auth_context->FindPropertyValues(TSI_ALTS_CONTEXT);
- if (ctx_vector.size() != 1) {
- gpr_log(GPR_ERROR, "contains zero or more than one ALTS context.");
- return nullptr;
- }
- upb::Arena context_arena;
- grpc_gcp_AltsContext* ctx = grpc_gcp_AltsContext_parse(
- ctx_vector[0].data(), ctx_vector[0].size(), context_arena.ptr());
- if (ctx == nullptr) {
- gpr_log(GPR_ERROR, "fails to parse ALTS context.");
- return nullptr;
- }
- if (grpc_gcp_AltsContext_security_level(ctx) < GRPC_SECURITY_MIN ||
- grpc_gcp_AltsContext_security_level(ctx) > GRPC_SECURITY_MAX) {
- gpr_log(GPR_ERROR, "security_level is invalid.");
- return nullptr;
- }
- return y_absl::make_unique<AltsContext>(AltsContext(ctx));
-}
-
-grpc::Status AltsClientAuthzCheck(
- const std::shared_ptr<const AuthContext>& auth_context,
- const std::vector<TString>& expected_service_accounts) {
- std::unique_ptr<AltsContext> alts_ctx =
- GetAltsContextFromAuthContext(auth_context);
- if (alts_ctx == nullptr) {
- return grpc::Status(grpc::StatusCode::PERMISSION_DENIED,
- "fails to parse ALTS context.");
- }
- if (std::find(expected_service_accounts.begin(),
- expected_service_accounts.end(),
- alts_ctx->peer_service_account()) !=
- expected_service_accounts.end()) {
- return grpc::Status::OK;
- }
- return grpc::Status(
- grpc::StatusCode::PERMISSION_DENIED,
- "client " + alts_ctx->peer_service_account() + " is not authorized.");
-}
-
-} // namespace experimental
-} // namespace grpc
+/*
+ *
+ * Copyright 2019 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "upb/upb.hpp"
+
+#include <grpc/grpc_security.h>
+#include <grpc/support/log.h>
+#include <grpcpp/security/alts_context.h>
+#include <grpcpp/security/alts_util.h>
+
+#include "src/core/lib/gprpp/memory.h"
+#include "src/core/tsi/alts/handshaker/alts_tsi_handshaker.h"
+#include "src/cpp/common/secure_auth_context.h"
+#include "src/proto/grpc/gcp/altscontext.upb.h"
+
+namespace grpc {
+namespace experimental {
+
+std::unique_ptr<AltsContext> GetAltsContextFromAuthContext(
+ const std::shared_ptr<const AuthContext>& auth_context) {
+ if (auth_context == nullptr) {
+ gpr_log(GPR_ERROR, "auth_context is nullptr.");
+ return nullptr;
+ }
+ std::vector<string_ref> ctx_vector =
+ auth_context->FindPropertyValues(TSI_ALTS_CONTEXT);
+ if (ctx_vector.size() != 1) {
+ gpr_log(GPR_ERROR, "contains zero or more than one ALTS context.");
+ return nullptr;
+ }
+ upb::Arena context_arena;
+ grpc_gcp_AltsContext* ctx = grpc_gcp_AltsContext_parse(
+ ctx_vector[0].data(), ctx_vector[0].size(), context_arena.ptr());
+ if (ctx == nullptr) {
+ gpr_log(GPR_ERROR, "fails to parse ALTS context.");
+ return nullptr;
+ }
+ if (grpc_gcp_AltsContext_security_level(ctx) < GRPC_SECURITY_MIN ||
+ grpc_gcp_AltsContext_security_level(ctx) > GRPC_SECURITY_MAX) {
+ gpr_log(GPR_ERROR, "security_level is invalid.");
+ return nullptr;
+ }
+ return y_absl::make_unique<AltsContext>(AltsContext(ctx));
+}
+
+grpc::Status AltsClientAuthzCheck(
+ const std::shared_ptr<const AuthContext>& auth_context,
+ const std::vector<TString>& expected_service_accounts) {
+ std::unique_ptr<AltsContext> alts_ctx =
+ GetAltsContextFromAuthContext(auth_context);
+ if (alts_ctx == nullptr) {
+ return grpc::Status(grpc::StatusCode::PERMISSION_DENIED,
+ "fails to parse ALTS context.");
+ }
+ if (std::find(expected_service_accounts.begin(),
+ expected_service_accounts.end(),
+ alts_ctx->peer_service_account()) !=
+ expected_service_accounts.end()) {
+ return grpc::Status::OK;
+ }
+ return grpc::Status(
+ grpc::StatusCode::PERMISSION_DENIED,
+ "client " + alts_ctx->peer_service_account() + " is not authorized.");
+}
+
+} // namespace experimental
+} // namespace grpc
diff --git a/contrib/libs/grpc/src/cpp/common/channel_arguments.cc b/contrib/libs/grpc/src/cpp/common/channel_arguments.cc
index 62934a15c94..5a5dd91b5ec 100644
--- a/contrib/libs/grpc/src/cpp/common/channel_arguments.cc
+++ b/contrib/libs/grpc/src/cpp/common/channel_arguments.cc
@@ -27,7 +27,7 @@
#include "src/core/lib/iomgr/exec_ctx.h"
#include "src/core/lib/iomgr/socket_mutator.h"
-namespace grpc {
+namespace grpc {
ChannelArguments::ChannelArguments() {
// This will be ignored if used on the server side.
@@ -97,7 +97,7 @@ void ChannelArguments::SetSocketMutator(grpc_socket_mutator* mutator) {
grpc_core::ExecCtx exec_ctx;
for (auto& arg : args_) {
if (arg.type == mutator_arg.type &&
- TString(arg.key) == TString(mutator_arg.key)) {
+ TString(arg.key) == TString(mutator_arg.key)) {
GPR_ASSERT(!replaced);
arg.value.pointer.vtable->destroy(arg.value.pointer.p);
arg.value.pointer = mutator_arg.value.pointer;
@@ -106,7 +106,7 @@ void ChannelArguments::SetSocketMutator(grpc_socket_mutator* mutator) {
}
if (!replaced) {
- strings_.push_back(TString(mutator_arg.key));
+ strings_.push_back(TString(mutator_arg.key));
args_.push_back(mutator_arg);
args_.back().key = const_cast<char*>(strings_.back().c_str());
}
@@ -117,7 +117,7 @@ void ChannelArguments::SetSocketMutator(grpc_socket_mutator* mutator) {
// prefix. The user can build up a prefix string by calling this multiple times,
// each with more significant identifier.
void ChannelArguments::SetUserAgentPrefix(
- const TString& user_agent_prefix) {
+ const TString& user_agent_prefix) {
if (user_agent_prefix.empty()) {
return;
}
@@ -126,7 +126,7 @@ void ChannelArguments::SetUserAgentPrefix(
for (auto& arg : args_) {
++strings_it;
if (arg.type == GRPC_ARG_STRING) {
- if (TString(arg.key) == GRPC_ARG_PRIMARY_USER_AGENT_STRING) {
+ if (TString(arg.key) == GRPC_ARG_PRIMARY_USER_AGENT_STRING) {
GPR_ASSERT(arg.value.string == strings_it->c_str());
*(strings_it) = user_agent_prefix + " " + arg.value.string;
arg.value.string = const_cast<char*>(strings_it->c_str());
@@ -142,7 +142,7 @@ void ChannelArguments::SetUserAgentPrefix(
}
void ChannelArguments::SetResourceQuota(
- const grpc::ResourceQuota& resource_quota) {
+ const grpc::ResourceQuota& resource_quota) {
SetPointerWithVtable(GRPC_ARG_RESOURCE_QUOTA,
resource_quota.c_resource_quota(),
grpc_resource_quota_arg_vtable());
@@ -157,16 +157,16 @@ void ChannelArguments::SetMaxSendMessageSize(int size) {
}
void ChannelArguments::SetLoadBalancingPolicyName(
- const TString& lb_policy_name) {
+ const TString& lb_policy_name) {
SetString(GRPC_ARG_LB_POLICY_NAME, lb_policy_name);
}
void ChannelArguments::SetServiceConfigJSON(
- const TString& service_config_json) {
+ const TString& service_config_json) {
SetString(GRPC_ARG_SERVICE_CONFIG, service_config_json);
}
-void ChannelArguments::SetInt(const TString& key, int value) {
+void ChannelArguments::SetInt(const TString& key, int value) {
grpc_arg arg;
arg.type = GRPC_ARG_INTEGER;
strings_.push_back(key);
@@ -176,7 +176,7 @@ void ChannelArguments::SetInt(const TString& key, int value) {
args_.push_back(arg);
}
-void ChannelArguments::SetPointer(const TString& key, void* value) {
+void ChannelArguments::SetPointer(const TString& key, void* value) {
static const grpc_arg_pointer_vtable vtable = {
&PointerVtableMembers::Copy, &PointerVtableMembers::Destroy,
&PointerVtableMembers::Compare};
@@ -184,7 +184,7 @@ void ChannelArguments::SetPointer(const TString& key, void* value) {
}
void ChannelArguments::SetPointerWithVtable(
- const TString& key, void* value,
+ const TString& key, void* value,
const grpc_arg_pointer_vtable* vtable) {
grpc_arg arg;
arg.type = GRPC_ARG_POINTER;
@@ -195,8 +195,8 @@ void ChannelArguments::SetPointerWithVtable(
args_.push_back(arg);
}
-void ChannelArguments::SetString(const TString& key,
- const TString& value) {
+void ChannelArguments::SetString(const TString& key,
+ const TString& value) {
grpc_arg arg;
arg.type = GRPC_ARG_STRING;
strings_.push_back(key);
@@ -214,4 +214,4 @@ void ChannelArguments::SetChannelArgs(grpc_channel_args* channel_args) const {
}
}
-} // namespace grpc
+} // namespace grpc
diff --git a/contrib/libs/grpc/src/cpp/common/completion_queue_cc.cc b/contrib/libs/grpc/src/cpp/common/completion_queue_cc.cc
index 5e3a5d715b0..96a7105eaf4 100644
--- a/contrib/libs/grpc/src/cpp/common/completion_queue_cc.cc
+++ b/contrib/libs/grpc/src/cpp/common/completion_queue_cc.cc
@@ -24,9 +24,9 @@
#include <grpcpp/impl/grpc_library.h>
#include <grpcpp/support/time.h>
-namespace grpc {
+namespace grpc {
-static internal::GrpcLibraryInitializer g_gli_initializer;
+static internal::GrpcLibraryInitializer g_gli_initializer;
// 'CompletionQueue' constructor can safely call GrpcLibraryCodegen(false) here
// i.e not have GrpcLibraryCodegen call grpc_init(). This is because, to create
@@ -39,12 +39,12 @@ CompletionQueue::CompletionQueue(grpc_completion_queue* take)
void CompletionQueue::Shutdown() {
g_gli_initializer.summon();
-#ifndef NDEBUG
- if (!ServerListEmpty()) {
- gpr_log(GPR_ERROR,
- "CompletionQueue shutdown being shutdown before its server.");
- }
-#endif
+#ifndef NDEBUG
+ if (!ServerListEmpty()) {
+ gpr_log(GPR_ERROR,
+ "CompletionQueue shutdown being shutdown before its server.");
+ }
+#endif
CompleteAvalanching();
}
@@ -96,4 +96,4 @@ bool CompletionQueue::CompletionQueueTLSCache::Flush(void** tag, bool* ok) {
return false;
}
-} // namespace grpc
+} // namespace grpc
diff --git a/contrib/libs/grpc/src/cpp/common/resource_quota_cc.cc b/contrib/libs/grpc/src/cpp/common/resource_quota_cc.cc
index e801f710ee7..64abff96338 100644
--- a/contrib/libs/grpc/src/cpp/common/resource_quota_cc.cc
+++ b/contrib/libs/grpc/src/cpp/common/resource_quota_cc.cc
@@ -19,11 +19,11 @@
#include <grpc/grpc.h>
#include <grpcpp/resource_quota.h>
-namespace grpc {
+namespace grpc {
ResourceQuota::ResourceQuota() : impl_(grpc_resource_quota_create(nullptr)) {}
-ResourceQuota::ResourceQuota(const TString& name)
+ResourceQuota::ResourceQuota(const TString& name)
: impl_(grpc_resource_quota_create(name.c_str())) {}
ResourceQuota::~ResourceQuota() { grpc_resource_quota_unref(impl_); }
@@ -37,4 +37,4 @@ ResourceQuota& ResourceQuota::SetMaxThreads(int new_max_threads) {
grpc_resource_quota_set_max_threads(impl_, new_max_threads);
return *this;
}
-} // namespace grpc
+} // namespace grpc
diff --git a/contrib/libs/grpc/src/cpp/common/secure_auth_context.cc b/contrib/libs/grpc/src/cpp/common/secure_auth_context.cc
index 721cb3e7fc1..e1f97889c8e 100644
--- a/contrib/libs/grpc/src/cpp/common/secure_auth_context.cc
+++ b/contrib/libs/grpc/src/cpp/common/secure_auth_context.cc
@@ -37,7 +37,7 @@ std::vector<grpc::string_ref> SecureAuthContext::GetPeerIdentity() const {
return identity;
}
-TString SecureAuthContext::GetPeerIdentityPropertyName() const {
+TString SecureAuthContext::GetPeerIdentityPropertyName() const {
if (ctx_ == nullptr) {
return "";
}
@@ -46,7 +46,7 @@ TString SecureAuthContext::GetPeerIdentityPropertyName() const {
}
std::vector<grpc::string_ref> SecureAuthContext::FindPropertyValues(
- const TString& name) const {
+ const TString& name) const {
if (ctx_ == nullptr) {
return std::vector<grpc::string_ref>();
}
@@ -76,14 +76,14 @@ AuthPropertyIterator SecureAuthContext::end() const {
return AuthPropertyIterator();
}
-void SecureAuthContext::AddProperty(const TString& key,
+void SecureAuthContext::AddProperty(const TString& key,
const grpc::string_ref& value) {
if (ctx_ == nullptr) return;
grpc_auth_context_add_property(ctx_.get(), key.c_str(), value.data(),
value.size());
}
-bool SecureAuthContext::SetPeerIdentityPropertyName(const TString& name) {
+bool SecureAuthContext::SetPeerIdentityPropertyName(const TString& name) {
if (ctx_ == nullptr) return false;
return grpc_auth_context_set_peer_identity_property_name(ctx_.get(),
name.c_str()) != 0;
diff --git a/contrib/libs/grpc/src/cpp/common/secure_auth_context.h b/contrib/libs/grpc/src/cpp/common/secure_auth_context.h
index 60c4449876e..51013efac70 100644
--- a/contrib/libs/grpc/src/cpp/common/secure_auth_context.h
+++ b/contrib/libs/grpc/src/cpp/common/secure_auth_context.h
@@ -37,19 +37,19 @@ class SecureAuthContext final : public AuthContext {
std::vector<grpc::string_ref> GetPeerIdentity() const override;
- TString GetPeerIdentityPropertyName() const override;
+ TString GetPeerIdentityPropertyName() const override;
std::vector<grpc::string_ref> FindPropertyValues(
- const TString& name) const override;
+ const TString& name) const override;
AuthPropertyIterator begin() const override;
AuthPropertyIterator end() const override;
- void AddProperty(const TString& key,
+ void AddProperty(const TString& key,
const grpc::string_ref& value) override;
- virtual bool SetPeerIdentityPropertyName(const TString& name) override;
+ virtual bool SetPeerIdentityPropertyName(const TString& name) override;
private:
grpc_core::RefCountedPtr<grpc_auth_context> ctx_;
diff --git a/contrib/libs/grpc/src/cpp/common/secure_channel_arguments.cc b/contrib/libs/grpc/src/cpp/common/secure_channel_arguments.cc
index 736d6083a0b..844bc627ab3 100644
--- a/contrib/libs/grpc/src/cpp/common/secure_channel_arguments.cc
+++ b/contrib/libs/grpc/src/cpp/common/secure_channel_arguments.cc
@@ -21,19 +21,19 @@
#include <grpc/grpc_security.h>
#include "src/core/lib/channel/channel_args.h"
-namespace grpc {
+namespace grpc {
-void ChannelArguments::SetSslTargetNameOverride(const TString& name) {
+void ChannelArguments::SetSslTargetNameOverride(const TString& name) {
SetString(GRPC_SSL_TARGET_NAME_OVERRIDE_ARG, name);
}
-TString ChannelArguments::GetSslTargetNameOverride() const {
+TString ChannelArguments::GetSslTargetNameOverride() const {
for (unsigned int i = 0; i < args_.size(); i++) {
- if (TString(GRPC_SSL_TARGET_NAME_OVERRIDE_ARG) == args_[i].key) {
+ if (TString(GRPC_SSL_TARGET_NAME_OVERRIDE_ARG) == args_[i].key) {
return args_[i].value.string;
}
}
return "";
}
-} // namespace grpc
+} // namespace grpc
diff --git a/contrib/libs/grpc/src/cpp/common/tls_credentials_options.cc b/contrib/libs/grpc/src/cpp/common/tls_credentials_options.cc
index 22b03ac1887..7e435ac1de3 100644
--- a/contrib/libs/grpc/src/cpp/common/tls_credentials_options.cc
+++ b/contrib/libs/grpc/src/cpp/common/tls_credentials_options.cc
@@ -16,20 +16,20 @@
*
*/
-#include <grpc/support/alloc.h>
+#include <grpc/support/alloc.h>
#include <grpcpp/security/tls_credentials_options.h>
-
-#include "y_absl/container/inlined_vector.h"
+
+#include "y_absl/container/inlined_vector.h"
#include "src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h"
#include "src/cpp/common/tls_credentials_options_util.h"
-namespace grpc {
+namespace grpc {
namespace experimental {
/** TLS key materials config API implementation **/
-void TlsKeyMaterialsConfig::set_pem_root_certs(
- const TString& pem_root_certs) {
- pem_root_certs_ = pem_root_certs;
+void TlsKeyMaterialsConfig::set_pem_root_certs(
+ const TString& pem_root_certs) {
+ pem_root_certs_ = pem_root_certs;
}
void TlsKeyMaterialsConfig::add_pem_key_cert_pair(
@@ -38,10 +38,10 @@ void TlsKeyMaterialsConfig::add_pem_key_cert_pair(
}
void TlsKeyMaterialsConfig::set_key_materials(
- const TString& pem_root_certs,
- const std::vector<PemKeyCertPair>& pem_key_cert_pair_list) {
- pem_key_cert_pair_list_ = pem_key_cert_pair_list;
- pem_root_certs_ = pem_root_certs;
+ const TString& pem_root_certs,
+ const std::vector<PemKeyCertPair>& pem_key_cert_pair_list) {
+ pem_key_cert_pair_list_ = pem_key_cert_pair_list;
+ pem_root_certs_ = pem_root_certs;
}
/** TLS credential reload arg API implementation **/
@@ -69,8 +69,8 @@ grpc_ssl_certificate_config_reload_status TlsCredentialReloadArg::status()
return c_arg_->status;
}
-TString TlsCredentialReloadArg::error_details() const {
- return c_arg_->error_details->error_details();
+TString TlsCredentialReloadArg::error_details() const {
+ return c_arg_->error_details->error_details();
}
void TlsCredentialReloadArg::set_cb_user_data(void* cb_user_data) {
@@ -78,59 +78,59 @@ void TlsCredentialReloadArg::set_cb_user_data(void* cb_user_data) {
}
void TlsCredentialReloadArg::set_pem_root_certs(
- const TString& pem_root_certs) {
+ const TString& pem_root_certs) {
::grpc_core::UniquePtr<char> c_pem_root_certs(
gpr_strdup(pem_root_certs.c_str()));
c_arg_->key_materials_config->set_pem_root_certs(std::move(c_pem_root_certs));
}
-namespace {
-
-::grpc_core::PemKeyCertPair ConvertToCorePemKeyCertPair(
- const TlsKeyMaterialsConfig::PemKeyCertPair& pem_key_cert_pair) {
+namespace {
+
+::grpc_core::PemKeyCertPair ConvertToCorePemKeyCertPair(
+ const TlsKeyMaterialsConfig::PemKeyCertPair& pem_key_cert_pair) {
grpc_ssl_pem_key_cert_pair* ssl_pair =
(grpc_ssl_pem_key_cert_pair*)gpr_malloc(
sizeof(grpc_ssl_pem_key_cert_pair));
ssl_pair->private_key = gpr_strdup(pem_key_cert_pair.private_key.c_str());
ssl_pair->cert_chain = gpr_strdup(pem_key_cert_pair.cert_chain.c_str());
- return ::grpc_core::PemKeyCertPair(ssl_pair);
-}
-
-} // namespace
-
-void TlsCredentialReloadArg::add_pem_key_cert_pair(
- const TlsKeyMaterialsConfig::PemKeyCertPair& pem_key_cert_pair) {
+ return ::grpc_core::PemKeyCertPair(ssl_pair);
+}
+
+} // namespace
+
+void TlsCredentialReloadArg::add_pem_key_cert_pair(
+ const TlsKeyMaterialsConfig::PemKeyCertPair& pem_key_cert_pair) {
c_arg_->key_materials_config->add_pem_key_cert_pair(
- ConvertToCorePemKeyCertPair(pem_key_cert_pair));
-}
-
-void TlsCredentialReloadArg::set_key_materials(
- const TString& pem_root_certs,
- std::vector<TlsKeyMaterialsConfig::PemKeyCertPair> pem_key_cert_pair_list) {
- /** Initialize the |key_materials_config| field of |c_arg_|, if it has not
- * already been done. **/
- if (c_arg_->key_materials_config == nullptr) {
- c_arg_->key_materials_config = grpc_tls_key_materials_config_create();
- }
- /** Convert |pem_key_cert_pair_list| to an inlined vector of ssl pairs. **/
- ::y_absl::InlinedVector<::grpc_core::PemKeyCertPair, 1>
- c_pem_key_cert_pair_list;
- for (const auto& key_cert_pair : pem_key_cert_pair_list) {
- c_pem_key_cert_pair_list.emplace_back(
- ConvertToCorePemKeyCertPair(key_cert_pair));
- }
- /** Populate the key materials config field of |c_arg_|. **/
- c_arg_->key_materials_config->set_key_materials(pem_root_certs.c_str(),
- c_pem_key_cert_pair_list);
-}
-
+ ConvertToCorePemKeyCertPair(pem_key_cert_pair));
+}
+
+void TlsCredentialReloadArg::set_key_materials(
+ const TString& pem_root_certs,
+ std::vector<TlsKeyMaterialsConfig::PemKeyCertPair> pem_key_cert_pair_list) {
+ /** Initialize the |key_materials_config| field of |c_arg_|, if it has not
+ * already been done. **/
+ if (c_arg_->key_materials_config == nullptr) {
+ c_arg_->key_materials_config = grpc_tls_key_materials_config_create();
+ }
+ /** Convert |pem_key_cert_pair_list| to an inlined vector of ssl pairs. **/
+ ::y_absl::InlinedVector<::grpc_core::PemKeyCertPair, 1>
+ c_pem_key_cert_pair_list;
+ for (const auto& key_cert_pair : pem_key_cert_pair_list) {
+ c_pem_key_cert_pair_list.emplace_back(
+ ConvertToCorePemKeyCertPair(key_cert_pair));
+ }
+ /** Populate the key materials config field of |c_arg_|. **/
+ c_arg_->key_materials_config->set_key_materials(pem_root_certs.c_str(),
+ c_pem_key_cert_pair_list);
+}
+
void TlsCredentialReloadArg::set_key_materials_config(
const std::shared_ptr<TlsKeyMaterialsConfig>& key_materials_config) {
if (key_materials_config == nullptr) {
c_arg_->key_materials_config = nullptr;
return;
}
- ::y_absl::InlinedVector<::grpc_core::PemKeyCertPair, 1>
+ ::y_absl::InlinedVector<::grpc_core::PemKeyCertPair, 1>
c_pem_key_cert_pair_list;
for (const auto& key_cert_pair :
key_materials_config->pem_key_cert_pair_list()) {
@@ -149,7 +149,7 @@ void TlsCredentialReloadArg::set_key_materials_config(
c_arg_->key_materials_config = grpc_tls_key_materials_config_create();
}
c_arg_->key_materials_config->set_key_materials(
- key_materials_config->pem_root_certs().c_str(), c_pem_key_cert_pair_list);
+ key_materials_config->pem_root_certs().c_str(), c_pem_key_cert_pair_list);
c_arg_->key_materials_config->set_version(key_materials_config->version());
}
@@ -159,8 +159,8 @@ void TlsCredentialReloadArg::set_status(
}
void TlsCredentialReloadArg::set_error_details(
- const TString& error_details) {
- c_arg_->error_details->set_error_details(error_details.c_str());
+ const TString& error_details) {
+ c_arg_->error_details->set_error_details(error_details.c_str());
}
void TlsCredentialReloadArg::OnCredentialReloadDoneCallback() {
@@ -202,27 +202,27 @@ void* TlsServerAuthorizationCheckArg::cb_user_data() const {
int TlsServerAuthorizationCheckArg::success() const { return c_arg_->success; }
-TString TlsServerAuthorizationCheckArg::target_name() const {
- TString cpp_target_name(c_arg_->target_name);
+TString TlsServerAuthorizationCheckArg::target_name() const {
+ TString cpp_target_name(c_arg_->target_name);
return cpp_target_name;
}
-TString TlsServerAuthorizationCheckArg::peer_cert() const {
- TString cpp_peer_cert(c_arg_->peer_cert);
+TString TlsServerAuthorizationCheckArg::peer_cert() const {
+ TString cpp_peer_cert(c_arg_->peer_cert);
return cpp_peer_cert;
}
-TString TlsServerAuthorizationCheckArg::peer_cert_full_chain() const {
- TString cpp_peer_cert_full_chain(c_arg_->peer_cert_full_chain);
- return cpp_peer_cert_full_chain;
-}
-
+TString TlsServerAuthorizationCheckArg::peer_cert_full_chain() const {
+ TString cpp_peer_cert_full_chain(c_arg_->peer_cert_full_chain);
+ return cpp_peer_cert_full_chain;
+}
+
grpc_status_code TlsServerAuthorizationCheckArg::status() const {
return c_arg_->status;
}
-TString TlsServerAuthorizationCheckArg::error_details() const {
- return c_arg_->error_details->error_details();
+TString TlsServerAuthorizationCheckArg::error_details() const {
+ return c_arg_->error_details->error_details();
}
void TlsServerAuthorizationCheckArg::set_cb_user_data(void* cb_user_data) {
@@ -234,27 +234,27 @@ void TlsServerAuthorizationCheckArg::set_success(int success) {
}
void TlsServerAuthorizationCheckArg::set_target_name(
- const TString& target_name) {
+ const TString& target_name) {
c_arg_->target_name = gpr_strdup(target_name.c_str());
}
void TlsServerAuthorizationCheckArg::set_peer_cert(
- const TString& peer_cert) {
+ const TString& peer_cert) {
c_arg_->peer_cert = gpr_strdup(peer_cert.c_str());
}
-void TlsServerAuthorizationCheckArg::set_peer_cert_full_chain(
- const TString& peer_cert_full_chain) {
- c_arg_->peer_cert_full_chain = gpr_strdup(peer_cert_full_chain.c_str());
-}
-
+void TlsServerAuthorizationCheckArg::set_peer_cert_full_chain(
+ const TString& peer_cert_full_chain) {
+ c_arg_->peer_cert_full_chain = gpr_strdup(peer_cert_full_chain.c_str());
+}
+
void TlsServerAuthorizationCheckArg::set_status(grpc_status_code status) {
c_arg_->status = status;
}
void TlsServerAuthorizationCheckArg::set_error_details(
- const TString& error_details) {
- c_arg_->error_details->set_error_details(error_details.c_str());
+ const TString& error_details) {
+ c_arg_->error_details->set_error_details(error_details.c_str());
}
void TlsServerAuthorizationCheckArg::OnServerAuthorizationCheckDoneCallback() {
@@ -281,33 +281,33 @@ TlsServerAuthorizationCheckConfig::~TlsServerAuthorizationCheckConfig() {}
/** gRPC TLS credential options API implementation **/
TlsCredentialsOptions::TlsCredentialsOptions(
- grpc_tls_server_verification_option server_verification_option,
- std::shared_ptr<TlsKeyMaterialsConfig> key_materials_config,
- std::shared_ptr<TlsCredentialReloadConfig> credential_reload_config,
- std::shared_ptr<TlsServerAuthorizationCheckConfig>
- server_authorization_check_config)
- : TlsCredentialsOptions(
- GRPC_SSL_DONT_REQUEST_CLIENT_CERTIFICATE, server_verification_option,
- std::move(key_materials_config), std::move(credential_reload_config),
- std::move(server_authorization_check_config)) {}
-
-TlsCredentialsOptions::TlsCredentialsOptions(
+ grpc_tls_server_verification_option server_verification_option,
+ std::shared_ptr<TlsKeyMaterialsConfig> key_materials_config,
+ std::shared_ptr<TlsCredentialReloadConfig> credential_reload_config,
+ std::shared_ptr<TlsServerAuthorizationCheckConfig>
+ server_authorization_check_config)
+ : TlsCredentialsOptions(
+ GRPC_SSL_DONT_REQUEST_CLIENT_CERTIFICATE, server_verification_option,
+ std::move(key_materials_config), std::move(credential_reload_config),
+ std::move(server_authorization_check_config)) {}
+
+TlsCredentialsOptions::TlsCredentialsOptions(
+ grpc_ssl_client_certificate_request_type cert_request_type,
+ std::shared_ptr<TlsKeyMaterialsConfig> key_materials_config,
+ std::shared_ptr<TlsCredentialReloadConfig> credential_reload_config)
+ : TlsCredentialsOptions(cert_request_type, GRPC_TLS_SERVER_VERIFICATION,
+ std::move(key_materials_config),
+ std::move(credential_reload_config), nullptr) {}
+
+TlsCredentialsOptions::TlsCredentialsOptions(
grpc_ssl_client_certificate_request_type cert_request_type,
- std::shared_ptr<TlsKeyMaterialsConfig> key_materials_config,
- std::shared_ptr<TlsCredentialReloadConfig> credential_reload_config)
- : TlsCredentialsOptions(cert_request_type, GRPC_TLS_SERVER_VERIFICATION,
- std::move(key_materials_config),
- std::move(credential_reload_config), nullptr) {}
-
-TlsCredentialsOptions::TlsCredentialsOptions(
- grpc_ssl_client_certificate_request_type cert_request_type,
- grpc_tls_server_verification_option server_verification_option,
+ grpc_tls_server_verification_option server_verification_option,
std::shared_ptr<TlsKeyMaterialsConfig> key_materials_config,
std::shared_ptr<TlsCredentialReloadConfig> credential_reload_config,
std::shared_ptr<TlsServerAuthorizationCheckConfig>
server_authorization_check_config)
: cert_request_type_(cert_request_type),
- server_verification_option_(server_verification_option),
+ server_verification_option_(server_verification_option),
key_materials_config_(std::move(key_materials_config)),
credential_reload_config_(std::move(credential_reload_config)),
server_authorization_check_config_(
@@ -328,16 +328,16 @@ TlsCredentialsOptions::TlsCredentialsOptions(
grpc_tls_credentials_options_set_server_authorization_check_config(
c_credentials_options_, server_authorization_check_config_->c_config());
}
- grpc_tls_credentials_options_set_server_verification_option(
- c_credentials_options_, server_verification_option);
+ grpc_tls_credentials_options_set_server_verification_option(
+ c_credentials_options_, server_verification_option);
}
-/** Whenever a TlsCredentialsOptions instance is created, the caller takes
- * ownership of the c_credentials_options_ pointer (see e.g. the implementation
- * of the TlsCredentials API in secure_credentials.cc). For this reason, the
- * TlsCredentialsOptions destructor is not responsible for freeing
- * c_credentials_options_. **/
+/** Whenever a TlsCredentialsOptions instance is created, the caller takes
+ * ownership of the c_credentials_options_ pointer (see e.g. the implementation
+ * of the TlsCredentials API in secure_credentials.cc). For this reason, the
+ * TlsCredentialsOptions destructor is not responsible for freeing
+ * c_credentials_options_. **/
TlsCredentialsOptions::~TlsCredentialsOptions() {}
} // namespace experimental
-} // namespace grpc
+} // namespace grpc
diff --git a/contrib/libs/grpc/src/cpp/common/tls_credentials_options_util.cc b/contrib/libs/grpc/src/cpp/common/tls_credentials_options_util.cc
index cdcf00376ea..ed84003212b 100644
--- a/contrib/libs/grpc/src/cpp/common/tls_credentials_options_util.cc
+++ b/contrib/libs/grpc/src/cpp/common/tls_credentials_options_util.cc
@@ -16,12 +16,12 @@
*
*/
-#include "y_absl/container/inlined_vector.h"
-
-#include <grpcpp/security/tls_credentials_options.h>
+#include "y_absl/container/inlined_vector.h"
+
+#include <grpcpp/security/tls_credentials_options.h>
#include "src/cpp/common/tls_credentials_options_util.h"
-namespace grpc {
+namespace grpc {
namespace experimental {
/** Converts the Cpp key materials to C key materials; this allocates memory for
@@ -37,7 +37,7 @@ grpc_tls_key_materials_config* ConvertToCKeyMaterialsConfig(
}
grpc_tls_key_materials_config* c_config =
grpc_tls_key_materials_config_create();
- ::y_absl::InlinedVector<::grpc_core::PemKeyCertPair, 1>
+ ::y_absl::InlinedVector<::grpc_core::PemKeyCertPair, 1>
c_pem_key_cert_pair_list;
for (const auto& key_cert_pair : config->pem_key_cert_pair_list()) {
grpc_ssl_pem_key_cert_pair* ssl_pair =
@@ -49,8 +49,8 @@ grpc_tls_key_materials_config* ConvertToCKeyMaterialsConfig(
::grpc_core::PemKeyCertPair(ssl_pair);
c_pem_key_cert_pair_list.push_back(::std::move(c_pem_key_cert_pair));
}
- c_config->set_key_materials(config->pem_root_certs().c_str(),
- c_pem_key_cert_pair_list);
+ c_config->set_key_materials(config->pem_root_certs().c_str(),
+ c_pem_key_cert_pair_list);
c_config->set_version(config->version());
return c_config;
}
@@ -146,4 +146,4 @@ void TlsServerAuthorizationCheckArgDestroyContext(void* context) {
}
} // namespace experimental
-} // namespace grpc
+} // namespace grpc
diff --git a/contrib/libs/grpc/src/cpp/common/tls_credentials_options_util.h b/contrib/libs/grpc/src/cpp/common/tls_credentials_options_util.h
index 6ffa0a67ddc..4ee04d15d7f 100644
--- a/contrib/libs/grpc/src/cpp/common/tls_credentials_options_util.h
+++ b/contrib/libs/grpc/src/cpp/common/tls_credentials_options_util.h
@@ -24,7 +24,7 @@
#include "src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h"
-namespace grpc {
+namespace grpc {
namespace experimental {
/** The following function is exposed for testing purposes. **/
@@ -53,6 +53,6 @@ void TlsCredentialReloadArgDestroyContext(void* context);
void TlsServerAuthorizationCheckArgDestroyContext(void* context);
} // namespace experimental
-} // namespace grpc
+} // namespace grpc
#endif // GRPC_INTERNAL_CPP_COMMON_TLS_CREDENTIALS_OPTIONS_UTIL_H
diff --git a/contrib/libs/grpc/src/cpp/common/validate_service_config.cc b/contrib/libs/grpc/src/cpp/common/validate_service_config.cc
index 5a139e33070..f63cfbc68c9 100644
--- a/contrib/libs/grpc/src/cpp/common/validate_service_config.cc
+++ b/contrib/libs/grpc/src/cpp/common/validate_service_config.cc
@@ -23,12 +23,12 @@
namespace grpc {
namespace experimental {
-TString ValidateServiceConfigJSON(const TString& service_config_json) {
+TString ValidateServiceConfigJSON(const TString& service_config_json) {
grpc_init();
grpc_error* error = GRPC_ERROR_NONE;
- grpc_core::ServiceConfig::Create(/*args=*/nullptr,
- service_config_json.c_str(), &error);
- TString return_value;
+ grpc_core::ServiceConfig::Create(/*args=*/nullptr,
+ service_config_json.c_str(), &error);
+ TString return_value;
if (error != GRPC_ERROR_NONE) {
return_value = grpc_error_string(error);
GRPC_ERROR_UNREF(error);
diff --git a/contrib/libs/grpc/src/cpp/common/version_cc.cc b/contrib/libs/grpc/src/cpp/common/version_cc.cc
index dfaa505461f..7f4228346a9 100644
--- a/contrib/libs/grpc/src/cpp/common/version_cc.cc
+++ b/contrib/libs/grpc/src/cpp/common/version_cc.cc
@@ -22,5 +22,5 @@
#include <grpcpp/grpcpp.h>
namespace grpc {
-TString Version() { return "1.33.2"; }
+TString Version() { return "1.33.2"; }
} // namespace grpc
diff --git a/contrib/libs/grpc/src/cpp/common/ya.make b/contrib/libs/grpc/src/cpp/common/ya.make
index 7364db41c10..f1966dce37b 100644
--- a/contrib/libs/grpc/src/cpp/common/ya.make
+++ b/contrib/libs/grpc/src/cpp/common/ya.make
@@ -1,41 +1,41 @@
-# Generated by devtools/yamaker.
-
-LIBRARY()
-
-OWNER(g:cpp-contrib)
-
-LICENSE(Apache-2.0)
-
-LICENSE_TEXTS(.yandex_meta/licenses.list.txt)
-
-PEERDIR(
- contrib/libs/grpc/grpc
- contrib/libs/grpc/grpc++
- contrib/libs/grpc/src/core/lib
- contrib/libs/grpc/third_party/address_sorting
- contrib/libs/grpc/third_party/upb
- contrib/libs/openssl
-)
-
-ADDINCL(
- GLOBAL contrib/libs/grpc/include
- ${ARCADIA_BUILD_ROOT}/contrib/libs/grpc
- contrib/libs/grpc
- contrib/libs/grpc/src/core/ext/upb-generated
- contrib/libs/grpc/third_party/upb
-)
-
-NO_COMPILER_WARNINGS()
-
-IF (OS_LINUX OR OS_DARWIN)
- CFLAGS(
- -DGRPC_POSIX_FORK_ALLOW_PTHREAD_ATFORK=1
- )
-ENDIF()
-
-SRCS(
- alts_context.cc
- alts_util.cc
-)
-
-END()
+# Generated by devtools/yamaker.
+
+LIBRARY()
+
+OWNER(g:cpp-contrib)
+
+LICENSE(Apache-2.0)
+
+LICENSE_TEXTS(.yandex_meta/licenses.list.txt)
+
+PEERDIR(
+ contrib/libs/grpc/grpc
+ contrib/libs/grpc/grpc++
+ contrib/libs/grpc/src/core/lib
+ contrib/libs/grpc/third_party/address_sorting
+ contrib/libs/grpc/third_party/upb
+ contrib/libs/openssl
+)
+
+ADDINCL(
+ GLOBAL contrib/libs/grpc/include
+ ${ARCADIA_BUILD_ROOT}/contrib/libs/grpc
+ contrib/libs/grpc
+ contrib/libs/grpc/src/core/ext/upb-generated
+ contrib/libs/grpc/third_party/upb
+)
+
+NO_COMPILER_WARNINGS()
+
+IF (OS_LINUX OR OS_DARWIN)
+ CFLAGS(
+ -DGRPC_POSIX_FORK_ALLOW_PTHREAD_ATFORK=1
+ )
+ENDIF()
+
+SRCS(
+ alts_context.cc
+ alts_util.cc
+)
+
+END()
diff --git a/contrib/libs/grpc/src/cpp/ext/proto_server_reflection.cc b/contrib/libs/grpc/src/cpp/ext/proto_server_reflection.cc
index 132c10c6817..1b388210c05 100644
--- a/contrib/libs/grpc/src/cpp/ext/proto_server_reflection.cc
+++ b/contrib/libs/grpc/src/cpp/ext/proto_server_reflection.cc
@@ -40,7 +40,7 @@ ProtoServerReflection::ProtoServerReflection()
: descriptor_pool_(protobuf::DescriptorPool::generated_pool()) {}
void ProtoServerReflection::SetServiceList(
- const std::vector<TString>* services) {
+ const std::vector<TString>* services) {
services_ = services;
}
@@ -110,7 +110,7 @@ Status ProtoServerReflection::ListService(ServerContext* /*context*/,
}
Status ProtoServerReflection::GetFileByName(
- ServerContext* /*context*/, const TString& filename,
+ ServerContext* /*context*/, const TString& filename,
ServerReflectionResponse* response) {
if (descriptor_pool_ == nullptr) {
return Status::CANCELLED;
@@ -121,13 +121,13 @@ Status ProtoServerReflection::GetFileByName(
if (file_desc == nullptr) {
return Status(StatusCode::NOT_FOUND, "File not found.");
}
- std::unordered_set<TString> seen_files;
+ std::unordered_set<TString> seen_files;
FillFileDescriptorResponse(file_desc, response, &seen_files);
return Status::OK;
}
Status ProtoServerReflection::GetFileContainingSymbol(
- ServerContext* /*context*/, const TString& symbol,
+ ServerContext* /*context*/, const TString& symbol,
ServerReflectionResponse* response) {
if (descriptor_pool_ == nullptr) {
return Status::CANCELLED;
@@ -138,7 +138,7 @@ Status ProtoServerReflection::GetFileContainingSymbol(
if (file_desc == nullptr) {
return Status(StatusCode::NOT_FOUND, "Symbol not found.");
}
- std::unordered_set<TString> seen_files;
+ std::unordered_set<TString> seen_files;
FillFileDescriptorResponse(file_desc, response, &seen_files);
return Status::OK;
}
@@ -162,13 +162,13 @@ Status ProtoServerReflection::GetFileContainingExtension(
if (field_desc == nullptr) {
return Status(StatusCode::NOT_FOUND, "Extension not found.");
}
- std::unordered_set<TString> seen_files;
+ std::unordered_set<TString> seen_files;
FillFileDescriptorResponse(field_desc->file(), response, &seen_files);
return Status::OK;
}
Status ProtoServerReflection::GetAllExtensionNumbers(
- ServerContext* /*context*/, const TString& type,
+ ServerContext* /*context*/, const TString& type,
ExtensionNumberResponse* response) {
if (descriptor_pool_ == nullptr) {
return Status::CANCELLED;
@@ -192,7 +192,7 @@ Status ProtoServerReflection::GetAllExtensionNumbers(
void ProtoServerReflection::FillFileDescriptorResponse(
const protobuf::FileDescriptor* file_desc,
ServerReflectionResponse* response,
- std::unordered_set<TString>* seen_files) {
+ std::unordered_set<TString>* seen_files) {
if (seen_files->find(file_desc->name()) != seen_files->end()) {
return;
}
diff --git a/contrib/libs/grpc/src/cpp/ext/proto_server_reflection.h b/contrib/libs/grpc/src/cpp/ext/proto_server_reflection.h
index 2dbdedef58d..2d17eed95a8 100644
--- a/contrib/libs/grpc/src/cpp/ext/proto_server_reflection.h
+++ b/contrib/libs/grpc/src/cpp/ext/proto_server_reflection.h
@@ -33,7 +33,7 @@ class ProtoServerReflection final
ProtoServerReflection();
// Add the full names of registered services
- void SetServiceList(const std::vector<TString>* services);
+ void SetServiceList(const std::vector<TString>* services);
// implementation of ServerReflectionInfo(stream ServerReflectionRequest) rpc
// in ServerReflection service
@@ -47,11 +47,11 @@ class ProtoServerReflection final
Status ListService(ServerContext* context,
reflection::v1alpha::ListServiceResponse* response);
- Status GetFileByName(ServerContext* context, const TString& file_name,
+ Status GetFileByName(ServerContext* context, const TString& file_name,
reflection::v1alpha::ServerReflectionResponse* response);
Status GetFileContainingSymbol(
- ServerContext* context, const TString& symbol,
+ ServerContext* context, const TString& symbol,
reflection::v1alpha::ServerReflectionResponse* response);
Status GetFileContainingExtension(
@@ -60,13 +60,13 @@ class ProtoServerReflection final
reflection::v1alpha::ServerReflectionResponse* response);
Status GetAllExtensionNumbers(
- ServerContext* context, const TString& type,
+ ServerContext* context, const TString& type,
reflection::v1alpha::ExtensionNumberResponse* response);
void FillFileDescriptorResponse(
const protobuf::FileDescriptor* file_desc,
reflection::v1alpha::ServerReflectionResponse* response,
- std::unordered_set<TString>* seen_files);
+ std::unordered_set<TString>* seen_files);
void FillErrorResponse(const Status& status,
reflection::v1alpha::ErrorResponse* error_response);
diff --git a/contrib/libs/grpc/src/cpp/ext/proto_server_reflection_plugin.cc b/contrib/libs/grpc/src/cpp/ext/proto_server_reflection_plugin.cc
index 63a25cdf589..007193d7f72 100644
--- a/contrib/libs/grpc/src/cpp/ext/proto_server_reflection_plugin.cc
+++ b/contrib/libs/grpc/src/cpp/ext/proto_server_reflection_plugin.cc
@@ -23,13 +23,13 @@
#include "src/cpp/ext/proto_server_reflection.h"
-namespace grpc {
+namespace grpc {
namespace reflection {
ProtoServerReflectionPlugin::ProtoServerReflectionPlugin()
: reflection_service_(new grpc::ProtoServerReflection()) {}
-TString ProtoServerReflectionPlugin::name() {
+TString ProtoServerReflectionPlugin::name() {
return "proto_server_reflection";
}
@@ -41,7 +41,7 @@ void ProtoServerReflectionPlugin::Finish(grpc::ServerInitializer* si) {
reflection_service_->SetServiceList(si->GetServiceList());
}
-void ProtoServerReflectionPlugin::ChangeArguments(const TString& /*name*/,
+void ProtoServerReflectionPlugin::ChangeArguments(const TString& /*name*/,
void* /*value*/) {}
bool ProtoServerReflectionPlugin::has_sync_methods() const {
@@ -64,11 +64,11 @@ static std::unique_ptr< ::grpc::ServerBuilderPlugin> CreateProtoReflection() {
}
void InitProtoReflectionServerBuilderPlugin() {
- static struct Initialize {
- Initialize() {
- ::grpc::ServerBuilder::InternalAddPluginFactory(&CreateProtoReflection);
- }
- } initializer;
+ static struct Initialize {
+ Initialize() {
+ ::grpc::ServerBuilder::InternalAddPluginFactory(&CreateProtoReflection);
+ }
+ } initializer;
}
// Force InitProtoReflectionServerBuilderPlugin() to be called at static
@@ -80,4 +80,4 @@ struct StaticProtoReflectionPluginInitializer {
} static_proto_reflection_plugin_initializer;
} // namespace reflection
-} // namespace grpc
+} // namespace grpc
diff --git a/contrib/libs/grpc/src/cpp/server/async_generic_service.cc b/contrib/libs/grpc/src/cpp/server/async_generic_service.cc
index 0e4e95465f8..07697a52d1f 100644
--- a/contrib/libs/grpc/src/cpp/server/async_generic_service.cc
+++ b/contrib/libs/grpc/src/cpp/server/async_generic_service.cc
@@ -24,8 +24,8 @@ namespace grpc {
void AsyncGenericService::RequestCall(
GenericServerContext* ctx, GenericServerAsyncReaderWriter* reader_writer,
- ::grpc::CompletionQueue* call_cq,
- ::grpc::ServerCompletionQueue* notification_cq, void* tag) {
+ ::grpc::CompletionQueue* call_cq,
+ ::grpc::ServerCompletionQueue* notification_cq, void* tag) {
server_->RequestAsyncGenericCall(ctx, reader_writer, call_cq, notification_cq,
tag);
}
diff --git a/contrib/libs/grpc/src/cpp/server/channel_argument_option.cc b/contrib/libs/grpc/src/cpp/server/channel_argument_option.cc
index 69ee6eed686..9aad932429d 100644
--- a/contrib/libs/grpc/src/cpp/server/channel_argument_option.cc
+++ b/contrib/libs/grpc/src/cpp/server/channel_argument_option.cc
@@ -21,10 +21,10 @@
namespace grpc {
std::unique_ptr<ServerBuilderOption> MakeChannelArgumentOption(
- const TString& name, const TString& value) {
+ const TString& name, const TString& value) {
class StringOption final : public ServerBuilderOption {
public:
- StringOption(const TString& name, const TString& value)
+ StringOption(const TString& name, const TString& value)
: name_(name), value_(value) {}
virtual void UpdateArguments(ChannelArguments* args) override {
@@ -35,17 +35,17 @@ std::unique_ptr<ServerBuilderOption> MakeChannelArgumentOption(
override {}
private:
- const TString name_;
- const TString value_;
+ const TString name_;
+ const TString value_;
};
return std::unique_ptr<ServerBuilderOption>(new StringOption(name, value));
}
std::unique_ptr<ServerBuilderOption> MakeChannelArgumentOption(
- const TString& name, int value) {
+ const TString& name, int value) {
class IntOption final : public ServerBuilderOption {
public:
- IntOption(const TString& name, int value)
+ IntOption(const TString& name, int value)
: name_(name), value_(value) {}
virtual void UpdateArguments(ChannelArguments* args) override {
@@ -56,7 +56,7 @@ std::unique_ptr<ServerBuilderOption> MakeChannelArgumentOption(
override {}
private:
- const TString name_;
+ const TString name_;
const int value_;
};
return std::unique_ptr<ServerBuilderOption>(new IntOption(name, value));
diff --git a/contrib/libs/grpc/src/cpp/server/channelz/channelz_service.cc b/contrib/libs/grpc/src/cpp/server/channelz/channelz_service.cc
index 1f402ef53d2..6dcf84bf40d 100644
--- a/contrib/libs/grpc/src/cpp/server/channelz/channelz_service.cc
+++ b/contrib/libs/grpc/src/cpp/server/channelz/channelz_service.cc
@@ -24,9 +24,9 @@
#include <grpc/support/alloc.h>
namespace grpc {
-
-namespace {
-
+
+namespace {
+
grpc::protobuf::util::Status ParseJson(const char* json_str,
grpc::protobuf::Message* message) {
grpc::protobuf::json::JsonParseOptions options;
@@ -34,8 +34,8 @@ grpc::protobuf::util::Status ParseJson(const char* json_str,
return grpc::protobuf::json::JsonStringToMessage(json_str, message, options);
}
-} // namespace
-
+} // namespace
+
Status ChannelzService::GetTopChannels(
ServerContext* /*unused*/,
const channelz::v1::GetTopChannelsRequest* request,
diff --git a/contrib/libs/grpc/src/cpp/server/channelz/channelz_service_plugin.cc b/contrib/libs/grpc/src/cpp/server/channelz/channelz_service_plugin.cc
index bae1b595440..ae26a447ab3 100644
--- a/contrib/libs/grpc/src/cpp/server/channelz/channelz_service_plugin.cc
+++ b/contrib/libs/grpc/src/cpp/server/channelz/channelz_service_plugin.cc
@@ -33,7 +33,7 @@ class ChannelzServicePlugin : public ::grpc::ServerBuilderPlugin {
public:
ChannelzServicePlugin() : channelz_service_(new grpc::ChannelzService()) {}
- TString name() override { return "channelz_service"; }
+ TString name() override { return "channelz_service"; }
void InitServer(grpc::ServerInitializer* si) override {
si->RegisterService(channelz_service_);
@@ -41,7 +41,7 @@ class ChannelzServicePlugin : public ::grpc::ServerBuilderPlugin {
void Finish(grpc::ServerInitializer* /*si*/) override {}
- void ChangeArguments(const TString& /*name*/, void* /*value*/) override {}
+ void ChangeArguments(const TString& /*name*/, void* /*value*/) override {}
bool has_sync_methods() const override {
if (channelz_service_) {
@@ -75,12 +75,12 @@ namespace channelz {
namespace experimental {
void InitChannelzService() {
- static struct Initializer {
- Initializer() {
- ::grpc::ServerBuilder::InternalAddPluginFactory(
- &grpc::channelz::experimental::CreateChannelzServicePlugin);
- }
- } initialize;
+ static struct Initializer {
+ Initializer() {
+ ::grpc::ServerBuilder::InternalAddPluginFactory(
+ &grpc::channelz::experimental::CreateChannelzServicePlugin);
+ }
+ } initialize;
}
} // namespace experimental
diff --git a/contrib/libs/grpc/src/cpp/server/external_connection_acceptor_impl.cc b/contrib/libs/grpc/src/cpp/server/external_connection_acceptor_impl.cc
index 9641301ab72..09d2a9d3b56 100644
--- a/contrib/libs/grpc/src/cpp/server/external_connection_acceptor_impl.cc
+++ b/contrib/libs/grpc/src/cpp/server/external_connection_acceptor_impl.cc
@@ -20,7 +20,7 @@
#include <memory>
-#include <grpcpp/server_builder.h>
+#include <grpcpp/server_builder.h>
#include <grpcpp/support/channel_arguments.h>
namespace grpc {
@@ -42,7 +42,7 @@ class AcceptorWrapper : public experimental::ExternalConnectionAcceptor {
} // namespace
ExternalConnectionAcceptorImpl::ExternalConnectionAcceptorImpl(
- const TString& name,
+ const TString& name,
ServerBuilder::experimental_type::ExternalConnectionType type,
std::shared_ptr<ServerCredentials> creds)
: name_(name), creds_(std::move(creds)) {
diff --git a/contrib/libs/grpc/src/cpp/server/external_connection_acceptor_impl.h b/contrib/libs/grpc/src/cpp/server/external_connection_acceptor_impl.h
index 8a1179bef2a..430c72862ea 100644
--- a/contrib/libs/grpc/src/cpp/server/external_connection_acceptor_impl.h
+++ b/contrib/libs/grpc/src/cpp/server/external_connection_acceptor_impl.h
@@ -36,7 +36,7 @@ class ExternalConnectionAcceptorImpl
: public std::enable_shared_from_this<ExternalConnectionAcceptorImpl> {
public:
ExternalConnectionAcceptorImpl(
- const TString& name,
+ const TString& name,
ServerBuilder::experimental_type::ExternalConnectionType type,
std::shared_ptr<ServerCredentials> creds);
// Should only be called once.
@@ -56,7 +56,7 @@ class ExternalConnectionAcceptorImpl
void SetToChannelArgs(::grpc::ChannelArguments* args);
private:
- const TString name_;
+ const TString name_;
std::shared_ptr<ServerCredentials> creds_;
grpc_core::TcpServerFdHandler* handler_ = nullptr; // not owned
grpc_core::Mutex mu_;
diff --git a/contrib/libs/grpc/src/cpp/server/health/default_health_check_service.cc b/contrib/libs/grpc/src/cpp/server/health/default_health_check_service.cc
index 059c97a4145..3cc508d0cbf 100644
--- a/contrib/libs/grpc/src/cpp/server/health/default_health_check_service.cc
+++ b/contrib/libs/grpc/src/cpp/server/health/default_health_check_service.cc
@@ -18,16 +18,16 @@
#include <memory>
-#include "upb/upb.hpp"
-
+#include "upb/upb.hpp"
+
#include <grpc/slice.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
-#include <grpcpp/impl/codegen/method_handler.h>
+#include <grpcpp/impl/codegen/method_handler.h>
#include "src/cpp/server/health/default_health_check_service.h"
#include "src/proto/grpc/health/v1/health.upb.h"
-#include "upb/upb.hpp"
+#include "upb/upb.hpp"
#define MAX_SERVICE_NAME_LENGTH 200
@@ -42,7 +42,7 @@ DefaultHealthCheckService::DefaultHealthCheckService() {
}
void DefaultHealthCheckService::SetServingStatus(
- const TString& service_name, bool serving) {
+ const TString& service_name, bool serving) {
grpc_core::MutexLock lock(&mu_);
if (shutdown_) {
// Set to NOT_SERVING in case service_name is not in the map.
@@ -77,7 +77,7 @@ void DefaultHealthCheckService::Shutdown() {
DefaultHealthCheckService::ServingStatus
DefaultHealthCheckService::GetServingStatus(
- const TString& service_name) const {
+ const TString& service_name) const {
grpc_core::MutexLock lock(&mu_);
auto it = services_map_.find(service_name);
if (it == services_map_.end()) {
@@ -88,7 +88,7 @@ DefaultHealthCheckService::GetServingStatus(
}
void DefaultHealthCheckService::RegisterCallHandler(
- const TString& service_name,
+ const TString& service_name,
std::shared_ptr<HealthCheckServiceImpl::CallHandler> handler) {
grpc_core::MutexLock lock(&mu_);
ServiceData& service_data = services_map_[service_name];
@@ -98,7 +98,7 @@ void DefaultHealthCheckService::RegisterCallHandler(
}
void DefaultHealthCheckService::UnregisterCallHandler(
- const TString& service_name,
+ const TString& service_name,
const std::shared_ptr<HealthCheckServiceImpl::CallHandler>& handler) {
grpc_core::MutexLock lock(&mu_);
auto it = services_map_.find(service_name);
@@ -185,7 +185,7 @@ void DefaultHealthCheckService::HealthCheckServiceImpl::StartServingThread() {
}
void DefaultHealthCheckService::HealthCheckServiceImpl::Serve(void* arg) {
- HealthCheckServiceImpl* service = static_cast<HealthCheckServiceImpl*>(arg);
+ HealthCheckServiceImpl* service = static_cast<HealthCheckServiceImpl*>(arg);
void* tag;
bool ok;
while (true) {
@@ -200,7 +200,7 @@ void DefaultHealthCheckService::HealthCheckServiceImpl::Serve(void* arg) {
}
bool DefaultHealthCheckService::HealthCheckServiceImpl::DecodeRequest(
- const ByteBuffer& request, TString* service_name) {
+ const ByteBuffer& request, TString* service_name) {
std::vector<Slice> slices;
if (!request.Dump(&slices).ok()) return false;
uint8_t* request_bytes = nullptr;
@@ -301,7 +301,7 @@ void DefaultHealthCheckService::HealthCheckServiceImpl::CheckCallHandler::
// Process request.
gpr_log(GPR_DEBUG, "[HCS %p] Health check started for handler %p", service_,
this);
- TString service_name;
+ TString service_name;
grpc::Status status = Status::OK;
ByteBuffer response;
if (!service_->DecodeRequest(request_, &service_name)) {
diff --git a/contrib/libs/grpc/src/cpp/server/health/default_health_check_service.h b/contrib/libs/grpc/src/cpp/server/health/default_health_check_service.h
index 6d7479b016a..9da1dfc15fa 100644
--- a/contrib/libs/grpc/src/cpp/server/health/default_health_check_service.h
+++ b/contrib/libs/grpc/src/cpp/server/health/default_health_check_service.h
@@ -194,7 +194,7 @@ class DefaultHealthCheckService final : public HealthCheckServiceInterface {
HealthCheckServiceImpl* service_;
ByteBuffer request_;
- TString service_name_;
+ TString service_name_;
GenericServerAsyncWriter stream_;
ServerContext ctx_;
@@ -213,7 +213,7 @@ class DefaultHealthCheckService final : public HealthCheckServiceInterface {
// Returns true on success.
static bool DecodeRequest(const ByteBuffer& request,
- TString* service_name);
+ TString* service_name);
static bool EncodeResponse(ServingStatus status, ByteBuffer* response);
// Needed to appease Windows compilers, which don't seem to allow
@@ -234,12 +234,12 @@ class DefaultHealthCheckService final : public HealthCheckServiceInterface {
DefaultHealthCheckService();
- void SetServingStatus(const TString& service_name, bool serving) override;
+ void SetServingStatus(const TString& service_name, bool serving) override;
void SetServingStatus(bool serving) override;
void Shutdown() override;
- ServingStatus GetServingStatus(const TString& service_name) const;
+ ServingStatus GetServingStatus(const TString& service_name) const;
HealthCheckServiceImpl* GetHealthCheckService(
std::unique_ptr<ServerCompletionQueue> cq);
@@ -266,16 +266,16 @@ class DefaultHealthCheckService final : public HealthCheckServiceInterface {
};
void RegisterCallHandler(
- const TString& service_name,
+ const TString& service_name,
std::shared_ptr<HealthCheckServiceImpl::CallHandler> handler);
void UnregisterCallHandler(
- const TString& service_name,
+ const TString& service_name,
const std::shared_ptr<HealthCheckServiceImpl::CallHandler>& handler);
mutable grpc_core::Mutex mu_;
- bool shutdown_ = false; // Guarded by mu_.
- std::map<TString, ServiceData> services_map_; // Guarded by mu_.
+ bool shutdown_ = false; // Guarded by mu_.
+ std::map<TString, ServiceData> services_map_; // Guarded by mu_.
std::unique_ptr<HealthCheckServiceImpl> impl_;
};
diff --git a/contrib/libs/grpc/src/cpp/server/health/health_check_service.cc b/contrib/libs/grpc/src/cpp/server/health/health_check_service.cc
index 35c194cb1b1..a0fa2d62f58 100644
--- a/contrib/libs/grpc/src/cpp/server/health/health_check_service.cc
+++ b/contrib/libs/grpc/src/cpp/server/health/health_check_service.cc
@@ -16,9 +16,9 @@
*
*/
-#include <grpcpp/health_check_service_interface.h>
+#include <grpcpp/health_check_service_interface.h>
-namespace grpc {
+namespace grpc {
namespace {
bool g_grpc_default_health_check_service_enabled = false;
} // namespace
@@ -31,4 +31,4 @@ void EnableDefaultHealthCheckService(bool enable) {
g_grpc_default_health_check_service_enabled = enable;
}
-} // namespace grpc
+} // namespace grpc
diff --git a/contrib/libs/grpc/src/cpp/server/insecure_server_credentials.cc b/contrib/libs/grpc/src/cpp/server/insecure_server_credentials.cc
index f78a4daf078..3f33f4e045c 100644
--- a/contrib/libs/grpc/src/cpp/server/insecure_server_credentials.cc
+++ b/contrib/libs/grpc/src/cpp/server/insecure_server_credentials.cc
@@ -21,11 +21,11 @@
#include <grpc/grpc.h>
#include <grpc/support/log.h>
-namespace grpc {
+namespace grpc {
namespace {
class InsecureServerCredentialsImpl final : public ServerCredentials {
public:
- int AddPortToServer(const TString& addr, grpc_server* server) override {
+ int AddPortToServer(const TString& addr, grpc_server* server) override {
return grpc_server_add_insecure_http2_port(server, addr.c_str());
}
void SetAuthMetadataProcessor(
@@ -41,4 +41,4 @@ std::shared_ptr<ServerCredentials> InsecureServerCredentials() {
new InsecureServerCredentialsImpl());
}
-} // namespace grpc
+} // namespace grpc
diff --git a/contrib/libs/grpc/src/cpp/server/load_reporter/load_data_store.cc b/contrib/libs/grpc/src/cpp/server/load_reporter/load_data_store.cc
index 46a368da918..f07fa812a7d 100644
--- a/contrib/libs/grpc/src/cpp/server/load_reporter/load_data_store.cc
+++ b/contrib/libs/grpc/src/cpp/server/load_reporter/load_data_store.cc
@@ -77,8 +77,8 @@ const typename C::value_type* RandomElement(const C& container) {
} // namespace
-LoadRecordKey::LoadRecordKey(const TString& client_ip_and_token,
- TString user_id)
+LoadRecordKey::LoadRecordKey(const TString& client_ip_and_token,
+ TString user_id)
: user_id_(std::move(user_id)) {
GPR_ASSERT(client_ip_and_token.size() >= 2);
int ip_hex_size;
@@ -98,7 +98,7 @@ LoadRecordKey::LoadRecordKey(const TString& client_ip_and_token,
}
}
-TString LoadRecordKey::GetClientIpBytes() const {
+TString LoadRecordKey::GetClientIpBytes() const {
if (client_ip_hex_.empty()) {
return "";
} else if (client_ip_hex_.size() == kIpv4AddressLength) {
@@ -110,8 +110,8 @@ TString LoadRecordKey::GetClientIpBytes() const {
return "";
}
ip_bytes = grpc_htonl(ip_bytes);
- return TString(reinterpret_cast<const char*>(&ip_bytes),
- sizeof(ip_bytes));
+ return TString(reinterpret_cast<const char*>(&ip_bytes),
+ sizeof(ip_bytes));
} else if (client_ip_hex_.size() == kIpv6AddressLength) {
uint32_t ip_bytes[4];
for (size_t i = 0; i < 4; ++i) {
@@ -125,14 +125,14 @@ TString LoadRecordKey::GetClientIpBytes() const {
}
ip_bytes[i] = grpc_htonl(ip_bytes[i]);
}
- return TString(reinterpret_cast<const char*>(ip_bytes),
- sizeof(ip_bytes));
+ return TString(reinterpret_cast<const char*>(ip_bytes),
+ sizeof(ip_bytes));
} else {
GPR_UNREACHABLE_CODE(return "");
}
}
-LoadRecordValue::LoadRecordValue(TString metric_name, uint64_t num_calls,
+LoadRecordValue::LoadRecordValue(TString metric_name, uint64_t num_calls,
double total_metric_value) {
call_metrics_.emplace(std::move(metric_name),
CallMetricValue(num_calls, total_metric_value));
@@ -177,8 +177,8 @@ uint64_t PerBalancerStore::GetNumCallsInProgressForReport() {
return num_calls_in_progress_;
}
-void PerHostStore::ReportStreamCreated(const TString& lb_id,
- const TString& load_key) {
+void PerHostStore::ReportStreamCreated(const TString& lb_id,
+ const TString& load_key) {
GPR_ASSERT(lb_id != kInvalidLbId);
SetUpForNewLbId(lb_id, load_key);
// Prior to this one, there was no load balancer receiving report, so we may
@@ -188,7 +188,7 @@ void PerHostStore::ReportStreamCreated(const TString& lb_id,
// this stream. Need to discuss with LB team.
if (assigned_stores_.size() == 1) {
for (const auto& p : per_balancer_stores_) {
- const TString& other_lb_id = p.first;
+ const TString& other_lb_id = p.first;
const std::unique_ptr<PerBalancerStore>& orphaned_store = p.second;
if (other_lb_id != lb_id) {
orphaned_store->Resume();
@@ -203,7 +203,7 @@ void PerHostStore::ReportStreamCreated(const TString& lb_id,
}
}
-void PerHostStore::ReportStreamClosed(const TString& lb_id) {
+void PerHostStore::ReportStreamClosed(const TString& lb_id) {
auto it_store_for_gone_lb = per_balancer_stores_.find(lb_id);
GPR_ASSERT(it_store_for_gone_lb != per_balancer_stores_.end());
// Remove this closed stream from our records.
@@ -215,7 +215,7 @@ void PerHostStore::ReportStreamClosed(const TString& lb_id) {
// The stores that were assigned to this balancer are orphaned now. They
// should be re-assigned to other balancers which are still receiving reports.
for (PerBalancerStore* orphaned_store : orphaned_stores) {
- const TString* new_receiver = nullptr;
+ const TString* new_receiver = nullptr;
auto it = load_key_to_receiving_lb_ids_.find(orphaned_store->load_key());
if (it != load_key_to_receiving_lb_ids_.end()) {
// First, try to pick from the active balancers with the same load key.
@@ -235,21 +235,21 @@ void PerHostStore::ReportStreamClosed(const TString& lb_id) {
}
PerBalancerStore* PerHostStore::FindPerBalancerStore(
- const TString& lb_id) const {
+ const TString& lb_id) const {
return per_balancer_stores_.find(lb_id) != per_balancer_stores_.end()
? per_balancer_stores_.find(lb_id)->second.get()
: nullptr;
}
const std::set<PerBalancerStore*>* PerHostStore::GetAssignedStores(
- const TString& lb_id) const {
+ const TString& lb_id) const {
auto it = assigned_stores_.find(lb_id);
if (it == assigned_stores_.end()) return nullptr;
return &(it->second);
}
void PerHostStore::AssignOrphanedStore(PerBalancerStore* orphaned_store,
- const TString& new_receiver) {
+ const TString& new_receiver) {
auto it = assigned_stores_.find(new_receiver);
GPR_ASSERT(it != assigned_stores_.end());
it->second.insert(orphaned_store);
@@ -260,8 +260,8 @@ void PerHostStore::AssignOrphanedStore(PerBalancerStore* orphaned_store,
new_receiver.c_str());
}
-void PerHostStore::SetUpForNewLbId(const TString& lb_id,
- const TString& load_key) {
+void PerHostStore::SetUpForNewLbId(const TString& lb_id,
+ const TString& load_key) {
// The top-level caller (i.e., LoadReportService) should guarantee the
// lb_id is unique for each reporting stream.
GPR_ASSERT(per_balancer_stores_.find(lb_id) == per_balancer_stores_.end());
@@ -284,7 +284,7 @@ PerBalancerStore* LoadDataStore::FindPerBalancerStore(
}
}
-void LoadDataStore::MergeRow(const TString& hostname,
+void LoadDataStore::MergeRow(const TString& hostname,
const LoadRecordKey& key,
const LoadRecordValue& value) {
PerBalancerStore* per_balancer_store =
@@ -315,20 +315,20 @@ void LoadDataStore::MergeRow(const TString& hostname,
}
const std::set<PerBalancerStore*>* LoadDataStore::GetAssignedStores(
- const TString& hostname, const TString& lb_id) {
+ const TString& hostname, const TString& lb_id) {
auto it = per_host_stores_.find(hostname);
if (it == per_host_stores_.end()) return nullptr;
return it->second.GetAssignedStores(lb_id);
}
-void LoadDataStore::ReportStreamCreated(const TString& hostname,
- const TString& lb_id,
- const TString& load_key) {
+void LoadDataStore::ReportStreamCreated(const TString& hostname,
+ const TString& lb_id,
+ const TString& load_key) {
per_host_stores_[hostname].ReportStreamCreated(lb_id, load_key);
}
-void LoadDataStore::ReportStreamClosed(const TString& hostname,
- const TString& lb_id) {
+void LoadDataStore::ReportStreamClosed(const TString& hostname,
+ const TString& lb_id) {
auto it_per_host_store = per_host_stores_.find(hostname);
GPR_ASSERT(it_per_host_store != per_host_stores_.end());
it_per_host_store->second.ReportStreamClosed(lb_id);
diff --git a/contrib/libs/grpc/src/cpp/server/load_reporter/load_data_store.h b/contrib/libs/grpc/src/cpp/server/load_reporter/load_data_store.h
index f6a31b87bce..61ba618331a 100644
--- a/contrib/libs/grpc/src/cpp/server/load_reporter/load_data_store.h
+++ b/contrib/libs/grpc/src/cpp/server/load_reporter/load_data_store.h
@@ -30,8 +30,8 @@
#include "src/cpp/server/load_reporter/constants.h"
-#include <util/string/cast.h>
-
+#include <util/string/cast.h>
+
namespace grpc {
namespace load_reporter {
@@ -69,17 +69,17 @@ class CallMetricValue {
// The key of a load record.
class LoadRecordKey {
public:
- LoadRecordKey(TString lb_id, TString lb_tag, TString user_id,
- TString client_ip_hex)
+ LoadRecordKey(TString lb_id, TString lb_tag, TString user_id,
+ TString client_ip_hex)
: lb_id_(std::move(lb_id)),
lb_tag_(std::move(lb_tag)),
user_id_(std::move(user_id)),
client_ip_hex_(std::move(client_ip_hex)) {}
// Parses the input client_ip_and_token to set client IP, LB ID, and LB tag.
- LoadRecordKey(const TString& client_ip_and_token, TString user_id);
+ LoadRecordKey(const TString& client_ip_and_token, TString user_id);
- TString ToString() const {
+ TString ToString() const {
return "[lb_id_=" + lb_id_ + ", lb_tag_=" + lb_tag_ +
", user_id_=" + user_id_ + ", client_ip_hex_=" + client_ip_hex_ +
"]";
@@ -91,17 +91,17 @@ class LoadRecordKey {
}
// Gets the client IP bytes in network order (i.e., big-endian).
- TString GetClientIpBytes() const;
+ TString GetClientIpBytes() const;
// Getters.
- const TString& lb_id() const { return lb_id_; }
- const TString& lb_tag() const { return lb_tag_; }
- const TString& user_id() const { return user_id_; }
- const TString& client_ip_hex() const { return client_ip_hex_; }
+ const TString& lb_id() const { return lb_id_; }
+ const TString& lb_tag() const { return lb_tag_; }
+ const TString& user_id() const { return user_id_; }
+ const TString& client_ip_hex() const { return client_ip_hex_; }
struct Hasher {
- void hash_combine(size_t* seed, const TString& k) const {
- *seed ^= std::hash<TString>()(k) + 0x9e3779b9 + (*seed << 6) +
+ void hash_combine(size_t* seed, const TString& k) const {
+ *seed ^= std::hash<TString>()(k) + 0x9e3779b9 + (*seed << 6) +
(*seed >> 2);
}
@@ -116,10 +116,10 @@ class LoadRecordKey {
};
private:
- TString lb_id_;
- TString lb_tag_;
- TString user_id_;
- TString client_ip_hex_;
+ TString lb_id_;
+ TString lb_tag_;
+ TString user_id_;
+ TString client_ip_hex_;
};
// The value of a load record.
@@ -135,7 +135,7 @@ class LoadRecordValue {
bytes_recv_(bytes_recv),
latency_ms_(latency_ms) {}
- LoadRecordValue(TString metric_name, uint64_t num_calls,
+ LoadRecordValue(TString metric_name, uint64_t num_calls,
double total_metric_value);
void MergeFrom(const LoadRecordValue& other) {
@@ -146,7 +146,7 @@ class LoadRecordValue {
bytes_recv_ += other.bytes_recv_;
latency_ms_ += other.latency_ms_;
for (const auto& p : other.call_metrics_) {
- const TString& key = p.first;
+ const TString& key = p.first;
const CallMetricValue& value = p.second;
call_metrics_[key].MergeFrom(value);
}
@@ -156,17 +156,17 @@ class LoadRecordValue {
return static_cast<int64_t>(start_count_ - ok_count_ - error_count_);
}
- TString ToString() const {
- return "[start_count_=" + ::ToString(start_count_) +
- ", ok_count_=" + ::ToString(ok_count_) +
- ", error_count_=" + ::ToString(error_count_) +
- ", bytes_sent_=" + ::ToString(bytes_sent_) +
- ", bytes_recv_=" + ::ToString(bytes_recv_) +
- ", latency_ms_=" + ::ToString(latency_ms_) + ", " +
- ::ToString(call_metrics_.size()) + " other call metric(s)]";
+ TString ToString() const {
+ return "[start_count_=" + ::ToString(start_count_) +
+ ", ok_count_=" + ::ToString(ok_count_) +
+ ", error_count_=" + ::ToString(error_count_) +
+ ", bytes_sent_=" + ::ToString(bytes_sent_) +
+ ", bytes_recv_=" + ::ToString(bytes_recv_) +
+ ", latency_ms_=" + ::ToString(latency_ms_) + ", " +
+ ::ToString(call_metrics_.size()) + " other call metric(s)]";
}
- bool InsertCallMetric(const TString& metric_name,
+ bool InsertCallMetric(const TString& metric_name,
const CallMetricValue& metric_value) {
return call_metrics_.insert({metric_name, metric_value}).second;
}
@@ -178,7 +178,7 @@ class LoadRecordValue {
uint64_t bytes_sent() const { return bytes_sent_; }
uint64_t bytes_recv() const { return bytes_recv_; }
uint64_t latency_ms() const { return latency_ms_; }
- const std::unordered_map<TString, CallMetricValue>& call_metrics() const {
+ const std::unordered_map<TString, CallMetricValue>& call_metrics() const {
return call_metrics_;
}
@@ -189,7 +189,7 @@ class LoadRecordValue {
uint64_t bytes_sent_ = 0;
uint64_t bytes_recv_ = 0;
uint64_t latency_ms_ = 0;
- std::unordered_map<TString, CallMetricValue> call_metrics_;
+ std::unordered_map<TString, CallMetricValue> call_metrics_;
};
// Stores the data associated with a particular LB ID.
@@ -198,7 +198,7 @@ class PerBalancerStore {
using LoadRecordMap =
std::unordered_map<LoadRecordKey, LoadRecordValue, LoadRecordKey::Hasher>;
- PerBalancerStore(TString lb_id, TString load_key)
+ PerBalancerStore(TString lb_id, TString load_key)
: lb_id_(std::move(lb_id)), load_key_(std::move(load_key)) {}
// Merge a load record with the given key and value if the store is not
@@ -218,7 +218,7 @@ class PerBalancerStore {
uint64_t GetNumCallsInProgressForReport();
- TString ToString() {
+ TString ToString() {
return "[PerBalancerStore lb_id_=" + lb_id_ + " load_key_=" + load_key_ +
"]";
}
@@ -226,14 +226,14 @@ class PerBalancerStore {
void ClearLoadRecordMap() { load_record_map_.clear(); }
// Getters.
- const TString& lb_id() const { return lb_id_; }
- const TString& load_key() const { return load_key_; }
+ const TString& lb_id() const { return lb_id_; }
+ const TString& load_key() const { return load_key_; }
const LoadRecordMap& load_record_map() const { return load_record_map_; }
private:
- TString lb_id_;
+ TString lb_id_;
// TODO(juanlishen): Use bytestring protobuf type?
- TString load_key_;
+ TString load_key_;
LoadRecordMap load_record_map_;
uint64_t num_calls_in_progress_ = 0;
uint64_t last_reported_num_calls_in_progress_ = 0;
@@ -247,39 +247,39 @@ class PerHostStore {
// LB ID (guaranteed unique) associated with that stream. If it is the only
// active store, adopt all the orphaned stores. If it is the first created
// store, adopt the store of kInvalidLbId.
- void ReportStreamCreated(const TString& lb_id,
- const TString& load_key);
+ void ReportStreamCreated(const TString& lb_id,
+ const TString& load_key);
// When a report stream is closed, the PerBalancerStores assigned to the
// associate LB ID need to be re-assigned to other active balancers,
// ideally with the same load key. If there is no active balancer, we have
// to suspend those stores and drop the incoming load data until they are
// resumed.
- void ReportStreamClosed(const TString& lb_id);
+ void ReportStreamClosed(const TString& lb_id);
// Returns null if not found. Caller doesn't own the returned store.
- PerBalancerStore* FindPerBalancerStore(const TString& lb_id) const;
+ PerBalancerStore* FindPerBalancerStore(const TString& lb_id) const;
// Returns null if lb_id is not found. The returned pointer points to the
// underlying data structure, which is not owned by the caller.
const std::set<PerBalancerStore*>* GetAssignedStores(
- const TString& lb_id) const;
+ const TString& lb_id) const;
private:
// Creates a PerBalancerStore for the given LB ID, assigns the store to
// itself, and records the LB ID to the load key.
- void SetUpForNewLbId(const TString& lb_id, const TString& load_key);
+ void SetUpForNewLbId(const TString& lb_id, const TString& load_key);
void AssignOrphanedStore(PerBalancerStore* orphaned_store,
- const TString& new_receiver);
+ const TString& new_receiver);
- std::unordered_map<TString, std::set<TString>>
+ std::unordered_map<TString, std::set<TString>>
load_key_to_receiving_lb_ids_;
// Key: LB ID. The key set includes all the LB IDs that have been
// allocated for reporting streams so far.
// Value: the unique pointer to the PerBalancerStore of the LB ID.
- std::unordered_map<TString, std::unique_ptr<PerBalancerStore>>
+ std::unordered_map<TString, std::unique_ptr<PerBalancerStore>>
per_balancer_stores_;
// Key: LB ID. The key set includes the LB IDs of the balancers that are
@@ -287,7 +287,7 @@ class PerHostStore {
// Value: the set of raw pointers to the PerBalancerStores assigned to the LB
// ID. Note that the sets in assigned_stores_ form a division of the value set
// of per_balancer_stores_.
- std::unordered_map<TString, std::set<PerBalancerStore*>> assigned_stores_;
+ std::unordered_map<TString, std::set<PerBalancerStore*>> assigned_stores_;
};
// Thread-unsafe two-level bookkeeper of all the load data.
@@ -302,8 +302,8 @@ class PerHostStore {
class LoadDataStore {
public:
// Returns null if not found. Caller doesn't own the returned store.
- PerBalancerStore* FindPerBalancerStore(const TString& hostname,
- const TString& lb_id) const;
+ PerBalancerStore* FindPerBalancerStore(const TString& hostname,
+ const TString& lb_id) const;
// Returns null if hostname or lb_id is not found. The returned pointer points
// to the underlying data structure, which is not owned by the caller.
@@ -313,33 +313,33 @@ class LoadDataStore {
// If a PerBalancerStore can be found by the hostname and LB ID in
// LoadRecordKey, the load data will be merged to that store. Otherwise,
// only track the number of the in-progress calls for this unknown LB ID.
- void MergeRow(const TString& hostname, const LoadRecordKey& key,
+ void MergeRow(const TString& hostname, const LoadRecordKey& key,
const LoadRecordValue& value);
// Is the given lb_id a tracked unknown LB ID (i.e., the LB ID was associated
// with some received load data but unknown to this load data store)?
- bool IsTrackedUnknownBalancerId(const TString& lb_id) const {
+ bool IsTrackedUnknownBalancerId(const TString& lb_id) const {
return unknown_balancer_id_trackers_.find(lb_id) !=
unknown_balancer_id_trackers_.end();
}
// Wrapper around PerHostStore::ReportStreamCreated.
- void ReportStreamCreated(const TString& hostname,
- const TString& lb_id,
- const TString& load_key);
+ void ReportStreamCreated(const TString& hostname,
+ const TString& lb_id,
+ const TString& load_key);
// Wrapper around PerHostStore::ReportStreamClosed.
- void ReportStreamClosed(const TString& hostname,
- const TString& lb_id);
+ void ReportStreamClosed(const TString& hostname,
+ const TString& lb_id);
private:
// Buffered data that was fetched from Census but hasn't been sent to
// balancer. We need to keep this data ourselves because Census will
// delete the data once it's returned.
- std::unordered_map<TString, PerHostStore> per_host_stores_;
+ std::unordered_map<TString, PerHostStore> per_host_stores_;
// Tracks the number of in-progress calls for each unknown LB ID.
- std::unordered_map<TString, uint64_t> unknown_balancer_id_trackers_;
+ std::unordered_map<TString, uint64_t> unknown_balancer_id_trackers_;
};
} // namespace load_reporter
diff --git a/contrib/libs/grpc/src/cpp/server/load_reporter/util.cc b/contrib/libs/grpc/src/cpp/server/load_reporter/util.cc
index b1acde10107..24ad9f3f248 100644
--- a/contrib/libs/grpc/src/cpp/server/load_reporter/util.cc
+++ b/contrib/libs/grpc/src/cpp/server/load_reporter/util.cc
@@ -24,14 +24,14 @@
#include <grpc/support/log.h>
-namespace grpc {
+namespace grpc {
namespace load_reporter {
namespace experimental {
void AddLoadReportingCost(grpc::ServerContext* ctx,
- const TString& cost_name, double cost_value) {
+ const TString& cost_name, double cost_value) {
if (std::isnormal(cost_value)) {
- TString buf;
+ TString buf;
buf.resize(sizeof(cost_value) + cost_name.size());
memcpy(&(*buf.begin()), &cost_value, sizeof(cost_value));
memcpy(&(*buf.begin()) + sizeof(cost_value), cost_name.data(),
@@ -44,4 +44,4 @@ void AddLoadReportingCost(grpc::ServerContext* ctx,
} // namespace experimental
} // namespace load_reporter
-} // namespace grpc
+} // namespace grpc
diff --git a/contrib/libs/grpc/src/cpp/server/secure_server_credentials.cc b/contrib/libs/grpc/src/cpp/server/secure_server_credentials.cc
index b084b01836e..732602bcb70 100644
--- a/contrib/libs/grpc/src/cpp/server/secure_server_credentials.cc
+++ b/contrib/libs/grpc/src/cpp/server/secure_server_credentials.cc
@@ -21,7 +21,7 @@
#include <memory>
#include <grpcpp/impl/codegen/slice.h>
-#include <grpcpp/impl/grpc_library.h>
+#include <grpcpp/impl/grpc_library.h>
#include <grpcpp/security/auth_metadata_processor.h>
#include "src/cpp/common/secure_auth_context.h"
@@ -92,7 +92,7 @@ void AuthMetadataProcessorAyncWrapper::InvokeProcessor(
status.error_message().c_str());
}
-int SecureServerCredentials::AddPortToServer(const TString& addr,
+int SecureServerCredentials::AddPortToServer(const TString& addr,
grpc_server* server) {
return grpc_server_add_secure_http2_port(server, addr.c_str(), creds_);
}
@@ -145,11 +145,11 @@ std::shared_ptr<ServerCredentials> LocalServerCredentials(
}
std::shared_ptr<ServerCredentials> TlsServerCredentials(
- const grpc::experimental::TlsCredentialsOptions& options) {
- grpc::GrpcLibraryCodegen init;
- return std::shared_ptr<ServerCredentials>(new SecureServerCredentials(
- grpc_tls_server_credentials_create(options.c_credentials_options())));
+ const grpc::experimental::TlsCredentialsOptions& options) {
+ grpc::GrpcLibraryCodegen init;
+ return std::shared_ptr<ServerCredentials>(new SecureServerCredentials(
+ grpc_tls_server_credentials_create(options.c_credentials_options())));
}
} // namespace experimental
-} // namespace grpc
+} // namespace grpc
diff --git a/contrib/libs/grpc/src/cpp/server/secure_server_credentials.h b/contrib/libs/grpc/src/cpp/server/secure_server_credentials.h
index 9a09c2314fa..9e3fb3f9ebf 100644
--- a/contrib/libs/grpc/src/cpp/server/secure_server_credentials.h
+++ b/contrib/libs/grpc/src/cpp/server/secure_server_credentials.h
@@ -28,7 +28,7 @@
#include "src/cpp/server/thread_pool_interface.h"
-namespace grpc {
+namespace grpc {
class SecureServerCredentials;
@@ -64,7 +64,7 @@ class SecureServerCredentials final : public ServerCredentials {
grpc_server_credentials_release(creds_);
}
- int AddPortToServer(const TString& addr, grpc_server* server) override;
+ int AddPortToServer(const TString& addr, grpc_server* server) override;
void SetAuthMetadataProcessor(
const std::shared_ptr<grpc::AuthMetadataProcessor>& processor) override;
@@ -74,6 +74,6 @@ class SecureServerCredentials final : public ServerCredentials {
std::unique_ptr<grpc::AuthMetadataProcessorAyncWrapper> processor_;
};
-} // namespace grpc
+} // namespace grpc
#endif // GRPC_INTERNAL_CPP_SERVER_SECURE_SERVER_CREDENTIALS_H
diff --git a/contrib/libs/grpc/src/cpp/server/server_builder.cc b/contrib/libs/grpc/src/cpp/server/server_builder.cc
index e3a9f4e4a60..0cc00b365ff 100644
--- a/contrib/libs/grpc/src/cpp/server/server_builder.cc
+++ b/contrib/libs/grpc/src/cpp/server/server_builder.cc
@@ -26,21 +26,21 @@
#include <utility>
-#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gpr/useful.h"
#include "src/cpp/server/external_connection_acceptor_impl.h"
#include "src/cpp/server/thread_pool_interface.h"
-namespace grpc {
+namespace grpc {
-static std::vector<std::unique_ptr<ServerBuilderPlugin> (*)()>*
+static std::vector<std::unique_ptr<ServerBuilderPlugin> (*)()>*
g_plugin_factory_list;
static gpr_once once_init_plugin_list = GPR_ONCE_INIT;
static void do_plugin_list_init(void) {
g_plugin_factory_list =
- new std::vector<std::unique_ptr<ServerBuilderPlugin> (*)()>();
+ new std::vector<std::unique_ptr<ServerBuilderPlugin> (*)()>();
}
ServerBuilder::ServerBuilder()
@@ -68,29 +68,29 @@ ServerBuilder::~ServerBuilder() {
}
}
-std::unique_ptr<grpc::ServerCompletionQueue> ServerBuilder::AddCompletionQueue(
+std::unique_ptr<grpc::ServerCompletionQueue> ServerBuilder::AddCompletionQueue(
bool is_frequently_polled) {
- grpc::ServerCompletionQueue* cq = new grpc::ServerCompletionQueue(
+ grpc::ServerCompletionQueue* cq = new grpc::ServerCompletionQueue(
GRPC_CQ_NEXT,
is_frequently_polled ? GRPC_CQ_DEFAULT_POLLING : GRPC_CQ_NON_LISTENING,
nullptr);
cqs_.push_back(cq);
- return std::unique_ptr<grpc::ServerCompletionQueue>(cq);
+ return std::unique_ptr<grpc::ServerCompletionQueue>(cq);
}
-ServerBuilder& ServerBuilder::RegisterService(Service* service) {
+ServerBuilder& ServerBuilder::RegisterService(Service* service) {
services_.emplace_back(new NamedService(service));
return *this;
}
-ServerBuilder& ServerBuilder::RegisterService(const TString& addr,
- Service* service) {
+ServerBuilder& ServerBuilder::RegisterService(const TString& addr,
+ Service* service) {
services_.emplace_back(new NamedService(addr, service));
return *this;
}
ServerBuilder& ServerBuilder::RegisterAsyncGenericService(
- AsyncGenericService* service) {
+ AsyncGenericService* service) {
if (generic_service_ || callback_generic_service_) {
gpr_log(GPR_ERROR,
"Adding multiple generic services is unsupported for now. "
@@ -102,22 +102,22 @@ ServerBuilder& ServerBuilder::RegisterAsyncGenericService(
return *this;
}
-#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL
-ServerBuilder& ServerBuilder::RegisterCallbackGenericService(
- CallbackGenericService* service) {
- if (generic_service_ || callback_generic_service_) {
- gpr_log(GPR_ERROR,
- "Adding multiple generic services is unsupported for now. "
- "Dropping the service %p",
- (void*)service);
- } else {
- callback_generic_service_ = service;
- }
- return *this;
-}
-#else
+#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL
+ServerBuilder& ServerBuilder::RegisterCallbackGenericService(
+ CallbackGenericService* service) {
+ if (generic_service_ || callback_generic_service_) {
+ gpr_log(GPR_ERROR,
+ "Adding multiple generic services is unsupported for now. "
+ "Dropping the service %p",
+ (void*)service);
+ } else {
+ callback_generic_service_ = service;
+ }
+ return *this;
+}
+#else
ServerBuilder& ServerBuilder::experimental_type::RegisterCallbackGenericService(
- experimental::CallbackGenericService* service) {
+ experimental::CallbackGenericService* service) {
if (builder_->generic_service_ || builder_->callback_generic_service_) {
gpr_log(GPR_ERROR,
"Adding multiple generic services is unsupported for now. "
@@ -128,13 +128,13 @@ ServerBuilder& ServerBuilder::experimental_type::RegisterCallbackGenericService(
}
return *builder_;
}
-#endif
+#endif
std::unique_ptr<grpc::experimental::ExternalConnectionAcceptor>
ServerBuilder::experimental_type::AddExternalConnectionAcceptor(
experimental_type::ExternalConnectionType type,
std::shared_ptr<ServerCredentials> creds) {
- TString name_prefix("external:");
+ TString name_prefix("external:");
char count_str[GPR_LTOA_MIN_BUFSIZE];
gpr_ltoa(static_cast<long>(builder_->acceptors_.size()), count_str);
builder_->acceptors_.emplace_back(
@@ -144,7 +144,7 @@ ServerBuilder::experimental_type::AddExternalConnectionAcceptor(
}
ServerBuilder& ServerBuilder::SetOption(
- std::unique_ptr<ServerBuilderOption> option) {
+ std::unique_ptr<ServerBuilderOption> option) {
options_.push_back(std::move(option));
return *this;
}
@@ -193,7 +193,7 @@ ServerBuilder& ServerBuilder::SetDefaultCompressionAlgorithm(
}
ServerBuilder& ServerBuilder::SetResourceQuota(
- const grpc::ResourceQuota& resource_quota) {
+ const grpc::ResourceQuota& resource_quota) {
if (resource_quota_ != nullptr) {
grpc_resource_quota_unref(resource_quota_);
}
@@ -203,10 +203,10 @@ ServerBuilder& ServerBuilder::SetResourceQuota(
}
ServerBuilder& ServerBuilder::AddListeningPort(
- const TString& addr_uri, std::shared_ptr<ServerCredentials> creds,
- int* selected_port) {
- const TString uri_scheme = "dns:";
- TString addr = addr_uri;
+ const TString& addr_uri, std::shared_ptr<ServerCredentials> creds,
+ int* selected_port) {
+ const TString uri_scheme = "dns:";
+ TString addr = addr_uri;
if (addr_uri.compare(0, uri_scheme.size(), uri_scheme) == 0) {
size_t pos = uri_scheme.size();
while (addr_uri[pos] == '/') ++pos; // Skip slashes.
@@ -222,13 +222,13 @@ std::unique_ptr<grpc::Server> ServerBuilder::BuildAndStart() {
if (max_receive_message_size_ >= -1) {
args.SetInt(GRPC_ARG_MAX_RECEIVE_MESSAGE_LENGTH, max_receive_message_size_);
}
- if (max_send_message_size_ >= -1) {
+ if (max_send_message_size_ >= -1) {
args.SetInt(GRPC_ARG_MAX_SEND_MESSAGE_LENGTH, max_send_message_size_);
}
- for (const auto& option : options_) {
- option->UpdateArguments(&args);
- option->UpdatePlugins(&plugins_);
- }
+ for (const auto& option : options_) {
+ option->UpdateArguments(&args);
+ option->UpdatePlugins(&plugins_);
+ }
args.SetInt(GRPC_COMPRESSION_CHANNEL_ENABLED_ALGORITHMS_BITSET,
enabled_compression_algorithms_bitset_);
if (maybe_default_compression_level_.is_set) {
@@ -245,11 +245,11 @@ std::unique_ptr<grpc::Server> ServerBuilder::BuildAndStart() {
grpc_resource_quota_arg_vtable());
}
- for (const auto& plugin : plugins_) {
- plugin->UpdateServerBuilder(this);
- plugin->UpdateChannelArguments(&args);
- }
-
+ for (const auto& plugin : plugins_) {
+ plugin->UpdateServerBuilder(this);
+ plugin->UpdateChannelArguments(&args);
+ }
+
// == Determine if the server has any syncrhonous methods ==
bool has_sync_methods = false;
for (const auto& value : services_) {
@@ -275,10 +275,10 @@ std::unique_ptr<grpc::Server> ServerBuilder::BuildAndStart() {
// This is different from the completion queues added to the server via
// ServerBuilder's AddCompletionQueue() method (those completion queues
// are in 'cqs_' member variable of ServerBuilder object)
- std::shared_ptr<std::vector<std::unique_ptr<grpc::ServerCompletionQueue>>>
- sync_server_cqs(
- std::make_shared<
- std::vector<std::unique_ptr<grpc::ServerCompletionQueue>>>());
+ std::shared_ptr<std::vector<std::unique_ptr<grpc::ServerCompletionQueue>>>
+ sync_server_cqs(
+ std::make_shared<
+ std::vector<std::unique_ptr<grpc::ServerCompletionQueue>>>());
bool has_frequently_polled_cqs = false;
for (const auto& cq : cqs_) {
@@ -307,7 +307,7 @@ std::unique_ptr<grpc::Server> ServerBuilder::BuildAndStart() {
// Create completion queues to listen to incoming rpc requests
for (int i = 0; i < sync_server_settings_.num_cqs; i++) {
sync_server_cqs->emplace_back(
- new grpc::ServerCompletionQueue(GRPC_CQ_NEXT, polling_type, nullptr));
+ new grpc::ServerCompletionQueue(GRPC_CQ_NEXT, polling_type, nullptr));
}
}
@@ -329,20 +329,20 @@ std::unique_ptr<grpc::Server> ServerBuilder::BuildAndStart() {
}
std::unique_ptr<grpc::Server> server(new grpc::Server(
- &args, sync_server_cqs, sync_server_settings_.min_pollers,
- sync_server_settings_.max_pollers, sync_server_settings_.cq_timeout_msec,
- std::move(acceptors_), resource_quota_,
- std::move(interceptor_creators_)));
+ &args, sync_server_cqs, sync_server_settings_.min_pollers,
+ sync_server_settings_.max_pollers, sync_server_settings_.cq_timeout_msec,
+ std::move(acceptors_), resource_quota_,
+ std::move(interceptor_creators_)));
- ServerInitializer* initializer = server->initializer();
+ ServerInitializer* initializer = server->initializer();
// Register all the completion queues with the server. i.e
// 1. sync_server_cqs: internal completion queues created IF this is a sync
// server
// 2. cqs_: Completion queues added via AddCompletionQueue() call
- for (const auto& cq : *sync_server_cqs) {
- grpc_server_register_completion_queue(server->server_, cq->cq(), nullptr);
+ for (const auto& cq : *sync_server_cqs) {
+ grpc_server_register_completion_queue(server->server_, cq->cq(), nullptr);
has_frequently_polled_cqs = true;
}
@@ -355,12 +355,12 @@ std::unique_ptr<grpc::Server> ServerBuilder::BuildAndStart() {
// AddCompletionQueue() API. Some of them may not be frequently polled (i.e by
// calling Next() or AsyncNext()) and hence are not safe to be used for
// listening to incoming channels. Such completion queues must be registered
- // as non-listening queues. In debug mode, these should have their server list
- // tracked since these are provided the user and must be Shutdown by the user
- // after the server is shutdown.
- for (const auto& cq : cqs_) {
- grpc_server_register_completion_queue(server->server_, cq->cq(), nullptr);
- cq->RegisterServer(server.get());
+ // as non-listening queues. In debug mode, these should have their server list
+ // tracked since these are provided the user and must be Shutdown by the user
+ // after the server is shutdown.
+ for (const auto& cq : cqs_) {
+ grpc_server_register_completion_queue(server->server_, cq->cq(), nullptr);
+ cq->RegisterServer(server.get());
}
if (!has_frequently_polled_cqs) {
@@ -416,7 +416,7 @@ std::unique_ptr<grpc::Server> ServerBuilder::BuildAndStart() {
}
void ServerBuilder::InternalAddPluginFactory(
- std::unique_ptr<ServerBuilderPlugin> (*CreatePlugin)()) {
+ std::unique_ptr<ServerBuilderPlugin> (*CreatePlugin)()) {
gpr_once_init(&once_init_plugin_list, do_plugin_list_init);
(*g_plugin_factory_list).push_back(CreatePlugin);
}
@@ -431,4 +431,4 @@ ServerBuilder& ServerBuilder::EnableWorkaround(grpc_workaround_list id) {
}
}
-} // namespace grpc
+} // namespace grpc
diff --git a/contrib/libs/grpc/src/cpp/server/server_callback.cc b/contrib/libs/grpc/src/cpp/server/server_callback.cc
index d2963851dcb..40aef8e7359 100644
--- a/contrib/libs/grpc/src/cpp/server/server_callback.cc
+++ b/contrib/libs/grpc/src/cpp/server/server_callback.cc
@@ -15,70 +15,70 @@
*
*/
-#include <grpcpp/impl/codegen/server_callback.h>
+#include <grpcpp/impl/codegen/server_callback.h>
#include "src/core/lib/iomgr/closure.h"
#include "src/core/lib/iomgr/exec_ctx.h"
#include "src/core/lib/iomgr/executor.h"
-namespace grpc {
+namespace grpc {
namespace internal {
-void ServerCallbackCall::ScheduleOnDone(bool inline_ondone) {
- if (inline_ondone) {
- CallOnDone();
- } else {
- // Unlike other uses of closure, do not Ref or Unref here since at this
- // point, all the Ref'fing and Unref'fing is done for this call.
- grpc_core::ExecCtx exec_ctx;
- struct ClosureWithArg {
- grpc_closure closure;
- ServerCallbackCall* call;
- explicit ClosureWithArg(ServerCallbackCall* call_arg) : call(call_arg) {
- GRPC_CLOSURE_INIT(&closure,
- [](void* void_arg, grpc_error*) {
- ClosureWithArg* arg =
- static_cast<ClosureWithArg*>(void_arg);
- arg->call->CallOnDone();
- delete arg;
- },
- this, grpc_schedule_on_exec_ctx);
- }
- };
- ClosureWithArg* arg = new ClosureWithArg(this);
- grpc_core::Executor::Run(&arg->closure, GRPC_ERROR_NONE);
- }
-}
-
+void ServerCallbackCall::ScheduleOnDone(bool inline_ondone) {
+ if (inline_ondone) {
+ CallOnDone();
+ } else {
+ // Unlike other uses of closure, do not Ref or Unref here since at this
+ // point, all the Ref'fing and Unref'fing is done for this call.
+ grpc_core::ExecCtx exec_ctx;
+ struct ClosureWithArg {
+ grpc_closure closure;
+ ServerCallbackCall* call;
+ explicit ClosureWithArg(ServerCallbackCall* call_arg) : call(call_arg) {
+ GRPC_CLOSURE_INIT(&closure,
+ [](void* void_arg, grpc_error*) {
+ ClosureWithArg* arg =
+ static_cast<ClosureWithArg*>(void_arg);
+ arg->call->CallOnDone();
+ delete arg;
+ },
+ this, grpc_schedule_on_exec_ctx);
+ }
+ };
+ ClosureWithArg* arg = new ClosureWithArg(this);
+ grpc_core::Executor::Run(&arg->closure, GRPC_ERROR_NONE);
+ }
+}
+
void ServerCallbackCall::CallOnCancel(ServerReactor* reactor) {
if (reactor->InternalInlineable()) {
reactor->OnCancel();
} else {
- // Ref to make sure that the closure executes before the whole call gets
- // destructed, and Unref within the closure.
+ // Ref to make sure that the closure executes before the whole call gets
+ // destructed, and Unref within the closure.
Ref();
grpc_core::ExecCtx exec_ctx;
- struct ClosureWithArg {
- grpc_closure closure;
+ struct ClosureWithArg {
+ grpc_closure closure;
ServerCallbackCall* call;
ServerReactor* reactor;
- ClosureWithArg(ServerCallbackCall* call_arg, ServerReactor* reactor_arg)
- : call(call_arg), reactor(reactor_arg) {
- GRPC_CLOSURE_INIT(&closure,
- [](void* void_arg, grpc_error*) {
- ClosureWithArg* arg =
- static_cast<ClosureWithArg*>(void_arg);
- arg->reactor->OnCancel();
- arg->call->MaybeDone();
- delete arg;
- },
- this, grpc_schedule_on_exec_ctx);
- }
+ ClosureWithArg(ServerCallbackCall* call_arg, ServerReactor* reactor_arg)
+ : call(call_arg), reactor(reactor_arg) {
+ GRPC_CLOSURE_INIT(&closure,
+ [](void* void_arg, grpc_error*) {
+ ClosureWithArg* arg =
+ static_cast<ClosureWithArg*>(void_arg);
+ arg->reactor->OnCancel();
+ arg->call->MaybeDone();
+ delete arg;
+ },
+ this, grpc_schedule_on_exec_ctx);
+ }
};
- ClosureWithArg* arg = new ClosureWithArg(this, reactor);
- grpc_core::Executor::Run(&arg->closure, GRPC_ERROR_NONE);
+ ClosureWithArg* arg = new ClosureWithArg(this, reactor);
+ grpc_core::Executor::Run(&arg->closure, GRPC_ERROR_NONE);
}
}
} // namespace internal
-} // namespace grpc
+} // namespace grpc
diff --git a/contrib/libs/grpc/src/cpp/server/server_cc.cc b/contrib/libs/grpc/src/cpp/server/server_cc.cc
index d8725fe0eb3..c2a911c7f7c 100644
--- a/contrib/libs/grpc/src/cpp/server/server_cc.cc
+++ b/contrib/libs/grpc/src/cpp/server/server_cc.cc
@@ -23,7 +23,7 @@
#include <utility>
#include <grpc/grpc.h>
-#include <grpc/impl/codegen/grpc_types.h>
+#include <grpc/impl/codegen/grpc_types.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpcpp/completion_queue.h>
@@ -47,14 +47,14 @@
#include "src/core/lib/profiling/timers.h"
#include "src/core/lib/surface/call.h"
#include "src/core/lib/surface/completion_queue.h"
-#include "src/core/lib/surface/server.h"
+#include "src/core/lib/surface/server.h"
#include "src/cpp/client/create_channel_internal.h"
#include "src/cpp/server/external_connection_acceptor_impl.h"
#include "src/cpp/server/health/default_health_check_service.h"
#include "src/cpp/thread_manager/thread_manager.h"
-#include <util/stream/str.h>
-
+#include <util/stream/str.h>
+
namespace grpc {
namespace {
@@ -99,15 +99,15 @@ class UnimplementedAsyncRequestContext {
GenericServerAsyncReaderWriter generic_stream_;
};
-// TODO(vjpai): Just for this file, use some contents of the experimental
-// namespace here to make the code easier to read below. Remove this when
-// de-experimentalized fully.
-#ifndef GRPC_CALLBACK_API_NONEXPERIMENTAL
-using ::grpc::experimental::CallbackGenericService;
-using ::grpc::experimental::CallbackServerContext;
-using ::grpc::experimental::GenericCallbackServerContext;
-#endif
-
+// TODO(vjpai): Just for this file, use some contents of the experimental
+// namespace here to make the code easier to read below. Remove this when
+// de-experimentalized fully.
+#ifndef GRPC_CALLBACK_API_NONEXPERIMENTAL
+using ::grpc::experimental::CallbackGenericService;
+using ::grpc::experimental::CallbackServerContext;
+using ::grpc::experimental::GenericCallbackServerContext;
+#endif
+
} // namespace
ServerInterface::BaseAsyncRequest::BaseAsyncRequest(
@@ -293,10 +293,10 @@ class Server::UnimplementedAsyncRequest final
: private grpc::UnimplementedAsyncRequestContext,
public GenericAsyncRequest {
public:
- UnimplementedAsyncRequest(ServerInterface* server,
- grpc::ServerCompletionQueue* cq)
+ UnimplementedAsyncRequest(ServerInterface* server,
+ grpc::ServerCompletionQueue* cq)
: GenericAsyncRequest(server, &server_context_, &generic_stream_, cq, cq,
- nullptr, false) {}
+ nullptr, false) {}
bool FinalizeResult(void** tag, bool* status) override;
@@ -528,54 +528,54 @@ class Server::SyncRequest final : public grpc::internal::CompletionQueueTag {
};
template <class ServerContextType>
-class Server::CallbackRequest final
- : public grpc::internal::CompletionQueueTag {
+class Server::CallbackRequest final
+ : public grpc::internal::CompletionQueueTag {
public:
- static_assert(
- std::is_base_of<grpc::CallbackServerContext, ServerContextType>::value,
- "ServerContextType must be derived from CallbackServerContext");
-
- // For codegen services, the value of method represents the defined
- // characteristics of the method being requested. For generic services, method
- // is nullptr since these services don't have pre-defined methods.
- CallbackRequest(Server* server, grpc::internal::RpcServiceMethod* method,
- grpc::CompletionQueue* cq,
- grpc_core::Server::RegisteredCallAllocation* data)
+ static_assert(
+ std::is_base_of<grpc::CallbackServerContext, ServerContextType>::value,
+ "ServerContextType must be derived from CallbackServerContext");
+
+ // For codegen services, the value of method represents the defined
+ // characteristics of the method being requested. For generic services, method
+ // is nullptr since these services don't have pre-defined methods.
+ CallbackRequest(Server* server, grpc::internal::RpcServiceMethod* method,
+ grpc::CompletionQueue* cq,
+ grpc_core::Server::RegisteredCallAllocation* data)
: server_(server),
method_(method),
- has_request_payload_(method->method_type() ==
- grpc::internal::RpcMethod::NORMAL_RPC ||
- method->method_type() ==
- grpc::internal::RpcMethod::SERVER_STREAMING),
- cq_(cq),
+ has_request_payload_(method->method_type() ==
+ grpc::internal::RpcMethod::NORMAL_RPC ||
+ method->method_type() ==
+ grpc::internal::RpcMethod::SERVER_STREAMING),
+ cq_(cq),
tag_(this) {
- CommonSetup(server, data);
- data->deadline = &deadline_;
- data->optional_payload = has_request_payload_ ? &request_payload_ : nullptr;
+ CommonSetup(server, data);
+ data->deadline = &deadline_;
+ data->optional_payload = has_request_payload_ ? &request_payload_ : nullptr;
}
- // For generic services, method is nullptr since these services don't have
- // pre-defined methods.
- CallbackRequest(Server* server, grpc::CompletionQueue* cq,
- grpc_core::Server::BatchCallAllocation* data)
- : server_(server),
- method_(nullptr),
- has_request_payload_(false),
- call_details_(new grpc_call_details),
- cq_(cq),
- tag_(this) {
- CommonSetup(server, data);
- grpc_call_details_init(call_details_);
- data->details = call_details_;
+ // For generic services, method is nullptr since these services don't have
+ // pre-defined methods.
+ CallbackRequest(Server* server, grpc::CompletionQueue* cq,
+ grpc_core::Server::BatchCallAllocation* data)
+ : server_(server),
+ method_(nullptr),
+ has_request_payload_(false),
+ call_details_(new grpc_call_details),
+ cq_(cq),
+ tag_(this) {
+ CommonSetup(server, data);
+ grpc_call_details_init(call_details_);
+ data->details = call_details_;
}
- ~CallbackRequest() {
- delete call_details_;
- grpc_metadata_array_destroy(&request_metadata_);
- if (has_request_payload_ && request_payload_) {
- grpc_byte_buffer_destroy(request_payload_);
- }
- server_->UnrefWithPossibleNotify();
+ ~CallbackRequest() {
+ delete call_details_;
+ grpc_metadata_array_destroy(&request_metadata_);
+ if (has_request_payload_ && request_payload_) {
+ grpc_byte_buffer_destroy(request_payload_);
+ }
+ server_->UnrefWithPossibleNotify();
}
// Needs specialization to account for different processing of metadata
@@ -680,48 +680,48 @@ class Server::CallbackRequest final
: req_->server_->generic_handler_.get();
handler->RunHandler(grpc::internal::MethodHandler::HandlerParameter(
call_, &req_->ctx_, req_->request_, req_->request_status_,
- req_->handler_data_, [this] { delete req_; }));
+ req_->handler_data_, [this] { delete req_; }));
}
};
- template <class CallAllocation>
- void CommonSetup(Server* server, CallAllocation* data) {
- server->Ref();
+ template <class CallAllocation>
+ void CommonSetup(Server* server, CallAllocation* data) {
+ server->Ref();
grpc_metadata_array_init(&request_metadata_);
- data->tag = &tag_;
- data->call = &call_;
- data->initial_metadata = &request_metadata_;
+ data->tag = &tag_;
+ data->call = &call_;
+ data->initial_metadata = &request_metadata_;
}
Server* const server_;
grpc::internal::RpcServiceMethod* const method_;
const bool has_request_payload_;
- grpc_byte_buffer* request_payload_ = nullptr;
- void* request_ = nullptr;
- void* handler_data_ = nullptr;
+ grpc_byte_buffer* request_payload_ = nullptr;
+ void* request_ = nullptr;
+ void* handler_data_ = nullptr;
grpc::Status request_status_;
- grpc_call_details* const call_details_ = nullptr;
+ grpc_call_details* const call_details_ = nullptr;
grpc_call* call_;
gpr_timespec deadline_;
grpc_metadata_array request_metadata_;
- grpc::CompletionQueue* const cq_;
+ grpc::CompletionQueue* const cq_;
CallbackCallTag tag_;
ServerContextType ctx_;
grpc::internal::InterceptorBatchMethodsImpl interceptor_methods_;
};
template <>
-bool Server::CallbackRequest<grpc::CallbackServerContext>::FinalizeResult(
- void** /*tag*/, bool* /*status*/) {
+bool Server::CallbackRequest<grpc::CallbackServerContext>::FinalizeResult(
+ void** /*tag*/, bool* /*status*/) {
return false;
}
template <>
-bool Server::CallbackRequest<
- grpc::GenericCallbackServerContext>::FinalizeResult(void** /*tag*/,
- bool* status) {
+bool Server::CallbackRequest<
+ grpc::GenericCallbackServerContext>::FinalizeResult(void** /*tag*/,
+ bool* status) {
if (*status) {
- deadline_ = call_details_->deadline;
+ deadline_ = call_details_->deadline;
// TODO(yangg) remove the copy here
ctx_.method_ = grpc::StringFromCopiedSlice(call_details_->method);
ctx_.host_ = grpc::StringFromCopiedSlice(call_details_->host);
@@ -732,14 +732,14 @@ bool Server::CallbackRequest<
}
template <>
-const char* Server::CallbackRequest<grpc::CallbackServerContext>::method_name()
- const {
+const char* Server::CallbackRequest<grpc::CallbackServerContext>::method_name()
+ const {
return method_->name();
}
template <>
const char* Server::CallbackRequest<
- grpc::GenericCallbackServerContext>::method_name() const {
+ grpc::GenericCallbackServerContext>::method_name() const {
return ctx_.method().c_str();
}
@@ -867,7 +867,7 @@ class Server::SyncRequestThreadManager : public grpc::ThreadManager {
static grpc::internal::GrpcLibraryInitializer g_gli_initializer;
Server::Server(
- grpc::ChannelArguments* args,
+ grpc::ChannelArguments* args,
std::shared_ptr<std::vector<std::unique_ptr<grpc::ServerCompletionQueue>>>
sync_server_cqs,
int min_pollers, int max_pollers, int sync_cq_timeout_msec,
@@ -879,13 +879,13 @@ Server::Server(
interceptor_creators)
: acceptors_(std::move(acceptors)),
interceptor_creators_(std::move(interceptor_creators)),
- max_receive_message_size_(INT_MIN),
+ max_receive_message_size_(INT_MIN),
sync_server_cqs_(std::move(sync_server_cqs)),
started_(false),
shutdown_(false),
shutdown_notified_(false),
server_(nullptr),
- server_initializer_(new ServerInitializer(this)),
+ server_initializer_(new ServerInitializer(this)),
health_check_service_disabled_(false) {
g_gli_initializer.summon();
gpr_once_init(&grpc::g_once_init_callbacks, grpc::InitGlobalCallbacks);
@@ -930,10 +930,10 @@ Server::Server(
channel_args.args[i].value.pointer.p));
}
}
- if (0 ==
- strcmp(channel_args.args[i].key, GRPC_ARG_MAX_RECEIVE_MESSAGE_LENGTH)) {
- max_receive_message_size_ = channel_args.args[i].value.integer;
- }
+ if (0 ==
+ strcmp(channel_args.args[i].key, GRPC_ARG_MAX_RECEIVE_MESSAGE_LENGTH)) {
+ max_receive_message_size_ = channel_args.args[i].value.integer;
+ }
}
server_ = grpc_server_create(&channel_args, nullptr);
}
@@ -955,10 +955,10 @@ Server::~Server() {
}
}
}
- // Destroy health check service before we destroy the C server so that
- // it does not call grpc_server_request_registered_call() after the C
- // server has been destroyed.
- health_check_service_.reset();
+ // Destroy health check service before we destroy the C server so that
+ // it does not call grpc_server_request_registered_call() after the C
+ // server has been destroyed.
+ health_check_service_.reset();
grpc_server_destroy(server_);
}
@@ -1005,7 +1005,7 @@ static grpc_server_register_method_payload_handling PayloadHandlingForMethod(
GPR_UNREACHABLE_CODE(return GRPC_SRM_PAYLOAD_NONE;);
}
-bool Server::RegisterService(const TString* host, grpc::Service* service) {
+bool Server::RegisterService(const TString* host, grpc::Service* service) {
bool has_async_methods = service->has_async_methods();
if (has_async_methods) {
GPR_ASSERT(service->server_ == nullptr &&
@@ -1037,16 +1037,16 @@ bool Server::RegisterService(const TString* host, grpc::Service* service) {
value->AddSyncMethod(method.get(), method_registration_tag);
}
} else {
- has_callback_methods_ = true;
- grpc::internal::RpcServiceMethod* method_value = method.get();
- grpc::CompletionQueue* cq = CallbackCQ();
- server_->core_server->SetRegisteredMethodAllocator(
- cq->cq(), method_registration_tag, [this, cq, method_value] {
- grpc_core::Server::RegisteredCallAllocation result;
- new CallbackRequest<grpc::CallbackServerContext>(this, method_value,
- cq, &result);
- return result;
- });
+ has_callback_methods_ = true;
+ grpc::internal::RpcServiceMethod* method_value = method.get();
+ grpc::CompletionQueue* cq = CallbackCQ();
+ server_->core_server->SetRegisteredMethodAllocator(
+ cq->cq(), method_registration_tag, [this, cq, method_value] {
+ grpc_core::Server::RegisteredCallAllocation result;
+ new CallbackRequest<grpc::CallbackServerContext>(this, method_value,
+ cq, &result);
+ return result;
+ });
}
method_name = method->name();
@@ -1055,10 +1055,10 @@ bool Server::RegisterService(const TString* host, grpc::Service* service) {
// Parse service name.
if (method_name != nullptr) {
std::stringstream ss(method_name);
- std::string service_name;
+ std::string service_name;
if (std::getline(ss, service_name, '/') &&
std::getline(ss, service_name, '/')) {
- services_.push_back(service_name.c_str());
+ services_.push_back(service_name.c_str());
}
}
return true;
@@ -1072,7 +1072,7 @@ void Server::RegisterAsyncGenericService(grpc::AsyncGenericService* service) {
}
void Server::RegisterCallbackGenericService(
- grpc::CallbackGenericService* service) {
+ grpc::CallbackGenericService* service) {
GPR_ASSERT(
service->server_ == nullptr &&
"Can only register a callback generic service against one server.");
@@ -1080,15 +1080,15 @@ void Server::RegisterCallbackGenericService(
has_callback_generic_service_ = true;
generic_handler_.reset(service->Handler());
- grpc::CompletionQueue* cq = CallbackCQ();
- server_->core_server->SetBatchMethodAllocator(cq->cq(), [this, cq] {
- grpc_core::Server::BatchCallAllocation result;
- new CallbackRequest<grpc::GenericCallbackServerContext>(this, cq, &result);
- return result;
- });
+ grpc::CompletionQueue* cq = CallbackCQ();
+ server_->core_server->SetBatchMethodAllocator(cq->cq(), [this, cq] {
+ grpc_core::Server::BatchCallAllocation result;
+ new CallbackRequest<grpc::GenericCallbackServerContext>(this, cq, &result);
+ return result;
+ });
}
-int Server::AddListeningPort(const TString& addr,
+int Server::AddListeningPort(const TString& addr,
grpc::ServerCredentials* creds) {
GPR_ASSERT(!started_);
int port = creds->AddPortToServer(addr, server_);
@@ -1096,31 +1096,31 @@ int Server::AddListeningPort(const TString& addr,
return port;
}
-void Server::Ref() {
- shutdown_refs_outstanding_.fetch_add(1, std::memory_order_relaxed);
-}
-
-void Server::UnrefWithPossibleNotify() {
- if (GPR_UNLIKELY(shutdown_refs_outstanding_.fetch_sub(
- 1, std::memory_order_acq_rel) == 1)) {
- // No refs outstanding means that shutdown has been initiated and no more
- // callback requests are outstanding.
- grpc::internal::MutexLock lock(&mu_);
- GPR_ASSERT(shutdown_);
- shutdown_done_ = true;
- shutdown_done_cv_.Signal();
- }
-}
-
-void Server::UnrefAndWaitLocked() {
- if (GPR_UNLIKELY(shutdown_refs_outstanding_.fetch_sub(
- 1, std::memory_order_acq_rel) == 1)) {
- shutdown_done_ = true;
- return; // no need to wait on CV since done condition already set
- }
- shutdown_done_cv_.WaitUntil(&mu_, [this] { return shutdown_done_; });
-}
-
+void Server::Ref() {
+ shutdown_refs_outstanding_.fetch_add(1, std::memory_order_relaxed);
+}
+
+void Server::UnrefWithPossibleNotify() {
+ if (GPR_UNLIKELY(shutdown_refs_outstanding_.fetch_sub(
+ 1, std::memory_order_acq_rel) == 1)) {
+ // No refs outstanding means that shutdown has been initiated and no more
+ // callback requests are outstanding.
+ grpc::internal::MutexLock lock(&mu_);
+ GPR_ASSERT(shutdown_);
+ shutdown_done_ = true;
+ shutdown_done_cv_.Signal();
+ }
+}
+
+void Server::UnrefAndWaitLocked() {
+ if (GPR_UNLIKELY(shutdown_refs_outstanding_.fetch_sub(
+ 1, std::memory_order_acq_rel) == 1)) {
+ shutdown_done_ = true;
+ return; // no need to wait on CV since done condition already set
+ }
+ shutdown_done_cv_.WaitUntil(&mu_, [this] { return shutdown_done_; });
+}
+
void Server::Start(grpc::ServerCompletionQueue** cqs, size_t num_cqs) {
GPR_ASSERT(!started_);
global_callbacks_->PreServerStart(this);
@@ -1156,17 +1156,17 @@ void Server::Start(grpc::ServerCompletionQueue** cqs, size_t num_cqs) {
// If this server uses callback methods, then create a callback generic
// service to handle any unimplemented methods using the default reactor
// creator
- if (has_callback_methods_ && !has_callback_generic_service_) {
- unimplemented_service_.reset(new grpc::CallbackGenericService);
+ if (has_callback_methods_ && !has_callback_generic_service_) {
+ unimplemented_service_.reset(new grpc::CallbackGenericService);
RegisterCallbackGenericService(unimplemented_service_.get());
}
-#ifndef NDEBUG
- for (size_t i = 0; i < num_cqs; i++) {
- cq_list_.push_back(cqs[i]);
- }
-#endif
-
+#ifndef NDEBUG
+ for (size_t i = 0; i < num_cqs; i++) {
+ cq_list_.push_back(cqs[i]);
+ }
+#endif
+
grpc_server_start(server_);
if (!has_async_generic_service_ && !has_callback_generic_service_) {
@@ -1248,8 +1248,8 @@ void Server::ShutdownInternal(gpr_timespec deadline) {
value->Wait();
}
- // Drop the shutdown ref and wait for all other refs to drop as well.
- UnrefAndWaitLocked();
+ // Drop the shutdown ref and wait for all other refs to drop as well.
+ UnrefAndWaitLocked();
// Shutdown the callback CQ. The CQ is owned by its own shutdown tag, so it
// will delete itself at true shutdown.
@@ -1266,15 +1266,15 @@ void Server::ShutdownInternal(gpr_timespec deadline) {
shutdown_notified_ = true;
shutdown_cv_.Broadcast();
-
-#ifndef NDEBUG
- // Unregister this server with the CQs passed into it by the user so that
- // those can be checked for properly-ordered shutdown.
- for (auto* cq : cq_list_) {
- cq->UnregisterServer(this);
- }
- cq_list_.clear();
-#endif
+
+#ifndef NDEBUG
+ // Unregister this server with the CQs passed into it by the user so that
+ // those can be checked for properly-ordered shutdown.
+ for (auto* cq : cq_list_) {
+ cq->UnregisterServer(this);
+ }
+ cq_list_.clear();
+#endif
}
void Server::Wait() {
@@ -1294,9 +1294,9 @@ bool Server::UnimplementedAsyncRequest::FinalizeResult(void** tag,
if (GenericAsyncRequest::FinalizeResult(tag, status)) {
// We either had no interceptors run or we are done intercepting
if (*status) {
- // Create a new request/response pair using the server and CQ values
- // stored in this object's base class.
- new UnimplementedAsyncRequest(server_, notification_cq_);
+ // Create a new request/response pair using the server and CQ values
+ // stored in this object's base class.
+ new UnimplementedAsyncRequest(server_, notification_cq_);
new UnimplementedAsyncResponse(this);
} else {
delete this;
@@ -1323,18 +1323,18 @@ grpc::CompletionQueue* Server::CallbackCQ() {
// TODO(vjpai): Consider using a single global CQ for the default CQ
// if there is no explicit per-server CQ registered
grpc::internal::MutexLock l(&mu_);
- if (callback_cq_ != nullptr) {
- return callback_cq_;
- }
- auto* shutdown_callback = new grpc::ShutdownCallback;
- callback_cq_ = new grpc::CompletionQueue(grpc_completion_queue_attributes{
- GRPC_CQ_CURRENT_VERSION, GRPC_CQ_CALLBACK, GRPC_CQ_DEFAULT_POLLING,
- shutdown_callback});
-
- // Transfer ownership of the new cq to its own shutdown callback
- shutdown_callback->TakeCQ(callback_cq_);
-
+ if (callback_cq_ != nullptr) {
+ return callback_cq_;
+ }
+ auto* shutdown_callback = new grpc::ShutdownCallback;
+ callback_cq_ = new grpc::CompletionQueue(grpc_completion_queue_attributes{
+ GRPC_CQ_CURRENT_VERSION, GRPC_CQ_CALLBACK, GRPC_CQ_DEFAULT_POLLING,
+ shutdown_callback});
+
+ // Transfer ownership of the new cq to its own shutdown callback
+ shutdown_callback->TakeCQ(callback_cq_);
+
return callback_cq_;
}
-} // namespace grpc
+} // namespace grpc
diff --git a/contrib/libs/grpc/src/cpp/server/server_context.cc b/contrib/libs/grpc/src/cpp/server/server_context.cc
index 1b93e3229a6..458ac20d87c 100644
--- a/contrib/libs/grpc/src/cpp/server/server_context.cc
+++ b/contrib/libs/grpc/src/cpp/server/server_context.cc
@@ -16,7 +16,7 @@
*
*/
-#include <grpcpp/impl/codegen/server_context.h>
+#include <grpcpp/impl/codegen/server_context.h>
#include <algorithm>
#include <utility>
@@ -27,7 +27,7 @@
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpcpp/impl/call.h>
-#include <grpcpp/impl/codegen/completion_queue.h>
+#include <grpcpp/impl/codegen/completion_queue.h>
#include <grpcpp/support/server_callback.h>
#include <grpcpp/support/time.h>
@@ -35,17 +35,17 @@
#include "src/core/lib/gprpp/sync.h"
#include "src/core/lib/surface/call.h"
-namespace grpc {
+namespace grpc {
// CompletionOp
class ServerContextBase::CompletionOp final
- : public internal::CallOpSetInterface {
+ : public internal::CallOpSetInterface {
public:
// initial refs: one in the server context, one in the cq
// must ref the call before calling constructor and after deleting this
- CompletionOp(internal::Call* call,
- ::grpc::internal::ServerCallbackCall* callback_controller)
+ CompletionOp(internal::Call* call,
+ ::grpc::internal::ServerCallbackCall* callback_controller)
: call_(*call),
callback_controller_(callback_controller),
has_tag_(false),
@@ -68,7 +68,7 @@ class ServerContextBase::CompletionOp final
}
}
- void FillOps(internal::Call* call) override;
+ void FillOps(internal::Call* call) override;
// This should always be arena allocated in the call, so override delete.
// But this class is not trivially destructible, so must actually call delete
@@ -136,8 +136,8 @@ class ServerContextBase::CompletionOp final
return finalized_ ? (cancelled_ != 0) : false;
}
- internal::Call call_;
- ::grpc::internal::ServerCallbackCall* const callback_controller_;
+ internal::Call call_;
+ ::grpc::internal::ServerCallbackCall* const callback_controller_;
bool has_tag_;
void* tag_;
void* core_cq_tag_;
@@ -146,7 +146,7 @@ class ServerContextBase::CompletionOp final
bool finalized_;
int cancelled_; // This is an int (not bool) because it is passed to core
bool done_intercepting_;
- internal::InterceptorBatchMethodsImpl interceptor_methods_;
+ internal::InterceptorBatchMethodsImpl interceptor_methods_;
};
void ServerContextBase::CompletionOp::Unref() {
@@ -157,7 +157,7 @@ void ServerContextBase::CompletionOp::Unref() {
}
}
-void ServerContextBase::CompletionOp::FillOps(internal::Call* call) {
+void ServerContextBase::CompletionOp::FillOps(internal::Call* call) {
grpc_op ops;
ops.op = GRPC_OP_RECV_CLOSE_ON_SERVER;
ops.data.recv_close_on_server.cancelled = &cancelled_;
@@ -174,31 +174,31 @@ void ServerContextBase::CompletionOp::FillOps(internal::Call* call) {
}
bool ServerContextBase::CompletionOp::FinalizeResult(void** tag, bool* status) {
- // Decide whether to call the cancel callback within the lock
- bool call_cancel;
-
- {
- grpc_core::MutexLock lock(&mu_);
- if (done_intercepting_) {
- // We are done intercepting.
- bool has_tag = has_tag_;
- if (has_tag) {
- *tag = tag_;
- }
- Unref();
- return has_tag;
+ // Decide whether to call the cancel callback within the lock
+ bool call_cancel;
+
+ {
+ grpc_core::MutexLock lock(&mu_);
+ if (done_intercepting_) {
+ // We are done intercepting.
+ bool has_tag = has_tag_;
+ if (has_tag) {
+ *tag = tag_;
+ }
+ Unref();
+ return has_tag;
+ }
+ finalized_ = true;
+
+ // If for some reason the incoming status is false, mark that as a
+ // cancellation.
+ // TODO(vjpai): does this ever happen?
+ if (!*status) {
+ cancelled_ = 1;
}
- finalized_ = true;
-
- // If for some reason the incoming status is false, mark that as a
- // cancellation.
- // TODO(vjpai): does this ever happen?
- if (!*status) {
- cancelled_ = 1;
- }
-
- call_cancel = (cancelled_ != 0);
- // Release the lock since we may call a callback and interceptors.
+
+ call_cancel = (cancelled_ != 0);
+ // Release the lock since we may call a callback and interceptors.
}
if (call_cancel && callback_controller_ != nullptr) {
@@ -206,28 +206,28 @@ bool ServerContextBase::CompletionOp::FinalizeResult(void** tag, bool* status) {
}
/* Add interception point and run through interceptors */
interceptor_methods_.AddInterceptionHookPoint(
- experimental::InterceptionHookPoints::POST_RECV_CLOSE);
+ experimental::InterceptionHookPoints::POST_RECV_CLOSE);
if (interceptor_methods_.RunInterceptors()) {
- // No interceptors were run
- bool has_tag = has_tag_;
- if (has_tag) {
+ // No interceptors were run
+ bool has_tag = has_tag_;
+ if (has_tag) {
*tag = tag_;
}
Unref();
- return has_tag;
+ return has_tag;
}
- // There are interceptors to be run. Return false for now.
+ // There are interceptors to be run. Return false for now.
return false;
}
// ServerContextBase body
-ServerContextBase::ServerContextBase()
- : deadline_(gpr_inf_future(GPR_CLOCK_REALTIME)) {}
+ServerContextBase::ServerContextBase()
+ : deadline_(gpr_inf_future(GPR_CLOCK_REALTIME)) {}
ServerContextBase::ServerContextBase(gpr_timespec deadline,
- grpc_metadata_array* arr)
- : deadline_(deadline) {
+ grpc_metadata_array* arr)
+ : deadline_(deadline) {
std::swap(*client_metadata_.arr(), *arr);
}
@@ -237,7 +237,7 @@ void ServerContextBase::BindDeadlineAndMetadata(gpr_timespec deadline,
std::swap(*client_metadata_.arr(), *arr);
}
-ServerContextBase::~ServerContextBase() {
+ServerContextBase::~ServerContextBase() {
if (completion_op_) {
completion_op_->Unref();
}
@@ -245,21 +245,21 @@ ServerContextBase::~ServerContextBase() {
rpc_info_->Unref();
}
if (default_reactor_used_.load(std::memory_order_relaxed)) {
- reinterpret_cast<Reactor*>(&default_reactor_)->~Reactor();
+ reinterpret_cast<Reactor*>(&default_reactor_)->~Reactor();
+ }
+}
+
+ServerContextBase::CallWrapper::~CallWrapper() {
+ if (call) {
+ // If the ServerContext is part of the call's arena, this could free the
+ // object itself.
+ grpc_call_unref(call);
}
}
-ServerContextBase::CallWrapper::~CallWrapper() {
- if (call) {
- // If the ServerContext is part of the call's arena, this could free the
- // object itself.
- grpc_call_unref(call);
- }
-}
-
void ServerContextBase::BeginCompletionOp(
- internal::Call* call, std::function<void(bool)> callback,
- ::grpc::internal::ServerCallbackCall* callback_controller) {
+ internal::Call* call, std::function<void(bool)> callback,
+ ::grpc::internal::ServerCallbackCall* callback_controller) {
GPR_ASSERT(!completion_op_);
if (rpc_info_) {
rpc_info_->Ref();
@@ -279,30 +279,30 @@ void ServerContextBase::BeginCompletionOp(
call->PerformOps(completion_op_);
}
-internal::CompletionQueueTag* ServerContextBase::GetCompletionOpTag() {
- return static_cast<internal::CompletionQueueTag*>(completion_op_);
+internal::CompletionQueueTag* ServerContextBase::GetCompletionOpTag() {
+ return static_cast<internal::CompletionQueueTag*>(completion_op_);
}
-void ServerContextBase::AddInitialMetadata(const TString& key,
- const TString& value) {
+void ServerContextBase::AddInitialMetadata(const TString& key,
+ const TString& value) {
initial_metadata_.insert(std::make_pair(key, value));
}
-void ServerContextBase::AddTrailingMetadata(const TString& key,
- const TString& value) {
+void ServerContextBase::AddTrailingMetadata(const TString& key,
+ const TString& value) {
trailing_metadata_.insert(std::make_pair(key, value));
}
void ServerContextBase::TryCancel() const {
- internal::CancelInterceptorBatchMethods cancel_methods;
+ internal::CancelInterceptorBatchMethods cancel_methods;
if (rpc_info_) {
for (size_t i = 0; i < rpc_info_->interceptors_.size(); i++) {
rpc_info_->RunInterceptor(&cancel_methods, i);
}
}
- grpc_call_error err =
- grpc_call_cancel_with_status(call_.call, GRPC_STATUS_CANCELLED,
- "Cancelled on the server side", nullptr);
+ grpc_call_error err =
+ grpc_call_cancel_with_status(call_.call, GRPC_STATUS_CANCELLED,
+ "Cancelled on the server side", nullptr);
if (err != GRPC_CALL_OK) {
gpr_log(GPR_ERROR, "TryCancel failed with: %d", err);
}
@@ -335,10 +335,10 @@ void ServerContextBase::set_compression_algorithm(
AddInitialMetadata(GRPC_COMPRESSION_REQUEST_ALGORITHM_MD_KEY, algorithm_name);
}
-TString ServerContextBase::peer() const {
- TString peer;
- if (call_.call) {
- char* c_peer = grpc_call_get_peer(call_.call);
+TString ServerContextBase::peer() const {
+ TString peer;
+ if (call_.call) {
+ char* c_peer = grpc_call_get_peer(call_.call);
peer = c_peer;
gpr_free(c_peer);
}
@@ -346,16 +346,16 @@ TString ServerContextBase::peer() const {
}
const struct census_context* ServerContextBase::census_context() const {
- return call_.call == nullptr ? nullptr
- : grpc_census_call_get_context(call_.call);
+ return call_.call == nullptr ? nullptr
+ : grpc_census_call_get_context(call_.call);
}
void ServerContextBase::SetLoadReportingCosts(
- const std::vector<TString>& cost_data) {
- if (call_.call == nullptr) return;
+ const std::vector<TString>& cost_data) {
+ if (call_.call == nullptr) return;
for (const auto& cost_datum : cost_data) {
AddTrailingMetadata(GRPC_LB_COST_MD_KEY, cost_datum);
}
}
-} // namespace grpc
+} // namespace grpc
diff --git a/contrib/libs/grpc/src/cpp/server/server_credentials.cc b/contrib/libs/grpc/src/cpp/server/server_credentials.cc
index 449e583abd0..c3b3a8b3793 100644
--- a/contrib/libs/grpc/src/cpp/server/server_credentials.cc
+++ b/contrib/libs/grpc/src/cpp/server/server_credentials.cc
@@ -16,10 +16,10 @@
*
*/
-#include <grpcpp/security/server_credentials.h>
+#include <grpcpp/security/server_credentials.h>
-namespace grpc {
+namespace grpc {
ServerCredentials::~ServerCredentials() {}
-} // namespace grpc
+} // namespace grpc
diff --git a/contrib/libs/grpc/src/cpp/server/server_posix.cc b/contrib/libs/grpc/src/cpp/server/server_posix.cc
index 3aaa6db0ea0..c3d40d4fa2d 100644
--- a/contrib/libs/grpc/src/cpp/server/server_posix.cc
+++ b/contrib/libs/grpc/src/cpp/server/server_posix.cc
@@ -20,7 +20,7 @@
#include <grpc/grpc_posix.h>
-namespace grpc {
+namespace grpc {
#ifdef GPR_SUPPORT_CHANNELS_FROM_FD
@@ -30,4 +30,4 @@ void AddInsecureChannelFromFd(grpc::Server* server, int fd) {
#endif // GPR_SUPPORT_CHANNELS_FROM_FD
-} // namespace grpc
+} // namespace grpc
diff --git a/contrib/libs/grpc/src/cpp/thread_manager/thread_manager.cc b/contrib/libs/grpc/src/cpp/thread_manager/thread_manager.cc
index e6988f54749..c8560aa81dd 100644
--- a/contrib/libs/grpc/src/cpp/thread_manager/thread_manager.cc
+++ b/contrib/libs/grpc/src/cpp/thread_manager/thread_manager.cc
@@ -184,8 +184,8 @@ void ThreadManager::MainWorkLoop() {
if (worker->created()) {
worker->Start();
} else {
- // Get lock again to undo changes to poller/thread counters.
- grpc_core::MutexLock failure_lock(&mu_);
+ // Get lock again to undo changes to poller/thread counters.
+ grpc_core::MutexLock failure_lock(&mu_);
num_pollers_--;
num_threads_--;
resource_exhausted = true;
diff --git a/contrib/libs/grpc/src/cpp/util/error_details.cc b/contrib/libs/grpc/src/cpp/util/error_details.cc
index 491a460386a..dfd3351be15 100644
--- a/contrib/libs/grpc/src/cpp/util/error_details.cc
+++ b/contrib/libs/grpc/src/cpp/util/error_details.cc
@@ -20,7 +20,7 @@
#include "src/proto/grpc/status/status.pb.h"
-namespace grpc {
+namespace grpc {
grpc::Status ExtractErrorDetails(const grpc::Status& from,
::google::rpc::Status* to) {
@@ -47,4 +47,4 @@ grpc::Status SetErrorDetails(const ::google::rpc::Status& from,
return grpc::Status::OK;
}
-} // namespace grpc
+} // namespace grpc
diff --git a/contrib/libs/grpc/src/proto/grpc/channelz/.yandex_meta/licenses.list.txt b/contrib/libs/grpc/src/proto/grpc/channelz/.yandex_meta/licenses.list.txt
index 209fa426f30..8b7269ff4cf 100644
--- a/contrib/libs/grpc/src/proto/grpc/channelz/.yandex_meta/licenses.list.txt
+++ b/contrib/libs/grpc/src/proto/grpc/channelz/.yandex_meta/licenses.list.txt
@@ -1,16 +1,16 @@
-====================Apache-2.0====================
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-
-====================COPYRIGHT====================
-// Copyright 2018 The gRPC Authors
+====================Apache-2.0====================
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+
+====================COPYRIGHT====================
+// Copyright 2018 The gRPC Authors
diff --git a/contrib/libs/grpc/src/proto/grpc/channelz/ya.make b/contrib/libs/grpc/src/proto/grpc/channelz/ya.make
index ad200b26428..9f1e3cedc9a 100644
--- a/contrib/libs/grpc/src/proto/grpc/channelz/ya.make
+++ b/contrib/libs/grpc/src/proto/grpc/channelz/ya.make
@@ -2,8 +2,8 @@ PROTO_LIBRARY()
LICENSE(Apache-2.0)
-LICENSE_TEXTS(.yandex_meta/licenses.list.txt)
-
+LICENSE_TEXTS(.yandex_meta/licenses.list.txt)
+
OWNER(
akastornov
dvshkurko
@@ -11,10 +11,10 @@ OWNER(
g:cpp-contrib
)
-PROTO_NAMESPACE(
- GLOBAL
- contrib/libs/grpc
-)
+PROTO_NAMESPACE(
+ GLOBAL
+ contrib/libs/grpc
+)
GRPC()
diff --git a/contrib/libs/grpc/src/proto/grpc/core/.yandex_meta/licenses.list.txt b/contrib/libs/grpc/src/proto/grpc/core/.yandex_meta/licenses.list.txt
index 1415278ad7f..28e08e9def4 100644
--- a/contrib/libs/grpc/src/proto/grpc/core/.yandex_meta/licenses.list.txt
+++ b/contrib/libs/grpc/src/proto/grpc/core/.yandex_meta/licenses.list.txt
@@ -1,16 +1,16 @@
-====================Apache-2.0====================
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-
-====================COPYRIGHT====================
- * Copyright 2017 gRPC authors.
+====================Apache-2.0====================
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+
+====================COPYRIGHT====================
+ * Copyright 2017 gRPC authors.
diff --git a/contrib/libs/grpc/src/proto/grpc/core/ya.make b/contrib/libs/grpc/src/proto/grpc/core/ya.make
index 3df13d68c92..856c34ee53f 100644
--- a/contrib/libs/grpc/src/proto/grpc/core/ya.make
+++ b/contrib/libs/grpc/src/proto/grpc/core/ya.make
@@ -2,18 +2,18 @@ PROTO_LIBRARY()
LICENSE(Apache-2.0)
-LICENSE_TEXTS(.yandex_meta/licenses.list.txt)
-
+LICENSE_TEXTS(.yandex_meta/licenses.list.txt)
+
OWNER(
akastornov
g:contrib
g:cpp-contrib
)
-PROTO_NAMESPACE(
- GLOBAL
- contrib/libs/grpc
-)
+PROTO_NAMESPACE(
+ GLOBAL
+ contrib/libs/grpc
+)
GRPC()
diff --git a/contrib/libs/grpc/src/proto/grpc/gcp/handshaker.proto b/contrib/libs/grpc/src/proto/grpc/gcp/handshaker.proto
index 02dc683df01..fe0e1e199ae 100644
--- a/contrib/libs/grpc/src/proto/grpc/gcp/handshaker.proto
+++ b/contrib/libs/grpc/src/proto/grpc/gcp/handshaker.proto
@@ -105,9 +105,9 @@ message StartClientHandshakeReq {
// (Optional) RPC protocol versions supported by the client.
RpcProtocolVersions rpc_versions = 9;
-
- // (Optional) Maximum frame size supported by the client.
- uint32 max_frame_size = 10;
+
+ // (Optional) Maximum frame size supported by the client.
+ uint32 max_frame_size = 10;
}
message ServerHandshakeParameters {
@@ -146,9 +146,9 @@ message StartServerHandshakeReq {
// (Optional) RPC protocol versions supported by the server.
RpcProtocolVersions rpc_versions = 6;
-
- // (Optional) Maximum frame size supported by the server.
- uint32 max_frame_size = 7;
+
+ // (Optional) Maximum frame size supported by the server.
+ uint32 max_frame_size = 7;
}
message NextHandshakeMessageReq {
@@ -196,9 +196,9 @@ message HandshakerResult {
// The RPC protocol versions supported by the peer.
RpcProtocolVersions peer_rpc_versions = 7;
-
- // The maximum frame size of the peer.
- uint32 max_frame_size = 8;
+
+ // The maximum frame size of the peer.
+ uint32 max_frame_size = 8;
}
message HandshakerStatus {
diff --git a/contrib/libs/grpc/src/proto/grpc/health/v1/.yandex_meta/licenses.list.txt b/contrib/libs/grpc/src/proto/grpc/health/v1/.yandex_meta/licenses.list.txt
index 47415c8a6c3..d841cd39fba 100644
--- a/contrib/libs/grpc/src/proto/grpc/health/v1/.yandex_meta/licenses.list.txt
+++ b/contrib/libs/grpc/src/proto/grpc/health/v1/.yandex_meta/licenses.list.txt
@@ -1,16 +1,16 @@
-====================Apache-2.0====================
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-
-====================COPYRIGHT====================
-// Copyright 2015 The gRPC Authors
+====================Apache-2.0====================
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+
+====================COPYRIGHT====================
+// Copyright 2015 The gRPC Authors
diff --git a/contrib/libs/grpc/src/proto/grpc/health/v1/ya.make b/contrib/libs/grpc/src/proto/grpc/health/v1/ya.make
index 54dc5537bbb..7bb8b0dff91 100644
--- a/contrib/libs/grpc/src/proto/grpc/health/v1/ya.make
+++ b/contrib/libs/grpc/src/proto/grpc/health/v1/ya.make
@@ -2,18 +2,18 @@ PROTO_LIBRARY()
LICENSE(Apache-2.0)
-LICENSE_TEXTS(.yandex_meta/licenses.list.txt)
-
+LICENSE_TEXTS(.yandex_meta/licenses.list.txt)
+
OWNER(
akastornov
g:contrib
g:cpp-contrib
)
-PROTO_NAMESPACE(
- GLOBAL
- contrib/libs/grpc
-)
+PROTO_NAMESPACE(
+ GLOBAL
+ contrib/libs/grpc
+)
GRPC()
diff --git a/contrib/libs/grpc/src/proto/grpc/lb/v1/load_balancer.proto b/contrib/libs/grpc/src/proto/grpc/lb/v1/load_balancer.proto
index f625ecdd8f7..ccf2efd629e 100644
--- a/contrib/libs/grpc/src/proto/grpc/lb/v1/load_balancer.proto
+++ b/contrib/libs/grpc/src/proto/grpc/lb/v1/load_balancer.proto
@@ -94,11 +94,11 @@ message LoadBalanceResponse {
// Contains the list of servers selected by the load balancer. The client
// should send requests to these servers in the specified order.
ServerList server_list = 2;
-
- // If this field is set, then the client should eagerly enter fallback
- // mode (even if there are existing, healthy connections to backends).
- // See go/grpclb-explicit-fallback for more details.
- FallbackResponse fallback_response = 3;
+
+ // If this field is set, then the client should eagerly enter fallback
+ // mode (even if there are existing, healthy connections to backends).
+ // See go/grpclb-explicit-fallback for more details.
+ FallbackResponse fallback_response = 3;
}
}
@@ -153,5 +153,5 @@ message Server {
reserved 5;
}
-
-message FallbackResponse {}
+
+message FallbackResponse {}
diff --git a/contrib/libs/grpc/src/proto/grpc/reflection/v1alpha/.yandex_meta/licenses.list.txt b/contrib/libs/grpc/src/proto/grpc/reflection/v1alpha/.yandex_meta/licenses.list.txt
index fbdcf84af08..3b9a2903ee8 100644
--- a/contrib/libs/grpc/src/proto/grpc/reflection/v1alpha/.yandex_meta/licenses.list.txt
+++ b/contrib/libs/grpc/src/proto/grpc/reflection/v1alpha/.yandex_meta/licenses.list.txt
@@ -1,16 +1,16 @@
-====================Apache-2.0====================
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-
-====================COPYRIGHT====================
- * Copyright 2016 gRPC authors.
+====================Apache-2.0====================
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+
+====================COPYRIGHT====================
+ * Copyright 2016 gRPC authors.
diff --git a/contrib/libs/grpc/src/proto/grpc/reflection/v1alpha/ya.make b/contrib/libs/grpc/src/proto/grpc/reflection/v1alpha/ya.make
index cbd851a3b45..f8e301c9370 100644
--- a/contrib/libs/grpc/src/proto/grpc/reflection/v1alpha/ya.make
+++ b/contrib/libs/grpc/src/proto/grpc/reflection/v1alpha/ya.make
@@ -2,18 +2,18 @@ PROTO_LIBRARY()
LICENSE(Apache-2.0)
-LICENSE_TEXTS(.yandex_meta/licenses.list.txt)
-
+LICENSE_TEXTS(.yandex_meta/licenses.list.txt)
+
OWNER(
akastornov
g:contrib
g:cpp-contrib
)
-PROTO_NAMESPACE(
- GLOBAL
- contrib/libs/grpc
-)
+PROTO_NAMESPACE(
+ GLOBAL
+ contrib/libs/grpc
+)
PY_NAMESPACE(src.proto.grpc.reflection.v1alpha)
diff --git a/contrib/libs/grpc/src/proto/grpc/status/.yandex_meta/licenses.list.txt b/contrib/libs/grpc/src/proto/grpc/status/.yandex_meta/licenses.list.txt
index e4070591098..724b968ab0c 100644
--- a/contrib/libs/grpc/src/proto/grpc/status/.yandex_meta/licenses.list.txt
+++ b/contrib/libs/grpc/src/proto/grpc/status/.yandex_meta/licenses.list.txt
@@ -1,16 +1,16 @@
-====================Apache-2.0====================
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-
-====================COPYRIGHT====================
-// Copyright 2016 Google Inc.
+====================Apache-2.0====================
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+
+====================COPYRIGHT====================
+// Copyright 2016 Google Inc.
diff --git a/contrib/libs/grpc/src/proto/grpc/status/ya.make b/contrib/libs/grpc/src/proto/grpc/status/ya.make
index f502885160c..eec367765ff 100644
--- a/contrib/libs/grpc/src/proto/grpc/status/ya.make
+++ b/contrib/libs/grpc/src/proto/grpc/status/ya.make
@@ -2,18 +2,18 @@ PROTO_LIBRARY()
LICENSE(Apache-2.0)
-LICENSE_TEXTS(.yandex_meta/licenses.list.txt)
-
+LICENSE_TEXTS(.yandex_meta/licenses.list.txt)
+
OWNER(
akastornov
g:contrib
g:cpp-contrib
)
-PROTO_NAMESPACE(
- GLOBAL
- contrib/libs/grpc
-)
+PROTO_NAMESPACE(
+ GLOBAL
+ contrib/libs/grpc
+)
GRPC()
diff --git a/contrib/libs/grpc/src/proto/grpc/testing/.yandex_meta/licenses.list.txt b/contrib/libs/grpc/src/proto/grpc/testing/.yandex_meta/licenses.list.txt
index f4e918c5a00..e71f54ae947 100644
--- a/contrib/libs/grpc/src/proto/grpc/testing/.yandex_meta/licenses.list.txt
+++ b/contrib/libs/grpc/src/proto/grpc/testing/.yandex_meta/licenses.list.txt
@@ -1,32 +1,32 @@
-====================Apache-2.0====================
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-
-====================COPYRIGHT====================
- * Copyright 2015 gRPC authors.
-
-
-====================COPYRIGHT====================
- * Copyright 2015-2016 gRPC authors.
-
-
-====================COPYRIGHT====================
- * Copyright 2016 gRPC authors.
-
-
-====================COPYRIGHT====================
- * Copyright 2017 gRPC authors.
-
-
-====================COPYRIGHT====================
- * Copyright 2018 gRPC authors.
+====================Apache-2.0====================
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+
+====================COPYRIGHT====================
+ * Copyright 2015 gRPC authors.
+
+
+====================COPYRIGHT====================
+ * Copyright 2015-2016 gRPC authors.
+
+
+====================COPYRIGHT====================
+ * Copyright 2016 gRPC authors.
+
+
+====================COPYRIGHT====================
+ * Copyright 2017 gRPC authors.
+
+
+====================COPYRIGHT====================
+ * Copyright 2018 gRPC authors.
diff --git a/contrib/libs/grpc/src/proto/grpc/testing/control.proto b/contrib/libs/grpc/src/proto/grpc/testing/control.proto
index f2d01fa3ca7..742b21926e7 100644
--- a/contrib/libs/grpc/src/proto/grpc/testing/control.proto
+++ b/contrib/libs/grpc/src/proto/grpc/testing/control.proto
@@ -117,9 +117,9 @@ message ClientConfig {
// If 0, disabled. Else, specifies the period between gathering latency
// medians in milliseconds.
int32 median_latency_collection_interval_millis = 20;
-
- // Number of client processes. 0 indicates no restriction.
- int32 client_processes = 21;
+
+ // Number of client processes. 0 indicates no restriction.
+ int32 client_processes = 21;
}
message ClientStatus { ClientStats stats = 1; }
@@ -166,9 +166,9 @@ message ServerConfig {
// Buffer pool size (no buffer pool specified if unset)
int32 resource_quota_size = 1001;
repeated ChannelArg channel_args = 1002;
-
- // Number of server processes. 0 indicates no restriction.
- int32 server_processes = 21;
+
+ // Number of server processes. 0 indicates no restriction.
+ int32 server_processes = 21;
}
message ServerArgs {
diff --git a/contrib/libs/grpc/src/proto/grpc/testing/duplicate/.yandex_meta/licenses.list.txt b/contrib/libs/grpc/src/proto/grpc/testing/duplicate/.yandex_meta/licenses.list.txt
index fc2e9317780..4a6b5dd2d60 100644
--- a/contrib/libs/grpc/src/proto/grpc/testing/duplicate/.yandex_meta/licenses.list.txt
+++ b/contrib/libs/grpc/src/proto/grpc/testing/duplicate/.yandex_meta/licenses.list.txt
@@ -1,16 +1,16 @@
-====================Apache-2.0====================
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-
-====================COPYRIGHT====================
- * Copyright 2015 gRPC authors.
+====================Apache-2.0====================
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+
+====================COPYRIGHT====================
+ * Copyright 2015 gRPC authors.
diff --git a/contrib/libs/grpc/src/proto/grpc/testing/duplicate/ya.make b/contrib/libs/grpc/src/proto/grpc/testing/duplicate/ya.make
index af57ff21637..b94aa415f80 100644
--- a/contrib/libs/grpc/src/proto/grpc/testing/duplicate/ya.make
+++ b/contrib/libs/grpc/src/proto/grpc/testing/duplicate/ya.make
@@ -2,8 +2,8 @@ PROTO_LIBRARY()
LICENSE(Apache-2.0)
-LICENSE_TEXTS(.yandex_meta/licenses.list.txt)
-
+LICENSE_TEXTS(.yandex_meta/licenses.list.txt)
+
OWNER(
akastornov
g:contrib
@@ -16,10 +16,10 @@ EXCLUDE_TAGS(
PY3_PROTO
)
-PROTO_NAMESPACE(
- GLOBAL
- contrib/libs/grpc
-)
+PROTO_NAMESPACE(
+ GLOBAL
+ contrib/libs/grpc
+)
PEERDIR(
contrib/libs/grpc/src/proto/grpc/testing
diff --git a/contrib/libs/grpc/src/proto/grpc/testing/echo.proto b/contrib/libs/grpc/src/proto/grpc/testing/echo.proto
index 6eb18b85977..33db1118648 100644
--- a/contrib/libs/grpc/src/proto/grpc/testing/echo.proto
+++ b/contrib/libs/grpc/src/proto/grpc/testing/echo.proto
@@ -15,55 +15,55 @@
syntax = "proto3";
-package grpc.testing;
-
+package grpc.testing;
+
import "src/proto/grpc/testing/echo_messages.proto";
import "src/proto/grpc/testing/simple_messages.proto";
service EchoTestService {
rpc Echo(EchoRequest) returns (EchoResponse);
- rpc Echo1(EchoRequest) returns (EchoResponse);
- rpc Echo2(EchoRequest) returns (EchoResponse);
- rpc CheckDeadlineUpperBound(SimpleRequest42) returns (StringValue);
- rpc CheckDeadlineSet(SimpleRequest42) returns (StringValue);
+ rpc Echo1(EchoRequest) returns (EchoResponse);
+ rpc Echo2(EchoRequest) returns (EchoResponse);
+ rpc CheckDeadlineUpperBound(SimpleRequest42) returns (StringValue);
+ rpc CheckDeadlineSet(SimpleRequest42) returns (StringValue);
+ // A service which checks that the initial metadata sent over contains some
+ // expected key value pair
+ rpc CheckClientInitialMetadata(SimpleRequest42) returns (SimpleResponse42);
+ rpc RequestStream(stream EchoRequest) returns (EchoResponse);
+ rpc ResponseStream(EchoRequest) returns (stream EchoResponse);
+ rpc BidiStream(stream EchoRequest) returns (stream EchoResponse);
+ rpc Unimplemented(EchoRequest) returns (EchoResponse);
+}
+
+service EchoTest1Service {
+ rpc Echo(EchoRequest) returns (EchoResponse);
+ rpc Echo1(EchoRequest) returns (EchoResponse);
+ rpc Echo2(EchoRequest) returns (EchoResponse);
+ // A service which checks that the initial metadata sent over contains some
+ // expected key value pair
+ rpc CheckClientInitialMetadata(SimpleRequest42) returns (SimpleResponse42);
+ rpc RequestStream(stream EchoRequest) returns (EchoResponse);
+ rpc ResponseStream(EchoRequest) returns (stream EchoResponse);
+ rpc BidiStream(stream EchoRequest) returns (stream EchoResponse);
+ rpc Unimplemented(EchoRequest) returns (EchoResponse);
+}
+
+service EchoTest2Service {
+ rpc Echo(EchoRequest) returns (EchoResponse);
+ rpc Echo1(EchoRequest) returns (EchoResponse);
+ rpc Echo2(EchoRequest) returns (EchoResponse);
// A service which checks that the initial metadata sent over contains some
// expected key value pair
- rpc CheckClientInitialMetadata(SimpleRequest42) returns (SimpleResponse42);
+ rpc CheckClientInitialMetadata(SimpleRequest42) returns (SimpleResponse42);
rpc RequestStream(stream EchoRequest) returns (EchoResponse);
rpc ResponseStream(EchoRequest) returns (stream EchoResponse);
rpc BidiStream(stream EchoRequest) returns (stream EchoResponse);
rpc Unimplemented(EchoRequest) returns (EchoResponse);
}
-service EchoTest1Service {
- rpc Echo(EchoRequest) returns (EchoResponse);
- rpc Echo1(EchoRequest) returns (EchoResponse);
- rpc Echo2(EchoRequest) returns (EchoResponse);
- // A service which checks that the initial metadata sent over contains some
- // expected key value pair
- rpc CheckClientInitialMetadata(SimpleRequest42) returns (SimpleResponse42);
- rpc RequestStream(stream EchoRequest) returns (EchoResponse);
- rpc ResponseStream(EchoRequest) returns (stream EchoResponse);
- rpc BidiStream(stream EchoRequest) returns (stream EchoResponse);
- rpc Unimplemented(EchoRequest) returns (EchoResponse);
-}
-
-service EchoTest2Service {
- rpc Echo(EchoRequest) returns (EchoResponse);
- rpc Echo1(EchoRequest) returns (EchoResponse);
- rpc Echo2(EchoRequest) returns (EchoResponse);
- // A service which checks that the initial metadata sent over contains some
- // expected key value pair
- rpc CheckClientInitialMetadata(SimpleRequest42) returns (SimpleResponse42);
- rpc RequestStream(stream EchoRequest) returns (EchoResponse);
- rpc ResponseStream(EchoRequest) returns (stream EchoResponse);
- rpc BidiStream(stream EchoRequest) returns (stream EchoResponse);
- rpc Unimplemented(EchoRequest) returns (EchoResponse);
-}
-
service UnimplementedEchoService {
rpc Unimplemented(EchoRequest) returns (EchoResponse);
}
// A service without any rpc defined to test coverage.
-service NoRpcService {}
+service NoRpcService {}
diff --git a/contrib/libs/grpc/src/proto/grpc/testing/echo_messages.proto b/contrib/libs/grpc/src/proto/grpc/testing/echo_messages.proto
index 1483302b296..6f1e5f34046 100644
--- a/contrib/libs/grpc/src/proto/grpc/testing/echo_messages.proto
+++ b/contrib/libs/grpc/src/proto/grpc/testing/echo_messages.proto
@@ -47,10 +47,10 @@ message RequestParams {
bool server_die = 12; // Server should not see a request with this set.
string binary_error_details = 13;
ErrorStatus expected_error = 14;
- int32 server_sleep_us = 15; // sleep when invoking server for deadline tests
+ int32 server_sleep_us = 15; // sleep when invoking server for deadline tests
int32 backend_channel_idx = 16; // which backend to send request to
bool echo_metadata_initially = 17;
- bool server_notify_client_when_started = 18;
+ bool server_notify_client_when_started = 18;
}
message EchoRequest {
diff --git a/contrib/libs/grpc/src/proto/grpc/testing/messages.proto b/contrib/libs/grpc/src/proto/grpc/testing/messages.proto
index 1ed8084e546..70e34277607 100644
--- a/contrib/libs/grpc/src/proto/grpc/testing/messages.proto
+++ b/contrib/libs/grpc/src/proto/grpc/testing/messages.proto
@@ -115,9 +115,9 @@ message SimpleResponse {
string server_id = 4;
// gRPCLB Path.
GrpclbRouteType grpclb_route_type = 5;
-
- // Server hostname.
- string hostname = 6;
+
+ // Server hostname.
+ string hostname = 6;
}
// Client-streaming request.
@@ -193,22 +193,22 @@ message ReconnectInfo {
bool passed = 1;
repeated int32 backoff_ms = 2;
}
-
-message LoadBalancerStatsRequest {
- // Request stats for the next num_rpcs sent by client.
- int32 num_rpcs = 1;
- // If num_rpcs have not completed within timeout_sec, return partial results.
- int32 timeout_sec = 2;
-}
-
-message LoadBalancerStatsResponse {
- message RpcsByPeer {
- // The number of completed RPCs for each peer.
- map<string, int32> rpcs_by_peer = 1;
- }
- // The number of completed RPCs for each peer.
- map<string, int32> rpcs_by_peer = 1;
- // The number of RPCs that failed to record a remote peer.
- int32 num_failures = 2;
- map<string, RpcsByPeer> rpcs_by_method = 3;
-}
+
+message LoadBalancerStatsRequest {
+ // Request stats for the next num_rpcs sent by client.
+ int32 num_rpcs = 1;
+ // If num_rpcs have not completed within timeout_sec, return partial results.
+ int32 timeout_sec = 2;
+}
+
+message LoadBalancerStatsResponse {
+ message RpcsByPeer {
+ // The number of completed RPCs for each peer.
+ map<string, int32> rpcs_by_peer = 1;
+ }
+ // The number of completed RPCs for each peer.
+ map<string, int32> rpcs_by_peer = 1;
+ // The number of RPCs that failed to record a remote peer.
+ int32 num_failures = 2;
+ map<string, RpcsByPeer> rpcs_by_method = 3;
+}
diff --git a/contrib/libs/grpc/src/proto/grpc/testing/simple_messages.proto b/contrib/libs/grpc/src/proto/grpc/testing/simple_messages.proto
index f7331baca61..6fbb395a448 100644
--- a/contrib/libs/grpc/src/proto/grpc/testing/simple_messages.proto
+++ b/contrib/libs/grpc/src/proto/grpc/testing/simple_messages.proto
@@ -17,10 +17,10 @@ syntax = "proto3";
package grpc.testing;
-message SimpleRequest42 {}
+message SimpleRequest42 {}
-message SimpleResponse42 {}
-
-message StringValue {
- string message = 1;
+message SimpleResponse42 {}
+
+message StringValue {
+ string message = 1;
}
diff --git a/contrib/libs/grpc/src/proto/grpc/testing/test.proto b/contrib/libs/grpc/src/proto/grpc/testing/test.proto
index e7a47aa03fc..1da43f48989 100644
--- a/contrib/libs/grpc/src/proto/grpc/testing/test.proto
+++ b/contrib/libs/grpc/src/proto/grpc/testing/test.proto
@@ -77,16 +77,16 @@ service ReconnectService {
rpc Start(grpc.testing.ReconnectParams) returns (grpc.testing.Empty);
rpc Stop(grpc.testing.Empty) returns (grpc.testing.ReconnectInfo);
}
-
-// A service used to obtain stats for verifying LB behavior.
-service LoadBalancerStatsService {
- // Gets the backend distribution for RPCs sent by a test client.
- rpc GetClientStats(LoadBalancerStatsRequest)
- returns (LoadBalancerStatsResponse) {}
-}
-
-// A service to remotely control health status of an xDS test server.
-service XdsUpdateHealthService {
- rpc SetServing(grpc.testing.Empty) returns (grpc.testing.Empty);
- rpc SetNotServing(grpc.testing.Empty) returns (grpc.testing.Empty);
-}
+
+// A service used to obtain stats for verifying LB behavior.
+service LoadBalancerStatsService {
+ // Gets the backend distribution for RPCs sent by a test client.
+ rpc GetClientStats(LoadBalancerStatsRequest)
+ returns (LoadBalancerStatsResponse) {}
+}
+
+// A service to remotely control health status of an xDS test server.
+service XdsUpdateHealthService {
+ rpc SetServing(grpc.testing.Empty) returns (grpc.testing.Empty);
+ rpc SetNotServing(grpc.testing.Empty) returns (grpc.testing.Empty);
+}
diff --git a/contrib/libs/grpc/src/proto/grpc/testing/xds/.yandex_meta/licenses.list.txt b/contrib/libs/grpc/src/proto/grpc/testing/xds/.yandex_meta/licenses.list.txt
index dff86714ccf..9c1158fe2e9 100644
--- a/contrib/libs/grpc/src/proto/grpc/testing/xds/.yandex_meta/licenses.list.txt
+++ b/contrib/libs/grpc/src/proto/grpc/testing/xds/.yandex_meta/licenses.list.txt
@@ -1,20 +1,20 @@
-====================Apache-2.0====================
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-
-====================COPYRIGHT====================
-// Copyright 2019 The gRPC Authors
-
-
-====================COPYRIGHT====================
-// Copyright 2020 The gRPC Authors
+====================Apache-2.0====================
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+
+====================COPYRIGHT====================
+// Copyright 2019 The gRPC Authors
+
+
+====================COPYRIGHT====================
+// Copyright 2020 The gRPC Authors
diff --git a/contrib/libs/grpc/src/proto/grpc/testing/xds/cds_for_test.proto b/contrib/libs/grpc/src/proto/grpc/testing/xds/cds_for_test.proto
index 8372a5f57f5..8ea198d0ee7 100644
--- a/contrib/libs/grpc/src/proto/grpc/testing/xds/cds_for_test.proto
+++ b/contrib/libs/grpc/src/proto/grpc/testing/xds/cds_for_test.proto
@@ -1,174 +1,174 @@
-// Copyright 2019 The gRPC Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// This file contains the xds protocol and its dependency. It can't be used by
-// the gRPC library; otherwise there can be duplicate definition problems if
-// users depend on both gRPC and Envoy. It can only be used by gRPC tests.
-//
-// TODO(juanlishen): This file is a hack to avoid a problem we're
-// currently having where we can't depend on a proto file in an external
-// repo due to bazel limitations. Once that's fixed, this should be
-// removed. Until this, it should be used in the gRPC tests only, or else it
-// will cause a conflict due to the same proto messages being defined in
-// multiple files in the same binary.
-
-syntax = "proto3";
-
-package envoy.api.v2;
-
-import "google/protobuf/wrappers.proto";
-
-// Aggregated Discovery Service (ADS) options. This is currently empty, but when
-// set in :ref:`ConfigSource <envoy_api_msg_core.ConfigSource>` can be used to
-// specify that ADS is to be used.
-message AggregatedConfigSource {
-}
-
-message SelfConfigSource {
-}
-
-message ConfigSource {
- oneof config_source_specifier {
- // When set, ADS will be used to fetch resources. The ADS API configuration
- // source in the bootstrap configuration is used.
- AggregatedConfigSource ads = 3;
-
- // [#not-implemented-hide:]
- // When set, the client will access the resources from the same server it got the
- // ConfigSource from, although not necessarily from the same stream. This is similar to the
- // :ref:`ads<envoy_api_field.ConfigSource.ads>` field, except that the client may use a
- // different stream to the same server. As a result, this field can be used for things
- // like LRS that cannot be sent on an ADS stream. It can also be used to link from (e.g.)
- // LDS to RDS on the same server without requiring the management server to know its name
- // or required credentials.
- // [#next-major-version: In xDS v3, consider replacing the ads field with this one, since
- // this field can implicitly mean to use the same stream in the case where the ConfigSource
- // is provided via ADS and the specified data can also be obtained via ADS.]
- SelfConfigSource self = 5;
- }
-}
-
-enum RoutingPriority {
- DEFAULT = 0;
- HIGH = 1;
-}
-
-message CircuitBreakers {
- message Thresholds {
- RoutingPriority priority = 1;
- google.protobuf.UInt32Value max_requests = 4;
- }
- repeated Thresholds thresholds = 1;
-}
-
-message Cluster {
- // Refer to :ref:`service discovery type <arch_overview_service_discovery_types>`
- // for an explanation on each type.
- enum DiscoveryType {
- // Refer to the :ref:`static discovery type<arch_overview_service_discovery_types_static>`
- // for an explanation.
- STATIC = 0;
-
- // Refer to the :ref:`strict DNS discovery
- // type<arch_overview_service_discovery_types_strict_dns>`
- // for an explanation.
- STRICT_DNS = 1;
-
- // Refer to the :ref:`logical DNS discovery
- // type<arch_overview_service_discovery_types_logical_dns>`
- // for an explanation.
- LOGICAL_DNS = 2;
-
- // Refer to the :ref:`service discovery type<arch_overview_service_discovery_types_eds>`
- // for an explanation.
- EDS = 3;
-
- // Refer to the :ref:`original destination discovery
- // type<arch_overview_service_discovery_types_original_destination>`
- // for an explanation.
- ORIGINAL_DST = 4;
- }
-
- string name = 1;
-
- oneof cluster_discovery_type {
- // The :ref:`service discovery type <arch_overview_service_discovery_types>`
- // to use for resolving the cluster.
- DiscoveryType type = 2;
- }
-
- // Only valid when discovery type is EDS.
- message EdsClusterConfig {
- // Configuration for the source of EDS updates for this Cluster.
- ConfigSource eds_config = 1;
-
- // Optional alternative to cluster name to present to EDS. This does not
- // have the same restrictions as cluster name, i.e. it may be arbitrary
- // length.
- string service_name = 2;
- }
-
- // Refer to :ref:`load balancer type <arch_overview_load_balancing_types>` architecture
- // overview section for information on each type.
- enum LbPolicy {
- // Refer to the :ref:`round robin load balancing
- // policy<arch_overview_load_balancing_types_round_robin>`
- // for an explanation.
- ROUND_ROBIN = 0;
-
- // Refer to the :ref:`least request load balancing
- // policy<arch_overview_load_balancing_types_least_request>`
- // for an explanation.
- LEAST_REQUEST = 1;
-
- // Refer to the :ref:`ring hash load balancing
- // policy<arch_overview_load_balancing_types_ring_hash>`
- // for an explanation.
- RING_HASH = 2;
-
- // Refer to the :ref:`random load balancing
- // policy<arch_overview_load_balancing_types_random>`
- // for an explanation.
- RANDOM = 3;
-
- // Refer to the :ref:`original destination load balancing
- // policy<arch_overview_load_balancing_types_original_destination>`
- // for an explanation.
- //
- // .. attention::
- //
- // **This load balancing policy is deprecated**. Use CLUSTER_PROVIDED instead.
- //
- ORIGINAL_DST_LB = 4;
-
- // Refer to the :ref:`Maglev load balancing policy<arch_overview_load_balancing_types_maglev>`
- // for an explanation.
- MAGLEV = 5;
-
- // This load balancer type must be specified if the configured cluster provides a cluster
- // specific load balancer. Consult the configured cluster's documentation for whether to set
- // this option or not.
- CLUSTER_PROVIDED = 6;
- }
- // The :ref:`load balancer type <arch_overview_load_balancing_types>` to use
- // when picking a host in the cluster.
- LbPolicy lb_policy = 6;
-
- // Configuration to use for EDS updates for the Cluster.
- EdsClusterConfig eds_cluster_config = 3;
-
- CircuitBreakers circuit_breakers = 10;
-
- ConfigSource lrs_server = 42;
-}
+// Copyright 2019 The gRPC Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// This file contains the xds protocol and its dependency. It can't be used by
+// the gRPC library; otherwise there can be duplicate definition problems if
+// users depend on both gRPC and Envoy. It can only be used by gRPC tests.
+//
+// TODO(juanlishen): This file is a hack to avoid a problem we're
+// currently having where we can't depend on a proto file in an external
+// repo due to bazel limitations. Once that's fixed, this should be
+// removed. Until this, it should be used in the gRPC tests only, or else it
+// will cause a conflict due to the same proto messages being defined in
+// multiple files in the same binary.
+
+syntax = "proto3";
+
+package envoy.api.v2;
+
+import "google/protobuf/wrappers.proto";
+
+// Aggregated Discovery Service (ADS) options. This is currently empty, but when
+// set in :ref:`ConfigSource <envoy_api_msg_core.ConfigSource>` can be used to
+// specify that ADS is to be used.
+message AggregatedConfigSource {
+}
+
+message SelfConfigSource {
+}
+
+message ConfigSource {
+ oneof config_source_specifier {
+ // When set, ADS will be used to fetch resources. The ADS API configuration
+ // source in the bootstrap configuration is used.
+ AggregatedConfigSource ads = 3;
+
+ // [#not-implemented-hide:]
+ // When set, the client will access the resources from the same server it got the
+ // ConfigSource from, although not necessarily from the same stream. This is similar to the
+ // :ref:`ads<envoy_api_field.ConfigSource.ads>` field, except that the client may use a
+ // different stream to the same server. As a result, this field can be used for things
+ // like LRS that cannot be sent on an ADS stream. It can also be used to link from (e.g.)
+ // LDS to RDS on the same server without requiring the management server to know its name
+ // or required credentials.
+ // [#next-major-version: In xDS v3, consider replacing the ads field with this one, since
+ // this field can implicitly mean to use the same stream in the case where the ConfigSource
+ // is provided via ADS and the specified data can also be obtained via ADS.]
+ SelfConfigSource self = 5;
+ }
+}
+
+enum RoutingPriority {
+ DEFAULT = 0;
+ HIGH = 1;
+}
+
+message CircuitBreakers {
+ message Thresholds {
+ RoutingPriority priority = 1;
+ google.protobuf.UInt32Value max_requests = 4;
+ }
+ repeated Thresholds thresholds = 1;
+}
+
+message Cluster {
+ // Refer to :ref:`service discovery type <arch_overview_service_discovery_types>`
+ // for an explanation on each type.
+ enum DiscoveryType {
+ // Refer to the :ref:`static discovery type<arch_overview_service_discovery_types_static>`
+ // for an explanation.
+ STATIC = 0;
+
+ // Refer to the :ref:`strict DNS discovery
+ // type<arch_overview_service_discovery_types_strict_dns>`
+ // for an explanation.
+ STRICT_DNS = 1;
+
+ // Refer to the :ref:`logical DNS discovery
+ // type<arch_overview_service_discovery_types_logical_dns>`
+ // for an explanation.
+ LOGICAL_DNS = 2;
+
+ // Refer to the :ref:`service discovery type<arch_overview_service_discovery_types_eds>`
+ // for an explanation.
+ EDS = 3;
+
+ // Refer to the :ref:`original destination discovery
+ // type<arch_overview_service_discovery_types_original_destination>`
+ // for an explanation.
+ ORIGINAL_DST = 4;
+ }
+
+ string name = 1;
+
+ oneof cluster_discovery_type {
+ // The :ref:`service discovery type <arch_overview_service_discovery_types>`
+ // to use for resolving the cluster.
+ DiscoveryType type = 2;
+ }
+
+ // Only valid when discovery type is EDS.
+ message EdsClusterConfig {
+ // Configuration for the source of EDS updates for this Cluster.
+ ConfigSource eds_config = 1;
+
+ // Optional alternative to cluster name to present to EDS. This does not
+ // have the same restrictions as cluster name, i.e. it may be arbitrary
+ // length.
+ string service_name = 2;
+ }
+
+ // Refer to :ref:`load balancer type <arch_overview_load_balancing_types>` architecture
+ // overview section for information on each type.
+ enum LbPolicy {
+ // Refer to the :ref:`round robin load balancing
+ // policy<arch_overview_load_balancing_types_round_robin>`
+ // for an explanation.
+ ROUND_ROBIN = 0;
+
+ // Refer to the :ref:`least request load balancing
+ // policy<arch_overview_load_balancing_types_least_request>`
+ // for an explanation.
+ LEAST_REQUEST = 1;
+
+ // Refer to the :ref:`ring hash load balancing
+ // policy<arch_overview_load_balancing_types_ring_hash>`
+ // for an explanation.
+ RING_HASH = 2;
+
+ // Refer to the :ref:`random load balancing
+ // policy<arch_overview_load_balancing_types_random>`
+ // for an explanation.
+ RANDOM = 3;
+
+ // Refer to the :ref:`original destination load balancing
+ // policy<arch_overview_load_balancing_types_original_destination>`
+ // for an explanation.
+ //
+ // .. attention::
+ //
+ // **This load balancing policy is deprecated**. Use CLUSTER_PROVIDED instead.
+ //
+ ORIGINAL_DST_LB = 4;
+
+ // Refer to the :ref:`Maglev load balancing policy<arch_overview_load_balancing_types_maglev>`
+ // for an explanation.
+ MAGLEV = 5;
+
+ // This load balancer type must be specified if the configured cluster provides a cluster
+ // specific load balancer. Consult the configured cluster's documentation for whether to set
+ // this option or not.
+ CLUSTER_PROVIDED = 6;
+ }
+ // The :ref:`load balancer type <arch_overview_load_balancing_types>` to use
+ // when picking a host in the cluster.
+ LbPolicy lb_policy = 6;
+
+ // Configuration to use for EDS updates for the Cluster.
+ EdsClusterConfig eds_cluster_config = 3;
+
+ CircuitBreakers circuit_breakers = 10;
+
+ ConfigSource lrs_server = 42;
+}
diff --git a/contrib/libs/grpc/src/proto/grpc/testing/xds/eds_for_test.proto b/contrib/libs/grpc/src/proto/grpc/testing/xds/eds_for_test.proto
index 61bfc4ac5c2..3b8ce66f0e5 100644
--- a/contrib/libs/grpc/src/proto/grpc/testing/xds/eds_for_test.proto
+++ b/contrib/libs/grpc/src/proto/grpc/testing/xds/eds_for_test.proto
@@ -28,8 +28,8 @@ syntax = "proto3";
package envoy.api.v2;
import "google/protobuf/any.proto";
-import "google/protobuf/struct.proto";
-import "google/protobuf/wrappers.proto";
+import "google/protobuf/struct.proto";
+import "google/protobuf/wrappers.proto";
message Status {
// The status code, which should be an enum value of [google.rpc.Code][].
@@ -95,7 +95,7 @@ message Node {
// Opaque metadata extending the node identifier. Envoy will pass this
// directly to the management server.
- google.protobuf.Struct metadata = 3;
+ google.protobuf.Struct metadata = 3;
// Locality specifying where the Envoy instance is running.
Locality locality = 4;
@@ -103,24 +103,24 @@ message Node {
// This is motivated by informing a management server during canary which
// version of Envoy is being tested in a heterogeneous fleet. This will be set
// by Envoy in management server RPCs.
- string build_version = 5 [deprecated = true];
-
- // Free-form string that identifies the entity requesting config.
- // E.g. "envoy" or "grpc"
- string user_agent_name = 6;
-
- oneof user_agent_version_type {
- // Free-form string that identifies the version of the entity requesting config.
- // E.g. "1.12.2" or "abcd1234", or "SpecialEnvoyBuild"
- string user_agent_version = 7;
- }
-
- // Client feature support list. These are well known features described
- // in the Envoy API repository for a given major version of an API. Client features
- // use reverse DNS naming scheme, for example `com.acme.feature`.
- // See :ref:`the list of features <client_features>` that xDS client may
- // support.
- repeated string client_features = 10;
+ string build_version = 5 [deprecated = true];
+
+ // Free-form string that identifies the entity requesting config.
+ // E.g. "envoy" or "grpc"
+ string user_agent_name = 6;
+
+ oneof user_agent_version_type {
+ // Free-form string that identifies the version of the entity requesting config.
+ // E.g. "1.12.2" or "abcd1234", or "SpecialEnvoyBuild"
+ string user_agent_version = 7;
+ }
+
+ // Client feature support list. These are well known features described
+ // in the Envoy API repository for a given major version of an API. Client features
+ // use reverse DNS naming scheme, for example `com.acme.feature`.
+ // See :ref:`the list of features <client_features>` that xDS client may
+ // support.
+ repeated string client_features = 10;
}
///////////////////////////////////////////////////////////////////////////////
@@ -271,7 +271,7 @@ message Address {
message Metadata {
// Key is the reverse DNS filter name, e.g. com.acme.widget. The envoy.*
// namespace is reserved for Envoy's built-in filters.
- map<string, google.protobuf.Struct> filter_metadata = 1;
+ map<string, google.protobuf.Struct> filter_metadata = 1;
}
///////////////////////////////////////////////////////////////////////////////
@@ -366,7 +366,7 @@ message LbEndpoint {
// The limit of 128 is somewhat arbitrary, but is applied due to performance
// concerns with the current implementation and can be removed when
// `this issue <https://github.com/envoyproxy/envoy/issues/1285>`_ is fixed.
- google.protobuf.UInt32Value load_balancing_weight = 4;
+ google.protobuf.UInt32Value load_balancing_weight = 4;
}
// A group of endpoints belonging to a Locality.
@@ -396,7 +396,7 @@ message LocalityLbEndpoints {
// The limit of 128 is somewhat arbitrary, but is applied due to performance
// concerns with the current implementation and can be removed when
// `this issue <https://github.com/envoyproxy/envoy/issues/1285>`_ is fixed.
- google.protobuf.UInt32Value load_balancing_weight = 3;
+ google.protobuf.UInt32Value load_balancing_weight = 3;
// Optional: the priority for this LocalityLbEndpoints. If unspecified this will
// default to the highest priority (0).
@@ -509,7 +509,7 @@ message ClusterLoadAssignment {
// below 72%.
// Read more at :ref:`priority levels <arch_overview_load_balancing_priority_levels>` and
// :ref:`localities <arch_overview_load_balancing_locality_weighted_lb>`.
- google.protobuf.UInt32Value overprovisioning_factor = 3;
+ google.protobuf.UInt32Value overprovisioning_factor = 3;
}
// Load balancing policy settings.
diff --git a/contrib/libs/grpc/src/proto/grpc/testing/xds/lds_rds_for_test.proto b/contrib/libs/grpc/src/proto/grpc/testing/xds/lds_rds_for_test.proto
index 14d2ecd1b44..d5ba5bd32bc 100644
--- a/contrib/libs/grpc/src/proto/grpc/testing/xds/lds_rds_for_test.proto
+++ b/contrib/libs/grpc/src/proto/grpc/testing/xds/lds_rds_for_test.proto
@@ -1,215 +1,215 @@
-// Copyright 2019 The gRPC Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// This file contains the eds protocol and its dependency.
-//
-// TODO(juanlishen): This file is a hack to avoid a problem we're
-// currently having where we can't depend on a proto file in an external
-// repo due to bazel limitations. Once that's fixed, this should be
-// removed. Until this, it should be used in the gRPC tests only, or else it
-// will cause a conflict due to the same proto messages being defined in
-// multiple files in the same binary.
-
-syntax = "proto3";
-
-package envoy.api.v2;
-
-import "google/protobuf/any.proto";
-import "google/protobuf/wrappers.proto";
-import "src/proto/grpc/testing/xds/cds_for_test.proto";
-import "src/proto/grpc/testing/xds/eds_for_test.proto";
-
-message RegexMatcher {
- message GoogleRE2 {
- google.protobuf.UInt32Value max_program_size = 1;
- }
- oneof engine_type {
- GoogleRE2 google_re2 = 1;
- }
- string regex = 2;
-}
-
-message Int64Range {
- // start of the range (inclusive)
- int64 start = 1;
-
- // end of the range (exclusive)
- int64 end = 2;
-}
-
-message BoolValue {
- // The bool value.
- bool value = 1;
-}
-
-message HeaderMatcher {
- string name = 1;
- oneof header_match_specifier {
- string exact_match = 4;
- RegexMatcher safe_regex_match = 11;
- Int64Range range_match = 6;
- bool present_match = 7;
- string prefix_match = 9;
- string suffix_match = 10;
- }
- bool invert_match = 8;
-}
-
-message QueryParameterMatcher {
- string name = 1;
-}
-
-message RuntimeFractionalPercent {
- FractionalPercent default_value = 1;
-}
-
-message RouteMatch {
- oneof path_specifier {
- // If specified, the route is a prefix rule meaning that the prefix must
- // match the beginning of the *:path* header.
- string prefix = 1;
- string path = 2;
- RegexMatcher safe_regex = 10;
- }
- BoolValue case_sensitive = 4;
- repeated QueryParameterMatcher query_parameters = 7;
- RuntimeFractionalPercent runtime_fraction = 9;
- repeated HeaderMatcher headers = 6;
-}
-
-message WeightedCluster {
- message ClusterWeight {
- string name = 1;
- google.protobuf.UInt32Value weight = 2;
- }
- repeated ClusterWeight clusters = 1;
- google.protobuf.UInt32Value total_weight = 3;
-}
-
-message RouteAction {
- oneof cluster_specifier {
- // Indicates the upstream cluster to which the request should be routed
- // to.
- string cluster = 1;
-
- // Envoy will determine the cluster to route to by reading the value of the
- // HTTP header named by cluster_header from the request headers. If the
- // header is not found or the referenced cluster does not exist, Envoy will
- // return a 404 response.
- //
- // .. attention::
- //
- // Internally, Envoy always uses the HTTP/2 *:authority* header to represent the HTTP/1
- // *Host* header. Thus, if attempting to match on *Host*, match on *:authority* instead.
- string cluster_header = 2;
- // Multiple upstream clusters can be specified for a given route. The
- // request is routed to one of the upstream clusters based on weights
- // assigned to each cluster. See
- // :ref:`traffic splitting <config_http_conn_man_route_table_traffic_splitting_split>`
- // for additional documentation.
- WeightedCluster weighted_clusters = 3;
- }
-}
-
-message RedirectAction {}
-
-message Route {
- RouteMatch match = 1;
-
- oneof action {
- // Route request to some upstream cluster.
- RouteAction route = 2;
-
- // Return a redirect.
- RedirectAction redirect = 3;
- }
-}
-
-message VirtualHost {
- repeated string domains = 2;
- repeated Route routes = 3;
-}
-
-message Rds {
- // Configuration source specifier for RDS.
- ConfigSource config_source = 1;
-
- // The name of the route configuration. This name will be passed to the RDS
- // API. This allows an Envoy configuration with multiple HTTP listeners (and
- // associated HTTP connection manager filters) to use different route
- // configurations.
- string route_config_name = 2;
-}
-
-message RouteConfiguration {
- // The name of the route configuration. For example, it might match
- // :ref:`route_config_name
- // <envoy_api_field_config.filter.network.http_connection_manager.v2.Rds.route_config_name>` in
- // :ref:`envoy_api_msg_config.filter.network.http_connection_manager.v2.Rds`.
- string name = 1;
-
- // An array of virtual hosts that make up the route table.
- repeated VirtualHost virtual_hosts = 2;
-}
-
-message ScopedRoutes {}
-
-message HttpConnectionManager {
- oneof route_specifier {
- // The connection manager’s route table will be dynamically loaded via the RDS API.
- Rds rds = 3;
-
- // The route table for the connection manager is static and is specified in this property.
- RouteConfiguration route_config = 4;
-
- // A route table will be dynamically assigned to each request based on request attributes
- // (e.g., the value of a header). The "routing scopes" (i.e., route tables) and "scope keys" are
- // specified in this message.
- ScopedRoutes scoped_routes = 31;
- }
-}
-
-message ApiListener {
- // The type in this field determines the type of API listener. At present, the following
- // types are supported:
- // envoy.config.filter.network.http_connection_manager.v2.HttpConnectionManager (HTTP)
- // [#next-major-version: In the v3 API, replace this Any field with a oneof containing the
- // specific config message for each type of API listener. We could not do this in v2 because
- // it would have caused circular dependencies for go protos: lds.proto depends on this file,
- // and http_connection_manager.proto depends on rds.proto, which is in the same directory as
- // lds.proto, so lds.proto cannot depend on this file.]
- google.protobuf.Any api_listener = 1;
-}
-
-message Listener {
- string name = 1;
-
- // Used to represent an API listener, which is used in non-proxy clients. The type of API
- // exposed to the non-proxy application depends on the type of API listener.
- // When this field is set, no other field except for :ref:`name<envoy_api_field_Listener.name>`
- // should be set.
- //
- // .. note::
- //
- // Currently only one ApiListener can be installed; and it can only be done via bootstrap config,
- // not LDS.
- //
- // [#next-major-version: In the v3 API, instead of this messy approach where the socket
- // listener fields are directly in the top-level Listener message and the API listener types
- // are in the ApiListener message, the socket listener messages should be in their own message,
- // and the top-level Listener should essentially be a oneof that selects between the
- // socket listener and the various types of API listener. That way, a given Listener message
- // can structurally only contain the fields of the relevant type.]
- ApiListener api_listener = 19;
-}
+// Copyright 2019 The gRPC Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// This file contains the eds protocol and its dependency.
+//
+// TODO(juanlishen): This file is a hack to avoid a problem we're
+// currently having where we can't depend on a proto file in an external
+// repo due to bazel limitations. Once that's fixed, this should be
+// removed. Until this, it should be used in the gRPC tests only, or else it
+// will cause a conflict due to the same proto messages being defined in
+// multiple files in the same binary.
+
+syntax = "proto3";
+
+package envoy.api.v2;
+
+import "google/protobuf/any.proto";
+import "google/protobuf/wrappers.proto";
+import "src/proto/grpc/testing/xds/cds_for_test.proto";
+import "src/proto/grpc/testing/xds/eds_for_test.proto";
+
+message RegexMatcher {
+ message GoogleRE2 {
+ google.protobuf.UInt32Value max_program_size = 1;
+ }
+ oneof engine_type {
+ GoogleRE2 google_re2 = 1;
+ }
+ string regex = 2;
+}
+
+message Int64Range {
+ // start of the range (inclusive)
+ int64 start = 1;
+
+ // end of the range (exclusive)
+ int64 end = 2;
+}
+
+message BoolValue {
+ // The bool value.
+ bool value = 1;
+}
+
+message HeaderMatcher {
+ string name = 1;
+ oneof header_match_specifier {
+ string exact_match = 4;
+ RegexMatcher safe_regex_match = 11;
+ Int64Range range_match = 6;
+ bool present_match = 7;
+ string prefix_match = 9;
+ string suffix_match = 10;
+ }
+ bool invert_match = 8;
+}
+
+message QueryParameterMatcher {
+ string name = 1;
+}
+
+message RuntimeFractionalPercent {
+ FractionalPercent default_value = 1;
+}
+
+message RouteMatch {
+ oneof path_specifier {
+ // If specified, the route is a prefix rule meaning that the prefix must
+ // match the beginning of the *:path* header.
+ string prefix = 1;
+ string path = 2;
+ RegexMatcher safe_regex = 10;
+ }
+ BoolValue case_sensitive = 4;
+ repeated QueryParameterMatcher query_parameters = 7;
+ RuntimeFractionalPercent runtime_fraction = 9;
+ repeated HeaderMatcher headers = 6;
+}
+
+message WeightedCluster {
+ message ClusterWeight {
+ string name = 1;
+ google.protobuf.UInt32Value weight = 2;
+ }
+ repeated ClusterWeight clusters = 1;
+ google.protobuf.UInt32Value total_weight = 3;
+}
+
+message RouteAction {
+ oneof cluster_specifier {
+ // Indicates the upstream cluster to which the request should be routed
+ // to.
+ string cluster = 1;
+
+ // Envoy will determine the cluster to route to by reading the value of the
+ // HTTP header named by cluster_header from the request headers. If the
+ // header is not found or the referenced cluster does not exist, Envoy will
+ // return a 404 response.
+ //
+ // .. attention::
+ //
+ // Internally, Envoy always uses the HTTP/2 *:authority* header to represent the HTTP/1
+ // *Host* header. Thus, if attempting to match on *Host*, match on *:authority* instead.
+ string cluster_header = 2;
+ // Multiple upstream clusters can be specified for a given route. The
+ // request is routed to one of the upstream clusters based on weights
+ // assigned to each cluster. See
+ // :ref:`traffic splitting <config_http_conn_man_route_table_traffic_splitting_split>`
+ // for additional documentation.
+ WeightedCluster weighted_clusters = 3;
+ }
+}
+
+message RedirectAction {}
+
+message Route {
+ RouteMatch match = 1;
+
+ oneof action {
+ // Route request to some upstream cluster.
+ RouteAction route = 2;
+
+ // Return a redirect.
+ RedirectAction redirect = 3;
+ }
+}
+
+message VirtualHost {
+ repeated string domains = 2;
+ repeated Route routes = 3;
+}
+
+message Rds {
+ // Configuration source specifier for RDS.
+ ConfigSource config_source = 1;
+
+ // The name of the route configuration. This name will be passed to the RDS
+ // API. This allows an Envoy configuration with multiple HTTP listeners (and
+ // associated HTTP connection manager filters) to use different route
+ // configurations.
+ string route_config_name = 2;
+}
+
+message RouteConfiguration {
+ // The name of the route configuration. For example, it might match
+ // :ref:`route_config_name
+ // <envoy_api_field_config.filter.network.http_connection_manager.v2.Rds.route_config_name>` in
+ // :ref:`envoy_api_msg_config.filter.network.http_connection_manager.v2.Rds`.
+ string name = 1;
+
+ // An array of virtual hosts that make up the route table.
+ repeated VirtualHost virtual_hosts = 2;
+}
+
+message ScopedRoutes {}
+
+message HttpConnectionManager {
+ oneof route_specifier {
+ // The connection manager’s route table will be dynamically loaded via the RDS API.
+ Rds rds = 3;
+
+ // The route table for the connection manager is static and is specified in this property.
+ RouteConfiguration route_config = 4;
+
+ // A route table will be dynamically assigned to each request based on request attributes
+ // (e.g., the value of a header). The "routing scopes" (i.e., route tables) and "scope keys" are
+ // specified in this message.
+ ScopedRoutes scoped_routes = 31;
+ }
+}
+
+message ApiListener {
+ // The type in this field determines the type of API listener. At present, the following
+ // types are supported:
+ // envoy.config.filter.network.http_connection_manager.v2.HttpConnectionManager (HTTP)
+ // [#next-major-version: In the v3 API, replace this Any field with a oneof containing the
+ // specific config message for each type of API listener. We could not do this in v2 because
+ // it would have caused circular dependencies for go protos: lds.proto depends on this file,
+ // and http_connection_manager.proto depends on rds.proto, which is in the same directory as
+ // lds.proto, so lds.proto cannot depend on this file.]
+ google.protobuf.Any api_listener = 1;
+}
+
+message Listener {
+ string name = 1;
+
+ // Used to represent an API listener, which is used in non-proxy clients. The type of API
+ // exposed to the non-proxy application depends on the type of API listener.
+ // When this field is set, no other field except for :ref:`name<envoy_api_field_Listener.name>`
+ // should be set.
+ //
+ // .. note::
+ //
+ // Currently only one ApiListener can be installed; and it can only be done via bootstrap config,
+ // not LDS.
+ //
+ // [#next-major-version: In the v3 API, instead of this messy approach where the socket
+ // listener fields are directly in the top-level Listener message and the API listener types
+ // are in the ApiListener message, the socket listener messages should be in their own message,
+ // and the top-level Listener should essentially be a oneof that selects between the
+ // socket listener and the various types of API listener. That way, a given Listener message
+ // can structurally only contain the fields of the relevant type.]
+ ApiListener api_listener = 19;
+}
diff --git a/contrib/libs/grpc/src/proto/grpc/testing/xds/lrs_for_test.proto b/contrib/libs/grpc/src/proto/grpc/testing/xds/lrs_for_test.proto
index 001810a471f..d46d5e2ccc5 100644
--- a/contrib/libs/grpc/src/proto/grpc/testing/xds/lrs_for_test.proto
+++ b/contrib/libs/grpc/src/proto/grpc/testing/xds/lrs_for_test.proto
@@ -166,14 +166,14 @@ message LoadStatsRequest {
// [#not-implemented-hide:] Not configuration. TBD how to doc proto APIs.
message LoadStatsResponse {
// Clusters to report stats for.
- // Not populated if *send_all_clusters* is true.
+ // Not populated if *send_all_clusters* is true.
repeated string clusters = 1;
- // If true, the client should send all clusters it knows about.
- // Only clients that advertise the "envoy.lrs.supports_send_all_clusters" capability in their
- // :ref:`client_features<envoy_api_field_core.Node.client_features>` field will honor this field.
- bool send_all_clusters = 4;
-
+ // If true, the client should send all clusters it knows about.
+ // Only clients that advertise the "envoy.lrs.supports_send_all_clusters" capability in their
+ // :ref:`client_features<envoy_api_field_core.Node.client_features>` field will honor this field.
+ bool send_all_clusters = 4;
+
// The minimum interval of time to collect stats over. This is only a minimum for two reasons:
// 1. There may be some delay from when the timer fires until stats sampling occurs.
// 2. For clusters that were already feature in the previous *LoadStatsResponse*, any traffic
diff --git a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/address.proto b/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/address.proto
index 08ada5cd951..abea8bf68a6 100644
--- a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/address.proto
+++ b/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/address.proto
@@ -1,50 +1,50 @@
-// Copyright 2020 The gRPC Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// Local copy of Envoy xDS proto file, used for testing only.
-
-syntax = "proto3";
-
-package envoy.config.core.v3;
-
-// [#protodoc-title: Network addresses]
-
-// [#next-free-field: 7]
-message SocketAddress {
- // The address for this socket. :ref:`Listeners <config_listeners>` will bind
- // to the address. An empty address is not allowed. Specify ``0.0.0.0`` or ``::``
- // to bind to any address. [#comment:TODO(zuercher) reinstate when implemented:
- // It is possible to distinguish a Listener address via the prefix/suffix matching
- // in :ref:`FilterChainMatch <envoy_api_msg_config.listener.v3.FilterChainMatch>`.] When used
- // within an upstream :ref:`BindConfig <envoy_api_msg_config.core.v3.BindConfig>`, the address
- // controls the source address of outbound connections. For :ref:`clusters
- // <envoy_api_msg_config.cluster.v3.Cluster>`, the cluster type determines whether the
- // address must be an IP (*STATIC* or *EDS* clusters) or a hostname resolved by DNS
- // (*STRICT_DNS* or *LOGICAL_DNS* clusters). Address resolution can be customized
- // via :ref:`resolver_name <envoy_api_field_config.core.v3.SocketAddress.resolver_name>`.
- string address = 2;
-
- oneof port_specifier {
- uint32 port_value = 3;
- }
-}
-
-// Addresses specify either a logical or physical address and port, which are
-// used to tell Envoy where to bind/listen, connect to upstream and find
-// management servers.
-message Address {
- oneof address {
- SocketAddress socket_address = 1;
- }
-}
+// Copyright 2020 The gRPC Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Local copy of Envoy xDS proto file, used for testing only.
+
+syntax = "proto3";
+
+package envoy.config.core.v3;
+
+// [#protodoc-title: Network addresses]
+
+// [#next-free-field: 7]
+message SocketAddress {
+ // The address for this socket. :ref:`Listeners <config_listeners>` will bind
+ // to the address. An empty address is not allowed. Specify ``0.0.0.0`` or ``::``
+ // to bind to any address. [#comment:TODO(zuercher) reinstate when implemented:
+ // It is possible to distinguish a Listener address via the prefix/suffix matching
+ // in :ref:`FilterChainMatch <envoy_api_msg_config.listener.v3.FilterChainMatch>`.] When used
+ // within an upstream :ref:`BindConfig <envoy_api_msg_config.core.v3.BindConfig>`, the address
+ // controls the source address of outbound connections. For :ref:`clusters
+ // <envoy_api_msg_config.cluster.v3.Cluster>`, the cluster type determines whether the
+ // address must be an IP (*STATIC* or *EDS* clusters) or a hostname resolved by DNS
+ // (*STRICT_DNS* or *LOGICAL_DNS* clusters). Address resolution can be customized
+ // via :ref:`resolver_name <envoy_api_field_config.core.v3.SocketAddress.resolver_name>`.
+ string address = 2;
+
+ oneof port_specifier {
+ uint32 port_value = 3;
+ }
+}
+
+// Addresses specify either a logical or physical address and port, which are
+// used to tell Envoy where to bind/listen, connect to upstream and find
+// management servers.
+message Address {
+ oneof address {
+ SocketAddress socket_address = 1;
+ }
+}
diff --git a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/ads.proto b/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/ads.proto
index c9f61571f37..aea815d0006 100644
--- a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/ads.proto
+++ b/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/ads.proto
@@ -1,45 +1,45 @@
-// Copyright 2020 The gRPC Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// Local copy of Envoy xDS proto file, used for testing only.
-
-syntax = "proto3";
-
-package envoy.service.discovery.v3;
-
-import "src/proto/grpc/testing/xds/v3/discovery.proto";
-
-// [#protodoc-title: Aggregated Discovery Service (ADS)]
-
-// [#not-implemented-hide:] Discovery services for endpoints, clusters, routes,
-// and listeners are retained in the package `envoy.api.v2` for backwards
-// compatibility with existing management servers. New development in discovery
-// services should proceed in the package `envoy.service.discovery.v2`.
-
-// See https://github.com/lyft/envoy-api#apis for a description of the role of
-// ADS and how it is intended to be used by a management server. ADS requests
-// have the same structure as their singleton xDS counterparts, but can
-// multiplex many resource types on a single stream. The type_url in the
-// DiscoveryRequest/DiscoveryResponse provides sufficient information to recover
-// the multiplexed singleton APIs at the Envoy instance and management server.
-service AggregatedDiscoveryService {
- // This is a gRPC-only API.
- rpc StreamAggregatedResources(stream DiscoveryRequest) returns (stream DiscoveryResponse) {
- }
-}
-
-// [#not-implemented-hide:] Not configuration. Workaround c++ protobuf issue with importing
-// services: https://github.com/google/protobuf/issues/4221
-message AdsDummy {
-}
+// Copyright 2020 The gRPC Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Local copy of Envoy xDS proto file, used for testing only.
+
+syntax = "proto3";
+
+package envoy.service.discovery.v3;
+
+import "src/proto/grpc/testing/xds/v3/discovery.proto";
+
+// [#protodoc-title: Aggregated Discovery Service (ADS)]
+
+// [#not-implemented-hide:] Discovery services for endpoints, clusters, routes,
+// and listeners are retained in the package `envoy.api.v2` for backwards
+// compatibility with existing management servers. New development in discovery
+// services should proceed in the package `envoy.service.discovery.v2`.
+
+// See https://github.com/lyft/envoy-api#apis for a description of the role of
+// ADS and how it is intended to be used by a management server. ADS requests
+// have the same structure as their singleton xDS counterparts, but can
+// multiplex many resource types on a single stream. The type_url in the
+// DiscoveryRequest/DiscoveryResponse provides sufficient information to recover
+// the multiplexed singleton APIs at the Envoy instance and management server.
+service AggregatedDiscoveryService {
+ // This is a gRPC-only API.
+ rpc StreamAggregatedResources(stream DiscoveryRequest) returns (stream DiscoveryResponse) {
+ }
+}
+
+// [#not-implemented-hide:] Not configuration. Workaround c++ protobuf issue with importing
+// services: https://github.com/google/protobuf/issues/4221
+message AdsDummy {
+}
diff --git a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/base.proto b/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/base.proto
index a701fb1b4a2..acecdda806a 100644
--- a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/base.proto
+++ b/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/base.proto
@@ -1,111 +1,111 @@
-// Copyright 2020 The gRPC Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// Local copy of Envoy xDS proto file, used for testing only.
-
-syntax = "proto3";
-
-package envoy.config.core.v3;
-
-import "src/proto/grpc/testing/xds/v3/percent.proto";
-
-import "google/protobuf/struct.proto";
-
-// Identifies location of where either Envoy runs or where upstream hosts run.
-message Locality {
- // Region this :ref:`zone <envoy_api_field_config.core.v3.Locality.zone>` belongs to.
- string region = 1;
-
- // Defines the local service zone where Envoy is running. Though optional, it
- // should be set if discovery service routing is used and the discovery
- // service exposes :ref:`zone data <envoy_api_field_config.endpoint.v3.LocalityLbEndpoints.locality>`,
- // either in this message or via :option:`--service-zone`. The meaning of zone
- // is context dependent, e.g. `Availability Zone (AZ)
- // <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html>`_
- // on AWS, `Zone <https://cloud.google.com/compute/docs/regions-zones/>`_ on
- // GCP, etc.
- string zone = 2;
-
- // When used for locality of upstream hosts, this field further splits zone
- // into smaller chunks of sub-zones so they can be load balanced
- // independently.
- string sub_zone = 3;
-}
-
-// Identifies a specific Envoy instance. The node identifier is presented to the
-// management server, which may use this identifier to distinguish per Envoy
-// configuration for serving.
-// [#next-free-field: 12]
-message Node {
- // An opaque node identifier for the Envoy node. This also provides the local
- // service node name. It should be set if any of the following features are
- // used: :ref:`statsd <arch_overview_statistics>`, :ref:`CDS
- // <config_cluster_manager_cds>`, and :ref:`HTTP tracing
- // <arch_overview_tracing>`, either in this message or via
- // :option:`--service-node`.
- string id = 1;
-
- // Defines the local service cluster name where Envoy is running. Though
- // optional, it should be set if any of the following features are used:
- // :ref:`statsd <arch_overview_statistics>`, :ref:`health check cluster
- // verification
- // <envoy_api_field_config.core.v3.HealthCheck.HttpHealthCheck.service_name_matcher>`,
- // :ref:`runtime override directory <envoy_api_msg_config.bootstrap.v3.Runtime>`,
- // :ref:`user agent addition
- // <envoy_api_field_extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.add_user_agent>`,
- // :ref:`HTTP global rate limiting <config_http_filters_rate_limit>`,
- // :ref:`CDS <config_cluster_manager_cds>`, and :ref:`HTTP tracing
- // <arch_overview_tracing>`, either in this message or via
- // :option:`--service-cluster`.
- string cluster = 2;
-
- // Opaque metadata extending the node identifier. Envoy will pass this
- // directly to the management server.
- google.protobuf.Struct metadata = 3;
-
- // Locality specifying where the Envoy instance is running.
- Locality locality = 4;
-
- // Free-form string that identifies the entity requesting config.
- // E.g. "envoy" or "grpc"
- string user_agent_name = 6;
-
- oneof user_agent_version_type {
- // Free-form string that identifies the version of the entity requesting config.
- // E.g. "1.12.2" or "abcd1234", or "SpecialEnvoyBuild"
- string user_agent_version = 7;
- }
-
- // Client feature support list. These are well known features described
- // in the Envoy API repository for a given major version of an API. Client features
- // use reverse DNS naming scheme, for example `com.acme.feature`.
- // See :ref:`the list of features <client_features>` that xDS client may
- // support.
- repeated string client_features = 10;
-}
-
-// Runtime derived FractionalPercent with defaults for when the numerator or denominator is not
-// specified via a runtime key.
-//
-// .. note::
-//
-// Parsing of the runtime key's data is implemented such that it may be represented as a
-// :ref:`FractionalPercent <envoy_api_msg_type.v3.FractionalPercent>` proto represented as JSON/YAML
-// and may also be represented as an integer with the assumption that the value is an integral
-// percentage out of 100. For instance, a runtime key lookup returning the value "42" would parse
-// as a `FractionalPercent` whose numerator is 42 and denominator is HUNDRED.
-message RuntimeFractionalPercent {
- // Default value if the runtime value's for the numerator/denominator keys are not available.
- type.v3.FractionalPercent default_value = 1;
-}
+// Copyright 2020 The gRPC Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Local copy of Envoy xDS proto file, used for testing only.
+
+syntax = "proto3";
+
+package envoy.config.core.v3;
+
+import "src/proto/grpc/testing/xds/v3/percent.proto";
+
+import "google/protobuf/struct.proto";
+
+// Identifies location of where either Envoy runs or where upstream hosts run.
+message Locality {
+ // Region this :ref:`zone <envoy_api_field_config.core.v3.Locality.zone>` belongs to.
+ string region = 1;
+
+ // Defines the local service zone where Envoy is running. Though optional, it
+ // should be set if discovery service routing is used and the discovery
+ // service exposes :ref:`zone data <envoy_api_field_config.endpoint.v3.LocalityLbEndpoints.locality>`,
+ // either in this message or via :option:`--service-zone`. The meaning of zone
+ // is context dependent, e.g. `Availability Zone (AZ)
+ // <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html>`_
+ // on AWS, `Zone <https://cloud.google.com/compute/docs/regions-zones/>`_ on
+ // GCP, etc.
+ string zone = 2;
+
+ // When used for locality of upstream hosts, this field further splits zone
+ // into smaller chunks of sub-zones so they can be load balanced
+ // independently.
+ string sub_zone = 3;
+}
+
+// Identifies a specific Envoy instance. The node identifier is presented to the
+// management server, which may use this identifier to distinguish per Envoy
+// configuration for serving.
+// [#next-free-field: 12]
+message Node {
+ // An opaque node identifier for the Envoy node. This also provides the local
+ // service node name. It should be set if any of the following features are
+ // used: :ref:`statsd <arch_overview_statistics>`, :ref:`CDS
+ // <config_cluster_manager_cds>`, and :ref:`HTTP tracing
+ // <arch_overview_tracing>`, either in this message or via
+ // :option:`--service-node`.
+ string id = 1;
+
+ // Defines the local service cluster name where Envoy is running. Though
+ // optional, it should be set if any of the following features are used:
+ // :ref:`statsd <arch_overview_statistics>`, :ref:`health check cluster
+ // verification
+ // <envoy_api_field_config.core.v3.HealthCheck.HttpHealthCheck.service_name_matcher>`,
+ // :ref:`runtime override directory <envoy_api_msg_config.bootstrap.v3.Runtime>`,
+ // :ref:`user agent addition
+ // <envoy_api_field_extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.add_user_agent>`,
+ // :ref:`HTTP global rate limiting <config_http_filters_rate_limit>`,
+ // :ref:`CDS <config_cluster_manager_cds>`, and :ref:`HTTP tracing
+ // <arch_overview_tracing>`, either in this message or via
+ // :option:`--service-cluster`.
+ string cluster = 2;
+
+ // Opaque metadata extending the node identifier. Envoy will pass this
+ // directly to the management server.
+ google.protobuf.Struct metadata = 3;
+
+ // Locality specifying where the Envoy instance is running.
+ Locality locality = 4;
+
+ // Free-form string that identifies the entity requesting config.
+ // E.g. "envoy" or "grpc"
+ string user_agent_name = 6;
+
+ oneof user_agent_version_type {
+ // Free-form string that identifies the version of the entity requesting config.
+ // E.g. "1.12.2" or "abcd1234", or "SpecialEnvoyBuild"
+ string user_agent_version = 7;
+ }
+
+ // Client feature support list. These are well known features described
+ // in the Envoy API repository for a given major version of an API. Client features
+ // use reverse DNS naming scheme, for example `com.acme.feature`.
+ // See :ref:`the list of features <client_features>` that xDS client may
+ // support.
+ repeated string client_features = 10;
+}
+
+// Runtime derived FractionalPercent with defaults for when the numerator or denominator is not
+// specified via a runtime key.
+//
+// .. note::
+//
+// Parsing of the runtime key's data is implemented such that it may be represented as a
+// :ref:`FractionalPercent <envoy_api_msg_type.v3.FractionalPercent>` proto represented as JSON/YAML
+// and may also be represented as an integer with the assumption that the value is an integral
+// percentage out of 100. For instance, a runtime key lookup returning the value "42" would parse
+// as a `FractionalPercent` whose numerator is 42 and denominator is HUNDRED.
+message RuntimeFractionalPercent {
+ // Default value if the runtime value's for the numerator/denominator keys are not available.
+ type.v3.FractionalPercent default_value = 1;
+}
diff --git a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/cluster.proto b/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/cluster.proto
index 49e4d824b41..c20d887bc21 100644
--- a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/cluster.proto
+++ b/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/cluster.proto
@@ -1,162 +1,162 @@
-// Copyright 2020 The gRPC Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// Local copy of Envoy xDS proto file, used for testing only.
-
-syntax = "proto3";
-
-package envoy.config.cluster.v3;
-
-import "src/proto/grpc/testing/xds/v3/config_source.proto";
-
-import "google/protobuf/wrappers.proto";
-
-enum RoutingPriority {
- DEFAULT = 0;
- HIGH = 1;
-}
-
-message CircuitBreakers {
- message Thresholds {
- RoutingPriority priority = 1;
- google.protobuf.UInt32Value max_requests = 4;
- }
- repeated Thresholds thresholds = 1;
-}
-
-// [#protodoc-title: Cluster configuration]
-
-// Configuration for a single upstream cluster.
-// [#next-free-field: 48]
-message Cluster {
- // Refer to :ref:`service discovery type <arch_overview_service_discovery_types>`
- // for an explanation on each type.
- enum DiscoveryType {
- // Refer to the :ref:`static discovery type<arch_overview_service_discovery_types_static>`
- // for an explanation.
- STATIC = 0;
-
- // Refer to the :ref:`strict DNS discovery
- // type<arch_overview_service_discovery_types_strict_dns>`
- // for an explanation.
- STRICT_DNS = 1;
-
- // Refer to the :ref:`logical DNS discovery
- // type<arch_overview_service_discovery_types_logical_dns>`
- // for an explanation.
- LOGICAL_DNS = 2;
-
- // Refer to the :ref:`service discovery type<arch_overview_service_discovery_types_eds>`
- // for an explanation.
- EDS = 3;
-
- // Refer to the :ref:`original destination discovery
- // type<arch_overview_service_discovery_types_original_destination>`
- // for an explanation.
- ORIGINAL_DST = 4;
- }
-
- // Refer to :ref:`load balancer type <arch_overview_load_balancing_types>` architecture
- // overview section for information on each type.
- enum LbPolicy {
- reserved 4;
-
- reserved "ORIGINAL_DST_LB";
-
- // Refer to the :ref:`round robin load balancing
- // policy<arch_overview_load_balancing_types_round_robin>`
- // for an explanation.
- ROUND_ROBIN = 0;
-
- // Refer to the :ref:`least request load balancing
- // policy<arch_overview_load_balancing_types_least_request>`
- // for an explanation.
- LEAST_REQUEST = 1;
-
- // Refer to the :ref:`ring hash load balancing
- // policy<arch_overview_load_balancing_types_ring_hash>`
- // for an explanation.
- RING_HASH = 2;
-
- // Refer to the :ref:`random load balancing
- // policy<arch_overview_load_balancing_types_random>`
- // for an explanation.
- RANDOM = 3;
-
- // Refer to the :ref:`Maglev load balancing policy<arch_overview_load_balancing_types_maglev>`
- // for an explanation.
- MAGLEV = 5;
-
- // This load balancer type must be specified if the configured cluster provides a cluster
- // specific load balancer. Consult the configured cluster's documentation for whether to set
- // this option or not.
- CLUSTER_PROVIDED = 6;
-
- // [#not-implemented-hide:] Use the new :ref:`load_balancing_policy
- // <envoy_api_field_config.cluster.v3.Cluster.load_balancing_policy>` field to determine the LB policy.
- // [#next-major-version: In the v3 API, we should consider deprecating the lb_policy field
- // and instead using the new load_balancing_policy field as the one and only mechanism for
- // configuring this.]
- LOAD_BALANCING_POLICY_CONFIG = 7;
- }
-
- // Only valid when discovery type is EDS.
- message EdsClusterConfig {
- // Configuration for the source of EDS updates for this Cluster.
- core.v3.ConfigSource eds_config = 1;
-
- // Optional alternative to cluster name to present to EDS. This does not
- // have the same restrictions as cluster name, i.e. it may be arbitrary
- // length.
- string service_name = 2;
- }
-
- // Supplies the name of the cluster which must be unique across all clusters.
- // The cluster name is used when emitting
- // :ref:`statistics <config_cluster_manager_cluster_stats>` if :ref:`alt_stat_name
- // <envoy_api_field_config.cluster.v3.Cluster.alt_stat_name>` is not provided.
- // Any ``:`` in the cluster name will be converted to ``_`` when emitting statistics.
- string name = 1;
-
- oneof cluster_discovery_type {
- // The :ref:`service discovery type <arch_overview_service_discovery_types>`
- // to use for resolving the cluster.
- DiscoveryType type = 2;
- }
-
- // Configuration to use for EDS updates for the Cluster.
- EdsClusterConfig eds_cluster_config = 3;
-
- // The :ref:`load balancer type <arch_overview_load_balancing_types>` to use
- // when picking a host in the cluster.
- LbPolicy lb_policy = 6;
-
- CircuitBreakers circuit_breakers = 10;
-
- // [#not-implemented-hide:]
- // If present, tells the client where to send load reports via LRS. If not present, the
- // client will fall back to a client-side default, which may be either (a) don't send any
- // load reports or (b) send load reports for all clusters to a single default server
- // (which may be configured in the bootstrap file).
- //
- // Note that if multiple clusters point to the same LRS server, the client may choose to
- // create a separate stream for each cluster or it may choose to coalesce the data for
- // multiple clusters onto a single stream. Either way, the client must make sure to send
- // the data for any given cluster on no more than one stream.
- //
- // [#next-major-version: In the v3 API, we should consider restructuring this somehow,
- // maybe by allowing LRS to go on the ADS stream, or maybe by moving some of the negotiation
- // from the LRS stream here.]
- core.v3.ConfigSource lrs_server = 42;
-}
+// Copyright 2020 The gRPC Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Local copy of Envoy xDS proto file, used for testing only.
+
+syntax = "proto3";
+
+package envoy.config.cluster.v3;
+
+import "src/proto/grpc/testing/xds/v3/config_source.proto";
+
+import "google/protobuf/wrappers.proto";
+
+enum RoutingPriority {
+ DEFAULT = 0;
+ HIGH = 1;
+}
+
+message CircuitBreakers {
+ message Thresholds {
+ RoutingPriority priority = 1;
+ google.protobuf.UInt32Value max_requests = 4;
+ }
+ repeated Thresholds thresholds = 1;
+}
+
+// [#protodoc-title: Cluster configuration]
+
+// Configuration for a single upstream cluster.
+// [#next-free-field: 48]
+message Cluster {
+ // Refer to :ref:`service discovery type <arch_overview_service_discovery_types>`
+ // for an explanation on each type.
+ enum DiscoveryType {
+ // Refer to the :ref:`static discovery type<arch_overview_service_discovery_types_static>`
+ // for an explanation.
+ STATIC = 0;
+
+ // Refer to the :ref:`strict DNS discovery
+ // type<arch_overview_service_discovery_types_strict_dns>`
+ // for an explanation.
+ STRICT_DNS = 1;
+
+ // Refer to the :ref:`logical DNS discovery
+ // type<arch_overview_service_discovery_types_logical_dns>`
+ // for an explanation.
+ LOGICAL_DNS = 2;
+
+ // Refer to the :ref:`service discovery type<arch_overview_service_discovery_types_eds>`
+ // for an explanation.
+ EDS = 3;
+
+ // Refer to the :ref:`original destination discovery
+ // type<arch_overview_service_discovery_types_original_destination>`
+ // for an explanation.
+ ORIGINAL_DST = 4;
+ }
+
+ // Refer to :ref:`load balancer type <arch_overview_load_balancing_types>` architecture
+ // overview section for information on each type.
+ enum LbPolicy {
+ reserved 4;
+
+ reserved "ORIGINAL_DST_LB";
+
+ // Refer to the :ref:`round robin load balancing
+ // policy<arch_overview_load_balancing_types_round_robin>`
+ // for an explanation.
+ ROUND_ROBIN = 0;
+
+ // Refer to the :ref:`least request load balancing
+ // policy<arch_overview_load_balancing_types_least_request>`
+ // for an explanation.
+ LEAST_REQUEST = 1;
+
+ // Refer to the :ref:`ring hash load balancing
+ // policy<arch_overview_load_balancing_types_ring_hash>`
+ // for an explanation.
+ RING_HASH = 2;
+
+ // Refer to the :ref:`random load balancing
+ // policy<arch_overview_load_balancing_types_random>`
+ // for an explanation.
+ RANDOM = 3;
+
+ // Refer to the :ref:`Maglev load balancing policy<arch_overview_load_balancing_types_maglev>`
+ // for an explanation.
+ MAGLEV = 5;
+
+ // This load balancer type must be specified if the configured cluster provides a cluster
+ // specific load balancer. Consult the configured cluster's documentation for whether to set
+ // this option or not.
+ CLUSTER_PROVIDED = 6;
+
+ // [#not-implemented-hide:] Use the new :ref:`load_balancing_policy
+ // <envoy_api_field_config.cluster.v3.Cluster.load_balancing_policy>` field to determine the LB policy.
+ // [#next-major-version: In the v3 API, we should consider deprecating the lb_policy field
+ // and instead using the new load_balancing_policy field as the one and only mechanism for
+ // configuring this.]
+ LOAD_BALANCING_POLICY_CONFIG = 7;
+ }
+
+ // Only valid when discovery type is EDS.
+ message EdsClusterConfig {
+ // Configuration for the source of EDS updates for this Cluster.
+ core.v3.ConfigSource eds_config = 1;
+
+ // Optional alternative to cluster name to present to EDS. This does not
+ // have the same restrictions as cluster name, i.e. it may be arbitrary
+ // length.
+ string service_name = 2;
+ }
+
+ // Supplies the name of the cluster which must be unique across all clusters.
+ // The cluster name is used when emitting
+ // :ref:`statistics <config_cluster_manager_cluster_stats>` if :ref:`alt_stat_name
+ // <envoy_api_field_config.cluster.v3.Cluster.alt_stat_name>` is not provided.
+ // Any ``:`` in the cluster name will be converted to ``_`` when emitting statistics.
+ string name = 1;
+
+ oneof cluster_discovery_type {
+ // The :ref:`service discovery type <arch_overview_service_discovery_types>`
+ // to use for resolving the cluster.
+ DiscoveryType type = 2;
+ }
+
+ // Configuration to use for EDS updates for the Cluster.
+ EdsClusterConfig eds_cluster_config = 3;
+
+ // The :ref:`load balancer type <arch_overview_load_balancing_types>` to use
+ // when picking a host in the cluster.
+ LbPolicy lb_policy = 6;
+
+ CircuitBreakers circuit_breakers = 10;
+
+ // [#not-implemented-hide:]
+ // If present, tells the client where to send load reports via LRS. If not present, the
+ // client will fall back to a client-side default, which may be either (a) don't send any
+ // load reports or (b) send load reports for all clusters to a single default server
+ // (which may be configured in the bootstrap file).
+ //
+ // Note that if multiple clusters point to the same LRS server, the client may choose to
+ // create a separate stream for each cluster or it may choose to coalesce the data for
+ // multiple clusters onto a single stream. Either way, the client must make sure to send
+ // the data for any given cluster on no more than one stream.
+ //
+ // [#next-major-version: In the v3 API, we should consider restructuring this somehow,
+ // maybe by allowing LRS to go on the ADS stream, or maybe by moving some of the negotiation
+ // from the LRS stream here.]
+ core.v3.ConfigSource lrs_server = 42;
+}
diff --git a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/config_source.proto b/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/config_source.proto
index 95afc08359f..487b79c00a4 100644
--- a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/config_source.proto
+++ b/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/config_source.proto
@@ -1,77 +1,77 @@
-// Copyright 2020 The gRPC Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// Local copy of Envoy xDS proto file, used for testing only.
-
-syntax = "proto3";
-
-package envoy.config.core.v3;
-
-// [#protodoc-title: Configuration sources]
-
-// Aggregated Discovery Service (ADS) options. This is currently empty, but when
-// set in :ref:`ConfigSource <envoy_api_msg_config.core.v3.ConfigSource>` can be used to
-// specify that ADS is to be used.
-message AggregatedConfigSource {
-}
-
-// [#not-implemented-hide:]
-// Self-referencing config source options. This is currently empty, but when
-// set in :ref:`ConfigSource <envoy_api_msg_config.core.v3.ConfigSource>` can be used to
-// specify that other data can be obtained from the same server.
-message SelfConfigSource {
-}
-
-// Configuration for :ref:`listeners <config_listeners>`, :ref:`clusters
-// <config_cluster_manager>`, :ref:`routes
-// <envoy_api_msg_config.route.v3.RouteConfiguration>`, :ref:`endpoints
-// <arch_overview_service_discovery>` etc. may either be sourced from the
-// filesystem or from an xDS API source. Filesystem configs are watched with
-// inotify for updates.
-// [#next-free-field: 7]
-message ConfigSource {
- oneof config_source_specifier {
- // Path on the filesystem to source and watch for configuration updates.
- // When sourcing configuration for :ref:`secret <envoy_api_msg_extensions.transport_sockets.tls.v3.Secret>`,
- // the certificate and key files are also watched for updates.
- //
- // .. note::
- //
- // The path to the source must exist at config load time.
- //
- // .. note::
- //
- // Envoy will only watch the file path for *moves.* This is because in general only moves
- // are atomic. The same method of swapping files as is demonstrated in the
- // :ref:`runtime documentation <config_runtime_symbolic_link_swap>` can be used here also.
- string path = 1;
-
- // When set, ADS will be used to fetch resources. The ADS API configuration
- // source in the bootstrap configuration is used.
- AggregatedConfigSource ads = 3;
-
- // [#not-implemented-hide:]
- // When set, the client will access the resources from the same server it got the
- // ConfigSource from, although not necessarily from the same stream. This is similar to the
- // :ref:`ads<envoy_api_field.ConfigSource.ads>` field, except that the client may use a
- // different stream to the same server. As a result, this field can be used for things
- // like LRS that cannot be sent on an ADS stream. It can also be used to link from (e.g.)
- // LDS to RDS on the same server without requiring the management server to know its name
- // or required credentials.
- // [#next-major-version: In xDS v3, consider replacing the ads field with this one, since
- // this field can implicitly mean to use the same stream in the case where the ConfigSource
- // is provided via ADS and the specified data can also be obtained via ADS.]
- SelfConfigSource self = 5;
- }
-}
+// Copyright 2020 The gRPC Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Local copy of Envoy xDS proto file, used for testing only.
+
+syntax = "proto3";
+
+package envoy.config.core.v3;
+
+// [#protodoc-title: Configuration sources]
+
+// Aggregated Discovery Service (ADS) options. This is currently empty, but when
+// set in :ref:`ConfigSource <envoy_api_msg_config.core.v3.ConfigSource>` can be used to
+// specify that ADS is to be used.
+message AggregatedConfigSource {
+}
+
+// [#not-implemented-hide:]
+// Self-referencing config source options. This is currently empty, but when
+// set in :ref:`ConfigSource <envoy_api_msg_config.core.v3.ConfigSource>` can be used to
+// specify that other data can be obtained from the same server.
+message SelfConfigSource {
+}
+
+// Configuration for :ref:`listeners <config_listeners>`, :ref:`clusters
+// <config_cluster_manager>`, :ref:`routes
+// <envoy_api_msg_config.route.v3.RouteConfiguration>`, :ref:`endpoints
+// <arch_overview_service_discovery>` etc. may either be sourced from the
+// filesystem or from an xDS API source. Filesystem configs are watched with
+// inotify for updates.
+// [#next-free-field: 7]
+message ConfigSource {
+ oneof config_source_specifier {
+ // Path on the filesystem to source and watch for configuration updates.
+ // When sourcing configuration for :ref:`secret <envoy_api_msg_extensions.transport_sockets.tls.v3.Secret>`,
+ // the certificate and key files are also watched for updates.
+ //
+ // .. note::
+ //
+ // The path to the source must exist at config load time.
+ //
+ // .. note::
+ //
+ // Envoy will only watch the file path for *moves.* This is because in general only moves
+ // are atomic. The same method of swapping files as is demonstrated in the
+ // :ref:`runtime documentation <config_runtime_symbolic_link_swap>` can be used here also.
+ string path = 1;
+
+ // When set, ADS will be used to fetch resources. The ADS API configuration
+ // source in the bootstrap configuration is used.
+ AggregatedConfigSource ads = 3;
+
+ // [#not-implemented-hide:]
+ // When set, the client will access the resources from the same server it got the
+ // ConfigSource from, although not necessarily from the same stream. This is similar to the
+ // :ref:`ads<envoy_api_field.ConfigSource.ads>` field, except that the client may use a
+ // different stream to the same server. As a result, this field can be used for things
+ // like LRS that cannot be sent on an ADS stream. It can also be used to link from (e.g.)
+ // LDS to RDS on the same server without requiring the management server to know its name
+ // or required credentials.
+ // [#next-major-version: In xDS v3, consider replacing the ads field with this one, since
+ // this field can implicitly mean to use the same stream in the case where the ConfigSource
+ // is provided via ADS and the specified data can also be obtained via ADS.]
+ SelfConfigSource self = 5;
+ }
+}
diff --git a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/discovery.proto b/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/discovery.proto
index 4fa2d193051..2a697d9648f 100644
--- a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/discovery.proto
+++ b/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/discovery.proto
@@ -1,122 +1,122 @@
-// Copyright 2020 The gRPC Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// Local copy of Envoy xDS proto file, used for testing only.
-
-syntax = "proto3";
-
-package envoy.service.discovery.v3;
-
-import "src/proto/grpc/testing/xds/v3/base.proto";
-
-import "google/protobuf/any.proto";
-
-message Status {
- // The status code, which should be an enum value of [google.rpc.Code][].
- int32 code = 1;
-
- // A developer-facing error message, which should be in English. Any
- // user-facing error message should be localized and sent in the
- // [google.rpc.Status.details][] field, or localized by the client.
- string message = 2;
-
- // A list of messages that carry the error details. There is a common set of
- // message types for APIs to use.
- repeated google.protobuf.Any details = 3;
-}
-
-// [#protodoc-title: Common discovery API components]
-
-// A DiscoveryRequest requests a set of versioned resources of the same type for
-// a given Envoy node on some API.
-// [#next-free-field: 7]
-message DiscoveryRequest {
- // The version_info provided in the request messages will be the version_info
- // received with the most recent successfully processed response or empty on
- // the first request. It is expected that no new request is sent after a
- // response is received until the Envoy instance is ready to ACK/NACK the new
- // configuration. ACK/NACK takes place by returning the new API config version
- // as applied or the previous API config version respectively. Each type_url
- // (see below) has an independent version associated with it.
- string version_info = 1;
-
- // The node making the request.
- config.core.v3.Node node = 2;
-
- // List of resources to subscribe to, e.g. list of cluster names or a route
- // configuration name. If this is empty, all resources for the API are
- // returned. LDS/CDS may have empty resource_names, which will cause all
- // resources for the Envoy instance to be returned. The LDS and CDS responses
- // will then imply a number of resources that need to be fetched via EDS/RDS,
- // which will be explicitly enumerated in resource_names.
- repeated string resource_names = 3;
-
- // Type of the resource that is being requested, e.g.
- // "type.googleapis.com/envoy.api.v2.ClusterLoadAssignment". This is implicit
- // in requests made via singleton xDS APIs such as CDS, LDS, etc. but is
- // required for ADS.
- string type_url = 4;
-
- // nonce corresponding to DiscoveryResponse being ACK/NACKed. See above
- // discussion on version_info and the DiscoveryResponse nonce comment. This
- // may be empty only if 1) this is a non-persistent-stream xDS such as HTTP,
- // or 2) the client has not yet accepted an update in this xDS stream (unlike
- // delta, where it is populated only for new explicit ACKs).
- string response_nonce = 5;
-
- // This is populated when the previous :ref:`DiscoveryResponse <envoy_api_msg_service.discovery.v3.DiscoveryResponse>`
- // failed to update configuration. The *message* field in *error_details* provides the Envoy
- // internal exception related to the failure. It is only intended for consumption during manual
- // debugging, the string provided is not guaranteed to be stable across Envoy versions.
- Status error_detail = 6;
-}
-
-// [#next-free-field: 7]
-message DiscoveryResponse {
- // The version of the response data.
- string version_info = 1;
-
- // The response resources. These resources are typed and depend on the API being called.
- repeated google.protobuf.Any resources = 2;
-
- // [#not-implemented-hide:]
- // Canary is used to support two Envoy command line flags:
- //
- // * --terminate-on-canary-transition-failure. When set, Envoy is able to
- // terminate if it detects that configuration is stuck at canary. Consider
- // this example sequence of updates:
- // - Management server applies a canary config successfully.
- // - Management server rolls back to a production config.
- // - Envoy rejects the new production config.
- // Since there is no sensible way to continue receiving configuration
- // updates, Envoy will then terminate and apply production config from a
- // clean slate.
- // * --dry-run-canary. When set, a canary response will never be applied, only
- // validated via a dry run.
- bool canary = 3;
-
- // Type URL for resources. Identifies the xDS API when muxing over ADS.
- // Must be consistent with the type_url in the 'resources' repeated Any (if non-empty).
- string type_url = 4;
-
- // For gRPC based subscriptions, the nonce provides a way to explicitly ack a
- // specific DiscoveryResponse in a following DiscoveryRequest. Additional
- // messages may have been sent by Envoy to the management server for the
- // previous version on the stream prior to this DiscoveryResponse, that were
- // unprocessed at response send time. The nonce allows the management server
- // to ignore any further DiscoveryRequests for the previous version until a
- // DiscoveryRequest bearing the nonce. The nonce is optional and is not
- // required for non-stream based xDS implementations.
- string nonce = 5;
-}
+// Copyright 2020 The gRPC Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Local copy of Envoy xDS proto file, used for testing only.
+
+syntax = "proto3";
+
+package envoy.service.discovery.v3;
+
+import "src/proto/grpc/testing/xds/v3/base.proto";
+
+import "google/protobuf/any.proto";
+
+message Status {
+ // The status code, which should be an enum value of [google.rpc.Code][].
+ int32 code = 1;
+
+ // A developer-facing error message, which should be in English. Any
+ // user-facing error message should be localized and sent in the
+ // [google.rpc.Status.details][] field, or localized by the client.
+ string message = 2;
+
+ // A list of messages that carry the error details. There is a common set of
+ // message types for APIs to use.
+ repeated google.protobuf.Any details = 3;
+}
+
+// [#protodoc-title: Common discovery API components]
+
+// A DiscoveryRequest requests a set of versioned resources of the same type for
+// a given Envoy node on some API.
+// [#next-free-field: 7]
+message DiscoveryRequest {
+ // The version_info provided in the request messages will be the version_info
+ // received with the most recent successfully processed response or empty on
+ // the first request. It is expected that no new request is sent after a
+ // response is received until the Envoy instance is ready to ACK/NACK the new
+ // configuration. ACK/NACK takes place by returning the new API config version
+ // as applied or the previous API config version respectively. Each type_url
+ // (see below) has an independent version associated with it.
+ string version_info = 1;
+
+ // The node making the request.
+ config.core.v3.Node node = 2;
+
+ // List of resources to subscribe to, e.g. list of cluster names or a route
+ // configuration name. If this is empty, all resources for the API are
+ // returned. LDS/CDS may have empty resource_names, which will cause all
+ // resources for the Envoy instance to be returned. The LDS and CDS responses
+ // will then imply a number of resources that need to be fetched via EDS/RDS,
+ // which will be explicitly enumerated in resource_names.
+ repeated string resource_names = 3;
+
+ // Type of the resource that is being requested, e.g.
+ // "type.googleapis.com/envoy.api.v2.ClusterLoadAssignment". This is implicit
+ // in requests made via singleton xDS APIs such as CDS, LDS, etc. but is
+ // required for ADS.
+ string type_url = 4;
+
+ // nonce corresponding to DiscoveryResponse being ACK/NACKed. See above
+ // discussion on version_info and the DiscoveryResponse nonce comment. This
+ // may be empty only if 1) this is a non-persistent-stream xDS such as HTTP,
+ // or 2) the client has not yet accepted an update in this xDS stream (unlike
+ // delta, where it is populated only for new explicit ACKs).
+ string response_nonce = 5;
+
+ // This is populated when the previous :ref:`DiscoveryResponse <envoy_api_msg_service.discovery.v3.DiscoveryResponse>`
+ // failed to update configuration. The *message* field in *error_details* provides the Envoy
+ // internal exception related to the failure. It is only intended for consumption during manual
+ // debugging, the string provided is not guaranteed to be stable across Envoy versions.
+ Status error_detail = 6;
+}
+
+// [#next-free-field: 7]
+message DiscoveryResponse {
+ // The version of the response data.
+ string version_info = 1;
+
+ // The response resources. These resources are typed and depend on the API being called.
+ repeated google.protobuf.Any resources = 2;
+
+ // [#not-implemented-hide:]
+ // Canary is used to support two Envoy command line flags:
+ //
+ // * --terminate-on-canary-transition-failure. When set, Envoy is able to
+ // terminate if it detects that configuration is stuck at canary. Consider
+ // this example sequence of updates:
+ // - Management server applies a canary config successfully.
+ // - Management server rolls back to a production config.
+ // - Envoy rejects the new production config.
+ // Since there is no sensible way to continue receiving configuration
+ // updates, Envoy will then terminate and apply production config from a
+ // clean slate.
+ // * --dry-run-canary. When set, a canary response will never be applied, only
+ // validated via a dry run.
+ bool canary = 3;
+
+ // Type URL for resources. Identifies the xDS API when muxing over ADS.
+ // Must be consistent with the type_url in the 'resources' repeated Any (if non-empty).
+ string type_url = 4;
+
+ // For gRPC based subscriptions, the nonce provides a way to explicitly ack a
+ // specific DiscoveryResponse in a following DiscoveryRequest. Additional
+ // messages may have been sent by Envoy to the management server for the
+ // previous version on the stream prior to this DiscoveryResponse, that were
+ // unprocessed at response send time. The nonce allows the management server
+ // to ignore any further DiscoveryRequests for the previous version until a
+ // DiscoveryRequest bearing the nonce. The nonce is optional and is not
+ // required for non-stream based xDS implementations.
+ string nonce = 5;
+}
diff --git a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/endpoint.proto b/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/endpoint.proto
index d0511020a57..7cc1d40ca6e 100644
--- a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/endpoint.proto
+++ b/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/endpoint.proto
@@ -1,176 +1,176 @@
-// Copyright 2020 The gRPC Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// Local copy of Envoy xDS proto file, used for testing only.
-
-syntax = "proto3";
-
-package envoy.config.endpoint.v3;
-
-import "src/proto/grpc/testing/xds/v3/address.proto";
-import "src/proto/grpc/testing/xds/v3/base.proto";
-import "src/proto/grpc/testing/xds/v3/percent.proto";
-
-import "google/protobuf/wrappers.proto";
-
-// [#protodoc-title: Endpoints]
-
-// Endpoint health status.
-enum HealthStatus {
- // The health status is not known. This is interpreted by Envoy as *HEALTHY*.
- UNKNOWN = 0;
-
- // Healthy.
- HEALTHY = 1;
-
- // Unhealthy.
- UNHEALTHY = 2;
-
- // Connection draining in progress. E.g.,
- // `<https://aws.amazon.com/blogs/aws/elb-connection-draining-remove-instances-from-service-with-care/>`_
- // or
- // `<https://cloud.google.com/compute/docs/load-balancing/enabling-connection-draining>`_.
- // This is interpreted by Envoy as *UNHEALTHY*.
- DRAINING = 3;
-
- // Health check timed out. This is part of HDS and is interpreted by Envoy as
- // *UNHEALTHY*.
- TIMEOUT = 4;
-
- // Degraded.
- DEGRADED = 5;
-}
-
-// Upstream host identifier.
-message Endpoint {
- // The upstream host address.
- //
- // .. attention::
- //
- // The form of host address depends on the given cluster type. For STATIC or EDS,
- // it is expected to be a direct IP address (or something resolvable by the
- // specified :ref:`resolver <envoy_api_field_config.core.v3.SocketAddress.resolver_name>`
- // in the Address). For LOGICAL or STRICT DNS, it is expected to be hostname,
- // and will be resolved via DNS.
- core.v3.Address address = 1;
-}
-
-// An Endpoint that Envoy can route traffic to.
-// [#next-free-field: 6]
-message LbEndpoint {
- // Upstream host identifier or a named reference.
- oneof host_identifier {
- Endpoint endpoint = 1;
- }
-
- // Optional health status when known and supplied by EDS server.
- HealthStatus health_status = 2;
-}
-
-// A group of endpoints belonging to a Locality.
-// One can have multiple LocalityLbEndpoints for a locality, but this is
-// generally only done if the different groups need to have different load
-// balancing weights or different priorities.
-// [#next-free-field: 7]
-message LocalityLbEndpoints {
- // Identifies location of where the upstream hosts run.
- core.v3.Locality locality = 1;
-
- // The group of endpoints belonging to the locality specified.
- repeated LbEndpoint lb_endpoints = 2;
-
- // Optional: Per priority/region/zone/sub_zone weight; at least 1. The load
- // balancing weight for a locality is divided by the sum of the weights of all
- // localities at the same priority level to produce the effective percentage
- // of traffic for the locality. The sum of the weights of all localities at
- // the same priority level must not exceed uint32_t maximal value (4294967295).
- //
- // Locality weights are only considered when :ref:`locality weighted load
- // balancing <arch_overview_load_balancing_locality_weighted_lb>` is
- // configured. These weights are ignored otherwise. If no weights are
- // specified when locality weighted load balancing is enabled, the locality is
- // assigned no load.
- google.protobuf.UInt32Value load_balancing_weight = 3;
-
- // Optional: the priority for this LocalityLbEndpoints. If unspecified this will
- // default to the highest priority (0).
- //
- // Under usual circumstances, Envoy will only select endpoints for the highest
- // priority (0). In the event all endpoints for a particular priority are
- // unavailable/unhealthy, Envoy will fail over to selecting endpoints for the
- // next highest priority group.
- //
- // Priorities should range from 0 (highest) to N (lowest) without skipping.
- uint32 priority = 5;
-}
-
-// [#protodoc-title: Endpoint configuration]
-// Endpoint discovery :ref:`architecture overview <arch_overview_service_discovery_types_eds>`
-
-// Each route from RDS will map to a single cluster or traffic split across
-// clusters using weights expressed in the RDS WeightedCluster.
-//
-// With EDS, each cluster is treated independently from a LB perspective, with
-// LB taking place between the Localities within a cluster and at a finer
-// granularity between the hosts within a locality. The percentage of traffic
-// for each endpoint is determined by both its load_balancing_weight, and the
-// load_balancing_weight of its locality. First, a locality will be selected,
-// then an endpoint within that locality will be chose based on its weight.
-// [#next-free-field: 6]
-message ClusterLoadAssignment {
- // Load balancing policy settings.
- // [#next-free-field: 6]
- message Policy {
- message DropOverload {
- // Identifier for the policy specifying the drop.
- string category = 1;
-
- // Percentage of traffic that should be dropped for the category.
- type.v3.FractionalPercent drop_percentage = 2;
- }
-
- // Action to trim the overall incoming traffic to protect the upstream
- // hosts. This action allows protection in case the hosts are unable to
- // recover from an outage, or unable to autoscale or unable to handle
- // incoming traffic volume for any reason.
- //
- // At the client each category is applied one after the other to generate
- // the 'actual' drop percentage on all outgoing traffic. For example:
- //
- // .. code-block:: json
- //
- // { "drop_overloads": [
- // { "category": "throttle", "drop_percentage": 60 }
- // { "category": "lb", "drop_percentage": 50 }
- // ]}
- //
- // The actual drop percentages applied to the traffic at the clients will be
- // "throttle"_drop = 60%
- // "lb"_drop = 20% // 50% of the remaining 'actual' load, which is 40%.
- // actual_outgoing_load = 20% // remaining after applying all categories.
- repeated DropOverload drop_overloads = 2;
- }
-
- // Name of the cluster. This will be the :ref:`service_name
- // <envoy_api_field_config.cluster.v3.Cluster.EdsClusterConfig.service_name>` value if specified
- // in the cluster :ref:`EdsClusterConfig
- // <envoy_api_msg_config.cluster.v3.Cluster.EdsClusterConfig>`.
- string cluster_name = 1;
-
- // List of endpoints to load balance to.
- repeated LocalityLbEndpoints endpoints = 2;
-
- // Load balancing policy settings.
- Policy policy = 4;
-}
+// Copyright 2020 The gRPC Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Local copy of Envoy xDS proto file, used for testing only.
+
+syntax = "proto3";
+
+package envoy.config.endpoint.v3;
+
+import "src/proto/grpc/testing/xds/v3/address.proto";
+import "src/proto/grpc/testing/xds/v3/base.proto";
+import "src/proto/grpc/testing/xds/v3/percent.proto";
+
+import "google/protobuf/wrappers.proto";
+
+// [#protodoc-title: Endpoints]
+
+// Endpoint health status.
+enum HealthStatus {
+ // The health status is not known. This is interpreted by Envoy as *HEALTHY*.
+ UNKNOWN = 0;
+
+ // Healthy.
+ HEALTHY = 1;
+
+ // Unhealthy.
+ UNHEALTHY = 2;
+
+ // Connection draining in progress. E.g.,
+ // `<https://aws.amazon.com/blogs/aws/elb-connection-draining-remove-instances-from-service-with-care/>`_
+ // or
+ // `<https://cloud.google.com/compute/docs/load-balancing/enabling-connection-draining>`_.
+ // This is interpreted by Envoy as *UNHEALTHY*.
+ DRAINING = 3;
+
+ // Health check timed out. This is part of HDS and is interpreted by Envoy as
+ // *UNHEALTHY*.
+ TIMEOUT = 4;
+
+ // Degraded.
+ DEGRADED = 5;
+}
+
+// Upstream host identifier.
+message Endpoint {
+ // The upstream host address.
+ //
+ // .. attention::
+ //
+ // The form of host address depends on the given cluster type. For STATIC or EDS,
+ // it is expected to be a direct IP address (or something resolvable by the
+ // specified :ref:`resolver <envoy_api_field_config.core.v3.SocketAddress.resolver_name>`
+ // in the Address). For LOGICAL or STRICT DNS, it is expected to be hostname,
+ // and will be resolved via DNS.
+ core.v3.Address address = 1;
+}
+
+// An Endpoint that Envoy can route traffic to.
+// [#next-free-field: 6]
+message LbEndpoint {
+ // Upstream host identifier or a named reference.
+ oneof host_identifier {
+ Endpoint endpoint = 1;
+ }
+
+ // Optional health status when known and supplied by EDS server.
+ HealthStatus health_status = 2;
+}
+
+// A group of endpoints belonging to a Locality.
+// One can have multiple LocalityLbEndpoints for a locality, but this is
+// generally only done if the different groups need to have different load
+// balancing weights or different priorities.
+// [#next-free-field: 7]
+message LocalityLbEndpoints {
+ // Identifies location of where the upstream hosts run.
+ core.v3.Locality locality = 1;
+
+ // The group of endpoints belonging to the locality specified.
+ repeated LbEndpoint lb_endpoints = 2;
+
+ // Optional: Per priority/region/zone/sub_zone weight; at least 1. The load
+ // balancing weight for a locality is divided by the sum of the weights of all
+ // localities at the same priority level to produce the effective percentage
+ // of traffic for the locality. The sum of the weights of all localities at
+ // the same priority level must not exceed uint32_t maximal value (4294967295).
+ //
+ // Locality weights are only considered when :ref:`locality weighted load
+ // balancing <arch_overview_load_balancing_locality_weighted_lb>` is
+ // configured. These weights are ignored otherwise. If no weights are
+ // specified when locality weighted load balancing is enabled, the locality is
+ // assigned no load.
+ google.protobuf.UInt32Value load_balancing_weight = 3;
+
+ // Optional: the priority for this LocalityLbEndpoints. If unspecified this will
+ // default to the highest priority (0).
+ //
+ // Under usual circumstances, Envoy will only select endpoints for the highest
+ // priority (0). In the event all endpoints for a particular priority are
+ // unavailable/unhealthy, Envoy will fail over to selecting endpoints for the
+ // next highest priority group.
+ //
+ // Priorities should range from 0 (highest) to N (lowest) without skipping.
+ uint32 priority = 5;
+}
+
+// [#protodoc-title: Endpoint configuration]
+// Endpoint discovery :ref:`architecture overview <arch_overview_service_discovery_types_eds>`
+
+// Each route from RDS will map to a single cluster or traffic split across
+// clusters using weights expressed in the RDS WeightedCluster.
+//
+// With EDS, each cluster is treated independently from a LB perspective, with
+// LB taking place between the Localities within a cluster and at a finer
+// granularity between the hosts within a locality. The percentage of traffic
+// for each endpoint is determined by both its load_balancing_weight, and the
+// load_balancing_weight of its locality. First, a locality will be selected,
+// then an endpoint within that locality will be chose based on its weight.
+// [#next-free-field: 6]
+message ClusterLoadAssignment {
+ // Load balancing policy settings.
+ // [#next-free-field: 6]
+ message Policy {
+ message DropOverload {
+ // Identifier for the policy specifying the drop.
+ string category = 1;
+
+ // Percentage of traffic that should be dropped for the category.
+ type.v3.FractionalPercent drop_percentage = 2;
+ }
+
+ // Action to trim the overall incoming traffic to protect the upstream
+ // hosts. This action allows protection in case the hosts are unable to
+ // recover from an outage, or unable to autoscale or unable to handle
+ // incoming traffic volume for any reason.
+ //
+ // At the client each category is applied one after the other to generate
+ // the 'actual' drop percentage on all outgoing traffic. For example:
+ //
+ // .. code-block:: json
+ //
+ // { "drop_overloads": [
+ // { "category": "throttle", "drop_percentage": 60 }
+ // { "category": "lb", "drop_percentage": 50 }
+ // ]}
+ //
+ // The actual drop percentages applied to the traffic at the clients will be
+ // "throttle"_drop = 60%
+ // "lb"_drop = 20% // 50% of the remaining 'actual' load, which is 40%.
+ // actual_outgoing_load = 20% // remaining after applying all categories.
+ repeated DropOverload drop_overloads = 2;
+ }
+
+ // Name of the cluster. This will be the :ref:`service_name
+ // <envoy_api_field_config.cluster.v3.Cluster.EdsClusterConfig.service_name>` value if specified
+ // in the cluster :ref:`EdsClusterConfig
+ // <envoy_api_msg_config.cluster.v3.Cluster.EdsClusterConfig>`.
+ string cluster_name = 1;
+
+ // List of endpoints to load balance to.
+ repeated LocalityLbEndpoints endpoints = 2;
+
+ // Load balancing policy settings.
+ Policy policy = 4;
+}
diff --git a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/http_connection_manager.proto b/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/http_connection_manager.proto
index 102b1df3854..998ad561470 100644
--- a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/http_connection_manager.proto
+++ b/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/http_connection_manager.proto
@@ -1,56 +1,56 @@
-// Copyright 2020 The gRPC Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// Local copy of Envoy xDS proto file, used for testing only.
-
-syntax = "proto3";
-
-package envoy.extensions.filters.network.http_connection_manager.v3;
-
-import "src/proto/grpc/testing/xds/v3/config_source.proto";
-import "src/proto/grpc/testing/xds/v3/route.proto";
-
-// [#protodoc-title: HTTP connection manager]
-// HTTP connection manager :ref:`configuration overview <config_http_conn_man>`.
-// [#extension: envoy.filters.network.http_connection_manager]
-
-// [#next-free-field: 38]
-message HttpConnectionManager {
- oneof route_specifier {
- // The connection manager’s route table will be dynamically loaded via the RDS API.
- Rds rds = 3;
-
- // The route table for the connection manager is static and is specified in this property.
- config.route.v3.RouteConfiguration route_config = 4;
-
- // A route table will be dynamically assigned to each request based on request attributes
- // (e.g., the value of a header). The "routing scopes" (i.e., route tables) and "scope keys" are
- // specified in this message.
- ScopedRoutes scoped_routes = 31;
- }
-}
-
-message Rds {
- // Configuration source specifier for RDS.
- config.core.v3.ConfigSource config_source = 1;
-
- // The name of the route configuration. This name will be passed to the RDS
- // API. This allows an Envoy configuration with multiple HTTP listeners (and
- // associated HTTP connection manager filters) to use different route
- // configurations.
- string route_config_name = 2;
-}
-
-message ScopedRoutes {
-}
+// Copyright 2020 The gRPC Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Local copy of Envoy xDS proto file, used for testing only.
+
+syntax = "proto3";
+
+package envoy.extensions.filters.network.http_connection_manager.v3;
+
+import "src/proto/grpc/testing/xds/v3/config_source.proto";
+import "src/proto/grpc/testing/xds/v3/route.proto";
+
+// [#protodoc-title: HTTP connection manager]
+// HTTP connection manager :ref:`configuration overview <config_http_conn_man>`.
+// [#extension: envoy.filters.network.http_connection_manager]
+
+// [#next-free-field: 38]
+message HttpConnectionManager {
+ oneof route_specifier {
+ // The connection manager’s route table will be dynamically loaded via the RDS API.
+ Rds rds = 3;
+
+ // The route table for the connection manager is static and is specified in this property.
+ config.route.v3.RouteConfiguration route_config = 4;
+
+ // A route table will be dynamically assigned to each request based on request attributes
+ // (e.g., the value of a header). The "routing scopes" (i.e., route tables) and "scope keys" are
+ // specified in this message.
+ ScopedRoutes scoped_routes = 31;
+ }
+}
+
+message Rds {
+ // Configuration source specifier for RDS.
+ config.core.v3.ConfigSource config_source = 1;
+
+ // The name of the route configuration. This name will be passed to the RDS
+ // API. This allows an Envoy configuration with multiple HTTP listeners (and
+ // associated HTTP connection manager filters) to use different route
+ // configurations.
+ string route_config_name = 2;
+}
+
+message ScopedRoutes {
+}
diff --git a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/listener.proto b/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/listener.proto
index b462ce0cd7b..e9160e033e2 100644
--- a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/listener.proto
+++ b/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/listener.proto
@@ -1,64 +1,64 @@
-// Copyright 2020 The gRPC Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// Local copy of Envoy xDS proto file, used for testing only.
-
-syntax = "proto3";
-
-package envoy.config.listener.v3;
-
-import "google/protobuf/any.proto";
-
-// [#protodoc-title: Listener configuration]
-// Listener :ref:`configuration overview <config_listeners>`
-
-// Describes a type of API listener, which is used in non-proxy clients. The type of API
-// exposed to the non-proxy application depends on the type of API listener.
-message ApiListener {
- // The type in this field determines the type of API listener. At present, the following
- // types are supported:
- // envoy.config.filter.network.http_connection_manager.v2.HttpConnectionManager (HTTP)
- // [#next-major-version: In the v3 API, replace this Any field with a oneof containing the
- // specific config message for each type of API listener. We could not do this in v2 because
- // it would have caused circular dependencies for go protos: lds.proto depends on this file,
- // and http_connection_manager.proto depends on rds.proto, which is in the same directory as
- // lds.proto, so lds.proto cannot depend on this file.]
- google.protobuf.Any api_listener = 1;
-}
-
-// [#next-free-field: 23]
-message Listener {
- // The unique name by which this listener is known. If no name is provided,
- // Envoy will allocate an internal UUID for the listener. If the listener is to be dynamically
- // updated or removed via :ref:`LDS <config_listeners_lds>` a unique name must be provided.
- string name = 1;
-
- // Used to represent an API listener, which is used in non-proxy clients. The type of API
- // exposed to the non-proxy application depends on the type of API listener.
- // When this field is set, no other field except for :ref:`name<envoy_api_field_config.listener.v3.Listener.name>`
- // should be set.
- //
- // .. note::
- //
- // Currently only one ApiListener can be installed; and it can only be done via bootstrap config,
- // not LDS.
- //
- // [#next-major-version: In the v3 API, instead of this messy approach where the socket
- // listener fields are directly in the top-level Listener message and the API listener types
- // are in the ApiListener message, the socket listener messages should be in their own message,
- // and the top-level Listener should essentially be a oneof that selects between the
- // socket listener and the various types of API listener. That way, a given Listener message
- // can structurally only contain the fields of the relevant type.]
- ApiListener api_listener = 19;
-}
+// Copyright 2020 The gRPC Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Local copy of Envoy xDS proto file, used for testing only.
+
+syntax = "proto3";
+
+package envoy.config.listener.v3;
+
+import "google/protobuf/any.proto";
+
+// [#protodoc-title: Listener configuration]
+// Listener :ref:`configuration overview <config_listeners>`
+
+// Describes a type of API listener, which is used in non-proxy clients. The type of API
+// exposed to the non-proxy application depends on the type of API listener.
+message ApiListener {
+ // The type in this field determines the type of API listener. At present, the following
+ // types are supported:
+ // envoy.config.filter.network.http_connection_manager.v2.HttpConnectionManager (HTTP)
+ // [#next-major-version: In the v3 API, replace this Any field with a oneof containing the
+ // specific config message for each type of API listener. We could not do this in v2 because
+ // it would have caused circular dependencies for go protos: lds.proto depends on this file,
+ // and http_connection_manager.proto depends on rds.proto, which is in the same directory as
+ // lds.proto, so lds.proto cannot depend on this file.]
+ google.protobuf.Any api_listener = 1;
+}
+
+// [#next-free-field: 23]
+message Listener {
+ // The unique name by which this listener is known. If no name is provided,
+ // Envoy will allocate an internal UUID for the listener. If the listener is to be dynamically
+ // updated or removed via :ref:`LDS <config_listeners_lds>` a unique name must be provided.
+ string name = 1;
+
+ // Used to represent an API listener, which is used in non-proxy clients. The type of API
+ // exposed to the non-proxy application depends on the type of API listener.
+ // When this field is set, no other field except for :ref:`name<envoy_api_field_config.listener.v3.Listener.name>`
+ // should be set.
+ //
+ // .. note::
+ //
+ // Currently only one ApiListener can be installed; and it can only be done via bootstrap config,
+ // not LDS.
+ //
+ // [#next-major-version: In the v3 API, instead of this messy approach where the socket
+ // listener fields are directly in the top-level Listener message and the API listener types
+ // are in the ApiListener message, the socket listener messages should be in their own message,
+ // and the top-level Listener should essentially be a oneof that selects between the
+ // socket listener and the various types of API listener. That way, a given Listener message
+ // can structurally only contain the fields of the relevant type.]
+ ApiListener api_listener = 19;
+}
diff --git a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/load_report.proto b/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/load_report.proto
index 8ff79b6c91b..b8ee86fb485 100644
--- a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/load_report.proto
+++ b/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/load_report.proto
@@ -1,162 +1,162 @@
-// Copyright 2020 The gRPC Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// Local copy of Envoy xDS proto file, used for testing only.
-
-syntax = "proto3";
-
-package envoy.config.endpoint.v3;
-
-import "src/proto/grpc/testing/xds/v3/address.proto";
-import "src/proto/grpc/testing/xds/v3/base.proto";
-
-import "google/protobuf/duration.proto";
-import "google/protobuf/struct.proto";
-
-// These are stats Envoy reports to GLB every so often. Report frequency is
-// defined by
-// :ref:`LoadStatsResponse.load_reporting_interval<envoy_api_field_service.load_stats.v3.LoadStatsResponse.load_reporting_interval>`.
-// Stats per upstream region/zone and optionally per subzone.
-// [#not-implemented-hide:] Not configuration. TBD how to doc proto APIs.
-// [#next-free-field: 9]
-message UpstreamLocalityStats {
- // Name of zone, region and optionally endpoint group these metrics were
- // collected from. Zone and region names could be empty if unknown.
- core.v3.Locality locality = 1;
-
- // The total number of requests successfully completed by the endpoints in the
- // locality.
- uint64 total_successful_requests = 2;
-
- // The total number of unfinished requests
- uint64 total_requests_in_progress = 3;
-
- // The total number of requests that failed due to errors at the endpoint,
- // aggregated over all endpoints in the locality.
- uint64 total_error_requests = 4;
-
- // The total number of requests that were issued by this Envoy since
- // the last report. This information is aggregated over all the
- // upstream endpoints in the locality.
- uint64 total_issued_requests = 8;
-
- // Stats for multi-dimensional load balancing.
- repeated EndpointLoadMetricStats load_metric_stats = 5;
-
- // Endpoint granularity stats information for this locality. This information
- // is populated if the Server requests it by setting
- // :ref:`LoadStatsResponse.report_endpoint_granularity<envoy_api_field_service.load_stats.v3.LoadStatsResponse.report_endpoint_granularity>`.
- repeated UpstreamEndpointStats upstream_endpoint_stats = 7;
-
- // [#not-implemented-hide:] The priority of the endpoint group these metrics
- // were collected from.
- uint32 priority = 6;
-}
-
-// [#not-implemented-hide:] Not configuration. TBD how to doc proto APIs.
-// [#next-free-field: 8]
-message UpstreamEndpointStats {
- // Upstream host address.
- core.v3.Address address = 1;
-
- // Opaque and implementation dependent metadata of the
- // endpoint. Envoy will pass this directly to the management server.
- google.protobuf.Struct metadata = 6;
-
- // The total number of requests successfully completed by the endpoints in the
- // locality. These include non-5xx responses for HTTP, where errors
- // originate at the client and the endpoint responded successfully. For gRPC,
- // the grpc-status values are those not covered by total_error_requests below.
- uint64 total_successful_requests = 2;
-
- // The total number of unfinished requests for this endpoint.
- uint64 total_requests_in_progress = 3;
-
- // The total number of requests that failed due to errors at the endpoint.
- // For HTTP these are responses with 5xx status codes and for gRPC the
- // grpc-status values:
- //
- // - DeadlineExceeded
- // - Unimplemented
- // - Internal
- // - Unavailable
- // - Unknown
- // - DataLoss
- uint64 total_error_requests = 4;
-
- // The total number of requests that were issued to this endpoint
- // since the last report. A single TCP connection, HTTP or gRPC
- // request or stream is counted as one request.
- uint64 total_issued_requests = 7;
-
- // Stats for multi-dimensional load balancing.
- repeated EndpointLoadMetricStats load_metric_stats = 5;
-}
-
-// [#not-implemented-hide:] Not configuration. TBD how to doc proto APIs.
-message EndpointLoadMetricStats {
- // Name of the metric; may be empty.
- string metric_name = 1;
-
- // Number of calls that finished and included this metric.
- uint64 num_requests_finished_with_metric = 2;
-
- // Sum of metric values across all calls that finished with this metric for
- // load_reporting_interval.
- double total_metric_value = 3;
-}
-
-// Per cluster load stats. Envoy reports these stats a management server in a
-// :ref:`LoadStatsRequest<envoy_api_msg_service.load_stats.v3.LoadStatsRequest>`
-// [#not-implemented-hide:] Not configuration. TBD how to doc proto APIs.
-// Next ID: 7
-// [#next-free-field: 7]
-message ClusterStats {
- message DroppedRequests {
- // Identifier for the policy specifying the drop.
- string category = 1;
-
- // Total number of deliberately dropped requests for the category.
- uint64 dropped_count = 2;
- }
-
- // The name of the cluster.
- string cluster_name = 1;
-
- // The eds_cluster_config service_name of the cluster.
- // It's possible that two clusters send the same service_name to EDS,
- // in that case, the management server is supposed to do aggregation on the load reports.
- string cluster_service_name = 6;
-
- // Need at least one.
- repeated UpstreamLocalityStats upstream_locality_stats = 2;
-
- // Cluster-level stats such as total_successful_requests may be computed by
- // summing upstream_locality_stats. In addition, below there are additional
- // cluster-wide stats.
- //
- // The total number of dropped requests. This covers requests
- // deliberately dropped by the drop_overload policy and circuit breaking.
- uint64 total_dropped_requests = 3;
-
- // Information about deliberately dropped requests for each category specified
- // in the DropOverload policy.
- repeated DroppedRequests dropped_requests = 5;
-
- // Period over which the actual load report occurred. This will be guaranteed to include every
- // request reported. Due to system load and delays between the *LoadStatsRequest* sent from Envoy
- // and the *LoadStatsResponse* message sent from the management server, this may be longer than
- // the requested load reporting interval in the *LoadStatsResponse*.
- google.protobuf.Duration load_report_interval = 4;
-}
+// Copyright 2020 The gRPC Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Local copy of Envoy xDS proto file, used for testing only.
+
+syntax = "proto3";
+
+package envoy.config.endpoint.v3;
+
+import "src/proto/grpc/testing/xds/v3/address.proto";
+import "src/proto/grpc/testing/xds/v3/base.proto";
+
+import "google/protobuf/duration.proto";
+import "google/protobuf/struct.proto";
+
+// These are stats Envoy reports to GLB every so often. Report frequency is
+// defined by
+// :ref:`LoadStatsResponse.load_reporting_interval<envoy_api_field_service.load_stats.v3.LoadStatsResponse.load_reporting_interval>`.
+// Stats per upstream region/zone and optionally per subzone.
+// [#not-implemented-hide:] Not configuration. TBD how to doc proto APIs.
+// [#next-free-field: 9]
+message UpstreamLocalityStats {
+ // Name of zone, region and optionally endpoint group these metrics were
+ // collected from. Zone and region names could be empty if unknown.
+ core.v3.Locality locality = 1;
+
+ // The total number of requests successfully completed by the endpoints in the
+ // locality.
+ uint64 total_successful_requests = 2;
+
+ // The total number of unfinished requests
+ uint64 total_requests_in_progress = 3;
+
+ // The total number of requests that failed due to errors at the endpoint,
+ // aggregated over all endpoints in the locality.
+ uint64 total_error_requests = 4;
+
+ // The total number of requests that were issued by this Envoy since
+ // the last report. This information is aggregated over all the
+ // upstream endpoints in the locality.
+ uint64 total_issued_requests = 8;
+
+ // Stats for multi-dimensional load balancing.
+ repeated EndpointLoadMetricStats load_metric_stats = 5;
+
+ // Endpoint granularity stats information for this locality. This information
+ // is populated if the Server requests it by setting
+ // :ref:`LoadStatsResponse.report_endpoint_granularity<envoy_api_field_service.load_stats.v3.LoadStatsResponse.report_endpoint_granularity>`.
+ repeated UpstreamEndpointStats upstream_endpoint_stats = 7;
+
+ // [#not-implemented-hide:] The priority of the endpoint group these metrics
+ // were collected from.
+ uint32 priority = 6;
+}
+
+// [#not-implemented-hide:] Not configuration. TBD how to doc proto APIs.
+// [#next-free-field: 8]
+message UpstreamEndpointStats {
+ // Upstream host address.
+ core.v3.Address address = 1;
+
+ // Opaque and implementation dependent metadata of the
+ // endpoint. Envoy will pass this directly to the management server.
+ google.protobuf.Struct metadata = 6;
+
+ // The total number of requests successfully completed by the endpoints in the
+ // locality. These include non-5xx responses for HTTP, where errors
+ // originate at the client and the endpoint responded successfully. For gRPC,
+ // the grpc-status values are those not covered by total_error_requests below.
+ uint64 total_successful_requests = 2;
+
+ // The total number of unfinished requests for this endpoint.
+ uint64 total_requests_in_progress = 3;
+
+ // The total number of requests that failed due to errors at the endpoint.
+ // For HTTP these are responses with 5xx status codes and for gRPC the
+ // grpc-status values:
+ //
+ // - DeadlineExceeded
+ // - Unimplemented
+ // - Internal
+ // - Unavailable
+ // - Unknown
+ // - DataLoss
+ uint64 total_error_requests = 4;
+
+ // The total number of requests that were issued to this endpoint
+ // since the last report. A single TCP connection, HTTP or gRPC
+ // request or stream is counted as one request.
+ uint64 total_issued_requests = 7;
+
+ // Stats for multi-dimensional load balancing.
+ repeated EndpointLoadMetricStats load_metric_stats = 5;
+}
+
+// [#not-implemented-hide:] Not configuration. TBD how to doc proto APIs.
+message EndpointLoadMetricStats {
+ // Name of the metric; may be empty.
+ string metric_name = 1;
+
+ // Number of calls that finished and included this metric.
+ uint64 num_requests_finished_with_metric = 2;
+
+ // Sum of metric values across all calls that finished with this metric for
+ // load_reporting_interval.
+ double total_metric_value = 3;
+}
+
+// Per cluster load stats. Envoy reports these stats a management server in a
+// :ref:`LoadStatsRequest<envoy_api_msg_service.load_stats.v3.LoadStatsRequest>`
+// [#not-implemented-hide:] Not configuration. TBD how to doc proto APIs.
+// Next ID: 7
+// [#next-free-field: 7]
+message ClusterStats {
+ message DroppedRequests {
+ // Identifier for the policy specifying the drop.
+ string category = 1;
+
+ // Total number of deliberately dropped requests for the category.
+ uint64 dropped_count = 2;
+ }
+
+ // The name of the cluster.
+ string cluster_name = 1;
+
+ // The eds_cluster_config service_name of the cluster.
+ // It's possible that two clusters send the same service_name to EDS,
+ // in that case, the management server is supposed to do aggregation on the load reports.
+ string cluster_service_name = 6;
+
+ // Need at least one.
+ repeated UpstreamLocalityStats upstream_locality_stats = 2;
+
+ // Cluster-level stats such as total_successful_requests may be computed by
+ // summing upstream_locality_stats. In addition, below there are additional
+ // cluster-wide stats.
+ //
+ // The total number of dropped requests. This covers requests
+ // deliberately dropped by the drop_overload policy and circuit breaking.
+ uint64 total_dropped_requests = 3;
+
+ // Information about deliberately dropped requests for each category specified
+ // in the DropOverload policy.
+ repeated DroppedRequests dropped_requests = 5;
+
+ // Period over which the actual load report occurred. This will be guaranteed to include every
+ // request reported. Due to system load and delays between the *LoadStatsRequest* sent from Envoy
+ // and the *LoadStatsResponse* message sent from the management server, this may be longer than
+ // the requested load reporting interval in the *LoadStatsResponse*.
+ google.protobuf.Duration load_report_interval = 4;
+}
diff --git a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/lrs.proto b/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/lrs.proto
index 2f4c268858a..e118b7f9576 100644
--- a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/lrs.proto
+++ b/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/lrs.proto
@@ -1,96 +1,96 @@
-// Copyright 2020 The gRPC Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// Local copy of Envoy xDS proto file, used for testing only.
-
-syntax = "proto3";
-
-package envoy.service.load_stats.v3;
-
-import "src/proto/grpc/testing/xds/v3/base.proto";
-import "src/proto/grpc/testing/xds/v3/load_report.proto";
-
-import "google/protobuf/duration.proto";
-
-// [#protodoc-title: Load reporting service]
-
-service LoadReportingService {
- // Advanced API to allow for multi-dimensional load balancing by remote
- // server. For receiving LB assignments, the steps are:
- // 1, The management server is configured with per cluster/zone/load metric
- // capacity configuration. The capacity configuration definition is
- // outside of the scope of this document.
- // 2. Envoy issues a standard {Stream,Fetch}Endpoints request for the clusters
- // to balance.
- //
- // Independently, Envoy will initiate a StreamLoadStats bidi stream with a
- // management server:
- // 1. Once a connection establishes, the management server publishes a
- // LoadStatsResponse for all clusters it is interested in learning load
- // stats about.
- // 2. For each cluster, Envoy load balances incoming traffic to upstream hosts
- // based on per-zone weights and/or per-instance weights (if specified)
- // based on intra-zone LbPolicy. This information comes from the above
- // {Stream,Fetch}Endpoints.
- // 3. When upstream hosts reply, they optionally add header <define header
- // name> with ASCII representation of EndpointLoadMetricStats.
- // 4. Envoy aggregates load reports over the period of time given to it in
- // LoadStatsResponse.load_reporting_interval. This includes aggregation
- // stats Envoy maintains by itself (total_requests, rpc_errors etc.) as
- // well as load metrics from upstream hosts.
- // 5. When the timer of load_reporting_interval expires, Envoy sends new
- // LoadStatsRequest filled with load reports for each cluster.
- // 6. The management server uses the load reports from all reported Envoys
- // from around the world, computes global assignment and prepares traffic
- // assignment destined for each zone Envoys are located in. Goto 2.
- rpc StreamLoadStats(stream LoadStatsRequest) returns (stream LoadStatsResponse) {
- }
-}
-
-// A load report Envoy sends to the management server.
-// [#not-implemented-hide:] Not configuration. TBD how to doc proto APIs.
-message LoadStatsRequest {
- // Node identifier for Envoy instance.
- config.core.v3.Node node = 1;
-
- // A list of load stats to report.
- repeated config.endpoint.v3.ClusterStats cluster_stats = 2;
-}
-
-// The management server sends envoy a LoadStatsResponse with all clusters it
-// is interested in learning load stats about.
-// [#not-implemented-hide:] Not configuration. TBD how to doc proto APIs.
-message LoadStatsResponse {
- // Clusters to report stats for.
- // Not populated if *send_all_clusters* is true.
- repeated string clusters = 1;
-
- // If true, the client should send all clusters it knows about.
- // Only clients that advertise the "envoy.lrs.supports_send_all_clusters" capability in their
- // :ref:`client_features<envoy_api_field_config.core.v3.Node.client_features>` field will honor this field.
- bool send_all_clusters = 4;
-
- // The minimum interval of time to collect stats over. This is only a minimum for two reasons:
- // 1. There may be some delay from when the timer fires until stats sampling occurs.
- // 2. For clusters that were already feature in the previous *LoadStatsResponse*, any traffic
- // that is observed in between the corresponding previous *LoadStatsRequest* and this
- // *LoadStatsResponse* will also be accumulated and billed to the cluster. This avoids a period
- // of inobservability that might otherwise exists between the messages. New clusters are not
- // subject to this consideration.
- google.protobuf.Duration load_reporting_interval = 2;
-
- // Set to *true* if the management server supports endpoint granularity
- // report.
- bool report_endpoint_granularity = 3;
-}
+// Copyright 2020 The gRPC Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Local copy of Envoy xDS proto file, used for testing only.
+
+syntax = "proto3";
+
+package envoy.service.load_stats.v3;
+
+import "src/proto/grpc/testing/xds/v3/base.proto";
+import "src/proto/grpc/testing/xds/v3/load_report.proto";
+
+import "google/protobuf/duration.proto";
+
+// [#protodoc-title: Load reporting service]
+
+service LoadReportingService {
+ // Advanced API to allow for multi-dimensional load balancing by remote
+ // server. For receiving LB assignments, the steps are:
+ // 1, The management server is configured with per cluster/zone/load metric
+ // capacity configuration. The capacity configuration definition is
+ // outside of the scope of this document.
+ // 2. Envoy issues a standard {Stream,Fetch}Endpoints request for the clusters
+ // to balance.
+ //
+ // Independently, Envoy will initiate a StreamLoadStats bidi stream with a
+ // management server:
+ // 1. Once a connection establishes, the management server publishes a
+ // LoadStatsResponse for all clusters it is interested in learning load
+ // stats about.
+ // 2. For each cluster, Envoy load balances incoming traffic to upstream hosts
+ // based on per-zone weights and/or per-instance weights (if specified)
+ // based on intra-zone LbPolicy. This information comes from the above
+ // {Stream,Fetch}Endpoints.
+ // 3. When upstream hosts reply, they optionally add header <define header
+ // name> with ASCII representation of EndpointLoadMetricStats.
+ // 4. Envoy aggregates load reports over the period of time given to it in
+ // LoadStatsResponse.load_reporting_interval. This includes aggregation
+ // stats Envoy maintains by itself (total_requests, rpc_errors etc.) as
+ // well as load metrics from upstream hosts.
+ // 5. When the timer of load_reporting_interval expires, Envoy sends new
+ // LoadStatsRequest filled with load reports for each cluster.
+ // 6. The management server uses the load reports from all reported Envoys
+ // from around the world, computes global assignment and prepares traffic
+ // assignment destined for each zone Envoys are located in. Goto 2.
+ rpc StreamLoadStats(stream LoadStatsRequest) returns (stream LoadStatsResponse) {
+ }
+}
+
+// A load report Envoy sends to the management server.
+// [#not-implemented-hide:] Not configuration. TBD how to doc proto APIs.
+message LoadStatsRequest {
+ // Node identifier for Envoy instance.
+ config.core.v3.Node node = 1;
+
+ // A list of load stats to report.
+ repeated config.endpoint.v3.ClusterStats cluster_stats = 2;
+}
+
+// The management server sends envoy a LoadStatsResponse with all clusters it
+// is interested in learning load stats about.
+// [#not-implemented-hide:] Not configuration. TBD how to doc proto APIs.
+message LoadStatsResponse {
+ // Clusters to report stats for.
+ // Not populated if *send_all_clusters* is true.
+ repeated string clusters = 1;
+
+ // If true, the client should send all clusters it knows about.
+ // Only clients that advertise the "envoy.lrs.supports_send_all_clusters" capability in their
+ // :ref:`client_features<envoy_api_field_config.core.v3.Node.client_features>` field will honor this field.
+ bool send_all_clusters = 4;
+
+ // The minimum interval of time to collect stats over. This is only a minimum for two reasons:
+ // 1. There may be some delay from when the timer fires until stats sampling occurs.
+ // 2. For clusters that were already feature in the previous *LoadStatsResponse*, any traffic
+ // that is observed in between the corresponding previous *LoadStatsRequest* and this
+ // *LoadStatsResponse* will also be accumulated and billed to the cluster. This avoids a period
+ // of inobservability that might otherwise exists between the messages. New clusters are not
+ // subject to this consideration.
+ google.protobuf.Duration load_reporting_interval = 2;
+
+ // Set to *true* if the management server supports endpoint granularity
+ // report.
+ bool report_endpoint_granularity = 3;
+}
diff --git a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/orca_load_report.proto b/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/orca_load_report.proto
index a83b280b927..0d6a1699a21 100644
--- a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/orca_load_report.proto
+++ b/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/orca_load_report.proto
@@ -1,44 +1,44 @@
-// Copyright 2020 The gRPC Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// Local copy of Envoy xDS proto file, used for testing only.
-
-syntax = "proto3";
-
-package udpa.data.orca.v1;
-
-// See section `ORCA load report format` of the design document in
-// :ref:`https://github.com/envoyproxy/envoy/issues/6614`.
-
-message OrcaLoadReport {
- // CPU utilization expressed as a fraction of available CPU resources. This
- // should be derived from the latest sample or measurement.
- double cpu_utilization = 1;
-
- // Memory utilization expressed as a fraction of available memory
- // resources. This should be derived from the latest sample or measurement.
- double mem_utilization = 2;
-
- // Total RPS being served by an endpoint. This should cover all services that an endpoint is
- // responsible for.
- uint64 rps = 3;
-
- // Application specific requests costs. Each value is an absolute cost (e.g. 3487 bytes of
- // storage) associated with the request.
- map<string, double> request_cost = 4;
-
- // Resource utilization values. Each value is expressed as a fraction of total resources
- // available, derived from the latest sample or measurement.
- map<string, double> utilization = 5;
-}
+// Copyright 2020 The gRPC Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Local copy of Envoy xDS proto file, used for testing only.
+
+syntax = "proto3";
+
+package udpa.data.orca.v1;
+
+// See section `ORCA load report format` of the design document in
+// :ref:`https://github.com/envoyproxy/envoy/issues/6614`.
+
+message OrcaLoadReport {
+ // CPU utilization expressed as a fraction of available CPU resources. This
+ // should be derived from the latest sample or measurement.
+ double cpu_utilization = 1;
+
+ // Memory utilization expressed as a fraction of available memory
+ // resources. This should be derived from the latest sample or measurement.
+ double mem_utilization = 2;
+
+ // Total RPS being served by an endpoint. This should cover all services that an endpoint is
+ // responsible for.
+ uint64 rps = 3;
+
+ // Application specific requests costs. Each value is an absolute cost (e.g. 3487 bytes of
+ // storage) associated with the request.
+ map<string, double> request_cost = 4;
+
+ // Resource utilization values. Each value is expressed as a fraction of total resources
+ // available, derived from the latest sample or measurement.
+ map<string, double> utilization = 5;
+}
diff --git a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/percent.proto b/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/percent.proto
index 56e088a3326..dacc97496ee 100644
--- a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/percent.proto
+++ b/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/percent.proto
@@ -1,52 +1,52 @@
-// Copyright 2020 The gRPC Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// Local copy of Envoy xDS proto file, used for testing only.
-
-syntax = "proto3";
-
-package envoy.type.v3;
-
-// A fractional percentage is used in cases in which for performance reasons performing floating
-// point to integer conversions during randomness calculations is undesirable. The message includes
-// both a numerator and denominator that together determine the final fractional value.
-//
-// * **Example**: 1/100 = 1%.
-// * **Example**: 3/10000 = 0.03%.
-message FractionalPercent {
- // Fraction percentages support several fixed denominator values.
- enum DenominatorType {
- // 100.
- //
- // **Example**: 1/100 = 1%.
- HUNDRED = 0;
-
- // 10,000.
- //
- // **Example**: 1/10000 = 0.01%.
- TEN_THOUSAND = 1;
-
- // 1,000,000.
- //
- // **Example**: 1/1000000 = 0.0001%.
- MILLION = 2;
- }
-
- // Specifies the numerator. Defaults to 0.
- uint32 numerator = 1;
-
- // Specifies the denominator. If the denominator specified is less than the numerator, the final
- // fractional percentage is capped at 1 (100%).
- DenominatorType denominator = 2;
-}
+// Copyright 2020 The gRPC Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Local copy of Envoy xDS proto file, used for testing only.
+
+syntax = "proto3";
+
+package envoy.type.v3;
+
+// A fractional percentage is used in cases in which for performance reasons performing floating
+// point to integer conversions during randomness calculations is undesirable. The message includes
+// both a numerator and denominator that together determine the final fractional value.
+//
+// * **Example**: 1/100 = 1%.
+// * **Example**: 3/10000 = 0.03%.
+message FractionalPercent {
+ // Fraction percentages support several fixed denominator values.
+ enum DenominatorType {
+ // 100.
+ //
+ // **Example**: 1/100 = 1%.
+ HUNDRED = 0;
+
+ // 10,000.
+ //
+ // **Example**: 1/10000 = 0.01%.
+ TEN_THOUSAND = 1;
+
+ // 1,000,000.
+ //
+ // **Example**: 1/1000000 = 0.0001%.
+ MILLION = 2;
+ }
+
+ // Specifies the numerator. Defaults to 0.
+ uint32 numerator = 1;
+
+ // Specifies the denominator. If the denominator specified is less than the numerator, the final
+ // fractional percentage is capped at 1 (100%).
+ DenominatorType denominator = 2;
+}
diff --git a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/range.proto b/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/range.proto
index a9c4c6fa96a..5fe5530ee6e 100644
--- a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/range.proto
+++ b/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/range.proto
@@ -1,31 +1,31 @@
-// Copyright 2020 The gRPC Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// Local copy of Envoy xDS proto file, used for testing only.
-
-syntax = "proto3";
-
-package envoy.type.v3;
-
-// [#protodoc-title: Range]
-
-// Specifies the int64 start and end of the range using half-open interval semantics [start,
-// end).
-message Int64Range {
- // start of the range (inclusive)
- int64 start = 1;
-
- // end of the range (exclusive)
- int64 end = 2;
-}
+// Copyright 2020 The gRPC Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Local copy of Envoy xDS proto file, used for testing only.
+
+syntax = "proto3";
+
+package envoy.type.v3;
+
+// [#protodoc-title: Range]
+
+// Specifies the int64 start and end of the range using half-open interval semantics [start,
+// end).
+message Int64Range {
+ // start of the range (inclusive)
+ int64 start = 1;
+
+ // end of the range (exclusive)
+ int64 end = 2;
+}
diff --git a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/regex.proto b/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/regex.proto
index abc61059f4d..af9045774f8 100644
--- a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/regex.proto
+++ b/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/regex.proto
@@ -1,38 +1,38 @@
-// Copyright 2020 The gRPC Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// Local copy of Envoy xDS proto file, used for testing only.
-
-syntax = "proto3";
-
-package envoy.type.matcher.v3;
-
-// [#protodoc-title: Regex matcher]
-
-// A regex matcher designed for safety when used with untrusted input.
-message RegexMatcher {
- // Google's `RE2 <https://github.com/google/re2>`_ regex engine. The regex string must adhere to
- // the documented `syntax <https://github.com/google/re2/wiki/Syntax>`_. The engine is designed
- // to complete execution in linear time as well as limit the amount of memory used.
- message GoogleRE2 {
- }
-
- oneof engine_type {
- // Google's RE2 regex engine.
- GoogleRE2 google_re2 = 1;
- }
-
- // The regex match string. The string must be supported by the configured engine.
- string regex = 2;
-}
+// Copyright 2020 The gRPC Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Local copy of Envoy xDS proto file, used for testing only.
+
+syntax = "proto3";
+
+package envoy.type.matcher.v3;
+
+// [#protodoc-title: Regex matcher]
+
+// A regex matcher designed for safety when used with untrusted input.
+message RegexMatcher {
+ // Google's `RE2 <https://github.com/google/re2>`_ regex engine. The regex string must adhere to
+ // the documented `syntax <https://github.com/google/re2/wiki/Syntax>`_. The engine is designed
+ // to complete execution in linear time as well as limit the amount of memory used.
+ message GoogleRE2 {
+ }
+
+ oneof engine_type {
+ // Google's RE2 regex engine.
+ GoogleRE2 google_re2 = 1;
+ }
+
+ // The regex match string. The string must be supported by the configured engine.
+ string regex = 2;
+}
diff --git a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/route.proto b/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/route.proto
index 414a6a11302..309f80a019d 100644
--- a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/route.proto
+++ b/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/route.proto
@@ -1,315 +1,315 @@
-// Copyright 2020 The gRPC Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// Local copy of Envoy xDS proto file, used for testing only.
-
-syntax = "proto3";
-
-package envoy.config.route.v3;
-
-import "src/proto/grpc/testing/xds/v3/base.proto";
-import "src/proto/grpc/testing/xds/v3/regex.proto";
-import "src/proto/grpc/testing/xds/v3/percent.proto";
-import "src/proto/grpc/testing/xds/v3/range.proto";
-
-import "google/protobuf/wrappers.proto";
-
-// [#protodoc-title: HTTP route components]
-// * Routing :ref:`architecture overview <arch_overview_http_routing>`
-// * HTTP :ref:`router filter <config_http_filters_router>`
-
-// The top level element in the routing configuration is a virtual host. Each virtual host has
-// a logical name as well as a set of domains that get routed to it based on the incoming request's
-// host header. This allows a single listener to service multiple top level domain path trees. Once
-// a virtual host is selected based on the domain, the routes are processed in order to see which
-// upstream cluster to route to or whether to perform a redirect.
-// [#next-free-field: 21]
-message VirtualHost {
- // The logical name of the virtual host. This is used when emitting certain
- // statistics but is not relevant for routing.
- string name = 1;
-
- // A list of domains (host/authority header) that will be matched to this
- // virtual host. Wildcard hosts are supported in the suffix or prefix form.
- //
- // Domain search order:
- // 1. Exact domain names: ``www.foo.com``.
- // 2. Suffix domain wildcards: ``*.foo.com`` or ``*-bar.foo.com``.
- // 3. Prefix domain wildcards: ``foo.*`` or ``foo-*``.
- // 4. Special wildcard ``*`` matching any domain.
- //
- // .. note::
- //
- // The wildcard will not match the empty string.
- // e.g. ``*-bar.foo.com`` will match ``baz-bar.foo.com`` but not ``-bar.foo.com``.
- // The longest wildcards match first.
- // Only a single virtual host in the entire route configuration can match on ``*``. A domain
- // must be unique across all virtual hosts or the config will fail to load.
- //
- // Domains cannot contain control characters. This is validated by the well_known_regex HTTP_HEADER_VALUE.
- repeated string domains = 2;
-
- // The list of routes that will be matched, in order, for incoming requests.
- // The first route that matches will be used.
- repeated Route routes = 3;
-}
-
-// A route is both a specification of how to match a request as well as an indication of what to do
-// next (e.g., redirect, forward, rewrite, etc.).
-//
-// .. attention::
-//
-// Envoy supports routing on HTTP method via :ref:`header matching
-// <envoy_api_msg_config.route.v3.HeaderMatcher>`.
-// [#next-free-field: 18]
-message Route {
- // Name for the route.
- string name = 14;
-
- // Route matching parameters.
- RouteMatch match = 1;
-
- oneof action {
- // Route request to some upstream cluster.
- RouteAction route = 2;
-
- // Return a redirect.
- RedirectAction redirect = 3;
- }
-}
-
-// Compared to the :ref:`cluster <envoy_api_field_config.route.v3.RouteAction.cluster>` field that specifies a
-// single upstream cluster as the target of a request, the :ref:`weighted_clusters
-// <envoy_api_field_config.route.v3.RouteAction.weighted_clusters>` option allows for specification of
-// multiple upstream clusters along with weights that indicate the percentage of
-// traffic to be forwarded to each cluster. The router selects an upstream cluster based on the
-// weights.
-message WeightedCluster {
- // [#next-free-field: 11]
- message ClusterWeight {
- // Name of the upstream cluster. The cluster must exist in the
- // :ref:`cluster manager configuration <config_cluster_manager>`.
- string name = 1;
-
- // An integer between 0 and :ref:`total_weight
- // <envoy_api_field_config.route.v3.WeightedCluster.total_weight>`. When a request matches the route,
- // the choice of an upstream cluster is determined by its weight. The sum of weights across all
- // entries in the clusters array must add up to the total_weight, which defaults to 100.
- google.protobuf.UInt32Value weight = 2;
- }
-
- // Specifies one or more upstream clusters associated with the route.
- repeated ClusterWeight clusters = 1;
-
- // Specifies the total weight across all clusters. The sum of all cluster weights must equal this
- // value, which must be greater than 0. Defaults to 100.
- google.protobuf.UInt32Value total_weight = 3;
-}
-
-// [#next-free-field: 13]
-message RouteMatch {
- oneof path_specifier {
- // If specified, the route is a prefix rule meaning that the prefix must
- // match the beginning of the *:path* header.
- string prefix = 1;
-
- // If specified, the route is an exact path rule meaning that the path must
- // exactly match the *:path* header once the query string is removed.
- string path = 2;
-
- // If specified, the route is a regular expression rule meaning that the
- // regex must match the *:path* header once the query string is removed. The entire path
- // (without the query string) must match the regex. The rule will not match if only a
- // subsequence of the *:path* header matches the regex.
- //
- // [#next-major-version: In the v3 API we should redo how path specification works such
- // that we utilize StringMatcher, and additionally have consistent options around whether we
- // strip query strings, do a case sensitive match, etc. In the interim it will be too disruptive
- // to deprecate the existing options. We should even consider whether we want to do away with
- // path_specifier entirely and just rely on a set of header matchers which can already match
- // on :path, etc. The issue with that is it is unclear how to generically deal with query string
- // stripping. This needs more thought.]
- type.matcher.v3.RegexMatcher safe_regex = 10;
- }
-
- // Indicates that prefix/path matching should be case insensitive. The default
- // is true.
- google.protobuf.BoolValue case_sensitive = 4;
-
- // Indicates that the route should additionally match on a runtime key. Every time the route
- // is considered for a match, it must also fall under the percentage of matches indicated by
- // this field. For some fraction N/D, a random number in the range [0,D) is selected. If the
- // number is <= the value of the numerator N, or if the key is not present, the default
- // value, the router continues to evaluate the remaining match criteria. A runtime_fraction
- // route configuration can be used to roll out route changes in a gradual manner without full
- // code/config deploys. Refer to the :ref:`traffic shifting
- // <config_http_conn_man_route_table_traffic_splitting_shift>` docs for additional documentation.
- //
- // .. note::
- //
- // Parsing this field is implemented such that the runtime key's data may be represented
- // as a FractionalPercent proto represented as JSON/YAML and may also be represented as an
- // integer with the assumption that the value is an integral percentage out of 100. For
- // instance, a runtime key lookup returning the value "42" would parse as a FractionalPercent
- // whose numerator is 42 and denominator is HUNDRED. This preserves legacy semantics.
- core.v3.RuntimeFractionalPercent runtime_fraction = 9;
-
- // Specifies a set of headers that the route should match on. The router will
- // check the request’s headers against all the specified headers in the route
- // config. A match will happen if all the headers in the route are present in
- // the request with the same values (or based on presence if the value field
- // is not in the config).
- repeated HeaderMatcher headers = 6;
-
- // Specifies a set of URL query parameters on which the route should
- // match. The router will check the query string from the *path* header
- // against all the specified query parameters. If the number of specified
- // query parameters is nonzero, they all must match the *path* header's
- // query string for a match to occur.
- repeated QueryParameterMatcher query_parameters = 7;
-}
-
-// [#next-free-field: 34]
-message RouteAction {
- oneof cluster_specifier {
- // Indicates the upstream cluster to which the request should be routed
- // to.
- string cluster = 1;
-
- // Envoy will determine the cluster to route to by reading the value of the
- // HTTP header named by cluster_header from the request headers. If the
- // header is not found or the referenced cluster does not exist, Envoy will
- // return a 404 response.
- //
- // .. attention::
- //
- // Internally, Envoy always uses the HTTP/2 *:authority* header to represent the HTTP/1
- // *Host* header. Thus, if attempting to match on *Host*, match on *:authority* instead.
- string cluster_header = 2;
-
- // Multiple upstream clusters can be specified for a given route. The
- // request is routed to one of the upstream clusters based on weights
- // assigned to each cluster. See
- // :ref:`traffic splitting <config_http_conn_man_route_table_traffic_splitting_split>`
- // for additional documentation.
- WeightedCluster weighted_clusters = 3;
- }
-}
-
-// .. attention::
-//
-// Internally, Envoy always uses the HTTP/2 *:authority* header to represent the HTTP/1 *Host*
-// header. Thus, if attempting to match on *Host*, match on *:authority* instead.
-//
-// .. attention::
-//
-// To route on HTTP method, use the special HTTP/2 *:method* header. This works for both
-// HTTP/1 and HTTP/2 as Envoy normalizes headers. E.g.,
-//
-// .. code-block:: json
-//
-// {
-// "name": ":method",
-// "exact_match": "POST"
-// }
-//
-// .. attention::
-// In the absence of any header match specifier, match will default to :ref:`present_match
-// <envoy_api_field_config.route.v3.HeaderMatcher.present_match>`. i.e, a request that has the :ref:`name
-// <envoy_api_field_config.route.v3.HeaderMatcher.name>` header will match, regardless of the header's
-// value.
-//
-// [#next-major-version: HeaderMatcher should be refactored to use StringMatcher.]
-// [#next-free-field: 12]
-message HeaderMatcher {
- // Specifies the name of the header in the request.
- string name = 1;
-
- // Specifies how the header match will be performed to route the request.
- oneof header_match_specifier {
- // If specified, header match will be performed based on the value of the header.
- string exact_match = 4;
-
- // If specified, this regex string is a regular expression rule which implies the entire request
- // header value must match the regex. The rule will not match if only a subsequence of the
- // request header value matches the regex.
- type.matcher.v3.RegexMatcher safe_regex_match = 11;
-
- // If specified, header match will be performed based on range.
- // The rule will match if the request header value is within this range.
- // The entire request header value must represent an integer in base 10 notation: consisting of
- // an optional plus or minus sign followed by a sequence of digits. The rule will not match if
- // the header value does not represent an integer. Match will fail for empty values, floating
- // point numbers or if only a subsequence of the header value is an integer.
- //
- // Examples:
- //
- // * For range [-10,0), route will match for header value -1, but not for 0, "somestring", 10.9,
- // "-1somestring"
- type.v3.Int64Range range_match = 6;
-
- // If specified, header match will be performed based on whether the header is in the
- // request.
- bool present_match = 7;
-
- // If specified, header match will be performed based on the prefix of the header value.
- // Note: empty prefix is not allowed, please use present_match instead.
- //
- // Examples:
- //
- // * The prefix *abcd* matches the value *abcdxyz*, but not for *abcxyz*.
- string prefix_match = 9;
-
- // If specified, header match will be performed based on the suffix of the header value.
- // Note: empty suffix is not allowed, please use present_match instead.
- //
- // Examples:
- //
- // * The suffix *abcd* matches the value *xyzabcd*, but not for *xyzbcd*.
- string suffix_match = 10;
- }
-
- // If specified, the match result will be inverted before checking. Defaults to false.
- //
- // Examples:
- //
- // * The regex ``\d{3}`` does not match the value *1234*, so it will match when inverted.
- // * The range [-10,0) will match the value -1, so it will not match when inverted.
- bool invert_match = 8;
-}
-
-// Query parameter matching treats the query string of a request's :path header
-// as an ampersand-separated list of keys and/or key=value elements.
-// [#next-free-field: 7]
-message QueryParameterMatcher {
-}
-
-// [#protodoc-title: HTTP route configuration]
-// * Routing :ref:`architecture overview <arch_overview_http_routing>`
-// * HTTP :ref:`router filter <config_http_filters_router>`
-
-// [#next-free-field: 11]
-message RouteConfiguration {
- // The name of the route configuration. For example, it might match
- // :ref:`route_config_name
- // <envoy_api_field_extensions.filters.network.http_connection_manager.v3.Rds.route_config_name>` in
- // :ref:`envoy_api_msg_extensions.filters.network.http_connection_manager.v3.Rds`.
- string name = 1;
-
- // An array of virtual hosts that make up the route table.
- repeated VirtualHost virtual_hosts = 2;
-}
-
-message RedirectAction {
-}
+// Copyright 2020 The gRPC Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Local copy of Envoy xDS proto file, used for testing only.
+
+syntax = "proto3";
+
+package envoy.config.route.v3;
+
+import "src/proto/grpc/testing/xds/v3/base.proto";
+import "src/proto/grpc/testing/xds/v3/regex.proto";
+import "src/proto/grpc/testing/xds/v3/percent.proto";
+import "src/proto/grpc/testing/xds/v3/range.proto";
+
+import "google/protobuf/wrappers.proto";
+
+// [#protodoc-title: HTTP route components]
+// * Routing :ref:`architecture overview <arch_overview_http_routing>`
+// * HTTP :ref:`router filter <config_http_filters_router>`
+
+// The top level element in the routing configuration is a virtual host. Each virtual host has
+// a logical name as well as a set of domains that get routed to it based on the incoming request's
+// host header. This allows a single listener to service multiple top level domain path trees. Once
+// a virtual host is selected based on the domain, the routes are processed in order to see which
+// upstream cluster to route to or whether to perform a redirect.
+// [#next-free-field: 21]
+message VirtualHost {
+ // The logical name of the virtual host. This is used when emitting certain
+ // statistics but is not relevant for routing.
+ string name = 1;
+
+ // A list of domains (host/authority header) that will be matched to this
+ // virtual host. Wildcard hosts are supported in the suffix or prefix form.
+ //
+ // Domain search order:
+ // 1. Exact domain names: ``www.foo.com``.
+ // 2. Suffix domain wildcards: ``*.foo.com`` or ``*-bar.foo.com``.
+ // 3. Prefix domain wildcards: ``foo.*`` or ``foo-*``.
+ // 4. Special wildcard ``*`` matching any domain.
+ //
+ // .. note::
+ //
+ // The wildcard will not match the empty string.
+ // e.g. ``*-bar.foo.com`` will match ``baz-bar.foo.com`` but not ``-bar.foo.com``.
+ // The longest wildcards match first.
+ // Only a single virtual host in the entire route configuration can match on ``*``. A domain
+ // must be unique across all virtual hosts or the config will fail to load.
+ //
+ // Domains cannot contain control characters. This is validated by the well_known_regex HTTP_HEADER_VALUE.
+ repeated string domains = 2;
+
+ // The list of routes that will be matched, in order, for incoming requests.
+ // The first route that matches will be used.
+ repeated Route routes = 3;
+}
+
+// A route is both a specification of how to match a request as well as an indication of what to do
+// next (e.g., redirect, forward, rewrite, etc.).
+//
+// .. attention::
+//
+// Envoy supports routing on HTTP method via :ref:`header matching
+// <envoy_api_msg_config.route.v3.HeaderMatcher>`.
+// [#next-free-field: 18]
+message Route {
+ // Name for the route.
+ string name = 14;
+
+ // Route matching parameters.
+ RouteMatch match = 1;
+
+ oneof action {
+ // Route request to some upstream cluster.
+ RouteAction route = 2;
+
+ // Return a redirect.
+ RedirectAction redirect = 3;
+ }
+}
+
+// Compared to the :ref:`cluster <envoy_api_field_config.route.v3.RouteAction.cluster>` field that specifies a
+// single upstream cluster as the target of a request, the :ref:`weighted_clusters
+// <envoy_api_field_config.route.v3.RouteAction.weighted_clusters>` option allows for specification of
+// multiple upstream clusters along with weights that indicate the percentage of
+// traffic to be forwarded to each cluster. The router selects an upstream cluster based on the
+// weights.
+message WeightedCluster {
+ // [#next-free-field: 11]
+ message ClusterWeight {
+ // Name of the upstream cluster. The cluster must exist in the
+ // :ref:`cluster manager configuration <config_cluster_manager>`.
+ string name = 1;
+
+ // An integer between 0 and :ref:`total_weight
+ // <envoy_api_field_config.route.v3.WeightedCluster.total_weight>`. When a request matches the route,
+ // the choice of an upstream cluster is determined by its weight. The sum of weights across all
+ // entries in the clusters array must add up to the total_weight, which defaults to 100.
+ google.protobuf.UInt32Value weight = 2;
+ }
+
+ // Specifies one or more upstream clusters associated with the route.
+ repeated ClusterWeight clusters = 1;
+
+ // Specifies the total weight across all clusters. The sum of all cluster weights must equal this
+ // value, which must be greater than 0. Defaults to 100.
+ google.protobuf.UInt32Value total_weight = 3;
+}
+
+// [#next-free-field: 13]
+message RouteMatch {
+ oneof path_specifier {
+ // If specified, the route is a prefix rule meaning that the prefix must
+ // match the beginning of the *:path* header.
+ string prefix = 1;
+
+ // If specified, the route is an exact path rule meaning that the path must
+ // exactly match the *:path* header once the query string is removed.
+ string path = 2;
+
+ // If specified, the route is a regular expression rule meaning that the
+ // regex must match the *:path* header once the query string is removed. The entire path
+ // (without the query string) must match the regex. The rule will not match if only a
+ // subsequence of the *:path* header matches the regex.
+ //
+ // [#next-major-version: In the v3 API we should redo how path specification works such
+ // that we utilize StringMatcher, and additionally have consistent options around whether we
+ // strip query strings, do a case sensitive match, etc. In the interim it will be too disruptive
+ // to deprecate the existing options. We should even consider whether we want to do away with
+ // path_specifier entirely and just rely on a set of header matchers which can already match
+ // on :path, etc. The issue with that is it is unclear how to generically deal with query string
+ // stripping. This needs more thought.]
+ type.matcher.v3.RegexMatcher safe_regex = 10;
+ }
+
+ // Indicates that prefix/path matching should be case insensitive. The default
+ // is true.
+ google.protobuf.BoolValue case_sensitive = 4;
+
+ // Indicates that the route should additionally match on a runtime key. Every time the route
+ // is considered for a match, it must also fall under the percentage of matches indicated by
+ // this field. For some fraction N/D, a random number in the range [0,D) is selected. If the
+ // number is <= the value of the numerator N, or if the key is not present, the default
+ // value, the router continues to evaluate the remaining match criteria. A runtime_fraction
+ // route configuration can be used to roll out route changes in a gradual manner without full
+ // code/config deploys. Refer to the :ref:`traffic shifting
+ // <config_http_conn_man_route_table_traffic_splitting_shift>` docs for additional documentation.
+ //
+ // .. note::
+ //
+ // Parsing this field is implemented such that the runtime key's data may be represented
+ // as a FractionalPercent proto represented as JSON/YAML and may also be represented as an
+ // integer with the assumption that the value is an integral percentage out of 100. For
+ // instance, a runtime key lookup returning the value "42" would parse as a FractionalPercent
+ // whose numerator is 42 and denominator is HUNDRED. This preserves legacy semantics.
+ core.v3.RuntimeFractionalPercent runtime_fraction = 9;
+
+ // Specifies a set of headers that the route should match on. The router will
+ // check the request’s headers against all the specified headers in the route
+ // config. A match will happen if all the headers in the route are present in
+ // the request with the same values (or based on presence if the value field
+ // is not in the config).
+ repeated HeaderMatcher headers = 6;
+
+ // Specifies a set of URL query parameters on which the route should
+ // match. The router will check the query string from the *path* header
+ // against all the specified query parameters. If the number of specified
+ // query parameters is nonzero, they all must match the *path* header's
+ // query string for a match to occur.
+ repeated QueryParameterMatcher query_parameters = 7;
+}
+
+// [#next-free-field: 34]
+message RouteAction {
+ oneof cluster_specifier {
+ // Indicates the upstream cluster to which the request should be routed
+ // to.
+ string cluster = 1;
+
+ // Envoy will determine the cluster to route to by reading the value of the
+ // HTTP header named by cluster_header from the request headers. If the
+ // header is not found or the referenced cluster does not exist, Envoy will
+ // return a 404 response.
+ //
+ // .. attention::
+ //
+ // Internally, Envoy always uses the HTTP/2 *:authority* header to represent the HTTP/1
+ // *Host* header. Thus, if attempting to match on *Host*, match on *:authority* instead.
+ string cluster_header = 2;
+
+ // Multiple upstream clusters can be specified for a given route. The
+ // request is routed to one of the upstream clusters based on weights
+ // assigned to each cluster. See
+ // :ref:`traffic splitting <config_http_conn_man_route_table_traffic_splitting_split>`
+ // for additional documentation.
+ WeightedCluster weighted_clusters = 3;
+ }
+}
+
+// .. attention::
+//
+// Internally, Envoy always uses the HTTP/2 *:authority* header to represent the HTTP/1 *Host*
+// header. Thus, if attempting to match on *Host*, match on *:authority* instead.
+//
+// .. attention::
+//
+// To route on HTTP method, use the special HTTP/2 *:method* header. This works for both
+// HTTP/1 and HTTP/2 as Envoy normalizes headers. E.g.,
+//
+// .. code-block:: json
+//
+// {
+// "name": ":method",
+// "exact_match": "POST"
+// }
+//
+// .. attention::
+// In the absence of any header match specifier, match will default to :ref:`present_match
+// <envoy_api_field_config.route.v3.HeaderMatcher.present_match>`. i.e, a request that has the :ref:`name
+// <envoy_api_field_config.route.v3.HeaderMatcher.name>` header will match, regardless of the header's
+// value.
+//
+// [#next-major-version: HeaderMatcher should be refactored to use StringMatcher.]
+// [#next-free-field: 12]
+message HeaderMatcher {
+ // Specifies the name of the header in the request.
+ string name = 1;
+
+ // Specifies how the header match will be performed to route the request.
+ oneof header_match_specifier {
+ // If specified, header match will be performed based on the value of the header.
+ string exact_match = 4;
+
+ // If specified, this regex string is a regular expression rule which implies the entire request
+ // header value must match the regex. The rule will not match if only a subsequence of the
+ // request header value matches the regex.
+ type.matcher.v3.RegexMatcher safe_regex_match = 11;
+
+ // If specified, header match will be performed based on range.
+ // The rule will match if the request header value is within this range.
+ // The entire request header value must represent an integer in base 10 notation: consisting of
+ // an optional plus or minus sign followed by a sequence of digits. The rule will not match if
+ // the header value does not represent an integer. Match will fail for empty values, floating
+ // point numbers or if only a subsequence of the header value is an integer.
+ //
+ // Examples:
+ //
+ // * For range [-10,0), route will match for header value -1, but not for 0, "somestring", 10.9,
+ // "-1somestring"
+ type.v3.Int64Range range_match = 6;
+
+ // If specified, header match will be performed based on whether the header is in the
+ // request.
+ bool present_match = 7;
+
+ // If specified, header match will be performed based on the prefix of the header value.
+ // Note: empty prefix is not allowed, please use present_match instead.
+ //
+ // Examples:
+ //
+ // * The prefix *abcd* matches the value *abcdxyz*, but not for *abcxyz*.
+ string prefix_match = 9;
+
+ // If specified, header match will be performed based on the suffix of the header value.
+ // Note: empty suffix is not allowed, please use present_match instead.
+ //
+ // Examples:
+ //
+ // * The suffix *abcd* matches the value *xyzabcd*, but not for *xyzbcd*.
+ string suffix_match = 10;
+ }
+
+ // If specified, the match result will be inverted before checking. Defaults to false.
+ //
+ // Examples:
+ //
+ // * The regex ``\d{3}`` does not match the value *1234*, so it will match when inverted.
+ // * The range [-10,0) will match the value -1, so it will not match when inverted.
+ bool invert_match = 8;
+}
+
+// Query parameter matching treats the query string of a request's :path header
+// as an ampersand-separated list of keys and/or key=value elements.
+// [#next-free-field: 7]
+message QueryParameterMatcher {
+}
+
+// [#protodoc-title: HTTP route configuration]
+// * Routing :ref:`architecture overview <arch_overview_http_routing>`
+// * HTTP :ref:`router filter <config_http_filters_router>`
+
+// [#next-free-field: 11]
+message RouteConfiguration {
+ // The name of the route configuration. For example, it might match
+ // :ref:`route_config_name
+ // <envoy_api_field_extensions.filters.network.http_connection_manager.v3.Rds.route_config_name>` in
+ // :ref:`envoy_api_msg_extensions.filters.network.http_connection_manager.v3.Rds`.
+ string name = 1;
+
+ // An array of virtual hosts that make up the route table.
+ repeated VirtualHost virtual_hosts = 2;
+}
+
+message RedirectAction {
+}
diff --git a/contrib/libs/grpc/src/proto/grpc/testing/xds/ya.make b/contrib/libs/grpc/src/proto/grpc/testing/xds/ya.make
index 78ce8de2fee..994ec6fa82a 100644
--- a/contrib/libs/grpc/src/proto/grpc/testing/xds/ya.make
+++ b/contrib/libs/grpc/src/proto/grpc/testing/xds/ya.make
@@ -2,8 +2,8 @@ PROTO_LIBRARY()
LICENSE(Apache-2.0)
-LICENSE_TEXTS(.yandex_meta/licenses.list.txt)
-
+LICENSE_TEXTS(.yandex_meta/licenses.list.txt)
+
OWNER(
akastornov
g:contrib
@@ -16,10 +16,10 @@ EXCLUDE_TAGS(
PY3_PROTO
)
-PROTO_NAMESPACE(
- GLOBAL
- contrib/libs/grpc
-)
+PROTO_NAMESPACE(
+ GLOBAL
+ contrib/libs/grpc
+)
PEERDIR(
contrib/libs/grpc/src/proto/grpc/testing
@@ -29,9 +29,9 @@ GRPC()
SRCS(
ads_for_test.proto
- cds_for_test.proto
+ cds_for_test.proto
eds_for_test.proto
- lds_rds_for_test.proto
+ lds_rds_for_test.proto
lrs_for_test.proto
orca_load_report_for_test.proto
)
diff --git a/contrib/libs/grpc/src/proto/grpc/testing/ya.make b/contrib/libs/grpc/src/proto/grpc/testing/ya.make
index e29415b84c2..2704585a373 100644
--- a/contrib/libs/grpc/src/proto/grpc/testing/ya.make
+++ b/contrib/libs/grpc/src/proto/grpc/testing/ya.make
@@ -2,8 +2,8 @@ PROTO_LIBRARY()
LICENSE(Apache-2.0)
-LICENSE_TEXTS(.yandex_meta/licenses.list.txt)
-
+LICENSE_TEXTS(.yandex_meta/licenses.list.txt)
+
OWNER(
akastornov
g:contrib
@@ -16,10 +16,10 @@ EXCLUDE_TAGS(
PY3_PROTO
)
-PROTO_NAMESPACE(
- GLOBAL
- contrib/libs/grpc
-)
+PROTO_NAMESPACE(
+ GLOBAL
+ contrib/libs/grpc
+)
PEERDIR(
contrib/libs/grpc/src/proto/grpc/core
diff --git a/contrib/libs/grpc/src/python/grpcio/.yandex_meta/licenses.list.txt b/contrib/libs/grpc/src/python/grpcio/.yandex_meta/licenses.list.txt
index 920997b5243..fa5b12c5a5c 100644
--- a/contrib/libs/grpc/src/python/grpcio/.yandex_meta/licenses.list.txt
+++ b/contrib/libs/grpc/src/python/grpcio/.yandex_meta/licenses.list.txt
@@ -1,60 +1,60 @@
-====================Apache-2.0====================
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-====================COPYRIGHT====================
- * Copyright 2015 gRPC authors.
-
-
-====================COPYRIGHT====================
- * Copyright 2015-2016 gRPC authors.
-
-
-====================COPYRIGHT====================
- * Copyright 2016 gRPC authors.
-
-
-====================COPYRIGHT====================
- * Copyright 2017 gRPC authors.
-
-
-====================COPYRIGHT====================
- * Copyright 2018 gRPC authors.
-
-
-====================COPYRIGHT====================
- * Copyright 2020 gRPC authors.
-
-
-====================COPYRIGHT====================
-# Copyright 2019 The gRPC authors.
-
-
-====================COPYRIGHT====================
-# Copyright 2019 gRPC authors.
-
-
-====================COPYRIGHT====================
-# Copyright 2020 The gRPC authors.
-
-
-====================COPYRIGHT====================
-// Copyright 2018 The gRPC Authors
-
-
-====================COPYRIGHT====================
-// Copyright 2019 The gRPC Authors
-
-
-====================COPYRIGHT====================
-// Copyright 2020 The gRPC Authors
+====================Apache-2.0====================
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+====================COPYRIGHT====================
+ * Copyright 2015 gRPC authors.
+
+
+====================COPYRIGHT====================
+ * Copyright 2015-2016 gRPC authors.
+
+
+====================COPYRIGHT====================
+ * Copyright 2016 gRPC authors.
+
+
+====================COPYRIGHT====================
+ * Copyright 2017 gRPC authors.
+
+
+====================COPYRIGHT====================
+ * Copyright 2018 gRPC authors.
+
+
+====================COPYRIGHT====================
+ * Copyright 2020 gRPC authors.
+
+
+====================COPYRIGHT====================
+# Copyright 2019 The gRPC authors.
+
+
+====================COPYRIGHT====================
+# Copyright 2019 gRPC authors.
+
+
+====================COPYRIGHT====================
+# Copyright 2020 The gRPC authors.
+
+
+====================COPYRIGHT====================
+// Copyright 2018 The gRPC Authors
+
+
+====================COPYRIGHT====================
+// Copyright 2019 The gRPC Authors
+
+
+====================COPYRIGHT====================
+// Copyright 2020 The gRPC Authors
diff --git a/contrib/libs/grpc/src/python/grpcio/README.rst b/contrib/libs/grpc/src/python/grpcio/README.rst
index d251ad89cb1..fe34ad5adfe 100644
--- a/contrib/libs/grpc/src/python/grpcio/README.rst
+++ b/contrib/libs/grpc/src/python/grpcio/README.rst
@@ -55,7 +55,7 @@ package named :code:`python-dev`).
::
$ export REPO_ROOT=grpc # REPO_ROOT can be any directory of your choice
- $ git clone -b RELEASE_TAG_HERE https://github.com/grpc/grpc $REPO_ROOT
+ $ git clone -b RELEASE_TAG_HERE https://github.com/grpc/grpc $REPO_ROOT
$ cd $REPO_ROOT
$ git submodule update --init
diff --git a/contrib/libs/grpc/src/python/grpcio/_parallel_compile_patch.py b/contrib/libs/grpc/src/python/grpcio/_parallel_compile_patch.py
index 6422849d35b..e4d50c38311 100644
--- a/contrib/libs/grpc/src/python/grpcio/_parallel_compile_patch.py
+++ b/contrib/libs/grpc/src/python/grpcio/_parallel_compile_patch.py
@@ -22,10 +22,10 @@ import os
try:
BUILD_EXT_COMPILER_JOBS = int(
- os.environ['GRPC_PYTHON_BUILD_EXT_COMPILER_JOBS'])
-except KeyError:
- import multiprocessing
- BUILD_EXT_COMPILER_JOBS = multiprocessing.cpu_count()
+ os.environ['GRPC_PYTHON_BUILD_EXT_COMPILER_JOBS'])
+except KeyError:
+ import multiprocessing
+ BUILD_EXT_COMPILER_JOBS = multiprocessing.cpu_count()
except ValueError:
BUILD_EXT_COMPILER_JOBS = 1
diff --git a/contrib/libs/grpc/src/python/grpcio/commands.py b/contrib/libs/grpc/src/python/grpcio/commands.py
index fddf5bf58f5..8240beb2958 100644
--- a/contrib/libs/grpc/src/python/grpcio/commands.py
+++ b/contrib/libs/grpc/src/python/grpcio/commands.py
@@ -13,8 +13,8 @@
# limitations under the License.
"""Provides distutils command classes for the GRPC Python setup process."""
-from __future__ import print_function
-
+from __future__ import print_function
+
import distutils
import glob
import os
@@ -101,7 +101,7 @@ class SphinxDocumentation(setuptools.Command):
target_dir = os.path.join(GRPC_STEM, 'doc', 'build')
exit_code = sphinx.cmd.build.build_main(
['-b', 'html', '-W', '--keep-going', source_dir, target_dir])
- if exit_code != 0:
+ if exit_code != 0:
raise CommandError(
"Documentation generation has warnings or errors")
@@ -151,10 +151,10 @@ def check_and_update_cythonization(extensions):
for source in extension.sources:
base, file_ext = os.path.splitext(source)
if file_ext == '.pyx':
- generated_pyx_source = next((base + gen_ext for gen_ext in (
- '.c',
- '.cpp',
- ) if os.path.isfile(base + gen_ext)), None)
+ generated_pyx_source = next((base + gen_ext for gen_ext in (
+ '.c',
+ '.cpp',
+ ) if os.path.isfile(base + gen_ext)), None)
if generated_pyx_source:
generated_pyx_sources.append(generated_pyx_source)
else:
@@ -196,7 +196,7 @@ def try_cythonize(extensions, linetracing=False, mandatory=True):
return Cython.Build.cythonize(
extensions,
include_path=[
- include_dir for extension in extensions
+ include_dir for extension in extensions
for include_dir in extension.include_dirs
] + [CYTHON_STEM],
compiler_directives=cython_compiler_directives)
@@ -217,13 +217,13 @@ class BuildExt(build_ext.build_ext):
"""Test if default compiler is okay with specifying c++ version
when invoked in C mode. GCC is okay with this, while clang is not.
"""
- if platform.system() != 'Windows':
- return False
+ if platform.system() != 'Windows':
+ return False
# TODO(lidiz) Remove the generated a.out for success tests.
- cc_test = subprocess.Popen(['cc', '-x', 'c', '-std=c++11', '-'],
- stdin=subprocess.PIPE,
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE)
+ cc_test = subprocess.Popen(['cc', '-x', 'c', '-std=c++11', '-'],
+ stdin=subprocess.PIPE,
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE)
_, cc_err = cc_test.communicate(input=b'int main(){return 0;}')
return not 'invalid argument' in str(cc_err)
@@ -273,10 +273,10 @@ class Gather(setuptools.Command):
"""Command to gather project dependencies."""
description = 'gather dependencies for grpcio'
- user_options = [
- ('test', 't', 'flag indicating to gather test dependencies'),
- ('install', 'i', 'flag indicating to gather install dependencies')
- ]
+ user_options = [
+ ('test', 't', 'flag indicating to gather test dependencies'),
+ ('install', 'i', 'flag indicating to gather install dependencies')
+ ]
def initialize_options(self):
self.test = False
@@ -292,43 +292,43 @@ class Gather(setuptools.Command):
self.distribution.install_requires)
if self.test and self.distribution.tests_require:
self.distribution.fetch_build_eggs(self.distribution.tests_require)
-
-
-class Clean(setuptools.Command):
- """Command to clean build artifacts."""
-
- description = 'Clean build artifacts.'
- user_options = [
- ('all', 'a', 'a phony flag to allow our script to continue'),
- ]
-
- _FILE_PATTERNS = (
- 'python_build',
- 'src/python/grpcio/__pycache__/',
- 'src/python/grpcio/grpc/_cython/cygrpc.cpp',
- 'src/python/grpcio/grpc/_cython/*.so',
- 'src/python/grpcio/grpcio.egg-info/',
- )
- _CURRENT_DIRECTORY = os.path.normpath(
- os.path.join(os.path.dirname(os.path.realpath(__file__)), "../../.."))
-
- def initialize_options(self):
- self.all = False
-
- def finalize_options(self):
- pass
-
- def run(self):
- for path_spec in self._FILE_PATTERNS:
- this_glob = os.path.normpath(
- os.path.join(Clean._CURRENT_DIRECTORY, path_spec))
- abs_paths = glob.glob(this_glob)
- for path in abs_paths:
- if not str(path).startswith(Clean._CURRENT_DIRECTORY):
- raise ValueError(
- "Cowardly refusing to delete {}.".format(path))
- print("Removing {}".format(os.path.relpath(path)))
- if os.path.isfile(path):
- os.remove(str(path))
- else:
- shutil.rmtree(str(path))
+
+
+class Clean(setuptools.Command):
+ """Command to clean build artifacts."""
+
+ description = 'Clean build artifacts.'
+ user_options = [
+ ('all', 'a', 'a phony flag to allow our script to continue'),
+ ]
+
+ _FILE_PATTERNS = (
+ 'python_build',
+ 'src/python/grpcio/__pycache__/',
+ 'src/python/grpcio/grpc/_cython/cygrpc.cpp',
+ 'src/python/grpcio/grpc/_cython/*.so',
+ 'src/python/grpcio/grpcio.egg-info/',
+ )
+ _CURRENT_DIRECTORY = os.path.normpath(
+ os.path.join(os.path.dirname(os.path.realpath(__file__)), "../../.."))
+
+ def initialize_options(self):
+ self.all = False
+
+ def finalize_options(self):
+ pass
+
+ def run(self):
+ for path_spec in self._FILE_PATTERNS:
+ this_glob = os.path.normpath(
+ os.path.join(Clean._CURRENT_DIRECTORY, path_spec))
+ abs_paths = glob.glob(this_glob)
+ for path in abs_paths:
+ if not str(path).startswith(Clean._CURRENT_DIRECTORY):
+ raise ValueError(
+ "Cowardly refusing to delete {}.".format(path))
+ print("Removing {}".format(os.path.relpath(path)))
+ if os.path.isfile(path):
+ os.remove(str(path))
+ else:
+ shutil.rmtree(str(path))
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/__init__.py b/contrib/libs/grpc/src/python/grpcio/grpc/__init__.py
index f36062d3f4f..abe87458c4f 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/__init__.py
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/__init__.py
@@ -187,7 +187,7 @@ class Future(six.with_metaclass(abc.ABCMeta)):
The callback will be passed this Future object describing the outcome
of the computation. Callbacks will be invoked after the future is
- terminated, whether successfully or not.
+ terminated, whether successfully or not.
If the computation has already completed, the callback will be called
immediately.
@@ -414,8 +414,8 @@ class ClientCallDetails(six.with_metaclass(abc.ABCMeta)):
metadata: Optional :term:`metadata` to be transmitted to
the service-side of the RPC.
credentials: An optional CallCredentials for the RPC.
- wait_for_ready: This is an EXPERIMENTAL argument. An optional
- flag to enable :term:`wait_for_ready` mechanism.
+ wait_for_ready: This is an EXPERIMENTAL argument. An optional
+ flag to enable :term:`wait_for_ready` mechanism.
compression: An element of grpc.compression, e.g.
grpc.compression.Gzip. This is an EXPERIMENTAL option.
"""
@@ -628,7 +628,7 @@ class AuthMetadataPlugin(six.with_metaclass(abc.ABCMeta)):
def __call__(self, context, callback):
"""Implements authentication by passing metadata to a callback.
- This method will be invoked asynchronously in a separate thread.
+ This method will be invoked asynchronously in a separate thread.
Args:
context: An AuthMetadataContext providing information on the RPC that
@@ -690,7 +690,7 @@ class UnaryUnaryMultiCallable(six.with_metaclass(abc.ABCMeta)):
credentials: An optional CallCredentials for the RPC. Only valid for
secure Channel.
wait_for_ready: This is an EXPERIMENTAL argument. An optional
- flag to enable :term:`wait_for_ready` mechanism.
+ flag to enable :term:`wait_for_ready` mechanism.
compression: An element of grpc.compression, e.g.
grpc.compression.Gzip. This is an EXPERIMENTAL option.
@@ -723,7 +723,7 @@ class UnaryUnaryMultiCallable(six.with_metaclass(abc.ABCMeta)):
credentials: An optional CallCredentials for the RPC. Only valid for
secure Channel.
wait_for_ready: This is an EXPERIMENTAL argument. An optional
- flag to enable :term:`wait_for_ready` mechanism.
+ flag to enable :term:`wait_for_ready` mechanism.
compression: An element of grpc.compression, e.g.
grpc.compression.Gzip. This is an EXPERIMENTAL option.
@@ -756,7 +756,7 @@ class UnaryUnaryMultiCallable(six.with_metaclass(abc.ABCMeta)):
credentials: An optional CallCredentials for the RPC. Only valid for
secure Channel.
wait_for_ready: This is an EXPERIMENTAL argument. An optional
- flag to enable :term:`wait_for_ready` mechanism.
+ flag to enable :term:`wait_for_ready` mechanism.
compression: An element of grpc.compression, e.g.
grpc.compression.Gzip. This is an EXPERIMENTAL option.
@@ -792,7 +792,7 @@ class UnaryStreamMultiCallable(six.with_metaclass(abc.ABCMeta)):
credentials: An optional CallCredentials for the RPC. Only valid for
secure Channel.
wait_for_ready: This is an EXPERIMENTAL argument. An optional
- flag to enable :term:`wait_for_ready` mechanism.
+ flag to enable :term:`wait_for_ready` mechanism.
compression: An element of grpc.compression, e.g.
grpc.compression.Gzip. This is an EXPERIMENTAL option.
@@ -828,7 +828,7 @@ class StreamUnaryMultiCallable(six.with_metaclass(abc.ABCMeta)):
credentials: An optional CallCredentials for the RPC. Only valid for
secure Channel.
wait_for_ready: This is an EXPERIMENTAL argument. An optional
- flag to enable :term:`wait_for_ready` mechanism.
+ flag to enable :term:`wait_for_ready` mechanism.
compression: An element of grpc.compression, e.g.
grpc.compression.Gzip. This is an EXPERIMENTAL option.
@@ -862,7 +862,7 @@ class StreamUnaryMultiCallable(six.with_metaclass(abc.ABCMeta)):
credentials: An optional CallCredentials for the RPC. Only valid for
secure Channel.
wait_for_ready: This is an EXPERIMENTAL argument. An optional
- flag to enable :term:`wait_for_ready` mechanism.
+ flag to enable :term:`wait_for_ready` mechanism.
compression: An element of grpc.compression, e.g.
grpc.compression.Gzip. This is an EXPERIMENTAL option.
@@ -895,7 +895,7 @@ class StreamUnaryMultiCallable(six.with_metaclass(abc.ABCMeta)):
credentials: An optional CallCredentials for the RPC. Only valid for
secure Channel.
wait_for_ready: This is an EXPERIMENTAL argument. An optional
- flag to enable :term:`wait_for_ready` mechanism.
+ flag to enable :term:`wait_for_ready` mechanism.
compression: An element of grpc.compression, e.g.
grpc.compression.Gzip. This is an EXPERIMENTAL option.
@@ -931,7 +931,7 @@ class StreamStreamMultiCallable(six.with_metaclass(abc.ABCMeta)):
credentials: An optional CallCredentials for the RPC. Only valid for
secure Channel.
wait_for_ready: This is an EXPERIMENTAL argument. An optional
- flag to enable :term:`wait_for_ready` mechanism.
+ flag to enable :term:`wait_for_ready` mechanism.
compression: An element of grpc.compression, e.g.
grpc.compression.Gzip. This is an EXPERIMENTAL option.
@@ -994,9 +994,9 @@ class Channel(six.with_metaclass(abc.ABCMeta)):
Args:
method: The name of the RPC method.
- request_serializer: Optional :term:`serializer` for serializing the request
+ request_serializer: Optional :term:`serializer` for serializing the request
message. Request goes unserialized in case None is passed.
- response_deserializer: Optional :term:`deserializer` for deserializing the
+ response_deserializer: Optional :term:`deserializer` for deserializing the
response message. Response goes undeserialized in case None
is passed.
@@ -1014,9 +1014,9 @@ class Channel(six.with_metaclass(abc.ABCMeta)):
Args:
method: The name of the RPC method.
- request_serializer: Optional :term:`serializer` for serializing the request
+ request_serializer: Optional :term:`serializer` for serializing the request
message. Request goes unserialized in case None is passed.
- response_deserializer: Optional :term:`deserializer` for deserializing the
+ response_deserializer: Optional :term:`deserializer` for deserializing the
response message. Response goes undeserialized in case None is
passed.
@@ -1034,9 +1034,9 @@ class Channel(six.with_metaclass(abc.ABCMeta)):
Args:
method: The name of the RPC method.
- request_serializer: Optional :term:`serializer` for serializing the request
+ request_serializer: Optional :term:`serializer` for serializing the request
message. Request goes unserialized in case None is passed.
- response_deserializer: Optional :term:`deserializer` for deserializing the
+ response_deserializer: Optional :term:`deserializer` for deserializing the
response message. Response goes undeserialized in case None is
passed.
@@ -1054,9 +1054,9 @@ class Channel(six.with_metaclass(abc.ABCMeta)):
Args:
method: The name of the RPC method.
- request_serializer: Optional :term:`serializer` for serializing the request
+ request_serializer: Optional :term:`serializer` for serializing the request
message. Request goes unserialized in case None is passed.
- response_deserializer: Optional :term:`deserializer` for deserializing the
+ response_deserializer: Optional :term:`deserializer` for deserializing the
response message. Response goes undeserialized in case None
is passed.
@@ -1076,15 +1076,15 @@ class Channel(six.with_metaclass(abc.ABCMeta)):
"""
raise NotImplementedError()
- def __enter__(self):
- """Enters the runtime context related to the channel object."""
- raise NotImplementedError()
+ def __enter__(self):
+ """Enters the runtime context related to the channel object."""
+ raise NotImplementedError()
+
+ def __exit__(self, exc_type, exc_val, exc_tb):
+ """Exits the runtime context related to the channel object."""
+ raise NotImplementedError()
+
- def __exit__(self, exc_type, exc_val, exc_tb):
- """Exits the runtime context related to the channel object."""
- raise NotImplementedError()
-
-
########################## Service-Side Context ##############################
@@ -1170,14 +1170,14 @@ class ServicerContext(six.with_metaclass(abc.ABCMeta, RpcContext)):
@abc.abstractmethod
def set_trailing_metadata(self, trailing_metadata):
- """Sets the trailing metadata for the RPC.
-
- Sets the trailing metadata to be sent upon completion of the RPC.
-
- If this method is invoked multiple times throughout the lifetime of an
- RPC, the value supplied in the final invocation will be the value sent
- over the wire.
-
+ """Sets the trailing metadata for the RPC.
+
+ Sets the trailing metadata to be sent upon completion of the RPC.
+
+ If this method is invoked multiple times throughout the lifetime of an
+ RPC, the value supplied in the final invocation will be the value sent
+ over the wire.
+
This method need not be called by implementations if they have no
metadata to add to what the gRPC runtime will transmit.
@@ -1271,11 +1271,11 @@ class RpcMethodHandler(six.with_metaclass(abc.ABCMeta)):
or any arbitrary number of request messages.
response_streaming: Whether the RPC supports exactly one response message
or any arbitrary number of response messages.
- request_deserializer: A callable :term:`deserializer` that accepts a byte string and
+ request_deserializer: A callable :term:`deserializer` that accepts a byte string and
returns an object suitable to be passed to this object's business
logic, or None to indicate that this object's business logic should be
passed the raw request bytes.
- response_serializer: A callable :term:`serializer` that accepts an object produced
+ response_serializer: A callable :term:`serializer` that accepts an object produced
by this object's business logic and returns a byte string, or None to
indicate that the byte strings produced by this object's business logic
should be transmitted on the wire as they are.
@@ -1496,8 +1496,8 @@ def unary_unary_rpc_method_handler(behavior,
Args:
behavior: The implementation of an RPC that accepts one request
and returns one response.
- request_deserializer: An optional :term:`deserializer` for request deserialization.
- response_serializer: An optional :term:`serializer` for response serialization.
+ request_deserializer: An optional :term:`deserializer` for request deserialization.
+ response_serializer: An optional :term:`serializer` for response serialization.
Returns:
An RpcMethodHandler object that is typically used by grpc.Server.
@@ -1516,8 +1516,8 @@ def unary_stream_rpc_method_handler(behavior,
Args:
behavior: The implementation of an RPC that accepts one request
and returns an iterator of response values.
- request_deserializer: An optional :term:`deserializer` for request deserialization.
- response_serializer: An optional :term:`serializer` for response serialization.
+ request_deserializer: An optional :term:`deserializer` for request deserialization.
+ response_serializer: An optional :term:`serializer` for response serialization.
Returns:
An RpcMethodHandler object that is typically used by grpc.Server.
@@ -1536,8 +1536,8 @@ def stream_unary_rpc_method_handler(behavior,
Args:
behavior: The implementation of an RPC that accepts an iterator of
request values and returns a single response value.
- request_deserializer: An optional :term:`deserializer` for request deserialization.
- response_serializer: An optional :term:`serializer` for response serialization.
+ request_deserializer: An optional :term:`deserializer` for request deserialization.
+ response_serializer: An optional :term:`serializer` for response serialization.
Returns:
An RpcMethodHandler object that is typically used by grpc.Server.
@@ -1556,8 +1556,8 @@ def stream_stream_rpc_method_handler(behavior,
Args:
behavior: The implementation of an RPC that accepts an iterator of
request values and returns an iterator of response values.
- request_deserializer: An optional :term:`deserializer` for request deserialization.
- response_serializer: An optional :term:`serializer` for response serialization.
+ request_deserializer: An optional :term:`deserializer` for request deserialization.
+ response_serializer: An optional :term:`serializer` for response serialization.
Returns:
An RpcMethodHandler object that is typically used by grpc.Server.
@@ -1597,7 +1597,7 @@ def ssl_channel_credentials(root_certificates=None,
private_key: The PEM-encoded private key as a byte string, or None if no
private key should be used.
certificate_chain: The PEM-encoded certificate chain as a byte string
- to use or None if no certificate chain should be used.
+ to use or None if no certificate chain should be used.
Returns:
A ChannelCredentials for use with an SSL-enabled Channel.
@@ -1833,58 +1833,58 @@ def local_server_credentials(local_connect_type=LocalConnectionType.LOCAL_TCP):
_cygrpc.server_credentials_local(local_connect_type.value))
-def alts_channel_credentials(service_accounts=None):
- """Creates a ChannelCredentials for use with an ALTS-enabled Channel.
-
- This is an EXPERIMENTAL API.
- ALTS credentials API can only be used in GCP environment as it relies on
- handshaker service being available. For more info about ALTS see
- https://cloud.google.com/security/encryption-in-transit/application-layer-transport-security
-
- Args:
- service_accounts: A list of server identities accepted by the client.
- If target service accounts are provided and none of them matches the
- peer identity of the server, handshake will fail. The arg can be empty
- if the client does not have any information about trusted server
- identity.
- Returns:
- A ChannelCredentials for use with an ALTS-enabled Channel
- """
- return ChannelCredentials(
- _cygrpc.channel_credentials_alts(service_accounts or []))
-
-
-def alts_server_credentials():
- """Creates a ServerCredentials for use with an ALTS-enabled connection.
-
- This is an EXPERIMENTAL API.
- ALTS credentials API can only be used in GCP environment as it relies on
- handshaker service being available. For more info about ALTS see
- https://cloud.google.com/security/encryption-in-transit/application-layer-transport-security
-
- Returns:
- A ServerCredentials for use with an ALTS-enabled Server
- """
- return ServerCredentials(_cygrpc.server_credentials_alts())
-
-
-def compute_engine_channel_credentials(call_credentials):
- """Creates a compute engine channel credential.
-
- This credential can only be used in a GCP environment as it relies on
- a handshaker service. For more info about ALTS, see
- https://cloud.google.com/security/encryption-in-transit/application-layer-transport-security
-
- This channel credential is expected to be used as part of a composite
- credential in conjunction with a call credentials that authenticates the
- VM's default service account. If used with any other sort of call
- credential, the connection may suddenly and unexpectedly begin failing RPCs.
- """
- return ChannelCredentials(
- _cygrpc.channel_credentials_compute_engine(
- call_credentials._credentials))
-
-
+def alts_channel_credentials(service_accounts=None):
+ """Creates a ChannelCredentials for use with an ALTS-enabled Channel.
+
+ This is an EXPERIMENTAL API.
+ ALTS credentials API can only be used in GCP environment as it relies on
+ handshaker service being available. For more info about ALTS see
+ https://cloud.google.com/security/encryption-in-transit/application-layer-transport-security
+
+ Args:
+ service_accounts: A list of server identities accepted by the client.
+ If target service accounts are provided and none of them matches the
+ peer identity of the server, handshake will fail. The arg can be empty
+ if the client does not have any information about trusted server
+ identity.
+ Returns:
+ A ChannelCredentials for use with an ALTS-enabled Channel
+ """
+ return ChannelCredentials(
+ _cygrpc.channel_credentials_alts(service_accounts or []))
+
+
+def alts_server_credentials():
+ """Creates a ServerCredentials for use with an ALTS-enabled connection.
+
+ This is an EXPERIMENTAL API.
+ ALTS credentials API can only be used in GCP environment as it relies on
+ handshaker service being available. For more info about ALTS see
+ https://cloud.google.com/security/encryption-in-transit/application-layer-transport-security
+
+ Returns:
+ A ServerCredentials for use with an ALTS-enabled Server
+ """
+ return ServerCredentials(_cygrpc.server_credentials_alts())
+
+
+def compute_engine_channel_credentials(call_credentials):
+ """Creates a compute engine channel credential.
+
+ This credential can only be used in a GCP environment as it relies on
+ a handshaker service. For more info about ALTS, see
+ https://cloud.google.com/security/encryption-in-transit/application-layer-transport-security
+
+ This channel credential is expected to be used as part of a composite
+ credential in conjunction with a call credentials that authenticates the
+ VM's default service account. If used with any other sort of call
+ credential, the connection may suddenly and unexpectedly begin failing RPCs.
+ """
+ return ChannelCredentials(
+ _cygrpc.channel_credentials_compute_engine(
+ call_credentials._credentials))
+
+
def channel_ready_future(channel):
"""Creates a Future that tracks when a Channel is ready.
@@ -1909,7 +1909,7 @@ def insecure_channel(target, options=None, compression=None):
Args:
target: The server address
- options: An optional list of key-value pairs (:term:`channel_arguments`
+ options: An optional list of key-value pairs (:term:`channel_arguments`
in gRPC Core runtime) to configure the channel.
compression: An optional value indicating the compression method to be
used over the lifetime of the channel. This is an EXPERIMENTAL option.
@@ -1918,8 +1918,8 @@ def insecure_channel(target, options=None, compression=None):
A Channel.
"""
from grpc import _channel # pylint: disable=cyclic-import
- return _channel.Channel(target, () if options is None else options, None,
- compression)
+ return _channel.Channel(target, () if options is None else options, None,
+ compression)
def secure_channel(target, credentials, options=None, compression=None):
@@ -1930,7 +1930,7 @@ def secure_channel(target, credentials, options=None, compression=None):
Args:
target: The server address.
credentials: A ChannelCredentials instance.
- options: An optional list of key-value pairs (:term:`channel_arguments`
+ options: An optional list of key-value pairs (:term:`channel_arguments`
in gRPC Core runtime) to configure the channel.
compression: An optional value indicating the compression method to be
used over the lifetime of the channel. This is an EXPERIMENTAL option.
@@ -1939,11 +1939,11 @@ def secure_channel(target, credentials, options=None, compression=None):
A Channel.
"""
from grpc import _channel # pylint: disable=cyclic-import
- from grpc.experimental import _insecure_channel_credentials
- if credentials._credentials is _insecure_channel_credentials:
- raise ValueError(
- "secure_channel cannot be called with insecure credentials." +
- " Call insecure_channel instead.")
+ from grpc.experimental import _insecure_channel_credentials
+ if credentials._credentials is _insecure_channel_credentials:
+ raise ValueError(
+ "secure_channel cannot be called with insecure credentials." +
+ " Call insecure_channel instead.")
return _channel.Channel(target, () if options is None else options,
credentials._credentials, compression)
@@ -1994,7 +1994,7 @@ def server(thread_pool,
and optionally manipulate the incoming RPCs before handing them over to
handlers. The interceptors are given control in the order they are
specified. This is an EXPERIMENTAL API.
- options: An optional list of key-value pairs (:term:`channel_arguments` in gRPC runtime)
+ options: An optional list of key-value pairs (:term:`channel_arguments` in gRPC runtime)
to configure the channel.
maximum_concurrent_rpcs: The maximum number of concurrent RPCs this server
will service before returning RESOURCE_EXHAUSTED status, or None to
@@ -2007,10 +2007,10 @@ def server(thread_pool,
A Server object.
"""
from grpc import _server # pylint: disable=cyclic-import
- return _server.create_server(thread_pool,
- () if handlers is None else handlers,
- () if interceptors is None else interceptors,
- () if options is None else options,
+ return _server.create_server(thread_pool,
+ () if handlers is None else handlers,
+ () if interceptors is None else interceptors,
+ () if options is None else options,
maximum_concurrent_rpcs, compression)
@@ -2038,8 +2038,8 @@ class Compression(enum.IntEnum):
Gzip = _compression.Gzip
-from grpc._runtime_protos import protos, services, protos_and_services # pylint: disable=wrong-import-position
-
+from grpc._runtime_protos import protos, services, protos_and_services # pylint: disable=wrong-import-position
+
################################### __all__ #################################
__all__ = (
@@ -2090,8 +2090,8 @@ __all__ = (
'composite_channel_credentials',
'local_channel_credentials',
'local_server_credentials',
- 'alts_channel_credentials',
- 'alts_server_credentials',
+ 'alts_channel_credentials',
+ 'alts_server_credentials',
'ssl_server_credentials',
'ssl_server_certificate_configuration',
'dynamic_ssl_server_credentials',
@@ -2100,9 +2100,9 @@ __all__ = (
'secure_channel',
'intercept_channel',
'server',
- 'protos',
- 'services',
- 'protos_and_services',
+ 'protos',
+ 'services',
+ 'protos_and_services',
)
############################### Extension Shims ################################
@@ -2123,8 +2123,8 @@ try:
sys.modules.update({'grpc.reflection': grpc_reflection})
except ImportError:
pass
-
-# Prevents import order issue in the case of renamed path.
-if sys.version_info >= (3, 6) and __name__ == "grpc":
- from grpc import aio # pylint: disable=ungrouped-imports
- sys.modules.update({'grpc.aio': aio})
+
+# Prevents import order issue in the case of renamed path.
+if sys.version_info >= (3, 6) and __name__ == "grpc":
+ from grpc import aio # pylint: disable=ungrouped-imports
+ sys.modules.update({'grpc.aio': aio})
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/_auth.py b/contrib/libs/grpc/src/python/grpcio/grpc/_auth.py
index 298943ff78c..2d38320afff 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/_auth.py
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/_auth.py
@@ -34,18 +34,18 @@ class GoogleCallCredentials(grpc.AuthMetadataPlugin):
credentials.get_access_token).args
def __call__(self, context, callback):
- try:
- if self._is_jwt:
- access_token = self._credentials.get_access_token(
- additional_claims={
- 'aud': context.service_url
- }).access_token
- else:
- access_token = self._credentials.get_access_token().access_token
- except Exception as exception: # pylint: disable=broad-except
- _sign_request(callback, None, exception)
+ try:
+ if self._is_jwt:
+ access_token = self._credentials.get_access_token(
+ additional_claims={
+ 'aud': context.service_url
+ }).access_token
+ else:
+ access_token = self._credentials.get_access_token().access_token
+ except Exception as exception: # pylint: disable=broad-except
+ _sign_request(callback, None, exception)
else:
- _sign_request(callback, access_token, None)
+ _sign_request(callback, access_token, None)
class AccessTokenAuthMetadataPlugin(grpc.AuthMetadataPlugin):
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/_channel.py b/contrib/libs/grpc/src/python/grpcio/grpc/_channel.py
index 530fa905bca..11921d78838 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/_channel.py
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/_channel.py
@@ -172,8 +172,8 @@ def _event_handler(state, response_deserializer):
except Exception as e: # pylint: disable=broad-except
# NOTE(rbellevi): We suppress but log errors here so as not to
# kill the channel spin thread.
- logging.error('Exception in callback %s: %s',
- repr(callback.func), repr(e))
+ logging.error('Exception in callback %s: %s',
+ repr(callback.func), repr(e))
return done and state.fork_epoch >= cygrpc.get_fork_epoch()
return handle_event
@@ -233,11 +233,11 @@ def _consume_request_iterator(request_iterator, state, call, request_serializer,
cygrpc.OperationType.send_message not in
state.due)
- _common.wait(state.condition.wait,
- _done,
- spin_cb=functools.partial(
- cygrpc.block_if_fork_in_progress,
- state))
+ _common.wait(state.condition.wait,
+ _done,
+ spin_cb=functools.partial(
+ cygrpc.block_if_fork_in_progress,
+ state))
if state.code is not None:
return
else:
@@ -442,112 +442,112 @@ class _Rendezvous(grpc.RpcError, grpc.RpcContext):
self._state.condition.notify_all()
-class _SingleThreadedRendezvous(_Rendezvous, grpc.Call, grpc.Future): # pylint: disable=too-many-ancestors
+class _SingleThreadedRendezvous(_Rendezvous, grpc.Call, grpc.Future): # pylint: disable=too-many-ancestors
"""An RPC iterator operating entirely on a single thread.
The __next__ method of _SingleThreadedRendezvous does not depend on the
existence of any other thread, including the "channel spin thread".
However, this means that its interface is entirely synchronous. So this
- class cannot completely fulfill the grpc.Future interface. The result,
- exception, and traceback methods will never block and will instead raise
- an exception if calling the method would result in blocking.
-
- This means that these methods are safe to call from add_done_callback
- handlers.
+ class cannot completely fulfill the grpc.Future interface. The result,
+ exception, and traceback methods will never block and will instead raise
+ an exception if calling the method would result in blocking.
+
+ This means that these methods are safe to call from add_done_callback
+ handlers.
"""
- def _is_complete(self):
- return self._state.code is not None
-
- def cancelled(self):
- with self._state.condition:
- return self._state.cancelled
-
- def running(self):
- with self._state.condition:
- return self._state.code is None
-
- def done(self):
- with self._state.condition:
- return self._state.code is not None
-
- def result(self, timeout=None):
- """Returns the result of the computation or raises its exception.
-
- This method will never block. Instead, it will raise an exception
- if calling this method would otherwise result in blocking.
-
- Since this method will never block, any `timeout` argument passed will
- be ignored.
- """
- del timeout
- with self._state.condition:
- if not self._is_complete():
- raise grpc.experimental.UsageError(
- "_SingleThreadedRendezvous only supports result() when the RPC is complete."
- )
- if self._state.code is grpc.StatusCode.OK:
- return self._state.response
- elif self._state.cancelled:
- raise grpc.FutureCancelledError()
- else:
- raise self
-
- def exception(self, timeout=None):
- """Return the exception raised by the computation.
-
- This method will never block. Instead, it will raise an exception
- if calling this method would otherwise result in blocking.
-
- Since this method will never block, any `timeout` argument passed will
- be ignored.
- """
- del timeout
- with self._state.condition:
- if not self._is_complete():
- raise grpc.experimental.UsageError(
- "_SingleThreadedRendezvous only supports exception() when the RPC is complete."
- )
- if self._state.code is grpc.StatusCode.OK:
- return None
- elif self._state.cancelled:
- raise grpc.FutureCancelledError()
- else:
- return self
-
- def traceback(self, timeout=None):
- """Access the traceback of the exception raised by the computation.
-
- This method will never block. Instead, it will raise an exception
- if calling this method would otherwise result in blocking.
-
- Since this method will never block, any `timeout` argument passed will
- be ignored.
- """
- del timeout
- with self._state.condition:
- if not self._is_complete():
- raise grpc.experimental.UsageError(
- "_SingleThreadedRendezvous only supports traceback() when the RPC is complete."
- )
- if self._state.code is grpc.StatusCode.OK:
- return None
- elif self._state.cancelled:
- raise grpc.FutureCancelledError()
- else:
- try:
- raise self
- except grpc.RpcError:
- return sys.exc_info()[2]
-
- def add_done_callback(self, fn):
- with self._state.condition:
- if self._state.code is None:
- self._state.callbacks.append(functools.partial(fn, self))
- return
-
- fn(self)
-
+ def _is_complete(self):
+ return self._state.code is not None
+
+ def cancelled(self):
+ with self._state.condition:
+ return self._state.cancelled
+
+ def running(self):
+ with self._state.condition:
+ return self._state.code is None
+
+ def done(self):
+ with self._state.condition:
+ return self._state.code is not None
+
+ def result(self, timeout=None):
+ """Returns the result of the computation or raises its exception.
+
+ This method will never block. Instead, it will raise an exception
+ if calling this method would otherwise result in blocking.
+
+ Since this method will never block, any `timeout` argument passed will
+ be ignored.
+ """
+ del timeout
+ with self._state.condition:
+ if not self._is_complete():
+ raise grpc.experimental.UsageError(
+ "_SingleThreadedRendezvous only supports result() when the RPC is complete."
+ )
+ if self._state.code is grpc.StatusCode.OK:
+ return self._state.response
+ elif self._state.cancelled:
+ raise grpc.FutureCancelledError()
+ else:
+ raise self
+
+ def exception(self, timeout=None):
+ """Return the exception raised by the computation.
+
+ This method will never block. Instead, it will raise an exception
+ if calling this method would otherwise result in blocking.
+
+ Since this method will never block, any `timeout` argument passed will
+ be ignored.
+ """
+ del timeout
+ with self._state.condition:
+ if not self._is_complete():
+ raise grpc.experimental.UsageError(
+ "_SingleThreadedRendezvous only supports exception() when the RPC is complete."
+ )
+ if self._state.code is grpc.StatusCode.OK:
+ return None
+ elif self._state.cancelled:
+ raise grpc.FutureCancelledError()
+ else:
+ return self
+
+ def traceback(self, timeout=None):
+ """Access the traceback of the exception raised by the computation.
+
+ This method will never block. Instead, it will raise an exception
+ if calling this method would otherwise result in blocking.
+
+ Since this method will never block, any `timeout` argument passed will
+ be ignored.
+ """
+ del timeout
+ with self._state.condition:
+ if not self._is_complete():
+ raise grpc.experimental.UsageError(
+ "_SingleThreadedRendezvous only supports traceback() when the RPC is complete."
+ )
+ if self._state.code is grpc.StatusCode.OK:
+ return None
+ elif self._state.cancelled:
+ raise grpc.FutureCancelledError()
+ else:
+ try:
+ raise self
+ except grpc.RpcError:
+ return sys.exc_info()[2]
+
+ def add_done_callback(self, fn):
+ with self._state.condition:
+ if self._state.code is None:
+ self._state.callbacks.append(functools.partial(fn, self))
+ return
+
+ fn(self)
+
def initial_metadata(self):
"""See grpc.Call.initial_metadata"""
with self._state.condition:
@@ -708,9 +708,9 @@ class _MultiThreadedRendezvous(_Rendezvous, grpc.Call, grpc.Future): # pylint:
See grpc.Future.result for the full API contract.
"""
with self._state.condition:
- timed_out = _common.wait(self._state.condition.wait,
- self._is_complete,
- timeout=timeout)
+ timed_out = _common.wait(self._state.condition.wait,
+ self._is_complete,
+ timeout=timeout)
if timed_out:
raise grpc.FutureTimeoutError()
else:
@@ -727,9 +727,9 @@ class _MultiThreadedRendezvous(_Rendezvous, grpc.Call, grpc.Future): # pylint:
See grpc.Future.exception for the full API contract.
"""
with self._state.condition:
- timed_out = _common.wait(self._state.condition.wait,
- self._is_complete,
- timeout=timeout)
+ timed_out = _common.wait(self._state.condition.wait,
+ self._is_complete,
+ timeout=timeout)
if timed_out:
raise grpc.FutureTimeoutError()
else:
@@ -746,9 +746,9 @@ class _MultiThreadedRendezvous(_Rendezvous, grpc.Call, grpc.Future): # pylint:
See grpc.future.traceback for the full API contract.
"""
with self._state.condition:
- timed_out = _common.wait(self._state.condition.wait,
- self._is_complete,
- timeout=timeout)
+ timed_out = _common.wait(self._state.condition.wait,
+ self._is_complete,
+ timeout=timeout)
if timed_out:
raise grpc.FutureTimeoutError()
else:
@@ -843,8 +843,8 @@ def _stream_unary_invocation_operationses_and_tags(metadata,
return tuple((
operations,
None,
- ) for operations in _stream_unary_invocation_operationses(
- metadata, initial_metadata_flags))
+ ) for operations in _stream_unary_invocation_operationses(
+ metadata, initial_metadata_flags))
def _determine_deadline(user_deadline):
@@ -948,12 +948,12 @@ class _UnaryUnaryMultiCallable(grpc.UnaryUnaryMultiCallable):
event_handler = _event_handler(state, self._response_deserializer)
call = self._managed_call(
cygrpc.PropagationConstants.GRPC_PROPAGATE_DEFAULTS,
- self._method, None, deadline, metadata,
- None if credentials is None else credentials._credentials,
+ self._method, None, deadline, metadata,
+ None if credentials is None else credentials._credentials,
(operations,), event_handler, self._context)
- return _MultiThreadedRendezvous(state, call,
- self._response_deserializer,
- deadline)
+ return _MultiThreadedRendezvous(state, call,
+ self._response_deserializer,
+ deadline)
class _SingleThreadedUnaryStreamMultiCallable(grpc.UnaryStreamMultiCallable):
@@ -1050,13 +1050,13 @@ class _UnaryStreamMultiCallable(grpc.UnaryStreamMultiCallable):
call = self._managed_call(
cygrpc.PropagationConstants.GRPC_PROPAGATE_DEFAULTS,
self._method, None, _determine_deadline(deadline), metadata,
- None if credentials is None else credentials._credentials,
- operationses, _event_handler(state,
- self._response_deserializer),
- self._context)
- return _MultiThreadedRendezvous(state, call,
- self._response_deserializer,
- deadline)
+ None if credentials is None else credentials._credentials,
+ operationses, _event_handler(state,
+ self._response_deserializer),
+ self._context)
+ return _MultiThreadedRendezvous(state, call,
+ self._response_deserializer,
+ deadline)
class _StreamUnaryMultiCallable(grpc.StreamUnaryMultiCallable):
@@ -1081,8 +1081,8 @@ class _StreamUnaryMultiCallable(grpc.StreamUnaryMultiCallable):
metadata, compression)
call = self._channel.segregated_call(
cygrpc.PropagationConstants.GRPC_PROPAGATE_DEFAULTS, self._method,
- None, _determine_deadline(deadline), augmented_metadata,
- None if credentials is None else credentials._credentials,
+ None, _determine_deadline(deadline), augmented_metadata,
+ None if credentials is None else credentials._credentials,
_stream_unary_invocation_operationses_and_tags(
augmented_metadata, initial_metadata_flags), self._context)
_consume_request_iterator(request_iterator, state, call,
@@ -1134,11 +1134,11 @@ class _StreamUnaryMultiCallable(grpc.StreamUnaryMultiCallable):
metadata, compression)
call = self._managed_call(
cygrpc.PropagationConstants.GRPC_PROPAGATE_DEFAULTS, self._method,
- None, deadline, augmented_metadata,
- None if credentials is None else credentials._credentials,
- _stream_unary_invocation_operationses(metadata,
- initial_metadata_flags),
- event_handler, self._context)
+ None, deadline, augmented_metadata,
+ None if credentials is None else credentials._credentials,
+ _stream_unary_invocation_operationses(metadata,
+ initial_metadata_flags),
+ event_handler, self._context)
_consume_request_iterator(request_iterator, state, call,
self._request_serializer, event_handler)
return _MultiThreadedRendezvous(state, call,
@@ -1181,9 +1181,9 @@ class _StreamStreamMultiCallable(grpc.StreamStreamMultiCallable):
event_handler = _event_handler(state, self._response_deserializer)
call = self._managed_call(
cygrpc.PropagationConstants.GRPC_PROPAGATE_DEFAULTS, self._method,
- None, _determine_deadline(deadline), augmented_metadata,
- None if credentials is None else credentials._credentials,
- operationses, event_handler, self._context)
+ None, _determine_deadline(deadline), augmented_metadata,
+ None if credentials is None else credentials._credentials,
+ operationses, event_handler, self._context)
_consume_request_iterator(request_iterator, state, call,
self._request_serializer, event_handler)
return _MultiThreadedRendezvous(state, call,
@@ -1219,14 +1219,14 @@ class _ChannelCallState(object):
def reset_postfork_child(self):
self.managed_calls = 0
- def __del__(self):
- try:
- self.channel.close(cygrpc.StatusCode.cancelled,
- 'Channel deallocated!')
- except (TypeError, AttributeError):
- pass
+ def __del__(self):
+ try:
+ self.channel.close(cygrpc.StatusCode.cancelled,
+ 'Channel deallocated!')
+ except (TypeError, AttributeError):
+ pass
+
-
def _run_channel_spin_thread(state):
def channel_spin():
@@ -1338,13 +1338,13 @@ def _deliver(state, initial_connectivity, initial_callbacks):
def _spawn_delivery(state, callbacks):
- delivering_thread = cygrpc.ForkManagedThread(target=_deliver,
- args=(
- state,
- state.connectivity,
- callbacks,
- ))
- delivering_thread.setDaemon(True)
+ delivering_thread = cygrpc.ForkManagedThread(target=_deliver,
+ args=(
+ state,
+ state.connectivity,
+ callbacks,
+ ))
+ delivering_thread.setDaemon(True)
delivering_thread.start()
state.delivering = True
@@ -1355,11 +1355,11 @@ def _poll_connectivity(state, channel, initial_try_to_connect):
connectivity = channel.check_connectivity_state(try_to_connect)
with state.lock:
state.connectivity = (
- _common.
- CYGRPC_CONNECTIVITY_STATE_TO_CHANNEL_CONNECTIVITY[connectivity])
- callbacks = tuple(
- callback for callback, unused_but_known_to_be_none_connectivity in
- state.callbacks_and_connectivities)
+ _common.
+ CYGRPC_CONNECTIVITY_STATE_TO_CHANNEL_CONNECTIVITY[connectivity])
+ callbacks = tuple(
+ callback for callback, unused_but_known_to_be_none_connectivity in
+ state.callbacks_and_connectivities)
for callback_and_connectivity in state.callbacks_and_connectivities:
callback_and_connectivity[1] = state.connectivity
if callbacks:
@@ -1492,11 +1492,11 @@ class Channel(grpc.Channel):
self._channel, _common.encode(method), request_serializer,
response_deserializer)
else:
- return _UnaryStreamMultiCallable(
- self._channel,
- _channel_managed_call_management(self._call_state),
- _common.encode(method), request_serializer,
- response_deserializer)
+ return _UnaryStreamMultiCallable(
+ self._channel,
+ _channel_managed_call_management(self._call_state),
+ _common.encode(method), request_serializer,
+ response_deserializer)
def stream_unary(self,
method,
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/_common.py b/contrib/libs/grpc/src/python/grpcio/grpc/_common.py
index 4547a0fe17a..128124c3256 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/_common.py
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/_common.py
@@ -24,15 +24,15 @@ _LOGGER = logging.getLogger(__name__)
CYGRPC_CONNECTIVITY_STATE_TO_CHANNEL_CONNECTIVITY = {
cygrpc.ConnectivityState.idle:
- grpc.ChannelConnectivity.IDLE,
+ grpc.ChannelConnectivity.IDLE,
cygrpc.ConnectivityState.connecting:
- grpc.ChannelConnectivity.CONNECTING,
+ grpc.ChannelConnectivity.CONNECTING,
cygrpc.ConnectivityState.ready:
- grpc.ChannelConnectivity.READY,
+ grpc.ChannelConnectivity.READY,
cygrpc.ConnectivityState.transient_failure:
- grpc.ChannelConnectivity.TRANSIENT_FAILURE,
+ grpc.ChannelConnectivity.TRANSIENT_FAILURE,
cygrpc.ConnectivityState.shutdown:
- grpc.ChannelConnectivity.SHUTDOWN,
+ grpc.ChannelConnectivity.SHUTDOWN,
}
CYGRPC_STATUS_CODE_TO_STATUS_CODE = {
@@ -55,16 +55,16 @@ CYGRPC_STATUS_CODE_TO_STATUS_CODE = {
cygrpc.StatusCode.data_loss: grpc.StatusCode.DATA_LOSS,
}
STATUS_CODE_TO_CYGRPC_STATUS_CODE = {
- grpc_code: cygrpc_code for cygrpc_code, grpc_code in six.iteritems(
+ grpc_code: cygrpc_code for cygrpc_code, grpc_code in six.iteritems(
CYGRPC_STATUS_CODE_TO_STATUS_CODE)
}
MAXIMUM_WAIT_TIMEOUT = 0.1
-_ERROR_MESSAGE_PORT_BINDING_FAILED = 'Failed to bind to address %s; set ' \
- 'GRPC_VERBOSITY=debug environment variable to see detailed error message.'
+_ERROR_MESSAGE_PORT_BINDING_FAILED = 'Failed to bind to address %s; set ' \
+ 'GRPC_VERBOSITY=debug environment variable to see detailed error message.'
+
-
def encode(s):
if isinstance(s, bytes):
return s
@@ -147,22 +147,22 @@ def wait(wait_fn, wait_complete_fn, timeout=None, spin_cb=None):
return True
_wait_once(wait_fn, remaining, spin_cb)
return False
-
-
-def validate_port_binding_result(address, port):
- """Validates if the port binding succeed.
-
- If the port returned by Core is 0, the binding is failed. However, in that
- case, the Core API doesn't return a detailed failing reason. The best we
- can do is raising an exception to prevent further confusion.
-
- Args:
- address: The address string to be bound.
- port: An int returned by core
- """
- if port == 0:
- # The Core API doesn't return a failure message. The best we can do
- # is raising an exception to prevent further confusion.
- raise RuntimeError(_ERROR_MESSAGE_PORT_BINDING_FAILED % address)
- else:
- return port
+
+
+def validate_port_binding_result(address, port):
+ """Validates if the port binding succeed.
+
+ If the port returned by Core is 0, the binding is failed. However, in that
+ case, the Core API doesn't return a detailed failing reason. The best we
+ can do is raising an exception to prevent further confusion.
+
+ Args:
+ address: The address string to be bound.
+ port: An int returned by core
+ """
+ if port == 0:
+ # The Core API doesn't return a failure message. The best we can do
+ # is raising an exception to prevent further confusion.
+ raise RuntimeError(_ERROR_MESSAGE_PORT_BINDING_FAILED % address)
+ else:
+ return port
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/call.pxd.pxi b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/call.pxd.pxi
index dc9ecd7a62d..867245a6944 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/call.pxd.pxi
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/call.pxd.pxi
@@ -13,35 +13,35 @@
# limitations under the License.
-cdef class _AioCall(GrpcCallWrapper):
+cdef class _AioCall(GrpcCallWrapper):
cdef:
- readonly AioChannel _channel
+ readonly AioChannel _channel
list _references
- object _deadline
- list _done_callbacks
-
- # Caches the picked event loop, so we can avoid the 30ns overhead each
- # time we need access to the event loop.
- object _loop
+ object _deadline
+ list _done_callbacks
- # Flag indicates whether cancel being called or not. Cancellation from
- # Core or peer works perfectly fine with normal procedure. However, we
- # need this flag to clean up resources for cancellation from the
- # application layer. Directly cancelling tasks might cause segfault
- # because Core is holding a pointer for the callback handler.
- bint _is_locally_cancelled
-
- # Following attributes are used for storing the status of the call and
- # the initial metadata. Waiters are used for pausing the execution of
- # tasks that are asking for one of the field when they are not yet
- # available.
- readonly AioRpcStatus _status
- readonly tuple _initial_metadata
- list _waiters_status
- list _waiters_initial_metadata
-
- int _send_initial_metadata_flags
-
- cdef void _create_grpc_call(self, object timeout, bytes method, CallCredentials credentials) except *
- cdef void _set_status(self, AioRpcStatus status) except *
- cdef void _set_initial_metadata(self, tuple initial_metadata) except *
+ # Caches the picked event loop, so we can avoid the 30ns overhead each
+ # time we need access to the event loop.
+ object _loop
+
+ # Flag indicates whether cancel being called or not. Cancellation from
+ # Core or peer works perfectly fine with normal procedure. However, we
+ # need this flag to clean up resources for cancellation from the
+ # application layer. Directly cancelling tasks might cause segfault
+ # because Core is holding a pointer for the callback handler.
+ bint _is_locally_cancelled
+
+ # Following attributes are used for storing the status of the call and
+ # the initial metadata. Waiters are used for pausing the execution of
+ # tasks that are asking for one of the field when they are not yet
+ # available.
+ readonly AioRpcStatus _status
+ readonly tuple _initial_metadata
+ list _waiters_status
+ list _waiters_initial_metadata
+
+ int _send_initial_metadata_flags
+
+ cdef void _create_grpc_call(self, object timeout, bytes method, CallCredentials credentials) except *
+ cdef void _set_status(self, AioRpcStatus status) except *
+ cdef void _set_initial_metadata(self, tuple initial_metadata) except *
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/call.pyx.pxi b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/call.pyx.pxi
index d09569dd1a7..10c024e1b39 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/call.pyx.pxi
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/call.pyx.pxi
@@ -15,493 +15,493 @@
_EMPTY_FLAGS = 0
_EMPTY_MASK = 0
-_IMMUTABLE_EMPTY_METADATA = tuple()
-
-_UNKNOWN_CANCELLATION_DETAILS = 'RPC cancelled for unknown reason.'
-_OK_CALL_REPRESENTATION = ('<{} of RPC that terminated with:\n'
- '\tstatus = {}\n'
- '\tdetails = "{}"\n'
- '>')
-
-_NON_OK_CALL_REPRESENTATION = ('<{} of RPC that terminated with:\n'
- '\tstatus = {}\n'
- '\tdetails = "{}"\n'
- '\tdebug_error_string = "{}"\n'
- '>')
-
-
-cdef int _get_send_initial_metadata_flags(object wait_for_ready) except *:
- cdef int flags = 0
- # Wait-for-ready can be None, which means using default value in Core.
- if wait_for_ready is not None:
- flags |= InitialMetadataFlags.wait_for_ready_explicitly_set
- if wait_for_ready:
- flags |= InitialMetadataFlags.wait_for_ready
-
- flags &= InitialMetadataFlags.used_mask
- return flags
-
-
-cdef class _AioCall(GrpcCallWrapper):
-
- def __cinit__(self, AioChannel channel, object deadline,
- bytes method, CallCredentials call_credentials, object wait_for_ready):
- init_grpc_aio()
- self.call = NULL
+_IMMUTABLE_EMPTY_METADATA = tuple()
+
+_UNKNOWN_CANCELLATION_DETAILS = 'RPC cancelled for unknown reason.'
+_OK_CALL_REPRESENTATION = ('<{} of RPC that terminated with:\n'
+ '\tstatus = {}\n'
+ '\tdetails = "{}"\n'
+ '>')
+
+_NON_OK_CALL_REPRESENTATION = ('<{} of RPC that terminated with:\n'
+ '\tstatus = {}\n'
+ '\tdetails = "{}"\n'
+ '\tdebug_error_string = "{}"\n'
+ '>')
+
+
+cdef int _get_send_initial_metadata_flags(object wait_for_ready) except *:
+ cdef int flags = 0
+ # Wait-for-ready can be None, which means using default value in Core.
+ if wait_for_ready is not None:
+ flags |= InitialMetadataFlags.wait_for_ready_explicitly_set
+ if wait_for_ready:
+ flags |= InitialMetadataFlags.wait_for_ready
+
+ flags &= InitialMetadataFlags.used_mask
+ return flags
+
+
+cdef class _AioCall(GrpcCallWrapper):
+
+ def __cinit__(self, AioChannel channel, object deadline,
+ bytes method, CallCredentials call_credentials, object wait_for_ready):
+ init_grpc_aio()
+ self.call = NULL
self._channel = channel
- self._loop = channel.loop
+ self._loop = channel.loop
self._references = []
- self._status = None
- self._initial_metadata = None
- self._waiters_status = []
- self._waiters_initial_metadata = []
- self._done_callbacks = []
- self._is_locally_cancelled = False
- self._deadline = deadline
- self._send_initial_metadata_flags = _get_send_initial_metadata_flags(wait_for_ready)
- self._create_grpc_call(deadline, method, call_credentials)
-
- def __dealloc__(self):
- if self.call:
- grpc_call_unref(self.call)
- shutdown_grpc_aio()
-
- def _repr(self) -> str:
- """Assembles the RPC representation string."""
- # This needs to be loaded at run time once everything
- # has been loaded.
- from grpc import _common
-
- if not self.done():
- return '<{} object>'.format(self.__class__.__name__)
-
- if self._status.code() is StatusCode.ok:
- return _OK_CALL_REPRESENTATION.format(
- self.__class__.__name__,
- _common.CYGRPC_STATUS_CODE_TO_STATUS_CODE[self._status.code()],
- self._status.details())
- else:
- return _NON_OK_CALL_REPRESENTATION.format(
- self.__class__.__name__,
- self._status.details(),
- _common.CYGRPC_STATUS_CODE_TO_STATUS_CODE[self._status.code()],
- self._status.debug_error_string())
-
- def __repr__(self) -> str:
- return self._repr()
-
- def __str__(self) -> str:
- return self._repr()
-
- cdef void _create_grpc_call(self,
- object deadline,
- bytes method,
- CallCredentials credentials) except *:
+ self._status = None
+ self._initial_metadata = None
+ self._waiters_status = []
+ self._waiters_initial_metadata = []
+ self._done_callbacks = []
+ self._is_locally_cancelled = False
+ self._deadline = deadline
+ self._send_initial_metadata_flags = _get_send_initial_metadata_flags(wait_for_ready)
+ self._create_grpc_call(deadline, method, call_credentials)
+
+ def __dealloc__(self):
+ if self.call:
+ grpc_call_unref(self.call)
+ shutdown_grpc_aio()
+
+ def _repr(self) -> str:
+ """Assembles the RPC representation string."""
+ # This needs to be loaded at run time once everything
+ # has been loaded.
+ from grpc import _common
+
+ if not self.done():
+ return '<{} object>'.format(self.__class__.__name__)
+
+ if self._status.code() is StatusCode.ok:
+ return _OK_CALL_REPRESENTATION.format(
+ self.__class__.__name__,
+ _common.CYGRPC_STATUS_CODE_TO_STATUS_CODE[self._status.code()],
+ self._status.details())
+ else:
+ return _NON_OK_CALL_REPRESENTATION.format(
+ self.__class__.__name__,
+ self._status.details(),
+ _common.CYGRPC_STATUS_CODE_TO_STATUS_CODE[self._status.code()],
+ self._status.debug_error_string())
+
+ def __repr__(self) -> str:
+ return self._repr()
+
+ def __str__(self) -> str:
+ return self._repr()
+
+ cdef void _create_grpc_call(self,
+ object deadline,
+ bytes method,
+ CallCredentials credentials) except *:
"""Creates the corresponding Core object for this RPC.
- For unary calls, the grpc_call lives shortly and can be destroyed after
+ For unary calls, the grpc_call lives shortly and can be destroyed after
invoke start_batch. However, if either side is streaming, the grpc_call
life span will be longer than one function. So, it would better save it
as an instance variable than a stack variable, which reflects its
nature in Core.
"""
cdef grpc_slice method_slice
- cdef gpr_timespec c_deadline = _timespec_from_time(deadline)
- cdef grpc_call_error set_credentials_error
+ cdef gpr_timespec c_deadline = _timespec_from_time(deadline)
+ cdef grpc_call_error set_credentials_error
method_slice = grpc_slice_from_copied_buffer(
<const char *> method,
<size_t> len(method)
)
- self.call = grpc_channel_create_call(
+ self.call = grpc_channel_create_call(
self._channel.channel,
NULL,
_EMPTY_MASK,
- global_completion_queue(),
+ global_completion_queue(),
method_slice,
NULL,
- c_deadline,
+ c_deadline,
NULL
)
-
- if credentials is not None:
- set_credentials_error = grpc_call_set_credentials(self.call, credentials.c())
- if set_credentials_error != GRPC_CALL_OK:
- raise InternalError("Credentials couldn't have been set: {0}".format(set_credentials_error))
-
+
+ if credentials is not None:
+ set_credentials_error = grpc_call_set_credentials(self.call, credentials.c())
+ if set_credentials_error != GRPC_CALL_OK:
+ raise InternalError("Credentials couldn't have been set: {0}".format(set_credentials_error))
+
grpc_slice_unref(method_slice)
- cdef void _set_status(self, AioRpcStatus status) except *:
- cdef list waiters
-
- self._status = status
-
- if self._initial_metadata is None:
- self._set_initial_metadata(_IMMUTABLE_EMPTY_METADATA)
-
- # No more waiters should be expected since status
- # has been set.
- waiters = self._waiters_status
- self._waiters_status = None
-
- for waiter in waiters:
- if not waiter.done():
- waiter.set_result(None)
-
- for callback in self._done_callbacks:
- callback()
-
- cdef void _set_initial_metadata(self, tuple initial_metadata) except *:
- cdef list waiters
-
- self._initial_metadata = initial_metadata
-
- # No more waiters should be expected since initial metadata
- # has been set.
- waiters = self._waiters_initial_metadata
- self._waiters_initial_metadata = None
-
- for waiter in waiters:
- if not waiter.done():
- waiter.set_result(None)
-
-
- def add_done_callback(self, callback):
- if self.done():
- callback()
- else:
- self._done_callbacks.append(callback)
-
- def time_remaining(self):
- if self._deadline is None:
- return None
- else:
- return max(0, self._deadline - time.time())
-
- def cancel(self, str details):
- """Cancels the RPC in Core with given RPC status.
-
- Above abstractions must invoke this method to set Core objects into
- proper state.
- """
- self._is_locally_cancelled = True
-
- cdef object details_bytes
- cdef char *c_details
- cdef grpc_call_error error
-
- self._set_status(AioRpcStatus(
- StatusCode.cancelled,
- details,
- None,
- None,
- ))
-
- details_bytes = str_to_bytes(details)
- self._references.append(details_bytes)
- c_details = <char *>details_bytes
- # By implementation, grpc_call_cancel_with_status always return OK
- error = grpc_call_cancel_with_status(
- self.call,
- StatusCode.cancelled,
- c_details,
- NULL,
- )
- assert error == GRPC_CALL_OK
-
- def done(self):
- """Returns if the RPC call has finished.
-
- Checks if the status has been provided, either
- because the RPC finished or because was cancelled..
-
- Returns:
- True if the RPC can be considered finished.
- """
- return self._status is not None
-
- def cancelled(self):
- """Returns if the RPC was cancelled.
-
- Returns:
- True if the RPC was cancelled.
- """
- if not self.done():
- return False
-
- return self._status.code() == StatusCode.cancelled
-
- async def status(self):
- """Returns the status of the RPC call.
-
- It returns the finshed status of the RPC. If the RPC
- has not finished yet this function will wait until the RPC
- gets finished.
-
- Returns:
- Finished status of the RPC as an AioRpcStatus object.
- """
- if self._status is not None:
- return self._status
-
- future = self._loop.create_future()
- self._waiters_status.append(future)
- await future
-
- return self._status
-
- def is_ok(self):
- """Returns if the RPC is ended with ok."""
- return self.done() and self._status.code() == StatusCode.ok
-
- async def initial_metadata(self):
- """Returns the initial metadata of the RPC call.
-
- If the initial metadata has not been received yet this function will
- wait until the RPC gets finished.
-
- Returns:
- The tuple object with the initial metadata.
- """
- if self._initial_metadata is not None:
- return self._initial_metadata
-
- future = self._loop.create_future()
- self._waiters_initial_metadata.append(future)
- await future
-
- return self._initial_metadata
-
- def is_locally_cancelled(self):
- """Returns if the RPC was cancelled locally.
-
- Returns:
- True when was cancelled locally, False when was cancelled remotelly or
- is still ongoing.
- """
- if self._is_locally_cancelled:
- return True
-
- return False
-
- async def unary_unary(self,
- bytes request,
- tuple outbound_initial_metadata):
- """Performs a unary unary RPC.
-
- Args:
- request: the serialized requests in bytes.
- outbound_initial_metadata: optional outbound metadata.
- """
- cdef tuple ops
-
- cdef SendInitialMetadataOperation initial_metadata_op = SendInitialMetadataOperation(
- outbound_initial_metadata,
- self._send_initial_metadata_flags)
- cdef SendMessageOperation send_message_op = SendMessageOperation(request, _EMPTY_FLAGS)
- cdef SendCloseFromClientOperation send_close_op = SendCloseFromClientOperation(_EMPTY_FLAGS)
- cdef ReceiveInitialMetadataOperation receive_initial_metadata_op = ReceiveInitialMetadataOperation(_EMPTY_FLAGS)
- cdef ReceiveMessageOperation receive_message_op = ReceiveMessageOperation(_EMPTY_FLAGS)
- cdef ReceiveStatusOnClientOperation receive_status_on_client_op = ReceiveStatusOnClientOperation(_EMPTY_FLAGS)
-
- ops = (initial_metadata_op, send_message_op, send_close_op,
- receive_initial_metadata_op, receive_message_op,
- receive_status_on_client_op)
-
- # Executes all operations in one batch.
- # Might raise CancelledError, handling it in Python UnaryUnaryCall.
- await execute_batch(self,
- ops,
- self._loop)
-
- self._set_initial_metadata(receive_initial_metadata_op.initial_metadata())
-
- cdef grpc_status_code code
- code = receive_status_on_client_op.code()
-
- self._set_status(AioRpcStatus(
- code,
- receive_status_on_client_op.details(),
- receive_status_on_client_op.trailing_metadata(),
- receive_status_on_client_op.error_string(),
- ))
-
- if code == StatusCode.ok:
- return receive_message_op.message()
- else:
- return None
-
- async def _handle_status_once_received(self):
- """Handles the status sent by peer once received."""
- cdef ReceiveStatusOnClientOperation op = ReceiveStatusOnClientOperation(_EMPTY_FLAGS)
- cdef tuple ops = (op,)
- await execute_batch(self, ops, self._loop)
-
- # Halts if the RPC is locally cancelled
- if self._is_locally_cancelled:
- return
-
- self._set_status(AioRpcStatus(
- op.code(),
- op.details(),
- op.trailing_metadata(),
- op.error_string(),
- ))
-
- async def receive_serialized_message(self):
- """Receives one single raw message in bytes."""
- cdef bytes received_message
-
- # Receives a message. Returns None when failed:
- # * EOF, no more messages to read;
- # * The client application cancels;
- # * The server sends final status.
- received_message = await _receive_message(
- self,
- self._loop
- )
- if received_message:
- return received_message
- else:
- return EOF
-
- async def send_serialized_message(self, bytes message):
- """Sends one single raw message in bytes."""
- await _send_message(self,
- message,
- None,
- False,
- self._loop)
-
- async def send_receive_close(self):
- """Half close the RPC on the client-side."""
- cdef SendCloseFromClientOperation op = SendCloseFromClientOperation(_EMPTY_FLAGS)
- cdef tuple ops = (op,)
- await execute_batch(self, ops, self._loop)
-
- async def initiate_unary_stream(self,
- bytes request,
- tuple outbound_initial_metadata):
- """Implementation of the start of a unary-stream call."""
- # Peer may prematurely end this RPC at any point. We need a corutine
- # that watches if the server sends the final status.
- status_task = self._loop.create_task(self._handle_status_once_received())
-
- cdef tuple outbound_ops
- cdef Operation initial_metadata_op = SendInitialMetadataOperation(
- outbound_initial_metadata,
- self._send_initial_metadata_flags)
- cdef Operation send_message_op = SendMessageOperation(
- request,
- _EMPTY_FLAGS)
- cdef Operation send_close_op = SendCloseFromClientOperation(
- _EMPTY_FLAGS)
-
- outbound_ops = (
- initial_metadata_op,
- send_message_op,
- send_close_op,
+ cdef void _set_status(self, AioRpcStatus status) except *:
+ cdef list waiters
+
+ self._status = status
+
+ if self._initial_metadata is None:
+ self._set_initial_metadata(_IMMUTABLE_EMPTY_METADATA)
+
+ # No more waiters should be expected since status
+ # has been set.
+ waiters = self._waiters_status
+ self._waiters_status = None
+
+ for waiter in waiters:
+ if not waiter.done():
+ waiter.set_result(None)
+
+ for callback in self._done_callbacks:
+ callback()
+
+ cdef void _set_initial_metadata(self, tuple initial_metadata) except *:
+ cdef list waiters
+
+ self._initial_metadata = initial_metadata
+
+ # No more waiters should be expected since initial metadata
+ # has been set.
+ waiters = self._waiters_initial_metadata
+ self._waiters_initial_metadata = None
+
+ for waiter in waiters:
+ if not waiter.done():
+ waiter.set_result(None)
+
+
+ def add_done_callback(self, callback):
+ if self.done():
+ callback()
+ else:
+ self._done_callbacks.append(callback)
+
+ def time_remaining(self):
+ if self._deadline is None:
+ return None
+ else:
+ return max(0, self._deadline - time.time())
+
+ def cancel(self, str details):
+ """Cancels the RPC in Core with given RPC status.
+
+ Above abstractions must invoke this method to set Core objects into
+ proper state.
+ """
+ self._is_locally_cancelled = True
+
+ cdef object details_bytes
+ cdef char *c_details
+ cdef grpc_call_error error
+
+ self._set_status(AioRpcStatus(
+ StatusCode.cancelled,
+ details,
+ None,
+ None,
+ ))
+
+ details_bytes = str_to_bytes(details)
+ self._references.append(details_bytes)
+ c_details = <char *>details_bytes
+ # By implementation, grpc_call_cancel_with_status always return OK
+ error = grpc_call_cancel_with_status(
+ self.call,
+ StatusCode.cancelled,
+ c_details,
+ NULL,
)
-
- try:
- # Sends out the request message.
- await execute_batch(self,
- outbound_ops,
- self._loop)
-
- # Receives initial metadata.
- self._set_initial_metadata(
- await _receive_initial_metadata(self,
- self._loop),
- )
- except ExecuteBatchError as batch_error:
- # Core should explain why this batch failed
- await status_task
-
- async def stream_unary(self,
- tuple outbound_initial_metadata,
- object metadata_sent_observer):
- """Actual implementation of the complete unary-stream call.
-
- Needs to pay extra attention to the raise mechanism. If we want to
- propagate the final status exception, then we have to raise it.
- Othersize, it would end normally and raise `StopAsyncIteration()`.
- """
- try:
- # Sends out initial_metadata ASAP.
- await _send_initial_metadata(self,
- outbound_initial_metadata,
- self._send_initial_metadata_flags,
- self._loop)
- # Notify upper level that sending messages are allowed now.
- metadata_sent_observer()
-
- # Receives initial metadata.
- self._set_initial_metadata(
- await _receive_initial_metadata(self, self._loop)
- )
- except ExecuteBatchError:
- # Core should explain why this batch failed
- await self._handle_status_once_received()
-
- # Allow upper layer to proceed only if the status is set
- metadata_sent_observer()
- return None
-
- cdef tuple inbound_ops
- cdef ReceiveMessageOperation receive_message_op = ReceiveMessageOperation(_EMPTY_FLAGS)
- cdef ReceiveStatusOnClientOperation receive_status_on_client_op = ReceiveStatusOnClientOperation(_EMPTY_FLAGS)
- inbound_ops = (receive_message_op, receive_status_on_client_op)
-
- # Executes all operations in one batch.
- await execute_batch(self,
- inbound_ops,
- self._loop)
-
- cdef grpc_status_code code
- code = receive_status_on_client_op.code()
-
- self._set_status(AioRpcStatus(
- code,
- receive_status_on_client_op.details(),
- receive_status_on_client_op.trailing_metadata(),
- receive_status_on_client_op.error_string(),
- ))
-
- if code == StatusCode.ok:
- return receive_message_op.message()
- else:
- return None
-
- async def initiate_stream_stream(self,
- tuple outbound_initial_metadata,
- object metadata_sent_observer):
- """Actual implementation of the complete stream-stream call.
-
- Needs to pay extra attention to the raise mechanism. If we want to
- propagate the final status exception, then we have to raise it.
- Othersize, it would end normally and raise `StopAsyncIteration()`.
- """
- # Peer may prematurely end this RPC at any point. We need a corutine
- # that watches if the server sends the final status.
- status_task = self._loop.create_task(self._handle_status_once_received())
-
- try:
- # Sends out initial_metadata ASAP.
- await _send_initial_metadata(self,
- outbound_initial_metadata,
- self._send_initial_metadata_flags,
- self._loop)
- # Notify upper level that sending messages are allowed now.
- metadata_sent_observer()
-
- # Receives initial metadata.
- self._set_initial_metadata(
- await _receive_initial_metadata(self, self._loop)
- )
- except ExecuteBatchError as batch_error:
- # Core should explain why this batch failed
- await status_task
-
- # Allow upper layer to proceed only if the status is set
- metadata_sent_observer()
+ assert error == GRPC_CALL_OK
+
+ def done(self):
+ """Returns if the RPC call has finished.
+
+ Checks if the status has been provided, either
+ because the RPC finished or because was cancelled..
+
+ Returns:
+ True if the RPC can be considered finished.
+ """
+ return self._status is not None
+
+ def cancelled(self):
+ """Returns if the RPC was cancelled.
+
+ Returns:
+ True if the RPC was cancelled.
+ """
+ if not self.done():
+ return False
+
+ return self._status.code() == StatusCode.cancelled
+
+ async def status(self):
+ """Returns the status of the RPC call.
+
+ It returns the finshed status of the RPC. If the RPC
+ has not finished yet this function will wait until the RPC
+ gets finished.
+
+ Returns:
+ Finished status of the RPC as an AioRpcStatus object.
+ """
+ if self._status is not None:
+ return self._status
+
+ future = self._loop.create_future()
+ self._waiters_status.append(future)
+ await future
+
+ return self._status
+
+ def is_ok(self):
+ """Returns if the RPC is ended with ok."""
+ return self.done() and self._status.code() == StatusCode.ok
+
+ async def initial_metadata(self):
+ """Returns the initial metadata of the RPC call.
+
+ If the initial metadata has not been received yet this function will
+ wait until the RPC gets finished.
+
+ Returns:
+ The tuple object with the initial metadata.
+ """
+ if self._initial_metadata is not None:
+ return self._initial_metadata
+
+ future = self._loop.create_future()
+ self._waiters_initial_metadata.append(future)
+ await future
+
+ return self._initial_metadata
+
+ def is_locally_cancelled(self):
+ """Returns if the RPC was cancelled locally.
+
+ Returns:
+ True when was cancelled locally, False when was cancelled remotelly or
+ is still ongoing.
+ """
+ if self._is_locally_cancelled:
+ return True
+
+ return False
+
+ async def unary_unary(self,
+ bytes request,
+ tuple outbound_initial_metadata):
+ """Performs a unary unary RPC.
+
+ Args:
+ request: the serialized requests in bytes.
+ outbound_initial_metadata: optional outbound metadata.
+ """
+ cdef tuple ops
+
+ cdef SendInitialMetadataOperation initial_metadata_op = SendInitialMetadataOperation(
+ outbound_initial_metadata,
+ self._send_initial_metadata_flags)
+ cdef SendMessageOperation send_message_op = SendMessageOperation(request, _EMPTY_FLAGS)
+ cdef SendCloseFromClientOperation send_close_op = SendCloseFromClientOperation(_EMPTY_FLAGS)
+ cdef ReceiveInitialMetadataOperation receive_initial_metadata_op = ReceiveInitialMetadataOperation(_EMPTY_FLAGS)
+ cdef ReceiveMessageOperation receive_message_op = ReceiveMessageOperation(_EMPTY_FLAGS)
+ cdef ReceiveStatusOnClientOperation receive_status_on_client_op = ReceiveStatusOnClientOperation(_EMPTY_FLAGS)
+
+ ops = (initial_metadata_op, send_message_op, send_close_op,
+ receive_initial_metadata_op, receive_message_op,
+ receive_status_on_client_op)
+
+ # Executes all operations in one batch.
+ # Might raise CancelledError, handling it in Python UnaryUnaryCall.
+ await execute_batch(self,
+ ops,
+ self._loop)
+
+ self._set_initial_metadata(receive_initial_metadata_op.initial_metadata())
+
+ cdef grpc_status_code code
+ code = receive_status_on_client_op.code()
+
+ self._set_status(AioRpcStatus(
+ code,
+ receive_status_on_client_op.details(),
+ receive_status_on_client_op.trailing_metadata(),
+ receive_status_on_client_op.error_string(),
+ ))
+
+ if code == StatusCode.ok:
+ return receive_message_op.message()
+ else:
+ return None
+
+ async def _handle_status_once_received(self):
+ """Handles the status sent by peer once received."""
+ cdef ReceiveStatusOnClientOperation op = ReceiveStatusOnClientOperation(_EMPTY_FLAGS)
+ cdef tuple ops = (op,)
+ await execute_batch(self, ops, self._loop)
+
+ # Halts if the RPC is locally cancelled
+ if self._is_locally_cancelled:
+ return
+
+ self._set_status(AioRpcStatus(
+ op.code(),
+ op.details(),
+ op.trailing_metadata(),
+ op.error_string(),
+ ))
+
+ async def receive_serialized_message(self):
+ """Receives one single raw message in bytes."""
+ cdef bytes received_message
+
+ # Receives a message. Returns None when failed:
+ # * EOF, no more messages to read;
+ # * The client application cancels;
+ # * The server sends final status.
+ received_message = await _receive_message(
+ self,
+ self._loop
+ )
+ if received_message:
+ return received_message
+ else:
+ return EOF
+
+ async def send_serialized_message(self, bytes message):
+ """Sends one single raw message in bytes."""
+ await _send_message(self,
+ message,
+ None,
+ False,
+ self._loop)
+
+ async def send_receive_close(self):
+ """Half close the RPC on the client-side."""
+ cdef SendCloseFromClientOperation op = SendCloseFromClientOperation(_EMPTY_FLAGS)
+ cdef tuple ops = (op,)
+ await execute_batch(self, ops, self._loop)
+
+ async def initiate_unary_stream(self,
+ bytes request,
+ tuple outbound_initial_metadata):
+ """Implementation of the start of a unary-stream call."""
+ # Peer may prematurely end this RPC at any point. We need a corutine
+ # that watches if the server sends the final status.
+ status_task = self._loop.create_task(self._handle_status_once_received())
+
+ cdef tuple outbound_ops
+ cdef Operation initial_metadata_op = SendInitialMetadataOperation(
+ outbound_initial_metadata,
+ self._send_initial_metadata_flags)
+ cdef Operation send_message_op = SendMessageOperation(
+ request,
+ _EMPTY_FLAGS)
+ cdef Operation send_close_op = SendCloseFromClientOperation(
+ _EMPTY_FLAGS)
+
+ outbound_ops = (
+ initial_metadata_op,
+ send_message_op,
+ send_close_op,
+ )
+
+ try:
+ # Sends out the request message.
+ await execute_batch(self,
+ outbound_ops,
+ self._loop)
+
+ # Receives initial metadata.
+ self._set_initial_metadata(
+ await _receive_initial_metadata(self,
+ self._loop),
+ )
+ except ExecuteBatchError as batch_error:
+ # Core should explain why this batch failed
+ await status_task
+
+ async def stream_unary(self,
+ tuple outbound_initial_metadata,
+ object metadata_sent_observer):
+ """Actual implementation of the complete unary-stream call.
+
+ Needs to pay extra attention to the raise mechanism. If we want to
+ propagate the final status exception, then we have to raise it.
+ Othersize, it would end normally and raise `StopAsyncIteration()`.
+ """
+ try:
+ # Sends out initial_metadata ASAP.
+ await _send_initial_metadata(self,
+ outbound_initial_metadata,
+ self._send_initial_metadata_flags,
+ self._loop)
+ # Notify upper level that sending messages are allowed now.
+ metadata_sent_observer()
+
+ # Receives initial metadata.
+ self._set_initial_metadata(
+ await _receive_initial_metadata(self, self._loop)
+ )
+ except ExecuteBatchError:
+ # Core should explain why this batch failed
+ await self._handle_status_once_received()
+
+ # Allow upper layer to proceed only if the status is set
+ metadata_sent_observer()
+ return None
+
+ cdef tuple inbound_ops
+ cdef ReceiveMessageOperation receive_message_op = ReceiveMessageOperation(_EMPTY_FLAGS)
+ cdef ReceiveStatusOnClientOperation receive_status_on_client_op = ReceiveStatusOnClientOperation(_EMPTY_FLAGS)
+ inbound_ops = (receive_message_op, receive_status_on_client_op)
+
+ # Executes all operations in one batch.
+ await execute_batch(self,
+ inbound_ops,
+ self._loop)
+
+ cdef grpc_status_code code
+ code = receive_status_on_client_op.code()
+
+ self._set_status(AioRpcStatus(
+ code,
+ receive_status_on_client_op.details(),
+ receive_status_on_client_op.trailing_metadata(),
+ receive_status_on_client_op.error_string(),
+ ))
+
+ if code == StatusCode.ok:
+ return receive_message_op.message()
+ else:
+ return None
+
+ async def initiate_stream_stream(self,
+ tuple outbound_initial_metadata,
+ object metadata_sent_observer):
+ """Actual implementation of the complete stream-stream call.
+
+ Needs to pay extra attention to the raise mechanism. If we want to
+ propagate the final status exception, then we have to raise it.
+ Othersize, it would end normally and raise `StopAsyncIteration()`.
+ """
+ # Peer may prematurely end this RPC at any point. We need a corutine
+ # that watches if the server sends the final status.
+ status_task = self._loop.create_task(self._handle_status_once_received())
+
+ try:
+ # Sends out initial_metadata ASAP.
+ await _send_initial_metadata(self,
+ outbound_initial_metadata,
+ self._send_initial_metadata_flags,
+ self._loop)
+ # Notify upper level that sending messages are allowed now.
+ metadata_sent_observer()
+
+ # Receives initial metadata.
+ self._set_initial_metadata(
+ await _receive_initial_metadata(self, self._loop)
+ )
+ except ExecuteBatchError as batch_error:
+ # Core should explain why this batch failed
+ await status_task
+
+ # Allow upper layer to proceed only if the status is set
+ metadata_sent_observer()
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/callback_common.pxd.pxi b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/callback_common.pxd.pxi
index 73c04507fcb..e5620cd166d 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/callback_common.pxd.pxi
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/callback_common.pxd.pxi
@@ -26,18 +26,18 @@ cdef struct CallbackContext:
#
# Attributes:
# functor: A grpc_experimental_completion_queue_functor represents the
- # callback function in the only way Core understands.
+ # callback function in the only way Core understands.
# waiter: An asyncio.Future object that fulfills when the callback is
- # invoked by Core.
- # failure_handler: A CallbackFailureHandler object that called when Core
+ # invoked by Core.
+ # failure_handler: A CallbackFailureHandler object that called when Core
# returns 'success == 0' state.
- # wrapper: A self-reference to the CallbackWrapper to help life cycle
- # management.
+ # wrapper: A self-reference to the CallbackWrapper to help life cycle
+ # management.
grpc_experimental_completion_queue_functor functor
cpython.PyObject *waiter
- cpython.PyObject *loop
+ cpython.PyObject *loop
cpython.PyObject *failure_handler
- cpython.PyObject *callback_wrapper
+ cpython.PyObject *callback_wrapper
cdef class CallbackWrapper:
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/callback_common.pyx.pxi b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/callback_common.pyx.pxi
index 05c51aec748..86fc91e76a4 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/callback_common.pyx.pxi
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/callback_common.pyx.pxi
@@ -14,7 +14,7 @@
cdef class CallbackFailureHandler:
-
+
def __cinit__(self,
str core_function_name,
object error_details,
@@ -32,33 +32,33 @@ cdef class CallbackFailureHandler:
cdef class CallbackWrapper:
- def __cinit__(self, object future, object loop, CallbackFailureHandler failure_handler):
+ def __cinit__(self, object future, object loop, CallbackFailureHandler failure_handler):
self.context.functor.functor_run = self.functor_run
self.context.waiter = <cpython.PyObject*>future
- self.context.loop = <cpython.PyObject*>loop
+ self.context.loop = <cpython.PyObject*>loop
self.context.failure_handler = <cpython.PyObject*>failure_handler
- self.context.callback_wrapper = <cpython.PyObject*>self
+ self.context.callback_wrapper = <cpython.PyObject*>self
# NOTE(lidiz) Not using a list here, because this class is critical in
# data path. We should make it as efficient as possible.
self._reference_of_future = future
self._reference_of_failure_handler = failure_handler
- # NOTE(lidiz) We need to ensure when Core invokes our callback, the
- # callback function itself is not deallocated. Othersise, we will get
- # a segfault. We can view this as Core holding a ref.
- cpython.Py_INCREF(self)
+ # NOTE(lidiz) We need to ensure when Core invokes our callback, the
+ # callback function itself is not deallocated. Othersise, we will get
+ # a segfault. We can view this as Core holding a ref.
+ cpython.Py_INCREF(self)
@staticmethod
cdef void functor_run(
grpc_experimental_completion_queue_functor* functor,
int success):
cdef CallbackContext *context = <CallbackContext *>functor
- cdef object waiter = <object>context.waiter
- if not waiter.cancelled():
- if success == 0:
- (<CallbackFailureHandler>context.failure_handler).handle(waiter)
- else:
- waiter.set_result(None)
- cpython.Py_DECREF(<object>context.callback_wrapper)
+ cdef object waiter = <object>context.waiter
+ if not waiter.cancelled():
+ if success == 0:
+ (<CallbackFailureHandler>context.failure_handler).handle(waiter)
+ else:
+ waiter.set_result(None)
+ cpython.Py_DECREF(<object>context.callback_wrapper)
cdef grpc_experimental_completion_queue_functor *c_functor(self):
return &self.context.functor
@@ -67,14 +67,14 @@ cdef class CallbackWrapper:
cdef CallbackFailureHandler CQ_SHUTDOWN_FAILURE_HANDLER = CallbackFailureHandler(
'grpc_completion_queue_shutdown',
'Unknown',
- InternalError)
+ InternalError)
-class ExecuteBatchError(InternalError):
- """Raised when execute batch returns a failure from Core."""
+class ExecuteBatchError(InternalError):
+ """Raised when execute batch returns a failure from Core."""
-async def execute_batch(GrpcCallWrapper grpc_call_wrapper,
+async def execute_batch(GrpcCallWrapper grpc_call_wrapper,
tuple operations,
object loop):
"""The callback version of start batch operations."""
@@ -84,8 +84,8 @@ async def execute_batch(GrpcCallWrapper grpc_call_wrapper,
cdef object future = loop.create_future()
cdef CallbackWrapper wrapper = CallbackWrapper(
future,
- loop,
- CallbackFailureHandler('execute_batch', operations, ExecuteBatchError))
+ loop,
+ CallbackFailureHandler('execute_batch', operations, ExecuteBatchError))
cdef grpc_call_error error = grpc_call_start_batch(
grpc_call_wrapper.call,
batch_operation_tag.c_ops,
@@ -93,90 +93,90 @@ async def execute_batch(GrpcCallWrapper grpc_call_wrapper,
wrapper.c_functor(), NULL)
if error != GRPC_CALL_OK:
- raise ExecuteBatchError("Failed grpc_call_start_batch: {}".format(error))
+ raise ExecuteBatchError("Failed grpc_call_start_batch: {}".format(error))
await future
-
+
cdef grpc_event c_event
# Tag.event must be called, otherwise messages won't be parsed from C
batch_operation_tag.event(c_event)
-
-
-cdef prepend_send_initial_metadata_op(tuple ops, tuple metadata):
- # Eventually, this function should be the only function that produces
- # SendInitialMetadataOperation. So we have more control over the flag.
- return (SendInitialMetadataOperation(
- metadata,
- _EMPTY_FLAG
- ),) + ops
-
-
-async def _receive_message(GrpcCallWrapper grpc_call_wrapper,
- object loop):
- """Retrives parsed messages from Core.
-
- The messages maybe already in Core's buffer, so there isn't a 1-to-1
- mapping between this and the underlying "socket.read()". Also, eventually,
- this function will end with an EOF, which reads empty message.
- """
- cdef ReceiveMessageOperation receive_op = ReceiveMessageOperation(_EMPTY_FLAG)
- cdef tuple ops = (receive_op,)
- try:
- await execute_batch(grpc_call_wrapper, ops, loop)
- except ExecuteBatchError as e:
- # NOTE(lidiz) The receive message operation has two ways to indicate
- # finish state : 1) returns empty message due to EOF; 2) fails inside
- # the callback (e.g. cancelled).
- #
- # Since they all indicates finish, they are better be merged.
- _LOGGER.debug('Failed to receive any message from Core')
- return receive_op.message()
-
-
-async def _send_message(GrpcCallWrapper grpc_call_wrapper,
- bytes message,
- Operation send_initial_metadata_op,
- int write_flag,
- object loop):
- cdef SendMessageOperation op = SendMessageOperation(message, write_flag)
- cdef tuple ops = (op,)
- if send_initial_metadata_op is not None:
- ops = (send_initial_metadata_op,) + ops
- await execute_batch(grpc_call_wrapper, ops, loop)
-
-
-async def _send_initial_metadata(GrpcCallWrapper grpc_call_wrapper,
- tuple metadata,
- int flags,
- object loop):
- cdef SendInitialMetadataOperation op = SendInitialMetadataOperation(
- metadata,
- flags)
- cdef tuple ops = (op,)
- await execute_batch(grpc_call_wrapper, ops, loop)
-
-
-async def _receive_initial_metadata(GrpcCallWrapper grpc_call_wrapper,
- object loop):
- cdef ReceiveInitialMetadataOperation op = ReceiveInitialMetadataOperation(_EMPTY_FLAGS)
- cdef tuple ops = (op,)
- await execute_batch(grpc_call_wrapper, ops, loop)
- return op.initial_metadata()
-
-async def _send_error_status_from_server(GrpcCallWrapper grpc_call_wrapper,
- grpc_status_code code,
- str details,
- tuple trailing_metadata,
- Operation send_initial_metadata_op,
- object loop):
- assert code != StatusCode.ok, 'Expecting non-ok status code.'
- cdef SendStatusFromServerOperation op = SendStatusFromServerOperation(
- trailing_metadata,
- code,
- details,
- _EMPTY_FLAGS,
- )
- cdef tuple ops = (op,)
- if send_initial_metadata_op is not None:
- ops = (send_initial_metadata_op,) + ops
- await execute_batch(grpc_call_wrapper, ops, loop)
+
+
+cdef prepend_send_initial_metadata_op(tuple ops, tuple metadata):
+ # Eventually, this function should be the only function that produces
+ # SendInitialMetadataOperation. So we have more control over the flag.
+ return (SendInitialMetadataOperation(
+ metadata,
+ _EMPTY_FLAG
+ ),) + ops
+
+
+async def _receive_message(GrpcCallWrapper grpc_call_wrapper,
+ object loop):
+ """Retrives parsed messages from Core.
+
+ The messages maybe already in Core's buffer, so there isn't a 1-to-1
+ mapping between this and the underlying "socket.read()". Also, eventually,
+ this function will end with an EOF, which reads empty message.
+ """
+ cdef ReceiveMessageOperation receive_op = ReceiveMessageOperation(_EMPTY_FLAG)
+ cdef tuple ops = (receive_op,)
+ try:
+ await execute_batch(grpc_call_wrapper, ops, loop)
+ except ExecuteBatchError as e:
+ # NOTE(lidiz) The receive message operation has two ways to indicate
+ # finish state : 1) returns empty message due to EOF; 2) fails inside
+ # the callback (e.g. cancelled).
+ #
+ # Since they all indicates finish, they are better be merged.
+ _LOGGER.debug('Failed to receive any message from Core')
+ return receive_op.message()
+
+
+async def _send_message(GrpcCallWrapper grpc_call_wrapper,
+ bytes message,
+ Operation send_initial_metadata_op,
+ int write_flag,
+ object loop):
+ cdef SendMessageOperation op = SendMessageOperation(message, write_flag)
+ cdef tuple ops = (op,)
+ if send_initial_metadata_op is not None:
+ ops = (send_initial_metadata_op,) + ops
+ await execute_batch(grpc_call_wrapper, ops, loop)
+
+
+async def _send_initial_metadata(GrpcCallWrapper grpc_call_wrapper,
+ tuple metadata,
+ int flags,
+ object loop):
+ cdef SendInitialMetadataOperation op = SendInitialMetadataOperation(
+ metadata,
+ flags)
+ cdef tuple ops = (op,)
+ await execute_batch(grpc_call_wrapper, ops, loop)
+
+
+async def _receive_initial_metadata(GrpcCallWrapper grpc_call_wrapper,
+ object loop):
+ cdef ReceiveInitialMetadataOperation op = ReceiveInitialMetadataOperation(_EMPTY_FLAGS)
+ cdef tuple ops = (op,)
+ await execute_batch(grpc_call_wrapper, ops, loop)
+ return op.initial_metadata()
+
+async def _send_error_status_from_server(GrpcCallWrapper grpc_call_wrapper,
+ grpc_status_code code,
+ str details,
+ tuple trailing_metadata,
+ Operation send_initial_metadata_op,
+ object loop):
+ assert code != StatusCode.ok, 'Expecting non-ok status code.'
+ cdef SendStatusFromServerOperation op = SendStatusFromServerOperation(
+ trailing_metadata,
+ code,
+ details,
+ _EMPTY_FLAGS,
+ )
+ cdef tuple ops = (op,)
+ if send_initial_metadata_op is not None:
+ ops = (send_initial_metadata_op,) + ops
+ await execute_batch(grpc_call_wrapper, ops, loop)
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/channel.pxd.pxi b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/channel.pxd.pxi
index 99c5fa21236..03b4990e488 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/channel.pxd.pxi
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/channel.pxd.pxi
@@ -12,16 +12,16 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-cdef enum AioChannelStatus:
- AIO_CHANNEL_STATUS_UNKNOWN
- AIO_CHANNEL_STATUS_READY
- AIO_CHANNEL_STATUS_CLOSING
- AIO_CHANNEL_STATUS_DESTROYED
-
+cdef enum AioChannelStatus:
+ AIO_CHANNEL_STATUS_UNKNOWN
+ AIO_CHANNEL_STATUS_READY
+ AIO_CHANNEL_STATUS_CLOSING
+ AIO_CHANNEL_STATUS_DESTROYED
+
cdef class AioChannel:
cdef:
grpc_channel * channel
- object loop
+ object loop
bytes _target
- AioChannelStatus _status
- bint _is_secure
+ AioChannelStatus _status
+ bint _is_secure
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/channel.pyx.pxi b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/channel.pyx.pxi
index 7b38743b6f3..beadce67b4a 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/channel.pyx.pxi
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/channel.pyx.pxi
@@ -11,124 +11,124 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-#
-
-
-class _WatchConnectivityFailed(Exception):
- """Dedicated exception class for watch connectivity failed.
-
- It might be failed due to deadline exceeded.
- """
-cdef CallbackFailureHandler _WATCH_CONNECTIVITY_FAILURE_HANDLER = CallbackFailureHandler(
- 'watch_connectivity_state',
- 'Timed out',
- _WatchConnectivityFailed)
-
-
+#
+
+
+class _WatchConnectivityFailed(Exception):
+ """Dedicated exception class for watch connectivity failed.
+
+ It might be failed due to deadline exceeded.
+ """
+cdef CallbackFailureHandler _WATCH_CONNECTIVITY_FAILURE_HANDLER = CallbackFailureHandler(
+ 'watch_connectivity_state',
+ 'Timed out',
+ _WatchConnectivityFailed)
+
+
cdef class AioChannel:
- def __cinit__(self, bytes target, tuple options, ChannelCredentials credentials, object loop):
- init_grpc_aio()
- if options is None:
- options = ()
- cdef _ChannelArgs channel_args = _ChannelArgs(options)
- self._target = target
- self.loop = loop
- self._status = AIO_CHANNEL_STATUS_READY
-
- if credentials is None:
- self._is_secure = False
- self.channel = grpc_insecure_channel_create(
- <char *>target,
- channel_args.c_args(),
- NULL)
- else:
- self._is_secure = True
- self.channel = grpc_secure_channel_create(
- <grpc_channel_credentials *> credentials.c(),
- <char *>target,
- channel_args.c_args(),
- NULL)
-
- def __dealloc__(self):
- shutdown_grpc_aio()
-
+ def __cinit__(self, bytes target, tuple options, ChannelCredentials credentials, object loop):
+ init_grpc_aio()
+ if options is None:
+ options = ()
+ cdef _ChannelArgs channel_args = _ChannelArgs(options)
+ self._target = target
+ self.loop = loop
+ self._status = AIO_CHANNEL_STATUS_READY
+
+ if credentials is None:
+ self._is_secure = False
+ self.channel = grpc_insecure_channel_create(
+ <char *>target,
+ channel_args.c_args(),
+ NULL)
+ else:
+ self._is_secure = True
+ self.channel = grpc_secure_channel_create(
+ <grpc_channel_credentials *> credentials.c(),
+ <char *>target,
+ channel_args.c_args(),
+ NULL)
+
+ def __dealloc__(self):
+ shutdown_grpc_aio()
+
def __repr__(self):
class_name = self.__class__.__name__
id_ = id(self)
return f"<{class_name} {id_}>"
- def check_connectivity_state(self, bint try_to_connect):
- """A Cython wrapper for Core's check connectivity state API."""
- if self._status == AIO_CHANNEL_STATUS_DESTROYED:
- return ConnectivityState.shutdown
- else:
- return grpc_channel_check_connectivity_state(
- self.channel,
- try_to_connect,
- )
-
- async def watch_connectivity_state(self,
- grpc_connectivity_state last_observed_state,
- object deadline):
- """Watch for one connectivity state change.
-
- Keeps mirroring the behavior from Core, so we can easily switch to
- other design of API if necessary.
- """
- if self._status in (AIO_CHANNEL_STATUS_DESTROYED, AIO_CHANNEL_STATUS_CLOSING):
- raise UsageError('Channel is closed.')
-
- cdef gpr_timespec c_deadline = _timespec_from_time(deadline)
-
- cdef object future = self.loop.create_future()
- cdef CallbackWrapper wrapper = CallbackWrapper(
- future,
- self.loop,
- _WATCH_CONNECTIVITY_FAILURE_HANDLER)
- grpc_channel_watch_connectivity_state(
- self.channel,
- last_observed_state,
- c_deadline,
- global_completion_queue(),
- wrapper.c_functor())
-
- try:
- await future
- except _WatchConnectivityFailed:
- return False
- else:
- return True
-
- def closing(self):
- self._status = AIO_CHANNEL_STATUS_CLOSING
-
+ def check_connectivity_state(self, bint try_to_connect):
+ """A Cython wrapper for Core's check connectivity state API."""
+ if self._status == AIO_CHANNEL_STATUS_DESTROYED:
+ return ConnectivityState.shutdown
+ else:
+ return grpc_channel_check_connectivity_state(
+ self.channel,
+ try_to_connect,
+ )
+
+ async def watch_connectivity_state(self,
+ grpc_connectivity_state last_observed_state,
+ object deadline):
+ """Watch for one connectivity state change.
+
+ Keeps mirroring the behavior from Core, so we can easily switch to
+ other design of API if necessary.
+ """
+ if self._status in (AIO_CHANNEL_STATUS_DESTROYED, AIO_CHANNEL_STATUS_CLOSING):
+ raise UsageError('Channel is closed.')
+
+ cdef gpr_timespec c_deadline = _timespec_from_time(deadline)
+
+ cdef object future = self.loop.create_future()
+ cdef CallbackWrapper wrapper = CallbackWrapper(
+ future,
+ self.loop,
+ _WATCH_CONNECTIVITY_FAILURE_HANDLER)
+ grpc_channel_watch_connectivity_state(
+ self.channel,
+ last_observed_state,
+ c_deadline,
+ global_completion_queue(),
+ wrapper.c_functor())
+
+ try:
+ await future
+ except _WatchConnectivityFailed:
+ return False
+ else:
+ return True
+
+ def closing(self):
+ self._status = AIO_CHANNEL_STATUS_CLOSING
+
def close(self):
- self._status = AIO_CHANNEL_STATUS_DESTROYED
+ self._status = AIO_CHANNEL_STATUS_DESTROYED
grpc_channel_destroy(self.channel)
- def closed(self):
- return self._status in (AIO_CHANNEL_STATUS_CLOSING, AIO_CHANNEL_STATUS_DESTROYED)
-
- def call(self,
- bytes method,
- object deadline,
- object python_call_credentials,
- object wait_for_ready):
- """Assembles a Cython Call object.
-
- Returns:
- An _AioCall object.
- """
- if self.closed():
- raise UsageError('Channel is closed.')
-
- cdef CallCredentials cython_call_credentials
- if python_call_credentials is not None:
- if not self._is_secure:
- raise UsageError("Call credentials are only valid on secure channels")
-
- cython_call_credentials = python_call_credentials._credentials
- else:
- cython_call_credentials = None
-
- return _AioCall(self, deadline, method, cython_call_credentials, wait_for_ready)
+ def closed(self):
+ return self._status in (AIO_CHANNEL_STATUS_CLOSING, AIO_CHANNEL_STATUS_DESTROYED)
+
+ def call(self,
+ bytes method,
+ object deadline,
+ object python_call_credentials,
+ object wait_for_ready):
+ """Assembles a Cython Call object.
+
+ Returns:
+ An _AioCall object.
+ """
+ if self.closed():
+ raise UsageError('Channel is closed.')
+
+ cdef CallCredentials cython_call_credentials
+ if python_call_credentials is not None:
+ if not self._is_secure:
+ raise UsageError("Call credentials are only valid on secure channels")
+
+ cython_call_credentials = python_call_credentials._credentials
+ else:
+ cython_call_credentials = None
+
+ return _AioCall(self, deadline, method, cython_call_credentials, wait_for_ready)
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/common.pyx.pxi b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/common.pyx.pxi
index 14cff6a2e9c..f759fbbec0c 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/common.pyx.pxi
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/common.pyx.pxi
@@ -1,186 +1,186 @@
-# Copyright 2019 The gRPC Authors
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-from cpython.version cimport PY_MAJOR_VERSION, PY_MINOR_VERSION
-
-
-cdef grpc_status_code get_status_code(object code) except *:
- if isinstance(code, int):
- if code >= StatusCode.ok and code <= StatusCode.data_loss:
- return code
- else:
- return StatusCode.unknown
- else:
- try:
- return code.value[0]
- except (KeyError, AttributeError):
- return StatusCode.unknown
-
-
-cdef object deserialize(object deserializer, bytes raw_message):
- """Perform deserialization on raw bytes.
-
- Failure to deserialize is a fatal error.
- """
- if deserializer:
- return deserializer(raw_message)
- else:
- return raw_message
-
-
-cdef bytes serialize(object serializer, object message):
- """Perform serialization on a message.
-
- Failure to serialize is a fatal error.
- """
- if isinstance(message, str):
- message = message.encode('utf-8')
- if serializer:
- return serializer(message)
- else:
- return message
-
-
-class _EOF:
-
- def __bool__(self):
- return False
-
- def __len__(self):
- return 0
-
- def _repr(self) -> str:
- return '<grpc.aio.EOF>'
-
- def __repr__(self) -> str:
- return self._repr()
-
- def __str__(self) -> str:
- return self._repr()
-
-
-EOF = _EOF()
-
-_COMPRESSION_METADATA_STRING_MAPPING = {
- CompressionAlgorithm.none: 'identity',
- CompressionAlgorithm.deflate: 'deflate',
- CompressionAlgorithm.gzip: 'gzip',
-}
-
-class BaseError(Exception):
- """The base class for exceptions generated by gRPC AsyncIO stack."""
-
-
-class UsageError(BaseError):
- """Raised when the usage of API by applications is inappropriate.
-
- For example, trying to invoke RPC on a closed channel, mixing two styles
- of streaming API on the client side. This exception should not be
- suppressed.
- """
-
-
-class AbortError(BaseError):
- """Raised when calling abort in servicer methods.
-
- This exception should not be suppressed. Applications may catch it to
- perform certain clean-up logic, and then re-raise it.
- """
-
-
-class InternalError(BaseError):
- """Raised upon unexpected errors in native code."""
-
-
-def schedule_coro_threadsafe(object coro, object loop):
- try:
- return loop.create_task(coro)
- except RuntimeError as runtime_error:
- if 'Non-thread-safe operation' in str(runtime_error):
- return asyncio.run_coroutine_threadsafe(
- coro,
- loop,
- )
- else:
- raise
-
-
-def async_generator_to_generator(object agen, object loop):
- """Converts an async generator into generator."""
- try:
- while True:
- future = asyncio.run_coroutine_threadsafe(
- agen.__anext__(),
- loop
- )
- response = future.result()
- if response is EOF:
- break
- else:
- yield response
- except StopAsyncIteration:
- # If StopAsyncIteration is raised, end this generator.
- pass
-
-
-async def generator_to_async_generator(object gen, object loop, object thread_pool):
- """Converts a generator into async generator.
-
- The generator might block, so we need to delegate the iteration to thread
- pool. Also, we can't simply delegate __next__ to the thread pool, otherwise
- we will see following error:
-
- TypeError: StopIteration interacts badly with generators and cannot be
- raised into a Future
- """
- queue = asyncio.Queue(maxsize=1, loop=loop)
-
- def yield_to_queue():
- try:
- for item in gen:
- asyncio.run_coroutine_threadsafe(queue.put(item), loop).result()
- finally:
- asyncio.run_coroutine_threadsafe(queue.put(EOF), loop).result()
-
- future = loop.run_in_executor(
- thread_pool,
- yield_to_queue,
- )
-
- while True:
- response = await queue.get()
- if response is EOF:
- break
- else:
- yield response
-
- # Port the exception if there is any
- await future
-
-
-if PY_MAJOR_VERSION >= 3 and PY_MINOR_VERSION >= 7:
- def get_working_loop():
- """Returns a running event loop.
-
- Due to a defect of asyncio.get_event_loop, its returned event loop might
- not be set as the default event loop for the main thread.
- """
- try:
- return asyncio.get_running_loop()
- except RuntimeError:
- return asyncio.get_event_loop()
-else:
- def get_working_loop():
- """Returns a running event loop."""
- return asyncio.get_event_loop()
+# Copyright 2019 The gRPC Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+from cpython.version cimport PY_MAJOR_VERSION, PY_MINOR_VERSION
+
+
+cdef grpc_status_code get_status_code(object code) except *:
+ if isinstance(code, int):
+ if code >= StatusCode.ok and code <= StatusCode.data_loss:
+ return code
+ else:
+ return StatusCode.unknown
+ else:
+ try:
+ return code.value[0]
+ except (KeyError, AttributeError):
+ return StatusCode.unknown
+
+
+cdef object deserialize(object deserializer, bytes raw_message):
+ """Perform deserialization on raw bytes.
+
+ Failure to deserialize is a fatal error.
+ """
+ if deserializer:
+ return deserializer(raw_message)
+ else:
+ return raw_message
+
+
+cdef bytes serialize(object serializer, object message):
+ """Perform serialization on a message.
+
+ Failure to serialize is a fatal error.
+ """
+ if isinstance(message, str):
+ message = message.encode('utf-8')
+ if serializer:
+ return serializer(message)
+ else:
+ return message
+
+
+class _EOF:
+
+ def __bool__(self):
+ return False
+
+ def __len__(self):
+ return 0
+
+ def _repr(self) -> str:
+ return '<grpc.aio.EOF>'
+
+ def __repr__(self) -> str:
+ return self._repr()
+
+ def __str__(self) -> str:
+ return self._repr()
+
+
+EOF = _EOF()
+
+_COMPRESSION_METADATA_STRING_MAPPING = {
+ CompressionAlgorithm.none: 'identity',
+ CompressionAlgorithm.deflate: 'deflate',
+ CompressionAlgorithm.gzip: 'gzip',
+}
+
+class BaseError(Exception):
+ """The base class for exceptions generated by gRPC AsyncIO stack."""
+
+
+class UsageError(BaseError):
+ """Raised when the usage of API by applications is inappropriate.
+
+ For example, trying to invoke RPC on a closed channel, mixing two styles
+ of streaming API on the client side. This exception should not be
+ suppressed.
+ """
+
+
+class AbortError(BaseError):
+ """Raised when calling abort in servicer methods.
+
+ This exception should not be suppressed. Applications may catch it to
+ perform certain clean-up logic, and then re-raise it.
+ """
+
+
+class InternalError(BaseError):
+ """Raised upon unexpected errors in native code."""
+
+
+def schedule_coro_threadsafe(object coro, object loop):
+ try:
+ return loop.create_task(coro)
+ except RuntimeError as runtime_error:
+ if 'Non-thread-safe operation' in str(runtime_error):
+ return asyncio.run_coroutine_threadsafe(
+ coro,
+ loop,
+ )
+ else:
+ raise
+
+
+def async_generator_to_generator(object agen, object loop):
+ """Converts an async generator into generator."""
+ try:
+ while True:
+ future = asyncio.run_coroutine_threadsafe(
+ agen.__anext__(),
+ loop
+ )
+ response = future.result()
+ if response is EOF:
+ break
+ else:
+ yield response
+ except StopAsyncIteration:
+ # If StopAsyncIteration is raised, end this generator.
+ pass
+
+
+async def generator_to_async_generator(object gen, object loop, object thread_pool):
+ """Converts a generator into async generator.
+
+ The generator might block, so we need to delegate the iteration to thread
+ pool. Also, we can't simply delegate __next__ to the thread pool, otherwise
+ we will see following error:
+
+ TypeError: StopIteration interacts badly with generators and cannot be
+ raised into a Future
+ """
+ queue = asyncio.Queue(maxsize=1, loop=loop)
+
+ def yield_to_queue():
+ try:
+ for item in gen:
+ asyncio.run_coroutine_threadsafe(queue.put(item), loop).result()
+ finally:
+ asyncio.run_coroutine_threadsafe(queue.put(EOF), loop).result()
+
+ future = loop.run_in_executor(
+ thread_pool,
+ yield_to_queue,
+ )
+
+ while True:
+ response = await queue.get()
+ if response is EOF:
+ break
+ else:
+ yield response
+
+ # Port the exception if there is any
+ await future
+
+
+if PY_MAJOR_VERSION >= 3 and PY_MINOR_VERSION >= 7:
+ def get_working_loop():
+ """Returns a running event loop.
+
+ Due to a defect of asyncio.get_event_loop, its returned event loop might
+ not be set as the default event loop for the main thread.
+ """
+ try:
+ return asyncio.get_running_loop()
+ except RuntimeError:
+ return asyncio.get_event_loop()
+else:
+ def get_working_loop():
+ """Returns a running event loop."""
+ return asyncio.get_event_loop()
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/completion_queue.pxd.pxi b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/completion_queue.pxd.pxi
index dea39759f17..a5189ad5267 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/completion_queue.pxd.pxi
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/completion_queue.pxd.pxi
@@ -1,76 +1,76 @@
-# Copyright 2020 The gRPC Authors
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# NOTE(lidiz) Unfortunately, we can't use "cimport" here because Cython
-# links it with exception handling. It introduces new dependencies.
-cdef extern from "<queue>" namespace "std" nogil:
- cdef cppclass queue[T]:
- queue()
- bint empty()
- T& front()
- void pop()
- void push(T&)
- size_t size()
-
-
-cdef extern from "<mutex>" namespace "std" nogil:
- cdef cppclass mutex:
- mutex()
- void lock()
- void unlock()
-
-
-ctypedef queue[grpc_event] cpp_event_queue
-
-
-IF UNAME_SYSNAME == "Windows":
- cdef extern from "winsock2.h" nogil:
- ctypedef uint32_t WIN_SOCKET "SOCKET"
- WIN_SOCKET win_socket "socket" (int af, int type, int protocol)
- int win_socket_send "send" (WIN_SOCKET s, const char *buf, int len, int flags)
-
-
-cdef void _unified_socket_write(int fd) nogil
-
-
-cdef class BaseCompletionQueue:
- cdef grpc_completion_queue *_cq
-
- cdef grpc_completion_queue* c_ptr(self)
-
-
-cdef class _BoundEventLoop:
- cdef readonly object loop
- cdef readonly object read_socket # socket.socket
- cdef bint _has_reader
-
-
-cdef class PollerCompletionQueue(BaseCompletionQueue):
- cdef bint _shutdown
- cdef cpp_event_queue _queue
- cdef mutex _queue_mutex
- cdef object _poller_thread # threading.Thread
- cdef int _write_fd
- cdef object _read_socket # socket.socket
- cdef object _write_socket # socket.socket
- cdef dict _loops # Mapping[asyncio.AbstractLoop, _BoundEventLoop]
-
- cdef void _poll(self) nogil
- cdef shutdown(self)
-
-
-cdef class CallbackCompletionQueue(BaseCompletionQueue):
- cdef object _shutdown_completed # asyncio.Future
- cdef CallbackWrapper _wrapper
- cdef object _loop
+# Copyright 2020 The gRPC Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# NOTE(lidiz) Unfortunately, we can't use "cimport" here because Cython
+# links it with exception handling. It introduces new dependencies.
+cdef extern from "<queue>" namespace "std" nogil:
+ cdef cppclass queue[T]:
+ queue()
+ bint empty()
+ T& front()
+ void pop()
+ void push(T&)
+ size_t size()
+
+
+cdef extern from "<mutex>" namespace "std" nogil:
+ cdef cppclass mutex:
+ mutex()
+ void lock()
+ void unlock()
+
+
+ctypedef queue[grpc_event] cpp_event_queue
+
+
+IF UNAME_SYSNAME == "Windows":
+ cdef extern from "winsock2.h" nogil:
+ ctypedef uint32_t WIN_SOCKET "SOCKET"
+ WIN_SOCKET win_socket "socket" (int af, int type, int protocol)
+ int win_socket_send "send" (WIN_SOCKET s, const char *buf, int len, int flags)
+
+
+cdef void _unified_socket_write(int fd) nogil
+
+
+cdef class BaseCompletionQueue:
+ cdef grpc_completion_queue *_cq
+
+ cdef grpc_completion_queue* c_ptr(self)
+
+
+cdef class _BoundEventLoop:
+ cdef readonly object loop
+ cdef readonly object read_socket # socket.socket
+ cdef bint _has_reader
+
+
+cdef class PollerCompletionQueue(BaseCompletionQueue):
+ cdef bint _shutdown
+ cdef cpp_event_queue _queue
+ cdef mutex _queue_mutex
+ cdef object _poller_thread # threading.Thread
+ cdef int _write_fd
+ cdef object _read_socket # socket.socket
+ cdef object _write_socket # socket.socket
+ cdef dict _loops # Mapping[asyncio.AbstractLoop, _BoundEventLoop]
+
+ cdef void _poll(self) nogil
+ cdef shutdown(self)
+
+
+cdef class CallbackCompletionQueue(BaseCompletionQueue):
+ cdef object _shutdown_completed # asyncio.Future
+ cdef CallbackWrapper _wrapper
+ cdef object _loop
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/completion_queue.pyx.pxi b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/completion_queue.pyx.pxi
index 82ef11d0c9d..1a32a553504 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/completion_queue.pyx.pxi
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/completion_queue.pyx.pxi
@@ -1,194 +1,194 @@
-# Copyright 2020 The gRPC Authors
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-import socket
-
-cdef gpr_timespec _GPR_INF_FUTURE = gpr_inf_future(GPR_CLOCK_REALTIME)
-cdef float _POLL_AWAKE_INTERVAL_S = 0.2
-
-# This bool indicates if the event loop impl can monitor a given fd, or has
-# loop.add_reader method.
-cdef bint _has_fd_monitoring = True
-
-IF UNAME_SYSNAME == "Windows":
- cdef void _unified_socket_write(int fd) nogil:
- win_socket_send(<WIN_SOCKET>fd, b"1", 1, 0)
-ELSE:
- cimport posix.unistd as unistd
-
- cdef void _unified_socket_write(int fd) nogil:
- unistd.write(fd, b"1", 1)
-
-
-def _handle_callback_wrapper(CallbackWrapper callback_wrapper, int success):
- CallbackWrapper.functor_run(callback_wrapper.c_functor(), success)
-
-
-cdef class BaseCompletionQueue:
-
- cdef grpc_completion_queue* c_ptr(self):
- return self._cq
-
-
-cdef class _BoundEventLoop:
-
- def __cinit__(self, object loop, object read_socket, object handler):
- global _has_fd_monitoring
- self.loop = loop
- self.read_socket = read_socket
- reader_function = functools.partial(
- handler,
- loop
- )
- # NOTE(lidiz) There isn't a way to cleanly pre-check if fd monitoring
- # support is available or not. Checking the event loop policy is not
- # good enough. The application can has its own loop implementation, or
- # uses different types of event loops (e.g., 1 Proactor, 3 Selectors).
- if _has_fd_monitoring:
- try:
- self.loop.add_reader(self.read_socket, reader_function)
- self._has_reader = True
- except NotImplementedError:
- _has_fd_monitoring = False
- self._has_reader = False
-
- def close(self):
- if self.loop:
- if self._has_reader:
- self.loop.remove_reader(self.read_socket)
-
-
-cdef class PollerCompletionQueue(BaseCompletionQueue):
-
- def __cinit__(self):
- self._cq = grpc_completion_queue_create_for_next(NULL)
- self._shutdown = False
- self._poller_thread = threading.Thread(target=self._poll_wrapper, daemon=True)
- self._poller_thread.start()
-
- self._read_socket, self._write_socket = socket.socketpair()
- self._write_fd = self._write_socket.fileno()
- self._loops = {}
-
- # The read socket might be read by multiple threads. But only one of them will
- # read the 1 byte sent by the poller thread. This setting is essential to allow
- # multiple loops in multiple threads bound to the same poller.
- self._read_socket.setblocking(False)
-
- self._queue = cpp_event_queue()
-
- def bind_loop(self, object loop):
- if loop in self._loops:
- return
- else:
- self._loops[loop] = _BoundEventLoop(loop, self._read_socket, self._handle_events)
-
- cdef void _poll(self) nogil:
- cdef grpc_event event
- cdef CallbackContext *context
-
- while not self._shutdown:
- event = grpc_completion_queue_next(self._cq,
- _GPR_INF_FUTURE,
- NULL)
-
- if event.type == GRPC_QUEUE_TIMEOUT:
- with gil:
- raise AssertionError("Core should not return GRPC_QUEUE_TIMEOUT!")
- elif event.type == GRPC_QUEUE_SHUTDOWN:
- self._shutdown = True
- else:
- self._queue_mutex.lock()
- self._queue.push(event)
- self._queue_mutex.unlock()
- if _has_fd_monitoring:
- _unified_socket_write(self._write_fd)
- else:
- with gil:
- # Event loops can be paused or killed at any time. So,
- # instead of deligate to any thread, the polling thread
- # should handle the distribution of the event.
- self._handle_events(None)
-
- def _poll_wrapper(self):
- with nogil:
- self._poll()
-
- cdef shutdown(self):
- # Removes the socket hook from loops
- for loop in self._loops:
- self._loops.get(loop).close()
-
- # TODO(https://github.com/grpc/grpc/issues/22365) perform graceful shutdown
- grpc_completion_queue_shutdown(self._cq)
- while not self._shutdown:
- self._poller_thread.join(timeout=_POLL_AWAKE_INTERVAL_S)
- grpc_completion_queue_destroy(self._cq)
-
- # Clean up socket resources
- self._read_socket.close()
- self._write_socket.close()
-
- def _handle_events(self, object context_loop):
- cdef bytes data
- if _has_fd_monitoring:
- # If fd monitoring is working, clean the socket without blocking.
- data = self._read_socket.recv(1)
- cdef grpc_event event
- cdef CallbackContext *context
-
- while True:
- self._queue_mutex.lock()
- if self._queue.empty():
- self._queue_mutex.unlock()
- break
- else:
- event = self._queue.front()
- self._queue.pop()
- self._queue_mutex.unlock()
-
- context = <CallbackContext *>event.tag
- loop = <object>context.loop
- if loop is context_loop:
- # Executes callbacks: complete the future
- CallbackWrapper.functor_run(
- <grpc_experimental_completion_queue_functor *>event.tag,
- event.success
- )
- else:
- loop.call_soon_threadsafe(
- _handle_callback_wrapper,
- <CallbackWrapper>context.callback_wrapper,
- event.success
- )
-
-
-cdef class CallbackCompletionQueue(BaseCompletionQueue):
-
- def __cinit__(self):
- self._loop = get_working_loop()
- self._shutdown_completed = self._loop.create_future()
- self._wrapper = CallbackWrapper(
- self._shutdown_completed,
- self._loop,
- CQ_SHUTDOWN_FAILURE_HANDLER)
- self._cq = grpc_completion_queue_create_for_callback(
- self._wrapper.c_functor(),
- NULL
- )
-
- async def shutdown(self):
- grpc_completion_queue_shutdown(self._cq)
- await self._shutdown_completed
- grpc_completion_queue_destroy(self._cq)
+# Copyright 2020 The gRPC Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import socket
+
+cdef gpr_timespec _GPR_INF_FUTURE = gpr_inf_future(GPR_CLOCK_REALTIME)
+cdef float _POLL_AWAKE_INTERVAL_S = 0.2
+
+# This bool indicates if the event loop impl can monitor a given fd, or has
+# loop.add_reader method.
+cdef bint _has_fd_monitoring = True
+
+IF UNAME_SYSNAME == "Windows":
+ cdef void _unified_socket_write(int fd) nogil:
+ win_socket_send(<WIN_SOCKET>fd, b"1", 1, 0)
+ELSE:
+ cimport posix.unistd as unistd
+
+ cdef void _unified_socket_write(int fd) nogil:
+ unistd.write(fd, b"1", 1)
+
+
+def _handle_callback_wrapper(CallbackWrapper callback_wrapper, int success):
+ CallbackWrapper.functor_run(callback_wrapper.c_functor(), success)
+
+
+cdef class BaseCompletionQueue:
+
+ cdef grpc_completion_queue* c_ptr(self):
+ return self._cq
+
+
+cdef class _BoundEventLoop:
+
+ def __cinit__(self, object loop, object read_socket, object handler):
+ global _has_fd_monitoring
+ self.loop = loop
+ self.read_socket = read_socket
+ reader_function = functools.partial(
+ handler,
+ loop
+ )
+ # NOTE(lidiz) There isn't a way to cleanly pre-check if fd monitoring
+ # support is available or not. Checking the event loop policy is not
+ # good enough. The application can has its own loop implementation, or
+ # uses different types of event loops (e.g., 1 Proactor, 3 Selectors).
+ if _has_fd_monitoring:
+ try:
+ self.loop.add_reader(self.read_socket, reader_function)
+ self._has_reader = True
+ except NotImplementedError:
+ _has_fd_monitoring = False
+ self._has_reader = False
+
+ def close(self):
+ if self.loop:
+ if self._has_reader:
+ self.loop.remove_reader(self.read_socket)
+
+
+cdef class PollerCompletionQueue(BaseCompletionQueue):
+
+ def __cinit__(self):
+ self._cq = grpc_completion_queue_create_for_next(NULL)
+ self._shutdown = False
+ self._poller_thread = threading.Thread(target=self._poll_wrapper, daemon=True)
+ self._poller_thread.start()
+
+ self._read_socket, self._write_socket = socket.socketpair()
+ self._write_fd = self._write_socket.fileno()
+ self._loops = {}
+
+ # The read socket might be read by multiple threads. But only one of them will
+ # read the 1 byte sent by the poller thread. This setting is essential to allow
+ # multiple loops in multiple threads bound to the same poller.
+ self._read_socket.setblocking(False)
+
+ self._queue = cpp_event_queue()
+
+ def bind_loop(self, object loop):
+ if loop in self._loops:
+ return
+ else:
+ self._loops[loop] = _BoundEventLoop(loop, self._read_socket, self._handle_events)
+
+ cdef void _poll(self) nogil:
+ cdef grpc_event event
+ cdef CallbackContext *context
+
+ while not self._shutdown:
+ event = grpc_completion_queue_next(self._cq,
+ _GPR_INF_FUTURE,
+ NULL)
+
+ if event.type == GRPC_QUEUE_TIMEOUT:
+ with gil:
+ raise AssertionError("Core should not return GRPC_QUEUE_TIMEOUT!")
+ elif event.type == GRPC_QUEUE_SHUTDOWN:
+ self._shutdown = True
+ else:
+ self._queue_mutex.lock()
+ self._queue.push(event)
+ self._queue_mutex.unlock()
+ if _has_fd_monitoring:
+ _unified_socket_write(self._write_fd)
+ else:
+ with gil:
+ # Event loops can be paused or killed at any time. So,
+ # instead of deligate to any thread, the polling thread
+ # should handle the distribution of the event.
+ self._handle_events(None)
+
+ def _poll_wrapper(self):
+ with nogil:
+ self._poll()
+
+ cdef shutdown(self):
+ # Removes the socket hook from loops
+ for loop in self._loops:
+ self._loops.get(loop).close()
+
+ # TODO(https://github.com/grpc/grpc/issues/22365) perform graceful shutdown
+ grpc_completion_queue_shutdown(self._cq)
+ while not self._shutdown:
+ self._poller_thread.join(timeout=_POLL_AWAKE_INTERVAL_S)
+ grpc_completion_queue_destroy(self._cq)
+
+ # Clean up socket resources
+ self._read_socket.close()
+ self._write_socket.close()
+
+ def _handle_events(self, object context_loop):
+ cdef bytes data
+ if _has_fd_monitoring:
+ # If fd monitoring is working, clean the socket without blocking.
+ data = self._read_socket.recv(1)
+ cdef grpc_event event
+ cdef CallbackContext *context
+
+ while True:
+ self._queue_mutex.lock()
+ if self._queue.empty():
+ self._queue_mutex.unlock()
+ break
+ else:
+ event = self._queue.front()
+ self._queue.pop()
+ self._queue_mutex.unlock()
+
+ context = <CallbackContext *>event.tag
+ loop = <object>context.loop
+ if loop is context_loop:
+ # Executes callbacks: complete the future
+ CallbackWrapper.functor_run(
+ <grpc_experimental_completion_queue_functor *>event.tag,
+ event.success
+ )
+ else:
+ loop.call_soon_threadsafe(
+ _handle_callback_wrapper,
+ <CallbackWrapper>context.callback_wrapper,
+ event.success
+ )
+
+
+cdef class CallbackCompletionQueue(BaseCompletionQueue):
+
+ def __cinit__(self):
+ self._loop = get_working_loop()
+ self._shutdown_completed = self._loop.create_future()
+ self._wrapper = CallbackWrapper(
+ self._shutdown_completed,
+ self._loop,
+ CQ_SHUTDOWN_FAILURE_HANDLER)
+ self._cq = grpc_completion_queue_create_for_callback(
+ self._wrapper.c_functor(),
+ NULL
+ )
+
+ async def shutdown(self):
+ grpc_completion_queue_shutdown(self._cq)
+ await self._shutdown_completed
+ grpc_completion_queue_destroy(self._cq)
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/grpc_aio.pxd.pxi b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/grpc_aio.pxd.pxi
index 5c1c67d86ee..ebf0660174d 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/grpc_aio.pxd.pxi
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/grpc_aio.pxd.pxi
@@ -13,31 +13,31 @@
# limitations under the License.
# distutils: language=c++
-cdef class _AioState:
- cdef object lock # threading.RLock
- cdef int refcount
- cdef object engine # AsyncIOEngine
- cdef BaseCompletionQueue cq
-
-
-cdef grpc_completion_queue *global_completion_queue()
-
-
-cpdef init_grpc_aio()
-
-
-cpdef shutdown_grpc_aio()
-
-
+cdef class _AioState:
+ cdef object lock # threading.RLock
+ cdef int refcount
+ cdef object engine # AsyncIOEngine
+ cdef BaseCompletionQueue cq
+
+
+cdef grpc_completion_queue *global_completion_queue()
+
+
+cpdef init_grpc_aio()
+
+
+cpdef shutdown_grpc_aio()
+
+
cdef extern from "src/core/lib/iomgr/timer_manager.h":
- void grpc_timer_manager_set_threading(bint enabled)
+ void grpc_timer_manager_set_threading(bint enabled)
+
-
cdef extern from "src/core/lib/iomgr/iomgr_internal.h":
- void grpc_set_default_iomgr_platform()
+ void grpc_set_default_iomgr_platform()
+
-
cdef extern from "src/core/lib/iomgr/executor.h" namespace "grpc_core":
cdef cppclass Executor:
@staticmethod
- void SetThreadingAll(bint enable)
+ void SetThreadingAll(bint enable)
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/grpc_aio.pyx.pxi b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/grpc_aio.pyx.pxi
index 8b829e85cc2..06c92cac586 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/grpc_aio.pyx.pxi
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/grpc_aio.pyx.pxi
@@ -12,132 +12,132 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-import enum
-
-cdef str _GRPC_ASYNCIO_ENGINE = os.environ.get('GRPC_ASYNCIO_ENGINE', 'poller').upper()
-cdef _AioState _global_aio_state = _AioState()
-
-
-class AsyncIOEngine(enum.Enum):
- CUSTOM_IO_MANAGER = 'custom_io_manager'
- POLLER = 'poller'
-
-
-cdef _default_asyncio_engine():
- return AsyncIOEngine.POLLER
-
-
-cdef grpc_completion_queue *global_completion_queue():
- return _global_aio_state.cq.c_ptr()
-
-
-cdef class _AioState:
-
- def __cinit__(self):
- self.lock = threading.RLock()
- self.refcount = 0
- self.engine = None
- self.cq = None
-
-
-cdef _initialize_custom_io_manager():
- # Activates asyncio IO manager.
- # NOTE(lidiz) Custom IO manager must be activated before the first
- # `grpc_init()`. Otherwise, some special configurations in Core won't
- # pick up the change, and resulted in SEGFAULT or ABORT.
+import enum
+
+cdef str _GRPC_ASYNCIO_ENGINE = os.environ.get('GRPC_ASYNCIO_ENGINE', 'poller').upper()
+cdef _AioState _global_aio_state = _AioState()
+
+
+class AsyncIOEngine(enum.Enum):
+ CUSTOM_IO_MANAGER = 'custom_io_manager'
+ POLLER = 'poller'
+
+
+cdef _default_asyncio_engine():
+ return AsyncIOEngine.POLLER
+
+
+cdef grpc_completion_queue *global_completion_queue():
+ return _global_aio_state.cq.c_ptr()
+
+
+cdef class _AioState:
+
+ def __cinit__(self):
+ self.lock = threading.RLock()
+ self.refcount = 0
+ self.engine = None
+ self.cq = None
+
+
+cdef _initialize_custom_io_manager():
+ # Activates asyncio IO manager.
+ # NOTE(lidiz) Custom IO manager must be activated before the first
+ # `grpc_init()`. Otherwise, some special configurations in Core won't
+ # pick up the change, and resulted in SEGFAULT or ABORT.
install_asyncio_iomgr()
-
- # Initializes gRPC Core, must be called before other Core API
+
+ # Initializes gRPC Core, must be called before other Core API
grpc_init()
# Timers are triggered by the Asyncio loop. We disable
# the background thread that is being used by the native
# gRPC iomgr.
- grpc_timer_manager_set_threading(False)
+ grpc_timer_manager_set_threading(False)
# gRPC callbaks are executed within the same thread used by the Asyncio
# event loop, as it is being done by the other Asyncio callbacks.
- Executor.SetThreadingAll(False)
-
- # Creates the only completion queue
- _global_aio_state.cq = CallbackCompletionQueue()
-
-
-cdef _initialize_poller():
- # Initializes gRPC Core, must be called before other Core API
- grpc_init()
-
- # Creates the only completion queue
- _global_aio_state.cq = PollerCompletionQueue()
-
-
-cdef _actual_aio_initialization():
- # Picks the engine for gRPC AsyncIO Stack
- _global_aio_state.engine = AsyncIOEngine.__members__.get(
- _GRPC_ASYNCIO_ENGINE,
- _default_asyncio_engine(),
- )
- _LOGGER.debug('Using %s as I/O engine', _global_aio_state.engine)
-
- # Initializes the process-level state accordingly
- if _global_aio_state.engine is AsyncIOEngine.CUSTOM_IO_MANAGER:
- _initialize_custom_io_manager()
- elif _global_aio_state.engine is AsyncIOEngine.POLLER:
- _initialize_poller()
- else:
- raise ValueError('Unsupported engine type [%s]' % _global_aio_state.engine)
-
-
-def _grpc_shutdown_wrapper(_):
- """A thin Python wrapper of Core's shutdown function.
-
- Define functions are not allowed in "cdef" functions, and Cython complains
- about a simple lambda with a C function.
- """
- grpc_shutdown_blocking()
-
-
-cdef _actual_aio_shutdown():
- if _global_aio_state.engine is AsyncIOEngine.CUSTOM_IO_MANAGER:
- future = schedule_coro_threadsafe(
- _global_aio_state.cq.shutdown(),
- (<CallbackCompletionQueue>_global_aio_state.cq)._loop
- )
- future.add_done_callback(_grpc_shutdown_wrapper)
- elif _global_aio_state.engine is AsyncIOEngine.POLLER:
- (<PollerCompletionQueue>_global_aio_state.cq).shutdown()
- grpc_shutdown_blocking()
- else:
- raise ValueError('Unsupported engine type [%s]' % _global_aio_state.engine)
-
-
-cdef _initialize_per_loop():
- cdef object loop = get_working_loop()
- if _global_aio_state.engine is AsyncIOEngine.POLLER:
- _global_aio_state.cq.bind_loop(loop)
-
-
-cpdef init_grpc_aio():
- """Initializes the gRPC AsyncIO module.
-
- Expected to be invoked on critical class constructors.
- E.g., AioChannel, AioServer.
- """
- with _global_aio_state.lock:
- _global_aio_state.refcount += 1
- if _global_aio_state.refcount == 1:
- _actual_aio_initialization()
- _initialize_per_loop()
-
-
-cpdef shutdown_grpc_aio():
- """Shuts down the gRPC AsyncIO module.
-
- Expected to be invoked on critical class destructors.
- E.g., AioChannel, AioServer.
- """
- with _global_aio_state.lock:
- assert _global_aio_state.refcount > 0
- _global_aio_state.refcount -= 1
- if not _global_aio_state.refcount:
- _actual_aio_shutdown()
+ Executor.SetThreadingAll(False)
+
+ # Creates the only completion queue
+ _global_aio_state.cq = CallbackCompletionQueue()
+
+
+cdef _initialize_poller():
+ # Initializes gRPC Core, must be called before other Core API
+ grpc_init()
+
+ # Creates the only completion queue
+ _global_aio_state.cq = PollerCompletionQueue()
+
+
+cdef _actual_aio_initialization():
+ # Picks the engine for gRPC AsyncIO Stack
+ _global_aio_state.engine = AsyncIOEngine.__members__.get(
+ _GRPC_ASYNCIO_ENGINE,
+ _default_asyncio_engine(),
+ )
+ _LOGGER.debug('Using %s as I/O engine', _global_aio_state.engine)
+
+ # Initializes the process-level state accordingly
+ if _global_aio_state.engine is AsyncIOEngine.CUSTOM_IO_MANAGER:
+ _initialize_custom_io_manager()
+ elif _global_aio_state.engine is AsyncIOEngine.POLLER:
+ _initialize_poller()
+ else:
+ raise ValueError('Unsupported engine type [%s]' % _global_aio_state.engine)
+
+
+def _grpc_shutdown_wrapper(_):
+ """A thin Python wrapper of Core's shutdown function.
+
+ Define functions are not allowed in "cdef" functions, and Cython complains
+ about a simple lambda with a C function.
+ """
+ grpc_shutdown_blocking()
+
+
+cdef _actual_aio_shutdown():
+ if _global_aio_state.engine is AsyncIOEngine.CUSTOM_IO_MANAGER:
+ future = schedule_coro_threadsafe(
+ _global_aio_state.cq.shutdown(),
+ (<CallbackCompletionQueue>_global_aio_state.cq)._loop
+ )
+ future.add_done_callback(_grpc_shutdown_wrapper)
+ elif _global_aio_state.engine is AsyncIOEngine.POLLER:
+ (<PollerCompletionQueue>_global_aio_state.cq).shutdown()
+ grpc_shutdown_blocking()
+ else:
+ raise ValueError('Unsupported engine type [%s]' % _global_aio_state.engine)
+
+
+cdef _initialize_per_loop():
+ cdef object loop = get_working_loop()
+ if _global_aio_state.engine is AsyncIOEngine.POLLER:
+ _global_aio_state.cq.bind_loop(loop)
+
+
+cpdef init_grpc_aio():
+ """Initializes the gRPC AsyncIO module.
+
+ Expected to be invoked on critical class constructors.
+ E.g., AioChannel, AioServer.
+ """
+ with _global_aio_state.lock:
+ _global_aio_state.refcount += 1
+ if _global_aio_state.refcount == 1:
+ _actual_aio_initialization()
+ _initialize_per_loop()
+
+
+cpdef shutdown_grpc_aio():
+ """Shuts down the gRPC AsyncIO module.
+
+ Expected to be invoked on critical class destructors.
+ E.g., AioChannel, AioServer.
+ """
+ with _global_aio_state.lock:
+ assert _global_aio_state.refcount > 0
+ _global_aio_state.refcount -= 1
+ if not _global_aio_state.refcount:
+ _actual_aio_shutdown()
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/iomgr/iomgr.pyx.pxi b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/iomgr/iomgr.pyx.pxi
index e8654385ac0..917ae24e11e 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/iomgr/iomgr.pyx.pxi
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/iomgr/iomgr.pyx.pxi
@@ -13,8 +13,8 @@
# limitations under the License.
-import platform
-
+import platform
+
from cpython cimport Py_INCREF, Py_DECREF
from libc cimport string
@@ -28,7 +28,7 @@ cdef grpc_socket_vtable asyncio_socket_vtable
cdef grpc_custom_resolver_vtable asyncio_resolver_vtable
cdef grpc_custom_timer_vtable asyncio_timer_vtable
cdef grpc_custom_poller_vtable asyncio_pollset_vtable
-cdef bint so_reuse_port
+cdef bint so_reuse_port
cdef grpc_error* asyncio_socket_init(
@@ -123,14 +123,14 @@ cdef grpc_error* asyncio_socket_listen(grpc_custom_socket* grpc_socket) with gil
return grpc_error_none()
-def _asyncio_apply_socket_options(object s, int flags):
- # Turn SO_REUSEADDR on for TCP sockets; if we want to support UDS, we will
- # need to update this function.
+def _asyncio_apply_socket_options(object s, int flags):
+ # Turn SO_REUSEADDR on for TCP sockets; if we want to support UDS, we will
+ # need to update this function.
s.setsockopt(native_socket.SOL_SOCKET, native_socket.SO_REUSEADDR, 1)
- # SO_REUSEPORT only available in POSIX systems.
- if platform.system() != 'Windows':
- if GRPC_CUSTOM_SOCKET_OPT_SO_REUSEPORT & flags:
- s.setsockopt(native_socket.SOL_SOCKET, native_socket.SO_REUSEPORT, 1)
+ # SO_REUSEPORT only available in POSIX systems.
+ if platform.system() != 'Windows':
+ if GRPC_CUSTOM_SOCKET_OPT_SO_REUSEPORT & flags:
+ s.setsockopt(native_socket.SOL_SOCKET, native_socket.SO_REUSEPORT, 1)
s.setsockopt(native_socket.IPPROTO_TCP, native_socket.TCP_NODELAY, True)
@@ -147,10 +147,10 @@ cdef grpc_error* asyncio_socket_bind(
family = native_socket.AF_INET
socket = native_socket.socket(family=family)
- _asyncio_apply_socket_options(socket, flags)
+ _asyncio_apply_socket_options(socket, flags)
socket.bind((host, port))
except IOError as io_error:
- socket.close()
+ socket.close()
return socket_error("bind", str(io_error))
else:
aio_socket = _AsyncioSocket.create_with_py_socket(grpc_socket, socket)
@@ -167,8 +167,8 @@ cdef void asyncio_socket_accept(
cdef grpc_error* asyncio_resolve(
- const char* host,
- const char* port,
+ const char* host,
+ const char* port,
grpc_resolved_addresses** res) with gil:
result = native_socket.getaddrinfo(host, port)
res[0] = tuples_to_resolvaddr(result)
@@ -176,8 +176,8 @@ cdef grpc_error* asyncio_resolve(
cdef void asyncio_resolve_async(
grpc_custom_resolver* grpc_resolver,
- const char* host,
- const char* port) with gil:
+ const char* host,
+ const char* port) with gil:
resolver = _AsyncioResolver.create(grpc_resolver)
resolver.resolve(host, port)
@@ -188,12 +188,12 @@ cdef void asyncio_timer_start(grpc_custom_timer* grpc_timer) with gil:
cdef void asyncio_timer_stop(grpc_custom_timer* grpc_timer) with gil:
- # TODO(https://github.com/grpc/grpc/issues/22278) remove this if condition
- if grpc_timer.timer == NULL:
- return
- else:
- timer = <_AsyncioTimer>grpc_timer.timer
- timer.stop()
+ # TODO(https://github.com/grpc/grpc/issues/22278) remove this if condition
+ if grpc_timer.timer == NULL:
+ return
+ else:
+ timer = <_AsyncioTimer>grpc_timer.timer
+ timer.stop()
cdef void asyncio_init_loop() with gil:
@@ -212,18 +212,18 @@ cdef void asyncio_run_loop(size_t timeout_ms) with gil:
pass
-def _auth_plugin_callback_wrapper(object cb,
- str service_url,
- str method_name,
- object callback):
- get_working_loop().call_soon(cb, service_url, method_name, callback)
-
-
+def _auth_plugin_callback_wrapper(object cb,
+ str service_url,
+ str method_name,
+ object callback):
+ get_working_loop().call_soon(cb, service_url, method_name, callback)
+
+
def install_asyncio_iomgr():
- # Auth plugins invoke user provided logic in another thread by default. We
- # need to override that behavior by registering the call to the event loop.
- set_async_callback_func(_auth_plugin_callback_wrapper)
-
+ # Auth plugins invoke user provided logic in another thread by default. We
+ # need to override that behavior by registering the call to the event loop.
+ set_async_callback_func(_auth_plugin_callback_wrapper)
+
asyncio_resolver_vtable.resolve = asyncio_resolve
asyncio_resolver_vtable.resolve_async = asyncio_resolve_async
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/iomgr/resolver.pxd.pxi b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/iomgr/resolver.pxd.pxi
index 878c457f6f6..51730c15976 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/iomgr/resolver.pxd.pxi
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/iomgr/resolver.pxd.pxi
@@ -14,11 +14,11 @@
cdef class _AsyncioResolver:
cdef:
- object _loop
+ object _loop
grpc_custom_resolver* _grpc_resolver
object _task_resolve
@staticmethod
cdef _AsyncioResolver create(grpc_custom_resolver* grpc_resolver)
- cdef void resolve(self, const char* host, const char* port)
+ cdef void resolve(self, const char* host, const char* port)
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/iomgr/resolver.pyx.pxi b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/iomgr/resolver.pyx.pxi
index d9cd8be7201..1a2e244ff9c 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/iomgr/resolver.pyx.pxi
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/iomgr/resolver.pyx.pxi
@@ -15,7 +15,7 @@
cdef class _AsyncioResolver:
def __cinit__(self):
- self._loop = get_working_loop()
+ self._loop = get_working_loop()
self._grpc_resolver = NULL
self._task_resolve = None
@@ -30,27 +30,27 @@ cdef class _AsyncioResolver:
id_ = id(self)
return f"<{class_name} {id_}>"
- async def _async_resolve(self, bytes host, bytes port):
- self._task_resolve = None
+ async def _async_resolve(self, bytes host, bytes port):
+ self._task_resolve = None
try:
- resolved = await self._loop.getaddrinfo(host, port)
+ resolved = await self._loop.getaddrinfo(host, port)
except Exception as e:
grpc_custom_resolve_callback(
<grpc_custom_resolver*>self._grpc_resolver,
- NULL,
- grpc_socket_error("Resolve address [{}:{}] failed: {}: {}".format(
- host, port, type(e), str(e)).encode())
+ NULL,
+ grpc_socket_error("Resolve address [{}:{}] failed: {}: {}".format(
+ host, port, type(e), str(e)).encode())
)
else:
grpc_custom_resolve_callback(
<grpc_custom_resolver*>self._grpc_resolver,
- tuples_to_resolvaddr(resolved),
- <grpc_error*>0
+ tuples_to_resolvaddr(resolved),
+ <grpc_error*>0
)
- cdef void resolve(self, const char* host, const char* port):
+ cdef void resolve(self, const char* host, const char* port):
assert not self._task_resolve
- self._task_resolve = self._loop.create_task(
- self._async_resolve(host, port)
+ self._task_resolve = self._loop.create_task(
+ self._async_resolve(host, port)
)
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/iomgr/socket.pxd.pxi b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/iomgr/socket.pxd.pxi
index 43a07c44aa4..cfab5549b2e 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/iomgr/socket.pxd.pxi
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/iomgr/socket.pxd.pxi
@@ -18,20 +18,20 @@ cdef class _AsyncioSocket:
# Common attributes
grpc_custom_socket * _grpc_socket
grpc_custom_read_callback _grpc_read_cb
- grpc_custom_write_callback _grpc_write_cb
+ grpc_custom_write_callback _grpc_write_cb
object _reader
object _writer
object _task_read
- object _task_write
+ object _task_write
object _task_connect
- object _task_listen
+ object _task_listen
char * _read_buffer
- # Caches the picked event loop, so we can avoid the 30ns overhead each
- # time we need access to the event loop.
- object _loop
- # TODO(lidiz) Drop after 3.6 deprecation. Python 3.7 introduces methods
- # like `is_closing()` to help graceful shutdown.
- bint _closed
+ # Caches the picked event loop, so we can avoid the 30ns overhead each
+ # time we need access to the event loop.
+ object _loop
+ # TODO(lidiz) Drop after 3.6 deprecation. Python 3.7 introduces methods
+ # like `is_closing()` to help graceful shutdown.
+ bint _closed
# Client-side attributes
grpc_custom_connect_callback _grpc_connect_cb
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/iomgr/socket.pyx.pxi b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/iomgr/socket.pyx.pxi
index 778a21e9fea..eecef17d98a 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/iomgr/socket.pyx.pxi
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/iomgr/socket.pyx.pxi
@@ -16,28 +16,28 @@ import socket as native_socket
from libc cimport string
-cdef int _ASYNCIO_STREAM_DEFAULT_SOCKET_BACKLOG = 100
-
-
-# TODO(https://github.com/grpc/grpc/issues/21348) Better flow control needed.
+cdef int _ASYNCIO_STREAM_DEFAULT_SOCKET_BACKLOG = 100
+
+
+# TODO(https://github.com/grpc/grpc/issues/21348) Better flow control needed.
cdef class _AsyncioSocket:
def __cinit__(self):
self._grpc_socket = NULL
self._grpc_connect_cb = NULL
self._grpc_read_cb = NULL
- self._grpc_write_cb = NULL
+ self._grpc_write_cb = NULL
self._reader = None
self._writer = None
self._task_connect = None
self._task_read = None
- self._task_write = None
- self._task_listen = None
+ self._task_write = None
+ self._task_listen = None
self._read_buffer = NULL
self._server = None
self._py_socket = None
self._peername = None
- self._closed = False
- self._loop = get_working_loop()
+ self._closed = False
+ self._loop = get_working_loop()
@staticmethod
cdef _AsyncioSocket create(grpc_custom_socket * grpc_socket,
@@ -64,57 +64,57 @@ cdef class _AsyncioSocket:
connected = self.is_connected()
return f"<{class_name} {id_} connected={connected}>"
- async def _async_connect(self, object host, object port,):
- self._task_connect = None
+ async def _async_connect(self, object host, object port,):
+ self._task_connect = None
try:
- self._reader, self._writer = await asyncio.open_connection(host, port)
+ self._reader, self._writer = await asyncio.open_connection(host, port)
except Exception as e:
- self._grpc_connect_cb(
- <grpc_custom_socket*>self._grpc_socket,
- grpc_socket_error("Socket connect failed: {}: {}".format(type(e), str(e)).encode())
- )
- else:
- # gRPC default posix implementation disables nagle
- # algorithm.
- sock = self._writer.transport.get_extra_info('socket')
- sock.setsockopt(native_socket.IPPROTO_TCP, native_socket.TCP_NODELAY, True)
-
- self._grpc_connect_cb(
- <grpc_custom_socket*>self._grpc_socket,
- <grpc_error*>0
- )
-
- cdef void connect(self,
- object host,
- object port,
- grpc_custom_connect_callback grpc_connect_cb):
- assert not self._reader
- assert not self._task_connect
-
- self._task_connect = self._loop.create_task(
- self._async_connect(host, port)
- )
- self._grpc_connect_cb = grpc_connect_cb
-
- async def _async_read(self, size_t length):
- self._task_read = None
+ self._grpc_connect_cb(
+ <grpc_custom_socket*>self._grpc_socket,
+ grpc_socket_error("Socket connect failed: {}: {}".format(type(e), str(e)).encode())
+ )
+ else:
+ # gRPC default posix implementation disables nagle
+ # algorithm.
+ sock = self._writer.transport.get_extra_info('socket')
+ sock.setsockopt(native_socket.IPPROTO_TCP, native_socket.TCP_NODELAY, True)
+
+ self._grpc_connect_cb(
+ <grpc_custom_socket*>self._grpc_socket,
+ <grpc_error*>0
+ )
+
+ cdef void connect(self,
+ object host,
+ object port,
+ grpc_custom_connect_callback grpc_connect_cb):
+ assert not self._reader
+ assert not self._task_connect
+
+ self._task_connect = self._loop.create_task(
+ self._async_connect(host, port)
+ )
+ self._grpc_connect_cb = grpc_connect_cb
+
+ async def _async_read(self, size_t length):
+ self._task_read = None
try:
- inbound_buffer = await self._reader.read(n=length)
- except ConnectionError as e:
- self._grpc_read_cb(
- <grpc_custom_socket*>self._grpc_socket,
- -1,
- grpc_socket_error("Read failed: {}".format(e).encode())
- )
- else:
+ inbound_buffer = await self._reader.read(n=length)
+ except ConnectionError as e:
+ self._grpc_read_cb(
+ <grpc_custom_socket*>self._grpc_socket,
+ -1,
+ grpc_socket_error("Read failed: {}".format(e).encode())
+ )
+ else:
string.memcpy(
<void*>self._read_buffer,
- <char*>inbound_buffer,
- len(inbound_buffer)
+ <char*>inbound_buffer,
+ len(inbound_buffer)
)
self._grpc_read_cb(
<grpc_custom_socket*>self._grpc_socket,
- len(inbound_buffer),
+ len(inbound_buffer),
<grpc_error*>0
)
@@ -123,53 +123,53 @@ cdef class _AsyncioSocket:
self._grpc_read_cb = grpc_read_cb
self._read_buffer = buffer_
- self._task_read = self._loop.create_task(self._async_read(length))
-
- async def _async_write(self, bytearray outbound_buffer):
- self._writer.write(outbound_buffer)
- self._task_write = None
- try:
- await self._writer.drain()
- self._grpc_write_cb(
- <grpc_custom_socket*>self._grpc_socket,
- <grpc_error*>0
- )
- except ConnectionError as connection_error:
- self._grpc_write_cb(
- <grpc_custom_socket*>self._grpc_socket,
- grpc_socket_error("Socket write failed: {}".format(connection_error).encode()),
- )
-
+ self._task_read = self._loop.create_task(self._async_read(length))
+
+ async def _async_write(self, bytearray outbound_buffer):
+ self._writer.write(outbound_buffer)
+ self._task_write = None
+ try:
+ await self._writer.drain()
+ self._grpc_write_cb(
+ <grpc_custom_socket*>self._grpc_socket,
+ <grpc_error*>0
+ )
+ except ConnectionError as connection_error:
+ self._grpc_write_cb(
+ <grpc_custom_socket*>self._grpc_socket,
+ grpc_socket_error("Socket write failed: {}".format(connection_error).encode()),
+ )
+
cdef void write(self, grpc_slice_buffer * g_slice_buffer, grpc_custom_write_callback grpc_write_cb):
- """Performs write to network socket in AsyncIO.
-
- For each socket, Core guarantees there'll be only one ongoing write.
- When the write is finished, we need to call grpc_write_cb to notify
- Core that the work is done.
- """
- assert not self._task_write
+ """Performs write to network socket in AsyncIO.
+
+ For each socket, Core guarantees there'll be only one ongoing write.
+ When the write is finished, we need to call grpc_write_cb to notify
+ Core that the work is done.
+ """
+ assert not self._task_write
cdef char* start
- cdef bytearray outbound_buffer = bytearray()
+ cdef bytearray outbound_buffer = bytearray()
for i in range(g_slice_buffer.count):
start = grpc_slice_buffer_start(g_slice_buffer, i)
length = grpc_slice_buffer_length(g_slice_buffer, i)
- outbound_buffer.extend(<bytes>start[:length])
+ outbound_buffer.extend(<bytes>start[:length])
- self._grpc_write_cb = grpc_write_cb
- self._task_write = self._loop.create_task(self._async_write(outbound_buffer))
+ self._grpc_write_cb = grpc_write_cb
+ self._task_write = self._loop.create_task(self._async_write(outbound_buffer))
cdef bint is_connected(self):
return self._reader and not self._reader._transport.is_closing()
cdef void close(self):
- if self._closed:
- return
- else:
- self._closed = True
+ if self._closed:
+ return
+ else:
+ self._closed = True
if self.is_connected():
self._writer.close()
- if self._task_listen and not self._task_listen.done():
- self._task_listen.close()
+ if self._task_listen and not self._task_listen.done():
+ self._task_listen.close()
if self._server:
self._server.close()
# NOTE(lidiz) If the asyncio.Server is created from a Python socket,
@@ -179,15 +179,15 @@ cdef class _AsyncioSocket:
self._py_socket.close()
def _new_connection_callback(self, object reader, object writer):
- # If the socket is closed, stop.
- if self._closed:
- return
-
- # Close the connection if server is not started yet.
- if self._grpc_accept_cb == NULL:
- writer.close()
- return
-
+ # If the socket is closed, stop.
+ if self._closed:
+ return
+
+ # Close the connection if server is not started yet.
+ if self._grpc_accept_cb == NULL:
+ writer.close()
+ return
+
client_socket = _AsyncioSocket.create(
self._grpc_client_socket,
reader,
@@ -197,20 +197,20 @@ cdef class _AsyncioSocket:
self._grpc_client_socket.impl = <void*>client_socket
cpython.Py_INCREF(client_socket) # Py_DECREF in asyncio_socket_destroy
# Accept callback expects to be called with:
- # * grpc_custom_socket: A grpc custom socket for server
- # * grpc_custom_socket: A grpc custom socket for client (with new Socket instance)
- # * grpc_error: An error object
+ # * grpc_custom_socket: A grpc custom socket for server
+ # * grpc_custom_socket: A grpc custom socket for client (with new Socket instance)
+ # * grpc_error: An error object
self._grpc_accept_cb(self._grpc_socket, self._grpc_client_socket, grpc_error_none())
cdef listen(self):
- self._py_socket.listen(_ASYNCIO_STREAM_DEFAULT_SOCKET_BACKLOG)
+ self._py_socket.listen(_ASYNCIO_STREAM_DEFAULT_SOCKET_BACKLOG)
async def create_asyncio_server():
self._server = await asyncio.start_server(
self._new_connection_callback,
sock=self._py_socket,
)
- self._task_listen = self._loop.create_task(create_asyncio_server())
+ self._task_listen = self._loop.create_task(create_asyncio_server())
cdef accept(self,
grpc_custom_socket* grpc_socket_client,
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/iomgr/timer.pxd.pxi b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/iomgr/timer.pxd.pxi
index a9511dc5ad8..76c3be0c57c 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/iomgr/timer.pxd.pxi
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/iomgr/timer.pxd.pxi
@@ -15,11 +15,11 @@
cdef class _AsyncioTimer:
cdef:
grpc_custom_timer * _grpc_timer
- object _timer_future
- bint _active
- object _loop
+ object _timer_future
+ bint _active
+ object _loop
@staticmethod
- cdef _AsyncioTimer create(grpc_custom_timer * grpc_timer, float timeout)
+ cdef _AsyncioTimer create(grpc_custom_timer * grpc_timer, float timeout)
cdef stop(self)
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/iomgr/timer.pyx.pxi b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/iomgr/timer.pyx.pxi
index 7a6ffd14793..c1508373a4b 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/iomgr/timer.pyx.pxi
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/iomgr/timer.pyx.pxi
@@ -16,23 +16,23 @@
cdef class _AsyncioTimer:
def __cinit__(self):
self._grpc_timer = NULL
- self._timer_future = None
- self._active = False
- self._loop = get_working_loop()
- cpython.Py_INCREF(self)
+ self._timer_future = None
+ self._active = False
+ self._loop = get_working_loop()
+ cpython.Py_INCREF(self)
@staticmethod
- cdef _AsyncioTimer create(grpc_custom_timer * grpc_timer, float timeout):
+ cdef _AsyncioTimer create(grpc_custom_timer * grpc_timer, float timeout):
timer = _AsyncioTimer()
timer._grpc_timer = grpc_timer
- timer._timer_future = timer._loop.call_later(timeout, timer.on_time_up)
- timer._active = True
+ timer._timer_future = timer._loop.call_later(timeout, timer.on_time_up)
+ timer._active = True
return timer
- def on_time_up(self):
- self._active = False
+ def on_time_up(self):
+ self._active = False
grpc_custom_timer_callback(self._grpc_timer, <grpc_error*>0)
- cpython.Py_DECREF(self)
+ cpython.Py_DECREF(self)
def __repr__(self):
class_name = self.__class__.__name__
@@ -40,9 +40,9 @@ cdef class _AsyncioTimer:
return f"<{class_name} {id_} deadline={self._deadline} active={self._active}>"
cdef stop(self):
- if not self._active:
+ if not self._active:
return
- self._timer_future.cancel()
- self._active = False
- cpython.Py_DECREF(self)
+ self._timer_future.cancel()
+ self._active = False
+ cpython.Py_DECREF(self)
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/rpc_status.pxd.pxi b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/rpc_status.pxd.pxi
index c9fb962b6ad..3780d8ddf2f 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/rpc_status.pxd.pxi
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/rpc_status.pxd.pxi
@@ -1,29 +1,29 @@
-# Copyright 2019 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-"""Exceptions for the aio version of the RPC calls."""
-
-
-cdef class AioRpcStatus(Exception):
- cdef readonly:
- grpc_status_code _code
- str _details
- # Per the spec, only client-side status has trailing metadata.
- tuple _trailing_metadata
- str _debug_error_string
-
- cpdef grpc_status_code code(self)
- cpdef str details(self)
- cpdef tuple trailing_metadata(self)
- cpdef str debug_error_string(self)
- cdef grpc_status_code c_code(self)
+# Copyright 2019 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+"""Exceptions for the aio version of the RPC calls."""
+
+
+cdef class AioRpcStatus(Exception):
+ cdef readonly:
+ grpc_status_code _code
+ str _details
+ # Per the spec, only client-side status has trailing metadata.
+ tuple _trailing_metadata
+ str _debug_error_string
+
+ cpdef grpc_status_code code(self)
+ cpdef str details(self)
+ cpdef tuple trailing_metadata(self)
+ cpdef str debug_error_string(self)
+ cdef grpc_status_code c_code(self)
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/rpc_status.pyx.pxi b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/rpc_status.pyx.pxi
index 95890cfda3e..07669fc1575 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/rpc_status.pyx.pxi
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/rpc_status.pyx.pxi
@@ -1,44 +1,44 @@
-# Copyright 2019 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-"""Exceptions for the aio version of the RPC calls."""
-
-
-cdef class AioRpcStatus(Exception):
-
- # The final status of gRPC is represented by three trailing metadata:
- # `grpc-status`, `grpc-status-message`, abd `grpc-status-details`.
- def __cinit__(self,
- grpc_status_code code,
- str details,
- tuple trailing_metadata,
- str debug_error_string):
- self._code = code
- self._details = details
- self._trailing_metadata = trailing_metadata
- self._debug_error_string = debug_error_string
-
- cpdef grpc_status_code code(self):
- return self._code
-
- cpdef str details(self):
- return self._details
-
- cpdef tuple trailing_metadata(self):
- return self._trailing_metadata
-
- cpdef str debug_error_string(self):
- return self._debug_error_string
-
- cdef grpc_status_code c_code(self):
- return <grpc_status_code>self._code
+# Copyright 2019 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+"""Exceptions for the aio version of the RPC calls."""
+
+
+cdef class AioRpcStatus(Exception):
+
+ # The final status of gRPC is represented by three trailing metadata:
+ # `grpc-status`, `grpc-status-message`, abd `grpc-status-details`.
+ def __cinit__(self,
+ grpc_status_code code,
+ str details,
+ tuple trailing_metadata,
+ str debug_error_string):
+ self._code = code
+ self._details = details
+ self._trailing_metadata = trailing_metadata
+ self._debug_error_string = debug_error_string
+
+ cpdef grpc_status_code code(self):
+ return self._code
+
+ cpdef str details(self):
+ return self._details
+
+ cpdef tuple trailing_metadata(self):
+ return self._trailing_metadata
+
+ cpdef str debug_error_string(self):
+ return self._debug_error_string
+
+ cdef grpc_status_code c_code(self):
+ return <grpc_status_code>self._code
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/server.pxd.pxi b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/server.pxd.pxi
index 5cca5b044c5..46a47bd1ba7 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/server.pxd.pxi
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/server.pxd.pxi
@@ -20,45 +20,45 @@ cdef class _HandlerCallDetails:
cdef class RPCState(GrpcCallWrapper):
cdef grpc_call_details details
cdef grpc_metadata_array request_metadata
- cdef AioServer server
- # NOTE(lidiz) Under certain corner case, receiving the client close
- # operation won't immediately fail ongoing RECV_MESSAGE operations. Here I
- # added a flag to workaround this unexpected behavior.
- cdef bint client_closed
- cdef object abort_exception
- cdef bint metadata_sent
- cdef bint status_sent
- cdef grpc_status_code status_code
- cdef str status_details
- cdef tuple trailing_metadata
- cdef object compression_algorithm
- cdef bint disable_next_compression
+ cdef AioServer server
+ # NOTE(lidiz) Under certain corner case, receiving the client close
+ # operation won't immediately fail ongoing RECV_MESSAGE operations. Here I
+ # added a flag to workaround this unexpected behavior.
+ cdef bint client_closed
+ cdef object abort_exception
+ cdef bint metadata_sent
+ cdef bint status_sent
+ cdef grpc_status_code status_code
+ cdef str status_details
+ cdef tuple trailing_metadata
+ cdef object compression_algorithm
+ cdef bint disable_next_compression
cdef bytes method(self)
- cdef tuple invocation_metadata(self)
- cdef void raise_for_termination(self) except *
- cdef int get_write_flag(self)
- cdef Operation create_send_initial_metadata_op_if_not_sent(self)
+ cdef tuple invocation_metadata(self)
+ cdef void raise_for_termination(self) except *
+ cdef int get_write_flag(self)
+ cdef Operation create_send_initial_metadata_op_if_not_sent(self)
+
+
+cdef class _ServicerContext:
+ cdef RPCState _rpc_state
+ cdef object _loop # asyncio.AbstractEventLoop
+ cdef object _request_deserializer # Callable[[bytes], Any]
+ cdef object _response_serializer # Callable[[Any], bytes]
+
+
+cdef class _SyncServicerContext:
+ cdef _ServicerContext _context
+ cdef list _callbacks
+ cdef object _loop # asyncio.AbstractEventLoop
+
+
+cdef class _MessageReceiver:
+ cdef _ServicerContext _servicer_context
+ cdef object _agen
-cdef class _ServicerContext:
- cdef RPCState _rpc_state
- cdef object _loop # asyncio.AbstractEventLoop
- cdef object _request_deserializer # Callable[[bytes], Any]
- cdef object _response_serializer # Callable[[Any], bytes]
-
-
-cdef class _SyncServicerContext:
- cdef _ServicerContext _context
- cdef list _callbacks
- cdef object _loop # asyncio.AbstractEventLoop
-
-
-cdef class _MessageReceiver:
- cdef _ServicerContext _servicer_context
- cdef object _agen
-
-
cdef enum AioServerStatus:
AIO_SERVER_STATUS_UNKNOWN
AIO_SERVER_STATUS_READY
@@ -77,7 +77,7 @@ cdef class AioServer:
cdef object _shutdown_completed # asyncio.Future
cdef CallbackWrapper _shutdown_callback_wrapper
cdef object _crash_exception # Exception
- cdef tuple _interceptors
- cdef object _thread_pool # concurrent.futures.ThreadPoolExecutor
-
- cdef thread_pool(self)
+ cdef tuple _interceptors
+ cdef object _thread_pool # concurrent.futures.ThreadPoolExecutor
+
+ cdef thread_pool(self)
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/server.pyx.pxi b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/server.pyx.pxi
index 5573be76716..a630ed88117 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/server.pyx.pxi
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/server.pyx.pxi
@@ -12,786 +12,786 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-
-import inspect
-import traceback
-import functools
-
-
+
+import inspect
+import traceback
+import functools
+
+
cdef int _EMPTY_FLAG = 0
-cdef str _RPC_FINISHED_DETAILS = 'RPC already finished.'
-cdef str _SERVER_STOPPED_DETAILS = 'Server already stopped.'
-
-cdef _augment_metadata(tuple metadata, object compression):
- if compression is None:
- return metadata
- else:
- return ((
- GRPC_COMPRESSION_REQUEST_ALGORITHM_MD_KEY,
- _COMPRESSION_METADATA_STRING_MAPPING[compression]
- ),) + metadata
-
-
+cdef str _RPC_FINISHED_DETAILS = 'RPC already finished.'
+cdef str _SERVER_STOPPED_DETAILS = 'Server already stopped.'
+
+cdef _augment_metadata(tuple metadata, object compression):
+ if compression is None:
+ return metadata
+ else:
+ return ((
+ GRPC_COMPRESSION_REQUEST_ALGORITHM_MD_KEY,
+ _COMPRESSION_METADATA_STRING_MAPPING[compression]
+ ),) + metadata
+
+
cdef class _HandlerCallDetails:
def __cinit__(self, str method, tuple invocation_metadata):
self.method = method
self.invocation_metadata = invocation_metadata
-class _ServerStoppedError(BaseError):
- """Raised if the server is stopped."""
-
-
+class _ServerStoppedError(BaseError):
+ """Raised if the server is stopped."""
+
+
cdef class RPCState:
- def __cinit__(self, AioServer server):
- init_grpc_aio()
- self.call = NULL
- self.server = server
+ def __cinit__(self, AioServer server):
+ init_grpc_aio()
+ self.call = NULL
+ self.server = server
grpc_metadata_array_init(&self.request_metadata)
grpc_call_details_init(&self.details)
- self.client_closed = False
- self.abort_exception = None
- self.metadata_sent = False
- self.status_sent = False
- self.status_code = StatusCode.ok
- self.status_details = ''
- self.trailing_metadata = _IMMUTABLE_EMPTY_METADATA
- self.compression_algorithm = None
- self.disable_next_compression = False
+ self.client_closed = False
+ self.abort_exception = None
+ self.metadata_sent = False
+ self.status_sent = False
+ self.status_code = StatusCode.ok
+ self.status_details = ''
+ self.trailing_metadata = _IMMUTABLE_EMPTY_METADATA
+ self.compression_algorithm = None
+ self.disable_next_compression = False
cdef bytes method(self):
- return _slice_bytes(self.details.method)
-
- cdef tuple invocation_metadata(self):
- return _metadata(&self.request_metadata)
-
- cdef void raise_for_termination(self) except *:
- """Raise exceptions if RPC is not running.
-
- Server method handlers may suppress the abort exception. We need to halt
- the RPC execution in that case. This function needs to be called after
- running application code.
-
- Also, the server may stop unexpected. We need to check before calling
- into Core functions, otherwise, segfault.
- """
- if self.abort_exception is not None:
- raise self.abort_exception
- if self.status_sent:
- raise UsageError(_RPC_FINISHED_DETAILS)
- if self.server._status == AIO_SERVER_STATUS_STOPPED:
- raise _ServerStoppedError(_SERVER_STOPPED_DETAILS)
-
- cdef int get_write_flag(self):
- if self.disable_next_compression:
- self.disable_next_compression = False
- return WriteFlag.no_compress
- else:
- return _EMPTY_FLAG
-
- cdef Operation create_send_initial_metadata_op_if_not_sent(self):
- cdef SendInitialMetadataOperation op
- if self.metadata_sent:
- return None
- else:
- op = SendInitialMetadataOperation(
- _augment_metadata(_IMMUTABLE_EMPTY_METADATA, self.compression_algorithm),
- _EMPTY_FLAG
- )
- return op
-
+ return _slice_bytes(self.details.method)
+
+ cdef tuple invocation_metadata(self):
+ return _metadata(&self.request_metadata)
+
+ cdef void raise_for_termination(self) except *:
+ """Raise exceptions if RPC is not running.
+
+ Server method handlers may suppress the abort exception. We need to halt
+ the RPC execution in that case. This function needs to be called after
+ running application code.
+
+ Also, the server may stop unexpected. We need to check before calling
+ into Core functions, otherwise, segfault.
+ """
+ if self.abort_exception is not None:
+ raise self.abort_exception
+ if self.status_sent:
+ raise UsageError(_RPC_FINISHED_DETAILS)
+ if self.server._status == AIO_SERVER_STATUS_STOPPED:
+ raise _ServerStoppedError(_SERVER_STOPPED_DETAILS)
+
+ cdef int get_write_flag(self):
+ if self.disable_next_compression:
+ self.disable_next_compression = False
+ return WriteFlag.no_compress
+ else:
+ return _EMPTY_FLAG
+
+ cdef Operation create_send_initial_metadata_op_if_not_sent(self):
+ cdef SendInitialMetadataOperation op
+ if self.metadata_sent:
+ return None
+ else:
+ op = SendInitialMetadataOperation(
+ _augment_metadata(_IMMUTABLE_EMPTY_METADATA, self.compression_algorithm),
+ _EMPTY_FLAG
+ )
+ return op
+
def __dealloc__(self):
"""Cleans the Core objects."""
grpc_call_details_destroy(&self.details)
grpc_metadata_array_destroy(&self.request_metadata)
if self.call:
grpc_call_unref(self.call)
- shutdown_grpc_aio()
-
-
-cdef class _ServicerContext:
-
- def __cinit__(self,
- RPCState rpc_state,
- object request_deserializer,
- object response_serializer,
- object loop):
- self._rpc_state = rpc_state
- self._request_deserializer = request_deserializer
- self._response_serializer = response_serializer
- self._loop = loop
-
- async def read(self):
- cdef bytes raw_message
- self._rpc_state.raise_for_termination()
-
- raw_message = await _receive_message(self._rpc_state, self._loop)
- self._rpc_state.raise_for_termination()
-
- if raw_message is None:
- return EOF
- else:
- return deserialize(self._request_deserializer,
- raw_message)
-
- async def write(self, object message):
- self._rpc_state.raise_for_termination()
-
- await _send_message(self._rpc_state,
- serialize(self._response_serializer, message),
- self._rpc_state.create_send_initial_metadata_op_if_not_sent(),
- self._rpc_state.get_write_flag(),
- self._loop)
- self._rpc_state.metadata_sent = True
-
- async def send_initial_metadata(self, object metadata):
- self._rpc_state.raise_for_termination()
-
- if self._rpc_state.metadata_sent:
- raise UsageError('Send initial metadata failed: already sent')
- else:
- await _send_initial_metadata(
- self._rpc_state,
- _augment_metadata(tuple(metadata), self._rpc_state.compression_algorithm),
- _EMPTY_FLAG,
- self._loop
- )
- self._rpc_state.metadata_sent = True
-
- async def abort(self,
- object code,
- str details='',
- tuple trailing_metadata=_IMMUTABLE_EMPTY_METADATA):
- if self._rpc_state.abort_exception is not None:
- raise UsageError('Abort already called!')
- else:
- # Keeps track of the exception object. After abort happen, the RPC
- # should stop execution. However, if users decided to suppress it, it
- # could lead to undefined behavior.
- self._rpc_state.abort_exception = AbortError('Locally aborted.')
-
- if trailing_metadata == _IMMUTABLE_EMPTY_METADATA and self._rpc_state.trailing_metadata:
- trailing_metadata = self._rpc_state.trailing_metadata
-
- if details == '' and self._rpc_state.status_details:
- details = self._rpc_state.status_details
-
- actual_code = get_status_code(code)
-
- self._rpc_state.status_sent = True
- await _send_error_status_from_server(
- self._rpc_state,
- actual_code,
- details,
- trailing_metadata,
- self._rpc_state.create_send_initial_metadata_op_if_not_sent(),
- self._loop
- )
-
- raise self._rpc_state.abort_exception
-
- async def abort_with_status(self, object status):
- await self.abort(status.code, status.details, status.trailing_metadata)
-
- def set_trailing_metadata(self, object metadata):
- self._rpc_state.trailing_metadata = tuple(metadata)
-
- def invocation_metadata(self):
- return self._rpc_state.invocation_metadata()
-
- def set_code(self, object code):
- self._rpc_state.status_code = get_status_code(code)
-
- def set_details(self, str details):
- self._rpc_state.status_details = details
-
- def set_compression(self, object compression):
- if self._rpc_state.metadata_sent:
- raise RuntimeError('Compression setting must be specified before sending initial metadata')
- else:
- self._rpc_state.compression_algorithm = compression
-
- def disable_next_message_compression(self):
- self._rpc_state.disable_next_compression = True
-
- def peer(self):
- cdef char *c_peer = NULL
- c_peer = grpc_call_get_peer(self._rpc_state.call)
- peer = (<bytes>c_peer).decode('utf8')
- gpr_free(c_peer)
- return peer
-
- def peer_identities(self):
- cdef Call query_call = Call()
- query_call.c_call = self._rpc_state.call
- identities = peer_identities(query_call)
- query_call.c_call = NULL
- return identities
-
- def peer_identity_key(self):
- cdef Call query_call = Call()
- query_call.c_call = self._rpc_state.call
- identity_key = peer_identity_key(query_call)
- query_call.c_call = NULL
- if identity_key:
- return identity_key.decode('utf8')
- else:
- return None
-
- def auth_context(self):
- cdef Call query_call = Call()
- query_call.c_call = self._rpc_state.call
- bytes_ctx = auth_context(query_call)
- query_call.c_call = NULL
- if bytes_ctx:
- ctx = {}
- for key in bytes_ctx:
- ctx[key.decode('utf8')] = bytes_ctx[key]
- return ctx
- else:
- return {}
-
-
-cdef class _SyncServicerContext:
- """Sync servicer context for sync handler compatibility."""
-
- def __cinit__(self,
- _ServicerContext context):
- self._context = context
- self._callbacks = []
- self._loop = context._loop
-
- def abort(self,
- object code,
- str details='',
- tuple trailing_metadata=_IMMUTABLE_EMPTY_METADATA):
- future = asyncio.run_coroutine_threadsafe(
- self._context.abort(code, details, trailing_metadata),
- self._loop)
- # Abort should raise an AbortError
- future.exception()
-
- def send_initial_metadata(self, object metadata):
- future = asyncio.run_coroutine_threadsafe(
- self._context.send_initial_metadata(metadata),
- self._loop)
- future.result()
-
- def set_trailing_metadata(self, object metadata):
- self._context.set_trailing_metadata(metadata)
-
- def invocation_metadata(self):
- return self._context.invocation_metadata()
-
- def set_code(self, object code):
- self._context.set_code(code)
-
- def set_details(self, str details):
- self._context.set_details(details)
-
- def set_compression(self, object compression):
- self._context.set_compression(compression)
-
- def disable_next_message_compression(self):
- self._context.disable_next_message_compression()
-
- def add_callback(self, object callback):
- self._callbacks.append(callback)
-
- def peer(self):
- return self._context.peer()
-
- def peer_identities(self):
- return self._context.peer_identities()
-
- def peer_identity_key(self):
- return self._context.peer_identity_key()
-
- def auth_context(self):
- return self._context.auth_context()
-
-
-async def _run_interceptor(object interceptors, object query_handler,
- object handler_call_details):
- interceptor = next(interceptors, None)
- if interceptor:
- continuation = functools.partial(_run_interceptor, interceptors,
- query_handler)
- return await interceptor.intercept_service(continuation, handler_call_details)
- else:
- return query_handler(handler_call_details)
-
-
-def _is_async_handler(object handler):
- """Inspect if a method handler is async or sync."""
- return inspect.isawaitable(handler) or inspect.iscoroutinefunction(handler) or inspect.isasyncgenfunction(handler)
-
-
-async def _find_method_handler(str method, tuple metadata, list generic_handlers,
- tuple interceptors):
- def query_handlers(handler_call_details):
- for generic_handler in generic_handlers:
- method_handler = generic_handler.service(handler_call_details)
- if method_handler is not None:
- return method_handler
- return None
-
- cdef _HandlerCallDetails handler_call_details = _HandlerCallDetails(method,
- metadata)
- # interceptor
- if interceptors:
- return await _run_interceptor(iter(interceptors), query_handlers,
- handler_call_details)
- else:
- return query_handlers(handler_call_details)
-
-
-async def _finish_handler_with_unary_response(RPCState rpc_state,
- object unary_handler,
- object request,
- _ServicerContext servicer_context,
- object response_serializer,
- object loop):
- """Finishes server method handler with a single response.
-
- This function executes the application handler, and handles response
- sending, as well as errors. It is shared between unary-unary and
- stream-unary handlers.
- """
- # Executes application logic
- cdef object response_message
- cdef _SyncServicerContext sync_servicer_context
-
- if _is_async_handler(unary_handler):
- # Run async method handlers in this coroutine
- response_message = await unary_handler(
- request,
- servicer_context,
- )
- else:
- # Run sync method handlers in the thread pool
- sync_servicer_context = _SyncServicerContext(servicer_context)
- response_message = await loop.run_in_executor(
- rpc_state.server.thread_pool(),
- unary_handler,
- request,
- sync_servicer_context,
- )
- # Support sync-stack callback
- for callback in sync_servicer_context._callbacks:
- callback()
-
- # Raises exception if aborted
- rpc_state.raise_for_termination()
-
- # Serializes the response message
- cdef bytes response_raw
- if rpc_state.status_code == StatusCode.ok:
- response_raw = serialize(
- response_serializer,
- response_message,
- )
- else:
- # Discards the response message if the status code is non-OK.
- response_raw = b''
-
- # Assembles the batch operations
- cdef tuple finish_ops
- finish_ops = (
- SendMessageOperation(response_raw, rpc_state.get_write_flag()),
- SendStatusFromServerOperation(
- rpc_state.trailing_metadata,
- rpc_state.status_code,
- rpc_state.status_details,
- _EMPTY_FLAGS,
- ),
- )
- if not rpc_state.metadata_sent:
- finish_ops = prepend_send_initial_metadata_op(
- finish_ops,
- None)
- rpc_state.metadata_sent = True
- rpc_state.status_sent = True
- await execute_batch(rpc_state, finish_ops, loop)
-
-
-async def _finish_handler_with_stream_responses(RPCState rpc_state,
- object stream_handler,
- object request,
- _ServicerContext servicer_context,
- object loop):
- """Finishes server method handler with multiple responses.
-
- This function executes the application handler, and handles response
- sending, as well as errors. It is shared between unary-stream and
- stream-stream handlers.
- """
- cdef object async_response_generator
- cdef object response_message
-
- if inspect.iscoroutinefunction(stream_handler):
- # Case 1: Coroutine async handler - using reader-writer API
- # The handler uses reader / writer API, returns None.
- await stream_handler(
- request,
- servicer_context,
- )
- else:
- if inspect.isasyncgenfunction(stream_handler):
- # Case 2: Async handler - async generator
- # The handler uses async generator API
- async_response_generator = stream_handler(
- request,
- servicer_context,
- )
- else:
- # Case 3: Sync handler - normal generator
- # NOTE(lidiz) Streaming handler in sync stack is either a generator
- # function or a function returns a generator.
- sync_servicer_context = _SyncServicerContext(servicer_context)
- gen = stream_handler(request, sync_servicer_context)
- async_response_generator = generator_to_async_generator(gen,
- loop,
- rpc_state.server.thread_pool())
-
- # Consumes messages from the generator
- async for response_message in async_response_generator:
- # Raises exception if aborted
- rpc_state.raise_for_termination()
-
- await servicer_context.write(response_message)
-
- # Raises exception if aborted
- rpc_state.raise_for_termination()
-
- # Sends the final status of this RPC
- cdef SendStatusFromServerOperation op = SendStatusFromServerOperation(
- rpc_state.trailing_metadata,
- rpc_state.status_code,
- rpc_state.status_details,
- _EMPTY_FLAGS,
- )
-
- cdef tuple finish_ops = (op,)
- if not rpc_state.metadata_sent:
- finish_ops = prepend_send_initial_metadata_op(
- finish_ops,
- None
- )
- rpc_state.metadata_sent = True
- rpc_state.status_sent = True
- await execute_batch(rpc_state, finish_ops, loop)
-
-
+ shutdown_grpc_aio()
+
+
+cdef class _ServicerContext:
+
+ def __cinit__(self,
+ RPCState rpc_state,
+ object request_deserializer,
+ object response_serializer,
+ object loop):
+ self._rpc_state = rpc_state
+ self._request_deserializer = request_deserializer
+ self._response_serializer = response_serializer
+ self._loop = loop
+
+ async def read(self):
+ cdef bytes raw_message
+ self._rpc_state.raise_for_termination()
+
+ raw_message = await _receive_message(self._rpc_state, self._loop)
+ self._rpc_state.raise_for_termination()
+
+ if raw_message is None:
+ return EOF
+ else:
+ return deserialize(self._request_deserializer,
+ raw_message)
+
+ async def write(self, object message):
+ self._rpc_state.raise_for_termination()
+
+ await _send_message(self._rpc_state,
+ serialize(self._response_serializer, message),
+ self._rpc_state.create_send_initial_metadata_op_if_not_sent(),
+ self._rpc_state.get_write_flag(),
+ self._loop)
+ self._rpc_state.metadata_sent = True
+
+ async def send_initial_metadata(self, object metadata):
+ self._rpc_state.raise_for_termination()
+
+ if self._rpc_state.metadata_sent:
+ raise UsageError('Send initial metadata failed: already sent')
+ else:
+ await _send_initial_metadata(
+ self._rpc_state,
+ _augment_metadata(tuple(metadata), self._rpc_state.compression_algorithm),
+ _EMPTY_FLAG,
+ self._loop
+ )
+ self._rpc_state.metadata_sent = True
+
+ async def abort(self,
+ object code,
+ str details='',
+ tuple trailing_metadata=_IMMUTABLE_EMPTY_METADATA):
+ if self._rpc_state.abort_exception is not None:
+ raise UsageError('Abort already called!')
+ else:
+ # Keeps track of the exception object. After abort happen, the RPC
+ # should stop execution. However, if users decided to suppress it, it
+ # could lead to undefined behavior.
+ self._rpc_state.abort_exception = AbortError('Locally aborted.')
+
+ if trailing_metadata == _IMMUTABLE_EMPTY_METADATA and self._rpc_state.trailing_metadata:
+ trailing_metadata = self._rpc_state.trailing_metadata
+
+ if details == '' and self._rpc_state.status_details:
+ details = self._rpc_state.status_details
+
+ actual_code = get_status_code(code)
+
+ self._rpc_state.status_sent = True
+ await _send_error_status_from_server(
+ self._rpc_state,
+ actual_code,
+ details,
+ trailing_metadata,
+ self._rpc_state.create_send_initial_metadata_op_if_not_sent(),
+ self._loop
+ )
+
+ raise self._rpc_state.abort_exception
+
+ async def abort_with_status(self, object status):
+ await self.abort(status.code, status.details, status.trailing_metadata)
+
+ def set_trailing_metadata(self, object metadata):
+ self._rpc_state.trailing_metadata = tuple(metadata)
+
+ def invocation_metadata(self):
+ return self._rpc_state.invocation_metadata()
+
+ def set_code(self, object code):
+ self._rpc_state.status_code = get_status_code(code)
+
+ def set_details(self, str details):
+ self._rpc_state.status_details = details
+
+ def set_compression(self, object compression):
+ if self._rpc_state.metadata_sent:
+ raise RuntimeError('Compression setting must be specified before sending initial metadata')
+ else:
+ self._rpc_state.compression_algorithm = compression
+
+ def disable_next_message_compression(self):
+ self._rpc_state.disable_next_compression = True
+
+ def peer(self):
+ cdef char *c_peer = NULL
+ c_peer = grpc_call_get_peer(self._rpc_state.call)
+ peer = (<bytes>c_peer).decode('utf8')
+ gpr_free(c_peer)
+ return peer
+
+ def peer_identities(self):
+ cdef Call query_call = Call()
+ query_call.c_call = self._rpc_state.call
+ identities = peer_identities(query_call)
+ query_call.c_call = NULL
+ return identities
+
+ def peer_identity_key(self):
+ cdef Call query_call = Call()
+ query_call.c_call = self._rpc_state.call
+ identity_key = peer_identity_key(query_call)
+ query_call.c_call = NULL
+ if identity_key:
+ return identity_key.decode('utf8')
+ else:
+ return None
+
+ def auth_context(self):
+ cdef Call query_call = Call()
+ query_call.c_call = self._rpc_state.call
+ bytes_ctx = auth_context(query_call)
+ query_call.c_call = NULL
+ if bytes_ctx:
+ ctx = {}
+ for key in bytes_ctx:
+ ctx[key.decode('utf8')] = bytes_ctx[key]
+ return ctx
+ else:
+ return {}
+
+
+cdef class _SyncServicerContext:
+ """Sync servicer context for sync handler compatibility."""
+
+ def __cinit__(self,
+ _ServicerContext context):
+ self._context = context
+ self._callbacks = []
+ self._loop = context._loop
+
+ def abort(self,
+ object code,
+ str details='',
+ tuple trailing_metadata=_IMMUTABLE_EMPTY_METADATA):
+ future = asyncio.run_coroutine_threadsafe(
+ self._context.abort(code, details, trailing_metadata),
+ self._loop)
+ # Abort should raise an AbortError
+ future.exception()
+
+ def send_initial_metadata(self, object metadata):
+ future = asyncio.run_coroutine_threadsafe(
+ self._context.send_initial_metadata(metadata),
+ self._loop)
+ future.result()
+
+ def set_trailing_metadata(self, object metadata):
+ self._context.set_trailing_metadata(metadata)
+
+ def invocation_metadata(self):
+ return self._context.invocation_metadata()
+
+ def set_code(self, object code):
+ self._context.set_code(code)
+
+ def set_details(self, str details):
+ self._context.set_details(details)
+
+ def set_compression(self, object compression):
+ self._context.set_compression(compression)
+
+ def disable_next_message_compression(self):
+ self._context.disable_next_message_compression()
+
+ def add_callback(self, object callback):
+ self._callbacks.append(callback)
+
+ def peer(self):
+ return self._context.peer()
+
+ def peer_identities(self):
+ return self._context.peer_identities()
+
+ def peer_identity_key(self):
+ return self._context.peer_identity_key()
+
+ def auth_context(self):
+ return self._context.auth_context()
+
+
+async def _run_interceptor(object interceptors, object query_handler,
+ object handler_call_details):
+ interceptor = next(interceptors, None)
+ if interceptor:
+ continuation = functools.partial(_run_interceptor, interceptors,
+ query_handler)
+ return await interceptor.intercept_service(continuation, handler_call_details)
+ else:
+ return query_handler(handler_call_details)
+
+
+def _is_async_handler(object handler):
+ """Inspect if a method handler is async or sync."""
+ return inspect.isawaitable(handler) or inspect.iscoroutinefunction(handler) or inspect.isasyncgenfunction(handler)
+
+
+async def _find_method_handler(str method, tuple metadata, list generic_handlers,
+ tuple interceptors):
+ def query_handlers(handler_call_details):
+ for generic_handler in generic_handlers:
+ method_handler = generic_handler.service(handler_call_details)
+ if method_handler is not None:
+ return method_handler
+ return None
+
+ cdef _HandlerCallDetails handler_call_details = _HandlerCallDetails(method,
+ metadata)
+ # interceptor
+ if interceptors:
+ return await _run_interceptor(iter(interceptors), query_handlers,
+ handler_call_details)
+ else:
+ return query_handlers(handler_call_details)
+
+
+async def _finish_handler_with_unary_response(RPCState rpc_state,
+ object unary_handler,
+ object request,
+ _ServicerContext servicer_context,
+ object response_serializer,
+ object loop):
+ """Finishes server method handler with a single response.
+
+ This function executes the application handler, and handles response
+ sending, as well as errors. It is shared between unary-unary and
+ stream-unary handlers.
+ """
+ # Executes application logic
+ cdef object response_message
+ cdef _SyncServicerContext sync_servicer_context
+
+ if _is_async_handler(unary_handler):
+ # Run async method handlers in this coroutine
+ response_message = await unary_handler(
+ request,
+ servicer_context,
+ )
+ else:
+ # Run sync method handlers in the thread pool
+ sync_servicer_context = _SyncServicerContext(servicer_context)
+ response_message = await loop.run_in_executor(
+ rpc_state.server.thread_pool(),
+ unary_handler,
+ request,
+ sync_servicer_context,
+ )
+ # Support sync-stack callback
+ for callback in sync_servicer_context._callbacks:
+ callback()
+
+ # Raises exception if aborted
+ rpc_state.raise_for_termination()
+
+ # Serializes the response message
+ cdef bytes response_raw
+ if rpc_state.status_code == StatusCode.ok:
+ response_raw = serialize(
+ response_serializer,
+ response_message,
+ )
+ else:
+ # Discards the response message if the status code is non-OK.
+ response_raw = b''
+
+ # Assembles the batch operations
+ cdef tuple finish_ops
+ finish_ops = (
+ SendMessageOperation(response_raw, rpc_state.get_write_flag()),
+ SendStatusFromServerOperation(
+ rpc_state.trailing_metadata,
+ rpc_state.status_code,
+ rpc_state.status_details,
+ _EMPTY_FLAGS,
+ ),
+ )
+ if not rpc_state.metadata_sent:
+ finish_ops = prepend_send_initial_metadata_op(
+ finish_ops,
+ None)
+ rpc_state.metadata_sent = True
+ rpc_state.status_sent = True
+ await execute_batch(rpc_state, finish_ops, loop)
+
+
+async def _finish_handler_with_stream_responses(RPCState rpc_state,
+ object stream_handler,
+ object request,
+ _ServicerContext servicer_context,
+ object loop):
+ """Finishes server method handler with multiple responses.
+
+ This function executes the application handler, and handles response
+ sending, as well as errors. It is shared between unary-stream and
+ stream-stream handlers.
+ """
+ cdef object async_response_generator
+ cdef object response_message
+
+ if inspect.iscoroutinefunction(stream_handler):
+ # Case 1: Coroutine async handler - using reader-writer API
+ # The handler uses reader / writer API, returns None.
+ await stream_handler(
+ request,
+ servicer_context,
+ )
+ else:
+ if inspect.isasyncgenfunction(stream_handler):
+ # Case 2: Async handler - async generator
+ # The handler uses async generator API
+ async_response_generator = stream_handler(
+ request,
+ servicer_context,
+ )
+ else:
+ # Case 3: Sync handler - normal generator
+ # NOTE(lidiz) Streaming handler in sync stack is either a generator
+ # function or a function returns a generator.
+ sync_servicer_context = _SyncServicerContext(servicer_context)
+ gen = stream_handler(request, sync_servicer_context)
+ async_response_generator = generator_to_async_generator(gen,
+ loop,
+ rpc_state.server.thread_pool())
+
+ # Consumes messages from the generator
+ async for response_message in async_response_generator:
+ # Raises exception if aborted
+ rpc_state.raise_for_termination()
+
+ await servicer_context.write(response_message)
+
+ # Raises exception if aborted
+ rpc_state.raise_for_termination()
+
+ # Sends the final status of this RPC
+ cdef SendStatusFromServerOperation op = SendStatusFromServerOperation(
+ rpc_state.trailing_metadata,
+ rpc_state.status_code,
+ rpc_state.status_details,
+ _EMPTY_FLAGS,
+ )
+
+ cdef tuple finish_ops = (op,)
+ if not rpc_state.metadata_sent:
+ finish_ops = prepend_send_initial_metadata_op(
+ finish_ops,
+ None
+ )
+ rpc_state.metadata_sent = True
+ rpc_state.status_sent = True
+ await execute_batch(rpc_state, finish_ops, loop)
+
+
async def _handle_unary_unary_rpc(object method_handler,
RPCState rpc_state,
object loop):
# Receives request message
- cdef bytes request_raw = await _receive_message(rpc_state, loop)
- if request_raw is None:
- # The RPC was cancelled immediately after start on client side.
- return
+ cdef bytes request_raw = await _receive_message(rpc_state, loop)
+ if request_raw is None:
+ # The RPC was cancelled immediately after start on client side.
+ return
+
+ # Deserializes the request message
+ cdef object request_message = deserialize(
+ method_handler.request_deserializer,
+ request_raw,
+ )
+
+ # Creates a dedecated ServicerContext
+ cdef _ServicerContext servicer_context = _ServicerContext(
+ rpc_state,
+ None,
+ None,
+ loop,
+ )
+
+ # Finishes the application handler
+ await _finish_handler_with_unary_response(
+ rpc_state,
+ method_handler.unary_unary,
+ request_message,
+ servicer_context,
+ method_handler.response_serializer,
+ loop
+ )
+
+
+async def _handle_unary_stream_rpc(object method_handler,
+ RPCState rpc_state,
+ object loop):
+ # Receives request message
+ cdef bytes request_raw = await _receive_message(rpc_state, loop)
+ if request_raw is None:
+ return
# Deserializes the request message
- cdef object request_message = deserialize(
- method_handler.request_deserializer,
- request_raw,
- )
-
- # Creates a dedecated ServicerContext
- cdef _ServicerContext servicer_context = _ServicerContext(
- rpc_state,
- None,
- None,
- loop,
- )
-
- # Finishes the application handler
- await _finish_handler_with_unary_response(
- rpc_state,
- method_handler.unary_unary,
- request_message,
- servicer_context,
- method_handler.response_serializer,
- loop
- )
-
-
-async def _handle_unary_stream_rpc(object method_handler,
- RPCState rpc_state,
- object loop):
- # Receives request message
- cdef bytes request_raw = await _receive_message(rpc_state, loop)
- if request_raw is None:
- return
-
- # Deserializes the request message
- cdef object request_message = deserialize(
- method_handler.request_deserializer,
- request_raw,
+ cdef object request_message = deserialize(
+ method_handler.request_deserializer,
+ request_raw,
+ )
+
+ # Creates a dedecated ServicerContext
+ cdef _ServicerContext servicer_context = _ServicerContext(
+ rpc_state,
+ method_handler.request_deserializer,
+ method_handler.response_serializer,
+ loop,
+ )
+
+ # Finishes the application handler
+ await _finish_handler_with_stream_responses(
+ rpc_state,
+ method_handler.unary_stream,
+ request_message,
+ servicer_context,
+ loop,
+ )
+
+
+cdef class _MessageReceiver:
+ """Bridge between the async generator API and the reader-writer API."""
+
+ def __cinit__(self, _ServicerContext servicer_context):
+ self._servicer_context = servicer_context
+ self._agen = None
+
+ async def _async_message_receiver(self):
+ """An async generator that receives messages."""
+ cdef object message
+ while True:
+ message = await self._servicer_context.read()
+ if message is not EOF:
+ yield message
+ else:
+ break
+
+ def __aiter__(self):
+ # Prevents never awaited warning if application never used the async generator
+ if self._agen is None:
+ self._agen = self._async_message_receiver()
+ return self._agen
+
+ async def __anext__(self):
+ return await self.__aiter__().__anext__()
+
+
+async def _handle_stream_unary_rpc(object method_handler,
+ RPCState rpc_state,
+ object loop):
+ # Creates a dedecated ServicerContext
+ cdef _ServicerContext servicer_context = _ServicerContext(
+ rpc_state,
+ method_handler.request_deserializer,
+ None,
+ loop,
)
- # Creates a dedecated ServicerContext
- cdef _ServicerContext servicer_context = _ServicerContext(
- rpc_state,
- method_handler.request_deserializer,
- method_handler.response_serializer,
- loop,
- )
-
- # Finishes the application handler
- await _finish_handler_with_stream_responses(
- rpc_state,
- method_handler.unary_stream,
- request_message,
- servicer_context,
- loop,
+ # Prepares the request generator
+ cdef object request_iterator
+ if _is_async_handler(method_handler.stream_unary):
+ request_iterator = _MessageReceiver(servicer_context)
+ else:
+ request_iterator = async_generator_to_generator(
+ _MessageReceiver(servicer_context),
+ loop
+ )
+
+ # Finishes the application handler
+ await _finish_handler_with_unary_response(
+ rpc_state,
+ method_handler.stream_unary,
+ request_iterator,
+ servicer_context,
+ method_handler.response_serializer,
+ loop
)
-cdef class _MessageReceiver:
- """Bridge between the async generator API and the reader-writer API."""
-
- def __cinit__(self, _ServicerContext servicer_context):
- self._servicer_context = servicer_context
- self._agen = None
-
- async def _async_message_receiver(self):
- """An async generator that receives messages."""
- cdef object message
- while True:
- message = await self._servicer_context.read()
- if message is not EOF:
- yield message
- else:
- break
-
- def __aiter__(self):
- # Prevents never awaited warning if application never used the async generator
- if self._agen is None:
- self._agen = self._async_message_receiver()
- return self._agen
-
- async def __anext__(self):
- return await self.__aiter__().__anext__()
-
-
-async def _handle_stream_unary_rpc(object method_handler,
- RPCState rpc_state,
- object loop):
- # Creates a dedecated ServicerContext
- cdef _ServicerContext servicer_context = _ServicerContext(
- rpc_state,
- method_handler.request_deserializer,
- None,
- loop,
- )
-
- # Prepares the request generator
- cdef object request_iterator
- if _is_async_handler(method_handler.stream_unary):
- request_iterator = _MessageReceiver(servicer_context)
- else:
- request_iterator = async_generator_to_generator(
- _MessageReceiver(servicer_context),
- loop
- )
-
- # Finishes the application handler
- await _finish_handler_with_unary_response(
- rpc_state,
- method_handler.stream_unary,
- request_iterator,
- servicer_context,
- method_handler.response_serializer,
- loop
- )
-
-
-async def _handle_stream_stream_rpc(object method_handler,
- RPCState rpc_state,
+async def _handle_stream_stream_rpc(object method_handler,
+ RPCState rpc_state,
object loop):
- # Creates a dedecated ServicerContext
- cdef _ServicerContext servicer_context = _ServicerContext(
- rpc_state,
- method_handler.request_deserializer,
- method_handler.response_serializer,
- loop,
+ # Creates a dedecated ServicerContext
+ cdef _ServicerContext servicer_context = _ServicerContext(
+ rpc_state,
+ method_handler.request_deserializer,
+ method_handler.response_serializer,
+ loop,
)
- # Prepares the request generator
- cdef object request_iterator
- if _is_async_handler(method_handler.stream_stream):
- request_iterator = _MessageReceiver(servicer_context)
- else:
- request_iterator = async_generator_to_generator(
- _MessageReceiver(servicer_context),
- loop
- )
-
- # Finishes the application handler
- await _finish_handler_with_stream_responses(
- rpc_state,
- method_handler.stream_stream,
- request_iterator,
- servicer_context,
- loop,
- )
-
-
-async def _handle_exceptions(RPCState rpc_state, object rpc_coro, object loop):
- try:
- try:
- await rpc_coro
- except AbortError as e:
- # Caught AbortError check if it is the same one
- assert rpc_state.abort_exception is e, 'Abort error has been replaced!'
- return
- else:
- # Check if the abort exception got suppressed
- if rpc_state.abort_exception is not None:
- _LOGGER.error(
- 'Abort error unexpectedly suppressed: %s',
- traceback.format_exception(rpc_state.abort_exception)
- )
- except (KeyboardInterrupt, SystemExit):
- raise
- except asyncio.CancelledError:
- _LOGGER.debug('RPC cancelled for servicer method [%s]', _decode(rpc_state.method()))
- except _ServerStoppedError:
- _LOGGER.warning('Aborting method [%s] due to server stop.', _decode(rpc_state.method()))
- except ExecuteBatchError:
- # If client closed (aka. cancelled), ignore the failed batch operations.
- if rpc_state.client_closed:
- return
- else:
- raise
- except Exception as e:
- _LOGGER.exception('Unexpected [%s] raised by servicer method [%s]' % (
- type(e).__name__,
- _decode(rpc_state.method()),
- ))
- if not rpc_state.status_sent and rpc_state.server._status != AIO_SERVER_STATUS_STOPPED:
- # Allows users to raise other types of exception with specified status code
- if rpc_state.status_code == StatusCode.ok:
- status_code = StatusCode.unknown
- else:
- status_code = rpc_state.status_code
-
- await _send_error_status_from_server(
- rpc_state,
- status_code,
- 'Unexpected %s: %s' % (type(e), e),
- rpc_state.trailing_metadata,
- rpc_state.create_send_initial_metadata_op_if_not_sent(),
- loop
- )
-
-
+ # Prepares the request generator
+ cdef object request_iterator
+ if _is_async_handler(method_handler.stream_stream):
+ request_iterator = _MessageReceiver(servicer_context)
+ else:
+ request_iterator = async_generator_to_generator(
+ _MessageReceiver(servicer_context),
+ loop
+ )
+
+ # Finishes the application handler
+ await _finish_handler_with_stream_responses(
+ rpc_state,
+ method_handler.stream_stream,
+ request_iterator,
+ servicer_context,
+ loop,
+ )
+
+
+async def _handle_exceptions(RPCState rpc_state, object rpc_coro, object loop):
+ try:
+ try:
+ await rpc_coro
+ except AbortError as e:
+ # Caught AbortError check if it is the same one
+ assert rpc_state.abort_exception is e, 'Abort error has been replaced!'
+ return
+ else:
+ # Check if the abort exception got suppressed
+ if rpc_state.abort_exception is not None:
+ _LOGGER.error(
+ 'Abort error unexpectedly suppressed: %s',
+ traceback.format_exception(rpc_state.abort_exception)
+ )
+ except (KeyboardInterrupt, SystemExit):
+ raise
+ except asyncio.CancelledError:
+ _LOGGER.debug('RPC cancelled for servicer method [%s]', _decode(rpc_state.method()))
+ except _ServerStoppedError:
+ _LOGGER.warning('Aborting method [%s] due to server stop.', _decode(rpc_state.method()))
+ except ExecuteBatchError:
+ # If client closed (aka. cancelled), ignore the failed batch operations.
+ if rpc_state.client_closed:
+ return
+ else:
+ raise
+ except Exception as e:
+ _LOGGER.exception('Unexpected [%s] raised by servicer method [%s]' % (
+ type(e).__name__,
+ _decode(rpc_state.method()),
+ ))
+ if not rpc_state.status_sent and rpc_state.server._status != AIO_SERVER_STATUS_STOPPED:
+ # Allows users to raise other types of exception with specified status code
+ if rpc_state.status_code == StatusCode.ok:
+ status_code = StatusCode.unknown
+ else:
+ status_code = rpc_state.status_code
+
+ await _send_error_status_from_server(
+ rpc_state,
+ status_code,
+ 'Unexpected %s: %s' % (type(e), e),
+ rpc_state.trailing_metadata,
+ rpc_state.create_send_initial_metadata_op_if_not_sent(),
+ loop
+ )
+
+
async def _handle_cancellation_from_core(object rpc_task,
- RPCState rpc_state,
- object loop):
+ RPCState rpc_state,
+ object loop):
cdef ReceiveCloseOnServerOperation op = ReceiveCloseOnServerOperation(_EMPTY_FLAG)
cdef tuple ops = (op,)
-
- # Awaits cancellation from peer.
- await execute_batch(rpc_state, ops, loop)
- rpc_state.client_closed = True
- # If 1) received cancel signal; 2) the Task is not finished; 3) the server
- # wasn't replying final status. For condition 3, it might cause inaccurate
- # log that an RPC is both aborted and cancelled.
- if op.cancelled() and not rpc_task.done() and not rpc_state.status_sent:
- # Injects `CancelledError` to halt the RPC coroutine
+
+ # Awaits cancellation from peer.
+ await execute_batch(rpc_state, ops, loop)
+ rpc_state.client_closed = True
+ # If 1) received cancel signal; 2) the Task is not finished; 3) the server
+ # wasn't replying final status. For condition 3, it might cause inaccurate
+ # log that an RPC is both aborted and cancelled.
+ if op.cancelled() and not rpc_task.done() and not rpc_state.status_sent:
+ # Injects `CancelledError` to halt the RPC coroutine
rpc_task.cancel()
-async def _schedule_rpc_coro(object rpc_coro,
- RPCState rpc_state,
- object loop):
- # Schedules the RPC coroutine.
- cdef object rpc_task = loop.create_task(_handle_exceptions(
- rpc_state,
- rpc_coro,
- loop,
- ))
- await _handle_cancellation_from_core(rpc_task, rpc_state, loop)
-
-
-async def _handle_rpc(list generic_handlers, tuple interceptors,
- RPCState rpc_state, object loop):
- cdef object method_handler
- # Finds the method handler (application logic)
- method_handler = await _find_method_handler(
- rpc_state.method().decode(),
- rpc_state.invocation_metadata(),
- generic_handlers,
- interceptors,
- )
- if method_handler is None:
- rpc_state.status_sent = True
- await _send_error_status_from_server(
- rpc_state,
- StatusCode.unimplemented,
- 'Method not found!',
- _IMMUTABLE_EMPTY_METADATA,
- rpc_state.create_send_initial_metadata_op_if_not_sent(),
- loop
- )
- return
-
- # Handles unary-unary case
- if not method_handler.request_streaming and not method_handler.response_streaming:
- await _handle_unary_unary_rpc(method_handler,
- rpc_state,
- loop)
- return
-
- # Handles unary-stream case
- if not method_handler.request_streaming and method_handler.response_streaming:
- await _handle_unary_stream_rpc(method_handler,
- rpc_state,
- loop)
- return
-
- # Handles stream-unary case
- if method_handler.request_streaming and not method_handler.response_streaming:
- await _handle_stream_unary_rpc(method_handler,
- rpc_state,
- loop)
- return
-
- # Handles stream-stream case
- if method_handler.request_streaming and method_handler.response_streaming:
- await _handle_stream_stream_rpc(method_handler,
- rpc_state,
- loop)
- return
-
-
-class _RequestCallError(Exception): pass
-
-cdef CallbackFailureHandler REQUEST_CALL_FAILURE_HANDLER = CallbackFailureHandler(
- 'grpc_server_request_call', None, _RequestCallError)
-
-
+async def _schedule_rpc_coro(object rpc_coro,
+ RPCState rpc_state,
+ object loop):
+ # Schedules the RPC coroutine.
+ cdef object rpc_task = loop.create_task(_handle_exceptions(
+ rpc_state,
+ rpc_coro,
+ loop,
+ ))
+ await _handle_cancellation_from_core(rpc_task, rpc_state, loop)
+
+
+async def _handle_rpc(list generic_handlers, tuple interceptors,
+ RPCState rpc_state, object loop):
+ cdef object method_handler
+ # Finds the method handler (application logic)
+ method_handler = await _find_method_handler(
+ rpc_state.method().decode(),
+ rpc_state.invocation_metadata(),
+ generic_handlers,
+ interceptors,
+ )
+ if method_handler is None:
+ rpc_state.status_sent = True
+ await _send_error_status_from_server(
+ rpc_state,
+ StatusCode.unimplemented,
+ 'Method not found!',
+ _IMMUTABLE_EMPTY_METADATA,
+ rpc_state.create_send_initial_metadata_op_if_not_sent(),
+ loop
+ )
+ return
+
+ # Handles unary-unary case
+ if not method_handler.request_streaming and not method_handler.response_streaming:
+ await _handle_unary_unary_rpc(method_handler,
+ rpc_state,
+ loop)
+ return
+
+ # Handles unary-stream case
+ if not method_handler.request_streaming and method_handler.response_streaming:
+ await _handle_unary_stream_rpc(method_handler,
+ rpc_state,
+ loop)
+ return
+
+ # Handles stream-unary case
+ if method_handler.request_streaming and not method_handler.response_streaming:
+ await _handle_stream_unary_rpc(method_handler,
+ rpc_state,
+ loop)
+ return
+
+ # Handles stream-stream case
+ if method_handler.request_streaming and method_handler.response_streaming:
+ await _handle_stream_stream_rpc(method_handler,
+ rpc_state,
+ loop)
+ return
+
+
+class _RequestCallError(Exception): pass
+
+cdef CallbackFailureHandler REQUEST_CALL_FAILURE_HANDLER = CallbackFailureHandler(
+ 'grpc_server_request_call', None, _RequestCallError)
+
+
cdef CallbackFailureHandler SERVER_SHUTDOWN_FAILURE_HANDLER = CallbackFailureHandler(
'grpc_server_shutdown_and_notify',
- None,
- InternalError)
+ None,
+ InternalError)
cdef class AioServer:
def __init__(self, loop, thread_pool, generic_handlers, interceptors,
- options, maximum_concurrent_rpcs):
- init_grpc_aio()
+ options, maximum_concurrent_rpcs):
+ init_grpc_aio()
# NOTE(lidiz) Core objects won't be deallocated automatically.
# If AioServer.shutdown is not called, those objects will leak.
self._server = Server(options)
grpc_server_register_completion_queue(
self._server.c_server,
- global_completion_queue(),
+ global_completion_queue(),
NULL
)
@@ -805,53 +805,53 @@ cdef class AioServer:
self._shutdown_completed = self._loop.create_future()
self._shutdown_callback_wrapper = CallbackWrapper(
self._shutdown_completed,
- self._loop,
+ self._loop,
SERVER_SHUTDOWN_FAILURE_HANDLER)
self._crash_exception = None
if interceptors:
- self._interceptors = interceptors
- else:
- self._interceptors = ()
-
- self._thread_pool = thread_pool
-
+ self._interceptors = interceptors
+ else:
+ self._interceptors = ()
+
+ self._thread_pool = thread_pool
+
if maximum_concurrent_rpcs:
raise NotImplementedError()
- def add_generic_rpc_handlers(self, object generic_rpc_handlers):
- self._generic_handlers.extend(generic_rpc_handlers)
+ def add_generic_rpc_handlers(self, object generic_rpc_handlers):
+ self._generic_handlers.extend(generic_rpc_handlers)
def add_insecure_port(self, address):
return self._server.add_http2_port(address)
def add_secure_port(self, address, server_credentials):
return self._server.add_http2_port(address,
- server_credentials._credentials)
-
- async def _request_call(self):
- cdef grpc_call_error error
- cdef RPCState rpc_state = RPCState(self)
- cdef object future = self._loop.create_future()
- cdef CallbackWrapper wrapper = CallbackWrapper(
- future,
- self._loop,
- REQUEST_CALL_FAILURE_HANDLER)
- error = grpc_server_request_call(
- self._server.c_server, &rpc_state.call, &rpc_state.details,
- &rpc_state.request_metadata,
- global_completion_queue(), global_completion_queue(),
- wrapper.c_functor()
- )
- if error != GRPC_CALL_OK:
- raise InternalError("Error in grpc_server_request_call: %s" % error)
-
- await future
- return rpc_state
-
+ server_credentials._credentials)
+
+ async def _request_call(self):
+ cdef grpc_call_error error
+ cdef RPCState rpc_state = RPCState(self)
+ cdef object future = self._loop.create_future()
+ cdef CallbackWrapper wrapper = CallbackWrapper(
+ future,
+ self._loop,
+ REQUEST_CALL_FAILURE_HANDLER)
+ error = grpc_server_request_call(
+ self._server.c_server, &rpc_state.call, &rpc_state.details,
+ &rpc_state.request_metadata,
+ global_completion_queue(), global_completion_queue(),
+ wrapper.c_functor()
+ )
+ if error != GRPC_CALL_OK:
+ raise InternalError("Error in grpc_server_request_call: %s" % error)
+
+ await future
+ return rpc_state
+
async def _server_main_loop(self,
object server_started):
- self._server.start(backup_queue=False)
+ self._server.start(backup_queue=False)
cdef RPCState rpc_state
server_started.set_result(True)
@@ -860,23 +860,23 @@ cdef class AioServer:
if self._status != AIO_SERVER_STATUS_RUNNING:
break
- # Accepts new request from Core
- rpc_state = await self._request_call()
-
- # Creates the dedicated RPC coroutine. If we schedule it right now,
- # there is no guarantee if the cancellation listening coroutine is
- # ready or not. So, we should control the ordering by scheduling
- # the coroutine onto event loop inside of the cancellation
- # coroutine.
- rpc_coro = _handle_rpc(self._generic_handlers,
- self._interceptors,
- rpc_state,
- self._loop)
-
- # Fires off a task that listens on the cancellation from client.
+ # Accepts new request from Core
+ rpc_state = await self._request_call()
+
+ # Creates the dedicated RPC coroutine. If we schedule it right now,
+ # there is no guarantee if the cancellation listening coroutine is
+ # ready or not. So, we should control the ordering by scheduling
+ # the coroutine onto event loop inside of the cancellation
+ # coroutine.
+ rpc_coro = _handle_rpc(self._generic_handlers,
+ self._interceptors,
+ rpc_state,
+ self._loop)
+
+ # Fires off a task that listens on the cancellation from client.
self._loop.create_task(
- _schedule_rpc_coro(
- rpc_coro,
+ _schedule_rpc_coro(
+ rpc_coro,
rpc_state,
self._loop
)
@@ -895,7 +895,7 @@ cdef class AioServer:
if self._status == AIO_SERVER_STATUS_RUNNING:
return
elif self._status != AIO_SERVER_STATUS_READY:
- raise UsageError('Server not in ready state')
+ raise UsageError('Server not in ready state')
self._status = AIO_SERVER_STATUS_RUNNING
cdef object server_started = self._loop.create_future()
@@ -913,7 +913,7 @@ cdef class AioServer:
# The shutdown callback won't be called until there is no live RPC.
grpc_server_shutdown_and_notify(
self._server.c_server,
- global_completion_queue(),
+ global_completion_queue(),
self._shutdown_callback_wrapper.c_functor())
# Ensures the serving task (coroutine) exits.
@@ -923,7 +923,7 @@ cdef class AioServer:
pass
async def shutdown(self, grace):
- """Gracefully shutdown the Core server.
+ """Gracefully shutdown the Core server.
Application should only call shutdown once.
@@ -966,7 +966,7 @@ cdef class AioServer:
self._server.is_shutdown = True
self._status = AIO_SERVER_STATUS_STOPPED
- async def wait_for_termination(self, object timeout):
+ async def wait_for_termination(self, object timeout):
if timeout is None:
await self._shutdown_completed
else:
@@ -988,20 +988,20 @@ cdef class AioServer:
return True
def __dealloc__(self):
- """Deallocation of Core objects are ensured by Python layer."""
- # TODO(lidiz) if users create server, and then dealloc it immediately.
- # There is a potential memory leak of created Core server.
+ """Deallocation of Core objects are ensured by Python layer."""
+ # TODO(lidiz) if users create server, and then dealloc it immediately.
+ # There is a potential memory leak of created Core server.
if self._status != AIO_SERVER_STATUS_STOPPED:
- _LOGGER.debug(
- '__dealloc__ called on running server %s with status %d',
- self,
- self._status
- )
- shutdown_grpc_aio()
-
- cdef thread_pool(self):
- """Access the thread pool instance."""
- return self._thread_pool
-
- def is_running(self):
- return self._status == AIO_SERVER_STATUS_RUNNING
+ _LOGGER.debug(
+ '__dealloc__ called on running server %s with status %d',
+ self,
+ self._status
+ )
+ shutdown_grpc_aio()
+
+ cdef thread_pool(self):
+ """Access the thread pool instance."""
+ return self._thread_pool
+
+ def is_running(self):
+ return self._status == AIO_SERVER_STATUS_RUNNING
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/channel.pyx.pxi b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/channel.pyx.pxi
index f0d6c69472d..74c7f6c1405 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/channel.pyx.pxi
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/channel.pyx.pxi
@@ -256,8 +256,8 @@ cdef void _call(
on_success(started_tags)
else:
raise ValueError('Cannot invoke RPC: %s' % channel_state.closed_reason)
-
-
+
+
cdef void _process_integrated_call_tag(
_ChannelState state, _BatchOperationTag tag) except *:
cdef _CallState call_state = state.integrated_call_states.pop(tag)
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/credentials.pxd.pxi b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/credentials.pxd.pxi
index 44aebc7cbde..ddaedb30bd4 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/credentials.pxd.pxi
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/credentials.pxd.pxi
@@ -102,9 +102,9 @@ cdef class ServerCredentials:
cdef class LocalChannelCredentials(ChannelCredentials):
cdef grpc_local_connect_type _local_connect_type
-
-
-cdef class ALTSChannelCredentials(ChannelCredentials):
- cdef grpc_alts_credentials_options *c_options
-
- cdef grpc_channel_credentials *c(self) except *
+
+
+cdef class ALTSChannelCredentials(ChannelCredentials):
+ cdef grpc_alts_credentials_options *c_options
+
+ cdef grpc_channel_credentials *c(self) except *
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/credentials.pyx.pxi b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/credentials.pyx.pxi
index 94687a4da9f..c75579cc04f 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/credentials.pyx.pxi
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/credentials.pyx.pxi
@@ -14,9 +14,9 @@
def _spawn_callback_in_thread(cb_func, args):
- t = ForkManagedThread(target=cb_func, args=args)
- t.setDaemon(True)
- t.start()
+ t = ForkManagedThread(target=cb_func, args=args)
+ t.setDaemon(True)
+ t.start()
async_callback_func = _spawn_callback_in_thread
@@ -34,14 +34,14 @@ cdef class CallCredentials:
raise NotImplementedError()
-cdef int _get_metadata(void *state,
- grpc_auth_metadata_context context,
- grpc_credentials_plugin_metadata_cb cb,
- void *user_data,
- grpc_metadata creds_md[GRPC_METADATA_CREDENTIALS_PLUGIN_SYNC_MAX],
- size_t *num_creds_md,
- grpc_status_code *status,
- const char **error_details) except * with gil:
+cdef int _get_metadata(void *state,
+ grpc_auth_metadata_context context,
+ grpc_credentials_plugin_metadata_cb cb,
+ void *user_data,
+ grpc_metadata creds_md[GRPC_METADATA_CREDENTIALS_PLUGIN_SYNC_MAX],
+ size_t *num_creds_md,
+ grpc_status_code *status,
+ const char **error_details) except * with gil:
cdef size_t metadata_count
cdef grpc_metadata *c_metadata
def callback(metadata, grpc_status_code status, bytes error_details):
@@ -75,9 +75,9 @@ cdef class MetadataPluginCallCredentials(CallCredentials):
c_metadata_plugin.type = self._name
cpython.Py_INCREF(self._metadata_plugin)
fork_handlers_and_grpc_init()
- # TODO(yihuazhang): Expose min_security_level via the Python API so that
- # applications can decide what minimum security level their plugins require.
- return grpc_metadata_credentials_create_from_plugin(c_metadata_plugin, GRPC_PRIVACY_AND_INTEGRITY, NULL)
+ # TODO(yihuazhang): Expose min_security_level via the Python API so that
+ # applications can decide what minimum security level their plugins require.
+ return grpc_metadata_credentials_create_from_plugin(c_metadata_plugin, GRPC_PRIVACY_AND_INTEGRITY, NULL)
cdef grpc_call_credentials *_composition(call_credentialses):
@@ -351,51 +351,51 @@ def server_credentials_local(grpc_local_connect_type local_connect_type):
cdef ServerCredentials credentials = ServerCredentials()
credentials.c_credentials = grpc_local_server_credentials_create(local_connect_type)
return credentials
+
+
+cdef class ALTSChannelCredentials(ChannelCredentials):
+
+ def __cinit__(self, list service_accounts):
+ self.c_options = grpc_alts_credentials_client_options_create()
+ cdef str account
+ for account in service_accounts:
+ grpc_alts_credentials_client_options_add_target_service_account(self.c_options, account)
-
-cdef class ALTSChannelCredentials(ChannelCredentials):
-
- def __cinit__(self, list service_accounts):
- self.c_options = grpc_alts_credentials_client_options_create()
- cdef str account
- for account in service_accounts:
- grpc_alts_credentials_client_options_add_target_service_account(self.c_options, account)
-
- def __dealloc__(self):
- if self.c_options != NULL:
- grpc_alts_credentials_options_destroy(self.c_options)
-
- cdef grpc_channel_credentials *c(self) except *:
- return grpc_alts_credentials_create(self.c_options)
-
-
-def channel_credentials_alts(list service_accounts):
- return ALTSChannelCredentials(service_accounts)
-
-
-def server_credentials_alts():
- cdef ServerCredentials credentials = ServerCredentials()
- cdef grpc_alts_credentials_options* c_options = grpc_alts_credentials_server_options_create()
- credentials.c_credentials = grpc_alts_server_credentials_create(c_options)
- # Options can be destroyed as deep copy was performed.
- grpc_alts_credentials_options_destroy(c_options)
- return credentials
-
-
-cdef class ComputeEngineChannelCredentials(ChannelCredentials):
- cdef grpc_channel_credentials* _c_creds
- cdef grpc_call_credentials* _call_creds
-
- def __cinit__(self, CallCredentials call_creds):
- self._c_creds = NULL
- self._call_creds = call_creds.c()
- if self._call_creds == NULL:
- raise ValueError("Call credentials may not be NULL.")
-
- cdef grpc_channel_credentials *c(self) except *:
- self._c_creds = grpc_google_default_credentials_create(self._call_creds)
- return self._c_creds
-
-
-def channel_credentials_compute_engine(call_creds):
- return ComputeEngineChannelCredentials(call_creds)
+ def __dealloc__(self):
+ if self.c_options != NULL:
+ grpc_alts_credentials_options_destroy(self.c_options)
+
+ cdef grpc_channel_credentials *c(self) except *:
+ return grpc_alts_credentials_create(self.c_options)
+
+
+def channel_credentials_alts(list service_accounts):
+ return ALTSChannelCredentials(service_accounts)
+
+
+def server_credentials_alts():
+ cdef ServerCredentials credentials = ServerCredentials()
+ cdef grpc_alts_credentials_options* c_options = grpc_alts_credentials_server_options_create()
+ credentials.c_credentials = grpc_alts_server_credentials_create(c_options)
+ # Options can be destroyed as deep copy was performed.
+ grpc_alts_credentials_options_destroy(c_options)
+ return credentials
+
+
+cdef class ComputeEngineChannelCredentials(ChannelCredentials):
+ cdef grpc_channel_credentials* _c_creds
+ cdef grpc_call_credentials* _call_creds
+
+ def __cinit__(self, CallCredentials call_creds):
+ self._c_creds = NULL
+ self._call_creds = call_creds.c()
+ if self._call_creds == NULL:
+ raise ValueError("Call credentials may not be NULL.")
+
+ cdef grpc_channel_credentials *c(self) except *:
+ self._c_creds = grpc_google_default_credentials_create(self._call_creds)
+ return self._c_creds
+
+
+def channel_credentials_compute_engine(call_creds):
+ return ComputeEngineChannelCredentials(call_creds)
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/fork_posix.pyx.pxi b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/fork_posix.pyx.pxi
index 9cd7b1b3b9c..53657e8b1a9 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/fork_posix.pyx.pxi
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/fork_posix.pyx.pxi
@@ -27,7 +27,7 @@ _TRUE_VALUES = ['yes', 'Yes', 'YES', 'true', 'True', 'TRUE', '1']
# must not block and should execute quickly.
#
# This flag is not supported on Windows.
-# This flag is also not supported for non-native IO manager.
+# This flag is also not supported for non-native IO manager.
_GRPC_ENABLE_FORK_SUPPORT = (
os.environ.get('GRPC_ENABLE_FORK_SUPPORT', '0')
.lower() in _TRUE_VALUES)
@@ -94,8 +94,8 @@ def fork_handlers_and_grpc_init():
_fork_state.fork_handler_registered = True
-
-
+
+
class ForkManagedThread(object):
def __init__(self, target, args=()):
if _GRPC_ENABLE_FORK_SUPPORT:
@@ -104,9 +104,9 @@ class ForkManagedThread(object):
target(*args)
finally:
_fork_state.active_thread_count.decrement()
- self._thread = threading.Thread(target=_run_with_context(managed_target), args=args)
+ self._thread = threading.Thread(target=_run_with_context(managed_target), args=args)
else:
- self._thread = threading.Thread(target=_run_with_context(target), args=args)
+ self._thread = threading.Thread(target=_run_with_context(target), args=args)
def setDaemon(self, daemonic):
self._thread.daemon = daemonic
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/fork_windows.pyx.pxi b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/fork_windows.pyx.pxi
index aba4d4c28f5..67aaf4d033d 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/fork_windows.pyx.pxi
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/fork_windows.pyx.pxi
@@ -21,7 +21,7 @@ def fork_handlers_and_grpc_init():
class ForkManagedThread(object):
def __init__(self, target, args=()):
- self._thread = threading.Thread(target=_run_with_context(target), args=args)
+ self._thread = threading.Thread(target=_run_with_context(target), args=args)
def setDaemon(self, daemonic):
self._thread.daemon = daemonic
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/grpc.pxi b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/grpc.pxi
index a0a34ff5bac..54eb7fdffc4 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/grpc.pxi
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/grpc.pxi
@@ -434,13 +434,13 @@ cdef extern from "grpc/grpc_security.h":
GRPC_SSL_REQUEST_AND_REQUIRE_CLIENT_CERTIFICATE_BUT_DONT_VERIFY
GRPC_SSL_REQUEST_AND_REQUIRE_CLIENT_CERTIFICATE_AND_VERIFY
- ctypedef enum grpc_security_level:
- GRPC_SECURITY_MIN
- GRPC_SECURITY_NONE = GRPC_SECURITY_MIN
- GRPC_INTEGRITY_ONLY
- GRPC_PRIVACY_AND_INTEGRITY
- GRPC_SECURITY_MAX = GRPC_PRIVACY_AND_INTEGRITY
-
+ ctypedef enum grpc_security_level:
+ GRPC_SECURITY_MIN
+ GRPC_SECURITY_NONE = GRPC_SECURITY_MIN
+ GRPC_INTEGRITY_ONLY
+ GRPC_PRIVACY_AND_INTEGRITY
+ GRPC_SECURITY_MAX = GRPC_PRIVACY_AND_INTEGRITY
+
ctypedef enum grpc_ssl_certificate_config_reload_status:
GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_UNCHANGED
GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_NEW
@@ -505,7 +505,7 @@ cdef extern from "grpc/grpc_security.h":
void grpc_set_ssl_roots_override_callback(
grpc_ssl_roots_override_callback cb) nogil
- grpc_channel_credentials *grpc_google_default_credentials_create(grpc_call_credentials* call_credentials) nogil
+ grpc_channel_credentials *grpc_google_default_credentials_create(grpc_call_credentials* call_credentials) nogil
grpc_channel_credentials *grpc_ssl_credentials_create(
const char *pem_root_certs, grpc_ssl_pem_key_cert_pair *pem_key_cert_pair,
verify_peer_options *verify_options, void *reserved) nogil
@@ -570,7 +570,7 @@ cdef extern from "grpc/grpc_security.h":
const char *type
grpc_call_credentials *grpc_metadata_credentials_create_from_plugin(
- grpc_metadata_credentials_plugin plugin, grpc_security_level min_security_level, void *reserved) nogil
+ grpc_metadata_credentials_plugin plugin, grpc_security_level min_security_level, void *reserved) nogil
ctypedef struct grpc_auth_property_iterator:
pass
@@ -607,22 +607,22 @@ cdef extern from "grpc/grpc_security.h":
grpc_server_credentials *grpc_local_server_credentials_create(
grpc_local_connect_type type)
- ctypedef struct grpc_alts_credentials_options:
- # We don't care about the internals (and in fact don't know them)
- pass
-
- grpc_channel_credentials *grpc_alts_credentials_create(
- const grpc_alts_credentials_options *options)
- grpc_server_credentials *grpc_alts_server_credentials_create(
- const grpc_alts_credentials_options *options)
-
- grpc_alts_credentials_options* grpc_alts_credentials_client_options_create()
- grpc_alts_credentials_options* grpc_alts_credentials_server_options_create()
- void grpc_alts_credentials_options_destroy(grpc_alts_credentials_options *options)
- void grpc_alts_credentials_client_options_add_target_service_account(grpc_alts_credentials_options *options, const char *service_account)
-
-
+ ctypedef struct grpc_alts_credentials_options:
+ # We don't care about the internals (and in fact don't know them)
+ pass
+ grpc_channel_credentials *grpc_alts_credentials_create(
+ const grpc_alts_credentials_options *options)
+ grpc_server_credentials *grpc_alts_server_credentials_create(
+ const grpc_alts_credentials_options *options)
+
+ grpc_alts_credentials_options* grpc_alts_credentials_client_options_create()
+ grpc_alts_credentials_options* grpc_alts_credentials_server_options_create()
+ void grpc_alts_credentials_options_destroy(grpc_alts_credentials_options *options)
+ void grpc_alts_credentials_client_options_add_target_service_account(grpc_alts_credentials_options *options, const char *service_account)
+
+
+
cdef extern from "grpc/compression.h":
ctypedef enum grpc_compression_algorithm:
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/grpc_gevent.pxd.pxi b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/grpc_gevent.pxd.pxi
index 969c2855cee..bd1d73145b9 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/grpc_gevent.pxd.pxi
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/grpc_gevent.pxd.pxi
@@ -37,5 +37,5 @@ cdef class SocketWrapper:
cdef class ResolveWrapper:
cdef grpc_custom_resolver *c_resolver
- cdef const char* c_host
- cdef const char* c_port
+ cdef const char* c_host
+ cdef const char* c_port
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/grpc_gevent.pyx.pxi b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/grpc_gevent.pyx.pxi
index 0001e10d30e..0f693ec6911 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/grpc_gevent.pyx.pxi
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/grpc_gevent.pyx.pxi
@@ -283,14 +283,14 @@ cdef socket_resolve_async_cython(ResolveWrapper resolve_wrapper):
def socket_resolve_async_python(resolve_wrapper):
socket_resolve_async_cython(resolve_wrapper)
-cdef void socket_resolve_async(grpc_custom_resolver* r, const char* host, const char* port) with gil:
+cdef void socket_resolve_async(grpc_custom_resolver* r, const char* host, const char* port) with gil:
rw = ResolveWrapper()
rw.c_resolver = r
rw.c_host = host
rw.c_port = port
_spawn_greenlet(socket_resolve_async_python, rw)
-cdef grpc_error* socket_resolve(const char* host, const char* port,
+cdef grpc_error* socket_resolve(const char* host, const char* port,
grpc_resolved_addresses** res) with gil:
try:
result = gevent_socket.getaddrinfo(host, port)
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/grpc_string.pyx.pxi b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/grpc_string.pyx.pxi
index f1e415f9e30..5c1e0679a97 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/grpc_string.pyx.pxi
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/grpc_string.pyx.pxi
@@ -35,7 +35,7 @@ cdef bytes _encode(object string_or_none):
elif isinstance(string_or_none, (bytes,)):
return <bytes>string_or_none
elif isinstance(string_or_none, (unicode,)):
- return string_or_none.encode('utf8')
+ return string_or_none.encode('utf8')
else:
raise TypeError('Expected str, not {}'.format(type(string_or_none)))
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/iomgr.pxd.pxi b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/iomgr.pxd.pxi
index 461251edb35..0c5a4e5763d 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/iomgr.pxd.pxi
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/iomgr.pxd.pxi
@@ -13,9 +13,9 @@
# limitations under the License.
# distutils: language=c++
-from libcpp cimport bool as bool_t
-from libcpp.string cimport string as cppstring
-
+from libcpp cimport bool as bool_t
+from libcpp.string cimport string as cppstring
+
cdef extern from "grpc/impl/codegen/slice.h":
struct grpc_slice_buffer:
int count
@@ -49,16 +49,16 @@ cdef extern from "src/core/lib/iomgr/resolve_address_custom.h":
pass
struct grpc_custom_resolver_vtable:
- grpc_error* (*resolve)(const char* host, const char* port, grpc_resolved_addresses** res);
- void (*resolve_async)(grpc_custom_resolver* resolver, const char* host, const char* port);
+ grpc_error* (*resolve)(const char* host, const char* port, grpc_resolved_addresses** res);
+ void (*resolve_async)(grpc_custom_resolver* resolver, const char* host, const char* port);
void grpc_custom_resolve_callback(grpc_custom_resolver* resolver,
grpc_resolved_addresses* result,
grpc_error* error);
cdef extern from "src/core/lib/iomgr/tcp_custom.h":
- cdef int GRPC_CUSTOM_SOCKET_OPT_SO_REUSEPORT
-
+ cdef int GRPC_CUSTOM_SOCKET_OPT_SO_REUSEPORT
+
struct grpc_custom_socket:
void* impl
# We don't care about the rest of the fields
@@ -121,8 +121,8 @@ cdef extern from "src/core/lib/iomgr/iomgr_custom.h":
cdef extern from "src/core/lib/iomgr/sockaddr_utils.h":
int grpc_sockaddr_get_port(const grpc_resolved_address *addr);
- cppstring grpc_sockaddr_to_string(const grpc_resolved_address *addr,
- bool_t normalize);
+ cppstring grpc_sockaddr_to_string(const grpc_resolved_address *addr,
+ bool_t normalize);
void grpc_string_to_sockaddr(grpc_resolved_address *out, char* addr, int port);
int grpc_sockaddr_set_port(const grpc_resolved_address *resolved_addr,
int port)
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/iomgr.pyx.pxi b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/iomgr.pyx.pxi
index c3036bc7277..3d6bb24f9a1 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/iomgr.pyx.pxi
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/iomgr.pyx.pxi
@@ -15,7 +15,7 @@
from libc cimport string
from libc.stdlib cimport malloc
-from libcpp.string cimport string as cppstring
+from libcpp.string cimport string as cppstring
cdef grpc_error* grpc_error_none():
return <grpc_error*>0
@@ -26,10 +26,10 @@ cdef grpc_error* socket_error(str syscall, str err):
return grpc_socket_error(error_bytes)
cdef resolved_addr_to_tuple(grpc_resolved_address* address):
- cdef cppstring res_str
+ cdef cppstring res_str
port = grpc_sockaddr_get_port(address)
- res_str = grpc_sockaddr_to_string(address, False)
- byte_str = _decode(res_str)
+ res_str = grpc_sockaddr_to_string(address, False)
+ byte_str = _decode(res_str)
if byte_str.endswith(':' + str(port)):
byte_str = byte_str[:(0 - len(str(port)) - 1)]
byte_str = byte_str.lstrip('[')
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/metadata.pyx.pxi b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/metadata.pyx.pxi
index 033608cee62..b2dd1e33808 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/metadata.pyx.pxi
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/metadata.pyx.pxi
@@ -41,11 +41,11 @@ cdef void _store_c_metadata(
for index, (key, value) in enumerate(metadata):
encoded_key = _encode(key)
encoded_value = value if encoded_key[-4:] == b'-bin' else _encode(value)
- if not isinstance(encoded_value, bytes):
- raise TypeError('Binary metadata key="%s" expected bytes, got %s' % (
- key,
- type(encoded_value)
- ))
+ if not isinstance(encoded_value, bytes):
+ raise TypeError('Binary metadata key="%s" expected bytes, got %s' % (
+ key,
+ type(encoded_value)
+ ))
c_metadata[0][index].key = _slice_from_bytes(encoded_key)
c_metadata[0][index].value = _slice_from_bytes(encoded_value)
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/operation.pyx.pxi b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/operation.pyx.pxi
index 9ed2b8e4650..3f3fd75407c 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/operation.pyx.pxi
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/operation.pyx.pxi
@@ -49,10 +49,10 @@ cdef class SendInitialMetadataOperation(Operation):
cdef class SendMessageOperation(Operation):
def __cinit__(self, bytes message, int flags):
- if message is None:
- self._message = b''
- else:
- self._message = message
+ if message is None:
+ self._message = b''
+ else:
+ self._message = message
self._flags = flags
def type(self):
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/server.pyx.pxi b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/server.pyx.pxi
index f5e4ffc5431..eff95c4f299 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/server.pyx.pxi
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/server.pyx.pxi
@@ -118,7 +118,7 @@ cdef class Server:
def cancel_all_calls(self):
if not self.is_shutting_down:
- raise UsageError("the server must be shutting down to cancel all calls")
+ raise UsageError("the server must be shutting down to cancel all calls")
elif self.is_shutdown:
return
else:
@@ -136,7 +136,7 @@ cdef class Server:
pass
elif not self.is_shutting_down:
if self.backup_shutdown_queue is None:
- raise InternalError('Server shutdown failed: no completion queue.')
+ raise InternalError('Server shutdown failed: no completion queue.')
else:
# the user didn't call shutdown - use our backup queue
self._c_shutdown(self.backup_shutdown_queue, None)
@@ -148,9 +148,9 @@ cdef class Server:
# much but repeatedly release the GIL and wait
while not self.is_shutdown:
time.sleep(0)
- with nogil:
- grpc_server_destroy(self.c_server)
- self.c_server = NULL
+ with nogil:
+ grpc_server_destroy(self.c_server)
+ self.c_server = NULL
def __dealloc__(self):
if self.c_server == NULL:
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/thread.pyx.pxi b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/thread.pyx.pxi
index d745c341b66..be4cb8b9a8e 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/thread.pyx.pxi
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/thread.pyx.pxi
@@ -1,59 +1,59 @@
-# Copyright 2020 The gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-def _contextvars_supported():
- """Determines if the contextvars module is supported.
-
- We use a 'try it and see if it works approach' here rather than predicting
- based on interpreter version in order to support older interpreters that
- may have a backported module based on, e.g. `threading.local`.
-
- Returns:
- A bool indicating whether `contextvars` are supported in the current
- environment.
- """
- try:
- import contextvars
- return True
- except ImportError:
- return False
-
-
-def _run_with_context(target):
- """Runs a callable with contextvars propagated.
-
- If contextvars are supported, the calling thread's context will be copied
- and propagated. If they are not supported, this function is equivalent
- to the identity function.
-
- Args:
- target: A callable object to wrap.
- Returns:
- A callable object with the same signature as `target` but with
- contextvars propagated.
- """
-
-
-if _contextvars_supported():
- import contextvars
- def _run_with_context(target):
- ctx = contextvars.copy_context()
- def _run(*args):
- ctx.run(target, *args)
- return _run
-else:
- def _run_with_context(target):
- def _run(*args):
- target(*args)
- return _run
+# Copyright 2020 The gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+def _contextvars_supported():
+ """Determines if the contextvars module is supported.
+
+ We use a 'try it and see if it works approach' here rather than predicting
+ based on interpreter version in order to support older interpreters that
+ may have a backported module based on, e.g. `threading.local`.
+
+ Returns:
+ A bool indicating whether `contextvars` are supported in the current
+ environment.
+ """
+ try:
+ import contextvars
+ return True
+ except ImportError:
+ return False
+
+
+def _run_with_context(target):
+ """Runs a callable with contextvars propagated.
+
+ If contextvars are supported, the calling thread's context will be copied
+ and propagated. If they are not supported, this function is equivalent
+ to the identity function.
+
+ Args:
+ target: A callable object to wrap.
+ Returns:
+ A callable object with the same signature as `target` but with
+ contextvars propagated.
+ """
+
+
+if _contextvars_supported():
+ import contextvars
+ def _run_with_context(target):
+ ctx = contextvars.copy_context()
+ def _run(*args):
+ ctx.run(target, *args)
+ return _run
+else:
+ def _run_with_context(target):
+ def _run(*args):
+ target(*args)
+ return _run
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/cygrpc.pxd b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/cygrpc.pxd
index 76e100cc7a3..166be370227 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/cygrpc.pxd
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/cygrpc.pxd
@@ -13,8 +13,8 @@
# limitations under the License.
# distutils: language=c++
-cimport cpython
-
+cimport cpython
+
include "_cygrpc/grpc.pxi"
include "_cygrpc/arguments.pxd.pxi"
@@ -45,8 +45,8 @@ IF UNAME_SYSNAME != "Windows":
include "_cygrpc/aio/iomgr/socket.pxd.pxi"
include "_cygrpc/aio/iomgr/timer.pxd.pxi"
include "_cygrpc/aio/iomgr/resolver.pxd.pxi"
-include "_cygrpc/aio/completion_queue.pxd.pxi"
-include "_cygrpc/aio/rpc_status.pxd.pxi"
+include "_cygrpc/aio/completion_queue.pxd.pxi"
+include "_cygrpc/aio/rpc_status.pxd.pxi"
include "_cygrpc/aio/grpc_aio.pxd.pxi"
include "_cygrpc/aio/callback_common.pxd.pxi"
include "_cygrpc/aio/call.pxd.pxi"
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/cygrpc.pyx b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/cygrpc.pyx
index 1c5cd48a496..8d355c6fbbb 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/cygrpc.pyx
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/cygrpc.pyx
@@ -15,14 +15,14 @@
cimport cpython
-import logging
-import os
+import logging
+import os
import sys
-import threading
-import time
-
-import grpc
-
+import threading
+import time
+
+import grpc
+
try:
import asyncio
except ImportError:
@@ -31,9 +31,9 @@ except ImportError:
# Asyncio package is not available we just skip it.
pass
-# The only copy of Python logger for the Cython extension
-_LOGGER = logging.getLogger(__name__)
-
+# The only copy of Python logger for the Cython extension
+_LOGGER = logging.getLogger(__name__)
+
# TODO(atash): figure out why the coverage tool gets confused about the Cython
# coverage plugin when the following files don't have a '.pxi' suffix.
include "_cygrpc/grpc_string.pyx.pxi"
@@ -59,8 +59,8 @@ include "_cygrpc/iomgr.pyx.pxi"
include "_cygrpc/grpc_gevent.pyx.pxi"
-include "_cygrpc/thread.pyx.pxi"
-
+include "_cygrpc/thread.pyx.pxi"
+
IF UNAME_SYSNAME == "Windows":
include "_cygrpc/fork_windows.pyx.pxi"
ELSE:
@@ -71,10 +71,10 @@ include "_cygrpc/aio/iomgr/iomgr.pyx.pxi"
include "_cygrpc/aio/iomgr/socket.pyx.pxi"
include "_cygrpc/aio/iomgr/timer.pyx.pxi"
include "_cygrpc/aio/iomgr/resolver.pyx.pxi"
-include "_cygrpc/aio/common.pyx.pxi"
-include "_cygrpc/aio/rpc_status.pyx.pxi"
-include "_cygrpc/aio/completion_queue.pyx.pxi"
-include "_cygrpc/aio/callback_common.pyx.pxi"
+include "_cygrpc/aio/common.pyx.pxi"
+include "_cygrpc/aio/rpc_status.pyx.pxi"
+include "_cygrpc/aio/completion_queue.pyx.pxi"
+include "_cygrpc/aio/callback_common.pyx.pxi"
include "_cygrpc/aio/grpc_aio.pyx.pxi"
include "_cygrpc/aio/call.pyx.pxi"
include "_cygrpc/aio/channel.pyx.pxi"
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/_grpcio_metadata.py b/contrib/libs/grpc/src/python/grpcio/grpc/_grpcio_metadata.py
index 25c22febd52..f5d0668407a 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/_grpcio_metadata.py
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/_grpcio_metadata.py
@@ -14,4 +14,4 @@
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio/grpc/_grpcio_metadata.py.template`!!!
-__version__ = """1.33.2"""
+__version__ = """1.33.2"""
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/_interceptor.py b/contrib/libs/grpc/src/python/grpcio/grpc/_interceptor.py
index 1d80185b7e3..ee63cb31452 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/_interceptor.py
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/_interceptor.py
@@ -213,12 +213,12 @@ class _UnaryUnaryMultiCallable(grpc.UnaryUnaryMultiCallable):
credentials=None,
wait_for_ready=None,
compression=None):
- response, ignored_call = self._with_call(request,
- timeout=timeout,
- metadata=metadata,
- credentials=credentials,
- wait_for_ready=wait_for_ready,
- compression=compression)
+ response, ignored_call = self._with_call(request,
+ timeout=timeout,
+ metadata=metadata,
+ credentials=credentials,
+ wait_for_ready=wait_for_ready,
+ compression=compression)
return response
def _with_call(self,
@@ -251,9 +251,9 @@ class _UnaryUnaryMultiCallable(grpc.UnaryUnaryMultiCallable):
except Exception as exception: # pylint:disable=broad-except
return _FailureOutcome(exception, sys.exc_info()[2])
- call = self._interceptor.intercept_unary_unary(continuation,
- client_call_details,
- request)
+ call = self._interceptor.intercept_unary_unary(continuation,
+ client_call_details,
+ request)
return call.result(), call
def with_call(self,
@@ -263,12 +263,12 @@ class _UnaryUnaryMultiCallable(grpc.UnaryUnaryMultiCallable):
credentials=None,
wait_for_ready=None,
compression=None):
- return self._with_call(request,
- timeout=timeout,
- metadata=metadata,
- credentials=credentials,
- wait_for_ready=wait_for_ready,
- compression=compression)
+ return self._with_call(request,
+ timeout=timeout,
+ metadata=metadata,
+ credentials=credentials,
+ wait_for_ready=wait_for_ready,
+ compression=compression)
def future(self,
request,
@@ -324,12 +324,12 @@ class _UnaryStreamMultiCallable(grpc.UnaryStreamMultiCallable):
new_wait_for_ready,
new_compression) = (_unwrap_client_call_details(
new_details, client_call_details))
- return self._thunk(new_method)(request,
- timeout=new_timeout,
- metadata=new_metadata,
- credentials=new_credentials,
- wait_for_ready=new_wait_for_ready,
- compression=new_compression)
+ return self._thunk(new_method)(request,
+ timeout=new_timeout,
+ metadata=new_metadata,
+ credentials=new_credentials,
+ wait_for_ready=new_wait_for_ready,
+ compression=new_compression)
try:
return self._interceptor.intercept_unary_stream(
@@ -352,12 +352,12 @@ class _StreamUnaryMultiCallable(grpc.StreamUnaryMultiCallable):
credentials=None,
wait_for_ready=None,
compression=None):
- response, ignored_call = self._with_call(request_iterator,
- timeout=timeout,
- metadata=metadata,
- credentials=credentials,
- wait_for_ready=wait_for_ready,
- compression=compression)
+ response, ignored_call = self._with_call(request_iterator,
+ timeout=timeout,
+ metadata=metadata,
+ credentials=credentials,
+ wait_for_ready=wait_for_ready,
+ compression=compression)
return response
def _with_call(self,
@@ -390,9 +390,9 @@ class _StreamUnaryMultiCallable(grpc.StreamUnaryMultiCallable):
except Exception as exception: # pylint:disable=broad-except
return _FailureOutcome(exception, sys.exc_info()[2])
- call = self._interceptor.intercept_stream_unary(continuation,
- client_call_details,
- request_iterator)
+ call = self._interceptor.intercept_stream_unary(continuation,
+ client_call_details,
+ request_iterator)
return call.result(), call
def with_call(self,
@@ -402,12 +402,12 @@ class _StreamUnaryMultiCallable(grpc.StreamUnaryMultiCallable):
credentials=None,
wait_for_ready=None,
compression=None):
- return self._with_call(request_iterator,
- timeout=timeout,
- metadata=metadata,
- credentials=credentials,
- wait_for_ready=wait_for_ready,
- compression=compression)
+ return self._with_call(request_iterator,
+ timeout=timeout,
+ metadata=metadata,
+ credentials=credentials,
+ wait_for_ready=wait_for_ready,
+ compression=compression)
def future(self,
request_iterator,
@@ -463,12 +463,12 @@ class _StreamStreamMultiCallable(grpc.StreamStreamMultiCallable):
new_wait_for_ready,
new_compression) = (_unwrap_client_call_details(
new_details, client_call_details))
- return self._thunk(new_method)(request_iterator,
- timeout=new_timeout,
- metadata=new_metadata,
- credentials=new_credentials,
- wait_for_ready=new_wait_for_ready,
- compression=new_compression)
+ return self._thunk(new_method)(request_iterator,
+ timeout=new_timeout,
+ metadata=new_metadata,
+ credentials=new_credentials,
+ wait_for_ready=new_wait_for_ready,
+ compression=new_compression)
try:
return self._interceptor.intercept_stream_stream(
@@ -493,8 +493,8 @@ class _Channel(grpc.Channel):
method,
request_serializer=None,
response_deserializer=None):
- thunk = lambda m: self._channel.unary_unary(m, request_serializer,
- response_deserializer)
+ thunk = lambda m: self._channel.unary_unary(m, request_serializer,
+ response_deserializer)
if isinstance(self._interceptor, grpc.UnaryUnaryClientInterceptor):
return _UnaryUnaryMultiCallable(thunk, method, self._interceptor)
else:
@@ -504,8 +504,8 @@ class _Channel(grpc.Channel):
method,
request_serializer=None,
response_deserializer=None):
- thunk = lambda m: self._channel.unary_stream(m, request_serializer,
- response_deserializer)
+ thunk = lambda m: self._channel.unary_stream(m, request_serializer,
+ response_deserializer)
if isinstance(self._interceptor, grpc.UnaryStreamClientInterceptor):
return _UnaryStreamMultiCallable(thunk, method, self._interceptor)
else:
@@ -515,8 +515,8 @@ class _Channel(grpc.Channel):
method,
request_serializer=None,
response_deserializer=None):
- thunk = lambda m: self._channel.stream_unary(m, request_serializer,
- response_deserializer)
+ thunk = lambda m: self._channel.stream_unary(m, request_serializer,
+ response_deserializer)
if isinstance(self._interceptor, grpc.StreamUnaryClientInterceptor):
return _StreamUnaryMultiCallable(thunk, method, self._interceptor)
else:
@@ -526,8 +526,8 @@ class _Channel(grpc.Channel):
method,
request_serializer=None,
response_deserializer=None):
- thunk = lambda m: self._channel.stream_stream(m, request_serializer,
- response_deserializer)
+ thunk = lambda m: self._channel.stream_stream(m, request_serializer,
+ response_deserializer)
if isinstance(self._interceptor, grpc.StreamStreamClientInterceptor):
return _StreamStreamMultiCallable(thunk, method, self._interceptor)
else:
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/_plugin_wrapping.py b/contrib/libs/grpc/src/python/grpcio/grpc/_plugin_wrapping.py
index e6f86a13d4f..e3bfa909169 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/_plugin_wrapping.py
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/_plugin_wrapping.py
@@ -70,12 +70,12 @@ class _Plugin(object):
self._metadata_plugin = metadata_plugin
def __call__(self, service_url, method_name, callback):
- context = _AuthMetadataContext(_common.decode(service_url),
- _common.decode(method_name))
+ context = _AuthMetadataContext(_common.decode(service_url),
+ _common.decode(method_name))
callback_state = _CallbackState()
try:
- self._metadata_plugin(
- context, _AuthMetadataPluginCallback(callback_state, callback))
+ self._metadata_plugin(
+ context, _AuthMetadataPluginCallback(callback_state, callback))
except Exception as exception: # pylint: disable=broad-except
_LOGGER.exception(
'AuthMetadataPluginCallback "%s" raised exception!',
@@ -97,5 +97,5 @@ def metadata_plugin_call_credentials(metadata_plugin, name):
else:
effective_name = name
return grpc.CallCredentials(
- cygrpc.MetadataPluginCallCredentials(_Plugin(metadata_plugin),
- _common.encode(effective_name)))
+ cygrpc.MetadataPluginCallCredentials(_Plugin(metadata_plugin),
+ _common.encode(effective_name)))
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/_runtime_protos.py b/contrib/libs/grpc/src/python/grpcio/grpc/_runtime_protos.py
index e6cd4bb0f19..7f555ccd9e4 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/_runtime_protos.py
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/_runtime_protos.py
@@ -1,171 +1,171 @@
-# Copyright 2020 The gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-import sys
-
-_REQUIRED_SYMBOLS = ("_protos", "_services", "_protos_and_services")
-
-
-def _uninstalled_protos(*args, **kwargs):
- raise NotImplementedError(
- "Install the grpcio-tools package (1.32.0+) to use the protos function."
- )
-
-
-def _uninstalled_services(*args, **kwargs):
- raise NotImplementedError(
- "Install the grpcio-tools package (1.32.0+) to use the services function."
- )
-
-
-def _uninstalled_protos_and_services(*args, **kwargs):
- raise NotImplementedError(
- "Install the grpcio-tools package (1.32.0+) to use the protos_and_services function."
- )
-
-
-def _interpreter_version_protos(*args, **kwargs):
- raise NotImplementedError(
- "The protos function is only on available on Python 3.X interpreters.")
-
-
-def _interpreter_version_services(*args, **kwargs):
- raise NotImplementedError(
- "The services function is only on available on Python 3.X interpreters."
- )
-
-
-def _interpreter_version_protos_and_services(*args, **kwargs):
- raise NotImplementedError(
- "The protos_and_services function is only on available on Python 3.X interpreters."
- )
-
-
-def protos(protobuf_path): # pylint: disable=unused-argument
- """Returns a module generated by the indicated .proto file.
-
- THIS IS AN EXPERIMENTAL API.
-
- Use this function to retrieve classes corresponding to message
- definitions in the .proto file.
-
- To inspect the contents of the returned module, use the dir function.
- For example:
-
- ```
- protos = grpc.protos("foo.proto")
- print(dir(protos))
- ```
-
- The returned module object corresponds to the _pb2.py file generated
- by protoc. The path is expected to be relative to an entry on sys.path
- and all transitive dependencies of the file should also be resolveable
- from an entry on sys.path.
-
- To completely disable the machinery behind this function, set the
- GRPC_PYTHON_DISABLE_DYNAMIC_STUBS environment variable to "true".
-
- Args:
- protobuf_path: The path to the .proto file on the filesystem. This path
- must be resolveable from an entry on sys.path and so must all of its
- transitive dependencies.
-
- Returns:
- A module object corresponding to the message code for the indicated
- .proto file. Equivalent to a generated _pb2.py file.
- """
-
-
-def services(protobuf_path): # pylint: disable=unused-argument
- """Returns a module generated by the indicated .proto file.
-
- THIS IS AN EXPERIMENTAL API.
-
- Use this function to retrieve classes and functions corresponding to
- service definitions in the .proto file, including both stub and servicer
- definitions.
-
- To inspect the contents of the returned module, use the dir function.
- For example:
-
- ```
- services = grpc.services("foo.proto")
- print(dir(services))
- ```
-
- The returned module object corresponds to the _pb2_grpc.py file generated
- by protoc. The path is expected to be relative to an entry on sys.path
- and all transitive dependencies of the file should also be resolveable
- from an entry on sys.path.
-
- To completely disable the machinery behind this function, set the
- GRPC_PYTHON_DISABLE_DYNAMIC_STUBS environment variable to "true".
-
- Args:
- protobuf_path: The path to the .proto file on the filesystem. This path
- must be resolveable from an entry on sys.path and so must all of its
- transitive dependencies.
-
- Returns:
- A module object corresponding to the stub/service code for the indicated
- .proto file. Equivalent to a generated _pb2_grpc.py file.
- """
-
-
-def protos_and_services(protobuf_path): # pylint: disable=unused-argument
- """Returns a 2-tuple of modules corresponding to protos and services.
-
- THIS IS AN EXPERIMENTAL API.
-
- The return value of this function is equivalent to a call to protos and a
- call to services.
-
- To completely disable the machinery behind this function, set the
- GRPC_PYTHON_DISABLE_DYNAMIC_STUBS environment variable to "true".
-
- Args:
- protobuf_path: The path to the .proto file on the filesystem. This path
- must be resolveable from an entry on sys.path and so must all of its
- transitive dependencies.
-
- Returns:
- A 2-tuple of module objects corresponding to (protos(path), services(path)).
- """
-
-
-if sys.version_info < (3, 5, 0):
- protos = _interpreter_version_protos
- services = _interpreter_version_services
- protos_and_services = _interpreter_version_protos_and_services
-else:
- try:
- import grpc_tools # pylint: disable=unused-import
- except ImportError as e:
- # NOTE: It's possible that we're encountering a transitive ImportError, so
- # we check for that and re-raise if so.
- if "grpc_tools" not in e.args[0]:
- raise
- protos = _uninstalled_protos
- services = _uninstalled_services
- protos_and_services = _uninstalled_protos_and_services
- else:
- import grpc_tools.protoc # pylint: disable=unused-import
- if all(hasattr(grpc_tools.protoc, sym) for sym in _REQUIRED_SYMBOLS):
- from grpc_tools.protoc import _protos as protos # pylint: disable=unused-import
- from grpc_tools.protoc import _services as services # pylint: disable=unused-import
- from grpc_tools.protoc import _protos_and_services as protos_and_services # pylint: disable=unused-import
- else:
- protos = _uninstalled_protos
- services = _uninstalled_services
- protos_and_services = _uninstalled_protos_and_services
+# Copyright 2020 The gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import sys
+
+_REQUIRED_SYMBOLS = ("_protos", "_services", "_protos_and_services")
+
+
+def _uninstalled_protos(*args, **kwargs):
+ raise NotImplementedError(
+ "Install the grpcio-tools package (1.32.0+) to use the protos function."
+ )
+
+
+def _uninstalled_services(*args, **kwargs):
+ raise NotImplementedError(
+ "Install the grpcio-tools package (1.32.0+) to use the services function."
+ )
+
+
+def _uninstalled_protos_and_services(*args, **kwargs):
+ raise NotImplementedError(
+ "Install the grpcio-tools package (1.32.0+) to use the protos_and_services function."
+ )
+
+
+def _interpreter_version_protos(*args, **kwargs):
+ raise NotImplementedError(
+ "The protos function is only on available on Python 3.X interpreters.")
+
+
+def _interpreter_version_services(*args, **kwargs):
+ raise NotImplementedError(
+ "The services function is only on available on Python 3.X interpreters."
+ )
+
+
+def _interpreter_version_protos_and_services(*args, **kwargs):
+ raise NotImplementedError(
+ "The protos_and_services function is only on available on Python 3.X interpreters."
+ )
+
+
+def protos(protobuf_path): # pylint: disable=unused-argument
+ """Returns a module generated by the indicated .proto file.
+
+ THIS IS AN EXPERIMENTAL API.
+
+ Use this function to retrieve classes corresponding to message
+ definitions in the .proto file.
+
+ To inspect the contents of the returned module, use the dir function.
+ For example:
+
+ ```
+ protos = grpc.protos("foo.proto")
+ print(dir(protos))
+ ```
+
+ The returned module object corresponds to the _pb2.py file generated
+ by protoc. The path is expected to be relative to an entry on sys.path
+ and all transitive dependencies of the file should also be resolveable
+ from an entry on sys.path.
+
+ To completely disable the machinery behind this function, set the
+ GRPC_PYTHON_DISABLE_DYNAMIC_STUBS environment variable to "true".
+
+ Args:
+ protobuf_path: The path to the .proto file on the filesystem. This path
+ must be resolveable from an entry on sys.path and so must all of its
+ transitive dependencies.
+
+ Returns:
+ A module object corresponding to the message code for the indicated
+ .proto file. Equivalent to a generated _pb2.py file.
+ """
+
+
+def services(protobuf_path): # pylint: disable=unused-argument
+ """Returns a module generated by the indicated .proto file.
+
+ THIS IS AN EXPERIMENTAL API.
+
+ Use this function to retrieve classes and functions corresponding to
+ service definitions in the .proto file, including both stub and servicer
+ definitions.
+
+ To inspect the contents of the returned module, use the dir function.
+ For example:
+
+ ```
+ services = grpc.services("foo.proto")
+ print(dir(services))
+ ```
+
+ The returned module object corresponds to the _pb2_grpc.py file generated
+ by protoc. The path is expected to be relative to an entry on sys.path
+ and all transitive dependencies of the file should also be resolveable
+ from an entry on sys.path.
+
+ To completely disable the machinery behind this function, set the
+ GRPC_PYTHON_DISABLE_DYNAMIC_STUBS environment variable to "true".
+
+ Args:
+ protobuf_path: The path to the .proto file on the filesystem. This path
+ must be resolveable from an entry on sys.path and so must all of its
+ transitive dependencies.
+
+ Returns:
+ A module object corresponding to the stub/service code for the indicated
+ .proto file. Equivalent to a generated _pb2_grpc.py file.
+ """
+
+
+def protos_and_services(protobuf_path): # pylint: disable=unused-argument
+ """Returns a 2-tuple of modules corresponding to protos and services.
+
+ THIS IS AN EXPERIMENTAL API.
+
+ The return value of this function is equivalent to a call to protos and a
+ call to services.
+
+ To completely disable the machinery behind this function, set the
+ GRPC_PYTHON_DISABLE_DYNAMIC_STUBS environment variable to "true".
+
+ Args:
+ protobuf_path: The path to the .proto file on the filesystem. This path
+ must be resolveable from an entry on sys.path and so must all of its
+ transitive dependencies.
+
+ Returns:
+ A 2-tuple of module objects corresponding to (protos(path), services(path)).
+ """
+
+
+if sys.version_info < (3, 5, 0):
+ protos = _interpreter_version_protos
+ services = _interpreter_version_services
+ protos_and_services = _interpreter_version_protos_and_services
+else:
+ try:
+ import grpc_tools # pylint: disable=unused-import
+ except ImportError as e:
+ # NOTE: It's possible that we're encountering a transitive ImportError, so
+ # we check for that and re-raise if so.
+ if "grpc_tools" not in e.args[0]:
+ raise
+ protos = _uninstalled_protos
+ services = _uninstalled_services
+ protos_and_services = _uninstalled_protos_and_services
+ else:
+ import grpc_tools.protoc # pylint: disable=unused-import
+ if all(hasattr(grpc_tools.protoc, sym) for sym in _REQUIRED_SYMBOLS):
+ from grpc_tools.protoc import _protos as protos # pylint: disable=unused-import
+ from grpc_tools.protoc import _services as services # pylint: disable=unused-import
+ from grpc_tools.protoc import _protos_and_services as protos_and_services # pylint: disable=unused-import
+ else:
+ protos = _uninstalled_protos
+ services = _uninstalled_services
+ protos_and_services = _uninstalled_protos_and_services
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/_server.py b/contrib/libs/grpc/src/python/grpcio/grpc/_server.py
index acbfb4193f2..48ff7439951 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/_server.py
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/_server.py
@@ -159,10 +159,10 @@ def _abort(state, call, code, details):
if state.initial_metadata_allowed:
operations = (
_get_initial_metadata_operation(state, None),
- cygrpc.SendStatusFromServerOperation(state.trailing_metadata,
- effective_code,
- effective_details,
- _EMPTY_FLAGS),
+ cygrpc.SendStatusFromServerOperation(state.trailing_metadata,
+ effective_code,
+ effective_details,
+ _EMPTY_FLAGS),
)
token = _SEND_INITIAL_METADATA_AND_SEND_STATUS_FROM_SERVER_TOKEN
else:
@@ -278,7 +278,7 @@ class _Context(grpc.ServicerContext):
def auth_context(self):
return {
- _common.decode(key): value for key, value in six.iteritems(
+ _common.decode(key): value for key, value in six.iteritems(
cygrpc.auth_context(self._rpc_event.call))
}
@@ -524,9 +524,9 @@ def _status(rpc_event, state, serialized_response):
code = _completion_code(state)
details = _details(state)
operations = [
- cygrpc.SendStatusFromServerOperation(state.trailing_metadata,
- code, details,
- _EMPTY_FLAGS),
+ cygrpc.SendStatusFromServerOperation(state.trailing_metadata,
+ code, details,
+ _EMPTY_FLAGS),
]
if state.initial_metadata_allowed:
operations.append(_get_initial_metadata_operation(state, None))
@@ -568,9 +568,9 @@ def _stream_response_in_pool(rpc_event, state, behavior, argument_thunk,
if response is None:
_status(rpc_event, state, None)
else:
- serialized_response = _serialize_response(rpc_event, state,
- response,
- response_serializer)
+ serialized_response = _serialize_response(rpc_event, state,
+ response,
+ response_serializer)
if serialized_response is not None:
_send_response(rpc_event, state, serialized_response)
@@ -579,12 +579,12 @@ def _stream_response_in_pool(rpc_event, state, behavior, argument_thunk,
if argument is not None:
if hasattr(behavior, 'experimental_non_blocking'
) and behavior.experimental_non_blocking:
- _call_behavior(rpc_event,
- state,
- behavior,
- argument,
- request_deserializer,
- send_response_callback=send_response)
+ _call_behavior(rpc_event,
+ state,
+ behavior,
+ argument,
+ request_deserializer,
+ send_response_callback=send_response)
else:
response_iterator, proceed = _call_behavior(
rpc_event, state, behavior, argument, request_deserializer)
@@ -599,9 +599,9 @@ def _is_rpc_state_active(state):
return state.client is not _CANCELLED and not state.statused
-def _send_message_callback_to_blocking_iterator_adapter(rpc_event, state,
- send_response_callback,
- response_iterator):
+def _send_message_callback_to_blocking_iterator_adapter(rpc_event, state,
+ send_response_callback,
+ response_iterator):
while True:
response, proceed = _take_response_from_response_iterator(
rpc_event, state, response_iterator)
@@ -648,11 +648,11 @@ def _handle_stream_unary(rpc_event, state, method_handler, default_thread_pool):
method_handler.request_deserializer)
thread_pool = _select_thread_pool_for_behavior(method_handler.stream_unary,
default_thread_pool)
- return thread_pool.submit(_unary_response_in_pool, rpc_event, state,
- method_handler.stream_unary,
- lambda: request_iterator,
- method_handler.request_deserializer,
- method_handler.response_serializer)
+ return thread_pool.submit(_unary_response_in_pool, rpc_event, state,
+ method_handler.stream_unary,
+ lambda: request_iterator,
+ method_handler.request_deserializer,
+ method_handler.response_serializer)
def _handle_stream_stream(rpc_event, state, method_handler,
@@ -661,11 +661,11 @@ def _handle_stream_stream(rpc_event, state, method_handler,
method_handler.request_deserializer)
thread_pool = _select_thread_pool_for_behavior(method_handler.stream_stream,
default_thread_pool)
- return thread_pool.submit(_stream_response_in_pool, rpc_event, state,
- method_handler.stream_stream,
- lambda: request_iterator,
- method_handler.request_deserializer,
- method_handler.response_serializer)
+ return thread_pool.submit(_stream_response_in_pool, rpc_event, state,
+ method_handler.stream_stream,
+ lambda: request_iterator,
+ method_handler.request_deserializer,
+ method_handler.response_serializer)
def _find_method_handler(rpc_event, generic_handlers, interceptor_pipeline):
@@ -696,10 +696,10 @@ def _reject_rpc(rpc_event, status, details):
cygrpc.SendStatusFromServerOperation(None, status, details,
_EMPTY_FLAGS),
)
- rpc_event.call.start_server_batch(operations, lambda ignored_event: (
- rpc_state,
- (),
- ))
+ rpc_event.call.start_server_batch(operations, lambda ignored_event: (
+ rpc_state,
+ (),
+ ))
return rpc_state
@@ -836,10 +836,10 @@ def _process_event_and_continue(state, event):
concurrency_exceeded = (
state.maximum_concurrent_rpcs is not None and
state.active_rpc_count >= state.maximum_concurrent_rpcs)
- rpc_state, rpc_future = _handle_call(event, state.generic_handlers,
- state.interceptor_pipeline,
- state.thread_pool,
- concurrency_exceeded)
+ rpc_state, rpc_future = _handle_call(event, state.generic_handlers,
+ state.interceptor_pipeline,
+ state.thread_pool,
+ concurrency_exceeded)
if rpc_state is not None:
state.rpc_states.add(rpc_state)
if rpc_future is not None:
@@ -958,14 +958,14 @@ class _Server(grpc.Server):
_add_generic_handlers(self._state, generic_rpc_handlers)
def add_insecure_port(self, address):
- return _common.validate_port_binding_result(
- address, _add_insecure_port(self._state, _common.encode(address)))
+ return _common.validate_port_binding_result(
+ address, _add_insecure_port(self._state, _common.encode(address)))
def add_secure_port(self, address, server_credentials):
- return _common.validate_port_binding_result(
- address,
- _add_secure_port(self._state, _common.encode(address),
- server_credentials))
+ return _common.validate_port_binding_result(
+ address,
+ _add_secure_port(self._state, _common.encode(address),
+ server_credentials))
def start(self):
_start(self._state)
@@ -974,9 +974,9 @@ class _Server(grpc.Server):
# NOTE(https://bugs.python.org/issue35935)
# Remove this workaround once threading.Event.wait() is working with
# CTRL+C across platforms.
- return _common.wait(self._state.termination_event.wait,
- self._state.termination_event.is_set,
- timeout=timeout)
+ return _common.wait(self._state.termination_event.wait,
+ self._state.termination_event.is_set,
+ timeout=timeout)
def stop(self, grace):
return _stop(self._state, grace)
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/_simple_stubs.py b/contrib/libs/grpc/src/python/grpcio/grpc/_simple_stubs.py
index d884c35a35a..baa7ae5dbe1 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/_simple_stubs.py
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/_simple_stubs.py
@@ -1,493 +1,493 @@
-# Copyright 2020 The gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-"""Functions that obviate explicit stubs and explicit channels."""
-
-import collections
-import datetime
-import os
-import logging
-import threading
-from typing import (Any, AnyStr, Callable, Dict, Iterator, Optional, Sequence,
- Tuple, TypeVar, Union)
-
-import grpc
-from grpc.experimental import experimental_api
-
-RequestType = TypeVar('RequestType')
-ResponseType = TypeVar('ResponseType')
-
-OptionsType = Sequence[Tuple[str, str]]
-CacheKey = Tuple[str, OptionsType, Optional[grpc.ChannelCredentials], Optional[
- grpc.Compression]]
-
-_LOGGER = logging.getLogger(__name__)
-
-_EVICTION_PERIOD_KEY = "GRPC_PYTHON_MANAGED_CHANNEL_EVICTION_SECONDS"
-if _EVICTION_PERIOD_KEY in os.environ:
- _EVICTION_PERIOD = datetime.timedelta(
- seconds=float(os.environ[_EVICTION_PERIOD_KEY]))
- _LOGGER.debug("Setting managed channel eviction period to %s",
- _EVICTION_PERIOD)
-else:
- _EVICTION_PERIOD = datetime.timedelta(minutes=10)
-
-_MAXIMUM_CHANNELS_KEY = "GRPC_PYTHON_MANAGED_CHANNEL_MAXIMUM"
-if _MAXIMUM_CHANNELS_KEY in os.environ:
- _MAXIMUM_CHANNELS = int(os.environ[_MAXIMUM_CHANNELS_KEY])
- _LOGGER.debug("Setting maximum managed channels to %d", _MAXIMUM_CHANNELS)
-else:
- _MAXIMUM_CHANNELS = 2**8
-
-_DEFAULT_TIMEOUT_KEY = "GRPC_PYTHON_DEFAULT_TIMEOUT_SECONDS"
-if _DEFAULT_TIMEOUT_KEY in os.environ:
- _DEFAULT_TIMEOUT = float(os.environ[_DEFAULT_TIMEOUT_KEY])
- _LOGGER.debug("Setting default timeout seconds to %f", _DEFAULT_TIMEOUT)
-else:
- _DEFAULT_TIMEOUT = 60.0
-
-
-def _create_channel(target: str, options: Sequence[Tuple[str, str]],
- channel_credentials: Optional[grpc.ChannelCredentials],
- compression: Optional[grpc.Compression]) -> grpc.Channel:
- if channel_credentials is grpc.experimental.insecure_channel_credentials():
- _LOGGER.debug(f"Creating insecure channel with options '{options}' " +
- f"and compression '{compression}'")
- return grpc.insecure_channel(target,
- options=options,
- compression=compression)
- else:
- _LOGGER.debug(
- f"Creating secure channel with credentials '{channel_credentials}', "
- + f"options '{options}' and compression '{compression}'")
- return grpc.secure_channel(target,
- credentials=channel_credentials,
- options=options,
- compression=compression)
-
-
-class ChannelCache:
- # NOTE(rbellevi): Untyped due to reference cycle.
- _singleton = None
- _lock: threading.RLock = threading.RLock()
- _condition: threading.Condition = threading.Condition(lock=_lock)
- _eviction_ready: threading.Event = threading.Event()
-
- _mapping: Dict[CacheKey, Tuple[grpc.Channel, datetime.datetime]]
- _eviction_thread: threading.Thread
-
- def __init__(self):
- self._mapping = collections.OrderedDict()
- self._eviction_thread = threading.Thread(
- target=ChannelCache._perform_evictions, daemon=True)
- self._eviction_thread.start()
-
- @staticmethod
- def get():
- with ChannelCache._lock:
- if ChannelCache._singleton is None:
- ChannelCache._singleton = ChannelCache()
- ChannelCache._eviction_ready.wait()
- return ChannelCache._singleton
-
- def _evict_locked(self, key: CacheKey):
- channel, _ = self._mapping.pop(key)
- _LOGGER.debug("Evicting channel %s with configuration %s.", channel,
- key)
- channel.close()
- del channel
-
- @staticmethod
- def _perform_evictions():
- while True:
- with ChannelCache._lock:
- ChannelCache._eviction_ready.set()
- if not ChannelCache._singleton._mapping:
- ChannelCache._condition.wait()
- elif len(ChannelCache._singleton._mapping) > _MAXIMUM_CHANNELS:
- key = next(iter(ChannelCache._singleton._mapping.keys()))
- ChannelCache._singleton._evict_locked(key)
- # And immediately reevaluate.
- else:
- key, (_, eviction_time) = next(
- iter(ChannelCache._singleton._mapping.items()))
- now = datetime.datetime.now()
- if eviction_time <= now:
- ChannelCache._singleton._evict_locked(key)
- continue
- else:
- time_to_eviction = (eviction_time - now).total_seconds()
- # NOTE: We aim to *eventually* coalesce to a state in
- # which no overdue channels are in the cache and the
- # length of the cache is longer than _MAXIMUM_CHANNELS.
- # We tolerate momentary states in which these two
- # criteria are not met.
- ChannelCache._condition.wait(timeout=time_to_eviction)
-
- def get_channel(self, target: str, options: Sequence[Tuple[str, str]],
- channel_credentials: Optional[grpc.ChannelCredentials],
- insecure: bool,
- compression: Optional[grpc.Compression]) -> grpc.Channel:
- if insecure and channel_credentials:
- raise ValueError("The insecure option is mutually exclusive with " +
- "the channel_credentials option. Please use one " +
- "or the other.")
- if insecure:
- channel_credentials = grpc.experimental.insecure_channel_credentials(
- )
- elif channel_credentials is None:
- _LOGGER.debug("Defaulting to SSL channel credentials.")
- channel_credentials = grpc.ssl_channel_credentials()
- key = (target, options, channel_credentials, compression)
- with self._lock:
- channel_data = self._mapping.get(key, None)
- if channel_data is not None:
- channel = channel_data[0]
- self._mapping.pop(key)
- self._mapping[key] = (channel, datetime.datetime.now() +
- _EVICTION_PERIOD)
- return channel
- else:
- channel = _create_channel(target, options, channel_credentials,
- compression)
- self._mapping[key] = (channel, datetime.datetime.now() +
- _EVICTION_PERIOD)
- if len(self._mapping) == 1 or len(
- self._mapping) >= _MAXIMUM_CHANNELS:
- self._condition.notify()
- return channel
-
- def _test_only_channel_count(self) -> int:
- with self._lock:
- return len(self._mapping)
-
-
-@experimental_api
-def unary_unary(
- request: RequestType,
- target: str,
- method: str,
- request_serializer: Optional[Callable[[Any], bytes]] = None,
- response_deserializer: Optional[Callable[[bytes], Any]] = None,
- options: Sequence[Tuple[AnyStr, AnyStr]] = (),
- channel_credentials: Optional[grpc.ChannelCredentials] = None,
- insecure: bool = False,
- call_credentials: Optional[grpc.CallCredentials] = None,
- compression: Optional[grpc.Compression] = None,
- wait_for_ready: Optional[bool] = None,
- timeout: Optional[float] = _DEFAULT_TIMEOUT,
- metadata: Optional[Sequence[Tuple[str, Union[str, bytes]]]] = None
-) -> ResponseType:
- """Invokes a unary-unary RPC without an explicitly specified channel.
-
- THIS IS AN EXPERIMENTAL API.
-
- This is backed by a per-process cache of channels. Channels are evicted
- from the cache after a fixed period by a background. Channels will also be
- evicted if more than a configured maximum accumulate.
-
- The default eviction period is 10 minutes. One may set the environment
- variable "GRPC_PYTHON_MANAGED_CHANNEL_EVICTION_SECONDS" to configure this.
-
- The default maximum number of channels is 256. One may set the
- environment variable "GRPC_PYTHON_MANAGED_CHANNEL_MAXIMUM" to configure
- this.
-
- Args:
- request: An iterator that yields request values for the RPC.
- target: The server address.
- method: The name of the RPC method.
- request_serializer: Optional :term:`serializer` for serializing the request
- message. Request goes unserialized in case None is passed.
- response_deserializer: Optional :term:`deserializer` for deserializing the response
- message. Response goes undeserialized in case None is passed.
- options: An optional list of key-value pairs (:term:`channel_arguments` in gRPC Core
- runtime) to configure the channel.
- channel_credentials: A credential applied to the whole channel, e.g. the
- return value of grpc.ssl_channel_credentials() or
- grpc.insecure_channel_credentials().
- insecure: If True, specifies channel_credentials as
- :term:`grpc.insecure_channel_credentials()`. This option is mutually
- exclusive with the `channel_credentials` option.
- call_credentials: A call credential applied to each call individually,
- e.g. the output of grpc.metadata_call_credentials() or
- grpc.access_token_call_credentials().
- compression: An optional value indicating the compression method to be
- used over the lifetime of the channel, e.g. grpc.Compression.Gzip.
- wait_for_ready: An optional flag indicating whether the RPC should fail
- immediately if the connection is not ready at the time the RPC is
- invoked, or if it should wait until the connection to the server
- becomes ready. When using this option, the user will likely also want
- to set a timeout. Defaults to True.
- timeout: An optional duration of time in seconds to allow for the RPC,
- after which an exception will be raised. If timeout is unspecified,
- defaults to a timeout controlled by the
- GRPC_PYTHON_DEFAULT_TIMEOUT_SECONDS environment variable. If that is
- unset, defaults to 60 seconds. Supply a value of None to indicate that
- no timeout should be enforced.
- metadata: Optional metadata to send to the server.
-
- Returns:
- The response to the RPC.
- """
- channel = ChannelCache.get().get_channel(target, options,
- channel_credentials, insecure,
- compression)
- multicallable = channel.unary_unary(method, request_serializer,
- response_deserializer)
- wait_for_ready = wait_for_ready if wait_for_ready is not None else True
- return multicallable(request,
- metadata=metadata,
- wait_for_ready=wait_for_ready,
- credentials=call_credentials,
- timeout=timeout)
-
-
-@experimental_api
-def unary_stream(
- request: RequestType,
- target: str,
- method: str,
- request_serializer: Optional[Callable[[Any], bytes]] = None,
- response_deserializer: Optional[Callable[[bytes], Any]] = None,
- options: Sequence[Tuple[AnyStr, AnyStr]] = (),
- channel_credentials: Optional[grpc.ChannelCredentials] = None,
- insecure: bool = False,
- call_credentials: Optional[grpc.CallCredentials] = None,
- compression: Optional[grpc.Compression] = None,
- wait_for_ready: Optional[bool] = None,
- timeout: Optional[float] = _DEFAULT_TIMEOUT,
- metadata: Optional[Sequence[Tuple[str, Union[str, bytes]]]] = None
-) -> Iterator[ResponseType]:
- """Invokes a unary-stream RPC without an explicitly specified channel.
-
- THIS IS AN EXPERIMENTAL API.
-
- This is backed by a per-process cache of channels. Channels are evicted
- from the cache after a fixed period by a background. Channels will also be
- evicted if more than a configured maximum accumulate.
-
- The default eviction period is 10 minutes. One may set the environment
- variable "GRPC_PYTHON_MANAGED_CHANNEL_EVICTION_SECONDS" to configure this.
-
- The default maximum number of channels is 256. One may set the
- environment variable "GRPC_PYTHON_MANAGED_CHANNEL_MAXIMUM" to configure
- this.
-
- Args:
- request: An iterator that yields request values for the RPC.
- target: The server address.
- method: The name of the RPC method.
- request_serializer: Optional :term:`serializer` for serializing the request
- message. Request goes unserialized in case None is passed.
- response_deserializer: Optional :term:`deserializer` for deserializing the response
- message. Response goes undeserialized in case None is passed.
- options: An optional list of key-value pairs (:term:`channel_arguments` in gRPC Core
- runtime) to configure the channel.
- channel_credentials: A credential applied to the whole channel, e.g. the
- return value of grpc.ssl_channel_credentials().
- insecure: If True, specifies channel_credentials as
- :term:`grpc.insecure_channel_credentials()`. This option is mutually
- exclusive with the `channel_credentials` option.
- call_credentials: A call credential applied to each call individually,
- e.g. the output of grpc.metadata_call_credentials() or
- grpc.access_token_call_credentials().
- compression: An optional value indicating the compression method to be
- used over the lifetime of the channel, e.g. grpc.Compression.Gzip.
- wait_for_ready: An optional flag indicating whether the RPC should fail
- immediately if the connection is not ready at the time the RPC is
- invoked, or if it should wait until the connection to the server
- becomes ready. When using this option, the user will likely also want
- to set a timeout. Defaults to True.
- timeout: An optional duration of time in seconds to allow for the RPC,
- after which an exception will be raised. If timeout is unspecified,
- defaults to a timeout controlled by the
- GRPC_PYTHON_DEFAULT_TIMEOUT_SECONDS environment variable. If that is
- unset, defaults to 60 seconds. Supply a value of None to indicate that
- no timeout should be enforced.
- metadata: Optional metadata to send to the server.
-
- Returns:
- An iterator of responses.
- """
- channel = ChannelCache.get().get_channel(target, options,
- channel_credentials, insecure,
- compression)
- multicallable = channel.unary_stream(method, request_serializer,
- response_deserializer)
- wait_for_ready = wait_for_ready if wait_for_ready is not None else True
- return multicallable(request,
- metadata=metadata,
- wait_for_ready=wait_for_ready,
- credentials=call_credentials,
- timeout=timeout)
-
-
-@experimental_api
-def stream_unary(
- request_iterator: Iterator[RequestType],
- target: str,
- method: str,
- request_serializer: Optional[Callable[[Any], bytes]] = None,
- response_deserializer: Optional[Callable[[bytes], Any]] = None,
- options: Sequence[Tuple[AnyStr, AnyStr]] = (),
- channel_credentials: Optional[grpc.ChannelCredentials] = None,
- insecure: bool = False,
- call_credentials: Optional[grpc.CallCredentials] = None,
- compression: Optional[grpc.Compression] = None,
- wait_for_ready: Optional[bool] = None,
- timeout: Optional[float] = _DEFAULT_TIMEOUT,
- metadata: Optional[Sequence[Tuple[str, Union[str, bytes]]]] = None
-) -> ResponseType:
- """Invokes a stream-unary RPC without an explicitly specified channel.
-
- THIS IS AN EXPERIMENTAL API.
-
- This is backed by a per-process cache of channels. Channels are evicted
- from the cache after a fixed period by a background. Channels will also be
- evicted if more than a configured maximum accumulate.
-
- The default eviction period is 10 minutes. One may set the environment
- variable "GRPC_PYTHON_MANAGED_CHANNEL_EVICTION_SECONDS" to configure this.
-
- The default maximum number of channels is 256. One may set the
- environment variable "GRPC_PYTHON_MANAGED_CHANNEL_MAXIMUM" to configure
- this.
-
- Args:
- request_iterator: An iterator that yields request values for the RPC.
- target: The server address.
- method: The name of the RPC method.
- request_serializer: Optional :term:`serializer` for serializing the request
- message. Request goes unserialized in case None is passed.
- response_deserializer: Optional :term:`deserializer` for deserializing the response
- message. Response goes undeserialized in case None is passed.
- options: An optional list of key-value pairs (:term:`channel_arguments` in gRPC Core
- runtime) to configure the channel.
- channel_credentials: A credential applied to the whole channel, e.g. the
- return value of grpc.ssl_channel_credentials().
- call_credentials: A call credential applied to each call individually,
- e.g. the output of grpc.metadata_call_credentials() or
- grpc.access_token_call_credentials().
- insecure: If True, specifies channel_credentials as
- :term:`grpc.insecure_channel_credentials()`. This option is mutually
- exclusive with the `channel_credentials` option.
- compression: An optional value indicating the compression method to be
- used over the lifetime of the channel, e.g. grpc.Compression.Gzip.
- wait_for_ready: An optional flag indicating whether the RPC should fail
- immediately if the connection is not ready at the time the RPC is
- invoked, or if it should wait until the connection to the server
- becomes ready. When using this option, the user will likely also want
- to set a timeout. Defaults to True.
- timeout: An optional duration of time in seconds to allow for the RPC,
- after which an exception will be raised. If timeout is unspecified,
- defaults to a timeout controlled by the
- GRPC_PYTHON_DEFAULT_TIMEOUT_SECONDS environment variable. If that is
- unset, defaults to 60 seconds. Supply a value of None to indicate that
- no timeout should be enforced.
- metadata: Optional metadata to send to the server.
-
- Returns:
- The response to the RPC.
- """
- channel = ChannelCache.get().get_channel(target, options,
- channel_credentials, insecure,
- compression)
- multicallable = channel.stream_unary(method, request_serializer,
- response_deserializer)
- wait_for_ready = wait_for_ready if wait_for_ready is not None else True
- return multicallable(request_iterator,
- metadata=metadata,
- wait_for_ready=wait_for_ready,
- credentials=call_credentials,
- timeout=timeout)
-
-
-@experimental_api
-def stream_stream(
- request_iterator: Iterator[RequestType],
- target: str,
- method: str,
- request_serializer: Optional[Callable[[Any], bytes]] = None,
- response_deserializer: Optional[Callable[[bytes], Any]] = None,
- options: Sequence[Tuple[AnyStr, AnyStr]] = (),
- channel_credentials: Optional[grpc.ChannelCredentials] = None,
- insecure: bool = False,
- call_credentials: Optional[grpc.CallCredentials] = None,
- compression: Optional[grpc.Compression] = None,
- wait_for_ready: Optional[bool] = None,
- timeout: Optional[float] = _DEFAULT_TIMEOUT,
- metadata: Optional[Sequence[Tuple[str, Union[str, bytes]]]] = None
-) -> Iterator[ResponseType]:
- """Invokes a stream-stream RPC without an explicitly specified channel.
-
- THIS IS AN EXPERIMENTAL API.
-
- This is backed by a per-process cache of channels. Channels are evicted
- from the cache after a fixed period by a background. Channels will also be
- evicted if more than a configured maximum accumulate.
-
- The default eviction period is 10 minutes. One may set the environment
- variable "GRPC_PYTHON_MANAGED_CHANNEL_EVICTION_SECONDS" to configure this.
-
- The default maximum number of channels is 256. One may set the
- environment variable "GRPC_PYTHON_MANAGED_CHANNEL_MAXIMUM" to configure
- this.
-
- Args:
- request_iterator: An iterator that yields request values for the RPC.
- target: The server address.
- method: The name of the RPC method.
- request_serializer: Optional :term:`serializer` for serializing the request
- message. Request goes unserialized in case None is passed.
- response_deserializer: Optional :term:`deserializer` for deserializing the response
- message. Response goes undeserialized in case None is passed.
- options: An optional list of key-value pairs (:term:`channel_arguments` in gRPC Core
- runtime) to configure the channel.
- channel_credentials: A credential applied to the whole channel, e.g. the
- return value of grpc.ssl_channel_credentials().
- call_credentials: A call credential applied to each call individually,
- e.g. the output of grpc.metadata_call_credentials() or
- grpc.access_token_call_credentials().
- insecure: If True, specifies channel_credentials as
- :term:`grpc.insecure_channel_credentials()`. This option is mutually
- exclusive with the `channel_credentials` option.
- compression: An optional value indicating the compression method to be
- used over the lifetime of the channel, e.g. grpc.Compression.Gzip.
- wait_for_ready: An optional flag indicating whether the RPC should fail
- immediately if the connection is not ready at the time the RPC is
- invoked, or if it should wait until the connection to the server
- becomes ready. When using this option, the user will likely also want
- to set a timeout. Defaults to True.
- timeout: An optional duration of time in seconds to allow for the RPC,
- after which an exception will be raised. If timeout is unspecified,
- defaults to a timeout controlled by the
- GRPC_PYTHON_DEFAULT_TIMEOUT_SECONDS environment variable. If that is
- unset, defaults to 60 seconds. Supply a value of None to indicate that
- no timeout should be enforced.
- metadata: Optional metadata to send to the server.
-
- Returns:
- An iterator of responses.
- """
- channel = ChannelCache.get().get_channel(target, options,
- channel_credentials, insecure,
- compression)
- multicallable = channel.stream_stream(method, request_serializer,
- response_deserializer)
- wait_for_ready = wait_for_ready if wait_for_ready is not None else True
- return multicallable(request_iterator,
- metadata=metadata,
- wait_for_ready=wait_for_ready,
- credentials=call_credentials,
- timeout=timeout)
+# Copyright 2020 The gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+"""Functions that obviate explicit stubs and explicit channels."""
+
+import collections
+import datetime
+import os
+import logging
+import threading
+from typing import (Any, AnyStr, Callable, Dict, Iterator, Optional, Sequence,
+ Tuple, TypeVar, Union)
+
+import grpc
+from grpc.experimental import experimental_api
+
+RequestType = TypeVar('RequestType')
+ResponseType = TypeVar('ResponseType')
+
+OptionsType = Sequence[Tuple[str, str]]
+CacheKey = Tuple[str, OptionsType, Optional[grpc.ChannelCredentials], Optional[
+ grpc.Compression]]
+
+_LOGGER = logging.getLogger(__name__)
+
+_EVICTION_PERIOD_KEY = "GRPC_PYTHON_MANAGED_CHANNEL_EVICTION_SECONDS"
+if _EVICTION_PERIOD_KEY in os.environ:
+ _EVICTION_PERIOD = datetime.timedelta(
+ seconds=float(os.environ[_EVICTION_PERIOD_KEY]))
+ _LOGGER.debug("Setting managed channel eviction period to %s",
+ _EVICTION_PERIOD)
+else:
+ _EVICTION_PERIOD = datetime.timedelta(minutes=10)
+
+_MAXIMUM_CHANNELS_KEY = "GRPC_PYTHON_MANAGED_CHANNEL_MAXIMUM"
+if _MAXIMUM_CHANNELS_KEY in os.environ:
+ _MAXIMUM_CHANNELS = int(os.environ[_MAXIMUM_CHANNELS_KEY])
+ _LOGGER.debug("Setting maximum managed channels to %d", _MAXIMUM_CHANNELS)
+else:
+ _MAXIMUM_CHANNELS = 2**8
+
+_DEFAULT_TIMEOUT_KEY = "GRPC_PYTHON_DEFAULT_TIMEOUT_SECONDS"
+if _DEFAULT_TIMEOUT_KEY in os.environ:
+ _DEFAULT_TIMEOUT = float(os.environ[_DEFAULT_TIMEOUT_KEY])
+ _LOGGER.debug("Setting default timeout seconds to %f", _DEFAULT_TIMEOUT)
+else:
+ _DEFAULT_TIMEOUT = 60.0
+
+
+def _create_channel(target: str, options: Sequence[Tuple[str, str]],
+ channel_credentials: Optional[grpc.ChannelCredentials],
+ compression: Optional[grpc.Compression]) -> grpc.Channel:
+ if channel_credentials is grpc.experimental.insecure_channel_credentials():
+ _LOGGER.debug(f"Creating insecure channel with options '{options}' " +
+ f"and compression '{compression}'")
+ return grpc.insecure_channel(target,
+ options=options,
+ compression=compression)
+ else:
+ _LOGGER.debug(
+ f"Creating secure channel with credentials '{channel_credentials}', "
+ + f"options '{options}' and compression '{compression}'")
+ return grpc.secure_channel(target,
+ credentials=channel_credentials,
+ options=options,
+ compression=compression)
+
+
+class ChannelCache:
+ # NOTE(rbellevi): Untyped due to reference cycle.
+ _singleton = None
+ _lock: threading.RLock = threading.RLock()
+ _condition: threading.Condition = threading.Condition(lock=_lock)
+ _eviction_ready: threading.Event = threading.Event()
+
+ _mapping: Dict[CacheKey, Tuple[grpc.Channel, datetime.datetime]]
+ _eviction_thread: threading.Thread
+
+ def __init__(self):
+ self._mapping = collections.OrderedDict()
+ self._eviction_thread = threading.Thread(
+ target=ChannelCache._perform_evictions, daemon=True)
+ self._eviction_thread.start()
+
+ @staticmethod
+ def get():
+ with ChannelCache._lock:
+ if ChannelCache._singleton is None:
+ ChannelCache._singleton = ChannelCache()
+ ChannelCache._eviction_ready.wait()
+ return ChannelCache._singleton
+
+ def _evict_locked(self, key: CacheKey):
+ channel, _ = self._mapping.pop(key)
+ _LOGGER.debug("Evicting channel %s with configuration %s.", channel,
+ key)
+ channel.close()
+ del channel
+
+ @staticmethod
+ def _perform_evictions():
+ while True:
+ with ChannelCache._lock:
+ ChannelCache._eviction_ready.set()
+ if not ChannelCache._singleton._mapping:
+ ChannelCache._condition.wait()
+ elif len(ChannelCache._singleton._mapping) > _MAXIMUM_CHANNELS:
+ key = next(iter(ChannelCache._singleton._mapping.keys()))
+ ChannelCache._singleton._evict_locked(key)
+ # And immediately reevaluate.
+ else:
+ key, (_, eviction_time) = next(
+ iter(ChannelCache._singleton._mapping.items()))
+ now = datetime.datetime.now()
+ if eviction_time <= now:
+ ChannelCache._singleton._evict_locked(key)
+ continue
+ else:
+ time_to_eviction = (eviction_time - now).total_seconds()
+ # NOTE: We aim to *eventually* coalesce to a state in
+ # which no overdue channels are in the cache and the
+ # length of the cache is longer than _MAXIMUM_CHANNELS.
+ # We tolerate momentary states in which these two
+ # criteria are not met.
+ ChannelCache._condition.wait(timeout=time_to_eviction)
+
+ def get_channel(self, target: str, options: Sequence[Tuple[str, str]],
+ channel_credentials: Optional[grpc.ChannelCredentials],
+ insecure: bool,
+ compression: Optional[grpc.Compression]) -> grpc.Channel:
+ if insecure and channel_credentials:
+ raise ValueError("The insecure option is mutually exclusive with " +
+ "the channel_credentials option. Please use one " +
+ "or the other.")
+ if insecure:
+ channel_credentials = grpc.experimental.insecure_channel_credentials(
+ )
+ elif channel_credentials is None:
+ _LOGGER.debug("Defaulting to SSL channel credentials.")
+ channel_credentials = grpc.ssl_channel_credentials()
+ key = (target, options, channel_credentials, compression)
+ with self._lock:
+ channel_data = self._mapping.get(key, None)
+ if channel_data is not None:
+ channel = channel_data[0]
+ self._mapping.pop(key)
+ self._mapping[key] = (channel, datetime.datetime.now() +
+ _EVICTION_PERIOD)
+ return channel
+ else:
+ channel = _create_channel(target, options, channel_credentials,
+ compression)
+ self._mapping[key] = (channel, datetime.datetime.now() +
+ _EVICTION_PERIOD)
+ if len(self._mapping) == 1 or len(
+ self._mapping) >= _MAXIMUM_CHANNELS:
+ self._condition.notify()
+ return channel
+
+ def _test_only_channel_count(self) -> int:
+ with self._lock:
+ return len(self._mapping)
+
+
+@experimental_api
+def unary_unary(
+ request: RequestType,
+ target: str,
+ method: str,
+ request_serializer: Optional[Callable[[Any], bytes]] = None,
+ response_deserializer: Optional[Callable[[bytes], Any]] = None,
+ options: Sequence[Tuple[AnyStr, AnyStr]] = (),
+ channel_credentials: Optional[grpc.ChannelCredentials] = None,
+ insecure: bool = False,
+ call_credentials: Optional[grpc.CallCredentials] = None,
+ compression: Optional[grpc.Compression] = None,
+ wait_for_ready: Optional[bool] = None,
+ timeout: Optional[float] = _DEFAULT_TIMEOUT,
+ metadata: Optional[Sequence[Tuple[str, Union[str, bytes]]]] = None
+) -> ResponseType:
+ """Invokes a unary-unary RPC without an explicitly specified channel.
+
+ THIS IS AN EXPERIMENTAL API.
+
+ This is backed by a per-process cache of channels. Channels are evicted
+ from the cache after a fixed period by a background. Channels will also be
+ evicted if more than a configured maximum accumulate.
+
+ The default eviction period is 10 minutes. One may set the environment
+ variable "GRPC_PYTHON_MANAGED_CHANNEL_EVICTION_SECONDS" to configure this.
+
+ The default maximum number of channels is 256. One may set the
+ environment variable "GRPC_PYTHON_MANAGED_CHANNEL_MAXIMUM" to configure
+ this.
+
+ Args:
+ request: An iterator that yields request values for the RPC.
+ target: The server address.
+ method: The name of the RPC method.
+ request_serializer: Optional :term:`serializer` for serializing the request
+ message. Request goes unserialized in case None is passed.
+ response_deserializer: Optional :term:`deserializer` for deserializing the response
+ message. Response goes undeserialized in case None is passed.
+ options: An optional list of key-value pairs (:term:`channel_arguments` in gRPC Core
+ runtime) to configure the channel.
+ channel_credentials: A credential applied to the whole channel, e.g. the
+ return value of grpc.ssl_channel_credentials() or
+ grpc.insecure_channel_credentials().
+ insecure: If True, specifies channel_credentials as
+ :term:`grpc.insecure_channel_credentials()`. This option is mutually
+ exclusive with the `channel_credentials` option.
+ call_credentials: A call credential applied to each call individually,
+ e.g. the output of grpc.metadata_call_credentials() or
+ grpc.access_token_call_credentials().
+ compression: An optional value indicating the compression method to be
+ used over the lifetime of the channel, e.g. grpc.Compression.Gzip.
+ wait_for_ready: An optional flag indicating whether the RPC should fail
+ immediately if the connection is not ready at the time the RPC is
+ invoked, or if it should wait until the connection to the server
+ becomes ready. When using this option, the user will likely also want
+ to set a timeout. Defaults to True.
+ timeout: An optional duration of time in seconds to allow for the RPC,
+ after which an exception will be raised. If timeout is unspecified,
+ defaults to a timeout controlled by the
+ GRPC_PYTHON_DEFAULT_TIMEOUT_SECONDS environment variable. If that is
+ unset, defaults to 60 seconds. Supply a value of None to indicate that
+ no timeout should be enforced.
+ metadata: Optional metadata to send to the server.
+
+ Returns:
+ The response to the RPC.
+ """
+ channel = ChannelCache.get().get_channel(target, options,
+ channel_credentials, insecure,
+ compression)
+ multicallable = channel.unary_unary(method, request_serializer,
+ response_deserializer)
+ wait_for_ready = wait_for_ready if wait_for_ready is not None else True
+ return multicallable(request,
+ metadata=metadata,
+ wait_for_ready=wait_for_ready,
+ credentials=call_credentials,
+ timeout=timeout)
+
+
+@experimental_api
+def unary_stream(
+ request: RequestType,
+ target: str,
+ method: str,
+ request_serializer: Optional[Callable[[Any], bytes]] = None,
+ response_deserializer: Optional[Callable[[bytes], Any]] = None,
+ options: Sequence[Tuple[AnyStr, AnyStr]] = (),
+ channel_credentials: Optional[grpc.ChannelCredentials] = None,
+ insecure: bool = False,
+ call_credentials: Optional[grpc.CallCredentials] = None,
+ compression: Optional[grpc.Compression] = None,
+ wait_for_ready: Optional[bool] = None,
+ timeout: Optional[float] = _DEFAULT_TIMEOUT,
+ metadata: Optional[Sequence[Tuple[str, Union[str, bytes]]]] = None
+) -> Iterator[ResponseType]:
+ """Invokes a unary-stream RPC without an explicitly specified channel.
+
+ THIS IS AN EXPERIMENTAL API.
+
+ This is backed by a per-process cache of channels. Channels are evicted
+ from the cache after a fixed period by a background. Channels will also be
+ evicted if more than a configured maximum accumulate.
+
+ The default eviction period is 10 minutes. One may set the environment
+ variable "GRPC_PYTHON_MANAGED_CHANNEL_EVICTION_SECONDS" to configure this.
+
+ The default maximum number of channels is 256. One may set the
+ environment variable "GRPC_PYTHON_MANAGED_CHANNEL_MAXIMUM" to configure
+ this.
+
+ Args:
+ request: An iterator that yields request values for the RPC.
+ target: The server address.
+ method: The name of the RPC method.
+ request_serializer: Optional :term:`serializer` for serializing the request
+ message. Request goes unserialized in case None is passed.
+ response_deserializer: Optional :term:`deserializer` for deserializing the response
+ message. Response goes undeserialized in case None is passed.
+ options: An optional list of key-value pairs (:term:`channel_arguments` in gRPC Core
+ runtime) to configure the channel.
+ channel_credentials: A credential applied to the whole channel, e.g. the
+ return value of grpc.ssl_channel_credentials().
+ insecure: If True, specifies channel_credentials as
+ :term:`grpc.insecure_channel_credentials()`. This option is mutually
+ exclusive with the `channel_credentials` option.
+ call_credentials: A call credential applied to each call individually,
+ e.g. the output of grpc.metadata_call_credentials() or
+ grpc.access_token_call_credentials().
+ compression: An optional value indicating the compression method to be
+ used over the lifetime of the channel, e.g. grpc.Compression.Gzip.
+ wait_for_ready: An optional flag indicating whether the RPC should fail
+ immediately if the connection is not ready at the time the RPC is
+ invoked, or if it should wait until the connection to the server
+ becomes ready. When using this option, the user will likely also want
+ to set a timeout. Defaults to True.
+ timeout: An optional duration of time in seconds to allow for the RPC,
+ after which an exception will be raised. If timeout is unspecified,
+ defaults to a timeout controlled by the
+ GRPC_PYTHON_DEFAULT_TIMEOUT_SECONDS environment variable. If that is
+ unset, defaults to 60 seconds. Supply a value of None to indicate that
+ no timeout should be enforced.
+ metadata: Optional metadata to send to the server.
+
+ Returns:
+ An iterator of responses.
+ """
+ channel = ChannelCache.get().get_channel(target, options,
+ channel_credentials, insecure,
+ compression)
+ multicallable = channel.unary_stream(method, request_serializer,
+ response_deserializer)
+ wait_for_ready = wait_for_ready if wait_for_ready is not None else True
+ return multicallable(request,
+ metadata=metadata,
+ wait_for_ready=wait_for_ready,
+ credentials=call_credentials,
+ timeout=timeout)
+
+
+@experimental_api
+def stream_unary(
+ request_iterator: Iterator[RequestType],
+ target: str,
+ method: str,
+ request_serializer: Optional[Callable[[Any], bytes]] = None,
+ response_deserializer: Optional[Callable[[bytes], Any]] = None,
+ options: Sequence[Tuple[AnyStr, AnyStr]] = (),
+ channel_credentials: Optional[grpc.ChannelCredentials] = None,
+ insecure: bool = False,
+ call_credentials: Optional[grpc.CallCredentials] = None,
+ compression: Optional[grpc.Compression] = None,
+ wait_for_ready: Optional[bool] = None,
+ timeout: Optional[float] = _DEFAULT_TIMEOUT,
+ metadata: Optional[Sequence[Tuple[str, Union[str, bytes]]]] = None
+) -> ResponseType:
+ """Invokes a stream-unary RPC without an explicitly specified channel.
+
+ THIS IS AN EXPERIMENTAL API.
+
+ This is backed by a per-process cache of channels. Channels are evicted
+ from the cache after a fixed period by a background. Channels will also be
+ evicted if more than a configured maximum accumulate.
+
+ The default eviction period is 10 minutes. One may set the environment
+ variable "GRPC_PYTHON_MANAGED_CHANNEL_EVICTION_SECONDS" to configure this.
+
+ The default maximum number of channels is 256. One may set the
+ environment variable "GRPC_PYTHON_MANAGED_CHANNEL_MAXIMUM" to configure
+ this.
+
+ Args:
+ request_iterator: An iterator that yields request values for the RPC.
+ target: The server address.
+ method: The name of the RPC method.
+ request_serializer: Optional :term:`serializer` for serializing the request
+ message. Request goes unserialized in case None is passed.
+ response_deserializer: Optional :term:`deserializer` for deserializing the response
+ message. Response goes undeserialized in case None is passed.
+ options: An optional list of key-value pairs (:term:`channel_arguments` in gRPC Core
+ runtime) to configure the channel.
+ channel_credentials: A credential applied to the whole channel, e.g. the
+ return value of grpc.ssl_channel_credentials().
+ call_credentials: A call credential applied to each call individually,
+ e.g. the output of grpc.metadata_call_credentials() or
+ grpc.access_token_call_credentials().
+ insecure: If True, specifies channel_credentials as
+ :term:`grpc.insecure_channel_credentials()`. This option is mutually
+ exclusive with the `channel_credentials` option.
+ compression: An optional value indicating the compression method to be
+ used over the lifetime of the channel, e.g. grpc.Compression.Gzip.
+ wait_for_ready: An optional flag indicating whether the RPC should fail
+ immediately if the connection is not ready at the time the RPC is
+ invoked, or if it should wait until the connection to the server
+ becomes ready. When using this option, the user will likely also want
+ to set a timeout. Defaults to True.
+ timeout: An optional duration of time in seconds to allow for the RPC,
+ after which an exception will be raised. If timeout is unspecified,
+ defaults to a timeout controlled by the
+ GRPC_PYTHON_DEFAULT_TIMEOUT_SECONDS environment variable. If that is
+ unset, defaults to 60 seconds. Supply a value of None to indicate that
+ no timeout should be enforced.
+ metadata: Optional metadata to send to the server.
+
+ Returns:
+ The response to the RPC.
+ """
+ channel = ChannelCache.get().get_channel(target, options,
+ channel_credentials, insecure,
+ compression)
+ multicallable = channel.stream_unary(method, request_serializer,
+ response_deserializer)
+ wait_for_ready = wait_for_ready if wait_for_ready is not None else True
+ return multicallable(request_iterator,
+ metadata=metadata,
+ wait_for_ready=wait_for_ready,
+ credentials=call_credentials,
+ timeout=timeout)
+
+
+@experimental_api
+def stream_stream(
+ request_iterator: Iterator[RequestType],
+ target: str,
+ method: str,
+ request_serializer: Optional[Callable[[Any], bytes]] = None,
+ response_deserializer: Optional[Callable[[bytes], Any]] = None,
+ options: Sequence[Tuple[AnyStr, AnyStr]] = (),
+ channel_credentials: Optional[grpc.ChannelCredentials] = None,
+ insecure: bool = False,
+ call_credentials: Optional[grpc.CallCredentials] = None,
+ compression: Optional[grpc.Compression] = None,
+ wait_for_ready: Optional[bool] = None,
+ timeout: Optional[float] = _DEFAULT_TIMEOUT,
+ metadata: Optional[Sequence[Tuple[str, Union[str, bytes]]]] = None
+) -> Iterator[ResponseType]:
+ """Invokes a stream-stream RPC without an explicitly specified channel.
+
+ THIS IS AN EXPERIMENTAL API.
+
+ This is backed by a per-process cache of channels. Channels are evicted
+ from the cache after a fixed period by a background. Channels will also be
+ evicted if more than a configured maximum accumulate.
+
+ The default eviction period is 10 minutes. One may set the environment
+ variable "GRPC_PYTHON_MANAGED_CHANNEL_EVICTION_SECONDS" to configure this.
+
+ The default maximum number of channels is 256. One may set the
+ environment variable "GRPC_PYTHON_MANAGED_CHANNEL_MAXIMUM" to configure
+ this.
+
+ Args:
+ request_iterator: An iterator that yields request values for the RPC.
+ target: The server address.
+ method: The name of the RPC method.
+ request_serializer: Optional :term:`serializer` for serializing the request
+ message. Request goes unserialized in case None is passed.
+ response_deserializer: Optional :term:`deserializer` for deserializing the response
+ message. Response goes undeserialized in case None is passed.
+ options: An optional list of key-value pairs (:term:`channel_arguments` in gRPC Core
+ runtime) to configure the channel.
+ channel_credentials: A credential applied to the whole channel, e.g. the
+ return value of grpc.ssl_channel_credentials().
+ call_credentials: A call credential applied to each call individually,
+ e.g. the output of grpc.metadata_call_credentials() or
+ grpc.access_token_call_credentials().
+ insecure: If True, specifies channel_credentials as
+ :term:`grpc.insecure_channel_credentials()`. This option is mutually
+ exclusive with the `channel_credentials` option.
+ compression: An optional value indicating the compression method to be
+ used over the lifetime of the channel, e.g. grpc.Compression.Gzip.
+ wait_for_ready: An optional flag indicating whether the RPC should fail
+ immediately if the connection is not ready at the time the RPC is
+ invoked, or if it should wait until the connection to the server
+ becomes ready. When using this option, the user will likely also want
+ to set a timeout. Defaults to True.
+ timeout: An optional duration of time in seconds to allow for the RPC,
+ after which an exception will be raised. If timeout is unspecified,
+ defaults to a timeout controlled by the
+ GRPC_PYTHON_DEFAULT_TIMEOUT_SECONDS environment variable. If that is
+ unset, defaults to 60 seconds. Supply a value of None to indicate that
+ no timeout should be enforced.
+ metadata: Optional metadata to send to the server.
+
+ Returns:
+ An iterator of responses.
+ """
+ channel = ChannelCache.get().get_channel(target, options,
+ channel_credentials, insecure,
+ compression)
+ multicallable = channel.stream_stream(method, request_serializer,
+ response_deserializer)
+ wait_for_ready = wait_for_ready if wait_for_ready is not None else True
+ return multicallable(request_iterator,
+ metadata=metadata,
+ wait_for_ready=wait_for_ready,
+ credentials=call_credentials,
+ timeout=timeout)
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/aio/__init__.py b/contrib/libs/grpc/src/python/grpcio/grpc/aio/__init__.py
index a947e69407c..2933aa5a45e 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/aio/__init__.py
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/aio/__init__.py
@@ -1,81 +1,81 @@
-# Copyright 2019 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-"""gRPC's Asynchronous Python API.
-
-gRPC Async API objects may only be used on the thread on which they were
-created. AsyncIO doesn't provide thread safety for most of its APIs.
-"""
-
-from typing import Any, Optional, Sequence, Tuple
-
-import grpc
-from grpc._cython.cygrpc import (init_grpc_aio, shutdown_grpc_aio, EOF,
- AbortError, BaseError, InternalError,
- UsageError)
-
-from ._base_call import (Call, RpcContext, StreamStreamCall, StreamUnaryCall,
- UnaryStreamCall, UnaryUnaryCall)
-from ._base_channel import (Channel, StreamStreamMultiCallable,
- StreamUnaryMultiCallable, UnaryStreamMultiCallable,
- UnaryUnaryMultiCallable)
-from ._call import AioRpcError
-from ._interceptor import (ClientCallDetails, ClientInterceptor,
- InterceptedUnaryUnaryCall,
- UnaryUnaryClientInterceptor,
- UnaryStreamClientInterceptor,
- StreamUnaryClientInterceptor,
- StreamStreamClientInterceptor, ServerInterceptor)
-from ._server import server
-from ._base_server import Server, ServicerContext
-from ._typing import ChannelArgumentType
-from ._channel import insecure_channel, secure_channel
-from ._metadata import Metadata
-
-################################### __all__ #################################
-
-__all__ = (
- 'init_grpc_aio',
- 'shutdown_grpc_aio',
- 'AioRpcError',
- 'RpcContext',
- 'Call',
- 'UnaryUnaryCall',
- 'UnaryStreamCall',
- 'StreamUnaryCall',
- 'StreamStreamCall',
- 'Channel',
- 'UnaryUnaryMultiCallable',
- 'UnaryStreamMultiCallable',
- 'StreamUnaryMultiCallable',
- 'StreamStreamMultiCallable',
- 'ClientCallDetails',
- 'ClientInterceptor',
- 'UnaryStreamClientInterceptor',
- 'UnaryUnaryClientInterceptor',
- 'StreamUnaryClientInterceptor',
- 'StreamStreamClientInterceptor',
- 'InterceptedUnaryUnaryCall',
- 'ServerInterceptor',
- 'insecure_channel',
- 'server',
- 'Server',
- 'ServicerContext',
- 'EOF',
- 'secure_channel',
- 'AbortError',
- 'BaseError',
- 'UsageError',
- 'InternalError',
- 'Metadata',
-)
+# Copyright 2019 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+"""gRPC's Asynchronous Python API.
+
+gRPC Async API objects may only be used on the thread on which they were
+created. AsyncIO doesn't provide thread safety for most of its APIs.
+"""
+
+from typing import Any, Optional, Sequence, Tuple
+
+import grpc
+from grpc._cython.cygrpc import (init_grpc_aio, shutdown_grpc_aio, EOF,
+ AbortError, BaseError, InternalError,
+ UsageError)
+
+from ._base_call import (Call, RpcContext, StreamStreamCall, StreamUnaryCall,
+ UnaryStreamCall, UnaryUnaryCall)
+from ._base_channel import (Channel, StreamStreamMultiCallable,
+ StreamUnaryMultiCallable, UnaryStreamMultiCallable,
+ UnaryUnaryMultiCallable)
+from ._call import AioRpcError
+from ._interceptor import (ClientCallDetails, ClientInterceptor,
+ InterceptedUnaryUnaryCall,
+ UnaryUnaryClientInterceptor,
+ UnaryStreamClientInterceptor,
+ StreamUnaryClientInterceptor,
+ StreamStreamClientInterceptor, ServerInterceptor)
+from ._server import server
+from ._base_server import Server, ServicerContext
+from ._typing import ChannelArgumentType
+from ._channel import insecure_channel, secure_channel
+from ._metadata import Metadata
+
+################################### __all__ #################################
+
+__all__ = (
+ 'init_grpc_aio',
+ 'shutdown_grpc_aio',
+ 'AioRpcError',
+ 'RpcContext',
+ 'Call',
+ 'UnaryUnaryCall',
+ 'UnaryStreamCall',
+ 'StreamUnaryCall',
+ 'StreamStreamCall',
+ 'Channel',
+ 'UnaryUnaryMultiCallable',
+ 'UnaryStreamMultiCallable',
+ 'StreamUnaryMultiCallable',
+ 'StreamStreamMultiCallable',
+ 'ClientCallDetails',
+ 'ClientInterceptor',
+ 'UnaryStreamClientInterceptor',
+ 'UnaryUnaryClientInterceptor',
+ 'StreamUnaryClientInterceptor',
+ 'StreamStreamClientInterceptor',
+ 'InterceptedUnaryUnaryCall',
+ 'ServerInterceptor',
+ 'insecure_channel',
+ 'server',
+ 'Server',
+ 'ServicerContext',
+ 'EOF',
+ 'secure_channel',
+ 'AbortError',
+ 'BaseError',
+ 'UsageError',
+ 'InternalError',
+ 'Metadata',
+)
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/aio/_base_call.py b/contrib/libs/grpc/src/python/grpcio/grpc/aio/_base_call.py
index efa88864d13..4ccbb3be132 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/aio/_base_call.py
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/aio/_base_call.py
@@ -1,244 +1,244 @@
-# Copyright 2019 The gRPC Authors
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-"""Abstract base classes for client-side Call objects.
-
-Call objects represents the RPC itself, and offer methods to access / modify
-its information. They also offer methods to manipulate the life-cycle of the
-RPC, e.g. cancellation.
-"""
-
-from abc import ABCMeta, abstractmethod
-from typing import AsyncIterable, Awaitable, Generic, Optional, Union
-
-import grpc
-
-from ._typing import (DoneCallbackType, EOFType, RequestType, ResponseType)
-from ._metadata import Metadata
-
-__all__ = 'RpcContext', 'Call', 'UnaryUnaryCall', 'UnaryStreamCall'
-
-
-class RpcContext(metaclass=ABCMeta):
- """Provides RPC-related information and action."""
-
- @abstractmethod
- def cancelled(self) -> bool:
- """Return True if the RPC is cancelled.
-
- The RPC is cancelled when the cancellation was requested with cancel().
-
- Returns:
- A bool indicates whether the RPC is cancelled or not.
- """
-
- @abstractmethod
- def done(self) -> bool:
- """Return True if the RPC is done.
-
- An RPC is done if the RPC is completed, cancelled or aborted.
-
- Returns:
- A bool indicates if the RPC is done.
- """
-
- @abstractmethod
- def time_remaining(self) -> Optional[float]:
- """Describes the length of allowed time remaining for the RPC.
-
- Returns:
- A nonnegative float indicating the length of allowed time in seconds
- remaining for the RPC to complete before it is considered to have
- timed out, or None if no deadline was specified for the RPC.
- """
-
- @abstractmethod
- def cancel(self) -> bool:
- """Cancels the RPC.
-
- Idempotent and has no effect if the RPC has already terminated.
-
- Returns:
- A bool indicates if the cancellation is performed or not.
- """
-
- @abstractmethod
- def add_done_callback(self, callback: DoneCallbackType) -> None:
- """Registers a callback to be called on RPC termination.
-
- Args:
- callback: A callable object will be called with the call object as
- its only argument.
- """
-
-
-class Call(RpcContext, metaclass=ABCMeta):
- """The abstract base class of an RPC on the client-side."""
-
- @abstractmethod
- async def initial_metadata(self) -> Metadata:
- """Accesses the initial metadata sent by the server.
-
- Returns:
- The initial :term:`metadata`.
- """
-
- @abstractmethod
- async def trailing_metadata(self) -> Metadata:
- """Accesses the trailing metadata sent by the server.
-
- Returns:
- The trailing :term:`metadata`.
- """
-
- @abstractmethod
- async def code(self) -> grpc.StatusCode:
- """Accesses the status code sent by the server.
-
- Returns:
- The StatusCode value for the RPC.
- """
-
- @abstractmethod
- async def details(self) -> str:
- """Accesses the details sent by the server.
-
- Returns:
- The details string of the RPC.
- """
-
- @abstractmethod
- async def wait_for_connection(self) -> None:
- """Waits until connected to peer and raises aio.AioRpcError if failed.
-
- This is an EXPERIMENTAL method.
-
- This method ensures the RPC has been successfully connected. Otherwise,
- an AioRpcError will be raised to explain the reason of the connection
- failure.
-
- This method is recommended for building retry mechanisms.
- """
-
-
-class UnaryUnaryCall(Generic[RequestType, ResponseType],
- Call,
- metaclass=ABCMeta):
- """The abstract base class of an unary-unary RPC on the client-side."""
-
- @abstractmethod
- def __await__(self) -> Awaitable[ResponseType]:
- """Await the response message to be ready.
-
- Returns:
- The response message of the RPC.
- """
-
-
-class UnaryStreamCall(Generic[RequestType, ResponseType],
- Call,
- metaclass=ABCMeta):
-
- @abstractmethod
- def __aiter__(self) -> AsyncIterable[ResponseType]:
- """Returns the async iterable representation that yields messages.
-
- Under the hood, it is calling the "read" method.
-
- Returns:
- An async iterable object that yields messages.
- """
-
- @abstractmethod
- async def read(self) -> Union[EOFType, ResponseType]:
- """Reads one message from the stream.
-
- Read operations must be serialized when called from multiple
- coroutines.
-
- Returns:
- A response message, or an `grpc.aio.EOF` to indicate the end of the
- stream.
- """
-
-
-class StreamUnaryCall(Generic[RequestType, ResponseType],
- Call,
- metaclass=ABCMeta):
-
- @abstractmethod
- async def write(self, request: RequestType) -> None:
- """Writes one message to the stream.
-
- Raises:
- An RpcError exception if the write failed.
- """
-
- @abstractmethod
- async def done_writing(self) -> None:
- """Notifies server that the client is done sending messages.
-
- After done_writing is called, any additional invocation to the write
- function will fail. This function is idempotent.
- """
-
- @abstractmethod
- def __await__(self) -> Awaitable[ResponseType]:
- """Await the response message to be ready.
-
- Returns:
- The response message of the stream.
- """
-
-
-class StreamStreamCall(Generic[RequestType, ResponseType],
- Call,
- metaclass=ABCMeta):
-
- @abstractmethod
- def __aiter__(self) -> AsyncIterable[ResponseType]:
- """Returns the async iterable representation that yields messages.
-
- Under the hood, it is calling the "read" method.
-
- Returns:
- An async iterable object that yields messages.
- """
-
- @abstractmethod
- async def read(self) -> Union[EOFType, ResponseType]:
- """Reads one message from the stream.
-
- Read operations must be serialized when called from multiple
- coroutines.
-
- Returns:
- A response message, or an `grpc.aio.EOF` to indicate the end of the
- stream.
- """
-
- @abstractmethod
- async def write(self, request: RequestType) -> None:
- """Writes one message to the stream.
-
- Raises:
- An RpcError exception if the write failed.
- """
-
- @abstractmethod
- async def done_writing(self) -> None:
- """Notifies server that the client is done sending messages.
-
- After done_writing is called, any additional invocation to the write
- function will fail. This function is idempotent.
- """
+# Copyright 2019 The gRPC Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+"""Abstract base classes for client-side Call objects.
+
+Call objects represents the RPC itself, and offer methods to access / modify
+its information. They also offer methods to manipulate the life-cycle of the
+RPC, e.g. cancellation.
+"""
+
+from abc import ABCMeta, abstractmethod
+from typing import AsyncIterable, Awaitable, Generic, Optional, Union
+
+import grpc
+
+from ._typing import (DoneCallbackType, EOFType, RequestType, ResponseType)
+from ._metadata import Metadata
+
+__all__ = 'RpcContext', 'Call', 'UnaryUnaryCall', 'UnaryStreamCall'
+
+
+class RpcContext(metaclass=ABCMeta):
+ """Provides RPC-related information and action."""
+
+ @abstractmethod
+ def cancelled(self) -> bool:
+ """Return True if the RPC is cancelled.
+
+ The RPC is cancelled when the cancellation was requested with cancel().
+
+ Returns:
+ A bool indicates whether the RPC is cancelled or not.
+ """
+
+ @abstractmethod
+ def done(self) -> bool:
+ """Return True if the RPC is done.
+
+ An RPC is done if the RPC is completed, cancelled or aborted.
+
+ Returns:
+ A bool indicates if the RPC is done.
+ """
+
+ @abstractmethod
+ def time_remaining(self) -> Optional[float]:
+ """Describes the length of allowed time remaining for the RPC.
+
+ Returns:
+ A nonnegative float indicating the length of allowed time in seconds
+ remaining for the RPC to complete before it is considered to have
+ timed out, or None if no deadline was specified for the RPC.
+ """
+
+ @abstractmethod
+ def cancel(self) -> bool:
+ """Cancels the RPC.
+
+ Idempotent and has no effect if the RPC has already terminated.
+
+ Returns:
+ A bool indicates if the cancellation is performed or not.
+ """
+
+ @abstractmethod
+ def add_done_callback(self, callback: DoneCallbackType) -> None:
+ """Registers a callback to be called on RPC termination.
+
+ Args:
+ callback: A callable object will be called with the call object as
+ its only argument.
+ """
+
+
+class Call(RpcContext, metaclass=ABCMeta):
+ """The abstract base class of an RPC on the client-side."""
+
+ @abstractmethod
+ async def initial_metadata(self) -> Metadata:
+ """Accesses the initial metadata sent by the server.
+
+ Returns:
+ The initial :term:`metadata`.
+ """
+
+ @abstractmethod
+ async def trailing_metadata(self) -> Metadata:
+ """Accesses the trailing metadata sent by the server.
+
+ Returns:
+ The trailing :term:`metadata`.
+ """
+
+ @abstractmethod
+ async def code(self) -> grpc.StatusCode:
+ """Accesses the status code sent by the server.
+
+ Returns:
+ The StatusCode value for the RPC.
+ """
+
+ @abstractmethod
+ async def details(self) -> str:
+ """Accesses the details sent by the server.
+
+ Returns:
+ The details string of the RPC.
+ """
+
+ @abstractmethod
+ async def wait_for_connection(self) -> None:
+ """Waits until connected to peer and raises aio.AioRpcError if failed.
+
+ This is an EXPERIMENTAL method.
+
+ This method ensures the RPC has been successfully connected. Otherwise,
+ an AioRpcError will be raised to explain the reason of the connection
+ failure.
+
+ This method is recommended for building retry mechanisms.
+ """
+
+
+class UnaryUnaryCall(Generic[RequestType, ResponseType],
+ Call,
+ metaclass=ABCMeta):
+ """The abstract base class of an unary-unary RPC on the client-side."""
+
+ @abstractmethod
+ def __await__(self) -> Awaitable[ResponseType]:
+ """Await the response message to be ready.
+
+ Returns:
+ The response message of the RPC.
+ """
+
+
+class UnaryStreamCall(Generic[RequestType, ResponseType],
+ Call,
+ metaclass=ABCMeta):
+
+ @abstractmethod
+ def __aiter__(self) -> AsyncIterable[ResponseType]:
+ """Returns the async iterable representation that yields messages.
+
+ Under the hood, it is calling the "read" method.
+
+ Returns:
+ An async iterable object that yields messages.
+ """
+
+ @abstractmethod
+ async def read(self) -> Union[EOFType, ResponseType]:
+ """Reads one message from the stream.
+
+ Read operations must be serialized when called from multiple
+ coroutines.
+
+ Returns:
+ A response message, or an `grpc.aio.EOF` to indicate the end of the
+ stream.
+ """
+
+
+class StreamUnaryCall(Generic[RequestType, ResponseType],
+ Call,
+ metaclass=ABCMeta):
+
+ @abstractmethod
+ async def write(self, request: RequestType) -> None:
+ """Writes one message to the stream.
+
+ Raises:
+ An RpcError exception if the write failed.
+ """
+
+ @abstractmethod
+ async def done_writing(self) -> None:
+ """Notifies server that the client is done sending messages.
+
+ After done_writing is called, any additional invocation to the write
+ function will fail. This function is idempotent.
+ """
+
+ @abstractmethod
+ def __await__(self) -> Awaitable[ResponseType]:
+ """Await the response message to be ready.
+
+ Returns:
+ The response message of the stream.
+ """
+
+
+class StreamStreamCall(Generic[RequestType, ResponseType],
+ Call,
+ metaclass=ABCMeta):
+
+ @abstractmethod
+ def __aiter__(self) -> AsyncIterable[ResponseType]:
+ """Returns the async iterable representation that yields messages.
+
+ Under the hood, it is calling the "read" method.
+
+ Returns:
+ An async iterable object that yields messages.
+ """
+
+ @abstractmethod
+ async def read(self) -> Union[EOFType, ResponseType]:
+ """Reads one message from the stream.
+
+ Read operations must be serialized when called from multiple
+ coroutines.
+
+ Returns:
+ A response message, or an `grpc.aio.EOF` to indicate the end of the
+ stream.
+ """
+
+ @abstractmethod
+ async def write(self, request: RequestType) -> None:
+ """Writes one message to the stream.
+
+ Raises:
+ An RpcError exception if the write failed.
+ """
+
+ @abstractmethod
+ async def done_writing(self) -> None:
+ """Notifies server that the client is done sending messages.
+
+ After done_writing is called, any additional invocation to the write
+ function will fail. This function is idempotent.
+ """
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/aio/_base_channel.py b/contrib/libs/grpc/src/python/grpcio/grpc/aio/_base_channel.py
index 8d852a1b9c2..4b4ea1355b4 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/aio/_base_channel.py
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/aio/_base_channel.py
@@ -1,347 +1,347 @@
-# Copyright 2020 The gRPC Authors
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-"""Abstract base classes for Channel objects and Multicallable objects."""
-
-import abc
-from typing import Any, Optional
-
-import grpc
-
-from . import _base_call
-from ._typing import (DeserializingFunction, RequestIterableType,
- SerializingFunction)
-from ._metadata import Metadata
-
-
-class UnaryUnaryMultiCallable(abc.ABC):
- """Enables asynchronous invocation of a unary-call RPC."""
-
- @abc.abstractmethod
- def __call__(self,
- request: Any,
- *,
- timeout: Optional[float] = None,
- metadata: Optional[Metadata] = None,
- credentials: Optional[grpc.CallCredentials] = None,
- wait_for_ready: Optional[bool] = None,
- compression: Optional[grpc.Compression] = None
- ) -> _base_call.UnaryUnaryCall:
- """Asynchronously invokes the underlying RPC.
-
- Args:
- request: The request value for the RPC.
- timeout: An optional duration of time in seconds to allow
- for the RPC.
- metadata: Optional :term:`metadata` to be transmitted to the
- service-side of the RPC.
- credentials: An optional CallCredentials for the RPC. Only valid for
- secure Channel.
- wait_for_ready: This is an EXPERIMENTAL argument. An optional
- flag to enable :term:`wait_for_ready` mechanism.
- compression: An element of grpc.compression, e.g.
- grpc.compression.Gzip. This is an EXPERIMENTAL option.
-
- Returns:
- A UnaryUnaryCall object.
-
- Raises:
- RpcError: Indicates that the RPC terminated with non-OK status. The
- raised RpcError will also be a Call for the RPC affording the RPC's
- metadata, status code, and details.
- """
-
-
-class UnaryStreamMultiCallable(abc.ABC):
- """Enables asynchronous invocation of a server-streaming RPC."""
-
- @abc.abstractmethod
- def __call__(self,
- request: Any,
- *,
- timeout: Optional[float] = None,
- metadata: Optional[Metadata] = None,
- credentials: Optional[grpc.CallCredentials] = None,
- wait_for_ready: Optional[bool] = None,
- compression: Optional[grpc.Compression] = None
- ) -> _base_call.UnaryStreamCall:
- """Asynchronously invokes the underlying RPC.
-
- Args:
- request: The request value for the RPC.
- timeout: An optional duration of time in seconds to allow
- for the RPC.
- metadata: Optional :term:`metadata` to be transmitted to the
- service-side of the RPC.
- credentials: An optional CallCredentials for the RPC. Only valid for
- secure Channel.
- wait_for_ready: This is an EXPERIMENTAL argument. An optional
- flag to enable :term:`wait_for_ready` mechanism.
- compression: An element of grpc.compression, e.g.
- grpc.compression.Gzip. This is an EXPERIMENTAL option.
-
- Returns:
- A UnaryStreamCall object.
-
- Raises:
- RpcError: Indicates that the RPC terminated with non-OK status. The
- raised RpcError will also be a Call for the RPC affording the RPC's
- metadata, status code, and details.
- """
-
-
-class StreamUnaryMultiCallable(abc.ABC):
- """Enables asynchronous invocation of a client-streaming RPC."""
-
- @abc.abstractmethod
- def __call__(self,
- request_iterator: Optional[RequestIterableType] = None,
- timeout: Optional[float] = None,
- metadata: Optional[Metadata] = None,
- credentials: Optional[grpc.CallCredentials] = None,
- wait_for_ready: Optional[bool] = None,
- compression: Optional[grpc.Compression] = None
- ) -> _base_call.StreamUnaryCall:
- """Asynchronously invokes the underlying RPC.
-
- Args:
- request_iterator: An optional async iterable or iterable of request
- messages for the RPC.
- timeout: An optional duration of time in seconds to allow
- for the RPC.
- metadata: Optional :term:`metadata` to be transmitted to the
- service-side of the RPC.
- credentials: An optional CallCredentials for the RPC. Only valid for
- secure Channel.
- wait_for_ready: This is an EXPERIMENTAL argument. An optional
- flag to enable :term:`wait_for_ready` mechanism.
- compression: An element of grpc.compression, e.g.
- grpc.compression.Gzip. This is an EXPERIMENTAL option.
-
- Returns:
- A StreamUnaryCall object.
-
- Raises:
- RpcError: Indicates that the RPC terminated with non-OK status. The
- raised RpcError will also be a Call for the RPC affording the RPC's
- metadata, status code, and details.
- """
-
-
-class StreamStreamMultiCallable(abc.ABC):
- """Enables asynchronous invocation of a bidirectional-streaming RPC."""
-
- @abc.abstractmethod
- def __call__(self,
- request_iterator: Optional[RequestIterableType] = None,
- timeout: Optional[float] = None,
- metadata: Optional[Metadata] = None,
- credentials: Optional[grpc.CallCredentials] = None,
- wait_for_ready: Optional[bool] = None,
- compression: Optional[grpc.Compression] = None
- ) -> _base_call.StreamStreamCall:
- """Asynchronously invokes the underlying RPC.
-
- Args:
- request_iterator: An optional async iterable or iterable of request
- messages for the RPC.
- timeout: An optional duration of time in seconds to allow
- for the RPC.
- metadata: Optional :term:`metadata` to be transmitted to the
- service-side of the RPC.
- credentials: An optional CallCredentials for the RPC. Only valid for
- secure Channel.
- wait_for_ready: This is an EXPERIMENTAL argument. An optional
- flag to enable :term:`wait_for_ready` mechanism.
- compression: An element of grpc.compression, e.g.
- grpc.compression.Gzip. This is an EXPERIMENTAL option.
-
- Returns:
- A StreamStreamCall object.
-
- Raises:
- RpcError: Indicates that the RPC terminated with non-OK status. The
- raised RpcError will also be a Call for the RPC affording the RPC's
- metadata, status code, and details.
- """
-
-
-class Channel(abc.ABC):
- """Enables asynchronous RPC invocation as a client.
-
- Channel objects implement the Asynchronous Context Manager (aka. async
- with) type, although they are not supportted to be entered and exited
- multiple times.
- """
-
- @abc.abstractmethod
- async def __aenter__(self):
- """Starts an asynchronous context manager.
-
- Returns:
- Channel the channel that was instantiated.
- """
-
- @abc.abstractmethod
- async def __aexit__(self, exc_type, exc_val, exc_tb):
- """Finishes the asynchronous context manager by closing the channel.
-
- Still active RPCs will be cancelled.
- """
-
- @abc.abstractmethod
- async def close(self, grace: Optional[float] = None):
- """Closes this Channel and releases all resources held by it.
-
- This method immediately stops the channel from executing new RPCs in
- all cases.
-
- If a grace period is specified, this method wait until all active
- RPCs are finshed, once the grace period is reached the ones that haven't
- been terminated are cancelled. If a grace period is not specified
- (by passing None for grace), all existing RPCs are cancelled immediately.
-
- This method is idempotent.
- """
-
- @abc.abstractmethod
- def get_state(self,
- try_to_connect: bool = False) -> grpc.ChannelConnectivity:
- """Checks the connectivity state of a channel.
-
- This is an EXPERIMENTAL API.
-
- If the channel reaches a stable connectivity state, it is guaranteed
- that the return value of this function will eventually converge to that
- state.
-
- Args:
- try_to_connect: a bool indicate whether the Channel should try to
- connect to peer or not.
-
- Returns: A ChannelConnectivity object.
- """
-
- @abc.abstractmethod
- async def wait_for_state_change(
- self,
- last_observed_state: grpc.ChannelConnectivity,
- ) -> None:
- """Waits for a change in connectivity state.
-
- This is an EXPERIMENTAL API.
-
- The function blocks until there is a change in the channel connectivity
- state from the "last_observed_state". If the state is already
- different, this function will return immediately.
-
- There is an inherent race between the invocation of
- "Channel.wait_for_state_change" and "Channel.get_state". The state can
- change arbitrary many times during the race, so there is no way to
- observe every state transition.
-
- If there is a need to put a timeout for this function, please refer to
- "asyncio.wait_for".
-
- Args:
- last_observed_state: A grpc.ChannelConnectivity object representing
- the last known state.
- """
-
- @abc.abstractmethod
- async def channel_ready(self) -> None:
- """Creates a coroutine that blocks until the Channel is READY."""
-
- @abc.abstractmethod
- def unary_unary(
- self,
- method: str,
- request_serializer: Optional[SerializingFunction] = None,
- response_deserializer: Optional[DeserializingFunction] = None
- ) -> UnaryUnaryMultiCallable:
- """Creates a UnaryUnaryMultiCallable for a unary-unary method.
-
- Args:
- method: The name of the RPC method.
- request_serializer: Optional :term:`serializer` for serializing the request
- message. Request goes unserialized in case None is passed.
- response_deserializer: Optional :term:`deserializer` for deserializing the
- response message. Response goes undeserialized in case None
- is passed.
-
- Returns:
- A UnaryUnaryMultiCallable value for the named unary-unary method.
- """
-
- @abc.abstractmethod
- def unary_stream(
- self,
- method: str,
- request_serializer: Optional[SerializingFunction] = None,
- response_deserializer: Optional[DeserializingFunction] = None
- ) -> UnaryStreamMultiCallable:
- """Creates a UnaryStreamMultiCallable for a unary-stream method.
-
- Args:
- method: The name of the RPC method.
- request_serializer: Optional :term:`serializer` for serializing the request
- message. Request goes unserialized in case None is passed.
- response_deserializer: Optional :term:`deserializer` for deserializing the
- response message. Response goes undeserialized in case None
- is passed.
-
- Returns:
- A UnarySteramMultiCallable value for the named unary-stream method.
- """
-
- @abc.abstractmethod
- def stream_unary(
- self,
- method: str,
- request_serializer: Optional[SerializingFunction] = None,
- response_deserializer: Optional[DeserializingFunction] = None
- ) -> StreamUnaryMultiCallable:
- """Creates a StreamUnaryMultiCallable for a stream-unary method.
-
- Args:
- method: The name of the RPC method.
- request_serializer: Optional :term:`serializer` for serializing the request
- message. Request goes unserialized in case None is passed.
- response_deserializer: Optional :term:`deserializer` for deserializing the
- response message. Response goes undeserialized in case None
- is passed.
-
- Returns:
- A StreamUnaryMultiCallable value for the named stream-unary method.
- """
-
- @abc.abstractmethod
- def stream_stream(
- self,
- method: str,
- request_serializer: Optional[SerializingFunction] = None,
- response_deserializer: Optional[DeserializingFunction] = None
- ) -> StreamStreamMultiCallable:
- """Creates a StreamStreamMultiCallable for a stream-stream method.
-
- Args:
- method: The name of the RPC method.
- request_serializer: Optional :term:`serializer` for serializing the request
- message. Request goes unserialized in case None is passed.
- response_deserializer: Optional :term:`deserializer` for deserializing the
- response message. Response goes undeserialized in case None
- is passed.
-
- Returns:
- A StreamStreamMultiCallable value for the named stream-stream method.
- """
+# Copyright 2020 The gRPC Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+"""Abstract base classes for Channel objects and Multicallable objects."""
+
+import abc
+from typing import Any, Optional
+
+import grpc
+
+from . import _base_call
+from ._typing import (DeserializingFunction, RequestIterableType,
+ SerializingFunction)
+from ._metadata import Metadata
+
+
+class UnaryUnaryMultiCallable(abc.ABC):
+ """Enables asynchronous invocation of a unary-call RPC."""
+
+ @abc.abstractmethod
+ def __call__(self,
+ request: Any,
+ *,
+ timeout: Optional[float] = None,
+ metadata: Optional[Metadata] = None,
+ credentials: Optional[grpc.CallCredentials] = None,
+ wait_for_ready: Optional[bool] = None,
+ compression: Optional[grpc.Compression] = None
+ ) -> _base_call.UnaryUnaryCall:
+ """Asynchronously invokes the underlying RPC.
+
+ Args:
+ request: The request value for the RPC.
+ timeout: An optional duration of time in seconds to allow
+ for the RPC.
+ metadata: Optional :term:`metadata` to be transmitted to the
+ service-side of the RPC.
+ credentials: An optional CallCredentials for the RPC. Only valid for
+ secure Channel.
+ wait_for_ready: This is an EXPERIMENTAL argument. An optional
+ flag to enable :term:`wait_for_ready` mechanism.
+ compression: An element of grpc.compression, e.g.
+ grpc.compression.Gzip. This is an EXPERIMENTAL option.
+
+ Returns:
+ A UnaryUnaryCall object.
+
+ Raises:
+ RpcError: Indicates that the RPC terminated with non-OK status. The
+ raised RpcError will also be a Call for the RPC affording the RPC's
+ metadata, status code, and details.
+ """
+
+
+class UnaryStreamMultiCallable(abc.ABC):
+ """Enables asynchronous invocation of a server-streaming RPC."""
+
+ @abc.abstractmethod
+ def __call__(self,
+ request: Any,
+ *,
+ timeout: Optional[float] = None,
+ metadata: Optional[Metadata] = None,
+ credentials: Optional[grpc.CallCredentials] = None,
+ wait_for_ready: Optional[bool] = None,
+ compression: Optional[grpc.Compression] = None
+ ) -> _base_call.UnaryStreamCall:
+ """Asynchronously invokes the underlying RPC.
+
+ Args:
+ request: The request value for the RPC.
+ timeout: An optional duration of time in seconds to allow
+ for the RPC.
+ metadata: Optional :term:`metadata` to be transmitted to the
+ service-side of the RPC.
+ credentials: An optional CallCredentials for the RPC. Only valid for
+ secure Channel.
+ wait_for_ready: This is an EXPERIMENTAL argument. An optional
+ flag to enable :term:`wait_for_ready` mechanism.
+ compression: An element of grpc.compression, e.g.
+ grpc.compression.Gzip. This is an EXPERIMENTAL option.
+
+ Returns:
+ A UnaryStreamCall object.
+
+ Raises:
+ RpcError: Indicates that the RPC terminated with non-OK status. The
+ raised RpcError will also be a Call for the RPC affording the RPC's
+ metadata, status code, and details.
+ """
+
+
+class StreamUnaryMultiCallable(abc.ABC):
+ """Enables asynchronous invocation of a client-streaming RPC."""
+
+ @abc.abstractmethod
+ def __call__(self,
+ request_iterator: Optional[RequestIterableType] = None,
+ timeout: Optional[float] = None,
+ metadata: Optional[Metadata] = None,
+ credentials: Optional[grpc.CallCredentials] = None,
+ wait_for_ready: Optional[bool] = None,
+ compression: Optional[grpc.Compression] = None
+ ) -> _base_call.StreamUnaryCall:
+ """Asynchronously invokes the underlying RPC.
+
+ Args:
+ request_iterator: An optional async iterable or iterable of request
+ messages for the RPC.
+ timeout: An optional duration of time in seconds to allow
+ for the RPC.
+ metadata: Optional :term:`metadata` to be transmitted to the
+ service-side of the RPC.
+ credentials: An optional CallCredentials for the RPC. Only valid for
+ secure Channel.
+ wait_for_ready: This is an EXPERIMENTAL argument. An optional
+ flag to enable :term:`wait_for_ready` mechanism.
+ compression: An element of grpc.compression, e.g.
+ grpc.compression.Gzip. This is an EXPERIMENTAL option.
+
+ Returns:
+ A StreamUnaryCall object.
+
+ Raises:
+ RpcError: Indicates that the RPC terminated with non-OK status. The
+ raised RpcError will also be a Call for the RPC affording the RPC's
+ metadata, status code, and details.
+ """
+
+
+class StreamStreamMultiCallable(abc.ABC):
+ """Enables asynchronous invocation of a bidirectional-streaming RPC."""
+
+ @abc.abstractmethod
+ def __call__(self,
+ request_iterator: Optional[RequestIterableType] = None,
+ timeout: Optional[float] = None,
+ metadata: Optional[Metadata] = None,
+ credentials: Optional[grpc.CallCredentials] = None,
+ wait_for_ready: Optional[bool] = None,
+ compression: Optional[grpc.Compression] = None
+ ) -> _base_call.StreamStreamCall:
+ """Asynchronously invokes the underlying RPC.
+
+ Args:
+ request_iterator: An optional async iterable or iterable of request
+ messages for the RPC.
+ timeout: An optional duration of time in seconds to allow
+ for the RPC.
+ metadata: Optional :term:`metadata` to be transmitted to the
+ service-side of the RPC.
+ credentials: An optional CallCredentials for the RPC. Only valid for
+ secure Channel.
+ wait_for_ready: This is an EXPERIMENTAL argument. An optional
+ flag to enable :term:`wait_for_ready` mechanism.
+ compression: An element of grpc.compression, e.g.
+ grpc.compression.Gzip. This is an EXPERIMENTAL option.
+
+ Returns:
+ A StreamStreamCall object.
+
+ Raises:
+ RpcError: Indicates that the RPC terminated with non-OK status. The
+ raised RpcError will also be a Call for the RPC affording the RPC's
+ metadata, status code, and details.
+ """
+
+
+class Channel(abc.ABC):
+ """Enables asynchronous RPC invocation as a client.
+
+ Channel objects implement the Asynchronous Context Manager (aka. async
+ with) type, although they are not supportted to be entered and exited
+ multiple times.
+ """
+
+ @abc.abstractmethod
+ async def __aenter__(self):
+ """Starts an asynchronous context manager.
+
+ Returns:
+ Channel the channel that was instantiated.
+ """
+
+ @abc.abstractmethod
+ async def __aexit__(self, exc_type, exc_val, exc_tb):
+ """Finishes the asynchronous context manager by closing the channel.
+
+ Still active RPCs will be cancelled.
+ """
+
+ @abc.abstractmethod
+ async def close(self, grace: Optional[float] = None):
+ """Closes this Channel and releases all resources held by it.
+
+ This method immediately stops the channel from executing new RPCs in
+ all cases.
+
+ If a grace period is specified, this method wait until all active
+ RPCs are finshed, once the grace period is reached the ones that haven't
+ been terminated are cancelled. If a grace period is not specified
+ (by passing None for grace), all existing RPCs are cancelled immediately.
+
+ This method is idempotent.
+ """
+
+ @abc.abstractmethod
+ def get_state(self,
+ try_to_connect: bool = False) -> grpc.ChannelConnectivity:
+ """Checks the connectivity state of a channel.
+
+ This is an EXPERIMENTAL API.
+
+ If the channel reaches a stable connectivity state, it is guaranteed
+ that the return value of this function will eventually converge to that
+ state.
+
+ Args:
+ try_to_connect: a bool indicate whether the Channel should try to
+ connect to peer or not.
+
+ Returns: A ChannelConnectivity object.
+ """
+
+ @abc.abstractmethod
+ async def wait_for_state_change(
+ self,
+ last_observed_state: grpc.ChannelConnectivity,
+ ) -> None:
+ """Waits for a change in connectivity state.
+
+ This is an EXPERIMENTAL API.
+
+ The function blocks until there is a change in the channel connectivity
+ state from the "last_observed_state". If the state is already
+ different, this function will return immediately.
+
+ There is an inherent race between the invocation of
+ "Channel.wait_for_state_change" and "Channel.get_state". The state can
+ change arbitrary many times during the race, so there is no way to
+ observe every state transition.
+
+ If there is a need to put a timeout for this function, please refer to
+ "asyncio.wait_for".
+
+ Args:
+ last_observed_state: A grpc.ChannelConnectivity object representing
+ the last known state.
+ """
+
+ @abc.abstractmethod
+ async def channel_ready(self) -> None:
+ """Creates a coroutine that blocks until the Channel is READY."""
+
+ @abc.abstractmethod
+ def unary_unary(
+ self,
+ method: str,
+ request_serializer: Optional[SerializingFunction] = None,
+ response_deserializer: Optional[DeserializingFunction] = None
+ ) -> UnaryUnaryMultiCallable:
+ """Creates a UnaryUnaryMultiCallable for a unary-unary method.
+
+ Args:
+ method: The name of the RPC method.
+ request_serializer: Optional :term:`serializer` for serializing the request
+ message. Request goes unserialized in case None is passed.
+ response_deserializer: Optional :term:`deserializer` for deserializing the
+ response message. Response goes undeserialized in case None
+ is passed.
+
+ Returns:
+ A UnaryUnaryMultiCallable value for the named unary-unary method.
+ """
+
+ @abc.abstractmethod
+ def unary_stream(
+ self,
+ method: str,
+ request_serializer: Optional[SerializingFunction] = None,
+ response_deserializer: Optional[DeserializingFunction] = None
+ ) -> UnaryStreamMultiCallable:
+ """Creates a UnaryStreamMultiCallable for a unary-stream method.
+
+ Args:
+ method: The name of the RPC method.
+ request_serializer: Optional :term:`serializer` for serializing the request
+ message. Request goes unserialized in case None is passed.
+ response_deserializer: Optional :term:`deserializer` for deserializing the
+ response message. Response goes undeserialized in case None
+ is passed.
+
+ Returns:
+ A UnarySteramMultiCallable value for the named unary-stream method.
+ """
+
+ @abc.abstractmethod
+ def stream_unary(
+ self,
+ method: str,
+ request_serializer: Optional[SerializingFunction] = None,
+ response_deserializer: Optional[DeserializingFunction] = None
+ ) -> StreamUnaryMultiCallable:
+ """Creates a StreamUnaryMultiCallable for a stream-unary method.
+
+ Args:
+ method: The name of the RPC method.
+ request_serializer: Optional :term:`serializer` for serializing the request
+ message. Request goes unserialized in case None is passed.
+ response_deserializer: Optional :term:`deserializer` for deserializing the
+ response message. Response goes undeserialized in case None
+ is passed.
+
+ Returns:
+ A StreamUnaryMultiCallable value for the named stream-unary method.
+ """
+
+ @abc.abstractmethod
+ def stream_stream(
+ self,
+ method: str,
+ request_serializer: Optional[SerializingFunction] = None,
+ response_deserializer: Optional[DeserializingFunction] = None
+ ) -> StreamStreamMultiCallable:
+ """Creates a StreamStreamMultiCallable for a stream-stream method.
+
+ Args:
+ method: The name of the RPC method.
+ request_serializer: Optional :term:`serializer` for serializing the request
+ message. Request goes unserialized in case None is passed.
+ response_deserializer: Optional :term:`deserializer` for deserializing the
+ response message. Response goes undeserialized in case None
+ is passed.
+
+ Returns:
+ A StreamStreamMultiCallable value for the named stream-stream method.
+ """
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/aio/_base_server.py b/contrib/libs/grpc/src/python/grpcio/grpc/aio/_base_server.py
index 69ec5075aba..926c8651714 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/aio/_base_server.py
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/aio/_base_server.py
@@ -1,294 +1,294 @@
-# Copyright 2020 The gRPC Authors
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-"""Abstract base classes for server-side classes."""
-
-import abc
-from typing import Generic, Mapping, Optional, Iterable, Sequence
-
-import grpc
-
-from ._typing import RequestType, ResponseType
-from ._metadata import Metadata
-
-
-class Server(abc.ABC):
- """Serves RPCs."""
-
- @abc.abstractmethod
- def add_generic_rpc_handlers(
- self,
- generic_rpc_handlers: Sequence[grpc.GenericRpcHandler]) -> None:
- """Registers GenericRpcHandlers with this Server.
-
- This method is only safe to call before the server is started.
-
- Args:
- generic_rpc_handlers: A sequence of GenericRpcHandlers that will be
- used to service RPCs.
- """
-
- @abc.abstractmethod
- def add_insecure_port(self, address: str) -> int:
- """Opens an insecure port for accepting RPCs.
-
- A port is a communication endpoint that used by networking protocols,
- like TCP and UDP. To date, we only support TCP.
-
- This method may only be called before starting the server.
-
- Args:
- address: The address for which to open a port. If the port is 0,
- or not specified in the address, then the gRPC runtime will choose a port.
-
- Returns:
- An integer port on which the server will accept RPC requests.
- """
-
- @abc.abstractmethod
- def add_secure_port(self, address: str,
- server_credentials: grpc.ServerCredentials) -> int:
- """Opens a secure port for accepting RPCs.
-
- A port is a communication endpoint that used by networking protocols,
- like TCP and UDP. To date, we only support TCP.
-
- This method may only be called before starting the server.
-
- Args:
- address: The address for which to open a port.
- if the port is 0, or not specified in the address, then the gRPC
- runtime will choose a port.
- server_credentials: A ServerCredentials object.
-
- Returns:
- An integer port on which the server will accept RPC requests.
- """
-
- @abc.abstractmethod
- async def start(self) -> None:
- """Starts this Server.
-
- This method may only be called once. (i.e. it is not idempotent).
- """
-
- @abc.abstractmethod
- async def stop(self, grace: Optional[float]) -> None:
- """Stops this Server.
-
- This method immediately stops the server from servicing new RPCs in
- all cases.
-
- If a grace period is specified, this method returns immediately and all
- RPCs active at the end of the grace period are aborted. If a grace
- period is not specified (by passing None for grace), all existing RPCs
- are aborted immediately and this method blocks until the last RPC
- handler terminates.
-
- This method is idempotent and may be called at any time. Passing a
- smaller grace value in a subsequent call will have the effect of
- stopping the Server sooner (passing None will have the effect of
- stopping the server immediately). Passing a larger grace value in a
- subsequent call will not have the effect of stopping the server later
- (i.e. the most restrictive grace value is used).
-
- Args:
- grace: A duration of time in seconds or None.
- """
-
- @abc.abstractmethod
- async def wait_for_termination(self,
- timeout: Optional[float] = None) -> bool:
- """Continues current coroutine once the server stops.
-
- This is an EXPERIMENTAL API.
-
- The wait will not consume computational resources during blocking, and
- it will block until one of the two following conditions are met:
-
- 1) The server is stopped or terminated;
- 2) A timeout occurs if timeout is not `None`.
-
- The timeout argument works in the same way as `threading.Event.wait()`.
- https://docs.python.org/3/library/threading.html#threading.Event.wait
-
- Args:
- timeout: A floating point number specifying a timeout for the
- operation in seconds.
-
- Returns:
- A bool indicates if the operation times out.
- """
-
-
-class ServicerContext(Generic[RequestType, ResponseType], abc.ABC):
- """A context object passed to method implementations."""
-
- @abc.abstractmethod
- async def read(self) -> RequestType:
- """Reads one message from the RPC.
-
- Only one read operation is allowed simultaneously.
-
- Returns:
- A response message of the RPC.
-
- Raises:
- An RpcError exception if the read failed.
- """
-
- @abc.abstractmethod
- async def write(self, message: ResponseType) -> None:
- """Writes one message to the RPC.
-
- Only one write operation is allowed simultaneously.
-
- Raises:
- An RpcError exception if the write failed.
- """
-
- @abc.abstractmethod
- async def send_initial_metadata(self, initial_metadata: Metadata) -> None:
- """Sends the initial metadata value to the client.
-
- This method need not be called by implementations if they have no
- metadata to add to what the gRPC runtime will transmit.
-
- Args:
- initial_metadata: The initial :term:`metadata`.
- """
-
- @abc.abstractmethod
- async def abort(self, code: grpc.StatusCode, details: str,
- trailing_metadata: Metadata) -> None:
- """Raises an exception to terminate the RPC with a non-OK status.
-
- The code and details passed as arguments will supercede any existing
- ones.
-
- Args:
- code: A StatusCode object to be sent to the client.
- It must not be StatusCode.OK.
- details: A UTF-8-encodable string to be sent to the client upon
- termination of the RPC.
- trailing_metadata: A sequence of tuple represents the trailing
- :term:`metadata`.
-
- Raises:
- Exception: An exception is always raised to signal the abortion the
- RPC to the gRPC runtime.
- """
-
- @abc.abstractmethod
- async def set_trailing_metadata(self, trailing_metadata: Metadata) -> None:
- """Sends the trailing metadata for the RPC.
-
- This method need not be called by implementations if they have no
- metadata to add to what the gRPC runtime will transmit.
-
- Args:
- trailing_metadata: The trailing :term:`metadata`.
- """
-
- @abc.abstractmethod
- def invocation_metadata(self) -> Optional[Metadata]:
- """Accesses the metadata from the sent by the client.
-
- Returns:
- The invocation :term:`metadata`.
- """
-
- @abc.abstractmethod
- def set_code(self, code: grpc.StatusCode) -> None:
- """Sets the value to be used as status code upon RPC completion.
-
- This method need not be called by method implementations if they wish
- the gRPC runtime to determine the status code of the RPC.
-
- Args:
- code: A StatusCode object to be sent to the client.
- """
-
- @abc.abstractmethod
- def set_details(self, details: str) -> None:
- """Sets the value to be used the as detail string upon RPC completion.
-
- This method need not be called by method implementations if they have
- no details to transmit.
-
- Args:
- details: A UTF-8-encodable string to be sent to the client upon
- termination of the RPC.
- """
-
- @abc.abstractmethod
- def set_compression(self, compression: grpc.Compression) -> None:
- """Set the compression algorithm to be used for the entire call.
-
- This is an EXPERIMENTAL method.
-
- Args:
- compression: An element of grpc.compression, e.g.
- grpc.compression.Gzip.
- """
-
- @abc.abstractmethod
- def disable_next_message_compression(self) -> None:
- """Disables compression for the next response message.
-
- This is an EXPERIMENTAL method.
-
- This method will override any compression configuration set during
- server creation or set on the call.
- """
-
- @abc.abstractmethod
- def peer(self) -> str:
- """Identifies the peer that invoked the RPC being serviced.
-
- Returns:
- A string identifying the peer that invoked the RPC being serviced.
- The string format is determined by gRPC runtime.
- """
-
- @abc.abstractmethod
- def peer_identities(self) -> Optional[Iterable[bytes]]:
- """Gets one or more peer identity(s).
-
- Equivalent to
- servicer_context.auth_context().get(servicer_context.peer_identity_key())
-
- Returns:
- An iterable of the identities, or None if the call is not
- authenticated. Each identity is returned as a raw bytes type.
- """
-
- @abc.abstractmethod
- def peer_identity_key(self) -> Optional[str]:
- """The auth property used to identify the peer.
-
- For example, "x509_common_name" or "x509_subject_alternative_name" are
- used to identify an SSL peer.
-
- Returns:
- The auth property (string) that indicates the
- peer identity, or None if the call is not authenticated.
- """
-
- @abc.abstractmethod
- def auth_context(self) -> Mapping[str, Iterable[bytes]]:
- """Gets the auth context for the call.
-
- Returns:
- A map of strings to an iterable of bytes for each auth property.
- """
+# Copyright 2020 The gRPC Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+"""Abstract base classes for server-side classes."""
+
+import abc
+from typing import Generic, Mapping, Optional, Iterable, Sequence
+
+import grpc
+
+from ._typing import RequestType, ResponseType
+from ._metadata import Metadata
+
+
+class Server(abc.ABC):
+ """Serves RPCs."""
+
+ @abc.abstractmethod
+ def add_generic_rpc_handlers(
+ self,
+ generic_rpc_handlers: Sequence[grpc.GenericRpcHandler]) -> None:
+ """Registers GenericRpcHandlers with this Server.
+
+ This method is only safe to call before the server is started.
+
+ Args:
+ generic_rpc_handlers: A sequence of GenericRpcHandlers that will be
+ used to service RPCs.
+ """
+
+ @abc.abstractmethod
+ def add_insecure_port(self, address: str) -> int:
+ """Opens an insecure port for accepting RPCs.
+
+ A port is a communication endpoint that used by networking protocols,
+ like TCP and UDP. To date, we only support TCP.
+
+ This method may only be called before starting the server.
+
+ Args:
+ address: The address for which to open a port. If the port is 0,
+ or not specified in the address, then the gRPC runtime will choose a port.
+
+ Returns:
+ An integer port on which the server will accept RPC requests.
+ """
+
+ @abc.abstractmethod
+ def add_secure_port(self, address: str,
+ server_credentials: grpc.ServerCredentials) -> int:
+ """Opens a secure port for accepting RPCs.
+
+ A port is a communication endpoint that used by networking protocols,
+ like TCP and UDP. To date, we only support TCP.
+
+ This method may only be called before starting the server.
+
+ Args:
+ address: The address for which to open a port.
+ if the port is 0, or not specified in the address, then the gRPC
+ runtime will choose a port.
+ server_credentials: A ServerCredentials object.
+
+ Returns:
+ An integer port on which the server will accept RPC requests.
+ """
+
+ @abc.abstractmethod
+ async def start(self) -> None:
+ """Starts this Server.
+
+ This method may only be called once. (i.e. it is not idempotent).
+ """
+
+ @abc.abstractmethod
+ async def stop(self, grace: Optional[float]) -> None:
+ """Stops this Server.
+
+ This method immediately stops the server from servicing new RPCs in
+ all cases.
+
+ If a grace period is specified, this method returns immediately and all
+ RPCs active at the end of the grace period are aborted. If a grace
+ period is not specified (by passing None for grace), all existing RPCs
+ are aborted immediately and this method blocks until the last RPC
+ handler terminates.
+
+ This method is idempotent and may be called at any time. Passing a
+ smaller grace value in a subsequent call will have the effect of
+ stopping the Server sooner (passing None will have the effect of
+ stopping the server immediately). Passing a larger grace value in a
+ subsequent call will not have the effect of stopping the server later
+ (i.e. the most restrictive grace value is used).
+
+ Args:
+ grace: A duration of time in seconds or None.
+ """
+
+ @abc.abstractmethod
+ async def wait_for_termination(self,
+ timeout: Optional[float] = None) -> bool:
+ """Continues current coroutine once the server stops.
+
+ This is an EXPERIMENTAL API.
+
+ The wait will not consume computational resources during blocking, and
+ it will block until one of the two following conditions are met:
+
+ 1) The server is stopped or terminated;
+ 2) A timeout occurs if timeout is not `None`.
+
+ The timeout argument works in the same way as `threading.Event.wait()`.
+ https://docs.python.org/3/library/threading.html#threading.Event.wait
+
+ Args:
+ timeout: A floating point number specifying a timeout for the
+ operation in seconds.
+
+ Returns:
+ A bool indicates if the operation times out.
+ """
+
+
+class ServicerContext(Generic[RequestType, ResponseType], abc.ABC):
+ """A context object passed to method implementations."""
+
+ @abc.abstractmethod
+ async def read(self) -> RequestType:
+ """Reads one message from the RPC.
+
+ Only one read operation is allowed simultaneously.
+
+ Returns:
+ A response message of the RPC.
+
+ Raises:
+ An RpcError exception if the read failed.
+ """
+
+ @abc.abstractmethod
+ async def write(self, message: ResponseType) -> None:
+ """Writes one message to the RPC.
+
+ Only one write operation is allowed simultaneously.
+
+ Raises:
+ An RpcError exception if the write failed.
+ """
+
+ @abc.abstractmethod
+ async def send_initial_metadata(self, initial_metadata: Metadata) -> None:
+ """Sends the initial metadata value to the client.
+
+ This method need not be called by implementations if they have no
+ metadata to add to what the gRPC runtime will transmit.
+
+ Args:
+ initial_metadata: The initial :term:`metadata`.
+ """
+
+ @abc.abstractmethod
+ async def abort(self, code: grpc.StatusCode, details: str,
+ trailing_metadata: Metadata) -> None:
+ """Raises an exception to terminate the RPC with a non-OK status.
+
+ The code and details passed as arguments will supercede any existing
+ ones.
+
+ Args:
+ code: A StatusCode object to be sent to the client.
+ It must not be StatusCode.OK.
+ details: A UTF-8-encodable string to be sent to the client upon
+ termination of the RPC.
+ trailing_metadata: A sequence of tuple represents the trailing
+ :term:`metadata`.
+
+ Raises:
+ Exception: An exception is always raised to signal the abortion the
+ RPC to the gRPC runtime.
+ """
+
+ @abc.abstractmethod
+ async def set_trailing_metadata(self, trailing_metadata: Metadata) -> None:
+ """Sends the trailing metadata for the RPC.
+
+ This method need not be called by implementations if they have no
+ metadata to add to what the gRPC runtime will transmit.
+
+ Args:
+ trailing_metadata: The trailing :term:`metadata`.
+ """
+
+ @abc.abstractmethod
+ def invocation_metadata(self) -> Optional[Metadata]:
+ """Accesses the metadata from the sent by the client.
+
+ Returns:
+ The invocation :term:`metadata`.
+ """
+
+ @abc.abstractmethod
+ def set_code(self, code: grpc.StatusCode) -> None:
+ """Sets the value to be used as status code upon RPC completion.
+
+ This method need not be called by method implementations if they wish
+ the gRPC runtime to determine the status code of the RPC.
+
+ Args:
+ code: A StatusCode object to be sent to the client.
+ """
+
+ @abc.abstractmethod
+ def set_details(self, details: str) -> None:
+ """Sets the value to be used the as detail string upon RPC completion.
+
+ This method need not be called by method implementations if they have
+ no details to transmit.
+
+ Args:
+ details: A UTF-8-encodable string to be sent to the client upon
+ termination of the RPC.
+ """
+
+ @abc.abstractmethod
+ def set_compression(self, compression: grpc.Compression) -> None:
+ """Set the compression algorithm to be used for the entire call.
+
+ This is an EXPERIMENTAL method.
+
+ Args:
+ compression: An element of grpc.compression, e.g.
+ grpc.compression.Gzip.
+ """
+
+ @abc.abstractmethod
+ def disable_next_message_compression(self) -> None:
+ """Disables compression for the next response message.
+
+ This is an EXPERIMENTAL method.
+
+ This method will override any compression configuration set during
+ server creation or set on the call.
+ """
+
+ @abc.abstractmethod
+ def peer(self) -> str:
+ """Identifies the peer that invoked the RPC being serviced.
+
+ Returns:
+ A string identifying the peer that invoked the RPC being serviced.
+ The string format is determined by gRPC runtime.
+ """
+
+ @abc.abstractmethod
+ def peer_identities(self) -> Optional[Iterable[bytes]]:
+ """Gets one or more peer identity(s).
+
+ Equivalent to
+ servicer_context.auth_context().get(servicer_context.peer_identity_key())
+
+ Returns:
+ An iterable of the identities, or None if the call is not
+ authenticated. Each identity is returned as a raw bytes type.
+ """
+
+ @abc.abstractmethod
+ def peer_identity_key(self) -> Optional[str]:
+ """The auth property used to identify the peer.
+
+ For example, "x509_common_name" or "x509_subject_alternative_name" are
+ used to identify an SSL peer.
+
+ Returns:
+ The auth property (string) that indicates the
+ peer identity, or None if the call is not authenticated.
+ """
+
+ @abc.abstractmethod
+ def auth_context(self) -> Mapping[str, Iterable[bytes]]:
+ """Gets the auth context for the call.
+
+ Returns:
+ A map of strings to an iterable of bytes for each auth property.
+ """
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/aio/_call.py b/contrib/libs/grpc/src/python/grpcio/grpc/aio/_call.py
index 975f7c55a13..ba229f35c39 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/aio/_call.py
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/aio/_call.py
@@ -1,629 +1,629 @@
-# Copyright 2019 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-"""Invocation-side implementation of gRPC Asyncio Python."""
-
-import asyncio
-import enum
-import inspect
-import logging
-from functools import partial
-from typing import AsyncIterable, Optional, Tuple
-
-import grpc
-from grpc import _common
-from grpc._cython import cygrpc
-
-from . import _base_call
-from ._metadata import Metadata
-from ._typing import (DeserializingFunction, DoneCallbackType, MetadatumType,
- RequestIterableType, RequestType, ResponseType,
- SerializingFunction)
-
-__all__ = 'AioRpcError', 'Call', 'UnaryUnaryCall', 'UnaryStreamCall'
-
-_LOCAL_CANCELLATION_DETAILS = 'Locally cancelled by application!'
-_GC_CANCELLATION_DETAILS = 'Cancelled upon garbage collection!'
-_RPC_ALREADY_FINISHED_DETAILS = 'RPC already finished.'
-_RPC_HALF_CLOSED_DETAILS = 'RPC is half closed after calling "done_writing".'
-_API_STYLE_ERROR = 'The iterator and read/write APIs may not be mixed on a single RPC.'
-
-_OK_CALL_REPRESENTATION = ('<{} of RPC that terminated with:\n'
- '\tstatus = {}\n'
- '\tdetails = "{}"\n'
- '>')
-
-_NON_OK_CALL_REPRESENTATION = ('<{} of RPC that terminated with:\n'
- '\tstatus = {}\n'
- '\tdetails = "{}"\n'
- '\tdebug_error_string = "{}"\n'
- '>')
-
-_LOGGER = logging.getLogger(__name__)
-
-
-class AioRpcError(grpc.RpcError):
- """An implementation of RpcError to be used by the asynchronous API.
-
- Raised RpcError is a snapshot of the final status of the RPC, values are
- determined. Hence, its methods no longer needs to be coroutines.
- """
-
- _code: grpc.StatusCode
- _details: Optional[str]
- _initial_metadata: Optional[Metadata]
- _trailing_metadata: Optional[Metadata]
- _debug_error_string: Optional[str]
-
- def __init__(self,
- code: grpc.StatusCode,
- initial_metadata: Metadata,
- trailing_metadata: Metadata,
- details: Optional[str] = None,
- debug_error_string: Optional[str] = None) -> None:
- """Constructor.
-
- Args:
- code: The status code with which the RPC has been finalized.
- details: Optional details explaining the reason of the error.
- initial_metadata: Optional initial metadata that could be sent by the
- Server.
- trailing_metadata: Optional metadata that could be sent by the Server.
- """
-
- super().__init__(self)
- self._code = code
- self._details = details
- self._initial_metadata = initial_metadata
- self._trailing_metadata = trailing_metadata
- self._debug_error_string = debug_error_string
-
- def code(self) -> grpc.StatusCode:
- """Accesses the status code sent by the server.
-
- Returns:
- The `grpc.StatusCode` status code.
- """
- return self._code
-
- def details(self) -> Optional[str]:
- """Accesses the details sent by the server.
-
- Returns:
- The description of the error.
- """
- return self._details
-
- def initial_metadata(self) -> Metadata:
- """Accesses the initial metadata sent by the server.
-
- Returns:
- The initial metadata received.
- """
- return self._initial_metadata
-
- def trailing_metadata(self) -> Metadata:
- """Accesses the trailing metadata sent by the server.
-
- Returns:
- The trailing metadata received.
- """
- return self._trailing_metadata
-
- def debug_error_string(self) -> str:
- """Accesses the debug error string sent by the server.
-
- Returns:
- The debug error string received.
- """
- return self._debug_error_string
-
- def _repr(self) -> str:
- """Assembles the error string for the RPC error."""
- return _NON_OK_CALL_REPRESENTATION.format(self.__class__.__name__,
- self._code, self._details,
- self._debug_error_string)
-
- def __repr__(self) -> str:
- return self._repr()
-
- def __str__(self) -> str:
- return self._repr()
-
-
-def _create_rpc_error(initial_metadata: Metadata,
- status: cygrpc.AioRpcStatus) -> AioRpcError:
- return AioRpcError(
- _common.CYGRPC_STATUS_CODE_TO_STATUS_CODE[status.code()],
- Metadata.from_tuple(initial_metadata),
- Metadata.from_tuple(status.trailing_metadata()),
- details=status.details(),
- debug_error_string=status.debug_error_string(),
- )
-
-
-class Call:
- """Base implementation of client RPC Call object.
-
- Implements logic around final status, metadata and cancellation.
- """
- _loop: asyncio.AbstractEventLoop
- _code: grpc.StatusCode
- _cython_call: cygrpc._AioCall
- _metadata: Tuple[MetadatumType]
- _request_serializer: SerializingFunction
- _response_deserializer: DeserializingFunction
-
- def __init__(self, cython_call: cygrpc._AioCall, metadata: Metadata,
- request_serializer: SerializingFunction,
- response_deserializer: DeserializingFunction,
- loop: asyncio.AbstractEventLoop) -> None:
- self._loop = loop
- self._cython_call = cython_call
- self._metadata = tuple(metadata)
- self._request_serializer = request_serializer
- self._response_deserializer = response_deserializer
-
- def __del__(self) -> None:
- # The '_cython_call' object might be destructed before Call object
- if hasattr(self, '_cython_call'):
- if not self._cython_call.done():
- self._cancel(_GC_CANCELLATION_DETAILS)
-
- def cancelled(self) -> bool:
- return self._cython_call.cancelled()
-
- def _cancel(self, details: str) -> bool:
- """Forwards the application cancellation reasoning."""
- if not self._cython_call.done():
- self._cython_call.cancel(details)
- return True
- else:
- return False
-
- def cancel(self) -> bool:
- return self._cancel(_LOCAL_CANCELLATION_DETAILS)
-
- def done(self) -> bool:
- return self._cython_call.done()
-
- def add_done_callback(self, callback: DoneCallbackType) -> None:
- cb = partial(callback, self)
- self._cython_call.add_done_callback(cb)
-
- def time_remaining(self) -> Optional[float]:
- return self._cython_call.time_remaining()
-
- async def initial_metadata(self) -> Metadata:
- raw_metadata_tuple = await self._cython_call.initial_metadata()
- return Metadata.from_tuple(raw_metadata_tuple)
-
- async def trailing_metadata(self) -> Metadata:
- raw_metadata_tuple = (await
- self._cython_call.status()).trailing_metadata()
- return Metadata.from_tuple(raw_metadata_tuple)
-
- async def code(self) -> grpc.StatusCode:
- cygrpc_code = (await self._cython_call.status()).code()
- return _common.CYGRPC_STATUS_CODE_TO_STATUS_CODE[cygrpc_code]
-
- async def details(self) -> str:
- return (await self._cython_call.status()).details()
-
- async def debug_error_string(self) -> str:
- return (await self._cython_call.status()).debug_error_string()
-
- async def _raise_for_status(self) -> None:
- if self._cython_call.is_locally_cancelled():
- raise asyncio.CancelledError()
- code = await self.code()
- if code != grpc.StatusCode.OK:
- raise _create_rpc_error(await self.initial_metadata(), await
- self._cython_call.status())
-
- def _repr(self) -> str:
- return repr(self._cython_call)
-
- def __repr__(self) -> str:
- return self._repr()
-
- def __str__(self) -> str:
- return self._repr()
-
-
-class _APIStyle(enum.IntEnum):
- UNKNOWN = 0
- ASYNC_GENERATOR = 1
- READER_WRITER = 2
-
-
-class _UnaryResponseMixin(Call):
- _call_response: asyncio.Task
-
- def _init_unary_response_mixin(self, response_task: asyncio.Task):
- self._call_response = response_task
-
- def cancel(self) -> bool:
- if super().cancel():
- self._call_response.cancel()
- return True
- else:
- return False
-
- def __await__(self) -> ResponseType:
- """Wait till the ongoing RPC request finishes."""
- try:
- response = yield from self._call_response
- except asyncio.CancelledError:
- # Even if we caught all other CancelledError, there is still
- # this corner case. If the application cancels immediately after
- # the Call object is created, we will observe this
- # `CancelledError`.
- if not self.cancelled():
- self.cancel()
- raise
-
- # NOTE(lidiz) If we raise RpcError in the task, and users doesn't
- # 'await' on it. AsyncIO will log 'Task exception was never retrieved'.
- # Instead, if we move the exception raising here, the spam stops.
- # Unfortunately, there can only be one 'yield from' in '__await__'. So,
- # we need to access the private instance variable.
- if response is cygrpc.EOF:
- if self._cython_call.is_locally_cancelled():
- raise asyncio.CancelledError()
- else:
- raise _create_rpc_error(self._cython_call._initial_metadata,
- self._cython_call._status)
- else:
- return response
-
-
-class _StreamResponseMixin(Call):
- _message_aiter: AsyncIterable[ResponseType]
- _preparation: asyncio.Task
- _response_style: _APIStyle
-
- def _init_stream_response_mixin(self, preparation: asyncio.Task):
- self._message_aiter = None
- self._preparation = preparation
- self._response_style = _APIStyle.UNKNOWN
-
- def _update_response_style(self, style: _APIStyle):
- if self._response_style is _APIStyle.UNKNOWN:
- self._response_style = style
- elif self._response_style is not style:
- raise cygrpc.UsageError(_API_STYLE_ERROR)
-
- def cancel(self) -> bool:
- if super().cancel():
- self._preparation.cancel()
- return True
- else:
- return False
-
- async def _fetch_stream_responses(self) -> ResponseType:
- message = await self._read()
- while message is not cygrpc.EOF:
- yield message
- message = await self._read()
-
- # If the read operation failed, Core should explain why.
- await self._raise_for_status()
-
- def __aiter__(self) -> AsyncIterable[ResponseType]:
- self._update_response_style(_APIStyle.ASYNC_GENERATOR)
- if self._message_aiter is None:
- self._message_aiter = self._fetch_stream_responses()
- return self._message_aiter
-
- async def _read(self) -> ResponseType:
- # Wait for the request being sent
- await self._preparation
-
- # Reads response message from Core
- try:
- raw_response = await self._cython_call.receive_serialized_message()
- except asyncio.CancelledError:
- if not self.cancelled():
- self.cancel()
- await self._raise_for_status()
-
- if raw_response is cygrpc.EOF:
- return cygrpc.EOF
- else:
- return _common.deserialize(raw_response,
- self._response_deserializer)
-
- async def read(self) -> ResponseType:
- if self.done():
- await self._raise_for_status()
- return cygrpc.EOF
- self._update_response_style(_APIStyle.READER_WRITER)
-
- response_message = await self._read()
-
- if response_message is cygrpc.EOF:
- # If the read operation failed, Core should explain why.
- await self._raise_for_status()
- return response_message
-
-
-class _StreamRequestMixin(Call):
- _metadata_sent: asyncio.Event
- _done_writing_flag: bool
- _async_request_poller: Optional[asyncio.Task]
- _request_style: _APIStyle
-
- def _init_stream_request_mixin(
- self, request_iterator: Optional[RequestIterableType]):
- self._metadata_sent = asyncio.Event(loop=self._loop)
- self._done_writing_flag = False
-
- # If user passes in an async iterator, create a consumer Task.
- if request_iterator is not None:
- self._async_request_poller = self._loop.create_task(
- self._consume_request_iterator(request_iterator))
- self._request_style = _APIStyle.ASYNC_GENERATOR
- else:
- self._async_request_poller = None
- self._request_style = _APIStyle.READER_WRITER
-
- def _raise_for_different_style(self, style: _APIStyle):
- if self._request_style is not style:
- raise cygrpc.UsageError(_API_STYLE_ERROR)
-
- def cancel(self) -> bool:
- if super().cancel():
- if self._async_request_poller is not None:
- self._async_request_poller.cancel()
- return True
- else:
- return False
-
- def _metadata_sent_observer(self):
- self._metadata_sent.set()
-
- async def _consume_request_iterator(self,
- request_iterator: RequestIterableType
- ) -> None:
- try:
- if inspect.isasyncgen(request_iterator) or hasattr(
- request_iterator, '__aiter__'):
- async for request in request_iterator:
- await self._write(request)
- else:
- for request in request_iterator:
- await self._write(request)
-
- await self._done_writing()
- except AioRpcError as rpc_error:
- # Rpc status should be exposed through other API. Exceptions raised
- # within this Task won't be retrieved by another coroutine. It's
- # better to suppress the error than spamming users' screen.
- _LOGGER.debug('Exception while consuming the request_iterator: %s',
- rpc_error)
-
- async def _write(self, request: RequestType) -> None:
- if self.done():
- raise asyncio.InvalidStateError(_RPC_ALREADY_FINISHED_DETAILS)
- if self._done_writing_flag:
- raise asyncio.InvalidStateError(_RPC_HALF_CLOSED_DETAILS)
- if not self._metadata_sent.is_set():
- await self._metadata_sent.wait()
- if self.done():
- await self._raise_for_status()
-
- serialized_request = _common.serialize(request,
- self._request_serializer)
- try:
- await self._cython_call.send_serialized_message(serialized_request)
- except asyncio.CancelledError:
- if not self.cancelled():
- self.cancel()
- await self._raise_for_status()
-
- async def _done_writing(self) -> None:
- if self.done():
- # If the RPC is finished, do nothing.
- return
- if not self._done_writing_flag:
- # If the done writing is not sent before, try to send it.
- self._done_writing_flag = True
- try:
- await self._cython_call.send_receive_close()
- except asyncio.CancelledError:
- if not self.cancelled():
- self.cancel()
- await self._raise_for_status()
-
- async def write(self, request: RequestType) -> None:
- self._raise_for_different_style(_APIStyle.READER_WRITER)
- await self._write(request)
-
- async def done_writing(self) -> None:
- """Signal peer that client is done writing.
-
- This method is idempotent.
- """
- self._raise_for_different_style(_APIStyle.READER_WRITER)
- await self._done_writing()
-
- async def wait_for_connection(self) -> None:
- await self._metadata_sent.wait()
- if self.done():
- await self._raise_for_status()
-
-
-class UnaryUnaryCall(_UnaryResponseMixin, Call, _base_call.UnaryUnaryCall):
- """Object for managing unary-unary RPC calls.
-
- Returned when an instance of `UnaryUnaryMultiCallable` object is called.
- """
- _request: RequestType
- _invocation_task: asyncio.Task
-
- # pylint: disable=too-many-arguments
- def __init__(self, request: RequestType, deadline: Optional[float],
- metadata: Metadata,
- credentials: Optional[grpc.CallCredentials],
- wait_for_ready: Optional[bool], channel: cygrpc.AioChannel,
- method: bytes, request_serializer: SerializingFunction,
- response_deserializer: DeserializingFunction,
- loop: asyncio.AbstractEventLoop) -> None:
- super().__init__(
- channel.call(method, deadline, credentials, wait_for_ready),
- metadata, request_serializer, response_deserializer, loop)
- self._request = request
- self._invocation_task = loop.create_task(self._invoke())
- self._init_unary_response_mixin(self._invocation_task)
-
- async def _invoke(self) -> ResponseType:
- serialized_request = _common.serialize(self._request,
- self._request_serializer)
-
- # NOTE(lidiz) asyncio.CancelledError is not a good transport for status,
- # because the asyncio.Task class do not cache the exception object.
- # https://github.com/python/cpython/blob/edad4d89e357c92f70c0324b937845d652b20afd/Lib/asyncio/tasks.py#L785
- try:
- serialized_response = await self._cython_call.unary_unary(
- serialized_request, self._metadata)
- except asyncio.CancelledError:
- if not self.cancelled():
- self.cancel()
-
- if self._cython_call.is_ok():
- return _common.deserialize(serialized_response,
- self._response_deserializer)
- else:
- return cygrpc.EOF
-
- async def wait_for_connection(self) -> None:
- await self._invocation_task
- if self.done():
- await self._raise_for_status()
-
-
-class UnaryStreamCall(_StreamResponseMixin, Call, _base_call.UnaryStreamCall):
- """Object for managing unary-stream RPC calls.
-
- Returned when an instance of `UnaryStreamMultiCallable` object is called.
- """
- _request: RequestType
- _send_unary_request_task: asyncio.Task
-
- # pylint: disable=too-many-arguments
- def __init__(self, request: RequestType, deadline: Optional[float],
- metadata: Metadata,
- credentials: Optional[grpc.CallCredentials],
- wait_for_ready: Optional[bool], channel: cygrpc.AioChannel,
- method: bytes, request_serializer: SerializingFunction,
- response_deserializer: DeserializingFunction,
- loop: asyncio.AbstractEventLoop) -> None:
- super().__init__(
- channel.call(method, deadline, credentials, wait_for_ready),
- metadata, request_serializer, response_deserializer, loop)
- self._request = request
- self._send_unary_request_task = loop.create_task(
- self._send_unary_request())
- self._init_stream_response_mixin(self._send_unary_request_task)
-
- async def _send_unary_request(self) -> ResponseType:
- serialized_request = _common.serialize(self._request,
- self._request_serializer)
- try:
- await self._cython_call.initiate_unary_stream(
- serialized_request, self._metadata)
- except asyncio.CancelledError:
- if not self.cancelled():
- self.cancel()
- raise
-
- async def wait_for_connection(self) -> None:
- await self._send_unary_request_task
- if self.done():
- await self._raise_for_status()
-
-
-class StreamUnaryCall(_StreamRequestMixin, _UnaryResponseMixin, Call,
- _base_call.StreamUnaryCall):
- """Object for managing stream-unary RPC calls.
-
- Returned when an instance of `StreamUnaryMultiCallable` object is called.
- """
-
- # pylint: disable=too-many-arguments
- def __init__(self, request_iterator: Optional[RequestIterableType],
- deadline: Optional[float], metadata: Metadata,
- credentials: Optional[grpc.CallCredentials],
- wait_for_ready: Optional[bool], channel: cygrpc.AioChannel,
- method: bytes, request_serializer: SerializingFunction,
- response_deserializer: DeserializingFunction,
- loop: asyncio.AbstractEventLoop) -> None:
- super().__init__(
- channel.call(method, deadline, credentials, wait_for_ready),
- metadata, request_serializer, response_deserializer, loop)
-
- self._init_stream_request_mixin(request_iterator)
- self._init_unary_response_mixin(loop.create_task(self._conduct_rpc()))
-
- async def _conduct_rpc(self) -> ResponseType:
- try:
- serialized_response = await self._cython_call.stream_unary(
- self._metadata, self._metadata_sent_observer)
- except asyncio.CancelledError:
- if not self.cancelled():
- self.cancel()
-
- if self._cython_call.is_ok():
- return _common.deserialize(serialized_response,
- self._response_deserializer)
- else:
- return cygrpc.EOF
-
-
-class StreamStreamCall(_StreamRequestMixin, _StreamResponseMixin, Call,
- _base_call.StreamStreamCall):
- """Object for managing stream-stream RPC calls.
-
- Returned when an instance of `StreamStreamMultiCallable` object is called.
- """
- _initializer: asyncio.Task
-
- # pylint: disable=too-many-arguments
- def __init__(self, request_iterator: Optional[RequestIterableType],
- deadline: Optional[float], metadata: Metadata,
- credentials: Optional[grpc.CallCredentials],
- wait_for_ready: Optional[bool], channel: cygrpc.AioChannel,
- method: bytes, request_serializer: SerializingFunction,
- response_deserializer: DeserializingFunction,
- loop: asyncio.AbstractEventLoop) -> None:
- super().__init__(
- channel.call(method, deadline, credentials, wait_for_ready),
- metadata, request_serializer, response_deserializer, loop)
- self._initializer = self._loop.create_task(self._prepare_rpc())
- self._init_stream_request_mixin(request_iterator)
- self._init_stream_response_mixin(self._initializer)
-
- async def _prepare_rpc(self):
- """This method prepares the RPC for receiving/sending messages.
-
- All other operations around the stream should only happen after the
- completion of this method.
- """
- try:
- await self._cython_call.initiate_stream_stream(
- self._metadata, self._metadata_sent_observer)
- except asyncio.CancelledError:
- if not self.cancelled():
- self.cancel()
- # No need to raise RpcError here, because no one will `await` this task.
+# Copyright 2019 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+"""Invocation-side implementation of gRPC Asyncio Python."""
+
+import asyncio
+import enum
+import inspect
+import logging
+from functools import partial
+from typing import AsyncIterable, Optional, Tuple
+
+import grpc
+from grpc import _common
+from grpc._cython import cygrpc
+
+from . import _base_call
+from ._metadata import Metadata
+from ._typing import (DeserializingFunction, DoneCallbackType, MetadatumType,
+ RequestIterableType, RequestType, ResponseType,
+ SerializingFunction)
+
+__all__ = 'AioRpcError', 'Call', 'UnaryUnaryCall', 'UnaryStreamCall'
+
+_LOCAL_CANCELLATION_DETAILS = 'Locally cancelled by application!'
+_GC_CANCELLATION_DETAILS = 'Cancelled upon garbage collection!'
+_RPC_ALREADY_FINISHED_DETAILS = 'RPC already finished.'
+_RPC_HALF_CLOSED_DETAILS = 'RPC is half closed after calling "done_writing".'
+_API_STYLE_ERROR = 'The iterator and read/write APIs may not be mixed on a single RPC.'
+
+_OK_CALL_REPRESENTATION = ('<{} of RPC that terminated with:\n'
+ '\tstatus = {}\n'
+ '\tdetails = "{}"\n'
+ '>')
+
+_NON_OK_CALL_REPRESENTATION = ('<{} of RPC that terminated with:\n'
+ '\tstatus = {}\n'
+ '\tdetails = "{}"\n'
+ '\tdebug_error_string = "{}"\n'
+ '>')
+
+_LOGGER = logging.getLogger(__name__)
+
+
+class AioRpcError(grpc.RpcError):
+ """An implementation of RpcError to be used by the asynchronous API.
+
+ Raised RpcError is a snapshot of the final status of the RPC, values are
+ determined. Hence, its methods no longer needs to be coroutines.
+ """
+
+ _code: grpc.StatusCode
+ _details: Optional[str]
+ _initial_metadata: Optional[Metadata]
+ _trailing_metadata: Optional[Metadata]
+ _debug_error_string: Optional[str]
+
+ def __init__(self,
+ code: grpc.StatusCode,
+ initial_metadata: Metadata,
+ trailing_metadata: Metadata,
+ details: Optional[str] = None,
+ debug_error_string: Optional[str] = None) -> None:
+ """Constructor.
+
+ Args:
+ code: The status code with which the RPC has been finalized.
+ details: Optional details explaining the reason of the error.
+ initial_metadata: Optional initial metadata that could be sent by the
+ Server.
+ trailing_metadata: Optional metadata that could be sent by the Server.
+ """
+
+ super().__init__(self)
+ self._code = code
+ self._details = details
+ self._initial_metadata = initial_metadata
+ self._trailing_metadata = trailing_metadata
+ self._debug_error_string = debug_error_string
+
+ def code(self) -> grpc.StatusCode:
+ """Accesses the status code sent by the server.
+
+ Returns:
+ The `grpc.StatusCode` status code.
+ """
+ return self._code
+
+ def details(self) -> Optional[str]:
+ """Accesses the details sent by the server.
+
+ Returns:
+ The description of the error.
+ """
+ return self._details
+
+ def initial_metadata(self) -> Metadata:
+ """Accesses the initial metadata sent by the server.
+
+ Returns:
+ The initial metadata received.
+ """
+ return self._initial_metadata
+
+ def trailing_metadata(self) -> Metadata:
+ """Accesses the trailing metadata sent by the server.
+
+ Returns:
+ The trailing metadata received.
+ """
+ return self._trailing_metadata
+
+ def debug_error_string(self) -> str:
+ """Accesses the debug error string sent by the server.
+
+ Returns:
+ The debug error string received.
+ """
+ return self._debug_error_string
+
+ def _repr(self) -> str:
+ """Assembles the error string for the RPC error."""
+ return _NON_OK_CALL_REPRESENTATION.format(self.__class__.__name__,
+ self._code, self._details,
+ self._debug_error_string)
+
+ def __repr__(self) -> str:
+ return self._repr()
+
+ def __str__(self) -> str:
+ return self._repr()
+
+
+def _create_rpc_error(initial_metadata: Metadata,
+ status: cygrpc.AioRpcStatus) -> AioRpcError:
+ return AioRpcError(
+ _common.CYGRPC_STATUS_CODE_TO_STATUS_CODE[status.code()],
+ Metadata.from_tuple(initial_metadata),
+ Metadata.from_tuple(status.trailing_metadata()),
+ details=status.details(),
+ debug_error_string=status.debug_error_string(),
+ )
+
+
+class Call:
+ """Base implementation of client RPC Call object.
+
+ Implements logic around final status, metadata and cancellation.
+ """
+ _loop: asyncio.AbstractEventLoop
+ _code: grpc.StatusCode
+ _cython_call: cygrpc._AioCall
+ _metadata: Tuple[MetadatumType]
+ _request_serializer: SerializingFunction
+ _response_deserializer: DeserializingFunction
+
+ def __init__(self, cython_call: cygrpc._AioCall, metadata: Metadata,
+ request_serializer: SerializingFunction,
+ response_deserializer: DeserializingFunction,
+ loop: asyncio.AbstractEventLoop) -> None:
+ self._loop = loop
+ self._cython_call = cython_call
+ self._metadata = tuple(metadata)
+ self._request_serializer = request_serializer
+ self._response_deserializer = response_deserializer
+
+ def __del__(self) -> None:
+ # The '_cython_call' object might be destructed before Call object
+ if hasattr(self, '_cython_call'):
+ if not self._cython_call.done():
+ self._cancel(_GC_CANCELLATION_DETAILS)
+
+ def cancelled(self) -> bool:
+ return self._cython_call.cancelled()
+
+ def _cancel(self, details: str) -> bool:
+ """Forwards the application cancellation reasoning."""
+ if not self._cython_call.done():
+ self._cython_call.cancel(details)
+ return True
+ else:
+ return False
+
+ def cancel(self) -> bool:
+ return self._cancel(_LOCAL_CANCELLATION_DETAILS)
+
+ def done(self) -> bool:
+ return self._cython_call.done()
+
+ def add_done_callback(self, callback: DoneCallbackType) -> None:
+ cb = partial(callback, self)
+ self._cython_call.add_done_callback(cb)
+
+ def time_remaining(self) -> Optional[float]:
+ return self._cython_call.time_remaining()
+
+ async def initial_metadata(self) -> Metadata:
+ raw_metadata_tuple = await self._cython_call.initial_metadata()
+ return Metadata.from_tuple(raw_metadata_tuple)
+
+ async def trailing_metadata(self) -> Metadata:
+ raw_metadata_tuple = (await
+ self._cython_call.status()).trailing_metadata()
+ return Metadata.from_tuple(raw_metadata_tuple)
+
+ async def code(self) -> grpc.StatusCode:
+ cygrpc_code = (await self._cython_call.status()).code()
+ return _common.CYGRPC_STATUS_CODE_TO_STATUS_CODE[cygrpc_code]
+
+ async def details(self) -> str:
+ return (await self._cython_call.status()).details()
+
+ async def debug_error_string(self) -> str:
+ return (await self._cython_call.status()).debug_error_string()
+
+ async def _raise_for_status(self) -> None:
+ if self._cython_call.is_locally_cancelled():
+ raise asyncio.CancelledError()
+ code = await self.code()
+ if code != grpc.StatusCode.OK:
+ raise _create_rpc_error(await self.initial_metadata(), await
+ self._cython_call.status())
+
+ def _repr(self) -> str:
+ return repr(self._cython_call)
+
+ def __repr__(self) -> str:
+ return self._repr()
+
+ def __str__(self) -> str:
+ return self._repr()
+
+
+class _APIStyle(enum.IntEnum):
+ UNKNOWN = 0
+ ASYNC_GENERATOR = 1
+ READER_WRITER = 2
+
+
+class _UnaryResponseMixin(Call):
+ _call_response: asyncio.Task
+
+ def _init_unary_response_mixin(self, response_task: asyncio.Task):
+ self._call_response = response_task
+
+ def cancel(self) -> bool:
+ if super().cancel():
+ self._call_response.cancel()
+ return True
+ else:
+ return False
+
+ def __await__(self) -> ResponseType:
+ """Wait till the ongoing RPC request finishes."""
+ try:
+ response = yield from self._call_response
+ except asyncio.CancelledError:
+ # Even if we caught all other CancelledError, there is still
+ # this corner case. If the application cancels immediately after
+ # the Call object is created, we will observe this
+ # `CancelledError`.
+ if not self.cancelled():
+ self.cancel()
+ raise
+
+ # NOTE(lidiz) If we raise RpcError in the task, and users doesn't
+ # 'await' on it. AsyncIO will log 'Task exception was never retrieved'.
+ # Instead, if we move the exception raising here, the spam stops.
+ # Unfortunately, there can only be one 'yield from' in '__await__'. So,
+ # we need to access the private instance variable.
+ if response is cygrpc.EOF:
+ if self._cython_call.is_locally_cancelled():
+ raise asyncio.CancelledError()
+ else:
+ raise _create_rpc_error(self._cython_call._initial_metadata,
+ self._cython_call._status)
+ else:
+ return response
+
+
+class _StreamResponseMixin(Call):
+ _message_aiter: AsyncIterable[ResponseType]
+ _preparation: asyncio.Task
+ _response_style: _APIStyle
+
+ def _init_stream_response_mixin(self, preparation: asyncio.Task):
+ self._message_aiter = None
+ self._preparation = preparation
+ self._response_style = _APIStyle.UNKNOWN
+
+ def _update_response_style(self, style: _APIStyle):
+ if self._response_style is _APIStyle.UNKNOWN:
+ self._response_style = style
+ elif self._response_style is not style:
+ raise cygrpc.UsageError(_API_STYLE_ERROR)
+
+ def cancel(self) -> bool:
+ if super().cancel():
+ self._preparation.cancel()
+ return True
+ else:
+ return False
+
+ async def _fetch_stream_responses(self) -> ResponseType:
+ message = await self._read()
+ while message is not cygrpc.EOF:
+ yield message
+ message = await self._read()
+
+ # If the read operation failed, Core should explain why.
+ await self._raise_for_status()
+
+ def __aiter__(self) -> AsyncIterable[ResponseType]:
+ self._update_response_style(_APIStyle.ASYNC_GENERATOR)
+ if self._message_aiter is None:
+ self._message_aiter = self._fetch_stream_responses()
+ return self._message_aiter
+
+ async def _read(self) -> ResponseType:
+ # Wait for the request being sent
+ await self._preparation
+
+ # Reads response message from Core
+ try:
+ raw_response = await self._cython_call.receive_serialized_message()
+ except asyncio.CancelledError:
+ if not self.cancelled():
+ self.cancel()
+ await self._raise_for_status()
+
+ if raw_response is cygrpc.EOF:
+ return cygrpc.EOF
+ else:
+ return _common.deserialize(raw_response,
+ self._response_deserializer)
+
+ async def read(self) -> ResponseType:
+ if self.done():
+ await self._raise_for_status()
+ return cygrpc.EOF
+ self._update_response_style(_APIStyle.READER_WRITER)
+
+ response_message = await self._read()
+
+ if response_message is cygrpc.EOF:
+ # If the read operation failed, Core should explain why.
+ await self._raise_for_status()
+ return response_message
+
+
+class _StreamRequestMixin(Call):
+ _metadata_sent: asyncio.Event
+ _done_writing_flag: bool
+ _async_request_poller: Optional[asyncio.Task]
+ _request_style: _APIStyle
+
+ def _init_stream_request_mixin(
+ self, request_iterator: Optional[RequestIterableType]):
+ self._metadata_sent = asyncio.Event(loop=self._loop)
+ self._done_writing_flag = False
+
+ # If user passes in an async iterator, create a consumer Task.
+ if request_iterator is not None:
+ self._async_request_poller = self._loop.create_task(
+ self._consume_request_iterator(request_iterator))
+ self._request_style = _APIStyle.ASYNC_GENERATOR
+ else:
+ self._async_request_poller = None
+ self._request_style = _APIStyle.READER_WRITER
+
+ def _raise_for_different_style(self, style: _APIStyle):
+ if self._request_style is not style:
+ raise cygrpc.UsageError(_API_STYLE_ERROR)
+
+ def cancel(self) -> bool:
+ if super().cancel():
+ if self._async_request_poller is not None:
+ self._async_request_poller.cancel()
+ return True
+ else:
+ return False
+
+ def _metadata_sent_observer(self):
+ self._metadata_sent.set()
+
+ async def _consume_request_iterator(self,
+ request_iterator: RequestIterableType
+ ) -> None:
+ try:
+ if inspect.isasyncgen(request_iterator) or hasattr(
+ request_iterator, '__aiter__'):
+ async for request in request_iterator:
+ await self._write(request)
+ else:
+ for request in request_iterator:
+ await self._write(request)
+
+ await self._done_writing()
+ except AioRpcError as rpc_error:
+ # Rpc status should be exposed through other API. Exceptions raised
+ # within this Task won't be retrieved by another coroutine. It's
+ # better to suppress the error than spamming users' screen.
+ _LOGGER.debug('Exception while consuming the request_iterator: %s',
+ rpc_error)
+
+ async def _write(self, request: RequestType) -> None:
+ if self.done():
+ raise asyncio.InvalidStateError(_RPC_ALREADY_FINISHED_DETAILS)
+ if self._done_writing_flag:
+ raise asyncio.InvalidStateError(_RPC_HALF_CLOSED_DETAILS)
+ if not self._metadata_sent.is_set():
+ await self._metadata_sent.wait()
+ if self.done():
+ await self._raise_for_status()
+
+ serialized_request = _common.serialize(request,
+ self._request_serializer)
+ try:
+ await self._cython_call.send_serialized_message(serialized_request)
+ except asyncio.CancelledError:
+ if not self.cancelled():
+ self.cancel()
+ await self._raise_for_status()
+
+ async def _done_writing(self) -> None:
+ if self.done():
+ # If the RPC is finished, do nothing.
+ return
+ if not self._done_writing_flag:
+ # If the done writing is not sent before, try to send it.
+ self._done_writing_flag = True
+ try:
+ await self._cython_call.send_receive_close()
+ except asyncio.CancelledError:
+ if not self.cancelled():
+ self.cancel()
+ await self._raise_for_status()
+
+ async def write(self, request: RequestType) -> None:
+ self._raise_for_different_style(_APIStyle.READER_WRITER)
+ await self._write(request)
+
+ async def done_writing(self) -> None:
+ """Signal peer that client is done writing.
+
+ This method is idempotent.
+ """
+ self._raise_for_different_style(_APIStyle.READER_WRITER)
+ await self._done_writing()
+
+ async def wait_for_connection(self) -> None:
+ await self._metadata_sent.wait()
+ if self.done():
+ await self._raise_for_status()
+
+
+class UnaryUnaryCall(_UnaryResponseMixin, Call, _base_call.UnaryUnaryCall):
+ """Object for managing unary-unary RPC calls.
+
+ Returned when an instance of `UnaryUnaryMultiCallable` object is called.
+ """
+ _request: RequestType
+ _invocation_task: asyncio.Task
+
+ # pylint: disable=too-many-arguments
+ def __init__(self, request: RequestType, deadline: Optional[float],
+ metadata: Metadata,
+ credentials: Optional[grpc.CallCredentials],
+ wait_for_ready: Optional[bool], channel: cygrpc.AioChannel,
+ method: bytes, request_serializer: SerializingFunction,
+ response_deserializer: DeserializingFunction,
+ loop: asyncio.AbstractEventLoop) -> None:
+ super().__init__(
+ channel.call(method, deadline, credentials, wait_for_ready),
+ metadata, request_serializer, response_deserializer, loop)
+ self._request = request
+ self._invocation_task = loop.create_task(self._invoke())
+ self._init_unary_response_mixin(self._invocation_task)
+
+ async def _invoke(self) -> ResponseType:
+ serialized_request = _common.serialize(self._request,
+ self._request_serializer)
+
+ # NOTE(lidiz) asyncio.CancelledError is not a good transport for status,
+ # because the asyncio.Task class do not cache the exception object.
+ # https://github.com/python/cpython/blob/edad4d89e357c92f70c0324b937845d652b20afd/Lib/asyncio/tasks.py#L785
+ try:
+ serialized_response = await self._cython_call.unary_unary(
+ serialized_request, self._metadata)
+ except asyncio.CancelledError:
+ if not self.cancelled():
+ self.cancel()
+
+ if self._cython_call.is_ok():
+ return _common.deserialize(serialized_response,
+ self._response_deserializer)
+ else:
+ return cygrpc.EOF
+
+ async def wait_for_connection(self) -> None:
+ await self._invocation_task
+ if self.done():
+ await self._raise_for_status()
+
+
+class UnaryStreamCall(_StreamResponseMixin, Call, _base_call.UnaryStreamCall):
+ """Object for managing unary-stream RPC calls.
+
+ Returned when an instance of `UnaryStreamMultiCallable` object is called.
+ """
+ _request: RequestType
+ _send_unary_request_task: asyncio.Task
+
+ # pylint: disable=too-many-arguments
+ def __init__(self, request: RequestType, deadline: Optional[float],
+ metadata: Metadata,
+ credentials: Optional[grpc.CallCredentials],
+ wait_for_ready: Optional[bool], channel: cygrpc.AioChannel,
+ method: bytes, request_serializer: SerializingFunction,
+ response_deserializer: DeserializingFunction,
+ loop: asyncio.AbstractEventLoop) -> None:
+ super().__init__(
+ channel.call(method, deadline, credentials, wait_for_ready),
+ metadata, request_serializer, response_deserializer, loop)
+ self._request = request
+ self._send_unary_request_task = loop.create_task(
+ self._send_unary_request())
+ self._init_stream_response_mixin(self._send_unary_request_task)
+
+ async def _send_unary_request(self) -> ResponseType:
+ serialized_request = _common.serialize(self._request,
+ self._request_serializer)
+ try:
+ await self._cython_call.initiate_unary_stream(
+ serialized_request, self._metadata)
+ except asyncio.CancelledError:
+ if not self.cancelled():
+ self.cancel()
+ raise
+
+ async def wait_for_connection(self) -> None:
+ await self._send_unary_request_task
+ if self.done():
+ await self._raise_for_status()
+
+
+class StreamUnaryCall(_StreamRequestMixin, _UnaryResponseMixin, Call,
+ _base_call.StreamUnaryCall):
+ """Object for managing stream-unary RPC calls.
+
+ Returned when an instance of `StreamUnaryMultiCallable` object is called.
+ """
+
+ # pylint: disable=too-many-arguments
+ def __init__(self, request_iterator: Optional[RequestIterableType],
+ deadline: Optional[float], metadata: Metadata,
+ credentials: Optional[grpc.CallCredentials],
+ wait_for_ready: Optional[bool], channel: cygrpc.AioChannel,
+ method: bytes, request_serializer: SerializingFunction,
+ response_deserializer: DeserializingFunction,
+ loop: asyncio.AbstractEventLoop) -> None:
+ super().__init__(
+ channel.call(method, deadline, credentials, wait_for_ready),
+ metadata, request_serializer, response_deserializer, loop)
+
+ self._init_stream_request_mixin(request_iterator)
+ self._init_unary_response_mixin(loop.create_task(self._conduct_rpc()))
+
+ async def _conduct_rpc(self) -> ResponseType:
+ try:
+ serialized_response = await self._cython_call.stream_unary(
+ self._metadata, self._metadata_sent_observer)
+ except asyncio.CancelledError:
+ if not self.cancelled():
+ self.cancel()
+
+ if self._cython_call.is_ok():
+ return _common.deserialize(serialized_response,
+ self._response_deserializer)
+ else:
+ return cygrpc.EOF
+
+
+class StreamStreamCall(_StreamRequestMixin, _StreamResponseMixin, Call,
+ _base_call.StreamStreamCall):
+ """Object for managing stream-stream RPC calls.
+
+ Returned when an instance of `StreamStreamMultiCallable` object is called.
+ """
+ _initializer: asyncio.Task
+
+ # pylint: disable=too-many-arguments
+ def __init__(self, request_iterator: Optional[RequestIterableType],
+ deadline: Optional[float], metadata: Metadata,
+ credentials: Optional[grpc.CallCredentials],
+ wait_for_ready: Optional[bool], channel: cygrpc.AioChannel,
+ method: bytes, request_serializer: SerializingFunction,
+ response_deserializer: DeserializingFunction,
+ loop: asyncio.AbstractEventLoop) -> None:
+ super().__init__(
+ channel.call(method, deadline, credentials, wait_for_ready),
+ metadata, request_serializer, response_deserializer, loop)
+ self._initializer = self._loop.create_task(self._prepare_rpc())
+ self._init_stream_request_mixin(request_iterator)
+ self._init_stream_response_mixin(self._initializer)
+
+ async def _prepare_rpc(self):
+ """This method prepares the RPC for receiving/sending messages.
+
+ All other operations around the stream should only happen after the
+ completion of this method.
+ """
+ try:
+ await self._cython_call.initiate_stream_stream(
+ self._metadata, self._metadata_sent_observer)
+ except asyncio.CancelledError:
+ if not self.cancelled():
+ self.cancel()
+ # No need to raise RpcError here, because no one will `await` this task.
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/aio/_channel.py b/contrib/libs/grpc/src/python/grpcio/grpc/aio/_channel.py
index 0ec0d2176cc..3af34677064 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/aio/_channel.py
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/aio/_channel.py
@@ -1,469 +1,469 @@
-# Copyright 2019 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-"""Invocation-side implementation of gRPC Asyncio Python."""
-
-import asyncio
-import sys
-from typing import Any, Iterable, Optional, Sequence, List
-
-import grpc
-from grpc import _common, _compression, _grpcio_metadata
-from grpc._cython import cygrpc
-
-from . import _base_call, _base_channel
-from ._call import (StreamStreamCall, StreamUnaryCall, UnaryStreamCall,
- UnaryUnaryCall)
-from ._interceptor import (
- InterceptedUnaryUnaryCall, InterceptedUnaryStreamCall,
- InterceptedStreamUnaryCall, InterceptedStreamStreamCall, ClientInterceptor,
- UnaryUnaryClientInterceptor, UnaryStreamClientInterceptor,
- StreamUnaryClientInterceptor, StreamStreamClientInterceptor)
-from ._metadata import Metadata
-from ._typing import (ChannelArgumentType, DeserializingFunction,
- SerializingFunction, RequestIterableType)
-from ._utils import _timeout_to_deadline
-
-_USER_AGENT = 'grpc-python-asyncio/{}'.format(_grpcio_metadata.__version__)
-
-if sys.version_info[1] < 7:
-
- def _all_tasks() -> Iterable[asyncio.Task]:
- return asyncio.Task.all_tasks()
-else:
-
- def _all_tasks() -> Iterable[asyncio.Task]:
- return asyncio.all_tasks()
-
-
-def _augment_channel_arguments(base_options: ChannelArgumentType,
- compression: Optional[grpc.Compression]):
- compression_channel_argument = _compression.create_channel_option(
- compression)
- user_agent_channel_argument = ((
- cygrpc.ChannelArgKey.primary_user_agent_string,
- _USER_AGENT,
- ),)
- return tuple(base_options
- ) + compression_channel_argument + user_agent_channel_argument
-
-
-class _BaseMultiCallable:
- """Base class of all multi callable objects.
-
- Handles the initialization logic and stores common attributes.
- """
- _loop: asyncio.AbstractEventLoop
- _channel: cygrpc.AioChannel
- _method: bytes
- _request_serializer: SerializingFunction
- _response_deserializer: DeserializingFunction
- _interceptors: Optional[Sequence[ClientInterceptor]]
- _loop: asyncio.AbstractEventLoop
-
- # pylint: disable=too-many-arguments
- def __init__(
- self,
- channel: cygrpc.AioChannel,
- method: bytes,
- request_serializer: SerializingFunction,
- response_deserializer: DeserializingFunction,
- interceptors: Optional[Sequence[ClientInterceptor]],
- loop: asyncio.AbstractEventLoop,
- ) -> None:
- self._loop = loop
- self._channel = channel
- self._method = method
- self._request_serializer = request_serializer
- self._response_deserializer = response_deserializer
- self._interceptors = interceptors
-
- @staticmethod
- def _init_metadata(metadata: Optional[Metadata] = None,
- compression: Optional[grpc.Compression] = None
- ) -> Metadata:
- """Based on the provided values for <metadata> or <compression> initialise the final
- metadata, as it should be used for the current call.
- """
- metadata = metadata or Metadata()
- if compression:
- metadata = Metadata(
- *_compression.augment_metadata(metadata, compression))
- return metadata
-
-
-class UnaryUnaryMultiCallable(_BaseMultiCallable,
- _base_channel.UnaryUnaryMultiCallable):
-
- def __call__(self,
- request: Any,
- *,
- timeout: Optional[float] = None,
- metadata: Optional[Metadata] = None,
- credentials: Optional[grpc.CallCredentials] = None,
- wait_for_ready: Optional[bool] = None,
- compression: Optional[grpc.Compression] = None
- ) -> _base_call.UnaryUnaryCall:
-
- metadata = self._init_metadata(metadata, compression)
- if not self._interceptors:
- call = UnaryUnaryCall(request, _timeout_to_deadline(timeout),
- metadata, credentials, wait_for_ready,
- self._channel, self._method,
- self._request_serializer,
- self._response_deserializer, self._loop)
- else:
- call = InterceptedUnaryUnaryCall(
- self._interceptors, request, timeout, metadata, credentials,
- wait_for_ready, self._channel, self._method,
- self._request_serializer, self._response_deserializer,
- self._loop)
-
- return call
-
-
-class UnaryStreamMultiCallable(_BaseMultiCallable,
- _base_channel.UnaryStreamMultiCallable):
-
- def __call__(self,
- request: Any,
- *,
- timeout: Optional[float] = None,
- metadata: Optional[Metadata] = None,
- credentials: Optional[grpc.CallCredentials] = None,
- wait_for_ready: Optional[bool] = None,
- compression: Optional[grpc.Compression] = None
- ) -> _base_call.UnaryStreamCall:
-
- metadata = self._init_metadata(metadata, compression)
- deadline = _timeout_to_deadline(timeout)
-
- if not self._interceptors:
- call = UnaryStreamCall(request, deadline, metadata, credentials,
- wait_for_ready, self._channel, self._method,
- self._request_serializer,
- self._response_deserializer, self._loop)
- else:
- call = InterceptedUnaryStreamCall(
- self._interceptors, request, deadline, metadata, credentials,
- wait_for_ready, self._channel, self._method,
- self._request_serializer, self._response_deserializer,
- self._loop)
-
- return call
-
-
-class StreamUnaryMultiCallable(_BaseMultiCallable,
- _base_channel.StreamUnaryMultiCallable):
-
- def __call__(self,
- request_iterator: Optional[RequestIterableType] = None,
- timeout: Optional[float] = None,
- metadata: Optional[Metadata] = None,
- credentials: Optional[grpc.CallCredentials] = None,
- wait_for_ready: Optional[bool] = None,
- compression: Optional[grpc.Compression] = None
- ) -> _base_call.StreamUnaryCall:
-
- metadata = self._init_metadata(metadata, compression)
- deadline = _timeout_to_deadline(timeout)
-
- if not self._interceptors:
- call = StreamUnaryCall(request_iterator, deadline, metadata,
- credentials, wait_for_ready, self._channel,
- self._method, self._request_serializer,
- self._response_deserializer, self._loop)
- else:
- call = InterceptedStreamUnaryCall(
- self._interceptors, request_iterator, deadline, metadata,
- credentials, wait_for_ready, self._channel, self._method,
- self._request_serializer, self._response_deserializer,
- self._loop)
-
- return call
-
-
-class StreamStreamMultiCallable(_BaseMultiCallable,
- _base_channel.StreamStreamMultiCallable):
-
- def __call__(self,
- request_iterator: Optional[RequestIterableType] = None,
- timeout: Optional[float] = None,
- metadata: Optional[Metadata] = None,
- credentials: Optional[grpc.CallCredentials] = None,
- wait_for_ready: Optional[bool] = None,
- compression: Optional[grpc.Compression] = None
- ) -> _base_call.StreamStreamCall:
-
- metadata = self._init_metadata(metadata, compression)
- deadline = _timeout_to_deadline(timeout)
-
- if not self._interceptors:
- call = StreamStreamCall(request_iterator, deadline, metadata,
- credentials, wait_for_ready, self._channel,
- self._method, self._request_serializer,
- self._response_deserializer, self._loop)
- else:
- call = InterceptedStreamStreamCall(
- self._interceptors, request_iterator, deadline, metadata,
- credentials, wait_for_ready, self._channel, self._method,
- self._request_serializer, self._response_deserializer,
- self._loop)
-
- return call
-
-
-class Channel(_base_channel.Channel):
- _loop: asyncio.AbstractEventLoop
- _channel: cygrpc.AioChannel
- _unary_unary_interceptors: List[UnaryUnaryClientInterceptor]
- _unary_stream_interceptors: List[UnaryStreamClientInterceptor]
- _stream_unary_interceptors: List[StreamUnaryClientInterceptor]
- _stream_stream_interceptors: List[StreamStreamClientInterceptor]
-
- def __init__(self, target: str, options: ChannelArgumentType,
- credentials: Optional[grpc.ChannelCredentials],
- compression: Optional[grpc.Compression],
- interceptors: Optional[Sequence[ClientInterceptor]]):
- """Constructor.
-
- Args:
- target: The target to which to connect.
- options: Configuration options for the channel.
- credentials: A cygrpc.ChannelCredentials or None.
- compression: An optional value indicating the compression method to be
- used over the lifetime of the channel.
- interceptors: An optional list of interceptors that would be used for
- intercepting any RPC executed with that channel.
- """
- self._unary_unary_interceptors = []
- self._unary_stream_interceptors = []
- self._stream_unary_interceptors = []
- self._stream_stream_interceptors = []
-
- if interceptors is not None:
- for interceptor in interceptors:
- if isinstance(interceptor, UnaryUnaryClientInterceptor):
- self._unary_unary_interceptors.append(interceptor)
- elif isinstance(interceptor, UnaryStreamClientInterceptor):
- self._unary_stream_interceptors.append(interceptor)
- elif isinstance(interceptor, StreamUnaryClientInterceptor):
- self._stream_unary_interceptors.append(interceptor)
- elif isinstance(interceptor, StreamStreamClientInterceptor):
- self._stream_stream_interceptors.append(interceptor)
- else:
- raise ValueError(
- "Interceptor {} must be ".format(interceptor) +
- "{} or ".format(UnaryUnaryClientInterceptor.__name__) +
- "{} or ".format(UnaryStreamClientInterceptor.__name__) +
- "{} or ".format(StreamUnaryClientInterceptor.__name__) +
- "{}. ".format(StreamStreamClientInterceptor.__name__))
-
- self._loop = cygrpc.get_working_loop()
- self._channel = cygrpc.AioChannel(
- _common.encode(target),
- _augment_channel_arguments(options, compression), credentials,
- self._loop)
-
- async def __aenter__(self):
- return self
-
- async def __aexit__(self, exc_type, exc_val, exc_tb):
- await self._close(None)
-
- async def _close(self, grace): # pylint: disable=too-many-branches
- if self._channel.closed():
- return
-
- # No new calls will be accepted by the Cython channel.
- self._channel.closing()
-
- # Iterate through running tasks
- tasks = _all_tasks()
- calls = []
- call_tasks = []
- for task in tasks:
- try:
- stack = task.get_stack(limit=1)
- except AttributeError as attribute_error:
- # NOTE(lidiz) tl;dr: If the Task is created with a CPython
- # object, it will trigger AttributeError.
- #
- # In the global finalizer, the event loop schedules
- # a CPython PyAsyncGenAThrow object.
- # https://github.com/python/cpython/blob/00e45877e33d32bb61aa13a2033e3bba370bda4d/Lib/asyncio/base_events.py#L484
- #
- # However, the PyAsyncGenAThrow object is written in C and
- # failed to include the normal Python frame objects. Hence,
- # this exception is a false negative, and it is safe to ignore
- # the failure. It is fixed by https://github.com/python/cpython/pull/18669,
- # but not available until 3.9 or 3.8.3. So, we have to keep it
- # for a while.
- # TODO(lidiz) drop this hack after 3.8 deprecation
- if 'frame' in str(attribute_error):
- continue
- else:
- raise
-
- # If the Task is created by a C-extension, the stack will be empty.
- if not stack:
- continue
-
- # Locate ones created by `aio.Call`.
- frame = stack[0]
- candidate = frame.f_locals.get('self')
- if candidate:
- if isinstance(candidate, _base_call.Call):
- if hasattr(candidate, '_channel'):
- # For intercepted Call object
- if candidate._channel is not self._channel:
- continue
- elif hasattr(candidate, '_cython_call'):
- # For normal Call object
- if candidate._cython_call._channel is not self._channel:
- continue
- else:
- # Unidentified Call object
- raise cygrpc.InternalError(
- f'Unrecognized call object: {candidate}')
-
- calls.append(candidate)
- call_tasks.append(task)
-
- # If needed, try to wait for them to finish.
- # Call objects are not always awaitables.
- if grace and call_tasks:
- await asyncio.wait(call_tasks, timeout=grace, loop=self._loop)
-
- # Time to cancel existing calls.
- for call in calls:
- call.cancel()
-
- # Destroy the channel
- self._channel.close()
-
- async def close(self, grace: Optional[float] = None):
- await self._close(grace)
-
- def get_state(self,
- try_to_connect: bool = False) -> grpc.ChannelConnectivity:
- result = self._channel.check_connectivity_state(try_to_connect)
- return _common.CYGRPC_CONNECTIVITY_STATE_TO_CHANNEL_CONNECTIVITY[result]
-
- async def wait_for_state_change(
- self,
- last_observed_state: grpc.ChannelConnectivity,
- ) -> None:
- assert await self._channel.watch_connectivity_state(
- last_observed_state.value[0], None)
-
- async def channel_ready(self) -> None:
- state = self.get_state(try_to_connect=True)
- while state != grpc.ChannelConnectivity.READY:
- await self.wait_for_state_change(state)
- state = self.get_state(try_to_connect=True)
-
- def unary_unary(
- self,
- method: str,
- request_serializer: Optional[SerializingFunction] = None,
- response_deserializer: Optional[DeserializingFunction] = None
- ) -> UnaryUnaryMultiCallable:
- return UnaryUnaryMultiCallable(self._channel, _common.encode(method),
- request_serializer,
- response_deserializer,
- self._unary_unary_interceptors,
- self._loop)
-
- def unary_stream(
- self,
- method: str,
- request_serializer: Optional[SerializingFunction] = None,
- response_deserializer: Optional[DeserializingFunction] = None
- ) -> UnaryStreamMultiCallable:
- return UnaryStreamMultiCallable(self._channel, _common.encode(method),
- request_serializer,
- response_deserializer,
- self._unary_stream_interceptors,
- self._loop)
-
- def stream_unary(
- self,
- method: str,
- request_serializer: Optional[SerializingFunction] = None,
- response_deserializer: Optional[DeserializingFunction] = None
- ) -> StreamUnaryMultiCallable:
- return StreamUnaryMultiCallable(self._channel, _common.encode(method),
- request_serializer,
- response_deserializer,
- self._stream_unary_interceptors,
- self._loop)
-
- def stream_stream(
- self,
- method: str,
- request_serializer: Optional[SerializingFunction] = None,
- response_deserializer: Optional[DeserializingFunction] = None
- ) -> StreamStreamMultiCallable:
- return StreamStreamMultiCallable(self._channel, _common.encode(method),
- request_serializer,
- response_deserializer,
- self._stream_stream_interceptors,
- self._loop)
-
-
-def insecure_channel(
- target: str,
- options: Optional[ChannelArgumentType] = None,
- compression: Optional[grpc.Compression] = None,
- interceptors: Optional[Sequence[ClientInterceptor]] = None):
- """Creates an insecure asynchronous Channel to a server.
-
- Args:
- target: The server address
- options: An optional list of key-value pairs (:term:`channel_arguments`
- in gRPC Core runtime) to configure the channel.
- compression: An optional value indicating the compression method to be
- used over the lifetime of the channel. This is an EXPERIMENTAL option.
- interceptors: An optional sequence of interceptors that will be executed for
- any call executed with this channel.
-
- Returns:
- A Channel.
- """
- return Channel(target, () if options is None else options, None,
- compression, interceptors)
-
-
-def secure_channel(target: str,
- credentials: grpc.ChannelCredentials,
- options: Optional[ChannelArgumentType] = None,
- compression: Optional[grpc.Compression] = None,
- interceptors: Optional[Sequence[ClientInterceptor]] = None):
- """Creates a secure asynchronous Channel to a server.
-
- Args:
- target: The server address.
- credentials: A ChannelCredentials instance.
- options: An optional list of key-value pairs (:term:`channel_arguments`
- in gRPC Core runtime) to configure the channel.
- compression: An optional value indicating the compression method to be
- used over the lifetime of the channel. This is an EXPERIMENTAL option.
- interceptors: An optional sequence of interceptors that will be executed for
- any call executed with this channel.
-
- Returns:
- An aio.Channel.
- """
- return Channel(target, () if options is None else options,
- credentials._credentials, compression, interceptors)
+# Copyright 2019 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+"""Invocation-side implementation of gRPC Asyncio Python."""
+
+import asyncio
+import sys
+from typing import Any, Iterable, Optional, Sequence, List
+
+import grpc
+from grpc import _common, _compression, _grpcio_metadata
+from grpc._cython import cygrpc
+
+from . import _base_call, _base_channel
+from ._call import (StreamStreamCall, StreamUnaryCall, UnaryStreamCall,
+ UnaryUnaryCall)
+from ._interceptor import (
+ InterceptedUnaryUnaryCall, InterceptedUnaryStreamCall,
+ InterceptedStreamUnaryCall, InterceptedStreamStreamCall, ClientInterceptor,
+ UnaryUnaryClientInterceptor, UnaryStreamClientInterceptor,
+ StreamUnaryClientInterceptor, StreamStreamClientInterceptor)
+from ._metadata import Metadata
+from ._typing import (ChannelArgumentType, DeserializingFunction,
+ SerializingFunction, RequestIterableType)
+from ._utils import _timeout_to_deadline
+
+_USER_AGENT = 'grpc-python-asyncio/{}'.format(_grpcio_metadata.__version__)
+
+if sys.version_info[1] < 7:
+
+ def _all_tasks() -> Iterable[asyncio.Task]:
+ return asyncio.Task.all_tasks()
+else:
+
+ def _all_tasks() -> Iterable[asyncio.Task]:
+ return asyncio.all_tasks()
+
+
+def _augment_channel_arguments(base_options: ChannelArgumentType,
+ compression: Optional[grpc.Compression]):
+ compression_channel_argument = _compression.create_channel_option(
+ compression)
+ user_agent_channel_argument = ((
+ cygrpc.ChannelArgKey.primary_user_agent_string,
+ _USER_AGENT,
+ ),)
+ return tuple(base_options
+ ) + compression_channel_argument + user_agent_channel_argument
+
+
+class _BaseMultiCallable:
+ """Base class of all multi callable objects.
+
+ Handles the initialization logic and stores common attributes.
+ """
+ _loop: asyncio.AbstractEventLoop
+ _channel: cygrpc.AioChannel
+ _method: bytes
+ _request_serializer: SerializingFunction
+ _response_deserializer: DeserializingFunction
+ _interceptors: Optional[Sequence[ClientInterceptor]]
+ _loop: asyncio.AbstractEventLoop
+
+ # pylint: disable=too-many-arguments
+ def __init__(
+ self,
+ channel: cygrpc.AioChannel,
+ method: bytes,
+ request_serializer: SerializingFunction,
+ response_deserializer: DeserializingFunction,
+ interceptors: Optional[Sequence[ClientInterceptor]],
+ loop: asyncio.AbstractEventLoop,
+ ) -> None:
+ self._loop = loop
+ self._channel = channel
+ self._method = method
+ self._request_serializer = request_serializer
+ self._response_deserializer = response_deserializer
+ self._interceptors = interceptors
+
+ @staticmethod
+ def _init_metadata(metadata: Optional[Metadata] = None,
+ compression: Optional[grpc.Compression] = None
+ ) -> Metadata:
+ """Based on the provided values for <metadata> or <compression> initialise the final
+ metadata, as it should be used for the current call.
+ """
+ metadata = metadata or Metadata()
+ if compression:
+ metadata = Metadata(
+ *_compression.augment_metadata(metadata, compression))
+ return metadata
+
+
+class UnaryUnaryMultiCallable(_BaseMultiCallable,
+ _base_channel.UnaryUnaryMultiCallable):
+
+ def __call__(self,
+ request: Any,
+ *,
+ timeout: Optional[float] = None,
+ metadata: Optional[Metadata] = None,
+ credentials: Optional[grpc.CallCredentials] = None,
+ wait_for_ready: Optional[bool] = None,
+ compression: Optional[grpc.Compression] = None
+ ) -> _base_call.UnaryUnaryCall:
+
+ metadata = self._init_metadata(metadata, compression)
+ if not self._interceptors:
+ call = UnaryUnaryCall(request, _timeout_to_deadline(timeout),
+ metadata, credentials, wait_for_ready,
+ self._channel, self._method,
+ self._request_serializer,
+ self._response_deserializer, self._loop)
+ else:
+ call = InterceptedUnaryUnaryCall(
+ self._interceptors, request, timeout, metadata, credentials,
+ wait_for_ready, self._channel, self._method,
+ self._request_serializer, self._response_deserializer,
+ self._loop)
+
+ return call
+
+
+class UnaryStreamMultiCallable(_BaseMultiCallable,
+ _base_channel.UnaryStreamMultiCallable):
+
+ def __call__(self,
+ request: Any,
+ *,
+ timeout: Optional[float] = None,
+ metadata: Optional[Metadata] = None,
+ credentials: Optional[grpc.CallCredentials] = None,
+ wait_for_ready: Optional[bool] = None,
+ compression: Optional[grpc.Compression] = None
+ ) -> _base_call.UnaryStreamCall:
+
+ metadata = self._init_metadata(metadata, compression)
+ deadline = _timeout_to_deadline(timeout)
+
+ if not self._interceptors:
+ call = UnaryStreamCall(request, deadline, metadata, credentials,
+ wait_for_ready, self._channel, self._method,
+ self._request_serializer,
+ self._response_deserializer, self._loop)
+ else:
+ call = InterceptedUnaryStreamCall(
+ self._interceptors, request, deadline, metadata, credentials,
+ wait_for_ready, self._channel, self._method,
+ self._request_serializer, self._response_deserializer,
+ self._loop)
+
+ return call
+
+
+class StreamUnaryMultiCallable(_BaseMultiCallable,
+ _base_channel.StreamUnaryMultiCallable):
+
+ def __call__(self,
+ request_iterator: Optional[RequestIterableType] = None,
+ timeout: Optional[float] = None,
+ metadata: Optional[Metadata] = None,
+ credentials: Optional[grpc.CallCredentials] = None,
+ wait_for_ready: Optional[bool] = None,
+ compression: Optional[grpc.Compression] = None
+ ) -> _base_call.StreamUnaryCall:
+
+ metadata = self._init_metadata(metadata, compression)
+ deadline = _timeout_to_deadline(timeout)
+
+ if not self._interceptors:
+ call = StreamUnaryCall(request_iterator, deadline, metadata,
+ credentials, wait_for_ready, self._channel,
+ self._method, self._request_serializer,
+ self._response_deserializer, self._loop)
+ else:
+ call = InterceptedStreamUnaryCall(
+ self._interceptors, request_iterator, deadline, metadata,
+ credentials, wait_for_ready, self._channel, self._method,
+ self._request_serializer, self._response_deserializer,
+ self._loop)
+
+ return call
+
+
+class StreamStreamMultiCallable(_BaseMultiCallable,
+ _base_channel.StreamStreamMultiCallable):
+
+ def __call__(self,
+ request_iterator: Optional[RequestIterableType] = None,
+ timeout: Optional[float] = None,
+ metadata: Optional[Metadata] = None,
+ credentials: Optional[grpc.CallCredentials] = None,
+ wait_for_ready: Optional[bool] = None,
+ compression: Optional[grpc.Compression] = None
+ ) -> _base_call.StreamStreamCall:
+
+ metadata = self._init_metadata(metadata, compression)
+ deadline = _timeout_to_deadline(timeout)
+
+ if not self._interceptors:
+ call = StreamStreamCall(request_iterator, deadline, metadata,
+ credentials, wait_for_ready, self._channel,
+ self._method, self._request_serializer,
+ self._response_deserializer, self._loop)
+ else:
+ call = InterceptedStreamStreamCall(
+ self._interceptors, request_iterator, deadline, metadata,
+ credentials, wait_for_ready, self._channel, self._method,
+ self._request_serializer, self._response_deserializer,
+ self._loop)
+
+ return call
+
+
+class Channel(_base_channel.Channel):
+ _loop: asyncio.AbstractEventLoop
+ _channel: cygrpc.AioChannel
+ _unary_unary_interceptors: List[UnaryUnaryClientInterceptor]
+ _unary_stream_interceptors: List[UnaryStreamClientInterceptor]
+ _stream_unary_interceptors: List[StreamUnaryClientInterceptor]
+ _stream_stream_interceptors: List[StreamStreamClientInterceptor]
+
+ def __init__(self, target: str, options: ChannelArgumentType,
+ credentials: Optional[grpc.ChannelCredentials],
+ compression: Optional[grpc.Compression],
+ interceptors: Optional[Sequence[ClientInterceptor]]):
+ """Constructor.
+
+ Args:
+ target: The target to which to connect.
+ options: Configuration options for the channel.
+ credentials: A cygrpc.ChannelCredentials or None.
+ compression: An optional value indicating the compression method to be
+ used over the lifetime of the channel.
+ interceptors: An optional list of interceptors that would be used for
+ intercepting any RPC executed with that channel.
+ """
+ self._unary_unary_interceptors = []
+ self._unary_stream_interceptors = []
+ self._stream_unary_interceptors = []
+ self._stream_stream_interceptors = []
+
+ if interceptors is not None:
+ for interceptor in interceptors:
+ if isinstance(interceptor, UnaryUnaryClientInterceptor):
+ self._unary_unary_interceptors.append(interceptor)
+ elif isinstance(interceptor, UnaryStreamClientInterceptor):
+ self._unary_stream_interceptors.append(interceptor)
+ elif isinstance(interceptor, StreamUnaryClientInterceptor):
+ self._stream_unary_interceptors.append(interceptor)
+ elif isinstance(interceptor, StreamStreamClientInterceptor):
+ self._stream_stream_interceptors.append(interceptor)
+ else:
+ raise ValueError(
+ "Interceptor {} must be ".format(interceptor) +
+ "{} or ".format(UnaryUnaryClientInterceptor.__name__) +
+ "{} or ".format(UnaryStreamClientInterceptor.__name__) +
+ "{} or ".format(StreamUnaryClientInterceptor.__name__) +
+ "{}. ".format(StreamStreamClientInterceptor.__name__))
+
+ self._loop = cygrpc.get_working_loop()
+ self._channel = cygrpc.AioChannel(
+ _common.encode(target),
+ _augment_channel_arguments(options, compression), credentials,
+ self._loop)
+
+ async def __aenter__(self):
+ return self
+
+ async def __aexit__(self, exc_type, exc_val, exc_tb):
+ await self._close(None)
+
+ async def _close(self, grace): # pylint: disable=too-many-branches
+ if self._channel.closed():
+ return
+
+ # No new calls will be accepted by the Cython channel.
+ self._channel.closing()
+
+ # Iterate through running tasks
+ tasks = _all_tasks()
+ calls = []
+ call_tasks = []
+ for task in tasks:
+ try:
+ stack = task.get_stack(limit=1)
+ except AttributeError as attribute_error:
+ # NOTE(lidiz) tl;dr: If the Task is created with a CPython
+ # object, it will trigger AttributeError.
+ #
+ # In the global finalizer, the event loop schedules
+ # a CPython PyAsyncGenAThrow object.
+ # https://github.com/python/cpython/blob/00e45877e33d32bb61aa13a2033e3bba370bda4d/Lib/asyncio/base_events.py#L484
+ #
+ # However, the PyAsyncGenAThrow object is written in C and
+ # failed to include the normal Python frame objects. Hence,
+ # this exception is a false negative, and it is safe to ignore
+ # the failure. It is fixed by https://github.com/python/cpython/pull/18669,
+ # but not available until 3.9 or 3.8.3. So, we have to keep it
+ # for a while.
+ # TODO(lidiz) drop this hack after 3.8 deprecation
+ if 'frame' in str(attribute_error):
+ continue
+ else:
+ raise
+
+ # If the Task is created by a C-extension, the stack will be empty.
+ if not stack:
+ continue
+
+ # Locate ones created by `aio.Call`.
+ frame = stack[0]
+ candidate = frame.f_locals.get('self')
+ if candidate:
+ if isinstance(candidate, _base_call.Call):
+ if hasattr(candidate, '_channel'):
+ # For intercepted Call object
+ if candidate._channel is not self._channel:
+ continue
+ elif hasattr(candidate, '_cython_call'):
+ # For normal Call object
+ if candidate._cython_call._channel is not self._channel:
+ continue
+ else:
+ # Unidentified Call object
+ raise cygrpc.InternalError(
+ f'Unrecognized call object: {candidate}')
+
+ calls.append(candidate)
+ call_tasks.append(task)
+
+ # If needed, try to wait for them to finish.
+ # Call objects are not always awaitables.
+ if grace and call_tasks:
+ await asyncio.wait(call_tasks, timeout=grace, loop=self._loop)
+
+ # Time to cancel existing calls.
+ for call in calls:
+ call.cancel()
+
+ # Destroy the channel
+ self._channel.close()
+
+ async def close(self, grace: Optional[float] = None):
+ await self._close(grace)
+
+ def get_state(self,
+ try_to_connect: bool = False) -> grpc.ChannelConnectivity:
+ result = self._channel.check_connectivity_state(try_to_connect)
+ return _common.CYGRPC_CONNECTIVITY_STATE_TO_CHANNEL_CONNECTIVITY[result]
+
+ async def wait_for_state_change(
+ self,
+ last_observed_state: grpc.ChannelConnectivity,
+ ) -> None:
+ assert await self._channel.watch_connectivity_state(
+ last_observed_state.value[0], None)
+
+ async def channel_ready(self) -> None:
+ state = self.get_state(try_to_connect=True)
+ while state != grpc.ChannelConnectivity.READY:
+ await self.wait_for_state_change(state)
+ state = self.get_state(try_to_connect=True)
+
+ def unary_unary(
+ self,
+ method: str,
+ request_serializer: Optional[SerializingFunction] = None,
+ response_deserializer: Optional[DeserializingFunction] = None
+ ) -> UnaryUnaryMultiCallable:
+ return UnaryUnaryMultiCallable(self._channel, _common.encode(method),
+ request_serializer,
+ response_deserializer,
+ self._unary_unary_interceptors,
+ self._loop)
+
+ def unary_stream(
+ self,
+ method: str,
+ request_serializer: Optional[SerializingFunction] = None,
+ response_deserializer: Optional[DeserializingFunction] = None
+ ) -> UnaryStreamMultiCallable:
+ return UnaryStreamMultiCallable(self._channel, _common.encode(method),
+ request_serializer,
+ response_deserializer,
+ self._unary_stream_interceptors,
+ self._loop)
+
+ def stream_unary(
+ self,
+ method: str,
+ request_serializer: Optional[SerializingFunction] = None,
+ response_deserializer: Optional[DeserializingFunction] = None
+ ) -> StreamUnaryMultiCallable:
+ return StreamUnaryMultiCallable(self._channel, _common.encode(method),
+ request_serializer,
+ response_deserializer,
+ self._stream_unary_interceptors,
+ self._loop)
+
+ def stream_stream(
+ self,
+ method: str,
+ request_serializer: Optional[SerializingFunction] = None,
+ response_deserializer: Optional[DeserializingFunction] = None
+ ) -> StreamStreamMultiCallable:
+ return StreamStreamMultiCallable(self._channel, _common.encode(method),
+ request_serializer,
+ response_deserializer,
+ self._stream_stream_interceptors,
+ self._loop)
+
+
+def insecure_channel(
+ target: str,
+ options: Optional[ChannelArgumentType] = None,
+ compression: Optional[grpc.Compression] = None,
+ interceptors: Optional[Sequence[ClientInterceptor]] = None):
+ """Creates an insecure asynchronous Channel to a server.
+
+ Args:
+ target: The server address
+ options: An optional list of key-value pairs (:term:`channel_arguments`
+ in gRPC Core runtime) to configure the channel.
+ compression: An optional value indicating the compression method to be
+ used over the lifetime of the channel. This is an EXPERIMENTAL option.
+ interceptors: An optional sequence of interceptors that will be executed for
+ any call executed with this channel.
+
+ Returns:
+ A Channel.
+ """
+ return Channel(target, () if options is None else options, None,
+ compression, interceptors)
+
+
+def secure_channel(target: str,
+ credentials: grpc.ChannelCredentials,
+ options: Optional[ChannelArgumentType] = None,
+ compression: Optional[grpc.Compression] = None,
+ interceptors: Optional[Sequence[ClientInterceptor]] = None):
+ """Creates a secure asynchronous Channel to a server.
+
+ Args:
+ target: The server address.
+ credentials: A ChannelCredentials instance.
+ options: An optional list of key-value pairs (:term:`channel_arguments`
+ in gRPC Core runtime) to configure the channel.
+ compression: An optional value indicating the compression method to be
+ used over the lifetime of the channel. This is an EXPERIMENTAL option.
+ interceptors: An optional sequence of interceptors that will be executed for
+ any call executed with this channel.
+
+ Returns:
+ An aio.Channel.
+ """
+ return Channel(target, () if options is None else options,
+ credentials._credentials, compression, interceptors)
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/aio/_interceptor.py b/contrib/libs/grpc/src/python/grpcio/grpc/aio/_interceptor.py
index 6f899cd461c..80e9625c553 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/aio/_interceptor.py
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/aio/_interceptor.py
@@ -1,987 +1,987 @@
-# Copyright 2019 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-"""Interceptors implementation of gRPC Asyncio Python."""
-import asyncio
-import collections
-import functools
-from abc import ABCMeta, abstractmethod
-from typing import Callable, Optional, Iterator, Sequence, Union, Awaitable, AsyncIterable
-
-import grpc
-from grpc._cython import cygrpc
-
-from . import _base_call
-from ._call import UnaryUnaryCall, UnaryStreamCall, StreamUnaryCall, StreamStreamCall, AioRpcError
-from ._call import _RPC_ALREADY_FINISHED_DETAILS, _RPC_HALF_CLOSED_DETAILS
-from ._call import _API_STYLE_ERROR
-from ._utils import _timeout_to_deadline
-from ._typing import (RequestType, SerializingFunction, DeserializingFunction,
- ResponseType, DoneCallbackType, RequestIterableType,
- ResponseIterableType)
-from ._metadata import Metadata
-
-_LOCAL_CANCELLATION_DETAILS = 'Locally cancelled by application!'
-
-
-class ServerInterceptor(metaclass=ABCMeta):
- """Affords intercepting incoming RPCs on the service-side.
-
- This is an EXPERIMENTAL API.
- """
-
- @abstractmethod
- async def intercept_service(
- self, continuation: Callable[[grpc.HandlerCallDetails], Awaitable[
- grpc.RpcMethodHandler]],
- handler_call_details: grpc.HandlerCallDetails
- ) -> grpc.RpcMethodHandler:
- """Intercepts incoming RPCs before handing them over to a handler.
-
- Args:
- continuation: A function that takes a HandlerCallDetails and
- proceeds to invoke the next interceptor in the chain, if any,
- or the RPC handler lookup logic, with the call details passed
- as an argument, and returns an RpcMethodHandler instance if
- the RPC is considered serviced, or None otherwise.
- handler_call_details: A HandlerCallDetails describing the RPC.
-
- Returns:
- An RpcMethodHandler with which the RPC may be serviced if the
- interceptor chooses to service this RPC, or None otherwise.
- """
-
-
-class ClientCallDetails(
- collections.namedtuple(
- 'ClientCallDetails',
- ('method', 'timeout', 'metadata', 'credentials', 'wait_for_ready')),
- grpc.ClientCallDetails):
- """Describes an RPC to be invoked.
-
- This is an EXPERIMENTAL API.
-
- Args:
- method: The method name of the RPC.
- timeout: An optional duration of time in seconds to allow for the RPC.
- metadata: Optional metadata to be transmitted to the service-side of
- the RPC.
- credentials: An optional CallCredentials for the RPC.
- wait_for_ready: This is an EXPERIMENTAL argument. An optional
- flag to enable :term:`wait_for_ready` mechanism.
- """
-
- method: str
- timeout: Optional[float]
- metadata: Optional[Metadata]
- credentials: Optional[grpc.CallCredentials]
- wait_for_ready: Optional[bool]
-
-
-class ClientInterceptor(metaclass=ABCMeta):
- """Base class used for all Aio Client Interceptor classes"""
-
-
-class UnaryUnaryClientInterceptor(ClientInterceptor, metaclass=ABCMeta):
- """Affords intercepting unary-unary invocations."""
-
- @abstractmethod
- async def intercept_unary_unary(
- self, continuation: Callable[[ClientCallDetails, RequestType],
- UnaryUnaryCall],
- client_call_details: ClientCallDetails,
- request: RequestType) -> Union[UnaryUnaryCall, ResponseType]:
- """Intercepts a unary-unary invocation asynchronously.
-
- Args:
- continuation: A coroutine that proceeds with the invocation by
- executing the next interceptor in the chain or invoking the
- actual RPC on the underlying Channel. It is the interceptor's
- responsibility to call it if it decides to move the RPC forward.
- The interceptor can use
- `call = await continuation(client_call_details, request)`
- to continue with the RPC. `continuation` returns the call to the
- RPC.
- client_call_details: A ClientCallDetails object describing the
- outgoing RPC.
- request: The request value for the RPC.
-
- Returns:
- An object with the RPC response.
-
- Raises:
- AioRpcError: Indicating that the RPC terminated with non-OK status.
- asyncio.CancelledError: Indicating that the RPC was canceled.
- """
-
-
-class UnaryStreamClientInterceptor(ClientInterceptor, metaclass=ABCMeta):
- """Affords intercepting unary-stream invocations."""
-
- @abstractmethod
- async def intercept_unary_stream(
- self, continuation: Callable[[ClientCallDetails, RequestType],
- UnaryStreamCall],
- client_call_details: ClientCallDetails, request: RequestType
- ) -> Union[ResponseIterableType, UnaryStreamCall]:
- """Intercepts a unary-stream invocation asynchronously.
-
- The function could return the call object or an asynchronous
- iterator, in case of being an asyncrhonous iterator this will
- become the source of the reads done by the caller.
-
- Args:
- continuation: A coroutine that proceeds with the invocation by
- executing the next interceptor in the chain or invoking the
- actual RPC on the underlying Channel. It is the interceptor's
- responsibility to call it if it decides to move the RPC forward.
- The interceptor can use
- `call = await continuation(client_call_details, request)`
- to continue with the RPC. `continuation` returns the call to the
- RPC.
- client_call_details: A ClientCallDetails object describing the
- outgoing RPC.
- request: The request value for the RPC.
-
- Returns:
- The RPC Call or an asynchronous iterator.
-
- Raises:
- AioRpcError: Indicating that the RPC terminated with non-OK status.
- asyncio.CancelledError: Indicating that the RPC was canceled.
- """
-
-
-class StreamUnaryClientInterceptor(ClientInterceptor, metaclass=ABCMeta):
- """Affords intercepting stream-unary invocations."""
-
- @abstractmethod
- async def intercept_stream_unary(
- self,
- continuation: Callable[[ClientCallDetails, RequestType],
- UnaryStreamCall],
- client_call_details: ClientCallDetails,
- request_iterator: RequestIterableType,
- ) -> StreamUnaryCall:
- """Intercepts a stream-unary invocation asynchronously.
-
- Within the interceptor the usage of the call methods like `write` or
- even awaiting the call should be done carefully, since the caller
- could be expecting an untouched call, for example for start writing
- messages to it.
-
- Args:
- continuation: A coroutine that proceeds with the invocation by
- executing the next interceptor in the chain or invoking the
- actual RPC on the underlying Channel. It is the interceptor's
- responsibility to call it if it decides to move the RPC forward.
- The interceptor can use
- `call = await continuation(client_call_details, request_iterator)`
- to continue with the RPC. `continuation` returns the call to the
- RPC.
- client_call_details: A ClientCallDetails object describing the
- outgoing RPC.
- request_iterator: The request iterator that will produce requests
- for the RPC.
-
- Returns:
- The RPC Call.
-
- Raises:
- AioRpcError: Indicating that the RPC terminated with non-OK status.
- asyncio.CancelledError: Indicating that the RPC was canceled.
- """
-
-
-class StreamStreamClientInterceptor(ClientInterceptor, metaclass=ABCMeta):
- """Affords intercepting stream-stream invocations."""
-
- @abstractmethod
- async def intercept_stream_stream(
- self,
- continuation: Callable[[ClientCallDetails, RequestType],
- UnaryStreamCall],
- client_call_details: ClientCallDetails,
- request_iterator: RequestIterableType,
- ) -> Union[ResponseIterableType, StreamStreamCall]:
- """Intercepts a stream-stream invocation asynchronously.
-
- Within the interceptor the usage of the call methods like `write` or
- even awaiting the call should be done carefully, since the caller
- could be expecting an untouched call, for example for start writing
- messages to it.
-
- The function could return the call object or an asynchronous
- iterator, in case of being an asyncrhonous iterator this will
- become the source of the reads done by the caller.
-
- Args:
- continuation: A coroutine that proceeds with the invocation by
- executing the next interceptor in the chain or invoking the
- actual RPC on the underlying Channel. It is the interceptor's
- responsibility to call it if it decides to move the RPC forward.
- The interceptor can use
- `call = await continuation(client_call_details, request_iterator)`
- to continue with the RPC. `continuation` returns the call to the
- RPC.
- client_call_details: A ClientCallDetails object describing the
- outgoing RPC.
- request_iterator: The request iterator that will produce requests
- for the RPC.
-
- Returns:
- The RPC Call or an asynchronous iterator.
-
- Raises:
- AioRpcError: Indicating that the RPC terminated with non-OK status.
- asyncio.CancelledError: Indicating that the RPC was canceled.
- """
-
-
-class InterceptedCall:
- """Base implementation for all intercepted call arities.
-
- Interceptors might have some work to do before the RPC invocation with
- the capacity of changing the invocation parameters, and some work to do
- after the RPC invocation with the capacity for accessing to the wrapped
- `UnaryUnaryCall`.
-
- It handles also early and later cancellations, when the RPC has not even
- started and the execution is still held by the interceptors or when the
- RPC has finished but again the execution is still held by the interceptors.
-
- Once the RPC is finally executed, all methods are finally done against the
- intercepted call, being at the same time the same call returned to the
- interceptors.
-
- As a base class for all of the interceptors implements the logic around
- final status, metadata and cancellation.
- """
-
- _interceptors_task: asyncio.Task
- _pending_add_done_callbacks: Sequence[DoneCallbackType]
-
- def __init__(self, interceptors_task: asyncio.Task) -> None:
- self._interceptors_task = interceptors_task
- self._pending_add_done_callbacks = []
- self._interceptors_task.add_done_callback(
- self._fire_or_add_pending_done_callbacks)
-
- def __del__(self):
- self.cancel()
-
- def _fire_or_add_pending_done_callbacks(self,
- interceptors_task: asyncio.Task
- ) -> None:
-
- if not self._pending_add_done_callbacks:
- return
-
- call_completed = False
-
- try:
- call = interceptors_task.result()
- if call.done():
- call_completed = True
- except (AioRpcError, asyncio.CancelledError):
- call_completed = True
-
- if call_completed:
- for callback in self._pending_add_done_callbacks:
- callback(self)
- else:
- for callback in self._pending_add_done_callbacks:
- callback = functools.partial(self._wrap_add_done_callback,
- callback)
- call.add_done_callback(callback)
-
- self._pending_add_done_callbacks = []
-
- def _wrap_add_done_callback(self, callback: DoneCallbackType,
- unused_call: _base_call.Call) -> None:
- callback(self)
-
- def cancel(self) -> bool:
- if not self._interceptors_task.done():
- # There is no yet the intercepted call available,
- # Trying to cancel it by using the generic Asyncio
- # cancellation method.
- return self._interceptors_task.cancel()
-
- try:
- call = self._interceptors_task.result()
- except AioRpcError:
- return False
- except asyncio.CancelledError:
- return False
-
- return call.cancel()
-
- def cancelled(self) -> bool:
- if not self._interceptors_task.done():
- return False
-
- try:
- call = self._interceptors_task.result()
- except AioRpcError as err:
- return err.code() == grpc.StatusCode.CANCELLED
- except asyncio.CancelledError:
- return True
-
- return call.cancelled()
-
- def done(self) -> bool:
- if not self._interceptors_task.done():
- return False
-
- try:
- call = self._interceptors_task.result()
- except (AioRpcError, asyncio.CancelledError):
- return True
-
- return call.done()
-
- def add_done_callback(self, callback: DoneCallbackType) -> None:
- if not self._interceptors_task.done():
- self._pending_add_done_callbacks.append(callback)
- return
-
- try:
- call = self._interceptors_task.result()
- except (AioRpcError, asyncio.CancelledError):
- callback(self)
- return
-
- if call.done():
- callback(self)
- else:
- callback = functools.partial(self._wrap_add_done_callback, callback)
- call.add_done_callback(callback)
-
- def time_remaining(self) -> Optional[float]:
- raise NotImplementedError()
-
- async def initial_metadata(self) -> Optional[Metadata]:
- try:
- call = await self._interceptors_task
- except AioRpcError as err:
- return err.initial_metadata()
- except asyncio.CancelledError:
- return None
-
- return await call.initial_metadata()
-
- async def trailing_metadata(self) -> Optional[Metadata]:
- try:
- call = await self._interceptors_task
- except AioRpcError as err:
- return err.trailing_metadata()
- except asyncio.CancelledError:
- return None
-
- return await call.trailing_metadata()
-
- async def code(self) -> grpc.StatusCode:
- try:
- call = await self._interceptors_task
- except AioRpcError as err:
- return err.code()
- except asyncio.CancelledError:
- return grpc.StatusCode.CANCELLED
-
- return await call.code()
-
- async def details(self) -> str:
- try:
- call = await self._interceptors_task
- except AioRpcError as err:
- return err.details()
- except asyncio.CancelledError:
- return _LOCAL_CANCELLATION_DETAILS
-
- return await call.details()
-
- async def debug_error_string(self) -> Optional[str]:
- try:
- call = await self._interceptors_task
- except AioRpcError as err:
- return err.debug_error_string()
- except asyncio.CancelledError:
- return ''
-
- return await call.debug_error_string()
-
- async def wait_for_connection(self) -> None:
- call = await self._interceptors_task
- return await call.wait_for_connection()
-
-
-class _InterceptedUnaryResponseMixin:
-
- def __await__(self):
- call = yield from self._interceptors_task.__await__()
- response = yield from call.__await__()
- return response
-
-
-class _InterceptedStreamResponseMixin:
- _response_aiter: Optional[AsyncIterable[ResponseType]]
-
- def _init_stream_response_mixin(self) -> None:
- # Is initalized later, otherwise if the iterator is not finnally
- # consumed a logging warning is emmited by Asyncio.
- self._response_aiter = None
-
- async def _wait_for_interceptor_task_response_iterator(self
- ) -> ResponseType:
- call = await self._interceptors_task
- async for response in call:
- yield response
-
- def __aiter__(self) -> AsyncIterable[ResponseType]:
- if self._response_aiter is None:
- self._response_aiter = self._wait_for_interceptor_task_response_iterator(
- )
- return self._response_aiter
-
- async def read(self) -> ResponseType:
- if self._response_aiter is None:
- self._response_aiter = self._wait_for_interceptor_task_response_iterator(
- )
- return await self._response_aiter.asend(None)
-
-
-class _InterceptedStreamRequestMixin:
-
- _write_to_iterator_async_gen: Optional[AsyncIterable[RequestType]]
- _write_to_iterator_queue: Optional[asyncio.Queue]
-
- _FINISH_ITERATOR_SENTINEL = object()
-
- def _init_stream_request_mixin(
- self, request_iterator: Optional[RequestIterableType]
- ) -> RequestIterableType:
-
- if request_iterator is None:
- # We provide our own request iterator which is a proxy
- # of the futures writes that will be done by the caller.
- self._write_to_iterator_queue = asyncio.Queue(maxsize=1)
- self._write_to_iterator_async_gen = self._proxy_writes_as_request_iterator(
- )
- request_iterator = self._write_to_iterator_async_gen
- else:
- self._write_to_iterator_queue = None
-
- return request_iterator
-
- async def _proxy_writes_as_request_iterator(self):
- await self._interceptors_task
-
- while True:
- value = await self._write_to_iterator_queue.get()
- if value is _InterceptedStreamRequestMixin._FINISH_ITERATOR_SENTINEL:
- break
- yield value
-
- async def write(self, request: RequestType) -> None:
- # If no queue was created it means that requests
- # should be expected through an iterators provided
- # by the caller.
- if self._write_to_iterator_queue is None:
- raise cygrpc.UsageError(_API_STYLE_ERROR)
-
- try:
- call = await self._interceptors_task
- except (asyncio.CancelledError, AioRpcError):
- raise asyncio.InvalidStateError(_RPC_ALREADY_FINISHED_DETAILS)
-
- if call.done():
- raise asyncio.InvalidStateError(_RPC_ALREADY_FINISHED_DETAILS)
- elif call._done_writing_flag:
- raise asyncio.InvalidStateError(_RPC_HALF_CLOSED_DETAILS)
-
- # Write might never end up since the call could abrubtly finish,
- # we give up on the first awaitable object that finishes.
- _, _ = await asyncio.wait(
- (self._write_to_iterator_queue.put(request), call.code()),
- return_when=asyncio.FIRST_COMPLETED)
-
- if call.done():
- raise asyncio.InvalidStateError(_RPC_ALREADY_FINISHED_DETAILS)
-
- async def done_writing(self) -> None:
- """Signal peer that client is done writing.
-
- This method is idempotent.
- """
- # If no queue was created it means that requests
- # should be expected through an iterators provided
- # by the caller.
- if self._write_to_iterator_queue is None:
- raise cygrpc.UsageError(_API_STYLE_ERROR)
-
- try:
- call = await self._interceptors_task
- except asyncio.CancelledError:
- raise asyncio.InvalidStateError(_RPC_ALREADY_FINISHED_DETAILS)
-
- # Write might never end up since the call could abrubtly finish,
- # we give up on the first awaitable object that finishes.
- _, _ = await asyncio.wait((self._write_to_iterator_queue.put(
- _InterceptedStreamRequestMixin._FINISH_ITERATOR_SENTINEL),
- call.code()),
- return_when=asyncio.FIRST_COMPLETED)
-
-
-class InterceptedUnaryUnaryCall(_InterceptedUnaryResponseMixin, InterceptedCall,
- _base_call.UnaryUnaryCall):
- """Used for running a `UnaryUnaryCall` wrapped by interceptors.
-
- For the `__await__` method is it is proxied to the intercepted call only when
- the interceptor task is finished.
- """
-
- _loop: asyncio.AbstractEventLoop
- _channel: cygrpc.AioChannel
-
- # pylint: disable=too-many-arguments
- def __init__(self, interceptors: Sequence[UnaryUnaryClientInterceptor],
- request: RequestType, timeout: Optional[float],
- metadata: Metadata,
- credentials: Optional[grpc.CallCredentials],
- wait_for_ready: Optional[bool], channel: cygrpc.AioChannel,
- method: bytes, request_serializer: SerializingFunction,
- response_deserializer: DeserializingFunction,
- loop: asyncio.AbstractEventLoop) -> None:
- self._loop = loop
- self._channel = channel
- interceptors_task = loop.create_task(
- self._invoke(interceptors, method, timeout, metadata, credentials,
- wait_for_ready, request, request_serializer,
- response_deserializer))
- super().__init__(interceptors_task)
-
- # pylint: disable=too-many-arguments
- async def _invoke(self, interceptors: Sequence[UnaryUnaryClientInterceptor],
- method: bytes, timeout: Optional[float],
- metadata: Optional[Metadata],
- credentials: Optional[grpc.CallCredentials],
- wait_for_ready: Optional[bool], request: RequestType,
- request_serializer: SerializingFunction,
- response_deserializer: DeserializingFunction
- ) -> UnaryUnaryCall:
- """Run the RPC call wrapped in interceptors"""
-
- async def _run_interceptor(
- interceptors: Iterator[UnaryUnaryClientInterceptor],
- client_call_details: ClientCallDetails,
- request: RequestType) -> _base_call.UnaryUnaryCall:
-
- interceptor = next(interceptors, None)
-
- if interceptor:
- continuation = functools.partial(_run_interceptor, interceptors)
-
- call_or_response = await interceptor.intercept_unary_unary(
- continuation, client_call_details, request)
-
- if isinstance(call_or_response, _base_call.UnaryUnaryCall):
- return call_or_response
- else:
- return UnaryUnaryCallResponse(call_or_response)
-
- else:
- return UnaryUnaryCall(
- request, _timeout_to_deadline(client_call_details.timeout),
- client_call_details.metadata,
- client_call_details.credentials,
- client_call_details.wait_for_ready, self._channel,
- client_call_details.method, request_serializer,
- response_deserializer, self._loop)
-
- client_call_details = ClientCallDetails(method, timeout, metadata,
- credentials, wait_for_ready)
- return await _run_interceptor(iter(interceptors), client_call_details,
- request)
-
- def time_remaining(self) -> Optional[float]:
- raise NotImplementedError()
-
-
-class InterceptedUnaryStreamCall(_InterceptedStreamResponseMixin,
- InterceptedCall, _base_call.UnaryStreamCall):
- """Used for running a `UnaryStreamCall` wrapped by interceptors."""
-
- _loop: asyncio.AbstractEventLoop
- _channel: cygrpc.AioChannel
- _last_returned_call_from_interceptors = Optional[_base_call.UnaryStreamCall]
-
- # pylint: disable=too-many-arguments
- def __init__(self, interceptors: Sequence[UnaryStreamClientInterceptor],
- request: RequestType, timeout: Optional[float],
- metadata: Metadata,
- credentials: Optional[grpc.CallCredentials],
- wait_for_ready: Optional[bool], channel: cygrpc.AioChannel,
- method: bytes, request_serializer: SerializingFunction,
- response_deserializer: DeserializingFunction,
- loop: asyncio.AbstractEventLoop) -> None:
- self._loop = loop
- self._channel = channel
- self._init_stream_response_mixin()
- self._last_returned_call_from_interceptors = None
- interceptors_task = loop.create_task(
- self._invoke(interceptors, method, timeout, metadata, credentials,
- wait_for_ready, request, request_serializer,
- response_deserializer))
- super().__init__(interceptors_task)
-
- # pylint: disable=too-many-arguments
- async def _invoke(self, interceptors: Sequence[UnaryUnaryClientInterceptor],
- method: bytes, timeout: Optional[float],
- metadata: Optional[Metadata],
- credentials: Optional[grpc.CallCredentials],
- wait_for_ready: Optional[bool], request: RequestType,
- request_serializer: SerializingFunction,
- response_deserializer: DeserializingFunction
- ) -> UnaryStreamCall:
- """Run the RPC call wrapped in interceptors"""
-
- async def _run_interceptor(
- interceptors: Iterator[UnaryStreamClientInterceptor],
- client_call_details: ClientCallDetails,
- request: RequestType,
- ) -> _base_call.UnaryUnaryCall:
-
- interceptor = next(interceptors, None)
-
- if interceptor:
- continuation = functools.partial(_run_interceptor, interceptors)
-
- call_or_response_iterator = await interceptor.intercept_unary_stream(
- continuation, client_call_details, request)
-
- if isinstance(call_or_response_iterator,
- _base_call.UnaryStreamCall):
- self._last_returned_call_from_interceptors = call_or_response_iterator
- else:
- self._last_returned_call_from_interceptors = UnaryStreamCallResponseIterator(
- self._last_returned_call_from_interceptors,
- call_or_response_iterator)
- return self._last_returned_call_from_interceptors
- else:
- self._last_returned_call_from_interceptors = UnaryStreamCall(
- request, _timeout_to_deadline(client_call_details.timeout),
- client_call_details.metadata,
- client_call_details.credentials,
- client_call_details.wait_for_ready, self._channel,
- client_call_details.method, request_serializer,
- response_deserializer, self._loop)
-
- return self._last_returned_call_from_interceptors
-
- client_call_details = ClientCallDetails(method, timeout, metadata,
- credentials, wait_for_ready)
- return await _run_interceptor(iter(interceptors), client_call_details,
- request)
-
- def time_remaining(self) -> Optional[float]:
- raise NotImplementedError()
-
-
-class InterceptedStreamUnaryCall(_InterceptedUnaryResponseMixin,
- _InterceptedStreamRequestMixin,
- InterceptedCall, _base_call.StreamUnaryCall):
- """Used for running a `StreamUnaryCall` wrapped by interceptors.
-
- For the `__await__` method is it is proxied to the intercepted call only when
- the interceptor task is finished.
- """
-
- _loop: asyncio.AbstractEventLoop
- _channel: cygrpc.AioChannel
-
- # pylint: disable=too-many-arguments
- def __init__(self, interceptors: Sequence[StreamUnaryClientInterceptor],
- request_iterator: Optional[RequestIterableType],
- timeout: Optional[float], metadata: Metadata,
- credentials: Optional[grpc.CallCredentials],
- wait_for_ready: Optional[bool], channel: cygrpc.AioChannel,
- method: bytes, request_serializer: SerializingFunction,
- response_deserializer: DeserializingFunction,
- loop: asyncio.AbstractEventLoop) -> None:
- self._loop = loop
- self._channel = channel
- request_iterator = self._init_stream_request_mixin(request_iterator)
- interceptors_task = loop.create_task(
- self._invoke(interceptors, method, timeout, metadata, credentials,
- wait_for_ready, request_iterator, request_serializer,
- response_deserializer))
- super().__init__(interceptors_task)
-
- # pylint: disable=too-many-arguments
- async def _invoke(
- self, interceptors: Sequence[StreamUnaryClientInterceptor],
- method: bytes, timeout: Optional[float],
- metadata: Optional[Metadata],
- credentials: Optional[grpc.CallCredentials],
- wait_for_ready: Optional[bool],
- request_iterator: RequestIterableType,
- request_serializer: SerializingFunction,
- response_deserializer: DeserializingFunction) -> StreamUnaryCall:
- """Run the RPC call wrapped in interceptors"""
-
- async def _run_interceptor(
- interceptors: Iterator[UnaryUnaryClientInterceptor],
- client_call_details: ClientCallDetails,
- request_iterator: RequestIterableType
- ) -> _base_call.StreamUnaryCall:
-
- interceptor = next(interceptors, None)
-
- if interceptor:
- continuation = functools.partial(_run_interceptor, interceptors)
-
- return await interceptor.intercept_stream_unary(
- continuation, client_call_details, request_iterator)
- else:
- return StreamUnaryCall(
- request_iterator,
- _timeout_to_deadline(client_call_details.timeout),
- client_call_details.metadata,
- client_call_details.credentials,
- client_call_details.wait_for_ready, self._channel,
- client_call_details.method, request_serializer,
- response_deserializer, self._loop)
-
- client_call_details = ClientCallDetails(method, timeout, metadata,
- credentials, wait_for_ready)
- return await _run_interceptor(iter(interceptors), client_call_details,
- request_iterator)
-
- def time_remaining(self) -> Optional[float]:
- raise NotImplementedError()
-
-
-class InterceptedStreamStreamCall(_InterceptedStreamResponseMixin,
- _InterceptedStreamRequestMixin,
- InterceptedCall, _base_call.StreamStreamCall):
- """Used for running a `StreamStreamCall` wrapped by interceptors."""
-
- _loop: asyncio.AbstractEventLoop
- _channel: cygrpc.AioChannel
- _last_returned_call_from_interceptors = Optional[_base_call.UnaryStreamCall]
-
- # pylint: disable=too-many-arguments
- def __init__(self, interceptors: Sequence[StreamStreamClientInterceptor],
- request_iterator: Optional[RequestIterableType],
- timeout: Optional[float], metadata: Metadata,
- credentials: Optional[grpc.CallCredentials],
- wait_for_ready: Optional[bool], channel: cygrpc.AioChannel,
- method: bytes, request_serializer: SerializingFunction,
- response_deserializer: DeserializingFunction,
- loop: asyncio.AbstractEventLoop) -> None:
- self._loop = loop
- self._channel = channel
- self._init_stream_response_mixin()
- request_iterator = self._init_stream_request_mixin(request_iterator)
- self._last_returned_call_from_interceptors = None
- interceptors_task = loop.create_task(
- self._invoke(interceptors, method, timeout, metadata, credentials,
- wait_for_ready, request_iterator, request_serializer,
- response_deserializer))
- super().__init__(interceptors_task)
-
- # pylint: disable=too-many-arguments
- async def _invoke(
- self, interceptors: Sequence[StreamStreamClientInterceptor],
- method: bytes, timeout: Optional[float],
- metadata: Optional[Metadata],
- credentials: Optional[grpc.CallCredentials],
- wait_for_ready: Optional[bool],
- request_iterator: RequestIterableType,
- request_serializer: SerializingFunction,
- response_deserializer: DeserializingFunction) -> StreamStreamCall:
- """Run the RPC call wrapped in interceptors"""
-
- async def _run_interceptor(
- interceptors: Iterator[StreamStreamClientInterceptor],
- client_call_details: ClientCallDetails,
- request_iterator: RequestIterableType
- ) -> _base_call.StreamStreamCall:
-
- interceptor = next(interceptors, None)
-
- if interceptor:
- continuation = functools.partial(_run_interceptor, interceptors)
-
- call_or_response_iterator = await interceptor.intercept_stream_stream(
- continuation, client_call_details, request_iterator)
-
- if isinstance(call_or_response_iterator,
- _base_call.StreamStreamCall):
- self._last_returned_call_from_interceptors = call_or_response_iterator
- else:
- self._last_returned_call_from_interceptors = StreamStreamCallResponseIterator(
- self._last_returned_call_from_interceptors,
- call_or_response_iterator)
- return self._last_returned_call_from_interceptors
- else:
- self._last_returned_call_from_interceptors = StreamStreamCall(
- request_iterator,
- _timeout_to_deadline(client_call_details.timeout),
- client_call_details.metadata,
- client_call_details.credentials,
- client_call_details.wait_for_ready, self._channel,
- client_call_details.method, request_serializer,
- response_deserializer, self._loop)
- return self._last_returned_call_from_interceptors
-
- client_call_details = ClientCallDetails(method, timeout, metadata,
- credentials, wait_for_ready)
- return await _run_interceptor(iter(interceptors), client_call_details,
- request_iterator)
-
- def time_remaining(self) -> Optional[float]:
- raise NotImplementedError()
-
-
-class UnaryUnaryCallResponse(_base_call.UnaryUnaryCall):
- """Final UnaryUnaryCall class finished with a response."""
- _response: ResponseType
-
- def __init__(self, response: ResponseType) -> None:
- self._response = response
-
- def cancel(self) -> bool:
- return False
-
- def cancelled(self) -> bool:
- return False
-
- def done(self) -> bool:
- return True
-
- def add_done_callback(self, unused_callback) -> None:
- raise NotImplementedError()
-
- def time_remaining(self) -> Optional[float]:
- raise NotImplementedError()
-
- async def initial_metadata(self) -> Optional[Metadata]:
- return None
-
- async def trailing_metadata(self) -> Optional[Metadata]:
- return None
-
- async def code(self) -> grpc.StatusCode:
- return grpc.StatusCode.OK
-
- async def details(self) -> str:
- return ''
-
- async def debug_error_string(self) -> Optional[str]:
- return None
-
- def __await__(self):
- if False: # pylint: disable=using-constant-test
- # This code path is never used, but a yield statement is needed
- # for telling the interpreter that __await__ is a generator.
- yield None
- return self._response
-
- async def wait_for_connection(self) -> None:
- pass
-
-
-class _StreamCallResponseIterator:
-
- _call: Union[_base_call.UnaryStreamCall, _base_call.StreamStreamCall]
- _response_iterator: AsyncIterable[ResponseType]
-
- def __init__(self, call: Union[_base_call.UnaryStreamCall, _base_call.
- StreamStreamCall],
- response_iterator: AsyncIterable[ResponseType]) -> None:
- self._response_iterator = response_iterator
- self._call = call
-
- def cancel(self) -> bool:
- return self._call.cancel()
-
- def cancelled(self) -> bool:
- return self._call.cancelled()
-
- def done(self) -> bool:
- return self._call.done()
-
- def add_done_callback(self, callback) -> None:
- self._call.add_done_callback(callback)
-
- def time_remaining(self) -> Optional[float]:
- return self._call.time_remaining()
-
- async def initial_metadata(self) -> Optional[Metadata]:
- return await self._call.initial_metadata()
-
- async def trailing_metadata(self) -> Optional[Metadata]:
- return await self._call.trailing_metadata()
-
- async def code(self) -> grpc.StatusCode:
- return await self._call.code()
-
- async def details(self) -> str:
- return await self._call.details()
-
- async def debug_error_string(self) -> Optional[str]:
- return await self._call.debug_error_string()
-
- def __aiter__(self):
- return self._response_iterator.__aiter__()
-
- async def wait_for_connection(self) -> None:
- return await self._call.wait_for_connection()
-
-
-class UnaryStreamCallResponseIterator(_StreamCallResponseIterator,
- _base_call.UnaryStreamCall):
- """UnaryStreamCall class wich uses an alternative response iterator."""
-
- async def read(self) -> ResponseType:
- # Behind the scenes everyting goes through the
- # async iterator. So this path should not be reached.
- raise NotImplementedError()
-
-
-class StreamStreamCallResponseIterator(_StreamCallResponseIterator,
- _base_call.StreamStreamCall):
- """StreamStreamCall class wich uses an alternative response iterator."""
-
- async def read(self) -> ResponseType:
- # Behind the scenes everyting goes through the
- # async iterator. So this path should not be reached.
- raise NotImplementedError()
-
- async def write(self, request: RequestType) -> None:
- # Behind the scenes everyting goes through the
- # async iterator provided by the InterceptedStreamStreamCall.
- # So this path should not be reached.
- raise NotImplementedError()
-
- async def done_writing(self) -> None:
- # Behind the scenes everyting goes through the
- # async iterator provided by the InterceptedStreamStreamCall.
- # So this path should not be reached.
- raise NotImplementedError()
-
- @property
- def _done_writing_flag(self) -> bool:
- return self._call._done_writing_flag
+# Copyright 2019 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+"""Interceptors implementation of gRPC Asyncio Python."""
+import asyncio
+import collections
+import functools
+from abc import ABCMeta, abstractmethod
+from typing import Callable, Optional, Iterator, Sequence, Union, Awaitable, AsyncIterable
+
+import grpc
+from grpc._cython import cygrpc
+
+from . import _base_call
+from ._call import UnaryUnaryCall, UnaryStreamCall, StreamUnaryCall, StreamStreamCall, AioRpcError
+from ._call import _RPC_ALREADY_FINISHED_DETAILS, _RPC_HALF_CLOSED_DETAILS
+from ._call import _API_STYLE_ERROR
+from ._utils import _timeout_to_deadline
+from ._typing import (RequestType, SerializingFunction, DeserializingFunction,
+ ResponseType, DoneCallbackType, RequestIterableType,
+ ResponseIterableType)
+from ._metadata import Metadata
+
+_LOCAL_CANCELLATION_DETAILS = 'Locally cancelled by application!'
+
+
+class ServerInterceptor(metaclass=ABCMeta):
+ """Affords intercepting incoming RPCs on the service-side.
+
+ This is an EXPERIMENTAL API.
+ """
+
+ @abstractmethod
+ async def intercept_service(
+ self, continuation: Callable[[grpc.HandlerCallDetails], Awaitable[
+ grpc.RpcMethodHandler]],
+ handler_call_details: grpc.HandlerCallDetails
+ ) -> grpc.RpcMethodHandler:
+ """Intercepts incoming RPCs before handing them over to a handler.
+
+ Args:
+ continuation: A function that takes a HandlerCallDetails and
+ proceeds to invoke the next interceptor in the chain, if any,
+ or the RPC handler lookup logic, with the call details passed
+ as an argument, and returns an RpcMethodHandler instance if
+ the RPC is considered serviced, or None otherwise.
+ handler_call_details: A HandlerCallDetails describing the RPC.
+
+ Returns:
+ An RpcMethodHandler with which the RPC may be serviced if the
+ interceptor chooses to service this RPC, or None otherwise.
+ """
+
+
+class ClientCallDetails(
+ collections.namedtuple(
+ 'ClientCallDetails',
+ ('method', 'timeout', 'metadata', 'credentials', 'wait_for_ready')),
+ grpc.ClientCallDetails):
+ """Describes an RPC to be invoked.
+
+ This is an EXPERIMENTAL API.
+
+ Args:
+ method: The method name of the RPC.
+ timeout: An optional duration of time in seconds to allow for the RPC.
+ metadata: Optional metadata to be transmitted to the service-side of
+ the RPC.
+ credentials: An optional CallCredentials for the RPC.
+ wait_for_ready: This is an EXPERIMENTAL argument. An optional
+ flag to enable :term:`wait_for_ready` mechanism.
+ """
+
+ method: str
+ timeout: Optional[float]
+ metadata: Optional[Metadata]
+ credentials: Optional[grpc.CallCredentials]
+ wait_for_ready: Optional[bool]
+
+
+class ClientInterceptor(metaclass=ABCMeta):
+ """Base class used for all Aio Client Interceptor classes"""
+
+
+class UnaryUnaryClientInterceptor(ClientInterceptor, metaclass=ABCMeta):
+ """Affords intercepting unary-unary invocations."""
+
+ @abstractmethod
+ async def intercept_unary_unary(
+ self, continuation: Callable[[ClientCallDetails, RequestType],
+ UnaryUnaryCall],
+ client_call_details: ClientCallDetails,
+ request: RequestType) -> Union[UnaryUnaryCall, ResponseType]:
+ """Intercepts a unary-unary invocation asynchronously.
+
+ Args:
+ continuation: A coroutine that proceeds with the invocation by
+ executing the next interceptor in the chain or invoking the
+ actual RPC on the underlying Channel. It is the interceptor's
+ responsibility to call it if it decides to move the RPC forward.
+ The interceptor can use
+ `call = await continuation(client_call_details, request)`
+ to continue with the RPC. `continuation` returns the call to the
+ RPC.
+ client_call_details: A ClientCallDetails object describing the
+ outgoing RPC.
+ request: The request value for the RPC.
+
+ Returns:
+ An object with the RPC response.
+
+ Raises:
+ AioRpcError: Indicating that the RPC terminated with non-OK status.
+ asyncio.CancelledError: Indicating that the RPC was canceled.
+ """
+
+
+class UnaryStreamClientInterceptor(ClientInterceptor, metaclass=ABCMeta):
+ """Affords intercepting unary-stream invocations."""
+
+ @abstractmethod
+ async def intercept_unary_stream(
+ self, continuation: Callable[[ClientCallDetails, RequestType],
+ UnaryStreamCall],
+ client_call_details: ClientCallDetails, request: RequestType
+ ) -> Union[ResponseIterableType, UnaryStreamCall]:
+ """Intercepts a unary-stream invocation asynchronously.
+
+ The function could return the call object or an asynchronous
+ iterator, in case of being an asyncrhonous iterator this will
+ become the source of the reads done by the caller.
+
+ Args:
+ continuation: A coroutine that proceeds with the invocation by
+ executing the next interceptor in the chain or invoking the
+ actual RPC on the underlying Channel. It is the interceptor's
+ responsibility to call it if it decides to move the RPC forward.
+ The interceptor can use
+ `call = await continuation(client_call_details, request)`
+ to continue with the RPC. `continuation` returns the call to the
+ RPC.
+ client_call_details: A ClientCallDetails object describing the
+ outgoing RPC.
+ request: The request value for the RPC.
+
+ Returns:
+ The RPC Call or an asynchronous iterator.
+
+ Raises:
+ AioRpcError: Indicating that the RPC terminated with non-OK status.
+ asyncio.CancelledError: Indicating that the RPC was canceled.
+ """
+
+
+class StreamUnaryClientInterceptor(ClientInterceptor, metaclass=ABCMeta):
+ """Affords intercepting stream-unary invocations."""
+
+ @abstractmethod
+ async def intercept_stream_unary(
+ self,
+ continuation: Callable[[ClientCallDetails, RequestType],
+ UnaryStreamCall],
+ client_call_details: ClientCallDetails,
+ request_iterator: RequestIterableType,
+ ) -> StreamUnaryCall:
+ """Intercepts a stream-unary invocation asynchronously.
+
+ Within the interceptor the usage of the call methods like `write` or
+ even awaiting the call should be done carefully, since the caller
+ could be expecting an untouched call, for example for start writing
+ messages to it.
+
+ Args:
+ continuation: A coroutine that proceeds with the invocation by
+ executing the next interceptor in the chain or invoking the
+ actual RPC on the underlying Channel. It is the interceptor's
+ responsibility to call it if it decides to move the RPC forward.
+ The interceptor can use
+ `call = await continuation(client_call_details, request_iterator)`
+ to continue with the RPC. `continuation` returns the call to the
+ RPC.
+ client_call_details: A ClientCallDetails object describing the
+ outgoing RPC.
+ request_iterator: The request iterator that will produce requests
+ for the RPC.
+
+ Returns:
+ The RPC Call.
+
+ Raises:
+ AioRpcError: Indicating that the RPC terminated with non-OK status.
+ asyncio.CancelledError: Indicating that the RPC was canceled.
+ """
+
+
+class StreamStreamClientInterceptor(ClientInterceptor, metaclass=ABCMeta):
+ """Affords intercepting stream-stream invocations."""
+
+ @abstractmethod
+ async def intercept_stream_stream(
+ self,
+ continuation: Callable[[ClientCallDetails, RequestType],
+ UnaryStreamCall],
+ client_call_details: ClientCallDetails,
+ request_iterator: RequestIterableType,
+ ) -> Union[ResponseIterableType, StreamStreamCall]:
+ """Intercepts a stream-stream invocation asynchronously.
+
+ Within the interceptor the usage of the call methods like `write` or
+ even awaiting the call should be done carefully, since the caller
+ could be expecting an untouched call, for example for start writing
+ messages to it.
+
+ The function could return the call object or an asynchronous
+ iterator, in case of being an asyncrhonous iterator this will
+ become the source of the reads done by the caller.
+
+ Args:
+ continuation: A coroutine that proceeds with the invocation by
+ executing the next interceptor in the chain or invoking the
+ actual RPC on the underlying Channel. It is the interceptor's
+ responsibility to call it if it decides to move the RPC forward.
+ The interceptor can use
+ `call = await continuation(client_call_details, request_iterator)`
+ to continue with the RPC. `continuation` returns the call to the
+ RPC.
+ client_call_details: A ClientCallDetails object describing the
+ outgoing RPC.
+ request_iterator: The request iterator that will produce requests
+ for the RPC.
+
+ Returns:
+ The RPC Call or an asynchronous iterator.
+
+ Raises:
+ AioRpcError: Indicating that the RPC terminated with non-OK status.
+ asyncio.CancelledError: Indicating that the RPC was canceled.
+ """
+
+
+class InterceptedCall:
+ """Base implementation for all intercepted call arities.
+
+ Interceptors might have some work to do before the RPC invocation with
+ the capacity of changing the invocation parameters, and some work to do
+ after the RPC invocation with the capacity for accessing to the wrapped
+ `UnaryUnaryCall`.
+
+ It handles also early and later cancellations, when the RPC has not even
+ started and the execution is still held by the interceptors or when the
+ RPC has finished but again the execution is still held by the interceptors.
+
+ Once the RPC is finally executed, all methods are finally done against the
+ intercepted call, being at the same time the same call returned to the
+ interceptors.
+
+ As a base class for all of the interceptors implements the logic around
+ final status, metadata and cancellation.
+ """
+
+ _interceptors_task: asyncio.Task
+ _pending_add_done_callbacks: Sequence[DoneCallbackType]
+
+ def __init__(self, interceptors_task: asyncio.Task) -> None:
+ self._interceptors_task = interceptors_task
+ self._pending_add_done_callbacks = []
+ self._interceptors_task.add_done_callback(
+ self._fire_or_add_pending_done_callbacks)
+
+ def __del__(self):
+ self.cancel()
+
+ def _fire_or_add_pending_done_callbacks(self,
+ interceptors_task: asyncio.Task
+ ) -> None:
+
+ if not self._pending_add_done_callbacks:
+ return
+
+ call_completed = False
+
+ try:
+ call = interceptors_task.result()
+ if call.done():
+ call_completed = True
+ except (AioRpcError, asyncio.CancelledError):
+ call_completed = True
+
+ if call_completed:
+ for callback in self._pending_add_done_callbacks:
+ callback(self)
+ else:
+ for callback in self._pending_add_done_callbacks:
+ callback = functools.partial(self._wrap_add_done_callback,
+ callback)
+ call.add_done_callback(callback)
+
+ self._pending_add_done_callbacks = []
+
+ def _wrap_add_done_callback(self, callback: DoneCallbackType,
+ unused_call: _base_call.Call) -> None:
+ callback(self)
+
+ def cancel(self) -> bool:
+ if not self._interceptors_task.done():
+ # There is no yet the intercepted call available,
+ # Trying to cancel it by using the generic Asyncio
+ # cancellation method.
+ return self._interceptors_task.cancel()
+
+ try:
+ call = self._interceptors_task.result()
+ except AioRpcError:
+ return False
+ except asyncio.CancelledError:
+ return False
+
+ return call.cancel()
+
+ def cancelled(self) -> bool:
+ if not self._interceptors_task.done():
+ return False
+
+ try:
+ call = self._interceptors_task.result()
+ except AioRpcError as err:
+ return err.code() == grpc.StatusCode.CANCELLED
+ except asyncio.CancelledError:
+ return True
+
+ return call.cancelled()
+
+ def done(self) -> bool:
+ if not self._interceptors_task.done():
+ return False
+
+ try:
+ call = self._interceptors_task.result()
+ except (AioRpcError, asyncio.CancelledError):
+ return True
+
+ return call.done()
+
+ def add_done_callback(self, callback: DoneCallbackType) -> None:
+ if not self._interceptors_task.done():
+ self._pending_add_done_callbacks.append(callback)
+ return
+
+ try:
+ call = self._interceptors_task.result()
+ except (AioRpcError, asyncio.CancelledError):
+ callback(self)
+ return
+
+ if call.done():
+ callback(self)
+ else:
+ callback = functools.partial(self._wrap_add_done_callback, callback)
+ call.add_done_callback(callback)
+
+ def time_remaining(self) -> Optional[float]:
+ raise NotImplementedError()
+
+ async def initial_metadata(self) -> Optional[Metadata]:
+ try:
+ call = await self._interceptors_task
+ except AioRpcError as err:
+ return err.initial_metadata()
+ except asyncio.CancelledError:
+ return None
+
+ return await call.initial_metadata()
+
+ async def trailing_metadata(self) -> Optional[Metadata]:
+ try:
+ call = await self._interceptors_task
+ except AioRpcError as err:
+ return err.trailing_metadata()
+ except asyncio.CancelledError:
+ return None
+
+ return await call.trailing_metadata()
+
+ async def code(self) -> grpc.StatusCode:
+ try:
+ call = await self._interceptors_task
+ except AioRpcError as err:
+ return err.code()
+ except asyncio.CancelledError:
+ return grpc.StatusCode.CANCELLED
+
+ return await call.code()
+
+ async def details(self) -> str:
+ try:
+ call = await self._interceptors_task
+ except AioRpcError as err:
+ return err.details()
+ except asyncio.CancelledError:
+ return _LOCAL_CANCELLATION_DETAILS
+
+ return await call.details()
+
+ async def debug_error_string(self) -> Optional[str]:
+ try:
+ call = await self._interceptors_task
+ except AioRpcError as err:
+ return err.debug_error_string()
+ except asyncio.CancelledError:
+ return ''
+
+ return await call.debug_error_string()
+
+ async def wait_for_connection(self) -> None:
+ call = await self._interceptors_task
+ return await call.wait_for_connection()
+
+
+class _InterceptedUnaryResponseMixin:
+
+ def __await__(self):
+ call = yield from self._interceptors_task.__await__()
+ response = yield from call.__await__()
+ return response
+
+
+class _InterceptedStreamResponseMixin:
+ _response_aiter: Optional[AsyncIterable[ResponseType]]
+
+ def _init_stream_response_mixin(self) -> None:
+ # Is initalized later, otherwise if the iterator is not finnally
+ # consumed a logging warning is emmited by Asyncio.
+ self._response_aiter = None
+
+ async def _wait_for_interceptor_task_response_iterator(self
+ ) -> ResponseType:
+ call = await self._interceptors_task
+ async for response in call:
+ yield response
+
+ def __aiter__(self) -> AsyncIterable[ResponseType]:
+ if self._response_aiter is None:
+ self._response_aiter = self._wait_for_interceptor_task_response_iterator(
+ )
+ return self._response_aiter
+
+ async def read(self) -> ResponseType:
+ if self._response_aiter is None:
+ self._response_aiter = self._wait_for_interceptor_task_response_iterator(
+ )
+ return await self._response_aiter.asend(None)
+
+
+class _InterceptedStreamRequestMixin:
+
+ _write_to_iterator_async_gen: Optional[AsyncIterable[RequestType]]
+ _write_to_iterator_queue: Optional[asyncio.Queue]
+
+ _FINISH_ITERATOR_SENTINEL = object()
+
+ def _init_stream_request_mixin(
+ self, request_iterator: Optional[RequestIterableType]
+ ) -> RequestIterableType:
+
+ if request_iterator is None:
+ # We provide our own request iterator which is a proxy
+ # of the futures writes that will be done by the caller.
+ self._write_to_iterator_queue = asyncio.Queue(maxsize=1)
+ self._write_to_iterator_async_gen = self._proxy_writes_as_request_iterator(
+ )
+ request_iterator = self._write_to_iterator_async_gen
+ else:
+ self._write_to_iterator_queue = None
+
+ return request_iterator
+
+ async def _proxy_writes_as_request_iterator(self):
+ await self._interceptors_task
+
+ while True:
+ value = await self._write_to_iterator_queue.get()
+ if value is _InterceptedStreamRequestMixin._FINISH_ITERATOR_SENTINEL:
+ break
+ yield value
+
+ async def write(self, request: RequestType) -> None:
+ # If no queue was created it means that requests
+ # should be expected through an iterators provided
+ # by the caller.
+ if self._write_to_iterator_queue is None:
+ raise cygrpc.UsageError(_API_STYLE_ERROR)
+
+ try:
+ call = await self._interceptors_task
+ except (asyncio.CancelledError, AioRpcError):
+ raise asyncio.InvalidStateError(_RPC_ALREADY_FINISHED_DETAILS)
+
+ if call.done():
+ raise asyncio.InvalidStateError(_RPC_ALREADY_FINISHED_DETAILS)
+ elif call._done_writing_flag:
+ raise asyncio.InvalidStateError(_RPC_HALF_CLOSED_DETAILS)
+
+ # Write might never end up since the call could abrubtly finish,
+ # we give up on the first awaitable object that finishes.
+ _, _ = await asyncio.wait(
+ (self._write_to_iterator_queue.put(request), call.code()),
+ return_when=asyncio.FIRST_COMPLETED)
+
+ if call.done():
+ raise asyncio.InvalidStateError(_RPC_ALREADY_FINISHED_DETAILS)
+
+ async def done_writing(self) -> None:
+ """Signal peer that client is done writing.
+
+ This method is idempotent.
+ """
+ # If no queue was created it means that requests
+ # should be expected through an iterators provided
+ # by the caller.
+ if self._write_to_iterator_queue is None:
+ raise cygrpc.UsageError(_API_STYLE_ERROR)
+
+ try:
+ call = await self._interceptors_task
+ except asyncio.CancelledError:
+ raise asyncio.InvalidStateError(_RPC_ALREADY_FINISHED_DETAILS)
+
+ # Write might never end up since the call could abrubtly finish,
+ # we give up on the first awaitable object that finishes.
+ _, _ = await asyncio.wait((self._write_to_iterator_queue.put(
+ _InterceptedStreamRequestMixin._FINISH_ITERATOR_SENTINEL),
+ call.code()),
+ return_when=asyncio.FIRST_COMPLETED)
+
+
+class InterceptedUnaryUnaryCall(_InterceptedUnaryResponseMixin, InterceptedCall,
+ _base_call.UnaryUnaryCall):
+ """Used for running a `UnaryUnaryCall` wrapped by interceptors.
+
+ For the `__await__` method is it is proxied to the intercepted call only when
+ the interceptor task is finished.
+ """
+
+ _loop: asyncio.AbstractEventLoop
+ _channel: cygrpc.AioChannel
+
+ # pylint: disable=too-many-arguments
+ def __init__(self, interceptors: Sequence[UnaryUnaryClientInterceptor],
+ request: RequestType, timeout: Optional[float],
+ metadata: Metadata,
+ credentials: Optional[grpc.CallCredentials],
+ wait_for_ready: Optional[bool], channel: cygrpc.AioChannel,
+ method: bytes, request_serializer: SerializingFunction,
+ response_deserializer: DeserializingFunction,
+ loop: asyncio.AbstractEventLoop) -> None:
+ self._loop = loop
+ self._channel = channel
+ interceptors_task = loop.create_task(
+ self._invoke(interceptors, method, timeout, metadata, credentials,
+ wait_for_ready, request, request_serializer,
+ response_deserializer))
+ super().__init__(interceptors_task)
+
+ # pylint: disable=too-many-arguments
+ async def _invoke(self, interceptors: Sequence[UnaryUnaryClientInterceptor],
+ method: bytes, timeout: Optional[float],
+ metadata: Optional[Metadata],
+ credentials: Optional[grpc.CallCredentials],
+ wait_for_ready: Optional[bool], request: RequestType,
+ request_serializer: SerializingFunction,
+ response_deserializer: DeserializingFunction
+ ) -> UnaryUnaryCall:
+ """Run the RPC call wrapped in interceptors"""
+
+ async def _run_interceptor(
+ interceptors: Iterator[UnaryUnaryClientInterceptor],
+ client_call_details: ClientCallDetails,
+ request: RequestType) -> _base_call.UnaryUnaryCall:
+
+ interceptor = next(interceptors, None)
+
+ if interceptor:
+ continuation = functools.partial(_run_interceptor, interceptors)
+
+ call_or_response = await interceptor.intercept_unary_unary(
+ continuation, client_call_details, request)
+
+ if isinstance(call_or_response, _base_call.UnaryUnaryCall):
+ return call_or_response
+ else:
+ return UnaryUnaryCallResponse(call_or_response)
+
+ else:
+ return UnaryUnaryCall(
+ request, _timeout_to_deadline(client_call_details.timeout),
+ client_call_details.metadata,
+ client_call_details.credentials,
+ client_call_details.wait_for_ready, self._channel,
+ client_call_details.method, request_serializer,
+ response_deserializer, self._loop)
+
+ client_call_details = ClientCallDetails(method, timeout, metadata,
+ credentials, wait_for_ready)
+ return await _run_interceptor(iter(interceptors), client_call_details,
+ request)
+
+ def time_remaining(self) -> Optional[float]:
+ raise NotImplementedError()
+
+
+class InterceptedUnaryStreamCall(_InterceptedStreamResponseMixin,
+ InterceptedCall, _base_call.UnaryStreamCall):
+ """Used for running a `UnaryStreamCall` wrapped by interceptors."""
+
+ _loop: asyncio.AbstractEventLoop
+ _channel: cygrpc.AioChannel
+ _last_returned_call_from_interceptors = Optional[_base_call.UnaryStreamCall]
+
+ # pylint: disable=too-many-arguments
+ def __init__(self, interceptors: Sequence[UnaryStreamClientInterceptor],
+ request: RequestType, timeout: Optional[float],
+ metadata: Metadata,
+ credentials: Optional[grpc.CallCredentials],
+ wait_for_ready: Optional[bool], channel: cygrpc.AioChannel,
+ method: bytes, request_serializer: SerializingFunction,
+ response_deserializer: DeserializingFunction,
+ loop: asyncio.AbstractEventLoop) -> None:
+ self._loop = loop
+ self._channel = channel
+ self._init_stream_response_mixin()
+ self._last_returned_call_from_interceptors = None
+ interceptors_task = loop.create_task(
+ self._invoke(interceptors, method, timeout, metadata, credentials,
+ wait_for_ready, request, request_serializer,
+ response_deserializer))
+ super().__init__(interceptors_task)
+
+ # pylint: disable=too-many-arguments
+ async def _invoke(self, interceptors: Sequence[UnaryUnaryClientInterceptor],
+ method: bytes, timeout: Optional[float],
+ metadata: Optional[Metadata],
+ credentials: Optional[grpc.CallCredentials],
+ wait_for_ready: Optional[bool], request: RequestType,
+ request_serializer: SerializingFunction,
+ response_deserializer: DeserializingFunction
+ ) -> UnaryStreamCall:
+ """Run the RPC call wrapped in interceptors"""
+
+ async def _run_interceptor(
+ interceptors: Iterator[UnaryStreamClientInterceptor],
+ client_call_details: ClientCallDetails,
+ request: RequestType,
+ ) -> _base_call.UnaryUnaryCall:
+
+ interceptor = next(interceptors, None)
+
+ if interceptor:
+ continuation = functools.partial(_run_interceptor, interceptors)
+
+ call_or_response_iterator = await interceptor.intercept_unary_stream(
+ continuation, client_call_details, request)
+
+ if isinstance(call_or_response_iterator,
+ _base_call.UnaryStreamCall):
+ self._last_returned_call_from_interceptors = call_or_response_iterator
+ else:
+ self._last_returned_call_from_interceptors = UnaryStreamCallResponseIterator(
+ self._last_returned_call_from_interceptors,
+ call_or_response_iterator)
+ return self._last_returned_call_from_interceptors
+ else:
+ self._last_returned_call_from_interceptors = UnaryStreamCall(
+ request, _timeout_to_deadline(client_call_details.timeout),
+ client_call_details.metadata,
+ client_call_details.credentials,
+ client_call_details.wait_for_ready, self._channel,
+ client_call_details.method, request_serializer,
+ response_deserializer, self._loop)
+
+ return self._last_returned_call_from_interceptors
+
+ client_call_details = ClientCallDetails(method, timeout, metadata,
+ credentials, wait_for_ready)
+ return await _run_interceptor(iter(interceptors), client_call_details,
+ request)
+
+ def time_remaining(self) -> Optional[float]:
+ raise NotImplementedError()
+
+
+class InterceptedStreamUnaryCall(_InterceptedUnaryResponseMixin,
+ _InterceptedStreamRequestMixin,
+ InterceptedCall, _base_call.StreamUnaryCall):
+ """Used for running a `StreamUnaryCall` wrapped by interceptors.
+
+ For the `__await__` method is it is proxied to the intercepted call only when
+ the interceptor task is finished.
+ """
+
+ _loop: asyncio.AbstractEventLoop
+ _channel: cygrpc.AioChannel
+
+ # pylint: disable=too-many-arguments
+ def __init__(self, interceptors: Sequence[StreamUnaryClientInterceptor],
+ request_iterator: Optional[RequestIterableType],
+ timeout: Optional[float], metadata: Metadata,
+ credentials: Optional[grpc.CallCredentials],
+ wait_for_ready: Optional[bool], channel: cygrpc.AioChannel,
+ method: bytes, request_serializer: SerializingFunction,
+ response_deserializer: DeserializingFunction,
+ loop: asyncio.AbstractEventLoop) -> None:
+ self._loop = loop
+ self._channel = channel
+ request_iterator = self._init_stream_request_mixin(request_iterator)
+ interceptors_task = loop.create_task(
+ self._invoke(interceptors, method, timeout, metadata, credentials,
+ wait_for_ready, request_iterator, request_serializer,
+ response_deserializer))
+ super().__init__(interceptors_task)
+
+ # pylint: disable=too-many-arguments
+ async def _invoke(
+ self, interceptors: Sequence[StreamUnaryClientInterceptor],
+ method: bytes, timeout: Optional[float],
+ metadata: Optional[Metadata],
+ credentials: Optional[grpc.CallCredentials],
+ wait_for_ready: Optional[bool],
+ request_iterator: RequestIterableType,
+ request_serializer: SerializingFunction,
+ response_deserializer: DeserializingFunction) -> StreamUnaryCall:
+ """Run the RPC call wrapped in interceptors"""
+
+ async def _run_interceptor(
+ interceptors: Iterator[UnaryUnaryClientInterceptor],
+ client_call_details: ClientCallDetails,
+ request_iterator: RequestIterableType
+ ) -> _base_call.StreamUnaryCall:
+
+ interceptor = next(interceptors, None)
+
+ if interceptor:
+ continuation = functools.partial(_run_interceptor, interceptors)
+
+ return await interceptor.intercept_stream_unary(
+ continuation, client_call_details, request_iterator)
+ else:
+ return StreamUnaryCall(
+ request_iterator,
+ _timeout_to_deadline(client_call_details.timeout),
+ client_call_details.metadata,
+ client_call_details.credentials,
+ client_call_details.wait_for_ready, self._channel,
+ client_call_details.method, request_serializer,
+ response_deserializer, self._loop)
+
+ client_call_details = ClientCallDetails(method, timeout, metadata,
+ credentials, wait_for_ready)
+ return await _run_interceptor(iter(interceptors), client_call_details,
+ request_iterator)
+
+ def time_remaining(self) -> Optional[float]:
+ raise NotImplementedError()
+
+
+class InterceptedStreamStreamCall(_InterceptedStreamResponseMixin,
+ _InterceptedStreamRequestMixin,
+ InterceptedCall, _base_call.StreamStreamCall):
+ """Used for running a `StreamStreamCall` wrapped by interceptors."""
+
+ _loop: asyncio.AbstractEventLoop
+ _channel: cygrpc.AioChannel
+ _last_returned_call_from_interceptors = Optional[_base_call.UnaryStreamCall]
+
+ # pylint: disable=too-many-arguments
+ def __init__(self, interceptors: Sequence[StreamStreamClientInterceptor],
+ request_iterator: Optional[RequestIterableType],
+ timeout: Optional[float], metadata: Metadata,
+ credentials: Optional[grpc.CallCredentials],
+ wait_for_ready: Optional[bool], channel: cygrpc.AioChannel,
+ method: bytes, request_serializer: SerializingFunction,
+ response_deserializer: DeserializingFunction,
+ loop: asyncio.AbstractEventLoop) -> None:
+ self._loop = loop
+ self._channel = channel
+ self._init_stream_response_mixin()
+ request_iterator = self._init_stream_request_mixin(request_iterator)
+ self._last_returned_call_from_interceptors = None
+ interceptors_task = loop.create_task(
+ self._invoke(interceptors, method, timeout, metadata, credentials,
+ wait_for_ready, request_iterator, request_serializer,
+ response_deserializer))
+ super().__init__(interceptors_task)
+
+ # pylint: disable=too-many-arguments
+ async def _invoke(
+ self, interceptors: Sequence[StreamStreamClientInterceptor],
+ method: bytes, timeout: Optional[float],
+ metadata: Optional[Metadata],
+ credentials: Optional[grpc.CallCredentials],
+ wait_for_ready: Optional[bool],
+ request_iterator: RequestIterableType,
+ request_serializer: SerializingFunction,
+ response_deserializer: DeserializingFunction) -> StreamStreamCall:
+ """Run the RPC call wrapped in interceptors"""
+
+ async def _run_interceptor(
+ interceptors: Iterator[StreamStreamClientInterceptor],
+ client_call_details: ClientCallDetails,
+ request_iterator: RequestIterableType
+ ) -> _base_call.StreamStreamCall:
+
+ interceptor = next(interceptors, None)
+
+ if interceptor:
+ continuation = functools.partial(_run_interceptor, interceptors)
+
+ call_or_response_iterator = await interceptor.intercept_stream_stream(
+ continuation, client_call_details, request_iterator)
+
+ if isinstance(call_or_response_iterator,
+ _base_call.StreamStreamCall):
+ self._last_returned_call_from_interceptors = call_or_response_iterator
+ else:
+ self._last_returned_call_from_interceptors = StreamStreamCallResponseIterator(
+ self._last_returned_call_from_interceptors,
+ call_or_response_iterator)
+ return self._last_returned_call_from_interceptors
+ else:
+ self._last_returned_call_from_interceptors = StreamStreamCall(
+ request_iterator,
+ _timeout_to_deadline(client_call_details.timeout),
+ client_call_details.metadata,
+ client_call_details.credentials,
+ client_call_details.wait_for_ready, self._channel,
+ client_call_details.method, request_serializer,
+ response_deserializer, self._loop)
+ return self._last_returned_call_from_interceptors
+
+ client_call_details = ClientCallDetails(method, timeout, metadata,
+ credentials, wait_for_ready)
+ return await _run_interceptor(iter(interceptors), client_call_details,
+ request_iterator)
+
+ def time_remaining(self) -> Optional[float]:
+ raise NotImplementedError()
+
+
+class UnaryUnaryCallResponse(_base_call.UnaryUnaryCall):
+ """Final UnaryUnaryCall class finished with a response."""
+ _response: ResponseType
+
+ def __init__(self, response: ResponseType) -> None:
+ self._response = response
+
+ def cancel(self) -> bool:
+ return False
+
+ def cancelled(self) -> bool:
+ return False
+
+ def done(self) -> bool:
+ return True
+
+ def add_done_callback(self, unused_callback) -> None:
+ raise NotImplementedError()
+
+ def time_remaining(self) -> Optional[float]:
+ raise NotImplementedError()
+
+ async def initial_metadata(self) -> Optional[Metadata]:
+ return None
+
+ async def trailing_metadata(self) -> Optional[Metadata]:
+ return None
+
+ async def code(self) -> grpc.StatusCode:
+ return grpc.StatusCode.OK
+
+ async def details(self) -> str:
+ return ''
+
+ async def debug_error_string(self) -> Optional[str]:
+ return None
+
+ def __await__(self):
+ if False: # pylint: disable=using-constant-test
+ # This code path is never used, but a yield statement is needed
+ # for telling the interpreter that __await__ is a generator.
+ yield None
+ return self._response
+
+ async def wait_for_connection(self) -> None:
+ pass
+
+
+class _StreamCallResponseIterator:
+
+ _call: Union[_base_call.UnaryStreamCall, _base_call.StreamStreamCall]
+ _response_iterator: AsyncIterable[ResponseType]
+
+ def __init__(self, call: Union[_base_call.UnaryStreamCall, _base_call.
+ StreamStreamCall],
+ response_iterator: AsyncIterable[ResponseType]) -> None:
+ self._response_iterator = response_iterator
+ self._call = call
+
+ def cancel(self) -> bool:
+ return self._call.cancel()
+
+ def cancelled(self) -> bool:
+ return self._call.cancelled()
+
+ def done(self) -> bool:
+ return self._call.done()
+
+ def add_done_callback(self, callback) -> None:
+ self._call.add_done_callback(callback)
+
+ def time_remaining(self) -> Optional[float]:
+ return self._call.time_remaining()
+
+ async def initial_metadata(self) -> Optional[Metadata]:
+ return await self._call.initial_metadata()
+
+ async def trailing_metadata(self) -> Optional[Metadata]:
+ return await self._call.trailing_metadata()
+
+ async def code(self) -> grpc.StatusCode:
+ return await self._call.code()
+
+ async def details(self) -> str:
+ return await self._call.details()
+
+ async def debug_error_string(self) -> Optional[str]:
+ return await self._call.debug_error_string()
+
+ def __aiter__(self):
+ return self._response_iterator.__aiter__()
+
+ async def wait_for_connection(self) -> None:
+ return await self._call.wait_for_connection()
+
+
+class UnaryStreamCallResponseIterator(_StreamCallResponseIterator,
+ _base_call.UnaryStreamCall):
+ """UnaryStreamCall class wich uses an alternative response iterator."""
+
+ async def read(self) -> ResponseType:
+ # Behind the scenes everyting goes through the
+ # async iterator. So this path should not be reached.
+ raise NotImplementedError()
+
+
+class StreamStreamCallResponseIterator(_StreamCallResponseIterator,
+ _base_call.StreamStreamCall):
+ """StreamStreamCall class wich uses an alternative response iterator."""
+
+ async def read(self) -> ResponseType:
+ # Behind the scenes everyting goes through the
+ # async iterator. So this path should not be reached.
+ raise NotImplementedError()
+
+ async def write(self, request: RequestType) -> None:
+ # Behind the scenes everyting goes through the
+ # async iterator provided by the InterceptedStreamStreamCall.
+ # So this path should not be reached.
+ raise NotImplementedError()
+
+ async def done_writing(self) -> None:
+ # Behind the scenes everyting goes through the
+ # async iterator provided by the InterceptedStreamStreamCall.
+ # So this path should not be reached.
+ raise NotImplementedError()
+
+ @property
+ def _done_writing_flag(self) -> bool:
+ return self._call._done_writing_flag
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/aio/_metadata.py b/contrib/libs/grpc/src/python/grpcio/grpc/aio/_metadata.py
index a53158831f1..3c7d9244049 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/aio/_metadata.py
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/aio/_metadata.py
@@ -1,119 +1,119 @@
-# Copyright 2020 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-"""Implementation of the metadata abstraction for gRPC Asyncio Python."""
-from typing import List, Tuple, Iterator, Any, Union
-from collections import abc, OrderedDict
-
-MetadataKey = str
-MetadataValue = Union[str, bytes]
-
-
-class Metadata(abc.Mapping):
- """Metadata abstraction for the asynchronous calls and interceptors.
-
- The metadata is a mapping from str -> List[str]
-
- Traits
- * Multiple entries are allowed for the same key
- * The order of the values by key is preserved
- * Getting by an element by key, retrieves the first mapped value
- * Supports an immutable view of the data
- * Allows partial mutation on the data without recreating the new object from scratch.
- """
-
- def __init__(self, *args: Tuple[MetadataKey, MetadataValue]) -> None:
- self._metadata = OrderedDict()
- for md_key, md_value in args:
- self.add(md_key, md_value)
-
- @classmethod
- def from_tuple(cls, raw_metadata: tuple):
- if raw_metadata:
- return cls(*raw_metadata)
- return cls()
-
- def add(self, key: MetadataKey, value: MetadataValue) -> None:
- self._metadata.setdefault(key, [])
- self._metadata[key].append(value)
-
- def __len__(self) -> int:
- """Return the total number of elements that there are in the metadata,
- including multiple values for the same key.
- """
- return sum(map(len, self._metadata.values()))
-
- def __getitem__(self, key: MetadataKey) -> MetadataValue:
- """When calling <metadata>[<key>], the first element of all those
- mapped for <key> is returned.
- """
- try:
- return self._metadata[key][0]
- except (ValueError, IndexError) as e:
- raise KeyError("{0!r}".format(key)) from e
-
- def __setitem__(self, key: MetadataKey, value: MetadataValue) -> None:
- """Calling metadata[<key>] = <value>
- Maps <value> to the first instance of <key>.
- """
- if key not in self:
- self._metadata[key] = [value]
- else:
- current_values = self.get_all(key)
- self._metadata[key] = [value, *current_values[1:]]
-
- def __delitem__(self, key: MetadataKey) -> None:
- """``del metadata[<key>]`` deletes the first mapping for <key>."""
- current_values = self.get_all(key)
- if not current_values:
- raise KeyError(repr(key))
- self._metadata[key] = current_values[1:]
-
- def delete_all(self, key: MetadataKey) -> None:
- """Delete all mappings for <key>."""
- del self._metadata[key]
-
- def __iter__(self) -> Iterator[Tuple[MetadataKey, MetadataValue]]:
- for key, values in self._metadata.items():
- for value in values:
- yield (key, value)
-
- def get_all(self, key: MetadataKey) -> List[MetadataValue]:
- """For compatibility with other Metadata abstraction objects (like in Java),
- this would return all items under the desired <key>.
- """
- return self._metadata.get(key, [])
-
- def set_all(self, key: MetadataKey, values: List[MetadataValue]) -> None:
- self._metadata[key] = values
-
- def __contains__(self, key: MetadataKey) -> bool:
- return key in self._metadata
-
- def __eq__(self, other: Any) -> bool:
- if isinstance(other, self.__class__):
- return self._metadata == other._metadata
- if isinstance(other, tuple):
- return tuple(self) == other
- return NotImplemented # pytype: disable=bad-return-type
-
- def __add__(self, other: Any) -> 'Metadata':
- if isinstance(other, self.__class__):
- return Metadata(*(tuple(self) + tuple(other)))
- if isinstance(other, tuple):
- return Metadata(*(tuple(self) + other))
- return NotImplemented # pytype: disable=bad-return-type
-
- def __repr__(self) -> str:
- view = tuple(self)
- return "{0}({1!r})".format(self.__class__.__name__, view)
+# Copyright 2020 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+"""Implementation of the metadata abstraction for gRPC Asyncio Python."""
+from typing import List, Tuple, Iterator, Any, Union
+from collections import abc, OrderedDict
+
+MetadataKey = str
+MetadataValue = Union[str, bytes]
+
+
+class Metadata(abc.Mapping):
+ """Metadata abstraction for the asynchronous calls and interceptors.
+
+ The metadata is a mapping from str -> List[str]
+
+ Traits
+ * Multiple entries are allowed for the same key
+ * The order of the values by key is preserved
+ * Getting by an element by key, retrieves the first mapped value
+ * Supports an immutable view of the data
+ * Allows partial mutation on the data without recreating the new object from scratch.
+ """
+
+ def __init__(self, *args: Tuple[MetadataKey, MetadataValue]) -> None:
+ self._metadata = OrderedDict()
+ for md_key, md_value in args:
+ self.add(md_key, md_value)
+
+ @classmethod
+ def from_tuple(cls, raw_metadata: tuple):
+ if raw_metadata:
+ return cls(*raw_metadata)
+ return cls()
+
+ def add(self, key: MetadataKey, value: MetadataValue) -> None:
+ self._metadata.setdefault(key, [])
+ self._metadata[key].append(value)
+
+ def __len__(self) -> int:
+ """Return the total number of elements that there are in the metadata,
+ including multiple values for the same key.
+ """
+ return sum(map(len, self._metadata.values()))
+
+ def __getitem__(self, key: MetadataKey) -> MetadataValue:
+ """When calling <metadata>[<key>], the first element of all those
+ mapped for <key> is returned.
+ """
+ try:
+ return self._metadata[key][0]
+ except (ValueError, IndexError) as e:
+ raise KeyError("{0!r}".format(key)) from e
+
+ def __setitem__(self, key: MetadataKey, value: MetadataValue) -> None:
+ """Calling metadata[<key>] = <value>
+ Maps <value> to the first instance of <key>.
+ """
+ if key not in self:
+ self._metadata[key] = [value]
+ else:
+ current_values = self.get_all(key)
+ self._metadata[key] = [value, *current_values[1:]]
+
+ def __delitem__(self, key: MetadataKey) -> None:
+ """``del metadata[<key>]`` deletes the first mapping for <key>."""
+ current_values = self.get_all(key)
+ if not current_values:
+ raise KeyError(repr(key))
+ self._metadata[key] = current_values[1:]
+
+ def delete_all(self, key: MetadataKey) -> None:
+ """Delete all mappings for <key>."""
+ del self._metadata[key]
+
+ def __iter__(self) -> Iterator[Tuple[MetadataKey, MetadataValue]]:
+ for key, values in self._metadata.items():
+ for value in values:
+ yield (key, value)
+
+ def get_all(self, key: MetadataKey) -> List[MetadataValue]:
+ """For compatibility with other Metadata abstraction objects (like in Java),
+ this would return all items under the desired <key>.
+ """
+ return self._metadata.get(key, [])
+
+ def set_all(self, key: MetadataKey, values: List[MetadataValue]) -> None:
+ self._metadata[key] = values
+
+ def __contains__(self, key: MetadataKey) -> bool:
+ return key in self._metadata
+
+ def __eq__(self, other: Any) -> bool:
+ if isinstance(other, self.__class__):
+ return self._metadata == other._metadata
+ if isinstance(other, tuple):
+ return tuple(self) == other
+ return NotImplemented # pytype: disable=bad-return-type
+
+ def __add__(self, other: Any) -> 'Metadata':
+ if isinstance(other, self.__class__):
+ return Metadata(*(tuple(self) + tuple(other)))
+ if isinstance(other, tuple):
+ return Metadata(*(tuple(self) + other))
+ return NotImplemented # pytype: disable=bad-return-type
+
+ def __repr__(self) -> str:
+ view = tuple(self)
+ return "{0}({1!r})".format(self.__class__.__name__, view)
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/aio/_server.py b/contrib/libs/grpc/src/python/grpcio/grpc/aio/_server.py
index 023c65dd068..4d7cb75892e 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/aio/_server.py
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/aio/_server.py
@@ -1,209 +1,209 @@
-# Copyright 2019 The gRPC Authors
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-"""Server-side implementation of gRPC Asyncio Python."""
-
-from concurrent.futures import Executor
-from typing import Any, Optional, Sequence
-
-import grpc
-from grpc import _common, _compression
-from grpc._cython import cygrpc
-
-from . import _base_server
-from ._typing import ChannelArgumentType
-from ._interceptor import ServerInterceptor
-
-
-def _augment_channel_arguments(base_options: ChannelArgumentType,
- compression: Optional[grpc.Compression]):
- compression_option = _compression.create_channel_option(compression)
- return tuple(base_options) + compression_option
-
-
-class Server(_base_server.Server):
- """Serves RPCs."""
-
- def __init__(self, thread_pool: Optional[Executor],
- generic_handlers: Optional[Sequence[grpc.GenericRpcHandler]],
- interceptors: Optional[Sequence[Any]],
- options: ChannelArgumentType,
- maximum_concurrent_rpcs: Optional[int],
- compression: Optional[grpc.Compression]):
- self._loop = cygrpc.get_working_loop()
- if interceptors:
- invalid_interceptors = [
- interceptor for interceptor in interceptors
- if not isinstance(interceptor, ServerInterceptor)
- ]
- if invalid_interceptors:
- raise ValueError(
- 'Interceptor must be ServerInterceptor, the '
- f'following are invalid: {invalid_interceptors}')
- self._server = cygrpc.AioServer(
- self._loop, thread_pool, generic_handlers, interceptors,
- _augment_channel_arguments(options, compression),
- maximum_concurrent_rpcs)
-
- def add_generic_rpc_handlers(
- self,
- generic_rpc_handlers: Sequence[grpc.GenericRpcHandler]) -> None:
- """Registers GenericRpcHandlers with this Server.
-
- This method is only safe to call before the server is started.
-
- Args:
- generic_rpc_handlers: A sequence of GenericRpcHandlers that will be
- used to service RPCs.
- """
- self._server.add_generic_rpc_handlers(generic_rpc_handlers)
-
- def add_insecure_port(self, address: str) -> int:
- """Opens an insecure port for accepting RPCs.
-
- This method may only be called before starting the server.
-
- Args:
- address: The address for which to open a port. If the port is 0,
- or not specified in the address, then the gRPC runtime will choose a port.
-
- Returns:
- An integer port on which the server will accept RPC requests.
- """
- return _common.validate_port_binding_result(
- address, self._server.add_insecure_port(_common.encode(address)))
-
- def add_secure_port(self, address: str,
- server_credentials: grpc.ServerCredentials) -> int:
- """Opens a secure port for accepting RPCs.
-
- This method may only be called before starting the server.
-
- Args:
- address: The address for which to open a port.
- if the port is 0, or not specified in the address, then the gRPC
- runtime will choose a port.
- server_credentials: A ServerCredentials object.
-
- Returns:
- An integer port on which the server will accept RPC requests.
- """
- return _common.validate_port_binding_result(
- address,
- self._server.add_secure_port(_common.encode(address),
- server_credentials))
-
- async def start(self) -> None:
- """Starts this Server.
-
- This method may only be called once. (i.e. it is not idempotent).
- """
- await self._server.start()
-
- async def stop(self, grace: Optional[float]) -> None:
- """Stops this Server.
-
- This method immediately stops the server from servicing new RPCs in
- all cases.
-
- If a grace period is specified, this method returns immediately and all
- RPCs active at the end of the grace period are aborted. If a grace
- period is not specified (by passing None for grace), all existing RPCs
- are aborted immediately and this method blocks until the last RPC
- handler terminates.
-
- This method is idempotent and may be called at any time. Passing a
- smaller grace value in a subsequent call will have the effect of
- stopping the Server sooner (passing None will have the effect of
- stopping the server immediately). Passing a larger grace value in a
- subsequent call will not have the effect of stopping the server later
- (i.e. the most restrictive grace value is used).
-
- Args:
- grace: A duration of time in seconds or None.
- """
- await self._server.shutdown(grace)
-
- async def wait_for_termination(self,
- timeout: Optional[float] = None) -> bool:
- """Block current coroutine until the server stops.
-
- This is an EXPERIMENTAL API.
-
- The wait will not consume computational resources during blocking, and
- it will block until one of the two following conditions are met:
-
- 1) The server is stopped or terminated;
- 2) A timeout occurs if timeout is not `None`.
-
- The timeout argument works in the same way as `threading.Event.wait()`.
- https://docs.python.org/3/library/threading.html#threading.Event.wait
-
- Args:
- timeout: A floating point number specifying a timeout for the
- operation in seconds.
-
- Returns:
- A bool indicates if the operation times out.
- """
- return await self._server.wait_for_termination(timeout)
-
- def __del__(self):
- """Schedules a graceful shutdown in current event loop.
-
- The Cython AioServer doesn't hold a ref-count to this class. It should
- be safe to slightly extend the underlying Cython object's life span.
- """
- if hasattr(self, '_server'):
- if self._server.is_running():
- cygrpc.schedule_coro_threadsafe(
- self._server.shutdown(None),
- self._loop,
- )
-
-
-def server(migration_thread_pool: Optional[Executor] = None,
- handlers: Optional[Sequence[grpc.GenericRpcHandler]] = None,
- interceptors: Optional[Sequence[Any]] = None,
- options: Optional[ChannelArgumentType] = None,
- maximum_concurrent_rpcs: Optional[int] = None,
- compression: Optional[grpc.Compression] = None):
- """Creates a Server with which RPCs can be serviced.
-
- Args:
- migration_thread_pool: A futures.ThreadPoolExecutor to be used by the
- Server to execute non-AsyncIO RPC handlers for migration purpose.
- handlers: An optional list of GenericRpcHandlers used for executing RPCs.
- More handlers may be added by calling add_generic_rpc_handlers any time
- before the server is started.
- interceptors: An optional list of ServerInterceptor objects that observe
- and optionally manipulate the incoming RPCs before handing them over to
- handlers. The interceptors are given control in the order they are
- specified. This is an EXPERIMENTAL API.
- options: An optional list of key-value pairs (:term:`channel_arguments` in gRPC runtime)
- to configure the channel.
- maximum_concurrent_rpcs: The maximum number of concurrent RPCs this server
- will service before returning RESOURCE_EXHAUSTED status, or None to
- indicate no limit.
- compression: An element of grpc.compression, e.g.
- grpc.compression.Gzip. This compression algorithm will be used for the
- lifetime of the server unless overridden by set_compression. This is an
- EXPERIMENTAL option.
-
- Returns:
- A Server object.
- """
- return Server(migration_thread_pool, () if handlers is None else handlers,
- () if interceptors is None else interceptors,
- () if options is None else options, maximum_concurrent_rpcs,
- compression)
+# Copyright 2019 The gRPC Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+"""Server-side implementation of gRPC Asyncio Python."""
+
+from concurrent.futures import Executor
+from typing import Any, Optional, Sequence
+
+import grpc
+from grpc import _common, _compression
+from grpc._cython import cygrpc
+
+from . import _base_server
+from ._typing import ChannelArgumentType
+from ._interceptor import ServerInterceptor
+
+
+def _augment_channel_arguments(base_options: ChannelArgumentType,
+ compression: Optional[grpc.Compression]):
+ compression_option = _compression.create_channel_option(compression)
+ return tuple(base_options) + compression_option
+
+
+class Server(_base_server.Server):
+ """Serves RPCs."""
+
+ def __init__(self, thread_pool: Optional[Executor],
+ generic_handlers: Optional[Sequence[grpc.GenericRpcHandler]],
+ interceptors: Optional[Sequence[Any]],
+ options: ChannelArgumentType,
+ maximum_concurrent_rpcs: Optional[int],
+ compression: Optional[grpc.Compression]):
+ self._loop = cygrpc.get_working_loop()
+ if interceptors:
+ invalid_interceptors = [
+ interceptor for interceptor in interceptors
+ if not isinstance(interceptor, ServerInterceptor)
+ ]
+ if invalid_interceptors:
+ raise ValueError(
+ 'Interceptor must be ServerInterceptor, the '
+ f'following are invalid: {invalid_interceptors}')
+ self._server = cygrpc.AioServer(
+ self._loop, thread_pool, generic_handlers, interceptors,
+ _augment_channel_arguments(options, compression),
+ maximum_concurrent_rpcs)
+
+ def add_generic_rpc_handlers(
+ self,
+ generic_rpc_handlers: Sequence[grpc.GenericRpcHandler]) -> None:
+ """Registers GenericRpcHandlers with this Server.
+
+ This method is only safe to call before the server is started.
+
+ Args:
+ generic_rpc_handlers: A sequence of GenericRpcHandlers that will be
+ used to service RPCs.
+ """
+ self._server.add_generic_rpc_handlers(generic_rpc_handlers)
+
+ def add_insecure_port(self, address: str) -> int:
+ """Opens an insecure port for accepting RPCs.
+
+ This method may only be called before starting the server.
+
+ Args:
+ address: The address for which to open a port. If the port is 0,
+ or not specified in the address, then the gRPC runtime will choose a port.
+
+ Returns:
+ An integer port on which the server will accept RPC requests.
+ """
+ return _common.validate_port_binding_result(
+ address, self._server.add_insecure_port(_common.encode(address)))
+
+ def add_secure_port(self, address: str,
+ server_credentials: grpc.ServerCredentials) -> int:
+ """Opens a secure port for accepting RPCs.
+
+ This method may only be called before starting the server.
+
+ Args:
+ address: The address for which to open a port.
+ if the port is 0, or not specified in the address, then the gRPC
+ runtime will choose a port.
+ server_credentials: A ServerCredentials object.
+
+ Returns:
+ An integer port on which the server will accept RPC requests.
+ """
+ return _common.validate_port_binding_result(
+ address,
+ self._server.add_secure_port(_common.encode(address),
+ server_credentials))
+
+ async def start(self) -> None:
+ """Starts this Server.
+
+ This method may only be called once. (i.e. it is not idempotent).
+ """
+ await self._server.start()
+
+ async def stop(self, grace: Optional[float]) -> None:
+ """Stops this Server.
+
+ This method immediately stops the server from servicing new RPCs in
+ all cases.
+
+ If a grace period is specified, this method returns immediately and all
+ RPCs active at the end of the grace period are aborted. If a grace
+ period is not specified (by passing None for grace), all existing RPCs
+ are aborted immediately and this method blocks until the last RPC
+ handler terminates.
+
+ This method is idempotent and may be called at any time. Passing a
+ smaller grace value in a subsequent call will have the effect of
+ stopping the Server sooner (passing None will have the effect of
+ stopping the server immediately). Passing a larger grace value in a
+ subsequent call will not have the effect of stopping the server later
+ (i.e. the most restrictive grace value is used).
+
+ Args:
+ grace: A duration of time in seconds or None.
+ """
+ await self._server.shutdown(grace)
+
+ async def wait_for_termination(self,
+ timeout: Optional[float] = None) -> bool:
+ """Block current coroutine until the server stops.
+
+ This is an EXPERIMENTAL API.
+
+ The wait will not consume computational resources during blocking, and
+ it will block until one of the two following conditions are met:
+
+ 1) The server is stopped or terminated;
+ 2) A timeout occurs if timeout is not `None`.
+
+ The timeout argument works in the same way as `threading.Event.wait()`.
+ https://docs.python.org/3/library/threading.html#threading.Event.wait
+
+ Args:
+ timeout: A floating point number specifying a timeout for the
+ operation in seconds.
+
+ Returns:
+ A bool indicates if the operation times out.
+ """
+ return await self._server.wait_for_termination(timeout)
+
+ def __del__(self):
+ """Schedules a graceful shutdown in current event loop.
+
+ The Cython AioServer doesn't hold a ref-count to this class. It should
+ be safe to slightly extend the underlying Cython object's life span.
+ """
+ if hasattr(self, '_server'):
+ if self._server.is_running():
+ cygrpc.schedule_coro_threadsafe(
+ self._server.shutdown(None),
+ self._loop,
+ )
+
+
+def server(migration_thread_pool: Optional[Executor] = None,
+ handlers: Optional[Sequence[grpc.GenericRpcHandler]] = None,
+ interceptors: Optional[Sequence[Any]] = None,
+ options: Optional[ChannelArgumentType] = None,
+ maximum_concurrent_rpcs: Optional[int] = None,
+ compression: Optional[grpc.Compression] = None):
+ """Creates a Server with which RPCs can be serviced.
+
+ Args:
+ migration_thread_pool: A futures.ThreadPoolExecutor to be used by the
+ Server to execute non-AsyncIO RPC handlers for migration purpose.
+ handlers: An optional list of GenericRpcHandlers used for executing RPCs.
+ More handlers may be added by calling add_generic_rpc_handlers any time
+ before the server is started.
+ interceptors: An optional list of ServerInterceptor objects that observe
+ and optionally manipulate the incoming RPCs before handing them over to
+ handlers. The interceptors are given control in the order they are
+ specified. This is an EXPERIMENTAL API.
+ options: An optional list of key-value pairs (:term:`channel_arguments` in gRPC runtime)
+ to configure the channel.
+ maximum_concurrent_rpcs: The maximum number of concurrent RPCs this server
+ will service before returning RESOURCE_EXHAUSTED status, or None to
+ indicate no limit.
+ compression: An element of grpc.compression, e.g.
+ grpc.compression.Gzip. This compression algorithm will be used for the
+ lifetime of the server unless overridden by set_compression. This is an
+ EXPERIMENTAL option.
+
+ Returns:
+ A Server object.
+ """
+ return Server(migration_thread_pool, () if handlers is None else handlers,
+ () if interceptors is None else interceptors,
+ () if options is None else options, maximum_concurrent_rpcs,
+ compression)
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/aio/_typing.py b/contrib/libs/grpc/src/python/grpcio/grpc/aio/_typing.py
index e0205bd63c1..7e2e8da8a06 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/aio/_typing.py
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/aio/_typing.py
@@ -1,32 +1,32 @@
-# Copyright 2019 The gRPC Authors
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-"""Common types for gRPC Async API"""
-
-from typing import (Any, AsyncIterable, Callable, Iterable, Sequence, Tuple,
- TypeVar, Union)
-
-from grpc._cython.cygrpc import EOF
-from ._metadata import Metadata, MetadataKey, MetadataValue
-
-RequestType = TypeVar('RequestType')
-ResponseType = TypeVar('ResponseType')
-SerializingFunction = Callable[[Any], bytes]
-DeserializingFunction = Callable[[bytes], Any]
-MetadatumType = Tuple[MetadataKey, MetadataValue]
-MetadataType = Metadata
-ChannelArgumentType = Sequence[Tuple[str, Any]]
-EOFType = type(EOF)
-DoneCallbackType = Callable[[Any], None]
-RequestIterableType = Union[Iterable[Any], AsyncIterable[Any]]
-ResponseIterableType = AsyncIterable[Any]
+# Copyright 2019 The gRPC Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+"""Common types for gRPC Async API"""
+
+from typing import (Any, AsyncIterable, Callable, Iterable, Sequence, Tuple,
+ TypeVar, Union)
+
+from grpc._cython.cygrpc import EOF
+from ._metadata import Metadata, MetadataKey, MetadataValue
+
+RequestType = TypeVar('RequestType')
+ResponseType = TypeVar('ResponseType')
+SerializingFunction = Callable[[Any], bytes]
+DeserializingFunction = Callable[[bytes], Any]
+MetadatumType = Tuple[MetadataKey, MetadataValue]
+MetadataType = Metadata
+ChannelArgumentType = Sequence[Tuple[str, Any]]
+EOFType = type(EOF)
+DoneCallbackType = Callable[[Any], None]
+RequestIterableType = Union[Iterable[Any], AsyncIterable[Any]]
+ResponseIterableType = AsyncIterable[Any]
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/aio/_utils.py b/contrib/libs/grpc/src/python/grpcio/grpc/aio/_utils.py
index e88db8ad4fd..e5772dce2da 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/aio/_utils.py
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/aio/_utils.py
@@ -1,22 +1,22 @@
-# Copyright 2019 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-"""Internal utilities used by the gRPC Aio module."""
-import time
-from typing import Optional
-
-
-def _timeout_to_deadline(timeout: Optional[float]) -> Optional[float]:
- if timeout is None:
- return None
- return time.time() + timeout
+# Copyright 2019 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+"""Internal utilities used by the gRPC Aio module."""
+import time
+from typing import Optional
+
+
+def _timeout_to_deadline(timeout: Optional[float]) -> Optional[float]:
+ if timeout is None:
+ return None
+ return time.time() + timeout
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/beta/_client_adaptations.py b/contrib/libs/grpc/src/python/grpcio/grpc/beta/_client_adaptations.py
index bd5d66e4267..652ae0ea171 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/beta/_client_adaptations.py
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/beta/_client_adaptations.py
@@ -24,14 +24,14 @@ from grpc.framework.interfaces.face import face
# pylint: disable=too-many-arguments,too-many-locals,unused-argument
_STATUS_CODE_TO_ABORTION_KIND_AND_ABORTION_ERROR_CLASS = {
- grpc.StatusCode.CANCELLED:
- (face.Abortion.Kind.CANCELLED, face.CancellationError),
- grpc.StatusCode.UNKNOWN:
- (face.Abortion.Kind.REMOTE_FAILURE, face.RemoteError),
- grpc.StatusCode.DEADLINE_EXCEEDED:
- (face.Abortion.Kind.EXPIRED, face.ExpirationError),
- grpc.StatusCode.UNIMPLEMENTED:
- (face.Abortion.Kind.LOCAL_FAILURE, face.LocalError),
+ grpc.StatusCode.CANCELLED:
+ (face.Abortion.Kind.CANCELLED, face.CancellationError),
+ grpc.StatusCode.UNKNOWN:
+ (face.Abortion.Kind.REMOTE_FAILURE, face.RemoteError),
+ grpc.StatusCode.DEADLINE_EXCEEDED:
+ (face.Abortion.Kind.EXPIRED, face.ExpirationError),
+ grpc.StatusCode.UNIMPLEMENTED:
+ (face.Abortion.Kind.LOCAL_FAILURE, face.LocalError),
}
@@ -186,10 +186,10 @@ def _blocking_unary_unary(channel, group, method, timeout, with_call,
credentials=_credentials(protocol_options))
return response, _Rendezvous(None, None, call)
else:
- return multi_callable(request,
- timeout=timeout,
- metadata=_metadata.unbeta(effective_metadata),
- credentials=_credentials(protocol_options))
+ return multi_callable(request,
+ timeout=timeout,
+ metadata=_metadata.unbeta(effective_metadata),
+ credentials=_credentials(protocol_options))
except grpc.RpcError as rpc_error_call:
raise _abortion_error(rpc_error_call)
@@ -244,10 +244,10 @@ def _blocking_stream_unary(channel, group, method, timeout, with_call,
credentials=_credentials(protocol_options))
return response, _Rendezvous(None, None, call)
else:
- return multi_callable(request_iterator,
- timeout=timeout,
- metadata=_metadata.unbeta(effective_metadata),
- credentials=_credentials(protocol_options))
+ return multi_callable(request_iterator,
+ timeout=timeout,
+ metadata=_metadata.unbeta(effective_metadata),
+ credentials=_credentials(protocol_options))
except grpc.RpcError as rpc_error_call:
raise _abortion_error(rpc_error_call)
@@ -301,18 +301,18 @@ class _UnaryUnaryMultiCallable(face.UnaryUnaryMultiCallable):
metadata=None,
with_call=False,
protocol_options=None):
- return _blocking_unary_unary(self._channel, self._group, self._method,
- timeout, with_call, protocol_options,
- metadata, self._metadata_transformer,
- request, self._request_serializer,
- self._response_deserializer)
+ return _blocking_unary_unary(self._channel, self._group, self._method,
+ timeout, with_call, protocol_options,
+ metadata, self._metadata_transformer,
+ request, self._request_serializer,
+ self._response_deserializer)
def future(self, request, timeout, metadata=None, protocol_options=None):
- return _future_unary_unary(self._channel, self._group, self._method,
- timeout, protocol_options, metadata,
- self._metadata_transformer, request,
- self._request_serializer,
- self._response_deserializer)
+ return _future_unary_unary(self._channel, self._group, self._method,
+ timeout, protocol_options, metadata,
+ self._metadata_transformer, request,
+ self._request_serializer,
+ self._response_deserializer)
def event(self,
request,
@@ -336,11 +336,11 @@ class _UnaryStreamMultiCallable(face.UnaryStreamMultiCallable):
self._response_deserializer = response_deserializer
def __call__(self, request, timeout, metadata=None, protocol_options=None):
- return _unary_stream(self._channel, self._group, self._method, timeout,
- protocol_options, metadata,
- self._metadata_transformer, request,
- self._request_serializer,
- self._response_deserializer)
+ return _unary_stream(self._channel, self._group, self._method, timeout,
+ protocol_options, metadata,
+ self._metadata_transformer, request,
+ self._request_serializer,
+ self._response_deserializer)
def event(self,
request,
@@ -369,23 +369,23 @@ class _StreamUnaryMultiCallable(face.StreamUnaryMultiCallable):
metadata=None,
with_call=False,
protocol_options=None):
- return _blocking_stream_unary(self._channel, self._group, self._method,
- timeout, with_call, protocol_options,
- metadata, self._metadata_transformer,
- request_iterator,
- self._request_serializer,
- self._response_deserializer)
+ return _blocking_stream_unary(self._channel, self._group, self._method,
+ timeout, with_call, protocol_options,
+ metadata, self._metadata_transformer,
+ request_iterator,
+ self._request_serializer,
+ self._response_deserializer)
def future(self,
request_iterator,
timeout,
metadata=None,
protocol_options=None):
- return _future_stream_unary(self._channel, self._group, self._method,
- timeout, protocol_options, metadata,
- self._metadata_transformer,
- request_iterator, self._request_serializer,
- self._response_deserializer)
+ return _future_stream_unary(self._channel, self._group, self._method,
+ timeout, protocol_options, metadata,
+ self._metadata_transformer,
+ request_iterator, self._request_serializer,
+ self._response_deserializer)
def event(self,
receiver,
@@ -412,11 +412,11 @@ class _StreamStreamMultiCallable(face.StreamStreamMultiCallable):
timeout,
metadata=None,
protocol_options=None):
- return _stream_stream(self._channel, self._group, self._method, timeout,
- protocol_options, metadata,
- self._metadata_transformer, request_iterator,
- self._request_serializer,
- self._response_deserializer)
+ return _stream_stream(self._channel, self._group, self._method, timeout,
+ protocol_options, metadata,
+ self._metadata_transformer, request_iterator,
+ self._request_serializer,
+ self._response_deserializer)
def event(self,
receiver,
@@ -513,11 +513,11 @@ class _GenericStub(face.GenericStub):
group,
method,
))
- return _blocking_stream_unary(self._channel, group, method, timeout,
- with_call, protocol_options, metadata,
- self._metadata_transformer,
- request_iterator, request_serializer,
- response_deserializer)
+ return _blocking_stream_unary(self._channel, group, method, timeout,
+ with_call, protocol_options, metadata,
+ self._metadata_transformer,
+ request_iterator, request_serializer,
+ response_deserializer)
def future_stream_unary(self,
group,
@@ -534,11 +534,11 @@ class _GenericStub(face.GenericStub):
group,
method,
))
- return _future_stream_unary(self._channel, group, method, timeout,
- protocol_options, metadata,
- self._metadata_transformer,
- request_iterator, request_serializer,
- response_deserializer)
+ return _future_stream_unary(self._channel, group, method, timeout,
+ protocol_options, metadata,
+ self._metadata_transformer,
+ request_iterator, request_serializer,
+ response_deserializer)
def inline_stream_stream(self,
group,
@@ -611,10 +611,10 @@ class _GenericStub(face.GenericStub):
group,
method,
))
- return _UnaryUnaryMultiCallable(self._channel, group, method,
- self._metadata_transformer,
- request_serializer,
- response_deserializer)
+ return _UnaryUnaryMultiCallable(self._channel, group, method,
+ self._metadata_transformer,
+ request_serializer,
+ response_deserializer)
def unary_stream(self, group, method):
request_serializer = self._request_serializers.get((
@@ -625,10 +625,10 @@ class _GenericStub(face.GenericStub):
group,
method,
))
- return _UnaryStreamMultiCallable(self._channel, group, method,
- self._metadata_transformer,
- request_serializer,
- response_deserializer)
+ return _UnaryStreamMultiCallable(self._channel, group, method,
+ self._metadata_transformer,
+ request_serializer,
+ response_deserializer)
def stream_unary(self, group, method):
request_serializer = self._request_serializers.get((
@@ -639,10 +639,10 @@ class _GenericStub(face.GenericStub):
group,
method,
))
- return _StreamUnaryMultiCallable(self._channel, group, method,
- self._metadata_transformer,
- request_serializer,
- response_deserializer)
+ return _StreamUnaryMultiCallable(self._channel, group, method,
+ self._metadata_transformer,
+ request_serializer,
+ response_deserializer)
def stream_stream(self, group, method):
request_serializer = self._request_serializers.get((
@@ -653,10 +653,10 @@ class _GenericStub(face.GenericStub):
group,
method,
))
- return _StreamStreamMultiCallable(self._channel, group, method,
- self._metadata_transformer,
- request_serializer,
- response_deserializer)
+ return _StreamStreamMultiCallable(self._channel, group, method,
+ self._metadata_transformer,
+ request_serializer,
+ response_deserializer)
def __enter__(self):
return self
@@ -683,8 +683,8 @@ class _DynamicStub(face.DynamicStub):
elif method_cardinality is cardinality.Cardinality.STREAM_STREAM:
return self._generic_stub.stream_stream(self._group, attr)
else:
- raise AttributeError('_DynamicStub object has no attribute "%s"!' %
- attr)
+ raise AttributeError('_DynamicStub object has no attribute "%s"!' %
+ attr)
def __enter__(self):
return self
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/beta/_server_adaptations.py b/contrib/libs/grpc/src/python/grpcio/grpc/beta/_server_adaptations.py
index 678e514a246..8843a3c5502 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/beta/_server_adaptations.py
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/beta/_server_adaptations.py
@@ -258,21 +258,21 @@ def _simple_method_handler(implementation, request_deserializer,
response_serializer):
if implementation.style is style.Service.INLINE:
if implementation.cardinality is cardinality.Cardinality.UNARY_UNARY:
- return _SimpleMethodHandler(
- False, False, request_deserializer, response_serializer,
- _adapt_unary_request_inline(implementation.unary_unary_inline),
- None, None, None)
+ return _SimpleMethodHandler(
+ False, False, request_deserializer, response_serializer,
+ _adapt_unary_request_inline(implementation.unary_unary_inline),
+ None, None, None)
elif implementation.cardinality is cardinality.Cardinality.UNARY_STREAM:
- return _SimpleMethodHandler(
- False, True, request_deserializer, response_serializer, None,
- _adapt_unary_request_inline(implementation.unary_stream_inline),
- None, None)
+ return _SimpleMethodHandler(
+ False, True, request_deserializer, response_serializer, None,
+ _adapt_unary_request_inline(implementation.unary_stream_inline),
+ None, None)
elif implementation.cardinality is cardinality.Cardinality.STREAM_UNARY:
- return _SimpleMethodHandler(
- True, False, request_deserializer, response_serializer, None,
- None,
- _adapt_stream_request_inline(
- implementation.stream_unary_inline), None)
+ return _SimpleMethodHandler(
+ True, False, request_deserializer, response_serializer, None,
+ None,
+ _adapt_stream_request_inline(
+ implementation.stream_unary_inline), None)
elif implementation.cardinality is cardinality.Cardinality.STREAM_STREAM:
return _SimpleMethodHandler(
True, True, request_deserializer, response_serializer, None,
@@ -281,26 +281,26 @@ def _simple_method_handler(implementation, request_deserializer,
implementation.stream_stream_inline))
elif implementation.style is style.Service.EVENT:
if implementation.cardinality is cardinality.Cardinality.UNARY_UNARY:
- return _SimpleMethodHandler(
- False, False, request_deserializer, response_serializer,
- _adapt_unary_unary_event(implementation.unary_unary_event),
- None, None, None)
+ return _SimpleMethodHandler(
+ False, False, request_deserializer, response_serializer,
+ _adapt_unary_unary_event(implementation.unary_unary_event),
+ None, None, None)
elif implementation.cardinality is cardinality.Cardinality.UNARY_STREAM:
- return _SimpleMethodHandler(
- False, True, request_deserializer, response_serializer, None,
- _adapt_unary_stream_event(implementation.unary_stream_event),
- None, None)
+ return _SimpleMethodHandler(
+ False, True, request_deserializer, response_serializer, None,
+ _adapt_unary_stream_event(implementation.unary_stream_event),
+ None, None)
elif implementation.cardinality is cardinality.Cardinality.STREAM_UNARY:
- return _SimpleMethodHandler(
- True, False, request_deserializer, response_serializer, None,
- None,
- _adapt_stream_unary_event(implementation.stream_unary_event),
- None)
+ return _SimpleMethodHandler(
+ True, False, request_deserializer, response_serializer, None,
+ None,
+ _adapt_stream_unary_event(implementation.stream_unary_event),
+ None)
elif implementation.cardinality is cardinality.Cardinality.STREAM_STREAM:
- return _SimpleMethodHandler(
- True, True, request_deserializer, response_serializer, None,
- None, None,
- _adapt_stream_stream_event(implementation.stream_stream_event))
+ return _SimpleMethodHandler(
+ True, True, request_deserializer, response_serializer, None,
+ None, None,
+ _adapt_stream_stream_event(implementation.stream_stream_event))
raise ValueError()
@@ -329,10 +329,10 @@ class _GenericRpcHandler(grpc.GenericRpcHandler):
method_implementation = self._method_implementations.get(
handler_call_details.method)
if method_implementation is not None:
- return _simple_method_handler(
- method_implementation,
- self._request_deserializers.get(handler_call_details.method),
- self._response_serializers.get(handler_call_details.method))
+ return _simple_method_handler(
+ method_implementation,
+ self._request_deserializers.get(handler_call_details.method),
+ self._response_serializers.get(handler_call_details.method))
elif self._multi_method_implementation is None:
return None
else:
@@ -371,14 +371,14 @@ class _Server(interfaces.Server):
def server(service_implementations, multi_method_implementation,
request_deserializers, response_serializers, thread_pool,
thread_pool_size):
- generic_rpc_handler = _GenericRpcHandler(service_implementations,
- multi_method_implementation,
- request_deserializers,
- response_serializers)
+ generic_rpc_handler = _GenericRpcHandler(service_implementations,
+ multi_method_implementation,
+ request_deserializers,
+ response_serializers)
if thread_pool is None:
- effective_thread_pool = logging_pool.pool(
- _DEFAULT_POOL_SIZE if thread_pool_size is None else thread_pool_size
- )
+ effective_thread_pool = logging_pool.pool(
+ _DEFAULT_POOL_SIZE if thread_pool_size is None else thread_pool_size
+ )
else:
effective_thread_pool = thread_pool
return _Server(
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/beta/implementations.py b/contrib/libs/grpc/src/python/grpcio/grpc/beta/implementations.py
index 66cd9c90c07..c5507b543fb 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/beta/implementations.py
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/beta/implementations.py
@@ -110,8 +110,8 @@ def insecure_channel(host, port):
Returns:
A Channel to the remote host through which RPCs may be conducted.
"""
- channel = grpc.insecure_channel(host if port is None else '%s:%d' %
- (host, port))
+ channel = grpc.insecure_channel(host if port is None else '%s:%d' %
+ (host, port))
return Channel(channel)
@@ -127,8 +127,8 @@ def secure_channel(host, port, channel_credentials):
Returns:
A secure Channel to the remote host through which RPCs may be conducted.
"""
- channel = grpc.secure_channel(
- host if port is None else '%s:%d' % (host, port), channel_credentials)
+ channel = grpc.secure_channel(
+ host if port is None else '%s:%d' % (host, port), channel_credentials)
return Channel(channel)
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/experimental/__init__.py b/contrib/libs/grpc/src/python/grpcio/grpc/experimental/__init__.py
index 584a7f80e2f..a4e2660fb4e 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/experimental/__init__.py
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/experimental/__init__.py
@@ -16,16 +16,16 @@
These APIs are subject to be removed during any minor version release.
"""
-import copy
-import functools
-import sys
-import warnings
-
-import grpc
-
-_EXPERIMENTAL_APIS_USED = set()
-
-
+import copy
+import functools
+import sys
+import warnings
+
+import grpc
+
+_EXPERIMENTAL_APIS_USED = set()
+
+
class ChannelOptions(object):
"""Indicates a channel option unique to gRPC Python.
@@ -39,89 +39,89 @@ class ChannelOptions(object):
class UsageError(Exception):
"""Raised by the gRPC library to indicate usage not allowed by the API."""
-
-
-_insecure_channel_credentials_sentinel = object()
-_insecure_channel_credentials = grpc.ChannelCredentials(
- _insecure_channel_credentials_sentinel)
-
-
-def insecure_channel_credentials():
- """Creates a ChannelCredentials for use with an insecure channel.
-
- THIS IS AN EXPERIMENTAL API.
-
- This is not for use with secure_channel function. Intead, this should be
- used with grpc.unary_unary, grpc.unary_stream, grpc.stream_unary, or
- grpc.stream_stream.
- """
- return _insecure_channel_credentials
-
-
-class ExperimentalApiWarning(Warning):
- """A warning that an API is experimental."""
-
-
-def _warn_experimental(api_name, stack_offset):
- if api_name not in _EXPERIMENTAL_APIS_USED:
- _EXPERIMENTAL_APIS_USED.add(api_name)
- msg = ("'{}' is an experimental API. It is subject to change or ".
- format(api_name) +
- "removal between minor releases. Proceed with caution.")
- warnings.warn(msg, ExperimentalApiWarning, stacklevel=2 + stack_offset)
-
-
-def experimental_api(f):
-
- @functools.wraps(f)
- def _wrapper(*args, **kwargs):
- _warn_experimental(f.__name__, 1)
- return f(*args, **kwargs)
-
- return _wrapper
-
-
-def wrap_server_method_handler(wrapper, handler):
- """Wraps the server method handler function.
-
- The server implementation requires all server handlers being wrapped as
- RpcMethodHandler objects. This helper function ease the pain of writing
- server handler wrappers.
-
- Args:
- wrapper: A wrapper function that takes in a method handler behavior
- (the actual function) and returns a wrapped function.
- handler: A RpcMethodHandler object to be wrapped.
-
- Returns:
- A newly created RpcMethodHandler.
- """
- if not handler:
- return None
-
- if not handler.request_streaming:
- if not handler.response_streaming:
- # NOTE(lidiz) _replace is a public API:
- # https://docs.python.org/dev/library/collections.html
- return handler._replace(unary_unary=wrapper(handler.unary_unary))
- else:
- return handler._replace(unary_stream=wrapper(handler.unary_stream))
- else:
- if not handler.response_streaming:
- return handler._replace(stream_unary=wrapper(handler.stream_unary))
- else:
- return handler._replace(
- stream_stream=wrapper(handler.stream_stream))
-
-
-__all__ = (
- 'ChannelOptions',
- 'ExperimentalApiWarning',
- 'UsageError',
- 'insecure_channel_credentials',
- 'wrap_server_method_handler',
-)
-
-if sys.version_info > (3, 6):
- from grpc._simple_stubs import unary_unary, unary_stream, stream_unary, stream_stream
- __all__ = __all__ + (unary_unary, unary_stream, stream_unary, stream_stream)
+
+
+_insecure_channel_credentials_sentinel = object()
+_insecure_channel_credentials = grpc.ChannelCredentials(
+ _insecure_channel_credentials_sentinel)
+
+
+def insecure_channel_credentials():
+ """Creates a ChannelCredentials for use with an insecure channel.
+
+ THIS IS AN EXPERIMENTAL API.
+
+ This is not for use with secure_channel function. Intead, this should be
+ used with grpc.unary_unary, grpc.unary_stream, grpc.stream_unary, or
+ grpc.stream_stream.
+ """
+ return _insecure_channel_credentials
+
+
+class ExperimentalApiWarning(Warning):
+ """A warning that an API is experimental."""
+
+
+def _warn_experimental(api_name, stack_offset):
+ if api_name not in _EXPERIMENTAL_APIS_USED:
+ _EXPERIMENTAL_APIS_USED.add(api_name)
+ msg = ("'{}' is an experimental API. It is subject to change or ".
+ format(api_name) +
+ "removal between minor releases. Proceed with caution.")
+ warnings.warn(msg, ExperimentalApiWarning, stacklevel=2 + stack_offset)
+
+
+def experimental_api(f):
+
+ @functools.wraps(f)
+ def _wrapper(*args, **kwargs):
+ _warn_experimental(f.__name__, 1)
+ return f(*args, **kwargs)
+
+ return _wrapper
+
+
+def wrap_server_method_handler(wrapper, handler):
+ """Wraps the server method handler function.
+
+ The server implementation requires all server handlers being wrapped as
+ RpcMethodHandler objects. This helper function ease the pain of writing
+ server handler wrappers.
+
+ Args:
+ wrapper: A wrapper function that takes in a method handler behavior
+ (the actual function) and returns a wrapped function.
+ handler: A RpcMethodHandler object to be wrapped.
+
+ Returns:
+ A newly created RpcMethodHandler.
+ """
+ if not handler:
+ return None
+
+ if not handler.request_streaming:
+ if not handler.response_streaming:
+ # NOTE(lidiz) _replace is a public API:
+ # https://docs.python.org/dev/library/collections.html
+ return handler._replace(unary_unary=wrapper(handler.unary_unary))
+ else:
+ return handler._replace(unary_stream=wrapper(handler.unary_stream))
+ else:
+ if not handler.response_streaming:
+ return handler._replace(stream_unary=wrapper(handler.stream_unary))
+ else:
+ return handler._replace(
+ stream_stream=wrapper(handler.stream_stream))
+
+
+__all__ = (
+ 'ChannelOptions',
+ 'ExperimentalApiWarning',
+ 'UsageError',
+ 'insecure_channel_credentials',
+ 'wrap_server_method_handler',
+)
+
+if sys.version_info > (3, 6):
+ from grpc._simple_stubs import unary_unary, unary_stream, stream_unary, stream_stream
+ __all__ = __all__ + (unary_unary, unary_stream, stream_unary, stream_stream)
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/experimental/aio/__init__.py b/contrib/libs/grpc/src/python/grpcio/grpc/experimental/aio/__init__.py
index c177b4bd531..576cb8dcde4 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/experimental/aio/__init__.py
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/experimental/aio/__init__.py
@@ -1,4 +1,4 @@
-# Copyright 2020 The gRPC Authors
+# Copyright 2020 The gRPC Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -11,6 +11,6 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-"""Alias of grpc.aio to keep backward compatibility."""
+"""Alias of grpc.aio to keep backward compatibility."""
-from grpc.aio import *
+from grpc.aio import *
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/framework/foundation/logging_pool.py b/contrib/libs/grpc/src/python/grpcio/grpc/framework/foundation/logging_pool.py
index 9119e414a5c..421999fb1c3 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/framework/foundation/logging_pool.py
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/framework/foundation/logging_pool.py
@@ -51,9 +51,9 @@ class _LoggingPool(object):
return self._backing_pool.submit(_wrap(fn), *args, **kwargs)
def map(self, func, *iterables, **kwargs):
- return self._backing_pool.map(_wrap(func),
- *iterables,
- timeout=kwargs.get('timeout', None))
+ return self._backing_pool.map(_wrap(func),
+ *iterables,
+ timeout=kwargs.get('timeout', None))
def shutdown(self, wait=True):
self._backing_pool.shutdown(wait=wait)
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc_core_dependencies.py b/contrib/libs/grpc/src/python/grpcio/grpc_core_dependencies.py
index 2e34549b7dd..67f985e1f46 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc_core_dependencies.py
+++ b/contrib/libs/grpc/src/python/grpcio/grpc_core_dependencies.py
@@ -23,28 +23,28 @@ CORE_SOURCE_FILES = [
'src/core/ext/filters/client_channel/client_channel_channelz.cc',
'src/core/ext/filters/client_channel/client_channel_factory.cc',
'src/core/ext/filters/client_channel/client_channel_plugin.cc',
- 'src/core/ext/filters/client_channel/config_selector.cc',
+ 'src/core/ext/filters/client_channel/config_selector.cc',
'src/core/ext/filters/client_channel/global_subchannel_pool.cc',
'src/core/ext/filters/client_channel/health/health_check_client.cc',
'src/core/ext/filters/client_channel/http_connect_handshaker.cc',
'src/core/ext/filters/client_channel/http_proxy.cc',
'src/core/ext/filters/client_channel/lb_policy.cc',
- 'src/core/ext/filters/client_channel/lb_policy/address_filtering.cc',
- 'src/core/ext/filters/client_channel/lb_policy/child_policy_handler.cc',
+ 'src/core/ext/filters/client_channel/lb_policy/address_filtering.cc',
+ 'src/core/ext/filters/client_channel/lb_policy/child_policy_handler.cc',
'src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc',
'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc',
- 'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.cc',
+ 'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.cc',
'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc',
'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc',
'src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc',
'src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc',
- 'src/core/ext/filters/client_channel/lb_policy/priority/priority.cc',
+ 'src/core/ext/filters/client_channel/lb_policy/priority/priority.cc',
'src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc',
- 'src/core/ext/filters/client_channel/lb_policy/weighted_target/weighted_target.cc',
+ 'src/core/ext/filters/client_channel/lb_policy/weighted_target/weighted_target.cc',
'src/core/ext/filters/client_channel/lb_policy/xds/cds.cc',
- 'src/core/ext/filters/client_channel/lb_policy/xds/eds.cc',
- 'src/core/ext/filters/client_channel/lb_policy/xds/eds_drop.cc',
- 'src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_manager.cc',
+ 'src/core/ext/filters/client_channel/lb_policy/xds/eds.cc',
+ 'src/core/ext/filters/client_channel/lb_policy/xds/eds_drop.cc',
+ 'src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_manager.cc',
'src/core/ext/filters/client_channel/lb_policy_registry.cc',
'src/core/ext/filters/client_channel/local_subchannel_pool.cc',
'src/core/ext/filters/client_channel/proxy_mapper_registry.cc',
@@ -70,8 +70,8 @@ CORE_SOURCE_FILES = [
'src/core/ext/filters/client_channel/retry_throttle.cc',
'src/core/ext/filters/client_channel/server_address.cc',
'src/core/ext/filters/client_channel/service_config.cc',
- 'src/core/ext/filters/client_channel/service_config_channel_arg_filter.cc',
- 'src/core/ext/filters/client_channel/service_config_parser.cc',
+ 'src/core/ext/filters/client_channel/service_config_channel_arg_filter.cc',
+ 'src/core/ext/filters/client_channel/service_config_parser.cc',
'src/core/ext/filters/client_channel/subchannel.cc',
'src/core/ext/filters/client_channel/subchannel_pool_interface.cc',
'src/core/ext/filters/client_idle/client_idle_filter.cc',
@@ -80,7 +80,7 @@ CORE_SOURCE_FILES = [
'src/core/ext/filters/http/client_authority_filter.cc',
'src/core/ext/filters/http/http_filters_plugin.cc',
'src/core/ext/filters/http/message_compress/message_compress_filter.cc',
- 'src/core/ext/filters/http/message_compress/message_decompress_filter.cc',
+ 'src/core/ext/filters/http/message_compress/message_decompress_filter.cc',
'src/core/ext/filters/http/server/http_server_filter.cc',
'src/core/ext/filters/max_age/max_age_filter.cc',
'src/core/ext/filters/message_size/message_size_filter.cc',
@@ -121,66 +121,66 @@ CORE_SOURCE_FILES = [
'src/core/ext/transport/chttp2/transport/writing.cc',
'src/core/ext/transport/inproc/inproc_plugin.cc',
'src/core/ext/transport/inproc/inproc_transport.cc',
- 'src/core/ext/upb-generated/envoy/annotations/deprecation.upb.c',
- 'src/core/ext/upb-generated/envoy/annotations/resource.upb.c',
- 'src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.c',
- 'src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.c',
- 'src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.c',
- 'src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.c',
- 'src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.c',
- 'src/core/ext/upb-generated/envoy/config/core/v3/address.upb.c',
- 'src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.c',
- 'src/core/ext/upb-generated/envoy/config/core/v3/base.upb.c',
- 'src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.c',
- 'src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.c',
- 'src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.c',
- 'src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.c',
- 'src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.c',
- 'src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.c',
- 'src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.c',
- 'src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.c',
- 'src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.c',
- 'src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.c',
- 'src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.c',
- 'src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.c',
- 'src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.c',
- 'src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.c',
- 'src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.c',
- 'src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.c',
- 'src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.c',
- 'src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.c',
- 'src/core/ext/upb-generated/envoy/config/route/v3/route.upb.c',
- 'src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.c',
- 'src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.c',
- 'src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.c',
- 'src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c',
- 'src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.c',
- 'src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.c',
- 'src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.c',
- 'src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.c',
- 'src/core/ext/upb-generated/envoy/service/cluster/v3/cds.upb.c',
- 'src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.c',
- 'src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.c',
- 'src/core/ext/upb-generated/envoy/service/endpoint/v3/eds.upb.c',
- 'src/core/ext/upb-generated/envoy/service/listener/v3/lds.upb.c',
- 'src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.c',
- 'src/core/ext/upb-generated/envoy/service/route/v3/rds.upb.c',
- 'src/core/ext/upb-generated/envoy/service/route/v3/srds.upb.c',
- 'src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.c',
- 'src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.c',
- 'src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.c',
- 'src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.c',
- 'src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.c',
- 'src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.c',
- 'src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.c',
- 'src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.c',
- 'src/core/ext/upb-generated/envoy/type/v3/http.upb.c',
- 'src/core/ext/upb-generated/envoy/type/v3/percent.upb.c',
- 'src/core/ext/upb-generated/envoy/type/v3/range.upb.c',
- 'src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.c',
+ 'src/core/ext/upb-generated/envoy/annotations/deprecation.upb.c',
+ 'src/core/ext/upb-generated/envoy/annotations/resource.upb.c',
+ 'src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.c',
+ 'src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.c',
+ 'src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.c',
+ 'src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.c',
+ 'src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.c',
+ 'src/core/ext/upb-generated/envoy/config/core/v3/address.upb.c',
+ 'src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.c',
+ 'src/core/ext/upb-generated/envoy/config/core/v3/base.upb.c',
+ 'src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.c',
+ 'src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.c',
+ 'src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.c',
+ 'src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.c',
+ 'src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.c',
+ 'src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.c',
+ 'src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.c',
+ 'src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.c',
+ 'src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.c',
+ 'src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.c',
+ 'src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.c',
+ 'src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.c',
+ 'src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.c',
+ 'src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.c',
+ 'src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.c',
+ 'src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.c',
+ 'src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.c',
+ 'src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.c',
+ 'src/core/ext/upb-generated/envoy/config/route/v3/route.upb.c',
+ 'src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.c',
+ 'src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.c',
+ 'src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.c',
+ 'src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c',
+ 'src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.c',
+ 'src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.c',
+ 'src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.c',
+ 'src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.c',
+ 'src/core/ext/upb-generated/envoy/service/cluster/v3/cds.upb.c',
+ 'src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.c',
+ 'src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.c',
+ 'src/core/ext/upb-generated/envoy/service/endpoint/v3/eds.upb.c',
+ 'src/core/ext/upb-generated/envoy/service/listener/v3/lds.upb.c',
+ 'src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.c',
+ 'src/core/ext/upb-generated/envoy/service/route/v3/rds.upb.c',
+ 'src/core/ext/upb-generated/envoy/service/route/v3/srds.upb.c',
+ 'src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.c',
+ 'src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.c',
+ 'src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.c',
+ 'src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.c',
+ 'src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.c',
+ 'src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.c',
+ 'src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.c',
+ 'src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.c',
+ 'src/core/ext/upb-generated/envoy/type/v3/http.upb.c',
+ 'src/core/ext/upb-generated/envoy/type/v3/percent.upb.c',
+ 'src/core/ext/upb-generated/envoy/type/v3/range.upb.c',
+ 'src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.c',
'src/core/ext/upb-generated/google/api/annotations.upb.c',
- 'src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.c',
- 'src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.c',
+ 'src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.c',
+ 'src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.c',
'src/core/ext/upb-generated/google/api/http.upb.c',
'src/core/ext/upb-generated/google/protobuf/any.upb.c',
'src/core/ext/upb-generated/google/protobuf/descriptor.upb.c',
@@ -195,25 +195,25 @@ CORE_SOURCE_FILES = [
'src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c',
'src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c',
'src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c',
- 'src/core/ext/upb-generated/udpa/annotations/migrate.upb.c',
- 'src/core/ext/upb-generated/udpa/annotations/security.upb.c',
- 'src/core/ext/upb-generated/udpa/annotations/sensitive.upb.c',
- 'src/core/ext/upb-generated/udpa/annotations/status.upb.c',
- 'src/core/ext/upb-generated/udpa/annotations/versioning.upb.c',
- 'src/core/ext/upb-generated/udpa/core/v1/authority.upb.c',
- 'src/core/ext/upb-generated/udpa/core/v1/collection_entry.upb.c',
- 'src/core/ext/upb-generated/udpa/core/v1/context_params.upb.c',
- 'src/core/ext/upb-generated/udpa/core/v1/resource.upb.c',
- 'src/core/ext/upb-generated/udpa/core/v1/resource_locator.upb.c',
- 'src/core/ext/upb-generated/udpa/core/v1/resource_name.upb.c',
+ 'src/core/ext/upb-generated/udpa/annotations/migrate.upb.c',
+ 'src/core/ext/upb-generated/udpa/annotations/security.upb.c',
+ 'src/core/ext/upb-generated/udpa/annotations/sensitive.upb.c',
+ 'src/core/ext/upb-generated/udpa/annotations/status.upb.c',
+ 'src/core/ext/upb-generated/udpa/annotations/versioning.upb.c',
+ 'src/core/ext/upb-generated/udpa/core/v1/authority.upb.c',
+ 'src/core/ext/upb-generated/udpa/core/v1/collection_entry.upb.c',
+ 'src/core/ext/upb-generated/udpa/core/v1/context_params.upb.c',
+ 'src/core/ext/upb-generated/udpa/core/v1/resource.upb.c',
+ 'src/core/ext/upb-generated/udpa/core/v1/resource_locator.upb.c',
+ 'src/core/ext/upb-generated/udpa/core/v1/resource_name.upb.c',
'src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c',
'src/core/ext/upb-generated/validate/validate.upb.c',
- 'src/core/ext/xds/certificate_provider_registry.cc',
- 'src/core/ext/xds/google_mesh_ca_certificate_provider_factory.cc',
- 'src/core/ext/xds/xds_api.cc',
- 'src/core/ext/xds/xds_bootstrap.cc',
- 'src/core/ext/xds/xds_client.cc',
- 'src/core/ext/xds/xds_client_stats.cc',
+ 'src/core/ext/xds/certificate_provider_registry.cc',
+ 'src/core/ext/xds/google_mesh_ca_certificate_provider_factory.cc',
+ 'src/core/ext/xds/xds_api.cc',
+ 'src/core/ext/xds/xds_bootstrap.cc',
+ 'src/core/ext/xds/xds_client.cc',
+ 'src/core/ext/xds/xds_client_stats.cc',
'src/core/lib/avl/avl.cc',
'src/core/lib/backoff/backoff.cc',
'src/core/lib/channel/channel_args.cc',
@@ -256,7 +256,7 @@ CORE_SOURCE_FILES = [
'src/core/lib/gpr/string_util_windows.cc',
'src/core/lib/gpr/string_windows.cc',
'src/core/lib/gpr/sync.cc',
- 'src/core/lib/gpr/sync_abseil.cc',
+ 'src/core/lib/gpr/sync_abseil.cc',
'src/core/lib/gpr/sync_posix.cc',
'src/core/lib/gpr/sync_windows.cc',
'src/core/lib/gpr/time.cc',
@@ -283,7 +283,7 @@ CORE_SOURCE_FILES = [
'src/core/lib/iomgr/call_combiner.cc',
'src/core/lib/iomgr/cfstream_handle.cc',
'src/core/lib/iomgr/combiner.cc',
- 'src/core/lib/iomgr/dualstack_socket_posix.cc',
+ 'src/core/lib/iomgr/dualstack_socket_posix.cc',
'src/core/lib/iomgr/endpoint.cc',
'src/core/lib/iomgr/endpoint_cfstream.cc',
'src/core/lib/iomgr/endpoint_pair_posix.cc',
@@ -291,7 +291,7 @@ CORE_SOURCE_FILES = [
'src/core/lib/iomgr/endpoint_pair_windows.cc',
'src/core/lib/iomgr/error.cc',
'src/core/lib/iomgr/error_cfstream.cc',
- 'src/core/lib/iomgr/ev_apple.cc',
+ 'src/core/lib/iomgr/ev_apple.cc',
'src/core/lib/iomgr/ev_epoll1_linux.cc',
'src/core/lib/iomgr/ev_epollex_linux.cc',
'src/core/lib/iomgr/ev_poll_posix.cc',
@@ -320,8 +320,8 @@ CORE_SOURCE_FILES = [
'src/core/lib/iomgr/is_epollexclusive_available.cc',
'src/core/lib/iomgr/load_file.cc',
'src/core/lib/iomgr/lockfree_event.cc',
- 'src/core/lib/iomgr/parse_address.cc',
- 'src/core/lib/iomgr/poller/eventmanager_libuv.cc',
+ 'src/core/lib/iomgr/parse_address.cc',
+ 'src/core/lib/iomgr/poller/eventmanager_libuv.cc',
'src/core/lib/iomgr/polling_entity.cc',
'src/core/lib/iomgr/pollset.cc',
'src/core/lib/iomgr/pollset_custom.cc',
@@ -374,14 +374,14 @@ CORE_SOURCE_FILES = [
'src/core/lib/iomgr/wakeup_fd_nospecial.cc',
'src/core/lib/iomgr/wakeup_fd_pipe.cc',
'src/core/lib/iomgr/wakeup_fd_posix.cc',
- 'src/core/lib/iomgr/work_serializer.cc',
+ 'src/core/lib/iomgr/work_serializer.cc',
'src/core/lib/json/json_reader.cc',
- 'src/core/lib/json/json_util.cc',
+ 'src/core/lib/json/json_util.cc',
'src/core/lib/json/json_writer.cc',
'src/core/lib/profiling/basic_timers.cc',
'src/core/lib/profiling/stap_timers.cc',
- 'src/core/lib/security/authorization/authorization_engine.cc',
- 'src/core/lib/security/authorization/evaluate_args.cc',
+ 'src/core/lib/security/authorization/authorization_engine.cc',
+ 'src/core/lib/security/authorization/evaluate_args.cc',
'src/core/lib/security/context/security_context.cc',
'src/core/lib/security/credentials/alts/alts_credentials.cc',
'src/core/lib/security/credentials/alts/check_gcp_environment.cc',
@@ -405,10 +405,10 @@ CORE_SOURCE_FILES = [
'src/core/lib/security/credentials/oauth2/oauth2_credentials.cc',
'src/core/lib/security/credentials/plugin/plugin_credentials.cc',
'src/core/lib/security/credentials/ssl/ssl_credentials.cc',
- 'src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.cc',
+ 'src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.cc',
'src/core/lib/security/credentials/tls/grpc_tls_credentials_options.cc',
- 'src/core/lib/security/credentials/tls/tls_credentials.cc',
- 'src/core/lib/security/credentials/xds/xds_credentials.cc',
+ 'src/core/lib/security/credentials/tls/tls_credentials.cc',
+ 'src/core/lib/security/credentials/xds/xds_credentials.cc',
'src/core/lib/security/security_connector/alts/alts_security_connector.cc',
'src/core/lib/security/security_connector/fake/fake_security_connector.cc',
'src/core/lib/security/security_connector/load_system_roots_fallback.cc',
@@ -418,7 +418,7 @@ CORE_SOURCE_FILES = [
'src/core/lib/security/security_connector/ssl/ssl_security_connector.cc',
'src/core/lib/security/security_connector/ssl_utils.cc',
'src/core/lib/security/security_connector/ssl_utils_config.cc',
- 'src/core/lib/security/security_connector/tls/tls_security_connector.cc',
+ 'src/core/lib/security/security_connector/tls/tls_security_connector.cc',
'src/core/lib/security/transport/client_auth_filter.cc',
'src/core/lib/security/transport/secure_endpoint.cc',
'src/core/lib/security/transport/security_handshaker.cc',
@@ -451,7 +451,7 @@ CORE_SOURCE_FILES = [
'src/core/lib/surface/server.cc',
'src/core/lib/surface/validate_metadata.cc',
'src/core/lib/surface/version.cc',
- 'src/core/lib/transport/authority_override.cc',
+ 'src/core/lib/transport/authority_override.cc',
'src/core/lib/transport/bdp_estimator.cc',
'src/core/lib/transport/byte_stream.cc',
'src/core/lib/transport/connectivity_state.cc',
@@ -494,349 +494,349 @@ CORE_SOURCE_FILES = [
'src/core/tsi/ssl_transport_security.cc',
'src/core/tsi/transport_security.cc',
'src/core/tsi/transport_security_grpc.cc',
- 'third_party/abseil-cpp/y_absl/base/dynamic_annotations.cc',
- 'third_party/abseil-cpp/y_absl/base/internal/cycleclock.cc',
- 'third_party/abseil-cpp/y_absl/base/internal/exponential_biased.cc',
- 'third_party/abseil-cpp/y_absl/base/internal/low_level_alloc.cc',
- 'third_party/abseil-cpp/y_absl/base/internal/raw_logging.cc',
- 'third_party/abseil-cpp/y_absl/base/internal/spinlock.cc',
- 'third_party/abseil-cpp/y_absl/base/internal/spinlock_wait.cc',
- 'third_party/abseil-cpp/y_absl/base/internal/sysinfo.cc',
- 'third_party/abseil-cpp/y_absl/base/internal/thread_identity.cc',
- 'third_party/abseil-cpp/y_absl/base/internal/throw_delegate.cc',
- 'third_party/abseil-cpp/y_absl/base/internal/unscaledcycleclock.cc',
- 'third_party/abseil-cpp/y_absl/base/log_severity.cc',
- 'third_party/abseil-cpp/y_absl/container/internal/hashtablez_sampler.cc',
- 'third_party/abseil-cpp/y_absl/container/internal/hashtablez_sampler_force_weak_definition.cc',
- 'third_party/abseil-cpp/y_absl/container/internal/raw_hash_set.cc',
- 'third_party/abseil-cpp/y_absl/debugging/internal/address_is_readable.cc',
- 'third_party/abseil-cpp/y_absl/debugging/internal/demangle.cc',
- 'third_party/abseil-cpp/y_absl/debugging/internal/elf_mem_image.cc',
- 'third_party/abseil-cpp/y_absl/debugging/internal/vdso_support.cc',
- 'third_party/abseil-cpp/y_absl/debugging/stacktrace.cc',
- 'third_party/abseil-cpp/y_absl/debugging/symbolize.cc',
- 'third_party/abseil-cpp/y_absl/hash/internal/city.cc',
- 'third_party/abseil-cpp/y_absl/hash/internal/hash.cc',
- 'third_party/abseil-cpp/y_absl/numeric/int128.cc',
- 'third_party/abseil-cpp/y_absl/status/status.cc',
- 'third_party/abseil-cpp/y_absl/status/status_payload_printer.cc',
- 'third_party/abseil-cpp/y_absl/strings/ascii.cc',
- 'third_party/abseil-cpp/y_absl/strings/charconv.cc',
- 'third_party/abseil-cpp/y_absl/strings/cord.cc',
- 'third_party/abseil-cpp/y_absl/strings/escaping.cc',
- 'third_party/abseil-cpp/y_absl/strings/internal/charconv_bigint.cc',
- 'third_party/abseil-cpp/y_absl/strings/internal/charconv_parse.cc',
- 'third_party/abseil-cpp/y_absl/strings/internal/escaping.cc',
- 'third_party/abseil-cpp/y_absl/strings/internal/memutil.cc',
- 'third_party/abseil-cpp/y_absl/strings/internal/ostringstream.cc',
- 'third_party/abseil-cpp/y_absl/strings/internal/str_format/arg.cc',
- 'third_party/abseil-cpp/y_absl/strings/internal/str_format/bind.cc',
- 'third_party/abseil-cpp/y_absl/strings/internal/str_format/extension.cc',
- 'third_party/abseil-cpp/y_absl/strings/internal/str_format/float_conversion.cc',
- 'third_party/abseil-cpp/y_absl/strings/internal/str_format/output.cc',
- 'third_party/abseil-cpp/y_absl/strings/internal/str_format/parser.cc',
- 'third_party/abseil-cpp/y_absl/strings/internal/utf8.cc',
- 'third_party/abseil-cpp/y_absl/strings/match.cc',
- 'third_party/abseil-cpp/y_absl/strings/numbers.cc',
- 'third_party/abseil-cpp/y_absl/strings/str_cat.cc',
- 'third_party/abseil-cpp/y_absl/strings/str_replace.cc',
- 'third_party/abseil-cpp/y_absl/strings/str_split.cc',
- 'third_party/abseil-cpp/y_absl/strings/string_view.cc',
- 'third_party/abseil-cpp/y_absl/strings/substitute.cc',
- 'third_party/abseil-cpp/y_absl/synchronization/barrier.cc',
- 'third_party/abseil-cpp/y_absl/synchronization/blocking_counter.cc',
- 'third_party/abseil-cpp/y_absl/synchronization/internal/create_thread_identity.cc',
- 'third_party/abseil-cpp/y_absl/synchronization/internal/graphcycles.cc',
- 'third_party/abseil-cpp/y_absl/synchronization/internal/per_thread_sem.cc',
- 'third_party/abseil-cpp/y_absl/synchronization/internal/waiter.cc',
- 'third_party/abseil-cpp/y_absl/synchronization/mutex.cc',
- 'third_party/abseil-cpp/y_absl/synchronization/notification.cc',
- 'third_party/abseil-cpp/y_absl/time/civil_time.cc',
- 'third_party/abseil-cpp/y_absl/time/clock.cc',
- 'third_party/abseil-cpp/y_absl/time/duration.cc',
- 'third_party/abseil-cpp/y_absl/time/format.cc',
- 'third_party/abseil-cpp/y_absl/time/internal/cctz/src/civil_time_detail.cc',
- 'third_party/abseil-cpp/y_absl/time/internal/cctz/src/time_zone_fixed.cc',
- 'third_party/abseil-cpp/y_absl/time/internal/cctz/src/time_zone_format.cc',
- 'third_party/abseil-cpp/y_absl/time/internal/cctz/src/time_zone_if.cc',
- 'third_party/abseil-cpp/y_absl/time/internal/cctz/src/time_zone_impl.cc',
- 'third_party/abseil-cpp/y_absl/time/internal/cctz/src/time_zone_info.cc',
- 'third_party/abseil-cpp/y_absl/time/internal/cctz/src/time_zone_libc.cc',
- 'third_party/abseil-cpp/y_absl/time/internal/cctz/src/time_zone_lookup.cc',
- 'third_party/abseil-cpp/y_absl/time/internal/cctz/src/time_zone_posix.cc',
- 'third_party/abseil-cpp/y_absl/time/internal/cctz/src/zone_info_source.cc',
- 'third_party/abseil-cpp/y_absl/time/time.cc',
- 'third_party/abseil-cpp/y_absl/types/bad_optional_access.cc',
- 'third_party/abseil-cpp/y_absl/types/bad_variant_access.cc',
+ 'third_party/abseil-cpp/y_absl/base/dynamic_annotations.cc',
+ 'third_party/abseil-cpp/y_absl/base/internal/cycleclock.cc',
+ 'third_party/abseil-cpp/y_absl/base/internal/exponential_biased.cc',
+ 'third_party/abseil-cpp/y_absl/base/internal/low_level_alloc.cc',
+ 'third_party/abseil-cpp/y_absl/base/internal/raw_logging.cc',
+ 'third_party/abseil-cpp/y_absl/base/internal/spinlock.cc',
+ 'third_party/abseil-cpp/y_absl/base/internal/spinlock_wait.cc',
+ 'third_party/abseil-cpp/y_absl/base/internal/sysinfo.cc',
+ 'third_party/abseil-cpp/y_absl/base/internal/thread_identity.cc',
+ 'third_party/abseil-cpp/y_absl/base/internal/throw_delegate.cc',
+ 'third_party/abseil-cpp/y_absl/base/internal/unscaledcycleclock.cc',
+ 'third_party/abseil-cpp/y_absl/base/log_severity.cc',
+ 'third_party/abseil-cpp/y_absl/container/internal/hashtablez_sampler.cc',
+ 'third_party/abseil-cpp/y_absl/container/internal/hashtablez_sampler_force_weak_definition.cc',
+ 'third_party/abseil-cpp/y_absl/container/internal/raw_hash_set.cc',
+ 'third_party/abseil-cpp/y_absl/debugging/internal/address_is_readable.cc',
+ 'third_party/abseil-cpp/y_absl/debugging/internal/demangle.cc',
+ 'third_party/abseil-cpp/y_absl/debugging/internal/elf_mem_image.cc',
+ 'third_party/abseil-cpp/y_absl/debugging/internal/vdso_support.cc',
+ 'third_party/abseil-cpp/y_absl/debugging/stacktrace.cc',
+ 'third_party/abseil-cpp/y_absl/debugging/symbolize.cc',
+ 'third_party/abseil-cpp/y_absl/hash/internal/city.cc',
+ 'third_party/abseil-cpp/y_absl/hash/internal/hash.cc',
+ 'third_party/abseil-cpp/y_absl/numeric/int128.cc',
+ 'third_party/abseil-cpp/y_absl/status/status.cc',
+ 'third_party/abseil-cpp/y_absl/status/status_payload_printer.cc',
+ 'third_party/abseil-cpp/y_absl/strings/ascii.cc',
+ 'third_party/abseil-cpp/y_absl/strings/charconv.cc',
+ 'third_party/abseil-cpp/y_absl/strings/cord.cc',
+ 'third_party/abseil-cpp/y_absl/strings/escaping.cc',
+ 'third_party/abseil-cpp/y_absl/strings/internal/charconv_bigint.cc',
+ 'third_party/abseil-cpp/y_absl/strings/internal/charconv_parse.cc',
+ 'third_party/abseil-cpp/y_absl/strings/internal/escaping.cc',
+ 'third_party/abseil-cpp/y_absl/strings/internal/memutil.cc',
+ 'third_party/abseil-cpp/y_absl/strings/internal/ostringstream.cc',
+ 'third_party/abseil-cpp/y_absl/strings/internal/str_format/arg.cc',
+ 'third_party/abseil-cpp/y_absl/strings/internal/str_format/bind.cc',
+ 'third_party/abseil-cpp/y_absl/strings/internal/str_format/extension.cc',
+ 'third_party/abseil-cpp/y_absl/strings/internal/str_format/float_conversion.cc',
+ 'third_party/abseil-cpp/y_absl/strings/internal/str_format/output.cc',
+ 'third_party/abseil-cpp/y_absl/strings/internal/str_format/parser.cc',
+ 'third_party/abseil-cpp/y_absl/strings/internal/utf8.cc',
+ 'third_party/abseil-cpp/y_absl/strings/match.cc',
+ 'third_party/abseil-cpp/y_absl/strings/numbers.cc',
+ 'third_party/abseil-cpp/y_absl/strings/str_cat.cc',
+ 'third_party/abseil-cpp/y_absl/strings/str_replace.cc',
+ 'third_party/abseil-cpp/y_absl/strings/str_split.cc',
+ 'third_party/abseil-cpp/y_absl/strings/string_view.cc',
+ 'third_party/abseil-cpp/y_absl/strings/substitute.cc',
+ 'third_party/abseil-cpp/y_absl/synchronization/barrier.cc',
+ 'third_party/abseil-cpp/y_absl/synchronization/blocking_counter.cc',
+ 'third_party/abseil-cpp/y_absl/synchronization/internal/create_thread_identity.cc',
+ 'third_party/abseil-cpp/y_absl/synchronization/internal/graphcycles.cc',
+ 'third_party/abseil-cpp/y_absl/synchronization/internal/per_thread_sem.cc',
+ 'third_party/abseil-cpp/y_absl/synchronization/internal/waiter.cc',
+ 'third_party/abseil-cpp/y_absl/synchronization/mutex.cc',
+ 'third_party/abseil-cpp/y_absl/synchronization/notification.cc',
+ 'third_party/abseil-cpp/y_absl/time/civil_time.cc',
+ 'third_party/abseil-cpp/y_absl/time/clock.cc',
+ 'third_party/abseil-cpp/y_absl/time/duration.cc',
+ 'third_party/abseil-cpp/y_absl/time/format.cc',
+ 'third_party/abseil-cpp/y_absl/time/internal/cctz/src/civil_time_detail.cc',
+ 'third_party/abseil-cpp/y_absl/time/internal/cctz/src/time_zone_fixed.cc',
+ 'third_party/abseil-cpp/y_absl/time/internal/cctz/src/time_zone_format.cc',
+ 'third_party/abseil-cpp/y_absl/time/internal/cctz/src/time_zone_if.cc',
+ 'third_party/abseil-cpp/y_absl/time/internal/cctz/src/time_zone_impl.cc',
+ 'third_party/abseil-cpp/y_absl/time/internal/cctz/src/time_zone_info.cc',
+ 'third_party/abseil-cpp/y_absl/time/internal/cctz/src/time_zone_libc.cc',
+ 'third_party/abseil-cpp/y_absl/time/internal/cctz/src/time_zone_lookup.cc',
+ 'third_party/abseil-cpp/y_absl/time/internal/cctz/src/time_zone_posix.cc',
+ 'third_party/abseil-cpp/y_absl/time/internal/cctz/src/zone_info_source.cc',
+ 'third_party/abseil-cpp/y_absl/time/time.cc',
+ 'third_party/abseil-cpp/y_absl/types/bad_optional_access.cc',
+ 'third_party/abseil-cpp/y_absl/types/bad_variant_access.cc',
'third_party/address_sorting/address_sorting.c',
'third_party/address_sorting/address_sorting_posix.c',
'third_party/address_sorting/address_sorting_windows.c',
- 'third_party/boringssl-with-bazel/err_data.c',
- 'third_party/boringssl-with-bazel/src/crypto/asn1/a_bitstr.c',
- 'third_party/boringssl-with-bazel/src/crypto/asn1/a_bool.c',
- 'third_party/boringssl-with-bazel/src/crypto/asn1/a_d2i_fp.c',
- 'third_party/boringssl-with-bazel/src/crypto/asn1/a_dup.c',
- 'third_party/boringssl-with-bazel/src/crypto/asn1/a_enum.c',
- 'third_party/boringssl-with-bazel/src/crypto/asn1/a_gentm.c',
- 'third_party/boringssl-with-bazel/src/crypto/asn1/a_i2d_fp.c',
- 'third_party/boringssl-with-bazel/src/crypto/asn1/a_int.c',
- 'third_party/boringssl-with-bazel/src/crypto/asn1/a_mbstr.c',
- 'third_party/boringssl-with-bazel/src/crypto/asn1/a_object.c',
- 'third_party/boringssl-with-bazel/src/crypto/asn1/a_octet.c',
- 'third_party/boringssl-with-bazel/src/crypto/asn1/a_print.c',
- 'third_party/boringssl-with-bazel/src/crypto/asn1/a_strnid.c',
- 'third_party/boringssl-with-bazel/src/crypto/asn1/a_time.c',
- 'third_party/boringssl-with-bazel/src/crypto/asn1/a_type.c',
- 'third_party/boringssl-with-bazel/src/crypto/asn1/a_utctm.c',
- 'third_party/boringssl-with-bazel/src/crypto/asn1/a_utf8.c',
- 'third_party/boringssl-with-bazel/src/crypto/asn1/asn1_lib.c',
- 'third_party/boringssl-with-bazel/src/crypto/asn1/asn1_par.c',
- 'third_party/boringssl-with-bazel/src/crypto/asn1/asn_pack.c',
- 'third_party/boringssl-with-bazel/src/crypto/asn1/f_enum.c',
- 'third_party/boringssl-with-bazel/src/crypto/asn1/f_int.c',
- 'third_party/boringssl-with-bazel/src/crypto/asn1/f_string.c',
- 'third_party/boringssl-with-bazel/src/crypto/asn1/tasn_dec.c',
- 'third_party/boringssl-with-bazel/src/crypto/asn1/tasn_enc.c',
- 'third_party/boringssl-with-bazel/src/crypto/asn1/tasn_fre.c',
- 'third_party/boringssl-with-bazel/src/crypto/asn1/tasn_new.c',
- 'third_party/boringssl-with-bazel/src/crypto/asn1/tasn_typ.c',
- 'third_party/boringssl-with-bazel/src/crypto/asn1/tasn_utl.c',
- 'third_party/boringssl-with-bazel/src/crypto/asn1/time_support.c',
- 'third_party/boringssl-with-bazel/src/crypto/base64/base64.c',
- 'third_party/boringssl-with-bazel/src/crypto/bio/bio.c',
- 'third_party/boringssl-with-bazel/src/crypto/bio/bio_mem.c',
- 'third_party/boringssl-with-bazel/src/crypto/bio/connect.c',
- 'third_party/boringssl-with-bazel/src/crypto/bio/fd.c',
- 'third_party/boringssl-with-bazel/src/crypto/bio/file.c',
- 'third_party/boringssl-with-bazel/src/crypto/bio/hexdump.c',
- 'third_party/boringssl-with-bazel/src/crypto/bio/pair.c',
- 'third_party/boringssl-with-bazel/src/crypto/bio/printf.c',
- 'third_party/boringssl-with-bazel/src/crypto/bio/socket.c',
- 'third_party/boringssl-with-bazel/src/crypto/bio/socket_helper.c',
- 'third_party/boringssl-with-bazel/src/crypto/bn_extra/bn_asn1.c',
- 'third_party/boringssl-with-bazel/src/crypto/bn_extra/convert.c',
- 'third_party/boringssl-with-bazel/src/crypto/buf/buf.c',
- 'third_party/boringssl-with-bazel/src/crypto/bytestring/asn1_compat.c',
- 'third_party/boringssl-with-bazel/src/crypto/bytestring/ber.c',
- 'third_party/boringssl-with-bazel/src/crypto/bytestring/cbb.c',
- 'third_party/boringssl-with-bazel/src/crypto/bytestring/cbs.c',
- 'third_party/boringssl-with-bazel/src/crypto/bytestring/unicode.c',
- 'third_party/boringssl-with-bazel/src/crypto/chacha/chacha.c',
- 'third_party/boringssl-with-bazel/src/crypto/cipher_extra/cipher_extra.c',
- 'third_party/boringssl-with-bazel/src/crypto/cipher_extra/derive_key.c',
- 'third_party/boringssl-with-bazel/src/crypto/cipher_extra/e_aesccm.c',
- 'third_party/boringssl-with-bazel/src/crypto/cipher_extra/e_aesctrhmac.c',
- 'third_party/boringssl-with-bazel/src/crypto/cipher_extra/e_aesgcmsiv.c',
- 'third_party/boringssl-with-bazel/src/crypto/cipher_extra/e_chacha20poly1305.c',
- 'third_party/boringssl-with-bazel/src/crypto/cipher_extra/e_null.c',
- 'third_party/boringssl-with-bazel/src/crypto/cipher_extra/e_rc2.c',
- 'third_party/boringssl-with-bazel/src/crypto/cipher_extra/e_rc4.c',
- 'third_party/boringssl-with-bazel/src/crypto/cipher_extra/e_tls.c',
- 'third_party/boringssl-with-bazel/src/crypto/cipher_extra/tls_cbc.c',
- 'third_party/boringssl-with-bazel/src/crypto/cmac/cmac.c',
- 'third_party/boringssl-with-bazel/src/crypto/conf/conf.c',
- 'third_party/boringssl-with-bazel/src/crypto/cpu-aarch64-fuchsia.c',
- 'third_party/boringssl-with-bazel/src/crypto/cpu-aarch64-linux.c',
- 'third_party/boringssl-with-bazel/src/crypto/cpu-arm-linux.c',
- 'third_party/boringssl-with-bazel/src/crypto/cpu-arm.c',
- 'third_party/boringssl-with-bazel/src/crypto/cpu-intel.c',
- 'third_party/boringssl-with-bazel/src/crypto/cpu-ppc64le.c',
- 'third_party/boringssl-with-bazel/src/crypto/crypto.c',
- 'third_party/boringssl-with-bazel/src/crypto/curve25519/curve25519.c',
- 'third_party/boringssl-with-bazel/src/crypto/curve25519/spake25519.c',
- 'third_party/boringssl-with-bazel/src/crypto/dh/check.c',
- 'third_party/boringssl-with-bazel/src/crypto/dh/dh.c',
- 'third_party/boringssl-with-bazel/src/crypto/dh/dh_asn1.c',
- 'third_party/boringssl-with-bazel/src/crypto/dh/params.c',
- 'third_party/boringssl-with-bazel/src/crypto/digest_extra/digest_extra.c',
- 'third_party/boringssl-with-bazel/src/crypto/dsa/dsa.c',
- 'third_party/boringssl-with-bazel/src/crypto/dsa/dsa_asn1.c',
- 'third_party/boringssl-with-bazel/src/crypto/ec_extra/ec_asn1.c',
- 'third_party/boringssl-with-bazel/src/crypto/ec_extra/ec_derive.c',
- 'third_party/boringssl-with-bazel/src/crypto/ec_extra/hash_to_curve.c',
- 'third_party/boringssl-with-bazel/src/crypto/ecdh_extra/ecdh_extra.c',
- 'third_party/boringssl-with-bazel/src/crypto/ecdsa_extra/ecdsa_asn1.c',
- 'third_party/boringssl-with-bazel/src/crypto/engine/engine.c',
- 'third_party/boringssl-with-bazel/src/crypto/err/err.c',
- 'third_party/boringssl-with-bazel/src/crypto/evp/digestsign.c',
- 'third_party/boringssl-with-bazel/src/crypto/evp/evp.c',
- 'third_party/boringssl-with-bazel/src/crypto/evp/evp_asn1.c',
- 'third_party/boringssl-with-bazel/src/crypto/evp/evp_ctx.c',
- 'third_party/boringssl-with-bazel/src/crypto/evp/p_dsa_asn1.c',
- 'third_party/boringssl-with-bazel/src/crypto/evp/p_ec.c',
- 'third_party/boringssl-with-bazel/src/crypto/evp/p_ec_asn1.c',
- 'third_party/boringssl-with-bazel/src/crypto/evp/p_ed25519.c',
- 'third_party/boringssl-with-bazel/src/crypto/evp/p_ed25519_asn1.c',
- 'third_party/boringssl-with-bazel/src/crypto/evp/p_rsa.c',
- 'third_party/boringssl-with-bazel/src/crypto/evp/p_rsa_asn1.c',
- 'third_party/boringssl-with-bazel/src/crypto/evp/p_x25519.c',
- 'third_party/boringssl-with-bazel/src/crypto/evp/p_x25519_asn1.c',
- 'third_party/boringssl-with-bazel/src/crypto/evp/pbkdf.c',
- 'third_party/boringssl-with-bazel/src/crypto/evp/print.c',
- 'third_party/boringssl-with-bazel/src/crypto/evp/scrypt.c',
- 'third_party/boringssl-with-bazel/src/crypto/evp/sign.c',
- 'third_party/boringssl-with-bazel/src/crypto/ex_data.c',
- 'third_party/boringssl-with-bazel/src/crypto/fipsmodule/bcm.c',
- 'third_party/boringssl-with-bazel/src/crypto/fipsmodule/fips_shared_support.c',
- 'third_party/boringssl-with-bazel/src/crypto/fipsmodule/is_fips.c',
- 'third_party/boringssl-with-bazel/src/crypto/hkdf/hkdf.c',
- 'third_party/boringssl-with-bazel/src/crypto/hpke/hpke.c',
- 'third_party/boringssl-with-bazel/src/crypto/hrss/hrss.c',
- 'third_party/boringssl-with-bazel/src/crypto/lhash/lhash.c',
- 'third_party/boringssl-with-bazel/src/crypto/mem.c',
- 'third_party/boringssl-with-bazel/src/crypto/obj/obj.c',
- 'third_party/boringssl-with-bazel/src/crypto/obj/obj_xref.c',
- 'third_party/boringssl-with-bazel/src/crypto/pem/pem_all.c',
- 'third_party/boringssl-with-bazel/src/crypto/pem/pem_info.c',
- 'third_party/boringssl-with-bazel/src/crypto/pem/pem_lib.c',
- 'third_party/boringssl-with-bazel/src/crypto/pem/pem_oth.c',
- 'third_party/boringssl-with-bazel/src/crypto/pem/pem_pk8.c',
- 'third_party/boringssl-with-bazel/src/crypto/pem/pem_pkey.c',
- 'third_party/boringssl-with-bazel/src/crypto/pem/pem_x509.c',
- 'third_party/boringssl-with-bazel/src/crypto/pem/pem_xaux.c',
- 'third_party/boringssl-with-bazel/src/crypto/pkcs7/pkcs7.c',
- 'third_party/boringssl-with-bazel/src/crypto/pkcs7/pkcs7_x509.c',
- 'third_party/boringssl-with-bazel/src/crypto/pkcs8/p5_pbev2.c',
- 'third_party/boringssl-with-bazel/src/crypto/pkcs8/pkcs8.c',
- 'third_party/boringssl-with-bazel/src/crypto/pkcs8/pkcs8_x509.c',
- 'third_party/boringssl-with-bazel/src/crypto/poly1305/poly1305.c',
- 'third_party/boringssl-with-bazel/src/crypto/poly1305/poly1305_arm.c',
- 'third_party/boringssl-with-bazel/src/crypto/poly1305/poly1305_vec.c',
- 'third_party/boringssl-with-bazel/src/crypto/pool/pool.c',
- 'third_party/boringssl-with-bazel/src/crypto/rand_extra/deterministic.c',
- 'third_party/boringssl-with-bazel/src/crypto/rand_extra/forkunsafe.c',
- 'third_party/boringssl-with-bazel/src/crypto/rand_extra/fuchsia.c',
- 'third_party/boringssl-with-bazel/src/crypto/rand_extra/rand_extra.c',
- 'third_party/boringssl-with-bazel/src/crypto/rand_extra/windows.c',
- 'third_party/boringssl-with-bazel/src/crypto/rc4/rc4.c',
- 'third_party/boringssl-with-bazel/src/crypto/refcount_c11.c',
- 'third_party/boringssl-with-bazel/src/crypto/refcount_lock.c',
- 'third_party/boringssl-with-bazel/src/crypto/rsa_extra/rsa_asn1.c',
- 'third_party/boringssl-with-bazel/src/crypto/rsa_extra/rsa_print.c',
- 'third_party/boringssl-with-bazel/src/crypto/siphash/siphash.c',
- 'third_party/boringssl-with-bazel/src/crypto/stack/stack.c',
- 'third_party/boringssl-with-bazel/src/crypto/thread.c',
- 'third_party/boringssl-with-bazel/src/crypto/thread_none.c',
- 'third_party/boringssl-with-bazel/src/crypto/thread_pthread.c',
- 'third_party/boringssl-with-bazel/src/crypto/thread_win.c',
- 'third_party/boringssl-with-bazel/src/crypto/trust_token/pmbtoken.c',
- 'third_party/boringssl-with-bazel/src/crypto/trust_token/trust_token.c',
- 'third_party/boringssl-with-bazel/src/crypto/x509/a_digest.c',
- 'third_party/boringssl-with-bazel/src/crypto/x509/a_sign.c',
- 'third_party/boringssl-with-bazel/src/crypto/x509/a_strex.c',
- 'third_party/boringssl-with-bazel/src/crypto/x509/a_verify.c',
- 'third_party/boringssl-with-bazel/src/crypto/x509/algorithm.c',
- 'third_party/boringssl-with-bazel/src/crypto/x509/asn1_gen.c',
- 'third_party/boringssl-with-bazel/src/crypto/x509/by_dir.c',
- 'third_party/boringssl-with-bazel/src/crypto/x509/by_file.c',
- 'third_party/boringssl-with-bazel/src/crypto/x509/i2d_pr.c',
- 'third_party/boringssl-with-bazel/src/crypto/x509/rsa_pss.c',
- 'third_party/boringssl-with-bazel/src/crypto/x509/t_crl.c',
- 'third_party/boringssl-with-bazel/src/crypto/x509/t_req.c',
- 'third_party/boringssl-with-bazel/src/crypto/x509/t_x509.c',
- 'third_party/boringssl-with-bazel/src/crypto/x509/t_x509a.c',
- 'third_party/boringssl-with-bazel/src/crypto/x509/x509.c',
- 'third_party/boringssl-with-bazel/src/crypto/x509/x509_att.c',
- 'third_party/boringssl-with-bazel/src/crypto/x509/x509_cmp.c',
- 'third_party/boringssl-with-bazel/src/crypto/x509/x509_d2.c',
- 'third_party/boringssl-with-bazel/src/crypto/x509/x509_def.c',
- 'third_party/boringssl-with-bazel/src/crypto/x509/x509_ext.c',
- 'third_party/boringssl-with-bazel/src/crypto/x509/x509_lu.c',
- 'third_party/boringssl-with-bazel/src/crypto/x509/x509_obj.c',
- 'third_party/boringssl-with-bazel/src/crypto/x509/x509_r2x.c',
- 'third_party/boringssl-with-bazel/src/crypto/x509/x509_req.c',
- 'third_party/boringssl-with-bazel/src/crypto/x509/x509_set.c',
- 'third_party/boringssl-with-bazel/src/crypto/x509/x509_trs.c',
- 'third_party/boringssl-with-bazel/src/crypto/x509/x509_txt.c',
- 'third_party/boringssl-with-bazel/src/crypto/x509/x509_v3.c',
- 'third_party/boringssl-with-bazel/src/crypto/x509/x509_vfy.c',
- 'third_party/boringssl-with-bazel/src/crypto/x509/x509_vpm.c',
- 'third_party/boringssl-with-bazel/src/crypto/x509/x509cset.c',
- 'third_party/boringssl-with-bazel/src/crypto/x509/x509name.c',
- 'third_party/boringssl-with-bazel/src/crypto/x509/x509rset.c',
- 'third_party/boringssl-with-bazel/src/crypto/x509/x509spki.c',
- 'third_party/boringssl-with-bazel/src/crypto/x509/x_algor.c',
- 'third_party/boringssl-with-bazel/src/crypto/x509/x_all.c',
- 'third_party/boringssl-with-bazel/src/crypto/x509/x_attrib.c',
- 'third_party/boringssl-with-bazel/src/crypto/x509/x_crl.c',
- 'third_party/boringssl-with-bazel/src/crypto/x509/x_exten.c',
- 'third_party/boringssl-with-bazel/src/crypto/x509/x_info.c',
- 'third_party/boringssl-with-bazel/src/crypto/x509/x_name.c',
- 'third_party/boringssl-with-bazel/src/crypto/x509/x_pkey.c',
- 'third_party/boringssl-with-bazel/src/crypto/x509/x_pubkey.c',
- 'third_party/boringssl-with-bazel/src/crypto/x509/x_req.c',
- 'third_party/boringssl-with-bazel/src/crypto/x509/x_sig.c',
- 'third_party/boringssl-with-bazel/src/crypto/x509/x_spki.c',
- 'third_party/boringssl-with-bazel/src/crypto/x509/x_val.c',
- 'third_party/boringssl-with-bazel/src/crypto/x509/x_x509.c',
- 'third_party/boringssl-with-bazel/src/crypto/x509/x_x509a.c',
- 'third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_cache.c',
- 'third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_data.c',
- 'third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_lib.c',
- 'third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_map.c',
- 'third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_node.c',
- 'third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_tree.c',
- 'third_party/boringssl-with-bazel/src/crypto/x509v3/v3_akey.c',
- 'third_party/boringssl-with-bazel/src/crypto/x509v3/v3_akeya.c',
- 'third_party/boringssl-with-bazel/src/crypto/x509v3/v3_alt.c',
- 'third_party/boringssl-with-bazel/src/crypto/x509v3/v3_bcons.c',
- 'third_party/boringssl-with-bazel/src/crypto/x509v3/v3_bitst.c',
- 'third_party/boringssl-with-bazel/src/crypto/x509v3/v3_conf.c',
- 'third_party/boringssl-with-bazel/src/crypto/x509v3/v3_cpols.c',
- 'third_party/boringssl-with-bazel/src/crypto/x509v3/v3_crld.c',
- 'third_party/boringssl-with-bazel/src/crypto/x509v3/v3_enum.c',
- 'third_party/boringssl-with-bazel/src/crypto/x509v3/v3_extku.c',
- 'third_party/boringssl-with-bazel/src/crypto/x509v3/v3_genn.c',
- 'third_party/boringssl-with-bazel/src/crypto/x509v3/v3_ia5.c',
- 'third_party/boringssl-with-bazel/src/crypto/x509v3/v3_info.c',
- 'third_party/boringssl-with-bazel/src/crypto/x509v3/v3_int.c',
- 'third_party/boringssl-with-bazel/src/crypto/x509v3/v3_lib.c',
- 'third_party/boringssl-with-bazel/src/crypto/x509v3/v3_ncons.c',
- 'third_party/boringssl-with-bazel/src/crypto/x509v3/v3_ocsp.c',
- 'third_party/boringssl-with-bazel/src/crypto/x509v3/v3_pci.c',
- 'third_party/boringssl-with-bazel/src/crypto/x509v3/v3_pcia.c',
- 'third_party/boringssl-with-bazel/src/crypto/x509v3/v3_pcons.c',
- 'third_party/boringssl-with-bazel/src/crypto/x509v3/v3_pmaps.c',
- 'third_party/boringssl-with-bazel/src/crypto/x509v3/v3_prn.c',
- 'third_party/boringssl-with-bazel/src/crypto/x509v3/v3_purp.c',
- 'third_party/boringssl-with-bazel/src/crypto/x509v3/v3_skey.c',
- 'third_party/boringssl-with-bazel/src/crypto/x509v3/v3_utl.c',
- 'third_party/boringssl-with-bazel/src/ssl/bio_ssl.cc',
- 'third_party/boringssl-with-bazel/src/ssl/d1_both.cc',
- 'third_party/boringssl-with-bazel/src/ssl/d1_lib.cc',
- 'third_party/boringssl-with-bazel/src/ssl/d1_pkt.cc',
- 'third_party/boringssl-with-bazel/src/ssl/d1_srtp.cc',
- 'third_party/boringssl-with-bazel/src/ssl/dtls_method.cc',
- 'third_party/boringssl-with-bazel/src/ssl/dtls_record.cc',
- 'third_party/boringssl-with-bazel/src/ssl/handoff.cc',
- 'third_party/boringssl-with-bazel/src/ssl/handshake.cc',
- 'third_party/boringssl-with-bazel/src/ssl/handshake_client.cc',
- 'third_party/boringssl-with-bazel/src/ssl/handshake_server.cc',
- 'third_party/boringssl-with-bazel/src/ssl/s3_both.cc',
- 'third_party/boringssl-with-bazel/src/ssl/s3_lib.cc',
- 'third_party/boringssl-with-bazel/src/ssl/s3_pkt.cc',
- 'third_party/boringssl-with-bazel/src/ssl/ssl_aead_ctx.cc',
- 'third_party/boringssl-with-bazel/src/ssl/ssl_asn1.cc',
- 'third_party/boringssl-with-bazel/src/ssl/ssl_buffer.cc',
- 'third_party/boringssl-with-bazel/src/ssl/ssl_cert.cc',
- 'third_party/boringssl-with-bazel/src/ssl/ssl_cipher.cc',
- 'third_party/boringssl-with-bazel/src/ssl/ssl_file.cc',
- 'third_party/boringssl-with-bazel/src/ssl/ssl_key_share.cc',
- 'third_party/boringssl-with-bazel/src/ssl/ssl_lib.cc',
- 'third_party/boringssl-with-bazel/src/ssl/ssl_privkey.cc',
- 'third_party/boringssl-with-bazel/src/ssl/ssl_session.cc',
- 'third_party/boringssl-with-bazel/src/ssl/ssl_stat.cc',
- 'third_party/boringssl-with-bazel/src/ssl/ssl_transcript.cc',
- 'third_party/boringssl-with-bazel/src/ssl/ssl_versions.cc',
- 'third_party/boringssl-with-bazel/src/ssl/ssl_x509.cc',
- 'third_party/boringssl-with-bazel/src/ssl/t1_enc.cc',
- 'third_party/boringssl-with-bazel/src/ssl/t1_lib.cc',
- 'third_party/boringssl-with-bazel/src/ssl/tls13_both.cc',
- 'third_party/boringssl-with-bazel/src/ssl/tls13_client.cc',
- 'third_party/boringssl-with-bazel/src/ssl/tls13_enc.cc',
- 'third_party/boringssl-with-bazel/src/ssl/tls13_server.cc',
- 'third_party/boringssl-with-bazel/src/ssl/tls_method.cc',
- 'third_party/boringssl-with-bazel/src/ssl/tls_record.cc',
+ 'third_party/boringssl-with-bazel/err_data.c',
+ 'third_party/boringssl-with-bazel/src/crypto/asn1/a_bitstr.c',
+ 'third_party/boringssl-with-bazel/src/crypto/asn1/a_bool.c',
+ 'third_party/boringssl-with-bazel/src/crypto/asn1/a_d2i_fp.c',
+ 'third_party/boringssl-with-bazel/src/crypto/asn1/a_dup.c',
+ 'third_party/boringssl-with-bazel/src/crypto/asn1/a_enum.c',
+ 'third_party/boringssl-with-bazel/src/crypto/asn1/a_gentm.c',
+ 'third_party/boringssl-with-bazel/src/crypto/asn1/a_i2d_fp.c',
+ 'third_party/boringssl-with-bazel/src/crypto/asn1/a_int.c',
+ 'third_party/boringssl-with-bazel/src/crypto/asn1/a_mbstr.c',
+ 'third_party/boringssl-with-bazel/src/crypto/asn1/a_object.c',
+ 'third_party/boringssl-with-bazel/src/crypto/asn1/a_octet.c',
+ 'third_party/boringssl-with-bazel/src/crypto/asn1/a_print.c',
+ 'third_party/boringssl-with-bazel/src/crypto/asn1/a_strnid.c',
+ 'third_party/boringssl-with-bazel/src/crypto/asn1/a_time.c',
+ 'third_party/boringssl-with-bazel/src/crypto/asn1/a_type.c',
+ 'third_party/boringssl-with-bazel/src/crypto/asn1/a_utctm.c',
+ 'third_party/boringssl-with-bazel/src/crypto/asn1/a_utf8.c',
+ 'third_party/boringssl-with-bazel/src/crypto/asn1/asn1_lib.c',
+ 'third_party/boringssl-with-bazel/src/crypto/asn1/asn1_par.c',
+ 'third_party/boringssl-with-bazel/src/crypto/asn1/asn_pack.c',
+ 'third_party/boringssl-with-bazel/src/crypto/asn1/f_enum.c',
+ 'third_party/boringssl-with-bazel/src/crypto/asn1/f_int.c',
+ 'third_party/boringssl-with-bazel/src/crypto/asn1/f_string.c',
+ 'third_party/boringssl-with-bazel/src/crypto/asn1/tasn_dec.c',
+ 'third_party/boringssl-with-bazel/src/crypto/asn1/tasn_enc.c',
+ 'third_party/boringssl-with-bazel/src/crypto/asn1/tasn_fre.c',
+ 'third_party/boringssl-with-bazel/src/crypto/asn1/tasn_new.c',
+ 'third_party/boringssl-with-bazel/src/crypto/asn1/tasn_typ.c',
+ 'third_party/boringssl-with-bazel/src/crypto/asn1/tasn_utl.c',
+ 'third_party/boringssl-with-bazel/src/crypto/asn1/time_support.c',
+ 'third_party/boringssl-with-bazel/src/crypto/base64/base64.c',
+ 'third_party/boringssl-with-bazel/src/crypto/bio/bio.c',
+ 'third_party/boringssl-with-bazel/src/crypto/bio/bio_mem.c',
+ 'third_party/boringssl-with-bazel/src/crypto/bio/connect.c',
+ 'third_party/boringssl-with-bazel/src/crypto/bio/fd.c',
+ 'third_party/boringssl-with-bazel/src/crypto/bio/file.c',
+ 'third_party/boringssl-with-bazel/src/crypto/bio/hexdump.c',
+ 'third_party/boringssl-with-bazel/src/crypto/bio/pair.c',
+ 'third_party/boringssl-with-bazel/src/crypto/bio/printf.c',
+ 'third_party/boringssl-with-bazel/src/crypto/bio/socket.c',
+ 'third_party/boringssl-with-bazel/src/crypto/bio/socket_helper.c',
+ 'third_party/boringssl-with-bazel/src/crypto/bn_extra/bn_asn1.c',
+ 'third_party/boringssl-with-bazel/src/crypto/bn_extra/convert.c',
+ 'third_party/boringssl-with-bazel/src/crypto/buf/buf.c',
+ 'third_party/boringssl-with-bazel/src/crypto/bytestring/asn1_compat.c',
+ 'third_party/boringssl-with-bazel/src/crypto/bytestring/ber.c',
+ 'third_party/boringssl-with-bazel/src/crypto/bytestring/cbb.c',
+ 'third_party/boringssl-with-bazel/src/crypto/bytestring/cbs.c',
+ 'third_party/boringssl-with-bazel/src/crypto/bytestring/unicode.c',
+ 'third_party/boringssl-with-bazel/src/crypto/chacha/chacha.c',
+ 'third_party/boringssl-with-bazel/src/crypto/cipher_extra/cipher_extra.c',
+ 'third_party/boringssl-with-bazel/src/crypto/cipher_extra/derive_key.c',
+ 'third_party/boringssl-with-bazel/src/crypto/cipher_extra/e_aesccm.c',
+ 'third_party/boringssl-with-bazel/src/crypto/cipher_extra/e_aesctrhmac.c',
+ 'third_party/boringssl-with-bazel/src/crypto/cipher_extra/e_aesgcmsiv.c',
+ 'third_party/boringssl-with-bazel/src/crypto/cipher_extra/e_chacha20poly1305.c',
+ 'third_party/boringssl-with-bazel/src/crypto/cipher_extra/e_null.c',
+ 'third_party/boringssl-with-bazel/src/crypto/cipher_extra/e_rc2.c',
+ 'third_party/boringssl-with-bazel/src/crypto/cipher_extra/e_rc4.c',
+ 'third_party/boringssl-with-bazel/src/crypto/cipher_extra/e_tls.c',
+ 'third_party/boringssl-with-bazel/src/crypto/cipher_extra/tls_cbc.c',
+ 'third_party/boringssl-with-bazel/src/crypto/cmac/cmac.c',
+ 'third_party/boringssl-with-bazel/src/crypto/conf/conf.c',
+ 'third_party/boringssl-with-bazel/src/crypto/cpu-aarch64-fuchsia.c',
+ 'third_party/boringssl-with-bazel/src/crypto/cpu-aarch64-linux.c',
+ 'third_party/boringssl-with-bazel/src/crypto/cpu-arm-linux.c',
+ 'third_party/boringssl-with-bazel/src/crypto/cpu-arm.c',
+ 'third_party/boringssl-with-bazel/src/crypto/cpu-intel.c',
+ 'third_party/boringssl-with-bazel/src/crypto/cpu-ppc64le.c',
+ 'third_party/boringssl-with-bazel/src/crypto/crypto.c',
+ 'third_party/boringssl-with-bazel/src/crypto/curve25519/curve25519.c',
+ 'third_party/boringssl-with-bazel/src/crypto/curve25519/spake25519.c',
+ 'third_party/boringssl-with-bazel/src/crypto/dh/check.c',
+ 'third_party/boringssl-with-bazel/src/crypto/dh/dh.c',
+ 'third_party/boringssl-with-bazel/src/crypto/dh/dh_asn1.c',
+ 'third_party/boringssl-with-bazel/src/crypto/dh/params.c',
+ 'third_party/boringssl-with-bazel/src/crypto/digest_extra/digest_extra.c',
+ 'third_party/boringssl-with-bazel/src/crypto/dsa/dsa.c',
+ 'third_party/boringssl-with-bazel/src/crypto/dsa/dsa_asn1.c',
+ 'third_party/boringssl-with-bazel/src/crypto/ec_extra/ec_asn1.c',
+ 'third_party/boringssl-with-bazel/src/crypto/ec_extra/ec_derive.c',
+ 'third_party/boringssl-with-bazel/src/crypto/ec_extra/hash_to_curve.c',
+ 'third_party/boringssl-with-bazel/src/crypto/ecdh_extra/ecdh_extra.c',
+ 'third_party/boringssl-with-bazel/src/crypto/ecdsa_extra/ecdsa_asn1.c',
+ 'third_party/boringssl-with-bazel/src/crypto/engine/engine.c',
+ 'third_party/boringssl-with-bazel/src/crypto/err/err.c',
+ 'third_party/boringssl-with-bazel/src/crypto/evp/digestsign.c',
+ 'third_party/boringssl-with-bazel/src/crypto/evp/evp.c',
+ 'third_party/boringssl-with-bazel/src/crypto/evp/evp_asn1.c',
+ 'third_party/boringssl-with-bazel/src/crypto/evp/evp_ctx.c',
+ 'third_party/boringssl-with-bazel/src/crypto/evp/p_dsa_asn1.c',
+ 'third_party/boringssl-with-bazel/src/crypto/evp/p_ec.c',
+ 'third_party/boringssl-with-bazel/src/crypto/evp/p_ec_asn1.c',
+ 'third_party/boringssl-with-bazel/src/crypto/evp/p_ed25519.c',
+ 'third_party/boringssl-with-bazel/src/crypto/evp/p_ed25519_asn1.c',
+ 'third_party/boringssl-with-bazel/src/crypto/evp/p_rsa.c',
+ 'third_party/boringssl-with-bazel/src/crypto/evp/p_rsa_asn1.c',
+ 'third_party/boringssl-with-bazel/src/crypto/evp/p_x25519.c',
+ 'third_party/boringssl-with-bazel/src/crypto/evp/p_x25519_asn1.c',
+ 'third_party/boringssl-with-bazel/src/crypto/evp/pbkdf.c',
+ 'third_party/boringssl-with-bazel/src/crypto/evp/print.c',
+ 'third_party/boringssl-with-bazel/src/crypto/evp/scrypt.c',
+ 'third_party/boringssl-with-bazel/src/crypto/evp/sign.c',
+ 'third_party/boringssl-with-bazel/src/crypto/ex_data.c',
+ 'third_party/boringssl-with-bazel/src/crypto/fipsmodule/bcm.c',
+ 'third_party/boringssl-with-bazel/src/crypto/fipsmodule/fips_shared_support.c',
+ 'third_party/boringssl-with-bazel/src/crypto/fipsmodule/is_fips.c',
+ 'third_party/boringssl-with-bazel/src/crypto/hkdf/hkdf.c',
+ 'third_party/boringssl-with-bazel/src/crypto/hpke/hpke.c',
+ 'third_party/boringssl-with-bazel/src/crypto/hrss/hrss.c',
+ 'third_party/boringssl-with-bazel/src/crypto/lhash/lhash.c',
+ 'third_party/boringssl-with-bazel/src/crypto/mem.c',
+ 'third_party/boringssl-with-bazel/src/crypto/obj/obj.c',
+ 'third_party/boringssl-with-bazel/src/crypto/obj/obj_xref.c',
+ 'third_party/boringssl-with-bazel/src/crypto/pem/pem_all.c',
+ 'third_party/boringssl-with-bazel/src/crypto/pem/pem_info.c',
+ 'third_party/boringssl-with-bazel/src/crypto/pem/pem_lib.c',
+ 'third_party/boringssl-with-bazel/src/crypto/pem/pem_oth.c',
+ 'third_party/boringssl-with-bazel/src/crypto/pem/pem_pk8.c',
+ 'third_party/boringssl-with-bazel/src/crypto/pem/pem_pkey.c',
+ 'third_party/boringssl-with-bazel/src/crypto/pem/pem_x509.c',
+ 'third_party/boringssl-with-bazel/src/crypto/pem/pem_xaux.c',
+ 'third_party/boringssl-with-bazel/src/crypto/pkcs7/pkcs7.c',
+ 'third_party/boringssl-with-bazel/src/crypto/pkcs7/pkcs7_x509.c',
+ 'third_party/boringssl-with-bazel/src/crypto/pkcs8/p5_pbev2.c',
+ 'third_party/boringssl-with-bazel/src/crypto/pkcs8/pkcs8.c',
+ 'third_party/boringssl-with-bazel/src/crypto/pkcs8/pkcs8_x509.c',
+ 'third_party/boringssl-with-bazel/src/crypto/poly1305/poly1305.c',
+ 'third_party/boringssl-with-bazel/src/crypto/poly1305/poly1305_arm.c',
+ 'third_party/boringssl-with-bazel/src/crypto/poly1305/poly1305_vec.c',
+ 'third_party/boringssl-with-bazel/src/crypto/pool/pool.c',
+ 'third_party/boringssl-with-bazel/src/crypto/rand_extra/deterministic.c',
+ 'third_party/boringssl-with-bazel/src/crypto/rand_extra/forkunsafe.c',
+ 'third_party/boringssl-with-bazel/src/crypto/rand_extra/fuchsia.c',
+ 'third_party/boringssl-with-bazel/src/crypto/rand_extra/rand_extra.c',
+ 'third_party/boringssl-with-bazel/src/crypto/rand_extra/windows.c',
+ 'third_party/boringssl-with-bazel/src/crypto/rc4/rc4.c',
+ 'third_party/boringssl-with-bazel/src/crypto/refcount_c11.c',
+ 'third_party/boringssl-with-bazel/src/crypto/refcount_lock.c',
+ 'third_party/boringssl-with-bazel/src/crypto/rsa_extra/rsa_asn1.c',
+ 'third_party/boringssl-with-bazel/src/crypto/rsa_extra/rsa_print.c',
+ 'third_party/boringssl-with-bazel/src/crypto/siphash/siphash.c',
+ 'third_party/boringssl-with-bazel/src/crypto/stack/stack.c',
+ 'third_party/boringssl-with-bazel/src/crypto/thread.c',
+ 'third_party/boringssl-with-bazel/src/crypto/thread_none.c',
+ 'third_party/boringssl-with-bazel/src/crypto/thread_pthread.c',
+ 'third_party/boringssl-with-bazel/src/crypto/thread_win.c',
+ 'third_party/boringssl-with-bazel/src/crypto/trust_token/pmbtoken.c',
+ 'third_party/boringssl-with-bazel/src/crypto/trust_token/trust_token.c',
+ 'third_party/boringssl-with-bazel/src/crypto/x509/a_digest.c',
+ 'third_party/boringssl-with-bazel/src/crypto/x509/a_sign.c',
+ 'third_party/boringssl-with-bazel/src/crypto/x509/a_strex.c',
+ 'third_party/boringssl-with-bazel/src/crypto/x509/a_verify.c',
+ 'third_party/boringssl-with-bazel/src/crypto/x509/algorithm.c',
+ 'third_party/boringssl-with-bazel/src/crypto/x509/asn1_gen.c',
+ 'third_party/boringssl-with-bazel/src/crypto/x509/by_dir.c',
+ 'third_party/boringssl-with-bazel/src/crypto/x509/by_file.c',
+ 'third_party/boringssl-with-bazel/src/crypto/x509/i2d_pr.c',
+ 'third_party/boringssl-with-bazel/src/crypto/x509/rsa_pss.c',
+ 'third_party/boringssl-with-bazel/src/crypto/x509/t_crl.c',
+ 'third_party/boringssl-with-bazel/src/crypto/x509/t_req.c',
+ 'third_party/boringssl-with-bazel/src/crypto/x509/t_x509.c',
+ 'third_party/boringssl-with-bazel/src/crypto/x509/t_x509a.c',
+ 'third_party/boringssl-with-bazel/src/crypto/x509/x509.c',
+ 'third_party/boringssl-with-bazel/src/crypto/x509/x509_att.c',
+ 'third_party/boringssl-with-bazel/src/crypto/x509/x509_cmp.c',
+ 'third_party/boringssl-with-bazel/src/crypto/x509/x509_d2.c',
+ 'third_party/boringssl-with-bazel/src/crypto/x509/x509_def.c',
+ 'third_party/boringssl-with-bazel/src/crypto/x509/x509_ext.c',
+ 'third_party/boringssl-with-bazel/src/crypto/x509/x509_lu.c',
+ 'third_party/boringssl-with-bazel/src/crypto/x509/x509_obj.c',
+ 'third_party/boringssl-with-bazel/src/crypto/x509/x509_r2x.c',
+ 'third_party/boringssl-with-bazel/src/crypto/x509/x509_req.c',
+ 'third_party/boringssl-with-bazel/src/crypto/x509/x509_set.c',
+ 'third_party/boringssl-with-bazel/src/crypto/x509/x509_trs.c',
+ 'third_party/boringssl-with-bazel/src/crypto/x509/x509_txt.c',
+ 'third_party/boringssl-with-bazel/src/crypto/x509/x509_v3.c',
+ 'third_party/boringssl-with-bazel/src/crypto/x509/x509_vfy.c',
+ 'third_party/boringssl-with-bazel/src/crypto/x509/x509_vpm.c',
+ 'third_party/boringssl-with-bazel/src/crypto/x509/x509cset.c',
+ 'third_party/boringssl-with-bazel/src/crypto/x509/x509name.c',
+ 'third_party/boringssl-with-bazel/src/crypto/x509/x509rset.c',
+ 'third_party/boringssl-with-bazel/src/crypto/x509/x509spki.c',
+ 'third_party/boringssl-with-bazel/src/crypto/x509/x_algor.c',
+ 'third_party/boringssl-with-bazel/src/crypto/x509/x_all.c',
+ 'third_party/boringssl-with-bazel/src/crypto/x509/x_attrib.c',
+ 'third_party/boringssl-with-bazel/src/crypto/x509/x_crl.c',
+ 'third_party/boringssl-with-bazel/src/crypto/x509/x_exten.c',
+ 'third_party/boringssl-with-bazel/src/crypto/x509/x_info.c',
+ 'third_party/boringssl-with-bazel/src/crypto/x509/x_name.c',
+ 'third_party/boringssl-with-bazel/src/crypto/x509/x_pkey.c',
+ 'third_party/boringssl-with-bazel/src/crypto/x509/x_pubkey.c',
+ 'third_party/boringssl-with-bazel/src/crypto/x509/x_req.c',
+ 'third_party/boringssl-with-bazel/src/crypto/x509/x_sig.c',
+ 'third_party/boringssl-with-bazel/src/crypto/x509/x_spki.c',
+ 'third_party/boringssl-with-bazel/src/crypto/x509/x_val.c',
+ 'third_party/boringssl-with-bazel/src/crypto/x509/x_x509.c',
+ 'third_party/boringssl-with-bazel/src/crypto/x509/x_x509a.c',
+ 'third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_cache.c',
+ 'third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_data.c',
+ 'third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_lib.c',
+ 'third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_map.c',
+ 'third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_node.c',
+ 'third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_tree.c',
+ 'third_party/boringssl-with-bazel/src/crypto/x509v3/v3_akey.c',
+ 'third_party/boringssl-with-bazel/src/crypto/x509v3/v3_akeya.c',
+ 'third_party/boringssl-with-bazel/src/crypto/x509v3/v3_alt.c',
+ 'third_party/boringssl-with-bazel/src/crypto/x509v3/v3_bcons.c',
+ 'third_party/boringssl-with-bazel/src/crypto/x509v3/v3_bitst.c',
+ 'third_party/boringssl-with-bazel/src/crypto/x509v3/v3_conf.c',
+ 'third_party/boringssl-with-bazel/src/crypto/x509v3/v3_cpols.c',
+ 'third_party/boringssl-with-bazel/src/crypto/x509v3/v3_crld.c',
+ 'third_party/boringssl-with-bazel/src/crypto/x509v3/v3_enum.c',
+ 'third_party/boringssl-with-bazel/src/crypto/x509v3/v3_extku.c',
+ 'third_party/boringssl-with-bazel/src/crypto/x509v3/v3_genn.c',
+ 'third_party/boringssl-with-bazel/src/crypto/x509v3/v3_ia5.c',
+ 'third_party/boringssl-with-bazel/src/crypto/x509v3/v3_info.c',
+ 'third_party/boringssl-with-bazel/src/crypto/x509v3/v3_int.c',
+ 'third_party/boringssl-with-bazel/src/crypto/x509v3/v3_lib.c',
+ 'third_party/boringssl-with-bazel/src/crypto/x509v3/v3_ncons.c',
+ 'third_party/boringssl-with-bazel/src/crypto/x509v3/v3_ocsp.c',
+ 'third_party/boringssl-with-bazel/src/crypto/x509v3/v3_pci.c',
+ 'third_party/boringssl-with-bazel/src/crypto/x509v3/v3_pcia.c',
+ 'third_party/boringssl-with-bazel/src/crypto/x509v3/v3_pcons.c',
+ 'third_party/boringssl-with-bazel/src/crypto/x509v3/v3_pmaps.c',
+ 'third_party/boringssl-with-bazel/src/crypto/x509v3/v3_prn.c',
+ 'third_party/boringssl-with-bazel/src/crypto/x509v3/v3_purp.c',
+ 'third_party/boringssl-with-bazel/src/crypto/x509v3/v3_skey.c',
+ 'third_party/boringssl-with-bazel/src/crypto/x509v3/v3_utl.c',
+ 'third_party/boringssl-with-bazel/src/ssl/bio_ssl.cc',
+ 'third_party/boringssl-with-bazel/src/ssl/d1_both.cc',
+ 'third_party/boringssl-with-bazel/src/ssl/d1_lib.cc',
+ 'third_party/boringssl-with-bazel/src/ssl/d1_pkt.cc',
+ 'third_party/boringssl-with-bazel/src/ssl/d1_srtp.cc',
+ 'third_party/boringssl-with-bazel/src/ssl/dtls_method.cc',
+ 'third_party/boringssl-with-bazel/src/ssl/dtls_record.cc',
+ 'third_party/boringssl-with-bazel/src/ssl/handoff.cc',
+ 'third_party/boringssl-with-bazel/src/ssl/handshake.cc',
+ 'third_party/boringssl-with-bazel/src/ssl/handshake_client.cc',
+ 'third_party/boringssl-with-bazel/src/ssl/handshake_server.cc',
+ 'third_party/boringssl-with-bazel/src/ssl/s3_both.cc',
+ 'third_party/boringssl-with-bazel/src/ssl/s3_lib.cc',
+ 'third_party/boringssl-with-bazel/src/ssl/s3_pkt.cc',
+ 'third_party/boringssl-with-bazel/src/ssl/ssl_aead_ctx.cc',
+ 'third_party/boringssl-with-bazel/src/ssl/ssl_asn1.cc',
+ 'third_party/boringssl-with-bazel/src/ssl/ssl_buffer.cc',
+ 'third_party/boringssl-with-bazel/src/ssl/ssl_cert.cc',
+ 'third_party/boringssl-with-bazel/src/ssl/ssl_cipher.cc',
+ 'third_party/boringssl-with-bazel/src/ssl/ssl_file.cc',
+ 'third_party/boringssl-with-bazel/src/ssl/ssl_key_share.cc',
+ 'third_party/boringssl-with-bazel/src/ssl/ssl_lib.cc',
+ 'third_party/boringssl-with-bazel/src/ssl/ssl_privkey.cc',
+ 'third_party/boringssl-with-bazel/src/ssl/ssl_session.cc',
+ 'third_party/boringssl-with-bazel/src/ssl/ssl_stat.cc',
+ 'third_party/boringssl-with-bazel/src/ssl/ssl_transcript.cc',
+ 'third_party/boringssl-with-bazel/src/ssl/ssl_versions.cc',
+ 'third_party/boringssl-with-bazel/src/ssl/ssl_x509.cc',
+ 'third_party/boringssl-with-bazel/src/ssl/t1_enc.cc',
+ 'third_party/boringssl-with-bazel/src/ssl/t1_lib.cc',
+ 'third_party/boringssl-with-bazel/src/ssl/tls13_both.cc',
+ 'third_party/boringssl-with-bazel/src/ssl/tls13_client.cc',
+ 'third_party/boringssl-with-bazel/src/ssl/tls13_enc.cc',
+ 'third_party/boringssl-with-bazel/src/ssl/tls13_server.cc',
+ 'third_party/boringssl-with-bazel/src/ssl/tls_method.cc',
+ 'third_party/boringssl-with-bazel/src/ssl/tls_record.cc',
'third_party/cares/cares/ares__close_sockets.c',
'third_party/cares/cares/ares__get_hostent.c',
'third_party/cares/cares/ares__read_line.c',
@@ -887,29 +887,29 @@ CORE_SOURCE_FILES = [
'third_party/cares/cares/inet_net_pton.c',
'third_party/cares/cares/inet_ntop.c',
'third_party/cares/cares/windows_port.c',
- 'third_party/re2/re2/bitstate.cc',
- 'third_party/re2/re2/compile.cc',
- 'third_party/re2/re2/dfa.cc',
- 'third_party/re2/re2/filtered_re2.cc',
- 'third_party/re2/re2/mimics_pcre.cc',
- 'third_party/re2/re2/nfa.cc',
- 'third_party/re2/re2/onepass.cc',
- 'third_party/re2/re2/parse.cc',
- 'third_party/re2/re2/perl_groups.cc',
- 'third_party/re2/re2/prefilter.cc',
- 'third_party/re2/re2/prefilter_tree.cc',
- 'third_party/re2/re2/prog.cc',
- 'third_party/re2/re2/re2.cc',
- 'third_party/re2/re2/regexp.cc',
- 'third_party/re2/re2/set.cc',
- 'third_party/re2/re2/simplify.cc',
- 'third_party/re2/re2/stringpiece.cc',
- 'third_party/re2/re2/tostring.cc',
- 'third_party/re2/re2/unicode_casefold.cc',
- 'third_party/re2/re2/unicode_groups.cc',
- 'third_party/re2/util/pcre.cc',
- 'third_party/re2/util/rune.cc',
- 'third_party/re2/util/strutil.cc',
+ 'third_party/re2/re2/bitstate.cc',
+ 'third_party/re2/re2/compile.cc',
+ 'third_party/re2/re2/dfa.cc',
+ 'third_party/re2/re2/filtered_re2.cc',
+ 'third_party/re2/re2/mimics_pcre.cc',
+ 'third_party/re2/re2/nfa.cc',
+ 'third_party/re2/re2/onepass.cc',
+ 'third_party/re2/re2/parse.cc',
+ 'third_party/re2/re2/perl_groups.cc',
+ 'third_party/re2/re2/prefilter.cc',
+ 'third_party/re2/re2/prefilter_tree.cc',
+ 'third_party/re2/re2/prog.cc',
+ 'third_party/re2/re2/re2.cc',
+ 'third_party/re2/re2/regexp.cc',
+ 'third_party/re2/re2/set.cc',
+ 'third_party/re2/re2/simplify.cc',
+ 'third_party/re2/re2/stringpiece.cc',
+ 'third_party/re2/re2/tostring.cc',
+ 'third_party/re2/re2/unicode_casefold.cc',
+ 'third_party/re2/re2/unicode_groups.cc',
+ 'third_party/re2/util/pcre.cc',
+ 'third_party/re2/util/rune.cc',
+ 'third_party/re2/util/strutil.cc',
'third_party/upb/upb/decode.c',
'third_party/upb/upb/encode.c',
'third_party/upb/upb/msg.c',
@@ -932,172 +932,172 @@ CORE_SOURCE_FILES = [
'third_party/zlib/uncompr.c',
'third_party/zlib/zutil.c',
]
-
-ASM_SOURCE_FILES = {
- 'crypto_ios_aarch64': [
- 'third_party/boringssl-with-bazel/ios-aarch64/crypto/chacha/chacha-armv8.S',
- 'third_party/boringssl-with-bazel/ios-aarch64/crypto/fipsmodule/aesv8-armx64.S',
- 'third_party/boringssl-with-bazel/ios-aarch64/crypto/fipsmodule/armv8-mont.S',
- 'third_party/boringssl-with-bazel/ios-aarch64/crypto/fipsmodule/ghash-neon-armv8.S',
- 'third_party/boringssl-with-bazel/ios-aarch64/crypto/fipsmodule/ghashv8-armx64.S',
- 'third_party/boringssl-with-bazel/ios-aarch64/crypto/fipsmodule/sha1-armv8.S',
- 'third_party/boringssl-with-bazel/ios-aarch64/crypto/fipsmodule/sha256-armv8.S',
- 'third_party/boringssl-with-bazel/ios-aarch64/crypto/fipsmodule/sha512-armv8.S',
- 'third_party/boringssl-with-bazel/ios-aarch64/crypto/fipsmodule/vpaes-armv8.S',
- 'third_party/boringssl-with-bazel/ios-aarch64/crypto/test/trampoline-armv8.S',
- ],
- 'crypto_mac_x86_64': [
- 'third_party/boringssl-with-bazel/mac-x86_64/crypto/chacha/chacha-x86_64.S',
- 'third_party/boringssl-with-bazel/mac-x86_64/crypto/cipher_extra/aes128gcmsiv-x86_64.S',
- 'third_party/boringssl-with-bazel/mac-x86_64/crypto/cipher_extra/chacha20_poly1305_x86_64.S',
- 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/aesni-gcm-x86_64.S',
- 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/aesni-x86_64.S',
- 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/ghash-ssse3-x86_64.S',
- 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/ghash-x86_64.S',
- 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/md5-x86_64.S',
- 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/p256-x86_64-asm.S',
- 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/p256_beeu-x86_64-asm.S',
- 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/rdrand-x86_64.S',
- 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/rsaz-avx2.S',
- 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/sha1-x86_64.S',
- 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/sha256-x86_64.S',
- 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/sha512-x86_64.S',
- 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/vpaes-x86_64.S',
- 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/x86_64-mont.S',
- 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/x86_64-mont5.S',
- 'third_party/boringssl-with-bazel/mac-x86_64/crypto/test/trampoline-x86_64.S',
- ],
- 'crypto_win_x86': [
- 'third_party/boringssl-with-bazel/win-x86/crypto/chacha/chacha-x86.asm',
- 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/aesni-x86.asm',
- 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/bn-586.asm',
- 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/co-586.asm',
- 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/ghash-ssse3-x86.asm',
- 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/ghash-x86.asm',
- 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/md5-586.asm',
- 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/sha1-586.asm',
- 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/sha256-586.asm',
- 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/sha512-586.asm',
- 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/vpaes-x86.asm',
- 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/x86-mont.asm',
- 'third_party/boringssl-with-bazel/win-x86/crypto/test/trampoline-x86.asm',
- ],
- 'crypto_linux_ppc64le': [
- 'third_party/boringssl-with-bazel/linux-ppc64le/crypto/fipsmodule/aesp8-ppc.S',
- 'third_party/boringssl-with-bazel/linux-ppc64le/crypto/fipsmodule/ghashp8-ppc.S',
- 'third_party/boringssl-with-bazel/linux-ppc64le/crypto/test/trampoline-ppc.S',
- ],
- 'crypto_mac_x86': [
- 'third_party/boringssl-with-bazel/mac-x86/crypto/chacha/chacha-x86.S',
- 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/aesni-x86.S',
- 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/bn-586.S',
- 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/co-586.S',
- 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/ghash-ssse3-x86.S',
- 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/ghash-x86.S',
- 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/md5-586.S',
- 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/sha1-586.S',
- 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/sha256-586.S',
- 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/sha512-586.S',
- 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/vpaes-x86.S',
- 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/x86-mont.S',
- 'third_party/boringssl-with-bazel/mac-x86/crypto/test/trampoline-x86.S',
- ],
- 'crypto_linux_x86': [
- 'third_party/boringssl-with-bazel/linux-x86/crypto/chacha/chacha-x86.S',
- 'third_party/boringssl-with-bazel/linux-x86/crypto/fipsmodule/aesni-x86.S',
- 'third_party/boringssl-with-bazel/linux-x86/crypto/fipsmodule/bn-586.S',
- 'third_party/boringssl-with-bazel/linux-x86/crypto/fipsmodule/co-586.S',
- 'third_party/boringssl-with-bazel/linux-x86/crypto/fipsmodule/ghash-ssse3-x86.S',
- 'third_party/boringssl-with-bazel/linux-x86/crypto/fipsmodule/ghash-x86.S',
- 'third_party/boringssl-with-bazel/linux-x86/crypto/fipsmodule/md5-586.S',
- 'third_party/boringssl-with-bazel/linux-x86/crypto/fipsmodule/sha1-586.S',
- 'third_party/boringssl-with-bazel/linux-x86/crypto/fipsmodule/sha256-586.S',
- 'third_party/boringssl-with-bazel/linux-x86/crypto/fipsmodule/sha512-586.S',
- 'third_party/boringssl-with-bazel/linux-x86/crypto/fipsmodule/vpaes-x86.S',
- 'third_party/boringssl-with-bazel/linux-x86/crypto/fipsmodule/x86-mont.S',
- 'third_party/boringssl-with-bazel/linux-x86/crypto/test/trampoline-x86.S',
- ],
- 'crypto_ios_arm': [
- 'third_party/boringssl-with-bazel/ios-arm/crypto/chacha/chacha-armv4.S',
- 'third_party/boringssl-with-bazel/ios-arm/crypto/fipsmodule/aesv8-armx32.S',
- 'third_party/boringssl-with-bazel/ios-arm/crypto/fipsmodule/armv4-mont.S',
- 'third_party/boringssl-with-bazel/ios-arm/crypto/fipsmodule/bsaes-armv7.S',
- 'third_party/boringssl-with-bazel/ios-arm/crypto/fipsmodule/ghash-armv4.S',
- 'third_party/boringssl-with-bazel/ios-arm/crypto/fipsmodule/ghashv8-armx32.S',
- 'third_party/boringssl-with-bazel/ios-arm/crypto/fipsmodule/sha1-armv4-large.S',
- 'third_party/boringssl-with-bazel/ios-arm/crypto/fipsmodule/sha256-armv4.S',
- 'third_party/boringssl-with-bazel/ios-arm/crypto/fipsmodule/sha512-armv4.S',
- 'third_party/boringssl-with-bazel/ios-arm/crypto/fipsmodule/vpaes-armv7.S',
- 'third_party/boringssl-with-bazel/ios-arm/crypto/test/trampoline-armv4.S',
- ],
- 'crypto_linux_x86_64': [
- 'third_party/boringssl-with-bazel/linux-x86_64/crypto/chacha/chacha-x86_64.S',
- 'third_party/boringssl-with-bazel/linux-x86_64/crypto/cipher_extra/aes128gcmsiv-x86_64.S',
- 'third_party/boringssl-with-bazel/linux-x86_64/crypto/cipher_extra/chacha20_poly1305_x86_64.S',
- 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/aesni-gcm-x86_64.S',
- 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/aesni-x86_64.S',
- 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/ghash-ssse3-x86_64.S',
- 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/ghash-x86_64.S',
- 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/md5-x86_64.S',
- 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/p256-x86_64-asm.S',
- 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/p256_beeu-x86_64-asm.S',
- 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/rdrand-x86_64.S',
- 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/rsaz-avx2.S',
- 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/sha1-x86_64.S',
- 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/sha256-x86_64.S',
- 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/sha512-x86_64.S',
- 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/vpaes-x86_64.S',
- 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/x86_64-mont.S',
- 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/x86_64-mont5.S',
- 'third_party/boringssl-with-bazel/linux-x86_64/crypto/test/trampoline-x86_64.S',
- 'third_party/boringssl-with-bazel/src/crypto/hrss/asm/poly_rq_mul.S',
- ],
- 'crypto_win_x86_64': [
- 'third_party/boringssl-with-bazel/win-x86_64/crypto/chacha/chacha-x86_64.asm',
- 'third_party/boringssl-with-bazel/win-x86_64/crypto/cipher_extra/aes128gcmsiv-x86_64.asm',
- 'third_party/boringssl-with-bazel/win-x86_64/crypto/cipher_extra/chacha20_poly1305_x86_64.asm',
- 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/aesni-gcm-x86_64.asm',
- 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/aesni-x86_64.asm',
- 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/ghash-ssse3-x86_64.asm',
- 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/ghash-x86_64.asm',
- 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/md5-x86_64.asm',
- 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/p256-x86_64-asm.asm',
- 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/p256_beeu-x86_64-asm.asm',
- 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/rdrand-x86_64.asm',
- 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/rsaz-avx2.asm',
- 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/sha1-x86_64.asm',
- 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/sha256-x86_64.asm',
- 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/sha512-x86_64.asm',
- 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/vpaes-x86_64.asm',
- 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/x86_64-mont.asm',
- 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/x86_64-mont5.asm',
- 'third_party/boringssl-with-bazel/win-x86_64/crypto/test/trampoline-x86_64.asm',
- ],
- 'crypto_linux_aarch64': [
- 'third_party/boringssl-with-bazel/linux-aarch64/crypto/chacha/chacha-armv8.S',
- 'third_party/boringssl-with-bazel/linux-aarch64/crypto/fipsmodule/aesv8-armx64.S',
- 'third_party/boringssl-with-bazel/linux-aarch64/crypto/fipsmodule/armv8-mont.S',
- 'third_party/boringssl-with-bazel/linux-aarch64/crypto/fipsmodule/ghash-neon-armv8.S',
- 'third_party/boringssl-with-bazel/linux-aarch64/crypto/fipsmodule/ghashv8-armx64.S',
- 'third_party/boringssl-with-bazel/linux-aarch64/crypto/fipsmodule/sha1-armv8.S',
- 'third_party/boringssl-with-bazel/linux-aarch64/crypto/fipsmodule/sha256-armv8.S',
- 'third_party/boringssl-with-bazel/linux-aarch64/crypto/fipsmodule/sha512-armv8.S',
- 'third_party/boringssl-with-bazel/linux-aarch64/crypto/fipsmodule/vpaes-armv8.S',
- 'third_party/boringssl-with-bazel/linux-aarch64/crypto/test/trampoline-armv8.S',
- ],
- 'crypto_linux_arm': [
- 'third_party/boringssl-with-bazel/linux-arm/crypto/chacha/chacha-armv4.S',
- 'third_party/boringssl-with-bazel/linux-arm/crypto/fipsmodule/aesv8-armx32.S',
- 'third_party/boringssl-with-bazel/linux-arm/crypto/fipsmodule/armv4-mont.S',
- 'third_party/boringssl-with-bazel/linux-arm/crypto/fipsmodule/bsaes-armv7.S',
- 'third_party/boringssl-with-bazel/linux-arm/crypto/fipsmodule/ghash-armv4.S',
- 'third_party/boringssl-with-bazel/linux-arm/crypto/fipsmodule/ghashv8-armx32.S',
- 'third_party/boringssl-with-bazel/linux-arm/crypto/fipsmodule/sha1-armv4-large.S',
- 'third_party/boringssl-with-bazel/linux-arm/crypto/fipsmodule/sha256-armv4.S',
- 'third_party/boringssl-with-bazel/linux-arm/crypto/fipsmodule/sha512-armv4.S',
- 'third_party/boringssl-with-bazel/linux-arm/crypto/fipsmodule/vpaes-armv7.S',
- 'third_party/boringssl-with-bazel/linux-arm/crypto/test/trampoline-armv4.S',
- 'third_party/boringssl-with-bazel/src/crypto/curve25519/asm/x25519-asm-arm.S',
- 'third_party/boringssl-with-bazel/src/crypto/poly1305/poly1305_arm_asm.S',
- ],
-}
+
+ASM_SOURCE_FILES = {
+ 'crypto_ios_aarch64': [
+ 'third_party/boringssl-with-bazel/ios-aarch64/crypto/chacha/chacha-armv8.S',
+ 'third_party/boringssl-with-bazel/ios-aarch64/crypto/fipsmodule/aesv8-armx64.S',
+ 'third_party/boringssl-with-bazel/ios-aarch64/crypto/fipsmodule/armv8-mont.S',
+ 'third_party/boringssl-with-bazel/ios-aarch64/crypto/fipsmodule/ghash-neon-armv8.S',
+ 'third_party/boringssl-with-bazel/ios-aarch64/crypto/fipsmodule/ghashv8-armx64.S',
+ 'third_party/boringssl-with-bazel/ios-aarch64/crypto/fipsmodule/sha1-armv8.S',
+ 'third_party/boringssl-with-bazel/ios-aarch64/crypto/fipsmodule/sha256-armv8.S',
+ 'third_party/boringssl-with-bazel/ios-aarch64/crypto/fipsmodule/sha512-armv8.S',
+ 'third_party/boringssl-with-bazel/ios-aarch64/crypto/fipsmodule/vpaes-armv8.S',
+ 'third_party/boringssl-with-bazel/ios-aarch64/crypto/test/trampoline-armv8.S',
+ ],
+ 'crypto_mac_x86_64': [
+ 'third_party/boringssl-with-bazel/mac-x86_64/crypto/chacha/chacha-x86_64.S',
+ 'third_party/boringssl-with-bazel/mac-x86_64/crypto/cipher_extra/aes128gcmsiv-x86_64.S',
+ 'third_party/boringssl-with-bazel/mac-x86_64/crypto/cipher_extra/chacha20_poly1305_x86_64.S',
+ 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/aesni-gcm-x86_64.S',
+ 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/aesni-x86_64.S',
+ 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/ghash-ssse3-x86_64.S',
+ 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/ghash-x86_64.S',
+ 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/md5-x86_64.S',
+ 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/p256-x86_64-asm.S',
+ 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/p256_beeu-x86_64-asm.S',
+ 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/rdrand-x86_64.S',
+ 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/rsaz-avx2.S',
+ 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/sha1-x86_64.S',
+ 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/sha256-x86_64.S',
+ 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/sha512-x86_64.S',
+ 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/vpaes-x86_64.S',
+ 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/x86_64-mont.S',
+ 'third_party/boringssl-with-bazel/mac-x86_64/crypto/fipsmodule/x86_64-mont5.S',
+ 'third_party/boringssl-with-bazel/mac-x86_64/crypto/test/trampoline-x86_64.S',
+ ],
+ 'crypto_win_x86': [
+ 'third_party/boringssl-with-bazel/win-x86/crypto/chacha/chacha-x86.asm',
+ 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/aesni-x86.asm',
+ 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/bn-586.asm',
+ 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/co-586.asm',
+ 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/ghash-ssse3-x86.asm',
+ 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/ghash-x86.asm',
+ 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/md5-586.asm',
+ 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/sha1-586.asm',
+ 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/sha256-586.asm',
+ 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/sha512-586.asm',
+ 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/vpaes-x86.asm',
+ 'third_party/boringssl-with-bazel/win-x86/crypto/fipsmodule/x86-mont.asm',
+ 'third_party/boringssl-with-bazel/win-x86/crypto/test/trampoline-x86.asm',
+ ],
+ 'crypto_linux_ppc64le': [
+ 'third_party/boringssl-with-bazel/linux-ppc64le/crypto/fipsmodule/aesp8-ppc.S',
+ 'third_party/boringssl-with-bazel/linux-ppc64le/crypto/fipsmodule/ghashp8-ppc.S',
+ 'third_party/boringssl-with-bazel/linux-ppc64le/crypto/test/trampoline-ppc.S',
+ ],
+ 'crypto_mac_x86': [
+ 'third_party/boringssl-with-bazel/mac-x86/crypto/chacha/chacha-x86.S',
+ 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/aesni-x86.S',
+ 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/bn-586.S',
+ 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/co-586.S',
+ 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/ghash-ssse3-x86.S',
+ 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/ghash-x86.S',
+ 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/md5-586.S',
+ 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/sha1-586.S',
+ 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/sha256-586.S',
+ 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/sha512-586.S',
+ 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/vpaes-x86.S',
+ 'third_party/boringssl-with-bazel/mac-x86/crypto/fipsmodule/x86-mont.S',
+ 'third_party/boringssl-with-bazel/mac-x86/crypto/test/trampoline-x86.S',
+ ],
+ 'crypto_linux_x86': [
+ 'third_party/boringssl-with-bazel/linux-x86/crypto/chacha/chacha-x86.S',
+ 'third_party/boringssl-with-bazel/linux-x86/crypto/fipsmodule/aesni-x86.S',
+ 'third_party/boringssl-with-bazel/linux-x86/crypto/fipsmodule/bn-586.S',
+ 'third_party/boringssl-with-bazel/linux-x86/crypto/fipsmodule/co-586.S',
+ 'third_party/boringssl-with-bazel/linux-x86/crypto/fipsmodule/ghash-ssse3-x86.S',
+ 'third_party/boringssl-with-bazel/linux-x86/crypto/fipsmodule/ghash-x86.S',
+ 'third_party/boringssl-with-bazel/linux-x86/crypto/fipsmodule/md5-586.S',
+ 'third_party/boringssl-with-bazel/linux-x86/crypto/fipsmodule/sha1-586.S',
+ 'third_party/boringssl-with-bazel/linux-x86/crypto/fipsmodule/sha256-586.S',
+ 'third_party/boringssl-with-bazel/linux-x86/crypto/fipsmodule/sha512-586.S',
+ 'third_party/boringssl-with-bazel/linux-x86/crypto/fipsmodule/vpaes-x86.S',
+ 'third_party/boringssl-with-bazel/linux-x86/crypto/fipsmodule/x86-mont.S',
+ 'third_party/boringssl-with-bazel/linux-x86/crypto/test/trampoline-x86.S',
+ ],
+ 'crypto_ios_arm': [
+ 'third_party/boringssl-with-bazel/ios-arm/crypto/chacha/chacha-armv4.S',
+ 'third_party/boringssl-with-bazel/ios-arm/crypto/fipsmodule/aesv8-armx32.S',
+ 'third_party/boringssl-with-bazel/ios-arm/crypto/fipsmodule/armv4-mont.S',
+ 'third_party/boringssl-with-bazel/ios-arm/crypto/fipsmodule/bsaes-armv7.S',
+ 'third_party/boringssl-with-bazel/ios-arm/crypto/fipsmodule/ghash-armv4.S',
+ 'third_party/boringssl-with-bazel/ios-arm/crypto/fipsmodule/ghashv8-armx32.S',
+ 'third_party/boringssl-with-bazel/ios-arm/crypto/fipsmodule/sha1-armv4-large.S',
+ 'third_party/boringssl-with-bazel/ios-arm/crypto/fipsmodule/sha256-armv4.S',
+ 'third_party/boringssl-with-bazel/ios-arm/crypto/fipsmodule/sha512-armv4.S',
+ 'third_party/boringssl-with-bazel/ios-arm/crypto/fipsmodule/vpaes-armv7.S',
+ 'third_party/boringssl-with-bazel/ios-arm/crypto/test/trampoline-armv4.S',
+ ],
+ 'crypto_linux_x86_64': [
+ 'third_party/boringssl-with-bazel/linux-x86_64/crypto/chacha/chacha-x86_64.S',
+ 'third_party/boringssl-with-bazel/linux-x86_64/crypto/cipher_extra/aes128gcmsiv-x86_64.S',
+ 'third_party/boringssl-with-bazel/linux-x86_64/crypto/cipher_extra/chacha20_poly1305_x86_64.S',
+ 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/aesni-gcm-x86_64.S',
+ 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/aesni-x86_64.S',
+ 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/ghash-ssse3-x86_64.S',
+ 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/ghash-x86_64.S',
+ 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/md5-x86_64.S',
+ 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/p256-x86_64-asm.S',
+ 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/p256_beeu-x86_64-asm.S',
+ 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/rdrand-x86_64.S',
+ 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/rsaz-avx2.S',
+ 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/sha1-x86_64.S',
+ 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/sha256-x86_64.S',
+ 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/sha512-x86_64.S',
+ 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/vpaes-x86_64.S',
+ 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/x86_64-mont.S',
+ 'third_party/boringssl-with-bazel/linux-x86_64/crypto/fipsmodule/x86_64-mont5.S',
+ 'third_party/boringssl-with-bazel/linux-x86_64/crypto/test/trampoline-x86_64.S',
+ 'third_party/boringssl-with-bazel/src/crypto/hrss/asm/poly_rq_mul.S',
+ ],
+ 'crypto_win_x86_64': [
+ 'third_party/boringssl-with-bazel/win-x86_64/crypto/chacha/chacha-x86_64.asm',
+ 'third_party/boringssl-with-bazel/win-x86_64/crypto/cipher_extra/aes128gcmsiv-x86_64.asm',
+ 'third_party/boringssl-with-bazel/win-x86_64/crypto/cipher_extra/chacha20_poly1305_x86_64.asm',
+ 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/aesni-gcm-x86_64.asm',
+ 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/aesni-x86_64.asm',
+ 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/ghash-ssse3-x86_64.asm',
+ 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/ghash-x86_64.asm',
+ 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/md5-x86_64.asm',
+ 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/p256-x86_64-asm.asm',
+ 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/p256_beeu-x86_64-asm.asm',
+ 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/rdrand-x86_64.asm',
+ 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/rsaz-avx2.asm',
+ 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/sha1-x86_64.asm',
+ 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/sha256-x86_64.asm',
+ 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/sha512-x86_64.asm',
+ 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/vpaes-x86_64.asm',
+ 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/x86_64-mont.asm',
+ 'third_party/boringssl-with-bazel/win-x86_64/crypto/fipsmodule/x86_64-mont5.asm',
+ 'third_party/boringssl-with-bazel/win-x86_64/crypto/test/trampoline-x86_64.asm',
+ ],
+ 'crypto_linux_aarch64': [
+ 'third_party/boringssl-with-bazel/linux-aarch64/crypto/chacha/chacha-armv8.S',
+ 'third_party/boringssl-with-bazel/linux-aarch64/crypto/fipsmodule/aesv8-armx64.S',
+ 'third_party/boringssl-with-bazel/linux-aarch64/crypto/fipsmodule/armv8-mont.S',
+ 'third_party/boringssl-with-bazel/linux-aarch64/crypto/fipsmodule/ghash-neon-armv8.S',
+ 'third_party/boringssl-with-bazel/linux-aarch64/crypto/fipsmodule/ghashv8-armx64.S',
+ 'third_party/boringssl-with-bazel/linux-aarch64/crypto/fipsmodule/sha1-armv8.S',
+ 'third_party/boringssl-with-bazel/linux-aarch64/crypto/fipsmodule/sha256-armv8.S',
+ 'third_party/boringssl-with-bazel/linux-aarch64/crypto/fipsmodule/sha512-armv8.S',
+ 'third_party/boringssl-with-bazel/linux-aarch64/crypto/fipsmodule/vpaes-armv8.S',
+ 'third_party/boringssl-with-bazel/linux-aarch64/crypto/test/trampoline-armv8.S',
+ ],
+ 'crypto_linux_arm': [
+ 'third_party/boringssl-with-bazel/linux-arm/crypto/chacha/chacha-armv4.S',
+ 'third_party/boringssl-with-bazel/linux-arm/crypto/fipsmodule/aesv8-armx32.S',
+ 'third_party/boringssl-with-bazel/linux-arm/crypto/fipsmodule/armv4-mont.S',
+ 'third_party/boringssl-with-bazel/linux-arm/crypto/fipsmodule/bsaes-armv7.S',
+ 'third_party/boringssl-with-bazel/linux-arm/crypto/fipsmodule/ghash-armv4.S',
+ 'third_party/boringssl-with-bazel/linux-arm/crypto/fipsmodule/ghashv8-armx32.S',
+ 'third_party/boringssl-with-bazel/linux-arm/crypto/fipsmodule/sha1-armv4-large.S',
+ 'third_party/boringssl-with-bazel/linux-arm/crypto/fipsmodule/sha256-armv4.S',
+ 'third_party/boringssl-with-bazel/linux-arm/crypto/fipsmodule/sha512-armv4.S',
+ 'third_party/boringssl-with-bazel/linux-arm/crypto/fipsmodule/vpaes-armv7.S',
+ 'third_party/boringssl-with-bazel/linux-arm/crypto/test/trampoline-armv4.S',
+ 'third_party/boringssl-with-bazel/src/crypto/curve25519/asm/x25519-asm-arm.S',
+ 'third_party/boringssl-with-bazel/src/crypto/poly1305/poly1305_arm_asm.S',
+ ],
+}
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc_version.py b/contrib/libs/grpc/src/python/grpcio/grpc_version.py
index aab68348ef3..9237f14e2fc 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc_version.py
+++ b/contrib/libs/grpc/src/python/grpcio/grpc_version.py
@@ -14,4 +14,4 @@
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio/grpc_version.py.template`!!!
-VERSION = '1.33.2'
+VERSION = '1.33.2'
diff --git a/contrib/libs/grpc/src/python/grpcio/support.py b/contrib/libs/grpc/src/python/grpcio/support.py
index 725b5eb76f5..217f3cb9ed5 100644
--- a/contrib/libs/grpc/src/python/grpcio/support.py
+++ b/contrib/libs/grpc/src/python/grpcio/support.py
@@ -28,25 +28,25 @@ int main(int argc, char **argv) { return 0; }
"""
C_PYTHON_DEV_ERROR_MESSAGE = """
Could not find <Python.h>. This could mean the following:
- * You're on Ubuntu and haven't run `apt-get install <PY_REPR>-dev`.
- * You're on RHEL/Fedora and haven't run `yum install <PY_REPR>-devel` or
- `dnf install <PY_REPR>-devel` (make sure you also have redhat-rpm-config
+ * You're on Ubuntu and haven't run `apt-get install <PY_REPR>-dev`.
+ * You're on RHEL/Fedora and haven't run `yum install <PY_REPR>-devel` or
+ `dnf install <PY_REPR>-devel` (make sure you also have redhat-rpm-config
installed)
* You're on Mac OS X and the usual Python framework was somehow corrupted
(check your environment variables or try re-installing?)
* You're on Windows and your Python installation was somehow corrupted
(check your environment variables or try re-installing?)
"""
-if sys.version_info[0] == 2:
- PYTHON_REPRESENTATION = 'python'
-elif sys.version_info[0] == 3:
- PYTHON_REPRESENTATION = 'python3'
-else:
- raise NotImplementedError('Unsupported Python version: %s' % sys.version)
+if sys.version_info[0] == 2:
+ PYTHON_REPRESENTATION = 'python'
+elif sys.version_info[0] == 3:
+ PYTHON_REPRESENTATION = 'python3'
+else:
+ raise NotImplementedError('Unsupported Python version: %s' % sys.version)
C_CHECKS = {
- C_PYTHON_DEV:
- C_PYTHON_DEV_ERROR_MESSAGE.replace('<PY_REPR>', PYTHON_REPRESENTATION),
+ C_PYTHON_DEV:
+ C_PYTHON_DEV_ERROR_MESSAGE.replace('<PY_REPR>', PYTHON_REPRESENTATION),
}
@@ -67,8 +67,8 @@ def _expect_compile(compiler, source_string, error_message):
if _compile(compiler, source_string) is not None:
sys.stderr.write(error_message)
raise commands.CommandError(
- "Diagnostics found a compilation environment issue:\n{}".format(
- error_message))
+ "Diagnostics found a compilation environment issue:\n{}".format(
+ error_message))
def diagnose_compile_error(build_ext, error):
diff --git a/contrib/libs/grpc/src/python/grpcio/ya.make b/contrib/libs/grpc/src/python/grpcio/ya.make
index 08008762b04..5cdb0230c41 100644
--- a/contrib/libs/grpc/src/python/grpcio/ya.make
+++ b/contrib/libs/grpc/src/python/grpcio/ya.make
@@ -2,8 +2,8 @@ PY23_LIBRARY()
LICENSE(Apache-2.0)
-LICENSE_TEXTS(.yandex_meta/licenses.list.txt)
-
+LICENSE_TEXTS(.yandex_meta/licenses.list.txt)
+
OWNER(
akastornov
g:contrib
@@ -23,7 +23,7 @@ IF (PYTHON2)
ENDIF()
ADDINCL(
- ${ARCADIA_BUILD_ROOT}/contrib/libs/grpc
+ ${ARCADIA_BUILD_ROOT}/contrib/libs/grpc
contrib/libs/grpc
contrib/libs/grpc/include
)
@@ -50,7 +50,7 @@ PY_SRCS(
grpc/_grpcio_metadata.py
grpc/_interceptor.py
grpc/_plugin_wrapping.py
- grpc/_runtime_protos.py
+ grpc/_runtime_protos.py
grpc/_server.py
grpc/_utilities.py
grpc/beta/__init__.py
@@ -86,18 +86,18 @@ PY_SRCS(
IF (PYTHON3)
PY_SRCS(
TOP_LEVEL
- grpc/_simple_stubs.py
- grpc/aio/_base_call.py
- grpc/aio/_base_channel.py
- grpc/aio/_base_server.py
- grpc/aio/_call.py
- grpc/aio/_channel.py
- grpc/aio/__init__.py
- grpc/aio/_interceptor.py
- grpc/aio/_metadata.py
- grpc/aio/_server.py
- grpc/aio/_typing.py
- grpc/aio/_utils.py
+ grpc/_simple_stubs.py
+ grpc/aio/_base_call.py
+ grpc/aio/_base_channel.py
+ grpc/aio/_base_server.py
+ grpc/aio/_call.py
+ grpc/aio/_channel.py
+ grpc/aio/__init__.py
+ grpc/aio/_interceptor.py
+ grpc/aio/_metadata.py
+ grpc/aio/_server.py
+ grpc/aio/_typing.py
+ grpc/aio/_utils.py
grpc/experimental/aio/__init__.py
)
ENDIF()
diff --git a/contrib/libs/grpc/src/python/grpcio_channelz/.yandex_meta/licenses.list.txt b/contrib/libs/grpc/src/python/grpcio_channelz/.yandex_meta/licenses.list.txt
index 2e74ac9ccee..e1a08df61b5 100644
--- a/contrib/libs/grpc/src/python/grpcio_channelz/.yandex_meta/licenses.list.txt
+++ b/contrib/libs/grpc/src/python/grpcio_channelz/.yandex_meta/licenses.list.txt
@@ -1,24 +1,24 @@
-====================Apache-2.0====================
- 'License :: OSI Approved :: Apache Software License',
-
-
-====================Apache-2.0====================
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-====================COPYRIGHT====================
-// Copyright 2018 The gRPC Authors
-
-
-====================COPYRIGHT====================
-// Copyright 2020 The gRPC Authors
+====================Apache-2.0====================
+ 'License :: OSI Approved :: Apache Software License',
+
+
+====================Apache-2.0====================
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+====================COPYRIGHT====================
+// Copyright 2018 The gRPC Authors
+
+
+====================COPYRIGHT====================
+// Copyright 2020 The gRPC Authors
diff --git a/contrib/libs/grpc/src/python/grpcio_channelz/channelz_commands.py b/contrib/libs/grpc/src/python/grpcio_channelz/channelz_commands.py
index 6b1d284c639..dbbce2fda5a 100644
--- a/contrib/libs/grpc/src/python/grpcio_channelz/channelz_commands.py
+++ b/contrib/libs/grpc/src/python/grpcio_channelz/channelz_commands.py
@@ -39,9 +39,9 @@ class Preprocess(setuptools.Command):
def run(self):
if os.path.isfile(CHANNELZ_PROTO):
- shutil.copyfile(
- CHANNELZ_PROTO,
- os.path.join(ROOT_DIR, 'grpc_channelz/v1/channelz.proto'))
+ shutil.copyfile(
+ CHANNELZ_PROTO,
+ os.path.join(ROOT_DIR, 'grpc_channelz/v1/channelz.proto'))
if os.path.isfile(LICENSE):
shutil.copyfile(LICENSE, os.path.join(ROOT_DIR, 'LICENSE'))
diff --git a/contrib/libs/grpc/src/python/grpcio_channelz/grpc_channelz/v1/_async.py b/contrib/libs/grpc/src/python/grpcio_channelz/grpc_channelz/v1/_async.py
index fec9187d19f..50911b0fd95 100644
--- a/contrib/libs/grpc/src/python/grpcio_channelz/grpc_channelz/v1/_async.py
+++ b/contrib/libs/grpc/src/python/grpcio_channelz/grpc_channelz/v1/_async.py
@@ -1,66 +1,66 @@
-# Copyright 2020 The gRPC Authors
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-"""AsyncIO version of Channelz servicer."""
-
-from grpc.experimental import aio
-
-import grpc_channelz.v1.channelz_pb2 as _channelz_pb2
-import grpc_channelz.v1.channelz_pb2_grpc as _channelz_pb2_grpc
-from grpc_channelz.v1._servicer import ChannelzServicer as _SyncChannelzServicer
-
-
-class ChannelzServicer(_channelz_pb2_grpc.ChannelzServicer):
- """AsyncIO servicer for handling RPCs for service statuses."""
-
- @staticmethod
- async def GetTopChannels(request: _channelz_pb2.GetTopChannelsRequest,
- context: aio.ServicerContext
- ) -> _channelz_pb2.GetTopChannelsResponse:
- return _SyncChannelzServicer.GetTopChannels(request, context)
-
- @staticmethod
- async def GetServers(request: _channelz_pb2.GetServersRequest,
- context: aio.ServicerContext
- ) -> _channelz_pb2.GetServersResponse:
- return _SyncChannelzServicer.GetServers(request, context)
-
- @staticmethod
- async def GetServer(request: _channelz_pb2.GetServerRequest,
- context: aio.ServicerContext
- ) -> _channelz_pb2.GetServerResponse:
- return _SyncChannelzServicer.GetServer(request, context)
-
- @staticmethod
- async def GetServerSockets(request: _channelz_pb2.GetServerSocketsRequest,
- context: aio.ServicerContext
- ) -> _channelz_pb2.GetServerSocketsResponse:
- return _SyncChannelzServicer.GetServerSockets(request, context)
-
- @staticmethod
- async def GetChannel(request: _channelz_pb2.GetChannelRequest,
- context: aio.ServicerContext
- ) -> _channelz_pb2.GetChannelResponse:
- return _SyncChannelzServicer.GetChannel(request, context)
-
- @staticmethod
- async def GetSubchannel(request: _channelz_pb2.GetSubchannelRequest,
- context: aio.ServicerContext
- ) -> _channelz_pb2.GetSubchannelResponse:
- return _SyncChannelzServicer.GetSubchannel(request, context)
-
- @staticmethod
- async def GetSocket(request: _channelz_pb2.GetSocketRequest,
- context: aio.ServicerContext
- ) -> _channelz_pb2.GetSocketResponse:
- return _SyncChannelzServicer.GetSocket(request, context)
+# Copyright 2020 The gRPC Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+"""AsyncIO version of Channelz servicer."""
+
+from grpc.experimental import aio
+
+import grpc_channelz.v1.channelz_pb2 as _channelz_pb2
+import grpc_channelz.v1.channelz_pb2_grpc as _channelz_pb2_grpc
+from grpc_channelz.v1._servicer import ChannelzServicer as _SyncChannelzServicer
+
+
+class ChannelzServicer(_channelz_pb2_grpc.ChannelzServicer):
+ """AsyncIO servicer for handling RPCs for service statuses."""
+
+ @staticmethod
+ async def GetTopChannels(request: _channelz_pb2.GetTopChannelsRequest,
+ context: aio.ServicerContext
+ ) -> _channelz_pb2.GetTopChannelsResponse:
+ return _SyncChannelzServicer.GetTopChannels(request, context)
+
+ @staticmethod
+ async def GetServers(request: _channelz_pb2.GetServersRequest,
+ context: aio.ServicerContext
+ ) -> _channelz_pb2.GetServersResponse:
+ return _SyncChannelzServicer.GetServers(request, context)
+
+ @staticmethod
+ async def GetServer(request: _channelz_pb2.GetServerRequest,
+ context: aio.ServicerContext
+ ) -> _channelz_pb2.GetServerResponse:
+ return _SyncChannelzServicer.GetServer(request, context)
+
+ @staticmethod
+ async def GetServerSockets(request: _channelz_pb2.GetServerSocketsRequest,
+ context: aio.ServicerContext
+ ) -> _channelz_pb2.GetServerSocketsResponse:
+ return _SyncChannelzServicer.GetServerSockets(request, context)
+
+ @staticmethod
+ async def GetChannel(request: _channelz_pb2.GetChannelRequest,
+ context: aio.ServicerContext
+ ) -> _channelz_pb2.GetChannelResponse:
+ return _SyncChannelzServicer.GetChannel(request, context)
+
+ @staticmethod
+ async def GetSubchannel(request: _channelz_pb2.GetSubchannelRequest,
+ context: aio.ServicerContext
+ ) -> _channelz_pb2.GetSubchannelResponse:
+ return _SyncChannelzServicer.GetSubchannel(request, context)
+
+ @staticmethod
+ async def GetSocket(request: _channelz_pb2.GetSocketRequest,
+ context: aio.ServicerContext
+ ) -> _channelz_pb2.GetSocketResponse:
+ return _SyncChannelzServicer.GetSocket(request, context)
diff --git a/contrib/libs/grpc/src/python/grpcio_channelz/grpc_channelz/v1/_servicer.py b/contrib/libs/grpc/src/python/grpcio_channelz/grpc_channelz/v1/_servicer.py
index c17a13b428b..6ba28f56a39 100644
--- a/contrib/libs/grpc/src/python/grpcio_channelz/grpc_channelz/v1/_servicer.py
+++ b/contrib/libs/grpc/src/python/grpcio_channelz/grpc_channelz/v1/_servicer.py
@@ -1,120 +1,120 @@
-# Copyright 2020 The gRPC Authors
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-"""Channelz debug service implementation in gRPC Python."""
-
-import grpc
-from grpc._cython import cygrpc
-
-import grpc_channelz.v1.channelz_pb2 as _channelz_pb2
-import grpc_channelz.v1.channelz_pb2_grpc as _channelz_pb2_grpc
-
-from google.protobuf import json_format
-
-
-class ChannelzServicer(_channelz_pb2_grpc.ChannelzServicer):
- """Servicer handling RPCs for service statuses."""
-
- @staticmethod
- def GetTopChannels(request, context):
- try:
- return json_format.Parse(
- cygrpc.channelz_get_top_channels(request.start_channel_id),
- _channelz_pb2.GetTopChannelsResponse(),
- )
- except (ValueError, json_format.ParseError) as e:
- context.set_code(grpc.StatusCode.INTERNAL)
- context.set_details(str(e))
-
- @staticmethod
- def GetServers(request, context):
- try:
- return json_format.Parse(
- cygrpc.channelz_get_servers(request.start_server_id),
- _channelz_pb2.GetServersResponse(),
- )
- except (ValueError, json_format.ParseError) as e:
- context.set_code(grpc.StatusCode.INTERNAL)
- context.set_details(str(e))
-
- @staticmethod
- def GetServer(request, context):
- try:
- return json_format.Parse(
- cygrpc.channelz_get_server(request.server_id),
- _channelz_pb2.GetServerResponse(),
- )
- except ValueError as e:
- context.set_code(grpc.StatusCode.NOT_FOUND)
- context.set_details(str(e))
- except json_format.ParseError as e:
- context.set_code(grpc.StatusCode.INTERNAL)
- context.set_details(str(e))
-
- @staticmethod
- def GetServerSockets(request, context):
- try:
- return json_format.Parse(
- cygrpc.channelz_get_server_sockets(request.server_id,
- request.start_socket_id,
- request.max_results),
- _channelz_pb2.GetServerSocketsResponse(),
- )
- except ValueError as e:
- context.set_code(grpc.StatusCode.NOT_FOUND)
- context.set_details(str(e))
- except json_format.ParseError as e:
- context.set_code(grpc.StatusCode.INTERNAL)
- context.set_details(str(e))
-
- @staticmethod
- def GetChannel(request, context):
- try:
- return json_format.Parse(
- cygrpc.channelz_get_channel(request.channel_id),
- _channelz_pb2.GetChannelResponse(),
- )
- except ValueError as e:
- context.set_code(grpc.StatusCode.NOT_FOUND)
- context.set_details(str(e))
- except json_format.ParseError as e:
- context.set_code(grpc.StatusCode.INTERNAL)
- context.set_details(str(e))
-
- @staticmethod
- def GetSubchannel(request, context):
- try:
- return json_format.Parse(
- cygrpc.channelz_get_subchannel(request.subchannel_id),
- _channelz_pb2.GetSubchannelResponse(),
- )
- except ValueError as e:
- context.set_code(grpc.StatusCode.NOT_FOUND)
- context.set_details(str(e))
- except json_format.ParseError as e:
- context.set_code(grpc.StatusCode.INTERNAL)
- context.set_details(str(e))
-
- @staticmethod
- def GetSocket(request, context):
- try:
- return json_format.Parse(
- cygrpc.channelz_get_socket(request.socket_id),
- _channelz_pb2.GetSocketResponse(),
- )
- except ValueError as e:
- context.set_code(grpc.StatusCode.NOT_FOUND)
- context.set_details(str(e))
- except json_format.ParseError as e:
- context.set_code(grpc.StatusCode.INTERNAL)
- context.set_details(str(e))
+# Copyright 2020 The gRPC Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+"""Channelz debug service implementation in gRPC Python."""
+
+import grpc
+from grpc._cython import cygrpc
+
+import grpc_channelz.v1.channelz_pb2 as _channelz_pb2
+import grpc_channelz.v1.channelz_pb2_grpc as _channelz_pb2_grpc
+
+from google.protobuf import json_format
+
+
+class ChannelzServicer(_channelz_pb2_grpc.ChannelzServicer):
+ """Servicer handling RPCs for service statuses."""
+
+ @staticmethod
+ def GetTopChannels(request, context):
+ try:
+ return json_format.Parse(
+ cygrpc.channelz_get_top_channels(request.start_channel_id),
+ _channelz_pb2.GetTopChannelsResponse(),
+ )
+ except (ValueError, json_format.ParseError) as e:
+ context.set_code(grpc.StatusCode.INTERNAL)
+ context.set_details(str(e))
+
+ @staticmethod
+ def GetServers(request, context):
+ try:
+ return json_format.Parse(
+ cygrpc.channelz_get_servers(request.start_server_id),
+ _channelz_pb2.GetServersResponse(),
+ )
+ except (ValueError, json_format.ParseError) as e:
+ context.set_code(grpc.StatusCode.INTERNAL)
+ context.set_details(str(e))
+
+ @staticmethod
+ def GetServer(request, context):
+ try:
+ return json_format.Parse(
+ cygrpc.channelz_get_server(request.server_id),
+ _channelz_pb2.GetServerResponse(),
+ )
+ except ValueError as e:
+ context.set_code(grpc.StatusCode.NOT_FOUND)
+ context.set_details(str(e))
+ except json_format.ParseError as e:
+ context.set_code(grpc.StatusCode.INTERNAL)
+ context.set_details(str(e))
+
+ @staticmethod
+ def GetServerSockets(request, context):
+ try:
+ return json_format.Parse(
+ cygrpc.channelz_get_server_sockets(request.server_id,
+ request.start_socket_id,
+ request.max_results),
+ _channelz_pb2.GetServerSocketsResponse(),
+ )
+ except ValueError as e:
+ context.set_code(grpc.StatusCode.NOT_FOUND)
+ context.set_details(str(e))
+ except json_format.ParseError as e:
+ context.set_code(grpc.StatusCode.INTERNAL)
+ context.set_details(str(e))
+
+ @staticmethod
+ def GetChannel(request, context):
+ try:
+ return json_format.Parse(
+ cygrpc.channelz_get_channel(request.channel_id),
+ _channelz_pb2.GetChannelResponse(),
+ )
+ except ValueError as e:
+ context.set_code(grpc.StatusCode.NOT_FOUND)
+ context.set_details(str(e))
+ except json_format.ParseError as e:
+ context.set_code(grpc.StatusCode.INTERNAL)
+ context.set_details(str(e))
+
+ @staticmethod
+ def GetSubchannel(request, context):
+ try:
+ return json_format.Parse(
+ cygrpc.channelz_get_subchannel(request.subchannel_id),
+ _channelz_pb2.GetSubchannelResponse(),
+ )
+ except ValueError as e:
+ context.set_code(grpc.StatusCode.NOT_FOUND)
+ context.set_details(str(e))
+ except json_format.ParseError as e:
+ context.set_code(grpc.StatusCode.INTERNAL)
+ context.set_details(str(e))
+
+ @staticmethod
+ def GetSocket(request, context):
+ try:
+ return json_format.Parse(
+ cygrpc.channelz_get_socket(request.socket_id),
+ _channelz_pb2.GetSocketResponse(),
+ )
+ except ValueError as e:
+ context.set_code(grpc.StatusCode.NOT_FOUND)
+ context.set_details(str(e))
+ except json_format.ParseError as e:
+ context.set_code(grpc.StatusCode.INTERNAL)
+ context.set_details(str(e))
diff --git a/contrib/libs/grpc/src/python/grpcio_channelz/grpc_channelz/v1/channelz.py b/contrib/libs/grpc/src/python/grpcio_channelz/grpc_channelz/v1/channelz.py
index 75f31a781b1..508fad53974 100644
--- a/contrib/libs/grpc/src/python/grpcio_channelz/grpc_channelz/v1/channelz.py
+++ b/contrib/libs/grpc/src/python/grpcio_channelz/grpc_channelz/v1/channelz.py
@@ -13,61 +13,61 @@
# limitations under the License.
"""Channelz debug service implementation in gRPC Python."""
-import sys
+import sys
import grpc
import grpc_channelz.v1.channelz_pb2_grpc as _channelz_pb2_grpc
-from grpc_channelz.v1._servicer import ChannelzServicer
+from grpc_channelz.v1._servicer import ChannelzServicer
-_add_channelz_servicer_doc = """Add Channelz servicer to a server.
+_add_channelz_servicer_doc = """Add Channelz servicer to a server.
-Channelz servicer is in charge of
-pulling information from C-Core for entire process. It will allow the
-server to response to Channelz queries.
+Channelz servicer is in charge of
+pulling information from C-Core for entire process. It will allow the
+server to response to Channelz queries.
-The Channelz statistic is enabled by default inside C-Core. Whether the
-statistic is enabled or not is isolated from adding Channelz servicer.
-That means you can query Channelz info with a Channelz-disabled channel,
-and you can add Channelz servicer to a Channelz-disabled server.
+The Channelz statistic is enabled by default inside C-Core. Whether the
+statistic is enabled or not is isolated from adding Channelz servicer.
+That means you can query Channelz info with a Channelz-disabled channel,
+and you can add Channelz servicer to a Channelz-disabled server.
-The Channelz statistic can be enabled or disabled by channel option
-'grpc.enable_channelz'. Set to 1 to enable, set to 0 to disable.
+The Channelz statistic can be enabled or disabled by channel option
+'grpc.enable_channelz'. Set to 1 to enable, set to 0 to disable.
-This is an EXPERIMENTAL API.
+This is an EXPERIMENTAL API.
-Args:
- server: A gRPC server to which Channelz service will be added.
-"""
+Args:
+ server: A gRPC server to which Channelz service will be added.
+"""
-if sys.version_info[0] >= 3 and sys.version_info[1] >= 6:
- from grpc_channelz.v1 import _async as aio
+if sys.version_info[0] >= 3 and sys.version_info[1] >= 6:
+ from grpc_channelz.v1 import _async as aio
- def add_channelz_servicer(server):
+ def add_channelz_servicer(server):
- if isinstance(server, grpc.experimental.aio.Server):
- _channelz_pb2_grpc.add_ChannelzServicer_to_server(
- aio.ChannelzServicer(), server)
- else:
- _channelz_pb2_grpc.add_ChannelzServicer_to_server(
- ChannelzServicer(), server)
+ if isinstance(server, grpc.experimental.aio.Server):
+ _channelz_pb2_grpc.add_ChannelzServicer_to_server(
+ aio.ChannelzServicer(), server)
+ else:
+ _channelz_pb2_grpc.add_ChannelzServicer_to_server(
+ ChannelzServicer(), server)
- add_channelz_servicer.__doc__ = _add_channelz_servicer_doc
+ add_channelz_servicer.__doc__ = _add_channelz_servicer_doc
- __all__ = [
- "aio",
- "add_channelz_servicer",
- "ChannelzServicer",
- ]
+ __all__ = [
+ "aio",
+ "add_channelz_servicer",
+ "ChannelzServicer",
+ ]
-else:
+else:
- def add_channelz_servicer(server):
- _channelz_pb2_grpc.add_ChannelzServicer_to_server(
- ChannelzServicer(), server)
+ def add_channelz_servicer(server):
+ _channelz_pb2_grpc.add_ChannelzServicer_to_server(
+ ChannelzServicer(), server)
- add_channelz_servicer.__doc__ = _add_channelz_servicer_doc
+ add_channelz_servicer.__doc__ = _add_channelz_servicer_doc
- __all__ = [
- "add_channelz_servicer",
- "ChannelzServicer",
- ]
+ __all__ = [
+ "add_channelz_servicer",
+ "ChannelzServicer",
+ ]
diff --git a/contrib/libs/grpc/src/python/grpcio_channelz/grpc_version.py b/contrib/libs/grpc/src/python/grpcio_channelz/grpc_version.py
index 2ee692f92e2..52cb1a9d3b3 100644
--- a/contrib/libs/grpc/src/python/grpcio_channelz/grpc_version.py
+++ b/contrib/libs/grpc/src/python/grpcio_channelz/grpc_version.py
@@ -14,4 +14,4 @@
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_channelz/grpc_version.py.template`!!!
-VERSION = '1.33.2'
+VERSION = '1.33.2'
diff --git a/contrib/libs/grpc/src/python/grpcio_channelz/setup.py b/contrib/libs/grpc/src/python/grpcio_channelz/setup.py
index 683747281e2..678b5ef13f3 100644
--- a/contrib/libs/grpc/src/python/grpcio_channelz/setup.py
+++ b/contrib/libs/grpc/src/python/grpcio_channelz/setup.py
@@ -55,7 +55,7 @@ CLASSIFIERS = [
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
- 'Programming Language :: Python :: 3.9',
+ 'Programming Language :: Python :: 3.9',
'License :: OSI Approved :: Apache Software License',
]
@@ -71,8 +71,8 @@ INSTALL_REQUIRES = (
try:
import channelz_commands as _channelz_commands
# we are in the build environment, otherwise the above import fails
- SETUP_REQUIRES = ('grpcio-tools=={version}'.format(
- version=grpc_version.VERSION),)
+ SETUP_REQUIRES = ('grpcio-tools=={version}'.format(
+ version=grpc_version.VERSION),)
COMMAND_CLASS = {
# Run preprocess from the repository *before* doing any packaging!
'preprocess': _channelz_commands.Preprocess,
diff --git a/contrib/libs/grpc/src/python/grpcio_channelz/ya.make b/contrib/libs/grpc/src/python/grpcio_channelz/ya.make
index fa2c70f87fa..2703d70ab04 100644
--- a/contrib/libs/grpc/src/python/grpcio_channelz/ya.make
+++ b/contrib/libs/grpc/src/python/grpcio_channelz/ya.make
@@ -2,8 +2,8 @@ PY23_LIBRARY()
LICENSE(Apache-2.0)
-LICENSE_TEXTS(.yandex_meta/licenses.list.txt)
-
+LICENSE_TEXTS(.yandex_meta/licenses.list.txt)
+
OWNER(
akastornov
dvshkurko
@@ -24,7 +24,7 @@ IF (PYTHON2)
ENDIF()
ADDINCL(
- ${ARCADIA_BUILD_ROOT}/contrib/libs/grpc
+ ${ARCADIA_BUILD_ROOT}/contrib/libs/grpc
contrib/libs/grpc
contrib/libs/grpc/include
)
@@ -42,15 +42,15 @@ PY_SRCS(
TOP_LEVEL
grpc_channelz/__init__.py
grpc_channelz/v1/__init__.py
- grpc_channelz/v1/_servicer.py
+ grpc_channelz/v1/_servicer.py
grpc_channelz/v1/channelz.py
)
-IF (PYTHON3)
- PY_SRCS(
- TOP_LEVEL
- grpc_channelz/v1/_async.py
- )
-ENDIF()
-
+IF (PYTHON3)
+ PY_SRCS(
+ TOP_LEVEL
+ grpc_channelz/v1/_async.py
+ )
+ENDIF()
+
END()
diff --git a/contrib/libs/grpc/src/python/grpcio_health_checking/.yandex_meta/licenses.list.txt b/contrib/libs/grpc/src/python/grpcio_health_checking/.yandex_meta/licenses.list.txt
index 1a5042a9b78..02cb1ca4783 100644
--- a/contrib/libs/grpc/src/python/grpcio_health_checking/.yandex_meta/licenses.list.txt
+++ b/contrib/libs/grpc/src/python/grpcio_health_checking/.yandex_meta/licenses.list.txt
@@ -1,32 +1,32 @@
-====================Apache-2.0====================
- license='Apache License 2.0',
-
-
-====================Apache-2.0====================
- 'License :: OSI Approved :: Apache Software License',
-
-
-====================Apache-2.0====================
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-====================COPYRIGHT====================
- * Copyright 2015 gRPC authors.
-
-
-====================COPYRIGHT====================
- * Copyright 2016 gRPC authors.
-
-
-====================COPYRIGHT====================
-// Copyright 2020 The gRPC Authors
+====================Apache-2.0====================
+ license='Apache License 2.0',
+
+
+====================Apache-2.0====================
+ 'License :: OSI Approved :: Apache Software License',
+
+
+====================Apache-2.0====================
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+====================COPYRIGHT====================
+ * Copyright 2015 gRPC authors.
+
+
+====================COPYRIGHT====================
+ * Copyright 2016 gRPC authors.
+
+
+====================COPYRIGHT====================
+// Copyright 2020 The gRPC Authors
diff --git a/contrib/libs/grpc/src/python/grpcio_health_checking/grpc_health/v1/_async.py b/contrib/libs/grpc/src/python/grpcio_health_checking/grpc_health/v1/_async.py
index 6f42b5e23b4..752531f5171 100644
--- a/contrib/libs/grpc/src/python/grpcio_health_checking/grpc_health/v1/_async.py
+++ b/contrib/libs/grpc/src/python/grpcio_health_checking/grpc_health/v1/_async.py
@@ -1,113 +1,113 @@
-# Copyright 2020 The gRPC Authors
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-"""Reference implementation for health checking in gRPC Python."""
-
-import asyncio
-import collections
-from typing import MutableMapping
-import grpc
-
-from grpc_health.v1 import health_pb2 as _health_pb2
-from grpc_health.v1 import health_pb2_grpc as _health_pb2_grpc
-
-
-class HealthServicer(_health_pb2_grpc.HealthServicer):
- """An AsyncIO implementation of health checking servicer."""
- _server_status: MutableMapping[
- str, '_health_pb2.HealthCheckResponse.ServingStatus']
- _server_watchers: MutableMapping[str, asyncio.Condition]
- _gracefully_shutting_down: bool
-
- def __init__(self) -> None:
- self._server_status = {"": _health_pb2.HealthCheckResponse.SERVING}
- self._server_watchers = collections.defaultdict(asyncio.Condition)
- self._gracefully_shutting_down = False
-
- async def Check(self, request: _health_pb2.HealthCheckRequest,
- context) -> None:
- status = self._server_status.get(request.service)
-
- if status is None:
- await context.abort(grpc.StatusCode.NOT_FOUND)
- else:
- return _health_pb2.HealthCheckResponse(status=status)
-
- async def Watch(self, request: _health_pb2.HealthCheckRequest,
- context) -> None:
- condition = self._server_watchers[request.service]
- last_status = None
- try:
- async with condition:
- while True:
- status = self._server_status.get(
- request.service,
- _health_pb2.HealthCheckResponse.SERVICE_UNKNOWN)
-
- # NOTE(lidiz) If the observed status is the same, it means
- # there are missing intermediate statuses. It's considered
- # acceptable since peer only interested in eventual status.
- if status != last_status:
- # Responds with current health state
- await context.write(
- _health_pb2.HealthCheckResponse(status=status))
-
- # Records the last sent status
- last_status = status
-
- # Polling on health state changes
- await condition.wait()
- finally:
- if request.service in self._server_watchers:
- del self._server_watchers[request.service]
-
- async def _set(self, service: str,
- status: _health_pb2.HealthCheckResponse.ServingStatus
- ) -> None:
- if service in self._server_watchers:
- condition = self._server_watchers.get(service)
- async with condition:
- self._server_status[service] = status
- condition.notify_all()
- else:
- self._server_status[service] = status
-
- async def set(self, service: str,
- status: _health_pb2.HealthCheckResponse.ServingStatus
- ) -> None:
- """Sets the status of a service.
-
- Args:
- service: string, the name of the service.
- status: HealthCheckResponse.status enum value indicating the status of
- the service
- """
- if self._gracefully_shutting_down:
- return
- else:
- await self._set(service, status)
-
- async def enter_graceful_shutdown(self) -> None:
- """Permanently sets the status of all services to NOT_SERVING.
-
- This should be invoked when the server is entering a graceful shutdown
- period. After this method is invoked, future attempts to set the status
- of a service will be ignored.
- """
- if self._gracefully_shutting_down:
- return
- else:
- self._gracefully_shutting_down = True
- for service in self._server_status:
- await self._set(service,
- _health_pb2.HealthCheckResponse.NOT_SERVING)
+# Copyright 2020 The gRPC Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+"""Reference implementation for health checking in gRPC Python."""
+
+import asyncio
+import collections
+from typing import MutableMapping
+import grpc
+
+from grpc_health.v1 import health_pb2 as _health_pb2
+from grpc_health.v1 import health_pb2_grpc as _health_pb2_grpc
+
+
+class HealthServicer(_health_pb2_grpc.HealthServicer):
+ """An AsyncIO implementation of health checking servicer."""
+ _server_status: MutableMapping[
+ str, '_health_pb2.HealthCheckResponse.ServingStatus']
+ _server_watchers: MutableMapping[str, asyncio.Condition]
+ _gracefully_shutting_down: bool
+
+ def __init__(self) -> None:
+ self._server_status = {"": _health_pb2.HealthCheckResponse.SERVING}
+ self._server_watchers = collections.defaultdict(asyncio.Condition)
+ self._gracefully_shutting_down = False
+
+ async def Check(self, request: _health_pb2.HealthCheckRequest,
+ context) -> None:
+ status = self._server_status.get(request.service)
+
+ if status is None:
+ await context.abort(grpc.StatusCode.NOT_FOUND)
+ else:
+ return _health_pb2.HealthCheckResponse(status=status)
+
+ async def Watch(self, request: _health_pb2.HealthCheckRequest,
+ context) -> None:
+ condition = self._server_watchers[request.service]
+ last_status = None
+ try:
+ async with condition:
+ while True:
+ status = self._server_status.get(
+ request.service,
+ _health_pb2.HealthCheckResponse.SERVICE_UNKNOWN)
+
+ # NOTE(lidiz) If the observed status is the same, it means
+ # there are missing intermediate statuses. It's considered
+ # acceptable since peer only interested in eventual status.
+ if status != last_status:
+ # Responds with current health state
+ await context.write(
+ _health_pb2.HealthCheckResponse(status=status))
+
+ # Records the last sent status
+ last_status = status
+
+ # Polling on health state changes
+ await condition.wait()
+ finally:
+ if request.service in self._server_watchers:
+ del self._server_watchers[request.service]
+
+ async def _set(self, service: str,
+ status: _health_pb2.HealthCheckResponse.ServingStatus
+ ) -> None:
+ if service in self._server_watchers:
+ condition = self._server_watchers.get(service)
+ async with condition:
+ self._server_status[service] = status
+ condition.notify_all()
+ else:
+ self._server_status[service] = status
+
+ async def set(self, service: str,
+ status: _health_pb2.HealthCheckResponse.ServingStatus
+ ) -> None:
+ """Sets the status of a service.
+
+ Args:
+ service: string, the name of the service.
+ status: HealthCheckResponse.status enum value indicating the status of
+ the service
+ """
+ if self._gracefully_shutting_down:
+ return
+ else:
+ await self._set(service, status)
+
+ async def enter_graceful_shutdown(self) -> None:
+ """Permanently sets the status of all services to NOT_SERVING.
+
+ This should be invoked when the server is entering a graceful shutdown
+ period. After this method is invoked, future attempts to set the status
+ of a service will be ignored.
+ """
+ if self._gracefully_shutting_down:
+ return
+ else:
+ self._gracefully_shutting_down = True
+ for service in self._server_status:
+ await self._set(service,
+ _health_pb2.HealthCheckResponse.NOT_SERVING)
diff --git a/contrib/libs/grpc/src/python/grpcio_health_checking/grpc_health/v1/health.py b/contrib/libs/grpc/src/python/grpcio_health_checking/grpc_health/v1/health.py
index 0be44729b0d..f7ee639ec8a 100644
--- a/contrib/libs/grpc/src/python/grpcio_health_checking/grpc_health/v1/health.py
+++ b/contrib/libs/grpc/src/python/grpcio_health_checking/grpc_health/v1/health.py
@@ -15,20 +15,20 @@
import collections
import threading
-import sys
+import sys
import grpc
from grpc_health.v1 import health_pb2 as _health_pb2
from grpc_health.v1 import health_pb2_grpc as _health_pb2_grpc
-if sys.version_info[0] >= 3 and sys.version_info[1] >= 6:
- # Exposes AsyncHealthServicer as public API.
- from . import _async as aio # pylint: disable=unused-import
-
-# The service name of the health checking servicer.
+if sys.version_info[0] >= 3 and sys.version_info[1] >= 6:
+ # Exposes AsyncHealthServicer as public API.
+ from . import _async as aio # pylint: disable=unused-import
+
+# The service name of the health checking servicer.
SERVICE_NAME = _health_pb2.DESCRIPTOR.services_by_name['Health'].full_name
-# The entry of overall health for the entire server.
-OVERALL_HEALTH = ''
+# The entry of overall health for the entire server.
+OVERALL_HEALTH = ''
class _Watcher():
@@ -85,7 +85,7 @@ class HealthServicer(_health_pb2_grpc.HealthServicer):
experimental_non_blocking=True,
experimental_thread_pool=None):
self._lock = threading.RLock()
- self._server_status = {"": _health_pb2.HealthCheckResponse.SERVING}
+ self._server_status = {"": _health_pb2.HealthCheckResponse.SERVING}
self._send_response_callbacks = {}
self.Watch.__func__.experimental_non_blocking = experimental_non_blocking
self.Watch.__func__.experimental_thread_pool = experimental_thread_pool
@@ -138,7 +138,7 @@ class HealthServicer(_health_pb2_grpc.HealthServicer):
"""Sets the status of a service.
Args:
- service: string, the name of the service.
+ service: string, the name of the service.
status: HealthCheckResponse.status enum value indicating the status of
the service
"""
diff --git a/contrib/libs/grpc/src/python/grpcio_health_checking/grpc_version.py b/contrib/libs/grpc/src/python/grpcio_health_checking/grpc_version.py
index bd03c5bafe9..f676be10684 100644
--- a/contrib/libs/grpc/src/python/grpcio_health_checking/grpc_version.py
+++ b/contrib/libs/grpc/src/python/grpcio_health_checking/grpc_version.py
@@ -14,4 +14,4 @@
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_health_checking/grpc_version.py.template`!!!
-VERSION = '1.33.2'
+VERSION = '1.33.2'
diff --git a/contrib/libs/grpc/src/python/grpcio_health_checking/health_commands.py b/contrib/libs/grpc/src/python/grpcio_health_checking/health_commands.py
index 14e675aca55..874dec7343a 100644
--- a/contrib/libs/grpc/src/python/grpcio_health_checking/health_commands.py
+++ b/contrib/libs/grpc/src/python/grpcio_health_checking/health_commands.py
@@ -38,9 +38,9 @@ class Preprocess(setuptools.Command):
def run(self):
if os.path.isfile(HEALTH_PROTO):
- shutil.copyfile(
- HEALTH_PROTO,
- os.path.join(ROOT_DIR, 'grpc_health/v1/health.proto'))
+ shutil.copyfile(
+ HEALTH_PROTO,
+ os.path.join(ROOT_DIR, 'grpc_health/v1/health.proto'))
if os.path.isfile(LICENSE):
shutil.copyfile(LICENSE, os.path.join(ROOT_DIR, 'LICENSE'))
diff --git a/contrib/libs/grpc/src/python/grpcio_health_checking/setup.py b/contrib/libs/grpc/src/python/grpcio_health_checking/setup.py
index af42fbef301..fa1fbbd55ad 100644
--- a/contrib/libs/grpc/src/python/grpcio_health_checking/setup.py
+++ b/contrib/libs/grpc/src/python/grpcio_health_checking/setup.py
@@ -54,7 +54,7 @@ CLASSIFIERS = [
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
- 'Programming Language :: Python :: 3.9',
+ 'Programming Language :: Python :: 3.9',
'License :: OSI Approved :: Apache Software License',
]
@@ -70,8 +70,8 @@ INSTALL_REQUIRES = (
try:
import health_commands as _health_commands
# we are in the build environment, otherwise the above import fails
- SETUP_REQUIRES = ('grpcio-tools=={version}'.format(
- version=grpc_version.VERSION),)
+ SETUP_REQUIRES = ('grpcio-tools=={version}'.format(
+ version=grpc_version.VERSION),)
COMMAND_CLASS = {
# Run preprocess from the repository *before* doing any packaging!
'preprocess': _health_commands.Preprocess,
@@ -85,17 +85,17 @@ except ImportError:
'build_package_protos': _NoOpCommand,
}
-setuptools.setup(name='grpcio-health-checking',
- version=grpc_version.VERSION,
- description='Standard Health Checking Service for gRPC',
- long_description=open(_README_PATH, 'r').read(),
- author='The gRPC Authors',
- author_email='[email protected]',
- url='https://grpc.io',
- license='Apache License 2.0',
- classifiers=CLASSIFIERS,
- package_dir=PACKAGE_DIRECTORIES,
- packages=setuptools.find_packages('.'),
- install_requires=INSTALL_REQUIRES,
- setup_requires=SETUP_REQUIRES,
- cmdclass=COMMAND_CLASS)
+setuptools.setup(name='grpcio-health-checking',
+ version=grpc_version.VERSION,
+ description='Standard Health Checking Service for gRPC',
+ long_description=open(_README_PATH, 'r').read(),
+ author='The gRPC Authors',
+ author_email='[email protected]',
+ url='https://grpc.io',
+ license='Apache License 2.0',
+ classifiers=CLASSIFIERS,
+ package_dir=PACKAGE_DIRECTORIES,
+ packages=setuptools.find_packages('.'),
+ install_requires=INSTALL_REQUIRES,
+ setup_requires=SETUP_REQUIRES,
+ cmdclass=COMMAND_CLASS)
diff --git a/contrib/libs/grpc/src/python/grpcio_health_checking/ya.make b/contrib/libs/grpc/src/python/grpcio_health_checking/ya.make
index 8553e612d81..4bab1758a5e 100644
--- a/contrib/libs/grpc/src/python/grpcio_health_checking/ya.make
+++ b/contrib/libs/grpc/src/python/grpcio_health_checking/ya.make
@@ -2,8 +2,8 @@ PY23_LIBRARY()
LICENSE(Apache-2.0)
-LICENSE_TEXTS(.yandex_meta/licenses.list.txt)
-
+LICENSE_TEXTS(.yandex_meta/licenses.list.txt)
+
OWNER(
akastornov
dvshkurko
@@ -24,7 +24,7 @@ IF (PYTHON2)
ENDIF()
ADDINCL(
- ${ARCADIA_BUILD_ROOT}/contrib/libs/grpc
+ ${ARCADIA_BUILD_ROOT}/contrib/libs/grpc
contrib/libs/grpc
contrib/libs/grpc/include
)
diff --git a/contrib/libs/grpc/src/python/grpcio_reflection/.yandex_meta/licenses.list.txt b/contrib/libs/grpc/src/python/grpcio_reflection/.yandex_meta/licenses.list.txt
index 26ef8a892c7..33706ec0849 100644
--- a/contrib/libs/grpc/src/python/grpcio_reflection/.yandex_meta/licenses.list.txt
+++ b/contrib/libs/grpc/src/python/grpcio_reflection/.yandex_meta/licenses.list.txt
@@ -1,28 +1,28 @@
-====================Apache-2.0====================
- license='Apache License 2.0',
-
-
-====================Apache-2.0====================
- 'License :: OSI Approved :: Apache Software License',
-
-
-====================Apache-2.0====================
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-====================COPYRIGHT====================
- * Copyright 2016 gRPC authors.
-
-
-====================COPYRIGHT====================
- * Copyright 2020 gRPC authors.
+====================Apache-2.0====================
+ license='Apache License 2.0',
+
+
+====================Apache-2.0====================
+ 'License :: OSI Approved :: Apache Software License',
+
+
+====================Apache-2.0====================
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+====================COPYRIGHT====================
+ * Copyright 2016 gRPC authors.
+
+
+====================COPYRIGHT====================
+ * Copyright 2020 gRPC authors.
diff --git a/contrib/libs/grpc/src/python/grpcio_reflection/grpc_reflection/v1alpha/_async.py b/contrib/libs/grpc/src/python/grpcio_reflection/grpc_reflection/v1alpha/_async.py
index 3a9cc425687..fb567fc09f5 100644
--- a/contrib/libs/grpc/src/python/grpcio_reflection/grpc_reflection/v1alpha/_async.py
+++ b/contrib/libs/grpc/src/python/grpcio_reflection/grpc_reflection/v1alpha/_async.py
@@ -1,57 +1,57 @@
-# Copyright 2020 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-"""The AsyncIO version of the reflection servicer."""
-
-from typing import AsyncIterable
-
-import grpc
-
-from src.proto.grpc.reflection.v1alpha import reflection_pb2 as _reflection_pb2
-from grpc_reflection.v1alpha._base import BaseReflectionServicer
-
-
-class ReflectionServicer(BaseReflectionServicer):
- """Servicer handling RPCs for service statuses."""
-
- async def ServerReflectionInfo(
- self, request_iterator: AsyncIterable[
- _reflection_pb2.ServerReflectionRequest], unused_context
- ) -> AsyncIterable[_reflection_pb2.ServerReflectionResponse]:
- async for request in request_iterator:
- if request.HasField('file_by_filename'):
- yield self._file_by_filename(request.file_by_filename)
- elif request.HasField('file_containing_symbol'):
- yield self._file_containing_symbol(
- request.file_containing_symbol)
- elif request.HasField('file_containing_extension'):
- yield self._file_containing_extension(
- request.file_containing_extension.containing_type,
- request.file_containing_extension.extension_number)
- elif request.HasField('all_extension_numbers_of_type'):
- yield self._all_extension_numbers_of_type(
- request.all_extension_numbers_of_type)
- elif request.HasField('list_services'):
- yield self._list_services()
- else:
- yield _reflection_pb2.ServerReflectionResponse(
- error_response=_reflection_pb2.ErrorResponse(
- error_code=grpc.StatusCode.INVALID_ARGUMENT.value[0],
- error_message=grpc.StatusCode.INVALID_ARGUMENT.value[1].
- encode(),
- ))
-
-
-__all__ = [
- "ReflectionServicer",
-]
+# Copyright 2020 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+"""The AsyncIO version of the reflection servicer."""
+
+from typing import AsyncIterable
+
+import grpc
+
+from src.proto.grpc.reflection.v1alpha import reflection_pb2 as _reflection_pb2
+from grpc_reflection.v1alpha._base import BaseReflectionServicer
+
+
+class ReflectionServicer(BaseReflectionServicer):
+ """Servicer handling RPCs for service statuses."""
+
+ async def ServerReflectionInfo(
+ self, request_iterator: AsyncIterable[
+ _reflection_pb2.ServerReflectionRequest], unused_context
+ ) -> AsyncIterable[_reflection_pb2.ServerReflectionResponse]:
+ async for request in request_iterator:
+ if request.HasField('file_by_filename'):
+ yield self._file_by_filename(request.file_by_filename)
+ elif request.HasField('file_containing_symbol'):
+ yield self._file_containing_symbol(
+ request.file_containing_symbol)
+ elif request.HasField('file_containing_extension'):
+ yield self._file_containing_extension(
+ request.file_containing_extension.containing_type,
+ request.file_containing_extension.extension_number)
+ elif request.HasField('all_extension_numbers_of_type'):
+ yield self._all_extension_numbers_of_type(
+ request.all_extension_numbers_of_type)
+ elif request.HasField('list_services'):
+ yield self._list_services()
+ else:
+ yield _reflection_pb2.ServerReflectionResponse(
+ error_response=_reflection_pb2.ErrorResponse(
+ error_code=grpc.StatusCode.INVALID_ARGUMENT.value[0],
+ error_message=grpc.StatusCode.INVALID_ARGUMENT.value[1].
+ encode(),
+ ))
+
+
+__all__ = [
+ "ReflectionServicer",
+]
diff --git a/contrib/libs/grpc/src/python/grpcio_reflection/grpc_reflection/v1alpha/_base.py b/contrib/libs/grpc/src/python/grpcio_reflection/grpc_reflection/v1alpha/_base.py
index b67c7ff2f5c..677dca98586 100644
--- a/contrib/libs/grpc/src/python/grpcio_reflection/grpc_reflection/v1alpha/_base.py
+++ b/contrib/libs/grpc/src/python/grpcio_reflection/grpc_reflection/v1alpha/_base.py
@@ -1,110 +1,110 @@
-# Copyright 2020 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-"""Base implementation of reflection servicer."""
-
-import grpc
-from google.protobuf import descriptor_pb2
-from google.protobuf import descriptor_pool
-
-from src.proto.grpc.reflection.v1alpha import reflection_pb2 as _reflection_pb2
-from src.proto.grpc.reflection.v1alpha import reflection_pb2_grpc as _reflection_pb2_grpc
-
-_POOL = descriptor_pool.Default()
-
-
-def _not_found_error():
- return _reflection_pb2.ServerReflectionResponse(
- error_response=_reflection_pb2.ErrorResponse(
- error_code=grpc.StatusCode.NOT_FOUND.value[0],
- error_message=grpc.StatusCode.NOT_FOUND.value[1].encode(),
- ))
-
-
-def _file_descriptor_response(descriptor):
- proto = descriptor_pb2.FileDescriptorProto()
- descriptor.CopyToProto(proto)
- serialized_proto = proto.SerializeToString()
- return _reflection_pb2.ServerReflectionResponse(
- file_descriptor_response=_reflection_pb2.FileDescriptorResponse(
- file_descriptor_proto=(serialized_proto,)),)
-
-
-class BaseReflectionServicer(_reflection_pb2_grpc.ServerReflectionServicer):
- """Base class for reflection servicer."""
-
- def __init__(self, service_names, pool=None):
- """Constructor.
-
- Args:
- service_names: Iterable of fully-qualified service names available.
- pool: An optional DescriptorPool instance.
- """
- self._service_names = tuple(sorted(service_names))
- self._pool = _POOL if pool is None else pool
-
- def _file_by_filename(self, filename):
- try:
- descriptor = self._pool.FindFileByName(filename)
- except KeyError:
- return _not_found_error()
- else:
- return _file_descriptor_response(descriptor)
-
- def _file_containing_symbol(self, fully_qualified_name):
- try:
- descriptor = self._pool.FindFileContainingSymbol(
- fully_qualified_name)
- except KeyError:
- return _not_found_error()
- else:
- return _file_descriptor_response(descriptor)
-
- def _file_containing_extension(self, containing_type, extension_number):
- try:
- message_descriptor = self._pool.FindMessageTypeByName(
- containing_type)
- extension_descriptor = self._pool.FindExtensionByNumber(
- message_descriptor, extension_number)
- descriptor = self._pool.FindFileContainingSymbol(
- extension_descriptor.full_name)
- except KeyError:
- return _not_found_error()
- else:
- return _file_descriptor_response(descriptor)
-
- def _all_extension_numbers_of_type(self, containing_type):
- try:
- message_descriptor = self._pool.FindMessageTypeByName(
- containing_type)
- extension_numbers = tuple(
- sorted(extension.number for extension in
- self._pool.FindAllExtensions(message_descriptor)))
- except KeyError:
- return _not_found_error()
- else:
- return _reflection_pb2.ServerReflectionResponse(
- all_extension_numbers_response=_reflection_pb2.
- ExtensionNumberResponse(
- base_type_name=message_descriptor.full_name,
- extension_number=extension_numbers))
-
- def _list_services(self):
- return _reflection_pb2.ServerReflectionResponse(
- list_services_response=_reflection_pb2.ListServiceResponse(service=[
- _reflection_pb2.ServiceResponse(name=service_name)
- for service_name in self._service_names
- ]))
-
-
-__all__ = ['BaseReflectionServicer']
+# Copyright 2020 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+"""Base implementation of reflection servicer."""
+
+import grpc
+from google.protobuf import descriptor_pb2
+from google.protobuf import descriptor_pool
+
+from src.proto.grpc.reflection.v1alpha import reflection_pb2 as _reflection_pb2
+from src.proto.grpc.reflection.v1alpha import reflection_pb2_grpc as _reflection_pb2_grpc
+
+_POOL = descriptor_pool.Default()
+
+
+def _not_found_error():
+ return _reflection_pb2.ServerReflectionResponse(
+ error_response=_reflection_pb2.ErrorResponse(
+ error_code=grpc.StatusCode.NOT_FOUND.value[0],
+ error_message=grpc.StatusCode.NOT_FOUND.value[1].encode(),
+ ))
+
+
+def _file_descriptor_response(descriptor):
+ proto = descriptor_pb2.FileDescriptorProto()
+ descriptor.CopyToProto(proto)
+ serialized_proto = proto.SerializeToString()
+ return _reflection_pb2.ServerReflectionResponse(
+ file_descriptor_response=_reflection_pb2.FileDescriptorResponse(
+ file_descriptor_proto=(serialized_proto,)),)
+
+
+class BaseReflectionServicer(_reflection_pb2_grpc.ServerReflectionServicer):
+ """Base class for reflection servicer."""
+
+ def __init__(self, service_names, pool=None):
+ """Constructor.
+
+ Args:
+ service_names: Iterable of fully-qualified service names available.
+ pool: An optional DescriptorPool instance.
+ """
+ self._service_names = tuple(sorted(service_names))
+ self._pool = _POOL if pool is None else pool
+
+ def _file_by_filename(self, filename):
+ try:
+ descriptor = self._pool.FindFileByName(filename)
+ except KeyError:
+ return _not_found_error()
+ else:
+ return _file_descriptor_response(descriptor)
+
+ def _file_containing_symbol(self, fully_qualified_name):
+ try:
+ descriptor = self._pool.FindFileContainingSymbol(
+ fully_qualified_name)
+ except KeyError:
+ return _not_found_error()
+ else:
+ return _file_descriptor_response(descriptor)
+
+ def _file_containing_extension(self, containing_type, extension_number):
+ try:
+ message_descriptor = self._pool.FindMessageTypeByName(
+ containing_type)
+ extension_descriptor = self._pool.FindExtensionByNumber(
+ message_descriptor, extension_number)
+ descriptor = self._pool.FindFileContainingSymbol(
+ extension_descriptor.full_name)
+ except KeyError:
+ return _not_found_error()
+ else:
+ return _file_descriptor_response(descriptor)
+
+ def _all_extension_numbers_of_type(self, containing_type):
+ try:
+ message_descriptor = self._pool.FindMessageTypeByName(
+ containing_type)
+ extension_numbers = tuple(
+ sorted(extension.number for extension in
+ self._pool.FindAllExtensions(message_descriptor)))
+ except KeyError:
+ return _not_found_error()
+ else:
+ return _reflection_pb2.ServerReflectionResponse(
+ all_extension_numbers_response=_reflection_pb2.
+ ExtensionNumberResponse(
+ base_type_name=message_descriptor.full_name,
+ extension_number=extension_numbers))
+
+ def _list_services(self):
+ return _reflection_pb2.ServerReflectionResponse(
+ list_services_response=_reflection_pb2.ListServiceResponse(service=[
+ _reflection_pb2.ServiceResponse(name=service_name)
+ for service_name in self._service_names
+ ]))
+
+
+__all__ = ['BaseReflectionServicer']
diff --git a/contrib/libs/grpc/src/python/grpcio_reflection/grpc_reflection/v1alpha/reflection.py b/contrib/libs/grpc/src/python/grpcio_reflection/grpc_reflection/v1alpha/reflection.py
index 70d1b7ecf24..b302cea2419 100644
--- a/contrib/libs/grpc/src/python/grpcio_reflection/grpc_reflection/v1alpha/reflection.py
+++ b/contrib/libs/grpc/src/python/grpcio_reflection/grpc_reflection/v1alpha/reflection.py
@@ -13,19 +13,19 @@
# limitations under the License.
"""Reference implementation for reflection in gRPC Python."""
-import sys
+import sys
import grpc
from src.proto.grpc.reflection.v1alpha import reflection_pb2 as _reflection_pb2
from src.proto.grpc.reflection.v1alpha import reflection_pb2_grpc as _reflection_pb2_grpc
-from grpc_reflection.v1alpha._base import BaseReflectionServicer
-
+from grpc_reflection.v1alpha._base import BaseReflectionServicer
+
SERVICE_NAME = _reflection_pb2.DESCRIPTOR.services_by_name[
'ServerReflection'].full_name
-class ReflectionServicer(BaseReflectionServicer):
+class ReflectionServicer(BaseReflectionServicer):
"""Servicer handling RPCs for service statuses."""
def ServerReflectionInfo(self, request_iterator, context):
@@ -49,50 +49,50 @@ class ReflectionServicer(BaseReflectionServicer):
yield _reflection_pb2.ServerReflectionResponse(
error_response=_reflection_pb2.ErrorResponse(
error_code=grpc.StatusCode.INVALID_ARGUMENT.value[0],
- error_message=grpc.StatusCode.INVALID_ARGUMENT.value[1].
- encode(),
+ error_message=grpc.StatusCode.INVALID_ARGUMENT.value[1].
+ encode(),
))
-_enable_server_reflection_doc = """Enables server reflection on a server.
-
-Args:
- service_names: Iterable of fully-qualified service names available.
- server: grpc.Server to which reflection service will be added.
- pool: DescriptorPool object to use (descriptor_pool.Default() if None).
-"""
-
-if sys.version_info[0] >= 3 and sys.version_info[1] >= 6:
- # Exposes AsyncReflectionServicer as public API.
- from . import _async as aio
- from grpc.experimental import aio as grpc_aio # pylint: disable=ungrouped-imports
-
- def enable_server_reflection(service_names, server, pool=None):
- if isinstance(server, grpc_aio.Server):
- _reflection_pb2_grpc.add_ServerReflectionServicer_to_server(
- aio.ReflectionServicer(service_names, pool=pool), server)
- else:
- _reflection_pb2_grpc.add_ServerReflectionServicer_to_server(
- ReflectionServicer(service_names, pool=pool), server)
-
- enable_server_reflection.__doc__ = _enable_server_reflection_doc
-
- __all__ = [
- "SERVICE_NAME",
- "ReflectionServicer",
- "enable_server_reflection",
- "aio",
- ]
-else:
-
- def enable_server_reflection(service_names, server, pool=None):
- _reflection_pb2_grpc.add_ServerReflectionServicer_to_server(
- ReflectionServicer(service_names, pool=pool), server)
-
- enable_server_reflection.__doc__ = _enable_server_reflection_doc
-
- __all__ = [
- "SERVICE_NAME",
- "ReflectionServicer",
- "enable_server_reflection",
- ]
+_enable_server_reflection_doc = """Enables server reflection on a server.
+
+Args:
+ service_names: Iterable of fully-qualified service names available.
+ server: grpc.Server to which reflection service will be added.
+ pool: DescriptorPool object to use (descriptor_pool.Default() if None).
+"""
+
+if sys.version_info[0] >= 3 and sys.version_info[1] >= 6:
+ # Exposes AsyncReflectionServicer as public API.
+ from . import _async as aio
+ from grpc.experimental import aio as grpc_aio # pylint: disable=ungrouped-imports
+
+ def enable_server_reflection(service_names, server, pool=None):
+ if isinstance(server, grpc_aio.Server):
+ _reflection_pb2_grpc.add_ServerReflectionServicer_to_server(
+ aio.ReflectionServicer(service_names, pool=pool), server)
+ else:
+ _reflection_pb2_grpc.add_ServerReflectionServicer_to_server(
+ ReflectionServicer(service_names, pool=pool), server)
+
+ enable_server_reflection.__doc__ = _enable_server_reflection_doc
+
+ __all__ = [
+ "SERVICE_NAME",
+ "ReflectionServicer",
+ "enable_server_reflection",
+ "aio",
+ ]
+else:
+
+ def enable_server_reflection(service_names, server, pool=None):
+ _reflection_pb2_grpc.add_ServerReflectionServicer_to_server(
+ ReflectionServicer(service_names, pool=pool), server)
+
+ enable_server_reflection.__doc__ = _enable_server_reflection_doc
+
+ __all__ = [
+ "SERVICE_NAME",
+ "ReflectionServicer",
+ "enable_server_reflection",
+ ]
diff --git a/contrib/libs/grpc/src/python/grpcio_reflection/grpc_version.py b/contrib/libs/grpc/src/python/grpcio_reflection/grpc_version.py
index 5ac147c8691..676511118a4 100644
--- a/contrib/libs/grpc/src/python/grpcio_reflection/grpc_version.py
+++ b/contrib/libs/grpc/src/python/grpcio_reflection/grpc_version.py
@@ -14,4 +14,4 @@
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_reflection/grpc_version.py.template`!!!
-VERSION = '1.33.2'
+VERSION = '1.33.2'
diff --git a/contrib/libs/grpc/src/python/grpcio_reflection/setup.py b/contrib/libs/grpc/src/python/grpcio_reflection/setup.py
index 7a5b060f9ce..2d0a3fcdaaf 100644
--- a/contrib/libs/grpc/src/python/grpcio_reflection/setup.py
+++ b/contrib/libs/grpc/src/python/grpcio_reflection/setup.py
@@ -55,7 +55,7 @@ CLASSIFIERS = [
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
- 'Programming Language :: Python :: 3.9',
+ 'Programming Language :: Python :: 3.9',
'License :: OSI Approved :: Apache Software License',
]
@@ -71,8 +71,8 @@ INSTALL_REQUIRES = (
try:
import reflection_commands as _reflection_commands
# we are in the build environment, otherwise the above import fails
- SETUP_REQUIRES = ('grpcio-tools=={version}'.format(
- version=grpc_version.VERSION),)
+ SETUP_REQUIRES = ('grpcio-tools=={version}'.format(
+ version=grpc_version.VERSION),)
COMMAND_CLASS = {
# Run preprocess from the repository *before* doing any packaging!
'preprocess': _reflection_commands.Preprocess,
@@ -86,17 +86,17 @@ except ImportError:
'build_package_protos': _NoOpCommand,
}
-setuptools.setup(name='grpcio-reflection',
- version=grpc_version.VERSION,
- license='Apache License 2.0',
- description='Standard Protobuf Reflection Service for gRPC',
- long_description=open(_README_PATH, 'r').read(),
- author='The gRPC Authors',
- author_email='[email protected]',
- classifiers=CLASSIFIERS,
- url='https://grpc.io',
- package_dir=PACKAGE_DIRECTORIES,
- packages=setuptools.find_packages('.'),
- install_requires=INSTALL_REQUIRES,
- setup_requires=SETUP_REQUIRES,
- cmdclass=COMMAND_CLASS)
+setuptools.setup(name='grpcio-reflection',
+ version=grpc_version.VERSION,
+ license='Apache License 2.0',
+ description='Standard Protobuf Reflection Service for gRPC',
+ long_description=open(_README_PATH, 'r').read(),
+ author='The gRPC Authors',
+ author_email='[email protected]',
+ classifiers=CLASSIFIERS,
+ url='https://grpc.io',
+ package_dir=PACKAGE_DIRECTORIES,
+ packages=setuptools.find_packages('.'),
+ install_requires=INSTALL_REQUIRES,
+ setup_requires=SETUP_REQUIRES,
+ cmdclass=COMMAND_CLASS)
diff --git a/contrib/libs/grpc/src/python/grpcio_reflection/ya.make b/contrib/libs/grpc/src/python/grpcio_reflection/ya.make
index 34233d3fad1..c0f7d61dcc3 100644
--- a/contrib/libs/grpc/src/python/grpcio_reflection/ya.make
+++ b/contrib/libs/grpc/src/python/grpcio_reflection/ya.make
@@ -2,8 +2,8 @@ PY23_LIBRARY()
LICENSE(Apache-2.0)
-LICENSE_TEXTS(.yandex_meta/licenses.list.txt)
-
+LICENSE_TEXTS(.yandex_meta/licenses.list.txt)
+
OWNER(
akastornov
dvshkurko
@@ -25,7 +25,7 @@ IF (PYTHON2)
ENDIF()
ADDINCL(
- ${ARCADIA_BUILD_ROOT}/contrib/libs/grpc
+ ${ARCADIA_BUILD_ROOT}/contrib/libs/grpc
contrib/libs/grpc
contrib/libs/grpc/include
)
@@ -43,15 +43,15 @@ PY_SRCS(
TOP_LEVEL
grpc_reflection/__init__.py
grpc_reflection/v1alpha/__init__.py
- grpc_reflection/v1alpha/_base.py
+ grpc_reflection/v1alpha/_base.py
grpc_reflection/v1alpha/reflection.py
)
-IF (PYTHON3)
- PY_SRCS(
- TOP_LEVEL
- grpc_reflection/v1alpha/_async.py
- )
-ENDIF()
-
+IF (PYTHON3)
+ PY_SRCS(
+ TOP_LEVEL
+ grpc_reflection/v1alpha/_async.py
+ )
+ENDIF()
+
END()
diff --git a/contrib/libs/grpc/src/python/grpcio_status/.yandex_meta/licenses.list.txt b/contrib/libs/grpc/src/python/grpcio_status/.yandex_meta/licenses.list.txt
index 758f1df9dce..93c430236f2 100644
--- a/contrib/libs/grpc/src/python/grpcio_status/.yandex_meta/licenses.list.txt
+++ b/contrib/libs/grpc/src/python/grpcio_status/.yandex_meta/licenses.list.txt
@@ -1,28 +1,28 @@
-====================Apache-2.0====================
- license='Apache License 2.0',
-
-
-====================Apache-2.0====================
- 'License :: OSI Approved :: Apache Software License',
-
-
-====================Apache-2.0====================
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-====================COPYRIGHT====================
-// Copyright 2018 The gRPC Authors
-
-
-====================COPYRIGHT====================
-// Copyright 2020 The gRPC Authors
+====================Apache-2.0====================
+ license='Apache License 2.0',
+
+
+====================Apache-2.0====================
+ 'License :: OSI Approved :: Apache Software License',
+
+
+====================Apache-2.0====================
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+====================COPYRIGHT====================
+// Copyright 2018 The gRPC Authors
+
+
+====================COPYRIGHT====================
+// Copyright 2020 The gRPC Authors
diff --git a/contrib/libs/grpc/src/python/grpcio_status/grpc_status/_async.py b/contrib/libs/grpc/src/python/grpcio_status/grpc_status/_async.py
index 7215ebb56b1..a6a6f7ef6ad 100644
--- a/contrib/libs/grpc/src/python/grpcio_status/grpc_status/_async.py
+++ b/contrib/libs/grpc/src/python/grpcio_status/grpc_status/_async.py
@@ -1,56 +1,56 @@
-# Copyright 2020 The gRPC Authors
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-"""Reference implementation for status mapping in gRPC Python."""
-
-from grpc.experimental import aio
-
-from google.rpc import status_pb2
-
-from ._common import code_to_grpc_status_code, GRPC_DETAILS_METADATA_KEY
-
-
-async def from_call(call: aio.Call):
- """Returns a google.rpc.status.Status message from a given grpc.aio.Call.
-
- This is an EXPERIMENTAL API.
-
- Args:
- call: An grpc.aio.Call instance.
-
- Returns:
- A google.rpc.status.Status message representing the status of the RPC.
- """
- code = await call.code()
- details = await call.details()
- trailing_metadata = await call.trailing_metadata()
- if trailing_metadata is None:
- return None
- for key, value in trailing_metadata:
- if key == GRPC_DETAILS_METADATA_KEY:
- rich_status = status_pb2.Status.FromString(value)
- if code.value[0] != rich_status.code:
- raise ValueError(
- 'Code in Status proto (%s) doesn\'t match status code (%s)'
- % (code_to_grpc_status_code(rich_status.code), code))
- if details != rich_status.message:
- raise ValueError(
- 'Message in Status proto (%s) doesn\'t match status details (%s)'
- % (rich_status.message, details))
- return rich_status
- return None
-
-
-__all__ = [
- 'from_call',
-]
+# Copyright 2020 The gRPC Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+"""Reference implementation for status mapping in gRPC Python."""
+
+from grpc.experimental import aio
+
+from google.rpc import status_pb2
+
+from ._common import code_to_grpc_status_code, GRPC_DETAILS_METADATA_KEY
+
+
+async def from_call(call: aio.Call):
+ """Returns a google.rpc.status.Status message from a given grpc.aio.Call.
+
+ This is an EXPERIMENTAL API.
+
+ Args:
+ call: An grpc.aio.Call instance.
+
+ Returns:
+ A google.rpc.status.Status message representing the status of the RPC.
+ """
+ code = await call.code()
+ details = await call.details()
+ trailing_metadata = await call.trailing_metadata()
+ if trailing_metadata is None:
+ return None
+ for key, value in trailing_metadata:
+ if key == GRPC_DETAILS_METADATA_KEY:
+ rich_status = status_pb2.Status.FromString(value)
+ if code.value[0] != rich_status.code:
+ raise ValueError(
+ 'Code in Status proto (%s) doesn\'t match status code (%s)'
+ % (code_to_grpc_status_code(rich_status.code), code))
+ if details != rich_status.message:
+ raise ValueError(
+ 'Message in Status proto (%s) doesn\'t match status details (%s)'
+ % (rich_status.message, details))
+ return rich_status
+ return None
+
+
+__all__ = [
+ 'from_call',
+]
diff --git a/contrib/libs/grpc/src/python/grpcio_status/grpc_status/_common.py b/contrib/libs/grpc/src/python/grpcio_status/grpc_status/_common.py
index e0505a43bf1..4bec0ba1372 100644
--- a/contrib/libs/grpc/src/python/grpcio_status/grpc_status/_common.py
+++ b/contrib/libs/grpc/src/python/grpcio_status/grpc_status/_common.py
@@ -1,27 +1,27 @@
-# Copyright 2020 The gRPC Authors
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-"""Reference implementation for status mapping in gRPC Python."""
-
-import grpc
-
-_CODE_TO_GRPC_CODE_MAPPING = {x.value[0]: x for x in grpc.StatusCode}
-
-GRPC_DETAILS_METADATA_KEY = 'grpc-status-details-bin'
-
-
-def code_to_grpc_status_code(code):
- try:
- return _CODE_TO_GRPC_CODE_MAPPING[code]
- except KeyError:
- raise ValueError('Invalid status code %s' % code)
+# Copyright 2020 The gRPC Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+"""Reference implementation for status mapping in gRPC Python."""
+
+import grpc
+
+_CODE_TO_GRPC_CODE_MAPPING = {x.value[0]: x for x in grpc.StatusCode}
+
+GRPC_DETAILS_METADATA_KEY = 'grpc-status-details-bin'
+
+
+def code_to_grpc_status_code(code):
+ try:
+ return _CODE_TO_GRPC_CODE_MAPPING[code]
+ except KeyError:
+ raise ValueError('Invalid status code %s' % code)
diff --git a/contrib/libs/grpc/src/python/grpcio_status/grpc_status/rpc_status.py b/contrib/libs/grpc/src/python/grpcio_status/grpc_status/rpc_status.py
index d1e99f82de3..d0ec08e3a5d 100644
--- a/contrib/libs/grpc/src/python/grpcio_status/grpc_status/rpc_status.py
+++ b/contrib/libs/grpc/src/python/grpcio_status/grpc_status/rpc_status.py
@@ -14,18 +14,18 @@
"""Reference implementation for status mapping in gRPC Python."""
import collections
-import sys
+import sys
import grpc
from google.rpc import status_pb2
-from ._common import code_to_grpc_status_code, GRPC_DETAILS_METADATA_KEY
+from ._common import code_to_grpc_status_code, GRPC_DETAILS_METADATA_KEY
class _Status(
- collections.namedtuple('_Status',
- ('code', 'details', 'trailing_metadata')),
- grpc.Status):
+ collections.namedtuple('_Status',
+ ('code', 'details', 'trailing_metadata')),
+ grpc.Status):
pass
@@ -47,12 +47,12 @@ def from_call(call):
if call.trailing_metadata() is None:
return None
for key, value in call.trailing_metadata():
- if key == GRPC_DETAILS_METADATA_KEY:
+ if key == GRPC_DETAILS_METADATA_KEY:
rich_status = status_pb2.Status.FromString(value)
if call.code().value[0] != rich_status.code:
raise ValueError(
'Code in Status proto (%s) doesn\'t match status code (%s)'
- % (code_to_grpc_status_code(rich_status.code), call.code()))
+ % (code_to_grpc_status_code(rich_status.code), call.code()))
if call.details() != rich_status.message:
raise ValueError(
'Message in Status proto (%s) doesn\'t match status details (%s)'
@@ -73,17 +73,17 @@ def to_status(status):
Returns:
A grpc.Status instance representing the input google.rpc.status.Status message.
"""
- return _Status(code=code_to_grpc_status_code(status.code),
- details=status.message,
- trailing_metadata=((GRPC_DETAILS_METADATA_KEY,
- status.SerializeToString()),))
-
-
-__all__ = [
- 'from_call',
- 'to_status',
-]
-
-if sys.version_info[0] >= 3 and sys.version_info[1] >= 6:
- from . import _async as aio # pylint: disable=unused-import
- __all__.append('aio')
+ return _Status(code=code_to_grpc_status_code(status.code),
+ details=status.message,
+ trailing_metadata=((GRPC_DETAILS_METADATA_KEY,
+ status.SerializeToString()),))
+
+
+__all__ = [
+ 'from_call',
+ 'to_status',
+]
+
+if sys.version_info[0] >= 3 and sys.version_info[1] >= 6:
+ from . import _async as aio # pylint: disable=unused-import
+ __all__.append('aio')
diff --git a/contrib/libs/grpc/src/python/grpcio_status/grpc_version.py b/contrib/libs/grpc/src/python/grpcio_status/grpc_version.py
index 2a346edf746..2b6ec9c6597 100644
--- a/contrib/libs/grpc/src/python/grpcio_status/grpc_version.py
+++ b/contrib/libs/grpc/src/python/grpcio_status/grpc_version.py
@@ -14,4 +14,4 @@
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_status/grpc_version.py.template`!!!
-VERSION = '1.33.2'
+VERSION = '1.33.2'
diff --git a/contrib/libs/grpc/src/python/grpcio_status/setup.py b/contrib/libs/grpc/src/python/grpcio_status/setup.py
index 7d5454d486f..eb49069c34f 100644
--- a/contrib/libs/grpc/src/python/grpcio_status/setup.py
+++ b/contrib/libs/grpc/src/python/grpcio_status/setup.py
@@ -54,7 +54,7 @@ CLASSIFIERS = [
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
- 'Programming Language :: Python :: 3.9',
+ 'Programming Language :: Python :: 3.9',
'License :: OSI Approved :: Apache Software License',
]
@@ -83,16 +83,16 @@ except ImportError:
'build_package_protos': _NoOpCommand,
}
-setuptools.setup(name='grpcio-status',
- version=grpc_version.VERSION,
- description='Status proto mapping for gRPC',
- long_description=open(_README_PATH, 'r').read(),
- author='The gRPC Authors',
- author_email='[email protected]',
- url='https://grpc.io',
- license='Apache License 2.0',
- classifiers=CLASSIFIERS,
- package_dir=PACKAGE_DIRECTORIES,
- packages=setuptools.find_packages('.'),
- install_requires=INSTALL_REQUIRES,
- cmdclass=COMMAND_CLASS)
+setuptools.setup(name='grpcio-status',
+ version=grpc_version.VERSION,
+ description='Status proto mapping for gRPC',
+ long_description=open(_README_PATH, 'r').read(),
+ author='The gRPC Authors',
+ author_email='[email protected]',
+ url='https://grpc.io',
+ license='Apache License 2.0',
+ classifiers=CLASSIFIERS,
+ package_dir=PACKAGE_DIRECTORIES,
+ packages=setuptools.find_packages('.'),
+ install_requires=INSTALL_REQUIRES,
+ cmdclass=COMMAND_CLASS)
diff --git a/contrib/libs/grpc/src/python/grpcio_status/status_commands.py b/contrib/libs/grpc/src/python/grpcio_status/status_commands.py
index f14b134bf91..8306f3c0278 100644
--- a/contrib/libs/grpc/src/python/grpcio_status/status_commands.py
+++ b/contrib/libs/grpc/src/python/grpcio_status/status_commands.py
@@ -19,9 +19,9 @@ import shutil
import setuptools
ROOT_DIR = os.path.abspath(os.path.dirname(os.path.abspath(__file__)))
-STATUS_PROTO = os.path.join(
- ROOT_DIR, '../../../third_party/googleapis/google/rpc/status.proto')
-PACKAGE_STATUS_PROTO_PATH = 'grpc_status/google/rpc'
+STATUS_PROTO = os.path.join(
+ ROOT_DIR, '../../../third_party/googleapis/google/rpc/status.proto')
+PACKAGE_STATUS_PROTO_PATH = 'grpc_status/google/rpc'
LICENSE = os.path.join(ROOT_DIR, '../../../LICENSE')
@@ -38,12 +38,12 @@ class Preprocess(setuptools.Command):
pass
def run(self):
- if os.path.isfile(STATUS_PROTO):
- if not os.path.isdir(PACKAGE_STATUS_PROTO_PATH):
- os.makedirs(PACKAGE_STATUS_PROTO_PATH)
- shutil.copyfile(
- STATUS_PROTO,
- os.path.join(ROOT_DIR, PACKAGE_STATUS_PROTO_PATH,
- 'status.proto'))
+ if os.path.isfile(STATUS_PROTO):
+ if not os.path.isdir(PACKAGE_STATUS_PROTO_PATH):
+ os.makedirs(PACKAGE_STATUS_PROTO_PATH)
+ shutil.copyfile(
+ STATUS_PROTO,
+ os.path.join(ROOT_DIR, PACKAGE_STATUS_PROTO_PATH,
+ 'status.proto'))
if os.path.isfile(LICENSE):
shutil.copyfile(LICENSE, os.path.join(ROOT_DIR, 'LICENSE'))
diff --git a/contrib/libs/grpc/src/python/grpcio_status/ya.make b/contrib/libs/grpc/src/python/grpcio_status/ya.make
index 78672f565de..61a3ee4336b 100644
--- a/contrib/libs/grpc/src/python/grpcio_status/ya.make
+++ b/contrib/libs/grpc/src/python/grpcio_status/ya.make
@@ -2,8 +2,8 @@ PY23_LIBRARY()
LICENSE(Apache-2.0)
-LICENSE_TEXTS(.yandex_meta/licenses.list.txt)
-
+LICENSE_TEXTS(.yandex_meta/licenses.list.txt)
+
OWNER(
akastornov
dvshkurko
@@ -25,7 +25,7 @@ IF (PYTHON2)
ENDIF()
ADDINCL(
- ${ARCADIA_BUILD_ROOT}/contrib/libs/grpc
+ ${ARCADIA_BUILD_ROOT}/contrib/libs/grpc
contrib/libs/grpc
contrib/libs/grpc/include
)
@@ -42,15 +42,15 @@ NO_COMPILER_WARNINGS()
PY_SRCS(
TOP_LEVEL
grpc_status/__init__.py
- grpc_status/_common.py
+ grpc_status/_common.py
grpc_status/rpc_status.py
)
-IF (PYTHON3)
- PY_SRCS(
- TOP_LEVEL
- grpc_status/_async.py
- )
-ENDIF()
-
+IF (PYTHON3)
+ PY_SRCS(
+ TOP_LEVEL
+ grpc_status/_async.py
+ )
+ENDIF()
+
END()
diff --git a/contrib/libs/grpc/src/python/grpcio_testing/grpc_testing/_channel/_rpc_state.py b/contrib/libs/grpc/src/python/grpcio_testing/grpc_testing/_channel/_rpc_state.py
index 32824ed0a03..a548ef0f12e 100644
--- a/contrib/libs/grpc/src/python/grpcio_testing/grpc_testing/_channel/_rpc_state.py
+++ b/contrib/libs/grpc/src/python/grpcio_testing/grpc_testing/_channel/_rpc_state.py
@@ -66,10 +66,10 @@ class State(_common.ChannelRpcHandler):
return _common.ChannelRpcRead(response, None, None,
None)
else:
- return _common.ChannelRpcRead(None,
- self._trailing_metadata,
- grpc.StatusCode.OK,
- self._details)
+ return _common.ChannelRpcRead(None,
+ self._trailing_metadata,
+ grpc.StatusCode.OK,
+ self._details)
elif self._code is None:
if self._responses:
response = self._responses.pop(0)
diff --git a/contrib/libs/grpc/src/python/grpcio_testing/grpc_testing/_server/_server.py b/contrib/libs/grpc/src/python/grpcio_testing/grpc_testing/_server/_server.py
index c382b8cdd25..6d256d848f7 100644
--- a/contrib/libs/grpc/src/python/grpcio_testing/grpc_testing/_server/_server.py
+++ b/contrib/libs/grpc/src/python/grpcio_testing/grpc_testing/_server/_server.py
@@ -74,33 +74,33 @@ class _Serverish(_common.Serverish):
if handler.add_termination_callback(rpc.extrinsic_abort):
servicer_context = _servicer_context.ServicerContext(
rpc, self._time, deadline)
- service_thread = threading.Thread(target=service_behavior,
- args=(
- implementation,
- rpc,
- servicer_context,
- ))
+ service_thread = threading.Thread(target=service_behavior,
+ args=(
+ implementation,
+ rpc,
+ servicer_context,
+ ))
service_thread.start()
def invoke_unary_unary(self, method_descriptor, handler,
invocation_metadata, request, deadline):
- self._invoke(_unary_unary_service(request), method_descriptor, handler,
- invocation_metadata, deadline)
+ self._invoke(_unary_unary_service(request), method_descriptor, handler,
+ invocation_metadata, deadline)
def invoke_unary_stream(self, method_descriptor, handler,
invocation_metadata, request, deadline):
- self._invoke(_unary_stream_service(request), method_descriptor, handler,
- invocation_metadata, deadline)
+ self._invoke(_unary_stream_service(request), method_descriptor, handler,
+ invocation_metadata, deadline)
def invoke_stream_unary(self, method_descriptor, handler,
invocation_metadata, deadline):
- self._invoke(_stream_unary_service(handler), method_descriptor, handler,
- invocation_metadata, deadline)
+ self._invoke(_stream_unary_service(handler), method_descriptor, handler,
+ invocation_metadata, deadline)
def invoke_stream_stream(self, method_descriptor, handler,
invocation_metadata, deadline):
- self._invoke(_stream_stream_service(handler), method_descriptor,
- handler, invocation_metadata, deadline)
+ self._invoke(_stream_stream_service(handler), method_descriptor,
+ handler, invocation_metadata, deadline)
def _deadline_and_handler(requests_closed, time, timeout):
@@ -122,17 +122,17 @@ class _Server(grpc_testing.Server):
def invoke_unary_unary(self, method_descriptor, invocation_metadata,
request, timeout):
deadline, handler = _deadline_and_handler(True, self._time, timeout)
- self._serverish.invoke_unary_unary(method_descriptor, handler,
- invocation_metadata, request,
- deadline)
+ self._serverish.invoke_unary_unary(method_descriptor, handler,
+ invocation_metadata, request,
+ deadline)
return _server_rpc.UnaryUnaryServerRpc(handler)
def invoke_unary_stream(self, method_descriptor, invocation_metadata,
request, timeout):
deadline, handler = _deadline_and_handler(True, self._time, timeout)
- self._serverish.invoke_unary_stream(method_descriptor, handler,
- invocation_metadata, request,
- deadline)
+ self._serverish.invoke_unary_stream(method_descriptor, handler,
+ invocation_metadata, request,
+ deadline)
return _server_rpc.UnaryStreamServerRpc(handler)
def invoke_stream_unary(self, method_descriptor, invocation_metadata,
diff --git a/contrib/libs/grpc/src/python/grpcio_testing/grpc_testing/_server/_service.py b/contrib/libs/grpc/src/python/grpcio_testing/grpc_testing/_server/_service.py
index df9211eac41..a65628a1216 100644
--- a/contrib/libs/grpc/src/python/grpcio_testing/grpc_testing/_server/_service.py
+++ b/contrib/libs/grpc/src/python/grpcio_testing/grpc_testing/_server/_service.py
@@ -80,10 +80,10 @@ def unary_stream(implementation, rpc, request, servicer_context):
def stream_unary(implementation, rpc, handler, servicer_context):
- _unary_response(_RequestIterator(rpc, handler), implementation, rpc,
- servicer_context)
+ _unary_response(_RequestIterator(rpc, handler), implementation, rpc,
+ servicer_context)
def stream_stream(implementation, rpc, handler, servicer_context):
- _stream_response(_RequestIterator(rpc, handler), implementation, rpc,
- servicer_context)
+ _stream_response(_RequestIterator(rpc, handler), implementation, rpc,
+ servicer_context)
diff --git a/contrib/libs/grpc/src/python/grpcio_testing/grpc_version.py b/contrib/libs/grpc/src/python/grpcio_testing/grpc_version.py
index 11a18afbe22..c042934ba35 100644
--- a/contrib/libs/grpc/src/python/grpcio_testing/grpc_version.py
+++ b/contrib/libs/grpc/src/python/grpcio_testing/grpc_version.py
@@ -14,4 +14,4 @@
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_testing/grpc_version.py.template`!!!
-VERSION = '1.33.2'
+VERSION = '1.33.2'
diff --git a/contrib/libs/grpc/src/python/grpcio_testing/setup.py b/contrib/libs/grpc/src/python/grpcio_testing/setup.py
index 594526c3e72..1946793fe62 100644
--- a/contrib/libs/grpc/src/python/grpcio_testing/setup.py
+++ b/contrib/libs/grpc/src/python/grpcio_testing/setup.py
@@ -66,15 +66,15 @@ except ImportError:
'preprocess': _NoOpCommand,
}
-setuptools.setup(name='grpcio-testing',
- version=grpc_version.VERSION,
- license='Apache License 2.0',
- description='Testing utilities for gRPC Python',
- long_description=open(_README_PATH, 'r').read(),
- author='The gRPC Authors',
- author_email='[email protected]',
- url='https://grpc.io',
- package_dir=PACKAGE_DIRECTORIES,
- packages=setuptools.find_packages('.'),
- install_requires=INSTALL_REQUIRES,
- cmdclass=COMMAND_CLASS)
+setuptools.setup(name='grpcio-testing',
+ version=grpc_version.VERSION,
+ license='Apache License 2.0',
+ description='Testing utilities for gRPC Python',
+ long_description=open(_README_PATH, 'r').read(),
+ author='The gRPC Authors',
+ author_email='[email protected]',
+ url='https://grpc.io',
+ package_dir=PACKAGE_DIRECTORIES,
+ packages=setuptools.find_packages('.'),
+ install_requires=INSTALL_REQUIRES,
+ cmdclass=COMMAND_CLASS)
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/.yandex_meta/licenses.list.txt b/contrib/libs/grpc/src/python/grpcio_tests/.yandex_meta/licenses.list.txt
index 47c501db069..e0080a7b1fc 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/.yandex_meta/licenses.list.txt
+++ b/contrib/libs/grpc/src/python/grpcio_tests/.yandex_meta/licenses.list.txt
@@ -1,72 +1,72 @@
-====================Apache-2.0====================
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-====================COPYRIGHT====================
- * Copyright 2015 gRPC authors.
-
-
-====================COPYRIGHT====================
- * Copyright 2016 gRPC authors.
-
-
-====================COPYRIGHT====================
- * Copyright 2017 gRPC authors.
-
-
-====================COPYRIGHT====================
- * Copyright 2018 gRPC authors.
-
-
-====================COPYRIGHT====================
- * Copyright 2020 gRPC authors.
-
-
-====================COPYRIGHT====================
-# Copyright 2018 The gRPC Authors.
-
-
-====================COPYRIGHT====================
-# Copyright 2019 The gRPC Authors.
-
-
-====================COPYRIGHT====================
-# Copyright 2019 The gRPC authors.
-
-
-====================COPYRIGHT====================
-# Copyright 2019 gRPC authors.
-
-
-====================COPYRIGHT====================
-# Copyright 2019 the gRPC authors.
-
-
-====================COPYRIGHT====================
-# Copyright 2020 The gRPC Authors.
-
-
-====================COPYRIGHT====================
-# Copyright 2020 The gRPC authors.
-
-
-====================COPYRIGHT====================
-// Copyright 2018 The gRPC Authors
-
-
-====================COPYRIGHT====================
-// Copyright 2019 The gRPC Authors
-
-
-====================COPYRIGHT====================
-// Copyright 2020 The gRPC Authors
+====================Apache-2.0====================
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+====================COPYRIGHT====================
+ * Copyright 2015 gRPC authors.
+
+
+====================COPYRIGHT====================
+ * Copyright 2016 gRPC authors.
+
+
+====================COPYRIGHT====================
+ * Copyright 2017 gRPC authors.
+
+
+====================COPYRIGHT====================
+ * Copyright 2018 gRPC authors.
+
+
+====================COPYRIGHT====================
+ * Copyright 2020 gRPC authors.
+
+
+====================COPYRIGHT====================
+# Copyright 2018 The gRPC Authors.
+
+
+====================COPYRIGHT====================
+# Copyright 2019 The gRPC Authors.
+
+
+====================COPYRIGHT====================
+# Copyright 2019 The gRPC authors.
+
+
+====================COPYRIGHT====================
+# Copyright 2019 gRPC authors.
+
+
+====================COPYRIGHT====================
+# Copyright 2019 the gRPC authors.
+
+
+====================COPYRIGHT====================
+# Copyright 2020 The gRPC Authors.
+
+
+====================COPYRIGHT====================
+# Copyright 2020 The gRPC authors.
+
+
+====================COPYRIGHT====================
+// Copyright 2018 The gRPC Authors
+
+
+====================COPYRIGHT====================
+// Copyright 2019 The gRPC Authors
+
+
+====================COPYRIGHT====================
+// Copyright 2020 The gRPC Authors
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/commands.py b/contrib/libs/grpc/src/python/grpcio_tests/commands.py
index 5fd84b9b2ce..889b0bd9dc3 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/commands.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/commands.py
@@ -106,37 +106,37 @@ class TestLite(setuptools.Command):
self.distribution.fetch_build_eggs(self.distribution.tests_require)
-class TestPy3Only(setuptools.Command):
- """Command to run tests for Python 3+ features.
-
- This does not include asyncio tests, which are housed in a separate
- directory.
- """
-
- description = 'run tests for py3+ features'
- user_options = []
-
- def initialize_options(self):
- pass
-
- def finalize_options(self):
- pass
-
- def run(self):
- self._add_eggs_to_path()
- import tests
- loader = tests.Loader()
- loader.loadTestsFromNames(['tests_py3_only'])
- runner = tests.Runner()
- result = runner.run(loader.suite)
- if not result.wasSuccessful():
- sys.exit('Test failure')
-
- def _add_eggs_to_path(self):
- self.distribution.fetch_build_eggs(self.distribution.install_requires)
- self.distribution.fetch_build_eggs(self.distribution.tests_require)
-
-
+class TestPy3Only(setuptools.Command):
+ """Command to run tests for Python 3+ features.
+
+ This does not include asyncio tests, which are housed in a separate
+ directory.
+ """
+
+ description = 'run tests for py3+ features'
+ user_options = []
+
+ def initialize_options(self):
+ pass
+
+ def finalize_options(self):
+ pass
+
+ def run(self):
+ self._add_eggs_to_path()
+ import tests
+ loader = tests.Loader()
+ loader.loadTestsFromNames(['tests_py3_only'])
+ runner = tests.Runner()
+ result = runner.run(loader.suite)
+ if not result.wasSuccessful():
+ sys.exit('Test failure')
+
+ def _add_eggs_to_path(self):
+ self.distribution.fetch_build_eggs(self.distribution.install_requires)
+ self.distribution.fetch_build_eggs(self.distribution.tests_require)
+
+
class TestAio(setuptools.Command):
"""Command to run aio tests without fetching or building anything."""
@@ -191,7 +191,7 @@ class TestGevent(setuptools.Command):
'unit._server_ssl_cert_config_test',
# TODO(https://github.com/grpc/grpc/issues/14901) enable this test
'protoc_plugin._python_plugin_test.PythonPluginTest',
- 'protoc_plugin._python_plugin_test.SimpleStubsPluginTest',
+ 'protoc_plugin._python_plugin_test.SimpleStubsPluginTest',
# Beta API is unsupported for gevent
'protoc_plugin.beta_python_plugin_test',
'unit.beta._beta_features_test',
@@ -220,17 +220,17 @@ class TestGevent(setuptools.Command):
'unit._cython._channel_test.ChannelTest.test_negative_deadline_connectivity',
# TODO(https://github.com/grpc/grpc/issues/15411) enable this test
'unit._local_credentials_test.LocalCredentialsTest',
- # TODO(https://github.com/grpc/grpc/issues/22020) LocalCredentials
- # aren't supported with custom io managers.
- 'unit._contextvars_propagation_test',
+ # TODO(https://github.com/grpc/grpc/issues/22020) LocalCredentials
+ # aren't supported with custom io managers.
+ 'unit._contextvars_propagation_test',
'testing._time_test.StrictRealTimeTest',
)
BANNED_WINDOWS_TESTS = (
# TODO(https://github.com/grpc/grpc/pull/15411) enable this test
- 'unit._dns_resolver_test.DNSResolverTest.test_connect_loopback',
- # TODO(https://github.com/grpc/grpc/pull/15411) enable this test
- 'unit._server_test.ServerTest.test_failed_port_binding_exception',
- )
+ 'unit._dns_resolver_test.DNSResolverTest.test_connect_loopback',
+ # TODO(https://github.com/grpc/grpc/pull/15411) enable this test
+ 'unit._server_test.ServerTest.test_failed_port_binding_exception',
+ )
description = 'run tests with gevent. Assumes grpc/gevent are installed'
user_options = []
@@ -269,18 +269,18 @@ class TestGevent(setuptools.Command):
class RunInterop(test.test):
description = 'run interop test client/server'
- user_options = [
- ('args=', None, 'pass-thru arguments for the client/server'),
- ('client', None, 'flag indicating to run the client'),
- ('server', None, 'flag indicating to run the server'),
- ('use-asyncio', None, 'flag indicating to run the asyncio stack')
- ]
+ user_options = [
+ ('args=', None, 'pass-thru arguments for the client/server'),
+ ('client', None, 'flag indicating to run the client'),
+ ('server', None, 'flag indicating to run the server'),
+ ('use-asyncio', None, 'flag indicating to run the asyncio stack')
+ ]
def initialize_options(self):
self.args = ''
self.client = False
self.server = False
- self.use_asyncio = False
+ self.use_asyncio = False
def finalize_options(self):
if self.client and self.server:
@@ -301,15 +301,15 @@ class RunInterop(test.test):
def run_server(self):
# We import here to ensure that our setuptools parent has had a chance to
# edit the Python system path.
- if self.use_asyncio:
- import asyncio
- from tests_aio.interop import server
- sys.argv[1:] = self.args.split()
- asyncio.get_event_loop().run_until_complete(server.serve())
- else:
- from tests.interop import server
- sys.argv[1:] = self.args.split()
- server.serve()
+ if self.use_asyncio:
+ import asyncio
+ from tests_aio.interop import server
+ sys.argv[1:] = self.args.split()
+ asyncio.get_event_loop().run_until_complete(server.serve())
+ else:
+ from tests.interop import server
+ sys.argv[1:] = self.args.split()
+ server.serve()
def run_client(self):
# We import here to ensure that our setuptools parent has had a chance to
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/grpc_version.py b/contrib/libs/grpc/src/python/grpcio_tests/grpc_version.py
index 5f5aa21ddf3..219b336a429 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/grpc_version.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/grpc_version.py
@@ -14,4 +14,4 @@
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_tests/grpc_version.py.template`!!!
-VERSION = '1.33.2'
+VERSION = '1.33.2'
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/setup.py b/contrib/libs/grpc/src/python/grpcio_tests/setup.py
index 8a55511d42a..87cccda425b 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/setup.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/setup.py
@@ -13,7 +13,7 @@
# limitations under the License.
"""A setup module for the gRPC Python package."""
-import multiprocessing
+import multiprocessing
import os
import os.path
import sys
@@ -38,16 +38,16 @@ PACKAGE_DIRECTORIES = {
}
INSTALL_REQUIRES = (
- 'coverage>=4.0', 'grpcio>={version}'.format(version=grpc_version.VERSION),
+ 'coverage>=4.0', 'grpcio>={version}'.format(version=grpc_version.VERSION),
'grpcio-channelz>={version}'.format(version=grpc_version.VERSION),
'grpcio-status>={version}'.format(version=grpc_version.VERSION),
'grpcio-tools>={version}'.format(version=grpc_version.VERSION),
'grpcio-health-checking>={version}'.format(version=grpc_version.VERSION),
- 'oauth2client>=1.4.7', 'protobuf>=3.6.0', 'six>=1.10',
- 'google-auth>=1.17.2', 'requests>=2.14.2')
+ 'oauth2client>=1.4.7', 'protobuf>=3.6.0', 'six>=1.10',
+ 'google-auth>=1.17.2', 'requests>=2.14.2')
if not PY3:
- INSTALL_REQUIRES += ('futures>=2.2.0', 'enum34>=1.0.4')
+ INSTALL_REQUIRES += ('futures>=2.2.0', 'enum34>=1.0.4')
COMMAND_CLASS = {
# Run `preprocess` *before* doing any packaging!
@@ -59,7 +59,7 @@ COMMAND_CLASS = {
'test_lite': commands.TestLite,
'test_gevent': commands.TestGevent,
'test_aio': commands.TestAio,
- 'test_py3_only': commands.TestPy3Only,
+ 'test_py3_only': commands.TestPy3Only,
}
PACKAGE_DATA = {
@@ -68,7 +68,7 @@ PACKAGE_DATA = {
'credentials/server1.key',
'credentials/server1.pem',
],
- 'tests.protoc_plugin.protos.invocation_testing': ['same.proto',],
+ 'tests.protoc_plugin.protos.invocation_testing': ['same.proto',],
'tests.protoc_plugin.protos.invocation_testing.split_messages': [
'messages.proto',
],
@@ -94,19 +94,19 @@ TESTS_REQUIRE = INSTALL_REQUIRES
PACKAGES = setuptools.find_packages('.')
-if __name__ == "__main__":
- multiprocessing.freeze_support()
- setuptools.setup(
- name='grpcio-tests',
- version=grpc_version.VERSION,
- license=LICENSE,
- packages=list(PACKAGES),
- package_dir=PACKAGE_DIRECTORIES,
- package_data=PACKAGE_DATA,
- install_requires=INSTALL_REQUIRES,
- cmdclass=COMMAND_CLASS,
- tests_require=TESTS_REQUIRE,
- test_suite=TEST_SUITE,
- test_loader=TEST_LOADER,
- test_runner=TEST_RUNNER,
- )
+if __name__ == "__main__":
+ multiprocessing.freeze_support()
+ setuptools.setup(
+ name='grpcio-tests',
+ version=grpc_version.VERSION,
+ license=LICENSE,
+ packages=list(PACKAGES),
+ package_dir=PACKAGE_DIRECTORIES,
+ package_data=PACKAGE_DATA,
+ install_requires=INSTALL_REQUIRES,
+ cmdclass=COMMAND_CLASS,
+ tests_require=TESTS_REQUIRE,
+ test_suite=TEST_SUITE,
+ test_loader=TEST_LOADER,
+ test_runner=TEST_RUNNER,
+ )
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/_result.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/_result.py
index 3d8ffa5e176..389d5f4f96a 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/_result.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/_result.py
@@ -106,13 +106,13 @@ class CaseResult(
stderr = self.stderr if stderr is None else stderr
skip_reason = self.skip_reason if skip_reason is None else skip_reason
traceback = self.traceback if traceback is None else traceback
- return CaseResult(id=self.id,
- name=name,
- kind=kind,
- stdout=stdout,
- stderr=stderr,
- skip_reason=skip_reason,
- traceback=traceback)
+ return CaseResult(id=self.id,
+ name=name,
+ kind=kind,
+ stdout=stdout,
+ stderr=stderr,
+ skip_reason=skip_reason,
+ traceback=traceback)
class AugmentedResult(unittest.TestResult):
@@ -147,9 +147,9 @@ class AugmentedResult(unittest.TestResult):
"""See unittest.TestResult.startTest."""
super(AugmentedResult, self).startTest(test)
case_id = self.id_map(test)
- self.cases[case_id] = CaseResult(id=case_id,
- name=test.id(),
- kind=CaseResult.Kind.RUNNING)
+ self.cases[case_id] = CaseResult(id=case_id,
+ name=test.id(),
+ kind=CaseResult.Kind.RUNNING)
def addError(self, test, err):
"""See unittest.TestResult.addError."""
@@ -275,8 +275,8 @@ class TerminalResult(CoverageResult):
def startTestRun(self):
"""See unittest.TestResult.startTestRun."""
super(TerminalResult, self).startTestRun()
- self.out.write(_Colors.HEADER + 'Testing gRPC Python...\n' +
- _Colors.END)
+ self.out.write(_Colors.HEADER + 'Testing gRPC Python...\n' +
+ _Colors.END)
def stopTestRun(self):
"""See unittest.TestResult.stopTestRun."""
@@ -287,43 +287,43 @@ class TerminalResult(CoverageResult):
def addError(self, test, err):
"""See unittest.TestResult.addError."""
super(TerminalResult, self).addError(test, err)
- self.out.write(_Colors.FAIL + 'ERROR {}\n'.format(test.id()) +
- _Colors.END)
+ self.out.write(_Colors.FAIL + 'ERROR {}\n'.format(test.id()) +
+ _Colors.END)
self.out.flush()
def addFailure(self, test, err):
"""See unittest.TestResult.addFailure."""
super(TerminalResult, self).addFailure(test, err)
- self.out.write(_Colors.FAIL + 'FAILURE {}\n'.format(test.id()) +
- _Colors.END)
+ self.out.write(_Colors.FAIL + 'FAILURE {}\n'.format(test.id()) +
+ _Colors.END)
self.out.flush()
def addSuccess(self, test):
"""See unittest.TestResult.addSuccess."""
super(TerminalResult, self).addSuccess(test)
- self.out.write(_Colors.OK + 'SUCCESS {}\n'.format(test.id()) +
- _Colors.END)
+ self.out.write(_Colors.OK + 'SUCCESS {}\n'.format(test.id()) +
+ _Colors.END)
self.out.flush()
def addSkip(self, test, reason):
"""See unittest.TestResult.addSkip."""
super(TerminalResult, self).addSkip(test, reason)
- self.out.write(_Colors.INFO + 'SKIP {}\n'.format(test.id()) +
- _Colors.END)
+ self.out.write(_Colors.INFO + 'SKIP {}\n'.format(test.id()) +
+ _Colors.END)
self.out.flush()
def addExpectedFailure(self, test, err):
"""See unittest.TestResult.addExpectedFailure."""
super(TerminalResult, self).addExpectedFailure(test, err)
- self.out.write(_Colors.INFO + 'FAILURE_OK {}\n'.format(test.id()) +
- _Colors.END)
+ self.out.write(_Colors.INFO + 'FAILURE_OK {}\n'.format(test.id()) +
+ _Colors.END)
self.out.flush()
def addUnexpectedSuccess(self, test):
"""See unittest.TestResult.addUnexpectedSuccess."""
super(TerminalResult, self).addUnexpectedSuccess(test)
- self.out.write(_Colors.INFO + 'UNEXPECTED_OK {}\n'.format(test.id()) +
- _Colors.END)
+ self.out.write(_Colors.INFO + 'UNEXPECTED_OK {}\n'.format(test.id()) +
+ _Colors.END)
self.out.flush()
@@ -372,11 +372,11 @@ def summary(result):
result.augmented_results(
lambda case_result: case_result.kind is CaseResult.Kind.SKIP))
expected_failures = list(
- result.augmented_results(lambda case_result: case_result.kind is
- CaseResult.Kind.EXPECTED_FAILURE))
+ result.augmented_results(lambda case_result: case_result.kind is
+ CaseResult.Kind.EXPECTED_FAILURE))
unexpected_successes = list(
- result.augmented_results(lambda case_result: case_result.kind is
- CaseResult.Kind.UNEXPECTED_SUCCESS))
+ result.augmented_results(lambda case_result: case_result.kind is
+ CaseResult.Kind.UNEXPECTED_SUCCESS))
running_names = [case.name for case in running]
finished_count = (len(failures) + len(errors) + len(successes) +
len(expected_failures) + len(unexpected_successes))
@@ -395,17 +395,17 @@ def summary(result):
expected_fail=len(expected_failures),
unexpected_successful=len(unexpected_successes),
interrupted=str(running_names)))
- tracebacks = '\n\n'.join([
- (_Colors.FAIL + '{test_name}' + _Colors.END + '\n' + _Colors.BOLD +
- 'traceback:' + _Colors.END + '\n' + '{traceback}\n' + _Colors.BOLD +
- 'stdout:' + _Colors.END + '\n' + '{stdout}\n' + _Colors.BOLD +
- 'stderr:' + _Colors.END + '\n' + '{stderr}\n').format(
- test_name=result.name,
- traceback=_traceback_string(*result.traceback),
- stdout=result.stdout,
- stderr=result.stderr)
- for result in itertools.chain(failures, errors)
- ])
+ tracebacks = '\n\n'.join([
+ (_Colors.FAIL + '{test_name}' + _Colors.END + '\n' + _Colors.BOLD +
+ 'traceback:' + _Colors.END + '\n' + '{traceback}\n' + _Colors.BOLD +
+ 'stdout:' + _Colors.END + '\n' + '{stdout}\n' + _Colors.BOLD +
+ 'stderr:' + _Colors.END + '\n' + '{stderr}\n').format(
+ test_name=result.name,
+ traceback=_traceback_string(*result.traceback),
+ stdout=result.stdout,
+ stderr=result.stderr)
+ for result in itertools.chain(failures, errors)
+ ])
notes = 'Unexpected successes: {}\n'.format(
[result.name for result in unexpected_successes])
return statistics + '\nErrors/Failures: \n' + tracebacks + '\n' + notes
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/_runner.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/_runner.py
index d49c79e8aa7..39da0399b02 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/_runner.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/_runner.py
@@ -114,8 +114,8 @@ class AugmentedCase(collections.namedtuple('AugmentedCase', ['case', 'id'])):
return super(cls, AugmentedCase).__new__(cls, case, id)
-# NOTE(lidiz) This complex wrapper is not triggering setUpClass nor
-# tearDownClass. Do not use those methods, or fix this wrapper!
+# NOTE(lidiz) This complex wrapper is not triggering setUpClass nor
+# tearDownClass. Do not use those methods, or fix this wrapper!
class Runner(object):
def __init__(self, dedicated_threads=False):
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/_sanity/_sanity_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/_sanity/_sanity_test.py
index fa29ba6e345..3aa92f37fb1 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/_sanity/_sanity_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/_sanity/_sanity_test.py
@@ -33,13 +33,13 @@ class SanityTest(unittest.TestCase):
loader = tests.Loader()
loader.loadTestsFromNames([self.TEST_PKG_MODULE_NAME])
test_suite_names = sorted({
- test_case_class.id().rsplit('.', 1)[0] for test_case_class in
- tests._loader.iterate_suite_cases(loader.suite)
+ test_case_class.id().rsplit('.', 1)[0] for test_case_class in
+ tests._loader.iterate_suite_cases(loader.suite)
})
tests_json_string = pkgutil.get_data(self.TEST_PKG_PATH, 'tests.json')
- tests_json = json.loads(
- tests_json_string.decode() if six.PY3 else tests_json_string)
+ tests_json = json.loads(
+ tests_json_string.decode() if six.PY3 else tests_json_string)
self.assertSequenceEqual(tests_json, test_suite_names)
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/channelz/_channelz_servicer_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/channelz/_channelz_servicer_test.py
index 45b59580358..784307ae005 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/channelz/_channelz_servicer_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/channelz/_channelz_servicer_test.py
@@ -70,9 +70,9 @@ class _ChannelServerPair(object):
def __init__(self):
# Server will enable channelz service
- self.server = grpc.server(futures.ThreadPoolExecutor(max_workers=3),
- options=_DISABLE_REUSE_PORT +
- _ENABLE_CHANNELZ)
+ self.server = grpc.server(futures.ThreadPoolExecutor(max_workers=3),
+ options=_DISABLE_REUSE_PORT +
+ _ENABLE_CHANNELZ)
port = self.server.add_insecure_port('[::]:0')
self.server.add_generic_rpc_handlers((_GenericHandler(),))
self.server.start()
@@ -128,9 +128,9 @@ class ChannelzServicerTest(unittest.TestCase):
self._pairs = []
# This server is for Channelz info fetching only
# It self should not enable Channelz
- self._server = grpc.server(futures.ThreadPoolExecutor(max_workers=3),
- options=_DISABLE_REUSE_PORT +
- _DISABLE_CHANNELZ)
+ self._server = grpc.server(futures.ThreadPoolExecutor(max_workers=3),
+ options=_DISABLE_REUSE_PORT +
+ _DISABLE_CHANNELZ)
port = self._server.add_insecure_port('[::]:0')
channelz.add_channelz_servicer(self._server)
self._server.start()
@@ -264,8 +264,8 @@ class ChannelzServicerTest(unittest.TestCase):
self.assertGreater(len(gtc_resp.channel[i].subchannel_ref), 0)
gsc_resp = self._channelz_stub.GetSubchannel(
channelz_pb2.GetSubchannelRequest(
- subchannel_id=gtc_resp.channel[i].subchannel_ref[0].
- subchannel_id))
+ subchannel_id=gtc_resp.channel[i].subchannel_ref[0].
+ subchannel_id))
self.assertEqual(gtc_resp.channel[i].data.calls_started,
gsc_resp.subchannel.data.calls_started)
self.assertEqual(gtc_resp.channel[i].data.calls_succeeded,
@@ -332,8 +332,8 @@ class ChannelzServicerTest(unittest.TestCase):
self.assertGreater(len(gtc_resp.channel[i].subchannel_ref), 0)
gsc_resp = self._channelz_stub.GetSubchannel(
channelz_pb2.GetSubchannelRequest(
- subchannel_id=gtc_resp.channel[i].subchannel_ref[0].
- subchannel_id))
+ subchannel_id=gtc_resp.channel[i].subchannel_ref[0].
+ subchannel_id))
self.assertEqual(len(gsc_resp.subchannel.socket_ref), 1)
gs_resp = self._channelz_stub.GetSocket(
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/fork/_fork_interop_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/fork/_fork_interop_test.py
index b6ed81eaaf4..e2eff257fa1 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/fork/_fork_interop_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/fork/_fork_interop_test.py
@@ -125,9 +125,9 @@ class ForkInteropTest(unittest.TestCase):
def _verifyTestCase(self, test_case):
script = _CLIENT_FORK_SCRIPT_TEMPLATE % (test_case.name, self._port)
- process = subprocess.Popen([sys.executable, '-c', script],
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE)
+ process = subprocess.Popen([sys.executable, '-c', script],
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE)
timer = threading.Timer(_SUBPROCESS_TIMEOUT_S, process.kill)
try:
timer.start()
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/fork/client.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/fork/client.py
index a086682149d..852e6da4d69 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/fork/client.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/fork/client.py
@@ -30,22 +30,22 @@ def _args():
raise argparse.ArgumentTypeError('Only true/false allowed')
parser = argparse.ArgumentParser()
- parser.add_argument('--server_host',
- default="localhost",
- type=str,
- help='the host to which to connect')
- parser.add_argument('--server_port',
- type=int,
- required=True,
- help='the port to which to connect')
- parser.add_argument('--test_case',
- default='large_unary',
- type=str,
- help='the test case to execute')
- parser.add_argument('--use_tls',
- default=False,
- type=parse_bool,
- help='require a secure connection')
+ parser.add_argument('--server_host',
+ default="localhost",
+ type=str,
+ help='the host to which to connect')
+ parser.add_argument('--server_port',
+ type=int,
+ required=True,
+ help='the port to which to connect')
+ parser.add_argument('--test_case',
+ default='large_unary',
+ type=str,
+ help='the test case to execute')
+ parser.add_argument('--use_tls',
+ default=False,
+ type=parse_bool,
+ help='require a secure connection')
return parser.parse_args()
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/fork/methods.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/fork/methods.py
index 040dbfa4c28..2123c699161 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/fork/methods.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/fork/methods.py
@@ -298,8 +298,8 @@ def _ping_pong_with_child_processes_after_first_response(
request_payload_sizes):
request = messages_pb2.StreamingOutputCallRequest(
response_type=messages_pb2.COMPRESSABLE,
- response_parameters=(messages_pb2.ResponseParameters(
- size=response_size),),
+ response_parameters=(messages_pb2.ResponseParameters(
+ size=response_size),),
payload=messages_pb2.Payload(body=b'\x00' * payload_size))
pipe.add(request)
if first_message_received:
@@ -338,8 +338,8 @@ def _in_progress_bidi_continue_call(channel):
inherited_code = parent_bidi_call.code()
inherited_details = parent_bidi_call.details()
if inherited_code != grpc.StatusCode.CANCELLED:
- raise ValueError('Expected inherited code CANCELLED, got %s' %
- inherited_code)
+ raise ValueError('Expected inherited code CANCELLED, got %s' %
+ inherited_code)
if inherited_details != 'Channel closed due to fork':
raise ValueError(
'Expected inherited details Channel closed due to fork, got %s'
@@ -347,10 +347,10 @@ def _in_progress_bidi_continue_call(channel):
# Don't run child_target after closing the parent call, as the call may have
# received a status from the server before fork occurs.
- _ping_pong_with_child_processes_after_first_response(channel,
- None,
- child_target,
- run_after_close=False)
+ _ping_pong_with_child_processes_after_first_response(channel,
+ None,
+ child_target,
+ run_after_close=False)
def _in_progress_bidi_same_channel_async_call(channel):
@@ -446,6 +446,6 @@ class TestCase(enum.Enum):
elif self is TestCase.IN_PROGRESS_BIDI_NEW_CHANNEL_BLOCKING_CALL:
_in_progress_bidi_new_channel_blocking_call(channel, args)
else:
- raise NotImplementedError('Test case "%s" not implemented!' %
- self.name)
+ raise NotImplementedError('Test case "%s" not implemented!' %
+ self.name)
channel.close()
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/health_check/_health_servicer_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/health_check/_health_servicer_test.py
index 17efc38e0d8..01345aaca08 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/health_check/_health_servicer_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/health_check/_health_servicer_test.py
@@ -73,8 +73,8 @@ class BaseWatchTests(object):
request = health_pb2.HealthCheckRequest(service='')
response_queue = queue.Queue()
rendezvous = self._stub.Watch(request)
- thread = threading.Thread(target=_consume_responses,
- args=(rendezvous, response_queue))
+ thread = threading.Thread(target=_consume_responses,
+ args=(rendezvous, response_queue))
thread.start()
response = response_queue.get(timeout=test_constants.SHORT_TIMEOUT)
@@ -92,8 +92,8 @@ class BaseWatchTests(object):
request = health_pb2.HealthCheckRequest(service=_WATCH_SERVICE)
response_queue = queue.Queue()
rendezvous = self._stub.Watch(request)
- thread = threading.Thread(target=_consume_responses,
- args=(rendezvous, response_queue))
+ thread = threading.Thread(target=_consume_responses,
+ args=(rendezvous, response_queue))
thread.start()
response = response_queue.get(timeout=test_constants.SHORT_TIMEOUT)
@@ -120,8 +120,8 @@ class BaseWatchTests(object):
request = health_pb2.HealthCheckRequest(service=_WATCH_SERVICE)
response_queue = queue.Queue()
rendezvous = self._stub.Watch(request)
- thread = threading.Thread(target=_consume_responses,
- args=(rendezvous, response_queue))
+ thread = threading.Thread(target=_consume_responses,
+ args=(rendezvous, response_queue))
thread.start()
response = response_queue.get(timeout=test_constants.SHORT_TIMEOUT)
@@ -143,10 +143,10 @@ class BaseWatchTests(object):
response_queue2 = queue.Queue()
rendezvous1 = self._stub.Watch(request)
rendezvous2 = self._stub.Watch(request)
- thread1 = threading.Thread(target=_consume_responses,
- args=(rendezvous1, response_queue1))
- thread2 = threading.Thread(target=_consume_responses,
- args=(rendezvous2, response_queue2))
+ thread1 = threading.Thread(target=_consume_responses,
+ args=(rendezvous1, response_queue1))
+ thread2 = threading.Thread(target=_consume_responses,
+ args=(rendezvous2, response_queue2))
thread1.start()
thread2.start()
@@ -182,8 +182,8 @@ class BaseWatchTests(object):
request = health_pb2.HealthCheckRequest(service=_WATCH_SERVICE)
response_queue = queue.Queue()
rendezvous = self._stub.Watch(request)
- thread = threading.Thread(target=_consume_responses,
- args=(rendezvous, response_queue))
+ thread = threading.Thread(target=_consume_responses,
+ args=(rendezvous, response_queue))
thread.start()
response = response_queue.get(timeout=test_constants.SHORT_TIMEOUT)
@@ -197,8 +197,8 @@ class BaseWatchTests(object):
# Wait, if necessary, for serving thread to process client cancellation
timeout = time.time() + test_constants.TIME_ALLOWANCE
- while (time.time() < timeout and
- self._servicer._send_response_callbacks[_WATCH_SERVICE]):
+ while (time.time() < timeout and
+ self._servicer._send_response_callbacks[_WATCH_SERVICE]):
time.sleep(1)
self.assertFalse(
self._servicer._send_response_callbacks[_WATCH_SERVICE],
@@ -209,8 +209,8 @@ class BaseWatchTests(object):
request = health_pb2.HealthCheckRequest(service='')
response_queue = queue.Queue()
rendezvous = self._stub.Watch(request)
- thread = threading.Thread(target=_consume_responses,
- args=(rendezvous, response_queue))
+ thread = threading.Thread(target=_consume_responses,
+ args=(rendezvous, response_queue))
thread.start()
response = response_queue.get(timeout=test_constants.SHORT_TIMEOUT)
@@ -234,9 +234,9 @@ class HealthServicerTest(BaseWatchTests.WatchTests):
def setUp(self):
self._thread_pool = thread_pool.RecordingThreadPool(max_workers=None)
- super(HealthServicerTest,
- self).start_server(non_blocking=True,
- thread_pool=self._thread_pool)
+ super(HealthServicerTest,
+ self).start_server(non_blocking=True,
+ thread_pool=self._thread_pool)
def test_check_empty_service(self):
request = health_pb2.HealthCheckRequest()
@@ -273,8 +273,8 @@ class HealthServicerTest(BaseWatchTests.WatchTests):
class HealthServicerBackwardsCompatibleWatchTest(BaseWatchTests.WatchTests):
def setUp(self):
- super(HealthServicerBackwardsCompatibleWatchTest,
- self).start_server(non_blocking=False, thread_pool=None)
+ super(HealthServicerBackwardsCompatibleWatchTest,
+ self).start_server(non_blocking=False, thread_pool=None)
if __name__ == '__main__':
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/http2/negative_http2_client.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/http2/negative_http2_client.py
index 43d086c0958..0753872b5e4 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/http2/negative_http2_client.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/http2/negative_http2_client.py
@@ -32,14 +32,14 @@ def _validate_payload_type_and_length(response, expected_type, expected_length):
def _expect_status_code(call, expected_code):
if call.code() != expected_code:
- raise ValueError('expected code %s, got %s' %
- (expected_code, call.code()))
+ raise ValueError('expected code %s, got %s' %
+ (expected_code, call.code()))
def _expect_status_details(call, expected_details):
if call.details() != expected_details:
- raise ValueError('expected message %s, got %s' %
- (expected_details, call.details()))
+ raise ValueError('expected message %s, got %s' %
+ (expected_details, call.details()))
def _validate_status_code_and_details(call, expected_code, expected_details):
@@ -102,9 +102,9 @@ def _max_streams(stub):
for _ in range(15):
futures.append(stub.UnaryCall.future(_SIMPLE_REQUEST))
for future in futures:
- _validate_payload_type_and_length(future.result(),
- messages_pb2.COMPRESSABLE,
- _RESPONSE_SIZE)
+ _validate_payload_type_and_length(future.result(),
+ messages_pb2.COMPRESSABLE,
+ _RESPONSE_SIZE)
def _run_test_case(test_case, stub):
@@ -126,18 +126,18 @@ def _run_test_case(test_case, stub):
def _args():
parser = argparse.ArgumentParser()
- parser.add_argument('--server_host',
- help='the host to which to connect',
- type=str,
- default="127.0.0.1")
- parser.add_argument('--server_port',
- help='the port to which to connect',
- type=int,
- default="8080")
- parser.add_argument('--test_case',
- help='the test case to execute',
- type=str,
- default="goaway")
+ parser.add_argument('--server_host',
+ help='the host to which to connect',
+ type=str,
+ default="127.0.0.1")
+ parser.add_argument('--server_port',
+ help='the port to which to connect',
+ type=int,
+ default="8080")
+ parser.add_argument('--test_case',
+ help='the test case to execute',
+ type=str,
+ default="goaway")
return parser.parse_args()
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/interop/_secure_intraop_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/interop/_secure_intraop_test.py
index 73d2e833953..bf1f1b118b3 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/interop/_secure_intraop_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/interop/_secure_intraop_test.py
@@ -38,13 +38,13 @@ class SecureIntraopTest(_intraop_test_case.IntraopTestCase, unittest.TestCase):
resources.certificate_chain())]))
self.server.start()
self.stub = test_pb2_grpc.TestServiceStub(
- grpc.secure_channel(
- 'localhost:{}'.format(port),
- grpc.ssl_channel_credentials(
- resources.test_root_certificates()), ((
- 'grpc.ssl_target_name_override',
- _SERVER_HOST_OVERRIDE,
- ),)))
+ grpc.secure_channel(
+ 'localhost:{}'.format(port),
+ grpc.ssl_channel_credentials(
+ resources.test_root_certificates()), ((
+ 'grpc.ssl_target_name_override',
+ _SERVER_HOST_OVERRIDE,
+ ),)))
def tearDown(self):
self.server.stop(None)
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/interop/client.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/interop/client.py
index 689054480f4..4d35f7ca32a 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/interop/client.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/interop/client.py
@@ -25,135 +25,135 @@ from tests.interop import methods
from tests.interop import resources
-def parse_interop_client_args():
+def parse_interop_client_args():
parser = argparse.ArgumentParser()
- parser.add_argument('--server_host',
- default="localhost",
- type=str,
- help='the host to which to connect')
- parser.add_argument('--server_port',
- type=int,
- required=True,
- help='the port to which to connect')
- parser.add_argument('--test_case',
- default='large_unary',
- type=str,
- help='the test case to execute')
- parser.add_argument('--use_tls',
- default=False,
- type=resources.parse_bool,
- help='require a secure connection')
- parser.add_argument('--use_alts',
- default=False,
- type=resources.parse_bool,
- help='require an ALTS secure connection')
- parser.add_argument('--use_test_ca',
- default=False,
- type=resources.parse_bool,
- help='replace platform root CAs with ca.pem')
- parser.add_argument('--custom_credentials_type',
- choices=["compute_engine_channel_creds"],
- default=None,
- help='use google default credentials')
- parser.add_argument('--server_host_override',
- type=str,
- help='the server host to which to claim to connect')
- parser.add_argument('--oauth_scope',
- type=str,
- help='scope for OAuth tokens')
- parser.add_argument('--default_service_account',
- type=str,
- help='email address of the default service account')
- parser.add_argument(
- "--grpc_test_use_grpclb_with_child_policy",
- type=str,
- help=(
- "If non-empty, set a static service config on channels created by "
- + "grpc::CreateTestChannel, that configures the grpclb LB policy " +
- "with a child policy being the value of this flag (e.g. round_robin "
- + "or pick_first)."))
+ parser.add_argument('--server_host',
+ default="localhost",
+ type=str,
+ help='the host to which to connect')
+ parser.add_argument('--server_port',
+ type=int,
+ required=True,
+ help='the port to which to connect')
+ parser.add_argument('--test_case',
+ default='large_unary',
+ type=str,
+ help='the test case to execute')
+ parser.add_argument('--use_tls',
+ default=False,
+ type=resources.parse_bool,
+ help='require a secure connection')
+ parser.add_argument('--use_alts',
+ default=False,
+ type=resources.parse_bool,
+ help='require an ALTS secure connection')
+ parser.add_argument('--use_test_ca',
+ default=False,
+ type=resources.parse_bool,
+ help='replace platform root CAs with ca.pem')
+ parser.add_argument('--custom_credentials_type',
+ choices=["compute_engine_channel_creds"],
+ default=None,
+ help='use google default credentials')
+ parser.add_argument('--server_host_override',
+ type=str,
+ help='the server host to which to claim to connect')
+ parser.add_argument('--oauth_scope',
+ type=str,
+ help='scope for OAuth tokens')
+ parser.add_argument('--default_service_account',
+ type=str,
+ help='email address of the default service account')
+ parser.add_argument(
+ "--grpc_test_use_grpclb_with_child_policy",
+ type=str,
+ help=(
+ "If non-empty, set a static service config on channels created by "
+ + "grpc::CreateTestChannel, that configures the grpclb LB policy " +
+ "with a child policy being the value of this flag (e.g. round_robin "
+ + "or pick_first)."))
return parser.parse_args()
-def _create_call_credentials(args):
+def _create_call_credentials(args):
if args.test_case == 'oauth2_auth_token':
google_credentials, unused_project_id = google_auth.default(
scopes=[args.oauth_scope])
google_credentials.refresh(google_auth.transport.requests.Request())
- return grpc.access_token_call_credentials(google_credentials.token)
+ return grpc.access_token_call_credentials(google_credentials.token)
elif args.test_case == 'compute_engine_creds':
google_credentials, unused_project_id = google_auth.default(
scopes=[args.oauth_scope])
- return grpc.metadata_call_credentials(
+ return grpc.metadata_call_credentials(
google_auth.transport.grpc.AuthMetadataPlugin(
credentials=google_credentials,
request=google_auth.transport.requests.Request()))
elif args.test_case == 'jwt_token_creds':
google_credentials = google_auth_jwt.OnDemandCredentials.from_service_account_file(
os.environ[google_auth.environment_vars.CREDENTIALS])
- return grpc.metadata_call_credentials(
+ return grpc.metadata_call_credentials(
google_auth.transport.grpc.AuthMetadataPlugin(
credentials=google_credentials, request=None))
else:
- return None
-
-
-def get_secure_channel_parameters(args):
- call_credentials = _create_call_credentials(args)
-
- channel_opts = ()
- if args.grpc_test_use_grpclb_with_child_policy:
- channel_opts += ((
- "grpc.service_config",
- '{"loadBalancingConfig": [{"grpclb": {"childPolicy": [{"%s": {}}]}}]}'
- % args.grpc_test_use_grpclb_with_child_policy),)
- if args.custom_credentials_type is not None:
- if args.custom_credentials_type == "compute_engine_channel_creds":
- assert call_credentials is None
- google_credentials, unused_project_id = google_auth.default(
- scopes=[args.oauth_scope])
- call_creds = grpc.metadata_call_credentials(
- google_auth.transport.grpc.AuthMetadataPlugin(
- credentials=google_credentials,
- request=google_auth.transport.requests.Request()))
- channel_credentials = grpc.compute_engine_channel_credentials(
- call_creds)
- else:
- raise ValueError("Unknown credentials type '{}'".format(
- args.custom_credentials_type))
- elif args.use_tls:
- if args.use_test_ca:
- root_certificates = resources.test_root_certificates()
- else:
- root_certificates = None # will load default roots.
-
- channel_credentials = grpc.ssl_channel_credentials(root_certificates)
- if call_credentials is not None:
- channel_credentials = grpc.composite_channel_credentials(
- channel_credentials, call_credentials)
-
- if args.server_host_override:
- channel_opts += ((
- 'grpc.ssl_target_name_override',
- args.server_host_override,
- ),)
- elif args.use_alts:
- channel_credentials = grpc.alts_channel_credentials()
-
- return channel_credentials, channel_opts
-
-
-def _create_channel(args):
- target = '{}:{}'.format(args.server_host, args.server_port)
-
- if args.use_tls or args.use_alts or args.custom_credentials_type is not None:
- channel_credentials, options = get_secure_channel_parameters(args)
- return grpc.secure_channel(target, channel_credentials, options)
- else:
- return grpc.insecure_channel(target)
-
-
-def create_stub(channel, args):
+ return None
+
+
+def get_secure_channel_parameters(args):
+ call_credentials = _create_call_credentials(args)
+
+ channel_opts = ()
+ if args.grpc_test_use_grpclb_with_child_policy:
+ channel_opts += ((
+ "grpc.service_config",
+ '{"loadBalancingConfig": [{"grpclb": {"childPolicy": [{"%s": {}}]}}]}'
+ % args.grpc_test_use_grpclb_with_child_policy),)
+ if args.custom_credentials_type is not None:
+ if args.custom_credentials_type == "compute_engine_channel_creds":
+ assert call_credentials is None
+ google_credentials, unused_project_id = google_auth.default(
+ scopes=[args.oauth_scope])
+ call_creds = grpc.metadata_call_credentials(
+ google_auth.transport.grpc.AuthMetadataPlugin(
+ credentials=google_credentials,
+ request=google_auth.transport.requests.Request()))
+ channel_credentials = grpc.compute_engine_channel_credentials(
+ call_creds)
+ else:
+ raise ValueError("Unknown credentials type '{}'".format(
+ args.custom_credentials_type))
+ elif args.use_tls:
+ if args.use_test_ca:
+ root_certificates = resources.test_root_certificates()
+ else:
+ root_certificates = None # will load default roots.
+
+ channel_credentials = grpc.ssl_channel_credentials(root_certificates)
+ if call_credentials is not None:
+ channel_credentials = grpc.composite_channel_credentials(
+ channel_credentials, call_credentials)
+
+ if args.server_host_override:
+ channel_opts += ((
+ 'grpc.ssl_target_name_override',
+ args.server_host_override,
+ ),)
+ elif args.use_alts:
+ channel_credentials = grpc.alts_channel_credentials()
+
+ return channel_credentials, channel_opts
+
+
+def _create_channel(args):
+ target = '{}:{}'.format(args.server_host, args.server_port)
+
+ if args.use_tls or args.use_alts or args.custom_credentials_type is not None:
+ channel_credentials, options = get_secure_channel_parameters(args)
+ return grpc.secure_channel(target, channel_credentials, options)
+ else:
+ return grpc.insecure_channel(target)
+
+
+def create_stub(channel, args):
if args.test_case == "unimplemented_service":
return test_pb2_grpc.UnimplementedServiceStub(channel)
else:
@@ -169,9 +169,9 @@ def _test_case_from_arg(test_case_arg):
def test_interoperability():
- args = parse_interop_client_args()
- channel = _create_channel(args)
- stub = create_stub(channel, args)
+ args = parse_interop_client_args()
+ channel = _create_channel(args)
+ stub = create_stub(channel, args)
test_case = _test_case_from_arg(args.test_case)
test_case.test_interoperability(stub, args)
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/interop/methods.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/interop/methods.py
index 880d915fb7d..44a1c38bb93 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/interop/methods.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/interop/methods.py
@@ -42,14 +42,14 @@ _TRAILING_METADATA_KEY = "x-grpc-test-echo-trailing-bin"
def _expect_status_code(call, expected_code):
if call.code() != expected_code:
- raise ValueError('expected code %s, got %s' %
- (expected_code, call.code()))
+ raise ValueError('expected code %s, got %s' %
+ (expected_code, call.code()))
def _expect_status_details(call, expected_details):
if call.details() != expected_details:
- raise ValueError('expected message %s, got %s' %
- (expected_details, call.details()))
+ raise ValueError('expected message %s, got %s' %
+ (expected_details, call.details()))
def _validate_status_code_and_details(call, expected_code, expected_details):
@@ -75,8 +75,8 @@ def _large_unary_common_behavior(stub, fill_username, fill_oauth_scope,
payload=messages_pb2.Payload(body=b'\x00' * 271828),
fill_username=fill_username,
fill_oauth_scope=fill_oauth_scope)
- response_future = stub.UnaryCall.future(request,
- credentials=call_credentials)
+ response_future = stub.UnaryCall.future(request,
+ credentials=call_credentials)
response = response_future.result()
_validate_payload_type_and_length(response, messages_pb2.COMPRESSABLE, size)
return response
@@ -85,8 +85,8 @@ def _large_unary_common_behavior(stub, fill_username, fill_oauth_scope,
def _empty_unary(stub):
response = stub.EmptyCall(empty_pb2.Empty())
if not isinstance(response, empty_pb2.Empty):
- raise TypeError('response is of type "%s", not empty_pb2.Empty!' %
- type(response))
+ raise TypeError('response is of type "%s", not empty_pb2.Empty!' %
+ type(response))
def _large_unary(stub):
@@ -106,8 +106,8 @@ def _client_streaming(stub):
for payload in payloads)
response = stub.StreamingInputCall(requests)
if response.aggregated_payload_size != 74922:
- raise ValueError('incorrect size %d!' %
- response.aggregated_payload_size)
+ raise ValueError('incorrect size %d!' %
+ response.aggregated_payload_size)
def _server_streaming(stub):
@@ -191,14 +191,14 @@ def _ping_pong(stub):
request_payload_sizes):
request = messages_pb2.StreamingOutputCallRequest(
response_type=messages_pb2.COMPRESSABLE,
- response_parameters=(messages_pb2.ResponseParameters(
- size=response_size),),
+ response_parameters=(messages_pb2.ResponseParameters(
+ size=response_size),),
payload=messages_pb2.Payload(body=b'\x00' * payload_size))
pipe.add(request)
response = next(response_iterator)
- _validate_payload_type_and_length(response,
- messages_pb2.COMPRESSABLE,
- response_size)
+ _validate_payload_type_and_length(response,
+ messages_pb2.COMPRESSABLE,
+ response_size)
def _cancel_after_begin(stub):
@@ -231,8 +231,8 @@ def _cancel_after_first_response(stub):
payload_size = request_payload_sizes[0]
request = messages_pb2.StreamingOutputCallRequest(
response_type=messages_pb2.COMPRESSABLE,
- response_parameters=(messages_pb2.ResponseParameters(
- size=response_size),),
+ response_parameters=(messages_pb2.ResponseParameters(
+ size=response_size),),
payload=messages_pb2.Payload(body=b'\x00' * payload_size))
pipe.add(request)
response = next(response_iterator)
@@ -301,10 +301,10 @@ def _status_code_and_message(stub):
payload=messages_pb2.Payload(body=b'\x00'),
response_status=messages_pb2.EchoStatus(code=code, message=details))
pipe.add(request) # sends the initial request.
- try:
- next(response_iterator)
- except grpc.RpcError as rpc_error:
- assert rpc_error.code() == status
+ try:
+ next(response_iterator)
+ except grpc.RpcError as rpc_error:
+ assert rpc_error.code() == status
# Dropping out of with block closes the pipe
_validate_status_code_and_details(response_iterator, status, details)
@@ -371,8 +371,8 @@ def _oauth2_auth_token(stub, args):
wanted_email = json.load(open(json_key_filename, 'r'))['client_email']
response = _large_unary_common_behavior(stub, True, True, None)
if wanted_email != response.username:
- raise ValueError('expected username %s, got %s' %
- (wanted_email, response.username))
+ raise ValueError('expected username %s, got %s' %
+ (wanted_email, response.username))
if args.oauth_scope.find(response.oauth_scope) == -1:
raise ValueError(
'expected to find oauth scope "{}" in received "{}"'.format(
@@ -384,8 +384,8 @@ def _jwt_token_creds(stub, args):
wanted_email = json.load(open(json_key_filename, 'r'))['client_email']
response = _large_unary_common_behavior(stub, True, False, None)
if wanted_email != response.username:
- raise ValueError('expected username %s, got %s' %
- (wanted_email, response.username))
+ raise ValueError('expected username %s, got %s' %
+ (wanted_email, response.username))
def _per_rpc_creds(stub, args):
@@ -399,8 +399,8 @@ def _per_rpc_creds(stub, args):
request=google_auth_transport_requests.Request()))
response = _large_unary_common_behavior(stub, True, False, call_credentials)
if wanted_email != response.username:
- raise ValueError('expected username %s, got %s' %
- (wanted_email, response.username))
+ raise ValueError('expected username %s, got %s' %
+ (wanted_email, response.username))
def _special_status_message(stub, args):
@@ -478,5 +478,5 @@ class TestCase(enum.Enum):
elif self is TestCase.SPECIAL_STATUS_MESSAGE:
_special_status_message(stub, args)
else:
- raise NotImplementedError('Test case "%s" not implemented!' %
- self.name)
+ raise NotImplementedError('Test case "%s" not implemented!' %
+ self.name)
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/interop/server.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/interop/server.py
index ba0c7a34aa6..c85adb0b0bb 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/interop/server.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/interop/server.py
@@ -28,40 +28,40 @@ logging.basicConfig()
_LOGGER = logging.getLogger(__name__)
-def parse_interop_server_arguments():
+def parse_interop_server_arguments():
parser = argparse.ArgumentParser()
- parser.add_argument('--port',
- type=int,
- required=True,
- help='the port on which to serve')
- parser.add_argument('--use_tls',
- default=False,
- type=resources.parse_bool,
- help='require a secure connection')
- parser.add_argument('--use_alts',
- default=False,
- type=resources.parse_bool,
- help='require an ALTS connection')
- return parser.parse_args()
+ parser.add_argument('--port',
+ type=int,
+ required=True,
+ help='the port on which to serve')
+ parser.add_argument('--use_tls',
+ default=False,
+ type=resources.parse_bool,
+ help='require a secure connection')
+ parser.add_argument('--use_alts',
+ default=False,
+ type=resources.parse_bool,
+ help='require an ALTS connection')
+ return parser.parse_args()
+
+
+def get_server_credentials(use_tls):
+ if use_tls:
+ private_key = resources.private_key()
+ certificate_chain = resources.certificate_chain()
+ return grpc.ssl_server_credentials(((private_key, certificate_chain),))
+ else:
+ return grpc.alts_server_credentials()
+
+
+def serve():
+ args = parse_interop_server_arguments()
-
-def get_server_credentials(use_tls):
- if use_tls:
- private_key = resources.private_key()
- certificate_chain = resources.certificate_chain()
- return grpc.ssl_server_credentials(((private_key, certificate_chain),))
- else:
- return grpc.alts_server_credentials()
-
-
-def serve():
- args = parse_interop_server_arguments()
-
server = test_common.test_server()
test_pb2_grpc.add_TestServiceServicer_to_server(service.TestService(),
server)
- if args.use_tls or args.use_alts:
- credentials = get_server_credentials(args.use_tls)
+ if args.use_tls or args.use_alts:
+ credentials = get_server_credentials(args.use_tls)
server.add_secure_port('[::]:{}'.format(args.port), credentials)
else:
server.add_insecure_port('[::]:{}'.format(args.port))
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/interop/service.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/interop/service.py
index bd2b173209c..08bb0c45a24 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/interop/service.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/interop/service.py
@@ -56,8 +56,8 @@ class TestService(test_pb2_grpc.TestServiceServicer):
_maybe_echo_metadata(context)
_maybe_echo_status_and_message(request, context)
return messages_pb2.SimpleResponse(
- payload=messages_pb2.Payload(type=messages_pb2.COMPRESSABLE,
- body=b'\x00' * request.response_size))
+ payload=messages_pb2.Payload(type=messages_pb2.COMPRESSABLE,
+ body=b'\x00' * request.response_size))
def StreamingOutputCall(self, request, context):
_maybe_echo_status_and_message(request, context)
@@ -65,9 +65,9 @@ class TestService(test_pb2_grpc.TestServiceServicer):
if response_parameters.interval_us != 0:
time.sleep(response_parameters.interval_us / _US_IN_A_SECOND)
yield messages_pb2.StreamingOutputCallResponse(
- payload=messages_pb2.Payload(type=request.response_type,
- body=b'\x00' *
- response_parameters.size))
+ payload=messages_pb2.Payload(type=request.response_type,
+ body=b'\x00' *
+ response_parameters.size))
def StreamingInputCall(self, request_iterator, context):
aggregate_size = 0
@@ -83,12 +83,12 @@ class TestService(test_pb2_grpc.TestServiceServicer):
_maybe_echo_status_and_message(request, context)
for response_parameters in request.response_parameters:
if response_parameters.interval_us != 0:
- time.sleep(response_parameters.interval_us /
- _US_IN_A_SECOND)
+ time.sleep(response_parameters.interval_us /
+ _US_IN_A_SECOND)
yield messages_pb2.StreamingOutputCallResponse(
- payload=messages_pb2.Payload(type=request.payload.type,
- body=b'\x00' *
- response_parameters.size))
+ payload=messages_pb2.Payload(type=request.payload.type,
+ body=b'\x00' *
+ response_parameters.size))
# NOTE(nathaniel): Apparently this is the same as the full-duplex call?
# NOTE(atash): It isn't even called in the interop spec (Oct 22 2015)...
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/qps/benchmark_client.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/qps/benchmark_client.py
index 383077b6308..17835e7c0db 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/qps/benchmark_client.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/qps/benchmark_client.py
@@ -61,16 +61,16 @@ class BenchmarkClient:
self._stub = benchmark_service_pb2_grpc.BenchmarkServiceStub(
channel)
payload = messages_pb2.Payload(
- body=bytes(b'\0' *
- config.payload_config.simple_params.req_size))
+ body=bytes(b'\0' *
+ config.payload_config.simple_params.req_size))
self._request = messages_pb2.SimpleRequest(
payload=payload,
response_size=config.payload_config.simple_params.resp_size)
else:
self._generic = True
self._stub = GenericStub(channel)
- self._request = bytes(b'\0' *
- config.payload_config.bytebuf_params.req_size)
+ self._request = bytes(b'\0' *
+ config.payload_config.bytebuf_params.req_size)
self._hist = hist
self._response_callbacks = []
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/qps/benchmark_server.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/qps/benchmark_server.py
index 174e4f84aec..75280bd7719 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/qps/benchmark_server.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/qps/benchmark_server.py
@@ -20,21 +20,21 @@ class BenchmarkServer(benchmark_service_pb2_grpc.BenchmarkServiceServicer):
"""Synchronous Server implementation for the Benchmark service."""
def UnaryCall(self, request, context):
- payload = messages_pb2.Payload(body=b'\0' * request.response_size)
+ payload = messages_pb2.Payload(body=b'\0' * request.response_size)
return messages_pb2.SimpleResponse(payload=payload)
def StreamingCall(self, request_iterator, context):
for request in request_iterator:
- payload = messages_pb2.Payload(body=b'\0' * request.response_size)
+ payload = messages_pb2.Payload(body=b'\0' * request.response_size)
yield messages_pb2.SimpleResponse(payload=payload)
-class GenericBenchmarkServer(benchmark_service_pb2_grpc.BenchmarkServiceServicer
- ):
+class GenericBenchmarkServer(benchmark_service_pb2_grpc.BenchmarkServiceServicer
+ ):
"""Generic Server implementation for the Benchmark service."""
def __init__(self, resp_size):
- self._response = b'\0' * resp_size
+ self._response = b'\0' * resp_size
def UnaryCall(self, request, context):
return self._response
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/qps/client_runner.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/qps/client_runner.py
index 7d6598c97ee..c5d299f6463 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/qps/client_runner.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/qps/client_runner.py
@@ -45,8 +45,8 @@ class OpenLoopClientRunner(ClientRunner):
super(OpenLoopClientRunner, self).__init__(client)
self._is_running = False
self._interval_generator = interval_generator
- self._dispatch_thread = threading.Thread(target=self._dispatch_requests,
- args=())
+ self._dispatch_thread = threading.Thread(target=self._dispatch_requests,
+ args=())
def start(self):
self._is_running = True
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/qps/histogram.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/qps/histogram.py
index d90dcf4b078..8139a6ee2fb 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/qps/histogram.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/qps/histogram.py
@@ -65,16 +65,16 @@ class Histogram(object):
data.count = self._count
return data
- def merge(self, another_data):
- with self._lock:
- for i in range(len(self._buckets)):
- self._buckets[i] += another_data.bucket[i]
- self._min = min(self._min, another_data.min_seen)
- self._max = max(self._max, another_data.max_seen)
- self._sum += another_data.sum
- self._sum_of_squares += another_data.sum_of_squares
- self._count += another_data.count
-
+ def merge(self, another_data):
+ with self._lock:
+ for i in range(len(self._buckets)):
+ self._buckets[i] += another_data.bucket[i]
+ self._min = min(self._min, another_data.min_seen)
+ self._max = max(self._max, another_data.max_seen)
+ self._sum += another_data.sum
+ self._sum_of_squares += another_data.sum_of_squares
+ self._count += another_data.count
+
def _bucket_for(self, val):
val = min(val, self._max_possible)
return int(math.log(val, self.multiplier))
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/qps/qps_worker.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/qps/qps_worker.py
index b9013d84f39..a7e692821ac 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/qps/qps_worker.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/qps/qps_worker.py
@@ -37,10 +37,10 @@ def run_worker_server(port):
if __name__ == '__main__':
parser = argparse.ArgumentParser(
description='gRPC Python performance testing worker')
- parser.add_argument('--driver_port',
- type=int,
- dest='port',
- help='The port the worker should listen on')
+ parser.add_argument('--driver_port',
+ type=int,
+ dest='port',
+ help='The port the worker should listen on')
args = parser.parse_args()
run_worker_server(args.port)
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/qps/worker_server.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/qps/worker_server.py
index 16ac044d2a7..65b081e5d1c 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/qps/worker_server.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/qps/worker_server.py
@@ -57,9 +57,9 @@ class WorkerServer(worker_service_pb2_grpc.WorkerServiceServicer):
def _get_server_status(self, start_time, end_time, port, cores):
end_time = time.time()
elapsed_time = end_time - start_time
- stats = stats_pb2.ServerStats(time_elapsed=elapsed_time,
- time_user=elapsed_time,
- time_system=elapsed_time)
+ stats = stats_pb2.ServerStats(time_elapsed=elapsed_time,
+ time_user=elapsed_time,
+ time_system=elapsed_time)
return control_pb2.ServerStatus(stats=stats, port=port, cores=cores)
def _create_server(self, config):
@@ -79,10 +79,10 @@ class WorkerServer(worker_service_pb2_grpc.WorkerServiceServicer):
servicer = benchmark_server.GenericBenchmarkServer(resp_size)
method_implementations = {
'StreamingCall':
- grpc.stream_stream_rpc_method_handler(servicer.StreamingCall
- ),
+ grpc.stream_stream_rpc_method_handler(servicer.StreamingCall
+ ),
'UnaryCall':
- grpc.unary_unary_rpc_method_handler(servicer.UnaryCall),
+ grpc.unary_unary_rpc_method_handler(servicer.UnaryCall),
}
handler = grpc.method_handlers_generic_handler(
'grpc.testing.BenchmarkService', method_implementations)
@@ -135,10 +135,10 @@ class WorkerServer(worker_service_pb2_grpc.WorkerServiceServicer):
latencies = qps_data.get_data()
end_time = time.time()
elapsed_time = end_time - start_time
- stats = stats_pb2.ClientStats(latencies=latencies,
- time_elapsed=elapsed_time,
- time_user=elapsed_time,
- time_system=elapsed_time)
+ stats = stats_pb2.ClientStats(latencies=latencies,
+ time_elapsed=elapsed_time,
+ time_user=elapsed_time,
+ time_system=elapsed_time)
return control_pb2.ClientStatus(stats=stats)
def _create_client_runner(self, server, config, qps_data):
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/status/_grpc_status_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/status/_grpc_status_test.py
index 449fbdf95d4..54a3b624203 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/status/_grpc_status_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/status/_grpc_status_test.py
@@ -60,8 +60,8 @@ def _not_ok_unary_unary(request, servicer_context):
def _error_details_unary_unary(request, servicer_context):
details = any_pb2.Any()
details.Pack(
- error_details_pb2.DebugInfo(stack_entries=traceback.format_stack(),
- detail='Intentionally invoked'))
+ error_details_pb2.DebugInfo(stack_entries=traceback.format_stack(),
+ detail='Intentionally invoked'))
rich_status = status_pb2.Status(
code=code_pb2.INTERNAL,
message=_STATUS_DETAILS,
@@ -78,8 +78,8 @@ def _inconsistent_unary_unary(request, servicer_context):
servicer_context.set_code(grpc.StatusCode.NOT_FOUND)
servicer_context.set_details(_STATUS_DETAILS_ANOTHER)
# User put inconsistent status information in trailing metadata
- servicer_context.set_trailing_metadata(
- ((_GRPC_DETAILS_METADATA_KEY, rich_status.SerializeToString()),))
+ servicer_context.set_trailing_metadata(
+ ((_GRPC_DETAILS_METADATA_KEY, rich_status.SerializeToString()),))
def _invalid_code_unary_unary(request, servicer_context):
@@ -151,8 +151,8 @@ class StatusTest(unittest.TestCase):
self.assertEqual(status.code, code_pb2.Code.Value('INTERNAL'))
# Check if the underlying proto message is intact
- self.assertEqual(
- status.details[0].Is(error_details_pb2.DebugInfo.DESCRIPTOR), True)
+ self.assertEqual(
+ status.details[0].Is(error_details_pb2.DebugInfo.DESCRIPTOR), True)
info = error_details_pb2.DebugInfo()
status.details[0].Unpack(info)
self.assertIn('_error_details_unary_unary', info.stack_entries[-1])
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/stress/client.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/stress/client.py
index 0fcaca441e8..01c14ba3e20 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/stress/client.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/stress/client.py
@@ -42,34 +42,34 @@ def _args():
help='comma separated list of testcase:weighting of tests to run',
default='large_unary:100',
type=str)
- parser.add_argument('--test_duration_secs',
- help='number of seconds to run the stress test',
- default=-1,
- type=int)
- parser.add_argument('--num_channels_per_server',
- help='number of channels per server',
- default=1,
- type=int)
- parser.add_argument('--num_stubs_per_channel',
- help='number of stubs to create per channel',
- default=1,
- type=int)
- parser.add_argument('--metrics_port',
- help='the port to listen for metrics requests on',
- default=8081,
- type=int)
+ parser.add_argument('--test_duration_secs',
+ help='number of seconds to run the stress test',
+ default=-1,
+ type=int)
+ parser.add_argument('--num_channels_per_server',
+ help='number of channels per server',
+ default=1,
+ type=int)
+ parser.add_argument('--num_stubs_per_channel',
+ help='number of stubs to create per channel',
+ default=1,
+ type=int)
+ parser.add_argument('--metrics_port',
+ help='the port to listen for metrics requests on',
+ default=8081,
+ type=int)
parser.add_argument(
'--use_test_ca',
help='Whether to use our fake CA. Requires --use_tls=true',
default=False,
type=bool)
- parser.add_argument('--use_tls',
- help='Whether to use TLS',
- default=False,
- type=bool)
- parser.add_argument('--server_host_override',
- help='the server host to which to claim to connect',
- type=str)
+ parser.add_argument('--use_tls',
+ help='Whether to use TLS',
+ default=False,
+ type=bool)
+ parser.add_argument('--server_host_override',
+ help='the server host to which to claim to connect',
+ type=str)
return parser.parse_args()
@@ -102,9 +102,9 @@ def _get_channel(target, args):
'grpc.ssl_target_name_override',
args.server_host_override,
),)
- channel = grpc.secure_channel(target,
- channel_credentials,
- options=options)
+ channel = grpc.secure_channel(target,
+ channel_credentials,
+ options=options)
else:
channel = grpc.insecure_channel(target)
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/stress/test_runner.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/stress/test_runner.py
index 001538ecbf6..1b6003fc698 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/stress/test_runner.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/stress/test_runner.py
@@ -53,6 +53,6 @@ class TestRunner(threading.Thread):
except Exception as e: # pylint: disable=broad-except
traceback.print_exc()
self._exception_queue.put(
- Exception(
- "An exception occurred during test {}".format(
- test_case), e))
+ Exception(
+ "An exception occurred during test {}".format(
+ test_case), e))
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/stress/unary_stream_benchmark.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/stress/unary_stream_benchmark.py
index 2130df5e428..cd872ece29d 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/stress/unary_stream_benchmark.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/stress/unary_stream_benchmark.py
@@ -60,9 +60,9 @@ try:
@contextlib.contextmanager
def _running_server():
- server_process = subprocess.Popen([sys.executable, '-c', _SERVER_CODE],
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE)
+ server_process = subprocess.Popen([sys.executable, '-c', _SERVER_CODE],
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE)
try:
yield
finally:
@@ -76,8 +76,8 @@ try:
def profile(message_size, response_count):
request = unary_stream_benchmark_pb2.BenchmarkRequest(
message_size=message_size, response_count=response_count)
- with grpc.insecure_channel('[::]:{}'.format(_PORT),
- options=_GRPC_CHANNEL_OPTIONS) as channel:
+ with grpc.insecure_channel('[::]:{}'.format(_PORT),
+ options=_GRPC_CHANNEL_OPTIONS) as channel:
stub = unary_stream_benchmark_pb2_grpc.UnaryStreamBenchmarkServiceStub(
channel)
start = datetime.datetime.now()
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/testing/_client_application.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/testing/_client_application.py
index ef4c1e985d6..57fa5109139 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/testing/_client_application.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/testing/_client_application.py
@@ -150,8 +150,8 @@ def _run_stream_stream(stub):
def _run_concurrent_stream_unary(stub):
future_calls = tuple(
- stub.StreUn.future(iter((_application_common.STREAM_UNARY_REQUEST,) *
- 3))
+ stub.StreUn.future(iter((_application_common.STREAM_UNARY_REQUEST,) *
+ 3))
for _ in range(test_constants.THREAD_CONCURRENCY))
for future_call in future_calls:
if future_call.code() is grpc.StatusCode.OK:
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/testing/_time_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/testing/_time_test.py
index be62422b9f4..cab665c045c 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/testing/_time_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/testing/_time_test.py
@@ -115,8 +115,8 @@ class TimeTest(object):
self._time.sleep_for(_QUANTUM * 3)
for test_event in test_events:
- (self.assertFalse if test_event in cancelled else self.assertTrue)(
- test_event.is_set())
+ (self.assertFalse if test_event in cancelled else self.assertTrue)(
+ test_event.is_set())
for background_noise_future in background_noise_futures:
background_noise_future.cancel()
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_abort_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_abort_test.py
index 5acd9d3eb14..d2eaf97d5f4 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_abort_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_abort_test.py
@@ -36,9 +36,9 @@ _ABORT_METADATA = (('a-trailing-metadata', '42'),)
class _Status(
- collections.namedtuple('_Status',
- ('code', 'details', 'trailing_metadata')),
- grpc.Status):
+ collections.namedtuple('_Status',
+ ('code', 'details', 'trailing_metadata')),
+ grpc.Status):
pass
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_api_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_api_test.py
index 5aac7877ecf..a459ee6e192 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_api_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_api_test.py
@@ -63,8 +63,8 @@ class AllTest(unittest.TestCase):
'LocalConnectionType',
'local_channel_credentials',
'local_server_credentials',
- 'alts_channel_credentials',
- 'alts_server_credentials',
+ 'alts_channel_credentials',
+ 'alts_server_credentials',
'unary_unary_rpc_method_handler',
'unary_stream_rpc_method_handler',
'stream_unary_rpc_method_handler',
@@ -84,9 +84,9 @@ class AllTest(unittest.TestCase):
'secure_channel',
'intercept_channel',
'server',
- 'protos',
- 'services',
- 'protos_and_services',
+ 'protos',
+ 'services',
+ 'protos_and_services',
)
six.assertCountEqual(self, expected_grpc_code_elements,
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_auth_context_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_auth_context_test.py
index 9d76fc757fd..817c528237b 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_auth_context_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_auth_context_test.py
@@ -64,7 +64,7 @@ class AuthContextTest(unittest.TestCase):
def testInsecure(self):
handler = grpc.method_handlers_generic_handler('test', {
'UnaryUnary':
- grpc.unary_unary_rpc_method_handler(handle_unary_unary)
+ grpc.unary_unary_rpc_method_handler(handle_unary_unary)
})
server = test_common.test_server()
server.add_generic_rpc_handlers((handler,))
@@ -83,7 +83,7 @@ class AuthContextTest(unittest.TestCase):
def testSecureNoCert(self):
handler = grpc.method_handlers_generic_handler('test', {
'UnaryUnary':
- grpc.unary_unary_rpc_method_handler(handle_unary_unary)
+ grpc.unary_unary_rpc_method_handler(handle_unary_unary)
})
server = test_common.test_server()
server.add_generic_rpc_handlers((handler,))
@@ -93,9 +93,9 @@ class AuthContextTest(unittest.TestCase):
channel_creds = grpc.ssl_channel_credentials(
root_certificates=_TEST_ROOT_CERTIFICATES)
- channel = grpc.secure_channel('localhost:{}'.format(port),
- channel_creds,
- options=_PROPERTY_OPTIONS)
+ channel = grpc.secure_channel('localhost:{}'.format(port),
+ channel_creds,
+ options=_PROPERTY_OPTIONS)
response = channel.unary_unary(_UNARY_UNARY)(_REQUEST)
channel.close()
server.stop(None)
@@ -103,17 +103,17 @@ class AuthContextTest(unittest.TestCase):
auth_data = pickle.loads(response)
self.assertIsNone(auth_data[_ID])
self.assertIsNone(auth_data[_ID_KEY])
- self.assertDictEqual(
- {
- 'security_level': [b'TSI_PRIVACY_AND_INTEGRITY'],
- 'transport_security_type': [b'ssl'],
- 'ssl_session_reused': [b'false'],
- }, auth_data[_AUTH_CTX])
+ self.assertDictEqual(
+ {
+ 'security_level': [b'TSI_PRIVACY_AND_INTEGRITY'],
+ 'transport_security_type': [b'ssl'],
+ 'ssl_session_reused': [b'false'],
+ }, auth_data[_AUTH_CTX])
def testSecureClientCert(self):
handler = grpc.method_handlers_generic_handler('test', {
'UnaryUnary':
- grpc.unary_unary_rpc_method_handler(handle_unary_unary)
+ grpc.unary_unary_rpc_method_handler(handle_unary_unary)
})
server = test_common.test_server()
server.add_generic_rpc_handlers((handler,))
@@ -128,9 +128,9 @@ class AuthContextTest(unittest.TestCase):
root_certificates=_TEST_ROOT_CERTIFICATES,
private_key=_PRIVATE_KEY,
certificate_chain=_CERTIFICATE_CHAIN)
- channel = grpc.secure_channel('localhost:{}'.format(port),
- channel_creds,
- options=_PROPERTY_OPTIONS)
+ channel = grpc.secure_channel('localhost:{}'.format(port),
+ channel_creds,
+ options=_PROPERTY_OPTIONS)
response = channel.unary_unary(_UNARY_UNARY)(_REQUEST)
channel.close()
@@ -146,9 +146,9 @@ class AuthContextTest(unittest.TestCase):
def _do_one_shot_client_rpc(self, channel_creds, channel_options, port,
expect_ssl_session_reused):
- channel = grpc.secure_channel('localhost:{}'.format(port),
- channel_creds,
- options=channel_options)
+ channel = grpc.secure_channel('localhost:{}'.format(port),
+ channel_creds,
+ options=channel_options)
response = channel.unary_unary(_UNARY_UNARY)(_REQUEST)
auth_data = pickle.loads(response)
self.assertEqual(expect_ssl_session_reused,
@@ -159,7 +159,7 @@ class AuthContextTest(unittest.TestCase):
# Set up a secure server
handler = grpc.method_handlers_generic_handler('test', {
'UnaryUnary':
- grpc.unary_unary_rpc_method_handler(handle_unary_unary)
+ grpc.unary_unary_rpc_method_handler(handle_unary_unary)
})
server = test_common.test_server()
server.add_generic_rpc_handlers((handler,))
@@ -175,16 +175,16 @@ class AuthContextTest(unittest.TestCase):
('grpc.ssl_session_cache', cache),)
# Initial connection has no session to resume
- self._do_one_shot_client_rpc(channel_creds,
- channel_options,
- port,
- expect_ssl_session_reused=[b'false'])
+ self._do_one_shot_client_rpc(channel_creds,
+ channel_options,
+ port,
+ expect_ssl_session_reused=[b'false'])
# Subsequent connections resume sessions
- self._do_one_shot_client_rpc(channel_creds,
- channel_options,
- port,
- expect_ssl_session_reused=[b'true'])
+ self._do_one_shot_client_rpc(channel_creds,
+ channel_options,
+ port,
+ expect_ssl_session_reused=[b'true'])
server.stop(None)
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_channel_args_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_channel_args_test.py
index bb2a7400df7..2f2eea61dbd 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_channel_args_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_channel_args_test.py
@@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-"""Tests of channel arguments on client/server side."""
+"""Tests of channel arguments on client/server side."""
from concurrent import futures
import unittest
@@ -49,15 +49,15 @@ class ChannelArgsTest(unittest.TestCase):
grpc.insecure_channel('localhost:8080', options=TEST_CHANNEL_ARGS)
def test_server(self):
- grpc.server(futures.ThreadPoolExecutor(max_workers=1),
- options=TEST_CHANNEL_ARGS)
+ grpc.server(futures.ThreadPoolExecutor(max_workers=1),
+ options=TEST_CHANNEL_ARGS)
def test_invalid_client_args(self):
for invalid_arg in INVALID_TEST_CHANNEL_ARGS:
- self.assertRaises(ValueError,
- grpc.insecure_channel,
- 'localhost:8080',
- options=invalid_arg)
+ self.assertRaises(ValueError,
+ grpc.insecure_channel,
+ 'localhost:8080',
+ options=invalid_arg)
if __name__ == '__main__':
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_channel_connectivity_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_channel_connectivity_test.py
index 76cd275aa15..d1b4c3c932f 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_channel_connectivity_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_channel_connectivity_test.py
@@ -87,8 +87,8 @@ class ChannelConnectivityTest(unittest.TestCase):
def test_immediately_connectable_channel_connectivity(self):
recording_thread_pool = thread_pool.RecordingThreadPool(
max_workers=None)
- server = grpc.server(recording_thread_pool,
- options=(('grpc.so_reuseport', 0),))
+ server = grpc.server(recording_thread_pool,
+ options=(('grpc.so_reuseport', 0),))
port = server.add_insecure_port('[::]:0')
server.start()
first_callback = _Callback()
@@ -132,8 +132,8 @@ class ChannelConnectivityTest(unittest.TestCase):
def test_reachable_then_unreachable_channel_connectivity(self):
recording_thread_pool = thread_pool.RecordingThreadPool(
max_workers=None)
- server = grpc.server(recording_thread_pool,
- options=(('grpc.so_reuseport', 0),))
+ server = grpc.server(recording_thread_pool,
+ options=(('grpc.so_reuseport', 0),))
port = server.add_insecure_port('[::]:0')
server.start()
callback = _Callback()
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_channel_ready_future_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_channel_ready_future_test.py
index 2c367d98524..ca9ebc16fe9 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_channel_ready_future_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_channel_ready_future_test.py
@@ -65,8 +65,8 @@ class ChannelReadyFutureTest(unittest.TestCase):
def test_immediately_connectable_channel_connectivity(self):
recording_thread_pool = thread_pool.RecordingThreadPool(
max_workers=None)
- server = grpc.server(recording_thread_pool,
- options=(('grpc.so_reuseport', 0),))
+ server = grpc.server(recording_thread_pool,
+ options=(('grpc.so_reuseport', 0),))
port = server.add_insecure_port('[::]:0')
server.start()
channel = grpc.insecure_channel('localhost:{}'.format(port))
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_compression_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_compression_test.py
index c04cdb497e3..bc58e1032ca 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_compression_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_compression_test.py
@@ -214,8 +214,8 @@ def _get_compression_ratios(client_function, first_channel_kwargs,
second_bytes_sent, second_bytes_received = _get_byte_counts(
second_channel_kwargs, second_multicallable_kwargs, client_function,
second_server_kwargs, second_server_handler, message)
- return ((second_bytes_sent - first_bytes_sent) /
- float(first_bytes_sent),
+ return ((second_bytes_sent - first_bytes_sent) /
+ float(first_bytes_sent),
(second_bytes_received - first_bytes_received) /
float(first_bytes_received))
finally:
@@ -274,11 +274,11 @@ class CompressionTest(unittest.TestCase):
-1.0 * _COMPRESSION_RATIO_THRESHOLD,
msg='Actual compession ratio: {}'.format(compression_ratio))
- def assertConfigurationCompressed(self, client_streaming, server_streaming,
- channel_compression,
- multicallable_compression,
- server_compression,
- server_call_compression):
+ def assertConfigurationCompressed(self, client_streaming, server_streaming,
+ channel_compression,
+ multicallable_compression,
+ server_compression,
+ server_call_compression):
client_side_compressed = channel_compression or multicallable_compression
server_side_compressed = server_compression or server_call_compression
channel_kwargs = {
@@ -354,10 +354,10 @@ def _get_compression_test_name(client_streaming, server_streaming,
server_compression_str = _get_compression_str('Server', server_compression)
server_call_compression_str = _get_compression_str('ServerCall',
server_call_compression)
- return 'test{}{}{}{}{}'.format(arity, channel_compression_str,
- multicallable_compression_str,
- server_compression_str,
- server_call_compression_str)
+ return 'test{}{}{}{}{}'.format(arity, channel_compression_str,
+ multicallable_compression_str,
+ server_compression_str,
+ server_call_compression_str)
def _test_options():
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_contextvars_propagation_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_contextvars_propagation_test.py
index 50b512b5251..fec0fbd7df4 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_contextvars_propagation_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_contextvars_propagation_test.py
@@ -1,118 +1,118 @@
-# Copyright 2020 The gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-"""Test of propagation of contextvars to AuthMetadataPlugin threads.."""
-
-import contextlib
-import logging
-import os
-import sys
-import unittest
-
-import grpc
-
-from tests.unit import test_common
-
-_UNARY_UNARY = "/test/UnaryUnary"
-_REQUEST = b"0000"
-
-
-def _unary_unary_handler(request, context):
- return request
-
-
-def contextvars_supported():
- try:
- import contextvars
- return True
- except ImportError:
- return False
-
-
-class _GenericHandler(grpc.GenericRpcHandler):
-
- def service(self, handler_call_details):
- if handler_call_details.method == _UNARY_UNARY:
- return grpc.unary_unary_rpc_method_handler(_unary_unary_handler)
- else:
- raise NotImplementedError()
-
-
-def _server():
- try:
- server = test_common.test_server()
- target = 'localhost:0'
- port = server.add_insecure_port(target)
- server.add_generic_rpc_handlers((_GenericHandler(),))
- server.start()
- yield port
- finally:
- server.stop(None)
-
-
-if contextvars_supported():
- import contextvars
-
- _EXPECTED_VALUE = 24601
- test_var = contextvars.ContextVar("test_var", default=None)
-
- def set_up_expected_context():
- test_var.set(_EXPECTED_VALUE)
-
- class TestCallCredentials(grpc.AuthMetadataPlugin):
-
- def __call__(self, context, callback):
- if test_var.get() != _EXPECTED_VALUE:
- raise AssertionError("{} != {}".format(test_var.get(),
- _EXPECTED_VALUE))
- callback((), None)
-
- def assert_called(self, test):
- test.assertTrue(self._invoked)
- test.assertEqual(_EXPECTED_VALUE, self._recorded_value)
-
-else:
-
- def set_up_expected_context():
- pass
-
- class TestCallCredentials(grpc.AuthMetadataPlugin):
-
- def __call__(self, context, callback):
- callback((), None)
-
-
-# TODO(https://github.com/grpc/grpc/issues/22257)
[email protected](os.name == "nt", "LocalCredentials not supported on Windows.")
-class ContextVarsPropagationTest(unittest.TestCase):
-
- def test_propagation_to_auth_plugin(self):
- set_up_expected_context()
- with _server() as port:
- target = "localhost:{}".format(port)
- local_credentials = grpc.local_channel_credentials()
- test_call_credentials = TestCallCredentials()
- call_credentials = grpc.metadata_call_credentials(
- test_call_credentials, "test call credentials")
- composite_credentials = grpc.composite_channel_credentials(
- local_credentials, call_credentials)
- with grpc.secure_channel(target, composite_credentials) as channel:
- stub = channel.unary_unary(_UNARY_UNARY)
- response = stub(_REQUEST, wait_for_ready=True)
- self.assertEqual(_REQUEST, response)
-
-
-if __name__ == '__main__':
- logging.basicConfig()
- unittest.main(verbosity=2)
+# Copyright 2020 The gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+"""Test of propagation of contextvars to AuthMetadataPlugin threads.."""
+
+import contextlib
+import logging
+import os
+import sys
+import unittest
+
+import grpc
+
+from tests.unit import test_common
+
+_UNARY_UNARY = "/test/UnaryUnary"
+_REQUEST = b"0000"
+
+
+def _unary_unary_handler(request, context):
+ return request
+
+
+def contextvars_supported():
+ try:
+ import contextvars
+ return True
+ except ImportError:
+ return False
+
+
+class _GenericHandler(grpc.GenericRpcHandler):
+
+ def service(self, handler_call_details):
+ if handler_call_details.method == _UNARY_UNARY:
+ return grpc.unary_unary_rpc_method_handler(_unary_unary_handler)
+ else:
+ raise NotImplementedError()
+
+
+def _server():
+ try:
+ server = test_common.test_server()
+ target = 'localhost:0'
+ port = server.add_insecure_port(target)
+ server.add_generic_rpc_handlers((_GenericHandler(),))
+ server.start()
+ yield port
+ finally:
+ server.stop(None)
+
+
+if contextvars_supported():
+ import contextvars
+
+ _EXPECTED_VALUE = 24601
+ test_var = contextvars.ContextVar("test_var", default=None)
+
+ def set_up_expected_context():
+ test_var.set(_EXPECTED_VALUE)
+
+ class TestCallCredentials(grpc.AuthMetadataPlugin):
+
+ def __call__(self, context, callback):
+ if test_var.get() != _EXPECTED_VALUE:
+ raise AssertionError("{} != {}".format(test_var.get(),
+ _EXPECTED_VALUE))
+ callback((), None)
+
+ def assert_called(self, test):
+ test.assertTrue(self._invoked)
+ test.assertEqual(_EXPECTED_VALUE, self._recorded_value)
+
+else:
+
+ def set_up_expected_context():
+ pass
+
+ class TestCallCredentials(grpc.AuthMetadataPlugin):
+
+ def __call__(self, context, callback):
+ callback((), None)
+
+
+# TODO(https://github.com/grpc/grpc/issues/22257)
[email protected](os.name == "nt", "LocalCredentials not supported on Windows.")
+class ContextVarsPropagationTest(unittest.TestCase):
+
+ def test_propagation_to_auth_plugin(self):
+ set_up_expected_context()
+ with _server() as port:
+ target = "localhost:{}".format(port)
+ local_credentials = grpc.local_channel_credentials()
+ test_call_credentials = TestCallCredentials()
+ call_credentials = grpc.metadata_call_credentials(
+ test_call_credentials, "test call credentials")
+ composite_credentials = grpc.composite_channel_credentials(
+ local_credentials, call_credentials)
+ with grpc.secure_channel(target, composite_credentials) as channel:
+ stub = channel.unary_unary(_UNARY_UNARY)
+ response = stub(_REQUEST, wait_for_ready=True)
+ self.assertEqual(_REQUEST, response)
+
+
+if __name__ == '__main__':
+ logging.basicConfig()
+ unittest.main(verbosity=2)
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_cython/_cancel_many_calls_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_cython/_cancel_many_calls_test.py
index 2c67e679fa6..b279f3d07c5 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_cython/_cancel_many_calls_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_cython/_cancel_many_calls_test.py
@@ -193,8 +193,8 @@ class CancelManyCallsTest(unittest.TestCase):
client_due.add(tag)
client_calls.append(client_call)
- client_events_future = test_utilities.SimpleFuture(lambda: tuple(
- channel.next_call_event() for _ in range(_SUCCESSFUL_CALLS)))
+ client_events_future = test_utilities.SimpleFuture(lambda: tuple(
+ channel.next_call_event() for _ in range(_SUCCESSFUL_CALLS)))
with state.condition:
while True:
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_cython/_no_messages_server_completion_queue_per_call_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_cython/_no_messages_server_completion_queue_per_call_test.py
index 54405483b2c..144a2fcae3f 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_cython/_no_messages_server_completion_queue_per_call_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_cython/_no_messages_server_completion_queue_per_call_test.py
@@ -59,10 +59,10 @@ class Test(_common.RpcTest, unittest.TestCase):
cygrpc.ReceiveStatusOnClientOperation(_common.EMPTY_FLAGS),
], client_complete_rpc_tag)
- client_events_future = test_utilities.SimpleFuture(lambda: [
- self.channel.next_call_event(),
- self.channel.next_call_event(),
- ])
+ client_events_future = test_utilities.SimpleFuture(lambda: [
+ self.channel.next_call_event(),
+ self.channel.next_call_event(),
+ ])
server_request_call_event = self.server_driver.event_with_tag(
server_request_call_tag)
@@ -122,8 +122,8 @@ class Test(_common.RpcTest, unittest.TestCase):
)
def test_rpcs(self):
- expecteds = [(_common.SUCCESSFUL_OPERATION_RESULT,) * 5
- ] * _common.RPC_COUNT
+ expecteds = [(_common.SUCCESSFUL_OPERATION_RESULT,) * 5
+ ] * _common.RPC_COUNT
actuallys = _common.execute_many_times(self._do_rpcs)
self.assertSequenceEqual(expecteds, actuallys)
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_cython/_no_messages_single_server_completion_queue_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_cython/_no_messages_single_server_completion_queue_test.py
index 12d99e489fc..38964768db7 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_cython/_no_messages_single_server_completion_queue_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_cython/_no_messages_single_server_completion_queue_test.py
@@ -58,10 +58,10 @@ class Test(_common.RpcTest, unittest.TestCase):
cygrpc.ReceiveInitialMetadataOperation(_common.EMPTY_FLAGS),
], client_receive_initial_metadata_tag)
- client_events_future = test_utilities.SimpleFuture(lambda: [
- self.channel.next_call_event(),
- self.channel.next_call_event(),
- ])
+ client_events_future = test_utilities.SimpleFuture(lambda: [
+ self.channel.next_call_event(),
+ self.channel.next_call_event(),
+ ])
server_request_call_event = self.server_driver.event_with_tag(
server_request_call_tag)
@@ -116,8 +116,8 @@ class Test(_common.RpcTest, unittest.TestCase):
)
def test_rpcs(self):
- expecteds = [(_common.SUCCESSFUL_OPERATION_RESULT,) * 5
- ] * _common.RPC_COUNT
+ expecteds = [(_common.SUCCESSFUL_OPERATION_RESULT,) * 5
+ ] * _common.RPC_COUNT
actuallys = _common.execute_many_times(self._do_rpcs)
self.assertSequenceEqual(expecteds, actuallys)
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_cython/cygrpc_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_cython/cygrpc_test.py
index f1c2d636a3c..1182f83a425 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_cython/cygrpc_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_cython/cygrpc_test.py
@@ -116,12 +116,12 @@ class ServerClientMixin(object):
cygrpc.ChannelArgKey.ssl_target_name_override,
host_override,
),)
- self.client_channel = cygrpc.Channel(
- 'localhost:{}'.format(self.port).encode(),
- client_channel_arguments, client_credentials)
+ self.client_channel = cygrpc.Channel(
+ 'localhost:{}'.format(self.port).encode(),
+ client_channel_arguments, client_credentials)
else:
- self.client_channel = cygrpc.Channel(
- 'localhost:{}'.format(self.port).encode(), set(), None)
+ self.client_channel = cygrpc.Channel(
+ 'localhost:{}'.format(self.port).encode(), set(), None)
if host_override:
self.host_argument = None # default host
self.expected_host = host_override
@@ -227,8 +227,8 @@ class ServerClientMixin(object):
request_event.invocation_metadata))
self.assertEqual(METHOD, request_event.call_details.method)
self.assertEqual(self.expected_host, request_event.call_details.host)
- self.assertLess(abs(DEADLINE - request_event.call_details.deadline),
- DEADLINE_TOLERANCE)
+ self.assertLess(abs(DEADLINE - request_event.call_details.deadline),
+ DEADLINE_TOLERANCE)
server_call_tag = object()
server_call = request_event.call
@@ -322,21 +322,21 @@ class ServerClientMixin(object):
self.server_completion_queue,
server_request_tag)
client_call = self.client_channel.segregated_call(
- 0, METHOD, self.host_argument, DEADLINE, None, None,
- ([(
+ 0, METHOD, self.host_argument, DEADLINE, None, None,
+ ([(
[
cygrpc.SendInitialMetadataOperation(empty_metadata,
_EMPTY_FLAGS),
cygrpc.ReceiveInitialMetadataOperation(_EMPTY_FLAGS),
],
object(),
- ),
- (
- [
- cygrpc.ReceiveStatusOnClientOperation(_EMPTY_FLAGS),
- ],
- object(),
- )]))
+ ),
+ (
+ [
+ cygrpc.ReceiveStatusOnClientOperation(_EMPTY_FLAGS),
+ ],
+ object(),
+ )]))
client_initial_metadata_event_future = test_utilities.SimpleFuture(
client_call.next_event)
@@ -377,10 +377,10 @@ class ServerClientMixin(object):
cygrpc.SendCloseFromClientOperation(_EMPTY_FLAGS),
], "Client epilogue")
# One for ReceiveStatusOnClient, one for SendCloseFromClient.
- client_events_future = test_utilities.SimpleFuture(lambda: {
- client_call.next_event(),
- client_call.next_event(),
- })
+ client_events_future = test_utilities.SimpleFuture(lambda: {
+ client_call.next_event(),
+ client_call.next_event(),
+ })
server_event_future = perform_server_operations([
cygrpc.ReceiveCloseOnServerOperation(_EMPTY_FLAGS),
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_dns_resolver_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_dns_resolver_test.py
index 99d97872507..43141255f1c 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_dns_resolver_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_dns_resolver_test.py
@@ -49,8 +49,8 @@ class DNSResolverTest(unittest.TestCase):
# NOTE(https://github.com/grpc/grpc/issues/18422)
# In short, Gevent + C-Ares = Segfault. The C-Ares driver is not
# supported by custom io manager like "gevent" or "libuv".
- with grpc.insecure_channel('loopback4.unittest.grpc.io:%d' %
- self._port) as channel:
+ with grpc.insecure_channel('loopback4.unittest.grpc.io:%d' %
+ self._port) as channel:
self.assertEqual(
channel.unary_unary(_METHOD)(
_REQUEST,
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_dynamic_stubs_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_dynamic_stubs_test.py
index 8b512654b2c..d2d8ce9f60b 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_dynamic_stubs_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_dynamic_stubs_test.py
@@ -1,119 +1,119 @@
-# Copyright 2019 The gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-"""Test of dynamic stub import API."""
-
-import contextlib
-import functools
-import logging
-import multiprocessing
-import os
-import sys
-import unittest
-
-
-def _grpc_tools_unimportable():
- original_sys_path = sys.path
- sys.path = [path for path in sys.path if "grpcio_tools" not in path]
- try:
- import grpc_tools
- except ImportError:
- pass
- else:
- del grpc_tools
- sys.path = original_sys_path
- raise unittest.SkipTest("Failed to make grpc_tools unimportable.")
- try:
- yield
- finally:
- sys.path = original_sys_path
-
-
-def _collect_errors(fn):
-
- @functools.wraps(fn)
- def _wrapped(error_queue):
- try:
- fn()
- except Exception as e:
- error_queue.put(e)
- raise
-
- return _wrapped
-
-
-def _run_in_subprocess(test_case):
- sys.path.insert(
- 0, os.path.join(os.path.realpath(os.path.dirname(__file__)), ".."))
- error_queue = multiprocessing.Queue()
- proc = multiprocessing.Process(target=test_case, args=(error_queue,))
- proc.start()
- proc.join()
- sys.path.pop(0)
- if not error_queue.empty():
- raise error_queue.get()
- assert proc.exitcode == 0, "Process exited with code {}".format(
- proc.exitcode)
-
-
-def _assert_unimplemented(msg_substr):
- import grpc
- try:
- protos, services = grpc.protos_and_services(
- "tests/unit/data/foo/bar.proto")
- except NotImplementedError as e:
- assert msg_substr in str(e), "{} was not in '{}'".format(
- msg_substr, str(e))
- else:
- assert False, "Did not raise NotImplementedError"
-
-
-@_collect_errors
-def _test_sunny_day():
- if sys.version_info[0] == 3:
- import grpc
- protos, services = grpc.protos_and_services(
- os.path.join("tests", "unit", "data", "foo", "bar.proto"))
- assert protos.BarMessage is not None
- assert services.BarStub is not None
- else:
- _assert_unimplemented("Python 3")
-
-
-@_collect_errors
-def _test_grpc_tools_unimportable():
- with _grpc_tools_unimportable():
- if sys.version_info[0] == 3:
- _assert_unimplemented("grpcio-tools")
- else:
- _assert_unimplemented("Python 3")
-
-
-# NOTE(rbellevi): multiprocessing.Process fails to pickle function objects
-# when they do not come from the "__main__" module, so this test passes
-# if run directly on Windows, but not if started by the test runner.
[email protected](os.name == "nt", "Windows multiprocessing unsupported")
-class DynamicStubTest(unittest.TestCase):
-
- @unittest.skip('grpcio-tools package required')
- def test_sunny_day(self):
- _run_in_subprocess(_test_sunny_day)
-
- def test_grpc_tools_unimportable(self):
- _run_in_subprocess(_test_grpc_tools_unimportable)
-
-
-if __name__ == "__main__":
- logging.basicConfig()
- unittest.main(verbosity=2)
+# Copyright 2019 The gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+"""Test of dynamic stub import API."""
+
+import contextlib
+import functools
+import logging
+import multiprocessing
+import os
+import sys
+import unittest
+
+
+def _grpc_tools_unimportable():
+ original_sys_path = sys.path
+ sys.path = [path for path in sys.path if "grpcio_tools" not in path]
+ try:
+ import grpc_tools
+ except ImportError:
+ pass
+ else:
+ del grpc_tools
+ sys.path = original_sys_path
+ raise unittest.SkipTest("Failed to make grpc_tools unimportable.")
+ try:
+ yield
+ finally:
+ sys.path = original_sys_path
+
+
+def _collect_errors(fn):
+
+ @functools.wraps(fn)
+ def _wrapped(error_queue):
+ try:
+ fn()
+ except Exception as e:
+ error_queue.put(e)
+ raise
+
+ return _wrapped
+
+
+def _run_in_subprocess(test_case):
+ sys.path.insert(
+ 0, os.path.join(os.path.realpath(os.path.dirname(__file__)), ".."))
+ error_queue = multiprocessing.Queue()
+ proc = multiprocessing.Process(target=test_case, args=(error_queue,))
+ proc.start()
+ proc.join()
+ sys.path.pop(0)
+ if not error_queue.empty():
+ raise error_queue.get()
+ assert proc.exitcode == 0, "Process exited with code {}".format(
+ proc.exitcode)
+
+
+def _assert_unimplemented(msg_substr):
+ import grpc
+ try:
+ protos, services = grpc.protos_and_services(
+ "tests/unit/data/foo/bar.proto")
+ except NotImplementedError as e:
+ assert msg_substr in str(e), "{} was not in '{}'".format(
+ msg_substr, str(e))
+ else:
+ assert False, "Did not raise NotImplementedError"
+
+
+@_collect_errors
+def _test_sunny_day():
+ if sys.version_info[0] == 3:
+ import grpc
+ protos, services = grpc.protos_and_services(
+ os.path.join("tests", "unit", "data", "foo", "bar.proto"))
+ assert protos.BarMessage is not None
+ assert services.BarStub is not None
+ else:
+ _assert_unimplemented("Python 3")
+
+
+@_collect_errors
+def _test_grpc_tools_unimportable():
+ with _grpc_tools_unimportable():
+ if sys.version_info[0] == 3:
+ _assert_unimplemented("grpcio-tools")
+ else:
+ _assert_unimplemented("Python 3")
+
+
+# NOTE(rbellevi): multiprocessing.Process fails to pickle function objects
+# when they do not come from the "__main__" module, so this test passes
+# if run directly on Windows, but not if started by the test runner.
[email protected](os.name == "nt", "Windows multiprocessing unsupported")
+class DynamicStubTest(unittest.TestCase):
+
+ @unittest.skip('grpcio-tools package required')
+ def test_sunny_day(self):
+ _run_in_subprocess(_test_sunny_day)
+
+ def test_grpc_tools_unimportable(self):
+ _run_in_subprocess(_test_grpc_tools_unimportable)
+
+
+if __name__ == "__main__":
+ logging.basicConfig()
+ unittest.main(verbosity=2)
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_error_message_encoding_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_error_message_encoding_test.py
index 43ba5f47451..e58007ad3ed 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_error_message_encoding_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_error_message_encoding_test.py
@@ -63,8 +63,8 @@ class ErrorMessageEncodingTest(unittest.TestCase):
def setUp(self):
self._server = test_common.test_server()
- self._server.add_generic_rpc_handlers(
- (_GenericHandler(weakref.proxy(self)),))
+ self._server.add_generic_rpc_handlers(
+ (_GenericHandler(weakref.proxy(self)),))
port = self._server.add_insecure_port('[::]:0')
self._server.start()
self._channel = grpc.insecure_channel('localhost:%d' % port)
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_exit_scenarios.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_exit_scenarios.py
index fe870b5a976..48ea054d2d7 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_exit_scenarios.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_exit_scenarios.py
@@ -165,9 +165,9 @@ if __name__ == '__main__':
logging.basicConfig()
parser = argparse.ArgumentParser()
parser.add_argument('scenario', type=str)
- parser.add_argument('--wait_for_interrupt',
- dest='wait_for_interrupt',
- action='store_true')
+ parser.add_argument('--wait_for_interrupt',
+ dest='wait_for_interrupt',
+ action='store_true')
args = parser.parse_args()
if args.scenario == UNSTARTED_SERVER:
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_exit_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_exit_test.py
index 66e5196ff18..4cf5ab63bdf 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_exit_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_exit_test.py
@@ -24,7 +24,7 @@ import six
import subprocess
import sys
import threading
-import datetime
+import datetime
import time
import unittest
import logging
@@ -32,15 +32,15 @@ import logging
from tests.unit import _exit_scenarios
# SCENARIO_FILE = os.path.abspath(
-# os.path.join(os.path.dirname(os.path.realpath(__file__)),
-# '_exit_scenarios.py'))
+# os.path.join(os.path.dirname(os.path.realpath(__file__)),
+# '_exit_scenarios.py'))
INTERPRETER = sys.executable
BASE_COMMAND = [INTERPRETER, '-m', 'tests.unit._exit_scenarios']
BASE_SIGTERM_COMMAND = BASE_COMMAND + ['--wait_for_interrupt']
-INIT_TIME = datetime.timedelta(seconds=1)
-WAIT_CHECK_INTERVAL = datetime.timedelta(milliseconds=100)
-WAIT_CHECK_DEFAULT_TIMEOUT = datetime.timedelta(seconds=5)
+INIT_TIME = datetime.timedelta(seconds=1)
+WAIT_CHECK_INTERVAL = datetime.timedelta(milliseconds=100)
+WAIT_CHECK_DEFAULT_TIMEOUT = datetime.timedelta(seconds=5)
processes = []
process_lock = threading.Lock()
@@ -60,71 +60,71 @@ def cleanup_processes():
atexit.register(cleanup_processes)
-def _process_wait_with_timeout(process, timeout=WAIT_CHECK_DEFAULT_TIMEOUT):
- """A funciton to mimic 3.3+ only timeout argument in process.wait."""
- deadline = datetime.datetime.now() + timeout
- while (process.poll() is None) and (datetime.datetime.now() < deadline):
- time.sleep(WAIT_CHECK_INTERVAL.total_seconds())
- if process.returncode is None:
- raise RuntimeError('Process failed to exit within %s' % timeout)
-
-
+def _process_wait_with_timeout(process, timeout=WAIT_CHECK_DEFAULT_TIMEOUT):
+ """A funciton to mimic 3.3+ only timeout argument in process.wait."""
+ deadline = datetime.datetime.now() + timeout
+ while (process.poll() is None) and (datetime.datetime.now() < deadline):
+ time.sleep(WAIT_CHECK_INTERVAL.total_seconds())
+ if process.returncode is None:
+ raise RuntimeError('Process failed to exit within %s' % timeout)
+
+
def interrupt_and_wait(process):
with process_lock:
processes.append(process)
- time.sleep(INIT_TIME.total_seconds())
+ time.sleep(INIT_TIME.total_seconds())
os.kill(process.pid, signal.SIGINT)
- _process_wait_with_timeout(process)
+ _process_wait_with_timeout(process)
def wait(process):
with process_lock:
processes.append(process)
- _process_wait_with_timeout(process)
+ _process_wait_with_timeout(process)
-# TODO(lidiz) enable exit tests once the root cause found.
[email protected]('https://github.com/grpc/grpc/issues/23982')
[email protected]('https://github.com/grpc/grpc/issues/23028')
+# TODO(lidiz) enable exit tests once the root cause found.
[email protected]('https://github.com/grpc/grpc/issues/23982')
[email protected]('https://github.com/grpc/grpc/issues/23028')
class ExitTest(unittest.TestCase):
def test_unstarted_server(self):
env = os.environ.copy()
env['Y_PYTHON_ENTRY_POINT'] = ':main'
- process = subprocess.Popen(BASE_COMMAND +
- [_exit_scenarios.UNSTARTED_SERVER],
- stdout=sys.stdout,
- stderr=sys.stderr,
- env=env)
+ process = subprocess.Popen(BASE_COMMAND +
+ [_exit_scenarios.UNSTARTED_SERVER],
+ stdout=sys.stdout,
+ stderr=sys.stderr,
+ env=env)
wait(process)
def test_unstarted_server_terminate(self):
env = os.environ.copy()
env['Y_PYTHON_ENTRY_POINT'] = ':main'
- process = subprocess.Popen(BASE_SIGTERM_COMMAND +
- [_exit_scenarios.UNSTARTED_SERVER],
- stdout=sys.stdout,
- env=env)
+ process = subprocess.Popen(BASE_SIGTERM_COMMAND +
+ [_exit_scenarios.UNSTARTED_SERVER],
+ stdout=sys.stdout,
+ env=env)
interrupt_and_wait(process)
def test_running_server(self):
env = os.environ.copy()
env['Y_PYTHON_ENTRY_POINT'] = ':main'
- process = subprocess.Popen(BASE_COMMAND +
- [_exit_scenarios.RUNNING_SERVER],
- stdout=sys.stdout,
- stderr=sys.stderr,
- env=env)
+ process = subprocess.Popen(BASE_COMMAND +
+ [_exit_scenarios.RUNNING_SERVER],
+ stdout=sys.stdout,
+ stderr=sys.stderr,
+ env=env)
wait(process)
def test_running_server_terminate(self):
env = os.environ.copy()
env['Y_PYTHON_ENTRY_POINT'] = ':main'
- process = subprocess.Popen(BASE_SIGTERM_COMMAND +
- [_exit_scenarios.RUNNING_SERVER],
- stdout=sys.stdout,
- stderr=sys.stderr,
- env=env)
+ process = subprocess.Popen(BASE_SIGTERM_COMMAND +
+ [_exit_scenarios.RUNNING_SERVER],
+ stdout=sys.stdout,
+ stderr=sys.stderr,
+ env=env)
interrupt_and_wait(process)
def test_poll_connectivity_no_server(self):
@@ -151,21 +151,21 @@ class ExitTest(unittest.TestCase):
def test_poll_connectivity(self):
env = os.environ.copy()
env['Y_PYTHON_ENTRY_POINT'] = ':main'
- process = subprocess.Popen(BASE_COMMAND +
- [_exit_scenarios.POLL_CONNECTIVITY],
- stdout=sys.stdout,
- stderr=sys.stderr,
- env=env)
+ process = subprocess.Popen(BASE_COMMAND +
+ [_exit_scenarios.POLL_CONNECTIVITY],
+ stdout=sys.stdout,
+ stderr=sys.stderr,
+ env=env)
wait(process)
def test_poll_connectivity_terminate(self):
env = os.environ.copy()
env['Y_PYTHON_ENTRY_POINT'] = ':main'
- process = subprocess.Popen(BASE_SIGTERM_COMMAND +
- [_exit_scenarios.POLL_CONNECTIVITY],
- stdout=sys.stdout,
- stderr=sys.stderr,
- env=env)
+ process = subprocess.Popen(BASE_SIGTERM_COMMAND +
+ [_exit_scenarios.POLL_CONNECTIVITY],
+ stdout=sys.stdout,
+ stderr=sys.stderr,
+ env=env)
interrupt_and_wait(process)
@unittest.skipIf(os.name == 'nt',
@@ -173,11 +173,11 @@ class ExitTest(unittest.TestCase):
def test_in_flight_unary_unary_call(self):
env = os.environ.copy()
env['Y_PYTHON_ENTRY_POINT'] = ':main'
- process = subprocess.Popen(BASE_COMMAND +
- [_exit_scenarios.IN_FLIGHT_UNARY_UNARY_CALL],
- stdout=sys.stdout,
- stderr=sys.stderr,
- env=env)
+ process = subprocess.Popen(BASE_COMMAND +
+ [_exit_scenarios.IN_FLIGHT_UNARY_UNARY_CALL],
+ stdout=sys.stdout,
+ stderr=sys.stderr,
+ env=env)
interrupt_and_wait(process)
@unittest.skipIf(os.name == 'nt',
@@ -257,5 +257,5 @@ class ExitTest(unittest.TestCase):
if __name__ == '__main__':
- logging.basicConfig(level=logging.DEBUG)
+ logging.basicConfig(level=logging.DEBUG)
unittest.main(verbosity=2)
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_interceptor_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_interceptor_test.py
index db618430473..619db7b3ffd 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_interceptor_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_interceptor_test.py
@@ -172,15 +172,15 @@ def _unary_unary_multi_callable(channel):
def _unary_stream_multi_callable(channel):
- return channel.unary_stream(_UNARY_STREAM,
- request_serializer=_SERIALIZE_REQUEST,
- response_deserializer=_DESERIALIZE_RESPONSE)
+ return channel.unary_stream(_UNARY_STREAM,
+ request_serializer=_SERIALIZE_REQUEST,
+ response_deserializer=_DESERIALIZE_RESPONSE)
def _stream_unary_multi_callable(channel):
- return channel.stream_unary(_STREAM_UNARY,
- request_serializer=_SERIALIZE_REQUEST,
- response_deserializer=_DESERIALIZE_RESPONSE)
+ return channel.stream_unary(_STREAM_UNARY,
+ request_serializer=_SERIALIZE_REQUEST,
+ response_deserializer=_DESERIALIZE_RESPONSE)
def _stream_stream_multi_callable(channel):
@@ -195,10 +195,10 @@ class _ClientCallDetails(
pass
-class _GenericClientInterceptor(grpc.UnaryUnaryClientInterceptor,
- grpc.UnaryStreamClientInterceptor,
- grpc.StreamUnaryClientInterceptor,
- grpc.StreamStreamClientInterceptor):
+class _GenericClientInterceptor(grpc.UnaryUnaryClientInterceptor,
+ grpc.UnaryStreamClientInterceptor,
+ grpc.StreamUnaryClientInterceptor,
+ grpc.StreamStreamClientInterceptor):
def __init__(self, interceptor_function):
self._fn = interceptor_function
@@ -231,11 +231,11 @@ class _GenericClientInterceptor(grpc.UnaryUnaryClientInterceptor,
return postprocess(response_it) if postprocess else response_it
-class _LoggingInterceptor(grpc.ServerInterceptor,
- grpc.UnaryUnaryClientInterceptor,
- grpc.UnaryStreamClientInterceptor,
- grpc.StreamUnaryClientInterceptor,
- grpc.StreamStreamClientInterceptor):
+class _LoggingInterceptor(grpc.ServerInterceptor,
+ grpc.UnaryUnaryClientInterceptor,
+ grpc.UnaryStreamClientInterceptor,
+ grpc.StreamUnaryClientInterceptor,
+ grpc.StreamStreamClientInterceptor):
def __init__(self, tag, record):
self.tag = tag
@@ -351,13 +351,13 @@ class InterceptorTest(unittest.TestCase):
lambda x: ('secret', '42') in x.invocation_metadata,
_LoggingInterceptor('s3', self._record))
- self._server = grpc.server(self._server_pool,
- options=(('grpc.so_reuseport', 0),),
- interceptors=(
- _LoggingInterceptor('s1', self._record),
- conditional_interceptor,
- _LoggingInterceptor('s2', self._record),
- ))
+ self._server = grpc.server(self._server_pool,
+ options=(('grpc.so_reuseport', 0),),
+ interceptors=(
+ _LoggingInterceptor('s1', self._record),
+ conditional_interceptor,
+ _LoggingInterceptor('s2', self._record),
+ ))
port = self._server.add_insecure_port('[::]:0')
self._server.add_generic_rpc_handlers((_GenericHandler(self._handler),))
self._server.start()
@@ -424,11 +424,11 @@ class InterceptorTest(unittest.TestCase):
def testInterceptedHeaderManipulationWithServerSideVerification(self):
request = b'\x07\x08'
- channel = grpc.intercept_channel(
- self._channel, _append_request_header_interceptor('secret', '42'))
- channel = grpc.intercept_channel(
- channel, _LoggingInterceptor('c1', self._record),
- _LoggingInterceptor('c2', self._record))
+ channel = grpc.intercept_channel(
+ self._channel, _append_request_header_interceptor('secret', '42'))
+ channel = grpc.intercept_channel(
+ channel, _LoggingInterceptor('c1', self._record),
+ _LoggingInterceptor('c2', self._record))
self._record[:] = []
@@ -450,9 +450,9 @@ class InterceptorTest(unittest.TestCase):
self._record[:] = []
- channel = grpc.intercept_channel(
- self._channel, _LoggingInterceptor('c1', self._record),
- _LoggingInterceptor('c2', self._record))
+ channel = grpc.intercept_channel(
+ self._channel, _LoggingInterceptor('c1', self._record),
+ _LoggingInterceptor('c2', self._record))
multi_callable = _unary_unary_multi_callable(channel)
multi_callable(
@@ -470,9 +470,9 @@ class InterceptorTest(unittest.TestCase):
self._record[:] = []
- channel = grpc.intercept_channel(
- self._channel, _LoggingInterceptor('c1', self._record),
- _LoggingInterceptor('c2', self._record))
+ channel = grpc.intercept_channel(
+ self._channel, _LoggingInterceptor('c1', self._record),
+ _LoggingInterceptor('c2', self._record))
multi_callable = _unary_unary_multi_callable(channel)
with self.assertRaises(grpc.RpcError) as exception_context:
@@ -491,9 +491,9 @@ class InterceptorTest(unittest.TestCase):
def testInterceptedUnaryRequestBlockingUnaryResponseWithCall(self):
request = b'\x07\x08'
- channel = grpc.intercept_channel(
- self._channel, _LoggingInterceptor('c1', self._record),
- _LoggingInterceptor('c2', self._record))
+ channel = grpc.intercept_channel(
+ self._channel, _LoggingInterceptor('c1', self._record),
+ _LoggingInterceptor('c2', self._record))
self._record[:] = []
@@ -513,9 +513,9 @@ class InterceptorTest(unittest.TestCase):
request = b'\x07\x08'
self._record[:] = []
- channel = grpc.intercept_channel(
- self._channel, _LoggingInterceptor('c1', self._record),
- _LoggingInterceptor('c2', self._record))
+ channel = grpc.intercept_channel(
+ self._channel, _LoggingInterceptor('c1', self._record),
+ _LoggingInterceptor('c2', self._record))
multi_callable = _unary_unary_multi_callable(channel)
response_future = multi_callable.future(
@@ -532,9 +532,9 @@ class InterceptorTest(unittest.TestCase):
request = b'\x37\x58'
self._record[:] = []
- channel = grpc.intercept_channel(
- self._channel, _LoggingInterceptor('c1', self._record),
- _LoggingInterceptor('c2', self._record))
+ channel = grpc.intercept_channel(
+ self._channel, _LoggingInterceptor('c1', self._record),
+ _LoggingInterceptor('c2', self._record))
multi_callable = _unary_stream_multi_callable(channel)
response_iterator = multi_callable(
@@ -551,9 +551,9 @@ class InterceptorTest(unittest.TestCase):
request = _EXCEPTION_REQUEST
self._record[:] = []
- channel = grpc.intercept_channel(
- self._channel, _LoggingInterceptor('c1', self._record),
- _LoggingInterceptor('c2', self._record))
+ channel = grpc.intercept_channel(
+ self._channel, _LoggingInterceptor('c1', self._record),
+ _LoggingInterceptor('c2', self._record))
multi_callable = _unary_stream_multi_callable(channel)
response_iterator = multi_callable(
@@ -575,9 +575,9 @@ class InterceptorTest(unittest.TestCase):
request_iterator = iter(requests)
self._record[:] = []
- channel = grpc.intercept_channel(
- self._channel, _LoggingInterceptor('c1', self._record),
- _LoggingInterceptor('c2', self._record))
+ channel = grpc.intercept_channel(
+ self._channel, _LoggingInterceptor('c1', self._record),
+ _LoggingInterceptor('c2', self._record))
multi_callable = _stream_unary_multi_callable(channel)
multi_callable(
@@ -596,9 +596,9 @@ class InterceptorTest(unittest.TestCase):
request_iterator = iter(requests)
self._record[:] = []
- channel = grpc.intercept_channel(
- self._channel, _LoggingInterceptor('c1', self._record),
- _LoggingInterceptor('c2', self._record))
+ channel = grpc.intercept_channel(
+ self._channel, _LoggingInterceptor('c1', self._record),
+ _LoggingInterceptor('c2', self._record))
multi_callable = _stream_unary_multi_callable(channel)
multi_callable.with_call(
@@ -618,9 +618,9 @@ class InterceptorTest(unittest.TestCase):
request_iterator = iter(requests)
self._record[:] = []
- channel = grpc.intercept_channel(
- self._channel, _LoggingInterceptor('c1', self._record),
- _LoggingInterceptor('c2', self._record))
+ channel = grpc.intercept_channel(
+ self._channel, _LoggingInterceptor('c1', self._record),
+ _LoggingInterceptor('c2', self._record))
multi_callable = _stream_unary_multi_callable(channel)
response_future = multi_callable.future(
@@ -639,9 +639,9 @@ class InterceptorTest(unittest.TestCase):
request_iterator = iter(requests)
self._record[:] = []
- channel = grpc.intercept_channel(
- self._channel, _LoggingInterceptor('c1', self._record),
- _LoggingInterceptor('c2', self._record))
+ channel = grpc.intercept_channel(
+ self._channel, _LoggingInterceptor('c1', self._record),
+ _LoggingInterceptor('c2', self._record))
multi_callable = _stream_unary_multi_callable(channel)
response_future = multi_callable.future(
@@ -663,9 +663,9 @@ class InterceptorTest(unittest.TestCase):
request_iterator = iter(requests)
self._record[:] = []
- channel = grpc.intercept_channel(
- self._channel, _LoggingInterceptor('c1', self._record),
- _LoggingInterceptor('c2', self._record))
+ channel = grpc.intercept_channel(
+ self._channel, _LoggingInterceptor('c1', self._record),
+ _LoggingInterceptor('c2', self._record))
multi_callable = _stream_stream_multi_callable(channel)
response_iterator = multi_callable(
@@ -684,9 +684,9 @@ class InterceptorTest(unittest.TestCase):
request_iterator = iter(requests)
self._record[:] = []
- channel = grpc.intercept_channel(
- self._channel, _LoggingInterceptor('c1', self._record),
- _LoggingInterceptor('c2', self._record))
+ channel = grpc.intercept_channel(
+ self._channel, _LoggingInterceptor('c1', self._record),
+ _LoggingInterceptor('c2', self._record))
multi_callable = _stream_stream_multi_callable(channel)
response_iterator = multi_callable(
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_invalid_metadata_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_invalid_metadata_test.py
index 8e9b369fcde..d1f1499d8cd 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_invalid_metadata_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_invalid_metadata_test.py
@@ -36,15 +36,15 @@ def _unary_unary_multi_callable(channel):
def _unary_stream_multi_callable(channel):
- return channel.unary_stream(_UNARY_STREAM,
- request_serializer=_SERIALIZE_REQUEST,
- response_deserializer=_DESERIALIZE_RESPONSE)
+ return channel.unary_stream(_UNARY_STREAM,
+ request_serializer=_SERIALIZE_REQUEST,
+ response_deserializer=_DESERIALIZE_RESPONSE)
def _stream_unary_multi_callable(channel):
- return channel.stream_unary(_STREAM_UNARY,
- request_serializer=_SERIALIZE_REQUEST,
- response_deserializer=_DESERIALIZE_RESPONSE)
+ return channel.stream_unary(_STREAM_UNARY,
+ request_serializer=_SERIALIZE_REQUEST,
+ response_deserializer=_DESERIALIZE_RESPONSE)
def _stream_stream_multi_callable(channel):
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_invocation_defects_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_invocation_defects_test.py
index 0a01834b2ad..a0208b51df4 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_invocation_defects_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_invocation_defects_test.py
@@ -157,15 +157,15 @@ def _unary_unary_multi_callable(channel):
def _unary_stream_multi_callable(channel):
- return channel.unary_stream(_UNARY_STREAM,
- request_serializer=_SERIALIZE_REQUEST,
- response_deserializer=_DESERIALIZE_RESPONSE)
+ return channel.unary_stream(_UNARY_STREAM,
+ request_serializer=_SERIALIZE_REQUEST,
+ response_deserializer=_DESERIALIZE_RESPONSE)
def _stream_unary_multi_callable(channel):
- return channel.stream_unary(_STREAM_UNARY,
- request_serializer=_SERIALIZE_REQUEST,
- response_deserializer=_DESERIALIZE_RESPONSE)
+ return channel.stream_unary(_STREAM_UNARY,
+ request_serializer=_SERIALIZE_REQUEST,
+ response_deserializer=_DESERIALIZE_RESPONSE)
def _stream_stream_multi_callable(channel):
@@ -177,7 +177,7 @@ def _defective_handler_multi_callable(channel):
class InvocationDefectsTest(unittest.TestCase):
- """Tests the handling of exception-raising user code on the client-side."""
+ """Tests the handling of exception-raising user code on the client-side."""
def setUp(self):
self._control = test_control.PauseFailControl()
@@ -195,44 +195,44 @@ class InvocationDefectsTest(unittest.TestCase):
self._channel.close()
def testIterableStreamRequestBlockingUnaryResponse(self):
- requests = object()
+ requests = object()
multi_callable = _stream_unary_multi_callable(self._channel)
- with self.assertRaises(grpc.RpcError) as exception_context:
- multi_callable(
+ with self.assertRaises(grpc.RpcError) as exception_context:
+ multi_callable(
requests,
metadata=(('test',
'IterableStreamRequestBlockingUnaryResponse'),))
- self.assertIs(grpc.StatusCode.UNKNOWN,
- exception_context.exception.code())
-
+ self.assertIs(grpc.StatusCode.UNKNOWN,
+ exception_context.exception.code())
+
def testIterableStreamRequestFutureUnaryResponse(self):
- requests = object()
+ requests = object()
multi_callable = _stream_unary_multi_callable(self._channel)
response_future = multi_callable.future(
requests,
metadata=(('test', 'IterableStreamRequestFutureUnaryResponse'),))
- with self.assertRaises(grpc.RpcError) as exception_context:
- response_future.result()
+ with self.assertRaises(grpc.RpcError) as exception_context:
+ response_future.result()
+
+ self.assertIs(grpc.StatusCode.UNKNOWN,
+ exception_context.exception.code())
- self.assertIs(grpc.StatusCode.UNKNOWN,
- exception_context.exception.code())
-
def testIterableStreamRequestStreamResponse(self):
- requests = object()
+ requests = object()
multi_callable = _stream_stream_multi_callable(self._channel)
response_iterator = multi_callable(
requests,
metadata=(('test', 'IterableStreamRequestStreamResponse'),))
- with self.assertRaises(grpc.RpcError) as exception_context:
+ with self.assertRaises(grpc.RpcError) as exception_context:
next(response_iterator)
- self.assertIs(grpc.StatusCode.UNKNOWN,
- exception_context.exception.code())
-
+ self.assertIs(grpc.StatusCode.UNKNOWN,
+ exception_context.exception.code())
+
def testIteratorStreamRequestStreamResponse(self):
requests_iterator = FailAfterFewIterationsCounter(
test_constants.STREAM_LENGTH // 2, b'\x07\x08')
@@ -241,21 +241,21 @@ class InvocationDefectsTest(unittest.TestCase):
requests_iterator,
metadata=(('test', 'IteratorStreamRequestStreamResponse'),))
- with self.assertRaises(grpc.RpcError) as exception_context:
+ with self.assertRaises(grpc.RpcError) as exception_context:
for _ in range(test_constants.STREAM_LENGTH // 2 + 1):
next(response_iterator)
- self.assertIs(grpc.StatusCode.UNKNOWN,
- exception_context.exception.code())
-
+ self.assertIs(grpc.StatusCode.UNKNOWN,
+ exception_context.exception.code())
+
def testDefectiveGenericRpcHandlerUnaryResponse(self):
request = b'\x07\x08'
multi_callable = _defective_handler_multi_callable(self._channel)
with self.assertRaises(grpc.RpcError) as exception_context:
- multi_callable(request,
- metadata=(('test',
- 'DefectiveGenericRpcHandlerUnary'),))
+ multi_callable(request,
+ metadata=(('test',
+ 'DefectiveGenericRpcHandlerUnary'),))
self.assertIs(grpc.StatusCode.UNKNOWN,
exception_context.exception.code())
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_local_credentials_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_local_credentials_test.py
index ecca610ccd1..cd1f71dbeed 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_local_credentials_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_local_credentials_test.py
@@ -47,10 +47,10 @@ class LocalCredentialsTest(unittest.TestCase):
server.start()
with grpc.secure_channel(server_addr.format(port),
channel_creds) as channel:
- self.assertEqual(
- b'abc',
- channel.unary_unary('/test/method')(b'abc',
- wait_for_ready=True))
+ self.assertEqual(
+ b'abc',
+ channel.unary_unary('/test/method')(b'abc',
+ wait_for_ready=True))
server.stop(None)
@unittest.skipIf(os.name == 'nt',
@@ -66,10 +66,10 @@ class LocalCredentialsTest(unittest.TestCase):
server.add_secure_port(server_addr, server_creds)
server.start()
with grpc.secure_channel(server_addr, channel_creds) as channel:
- self.assertEqual(
- b'abc',
- channel.unary_unary('/test/method')(b'abc',
- wait_for_ready=True))
+ self.assertEqual(
+ b'abc',
+ channel.unary_unary('/test/method')(b'abc',
+ wait_for_ready=True))
server.stop(None)
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_logging_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_logging_test.py
index 699299d32e3..1304bb55879 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_logging_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_logging_test.py
@@ -87,10 +87,10 @@ class LoggingTest(unittest.TestCase):
def _verifyScriptSucceeds(self, script):
env = os.environ.copy()
env['Y_PYTHON_ENTRY_POINT'] = ':main'
- process = subprocess.Popen([INTERPRETER, '-c', script],
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE,
- env=env)
+ process = subprocess.Popen([INTERPRETER, '-c', script],
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE,
+ env=env)
out, err = process.communicate()
self.assertEqual(
0, process.returncode,
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_metadata_code_details_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_metadata_code_details_test.py
index 24112695a63..5b06eb2bfe8 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_metadata_code_details_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_metadata_code_details_test.py
@@ -171,19 +171,19 @@ class _Servicer(object):
def _generic_handler(servicer):
method_handlers = {
_UNARY_UNARY:
- grpc.unary_unary_rpc_method_handler(
- servicer.unary_unary,
- request_deserializer=_REQUEST_DESERIALIZER,
- response_serializer=_RESPONSE_SERIALIZER),
+ grpc.unary_unary_rpc_method_handler(
+ servicer.unary_unary,
+ request_deserializer=_REQUEST_DESERIALIZER,
+ response_serializer=_RESPONSE_SERIALIZER),
_UNARY_STREAM:
- grpc.unary_stream_rpc_method_handler(servicer.unary_stream),
+ grpc.unary_stream_rpc_method_handler(servicer.unary_stream),
_STREAM_UNARY:
- grpc.stream_unary_rpc_method_handler(servicer.stream_unary),
+ grpc.stream_unary_rpc_method_handler(servicer.stream_unary),
_STREAM_STREAM:
- grpc.stream_stream_rpc_method_handler(
- servicer.stream_stream,
- request_deserializer=_REQUEST_DESERIALIZER,
- response_serializer=_RESPONSE_SERIALIZER),
+ grpc.stream_stream_rpc_method_handler(
+ servicer.stream_stream,
+ request_deserializer=_REQUEST_DESERIALIZER,
+ response_serializer=_RESPONSE_SERIALIZER),
}
return grpc.method_handlers_generic_handler(_SERVICE, method_handlers)
@@ -208,18 +208,18 @@ class MetadataCodeDetailsTest(unittest.TestCase):
request_serializer=_REQUEST_SERIALIZER,
response_deserializer=_RESPONSE_DESERIALIZER,
)
- self._unary_stream = self._channel.unary_stream(
- '/'.join((
- '',
- _SERVICE,
- _UNARY_STREAM,
- )),)
- self._stream_unary = self._channel.stream_unary(
- '/'.join((
- '',
- _SERVICE,
- _STREAM_UNARY,
- )),)
+ self._unary_stream = self._channel.unary_stream(
+ '/'.join((
+ '',
+ _SERVICE,
+ _UNARY_STREAM,
+ )),)
+ self._stream_unary = self._channel.stream_unary(
+ '/'.join((
+ '',
+ _SERVICE,
+ _STREAM_UNARY,
+ )),)
self._stream_stream = self._channel.stream_stream(
'/'.join((
'',
@@ -254,8 +254,8 @@ class MetadataCodeDetailsTest(unittest.TestCase):
def testSuccessfulUnaryStream(self):
self._servicer.set_details(_DETAILS)
- response_iterator_call = self._unary_stream(_SERIALIZED_REQUEST,
- metadata=_CLIENT_METADATA)
+ response_iterator_call = self._unary_stream(_SERIALIZED_REQUEST,
+ metadata=_CLIENT_METADATA)
received_initial_metadata = response_iterator_call.initial_metadata()
list(response_iterator_call)
@@ -292,9 +292,9 @@ class MetadataCodeDetailsTest(unittest.TestCase):
def testSuccessfulStreamStream(self):
self._servicer.set_details(_DETAILS)
- response_iterator_call = self._stream_stream(iter(
- [object()] * test_constants.STREAM_LENGTH),
- metadata=_CLIENT_METADATA)
+ response_iterator_call = self._stream_stream(iter(
+ [object()] * test_constants.STREAM_LENGTH),
+ metadata=_CLIENT_METADATA)
received_initial_metadata = response_iterator_call.initial_metadata()
list(response_iterator_call)
@@ -375,9 +375,9 @@ class MetadataCodeDetailsTest(unittest.TestCase):
self._servicer.set_abort_call()
with self.assertRaises(grpc.RpcError) as exception_context:
- self._stream_unary.with_call(iter([_SERIALIZED_REQUEST] *
- test_constants.STREAM_LENGTH),
- metadata=_CLIENT_METADATA)
+ self._stream_unary.with_call(iter([_SERIALIZED_REQUEST] *
+ test_constants.STREAM_LENGTH),
+ metadata=_CLIENT_METADATA)
self.assertTrue(
test_common.metadata_transmitted(
@@ -450,8 +450,8 @@ class MetadataCodeDetailsTest(unittest.TestCase):
self._servicer.set_code(_NON_OK_CODE)
self._servicer.set_details(_DETAILS)
- response_iterator_call = self._unary_stream(_SERIALIZED_REQUEST,
- metadata=_CLIENT_METADATA)
+ response_iterator_call = self._unary_stream(_SERIALIZED_REQUEST,
+ metadata=_CLIENT_METADATA)
received_initial_metadata = response_iterator_call.initial_metadata()
with self.assertRaises(grpc.RpcError):
list(response_iterator_call)
@@ -474,9 +474,9 @@ class MetadataCodeDetailsTest(unittest.TestCase):
self._servicer.set_details(_DETAILS)
with self.assertRaises(grpc.RpcError) as exception_context:
- self._stream_unary.with_call(iter([_SERIALIZED_REQUEST] *
- test_constants.STREAM_LENGTH),
- metadata=_CLIENT_METADATA)
+ self._stream_unary.with_call(iter([_SERIALIZED_REQUEST] *
+ test_constants.STREAM_LENGTH),
+ metadata=_CLIENT_METADATA)
self.assertTrue(
test_common.metadata_transmitted(
@@ -496,9 +496,9 @@ class MetadataCodeDetailsTest(unittest.TestCase):
self._servicer.set_code(_NON_OK_CODE)
self._servicer.set_details(_DETAILS)
- response_iterator_call = self._stream_stream(iter(
- [object()] * test_constants.STREAM_LENGTH),
- metadata=_CLIENT_METADATA)
+ response_iterator_call = self._stream_stream(iter(
+ [object()] * test_constants.STREAM_LENGTH),
+ metadata=_CLIENT_METADATA)
received_initial_metadata = response_iterator_call.initial_metadata()
with self.assertRaises(grpc.RpcError) as exception_context:
list(response_iterator_call)
@@ -543,8 +543,8 @@ class MetadataCodeDetailsTest(unittest.TestCase):
self._servicer.set_details(_DETAILS)
self._servicer.set_exception()
- response_iterator_call = self._unary_stream(_SERIALIZED_REQUEST,
- metadata=_CLIENT_METADATA)
+ response_iterator_call = self._unary_stream(_SERIALIZED_REQUEST,
+ metadata=_CLIENT_METADATA)
received_initial_metadata = response_iterator_call.initial_metadata()
with self.assertRaises(grpc.RpcError):
list(response_iterator_call)
@@ -568,9 +568,9 @@ class MetadataCodeDetailsTest(unittest.TestCase):
self._servicer.set_exception()
with self.assertRaises(grpc.RpcError) as exception_context:
- self._stream_unary.with_call(iter([_SERIALIZED_REQUEST] *
- test_constants.STREAM_LENGTH),
- metadata=_CLIENT_METADATA)
+ self._stream_unary.with_call(iter([_SERIALIZED_REQUEST] *
+ test_constants.STREAM_LENGTH),
+ metadata=_CLIENT_METADATA)
self.assertTrue(
test_common.metadata_transmitted(
@@ -591,9 +591,9 @@ class MetadataCodeDetailsTest(unittest.TestCase):
self._servicer.set_details(_DETAILS)
self._servicer.set_exception()
- response_iterator_call = self._stream_stream(iter(
- [object()] * test_constants.STREAM_LENGTH),
- metadata=_CLIENT_METADATA)
+ response_iterator_call = self._stream_stream(iter(
+ [object()] * test_constants.STREAM_LENGTH),
+ metadata=_CLIENT_METADATA)
received_initial_metadata = response_iterator_call.initial_metadata()
with self.assertRaises(grpc.RpcError):
list(response_iterator_call)
@@ -639,9 +639,9 @@ class MetadataCodeDetailsTest(unittest.TestCase):
self._servicer.set_return_none()
with self.assertRaises(grpc.RpcError) as exception_context:
- self._stream_unary.with_call(iter([_SERIALIZED_REQUEST] *
- test_constants.STREAM_LENGTH),
- metadata=_CLIENT_METADATA)
+ self._stream_unary.with_call(iter([_SERIALIZED_REQUEST] *
+ test_constants.STREAM_LENGTH),
+ metadata=_CLIENT_METADATA)
self.assertTrue(
test_common.metadata_transmitted(
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_metadata_flags_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_metadata_flags_test.py
index fc86f0a6568..e2b36b1c70f 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_metadata_flags_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_metadata_flags_test.py
@@ -17,7 +17,7 @@ import time
import weakref
import unittest
import threading
-import logging
+import logging
import socket
from six.moves import queue
@@ -26,7 +26,7 @@ import grpc
from tests.unit import test_common
from tests.unit.framework.common import test_constants
import tests.unit.framework.common
-from tests.unit.framework.common import get_socket
+from tests.unit.framework.common import get_socket
_UNARY_UNARY = '/test/UnaryUnary'
_UNARY_STREAM = '/test/UnaryStream'
@@ -69,17 +69,17 @@ class _MethodHandler(grpc.RpcMethodHandler):
self.stream_unary = None
self.stream_stream = None
if self.request_streaming and self.response_streaming:
- self.stream_stream = lambda req, ctx: handle_stream_stream(
- test, req, ctx)
+ self.stream_stream = lambda req, ctx: handle_stream_stream(
+ test, req, ctx)
elif self.request_streaming:
- self.stream_unary = lambda req, ctx: handle_stream_unary(
- test, req, ctx)
+ self.stream_unary = lambda req, ctx: handle_stream_unary(
+ test, req, ctx)
elif self.response_streaming:
- self.unary_stream = lambda req, ctx: handle_unary_stream(
- test, req, ctx)
+ self.unary_stream = lambda req, ctx: handle_unary_stream(
+ test, req, ctx)
else:
- self.unary_unary = lambda req, ctx: handle_unary_unary(
- test, req, ctx)
+ self.unary_unary = lambda req, ctx: handle_unary_unary(
+ test, req, ctx)
class _GenericHandler(grpc.GenericRpcHandler):
@@ -102,9 +102,9 @@ class _GenericHandler(grpc.GenericRpcHandler):
def create_dummy_channel():
"""Creating dummy channels is a workaround for retries"""
- host, port, sock = get_socket(sock_options=(socket.SO_REUSEADDR,))
- sock.close()
- return grpc.insecure_channel('{}:{}'.format(host, port))
+ host, port, sock = get_socket(sock_options=(socket.SO_REUSEADDR,))
+ sock.close()
+ return grpc.insecure_channel('{}:{}'.format(host, port))
def perform_unary_unary_call(channel, wait_for_ready=None):
@@ -194,9 +194,9 @@ class MetadataFlagsTest(unittest.TestCase):
def test_call_wait_for_ready_disabled(self):
for perform_call in _ALL_CALL_CASES:
with create_dummy_channel() as channel:
- self.check_connection_does_failfast(perform_call,
- channel,
- wait_for_ready=False)
+ self.check_connection_does_failfast(perform_call,
+ channel,
+ wait_for_ready=False)
def test_call_wait_for_ready_enabled(self):
# To test the wait mechanism, Python thread is required to make
@@ -206,55 +206,55 @@ class MetadataFlagsTest(unittest.TestCase):
# exceptions and raise them again in main thread.
unhandled_exceptions = queue.Queue()
- # We just need an unused TCP port
- host, port, sock = get_socket(sock_options=(socket.SO_REUSEADDR,))
- sock.close()
-
- addr = '{}:{}'.format(host, port)
- wg = test_common.WaitGroup(len(_ALL_CALL_CASES))
-
- def wait_for_transient_failure(channel_connectivity):
- if channel_connectivity == grpc.ChannelConnectivity.TRANSIENT_FAILURE:
- wg.done()
-
- def test_call(perform_call):
- with grpc.insecure_channel(addr) as channel:
- try:
- channel.subscribe(wait_for_transient_failure)
- perform_call(channel, wait_for_ready=True)
- except BaseException as e: # pylint: disable=broad-except
- # If the call failed, the thread would be destroyed. The
- # channel object can be collected before calling the
- # callback, which will result in a deadlock.
+ # We just need an unused TCP port
+ host, port, sock = get_socket(sock_options=(socket.SO_REUSEADDR,))
+ sock.close()
+
+ addr = '{}:{}'.format(host, port)
+ wg = test_common.WaitGroup(len(_ALL_CALL_CASES))
+
+ def wait_for_transient_failure(channel_connectivity):
+ if channel_connectivity == grpc.ChannelConnectivity.TRANSIENT_FAILURE:
+ wg.done()
+
+ def test_call(perform_call):
+ with grpc.insecure_channel(addr) as channel:
+ try:
+ channel.subscribe(wait_for_transient_failure)
+ perform_call(channel, wait_for_ready=True)
+ except BaseException as e: # pylint: disable=broad-except
+ # If the call failed, the thread would be destroyed. The
+ # channel object can be collected before calling the
+ # callback, which will result in a deadlock.
wg.done()
- unhandled_exceptions.put(e, True)
+ unhandled_exceptions.put(e, True)
- test_threads = []
- for perform_call in _ALL_CALL_CASES:
- test_thread = threading.Thread(target=test_call,
- args=(perform_call,))
- test_thread.daemon = True
- test_thread.exception = None
- test_thread.start()
- test_threads.append(test_thread)
+ test_threads = []
+ for perform_call in _ALL_CALL_CASES:
+ test_thread = threading.Thread(target=test_call,
+ args=(perform_call,))
+ test_thread.daemon = True
+ test_thread.exception = None
+ test_thread.start()
+ test_threads.append(test_thread)
- # Start the server after the connections are waiting
- wg.wait()
- server = test_common.test_server(reuse_port=True)
- server.add_generic_rpc_handlers((_GenericHandler(weakref.proxy(self)),))
- server.add_insecure_port(addr)
- server.start()
+ # Start the server after the connections are waiting
+ wg.wait()
+ server = test_common.test_server(reuse_port=True)
+ server.add_generic_rpc_handlers((_GenericHandler(weakref.proxy(self)),))
+ server.add_insecure_port(addr)
+ server.start()
- for test_thread in test_threads:
- test_thread.join()
+ for test_thread in test_threads:
+ test_thread.join()
- # Stop the server to make test end properly
- server.stop(0)
+ # Stop the server to make test end properly
+ server.stop(0)
- if not unhandled_exceptions.empty():
- raise unhandled_exceptions.get(True)
+ if not unhandled_exceptions.empty():
+ raise unhandled_exceptions.get(True)
if __name__ == '__main__':
- logging.basicConfig(level=logging.DEBUG)
+ logging.basicConfig(level=logging.DEBUG)
unittest.main(verbosity=2)
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_metadata_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_metadata_test.py
index e1498ca9bac..3e7717b04c7 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_metadata_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_metadata_test.py
@@ -177,12 +177,12 @@ class MetadataTest(unittest.TestCase):
def setUp(self):
self._server = test_common.test_server()
- self._server.add_generic_rpc_handlers(
- (_GenericHandler(weakref.proxy(self)),))
+ self._server.add_generic_rpc_handlers(
+ (_GenericHandler(weakref.proxy(self)),))
port = self._server.add_insecure_port('[::]:0')
self._server.start()
- self._channel = grpc.insecure_channel('localhost:%d' % port,
- options=_CHANNEL_ARGS)
+ self._channel = grpc.insecure_channel('localhost:%d' % port,
+ options=_CHANNEL_ARGS)
def tearDown(self):
self._server.stop(0)
@@ -225,8 +225,8 @@ class MetadataTest(unittest.TestCase):
def testStreamStream(self):
multi_callable = self._channel.stream_stream(_STREAM_STREAM)
- call = multi_callable(iter([_REQUEST] * test_constants.STREAM_LENGTH),
- metadata=_INVOCATION_METADATA)
+ call = multi_callable(iter([_REQUEST] * test_constants.STREAM_LENGTH),
+ metadata=_INVOCATION_METADATA)
self.assertTrue(
test_common.metadata_transmitted(_EXPECTED_INITIAL_METADATA,
call.initial_metadata()))
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_reconnect_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_reconnect_test.py
index 758895bf872..16feb4b1ff4 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_reconnect_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_reconnect_test.py
@@ -40,7 +40,7 @@ class ReconnectTest(unittest.TestCase):
server_pool = logging_pool.pool(test_constants.THREAD_CONCURRENCY)
handler = grpc.method_handlers_generic_handler('test', {
'UnaryUnary':
- grpc.unary_unary_rpc_method_handler(_handle_unary_unary)
+ grpc.unary_unary_rpc_method_handler(_handle_unary_unary)
})
options = (('grpc.so_reuseport', 1),)
with bound_socket() as (host, port):
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_rpc_part_1_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_rpc_part_1_test.py
index d432c27ef0b..9b0cb29a0d5 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_rpc_part_1_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_rpc_part_1_test.py
@@ -1,232 +1,232 @@
-# Copyright 2016 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-"""Test of RPCs made against gRPC Python's application-layer API."""
-
-import itertools
-import threading
-import unittest
-import logging
-from concurrent import futures
-
-import grpc
-from grpc.framework.foundation import logging_pool
-
-from tests.unit._rpc_test_helpers import (
- TIMEOUT_SHORT, Callback, unary_unary_multi_callable,
- unary_stream_multi_callable, unary_stream_non_blocking_multi_callable,
- stream_unary_multi_callable, stream_stream_multi_callable,
- stream_stream_non_blocking_multi_callable, BaseRPCTest)
-from tests.unit.framework.common import test_constants
-
-
-class RPCPart1Test(BaseRPCTest, unittest.TestCase):
-
- def testExpiredStreamRequestBlockingUnaryResponse(self):
- requests = tuple(
- b'\x07\x08' for _ in range(test_constants.STREAM_LENGTH))
- request_iterator = iter(requests)
-
- multi_callable = stream_unary_multi_callable(self._channel)
- with self._control.pause():
- with self.assertRaises(grpc.RpcError) as exception_context:
- multi_callable(
- request_iterator,
- timeout=TIMEOUT_SHORT,
- metadata=(('test',
- 'ExpiredStreamRequestBlockingUnaryResponse'),))
-
- self.assertIsInstance(exception_context.exception, grpc.RpcError)
- self.assertIsInstance(exception_context.exception, grpc.Call)
- self.assertIsNotNone(exception_context.exception.initial_metadata())
- self.assertIs(grpc.StatusCode.DEADLINE_EXCEEDED,
- exception_context.exception.code())
- self.assertIsNotNone(exception_context.exception.details())
- self.assertIsNotNone(exception_context.exception.trailing_metadata())
-
- def testExpiredStreamRequestFutureUnaryResponse(self):
- requests = tuple(
- b'\x07\x18' for _ in range(test_constants.STREAM_LENGTH))
- request_iterator = iter(requests)
- callback = Callback()
-
- multi_callable = stream_unary_multi_callable(self._channel)
- with self._control.pause():
- response_future = multi_callable.future(
- request_iterator,
- timeout=TIMEOUT_SHORT,
- metadata=(('test', 'ExpiredStreamRequestFutureUnaryResponse'),))
- with self.assertRaises(grpc.FutureTimeoutError):
- response_future.result(timeout=TIMEOUT_SHORT / 2.0)
- response_future.add_done_callback(callback)
- value_passed_to_callback = callback.value()
-
- with self.assertRaises(grpc.RpcError) as exception_context:
- response_future.result()
- self.assertIs(grpc.StatusCode.DEADLINE_EXCEEDED, response_future.code())
- self.assertIs(grpc.StatusCode.DEADLINE_EXCEEDED,
- exception_context.exception.code())
- self.assertIsInstance(response_future.exception(), grpc.RpcError)
- self.assertIsNotNone(response_future.traceback())
- self.assertIs(response_future, value_passed_to_callback)
- self.assertIsNotNone(response_future.initial_metadata())
- self.assertIs(grpc.StatusCode.DEADLINE_EXCEEDED, response_future.code())
- self.assertIsNotNone(response_future.details())
- self.assertIsNotNone(response_future.trailing_metadata())
-
- def testExpiredStreamRequestStreamResponse(self):
- self._expired_stream_request_stream_response(
- stream_stream_multi_callable(self._channel))
-
- def testExpiredStreamRequestStreamResponseNonBlocking(self):
- self._expired_stream_request_stream_response(
- stream_stream_non_blocking_multi_callable(self._channel))
-
- def testFailedUnaryRequestBlockingUnaryResponse(self):
- request = b'\x37\x17'
-
- multi_callable = unary_unary_multi_callable(self._channel)
- with self._control.fail():
- with self.assertRaises(grpc.RpcError) as exception_context:
- multi_callable.with_call(
- request,
- metadata=(('test',
- 'FailedUnaryRequestBlockingUnaryResponse'),))
-
- self.assertIs(grpc.StatusCode.UNKNOWN,
- exception_context.exception.code())
- # sanity checks on to make sure returned string contains default members
- # of the error
- debug_error_string = exception_context.exception.debug_error_string()
- self.assertIn('created', debug_error_string)
- self.assertIn('description', debug_error_string)
- self.assertIn('file', debug_error_string)
- self.assertIn('file_line', debug_error_string)
-
- def testFailedUnaryRequestFutureUnaryResponse(self):
- request = b'\x37\x17'
- callback = Callback()
-
- multi_callable = unary_unary_multi_callable(self._channel)
- with self._control.fail():
- response_future = multi_callable.future(
- request,
- metadata=(('test', 'FailedUnaryRequestFutureUnaryResponse'),))
- response_future.add_done_callback(callback)
- value_passed_to_callback = callback.value()
-
- self.assertIsInstance(response_future, grpc.Future)
- self.assertIsInstance(response_future, grpc.Call)
- with self.assertRaises(grpc.RpcError) as exception_context:
- response_future.result()
- self.assertIs(grpc.StatusCode.UNKNOWN,
- exception_context.exception.code())
- self.assertIsInstance(response_future.exception(), grpc.RpcError)
- self.assertIsNotNone(response_future.traceback())
- self.assertIs(grpc.StatusCode.UNKNOWN,
- response_future.exception().code())
- self.assertIs(response_future, value_passed_to_callback)
-
- def testFailedUnaryRequestStreamResponse(self):
- self._failed_unary_request_stream_response(
- unary_stream_multi_callable(self._channel))
-
- def testFailedUnaryRequestStreamResponseNonBlocking(self):
- self._failed_unary_request_stream_response(
- unary_stream_non_blocking_multi_callable(self._channel))
-
- def testFailedStreamRequestBlockingUnaryResponse(self):
- requests = tuple(
- b'\x47\x58' for _ in range(test_constants.STREAM_LENGTH))
- request_iterator = iter(requests)
-
- multi_callable = stream_unary_multi_callable(self._channel)
- with self._control.fail():
- with self.assertRaises(grpc.RpcError) as exception_context:
- multi_callable(
- request_iterator,
- metadata=(('test',
- 'FailedStreamRequestBlockingUnaryResponse'),))
-
- self.assertIs(grpc.StatusCode.UNKNOWN,
- exception_context.exception.code())
-
- def testFailedStreamRequestFutureUnaryResponse(self):
- requests = tuple(
- b'\x07\x18' for _ in range(test_constants.STREAM_LENGTH))
- request_iterator = iter(requests)
- callback = Callback()
-
- multi_callable = stream_unary_multi_callable(self._channel)
- with self._control.fail():
- response_future = multi_callable.future(
- request_iterator,
- metadata=(('test', 'FailedStreamRequestFutureUnaryResponse'),))
- response_future.add_done_callback(callback)
- value_passed_to_callback = callback.value()
-
- with self.assertRaises(grpc.RpcError) as exception_context:
- response_future.result()
- self.assertIs(grpc.StatusCode.UNKNOWN, response_future.code())
- self.assertIs(grpc.StatusCode.UNKNOWN,
- exception_context.exception.code())
- self.assertIsInstance(response_future.exception(), grpc.RpcError)
- self.assertIsNotNone(response_future.traceback())
- self.assertIs(response_future, value_passed_to_callback)
-
- def testFailedStreamRequestStreamResponse(self):
- self._failed_stream_request_stream_response(
- stream_stream_multi_callable(self._channel))
-
- def testFailedStreamRequestStreamResponseNonBlocking(self):
- self._failed_stream_request_stream_response(
- stream_stream_non_blocking_multi_callable(self._channel))
-
- def testIgnoredUnaryRequestFutureUnaryResponse(self):
- request = b'\x37\x17'
-
- multi_callable = unary_unary_multi_callable(self._channel)
- multi_callable.future(
- request,
- metadata=(('test', 'IgnoredUnaryRequestFutureUnaryResponse'),))
-
- def testIgnoredUnaryRequestStreamResponse(self):
- self._ignored_unary_stream_request_future_unary_response(
- unary_stream_multi_callable(self._channel))
-
- def testIgnoredUnaryRequestStreamResponseNonBlocking(self):
- self._ignored_unary_stream_request_future_unary_response(
- unary_stream_non_blocking_multi_callable(self._channel))
-
- def testIgnoredStreamRequestFutureUnaryResponse(self):
- requests = tuple(
- b'\x07\x18' for _ in range(test_constants.STREAM_LENGTH))
- request_iterator = iter(requests)
-
- multi_callable = stream_unary_multi_callable(self._channel)
- multi_callable.future(
- request_iterator,
- metadata=(('test', 'IgnoredStreamRequestFutureUnaryResponse'),))
-
- def testIgnoredStreamRequestStreamResponse(self):
- self._ignored_stream_request_stream_response(
- stream_stream_multi_callable(self._channel))
-
- def testIgnoredStreamRequestStreamResponseNonBlocking(self):
- self._ignored_stream_request_stream_response(
- stream_stream_non_blocking_multi_callable(self._channel))
-
-
-if __name__ == '__main__':
- logging.basicConfig()
- unittest.main(verbosity=2)
+# Copyright 2016 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+"""Test of RPCs made against gRPC Python's application-layer API."""
+
+import itertools
+import threading
+import unittest
+import logging
+from concurrent import futures
+
+import grpc
+from grpc.framework.foundation import logging_pool
+
+from tests.unit._rpc_test_helpers import (
+ TIMEOUT_SHORT, Callback, unary_unary_multi_callable,
+ unary_stream_multi_callable, unary_stream_non_blocking_multi_callable,
+ stream_unary_multi_callable, stream_stream_multi_callable,
+ stream_stream_non_blocking_multi_callable, BaseRPCTest)
+from tests.unit.framework.common import test_constants
+
+
+class RPCPart1Test(BaseRPCTest, unittest.TestCase):
+
+ def testExpiredStreamRequestBlockingUnaryResponse(self):
+ requests = tuple(
+ b'\x07\x08' for _ in range(test_constants.STREAM_LENGTH))
+ request_iterator = iter(requests)
+
+ multi_callable = stream_unary_multi_callable(self._channel)
+ with self._control.pause():
+ with self.assertRaises(grpc.RpcError) as exception_context:
+ multi_callable(
+ request_iterator,
+ timeout=TIMEOUT_SHORT,
+ metadata=(('test',
+ 'ExpiredStreamRequestBlockingUnaryResponse'),))
+
+ self.assertIsInstance(exception_context.exception, grpc.RpcError)
+ self.assertIsInstance(exception_context.exception, grpc.Call)
+ self.assertIsNotNone(exception_context.exception.initial_metadata())
+ self.assertIs(grpc.StatusCode.DEADLINE_EXCEEDED,
+ exception_context.exception.code())
+ self.assertIsNotNone(exception_context.exception.details())
+ self.assertIsNotNone(exception_context.exception.trailing_metadata())
+
+ def testExpiredStreamRequestFutureUnaryResponse(self):
+ requests = tuple(
+ b'\x07\x18' for _ in range(test_constants.STREAM_LENGTH))
+ request_iterator = iter(requests)
+ callback = Callback()
+
+ multi_callable = stream_unary_multi_callable(self._channel)
+ with self._control.pause():
+ response_future = multi_callable.future(
+ request_iterator,
+ timeout=TIMEOUT_SHORT,
+ metadata=(('test', 'ExpiredStreamRequestFutureUnaryResponse'),))
+ with self.assertRaises(grpc.FutureTimeoutError):
+ response_future.result(timeout=TIMEOUT_SHORT / 2.0)
+ response_future.add_done_callback(callback)
+ value_passed_to_callback = callback.value()
+
+ with self.assertRaises(grpc.RpcError) as exception_context:
+ response_future.result()
+ self.assertIs(grpc.StatusCode.DEADLINE_EXCEEDED, response_future.code())
+ self.assertIs(grpc.StatusCode.DEADLINE_EXCEEDED,
+ exception_context.exception.code())
+ self.assertIsInstance(response_future.exception(), grpc.RpcError)
+ self.assertIsNotNone(response_future.traceback())
+ self.assertIs(response_future, value_passed_to_callback)
+ self.assertIsNotNone(response_future.initial_metadata())
+ self.assertIs(grpc.StatusCode.DEADLINE_EXCEEDED, response_future.code())
+ self.assertIsNotNone(response_future.details())
+ self.assertIsNotNone(response_future.trailing_metadata())
+
+ def testExpiredStreamRequestStreamResponse(self):
+ self._expired_stream_request_stream_response(
+ stream_stream_multi_callable(self._channel))
+
+ def testExpiredStreamRequestStreamResponseNonBlocking(self):
+ self._expired_stream_request_stream_response(
+ stream_stream_non_blocking_multi_callable(self._channel))
+
+ def testFailedUnaryRequestBlockingUnaryResponse(self):
+ request = b'\x37\x17'
+
+ multi_callable = unary_unary_multi_callable(self._channel)
+ with self._control.fail():
+ with self.assertRaises(grpc.RpcError) as exception_context:
+ multi_callable.with_call(
+ request,
+ metadata=(('test',
+ 'FailedUnaryRequestBlockingUnaryResponse'),))
+
+ self.assertIs(grpc.StatusCode.UNKNOWN,
+ exception_context.exception.code())
+ # sanity checks on to make sure returned string contains default members
+ # of the error
+ debug_error_string = exception_context.exception.debug_error_string()
+ self.assertIn('created', debug_error_string)
+ self.assertIn('description', debug_error_string)
+ self.assertIn('file', debug_error_string)
+ self.assertIn('file_line', debug_error_string)
+
+ def testFailedUnaryRequestFutureUnaryResponse(self):
+ request = b'\x37\x17'
+ callback = Callback()
+
+ multi_callable = unary_unary_multi_callable(self._channel)
+ with self._control.fail():
+ response_future = multi_callable.future(
+ request,
+ metadata=(('test', 'FailedUnaryRequestFutureUnaryResponse'),))
+ response_future.add_done_callback(callback)
+ value_passed_to_callback = callback.value()
+
+ self.assertIsInstance(response_future, grpc.Future)
+ self.assertIsInstance(response_future, grpc.Call)
+ with self.assertRaises(grpc.RpcError) as exception_context:
+ response_future.result()
+ self.assertIs(grpc.StatusCode.UNKNOWN,
+ exception_context.exception.code())
+ self.assertIsInstance(response_future.exception(), grpc.RpcError)
+ self.assertIsNotNone(response_future.traceback())
+ self.assertIs(grpc.StatusCode.UNKNOWN,
+ response_future.exception().code())
+ self.assertIs(response_future, value_passed_to_callback)
+
+ def testFailedUnaryRequestStreamResponse(self):
+ self._failed_unary_request_stream_response(
+ unary_stream_multi_callable(self._channel))
+
+ def testFailedUnaryRequestStreamResponseNonBlocking(self):
+ self._failed_unary_request_stream_response(
+ unary_stream_non_blocking_multi_callable(self._channel))
+
+ def testFailedStreamRequestBlockingUnaryResponse(self):
+ requests = tuple(
+ b'\x47\x58' for _ in range(test_constants.STREAM_LENGTH))
+ request_iterator = iter(requests)
+
+ multi_callable = stream_unary_multi_callable(self._channel)
+ with self._control.fail():
+ with self.assertRaises(grpc.RpcError) as exception_context:
+ multi_callable(
+ request_iterator,
+ metadata=(('test',
+ 'FailedStreamRequestBlockingUnaryResponse'),))
+
+ self.assertIs(grpc.StatusCode.UNKNOWN,
+ exception_context.exception.code())
+
+ def testFailedStreamRequestFutureUnaryResponse(self):
+ requests = tuple(
+ b'\x07\x18' for _ in range(test_constants.STREAM_LENGTH))
+ request_iterator = iter(requests)
+ callback = Callback()
+
+ multi_callable = stream_unary_multi_callable(self._channel)
+ with self._control.fail():
+ response_future = multi_callable.future(
+ request_iterator,
+ metadata=(('test', 'FailedStreamRequestFutureUnaryResponse'),))
+ response_future.add_done_callback(callback)
+ value_passed_to_callback = callback.value()
+
+ with self.assertRaises(grpc.RpcError) as exception_context:
+ response_future.result()
+ self.assertIs(grpc.StatusCode.UNKNOWN, response_future.code())
+ self.assertIs(grpc.StatusCode.UNKNOWN,
+ exception_context.exception.code())
+ self.assertIsInstance(response_future.exception(), grpc.RpcError)
+ self.assertIsNotNone(response_future.traceback())
+ self.assertIs(response_future, value_passed_to_callback)
+
+ def testFailedStreamRequestStreamResponse(self):
+ self._failed_stream_request_stream_response(
+ stream_stream_multi_callable(self._channel))
+
+ def testFailedStreamRequestStreamResponseNonBlocking(self):
+ self._failed_stream_request_stream_response(
+ stream_stream_non_blocking_multi_callable(self._channel))
+
+ def testIgnoredUnaryRequestFutureUnaryResponse(self):
+ request = b'\x37\x17'
+
+ multi_callable = unary_unary_multi_callable(self._channel)
+ multi_callable.future(
+ request,
+ metadata=(('test', 'IgnoredUnaryRequestFutureUnaryResponse'),))
+
+ def testIgnoredUnaryRequestStreamResponse(self):
+ self._ignored_unary_stream_request_future_unary_response(
+ unary_stream_multi_callable(self._channel))
+
+ def testIgnoredUnaryRequestStreamResponseNonBlocking(self):
+ self._ignored_unary_stream_request_future_unary_response(
+ unary_stream_non_blocking_multi_callable(self._channel))
+
+ def testIgnoredStreamRequestFutureUnaryResponse(self):
+ requests = tuple(
+ b'\x07\x18' for _ in range(test_constants.STREAM_LENGTH))
+ request_iterator = iter(requests)
+
+ multi_callable = stream_unary_multi_callable(self._channel)
+ multi_callable.future(
+ request_iterator,
+ metadata=(('test', 'IgnoredStreamRequestFutureUnaryResponse'),))
+
+ def testIgnoredStreamRequestStreamResponse(self):
+ self._ignored_stream_request_stream_response(
+ stream_stream_multi_callable(self._channel))
+
+ def testIgnoredStreamRequestStreamResponseNonBlocking(self):
+ self._ignored_stream_request_stream_response(
+ stream_stream_non_blocking_multi_callable(self._channel))
+
+
+if __name__ == '__main__':
+ logging.basicConfig()
+ unittest.main(verbosity=2)
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_rpc_part_2_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_rpc_part_2_test.py
index 45a41109d83..0e559efec2a 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_rpc_part_2_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_rpc_part_2_test.py
@@ -1,426 +1,426 @@
-# Copyright 2016 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-"""Test of RPCs made against gRPC Python's application-layer API."""
-
-import itertools
-import threading
-import unittest
-import logging
-from concurrent import futures
-
-import grpc
-from grpc.framework.foundation import logging_pool
-
-from tests.unit._rpc_test_helpers import (
- TIMEOUT_SHORT, Callback, unary_unary_multi_callable,
- unary_stream_multi_callable, unary_stream_non_blocking_multi_callable,
- stream_unary_multi_callable, stream_stream_multi_callable,
- stream_stream_non_blocking_multi_callable, BaseRPCTest)
-from tests.unit.framework.common import test_constants
-
-
-class RPCPart2Test(BaseRPCTest, unittest.TestCase):
-
- def testDefaultThreadPoolIsUsed(self):
- self._consume_one_stream_response_unary_request(
- unary_stream_multi_callable(self._channel))
- self.assertFalse(self._thread_pool.was_used())
-
- def testExperimentalThreadPoolIsUsed(self):
- self._consume_one_stream_response_unary_request(
- unary_stream_non_blocking_multi_callable(self._channel))
- self.assertTrue(self._thread_pool.was_used())
-
- def testUnrecognizedMethod(self):
- request = b'abc'
-
- with self.assertRaises(grpc.RpcError) as exception_context:
- self._channel.unary_unary('NoSuchMethod')(request)
-
- self.assertEqual(grpc.StatusCode.UNIMPLEMENTED,
- exception_context.exception.code())
-
- def testSuccessfulUnaryRequestBlockingUnaryResponse(self):
- request = b'\x07\x08'
- expected_response = self._handler.handle_unary_unary(request, None)
-
- multi_callable = unary_unary_multi_callable(self._channel)
- response = multi_callable(
- request,
- metadata=(('test', 'SuccessfulUnaryRequestBlockingUnaryResponse'),))
-
- self.assertEqual(expected_response, response)
-
- def testSuccessfulUnaryRequestBlockingUnaryResponseWithCall(self):
- request = b'\x07\x08'
- expected_response = self._handler.handle_unary_unary(request, None)
-
- multi_callable = unary_unary_multi_callable(self._channel)
- response, call = multi_callable.with_call(
- request,
- metadata=(('test',
- 'SuccessfulUnaryRequestBlockingUnaryResponseWithCall'),))
-
- self.assertEqual(expected_response, response)
- self.assertIs(grpc.StatusCode.OK, call.code())
- self.assertEqual('', call.debug_error_string())
-
- def testSuccessfulUnaryRequestFutureUnaryResponse(self):
- request = b'\x07\x08'
- expected_response = self._handler.handle_unary_unary(request, None)
-
- multi_callable = unary_unary_multi_callable(self._channel)
- response_future = multi_callable.future(
- request,
- metadata=(('test', 'SuccessfulUnaryRequestFutureUnaryResponse'),))
- response = response_future.result()
-
- self.assertIsInstance(response_future, grpc.Future)
- self.assertIsInstance(response_future, grpc.Call)
- self.assertEqual(expected_response, response)
- self.assertIsNone(response_future.exception())
- self.assertIsNone(response_future.traceback())
-
- def testSuccessfulUnaryRequestStreamResponse(self):
- request = b'\x37\x58'
- expected_responses = tuple(
- self._handler.handle_unary_stream(request, None))
-
- multi_callable = unary_stream_multi_callable(self._channel)
- response_iterator = multi_callable(
- request,
- metadata=(('test', 'SuccessfulUnaryRequestStreamResponse'),))
- responses = tuple(response_iterator)
-
- self.assertSequenceEqual(expected_responses, responses)
-
- def testSuccessfulStreamRequestBlockingUnaryResponse(self):
- requests = tuple(
- b'\x07\x08' for _ in range(test_constants.STREAM_LENGTH))
- expected_response = self._handler.handle_stream_unary(
- iter(requests), None)
- request_iterator = iter(requests)
-
- multi_callable = stream_unary_multi_callable(self._channel)
- response = multi_callable(
- request_iterator,
- metadata=(('test',
- 'SuccessfulStreamRequestBlockingUnaryResponse'),))
-
- self.assertEqual(expected_response, response)
-
- def testSuccessfulStreamRequestBlockingUnaryResponseWithCall(self):
- requests = tuple(
- b'\x07\x08' for _ in range(test_constants.STREAM_LENGTH))
- expected_response = self._handler.handle_stream_unary(
- iter(requests), None)
- request_iterator = iter(requests)
-
- multi_callable = stream_unary_multi_callable(self._channel)
- response, call = multi_callable.with_call(
- request_iterator,
- metadata=(
- ('test',
- 'SuccessfulStreamRequestBlockingUnaryResponseWithCall'),))
-
- self.assertEqual(expected_response, response)
- self.assertIs(grpc.StatusCode.OK, call.code())
-
- def testSuccessfulStreamRequestFutureUnaryResponse(self):
- requests = tuple(
- b'\x07\x08' for _ in range(test_constants.STREAM_LENGTH))
- expected_response = self._handler.handle_stream_unary(
- iter(requests), None)
- request_iterator = iter(requests)
-
- multi_callable = stream_unary_multi_callable(self._channel)
- response_future = multi_callable.future(
- request_iterator,
- metadata=(('test', 'SuccessfulStreamRequestFutureUnaryResponse'),))
- response = response_future.result()
-
- self.assertEqual(expected_response, response)
- self.assertIsNone(response_future.exception())
- self.assertIsNone(response_future.traceback())
-
- def testSuccessfulStreamRequestStreamResponse(self):
- requests = tuple(
- b'\x77\x58' for _ in range(test_constants.STREAM_LENGTH))
-
- expected_responses = tuple(
- self._handler.handle_stream_stream(iter(requests), None))
- request_iterator = iter(requests)
-
- multi_callable = stream_stream_multi_callable(self._channel)
- response_iterator = multi_callable(
- request_iterator,
- metadata=(('test', 'SuccessfulStreamRequestStreamResponse'),))
- responses = tuple(response_iterator)
-
- self.assertSequenceEqual(expected_responses, responses)
-
- def testSequentialInvocations(self):
- first_request = b'\x07\x08'
- second_request = b'\x0809'
- expected_first_response = self._handler.handle_unary_unary(
- first_request, None)
- expected_second_response = self._handler.handle_unary_unary(
- second_request, None)
-
- multi_callable = unary_unary_multi_callable(self._channel)
- first_response = multi_callable(first_request,
- metadata=(('test',
- 'SequentialInvocations'),))
- second_response = multi_callable(second_request,
- metadata=(('test',
- 'SequentialInvocations'),))
-
- self.assertEqual(expected_first_response, first_response)
- self.assertEqual(expected_second_response, second_response)
-
- def testConcurrentBlockingInvocations(self):
- pool = logging_pool.pool(test_constants.THREAD_CONCURRENCY)
- requests = tuple(
- b'\x07\x08' for _ in range(test_constants.STREAM_LENGTH))
- expected_response = self._handler.handle_stream_unary(
- iter(requests), None)
- expected_responses = [expected_response
- ] * test_constants.THREAD_CONCURRENCY
- response_futures = [None] * test_constants.THREAD_CONCURRENCY
-
- multi_callable = stream_unary_multi_callable(self._channel)
- for index in range(test_constants.THREAD_CONCURRENCY):
- request_iterator = iter(requests)
- response_future = pool.submit(
- multi_callable,
- request_iterator,
- metadata=(('test', 'ConcurrentBlockingInvocations'),))
- response_futures[index] = response_future
- responses = tuple(
- response_future.result() for response_future in response_futures)
-
- pool.shutdown(wait=True)
- self.assertSequenceEqual(expected_responses, responses)
-
- def testConcurrentFutureInvocations(self):
- requests = tuple(
- b'\x07\x08' for _ in range(test_constants.STREAM_LENGTH))
- expected_response = self._handler.handle_stream_unary(
- iter(requests), None)
- expected_responses = [expected_response
- ] * test_constants.THREAD_CONCURRENCY
- response_futures = [None] * test_constants.THREAD_CONCURRENCY
-
- multi_callable = stream_unary_multi_callable(self._channel)
- for index in range(test_constants.THREAD_CONCURRENCY):
- request_iterator = iter(requests)
- response_future = multi_callable.future(
- request_iterator,
- metadata=(('test', 'ConcurrentFutureInvocations'),))
- response_futures[index] = response_future
- responses = tuple(
- response_future.result() for response_future in response_futures)
-
- self.assertSequenceEqual(expected_responses, responses)
-
- def testWaitingForSomeButNotAllConcurrentFutureInvocations(self):
- pool = logging_pool.pool(test_constants.THREAD_CONCURRENCY)
- request = b'\x67\x68'
- expected_response = self._handler.handle_unary_unary(request, None)
- response_futures = [None] * test_constants.THREAD_CONCURRENCY
- lock = threading.Lock()
- test_is_running_cell = [True]
-
- def wrap_future(future):
-
- def wrap():
- try:
- return future.result()
- except grpc.RpcError:
- with lock:
- if test_is_running_cell[0]:
- raise
- return None
-
- return wrap
-
- multi_callable = unary_unary_multi_callable(self._channel)
- for index in range(test_constants.THREAD_CONCURRENCY):
- inner_response_future = multi_callable.future(
- request,
- metadata=(
- ('test',
- 'WaitingForSomeButNotAllConcurrentFutureInvocations'),))
- outer_response_future = pool.submit(
- wrap_future(inner_response_future))
- response_futures[index] = outer_response_future
-
- some_completed_response_futures_iterator = itertools.islice(
- futures.as_completed(response_futures),
- test_constants.THREAD_CONCURRENCY // 2)
- for response_future in some_completed_response_futures_iterator:
- self.assertEqual(expected_response, response_future.result())
- with lock:
- test_is_running_cell[0] = False
-
- def testConsumingOneStreamResponseUnaryRequest(self):
- self._consume_one_stream_response_unary_request(
- unary_stream_multi_callable(self._channel))
-
- def testConsumingOneStreamResponseUnaryRequestNonBlocking(self):
- self._consume_one_stream_response_unary_request(
- unary_stream_non_blocking_multi_callable(self._channel))
-
- def testConsumingSomeButNotAllStreamResponsesUnaryRequest(self):
- self._consume_some_but_not_all_stream_responses_unary_request(
- unary_stream_multi_callable(self._channel))
-
- def testConsumingSomeButNotAllStreamResponsesUnaryRequestNonBlocking(self):
- self._consume_some_but_not_all_stream_responses_unary_request(
- unary_stream_non_blocking_multi_callable(self._channel))
-
- def testConsumingSomeButNotAllStreamResponsesStreamRequest(self):
- self._consume_some_but_not_all_stream_responses_stream_request(
- stream_stream_multi_callable(self._channel))
-
- def testConsumingSomeButNotAllStreamResponsesStreamRequestNonBlocking(self):
- self._consume_some_but_not_all_stream_responses_stream_request(
- stream_stream_non_blocking_multi_callable(self._channel))
-
- def testConsumingTooManyStreamResponsesStreamRequest(self):
- self._consume_too_many_stream_responses_stream_request(
- stream_stream_multi_callable(self._channel))
-
- def testConsumingTooManyStreamResponsesStreamRequestNonBlocking(self):
- self._consume_too_many_stream_responses_stream_request(
- stream_stream_non_blocking_multi_callable(self._channel))
-
- def testCancelledUnaryRequestUnaryResponse(self):
- request = b'\x07\x17'
-
- multi_callable = unary_unary_multi_callable(self._channel)
- with self._control.pause():
- response_future = multi_callable.future(
- request,
- metadata=(('test', 'CancelledUnaryRequestUnaryResponse'),))
- response_future.cancel()
-
- self.assertIs(grpc.StatusCode.CANCELLED, response_future.code())
- self.assertTrue(response_future.cancelled())
- with self.assertRaises(grpc.FutureCancelledError):
- response_future.result()
- with self.assertRaises(grpc.FutureCancelledError):
- response_future.exception()
- with self.assertRaises(grpc.FutureCancelledError):
- response_future.traceback()
-
- def testCancelledUnaryRequestStreamResponse(self):
- self._cancelled_unary_request_stream_response(
- unary_stream_multi_callable(self._channel))
-
- def testCancelledUnaryRequestStreamResponseNonBlocking(self):
- self._cancelled_unary_request_stream_response(
- unary_stream_non_blocking_multi_callable(self._channel))
-
- def testCancelledStreamRequestUnaryResponse(self):
- requests = tuple(
- b'\x07\x08' for _ in range(test_constants.STREAM_LENGTH))
- request_iterator = iter(requests)
-
- multi_callable = stream_unary_multi_callable(self._channel)
- with self._control.pause():
- response_future = multi_callable.future(
- request_iterator,
- metadata=(('test', 'CancelledStreamRequestUnaryResponse'),))
- self._control.block_until_paused()
- response_future.cancel()
-
- self.assertIs(grpc.StatusCode.CANCELLED, response_future.code())
- self.assertTrue(response_future.cancelled())
- with self.assertRaises(grpc.FutureCancelledError):
- response_future.result()
- with self.assertRaises(grpc.FutureCancelledError):
- response_future.exception()
- with self.assertRaises(grpc.FutureCancelledError):
- response_future.traceback()
- self.assertIsNotNone(response_future.initial_metadata())
- self.assertIsNotNone(response_future.details())
- self.assertIsNotNone(response_future.trailing_metadata())
-
- def testCancelledStreamRequestStreamResponse(self):
- self._cancelled_stream_request_stream_response(
- stream_stream_multi_callable(self._channel))
-
- def testCancelledStreamRequestStreamResponseNonBlocking(self):
- self._cancelled_stream_request_stream_response(
- stream_stream_non_blocking_multi_callable(self._channel))
-
- def testExpiredUnaryRequestBlockingUnaryResponse(self):
- request = b'\x07\x17'
-
- multi_callable = unary_unary_multi_callable(self._channel)
- with self._control.pause():
- with self.assertRaises(grpc.RpcError) as exception_context:
- multi_callable.with_call(
- request,
- timeout=TIMEOUT_SHORT,
- metadata=(('test',
- 'ExpiredUnaryRequestBlockingUnaryResponse'),))
-
- self.assertIsInstance(exception_context.exception, grpc.Call)
- self.assertIsNotNone(exception_context.exception.initial_metadata())
- self.assertIs(grpc.StatusCode.DEADLINE_EXCEEDED,
- exception_context.exception.code())
- self.assertIsNotNone(exception_context.exception.details())
- self.assertIsNotNone(exception_context.exception.trailing_metadata())
-
- def testExpiredUnaryRequestFutureUnaryResponse(self):
- request = b'\x07\x17'
- callback = Callback()
-
- multi_callable = unary_unary_multi_callable(self._channel)
- with self._control.pause():
- response_future = multi_callable.future(
- request,
- timeout=TIMEOUT_SHORT,
- metadata=(('test', 'ExpiredUnaryRequestFutureUnaryResponse'),))
- response_future.add_done_callback(callback)
- value_passed_to_callback = callback.value()
-
- self.assertIs(response_future, value_passed_to_callback)
- self.assertIsNotNone(response_future.initial_metadata())
- self.assertIs(grpc.StatusCode.DEADLINE_EXCEEDED, response_future.code())
- self.assertIsNotNone(response_future.details())
- self.assertIsNotNone(response_future.trailing_metadata())
- with self.assertRaises(grpc.RpcError) as exception_context:
- response_future.result()
- self.assertIs(grpc.StatusCode.DEADLINE_EXCEEDED,
- exception_context.exception.code())
- self.assertIsInstance(response_future.exception(), grpc.RpcError)
- self.assertIsNotNone(response_future.traceback())
- self.assertIs(grpc.StatusCode.DEADLINE_EXCEEDED,
- response_future.exception().code())
-
- def testExpiredUnaryRequestStreamResponse(self):
- self._expired_unary_request_stream_response(
- unary_stream_multi_callable(self._channel))
-
- def testExpiredUnaryRequestStreamResponseNonBlocking(self):
- self._expired_unary_request_stream_response(
- unary_stream_non_blocking_multi_callable(self._channel))
-
-
-if __name__ == '__main__':
- logging.basicConfig()
- unittest.main(verbosity=2)
+# Copyright 2016 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+"""Test of RPCs made against gRPC Python's application-layer API."""
+
+import itertools
+import threading
+import unittest
+import logging
+from concurrent import futures
+
+import grpc
+from grpc.framework.foundation import logging_pool
+
+from tests.unit._rpc_test_helpers import (
+ TIMEOUT_SHORT, Callback, unary_unary_multi_callable,
+ unary_stream_multi_callable, unary_stream_non_blocking_multi_callable,
+ stream_unary_multi_callable, stream_stream_multi_callable,
+ stream_stream_non_blocking_multi_callable, BaseRPCTest)
+from tests.unit.framework.common import test_constants
+
+
+class RPCPart2Test(BaseRPCTest, unittest.TestCase):
+
+ def testDefaultThreadPoolIsUsed(self):
+ self._consume_one_stream_response_unary_request(
+ unary_stream_multi_callable(self._channel))
+ self.assertFalse(self._thread_pool.was_used())
+
+ def testExperimentalThreadPoolIsUsed(self):
+ self._consume_one_stream_response_unary_request(
+ unary_stream_non_blocking_multi_callable(self._channel))
+ self.assertTrue(self._thread_pool.was_used())
+
+ def testUnrecognizedMethod(self):
+ request = b'abc'
+
+ with self.assertRaises(grpc.RpcError) as exception_context:
+ self._channel.unary_unary('NoSuchMethod')(request)
+
+ self.assertEqual(grpc.StatusCode.UNIMPLEMENTED,
+ exception_context.exception.code())
+
+ def testSuccessfulUnaryRequestBlockingUnaryResponse(self):
+ request = b'\x07\x08'
+ expected_response = self._handler.handle_unary_unary(request, None)
+
+ multi_callable = unary_unary_multi_callable(self._channel)
+ response = multi_callable(
+ request,
+ metadata=(('test', 'SuccessfulUnaryRequestBlockingUnaryResponse'),))
+
+ self.assertEqual(expected_response, response)
+
+ def testSuccessfulUnaryRequestBlockingUnaryResponseWithCall(self):
+ request = b'\x07\x08'
+ expected_response = self._handler.handle_unary_unary(request, None)
+
+ multi_callable = unary_unary_multi_callable(self._channel)
+ response, call = multi_callable.with_call(
+ request,
+ metadata=(('test',
+ 'SuccessfulUnaryRequestBlockingUnaryResponseWithCall'),))
+
+ self.assertEqual(expected_response, response)
+ self.assertIs(grpc.StatusCode.OK, call.code())
+ self.assertEqual('', call.debug_error_string())
+
+ def testSuccessfulUnaryRequestFutureUnaryResponse(self):
+ request = b'\x07\x08'
+ expected_response = self._handler.handle_unary_unary(request, None)
+
+ multi_callable = unary_unary_multi_callable(self._channel)
+ response_future = multi_callable.future(
+ request,
+ metadata=(('test', 'SuccessfulUnaryRequestFutureUnaryResponse'),))
+ response = response_future.result()
+
+ self.assertIsInstance(response_future, grpc.Future)
+ self.assertIsInstance(response_future, grpc.Call)
+ self.assertEqual(expected_response, response)
+ self.assertIsNone(response_future.exception())
+ self.assertIsNone(response_future.traceback())
+
+ def testSuccessfulUnaryRequestStreamResponse(self):
+ request = b'\x37\x58'
+ expected_responses = tuple(
+ self._handler.handle_unary_stream(request, None))
+
+ multi_callable = unary_stream_multi_callable(self._channel)
+ response_iterator = multi_callable(
+ request,
+ metadata=(('test', 'SuccessfulUnaryRequestStreamResponse'),))
+ responses = tuple(response_iterator)
+
+ self.assertSequenceEqual(expected_responses, responses)
+
+ def testSuccessfulStreamRequestBlockingUnaryResponse(self):
+ requests = tuple(
+ b'\x07\x08' for _ in range(test_constants.STREAM_LENGTH))
+ expected_response = self._handler.handle_stream_unary(
+ iter(requests), None)
+ request_iterator = iter(requests)
+
+ multi_callable = stream_unary_multi_callable(self._channel)
+ response = multi_callable(
+ request_iterator,
+ metadata=(('test',
+ 'SuccessfulStreamRequestBlockingUnaryResponse'),))
+
+ self.assertEqual(expected_response, response)
+
+ def testSuccessfulStreamRequestBlockingUnaryResponseWithCall(self):
+ requests = tuple(
+ b'\x07\x08' for _ in range(test_constants.STREAM_LENGTH))
+ expected_response = self._handler.handle_stream_unary(
+ iter(requests), None)
+ request_iterator = iter(requests)
+
+ multi_callable = stream_unary_multi_callable(self._channel)
+ response, call = multi_callable.with_call(
+ request_iterator,
+ metadata=(
+ ('test',
+ 'SuccessfulStreamRequestBlockingUnaryResponseWithCall'),))
+
+ self.assertEqual(expected_response, response)
+ self.assertIs(grpc.StatusCode.OK, call.code())
+
+ def testSuccessfulStreamRequestFutureUnaryResponse(self):
+ requests = tuple(
+ b'\x07\x08' for _ in range(test_constants.STREAM_LENGTH))
+ expected_response = self._handler.handle_stream_unary(
+ iter(requests), None)
+ request_iterator = iter(requests)
+
+ multi_callable = stream_unary_multi_callable(self._channel)
+ response_future = multi_callable.future(
+ request_iterator,
+ metadata=(('test', 'SuccessfulStreamRequestFutureUnaryResponse'),))
+ response = response_future.result()
+
+ self.assertEqual(expected_response, response)
+ self.assertIsNone(response_future.exception())
+ self.assertIsNone(response_future.traceback())
+
+ def testSuccessfulStreamRequestStreamResponse(self):
+ requests = tuple(
+ b'\x77\x58' for _ in range(test_constants.STREAM_LENGTH))
+
+ expected_responses = tuple(
+ self._handler.handle_stream_stream(iter(requests), None))
+ request_iterator = iter(requests)
+
+ multi_callable = stream_stream_multi_callable(self._channel)
+ response_iterator = multi_callable(
+ request_iterator,
+ metadata=(('test', 'SuccessfulStreamRequestStreamResponse'),))
+ responses = tuple(response_iterator)
+
+ self.assertSequenceEqual(expected_responses, responses)
+
+ def testSequentialInvocations(self):
+ first_request = b'\x07\x08'
+ second_request = b'\x0809'
+ expected_first_response = self._handler.handle_unary_unary(
+ first_request, None)
+ expected_second_response = self._handler.handle_unary_unary(
+ second_request, None)
+
+ multi_callable = unary_unary_multi_callable(self._channel)
+ first_response = multi_callable(first_request,
+ metadata=(('test',
+ 'SequentialInvocations'),))
+ second_response = multi_callable(second_request,
+ metadata=(('test',
+ 'SequentialInvocations'),))
+
+ self.assertEqual(expected_first_response, first_response)
+ self.assertEqual(expected_second_response, second_response)
+
+ def testConcurrentBlockingInvocations(self):
+ pool = logging_pool.pool(test_constants.THREAD_CONCURRENCY)
+ requests = tuple(
+ b'\x07\x08' for _ in range(test_constants.STREAM_LENGTH))
+ expected_response = self._handler.handle_stream_unary(
+ iter(requests), None)
+ expected_responses = [expected_response
+ ] * test_constants.THREAD_CONCURRENCY
+ response_futures = [None] * test_constants.THREAD_CONCURRENCY
+
+ multi_callable = stream_unary_multi_callable(self._channel)
+ for index in range(test_constants.THREAD_CONCURRENCY):
+ request_iterator = iter(requests)
+ response_future = pool.submit(
+ multi_callable,
+ request_iterator,
+ metadata=(('test', 'ConcurrentBlockingInvocations'),))
+ response_futures[index] = response_future
+ responses = tuple(
+ response_future.result() for response_future in response_futures)
+
+ pool.shutdown(wait=True)
+ self.assertSequenceEqual(expected_responses, responses)
+
+ def testConcurrentFutureInvocations(self):
+ requests = tuple(
+ b'\x07\x08' for _ in range(test_constants.STREAM_LENGTH))
+ expected_response = self._handler.handle_stream_unary(
+ iter(requests), None)
+ expected_responses = [expected_response
+ ] * test_constants.THREAD_CONCURRENCY
+ response_futures = [None] * test_constants.THREAD_CONCURRENCY
+
+ multi_callable = stream_unary_multi_callable(self._channel)
+ for index in range(test_constants.THREAD_CONCURRENCY):
+ request_iterator = iter(requests)
+ response_future = multi_callable.future(
+ request_iterator,
+ metadata=(('test', 'ConcurrentFutureInvocations'),))
+ response_futures[index] = response_future
+ responses = tuple(
+ response_future.result() for response_future in response_futures)
+
+ self.assertSequenceEqual(expected_responses, responses)
+
+ def testWaitingForSomeButNotAllConcurrentFutureInvocations(self):
+ pool = logging_pool.pool(test_constants.THREAD_CONCURRENCY)
+ request = b'\x67\x68'
+ expected_response = self._handler.handle_unary_unary(request, None)
+ response_futures = [None] * test_constants.THREAD_CONCURRENCY
+ lock = threading.Lock()
+ test_is_running_cell = [True]
+
+ def wrap_future(future):
+
+ def wrap():
+ try:
+ return future.result()
+ except grpc.RpcError:
+ with lock:
+ if test_is_running_cell[0]:
+ raise
+ return None
+
+ return wrap
+
+ multi_callable = unary_unary_multi_callable(self._channel)
+ for index in range(test_constants.THREAD_CONCURRENCY):
+ inner_response_future = multi_callable.future(
+ request,
+ metadata=(
+ ('test',
+ 'WaitingForSomeButNotAllConcurrentFutureInvocations'),))
+ outer_response_future = pool.submit(
+ wrap_future(inner_response_future))
+ response_futures[index] = outer_response_future
+
+ some_completed_response_futures_iterator = itertools.islice(
+ futures.as_completed(response_futures),
+ test_constants.THREAD_CONCURRENCY // 2)
+ for response_future in some_completed_response_futures_iterator:
+ self.assertEqual(expected_response, response_future.result())
+ with lock:
+ test_is_running_cell[0] = False
+
+ def testConsumingOneStreamResponseUnaryRequest(self):
+ self._consume_one_stream_response_unary_request(
+ unary_stream_multi_callable(self._channel))
+
+ def testConsumingOneStreamResponseUnaryRequestNonBlocking(self):
+ self._consume_one_stream_response_unary_request(
+ unary_stream_non_blocking_multi_callable(self._channel))
+
+ def testConsumingSomeButNotAllStreamResponsesUnaryRequest(self):
+ self._consume_some_but_not_all_stream_responses_unary_request(
+ unary_stream_multi_callable(self._channel))
+
+ def testConsumingSomeButNotAllStreamResponsesUnaryRequestNonBlocking(self):
+ self._consume_some_but_not_all_stream_responses_unary_request(
+ unary_stream_non_blocking_multi_callable(self._channel))
+
+ def testConsumingSomeButNotAllStreamResponsesStreamRequest(self):
+ self._consume_some_but_not_all_stream_responses_stream_request(
+ stream_stream_multi_callable(self._channel))
+
+ def testConsumingSomeButNotAllStreamResponsesStreamRequestNonBlocking(self):
+ self._consume_some_but_not_all_stream_responses_stream_request(
+ stream_stream_non_blocking_multi_callable(self._channel))
+
+ def testConsumingTooManyStreamResponsesStreamRequest(self):
+ self._consume_too_many_stream_responses_stream_request(
+ stream_stream_multi_callable(self._channel))
+
+ def testConsumingTooManyStreamResponsesStreamRequestNonBlocking(self):
+ self._consume_too_many_stream_responses_stream_request(
+ stream_stream_non_blocking_multi_callable(self._channel))
+
+ def testCancelledUnaryRequestUnaryResponse(self):
+ request = b'\x07\x17'
+
+ multi_callable = unary_unary_multi_callable(self._channel)
+ with self._control.pause():
+ response_future = multi_callable.future(
+ request,
+ metadata=(('test', 'CancelledUnaryRequestUnaryResponse'),))
+ response_future.cancel()
+
+ self.assertIs(grpc.StatusCode.CANCELLED, response_future.code())
+ self.assertTrue(response_future.cancelled())
+ with self.assertRaises(grpc.FutureCancelledError):
+ response_future.result()
+ with self.assertRaises(grpc.FutureCancelledError):
+ response_future.exception()
+ with self.assertRaises(grpc.FutureCancelledError):
+ response_future.traceback()
+
+ def testCancelledUnaryRequestStreamResponse(self):
+ self._cancelled_unary_request_stream_response(
+ unary_stream_multi_callable(self._channel))
+
+ def testCancelledUnaryRequestStreamResponseNonBlocking(self):
+ self._cancelled_unary_request_stream_response(
+ unary_stream_non_blocking_multi_callable(self._channel))
+
+ def testCancelledStreamRequestUnaryResponse(self):
+ requests = tuple(
+ b'\x07\x08' for _ in range(test_constants.STREAM_LENGTH))
+ request_iterator = iter(requests)
+
+ multi_callable = stream_unary_multi_callable(self._channel)
+ with self._control.pause():
+ response_future = multi_callable.future(
+ request_iterator,
+ metadata=(('test', 'CancelledStreamRequestUnaryResponse'),))
+ self._control.block_until_paused()
+ response_future.cancel()
+
+ self.assertIs(grpc.StatusCode.CANCELLED, response_future.code())
+ self.assertTrue(response_future.cancelled())
+ with self.assertRaises(grpc.FutureCancelledError):
+ response_future.result()
+ with self.assertRaises(grpc.FutureCancelledError):
+ response_future.exception()
+ with self.assertRaises(grpc.FutureCancelledError):
+ response_future.traceback()
+ self.assertIsNotNone(response_future.initial_metadata())
+ self.assertIsNotNone(response_future.details())
+ self.assertIsNotNone(response_future.trailing_metadata())
+
+ def testCancelledStreamRequestStreamResponse(self):
+ self._cancelled_stream_request_stream_response(
+ stream_stream_multi_callable(self._channel))
+
+ def testCancelledStreamRequestStreamResponseNonBlocking(self):
+ self._cancelled_stream_request_stream_response(
+ stream_stream_non_blocking_multi_callable(self._channel))
+
+ def testExpiredUnaryRequestBlockingUnaryResponse(self):
+ request = b'\x07\x17'
+
+ multi_callable = unary_unary_multi_callable(self._channel)
+ with self._control.pause():
+ with self.assertRaises(grpc.RpcError) as exception_context:
+ multi_callable.with_call(
+ request,
+ timeout=TIMEOUT_SHORT,
+ metadata=(('test',
+ 'ExpiredUnaryRequestBlockingUnaryResponse'),))
+
+ self.assertIsInstance(exception_context.exception, grpc.Call)
+ self.assertIsNotNone(exception_context.exception.initial_metadata())
+ self.assertIs(grpc.StatusCode.DEADLINE_EXCEEDED,
+ exception_context.exception.code())
+ self.assertIsNotNone(exception_context.exception.details())
+ self.assertIsNotNone(exception_context.exception.trailing_metadata())
+
+ def testExpiredUnaryRequestFutureUnaryResponse(self):
+ request = b'\x07\x17'
+ callback = Callback()
+
+ multi_callable = unary_unary_multi_callable(self._channel)
+ with self._control.pause():
+ response_future = multi_callable.future(
+ request,
+ timeout=TIMEOUT_SHORT,
+ metadata=(('test', 'ExpiredUnaryRequestFutureUnaryResponse'),))
+ response_future.add_done_callback(callback)
+ value_passed_to_callback = callback.value()
+
+ self.assertIs(response_future, value_passed_to_callback)
+ self.assertIsNotNone(response_future.initial_metadata())
+ self.assertIs(grpc.StatusCode.DEADLINE_EXCEEDED, response_future.code())
+ self.assertIsNotNone(response_future.details())
+ self.assertIsNotNone(response_future.trailing_metadata())
+ with self.assertRaises(grpc.RpcError) as exception_context:
+ response_future.result()
+ self.assertIs(grpc.StatusCode.DEADLINE_EXCEEDED,
+ exception_context.exception.code())
+ self.assertIsInstance(response_future.exception(), grpc.RpcError)
+ self.assertIsNotNone(response_future.traceback())
+ self.assertIs(grpc.StatusCode.DEADLINE_EXCEEDED,
+ response_future.exception().code())
+
+ def testExpiredUnaryRequestStreamResponse(self):
+ self._expired_unary_request_stream_response(
+ unary_stream_multi_callable(self._channel))
+
+ def testExpiredUnaryRequestStreamResponseNonBlocking(self):
+ self._expired_unary_request_stream_response(
+ unary_stream_non_blocking_multi_callable(self._channel))
+
+
+if __name__ == '__main__':
+ logging.basicConfig()
+ unittest.main(verbosity=2)
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_rpc_test_helpers.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_rpc_test_helpers.py
index e66e99f0a78..a3f18a9a490 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_rpc_test_helpers.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_rpc_test_helpers.py
@@ -1,417 +1,417 @@
-# Copyright 2020 The gRPC Authors
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-"""Test helpers for RPC invocation tests."""
-
-import datetime
-import threading
-
-import grpc
-from grpc.framework.foundation import logging_pool
-
-from tests.unit import test_common
-from tests.unit import thread_pool
-from tests.unit.framework.common import test_constants
-from tests.unit.framework.common import test_control
-
-_SERIALIZE_REQUEST = lambda bytestring: bytestring * 2
-_DESERIALIZE_REQUEST = lambda bytestring: bytestring[len(bytestring) // 2:]
-_SERIALIZE_RESPONSE = lambda bytestring: bytestring * 3
-_DESERIALIZE_RESPONSE = lambda bytestring: bytestring[:len(bytestring) // 3]
-
-_UNARY_UNARY = '/test/UnaryUnary'
-_UNARY_STREAM = '/test/UnaryStream'
-_UNARY_STREAM_NON_BLOCKING = '/test/UnaryStreamNonBlocking'
-_STREAM_UNARY = '/test/StreamUnary'
-_STREAM_STREAM = '/test/StreamStream'
-_STREAM_STREAM_NON_BLOCKING = '/test/StreamStreamNonBlocking'
-
-TIMEOUT_SHORT = datetime.timedelta(seconds=1).total_seconds()
-
-
-class Callback(object):
-
- def __init__(self):
- self._condition = threading.Condition()
- self._value = None
- self._called = False
-
- def __call__(self, value):
- with self._condition:
- self._value = value
- self._called = True
- self._condition.notify_all()
-
- def value(self):
- with self._condition:
- while not self._called:
- self._condition.wait()
- return self._value
-
-
-class _Handler(object):
-
- def __init__(self, control, thread_pool):
- self._control = control
- self._thread_pool = thread_pool
- non_blocking_functions = (self.handle_unary_stream_non_blocking,
- self.handle_stream_stream_non_blocking)
- for non_blocking_function in non_blocking_functions:
- non_blocking_function.__func__.experimental_non_blocking = True
- non_blocking_function.__func__.experimental_thread_pool = self._thread_pool
-
- def handle_unary_unary(self, request, servicer_context):
- self._control.control()
- if servicer_context is not None:
- servicer_context.set_trailing_metadata(((
- 'testkey',
- 'testvalue',
- ),))
- # TODO(https://github.com/grpc/grpc/issues/8483): test the values
- # returned by these methods rather than only "smoke" testing that
- # the return after having been called.
- servicer_context.is_active()
- servicer_context.time_remaining()
- return request
-
- def handle_unary_stream(self, request, servicer_context):
- for _ in range(test_constants.STREAM_LENGTH):
- self._control.control()
- yield request
- self._control.control()
- if servicer_context is not None:
- servicer_context.set_trailing_metadata(((
- 'testkey',
- 'testvalue',
- ),))
-
- def handle_unary_stream_non_blocking(self, request, servicer_context,
- on_next):
- for _ in range(test_constants.STREAM_LENGTH):
- self._control.control()
- on_next(request)
- self._control.control()
- if servicer_context is not None:
- servicer_context.set_trailing_metadata(((
- 'testkey',
- 'testvalue',
- ),))
- on_next(None)
-
- def handle_stream_unary(self, request_iterator, servicer_context):
- if servicer_context is not None:
- servicer_context.invocation_metadata()
- self._control.control()
- response_elements = []
- for request in request_iterator:
- self._control.control()
- response_elements.append(request)
- self._control.control()
- if servicer_context is not None:
- servicer_context.set_trailing_metadata(((
- 'testkey',
- 'testvalue',
- ),))
- return b''.join(response_elements)
-
- def handle_stream_stream(self, request_iterator, servicer_context):
- self._control.control()
- if servicer_context is not None:
- servicer_context.set_trailing_metadata(((
- 'testkey',
- 'testvalue',
- ),))
- for request in request_iterator:
- self._control.control()
- yield request
- self._control.control()
-
- def handle_stream_stream_non_blocking(self, request_iterator,
- servicer_context, on_next):
- self._control.control()
- if servicer_context is not None:
- servicer_context.set_trailing_metadata(((
- 'testkey',
- 'testvalue',
- ),))
- for request in request_iterator:
- self._control.control()
- on_next(request)
- self._control.control()
- on_next(None)
-
-
-class _MethodHandler(grpc.RpcMethodHandler):
-
- def __init__(self, request_streaming, response_streaming,
- request_deserializer, response_serializer, unary_unary,
- unary_stream, stream_unary, stream_stream):
- self.request_streaming = request_streaming
- self.response_streaming = response_streaming
- self.request_deserializer = request_deserializer
- self.response_serializer = response_serializer
- self.unary_unary = unary_unary
- self.unary_stream = unary_stream
- self.stream_unary = stream_unary
- self.stream_stream = stream_stream
-
-
-class _GenericHandler(grpc.GenericRpcHandler):
-
- def __init__(self, handler):
- self._handler = handler
-
- def service(self, handler_call_details):
- if handler_call_details.method == _UNARY_UNARY:
- return _MethodHandler(False, False, None, None,
- self._handler.handle_unary_unary, None, None,
- None)
- elif handler_call_details.method == _UNARY_STREAM:
- return _MethodHandler(False, True, _DESERIALIZE_REQUEST,
- _SERIALIZE_RESPONSE, None,
- self._handler.handle_unary_stream, None, None)
- elif handler_call_details.method == _UNARY_STREAM_NON_BLOCKING:
- return _MethodHandler(
- False, True, _DESERIALIZE_REQUEST, _SERIALIZE_RESPONSE, None,
- self._handler.handle_unary_stream_non_blocking, None, None)
- elif handler_call_details.method == _STREAM_UNARY:
- return _MethodHandler(True, False, _DESERIALIZE_REQUEST,
- _SERIALIZE_RESPONSE, None, None,
- self._handler.handle_stream_unary, None)
- elif handler_call_details.method == _STREAM_STREAM:
- return _MethodHandler(True, True, None, None, None, None, None,
- self._handler.handle_stream_stream)
- elif handler_call_details.method == _STREAM_STREAM_NON_BLOCKING:
- return _MethodHandler(
- True, True, None, None, None, None, None,
- self._handler.handle_stream_stream_non_blocking)
- else:
- return None
-
-
-def unary_unary_multi_callable(channel):
- return channel.unary_unary(_UNARY_UNARY)
-
-
-def unary_stream_multi_callable(channel):
- return channel.unary_stream(_UNARY_STREAM,
- request_serializer=_SERIALIZE_REQUEST,
- response_deserializer=_DESERIALIZE_RESPONSE)
-
-
-def unary_stream_non_blocking_multi_callable(channel):
- return channel.unary_stream(_UNARY_STREAM_NON_BLOCKING,
- request_serializer=_SERIALIZE_REQUEST,
- response_deserializer=_DESERIALIZE_RESPONSE)
-
-
-def stream_unary_multi_callable(channel):
- return channel.stream_unary(_STREAM_UNARY,
- request_serializer=_SERIALIZE_REQUEST,
- response_deserializer=_DESERIALIZE_RESPONSE)
-
-
-def stream_stream_multi_callable(channel):
- return channel.stream_stream(_STREAM_STREAM)
-
-
-def stream_stream_non_blocking_multi_callable(channel):
- return channel.stream_stream(_STREAM_STREAM_NON_BLOCKING)
-
-
-class BaseRPCTest(object):
-
- def setUp(self):
- self._control = test_control.PauseFailControl()
- self._thread_pool = thread_pool.RecordingThreadPool(max_workers=None)
- self._handler = _Handler(self._control, self._thread_pool)
-
- self._server = test_common.test_server()
- port = self._server.add_insecure_port('[::]:0')
- self._server.add_generic_rpc_handlers((_GenericHandler(self._handler),))
- self._server.start()
-
- self._channel = grpc.insecure_channel('localhost:%d' % port)
-
- def tearDown(self):
- self._server.stop(None)
- self._channel.close()
-
- def _consume_one_stream_response_unary_request(self, multi_callable):
- request = b'\x57\x38'
-
- response_iterator = multi_callable(
- request,
- metadata=(('test', 'ConsumingOneStreamResponseUnaryRequest'),))
- next(response_iterator)
-
- def _consume_some_but_not_all_stream_responses_unary_request(
- self, multi_callable):
- request = b'\x57\x38'
-
- response_iterator = multi_callable(
- request,
- metadata=(('test',
- 'ConsumingSomeButNotAllStreamResponsesUnaryRequest'),))
- for _ in range(test_constants.STREAM_LENGTH // 2):
- next(response_iterator)
-
- def _consume_some_but_not_all_stream_responses_stream_request(
- self, multi_callable):
- requests = tuple(
- b'\x67\x88' for _ in range(test_constants.STREAM_LENGTH))
- request_iterator = iter(requests)
-
- response_iterator = multi_callable(
- request_iterator,
- metadata=(('test',
- 'ConsumingSomeButNotAllStreamResponsesStreamRequest'),))
- for _ in range(test_constants.STREAM_LENGTH // 2):
- next(response_iterator)
-
- def _consume_too_many_stream_responses_stream_request(self, multi_callable):
- requests = tuple(
- b'\x67\x88' for _ in range(test_constants.STREAM_LENGTH))
- request_iterator = iter(requests)
-
- response_iterator = multi_callable(
- request_iterator,
- metadata=(('test',
- 'ConsumingTooManyStreamResponsesStreamRequest'),))
- for _ in range(test_constants.STREAM_LENGTH):
- next(response_iterator)
- for _ in range(test_constants.STREAM_LENGTH):
- with self.assertRaises(StopIteration):
- next(response_iterator)
-
- self.assertIsNotNone(response_iterator.initial_metadata())
- self.assertIs(grpc.StatusCode.OK, response_iterator.code())
- self.assertIsNotNone(response_iterator.details())
- self.assertIsNotNone(response_iterator.trailing_metadata())
-
- def _cancelled_unary_request_stream_response(self, multi_callable):
- request = b'\x07\x19'
-
- with self._control.pause():
- response_iterator = multi_callable(
- request,
- metadata=(('test', 'CancelledUnaryRequestStreamResponse'),))
- self._control.block_until_paused()
- response_iterator.cancel()
-
- with self.assertRaises(grpc.RpcError) as exception_context:
- next(response_iterator)
- self.assertIs(grpc.StatusCode.CANCELLED,
- exception_context.exception.code())
- self.assertIsNotNone(response_iterator.initial_metadata())
- self.assertIs(grpc.StatusCode.CANCELLED, response_iterator.code())
- self.assertIsNotNone(response_iterator.details())
- self.assertIsNotNone(response_iterator.trailing_metadata())
-
- def _cancelled_stream_request_stream_response(self, multi_callable):
- requests = tuple(
- b'\x07\x08' for _ in range(test_constants.STREAM_LENGTH))
- request_iterator = iter(requests)
-
- with self._control.pause():
- response_iterator = multi_callable(
- request_iterator,
- metadata=(('test', 'CancelledStreamRequestStreamResponse'),))
- response_iterator.cancel()
-
- with self.assertRaises(grpc.RpcError):
- next(response_iterator)
- self.assertIsNotNone(response_iterator.initial_metadata())
- self.assertIs(grpc.StatusCode.CANCELLED, response_iterator.code())
- self.assertIsNotNone(response_iterator.details())
- self.assertIsNotNone(response_iterator.trailing_metadata())
-
- def _expired_unary_request_stream_response(self, multi_callable):
- request = b'\x07\x19'
-
- with self._control.pause():
- with self.assertRaises(grpc.RpcError) as exception_context:
- response_iterator = multi_callable(
- request,
- timeout=test_constants.SHORT_TIMEOUT,
- metadata=(('test', 'ExpiredUnaryRequestStreamResponse'),))
- next(response_iterator)
-
- self.assertIs(grpc.StatusCode.DEADLINE_EXCEEDED,
- exception_context.exception.code())
- self.assertIs(grpc.StatusCode.DEADLINE_EXCEEDED,
- response_iterator.code())
-
- def _expired_stream_request_stream_response(self, multi_callable):
- requests = tuple(
- b'\x67\x18' for _ in range(test_constants.STREAM_LENGTH))
- request_iterator = iter(requests)
-
- with self._control.pause():
- with self.assertRaises(grpc.RpcError) as exception_context:
- response_iterator = multi_callable(
- request_iterator,
- timeout=test_constants.SHORT_TIMEOUT,
- metadata=(('test', 'ExpiredStreamRequestStreamResponse'),))
- next(response_iterator)
-
- self.assertIs(grpc.StatusCode.DEADLINE_EXCEEDED,
- exception_context.exception.code())
- self.assertIs(grpc.StatusCode.DEADLINE_EXCEEDED,
- response_iterator.code())
-
- def _failed_unary_request_stream_response(self, multi_callable):
- request = b'\x37\x17'
-
- with self.assertRaises(grpc.RpcError) as exception_context:
- with self._control.fail():
- response_iterator = multi_callable(
- request,
- metadata=(('test', 'FailedUnaryRequestStreamResponse'),))
- next(response_iterator)
-
- self.assertIs(grpc.StatusCode.UNKNOWN,
- exception_context.exception.code())
-
- def _failed_stream_request_stream_response(self, multi_callable):
- requests = tuple(
- b'\x67\x88' for _ in range(test_constants.STREAM_LENGTH))
- request_iterator = iter(requests)
-
- with self._control.fail():
- with self.assertRaises(grpc.RpcError) as exception_context:
- response_iterator = multi_callable(
- request_iterator,
- metadata=(('test', 'FailedStreamRequestStreamResponse'),))
- tuple(response_iterator)
-
- self.assertIs(grpc.StatusCode.UNKNOWN,
- exception_context.exception.code())
- self.assertIs(grpc.StatusCode.UNKNOWN, response_iterator.code())
-
- def _ignored_unary_stream_request_future_unary_response(
- self, multi_callable):
- request = b'\x37\x17'
-
- multi_callable(request,
- metadata=(('test',
- 'IgnoredUnaryRequestStreamResponse'),))
-
- def _ignored_stream_request_stream_response(self, multi_callable):
- requests = tuple(
- b'\x67\x88' for _ in range(test_constants.STREAM_LENGTH))
- request_iterator = iter(requests)
-
- multi_callable(request_iterator,
- metadata=(('test',
- 'IgnoredStreamRequestStreamResponse'),))
+# Copyright 2020 The gRPC Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+"""Test helpers for RPC invocation tests."""
+
+import datetime
+import threading
+
+import grpc
+from grpc.framework.foundation import logging_pool
+
+from tests.unit import test_common
+from tests.unit import thread_pool
+from tests.unit.framework.common import test_constants
+from tests.unit.framework.common import test_control
+
+_SERIALIZE_REQUEST = lambda bytestring: bytestring * 2
+_DESERIALIZE_REQUEST = lambda bytestring: bytestring[len(bytestring) // 2:]
+_SERIALIZE_RESPONSE = lambda bytestring: bytestring * 3
+_DESERIALIZE_RESPONSE = lambda bytestring: bytestring[:len(bytestring) // 3]
+
+_UNARY_UNARY = '/test/UnaryUnary'
+_UNARY_STREAM = '/test/UnaryStream'
+_UNARY_STREAM_NON_BLOCKING = '/test/UnaryStreamNonBlocking'
+_STREAM_UNARY = '/test/StreamUnary'
+_STREAM_STREAM = '/test/StreamStream'
+_STREAM_STREAM_NON_BLOCKING = '/test/StreamStreamNonBlocking'
+
+TIMEOUT_SHORT = datetime.timedelta(seconds=1).total_seconds()
+
+
+class Callback(object):
+
+ def __init__(self):
+ self._condition = threading.Condition()
+ self._value = None
+ self._called = False
+
+ def __call__(self, value):
+ with self._condition:
+ self._value = value
+ self._called = True
+ self._condition.notify_all()
+
+ def value(self):
+ with self._condition:
+ while not self._called:
+ self._condition.wait()
+ return self._value
+
+
+class _Handler(object):
+
+ def __init__(self, control, thread_pool):
+ self._control = control
+ self._thread_pool = thread_pool
+ non_blocking_functions = (self.handle_unary_stream_non_blocking,
+ self.handle_stream_stream_non_blocking)
+ for non_blocking_function in non_blocking_functions:
+ non_blocking_function.__func__.experimental_non_blocking = True
+ non_blocking_function.__func__.experimental_thread_pool = self._thread_pool
+
+ def handle_unary_unary(self, request, servicer_context):
+ self._control.control()
+ if servicer_context is not None:
+ servicer_context.set_trailing_metadata(((
+ 'testkey',
+ 'testvalue',
+ ),))
+ # TODO(https://github.com/grpc/grpc/issues/8483): test the values
+ # returned by these methods rather than only "smoke" testing that
+ # the return after having been called.
+ servicer_context.is_active()
+ servicer_context.time_remaining()
+ return request
+
+ def handle_unary_stream(self, request, servicer_context):
+ for _ in range(test_constants.STREAM_LENGTH):
+ self._control.control()
+ yield request
+ self._control.control()
+ if servicer_context is not None:
+ servicer_context.set_trailing_metadata(((
+ 'testkey',
+ 'testvalue',
+ ),))
+
+ def handle_unary_stream_non_blocking(self, request, servicer_context,
+ on_next):
+ for _ in range(test_constants.STREAM_LENGTH):
+ self._control.control()
+ on_next(request)
+ self._control.control()
+ if servicer_context is not None:
+ servicer_context.set_trailing_metadata(((
+ 'testkey',
+ 'testvalue',
+ ),))
+ on_next(None)
+
+ def handle_stream_unary(self, request_iterator, servicer_context):
+ if servicer_context is not None:
+ servicer_context.invocation_metadata()
+ self._control.control()
+ response_elements = []
+ for request in request_iterator:
+ self._control.control()
+ response_elements.append(request)
+ self._control.control()
+ if servicer_context is not None:
+ servicer_context.set_trailing_metadata(((
+ 'testkey',
+ 'testvalue',
+ ),))
+ return b''.join(response_elements)
+
+ def handle_stream_stream(self, request_iterator, servicer_context):
+ self._control.control()
+ if servicer_context is not None:
+ servicer_context.set_trailing_metadata(((
+ 'testkey',
+ 'testvalue',
+ ),))
+ for request in request_iterator:
+ self._control.control()
+ yield request
+ self._control.control()
+
+ def handle_stream_stream_non_blocking(self, request_iterator,
+ servicer_context, on_next):
+ self._control.control()
+ if servicer_context is not None:
+ servicer_context.set_trailing_metadata(((
+ 'testkey',
+ 'testvalue',
+ ),))
+ for request in request_iterator:
+ self._control.control()
+ on_next(request)
+ self._control.control()
+ on_next(None)
+
+
+class _MethodHandler(grpc.RpcMethodHandler):
+
+ def __init__(self, request_streaming, response_streaming,
+ request_deserializer, response_serializer, unary_unary,
+ unary_stream, stream_unary, stream_stream):
+ self.request_streaming = request_streaming
+ self.response_streaming = response_streaming
+ self.request_deserializer = request_deserializer
+ self.response_serializer = response_serializer
+ self.unary_unary = unary_unary
+ self.unary_stream = unary_stream
+ self.stream_unary = stream_unary
+ self.stream_stream = stream_stream
+
+
+class _GenericHandler(grpc.GenericRpcHandler):
+
+ def __init__(self, handler):
+ self._handler = handler
+
+ def service(self, handler_call_details):
+ if handler_call_details.method == _UNARY_UNARY:
+ return _MethodHandler(False, False, None, None,
+ self._handler.handle_unary_unary, None, None,
+ None)
+ elif handler_call_details.method == _UNARY_STREAM:
+ return _MethodHandler(False, True, _DESERIALIZE_REQUEST,
+ _SERIALIZE_RESPONSE, None,
+ self._handler.handle_unary_stream, None, None)
+ elif handler_call_details.method == _UNARY_STREAM_NON_BLOCKING:
+ return _MethodHandler(
+ False, True, _DESERIALIZE_REQUEST, _SERIALIZE_RESPONSE, None,
+ self._handler.handle_unary_stream_non_blocking, None, None)
+ elif handler_call_details.method == _STREAM_UNARY:
+ return _MethodHandler(True, False, _DESERIALIZE_REQUEST,
+ _SERIALIZE_RESPONSE, None, None,
+ self._handler.handle_stream_unary, None)
+ elif handler_call_details.method == _STREAM_STREAM:
+ return _MethodHandler(True, True, None, None, None, None, None,
+ self._handler.handle_stream_stream)
+ elif handler_call_details.method == _STREAM_STREAM_NON_BLOCKING:
+ return _MethodHandler(
+ True, True, None, None, None, None, None,
+ self._handler.handle_stream_stream_non_blocking)
+ else:
+ return None
+
+
+def unary_unary_multi_callable(channel):
+ return channel.unary_unary(_UNARY_UNARY)
+
+
+def unary_stream_multi_callable(channel):
+ return channel.unary_stream(_UNARY_STREAM,
+ request_serializer=_SERIALIZE_REQUEST,
+ response_deserializer=_DESERIALIZE_RESPONSE)
+
+
+def unary_stream_non_blocking_multi_callable(channel):
+ return channel.unary_stream(_UNARY_STREAM_NON_BLOCKING,
+ request_serializer=_SERIALIZE_REQUEST,
+ response_deserializer=_DESERIALIZE_RESPONSE)
+
+
+def stream_unary_multi_callable(channel):
+ return channel.stream_unary(_STREAM_UNARY,
+ request_serializer=_SERIALIZE_REQUEST,
+ response_deserializer=_DESERIALIZE_RESPONSE)
+
+
+def stream_stream_multi_callable(channel):
+ return channel.stream_stream(_STREAM_STREAM)
+
+
+def stream_stream_non_blocking_multi_callable(channel):
+ return channel.stream_stream(_STREAM_STREAM_NON_BLOCKING)
+
+
+class BaseRPCTest(object):
+
+ def setUp(self):
+ self._control = test_control.PauseFailControl()
+ self._thread_pool = thread_pool.RecordingThreadPool(max_workers=None)
+ self._handler = _Handler(self._control, self._thread_pool)
+
+ self._server = test_common.test_server()
+ port = self._server.add_insecure_port('[::]:0')
+ self._server.add_generic_rpc_handlers((_GenericHandler(self._handler),))
+ self._server.start()
+
+ self._channel = grpc.insecure_channel('localhost:%d' % port)
+
+ def tearDown(self):
+ self._server.stop(None)
+ self._channel.close()
+
+ def _consume_one_stream_response_unary_request(self, multi_callable):
+ request = b'\x57\x38'
+
+ response_iterator = multi_callable(
+ request,
+ metadata=(('test', 'ConsumingOneStreamResponseUnaryRequest'),))
+ next(response_iterator)
+
+ def _consume_some_but_not_all_stream_responses_unary_request(
+ self, multi_callable):
+ request = b'\x57\x38'
+
+ response_iterator = multi_callable(
+ request,
+ metadata=(('test',
+ 'ConsumingSomeButNotAllStreamResponsesUnaryRequest'),))
+ for _ in range(test_constants.STREAM_LENGTH // 2):
+ next(response_iterator)
+
+ def _consume_some_but_not_all_stream_responses_stream_request(
+ self, multi_callable):
+ requests = tuple(
+ b'\x67\x88' for _ in range(test_constants.STREAM_LENGTH))
+ request_iterator = iter(requests)
+
+ response_iterator = multi_callable(
+ request_iterator,
+ metadata=(('test',
+ 'ConsumingSomeButNotAllStreamResponsesStreamRequest'),))
+ for _ in range(test_constants.STREAM_LENGTH // 2):
+ next(response_iterator)
+
+ def _consume_too_many_stream_responses_stream_request(self, multi_callable):
+ requests = tuple(
+ b'\x67\x88' for _ in range(test_constants.STREAM_LENGTH))
+ request_iterator = iter(requests)
+
+ response_iterator = multi_callable(
+ request_iterator,
+ metadata=(('test',
+ 'ConsumingTooManyStreamResponsesStreamRequest'),))
+ for _ in range(test_constants.STREAM_LENGTH):
+ next(response_iterator)
+ for _ in range(test_constants.STREAM_LENGTH):
+ with self.assertRaises(StopIteration):
+ next(response_iterator)
+
+ self.assertIsNotNone(response_iterator.initial_metadata())
+ self.assertIs(grpc.StatusCode.OK, response_iterator.code())
+ self.assertIsNotNone(response_iterator.details())
+ self.assertIsNotNone(response_iterator.trailing_metadata())
+
+ def _cancelled_unary_request_stream_response(self, multi_callable):
+ request = b'\x07\x19'
+
+ with self._control.pause():
+ response_iterator = multi_callable(
+ request,
+ metadata=(('test', 'CancelledUnaryRequestStreamResponse'),))
+ self._control.block_until_paused()
+ response_iterator.cancel()
+
+ with self.assertRaises(grpc.RpcError) as exception_context:
+ next(response_iterator)
+ self.assertIs(grpc.StatusCode.CANCELLED,
+ exception_context.exception.code())
+ self.assertIsNotNone(response_iterator.initial_metadata())
+ self.assertIs(grpc.StatusCode.CANCELLED, response_iterator.code())
+ self.assertIsNotNone(response_iterator.details())
+ self.assertIsNotNone(response_iterator.trailing_metadata())
+
+ def _cancelled_stream_request_stream_response(self, multi_callable):
+ requests = tuple(
+ b'\x07\x08' for _ in range(test_constants.STREAM_LENGTH))
+ request_iterator = iter(requests)
+
+ with self._control.pause():
+ response_iterator = multi_callable(
+ request_iterator,
+ metadata=(('test', 'CancelledStreamRequestStreamResponse'),))
+ response_iterator.cancel()
+
+ with self.assertRaises(grpc.RpcError):
+ next(response_iterator)
+ self.assertIsNotNone(response_iterator.initial_metadata())
+ self.assertIs(grpc.StatusCode.CANCELLED, response_iterator.code())
+ self.assertIsNotNone(response_iterator.details())
+ self.assertIsNotNone(response_iterator.trailing_metadata())
+
+ def _expired_unary_request_stream_response(self, multi_callable):
+ request = b'\x07\x19'
+
+ with self._control.pause():
+ with self.assertRaises(grpc.RpcError) as exception_context:
+ response_iterator = multi_callable(
+ request,
+ timeout=test_constants.SHORT_TIMEOUT,
+ metadata=(('test', 'ExpiredUnaryRequestStreamResponse'),))
+ next(response_iterator)
+
+ self.assertIs(grpc.StatusCode.DEADLINE_EXCEEDED,
+ exception_context.exception.code())
+ self.assertIs(grpc.StatusCode.DEADLINE_EXCEEDED,
+ response_iterator.code())
+
+ def _expired_stream_request_stream_response(self, multi_callable):
+ requests = tuple(
+ b'\x67\x18' for _ in range(test_constants.STREAM_LENGTH))
+ request_iterator = iter(requests)
+
+ with self._control.pause():
+ with self.assertRaises(grpc.RpcError) as exception_context:
+ response_iterator = multi_callable(
+ request_iterator,
+ timeout=test_constants.SHORT_TIMEOUT,
+ metadata=(('test', 'ExpiredStreamRequestStreamResponse'),))
+ next(response_iterator)
+
+ self.assertIs(grpc.StatusCode.DEADLINE_EXCEEDED,
+ exception_context.exception.code())
+ self.assertIs(grpc.StatusCode.DEADLINE_EXCEEDED,
+ response_iterator.code())
+
+ def _failed_unary_request_stream_response(self, multi_callable):
+ request = b'\x37\x17'
+
+ with self.assertRaises(grpc.RpcError) as exception_context:
+ with self._control.fail():
+ response_iterator = multi_callable(
+ request,
+ metadata=(('test', 'FailedUnaryRequestStreamResponse'),))
+ next(response_iterator)
+
+ self.assertIs(grpc.StatusCode.UNKNOWN,
+ exception_context.exception.code())
+
+ def _failed_stream_request_stream_response(self, multi_callable):
+ requests = tuple(
+ b'\x67\x88' for _ in range(test_constants.STREAM_LENGTH))
+ request_iterator = iter(requests)
+
+ with self._control.fail():
+ with self.assertRaises(grpc.RpcError) as exception_context:
+ response_iterator = multi_callable(
+ request_iterator,
+ metadata=(('test', 'FailedStreamRequestStreamResponse'),))
+ tuple(response_iterator)
+
+ self.assertIs(grpc.StatusCode.UNKNOWN,
+ exception_context.exception.code())
+ self.assertIs(grpc.StatusCode.UNKNOWN, response_iterator.code())
+
+ def _ignored_unary_stream_request_future_unary_response(
+ self, multi_callable):
+ request = b'\x37\x17'
+
+ multi_callable(request,
+ metadata=(('test',
+ 'IgnoredUnaryRequestStreamResponse'),))
+
+ def _ignored_stream_request_stream_response(self, multi_callable):
+ requests = tuple(
+ b'\x67\x88' for _ in range(test_constants.STREAM_LENGTH))
+ request_iterator = iter(requests)
+
+ multi_callable(request_iterator,
+ metadata=(('test',
+ 'IgnoredStreamRequestStreamResponse'),))
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_server_ssl_cert_config_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_server_ssl_cert_config_test.py
index fba6072b94c..35d992a33d6 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_server_ssl_cert_config_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_server_ssl_cert_config_test.py
@@ -161,14 +161,14 @@ class _ServerSSLCertReloadTest(
else:
with self.assertRaises(grpc.RpcError) as exception_context:
client_stub.UnUn(request)
- # If TLS 1.2 is used, then the client receives an alert message
- # before the handshake is complete, so the status is UNAVAILABLE. If
- # TLS 1.3 is used, then the client receives the alert message after
- # the handshake is complete, so the TSI handshaker returns the
- # TSI_PROTOCOL_FAILURE result. This result does not have a
- # corresponding status code, so this yields an UNKNOWN status.
- self.assertTrue(exception_context.exception.code(
- ) in [grpc.StatusCode.UNAVAILABLE, grpc.StatusCode.UNKNOWN])
+ # If TLS 1.2 is used, then the client receives an alert message
+ # before the handshake is complete, so the status is UNAVAILABLE. If
+ # TLS 1.3 is used, then the client receives the alert message after
+ # the handshake is complete, so the TSI handshaker returns the
+ # TSI_PROTOCOL_FAILURE result. This result does not have a
+ # corresponding status code, so this yields an UNKNOWN status.
+ self.assertTrue(exception_context.exception.code(
+ ) in [grpc.StatusCode.UNAVAILABLE, grpc.StatusCode.UNKNOWN])
def _do_one_shot_client_rpc(self,
expect_success,
@@ -186,10 +186,10 @@ class _ServerSSLCertReloadTest(
def _test(self):
# things should work...
self.cert_config_fetcher.configure(False, None)
- self._do_one_shot_client_rpc(True,
- root_certificates=CA_1_PEM,
- private_key=CLIENT_KEY_2_PEM,
- certificate_chain=CLIENT_CERT_CHAIN_2_PEM)
+ self._do_one_shot_client_rpc(True,
+ root_certificates=CA_1_PEM,
+ private_key=CLIENT_KEY_2_PEM,
+ certificate_chain=CLIENT_CERT_CHAIN_2_PEM)
actual_calls = self.cert_config_fetcher.getCalls()
self.assertEqual(len(actual_calls), 1)
self.assertFalse(actual_calls[0].did_raise)
@@ -199,10 +199,10 @@ class _ServerSSLCertReloadTest(
# fails because client trusts ca2 and so will reject server
self.cert_config_fetcher.reset()
self.cert_config_fetcher.configure(False, None)
- self._do_one_shot_client_rpc(False,
- root_certificates=CA_2_PEM,
- private_key=CLIENT_KEY_2_PEM,
- certificate_chain=CLIENT_CERT_CHAIN_2_PEM)
+ self._do_one_shot_client_rpc(False,
+ root_certificates=CA_2_PEM,
+ private_key=CLIENT_KEY_2_PEM,
+ certificate_chain=CLIENT_CERT_CHAIN_2_PEM)
actual_calls = self.cert_config_fetcher.getCalls()
self.assertGreaterEqual(len(actual_calls), 1)
self.assertFalse(actual_calls[0].did_raise)
@@ -213,10 +213,10 @@ class _ServerSSLCertReloadTest(
# should work again...
self.cert_config_fetcher.reset()
self.cert_config_fetcher.configure(True, None)
- self._do_one_shot_client_rpc(True,
- root_certificates=CA_1_PEM,
- private_key=CLIENT_KEY_2_PEM,
- certificate_chain=CLIENT_CERT_CHAIN_2_PEM)
+ self._do_one_shot_client_rpc(True,
+ root_certificates=CA_1_PEM,
+ private_key=CLIENT_KEY_2_PEM,
+ certificate_chain=CLIENT_CERT_CHAIN_2_PEM)
actual_calls = self.cert_config_fetcher.getCalls()
self.assertEqual(len(actual_calls), 1)
self.assertTrue(actual_calls[0].did_raise)
@@ -227,10 +227,10 @@ class _ServerSSLCertReloadTest(
# so server will reject
self.cert_config_fetcher.reset()
self.cert_config_fetcher.configure(False, None)
- self._do_one_shot_client_rpc(not self.require_client_auth(),
- root_certificates=CA_1_PEM,
- private_key=CLIENT_KEY_1_PEM,
- certificate_chain=CLIENT_CERT_CHAIN_1_PEM)
+ self._do_one_shot_client_rpc(not self.require_client_auth(),
+ root_certificates=CA_1_PEM,
+ private_key=CLIENT_KEY_1_PEM,
+ certificate_chain=CLIENT_CERT_CHAIN_1_PEM)
actual_calls = self.cert_config_fetcher.getCalls()
self.assertGreaterEqual(len(actual_calls), 1)
for i, call in enumerate(actual_calls):
@@ -240,10 +240,10 @@ class _ServerSSLCertReloadTest(
# should work again...
self.cert_config_fetcher.reset()
self.cert_config_fetcher.configure(False, None)
- self._do_one_shot_client_rpc(True,
- root_certificates=CA_1_PEM,
- private_key=CLIENT_KEY_2_PEM,
- certificate_chain=CLIENT_CERT_CHAIN_2_PEM)
+ self._do_one_shot_client_rpc(True,
+ root_certificates=CA_1_PEM,
+ private_key=CLIENT_KEY_2_PEM,
+ certificate_chain=CLIENT_CERT_CHAIN_2_PEM)
actual_calls = self.cert_config_fetcher.getCalls()
self.assertEqual(len(actual_calls), 1)
self.assertFalse(actual_calls[0].did_raise)
@@ -287,10 +287,10 @@ class _ServerSSLCertReloadTest(
root_certificates=CA_1_PEM)
self.cert_config_fetcher.reset()
self.cert_config_fetcher.configure(False, cert_config)
- self._do_one_shot_client_rpc(False,
- root_certificates=CA_1_PEM,
- private_key=CLIENT_KEY_2_PEM,
- certificate_chain=CLIENT_CERT_CHAIN_2_PEM)
+ self._do_one_shot_client_rpc(False,
+ root_certificates=CA_1_PEM,
+ private_key=CLIENT_KEY_2_PEM,
+ certificate_chain=CLIENT_CERT_CHAIN_2_PEM)
actual_calls = self.cert_config_fetcher.getCalls()
self.assertGreaterEqual(len(actual_calls), 1)
self.assertFalse(actual_calls[0].did_raise)
@@ -302,10 +302,10 @@ class _ServerSSLCertReloadTest(
# now should work again...
self.cert_config_fetcher.reset()
self.cert_config_fetcher.configure(False, None)
- self._do_one_shot_client_rpc(True,
- root_certificates=CA_2_PEM,
- private_key=CLIENT_KEY_1_PEM,
- certificate_chain=CLIENT_CERT_CHAIN_1_PEM)
+ self._do_one_shot_client_rpc(True,
+ root_certificates=CA_2_PEM,
+ private_key=CLIENT_KEY_1_PEM,
+ certificate_chain=CLIENT_CERT_CHAIN_1_PEM)
actual_calls = self.cert_config_fetcher.getCalls()
self.assertEqual(len(actual_calls), 1)
self.assertFalse(actual_calls[0].did_raise)
@@ -314,10 +314,10 @@ class _ServerSSLCertReloadTest(
# client should be rejected by server if with_client_auth
self.cert_config_fetcher.reset()
self.cert_config_fetcher.configure(False, None)
- self._do_one_shot_client_rpc(not self.require_client_auth(),
- root_certificates=CA_2_PEM,
- private_key=CLIENT_KEY_2_PEM,
- certificate_chain=CLIENT_CERT_CHAIN_2_PEM)
+ self._do_one_shot_client_rpc(not self.require_client_auth(),
+ root_certificates=CA_2_PEM,
+ private_key=CLIENT_KEY_2_PEM,
+ certificate_chain=CLIENT_CERT_CHAIN_2_PEM)
actual_calls = self.cert_config_fetcher.getCalls()
self.assertGreaterEqual(len(actual_calls), 1)
for i, call in enumerate(actual_calls):
@@ -327,10 +327,10 @@ class _ServerSSLCertReloadTest(
# here client should reject server...
self.cert_config_fetcher.reset()
self.cert_config_fetcher.configure(False, None)
- self._do_one_shot_client_rpc(False,
- root_certificates=CA_1_PEM,
- private_key=CLIENT_KEY_2_PEM,
- certificate_chain=CLIENT_CERT_CHAIN_2_PEM)
+ self._do_one_shot_client_rpc(False,
+ root_certificates=CA_1_PEM,
+ private_key=CLIENT_KEY_2_PEM,
+ certificate_chain=CLIENT_CERT_CHAIN_2_PEM)
actual_calls = self.cert_config_fetcher.getCalls()
self.assertGreaterEqual(len(actual_calls), 1)
for i, call in enumerate(actual_calls):
@@ -426,10 +426,10 @@ class ServerSSLCertReloadTestCertConfigReuse(_ServerSSLCertReloadTest):
# succeed with A
self.cert_config_fetcher.reset()
self.cert_config_fetcher.configure(False, self.cert_config_A)
- self._do_one_shot_client_rpc(True,
- root_certificates=CA_1_PEM,
- private_key=CLIENT_KEY_2_PEM,
- certificate_chain=CLIENT_CERT_CHAIN_2_PEM)
+ self._do_one_shot_client_rpc(True,
+ root_certificates=CA_1_PEM,
+ private_key=CLIENT_KEY_2_PEM,
+ certificate_chain=CLIENT_CERT_CHAIN_2_PEM)
actual_calls = self.cert_config_fetcher.getCalls()
self.assertEqual(len(actual_calls), 1)
self.assertFalse(actual_calls[0].did_raise)
@@ -439,10 +439,10 @@ class ServerSSLCertReloadTestCertConfigReuse(_ServerSSLCertReloadTest):
# fail with A
self.cert_config_fetcher.reset()
self.cert_config_fetcher.configure(False, self.cert_config_A)
- self._do_one_shot_client_rpc(False,
- root_certificates=CA_2_PEM,
- private_key=CLIENT_KEY_1_PEM,
- certificate_chain=CLIENT_CERT_CHAIN_1_PEM)
+ self._do_one_shot_client_rpc(False,
+ root_certificates=CA_2_PEM,
+ private_key=CLIENT_KEY_1_PEM,
+ certificate_chain=CLIENT_CERT_CHAIN_1_PEM)
actual_calls = self.cert_config_fetcher.getCalls()
self.assertGreaterEqual(len(actual_calls), 1)
self.assertFalse(actual_calls[0].did_raise)
@@ -454,10 +454,10 @@ class ServerSSLCertReloadTestCertConfigReuse(_ServerSSLCertReloadTest):
# succeed again with A
self.cert_config_fetcher.reset()
self.cert_config_fetcher.configure(False, self.cert_config_A)
- self._do_one_shot_client_rpc(True,
- root_certificates=CA_1_PEM,
- private_key=CLIENT_KEY_2_PEM,
- certificate_chain=CLIENT_CERT_CHAIN_2_PEM)
+ self._do_one_shot_client_rpc(True,
+ root_certificates=CA_1_PEM,
+ private_key=CLIENT_KEY_2_PEM,
+ certificate_chain=CLIENT_CERT_CHAIN_2_PEM)
actual_calls = self.cert_config_fetcher.getCalls()
self.assertEqual(len(actual_calls), 1)
self.assertFalse(actual_calls[0].did_raise)
@@ -467,10 +467,10 @@ class ServerSSLCertReloadTestCertConfigReuse(_ServerSSLCertReloadTest):
# succeed with B
self.cert_config_fetcher.reset()
self.cert_config_fetcher.configure(False, self.cert_config_B)
- self._do_one_shot_client_rpc(True,
- root_certificates=CA_2_PEM,
- private_key=CLIENT_KEY_1_PEM,
- certificate_chain=CLIENT_CERT_CHAIN_1_PEM)
+ self._do_one_shot_client_rpc(True,
+ root_certificates=CA_2_PEM,
+ private_key=CLIENT_KEY_1_PEM,
+ certificate_chain=CLIENT_CERT_CHAIN_1_PEM)
actual_calls = self.cert_config_fetcher.getCalls()
self.assertEqual(len(actual_calls), 1)
self.assertFalse(actual_calls[0].did_raise)
@@ -480,10 +480,10 @@ class ServerSSLCertReloadTestCertConfigReuse(_ServerSSLCertReloadTest):
# fail with B
self.cert_config_fetcher.reset()
self.cert_config_fetcher.configure(False, self.cert_config_B)
- self._do_one_shot_client_rpc(False,
- root_certificates=CA_1_PEM,
- private_key=CLIENT_KEY_2_PEM,
- certificate_chain=CLIENT_CERT_CHAIN_2_PEM)
+ self._do_one_shot_client_rpc(False,
+ root_certificates=CA_1_PEM,
+ private_key=CLIENT_KEY_2_PEM,
+ certificate_chain=CLIENT_CERT_CHAIN_2_PEM)
actual_calls = self.cert_config_fetcher.getCalls()
self.assertGreaterEqual(len(actual_calls), 1)
self.assertFalse(actual_calls[0].did_raise)
@@ -495,10 +495,10 @@ class ServerSSLCertReloadTestCertConfigReuse(_ServerSSLCertReloadTest):
# succeed again with B
self.cert_config_fetcher.reset()
self.cert_config_fetcher.configure(False, self.cert_config_B)
- self._do_one_shot_client_rpc(True,
- root_certificates=CA_2_PEM,
- private_key=CLIENT_KEY_1_PEM,
- certificate_chain=CLIENT_CERT_CHAIN_1_PEM)
+ self._do_one_shot_client_rpc(True,
+ root_certificates=CA_2_PEM,
+ private_key=CLIENT_KEY_1_PEM,
+ certificate_chain=CLIENT_CERT_CHAIN_1_PEM)
actual_calls = self.cert_config_fetcher.getCalls()
self.assertEqual(len(actual_calls), 1)
self.assertFalse(actual_calls[0].did_raise)
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_server_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_server_test.py
index aee1053c990..3c519219d59 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_server_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_server_test.py
@@ -18,9 +18,9 @@ import logging
import grpc
-from tests.unit import resources
+from tests.unit import resources
+
-
class _ActualGenericRpcHandler(grpc.GenericRpcHandler):
def service(self, handler_call_details):
@@ -31,11 +31,11 @@ class ServerTest(unittest.TestCase):
def test_not_a_generic_rpc_handler_at_construction(self):
with self.assertRaises(AttributeError) as exception_context:
- grpc.server(futures.ThreadPoolExecutor(max_workers=5),
- handlers=[
- _ActualGenericRpcHandler(),
- object(),
- ])
+ grpc.server(futures.ThreadPoolExecutor(max_workers=5),
+ handlers=[
+ _ActualGenericRpcHandler(),
+ object(),
+ ])
self.assertIn('grpc.GenericRpcHandler',
str(exception_context.exception))
@@ -49,21 +49,21 @@ class ServerTest(unittest.TestCase):
self.assertIn('grpc.GenericRpcHandler',
str(exception_context.exception))
- def test_failed_port_binding_exception(self):
- server = grpc.server(None, options=(('grpc.so_reuseport', 0),))
- port = server.add_insecure_port('localhost:0')
- bind_address = "localhost:%d" % port
+ def test_failed_port_binding_exception(self):
+ server = grpc.server(None, options=(('grpc.so_reuseport', 0),))
+ port = server.add_insecure_port('localhost:0')
+ bind_address = "localhost:%d" % port
+
+ with self.assertRaises(RuntimeError):
+ server.add_insecure_port(bind_address)
+
+ server_credentials = grpc.ssl_server_credentials([
+ (resources.private_key(), resources.certificate_chain())
+ ])
+ with self.assertRaises(RuntimeError):
+ server.add_secure_port(bind_address, server_credentials)
+
- with self.assertRaises(RuntimeError):
- server.add_insecure_port(bind_address)
-
- server_credentials = grpc.ssl_server_credentials([
- (resources.private_key(), resources.certificate_chain())
- ])
- with self.assertRaises(RuntimeError):
- server.add_secure_port(bind_address, server_credentials)
-
-
if __name__ == '__main__':
logging.basicConfig()
unittest.main(verbosity=2)
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_server_wait_for_termination_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_server_wait_for_termination_test.py
index be691133a27..3dd95ea8bf6 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_server_wait_for_termination_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_server_wait_for_termination_test.py
@@ -39,11 +39,11 @@ class ServerWaitForTerminationTest(unittest.TestCase):
termination_event = threading.Event()
server = grpc.server(futures.ThreadPoolExecutor())
- wait_thread = threading.Thread(target=_block_on_waiting,
- args=(
- server,
- termination_event,
- ))
+ wait_thread = threading.Thread(target=_block_on_waiting,
+ args=(
+ server,
+ termination_event,
+ ))
wait_thread.daemon = True
wait_thread.start()
time.sleep(_WAIT_FOR_BLOCKING.total_seconds())
@@ -56,11 +56,11 @@ class ServerWaitForTerminationTest(unittest.TestCase):
termination_event = threading.Event()
server = grpc.server(futures.ThreadPoolExecutor())
- wait_thread = threading.Thread(target=_block_on_waiting,
- args=(
- server,
- termination_event,
- ))
+ wait_thread = threading.Thread(target=_block_on_waiting,
+ args=(
+ server,
+ termination_event,
+ ))
wait_thread.daemon = True
wait_thread.start()
time.sleep(_WAIT_FOR_BLOCKING.total_seconds())
@@ -74,12 +74,12 @@ class ServerWaitForTerminationTest(unittest.TestCase):
termination_event = threading.Event()
server = grpc.server(futures.ThreadPoolExecutor())
- wait_thread = threading.Thread(target=_block_on_waiting,
- args=(
- server,
- termination_event,
- test_constants.SHORT_TIMEOUT / 2,
- ))
+ wait_thread = threading.Thread(target=_block_on_waiting,
+ args=(
+ server,
+ termination_event,
+ test_constants.SHORT_TIMEOUT / 2,
+ ))
wait_thread.daemon = True
wait_thread.start()
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_session_cache_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_session_cache_test.py
index 8a5df7d512e..9bff4d2af00 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_session_cache_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_session_cache_test.py
@@ -53,9 +53,9 @@ def handle_unary_unary(request, servicer_context):
def start_secure_server():
- handler = grpc.method_handlers_generic_handler(
- 'test',
- {'UnaryUnary': grpc.unary_unary_rpc_method_handler(handle_unary_unary)})
+ handler = grpc.method_handlers_generic_handler(
+ 'test',
+ {'UnaryUnary': grpc.unary_unary_rpc_method_handler(handle_unary_unary)})
server = test_common.test_server()
server.add_generic_rpc_handlers((handler,))
server_cred = grpc.ssl_server_credentials(_SERVER_CERTS)
@@ -69,9 +69,9 @@ class SSLSessionCacheTest(unittest.TestCase):
def _do_one_shot_client_rpc(self, channel_creds, channel_options, port,
expect_ssl_session_reused):
- channel = grpc.secure_channel('localhost:{}'.format(port),
- channel_creds,
- options=channel_options)
+ channel = grpc.secure_channel('localhost:{}'.format(port),
+ channel_creds,
+ options=channel_options)
response = channel.unary_unary(_UNARY_UNARY)(_REQUEST)
auth_data = pickle.loads(response)
self.assertEqual(expect_ssl_session_reused,
@@ -88,50 +88,50 @@ class SSLSessionCacheTest(unittest.TestCase):
('grpc.ssl_session_cache', cache),)
# Initial connection has no session to resume
- self._do_one_shot_client_rpc(channel_creds,
- channel_options,
- port_1,
- expect_ssl_session_reused=[b'false'])
+ self._do_one_shot_client_rpc(channel_creds,
+ channel_options,
+ port_1,
+ expect_ssl_session_reused=[b'false'])
# Connection to server_1 resumes from initial session
- self._do_one_shot_client_rpc(channel_creds,
- channel_options,
- port_1,
- expect_ssl_session_reused=[b'true'])
+ self._do_one_shot_client_rpc(channel_creds,
+ channel_options,
+ port_1,
+ expect_ssl_session_reused=[b'true'])
# Connection to a different server with the same name overwrites the cache entry
server_2, port_2 = start_secure_server()
- self._do_one_shot_client_rpc(channel_creds,
- channel_options,
- port_2,
- expect_ssl_session_reused=[b'false'])
- self._do_one_shot_client_rpc(channel_creds,
- channel_options,
- port_2,
- expect_ssl_session_reused=[b'true'])
+ self._do_one_shot_client_rpc(channel_creds,
+ channel_options,
+ port_2,
+ expect_ssl_session_reused=[b'false'])
+ self._do_one_shot_client_rpc(channel_creds,
+ channel_options,
+ port_2,
+ expect_ssl_session_reused=[b'true'])
server_2.stop(None)
# Connection to server_1 now falls back to full TLS handshake
- self._do_one_shot_client_rpc(channel_creds,
- channel_options,
- port_1,
- expect_ssl_session_reused=[b'false'])
+ self._do_one_shot_client_rpc(channel_creds,
+ channel_options,
+ port_1,
+ expect_ssl_session_reused=[b'false'])
# Re-creating server_1 causes old sessions to become invalid
server_1.stop(None)
server_1, port_1 = start_secure_server()
# Old sessions should no longer be valid
- self._do_one_shot_client_rpc(channel_creds,
- channel_options,
- port_1,
- expect_ssl_session_reused=[b'false'])
+ self._do_one_shot_client_rpc(channel_creds,
+ channel_options,
+ port_1,
+ expect_ssl_session_reused=[b'false'])
# Resumption should work for subsequent connections
- self._do_one_shot_client_rpc(channel_creds,
- channel_options,
- port_1,
- expect_ssl_session_reused=[b'true'])
+ self._do_one_shot_client_rpc(channel_creds,
+ channel_options,
+ port_1,
+ expect_ssl_session_reused=[b'true'])
server_1.stop(None)
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_signal_client.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_signal_client.py
index 123f6fe3dee..0be1270749c 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_signal_client.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_signal_client.py
@@ -55,8 +55,8 @@ def main_unary(server_target):
with grpc.insecure_channel(server_target) as channel:
multicallable = channel.unary_unary(UNARY_UNARY)
signal.signal(signal.SIGINT, handle_sigint)
- per_process_rpc_future = multicallable.future(_MESSAGE,
- wait_for_ready=True)
+ per_process_rpc_future = multicallable.future(_MESSAGE,
+ wait_for_ready=True)
result = per_process_rpc_future.result()
assert False, _ASSERTION_MESSAGE
@@ -90,8 +90,8 @@ def main_streaming_with_exception(server_target):
"""Initiate a streaming RPC with a signal handler that will raise."""
channel = grpc.insecure_channel(server_target)
try:
- for _ in channel.unary_stream(UNARY_STREAM)(_MESSAGE,
- wait_for_ready=True):
+ for _ in channel.unary_stream(UNARY_STREAM)(_MESSAGE,
+ wait_for_ready=True):
pass
except KeyboardInterrupt:
sys.stderr.write("Running signal handler.\n")
@@ -105,9 +105,9 @@ if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Signal test client.')
parser.add_argument('server', help='Server target')
parser.add_argument('arity', help='Arity', choices=('unary', 'streaming'))
- parser.add_argument('--exception',
- help='Whether the signal throws an exception',
- action='store_true')
+ parser.add_argument('--exception',
+ help='Whether the signal throws an exception',
+ action='store_true')
args = parser.parse_args()
if args.arity == 'unary' and not args.exception:
main_unary(args.server)
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/beta/_beta_features_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/beta/_beta_features_test.py
index ae7bbc108c4..a111d687641 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/beta/_beta_features_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/beta/_beta_features_test.py
@@ -132,9 +132,9 @@ class _BlockingIterator(object):
def _metadata_plugin(context, callback):
- callback([
- (_PER_RPC_CREDENTIALS_METADATA_KEY, _PER_RPC_CREDENTIALS_METADATA_VALUE)
- ], None)
+ callback([
+ (_PER_RPC_CREDENTIALS_METADATA_KEY, _PER_RPC_CREDENTIALS_METADATA_VALUE)
+ ], None)
class BetaFeaturesTest(unittest.TestCase):
@@ -143,13 +143,13 @@ class BetaFeaturesTest(unittest.TestCase):
self._servicer = _Servicer()
method_implementations = {
(_GROUP, _UNARY_UNARY):
- utilities.unary_unary_inline(self._servicer.unary_unary),
+ utilities.unary_unary_inline(self._servicer.unary_unary),
(_GROUP, _UNARY_STREAM):
- utilities.unary_stream_inline(self._servicer.unary_stream),
+ utilities.unary_stream_inline(self._servicer.unary_stream),
(_GROUP, _STREAM_UNARY):
- utilities.stream_unary_inline(self._servicer.stream_unary),
+ utilities.stream_unary_inline(self._servicer.stream_unary),
(_GROUP, _STREAM_STREAM):
- utilities.stream_stream_inline(self._servicer.stream_stream),
+ utilities.stream_stream_inline(self._servicer.stream_stream),
}
cardinalities = {
@@ -161,8 +161,8 @@ class BetaFeaturesTest(unittest.TestCase):
server_options = implementations.server_options(
thread_pool_size=test_constants.POOL_SIZE)
- self._server = implementations.server(method_implementations,
- options=server_options)
+ self._server = implementations.server(method_implementations,
+ options=server_options)
server_credentials = implementations.ssl_server_credentials([
(
resources.private_key(),
@@ -179,10 +179,10 @@ class BetaFeaturesTest(unittest.TestCase):
'localhost', port, self._channel_credentials, _SERVER_HOST_OVERRIDE)
stub_options = implementations.stub_options(
thread_pool_size=test_constants.POOL_SIZE)
- self._dynamic_stub = implementations.dynamic_stub(channel,
- _GROUP,
- cardinalities,
- options=stub_options)
+ self._dynamic_stub = implementations.dynamic_stub(channel,
+ _GROUP,
+ cardinalities,
+ options=stub_options)
def tearDown(self):
self._dynamic_stub = None
@@ -191,10 +191,10 @@ class BetaFeaturesTest(unittest.TestCase):
def test_unary_unary(self):
call_options = interfaces.grpc_call_options(
disable_compression=True, credentials=self._call_credentials)
- response = getattr(self._dynamic_stub,
- _UNARY_UNARY)(_REQUEST,
- test_constants.LONG_TIMEOUT,
- protocol_options=call_options)
+ response = getattr(self._dynamic_stub,
+ _UNARY_UNARY)(_REQUEST,
+ test_constants.LONG_TIMEOUT,
+ protocol_options=call_options)
self.assertEqual(_RESPONSE, response)
self.assertIsNotNone(self._servicer.peer())
invocation_metadata = [
@@ -276,13 +276,13 @@ class ContextManagementAndLifecycleTest(unittest.TestCase):
self._servicer = _Servicer()
self._method_implementations = {
(_GROUP, _UNARY_UNARY):
- utilities.unary_unary_inline(self._servicer.unary_unary),
+ utilities.unary_unary_inline(self._servicer.unary_unary),
(_GROUP, _UNARY_STREAM):
- utilities.unary_stream_inline(self._servicer.unary_stream),
+ utilities.unary_stream_inline(self._servicer.unary_stream),
(_GROUP, _STREAM_UNARY):
- utilities.stream_unary_inline(self._servicer.stream_unary),
+ utilities.stream_unary_inline(self._servicer.stream_unary),
(_GROUP, _STREAM_STREAM):
- utilities.stream_stream_inline(self._servicer.stream_stream),
+ utilities.stream_stream_inline(self._servicer.stream_stream),
}
self._cardinalities = {
@@ -306,17 +306,17 @@ class ContextManagementAndLifecycleTest(unittest.TestCase):
thread_pool_size=test_constants.POOL_SIZE)
def test_stub_context(self):
- server = implementations.server(self._method_implementations,
- options=self._server_options)
+ server = implementations.server(self._method_implementations,
+ options=self._server_options)
port = server.add_secure_port('[::]:0', self._server_credentials)
server.start()
channel = test_utilities.not_really_secure_channel(
'localhost', port, self._channel_credentials, _SERVER_HOST_OVERRIDE)
- dynamic_stub = implementations.dynamic_stub(channel,
- _GROUP,
- self._cardinalities,
- options=self._stub_options)
+ dynamic_stub = implementations.dynamic_stub(channel,
+ _GROUP,
+ self._cardinalities,
+ options=self._stub_options)
for _ in range(100):
with dynamic_stub:
pass
@@ -324,10 +324,10 @@ class ContextManagementAndLifecycleTest(unittest.TestCase):
with dynamic_stub:
call_options = interfaces.grpc_call_options(
disable_compression=True)
- response = getattr(dynamic_stub,
- _UNARY_UNARY)(_REQUEST,
- test_constants.LONG_TIMEOUT,
- protocol_options=call_options)
+ response = getattr(dynamic_stub,
+ _UNARY_UNARY)(_REQUEST,
+ test_constants.LONG_TIMEOUT,
+ protocol_options=call_options)
self.assertEqual(_RESPONSE, response)
self.assertIsNotNone(self._servicer.peer())
@@ -335,14 +335,14 @@ class ContextManagementAndLifecycleTest(unittest.TestCase):
def test_server_lifecycle(self):
for _ in range(100):
- server = implementations.server(self._method_implementations,
- options=self._server_options)
+ server = implementations.server(self._method_implementations,
+ options=self._server_options)
port = server.add_secure_port('[::]:0', self._server_credentials)
server.start()
server.stop(test_constants.SHORT_TIMEOUT).wait()
for _ in range(100):
- server = implementations.server(self._method_implementations,
- options=self._server_options)
+ server = implementations.server(self._method_implementations,
+ options=self._server_options)
server.add_secure_port('[::]:0', self._server_credentials)
server.add_insecure_port('[::]:0')
with server:
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/beta/_implementations_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/beta/_implementations_test.py
index 07127ea28c9..75a615eeffb 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/beta/_implementations_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/beta/_implementations_test.py
@@ -41,8 +41,8 @@ class CallCredentialsTest(unittest.TestCase):
def test_google_call_credentials(self):
creds = oauth2client_client.GoogleCredentials(
'token', 'client_id', 'secret', 'refresh_token',
- datetime.datetime(2008, 6, 24), 'https://refresh.uri.com/',
- 'user_agent')
+ datetime.datetime(2008, 6, 24), 'https://refresh.uri.com/',
+ 'user_agent')
call_creds = implementations.google_call_credentials(creds)
self.assertIsInstance(call_creds, implementations.CallCredentials)
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/beta/_not_found_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/beta/_not_found_test.py
index 2b9df9f3936..837d2bbebf2 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/beta/_not_found_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/beta/_not_found_test.py
@@ -36,11 +36,11 @@ class NotFoundTest(unittest.TestCase):
def test_blocking_unary_unary_not_found(self):
with self.assertRaises(face.LocalError) as exception_assertion_context:
- self._generic_stub.blocking_unary_unary('groop',
- 'meffod',
- b'abc',
- test_constants.LONG_TIMEOUT,
- with_call=True)
+ self._generic_stub.blocking_unary_unary('groop',
+ 'meffod',
+ b'abc',
+ test_constants.LONG_TIMEOUT,
+ with_call=True)
self.assertIs(exception_assertion_context.exception.code,
interfaces.StatusCode.UNIMPLEMENTED)
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/credentials/ca.pem b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/credentials/ca.pem
index ac1808a56d1..49d39cd8ed5 100755
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/credentials/ca.pem
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/credentials/ca.pem
@@ -1,20 +1,20 @@
-----BEGIN CERTIFICATE-----
-MIIDWjCCAkKgAwIBAgIUWrP0VvHcy+LP6UuYNtiL9gBhD5owDQYJKoZIhvcNAQEL
-BQAwVjELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoM
-GEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDEPMA0GA1UEAwwGdGVzdGNhMB4XDTIw
-MDMxNzE4NTk1MVoXDTMwMDMxNTE4NTk1MVowVjELMAkGA1UEBhMCQVUxEzARBgNV
-BAgMClNvbWUtU3RhdGUxITAfBgNVBAoMGEludGVybmV0IFdpZGdpdHMgUHR5IEx0
-ZDEPMA0GA1UEAwwGdGVzdGNhMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC
-AQEAsGL0oXflF0LzoM+Bh+qUU9yhqzw2w8OOX5mu/iNCyUOBrqaHi7mGHx73GD01
-diNzCzvlcQqdNIH6NQSL7DTpBjca66jYT9u73vZe2MDrr1nVbuLvfu9850cdxiUO
-Inv5xf8+sTHG0C+a+VAvMhsLiRjsq+lXKRJyk5zkbbsETybqpxoJ+K7CoSy3yc/k
-QIY3TipwEtwkKP4hzyo6KiGd/DPexie4nBUInN3bS1BUeNZ5zeaIC2eg3bkeeW7c
-qT55b+Yen6CxY0TEkzBK6AKt/WUialKMgT0wbTxRZO7kUCH3Sq6e/wXeFdJ+HvdV
-LPlAg5TnMaNpRdQih/8nRFpsdwIDAQABoyAwHjAMBgNVHRMEBTADAQH/MA4GA1Ud
-DwEB/wQEAwICBDANBgkqhkiG9w0BAQsFAAOCAQEAkTrKZjBrJXHps/HrjNCFPb5a
-THuGPCSsepe1wkKdSp1h4HGRpLoCgcLysCJ5hZhRpHkRihhef+rFHEe60UePQO3S
-CVTtdJB4CYWpcNyXOdqefrbJW5QNljxgi6Fhvs7JJkBqdXIkWXtFk2eRgOIP2Eo9
-/OHQHlYnwZFrk6sp4wPyR+A95S0toZBcyDVz7u+hOW0pGK3wviOe9lvRgj/H3Pwt
-bewb0l+MhRig0/DVHamyVxrDRbqInU1/GTNCwcZkXKYFWSf92U+kIcTth24Q1gcw
-eZiLl5FfrWokUNytFElXob0V0a5/kbhiLc3yWmvWqHTpqCALbVyF+rKJo2f5Kw==
+MIIDWjCCAkKgAwIBAgIUWrP0VvHcy+LP6UuYNtiL9gBhD5owDQYJKoZIhvcNAQEL
+BQAwVjELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoM
+GEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDEPMA0GA1UEAwwGdGVzdGNhMB4XDTIw
+MDMxNzE4NTk1MVoXDTMwMDMxNTE4NTk1MVowVjELMAkGA1UEBhMCQVUxEzARBgNV
+BAgMClNvbWUtU3RhdGUxITAfBgNVBAoMGEludGVybmV0IFdpZGdpdHMgUHR5IEx0
+ZDEPMA0GA1UEAwwGdGVzdGNhMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC
+AQEAsGL0oXflF0LzoM+Bh+qUU9yhqzw2w8OOX5mu/iNCyUOBrqaHi7mGHx73GD01
+diNzCzvlcQqdNIH6NQSL7DTpBjca66jYT9u73vZe2MDrr1nVbuLvfu9850cdxiUO
+Inv5xf8+sTHG0C+a+VAvMhsLiRjsq+lXKRJyk5zkbbsETybqpxoJ+K7CoSy3yc/k
+QIY3TipwEtwkKP4hzyo6KiGd/DPexie4nBUInN3bS1BUeNZ5zeaIC2eg3bkeeW7c
+qT55b+Yen6CxY0TEkzBK6AKt/WUialKMgT0wbTxRZO7kUCH3Sq6e/wXeFdJ+HvdV
+LPlAg5TnMaNpRdQih/8nRFpsdwIDAQABoyAwHjAMBgNVHRMEBTADAQH/MA4GA1Ud
+DwEB/wQEAwICBDANBgkqhkiG9w0BAQsFAAOCAQEAkTrKZjBrJXHps/HrjNCFPb5a
+THuGPCSsepe1wkKdSp1h4HGRpLoCgcLysCJ5hZhRpHkRihhef+rFHEe60UePQO3S
+CVTtdJB4CYWpcNyXOdqefrbJW5QNljxgi6Fhvs7JJkBqdXIkWXtFk2eRgOIP2Eo9
+/OHQHlYnwZFrk6sp4wPyR+A95S0toZBcyDVz7u+hOW0pGK3wviOe9lvRgj/H3Pwt
+bewb0l+MhRig0/DVHamyVxrDRbqInU1/GTNCwcZkXKYFWSf92U+kIcTth24Q1gcw
+eZiLl5FfrWokUNytFElXob0V0a5/kbhiLc3yWmvWqHTpqCALbVyF+rKJo2f5Kw==
-----END CERTIFICATE-----
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/credentials/server1.key b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/credentials/server1.key
index 23884118447..086462992cf 100755
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/credentials/server1.key
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/credentials/server1.key
@@ -1,28 +1,28 @@
-----BEGIN PRIVATE KEY-----
-MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDnE443EknxvxBq
-6+hvn/t09hl8hx366EBYvZmVM/NC+7igXRAjiJiA/mIaCvL3MS0Iz5hBLxSGICU+
-WproA3GCIFITIwcf/ETyWj/5xpgZ4AKrLrjQmmX8mhwUajfF3UvwMJrCOVqPp67t
-PtP+2kBXaqrXdvnvXR41FsIB8V7zIAuIZB6bHQhiGVlc1sgZYsE2EGG9WMmHtS86
-qkAOTjG2XyjmPTGAwhGDpYkYrpzp99IiDh4/Veai81hn0ssQkbry0XRD/Ig3jcHh
-23WiriPNJ0JsbgXUSLKRPZObA9VgOLy2aXoN84IMaeK3yy+cwSYG/99w93fUZJte
-MXwz4oYZAgMBAAECggEBAIVn2Ncai+4xbH0OLWckabwgyJ4IM9rDc0LIU368O1kU
-koais8qP9dujAWgfoh3sGh/YGgKn96VnsZjKHlyMgF+r4TaDJn3k2rlAOWcurGlj
-1qaVlsV4HiEzp7pxiDmHhWvp4672Bb6iBG+bsjCUOEk/n9o9KhZzIBluRhtxCmw5
-nw4Do7z00PTvN81260uPWSc04IrytvZUiAIx/5qxD72bij2xJ8t/I9GI8g4FtoVB
-8pB6S/hJX1PZhh9VlU6Yk+TOfOVnbebG4W5138LkB835eqk3Zz0qsbc2euoi8Hxi
-y1VGwQEmMQ63jXz4c6g+X55ifvUK9Jpn5E8pq+pMd7ECgYEA93lYq+Cr54K4ey5t
-sWMa+ye5RqxjzgXj2Kqr55jb54VWG7wp2iGbg8FMlkQwzTJwebzDyCSatguEZLuB
-gRGroRnsUOy9vBvhKPOch9bfKIl6qOgzMJB267fBVWx5ybnRbWN/I7RvMQf3k+9y
-biCIVnxDLEEYyx7z85/5qxsXg/MCgYEA7wmWKtCTn032Hy9P8OL49T0X6Z8FlkDC
-Rk42ygrc/MUbugq9RGUxcCxoImOG9JXUpEtUe31YDm2j+/nbvrjl6/bP2qWs0V7l
-dTJl6dABP51pCw8+l4cWgBBX08Lkeen812AAFNrjmDCjX6rHjWHLJcpS18fnRRkP
-V1d/AHWX7MMCgYEA6Gsw2guhp0Zf2GCcaNK5DlQab8OL4Hwrpttzo4kuTlwtqNKp
-Q9H4al9qfF4Cr1TFya98+EVYf8yFRM3NLNjZpe3gwYf2EerlJj7VLcahw0KKzoN1
-QBENfwgPLRk5sDkx9VhSmcfl/diLroZdpAwtv3vo4nEoxeuGFbKTGx3Qkf0CgYEA
-xyR+dcb05Ygm3w4klHQTowQ10s1H80iaUcZBgQuR1ghEtDbUPZHsoR5t1xCB02ys
-DgAwLv1bChIvxvH/L6KM8ovZ2LekBX4AviWxoBxJnfz/EVau98B0b1auRN6eSC83
-FRuGldlSOW1z/nSh8ViizSYE5H5HX1qkXEippvFRE88CgYB3Bfu3YQY60ITWIShv
-nNkdcbTT9eoP9suaRJjw92Ln+7ZpALYlQMKUZmJ/5uBmLs4RFwUTQruLOPL4yLTH
-awADWUzs3IRr1fwn9E+zM8JVyKCnUEM3w4N5UZskGO2klashAd30hWO+knRv/y0r
-uGIYs9Ek7YXlXIRVrzMwcsrt1w==
+MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDnE443EknxvxBq
+6+hvn/t09hl8hx366EBYvZmVM/NC+7igXRAjiJiA/mIaCvL3MS0Iz5hBLxSGICU+
+WproA3GCIFITIwcf/ETyWj/5xpgZ4AKrLrjQmmX8mhwUajfF3UvwMJrCOVqPp67t
+PtP+2kBXaqrXdvnvXR41FsIB8V7zIAuIZB6bHQhiGVlc1sgZYsE2EGG9WMmHtS86
+qkAOTjG2XyjmPTGAwhGDpYkYrpzp99IiDh4/Veai81hn0ssQkbry0XRD/Ig3jcHh
+23WiriPNJ0JsbgXUSLKRPZObA9VgOLy2aXoN84IMaeK3yy+cwSYG/99w93fUZJte
+MXwz4oYZAgMBAAECggEBAIVn2Ncai+4xbH0OLWckabwgyJ4IM9rDc0LIU368O1kU
+koais8qP9dujAWgfoh3sGh/YGgKn96VnsZjKHlyMgF+r4TaDJn3k2rlAOWcurGlj
+1qaVlsV4HiEzp7pxiDmHhWvp4672Bb6iBG+bsjCUOEk/n9o9KhZzIBluRhtxCmw5
+nw4Do7z00PTvN81260uPWSc04IrytvZUiAIx/5qxD72bij2xJ8t/I9GI8g4FtoVB
+8pB6S/hJX1PZhh9VlU6Yk+TOfOVnbebG4W5138LkB835eqk3Zz0qsbc2euoi8Hxi
+y1VGwQEmMQ63jXz4c6g+X55ifvUK9Jpn5E8pq+pMd7ECgYEA93lYq+Cr54K4ey5t
+sWMa+ye5RqxjzgXj2Kqr55jb54VWG7wp2iGbg8FMlkQwzTJwebzDyCSatguEZLuB
+gRGroRnsUOy9vBvhKPOch9bfKIl6qOgzMJB267fBVWx5ybnRbWN/I7RvMQf3k+9y
+biCIVnxDLEEYyx7z85/5qxsXg/MCgYEA7wmWKtCTn032Hy9P8OL49T0X6Z8FlkDC
+Rk42ygrc/MUbugq9RGUxcCxoImOG9JXUpEtUe31YDm2j+/nbvrjl6/bP2qWs0V7l
+dTJl6dABP51pCw8+l4cWgBBX08Lkeen812AAFNrjmDCjX6rHjWHLJcpS18fnRRkP
+V1d/AHWX7MMCgYEA6Gsw2guhp0Zf2GCcaNK5DlQab8OL4Hwrpttzo4kuTlwtqNKp
+Q9H4al9qfF4Cr1TFya98+EVYf8yFRM3NLNjZpe3gwYf2EerlJj7VLcahw0KKzoN1
+QBENfwgPLRk5sDkx9VhSmcfl/diLroZdpAwtv3vo4nEoxeuGFbKTGx3Qkf0CgYEA
+xyR+dcb05Ygm3w4klHQTowQ10s1H80iaUcZBgQuR1ghEtDbUPZHsoR5t1xCB02ys
+DgAwLv1bChIvxvH/L6KM8ovZ2LekBX4AviWxoBxJnfz/EVau98B0b1auRN6eSC83
+FRuGldlSOW1z/nSh8ViizSYE5H5HX1qkXEippvFRE88CgYB3Bfu3YQY60ITWIShv
+nNkdcbTT9eoP9suaRJjw92Ln+7ZpALYlQMKUZmJ/5uBmLs4RFwUTQruLOPL4yLTH
+awADWUzs3IRr1fwn9E+zM8JVyKCnUEM3w4N5UZskGO2klashAd30hWO+knRv/y0r
+uGIYs9Ek7YXlXIRVrzMwcsrt1w==
-----END PRIVATE KEY-----
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/credentials/server1.pem b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/credentials/server1.pem
index 3025c1320ec..88244f856c6 100755
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/credentials/server1.pem
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/credentials/server1.pem
@@ -1,22 +1,22 @@
-----BEGIN CERTIFICATE-----
-MIIDtDCCApygAwIBAgIUbJfTREJ6k6/+oInWhV1O1j3ZT0IwDQYJKoZIhvcNAQEL
-BQAwVjELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoM
-GEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDEPMA0GA1UEAwwGdGVzdGNhMB4XDTIw
-MDMxODAzMTA0MloXDTMwMDMxNjAzMTA0MlowZTELMAkGA1UEBhMCVVMxETAPBgNV
-BAgMCElsbGlub2lzMRAwDgYDVQQHDAdDaGljYWdvMRUwEwYDVQQKDAxFeGFtcGxl
-LCBDby4xGjAYBgNVBAMMESoudGVzdC5nb29nbGUuY29tMIIBIjANBgkqhkiG9w0B
-AQEFAAOCAQ8AMIIBCgKCAQEA5xOONxJJ8b8Qauvob5/7dPYZfIcd+uhAWL2ZlTPz
-Qvu4oF0QI4iYgP5iGgry9zEtCM+YQS8UhiAlPlqa6ANxgiBSEyMHH/xE8lo/+caY
-GeACqy640Jpl/JocFGo3xd1L8DCawjlaj6eu7T7T/tpAV2qq13b5710eNRbCAfFe
-8yALiGQemx0IYhlZXNbIGWLBNhBhvVjJh7UvOqpADk4xtl8o5j0xgMIRg6WJGK6c
-6ffSIg4eP1XmovNYZ9LLEJG68tF0Q/yIN43B4dt1oq4jzSdCbG4F1EiykT2TmwPV
-YDi8tml6DfOCDGnit8svnMEmBv/fcPd31GSbXjF8M+KGGQIDAQABo2swaTAJBgNV
-HRMEAjAAMAsGA1UdDwQEAwIF4DBPBgNVHREESDBGghAqLnRlc3QuZ29vZ2xlLmZy
-ghh3YXRlcnpvb2kudGVzdC5nb29nbGUuYmWCEioudGVzdC55b3V0dWJlLmNvbYcE
-wKgBAzANBgkqhkiG9w0BAQsFAAOCAQEAS8hDQA8PSgipgAml7Q3/djwQ644ghWQv
-C2Kb+r30RCY1EyKNhnQnIIh/OUbBZvh0M0iYsy6xqXgfDhCB93AA6j0i5cS8fkhH
-Jl4RK0tSkGQ3YNY4NzXwQP/vmUgfkw8VBAZ4Y4GKxppdATjffIW+srbAmdDruIRM
-wPeikgOoRrXf0LA1fi4TqxARzeRwenQpayNfGHTvVF9aJkl8HoaMunTAdG5pIVcr
-9GKi/gEMpXUJbbVv3U5frX1Wo4CFo+rZWJ/LyCMeb0jciNLxSdMwj/E/ZuExlyeZ
-gc9ctPjSMvgSyXEKv6Vwobleeg88V2ZgzenziORoWj4KszG/lbQZvg==
+MIIDtDCCApygAwIBAgIUbJfTREJ6k6/+oInWhV1O1j3ZT0IwDQYJKoZIhvcNAQEL
+BQAwVjELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoM
+GEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDEPMA0GA1UEAwwGdGVzdGNhMB4XDTIw
+MDMxODAzMTA0MloXDTMwMDMxNjAzMTA0MlowZTELMAkGA1UEBhMCVVMxETAPBgNV
+BAgMCElsbGlub2lzMRAwDgYDVQQHDAdDaGljYWdvMRUwEwYDVQQKDAxFeGFtcGxl
+LCBDby4xGjAYBgNVBAMMESoudGVzdC5nb29nbGUuY29tMIIBIjANBgkqhkiG9w0B
+AQEFAAOCAQ8AMIIBCgKCAQEA5xOONxJJ8b8Qauvob5/7dPYZfIcd+uhAWL2ZlTPz
+Qvu4oF0QI4iYgP5iGgry9zEtCM+YQS8UhiAlPlqa6ANxgiBSEyMHH/xE8lo/+caY
+GeACqy640Jpl/JocFGo3xd1L8DCawjlaj6eu7T7T/tpAV2qq13b5710eNRbCAfFe
+8yALiGQemx0IYhlZXNbIGWLBNhBhvVjJh7UvOqpADk4xtl8o5j0xgMIRg6WJGK6c
+6ffSIg4eP1XmovNYZ9LLEJG68tF0Q/yIN43B4dt1oq4jzSdCbG4F1EiykT2TmwPV
+YDi8tml6DfOCDGnit8svnMEmBv/fcPd31GSbXjF8M+KGGQIDAQABo2swaTAJBgNV
+HRMEAjAAMAsGA1UdDwQEAwIF4DBPBgNVHREESDBGghAqLnRlc3QuZ29vZ2xlLmZy
+ghh3YXRlcnpvb2kudGVzdC5nb29nbGUuYmWCEioudGVzdC55b3V0dWJlLmNvbYcE
+wKgBAzANBgkqhkiG9w0BAQsFAAOCAQEAS8hDQA8PSgipgAml7Q3/djwQ644ghWQv
+C2Kb+r30RCY1EyKNhnQnIIh/OUbBZvh0M0iYsy6xqXgfDhCB93AA6j0i5cS8fkhH
+Jl4RK0tSkGQ3YNY4NzXwQP/vmUgfkw8VBAZ4Y4GKxppdATjffIW+srbAmdDruIRM
+wPeikgOoRrXf0LA1fi4TqxARzeRwenQpayNfGHTvVF9aJkl8HoaMunTAdG5pIVcr
+9GKi/gEMpXUJbbVv3U5frX1Wo4CFo+rZWJ/LyCMeb0jciNLxSdMwj/E/ZuExlyeZ
+gc9ctPjSMvgSyXEKv6Vwobleeg88V2ZgzenziORoWj4KszG/lbQZvg==
-----END CERTIFICATE-----
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/framework/common/__init__.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/framework/common/__init__.py
index ac4ca36b4a4..8b58a0c46af 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/framework/common/__init__.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/framework/common/__init__.py
@@ -15,25 +15,25 @@
import contextlib
import os
import socket
-import errno
+import errno
-_DEFAULT_SOCK_OPTIONS = (socket.SO_REUSEADDR,
- socket.SO_REUSEPORT) if os.name != 'nt' else (
- socket.SO_REUSEADDR,)
-_UNRECOVERABLE_ERRNOS = (errno.EADDRINUSE, errno.ENOSR)
+_DEFAULT_SOCK_OPTIONS = (socket.SO_REUSEADDR,
+ socket.SO_REUSEPORT) if os.name != 'nt' else (
+ socket.SO_REUSEADDR,)
+_UNRECOVERABLE_ERRNOS = (errno.EADDRINUSE, errno.ENOSR)
def get_socket(bind_address='localhost',
- port=0,
+ port=0,
listen=True,
- sock_options=_DEFAULT_SOCK_OPTIONS):
- """Opens a socket.
+ sock_options=_DEFAULT_SOCK_OPTIONS):
+ """Opens a socket.
Useful for reserving a port for a system-under-test.
Args:
bind_address: The host to which to bind.
- port: The port to which to bind.
+ port: The port to which to bind.
listen: A boolean value indicating whether or not to listen on the socket.
sock_options: A sequence of socket options to apply to the socket.
@@ -53,20 +53,20 @@ def get_socket(bind_address='localhost',
sock = socket.socket(address_family, socket.SOCK_STREAM)
for sock_option in _sock_options:
sock.setsockopt(socket.SOL_SOCKET, sock_option, 1)
- sock.bind((bind_address, port))
+ sock.bind((bind_address, port))
if listen:
sock.listen(1)
return bind_address, sock.getsockname()[1], sock
- except OSError as os_error:
+ except OSError as os_error:
+ sock.close()
+ if os_error.errno in _UNRECOVERABLE_ERRNOS:
+ raise
+ else:
+ continue
+ # For PY2, socket.error is a child class of IOError; for PY3, it is
+ # pointing to OSError. We need this catch to make it 2/3 agnostic.
+ except socket.error: # pylint: disable=duplicate-except
sock.close()
- if os_error.errno in _UNRECOVERABLE_ERRNOS:
- raise
- else:
- continue
- # For PY2, socket.error is a child class of IOError; for PY3, it is
- # pointing to OSError. We need this catch to make it 2/3 agnostic.
- except socket.error: # pylint: disable=duplicate-except
- sock.close()
continue
raise RuntimeError("Failed to bind to {} with sock_options {}".format(
bind_address, sock_options))
@@ -74,16 +74,16 @@ def get_socket(bind_address='localhost',
@contextlib.contextmanager
def bound_socket(bind_address='localhost',
- port=0,
+ port=0,
listen=True,
- sock_options=_DEFAULT_SOCK_OPTIONS):
+ sock_options=_DEFAULT_SOCK_OPTIONS):
"""Opens a socket bound to an arbitrary port.
Useful for reserving a port for a system-under-test.
Args:
bind_address: The host to which to bind.
- port: The port to which to bind.
+ port: The port to which to bind.
listen: A boolean value indicating whether or not to listen on the socket.
sock_options: A sequence of socket options to apply to the socket.
@@ -92,10 +92,10 @@ def bound_socket(bind_address='localhost',
- the address to which the socket is bound
- the port to which the socket is bound
"""
- host, port, sock = get_socket(bind_address=bind_address,
- port=port,
- listen=listen,
- sock_options=sock_options)
+ host, port, sock = get_socket(bind_address=bind_address,
+ port=port,
+ listen=listen,
+ sock_options=sock_options)
try:
yield host, port
finally:
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/test_common.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/test_common.py
index 8205a818d72..59ded0752fd 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/test_common.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/test_common.py
@@ -105,8 +105,8 @@ def test_server(max_workers=10, reuse_port=False):
These servers have SO_REUSEPORT disabled to prevent cross-talk.
"""
- return grpc.server(futures.ThreadPoolExecutor(max_workers=max_workers),
- options=(('grpc.so_reuseport', int(reuse_port)),))
+ return grpc.server(futures.ThreadPoolExecutor(max_workers=max_workers),
+ options=(('grpc.so_reuseport', int(reuse_port)),))
class WaitGroup(object):
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/benchmark/benchmark_client.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/benchmark/benchmark_client.py
index 1349f024f53..51a046c20c7 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/benchmark/benchmark_client.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/benchmark/benchmark_client.py
@@ -1,155 +1,155 @@
-# Copyright 2020 The gRPC Authors
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-"""The Python AsyncIO Benchmark Clients."""
-
-import abc
-import asyncio
-import time
-import logging
-import random
-
-import grpc
-from grpc.experimental import aio
-
-from src.proto.grpc.testing import (benchmark_service_pb2_grpc, control_pb2,
- messages_pb2)
-from tests.qps import histogram
-from tests.unit import resources
-
-
-class GenericStub(object):
-
- def __init__(self, channel: aio.Channel):
- self.UnaryCall = channel.unary_unary(
- '/grpc.testing.BenchmarkService/UnaryCall')
- self.StreamingCall = channel.stream_stream(
- '/grpc.testing.BenchmarkService/StreamingCall')
-
-
-class BenchmarkClient(abc.ABC):
- """Benchmark client interface that exposes a non-blocking send_request()."""
-
- def __init__(self, address: str, config: control_pb2.ClientConfig,
- hist: histogram.Histogram):
- # Disables underlying reuse of subchannels
- unique_option = (('iv', random.random()),)
-
- # Parses the channel argument from config
- channel_args = tuple(
- (arg.name, arg.str_value) if arg.HasField('str_value') else (
- arg.name, int(arg.int_value)) for arg in config.channel_args)
-
- # Creates the channel
- if config.HasField('security_params'):
- channel_credentials = grpc.ssl_channel_credentials(
- resources.test_root_certificates(),)
- server_host_override_option = ((
- 'grpc.ssl_target_name_override',
- config.security_params.server_host_override,
- ),)
- self._channel = aio.secure_channel(
- address, channel_credentials,
- unique_option + channel_args + server_host_override_option)
- else:
- self._channel = aio.insecure_channel(address,
- options=unique_option +
- channel_args)
-
- # Creates the stub
- if config.payload_config.WhichOneof('payload') == 'simple_params':
- self._generic = False
- self._stub = benchmark_service_pb2_grpc.BenchmarkServiceStub(
- self._channel)
- payload = messages_pb2.Payload(
- body=b'\0' * config.payload_config.simple_params.req_size)
- self._request = messages_pb2.SimpleRequest(
- payload=payload,
- response_size=config.payload_config.simple_params.resp_size)
- else:
- self._generic = True
- self._stub = GenericStub(self._channel)
- self._request = b'\0' * config.payload_config.bytebuf_params.req_size
-
- self._hist = hist
- self._response_callbacks = []
- self._concurrency = config.outstanding_rpcs_per_channel
-
- async def run(self) -> None:
- await self._channel.channel_ready()
-
- async def stop(self) -> None:
- await self._channel.close()
-
- def _record_query_time(self, query_time: float) -> None:
- self._hist.add(query_time * 1e9)
-
-
-class UnaryAsyncBenchmarkClient(BenchmarkClient):
-
- def __init__(self, address: str, config: control_pb2.ClientConfig,
- hist: histogram.Histogram):
- super().__init__(address, config, hist)
- self._running = None
- self._stopped = asyncio.Event()
-
- async def _send_request(self):
- start_time = time.monotonic()
- await self._stub.UnaryCall(self._request)
- self._record_query_time(time.monotonic() - start_time)
-
- async def _send_indefinitely(self) -> None:
- while self._running:
- await self._send_request()
-
- async def run(self) -> None:
- await super().run()
- self._running = True
- senders = (self._send_indefinitely() for _ in range(self._concurrency))
- await asyncio.gather(*senders)
- self._stopped.set()
-
- async def stop(self) -> None:
- self._running = False
- await self._stopped.wait()
- await super().stop()
-
-
-class StreamingAsyncBenchmarkClient(BenchmarkClient):
-
- def __init__(self, address: str, config: control_pb2.ClientConfig,
- hist: histogram.Histogram):
- super().__init__(address, config, hist)
- self._running = None
- self._stopped = asyncio.Event()
-
- async def _one_streaming_call(self):
- call = self._stub.StreamingCall()
- while self._running:
- start_time = time.time()
- await call.write(self._request)
- await call.read()
- self._record_query_time(time.time() - start_time)
- await call.done_writing()
-
- async def run(self):
- await super().run()
- self._running = True
- senders = (self._one_streaming_call() for _ in range(self._concurrency))
- await asyncio.gather(*senders)
- self._stopped.set()
-
- async def stop(self):
- self._running = False
- await self._stopped.wait()
- await super().stop()
+# Copyright 2020 The gRPC Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+"""The Python AsyncIO Benchmark Clients."""
+
+import abc
+import asyncio
+import time
+import logging
+import random
+
+import grpc
+from grpc.experimental import aio
+
+from src.proto.grpc.testing import (benchmark_service_pb2_grpc, control_pb2,
+ messages_pb2)
+from tests.qps import histogram
+from tests.unit import resources
+
+
+class GenericStub(object):
+
+ def __init__(self, channel: aio.Channel):
+ self.UnaryCall = channel.unary_unary(
+ '/grpc.testing.BenchmarkService/UnaryCall')
+ self.StreamingCall = channel.stream_stream(
+ '/grpc.testing.BenchmarkService/StreamingCall')
+
+
+class BenchmarkClient(abc.ABC):
+ """Benchmark client interface that exposes a non-blocking send_request()."""
+
+ def __init__(self, address: str, config: control_pb2.ClientConfig,
+ hist: histogram.Histogram):
+ # Disables underlying reuse of subchannels
+ unique_option = (('iv', random.random()),)
+
+ # Parses the channel argument from config
+ channel_args = tuple(
+ (arg.name, arg.str_value) if arg.HasField('str_value') else (
+ arg.name, int(arg.int_value)) for arg in config.channel_args)
+
+ # Creates the channel
+ if config.HasField('security_params'):
+ channel_credentials = grpc.ssl_channel_credentials(
+ resources.test_root_certificates(),)
+ server_host_override_option = ((
+ 'grpc.ssl_target_name_override',
+ config.security_params.server_host_override,
+ ),)
+ self._channel = aio.secure_channel(
+ address, channel_credentials,
+ unique_option + channel_args + server_host_override_option)
+ else:
+ self._channel = aio.insecure_channel(address,
+ options=unique_option +
+ channel_args)
+
+ # Creates the stub
+ if config.payload_config.WhichOneof('payload') == 'simple_params':
+ self._generic = False
+ self._stub = benchmark_service_pb2_grpc.BenchmarkServiceStub(
+ self._channel)
+ payload = messages_pb2.Payload(
+ body=b'\0' * config.payload_config.simple_params.req_size)
+ self._request = messages_pb2.SimpleRequest(
+ payload=payload,
+ response_size=config.payload_config.simple_params.resp_size)
+ else:
+ self._generic = True
+ self._stub = GenericStub(self._channel)
+ self._request = b'\0' * config.payload_config.bytebuf_params.req_size
+
+ self._hist = hist
+ self._response_callbacks = []
+ self._concurrency = config.outstanding_rpcs_per_channel
+
+ async def run(self) -> None:
+ await self._channel.channel_ready()
+
+ async def stop(self) -> None:
+ await self._channel.close()
+
+ def _record_query_time(self, query_time: float) -> None:
+ self._hist.add(query_time * 1e9)
+
+
+class UnaryAsyncBenchmarkClient(BenchmarkClient):
+
+ def __init__(self, address: str, config: control_pb2.ClientConfig,
+ hist: histogram.Histogram):
+ super().__init__(address, config, hist)
+ self._running = None
+ self._stopped = asyncio.Event()
+
+ async def _send_request(self):
+ start_time = time.monotonic()
+ await self._stub.UnaryCall(self._request)
+ self._record_query_time(time.monotonic() - start_time)
+
+ async def _send_indefinitely(self) -> None:
+ while self._running:
+ await self._send_request()
+
+ async def run(self) -> None:
+ await super().run()
+ self._running = True
+ senders = (self._send_indefinitely() for _ in range(self._concurrency))
+ await asyncio.gather(*senders)
+ self._stopped.set()
+
+ async def stop(self) -> None:
+ self._running = False
+ await self._stopped.wait()
+ await super().stop()
+
+
+class StreamingAsyncBenchmarkClient(BenchmarkClient):
+
+ def __init__(self, address: str, config: control_pb2.ClientConfig,
+ hist: histogram.Histogram):
+ super().__init__(address, config, hist)
+ self._running = None
+ self._stopped = asyncio.Event()
+
+ async def _one_streaming_call(self):
+ call = self._stub.StreamingCall()
+ while self._running:
+ start_time = time.time()
+ await call.write(self._request)
+ await call.read()
+ self._record_query_time(time.time() - start_time)
+ await call.done_writing()
+
+ async def run(self):
+ await super().run()
+ self._running = True
+ senders = (self._one_streaming_call() for _ in range(self._concurrency))
+ await asyncio.gather(*senders)
+ self._stopped.set()
+
+ async def stop(self):
+ self._running = False
+ await self._stopped.wait()
+ await super().stop()
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/benchmark/benchmark_servicer.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/benchmark/benchmark_servicer.py
index 2286ebda107..50d3065cd19 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/benchmark/benchmark_servicer.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/benchmark/benchmark_servicer.py
@@ -1,55 +1,55 @@
-# Copyright 2020 The gRPC Authors
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-"""The Python AsyncIO Benchmark Servicers."""
-
-import asyncio
-import logging
-import unittest
-
-from grpc.experimental import aio
-
-from src.proto.grpc.testing import benchmark_service_pb2_grpc, messages_pb2
-
-
-class BenchmarkServicer(benchmark_service_pb2_grpc.BenchmarkServiceServicer):
-
- async def UnaryCall(self, request, unused_context):
- payload = messages_pb2.Payload(body=b'\0' * request.response_size)
- return messages_pb2.SimpleResponse(payload=payload)
-
- async def StreamingFromServer(self, request, unused_context):
- payload = messages_pb2.Payload(body=b'\0' * request.response_size)
- # Sends response at full capacity!
- while True:
- yield messages_pb2.SimpleResponse(payload=payload)
-
- async def StreamingCall(self, request_iterator, unused_context):
- async for request in request_iterator:
- payload = messages_pb2.Payload(body=b'\0' * request.response_size)
- yield messages_pb2.SimpleResponse(payload=payload)
-
-
-class GenericBenchmarkServicer(
- benchmark_service_pb2_grpc.BenchmarkServiceServicer):
- """Generic (no-codec) Server implementation for the Benchmark service."""
-
- def __init__(self, resp_size):
- self._response = '\0' * resp_size
-
- async def UnaryCall(self, unused_request, unused_context):
- return self._response
-
- async def StreamingCall(self, request_iterator, unused_context):
- async for _ in request_iterator:
- yield self._response
+# Copyright 2020 The gRPC Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+"""The Python AsyncIO Benchmark Servicers."""
+
+import asyncio
+import logging
+import unittest
+
+from grpc.experimental import aio
+
+from src.proto.grpc.testing import benchmark_service_pb2_grpc, messages_pb2
+
+
+class BenchmarkServicer(benchmark_service_pb2_grpc.BenchmarkServiceServicer):
+
+ async def UnaryCall(self, request, unused_context):
+ payload = messages_pb2.Payload(body=b'\0' * request.response_size)
+ return messages_pb2.SimpleResponse(payload=payload)
+
+ async def StreamingFromServer(self, request, unused_context):
+ payload = messages_pb2.Payload(body=b'\0' * request.response_size)
+ # Sends response at full capacity!
+ while True:
+ yield messages_pb2.SimpleResponse(payload=payload)
+
+ async def StreamingCall(self, request_iterator, unused_context):
+ async for request in request_iterator:
+ payload = messages_pb2.Payload(body=b'\0' * request.response_size)
+ yield messages_pb2.SimpleResponse(payload=payload)
+
+
+class GenericBenchmarkServicer(
+ benchmark_service_pb2_grpc.BenchmarkServiceServicer):
+ """Generic (no-codec) Server implementation for the Benchmark service."""
+
+ def __init__(self, resp_size):
+ self._response = '\0' * resp_size
+
+ async def UnaryCall(self, unused_request, unused_context):
+ return self._response
+
+ async def StreamingCall(self, request_iterator, unused_context):
+ async for _ in request_iterator:
+ yield self._response
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/benchmark/server.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/benchmark/server.py
index 727e4b7bf98..561298a626b 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/benchmark/server.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/benchmark/server.py
@@ -17,21 +17,21 @@ import logging
import unittest
from grpc.experimental import aio
-
+
from src.proto.grpc.testing import benchmark_service_pb2_grpc
-from tests_aio.benchmark import benchmark_servicer
+from tests_aio.benchmark import benchmark_servicer
async def _start_async_server():
server = aio.server()
- port = server.add_insecure_port('localhost:%s' % 50051)
- servicer = benchmark_servicer.BenchmarkServicer()
+ port = server.add_insecure_port('localhost:%s' % 50051)
+ servicer = benchmark_servicer.BenchmarkServicer()
benchmark_service_pb2_grpc.add_BenchmarkServiceServicer_to_server(
servicer, server)
await server.start()
- logging.info('Benchmark server started at :%d' % port)
+ logging.info('Benchmark server started at :%d' % port)
await server.wait_for_termination()
@@ -42,5 +42,5 @@ def main():
if __name__ == '__main__':
- logging.basicConfig(level=logging.DEBUG)
+ logging.basicConfig(level=logging.DEBUG)
main()
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/benchmark/worker.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/benchmark/worker.py
index d15bdcbf088..dc16f050872 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/benchmark/worker.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/benchmark/worker.py
@@ -1,59 +1,59 @@
-# Copyright 2020 The gRPC Authors
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-import argparse
-import asyncio
-import logging
-
-from grpc.experimental import aio
-
-from src.proto.grpc.testing import worker_service_pb2_grpc
-from tests_aio.benchmark import worker_servicer
-
-
-async def run_worker_server(port: int) -> None:
- server = aio.server()
-
- servicer = worker_servicer.WorkerServicer()
- worker_service_pb2_grpc.add_WorkerServiceServicer_to_server(
- servicer, server)
-
- server.add_insecure_port('[::]:{}'.format(port))
-
- await server.start()
-
- await servicer.wait_for_quit()
- await server.stop(None)
-
-
-if __name__ == '__main__':
- logging.basicConfig(level=logging.DEBUG)
- parser = argparse.ArgumentParser(
- description='gRPC Python performance testing worker')
- parser.add_argument('--driver_port',
- type=int,
- dest='port',
- help='The port the worker should listen on')
- parser.add_argument('--uvloop',
- action='store_true',
- help='Use uvloop or not')
- args = parser.parse_args()
-
- if args.uvloop:
- import uvloop
- asyncio.set_event_loop_policy(uvloop.EventLoopPolicy())
- loop = uvloop.new_event_loop()
- asyncio.set_event_loop(loop)
-
- asyncio.get_event_loop().run_until_complete(run_worker_server(args.port))
+# Copyright 2020 The gRPC Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import argparse
+import asyncio
+import logging
+
+from grpc.experimental import aio
+
+from src.proto.grpc.testing import worker_service_pb2_grpc
+from tests_aio.benchmark import worker_servicer
+
+
+async def run_worker_server(port: int) -> None:
+ server = aio.server()
+
+ servicer = worker_servicer.WorkerServicer()
+ worker_service_pb2_grpc.add_WorkerServiceServicer_to_server(
+ servicer, server)
+
+ server.add_insecure_port('[::]:{}'.format(port))
+
+ await server.start()
+
+ await servicer.wait_for_quit()
+ await server.stop(None)
+
+
+if __name__ == '__main__':
+ logging.basicConfig(level=logging.DEBUG)
+ parser = argparse.ArgumentParser(
+ description='gRPC Python performance testing worker')
+ parser.add_argument('--driver_port',
+ type=int,
+ dest='port',
+ help='The port the worker should listen on')
+ parser.add_argument('--uvloop',
+ action='store_true',
+ help='Use uvloop or not')
+ args = parser.parse_args()
+
+ if args.uvloop:
+ import uvloop
+ asyncio.set_event_loop_policy(uvloop.EventLoopPolicy())
+ loop = uvloop.new_event_loop()
+ asyncio.set_event_loop(loop)
+
+ asyncio.get_event_loop().run_until_complete(run_worker_server(args.port))
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/benchmark/worker_servicer.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/benchmark/worker_servicer.py
index 3b335556cf1..4f80095cd20 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/benchmark/worker_servicer.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/benchmark/worker_servicer.py
@@ -1,367 +1,367 @@
-# Copyright 2020 The gRPC Authors
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-import asyncio
-import collections
-import logging
-import multiprocessing
-import os
-import sys
-import time
-from typing import Tuple
-
-import grpc
-from grpc.experimental import aio
-
-from src.proto.grpc.testing import (benchmark_service_pb2_grpc, control_pb2,
- stats_pb2, worker_service_pb2_grpc)
-from tests.qps import histogram
-from tests.unit import resources
-from tests.unit.framework.common import get_socket
-from tests_aio.benchmark import benchmark_client, benchmark_servicer
-
-_NUM_CORES = multiprocessing.cpu_count()
-_WORKER_ENTRY_FILE = os.path.join(
- os.path.split(os.path.abspath(__file__))[0], 'worker.py')
-
-_LOGGER = logging.getLogger(__name__)
-
-
-class _SubWorker(
- collections.namedtuple('_SubWorker',
- ['process', 'port', 'channel', 'stub'])):
- """A data class that holds information about a child qps worker."""
-
- def _repr(self):
- return f'<_SubWorker pid={self.process.pid} port={self.port}>'
-
- def __repr__(self):
- return self._repr()
-
- def __str__(self):
- return self._repr()
-
-
-def _get_server_status(start_time: float, end_time: float,
- port: int) -> control_pb2.ServerStatus:
- """Creates ServerStatus proto message."""
- end_time = time.monotonic()
- elapsed_time = end_time - start_time
- # TODO(lidiz) Collect accurate time system to compute QPS/core-second.
- stats = stats_pb2.ServerStats(time_elapsed=elapsed_time,
- time_user=elapsed_time,
- time_system=elapsed_time)
- return control_pb2.ServerStatus(stats=stats, port=port, cores=_NUM_CORES)
-
-
-def _create_server(config: control_pb2.ServerConfig) -> Tuple[aio.Server, int]:
- """Creates a server object according to the ServerConfig."""
- channel_args = tuple(
- (arg.name,
- arg.str_value) if arg.HasField('str_value') else (arg.name,
- int(arg.int_value))
- for arg in config.channel_args)
-
- server = aio.server(options=channel_args + (('grpc.so_reuseport', 1),))
- if config.server_type == control_pb2.ASYNC_SERVER:
- servicer = benchmark_servicer.BenchmarkServicer()
- benchmark_service_pb2_grpc.add_BenchmarkServiceServicer_to_server(
- servicer, server)
- elif config.server_type == control_pb2.ASYNC_GENERIC_SERVER:
- resp_size = config.payload_config.bytebuf_params.resp_size
- servicer = benchmark_servicer.GenericBenchmarkServicer(resp_size)
- method_implementations = {
- 'StreamingCall':
- grpc.stream_stream_rpc_method_handler(servicer.StreamingCall),
- 'UnaryCall':
- grpc.unary_unary_rpc_method_handler(servicer.UnaryCall),
- }
- handler = grpc.method_handlers_generic_handler(
- 'grpc.testing.BenchmarkService', method_implementations)
- server.add_generic_rpc_handlers((handler,))
- else:
- raise NotImplementedError('Unsupported server type {}'.format(
- config.server_type))
-
- if config.HasField('security_params'): # Use SSL
- server_creds = grpc.ssl_server_credentials(
- ((resources.private_key(), resources.certificate_chain()),))
- port = server.add_secure_port('[::]:{}'.format(config.port),
- server_creds)
- else:
- port = server.add_insecure_port('[::]:{}'.format(config.port))
-
- return server, port
-
-
-def _get_client_status(start_time: float, end_time: float,
- qps_data: histogram.Histogram
- ) -> control_pb2.ClientStatus:
- """Creates ClientStatus proto message."""
- latencies = qps_data.get_data()
- end_time = time.monotonic()
- elapsed_time = end_time - start_time
- # TODO(lidiz) Collect accurate time system to compute QPS/core-second.
- stats = stats_pb2.ClientStats(latencies=latencies,
- time_elapsed=elapsed_time,
- time_user=elapsed_time,
- time_system=elapsed_time)
- return control_pb2.ClientStatus(stats=stats)
-
-
-def _create_client(server: str, config: control_pb2.ClientConfig,
- qps_data: histogram.Histogram
- ) -> benchmark_client.BenchmarkClient:
- """Creates a client object according to the ClientConfig."""
- if config.load_params.WhichOneof('load') != 'closed_loop':
- raise NotImplementedError(
- f'Unsupported load parameter {config.load_params}')
-
- if config.client_type == control_pb2.ASYNC_CLIENT:
- if config.rpc_type == control_pb2.UNARY:
- client_type = benchmark_client.UnaryAsyncBenchmarkClient
- elif config.rpc_type == control_pb2.STREAMING:
- client_type = benchmark_client.StreamingAsyncBenchmarkClient
- else:
- raise NotImplementedError(
- f'Unsupported rpc_type [{config.rpc_type}]')
- else:
- raise NotImplementedError(
- f'Unsupported client type {config.client_type}')
-
- return client_type(server, config, qps_data)
-
-
-def _pick_an_unused_port() -> int:
- """Picks an unused TCP port."""
- _, port, sock = get_socket()
- sock.close()
- return port
-
-
-async def _create_sub_worker() -> _SubWorker:
- """Creates a child qps worker as a subprocess."""
- port = _pick_an_unused_port()
-
- _LOGGER.info('Creating sub worker at port [%d]...', port)
- process = await asyncio.create_subprocess_exec(sys.executable,
- _WORKER_ENTRY_FILE,
- '--driver_port', str(port))
- _LOGGER.info('Created sub worker process for port [%d] at pid [%d]', port,
- process.pid)
- channel = aio.insecure_channel(f'localhost:{port}')
- _LOGGER.info('Waiting for sub worker at port [%d]', port)
- await channel.channel_ready()
- stub = worker_service_pb2_grpc.WorkerServiceStub(channel)
- return _SubWorker(
- process=process,
- port=port,
- channel=channel,
- stub=stub,
- )
-
-
-class WorkerServicer(worker_service_pb2_grpc.WorkerServiceServicer):
- """Python Worker Server implementation."""
-
- def __init__(self):
- self._loop = asyncio.get_event_loop()
- self._quit_event = asyncio.Event()
-
- async def _run_single_server(self, config, request_iterator, context):
- server, port = _create_server(config)
- await server.start()
- _LOGGER.info('Server started at port [%d]', port)
-
- start_time = time.monotonic()
- await context.write(_get_server_status(start_time, start_time, port))
-
- async for request in request_iterator:
- end_time = time.monotonic()
- status = _get_server_status(start_time, end_time, port)
- if request.mark.reset:
- start_time = end_time
- await context.write(status)
- await server.stop(None)
-
- async def RunServer(self, request_iterator, context):
- config_request = await context.read()
- config = config_request.setup
- _LOGGER.info('Received ServerConfig: %s', config)
-
- if config.server_processes <= 0:
- _LOGGER.info('Using server_processes == [%d]', _NUM_CORES)
- config.server_processes = _NUM_CORES
-
- if config.port == 0:
- config.port = _pick_an_unused_port()
- _LOGGER.info('Port picked [%d]', config.port)
-
- if config.server_processes == 1:
- # If server_processes == 1, start the server in this process.
- await self._run_single_server(config, request_iterator, context)
- else:
- # If server_processes > 1, offload to other processes.
- sub_workers = await asyncio.gather(*(
- _create_sub_worker() for _ in range(config.server_processes)))
-
- calls = [worker.stub.RunServer() for worker in sub_workers]
-
- config_request.setup.server_processes = 1
-
- for call in calls:
- await call.write(config_request)
- # An empty status indicates the peer is ready
- await call.read()
-
- start_time = time.monotonic()
- await context.write(
- _get_server_status(
- start_time,
- start_time,
- config.port,
- ))
-
- _LOGGER.info('Servers are ready to serve.')
-
- async for request in request_iterator:
- end_time = time.monotonic()
-
- for call in calls:
- await call.write(request)
- # Reports from sub workers doesn't matter
- await call.read()
-
- status = _get_server_status(
- start_time,
- end_time,
- config.port,
- )
- if request.mark.reset:
- start_time = end_time
- await context.write(status)
-
- for call in calls:
- await call.done_writing()
-
- for worker in sub_workers:
- await worker.stub.QuitWorker(control_pb2.Void())
- await worker.channel.close()
- _LOGGER.info('Waiting for [%s] to quit...', worker)
- await worker.process.wait()
-
- async def _run_single_client(self, config, request_iterator, context):
- running_tasks = []
- qps_data = histogram.Histogram(config.histogram_params.resolution,
- config.histogram_params.max_possible)
- start_time = time.monotonic()
-
- # Create a client for each channel as asyncio.Task
- for i in range(config.client_channels):
- server = config.server_targets[i % len(config.server_targets)]
- client = _create_client(server, config, qps_data)
- _LOGGER.info('Client created against server [%s]', server)
- running_tasks.append(self._loop.create_task(client.run()))
-
- end_time = time.monotonic()
- await context.write(_get_client_status(start_time, end_time, qps_data))
-
- # Respond to stat requests
- async for request in request_iterator:
- end_time = time.monotonic()
- status = _get_client_status(start_time, end_time, qps_data)
- if request.mark.reset:
- qps_data.reset()
- start_time = time.monotonic()
- await context.write(status)
-
- # Cleanup the clients
- for task in running_tasks:
- task.cancel()
-
- async def RunClient(self, request_iterator, context):
- config_request = await context.read()
- config = config_request.setup
- _LOGGER.info('Received ClientConfig: %s', config)
-
- if config.client_processes <= 0:
- _LOGGER.info('client_processes can\'t be [%d]',
- config.client_processes)
- _LOGGER.info('Using client_processes == [%d]', _NUM_CORES)
- config.client_processes = _NUM_CORES
-
- if config.client_processes == 1:
- # If client_processes == 1, run the benchmark in this process.
- await self._run_single_client(config, request_iterator, context)
- else:
- # If client_processes > 1, offload the work to other processes.
- sub_workers = await asyncio.gather(*(
- _create_sub_worker() for _ in range(config.client_processes)))
-
- calls = [worker.stub.RunClient() for worker in sub_workers]
-
- config_request.setup.client_processes = 1
-
- for call in calls:
- await call.write(config_request)
- # An empty status indicates the peer is ready
- await call.read()
-
- start_time = time.monotonic()
- result = histogram.Histogram(config.histogram_params.resolution,
- config.histogram_params.max_possible)
- end_time = time.monotonic()
- await context.write(_get_client_status(start_time, end_time,
- result))
-
- async for request in request_iterator:
- end_time = time.monotonic()
-
- for call in calls:
- _LOGGER.debug('Fetching status...')
- await call.write(request)
- sub_status = await call.read()
- result.merge(sub_status.stats.latencies)
- _LOGGER.debug('Update from sub worker count=[%d]',
- sub_status.stats.latencies.count)
-
- status = _get_client_status(start_time, end_time, result)
- if request.mark.reset:
- result.reset()
- start_time = time.monotonic()
- _LOGGER.debug('Reporting count=[%d]',
- status.stats.latencies.count)
- await context.write(status)
-
- for call in calls:
- await call.done_writing()
-
- for worker in sub_workers:
- await worker.stub.QuitWorker(control_pb2.Void())
- await worker.channel.close()
- _LOGGER.info('Waiting for sub worker [%s] to quit...', worker)
- await worker.process.wait()
- _LOGGER.info('Sub worker [%s] quit', worker)
-
- @staticmethod
- async def CoreCount(unused_request, unused_context):
- return control_pb2.CoreResponse(cores=_NUM_CORES)
-
- async def QuitWorker(self, unused_request, unused_context):
- _LOGGER.info('QuitWorker command received.')
- self._quit_event.set()
- return control_pb2.Void()
-
- async def wait_for_quit(self):
- await self._quit_event.wait()
+# Copyright 2020 The gRPC Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import asyncio
+import collections
+import logging
+import multiprocessing
+import os
+import sys
+import time
+from typing import Tuple
+
+import grpc
+from grpc.experimental import aio
+
+from src.proto.grpc.testing import (benchmark_service_pb2_grpc, control_pb2,
+ stats_pb2, worker_service_pb2_grpc)
+from tests.qps import histogram
+from tests.unit import resources
+from tests.unit.framework.common import get_socket
+from tests_aio.benchmark import benchmark_client, benchmark_servicer
+
+_NUM_CORES = multiprocessing.cpu_count()
+_WORKER_ENTRY_FILE = os.path.join(
+ os.path.split(os.path.abspath(__file__))[0], 'worker.py')
+
+_LOGGER = logging.getLogger(__name__)
+
+
+class _SubWorker(
+ collections.namedtuple('_SubWorker',
+ ['process', 'port', 'channel', 'stub'])):
+ """A data class that holds information about a child qps worker."""
+
+ def _repr(self):
+ return f'<_SubWorker pid={self.process.pid} port={self.port}>'
+
+ def __repr__(self):
+ return self._repr()
+
+ def __str__(self):
+ return self._repr()
+
+
+def _get_server_status(start_time: float, end_time: float,
+ port: int) -> control_pb2.ServerStatus:
+ """Creates ServerStatus proto message."""
+ end_time = time.monotonic()
+ elapsed_time = end_time - start_time
+ # TODO(lidiz) Collect accurate time system to compute QPS/core-second.
+ stats = stats_pb2.ServerStats(time_elapsed=elapsed_time,
+ time_user=elapsed_time,
+ time_system=elapsed_time)
+ return control_pb2.ServerStatus(stats=stats, port=port, cores=_NUM_CORES)
+
+
+def _create_server(config: control_pb2.ServerConfig) -> Tuple[aio.Server, int]:
+ """Creates a server object according to the ServerConfig."""
+ channel_args = tuple(
+ (arg.name,
+ arg.str_value) if arg.HasField('str_value') else (arg.name,
+ int(arg.int_value))
+ for arg in config.channel_args)
+
+ server = aio.server(options=channel_args + (('grpc.so_reuseport', 1),))
+ if config.server_type == control_pb2.ASYNC_SERVER:
+ servicer = benchmark_servicer.BenchmarkServicer()
+ benchmark_service_pb2_grpc.add_BenchmarkServiceServicer_to_server(
+ servicer, server)
+ elif config.server_type == control_pb2.ASYNC_GENERIC_SERVER:
+ resp_size = config.payload_config.bytebuf_params.resp_size
+ servicer = benchmark_servicer.GenericBenchmarkServicer(resp_size)
+ method_implementations = {
+ 'StreamingCall':
+ grpc.stream_stream_rpc_method_handler(servicer.StreamingCall),
+ 'UnaryCall':
+ grpc.unary_unary_rpc_method_handler(servicer.UnaryCall),
+ }
+ handler = grpc.method_handlers_generic_handler(
+ 'grpc.testing.BenchmarkService', method_implementations)
+ server.add_generic_rpc_handlers((handler,))
+ else:
+ raise NotImplementedError('Unsupported server type {}'.format(
+ config.server_type))
+
+ if config.HasField('security_params'): # Use SSL
+ server_creds = grpc.ssl_server_credentials(
+ ((resources.private_key(), resources.certificate_chain()),))
+ port = server.add_secure_port('[::]:{}'.format(config.port),
+ server_creds)
+ else:
+ port = server.add_insecure_port('[::]:{}'.format(config.port))
+
+ return server, port
+
+
+def _get_client_status(start_time: float, end_time: float,
+ qps_data: histogram.Histogram
+ ) -> control_pb2.ClientStatus:
+ """Creates ClientStatus proto message."""
+ latencies = qps_data.get_data()
+ end_time = time.monotonic()
+ elapsed_time = end_time - start_time
+ # TODO(lidiz) Collect accurate time system to compute QPS/core-second.
+ stats = stats_pb2.ClientStats(latencies=latencies,
+ time_elapsed=elapsed_time,
+ time_user=elapsed_time,
+ time_system=elapsed_time)
+ return control_pb2.ClientStatus(stats=stats)
+
+
+def _create_client(server: str, config: control_pb2.ClientConfig,
+ qps_data: histogram.Histogram
+ ) -> benchmark_client.BenchmarkClient:
+ """Creates a client object according to the ClientConfig."""
+ if config.load_params.WhichOneof('load') != 'closed_loop':
+ raise NotImplementedError(
+ f'Unsupported load parameter {config.load_params}')
+
+ if config.client_type == control_pb2.ASYNC_CLIENT:
+ if config.rpc_type == control_pb2.UNARY:
+ client_type = benchmark_client.UnaryAsyncBenchmarkClient
+ elif config.rpc_type == control_pb2.STREAMING:
+ client_type = benchmark_client.StreamingAsyncBenchmarkClient
+ else:
+ raise NotImplementedError(
+ f'Unsupported rpc_type [{config.rpc_type}]')
+ else:
+ raise NotImplementedError(
+ f'Unsupported client type {config.client_type}')
+
+ return client_type(server, config, qps_data)
+
+
+def _pick_an_unused_port() -> int:
+ """Picks an unused TCP port."""
+ _, port, sock = get_socket()
+ sock.close()
+ return port
+
+
+async def _create_sub_worker() -> _SubWorker:
+ """Creates a child qps worker as a subprocess."""
+ port = _pick_an_unused_port()
+
+ _LOGGER.info('Creating sub worker at port [%d]...', port)
+ process = await asyncio.create_subprocess_exec(sys.executable,
+ _WORKER_ENTRY_FILE,
+ '--driver_port', str(port))
+ _LOGGER.info('Created sub worker process for port [%d] at pid [%d]', port,
+ process.pid)
+ channel = aio.insecure_channel(f'localhost:{port}')
+ _LOGGER.info('Waiting for sub worker at port [%d]', port)
+ await channel.channel_ready()
+ stub = worker_service_pb2_grpc.WorkerServiceStub(channel)
+ return _SubWorker(
+ process=process,
+ port=port,
+ channel=channel,
+ stub=stub,
+ )
+
+
+class WorkerServicer(worker_service_pb2_grpc.WorkerServiceServicer):
+ """Python Worker Server implementation."""
+
+ def __init__(self):
+ self._loop = asyncio.get_event_loop()
+ self._quit_event = asyncio.Event()
+
+ async def _run_single_server(self, config, request_iterator, context):
+ server, port = _create_server(config)
+ await server.start()
+ _LOGGER.info('Server started at port [%d]', port)
+
+ start_time = time.monotonic()
+ await context.write(_get_server_status(start_time, start_time, port))
+
+ async for request in request_iterator:
+ end_time = time.monotonic()
+ status = _get_server_status(start_time, end_time, port)
+ if request.mark.reset:
+ start_time = end_time
+ await context.write(status)
+ await server.stop(None)
+
+ async def RunServer(self, request_iterator, context):
+ config_request = await context.read()
+ config = config_request.setup
+ _LOGGER.info('Received ServerConfig: %s', config)
+
+ if config.server_processes <= 0:
+ _LOGGER.info('Using server_processes == [%d]', _NUM_CORES)
+ config.server_processes = _NUM_CORES
+
+ if config.port == 0:
+ config.port = _pick_an_unused_port()
+ _LOGGER.info('Port picked [%d]', config.port)
+
+ if config.server_processes == 1:
+ # If server_processes == 1, start the server in this process.
+ await self._run_single_server(config, request_iterator, context)
+ else:
+ # If server_processes > 1, offload to other processes.
+ sub_workers = await asyncio.gather(*(
+ _create_sub_worker() for _ in range(config.server_processes)))
+
+ calls = [worker.stub.RunServer() for worker in sub_workers]
+
+ config_request.setup.server_processes = 1
+
+ for call in calls:
+ await call.write(config_request)
+ # An empty status indicates the peer is ready
+ await call.read()
+
+ start_time = time.monotonic()
+ await context.write(
+ _get_server_status(
+ start_time,
+ start_time,
+ config.port,
+ ))
+
+ _LOGGER.info('Servers are ready to serve.')
+
+ async for request in request_iterator:
+ end_time = time.monotonic()
+
+ for call in calls:
+ await call.write(request)
+ # Reports from sub workers doesn't matter
+ await call.read()
+
+ status = _get_server_status(
+ start_time,
+ end_time,
+ config.port,
+ )
+ if request.mark.reset:
+ start_time = end_time
+ await context.write(status)
+
+ for call in calls:
+ await call.done_writing()
+
+ for worker in sub_workers:
+ await worker.stub.QuitWorker(control_pb2.Void())
+ await worker.channel.close()
+ _LOGGER.info('Waiting for [%s] to quit...', worker)
+ await worker.process.wait()
+
+ async def _run_single_client(self, config, request_iterator, context):
+ running_tasks = []
+ qps_data = histogram.Histogram(config.histogram_params.resolution,
+ config.histogram_params.max_possible)
+ start_time = time.monotonic()
+
+ # Create a client for each channel as asyncio.Task
+ for i in range(config.client_channels):
+ server = config.server_targets[i % len(config.server_targets)]
+ client = _create_client(server, config, qps_data)
+ _LOGGER.info('Client created against server [%s]', server)
+ running_tasks.append(self._loop.create_task(client.run()))
+
+ end_time = time.monotonic()
+ await context.write(_get_client_status(start_time, end_time, qps_data))
+
+ # Respond to stat requests
+ async for request in request_iterator:
+ end_time = time.monotonic()
+ status = _get_client_status(start_time, end_time, qps_data)
+ if request.mark.reset:
+ qps_data.reset()
+ start_time = time.monotonic()
+ await context.write(status)
+
+ # Cleanup the clients
+ for task in running_tasks:
+ task.cancel()
+
+ async def RunClient(self, request_iterator, context):
+ config_request = await context.read()
+ config = config_request.setup
+ _LOGGER.info('Received ClientConfig: %s', config)
+
+ if config.client_processes <= 0:
+ _LOGGER.info('client_processes can\'t be [%d]',
+ config.client_processes)
+ _LOGGER.info('Using client_processes == [%d]', _NUM_CORES)
+ config.client_processes = _NUM_CORES
+
+ if config.client_processes == 1:
+ # If client_processes == 1, run the benchmark in this process.
+ await self._run_single_client(config, request_iterator, context)
+ else:
+ # If client_processes > 1, offload the work to other processes.
+ sub_workers = await asyncio.gather(*(
+ _create_sub_worker() for _ in range(config.client_processes)))
+
+ calls = [worker.stub.RunClient() for worker in sub_workers]
+
+ config_request.setup.client_processes = 1
+
+ for call in calls:
+ await call.write(config_request)
+ # An empty status indicates the peer is ready
+ await call.read()
+
+ start_time = time.monotonic()
+ result = histogram.Histogram(config.histogram_params.resolution,
+ config.histogram_params.max_possible)
+ end_time = time.monotonic()
+ await context.write(_get_client_status(start_time, end_time,
+ result))
+
+ async for request in request_iterator:
+ end_time = time.monotonic()
+
+ for call in calls:
+ _LOGGER.debug('Fetching status...')
+ await call.write(request)
+ sub_status = await call.read()
+ result.merge(sub_status.stats.latencies)
+ _LOGGER.debug('Update from sub worker count=[%d]',
+ sub_status.stats.latencies.count)
+
+ status = _get_client_status(start_time, end_time, result)
+ if request.mark.reset:
+ result.reset()
+ start_time = time.monotonic()
+ _LOGGER.debug('Reporting count=[%d]',
+ status.stats.latencies.count)
+ await context.write(status)
+
+ for call in calls:
+ await call.done_writing()
+
+ for worker in sub_workers:
+ await worker.stub.QuitWorker(control_pb2.Void())
+ await worker.channel.close()
+ _LOGGER.info('Waiting for sub worker [%s] to quit...', worker)
+ await worker.process.wait()
+ _LOGGER.info('Sub worker [%s] quit', worker)
+
+ @staticmethod
+ async def CoreCount(unused_request, unused_context):
+ return control_pb2.CoreResponse(cores=_NUM_CORES)
+
+ async def QuitWorker(self, unused_request, unused_context):
+ _LOGGER.info('QuitWorker command received.')
+ self._quit_event.set()
+ return control_pb2.Void()
+
+ async def wait_for_quit(self):
+ await self._quit_event.wait()
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/channelz/__init__.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/channelz/__init__.py
index 2cb28cb4645..1517f71d093 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/channelz/__init__.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/channelz/__init__.py
@@ -1,13 +1,13 @@
-# Copyright 2020 The gRPC Authors
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
+# Copyright 2020 The gRPC Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/channelz/channelz_servicer_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/channelz/channelz_servicer_test.py
index eeabf5ed7d9..d6e9fd42791 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/channelz/channelz_servicer_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/channelz/channelz_servicer_test.py
@@ -1,474 +1,474 @@
-# Copyright 2020 The gRPC Authors
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-"""Tests of grpc_channelz.v1.channelz."""
-
-import unittest
-import logging
-import asyncio
-
-import grpc
-from grpc.experimental import aio
-
-from grpc_channelz.v1 import channelz
-from grpc_channelz.v1 import channelz_pb2
-from grpc_channelz.v1 import channelz_pb2_grpc
-
-from tests.unit.framework.common import test_constants
-from tests_aio.unit._test_base import AioTestBase
-
-_SUCCESSFUL_UNARY_UNARY = '/test/SuccessfulUnaryUnary'
-_FAILED_UNARY_UNARY = '/test/FailedUnaryUnary'
-_SUCCESSFUL_STREAM_STREAM = '/test/SuccessfulStreamStream'
-
-_REQUEST = b'\x00\x00\x00'
-_RESPONSE = b'\x01\x01\x01'
-
-_DISABLE_REUSE_PORT = (('grpc.so_reuseport', 0),)
-_ENABLE_CHANNELZ = (('grpc.enable_channelz', 1),)
-_DISABLE_CHANNELZ = (('grpc.enable_channelz', 0),)
-
-_LARGE_UNASSIGNED_ID = 10000
-
-
-async def _successful_unary_unary(request, servicer_context):
- return _RESPONSE
-
-
-async def _failed_unary_unary(request, servicer_context):
- servicer_context.set_code(grpc.StatusCode.INTERNAL)
- servicer_context.set_details("Channelz Test Intended Failure")
-
-
-async def _successful_stream_stream(request_iterator, servicer_context):
- async for _ in request_iterator:
- yield _RESPONSE
-
-
-class _GenericHandler(grpc.GenericRpcHandler):
-
- def service(self, handler_call_details):
- if handler_call_details.method == _SUCCESSFUL_UNARY_UNARY:
- return grpc.unary_unary_rpc_method_handler(_successful_unary_unary)
- elif handler_call_details.method == _FAILED_UNARY_UNARY:
- return grpc.unary_unary_rpc_method_handler(_failed_unary_unary)
- elif handler_call_details.method == _SUCCESSFUL_STREAM_STREAM:
- return grpc.stream_stream_rpc_method_handler(
- _successful_stream_stream)
- else:
- return None
-
-
-class _ChannelServerPair:
-
- def __init__(self):
- self.address = ''
- self.server = None
- self.channel = None
- self.server_ref_id = None
- self.channel_ref_id = None
-
- async def start(self):
- # Server will enable channelz service
- self.server = aio.server(options=_DISABLE_REUSE_PORT + _ENABLE_CHANNELZ)
- port = self.server.add_insecure_port('[::]:0')
- self.address = 'localhost:%d' % port
- self.server.add_generic_rpc_handlers((_GenericHandler(),))
- await self.server.start()
-
- # Channel will enable channelz service...
- self.channel = aio.insecure_channel(self.address,
- options=_ENABLE_CHANNELZ)
-
- async def bind_channelz(self, channelz_stub):
- resp = await channelz_stub.GetTopChannels(
- channelz_pb2.GetTopChannelsRequest(start_channel_id=0))
- for channel in resp.channel:
- if channel.data.target == self.address:
- self.channel_ref_id = channel.ref.channel_id
-
- resp = await channelz_stub.GetServers(
- channelz_pb2.GetServersRequest(start_server_id=0))
- self.server_ref_id = resp.server[-1].ref.server_id
-
- async def stop(self):
- await self.channel.close()
- await self.server.stop(None)
-
-
-async def _create_channel_server_pairs(n, channelz_stub=None):
- """Create channel-server pairs."""
- pairs = [_ChannelServerPair() for i in range(n)]
- for pair in pairs:
- await pair.start()
- if channelz_stub:
- await pair.bind_channelz(channelz_stub)
- return pairs
-
-
-async def _destroy_channel_server_pairs(pairs):
- for pair in pairs:
- await pair.stop()
-
-
-class ChannelzServicerTest(AioTestBase):
-
- async def setUp(self):
- # This server is for Channelz info fetching only
- # It self should not enable Channelz
- self._server = aio.server(options=_DISABLE_REUSE_PORT +
- _DISABLE_CHANNELZ)
- port = self._server.add_insecure_port('[::]:0')
- channelz.add_channelz_servicer(self._server)
- await self._server.start()
-
- # This channel is used to fetch Channelz info only
- # Channelz should not be enabled
- self._channel = aio.insecure_channel('localhost:%d' % port,
- options=_DISABLE_CHANNELZ)
- self._channelz_stub = channelz_pb2_grpc.ChannelzStub(self._channel)
-
- async def tearDown(self):
- await self._channel.close()
- await self._server.stop(None)
-
- async def _get_server_by_ref_id(self, ref_id):
- """Server id may not be consecutive"""
- resp = await self._channelz_stub.GetServers(
- channelz_pb2.GetServersRequest(start_server_id=ref_id))
- self.assertEqual(ref_id, resp.server[0].ref.server_id)
- return resp.server[0]
-
- async def _send_successful_unary_unary(self, pair):
- call = pair.channel.unary_unary(_SUCCESSFUL_UNARY_UNARY)(_REQUEST)
- self.assertEqual(grpc.StatusCode.OK, await call.code())
-
- async def _send_failed_unary_unary(self, pair):
- try:
- await pair.channel.unary_unary(_FAILED_UNARY_UNARY)(_REQUEST)
- except grpc.RpcError:
- return
- else:
- self.fail("This call supposed to fail")
-
- async def _send_successful_stream_stream(self, pair):
- call = pair.channel.stream_stream(_SUCCESSFUL_STREAM_STREAM)(iter(
- [_REQUEST] * test_constants.STREAM_LENGTH))
- cnt = 0
- async for _ in call:
- cnt += 1
- self.assertEqual(cnt, test_constants.STREAM_LENGTH)
-
- async def test_get_top_channels_high_start_id(self):
- pairs = await _create_channel_server_pairs(1)
-
- resp = await self._channelz_stub.GetTopChannels(
- channelz_pb2.GetTopChannelsRequest(
- start_channel_id=_LARGE_UNASSIGNED_ID))
- self.assertEqual(len(resp.channel), 0)
- self.assertEqual(resp.end, True)
-
- await _destroy_channel_server_pairs(pairs)
-
- async def test_successful_request(self):
- pairs = await _create_channel_server_pairs(1, self._channelz_stub)
-
- await self._send_successful_unary_unary(pairs[0])
- resp = await self._channelz_stub.GetChannel(
- channelz_pb2.GetChannelRequest(channel_id=pairs[0].channel_ref_id))
-
- self.assertEqual(resp.channel.data.calls_started, 1)
- self.assertEqual(resp.channel.data.calls_succeeded, 1)
- self.assertEqual(resp.channel.data.calls_failed, 0)
-
- await _destroy_channel_server_pairs(pairs)
-
- async def test_failed_request(self):
- pairs = await _create_channel_server_pairs(1, self._channelz_stub)
-
- await self._send_failed_unary_unary(pairs[0])
- resp = await self._channelz_stub.GetChannel(
- channelz_pb2.GetChannelRequest(channel_id=pairs[0].channel_ref_id))
- self.assertEqual(resp.channel.data.calls_started, 1)
- self.assertEqual(resp.channel.data.calls_succeeded, 0)
- self.assertEqual(resp.channel.data.calls_failed, 1)
-
- await _destroy_channel_server_pairs(pairs)
-
- async def test_many_requests(self):
- pairs = await _create_channel_server_pairs(1, self._channelz_stub)
-
- k_success = 7
- k_failed = 9
- for i in range(k_success):
- await self._send_successful_unary_unary(pairs[0])
- for i in range(k_failed):
- await self._send_failed_unary_unary(pairs[0])
- resp = await self._channelz_stub.GetChannel(
- channelz_pb2.GetChannelRequest(channel_id=pairs[0].channel_ref_id))
- self.assertEqual(resp.channel.data.calls_started, k_success + k_failed)
- self.assertEqual(resp.channel.data.calls_succeeded, k_success)
- self.assertEqual(resp.channel.data.calls_failed, k_failed)
-
- await _destroy_channel_server_pairs(pairs)
-
- async def test_many_requests_many_channel(self):
- k_channels = 4
- pairs = await _create_channel_server_pairs(k_channels,
- self._channelz_stub)
- k_success = 11
- k_failed = 13
- for i in range(k_success):
- await self._send_successful_unary_unary(pairs[0])
- await self._send_successful_unary_unary(pairs[2])
- for i in range(k_failed):
- await self._send_failed_unary_unary(pairs[1])
- await self._send_failed_unary_unary(pairs[2])
-
- # The first channel saw only successes
- resp = await self._channelz_stub.GetChannel(
- channelz_pb2.GetChannelRequest(channel_id=pairs[0].channel_ref_id))
- self.assertEqual(resp.channel.data.calls_started, k_success)
- self.assertEqual(resp.channel.data.calls_succeeded, k_success)
- self.assertEqual(resp.channel.data.calls_failed, 0)
-
- # The second channel saw only failures
- resp = await self._channelz_stub.GetChannel(
- channelz_pb2.GetChannelRequest(channel_id=pairs[1].channel_ref_id))
- self.assertEqual(resp.channel.data.calls_started, k_failed)
- self.assertEqual(resp.channel.data.calls_succeeded, 0)
- self.assertEqual(resp.channel.data.calls_failed, k_failed)
-
- # The third channel saw both successes and failures
- resp = await self._channelz_stub.GetChannel(
- channelz_pb2.GetChannelRequest(channel_id=pairs[2].channel_ref_id))
- self.assertEqual(resp.channel.data.calls_started, k_success + k_failed)
- self.assertEqual(resp.channel.data.calls_succeeded, k_success)
- self.assertEqual(resp.channel.data.calls_failed, k_failed)
-
- # The fourth channel saw nothing
- resp = await self._channelz_stub.GetChannel(
- channelz_pb2.GetChannelRequest(channel_id=pairs[3].channel_ref_id))
- self.assertEqual(resp.channel.data.calls_started, 0)
- self.assertEqual(resp.channel.data.calls_succeeded, 0)
- self.assertEqual(resp.channel.data.calls_failed, 0)
-
- await _destroy_channel_server_pairs(pairs)
-
- async def test_many_subchannels(self):
- k_channels = 4
- pairs = await _create_channel_server_pairs(k_channels,
- self._channelz_stub)
- k_success = 17
- k_failed = 19
- for i in range(k_success):
- await self._send_successful_unary_unary(pairs[0])
- await self._send_successful_unary_unary(pairs[2])
- for i in range(k_failed):
- await self._send_failed_unary_unary(pairs[1])
- await self._send_failed_unary_unary(pairs[2])
-
- for i in range(k_channels):
- gc_resp = await self._channelz_stub.GetChannel(
- channelz_pb2.GetChannelRequest(
- channel_id=pairs[i].channel_ref_id))
- # If no call performed in the channel, there shouldn't be any subchannel
- if gc_resp.channel.data.calls_started == 0:
- self.assertEqual(len(gc_resp.channel.subchannel_ref), 0)
- continue
-
- # Otherwise, the subchannel should exist
- self.assertGreater(len(gc_resp.channel.subchannel_ref), 0)
- gsc_resp = await self._channelz_stub.GetSubchannel(
- channelz_pb2.GetSubchannelRequest(
- subchannel_id=gc_resp.channel.subchannel_ref[0].
- subchannel_id))
- self.assertEqual(gc_resp.channel.data.calls_started,
- gsc_resp.subchannel.data.calls_started)
- self.assertEqual(gc_resp.channel.data.calls_succeeded,
- gsc_resp.subchannel.data.calls_succeeded)
- self.assertEqual(gc_resp.channel.data.calls_failed,
- gsc_resp.subchannel.data.calls_failed)
-
- await _destroy_channel_server_pairs(pairs)
-
- async def test_server_call(self):
- pairs = await _create_channel_server_pairs(1, self._channelz_stub)
-
- k_success = 23
- k_failed = 29
- for i in range(k_success):
- await self._send_successful_unary_unary(pairs[0])
- for i in range(k_failed):
- await self._send_failed_unary_unary(pairs[0])
-
- resp = await self._get_server_by_ref_id(pairs[0].server_ref_id)
- self.assertEqual(resp.data.calls_started, k_success + k_failed)
- self.assertEqual(resp.data.calls_succeeded, k_success)
- self.assertEqual(resp.data.calls_failed, k_failed)
-
- await _destroy_channel_server_pairs(pairs)
-
- async def test_many_subchannels_and_sockets(self):
- k_channels = 4
- pairs = await _create_channel_server_pairs(k_channels,
- self._channelz_stub)
- k_success = 3
- k_failed = 5
- for i in range(k_success):
- await self._send_successful_unary_unary(pairs[0])
- await self._send_successful_unary_unary(pairs[2])
- for i in range(k_failed):
- await self._send_failed_unary_unary(pairs[1])
- await self._send_failed_unary_unary(pairs[2])
-
- for i in range(k_channels):
- gc_resp = await self._channelz_stub.GetChannel(
- channelz_pb2.GetChannelRequest(
- channel_id=pairs[i].channel_ref_id))
-
- # If no call performed in the channel, there shouldn't be any subchannel
- if gc_resp.channel.data.calls_started == 0:
- self.assertEqual(len(gc_resp.channel.subchannel_ref), 0)
- continue
-
- # Otherwise, the subchannel should exist
- self.assertGreater(len(gc_resp.channel.subchannel_ref), 0)
- gsc_resp = await self._channelz_stub.GetSubchannel(
- channelz_pb2.GetSubchannelRequest(
- subchannel_id=gc_resp.channel.subchannel_ref[0].
- subchannel_id))
- self.assertEqual(len(gsc_resp.subchannel.socket_ref), 1)
-
- gs_resp = await self._channelz_stub.GetSocket(
- channelz_pb2.GetSocketRequest(
- socket_id=gsc_resp.subchannel.socket_ref[0].socket_id))
- self.assertEqual(gsc_resp.subchannel.data.calls_started,
- gs_resp.socket.data.streams_started)
- self.assertEqual(0, gs_resp.socket.data.streams_failed)
- # Calls started == messages sent, only valid for unary calls
- self.assertEqual(gsc_resp.subchannel.data.calls_started,
- gs_resp.socket.data.messages_sent)
-
- await _destroy_channel_server_pairs(pairs)
-
- async def test_streaming_rpc(self):
- pairs = await _create_channel_server_pairs(1, self._channelz_stub)
- # In C++, the argument for _send_successful_stream_stream is message length.
- # Here the argument is still channel idx, to be consistent with the other two.
- await self._send_successful_stream_stream(pairs[0])
-
- gc_resp = await self._channelz_stub.GetChannel(
- channelz_pb2.GetChannelRequest(channel_id=pairs[0].channel_ref_id))
- self.assertEqual(gc_resp.channel.data.calls_started, 1)
- self.assertEqual(gc_resp.channel.data.calls_succeeded, 1)
- self.assertEqual(gc_resp.channel.data.calls_failed, 0)
- # Subchannel exists
- self.assertGreater(len(gc_resp.channel.subchannel_ref), 0)
-
- gsc_resp = await self._channelz_stub.GetSubchannel(
- channelz_pb2.GetSubchannelRequest(
- subchannel_id=gc_resp.channel.subchannel_ref[0].subchannel_id))
- self.assertEqual(gsc_resp.subchannel.data.calls_started, 1)
- self.assertEqual(gsc_resp.subchannel.data.calls_succeeded, 1)
- self.assertEqual(gsc_resp.subchannel.data.calls_failed, 0)
- # Socket exists
- self.assertEqual(len(gsc_resp.subchannel.socket_ref), 1)
-
- gs_resp = await self._channelz_stub.GetSocket(
- channelz_pb2.GetSocketRequest(
- socket_id=gsc_resp.subchannel.socket_ref[0].socket_id))
- self.assertEqual(gs_resp.socket.data.streams_started, 1)
- self.assertEqual(gs_resp.socket.data.streams_succeeded, 1)
- self.assertEqual(gs_resp.socket.data.streams_failed, 0)
- self.assertEqual(gs_resp.socket.data.messages_sent,
- test_constants.STREAM_LENGTH)
- self.assertEqual(gs_resp.socket.data.messages_received,
- test_constants.STREAM_LENGTH)
-
- await _destroy_channel_server_pairs(pairs)
-
- async def test_server_sockets(self):
- pairs = await _create_channel_server_pairs(1, self._channelz_stub)
-
- await self._send_successful_unary_unary(pairs[0])
- await self._send_failed_unary_unary(pairs[0])
-
- resp = await self._get_server_by_ref_id(pairs[0].server_ref_id)
- self.assertEqual(resp.data.calls_started, 2)
- self.assertEqual(resp.data.calls_succeeded, 1)
- self.assertEqual(resp.data.calls_failed, 1)
-
- gss_resp = await self._channelz_stub.GetServerSockets(
- channelz_pb2.GetServerSocketsRequest(server_id=resp.ref.server_id,
- start_socket_id=0))
- # If the RPC call failed, it will raise a grpc.RpcError
- # So, if there is no exception raised, considered pass
- await _destroy_channel_server_pairs(pairs)
-
- async def test_server_listen_sockets(self):
- pairs = await _create_channel_server_pairs(1, self._channelz_stub)
-
- resp = await self._get_server_by_ref_id(pairs[0].server_ref_id)
- self.assertEqual(len(resp.listen_socket), 1)
-
- gs_resp = await self._channelz_stub.GetSocket(
- channelz_pb2.GetSocketRequest(
- socket_id=resp.listen_socket[0].socket_id))
- # If the RPC call failed, it will raise a grpc.RpcError
- # So, if there is no exception raised, considered pass
- await _destroy_channel_server_pairs(pairs)
-
- async def test_invalid_query_get_server(self):
- with self.assertRaises(aio.AioRpcError) as exception_context:
- await self._channelz_stub.GetServer(
- channelz_pb2.GetServerRequest(server_id=_LARGE_UNASSIGNED_ID))
- self.assertEqual(grpc.StatusCode.NOT_FOUND,
- exception_context.exception.code())
-
- async def test_invalid_query_get_channel(self):
- with self.assertRaises(aio.AioRpcError) as exception_context:
- await self._channelz_stub.GetChannel(
- channelz_pb2.GetChannelRequest(channel_id=_LARGE_UNASSIGNED_ID))
- self.assertEqual(grpc.StatusCode.NOT_FOUND,
- exception_context.exception.code())
-
- async def test_invalid_query_get_subchannel(self):
- with self.assertRaises(aio.AioRpcError) as exception_context:
- await self._channelz_stub.GetSubchannel(
- channelz_pb2.GetSubchannelRequest(
- subchannel_id=_LARGE_UNASSIGNED_ID))
- self.assertEqual(grpc.StatusCode.NOT_FOUND,
- exception_context.exception.code())
-
- async def test_invalid_query_get_socket(self):
- with self.assertRaises(aio.AioRpcError) as exception_context:
- await self._channelz_stub.GetSocket(
- channelz_pb2.GetSocketRequest(socket_id=_LARGE_UNASSIGNED_ID))
- self.assertEqual(grpc.StatusCode.NOT_FOUND,
- exception_context.exception.code())
-
- async def test_invalid_query_get_server_sockets(self):
- with self.assertRaises(aio.AioRpcError) as exception_context:
- await self._channelz_stub.GetServerSockets(
- channelz_pb2.GetServerSocketsRequest(
- server_id=_LARGE_UNASSIGNED_ID,
- start_socket_id=0,
- ))
- self.assertEqual(grpc.StatusCode.NOT_FOUND,
- exception_context.exception.code())
-
-
-if __name__ == '__main__':
- logging.basicConfig(level=logging.DEBUG)
- unittest.main(verbosity=2)
+# Copyright 2020 The gRPC Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+"""Tests of grpc_channelz.v1.channelz."""
+
+import unittest
+import logging
+import asyncio
+
+import grpc
+from grpc.experimental import aio
+
+from grpc_channelz.v1 import channelz
+from grpc_channelz.v1 import channelz_pb2
+from grpc_channelz.v1 import channelz_pb2_grpc
+
+from tests.unit.framework.common import test_constants
+from tests_aio.unit._test_base import AioTestBase
+
+_SUCCESSFUL_UNARY_UNARY = '/test/SuccessfulUnaryUnary'
+_FAILED_UNARY_UNARY = '/test/FailedUnaryUnary'
+_SUCCESSFUL_STREAM_STREAM = '/test/SuccessfulStreamStream'
+
+_REQUEST = b'\x00\x00\x00'
+_RESPONSE = b'\x01\x01\x01'
+
+_DISABLE_REUSE_PORT = (('grpc.so_reuseport', 0),)
+_ENABLE_CHANNELZ = (('grpc.enable_channelz', 1),)
+_DISABLE_CHANNELZ = (('grpc.enable_channelz', 0),)
+
+_LARGE_UNASSIGNED_ID = 10000
+
+
+async def _successful_unary_unary(request, servicer_context):
+ return _RESPONSE
+
+
+async def _failed_unary_unary(request, servicer_context):
+ servicer_context.set_code(grpc.StatusCode.INTERNAL)
+ servicer_context.set_details("Channelz Test Intended Failure")
+
+
+async def _successful_stream_stream(request_iterator, servicer_context):
+ async for _ in request_iterator:
+ yield _RESPONSE
+
+
+class _GenericHandler(grpc.GenericRpcHandler):
+
+ def service(self, handler_call_details):
+ if handler_call_details.method == _SUCCESSFUL_UNARY_UNARY:
+ return grpc.unary_unary_rpc_method_handler(_successful_unary_unary)
+ elif handler_call_details.method == _FAILED_UNARY_UNARY:
+ return grpc.unary_unary_rpc_method_handler(_failed_unary_unary)
+ elif handler_call_details.method == _SUCCESSFUL_STREAM_STREAM:
+ return grpc.stream_stream_rpc_method_handler(
+ _successful_stream_stream)
+ else:
+ return None
+
+
+class _ChannelServerPair:
+
+ def __init__(self):
+ self.address = ''
+ self.server = None
+ self.channel = None
+ self.server_ref_id = None
+ self.channel_ref_id = None
+
+ async def start(self):
+ # Server will enable channelz service
+ self.server = aio.server(options=_DISABLE_REUSE_PORT + _ENABLE_CHANNELZ)
+ port = self.server.add_insecure_port('[::]:0')
+ self.address = 'localhost:%d' % port
+ self.server.add_generic_rpc_handlers((_GenericHandler(),))
+ await self.server.start()
+
+ # Channel will enable channelz service...
+ self.channel = aio.insecure_channel(self.address,
+ options=_ENABLE_CHANNELZ)
+
+ async def bind_channelz(self, channelz_stub):
+ resp = await channelz_stub.GetTopChannels(
+ channelz_pb2.GetTopChannelsRequest(start_channel_id=0))
+ for channel in resp.channel:
+ if channel.data.target == self.address:
+ self.channel_ref_id = channel.ref.channel_id
+
+ resp = await channelz_stub.GetServers(
+ channelz_pb2.GetServersRequest(start_server_id=0))
+ self.server_ref_id = resp.server[-1].ref.server_id
+
+ async def stop(self):
+ await self.channel.close()
+ await self.server.stop(None)
+
+
+async def _create_channel_server_pairs(n, channelz_stub=None):
+ """Create channel-server pairs."""
+ pairs = [_ChannelServerPair() for i in range(n)]
+ for pair in pairs:
+ await pair.start()
+ if channelz_stub:
+ await pair.bind_channelz(channelz_stub)
+ return pairs
+
+
+async def _destroy_channel_server_pairs(pairs):
+ for pair in pairs:
+ await pair.stop()
+
+
+class ChannelzServicerTest(AioTestBase):
+
+ async def setUp(self):
+ # This server is for Channelz info fetching only
+ # It self should not enable Channelz
+ self._server = aio.server(options=_DISABLE_REUSE_PORT +
+ _DISABLE_CHANNELZ)
+ port = self._server.add_insecure_port('[::]:0')
+ channelz.add_channelz_servicer(self._server)
+ await self._server.start()
+
+ # This channel is used to fetch Channelz info only
+ # Channelz should not be enabled
+ self._channel = aio.insecure_channel('localhost:%d' % port,
+ options=_DISABLE_CHANNELZ)
+ self._channelz_stub = channelz_pb2_grpc.ChannelzStub(self._channel)
+
+ async def tearDown(self):
+ await self._channel.close()
+ await self._server.stop(None)
+
+ async def _get_server_by_ref_id(self, ref_id):
+ """Server id may not be consecutive"""
+ resp = await self._channelz_stub.GetServers(
+ channelz_pb2.GetServersRequest(start_server_id=ref_id))
+ self.assertEqual(ref_id, resp.server[0].ref.server_id)
+ return resp.server[0]
+
+ async def _send_successful_unary_unary(self, pair):
+ call = pair.channel.unary_unary(_SUCCESSFUL_UNARY_UNARY)(_REQUEST)
+ self.assertEqual(grpc.StatusCode.OK, await call.code())
+
+ async def _send_failed_unary_unary(self, pair):
+ try:
+ await pair.channel.unary_unary(_FAILED_UNARY_UNARY)(_REQUEST)
+ except grpc.RpcError:
+ return
+ else:
+ self.fail("This call supposed to fail")
+
+ async def _send_successful_stream_stream(self, pair):
+ call = pair.channel.stream_stream(_SUCCESSFUL_STREAM_STREAM)(iter(
+ [_REQUEST] * test_constants.STREAM_LENGTH))
+ cnt = 0
+ async for _ in call:
+ cnt += 1
+ self.assertEqual(cnt, test_constants.STREAM_LENGTH)
+
+ async def test_get_top_channels_high_start_id(self):
+ pairs = await _create_channel_server_pairs(1)
+
+ resp = await self._channelz_stub.GetTopChannels(
+ channelz_pb2.GetTopChannelsRequest(
+ start_channel_id=_LARGE_UNASSIGNED_ID))
+ self.assertEqual(len(resp.channel), 0)
+ self.assertEqual(resp.end, True)
+
+ await _destroy_channel_server_pairs(pairs)
+
+ async def test_successful_request(self):
+ pairs = await _create_channel_server_pairs(1, self._channelz_stub)
+
+ await self._send_successful_unary_unary(pairs[0])
+ resp = await self._channelz_stub.GetChannel(
+ channelz_pb2.GetChannelRequest(channel_id=pairs[0].channel_ref_id))
+
+ self.assertEqual(resp.channel.data.calls_started, 1)
+ self.assertEqual(resp.channel.data.calls_succeeded, 1)
+ self.assertEqual(resp.channel.data.calls_failed, 0)
+
+ await _destroy_channel_server_pairs(pairs)
+
+ async def test_failed_request(self):
+ pairs = await _create_channel_server_pairs(1, self._channelz_stub)
+
+ await self._send_failed_unary_unary(pairs[0])
+ resp = await self._channelz_stub.GetChannel(
+ channelz_pb2.GetChannelRequest(channel_id=pairs[0].channel_ref_id))
+ self.assertEqual(resp.channel.data.calls_started, 1)
+ self.assertEqual(resp.channel.data.calls_succeeded, 0)
+ self.assertEqual(resp.channel.data.calls_failed, 1)
+
+ await _destroy_channel_server_pairs(pairs)
+
+ async def test_many_requests(self):
+ pairs = await _create_channel_server_pairs(1, self._channelz_stub)
+
+ k_success = 7
+ k_failed = 9
+ for i in range(k_success):
+ await self._send_successful_unary_unary(pairs[0])
+ for i in range(k_failed):
+ await self._send_failed_unary_unary(pairs[0])
+ resp = await self._channelz_stub.GetChannel(
+ channelz_pb2.GetChannelRequest(channel_id=pairs[0].channel_ref_id))
+ self.assertEqual(resp.channel.data.calls_started, k_success + k_failed)
+ self.assertEqual(resp.channel.data.calls_succeeded, k_success)
+ self.assertEqual(resp.channel.data.calls_failed, k_failed)
+
+ await _destroy_channel_server_pairs(pairs)
+
+ async def test_many_requests_many_channel(self):
+ k_channels = 4
+ pairs = await _create_channel_server_pairs(k_channels,
+ self._channelz_stub)
+ k_success = 11
+ k_failed = 13
+ for i in range(k_success):
+ await self._send_successful_unary_unary(pairs[0])
+ await self._send_successful_unary_unary(pairs[2])
+ for i in range(k_failed):
+ await self._send_failed_unary_unary(pairs[1])
+ await self._send_failed_unary_unary(pairs[2])
+
+ # The first channel saw only successes
+ resp = await self._channelz_stub.GetChannel(
+ channelz_pb2.GetChannelRequest(channel_id=pairs[0].channel_ref_id))
+ self.assertEqual(resp.channel.data.calls_started, k_success)
+ self.assertEqual(resp.channel.data.calls_succeeded, k_success)
+ self.assertEqual(resp.channel.data.calls_failed, 0)
+
+ # The second channel saw only failures
+ resp = await self._channelz_stub.GetChannel(
+ channelz_pb2.GetChannelRequest(channel_id=pairs[1].channel_ref_id))
+ self.assertEqual(resp.channel.data.calls_started, k_failed)
+ self.assertEqual(resp.channel.data.calls_succeeded, 0)
+ self.assertEqual(resp.channel.data.calls_failed, k_failed)
+
+ # The third channel saw both successes and failures
+ resp = await self._channelz_stub.GetChannel(
+ channelz_pb2.GetChannelRequest(channel_id=pairs[2].channel_ref_id))
+ self.assertEqual(resp.channel.data.calls_started, k_success + k_failed)
+ self.assertEqual(resp.channel.data.calls_succeeded, k_success)
+ self.assertEqual(resp.channel.data.calls_failed, k_failed)
+
+ # The fourth channel saw nothing
+ resp = await self._channelz_stub.GetChannel(
+ channelz_pb2.GetChannelRequest(channel_id=pairs[3].channel_ref_id))
+ self.assertEqual(resp.channel.data.calls_started, 0)
+ self.assertEqual(resp.channel.data.calls_succeeded, 0)
+ self.assertEqual(resp.channel.data.calls_failed, 0)
+
+ await _destroy_channel_server_pairs(pairs)
+
+ async def test_many_subchannels(self):
+ k_channels = 4
+ pairs = await _create_channel_server_pairs(k_channels,
+ self._channelz_stub)
+ k_success = 17
+ k_failed = 19
+ for i in range(k_success):
+ await self._send_successful_unary_unary(pairs[0])
+ await self._send_successful_unary_unary(pairs[2])
+ for i in range(k_failed):
+ await self._send_failed_unary_unary(pairs[1])
+ await self._send_failed_unary_unary(pairs[2])
+
+ for i in range(k_channels):
+ gc_resp = await self._channelz_stub.GetChannel(
+ channelz_pb2.GetChannelRequest(
+ channel_id=pairs[i].channel_ref_id))
+ # If no call performed in the channel, there shouldn't be any subchannel
+ if gc_resp.channel.data.calls_started == 0:
+ self.assertEqual(len(gc_resp.channel.subchannel_ref), 0)
+ continue
+
+ # Otherwise, the subchannel should exist
+ self.assertGreater(len(gc_resp.channel.subchannel_ref), 0)
+ gsc_resp = await self._channelz_stub.GetSubchannel(
+ channelz_pb2.GetSubchannelRequest(
+ subchannel_id=gc_resp.channel.subchannel_ref[0].
+ subchannel_id))
+ self.assertEqual(gc_resp.channel.data.calls_started,
+ gsc_resp.subchannel.data.calls_started)
+ self.assertEqual(gc_resp.channel.data.calls_succeeded,
+ gsc_resp.subchannel.data.calls_succeeded)
+ self.assertEqual(gc_resp.channel.data.calls_failed,
+ gsc_resp.subchannel.data.calls_failed)
+
+ await _destroy_channel_server_pairs(pairs)
+
+ async def test_server_call(self):
+ pairs = await _create_channel_server_pairs(1, self._channelz_stub)
+
+ k_success = 23
+ k_failed = 29
+ for i in range(k_success):
+ await self._send_successful_unary_unary(pairs[0])
+ for i in range(k_failed):
+ await self._send_failed_unary_unary(pairs[0])
+
+ resp = await self._get_server_by_ref_id(pairs[0].server_ref_id)
+ self.assertEqual(resp.data.calls_started, k_success + k_failed)
+ self.assertEqual(resp.data.calls_succeeded, k_success)
+ self.assertEqual(resp.data.calls_failed, k_failed)
+
+ await _destroy_channel_server_pairs(pairs)
+
+ async def test_many_subchannels_and_sockets(self):
+ k_channels = 4
+ pairs = await _create_channel_server_pairs(k_channels,
+ self._channelz_stub)
+ k_success = 3
+ k_failed = 5
+ for i in range(k_success):
+ await self._send_successful_unary_unary(pairs[0])
+ await self._send_successful_unary_unary(pairs[2])
+ for i in range(k_failed):
+ await self._send_failed_unary_unary(pairs[1])
+ await self._send_failed_unary_unary(pairs[2])
+
+ for i in range(k_channels):
+ gc_resp = await self._channelz_stub.GetChannel(
+ channelz_pb2.GetChannelRequest(
+ channel_id=pairs[i].channel_ref_id))
+
+ # If no call performed in the channel, there shouldn't be any subchannel
+ if gc_resp.channel.data.calls_started == 0:
+ self.assertEqual(len(gc_resp.channel.subchannel_ref), 0)
+ continue
+
+ # Otherwise, the subchannel should exist
+ self.assertGreater(len(gc_resp.channel.subchannel_ref), 0)
+ gsc_resp = await self._channelz_stub.GetSubchannel(
+ channelz_pb2.GetSubchannelRequest(
+ subchannel_id=gc_resp.channel.subchannel_ref[0].
+ subchannel_id))
+ self.assertEqual(len(gsc_resp.subchannel.socket_ref), 1)
+
+ gs_resp = await self._channelz_stub.GetSocket(
+ channelz_pb2.GetSocketRequest(
+ socket_id=gsc_resp.subchannel.socket_ref[0].socket_id))
+ self.assertEqual(gsc_resp.subchannel.data.calls_started,
+ gs_resp.socket.data.streams_started)
+ self.assertEqual(0, gs_resp.socket.data.streams_failed)
+ # Calls started == messages sent, only valid for unary calls
+ self.assertEqual(gsc_resp.subchannel.data.calls_started,
+ gs_resp.socket.data.messages_sent)
+
+ await _destroy_channel_server_pairs(pairs)
+
+ async def test_streaming_rpc(self):
+ pairs = await _create_channel_server_pairs(1, self._channelz_stub)
+ # In C++, the argument for _send_successful_stream_stream is message length.
+ # Here the argument is still channel idx, to be consistent with the other two.
+ await self._send_successful_stream_stream(pairs[0])
+
+ gc_resp = await self._channelz_stub.GetChannel(
+ channelz_pb2.GetChannelRequest(channel_id=pairs[0].channel_ref_id))
+ self.assertEqual(gc_resp.channel.data.calls_started, 1)
+ self.assertEqual(gc_resp.channel.data.calls_succeeded, 1)
+ self.assertEqual(gc_resp.channel.data.calls_failed, 0)
+ # Subchannel exists
+ self.assertGreater(len(gc_resp.channel.subchannel_ref), 0)
+
+ gsc_resp = await self._channelz_stub.GetSubchannel(
+ channelz_pb2.GetSubchannelRequest(
+ subchannel_id=gc_resp.channel.subchannel_ref[0].subchannel_id))
+ self.assertEqual(gsc_resp.subchannel.data.calls_started, 1)
+ self.assertEqual(gsc_resp.subchannel.data.calls_succeeded, 1)
+ self.assertEqual(gsc_resp.subchannel.data.calls_failed, 0)
+ # Socket exists
+ self.assertEqual(len(gsc_resp.subchannel.socket_ref), 1)
+
+ gs_resp = await self._channelz_stub.GetSocket(
+ channelz_pb2.GetSocketRequest(
+ socket_id=gsc_resp.subchannel.socket_ref[0].socket_id))
+ self.assertEqual(gs_resp.socket.data.streams_started, 1)
+ self.assertEqual(gs_resp.socket.data.streams_succeeded, 1)
+ self.assertEqual(gs_resp.socket.data.streams_failed, 0)
+ self.assertEqual(gs_resp.socket.data.messages_sent,
+ test_constants.STREAM_LENGTH)
+ self.assertEqual(gs_resp.socket.data.messages_received,
+ test_constants.STREAM_LENGTH)
+
+ await _destroy_channel_server_pairs(pairs)
+
+ async def test_server_sockets(self):
+ pairs = await _create_channel_server_pairs(1, self._channelz_stub)
+
+ await self._send_successful_unary_unary(pairs[0])
+ await self._send_failed_unary_unary(pairs[0])
+
+ resp = await self._get_server_by_ref_id(pairs[0].server_ref_id)
+ self.assertEqual(resp.data.calls_started, 2)
+ self.assertEqual(resp.data.calls_succeeded, 1)
+ self.assertEqual(resp.data.calls_failed, 1)
+
+ gss_resp = await self._channelz_stub.GetServerSockets(
+ channelz_pb2.GetServerSocketsRequest(server_id=resp.ref.server_id,
+ start_socket_id=0))
+ # If the RPC call failed, it will raise a grpc.RpcError
+ # So, if there is no exception raised, considered pass
+ await _destroy_channel_server_pairs(pairs)
+
+ async def test_server_listen_sockets(self):
+ pairs = await _create_channel_server_pairs(1, self._channelz_stub)
+
+ resp = await self._get_server_by_ref_id(pairs[0].server_ref_id)
+ self.assertEqual(len(resp.listen_socket), 1)
+
+ gs_resp = await self._channelz_stub.GetSocket(
+ channelz_pb2.GetSocketRequest(
+ socket_id=resp.listen_socket[0].socket_id))
+ # If the RPC call failed, it will raise a grpc.RpcError
+ # So, if there is no exception raised, considered pass
+ await _destroy_channel_server_pairs(pairs)
+
+ async def test_invalid_query_get_server(self):
+ with self.assertRaises(aio.AioRpcError) as exception_context:
+ await self._channelz_stub.GetServer(
+ channelz_pb2.GetServerRequest(server_id=_LARGE_UNASSIGNED_ID))
+ self.assertEqual(grpc.StatusCode.NOT_FOUND,
+ exception_context.exception.code())
+
+ async def test_invalid_query_get_channel(self):
+ with self.assertRaises(aio.AioRpcError) as exception_context:
+ await self._channelz_stub.GetChannel(
+ channelz_pb2.GetChannelRequest(channel_id=_LARGE_UNASSIGNED_ID))
+ self.assertEqual(grpc.StatusCode.NOT_FOUND,
+ exception_context.exception.code())
+
+ async def test_invalid_query_get_subchannel(self):
+ with self.assertRaises(aio.AioRpcError) as exception_context:
+ await self._channelz_stub.GetSubchannel(
+ channelz_pb2.GetSubchannelRequest(
+ subchannel_id=_LARGE_UNASSIGNED_ID))
+ self.assertEqual(grpc.StatusCode.NOT_FOUND,
+ exception_context.exception.code())
+
+ async def test_invalid_query_get_socket(self):
+ with self.assertRaises(aio.AioRpcError) as exception_context:
+ await self._channelz_stub.GetSocket(
+ channelz_pb2.GetSocketRequest(socket_id=_LARGE_UNASSIGNED_ID))
+ self.assertEqual(grpc.StatusCode.NOT_FOUND,
+ exception_context.exception.code())
+
+ async def test_invalid_query_get_server_sockets(self):
+ with self.assertRaises(aio.AioRpcError) as exception_context:
+ await self._channelz_stub.GetServerSockets(
+ channelz_pb2.GetServerSocketsRequest(
+ server_id=_LARGE_UNASSIGNED_ID,
+ start_socket_id=0,
+ ))
+ self.assertEqual(grpc.StatusCode.NOT_FOUND,
+ exception_context.exception.code())
+
+
+if __name__ == '__main__':
+ logging.basicConfig(level=logging.DEBUG)
+ unittest.main(verbosity=2)
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/health_check/__init__.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/health_check/__init__.py
index 2cb28cb4645..1517f71d093 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/health_check/__init__.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/health_check/__init__.py
@@ -1,13 +1,13 @@
-# Copyright 2020 The gRPC Authors
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
+# Copyright 2020 The gRPC Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/health_check/health_servicer_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/health_check/health_servicer_test.py
index 5823badf7b3..a539dbf1409 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/health_check/health_servicer_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/health_check/health_servicer_test.py
@@ -1,282 +1,282 @@
-# Copyright 2020 The gRPC Authors
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-"""Tests AsyncIO version of grpcio-health-checking."""
-
-import asyncio
-import logging
-import time
-import random
-import unittest
-
-import grpc
-
-from grpc_health.v1 import health
-from grpc_health.v1 import health_pb2
-from grpc_health.v1 import health_pb2_grpc
-from grpc.experimental import aio
-
-from tests.unit.framework.common import test_constants
-
-from tests_aio.unit._test_base import AioTestBase
-
-_SERVING_SERVICE = 'grpc.test.TestServiceServing'
-_UNKNOWN_SERVICE = 'grpc.test.TestServiceUnknown'
-_NOT_SERVING_SERVICE = 'grpc.test.TestServiceNotServing'
-_WATCH_SERVICE = 'grpc.test.WatchService'
-
-_LARGE_NUMBER_OF_STATUS_CHANGES = 1000
-
-
-async def _pipe_to_queue(call, queue):
- async for response in call:
- await queue.put(response)
-
-
-class HealthServicerTest(AioTestBase):
-
- async def setUp(self):
- self._servicer = health.aio.HealthServicer()
- await self._servicer.set(_SERVING_SERVICE,
- health_pb2.HealthCheckResponse.SERVING)
- await self._servicer.set(_UNKNOWN_SERVICE,
- health_pb2.HealthCheckResponse.UNKNOWN)
- await self._servicer.set(_NOT_SERVING_SERVICE,
- health_pb2.HealthCheckResponse.NOT_SERVING)
- self._server = aio.server()
- port = self._server.add_insecure_port('[::]:0')
- health_pb2_grpc.add_HealthServicer_to_server(self._servicer,
- self._server)
- await self._server.start()
-
- self._channel = aio.insecure_channel('localhost:%d' % port)
- self._stub = health_pb2_grpc.HealthStub(self._channel)
-
- async def tearDown(self):
- await self._channel.close()
- await self._server.stop(None)
-
- async def test_check_empty_service(self):
- request = health_pb2.HealthCheckRequest()
- resp = await self._stub.Check(request)
- self.assertEqual(health_pb2.HealthCheckResponse.SERVING, resp.status)
-
- async def test_check_serving_service(self):
- request = health_pb2.HealthCheckRequest(service=_SERVING_SERVICE)
- resp = await self._stub.Check(request)
- self.assertEqual(health_pb2.HealthCheckResponse.SERVING, resp.status)
-
- async def test_check_unknown_service(self):
- request = health_pb2.HealthCheckRequest(service=_UNKNOWN_SERVICE)
- resp = await self._stub.Check(request)
- self.assertEqual(health_pb2.HealthCheckResponse.UNKNOWN, resp.status)
-
- async def test_check_not_serving_service(self):
- request = health_pb2.HealthCheckRequest(service=_NOT_SERVING_SERVICE)
- resp = await self._stub.Check(request)
- self.assertEqual(health_pb2.HealthCheckResponse.NOT_SERVING,
- resp.status)
-
- async def test_check_not_found_service(self):
- request = health_pb2.HealthCheckRequest(service='not-found')
- with self.assertRaises(aio.AioRpcError) as context:
- await self._stub.Check(request)
-
- self.assertEqual(grpc.StatusCode.NOT_FOUND, context.exception.code())
-
- async def test_health_service_name(self):
- self.assertEqual(health.SERVICE_NAME, 'grpc.health.v1.Health')
-
- async def test_watch_empty_service(self):
- request = health_pb2.HealthCheckRequest(service=health.OVERALL_HEALTH)
-
- call = self._stub.Watch(request)
- queue = asyncio.Queue()
- task = self.loop.create_task(_pipe_to_queue(call, queue))
-
- self.assertEqual(health_pb2.HealthCheckResponse.SERVING,
- (await queue.get()).status)
-
- call.cancel()
-
- with self.assertRaises(asyncio.CancelledError):
- await task
-
- self.assertTrue(queue.empty())
-
- async def test_watch_new_service(self):
- request = health_pb2.HealthCheckRequest(service=_WATCH_SERVICE)
- call = self._stub.Watch(request)
- queue = asyncio.Queue()
- task = self.loop.create_task(_pipe_to_queue(call, queue))
-
- self.assertEqual(health_pb2.HealthCheckResponse.SERVICE_UNKNOWN,
- (await queue.get()).status)
-
- await self._servicer.set(_WATCH_SERVICE,
- health_pb2.HealthCheckResponse.SERVING)
- self.assertEqual(health_pb2.HealthCheckResponse.SERVING,
- (await queue.get()).status)
-
- await self._servicer.set(_WATCH_SERVICE,
- health_pb2.HealthCheckResponse.NOT_SERVING)
- self.assertEqual(health_pb2.HealthCheckResponse.NOT_SERVING,
- (await queue.get()).status)
-
- call.cancel()
-
- with self.assertRaises(asyncio.CancelledError):
- await task
-
- self.assertTrue(queue.empty())
-
- async def test_watch_service_isolation(self):
- request = health_pb2.HealthCheckRequest(service=_WATCH_SERVICE)
- call = self._stub.Watch(request)
- queue = asyncio.Queue()
- task = self.loop.create_task(_pipe_to_queue(call, queue))
-
- self.assertEqual(health_pb2.HealthCheckResponse.SERVICE_UNKNOWN,
- (await queue.get()).status)
-
- await self._servicer.set('some-other-service',
- health_pb2.HealthCheckResponse.SERVING)
- # The change of health status in other service should be isolated.
- # Hence, no additional notification should be observed.
- with self.assertRaises(asyncio.TimeoutError):
- await asyncio.wait_for(queue.get(), test_constants.SHORT_TIMEOUT)
-
- call.cancel()
-
- with self.assertRaises(asyncio.CancelledError):
- await task
-
- self.assertTrue(queue.empty())
-
- async def test_two_watchers(self):
- request = health_pb2.HealthCheckRequest(service=_WATCH_SERVICE)
- queue1 = asyncio.Queue()
- queue2 = asyncio.Queue()
- call1 = self._stub.Watch(request)
- call2 = self._stub.Watch(request)
- task1 = self.loop.create_task(_pipe_to_queue(call1, queue1))
- task2 = self.loop.create_task(_pipe_to_queue(call2, queue2))
-
- self.assertEqual(health_pb2.HealthCheckResponse.SERVICE_UNKNOWN,
- (await queue1.get()).status)
- self.assertEqual(health_pb2.HealthCheckResponse.SERVICE_UNKNOWN,
- (await queue2.get()).status)
-
- await self._servicer.set(_WATCH_SERVICE,
- health_pb2.HealthCheckResponse.SERVING)
- self.assertEqual(health_pb2.HealthCheckResponse.SERVING,
- (await queue1.get()).status)
- self.assertEqual(health_pb2.HealthCheckResponse.SERVING,
- (await queue2.get()).status)
-
- call1.cancel()
- call2.cancel()
-
- with self.assertRaises(asyncio.CancelledError):
- await task1
-
- with self.assertRaises(asyncio.CancelledError):
- await task2
-
- self.assertTrue(queue1.empty())
- self.assertTrue(queue2.empty())
-
- async def test_cancelled_watch_removed_from_watch_list(self):
- request = health_pb2.HealthCheckRequest(service=_WATCH_SERVICE)
- call = self._stub.Watch(request)
- queue = asyncio.Queue()
- task = self.loop.create_task(_pipe_to_queue(call, queue))
-
- self.assertEqual(health_pb2.HealthCheckResponse.SERVICE_UNKNOWN,
- (await queue.get()).status)
-
- call.cancel()
- await self._servicer.set(_WATCH_SERVICE,
- health_pb2.HealthCheckResponse.SERVING)
-
- with self.assertRaises(asyncio.CancelledError):
- await task
-
- # Wait for the serving coroutine to process client cancellation.
- timeout = time.monotonic() + test_constants.TIME_ALLOWANCE
- while (time.monotonic() < timeout and self._servicer._server_watchers):
- await asyncio.sleep(1)
- self.assertFalse(self._servicer._server_watchers,
- 'There should not be any watcher left')
- self.assertTrue(queue.empty())
-
- async def test_graceful_shutdown(self):
- request = health_pb2.HealthCheckRequest(service=health.OVERALL_HEALTH)
- call = self._stub.Watch(request)
- queue = asyncio.Queue()
- task = self.loop.create_task(_pipe_to_queue(call, queue))
-
- self.assertEqual(health_pb2.HealthCheckResponse.SERVING,
- (await queue.get()).status)
-
- await self._servicer.enter_graceful_shutdown()
- self.assertEqual(health_pb2.HealthCheckResponse.NOT_SERVING,
- (await queue.get()).status)
-
- # This should be a no-op.
- await self._servicer.set(health.OVERALL_HEALTH,
- health_pb2.HealthCheckResponse.SERVING)
-
- resp = await self._stub.Check(request)
- self.assertEqual(health_pb2.HealthCheckResponse.NOT_SERVING,
- resp.status)
-
- call.cancel()
-
- with self.assertRaises(asyncio.CancelledError):
- await task
-
- self.assertTrue(queue.empty())
-
- async def test_no_duplicate_status(self):
- request = health_pb2.HealthCheckRequest(service=_WATCH_SERVICE)
- call = self._stub.Watch(request)
- queue = asyncio.Queue()
- task = self.loop.create_task(_pipe_to_queue(call, queue))
-
- self.assertEqual(health_pb2.HealthCheckResponse.SERVICE_UNKNOWN,
- (await queue.get()).status)
- last_status = health_pb2.HealthCheckResponse.SERVICE_UNKNOWN
-
- for _ in range(_LARGE_NUMBER_OF_STATUS_CHANGES):
- if random.randint(0, 1) == 0:
- status = health_pb2.HealthCheckResponse.SERVING
- else:
- status = health_pb2.HealthCheckResponse.NOT_SERVING
-
- await self._servicer.set(_WATCH_SERVICE, status)
- if status != last_status:
- self.assertEqual(status, (await queue.get()).status)
- last_status = status
-
- call.cancel()
-
- with self.assertRaises(asyncio.CancelledError):
- await task
-
- self.assertTrue(queue.empty())
-
-
-if __name__ == '__main__':
- logging.basicConfig(level=logging.DEBUG)
- unittest.main(verbosity=2)
+# Copyright 2020 The gRPC Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+"""Tests AsyncIO version of grpcio-health-checking."""
+
+import asyncio
+import logging
+import time
+import random
+import unittest
+
+import grpc
+
+from grpc_health.v1 import health
+from grpc_health.v1 import health_pb2
+from grpc_health.v1 import health_pb2_grpc
+from grpc.experimental import aio
+
+from tests.unit.framework.common import test_constants
+
+from tests_aio.unit._test_base import AioTestBase
+
+_SERVING_SERVICE = 'grpc.test.TestServiceServing'
+_UNKNOWN_SERVICE = 'grpc.test.TestServiceUnknown'
+_NOT_SERVING_SERVICE = 'grpc.test.TestServiceNotServing'
+_WATCH_SERVICE = 'grpc.test.WatchService'
+
+_LARGE_NUMBER_OF_STATUS_CHANGES = 1000
+
+
+async def _pipe_to_queue(call, queue):
+ async for response in call:
+ await queue.put(response)
+
+
+class HealthServicerTest(AioTestBase):
+
+ async def setUp(self):
+ self._servicer = health.aio.HealthServicer()
+ await self._servicer.set(_SERVING_SERVICE,
+ health_pb2.HealthCheckResponse.SERVING)
+ await self._servicer.set(_UNKNOWN_SERVICE,
+ health_pb2.HealthCheckResponse.UNKNOWN)
+ await self._servicer.set(_NOT_SERVING_SERVICE,
+ health_pb2.HealthCheckResponse.NOT_SERVING)
+ self._server = aio.server()
+ port = self._server.add_insecure_port('[::]:0')
+ health_pb2_grpc.add_HealthServicer_to_server(self._servicer,
+ self._server)
+ await self._server.start()
+
+ self._channel = aio.insecure_channel('localhost:%d' % port)
+ self._stub = health_pb2_grpc.HealthStub(self._channel)
+
+ async def tearDown(self):
+ await self._channel.close()
+ await self._server.stop(None)
+
+ async def test_check_empty_service(self):
+ request = health_pb2.HealthCheckRequest()
+ resp = await self._stub.Check(request)
+ self.assertEqual(health_pb2.HealthCheckResponse.SERVING, resp.status)
+
+ async def test_check_serving_service(self):
+ request = health_pb2.HealthCheckRequest(service=_SERVING_SERVICE)
+ resp = await self._stub.Check(request)
+ self.assertEqual(health_pb2.HealthCheckResponse.SERVING, resp.status)
+
+ async def test_check_unknown_service(self):
+ request = health_pb2.HealthCheckRequest(service=_UNKNOWN_SERVICE)
+ resp = await self._stub.Check(request)
+ self.assertEqual(health_pb2.HealthCheckResponse.UNKNOWN, resp.status)
+
+ async def test_check_not_serving_service(self):
+ request = health_pb2.HealthCheckRequest(service=_NOT_SERVING_SERVICE)
+ resp = await self._stub.Check(request)
+ self.assertEqual(health_pb2.HealthCheckResponse.NOT_SERVING,
+ resp.status)
+
+ async def test_check_not_found_service(self):
+ request = health_pb2.HealthCheckRequest(service='not-found')
+ with self.assertRaises(aio.AioRpcError) as context:
+ await self._stub.Check(request)
+
+ self.assertEqual(grpc.StatusCode.NOT_FOUND, context.exception.code())
+
+ async def test_health_service_name(self):
+ self.assertEqual(health.SERVICE_NAME, 'grpc.health.v1.Health')
+
+ async def test_watch_empty_service(self):
+ request = health_pb2.HealthCheckRequest(service=health.OVERALL_HEALTH)
+
+ call = self._stub.Watch(request)
+ queue = asyncio.Queue()
+ task = self.loop.create_task(_pipe_to_queue(call, queue))
+
+ self.assertEqual(health_pb2.HealthCheckResponse.SERVING,
+ (await queue.get()).status)
+
+ call.cancel()
+
+ with self.assertRaises(asyncio.CancelledError):
+ await task
+
+ self.assertTrue(queue.empty())
+
+ async def test_watch_new_service(self):
+ request = health_pb2.HealthCheckRequest(service=_WATCH_SERVICE)
+ call = self._stub.Watch(request)
+ queue = asyncio.Queue()
+ task = self.loop.create_task(_pipe_to_queue(call, queue))
+
+ self.assertEqual(health_pb2.HealthCheckResponse.SERVICE_UNKNOWN,
+ (await queue.get()).status)
+
+ await self._servicer.set(_WATCH_SERVICE,
+ health_pb2.HealthCheckResponse.SERVING)
+ self.assertEqual(health_pb2.HealthCheckResponse.SERVING,
+ (await queue.get()).status)
+
+ await self._servicer.set(_WATCH_SERVICE,
+ health_pb2.HealthCheckResponse.NOT_SERVING)
+ self.assertEqual(health_pb2.HealthCheckResponse.NOT_SERVING,
+ (await queue.get()).status)
+
+ call.cancel()
+
+ with self.assertRaises(asyncio.CancelledError):
+ await task
+
+ self.assertTrue(queue.empty())
+
+ async def test_watch_service_isolation(self):
+ request = health_pb2.HealthCheckRequest(service=_WATCH_SERVICE)
+ call = self._stub.Watch(request)
+ queue = asyncio.Queue()
+ task = self.loop.create_task(_pipe_to_queue(call, queue))
+
+ self.assertEqual(health_pb2.HealthCheckResponse.SERVICE_UNKNOWN,
+ (await queue.get()).status)
+
+ await self._servicer.set('some-other-service',
+ health_pb2.HealthCheckResponse.SERVING)
+ # The change of health status in other service should be isolated.
+ # Hence, no additional notification should be observed.
+ with self.assertRaises(asyncio.TimeoutError):
+ await asyncio.wait_for(queue.get(), test_constants.SHORT_TIMEOUT)
+
+ call.cancel()
+
+ with self.assertRaises(asyncio.CancelledError):
+ await task
+
+ self.assertTrue(queue.empty())
+
+ async def test_two_watchers(self):
+ request = health_pb2.HealthCheckRequest(service=_WATCH_SERVICE)
+ queue1 = asyncio.Queue()
+ queue2 = asyncio.Queue()
+ call1 = self._stub.Watch(request)
+ call2 = self._stub.Watch(request)
+ task1 = self.loop.create_task(_pipe_to_queue(call1, queue1))
+ task2 = self.loop.create_task(_pipe_to_queue(call2, queue2))
+
+ self.assertEqual(health_pb2.HealthCheckResponse.SERVICE_UNKNOWN,
+ (await queue1.get()).status)
+ self.assertEqual(health_pb2.HealthCheckResponse.SERVICE_UNKNOWN,
+ (await queue2.get()).status)
+
+ await self._servicer.set(_WATCH_SERVICE,
+ health_pb2.HealthCheckResponse.SERVING)
+ self.assertEqual(health_pb2.HealthCheckResponse.SERVING,
+ (await queue1.get()).status)
+ self.assertEqual(health_pb2.HealthCheckResponse.SERVING,
+ (await queue2.get()).status)
+
+ call1.cancel()
+ call2.cancel()
+
+ with self.assertRaises(asyncio.CancelledError):
+ await task1
+
+ with self.assertRaises(asyncio.CancelledError):
+ await task2
+
+ self.assertTrue(queue1.empty())
+ self.assertTrue(queue2.empty())
+
+ async def test_cancelled_watch_removed_from_watch_list(self):
+ request = health_pb2.HealthCheckRequest(service=_WATCH_SERVICE)
+ call = self._stub.Watch(request)
+ queue = asyncio.Queue()
+ task = self.loop.create_task(_pipe_to_queue(call, queue))
+
+ self.assertEqual(health_pb2.HealthCheckResponse.SERVICE_UNKNOWN,
+ (await queue.get()).status)
+
+ call.cancel()
+ await self._servicer.set(_WATCH_SERVICE,
+ health_pb2.HealthCheckResponse.SERVING)
+
+ with self.assertRaises(asyncio.CancelledError):
+ await task
+
+ # Wait for the serving coroutine to process client cancellation.
+ timeout = time.monotonic() + test_constants.TIME_ALLOWANCE
+ while (time.monotonic() < timeout and self._servicer._server_watchers):
+ await asyncio.sleep(1)
+ self.assertFalse(self._servicer._server_watchers,
+ 'There should not be any watcher left')
+ self.assertTrue(queue.empty())
+
+ async def test_graceful_shutdown(self):
+ request = health_pb2.HealthCheckRequest(service=health.OVERALL_HEALTH)
+ call = self._stub.Watch(request)
+ queue = asyncio.Queue()
+ task = self.loop.create_task(_pipe_to_queue(call, queue))
+
+ self.assertEqual(health_pb2.HealthCheckResponse.SERVING,
+ (await queue.get()).status)
+
+ await self._servicer.enter_graceful_shutdown()
+ self.assertEqual(health_pb2.HealthCheckResponse.NOT_SERVING,
+ (await queue.get()).status)
+
+ # This should be a no-op.
+ await self._servicer.set(health.OVERALL_HEALTH,
+ health_pb2.HealthCheckResponse.SERVING)
+
+ resp = await self._stub.Check(request)
+ self.assertEqual(health_pb2.HealthCheckResponse.NOT_SERVING,
+ resp.status)
+
+ call.cancel()
+
+ with self.assertRaises(asyncio.CancelledError):
+ await task
+
+ self.assertTrue(queue.empty())
+
+ async def test_no_duplicate_status(self):
+ request = health_pb2.HealthCheckRequest(service=_WATCH_SERVICE)
+ call = self._stub.Watch(request)
+ queue = asyncio.Queue()
+ task = self.loop.create_task(_pipe_to_queue(call, queue))
+
+ self.assertEqual(health_pb2.HealthCheckResponse.SERVICE_UNKNOWN,
+ (await queue.get()).status)
+ last_status = health_pb2.HealthCheckResponse.SERVICE_UNKNOWN
+
+ for _ in range(_LARGE_NUMBER_OF_STATUS_CHANGES):
+ if random.randint(0, 1) == 0:
+ status = health_pb2.HealthCheckResponse.SERVING
+ else:
+ status = health_pb2.HealthCheckResponse.NOT_SERVING
+
+ await self._servicer.set(_WATCH_SERVICE, status)
+ if status != last_status:
+ self.assertEqual(status, (await queue.get()).status)
+ last_status = status
+
+ call.cancel()
+
+ with self.assertRaises(asyncio.CancelledError):
+ await task
+
+ self.assertTrue(queue.empty())
+
+
+if __name__ == '__main__':
+ logging.basicConfig(level=logging.DEBUG)
+ unittest.main(verbosity=2)
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/interop/__init__.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/interop/__init__.py
index 59b52328e8d..b71ddbd314c 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/interop/__init__.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/interop/__init__.py
@@ -1,13 +1,13 @@
-# Copyright 2019 The gRPC Authors
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
+# Copyright 2019 The gRPC Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/interop/client.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/interop/client.py
index 791d3963710..a4c5e12ceda 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/interop/client.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/interop/client.py
@@ -1,61 +1,61 @@
-# Copyright 2019 The gRPC Authors
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-import argparse
-import asyncio
-import logging
-import os
-
-import grpc
-from grpc.experimental import aio
-
-from tests.interop import client as interop_client_lib
-from tests_aio.interop import methods
-
-_LOGGER = logging.getLogger(__name__)
-_LOGGER.setLevel(logging.DEBUG)
-
-
-def _create_channel(args):
- target = f'{args.server_host}:{args.server_port}'
-
- if args.use_tls or args.use_alts or args.custom_credentials_type is not None:
- channel_credentials, options = interop_client_lib.get_secure_channel_parameters(
- args)
- return aio.secure_channel(target, channel_credentials, options)
- else:
- return aio.insecure_channel(target)
-
-
-def _test_case_from_arg(test_case_arg):
- for test_case in methods.TestCase:
- if test_case_arg == test_case.value:
- return test_case
- else:
- raise ValueError('No test case "%s"!' % test_case_arg)
-
-
-async def test_interoperability():
-
- args = interop_client_lib.parse_interop_client_args()
- channel = _create_channel(args)
- stub = interop_client_lib.create_stub(channel, args)
- test_case = _test_case_from_arg(args.test_case)
- await methods.test_interoperability(test_case, stub, args)
-
-
-if __name__ == '__main__':
- logging.basicConfig(level=logging.DEBUG)
- asyncio.get_event_loop().set_debug(True)
- asyncio.get_event_loop().run_until_complete(test_interoperability())
+# Copyright 2019 The gRPC Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import argparse
+import asyncio
+import logging
+import os
+
+import grpc
+from grpc.experimental import aio
+
+from tests.interop import client as interop_client_lib
+from tests_aio.interop import methods
+
+_LOGGER = logging.getLogger(__name__)
+_LOGGER.setLevel(logging.DEBUG)
+
+
+def _create_channel(args):
+ target = f'{args.server_host}:{args.server_port}'
+
+ if args.use_tls or args.use_alts or args.custom_credentials_type is not None:
+ channel_credentials, options = interop_client_lib.get_secure_channel_parameters(
+ args)
+ return aio.secure_channel(target, channel_credentials, options)
+ else:
+ return aio.insecure_channel(target)
+
+
+def _test_case_from_arg(test_case_arg):
+ for test_case in methods.TestCase:
+ if test_case_arg == test_case.value:
+ return test_case
+ else:
+ raise ValueError('No test case "%s"!' % test_case_arg)
+
+
+async def test_interoperability():
+
+ args = interop_client_lib.parse_interop_client_args()
+ channel = _create_channel(args)
+ stub = interop_client_lib.create_stub(channel, args)
+ test_case = _test_case_from_arg(args.test_case)
+ await methods.test_interoperability(test_case, stub, args)
+
+
+if __name__ == '__main__':
+ logging.basicConfig(level=logging.DEBUG)
+ asyncio.get_event_loop().set_debug(True)
+ asyncio.get_event_loop().run_until_complete(test_interoperability())
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/interop/local_interop_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/interop/local_interop_test.py
index 6b58af89672..0db15be3a94 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/interop/local_interop_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/interop/local_interop_test.py
@@ -1,134 +1,134 @@
-# Copyright 2020 The gRPC Authors
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-"""Conducts interop tests locally."""
-
-import logging
-import unittest
-
-import grpc
-from grpc.experimental import aio
-
-from src.proto.grpc.testing import test_pb2_grpc
-from tests.interop import resources
-from tests_aio.interop import methods
-from tests_aio.unit._test_base import AioTestBase
-from tests_aio.unit._test_server import start_test_server
-
-_SERVER_HOST_OVERRIDE = 'foo.test.google.fr'
-
-
-class InteropTestCaseMixin:
- """Unit test methods.
-
- This class must be mixed in with unittest.TestCase and a class that defines
- setUp and tearDown methods that manage a stub attribute.
- """
- _stub: test_pb2_grpc.TestServiceStub
-
- async def test_empty_unary(self):
- await methods.test_interoperability(methods.TestCase.EMPTY_UNARY,
- self._stub, None)
-
- async def test_large_unary(self):
- await methods.test_interoperability(methods.TestCase.LARGE_UNARY,
- self._stub, None)
-
- async def test_server_streaming(self):
- await methods.test_interoperability(methods.TestCase.SERVER_STREAMING,
- self._stub, None)
-
- async def test_client_streaming(self):
- await methods.test_interoperability(methods.TestCase.CLIENT_STREAMING,
- self._stub, None)
-
- async def test_ping_pong(self):
- await methods.test_interoperability(methods.TestCase.PING_PONG,
- self._stub, None)
-
- async def test_cancel_after_begin(self):
- await methods.test_interoperability(methods.TestCase.CANCEL_AFTER_BEGIN,
- self._stub, None)
-
- async def test_cancel_after_first_response(self):
- await methods.test_interoperability(
- methods.TestCase.CANCEL_AFTER_FIRST_RESPONSE, self._stub, None)
-
- async def test_timeout_on_sleeping_server(self):
- await methods.test_interoperability(
- methods.TestCase.TIMEOUT_ON_SLEEPING_SERVER, self._stub, None)
-
- async def test_empty_stream(self):
- await methods.test_interoperability(methods.TestCase.EMPTY_STREAM,
- self._stub, None)
-
- async def test_status_code_and_message(self):
- await methods.test_interoperability(
- methods.TestCase.STATUS_CODE_AND_MESSAGE, self._stub, None)
-
- async def test_unimplemented_method(self):
- await methods.test_interoperability(
- methods.TestCase.UNIMPLEMENTED_METHOD, self._stub, None)
-
- async def test_unimplemented_service(self):
- await methods.test_interoperability(
- methods.TestCase.UNIMPLEMENTED_SERVICE, self._stub, None)
-
- async def test_custom_metadata(self):
- await methods.test_interoperability(methods.TestCase.CUSTOM_METADATA,
- self._stub, None)
-
- async def test_special_status_message(self):
- await methods.test_interoperability(
- methods.TestCase.SPECIAL_STATUS_MESSAGE, self._stub, None)
-
-
-class InsecureLocalInteropTest(InteropTestCaseMixin, AioTestBase):
-
- async def setUp(self):
- address, self._server = await start_test_server()
- self._channel = aio.insecure_channel(address)
- self._stub = test_pb2_grpc.TestServiceStub(self._channel)
-
- async def tearDown(self):
- await self._channel.close()
- await self._server.stop(None)
-
-
-class SecureLocalInteropTest(InteropTestCaseMixin, AioTestBase):
-
- async def setUp(self):
- server_credentials = grpc.ssl_server_credentials([
- (resources.private_key(), resources.certificate_chain())
- ])
- channel_credentials = grpc.ssl_channel_credentials(
- resources.test_root_certificates())
- channel_options = ((
- 'grpc.ssl_target_name_override',
- _SERVER_HOST_OVERRIDE,
- ),)
-
- address, self._server = await start_test_server(
- secure=True, server_credentials=server_credentials)
- self._channel = aio.secure_channel(address, channel_credentials,
- channel_options)
- self._stub = test_pb2_grpc.TestServiceStub(self._channel)
-
- async def tearDown(self):
- await self._channel.close()
- await self._server.stop(None)
-
-
-if __name__ == '__main__':
- logging.basicConfig(level=logging.INFO)
- unittest.main(verbosity=2)
+# Copyright 2020 The gRPC Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+"""Conducts interop tests locally."""
+
+import logging
+import unittest
+
+import grpc
+from grpc.experimental import aio
+
+from src.proto.grpc.testing import test_pb2_grpc
+from tests.interop import resources
+from tests_aio.interop import methods
+from tests_aio.unit._test_base import AioTestBase
+from tests_aio.unit._test_server import start_test_server
+
+_SERVER_HOST_OVERRIDE = 'foo.test.google.fr'
+
+
+class InteropTestCaseMixin:
+ """Unit test methods.
+
+ This class must be mixed in with unittest.TestCase and a class that defines
+ setUp and tearDown methods that manage a stub attribute.
+ """
+ _stub: test_pb2_grpc.TestServiceStub
+
+ async def test_empty_unary(self):
+ await methods.test_interoperability(methods.TestCase.EMPTY_UNARY,
+ self._stub, None)
+
+ async def test_large_unary(self):
+ await methods.test_interoperability(methods.TestCase.LARGE_UNARY,
+ self._stub, None)
+
+ async def test_server_streaming(self):
+ await methods.test_interoperability(methods.TestCase.SERVER_STREAMING,
+ self._stub, None)
+
+ async def test_client_streaming(self):
+ await methods.test_interoperability(methods.TestCase.CLIENT_STREAMING,
+ self._stub, None)
+
+ async def test_ping_pong(self):
+ await methods.test_interoperability(methods.TestCase.PING_PONG,
+ self._stub, None)
+
+ async def test_cancel_after_begin(self):
+ await methods.test_interoperability(methods.TestCase.CANCEL_AFTER_BEGIN,
+ self._stub, None)
+
+ async def test_cancel_after_first_response(self):
+ await methods.test_interoperability(
+ methods.TestCase.CANCEL_AFTER_FIRST_RESPONSE, self._stub, None)
+
+ async def test_timeout_on_sleeping_server(self):
+ await methods.test_interoperability(
+ methods.TestCase.TIMEOUT_ON_SLEEPING_SERVER, self._stub, None)
+
+ async def test_empty_stream(self):
+ await methods.test_interoperability(methods.TestCase.EMPTY_STREAM,
+ self._stub, None)
+
+ async def test_status_code_and_message(self):
+ await methods.test_interoperability(
+ methods.TestCase.STATUS_CODE_AND_MESSAGE, self._stub, None)
+
+ async def test_unimplemented_method(self):
+ await methods.test_interoperability(
+ methods.TestCase.UNIMPLEMENTED_METHOD, self._stub, None)
+
+ async def test_unimplemented_service(self):
+ await methods.test_interoperability(
+ methods.TestCase.UNIMPLEMENTED_SERVICE, self._stub, None)
+
+ async def test_custom_metadata(self):
+ await methods.test_interoperability(methods.TestCase.CUSTOM_METADATA,
+ self._stub, None)
+
+ async def test_special_status_message(self):
+ await methods.test_interoperability(
+ methods.TestCase.SPECIAL_STATUS_MESSAGE, self._stub, None)
+
+
+class InsecureLocalInteropTest(InteropTestCaseMixin, AioTestBase):
+
+ async def setUp(self):
+ address, self._server = await start_test_server()
+ self._channel = aio.insecure_channel(address)
+ self._stub = test_pb2_grpc.TestServiceStub(self._channel)
+
+ async def tearDown(self):
+ await self._channel.close()
+ await self._server.stop(None)
+
+
+class SecureLocalInteropTest(InteropTestCaseMixin, AioTestBase):
+
+ async def setUp(self):
+ server_credentials = grpc.ssl_server_credentials([
+ (resources.private_key(), resources.certificate_chain())
+ ])
+ channel_credentials = grpc.ssl_channel_credentials(
+ resources.test_root_certificates())
+ channel_options = ((
+ 'grpc.ssl_target_name_override',
+ _SERVER_HOST_OVERRIDE,
+ ),)
+
+ address, self._server = await start_test_server(
+ secure=True, server_credentials=server_credentials)
+ self._channel = aio.secure_channel(address, channel_credentials,
+ channel_options)
+ self._stub = test_pb2_grpc.TestServiceStub(self._channel)
+
+ async def tearDown(self):
+ await self._channel.close()
+ await self._server.stop(None)
+
+
+if __name__ == '__main__':
+ logging.basicConfig(level=logging.INFO)
+ unittest.main(verbosity=2)
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/interop/methods.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/interop/methods.py
index 1bb70326b9a..aa39976981f 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/interop/methods.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/interop/methods.py
@@ -1,456 +1,456 @@
-# Copyright 2019 The gRPC Authors
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-"""Implementations of interoperability test methods."""
-
-import argparse
-import asyncio
-import collections
-import datetime
-import enum
-import inspect
-import json
-import os
-import threading
-import time
-from typing import Any, Optional, Union
-
-import grpc
-from google import auth as google_auth
-from google.auth import environment_vars as google_auth_environment_vars
-from google.auth.transport import grpc as google_auth_transport_grpc
-from google.auth.transport import requests as google_auth_transport_requests
-from grpc.experimental import aio
-
-from src.proto.grpc.testing import empty_pb2, messages_pb2, test_pb2_grpc
-
-_INITIAL_METADATA_KEY = "x-grpc-test-echo-initial"
-_TRAILING_METADATA_KEY = "x-grpc-test-echo-trailing-bin"
-
-
-async def _expect_status_code(call: aio.Call,
- expected_code: grpc.StatusCode) -> None:
- code = await call.code()
- if code != expected_code:
- raise ValueError('expected code %s, got %s' %
- (expected_code, await call.code()))
-
-
-async def _expect_status_details(call: aio.Call, expected_details: str) -> None:
- details = await call.details()
- if details != expected_details:
- raise ValueError('expected message %s, got %s' %
- (expected_details, await call.details()))
-
-
-async def _validate_status_code_and_details(call: aio.Call,
- expected_code: grpc.StatusCode,
- expected_details: str) -> None:
- await _expect_status_code(call, expected_code)
- await _expect_status_details(call, expected_details)
-
-
-def _validate_payload_type_and_length(
- response: Union[messages_pb2.SimpleResponse, messages_pb2.
- StreamingOutputCallResponse], expected_type: Any,
- expected_length: int) -> None:
- if response.payload.type is not expected_type:
- raise ValueError('expected payload type %s, got %s' %
- (expected_type, type(response.payload.type)))
- elif len(response.payload.body) != expected_length:
- raise ValueError('expected payload body size %d, got %d' %
- (expected_length, len(response.payload.body)))
-
-
-async def _large_unary_common_behavior(
- stub: test_pb2_grpc.TestServiceStub, fill_username: bool,
- fill_oauth_scope: bool, call_credentials: Optional[grpc.CallCredentials]
-) -> messages_pb2.SimpleResponse:
- size = 314159
- request = messages_pb2.SimpleRequest(
- response_type=messages_pb2.COMPRESSABLE,
- response_size=size,
- payload=messages_pb2.Payload(body=b'\x00' * 271828),
- fill_username=fill_username,
- fill_oauth_scope=fill_oauth_scope)
- response = await stub.UnaryCall(request, credentials=call_credentials)
- _validate_payload_type_and_length(response, messages_pb2.COMPRESSABLE, size)
- return response
-
-
-async def _empty_unary(stub: test_pb2_grpc.TestServiceStub) -> None:
- response = await stub.EmptyCall(empty_pb2.Empty())
- if not isinstance(response, empty_pb2.Empty):
- raise TypeError('response is of type "%s", not empty_pb2.Empty!' %
- type(response))
-
-
-async def _large_unary(stub: test_pb2_grpc.TestServiceStub) -> None:
- await _large_unary_common_behavior(stub, False, False, None)
-
-
-async def _client_streaming(stub: test_pb2_grpc.TestServiceStub) -> None:
- payload_body_sizes = (
- 27182,
- 8,
- 1828,
- 45904,
- )
-
- async def request_gen():
- for size in payload_body_sizes:
- yield messages_pb2.StreamingInputCallRequest(
- payload=messages_pb2.Payload(body=b'\x00' * size))
-
- response = await stub.StreamingInputCall(request_gen())
- if response.aggregated_payload_size != sum(payload_body_sizes):
- raise ValueError('incorrect size %d!' %
- response.aggregated_payload_size)
-
-
-async def _server_streaming(stub: test_pb2_grpc.TestServiceStub) -> None:
- sizes = (
- 31415,
- 9,
- 2653,
- 58979,
- )
-
- request = messages_pb2.StreamingOutputCallRequest(
- response_type=messages_pb2.COMPRESSABLE,
- response_parameters=(
- messages_pb2.ResponseParameters(size=sizes[0]),
- messages_pb2.ResponseParameters(size=sizes[1]),
- messages_pb2.ResponseParameters(size=sizes[2]),
- messages_pb2.ResponseParameters(size=sizes[3]),
- ))
- call = stub.StreamingOutputCall(request)
- for size in sizes:
- response = await call.read()
- _validate_payload_type_and_length(response, messages_pb2.COMPRESSABLE,
- size)
-
-
-async def _ping_pong(stub: test_pb2_grpc.TestServiceStub) -> None:
- request_response_sizes = (
- 31415,
- 9,
- 2653,
- 58979,
- )
- request_payload_sizes = (
- 27182,
- 8,
- 1828,
- 45904,
- )
-
- call = stub.FullDuplexCall()
- for response_size, payload_size in zip(request_response_sizes,
- request_payload_sizes):
- request = messages_pb2.StreamingOutputCallRequest(
- response_type=messages_pb2.COMPRESSABLE,
- response_parameters=(messages_pb2.ResponseParameters(
- size=response_size),),
- payload=messages_pb2.Payload(body=b'\x00' * payload_size))
-
- await call.write(request)
- response = await call.read()
- _validate_payload_type_and_length(response, messages_pb2.COMPRESSABLE,
- response_size)
- await call.done_writing()
- await _validate_status_code_and_details(call, grpc.StatusCode.OK, '')
-
-
-async def _cancel_after_begin(stub: test_pb2_grpc.TestServiceStub):
- call = stub.StreamingInputCall()
- call.cancel()
- if not call.cancelled():
- raise ValueError('expected cancelled method to return True')
- code = await call.code()
- if code is not grpc.StatusCode.CANCELLED:
- raise ValueError('expected status code CANCELLED')
-
-
-async def _cancel_after_first_response(stub: test_pb2_grpc.TestServiceStub):
- request_response_sizes = (
- 31415,
- 9,
- 2653,
- 58979,
- )
- request_payload_sizes = (
- 27182,
- 8,
- 1828,
- 45904,
- )
-
- call = stub.FullDuplexCall()
-
- response_size = request_response_sizes[0]
- payload_size = request_payload_sizes[0]
- request = messages_pb2.StreamingOutputCallRequest(
- response_type=messages_pb2.COMPRESSABLE,
- response_parameters=(messages_pb2.ResponseParameters(
- size=response_size),),
- payload=messages_pb2.Payload(body=b'\x00' * payload_size))
-
- await call.write(request)
- await call.read()
-
- call.cancel()
-
- try:
- await call.read()
- except asyncio.CancelledError:
- assert await call.code() is grpc.StatusCode.CANCELLED
- else:
- raise ValueError('expected call to be cancelled')
-
-
-async def _timeout_on_sleeping_server(stub: test_pb2_grpc.TestServiceStub):
- request_payload_size = 27182
- time_limit = datetime.timedelta(seconds=1)
-
- call = stub.FullDuplexCall(timeout=time_limit.total_seconds())
-
- request = messages_pb2.StreamingOutputCallRequest(
- response_type=messages_pb2.COMPRESSABLE,
- payload=messages_pb2.Payload(body=b'\x00' * request_payload_size),
- response_parameters=(messages_pb2.ResponseParameters(
- interval_us=int(time_limit.total_seconds() * 2 * 10**6)),))
- await call.write(request)
- await call.done_writing()
- try:
- await call.read()
- except aio.AioRpcError as rpc_error:
- if rpc_error.code() is not grpc.StatusCode.DEADLINE_EXCEEDED:
- raise
- else:
- raise ValueError('expected call to exceed deadline')
-
-
-async def _empty_stream(stub: test_pb2_grpc.TestServiceStub):
- call = stub.FullDuplexCall()
- await call.done_writing()
- assert await call.read() == aio.EOF
-
-
-async def _status_code_and_message(stub: test_pb2_grpc.TestServiceStub):
- details = 'test status message'
- status = grpc.StatusCode.UNKNOWN # code = 2
-
- # Test with a UnaryCall
- request = messages_pb2.SimpleRequest(
- response_type=messages_pb2.COMPRESSABLE,
- response_size=1,
- payload=messages_pb2.Payload(body=b'\x00'),
- response_status=messages_pb2.EchoStatus(code=status.value[0],
- message=details))
- call = stub.UnaryCall(request)
- await _validate_status_code_and_details(call, status, details)
-
- # Test with a FullDuplexCall
- call = stub.FullDuplexCall()
- request = messages_pb2.StreamingOutputCallRequest(
- response_type=messages_pb2.COMPRESSABLE,
- response_parameters=(messages_pb2.ResponseParameters(size=1),),
- payload=messages_pb2.Payload(body=b'\x00'),
- response_status=messages_pb2.EchoStatus(code=status.value[0],
- message=details))
- await call.write(request) # sends the initial request.
- await call.done_writing()
- try:
- await call.read()
- except aio.AioRpcError as rpc_error:
- assert rpc_error.code() == status
- await _validate_status_code_and_details(call, status, details)
-
-
-async def _unimplemented_method(stub: test_pb2_grpc.TestServiceStub):
- call = stub.UnimplementedCall(empty_pb2.Empty())
- await _expect_status_code(call, grpc.StatusCode.UNIMPLEMENTED)
-
-
-async def _unimplemented_service(stub: test_pb2_grpc.UnimplementedServiceStub):
- call = stub.UnimplementedCall(empty_pb2.Empty())
- await _expect_status_code(call, grpc.StatusCode.UNIMPLEMENTED)
-
-
-async def _custom_metadata(stub: test_pb2_grpc.TestServiceStub):
- initial_metadata_value = "test_initial_metadata_value"
- trailing_metadata_value = b"\x0a\x0b\x0a\x0b\x0a\x0b"
- metadata = aio.Metadata(
- (_INITIAL_METADATA_KEY, initial_metadata_value),
- (_TRAILING_METADATA_KEY, trailing_metadata_value),
- )
-
- async def _validate_metadata(call):
- initial_metadata = await call.initial_metadata()
- if initial_metadata[_INITIAL_METADATA_KEY] != initial_metadata_value:
- raise ValueError('expected initial metadata %s, got %s' %
- (initial_metadata_value,
- initial_metadata[_INITIAL_METADATA_KEY]))
-
- trailing_metadata = await call.trailing_metadata()
- if trailing_metadata[_TRAILING_METADATA_KEY] != trailing_metadata_value:
- raise ValueError('expected trailing metadata %s, got %s' %
- (trailing_metadata_value,
- trailing_metadata[_TRAILING_METADATA_KEY]))
-
- # Testing with UnaryCall
- request = messages_pb2.SimpleRequest(
- response_type=messages_pb2.COMPRESSABLE,
- response_size=1,
- payload=messages_pb2.Payload(body=b'\x00'))
- call = stub.UnaryCall(request, metadata=metadata)
- await _validate_metadata(call)
-
- # Testing with FullDuplexCall
- call = stub.FullDuplexCall(metadata=metadata)
- request = messages_pb2.StreamingOutputCallRequest(
- response_type=messages_pb2.COMPRESSABLE,
- response_parameters=(messages_pb2.ResponseParameters(size=1),))
- await call.write(request)
- await call.read()
- await call.done_writing()
- await _validate_metadata(call)
-
-
-async def _compute_engine_creds(stub: test_pb2_grpc.TestServiceStub,
- args: argparse.Namespace):
- response = await _large_unary_common_behavior(stub, True, True, None)
- if args.default_service_account != response.username:
- raise ValueError('expected username %s, got %s' %
- (args.default_service_account, response.username))
-
-
-async def _oauth2_auth_token(stub: test_pb2_grpc.TestServiceStub,
- args: argparse.Namespace):
- json_key_filename = os.environ[google_auth_environment_vars.CREDENTIALS]
- wanted_email = json.load(open(json_key_filename, 'r'))['client_email']
- response = await _large_unary_common_behavior(stub, True, True, None)
- if wanted_email != response.username:
- raise ValueError('expected username %s, got %s' %
- (wanted_email, response.username))
- if args.oauth_scope.find(response.oauth_scope) == -1:
- raise ValueError(
- 'expected to find oauth scope "{}" in received "{}"'.format(
- response.oauth_scope, args.oauth_scope))
-
-
-async def _jwt_token_creds(stub: test_pb2_grpc.TestServiceStub):
- json_key_filename = os.environ[google_auth_environment_vars.CREDENTIALS]
- wanted_email = json.load(open(json_key_filename, 'r'))['client_email']
- response = await _large_unary_common_behavior(stub, True, False, None)
- if wanted_email != response.username:
- raise ValueError('expected username %s, got %s' %
- (wanted_email, response.username))
-
-
-async def _per_rpc_creds(stub: test_pb2_grpc.TestServiceStub,
- args: argparse.Namespace):
- json_key_filename = os.environ[google_auth_environment_vars.CREDENTIALS]
- wanted_email = json.load(open(json_key_filename, 'r'))['client_email']
- google_credentials, unused_project_id = google_auth.default(
- scopes=[args.oauth_scope])
- call_credentials = grpc.metadata_call_credentials(
- google_auth_transport_grpc.AuthMetadataPlugin(
- credentials=google_credentials,
- request=google_auth_transport_requests.Request()))
- response = await _large_unary_common_behavior(stub, True, False,
- call_credentials)
- if wanted_email != response.username:
- raise ValueError('expected username %s, got %s' %
- (wanted_email, response.username))
-
-
-async def _special_status_message(stub: test_pb2_grpc.TestServiceStub):
- details = b'\t\ntest with whitespace\r\nand Unicode BMP \xe2\x98\xba and non-BMP \xf0\x9f\x98\x88\t\n'.decode(
- 'utf-8')
- status = grpc.StatusCode.UNKNOWN # code = 2
-
- # Test with a UnaryCall
- request = messages_pb2.SimpleRequest(
- response_type=messages_pb2.COMPRESSABLE,
- response_size=1,
- payload=messages_pb2.Payload(body=b'\x00'),
- response_status=messages_pb2.EchoStatus(code=status.value[0],
- message=details))
- call = stub.UnaryCall(request)
- await _validate_status_code_and_details(call, status, details)
-
-
-class TestCase(enum.Enum):
- EMPTY_UNARY = 'empty_unary'
- LARGE_UNARY = 'large_unary'
- SERVER_STREAMING = 'server_streaming'
- CLIENT_STREAMING = 'client_streaming'
- PING_PONG = 'ping_pong'
- CANCEL_AFTER_BEGIN = 'cancel_after_begin'
- CANCEL_AFTER_FIRST_RESPONSE = 'cancel_after_first_response'
- TIMEOUT_ON_SLEEPING_SERVER = 'timeout_on_sleeping_server'
- EMPTY_STREAM = 'empty_stream'
- STATUS_CODE_AND_MESSAGE = 'status_code_and_message'
- UNIMPLEMENTED_METHOD = 'unimplemented_method'
- UNIMPLEMENTED_SERVICE = 'unimplemented_service'
- CUSTOM_METADATA = "custom_metadata"
- COMPUTE_ENGINE_CREDS = 'compute_engine_creds'
- OAUTH2_AUTH_TOKEN = 'oauth2_auth_token'
- JWT_TOKEN_CREDS = 'jwt_token_creds'
- PER_RPC_CREDS = 'per_rpc_creds'
- SPECIAL_STATUS_MESSAGE = 'special_status_message'
-
-
-_TEST_CASE_IMPLEMENTATION_MAPPING = {
- TestCase.EMPTY_UNARY: _empty_unary,
- TestCase.LARGE_UNARY: _large_unary,
- TestCase.SERVER_STREAMING: _server_streaming,
- TestCase.CLIENT_STREAMING: _client_streaming,
- TestCase.PING_PONG: _ping_pong,
- TestCase.CANCEL_AFTER_BEGIN: _cancel_after_begin,
- TestCase.CANCEL_AFTER_FIRST_RESPONSE: _cancel_after_first_response,
- TestCase.TIMEOUT_ON_SLEEPING_SERVER: _timeout_on_sleeping_server,
- TestCase.EMPTY_STREAM: _empty_stream,
- TestCase.STATUS_CODE_AND_MESSAGE: _status_code_and_message,
- TestCase.UNIMPLEMENTED_METHOD: _unimplemented_method,
- TestCase.UNIMPLEMENTED_SERVICE: _unimplemented_service,
- TestCase.CUSTOM_METADATA: _custom_metadata,
- TestCase.COMPUTE_ENGINE_CREDS: _compute_engine_creds,
- TestCase.OAUTH2_AUTH_TOKEN: _oauth2_auth_token,
- TestCase.JWT_TOKEN_CREDS: _jwt_token_creds,
- TestCase.PER_RPC_CREDS: _per_rpc_creds,
- TestCase.SPECIAL_STATUS_MESSAGE: _special_status_message,
-}
-
-
-async def test_interoperability(case: TestCase,
- stub: test_pb2_grpc.TestServiceStub,
- args: Optional[argparse.Namespace] = None
- ) -> None:
- method = _TEST_CASE_IMPLEMENTATION_MAPPING.get(case)
- if method is None:
- raise NotImplementedError(f'Test case "{case}" not implemented!')
- else:
- num_params = len(inspect.signature(method).parameters)
- if num_params == 1:
- await method(stub)
- elif num_params == 2:
- if args is not None:
- await method(stub, args)
- else:
- raise ValueError(f'Failed to run case [{case}]: args is None')
- else:
- raise ValueError(f'Invalid number of parameters [{num_params}]')
+# Copyright 2019 The gRPC Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+"""Implementations of interoperability test methods."""
+
+import argparse
+import asyncio
+import collections
+import datetime
+import enum
+import inspect
+import json
+import os
+import threading
+import time
+from typing import Any, Optional, Union
+
+import grpc
+from google import auth as google_auth
+from google.auth import environment_vars as google_auth_environment_vars
+from google.auth.transport import grpc as google_auth_transport_grpc
+from google.auth.transport import requests as google_auth_transport_requests
+from grpc.experimental import aio
+
+from src.proto.grpc.testing import empty_pb2, messages_pb2, test_pb2_grpc
+
+_INITIAL_METADATA_KEY = "x-grpc-test-echo-initial"
+_TRAILING_METADATA_KEY = "x-grpc-test-echo-trailing-bin"
+
+
+async def _expect_status_code(call: aio.Call,
+ expected_code: grpc.StatusCode) -> None:
+ code = await call.code()
+ if code != expected_code:
+ raise ValueError('expected code %s, got %s' %
+ (expected_code, await call.code()))
+
+
+async def _expect_status_details(call: aio.Call, expected_details: str) -> None:
+ details = await call.details()
+ if details != expected_details:
+ raise ValueError('expected message %s, got %s' %
+ (expected_details, await call.details()))
+
+
+async def _validate_status_code_and_details(call: aio.Call,
+ expected_code: grpc.StatusCode,
+ expected_details: str) -> None:
+ await _expect_status_code(call, expected_code)
+ await _expect_status_details(call, expected_details)
+
+
+def _validate_payload_type_and_length(
+ response: Union[messages_pb2.SimpleResponse, messages_pb2.
+ StreamingOutputCallResponse], expected_type: Any,
+ expected_length: int) -> None:
+ if response.payload.type is not expected_type:
+ raise ValueError('expected payload type %s, got %s' %
+ (expected_type, type(response.payload.type)))
+ elif len(response.payload.body) != expected_length:
+ raise ValueError('expected payload body size %d, got %d' %
+ (expected_length, len(response.payload.body)))
+
+
+async def _large_unary_common_behavior(
+ stub: test_pb2_grpc.TestServiceStub, fill_username: bool,
+ fill_oauth_scope: bool, call_credentials: Optional[grpc.CallCredentials]
+) -> messages_pb2.SimpleResponse:
+ size = 314159
+ request = messages_pb2.SimpleRequest(
+ response_type=messages_pb2.COMPRESSABLE,
+ response_size=size,
+ payload=messages_pb2.Payload(body=b'\x00' * 271828),
+ fill_username=fill_username,
+ fill_oauth_scope=fill_oauth_scope)
+ response = await stub.UnaryCall(request, credentials=call_credentials)
+ _validate_payload_type_and_length(response, messages_pb2.COMPRESSABLE, size)
+ return response
+
+
+async def _empty_unary(stub: test_pb2_grpc.TestServiceStub) -> None:
+ response = await stub.EmptyCall(empty_pb2.Empty())
+ if not isinstance(response, empty_pb2.Empty):
+ raise TypeError('response is of type "%s", not empty_pb2.Empty!' %
+ type(response))
+
+
+async def _large_unary(stub: test_pb2_grpc.TestServiceStub) -> None:
+ await _large_unary_common_behavior(stub, False, False, None)
+
+
+async def _client_streaming(stub: test_pb2_grpc.TestServiceStub) -> None:
+ payload_body_sizes = (
+ 27182,
+ 8,
+ 1828,
+ 45904,
+ )
+
+ async def request_gen():
+ for size in payload_body_sizes:
+ yield messages_pb2.StreamingInputCallRequest(
+ payload=messages_pb2.Payload(body=b'\x00' * size))
+
+ response = await stub.StreamingInputCall(request_gen())
+ if response.aggregated_payload_size != sum(payload_body_sizes):
+ raise ValueError('incorrect size %d!' %
+ response.aggregated_payload_size)
+
+
+async def _server_streaming(stub: test_pb2_grpc.TestServiceStub) -> None:
+ sizes = (
+ 31415,
+ 9,
+ 2653,
+ 58979,
+ )
+
+ request = messages_pb2.StreamingOutputCallRequest(
+ response_type=messages_pb2.COMPRESSABLE,
+ response_parameters=(
+ messages_pb2.ResponseParameters(size=sizes[0]),
+ messages_pb2.ResponseParameters(size=sizes[1]),
+ messages_pb2.ResponseParameters(size=sizes[2]),
+ messages_pb2.ResponseParameters(size=sizes[3]),
+ ))
+ call = stub.StreamingOutputCall(request)
+ for size in sizes:
+ response = await call.read()
+ _validate_payload_type_and_length(response, messages_pb2.COMPRESSABLE,
+ size)
+
+
+async def _ping_pong(stub: test_pb2_grpc.TestServiceStub) -> None:
+ request_response_sizes = (
+ 31415,
+ 9,
+ 2653,
+ 58979,
+ )
+ request_payload_sizes = (
+ 27182,
+ 8,
+ 1828,
+ 45904,
+ )
+
+ call = stub.FullDuplexCall()
+ for response_size, payload_size in zip(request_response_sizes,
+ request_payload_sizes):
+ request = messages_pb2.StreamingOutputCallRequest(
+ response_type=messages_pb2.COMPRESSABLE,
+ response_parameters=(messages_pb2.ResponseParameters(
+ size=response_size),),
+ payload=messages_pb2.Payload(body=b'\x00' * payload_size))
+
+ await call.write(request)
+ response = await call.read()
+ _validate_payload_type_and_length(response, messages_pb2.COMPRESSABLE,
+ response_size)
+ await call.done_writing()
+ await _validate_status_code_and_details(call, grpc.StatusCode.OK, '')
+
+
+async def _cancel_after_begin(stub: test_pb2_grpc.TestServiceStub):
+ call = stub.StreamingInputCall()
+ call.cancel()
+ if not call.cancelled():
+ raise ValueError('expected cancelled method to return True')
+ code = await call.code()
+ if code is not grpc.StatusCode.CANCELLED:
+ raise ValueError('expected status code CANCELLED')
+
+
+async def _cancel_after_first_response(stub: test_pb2_grpc.TestServiceStub):
+ request_response_sizes = (
+ 31415,
+ 9,
+ 2653,
+ 58979,
+ )
+ request_payload_sizes = (
+ 27182,
+ 8,
+ 1828,
+ 45904,
+ )
+
+ call = stub.FullDuplexCall()
+
+ response_size = request_response_sizes[0]
+ payload_size = request_payload_sizes[0]
+ request = messages_pb2.StreamingOutputCallRequest(
+ response_type=messages_pb2.COMPRESSABLE,
+ response_parameters=(messages_pb2.ResponseParameters(
+ size=response_size),),
+ payload=messages_pb2.Payload(body=b'\x00' * payload_size))
+
+ await call.write(request)
+ await call.read()
+
+ call.cancel()
+
+ try:
+ await call.read()
+ except asyncio.CancelledError:
+ assert await call.code() is grpc.StatusCode.CANCELLED
+ else:
+ raise ValueError('expected call to be cancelled')
+
+
+async def _timeout_on_sleeping_server(stub: test_pb2_grpc.TestServiceStub):
+ request_payload_size = 27182
+ time_limit = datetime.timedelta(seconds=1)
+
+ call = stub.FullDuplexCall(timeout=time_limit.total_seconds())
+
+ request = messages_pb2.StreamingOutputCallRequest(
+ response_type=messages_pb2.COMPRESSABLE,
+ payload=messages_pb2.Payload(body=b'\x00' * request_payload_size),
+ response_parameters=(messages_pb2.ResponseParameters(
+ interval_us=int(time_limit.total_seconds() * 2 * 10**6)),))
+ await call.write(request)
+ await call.done_writing()
+ try:
+ await call.read()
+ except aio.AioRpcError as rpc_error:
+ if rpc_error.code() is not grpc.StatusCode.DEADLINE_EXCEEDED:
+ raise
+ else:
+ raise ValueError('expected call to exceed deadline')
+
+
+async def _empty_stream(stub: test_pb2_grpc.TestServiceStub):
+ call = stub.FullDuplexCall()
+ await call.done_writing()
+ assert await call.read() == aio.EOF
+
+
+async def _status_code_and_message(stub: test_pb2_grpc.TestServiceStub):
+ details = 'test status message'
+ status = grpc.StatusCode.UNKNOWN # code = 2
+
+ # Test with a UnaryCall
+ request = messages_pb2.SimpleRequest(
+ response_type=messages_pb2.COMPRESSABLE,
+ response_size=1,
+ payload=messages_pb2.Payload(body=b'\x00'),
+ response_status=messages_pb2.EchoStatus(code=status.value[0],
+ message=details))
+ call = stub.UnaryCall(request)
+ await _validate_status_code_and_details(call, status, details)
+
+ # Test with a FullDuplexCall
+ call = stub.FullDuplexCall()
+ request = messages_pb2.StreamingOutputCallRequest(
+ response_type=messages_pb2.COMPRESSABLE,
+ response_parameters=(messages_pb2.ResponseParameters(size=1),),
+ payload=messages_pb2.Payload(body=b'\x00'),
+ response_status=messages_pb2.EchoStatus(code=status.value[0],
+ message=details))
+ await call.write(request) # sends the initial request.
+ await call.done_writing()
+ try:
+ await call.read()
+ except aio.AioRpcError as rpc_error:
+ assert rpc_error.code() == status
+ await _validate_status_code_and_details(call, status, details)
+
+
+async def _unimplemented_method(stub: test_pb2_grpc.TestServiceStub):
+ call = stub.UnimplementedCall(empty_pb2.Empty())
+ await _expect_status_code(call, grpc.StatusCode.UNIMPLEMENTED)
+
+
+async def _unimplemented_service(stub: test_pb2_grpc.UnimplementedServiceStub):
+ call = stub.UnimplementedCall(empty_pb2.Empty())
+ await _expect_status_code(call, grpc.StatusCode.UNIMPLEMENTED)
+
+
+async def _custom_metadata(stub: test_pb2_grpc.TestServiceStub):
+ initial_metadata_value = "test_initial_metadata_value"
+ trailing_metadata_value = b"\x0a\x0b\x0a\x0b\x0a\x0b"
+ metadata = aio.Metadata(
+ (_INITIAL_METADATA_KEY, initial_metadata_value),
+ (_TRAILING_METADATA_KEY, trailing_metadata_value),
+ )
+
+ async def _validate_metadata(call):
+ initial_metadata = await call.initial_metadata()
+ if initial_metadata[_INITIAL_METADATA_KEY] != initial_metadata_value:
+ raise ValueError('expected initial metadata %s, got %s' %
+ (initial_metadata_value,
+ initial_metadata[_INITIAL_METADATA_KEY]))
+
+ trailing_metadata = await call.trailing_metadata()
+ if trailing_metadata[_TRAILING_METADATA_KEY] != trailing_metadata_value:
+ raise ValueError('expected trailing metadata %s, got %s' %
+ (trailing_metadata_value,
+ trailing_metadata[_TRAILING_METADATA_KEY]))
+
+ # Testing with UnaryCall
+ request = messages_pb2.SimpleRequest(
+ response_type=messages_pb2.COMPRESSABLE,
+ response_size=1,
+ payload=messages_pb2.Payload(body=b'\x00'))
+ call = stub.UnaryCall(request, metadata=metadata)
+ await _validate_metadata(call)
+
+ # Testing with FullDuplexCall
+ call = stub.FullDuplexCall(metadata=metadata)
+ request = messages_pb2.StreamingOutputCallRequest(
+ response_type=messages_pb2.COMPRESSABLE,
+ response_parameters=(messages_pb2.ResponseParameters(size=1),))
+ await call.write(request)
+ await call.read()
+ await call.done_writing()
+ await _validate_metadata(call)
+
+
+async def _compute_engine_creds(stub: test_pb2_grpc.TestServiceStub,
+ args: argparse.Namespace):
+ response = await _large_unary_common_behavior(stub, True, True, None)
+ if args.default_service_account != response.username:
+ raise ValueError('expected username %s, got %s' %
+ (args.default_service_account, response.username))
+
+
+async def _oauth2_auth_token(stub: test_pb2_grpc.TestServiceStub,
+ args: argparse.Namespace):
+ json_key_filename = os.environ[google_auth_environment_vars.CREDENTIALS]
+ wanted_email = json.load(open(json_key_filename, 'r'))['client_email']
+ response = await _large_unary_common_behavior(stub, True, True, None)
+ if wanted_email != response.username:
+ raise ValueError('expected username %s, got %s' %
+ (wanted_email, response.username))
+ if args.oauth_scope.find(response.oauth_scope) == -1:
+ raise ValueError(
+ 'expected to find oauth scope "{}" in received "{}"'.format(
+ response.oauth_scope, args.oauth_scope))
+
+
+async def _jwt_token_creds(stub: test_pb2_grpc.TestServiceStub):
+ json_key_filename = os.environ[google_auth_environment_vars.CREDENTIALS]
+ wanted_email = json.load(open(json_key_filename, 'r'))['client_email']
+ response = await _large_unary_common_behavior(stub, True, False, None)
+ if wanted_email != response.username:
+ raise ValueError('expected username %s, got %s' %
+ (wanted_email, response.username))
+
+
+async def _per_rpc_creds(stub: test_pb2_grpc.TestServiceStub,
+ args: argparse.Namespace):
+ json_key_filename = os.environ[google_auth_environment_vars.CREDENTIALS]
+ wanted_email = json.load(open(json_key_filename, 'r'))['client_email']
+ google_credentials, unused_project_id = google_auth.default(
+ scopes=[args.oauth_scope])
+ call_credentials = grpc.metadata_call_credentials(
+ google_auth_transport_grpc.AuthMetadataPlugin(
+ credentials=google_credentials,
+ request=google_auth_transport_requests.Request()))
+ response = await _large_unary_common_behavior(stub, True, False,
+ call_credentials)
+ if wanted_email != response.username:
+ raise ValueError('expected username %s, got %s' %
+ (wanted_email, response.username))
+
+
+async def _special_status_message(stub: test_pb2_grpc.TestServiceStub):
+ details = b'\t\ntest with whitespace\r\nand Unicode BMP \xe2\x98\xba and non-BMP \xf0\x9f\x98\x88\t\n'.decode(
+ 'utf-8')
+ status = grpc.StatusCode.UNKNOWN # code = 2
+
+ # Test with a UnaryCall
+ request = messages_pb2.SimpleRequest(
+ response_type=messages_pb2.COMPRESSABLE,
+ response_size=1,
+ payload=messages_pb2.Payload(body=b'\x00'),
+ response_status=messages_pb2.EchoStatus(code=status.value[0],
+ message=details))
+ call = stub.UnaryCall(request)
+ await _validate_status_code_and_details(call, status, details)
+
+
+class TestCase(enum.Enum):
+ EMPTY_UNARY = 'empty_unary'
+ LARGE_UNARY = 'large_unary'
+ SERVER_STREAMING = 'server_streaming'
+ CLIENT_STREAMING = 'client_streaming'
+ PING_PONG = 'ping_pong'
+ CANCEL_AFTER_BEGIN = 'cancel_after_begin'
+ CANCEL_AFTER_FIRST_RESPONSE = 'cancel_after_first_response'
+ TIMEOUT_ON_SLEEPING_SERVER = 'timeout_on_sleeping_server'
+ EMPTY_STREAM = 'empty_stream'
+ STATUS_CODE_AND_MESSAGE = 'status_code_and_message'
+ UNIMPLEMENTED_METHOD = 'unimplemented_method'
+ UNIMPLEMENTED_SERVICE = 'unimplemented_service'
+ CUSTOM_METADATA = "custom_metadata"
+ COMPUTE_ENGINE_CREDS = 'compute_engine_creds'
+ OAUTH2_AUTH_TOKEN = 'oauth2_auth_token'
+ JWT_TOKEN_CREDS = 'jwt_token_creds'
+ PER_RPC_CREDS = 'per_rpc_creds'
+ SPECIAL_STATUS_MESSAGE = 'special_status_message'
+
+
+_TEST_CASE_IMPLEMENTATION_MAPPING = {
+ TestCase.EMPTY_UNARY: _empty_unary,
+ TestCase.LARGE_UNARY: _large_unary,
+ TestCase.SERVER_STREAMING: _server_streaming,
+ TestCase.CLIENT_STREAMING: _client_streaming,
+ TestCase.PING_PONG: _ping_pong,
+ TestCase.CANCEL_AFTER_BEGIN: _cancel_after_begin,
+ TestCase.CANCEL_AFTER_FIRST_RESPONSE: _cancel_after_first_response,
+ TestCase.TIMEOUT_ON_SLEEPING_SERVER: _timeout_on_sleeping_server,
+ TestCase.EMPTY_STREAM: _empty_stream,
+ TestCase.STATUS_CODE_AND_MESSAGE: _status_code_and_message,
+ TestCase.UNIMPLEMENTED_METHOD: _unimplemented_method,
+ TestCase.UNIMPLEMENTED_SERVICE: _unimplemented_service,
+ TestCase.CUSTOM_METADATA: _custom_metadata,
+ TestCase.COMPUTE_ENGINE_CREDS: _compute_engine_creds,
+ TestCase.OAUTH2_AUTH_TOKEN: _oauth2_auth_token,
+ TestCase.JWT_TOKEN_CREDS: _jwt_token_creds,
+ TestCase.PER_RPC_CREDS: _per_rpc_creds,
+ TestCase.SPECIAL_STATUS_MESSAGE: _special_status_message,
+}
+
+
+async def test_interoperability(case: TestCase,
+ stub: test_pb2_grpc.TestServiceStub,
+ args: Optional[argparse.Namespace] = None
+ ) -> None:
+ method = _TEST_CASE_IMPLEMENTATION_MAPPING.get(case)
+ if method is None:
+ raise NotImplementedError(f'Test case "{case}" not implemented!')
+ else:
+ num_params = len(inspect.signature(method).parameters)
+ if num_params == 1:
+ await method(stub)
+ elif num_params == 2:
+ if args is not None:
+ await method(stub, args)
+ else:
+ raise ValueError(f'Failed to run case [{case}]: args is None')
+ else:
+ raise ValueError(f'Invalid number of parameters [{num_params}]')
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/interop/server.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/interop/server.py
index 7e5782b43de..509abdf0b2f 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/interop/server.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/interop/server.py
@@ -1,49 +1,49 @@
-# Copyright 2019 The gRPC Authors
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-"""The gRPC interoperability test server using AsyncIO stack."""
-
-import asyncio
-import argparse
-import logging
-
-import grpc
-
-from tests.interop import server as interop_server_lib
-from tests_aio.unit import _test_server
-
-logging.basicConfig(level=logging.DEBUG)
-_LOGGER = logging.getLogger(__name__)
-_LOGGER.setLevel(logging.DEBUG)
-
-
-async def serve():
- args = interop_server_lib.parse_interop_server_arguments()
-
- if args.use_tls or args.use_alts:
- credentials = interop_server_lib.get_server_credentials(args.use_tls)
- address, server = await _test_server.start_test_server(
- port=args.port, secure=True, server_credentials=credentials)
- else:
- address, server = await _test_server.start_test_server(
- port=args.port,
- secure=False,
- )
-
- _LOGGER.info('Server serving at %s', address)
- await server.wait_for_termination()
- _LOGGER.info('Server stopped; exiting.')
-
-
-if __name__ == '__main__':
- asyncio.get_event_loop().run_until_complete(serve())
+# Copyright 2019 The gRPC Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+"""The gRPC interoperability test server using AsyncIO stack."""
+
+import asyncio
+import argparse
+import logging
+
+import grpc
+
+from tests.interop import server as interop_server_lib
+from tests_aio.unit import _test_server
+
+logging.basicConfig(level=logging.DEBUG)
+_LOGGER = logging.getLogger(__name__)
+_LOGGER.setLevel(logging.DEBUG)
+
+
+async def serve():
+ args = interop_server_lib.parse_interop_server_arguments()
+
+ if args.use_tls or args.use_alts:
+ credentials = interop_server_lib.get_server_credentials(args.use_tls)
+ address, server = await _test_server.start_test_server(
+ port=args.port, secure=True, server_credentials=credentials)
+ else:
+ address, server = await _test_server.start_test_server(
+ port=args.port,
+ secure=False,
+ )
+
+ _LOGGER.info('Server serving at %s', address)
+ await server.wait_for_termination()
+ _LOGGER.info('Server stopped; exiting.')
+
+
+if __name__ == '__main__':
+ asyncio.get_event_loop().run_until_complete(serve())
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/reflection/__init__.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/reflection/__init__.py
index 8d89990e826..5772620b602 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/reflection/__init__.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/reflection/__init__.py
@@ -1,13 +1,13 @@
-# Copyright 2016 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
+# Copyright 2016 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/reflection/reflection_servicer_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/reflection/reflection_servicer_test.py
index 73ecc467185..edd2d79eabe 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/reflection/reflection_servicer_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/reflection/reflection_servicer_test.py
@@ -1,193 +1,193 @@
-# Copyright 2016 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-"""Tests of grpc_reflection.v1alpha.reflection."""
-
-import logging
-import unittest
-
-import grpc
-from google.protobuf import descriptor_pb2
-from grpc.experimental import aio
-
-from grpc_reflection.v1alpha import (reflection, reflection_pb2,
- reflection_pb2_grpc)
-from src.proto.grpc.testing import empty_pb2
-from src.proto.grpc.testing.proto2 import empty2_extensions_pb2
-from tests_aio.unit._test_base import AioTestBase
-
-_EMPTY_PROTO_FILE_NAME = 'src/proto/grpc/testing/empty.proto'
-_EMPTY_PROTO_SYMBOL_NAME = 'grpc.testing.Empty'
-_SERVICE_NAMES = ('Angstrom', 'Bohr', 'Curie', 'Dyson', 'Einstein', 'Feynman',
- 'Galilei')
-_EMPTY_EXTENSIONS_SYMBOL_NAME = 'grpc.testing.proto2.EmptyWithExtensions'
-_EMPTY_EXTENSIONS_NUMBERS = (
- 124,
- 125,
- 126,
- 127,
- 128,
-)
-
-
-def _file_descriptor_to_proto(descriptor):
- proto = descriptor_pb2.FileDescriptorProto()
- descriptor.CopyToProto(proto)
- return proto.SerializeToString()
-
-
-class ReflectionServicerTest(AioTestBase):
-
- async def setUp(self):
- self._server = aio.server()
- reflection.enable_server_reflection(_SERVICE_NAMES, self._server)
- port = self._server.add_insecure_port('[::]:0')
- await self._server.start()
-
- self._channel = aio.insecure_channel('localhost:%d' % port)
- self._stub = reflection_pb2_grpc.ServerReflectionStub(self._channel)
-
- async def tearDown(self):
- await self._server.stop(None)
- await self._channel.close()
-
- async def test_file_by_name(self):
- requests = (
- reflection_pb2.ServerReflectionRequest(
- file_by_filename=_EMPTY_PROTO_FILE_NAME),
- reflection_pb2.ServerReflectionRequest(
- file_by_filename='i-donut-exist'),
- )
- responses = []
- async for response in self._stub.ServerReflectionInfo(iter(requests)):
- responses.append(response)
- expected_responses = (
- reflection_pb2.ServerReflectionResponse(
- valid_host='',
- file_descriptor_response=reflection_pb2.FileDescriptorResponse(
- file_descriptor_proto=(
- _file_descriptor_to_proto(empty_pb2.DESCRIPTOR),))),
- reflection_pb2.ServerReflectionResponse(
- valid_host='',
- error_response=reflection_pb2.ErrorResponse(
- error_code=grpc.StatusCode.NOT_FOUND.value[0],
- error_message=grpc.StatusCode.NOT_FOUND.value[1].encode(),
- )),
- )
- self.assertSequenceEqual(expected_responses, responses)
-
- async def test_file_by_symbol(self):
- requests = (
- reflection_pb2.ServerReflectionRequest(
- file_containing_symbol=_EMPTY_PROTO_SYMBOL_NAME),
- reflection_pb2.ServerReflectionRequest(
- file_containing_symbol='i.donut.exist.co.uk.org.net.me.name.foo'
- ),
- )
- responses = []
- async for response in self._stub.ServerReflectionInfo(iter(requests)):
- responses.append(response)
- expected_responses = (
- reflection_pb2.ServerReflectionResponse(
- valid_host='',
- file_descriptor_response=reflection_pb2.FileDescriptorResponse(
- file_descriptor_proto=(
- _file_descriptor_to_proto(empty_pb2.DESCRIPTOR),))),
- reflection_pb2.ServerReflectionResponse(
- valid_host='',
- error_response=reflection_pb2.ErrorResponse(
- error_code=grpc.StatusCode.NOT_FOUND.value[0],
- error_message=grpc.StatusCode.NOT_FOUND.value[1].encode(),
- )),
- )
- self.assertSequenceEqual(expected_responses, responses)
-
- async def test_file_containing_extension(self):
- requests = (
- reflection_pb2.ServerReflectionRequest(
- file_containing_extension=reflection_pb2.ExtensionRequest(
- containing_type=_EMPTY_EXTENSIONS_SYMBOL_NAME,
- extension_number=125,
- ),),
- reflection_pb2.ServerReflectionRequest(
- file_containing_extension=reflection_pb2.ExtensionRequest(
- containing_type='i.donut.exist.co.uk.org.net.me.name.foo',
- extension_number=55,
- ),),
- )
- responses = []
- async for response in self._stub.ServerReflectionInfo(iter(requests)):
- responses.append(response)
- expected_responses = (
- reflection_pb2.ServerReflectionResponse(
- valid_host='',
- file_descriptor_response=reflection_pb2.FileDescriptorResponse(
- file_descriptor_proto=(_file_descriptor_to_proto(
- empty2_extensions_pb2.DESCRIPTOR),))),
- reflection_pb2.ServerReflectionResponse(
- valid_host='',
- error_response=reflection_pb2.ErrorResponse(
- error_code=grpc.StatusCode.NOT_FOUND.value[0],
- error_message=grpc.StatusCode.NOT_FOUND.value[1].encode(),
- )),
- )
- self.assertSequenceEqual(expected_responses, responses)
-
- async def test_extension_numbers_of_type(self):
- requests = (
- reflection_pb2.ServerReflectionRequest(
- all_extension_numbers_of_type=_EMPTY_EXTENSIONS_SYMBOL_NAME),
- reflection_pb2.ServerReflectionRequest(
- all_extension_numbers_of_type='i.donut.exist.co.uk.net.name.foo'
- ),
- )
- responses = []
- async for response in self._stub.ServerReflectionInfo(iter(requests)):
- responses.append(response)
- expected_responses = (
- reflection_pb2.ServerReflectionResponse(
- valid_host='',
- all_extension_numbers_response=reflection_pb2.
- ExtensionNumberResponse(
- base_type_name=_EMPTY_EXTENSIONS_SYMBOL_NAME,
- extension_number=_EMPTY_EXTENSIONS_NUMBERS)),
- reflection_pb2.ServerReflectionResponse(
- valid_host='',
- error_response=reflection_pb2.ErrorResponse(
- error_code=grpc.StatusCode.NOT_FOUND.value[0],
- error_message=grpc.StatusCode.NOT_FOUND.value[1].encode(),
- )),
- )
- self.assertSequenceEqual(expected_responses, responses)
-
- async def test_list_services(self):
- requests = (reflection_pb2.ServerReflectionRequest(list_services='',),)
- responses = []
- async for response in self._stub.ServerReflectionInfo(iter(requests)):
- responses.append(response)
- expected_responses = (reflection_pb2.ServerReflectionResponse(
- valid_host='',
- list_services_response=reflection_pb2.ListServiceResponse(
- service=tuple(
- reflection_pb2.ServiceResponse(name=name)
- for name in _SERVICE_NAMES))),)
- self.assertSequenceEqual(expected_responses, responses)
-
- def test_reflection_service_name(self):
- self.assertEqual(reflection.SERVICE_NAME,
- 'grpc.reflection.v1alpha.ServerReflection')
-
-
-if __name__ == '__main__':
- logging.basicConfig(level=logging.DEBUG)
- unittest.main(verbosity=2)
+# Copyright 2016 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+"""Tests of grpc_reflection.v1alpha.reflection."""
+
+import logging
+import unittest
+
+import grpc
+from google.protobuf import descriptor_pb2
+from grpc.experimental import aio
+
+from grpc_reflection.v1alpha import (reflection, reflection_pb2,
+ reflection_pb2_grpc)
+from src.proto.grpc.testing import empty_pb2
+from src.proto.grpc.testing.proto2 import empty2_extensions_pb2
+from tests_aio.unit._test_base import AioTestBase
+
+_EMPTY_PROTO_FILE_NAME = 'src/proto/grpc/testing/empty.proto'
+_EMPTY_PROTO_SYMBOL_NAME = 'grpc.testing.Empty'
+_SERVICE_NAMES = ('Angstrom', 'Bohr', 'Curie', 'Dyson', 'Einstein', 'Feynman',
+ 'Galilei')
+_EMPTY_EXTENSIONS_SYMBOL_NAME = 'grpc.testing.proto2.EmptyWithExtensions'
+_EMPTY_EXTENSIONS_NUMBERS = (
+ 124,
+ 125,
+ 126,
+ 127,
+ 128,
+)
+
+
+def _file_descriptor_to_proto(descriptor):
+ proto = descriptor_pb2.FileDescriptorProto()
+ descriptor.CopyToProto(proto)
+ return proto.SerializeToString()
+
+
+class ReflectionServicerTest(AioTestBase):
+
+ async def setUp(self):
+ self._server = aio.server()
+ reflection.enable_server_reflection(_SERVICE_NAMES, self._server)
+ port = self._server.add_insecure_port('[::]:0')
+ await self._server.start()
+
+ self._channel = aio.insecure_channel('localhost:%d' % port)
+ self._stub = reflection_pb2_grpc.ServerReflectionStub(self._channel)
+
+ async def tearDown(self):
+ await self._server.stop(None)
+ await self._channel.close()
+
+ async def test_file_by_name(self):
+ requests = (
+ reflection_pb2.ServerReflectionRequest(
+ file_by_filename=_EMPTY_PROTO_FILE_NAME),
+ reflection_pb2.ServerReflectionRequest(
+ file_by_filename='i-donut-exist'),
+ )
+ responses = []
+ async for response in self._stub.ServerReflectionInfo(iter(requests)):
+ responses.append(response)
+ expected_responses = (
+ reflection_pb2.ServerReflectionResponse(
+ valid_host='',
+ file_descriptor_response=reflection_pb2.FileDescriptorResponse(
+ file_descriptor_proto=(
+ _file_descriptor_to_proto(empty_pb2.DESCRIPTOR),))),
+ reflection_pb2.ServerReflectionResponse(
+ valid_host='',
+ error_response=reflection_pb2.ErrorResponse(
+ error_code=grpc.StatusCode.NOT_FOUND.value[0],
+ error_message=grpc.StatusCode.NOT_FOUND.value[1].encode(),
+ )),
+ )
+ self.assertSequenceEqual(expected_responses, responses)
+
+ async def test_file_by_symbol(self):
+ requests = (
+ reflection_pb2.ServerReflectionRequest(
+ file_containing_symbol=_EMPTY_PROTO_SYMBOL_NAME),
+ reflection_pb2.ServerReflectionRequest(
+ file_containing_symbol='i.donut.exist.co.uk.org.net.me.name.foo'
+ ),
+ )
+ responses = []
+ async for response in self._stub.ServerReflectionInfo(iter(requests)):
+ responses.append(response)
+ expected_responses = (
+ reflection_pb2.ServerReflectionResponse(
+ valid_host='',
+ file_descriptor_response=reflection_pb2.FileDescriptorResponse(
+ file_descriptor_proto=(
+ _file_descriptor_to_proto(empty_pb2.DESCRIPTOR),))),
+ reflection_pb2.ServerReflectionResponse(
+ valid_host='',
+ error_response=reflection_pb2.ErrorResponse(
+ error_code=grpc.StatusCode.NOT_FOUND.value[0],
+ error_message=grpc.StatusCode.NOT_FOUND.value[1].encode(),
+ )),
+ )
+ self.assertSequenceEqual(expected_responses, responses)
+
+ async def test_file_containing_extension(self):
+ requests = (
+ reflection_pb2.ServerReflectionRequest(
+ file_containing_extension=reflection_pb2.ExtensionRequest(
+ containing_type=_EMPTY_EXTENSIONS_SYMBOL_NAME,
+ extension_number=125,
+ ),),
+ reflection_pb2.ServerReflectionRequest(
+ file_containing_extension=reflection_pb2.ExtensionRequest(
+ containing_type='i.donut.exist.co.uk.org.net.me.name.foo',
+ extension_number=55,
+ ),),
+ )
+ responses = []
+ async for response in self._stub.ServerReflectionInfo(iter(requests)):
+ responses.append(response)
+ expected_responses = (
+ reflection_pb2.ServerReflectionResponse(
+ valid_host='',
+ file_descriptor_response=reflection_pb2.FileDescriptorResponse(
+ file_descriptor_proto=(_file_descriptor_to_proto(
+ empty2_extensions_pb2.DESCRIPTOR),))),
+ reflection_pb2.ServerReflectionResponse(
+ valid_host='',
+ error_response=reflection_pb2.ErrorResponse(
+ error_code=grpc.StatusCode.NOT_FOUND.value[0],
+ error_message=grpc.StatusCode.NOT_FOUND.value[1].encode(),
+ )),
+ )
+ self.assertSequenceEqual(expected_responses, responses)
+
+ async def test_extension_numbers_of_type(self):
+ requests = (
+ reflection_pb2.ServerReflectionRequest(
+ all_extension_numbers_of_type=_EMPTY_EXTENSIONS_SYMBOL_NAME),
+ reflection_pb2.ServerReflectionRequest(
+ all_extension_numbers_of_type='i.donut.exist.co.uk.net.name.foo'
+ ),
+ )
+ responses = []
+ async for response in self._stub.ServerReflectionInfo(iter(requests)):
+ responses.append(response)
+ expected_responses = (
+ reflection_pb2.ServerReflectionResponse(
+ valid_host='',
+ all_extension_numbers_response=reflection_pb2.
+ ExtensionNumberResponse(
+ base_type_name=_EMPTY_EXTENSIONS_SYMBOL_NAME,
+ extension_number=_EMPTY_EXTENSIONS_NUMBERS)),
+ reflection_pb2.ServerReflectionResponse(
+ valid_host='',
+ error_response=reflection_pb2.ErrorResponse(
+ error_code=grpc.StatusCode.NOT_FOUND.value[0],
+ error_message=grpc.StatusCode.NOT_FOUND.value[1].encode(),
+ )),
+ )
+ self.assertSequenceEqual(expected_responses, responses)
+
+ async def test_list_services(self):
+ requests = (reflection_pb2.ServerReflectionRequest(list_services='',),)
+ responses = []
+ async for response in self._stub.ServerReflectionInfo(iter(requests)):
+ responses.append(response)
+ expected_responses = (reflection_pb2.ServerReflectionResponse(
+ valid_host='',
+ list_services_response=reflection_pb2.ListServiceResponse(
+ service=tuple(
+ reflection_pb2.ServiceResponse(name=name)
+ for name in _SERVICE_NAMES))),)
+ self.assertSequenceEqual(expected_responses, responses)
+
+ def test_reflection_service_name(self):
+ self.assertEqual(reflection.SERVICE_NAME,
+ 'grpc.reflection.v1alpha.ServerReflection')
+
+
+if __name__ == '__main__':
+ logging.basicConfig(level=logging.DEBUG)
+ unittest.main(verbosity=2)
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/status/__init__.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/status/__init__.py
index 2cb28cb4645..1517f71d093 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/status/__init__.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/status/__init__.py
@@ -1,13 +1,13 @@
-# Copyright 2020 The gRPC Authors
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
+# Copyright 2020 The gRPC Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/status/grpc_status_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/status/grpc_status_test.py
index 61c446bf0e3..980cf5a67e7 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/status/grpc_status_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/status/grpc_status_test.py
@@ -1,175 +1,175 @@
-# Copyright 2020 The gRPC Authors
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-"""Tests of grpc_status with gRPC AsyncIO stack."""
-
-import logging
-import traceback
-import unittest
-
-import grpc
-from google.protobuf import any_pb2
-from google.rpc import code_pb2, error_details_pb2, status_pb2
-from grpc.experimental import aio
-
-from grpc_status import rpc_status
-from tests_aio.unit._test_base import AioTestBase
-
-_STATUS_OK = '/test/StatusOK'
-_STATUS_NOT_OK = '/test/StatusNotOk'
-_ERROR_DETAILS = '/test/ErrorDetails'
-_INCONSISTENT = '/test/Inconsistent'
-_INVALID_CODE = '/test/InvalidCode'
-
-_REQUEST = b'\x00\x00\x00'
-_RESPONSE = b'\x01\x01\x01'
-
-_GRPC_DETAILS_METADATA_KEY = 'grpc-status-details-bin'
-
-_STATUS_DETAILS = 'This is an error detail'
-_STATUS_DETAILS_ANOTHER = 'This is another error detail'
-
-
-async def _ok_unary_unary(request, servicer_context):
- return _RESPONSE
-
-
-async def _not_ok_unary_unary(request, servicer_context):
- await servicer_context.abort(grpc.StatusCode.INTERNAL, _STATUS_DETAILS)
-
-
-async def _error_details_unary_unary(request, servicer_context):
- details = any_pb2.Any()
- details.Pack(
- error_details_pb2.DebugInfo(stack_entries=traceback.format_stack(),
- detail='Intentionally invoked'))
- rich_status = status_pb2.Status(
- code=code_pb2.INTERNAL,
- message=_STATUS_DETAILS,
- details=[details],
- )
- await servicer_context.abort_with_status(rpc_status.to_status(rich_status))
-
-
-async def _inconsistent_unary_unary(request, servicer_context):
- rich_status = status_pb2.Status(
- code=code_pb2.INTERNAL,
- message=_STATUS_DETAILS,
- )
- servicer_context.set_code(grpc.StatusCode.NOT_FOUND)
- servicer_context.set_details(_STATUS_DETAILS_ANOTHER)
- # User put inconsistent status information in trailing metadata
- servicer_context.set_trailing_metadata(
- ((_GRPC_DETAILS_METADATA_KEY, rich_status.SerializeToString()),))
-
-
-async def _invalid_code_unary_unary(request, servicer_context):
- rich_status = status_pb2.Status(
- code=42,
- message='Invalid code',
- )
- await servicer_context.abort_with_status(rpc_status.to_status(rich_status))
-
-
-class _GenericHandler(grpc.GenericRpcHandler):
-
- def service(self, handler_call_details):
- if handler_call_details.method == _STATUS_OK:
- return grpc.unary_unary_rpc_method_handler(_ok_unary_unary)
- elif handler_call_details.method == _STATUS_NOT_OK:
- return grpc.unary_unary_rpc_method_handler(_not_ok_unary_unary)
- elif handler_call_details.method == _ERROR_DETAILS:
- return grpc.unary_unary_rpc_method_handler(
- _error_details_unary_unary)
- elif handler_call_details.method == _INCONSISTENT:
- return grpc.unary_unary_rpc_method_handler(
- _inconsistent_unary_unary)
- elif handler_call_details.method == _INVALID_CODE:
- return grpc.unary_unary_rpc_method_handler(
- _invalid_code_unary_unary)
- else:
- return None
-
-
-class StatusTest(AioTestBase):
-
- async def setUp(self):
- self._server = aio.server()
- self._server.add_generic_rpc_handlers((_GenericHandler(),))
- port = self._server.add_insecure_port('[::]:0')
- await self._server.start()
-
- self._channel = aio.insecure_channel('localhost:%d' % port)
-
- async def tearDown(self):
- await self._server.stop(None)
- await self._channel.close()
-
- async def test_status_ok(self):
- call = self._channel.unary_unary(_STATUS_OK)(_REQUEST)
-
- # Succeed RPC doesn't have status
- status = await rpc_status.aio.from_call(call)
- self.assertIs(status, None)
-
- async def test_status_not_ok(self):
- call = self._channel.unary_unary(_STATUS_NOT_OK)(_REQUEST)
- with self.assertRaises(aio.AioRpcError) as exception_context:
- await call
- rpc_error = exception_context.exception
-
- self.assertEqual(rpc_error.code(), grpc.StatusCode.INTERNAL)
- # Failed RPC doesn't automatically generate status
- status = await rpc_status.aio.from_call(call)
- self.assertIs(status, None)
-
- async def test_error_details(self):
- call = self._channel.unary_unary(_ERROR_DETAILS)(_REQUEST)
- with self.assertRaises(aio.AioRpcError) as exception_context:
- await call
- rpc_error = exception_context.exception
-
- status = await rpc_status.aio.from_call(call)
- self.assertEqual(rpc_error.code(), grpc.StatusCode.INTERNAL)
- self.assertEqual(status.code, code_pb2.Code.Value('INTERNAL'))
-
- # Check if the underlying proto message is intact
- self.assertTrue(status.details[0].Is(
- error_details_pb2.DebugInfo.DESCRIPTOR))
- info = error_details_pb2.DebugInfo()
- status.details[0].Unpack(info)
- self.assertIn('_error_details_unary_unary', info.stack_entries[-1])
-
- async def test_code_message_validation(self):
- call = self._channel.unary_unary(_INCONSISTENT)(_REQUEST)
- with self.assertRaises(aio.AioRpcError) as exception_context:
- await call
- rpc_error = exception_context.exception
- self.assertEqual(rpc_error.code(), grpc.StatusCode.NOT_FOUND)
-
- # Code/Message validation failed
- with self.assertRaises(ValueError):
- await rpc_status.aio.from_call(call)
-
- async def test_invalid_code(self):
- with self.assertRaises(aio.AioRpcError) as exception_context:
- await self._channel.unary_unary(_INVALID_CODE)(_REQUEST)
- rpc_error = exception_context.exception
- self.assertEqual(rpc_error.code(), grpc.StatusCode.UNKNOWN)
- # Invalid status code exception raised during coversion
- self.assertIn('Invalid status code', rpc_error.details())
-
-
-if __name__ == '__main__':
- logging.basicConfig()
- unittest.main(verbosity=2)
+# Copyright 2020 The gRPC Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+"""Tests of grpc_status with gRPC AsyncIO stack."""
+
+import logging
+import traceback
+import unittest
+
+import grpc
+from google.protobuf import any_pb2
+from google.rpc import code_pb2, error_details_pb2, status_pb2
+from grpc.experimental import aio
+
+from grpc_status import rpc_status
+from tests_aio.unit._test_base import AioTestBase
+
+_STATUS_OK = '/test/StatusOK'
+_STATUS_NOT_OK = '/test/StatusNotOk'
+_ERROR_DETAILS = '/test/ErrorDetails'
+_INCONSISTENT = '/test/Inconsistent'
+_INVALID_CODE = '/test/InvalidCode'
+
+_REQUEST = b'\x00\x00\x00'
+_RESPONSE = b'\x01\x01\x01'
+
+_GRPC_DETAILS_METADATA_KEY = 'grpc-status-details-bin'
+
+_STATUS_DETAILS = 'This is an error detail'
+_STATUS_DETAILS_ANOTHER = 'This is another error detail'
+
+
+async def _ok_unary_unary(request, servicer_context):
+ return _RESPONSE
+
+
+async def _not_ok_unary_unary(request, servicer_context):
+ await servicer_context.abort(grpc.StatusCode.INTERNAL, _STATUS_DETAILS)
+
+
+async def _error_details_unary_unary(request, servicer_context):
+ details = any_pb2.Any()
+ details.Pack(
+ error_details_pb2.DebugInfo(stack_entries=traceback.format_stack(),
+ detail='Intentionally invoked'))
+ rich_status = status_pb2.Status(
+ code=code_pb2.INTERNAL,
+ message=_STATUS_DETAILS,
+ details=[details],
+ )
+ await servicer_context.abort_with_status(rpc_status.to_status(rich_status))
+
+
+async def _inconsistent_unary_unary(request, servicer_context):
+ rich_status = status_pb2.Status(
+ code=code_pb2.INTERNAL,
+ message=_STATUS_DETAILS,
+ )
+ servicer_context.set_code(grpc.StatusCode.NOT_FOUND)
+ servicer_context.set_details(_STATUS_DETAILS_ANOTHER)
+ # User put inconsistent status information in trailing metadata
+ servicer_context.set_trailing_metadata(
+ ((_GRPC_DETAILS_METADATA_KEY, rich_status.SerializeToString()),))
+
+
+async def _invalid_code_unary_unary(request, servicer_context):
+ rich_status = status_pb2.Status(
+ code=42,
+ message='Invalid code',
+ )
+ await servicer_context.abort_with_status(rpc_status.to_status(rich_status))
+
+
+class _GenericHandler(grpc.GenericRpcHandler):
+
+ def service(self, handler_call_details):
+ if handler_call_details.method == _STATUS_OK:
+ return grpc.unary_unary_rpc_method_handler(_ok_unary_unary)
+ elif handler_call_details.method == _STATUS_NOT_OK:
+ return grpc.unary_unary_rpc_method_handler(_not_ok_unary_unary)
+ elif handler_call_details.method == _ERROR_DETAILS:
+ return grpc.unary_unary_rpc_method_handler(
+ _error_details_unary_unary)
+ elif handler_call_details.method == _INCONSISTENT:
+ return grpc.unary_unary_rpc_method_handler(
+ _inconsistent_unary_unary)
+ elif handler_call_details.method == _INVALID_CODE:
+ return grpc.unary_unary_rpc_method_handler(
+ _invalid_code_unary_unary)
+ else:
+ return None
+
+
+class StatusTest(AioTestBase):
+
+ async def setUp(self):
+ self._server = aio.server()
+ self._server.add_generic_rpc_handlers((_GenericHandler(),))
+ port = self._server.add_insecure_port('[::]:0')
+ await self._server.start()
+
+ self._channel = aio.insecure_channel('localhost:%d' % port)
+
+ async def tearDown(self):
+ await self._server.stop(None)
+ await self._channel.close()
+
+ async def test_status_ok(self):
+ call = self._channel.unary_unary(_STATUS_OK)(_REQUEST)
+
+ # Succeed RPC doesn't have status
+ status = await rpc_status.aio.from_call(call)
+ self.assertIs(status, None)
+
+ async def test_status_not_ok(self):
+ call = self._channel.unary_unary(_STATUS_NOT_OK)(_REQUEST)
+ with self.assertRaises(aio.AioRpcError) as exception_context:
+ await call
+ rpc_error = exception_context.exception
+
+ self.assertEqual(rpc_error.code(), grpc.StatusCode.INTERNAL)
+ # Failed RPC doesn't automatically generate status
+ status = await rpc_status.aio.from_call(call)
+ self.assertIs(status, None)
+
+ async def test_error_details(self):
+ call = self._channel.unary_unary(_ERROR_DETAILS)(_REQUEST)
+ with self.assertRaises(aio.AioRpcError) as exception_context:
+ await call
+ rpc_error = exception_context.exception
+
+ status = await rpc_status.aio.from_call(call)
+ self.assertEqual(rpc_error.code(), grpc.StatusCode.INTERNAL)
+ self.assertEqual(status.code, code_pb2.Code.Value('INTERNAL'))
+
+ # Check if the underlying proto message is intact
+ self.assertTrue(status.details[0].Is(
+ error_details_pb2.DebugInfo.DESCRIPTOR))
+ info = error_details_pb2.DebugInfo()
+ status.details[0].Unpack(info)
+ self.assertIn('_error_details_unary_unary', info.stack_entries[-1])
+
+ async def test_code_message_validation(self):
+ call = self._channel.unary_unary(_INCONSISTENT)(_REQUEST)
+ with self.assertRaises(aio.AioRpcError) as exception_context:
+ await call
+ rpc_error = exception_context.exception
+ self.assertEqual(rpc_error.code(), grpc.StatusCode.NOT_FOUND)
+
+ # Code/Message validation failed
+ with self.assertRaises(ValueError):
+ await rpc_status.aio.from_call(call)
+
+ async def test_invalid_code(self):
+ with self.assertRaises(aio.AioRpcError) as exception_context:
+ await self._channel.unary_unary(_INVALID_CODE)(_REQUEST)
+ rpc_error = exception_context.exception
+ self.assertEqual(rpc_error.code(), grpc.StatusCode.UNKNOWN)
+ # Invalid status code exception raised during coversion
+ self.assertIn('Invalid status code', rpc_error.details())
+
+
+if __name__ == '__main__':
+ logging.basicConfig()
+ unittest.main(verbosity=2)
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/_common.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/_common.py
index 6156aa98dc3..016280a1528 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/_common.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/_common.py
@@ -1,99 +1,99 @@
-# Copyright 2020 The gRPC Authors
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-import asyncio
-import grpc
-from typing import AsyncIterable
-from grpc.experimental import aio
-from grpc.aio._typing import MetadatumType, MetadataKey, MetadataValue
-from grpc.aio._metadata import Metadata
-
-from tests.unit.framework.common import test_constants
-
-
-def seen_metadata(expected: Metadata, actual: Metadata):
- return not bool(set(tuple(expected)) - set(tuple(actual)))
-
-
-def seen_metadatum(expected_key: MetadataKey, expected_value: MetadataValue,
- actual: Metadata) -> bool:
- obtained = actual[expected_key]
- return obtained == expected_value
-
-
-async def block_until_certain_state(channel: aio.Channel,
- expected_state: grpc.ChannelConnectivity):
- state = channel.get_state()
- while state != expected_state:
- await channel.wait_for_state_change(state)
- state = channel.get_state()
-
-
-def inject_callbacks(call: aio.Call):
- first_callback_ran = asyncio.Event()
-
- def first_callback(call):
- # Validate that all resopnses have been received
- # and the call is an end state.
- assert call.done()
- first_callback_ran.set()
-
- second_callback_ran = asyncio.Event()
-
- def second_callback(call):
- # Validate that all responses have been received
- # and the call is an end state.
- assert call.done()
- second_callback_ran.set()
-
- call.add_done_callback(first_callback)
- call.add_done_callback(second_callback)
-
- async def validation():
- await asyncio.wait_for(
- asyncio.gather(first_callback_ran.wait(),
- second_callback_ran.wait()),
- test_constants.SHORT_TIMEOUT)
-
- return validation()
-
-
-class CountingRequestIterator:
-
- def __init__(self, request_iterator):
- self.request_cnt = 0
- self._request_iterator = request_iterator
-
- async def _forward_requests(self):
- async for request in self._request_iterator:
- self.request_cnt += 1
- yield request
-
- def __aiter__(self):
- return self._forward_requests()
-
-
-class CountingResponseIterator:
-
- def __init__(self, response_iterator):
- self.response_cnt = 0
- self._response_iterator = response_iterator
-
- async def _forward_responses(self):
- async for response in self._response_iterator:
- self.response_cnt += 1
- yield response
-
- def __aiter__(self):
- return self._forward_responses()
+# Copyright 2020 The gRPC Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import asyncio
+import grpc
+from typing import AsyncIterable
+from grpc.experimental import aio
+from grpc.aio._typing import MetadatumType, MetadataKey, MetadataValue
+from grpc.aio._metadata import Metadata
+
+from tests.unit.framework.common import test_constants
+
+
+def seen_metadata(expected: Metadata, actual: Metadata):
+ return not bool(set(tuple(expected)) - set(tuple(actual)))
+
+
+def seen_metadatum(expected_key: MetadataKey, expected_value: MetadataValue,
+ actual: Metadata) -> bool:
+ obtained = actual[expected_key]
+ return obtained == expected_value
+
+
+async def block_until_certain_state(channel: aio.Channel,
+ expected_state: grpc.ChannelConnectivity):
+ state = channel.get_state()
+ while state != expected_state:
+ await channel.wait_for_state_change(state)
+ state = channel.get_state()
+
+
+def inject_callbacks(call: aio.Call):
+ first_callback_ran = asyncio.Event()
+
+ def first_callback(call):
+ # Validate that all resopnses have been received
+ # and the call is an end state.
+ assert call.done()
+ first_callback_ran.set()
+
+ second_callback_ran = asyncio.Event()
+
+ def second_callback(call):
+ # Validate that all responses have been received
+ # and the call is an end state.
+ assert call.done()
+ second_callback_ran.set()
+
+ call.add_done_callback(first_callback)
+ call.add_done_callback(second_callback)
+
+ async def validation():
+ await asyncio.wait_for(
+ asyncio.gather(first_callback_ran.wait(),
+ second_callback_ran.wait()),
+ test_constants.SHORT_TIMEOUT)
+
+ return validation()
+
+
+class CountingRequestIterator:
+
+ def __init__(self, request_iterator):
+ self.request_cnt = 0
+ self._request_iterator = request_iterator
+
+ async def _forward_requests(self):
+ async for request in self._request_iterator:
+ self.request_cnt += 1
+ yield request
+
+ def __aiter__(self):
+ return self._forward_requests()
+
+
+class CountingResponseIterator:
+
+ def __init__(self, response_iterator):
+ self.response_cnt = 0
+ self._response_iterator = response_iterator
+
+ async def _forward_responses(self):
+ async for response in self._response_iterator:
+ self.response_cnt += 1
+ yield response
+
+ def __aiter__(self):
+ return self._forward_responses()
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/_constants.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/_constants.py
index aed61466d08..986a6f9d842 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/_constants.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/_constants.py
@@ -1,16 +1,16 @@
-# Copyright 2020 The gRPC Authors
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-UNREACHABLE_TARGET = '0.0.0.1:1111'
-UNARY_CALL_WITH_SLEEP_VALUE = 0.2
+# Copyright 2020 The gRPC Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+UNREACHABLE_TARGET = '0.0.0.1:1111'
+UNARY_CALL_WITH_SLEEP_VALUE = 0.2
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/_metadata_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/_metadata_test.py
index 023613ece13..c0594cb06ab 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/_metadata_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/_metadata_test.py
@@ -1,137 +1,137 @@
-# Copyright 2020 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-"""Tests for the metadata abstraction that's used in the asynchronous driver."""
-import logging
-import unittest
-
-from grpc.experimental.aio import Metadata
-
-
-class TestTypeMetadata(unittest.TestCase):
- """Tests for the metadata type"""
-
- _DEFAULT_DATA = (("key1", "value1"), ("key2", "value2"))
- _MULTI_ENTRY_DATA = (("key1", "value1"), ("key1", "other value 1"),
- ("key2", "value2"))
-
- def test_init_metadata(self):
- test_cases = {
- "emtpy": (),
- "with-single-data": self._DEFAULT_DATA,
- "with-multi-data": self._MULTI_ENTRY_DATA,
- }
- for case, args in test_cases.items():
- with self.subTest(case=case):
- metadata = Metadata(*args)
- self.assertEqual(len(metadata), len(args))
-
- def test_get_item(self):
- metadata = Metadata(("key", "value1"), ("key", "value2"),
- ("key2", "other value"))
- self.assertEqual(metadata["key"], "value1")
- self.assertEqual(metadata["key2"], "other value")
- self.assertEqual(metadata.get("key"), "value1")
- self.assertEqual(metadata.get("key2"), "other value")
-
- with self.assertRaises(KeyError):
- metadata["key not found"]
- self.assertIsNone(metadata.get("key not found"))
-
- def test_add_value(self):
- metadata = Metadata()
- metadata.add("key", "value")
- metadata.add("key", "second value")
- metadata.add("key2", "value2")
-
- self.assertEqual(metadata["key"], "value")
- self.assertEqual(metadata["key2"], "value2")
-
- def test_get_all_items(self):
- metadata = Metadata(*self._MULTI_ENTRY_DATA)
- self.assertEqual(metadata.get_all("key1"), ["value1", "other value 1"])
- self.assertEqual(metadata.get_all("key2"), ["value2"])
- self.assertEqual(metadata.get_all("non existing key"), [])
-
- def test_container(self):
- metadata = Metadata(*self._MULTI_ENTRY_DATA)
- self.assertIn("key1", metadata)
-
- def test_equals(self):
- metadata = Metadata()
- for key, value in self._DEFAULT_DATA:
- metadata.add(key, value)
- metadata2 = Metadata(*self._DEFAULT_DATA)
-
- self.assertEqual(metadata, metadata2)
- self.assertNotEqual(metadata, "foo")
-
- def test_repr(self):
- metadata = Metadata(*self._DEFAULT_DATA)
- expected = "Metadata({0!r})".format(self._DEFAULT_DATA)
- self.assertEqual(repr(metadata), expected)
-
- def test_set(self):
- metadata = Metadata(*self._MULTI_ENTRY_DATA)
- override_value = "override value"
- for _ in range(3):
- metadata["key1"] = override_value
-
- self.assertEqual(metadata["key1"], override_value)
- self.assertEqual(metadata.get_all("key1"),
- [override_value, "other value 1"])
-
- empty_metadata = Metadata()
- for _ in range(3):
- empty_metadata["key"] = override_value
-
- self.assertEqual(empty_metadata["key"], override_value)
- self.assertEqual(empty_metadata.get_all("key"), [override_value])
-
- def test_set_all(self):
- metadata = Metadata(*self._DEFAULT_DATA)
- metadata.set_all("key", ["value1", b"new value 2"])
-
- self.assertEqual(metadata["key"], "value1")
- self.assertEqual(metadata.get_all("key"), ["value1", b"new value 2"])
-
- def test_delete_values(self):
- metadata = Metadata(*self._MULTI_ENTRY_DATA)
- del metadata["key1"]
- self.assertEqual(metadata.get("key1"), "other value 1")
-
- metadata.delete_all("key1")
- self.assertNotIn("key1", metadata)
-
- metadata.delete_all("key2")
- self.assertEqual(len(metadata), 0)
-
- with self.assertRaises(KeyError):
- del metadata["other key"]
-
- def test_metadata_from_tuple(self):
- scenarios = (
- (None, Metadata()),
- (Metadata(), Metadata()),
- (self._DEFAULT_DATA, Metadata(*self._DEFAULT_DATA)),
- (self._MULTI_ENTRY_DATA, Metadata(*self._MULTI_ENTRY_DATA)),
- (Metadata(*self._DEFAULT_DATA), Metadata(*self._DEFAULT_DATA)),
- )
- for source, expected in scenarios:
- with self.subTest(raw_metadata=source, expected=expected):
- self.assertEqual(expected, Metadata.from_tuple(source))
-
-
-if __name__ == '__main__':
- logging.basicConfig()
- unittest.main(verbosity=2)
+# Copyright 2020 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+"""Tests for the metadata abstraction that's used in the asynchronous driver."""
+import logging
+import unittest
+
+from grpc.experimental.aio import Metadata
+
+
+class TestTypeMetadata(unittest.TestCase):
+ """Tests for the metadata type"""
+
+ _DEFAULT_DATA = (("key1", "value1"), ("key2", "value2"))
+ _MULTI_ENTRY_DATA = (("key1", "value1"), ("key1", "other value 1"),
+ ("key2", "value2"))
+
+ def test_init_metadata(self):
+ test_cases = {
+ "emtpy": (),
+ "with-single-data": self._DEFAULT_DATA,
+ "with-multi-data": self._MULTI_ENTRY_DATA,
+ }
+ for case, args in test_cases.items():
+ with self.subTest(case=case):
+ metadata = Metadata(*args)
+ self.assertEqual(len(metadata), len(args))
+
+ def test_get_item(self):
+ metadata = Metadata(("key", "value1"), ("key", "value2"),
+ ("key2", "other value"))
+ self.assertEqual(metadata["key"], "value1")
+ self.assertEqual(metadata["key2"], "other value")
+ self.assertEqual(metadata.get("key"), "value1")
+ self.assertEqual(metadata.get("key2"), "other value")
+
+ with self.assertRaises(KeyError):
+ metadata["key not found"]
+ self.assertIsNone(metadata.get("key not found"))
+
+ def test_add_value(self):
+ metadata = Metadata()
+ metadata.add("key", "value")
+ metadata.add("key", "second value")
+ metadata.add("key2", "value2")
+
+ self.assertEqual(metadata["key"], "value")
+ self.assertEqual(metadata["key2"], "value2")
+
+ def test_get_all_items(self):
+ metadata = Metadata(*self._MULTI_ENTRY_DATA)
+ self.assertEqual(metadata.get_all("key1"), ["value1", "other value 1"])
+ self.assertEqual(metadata.get_all("key2"), ["value2"])
+ self.assertEqual(metadata.get_all("non existing key"), [])
+
+ def test_container(self):
+ metadata = Metadata(*self._MULTI_ENTRY_DATA)
+ self.assertIn("key1", metadata)
+
+ def test_equals(self):
+ metadata = Metadata()
+ for key, value in self._DEFAULT_DATA:
+ metadata.add(key, value)
+ metadata2 = Metadata(*self._DEFAULT_DATA)
+
+ self.assertEqual(metadata, metadata2)
+ self.assertNotEqual(metadata, "foo")
+
+ def test_repr(self):
+ metadata = Metadata(*self._DEFAULT_DATA)
+ expected = "Metadata({0!r})".format(self._DEFAULT_DATA)
+ self.assertEqual(repr(metadata), expected)
+
+ def test_set(self):
+ metadata = Metadata(*self._MULTI_ENTRY_DATA)
+ override_value = "override value"
+ for _ in range(3):
+ metadata["key1"] = override_value
+
+ self.assertEqual(metadata["key1"], override_value)
+ self.assertEqual(metadata.get_all("key1"),
+ [override_value, "other value 1"])
+
+ empty_metadata = Metadata()
+ for _ in range(3):
+ empty_metadata["key"] = override_value
+
+ self.assertEqual(empty_metadata["key"], override_value)
+ self.assertEqual(empty_metadata.get_all("key"), [override_value])
+
+ def test_set_all(self):
+ metadata = Metadata(*self._DEFAULT_DATA)
+ metadata.set_all("key", ["value1", b"new value 2"])
+
+ self.assertEqual(metadata["key"], "value1")
+ self.assertEqual(metadata.get_all("key"), ["value1", b"new value 2"])
+
+ def test_delete_values(self):
+ metadata = Metadata(*self._MULTI_ENTRY_DATA)
+ del metadata["key1"]
+ self.assertEqual(metadata.get("key1"), "other value 1")
+
+ metadata.delete_all("key1")
+ self.assertNotIn("key1", metadata)
+
+ metadata.delete_all("key2")
+ self.assertEqual(len(metadata), 0)
+
+ with self.assertRaises(KeyError):
+ del metadata["other key"]
+
+ def test_metadata_from_tuple(self):
+ scenarios = (
+ (None, Metadata()),
+ (Metadata(), Metadata()),
+ (self._DEFAULT_DATA, Metadata(*self._DEFAULT_DATA)),
+ (self._MULTI_ENTRY_DATA, Metadata(*self._MULTI_ENTRY_DATA)),
+ (Metadata(*self._DEFAULT_DATA), Metadata(*self._DEFAULT_DATA)),
+ )
+ for source, expected in scenarios:
+ with self.subTest(raw_metadata=source, expected=expected):
+ self.assertEqual(expected, Metadata.from_tuple(source))
+
+
+if __name__ == '__main__':
+ logging.basicConfig()
+ unittest.main(verbosity=2)
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/_test_base.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/_test_base.py
index 3011d9f8698..ec5f2112da0 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/_test_base.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/_test_base.py
@@ -12,55 +12,55 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-import logging
-import functools
+import logging
+import functools
import asyncio
-from typing import Callable
+from typing import Callable
import unittest
from grpc.experimental import aio
-__all__ = 'AioTestBase'
+__all__ = 'AioTestBase'
-_COROUTINE_FUNCTION_ALLOWLIST = ['setUp', 'tearDown']
-
-
-def _async_to_sync_decorator(f: Callable, loop: asyncio.AbstractEventLoop):
-
- @functools.wraps(f)
- def wrapper(*args, **kwargs):
- return loop.run_until_complete(f(*args, **kwargs))
-
- return wrapper
-
-
-def _get_default_loop(debug=True):
- try:
- loop = asyncio.get_event_loop()
- except:
- loop = asyncio.new_event_loop()
- asyncio.set_event_loop(loop)
- finally:
- loop.set_debug(debug)
- return loop
-
-
-# NOTE(gnossen) this test class can also be implemented with metaclass.
+_COROUTINE_FUNCTION_ALLOWLIST = ['setUp', 'tearDown']
+
+
+def _async_to_sync_decorator(f: Callable, loop: asyncio.AbstractEventLoop):
+
+ @functools.wraps(f)
+ def wrapper(*args, **kwargs):
+ return loop.run_until_complete(f(*args, **kwargs))
+
+ return wrapper
+
+
+def _get_default_loop(debug=True):
+ try:
+ loop = asyncio.get_event_loop()
+ except:
+ loop = asyncio.new_event_loop()
+ asyncio.set_event_loop(loop)
+ finally:
+ loop.set_debug(debug)
+ return loop
+
+
+# NOTE(gnossen) this test class can also be implemented with metaclass.
class AioTestBase(unittest.TestCase):
- # NOTE(lidi) We need to pick a loop for entire testing phase, otherwise it
- # will trigger create new loops in new threads, leads to deadlock.
- _TEST_LOOP = _get_default_loop()
+ # NOTE(lidi) We need to pick a loop for entire testing phase, otherwise it
+ # will trigger create new loops in new threads, leads to deadlock.
+ _TEST_LOOP = _get_default_loop()
@property
def loop(self):
- return self._TEST_LOOP
-
- def __getattribute__(self, name):
- """Overrides the loading logic to support coroutine functions."""
- attr = super().__getattribute__(name)
-
- # If possible, converts the coroutine into a sync function.
- if name.startswith('test_') or name in _COROUTINE_FUNCTION_ALLOWLIST:
- if asyncio.iscoroutinefunction(attr):
- return _async_to_sync_decorator(attr, self._TEST_LOOP)
- # For other attributes, let them pass.
- return attr
+ return self._TEST_LOOP
+
+ def __getattribute__(self, name):
+ """Overrides the loading logic to support coroutine functions."""
+ attr = super().__getattribute__(name)
+
+ # If possible, converts the coroutine into a sync function.
+ if name.startswith('test_') or name in _COROUTINE_FUNCTION_ALLOWLIST:
+ if asyncio.iscoroutinefunction(attr):
+ return _async_to_sync_decorator(attr, self._TEST_LOOP)
+ # For other attributes, let them pass.
+ return attr
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/_test_server.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/_test_server.py
index cc68739d11c..5e5081a38d0 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/_test_server.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/_test_server.py
@@ -12,132 +12,132 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-import asyncio
-import datetime
+import asyncio
+import datetime
-import grpc
+import grpc
from grpc.experimental import aio
-from tests.unit import resources
-
-from src.proto.grpc.testing import empty_pb2, messages_pb2, test_pb2_grpc
-from tests_aio.unit import _constants
-
-_INITIAL_METADATA_KEY = "x-grpc-test-echo-initial"
-_TRAILING_METADATA_KEY = "x-grpc-test-echo-trailing-bin"
-
-
-async def _maybe_echo_metadata(servicer_context):
- """Copies metadata from request to response if it is present."""
- invocation_metadata = dict(servicer_context.invocation_metadata())
- if _INITIAL_METADATA_KEY in invocation_metadata:
- initial_metadatum = (_INITIAL_METADATA_KEY,
- invocation_metadata[_INITIAL_METADATA_KEY])
- await servicer_context.send_initial_metadata((initial_metadatum,))
- if _TRAILING_METADATA_KEY in invocation_metadata:
- trailing_metadatum = (_TRAILING_METADATA_KEY,
- invocation_metadata[_TRAILING_METADATA_KEY])
- servicer_context.set_trailing_metadata((trailing_metadatum,))
-
-
-async def _maybe_echo_status(request: messages_pb2.SimpleRequest,
- servicer_context):
- """Echos the RPC status if demanded by the request."""
- if request.HasField('response_status'):
- await servicer_context.abort(request.response_status.code,
- request.response_status.message)
-
-
-class TestServiceServicer(test_pb2_grpc.TestServiceServicer):
-
- async def UnaryCall(self, request, context):
- await _maybe_echo_metadata(context)
- await _maybe_echo_status(request, context)
- return messages_pb2.SimpleResponse(
- payload=messages_pb2.Payload(type=messages_pb2.COMPRESSABLE,
- body=b'\x00' * request.response_size))
-
- async def EmptyCall(self, request, context):
- return empty_pb2.Empty()
-
- async def StreamingOutputCall(
- self, request: messages_pb2.StreamingOutputCallRequest,
- unused_context):
- for response_parameters in request.response_parameters:
- if response_parameters.interval_us != 0:
- await asyncio.sleep(
- datetime.timedelta(microseconds=response_parameters.
- interval_us).total_seconds())
- yield messages_pb2.StreamingOutputCallResponse(
- payload=messages_pb2.Payload(type=request.response_type,
- body=b'\x00' *
- response_parameters.size))
-
- # Next methods are extra ones that are registred programatically
- # when the sever is instantiated. They are not being provided by
- # the proto file.
- async def UnaryCallWithSleep(self, unused_request, unused_context):
- await asyncio.sleep(_constants.UNARY_CALL_WITH_SLEEP_VALUE)
- return messages_pb2.SimpleResponse()
-
- async def StreamingInputCall(self, request_async_iterator, unused_context):
- aggregate_size = 0
- async for request in request_async_iterator:
- if request.payload is not None and request.payload.body:
- aggregate_size += len(request.payload.body)
- return messages_pb2.StreamingInputCallResponse(
- aggregated_payload_size=aggregate_size)
-
- async def FullDuplexCall(self, request_async_iterator, context):
- await _maybe_echo_metadata(context)
- async for request in request_async_iterator:
- await _maybe_echo_status(request, context)
- for response_parameters in request.response_parameters:
- if response_parameters.interval_us != 0:
- await asyncio.sleep(
- datetime.timedelta(microseconds=response_parameters.
- interval_us).total_seconds())
- yield messages_pb2.StreamingOutputCallResponse(
- payload=messages_pb2.Payload(type=request.payload.type,
- body=b'\x00' *
- response_parameters.size))
-
-
-def _create_extra_generic_handler(servicer: TestServiceServicer):
- # Add programatically extra methods not provided by the proto file
- # that are used during the tests
- rpc_method_handlers = {
- 'UnaryCallWithSleep':
- grpc.unary_unary_rpc_method_handler(
- servicer.UnaryCallWithSleep,
- request_deserializer=messages_pb2.SimpleRequest.FromString,
- response_serializer=messages_pb2.SimpleResponse.
- SerializeToString)
- }
- return grpc.method_handlers_generic_handler('grpc.testing.TestService',
- rpc_method_handlers)
-
-
-async def start_test_server(port=0,
- secure=False,
- server_credentials=None,
- interceptors=None):
- server = aio.server(options=(('grpc.so_reuseport', 0),),
- interceptors=interceptors)
- servicer = TestServiceServicer()
- test_pb2_grpc.add_TestServiceServicer_to_server(servicer, server)
-
- server.add_generic_rpc_handlers((_create_extra_generic_handler(servicer),))
-
- if secure:
- if server_credentials is None:
- server_credentials = grpc.ssl_server_credentials([
- (resources.private_key(), resources.certificate_chain())
- ])
- port = server.add_secure_port('[::]:%d' % port, server_credentials)
- else:
- port = server.add_insecure_port('[::]:%d' % port)
-
+from tests.unit import resources
+
+from src.proto.grpc.testing import empty_pb2, messages_pb2, test_pb2_grpc
+from tests_aio.unit import _constants
+
+_INITIAL_METADATA_KEY = "x-grpc-test-echo-initial"
+_TRAILING_METADATA_KEY = "x-grpc-test-echo-trailing-bin"
+
+
+async def _maybe_echo_metadata(servicer_context):
+ """Copies metadata from request to response if it is present."""
+ invocation_metadata = dict(servicer_context.invocation_metadata())
+ if _INITIAL_METADATA_KEY in invocation_metadata:
+ initial_metadatum = (_INITIAL_METADATA_KEY,
+ invocation_metadata[_INITIAL_METADATA_KEY])
+ await servicer_context.send_initial_metadata((initial_metadatum,))
+ if _TRAILING_METADATA_KEY in invocation_metadata:
+ trailing_metadatum = (_TRAILING_METADATA_KEY,
+ invocation_metadata[_TRAILING_METADATA_KEY])
+ servicer_context.set_trailing_metadata((trailing_metadatum,))
+
+
+async def _maybe_echo_status(request: messages_pb2.SimpleRequest,
+ servicer_context):
+ """Echos the RPC status if demanded by the request."""
+ if request.HasField('response_status'):
+ await servicer_context.abort(request.response_status.code,
+ request.response_status.message)
+
+
+class TestServiceServicer(test_pb2_grpc.TestServiceServicer):
+
+ async def UnaryCall(self, request, context):
+ await _maybe_echo_metadata(context)
+ await _maybe_echo_status(request, context)
+ return messages_pb2.SimpleResponse(
+ payload=messages_pb2.Payload(type=messages_pb2.COMPRESSABLE,
+ body=b'\x00' * request.response_size))
+
+ async def EmptyCall(self, request, context):
+ return empty_pb2.Empty()
+
+ async def StreamingOutputCall(
+ self, request: messages_pb2.StreamingOutputCallRequest,
+ unused_context):
+ for response_parameters in request.response_parameters:
+ if response_parameters.interval_us != 0:
+ await asyncio.sleep(
+ datetime.timedelta(microseconds=response_parameters.
+ interval_us).total_seconds())
+ yield messages_pb2.StreamingOutputCallResponse(
+ payload=messages_pb2.Payload(type=request.response_type,
+ body=b'\x00' *
+ response_parameters.size))
+
+ # Next methods are extra ones that are registred programatically
+ # when the sever is instantiated. They are not being provided by
+ # the proto file.
+ async def UnaryCallWithSleep(self, unused_request, unused_context):
+ await asyncio.sleep(_constants.UNARY_CALL_WITH_SLEEP_VALUE)
+ return messages_pb2.SimpleResponse()
+
+ async def StreamingInputCall(self, request_async_iterator, unused_context):
+ aggregate_size = 0
+ async for request in request_async_iterator:
+ if request.payload is not None and request.payload.body:
+ aggregate_size += len(request.payload.body)
+ return messages_pb2.StreamingInputCallResponse(
+ aggregated_payload_size=aggregate_size)
+
+ async def FullDuplexCall(self, request_async_iterator, context):
+ await _maybe_echo_metadata(context)
+ async for request in request_async_iterator:
+ await _maybe_echo_status(request, context)
+ for response_parameters in request.response_parameters:
+ if response_parameters.interval_us != 0:
+ await asyncio.sleep(
+ datetime.timedelta(microseconds=response_parameters.
+ interval_us).total_seconds())
+ yield messages_pb2.StreamingOutputCallResponse(
+ payload=messages_pb2.Payload(type=request.payload.type,
+ body=b'\x00' *
+ response_parameters.size))
+
+
+def _create_extra_generic_handler(servicer: TestServiceServicer):
+ # Add programatically extra methods not provided by the proto file
+ # that are used during the tests
+ rpc_method_handlers = {
+ 'UnaryCallWithSleep':
+ grpc.unary_unary_rpc_method_handler(
+ servicer.UnaryCallWithSleep,
+ request_deserializer=messages_pb2.SimpleRequest.FromString,
+ response_serializer=messages_pb2.SimpleResponse.
+ SerializeToString)
+ }
+ return grpc.method_handlers_generic_handler('grpc.testing.TestService',
+ rpc_method_handlers)
+
+
+async def start_test_server(port=0,
+ secure=False,
+ server_credentials=None,
+ interceptors=None):
+ server = aio.server(options=(('grpc.so_reuseport', 0),),
+ interceptors=interceptors)
+ servicer = TestServiceServicer()
+ test_pb2_grpc.add_TestServiceServicer_to_server(servicer, server)
+
+ server.add_generic_rpc_handlers((_create_extra_generic_handler(servicer),))
+
+ if secure:
+ if server_credentials is None:
+ server_credentials = grpc.ssl_server_credentials([
+ (resources.private_key(), resources.certificate_chain())
+ ])
+ port = server.add_secure_port('[::]:%d' % port, server_credentials)
+ else:
+ port = server.add_insecure_port('[::]:%d' % port)
+
await server.start()
-
+
# NOTE(lidizheng) returning the server to prevent it from deallocation
return 'localhost:%d' % port, server
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/abort_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/abort_test.py
index 3bc5c474cbd..828b6884dfa 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/abort_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/abort_test.py
@@ -1,151 +1,151 @@
-# Copyright 2019 The gRPC Authors
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-import asyncio
-import logging
-import unittest
-import time
-import gc
-
-import grpc
-from grpc.experimental import aio
-from tests_aio.unit._test_base import AioTestBase
-from tests.unit.framework.common import test_constants
-
-_UNARY_UNARY_ABORT = '/test/UnaryUnaryAbort'
-_SUPPRESS_ABORT = '/test/SuppressAbort'
-_REPLACE_ABORT = '/test/ReplaceAbort'
-_ABORT_AFTER_REPLY = '/test/AbortAfterReply'
-
-_REQUEST = b'\x00\x00\x00'
-_RESPONSE = b'\x01\x01\x01'
-_NUM_STREAM_RESPONSES = 5
-
-_ABORT_CODE = grpc.StatusCode.RESOURCE_EXHAUSTED
-_ABORT_DETAILS = 'Dummy error details'
-
-
-class _GenericHandler(grpc.GenericRpcHandler):
-
- @staticmethod
- async def _unary_unary_abort(unused_request, context):
- await context.abort(_ABORT_CODE, _ABORT_DETAILS)
- raise RuntimeError('This line should not be executed')
-
- @staticmethod
- async def _suppress_abort(unused_request, context):
- try:
- await context.abort(_ABORT_CODE, _ABORT_DETAILS)
- except aio.AbortError as e:
- pass
- return _RESPONSE
-
- @staticmethod
- async def _replace_abort(unused_request, context):
- try:
- await context.abort(_ABORT_CODE, _ABORT_DETAILS)
- except aio.AbortError as e:
- await context.abort(grpc.StatusCode.INVALID_ARGUMENT,
- 'Override abort!')
-
- @staticmethod
- async def _abort_after_reply(unused_request, context):
- yield _RESPONSE
- await context.abort(_ABORT_CODE, _ABORT_DETAILS)
- raise RuntimeError('This line should not be executed')
-
- def service(self, handler_details):
- if handler_details.method == _UNARY_UNARY_ABORT:
- return grpc.unary_unary_rpc_method_handler(self._unary_unary_abort)
- if handler_details.method == _SUPPRESS_ABORT:
- return grpc.unary_unary_rpc_method_handler(self._suppress_abort)
- if handler_details.method == _REPLACE_ABORT:
- return grpc.unary_unary_rpc_method_handler(self._replace_abort)
- if handler_details.method == _ABORT_AFTER_REPLY:
- return grpc.unary_stream_rpc_method_handler(self._abort_after_reply)
-
-
-async def _start_test_server():
- server = aio.server()
- port = server.add_insecure_port('[::]:0')
- server.add_generic_rpc_handlers((_GenericHandler(),))
- await server.start()
- return 'localhost:%d' % port, server
-
-
-class TestAbort(AioTestBase):
-
- async def setUp(self):
- address, self._server = await _start_test_server()
- self._channel = aio.insecure_channel(address)
-
- async def tearDown(self):
- await self._channel.close()
- await self._server.stop(None)
-
- async def test_unary_unary_abort(self):
- method = self._channel.unary_unary(_UNARY_UNARY_ABORT)
- call = method(_REQUEST)
-
- self.assertEqual(_ABORT_CODE, await call.code())
- self.assertEqual(_ABORT_DETAILS, await call.details())
-
- with self.assertRaises(aio.AioRpcError) as exception_context:
- await call
-
- rpc_error = exception_context.exception
- self.assertEqual(_ABORT_CODE, rpc_error.code())
- self.assertEqual(_ABORT_DETAILS, rpc_error.details())
-
- async def test_suppress_abort(self):
- method = self._channel.unary_unary(_SUPPRESS_ABORT)
- call = method(_REQUEST)
-
- with self.assertRaises(aio.AioRpcError) as exception_context:
- await call
-
- rpc_error = exception_context.exception
- self.assertEqual(_ABORT_CODE, rpc_error.code())
- self.assertEqual(_ABORT_DETAILS, rpc_error.details())
-
- async def test_replace_abort(self):
- method = self._channel.unary_unary(_REPLACE_ABORT)
- call = method(_REQUEST)
-
- with self.assertRaises(aio.AioRpcError) as exception_context:
- await call
-
- rpc_error = exception_context.exception
- self.assertEqual(_ABORT_CODE, rpc_error.code())
- self.assertEqual(_ABORT_DETAILS, rpc_error.details())
-
- async def test_abort_after_reply(self):
- method = self._channel.unary_stream(_ABORT_AFTER_REPLY)
- call = method(_REQUEST)
-
- with self.assertRaises(aio.AioRpcError) as exception_context:
- await call.read()
- await call.read()
-
- rpc_error = exception_context.exception
- self.assertEqual(_ABORT_CODE, rpc_error.code())
- self.assertEqual(_ABORT_DETAILS, rpc_error.details())
-
- self.assertEqual(_ABORT_CODE, await call.code())
- self.assertEqual(_ABORT_DETAILS, await call.details())
-
-
-if __name__ == '__main__':
- logging.basicConfig(level=logging.DEBUG)
- unittest.main(verbosity=2)
+# Copyright 2019 The gRPC Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import asyncio
+import logging
+import unittest
+import time
+import gc
+
+import grpc
+from grpc.experimental import aio
+from tests_aio.unit._test_base import AioTestBase
+from tests.unit.framework.common import test_constants
+
+_UNARY_UNARY_ABORT = '/test/UnaryUnaryAbort'
+_SUPPRESS_ABORT = '/test/SuppressAbort'
+_REPLACE_ABORT = '/test/ReplaceAbort'
+_ABORT_AFTER_REPLY = '/test/AbortAfterReply'
+
+_REQUEST = b'\x00\x00\x00'
+_RESPONSE = b'\x01\x01\x01'
+_NUM_STREAM_RESPONSES = 5
+
+_ABORT_CODE = grpc.StatusCode.RESOURCE_EXHAUSTED
+_ABORT_DETAILS = 'Dummy error details'
+
+
+class _GenericHandler(grpc.GenericRpcHandler):
+
+ @staticmethod
+ async def _unary_unary_abort(unused_request, context):
+ await context.abort(_ABORT_CODE, _ABORT_DETAILS)
+ raise RuntimeError('This line should not be executed')
+
+ @staticmethod
+ async def _suppress_abort(unused_request, context):
+ try:
+ await context.abort(_ABORT_CODE, _ABORT_DETAILS)
+ except aio.AbortError as e:
+ pass
+ return _RESPONSE
+
+ @staticmethod
+ async def _replace_abort(unused_request, context):
+ try:
+ await context.abort(_ABORT_CODE, _ABORT_DETAILS)
+ except aio.AbortError as e:
+ await context.abort(grpc.StatusCode.INVALID_ARGUMENT,
+ 'Override abort!')
+
+ @staticmethod
+ async def _abort_after_reply(unused_request, context):
+ yield _RESPONSE
+ await context.abort(_ABORT_CODE, _ABORT_DETAILS)
+ raise RuntimeError('This line should not be executed')
+
+ def service(self, handler_details):
+ if handler_details.method == _UNARY_UNARY_ABORT:
+ return grpc.unary_unary_rpc_method_handler(self._unary_unary_abort)
+ if handler_details.method == _SUPPRESS_ABORT:
+ return grpc.unary_unary_rpc_method_handler(self._suppress_abort)
+ if handler_details.method == _REPLACE_ABORT:
+ return grpc.unary_unary_rpc_method_handler(self._replace_abort)
+ if handler_details.method == _ABORT_AFTER_REPLY:
+ return grpc.unary_stream_rpc_method_handler(self._abort_after_reply)
+
+
+async def _start_test_server():
+ server = aio.server()
+ port = server.add_insecure_port('[::]:0')
+ server.add_generic_rpc_handlers((_GenericHandler(),))
+ await server.start()
+ return 'localhost:%d' % port, server
+
+
+class TestAbort(AioTestBase):
+
+ async def setUp(self):
+ address, self._server = await _start_test_server()
+ self._channel = aio.insecure_channel(address)
+
+ async def tearDown(self):
+ await self._channel.close()
+ await self._server.stop(None)
+
+ async def test_unary_unary_abort(self):
+ method = self._channel.unary_unary(_UNARY_UNARY_ABORT)
+ call = method(_REQUEST)
+
+ self.assertEqual(_ABORT_CODE, await call.code())
+ self.assertEqual(_ABORT_DETAILS, await call.details())
+
+ with self.assertRaises(aio.AioRpcError) as exception_context:
+ await call
+
+ rpc_error = exception_context.exception
+ self.assertEqual(_ABORT_CODE, rpc_error.code())
+ self.assertEqual(_ABORT_DETAILS, rpc_error.details())
+
+ async def test_suppress_abort(self):
+ method = self._channel.unary_unary(_SUPPRESS_ABORT)
+ call = method(_REQUEST)
+
+ with self.assertRaises(aio.AioRpcError) as exception_context:
+ await call
+
+ rpc_error = exception_context.exception
+ self.assertEqual(_ABORT_CODE, rpc_error.code())
+ self.assertEqual(_ABORT_DETAILS, rpc_error.details())
+
+ async def test_replace_abort(self):
+ method = self._channel.unary_unary(_REPLACE_ABORT)
+ call = method(_REQUEST)
+
+ with self.assertRaises(aio.AioRpcError) as exception_context:
+ await call
+
+ rpc_error = exception_context.exception
+ self.assertEqual(_ABORT_CODE, rpc_error.code())
+ self.assertEqual(_ABORT_DETAILS, rpc_error.details())
+
+ async def test_abort_after_reply(self):
+ method = self._channel.unary_stream(_ABORT_AFTER_REPLY)
+ call = method(_REQUEST)
+
+ with self.assertRaises(aio.AioRpcError) as exception_context:
+ await call.read()
+ await call.read()
+
+ rpc_error = exception_context.exception
+ self.assertEqual(_ABORT_CODE, rpc_error.code())
+ self.assertEqual(_ABORT_DETAILS, rpc_error.details())
+
+ self.assertEqual(_ABORT_CODE, await call.code())
+ self.assertEqual(_ABORT_DETAILS, await call.details())
+
+
+if __name__ == '__main__':
+ logging.basicConfig(level=logging.DEBUG)
+ unittest.main(verbosity=2)
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/aio_rpc_error_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/aio_rpc_error_test.py
index 49532e8b04c..b7b18e08f6e 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/aio_rpc_error_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/aio_rpc_error_test.py
@@ -1,52 +1,52 @@
-# Copyright 2019 The gRPC Authors
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-"""Tests AioRpcError class."""
-
-import logging
-import unittest
-
-import grpc
-
-from grpc.experimental import aio
-from grpc.aio._call import AioRpcError
-from tests_aio.unit._test_base import AioTestBase
-
-_TEST_INITIAL_METADATA = aio.Metadata(
- ('initial metadata key', 'initial metadata value'))
-_TEST_TRAILING_METADATA = aio.Metadata(
- ('trailing metadata key', 'trailing metadata value'))
-_TEST_DEBUG_ERROR_STRING = '{This is a debug string}'
-
-
-class TestAioRpcError(unittest.TestCase):
-
- def test_attributes(self):
- aio_rpc_error = AioRpcError(grpc.StatusCode.CANCELLED,
- initial_metadata=_TEST_INITIAL_METADATA,
- trailing_metadata=_TEST_TRAILING_METADATA,
- details="details",
- debug_error_string=_TEST_DEBUG_ERROR_STRING)
- self.assertEqual(aio_rpc_error.code(), grpc.StatusCode.CANCELLED)
- self.assertEqual(aio_rpc_error.details(), 'details')
- self.assertEqual(aio_rpc_error.initial_metadata(),
- _TEST_INITIAL_METADATA)
- self.assertEqual(aio_rpc_error.trailing_metadata(),
- _TEST_TRAILING_METADATA)
- self.assertEqual(aio_rpc_error.debug_error_string(),
- _TEST_DEBUG_ERROR_STRING)
-
-
-if __name__ == '__main__':
- logging.basicConfig()
- unittest.main(verbosity=2)
+# Copyright 2019 The gRPC Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+"""Tests AioRpcError class."""
+
+import logging
+import unittest
+
+import grpc
+
+from grpc.experimental import aio
+from grpc.aio._call import AioRpcError
+from tests_aio.unit._test_base import AioTestBase
+
+_TEST_INITIAL_METADATA = aio.Metadata(
+ ('initial metadata key', 'initial metadata value'))
+_TEST_TRAILING_METADATA = aio.Metadata(
+ ('trailing metadata key', 'trailing metadata value'))
+_TEST_DEBUG_ERROR_STRING = '{This is a debug string}'
+
+
+class TestAioRpcError(unittest.TestCase):
+
+ def test_attributes(self):
+ aio_rpc_error = AioRpcError(grpc.StatusCode.CANCELLED,
+ initial_metadata=_TEST_INITIAL_METADATA,
+ trailing_metadata=_TEST_TRAILING_METADATA,
+ details="details",
+ debug_error_string=_TEST_DEBUG_ERROR_STRING)
+ self.assertEqual(aio_rpc_error.code(), grpc.StatusCode.CANCELLED)
+ self.assertEqual(aio_rpc_error.details(), 'details')
+ self.assertEqual(aio_rpc_error.initial_metadata(),
+ _TEST_INITIAL_METADATA)
+ self.assertEqual(aio_rpc_error.trailing_metadata(),
+ _TEST_TRAILING_METADATA)
+ self.assertEqual(aio_rpc_error.debug_error_string(),
+ _TEST_DEBUG_ERROR_STRING)
+
+
+if __name__ == '__main__':
+ logging.basicConfig()
+ unittest.main(verbosity=2)
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/auth_context_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/auth_context_test.py
index 42a60abde86..fb303714682 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/auth_context_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/auth_context_test.py
@@ -1,194 +1,194 @@
-# Copyright 2020 The gRPC Authors
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-"""Porting auth context tests from sync stack."""
-
-import pickle
-import unittest
-import logging
-
-import grpc
-from grpc.experimental import aio
-from grpc.experimental import session_cache
-import six
-
-from tests.unit import resources
-from tests_aio.unit._test_base import AioTestBase
-
-_REQUEST = b'\x00\x00\x00'
-_RESPONSE = b'\x00\x00\x00'
-
-_UNARY_UNARY = '/test/UnaryUnary'
-
-_SERVER_HOST_OVERRIDE = 'foo.test.google.fr'
-_CLIENT_IDS = (
- b'*.test.google.fr',
- b'waterzooi.test.google.be',
- b'*.test.youtube.com',
- b'192.168.1.3',
-)
-_ID = 'id'
-_ID_KEY = 'id_key'
-_AUTH_CTX = 'auth_ctx'
-
-_PRIVATE_KEY = resources.private_key()
-_CERTIFICATE_CHAIN = resources.certificate_chain()
-_TEST_ROOT_CERTIFICATES = resources.test_root_certificates()
-_SERVER_CERTS = ((_PRIVATE_KEY, _CERTIFICATE_CHAIN),)
-_PROPERTY_OPTIONS = ((
- 'grpc.ssl_target_name_override',
- _SERVER_HOST_OVERRIDE,
-),)
-
-
-async def handle_unary_unary(unused_request: bytes,
- servicer_context: aio.ServicerContext):
- return pickle.dumps({
- _ID: servicer_context.peer_identities(),
- _ID_KEY: servicer_context.peer_identity_key(),
- _AUTH_CTX: servicer_context.auth_context()
- })
-
-
-class TestAuthContext(AioTestBase):
-
- async def test_insecure(self):
- handler = grpc.method_handlers_generic_handler('test', {
- 'UnaryUnary':
- grpc.unary_unary_rpc_method_handler(handle_unary_unary)
- })
- server = aio.server()
- server.add_generic_rpc_handlers((handler,))
- port = server.add_insecure_port('[::]:0')
- await server.start()
-
- async with aio.insecure_channel('localhost:%d' % port) as channel:
- response = await channel.unary_unary(_UNARY_UNARY)(_REQUEST)
- await server.stop(None)
-
- auth_data = pickle.loads(response)
- self.assertIsNone(auth_data[_ID])
- self.assertIsNone(auth_data[_ID_KEY])
- self.assertDictEqual({}, auth_data[_AUTH_CTX])
-
- async def test_secure_no_cert(self):
- handler = grpc.method_handlers_generic_handler('test', {
- 'UnaryUnary':
- grpc.unary_unary_rpc_method_handler(handle_unary_unary)
- })
- server = aio.server()
- server.add_generic_rpc_handlers((handler,))
- server_cred = grpc.ssl_server_credentials(_SERVER_CERTS)
- port = server.add_secure_port('[::]:0', server_cred)
- await server.start()
-
- channel_creds = grpc.ssl_channel_credentials(
- root_certificates=_TEST_ROOT_CERTIFICATES)
- channel = aio.secure_channel('localhost:{}'.format(port),
- channel_creds,
- options=_PROPERTY_OPTIONS)
- response = await channel.unary_unary(_UNARY_UNARY)(_REQUEST)
- await channel.close()
- await server.stop(None)
-
- auth_data = pickle.loads(response)
- self.assertIsNone(auth_data[_ID])
- self.assertIsNone(auth_data[_ID_KEY])
- self.assertDictEqual(
- {
- 'security_level': [b'TSI_PRIVACY_AND_INTEGRITY'],
- 'transport_security_type': [b'ssl'],
- 'ssl_session_reused': [b'false'],
- }, auth_data[_AUTH_CTX])
-
- async def test_secure_client_cert(self):
- handler = grpc.method_handlers_generic_handler('test', {
- 'UnaryUnary':
- grpc.unary_unary_rpc_method_handler(handle_unary_unary)
- })
- server = aio.server()
- server.add_generic_rpc_handlers((handler,))
- server_cred = grpc.ssl_server_credentials(
- _SERVER_CERTS,
- root_certificates=_TEST_ROOT_CERTIFICATES,
- require_client_auth=True)
- port = server.add_secure_port('[::]:0', server_cred)
- await server.start()
-
- channel_creds = grpc.ssl_channel_credentials(
- root_certificates=_TEST_ROOT_CERTIFICATES,
- private_key=_PRIVATE_KEY,
- certificate_chain=_CERTIFICATE_CHAIN)
- channel = aio.secure_channel('localhost:{}'.format(port),
- channel_creds,
- options=_PROPERTY_OPTIONS)
-
- response = await channel.unary_unary(_UNARY_UNARY)(_REQUEST)
- await channel.close()
- await server.stop(None)
-
- auth_data = pickle.loads(response)
- auth_ctx = auth_data[_AUTH_CTX]
- self.assertCountEqual(_CLIENT_IDS, auth_data[_ID])
- self.assertEqual('x509_subject_alternative_name', auth_data[_ID_KEY])
- self.assertSequenceEqual([b'ssl'], auth_ctx['transport_security_type'])
- self.assertSequenceEqual([b'*.test.google.com'],
- auth_ctx['x509_common_name'])
-
- async def _do_one_shot_client_rpc(self, channel_creds, channel_options,
- port, expect_ssl_session_reused):
- channel = aio.secure_channel('localhost:{}'.format(port),
- channel_creds,
- options=channel_options)
- response = await channel.unary_unary(_UNARY_UNARY)(_REQUEST)
- auth_data = pickle.loads(response)
- self.assertEqual(expect_ssl_session_reused,
- auth_data[_AUTH_CTX]['ssl_session_reused'])
- await channel.close()
-
- async def test_session_resumption(self):
- # Set up a secure server
- handler = grpc.method_handlers_generic_handler('test', {
- 'UnaryUnary':
- grpc.unary_unary_rpc_method_handler(handle_unary_unary)
- })
- server = aio.server()
- server.add_generic_rpc_handlers((handler,))
- server_cred = grpc.ssl_server_credentials(_SERVER_CERTS)
- port = server.add_secure_port('[::]:0', server_cred)
- await server.start()
-
- # Create a cache for TLS session tickets
- cache = session_cache.ssl_session_cache_lru(1)
- channel_creds = grpc.ssl_channel_credentials(
- root_certificates=_TEST_ROOT_CERTIFICATES)
- channel_options = _PROPERTY_OPTIONS + (
- ('grpc.ssl_session_cache', cache),)
-
- # Initial connection has no session to resume
- await self._do_one_shot_client_rpc(channel_creds,
- channel_options,
- port,
- expect_ssl_session_reused=[b'false'])
-
- # Subsequent connections resume sessions
- await self._do_one_shot_client_rpc(channel_creds,
- channel_options,
- port,
- expect_ssl_session_reused=[b'true'])
- await server.stop(None)
-
-
-if __name__ == '__main__':
- logging.basicConfig(level=logging.DEBUG)
- unittest.main()
+# Copyright 2020 The gRPC Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+"""Porting auth context tests from sync stack."""
+
+import pickle
+import unittest
+import logging
+
+import grpc
+from grpc.experimental import aio
+from grpc.experimental import session_cache
+import six
+
+from tests.unit import resources
+from tests_aio.unit._test_base import AioTestBase
+
+_REQUEST = b'\x00\x00\x00'
+_RESPONSE = b'\x00\x00\x00'
+
+_UNARY_UNARY = '/test/UnaryUnary'
+
+_SERVER_HOST_OVERRIDE = 'foo.test.google.fr'
+_CLIENT_IDS = (
+ b'*.test.google.fr',
+ b'waterzooi.test.google.be',
+ b'*.test.youtube.com',
+ b'192.168.1.3',
+)
+_ID = 'id'
+_ID_KEY = 'id_key'
+_AUTH_CTX = 'auth_ctx'
+
+_PRIVATE_KEY = resources.private_key()
+_CERTIFICATE_CHAIN = resources.certificate_chain()
+_TEST_ROOT_CERTIFICATES = resources.test_root_certificates()
+_SERVER_CERTS = ((_PRIVATE_KEY, _CERTIFICATE_CHAIN),)
+_PROPERTY_OPTIONS = ((
+ 'grpc.ssl_target_name_override',
+ _SERVER_HOST_OVERRIDE,
+),)
+
+
+async def handle_unary_unary(unused_request: bytes,
+ servicer_context: aio.ServicerContext):
+ return pickle.dumps({
+ _ID: servicer_context.peer_identities(),
+ _ID_KEY: servicer_context.peer_identity_key(),
+ _AUTH_CTX: servicer_context.auth_context()
+ })
+
+
+class TestAuthContext(AioTestBase):
+
+ async def test_insecure(self):
+ handler = grpc.method_handlers_generic_handler('test', {
+ 'UnaryUnary':
+ grpc.unary_unary_rpc_method_handler(handle_unary_unary)
+ })
+ server = aio.server()
+ server.add_generic_rpc_handlers((handler,))
+ port = server.add_insecure_port('[::]:0')
+ await server.start()
+
+ async with aio.insecure_channel('localhost:%d' % port) as channel:
+ response = await channel.unary_unary(_UNARY_UNARY)(_REQUEST)
+ await server.stop(None)
+
+ auth_data = pickle.loads(response)
+ self.assertIsNone(auth_data[_ID])
+ self.assertIsNone(auth_data[_ID_KEY])
+ self.assertDictEqual({}, auth_data[_AUTH_CTX])
+
+ async def test_secure_no_cert(self):
+ handler = grpc.method_handlers_generic_handler('test', {
+ 'UnaryUnary':
+ grpc.unary_unary_rpc_method_handler(handle_unary_unary)
+ })
+ server = aio.server()
+ server.add_generic_rpc_handlers((handler,))
+ server_cred = grpc.ssl_server_credentials(_SERVER_CERTS)
+ port = server.add_secure_port('[::]:0', server_cred)
+ await server.start()
+
+ channel_creds = grpc.ssl_channel_credentials(
+ root_certificates=_TEST_ROOT_CERTIFICATES)
+ channel = aio.secure_channel('localhost:{}'.format(port),
+ channel_creds,
+ options=_PROPERTY_OPTIONS)
+ response = await channel.unary_unary(_UNARY_UNARY)(_REQUEST)
+ await channel.close()
+ await server.stop(None)
+
+ auth_data = pickle.loads(response)
+ self.assertIsNone(auth_data[_ID])
+ self.assertIsNone(auth_data[_ID_KEY])
+ self.assertDictEqual(
+ {
+ 'security_level': [b'TSI_PRIVACY_AND_INTEGRITY'],
+ 'transport_security_type': [b'ssl'],
+ 'ssl_session_reused': [b'false'],
+ }, auth_data[_AUTH_CTX])
+
+ async def test_secure_client_cert(self):
+ handler = grpc.method_handlers_generic_handler('test', {
+ 'UnaryUnary':
+ grpc.unary_unary_rpc_method_handler(handle_unary_unary)
+ })
+ server = aio.server()
+ server.add_generic_rpc_handlers((handler,))
+ server_cred = grpc.ssl_server_credentials(
+ _SERVER_CERTS,
+ root_certificates=_TEST_ROOT_CERTIFICATES,
+ require_client_auth=True)
+ port = server.add_secure_port('[::]:0', server_cred)
+ await server.start()
+
+ channel_creds = grpc.ssl_channel_credentials(
+ root_certificates=_TEST_ROOT_CERTIFICATES,
+ private_key=_PRIVATE_KEY,
+ certificate_chain=_CERTIFICATE_CHAIN)
+ channel = aio.secure_channel('localhost:{}'.format(port),
+ channel_creds,
+ options=_PROPERTY_OPTIONS)
+
+ response = await channel.unary_unary(_UNARY_UNARY)(_REQUEST)
+ await channel.close()
+ await server.stop(None)
+
+ auth_data = pickle.loads(response)
+ auth_ctx = auth_data[_AUTH_CTX]
+ self.assertCountEqual(_CLIENT_IDS, auth_data[_ID])
+ self.assertEqual('x509_subject_alternative_name', auth_data[_ID_KEY])
+ self.assertSequenceEqual([b'ssl'], auth_ctx['transport_security_type'])
+ self.assertSequenceEqual([b'*.test.google.com'],
+ auth_ctx['x509_common_name'])
+
+ async def _do_one_shot_client_rpc(self, channel_creds, channel_options,
+ port, expect_ssl_session_reused):
+ channel = aio.secure_channel('localhost:{}'.format(port),
+ channel_creds,
+ options=channel_options)
+ response = await channel.unary_unary(_UNARY_UNARY)(_REQUEST)
+ auth_data = pickle.loads(response)
+ self.assertEqual(expect_ssl_session_reused,
+ auth_data[_AUTH_CTX]['ssl_session_reused'])
+ await channel.close()
+
+ async def test_session_resumption(self):
+ # Set up a secure server
+ handler = grpc.method_handlers_generic_handler('test', {
+ 'UnaryUnary':
+ grpc.unary_unary_rpc_method_handler(handle_unary_unary)
+ })
+ server = aio.server()
+ server.add_generic_rpc_handlers((handler,))
+ server_cred = grpc.ssl_server_credentials(_SERVER_CERTS)
+ port = server.add_secure_port('[::]:0', server_cred)
+ await server.start()
+
+ # Create a cache for TLS session tickets
+ cache = session_cache.ssl_session_cache_lru(1)
+ channel_creds = grpc.ssl_channel_credentials(
+ root_certificates=_TEST_ROOT_CERTIFICATES)
+ channel_options = _PROPERTY_OPTIONS + (
+ ('grpc.ssl_session_cache', cache),)
+
+ # Initial connection has no session to resume
+ await self._do_one_shot_client_rpc(channel_creds,
+ channel_options,
+ port,
+ expect_ssl_session_reused=[b'false'])
+
+ # Subsequent connections resume sessions
+ await self._do_one_shot_client_rpc(channel_creds,
+ channel_options,
+ port,
+ expect_ssl_session_reused=[b'true'])
+ await server.stop(None)
+
+
+if __name__ == '__main__':
+ logging.basicConfig(level=logging.DEBUG)
+ unittest.main()
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/call_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/call_test.py
index b3b389a59f8..1961226fa6d 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/call_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/call_test.py
@@ -11,804 +11,804 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-"""Tests behavior of the Call classes."""
-
+"""Tests behavior of the Call classes."""
+
import asyncio
import logging
import unittest
-import datetime
+import datetime
import grpc
-from grpc.experimental import aio
+from grpc.experimental import aio
-from src.proto.grpc.testing import messages_pb2, test_pb2_grpc
-from tests_aio.unit._test_base import AioTestBase
+from src.proto.grpc.testing import messages_pb2, test_pb2_grpc
+from tests_aio.unit._test_base import AioTestBase
from tests_aio.unit._test_server import start_test_server
-from tests_aio.unit._constants import UNREACHABLE_TARGET
-
-_SHORT_TIMEOUT_S = datetime.timedelta(seconds=1).total_seconds()
-
-_NUM_STREAM_RESPONSES = 5
-_RESPONSE_PAYLOAD_SIZE = 42
-_REQUEST_PAYLOAD_SIZE = 7
-_LOCAL_CANCEL_DETAILS_EXPECTATION = 'Locally cancelled by application!'
-_RESPONSE_INTERVAL_US = int(_SHORT_TIMEOUT_S * 1000 * 1000)
-_INFINITE_INTERVAL_US = 2**31 - 1
-
-
-class _MulticallableTestMixin():
-
- async def setUp(self):
- address, self._server = await start_test_server()
- self._channel = aio.insecure_channel(address)
- self._stub = test_pb2_grpc.TestServiceStub(self._channel)
-
- async def tearDown(self):
- await self._channel.close()
- await self._server.stop(None)
-
-
-class TestUnaryUnaryCall(_MulticallableTestMixin, AioTestBase):
-
- async def test_call_to_string(self):
- call = self._stub.UnaryCall(messages_pb2.SimpleRequest())
-
- self.assertTrue(str(call) is not None)
- self.assertTrue(repr(call) is not None)
-
- await call
-
- self.assertTrue(str(call) is not None)
- self.assertTrue(repr(call) is not None)
-
- async def test_call_ok(self):
- call = self._stub.UnaryCall(messages_pb2.SimpleRequest())
-
- self.assertFalse(call.done())
-
- response = await call
-
- self.assertTrue(call.done())
- self.assertIsInstance(response, messages_pb2.SimpleResponse)
- self.assertEqual(await call.code(), grpc.StatusCode.OK)
-
- # Response is cached at call object level, reentrance
- # returns again the same response
- response_retry = await call
- self.assertIs(response, response_retry)
-
- async def test_call_rpc_error(self):
- async with aio.insecure_channel(UNREACHABLE_TARGET) as channel:
- stub = test_pb2_grpc.TestServiceStub(channel)
-
- call = stub.UnaryCall(messages_pb2.SimpleRequest())
-
- with self.assertRaises(aio.AioRpcError) as exception_context:
- await call
-
- self.assertEqual(grpc.StatusCode.UNAVAILABLE,
- exception_context.exception.code())
-
- self.assertTrue(call.done())
- self.assertEqual(grpc.StatusCode.UNAVAILABLE, await call.code())
-
- async def test_call_code_awaitable(self):
- call = self._stub.UnaryCall(messages_pb2.SimpleRequest())
- self.assertEqual(await call.code(), grpc.StatusCode.OK)
-
- async def test_call_details_awaitable(self):
- call = self._stub.UnaryCall(messages_pb2.SimpleRequest())
- self.assertEqual('', await call.details())
-
- async def test_call_initial_metadata_awaitable(self):
- call = self._stub.UnaryCall(messages_pb2.SimpleRequest())
- self.assertEqual(aio.Metadata(), await call.initial_metadata())
-
- async def test_call_trailing_metadata_awaitable(self):
- call = self._stub.UnaryCall(messages_pb2.SimpleRequest())
- self.assertEqual(aio.Metadata(), await call.trailing_metadata())
-
- async def test_call_initial_metadata_cancelable(self):
- coro_started = asyncio.Event()
- call = self._stub.UnaryCall(messages_pb2.SimpleRequest())
-
- async def coro():
- coro_started.set()
- await call.initial_metadata()
-
- task = self.loop.create_task(coro())
- await coro_started.wait()
- task.cancel()
-
- # Test that initial metadata can still be asked thought
- # a cancellation happened with the previous task
- self.assertEqual(aio.Metadata(), await call.initial_metadata())
-
- async def test_call_initial_metadata_multiple_waiters(self):
- call = self._stub.UnaryCall(messages_pb2.SimpleRequest())
-
- async def coro():
- return await call.initial_metadata()
-
- task1 = self.loop.create_task(coro())
- task2 = self.loop.create_task(coro())
-
- await call
- expected = [aio.Metadata() for _ in range(2)]
- self.assertEqual(expected, await asyncio.gather(*[task1, task2]))
-
- async def test_call_code_cancelable(self):
- coro_started = asyncio.Event()
- call = self._stub.UnaryCall(messages_pb2.SimpleRequest())
-
- async def coro():
- coro_started.set()
- await call.code()
-
- task = self.loop.create_task(coro())
- await coro_started.wait()
- task.cancel()
-
- # Test that code can still be asked thought
- # a cancellation happened with the previous task
- self.assertEqual(grpc.StatusCode.OK, await call.code())
-
- async def test_call_code_multiple_waiters(self):
- call = self._stub.UnaryCall(messages_pb2.SimpleRequest())
-
- async def coro():
- return await call.code()
-
- task1 = self.loop.create_task(coro())
- task2 = self.loop.create_task(coro())
-
- await call
-
- self.assertEqual([grpc.StatusCode.OK, grpc.StatusCode.OK], await
- asyncio.gather(task1, task2))
-
- async def test_cancel_unary_unary(self):
- call = self._stub.UnaryCall(messages_pb2.SimpleRequest())
-
- self.assertFalse(call.cancelled())
-
- self.assertTrue(call.cancel())
- self.assertFalse(call.cancel())
-
- with self.assertRaises(asyncio.CancelledError):
- await call
-
- # The info in the RpcError should match the info in Call object.
- self.assertTrue(call.cancelled())
- self.assertEqual(await call.code(), grpc.StatusCode.CANCELLED)
- self.assertEqual(await call.details(),
- 'Locally cancelled by application!')
-
- async def test_cancel_unary_unary_in_task(self):
- coro_started = asyncio.Event()
- call = self._stub.EmptyCall(messages_pb2.SimpleRequest())
-
- async def another_coro():
- coro_started.set()
- await call
-
- task = self.loop.create_task(another_coro())
- await coro_started.wait()
-
- self.assertFalse(task.done())
- task.cancel()
-
- self.assertEqual(grpc.StatusCode.CANCELLED, await call.code())
-
- with self.assertRaises(asyncio.CancelledError):
- await task
-
- async def test_passing_credentials_fails_over_insecure_channel(self):
- call_credentials = grpc.composite_call_credentials(
- grpc.access_token_call_credentials("abc"),
- grpc.access_token_call_credentials("def"),
- )
- with self.assertRaisesRegex(
- aio.UsageError,
- "Call credentials are only valid on secure channels"):
- self._stub.UnaryCall(messages_pb2.SimpleRequest(),
- credentials=call_credentials)
-
-
-class TestUnaryStreamCall(_MulticallableTestMixin, AioTestBase):
-
- async def test_call_rpc_error(self):
- channel = aio.insecure_channel(UNREACHABLE_TARGET)
- request = messages_pb2.StreamingOutputCallRequest()
- stub = test_pb2_grpc.TestServiceStub(channel)
- call = stub.StreamingOutputCall(request)
-
- with self.assertRaises(aio.AioRpcError) as exception_context:
- async for response in call:
- pass
-
- self.assertEqual(grpc.StatusCode.UNAVAILABLE,
- exception_context.exception.code())
-
- self.assertTrue(call.done())
- self.assertEqual(grpc.StatusCode.UNAVAILABLE, await call.code())
- await channel.close()
-
- async def test_cancel_unary_stream(self):
- # Prepares the request
- request = messages_pb2.StreamingOutputCallRequest()
- for _ in range(_NUM_STREAM_RESPONSES):
- request.response_parameters.append(
- messages_pb2.ResponseParameters(
- size=_RESPONSE_PAYLOAD_SIZE,
- interval_us=_RESPONSE_INTERVAL_US,
- ))
-
- # Invokes the actual RPC
- call = self._stub.StreamingOutputCall(request)
- self.assertFalse(call.cancelled())
-
- response = await call.read()
- self.assertIs(type(response), messages_pb2.StreamingOutputCallResponse)
- self.assertEqual(_RESPONSE_PAYLOAD_SIZE, len(response.payload.body))
-
- self.assertTrue(call.cancel())
- self.assertEqual(grpc.StatusCode.CANCELLED, await call.code())
- self.assertEqual(_LOCAL_CANCEL_DETAILS_EXPECTATION, await
- call.details())
- self.assertFalse(call.cancel())
-
- with self.assertRaises(asyncio.CancelledError):
- await call.read()
- self.assertTrue(call.cancelled())
-
- async def test_multiple_cancel_unary_stream(self):
- # Prepares the request
- request = messages_pb2.StreamingOutputCallRequest()
- for _ in range(_NUM_STREAM_RESPONSES):
- request.response_parameters.append(
- messages_pb2.ResponseParameters(
- size=_RESPONSE_PAYLOAD_SIZE,
- interval_us=_RESPONSE_INTERVAL_US,
- ))
-
- # Invokes the actual RPC
- call = self._stub.StreamingOutputCall(request)
- self.assertFalse(call.cancelled())
-
- response = await call.read()
- self.assertIs(type(response), messages_pb2.StreamingOutputCallResponse)
- self.assertEqual(_RESPONSE_PAYLOAD_SIZE, len(response.payload.body))
-
- self.assertTrue(call.cancel())
- self.assertFalse(call.cancel())
- self.assertFalse(call.cancel())
- self.assertFalse(call.cancel())
-
- with self.assertRaises(asyncio.CancelledError):
- await call.read()
-
- async def test_early_cancel_unary_stream(self):
- """Test cancellation before receiving messages."""
- # Prepares the request
- request = messages_pb2.StreamingOutputCallRequest()
- for _ in range(_NUM_STREAM_RESPONSES):
- request.response_parameters.append(
- messages_pb2.ResponseParameters(
- size=_RESPONSE_PAYLOAD_SIZE,
- interval_us=_RESPONSE_INTERVAL_US,
- ))
-
- # Invokes the actual RPC
- call = self._stub.StreamingOutputCall(request)
-
- self.assertFalse(call.cancelled())
- self.assertTrue(call.cancel())
- self.assertFalse(call.cancel())
-
- with self.assertRaises(asyncio.CancelledError):
- await call.read()
-
- self.assertTrue(call.cancelled())
-
- self.assertEqual(grpc.StatusCode.CANCELLED, await call.code())
- self.assertEqual(_LOCAL_CANCEL_DETAILS_EXPECTATION, await
- call.details())
-
- async def test_late_cancel_unary_stream(self):
- """Test cancellation after received all messages."""
- # Prepares the request
- request = messages_pb2.StreamingOutputCallRequest()
- for _ in range(_NUM_STREAM_RESPONSES):
- request.response_parameters.append(
- messages_pb2.ResponseParameters(size=_RESPONSE_PAYLOAD_SIZE,))
-
- # Invokes the actual RPC
- call = self._stub.StreamingOutputCall(request)
-
- for _ in range(_NUM_STREAM_RESPONSES):
- response = await call.read()
- self.assertIs(type(response),
- messages_pb2.StreamingOutputCallResponse)
- self.assertEqual(_RESPONSE_PAYLOAD_SIZE, len(response.payload.body))
-
- # After all messages received, it is possible that the final state
- # is received or on its way. It's basically a data race, so our
- # expectation here is do not crash :)
- call.cancel()
- self.assertIn(await call.code(),
- [grpc.StatusCode.OK, grpc.StatusCode.CANCELLED])
-
- async def test_too_many_reads_unary_stream(self):
- """Test calling read after received all messages fails."""
- # Prepares the request
- request = messages_pb2.StreamingOutputCallRequest()
- for _ in range(_NUM_STREAM_RESPONSES):
- request.response_parameters.append(
- messages_pb2.ResponseParameters(size=_RESPONSE_PAYLOAD_SIZE,))
-
- # Invokes the actual RPC
- call = self._stub.StreamingOutputCall(request)
-
- for _ in range(_NUM_STREAM_RESPONSES):
- response = await call.read()
- self.assertIs(type(response),
- messages_pb2.StreamingOutputCallResponse)
- self.assertEqual(_RESPONSE_PAYLOAD_SIZE, len(response.payload.body))
- self.assertIs(await call.read(), aio.EOF)
-
- # After the RPC is finished, further reads will lead to exception.
- self.assertEqual(await call.code(), grpc.StatusCode.OK)
- self.assertIs(await call.read(), aio.EOF)
-
- async def test_unary_stream_async_generator(self):
- """Sunny day test case for unary_stream."""
- # Prepares the request
- request = messages_pb2.StreamingOutputCallRequest()
- for _ in range(_NUM_STREAM_RESPONSES):
- request.response_parameters.append(
- messages_pb2.ResponseParameters(size=_RESPONSE_PAYLOAD_SIZE,))
-
- # Invokes the actual RPC
- call = self._stub.StreamingOutputCall(request)
- self.assertFalse(call.cancelled())
-
- async for response in call:
- self.assertIs(type(response),
- messages_pb2.StreamingOutputCallResponse)
- self.assertEqual(_RESPONSE_PAYLOAD_SIZE, len(response.payload.body))
-
- self.assertEqual(await call.code(), grpc.StatusCode.OK)
-
- async def test_cancel_unary_stream_in_task_using_read(self):
- coro_started = asyncio.Event()
-
- # Configs the server method to block forever
- request = messages_pb2.StreamingOutputCallRequest()
- request.response_parameters.append(
- messages_pb2.ResponseParameters(
- size=_RESPONSE_PAYLOAD_SIZE,
- interval_us=_INFINITE_INTERVAL_US,
- ))
-
- # Invokes the actual RPC
- call = self._stub.StreamingOutputCall(request)
-
- async def another_coro():
- coro_started.set()
- await call.read()
-
- task = self.loop.create_task(another_coro())
- await coro_started.wait()
-
- self.assertFalse(task.done())
- task.cancel()
-
- self.assertEqual(grpc.StatusCode.CANCELLED, await call.code())
-
- with self.assertRaises(asyncio.CancelledError):
- await task
-
- async def test_cancel_unary_stream_in_task_using_async_for(self):
- coro_started = asyncio.Event()
-
- # Configs the server method to block forever
- request = messages_pb2.StreamingOutputCallRequest()
- request.response_parameters.append(
- messages_pb2.ResponseParameters(
- size=_RESPONSE_PAYLOAD_SIZE,
- interval_us=_INFINITE_INTERVAL_US,
- ))
-
- # Invokes the actual RPC
- call = self._stub.StreamingOutputCall(request)
-
- async def another_coro():
- coro_started.set()
- async for _ in call:
- pass
-
- task = self.loop.create_task(another_coro())
- await coro_started.wait()
-
- self.assertFalse(task.done())
- task.cancel()
-
- self.assertEqual(grpc.StatusCode.CANCELLED, await call.code())
-
- with self.assertRaises(asyncio.CancelledError):
- await task
-
- async def test_time_remaining(self):
- request = messages_pb2.StreamingOutputCallRequest()
- # First message comes back immediately
- request.response_parameters.append(
- messages_pb2.ResponseParameters(size=_RESPONSE_PAYLOAD_SIZE,))
- # Second message comes back after a unit of wait time
- request.response_parameters.append(
- messages_pb2.ResponseParameters(
- size=_RESPONSE_PAYLOAD_SIZE,
- interval_us=_RESPONSE_INTERVAL_US,
- ))
-
- call = self._stub.StreamingOutputCall(request,
- timeout=_SHORT_TIMEOUT_S * 2)
-
- response = await call.read()
- self.assertEqual(_RESPONSE_PAYLOAD_SIZE, len(response.payload.body))
-
- # Should be around the same as the timeout
- remained_time = call.time_remaining()
- self.assertGreater(remained_time, _SHORT_TIMEOUT_S * 3 / 2)
- self.assertLess(remained_time, _SHORT_TIMEOUT_S * 5 / 2)
-
- response = await call.read()
- self.assertEqual(_RESPONSE_PAYLOAD_SIZE, len(response.payload.body))
-
- # Should be around the timeout minus a unit of wait time
- remained_time = call.time_remaining()
- self.assertGreater(remained_time, _SHORT_TIMEOUT_S / 2)
- self.assertLess(remained_time, _SHORT_TIMEOUT_S * 3 / 2)
-
- self.assertEqual(grpc.StatusCode.OK, await call.code())
-
-
-class TestStreamUnaryCall(_MulticallableTestMixin, AioTestBase):
-
- async def test_cancel_stream_unary(self):
- call = self._stub.StreamingInputCall()
-
- # Prepares the request
- payload = messages_pb2.Payload(body=b'\0' * _REQUEST_PAYLOAD_SIZE)
- request = messages_pb2.StreamingInputCallRequest(payload=payload)
-
- # Sends out requests
- for _ in range(_NUM_STREAM_RESPONSES):
- await call.write(request)
-
- # Cancels the RPC
- self.assertFalse(call.done())
- self.assertFalse(call.cancelled())
- self.assertTrue(call.cancel())
- self.assertTrue(call.cancelled())
-
- await call.done_writing()
-
- with self.assertRaises(asyncio.CancelledError):
- await call
-
- async def test_early_cancel_stream_unary(self):
- call = self._stub.StreamingInputCall()
-
- # Cancels the RPC
- self.assertFalse(call.done())
- self.assertFalse(call.cancelled())
- self.assertTrue(call.cancel())
- self.assertTrue(call.cancelled())
-
- with self.assertRaises(asyncio.InvalidStateError):
- await call.write(messages_pb2.StreamingInputCallRequest())
-
- # Should be no-op
- await call.done_writing()
-
- with self.assertRaises(asyncio.CancelledError):
- await call
-
- async def test_write_after_done_writing(self):
- call = self._stub.StreamingInputCall()
-
- # Prepares the request
- payload = messages_pb2.Payload(body=b'\0' * _REQUEST_PAYLOAD_SIZE)
- request = messages_pb2.StreamingInputCallRequest(payload=payload)
-
- # Sends out requests
- for _ in range(_NUM_STREAM_RESPONSES):
- await call.write(request)
-
- # Should be no-op
- await call.done_writing()
-
- with self.assertRaises(asyncio.InvalidStateError):
- await call.write(messages_pb2.StreamingInputCallRequest())
-
- response = await call
- self.assertIsInstance(response, messages_pb2.StreamingInputCallResponse)
- self.assertEqual(_NUM_STREAM_RESPONSES * _REQUEST_PAYLOAD_SIZE,
- response.aggregated_payload_size)
-
- self.assertEqual(await call.code(), grpc.StatusCode.OK)
-
- async def test_error_in_async_generator(self):
- # Server will pause between responses
- request = messages_pb2.StreamingOutputCallRequest()
- request.response_parameters.append(
- messages_pb2.ResponseParameters(
- size=_RESPONSE_PAYLOAD_SIZE,
- interval_us=_RESPONSE_INTERVAL_US,
- ))
-
- # We expect the request iterator to receive the exception
- request_iterator_received_the_exception = asyncio.Event()
-
- async def request_iterator():
- with self.assertRaises(asyncio.CancelledError):
- for _ in range(_NUM_STREAM_RESPONSES):
- yield request
- await asyncio.sleep(_SHORT_TIMEOUT_S)
- request_iterator_received_the_exception.set()
-
- call = self._stub.StreamingInputCall(request_iterator())
-
- # Cancel the RPC after at least one response
- async def cancel_later():
- await asyncio.sleep(_SHORT_TIMEOUT_S * 2)
- call.cancel()
-
- cancel_later_task = self.loop.create_task(cancel_later())
-
- with self.assertRaises(asyncio.CancelledError):
- await call
-
- await request_iterator_received_the_exception.wait()
-
- # No failures in the cancel later task!
- await cancel_later_task
-
- async def test_normal_iterable_requests(self):
- # Prepares the request
- payload = messages_pb2.Payload(body=b'\0' * _REQUEST_PAYLOAD_SIZE)
- request = messages_pb2.StreamingInputCallRequest(payload=payload)
- requests = [request] * _NUM_STREAM_RESPONSES
-
- # Sends out requests
- call = self._stub.StreamingInputCall(requests)
-
- # RPC should succeed
- response = await call
- self.assertIsInstance(response, messages_pb2.StreamingInputCallResponse)
- self.assertEqual(_NUM_STREAM_RESPONSES * _REQUEST_PAYLOAD_SIZE,
- response.aggregated_payload_size)
-
- self.assertEqual(await call.code(), grpc.StatusCode.OK)
-
- async def test_call_rpc_error(self):
- async with aio.insecure_channel(UNREACHABLE_TARGET) as channel:
- stub = test_pb2_grpc.TestServiceStub(channel)
-
- # The error should be raised automatically without any traffic.
- call = stub.StreamingInputCall()
- with self.assertRaises(aio.AioRpcError) as exception_context:
- await call
-
- self.assertEqual(grpc.StatusCode.UNAVAILABLE,
- exception_context.exception.code())
-
- self.assertTrue(call.done())
- self.assertEqual(grpc.StatusCode.UNAVAILABLE, await call.code())
-
- async def test_timeout(self):
- call = self._stub.StreamingInputCall(timeout=_SHORT_TIMEOUT_S)
-
- # The error should be raised automatically without any traffic.
- with self.assertRaises(aio.AioRpcError) as exception_context:
- await call
-
- rpc_error = exception_context.exception
- self.assertEqual(grpc.StatusCode.DEADLINE_EXCEEDED, rpc_error.code())
- self.assertTrue(call.done())
- self.assertEqual(grpc.StatusCode.DEADLINE_EXCEEDED, await call.code())
-
-
-# Prepares the request that stream in a ping-pong manner.
-_STREAM_OUTPUT_REQUEST_ONE_RESPONSE = messages_pb2.StreamingOutputCallRequest()
-_STREAM_OUTPUT_REQUEST_ONE_RESPONSE.response_parameters.append(
- messages_pb2.ResponseParameters(size=_RESPONSE_PAYLOAD_SIZE))
-
-
-class TestStreamStreamCall(_MulticallableTestMixin, AioTestBase):
-
- async def test_cancel(self):
- # Invokes the actual RPC
- call = self._stub.FullDuplexCall()
-
- for _ in range(_NUM_STREAM_RESPONSES):
- await call.write(_STREAM_OUTPUT_REQUEST_ONE_RESPONSE)
- response = await call.read()
- self.assertIsInstance(response,
- messages_pb2.StreamingOutputCallResponse)
- self.assertEqual(_RESPONSE_PAYLOAD_SIZE, len(response.payload.body))
-
- # Cancels the RPC
- self.assertFalse(call.done())
- self.assertFalse(call.cancelled())
- self.assertTrue(call.cancel())
- self.assertTrue(call.cancelled())
- self.assertEqual(grpc.StatusCode.CANCELLED, await call.code())
-
- async def test_cancel_with_pending_read(self):
- call = self._stub.FullDuplexCall()
-
- await call.write(_STREAM_OUTPUT_REQUEST_ONE_RESPONSE)
-
- # Cancels the RPC
- self.assertFalse(call.done())
- self.assertFalse(call.cancelled())
- self.assertTrue(call.cancel())
- self.assertTrue(call.cancelled())
- self.assertEqual(grpc.StatusCode.CANCELLED, await call.code())
-
- async def test_cancel_with_ongoing_read(self):
- call = self._stub.FullDuplexCall()
- coro_started = asyncio.Event()
-
- async def read_coro():
- coro_started.set()
- await call.read()
-
- read_task = self.loop.create_task(read_coro())
- await coro_started.wait()
- self.assertFalse(read_task.done())
-
- # Cancels the RPC
- self.assertFalse(call.done())
- self.assertFalse(call.cancelled())
- self.assertTrue(call.cancel())
- self.assertTrue(call.cancelled())
- self.assertEqual(grpc.StatusCode.CANCELLED, await call.code())
-
- async def test_early_cancel(self):
- call = self._stub.FullDuplexCall()
-
- # Cancels the RPC
- self.assertFalse(call.done())
- self.assertFalse(call.cancelled())
- self.assertTrue(call.cancel())
- self.assertTrue(call.cancelled())
- self.assertEqual(grpc.StatusCode.CANCELLED, await call.code())
-
- async def test_cancel_after_done_writing(self):
- call = self._stub.FullDuplexCall()
- await call.done_writing()
-
- # Cancels the RPC
- self.assertFalse(call.done())
- self.assertFalse(call.cancelled())
- self.assertTrue(call.cancel())
- self.assertTrue(call.cancelled())
- self.assertEqual(grpc.StatusCode.CANCELLED, await call.code())
-
- async def test_late_cancel(self):
- call = self._stub.FullDuplexCall()
- await call.done_writing()
- self.assertEqual(grpc.StatusCode.OK, await call.code())
-
- # Cancels the RPC
- self.assertTrue(call.done())
- self.assertFalse(call.cancelled())
- self.assertFalse(call.cancel())
- self.assertFalse(call.cancelled())
-
- # Status is still OK
- self.assertEqual(grpc.StatusCode.OK, await call.code())
-
- async def test_async_generator(self):
-
- async def request_generator():
- yield _STREAM_OUTPUT_REQUEST_ONE_RESPONSE
- yield _STREAM_OUTPUT_REQUEST_ONE_RESPONSE
-
- call = self._stub.FullDuplexCall(request_generator())
- async for response in call:
- self.assertEqual(_RESPONSE_PAYLOAD_SIZE, len(response.payload.body))
-
- self.assertEqual(await call.code(), grpc.StatusCode.OK)
-
- async def test_too_many_reads(self):
-
- async def request_generator():
- for _ in range(_NUM_STREAM_RESPONSES):
- yield _STREAM_OUTPUT_REQUEST_ONE_RESPONSE
-
- call = self._stub.FullDuplexCall(request_generator())
- for _ in range(_NUM_STREAM_RESPONSES):
- response = await call.read()
- self.assertEqual(_RESPONSE_PAYLOAD_SIZE, len(response.payload.body))
- self.assertIs(await call.read(), aio.EOF)
-
- self.assertEqual(await call.code(), grpc.StatusCode.OK)
- # After the RPC finished, the read should also produce EOF
- self.assertIs(await call.read(), aio.EOF)
-
- async def test_read_write_after_done_writing(self):
- call = self._stub.FullDuplexCall()
-
- # Writes two requests, and pending two requests
- await call.write(_STREAM_OUTPUT_REQUEST_ONE_RESPONSE)
- await call.write(_STREAM_OUTPUT_REQUEST_ONE_RESPONSE)
- await call.done_writing()
-
- # Further write should fail
- with self.assertRaises(asyncio.InvalidStateError):
- await call.write(_STREAM_OUTPUT_REQUEST_ONE_RESPONSE)
-
- # But read should be unaffected
- response = await call.read()
- self.assertEqual(_RESPONSE_PAYLOAD_SIZE, len(response.payload.body))
- response = await call.read()
- self.assertEqual(_RESPONSE_PAYLOAD_SIZE, len(response.payload.body))
-
- self.assertEqual(await call.code(), grpc.StatusCode.OK)
-
- async def test_error_in_async_generator(self):
- # Server will pause between responses
- request = messages_pb2.StreamingOutputCallRequest()
- request.response_parameters.append(
- messages_pb2.ResponseParameters(
- size=_RESPONSE_PAYLOAD_SIZE,
- interval_us=_RESPONSE_INTERVAL_US,
- ))
-
- # We expect the request iterator to receive the exception
- request_iterator_received_the_exception = asyncio.Event()
-
- async def request_iterator():
- with self.assertRaises(asyncio.CancelledError):
- for _ in range(_NUM_STREAM_RESPONSES):
- yield request
- await asyncio.sleep(_SHORT_TIMEOUT_S)
- request_iterator_received_the_exception.set()
-
- call = self._stub.FullDuplexCall(request_iterator())
-
- # Cancel the RPC after at least one response
- async def cancel_later():
- await asyncio.sleep(_SHORT_TIMEOUT_S * 2)
- call.cancel()
-
- cancel_later_task = self.loop.create_task(cancel_later())
-
- with self.assertRaises(asyncio.CancelledError):
- async for response in call:
- self.assertEqual(_RESPONSE_PAYLOAD_SIZE,
- len(response.payload.body))
-
- await request_iterator_received_the_exception.wait()
-
- self.assertEqual(grpc.StatusCode.CANCELLED, await call.code())
- # No failures in the cancel later task!
- await cancel_later_task
-
- async def test_normal_iterable_requests(self):
- requests = [_STREAM_OUTPUT_REQUEST_ONE_RESPONSE] * _NUM_STREAM_RESPONSES
-
- call = self._stub.FullDuplexCall(iter(requests))
- async for response in call:
- self.assertEqual(_RESPONSE_PAYLOAD_SIZE, len(response.payload.body))
-
- self.assertEqual(await call.code(), grpc.StatusCode.OK)
-
-
+from tests_aio.unit._constants import UNREACHABLE_TARGET
+
+_SHORT_TIMEOUT_S = datetime.timedelta(seconds=1).total_seconds()
+
+_NUM_STREAM_RESPONSES = 5
+_RESPONSE_PAYLOAD_SIZE = 42
+_REQUEST_PAYLOAD_SIZE = 7
+_LOCAL_CANCEL_DETAILS_EXPECTATION = 'Locally cancelled by application!'
+_RESPONSE_INTERVAL_US = int(_SHORT_TIMEOUT_S * 1000 * 1000)
+_INFINITE_INTERVAL_US = 2**31 - 1
+
+
+class _MulticallableTestMixin():
+
+ async def setUp(self):
+ address, self._server = await start_test_server()
+ self._channel = aio.insecure_channel(address)
+ self._stub = test_pb2_grpc.TestServiceStub(self._channel)
+
+ async def tearDown(self):
+ await self._channel.close()
+ await self._server.stop(None)
+
+
+class TestUnaryUnaryCall(_MulticallableTestMixin, AioTestBase):
+
+ async def test_call_to_string(self):
+ call = self._stub.UnaryCall(messages_pb2.SimpleRequest())
+
+ self.assertTrue(str(call) is not None)
+ self.assertTrue(repr(call) is not None)
+
+ await call
+
+ self.assertTrue(str(call) is not None)
+ self.assertTrue(repr(call) is not None)
+
+ async def test_call_ok(self):
+ call = self._stub.UnaryCall(messages_pb2.SimpleRequest())
+
+ self.assertFalse(call.done())
+
+ response = await call
+
+ self.assertTrue(call.done())
+ self.assertIsInstance(response, messages_pb2.SimpleResponse)
+ self.assertEqual(await call.code(), grpc.StatusCode.OK)
+
+ # Response is cached at call object level, reentrance
+ # returns again the same response
+ response_retry = await call
+ self.assertIs(response, response_retry)
+
+ async def test_call_rpc_error(self):
+ async with aio.insecure_channel(UNREACHABLE_TARGET) as channel:
+ stub = test_pb2_grpc.TestServiceStub(channel)
+
+ call = stub.UnaryCall(messages_pb2.SimpleRequest())
+
+ with self.assertRaises(aio.AioRpcError) as exception_context:
+ await call
+
+ self.assertEqual(grpc.StatusCode.UNAVAILABLE,
+ exception_context.exception.code())
+
+ self.assertTrue(call.done())
+ self.assertEqual(grpc.StatusCode.UNAVAILABLE, await call.code())
+
+ async def test_call_code_awaitable(self):
+ call = self._stub.UnaryCall(messages_pb2.SimpleRequest())
+ self.assertEqual(await call.code(), grpc.StatusCode.OK)
+
+ async def test_call_details_awaitable(self):
+ call = self._stub.UnaryCall(messages_pb2.SimpleRequest())
+ self.assertEqual('', await call.details())
+
+ async def test_call_initial_metadata_awaitable(self):
+ call = self._stub.UnaryCall(messages_pb2.SimpleRequest())
+ self.assertEqual(aio.Metadata(), await call.initial_metadata())
+
+ async def test_call_trailing_metadata_awaitable(self):
+ call = self._stub.UnaryCall(messages_pb2.SimpleRequest())
+ self.assertEqual(aio.Metadata(), await call.trailing_metadata())
+
+ async def test_call_initial_metadata_cancelable(self):
+ coro_started = asyncio.Event()
+ call = self._stub.UnaryCall(messages_pb2.SimpleRequest())
+
+ async def coro():
+ coro_started.set()
+ await call.initial_metadata()
+
+ task = self.loop.create_task(coro())
+ await coro_started.wait()
+ task.cancel()
+
+ # Test that initial metadata can still be asked thought
+ # a cancellation happened with the previous task
+ self.assertEqual(aio.Metadata(), await call.initial_metadata())
+
+ async def test_call_initial_metadata_multiple_waiters(self):
+ call = self._stub.UnaryCall(messages_pb2.SimpleRequest())
+
+ async def coro():
+ return await call.initial_metadata()
+
+ task1 = self.loop.create_task(coro())
+ task2 = self.loop.create_task(coro())
+
+ await call
+ expected = [aio.Metadata() for _ in range(2)]
+ self.assertEqual(expected, await asyncio.gather(*[task1, task2]))
+
+ async def test_call_code_cancelable(self):
+ coro_started = asyncio.Event()
+ call = self._stub.UnaryCall(messages_pb2.SimpleRequest())
+
+ async def coro():
+ coro_started.set()
+ await call.code()
+
+ task = self.loop.create_task(coro())
+ await coro_started.wait()
+ task.cancel()
+
+ # Test that code can still be asked thought
+ # a cancellation happened with the previous task
+ self.assertEqual(grpc.StatusCode.OK, await call.code())
+
+ async def test_call_code_multiple_waiters(self):
+ call = self._stub.UnaryCall(messages_pb2.SimpleRequest())
+
+ async def coro():
+ return await call.code()
+
+ task1 = self.loop.create_task(coro())
+ task2 = self.loop.create_task(coro())
+
+ await call
+
+ self.assertEqual([grpc.StatusCode.OK, grpc.StatusCode.OK], await
+ asyncio.gather(task1, task2))
+
+ async def test_cancel_unary_unary(self):
+ call = self._stub.UnaryCall(messages_pb2.SimpleRequest())
+
+ self.assertFalse(call.cancelled())
+
+ self.assertTrue(call.cancel())
+ self.assertFalse(call.cancel())
+
+ with self.assertRaises(asyncio.CancelledError):
+ await call
+
+ # The info in the RpcError should match the info in Call object.
+ self.assertTrue(call.cancelled())
+ self.assertEqual(await call.code(), grpc.StatusCode.CANCELLED)
+ self.assertEqual(await call.details(),
+ 'Locally cancelled by application!')
+
+ async def test_cancel_unary_unary_in_task(self):
+ coro_started = asyncio.Event()
+ call = self._stub.EmptyCall(messages_pb2.SimpleRequest())
+
+ async def another_coro():
+ coro_started.set()
+ await call
+
+ task = self.loop.create_task(another_coro())
+ await coro_started.wait()
+
+ self.assertFalse(task.done())
+ task.cancel()
+
+ self.assertEqual(grpc.StatusCode.CANCELLED, await call.code())
+
+ with self.assertRaises(asyncio.CancelledError):
+ await task
+
+ async def test_passing_credentials_fails_over_insecure_channel(self):
+ call_credentials = grpc.composite_call_credentials(
+ grpc.access_token_call_credentials("abc"),
+ grpc.access_token_call_credentials("def"),
+ )
+ with self.assertRaisesRegex(
+ aio.UsageError,
+ "Call credentials are only valid on secure channels"):
+ self._stub.UnaryCall(messages_pb2.SimpleRequest(),
+ credentials=call_credentials)
+
+
+class TestUnaryStreamCall(_MulticallableTestMixin, AioTestBase):
+
+ async def test_call_rpc_error(self):
+ channel = aio.insecure_channel(UNREACHABLE_TARGET)
+ request = messages_pb2.StreamingOutputCallRequest()
+ stub = test_pb2_grpc.TestServiceStub(channel)
+ call = stub.StreamingOutputCall(request)
+
+ with self.assertRaises(aio.AioRpcError) as exception_context:
+ async for response in call:
+ pass
+
+ self.assertEqual(grpc.StatusCode.UNAVAILABLE,
+ exception_context.exception.code())
+
+ self.assertTrue(call.done())
+ self.assertEqual(grpc.StatusCode.UNAVAILABLE, await call.code())
+ await channel.close()
+
+ async def test_cancel_unary_stream(self):
+ # Prepares the request
+ request = messages_pb2.StreamingOutputCallRequest()
+ for _ in range(_NUM_STREAM_RESPONSES):
+ request.response_parameters.append(
+ messages_pb2.ResponseParameters(
+ size=_RESPONSE_PAYLOAD_SIZE,
+ interval_us=_RESPONSE_INTERVAL_US,
+ ))
+
+ # Invokes the actual RPC
+ call = self._stub.StreamingOutputCall(request)
+ self.assertFalse(call.cancelled())
+
+ response = await call.read()
+ self.assertIs(type(response), messages_pb2.StreamingOutputCallResponse)
+ self.assertEqual(_RESPONSE_PAYLOAD_SIZE, len(response.payload.body))
+
+ self.assertTrue(call.cancel())
+ self.assertEqual(grpc.StatusCode.CANCELLED, await call.code())
+ self.assertEqual(_LOCAL_CANCEL_DETAILS_EXPECTATION, await
+ call.details())
+ self.assertFalse(call.cancel())
+
+ with self.assertRaises(asyncio.CancelledError):
+ await call.read()
+ self.assertTrue(call.cancelled())
+
+ async def test_multiple_cancel_unary_stream(self):
+ # Prepares the request
+ request = messages_pb2.StreamingOutputCallRequest()
+ for _ in range(_NUM_STREAM_RESPONSES):
+ request.response_parameters.append(
+ messages_pb2.ResponseParameters(
+ size=_RESPONSE_PAYLOAD_SIZE,
+ interval_us=_RESPONSE_INTERVAL_US,
+ ))
+
+ # Invokes the actual RPC
+ call = self._stub.StreamingOutputCall(request)
+ self.assertFalse(call.cancelled())
+
+ response = await call.read()
+ self.assertIs(type(response), messages_pb2.StreamingOutputCallResponse)
+ self.assertEqual(_RESPONSE_PAYLOAD_SIZE, len(response.payload.body))
+
+ self.assertTrue(call.cancel())
+ self.assertFalse(call.cancel())
+ self.assertFalse(call.cancel())
+ self.assertFalse(call.cancel())
+
+ with self.assertRaises(asyncio.CancelledError):
+ await call.read()
+
+ async def test_early_cancel_unary_stream(self):
+ """Test cancellation before receiving messages."""
+ # Prepares the request
+ request = messages_pb2.StreamingOutputCallRequest()
+ for _ in range(_NUM_STREAM_RESPONSES):
+ request.response_parameters.append(
+ messages_pb2.ResponseParameters(
+ size=_RESPONSE_PAYLOAD_SIZE,
+ interval_us=_RESPONSE_INTERVAL_US,
+ ))
+
+ # Invokes the actual RPC
+ call = self._stub.StreamingOutputCall(request)
+
+ self.assertFalse(call.cancelled())
+ self.assertTrue(call.cancel())
+ self.assertFalse(call.cancel())
+
+ with self.assertRaises(asyncio.CancelledError):
+ await call.read()
+
+ self.assertTrue(call.cancelled())
+
+ self.assertEqual(grpc.StatusCode.CANCELLED, await call.code())
+ self.assertEqual(_LOCAL_CANCEL_DETAILS_EXPECTATION, await
+ call.details())
+
+ async def test_late_cancel_unary_stream(self):
+ """Test cancellation after received all messages."""
+ # Prepares the request
+ request = messages_pb2.StreamingOutputCallRequest()
+ for _ in range(_NUM_STREAM_RESPONSES):
+ request.response_parameters.append(
+ messages_pb2.ResponseParameters(size=_RESPONSE_PAYLOAD_SIZE,))
+
+ # Invokes the actual RPC
+ call = self._stub.StreamingOutputCall(request)
+
+ for _ in range(_NUM_STREAM_RESPONSES):
+ response = await call.read()
+ self.assertIs(type(response),
+ messages_pb2.StreamingOutputCallResponse)
+ self.assertEqual(_RESPONSE_PAYLOAD_SIZE, len(response.payload.body))
+
+ # After all messages received, it is possible that the final state
+ # is received or on its way. It's basically a data race, so our
+ # expectation here is do not crash :)
+ call.cancel()
+ self.assertIn(await call.code(),
+ [grpc.StatusCode.OK, grpc.StatusCode.CANCELLED])
+
+ async def test_too_many_reads_unary_stream(self):
+ """Test calling read after received all messages fails."""
+ # Prepares the request
+ request = messages_pb2.StreamingOutputCallRequest()
+ for _ in range(_NUM_STREAM_RESPONSES):
+ request.response_parameters.append(
+ messages_pb2.ResponseParameters(size=_RESPONSE_PAYLOAD_SIZE,))
+
+ # Invokes the actual RPC
+ call = self._stub.StreamingOutputCall(request)
+
+ for _ in range(_NUM_STREAM_RESPONSES):
+ response = await call.read()
+ self.assertIs(type(response),
+ messages_pb2.StreamingOutputCallResponse)
+ self.assertEqual(_RESPONSE_PAYLOAD_SIZE, len(response.payload.body))
+ self.assertIs(await call.read(), aio.EOF)
+
+ # After the RPC is finished, further reads will lead to exception.
+ self.assertEqual(await call.code(), grpc.StatusCode.OK)
+ self.assertIs(await call.read(), aio.EOF)
+
+ async def test_unary_stream_async_generator(self):
+ """Sunny day test case for unary_stream."""
+ # Prepares the request
+ request = messages_pb2.StreamingOutputCallRequest()
+ for _ in range(_NUM_STREAM_RESPONSES):
+ request.response_parameters.append(
+ messages_pb2.ResponseParameters(size=_RESPONSE_PAYLOAD_SIZE,))
+
+ # Invokes the actual RPC
+ call = self._stub.StreamingOutputCall(request)
+ self.assertFalse(call.cancelled())
+
+ async for response in call:
+ self.assertIs(type(response),
+ messages_pb2.StreamingOutputCallResponse)
+ self.assertEqual(_RESPONSE_PAYLOAD_SIZE, len(response.payload.body))
+
+ self.assertEqual(await call.code(), grpc.StatusCode.OK)
+
+ async def test_cancel_unary_stream_in_task_using_read(self):
+ coro_started = asyncio.Event()
+
+ # Configs the server method to block forever
+ request = messages_pb2.StreamingOutputCallRequest()
+ request.response_parameters.append(
+ messages_pb2.ResponseParameters(
+ size=_RESPONSE_PAYLOAD_SIZE,
+ interval_us=_INFINITE_INTERVAL_US,
+ ))
+
+ # Invokes the actual RPC
+ call = self._stub.StreamingOutputCall(request)
+
+ async def another_coro():
+ coro_started.set()
+ await call.read()
+
+ task = self.loop.create_task(another_coro())
+ await coro_started.wait()
+
+ self.assertFalse(task.done())
+ task.cancel()
+
+ self.assertEqual(grpc.StatusCode.CANCELLED, await call.code())
+
+ with self.assertRaises(asyncio.CancelledError):
+ await task
+
+ async def test_cancel_unary_stream_in_task_using_async_for(self):
+ coro_started = asyncio.Event()
+
+ # Configs the server method to block forever
+ request = messages_pb2.StreamingOutputCallRequest()
+ request.response_parameters.append(
+ messages_pb2.ResponseParameters(
+ size=_RESPONSE_PAYLOAD_SIZE,
+ interval_us=_INFINITE_INTERVAL_US,
+ ))
+
+ # Invokes the actual RPC
+ call = self._stub.StreamingOutputCall(request)
+
+ async def another_coro():
+ coro_started.set()
+ async for _ in call:
+ pass
+
+ task = self.loop.create_task(another_coro())
+ await coro_started.wait()
+
+ self.assertFalse(task.done())
+ task.cancel()
+
+ self.assertEqual(grpc.StatusCode.CANCELLED, await call.code())
+
+ with self.assertRaises(asyncio.CancelledError):
+ await task
+
+ async def test_time_remaining(self):
+ request = messages_pb2.StreamingOutputCallRequest()
+ # First message comes back immediately
+ request.response_parameters.append(
+ messages_pb2.ResponseParameters(size=_RESPONSE_PAYLOAD_SIZE,))
+ # Second message comes back after a unit of wait time
+ request.response_parameters.append(
+ messages_pb2.ResponseParameters(
+ size=_RESPONSE_PAYLOAD_SIZE,
+ interval_us=_RESPONSE_INTERVAL_US,
+ ))
+
+ call = self._stub.StreamingOutputCall(request,
+ timeout=_SHORT_TIMEOUT_S * 2)
+
+ response = await call.read()
+ self.assertEqual(_RESPONSE_PAYLOAD_SIZE, len(response.payload.body))
+
+ # Should be around the same as the timeout
+ remained_time = call.time_remaining()
+ self.assertGreater(remained_time, _SHORT_TIMEOUT_S * 3 / 2)
+ self.assertLess(remained_time, _SHORT_TIMEOUT_S * 5 / 2)
+
+ response = await call.read()
+ self.assertEqual(_RESPONSE_PAYLOAD_SIZE, len(response.payload.body))
+
+ # Should be around the timeout minus a unit of wait time
+ remained_time = call.time_remaining()
+ self.assertGreater(remained_time, _SHORT_TIMEOUT_S / 2)
+ self.assertLess(remained_time, _SHORT_TIMEOUT_S * 3 / 2)
+
+ self.assertEqual(grpc.StatusCode.OK, await call.code())
+
+
+class TestStreamUnaryCall(_MulticallableTestMixin, AioTestBase):
+
+ async def test_cancel_stream_unary(self):
+ call = self._stub.StreamingInputCall()
+
+ # Prepares the request
+ payload = messages_pb2.Payload(body=b'\0' * _REQUEST_PAYLOAD_SIZE)
+ request = messages_pb2.StreamingInputCallRequest(payload=payload)
+
+ # Sends out requests
+ for _ in range(_NUM_STREAM_RESPONSES):
+ await call.write(request)
+
+ # Cancels the RPC
+ self.assertFalse(call.done())
+ self.assertFalse(call.cancelled())
+ self.assertTrue(call.cancel())
+ self.assertTrue(call.cancelled())
+
+ await call.done_writing()
+
+ with self.assertRaises(asyncio.CancelledError):
+ await call
+
+ async def test_early_cancel_stream_unary(self):
+ call = self._stub.StreamingInputCall()
+
+ # Cancels the RPC
+ self.assertFalse(call.done())
+ self.assertFalse(call.cancelled())
+ self.assertTrue(call.cancel())
+ self.assertTrue(call.cancelled())
+
+ with self.assertRaises(asyncio.InvalidStateError):
+ await call.write(messages_pb2.StreamingInputCallRequest())
+
+ # Should be no-op
+ await call.done_writing()
+
+ with self.assertRaises(asyncio.CancelledError):
+ await call
+
+ async def test_write_after_done_writing(self):
+ call = self._stub.StreamingInputCall()
+
+ # Prepares the request
+ payload = messages_pb2.Payload(body=b'\0' * _REQUEST_PAYLOAD_SIZE)
+ request = messages_pb2.StreamingInputCallRequest(payload=payload)
+
+ # Sends out requests
+ for _ in range(_NUM_STREAM_RESPONSES):
+ await call.write(request)
+
+ # Should be no-op
+ await call.done_writing()
+
+ with self.assertRaises(asyncio.InvalidStateError):
+ await call.write(messages_pb2.StreamingInputCallRequest())
+
+ response = await call
+ self.assertIsInstance(response, messages_pb2.StreamingInputCallResponse)
+ self.assertEqual(_NUM_STREAM_RESPONSES * _REQUEST_PAYLOAD_SIZE,
+ response.aggregated_payload_size)
+
+ self.assertEqual(await call.code(), grpc.StatusCode.OK)
+
+ async def test_error_in_async_generator(self):
+ # Server will pause between responses
+ request = messages_pb2.StreamingOutputCallRequest()
+ request.response_parameters.append(
+ messages_pb2.ResponseParameters(
+ size=_RESPONSE_PAYLOAD_SIZE,
+ interval_us=_RESPONSE_INTERVAL_US,
+ ))
+
+ # We expect the request iterator to receive the exception
+ request_iterator_received_the_exception = asyncio.Event()
+
+ async def request_iterator():
+ with self.assertRaises(asyncio.CancelledError):
+ for _ in range(_NUM_STREAM_RESPONSES):
+ yield request
+ await asyncio.sleep(_SHORT_TIMEOUT_S)
+ request_iterator_received_the_exception.set()
+
+ call = self._stub.StreamingInputCall(request_iterator())
+
+ # Cancel the RPC after at least one response
+ async def cancel_later():
+ await asyncio.sleep(_SHORT_TIMEOUT_S * 2)
+ call.cancel()
+
+ cancel_later_task = self.loop.create_task(cancel_later())
+
+ with self.assertRaises(asyncio.CancelledError):
+ await call
+
+ await request_iterator_received_the_exception.wait()
+
+ # No failures in the cancel later task!
+ await cancel_later_task
+
+ async def test_normal_iterable_requests(self):
+ # Prepares the request
+ payload = messages_pb2.Payload(body=b'\0' * _REQUEST_PAYLOAD_SIZE)
+ request = messages_pb2.StreamingInputCallRequest(payload=payload)
+ requests = [request] * _NUM_STREAM_RESPONSES
+
+ # Sends out requests
+ call = self._stub.StreamingInputCall(requests)
+
+ # RPC should succeed
+ response = await call
+ self.assertIsInstance(response, messages_pb2.StreamingInputCallResponse)
+ self.assertEqual(_NUM_STREAM_RESPONSES * _REQUEST_PAYLOAD_SIZE,
+ response.aggregated_payload_size)
+
+ self.assertEqual(await call.code(), grpc.StatusCode.OK)
+
+ async def test_call_rpc_error(self):
+ async with aio.insecure_channel(UNREACHABLE_TARGET) as channel:
+ stub = test_pb2_grpc.TestServiceStub(channel)
+
+ # The error should be raised automatically without any traffic.
+ call = stub.StreamingInputCall()
+ with self.assertRaises(aio.AioRpcError) as exception_context:
+ await call
+
+ self.assertEqual(grpc.StatusCode.UNAVAILABLE,
+ exception_context.exception.code())
+
+ self.assertTrue(call.done())
+ self.assertEqual(grpc.StatusCode.UNAVAILABLE, await call.code())
+
+ async def test_timeout(self):
+ call = self._stub.StreamingInputCall(timeout=_SHORT_TIMEOUT_S)
+
+ # The error should be raised automatically without any traffic.
+ with self.assertRaises(aio.AioRpcError) as exception_context:
+ await call
+
+ rpc_error = exception_context.exception
+ self.assertEqual(grpc.StatusCode.DEADLINE_EXCEEDED, rpc_error.code())
+ self.assertTrue(call.done())
+ self.assertEqual(grpc.StatusCode.DEADLINE_EXCEEDED, await call.code())
+
+
+# Prepares the request that stream in a ping-pong manner.
+_STREAM_OUTPUT_REQUEST_ONE_RESPONSE = messages_pb2.StreamingOutputCallRequest()
+_STREAM_OUTPUT_REQUEST_ONE_RESPONSE.response_parameters.append(
+ messages_pb2.ResponseParameters(size=_RESPONSE_PAYLOAD_SIZE))
+
+
+class TestStreamStreamCall(_MulticallableTestMixin, AioTestBase):
+
+ async def test_cancel(self):
+ # Invokes the actual RPC
+ call = self._stub.FullDuplexCall()
+
+ for _ in range(_NUM_STREAM_RESPONSES):
+ await call.write(_STREAM_OUTPUT_REQUEST_ONE_RESPONSE)
+ response = await call.read()
+ self.assertIsInstance(response,
+ messages_pb2.StreamingOutputCallResponse)
+ self.assertEqual(_RESPONSE_PAYLOAD_SIZE, len(response.payload.body))
+
+ # Cancels the RPC
+ self.assertFalse(call.done())
+ self.assertFalse(call.cancelled())
+ self.assertTrue(call.cancel())
+ self.assertTrue(call.cancelled())
+ self.assertEqual(grpc.StatusCode.CANCELLED, await call.code())
+
+ async def test_cancel_with_pending_read(self):
+ call = self._stub.FullDuplexCall()
+
+ await call.write(_STREAM_OUTPUT_REQUEST_ONE_RESPONSE)
+
+ # Cancels the RPC
+ self.assertFalse(call.done())
+ self.assertFalse(call.cancelled())
+ self.assertTrue(call.cancel())
+ self.assertTrue(call.cancelled())
+ self.assertEqual(grpc.StatusCode.CANCELLED, await call.code())
+
+ async def test_cancel_with_ongoing_read(self):
+ call = self._stub.FullDuplexCall()
+ coro_started = asyncio.Event()
+
+ async def read_coro():
+ coro_started.set()
+ await call.read()
+
+ read_task = self.loop.create_task(read_coro())
+ await coro_started.wait()
+ self.assertFalse(read_task.done())
+
+ # Cancels the RPC
+ self.assertFalse(call.done())
+ self.assertFalse(call.cancelled())
+ self.assertTrue(call.cancel())
+ self.assertTrue(call.cancelled())
+ self.assertEqual(grpc.StatusCode.CANCELLED, await call.code())
+
+ async def test_early_cancel(self):
+ call = self._stub.FullDuplexCall()
+
+ # Cancels the RPC
+ self.assertFalse(call.done())
+ self.assertFalse(call.cancelled())
+ self.assertTrue(call.cancel())
+ self.assertTrue(call.cancelled())
+ self.assertEqual(grpc.StatusCode.CANCELLED, await call.code())
+
+ async def test_cancel_after_done_writing(self):
+ call = self._stub.FullDuplexCall()
+ await call.done_writing()
+
+ # Cancels the RPC
+ self.assertFalse(call.done())
+ self.assertFalse(call.cancelled())
+ self.assertTrue(call.cancel())
+ self.assertTrue(call.cancelled())
+ self.assertEqual(grpc.StatusCode.CANCELLED, await call.code())
+
+ async def test_late_cancel(self):
+ call = self._stub.FullDuplexCall()
+ await call.done_writing()
+ self.assertEqual(grpc.StatusCode.OK, await call.code())
+
+ # Cancels the RPC
+ self.assertTrue(call.done())
+ self.assertFalse(call.cancelled())
+ self.assertFalse(call.cancel())
+ self.assertFalse(call.cancelled())
+
+ # Status is still OK
+ self.assertEqual(grpc.StatusCode.OK, await call.code())
+
+ async def test_async_generator(self):
+
+ async def request_generator():
+ yield _STREAM_OUTPUT_REQUEST_ONE_RESPONSE
+ yield _STREAM_OUTPUT_REQUEST_ONE_RESPONSE
+
+ call = self._stub.FullDuplexCall(request_generator())
+ async for response in call:
+ self.assertEqual(_RESPONSE_PAYLOAD_SIZE, len(response.payload.body))
+
+ self.assertEqual(await call.code(), grpc.StatusCode.OK)
+
+ async def test_too_many_reads(self):
+
+ async def request_generator():
+ for _ in range(_NUM_STREAM_RESPONSES):
+ yield _STREAM_OUTPUT_REQUEST_ONE_RESPONSE
+
+ call = self._stub.FullDuplexCall(request_generator())
+ for _ in range(_NUM_STREAM_RESPONSES):
+ response = await call.read()
+ self.assertEqual(_RESPONSE_PAYLOAD_SIZE, len(response.payload.body))
+ self.assertIs(await call.read(), aio.EOF)
+
+ self.assertEqual(await call.code(), grpc.StatusCode.OK)
+ # After the RPC finished, the read should also produce EOF
+ self.assertIs(await call.read(), aio.EOF)
+
+ async def test_read_write_after_done_writing(self):
+ call = self._stub.FullDuplexCall()
+
+ # Writes two requests, and pending two requests
+ await call.write(_STREAM_OUTPUT_REQUEST_ONE_RESPONSE)
+ await call.write(_STREAM_OUTPUT_REQUEST_ONE_RESPONSE)
+ await call.done_writing()
+
+ # Further write should fail
+ with self.assertRaises(asyncio.InvalidStateError):
+ await call.write(_STREAM_OUTPUT_REQUEST_ONE_RESPONSE)
+
+ # But read should be unaffected
+ response = await call.read()
+ self.assertEqual(_RESPONSE_PAYLOAD_SIZE, len(response.payload.body))
+ response = await call.read()
+ self.assertEqual(_RESPONSE_PAYLOAD_SIZE, len(response.payload.body))
+
+ self.assertEqual(await call.code(), grpc.StatusCode.OK)
+
+ async def test_error_in_async_generator(self):
+ # Server will pause between responses
+ request = messages_pb2.StreamingOutputCallRequest()
+ request.response_parameters.append(
+ messages_pb2.ResponseParameters(
+ size=_RESPONSE_PAYLOAD_SIZE,
+ interval_us=_RESPONSE_INTERVAL_US,
+ ))
+
+ # We expect the request iterator to receive the exception
+ request_iterator_received_the_exception = asyncio.Event()
+
+ async def request_iterator():
+ with self.assertRaises(asyncio.CancelledError):
+ for _ in range(_NUM_STREAM_RESPONSES):
+ yield request
+ await asyncio.sleep(_SHORT_TIMEOUT_S)
+ request_iterator_received_the_exception.set()
+
+ call = self._stub.FullDuplexCall(request_iterator())
+
+ # Cancel the RPC after at least one response
+ async def cancel_later():
+ await asyncio.sleep(_SHORT_TIMEOUT_S * 2)
+ call.cancel()
+
+ cancel_later_task = self.loop.create_task(cancel_later())
+
+ with self.assertRaises(asyncio.CancelledError):
+ async for response in call:
+ self.assertEqual(_RESPONSE_PAYLOAD_SIZE,
+ len(response.payload.body))
+
+ await request_iterator_received_the_exception.wait()
+
+ self.assertEqual(grpc.StatusCode.CANCELLED, await call.code())
+ # No failures in the cancel later task!
+ await cancel_later_task
+
+ async def test_normal_iterable_requests(self):
+ requests = [_STREAM_OUTPUT_REQUEST_ONE_RESPONSE] * _NUM_STREAM_RESPONSES
+
+ call = self._stub.FullDuplexCall(iter(requests))
+ async for response in call:
+ self.assertEqual(_RESPONSE_PAYLOAD_SIZE, len(response.payload.body))
+
+ self.assertEqual(await call.code(), grpc.StatusCode.OK)
+
+
if __name__ == '__main__':
- logging.basicConfig(level=logging.DEBUG)
+ logging.basicConfig(level=logging.DEBUG)
unittest.main(verbosity=2)
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/channel_argument_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/channel_argument_test.py
index ccf23d5cdf3..8bf2dc8b1f1 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/channel_argument_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/channel_argument_test.py
@@ -1,176 +1,176 @@
-# Copyright 2019 The gRPC Authors
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-"""Tests behavior around the Core channel arguments."""
-
-import asyncio
-import logging
-import platform
-import random
-import errno
-import unittest
-
-import grpc
-from grpc.experimental import aio
-
-from src.proto.grpc.testing import messages_pb2, test_pb2_grpc
-from tests.unit.framework import common
-from tests_aio.unit._test_base import AioTestBase
-from tests_aio.unit._test_server import start_test_server
-
-_RANDOM_SEED = 42
-
-_ENABLE_REUSE_PORT = 'SO_REUSEPORT enabled'
-_DISABLE_REUSE_PORT = 'SO_REUSEPORT disabled'
-_SOCKET_OPT_SO_REUSEPORT = 'grpc.so_reuseport'
-_OPTIONS = (
- (_ENABLE_REUSE_PORT, ((_SOCKET_OPT_SO_REUSEPORT, 1),)),
- (_DISABLE_REUSE_PORT, ((_SOCKET_OPT_SO_REUSEPORT, 0),)),
-)
-
-_NUM_SERVER_CREATED = 5
-
-_GRPC_ARG_MAX_RECEIVE_MESSAGE_LENGTH = 'grpc.max_receive_message_length'
-_MAX_MESSAGE_LENGTH = 1024
-
-_ADDRESS_TOKEN_ERRNO = errno.EADDRINUSE, errno.ENOSR
-
-
-class _TestPointerWrapper(object):
-
- def __int__(self):
- return 123456
-
-
-_TEST_CHANNEL_ARGS = (
- ('arg1', b'bytes_val'),
- ('arg2', 'str_val'),
- ('arg3', 1),
- (b'arg4', 'str_val'),
- ('arg6', _TestPointerWrapper()),
-)
-
-_INVALID_TEST_CHANNEL_ARGS = [
- {
- 'foo': 'bar'
- },
- (('key',),),
- 'str',
-]
-
-
-async def test_if_reuse_port_enabled(server: aio.Server):
- port = server.add_insecure_port('localhost:0')
- await server.start()
-
- try:
- with common.bound_socket(
- bind_address='localhost',
- port=port,
- listen=False,
- ) as (unused_host, bound_port):
- assert bound_port == port
- except OSError as e:
- if e.errno in _ADDRESS_TOKEN_ERRNO:
- return False
- else:
- logging.exception(e)
- raise
- else:
- return True
-
-
-class TestChannelArgument(AioTestBase):
-
- async def setUp(self):
- random.seed(_RANDOM_SEED)
-
- @unittest.skipIf(platform.system() == 'Windows',
- 'SO_REUSEPORT only available in Linux-like OS.')
- async def test_server_so_reuse_port_is_set_properly(self):
-
- async def test_body():
- fact, options = random.choice(_OPTIONS)
- server = aio.server(options=options)
- try:
- result = await test_if_reuse_port_enabled(server)
- if fact == _ENABLE_REUSE_PORT and not result:
- self.fail(
- 'Enabled reuse port in options, but not observed in socket'
- )
- elif fact == _DISABLE_REUSE_PORT and result:
- self.fail(
- 'Disabled reuse port in options, but observed in socket'
- )
- finally:
- await server.stop(None)
-
- # Creating a lot of servers concurrently
- await asyncio.gather(*(test_body() for _ in range(_NUM_SERVER_CREATED)))
-
- async def test_client(self):
- # Do not segfault, or raise exception!
- channel = aio.insecure_channel('[::]:0', options=_TEST_CHANNEL_ARGS)
- await channel.close()
-
- async def test_server(self):
- # Do not segfault, or raise exception!
- server = aio.server(options=_TEST_CHANNEL_ARGS)
- await server.stop(None)
-
- async def test_invalid_client_args(self):
- for invalid_arg in _INVALID_TEST_CHANNEL_ARGS:
- self.assertRaises((ValueError, TypeError),
- aio.insecure_channel,
- '[::]:0',
- options=invalid_arg)
-
- async def test_max_message_length_applied(self):
- address, server = await start_test_server()
-
- async with aio.insecure_channel(
- address,
- options=((_GRPC_ARG_MAX_RECEIVE_MESSAGE_LENGTH,
- _MAX_MESSAGE_LENGTH),)) as channel:
- stub = test_pb2_grpc.TestServiceStub(channel)
-
- request = messages_pb2.StreamingOutputCallRequest()
- # First request will pass
- request.response_parameters.append(
- messages_pb2.ResponseParameters(size=_MAX_MESSAGE_LENGTH // 2,))
- # Second request should fail
- request.response_parameters.append(
- messages_pb2.ResponseParameters(size=_MAX_MESSAGE_LENGTH * 2,))
-
- call = stub.StreamingOutputCall(request)
-
- response = await call.read()
- self.assertEqual(_MAX_MESSAGE_LENGTH // 2,
- len(response.payload.body))
-
- with self.assertRaises(aio.AioRpcError) as exception_context:
- await call.read()
- rpc_error = exception_context.exception
- self.assertEqual(grpc.StatusCode.RESOURCE_EXHAUSTED,
- rpc_error.code())
- self.assertIn(str(_MAX_MESSAGE_LENGTH), rpc_error.details())
-
- self.assertEqual(grpc.StatusCode.RESOURCE_EXHAUSTED, await
- call.code())
-
- await server.stop(None)
-
-
-if __name__ == '__main__':
- logging.basicConfig(level=logging.DEBUG)
- unittest.main(verbosity=2)
+# Copyright 2019 The gRPC Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+"""Tests behavior around the Core channel arguments."""
+
+import asyncio
+import logging
+import platform
+import random
+import errno
+import unittest
+
+import grpc
+from grpc.experimental import aio
+
+from src.proto.grpc.testing import messages_pb2, test_pb2_grpc
+from tests.unit.framework import common
+from tests_aio.unit._test_base import AioTestBase
+from tests_aio.unit._test_server import start_test_server
+
+_RANDOM_SEED = 42
+
+_ENABLE_REUSE_PORT = 'SO_REUSEPORT enabled'
+_DISABLE_REUSE_PORT = 'SO_REUSEPORT disabled'
+_SOCKET_OPT_SO_REUSEPORT = 'grpc.so_reuseport'
+_OPTIONS = (
+ (_ENABLE_REUSE_PORT, ((_SOCKET_OPT_SO_REUSEPORT, 1),)),
+ (_DISABLE_REUSE_PORT, ((_SOCKET_OPT_SO_REUSEPORT, 0),)),
+)
+
+_NUM_SERVER_CREATED = 5
+
+_GRPC_ARG_MAX_RECEIVE_MESSAGE_LENGTH = 'grpc.max_receive_message_length'
+_MAX_MESSAGE_LENGTH = 1024
+
+_ADDRESS_TOKEN_ERRNO = errno.EADDRINUSE, errno.ENOSR
+
+
+class _TestPointerWrapper(object):
+
+ def __int__(self):
+ return 123456
+
+
+_TEST_CHANNEL_ARGS = (
+ ('arg1', b'bytes_val'),
+ ('arg2', 'str_val'),
+ ('arg3', 1),
+ (b'arg4', 'str_val'),
+ ('arg6', _TestPointerWrapper()),
+)
+
+_INVALID_TEST_CHANNEL_ARGS = [
+ {
+ 'foo': 'bar'
+ },
+ (('key',),),
+ 'str',
+]
+
+
+async def test_if_reuse_port_enabled(server: aio.Server):
+ port = server.add_insecure_port('localhost:0')
+ await server.start()
+
+ try:
+ with common.bound_socket(
+ bind_address='localhost',
+ port=port,
+ listen=False,
+ ) as (unused_host, bound_port):
+ assert bound_port == port
+ except OSError as e:
+ if e.errno in _ADDRESS_TOKEN_ERRNO:
+ return False
+ else:
+ logging.exception(e)
+ raise
+ else:
+ return True
+
+
+class TestChannelArgument(AioTestBase):
+
+ async def setUp(self):
+ random.seed(_RANDOM_SEED)
+
+ @unittest.skipIf(platform.system() == 'Windows',
+ 'SO_REUSEPORT only available in Linux-like OS.')
+ async def test_server_so_reuse_port_is_set_properly(self):
+
+ async def test_body():
+ fact, options = random.choice(_OPTIONS)
+ server = aio.server(options=options)
+ try:
+ result = await test_if_reuse_port_enabled(server)
+ if fact == _ENABLE_REUSE_PORT and not result:
+ self.fail(
+ 'Enabled reuse port in options, but not observed in socket'
+ )
+ elif fact == _DISABLE_REUSE_PORT and result:
+ self.fail(
+ 'Disabled reuse port in options, but observed in socket'
+ )
+ finally:
+ await server.stop(None)
+
+ # Creating a lot of servers concurrently
+ await asyncio.gather(*(test_body() for _ in range(_NUM_SERVER_CREATED)))
+
+ async def test_client(self):
+ # Do not segfault, or raise exception!
+ channel = aio.insecure_channel('[::]:0', options=_TEST_CHANNEL_ARGS)
+ await channel.close()
+
+ async def test_server(self):
+ # Do not segfault, or raise exception!
+ server = aio.server(options=_TEST_CHANNEL_ARGS)
+ await server.stop(None)
+
+ async def test_invalid_client_args(self):
+ for invalid_arg in _INVALID_TEST_CHANNEL_ARGS:
+ self.assertRaises((ValueError, TypeError),
+ aio.insecure_channel,
+ '[::]:0',
+ options=invalid_arg)
+
+ async def test_max_message_length_applied(self):
+ address, server = await start_test_server()
+
+ async with aio.insecure_channel(
+ address,
+ options=((_GRPC_ARG_MAX_RECEIVE_MESSAGE_LENGTH,
+ _MAX_MESSAGE_LENGTH),)) as channel:
+ stub = test_pb2_grpc.TestServiceStub(channel)
+
+ request = messages_pb2.StreamingOutputCallRequest()
+ # First request will pass
+ request.response_parameters.append(
+ messages_pb2.ResponseParameters(size=_MAX_MESSAGE_LENGTH // 2,))
+ # Second request should fail
+ request.response_parameters.append(
+ messages_pb2.ResponseParameters(size=_MAX_MESSAGE_LENGTH * 2,))
+
+ call = stub.StreamingOutputCall(request)
+
+ response = await call.read()
+ self.assertEqual(_MAX_MESSAGE_LENGTH // 2,
+ len(response.payload.body))
+
+ with self.assertRaises(aio.AioRpcError) as exception_context:
+ await call.read()
+ rpc_error = exception_context.exception
+ self.assertEqual(grpc.StatusCode.RESOURCE_EXHAUSTED,
+ rpc_error.code())
+ self.assertIn(str(_MAX_MESSAGE_LENGTH), rpc_error.details())
+
+ self.assertEqual(grpc.StatusCode.RESOURCE_EXHAUSTED, await
+ call.code())
+
+ await server.stop(None)
+
+
+if __name__ == '__main__':
+ logging.basicConfig(level=logging.DEBUG)
+ unittest.main(verbosity=2)
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/channel_ready_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/channel_ready_test.py
index 391df3a6126..75e4703d869 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/channel_ready_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/channel_ready_test.py
@@ -1,69 +1,69 @@
-# Copyright 2020 The gRPC Authors
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-"""Testing the channel_ready function."""
-
-import asyncio
-import gc
-import logging
-import socket
-import time
-import unittest
-
-import grpc
-from grpc.experimental import aio
-
-from tests.unit.framework.common import get_socket, test_constants
-from tests_aio.unit import _common
-from tests_aio.unit._test_base import AioTestBase
-from tests_aio.unit._test_server import start_test_server
-
-
-class TestChannelReady(AioTestBase):
-
- async def setUp(self):
- address, self._port, self._socket = get_socket(
- listen=False, sock_options=(socket.SO_REUSEADDR,))
- self._channel = aio.insecure_channel(f"{address}:{self._port}")
- self._socket.close()
-
- async def tearDown(self):
- await self._channel.close()
-
- async def test_channel_ready_success(self):
- # Start `channel_ready` as another Task
- channel_ready_task = self.loop.create_task(
- self._channel.channel_ready())
-
- # Wait for TRANSIENT_FAILURE
- await _common.block_until_certain_state(
- self._channel, grpc.ChannelConnectivity.TRANSIENT_FAILURE)
-
- try:
- # Start the server
- _, server = await start_test_server(port=self._port)
-
- # The RPC should recover itself
- await channel_ready_task
- finally:
- await server.stop(None)
-
- async def test_channel_ready_blocked(self):
- with self.assertRaises(asyncio.TimeoutError):
- await asyncio.wait_for(self._channel.channel_ready(),
- test_constants.SHORT_TIMEOUT)
-
-
-if __name__ == '__main__':
- logging.basicConfig(level=logging.DEBUG)
- unittest.main(verbosity=2)
+# Copyright 2020 The gRPC Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+"""Testing the channel_ready function."""
+
+import asyncio
+import gc
+import logging
+import socket
+import time
+import unittest
+
+import grpc
+from grpc.experimental import aio
+
+from tests.unit.framework.common import get_socket, test_constants
+from tests_aio.unit import _common
+from tests_aio.unit._test_base import AioTestBase
+from tests_aio.unit._test_server import start_test_server
+
+
+class TestChannelReady(AioTestBase):
+
+ async def setUp(self):
+ address, self._port, self._socket = get_socket(
+ listen=False, sock_options=(socket.SO_REUSEADDR,))
+ self._channel = aio.insecure_channel(f"{address}:{self._port}")
+ self._socket.close()
+
+ async def tearDown(self):
+ await self._channel.close()
+
+ async def test_channel_ready_success(self):
+ # Start `channel_ready` as another Task
+ channel_ready_task = self.loop.create_task(
+ self._channel.channel_ready())
+
+ # Wait for TRANSIENT_FAILURE
+ await _common.block_until_certain_state(
+ self._channel, grpc.ChannelConnectivity.TRANSIENT_FAILURE)
+
+ try:
+ # Start the server
+ _, server = await start_test_server(port=self._port)
+
+ # The RPC should recover itself
+ await channel_ready_task
+ finally:
+ await server.stop(None)
+
+ async def test_channel_ready_blocked(self):
+ with self.assertRaises(asyncio.TimeoutError):
+ await asyncio.wait_for(self._channel.channel_ready(),
+ test_constants.SHORT_TIMEOUT)
+
+
+if __name__ == '__main__':
+ logging.basicConfig(level=logging.DEBUG)
+ unittest.main(verbosity=2)
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/channel_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/channel_test.py
index d09a4c193ea..58cd555491d 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/channel_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/channel_test.py
@@ -11,220 +11,220 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-"""Tests behavior of the grpc.aio.Channel class."""
-
+"""Tests behavior of the grpc.aio.Channel class."""
+
import logging
-import os
+import os
import unittest
import grpc
-from grpc.experimental import aio
+from grpc.experimental import aio
-from src.proto.grpc.testing import messages_pb2, test_pb2_grpc
+from src.proto.grpc.testing import messages_pb2, test_pb2_grpc
from tests.unit.framework.common import test_constants
-from tests_aio.unit._constants import (UNARY_CALL_WITH_SLEEP_VALUE,
- UNREACHABLE_TARGET)
-from tests_aio.unit._test_base import AioTestBase
+from tests_aio.unit._constants import (UNARY_CALL_WITH_SLEEP_VALUE,
+ UNREACHABLE_TARGET)
+from tests_aio.unit._test_base import AioTestBase
from tests_aio.unit._test_server import start_test_server
_UNARY_CALL_METHOD = '/grpc.testing.TestService/UnaryCall'
-_UNARY_CALL_METHOD_WITH_SLEEP = '/grpc.testing.TestService/UnaryCallWithSleep'
-_STREAMING_OUTPUT_CALL_METHOD = '/grpc.testing.TestService/StreamingOutputCall'
+_UNARY_CALL_METHOD_WITH_SLEEP = '/grpc.testing.TestService/UnaryCallWithSleep'
+_STREAMING_OUTPUT_CALL_METHOD = '/grpc.testing.TestService/StreamingOutputCall'
-_INVOCATION_METADATA = (
- ('x-grpc-test-echo-initial', 'initial-md-value'),
- ('x-grpc-test-echo-trailing-bin', b'\x00\x02'),
-)
+_INVOCATION_METADATA = (
+ ('x-grpc-test-echo-initial', 'initial-md-value'),
+ ('x-grpc-test-echo-trailing-bin', b'\x00\x02'),
+)
-_NUM_STREAM_RESPONSES = 5
-_REQUEST_PAYLOAD_SIZE = 7
-_RESPONSE_PAYLOAD_SIZE = 42
+_NUM_STREAM_RESPONSES = 5
+_REQUEST_PAYLOAD_SIZE = 7
+_RESPONSE_PAYLOAD_SIZE = 42
-class TestChannel(AioTestBase):
+class TestChannel(AioTestBase):
- async def setUp(self):
- self._server_target, self._server = await start_test_server()
+ async def setUp(self):
+ self._server_target, self._server = await start_test_server()
- async def tearDown(self):
- await self._server.stop(None)
+ async def tearDown(self):
+ await self._server.stop(None)
- async def test_async_context(self):
- async with aio.insecure_channel(self._server_target) as channel:
- hi = channel.unary_unary(
- _UNARY_CALL_METHOD,
- request_serializer=messages_pb2.SimpleRequest.SerializeToString,
- response_deserializer=messages_pb2.SimpleResponse.FromString)
- await hi(messages_pb2.SimpleRequest())
+ async def test_async_context(self):
+ async with aio.insecure_channel(self._server_target) as channel:
+ hi = channel.unary_unary(
+ _UNARY_CALL_METHOD,
+ request_serializer=messages_pb2.SimpleRequest.SerializeToString,
+ response_deserializer=messages_pb2.SimpleResponse.FromString)
+ await hi(messages_pb2.SimpleRequest())
- async def test_unary_unary(self):
- async with aio.insecure_channel(self._server_target) as channel:
+ async def test_unary_unary(self):
+ async with aio.insecure_channel(self._server_target) as channel:
hi = channel.unary_unary(
_UNARY_CALL_METHOD,
request_serializer=messages_pb2.SimpleRequest.SerializeToString,
response_deserializer=messages_pb2.SimpleResponse.FromString)
response = await hi(messages_pb2.SimpleRequest())
- self.assertIsInstance(response, messages_pb2.SimpleResponse)
-
- async def test_unary_call_times_out(self):
- async with aio.insecure_channel(self._server_target) as channel:
- hi = channel.unary_unary(
- _UNARY_CALL_METHOD_WITH_SLEEP,
- request_serializer=messages_pb2.SimpleRequest.SerializeToString,
- response_deserializer=messages_pb2.SimpleResponse.FromString,
- )
-
- with self.assertRaises(grpc.RpcError) as exception_context:
- await hi(messages_pb2.SimpleRequest(),
- timeout=UNARY_CALL_WITH_SLEEP_VALUE / 2)
-
- _, details = grpc.StatusCode.DEADLINE_EXCEEDED.value # pylint: disable=unused-variable
- self.assertEqual(grpc.StatusCode.DEADLINE_EXCEEDED,
- exception_context.exception.code())
- self.assertEqual(details.title(),
- exception_context.exception.details())
- self.assertIsNotNone(exception_context.exception.initial_metadata())
- self.assertIsNotNone(
- exception_context.exception.trailing_metadata())
-
- @unittest.skipIf(os.name == 'nt',
- 'TODO: https://github.com/grpc/grpc/issues/21658')
- async def test_unary_call_does_not_times_out(self):
- async with aio.insecure_channel(self._server_target) as channel:
- hi = channel.unary_unary(
- _UNARY_CALL_METHOD_WITH_SLEEP,
- request_serializer=messages_pb2.SimpleRequest.SerializeToString,
- response_deserializer=messages_pb2.SimpleResponse.FromString,
- )
-
- call = hi(messages_pb2.SimpleRequest(),
- timeout=UNARY_CALL_WITH_SLEEP_VALUE * 5)
- self.assertEqual(await call.code(), grpc.StatusCode.OK)
-
- async def test_unary_stream(self):
- channel = aio.insecure_channel(self._server_target)
- stub = test_pb2_grpc.TestServiceStub(channel)
-
- # Prepares the request
- request = messages_pb2.StreamingOutputCallRequest()
- for _ in range(_NUM_STREAM_RESPONSES):
- request.response_parameters.append(
- messages_pb2.ResponseParameters(size=_RESPONSE_PAYLOAD_SIZE))
-
- # Invokes the actual RPC
- call = stub.StreamingOutputCall(request)
-
- # Validates the responses
- response_cnt = 0
- async for response in call:
- response_cnt += 1
- self.assertIs(type(response),
- messages_pb2.StreamingOutputCallResponse)
- self.assertEqual(_RESPONSE_PAYLOAD_SIZE, len(response.payload.body))
-
- self.assertEqual(_NUM_STREAM_RESPONSES, response_cnt)
- self.assertEqual(await call.code(), grpc.StatusCode.OK)
- await channel.close()
-
- async def test_stream_unary_using_write(self):
- channel = aio.insecure_channel(self._server_target)
- stub = test_pb2_grpc.TestServiceStub(channel)
-
- # Invokes the actual RPC
- call = stub.StreamingInputCall()
-
- # Prepares the request
- payload = messages_pb2.Payload(body=b'\0' * _REQUEST_PAYLOAD_SIZE)
- request = messages_pb2.StreamingInputCallRequest(payload=payload)
-
- # Sends out requests
- for _ in range(_NUM_STREAM_RESPONSES):
- await call.write(request)
- await call.done_writing()
-
- # Validates the responses
- response = await call
- self.assertIsInstance(response, messages_pb2.StreamingInputCallResponse)
- self.assertEqual(_NUM_STREAM_RESPONSES * _REQUEST_PAYLOAD_SIZE,
- response.aggregated_payload_size)
-
- self.assertEqual(await call.code(), grpc.StatusCode.OK)
- await channel.close()
-
- async def test_stream_unary_using_async_gen(self):
- channel = aio.insecure_channel(self._server_target)
- stub = test_pb2_grpc.TestServiceStub(channel)
-
- # Prepares the request
- payload = messages_pb2.Payload(body=b'\0' * _REQUEST_PAYLOAD_SIZE)
- request = messages_pb2.StreamingInputCallRequest(payload=payload)
-
- async def gen():
- for _ in range(_NUM_STREAM_RESPONSES):
- yield request
-
- # Invokes the actual RPC
- call = stub.StreamingInputCall(gen())
-
- # Validates the responses
- response = await call
- self.assertIsInstance(response, messages_pb2.StreamingInputCallResponse)
- self.assertEqual(_NUM_STREAM_RESPONSES * _REQUEST_PAYLOAD_SIZE,
- response.aggregated_payload_size)
-
- self.assertEqual(await call.code(), grpc.StatusCode.OK)
- await channel.close()
-
- async def test_stream_stream_using_read_write(self):
- channel = aio.insecure_channel(self._server_target)
- stub = test_pb2_grpc.TestServiceStub(channel)
-
- # Invokes the actual RPC
- call = stub.FullDuplexCall()
-
- # Prepares the request
- request = messages_pb2.StreamingOutputCallRequest()
- request.response_parameters.append(
- messages_pb2.ResponseParameters(size=_RESPONSE_PAYLOAD_SIZE))
-
- for _ in range(_NUM_STREAM_RESPONSES):
- await call.write(request)
- response = await call.read()
- self.assertIsInstance(response,
- messages_pb2.StreamingOutputCallResponse)
- self.assertEqual(_RESPONSE_PAYLOAD_SIZE, len(response.payload.body))
-
- await call.done_writing()
-
- self.assertEqual(grpc.StatusCode.OK, await call.code())
- await channel.close()
-
- async def test_stream_stream_using_async_gen(self):
- channel = aio.insecure_channel(self._server_target)
- stub = test_pb2_grpc.TestServiceStub(channel)
-
- # Prepares the request
- request = messages_pb2.StreamingOutputCallRequest()
- request.response_parameters.append(
- messages_pb2.ResponseParameters(size=_RESPONSE_PAYLOAD_SIZE))
-
- async def gen():
- for _ in range(_NUM_STREAM_RESPONSES):
- yield request
-
- # Invokes the actual RPC
- call = stub.FullDuplexCall(gen())
-
- async for response in call:
- self.assertIsInstance(response,
- messages_pb2.StreamingOutputCallResponse)
- self.assertEqual(_RESPONSE_PAYLOAD_SIZE, len(response.payload.body))
-
- self.assertEqual(grpc.StatusCode.OK, await call.code())
- await channel.close()
-
-
+ self.assertIsInstance(response, messages_pb2.SimpleResponse)
+
+ async def test_unary_call_times_out(self):
+ async with aio.insecure_channel(self._server_target) as channel:
+ hi = channel.unary_unary(
+ _UNARY_CALL_METHOD_WITH_SLEEP,
+ request_serializer=messages_pb2.SimpleRequest.SerializeToString,
+ response_deserializer=messages_pb2.SimpleResponse.FromString,
+ )
+
+ with self.assertRaises(grpc.RpcError) as exception_context:
+ await hi(messages_pb2.SimpleRequest(),
+ timeout=UNARY_CALL_WITH_SLEEP_VALUE / 2)
+
+ _, details = grpc.StatusCode.DEADLINE_EXCEEDED.value # pylint: disable=unused-variable
+ self.assertEqual(grpc.StatusCode.DEADLINE_EXCEEDED,
+ exception_context.exception.code())
+ self.assertEqual(details.title(),
+ exception_context.exception.details())
+ self.assertIsNotNone(exception_context.exception.initial_metadata())
+ self.assertIsNotNone(
+ exception_context.exception.trailing_metadata())
+
+ @unittest.skipIf(os.name == 'nt',
+ 'TODO: https://github.com/grpc/grpc/issues/21658')
+ async def test_unary_call_does_not_times_out(self):
+ async with aio.insecure_channel(self._server_target) as channel:
+ hi = channel.unary_unary(
+ _UNARY_CALL_METHOD_WITH_SLEEP,
+ request_serializer=messages_pb2.SimpleRequest.SerializeToString,
+ response_deserializer=messages_pb2.SimpleResponse.FromString,
+ )
+
+ call = hi(messages_pb2.SimpleRequest(),
+ timeout=UNARY_CALL_WITH_SLEEP_VALUE * 5)
+ self.assertEqual(await call.code(), grpc.StatusCode.OK)
+
+ async def test_unary_stream(self):
+ channel = aio.insecure_channel(self._server_target)
+ stub = test_pb2_grpc.TestServiceStub(channel)
+
+ # Prepares the request
+ request = messages_pb2.StreamingOutputCallRequest()
+ for _ in range(_NUM_STREAM_RESPONSES):
+ request.response_parameters.append(
+ messages_pb2.ResponseParameters(size=_RESPONSE_PAYLOAD_SIZE))
+
+ # Invokes the actual RPC
+ call = stub.StreamingOutputCall(request)
+
+ # Validates the responses
+ response_cnt = 0
+ async for response in call:
+ response_cnt += 1
+ self.assertIs(type(response),
+ messages_pb2.StreamingOutputCallResponse)
+ self.assertEqual(_RESPONSE_PAYLOAD_SIZE, len(response.payload.body))
+
+ self.assertEqual(_NUM_STREAM_RESPONSES, response_cnt)
+ self.assertEqual(await call.code(), grpc.StatusCode.OK)
+ await channel.close()
+
+ async def test_stream_unary_using_write(self):
+ channel = aio.insecure_channel(self._server_target)
+ stub = test_pb2_grpc.TestServiceStub(channel)
+
+ # Invokes the actual RPC
+ call = stub.StreamingInputCall()
+
+ # Prepares the request
+ payload = messages_pb2.Payload(body=b'\0' * _REQUEST_PAYLOAD_SIZE)
+ request = messages_pb2.StreamingInputCallRequest(payload=payload)
+
+ # Sends out requests
+ for _ in range(_NUM_STREAM_RESPONSES):
+ await call.write(request)
+ await call.done_writing()
+
+ # Validates the responses
+ response = await call
+ self.assertIsInstance(response, messages_pb2.StreamingInputCallResponse)
+ self.assertEqual(_NUM_STREAM_RESPONSES * _REQUEST_PAYLOAD_SIZE,
+ response.aggregated_payload_size)
+
+ self.assertEqual(await call.code(), grpc.StatusCode.OK)
+ await channel.close()
+
+ async def test_stream_unary_using_async_gen(self):
+ channel = aio.insecure_channel(self._server_target)
+ stub = test_pb2_grpc.TestServiceStub(channel)
+
+ # Prepares the request
+ payload = messages_pb2.Payload(body=b'\0' * _REQUEST_PAYLOAD_SIZE)
+ request = messages_pb2.StreamingInputCallRequest(payload=payload)
+
+ async def gen():
+ for _ in range(_NUM_STREAM_RESPONSES):
+ yield request
+
+ # Invokes the actual RPC
+ call = stub.StreamingInputCall(gen())
+
+ # Validates the responses
+ response = await call
+ self.assertIsInstance(response, messages_pb2.StreamingInputCallResponse)
+ self.assertEqual(_NUM_STREAM_RESPONSES * _REQUEST_PAYLOAD_SIZE,
+ response.aggregated_payload_size)
+
+ self.assertEqual(await call.code(), grpc.StatusCode.OK)
+ await channel.close()
+
+ async def test_stream_stream_using_read_write(self):
+ channel = aio.insecure_channel(self._server_target)
+ stub = test_pb2_grpc.TestServiceStub(channel)
+
+ # Invokes the actual RPC
+ call = stub.FullDuplexCall()
+
+ # Prepares the request
+ request = messages_pb2.StreamingOutputCallRequest()
+ request.response_parameters.append(
+ messages_pb2.ResponseParameters(size=_RESPONSE_PAYLOAD_SIZE))
+
+ for _ in range(_NUM_STREAM_RESPONSES):
+ await call.write(request)
+ response = await call.read()
+ self.assertIsInstance(response,
+ messages_pb2.StreamingOutputCallResponse)
+ self.assertEqual(_RESPONSE_PAYLOAD_SIZE, len(response.payload.body))
+
+ await call.done_writing()
+
+ self.assertEqual(grpc.StatusCode.OK, await call.code())
+ await channel.close()
+
+ async def test_stream_stream_using_async_gen(self):
+ channel = aio.insecure_channel(self._server_target)
+ stub = test_pb2_grpc.TestServiceStub(channel)
+
+ # Prepares the request
+ request = messages_pb2.StreamingOutputCallRequest()
+ request.response_parameters.append(
+ messages_pb2.ResponseParameters(size=_RESPONSE_PAYLOAD_SIZE))
+
+ async def gen():
+ for _ in range(_NUM_STREAM_RESPONSES):
+ yield request
+
+ # Invokes the actual RPC
+ call = stub.FullDuplexCall(gen())
+
+ async for response in call:
+ self.assertIsInstance(response,
+ messages_pb2.StreamingOutputCallResponse)
+ self.assertEqual(_RESPONSE_PAYLOAD_SIZE, len(response.payload.body))
+
+ self.assertEqual(grpc.StatusCode.OK, await call.code())
+ await channel.close()
+
+
if __name__ == '__main__':
- logging.basicConfig(level=logging.DEBUG)
+ logging.basicConfig(level=logging.DEBUG)
unittest.main(verbosity=2)
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/client_stream_stream_interceptor_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/client_stream_stream_interceptor_test.py
index ccf5855de13..ce6a7bc04d6 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/client_stream_stream_interceptor_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/client_stream_stream_interceptor_test.py
@@ -1,202 +1,202 @@
-# Copyright 2020 The gRPC Authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-import logging
-import unittest
-
-import grpc
-
-from grpc.experimental import aio
-from tests_aio.unit._common import CountingResponseIterator, CountingRequestIterator
-from tests_aio.unit._test_server import start_test_server
-from tests_aio.unit._test_base import AioTestBase
-from src.proto.grpc.testing import messages_pb2, test_pb2_grpc
-
-_NUM_STREAM_RESPONSES = 5
-_NUM_STREAM_REQUESTS = 5
-_RESPONSE_PAYLOAD_SIZE = 7
-
-
-class _StreamStreamInterceptorEmpty(aio.StreamStreamClientInterceptor):
-
- async def intercept_stream_stream(self, continuation, client_call_details,
- request_iterator):
- return await continuation(client_call_details, request_iterator)
-
- def assert_in_final_state(self, test: unittest.TestCase):
- pass
-
-
-class _StreamStreamInterceptorWithRequestAndResponseIterator(
- aio.StreamStreamClientInterceptor):
-
- async def intercept_stream_stream(self, continuation, client_call_details,
- request_iterator):
- self.request_iterator = CountingRequestIterator(request_iterator)
- call = await continuation(client_call_details, self.request_iterator)
- self.response_iterator = CountingResponseIterator(call)
- return self.response_iterator
-
- def assert_in_final_state(self, test: unittest.TestCase):
- test.assertEqual(_NUM_STREAM_REQUESTS,
- self.request_iterator.request_cnt)
- test.assertEqual(_NUM_STREAM_RESPONSES,
- self.response_iterator.response_cnt)
-
-
-class TestStreamStreamClientInterceptor(AioTestBase):
-
- async def setUp(self):
- self._server_target, self._server = await start_test_server()
-
- async def tearDown(self):
- await self._server.stop(None)
-
- async def test_intercepts(self):
-
- for interceptor_class in (
- _StreamStreamInterceptorEmpty,
- _StreamStreamInterceptorWithRequestAndResponseIterator):
-
- with self.subTest(name=interceptor_class):
- interceptor = interceptor_class()
- channel = aio.insecure_channel(self._server_target,
- interceptors=[interceptor])
- stub = test_pb2_grpc.TestServiceStub(channel)
-
- # Prepares the request
- request = messages_pb2.StreamingOutputCallRequest()
- request.response_parameters.append(
- messages_pb2.ResponseParameters(
- size=_RESPONSE_PAYLOAD_SIZE))
-
- async def request_iterator():
- for _ in range(_NUM_STREAM_REQUESTS):
- yield request
-
- call = stub.FullDuplexCall(request_iterator())
-
- await call.wait_for_connection()
-
- response_cnt = 0
- async for response in call:
- response_cnt += 1
- self.assertIsInstance(
- response, messages_pb2.StreamingOutputCallResponse)
- self.assertEqual(_RESPONSE_PAYLOAD_SIZE,
- len(response.payload.body))
-
- self.assertEqual(response_cnt, _NUM_STREAM_RESPONSES)
- self.assertEqual(await call.code(), grpc.StatusCode.OK)
- self.assertEqual(await call.initial_metadata(), aio.Metadata())
- self.assertEqual(await call.trailing_metadata(), aio.Metadata())
- self.assertEqual(await call.details(), '')
- self.assertEqual(await call.debug_error_string(), '')
- self.assertEqual(call.cancel(), False)
- self.assertEqual(call.cancelled(), False)
- self.assertEqual(call.done(), True)
-
- interceptor.assert_in_final_state(self)
-
- await channel.close()
-
- async def test_intercepts_using_write_and_read(self):
- for interceptor_class in (
- _StreamStreamInterceptorEmpty,
- _StreamStreamInterceptorWithRequestAndResponseIterator):
-
- with self.subTest(name=interceptor_class):
- interceptor = interceptor_class()
- channel = aio.insecure_channel(self._server_target,
- interceptors=[interceptor])
- stub = test_pb2_grpc.TestServiceStub(channel)
-
- # Prepares the request
- request = messages_pb2.StreamingOutputCallRequest()
- request.response_parameters.append(
- messages_pb2.ResponseParameters(
- size=_RESPONSE_PAYLOAD_SIZE))
-
- call = stub.FullDuplexCall()
-
- for _ in range(_NUM_STREAM_RESPONSES):
- await call.write(request)
- response = await call.read()
- self.assertIsInstance(
- response, messages_pb2.StreamingOutputCallResponse)
- self.assertEqual(_RESPONSE_PAYLOAD_SIZE,
- len(response.payload.body))
-
- await call.done_writing()
-
- self.assertEqual(await call.code(), grpc.StatusCode.OK)
- self.assertEqual(await call.initial_metadata(), aio.Metadata())
- self.assertEqual(await call.trailing_metadata(), aio.Metadata())
- self.assertEqual(await call.details(), '')
- self.assertEqual(await call.debug_error_string(), '')
- self.assertEqual(call.cancel(), False)
- self.assertEqual(call.cancelled(), False)
- self.assertEqual(call.done(), True)
-
- interceptor.assert_in_final_state(self)
-
- await channel.close()
-
- async def test_multiple_interceptors_request_iterator(self):
- for interceptor_class in (
- _StreamStreamInterceptorEmpty,
- _StreamStreamInterceptorWithRequestAndResponseIterator):
-
- with self.subTest(name=interceptor_class):
-
- interceptors = [interceptor_class(), interceptor_class()]
- channel = aio.insecure_channel(self._server_target,
- interceptors=interceptors)
- stub = test_pb2_grpc.TestServiceStub(channel)
-
- # Prepares the request
- request = messages_pb2.StreamingOutputCallRequest()
- request.response_parameters.append(
- messages_pb2.ResponseParameters(
- size=_RESPONSE_PAYLOAD_SIZE))
-
- call = stub.FullDuplexCall()
-
- for _ in range(_NUM_STREAM_RESPONSES):
- await call.write(request)
- response = await call.read()
- self.assertIsInstance(
- response, messages_pb2.StreamingOutputCallResponse)
- self.assertEqual(_RESPONSE_PAYLOAD_SIZE,
- len(response.payload.body))
-
- await call.done_writing()
-
- self.assertEqual(await call.code(), grpc.StatusCode.OK)
- self.assertEqual(await call.initial_metadata(), aio.Metadata())
- self.assertEqual(await call.trailing_metadata(), aio.Metadata())
- self.assertEqual(await call.details(), '')
- self.assertEqual(await call.debug_error_string(), '')
- self.assertEqual(call.cancel(), False)
- self.assertEqual(call.cancelled(), False)
- self.assertEqual(call.done(), True)
-
- for interceptor in interceptors:
- interceptor.assert_in_final_state(self)
-
- await channel.close()
-
-
-if __name__ == '__main__':
- logging.basicConfig(level=logging.DEBUG)
- unittest.main(verbosity=2)
+# Copyright 2020 The gRPC Authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+import logging
+import unittest
+
+import grpc
+
+from grpc.experimental import aio
+from tests_aio.unit._common import CountingResponseIterator, CountingRequestIterator
+from tests_aio.unit._test_server import start_test_server
+from tests_aio.unit._test_base import AioTestBase
+from src.proto.grpc.testing import messages_pb2, test_pb2_grpc
+
+_NUM_STREAM_RESPONSES = 5
+_NUM_STREAM_REQUESTS = 5
+_RESPONSE_PAYLOAD_SIZE = 7
+
+
+class _StreamStreamInterceptorEmpty(aio.StreamStreamClientInterceptor):
+
+ async def intercept_stream_stream(self, continuation, client_call_details,
+ request_iterator):
+ return await continuation(client_call_details, request_iterator)
+
+ def assert_in_final_state(self, test: unittest.TestCase):
+ pass
+
+
+class _StreamStreamInterceptorWithRequestAndResponseIterator(
+ aio.StreamStreamClientInterceptor):
+
+ async def intercept_stream_stream(self, continuation, client_call_details,
+ request_iterator):
+ self.request_iterator = CountingRequestIterator(request_iterator)
+ call = await continuation(client_call_details, self.request_iterator)
+ self.response_iterator = CountingResponseIterator(call)
+ return self.response_iterator
+
+ def assert_in_final_state(self, test: unittest.TestCase):
+ test.assertEqual(_NUM_STREAM_REQUESTS,
+ self.request_iterator.request_cnt)
+ test.assertEqual(_NUM_STREAM_RESPONSES,
+ self.response_iterator.response_cnt)
+
+
+class TestStreamStreamClientInterceptor(AioTestBase):
+
+ async def setUp(self):
+ self._server_target, self._server = await start_test_server()
+
+ async def tearDown(self):
+ await self._server.stop(None)
+
+ async def test_intercepts(self):
+
+ for interceptor_class in (
+ _StreamStreamInterceptorEmpty,
+ _StreamStreamInterceptorWithRequestAndResponseIterator):
+
+ with self.subTest(name=interceptor_class):
+ interceptor = interceptor_class()
+ channel = aio.insecure_channel(self._server_target,
+ interceptors=[interceptor])
+ stub = test_pb2_grpc.TestServiceStub(channel)
+
+ # Prepares the request
+ request = messages_pb2.StreamingOutputCallRequest()
+ request.response_parameters.append(
+ messages_pb2.ResponseParameters(
+ size=_RESPONSE_PAYLOAD_SIZE))
+
+ async def request_iterator():
+ for _ in range(_NUM_STREAM_REQUESTS):
+ yield request
+
+ call = stub.FullDuplexCall(request_iterator())
+
+ await call.wait_for_connection()
+
+ response_cnt = 0
+ async for response in call:
+ response_cnt += 1
+ self.assertIsInstance(
+ response, messages_pb2.StreamingOutputCallResponse)
+ self.assertEqual(_RESPONSE_PAYLOAD_SIZE,
+ len(response.payload.body))
+
+ self.assertEqual(response_cnt, _NUM_STREAM_RESPONSES)
+ self.assertEqual(await call.code(), grpc.StatusCode.OK)
+ self.assertEqual(await call.initial_metadata(), aio.Metadata())
+ self.assertEqual(await call.trailing_metadata(), aio.Metadata())
+ self.assertEqual(await call.details(), '')
+ self.assertEqual(await call.debug_error_string(), '')
+ self.assertEqual(call.cancel(), False)
+ self.assertEqual(call.cancelled(), False)
+ self.assertEqual(call.done(), True)
+
+ interceptor.assert_in_final_state(self)
+
+ await channel.close()
+
+ async def test_intercepts_using_write_and_read(self):
+ for interceptor_class in (
+ _StreamStreamInterceptorEmpty,
+ _StreamStreamInterceptorWithRequestAndResponseIterator):
+
+ with self.subTest(name=interceptor_class):
+ interceptor = interceptor_class()
+ channel = aio.insecure_channel(self._server_target,
+ interceptors=[interceptor])
+ stub = test_pb2_grpc.TestServiceStub(channel)
+
+ # Prepares the request
+ request = messages_pb2.StreamingOutputCallRequest()
+ request.response_parameters.append(
+ messages_pb2.ResponseParameters(
+ size=_RESPONSE_PAYLOAD_SIZE))
+
+ call = stub.FullDuplexCall()
+
+ for _ in range(_NUM_STREAM_RESPONSES):
+ await call.write(request)
+ response = await call.read()
+ self.assertIsInstance(
+ response, messages_pb2.StreamingOutputCallResponse)
+ self.assertEqual(_RESPONSE_PAYLOAD_SIZE,
+ len(response.payload.body))
+
+ await call.done_writing()
+
+ self.assertEqual(await call.code(), grpc.StatusCode.OK)
+ self.assertEqual(await call.initial_metadata(), aio.Metadata())
+ self.assertEqual(await call.trailing_metadata(), aio.Metadata())
+ self.assertEqual(await call.details(), '')
+ self.assertEqual(await call.debug_error_string(), '')
+ self.assertEqual(call.cancel(), False)
+ self.assertEqual(call.cancelled(), False)
+ self.assertEqual(call.done(), True)
+
+ interceptor.assert_in_final_state(self)
+
+ await channel.close()
+
+ async def test_multiple_interceptors_request_iterator(self):
+ for interceptor_class in (
+ _StreamStreamInterceptorEmpty,
+ _StreamStreamInterceptorWithRequestAndResponseIterator):
+
+ with self.subTest(name=interceptor_class):
+
+ interceptors = [interceptor_class(), interceptor_class()]
+ channel = aio.insecure_channel(self._server_target,
+ interceptors=interceptors)
+ stub = test_pb2_grpc.TestServiceStub(channel)
+
+ # Prepares the request
+ request = messages_pb2.StreamingOutputCallRequest()
+ request.response_parameters.append(
+ messages_pb2.ResponseParameters(
+ size=_RESPONSE_PAYLOAD_SIZE))
+
+ call = stub.FullDuplexCall()
+
+ for _ in range(_NUM_STREAM_RESPONSES):
+ await call.write(request)
+ response = await call.read()
+ self.assertIsInstance(
+ response, messages_pb2.StreamingOutputCallResponse)
+ self.assertEqual(_RESPONSE_PAYLOAD_SIZE,
+ len(response.payload.body))
+
+ await call.done_writing()
+
+ self.assertEqual(await call.code(), grpc.StatusCode.OK)
+ self.assertEqual(await call.initial_metadata(), aio.Metadata())
+ self.assertEqual(await call.trailing_metadata(), aio.Metadata())
+ self.assertEqual(await call.details(), '')
+ self.assertEqual(await call.debug_error_string(), '')
+ self.assertEqual(call.cancel(), False)
+ self.assertEqual(call.cancelled(), False)
+ self.assertEqual(call.done(), True)
+
+ for interceptor in interceptors:
+ interceptor.assert_in_final_state(self)
+
+ await channel.close()
+
+
+if __name__ == '__main__':
+ logging.basicConfig(level=logging.DEBUG)
+ unittest.main(verbosity=2)
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/client_stream_unary_interceptor_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/client_stream_unary_interceptor_test.py
index 0c07e2ce745..b9a04af00dc 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/client_stream_unary_interceptor_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/client_stream_unary_interceptor_test.py
@@ -1,517 +1,517 @@
-# Copyright 2020 The gRPC Authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-import asyncio
-import logging
-import unittest
-import datetime
-
-import grpc
-
-from grpc.experimental import aio
-from tests_aio.unit._constants import UNREACHABLE_TARGET
-from tests_aio.unit._common import inject_callbacks
-from tests_aio.unit._common import CountingRequestIterator
-from tests_aio.unit._test_server import start_test_server
-from tests_aio.unit._test_base import AioTestBase
-from tests.unit.framework.common import test_constants
-from src.proto.grpc.testing import messages_pb2, test_pb2_grpc
-
-_SHORT_TIMEOUT_S = 1.0
-
-_NUM_STREAM_REQUESTS = 5
-_REQUEST_PAYLOAD_SIZE = 7
-_RESPONSE_INTERVAL_US = int(_SHORT_TIMEOUT_S * 1000 * 1000)
-
-
-class _StreamUnaryInterceptorEmpty(aio.StreamUnaryClientInterceptor):
-
- async def intercept_stream_unary(self, continuation, client_call_details,
- request_iterator):
- return await continuation(client_call_details, request_iterator)
-
- def assert_in_final_state(self, test: unittest.TestCase):
- pass
-
-
-class _StreamUnaryInterceptorWithRequestIterator(
- aio.StreamUnaryClientInterceptor):
-
- async def intercept_stream_unary(self, continuation, client_call_details,
- request_iterator):
- self.request_iterator = CountingRequestIterator(request_iterator)
- call = await continuation(client_call_details, self.request_iterator)
- return call
-
- def assert_in_final_state(self, test: unittest.TestCase):
- test.assertEqual(_NUM_STREAM_REQUESTS,
- self.request_iterator.request_cnt)
-
-
-class TestStreamUnaryClientInterceptor(AioTestBase):
-
- async def setUp(self):
- self._server_target, self._server = await start_test_server()
-
- async def tearDown(self):
- await self._server.stop(None)
-
- async def test_intercepts(self):
- for interceptor_class in (_StreamUnaryInterceptorEmpty,
- _StreamUnaryInterceptorWithRequestIterator):
-
- with self.subTest(name=interceptor_class):
- interceptor = interceptor_class()
- channel = aio.insecure_channel(self._server_target,
- interceptors=[interceptor])
- stub = test_pb2_grpc.TestServiceStub(channel)
-
- payload = messages_pb2.Payload(body=b'\0' *
- _REQUEST_PAYLOAD_SIZE)
- request = messages_pb2.StreamingInputCallRequest(
- payload=payload)
-
- async def request_iterator():
- for _ in range(_NUM_STREAM_REQUESTS):
- yield request
-
- call = stub.StreamingInputCall(request_iterator())
-
- response = await call
-
- self.assertEqual(_NUM_STREAM_REQUESTS * _REQUEST_PAYLOAD_SIZE,
- response.aggregated_payload_size)
- self.assertEqual(await call.code(), grpc.StatusCode.OK)
- self.assertEqual(await call.initial_metadata(), aio.Metadata())
- self.assertEqual(await call.trailing_metadata(), aio.Metadata())
- self.assertEqual(await call.details(), '')
- self.assertEqual(await call.debug_error_string(), '')
- self.assertEqual(call.cancel(), False)
- self.assertEqual(call.cancelled(), False)
- self.assertEqual(call.done(), True)
-
- interceptor.assert_in_final_state(self)
-
- await channel.close()
-
- async def test_intercepts_using_write(self):
- for interceptor_class in (_StreamUnaryInterceptorEmpty,
- _StreamUnaryInterceptorWithRequestIterator):
-
- with self.subTest(name=interceptor_class):
- interceptor = interceptor_class()
- channel = aio.insecure_channel(self._server_target,
- interceptors=[interceptor])
- stub = test_pb2_grpc.TestServiceStub(channel)
-
- payload = messages_pb2.Payload(body=b'\0' *
- _REQUEST_PAYLOAD_SIZE)
- request = messages_pb2.StreamingInputCallRequest(
- payload=payload)
-
- call = stub.StreamingInputCall()
-
- for _ in range(_NUM_STREAM_REQUESTS):
- await call.write(request)
-
- await call.done_writing()
-
- response = await call
-
- self.assertEqual(_NUM_STREAM_REQUESTS * _REQUEST_PAYLOAD_SIZE,
- response.aggregated_payload_size)
- self.assertEqual(await call.code(), grpc.StatusCode.OK)
- self.assertEqual(await call.initial_metadata(), aio.Metadata())
- self.assertEqual(await call.trailing_metadata(), aio.Metadata())
- self.assertEqual(await call.details(), '')
- self.assertEqual(await call.debug_error_string(), '')
- self.assertEqual(call.cancel(), False)
- self.assertEqual(call.cancelled(), False)
- self.assertEqual(call.done(), True)
-
- interceptor.assert_in_final_state(self)
-
- await channel.close()
-
- async def test_add_done_callback_interceptor_task_not_finished(self):
- for interceptor_class in (_StreamUnaryInterceptorEmpty,
- _StreamUnaryInterceptorWithRequestIterator):
-
- with self.subTest(name=interceptor_class):
- interceptor = interceptor_class()
-
- channel = aio.insecure_channel(self._server_target,
- interceptors=[interceptor])
- stub = test_pb2_grpc.TestServiceStub(channel)
-
- payload = messages_pb2.Payload(body=b'\0' *
- _REQUEST_PAYLOAD_SIZE)
- request = messages_pb2.StreamingInputCallRequest(
- payload=payload)
-
- async def request_iterator():
- for _ in range(_NUM_STREAM_REQUESTS):
- yield request
-
- call = stub.StreamingInputCall(request_iterator())
-
- validation = inject_callbacks(call)
-
- response = await call
-
- await validation
-
- await channel.close()
-
- async def test_add_done_callback_interceptor_task_finished(self):
- for interceptor_class in (_StreamUnaryInterceptorEmpty,
- _StreamUnaryInterceptorWithRequestIterator):
-
- with self.subTest(name=interceptor_class):
- interceptor = interceptor_class()
-
- channel = aio.insecure_channel(self._server_target,
- interceptors=[interceptor])
- stub = test_pb2_grpc.TestServiceStub(channel)
-
- payload = messages_pb2.Payload(body=b'\0' *
- _REQUEST_PAYLOAD_SIZE)
- request = messages_pb2.StreamingInputCallRequest(
- payload=payload)
-
- async def request_iterator():
- for _ in range(_NUM_STREAM_REQUESTS):
- yield request
-
- call = stub.StreamingInputCall(request_iterator())
-
- response = await call
-
- validation = inject_callbacks(call)
-
- await validation
-
- await channel.close()
-
- async def test_multiple_interceptors_request_iterator(self):
- for interceptor_class in (_StreamUnaryInterceptorEmpty,
- _StreamUnaryInterceptorWithRequestIterator):
-
- with self.subTest(name=interceptor_class):
-
- interceptors = [interceptor_class(), interceptor_class()]
- channel = aio.insecure_channel(self._server_target,
- interceptors=interceptors)
- stub = test_pb2_grpc.TestServiceStub(channel)
-
- payload = messages_pb2.Payload(body=b'\0' *
- _REQUEST_PAYLOAD_SIZE)
- request = messages_pb2.StreamingInputCallRequest(
- payload=payload)
-
- async def request_iterator():
- for _ in range(_NUM_STREAM_REQUESTS):
- yield request
-
- call = stub.StreamingInputCall(request_iterator())
-
- response = await call
-
- self.assertEqual(_NUM_STREAM_REQUESTS * _REQUEST_PAYLOAD_SIZE,
- response.aggregated_payload_size)
- self.assertEqual(await call.code(), grpc.StatusCode.OK)
- self.assertEqual(await call.initial_metadata(), aio.Metadata())
- self.assertEqual(await call.trailing_metadata(), aio.Metadata())
- self.assertEqual(await call.details(), '')
- self.assertEqual(await call.debug_error_string(), '')
- self.assertEqual(call.cancel(), False)
- self.assertEqual(call.cancelled(), False)
- self.assertEqual(call.done(), True)
-
- for interceptor in interceptors:
- interceptor.assert_in_final_state(self)
-
- await channel.close()
-
- async def test_intercepts_request_iterator_rpc_error(self):
- for interceptor_class in (_StreamUnaryInterceptorEmpty,
- _StreamUnaryInterceptorWithRequestIterator):
-
- with self.subTest(name=interceptor_class):
- channel = aio.insecure_channel(
- UNREACHABLE_TARGET, interceptors=[interceptor_class()])
- stub = test_pb2_grpc.TestServiceStub(channel)
-
- payload = messages_pb2.Payload(body=b'\0' *
- _REQUEST_PAYLOAD_SIZE)
- request = messages_pb2.StreamingInputCallRequest(
- payload=payload)
-
- # When there is an error the request iterator is no longer
- # consumed.
- async def request_iterator():
- for _ in range(_NUM_STREAM_REQUESTS):
- yield request
-
- call = stub.StreamingInputCall(request_iterator())
-
- with self.assertRaises(aio.AioRpcError) as exception_context:
- await call
-
- self.assertEqual(grpc.StatusCode.UNAVAILABLE,
- exception_context.exception.code())
- self.assertTrue(call.done())
- self.assertEqual(grpc.StatusCode.UNAVAILABLE, await call.code())
-
- await channel.close()
-
- async def test_intercepts_request_iterator_rpc_error_using_write(self):
- for interceptor_class in (_StreamUnaryInterceptorEmpty,
- _StreamUnaryInterceptorWithRequestIterator):
-
- with self.subTest(name=interceptor_class):
- channel = aio.insecure_channel(
- UNREACHABLE_TARGET, interceptors=[interceptor_class()])
- stub = test_pb2_grpc.TestServiceStub(channel)
-
- payload = messages_pb2.Payload(body=b'\0' *
- _REQUEST_PAYLOAD_SIZE)
- request = messages_pb2.StreamingInputCallRequest(
- payload=payload)
-
- call = stub.StreamingInputCall()
-
- # When there is an error during the write, exception is raised.
- with self.assertRaises(asyncio.InvalidStateError):
- for _ in range(_NUM_STREAM_REQUESTS):
- await call.write(request)
-
- with self.assertRaises(aio.AioRpcError) as exception_context:
- await call
-
- self.assertEqual(grpc.StatusCode.UNAVAILABLE,
- exception_context.exception.code())
- self.assertTrue(call.done())
- self.assertEqual(grpc.StatusCode.UNAVAILABLE, await call.code())
-
- await channel.close()
-
- async def test_cancel_before_rpc(self):
-
- interceptor_reached = asyncio.Event()
- wait_for_ever = self.loop.create_future()
-
- class Interceptor(aio.StreamUnaryClientInterceptor):
-
- async def intercept_stream_unary(self, continuation,
- client_call_details,
- request_iterator):
- interceptor_reached.set()
- await wait_for_ever
-
- channel = aio.insecure_channel(self._server_target,
- interceptors=[Interceptor()])
- stub = test_pb2_grpc.TestServiceStub(channel)
-
- payload = messages_pb2.Payload(body=b'\0' * _REQUEST_PAYLOAD_SIZE)
- request = messages_pb2.StreamingInputCallRequest(payload=payload)
-
- call = stub.StreamingInputCall()
-
- self.assertFalse(call.cancelled())
- self.assertFalse(call.done())
-
- await interceptor_reached.wait()
- self.assertTrue(call.cancel())
-
- # When there is an error during the write, exception is raised.
- with self.assertRaises(asyncio.InvalidStateError):
- for _ in range(_NUM_STREAM_REQUESTS):
- await call.write(request)
-
- with self.assertRaises(asyncio.CancelledError):
- await call
-
- self.assertTrue(call.cancelled())
- self.assertTrue(call.done())
- self.assertEqual(await call.code(), grpc.StatusCode.CANCELLED)
- self.assertEqual(await call.initial_metadata(), None)
- self.assertEqual(await call.trailing_metadata(), None)
- await channel.close()
-
- async def test_cancel_after_rpc(self):
-
- interceptor_reached = asyncio.Event()
- wait_for_ever = self.loop.create_future()
-
- class Interceptor(aio.StreamUnaryClientInterceptor):
-
- async def intercept_stream_unary(self, continuation,
- client_call_details,
- request_iterator):
- call = await continuation(client_call_details, request_iterator)
- interceptor_reached.set()
- await wait_for_ever
-
- channel = aio.insecure_channel(self._server_target,
- interceptors=[Interceptor()])
- stub = test_pb2_grpc.TestServiceStub(channel)
-
- payload = messages_pb2.Payload(body=b'\0' * _REQUEST_PAYLOAD_SIZE)
- request = messages_pb2.StreamingInputCallRequest(payload=payload)
-
- call = stub.StreamingInputCall()
-
- self.assertFalse(call.cancelled())
- self.assertFalse(call.done())
-
- await interceptor_reached.wait()
- self.assertTrue(call.cancel())
-
- # When there is an error during the write, exception is raised.
- with self.assertRaises(asyncio.InvalidStateError):
- for _ in range(_NUM_STREAM_REQUESTS):
- await call.write(request)
-
- with self.assertRaises(asyncio.CancelledError):
- await call
-
- self.assertTrue(call.cancelled())
- self.assertTrue(call.done())
- self.assertEqual(await call.code(), grpc.StatusCode.CANCELLED)
- self.assertEqual(await call.initial_metadata(), None)
- self.assertEqual(await call.trailing_metadata(), None)
- await channel.close()
-
- async def test_cancel_while_writing(self):
- # Test cancelation before making any write or after doing at least 1
- for num_writes_before_cancel in (0, 1):
- with self.subTest(name="Num writes before cancel: {}".format(
- num_writes_before_cancel)):
-
- channel = aio.insecure_channel(
- UNREACHABLE_TARGET,
- interceptors=[_StreamUnaryInterceptorWithRequestIterator()])
- stub = test_pb2_grpc.TestServiceStub(channel)
-
- payload = messages_pb2.Payload(body=b'\0' *
- _REQUEST_PAYLOAD_SIZE)
- request = messages_pb2.StreamingInputCallRequest(
- payload=payload)
-
- call = stub.StreamingInputCall()
-
- with self.assertRaises(asyncio.InvalidStateError):
- for i in range(_NUM_STREAM_REQUESTS):
- if i == num_writes_before_cancel:
- self.assertTrue(call.cancel())
- await call.write(request)
-
- with self.assertRaises(asyncio.CancelledError):
- await call
-
- self.assertTrue(call.cancelled())
- self.assertTrue(call.done())
- self.assertEqual(await call.code(), grpc.StatusCode.CANCELLED)
-
- await channel.close()
-
- async def test_cancel_by_the_interceptor(self):
-
- class Interceptor(aio.StreamUnaryClientInterceptor):
-
- async def intercept_stream_unary(self, continuation,
- client_call_details,
- request_iterator):
- call = await continuation(client_call_details, request_iterator)
- call.cancel()
- return call
-
- channel = aio.insecure_channel(UNREACHABLE_TARGET,
- interceptors=[Interceptor()])
- stub = test_pb2_grpc.TestServiceStub(channel)
-
- payload = messages_pb2.Payload(body=b'\0' * _REQUEST_PAYLOAD_SIZE)
- request = messages_pb2.StreamingInputCallRequest(payload=payload)
-
- call = stub.StreamingInputCall()
-
- with self.assertRaises(asyncio.InvalidStateError):
- for i in range(_NUM_STREAM_REQUESTS):
- await call.write(request)
-
- with self.assertRaises(asyncio.CancelledError):
- await call
-
- self.assertTrue(call.cancelled())
- self.assertTrue(call.done())
- self.assertEqual(await call.code(), grpc.StatusCode.CANCELLED)
-
- await channel.close()
-
- async def test_exception_raised_by_interceptor(self):
-
- class InterceptorException(Exception):
- pass
-
- class Interceptor(aio.StreamUnaryClientInterceptor):
-
- async def intercept_stream_unary(self, continuation,
- client_call_details,
- request_iterator):
- raise InterceptorException
-
- channel = aio.insecure_channel(UNREACHABLE_TARGET,
- interceptors=[Interceptor()])
- stub = test_pb2_grpc.TestServiceStub(channel)
-
- payload = messages_pb2.Payload(body=b'\0' * _REQUEST_PAYLOAD_SIZE)
- request = messages_pb2.StreamingInputCallRequest(payload=payload)
-
- call = stub.StreamingInputCall()
-
- with self.assertRaises(InterceptorException):
- for i in range(_NUM_STREAM_REQUESTS):
- await call.write(request)
-
- with self.assertRaises(InterceptorException):
- await call
-
- await channel.close()
-
- async def test_intercepts_prohibit_mixing_style(self):
- channel = aio.insecure_channel(
- self._server_target, interceptors=[_StreamUnaryInterceptorEmpty()])
- stub = test_pb2_grpc.TestServiceStub(channel)
-
- payload = messages_pb2.Payload(body=b'\0' * _REQUEST_PAYLOAD_SIZE)
- request = messages_pb2.StreamingInputCallRequest(payload=payload)
-
- async def request_iterator():
- for _ in range(_NUM_STREAM_REQUESTS):
- yield request
-
- call = stub.StreamingInputCall(request_iterator())
-
- with self.assertRaises(grpc._cython.cygrpc.UsageError):
- await call.write(request)
-
- with self.assertRaises(grpc._cython.cygrpc.UsageError):
- await call.done_writing()
-
- await channel.close()
-
-
-if __name__ == '__main__':
- logging.basicConfig(level=logging.DEBUG)
- unittest.main(verbosity=2)
+# Copyright 2020 The gRPC Authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+import asyncio
+import logging
+import unittest
+import datetime
+
+import grpc
+
+from grpc.experimental import aio
+from tests_aio.unit._constants import UNREACHABLE_TARGET
+from tests_aio.unit._common import inject_callbacks
+from tests_aio.unit._common import CountingRequestIterator
+from tests_aio.unit._test_server import start_test_server
+from tests_aio.unit._test_base import AioTestBase
+from tests.unit.framework.common import test_constants
+from src.proto.grpc.testing import messages_pb2, test_pb2_grpc
+
+_SHORT_TIMEOUT_S = 1.0
+
+_NUM_STREAM_REQUESTS = 5
+_REQUEST_PAYLOAD_SIZE = 7
+_RESPONSE_INTERVAL_US = int(_SHORT_TIMEOUT_S * 1000 * 1000)
+
+
+class _StreamUnaryInterceptorEmpty(aio.StreamUnaryClientInterceptor):
+
+ async def intercept_stream_unary(self, continuation, client_call_details,
+ request_iterator):
+ return await continuation(client_call_details, request_iterator)
+
+ def assert_in_final_state(self, test: unittest.TestCase):
+ pass
+
+
+class _StreamUnaryInterceptorWithRequestIterator(
+ aio.StreamUnaryClientInterceptor):
+
+ async def intercept_stream_unary(self, continuation, client_call_details,
+ request_iterator):
+ self.request_iterator = CountingRequestIterator(request_iterator)
+ call = await continuation(client_call_details, self.request_iterator)
+ return call
+
+ def assert_in_final_state(self, test: unittest.TestCase):
+ test.assertEqual(_NUM_STREAM_REQUESTS,
+ self.request_iterator.request_cnt)
+
+
+class TestStreamUnaryClientInterceptor(AioTestBase):
+
+ async def setUp(self):
+ self._server_target, self._server = await start_test_server()
+
+ async def tearDown(self):
+ await self._server.stop(None)
+
+ async def test_intercepts(self):
+ for interceptor_class in (_StreamUnaryInterceptorEmpty,
+ _StreamUnaryInterceptorWithRequestIterator):
+
+ with self.subTest(name=interceptor_class):
+ interceptor = interceptor_class()
+ channel = aio.insecure_channel(self._server_target,
+ interceptors=[interceptor])
+ stub = test_pb2_grpc.TestServiceStub(channel)
+
+ payload = messages_pb2.Payload(body=b'\0' *
+ _REQUEST_PAYLOAD_SIZE)
+ request = messages_pb2.StreamingInputCallRequest(
+ payload=payload)
+
+ async def request_iterator():
+ for _ in range(_NUM_STREAM_REQUESTS):
+ yield request
+
+ call = stub.StreamingInputCall(request_iterator())
+
+ response = await call
+
+ self.assertEqual(_NUM_STREAM_REQUESTS * _REQUEST_PAYLOAD_SIZE,
+ response.aggregated_payload_size)
+ self.assertEqual(await call.code(), grpc.StatusCode.OK)
+ self.assertEqual(await call.initial_metadata(), aio.Metadata())
+ self.assertEqual(await call.trailing_metadata(), aio.Metadata())
+ self.assertEqual(await call.details(), '')
+ self.assertEqual(await call.debug_error_string(), '')
+ self.assertEqual(call.cancel(), False)
+ self.assertEqual(call.cancelled(), False)
+ self.assertEqual(call.done(), True)
+
+ interceptor.assert_in_final_state(self)
+
+ await channel.close()
+
+ async def test_intercepts_using_write(self):
+ for interceptor_class in (_StreamUnaryInterceptorEmpty,
+ _StreamUnaryInterceptorWithRequestIterator):
+
+ with self.subTest(name=interceptor_class):
+ interceptor = interceptor_class()
+ channel = aio.insecure_channel(self._server_target,
+ interceptors=[interceptor])
+ stub = test_pb2_grpc.TestServiceStub(channel)
+
+ payload = messages_pb2.Payload(body=b'\0' *
+ _REQUEST_PAYLOAD_SIZE)
+ request = messages_pb2.StreamingInputCallRequest(
+ payload=payload)
+
+ call = stub.StreamingInputCall()
+
+ for _ in range(_NUM_STREAM_REQUESTS):
+ await call.write(request)
+
+ await call.done_writing()
+
+ response = await call
+
+ self.assertEqual(_NUM_STREAM_REQUESTS * _REQUEST_PAYLOAD_SIZE,
+ response.aggregated_payload_size)
+ self.assertEqual(await call.code(), grpc.StatusCode.OK)
+ self.assertEqual(await call.initial_metadata(), aio.Metadata())
+ self.assertEqual(await call.trailing_metadata(), aio.Metadata())
+ self.assertEqual(await call.details(), '')
+ self.assertEqual(await call.debug_error_string(), '')
+ self.assertEqual(call.cancel(), False)
+ self.assertEqual(call.cancelled(), False)
+ self.assertEqual(call.done(), True)
+
+ interceptor.assert_in_final_state(self)
+
+ await channel.close()
+
+ async def test_add_done_callback_interceptor_task_not_finished(self):
+ for interceptor_class in (_StreamUnaryInterceptorEmpty,
+ _StreamUnaryInterceptorWithRequestIterator):
+
+ with self.subTest(name=interceptor_class):
+ interceptor = interceptor_class()
+
+ channel = aio.insecure_channel(self._server_target,
+ interceptors=[interceptor])
+ stub = test_pb2_grpc.TestServiceStub(channel)
+
+ payload = messages_pb2.Payload(body=b'\0' *
+ _REQUEST_PAYLOAD_SIZE)
+ request = messages_pb2.StreamingInputCallRequest(
+ payload=payload)
+
+ async def request_iterator():
+ for _ in range(_NUM_STREAM_REQUESTS):
+ yield request
+
+ call = stub.StreamingInputCall(request_iterator())
+
+ validation = inject_callbacks(call)
+
+ response = await call
+
+ await validation
+
+ await channel.close()
+
+ async def test_add_done_callback_interceptor_task_finished(self):
+ for interceptor_class in (_StreamUnaryInterceptorEmpty,
+ _StreamUnaryInterceptorWithRequestIterator):
+
+ with self.subTest(name=interceptor_class):
+ interceptor = interceptor_class()
+
+ channel = aio.insecure_channel(self._server_target,
+ interceptors=[interceptor])
+ stub = test_pb2_grpc.TestServiceStub(channel)
+
+ payload = messages_pb2.Payload(body=b'\0' *
+ _REQUEST_PAYLOAD_SIZE)
+ request = messages_pb2.StreamingInputCallRequest(
+ payload=payload)
+
+ async def request_iterator():
+ for _ in range(_NUM_STREAM_REQUESTS):
+ yield request
+
+ call = stub.StreamingInputCall(request_iterator())
+
+ response = await call
+
+ validation = inject_callbacks(call)
+
+ await validation
+
+ await channel.close()
+
+ async def test_multiple_interceptors_request_iterator(self):
+ for interceptor_class in (_StreamUnaryInterceptorEmpty,
+ _StreamUnaryInterceptorWithRequestIterator):
+
+ with self.subTest(name=interceptor_class):
+
+ interceptors = [interceptor_class(), interceptor_class()]
+ channel = aio.insecure_channel(self._server_target,
+ interceptors=interceptors)
+ stub = test_pb2_grpc.TestServiceStub(channel)
+
+ payload = messages_pb2.Payload(body=b'\0' *
+ _REQUEST_PAYLOAD_SIZE)
+ request = messages_pb2.StreamingInputCallRequest(
+ payload=payload)
+
+ async def request_iterator():
+ for _ in range(_NUM_STREAM_REQUESTS):
+ yield request
+
+ call = stub.StreamingInputCall(request_iterator())
+
+ response = await call
+
+ self.assertEqual(_NUM_STREAM_REQUESTS * _REQUEST_PAYLOAD_SIZE,
+ response.aggregated_payload_size)
+ self.assertEqual(await call.code(), grpc.StatusCode.OK)
+ self.assertEqual(await call.initial_metadata(), aio.Metadata())
+ self.assertEqual(await call.trailing_metadata(), aio.Metadata())
+ self.assertEqual(await call.details(), '')
+ self.assertEqual(await call.debug_error_string(), '')
+ self.assertEqual(call.cancel(), False)
+ self.assertEqual(call.cancelled(), False)
+ self.assertEqual(call.done(), True)
+
+ for interceptor in interceptors:
+ interceptor.assert_in_final_state(self)
+
+ await channel.close()
+
+ async def test_intercepts_request_iterator_rpc_error(self):
+ for interceptor_class in (_StreamUnaryInterceptorEmpty,
+ _StreamUnaryInterceptorWithRequestIterator):
+
+ with self.subTest(name=interceptor_class):
+ channel = aio.insecure_channel(
+ UNREACHABLE_TARGET, interceptors=[interceptor_class()])
+ stub = test_pb2_grpc.TestServiceStub(channel)
+
+ payload = messages_pb2.Payload(body=b'\0' *
+ _REQUEST_PAYLOAD_SIZE)
+ request = messages_pb2.StreamingInputCallRequest(
+ payload=payload)
+
+ # When there is an error the request iterator is no longer
+ # consumed.
+ async def request_iterator():
+ for _ in range(_NUM_STREAM_REQUESTS):
+ yield request
+
+ call = stub.StreamingInputCall(request_iterator())
+
+ with self.assertRaises(aio.AioRpcError) as exception_context:
+ await call
+
+ self.assertEqual(grpc.StatusCode.UNAVAILABLE,
+ exception_context.exception.code())
+ self.assertTrue(call.done())
+ self.assertEqual(grpc.StatusCode.UNAVAILABLE, await call.code())
+
+ await channel.close()
+
+ async def test_intercepts_request_iterator_rpc_error_using_write(self):
+ for interceptor_class in (_StreamUnaryInterceptorEmpty,
+ _StreamUnaryInterceptorWithRequestIterator):
+
+ with self.subTest(name=interceptor_class):
+ channel = aio.insecure_channel(
+ UNREACHABLE_TARGET, interceptors=[interceptor_class()])
+ stub = test_pb2_grpc.TestServiceStub(channel)
+
+ payload = messages_pb2.Payload(body=b'\0' *
+ _REQUEST_PAYLOAD_SIZE)
+ request = messages_pb2.StreamingInputCallRequest(
+ payload=payload)
+
+ call = stub.StreamingInputCall()
+
+ # When there is an error during the write, exception is raised.
+ with self.assertRaises(asyncio.InvalidStateError):
+ for _ in range(_NUM_STREAM_REQUESTS):
+ await call.write(request)
+
+ with self.assertRaises(aio.AioRpcError) as exception_context:
+ await call
+
+ self.assertEqual(grpc.StatusCode.UNAVAILABLE,
+ exception_context.exception.code())
+ self.assertTrue(call.done())
+ self.assertEqual(grpc.StatusCode.UNAVAILABLE, await call.code())
+
+ await channel.close()
+
+ async def test_cancel_before_rpc(self):
+
+ interceptor_reached = asyncio.Event()
+ wait_for_ever = self.loop.create_future()
+
+ class Interceptor(aio.StreamUnaryClientInterceptor):
+
+ async def intercept_stream_unary(self, continuation,
+ client_call_details,
+ request_iterator):
+ interceptor_reached.set()
+ await wait_for_ever
+
+ channel = aio.insecure_channel(self._server_target,
+ interceptors=[Interceptor()])
+ stub = test_pb2_grpc.TestServiceStub(channel)
+
+ payload = messages_pb2.Payload(body=b'\0' * _REQUEST_PAYLOAD_SIZE)
+ request = messages_pb2.StreamingInputCallRequest(payload=payload)
+
+ call = stub.StreamingInputCall()
+
+ self.assertFalse(call.cancelled())
+ self.assertFalse(call.done())
+
+ await interceptor_reached.wait()
+ self.assertTrue(call.cancel())
+
+ # When there is an error during the write, exception is raised.
+ with self.assertRaises(asyncio.InvalidStateError):
+ for _ in range(_NUM_STREAM_REQUESTS):
+ await call.write(request)
+
+ with self.assertRaises(asyncio.CancelledError):
+ await call
+
+ self.assertTrue(call.cancelled())
+ self.assertTrue(call.done())
+ self.assertEqual(await call.code(), grpc.StatusCode.CANCELLED)
+ self.assertEqual(await call.initial_metadata(), None)
+ self.assertEqual(await call.trailing_metadata(), None)
+ await channel.close()
+
+ async def test_cancel_after_rpc(self):
+
+ interceptor_reached = asyncio.Event()
+ wait_for_ever = self.loop.create_future()
+
+ class Interceptor(aio.StreamUnaryClientInterceptor):
+
+ async def intercept_stream_unary(self, continuation,
+ client_call_details,
+ request_iterator):
+ call = await continuation(client_call_details, request_iterator)
+ interceptor_reached.set()
+ await wait_for_ever
+
+ channel = aio.insecure_channel(self._server_target,
+ interceptors=[Interceptor()])
+ stub = test_pb2_grpc.TestServiceStub(channel)
+
+ payload = messages_pb2.Payload(body=b'\0' * _REQUEST_PAYLOAD_SIZE)
+ request = messages_pb2.StreamingInputCallRequest(payload=payload)
+
+ call = stub.StreamingInputCall()
+
+ self.assertFalse(call.cancelled())
+ self.assertFalse(call.done())
+
+ await interceptor_reached.wait()
+ self.assertTrue(call.cancel())
+
+ # When there is an error during the write, exception is raised.
+ with self.assertRaises(asyncio.InvalidStateError):
+ for _ in range(_NUM_STREAM_REQUESTS):
+ await call.write(request)
+
+ with self.assertRaises(asyncio.CancelledError):
+ await call
+
+ self.assertTrue(call.cancelled())
+ self.assertTrue(call.done())
+ self.assertEqual(await call.code(), grpc.StatusCode.CANCELLED)
+ self.assertEqual(await call.initial_metadata(), None)
+ self.assertEqual(await call.trailing_metadata(), None)
+ await channel.close()
+
+ async def test_cancel_while_writing(self):
+ # Test cancelation before making any write or after doing at least 1
+ for num_writes_before_cancel in (0, 1):
+ with self.subTest(name="Num writes before cancel: {}".format(
+ num_writes_before_cancel)):
+
+ channel = aio.insecure_channel(
+ UNREACHABLE_TARGET,
+ interceptors=[_StreamUnaryInterceptorWithRequestIterator()])
+ stub = test_pb2_grpc.TestServiceStub(channel)
+
+ payload = messages_pb2.Payload(body=b'\0' *
+ _REQUEST_PAYLOAD_SIZE)
+ request = messages_pb2.StreamingInputCallRequest(
+ payload=payload)
+
+ call = stub.StreamingInputCall()
+
+ with self.assertRaises(asyncio.InvalidStateError):
+ for i in range(_NUM_STREAM_REQUESTS):
+ if i == num_writes_before_cancel:
+ self.assertTrue(call.cancel())
+ await call.write(request)
+
+ with self.assertRaises(asyncio.CancelledError):
+ await call
+
+ self.assertTrue(call.cancelled())
+ self.assertTrue(call.done())
+ self.assertEqual(await call.code(), grpc.StatusCode.CANCELLED)
+
+ await channel.close()
+
+ async def test_cancel_by_the_interceptor(self):
+
+ class Interceptor(aio.StreamUnaryClientInterceptor):
+
+ async def intercept_stream_unary(self, continuation,
+ client_call_details,
+ request_iterator):
+ call = await continuation(client_call_details, request_iterator)
+ call.cancel()
+ return call
+
+ channel = aio.insecure_channel(UNREACHABLE_TARGET,
+ interceptors=[Interceptor()])
+ stub = test_pb2_grpc.TestServiceStub(channel)
+
+ payload = messages_pb2.Payload(body=b'\0' * _REQUEST_PAYLOAD_SIZE)
+ request = messages_pb2.StreamingInputCallRequest(payload=payload)
+
+ call = stub.StreamingInputCall()
+
+ with self.assertRaises(asyncio.InvalidStateError):
+ for i in range(_NUM_STREAM_REQUESTS):
+ await call.write(request)
+
+ with self.assertRaises(asyncio.CancelledError):
+ await call
+
+ self.assertTrue(call.cancelled())
+ self.assertTrue(call.done())
+ self.assertEqual(await call.code(), grpc.StatusCode.CANCELLED)
+
+ await channel.close()
+
+ async def test_exception_raised_by_interceptor(self):
+
+ class InterceptorException(Exception):
+ pass
+
+ class Interceptor(aio.StreamUnaryClientInterceptor):
+
+ async def intercept_stream_unary(self, continuation,
+ client_call_details,
+ request_iterator):
+ raise InterceptorException
+
+ channel = aio.insecure_channel(UNREACHABLE_TARGET,
+ interceptors=[Interceptor()])
+ stub = test_pb2_grpc.TestServiceStub(channel)
+
+ payload = messages_pb2.Payload(body=b'\0' * _REQUEST_PAYLOAD_SIZE)
+ request = messages_pb2.StreamingInputCallRequest(payload=payload)
+
+ call = stub.StreamingInputCall()
+
+ with self.assertRaises(InterceptorException):
+ for i in range(_NUM_STREAM_REQUESTS):
+ await call.write(request)
+
+ with self.assertRaises(InterceptorException):
+ await call
+
+ await channel.close()
+
+ async def test_intercepts_prohibit_mixing_style(self):
+ channel = aio.insecure_channel(
+ self._server_target, interceptors=[_StreamUnaryInterceptorEmpty()])
+ stub = test_pb2_grpc.TestServiceStub(channel)
+
+ payload = messages_pb2.Payload(body=b'\0' * _REQUEST_PAYLOAD_SIZE)
+ request = messages_pb2.StreamingInputCallRequest(payload=payload)
+
+ async def request_iterator():
+ for _ in range(_NUM_STREAM_REQUESTS):
+ yield request
+
+ call = stub.StreamingInputCall(request_iterator())
+
+ with self.assertRaises(grpc._cython.cygrpc.UsageError):
+ await call.write(request)
+
+ with self.assertRaises(grpc._cython.cygrpc.UsageError):
+ await call.done_writing()
+
+ await channel.close()
+
+
+if __name__ == '__main__':
+ logging.basicConfig(level=logging.DEBUG)
+ unittest.main(verbosity=2)
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/client_unary_stream_interceptor_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/client_unary_stream_interceptor_test.py
index 51b10c4bd60..fd542fd16e9 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/client_unary_stream_interceptor_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/client_unary_stream_interceptor_test.py
@@ -1,395 +1,395 @@
-# Copyright 2020 The gRPC Authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-import asyncio
-import logging
-import unittest
-import datetime
-
-import grpc
-
-from grpc.experimental import aio
-from tests_aio.unit._constants import UNREACHABLE_TARGET
-from tests_aio.unit._common import inject_callbacks
-from tests_aio.unit._common import CountingResponseIterator
-from tests_aio.unit._test_server import start_test_server
-from tests_aio.unit._test_base import AioTestBase
-from tests.unit.framework.common import test_constants
-from src.proto.grpc.testing import messages_pb2, test_pb2_grpc
-
-_SHORT_TIMEOUT_S = 1.0
-
-_NUM_STREAM_RESPONSES = 5
-_REQUEST_PAYLOAD_SIZE = 7
-_RESPONSE_PAYLOAD_SIZE = 7
-_RESPONSE_INTERVAL_US = int(_SHORT_TIMEOUT_S * 1000 * 1000)
-
-
-class _UnaryStreamInterceptorEmpty(aio.UnaryStreamClientInterceptor):
-
- async def intercept_unary_stream(self, continuation, client_call_details,
- request):
- return await continuation(client_call_details, request)
-
- def assert_in_final_state(self, test: unittest.TestCase):
- pass
-
-
-class _UnaryStreamInterceptorWithResponseIterator(
- aio.UnaryStreamClientInterceptor):
-
- async def intercept_unary_stream(self, continuation, client_call_details,
- request):
- call = await continuation(client_call_details, request)
- self.response_iterator = CountingResponseIterator(call)
- return self.response_iterator
-
- def assert_in_final_state(self, test: unittest.TestCase):
- test.assertEqual(_NUM_STREAM_RESPONSES,
- self.response_iterator.response_cnt)
-
-
-class TestUnaryStreamClientInterceptor(AioTestBase):
-
- async def setUp(self):
- self._server_target, self._server = await start_test_server()
-
- async def tearDown(self):
- await self._server.stop(None)
-
- async def test_intercepts(self):
- for interceptor_class in (_UnaryStreamInterceptorEmpty,
- _UnaryStreamInterceptorWithResponseIterator):
-
- with self.subTest(name=interceptor_class):
- interceptor = interceptor_class()
-
- request = messages_pb2.StreamingOutputCallRequest()
- request.response_parameters.extend([
- messages_pb2.ResponseParameters(size=_RESPONSE_PAYLOAD_SIZE)
- ] * _NUM_STREAM_RESPONSES)
-
- channel = aio.insecure_channel(self._server_target,
- interceptors=[interceptor])
- stub = test_pb2_grpc.TestServiceStub(channel)
- call = stub.StreamingOutputCall(request)
-
- await call.wait_for_connection()
-
- response_cnt = 0
- async for response in call:
- response_cnt += 1
- self.assertIs(type(response),
- messages_pb2.StreamingOutputCallResponse)
- self.assertEqual(_RESPONSE_PAYLOAD_SIZE,
- len(response.payload.body))
-
- self.assertEqual(response_cnt, _NUM_STREAM_RESPONSES)
- self.assertEqual(await call.code(), grpc.StatusCode.OK)
- self.assertEqual(await call.initial_metadata(), aio.Metadata())
- self.assertEqual(await call.trailing_metadata(), aio.Metadata())
- self.assertEqual(await call.details(), '')
- self.assertEqual(await call.debug_error_string(), '')
- self.assertEqual(call.cancel(), False)
- self.assertEqual(call.cancelled(), False)
- self.assertEqual(call.done(), True)
-
- interceptor.assert_in_final_state(self)
-
- await channel.close()
-
- async def test_add_done_callback_interceptor_task_not_finished(self):
- for interceptor_class in (_UnaryStreamInterceptorEmpty,
- _UnaryStreamInterceptorWithResponseIterator):
-
- with self.subTest(name=interceptor_class):
- interceptor = interceptor_class()
-
- request = messages_pb2.StreamingOutputCallRequest()
- request.response_parameters.extend([
- messages_pb2.ResponseParameters(size=_RESPONSE_PAYLOAD_SIZE)
- ] * _NUM_STREAM_RESPONSES)
-
- channel = aio.insecure_channel(self._server_target,
- interceptors=[interceptor])
- stub = test_pb2_grpc.TestServiceStub(channel)
- call = stub.StreamingOutputCall(request)
-
- validation = inject_callbacks(call)
-
- async for response in call:
- pass
-
- await validation
-
- await channel.close()
-
- async def test_add_done_callback_interceptor_task_finished(self):
- for interceptor_class in (_UnaryStreamInterceptorEmpty,
- _UnaryStreamInterceptorWithResponseIterator):
-
- with self.subTest(name=interceptor_class):
- interceptor = interceptor_class()
-
- request = messages_pb2.StreamingOutputCallRequest()
- request.response_parameters.extend([
- messages_pb2.ResponseParameters(size=_RESPONSE_PAYLOAD_SIZE)
- ] * _NUM_STREAM_RESPONSES)
-
- channel = aio.insecure_channel(self._server_target,
- interceptors=[interceptor])
- stub = test_pb2_grpc.TestServiceStub(channel)
- call = stub.StreamingOutputCall(request)
-
- # This ensures that the callbacks will be registered
- # with the intercepted call rather than saving in the
- # pending state list.
- await call.wait_for_connection()
-
- validation = inject_callbacks(call)
-
- async for response in call:
- pass
-
- await validation
-
- await channel.close()
-
- async def test_response_iterator_using_read(self):
- interceptor = _UnaryStreamInterceptorWithResponseIterator()
-
- channel = aio.insecure_channel(self._server_target,
- interceptors=[interceptor])
- stub = test_pb2_grpc.TestServiceStub(channel)
-
- request = messages_pb2.StreamingOutputCallRequest()
- request.response_parameters.extend(
- [messages_pb2.ResponseParameters(size=_RESPONSE_PAYLOAD_SIZE)] *
- _NUM_STREAM_RESPONSES)
-
- call = stub.StreamingOutputCall(request)
-
- response_cnt = 0
- for response in range(_NUM_STREAM_RESPONSES):
- response = await call.read()
- response_cnt += 1
- self.assertIs(type(response),
- messages_pb2.StreamingOutputCallResponse)
- self.assertEqual(_RESPONSE_PAYLOAD_SIZE, len(response.payload.body))
-
- self.assertEqual(response_cnt, _NUM_STREAM_RESPONSES)
- self.assertEqual(interceptor.response_iterator.response_cnt,
- _NUM_STREAM_RESPONSES)
- self.assertEqual(await call.code(), grpc.StatusCode.OK)
-
- await channel.close()
-
- async def test_multiple_interceptors_response_iterator(self):
- for interceptor_class in (_UnaryStreamInterceptorEmpty,
- _UnaryStreamInterceptorWithResponseIterator):
-
- with self.subTest(name=interceptor_class):
-
- interceptors = [interceptor_class(), interceptor_class()]
-
- channel = aio.insecure_channel(self._server_target,
- interceptors=interceptors)
- stub = test_pb2_grpc.TestServiceStub(channel)
-
- request = messages_pb2.StreamingOutputCallRequest()
- request.response_parameters.extend([
- messages_pb2.ResponseParameters(size=_RESPONSE_PAYLOAD_SIZE)
- ] * _NUM_STREAM_RESPONSES)
-
- call = stub.StreamingOutputCall(request)
-
- response_cnt = 0
- async for response in call:
- response_cnt += 1
- self.assertIs(type(response),
- messages_pb2.StreamingOutputCallResponse)
- self.assertEqual(_RESPONSE_PAYLOAD_SIZE,
- len(response.payload.body))
-
- self.assertEqual(response_cnt, _NUM_STREAM_RESPONSES)
- self.assertEqual(await call.code(), grpc.StatusCode.OK)
-
- await channel.close()
-
- async def test_intercepts_response_iterator_rpc_error(self):
- for interceptor_class in (_UnaryStreamInterceptorEmpty,
- _UnaryStreamInterceptorWithResponseIterator):
-
- with self.subTest(name=interceptor_class):
-
- channel = aio.insecure_channel(
- UNREACHABLE_TARGET, interceptors=[interceptor_class()])
- request = messages_pb2.StreamingOutputCallRequest()
- stub = test_pb2_grpc.TestServiceStub(channel)
- call = stub.StreamingOutputCall(request)
-
- with self.assertRaises(aio.AioRpcError) as exception_context:
- async for response in call:
- pass
-
- self.assertEqual(grpc.StatusCode.UNAVAILABLE,
- exception_context.exception.code())
-
- self.assertTrue(call.done())
- self.assertEqual(grpc.StatusCode.UNAVAILABLE, await call.code())
- await channel.close()
-
- async def test_cancel_before_rpc(self):
-
- interceptor_reached = asyncio.Event()
- wait_for_ever = self.loop.create_future()
-
- class Interceptor(aio.UnaryStreamClientInterceptor):
-
- async def intercept_unary_stream(self, continuation,
- client_call_details, request):
- interceptor_reached.set()
- await wait_for_ever
-
- channel = aio.insecure_channel(UNREACHABLE_TARGET,
- interceptors=[Interceptor()])
- request = messages_pb2.StreamingOutputCallRequest()
- stub = test_pb2_grpc.TestServiceStub(channel)
- call = stub.StreamingOutputCall(request)
-
- self.assertFalse(call.cancelled())
- self.assertFalse(call.done())
-
- await interceptor_reached.wait()
- self.assertTrue(call.cancel())
-
- with self.assertRaises(asyncio.CancelledError):
- async for response in call:
- pass
-
- self.assertTrue(call.cancelled())
- self.assertTrue(call.done())
- self.assertEqual(await call.code(), grpc.StatusCode.CANCELLED)
- self.assertEqual(await call.initial_metadata(), None)
- self.assertEqual(await call.trailing_metadata(), None)
- await channel.close()
-
- async def test_cancel_after_rpc(self):
-
- interceptor_reached = asyncio.Event()
- wait_for_ever = self.loop.create_future()
-
- class Interceptor(aio.UnaryStreamClientInterceptor):
-
- async def intercept_unary_stream(self, continuation,
- client_call_details, request):
- call = await continuation(client_call_details, request)
- interceptor_reached.set()
- await wait_for_ever
-
- channel = aio.insecure_channel(UNREACHABLE_TARGET,
- interceptors=[Interceptor()])
- request = messages_pb2.StreamingOutputCallRequest()
- stub = test_pb2_grpc.TestServiceStub(channel)
- call = stub.StreamingOutputCall(request)
-
- self.assertFalse(call.cancelled())
- self.assertFalse(call.done())
-
- await interceptor_reached.wait()
- self.assertTrue(call.cancel())
-
- with self.assertRaises(asyncio.CancelledError):
- async for response in call:
- pass
-
- self.assertTrue(call.cancelled())
- self.assertTrue(call.done())
- self.assertEqual(await call.code(), grpc.StatusCode.CANCELLED)
- self.assertEqual(await call.initial_metadata(), None)
- self.assertEqual(await call.trailing_metadata(), None)
- await channel.close()
-
- async def test_cancel_consuming_response_iterator(self):
- request = messages_pb2.StreamingOutputCallRequest()
- request.response_parameters.extend(
- [messages_pb2.ResponseParameters(size=_RESPONSE_PAYLOAD_SIZE)] *
- _NUM_STREAM_RESPONSES)
-
- channel = aio.insecure_channel(
- self._server_target,
- interceptors=[_UnaryStreamInterceptorWithResponseIterator()])
- stub = test_pb2_grpc.TestServiceStub(channel)
- call = stub.StreamingOutputCall(request)
-
- with self.assertRaises(asyncio.CancelledError):
- async for response in call:
- call.cancel()
-
- self.assertTrue(call.cancelled())
- self.assertTrue(call.done())
- self.assertEqual(await call.code(), grpc.StatusCode.CANCELLED)
- await channel.close()
-
- async def test_cancel_by_the_interceptor(self):
-
- class Interceptor(aio.UnaryStreamClientInterceptor):
-
- async def intercept_unary_stream(self, continuation,
- client_call_details, request):
- call = await continuation(client_call_details, request)
- call.cancel()
- return call
-
- channel = aio.insecure_channel(UNREACHABLE_TARGET,
- interceptors=[Interceptor()])
- request = messages_pb2.StreamingOutputCallRequest()
- stub = test_pb2_grpc.TestServiceStub(channel)
- call = stub.StreamingOutputCall(request)
-
- with self.assertRaises(asyncio.CancelledError):
- async for response in call:
- pass
-
- self.assertTrue(call.cancelled())
- self.assertTrue(call.done())
- self.assertEqual(await call.code(), grpc.StatusCode.CANCELLED)
- await channel.close()
-
- async def test_exception_raised_by_interceptor(self):
-
- class InterceptorException(Exception):
- pass
-
- class Interceptor(aio.UnaryStreamClientInterceptor):
-
- async def intercept_unary_stream(self, continuation,
- client_call_details, request):
- raise InterceptorException
-
- channel = aio.insecure_channel(UNREACHABLE_TARGET,
- interceptors=[Interceptor()])
- request = messages_pb2.StreamingOutputCallRequest()
- stub = test_pb2_grpc.TestServiceStub(channel)
- call = stub.StreamingOutputCall(request)
-
- with self.assertRaises(InterceptorException):
- async for response in call:
- pass
-
- await channel.close()
-
-
-if __name__ == '__main__':
- logging.basicConfig(level=logging.DEBUG)
- unittest.main(verbosity=2)
+# Copyright 2020 The gRPC Authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+import asyncio
+import logging
+import unittest
+import datetime
+
+import grpc
+
+from grpc.experimental import aio
+from tests_aio.unit._constants import UNREACHABLE_TARGET
+from tests_aio.unit._common import inject_callbacks
+from tests_aio.unit._common import CountingResponseIterator
+from tests_aio.unit._test_server import start_test_server
+from tests_aio.unit._test_base import AioTestBase
+from tests.unit.framework.common import test_constants
+from src.proto.grpc.testing import messages_pb2, test_pb2_grpc
+
+_SHORT_TIMEOUT_S = 1.0
+
+_NUM_STREAM_RESPONSES = 5
+_REQUEST_PAYLOAD_SIZE = 7
+_RESPONSE_PAYLOAD_SIZE = 7
+_RESPONSE_INTERVAL_US = int(_SHORT_TIMEOUT_S * 1000 * 1000)
+
+
+class _UnaryStreamInterceptorEmpty(aio.UnaryStreamClientInterceptor):
+
+ async def intercept_unary_stream(self, continuation, client_call_details,
+ request):
+ return await continuation(client_call_details, request)
+
+ def assert_in_final_state(self, test: unittest.TestCase):
+ pass
+
+
+class _UnaryStreamInterceptorWithResponseIterator(
+ aio.UnaryStreamClientInterceptor):
+
+ async def intercept_unary_stream(self, continuation, client_call_details,
+ request):
+ call = await continuation(client_call_details, request)
+ self.response_iterator = CountingResponseIterator(call)
+ return self.response_iterator
+
+ def assert_in_final_state(self, test: unittest.TestCase):
+ test.assertEqual(_NUM_STREAM_RESPONSES,
+ self.response_iterator.response_cnt)
+
+
+class TestUnaryStreamClientInterceptor(AioTestBase):
+
+ async def setUp(self):
+ self._server_target, self._server = await start_test_server()
+
+ async def tearDown(self):
+ await self._server.stop(None)
+
+ async def test_intercepts(self):
+ for interceptor_class in (_UnaryStreamInterceptorEmpty,
+ _UnaryStreamInterceptorWithResponseIterator):
+
+ with self.subTest(name=interceptor_class):
+ interceptor = interceptor_class()
+
+ request = messages_pb2.StreamingOutputCallRequest()
+ request.response_parameters.extend([
+ messages_pb2.ResponseParameters(size=_RESPONSE_PAYLOAD_SIZE)
+ ] * _NUM_STREAM_RESPONSES)
+
+ channel = aio.insecure_channel(self._server_target,
+ interceptors=[interceptor])
+ stub = test_pb2_grpc.TestServiceStub(channel)
+ call = stub.StreamingOutputCall(request)
+
+ await call.wait_for_connection()
+
+ response_cnt = 0
+ async for response in call:
+ response_cnt += 1
+ self.assertIs(type(response),
+ messages_pb2.StreamingOutputCallResponse)
+ self.assertEqual(_RESPONSE_PAYLOAD_SIZE,
+ len(response.payload.body))
+
+ self.assertEqual(response_cnt, _NUM_STREAM_RESPONSES)
+ self.assertEqual(await call.code(), grpc.StatusCode.OK)
+ self.assertEqual(await call.initial_metadata(), aio.Metadata())
+ self.assertEqual(await call.trailing_metadata(), aio.Metadata())
+ self.assertEqual(await call.details(), '')
+ self.assertEqual(await call.debug_error_string(), '')
+ self.assertEqual(call.cancel(), False)
+ self.assertEqual(call.cancelled(), False)
+ self.assertEqual(call.done(), True)
+
+ interceptor.assert_in_final_state(self)
+
+ await channel.close()
+
+ async def test_add_done_callback_interceptor_task_not_finished(self):
+ for interceptor_class in (_UnaryStreamInterceptorEmpty,
+ _UnaryStreamInterceptorWithResponseIterator):
+
+ with self.subTest(name=interceptor_class):
+ interceptor = interceptor_class()
+
+ request = messages_pb2.StreamingOutputCallRequest()
+ request.response_parameters.extend([
+ messages_pb2.ResponseParameters(size=_RESPONSE_PAYLOAD_SIZE)
+ ] * _NUM_STREAM_RESPONSES)
+
+ channel = aio.insecure_channel(self._server_target,
+ interceptors=[interceptor])
+ stub = test_pb2_grpc.TestServiceStub(channel)
+ call = stub.StreamingOutputCall(request)
+
+ validation = inject_callbacks(call)
+
+ async for response in call:
+ pass
+
+ await validation
+
+ await channel.close()
+
+ async def test_add_done_callback_interceptor_task_finished(self):
+ for interceptor_class in (_UnaryStreamInterceptorEmpty,
+ _UnaryStreamInterceptorWithResponseIterator):
+
+ with self.subTest(name=interceptor_class):
+ interceptor = interceptor_class()
+
+ request = messages_pb2.StreamingOutputCallRequest()
+ request.response_parameters.extend([
+ messages_pb2.ResponseParameters(size=_RESPONSE_PAYLOAD_SIZE)
+ ] * _NUM_STREAM_RESPONSES)
+
+ channel = aio.insecure_channel(self._server_target,
+ interceptors=[interceptor])
+ stub = test_pb2_grpc.TestServiceStub(channel)
+ call = stub.StreamingOutputCall(request)
+
+ # This ensures that the callbacks will be registered
+ # with the intercepted call rather than saving in the
+ # pending state list.
+ await call.wait_for_connection()
+
+ validation = inject_callbacks(call)
+
+ async for response in call:
+ pass
+
+ await validation
+
+ await channel.close()
+
+ async def test_response_iterator_using_read(self):
+ interceptor = _UnaryStreamInterceptorWithResponseIterator()
+
+ channel = aio.insecure_channel(self._server_target,
+ interceptors=[interceptor])
+ stub = test_pb2_grpc.TestServiceStub(channel)
+
+ request = messages_pb2.StreamingOutputCallRequest()
+ request.response_parameters.extend(
+ [messages_pb2.ResponseParameters(size=_RESPONSE_PAYLOAD_SIZE)] *
+ _NUM_STREAM_RESPONSES)
+
+ call = stub.StreamingOutputCall(request)
+
+ response_cnt = 0
+ for response in range(_NUM_STREAM_RESPONSES):
+ response = await call.read()
+ response_cnt += 1
+ self.assertIs(type(response),
+ messages_pb2.StreamingOutputCallResponse)
+ self.assertEqual(_RESPONSE_PAYLOAD_SIZE, len(response.payload.body))
+
+ self.assertEqual(response_cnt, _NUM_STREAM_RESPONSES)
+ self.assertEqual(interceptor.response_iterator.response_cnt,
+ _NUM_STREAM_RESPONSES)
+ self.assertEqual(await call.code(), grpc.StatusCode.OK)
+
+ await channel.close()
+
+ async def test_multiple_interceptors_response_iterator(self):
+ for interceptor_class in (_UnaryStreamInterceptorEmpty,
+ _UnaryStreamInterceptorWithResponseIterator):
+
+ with self.subTest(name=interceptor_class):
+
+ interceptors = [interceptor_class(), interceptor_class()]
+
+ channel = aio.insecure_channel(self._server_target,
+ interceptors=interceptors)
+ stub = test_pb2_grpc.TestServiceStub(channel)
+
+ request = messages_pb2.StreamingOutputCallRequest()
+ request.response_parameters.extend([
+ messages_pb2.ResponseParameters(size=_RESPONSE_PAYLOAD_SIZE)
+ ] * _NUM_STREAM_RESPONSES)
+
+ call = stub.StreamingOutputCall(request)
+
+ response_cnt = 0
+ async for response in call:
+ response_cnt += 1
+ self.assertIs(type(response),
+ messages_pb2.StreamingOutputCallResponse)
+ self.assertEqual(_RESPONSE_PAYLOAD_SIZE,
+ len(response.payload.body))
+
+ self.assertEqual(response_cnt, _NUM_STREAM_RESPONSES)
+ self.assertEqual(await call.code(), grpc.StatusCode.OK)
+
+ await channel.close()
+
+ async def test_intercepts_response_iterator_rpc_error(self):
+ for interceptor_class in (_UnaryStreamInterceptorEmpty,
+ _UnaryStreamInterceptorWithResponseIterator):
+
+ with self.subTest(name=interceptor_class):
+
+ channel = aio.insecure_channel(
+ UNREACHABLE_TARGET, interceptors=[interceptor_class()])
+ request = messages_pb2.StreamingOutputCallRequest()
+ stub = test_pb2_grpc.TestServiceStub(channel)
+ call = stub.StreamingOutputCall(request)
+
+ with self.assertRaises(aio.AioRpcError) as exception_context:
+ async for response in call:
+ pass
+
+ self.assertEqual(grpc.StatusCode.UNAVAILABLE,
+ exception_context.exception.code())
+
+ self.assertTrue(call.done())
+ self.assertEqual(grpc.StatusCode.UNAVAILABLE, await call.code())
+ await channel.close()
+
+ async def test_cancel_before_rpc(self):
+
+ interceptor_reached = asyncio.Event()
+ wait_for_ever = self.loop.create_future()
+
+ class Interceptor(aio.UnaryStreamClientInterceptor):
+
+ async def intercept_unary_stream(self, continuation,
+ client_call_details, request):
+ interceptor_reached.set()
+ await wait_for_ever
+
+ channel = aio.insecure_channel(UNREACHABLE_TARGET,
+ interceptors=[Interceptor()])
+ request = messages_pb2.StreamingOutputCallRequest()
+ stub = test_pb2_grpc.TestServiceStub(channel)
+ call = stub.StreamingOutputCall(request)
+
+ self.assertFalse(call.cancelled())
+ self.assertFalse(call.done())
+
+ await interceptor_reached.wait()
+ self.assertTrue(call.cancel())
+
+ with self.assertRaises(asyncio.CancelledError):
+ async for response in call:
+ pass
+
+ self.assertTrue(call.cancelled())
+ self.assertTrue(call.done())
+ self.assertEqual(await call.code(), grpc.StatusCode.CANCELLED)
+ self.assertEqual(await call.initial_metadata(), None)
+ self.assertEqual(await call.trailing_metadata(), None)
+ await channel.close()
+
+ async def test_cancel_after_rpc(self):
+
+ interceptor_reached = asyncio.Event()
+ wait_for_ever = self.loop.create_future()
+
+ class Interceptor(aio.UnaryStreamClientInterceptor):
+
+ async def intercept_unary_stream(self, continuation,
+ client_call_details, request):
+ call = await continuation(client_call_details, request)
+ interceptor_reached.set()
+ await wait_for_ever
+
+ channel = aio.insecure_channel(UNREACHABLE_TARGET,
+ interceptors=[Interceptor()])
+ request = messages_pb2.StreamingOutputCallRequest()
+ stub = test_pb2_grpc.TestServiceStub(channel)
+ call = stub.StreamingOutputCall(request)
+
+ self.assertFalse(call.cancelled())
+ self.assertFalse(call.done())
+
+ await interceptor_reached.wait()
+ self.assertTrue(call.cancel())
+
+ with self.assertRaises(asyncio.CancelledError):
+ async for response in call:
+ pass
+
+ self.assertTrue(call.cancelled())
+ self.assertTrue(call.done())
+ self.assertEqual(await call.code(), grpc.StatusCode.CANCELLED)
+ self.assertEqual(await call.initial_metadata(), None)
+ self.assertEqual(await call.trailing_metadata(), None)
+ await channel.close()
+
+ async def test_cancel_consuming_response_iterator(self):
+ request = messages_pb2.StreamingOutputCallRequest()
+ request.response_parameters.extend(
+ [messages_pb2.ResponseParameters(size=_RESPONSE_PAYLOAD_SIZE)] *
+ _NUM_STREAM_RESPONSES)
+
+ channel = aio.insecure_channel(
+ self._server_target,
+ interceptors=[_UnaryStreamInterceptorWithResponseIterator()])
+ stub = test_pb2_grpc.TestServiceStub(channel)
+ call = stub.StreamingOutputCall(request)
+
+ with self.assertRaises(asyncio.CancelledError):
+ async for response in call:
+ call.cancel()
+
+ self.assertTrue(call.cancelled())
+ self.assertTrue(call.done())
+ self.assertEqual(await call.code(), grpc.StatusCode.CANCELLED)
+ await channel.close()
+
+ async def test_cancel_by_the_interceptor(self):
+
+ class Interceptor(aio.UnaryStreamClientInterceptor):
+
+ async def intercept_unary_stream(self, continuation,
+ client_call_details, request):
+ call = await continuation(client_call_details, request)
+ call.cancel()
+ return call
+
+ channel = aio.insecure_channel(UNREACHABLE_TARGET,
+ interceptors=[Interceptor()])
+ request = messages_pb2.StreamingOutputCallRequest()
+ stub = test_pb2_grpc.TestServiceStub(channel)
+ call = stub.StreamingOutputCall(request)
+
+ with self.assertRaises(asyncio.CancelledError):
+ async for response in call:
+ pass
+
+ self.assertTrue(call.cancelled())
+ self.assertTrue(call.done())
+ self.assertEqual(await call.code(), grpc.StatusCode.CANCELLED)
+ await channel.close()
+
+ async def test_exception_raised_by_interceptor(self):
+
+ class InterceptorException(Exception):
+ pass
+
+ class Interceptor(aio.UnaryStreamClientInterceptor):
+
+ async def intercept_unary_stream(self, continuation,
+ client_call_details, request):
+ raise InterceptorException
+
+ channel = aio.insecure_channel(UNREACHABLE_TARGET,
+ interceptors=[Interceptor()])
+ request = messages_pb2.StreamingOutputCallRequest()
+ stub = test_pb2_grpc.TestServiceStub(channel)
+ call = stub.StreamingOutputCall(request)
+
+ with self.assertRaises(InterceptorException):
+ async for response in call:
+ pass
+
+ await channel.close()
+
+
+if __name__ == '__main__':
+ logging.basicConfig(level=logging.DEBUG)
+ unittest.main(verbosity=2)
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/client_unary_unary_interceptor_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/client_unary_unary_interceptor_test.py
index 12af6629ac8..e64daec7df4 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/client_unary_unary_interceptor_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/client_unary_unary_interceptor_test.py
@@ -1,699 +1,699 @@
-# Copyright 2019 The gRPC Authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-import asyncio
-import logging
-import unittest
-
-import grpc
-
-from grpc.experimental import aio
-from tests_aio.unit._test_server import start_test_server, _INITIAL_METADATA_KEY, _TRAILING_METADATA_KEY
-from tests_aio.unit import _constants
-from tests_aio.unit import _common
-from tests_aio.unit._test_base import AioTestBase
-from src.proto.grpc.testing import messages_pb2, test_pb2_grpc
-
-_LOCAL_CANCEL_DETAILS_EXPECTATION = 'Locally cancelled by application!'
-_INITIAL_METADATA_TO_INJECT = aio.Metadata(
- (_INITIAL_METADATA_KEY, 'extra info'),
- (_TRAILING_METADATA_KEY, b'\x13\x37'),
-)
-_TIMEOUT_CHECK_IF_CALLBACK_WAS_CALLED = 1.0
-
-
-class TestUnaryUnaryClientInterceptor(AioTestBase):
-
- async def setUp(self):
- self._server_target, self._server = await start_test_server()
-
- async def tearDown(self):
- await self._server.stop(None)
-
- def test_invalid_interceptor(self):
-
- class InvalidInterceptor:
- """Just an invalid Interceptor"""
-
- with self.assertRaises(ValueError):
- aio.insecure_channel("", interceptors=[InvalidInterceptor()])
-
- async def test_executed_right_order(self):
-
- interceptors_executed = []
-
- class Interceptor(aio.UnaryUnaryClientInterceptor):
- """Interceptor used for testing if the interceptor is being called"""
-
- async def intercept_unary_unary(self, continuation,
- client_call_details, request):
- interceptors_executed.append(self)
- call = await continuation(client_call_details, request)
- return call
-
- interceptors = [Interceptor() for i in range(2)]
-
- async with aio.insecure_channel(self._server_target,
- interceptors=interceptors) as channel:
- multicallable = channel.unary_unary(
- '/grpc.testing.TestService/UnaryCall',
- request_serializer=messages_pb2.SimpleRequest.SerializeToString,
- response_deserializer=messages_pb2.SimpleResponse.FromString)
- call = multicallable(messages_pb2.SimpleRequest())
- response = await call
-
- # Check that all interceptors were executed, and were executed
- # in the right order.
- self.assertSequenceEqual(interceptors_executed, interceptors)
-
- self.assertIsInstance(response, messages_pb2.SimpleResponse)
-
- @unittest.expectedFailure
- # TODO(https://github.com/grpc/grpc/issues/20144) Once metadata support is
- # implemented in the client-side, this test must be implemented.
- def test_modify_metadata(self):
- raise NotImplementedError()
-
- @unittest.expectedFailure
- # TODO(https://github.com/grpc/grpc/issues/20532) Once credentials support is
- # implemented in the client-side, this test must be implemented.
- def test_modify_credentials(self):
- raise NotImplementedError()
-
- async def test_status_code_Ok(self):
-
- class StatusCodeOkInterceptor(aio.UnaryUnaryClientInterceptor):
- """Interceptor used for observing status code Ok returned by the RPC"""
-
- def __init__(self):
- self.status_code_Ok_observed = False
-
- async def intercept_unary_unary(self, continuation,
- client_call_details, request):
- call = await continuation(client_call_details, request)
- code = await call.code()
- if code == grpc.StatusCode.OK:
- self.status_code_Ok_observed = True
-
- return call
-
- interceptor = StatusCodeOkInterceptor()
-
- async with aio.insecure_channel(self._server_target,
- interceptors=[interceptor]) as channel:
-
- # when no error StatusCode.OK must be observed
- multicallable = channel.unary_unary(
- '/grpc.testing.TestService/UnaryCall',
- request_serializer=messages_pb2.SimpleRequest.SerializeToString,
- response_deserializer=messages_pb2.SimpleResponse.FromString)
-
- await multicallable(messages_pb2.SimpleRequest())
-
- self.assertTrue(interceptor.status_code_Ok_observed)
-
- async def test_add_timeout(self):
-
- class TimeoutInterceptor(aio.UnaryUnaryClientInterceptor):
- """Interceptor used for adding a timeout to the RPC"""
-
- async def intercept_unary_unary(self, continuation,
- client_call_details, request):
- new_client_call_details = aio.ClientCallDetails(
- method=client_call_details.method,
- timeout=_constants.UNARY_CALL_WITH_SLEEP_VALUE / 2,
- metadata=client_call_details.metadata,
- credentials=client_call_details.credentials,
- wait_for_ready=client_call_details.wait_for_ready)
- return await continuation(new_client_call_details, request)
-
- interceptor = TimeoutInterceptor()
-
- async with aio.insecure_channel(self._server_target,
- interceptors=[interceptor]) as channel:
-
- multicallable = channel.unary_unary(
- '/grpc.testing.TestService/UnaryCallWithSleep',
- request_serializer=messages_pb2.SimpleRequest.SerializeToString,
- response_deserializer=messages_pb2.SimpleResponse.FromString)
-
- call = multicallable(messages_pb2.SimpleRequest())
-
- with self.assertRaises(aio.AioRpcError) as exception_context:
- await call
-
- self.assertEqual(exception_context.exception.code(),
- grpc.StatusCode.DEADLINE_EXCEEDED)
-
- self.assertTrue(call.done())
- self.assertEqual(grpc.StatusCode.DEADLINE_EXCEEDED, await
- call.code())
-
- async def test_retry(self):
-
- class RetryInterceptor(aio.UnaryUnaryClientInterceptor):
- """Simulates a Retry Interceptor which ends up by making
- two RPC calls."""
-
- def __init__(self):
- self.calls = []
-
- async def intercept_unary_unary(self, continuation,
- client_call_details, request):
-
- new_client_call_details = aio.ClientCallDetails(
- method=client_call_details.method,
- timeout=_constants.UNARY_CALL_WITH_SLEEP_VALUE / 2,
- metadata=client_call_details.metadata,
- credentials=client_call_details.credentials,
- wait_for_ready=client_call_details.wait_for_ready)
-
- try:
- call = await continuation(new_client_call_details, request)
- await call
- except grpc.RpcError:
- pass
-
- self.calls.append(call)
-
- new_client_call_details = aio.ClientCallDetails(
- method=client_call_details.method,
- timeout=None,
- metadata=client_call_details.metadata,
- credentials=client_call_details.credentials,
- wait_for_ready=client_call_details.wait_for_ready)
-
- call = await continuation(new_client_call_details, request)
- self.calls.append(call)
- return call
-
- interceptor = RetryInterceptor()
-
- async with aio.insecure_channel(self._server_target,
- interceptors=[interceptor]) as channel:
-
- multicallable = channel.unary_unary(
- '/grpc.testing.TestService/UnaryCallWithSleep',
- request_serializer=messages_pb2.SimpleRequest.SerializeToString,
- response_deserializer=messages_pb2.SimpleResponse.FromString)
-
- call = multicallable(messages_pb2.SimpleRequest())
-
- await call
-
- self.assertEqual(grpc.StatusCode.OK, await call.code())
-
- # Check that two calls were made, first one finishing with
- # a deadline and second one finishing ok..
- self.assertEqual(len(interceptor.calls), 2)
- self.assertEqual(await interceptor.calls[0].code(),
- grpc.StatusCode.DEADLINE_EXCEEDED)
- self.assertEqual(await interceptor.calls[1].code(),
- grpc.StatusCode.OK)
-
- async def test_rpcresponse(self):
-
- class Interceptor(aio.UnaryUnaryClientInterceptor):
- """Raw responses are seen as reegular calls"""
-
- async def intercept_unary_unary(self, continuation,
- client_call_details, request):
- call = await continuation(client_call_details, request)
- response = await call
- return call
-
- class ResponseInterceptor(aio.UnaryUnaryClientInterceptor):
- """Return a raw response"""
- response = messages_pb2.SimpleResponse()
-
- async def intercept_unary_unary(self, continuation,
- client_call_details, request):
- return ResponseInterceptor.response
-
- interceptor, interceptor_response = Interceptor(), ResponseInterceptor()
-
- async with aio.insecure_channel(
- self._server_target,
- interceptors=[interceptor, interceptor_response]) as channel:
-
- multicallable = channel.unary_unary(
- '/grpc.testing.TestService/UnaryCall',
- request_serializer=messages_pb2.SimpleRequest.SerializeToString,
- response_deserializer=messages_pb2.SimpleResponse.FromString)
-
- call = multicallable(messages_pb2.SimpleRequest())
- response = await call
-
- # Check that the response returned is the one returned by the
- # interceptor
- self.assertEqual(id(response), id(ResponseInterceptor.response))
-
- # Check all of the UnaryUnaryCallResponse attributes
- self.assertTrue(call.done())
- self.assertFalse(call.cancel())
- self.assertFalse(call.cancelled())
- self.assertEqual(await call.code(), grpc.StatusCode.OK)
- self.assertEqual(await call.details(), '')
- self.assertEqual(await call.initial_metadata(), None)
- self.assertEqual(await call.trailing_metadata(), None)
- self.assertEqual(await call.debug_error_string(), None)
-
-
-class TestInterceptedUnaryUnaryCall(AioTestBase):
-
- async def setUp(self):
- self._server_target, self._server = await start_test_server()
-
- async def tearDown(self):
- await self._server.stop(None)
-
- async def test_call_ok(self):
-
- class Interceptor(aio.UnaryUnaryClientInterceptor):
-
- async def intercept_unary_unary(self, continuation,
- client_call_details, request):
- call = await continuation(client_call_details, request)
- return call
-
- async with aio.insecure_channel(self._server_target,
- interceptors=[Interceptor()
- ]) as channel:
-
- multicallable = channel.unary_unary(
- '/grpc.testing.TestService/UnaryCall',
- request_serializer=messages_pb2.SimpleRequest.SerializeToString,
- response_deserializer=messages_pb2.SimpleResponse.FromString)
- call = multicallable(messages_pb2.SimpleRequest())
- response = await call
-
- self.assertTrue(call.done())
- self.assertFalse(call.cancelled())
- self.assertEqual(type(response), messages_pb2.SimpleResponse)
- self.assertEqual(await call.code(), grpc.StatusCode.OK)
- self.assertEqual(await call.details(), '')
- self.assertEqual(await call.initial_metadata(), aio.Metadata())
- self.assertEqual(await call.trailing_metadata(), aio.Metadata())
-
- async def test_call_ok_awaited(self):
-
- class Interceptor(aio.UnaryUnaryClientInterceptor):
-
- async def intercept_unary_unary(self, continuation,
- client_call_details, request):
- call = await continuation(client_call_details, request)
- await call
- return call
-
- async with aio.insecure_channel(self._server_target,
- interceptors=[Interceptor()
- ]) as channel:
-
- multicallable = channel.unary_unary(
- '/grpc.testing.TestService/UnaryCall',
- request_serializer=messages_pb2.SimpleRequest.SerializeToString,
- response_deserializer=messages_pb2.SimpleResponse.FromString)
- call = multicallable(messages_pb2.SimpleRequest())
- response = await call
-
- self.assertTrue(call.done())
- self.assertFalse(call.cancelled())
- self.assertEqual(type(response), messages_pb2.SimpleResponse)
- self.assertEqual(await call.code(), grpc.StatusCode.OK)
- self.assertEqual(await call.details(), '')
- self.assertEqual(await call.initial_metadata(), aio.Metadata())
- self.assertEqual(await call.trailing_metadata(), aio.Metadata())
-
- async def test_call_rpc_error(self):
-
- class Interceptor(aio.UnaryUnaryClientInterceptor):
-
- async def intercept_unary_unary(self, continuation,
- client_call_details, request):
- call = await continuation(client_call_details, request)
- return call
-
- async with aio.insecure_channel(self._server_target,
- interceptors=[Interceptor()
- ]) as channel:
-
- multicallable = channel.unary_unary(
- '/grpc.testing.TestService/UnaryCallWithSleep',
- request_serializer=messages_pb2.SimpleRequest.SerializeToString,
- response_deserializer=messages_pb2.SimpleResponse.FromString)
-
- call = multicallable(
- messages_pb2.SimpleRequest(),
- timeout=_constants.UNARY_CALL_WITH_SLEEP_VALUE / 2)
-
- with self.assertRaises(aio.AioRpcError) as exception_context:
- await call
-
- self.assertTrue(call.done())
- self.assertFalse(call.cancelled())
- self.assertEqual(await call.code(),
- grpc.StatusCode.DEADLINE_EXCEEDED)
- self.assertEqual(await call.details(), 'Deadline Exceeded')
- self.assertEqual(await call.initial_metadata(), aio.Metadata())
- self.assertEqual(await call.trailing_metadata(), aio.Metadata())
-
- async def test_call_rpc_error_awaited(self):
-
- class Interceptor(aio.UnaryUnaryClientInterceptor):
-
- async def intercept_unary_unary(self, continuation,
- client_call_details, request):
- call = await continuation(client_call_details, request)
- await call
- return call
-
- async with aio.insecure_channel(self._server_target,
- interceptors=[Interceptor()
- ]) as channel:
-
- multicallable = channel.unary_unary(
- '/grpc.testing.TestService/UnaryCallWithSleep',
- request_serializer=messages_pb2.SimpleRequest.SerializeToString,
- response_deserializer=messages_pb2.SimpleResponse.FromString)
-
- call = multicallable(
- messages_pb2.SimpleRequest(),
- timeout=_constants.UNARY_CALL_WITH_SLEEP_VALUE / 2)
-
- with self.assertRaises(aio.AioRpcError) as exception_context:
- await call
-
- self.assertTrue(call.done())
- self.assertFalse(call.cancelled())
- self.assertEqual(await call.code(),
- grpc.StatusCode.DEADLINE_EXCEEDED)
- self.assertEqual(await call.details(), 'Deadline Exceeded')
- self.assertEqual(await call.initial_metadata(), aio.Metadata())
- self.assertEqual(await call.trailing_metadata(), aio.Metadata())
-
- async def test_cancel_before_rpc(self):
-
- interceptor_reached = asyncio.Event()
- wait_for_ever = self.loop.create_future()
-
- class Interceptor(aio.UnaryUnaryClientInterceptor):
-
- async def intercept_unary_unary(self, continuation,
- client_call_details, request):
- interceptor_reached.set()
- await wait_for_ever
-
- async with aio.insecure_channel(self._server_target,
- interceptors=[Interceptor()
- ]) as channel:
-
- multicallable = channel.unary_unary(
- '/grpc.testing.TestService/UnaryCall',
- request_serializer=messages_pb2.SimpleRequest.SerializeToString,
- response_deserializer=messages_pb2.SimpleResponse.FromString)
- call = multicallable(messages_pb2.SimpleRequest())
-
- self.assertFalse(call.cancelled())
- self.assertFalse(call.done())
-
- await interceptor_reached.wait()
- self.assertTrue(call.cancel())
-
- with self.assertRaises(asyncio.CancelledError):
- await call
-
- self.assertTrue(call.cancelled())
- self.assertTrue(call.done())
- self.assertEqual(await call.code(), grpc.StatusCode.CANCELLED)
- self.assertEqual(await call.details(),
- _LOCAL_CANCEL_DETAILS_EXPECTATION)
- self.assertEqual(await call.initial_metadata(), None)
- self.assertEqual(await call.trailing_metadata(), None)
-
- async def test_cancel_after_rpc(self):
-
- interceptor_reached = asyncio.Event()
- wait_for_ever = self.loop.create_future()
-
- class Interceptor(aio.UnaryUnaryClientInterceptor):
-
- async def intercept_unary_unary(self, continuation,
- client_call_details, request):
- call = await continuation(client_call_details, request)
- await call
- interceptor_reached.set()
- await wait_for_ever
-
- async with aio.insecure_channel(self._server_target,
- interceptors=[Interceptor()
- ]) as channel:
-
- multicallable = channel.unary_unary(
- '/grpc.testing.TestService/UnaryCall',
- request_serializer=messages_pb2.SimpleRequest.SerializeToString,
- response_deserializer=messages_pb2.SimpleResponse.FromString)
- call = multicallable(messages_pb2.SimpleRequest())
-
- self.assertFalse(call.cancelled())
- self.assertFalse(call.done())
-
- await interceptor_reached.wait()
- self.assertTrue(call.cancel())
-
- with self.assertRaises(asyncio.CancelledError):
- await call
-
- self.assertTrue(call.cancelled())
- self.assertTrue(call.done())
- self.assertEqual(await call.code(), grpc.StatusCode.CANCELLED)
- self.assertEqual(await call.details(),
- _LOCAL_CANCEL_DETAILS_EXPECTATION)
- self.assertEqual(await call.initial_metadata(), None)
- self.assertEqual(await call.trailing_metadata(), None)
-
- async def test_cancel_inside_interceptor_after_rpc_awaiting(self):
-
- class Interceptor(aio.UnaryUnaryClientInterceptor):
-
- async def intercept_unary_unary(self, continuation,
- client_call_details, request):
- call = await continuation(client_call_details, request)
- call.cancel()
- await call
- return call
-
- async with aio.insecure_channel(self._server_target,
- interceptors=[Interceptor()
- ]) as channel:
-
- multicallable = channel.unary_unary(
- '/grpc.testing.TestService/UnaryCall',
- request_serializer=messages_pb2.SimpleRequest.SerializeToString,
- response_deserializer=messages_pb2.SimpleResponse.FromString)
- call = multicallable(messages_pb2.SimpleRequest())
-
- with self.assertRaises(asyncio.CancelledError):
- await call
-
- self.assertTrue(call.cancelled())
- self.assertTrue(call.done())
- self.assertEqual(await call.code(), grpc.StatusCode.CANCELLED)
- self.assertEqual(await call.details(),
- _LOCAL_CANCEL_DETAILS_EXPECTATION)
- self.assertEqual(await call.initial_metadata(), None)
- self.assertEqual(await call.trailing_metadata(), None)
-
- async def test_cancel_inside_interceptor_after_rpc_not_awaiting(self):
-
- class Interceptor(aio.UnaryUnaryClientInterceptor):
-
- async def intercept_unary_unary(self, continuation,
- client_call_details, request):
- call = await continuation(client_call_details, request)
- call.cancel()
- return call
-
- async with aio.insecure_channel(self._server_target,
- interceptors=[Interceptor()
- ]) as channel:
-
- multicallable = channel.unary_unary(
- '/grpc.testing.TestService/UnaryCall',
- request_serializer=messages_pb2.SimpleRequest.SerializeToString,
- response_deserializer=messages_pb2.SimpleResponse.FromString)
- call = multicallable(messages_pb2.SimpleRequest())
-
- with self.assertRaises(asyncio.CancelledError):
- await call
-
- self.assertTrue(call.cancelled())
- self.assertTrue(call.done())
- self.assertEqual(await call.code(), grpc.StatusCode.CANCELLED)
- self.assertEqual(await call.details(),
- _LOCAL_CANCEL_DETAILS_EXPECTATION)
- self.assertEqual(await call.initial_metadata(), aio.Metadata())
- self.assertEqual(
- await call.trailing_metadata(), aio.Metadata(),
- "When the raw response is None, empty metadata is returned")
-
- async def test_initial_metadata_modification(self):
-
- class Interceptor(aio.UnaryUnaryClientInterceptor):
-
- async def intercept_unary_unary(self, continuation,
- client_call_details, request):
- new_metadata = aio.Metadata(*client_call_details.metadata,
- *_INITIAL_METADATA_TO_INJECT)
- new_details = aio.ClientCallDetails(
- method=client_call_details.method,
- timeout=client_call_details.timeout,
- metadata=new_metadata,
- credentials=client_call_details.credentials,
- wait_for_ready=client_call_details.wait_for_ready,
- )
- return await continuation(new_details, request)
-
- async with aio.insecure_channel(self._server_target,
- interceptors=[Interceptor()
- ]) as channel:
- stub = test_pb2_grpc.TestServiceStub(channel)
- call = stub.UnaryCall(messages_pb2.SimpleRequest())
-
- # Expected to see the echoed initial metadata
- self.assertTrue(
- _common.seen_metadatum(
- expected_key=_INITIAL_METADATA_KEY,
- expected_value=_INITIAL_METADATA_TO_INJECT[
- _INITIAL_METADATA_KEY],
- actual=await call.initial_metadata(),
- ))
- # Expected to see the echoed trailing metadata
- self.assertTrue(
- _common.seen_metadatum(
- expected_key=_TRAILING_METADATA_KEY,
- expected_value=_INITIAL_METADATA_TO_INJECT[
- _TRAILING_METADATA_KEY],
- actual=await call.trailing_metadata(),
- ))
- self.assertEqual(await call.code(), grpc.StatusCode.OK)
-
- async def test_add_done_callback_before_finishes(self):
- called = asyncio.Event()
- interceptor_can_continue = asyncio.Event()
-
- def callback(call):
- called.set()
-
- class Interceptor(aio.UnaryUnaryClientInterceptor):
-
- async def intercept_unary_unary(self, continuation,
- client_call_details, request):
-
- await interceptor_can_continue.wait()
- call = await continuation(client_call_details, request)
- return call
-
- async with aio.insecure_channel(self._server_target,
- interceptors=[Interceptor()
- ]) as channel:
-
- multicallable = channel.unary_unary(
- '/grpc.testing.TestService/UnaryCall',
- request_serializer=messages_pb2.SimpleRequest.SerializeToString,
- response_deserializer=messages_pb2.SimpleResponse.FromString)
- call = multicallable(messages_pb2.SimpleRequest())
- call.add_done_callback(callback)
- interceptor_can_continue.set()
- await call
-
- try:
- await asyncio.wait_for(
- called.wait(),
- timeout=_TIMEOUT_CHECK_IF_CALLBACK_WAS_CALLED)
- except:
- self.fail("Callback was not called")
-
- async def test_add_done_callback_after_finishes(self):
- called = asyncio.Event()
-
- def callback(call):
- called.set()
-
- class Interceptor(aio.UnaryUnaryClientInterceptor):
-
- async def intercept_unary_unary(self, continuation,
- client_call_details, request):
-
- call = await continuation(client_call_details, request)
- return call
-
- async with aio.insecure_channel(self._server_target,
- interceptors=[Interceptor()
- ]) as channel:
-
- multicallable = channel.unary_unary(
- '/grpc.testing.TestService/UnaryCall',
- request_serializer=messages_pb2.SimpleRequest.SerializeToString,
- response_deserializer=messages_pb2.SimpleResponse.FromString)
- call = multicallable(messages_pb2.SimpleRequest())
-
- await call
-
- call.add_done_callback(callback)
-
- try:
- await asyncio.wait_for(
- called.wait(),
- timeout=_TIMEOUT_CHECK_IF_CALLBACK_WAS_CALLED)
- except:
- self.fail("Callback was not called")
-
- async def test_add_done_callback_after_finishes_before_await(self):
- called = asyncio.Event()
-
- def callback(call):
- called.set()
-
- class Interceptor(aio.UnaryUnaryClientInterceptor):
-
- async def intercept_unary_unary(self, continuation,
- client_call_details, request):
-
- call = await continuation(client_call_details, request)
- return call
-
- async with aio.insecure_channel(self._server_target,
- interceptors=[Interceptor()
- ]) as channel:
-
- multicallable = channel.unary_unary(
- '/grpc.testing.TestService/UnaryCall',
- request_serializer=messages_pb2.SimpleRequest.SerializeToString,
- response_deserializer=messages_pb2.SimpleResponse.FromString)
- call = multicallable(messages_pb2.SimpleRequest())
-
- call.add_done_callback(callback)
-
- await call
-
- try:
- await asyncio.wait_for(
- called.wait(),
- timeout=_TIMEOUT_CHECK_IF_CALLBACK_WAS_CALLED)
- except:
- self.fail("Callback was not called")
-
-
-if __name__ == '__main__':
- logging.basicConfig(level=logging.DEBUG)
- unittest.main(verbosity=2)
+# Copyright 2019 The gRPC Authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+import asyncio
+import logging
+import unittest
+
+import grpc
+
+from grpc.experimental import aio
+from tests_aio.unit._test_server import start_test_server, _INITIAL_METADATA_KEY, _TRAILING_METADATA_KEY
+from tests_aio.unit import _constants
+from tests_aio.unit import _common
+from tests_aio.unit._test_base import AioTestBase
+from src.proto.grpc.testing import messages_pb2, test_pb2_grpc
+
+_LOCAL_CANCEL_DETAILS_EXPECTATION = 'Locally cancelled by application!'
+_INITIAL_METADATA_TO_INJECT = aio.Metadata(
+ (_INITIAL_METADATA_KEY, 'extra info'),
+ (_TRAILING_METADATA_KEY, b'\x13\x37'),
+)
+_TIMEOUT_CHECK_IF_CALLBACK_WAS_CALLED = 1.0
+
+
+class TestUnaryUnaryClientInterceptor(AioTestBase):
+
+ async def setUp(self):
+ self._server_target, self._server = await start_test_server()
+
+ async def tearDown(self):
+ await self._server.stop(None)
+
+ def test_invalid_interceptor(self):
+
+ class InvalidInterceptor:
+ """Just an invalid Interceptor"""
+
+ with self.assertRaises(ValueError):
+ aio.insecure_channel("", interceptors=[InvalidInterceptor()])
+
+ async def test_executed_right_order(self):
+
+ interceptors_executed = []
+
+ class Interceptor(aio.UnaryUnaryClientInterceptor):
+ """Interceptor used for testing if the interceptor is being called"""
+
+ async def intercept_unary_unary(self, continuation,
+ client_call_details, request):
+ interceptors_executed.append(self)
+ call = await continuation(client_call_details, request)
+ return call
+
+ interceptors = [Interceptor() for i in range(2)]
+
+ async with aio.insecure_channel(self._server_target,
+ interceptors=interceptors) as channel:
+ multicallable = channel.unary_unary(
+ '/grpc.testing.TestService/UnaryCall',
+ request_serializer=messages_pb2.SimpleRequest.SerializeToString,
+ response_deserializer=messages_pb2.SimpleResponse.FromString)
+ call = multicallable(messages_pb2.SimpleRequest())
+ response = await call
+
+ # Check that all interceptors were executed, and were executed
+ # in the right order.
+ self.assertSequenceEqual(interceptors_executed, interceptors)
+
+ self.assertIsInstance(response, messages_pb2.SimpleResponse)
+
+ @unittest.expectedFailure
+ # TODO(https://github.com/grpc/grpc/issues/20144) Once metadata support is
+ # implemented in the client-side, this test must be implemented.
+ def test_modify_metadata(self):
+ raise NotImplementedError()
+
+ @unittest.expectedFailure
+ # TODO(https://github.com/grpc/grpc/issues/20532) Once credentials support is
+ # implemented in the client-side, this test must be implemented.
+ def test_modify_credentials(self):
+ raise NotImplementedError()
+
+ async def test_status_code_Ok(self):
+
+ class StatusCodeOkInterceptor(aio.UnaryUnaryClientInterceptor):
+ """Interceptor used for observing status code Ok returned by the RPC"""
+
+ def __init__(self):
+ self.status_code_Ok_observed = False
+
+ async def intercept_unary_unary(self, continuation,
+ client_call_details, request):
+ call = await continuation(client_call_details, request)
+ code = await call.code()
+ if code == grpc.StatusCode.OK:
+ self.status_code_Ok_observed = True
+
+ return call
+
+ interceptor = StatusCodeOkInterceptor()
+
+ async with aio.insecure_channel(self._server_target,
+ interceptors=[interceptor]) as channel:
+
+ # when no error StatusCode.OK must be observed
+ multicallable = channel.unary_unary(
+ '/grpc.testing.TestService/UnaryCall',
+ request_serializer=messages_pb2.SimpleRequest.SerializeToString,
+ response_deserializer=messages_pb2.SimpleResponse.FromString)
+
+ await multicallable(messages_pb2.SimpleRequest())
+
+ self.assertTrue(interceptor.status_code_Ok_observed)
+
+ async def test_add_timeout(self):
+
+ class TimeoutInterceptor(aio.UnaryUnaryClientInterceptor):
+ """Interceptor used for adding a timeout to the RPC"""
+
+ async def intercept_unary_unary(self, continuation,
+ client_call_details, request):
+ new_client_call_details = aio.ClientCallDetails(
+ method=client_call_details.method,
+ timeout=_constants.UNARY_CALL_WITH_SLEEP_VALUE / 2,
+ metadata=client_call_details.metadata,
+ credentials=client_call_details.credentials,
+ wait_for_ready=client_call_details.wait_for_ready)
+ return await continuation(new_client_call_details, request)
+
+ interceptor = TimeoutInterceptor()
+
+ async with aio.insecure_channel(self._server_target,
+ interceptors=[interceptor]) as channel:
+
+ multicallable = channel.unary_unary(
+ '/grpc.testing.TestService/UnaryCallWithSleep',
+ request_serializer=messages_pb2.SimpleRequest.SerializeToString,
+ response_deserializer=messages_pb2.SimpleResponse.FromString)
+
+ call = multicallable(messages_pb2.SimpleRequest())
+
+ with self.assertRaises(aio.AioRpcError) as exception_context:
+ await call
+
+ self.assertEqual(exception_context.exception.code(),
+ grpc.StatusCode.DEADLINE_EXCEEDED)
+
+ self.assertTrue(call.done())
+ self.assertEqual(grpc.StatusCode.DEADLINE_EXCEEDED, await
+ call.code())
+
+ async def test_retry(self):
+
+ class RetryInterceptor(aio.UnaryUnaryClientInterceptor):
+ """Simulates a Retry Interceptor which ends up by making
+ two RPC calls."""
+
+ def __init__(self):
+ self.calls = []
+
+ async def intercept_unary_unary(self, continuation,
+ client_call_details, request):
+
+ new_client_call_details = aio.ClientCallDetails(
+ method=client_call_details.method,
+ timeout=_constants.UNARY_CALL_WITH_SLEEP_VALUE / 2,
+ metadata=client_call_details.metadata,
+ credentials=client_call_details.credentials,
+ wait_for_ready=client_call_details.wait_for_ready)
+
+ try:
+ call = await continuation(new_client_call_details, request)
+ await call
+ except grpc.RpcError:
+ pass
+
+ self.calls.append(call)
+
+ new_client_call_details = aio.ClientCallDetails(
+ method=client_call_details.method,
+ timeout=None,
+ metadata=client_call_details.metadata,
+ credentials=client_call_details.credentials,
+ wait_for_ready=client_call_details.wait_for_ready)
+
+ call = await continuation(new_client_call_details, request)
+ self.calls.append(call)
+ return call
+
+ interceptor = RetryInterceptor()
+
+ async with aio.insecure_channel(self._server_target,
+ interceptors=[interceptor]) as channel:
+
+ multicallable = channel.unary_unary(
+ '/grpc.testing.TestService/UnaryCallWithSleep',
+ request_serializer=messages_pb2.SimpleRequest.SerializeToString,
+ response_deserializer=messages_pb2.SimpleResponse.FromString)
+
+ call = multicallable(messages_pb2.SimpleRequest())
+
+ await call
+
+ self.assertEqual(grpc.StatusCode.OK, await call.code())
+
+ # Check that two calls were made, first one finishing with
+ # a deadline and second one finishing ok..
+ self.assertEqual(len(interceptor.calls), 2)
+ self.assertEqual(await interceptor.calls[0].code(),
+ grpc.StatusCode.DEADLINE_EXCEEDED)
+ self.assertEqual(await interceptor.calls[1].code(),
+ grpc.StatusCode.OK)
+
+ async def test_rpcresponse(self):
+
+ class Interceptor(aio.UnaryUnaryClientInterceptor):
+ """Raw responses are seen as reegular calls"""
+
+ async def intercept_unary_unary(self, continuation,
+ client_call_details, request):
+ call = await continuation(client_call_details, request)
+ response = await call
+ return call
+
+ class ResponseInterceptor(aio.UnaryUnaryClientInterceptor):
+ """Return a raw response"""
+ response = messages_pb2.SimpleResponse()
+
+ async def intercept_unary_unary(self, continuation,
+ client_call_details, request):
+ return ResponseInterceptor.response
+
+ interceptor, interceptor_response = Interceptor(), ResponseInterceptor()
+
+ async with aio.insecure_channel(
+ self._server_target,
+ interceptors=[interceptor, interceptor_response]) as channel:
+
+ multicallable = channel.unary_unary(
+ '/grpc.testing.TestService/UnaryCall',
+ request_serializer=messages_pb2.SimpleRequest.SerializeToString,
+ response_deserializer=messages_pb2.SimpleResponse.FromString)
+
+ call = multicallable(messages_pb2.SimpleRequest())
+ response = await call
+
+ # Check that the response returned is the one returned by the
+ # interceptor
+ self.assertEqual(id(response), id(ResponseInterceptor.response))
+
+ # Check all of the UnaryUnaryCallResponse attributes
+ self.assertTrue(call.done())
+ self.assertFalse(call.cancel())
+ self.assertFalse(call.cancelled())
+ self.assertEqual(await call.code(), grpc.StatusCode.OK)
+ self.assertEqual(await call.details(), '')
+ self.assertEqual(await call.initial_metadata(), None)
+ self.assertEqual(await call.trailing_metadata(), None)
+ self.assertEqual(await call.debug_error_string(), None)
+
+
+class TestInterceptedUnaryUnaryCall(AioTestBase):
+
+ async def setUp(self):
+ self._server_target, self._server = await start_test_server()
+
+ async def tearDown(self):
+ await self._server.stop(None)
+
+ async def test_call_ok(self):
+
+ class Interceptor(aio.UnaryUnaryClientInterceptor):
+
+ async def intercept_unary_unary(self, continuation,
+ client_call_details, request):
+ call = await continuation(client_call_details, request)
+ return call
+
+ async with aio.insecure_channel(self._server_target,
+ interceptors=[Interceptor()
+ ]) as channel:
+
+ multicallable = channel.unary_unary(
+ '/grpc.testing.TestService/UnaryCall',
+ request_serializer=messages_pb2.SimpleRequest.SerializeToString,
+ response_deserializer=messages_pb2.SimpleResponse.FromString)
+ call = multicallable(messages_pb2.SimpleRequest())
+ response = await call
+
+ self.assertTrue(call.done())
+ self.assertFalse(call.cancelled())
+ self.assertEqual(type(response), messages_pb2.SimpleResponse)
+ self.assertEqual(await call.code(), grpc.StatusCode.OK)
+ self.assertEqual(await call.details(), '')
+ self.assertEqual(await call.initial_metadata(), aio.Metadata())
+ self.assertEqual(await call.trailing_metadata(), aio.Metadata())
+
+ async def test_call_ok_awaited(self):
+
+ class Interceptor(aio.UnaryUnaryClientInterceptor):
+
+ async def intercept_unary_unary(self, continuation,
+ client_call_details, request):
+ call = await continuation(client_call_details, request)
+ await call
+ return call
+
+ async with aio.insecure_channel(self._server_target,
+ interceptors=[Interceptor()
+ ]) as channel:
+
+ multicallable = channel.unary_unary(
+ '/grpc.testing.TestService/UnaryCall',
+ request_serializer=messages_pb2.SimpleRequest.SerializeToString,
+ response_deserializer=messages_pb2.SimpleResponse.FromString)
+ call = multicallable(messages_pb2.SimpleRequest())
+ response = await call
+
+ self.assertTrue(call.done())
+ self.assertFalse(call.cancelled())
+ self.assertEqual(type(response), messages_pb2.SimpleResponse)
+ self.assertEqual(await call.code(), grpc.StatusCode.OK)
+ self.assertEqual(await call.details(), '')
+ self.assertEqual(await call.initial_metadata(), aio.Metadata())
+ self.assertEqual(await call.trailing_metadata(), aio.Metadata())
+
+ async def test_call_rpc_error(self):
+
+ class Interceptor(aio.UnaryUnaryClientInterceptor):
+
+ async def intercept_unary_unary(self, continuation,
+ client_call_details, request):
+ call = await continuation(client_call_details, request)
+ return call
+
+ async with aio.insecure_channel(self._server_target,
+ interceptors=[Interceptor()
+ ]) as channel:
+
+ multicallable = channel.unary_unary(
+ '/grpc.testing.TestService/UnaryCallWithSleep',
+ request_serializer=messages_pb2.SimpleRequest.SerializeToString,
+ response_deserializer=messages_pb2.SimpleResponse.FromString)
+
+ call = multicallable(
+ messages_pb2.SimpleRequest(),
+ timeout=_constants.UNARY_CALL_WITH_SLEEP_VALUE / 2)
+
+ with self.assertRaises(aio.AioRpcError) as exception_context:
+ await call
+
+ self.assertTrue(call.done())
+ self.assertFalse(call.cancelled())
+ self.assertEqual(await call.code(),
+ grpc.StatusCode.DEADLINE_EXCEEDED)
+ self.assertEqual(await call.details(), 'Deadline Exceeded')
+ self.assertEqual(await call.initial_metadata(), aio.Metadata())
+ self.assertEqual(await call.trailing_metadata(), aio.Metadata())
+
+ async def test_call_rpc_error_awaited(self):
+
+ class Interceptor(aio.UnaryUnaryClientInterceptor):
+
+ async def intercept_unary_unary(self, continuation,
+ client_call_details, request):
+ call = await continuation(client_call_details, request)
+ await call
+ return call
+
+ async with aio.insecure_channel(self._server_target,
+ interceptors=[Interceptor()
+ ]) as channel:
+
+ multicallable = channel.unary_unary(
+ '/grpc.testing.TestService/UnaryCallWithSleep',
+ request_serializer=messages_pb2.SimpleRequest.SerializeToString,
+ response_deserializer=messages_pb2.SimpleResponse.FromString)
+
+ call = multicallable(
+ messages_pb2.SimpleRequest(),
+ timeout=_constants.UNARY_CALL_WITH_SLEEP_VALUE / 2)
+
+ with self.assertRaises(aio.AioRpcError) as exception_context:
+ await call
+
+ self.assertTrue(call.done())
+ self.assertFalse(call.cancelled())
+ self.assertEqual(await call.code(),
+ grpc.StatusCode.DEADLINE_EXCEEDED)
+ self.assertEqual(await call.details(), 'Deadline Exceeded')
+ self.assertEqual(await call.initial_metadata(), aio.Metadata())
+ self.assertEqual(await call.trailing_metadata(), aio.Metadata())
+
+ async def test_cancel_before_rpc(self):
+
+ interceptor_reached = asyncio.Event()
+ wait_for_ever = self.loop.create_future()
+
+ class Interceptor(aio.UnaryUnaryClientInterceptor):
+
+ async def intercept_unary_unary(self, continuation,
+ client_call_details, request):
+ interceptor_reached.set()
+ await wait_for_ever
+
+ async with aio.insecure_channel(self._server_target,
+ interceptors=[Interceptor()
+ ]) as channel:
+
+ multicallable = channel.unary_unary(
+ '/grpc.testing.TestService/UnaryCall',
+ request_serializer=messages_pb2.SimpleRequest.SerializeToString,
+ response_deserializer=messages_pb2.SimpleResponse.FromString)
+ call = multicallable(messages_pb2.SimpleRequest())
+
+ self.assertFalse(call.cancelled())
+ self.assertFalse(call.done())
+
+ await interceptor_reached.wait()
+ self.assertTrue(call.cancel())
+
+ with self.assertRaises(asyncio.CancelledError):
+ await call
+
+ self.assertTrue(call.cancelled())
+ self.assertTrue(call.done())
+ self.assertEqual(await call.code(), grpc.StatusCode.CANCELLED)
+ self.assertEqual(await call.details(),
+ _LOCAL_CANCEL_DETAILS_EXPECTATION)
+ self.assertEqual(await call.initial_metadata(), None)
+ self.assertEqual(await call.trailing_metadata(), None)
+
+ async def test_cancel_after_rpc(self):
+
+ interceptor_reached = asyncio.Event()
+ wait_for_ever = self.loop.create_future()
+
+ class Interceptor(aio.UnaryUnaryClientInterceptor):
+
+ async def intercept_unary_unary(self, continuation,
+ client_call_details, request):
+ call = await continuation(client_call_details, request)
+ await call
+ interceptor_reached.set()
+ await wait_for_ever
+
+ async with aio.insecure_channel(self._server_target,
+ interceptors=[Interceptor()
+ ]) as channel:
+
+ multicallable = channel.unary_unary(
+ '/grpc.testing.TestService/UnaryCall',
+ request_serializer=messages_pb2.SimpleRequest.SerializeToString,
+ response_deserializer=messages_pb2.SimpleResponse.FromString)
+ call = multicallable(messages_pb2.SimpleRequest())
+
+ self.assertFalse(call.cancelled())
+ self.assertFalse(call.done())
+
+ await interceptor_reached.wait()
+ self.assertTrue(call.cancel())
+
+ with self.assertRaises(asyncio.CancelledError):
+ await call
+
+ self.assertTrue(call.cancelled())
+ self.assertTrue(call.done())
+ self.assertEqual(await call.code(), grpc.StatusCode.CANCELLED)
+ self.assertEqual(await call.details(),
+ _LOCAL_CANCEL_DETAILS_EXPECTATION)
+ self.assertEqual(await call.initial_metadata(), None)
+ self.assertEqual(await call.trailing_metadata(), None)
+
+ async def test_cancel_inside_interceptor_after_rpc_awaiting(self):
+
+ class Interceptor(aio.UnaryUnaryClientInterceptor):
+
+ async def intercept_unary_unary(self, continuation,
+ client_call_details, request):
+ call = await continuation(client_call_details, request)
+ call.cancel()
+ await call
+ return call
+
+ async with aio.insecure_channel(self._server_target,
+ interceptors=[Interceptor()
+ ]) as channel:
+
+ multicallable = channel.unary_unary(
+ '/grpc.testing.TestService/UnaryCall',
+ request_serializer=messages_pb2.SimpleRequest.SerializeToString,
+ response_deserializer=messages_pb2.SimpleResponse.FromString)
+ call = multicallable(messages_pb2.SimpleRequest())
+
+ with self.assertRaises(asyncio.CancelledError):
+ await call
+
+ self.assertTrue(call.cancelled())
+ self.assertTrue(call.done())
+ self.assertEqual(await call.code(), grpc.StatusCode.CANCELLED)
+ self.assertEqual(await call.details(),
+ _LOCAL_CANCEL_DETAILS_EXPECTATION)
+ self.assertEqual(await call.initial_metadata(), None)
+ self.assertEqual(await call.trailing_metadata(), None)
+
+ async def test_cancel_inside_interceptor_after_rpc_not_awaiting(self):
+
+ class Interceptor(aio.UnaryUnaryClientInterceptor):
+
+ async def intercept_unary_unary(self, continuation,
+ client_call_details, request):
+ call = await continuation(client_call_details, request)
+ call.cancel()
+ return call
+
+ async with aio.insecure_channel(self._server_target,
+ interceptors=[Interceptor()
+ ]) as channel:
+
+ multicallable = channel.unary_unary(
+ '/grpc.testing.TestService/UnaryCall',
+ request_serializer=messages_pb2.SimpleRequest.SerializeToString,
+ response_deserializer=messages_pb2.SimpleResponse.FromString)
+ call = multicallable(messages_pb2.SimpleRequest())
+
+ with self.assertRaises(asyncio.CancelledError):
+ await call
+
+ self.assertTrue(call.cancelled())
+ self.assertTrue(call.done())
+ self.assertEqual(await call.code(), grpc.StatusCode.CANCELLED)
+ self.assertEqual(await call.details(),
+ _LOCAL_CANCEL_DETAILS_EXPECTATION)
+ self.assertEqual(await call.initial_metadata(), aio.Metadata())
+ self.assertEqual(
+ await call.trailing_metadata(), aio.Metadata(),
+ "When the raw response is None, empty metadata is returned")
+
+ async def test_initial_metadata_modification(self):
+
+ class Interceptor(aio.UnaryUnaryClientInterceptor):
+
+ async def intercept_unary_unary(self, continuation,
+ client_call_details, request):
+ new_metadata = aio.Metadata(*client_call_details.metadata,
+ *_INITIAL_METADATA_TO_INJECT)
+ new_details = aio.ClientCallDetails(
+ method=client_call_details.method,
+ timeout=client_call_details.timeout,
+ metadata=new_metadata,
+ credentials=client_call_details.credentials,
+ wait_for_ready=client_call_details.wait_for_ready,
+ )
+ return await continuation(new_details, request)
+
+ async with aio.insecure_channel(self._server_target,
+ interceptors=[Interceptor()
+ ]) as channel:
+ stub = test_pb2_grpc.TestServiceStub(channel)
+ call = stub.UnaryCall(messages_pb2.SimpleRequest())
+
+ # Expected to see the echoed initial metadata
+ self.assertTrue(
+ _common.seen_metadatum(
+ expected_key=_INITIAL_METADATA_KEY,
+ expected_value=_INITIAL_METADATA_TO_INJECT[
+ _INITIAL_METADATA_KEY],
+ actual=await call.initial_metadata(),
+ ))
+ # Expected to see the echoed trailing metadata
+ self.assertTrue(
+ _common.seen_metadatum(
+ expected_key=_TRAILING_METADATA_KEY,
+ expected_value=_INITIAL_METADATA_TO_INJECT[
+ _TRAILING_METADATA_KEY],
+ actual=await call.trailing_metadata(),
+ ))
+ self.assertEqual(await call.code(), grpc.StatusCode.OK)
+
+ async def test_add_done_callback_before_finishes(self):
+ called = asyncio.Event()
+ interceptor_can_continue = asyncio.Event()
+
+ def callback(call):
+ called.set()
+
+ class Interceptor(aio.UnaryUnaryClientInterceptor):
+
+ async def intercept_unary_unary(self, continuation,
+ client_call_details, request):
+
+ await interceptor_can_continue.wait()
+ call = await continuation(client_call_details, request)
+ return call
+
+ async with aio.insecure_channel(self._server_target,
+ interceptors=[Interceptor()
+ ]) as channel:
+
+ multicallable = channel.unary_unary(
+ '/grpc.testing.TestService/UnaryCall',
+ request_serializer=messages_pb2.SimpleRequest.SerializeToString,
+ response_deserializer=messages_pb2.SimpleResponse.FromString)
+ call = multicallable(messages_pb2.SimpleRequest())
+ call.add_done_callback(callback)
+ interceptor_can_continue.set()
+ await call
+
+ try:
+ await asyncio.wait_for(
+ called.wait(),
+ timeout=_TIMEOUT_CHECK_IF_CALLBACK_WAS_CALLED)
+ except:
+ self.fail("Callback was not called")
+
+ async def test_add_done_callback_after_finishes(self):
+ called = asyncio.Event()
+
+ def callback(call):
+ called.set()
+
+ class Interceptor(aio.UnaryUnaryClientInterceptor):
+
+ async def intercept_unary_unary(self, continuation,
+ client_call_details, request):
+
+ call = await continuation(client_call_details, request)
+ return call
+
+ async with aio.insecure_channel(self._server_target,
+ interceptors=[Interceptor()
+ ]) as channel:
+
+ multicallable = channel.unary_unary(
+ '/grpc.testing.TestService/UnaryCall',
+ request_serializer=messages_pb2.SimpleRequest.SerializeToString,
+ response_deserializer=messages_pb2.SimpleResponse.FromString)
+ call = multicallable(messages_pb2.SimpleRequest())
+
+ await call
+
+ call.add_done_callback(callback)
+
+ try:
+ await asyncio.wait_for(
+ called.wait(),
+ timeout=_TIMEOUT_CHECK_IF_CALLBACK_WAS_CALLED)
+ except:
+ self.fail("Callback was not called")
+
+ async def test_add_done_callback_after_finishes_before_await(self):
+ called = asyncio.Event()
+
+ def callback(call):
+ called.set()
+
+ class Interceptor(aio.UnaryUnaryClientInterceptor):
+
+ async def intercept_unary_unary(self, continuation,
+ client_call_details, request):
+
+ call = await continuation(client_call_details, request)
+ return call
+
+ async with aio.insecure_channel(self._server_target,
+ interceptors=[Interceptor()
+ ]) as channel:
+
+ multicallable = channel.unary_unary(
+ '/grpc.testing.TestService/UnaryCall',
+ request_serializer=messages_pb2.SimpleRequest.SerializeToString,
+ response_deserializer=messages_pb2.SimpleResponse.FromString)
+ call = multicallable(messages_pb2.SimpleRequest())
+
+ call.add_done_callback(callback)
+
+ await call
+
+ try:
+ await asyncio.wait_for(
+ called.wait(),
+ timeout=_TIMEOUT_CHECK_IF_CALLBACK_WAS_CALLED)
+ except:
+ self.fail("Callback was not called")
+
+
+if __name__ == '__main__':
+ logging.basicConfig(level=logging.DEBUG)
+ unittest.main(verbosity=2)
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/close_channel_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/close_channel_test.py
index 6163fefa498..20543e95bf7 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/close_channel_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/close_channel_test.py
@@ -1,138 +1,138 @@
-# Copyright 2020 The gRPC Authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-"""Tests behavior of closing a grpc.aio.Channel."""
-
-import asyncio
-import logging
-import unittest
-
-import grpc
-from grpc.experimental import aio
-from grpc.aio import _base_call
-
-from src.proto.grpc.testing import messages_pb2, test_pb2_grpc
-from tests_aio.unit._test_base import AioTestBase
-from tests_aio.unit._test_server import start_test_server
-
-_UNARY_CALL_METHOD_WITH_SLEEP = '/grpc.testing.TestService/UnaryCallWithSleep'
-_LONG_TIMEOUT_THAT_SHOULD_NOT_EXPIRE = 60
-
-
-class TestCloseChannel(AioTestBase):
-
- async def setUp(self):
- self._server_target, self._server = await start_test_server()
-
- async def tearDown(self):
- await self._server.stop(None)
-
- async def test_graceful_close(self):
- channel = aio.insecure_channel(self._server_target)
- UnaryCallWithSleep = channel.unary_unary(
- _UNARY_CALL_METHOD_WITH_SLEEP,
- request_serializer=messages_pb2.SimpleRequest.SerializeToString,
- response_deserializer=messages_pb2.SimpleResponse.FromString,
- )
-
- call = UnaryCallWithSleep(messages_pb2.SimpleRequest())
-
- await channel.close(grace=_LONG_TIMEOUT_THAT_SHOULD_NOT_EXPIRE)
-
- self.assertEqual(grpc.StatusCode.OK, await call.code())
-
- async def test_none_graceful_close(self):
- channel = aio.insecure_channel(self._server_target)
- UnaryCallWithSleep = channel.unary_unary(
- _UNARY_CALL_METHOD_WITH_SLEEP,
- request_serializer=messages_pb2.SimpleRequest.SerializeToString,
- response_deserializer=messages_pb2.SimpleResponse.FromString,
- )
-
- call = UnaryCallWithSleep(messages_pb2.SimpleRequest())
-
- await channel.close(None)
-
- self.assertEqual(grpc.StatusCode.CANCELLED, await call.code())
-
- async def test_close_unary_unary(self):
- channel = aio.insecure_channel(self._server_target)
- stub = test_pb2_grpc.TestServiceStub(channel)
-
- calls = [stub.UnaryCall(messages_pb2.SimpleRequest()) for _ in range(2)]
-
- await channel.close()
-
- for call in calls:
- self.assertTrue(call.cancelled())
-
- async def test_close_unary_stream(self):
- channel = aio.insecure_channel(self._server_target)
- stub = test_pb2_grpc.TestServiceStub(channel)
-
- request = messages_pb2.StreamingOutputCallRequest()
- calls = [stub.StreamingOutputCall(request) for _ in range(2)]
-
- await channel.close()
-
- for call in calls:
- self.assertTrue(call.cancelled())
-
- async def test_close_stream_unary(self):
- channel = aio.insecure_channel(self._server_target)
- stub = test_pb2_grpc.TestServiceStub(channel)
-
- calls = [stub.StreamingInputCall() for _ in range(2)]
-
- await channel.close()
-
- for call in calls:
- self.assertTrue(call.cancelled())
-
- async def test_close_stream_stream(self):
- channel = aio.insecure_channel(self._server_target)
- stub = test_pb2_grpc.TestServiceStub(channel)
-
- calls = [stub.FullDuplexCall() for _ in range(2)]
-
- await channel.close()
-
- for call in calls:
- self.assertTrue(call.cancelled())
-
- async def test_close_async_context(self):
- async with aio.insecure_channel(self._server_target) as channel:
- stub = test_pb2_grpc.TestServiceStub(channel)
- calls = [
- stub.UnaryCall(messages_pb2.SimpleRequest()) for _ in range(2)
- ]
-
- for call in calls:
- self.assertTrue(call.cancelled())
-
- async def test_channel_isolation(self):
- async with aio.insecure_channel(self._server_target) as channel1:
- async with aio.insecure_channel(self._server_target) as channel2:
- stub1 = test_pb2_grpc.TestServiceStub(channel1)
- stub2 = test_pb2_grpc.TestServiceStub(channel2)
-
- call1 = stub1.UnaryCall(messages_pb2.SimpleRequest())
- call2 = stub2.UnaryCall(messages_pb2.SimpleRequest())
-
- self.assertFalse(call1.cancelled())
- self.assertTrue(call2.cancelled())
-
-
-if __name__ == '__main__':
- logging.basicConfig(level=logging.DEBUG)
- unittest.main(verbosity=2)
+# Copyright 2020 The gRPC Authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+"""Tests behavior of closing a grpc.aio.Channel."""
+
+import asyncio
+import logging
+import unittest
+
+import grpc
+from grpc.experimental import aio
+from grpc.aio import _base_call
+
+from src.proto.grpc.testing import messages_pb2, test_pb2_grpc
+from tests_aio.unit._test_base import AioTestBase
+from tests_aio.unit._test_server import start_test_server
+
+_UNARY_CALL_METHOD_WITH_SLEEP = '/grpc.testing.TestService/UnaryCallWithSleep'
+_LONG_TIMEOUT_THAT_SHOULD_NOT_EXPIRE = 60
+
+
+class TestCloseChannel(AioTestBase):
+
+ async def setUp(self):
+ self._server_target, self._server = await start_test_server()
+
+ async def tearDown(self):
+ await self._server.stop(None)
+
+ async def test_graceful_close(self):
+ channel = aio.insecure_channel(self._server_target)
+ UnaryCallWithSleep = channel.unary_unary(
+ _UNARY_CALL_METHOD_WITH_SLEEP,
+ request_serializer=messages_pb2.SimpleRequest.SerializeToString,
+ response_deserializer=messages_pb2.SimpleResponse.FromString,
+ )
+
+ call = UnaryCallWithSleep(messages_pb2.SimpleRequest())
+
+ await channel.close(grace=_LONG_TIMEOUT_THAT_SHOULD_NOT_EXPIRE)
+
+ self.assertEqual(grpc.StatusCode.OK, await call.code())
+
+ async def test_none_graceful_close(self):
+ channel = aio.insecure_channel(self._server_target)
+ UnaryCallWithSleep = channel.unary_unary(
+ _UNARY_CALL_METHOD_WITH_SLEEP,
+ request_serializer=messages_pb2.SimpleRequest.SerializeToString,
+ response_deserializer=messages_pb2.SimpleResponse.FromString,
+ )
+
+ call = UnaryCallWithSleep(messages_pb2.SimpleRequest())
+
+ await channel.close(None)
+
+ self.assertEqual(grpc.StatusCode.CANCELLED, await call.code())
+
+ async def test_close_unary_unary(self):
+ channel = aio.insecure_channel(self._server_target)
+ stub = test_pb2_grpc.TestServiceStub(channel)
+
+ calls = [stub.UnaryCall(messages_pb2.SimpleRequest()) for _ in range(2)]
+
+ await channel.close()
+
+ for call in calls:
+ self.assertTrue(call.cancelled())
+
+ async def test_close_unary_stream(self):
+ channel = aio.insecure_channel(self._server_target)
+ stub = test_pb2_grpc.TestServiceStub(channel)
+
+ request = messages_pb2.StreamingOutputCallRequest()
+ calls = [stub.StreamingOutputCall(request) for _ in range(2)]
+
+ await channel.close()
+
+ for call in calls:
+ self.assertTrue(call.cancelled())
+
+ async def test_close_stream_unary(self):
+ channel = aio.insecure_channel(self._server_target)
+ stub = test_pb2_grpc.TestServiceStub(channel)
+
+ calls = [stub.StreamingInputCall() for _ in range(2)]
+
+ await channel.close()
+
+ for call in calls:
+ self.assertTrue(call.cancelled())
+
+ async def test_close_stream_stream(self):
+ channel = aio.insecure_channel(self._server_target)
+ stub = test_pb2_grpc.TestServiceStub(channel)
+
+ calls = [stub.FullDuplexCall() for _ in range(2)]
+
+ await channel.close()
+
+ for call in calls:
+ self.assertTrue(call.cancelled())
+
+ async def test_close_async_context(self):
+ async with aio.insecure_channel(self._server_target) as channel:
+ stub = test_pb2_grpc.TestServiceStub(channel)
+ calls = [
+ stub.UnaryCall(messages_pb2.SimpleRequest()) for _ in range(2)
+ ]
+
+ for call in calls:
+ self.assertTrue(call.cancelled())
+
+ async def test_channel_isolation(self):
+ async with aio.insecure_channel(self._server_target) as channel1:
+ async with aio.insecure_channel(self._server_target) as channel2:
+ stub1 = test_pb2_grpc.TestServiceStub(channel1)
+ stub2 = test_pb2_grpc.TestServiceStub(channel2)
+
+ call1 = stub1.UnaryCall(messages_pb2.SimpleRequest())
+ call2 = stub2.UnaryCall(messages_pb2.SimpleRequest())
+
+ self.assertFalse(call1.cancelled())
+ self.assertTrue(call2.cancelled())
+
+
+if __name__ == '__main__':
+ logging.basicConfig(level=logging.DEBUG)
+ unittest.main(verbosity=2)
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/compatibility_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/compatibility_test.py
index ae404c5a64b..0bb3a3acc89 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/compatibility_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/compatibility_test.py
@@ -1,380 +1,380 @@
-# Copyright 2020 The gRPC Authors
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-"""Testing the compatibility between AsyncIO stack and the old stack."""
-
-import asyncio
-import logging
-import os
-import random
-import threading
-import unittest
-from concurrent.futures import ThreadPoolExecutor
-from typing import Callable, Iterable, Sequence, Tuple
-
-import grpc
-from grpc.experimental import aio
-
-from src.proto.grpc.testing import messages_pb2, test_pb2_grpc
-from tests.unit.framework.common import test_constants
-from tests_aio.unit import _common
-from tests_aio.unit._test_base import AioTestBase
-from tests_aio.unit._test_server import TestServiceServicer, start_test_server
-
-_NUM_STREAM_RESPONSES = 5
-_REQUEST_PAYLOAD_SIZE = 7
-_RESPONSE_PAYLOAD_SIZE = 42
-_REQUEST = b'\x03\x07'
-_ADHOC_METHOD = '/test/AdHoc'
-
-
-def _unique_options() -> Sequence[Tuple[str, float]]:
- return (('iv', random.random()),)
-
-
-class _AdhocGenericHandler(grpc.GenericRpcHandler):
- _handler: grpc.RpcMethodHandler
-
- def __init__(self):
- self._handler = None
-
- def set_adhoc_handler(self, handler: grpc.RpcMethodHandler):
- self._handler = handler
-
- def service(self, handler_call_details):
- if handler_call_details.method == _ADHOC_METHOD:
- return self._handler
- else:
- return None
-
-
- os.environ.get('GRPC_ASYNCIO_ENGINE', '').lower() == 'custom_io_manager',
- 'Compatible mode needs POLLER completion queue.')
-class TestCompatibility(AioTestBase):
-
- async def setUp(self):
- self._async_server = aio.server(
- options=(('grpc.so_reuseport', 0),),
- migration_thread_pool=ThreadPoolExecutor())
-
- test_pb2_grpc.add_TestServiceServicer_to_server(TestServiceServicer(),
- self._async_server)
- self._adhoc_handlers = _AdhocGenericHandler()
- self._async_server.add_generic_rpc_handlers((self._adhoc_handlers,))
-
- port = self._async_server.add_insecure_port('[::]:0')
- address = 'localhost:%d' % port
- await self._async_server.start()
-
- # Create async stub
- self._async_channel = aio.insecure_channel(address,
- options=_unique_options())
- self._async_stub = test_pb2_grpc.TestServiceStub(self._async_channel)
-
- # Create sync stub
- self._sync_channel = grpc.insecure_channel(address,
- options=_unique_options())
- self._sync_stub = test_pb2_grpc.TestServiceStub(self._sync_channel)
-
- async def tearDown(self):
- self._sync_channel.close()
- await self._async_channel.close()
- await self._async_server.stop(None)
-
- async def _run_in_another_thread(self, func: Callable[[], None]):
- work_done = asyncio.Event(loop=self.loop)
-
- def thread_work():
- func()
- self.loop.call_soon_threadsafe(work_done.set)
-
- thread = threading.Thread(target=thread_work, daemon=True)
- thread.start()
- await work_done.wait()
- thread.join()
-
- async def test_unary_unary(self):
- # Calling async API in this thread
- await self._async_stub.UnaryCall(messages_pb2.SimpleRequest(),
- timeout=test_constants.LONG_TIMEOUT)
-
- # Calling sync API in a different thread
- def sync_work() -> None:
- response, call = self._sync_stub.UnaryCall.with_call(
- messages_pb2.SimpleRequest(),
- timeout=test_constants.LONG_TIMEOUT)
- self.assertIsInstance(response, messages_pb2.SimpleResponse)
- self.assertEqual(grpc.StatusCode.OK, call.code())
-
- await self._run_in_another_thread(sync_work)
-
- async def test_unary_stream(self):
- request = messages_pb2.StreamingOutputCallRequest()
- for _ in range(_NUM_STREAM_RESPONSES):
- request.response_parameters.append(
- messages_pb2.ResponseParameters(size=_RESPONSE_PAYLOAD_SIZE))
-
- # Calling async API in this thread
- call = self._async_stub.StreamingOutputCall(request)
-
- for _ in range(_NUM_STREAM_RESPONSES):
- await call.read()
- self.assertEqual(grpc.StatusCode.OK, await call.code())
-
- # Calling sync API in a different thread
- def sync_work() -> None:
- response_iterator = self._sync_stub.StreamingOutputCall(request)
- for response in response_iterator:
- assert _RESPONSE_PAYLOAD_SIZE == len(response.payload.body)
- self.assertEqual(grpc.StatusCode.OK, response_iterator.code())
-
- await self._run_in_another_thread(sync_work)
-
- async def test_stream_unary(self):
- payload = messages_pb2.Payload(body=b'\0' * _REQUEST_PAYLOAD_SIZE)
- request = messages_pb2.StreamingInputCallRequest(payload=payload)
-
- # Calling async API in this thread
- async def gen():
- for _ in range(_NUM_STREAM_RESPONSES):
- yield request
-
- response = await self._async_stub.StreamingInputCall(gen())
- self.assertEqual(_NUM_STREAM_RESPONSES * _REQUEST_PAYLOAD_SIZE,
- response.aggregated_payload_size)
-
- # Calling sync API in a different thread
- def sync_work() -> None:
- response = self._sync_stub.StreamingInputCall(
- iter([request] * _NUM_STREAM_RESPONSES))
- self.assertEqual(_NUM_STREAM_RESPONSES * _REQUEST_PAYLOAD_SIZE,
- response.aggregated_payload_size)
-
- await self._run_in_another_thread(sync_work)
-
- async def test_stream_stream(self):
- request = messages_pb2.StreamingOutputCallRequest()
- request.response_parameters.append(
- messages_pb2.ResponseParameters(size=_RESPONSE_PAYLOAD_SIZE))
-
- # Calling async API in this thread
- call = self._async_stub.FullDuplexCall()
-
- for _ in range(_NUM_STREAM_RESPONSES):
- await call.write(request)
- response = await call.read()
- assert _RESPONSE_PAYLOAD_SIZE == len(response.payload.body)
-
- await call.done_writing()
- assert await call.code() == grpc.StatusCode.OK
-
- # Calling sync API in a different thread
- def sync_work() -> None:
- response_iterator = self._sync_stub.FullDuplexCall(iter([request]))
- for response in response_iterator:
- assert _RESPONSE_PAYLOAD_SIZE == len(response.payload.body)
- self.assertEqual(grpc.StatusCode.OK, response_iterator.code())
-
- await self._run_in_another_thread(sync_work)
-
- async def test_server(self):
-
- class GenericHandlers(grpc.GenericRpcHandler):
-
- def service(self, handler_call_details):
- return grpc.unary_unary_rpc_method_handler(lambda x, _: x)
-
- # It's fine to instantiate server object in the event loop thread.
- # The server will spawn its own serving thread.
- server = grpc.server(ThreadPoolExecutor(),
- handlers=(GenericHandlers(),))
- port = server.add_insecure_port('localhost:0')
- server.start()
-
- def sync_work() -> None:
- for _ in range(100):
- with grpc.insecure_channel('localhost:%d' % port) as channel:
- response = channel.unary_unary('/test/test')(b'\x07\x08')
- self.assertEqual(response, b'\x07\x08')
-
- await self._run_in_another_thread(sync_work)
-
- async def test_many_loop(self):
- address, server = await start_test_server()
-
- # Run another loop in another thread
- def sync_work():
-
- async def async_work():
- # Create async stub
- async_channel = aio.insecure_channel(address,
- options=_unique_options())
- async_stub = test_pb2_grpc.TestServiceStub(async_channel)
-
- call = async_stub.UnaryCall(messages_pb2.SimpleRequest())
- response = await call
- self.assertIsInstance(response, messages_pb2.SimpleResponse)
- self.assertEqual(grpc.StatusCode.OK, await call.code())
-
- loop = asyncio.new_event_loop()
- loop.run_until_complete(async_work())
-
- await self._run_in_another_thread(sync_work)
- await server.stop(None)
-
- async def test_sync_unary_unary_success(self):
-
- @grpc.unary_unary_rpc_method_handler
- def echo_unary_unary(request: bytes, unused_context):
- return request
-
- self._adhoc_handlers.set_adhoc_handler(echo_unary_unary)
- response = await self._async_channel.unary_unary(_ADHOC_METHOD)(_REQUEST
- )
- self.assertEqual(_REQUEST, response)
-
- async def test_sync_unary_unary_metadata(self):
- metadata = (('unique', 'key-42'),)
-
- @grpc.unary_unary_rpc_method_handler
- def metadata_unary_unary(request: bytes, context: grpc.ServicerContext):
- context.send_initial_metadata(metadata)
- return request
-
- self._adhoc_handlers.set_adhoc_handler(metadata_unary_unary)
- call = self._async_channel.unary_unary(_ADHOC_METHOD)(_REQUEST)
- self.assertTrue(
- _common.seen_metadata(aio.Metadata(*metadata), await
- call.initial_metadata()))
-
- async def test_sync_unary_unary_abort(self):
-
- @grpc.unary_unary_rpc_method_handler
- def abort_unary_unary(request: bytes, context: grpc.ServicerContext):
- context.abort(grpc.StatusCode.INTERNAL, 'Test')
-
- self._adhoc_handlers.set_adhoc_handler(abort_unary_unary)
- with self.assertRaises(aio.AioRpcError) as exception_context:
- await self._async_channel.unary_unary(_ADHOC_METHOD)(_REQUEST)
- self.assertEqual(grpc.StatusCode.INTERNAL,
- exception_context.exception.code())
-
- async def test_sync_unary_unary_set_code(self):
-
- @grpc.unary_unary_rpc_method_handler
- def set_code_unary_unary(request: bytes, context: grpc.ServicerContext):
- context.set_code(grpc.StatusCode.INTERNAL)
-
- self._adhoc_handlers.set_adhoc_handler(set_code_unary_unary)
- with self.assertRaises(aio.AioRpcError) as exception_context:
- await self._async_channel.unary_unary(_ADHOC_METHOD)(_REQUEST)
- self.assertEqual(grpc.StatusCode.INTERNAL,
- exception_context.exception.code())
-
- async def test_sync_unary_stream_success(self):
-
- @grpc.unary_stream_rpc_method_handler
- def echo_unary_stream(request: bytes, unused_context):
- for _ in range(_NUM_STREAM_RESPONSES):
- yield request
-
- self._adhoc_handlers.set_adhoc_handler(echo_unary_stream)
- call = self._async_channel.unary_stream(_ADHOC_METHOD)(_REQUEST)
- async for response in call:
- self.assertEqual(_REQUEST, response)
-
- async def test_sync_unary_stream_error(self):
-
- @grpc.unary_stream_rpc_method_handler
- def error_unary_stream(request: bytes, unused_context):
- for _ in range(_NUM_STREAM_RESPONSES):
- yield request
- raise RuntimeError('Test')
-
- self._adhoc_handlers.set_adhoc_handler(error_unary_stream)
- call = self._async_channel.unary_stream(_ADHOC_METHOD)(_REQUEST)
- with self.assertRaises(aio.AioRpcError) as exception_context:
- async for response in call:
- self.assertEqual(_REQUEST, response)
- self.assertEqual(grpc.StatusCode.UNKNOWN,
- exception_context.exception.code())
-
- async def test_sync_stream_unary_success(self):
-
- @grpc.stream_unary_rpc_method_handler
- def echo_stream_unary(request_iterator: Iterable[bytes],
- unused_context):
- self.assertEqual(len(list(request_iterator)), _NUM_STREAM_RESPONSES)
- return _REQUEST
-
- self._adhoc_handlers.set_adhoc_handler(echo_stream_unary)
- request_iterator = iter([_REQUEST] * _NUM_STREAM_RESPONSES)
- response = await self._async_channel.stream_unary(_ADHOC_METHOD)(
- request_iterator)
- self.assertEqual(_REQUEST, response)
-
- async def test_sync_stream_unary_error(self):
-
- @grpc.stream_unary_rpc_method_handler
- def echo_stream_unary(request_iterator: Iterable[bytes],
- unused_context):
- self.assertEqual(len(list(request_iterator)), _NUM_STREAM_RESPONSES)
- raise RuntimeError('Test')
-
- self._adhoc_handlers.set_adhoc_handler(echo_stream_unary)
- request_iterator = iter([_REQUEST] * _NUM_STREAM_RESPONSES)
- with self.assertRaises(aio.AioRpcError) as exception_context:
- response = await self._async_channel.stream_unary(_ADHOC_METHOD)(
- request_iterator)
- self.assertEqual(grpc.StatusCode.UNKNOWN,
- exception_context.exception.code())
-
- async def test_sync_stream_stream_success(self):
-
- @grpc.stream_stream_rpc_method_handler
- def echo_stream_stream(request_iterator: Iterable[bytes],
- unused_context):
- for request in request_iterator:
- yield request
-
- self._adhoc_handlers.set_adhoc_handler(echo_stream_stream)
- request_iterator = iter([_REQUEST] * _NUM_STREAM_RESPONSES)
- call = self._async_channel.stream_stream(_ADHOC_METHOD)(
- request_iterator)
- async for response in call:
- self.assertEqual(_REQUEST, response)
-
- async def test_sync_stream_stream_error(self):
-
- @grpc.stream_stream_rpc_method_handler
- def echo_stream_stream(request_iterator: Iterable[bytes],
- unused_context):
- for request in request_iterator:
- yield request
- raise RuntimeError('test')
-
- self._adhoc_handlers.set_adhoc_handler(echo_stream_stream)
- request_iterator = iter([_REQUEST] * _NUM_STREAM_RESPONSES)
- call = self._async_channel.stream_stream(_ADHOC_METHOD)(
- request_iterator)
- with self.assertRaises(aio.AioRpcError) as exception_context:
- async for response in call:
- self.assertEqual(_REQUEST, response)
- self.assertEqual(grpc.StatusCode.UNKNOWN,
- exception_context.exception.code())
-
-
-if __name__ == '__main__':
- logging.basicConfig(level=logging.DEBUG)
- unittest.main(verbosity=2)
+# Copyright 2020 The gRPC Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+"""Testing the compatibility between AsyncIO stack and the old stack."""
+
+import asyncio
+import logging
+import os
+import random
+import threading
+import unittest
+from concurrent.futures import ThreadPoolExecutor
+from typing import Callable, Iterable, Sequence, Tuple
+
+import grpc
+from grpc.experimental import aio
+
+from src.proto.grpc.testing import messages_pb2, test_pb2_grpc
+from tests.unit.framework.common import test_constants
+from tests_aio.unit import _common
+from tests_aio.unit._test_base import AioTestBase
+from tests_aio.unit._test_server import TestServiceServicer, start_test_server
+
+_NUM_STREAM_RESPONSES = 5
+_REQUEST_PAYLOAD_SIZE = 7
+_RESPONSE_PAYLOAD_SIZE = 42
+_REQUEST = b'\x03\x07'
+_ADHOC_METHOD = '/test/AdHoc'
+
+
+def _unique_options() -> Sequence[Tuple[str, float]]:
+ return (('iv', random.random()),)
+
+
+class _AdhocGenericHandler(grpc.GenericRpcHandler):
+ _handler: grpc.RpcMethodHandler
+
+ def __init__(self):
+ self._handler = None
+
+ def set_adhoc_handler(self, handler: grpc.RpcMethodHandler):
+ self._handler = handler
+
+ def service(self, handler_call_details):
+ if handler_call_details.method == _ADHOC_METHOD:
+ return self._handler
+ else:
+ return None
+
+
+ os.environ.get('GRPC_ASYNCIO_ENGINE', '').lower() == 'custom_io_manager',
+ 'Compatible mode needs POLLER completion queue.')
+class TestCompatibility(AioTestBase):
+
+ async def setUp(self):
+ self._async_server = aio.server(
+ options=(('grpc.so_reuseport', 0),),
+ migration_thread_pool=ThreadPoolExecutor())
+
+ test_pb2_grpc.add_TestServiceServicer_to_server(TestServiceServicer(),
+ self._async_server)
+ self._adhoc_handlers = _AdhocGenericHandler()
+ self._async_server.add_generic_rpc_handlers((self._adhoc_handlers,))
+
+ port = self._async_server.add_insecure_port('[::]:0')
+ address = 'localhost:%d' % port
+ await self._async_server.start()
+
+ # Create async stub
+ self._async_channel = aio.insecure_channel(address,
+ options=_unique_options())
+ self._async_stub = test_pb2_grpc.TestServiceStub(self._async_channel)
+
+ # Create sync stub
+ self._sync_channel = grpc.insecure_channel(address,
+ options=_unique_options())
+ self._sync_stub = test_pb2_grpc.TestServiceStub(self._sync_channel)
+
+ async def tearDown(self):
+ self._sync_channel.close()
+ await self._async_channel.close()
+ await self._async_server.stop(None)
+
+ async def _run_in_another_thread(self, func: Callable[[], None]):
+ work_done = asyncio.Event(loop=self.loop)
+
+ def thread_work():
+ func()
+ self.loop.call_soon_threadsafe(work_done.set)
+
+ thread = threading.Thread(target=thread_work, daemon=True)
+ thread.start()
+ await work_done.wait()
+ thread.join()
+
+ async def test_unary_unary(self):
+ # Calling async API in this thread
+ await self._async_stub.UnaryCall(messages_pb2.SimpleRequest(),
+ timeout=test_constants.LONG_TIMEOUT)
+
+ # Calling sync API in a different thread
+ def sync_work() -> None:
+ response, call = self._sync_stub.UnaryCall.with_call(
+ messages_pb2.SimpleRequest(),
+ timeout=test_constants.LONG_TIMEOUT)
+ self.assertIsInstance(response, messages_pb2.SimpleResponse)
+ self.assertEqual(grpc.StatusCode.OK, call.code())
+
+ await self._run_in_another_thread(sync_work)
+
+ async def test_unary_stream(self):
+ request = messages_pb2.StreamingOutputCallRequest()
+ for _ in range(_NUM_STREAM_RESPONSES):
+ request.response_parameters.append(
+ messages_pb2.ResponseParameters(size=_RESPONSE_PAYLOAD_SIZE))
+
+ # Calling async API in this thread
+ call = self._async_stub.StreamingOutputCall(request)
+
+ for _ in range(_NUM_STREAM_RESPONSES):
+ await call.read()
+ self.assertEqual(grpc.StatusCode.OK, await call.code())
+
+ # Calling sync API in a different thread
+ def sync_work() -> None:
+ response_iterator = self._sync_stub.StreamingOutputCall(request)
+ for response in response_iterator:
+ assert _RESPONSE_PAYLOAD_SIZE == len(response.payload.body)
+ self.assertEqual(grpc.StatusCode.OK, response_iterator.code())
+
+ await self._run_in_another_thread(sync_work)
+
+ async def test_stream_unary(self):
+ payload = messages_pb2.Payload(body=b'\0' * _REQUEST_PAYLOAD_SIZE)
+ request = messages_pb2.StreamingInputCallRequest(payload=payload)
+
+ # Calling async API in this thread
+ async def gen():
+ for _ in range(_NUM_STREAM_RESPONSES):
+ yield request
+
+ response = await self._async_stub.StreamingInputCall(gen())
+ self.assertEqual(_NUM_STREAM_RESPONSES * _REQUEST_PAYLOAD_SIZE,
+ response.aggregated_payload_size)
+
+ # Calling sync API in a different thread
+ def sync_work() -> None:
+ response = self._sync_stub.StreamingInputCall(
+ iter([request] * _NUM_STREAM_RESPONSES))
+ self.assertEqual(_NUM_STREAM_RESPONSES * _REQUEST_PAYLOAD_SIZE,
+ response.aggregated_payload_size)
+
+ await self._run_in_another_thread(sync_work)
+
+ async def test_stream_stream(self):
+ request = messages_pb2.StreamingOutputCallRequest()
+ request.response_parameters.append(
+ messages_pb2.ResponseParameters(size=_RESPONSE_PAYLOAD_SIZE))
+
+ # Calling async API in this thread
+ call = self._async_stub.FullDuplexCall()
+
+ for _ in range(_NUM_STREAM_RESPONSES):
+ await call.write(request)
+ response = await call.read()
+ assert _RESPONSE_PAYLOAD_SIZE == len(response.payload.body)
+
+ await call.done_writing()
+ assert await call.code() == grpc.StatusCode.OK
+
+ # Calling sync API in a different thread
+ def sync_work() -> None:
+ response_iterator = self._sync_stub.FullDuplexCall(iter([request]))
+ for response in response_iterator:
+ assert _RESPONSE_PAYLOAD_SIZE == len(response.payload.body)
+ self.assertEqual(grpc.StatusCode.OK, response_iterator.code())
+
+ await self._run_in_another_thread(sync_work)
+
+ async def test_server(self):
+
+ class GenericHandlers(grpc.GenericRpcHandler):
+
+ def service(self, handler_call_details):
+ return grpc.unary_unary_rpc_method_handler(lambda x, _: x)
+
+ # It's fine to instantiate server object in the event loop thread.
+ # The server will spawn its own serving thread.
+ server = grpc.server(ThreadPoolExecutor(),
+ handlers=(GenericHandlers(),))
+ port = server.add_insecure_port('localhost:0')
+ server.start()
+
+ def sync_work() -> None:
+ for _ in range(100):
+ with grpc.insecure_channel('localhost:%d' % port) as channel:
+ response = channel.unary_unary('/test/test')(b'\x07\x08')
+ self.assertEqual(response, b'\x07\x08')
+
+ await self._run_in_another_thread(sync_work)
+
+ async def test_many_loop(self):
+ address, server = await start_test_server()
+
+ # Run another loop in another thread
+ def sync_work():
+
+ async def async_work():
+ # Create async stub
+ async_channel = aio.insecure_channel(address,
+ options=_unique_options())
+ async_stub = test_pb2_grpc.TestServiceStub(async_channel)
+
+ call = async_stub.UnaryCall(messages_pb2.SimpleRequest())
+ response = await call
+ self.assertIsInstance(response, messages_pb2.SimpleResponse)
+ self.assertEqual(grpc.StatusCode.OK, await call.code())
+
+ loop = asyncio.new_event_loop()
+ loop.run_until_complete(async_work())
+
+ await self._run_in_another_thread(sync_work)
+ await server.stop(None)
+
+ async def test_sync_unary_unary_success(self):
+
+ @grpc.unary_unary_rpc_method_handler
+ def echo_unary_unary(request: bytes, unused_context):
+ return request
+
+ self._adhoc_handlers.set_adhoc_handler(echo_unary_unary)
+ response = await self._async_channel.unary_unary(_ADHOC_METHOD)(_REQUEST
+ )
+ self.assertEqual(_REQUEST, response)
+
+ async def test_sync_unary_unary_metadata(self):
+ metadata = (('unique', 'key-42'),)
+
+ @grpc.unary_unary_rpc_method_handler
+ def metadata_unary_unary(request: bytes, context: grpc.ServicerContext):
+ context.send_initial_metadata(metadata)
+ return request
+
+ self._adhoc_handlers.set_adhoc_handler(metadata_unary_unary)
+ call = self._async_channel.unary_unary(_ADHOC_METHOD)(_REQUEST)
+ self.assertTrue(
+ _common.seen_metadata(aio.Metadata(*metadata), await
+ call.initial_metadata()))
+
+ async def test_sync_unary_unary_abort(self):
+
+ @grpc.unary_unary_rpc_method_handler
+ def abort_unary_unary(request: bytes, context: grpc.ServicerContext):
+ context.abort(grpc.StatusCode.INTERNAL, 'Test')
+
+ self._adhoc_handlers.set_adhoc_handler(abort_unary_unary)
+ with self.assertRaises(aio.AioRpcError) as exception_context:
+ await self._async_channel.unary_unary(_ADHOC_METHOD)(_REQUEST)
+ self.assertEqual(grpc.StatusCode.INTERNAL,
+ exception_context.exception.code())
+
+ async def test_sync_unary_unary_set_code(self):
+
+ @grpc.unary_unary_rpc_method_handler
+ def set_code_unary_unary(request: bytes, context: grpc.ServicerContext):
+ context.set_code(grpc.StatusCode.INTERNAL)
+
+ self._adhoc_handlers.set_adhoc_handler(set_code_unary_unary)
+ with self.assertRaises(aio.AioRpcError) as exception_context:
+ await self._async_channel.unary_unary(_ADHOC_METHOD)(_REQUEST)
+ self.assertEqual(grpc.StatusCode.INTERNAL,
+ exception_context.exception.code())
+
+ async def test_sync_unary_stream_success(self):
+
+ @grpc.unary_stream_rpc_method_handler
+ def echo_unary_stream(request: bytes, unused_context):
+ for _ in range(_NUM_STREAM_RESPONSES):
+ yield request
+
+ self._adhoc_handlers.set_adhoc_handler(echo_unary_stream)
+ call = self._async_channel.unary_stream(_ADHOC_METHOD)(_REQUEST)
+ async for response in call:
+ self.assertEqual(_REQUEST, response)
+
+ async def test_sync_unary_stream_error(self):
+
+ @grpc.unary_stream_rpc_method_handler
+ def error_unary_stream(request: bytes, unused_context):
+ for _ in range(_NUM_STREAM_RESPONSES):
+ yield request
+ raise RuntimeError('Test')
+
+ self._adhoc_handlers.set_adhoc_handler(error_unary_stream)
+ call = self._async_channel.unary_stream(_ADHOC_METHOD)(_REQUEST)
+ with self.assertRaises(aio.AioRpcError) as exception_context:
+ async for response in call:
+ self.assertEqual(_REQUEST, response)
+ self.assertEqual(grpc.StatusCode.UNKNOWN,
+ exception_context.exception.code())
+
+ async def test_sync_stream_unary_success(self):
+
+ @grpc.stream_unary_rpc_method_handler
+ def echo_stream_unary(request_iterator: Iterable[bytes],
+ unused_context):
+ self.assertEqual(len(list(request_iterator)), _NUM_STREAM_RESPONSES)
+ return _REQUEST
+
+ self._adhoc_handlers.set_adhoc_handler(echo_stream_unary)
+ request_iterator = iter([_REQUEST] * _NUM_STREAM_RESPONSES)
+ response = await self._async_channel.stream_unary(_ADHOC_METHOD)(
+ request_iterator)
+ self.assertEqual(_REQUEST, response)
+
+ async def test_sync_stream_unary_error(self):
+
+ @grpc.stream_unary_rpc_method_handler
+ def echo_stream_unary(request_iterator: Iterable[bytes],
+ unused_context):
+ self.assertEqual(len(list(request_iterator)), _NUM_STREAM_RESPONSES)
+ raise RuntimeError('Test')
+
+ self._adhoc_handlers.set_adhoc_handler(echo_stream_unary)
+ request_iterator = iter([_REQUEST] * _NUM_STREAM_RESPONSES)
+ with self.assertRaises(aio.AioRpcError) as exception_context:
+ response = await self._async_channel.stream_unary(_ADHOC_METHOD)(
+ request_iterator)
+ self.assertEqual(grpc.StatusCode.UNKNOWN,
+ exception_context.exception.code())
+
+ async def test_sync_stream_stream_success(self):
+
+ @grpc.stream_stream_rpc_method_handler
+ def echo_stream_stream(request_iterator: Iterable[bytes],
+ unused_context):
+ for request in request_iterator:
+ yield request
+
+ self._adhoc_handlers.set_adhoc_handler(echo_stream_stream)
+ request_iterator = iter([_REQUEST] * _NUM_STREAM_RESPONSES)
+ call = self._async_channel.stream_stream(_ADHOC_METHOD)(
+ request_iterator)
+ async for response in call:
+ self.assertEqual(_REQUEST, response)
+
+ async def test_sync_stream_stream_error(self):
+
+ @grpc.stream_stream_rpc_method_handler
+ def echo_stream_stream(request_iterator: Iterable[bytes],
+ unused_context):
+ for request in request_iterator:
+ yield request
+ raise RuntimeError('test')
+
+ self._adhoc_handlers.set_adhoc_handler(echo_stream_stream)
+ request_iterator = iter([_REQUEST] * _NUM_STREAM_RESPONSES)
+ call = self._async_channel.stream_stream(_ADHOC_METHOD)(
+ request_iterator)
+ with self.assertRaises(aio.AioRpcError) as exception_context:
+ async for response in call:
+ self.assertEqual(_REQUEST, response)
+ self.assertEqual(grpc.StatusCode.UNKNOWN,
+ exception_context.exception.code())
+
+
+if __name__ == '__main__':
+ logging.basicConfig(level=logging.DEBUG)
+ unittest.main(verbosity=2)
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/compression_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/compression_test.py
index b9f2c8dd976..9d93885ea23 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/compression_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/compression_test.py
@@ -1,196 +1,196 @@
-# Copyright 2020 The gRPC Authors
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-"""Tests behavior around the compression mechanism."""
-
-import asyncio
-import logging
-import platform
-import random
-import unittest
-
-import grpc
-from grpc.experimental import aio
-
-from tests_aio.unit._test_base import AioTestBase
-from tests_aio.unit import _common
-
-_GZIP_CHANNEL_ARGUMENT = ('grpc.default_compression_algorithm', 2)
-_GZIP_DISABLED_CHANNEL_ARGUMENT = ('grpc.compression_enabled_algorithms_bitset',
- 3)
-_DEFLATE_DISABLED_CHANNEL_ARGUMENT = (
- 'grpc.compression_enabled_algorithms_bitset', 5)
-
-_TEST_UNARY_UNARY = '/test/TestUnaryUnary'
-_TEST_SET_COMPRESSION = '/test/TestSetCompression'
-_TEST_DISABLE_COMPRESSION_UNARY = '/test/TestDisableCompressionUnary'
-_TEST_DISABLE_COMPRESSION_STREAM = '/test/TestDisableCompressionStream'
-
-_REQUEST = b'\x01' * 100
-_RESPONSE = b'\x02' * 100
-
-
-async def _test_unary_unary(unused_request, unused_context):
- return _RESPONSE
-
-
-async def _test_set_compression(unused_request_iterator, context):
- assert _REQUEST == await context.read()
- context.set_compression(grpc.Compression.Deflate)
- await context.write(_RESPONSE)
- try:
- context.set_compression(grpc.Compression.Deflate)
- except RuntimeError:
- # NOTE(lidiz) Testing if the servicer context raises exception when
- # the set_compression method is called after initial_metadata sent.
- # After the initial_metadata sent, the server-side has no control over
- # which compression algorithm it should use.
- pass
- else:
- raise ValueError(
- 'Expecting exceptions if set_compression is not effective')
-
-
-async def _test_disable_compression_unary(request, context):
- assert _REQUEST == request
- context.set_compression(grpc.Compression.Deflate)
- context.disable_next_message_compression()
- return _RESPONSE
-
-
-async def _test_disable_compression_stream(unused_request_iterator, context):
- assert _REQUEST == await context.read()
- context.set_compression(grpc.Compression.Deflate)
- await context.write(_RESPONSE)
- context.disable_next_message_compression()
- await context.write(_RESPONSE)
- await context.write(_RESPONSE)
-
-
-_ROUTING_TABLE = {
- _TEST_UNARY_UNARY:
- grpc.unary_unary_rpc_method_handler(_test_unary_unary),
- _TEST_SET_COMPRESSION:
- grpc.stream_stream_rpc_method_handler(_test_set_compression),
- _TEST_DISABLE_COMPRESSION_UNARY:
- grpc.unary_unary_rpc_method_handler(_test_disable_compression_unary),
- _TEST_DISABLE_COMPRESSION_STREAM:
- grpc.stream_stream_rpc_method_handler(_test_disable_compression_stream),
-}
-
-
-class _GenericHandler(grpc.GenericRpcHandler):
-
- def service(self, handler_call_details):
- return _ROUTING_TABLE.get(handler_call_details.method)
-
-
-async def _start_test_server(options=None):
- server = aio.server(options=options)
- port = server.add_insecure_port('[::]:0')
- server.add_generic_rpc_handlers((_GenericHandler(),))
- await server.start()
- return f'localhost:{port}', server
-
-
-class TestCompression(AioTestBase):
-
- async def setUp(self):
- server_options = (_GZIP_DISABLED_CHANNEL_ARGUMENT,)
- self._address, self._server = await _start_test_server(server_options)
- self._channel = aio.insecure_channel(self._address)
-
- async def tearDown(self):
- await self._channel.close()
- await self._server.stop(None)
-
- async def test_channel_level_compression_baned_compression(self):
- # GZIP is disabled, this call should fail
- async with aio.insecure_channel(
- self._address, compression=grpc.Compression.Gzip) as channel:
- multicallable = channel.unary_unary(_TEST_UNARY_UNARY)
- call = multicallable(_REQUEST)
- with self.assertRaises(aio.AioRpcError) as exception_context:
- await call
- rpc_error = exception_context.exception
- self.assertEqual(grpc.StatusCode.UNIMPLEMENTED, rpc_error.code())
-
- async def test_channel_level_compression_allowed_compression(self):
- # Deflate is allowed, this call should succeed
- async with aio.insecure_channel(
- self._address, compression=grpc.Compression.Deflate) as channel:
- multicallable = channel.unary_unary(_TEST_UNARY_UNARY)
- call = multicallable(_REQUEST)
- self.assertEqual(grpc.StatusCode.OK, await call.code())
-
- async def test_client_call_level_compression_baned_compression(self):
- multicallable = self._channel.unary_unary(_TEST_UNARY_UNARY)
-
- # GZIP is disabled, this call should fail
- call = multicallable(_REQUEST, compression=grpc.Compression.Gzip)
- with self.assertRaises(aio.AioRpcError) as exception_context:
- await call
- rpc_error = exception_context.exception
- self.assertEqual(grpc.StatusCode.UNIMPLEMENTED, rpc_error.code())
-
- async def test_client_call_level_compression_allowed_compression(self):
- multicallable = self._channel.unary_unary(_TEST_UNARY_UNARY)
-
- # Deflate is allowed, this call should succeed
- call = multicallable(_REQUEST, compression=grpc.Compression.Deflate)
- self.assertEqual(grpc.StatusCode.OK, await call.code())
-
- async def test_server_call_level_compression(self):
- multicallable = self._channel.stream_stream(_TEST_SET_COMPRESSION)
- call = multicallable()
- await call.write(_REQUEST)
- await call.done_writing()
- self.assertEqual(_RESPONSE, await call.read())
- self.assertEqual(grpc.StatusCode.OK, await call.code())
-
- async def test_server_disable_compression_unary(self):
- multicallable = self._channel.unary_unary(
- _TEST_DISABLE_COMPRESSION_UNARY)
- call = multicallable(_REQUEST)
- self.assertEqual(_RESPONSE, await call)
- self.assertEqual(grpc.StatusCode.OK, await call.code())
-
- async def test_server_disable_compression_stream(self):
- multicallable = self._channel.stream_stream(
- _TEST_DISABLE_COMPRESSION_STREAM)
- call = multicallable()
- await call.write(_REQUEST)
- await call.done_writing()
- self.assertEqual(_RESPONSE, await call.read())
- self.assertEqual(_RESPONSE, await call.read())
- self.assertEqual(_RESPONSE, await call.read())
- self.assertEqual(grpc.StatusCode.OK, await call.code())
-
- async def test_server_default_compression_algorithm(self):
- server = aio.server(compression=grpc.Compression.Deflate)
- port = server.add_insecure_port('[::]:0')
- server.add_generic_rpc_handlers((_GenericHandler(),))
- await server.start()
-
- async with aio.insecure_channel(f'localhost:{port}') as channel:
- multicallable = channel.unary_unary(_TEST_UNARY_UNARY)
- call = multicallable(_REQUEST)
- self.assertEqual(_RESPONSE, await call)
- self.assertEqual(grpc.StatusCode.OK, await call.code())
-
- await server.stop(None)
-
-
-if __name__ == '__main__':
- logging.basicConfig(level=logging.DEBUG)
- unittest.main(verbosity=2)
+# Copyright 2020 The gRPC Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+"""Tests behavior around the compression mechanism."""
+
+import asyncio
+import logging
+import platform
+import random
+import unittest
+
+import grpc
+from grpc.experimental import aio
+
+from tests_aio.unit._test_base import AioTestBase
+from tests_aio.unit import _common
+
+_GZIP_CHANNEL_ARGUMENT = ('grpc.default_compression_algorithm', 2)
+_GZIP_DISABLED_CHANNEL_ARGUMENT = ('grpc.compression_enabled_algorithms_bitset',
+ 3)
+_DEFLATE_DISABLED_CHANNEL_ARGUMENT = (
+ 'grpc.compression_enabled_algorithms_bitset', 5)
+
+_TEST_UNARY_UNARY = '/test/TestUnaryUnary'
+_TEST_SET_COMPRESSION = '/test/TestSetCompression'
+_TEST_DISABLE_COMPRESSION_UNARY = '/test/TestDisableCompressionUnary'
+_TEST_DISABLE_COMPRESSION_STREAM = '/test/TestDisableCompressionStream'
+
+_REQUEST = b'\x01' * 100
+_RESPONSE = b'\x02' * 100
+
+
+async def _test_unary_unary(unused_request, unused_context):
+ return _RESPONSE
+
+
+async def _test_set_compression(unused_request_iterator, context):
+ assert _REQUEST == await context.read()
+ context.set_compression(grpc.Compression.Deflate)
+ await context.write(_RESPONSE)
+ try:
+ context.set_compression(grpc.Compression.Deflate)
+ except RuntimeError:
+ # NOTE(lidiz) Testing if the servicer context raises exception when
+ # the set_compression method is called after initial_metadata sent.
+ # After the initial_metadata sent, the server-side has no control over
+ # which compression algorithm it should use.
+ pass
+ else:
+ raise ValueError(
+ 'Expecting exceptions if set_compression is not effective')
+
+
+async def _test_disable_compression_unary(request, context):
+ assert _REQUEST == request
+ context.set_compression(grpc.Compression.Deflate)
+ context.disable_next_message_compression()
+ return _RESPONSE
+
+
+async def _test_disable_compression_stream(unused_request_iterator, context):
+ assert _REQUEST == await context.read()
+ context.set_compression(grpc.Compression.Deflate)
+ await context.write(_RESPONSE)
+ context.disable_next_message_compression()
+ await context.write(_RESPONSE)
+ await context.write(_RESPONSE)
+
+
+_ROUTING_TABLE = {
+ _TEST_UNARY_UNARY:
+ grpc.unary_unary_rpc_method_handler(_test_unary_unary),
+ _TEST_SET_COMPRESSION:
+ grpc.stream_stream_rpc_method_handler(_test_set_compression),
+ _TEST_DISABLE_COMPRESSION_UNARY:
+ grpc.unary_unary_rpc_method_handler(_test_disable_compression_unary),
+ _TEST_DISABLE_COMPRESSION_STREAM:
+ grpc.stream_stream_rpc_method_handler(_test_disable_compression_stream),
+}
+
+
+class _GenericHandler(grpc.GenericRpcHandler):
+
+ def service(self, handler_call_details):
+ return _ROUTING_TABLE.get(handler_call_details.method)
+
+
+async def _start_test_server(options=None):
+ server = aio.server(options=options)
+ port = server.add_insecure_port('[::]:0')
+ server.add_generic_rpc_handlers((_GenericHandler(),))
+ await server.start()
+ return f'localhost:{port}', server
+
+
+class TestCompression(AioTestBase):
+
+ async def setUp(self):
+ server_options = (_GZIP_DISABLED_CHANNEL_ARGUMENT,)
+ self._address, self._server = await _start_test_server(server_options)
+ self._channel = aio.insecure_channel(self._address)
+
+ async def tearDown(self):
+ await self._channel.close()
+ await self._server.stop(None)
+
+ async def test_channel_level_compression_baned_compression(self):
+ # GZIP is disabled, this call should fail
+ async with aio.insecure_channel(
+ self._address, compression=grpc.Compression.Gzip) as channel:
+ multicallable = channel.unary_unary(_TEST_UNARY_UNARY)
+ call = multicallable(_REQUEST)
+ with self.assertRaises(aio.AioRpcError) as exception_context:
+ await call
+ rpc_error = exception_context.exception
+ self.assertEqual(grpc.StatusCode.UNIMPLEMENTED, rpc_error.code())
+
+ async def test_channel_level_compression_allowed_compression(self):
+ # Deflate is allowed, this call should succeed
+ async with aio.insecure_channel(
+ self._address, compression=grpc.Compression.Deflate) as channel:
+ multicallable = channel.unary_unary(_TEST_UNARY_UNARY)
+ call = multicallable(_REQUEST)
+ self.assertEqual(grpc.StatusCode.OK, await call.code())
+
+ async def test_client_call_level_compression_baned_compression(self):
+ multicallable = self._channel.unary_unary(_TEST_UNARY_UNARY)
+
+ # GZIP is disabled, this call should fail
+ call = multicallable(_REQUEST, compression=grpc.Compression.Gzip)
+ with self.assertRaises(aio.AioRpcError) as exception_context:
+ await call
+ rpc_error = exception_context.exception
+ self.assertEqual(grpc.StatusCode.UNIMPLEMENTED, rpc_error.code())
+
+ async def test_client_call_level_compression_allowed_compression(self):
+ multicallable = self._channel.unary_unary(_TEST_UNARY_UNARY)
+
+ # Deflate is allowed, this call should succeed
+ call = multicallable(_REQUEST, compression=grpc.Compression.Deflate)
+ self.assertEqual(grpc.StatusCode.OK, await call.code())
+
+ async def test_server_call_level_compression(self):
+ multicallable = self._channel.stream_stream(_TEST_SET_COMPRESSION)
+ call = multicallable()
+ await call.write(_REQUEST)
+ await call.done_writing()
+ self.assertEqual(_RESPONSE, await call.read())
+ self.assertEqual(grpc.StatusCode.OK, await call.code())
+
+ async def test_server_disable_compression_unary(self):
+ multicallable = self._channel.unary_unary(
+ _TEST_DISABLE_COMPRESSION_UNARY)
+ call = multicallable(_REQUEST)
+ self.assertEqual(_RESPONSE, await call)
+ self.assertEqual(grpc.StatusCode.OK, await call.code())
+
+ async def test_server_disable_compression_stream(self):
+ multicallable = self._channel.stream_stream(
+ _TEST_DISABLE_COMPRESSION_STREAM)
+ call = multicallable()
+ await call.write(_REQUEST)
+ await call.done_writing()
+ self.assertEqual(_RESPONSE, await call.read())
+ self.assertEqual(_RESPONSE, await call.read())
+ self.assertEqual(_RESPONSE, await call.read())
+ self.assertEqual(grpc.StatusCode.OK, await call.code())
+
+ async def test_server_default_compression_algorithm(self):
+ server = aio.server(compression=grpc.Compression.Deflate)
+ port = server.add_insecure_port('[::]:0')
+ server.add_generic_rpc_handlers((_GenericHandler(),))
+ await server.start()
+
+ async with aio.insecure_channel(f'localhost:{port}') as channel:
+ multicallable = channel.unary_unary(_TEST_UNARY_UNARY)
+ call = multicallable(_REQUEST)
+ self.assertEqual(_RESPONSE, await call)
+ self.assertEqual(grpc.StatusCode.OK, await call.code())
+
+ await server.stop(None)
+
+
+if __name__ == '__main__':
+ logging.basicConfig(level=logging.DEBUG)
+ unittest.main(verbosity=2)
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/connectivity_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/connectivity_test.py
index bb577ec5881..7f98329070b 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/connectivity_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/connectivity_test.py
@@ -1,112 +1,112 @@
-# Copyright 2019 The gRPC Authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-"""Tests behavior of the connectivity state."""
-
-import asyncio
-import logging
-import threading
-import time
-import unittest
-
-import grpc
-from grpc.experimental import aio
-
-from tests.unit.framework.common import test_constants
-from tests_aio.unit import _common
-from tests_aio.unit._constants import UNREACHABLE_TARGET
-from tests_aio.unit._test_base import AioTestBase
-from tests_aio.unit._test_server import start_test_server
-
-
-class TestConnectivityState(AioTestBase):
-
- async def setUp(self):
- self._server_address, self._server = await start_test_server()
-
- async def tearDown(self):
- await self._server.stop(None)
-
- async def test_unavailable_backend(self):
- async with aio.insecure_channel(UNREACHABLE_TARGET) as channel:
- self.assertEqual(grpc.ChannelConnectivity.IDLE,
- channel.get_state(False))
- self.assertEqual(grpc.ChannelConnectivity.IDLE,
- channel.get_state(True))
-
- # Should not time out
- await asyncio.wait_for(
- _common.block_until_certain_state(
- channel, grpc.ChannelConnectivity.TRANSIENT_FAILURE),
- test_constants.SHORT_TIMEOUT)
-
- async def test_normal_backend(self):
- async with aio.insecure_channel(self._server_address) as channel:
- current_state = channel.get_state(True)
- self.assertEqual(grpc.ChannelConnectivity.IDLE, current_state)
-
- # Should not time out
- await asyncio.wait_for(
- _common.block_until_certain_state(
- channel, grpc.ChannelConnectivity.READY),
- test_constants.SHORT_TIMEOUT)
-
- async def test_timeout(self):
- async with aio.insecure_channel(self._server_address) as channel:
- self.assertEqual(grpc.ChannelConnectivity.IDLE,
- channel.get_state(False))
-
- # If timed out, the function should return None.
- with self.assertRaises(asyncio.TimeoutError):
- await asyncio.wait_for(
- _common.block_until_certain_state(
- channel, grpc.ChannelConnectivity.READY),
- test_constants.SHORT_TIMEOUT)
-
- async def test_shutdown(self):
- channel = aio.insecure_channel(self._server_address)
-
- self.assertEqual(grpc.ChannelConnectivity.IDLE,
- channel.get_state(False))
-
- # Waiting for changes in a separate coroutine
- wait_started = asyncio.Event()
-
- async def a_pending_wait():
- wait_started.set()
- await channel.wait_for_state_change(grpc.ChannelConnectivity.IDLE)
-
- pending_task = self.loop.create_task(a_pending_wait())
- await wait_started.wait()
-
- await channel.close()
-
- self.assertEqual(grpc.ChannelConnectivity.SHUTDOWN,
- channel.get_state(True))
-
- self.assertEqual(grpc.ChannelConnectivity.SHUTDOWN,
- channel.get_state(False))
-
- # Make sure there isn't any exception in the task
- await pending_task
-
- # It can raise exceptions since it is an usage error, but it should not
- # segfault or abort.
- with self.assertRaises(aio.UsageError):
- await channel.wait_for_state_change(
- grpc.ChannelConnectivity.SHUTDOWN)
-
-
-if __name__ == '__main__':
- logging.basicConfig(level=logging.DEBUG)
- unittest.main(verbosity=2)
+# Copyright 2019 The gRPC Authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+"""Tests behavior of the connectivity state."""
+
+import asyncio
+import logging
+import threading
+import time
+import unittest
+
+import grpc
+from grpc.experimental import aio
+
+from tests.unit.framework.common import test_constants
+from tests_aio.unit import _common
+from tests_aio.unit._constants import UNREACHABLE_TARGET
+from tests_aio.unit._test_base import AioTestBase
+from tests_aio.unit._test_server import start_test_server
+
+
+class TestConnectivityState(AioTestBase):
+
+ async def setUp(self):
+ self._server_address, self._server = await start_test_server()
+
+ async def tearDown(self):
+ await self._server.stop(None)
+
+ async def test_unavailable_backend(self):
+ async with aio.insecure_channel(UNREACHABLE_TARGET) as channel:
+ self.assertEqual(grpc.ChannelConnectivity.IDLE,
+ channel.get_state(False))
+ self.assertEqual(grpc.ChannelConnectivity.IDLE,
+ channel.get_state(True))
+
+ # Should not time out
+ await asyncio.wait_for(
+ _common.block_until_certain_state(
+ channel, grpc.ChannelConnectivity.TRANSIENT_FAILURE),
+ test_constants.SHORT_TIMEOUT)
+
+ async def test_normal_backend(self):
+ async with aio.insecure_channel(self._server_address) as channel:
+ current_state = channel.get_state(True)
+ self.assertEqual(grpc.ChannelConnectivity.IDLE, current_state)
+
+ # Should not time out
+ await asyncio.wait_for(
+ _common.block_until_certain_state(
+ channel, grpc.ChannelConnectivity.READY),
+ test_constants.SHORT_TIMEOUT)
+
+ async def test_timeout(self):
+ async with aio.insecure_channel(self._server_address) as channel:
+ self.assertEqual(grpc.ChannelConnectivity.IDLE,
+ channel.get_state(False))
+
+ # If timed out, the function should return None.
+ with self.assertRaises(asyncio.TimeoutError):
+ await asyncio.wait_for(
+ _common.block_until_certain_state(
+ channel, grpc.ChannelConnectivity.READY),
+ test_constants.SHORT_TIMEOUT)
+
+ async def test_shutdown(self):
+ channel = aio.insecure_channel(self._server_address)
+
+ self.assertEqual(grpc.ChannelConnectivity.IDLE,
+ channel.get_state(False))
+
+ # Waiting for changes in a separate coroutine
+ wait_started = asyncio.Event()
+
+ async def a_pending_wait():
+ wait_started.set()
+ await channel.wait_for_state_change(grpc.ChannelConnectivity.IDLE)
+
+ pending_task = self.loop.create_task(a_pending_wait())
+ await wait_started.wait()
+
+ await channel.close()
+
+ self.assertEqual(grpc.ChannelConnectivity.SHUTDOWN,
+ channel.get_state(True))
+
+ self.assertEqual(grpc.ChannelConnectivity.SHUTDOWN,
+ channel.get_state(False))
+
+ # Make sure there isn't any exception in the task
+ await pending_task
+
+ # It can raise exceptions since it is an usage error, but it should not
+ # segfault or abort.
+ with self.assertRaises(aio.UsageError):
+ await channel.wait_for_state_change(
+ grpc.ChannelConnectivity.SHUTDOWN)
+
+
+if __name__ == '__main__':
+ logging.basicConfig(level=logging.DEBUG)
+ unittest.main(verbosity=2)
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/context_peer_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/context_peer_test.py
index e53d771a931..ea5f4621afb 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/context_peer_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/context_peer_test.py
@@ -1,65 +1,65 @@
-# Copyright 2020 The gRPC Authors
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-"""Testing the server context ability to access peer info."""
-
-import asyncio
-import logging
-import os
-import unittest
-from typing import Callable, Iterable, Sequence, Tuple
-
-import grpc
-from grpc.experimental import aio
-
-from src.proto.grpc.testing import messages_pb2, test_pb2_grpc
-from tests.unit.framework.common import test_constants
-from tests_aio.unit import _common
-from tests_aio.unit._test_base import AioTestBase
-from tests_aio.unit._test_server import TestServiceServicer, start_test_server
-
-_REQUEST = b'\x03\x07'
-_TEST_METHOD = '/test/UnaryUnary'
-
-
-class TestContextPeer(AioTestBase):
-
- async def test_peer(self):
-
- @grpc.unary_unary_rpc_method_handler
- async def check_peer_unary_unary(request: bytes,
- context: aio.ServicerContext):
- self.assertEqual(_REQUEST, request)
- # The peer address could be ipv4 or ipv6
- self.assertIn('ip', context.peer())
- return request
-
- # Creates a server
- server = aio.server()
- handlers = grpc.method_handlers_generic_handler(
- 'test', {'UnaryUnary': check_peer_unary_unary})
- server.add_generic_rpc_handlers((handlers,))
- port = server.add_insecure_port('[::]:0')
- await server.start()
-
- # Creates a channel
- async with aio.insecure_channel('localhost:%d' % port) as channel:
- response = await channel.unary_unary(_TEST_METHOD)(_REQUEST)
- self.assertEqual(_REQUEST, response)
-
- await server.stop(None)
-
-
-if __name__ == '__main__':
- logging.basicConfig(level=logging.DEBUG)
- unittest.main(verbosity=2)
+# Copyright 2020 The gRPC Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+"""Testing the server context ability to access peer info."""
+
+import asyncio
+import logging
+import os
+import unittest
+from typing import Callable, Iterable, Sequence, Tuple
+
+import grpc
+from grpc.experimental import aio
+
+from src.proto.grpc.testing import messages_pb2, test_pb2_grpc
+from tests.unit.framework.common import test_constants
+from tests_aio.unit import _common
+from tests_aio.unit._test_base import AioTestBase
+from tests_aio.unit._test_server import TestServiceServicer, start_test_server
+
+_REQUEST = b'\x03\x07'
+_TEST_METHOD = '/test/UnaryUnary'
+
+
+class TestContextPeer(AioTestBase):
+
+ async def test_peer(self):
+
+ @grpc.unary_unary_rpc_method_handler
+ async def check_peer_unary_unary(request: bytes,
+ context: aio.ServicerContext):
+ self.assertEqual(_REQUEST, request)
+ # The peer address could be ipv4 or ipv6
+ self.assertIn('ip', context.peer())
+ return request
+
+ # Creates a server
+ server = aio.server()
+ handlers = grpc.method_handlers_generic_handler(
+ 'test', {'UnaryUnary': check_peer_unary_unary})
+ server.add_generic_rpc_handlers((handlers,))
+ port = server.add_insecure_port('[::]:0')
+ await server.start()
+
+ # Creates a channel
+ async with aio.insecure_channel('localhost:%d' % port) as channel:
+ response = await channel.unary_unary(_TEST_METHOD)(_REQUEST)
+ self.assertEqual(_REQUEST, response)
+
+ await server.stop(None)
+
+
+if __name__ == '__main__':
+ logging.basicConfig(level=logging.DEBUG)
+ unittest.main(verbosity=2)
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/done_callback_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/done_callback_test.py
index f4916f52ecc..481bafd5679 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/done_callback_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/done_callback_test.py
@@ -1,124 +1,124 @@
-# Copyright 2020 The gRPC Authors
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-"""Testing the done callbacks mechanism."""
-
-import asyncio
-import logging
-import unittest
-import time
-import gc
-
-import grpc
-from grpc.experimental import aio
-from tests_aio.unit._common import inject_callbacks
-from tests_aio.unit._test_base import AioTestBase
-from tests.unit.framework.common import test_constants
-from src.proto.grpc.testing import messages_pb2, test_pb2_grpc
-from tests_aio.unit._test_server import start_test_server
-
-_NUM_STREAM_RESPONSES = 5
-_REQUEST_PAYLOAD_SIZE = 7
-_RESPONSE_PAYLOAD_SIZE = 42
-
-
-class TestDoneCallback(AioTestBase):
-
- async def setUp(self):
- address, self._server = await start_test_server()
- self._channel = aio.insecure_channel(address)
- self._stub = test_pb2_grpc.TestServiceStub(self._channel)
-
- async def tearDown(self):
- await self._channel.close()
- await self._server.stop(None)
-
- async def test_add_after_done(self):
- call = self._stub.UnaryCall(messages_pb2.SimpleRequest())
- self.assertEqual(grpc.StatusCode.OK, await call.code())
-
- validation = inject_callbacks(call)
- await validation
-
- async def test_unary_unary(self):
- call = self._stub.UnaryCall(messages_pb2.SimpleRequest())
- validation = inject_callbacks(call)
-
- self.assertEqual(grpc.StatusCode.OK, await call.code())
-
- await validation
-
- async def test_unary_stream(self):
- request = messages_pb2.StreamingOutputCallRequest()
- for _ in range(_NUM_STREAM_RESPONSES):
- request.response_parameters.append(
- messages_pb2.ResponseParameters(size=_RESPONSE_PAYLOAD_SIZE))
-
- call = self._stub.StreamingOutputCall(request)
- validation = inject_callbacks(call)
-
- response_cnt = 0
- async for response in call:
- response_cnt += 1
- self.assertIsInstance(response,
- messages_pb2.StreamingOutputCallResponse)
- self.assertEqual(_RESPONSE_PAYLOAD_SIZE, len(response.payload.body))
-
- self.assertEqual(_NUM_STREAM_RESPONSES, response_cnt)
- self.assertEqual(grpc.StatusCode.OK, await call.code())
-
- await validation
-
- async def test_stream_unary(self):
- payload = messages_pb2.Payload(body=b'\0' * _REQUEST_PAYLOAD_SIZE)
- request = messages_pb2.StreamingInputCallRequest(payload=payload)
-
- async def gen():
- for _ in range(_NUM_STREAM_RESPONSES):
- yield request
-
- call = self._stub.StreamingInputCall(gen())
- validation = inject_callbacks(call)
-
- response = await call
- self.assertIsInstance(response, messages_pb2.StreamingInputCallResponse)
- self.assertEqual(_NUM_STREAM_RESPONSES * _REQUEST_PAYLOAD_SIZE,
- response.aggregated_payload_size)
- self.assertEqual(grpc.StatusCode.OK, await call.code())
-
- await validation
-
- async def test_stream_stream(self):
- call = self._stub.FullDuplexCall()
- validation = inject_callbacks(call)
-
- request = messages_pb2.StreamingOutputCallRequest()
- request.response_parameters.append(
- messages_pb2.ResponseParameters(size=_RESPONSE_PAYLOAD_SIZE))
-
- for _ in range(_NUM_STREAM_RESPONSES):
- await call.write(request)
- response = await call.read()
- self.assertIsInstance(response,
- messages_pb2.StreamingOutputCallResponse)
- self.assertEqual(_RESPONSE_PAYLOAD_SIZE, len(response.payload.body))
-
- await call.done_writing()
-
- self.assertEqual(grpc.StatusCode.OK, await call.code())
- await validation
-
-
-if __name__ == '__main__':
- logging.basicConfig(level=logging.DEBUG)
- unittest.main(verbosity=2)
+# Copyright 2020 The gRPC Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+"""Testing the done callbacks mechanism."""
+
+import asyncio
+import logging
+import unittest
+import time
+import gc
+
+import grpc
+from grpc.experimental import aio
+from tests_aio.unit._common import inject_callbacks
+from tests_aio.unit._test_base import AioTestBase
+from tests.unit.framework.common import test_constants
+from src.proto.grpc.testing import messages_pb2, test_pb2_grpc
+from tests_aio.unit._test_server import start_test_server
+
+_NUM_STREAM_RESPONSES = 5
+_REQUEST_PAYLOAD_SIZE = 7
+_RESPONSE_PAYLOAD_SIZE = 42
+
+
+class TestDoneCallback(AioTestBase):
+
+ async def setUp(self):
+ address, self._server = await start_test_server()
+ self._channel = aio.insecure_channel(address)
+ self._stub = test_pb2_grpc.TestServiceStub(self._channel)
+
+ async def tearDown(self):
+ await self._channel.close()
+ await self._server.stop(None)
+
+ async def test_add_after_done(self):
+ call = self._stub.UnaryCall(messages_pb2.SimpleRequest())
+ self.assertEqual(grpc.StatusCode.OK, await call.code())
+
+ validation = inject_callbacks(call)
+ await validation
+
+ async def test_unary_unary(self):
+ call = self._stub.UnaryCall(messages_pb2.SimpleRequest())
+ validation = inject_callbacks(call)
+
+ self.assertEqual(grpc.StatusCode.OK, await call.code())
+
+ await validation
+
+ async def test_unary_stream(self):
+ request = messages_pb2.StreamingOutputCallRequest()
+ for _ in range(_NUM_STREAM_RESPONSES):
+ request.response_parameters.append(
+ messages_pb2.ResponseParameters(size=_RESPONSE_PAYLOAD_SIZE))
+
+ call = self._stub.StreamingOutputCall(request)
+ validation = inject_callbacks(call)
+
+ response_cnt = 0
+ async for response in call:
+ response_cnt += 1
+ self.assertIsInstance(response,
+ messages_pb2.StreamingOutputCallResponse)
+ self.assertEqual(_RESPONSE_PAYLOAD_SIZE, len(response.payload.body))
+
+ self.assertEqual(_NUM_STREAM_RESPONSES, response_cnt)
+ self.assertEqual(grpc.StatusCode.OK, await call.code())
+
+ await validation
+
+ async def test_stream_unary(self):
+ payload = messages_pb2.Payload(body=b'\0' * _REQUEST_PAYLOAD_SIZE)
+ request = messages_pb2.StreamingInputCallRequest(payload=payload)
+
+ async def gen():
+ for _ in range(_NUM_STREAM_RESPONSES):
+ yield request
+
+ call = self._stub.StreamingInputCall(gen())
+ validation = inject_callbacks(call)
+
+ response = await call
+ self.assertIsInstance(response, messages_pb2.StreamingInputCallResponse)
+ self.assertEqual(_NUM_STREAM_RESPONSES * _REQUEST_PAYLOAD_SIZE,
+ response.aggregated_payload_size)
+ self.assertEqual(grpc.StatusCode.OK, await call.code())
+
+ await validation
+
+ async def test_stream_stream(self):
+ call = self._stub.FullDuplexCall()
+ validation = inject_callbacks(call)
+
+ request = messages_pb2.StreamingOutputCallRequest()
+ request.response_parameters.append(
+ messages_pb2.ResponseParameters(size=_RESPONSE_PAYLOAD_SIZE))
+
+ for _ in range(_NUM_STREAM_RESPONSES):
+ await call.write(request)
+ response = await call.read()
+ self.assertIsInstance(response,
+ messages_pb2.StreamingOutputCallResponse)
+ self.assertEqual(_RESPONSE_PAYLOAD_SIZE, len(response.payload.body))
+
+ await call.done_writing()
+
+ self.assertEqual(grpc.StatusCode.OK, await call.code())
+ await validation
+
+
+if __name__ == '__main__':
+ logging.basicConfig(level=logging.DEBUG)
+ unittest.main(verbosity=2)
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/init_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/init_test.py
index 701e6f194b0..b9183a22c75 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/init_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/init_test.py
@@ -14,20 +14,20 @@
import logging
import unittest
-
-class TestInit(unittest.TestCase):
- def test_grpc(self):
- import grpc # pylint: disable=wrong-import-position
- channel = grpc.aio.insecure_channel('dummy')
- self.assertIsInstance(channel, grpc.aio.Channel)
+class TestInit(unittest.TestCase):
+
+ def test_grpc(self):
+ import grpc # pylint: disable=wrong-import-position
+ channel = grpc.aio.insecure_channel('dummy')
+ self.assertIsInstance(channel, grpc.aio.Channel)
+
+ def test_grpc_dot_aio(self):
+ import grpc.aio # pylint: disable=wrong-import-position
+ channel = grpc.aio.insecure_channel('dummy')
+ self.assertIsInstance(channel, grpc.aio.Channel)
- def test_grpc_dot_aio(self):
- import grpc.aio # pylint: disable=wrong-import-position
- channel = grpc.aio.insecure_channel('dummy')
- self.assertIsInstance(channel, grpc.aio.Channel)
-
if __name__ == '__main__':
- logging.basicConfig(level=logging.DEBUG)
+ logging.basicConfig(level=logging.DEBUG)
unittest.main(verbosity=2)
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/metadata_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/metadata_test.py
index e49f8ef220e..2261446b3ea 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/metadata_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/metadata_test.py
@@ -1,297 +1,297 @@
-# Copyright 2020 The gRPC Authors
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-"""Tests behavior around the metadata mechanism."""
-
-import asyncio
-import logging
-import platform
-import random
-import unittest
-
-import grpc
-from grpc.experimental import aio
-
-from tests_aio.unit._test_base import AioTestBase
-from tests_aio.unit import _common
-
-_TEST_CLIENT_TO_SERVER = '/test/TestClientToServer'
-_TEST_SERVER_TO_CLIENT = '/test/TestServerToClient'
-_TEST_TRAILING_METADATA = '/test/TestTrailingMetadata'
-_TEST_ECHO_INITIAL_METADATA = '/test/TestEchoInitialMetadata'
-_TEST_GENERIC_HANDLER = '/test/TestGenericHandler'
-_TEST_UNARY_STREAM = '/test/TestUnaryStream'
-_TEST_STREAM_UNARY = '/test/TestStreamUnary'
-_TEST_STREAM_STREAM = '/test/TestStreamStream'
-
-_REQUEST = b'\x00\x00\x00'
-_RESPONSE = b'\x01\x01\x01'
-
-_INITIAL_METADATA_FROM_CLIENT_TO_SERVER = aio.Metadata(
- ('client-to-server', 'question'),
- ('client-to-server-bin', b'\x07\x07\x07'),
-)
-_INITIAL_METADATA_FROM_SERVER_TO_CLIENT = aio.Metadata(
- ('server-to-client', 'answer'),
- ('server-to-client-bin', b'\x06\x06\x06'),
-)
-_TRAILING_METADATA = aio.Metadata(
- ('a-trailing-metadata', 'stack-trace'),
- ('a-trailing-metadata-bin', b'\x05\x05\x05'),
-)
-_INITIAL_METADATA_FOR_GENERIC_HANDLER = aio.Metadata(
- ('a-must-have-key', 'secret'),)
-
-_INVALID_METADATA_TEST_CASES = (
- (
- TypeError,
- ((42, 42),),
- ),
- (
- TypeError,
- (({}, {}),),
- ),
- (
- TypeError,
- ((None, {}),),
- ),
- (
- TypeError,
- (({}, {}),),
- ),
- (
- TypeError,
- (('normal', object()),),
- ),
-)
-
-
-class _TestGenericHandlerForMethods(grpc.GenericRpcHandler):
-
- def __init__(self):
- self._routing_table = {
- _TEST_CLIENT_TO_SERVER:
- grpc.unary_unary_rpc_method_handler(self._test_client_to_server
- ),
- _TEST_SERVER_TO_CLIENT:
- grpc.unary_unary_rpc_method_handler(self._test_server_to_client
- ),
- _TEST_TRAILING_METADATA:
- grpc.unary_unary_rpc_method_handler(self._test_trailing_metadata
- ),
- _TEST_UNARY_STREAM:
- grpc.unary_stream_rpc_method_handler(self._test_unary_stream),
- _TEST_STREAM_UNARY:
- grpc.stream_unary_rpc_method_handler(self._test_stream_unary),
- _TEST_STREAM_STREAM:
- grpc.stream_stream_rpc_method_handler(self._test_stream_stream),
- }
-
- @staticmethod
- async def _test_client_to_server(request, context):
- assert _REQUEST == request
- assert _common.seen_metadata(_INITIAL_METADATA_FROM_CLIENT_TO_SERVER,
- context.invocation_metadata())
- return _RESPONSE
-
- @staticmethod
- async def _test_server_to_client(request, context):
- assert _REQUEST == request
- await context.send_initial_metadata(
- _INITIAL_METADATA_FROM_SERVER_TO_CLIENT)
- return _RESPONSE
-
- @staticmethod
- async def _test_trailing_metadata(request, context):
- assert _REQUEST == request
- context.set_trailing_metadata(_TRAILING_METADATA)
- return _RESPONSE
-
- @staticmethod
- async def _test_unary_stream(request, context):
- assert _REQUEST == request
- assert _common.seen_metadata(_INITIAL_METADATA_FROM_CLIENT_TO_SERVER,
- context.invocation_metadata())
- await context.send_initial_metadata(
- _INITIAL_METADATA_FROM_SERVER_TO_CLIENT)
- yield _RESPONSE
- context.set_trailing_metadata(_TRAILING_METADATA)
-
- @staticmethod
- async def _test_stream_unary(request_iterator, context):
- assert _common.seen_metadata(_INITIAL_METADATA_FROM_CLIENT_TO_SERVER,
- context.invocation_metadata())
- await context.send_initial_metadata(
- _INITIAL_METADATA_FROM_SERVER_TO_CLIENT)
-
- async for request in request_iterator:
- assert _REQUEST == request
-
- context.set_trailing_metadata(_TRAILING_METADATA)
- return _RESPONSE
-
- @staticmethod
- async def _test_stream_stream(request_iterator, context):
- assert _common.seen_metadata(_INITIAL_METADATA_FROM_CLIENT_TO_SERVER,
- context.invocation_metadata())
- await context.send_initial_metadata(
- _INITIAL_METADATA_FROM_SERVER_TO_CLIENT)
-
- async for request in request_iterator:
- assert _REQUEST == request
-
- yield _RESPONSE
- context.set_trailing_metadata(_TRAILING_METADATA)
-
- def service(self, handler_call_details):
- return self._routing_table.get(handler_call_details.method)
-
-
-class _TestGenericHandlerItself(grpc.GenericRpcHandler):
-
- @staticmethod
- async def _method(request, unused_context):
- assert _REQUEST == request
- return _RESPONSE
-
- def service(self, handler_call_details):
- assert _common.seen_metadata(_INITIAL_METADATA_FOR_GENERIC_HANDLER,
- handler_call_details.invocation_metadata)
- return grpc.unary_unary_rpc_method_handler(self._method)
-
-
-async def _start_test_server():
- server = aio.server()
- port = server.add_insecure_port('[::]:0')
- server.add_generic_rpc_handlers((
- _TestGenericHandlerForMethods(),
- _TestGenericHandlerItself(),
- ))
- await server.start()
- return 'localhost:%d' % port, server
-
-
-class TestMetadata(AioTestBase):
-
- async def setUp(self):
- address, self._server = await _start_test_server()
- self._client = aio.insecure_channel(address)
-
- async def tearDown(self):
- await self._client.close()
- await self._server.stop(None)
-
- async def test_from_client_to_server(self):
- multicallable = self._client.unary_unary(_TEST_CLIENT_TO_SERVER)
- call = multicallable(_REQUEST,
- metadata=_INITIAL_METADATA_FROM_CLIENT_TO_SERVER)
- self.assertEqual(_RESPONSE, await call)
- self.assertEqual(grpc.StatusCode.OK, await call.code())
-
- async def test_from_server_to_client(self):
- multicallable = self._client.unary_unary(_TEST_SERVER_TO_CLIENT)
- call = multicallable(_REQUEST)
-
- self.assertEqual(_INITIAL_METADATA_FROM_SERVER_TO_CLIENT, await
- call.initial_metadata())
- self.assertEqual(_RESPONSE, await call)
- self.assertEqual(grpc.StatusCode.OK, await call.code())
-
- async def test_trailing_metadata(self):
- multicallable = self._client.unary_unary(_TEST_TRAILING_METADATA)
- call = multicallable(_REQUEST)
- self.assertEqual(_TRAILING_METADATA, await call.trailing_metadata())
- self.assertEqual(_RESPONSE, await call)
- self.assertEqual(grpc.StatusCode.OK, await call.code())
-
- async def test_from_client_to_server_with_list(self):
- multicallable = self._client.unary_unary(_TEST_CLIENT_TO_SERVER)
- call = multicallable(
- _REQUEST, metadata=list(_INITIAL_METADATA_FROM_CLIENT_TO_SERVER)) # pytype: disable=wrong-arg-types
- self.assertEqual(_RESPONSE, await call)
- self.assertEqual(grpc.StatusCode.OK, await call.code())
-
- @unittest.skipIf(platform.system() == 'Windows',
- 'https://github.com/grpc/grpc/issues/21943')
- async def test_invalid_metadata(self):
- multicallable = self._client.unary_unary(_TEST_CLIENT_TO_SERVER)
- for exception_type, metadata in _INVALID_METADATA_TEST_CASES:
- with self.subTest(metadata=metadata):
- with self.assertRaises(exception_type):
- call = multicallable(_REQUEST, metadata=metadata)
- await call
-
- async def test_generic_handler(self):
- multicallable = self._client.unary_unary(_TEST_GENERIC_HANDLER)
- call = multicallable(_REQUEST,
- metadata=_INITIAL_METADATA_FOR_GENERIC_HANDLER)
- self.assertEqual(_RESPONSE, await call)
- self.assertEqual(grpc.StatusCode.OK, await call.code())
-
- async def test_unary_stream(self):
- multicallable = self._client.unary_stream(_TEST_UNARY_STREAM)
- call = multicallable(_REQUEST,
- metadata=_INITIAL_METADATA_FROM_CLIENT_TO_SERVER)
-
- self.assertTrue(
- _common.seen_metadata(_INITIAL_METADATA_FROM_SERVER_TO_CLIENT, await
- call.initial_metadata()))
-
- self.assertSequenceEqual([_RESPONSE],
- [request async for request in call])
-
- self.assertEqual(_TRAILING_METADATA, await call.trailing_metadata())
- self.assertEqual(grpc.StatusCode.OK, await call.code())
-
- async def test_stream_unary(self):
- multicallable = self._client.stream_unary(_TEST_STREAM_UNARY)
- call = multicallable(metadata=_INITIAL_METADATA_FROM_CLIENT_TO_SERVER)
- await call.write(_REQUEST)
- await call.done_writing()
-
- self.assertTrue(
- _common.seen_metadata(_INITIAL_METADATA_FROM_SERVER_TO_CLIENT, await
- call.initial_metadata()))
- self.assertEqual(_RESPONSE, await call)
-
- self.assertEqual(_TRAILING_METADATA, await call.trailing_metadata())
- self.assertEqual(grpc.StatusCode.OK, await call.code())
-
- async def test_stream_stream(self):
- multicallable = self._client.stream_stream(_TEST_STREAM_STREAM)
- call = multicallable(metadata=_INITIAL_METADATA_FROM_CLIENT_TO_SERVER)
- await call.write(_REQUEST)
- await call.done_writing()
-
- self.assertTrue(
- _common.seen_metadata(_INITIAL_METADATA_FROM_SERVER_TO_CLIENT, await
- call.initial_metadata()))
- self.assertSequenceEqual([_RESPONSE],
- [request async for request in call])
- self.assertEqual(_TRAILING_METADATA, await call.trailing_metadata())
- self.assertEqual(grpc.StatusCode.OK, await call.code())
-
- async def test_compatibility_with_tuple(self):
- metadata_obj = aio.Metadata(('key', '42'), ('key-2', 'value'))
- self.assertEqual(metadata_obj, tuple(metadata_obj))
- self.assertEqual(tuple(metadata_obj), metadata_obj)
-
- expected_sum = tuple(metadata_obj) + (('third', '3'),)
- self.assertEqual(expected_sum, metadata_obj + (('third', '3'),))
- self.assertEqual(expected_sum, metadata_obj + aio.Metadata(
- ('third', '3')))
-
-
-if __name__ == '__main__':
- logging.basicConfig(level=logging.DEBUG)
- unittest.main(verbosity=2)
+# Copyright 2020 The gRPC Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+"""Tests behavior around the metadata mechanism."""
+
+import asyncio
+import logging
+import platform
+import random
+import unittest
+
+import grpc
+from grpc.experimental import aio
+
+from tests_aio.unit._test_base import AioTestBase
+from tests_aio.unit import _common
+
+_TEST_CLIENT_TO_SERVER = '/test/TestClientToServer'
+_TEST_SERVER_TO_CLIENT = '/test/TestServerToClient'
+_TEST_TRAILING_METADATA = '/test/TestTrailingMetadata'
+_TEST_ECHO_INITIAL_METADATA = '/test/TestEchoInitialMetadata'
+_TEST_GENERIC_HANDLER = '/test/TestGenericHandler'
+_TEST_UNARY_STREAM = '/test/TestUnaryStream'
+_TEST_STREAM_UNARY = '/test/TestStreamUnary'
+_TEST_STREAM_STREAM = '/test/TestStreamStream'
+
+_REQUEST = b'\x00\x00\x00'
+_RESPONSE = b'\x01\x01\x01'
+
+_INITIAL_METADATA_FROM_CLIENT_TO_SERVER = aio.Metadata(
+ ('client-to-server', 'question'),
+ ('client-to-server-bin', b'\x07\x07\x07'),
+)
+_INITIAL_METADATA_FROM_SERVER_TO_CLIENT = aio.Metadata(
+ ('server-to-client', 'answer'),
+ ('server-to-client-bin', b'\x06\x06\x06'),
+)
+_TRAILING_METADATA = aio.Metadata(
+ ('a-trailing-metadata', 'stack-trace'),
+ ('a-trailing-metadata-bin', b'\x05\x05\x05'),
+)
+_INITIAL_METADATA_FOR_GENERIC_HANDLER = aio.Metadata(
+ ('a-must-have-key', 'secret'),)
+
+_INVALID_METADATA_TEST_CASES = (
+ (
+ TypeError,
+ ((42, 42),),
+ ),
+ (
+ TypeError,
+ (({}, {}),),
+ ),
+ (
+ TypeError,
+ ((None, {}),),
+ ),
+ (
+ TypeError,
+ (({}, {}),),
+ ),
+ (
+ TypeError,
+ (('normal', object()),),
+ ),
+)
+
+
+class _TestGenericHandlerForMethods(grpc.GenericRpcHandler):
+
+ def __init__(self):
+ self._routing_table = {
+ _TEST_CLIENT_TO_SERVER:
+ grpc.unary_unary_rpc_method_handler(self._test_client_to_server
+ ),
+ _TEST_SERVER_TO_CLIENT:
+ grpc.unary_unary_rpc_method_handler(self._test_server_to_client
+ ),
+ _TEST_TRAILING_METADATA:
+ grpc.unary_unary_rpc_method_handler(self._test_trailing_metadata
+ ),
+ _TEST_UNARY_STREAM:
+ grpc.unary_stream_rpc_method_handler(self._test_unary_stream),
+ _TEST_STREAM_UNARY:
+ grpc.stream_unary_rpc_method_handler(self._test_stream_unary),
+ _TEST_STREAM_STREAM:
+ grpc.stream_stream_rpc_method_handler(self._test_stream_stream),
+ }
+
+ @staticmethod
+ async def _test_client_to_server(request, context):
+ assert _REQUEST == request
+ assert _common.seen_metadata(_INITIAL_METADATA_FROM_CLIENT_TO_SERVER,
+ context.invocation_metadata())
+ return _RESPONSE
+
+ @staticmethod
+ async def _test_server_to_client(request, context):
+ assert _REQUEST == request
+ await context.send_initial_metadata(
+ _INITIAL_METADATA_FROM_SERVER_TO_CLIENT)
+ return _RESPONSE
+
+ @staticmethod
+ async def _test_trailing_metadata(request, context):
+ assert _REQUEST == request
+ context.set_trailing_metadata(_TRAILING_METADATA)
+ return _RESPONSE
+
+ @staticmethod
+ async def _test_unary_stream(request, context):
+ assert _REQUEST == request
+ assert _common.seen_metadata(_INITIAL_METADATA_FROM_CLIENT_TO_SERVER,
+ context.invocation_metadata())
+ await context.send_initial_metadata(
+ _INITIAL_METADATA_FROM_SERVER_TO_CLIENT)
+ yield _RESPONSE
+ context.set_trailing_metadata(_TRAILING_METADATA)
+
+ @staticmethod
+ async def _test_stream_unary(request_iterator, context):
+ assert _common.seen_metadata(_INITIAL_METADATA_FROM_CLIENT_TO_SERVER,
+ context.invocation_metadata())
+ await context.send_initial_metadata(
+ _INITIAL_METADATA_FROM_SERVER_TO_CLIENT)
+
+ async for request in request_iterator:
+ assert _REQUEST == request
+
+ context.set_trailing_metadata(_TRAILING_METADATA)
+ return _RESPONSE
+
+ @staticmethod
+ async def _test_stream_stream(request_iterator, context):
+ assert _common.seen_metadata(_INITIAL_METADATA_FROM_CLIENT_TO_SERVER,
+ context.invocation_metadata())
+ await context.send_initial_metadata(
+ _INITIAL_METADATA_FROM_SERVER_TO_CLIENT)
+
+ async for request in request_iterator:
+ assert _REQUEST == request
+
+ yield _RESPONSE
+ context.set_trailing_metadata(_TRAILING_METADATA)
+
+ def service(self, handler_call_details):
+ return self._routing_table.get(handler_call_details.method)
+
+
+class _TestGenericHandlerItself(grpc.GenericRpcHandler):
+
+ @staticmethod
+ async def _method(request, unused_context):
+ assert _REQUEST == request
+ return _RESPONSE
+
+ def service(self, handler_call_details):
+ assert _common.seen_metadata(_INITIAL_METADATA_FOR_GENERIC_HANDLER,
+ handler_call_details.invocation_metadata)
+ return grpc.unary_unary_rpc_method_handler(self._method)
+
+
+async def _start_test_server():
+ server = aio.server()
+ port = server.add_insecure_port('[::]:0')
+ server.add_generic_rpc_handlers((
+ _TestGenericHandlerForMethods(),
+ _TestGenericHandlerItself(),
+ ))
+ await server.start()
+ return 'localhost:%d' % port, server
+
+
+class TestMetadata(AioTestBase):
+
+ async def setUp(self):
+ address, self._server = await _start_test_server()
+ self._client = aio.insecure_channel(address)
+
+ async def tearDown(self):
+ await self._client.close()
+ await self._server.stop(None)
+
+ async def test_from_client_to_server(self):
+ multicallable = self._client.unary_unary(_TEST_CLIENT_TO_SERVER)
+ call = multicallable(_REQUEST,
+ metadata=_INITIAL_METADATA_FROM_CLIENT_TO_SERVER)
+ self.assertEqual(_RESPONSE, await call)
+ self.assertEqual(grpc.StatusCode.OK, await call.code())
+
+ async def test_from_server_to_client(self):
+ multicallable = self._client.unary_unary(_TEST_SERVER_TO_CLIENT)
+ call = multicallable(_REQUEST)
+
+ self.assertEqual(_INITIAL_METADATA_FROM_SERVER_TO_CLIENT, await
+ call.initial_metadata())
+ self.assertEqual(_RESPONSE, await call)
+ self.assertEqual(grpc.StatusCode.OK, await call.code())
+
+ async def test_trailing_metadata(self):
+ multicallable = self._client.unary_unary(_TEST_TRAILING_METADATA)
+ call = multicallable(_REQUEST)
+ self.assertEqual(_TRAILING_METADATA, await call.trailing_metadata())
+ self.assertEqual(_RESPONSE, await call)
+ self.assertEqual(grpc.StatusCode.OK, await call.code())
+
+ async def test_from_client_to_server_with_list(self):
+ multicallable = self._client.unary_unary(_TEST_CLIENT_TO_SERVER)
+ call = multicallable(
+ _REQUEST, metadata=list(_INITIAL_METADATA_FROM_CLIENT_TO_SERVER)) # pytype: disable=wrong-arg-types
+ self.assertEqual(_RESPONSE, await call)
+ self.assertEqual(grpc.StatusCode.OK, await call.code())
+
+ @unittest.skipIf(platform.system() == 'Windows',
+ 'https://github.com/grpc/grpc/issues/21943')
+ async def test_invalid_metadata(self):
+ multicallable = self._client.unary_unary(_TEST_CLIENT_TO_SERVER)
+ for exception_type, metadata in _INVALID_METADATA_TEST_CASES:
+ with self.subTest(metadata=metadata):
+ with self.assertRaises(exception_type):
+ call = multicallable(_REQUEST, metadata=metadata)
+ await call
+
+ async def test_generic_handler(self):
+ multicallable = self._client.unary_unary(_TEST_GENERIC_HANDLER)
+ call = multicallable(_REQUEST,
+ metadata=_INITIAL_METADATA_FOR_GENERIC_HANDLER)
+ self.assertEqual(_RESPONSE, await call)
+ self.assertEqual(grpc.StatusCode.OK, await call.code())
+
+ async def test_unary_stream(self):
+ multicallable = self._client.unary_stream(_TEST_UNARY_STREAM)
+ call = multicallable(_REQUEST,
+ metadata=_INITIAL_METADATA_FROM_CLIENT_TO_SERVER)
+
+ self.assertTrue(
+ _common.seen_metadata(_INITIAL_METADATA_FROM_SERVER_TO_CLIENT, await
+ call.initial_metadata()))
+
+ self.assertSequenceEqual([_RESPONSE],
+ [request async for request in call])
+
+ self.assertEqual(_TRAILING_METADATA, await call.trailing_metadata())
+ self.assertEqual(grpc.StatusCode.OK, await call.code())
+
+ async def test_stream_unary(self):
+ multicallable = self._client.stream_unary(_TEST_STREAM_UNARY)
+ call = multicallable(metadata=_INITIAL_METADATA_FROM_CLIENT_TO_SERVER)
+ await call.write(_REQUEST)
+ await call.done_writing()
+
+ self.assertTrue(
+ _common.seen_metadata(_INITIAL_METADATA_FROM_SERVER_TO_CLIENT, await
+ call.initial_metadata()))
+ self.assertEqual(_RESPONSE, await call)
+
+ self.assertEqual(_TRAILING_METADATA, await call.trailing_metadata())
+ self.assertEqual(grpc.StatusCode.OK, await call.code())
+
+ async def test_stream_stream(self):
+ multicallable = self._client.stream_stream(_TEST_STREAM_STREAM)
+ call = multicallable(metadata=_INITIAL_METADATA_FROM_CLIENT_TO_SERVER)
+ await call.write(_REQUEST)
+ await call.done_writing()
+
+ self.assertTrue(
+ _common.seen_metadata(_INITIAL_METADATA_FROM_SERVER_TO_CLIENT, await
+ call.initial_metadata()))
+ self.assertSequenceEqual([_RESPONSE],
+ [request async for request in call])
+ self.assertEqual(_TRAILING_METADATA, await call.trailing_metadata())
+ self.assertEqual(grpc.StatusCode.OK, await call.code())
+
+ async def test_compatibility_with_tuple(self):
+ metadata_obj = aio.Metadata(('key', '42'), ('key-2', 'value'))
+ self.assertEqual(metadata_obj, tuple(metadata_obj))
+ self.assertEqual(tuple(metadata_obj), metadata_obj)
+
+ expected_sum = tuple(metadata_obj) + (('third', '3'),)
+ self.assertEqual(expected_sum, metadata_obj + (('third', '3'),))
+ self.assertEqual(expected_sum, metadata_obj + aio.Metadata(
+ ('third', '3')))
+
+
+if __name__ == '__main__':
+ logging.basicConfig(level=logging.DEBUG)
+ unittest.main(verbosity=2)
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/outside_init_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/outside_init_test.py
index 0d710ef0f2c..879796cf0f5 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/outside_init_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/outside_init_test.py
@@ -1,74 +1,74 @@
-# Copyright 2020 The gRPC Authors
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-"""Tests behavior around the metadata mechanism."""
-
-import asyncio
-import logging
-import unittest
-from grpc.experimental import aio
-import grpc
-
-from tests_aio.unit._test_server import start_test_server
-from src.proto.grpc.testing import messages_pb2, test_pb2_grpc
-
-_NUM_OF_LOOPS = 50
-
-
-class TestOutsideInit(unittest.TestCase):
-
- def test_behavior_outside_asyncio(self):
- # Ensures non-AsyncIO object can be initiated
- channel_creds = grpc.ssl_channel_credentials()
-
- # Ensures AsyncIO API not raising outside of AsyncIO.
- # NOTE(lidiz) This behavior is bound with GAPIC generator, and required
- # by test frameworks like pytest. In test frameworks, objects shared
- # across cases need to be created outside of AsyncIO coroutines.
- aio.insecure_channel('')
- aio.secure_channel('', channel_creds)
- aio.server()
- aio.init_grpc_aio()
- aio.shutdown_grpc_aio()
-
- def test_multi_ephemeral_loops(self):
- # Initializes AIO module outside. It's part of the test. We especially
- # want to ensure the closing of the default loop won't cause deadlocks.
- aio.init_grpc_aio()
-
- async def ping_pong():
- address, server = await start_test_server()
- channel = aio.insecure_channel(address)
- stub = test_pb2_grpc.TestServiceStub(channel)
-
- await stub.UnaryCall(messages_pb2.SimpleRequest())
-
- await channel.close()
- await server.stop(None)
-
- for i in range(_NUM_OF_LOOPS):
- old_loop = asyncio.get_event_loop()
- old_loop.close()
-
- loop = asyncio.new_event_loop()
- loop.set_debug(True)
- asyncio.set_event_loop(loop)
-
- loop.run_until_complete(ping_pong())
-
- aio.shutdown_grpc_aio()
-
-
-if __name__ == "__main__":
- logging.basicConfig(level=logging.DEBUG)
- unittest.main(verbosity=2)
+# Copyright 2020 The gRPC Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+"""Tests behavior around the metadata mechanism."""
+
+import asyncio
+import logging
+import unittest
+from grpc.experimental import aio
+import grpc
+
+from tests_aio.unit._test_server import start_test_server
+from src.proto.grpc.testing import messages_pb2, test_pb2_grpc
+
+_NUM_OF_LOOPS = 50
+
+
+class TestOutsideInit(unittest.TestCase):
+
+ def test_behavior_outside_asyncio(self):
+ # Ensures non-AsyncIO object can be initiated
+ channel_creds = grpc.ssl_channel_credentials()
+
+ # Ensures AsyncIO API not raising outside of AsyncIO.
+ # NOTE(lidiz) This behavior is bound with GAPIC generator, and required
+ # by test frameworks like pytest. In test frameworks, objects shared
+ # across cases need to be created outside of AsyncIO coroutines.
+ aio.insecure_channel('')
+ aio.secure_channel('', channel_creds)
+ aio.server()
+ aio.init_grpc_aio()
+ aio.shutdown_grpc_aio()
+
+ def test_multi_ephemeral_loops(self):
+ # Initializes AIO module outside. It's part of the test. We especially
+ # want to ensure the closing of the default loop won't cause deadlocks.
+ aio.init_grpc_aio()
+
+ async def ping_pong():
+ address, server = await start_test_server()
+ channel = aio.insecure_channel(address)
+ stub = test_pb2_grpc.TestServiceStub(channel)
+
+ await stub.UnaryCall(messages_pb2.SimpleRequest())
+
+ await channel.close()
+ await server.stop(None)
+
+ for i in range(_NUM_OF_LOOPS):
+ old_loop = asyncio.get_event_loop()
+ old_loop.close()
+
+ loop = asyncio.new_event_loop()
+ loop.set_debug(True)
+ asyncio.set_event_loop(loop)
+
+ loop.run_until_complete(ping_pong())
+
+ aio.shutdown_grpc_aio()
+
+
+if __name__ == "__main__":
+ logging.basicConfig(level=logging.DEBUG)
+ unittest.main(verbosity=2)
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/secure_call_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/secure_call_test.py
index a63f84c0d08..7efaddd607e 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/secure_call_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/secure_call_test.py
@@ -1,130 +1,130 @@
-# Copyright 2020 The gRPC Authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-"""Tests the behaviour of the Call classes under a secure channel."""
-
-import unittest
-import logging
-
-import grpc
-from grpc.experimental import aio
-from src.proto.grpc.testing import messages_pb2, test_pb2_grpc
-from tests_aio.unit._test_base import AioTestBase
-from tests_aio.unit._test_server import start_test_server
-from tests.unit import resources
-
-_SERVER_HOST_OVERRIDE = 'foo.test.google.fr'
-_NUM_STREAM_RESPONSES = 5
-_RESPONSE_PAYLOAD_SIZE = 42
-
-
-class _SecureCallMixin:
- """A Mixin to run the call tests over a secure channel."""
-
- async def setUp(self):
- server_credentials = grpc.ssl_server_credentials([
- (resources.private_key(), resources.certificate_chain())
- ])
- channel_credentials = grpc.ssl_channel_credentials(
- resources.test_root_certificates())
-
- self._server_address, self._server = await start_test_server(
- secure=True, server_credentials=server_credentials)
- channel_options = ((
- 'grpc.ssl_target_name_override',
- _SERVER_HOST_OVERRIDE,
- ),)
- self._channel = aio.secure_channel(self._server_address,
- channel_credentials, channel_options)
- self._stub = test_pb2_grpc.TestServiceStub(self._channel)
-
- async def tearDown(self):
- await self._channel.close()
- await self._server.stop(None)
-
-
-class TestUnaryUnarySecureCall(_SecureCallMixin, AioTestBase):
- """unary_unary Calls made over a secure channel."""
-
- async def test_call_ok_over_secure_channel(self):
- call = self._stub.UnaryCall(messages_pb2.SimpleRequest())
- response = await call
- self.assertIsInstance(response, messages_pb2.SimpleResponse)
- self.assertEqual(await call.code(), grpc.StatusCode.OK)
-
- async def test_call_with_credentials(self):
- call_credentials = grpc.composite_call_credentials(
- grpc.access_token_call_credentials("abc"),
- grpc.access_token_call_credentials("def"),
- )
- call = self._stub.UnaryCall(messages_pb2.SimpleRequest(),
- credentials=call_credentials)
- response = await call
-
- self.assertIsInstance(response, messages_pb2.SimpleResponse)
-
-
-class TestUnaryStreamSecureCall(_SecureCallMixin, AioTestBase):
- """unary_stream calls over a secure channel"""
-
- async def test_unary_stream_async_generator_secure(self):
- request = messages_pb2.StreamingOutputCallRequest()
- request.response_parameters.extend(
- messages_pb2.ResponseParameters(size=_RESPONSE_PAYLOAD_SIZE,)
- for _ in range(_NUM_STREAM_RESPONSES))
- call_credentials = grpc.composite_call_credentials(
- grpc.access_token_call_credentials("abc"),
- grpc.access_token_call_credentials("def"),
- )
- call = self._stub.StreamingOutputCall(request,
- credentials=call_credentials)
-
- async for response in call:
- self.assertIsInstance(response,
- messages_pb2.StreamingOutputCallResponse)
- self.assertEqual(len(response.payload.body), _RESPONSE_PAYLOAD_SIZE)
-
- self.assertEqual(await call.code(), grpc.StatusCode.OK)
-
-
-# Prepares the request that stream in a ping-pong manner.
-_STREAM_OUTPUT_REQUEST_ONE_RESPONSE = messages_pb2.StreamingOutputCallRequest()
-_STREAM_OUTPUT_REQUEST_ONE_RESPONSE.response_parameters.append(
- messages_pb2.ResponseParameters(size=_RESPONSE_PAYLOAD_SIZE))
-
-
-class TestStreamStreamSecureCall(_SecureCallMixin, AioTestBase):
- _STREAM_ITERATIONS = 2
-
- async def test_async_generator_secure_channel(self):
-
- async def request_generator():
- for _ in range(self._STREAM_ITERATIONS):
- yield _STREAM_OUTPUT_REQUEST_ONE_RESPONSE
-
- call_credentials = grpc.composite_call_credentials(
- grpc.access_token_call_credentials("abc"),
- grpc.access_token_call_credentials("def"),
- )
-
- call = self._stub.FullDuplexCall(request_generator(),
- credentials=call_credentials)
- async for response in call:
- self.assertEqual(_RESPONSE_PAYLOAD_SIZE, len(response.payload.body))
-
- self.assertEqual(await call.code(), grpc.StatusCode.OK)
-
-
-if __name__ == '__main__':
- logging.basicConfig(level=logging.DEBUG)
- unittest.main(verbosity=2)
+# Copyright 2020 The gRPC Authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+"""Tests the behaviour of the Call classes under a secure channel."""
+
+import unittest
+import logging
+
+import grpc
+from grpc.experimental import aio
+from src.proto.grpc.testing import messages_pb2, test_pb2_grpc
+from tests_aio.unit._test_base import AioTestBase
+from tests_aio.unit._test_server import start_test_server
+from tests.unit import resources
+
+_SERVER_HOST_OVERRIDE = 'foo.test.google.fr'
+_NUM_STREAM_RESPONSES = 5
+_RESPONSE_PAYLOAD_SIZE = 42
+
+
+class _SecureCallMixin:
+ """A Mixin to run the call tests over a secure channel."""
+
+ async def setUp(self):
+ server_credentials = grpc.ssl_server_credentials([
+ (resources.private_key(), resources.certificate_chain())
+ ])
+ channel_credentials = grpc.ssl_channel_credentials(
+ resources.test_root_certificates())
+
+ self._server_address, self._server = await start_test_server(
+ secure=True, server_credentials=server_credentials)
+ channel_options = ((
+ 'grpc.ssl_target_name_override',
+ _SERVER_HOST_OVERRIDE,
+ ),)
+ self._channel = aio.secure_channel(self._server_address,
+ channel_credentials, channel_options)
+ self._stub = test_pb2_grpc.TestServiceStub(self._channel)
+
+ async def tearDown(self):
+ await self._channel.close()
+ await self._server.stop(None)
+
+
+class TestUnaryUnarySecureCall(_SecureCallMixin, AioTestBase):
+ """unary_unary Calls made over a secure channel."""
+
+ async def test_call_ok_over_secure_channel(self):
+ call = self._stub.UnaryCall(messages_pb2.SimpleRequest())
+ response = await call
+ self.assertIsInstance(response, messages_pb2.SimpleResponse)
+ self.assertEqual(await call.code(), grpc.StatusCode.OK)
+
+ async def test_call_with_credentials(self):
+ call_credentials = grpc.composite_call_credentials(
+ grpc.access_token_call_credentials("abc"),
+ grpc.access_token_call_credentials("def"),
+ )
+ call = self._stub.UnaryCall(messages_pb2.SimpleRequest(),
+ credentials=call_credentials)
+ response = await call
+
+ self.assertIsInstance(response, messages_pb2.SimpleResponse)
+
+
+class TestUnaryStreamSecureCall(_SecureCallMixin, AioTestBase):
+ """unary_stream calls over a secure channel"""
+
+ async def test_unary_stream_async_generator_secure(self):
+ request = messages_pb2.StreamingOutputCallRequest()
+ request.response_parameters.extend(
+ messages_pb2.ResponseParameters(size=_RESPONSE_PAYLOAD_SIZE,)
+ for _ in range(_NUM_STREAM_RESPONSES))
+ call_credentials = grpc.composite_call_credentials(
+ grpc.access_token_call_credentials("abc"),
+ grpc.access_token_call_credentials("def"),
+ )
+ call = self._stub.StreamingOutputCall(request,
+ credentials=call_credentials)
+
+ async for response in call:
+ self.assertIsInstance(response,
+ messages_pb2.StreamingOutputCallResponse)
+ self.assertEqual(len(response.payload.body), _RESPONSE_PAYLOAD_SIZE)
+
+ self.assertEqual(await call.code(), grpc.StatusCode.OK)
+
+
+# Prepares the request that stream in a ping-pong manner.
+_STREAM_OUTPUT_REQUEST_ONE_RESPONSE = messages_pb2.StreamingOutputCallRequest()
+_STREAM_OUTPUT_REQUEST_ONE_RESPONSE.response_parameters.append(
+ messages_pb2.ResponseParameters(size=_RESPONSE_PAYLOAD_SIZE))
+
+
+class TestStreamStreamSecureCall(_SecureCallMixin, AioTestBase):
+ _STREAM_ITERATIONS = 2
+
+ async def test_async_generator_secure_channel(self):
+
+ async def request_generator():
+ for _ in range(self._STREAM_ITERATIONS):
+ yield _STREAM_OUTPUT_REQUEST_ONE_RESPONSE
+
+ call_credentials = grpc.composite_call_credentials(
+ grpc.access_token_call_credentials("abc"),
+ grpc.access_token_call_credentials("def"),
+ )
+
+ call = self._stub.FullDuplexCall(request_generator(),
+ credentials=call_credentials)
+ async for response in call:
+ self.assertEqual(_RESPONSE_PAYLOAD_SIZE, len(response.payload.body))
+
+ self.assertEqual(await call.code(), grpc.StatusCode.OK)
+
+
+if __name__ == '__main__':
+ logging.basicConfig(level=logging.DEBUG)
+ unittest.main(verbosity=2)
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/server_interceptor_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/server_interceptor_test.py
index e4133c431f9..d891ecdb771 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/server_interceptor_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/server_interceptor_test.py
@@ -1,330 +1,330 @@
-# Copyright 2020 The gRPC Authors
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-"""Test the functionality of server interceptors."""
-
-import asyncio
-import functools
-import logging
-import unittest
-from typing import Any, Awaitable, Callable, Tuple
-
-import grpc
-from grpc.experimental import aio, wrap_server_method_handler
-
-from src.proto.grpc.testing import messages_pb2, test_pb2_grpc
-from tests_aio.unit._test_base import AioTestBase
-from tests_aio.unit._test_server import start_test_server
-
-_NUM_STREAM_RESPONSES = 5
-_REQUEST_PAYLOAD_SIZE = 7
-_RESPONSE_PAYLOAD_SIZE = 42
-
-
-class _LoggingInterceptor(aio.ServerInterceptor):
-
- def __init__(self, tag: str, record: list) -> None:
- self.tag = tag
- self.record = record
-
- async def intercept_service(
- self, continuation: Callable[[grpc.HandlerCallDetails], Awaitable[
- grpc.RpcMethodHandler]],
- handler_call_details: grpc.HandlerCallDetails
- ) -> grpc.RpcMethodHandler:
- self.record.append(self.tag + ':intercept_service')
- return await continuation(handler_call_details)
-
-
-class _GenericInterceptor(aio.ServerInterceptor):
-
- def __init__(self, fn: Callable[[
- Callable[[grpc.HandlerCallDetails], Awaitable[grpc.
- RpcMethodHandler]],
- grpc.HandlerCallDetails
- ], Any]) -> None:
- self._fn = fn
-
- async def intercept_service(
- self, continuation: Callable[[grpc.HandlerCallDetails], Awaitable[
- grpc.RpcMethodHandler]],
- handler_call_details: grpc.HandlerCallDetails
- ) -> grpc.RpcMethodHandler:
- return await self._fn(continuation, handler_call_details)
-
-
-def _filter_server_interceptor(condition: Callable,
- interceptor: aio.ServerInterceptor
- ) -> aio.ServerInterceptor:
-
- async def intercept_service(
- continuation: Callable[[grpc.HandlerCallDetails], Awaitable[
- grpc.RpcMethodHandler]],
- handler_call_details: grpc.HandlerCallDetails
- ) -> grpc.RpcMethodHandler:
- if condition(handler_call_details):
- return await interceptor.intercept_service(continuation,
- handler_call_details)
- return await continuation(handler_call_details)
-
- return _GenericInterceptor(intercept_service)
-
-
-class _CacheInterceptor(aio.ServerInterceptor):
- """An interceptor that caches response based on request message."""
-
- def __init__(self, cache_store=None):
- self.cache_store = cache_store or {}
-
- async def intercept_service(
- self, continuation: Callable[[grpc.HandlerCallDetails], Awaitable[
- grpc.RpcMethodHandler]],
- handler_call_details: grpc.HandlerCallDetails
- ) -> grpc.RpcMethodHandler:
- # Get the actual handler
- handler = await continuation(handler_call_details)
-
- # Only intercept unary call RPCs
- if handler and (handler.request_streaming or # pytype: disable=attribute-error
- handler.response_streaming): # pytype: disable=attribute-error
- return handler
-
- def wrapper(behavior: Callable[
- [messages_pb2.SimpleRequest, aio.
- ServicerContext], messages_pb2.SimpleResponse]):
-
- @functools.wraps(behavior)
- async def wrapper(request: messages_pb2.SimpleRequest,
- context: aio.ServicerContext
- ) -> messages_pb2.SimpleResponse:
- if request.response_size not in self.cache_store:
- self.cache_store[request.response_size] = await behavior(
- request, context)
- return self.cache_store[request.response_size]
-
- return wrapper
-
- return wrap_server_method_handler(wrapper, handler)
-
-
-async def _create_server_stub_pair(
- *interceptors: aio.ServerInterceptor
-) -> Tuple[aio.Server, test_pb2_grpc.TestServiceStub]:
- """Creates a server-stub pair with given interceptors.
-
- Returning the server object to protect it from being garbage collected.
- """
- server_target, server = await start_test_server(interceptors=interceptors)
- channel = aio.insecure_channel(server_target)
- return server, test_pb2_grpc.TestServiceStub(channel)
-
-
-class TestServerInterceptor(AioTestBase):
-
- async def test_invalid_interceptor(self):
-
- class InvalidInterceptor:
- """Just an invalid Interceptor"""
-
- with self.assertRaises(ValueError):
- server_target, _ = await start_test_server(
- interceptors=(InvalidInterceptor(),))
-
- async def test_executed_right_order(self):
- record = []
- server_target, _ = await start_test_server(interceptors=(
- _LoggingInterceptor('log1', record),
- _LoggingInterceptor('log2', record),
- ))
-
- async with aio.insecure_channel(server_target) as channel:
- multicallable = channel.unary_unary(
- '/grpc.testing.TestService/UnaryCall',
- request_serializer=messages_pb2.SimpleRequest.SerializeToString,
- response_deserializer=messages_pb2.SimpleResponse.FromString)
- call = multicallable(messages_pb2.SimpleRequest())
- response = await call
-
- # Check that all interceptors were executed, and were executed
- # in the right order.
- self.assertSequenceEqual([
- 'log1:intercept_service',
- 'log2:intercept_service',
- ], record)
- self.assertIsInstance(response, messages_pb2.SimpleResponse)
-
- async def test_response_ok(self):
- record = []
- server_target, _ = await start_test_server(
- interceptors=(_LoggingInterceptor('log1', record),))
-
- async with aio.insecure_channel(server_target) as channel:
- multicallable = channel.unary_unary(
- '/grpc.testing.TestService/UnaryCall',
- request_serializer=messages_pb2.SimpleRequest.SerializeToString,
- response_deserializer=messages_pb2.SimpleResponse.FromString)
- call = multicallable(messages_pb2.SimpleRequest())
- response = await call
- code = await call.code()
-
- self.assertSequenceEqual(['log1:intercept_service'], record)
- self.assertIsInstance(response, messages_pb2.SimpleResponse)
- self.assertEqual(code, grpc.StatusCode.OK)
-
- async def test_apply_different_interceptors_by_metadata(self):
- record = []
- conditional_interceptor = _filter_server_interceptor(
- lambda x: ('secret', '42') in x.invocation_metadata,
- _LoggingInterceptor('log3', record))
- server_target, _ = await start_test_server(interceptors=(
- _LoggingInterceptor('log1', record),
- conditional_interceptor,
- _LoggingInterceptor('log2', record),
- ))
-
- async with aio.insecure_channel(server_target) as channel:
- multicallable = channel.unary_unary(
- '/grpc.testing.TestService/UnaryCall',
- request_serializer=messages_pb2.SimpleRequest.SerializeToString,
- response_deserializer=messages_pb2.SimpleResponse.FromString)
-
- metadata = aio.Metadata(('key', 'value'),)
- call = multicallable(messages_pb2.SimpleRequest(),
- metadata=metadata)
- await call
- self.assertSequenceEqual([
- 'log1:intercept_service',
- 'log2:intercept_service',
- ], record)
-
- record.clear()
- metadata = aio.Metadata(('key', 'value'), ('secret', '42'))
- call = multicallable(messages_pb2.SimpleRequest(),
- metadata=metadata)
- await call
- self.assertSequenceEqual([
- 'log1:intercept_service',
- 'log3:intercept_service',
- 'log2:intercept_service',
- ], record)
-
- async def test_response_caching(self):
- # Prepares a preset value to help testing
- interceptor = _CacheInterceptor({
- 42:
- messages_pb2.SimpleResponse(payload=messages_pb2.Payload(
- body=b'\x42'))
- })
-
- # Constructs a server with the cache interceptor
- server, stub = await _create_server_stub_pair(interceptor)
-
- # Tests if the cache store is used
- response = await stub.UnaryCall(
- messages_pb2.SimpleRequest(response_size=42))
- self.assertEqual(1, len(interceptor.cache_store[42].payload.body))
- self.assertEqual(interceptor.cache_store[42], response)
-
- # Tests response can be cached
- response = await stub.UnaryCall(
- messages_pb2.SimpleRequest(response_size=1337))
- self.assertEqual(1337, len(interceptor.cache_store[1337].payload.body))
- self.assertEqual(interceptor.cache_store[1337], response)
- response = await stub.UnaryCall(
- messages_pb2.SimpleRequest(response_size=1337))
- self.assertEqual(interceptor.cache_store[1337], response)
-
- async def test_interceptor_unary_stream(self):
- record = []
- server, stub = await _create_server_stub_pair(
- _LoggingInterceptor('log_unary_stream', record))
-
- # Prepares the request
- request = messages_pb2.StreamingOutputCallRequest()
- for _ in range(_NUM_STREAM_RESPONSES):
- request.response_parameters.append(
- messages_pb2.ResponseParameters(size=_RESPONSE_PAYLOAD_SIZE,))
-
- # Tests if the cache store is used
- call = stub.StreamingOutputCall(request)
-
- # Ensures the RPC goes fine
- async for response in call:
- self.assertEqual(_RESPONSE_PAYLOAD_SIZE, len(response.payload.body))
- self.assertEqual(await call.code(), grpc.StatusCode.OK)
-
- self.assertSequenceEqual([
- 'log_unary_stream:intercept_service',
- ], record)
-
- async def test_interceptor_stream_unary(self):
- record = []
- server, stub = await _create_server_stub_pair(
- _LoggingInterceptor('log_stream_unary', record))
-
- # Invokes the actual RPC
- call = stub.StreamingInputCall()
-
- # Prepares the request
- payload = messages_pb2.Payload(body=b'\0' * _REQUEST_PAYLOAD_SIZE)
- request = messages_pb2.StreamingInputCallRequest(payload=payload)
-
- # Sends out requests
- for _ in range(_NUM_STREAM_RESPONSES):
- await call.write(request)
- await call.done_writing()
-
- # Validates the responses
- response = await call
- self.assertIsInstance(response, messages_pb2.StreamingInputCallResponse)
- self.assertEqual(_NUM_STREAM_RESPONSES * _REQUEST_PAYLOAD_SIZE,
- response.aggregated_payload_size)
-
- self.assertEqual(await call.code(), grpc.StatusCode.OK)
-
- self.assertSequenceEqual([
- 'log_stream_unary:intercept_service',
- ], record)
-
- async def test_interceptor_stream_stream(self):
- record = []
- server, stub = await _create_server_stub_pair(
- _LoggingInterceptor('log_stream_stream', record))
-
- # Prepares the request
- payload = messages_pb2.Payload(body=b'\0' * _REQUEST_PAYLOAD_SIZE)
- request = messages_pb2.StreamingInputCallRequest(payload=payload)
-
- async def gen():
- for _ in range(_NUM_STREAM_RESPONSES):
- yield request
-
- # Invokes the actual RPC
- call = stub.StreamingInputCall(gen())
-
- # Validates the responses
- response = await call
- self.assertIsInstance(response, messages_pb2.StreamingInputCallResponse)
- self.assertEqual(_NUM_STREAM_RESPONSES * _REQUEST_PAYLOAD_SIZE,
- response.aggregated_payload_size)
-
- self.assertEqual(await call.code(), grpc.StatusCode.OK)
-
- self.assertSequenceEqual([
- 'log_stream_stream:intercept_service',
- ], record)
-
-
-if __name__ == '__main__':
- logging.basicConfig(level=logging.DEBUG)
- unittest.main(verbosity=2)
+# Copyright 2020 The gRPC Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+"""Test the functionality of server interceptors."""
+
+import asyncio
+import functools
+import logging
+import unittest
+from typing import Any, Awaitable, Callable, Tuple
+
+import grpc
+from grpc.experimental import aio, wrap_server_method_handler
+
+from src.proto.grpc.testing import messages_pb2, test_pb2_grpc
+from tests_aio.unit._test_base import AioTestBase
+from tests_aio.unit._test_server import start_test_server
+
+_NUM_STREAM_RESPONSES = 5
+_REQUEST_PAYLOAD_SIZE = 7
+_RESPONSE_PAYLOAD_SIZE = 42
+
+
+class _LoggingInterceptor(aio.ServerInterceptor):
+
+ def __init__(self, tag: str, record: list) -> None:
+ self.tag = tag
+ self.record = record
+
+ async def intercept_service(
+ self, continuation: Callable[[grpc.HandlerCallDetails], Awaitable[
+ grpc.RpcMethodHandler]],
+ handler_call_details: grpc.HandlerCallDetails
+ ) -> grpc.RpcMethodHandler:
+ self.record.append(self.tag + ':intercept_service')
+ return await continuation(handler_call_details)
+
+
+class _GenericInterceptor(aio.ServerInterceptor):
+
+ def __init__(self, fn: Callable[[
+ Callable[[grpc.HandlerCallDetails], Awaitable[grpc.
+ RpcMethodHandler]],
+ grpc.HandlerCallDetails
+ ], Any]) -> None:
+ self._fn = fn
+
+ async def intercept_service(
+ self, continuation: Callable[[grpc.HandlerCallDetails], Awaitable[
+ grpc.RpcMethodHandler]],
+ handler_call_details: grpc.HandlerCallDetails
+ ) -> grpc.RpcMethodHandler:
+ return await self._fn(continuation, handler_call_details)
+
+
+def _filter_server_interceptor(condition: Callable,
+ interceptor: aio.ServerInterceptor
+ ) -> aio.ServerInterceptor:
+
+ async def intercept_service(
+ continuation: Callable[[grpc.HandlerCallDetails], Awaitable[
+ grpc.RpcMethodHandler]],
+ handler_call_details: grpc.HandlerCallDetails
+ ) -> grpc.RpcMethodHandler:
+ if condition(handler_call_details):
+ return await interceptor.intercept_service(continuation,
+ handler_call_details)
+ return await continuation(handler_call_details)
+
+ return _GenericInterceptor(intercept_service)
+
+
+class _CacheInterceptor(aio.ServerInterceptor):
+ """An interceptor that caches response based on request message."""
+
+ def __init__(self, cache_store=None):
+ self.cache_store = cache_store or {}
+
+ async def intercept_service(
+ self, continuation: Callable[[grpc.HandlerCallDetails], Awaitable[
+ grpc.RpcMethodHandler]],
+ handler_call_details: grpc.HandlerCallDetails
+ ) -> grpc.RpcMethodHandler:
+ # Get the actual handler
+ handler = await continuation(handler_call_details)
+
+ # Only intercept unary call RPCs
+ if handler and (handler.request_streaming or # pytype: disable=attribute-error
+ handler.response_streaming): # pytype: disable=attribute-error
+ return handler
+
+ def wrapper(behavior: Callable[
+ [messages_pb2.SimpleRequest, aio.
+ ServicerContext], messages_pb2.SimpleResponse]):
+
+ @functools.wraps(behavior)
+ async def wrapper(request: messages_pb2.SimpleRequest,
+ context: aio.ServicerContext
+ ) -> messages_pb2.SimpleResponse:
+ if request.response_size not in self.cache_store:
+ self.cache_store[request.response_size] = await behavior(
+ request, context)
+ return self.cache_store[request.response_size]
+
+ return wrapper
+
+ return wrap_server_method_handler(wrapper, handler)
+
+
+async def _create_server_stub_pair(
+ *interceptors: aio.ServerInterceptor
+) -> Tuple[aio.Server, test_pb2_grpc.TestServiceStub]:
+ """Creates a server-stub pair with given interceptors.
+
+ Returning the server object to protect it from being garbage collected.
+ """
+ server_target, server = await start_test_server(interceptors=interceptors)
+ channel = aio.insecure_channel(server_target)
+ return server, test_pb2_grpc.TestServiceStub(channel)
+
+
+class TestServerInterceptor(AioTestBase):
+
+ async def test_invalid_interceptor(self):
+
+ class InvalidInterceptor:
+ """Just an invalid Interceptor"""
+
+ with self.assertRaises(ValueError):
+ server_target, _ = await start_test_server(
+ interceptors=(InvalidInterceptor(),))
+
+ async def test_executed_right_order(self):
+ record = []
+ server_target, _ = await start_test_server(interceptors=(
+ _LoggingInterceptor('log1', record),
+ _LoggingInterceptor('log2', record),
+ ))
+
+ async with aio.insecure_channel(server_target) as channel:
+ multicallable = channel.unary_unary(
+ '/grpc.testing.TestService/UnaryCall',
+ request_serializer=messages_pb2.SimpleRequest.SerializeToString,
+ response_deserializer=messages_pb2.SimpleResponse.FromString)
+ call = multicallable(messages_pb2.SimpleRequest())
+ response = await call
+
+ # Check that all interceptors were executed, and were executed
+ # in the right order.
+ self.assertSequenceEqual([
+ 'log1:intercept_service',
+ 'log2:intercept_service',
+ ], record)
+ self.assertIsInstance(response, messages_pb2.SimpleResponse)
+
+ async def test_response_ok(self):
+ record = []
+ server_target, _ = await start_test_server(
+ interceptors=(_LoggingInterceptor('log1', record),))
+
+ async with aio.insecure_channel(server_target) as channel:
+ multicallable = channel.unary_unary(
+ '/grpc.testing.TestService/UnaryCall',
+ request_serializer=messages_pb2.SimpleRequest.SerializeToString,
+ response_deserializer=messages_pb2.SimpleResponse.FromString)
+ call = multicallable(messages_pb2.SimpleRequest())
+ response = await call
+ code = await call.code()
+
+ self.assertSequenceEqual(['log1:intercept_service'], record)
+ self.assertIsInstance(response, messages_pb2.SimpleResponse)
+ self.assertEqual(code, grpc.StatusCode.OK)
+
+ async def test_apply_different_interceptors_by_metadata(self):
+ record = []
+ conditional_interceptor = _filter_server_interceptor(
+ lambda x: ('secret', '42') in x.invocation_metadata,
+ _LoggingInterceptor('log3', record))
+ server_target, _ = await start_test_server(interceptors=(
+ _LoggingInterceptor('log1', record),
+ conditional_interceptor,
+ _LoggingInterceptor('log2', record),
+ ))
+
+ async with aio.insecure_channel(server_target) as channel:
+ multicallable = channel.unary_unary(
+ '/grpc.testing.TestService/UnaryCall',
+ request_serializer=messages_pb2.SimpleRequest.SerializeToString,
+ response_deserializer=messages_pb2.SimpleResponse.FromString)
+
+ metadata = aio.Metadata(('key', 'value'),)
+ call = multicallable(messages_pb2.SimpleRequest(),
+ metadata=metadata)
+ await call
+ self.assertSequenceEqual([
+ 'log1:intercept_service',
+ 'log2:intercept_service',
+ ], record)
+
+ record.clear()
+ metadata = aio.Metadata(('key', 'value'), ('secret', '42'))
+ call = multicallable(messages_pb2.SimpleRequest(),
+ metadata=metadata)
+ await call
+ self.assertSequenceEqual([
+ 'log1:intercept_service',
+ 'log3:intercept_service',
+ 'log2:intercept_service',
+ ], record)
+
+ async def test_response_caching(self):
+ # Prepares a preset value to help testing
+ interceptor = _CacheInterceptor({
+ 42:
+ messages_pb2.SimpleResponse(payload=messages_pb2.Payload(
+ body=b'\x42'))
+ })
+
+ # Constructs a server with the cache interceptor
+ server, stub = await _create_server_stub_pair(interceptor)
+
+ # Tests if the cache store is used
+ response = await stub.UnaryCall(
+ messages_pb2.SimpleRequest(response_size=42))
+ self.assertEqual(1, len(interceptor.cache_store[42].payload.body))
+ self.assertEqual(interceptor.cache_store[42], response)
+
+ # Tests response can be cached
+ response = await stub.UnaryCall(
+ messages_pb2.SimpleRequest(response_size=1337))
+ self.assertEqual(1337, len(interceptor.cache_store[1337].payload.body))
+ self.assertEqual(interceptor.cache_store[1337], response)
+ response = await stub.UnaryCall(
+ messages_pb2.SimpleRequest(response_size=1337))
+ self.assertEqual(interceptor.cache_store[1337], response)
+
+ async def test_interceptor_unary_stream(self):
+ record = []
+ server, stub = await _create_server_stub_pair(
+ _LoggingInterceptor('log_unary_stream', record))
+
+ # Prepares the request
+ request = messages_pb2.StreamingOutputCallRequest()
+ for _ in range(_NUM_STREAM_RESPONSES):
+ request.response_parameters.append(
+ messages_pb2.ResponseParameters(size=_RESPONSE_PAYLOAD_SIZE,))
+
+ # Tests if the cache store is used
+ call = stub.StreamingOutputCall(request)
+
+ # Ensures the RPC goes fine
+ async for response in call:
+ self.assertEqual(_RESPONSE_PAYLOAD_SIZE, len(response.payload.body))
+ self.assertEqual(await call.code(), grpc.StatusCode.OK)
+
+ self.assertSequenceEqual([
+ 'log_unary_stream:intercept_service',
+ ], record)
+
+ async def test_interceptor_stream_unary(self):
+ record = []
+ server, stub = await _create_server_stub_pair(
+ _LoggingInterceptor('log_stream_unary', record))
+
+ # Invokes the actual RPC
+ call = stub.StreamingInputCall()
+
+ # Prepares the request
+ payload = messages_pb2.Payload(body=b'\0' * _REQUEST_PAYLOAD_SIZE)
+ request = messages_pb2.StreamingInputCallRequest(payload=payload)
+
+ # Sends out requests
+ for _ in range(_NUM_STREAM_RESPONSES):
+ await call.write(request)
+ await call.done_writing()
+
+ # Validates the responses
+ response = await call
+ self.assertIsInstance(response, messages_pb2.StreamingInputCallResponse)
+ self.assertEqual(_NUM_STREAM_RESPONSES * _REQUEST_PAYLOAD_SIZE,
+ response.aggregated_payload_size)
+
+ self.assertEqual(await call.code(), grpc.StatusCode.OK)
+
+ self.assertSequenceEqual([
+ 'log_stream_unary:intercept_service',
+ ], record)
+
+ async def test_interceptor_stream_stream(self):
+ record = []
+ server, stub = await _create_server_stub_pair(
+ _LoggingInterceptor('log_stream_stream', record))
+
+ # Prepares the request
+ payload = messages_pb2.Payload(body=b'\0' * _REQUEST_PAYLOAD_SIZE)
+ request = messages_pb2.StreamingInputCallRequest(payload=payload)
+
+ async def gen():
+ for _ in range(_NUM_STREAM_RESPONSES):
+ yield request
+
+ # Invokes the actual RPC
+ call = stub.StreamingInputCall(gen())
+
+ # Validates the responses
+ response = await call
+ self.assertIsInstance(response, messages_pb2.StreamingInputCallResponse)
+ self.assertEqual(_NUM_STREAM_RESPONSES * _REQUEST_PAYLOAD_SIZE,
+ response.aggregated_payload_size)
+
+ self.assertEqual(await call.code(), grpc.StatusCode.OK)
+
+ self.assertSequenceEqual([
+ 'log_stream_stream:intercept_service',
+ ], record)
+
+
+if __name__ == '__main__':
+ logging.basicConfig(level=logging.DEBUG)
+ unittest.main(verbosity=2)
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/server_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/server_test.py
index 95d50bee7bb..61d1edd5231 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/server_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/server_test.py
@@ -13,90 +13,90 @@
# limitations under the License.
import asyncio
-import gc
+import gc
import logging
-import socket
-import time
+import socket
+import time
import unittest
import grpc
from grpc.experimental import aio
-
-from tests.unit import resources
-from tests.unit.framework.common import test_constants
+
+from tests.unit import resources
+from tests.unit.framework.common import test_constants
from tests_aio.unit._test_base import AioTestBase
_SIMPLE_UNARY_UNARY = '/test/SimpleUnaryUnary'
_BLOCK_FOREVER = '/test/BlockForever'
_BLOCK_BRIEFLY = '/test/BlockBriefly'
-_UNARY_STREAM_ASYNC_GEN = '/test/UnaryStreamAsyncGen'
-_UNARY_STREAM_READER_WRITER = '/test/UnaryStreamReaderWriter'
-_UNARY_STREAM_EVILLY_MIXED = '/test/UnaryStreamEvillyMixed'
-_STREAM_UNARY_ASYNC_GEN = '/test/StreamUnaryAsyncGen'
-_STREAM_UNARY_READER_WRITER = '/test/StreamUnaryReaderWriter'
-_STREAM_UNARY_EVILLY_MIXED = '/test/StreamUnaryEvillyMixed'
-_STREAM_STREAM_ASYNC_GEN = '/test/StreamStreamAsyncGen'
-_STREAM_STREAM_READER_WRITER = '/test/StreamStreamReaderWriter'
-_STREAM_STREAM_EVILLY_MIXED = '/test/StreamStreamEvillyMixed'
-_UNIMPLEMENTED_METHOD = '/test/UnimplementedMethod'
-_ERROR_IN_STREAM_STREAM = '/test/ErrorInStreamStream'
-_ERROR_WITHOUT_RAISE_IN_UNARY_UNARY = '/test/ErrorWithoutRaiseInUnaryUnary'
-_ERROR_WITHOUT_RAISE_IN_STREAM_STREAM = '/test/ErrorWithoutRaiseInStreamStream'
+_UNARY_STREAM_ASYNC_GEN = '/test/UnaryStreamAsyncGen'
+_UNARY_STREAM_READER_WRITER = '/test/UnaryStreamReaderWriter'
+_UNARY_STREAM_EVILLY_MIXED = '/test/UnaryStreamEvillyMixed'
+_STREAM_UNARY_ASYNC_GEN = '/test/StreamUnaryAsyncGen'
+_STREAM_UNARY_READER_WRITER = '/test/StreamUnaryReaderWriter'
+_STREAM_UNARY_EVILLY_MIXED = '/test/StreamUnaryEvillyMixed'
+_STREAM_STREAM_ASYNC_GEN = '/test/StreamStreamAsyncGen'
+_STREAM_STREAM_READER_WRITER = '/test/StreamStreamReaderWriter'
+_STREAM_STREAM_EVILLY_MIXED = '/test/StreamStreamEvillyMixed'
+_UNIMPLEMENTED_METHOD = '/test/UnimplementedMethod'
+_ERROR_IN_STREAM_STREAM = '/test/ErrorInStreamStream'
+_ERROR_WITHOUT_RAISE_IN_UNARY_UNARY = '/test/ErrorWithoutRaiseInUnaryUnary'
+_ERROR_WITHOUT_RAISE_IN_STREAM_STREAM = '/test/ErrorWithoutRaiseInStreamStream'
_REQUEST = b'\x00\x00\x00'
_RESPONSE = b'\x01\x01\x01'
-_NUM_STREAM_REQUESTS = 3
-_NUM_STREAM_RESPONSES = 5
+_NUM_STREAM_REQUESTS = 3
+_NUM_STREAM_RESPONSES = 5
class _GenericHandler(grpc.GenericRpcHandler):
def __init__(self):
self._called = asyncio.get_event_loop().create_future()
- self._routing_table = {
- _SIMPLE_UNARY_UNARY:
- grpc.unary_unary_rpc_method_handler(self._unary_unary),
- _BLOCK_FOREVER:
- grpc.unary_unary_rpc_method_handler(self._block_forever),
- _BLOCK_BRIEFLY:
- grpc.unary_unary_rpc_method_handler(self._block_briefly),
- _UNARY_STREAM_ASYNC_GEN:
- grpc.unary_stream_rpc_method_handler(
- self._unary_stream_async_gen),
- _UNARY_STREAM_READER_WRITER:
- grpc.unary_stream_rpc_method_handler(
- self._unary_stream_reader_writer),
- _UNARY_STREAM_EVILLY_MIXED:
- grpc.unary_stream_rpc_method_handler(
- self._unary_stream_evilly_mixed),
- _STREAM_UNARY_ASYNC_GEN:
- grpc.stream_unary_rpc_method_handler(
- self._stream_unary_async_gen),
- _STREAM_UNARY_READER_WRITER:
- grpc.stream_unary_rpc_method_handler(
- self._stream_unary_reader_writer),
- _STREAM_UNARY_EVILLY_MIXED:
- grpc.stream_unary_rpc_method_handler(
- self._stream_unary_evilly_mixed),
- _STREAM_STREAM_ASYNC_GEN:
- grpc.stream_stream_rpc_method_handler(
- self._stream_stream_async_gen),
- _STREAM_STREAM_READER_WRITER:
- grpc.stream_stream_rpc_method_handler(
- self._stream_stream_reader_writer),
- _STREAM_STREAM_EVILLY_MIXED:
- grpc.stream_stream_rpc_method_handler(
- self._stream_stream_evilly_mixed),
- _ERROR_IN_STREAM_STREAM:
- grpc.stream_stream_rpc_method_handler(
- self._error_in_stream_stream),
- _ERROR_WITHOUT_RAISE_IN_UNARY_UNARY:
- grpc.unary_unary_rpc_method_handler(
- self._error_without_raise_in_unary_unary),
- _ERROR_WITHOUT_RAISE_IN_STREAM_STREAM:
- grpc.stream_stream_rpc_method_handler(
- self._error_without_raise_in_stream_stream),
- }
+ self._routing_table = {
+ _SIMPLE_UNARY_UNARY:
+ grpc.unary_unary_rpc_method_handler(self._unary_unary),
+ _BLOCK_FOREVER:
+ grpc.unary_unary_rpc_method_handler(self._block_forever),
+ _BLOCK_BRIEFLY:
+ grpc.unary_unary_rpc_method_handler(self._block_briefly),
+ _UNARY_STREAM_ASYNC_GEN:
+ grpc.unary_stream_rpc_method_handler(
+ self._unary_stream_async_gen),
+ _UNARY_STREAM_READER_WRITER:
+ grpc.unary_stream_rpc_method_handler(
+ self._unary_stream_reader_writer),
+ _UNARY_STREAM_EVILLY_MIXED:
+ grpc.unary_stream_rpc_method_handler(
+ self._unary_stream_evilly_mixed),
+ _STREAM_UNARY_ASYNC_GEN:
+ grpc.stream_unary_rpc_method_handler(
+ self._stream_unary_async_gen),
+ _STREAM_UNARY_READER_WRITER:
+ grpc.stream_unary_rpc_method_handler(
+ self._stream_unary_reader_writer),
+ _STREAM_UNARY_EVILLY_MIXED:
+ grpc.stream_unary_rpc_method_handler(
+ self._stream_unary_evilly_mixed),
+ _STREAM_STREAM_ASYNC_GEN:
+ grpc.stream_stream_rpc_method_handler(
+ self._stream_stream_async_gen),
+ _STREAM_STREAM_READER_WRITER:
+ grpc.stream_stream_rpc_method_handler(
+ self._stream_stream_reader_writer),
+ _STREAM_STREAM_EVILLY_MIXED:
+ grpc.stream_stream_rpc_method_handler(
+ self._stream_stream_evilly_mixed),
+ _ERROR_IN_STREAM_STREAM:
+ grpc.stream_stream_rpc_method_handler(
+ self._error_in_stream_stream),
+ _ERROR_WITHOUT_RAISE_IN_UNARY_UNARY:
+ grpc.unary_unary_rpc_method_handler(
+ self._error_without_raise_in_unary_unary),
+ _ERROR_WITHOUT_RAISE_IN_STREAM_STREAM:
+ grpc.stream_stream_rpc_method_handler(
+ self._error_without_raise_in_stream_stream),
+ }
@staticmethod
async def _unary_unary(unused_request, unused_context):
@@ -105,92 +105,92 @@ class _GenericHandler(grpc.GenericRpcHandler):
async def _block_forever(self, unused_request, unused_context):
await asyncio.get_event_loop().create_future()
- async def _block_briefly(self, unused_request, unused_context):
+ async def _block_briefly(self, unused_request, unused_context):
await asyncio.sleep(test_constants.SHORT_TIMEOUT / 2)
return _RESPONSE
- async def _unary_stream_async_gen(self, unused_request, unused_context):
- for _ in range(_NUM_STREAM_RESPONSES):
- yield _RESPONSE
-
- async def _unary_stream_reader_writer(self, unused_request, context):
- for _ in range(_NUM_STREAM_RESPONSES):
- await context.write(_RESPONSE)
-
- async def _unary_stream_evilly_mixed(self, unused_request, context):
- yield _RESPONSE
- for _ in range(_NUM_STREAM_RESPONSES - 1):
- await context.write(_RESPONSE)
-
- async def _stream_unary_async_gen(self, request_iterator, unused_context):
- request_count = 0
- async for request in request_iterator:
- assert _REQUEST == request
- request_count += 1
- assert _NUM_STREAM_REQUESTS == request_count
- return _RESPONSE
-
- async def _stream_unary_reader_writer(self, unused_request, context):
- for _ in range(_NUM_STREAM_REQUESTS):
- assert _REQUEST == await context.read()
- return _RESPONSE
-
- async def _stream_unary_evilly_mixed(self, request_iterator, context):
- assert _REQUEST == await context.read()
- request_count = 0
- async for request in request_iterator:
- assert _REQUEST == request
- request_count += 1
- assert _NUM_STREAM_REQUESTS - 1 == request_count
- return _RESPONSE
-
- async def _stream_stream_async_gen(self, request_iterator, unused_context):
- request_count = 0
- async for request in request_iterator:
- assert _REQUEST == request
- request_count += 1
- assert _NUM_STREAM_REQUESTS == request_count
-
- for _ in range(_NUM_STREAM_RESPONSES):
- yield _RESPONSE
-
- async def _stream_stream_reader_writer(self, unused_request, context):
- for _ in range(_NUM_STREAM_REQUESTS):
- assert _REQUEST == await context.read()
- for _ in range(_NUM_STREAM_RESPONSES):
- await context.write(_RESPONSE)
-
- async def _stream_stream_evilly_mixed(self, request_iterator, context):
- assert _REQUEST == await context.read()
- request_count = 0
- async for request in request_iterator:
- assert _REQUEST == request
- request_count += 1
- assert _NUM_STREAM_REQUESTS - 1 == request_count
-
- yield _RESPONSE
- for _ in range(_NUM_STREAM_RESPONSES - 1):
- await context.write(_RESPONSE)
-
- async def _error_in_stream_stream(self, request_iterator, unused_context):
- async for request in request_iterator:
- assert _REQUEST == request
- raise RuntimeError('A testing RuntimeError!')
- yield _RESPONSE
-
- async def _error_without_raise_in_unary_unary(self, request, context):
- assert _REQUEST == request
- context.set_code(grpc.StatusCode.INTERNAL)
-
- async def _error_without_raise_in_stream_stream(self, request_iterator,
- context):
- async for request in request_iterator:
- assert _REQUEST == request
- context.set_code(grpc.StatusCode.INTERNAL)
-
+ async def _unary_stream_async_gen(self, unused_request, unused_context):
+ for _ in range(_NUM_STREAM_RESPONSES):
+ yield _RESPONSE
+
+ async def _unary_stream_reader_writer(self, unused_request, context):
+ for _ in range(_NUM_STREAM_RESPONSES):
+ await context.write(_RESPONSE)
+
+ async def _unary_stream_evilly_mixed(self, unused_request, context):
+ yield _RESPONSE
+ for _ in range(_NUM_STREAM_RESPONSES - 1):
+ await context.write(_RESPONSE)
+
+ async def _stream_unary_async_gen(self, request_iterator, unused_context):
+ request_count = 0
+ async for request in request_iterator:
+ assert _REQUEST == request
+ request_count += 1
+ assert _NUM_STREAM_REQUESTS == request_count
+ return _RESPONSE
+
+ async def _stream_unary_reader_writer(self, unused_request, context):
+ for _ in range(_NUM_STREAM_REQUESTS):
+ assert _REQUEST == await context.read()
+ return _RESPONSE
+
+ async def _stream_unary_evilly_mixed(self, request_iterator, context):
+ assert _REQUEST == await context.read()
+ request_count = 0
+ async for request in request_iterator:
+ assert _REQUEST == request
+ request_count += 1
+ assert _NUM_STREAM_REQUESTS - 1 == request_count
+ return _RESPONSE
+
+ async def _stream_stream_async_gen(self, request_iterator, unused_context):
+ request_count = 0
+ async for request in request_iterator:
+ assert _REQUEST == request
+ request_count += 1
+ assert _NUM_STREAM_REQUESTS == request_count
+
+ for _ in range(_NUM_STREAM_RESPONSES):
+ yield _RESPONSE
+
+ async def _stream_stream_reader_writer(self, unused_request, context):
+ for _ in range(_NUM_STREAM_REQUESTS):
+ assert _REQUEST == await context.read()
+ for _ in range(_NUM_STREAM_RESPONSES):
+ await context.write(_RESPONSE)
+
+ async def _stream_stream_evilly_mixed(self, request_iterator, context):
+ assert _REQUEST == await context.read()
+ request_count = 0
+ async for request in request_iterator:
+ assert _REQUEST == request
+ request_count += 1
+ assert _NUM_STREAM_REQUESTS - 1 == request_count
+
+ yield _RESPONSE
+ for _ in range(_NUM_STREAM_RESPONSES - 1):
+ await context.write(_RESPONSE)
+
+ async def _error_in_stream_stream(self, request_iterator, unused_context):
+ async for request in request_iterator:
+ assert _REQUEST == request
+ raise RuntimeError('A testing RuntimeError!')
+ yield _RESPONSE
+
+ async def _error_without_raise_in_unary_unary(self, request, context):
+ assert _REQUEST == request
+ context.set_code(grpc.StatusCode.INTERNAL)
+
+ async def _error_without_raise_in_stream_stream(self, request_iterator,
+ context):
+ async for request in request_iterator:
+ assert _REQUEST == request
+ context.set_code(grpc.StatusCode.INTERNAL)
+
def service(self, handler_details):
self._called.set_result(None)
- return self._routing_table.get(handler_details.method)
+ return self._routing_table.get(handler_details.method)
async def wait_for_call(self):
await self._called
@@ -207,280 +207,280 @@ async def _start_test_server():
class TestServer(AioTestBase):
- async def setUp(self):
- addr, self._server, self._generic_handler = await _start_test_server()
- self._channel = aio.insecure_channel(addr)
+ async def setUp(self):
+ addr, self._server, self._generic_handler = await _start_test_server()
+ self._channel = aio.insecure_channel(addr)
+
+ async def tearDown(self):
+ await self._channel.close()
+ await self._server.stop(None)
+
+ async def test_unary_unary(self):
+ unary_unary_call = self._channel.unary_unary(_SIMPLE_UNARY_UNARY)
+ response = await unary_unary_call(_REQUEST)
+ self.assertEqual(response, _RESPONSE)
+
+ async def test_unary_stream_async_generator(self):
+ unary_stream_call = self._channel.unary_stream(_UNARY_STREAM_ASYNC_GEN)
+ call = unary_stream_call(_REQUEST)
+
+ response_cnt = 0
+ async for response in call:
+ response_cnt += 1
+ self.assertEqual(_RESPONSE, response)
+
+ self.assertEqual(_NUM_STREAM_RESPONSES, response_cnt)
+ self.assertEqual(await call.code(), grpc.StatusCode.OK)
+
+ async def test_unary_stream_reader_writer(self):
+ unary_stream_call = self._channel.unary_stream(
+ _UNARY_STREAM_READER_WRITER)
+ call = unary_stream_call(_REQUEST)
+
+ for _ in range(_NUM_STREAM_RESPONSES):
+ response = await call.read()
+ self.assertEqual(_RESPONSE, response)
+
+ self.assertEqual(await call.code(), grpc.StatusCode.OK)
+
+ async def test_unary_stream_evilly_mixed(self):
+ unary_stream_call = self._channel.unary_stream(
+ _UNARY_STREAM_EVILLY_MIXED)
+ call = unary_stream_call(_REQUEST)
+
+ # Uses reader API
+ self.assertEqual(_RESPONSE, await call.read())
+
+ # Uses async generator API, mixed!
+ with self.assertRaises(aio.UsageError):
+ async for response in call:
+ self.assertEqual(_RESPONSE, response)
+
+ async def test_stream_unary_async_generator(self):
+ stream_unary_call = self._channel.stream_unary(_STREAM_UNARY_ASYNC_GEN)
+ call = stream_unary_call()
+
+ for _ in range(_NUM_STREAM_REQUESTS):
+ await call.write(_REQUEST)
+ await call.done_writing()
+
+ response = await call
+ self.assertEqual(_RESPONSE, response)
+ self.assertEqual(await call.code(), grpc.StatusCode.OK)
+
+ async def test_stream_unary_reader_writer(self):
+ stream_unary_call = self._channel.stream_unary(
+ _STREAM_UNARY_READER_WRITER)
+ call = stream_unary_call()
+
+ for _ in range(_NUM_STREAM_REQUESTS):
+ await call.write(_REQUEST)
+ await call.done_writing()
+
+ response = await call
+ self.assertEqual(_RESPONSE, response)
+ self.assertEqual(await call.code(), grpc.StatusCode.OK)
+
+ async def test_stream_unary_evilly_mixed(self):
+ stream_unary_call = self._channel.stream_unary(
+ _STREAM_UNARY_EVILLY_MIXED)
+ call = stream_unary_call()
+
+ for _ in range(_NUM_STREAM_REQUESTS):
+ await call.write(_REQUEST)
+ await call.done_writing()
+
+ response = await call
+ self.assertEqual(_RESPONSE, response)
+ self.assertEqual(await call.code(), grpc.StatusCode.OK)
+
+ async def test_stream_stream_async_generator(self):
+ stream_stream_call = self._channel.stream_stream(
+ _STREAM_STREAM_ASYNC_GEN)
+ call = stream_stream_call()
+
+ for _ in range(_NUM_STREAM_REQUESTS):
+ await call.write(_REQUEST)
+ await call.done_writing()
+
+ for _ in range(_NUM_STREAM_RESPONSES):
+ response = await call.read()
+ self.assertEqual(_RESPONSE, response)
+
+ self.assertEqual(await call.code(), grpc.StatusCode.OK)
+
+ async def test_stream_stream_reader_writer(self):
+ stream_stream_call = self._channel.stream_stream(
+ _STREAM_STREAM_READER_WRITER)
+ call = stream_stream_call()
+
+ for _ in range(_NUM_STREAM_REQUESTS):
+ await call.write(_REQUEST)
+ await call.done_writing()
+
+ for _ in range(_NUM_STREAM_RESPONSES):
+ response = await call.read()
+ self.assertEqual(_RESPONSE, response)
+
+ self.assertEqual(await call.code(), grpc.StatusCode.OK)
+
+ async def test_stream_stream_evilly_mixed(self):
+ stream_stream_call = self._channel.stream_stream(
+ _STREAM_STREAM_EVILLY_MIXED)
+ call = stream_stream_call()
+
+ for _ in range(_NUM_STREAM_REQUESTS):
+ await call.write(_REQUEST)
+ await call.done_writing()
+
+ for _ in range(_NUM_STREAM_RESPONSES):
+ response = await call.read()
+ self.assertEqual(_RESPONSE, response)
+
+ self.assertEqual(await call.code(), grpc.StatusCode.OK)
+
+ async def test_shutdown(self):
+ await self._server.stop(None)
+ # Ensures no SIGSEGV triggered, and ends within timeout.
+
+ async def test_shutdown_after_call(self):
+ await self._channel.unary_unary(_SIMPLE_UNARY_UNARY)(_REQUEST)
+
+ await self._server.stop(None)
+
+ async def test_graceful_shutdown_success(self):
+ call = self._channel.unary_unary(_BLOCK_BRIEFLY)(_REQUEST)
+ await self._generic_handler.wait_for_call()
+
+ shutdown_start_time = time.time()
+ await self._server.stop(test_constants.SHORT_TIMEOUT)
+ grace_period_length = time.time() - shutdown_start_time
+ self.assertGreater(grace_period_length,
+ test_constants.SHORT_TIMEOUT / 3)
+
+ # Validates the states.
+ self.assertEqual(_RESPONSE, await call)
+ self.assertTrue(call.done())
+
+ async def test_graceful_shutdown_failed(self):
+ call = self._channel.unary_unary(_BLOCK_FOREVER)(_REQUEST)
+ await self._generic_handler.wait_for_call()
+
+ await self._server.stop(test_constants.SHORT_TIMEOUT)
+
+ with self.assertRaises(aio.AioRpcError) as exception_context:
+ await call
+ self.assertEqual(grpc.StatusCode.UNAVAILABLE,
+ exception_context.exception.code())
+
+ async def test_concurrent_graceful_shutdown(self):
+ call = self._channel.unary_unary(_BLOCK_BRIEFLY)(_REQUEST)
+ await self._generic_handler.wait_for_call()
+
+ # Expects the shortest grace period to be effective.
+ shutdown_start_time = time.time()
+ await asyncio.gather(
+ self._server.stop(test_constants.LONG_TIMEOUT),
+ self._server.stop(test_constants.SHORT_TIMEOUT),
+ self._server.stop(test_constants.LONG_TIMEOUT),
+ )
+ grace_period_length = time.time() - shutdown_start_time
+ self.assertGreater(grace_period_length,
+ test_constants.SHORT_TIMEOUT / 3)
+
+ self.assertEqual(_RESPONSE, await call)
+ self.assertTrue(call.done())
+
+ async def test_concurrent_graceful_shutdown_immediate(self):
+ call = self._channel.unary_unary(_BLOCK_FOREVER)(_REQUEST)
+ await self._generic_handler.wait_for_call()
+
+ # Expects no grace period, due to the "server.stop(None)".
+ await asyncio.gather(
+ self._server.stop(test_constants.LONG_TIMEOUT),
+ self._server.stop(None),
+ self._server.stop(test_constants.SHORT_TIMEOUT),
+ self._server.stop(test_constants.LONG_TIMEOUT),
+ )
- async def tearDown(self):
- await self._channel.close()
- await self._server.stop(None)
+ with self.assertRaises(aio.AioRpcError) as exception_context:
+ await call
+ self.assertEqual(grpc.StatusCode.UNAVAILABLE,
+ exception_context.exception.code())
- async def test_unary_unary(self):
- unary_unary_call = self._channel.unary_unary(_SIMPLE_UNARY_UNARY)
- response = await unary_unary_call(_REQUEST)
- self.assertEqual(response, _RESPONSE)
+ async def test_shutdown_before_call(self):
+ await self._server.stop(None)
- async def test_unary_stream_async_generator(self):
- unary_stream_call = self._channel.unary_stream(_UNARY_STREAM_ASYNC_GEN)
- call = unary_stream_call(_REQUEST)
+ # Ensures the server is cleaned up at this point.
+ # Some proper exception should be raised.
+ with self.assertRaises(aio.AioRpcError):
+ await self._channel.unary_unary(_SIMPLE_UNARY_UNARY)(_REQUEST)
- response_cnt = 0
- async for response in call:
- response_cnt += 1
- self.assertEqual(_RESPONSE, response)
+ async def test_unimplemented(self):
+ call = self._channel.unary_unary(_UNIMPLEMENTED_METHOD)
+ with self.assertRaises(aio.AioRpcError) as exception_context:
+ await call(_REQUEST)
+ rpc_error = exception_context.exception
+ self.assertEqual(grpc.StatusCode.UNIMPLEMENTED, rpc_error.code())
- self.assertEqual(_NUM_STREAM_RESPONSES, response_cnt)
- self.assertEqual(await call.code(), grpc.StatusCode.OK)
+ async def test_shutdown_during_stream_stream(self):
+ stream_stream_call = self._channel.stream_stream(
+ _STREAM_STREAM_ASYNC_GEN)
+ call = stream_stream_call()
- async def test_unary_stream_reader_writer(self):
- unary_stream_call = self._channel.unary_stream(
- _UNARY_STREAM_READER_WRITER)
- call = unary_stream_call(_REQUEST)
+ # Don't half close the RPC yet, keep it alive.
+ await call.write(_REQUEST)
+ await self._server.stop(None)
- for _ in range(_NUM_STREAM_RESPONSES):
- response = await call.read()
- self.assertEqual(_RESPONSE, response)
+ self.assertEqual(grpc.StatusCode.UNAVAILABLE, await call.code())
+ # No segfault
- self.assertEqual(await call.code(), grpc.StatusCode.OK)
+ async def test_error_in_stream_stream(self):
+ stream_stream_call = self._channel.stream_stream(
+ _ERROR_IN_STREAM_STREAM)
+ call = stream_stream_call()
+
+ # Don't half close the RPC yet, keep it alive.
+ await call.write(_REQUEST)
- async def test_unary_stream_evilly_mixed(self):
- unary_stream_call = self._channel.unary_stream(
- _UNARY_STREAM_EVILLY_MIXED)
- call = unary_stream_call(_REQUEST)
+ # Don't segfault here
+ self.assertEqual(grpc.StatusCode.UNKNOWN, await call.code())
+
+ async def test_error_without_raise_in_unary_unary(self):
+ call = self._channel.unary_unary(_ERROR_WITHOUT_RAISE_IN_UNARY_UNARY)(
+ _REQUEST)
+
+ with self.assertRaises(aio.AioRpcError) as exception_context:
+ await call
+
+ rpc_error = exception_context.exception
+ self.assertEqual(grpc.StatusCode.INTERNAL, rpc_error.code())
+
+ async def test_error_without_raise_in_stream_stream(self):
+ call = self._channel.stream_stream(
+ _ERROR_WITHOUT_RAISE_IN_STREAM_STREAM)()
+
+ for _ in range(_NUM_STREAM_REQUESTS):
+ await call.write(_REQUEST)
+ await call.done_writing()
+
+ self.assertEqual(grpc.StatusCode.INTERNAL, await call.code())
+
+ async def test_port_binding_exception(self):
+ server = aio.server(options=(('grpc.so_reuseport', 0),))
+ port = server.add_insecure_port('localhost:0')
+ bind_address = "localhost:%d" % port
+
+ with self.assertRaises(RuntimeError):
+ server.add_insecure_port(bind_address)
+
+ server_credentials = grpc.ssl_server_credentials([
+ (resources.private_key(), resources.certificate_chain())
+ ])
+ with self.assertRaises(RuntimeError):
+ server.add_secure_port(bind_address, server_credentials)
- # Uses reader API
- self.assertEqual(_RESPONSE, await call.read())
- # Uses async generator API, mixed!
- with self.assertRaises(aio.UsageError):
- async for response in call:
- self.assertEqual(_RESPONSE, response)
-
- async def test_stream_unary_async_generator(self):
- stream_unary_call = self._channel.stream_unary(_STREAM_UNARY_ASYNC_GEN)
- call = stream_unary_call()
-
- for _ in range(_NUM_STREAM_REQUESTS):
- await call.write(_REQUEST)
- await call.done_writing()
-
- response = await call
- self.assertEqual(_RESPONSE, response)
- self.assertEqual(await call.code(), grpc.StatusCode.OK)
-
- async def test_stream_unary_reader_writer(self):
- stream_unary_call = self._channel.stream_unary(
- _STREAM_UNARY_READER_WRITER)
- call = stream_unary_call()
-
- for _ in range(_NUM_STREAM_REQUESTS):
- await call.write(_REQUEST)
- await call.done_writing()
-
- response = await call
- self.assertEqual(_RESPONSE, response)
- self.assertEqual(await call.code(), grpc.StatusCode.OK)
-
- async def test_stream_unary_evilly_mixed(self):
- stream_unary_call = self._channel.stream_unary(
- _STREAM_UNARY_EVILLY_MIXED)
- call = stream_unary_call()
-
- for _ in range(_NUM_STREAM_REQUESTS):
- await call.write(_REQUEST)
- await call.done_writing()
-
- response = await call
- self.assertEqual(_RESPONSE, response)
- self.assertEqual(await call.code(), grpc.StatusCode.OK)
-
- async def test_stream_stream_async_generator(self):
- stream_stream_call = self._channel.stream_stream(
- _STREAM_STREAM_ASYNC_GEN)
- call = stream_stream_call()
-
- for _ in range(_NUM_STREAM_REQUESTS):
- await call.write(_REQUEST)
- await call.done_writing()
-
- for _ in range(_NUM_STREAM_RESPONSES):
- response = await call.read()
- self.assertEqual(_RESPONSE, response)
-
- self.assertEqual(await call.code(), grpc.StatusCode.OK)
-
- async def test_stream_stream_reader_writer(self):
- stream_stream_call = self._channel.stream_stream(
- _STREAM_STREAM_READER_WRITER)
- call = stream_stream_call()
-
- for _ in range(_NUM_STREAM_REQUESTS):
- await call.write(_REQUEST)
- await call.done_writing()
-
- for _ in range(_NUM_STREAM_RESPONSES):
- response = await call.read()
- self.assertEqual(_RESPONSE, response)
-
- self.assertEqual(await call.code(), grpc.StatusCode.OK)
-
- async def test_stream_stream_evilly_mixed(self):
- stream_stream_call = self._channel.stream_stream(
- _STREAM_STREAM_EVILLY_MIXED)
- call = stream_stream_call()
-
- for _ in range(_NUM_STREAM_REQUESTS):
- await call.write(_REQUEST)
- await call.done_writing()
-
- for _ in range(_NUM_STREAM_RESPONSES):
- response = await call.read()
- self.assertEqual(_RESPONSE, response)
-
- self.assertEqual(await call.code(), grpc.StatusCode.OK)
-
- async def test_shutdown(self):
- await self._server.stop(None)
- # Ensures no SIGSEGV triggered, and ends within timeout.
-
- async def test_shutdown_after_call(self):
- await self._channel.unary_unary(_SIMPLE_UNARY_UNARY)(_REQUEST)
-
- await self._server.stop(None)
-
- async def test_graceful_shutdown_success(self):
- call = self._channel.unary_unary(_BLOCK_BRIEFLY)(_REQUEST)
- await self._generic_handler.wait_for_call()
-
- shutdown_start_time = time.time()
- await self._server.stop(test_constants.SHORT_TIMEOUT)
- grace_period_length = time.time() - shutdown_start_time
- self.assertGreater(grace_period_length,
- test_constants.SHORT_TIMEOUT / 3)
-
- # Validates the states.
- self.assertEqual(_RESPONSE, await call)
- self.assertTrue(call.done())
-
- async def test_graceful_shutdown_failed(self):
- call = self._channel.unary_unary(_BLOCK_FOREVER)(_REQUEST)
- await self._generic_handler.wait_for_call()
-
- await self._server.stop(test_constants.SHORT_TIMEOUT)
-
- with self.assertRaises(aio.AioRpcError) as exception_context:
- await call
- self.assertEqual(grpc.StatusCode.UNAVAILABLE,
- exception_context.exception.code())
-
- async def test_concurrent_graceful_shutdown(self):
- call = self._channel.unary_unary(_BLOCK_BRIEFLY)(_REQUEST)
- await self._generic_handler.wait_for_call()
-
- # Expects the shortest grace period to be effective.
- shutdown_start_time = time.time()
- await asyncio.gather(
- self._server.stop(test_constants.LONG_TIMEOUT),
- self._server.stop(test_constants.SHORT_TIMEOUT),
- self._server.stop(test_constants.LONG_TIMEOUT),
- )
- grace_period_length = time.time() - shutdown_start_time
- self.assertGreater(grace_period_length,
- test_constants.SHORT_TIMEOUT / 3)
-
- self.assertEqual(_RESPONSE, await call)
- self.assertTrue(call.done())
-
- async def test_concurrent_graceful_shutdown_immediate(self):
- call = self._channel.unary_unary(_BLOCK_FOREVER)(_REQUEST)
- await self._generic_handler.wait_for_call()
-
- # Expects no grace period, due to the "server.stop(None)".
- await asyncio.gather(
- self._server.stop(test_constants.LONG_TIMEOUT),
- self._server.stop(None),
- self._server.stop(test_constants.SHORT_TIMEOUT),
- self._server.stop(test_constants.LONG_TIMEOUT),
- )
-
- with self.assertRaises(aio.AioRpcError) as exception_context:
- await call
- self.assertEqual(grpc.StatusCode.UNAVAILABLE,
- exception_context.exception.code())
-
- async def test_shutdown_before_call(self):
- await self._server.stop(None)
-
- # Ensures the server is cleaned up at this point.
- # Some proper exception should be raised.
- with self.assertRaises(aio.AioRpcError):
- await self._channel.unary_unary(_SIMPLE_UNARY_UNARY)(_REQUEST)
-
- async def test_unimplemented(self):
- call = self._channel.unary_unary(_UNIMPLEMENTED_METHOD)
- with self.assertRaises(aio.AioRpcError) as exception_context:
- await call(_REQUEST)
- rpc_error = exception_context.exception
- self.assertEqual(grpc.StatusCode.UNIMPLEMENTED, rpc_error.code())
-
- async def test_shutdown_during_stream_stream(self):
- stream_stream_call = self._channel.stream_stream(
- _STREAM_STREAM_ASYNC_GEN)
- call = stream_stream_call()
-
- # Don't half close the RPC yet, keep it alive.
- await call.write(_REQUEST)
- await self._server.stop(None)
-
- self.assertEqual(grpc.StatusCode.UNAVAILABLE, await call.code())
- # No segfault
-
- async def test_error_in_stream_stream(self):
- stream_stream_call = self._channel.stream_stream(
- _ERROR_IN_STREAM_STREAM)
- call = stream_stream_call()
-
- # Don't half close the RPC yet, keep it alive.
- await call.write(_REQUEST)
-
- # Don't segfault here
- self.assertEqual(grpc.StatusCode.UNKNOWN, await call.code())
-
- async def test_error_without_raise_in_unary_unary(self):
- call = self._channel.unary_unary(_ERROR_WITHOUT_RAISE_IN_UNARY_UNARY)(
- _REQUEST)
-
- with self.assertRaises(aio.AioRpcError) as exception_context:
- await call
-
- rpc_error = exception_context.exception
- self.assertEqual(grpc.StatusCode.INTERNAL, rpc_error.code())
-
- async def test_error_without_raise_in_stream_stream(self):
- call = self._channel.stream_stream(
- _ERROR_WITHOUT_RAISE_IN_STREAM_STREAM)()
-
- for _ in range(_NUM_STREAM_REQUESTS):
- await call.write(_REQUEST)
- await call.done_writing()
-
- self.assertEqual(grpc.StatusCode.INTERNAL, await call.code())
-
- async def test_port_binding_exception(self):
- server = aio.server(options=(('grpc.so_reuseport', 0),))
- port = server.add_insecure_port('localhost:0')
- bind_address = "localhost:%d" % port
-
- with self.assertRaises(RuntimeError):
- server.add_insecure_port(bind_address)
-
- server_credentials = grpc.ssl_server_credentials([
- (resources.private_key(), resources.certificate_chain())
- ])
- with self.assertRaises(RuntimeError):
- server.add_secure_port(bind_address, server_credentials)
-
-
if __name__ == '__main__':
- logging.basicConfig(level=logging.DEBUG)
+ logging.basicConfig(level=logging.DEBUG)
unittest.main(verbosity=2)
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/timeout_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/timeout_test.py
index 8ad0af48f79..b5bcc027ec1 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/timeout_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/timeout_test.py
@@ -1,178 +1,178 @@
-# Copyright 2020 The gRPC Authors
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-"""Tests behavior of the timeout mechanism on client side."""
-
-import asyncio
-import logging
-import platform
-import random
-import unittest
-import datetime
-
-import grpc
-from grpc.experimental import aio
-
-from tests_aio.unit._test_base import AioTestBase
-from tests_aio.unit import _common
-
-_SLEEP_TIME_UNIT_S = datetime.timedelta(seconds=1).total_seconds()
-
-_TEST_SLEEPY_UNARY_UNARY = '/test/Test/SleepyUnaryUnary'
-_TEST_SLEEPY_UNARY_STREAM = '/test/Test/SleepyUnaryStream'
-_TEST_SLEEPY_STREAM_UNARY = '/test/Test/SleepyStreamUnary'
-_TEST_SLEEPY_STREAM_STREAM = '/test/Test/SleepyStreamStream'
-
-_REQUEST = b'\x00\x00\x00'
-_RESPONSE = b'\x01\x01\x01'
-
-
-async def _test_sleepy_unary_unary(unused_request, unused_context):
- await asyncio.sleep(_SLEEP_TIME_UNIT_S)
- return _RESPONSE
-
-
-async def _test_sleepy_unary_stream(unused_request, unused_context):
- yield _RESPONSE
- await asyncio.sleep(_SLEEP_TIME_UNIT_S)
- yield _RESPONSE
-
-
-async def _test_sleepy_stream_unary(unused_request_iterator, context):
- assert _REQUEST == await context.read()
- await asyncio.sleep(_SLEEP_TIME_UNIT_S)
- assert _REQUEST == await context.read()
- return _RESPONSE
-
-
-async def _test_sleepy_stream_stream(unused_request_iterator, context):
- assert _REQUEST == await context.read()
- await asyncio.sleep(_SLEEP_TIME_UNIT_S)
- await context.write(_RESPONSE)
-
-
-_ROUTING_TABLE = {
- _TEST_SLEEPY_UNARY_UNARY:
- grpc.unary_unary_rpc_method_handler(_test_sleepy_unary_unary),
- _TEST_SLEEPY_UNARY_STREAM:
- grpc.unary_stream_rpc_method_handler(_test_sleepy_unary_stream),
- _TEST_SLEEPY_STREAM_UNARY:
- grpc.stream_unary_rpc_method_handler(_test_sleepy_stream_unary),
- _TEST_SLEEPY_STREAM_STREAM:
- grpc.stream_stream_rpc_method_handler(_test_sleepy_stream_stream)
-}
-
-
-class _GenericHandler(grpc.GenericRpcHandler):
-
- def service(self, handler_call_details):
- return _ROUTING_TABLE.get(handler_call_details.method)
-
-
-async def _start_test_server():
- server = aio.server()
- port = server.add_insecure_port('[::]:0')
- server.add_generic_rpc_handlers((_GenericHandler(),))
- await server.start()
- return f'localhost:{port}', server
-
-
-class TestTimeout(AioTestBase):
-
- async def setUp(self):
- address, self._server = await _start_test_server()
- self._client = aio.insecure_channel(address)
- self.assertEqual(grpc.ChannelConnectivity.IDLE,
- self._client.get_state(True))
- await _common.block_until_certain_state(self._client,
- grpc.ChannelConnectivity.READY)
-
- async def tearDown(self):
- await self._client.close()
- await self._server.stop(None)
-
- async def test_unary_unary_success_with_timeout(self):
- multicallable = self._client.unary_unary(_TEST_SLEEPY_UNARY_UNARY)
- call = multicallable(_REQUEST, timeout=2 * _SLEEP_TIME_UNIT_S)
- self.assertEqual(_RESPONSE, await call)
- self.assertEqual(grpc.StatusCode.OK, await call.code())
-
- async def test_unary_unary_deadline_exceeded(self):
- multicallable = self._client.unary_unary(_TEST_SLEEPY_UNARY_UNARY)
- call = multicallable(_REQUEST, timeout=0.5 * _SLEEP_TIME_UNIT_S)
-
- with self.assertRaises(aio.AioRpcError) as exception_context:
- await call
-
- rpc_error = exception_context.exception
- self.assertEqual(grpc.StatusCode.DEADLINE_EXCEEDED, rpc_error.code())
-
- async def test_unary_stream_success_with_timeout(self):
- multicallable = self._client.unary_stream(_TEST_SLEEPY_UNARY_STREAM)
- call = multicallable(_REQUEST, timeout=2 * _SLEEP_TIME_UNIT_S)
- self.assertEqual(_RESPONSE, await call.read())
- self.assertEqual(_RESPONSE, await call.read())
- self.assertEqual(grpc.StatusCode.OK, await call.code())
-
- async def test_unary_stream_deadline_exceeded(self):
- multicallable = self._client.unary_stream(_TEST_SLEEPY_UNARY_STREAM)
- call = multicallable(_REQUEST, timeout=0.5 * _SLEEP_TIME_UNIT_S)
- self.assertEqual(_RESPONSE, await call.read())
-
- with self.assertRaises(aio.AioRpcError) as exception_context:
- await call.read()
-
- rpc_error = exception_context.exception
- self.assertEqual(grpc.StatusCode.DEADLINE_EXCEEDED, rpc_error.code())
-
- async def test_stream_unary_success_with_timeout(self):
- multicallable = self._client.stream_unary(_TEST_SLEEPY_STREAM_UNARY)
- call = multicallable(timeout=2 * _SLEEP_TIME_UNIT_S)
- await call.write(_REQUEST)
- await call.write(_REQUEST)
- self.assertEqual(grpc.StatusCode.OK, await call.code())
-
- async def test_stream_unary_deadline_exceeded(self):
- multicallable = self._client.stream_unary(_TEST_SLEEPY_STREAM_UNARY)
- call = multicallable(timeout=0.5 * _SLEEP_TIME_UNIT_S)
-
- with self.assertRaises(aio.AioRpcError) as exception_context:
- await call.write(_REQUEST)
- await call.write(_REQUEST)
- await call
-
- rpc_error = exception_context.exception
- self.assertEqual(grpc.StatusCode.DEADLINE_EXCEEDED, rpc_error.code())
-
- async def test_stream_stream_success_with_timeout(self):
- multicallable = self._client.stream_stream(_TEST_SLEEPY_STREAM_STREAM)
- call = multicallable(timeout=2 * _SLEEP_TIME_UNIT_S)
- await call.write(_REQUEST)
- self.assertEqual(_RESPONSE, await call.read())
- self.assertEqual(grpc.StatusCode.OK, await call.code())
-
- async def test_stream_stream_deadline_exceeded(self):
- multicallable = self._client.stream_stream(_TEST_SLEEPY_STREAM_STREAM)
- call = multicallable(timeout=0.5 * _SLEEP_TIME_UNIT_S)
-
- with self.assertRaises(aio.AioRpcError) as exception_context:
- await call.write(_REQUEST)
- await call.read()
-
- rpc_error = exception_context.exception
- self.assertEqual(grpc.StatusCode.DEADLINE_EXCEEDED, rpc_error.code())
-
-
-if __name__ == '__main__':
- logging.basicConfig(level=logging.DEBUG)
- unittest.main(verbosity=2)
+# Copyright 2020 The gRPC Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+"""Tests behavior of the timeout mechanism on client side."""
+
+import asyncio
+import logging
+import platform
+import random
+import unittest
+import datetime
+
+import grpc
+from grpc.experimental import aio
+
+from tests_aio.unit._test_base import AioTestBase
+from tests_aio.unit import _common
+
+_SLEEP_TIME_UNIT_S = datetime.timedelta(seconds=1).total_seconds()
+
+_TEST_SLEEPY_UNARY_UNARY = '/test/Test/SleepyUnaryUnary'
+_TEST_SLEEPY_UNARY_STREAM = '/test/Test/SleepyUnaryStream'
+_TEST_SLEEPY_STREAM_UNARY = '/test/Test/SleepyStreamUnary'
+_TEST_SLEEPY_STREAM_STREAM = '/test/Test/SleepyStreamStream'
+
+_REQUEST = b'\x00\x00\x00'
+_RESPONSE = b'\x01\x01\x01'
+
+
+async def _test_sleepy_unary_unary(unused_request, unused_context):
+ await asyncio.sleep(_SLEEP_TIME_UNIT_S)
+ return _RESPONSE
+
+
+async def _test_sleepy_unary_stream(unused_request, unused_context):
+ yield _RESPONSE
+ await asyncio.sleep(_SLEEP_TIME_UNIT_S)
+ yield _RESPONSE
+
+
+async def _test_sleepy_stream_unary(unused_request_iterator, context):
+ assert _REQUEST == await context.read()
+ await asyncio.sleep(_SLEEP_TIME_UNIT_S)
+ assert _REQUEST == await context.read()
+ return _RESPONSE
+
+
+async def _test_sleepy_stream_stream(unused_request_iterator, context):
+ assert _REQUEST == await context.read()
+ await asyncio.sleep(_SLEEP_TIME_UNIT_S)
+ await context.write(_RESPONSE)
+
+
+_ROUTING_TABLE = {
+ _TEST_SLEEPY_UNARY_UNARY:
+ grpc.unary_unary_rpc_method_handler(_test_sleepy_unary_unary),
+ _TEST_SLEEPY_UNARY_STREAM:
+ grpc.unary_stream_rpc_method_handler(_test_sleepy_unary_stream),
+ _TEST_SLEEPY_STREAM_UNARY:
+ grpc.stream_unary_rpc_method_handler(_test_sleepy_stream_unary),
+ _TEST_SLEEPY_STREAM_STREAM:
+ grpc.stream_stream_rpc_method_handler(_test_sleepy_stream_stream)
+}
+
+
+class _GenericHandler(grpc.GenericRpcHandler):
+
+ def service(self, handler_call_details):
+ return _ROUTING_TABLE.get(handler_call_details.method)
+
+
+async def _start_test_server():
+ server = aio.server()
+ port = server.add_insecure_port('[::]:0')
+ server.add_generic_rpc_handlers((_GenericHandler(),))
+ await server.start()
+ return f'localhost:{port}', server
+
+
+class TestTimeout(AioTestBase):
+
+ async def setUp(self):
+ address, self._server = await _start_test_server()
+ self._client = aio.insecure_channel(address)
+ self.assertEqual(grpc.ChannelConnectivity.IDLE,
+ self._client.get_state(True))
+ await _common.block_until_certain_state(self._client,
+ grpc.ChannelConnectivity.READY)
+
+ async def tearDown(self):
+ await self._client.close()
+ await self._server.stop(None)
+
+ async def test_unary_unary_success_with_timeout(self):
+ multicallable = self._client.unary_unary(_TEST_SLEEPY_UNARY_UNARY)
+ call = multicallable(_REQUEST, timeout=2 * _SLEEP_TIME_UNIT_S)
+ self.assertEqual(_RESPONSE, await call)
+ self.assertEqual(grpc.StatusCode.OK, await call.code())
+
+ async def test_unary_unary_deadline_exceeded(self):
+ multicallable = self._client.unary_unary(_TEST_SLEEPY_UNARY_UNARY)
+ call = multicallable(_REQUEST, timeout=0.5 * _SLEEP_TIME_UNIT_S)
+
+ with self.assertRaises(aio.AioRpcError) as exception_context:
+ await call
+
+ rpc_error = exception_context.exception
+ self.assertEqual(grpc.StatusCode.DEADLINE_EXCEEDED, rpc_error.code())
+
+ async def test_unary_stream_success_with_timeout(self):
+ multicallable = self._client.unary_stream(_TEST_SLEEPY_UNARY_STREAM)
+ call = multicallable(_REQUEST, timeout=2 * _SLEEP_TIME_UNIT_S)
+ self.assertEqual(_RESPONSE, await call.read())
+ self.assertEqual(_RESPONSE, await call.read())
+ self.assertEqual(grpc.StatusCode.OK, await call.code())
+
+ async def test_unary_stream_deadline_exceeded(self):
+ multicallable = self._client.unary_stream(_TEST_SLEEPY_UNARY_STREAM)
+ call = multicallable(_REQUEST, timeout=0.5 * _SLEEP_TIME_UNIT_S)
+ self.assertEqual(_RESPONSE, await call.read())
+
+ with self.assertRaises(aio.AioRpcError) as exception_context:
+ await call.read()
+
+ rpc_error = exception_context.exception
+ self.assertEqual(grpc.StatusCode.DEADLINE_EXCEEDED, rpc_error.code())
+
+ async def test_stream_unary_success_with_timeout(self):
+ multicallable = self._client.stream_unary(_TEST_SLEEPY_STREAM_UNARY)
+ call = multicallable(timeout=2 * _SLEEP_TIME_UNIT_S)
+ await call.write(_REQUEST)
+ await call.write(_REQUEST)
+ self.assertEqual(grpc.StatusCode.OK, await call.code())
+
+ async def test_stream_unary_deadline_exceeded(self):
+ multicallable = self._client.stream_unary(_TEST_SLEEPY_STREAM_UNARY)
+ call = multicallable(timeout=0.5 * _SLEEP_TIME_UNIT_S)
+
+ with self.assertRaises(aio.AioRpcError) as exception_context:
+ await call.write(_REQUEST)
+ await call.write(_REQUEST)
+ await call
+
+ rpc_error = exception_context.exception
+ self.assertEqual(grpc.StatusCode.DEADLINE_EXCEEDED, rpc_error.code())
+
+ async def test_stream_stream_success_with_timeout(self):
+ multicallable = self._client.stream_stream(_TEST_SLEEPY_STREAM_STREAM)
+ call = multicallable(timeout=2 * _SLEEP_TIME_UNIT_S)
+ await call.write(_REQUEST)
+ self.assertEqual(_RESPONSE, await call.read())
+ self.assertEqual(grpc.StatusCode.OK, await call.code())
+
+ async def test_stream_stream_deadline_exceeded(self):
+ multicallable = self._client.stream_stream(_TEST_SLEEPY_STREAM_STREAM)
+ call = multicallable(timeout=0.5 * _SLEEP_TIME_UNIT_S)
+
+ with self.assertRaises(aio.AioRpcError) as exception_context:
+ await call.write(_REQUEST)
+ await call.read()
+
+ rpc_error = exception_context.exception
+ self.assertEqual(grpc.StatusCode.DEADLINE_EXCEEDED, rpc_error.code())
+
+
+if __name__ == '__main__':
+ logging.basicConfig(level=logging.DEBUG)
+ unittest.main(verbosity=2)
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/wait_for_connection_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/wait_for_connection_test.py
index 5d572b4d8a4..cb6f7985290 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/wait_for_connection_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/wait_for_connection_test.py
@@ -1,159 +1,159 @@
-# Copyright 2020 The gRPC Authors
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-"""Tests behavior of the wait for connection API on client side."""
-
-import asyncio
-import logging
-import unittest
-import datetime
-from typing import Callable, Tuple
-
-import grpc
-from grpc.experimental import aio
-
-from tests_aio.unit._test_base import AioTestBase
-from tests_aio.unit._test_server import start_test_server
-from tests_aio.unit import _common
-from src.proto.grpc.testing import messages_pb2, test_pb2_grpc
-from tests_aio.unit._constants import UNREACHABLE_TARGET
-
-_REQUEST = b'\x01\x02\x03'
-_TEST_METHOD = '/test/Test'
-
-_NUM_STREAM_RESPONSES = 5
-_REQUEST_PAYLOAD_SIZE = 7
-_RESPONSE_PAYLOAD_SIZE = 42
-
-
-class TestWaitForConnection(AioTestBase):
- """Tests if wait_for_connection raises connectivity issue."""
-
- async def setUp(self):
- address, self._server = await start_test_server()
- self._channel = aio.insecure_channel(address)
- self._dummy_channel = aio.insecure_channel(UNREACHABLE_TARGET)
- self._stub = test_pb2_grpc.TestServiceStub(self._channel)
-
- async def tearDown(self):
- await self._dummy_channel.close()
- await self._channel.close()
- await self._server.stop(None)
-
- async def test_unary_unary_ok(self):
- call = self._stub.UnaryCall(messages_pb2.SimpleRequest())
-
- # No exception raised and no message swallowed.
- await call.wait_for_connection()
-
- response = await call
- self.assertIsInstance(response, messages_pb2.SimpleResponse)
-
- async def test_unary_stream_ok(self):
- request = messages_pb2.StreamingOutputCallRequest()
- for _ in range(_NUM_STREAM_RESPONSES):
- request.response_parameters.append(
- messages_pb2.ResponseParameters(size=_RESPONSE_PAYLOAD_SIZE))
-
- call = self._stub.StreamingOutputCall(request)
-
- # No exception raised and no message swallowed.
- await call.wait_for_connection()
-
- response_cnt = 0
- async for response in call:
- response_cnt += 1
- self.assertIs(type(response),
- messages_pb2.StreamingOutputCallResponse)
- self.assertEqual(_RESPONSE_PAYLOAD_SIZE, len(response.payload.body))
-
- self.assertEqual(_NUM_STREAM_RESPONSES, response_cnt)
- self.assertEqual(await call.code(), grpc.StatusCode.OK)
-
- async def test_stream_unary_ok(self):
- call = self._stub.StreamingInputCall()
-
- # No exception raised and no message swallowed.
- await call.wait_for_connection()
-
- payload = messages_pb2.Payload(body=b'\0' * _REQUEST_PAYLOAD_SIZE)
- request = messages_pb2.StreamingInputCallRequest(payload=payload)
-
- for _ in range(_NUM_STREAM_RESPONSES):
- await call.write(request)
- await call.done_writing()
-
- response = await call
- self.assertIsInstance(response, messages_pb2.StreamingInputCallResponse)
- self.assertEqual(_NUM_STREAM_RESPONSES * _REQUEST_PAYLOAD_SIZE,
- response.aggregated_payload_size)
-
- self.assertEqual(await call.code(), grpc.StatusCode.OK)
-
- async def test_stream_stream_ok(self):
- call = self._stub.FullDuplexCall()
-
- # No exception raised and no message swallowed.
- await call.wait_for_connection()
-
- request = messages_pb2.StreamingOutputCallRequest()
- request.response_parameters.append(
- messages_pb2.ResponseParameters(size=_RESPONSE_PAYLOAD_SIZE))
-
- for _ in range(_NUM_STREAM_RESPONSES):
- await call.write(request)
- response = await call.read()
- self.assertIsInstance(response,
- messages_pb2.StreamingOutputCallResponse)
- self.assertEqual(_RESPONSE_PAYLOAD_SIZE, len(response.payload.body))
-
- await call.done_writing()
-
- self.assertEqual(grpc.StatusCode.OK, await call.code())
-
- async def test_unary_unary_error(self):
- call = self._dummy_channel.unary_unary(_TEST_METHOD)(_REQUEST)
-
- with self.assertRaises(aio.AioRpcError) as exception_context:
- await call.wait_for_connection()
- rpc_error = exception_context.exception
- self.assertEqual(grpc.StatusCode.UNAVAILABLE, rpc_error.code())
-
- async def test_unary_stream_error(self):
- call = self._dummy_channel.unary_stream(_TEST_METHOD)(_REQUEST)
-
- with self.assertRaises(aio.AioRpcError) as exception_context:
- await call.wait_for_connection()
- rpc_error = exception_context.exception
- self.assertEqual(grpc.StatusCode.UNAVAILABLE, rpc_error.code())
-
- async def test_stream_unary_error(self):
- call = self._dummy_channel.stream_unary(_TEST_METHOD)()
-
- with self.assertRaises(aio.AioRpcError) as exception_context:
- await call.wait_for_connection()
- rpc_error = exception_context.exception
- self.assertEqual(grpc.StatusCode.UNAVAILABLE, rpc_error.code())
-
- async def test_stream_stream_error(self):
- call = self._dummy_channel.stream_stream(_TEST_METHOD)()
-
- with self.assertRaises(aio.AioRpcError) as exception_context:
- await call.wait_for_connection()
- rpc_error = exception_context.exception
- self.assertEqual(grpc.StatusCode.UNAVAILABLE, rpc_error.code())
-
-
-if __name__ == '__main__':
- logging.basicConfig(level=logging.DEBUG)
- unittest.main(verbosity=2)
+# Copyright 2020 The gRPC Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+"""Tests behavior of the wait for connection API on client side."""
+
+import asyncio
+import logging
+import unittest
+import datetime
+from typing import Callable, Tuple
+
+import grpc
+from grpc.experimental import aio
+
+from tests_aio.unit._test_base import AioTestBase
+from tests_aio.unit._test_server import start_test_server
+from tests_aio.unit import _common
+from src.proto.grpc.testing import messages_pb2, test_pb2_grpc
+from tests_aio.unit._constants import UNREACHABLE_TARGET
+
+_REQUEST = b'\x01\x02\x03'
+_TEST_METHOD = '/test/Test'
+
+_NUM_STREAM_RESPONSES = 5
+_REQUEST_PAYLOAD_SIZE = 7
+_RESPONSE_PAYLOAD_SIZE = 42
+
+
+class TestWaitForConnection(AioTestBase):
+ """Tests if wait_for_connection raises connectivity issue."""
+
+ async def setUp(self):
+ address, self._server = await start_test_server()
+ self._channel = aio.insecure_channel(address)
+ self._dummy_channel = aio.insecure_channel(UNREACHABLE_TARGET)
+ self._stub = test_pb2_grpc.TestServiceStub(self._channel)
+
+ async def tearDown(self):
+ await self._dummy_channel.close()
+ await self._channel.close()
+ await self._server.stop(None)
+
+ async def test_unary_unary_ok(self):
+ call = self._stub.UnaryCall(messages_pb2.SimpleRequest())
+
+ # No exception raised and no message swallowed.
+ await call.wait_for_connection()
+
+ response = await call
+ self.assertIsInstance(response, messages_pb2.SimpleResponse)
+
+ async def test_unary_stream_ok(self):
+ request = messages_pb2.StreamingOutputCallRequest()
+ for _ in range(_NUM_STREAM_RESPONSES):
+ request.response_parameters.append(
+ messages_pb2.ResponseParameters(size=_RESPONSE_PAYLOAD_SIZE))
+
+ call = self._stub.StreamingOutputCall(request)
+
+ # No exception raised and no message swallowed.
+ await call.wait_for_connection()
+
+ response_cnt = 0
+ async for response in call:
+ response_cnt += 1
+ self.assertIs(type(response),
+ messages_pb2.StreamingOutputCallResponse)
+ self.assertEqual(_RESPONSE_PAYLOAD_SIZE, len(response.payload.body))
+
+ self.assertEqual(_NUM_STREAM_RESPONSES, response_cnt)
+ self.assertEqual(await call.code(), grpc.StatusCode.OK)
+
+ async def test_stream_unary_ok(self):
+ call = self._stub.StreamingInputCall()
+
+ # No exception raised and no message swallowed.
+ await call.wait_for_connection()
+
+ payload = messages_pb2.Payload(body=b'\0' * _REQUEST_PAYLOAD_SIZE)
+ request = messages_pb2.StreamingInputCallRequest(payload=payload)
+
+ for _ in range(_NUM_STREAM_RESPONSES):
+ await call.write(request)
+ await call.done_writing()
+
+ response = await call
+ self.assertIsInstance(response, messages_pb2.StreamingInputCallResponse)
+ self.assertEqual(_NUM_STREAM_RESPONSES * _REQUEST_PAYLOAD_SIZE,
+ response.aggregated_payload_size)
+
+ self.assertEqual(await call.code(), grpc.StatusCode.OK)
+
+ async def test_stream_stream_ok(self):
+ call = self._stub.FullDuplexCall()
+
+ # No exception raised and no message swallowed.
+ await call.wait_for_connection()
+
+ request = messages_pb2.StreamingOutputCallRequest()
+ request.response_parameters.append(
+ messages_pb2.ResponseParameters(size=_RESPONSE_PAYLOAD_SIZE))
+
+ for _ in range(_NUM_STREAM_RESPONSES):
+ await call.write(request)
+ response = await call.read()
+ self.assertIsInstance(response,
+ messages_pb2.StreamingOutputCallResponse)
+ self.assertEqual(_RESPONSE_PAYLOAD_SIZE, len(response.payload.body))
+
+ await call.done_writing()
+
+ self.assertEqual(grpc.StatusCode.OK, await call.code())
+
+ async def test_unary_unary_error(self):
+ call = self._dummy_channel.unary_unary(_TEST_METHOD)(_REQUEST)
+
+ with self.assertRaises(aio.AioRpcError) as exception_context:
+ await call.wait_for_connection()
+ rpc_error = exception_context.exception
+ self.assertEqual(grpc.StatusCode.UNAVAILABLE, rpc_error.code())
+
+ async def test_unary_stream_error(self):
+ call = self._dummy_channel.unary_stream(_TEST_METHOD)(_REQUEST)
+
+ with self.assertRaises(aio.AioRpcError) as exception_context:
+ await call.wait_for_connection()
+ rpc_error = exception_context.exception
+ self.assertEqual(grpc.StatusCode.UNAVAILABLE, rpc_error.code())
+
+ async def test_stream_unary_error(self):
+ call = self._dummy_channel.stream_unary(_TEST_METHOD)()
+
+ with self.assertRaises(aio.AioRpcError) as exception_context:
+ await call.wait_for_connection()
+ rpc_error = exception_context.exception
+ self.assertEqual(grpc.StatusCode.UNAVAILABLE, rpc_error.code())
+
+ async def test_stream_stream_error(self):
+ call = self._dummy_channel.stream_stream(_TEST_METHOD)()
+
+ with self.assertRaises(aio.AioRpcError) as exception_context:
+ await call.wait_for_connection()
+ rpc_error = exception_context.exception
+ self.assertEqual(grpc.StatusCode.UNAVAILABLE, rpc_error.code())
+
+
+if __name__ == '__main__':
+ logging.basicConfig(level=logging.DEBUG)
+ unittest.main(verbosity=2)
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/wait_for_ready_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/wait_for_ready_test.py
index a4ac5e4bd3b..5bcfd54856b 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/wait_for_ready_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/wait_for_ready_test.py
@@ -1,146 +1,146 @@
-# Copyright 2020 The gRPC Authors
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-"""Testing the done callbacks mechanism."""
-
-import asyncio
-import logging
-import unittest
-import time
-import gc
-
-import grpc
-from grpc.experimental import aio
-from tests_aio.unit._test_base import AioTestBase
-from tests.unit.framework.common import test_constants
-from tests.unit.framework.common import get_socket
-from src.proto.grpc.testing import messages_pb2, test_pb2_grpc
-from tests_aio.unit._test_server import start_test_server
-from tests_aio.unit import _common
-
-_NUM_STREAM_RESPONSES = 5
-_REQUEST_PAYLOAD_SIZE = 7
-_RESPONSE_PAYLOAD_SIZE = 42
-
-
-async def _perform_unary_unary(stub, wait_for_ready):
- await stub.UnaryCall(messages_pb2.SimpleRequest(),
- timeout=test_constants.LONG_TIMEOUT,
- wait_for_ready=wait_for_ready)
-
-
-async def _perform_unary_stream(stub, wait_for_ready):
- request = messages_pb2.StreamingOutputCallRequest()
- for _ in range(_NUM_STREAM_RESPONSES):
- request.response_parameters.append(
- messages_pb2.ResponseParameters(size=_RESPONSE_PAYLOAD_SIZE))
-
- call = stub.StreamingOutputCall(request,
- timeout=test_constants.LONG_TIMEOUT,
- wait_for_ready=wait_for_ready)
-
- for _ in range(_NUM_STREAM_RESPONSES):
- await call.read()
- assert await call.code() == grpc.StatusCode.OK
-
-
-async def _perform_stream_unary(stub, wait_for_ready):
- payload = messages_pb2.Payload(body=b'\0' * _REQUEST_PAYLOAD_SIZE)
- request = messages_pb2.StreamingInputCallRequest(payload=payload)
-
- async def gen():
- for _ in range(_NUM_STREAM_RESPONSES):
- yield request
-
- await stub.StreamingInputCall(gen(),
- timeout=test_constants.LONG_TIMEOUT,
- wait_for_ready=wait_for_ready)
-
-
-async def _perform_stream_stream(stub, wait_for_ready):
- call = stub.FullDuplexCall(timeout=test_constants.LONG_TIMEOUT,
- wait_for_ready=wait_for_ready)
-
- request = messages_pb2.StreamingOutputCallRequest()
- request.response_parameters.append(
- messages_pb2.ResponseParameters(size=_RESPONSE_PAYLOAD_SIZE))
-
- for _ in range(_NUM_STREAM_RESPONSES):
- await call.write(request)
- response = await call.read()
- assert _RESPONSE_PAYLOAD_SIZE == len(response.payload.body)
-
- await call.done_writing()
- assert await call.code() == grpc.StatusCode.OK
-
-
-_RPC_ACTIONS = (
- _perform_unary_unary,
- _perform_unary_stream,
- _perform_stream_unary,
- _perform_stream_stream,
-)
-
-
-class TestWaitForReady(AioTestBase):
-
- async def setUp(self):
- address, self._port, self._socket = get_socket(listen=False)
- self._channel = aio.insecure_channel(f"{address}:{self._port}")
- self._stub = test_pb2_grpc.TestServiceStub(self._channel)
- self._socket.close()
-
- async def tearDown(self):
- await self._channel.close()
-
- async def _connection_fails_fast(self, wait_for_ready):
- for action in _RPC_ACTIONS:
- with self.subTest(name=action):
- with self.assertRaises(aio.AioRpcError) as exception_context:
- await action(self._stub, wait_for_ready)
- rpc_error = exception_context.exception
- self.assertEqual(grpc.StatusCode.UNAVAILABLE, rpc_error.code())
-
- async def test_call_wait_for_ready_default(self):
- """RPC should fail immediately after connection failed."""
- await self._connection_fails_fast(None)
-
- async def test_call_wait_for_ready_disabled(self):
- """RPC should fail immediately after connection failed."""
- await self._connection_fails_fast(False)
-
- async def test_call_wait_for_ready_enabled(self):
- """RPC will wait until the connection is ready."""
- for action in _RPC_ACTIONS:
- with self.subTest(name=action.__name__):
- # Starts the RPC
- action_task = self.loop.create_task(action(self._stub, True))
-
- # Wait for TRANSIENT_FAILURE, and RPC is not aborting
- await _common.block_until_certain_state(
- self._channel, grpc.ChannelConnectivity.TRANSIENT_FAILURE)
-
- try:
- # Start the server
- _, server = await start_test_server(port=self._port)
-
- # The RPC should recover itself
- await action_task
- finally:
- if server is not None:
- await server.stop(None)
-
-
-if __name__ == '__main__':
- logging.basicConfig(level=logging.DEBUG)
- unittest.main(verbosity=2)
+# Copyright 2020 The gRPC Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+"""Testing the done callbacks mechanism."""
+
+import asyncio
+import logging
+import unittest
+import time
+import gc
+
+import grpc
+from grpc.experimental import aio
+from tests_aio.unit._test_base import AioTestBase
+from tests.unit.framework.common import test_constants
+from tests.unit.framework.common import get_socket
+from src.proto.grpc.testing import messages_pb2, test_pb2_grpc
+from tests_aio.unit._test_server import start_test_server
+from tests_aio.unit import _common
+
+_NUM_STREAM_RESPONSES = 5
+_REQUEST_PAYLOAD_SIZE = 7
+_RESPONSE_PAYLOAD_SIZE = 42
+
+
+async def _perform_unary_unary(stub, wait_for_ready):
+ await stub.UnaryCall(messages_pb2.SimpleRequest(),
+ timeout=test_constants.LONG_TIMEOUT,
+ wait_for_ready=wait_for_ready)
+
+
+async def _perform_unary_stream(stub, wait_for_ready):
+ request = messages_pb2.StreamingOutputCallRequest()
+ for _ in range(_NUM_STREAM_RESPONSES):
+ request.response_parameters.append(
+ messages_pb2.ResponseParameters(size=_RESPONSE_PAYLOAD_SIZE))
+
+ call = stub.StreamingOutputCall(request,
+ timeout=test_constants.LONG_TIMEOUT,
+ wait_for_ready=wait_for_ready)
+
+ for _ in range(_NUM_STREAM_RESPONSES):
+ await call.read()
+ assert await call.code() == grpc.StatusCode.OK
+
+
+async def _perform_stream_unary(stub, wait_for_ready):
+ payload = messages_pb2.Payload(body=b'\0' * _REQUEST_PAYLOAD_SIZE)
+ request = messages_pb2.StreamingInputCallRequest(payload=payload)
+
+ async def gen():
+ for _ in range(_NUM_STREAM_RESPONSES):
+ yield request
+
+ await stub.StreamingInputCall(gen(),
+ timeout=test_constants.LONG_TIMEOUT,
+ wait_for_ready=wait_for_ready)
+
+
+async def _perform_stream_stream(stub, wait_for_ready):
+ call = stub.FullDuplexCall(timeout=test_constants.LONG_TIMEOUT,
+ wait_for_ready=wait_for_ready)
+
+ request = messages_pb2.StreamingOutputCallRequest()
+ request.response_parameters.append(
+ messages_pb2.ResponseParameters(size=_RESPONSE_PAYLOAD_SIZE))
+
+ for _ in range(_NUM_STREAM_RESPONSES):
+ await call.write(request)
+ response = await call.read()
+ assert _RESPONSE_PAYLOAD_SIZE == len(response.payload.body)
+
+ await call.done_writing()
+ assert await call.code() == grpc.StatusCode.OK
+
+
+_RPC_ACTIONS = (
+ _perform_unary_unary,
+ _perform_unary_stream,
+ _perform_stream_unary,
+ _perform_stream_stream,
+)
+
+
+class TestWaitForReady(AioTestBase):
+
+ async def setUp(self):
+ address, self._port, self._socket = get_socket(listen=False)
+ self._channel = aio.insecure_channel(f"{address}:{self._port}")
+ self._stub = test_pb2_grpc.TestServiceStub(self._channel)
+ self._socket.close()
+
+ async def tearDown(self):
+ await self._channel.close()
+
+ async def _connection_fails_fast(self, wait_for_ready):
+ for action in _RPC_ACTIONS:
+ with self.subTest(name=action):
+ with self.assertRaises(aio.AioRpcError) as exception_context:
+ await action(self._stub, wait_for_ready)
+ rpc_error = exception_context.exception
+ self.assertEqual(grpc.StatusCode.UNAVAILABLE, rpc_error.code())
+
+ async def test_call_wait_for_ready_default(self):
+ """RPC should fail immediately after connection failed."""
+ await self._connection_fails_fast(None)
+
+ async def test_call_wait_for_ready_disabled(self):
+ """RPC should fail immediately after connection failed."""
+ await self._connection_fails_fast(False)
+
+ async def test_call_wait_for_ready_enabled(self):
+ """RPC will wait until the connection is ready."""
+ for action in _RPC_ACTIONS:
+ with self.subTest(name=action.__name__):
+ # Starts the RPC
+ action_task = self.loop.create_task(action(self._stub, True))
+
+ # Wait for TRANSIENT_FAILURE, and RPC is not aborting
+ await _common.block_until_certain_state(
+ self._channel, grpc.ChannelConnectivity.TRANSIENT_FAILURE)
+
+ try:
+ # Start the server
+ _, server = await start_test_server(port=self._port)
+
+ # The RPC should recover itself
+ await action_task
+ finally:
+ if server is not None:
+ await server.stop(None)
+
+
+if __name__ == '__main__':
+ logging.basicConfig(level=logging.DEBUG)
+ unittest.main(verbosity=2)
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_py3_only/__init__.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_py3_only/__init__.py
index c3423d83e00..6732ae8cbb5 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_py3_only/__init__.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_py3_only/__init__.py
@@ -1,21 +1,21 @@
-# Copyright 2020 The gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-from __future__ import absolute_import
-
-from tests import _loader
-from tests import _runner
-
-Loader = _loader.Loader
-Runner = _runner.Runner
+# Copyright 2020 The gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+from __future__ import absolute_import
+
+from tests import _loader
+from tests import _runner
+
+Loader = _loader.Loader
+Runner = _runner.Runner
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_py3_only/interop/xds_interop_client.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_py3_only/interop/xds_interop_client.py
index 4ebcfa5b21f..21277a98cf2 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_py3_only/interop/xds_interop_client.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_py3_only/interop/xds_interop_client.py
@@ -1,348 +1,348 @@
-# Copyright 2020 The gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-import argparse
-import logging
-import signal
-import threading
-import time
-import sys
-
-from typing import DefaultDict, Dict, List, Mapping, Set, Sequence, Tuple
-import collections
-
-from concurrent import futures
-
-import grpc
-
-from src.proto.grpc.testing import test_pb2
-from src.proto.grpc.testing import test_pb2_grpc
-from src.proto.grpc.testing import messages_pb2
-from src.proto.grpc.testing import empty_pb2
-
-logger = logging.getLogger()
-console_handler = logging.StreamHandler()
-formatter = logging.Formatter(fmt='%(asctime)s: %(levelname)-8s %(message)s')
-console_handler.setFormatter(formatter)
-logger.addHandler(console_handler)
-
-_SUPPORTED_METHODS = (
- "UnaryCall",
- "EmptyCall",
-)
-
-PerMethodMetadataType = Mapping[str, Sequence[Tuple[str, str]]]
-
-
-class _StatsWatcher:
- _start: int
- _end: int
- _rpcs_needed: int
- _rpcs_by_peer: DefaultDict[str, int]
- _rpcs_by_method: DefaultDict[str, DefaultDict[str, int]]
- _no_remote_peer: int
- _lock: threading.Lock
- _condition: threading.Condition
-
- def __init__(self, start: int, end: int):
- self._start = start
- self._end = end
- self._rpcs_needed = end - start
- self._rpcs_by_peer = collections.defaultdict(int)
- self._rpcs_by_method = collections.defaultdict(
- lambda: collections.defaultdict(int))
- self._condition = threading.Condition()
- self._no_remote_peer = 0
-
- def on_rpc_complete(self, request_id: int, peer: str, method: str) -> None:
- """Records statistics for a single RPC."""
- if self._start <= request_id < self._end:
- with self._condition:
- if not peer:
- self._no_remote_peer += 1
- else:
- self._rpcs_by_peer[peer] += 1
- self._rpcs_by_method[method][peer] += 1
- self._rpcs_needed -= 1
- self._condition.notify()
-
- def await_rpc_stats_response(self, timeout_sec: int
- ) -> messages_pb2.LoadBalancerStatsResponse:
- """Blocks until a full response has been collected."""
- with self._condition:
- self._condition.wait_for(lambda: not self._rpcs_needed,
- timeout=float(timeout_sec))
- response = messages_pb2.LoadBalancerStatsResponse()
- for peer, count in self._rpcs_by_peer.items():
- response.rpcs_by_peer[peer] = count
- for method, count_by_peer in self._rpcs_by_method.items():
- for peer, count in count_by_peer.items():
- response.rpcs_by_method[method].rpcs_by_peer[peer] = count
- response.num_failures = self._no_remote_peer + self._rpcs_needed
- return response
-
-
-_global_lock = threading.Lock()
-_stop_event = threading.Event()
-_global_rpc_id: int = 0
-_watchers: Set[_StatsWatcher] = set()
-_global_server = None
-
-
-def _handle_sigint(sig, frame):
- _stop_event.set()
- _global_server.stop(None)
-
-
-class _LoadBalancerStatsServicer(test_pb2_grpc.LoadBalancerStatsServiceServicer
- ):
-
- def __init__(self):
- super(_LoadBalancerStatsServicer).__init__()
-
- def GetClientStats(self, request: messages_pb2.LoadBalancerStatsRequest,
- context: grpc.ServicerContext
- ) -> messages_pb2.LoadBalancerStatsResponse:
- logger.info("Received stats request.")
- start = None
- end = None
- watcher = None
- with _global_lock:
- start = _global_rpc_id + 1
- end = start + request.num_rpcs
- watcher = _StatsWatcher(start, end)
- _watchers.add(watcher)
- response = watcher.await_rpc_stats_response(request.timeout_sec)
- with _global_lock:
- _watchers.remove(watcher)
- logger.info("Returning stats response: {}".format(response))
- return response
-
-
-def _start_rpc(method: str, metadata: Sequence[Tuple[str, str]],
- request_id: int, stub: test_pb2_grpc.TestServiceStub,
- timeout: float,
- futures: Mapping[int, Tuple[grpc.Future, str]]) -> None:
- logger.info(f"Sending {method} request to backend: {request_id}")
- if method == "UnaryCall":
- future = stub.UnaryCall.future(messages_pb2.SimpleRequest(),
- metadata=metadata,
- timeout=timeout)
- elif method == "EmptyCall":
- future = stub.EmptyCall.future(empty_pb2.Empty(),
- metadata=metadata,
- timeout=timeout)
- else:
- raise ValueError(f"Unrecognized method '{method}'.")
- futures[request_id] = (future, method)
-
-
-def _on_rpc_done(rpc_id: int, future: grpc.Future, method: str,
- print_response: bool) -> None:
- exception = future.exception()
- hostname = ""
- if exception is not None:
- if exception.code() == grpc.StatusCode.DEADLINE_EXCEEDED:
- logger.error(f"RPC {rpc_id} timed out")
- else:
- logger.error(exception)
- else:
- response = future.result()
- hostname = None
- for metadatum in future.initial_metadata():
- if metadatum[0] == "hostname":
- hostname = metadatum[1]
- break
- else:
- hostname = response.hostname
- if print_response:
- if future.code() == grpc.StatusCode.OK:
- logger.info("Successful response.")
- else:
- logger.info(f"RPC failed: {call}")
- with _global_lock:
- for watcher in _watchers:
- watcher.on_rpc_complete(rpc_id, hostname, method)
-
-
-def _remove_completed_rpcs(futures: Mapping[int, grpc.Future],
- print_response: bool) -> None:
- logger.debug("Removing completed RPCs")
- done = []
- for future_id, (future, method) in futures.items():
- if future.done():
- _on_rpc_done(future_id, future, method, args.print_response)
- done.append(future_id)
- for rpc_id in done:
- del futures[rpc_id]
-
-
-def _cancel_all_rpcs(futures: Mapping[int, Tuple[grpc.Future, str]]) -> None:
- logger.info("Cancelling all remaining RPCs")
- for future, _ in futures.values():
- future.cancel()
-
-
-def _run_single_channel(method: str, metadata: Sequence[Tuple[str, str]],
- qps: int, server: str, rpc_timeout_sec: int,
- print_response: bool):
- global _global_rpc_id # pylint: disable=global-statement
- duration_per_query = 1.0 / float(qps)
- with grpc.insecure_channel(server) as channel:
- stub = test_pb2_grpc.TestServiceStub(channel)
- futures: Dict[int, Tuple[grpc.Future, str]] = {}
- while not _stop_event.is_set():
- request_id = None
- with _global_lock:
- request_id = _global_rpc_id
- _global_rpc_id += 1
- start = time.time()
- end = start + duration_per_query
- _start_rpc(method, metadata, request_id, stub,
- float(rpc_timeout_sec), futures)
- _remove_completed_rpcs(futures, print_response)
- logger.debug(f"Currently {len(futures)} in-flight RPCs")
- now = time.time()
- while now < end:
- time.sleep(end - now)
- now = time.time()
- _cancel_all_rpcs(futures)
-
-
-class _MethodHandle:
- """An object grouping together threads driving RPCs for a method."""
-
- _channel_threads: List[threading.Thread]
-
- def __init__(self, method: str, metadata: Sequence[Tuple[str, str]],
- num_channels: int, qps: int, server: str, rpc_timeout_sec: int,
- print_response: bool):
- """Creates and starts a group of threads running the indicated method."""
- self._channel_threads = []
- for i in range(num_channels):
- thread = threading.Thread(target=_run_single_channel,
- args=(
- method,
- metadata,
- qps,
- server,
- rpc_timeout_sec,
- print_response,
- ))
- thread.start()
- self._channel_threads.append(thread)
-
- def stop(self):
- """Joins all threads referenced by the handle."""
- for channel_thread in self._channel_threads:
- channel_thread.join()
-
-
-def _run(args: argparse.Namespace, methods: Sequence[str],
- per_method_metadata: PerMethodMetadataType) -> None:
- logger.info("Starting python xDS Interop Client.")
- global _global_server # pylint: disable=global-statement
- method_handles = []
- for method in methods:
- method_handles.append(
- _MethodHandle(method, per_method_metadata.get(method, []),
- args.num_channels, args.qps, args.server,
- args.rpc_timeout_sec, args.print_response))
- _global_server = grpc.server(futures.ThreadPoolExecutor())
- _global_server.add_insecure_port(f"0.0.0.0:{args.stats_port}")
- test_pb2_grpc.add_LoadBalancerStatsServiceServicer_to_server(
- _LoadBalancerStatsServicer(), _global_server)
- _global_server.start()
- _global_server.wait_for_termination()
- for method_handle in method_handles:
- method_handle.stop()
-
-
-def parse_metadata_arg(metadata_arg: str) -> PerMethodMetadataType:
- metadata = metadata_arg.split(",") if args.metadata else []
- per_method_metadata = collections.defaultdict(list)
- for metadatum in metadata:
- elems = metadatum.split(":")
- if len(elems) != 3:
- raise ValueError(
- f"'{metadatum}' was not in the form 'METHOD:KEY:VALUE'")
- if elems[0] not in _SUPPORTED_METHODS:
- raise ValueError(f"Unrecognized method '{elems[0]}'")
- per_method_metadata[elems[0]].append((elems[1], elems[2]))
- return per_method_metadata
-
-
-def parse_rpc_arg(rpc_arg: str) -> Sequence[str]:
- methods = rpc_arg.split(",")
- if set(methods) - set(_SUPPORTED_METHODS):
- raise ValueError("--rpc supported methods: {}".format(
- ", ".join(_SUPPORTED_METHODS)))
- return methods
-
-
-if __name__ == "__main__":
- parser = argparse.ArgumentParser(
- description='Run Python XDS interop client.')
- parser.add_argument(
- "--num_channels",
- default=1,
- type=int,
- help="The number of channels from which to send requests.")
- parser.add_argument("--print_response",
- default=False,
- action="store_true",
- help="Write RPC response to STDOUT.")
- parser.add_argument(
- "--qps",
- default=1,
- type=int,
- help="The number of queries to send from each channel per second.")
- parser.add_argument("--rpc_timeout_sec",
- default=30,
- type=int,
- help="The per-RPC timeout in seconds.")
- parser.add_argument("--server",
- default="localhost:50051",
- help="The address of the server.")
- parser.add_argument(
- "--stats_port",
- default=50052,
- type=int,
- help="The port on which to expose the peer distribution stats service.")
- parser.add_argument('--verbose',
- help='verbose log output',
- default=False,
- action='store_true')
- parser.add_argument("--log_file",
- default=None,
- type=str,
- help="A file to log to.")
- rpc_help = "A comma-delimited list of RPC methods to run. Must be one of "
- rpc_help += ", ".join(_SUPPORTED_METHODS)
- rpc_help += "."
- parser.add_argument("--rpc", default="UnaryCall", type=str, help=rpc_help)
- metadata_help = (
- "A comma-delimited list of 3-tuples of the form " +
- "METHOD:KEY:VALUE, e.g. " +
- "EmptyCall:key1:value1,UnaryCall:key2:value2,EmptyCall:k3:v3")
- parser.add_argument("--metadata", default="", type=str, help=metadata_help)
- args = parser.parse_args()
- signal.signal(signal.SIGINT, _handle_sigint)
- if args.verbose:
- logger.setLevel(logging.DEBUG)
- if args.log_file:
- file_handler = logging.FileHandler(args.log_file, mode='a')
- file_handler.setFormatter(formatter)
- logger.addHandler(file_handler)
- _run(args, parse_rpc_arg(args.rpc), parse_metadata_arg(args.metadata))
+# Copyright 2020 The gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import argparse
+import logging
+import signal
+import threading
+import time
+import sys
+
+from typing import DefaultDict, Dict, List, Mapping, Set, Sequence, Tuple
+import collections
+
+from concurrent import futures
+
+import grpc
+
+from src.proto.grpc.testing import test_pb2
+from src.proto.grpc.testing import test_pb2_grpc
+from src.proto.grpc.testing import messages_pb2
+from src.proto.grpc.testing import empty_pb2
+
+logger = logging.getLogger()
+console_handler = logging.StreamHandler()
+formatter = logging.Formatter(fmt='%(asctime)s: %(levelname)-8s %(message)s')
+console_handler.setFormatter(formatter)
+logger.addHandler(console_handler)
+
+_SUPPORTED_METHODS = (
+ "UnaryCall",
+ "EmptyCall",
+)
+
+PerMethodMetadataType = Mapping[str, Sequence[Tuple[str, str]]]
+
+
+class _StatsWatcher:
+ _start: int
+ _end: int
+ _rpcs_needed: int
+ _rpcs_by_peer: DefaultDict[str, int]
+ _rpcs_by_method: DefaultDict[str, DefaultDict[str, int]]
+ _no_remote_peer: int
+ _lock: threading.Lock
+ _condition: threading.Condition
+
+ def __init__(self, start: int, end: int):
+ self._start = start
+ self._end = end
+ self._rpcs_needed = end - start
+ self._rpcs_by_peer = collections.defaultdict(int)
+ self._rpcs_by_method = collections.defaultdict(
+ lambda: collections.defaultdict(int))
+ self._condition = threading.Condition()
+ self._no_remote_peer = 0
+
+ def on_rpc_complete(self, request_id: int, peer: str, method: str) -> None:
+ """Records statistics for a single RPC."""
+ if self._start <= request_id < self._end:
+ with self._condition:
+ if not peer:
+ self._no_remote_peer += 1
+ else:
+ self._rpcs_by_peer[peer] += 1
+ self._rpcs_by_method[method][peer] += 1
+ self._rpcs_needed -= 1
+ self._condition.notify()
+
+ def await_rpc_stats_response(self, timeout_sec: int
+ ) -> messages_pb2.LoadBalancerStatsResponse:
+ """Blocks until a full response has been collected."""
+ with self._condition:
+ self._condition.wait_for(lambda: not self._rpcs_needed,
+ timeout=float(timeout_sec))
+ response = messages_pb2.LoadBalancerStatsResponse()
+ for peer, count in self._rpcs_by_peer.items():
+ response.rpcs_by_peer[peer] = count
+ for method, count_by_peer in self._rpcs_by_method.items():
+ for peer, count in count_by_peer.items():
+ response.rpcs_by_method[method].rpcs_by_peer[peer] = count
+ response.num_failures = self._no_remote_peer + self._rpcs_needed
+ return response
+
+
+_global_lock = threading.Lock()
+_stop_event = threading.Event()
+_global_rpc_id: int = 0
+_watchers: Set[_StatsWatcher] = set()
+_global_server = None
+
+
+def _handle_sigint(sig, frame):
+ _stop_event.set()
+ _global_server.stop(None)
+
+
+class _LoadBalancerStatsServicer(test_pb2_grpc.LoadBalancerStatsServiceServicer
+ ):
+
+ def __init__(self):
+ super(_LoadBalancerStatsServicer).__init__()
+
+ def GetClientStats(self, request: messages_pb2.LoadBalancerStatsRequest,
+ context: grpc.ServicerContext
+ ) -> messages_pb2.LoadBalancerStatsResponse:
+ logger.info("Received stats request.")
+ start = None
+ end = None
+ watcher = None
+ with _global_lock:
+ start = _global_rpc_id + 1
+ end = start + request.num_rpcs
+ watcher = _StatsWatcher(start, end)
+ _watchers.add(watcher)
+ response = watcher.await_rpc_stats_response(request.timeout_sec)
+ with _global_lock:
+ _watchers.remove(watcher)
+ logger.info("Returning stats response: {}".format(response))
+ return response
+
+
+def _start_rpc(method: str, metadata: Sequence[Tuple[str, str]],
+ request_id: int, stub: test_pb2_grpc.TestServiceStub,
+ timeout: float,
+ futures: Mapping[int, Tuple[grpc.Future, str]]) -> None:
+ logger.info(f"Sending {method} request to backend: {request_id}")
+ if method == "UnaryCall":
+ future = stub.UnaryCall.future(messages_pb2.SimpleRequest(),
+ metadata=metadata,
+ timeout=timeout)
+ elif method == "EmptyCall":
+ future = stub.EmptyCall.future(empty_pb2.Empty(),
+ metadata=metadata,
+ timeout=timeout)
+ else:
+ raise ValueError(f"Unrecognized method '{method}'.")
+ futures[request_id] = (future, method)
+
+
+def _on_rpc_done(rpc_id: int, future: grpc.Future, method: str,
+ print_response: bool) -> None:
+ exception = future.exception()
+ hostname = ""
+ if exception is not None:
+ if exception.code() == grpc.StatusCode.DEADLINE_EXCEEDED:
+ logger.error(f"RPC {rpc_id} timed out")
+ else:
+ logger.error(exception)
+ else:
+ response = future.result()
+ hostname = None
+ for metadatum in future.initial_metadata():
+ if metadatum[0] == "hostname":
+ hostname = metadatum[1]
+ break
+ else:
+ hostname = response.hostname
+ if print_response:
+ if future.code() == grpc.StatusCode.OK:
+ logger.info("Successful response.")
+ else:
+ logger.info(f"RPC failed: {call}")
+ with _global_lock:
+ for watcher in _watchers:
+ watcher.on_rpc_complete(rpc_id, hostname, method)
+
+
+def _remove_completed_rpcs(futures: Mapping[int, grpc.Future],
+ print_response: bool) -> None:
+ logger.debug("Removing completed RPCs")
+ done = []
+ for future_id, (future, method) in futures.items():
+ if future.done():
+ _on_rpc_done(future_id, future, method, args.print_response)
+ done.append(future_id)
+ for rpc_id in done:
+ del futures[rpc_id]
+
+
+def _cancel_all_rpcs(futures: Mapping[int, Tuple[grpc.Future, str]]) -> None:
+ logger.info("Cancelling all remaining RPCs")
+ for future, _ in futures.values():
+ future.cancel()
+
+
+def _run_single_channel(method: str, metadata: Sequence[Tuple[str, str]],
+ qps: int, server: str, rpc_timeout_sec: int,
+ print_response: bool):
+ global _global_rpc_id # pylint: disable=global-statement
+ duration_per_query = 1.0 / float(qps)
+ with grpc.insecure_channel(server) as channel:
+ stub = test_pb2_grpc.TestServiceStub(channel)
+ futures: Dict[int, Tuple[grpc.Future, str]] = {}
+ while not _stop_event.is_set():
+ request_id = None
+ with _global_lock:
+ request_id = _global_rpc_id
+ _global_rpc_id += 1
+ start = time.time()
+ end = start + duration_per_query
+ _start_rpc(method, metadata, request_id, stub,
+ float(rpc_timeout_sec), futures)
+ _remove_completed_rpcs(futures, print_response)
+ logger.debug(f"Currently {len(futures)} in-flight RPCs")
+ now = time.time()
+ while now < end:
+ time.sleep(end - now)
+ now = time.time()
+ _cancel_all_rpcs(futures)
+
+
+class _MethodHandle:
+ """An object grouping together threads driving RPCs for a method."""
+
+ _channel_threads: List[threading.Thread]
+
+ def __init__(self, method: str, metadata: Sequence[Tuple[str, str]],
+ num_channels: int, qps: int, server: str, rpc_timeout_sec: int,
+ print_response: bool):
+ """Creates and starts a group of threads running the indicated method."""
+ self._channel_threads = []
+ for i in range(num_channels):
+ thread = threading.Thread(target=_run_single_channel,
+ args=(
+ method,
+ metadata,
+ qps,
+ server,
+ rpc_timeout_sec,
+ print_response,
+ ))
+ thread.start()
+ self._channel_threads.append(thread)
+
+ def stop(self):
+ """Joins all threads referenced by the handle."""
+ for channel_thread in self._channel_threads:
+ channel_thread.join()
+
+
+def _run(args: argparse.Namespace, methods: Sequence[str],
+ per_method_metadata: PerMethodMetadataType) -> None:
+ logger.info("Starting python xDS Interop Client.")
+ global _global_server # pylint: disable=global-statement
+ method_handles = []
+ for method in methods:
+ method_handles.append(
+ _MethodHandle(method, per_method_metadata.get(method, []),
+ args.num_channels, args.qps, args.server,
+ args.rpc_timeout_sec, args.print_response))
+ _global_server = grpc.server(futures.ThreadPoolExecutor())
+ _global_server.add_insecure_port(f"0.0.0.0:{args.stats_port}")
+ test_pb2_grpc.add_LoadBalancerStatsServiceServicer_to_server(
+ _LoadBalancerStatsServicer(), _global_server)
+ _global_server.start()
+ _global_server.wait_for_termination()
+ for method_handle in method_handles:
+ method_handle.stop()
+
+
+def parse_metadata_arg(metadata_arg: str) -> PerMethodMetadataType:
+ metadata = metadata_arg.split(",") if args.metadata else []
+ per_method_metadata = collections.defaultdict(list)
+ for metadatum in metadata:
+ elems = metadatum.split(":")
+ if len(elems) != 3:
+ raise ValueError(
+ f"'{metadatum}' was not in the form 'METHOD:KEY:VALUE'")
+ if elems[0] not in _SUPPORTED_METHODS:
+ raise ValueError(f"Unrecognized method '{elems[0]}'")
+ per_method_metadata[elems[0]].append((elems[1], elems[2]))
+ return per_method_metadata
+
+
+def parse_rpc_arg(rpc_arg: str) -> Sequence[str]:
+ methods = rpc_arg.split(",")
+ if set(methods) - set(_SUPPORTED_METHODS):
+ raise ValueError("--rpc supported methods: {}".format(
+ ", ".join(_SUPPORTED_METHODS)))
+ return methods
+
+
+if __name__ == "__main__":
+ parser = argparse.ArgumentParser(
+ description='Run Python XDS interop client.')
+ parser.add_argument(
+ "--num_channels",
+ default=1,
+ type=int,
+ help="The number of channels from which to send requests.")
+ parser.add_argument("--print_response",
+ default=False,
+ action="store_true",
+ help="Write RPC response to STDOUT.")
+ parser.add_argument(
+ "--qps",
+ default=1,
+ type=int,
+ help="The number of queries to send from each channel per second.")
+ parser.add_argument("--rpc_timeout_sec",
+ default=30,
+ type=int,
+ help="The per-RPC timeout in seconds.")
+ parser.add_argument("--server",
+ default="localhost:50051",
+ help="The address of the server.")
+ parser.add_argument(
+ "--stats_port",
+ default=50052,
+ type=int,
+ help="The port on which to expose the peer distribution stats service.")
+ parser.add_argument('--verbose',
+ help='verbose log output',
+ default=False,
+ action='store_true')
+ parser.add_argument("--log_file",
+ default=None,
+ type=str,
+ help="A file to log to.")
+ rpc_help = "A comma-delimited list of RPC methods to run. Must be one of "
+ rpc_help += ", ".join(_SUPPORTED_METHODS)
+ rpc_help += "."
+ parser.add_argument("--rpc", default="UnaryCall", type=str, help=rpc_help)
+ metadata_help = (
+ "A comma-delimited list of 3-tuples of the form " +
+ "METHOD:KEY:VALUE, e.g. " +
+ "EmptyCall:key1:value1,UnaryCall:key2:value2,EmptyCall:k3:v3")
+ parser.add_argument("--metadata", default="", type=str, help=metadata_help)
+ args = parser.parse_args()
+ signal.signal(signal.SIGINT, _handle_sigint)
+ if args.verbose:
+ logger.setLevel(logging.DEBUG)
+ if args.log_file:
+ file_handler = logging.FileHandler(args.log_file, mode='a')
+ file_handler.setFormatter(formatter)
+ logger.addHandler(file_handler)
+ _run(args, parse_rpc_arg(args.rpc), parse_metadata_arg(args.metadata))
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_py3_only/unit/__init__.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_py3_only/unit/__init__.py
index 690315b5ada..f4b321fc5b2 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_py3_only/unit/__init__.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_py3_only/unit/__init__.py
@@ -1,13 +1,13 @@
-# Copyright 2019 The gRPC Authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
+# Copyright 2019 The gRPC Authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_py3_only/unit/_leak_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_py3_only/unit/_leak_test.py
index 9532aab645f..3b3f12fa1f9 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_py3_only/unit/_leak_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_py3_only/unit/_leak_test.py
@@ -1,98 +1,98 @@
-# Copyright 2020 The gRPC Authors
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-"""A smoke test for memory leaks on short-lived channels without close.
-
-This test doesn't guarantee all resources are cleaned if `Channel.close` is not
-explicitly invoked. The recommended way of using Channel object is using `with`
-clause, and let context manager automatically close the channel.
-"""
-
-import logging
-import os
-import resource
-import sys
-import unittest
-from concurrent.futures import ThreadPoolExecutor
-
-import grpc
-
-_TEST_METHOD = '/test/Test'
-_REQUEST = b'\x23\x33'
-_LARGE_NUM_OF_ITERATIONS = 5000
-
-# If MAX_RSS inflated more than this size, the test is failed.
-_FAIL_THRESHOLD = 25 * 1024 * 1024 # 25 MiB
-
-
-def _get_max_rss():
- return resource.getrusage(resource.RUSAGE_SELF).ru_maxrss
-
-
-def _pretty_print_bytes(x):
- if x > 1024 * 1024 * 1024:
- return "%.2f GiB" % (x / 1024.0 / 1024 / 1024)
- elif x > 1024 * 1024:
- return "%.2f MiB" % (x / 1024.0 / 1024)
- elif x > 1024:
- return "%.2f KiB" % (x / 1024.0)
- else:
- return "%d B" % x
-
-
-class _GenericHandler(grpc.GenericRpcHandler):
-
- def service(self, handler_call_details):
- if handler_call_details.method == _TEST_METHOD:
- return grpc.unary_unary_rpc_method_handler(lambda x, _: x)
-
-
-def _start_a_test_server():
- server = grpc.server(ThreadPoolExecutor(max_workers=1),
- options=(('grpc.so_reuseport', 0),))
- server.add_generic_rpc_handlers((_GenericHandler(),))
- port = server.add_insecure_port('localhost:0')
- server.start()
- return 'localhost:%d' % port, server
-
-
-def _perform_an_rpc(address):
- channel = grpc.insecure_channel(address)
- multicallable = channel.unary_unary(_TEST_METHOD)
- response = multicallable(_REQUEST)
- assert _REQUEST == response
-
-
-class TestLeak(unittest.TestCase):
-
- def test_leak_with_single_shot_rpcs(self):
- address, server = _start_a_test_server()
-
- # Records memory before experiment.
- before = _get_max_rss()
-
- # Amplifies the leak.
- for n in range(_LARGE_NUM_OF_ITERATIONS):
- _perform_an_rpc(address)
-
- # Fails the test if memory leak detected.
- diff = _get_max_rss() - before
- if diff > _FAIL_THRESHOLD:
- self.fail("Max RSS inflated {} > {}".format(
- _pretty_print_bytes(diff),
- _pretty_print_bytes(_FAIL_THRESHOLD)))
-
-
-if __name__ == "__main__":
- logging.basicConfig(level=logging.DEBUG)
- unittest.main(verbosity=2)
+# Copyright 2020 The gRPC Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+"""A smoke test for memory leaks on short-lived channels without close.
+
+This test doesn't guarantee all resources are cleaned if `Channel.close` is not
+explicitly invoked. The recommended way of using Channel object is using `with`
+clause, and let context manager automatically close the channel.
+"""
+
+import logging
+import os
+import resource
+import sys
+import unittest
+from concurrent.futures import ThreadPoolExecutor
+
+import grpc
+
+_TEST_METHOD = '/test/Test'
+_REQUEST = b'\x23\x33'
+_LARGE_NUM_OF_ITERATIONS = 5000
+
+# If MAX_RSS inflated more than this size, the test is failed.
+_FAIL_THRESHOLD = 25 * 1024 * 1024 # 25 MiB
+
+
+def _get_max_rss():
+ return resource.getrusage(resource.RUSAGE_SELF).ru_maxrss
+
+
+def _pretty_print_bytes(x):
+ if x > 1024 * 1024 * 1024:
+ return "%.2f GiB" % (x / 1024.0 / 1024 / 1024)
+ elif x > 1024 * 1024:
+ return "%.2f MiB" % (x / 1024.0 / 1024)
+ elif x > 1024:
+ return "%.2f KiB" % (x / 1024.0)
+ else:
+ return "%d B" % x
+
+
+class _GenericHandler(grpc.GenericRpcHandler):
+
+ def service(self, handler_call_details):
+ if handler_call_details.method == _TEST_METHOD:
+ return grpc.unary_unary_rpc_method_handler(lambda x, _: x)
+
+
+def _start_a_test_server():
+ server = grpc.server(ThreadPoolExecutor(max_workers=1),
+ options=(('grpc.so_reuseport', 0),))
+ server.add_generic_rpc_handlers((_GenericHandler(),))
+ port = server.add_insecure_port('localhost:0')
+ server.start()
+ return 'localhost:%d' % port, server
+
+
+def _perform_an_rpc(address):
+ channel = grpc.insecure_channel(address)
+ multicallable = channel.unary_unary(_TEST_METHOD)
+ response = multicallable(_REQUEST)
+ assert _REQUEST == response
+
+
+class TestLeak(unittest.TestCase):
+
+ def test_leak_with_single_shot_rpcs(self):
+ address, server = _start_a_test_server()
+
+ # Records memory before experiment.
+ before = _get_max_rss()
+
+ # Amplifies the leak.
+ for n in range(_LARGE_NUM_OF_ITERATIONS):
+ _perform_an_rpc(address)
+
+ # Fails the test if memory leak detected.
+ diff = _get_max_rss() - before
+ if diff > _FAIL_THRESHOLD:
+ self.fail("Max RSS inflated {} > {}".format(
+ _pretty_print_bytes(diff),
+ _pretty_print_bytes(_FAIL_THRESHOLD)))
+
+
+if __name__ == "__main__":
+ logging.basicConfig(level=logging.DEBUG)
+ unittest.main(verbosity=2)
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_py3_only/unit/_simple_stubs_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_py3_only/unit/_simple_stubs_test.py
index c891e6a01e2..08d5a882eb9 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_py3_only/unit/_simple_stubs_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_py3_only/unit/_simple_stubs_test.py
@@ -1,415 +1,415 @@
-# Copyright 2020 The gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-"""Tests for Simple Stubs."""
-
-# TODO(https://github.com/grpc/grpc/issues/21965): Run under setuptools.
-
-import os
-
-_MAXIMUM_CHANNELS = 10
-
-_DEFAULT_TIMEOUT = 1.0
-
-os.environ["GRPC_PYTHON_MANAGED_CHANNEL_EVICTION_SECONDS"] = "2"
-os.environ["GRPC_PYTHON_MANAGED_CHANNEL_MAXIMUM"] = str(_MAXIMUM_CHANNELS)
-os.environ["GRPC_PYTHON_DEFAULT_TIMEOUT_SECONDS"] = str(_DEFAULT_TIMEOUT)
-
-import contextlib
-import datetime
-import inspect
-import logging
-import threading
-import unittest
-import sys
-import time
-from typing import Callable, Optional
-
-from tests.unit import test_common
-from tests.unit.framework.common import get_socket
-from tests.unit import resources
-import grpc
-import grpc.experimental
-
-_REQUEST = b"0000"
-
-_CACHE_EPOCHS = 8
-_CACHE_TRIALS = 6
-
-_SERVER_RESPONSE_COUNT = 10
-_CLIENT_REQUEST_COUNT = _SERVER_RESPONSE_COUNT
-
-_STRESS_EPOCHS = _MAXIMUM_CHANNELS * 10
-
-_UNARY_UNARY = "/test/UnaryUnary"
-_UNARY_STREAM = "/test/UnaryStream"
-_STREAM_UNARY = "/test/StreamUnary"
-_STREAM_STREAM = "/test/StreamStream"
-_BLACK_HOLE = "/test/BlackHole"
-
-
-def _env(key: str, value: str):
- os.environ[key] = value
- yield
- del os.environ[key]
-
-
-def _unary_unary_handler(request, context):
- return request
-
-
-def _unary_stream_handler(request, context):
- for _ in range(_SERVER_RESPONSE_COUNT):
- yield request
-
-
-def _stream_unary_handler(request_iterator, context):
- request = None
- for single_request in request_iterator:
- request = single_request
- return request
-
-
-def _stream_stream_handler(request_iterator, context):
- for request in request_iterator:
- yield request
-
-
-def _black_hole_handler(request, context):
- event = threading.Event()
-
- def _on_done():
- event.set()
-
- context.add_callback(_on_done)
- while not event.is_set():
- time.sleep(0.1)
-
-
-class _GenericHandler(grpc.GenericRpcHandler):
-
- def service(self, handler_call_details):
- if handler_call_details.method == _UNARY_UNARY:
- return grpc.unary_unary_rpc_method_handler(_unary_unary_handler)
- elif handler_call_details.method == _UNARY_STREAM:
- return grpc.unary_stream_rpc_method_handler(_unary_stream_handler)
- elif handler_call_details.method == _STREAM_UNARY:
- return grpc.stream_unary_rpc_method_handler(_stream_unary_handler)
- elif handler_call_details.method == _STREAM_STREAM:
- return grpc.stream_stream_rpc_method_handler(_stream_stream_handler)
- elif handler_call_details.method == _BLACK_HOLE:
- return grpc.unary_unary_rpc_method_handler(_black_hole_handler)
- else:
- raise NotImplementedError()
-
-
-def _time_invocation(to_time: Callable[[], None]) -> datetime.timedelta:
- start = datetime.datetime.now()
- to_time()
- return datetime.datetime.now() - start
-
-
-def _server(credentials: Optional[grpc.ServerCredentials]):
- try:
- server = test_common.test_server()
- target = '[::]:0'
- if credentials is None:
- port = server.add_insecure_port(target)
- else:
- port = server.add_secure_port(target, credentials)
- server.add_generic_rpc_handlers((_GenericHandler(),))
- server.start()
- yield port
- finally:
- server.stop(None)
-
-
-class SimpleStubsTest(unittest.TestCase):
-
- def assert_cached(self, to_check: Callable[[str], None]) -> None:
- """Asserts that a function caches intermediate data/state.
-
- To be specific, given a function whose caching behavior is
- deterministic in the value of a supplied string, this function asserts
- that, on average, subsequent invocations of the function for a specific
- string are faster than first invocations with that same string.
-
- Args:
- to_check: A function returning nothing, that caches values based on
- an arbitrary supplied string.
- """
- initial_runs = []
- cached_runs = []
- for epoch in range(_CACHE_EPOCHS):
- runs = []
- text = str(epoch)
- for trial in range(_CACHE_TRIALS):
- runs.append(_time_invocation(lambda: to_check(text)))
- initial_runs.append(runs[0])
- cached_runs.extend(runs[1:])
- average_cold = sum((run for run in initial_runs),
- datetime.timedelta()) / len(initial_runs)
- average_warm = sum((run for run in cached_runs),
- datetime.timedelta()) / len(cached_runs)
- self.assertLess(average_warm, average_cold)
-
- def assert_eventually(self,
- predicate: Callable[[], bool],
- *,
- timeout: Optional[datetime.timedelta] = None,
- message: Optional[Callable[[], str]] = None) -> None:
- message = message or (lambda: "Proposition did not evaluate to true")
- timeout = timeout or datetime.timedelta(seconds=10)
- end = datetime.datetime.now() + timeout
- while datetime.datetime.now() < end:
- if predicate():
- break
- time.sleep(0.5)
- else:
- self.fail(message() + " after " + str(timeout))
-
- def test_unary_unary_insecure(self):
- with _server(None) as port:
- target = f'localhost:{port}'
- response = grpc.experimental.unary_unary(
- _REQUEST,
- target,
- _UNARY_UNARY,
- channel_credentials=grpc.experimental.
- insecure_channel_credentials(),
- timeout=None)
- self.assertEqual(_REQUEST, response)
-
- def test_unary_unary_secure(self):
- with _server(grpc.local_server_credentials()) as port:
- target = f'localhost:{port}'
- response = grpc.experimental.unary_unary(
- _REQUEST,
- target,
- _UNARY_UNARY,
- channel_credentials=grpc.local_channel_credentials(),
- timeout=None)
- self.assertEqual(_REQUEST, response)
-
- def test_channels_cached(self):
- with _server(grpc.local_server_credentials()) as port:
- target = f'localhost:{port}'
- test_name = inspect.stack()[0][3]
- args = (_REQUEST, target, _UNARY_UNARY)
- kwargs = {"channel_credentials": grpc.local_channel_credentials()}
-
- def _invoke(seed: str):
- run_kwargs = dict(kwargs)
- run_kwargs["options"] = ((test_name + seed, ""),)
- grpc.experimental.unary_unary(*args, **run_kwargs)
-
- self.assert_cached(_invoke)
-
- def test_channels_evicted(self):
- with _server(grpc.local_server_credentials()) as port:
- target = f'localhost:{port}'
- response = grpc.experimental.unary_unary(
- _REQUEST,
- target,
- _UNARY_UNARY,
- channel_credentials=grpc.local_channel_credentials())
- self.assert_eventually(
- lambda: grpc._simple_stubs.ChannelCache.get(
- )._test_only_channel_count() == 0,
- message=lambda:
- f"{grpc._simple_stubs.ChannelCache.get()._test_only_channel_count()} remain"
- )
-
- def test_total_channels_enforced(self):
- with _server(grpc.local_server_credentials()) as port:
- target = f'localhost:{port}'
- for i in range(_STRESS_EPOCHS):
- # Ensure we get a new channel each time.
- options = (("foo", str(i)),)
- # Send messages at full blast.
- grpc.experimental.unary_unary(
- _REQUEST,
- target,
- _UNARY_UNARY,
- options=options,
- channel_credentials=grpc.local_channel_credentials())
- self.assert_eventually(
- lambda: grpc._simple_stubs.ChannelCache.get(
- )._test_only_channel_count() <= _MAXIMUM_CHANNELS + 1,
- message=lambda:
- f"{grpc._simple_stubs.ChannelCache.get()._test_only_channel_count()} channels remain"
- )
-
- def test_unary_stream(self):
- with _server(grpc.local_server_credentials()) as port:
- target = f'localhost:{port}'
- for response in grpc.experimental.unary_stream(
- _REQUEST,
- target,
- _UNARY_STREAM,
- channel_credentials=grpc.local_channel_credentials()):
- self.assertEqual(_REQUEST, response)
-
- def test_stream_unary(self):
-
- def request_iter():
- for _ in range(_CLIENT_REQUEST_COUNT):
- yield _REQUEST
-
- with _server(grpc.local_server_credentials()) as port:
- target = f'localhost:{port}'
- response = grpc.experimental.stream_unary(
- request_iter(),
- target,
- _STREAM_UNARY,
- channel_credentials=grpc.local_channel_credentials())
- self.assertEqual(_REQUEST, response)
-
- def test_stream_stream(self):
-
- def request_iter():
- for _ in range(_CLIENT_REQUEST_COUNT):
- yield _REQUEST
-
- with _server(grpc.local_server_credentials()) as port:
- target = f'localhost:{port}'
- for response in grpc.experimental.stream_stream(
- request_iter(),
- target,
- _STREAM_STREAM,
- channel_credentials=grpc.local_channel_credentials()):
- self.assertEqual(_REQUEST, response)
-
- def test_default_ssl(self):
- _private_key = resources.private_key()
- _certificate_chain = resources.certificate_chain()
- _server_certs = ((_private_key, _certificate_chain),)
- _server_host_override = 'foo.test.google.fr'
- _test_root_certificates = resources.test_root_certificates()
- _property_options = ((
- 'grpc.ssl_target_name_override',
- _server_host_override,
- ),)
- cert_dir = os.path.join(os.path.dirname(resources.__file__),
- "credentials")
- cert_file = os.path.join(cert_dir, "ca.pem")
- with _env("GRPC_DEFAULT_SSL_ROOTS_FILE_PATH", cert_file):
- server_creds = grpc.ssl_server_credentials(_server_certs)
- with _server(server_creds) as port:
- target = f'localhost:{port}'
- response = grpc.experimental.unary_unary(
- _REQUEST, target, _UNARY_UNARY, options=_property_options)
-
- def test_insecure_sugar(self):
- with _server(None) as port:
- target = f'localhost:{port}'
- response = grpc.experimental.unary_unary(_REQUEST,
- target,
- _UNARY_UNARY,
- insecure=True)
- self.assertEqual(_REQUEST, response)
-
- def test_insecure_sugar_mutually_exclusive(self):
- with _server(None) as port:
- target = f'localhost:{port}'
- with self.assertRaises(ValueError):
- response = grpc.experimental.unary_unary(
- _REQUEST,
- target,
- _UNARY_UNARY,
- insecure=True,
- channel_credentials=grpc.local_channel_credentials())
-
- def test_default_wait_for_ready(self):
- addr, port, sock = get_socket()
- sock.close()
- target = f'{addr}:{port}'
- channel = grpc._simple_stubs.ChannelCache.get().get_channel(
- target, (), None, True, None)
- rpc_finished_event = threading.Event()
- rpc_failed_event = threading.Event()
- server = None
-
- def _on_connectivity_changed(connectivity):
- nonlocal server
- if connectivity is grpc.ChannelConnectivity.TRANSIENT_FAILURE:
- self.assertFalse(rpc_finished_event.is_set())
- self.assertFalse(rpc_failed_event.is_set())
- server = test_common.test_server()
- server.add_insecure_port(target)
- server.add_generic_rpc_handlers((_GenericHandler(),))
- server.start()
- channel.unsubscribe(_on_connectivity_changed)
- elif connectivity in (grpc.ChannelConnectivity.IDLE,
- grpc.ChannelConnectivity.CONNECTING):
- pass
- else:
- self.fail("Encountered unknown state.")
-
- channel.subscribe(_on_connectivity_changed)
-
- def _send_rpc():
- try:
- response = grpc.experimental.unary_unary(_REQUEST,
- target,
- _UNARY_UNARY,
- timeout=None,
- insecure=True)
- rpc_finished_event.set()
- except Exception as e:
- rpc_failed_event.set()
-
- t = threading.Thread(target=_send_rpc)
- t.start()
- t.join()
- self.assertFalse(rpc_failed_event.is_set())
- self.assertTrue(rpc_finished_event.is_set())
- if server is not None:
- server.stop(None)
-
- def assert_times_out(self, invocation_args):
- with _server(None) as port:
- target = f'localhost:{port}'
- with self.assertRaises(grpc.RpcError) as cm:
- response = grpc.experimental.unary_unary(_REQUEST,
- target,
- _BLACK_HOLE,
- insecure=True,
- **invocation_args)
- self.assertEqual(grpc.StatusCode.DEADLINE_EXCEEDED,
- cm.exception.code())
-
- def test_default_timeout(self):
- not_present = object()
- wait_for_ready_values = [True, not_present]
- timeout_values = [0.5, not_present]
- cases = []
- for wait_for_ready in wait_for_ready_values:
- for timeout in timeout_values:
- case = {}
- if timeout is not not_present:
- case["timeout"] = timeout
- if wait_for_ready is not not_present:
- case["wait_for_ready"] = wait_for_ready
- cases.append(case)
-
- for case in cases:
- with self.subTest(**case):
- self.assert_times_out(case)
-
-
-if __name__ == "__main__":
- logging.basicConfig(level=logging.INFO)
- unittest.main(verbosity=2)
+# Copyright 2020 The gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+"""Tests for Simple Stubs."""
+
+# TODO(https://github.com/grpc/grpc/issues/21965): Run under setuptools.
+
+import os
+
+_MAXIMUM_CHANNELS = 10
+
+_DEFAULT_TIMEOUT = 1.0
+
+os.environ["GRPC_PYTHON_MANAGED_CHANNEL_EVICTION_SECONDS"] = "2"
+os.environ["GRPC_PYTHON_MANAGED_CHANNEL_MAXIMUM"] = str(_MAXIMUM_CHANNELS)
+os.environ["GRPC_PYTHON_DEFAULT_TIMEOUT_SECONDS"] = str(_DEFAULT_TIMEOUT)
+
+import contextlib
+import datetime
+import inspect
+import logging
+import threading
+import unittest
+import sys
+import time
+from typing import Callable, Optional
+
+from tests.unit import test_common
+from tests.unit.framework.common import get_socket
+from tests.unit import resources
+import grpc
+import grpc.experimental
+
+_REQUEST = b"0000"
+
+_CACHE_EPOCHS = 8
+_CACHE_TRIALS = 6
+
+_SERVER_RESPONSE_COUNT = 10
+_CLIENT_REQUEST_COUNT = _SERVER_RESPONSE_COUNT
+
+_STRESS_EPOCHS = _MAXIMUM_CHANNELS * 10
+
+_UNARY_UNARY = "/test/UnaryUnary"
+_UNARY_STREAM = "/test/UnaryStream"
+_STREAM_UNARY = "/test/StreamUnary"
+_STREAM_STREAM = "/test/StreamStream"
+_BLACK_HOLE = "/test/BlackHole"
+
+
+def _env(key: str, value: str):
+ os.environ[key] = value
+ yield
+ del os.environ[key]
+
+
+def _unary_unary_handler(request, context):
+ return request
+
+
+def _unary_stream_handler(request, context):
+ for _ in range(_SERVER_RESPONSE_COUNT):
+ yield request
+
+
+def _stream_unary_handler(request_iterator, context):
+ request = None
+ for single_request in request_iterator:
+ request = single_request
+ return request
+
+
+def _stream_stream_handler(request_iterator, context):
+ for request in request_iterator:
+ yield request
+
+
+def _black_hole_handler(request, context):
+ event = threading.Event()
+
+ def _on_done():
+ event.set()
+
+ context.add_callback(_on_done)
+ while not event.is_set():
+ time.sleep(0.1)
+
+
+class _GenericHandler(grpc.GenericRpcHandler):
+
+ def service(self, handler_call_details):
+ if handler_call_details.method == _UNARY_UNARY:
+ return grpc.unary_unary_rpc_method_handler(_unary_unary_handler)
+ elif handler_call_details.method == _UNARY_STREAM:
+ return grpc.unary_stream_rpc_method_handler(_unary_stream_handler)
+ elif handler_call_details.method == _STREAM_UNARY:
+ return grpc.stream_unary_rpc_method_handler(_stream_unary_handler)
+ elif handler_call_details.method == _STREAM_STREAM:
+ return grpc.stream_stream_rpc_method_handler(_stream_stream_handler)
+ elif handler_call_details.method == _BLACK_HOLE:
+ return grpc.unary_unary_rpc_method_handler(_black_hole_handler)
+ else:
+ raise NotImplementedError()
+
+
+def _time_invocation(to_time: Callable[[], None]) -> datetime.timedelta:
+ start = datetime.datetime.now()
+ to_time()
+ return datetime.datetime.now() - start
+
+
+def _server(credentials: Optional[grpc.ServerCredentials]):
+ try:
+ server = test_common.test_server()
+ target = '[::]:0'
+ if credentials is None:
+ port = server.add_insecure_port(target)
+ else:
+ port = server.add_secure_port(target, credentials)
+ server.add_generic_rpc_handlers((_GenericHandler(),))
+ server.start()
+ yield port
+ finally:
+ server.stop(None)
+
+
+class SimpleStubsTest(unittest.TestCase):
+
+ def assert_cached(self, to_check: Callable[[str], None]) -> None:
+ """Asserts that a function caches intermediate data/state.
+
+ To be specific, given a function whose caching behavior is
+ deterministic in the value of a supplied string, this function asserts
+ that, on average, subsequent invocations of the function for a specific
+ string are faster than first invocations with that same string.
+
+ Args:
+ to_check: A function returning nothing, that caches values based on
+ an arbitrary supplied string.
+ """
+ initial_runs = []
+ cached_runs = []
+ for epoch in range(_CACHE_EPOCHS):
+ runs = []
+ text = str(epoch)
+ for trial in range(_CACHE_TRIALS):
+ runs.append(_time_invocation(lambda: to_check(text)))
+ initial_runs.append(runs[0])
+ cached_runs.extend(runs[1:])
+ average_cold = sum((run for run in initial_runs),
+ datetime.timedelta()) / len(initial_runs)
+ average_warm = sum((run for run in cached_runs),
+ datetime.timedelta()) / len(cached_runs)
+ self.assertLess(average_warm, average_cold)
+
+ def assert_eventually(self,
+ predicate: Callable[[], bool],
+ *,
+ timeout: Optional[datetime.timedelta] = None,
+ message: Optional[Callable[[], str]] = None) -> None:
+ message = message or (lambda: "Proposition did not evaluate to true")
+ timeout = timeout or datetime.timedelta(seconds=10)
+ end = datetime.datetime.now() + timeout
+ while datetime.datetime.now() < end:
+ if predicate():
+ break
+ time.sleep(0.5)
+ else:
+ self.fail(message() + " after " + str(timeout))
+
+ def test_unary_unary_insecure(self):
+ with _server(None) as port:
+ target = f'localhost:{port}'
+ response = grpc.experimental.unary_unary(
+ _REQUEST,
+ target,
+ _UNARY_UNARY,
+ channel_credentials=grpc.experimental.
+ insecure_channel_credentials(),
+ timeout=None)
+ self.assertEqual(_REQUEST, response)
+
+ def test_unary_unary_secure(self):
+ with _server(grpc.local_server_credentials()) as port:
+ target = f'localhost:{port}'
+ response = grpc.experimental.unary_unary(
+ _REQUEST,
+ target,
+ _UNARY_UNARY,
+ channel_credentials=grpc.local_channel_credentials(),
+ timeout=None)
+ self.assertEqual(_REQUEST, response)
+
+ def test_channels_cached(self):
+ with _server(grpc.local_server_credentials()) as port:
+ target = f'localhost:{port}'
+ test_name = inspect.stack()[0][3]
+ args = (_REQUEST, target, _UNARY_UNARY)
+ kwargs = {"channel_credentials": grpc.local_channel_credentials()}
+
+ def _invoke(seed: str):
+ run_kwargs = dict(kwargs)
+ run_kwargs["options"] = ((test_name + seed, ""),)
+ grpc.experimental.unary_unary(*args, **run_kwargs)
+
+ self.assert_cached(_invoke)
+
+ def test_channels_evicted(self):
+ with _server(grpc.local_server_credentials()) as port:
+ target = f'localhost:{port}'
+ response = grpc.experimental.unary_unary(
+ _REQUEST,
+ target,
+ _UNARY_UNARY,
+ channel_credentials=grpc.local_channel_credentials())
+ self.assert_eventually(
+ lambda: grpc._simple_stubs.ChannelCache.get(
+ )._test_only_channel_count() == 0,
+ message=lambda:
+ f"{grpc._simple_stubs.ChannelCache.get()._test_only_channel_count()} remain"
+ )
+
+ def test_total_channels_enforced(self):
+ with _server(grpc.local_server_credentials()) as port:
+ target = f'localhost:{port}'
+ for i in range(_STRESS_EPOCHS):
+ # Ensure we get a new channel each time.
+ options = (("foo", str(i)),)
+ # Send messages at full blast.
+ grpc.experimental.unary_unary(
+ _REQUEST,
+ target,
+ _UNARY_UNARY,
+ options=options,
+ channel_credentials=grpc.local_channel_credentials())
+ self.assert_eventually(
+ lambda: grpc._simple_stubs.ChannelCache.get(
+ )._test_only_channel_count() <= _MAXIMUM_CHANNELS + 1,
+ message=lambda:
+ f"{grpc._simple_stubs.ChannelCache.get()._test_only_channel_count()} channels remain"
+ )
+
+ def test_unary_stream(self):
+ with _server(grpc.local_server_credentials()) as port:
+ target = f'localhost:{port}'
+ for response in grpc.experimental.unary_stream(
+ _REQUEST,
+ target,
+ _UNARY_STREAM,
+ channel_credentials=grpc.local_channel_credentials()):
+ self.assertEqual(_REQUEST, response)
+
+ def test_stream_unary(self):
+
+ def request_iter():
+ for _ in range(_CLIENT_REQUEST_COUNT):
+ yield _REQUEST
+
+ with _server(grpc.local_server_credentials()) as port:
+ target = f'localhost:{port}'
+ response = grpc.experimental.stream_unary(
+ request_iter(),
+ target,
+ _STREAM_UNARY,
+ channel_credentials=grpc.local_channel_credentials())
+ self.assertEqual(_REQUEST, response)
+
+ def test_stream_stream(self):
+
+ def request_iter():
+ for _ in range(_CLIENT_REQUEST_COUNT):
+ yield _REQUEST
+
+ with _server(grpc.local_server_credentials()) as port:
+ target = f'localhost:{port}'
+ for response in grpc.experimental.stream_stream(
+ request_iter(),
+ target,
+ _STREAM_STREAM,
+ channel_credentials=grpc.local_channel_credentials()):
+ self.assertEqual(_REQUEST, response)
+
+ def test_default_ssl(self):
+ _private_key = resources.private_key()
+ _certificate_chain = resources.certificate_chain()
+ _server_certs = ((_private_key, _certificate_chain),)
+ _server_host_override = 'foo.test.google.fr'
+ _test_root_certificates = resources.test_root_certificates()
+ _property_options = ((
+ 'grpc.ssl_target_name_override',
+ _server_host_override,
+ ),)
+ cert_dir = os.path.join(os.path.dirname(resources.__file__),
+ "credentials")
+ cert_file = os.path.join(cert_dir, "ca.pem")
+ with _env("GRPC_DEFAULT_SSL_ROOTS_FILE_PATH", cert_file):
+ server_creds = grpc.ssl_server_credentials(_server_certs)
+ with _server(server_creds) as port:
+ target = f'localhost:{port}'
+ response = grpc.experimental.unary_unary(
+ _REQUEST, target, _UNARY_UNARY, options=_property_options)
+
+ def test_insecure_sugar(self):
+ with _server(None) as port:
+ target = f'localhost:{port}'
+ response = grpc.experimental.unary_unary(_REQUEST,
+ target,
+ _UNARY_UNARY,
+ insecure=True)
+ self.assertEqual(_REQUEST, response)
+
+ def test_insecure_sugar_mutually_exclusive(self):
+ with _server(None) as port:
+ target = f'localhost:{port}'
+ with self.assertRaises(ValueError):
+ response = grpc.experimental.unary_unary(
+ _REQUEST,
+ target,
+ _UNARY_UNARY,
+ insecure=True,
+ channel_credentials=grpc.local_channel_credentials())
+
+ def test_default_wait_for_ready(self):
+ addr, port, sock = get_socket()
+ sock.close()
+ target = f'{addr}:{port}'
+ channel = grpc._simple_stubs.ChannelCache.get().get_channel(
+ target, (), None, True, None)
+ rpc_finished_event = threading.Event()
+ rpc_failed_event = threading.Event()
+ server = None
+
+ def _on_connectivity_changed(connectivity):
+ nonlocal server
+ if connectivity is grpc.ChannelConnectivity.TRANSIENT_FAILURE:
+ self.assertFalse(rpc_finished_event.is_set())
+ self.assertFalse(rpc_failed_event.is_set())
+ server = test_common.test_server()
+ server.add_insecure_port(target)
+ server.add_generic_rpc_handlers((_GenericHandler(),))
+ server.start()
+ channel.unsubscribe(_on_connectivity_changed)
+ elif connectivity in (grpc.ChannelConnectivity.IDLE,
+ grpc.ChannelConnectivity.CONNECTING):
+ pass
+ else:
+ self.fail("Encountered unknown state.")
+
+ channel.subscribe(_on_connectivity_changed)
+
+ def _send_rpc():
+ try:
+ response = grpc.experimental.unary_unary(_REQUEST,
+ target,
+ _UNARY_UNARY,
+ timeout=None,
+ insecure=True)
+ rpc_finished_event.set()
+ except Exception as e:
+ rpc_failed_event.set()
+
+ t = threading.Thread(target=_send_rpc)
+ t.start()
+ t.join()
+ self.assertFalse(rpc_failed_event.is_set())
+ self.assertTrue(rpc_finished_event.is_set())
+ if server is not None:
+ server.stop(None)
+
+ def assert_times_out(self, invocation_args):
+ with _server(None) as port:
+ target = f'localhost:{port}'
+ with self.assertRaises(grpc.RpcError) as cm:
+ response = grpc.experimental.unary_unary(_REQUEST,
+ target,
+ _BLACK_HOLE,
+ insecure=True,
+ **invocation_args)
+ self.assertEqual(grpc.StatusCode.DEADLINE_EXCEEDED,
+ cm.exception.code())
+
+ def test_default_timeout(self):
+ not_present = object()
+ wait_for_ready_values = [True, not_present]
+ timeout_values = [0.5, not_present]
+ cases = []
+ for wait_for_ready in wait_for_ready_values:
+ for timeout in timeout_values:
+ case = {}
+ if timeout is not not_present:
+ case["timeout"] = timeout
+ if wait_for_ready is not not_present:
+ case["wait_for_ready"] = wait_for_ready
+ cases.append(case)
+
+ for case in cases:
+ with self.subTest(**case):
+ self.assert_times_out(case)
+
+
+if __name__ == "__main__":
+ logging.basicConfig(level=logging.INFO)
+ unittest.main(verbosity=2)
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/ya.make b/contrib/libs/grpc/src/python/grpcio_tests/ya.make
index 09ee7f2fb5e..b0642eae345 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/ya.make
+++ b/contrib/libs/grpc/src/python/grpcio_tests/ya.make
@@ -1,13 +1,13 @@
PY3TEST()
-LICENSE(Apache-2.0)
+LICENSE(Apache-2.0)
+
+LICENSE_TEXTS(.yandex_meta/licenses.list.txt)
+
+PEERDIR(
+ contrib/libs/grpc/python
+)
-LICENSE_TEXTS(.yandex_meta/licenses.list.txt)
-
-PEERDIR(
- contrib/libs/grpc/python
-)
-
NO_LINT()
PY_SRCS(
@@ -28,7 +28,7 @@ PY_SRCS(
tests/unit/_cython/test_utilities.py
tests/unit/_exit_scenarios.py
tests/unit/_from_grpc_import_star.py
- tests/unit/_rpc_test_helpers.py
+ tests/unit/_rpc_test_helpers.py
tests/unit/_server_shutdown_scenarios.py
tests/unit/_signal_client.py
tests/unit/_tcp_proxy.py
@@ -76,7 +76,7 @@ TEST_SRCS(
tests/unit/_channel_ready_future_test.py
# FLAKY
# tests/unit/_compression_test.py
- tests/unit/_contextvars_propagation_test.py
+ tests/unit/_contextvars_propagation_test.py
tests/unit/_credentials_test.py
tests/unit/_cython/_cancel_many_calls_test.py
tests/unit/_cython/_channel_test.py
@@ -87,7 +87,7 @@ TEST_SRCS(
tests/unit/_cython/_server_test.py
tests/unit/_cython/cygrpc_test.py
tests/unit/_dns_resolver_test.py
- tests/unit/_dynamic_stubs_test.py
+ tests/unit/_dynamic_stubs_test.py
tests/unit/_empty_message_test.py
tests/unit/_error_message_encoding_test.py
tests/unit/_exit_test.py
@@ -102,8 +102,8 @@ TEST_SRCS(
tests/unit/_metadata_test.py
tests/unit/_reconnect_test.py
tests/unit/_resource_exhausted_test.py
- tests/unit/_rpc_part_1_test.py
- tests/unit/_rpc_part_2_test.py
+ tests/unit/_rpc_part_1_test.py
+ tests/unit/_rpc_part_2_test.py
tests/unit/_server_shutdown_test.py
# tests.testing
# tests/unit/_server_ssl_cert_config_test.py